nesdev.com
http://forums.nesdev.com/

Bank Switching
http://forums.nesdev.com/viewtopic.php?f=10&t=885
Page 5 of 5

Author:  Guyver [ Fri Sep 01, 2017 4:49 am ]
Post subject:  Re: Bank Switching

No one will help? :oops:

Author:  na_th_an [ Fri Sep 01, 2017 5:44 am ]
Post subject:  Re: Bank Switching

bank switching in MMC1 is nothing like bankswitching in UNROM. You have to write the bits sequentially. Check the wiki!

Author:  Guyver [ Sat Sep 02, 2017 2:14 pm ]
Post subject:  Re: Bank Switching

I can not write the working code for NESASM3 example (cyoammc1)... :cry: Could you help with the working code? It is for this example.
I beg you to help, I almost made my game. And I lack only the correct code for switching banks of graphics. I can not write the code myself. I've already tried it ..

Author:  na_th_an [ Sun Sep 03, 2017 11:48 pm ]
Post subject:  Re: Bank Switching

Have you tried the code snippets? there's nothing more to it, I mean, it's pretty straightforward, it's just:

Code:
  lda #<VALUE>   ; vertical mirroring, fixed $C000, 8 KB CHR pages
  sta <REG>  ; (use $0F instead for horizontal mirroring)
  lsr a
  sta <REG>
  lsr a
  sta <REG>
  lsr a
  sta <REG>
  lsr a
  sta <REG>


Where <REG> is the register address you want to write <VALUE> to. You can check the port addresses and what to write to them here http://wiki.nesdev.com/w/index.php/MMC1

You first set up everything writing to port $8000 (mirroring a bank mode). You can change your CHR ROM banks individually using $A000 and $C000, and you can set your PRG bank writing to port $E000.

Author:  Guyver [ Mon Sep 04, 2017 3:31 am ]
Post subject:  Re: Bank Switching

Help me to insert the code here:

http://forums.nesdev.com/download/file.php?id=9998

It will take you 1 minute. (You will spend more time if you try to explain to me how to do it). :roll:

Do you think I have not tried to do this? I can not do it. Help me please not by advice, but by working example. I wrote - I can not do anything on my own. (Forgive me if I do not write clearly, I know English very badly ...)

I could give my own project, but there all the comments are in Russian. I built my game based on the example from NESASM3.

Author:  na_th_an [ Tue Sep 05, 2017 4:13 am ]
Post subject:  Re: Bank Switching

Sorry, I don't use NESASM3, nor really code in assembly, nor have the time to try and understand a whole bunch of assembly code written by somebody else :)

I understood you want to page in bank 13 to copy CHR data to CHR-RAM, so paging in bank 13 of PRG in MMC1:

Code:
  lda #13   ; Set bank 13
  sta $E000  ; $E000 = set PRG bank.
  lsr a
  sta $E000
  lsr a
  sta $E000
  lsr a
  sta $E000
  lsr a
  sta $E000

Author:  Guyver [ Tue Sep 05, 2017 6:20 am ]
Post subject:  Re: Bank Switching

Alas ... This code does not work for me in this rom. :?

In my example:

Code:
  .inesprg 8   ; 8x 16KB PRG code = 128KB
  .ineschr 0   ; 0x  8KB CHR data = CHR RAM
  .inesmap 1   ; mapper 1 = MMC1


Graphics are taken from the penultimate bank. And I do not know how to change the bank of graphics to another one or add one more and switch him.

Author:  na_th_an [ Mon Sep 11, 2017 2:58 am ]
Post subject:  Re: Bank Switching

This is a CHR-RAM board, so you have to page in the bank with the graphics and copy them to VRAM via $2006/$2007 writes. The code I posted is for the first part (page in a PRG-ROM bank). You have then top copy the pattern data to the VRAM.

Learn about CHR-RAM here http://wiki.nesdev.com/w/index.php/CHR_ ... to_CHR_RAM

Page 5 of 5 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/