I've got this code, but at start up the sprite tiles are loaded into both sides of the PPU and also the palette is all messed up. the palette fixes itself once you start the game but the tiles are still only the sprites on both sides. Also i'm setting the iNes header byte 0x0006 to $11 (or $12, not sure which is correct, both cause the same issue)
Code:
InitMMC:
LDA #080h ; reset mapper
STA $FFFF ;
lda #$00 ; init mapper register 3 with $00
ldx #$E0
jsr UpdateMMC
ldx #$A0 ; init mapper register 1 with $00
jsr UpdateMMC
lda #%00000110 ; init mapper register 0 with $06
ldx #$80
jsr UpdateMMC
jmp $8000
; UpdateMMC subroutine
; Expects:
; A = control value
; X =
; $80 - mapper control
; $A0 - chr bank 1 control
; $C0 - chr bank 2 control
; $E0 - prg bank control
; Uses:
; $00 - LSB for mapper control addr
; $01 - MSB " " " "
UpdateMMC:
stx $01 ; write MSB to mem addr
ldy #$00 ; set y to 00
sty $00 ; write y to LSB
ldx #$05 ; counter = 5
loop: ; start loop:
sta ($00),y ; store bit into mapper
lsr a ; right shift acc
dex ; decrease counter
bne loop: ; if counter != 0 goto loop:
rts
LDA #080h ; reset mapper
STA $FFFF ;
lda #$00 ; init mapper register 3 with $00
ldx #$E0
jsr UpdateMMC
ldx #$A0 ; init mapper register 1 with $00
jsr UpdateMMC
lda #%00000110 ; init mapper register 0 with $06
ldx #$80
jsr UpdateMMC
jmp $8000
; UpdateMMC subroutine
; Expects:
; A = control value
; X =
; $80 - mapper control
; $A0 - chr bank 1 control
; $C0 - chr bank 2 control
; $E0 - prg bank control
; Uses:
; $00 - LSB for mapper control addr
; $01 - MSB " " " "
UpdateMMC:
stx $01 ; write MSB to mem addr
ldy #$00 ; set y to 00
sty $00 ; write y to LSB
ldx #$05 ; counter = 5
loop: ; start loop:
sta ($00),y ; store bit into mapper
lsr a ; right shift acc
dex ; decrease counter
bne loop: ; if counter != 0 goto loop:
rts
Quote from: Disch on February 02, 2008, 06:51:42 pm
you're not using my mapper docs? ;_;
hehe, just teasing. Kevtris' docs are great.
hehe, just teasing. Kevtris' docs are great.
i'm using both but his was a little more verbose on the area i was asking about
i used your docs to pick the mapper though hehe
Author

btw which is the correct iNes header value? 11 or 12? it seems like it should be 11 right? now i gotta work on actually expanding it 
now i just need to figure out how to do the prg switching. switching the chr pages was tricky cause you have to shift the page number to the left before sending (where it's then shifted right a whole bunch lol)