added libs for memchips

This commit is contained in:
Jakub Husak
2023-01-10 13:53:32 +01:00
parent 10b63eee15
commit dd20cc4592
4 changed files with 128 additions and 0 deletions
+36
View File
@@ -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