diff --git a/lib/lib_28sf0x0.asm b/lib/lib_28sf0x0.asm new file mode 100644 index 0000000..698d376 --- /dev/null +++ b/lib/lib_28sf0x0.asm @@ -0,0 +1,23 @@ +TRIGGER_FORMAT_28SF equ $30 +C_FORMAT_28SF equ $30 +C_BYTE_PROG_28SF equ $10 +flashoppreamble + pha + lda #C_BYTE_PROG_28SF + scc + lda #C_FORMAT_28SF ; only if c set +flashoppreamble_acc ; 28SF0x0 + sta $d500,x ; can be any address + sta $a000; command: FORMAT/ID_MODE/BYTE_PROG, any address + rts +flash_unlockchip + sta $D500,x + ; read from 1823H, 1820H, 1822H, 0418H, 041BH, 0419H, 041AH + lda $B823 + lda $B820 + lda $B822 + lda $A418 + lda $A41B + lda $A419 + lda $A41A + rts diff --git a/lib/lib_29f0x0.asm b/lib/lib_29f0x0.asm new file mode 100644 index 0000000..d6d12e5 --- /dev/null +++ b/lib/lib_29f0x0.asm @@ -0,0 +1,36 @@ +TRIGGER_FORMAT_29F equ $10 +C_FORMAT_29F equ $80 +C_BYTE_PROG_29F equ $a0 +flashoppreamble_29F + pha + lda #C_BYTE_PROG_29F + scc + lda #C_FORMAT_29F ; only if c set + sta command_ZP + pla + .byte {bit.w} +flashoppreamble_acc_29F ; 39sf0x0, 29F040 + sta command_ZP + txa + pha + ; when write byte x must be set to either 0 or 40 temporarily + and #$40 + tax + sta $d502,x + mva #$aa $b555 ; $5555<$aa + sta $d501,x + mva #$55 $aaaa ; $2aaa<$55 + ; $5555<$80 + sta $d502,x + mva command_ZPff $b555; will become command: FORMAT/ID_MODE/BYTE_PROG + cmp #C_FORMAT_29F + bne @+ ; if not FORMAT, procedure finishes + ; FORMAT part, more to write + sta $d502,x + mva #$aa $b555 ; $5555<$aa + sta $d501,x + mva #$55 $aaaa ; $2aaa<$55 +@ pla + tax +flash_unlockchip_29F + rts diff --git a/lib/lib_29sf0x0.asm b/lib/lib_29sf0x0.asm new file mode 100644 index 0000000..23d326b --- /dev/null +++ b/lib/lib_29sf0x0.asm @@ -0,0 +1,33 @@ +TRIGGER_FORMAT_29SF equ $10 +C_FORMAT_29SF equ $80 +C_BYTE_PROG_29SF equ $a0 +flashoppreamble_29SF + pha + lda #C_BYTE_PROG_29SF + scc + lda #C_FORMAT_29SF ; only if c set + sta command_ZP + pla + .byte {bit.w} +flashoppreamble_acc_29SF ; 29sf040 + sta command_ZP + txa + pha + ; when write byte x must be set to either 0 or 40 temporarily + and #$40 + tax + sta $d500,x + mva #$aa $a555 ; $555<$aa + mva #$55 $a2aa ; $2aa<$55 + ; $555