What Mapper Did Gradius II Repro Use?

A place that you can discuss reproduction of classic titles or "licensed-for-reproduction" homebrew for personal use.

Moderators: B00daW, Moderators

Forum rules
1. NO BLATANT PIRACY. This includes reproducing homebrew less than 10 years old, with the exception of free software.
2. No advertising your reproductions, with the exception of free software.
3. Be nice. See RFC 1855 if you aren't sure what this means.
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

Ofcourse I'd also love to see a Contra (J) conversion to MMC3, because the VRC2b version kicked the ass of the UNROM version.
This is already done.

This is weird, for some reason I was sure that all non-Nintendo mappers weren't doccumented on the wiki. I didn't even check there ;-) I'll try to convert Gradius II to MMC3, but I won't be able to test it on hardware right now because I have no EPROM programmer at this time, I'll have to buy a new one.

EDIT : This whole adress pin swap thing is really confusing, Konami really got nasty here, but I'll still try to do something.
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

Okay, I've spent my day hacking the game to MMC3 with sucess.
I still haven't completed the game as a whole to see if there is scrambled graphics later, but for now I encountered none, I haven't had to change anything in the CHRROM (yet). The game works perfect in all inacurate emulators (including Nesticle !), but I've the two following issues :

- Nintendulator : The status bar is shaking by one pixel for some reason. I cannot find why, I always setup the IRQ at the exact same time during NMI.

- Nestopia : This is the weirdest thing I've ever seen in emulation. The graphics are scrabled at opening for some reason I don't know, they work perfect in any other emulator. But the really weird thing is that as soon as the game starts, graphics are perfect, but the player dies immediately, and again, again until it's game over. There is absolutely nothing to do about this !! This is really the thing that makes we wonder what the f... is happening.

Also the game uses a 2KB SRAM I think so TSROM will be needed at least, I guess. Or add a 2KB RAM on a TLROM board yourself if you want.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

I'll test them on the Powerpak if you like. Ignore my private message about Contra as I replied before reading this. Sweet stuff man. Send me a patch for Gradius 2 and I'll test it out.
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

Okay, I've temporarly updated data of the last 8k PRG bank ($e000-$ffff) here http://jonathan.microclub.ch/contra/gradius2_patch.bin.
To run the game as an iNES ROM just go with an hex editor to offset $1E010, paste this (overwriting previous data), and change the header so that it is mapper 4 and not mapper 25 (so that nobody can call me illegaly distributing the ROM).
I really wonder how it looks on real hardware, status bar is probably shaking, I tried change the timing a bit but I couldn't get rid of this shaking. Tell me if your ship is always destroyed as it is in Nestopia, this is really weird.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

I got the same results on Nestopia as you. Ship dieing always. Also the first screen of the ship had all wrong gfx. Nintendulator didnt have either problem. I'm assuming you know the sprites are messed up. I'm going to try it on the powerpak shortly.

On Powerpak it performs like it does on Nintendulator. The ship doesn't constantly explode. Just the sprites are wrong, and the status bar jumps around a whole bunch. More so when I got past the first space area and where the red fireball planetoids were and was shooting lasers.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Bregalad wrote:To run the game as an iNES ROM just go with an hex editor to offset $1E010, paste this (overwriting previous data), and change the header so that it is mapper 4 and not mapper 25 (so that nobody can call me illegaly distributing the ROM).
Do you know how to work an IPS patcher?
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

tepples wrote: Do you know how to work an IPS patcher?
Yeah but for some reason I didn't want to go though the trouble of making a ips file.

I now played though the whole game (savestates rules !!) and yeah, a lot of sprites are screwed on later levels (comes from the wrong CHR bank), but everything is perfect on the first level, and I don't know how an human person is able to pass it on the real hardware (who lack savestates) even with the 30 lives code. The ending has screwed up graphics as well because the game swaps bg and sprites banks to normal via $2000 (I've made them backwards so that MMC3 IRQ counter works). I don't know if there is any sprites from the BG bank exept the cursor in the secret sound mode. (if there is any during gameplay this may screw IRQs up). Finally I've got the game freeze randomly several time when too much objects are on screen, don't know why (with VirtuaNES).

