Author Topic: Nes2pce Possible to get more conversions?  (Read 5798 times)

NightWolve

  • Hero Member
  • *****
  • Posts: 5277
Re: Nes2pce Possible to get more conversions?
« Reply #15 on: September 01, 2014, 08:09:30 AM »
Blaster Master?

+1

Thinking of playing that, and now Metroid on a TurboExpress with the 3.5" LCD mod some day. ;)

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Nes2pce Possible to get more conversions?
« Reply #16 on: September 05, 2014, 07:19:00 AM »
The NES games that switch tilemap mirroring randomly, are a current problem for my nes2pce video code. I have an idea of how to handle this without hacking the game engine, but it's a major piece of work. Megaman 2 has this issue, when the screen scrolls for the end game stage map and the intro (unsupported mirror mode switching). Also, you might have noticed that in some games the sprites are offset by 1 pixel when moving with the BG.

 Normally this isn't a concern, as even some PCE games do this, but I do want to fix it - or attempt to reduce this. This is a PCE thing, because the PCE updates the sprite locations/attributes on a fixed schedule (at the start of vblank), where as the NES can do it anywhere in vblank. It doesn't just effect sprites, but moves vblank into the active screen area of the game - giving the PCE more time to translate NES PPU/APU data into PCE data on the fly (better syncing at the start of the next frame, etc). Since in game logic is running 4x the speed, there shouldn't be a problem with this (and in game logic tends to run in active screen for nes game, meaning they aren't touching the video display; i.e. it's running fast). As it is, the PCE is sitting idle for quite a bit of the time during active display. I want to put that idle time to good use. This idea is also complex like the mirroring situation.

 These two upgrades would open up a lot more NES games to be...hackemulated.  Hacmulated? Hamulated? Whatever. Something between HLE and emulation.

Dicer

  • Hero Member
  • *****
  • Posts: 1905
Re: Nes2pce Possible to get more conversions?
« Reply #17 on: December 03, 2014, 08:10:37 AM »
The NES games that switch tilemap mirroring randomly, are a current problem for my nes2pce video code. I have an idea of how to handle this without hacking the game engine, but it's a major piece of work. Megaman 2 has this issue, when the screen scrolls for the end game stage map and the intro (unsupported mirror mode switching). Also, you might have noticed that in some games the sprites are offset by 1 pixel when moving with the BG.

 Normally this isn't a concern, as even some PCE games do this, but I do want to fix it - or attempt to reduce this. This is a PCE thing, because the PCE updates the sprite locations/attributes on a fixed schedule (at the start of vblank), where as the NES can do it anywhere in vblank. It doesn't just effect sprites, but moves vblank into the active screen area of the game - giving the PCE more time to translate NES PPU/APU data into PCE data on the fly (better syncing at the start of the next frame, etc). Since in game logic is running 4x the speed, there shouldn't be a problem with this (and in game logic tends to run in active screen for nes game, meaning they aren't touching the video display; i.e. it's running fast). As it is, the PCE is sitting idle for quite a bit of the time during active display. I want to put that idle time to good use. This idea is also complex like the mirroring situation.

 These two upgrades would open up a lot more NES games to be...hackemulated.  Hacmulated? Hamulated? Whatever. Something between HLE and emulation.

Hopefully these hurdles get leaped over at some point, because more is better :)


seieienbu

  • Hero Member
  • *****
  • Posts: 1989
Re: Nes2pce Possible to get more conversions?
« Reply #18 on: December 03, 2014, 03:03:06 PM »


 These two upgrades would open up a lot more NES games to be...hackemulated.  Hacmulated? Hamulated? Whatever. Something between HLE and emulation.

I like the term Hacmulated.  Megaman 2 is one of my favorite games; it'd be cool to have a Turbo version of it.  Good luck with your hacking!
Current want list:  Bomberman 93

Dicer

  • Hero Member
  • *****
  • Posts: 1905
Re: Nes2pce Possible to get more conversions?
« Reply #19 on: December 03, 2014, 03:35:33 PM »


 These two upgrades would open up a lot more NES games to be...hackemulated.  Hacmulated? Hamulated? Whatever. Something between HLE and emulation.


I like the term Hacmulated.  Megaman 2 is one of my favorite games; it'd be cool to have a Turbo version of it.  Good luck with your hacking!


Then you'll like this... http://pcedev.wordpress.com/downloads-and-links/

seieienbu

  • Hero Member
  • *****
  • Posts: 1989
Re: Nes2pce Possible to get more conversions?
« Reply #20 on: December 03, 2014, 06:52:52 PM »
...looks like tomorrow evening is booked.
Current want list:  Bomberman 93

Keith Courage

  • Hero Member
  • *****
  • Posts: 2690
Re: Nes2pce Possible to get more conversions?
« Reply #21 on: December 05, 2014, 07:15:41 AM »
I second Metroid. It is one amazing game.

Especially if there could be a save feature.
« Last Edit: December 07, 2014, 06:28:50 PM by Keith Courage »

