I have previously done chr switching using MMC1 mapper and it worked well and good .....here I was using 32 kb switching mode (but I never switched)
But now I want to use 16kb prg bank switching ...
for that, the changes I have made to the previous code [the code in which chr switching is working fine] are :
1)I have generated a .lst file and seen where the first 16 kb of code ends...
then I have cut and pasted the next 16 kb code into other .asm file (two.asm) and the first 16 kb as(one.asm)
2)next I added the bank with the following code and in the first 16 kb file(one.asm)...
Quote:
.base $C000
.incbin "two.asm"
.org $ffff
3)in the mapper initialization I changed to the following :
Quote:
LDX #%00010011
jsr initMMC1Mapper
initMMC1Mapper:
LDA #$80
STA $8000
TXA
JSR setMMC1ControlMode
LDA #$00
JSR setCHRPage0000
LDA #$01
JSR setCHRPage1000
LDA #$01
JSR setPRGBank
RTS
the subroutines writes to the registers.....
3)when I compiled I am getting weird results...
value out of range in the 3rd line of the following added code:
.base $C000
.incbin "two.asm"
.org $ffff
So, please can you say me when does bank actually gets switched for first time ...?? like before the first pass after second...??
please can any one help me regarding the mentioned error...???
thanks in advance..
But now I want to use 16kb prg bank switching ...
for that, the changes I have made to the previous code [the code in which chr switching is working fine] are :
1)I have generated a .lst file and seen where the first 16 kb of code ends...
then I have cut and pasted the next 16 kb code into other .asm file (two.asm) and the first 16 kb as(one.asm)
2)next I added the bank with the following code and in the first 16 kb file(one.asm)...
Quote:
.base $C000
.incbin "two.asm"
.org $ffff
3)in the mapper initialization I changed to the following :
Quote:
LDX #%00010011
jsr initMMC1Mapper
initMMC1Mapper:
LDA #$80
STA $8000
TXA
JSR setMMC1ControlMode
LDA #$00
JSR setCHRPage0000
LDA #$01
JSR setCHRPage1000
LDA #$01
JSR setPRGBank
RTS
the subroutines writes to the registers.....
3)when I compiled I am getting weird results...
value out of range in the 3rd line of the following added code:
.base $C000
.incbin "two.asm"
.org $ffff
So, please can you say me when does bank actually gets switched for first time ...?? like before the first pass after second...??
please can any one help me regarding the mentioned error...???
thanks in advance..