It is currently Fri Oct 19, 2018 5:02 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 56 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
PostPosted: Fri Sep 28, 2018 9:41 pm 
Offline
User avatar

Joined: Sat Sep 07, 2013 2:59 pm
Posts: 1708
I want to convert my current game from a MMC-1 with 256 KB to MMC-1 with 512 KB.
I did all the changes that I think are needed, but the game doesn't start anymore.

This is what I did:

I changed the fifth value in the NES header from 16 to 32:
Code:
.segment "HEADER"
   .byte "NES", $1A
   .byte 32
   .byte 0
   .byte %00010010

I added new memory and segment entries in the config file.

Those are the corresponding original values:

Code:
PRG_ROM_BANK_0:   type = ro, start = $8000, size = $4000, file = %O, fill = yes;
...
PRG_ROM_BANK_14:  type = ro, start = $8000, size = $4000, file = %O, fill = yes;
PRG_ROM_BANK_FIX: type = ro, start = $C000, size = $4000, file = %O, fill = yes;
Code:
BANK_0_RESET:   load = PRG_ROM_BANK_0,   type = ro;
...
BANK_14_RESET:  load = PRG_ROM_BANK_14,  type = ro;
BANK_FIX_RESET: load = PRG_ROM_BANK_FIX, type = ro;
Code:
BANK_0_VECTORS:   load = PRG_ROM_BANK_0,   type = ro, start = $BFFA;
...
BANK_14_VECTORS:  load = PRG_ROM_BANK_14,  type = ro, start = $BFFA;
BANK_FIX_VECTORS: load = PRG_ROM_BANK_FIX, type = ro, start = $FFFA;

Here, I put bank 15-30 between 14 and fix.

Same with the code itself.

Original versions:

Code:
.segment "BANK_0_RESET"
   RESET_START
...
.segment "BANK_14_RESET"
   RESET_START
.segment "BANK_FIX_RESET"
Reset:
   RESET_START
Code:
.segment "BANK_0_VECTORS"
   .addr Nmi, Reset, 0
...
.segment "BANK_14_VECTORS"
   .addr Nmi, Reset, 0
.segment "BANK_FIX_VECTORS"
   .addr Nmi, Reset, 0

I added bank 15-30 between bank 14 and bank fix.

By the way, RESET_START is a macro that contains this code:
Code:
.macro RESET_START
   SEI
   CLD
   LDX #$40
   STX ApuFrameCounter
   LDX #$FF
   TXS
   STX $8000
.endmacro

All in all, the version with 16 banks works fine. But with 32 banks, it doesn't even start.

So, what else do I need to add, so that the code works?

_________________
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg


Top
 Profile  
 
PostPosted: Fri Sep 28, 2018 10:01 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6893
Location: Canada
The MMC1 mapper was only designed to do 256k normally. The 5th bit of the "PRG" register actually controls PRG-RAM enable, not PRG banking. The high bit of 512k PRG select was achieved by reusing a line from the CHR banking registers on some boards. It's a terribly overloaded situation, unfortunately. You might find emulators that won't even use the high bit like that without a CRC match.


Top
 Profile  
 
PostPosted: Sat Sep 29, 2018 5:00 am 
Offline
User avatar

Joined: Sat Sep 07, 2013 2:59 pm
Posts: 1708
Well, there are two non-obscure, American MMC-1 cartridges with 512 KB PRG ROM: "Dragon Warrior III" and "IV".

So it looks like MMC-1 512 KB mappers were not only used by some unknown company in games that nobody remembers, but this mapper type actually exists inside the list of the popular, famous titles.

So, should I stick with MMC-1 and check how to change the code accordingly?
Or should I switch to MMC-3?

_________________
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg


Top
 Profile  
 
PostPosted: Sat Sep 29, 2018 5:19 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10901
Location: Rio de Janeiro - Brazil
DRW wrote:
At least there are two non-obscure, American MMC-1 cartridges with 512 KB PRG ROM: "Dragon Warrior III" and "IV", so it's not like this was only used by some unknown company.

