I added in the CDDA track handler code. I wasn’t gonna yet, but (nameless) pointed out to me the playback routine for the game music engine from the NSF file – so I just put a hook in it and … well this is what happened (more or less). No, I don’t have the best selection of tracks. It’s just to show off the feature, really.
Archive for February, 2011
This is the new build:
PLEASE be fare warned that I take no responsibility in what CDR media does to your system. Play it at your own risk.
If you’re a original Duo owner (black model, US or JP), you need to be aware of the “laser parking” issue. While I’ve never seen it happen for a tiny two track setup like this, it doesn’t mean it can’t happen. On the original Duo models, sometimes the laser seeks all the way to the end of the track and past it. It can get stuck there and you have to finger/rotate the gear/track mechanism to get it unstuck. People have theories as to why, but no one knows for sure what the exact problem is. From what I tested years back, media played a very big part. But it wasn’t a single factor. Burn speed (and crappy burners), which is relative and you can’t just applied it to any other brands/models, was an influencing factor too. Burning too fast causes the ‘pit’ edges to become sloppy. This throws off old CD laser as they have a tougher time trying to read them. Certain media don’t reflect enough are just barely adequate for these old CD laser, so you get random failures or skipping(audio) when reading. Others have speculated that if the original Duo laser unit is already on it’s way out, you’re more likely to have the laser parking issue. I can’t really say if that’s true or not, but when I did my tests I didn’t have a brand new out of the box Duo to test with.
The best CD unit that I’ve tested, is the SuperCDROM. That thing is a beast. The original CD, is probably a small step above an original Duo without a new laser replacement. I’ve never tested the later model Duo-Rs, but I’ve heard good things about them. But of all the system, it’s the original Duos that have the laser parking issue. That’s more serious than a simple read or skip issue. Please be aware of it. If you’ve had a new laser replacement for the Duo, I heard this gets rid of the problem.
So I finally figured out the problem after hours of debugging and writing special visual debug feedback. Seems there’s something really strange about the CD base ram. I’ll explain…
In the NES emulator, the NES has ZP and ram mapped to $0000-1fff address range. It’s only 2k, but it’s mirrored. The space right above it isn’t used (open bus I think or possible more mirrored ram). So on the PCE to get the NES code to run natively, you make the *same* ram bank to both pages: $0000 and $2000. The $2000 covers the ZP address and the stack pointer address of the PCE’s processor, but the NES code doesn’t see it as any different. The $0000 area acts as it should. Normally, PCE games map in the hardware bank into MPR 0 or page $0000. But I map bank $ff into page $6000 range. At least for the NES games that don’t use extra onbard sram (I can’t do that for dragon warrior, so I used self modifying code and ST0/ST1/ST2 opcodes for writes. Vram reads are a little slower because I have to swap the bank in and out of some page area).
Anyway, this isn’t a problem for system ram bank $f8. Why don’t I just use that? I could, but I had plans… plans for adding adpcm, loading, cdda playback. For that, there are special address ranges that are reserved for the system card functions. The emulation core would completely destroy them. So I swap in that $f8 when I call a sys card function, but otherwise I use some other ram bank.
So this is where I got into trouble. Apparently (apparently now!) there’s something amidst about that bank of ram. Normally, there’s nothing to think about. I mean, it’s mapped all over the place like normal rom. Nothing is different. And Charles has stated they he’s used the bank $80-87 as page $2000 ram without problems. I on the other hand was getting corruptions in ram. It upgraded a number of games to figure out why. SMB really got my attention. The game actually played, but was really corrupt (raining coins! turtles coming out of the power blocks when you hit them!). Assuming what charles recalls is true, the only difference between his scenario and mine, is that I also have the CD base banks mapped to page $0000 range and was directly accessing them.
wtf? So I mapped in ‘card’ ram. Ram the normally resided on the upgrade card (although on my SuperCDROM 2 it’s just in the unit itself). Voila. Corruption went away in SMB and the other games didn’t crash before the title screen.
Let me tell you, I NEVER saw that coming. Not in a million years. Take heed if you’re a PCE coder. That really is some bullshit.
Also… these CDRs I just bought… are totally shitty. And my new Blu-ray burner is a piece of crap for burning CDRs too.
Hold off on burning the CD image. There’s an issue at the start of the emulator on the real system. I finally got my real hardware back/unpacked and setup, so I’ll be debugging mean time. I’ll post an updated version once I get this figured out (yeah, it works in emulators – but that’s meaningless for the purpose of this project).
Heh, spent about an hour on this today. I’m feeling much better. Man, never been sick for over two weeks straight. Something really kicked my ass ;>_>
Anyway, I implemented display on/off, so now the garbage between screen transitions (that would normally be blank) is gone. I remove the garbage tiles from the top of the screen board too. And finally, I fixed a few audio emulation bugs.
Here’s the updated version: http://www.pcedev.net/nes2pce/Megaman_CD_097.zip
Edit: Opps, I forgot something. I just beat the game on mednafen (0.9.16). I was wondering if any MM1 capable fans can playthrough this game on the real hardware and let me know of any problems. Thanks 😀 Hmm.. I think I’ll make a single CUE/ISO zip with just the game itself (without source) so people can test it out. http://www.pcedev.net/nes2pce/Megaman_CD_gameonly_097.zip
I had this for a while and I recently/quickly cleaned it up: http://www.pcedev.net/nes2pce/Megaman_CD_094.zip
Nothing special, just on CD for those without a flash card that want to play it on the real hardware. There’s also a system card 3.0 warning screen 😀
Guess I’ll update downloads and links section now…