It is currently Tue Nov 21, 2017 12:40 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 68 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: Mon Feb 27, 2006 12:07 am 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3484
Location: Indianapolis
If you do use 32kB banks, you'd have a copy of the code in the same place in every bank (including the reset vector). Or in RAM.

And SUROM I think uses one of the extra CHR page select bits for PRG.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 27, 2006 3:36 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2136
Location: Minneapolis, Minnesota, United States
Oh, I suppose you're right about the small routine thing. Yeah, I agree that that'd be alot better.

But when you're working on a project such as the one I'm working on, you NEED bankswitching. I'm working on a HUGE RPG, and when you get sucked into a battle, you'll want to switch banks, of course. And there'll be banks with enemy data in them that you'll want to copy data to RAM from, so bankswitching is absolutely neccisary.

Okay, I'm sorry, but really didn't understand what you guys were talking about by a copy of the same code in each bank in the same place when using 32k PRG banks. When you switch 32k PRG banks, is it like, you switch from bank 0 and 1 to 2 and 3 or something? Or like 0 and 1 to 4 and 5, or something like that? And you said that with SUROM they use one of the extra CHR bits to switch banks. How can you just manipulate the registers to use the CHR bits to bank switch? That doesn't make any sense. Please explain, if you will :).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 28, 2006 1:47 am 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3484
Location: Indianapolis
Celius wrote:
Okay, I'm sorry, but really didn't understand what you guys were talking about by a copy of the same code in each bank in the same place when using 32k PRG banks. When you switch 32k PRG banks, is it like, you switch from bank 0 and 1 to 2 and 3 or something? Or like 0 and 1 to 4 and 5, or something like that?


You switch from any bank, to any bank. The point to having code at the same address is so you can just jump or JSR to it from any bank. What I did in that code on one program was keep track of the current bank, push it on the stack, set the new bank and JSR to the (banked) subroutine, then comes back, restores the old bank, and RTS's back to wherever.

Quote:
And you said that with SUROM they use one of the extra CHR bits to switch banks. How can you just manipulate the registers to use the CHR bits to bank switch? That doesn't make any sense. Please explain, if you will :).


It's just a matter of wiring on the board. They hooked one of the pins from the mapper up to the PRG instead of CHR chip, bankswitching output bits are just latched bits (basically one bit of memory) that could be hooked up to whatever.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 28, 2006 3:34 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2136
Location: Minneapolis, Minnesota, United States
Okay, so when using 32k banks, you can have 512k of PRG right? Because this is neccissary for my project. And it's just for bankswitching right? Like you still have 16k banks, but you switch 32k at a time? Or what?

And how would you code a game that runs with SUROM to use the 2 CHR bits to do bankswitching?

EDIT: Also, I don't know if JSRing to banks is that neccissary. I think that having a routine like this:

Code:
.org $8000
  jmp +

  ldx #5
;This is a routine that was jumped to with the value #$02 in A
- sta $E000
  lsr a
  dex
  bne -

+
 ;whatever code you want here


I'd have that at the beggining of every bank, so I could jmp to it with a specific value in A so it would switch banks. But I should have a routine that takes saved High/Low adresses and jumps to them. That'd be helpful.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 28, 2006 6:25 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3950
There was also a pirate MMC3 variant that uses the CHR bankswitcher to switch which 512k the MMC3 sees, so it can have up to 1024k PRG (with 8k chr ram). Fceu emulates it on standard mmc3, other emulators don't.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 03, 2006 2:03 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7272
Location: Chexbres, VD, Switzerland
SUROM is needed for 512kb. No matter if you use 32kb or 16kb banks. If you use 32kb, the lowest bankswitching bit is "forced" to be zero, no matter how it actually is. So switch the 32kb bank 2 (or 3, no matter) in $8000-$ffff will switch the 16kb bank 2 in $8000-$bfff and 16kb bank 3 in $c000-$fffff. In my opinion, using 32kb bank is crazy in most cases, except if you're doing very tricky tricks, and I'll think to only use 16kb banks if I were you. I really ask how most Rare games does to use only 32kb bankswitching.