Yes, but it's still a hack. They repurposed a CHR address line to select between 2 256KB of a 512KB PRG chip, so the result is more like a multicart with 2 256KB MMC1 programs that can switch to each other.

If you stick to the MMC1, you have to design your program around that model. One solution is to use one of the 256KB halves mostly for graphics and audio, so you don't need to jump back and forth during game logic.

Quote:
So, should I stick with MMC-1 and check how to change the code accordingly?
Or should I switch to MMC-3?

I'm not a big fan of the MMC1 anyway, so I think this would be a huge upgrade. In addition to the much improved memory mapping capabilities, you'll get a decent scanline counter that'll open a world of possibilities for raster effects.


Top
 Profile  
 
PostPosted: Sat Sep 29, 2018 5:46 am 
Offline
User avatar

Joined: Sat Sep 07, 2013 2:59 pm
Posts: 1708
O.k., I'll switch to MMC-3 then.

Since my game is a top-down action adventure like "Zelda", raster effects aren't really necessary, but I can finally abolish sprite 0 for the nametable switch when a dialog box is open.

Also, my graphics artist can then do animated backgrounds.

_________________
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg


Top
 Profile  
 
PostPosted: Sat Sep 29, 2018 5:49 am 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20674
Location: NE Indiana, USA (NTSC)
rainwarrior wrote:
The MMC1 mapper was only designed to do 256k normally. The 5th bit of the "PRG" register actually controls PRG-RAM enable, not PRG banking. The high bit of 512k PRG select was achieved by reusing a line from the CHR banking registers on some boards. It's a terribly overloaded situation, unfortunately.

I don't see what you mean by "overloaded" in this case. In all MMC1 boards with 4 Mbit PRG ROM, A18 on the program is connected to the mapper's CHR A16 output.

rainwarrior wrote:
You might find emulators that won't even use the high bit like that without a CRC match.

Anyone know which emulators these might be, so that I can file a bug should Holy Mapperel fail?

Again, the biggest reason to stick with MMC1 is if your cart manufacturer charges more for the larger CPLD that can hold an MMC3. Have you received quotes from manufacturers?

Animated backgrounds don't technically need MMC3, as you can stuff tiles into CHR RAM during idle vblank time. The Curse of Possum Hollow does this because only 16 tiles of each background can be animated (in 2 groups of 8, one group per vblank).


Top
 Profile  
 
PostPosted: Sat Sep 29, 2018 5:56 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10901
Location: Rio de Janeiro - Brazil
DRW wrote:
O.k., I'll switch to MMC-3 then.

If that doesn't cause any supply or cost issues, I think that's a great decision.

Quote:
Since my game is a top-down action adventure like "Zelda", raster effects aren't really necessary, but I can finally abolish sprite 0 for the nametable switch when a dialog box is open.

Some may associate "raster effects" with "parallax effects", but dialog boxes and status bars are also considered raster effects. Maybe you'll think of something else to do in-game.

Quote:
Also, my graphics artist can then do animated backgrounds.

Those are always pretty cool.


Top
 Profile  
 
PostPosted: Sat Sep 29, 2018 8:11 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7548
Location: Chexbres, VD, Switzerland
We already have had a discussion about this exact same subject 2 weeks ago. Please research before asking.


Top
 Profile  
 
PostPosted: Sat Sep 29, 2018 9:08 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6893
Location: Canada
tepples wrote:
I don't see what you mean by "overloaded" in this case.

I mean the textbook definition of "overloaded" in a programming context.

tepples wrote:
rainwarrior wrote:
You might find emulators that won't even use the high bit like that without a CRC match.

Anyone know which emulators these might be, so that I can file a bug should Holy Mapperel fail?

I haven't tested it, but this comment in FCEUX's source is suggestive.


