+  RHDN Forum Archive
|-+  Romhacking
| |-+  General Romhacking
| | |-+  iNES mapper #19 (Namcot 106) - expansion.
Pages: [1]
Author Topic: iNES mapper #19 (Namcot 106) - expansion.  (Read 1 times)
aishsha
Guest
« on: August 14, 2009, 08:44:46 am »

Hey there. I have a rather peculiar problem with this specific mapper. I've expanded my ROM with KingMike's nflate and it somehow throws 256kb of empty space to the beginning of the ROM just after the header. The question is: how the heck can I calculate bank indexes for switching, if the text starts much further on and it starts with bank index 1?
The whole bank index writing procedure involves 3 indexes (6 banks are emulated as 3 here, as they are switched in pairs). The bank index writing routine looks like this:
Code:
$EE5F:F0 22     BEQ $EE83
$EE61:30 12     BMI $EE75
$EE63:C9 40     CMP #$40
$EE65:B0 1C     BCS $EE83
$EE67:A9 03     LDA #$03
$EE69:8D 38 01  STA $0138 = #$01
$EE6C:20 40 E9  JSR $E940
$EE6F:20 00 80  JSR $8000
$EE72:4C 6C E9  JMP $E96C
$EE75:A9 01     LDA #$01
$EE77:8D 38 01  STA $0138 = #$01
$EE7A:20 38 E9  JSR $E938
$EE7D:20 21 80  JSR $8021
$EE80:4C 6C E9  JMP $E96C
$EE83:A9 06     LDA #$06
$EE85:8D 38 01  STA $0138 = #$01
$EE88:20 4C E9  JSR $E94C
I understand, this is a special case (as KingMike explained in his readme) but how can I use the free space I obtained?
« Last Edit: August 14, 2009, 08:54:31 am by aishsha »
KingMike
Guest
« Reply #1 on: August 14, 2009, 06:53:33 pm »

The games I've hacked with this (Kaiju Monogatarai and Tensai Bakabon) have both used mirrored bank values (writing bank numbers well beyond the physical size of the PRG-ROM).
Does the game still run after expansion?
If so, then it's probably using mirrored values. If it doesn't, then I guess I need to make an update to allow the user to choose if it uses mirrored or normal bankswaps. Smiley
Example: Kaiju Monogatari would write values like $78 to the bankswap registers, even though there were only 16 banks (0 to $F) in the original. So it would do (#$78 AND #$0F) = #$08. My translation had 32 PRG banks (0 to $1F), so it would do (#$78 AND #$1F) = #$18 and write that to the bankswap register.
Although, I don't see the bankswap register writes ($E000-E7FF swaps $8000-9FFF, $E800-EFFF swaps $A000-BFFF, $F000-F7FF swaps $C000-DFFF)
aishsha
Guest
« Reply #2 on: August 14, 2009, 07:23:39 pm »

It's Dream Master and yeah, it runs perfectly. Expansion was from 512 and up to 768kb but we were somehow confused about the way it expanded PRG. And it has the same number of banks as Kaijuu, as I see - from 00 to 0f - but the thing is that all the empty space after expansion was BEFORE the original banks. I mean, header, empty space, original banks with text I want to swap. So if text is somewhere in 50xxx inside the rom, empty chunk begins somewhere at 11-12, then 32xxx and so on. It uses only 3 doubled banks for dialogue text - (2x8kb per each) and it does seem to use direct values. we need to dig in, I guess - thanks for the hint!

UPDATE: Ok, for those interested, the game starts indexing new-formed bank from 10 and further on, starting from the the address 10 where the first new bank starts. So generally, indexing goes as follows inside the rom: 10, 11...1f, 00, 01...0f.
« Last Edit: August 17, 2009, 02:51:02 pm by aishsha »
KingMike
Guest
« Reply #3 on: August 23, 2009, 03:09:13 pm »

This game just doesn't seem to like being expanded.
Even when I expanded the ROM by pasting 2 copies of the PRG followed by the CHR, it still glitches the tilemap.
For some reason, it's suddenly deciding to use single-screen mirroring instead of horizontal.
Changing the mapper in the header to 210 seems to fix it (at least the intro seems to work).
The new banks should be 00...1F, with 20-3F being the original PRG banks.
« Last Edit: August 23, 2009, 03:21:50 pm by KingMike »
aishsha
Guest
« Reply #4 on: August 23, 2009, 04:23:46 pm »

Quote from: KingMike on August 23, 2009, 03:09:13 pm
This game just doesn't seem to like being expanded.
Even when I expanded the ROM by pasting 2 copies of the PRG followed by the CHR, it still glitches the tilemap.
For some reason, it's suddenly deciding to use single-screen mirroring instead of horizontal.
Changing the mapper in the header to 210 seems to fix it (at least the intro seems to work).
The new banks should be 00...1F, with 20-3F being the original PRG banks.
Hmm... It's quite strange 'cause after nflate expansion it seems to work without any problem... But the banks now start with 10,11... then go original 00,01 banks. And the tile map seems to be ok as well... At the moment I only have some problems with moving the text there (I need to make custom pointers) but the text is easily read from new banks. The only peculiarity is that the banks here are seen as 4000 by the program as it switches 'em in pairs...
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC