Permalink
Browse files

Initialize the APU a bit more thoroughly

1 parent 7631a07 commit da996b12d69351f6a5fe37f803e58246d7b3f439 @mrehkopf committed Oct 3, 2016
Showing with 6 additions and 3 deletions.
  1. +6 −3 snes/spc700.a65
View
@@ -12,7 +12,7 @@ apu_ram_init:
lda @apu_ram_init_code, x
jsr spc_upload_byte
inx
- cpx #38
+ cpx #43
bne -
ldx #$0002
stx APUIO2
@@ -50,8 +50,11 @@ apu_ram_init_code: ; .org $0002
.byt $ab,$19 ; inc loop2+2
.byt $1d ; dec x
.byt $d0,-11 ; bne loop2
- ; make sure IPL ROM is mapped, reset input latches 0+1
- .byt $8f,$90,$f1 ; mov $f1, #$90
+ ; make sure IPL ROM is mapped, reset input+output registers
+ .byt $20 ; clrp
+ .byt $8f,$b0,$f1 ; mov $f1, #$b0
+ .byt $da,$f4 ; mov $f4, ya (= 0)
+ .byt $da,$f6 ; mov $f6, ya
; Re-run IPL
.byt $5f,$c0,$ff ; jmp $ffc0

0 comments on commit da996b1

Please sign in to comment.