Top
 Profile  
 
PostPosted: Sat Sep 29, 2018 9:40 am 
Offline
User avatar

Joined: Sat Sep 07, 2013 2:59 pm
Posts: 1708
Bregalad wrote:

Do you remember when I told you that you have a habit of trying to put me down? This is another one of those examples.

Do you seriously expect me to find a single post within a larger thread that is called "More MMC1 CHR bankswitching woes" when I have a question about increasing the number of PRG ROM banks of an MMC-1 ROM?

Yeah, sounds doable. I always read every post in every thread on this forum. How could I not stumble upon this information buried in a thread about CHR-related issues? :roll:

_________________
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg


Top
 Profile  
 
PostPosted: Sat Sep 29, 2018 10:06 am 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20674
Location: NE Indiana, USA (NTSC)
rainwarrior wrote:
tepples wrote:
rainwarrior wrote:
You might find emulators that won't even use the high bit like that without a CRC match.

Anyone know which emulators these might be, so that I can file a bug should Holy Mapperel fail?

I haven't tested it, but this comment in FCEUX's source is suggestive.

Based on my reading of that code, it still figures offs_16banks correctly, though artifacts from using 4K mode with different values for bit 4 might not be emulated. I just tested a Holy Mapperel SUROM build in FCEUX and confirmed that it worked. I think the comment was just describing misuse of the WRAM disable bit as an extra PRG bank bit.


Top
 Profile  
 
PostPosted: Wed Oct 03, 2018 12:09 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7548
Location: Chexbres, VD, Switzerland
I originally didn't intend to answer, as I don't necessarly like getting political, but as it seems from DRW's signature he's selling games I can't refrain from commenting. We the forum users help everyone for free, and you are probably making profit from this help, but you still complain and act relatively aggressively. This behavior is not inclining people to help you. Now I can already forsee you aggressively defend your cause and so on, but I just won't care; I'm just pointing things out, I don't care about being right or wrong or anything, and I don't like getting political anymore.

DRW wrote:
Do you remember when I told you that you have a habit of trying to put me down? This is another one of those examples.

I don't know why you're taking it personally, but I don't normally behave differently towads different forum users. I would have said the exact same with anyone else. If you are taking this as a personal attack or anything you're probably paranoid, since this is neither personal nor an attack. I simply wrote a helpful post about extensions of MMC1 less than a month ago, I'm linking to it (and other people discussing the subject) rather than typing everything down again. How's that bad in any way ? Sometimes if I clearly remember a discussion having already taken place I could even link to post from 10 years ago too. There's no point in discussing the same thing over and over again if a clear explanation is already there for free.

Besides, you mentioned your game doesn't start but you didn't explain the efforts you made debugging with FCEU or Nintendulator in order to see where your game crashed, so not pointing to the reail problem.

Quote:
Do you seriously expect me to find a single post within a larger thread that is called "More MMC1 CHR bankswitching woes" when I have a question about increasing the number of PRG ROM banks of an MMC-1 ROM?

Yes, I expect people to follow the forums, but I fully agree the thread title is irrelevant to the subject being discussed in this case; this happens regularly though and is unavoidable as discussions tends to derail.


Top
 Profile  
 
PostPosted: Wed Oct 03, 2018 3:21 am 
Offline
User avatar

Joined: Sat Sep 07, 2013 2:59 pm
Posts: 1708
Bregalad wrote:
We the forum users help everyone for free, and you are probably making profit from this help, but you still complain and act relatively aggressively.

I don't complain about people who help me. But I can complain about snarky comments that don't help me.

I'm grateful for rainwarrior's and tokumaru's help because they told me exactly what the issue is.
You, on the other hand, merely told me "Please research before asking." And your link merely repeated what has already been answered by the ther two guys, so I didn't even need this link in that moment anymore. Hence, your help in this situation was exactly zero.