toymachine78

  • Guest
Re: Nes2pce Possible to get more conversions?
« Reply #22 on: December 05, 2014, 07:41:45 AM »
What language do these systems use? Are they the same or different? Are they proprietary code sets or something more mainstream like basic or C or something?

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Nes2pce Possible to get more conversions?
« Reply #23 on: December 05, 2014, 04:19:20 PM »
What language do these systems use? Are they the same or different? Are they proprietary code sets or something more mainstream like basic or C or something?
These games were originally coded assembly, but that doesn't matter since there are no public source code; all these games are in native machine language (compiled/assembled/whatever). The PCE processor is backwards compatible, so it can run the NES code natively. But that's about it - the rest has to emulated, or rather converted on the fly in realtime (mappers, bank switching, sprites, tiles, maps, audio, etc). My code is a bit voodoo, and not a lot of comments (that's an understatement), so it's so easy for others to jump in and use (from what I've been told, but one person did get it working on their own). From my own perspective, the code doesn't really need comments. It's kinda obvious what's going on for a port write/read emulation call. It just takes extensive system knowledge of both systems to be applicable, because the code isn't 100% out of the box reusable for every game. Small tweaks needs to be made here and there for each game (hence the extensive knowledge on both systems mentioned). The tweaks are usually centered around timing and related quirks.

 Anyway, the backend code on the PCE side is Assembly code. The NES roms themselves are still in native binary format; nothing is disassembled. So that's all on the coder to handle whatever. Usually nothing needed to be disassembled, but the port read/writes need to be tracked down and replaced with emulation hooks to the backend code. Personally, I put it at advance level stuff (hacking and programming) - but that really depends on the game itself. At minimum, it's intermediate level skill/knowledge.

 I don't make the source available to the public directly anymore, but to individuals who request it (whole project folder, etc).

NightWolve

  • Hero Member
  • *****
  • Posts: 5277
Re: Nes2pce Possible to get more conversions?
« Reply #24 on: December 05, 2014, 05:12:50 PM »
Have you worked on your incomplete sound emulation code BTW, Tom ? After testing my TurboEverdrive on my Express, I tried your hackulation ROMs like Contra, Castlevania, etc. and I couldn't stand playing them under the condition they're in with terribly distorted background music/sound consisting of bleeps, blips, etc... Renders the game unplayable to me.

Lochlan

  • Sr. Member
  • ****
  • Posts: 408
Re: Nes2pce Possible to get more conversions?
« Reply #25 on: December 05, 2014, 08:10:42 PM »
^From the downloads and links page of pcedev.wordpress.com:

Quote
NES2PCE projects:

- Castlevania 1 ver 0.44 (early beta)
- Contra ver 0.35 (early beta)
- Ducktales 2 ver 0.31 (early beta)
- Robowarrior ver 0.27 (early beta)
- SMB 1 ver 0.21 (early beta)

Note: The above nes2pce stuff have older audio emulation, and will sound off. They haven’t been updated with the newer AUP core yet. Once I get sweep emulation working, I’ll update all of the above roms.

...which I assume is what you're referring to.
I'm not sorry about this, as I'm not sorry about ANY attack by the goverrats.

NightWolve

  • Hero Member
  • *****
  • Posts: 5277
Re: Nes2pce Possible to get more conversions?
« Reply #26 on: December 05, 2014, 08:42:48 PM »
Ah, good to see! So that has been fixed.

toymachine78

  • Guest
Re: Nes2pce Possible to get more conversions?
« Reply #27 on: December 05, 2014, 09:46:49 PM »
What language do these systems use? Are they the same or different? Are they proprietary code sets or something more mainstream like basic or C or something?
These games were originally coded assembly, but that doesn't matter since there are no public source code; all these games are in native machine language (compiled/assembled/whatever). The PCE processor is backwards compatible, so it can run the NES code natively. But that's about it - the rest has to emulated, or rather converted on the fly in realtime (mappers, bank switching, sprites, tiles, maps, audio, etc). My code is a bit voodoo, and not a lot of comments (that's an understatement), so it's so easy for others to jump in and use (from what I've been told, but one person did get it working on their own). From my own perspective, the code doesn't really need comments. It's kinda obvious what's going on for a port write/read emulation call. It just takes extensive system knowledge of both systems to be applicable, because the code isn't 100% out of the box reusable for every game. Small tweaks needs to be made here and there for each game (hence the extensive knowledge on both systems mentioned). The tweaks are usually centered around timing and related quirks.

 Anyway, the backend code on the PCE side is Assembly code. The NES roms themselves are still in native binary format; nothing is disassembled. So that's all on the coder to handle whatever. Usually nothing needed to be disassembled, but the port read/writes need to be tracked down and replaced with emulation hooks to the backend code. Personally, I put it at advance level stuff (hacking and programming) - but that really depends on the game itself. At minimum, it's intermediate level skill/knowledge.

 I don't make the source available to the public directly anymore, but to individuals who request it (whole project folder, etc).
   Thanks for the explanation. I would agree that it would require advanced skill. I have worked with Assembler some at work. Some of our 3M vendor applications are written in assembler, and our older 3270 mapsets for our green screens.

Its definitely not very user friendly or intuitive. I always thought it would be fun to dabble in this on the side. I haven't coded since 2006 though, and I'm rusty. This would prob require more time than I have to commit at the time. 

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Nes2pce Possible to get more conversions?
« Reply #28 on: December 06, 2014, 03:54:11 AM »
   Thanks for the explanation. I would agree that it would require advanced skill. I have worked with Assembler some at work. Some of our 3M vendor applications are written in assembler, and our older 3270 mapsets for our green screens.

Its definitely not very user friendly or intuitive. I always thought it would be fun to dabble in this on the side. I haven't coded since 2006 though, and I'm rusty. This would prob require more time than I have to commit at the time. 
To be honest, it's not really the assembly syntax/language that poses the more complex issues - it's the hardware. Beside a few calculation look-up tables that I use for video addressing, almost all the code is for the emulation backend is nothing fancy. It's everything around the processor. NES video isn't clean in design/interface, and games rely on these weird quirks (you get dumby/pre-buffered data on the first read from vram port, etc). NES programmers turn off the display while in vblank, and this causes a problem for the PCE which doesn't need this. On the PCE if BG/Sprites aren't enabled by the time active display starts on the PCE, it's disabled for the whole screen - you can't turn it back on mid screen. A serious pain in the ass when NES code runs into active display area of the PCE. I had to cache/buffer this for a whole frame on the PCE side, so I could tell the difference between normal vblank code or if the game is really turning off the screen on the NES. I had to test for this case. Stuff like that. While that's working now, everything is still timing sensitive, since the NES code isn't perfectly synced (running) as with a real NES. I mean, it gets re-synced every frame due to v-blank interrupt. Usually not a big deal, but it can cause problems to where you need to tweak or replace some NES specific code (like sprite 0 trick on NES to make fixed status bars). Or some stuff isn't straight up emulated yet because games I worked with hadn't used that feature yet.

 I actually have three main PPU emulation cores that I tweak depending on the game. One is for games that use 8x16 sprites, one is for certain tilemap mirroring, one is for vrom vs vram, etc. I don't emulate everything straight out because the overhead of case checking makes the code slower and more complex. For instances, if I wanted to get Blaster Master up and running, I'd have to make a new PPU core than can handle both 8x16 and 8x8 sprites, because this game switches between these modes (overhead mode VS tank mode). Most NES games don't do this. 8x16 sprites on the NES aren't just large sprites; it also allows sprite cells (access to them) to cross into the BG only cell bank (which otherwise isn't capable of doing in 8x8 mode). It's common for 8x16 sprite cells and BG cells to be in same BG bank, so I have to double write to vram on the PCE to compensate for this; I write/convert the data into two locations in PCE vram (since PCE sprites DO NOT use the same cell format as PCE tiles, like it does on the NES). I could write code to switch between with core to use by testing a PPU reg status bit, but if the game updates vram/vrom BEFORE changing the PPU to this bit - then I won't be able to tell. This is crucial. The game would have to be hacked to fix this timing issue, if this were the case.

 Stuff like that. So the core(s) I wrote are reusable across different games, but they still need to be tailored/tweaked per game. Thus the requirement for both in depth/advance knowledge of NES and PCE. The commenting of my code is the least of the problem ;)

 The negative stuff out of the way, I do have a positive side; upgrades. Since I'm emulating the PPU in realtime, I've actually gone in and expanded the NES PPU capabilities. I took the unused bits in the sprite tables for the PPU, and gave it larger sprites with larger subpalettes. This basically gives a hacker a level of translation for PCE capabilities, but without learning PCE side of the system. So an experienced NES hacker could upgrade something like Megaman 1 or 2 with better graphics, without having to learn the PCE's much different hardware side. And they could write code as if it was on the NES system (6502, typical mapper, etc). But I have yet to get any interested hackers out there though, sadly.

 NightWolve: Yeah, I haven't made public the released the updated audio core for those games. Although they sound better, the lack of sweep emulation still makes them sound broken at parts. Once I get that working, I'll update it. Those games were more of just a proof of concept and practice (those games only took about a day to get up and running). Megaman 1, 2, and Dragon Warrior (unreleased) were tweaked to run as perfect as I could - because I cared more about those games.
« Last Edit: December 06, 2014, 03:57:24 AM by Bonknuts »

VenomMacbeth

  • Hero Member
  • *****
  • Posts: 1837
Re: Nes2pce Possible to get more conversions?
« Reply #29 on: December 06, 2014, 07:21:39 AM »
Soooo how about Recca?
Play Turbografx.
Play the Turbografx. PLAY
THE TURBOGRAFX!!!!!!

Buh buh buh, I have almost all teh games evar.  I R TEH BESTEST COLLECTR!!