Not sure if this is the correct sub forum. http://pcedev.blockos.org/viewtopic.php?f=5&t=15 http://pcedev.blockos.org/viewtopic.php?f=5&t=21 They're PCE flash cart friendly ;-)
Instead of porting individual games, thought of working on a low spec emulator a la PocketNES? Does the PCE use wait states when reading from ROM in 7 MHz mode? If not, I think that could be possible with minimal hooking of NES registers, graphics preprocessing (CHR ROM only I guess) before the games start.
Awesome work. I didn't expect to see this so soon. Mega Man works very well. The only thing that seems to be off is when the screen transitions where the NES turns off the PPU, the PCE doesn't blank out the screen so you see some garbage or you see the actual updates happening. In castlevania it seemed like when you get to the first door, you see it update the BG in collums. I haven't look at your source code package but I plan to do that. I'm guessing it's fairly easy to do simple games that just bank alittle bit of PRG and only have 8K of CHR RAM or ROM. There's alot of games that fit into that simple category too. You must really like the PC-Engine (who could blame ya?) and it makes me wish I still had my PCE DUO system. Ofcourse I'd need a Flash Cartridge too. Edit: So looking at your source, could I take another UNROM game and just do as you did and patch all of the register writes like you did for Mega Man and it should assemble a ROM that should run? Curious because, Contra is another UNROM game that's pretty popular.
Calpis, how could the PC-Engine do something like PocketNES? I don't think the PC-Engine has very much RAM like you have on the GBA. I think you pretty much have to patch the roms before making your PCE ROM. Anyway, as I said on the PCEDEV forum, I used your framework and tweaked my NES emulator a bit and got Contra running on the PC-Engine. No control input or sound yet though. It also seems 8x16 sprites are unsupported or I made an error somewhere.
Well PocketNES runs on only a 16 MHz ARM and can't natively run the code, so a 7 MHz 65C02 should be capable of handling HLE in real time at similar performance, that's what these ports are doing anyway without the speedhacks. I just think would be more interesting for the core code to become a universal emulator. RAM isn't a really an issue unless we're talking about save RAM, since WRAM and VRAM with room to spare can fit into PCE's 8K, but for save RAM there's always the CDROM's backup RAM. PCE also uses two tile formats for sprites and background right? That could be a big bottleneck but I think it's all doable.
Well I meant that, you have to patch the program rom to run it natively. So you have to do that before hand, you can't do that on the PCE itself. You are right about there being different formats for sprites and background though. I remember hearing that before. I got Contra responding to control now, except that itself backwards. Left and Right are B and A. Up and Down are Start and Select. Didn't try adding the sound registers but I might as well. Calpis, do you know if PCE supports 8x16 sprites?
Awesome! :icon_bigg If you're using the Megaman source, then yeah it only supports 8x8 sprites. The castlevania code is hardcoded for 8x16 sprites and allows both pattern table banks to be use as sprites, unlike megaman source. If you want, check out mednafen as it has a really awesome PCE debugger to get a visual on how the sprites are laid out in vram. But yeah, you've notived that I haven't allowed the PPU to be turned off. Both games are still a WIP and as such, there's a slight behavior problem that sometimes the NES code doesn't turn on the display in time for the PCE's active display (it's a variable thing). For instance in Megaman a few frames in the beginning of vertical scrolling would cause a few black frames (display off). Since the PCE is converting all the NES code PPU writes in real time, it extends the vblank code (it helps that the PCE allows the coder to write to VRAM at anytime of the display - active or not). I plan to remedy this by having the PCE code issue the vblank flag in the PPU reg at a early point of the display instead of at the point of the PCE's end of active display. This will give more vblank time (the NES code is running 3.5-4 times as fast so it's more than likely that it's arriving at the the vblank wait loop pretty early on). I might also move the PPU emulation/convertion code into ram for some self modifying optimizations and possibly buffer the display on/off writes to the PPU if it comes to that. If any of those solutions are needed inconjunction with moving the vblank flag on an early scanline. As for joypad, I actually just replace the games read routine with a hook, then write to whatever memory address the game expects the original joypad routine to write to. It was just easier to do, but requires each game to have a custom routine writen for it. I have plans to do some MMC1 games and VROM games (Dragon Warrior was the first MMC1 & VROM game that I did for this type of project). I also have worked out how to implement dynamic switching of H and V mirrroring. Zelda II BS here I come :love2: PCE smallest sprite cell is 16x16. All sprites are padded to that size on the fly when written to vram(pattern table address location). For 8x8 sprites, I have to adjust the X/Y positions for flips so they align up correctly. 8x16 sprites only need X correction. I take care of this on the fly in the sprite dma call ($4014).
Well this is all very interesting. I'll be looking into it more. I'm trying a different game than Contra for now. I look forward to any update that allows you to switch Background Table mirroring as that would be useful. I am guessing currently both sources are fixed with Vertical Mirroring. I'd be happy to help hack some games as far as changing registers and such, but I doubt I'd be able to help too much with the PCE specific stuff. Once again I am amazed by the progress you've made.
I'm still learning the quirks and in/outs of the APU unit. Megaman sounds pretty close, but Castlevania has some sound issues. I haven't emulated sweeps yet but I have a feeling that's not what is causing all the artifacts I'm hearing