My gratefulness always depends on the actual contents of the posts. Just because person A helped me doesn't mean that I have to be grateful towards person B, you know?

Bregalad wrote:
There's no point in discussing the same thing over and over again if a clear explanation is already there for free.

Linking to another thread is fine. Complaining that the poster should have found it himself isn't, especially when it's not even obvious that this specific thread is about this specific topic.

Bregalad wrote:
Besides, you mentioned your game doesn't start but you didn't explain the efforts you made debugging with FCEU or Nintendulator in order to see where your game crashed, so not pointing to the reail problem.

And that's a problem why exactly?
Sure, if someone does some obscure things in his code, then you can ask him what exactly he did. But I merely added more banks and someone immediately recognized that MMC1 simply doesn't support this number of banks, period.
So, what exactly are you even complaining about? That I didn't list all the things that I've done that wouldn't have made a difference anyway?

Again: My problem's answer lies not in any code bugs that I accidentally made, but in the simple fact that the mapper isn't built for that size.
The wiki page says 512 KB and you write five bits to the mapper, but the 512 KB only refers to some hacky workaround of which I never even knew that it can be a thing in the first place. So, my confusion after trying to add more banks and the game not working anymore wasn't something that was easily avoidable, but it was something that's easily answerable by anybody who knows a bit about the MMC1.

Bregalad wrote:
Quote:
Do you seriously expect me to find a single post within a larger thread that is called "More MMC1 CHR bankswitching woes" when I have a question about increasing the number of PRG ROM banks of an MMC-1 ROM?

Yes, I expect people to follow the forums, but I fully agree the thread title is irrelevant to the subject being discussed in this case; this happens regularly though and is unavoidable as discussions tends to derail.

Oh, so you're not only expecting people to read every MMC1 thread because one of the 50 threads where this word appears might have this very answer. You expect people to read every thread because even a thread called "Scrolling issues" could have the desired MMC1 answer somewhere on page 17 of 25.
This premise is even more ridiculous.


And that's everything that I have to say about this.

_________________
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg


Top
 Profile  
 
PostPosted: Wed Oct 03, 2018 5:08 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7548
Location: Chexbres, VD, Switzerland
Quote:
Again: My problem's answer lies not in any code bugs that I accidentally made, but in the simple fact that the mapper isn't built for that size.
The wiki page says 512 KB and you write five bits to the mapper, but the 512 KB only refers to some hacky workaround of which I never even knew that it can be a thing in the first place

Oh I totally did not understand that, this changes everything. I assumed you knew about SUROM quirck but couldn't make it work and asked how. So I was definitely wrong from the beginning - my apologizes.


Top
 Profile  
 
PostPosted: Wed Oct 03, 2018 6:32 am 
Offline
User avatar

Joined: Sat Sep 07, 2013 2:59 pm
Posts: 1708
Well, I explained in detail what I tried, didn't I?
Quote:
I want to convert my current game from a MMC-1 with 256 KB to MMC-1 with 512 KB.
[...]
This is what I did:
I changed the fifth value in the NES header from 16 to 32
[...]
I added new memory and segment entries in the config file.
[...]
Same with the code itself.
[...]
All in all, the version with 16 banks works fine. But with 32 banks, it doesn't even start.

This way, it was clear that I didn't know anything about any specific quirks and the unusual way to implement a 512 KB MMC1 ROM, but that I simply just tried to extend the game from 256 KB to 512 KB, in the same way that someone would extend a 128 KB MMC1 ROM to 256 KB.

Or, as you said it yourself:
Bregalad wrote:
Please research before asking.

_________________
Available now: My game "City Trouble".
Website: https://megacatstudios.com/products/city-trouble
Trailer: https://youtu.be/IYXpP59qSxA
Gameplay: https://youtu.be/Eee0yurkIW4
German Retro Gamer article: http://i67.tinypic.com/345o108.jpg


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

All times are UTC - 7 hours


Who is online

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