But, it's up to you to plan your own bankswitching strategies to get a larger rom. You don't have to think the most tricky it is, the best it is, because it isn't. If using SOROM, a particular bit in MMC1 reg 2 or reg 3 sets the MSB of bankswitching, so you'll need to upload 2 MMC1 regs when bankswitching. It isn't very complicated. Also, you won't need destroy a Dragon Warrior 3 or 4 card to get a real SUROM board fortunately. You can modify a simple Zelda cart to have a SUROM configuration.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 03, 2006 1:41 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19238
Location: NE Indiana, USA (NTSC)
Bregalad wrote:
In my opinion, using 32kb bank is crazy in most cases, except if you're doing very tricky tricks, and I'll think to only use 16kb banks if I were you. I really ask how most Rare games does to use only 32kb bankswitching.

GNROM, BNROM, and the Color Dreams board also have 32 KB PRG bankswitching. As long as you're not using DMC, it's easy to work around the bankswitching limitation using jump tables in RAM or jump tables duplicated through the last 1 KB of each PRG bank.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 03, 2006 1:56 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7272
Location: Chexbres, VD, Switzerland
Yeah, it is do-able, but it still is much easier to work with one hardwired bank, I think. 32kb banks maybe allow you to place all data and code related together in the same bank.
For example, you'll have 32kb with all maps and all code that do something with the maps, 32kb with all music and you music replay code, 32kb with all text of the games and all programm that shows text, etc...
If you want more than 32kb, you'll have to be very tricky.
In a standard configuration, you'd rather have data in the bankswitched part and code in the hardwired place, OR have both code and data bankswitched.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 03, 2006 3:20 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2136
Location: Minneapolis, Minnesota, United States
Thanks for replies. But I'm just wondering if 32k banks are neccissary for SUROM? Do you NEED 32k banks for SUROM? If not, how would you CODE MMC1 to use the CHR bits for bankswitching?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 03, 2006 4:35 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19238
Location: NE Indiana, USA (NTSC)
No, you don't need to use 32 KB banks with the high bit mappers, but it'd be wise to have mapper init code in each "fixed" bank.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 04, 2006 10:51 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7272
Location: Chexbres, VD, Switzerland
Celius wrote:
Thanks for replies. But I'm just wondering if 32k banks are neccissary for SUROM? Do you NEED 32k banks for SUROM? If not, how would you CODE MMC1 to use the CHR bits for bankswitching?

Read this again :
Quote:
--------------------------------------------------------------------------------

SUROM is needed for 512kb. No matter if you use 32kb or 16kb banks. If you use 32kb, the lowest bankswitching bit is "forced" to be zero, no matter how it actually is. So switch the 32kb bank 2 (or 3, no matter) in $8000-$ffff will switch the 16kb bank 2 in $8000-$bfff and 16kb bank 3 in $c000-$fffff. In my opinion, using 32kb bank is crazy in most cases, except if you're doing very tricky tricks, and I'll think to only use 16kb banks if I were you. I really ask how most Rare games does to use only 32kb bankswitching.


If you don't understand ask about what you don't understand and don't just re-ask the whole question.
Any I don't see what you mean by coding the MMC1. You just have to make sure to understand that one bits of the MMC1 registers that normally apply to CHR selection bits is the upper bit of the PRG-ROM selection value, and if you want more deail read the wiki or hack Dragon Warrior 3.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 04, 2006 5:52 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2136
Location: Minneapolis, Minnesota, United States
Oh! So because you're using CHR RAM, and have 0 CHR banks, if you write to the CHR switching bit, it'll swap PRG instead of CHR banks?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 04, 2006 7:14 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19238
Location: NE Indiana, USA (NTSC)
No, it's because the SUROM board is wired differently, such that the CHR high address pins go to PRG instead of CHR.

CHR RAM games using the MMC1 can be reconstructed from iNES files as follows:
  • Mapper 1, no CHR ROM, PRG ROM 16-256 KB => SNROM
  • Mapper 1, no CHR ROM, PRG ROM 512 KB => SUROM


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 04, 2006 7:41 pm 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2136
Location: Minneapolis, Minnesota, United States
Okay, I'm going to ask my question, hopefully for the last time, but way clearer.

How is one supposed to code a game that runs with SUROM, and have it run on an emulator? I know you can rewire it on an actual cartridge, but how do you make it run via an emulator? How do you tell the ROM to use the CHR bit for PRG bankswitching? You can't just magicly have the ROM use the CHR bit for switching PRG banks, you have to do something to the ROM to have it do that. What is that something?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 04, 2006 7:45 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1392
Celius wrote:
How do you tell the ROM to use the CHR bit for PRG bankswitching?


You make the PRG ROM 512KB long. Seriously, this is how most (if not all) emulators support the NES-SUROM board when presented as iNES mapper 1.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


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  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 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