Hi all!
I have a question for you, if I may:
My goal is to have a 128K PRG / 16K CHR game made, with 16K banked at $8000-$BFFF ($C000-$FFFF is fixed).
I have the Mapper control byte at #%00001100. This is my RESET VECTOR:
What I don't know, is how to arrange the .BANKs in my source file.
Do I start this way:
(which doesn't make sense to me because it is out of order)
Or like this:
I have this link that gives an example on how to do the actual bank switch: https://wiki.nesdev.com/w/index.php/Programming_MMC1
Seems simple enough.
I have to say, bank switching on the Atari 7800 is so simple. You just write the bank number to any address from $8000-$BFFF. That's all.
Thank you for your help!
Bob
I have a question for you, if I may:
My goal is to have a 128K PRG / 16K CHR game made, with 16K banked at $8000-$BFFF ($C000-$FFFF is fixed).
I have the Mapper control byte at #%00001100. This is my RESET VECTOR:
Code:
RESET:
SEI ; DISABLE IRQS
CLD ; DISABLE DECIMAL MODE
LDA #$80 ; THIS LOCKS THE PRG ROM AT $C000-$FFFF TO THE LAST BANK.
STA $8000
LDX #$40
STX $4017 ; DISABLE APU FRAME IRQ
LDX #$FF
TXS ; SET UP STACK
INX ; NOW X = 0
STX $2000 ; DISABLE NMI
STX $2001 ; DISABLE RENDERING
STX $4010 ; DISABLE DMC IRQS
SEI ; DISABLE IRQS
CLD ; DISABLE DECIMAL MODE
LDA #$80 ; THIS LOCKS THE PRG ROM AT $C000-$FFFF TO THE LAST BANK.
STA $8000
LDX #$40
STX $4017 ; DISABLE APU FRAME IRQ
LDX #$FF
TXS ; SET UP STACK
INX ; NOW X = 0
STX $2000 ; DISABLE NMI
STX $2001 ; DISABLE RENDERING
STX $4010 ; DISABLE DMC IRQS
What I don't know, is how to arrange the .BANKs in my source file.
Do I start this way:
Code:
.BANK 0
.ORG $C000
(program code & data)
.BANK 1
.ORG $E000
(program code & data)
.BANK 2
.ORG $8000
(data)
.BANK 3
.ORG $A000
(data)
.BANK 4
.ORG $8000
(data)
.BANK 5
.ORG $A000
(data)
(etc.)
.ORG $C000
(program code & data)
.BANK 1
.ORG $E000
(program code & data)
.BANK 2
.ORG $8000
(data)
.BANK 3
.ORG $A000
(data)
.BANK 4
.ORG $8000
(data)
.BANK 5
.ORG $A000
(data)
(etc.)
(which doesn't make sense to me because it is out of order)
Or like this:
Code:
.BANK 0
.ORG $8000
(data)
.BANK 1
.ORG $A000
(data)
.BANK 2
.ORG $C000
(program code & data)
.BANK 3
.ORG $E000
(program code & data)
.BANK 4
.ORG $8000
(data)
.BANK 5
.ORG $A000
(data)
(etc.)
.ORG $8000
(data)
.BANK 1
.ORG $A000
(data)
.BANK 2
.ORG $C000
(program code & data)
.BANK 3
.ORG $E000
(program code & data)
.BANK 4
.ORG $8000
(data)
.BANK 5
.ORG $A000
(data)
(etc.)
I have this link that gives an example on how to do the actual bank switch: https://wiki.nesdev.com/w/index.php/Programming_MMC1
Seems simple enough.
I have to say, bank switching on the Atari 7800 is so simple. You just write the bank number to any address from $8000-$BFFF. That's all.
Thank you for your help!
Bob