Page 2 of 2
Posted: Thu Feb 05, 2009 10:30 am
by d4s
Hamtaro126 wrote:
d4s wrote:
Putting the cpu into emulation mode and a sep #$30 should be enough.
That is also a very wise thing that I could have for NES to SNES conversion, since 6502 is emulated that way
I have to be honest here, I never actually tried to port a NES game to SNES, I just believe that this should at least execute the code correctly. I'd imagine that the biggest gripe would be adapting NES raster code to work correctly.
A total rewrite of these using HDMA would probably be the way to go here. The SNES doesn't have hardware sprite/bg collision detection built-in, so you'd have a hard time directly porting that kind of code, anyway.
Hamtaro126 wrote:
And Is the official SNES docs illegal to distribute? If not, Does the official NES2GBC doc have to go in RHDN? I am confused!
I'm sure it's not legal, as this is confidential Nintendo material.
Posted: Thu Feb 05, 2009 2:23 pm
by Hamtaro126
d4s wrote:Hamtaro126 wrote:
d4s wrote:
Putting the cpu into emulation mode and a sep #$30 should be enough.
That is also a very wise thing that I could have for NES to SNES conversion, since 6502 is emulated that way
I have to be honest here, I never actually tried to port a NES game to SNES, I just believe that this should at least execute the code correctly. I'd imagine that the biggest gripe would be adapting NES raster code to work correctly.
A total rewrite of these using HDMA would probably be the way to go here. The SNES doesn't have hardware sprite/bg collision detection built-in, so you'd have a hard time directly porting that kind of code, anyway.
For Sprite 0 hits, Disch gave me a little ASM example using IRQ in place of Sprite 0. It uses one RAM byte in $B8 (and include $B9 if 16 bit)
In NMI:
set $B8 to #$00, change Sprite 0 hit detection from STA $2002 to STA $B8 then make IRQ Init code, now redirect to the main NMI stuff with RTI at the end
In IRQ:
set $B8 to #$40, then disable/acknowlage IRQ. RTI it
Posted: Thu Feb 05, 2009 5:43 pm
by cybertron
Phew, Romhacking is back up. That developer manual is really interesting! Should be required reading. Maybe a Soviet spy took it...
Has anyone ported a NES game before? I would imagine it would be really difficult as you would have to re-write most of it
I know someone ported Sonic 1 to the 32X, but thats a whole different concept.
Posted: Thu Feb 05, 2009 5:54 pm
by MottZilla
Porting a NES game to SNES is not hard if you have the source code. Most of the code can stay the same, the differences will be three things. Audio, Graphics, and Memory Mapping. Simple NES games that are NROM have been hacked by various groups to run on SNES without any access to source.
Posted: Thu Feb 05, 2009 6:50 pm
by Memblers
I always wanted to be able to hack my sound emulator into those hacked-up ports. Maybe I'm optimistic, but I don't think it would be hard to make an NES PPU emulator for SNES. Replace register writes with JSRs and have at it.
The real fun would come though, with any cycle-timed PPU tricks (I'd just forget about it). Bankswitching would be a chore.
Sound part is done, except for DPCM.
Posted: Fri Feb 06, 2009 12:14 am
by Hamtaro126
I am going to contact the people under development of WLA-DX to see if the lables can be fixed like explaned last time, or it's unportable!
Posted: Fri Feb 06, 2009 2:57 am
by Bregalad
Sound part is done, except for DPCM.
Mmh, it seemed that the noise part needed some serious optimization. You should probably use noise simples with a lockup table for pitch instead of using SPC-700's noise, so that you can get the 2 loop lenght proprely.
The real fun would come though, with any cycle-timed PPU tricks (I'd just forget about it). Bankswitching would be a chore.
The SNES features both raster IRQ and HDMA which can handle all of this very easily. Games that use, say, MMC3 IRQs could be redirected to raster IRQ on the SNES, and those who does loop to do wavy effects could store the result of the loop in a buffer that would be sent on HDMA next frame (needs a 1-frame delay). Altough each game would have to be hacked manually.
Simple NES games that are NROM have been hacked by various groups to run on SNES without any access to source.
I'm interested to see that, but I didn't see that anywhere. Link please ?
Posted: Fri Feb 06, 2009 3:40 pm
by Memblers
Bregalad wrote:Sound part is done, except for DPCM.
Mmh, it seemed that the noise part needed some serious optimization. You should probably use noise simples with a lockup table for pitch instead of using SPC-700's noise, so that you can get the 2 loop lenght proprely.
Oh, I did forget about that. Even Chibi-Tech's song in the intro, which was even arranged for that intro, used the looped noise. That's so blatantly wrong, heheh.
I don't think it could ever sound right because of the samplerate and especially the SNES's sample format (loop alignment is comparable to making looped DPCM instruments on NES - not as bad though). But it could at least sound similar, I'll keep that in mind if I ever end up working on it again.
The real fun would come though, with any cycle-timed PPU tricks (I'd just forget about it). Bankswitching would be a chore.
The SNES features both raster IRQ and HDMA which can handle all of this very easily. Games that use, say, MMC3 IRQs could be redirected to raster IRQ on the SNES, and those who does loop to do wavy effects could store the result of the loop in a buffer that would be sent on HDMA next frame (needs a 1-frame delay). Altough each game would have to be hacked manually.
I think that would work too, the danger is that the SNES is 2X faster than the NES, so if those 224+ writes include much workload, then it'll be too late. I can see $2006 writes being a problem, $2005 should be doable though. HIRQ could go every scanline (or maybe 2) to change the indexing for the emulated PPU write buffer while it's being created.
Posted: Fri Feb 06, 2009 5:57 pm
by Memblers
Bregalad wrote:Simple NES games that are NROM have been hacked by various groups to run on SNES without any access to source.
I'm interested to see that, but I didn't see that anywhere. Link please ?
Look under AS.
http://www.theesa.com/
Also, Arkanoid right above those.
[No links to romz sitez please. --MOD]