Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.
Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.
(...)
flashoppreamble_39SF ; preserves X
pha
lda #C_BYTE_PROG_39SF
scc
lda #C_FORMAT_39SF ; only if c set
sta command_ZP_39SF
pla
.byte {bit.w}
flashoppreamble_acc_39SF ; 39sf0x0, 29F040
sta command_ZP_39SF
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_ZP_39SF $b555; will become command: FORMAT/ID_MODE/BYTE_PROG
cmp #C_FORMAT_39SF
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
sta $d502,x
mva #$10 $b555 ; $5555<$10
@ pla
tax
flash_lockchip_39SF
flash_unlockchip_39SF
flash_wait_unit_39SF
rts
(...)
START sei
lda #$00
sta DMACTL
sta DMACTLS
lda #$01
sta CRITIC
lda #$EC
sta COLBAKS
sta COLBAK
ldx #$FF
WAIT stx $D5FF
lda TRIG3
sta GINTLK
lda CONSOL
and #$02
bne WAIT
jmp RESETCD