11 March 2016 - Forum Rules
Started by BlackPaladin, March 20, 2023, 10:35:18 PM
03FF86: A2 0B LDX #$0B <- Loads Bank 0B 03FF88: 8A TXA <- Moves X Register to A 03FF89: 20 E3 FF JSR $FFE3 <- Jumps to Bank Switching subroutine 03FF8C: 4C 5F FC JMP $FC5F <- Jumps to $2FC5F in Bank 0B 03FF8F: A2 0F LDX #$0F <- Loads Bank 0F, 03FF91: 8A TXA <- Moves X Register to A 03FF95: 60 RTS <- Ends Routine
03FF8C: 4C 5F FC JMP $FC5F <- Jumps to $2FC5F in Bank 0B
Quote from: Cyneprepou4uk on March 21, 2023, 05:27:43 AMCode Select Expand03FF8C: 4C 5F FC JMP $FC5F <- Jumps to $2FC5F in Bank 0BUnless your mapper is in 32k PRG mode (which is unlikely), you're jumping to the last fixed bank, not to bank 0B.In 16k PRG mode you can swap 8000-BFFF area only.
QuotePRG ROM: 16 x 16KiB = 256 KiB CHR ROM: 0 x 8KiB = 0 KiB ROM CRC32: 0x4e7cad28 ROM MD5: 0x39b549ef5d37dd661c0aeddca2b84c9f Mapper #: 1 Mapper name: MMC1 Mirroring: Horizontal Battery-backed: Yes Trained: No NES2.0 Extensions Sub Mapper #: 0 Total WRAM size: 8 KiB Total VRAM size: 8 KiB WRAM backed by battery: 8 KiB VRAM backed by battery: 0 KiB
Quote from: Cyneprepou4uk on March 21, 2023, 12:32:50 PMSeems that you still don't understand what PRG bankswitching is all about.Basically, CPU can access 0000-FFFF range via memory bus, and not more than that. 8000-FFFF is used for PRG, which is 32k, and CPU can access PRG within that range only (some mappers allow 6000-7FFF as well). However, games can have larger PRG than 32k, and by default CPU cannot access 0x2FC5F or whatever. So by using mappers you can connect different PRG banks to memory bus via their registers.For example, your game allows you to connect 16k banks to 8000-BFFF range. If you connect bank 00 and execute JMP $8000, you will be jumping to 0x00010. If you connect bank 01 and execute the same JMP $8000, this time you will be jumping to 0x04010. Here you can see how after the last write to FFFF register, memory at 8000-BFFF is changing to a different one in Hex Editor. I can "Go Here In ROM File" to see which PRG bank is connected at the moment. At the same time it's still 8000-BFFF for CPU, which means that your instructions must operate with 8000-BFFF range in order to do something with connected bank.Also, your game's mapper configuration connects last 16k of PRG to C000-FFFF, and you can't swap it to another bank. It's called a fixed bank. So your JMP $FC5F will always jump to 0x3FC6C despite what is loaded into 8000-BFFF.A fixed bank is used as a transitional place between bankswitching, because bad things will happen if you execute bank switching code while being in that bankswitching area (unless you know what you're doing). Also it contains common code for other banks in order for them to have a constant access to (math calculations for example). And of course it has interrupt vectors and their handlers. And sometimes DPCM music data.
Page created in 0.131 seconds with 19 queries.