It is currently Thu Sep 21, 2017 10:52 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 68 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject: Re: Bank Switching
PostPosted: Fri Sep 01, 2017 4:49 am 
Offline
User avatar

Joined: Sat Aug 19, 2017 5:47 pm
Posts: 11
Location: Russia, Sinegorie
No one will help? :oops:

_________________
http://famicom.space


Top
 Profile  
 
 Post subject: Re: Bank Switching
PostPosted: Fri Sep 01, 2017 5:44 am 
Offline

Joined: Mon May 27, 2013 9:40 am
Posts: 348
bank switching in MMC1 is nothing like bankswitching in UNROM. You have to write the bits sequentially. Check the wiki!

_________________
http://www.mojontwins.com


Top
 Profile  
 
 Post subject: Re: Bank Switching
PostPosted: Sat Sep 02, 2017 2:14 pm 
Offline
User avatar

Joined: Sat Aug 19, 2017 5:47 pm
Posts: 11
Location: Russia, Sinegorie
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 ..

_________________
http://famicom.space


Top
 Profile  
 
 Post subject: Re: Bank Switching
PostPosted: Sun Sep 03, 2017 11:48 pm 
Offline

Joined: Mon May 27, 2013 9:40 am
Posts: 348
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.

_________________
http://www.mojontwins.com


Top
 Profile  
 
 Post subject: Re: Bank Switching
PostPosted: Mon Sep 04, 2017 3:31 am 
Offline
User avatar

Joined: Sat Aug 19, 2017 5:47 pm
Posts: 11
Location: Russia, Sinegorie
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.

_________________
http://famicom.space


Top
 Profile  
 
 Post subject: Re: Bank Switching
PostPosted: Tue Sep 05, 2017 4:13 am 
Offline

Joined: Mon May 27, 2013 9:40 am
Posts: 348
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

_________________
http://www.mojontwins.com


Top
 Profile  
 
 Post subject: Re: Bank Switching
PostPosted: Tue Sep 05, 2017 6:20 am 
Offline
User avatar

Joined: Sat Aug 19, 2017 5:47 pm
Posts: 11
Location: Russia, Sinegorie
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.

_________________
http://famicom.space


Top
 Profile  
 
 Post subject: Re: Bank Switching
PostPosted: Mon Sep 11, 2017 2:58 am 
Offline

Joined: Mon May 27, 2013 9:40 am
Posts: 348
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

_________________
http://www.mojontwins.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 68 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group