I guess I could go through the trouble of editing the game's CHRROM in order to work on MMC3, but I fell I've done enough work with this game today.

Anyone is free to try it, for information the games swaps "virtual 8 KB banks", which are consisted of 8 bytes of 1 KB bank. The game have a huge table of 256 bytes (that's 32 "virtual" 8 KB banks) located in the main PRG bank at $EA1D (location in iNES ROM is $1EA2D). Bytes comes in this order : BG part 1, BG part 2, ..., Sprites part 3, sprites part 4. In the MMC3 version sprites part 2 and sprites part 4 are ignored, and are "substitued" by sprites part 1 + 1 and sprites part 3 + 1 instead, which don't always works. I guess one have to try to change the order of the banks, possibly duplicating data so that each numbers in sprite data are consecutive numbers (this can be applied to the original ROM), and thrus re-arrange the CHRROM as needed. Note that I'm unsure if dynamical BG animation is based on this table or not, at the end of the first level the games changes the BG bank used via IRQ, so I guess it's not, it adds or substract from the "normal" bank.

Also if anyone has an idea why a MMC3 IRQ could vary randomly by an amout of one (resulting in a shaking bar) I'm listening. I've got a lot of shaking bars in VirtuaNES, and weirdly when the real bar is shaking it's not in VirtuaNES. So VirtuaNES is always wrong, that's kind of fun.

Finally, I found interesting how Gradius II handles its IRQs. There is always a IRQ triggering at 2 different positions on the screen, regardless of other parameters. Then the IRQs does something like change the CHR banks, or change scrolling to the status bar, only if the main game ordered it so. That's quite of a good idea I think.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

I'm guessing you must have changed the CHR, cause the sprites for me are always messed up with just that 8kb prg change. If you're done with it, and not just done with it for the day, I'd love to see any notes and get a copy of where you are at. I'd like to see the first level with correct sprites.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

Bregalad wrote:I now played though the whole game (savestates rules !!) and yeah, a lot of sprites are screwed on later levels (comes from the wrong CHR bank), but everything is perfect on the first level, and I don't know how an human person is able to pass it on the real hardware (who lack savestates) even with the 30 lives code.
Have you ever watched any DoDonPachi or Espgaluda videos on YouTube? Some people who play scrolling shooters are obse^H^H^H^H dedicated enough to survive that kind of enemy firepower.
User avatar
BMF54123
Posts: 410
Joined: Mon Aug 28, 2006 2:52 am
Contact:

Post by BMF54123 »

Could the exploding ship have anything to do with Konami's infamous copy protection? I don't know if this game has it, but some other games become either much more difficult (Yume Penguin Monogatari) or entirely unplayable (Kid Dracula; enemies and sprite platforms disappear at level 2) if they're tampered with. Kinda weird that it wouldn't happen on other emulators, though.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

BMF54123 wrote:Could the exploding ship have anything to do with Konami's infamous copy protection? I don't know if this game has it, but some other games become either much more difficult (Yume Penguin Monogatari) or entirely unplayable (Kid Dracula; enemies and sprite platforms disappear at level 2) if they're tampered with. Kinda weird that it wouldn't happen on other emulators, though.
Considering the exploding ship fails to happen on the actual NES when I tested, I doubt it's that protection in Nestopia.
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

MottZilla wrote:I'm guessing you must have changed the CHR, cause the sprites for me are always messed up with just that 8kb prg change. If you're done with it, and not just done with it for the day, I'd love to see any notes and get a copy of where you are at. I'd like to see the first level with correct sprites.
I didn't remember changing anything outside of the main PRG bank, but I guess I was wrong, because this was needed to swap pattern tables, I've done an IPS Patch instead (apply on the original Gradius II) hoping you'll get better results.

Note that my original Gradius II ROM has C71D4CE7 as PRG CRC and 537B6F6A as CHR CRC, I don't know if there is any variants floating arround.

I'll try to change the order of CHR banks todays, and that's the only thing left to do, among with fixing that damn shaking status bar, and removing the point where the games sets BG pattern table to 1 again at the ending.
I guess I'll try to figure this out today, but I cannot guarantee anything. Feel free to try change the CHR banks, I've tell above how they function (at least for most part of the game), the game just swaps them in 8 KB chunks made of 8 1KB chunks.

EDIT : I've fixed the exploding ship problem. This was due to SRAM to be disabled by default in Nestopia, and enabled by default with other emus. If there is no SRAM, the ship explodes, Konami is pretty cool.
Last edited by Bregalad on Thu Feb 07, 2008 5:57 am, edited 1 time in total.
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

Okay, guys I have very good news. The hack is 100% finished, and graphics should in theory be 100% intact on MMC3, and that with still 128 KB CHR ROM a bit rearanged (altrough I haven't played through the whole game again yet), status bar is no longer shaking (this was due to the IRQ to be set before the game does it's nametable updates, who caused the counter to ocasionally clock during VBlank !).

I've updated my IPS file, tell me if it works on real hardware, and if it does, I'll update my Contra page to fix the spelling errors and turn it into a dual Contra/Gradius II page.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

There are 2 dumps of Gradius 2 I know of. I'll check if they are that different. I'll also test out the ips patch. I'll edit or post again when I have tested.

Edit: Initial tests with my Gradius 2 (J) show good sprites and all, really everything looked flawless, on Nestopia so far. I will test on Powerpak next. But I compared the alternate dump of Gradius 2. It seems to have a different CHR. CRC32 is 7E31C1D7. That's for the CHR, not the whole rom. Rom name was Gradius 2 (J) [a1].nes

Oddly, the program roms are identical. And there's no visible difference. But i'm not sure if it wouldn't work on it. I'll test it later. But so far it looks like you've done a great job, now I just need a game genie code to help me play through the whole game. ;)

Edit:
From NESTopia

File: Gradius 2 (J).nes
Directory: D:\ROMS\NesFC\Japan\
CRC: 0x5ADBF660
Region: NTSC
Board/Chips: KONAMI VRC4 Y
Mapper: 25
PRG-ROM: 128k, CRC: 0xC71D4CE7
CHR-ROM: 128k, CRC: 0x537B6F6A
Mirroring: Mapper Controlled
Battery: No
Trainer: No
Condition: Good

---

File: Gradius 2 (J) [a1].nes
Directory: D:\ROMS\NesFC\Japan\
CRC: 0x779158DD
Region: NTSC
Board/Chips: KONAMI VRC4 Y
Mapper: 25
PRG-ROM: 128k, CRC: 0xC71D4CE7
CHR-ROM: 128k, CRC: 0x7E31C1D7
Mirroring: Mapper Controlled
Battery: No
Trainer: No
Condition: Good

Both work with the MMC3 ips. Atleast they play into the first level.

About the status bar, it stays where it should, except when there are alot of sprites on screen. Then it will glitch. I'll have to try the original rom to see if that happened in it or not. But it's still perfectly playable. Haven't tried it on Powerpak yet.

GTSVLGLA - Start with 99 Lives
User avatar
Bregalad
Posts: 8055
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Post by Bregalad »

You can do the UUDDLRLRBA code at title screen to get 30 lives, however the game is still almost as hard because you restart back on each live (unlike in Life Force where this code makes the game significantly easier).
About the status bar, it stays where it should, except when there are alot of sprites on screen. Then it will glitch. I'll have to try the original rom to see if that happened in it or not. But it's still perfectly playable. Haven't tried it on Powerpak yet.
Yes. I've noticed this too, I don't know why. At some points, there is sprites from the BG pattern table who accidentally clock the IRQ counter, making the status bar higher. I'm a bit screwed here, either the status bar is wrong, or either I force the sprite to be in the right pattern table, then the status bar will be right but the sprites will look wrong.
Post Reply