Author Topic: Mega Man 1 on the PC Engine  (Read 358 times)

peonpiate

  • Newbie
  • *
  • Posts: 19
Mega Man 1 on the PC Engine
« on: September 28, 2009, 06:48:19 AM »
Hey, im a long time periodic lurker on these boards whenever im bored at work [which is often]. Anyways I stumbled across this thread today at Retrogaming-Roundtable.

http://www.digitpress.com/forum/showthread.php?t=136463

According to that thread someone managed to convert MM1 to play on a PC-Engine, I didnt really believe it at first but I tried the rom out in Magic Engine and it does work. Its 100% MM1, the only bug that I could see was the sounds were off a tad on the standard 'blaster weapon megaman uses [I played through MM1 on nes about 4 times so far]. Besides that its flawless, and even has no slowdown from what i could tell during my short playthrough of metal man's stage.

Anyways...im curious as to how its really possible, I know there are a few other conversions out there like Mario bros, but is the PCE really emulating anything ? I have used quite a few emulators before and I dont see how a 7.6mhz cpu can emulate a 1.6mhz one, on a PC emulating a 3mhz cpu can be rough on a 1ghz system. Also I wonder if its possible that some of the higher end games could be converted to PCE, such as Mario 3 and the like...

Figured some people might want to chew on this abit =p anyways it got the inner geek in me going.

Necromancer

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 21374
Re: Mega Man 1 on the PC Engine
« Reply #1 on: September 28, 2009, 07:11:48 AM »
Mega Man and Castlevania were brought to the Turbo by resident coder Tom (click here for a bit about the conversions). 

Anyways...im curious as to how its really possible, I know there are a few other conversions out there like Mario bros, but is the PCE really emulating anything ? I have used quite a few emulators before and I dont see how a 7.6mhz cpu can emulate a 1.6mhz one, on a PC emulating a 3mhz cpu can be rough on a 1ghz system.


Keep in mind that the NES's CPU is based on the 6502 and the TG-16's CPU is based on the 65C02 (upgraded 6502), so the Turbo doesn't have to translate each instruction like a computer does.  Hopefully, Tom will come along and provide a little more info.
U.S. Collection: 98% complete    157/161 titles

peonpiate

  • Newbie
  • *
  • Posts: 19
Re: Mega Man 1 on the PC Engine
« Reply #2 on: September 28, 2009, 07:40:50 AM »
Thanks for the link, I didnt realize he was poster of here [I should have though considering its PCE stuff]. Take this thread as more of a bump than anything in that case, since its pretty interesting and maybe some more info can be found out.

Tom

  • Guest
Re: Mega Man 1 on the PC Engine
« Reply #3 on: September 28, 2009, 09:29:14 AM »


Quote
Anyways...im curious as to how its really possible, I know there are a few other conversions out there like Mario bros, but is the PCE really emulating anything ? I have used quite a few emulators before and I dont see how a 7.6mhz cpu can emulate a 1.6mhz one, on a PC emulating a 3mhz cpu can be rough on a 1ghz system. Also I wonder if its possible that some of the higher end games could be converted to PCE, such as Mario 3 and the like...

Figured some people might want to chew on this abit =p anyways it got the inner geek in me going.

 PC emulation today is geared for extreme accuracy. Every little pixel flickering on a scanline (you know, like status windows and such), etc. My approach and goal is different, of course. As long as I can get the all the game logic to fit within frame (1/60 second) like it would on the real NES, then the gameplay is identical - minus any removal of slowdown. The PCE is running the original game/logic code at 7.16mhz. There's no emulation of the CPU itself since the PCE CPU is about 99.99% backwards compatible - as long as the game doesn't try to use illegal opcodes or the jump indirect bug of the original 6502. So that part is taken care of. While the video is completely different on the NES than the PCE, everything from format to regs to tilemaps layouts/etc, what they do have in common is they are both tile/tilemap and sprite based systems (although the format and sizes are different). So I can used the PCE's VDC (video display controller) for video acceleration. It also helps out a TON that the PCE allows access to vram during active display and that the NES does not. On a PC, you would do it pixel by pixel and in software - for accuracy. There are some mismatches like the NES having 8x8 sprites, but the PCE doesn't. It has 16x16 sprites. So I have to waste a whole 16x16 sprite to store this 8x8 NES sprite. This also means games like Megaman will have the same sprite flicker/drop out as the original NES. If an NES game uses 8x16 sprite sizes, then flicker is reduced. Megaman doesn't, but Castlevania does and thus has reduced flicker. Anyway, I optimized the hell out of the PCE video and audio emulation code. The only other optimization layer I could add would be self modifying code and it's not going to add much speed increase to what I already have. For sound, my audio emulation code isn't as complete as I would like it. Trying to emulate NES audio quirks and such is a pain and I haven't emulated everything about the NES audio hardware/regs either. It needs some work.

 In reality, it would be better to hack the original game's routines for tilemap/tiles/sprites/audio to use PCE native format. But that would be a lot a work and fairly complex. Not that my method isn't complex, but it is like 95% directly reusable for other similar projects. I was able to get Castlevania, SMB, RoboWarrior up and running/playable in 6-8 hours by reusing code from Megaman. And, it's not like a hacker can't still replace the NES hardware routines with native PCE ones if they decided to 'upgrade' these PCE projects. PCE hardware is actually more straight forward than NES.

esteban

  • Hero Member
  • *****
  • Posts: 24063
Re: Mega Man 1 on the PC Engine
« Reply #4 on: September 28, 2009, 09:57:33 AM »
Wow, that's pretty kool to add Mega Man 1 to the NES games running on PCE hardware :).

I should get one of those flash cards to play ROMs on real hardware.


Quote
This also means games like Megaman will have the same sprite flicker/drop out as the original NES. If an NES game uses 8x16 sprite sizes, then flicker is reduced. Megaman doesn't, but Castlevania does and thus has reduced flicker.

Thanks for the explanation. It makes me dream of "enhanced" versions of NES games :)

TANGENT: By the way, remember all those posts from magicengine (documenting the "hidden" data in CD games)... this was a few years ago... were they saved / documented outside of magicengine's forums? Thanks in advance.

« Last Edit: September 28, 2009, 10:05:54 AM by esteban »
  |    | 

peonpiate

  • Newbie
  • *
  • Posts: 19
Re: Mega Man 1 on the PC Engine
« Reply #5 on: September 28, 2009, 11:02:03 AM »
I did notice the flickering but chopped it up to being something that cant be worked around, losing the slowdown was nice though.

Besides that its cool you got this working, I dont think to many people know the Nes is so close to the PCE that it can be hacked to run alot of its games. I did to an extent but thought it was only the most basic games like Mario bros/Duck hunt. If i could do it myself Id work on River city ransom [semi request =p].


ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: Mega Man 1 on the PC Engine
« Reply #6 on: September 28, 2009, 11:36:53 AM »
TANGENT: By the way, remember all those posts from magicengine (documenting the "hidden" data in CD games)... this was a few years ago... were they saved / documented outside of magicengine's forums? Thanks in advance.


If you mean a few unused pictures, I managed to extract a few from Sylphia, and made a slideshow.  These were probably "sample" pictures and code that came with the Hu7CD development environment.


http://www.disgruntleddesigner.com/chrisc/data/HiddenPics.zip

esteban

  • Hero Member
  • *****
  • Posts: 24063
Re: Mega Man 1 on the PC Engine
« Reply #7 on: September 28, 2009, 11:54:44 AM »
TANGENT: By the way, remember all those posts from magicengine (documenting the "hidden" data in CD games)... this was a few years ago... were they saved / documented outside of magicengine's forums? Thanks in advance.


If you mean a few unused pictures, I managed to extract a few from Sylphia, and made a slideshow.  These were probably "sample" pictures and code that came with the Hu7CD development environment.


http://www.disgruntleddesigner.com/chrisc/data/HiddenPics.zip


Yes, that was awesome (actually, I didn't look at it yet).

Still, I remember your stuff :) The images from Gradius II (?) are ingrained in my brain (Bigfoot, Japanese dude with an expression of "Yay!" on his face, etc.)  That is your stuff, correct? It has been years...  :)

My faulty brain has jumbled everything together.

Sad but true.
  |    | 

termis

  • Hero Member
  • *****
  • Posts: 1485
Re: Mega Man 1 on the PC Engine
« Reply #8 on: September 28, 2009, 01:21:30 PM »
If i could do it myself Id work on River city ransom [semi request =p].


peonpiate

  • Newbie
  • *
  • Posts: 19
Re: Mega Man 1 on the PC Engine
« Reply #9 on: September 28, 2009, 02:42:38 PM »
I left it out of my earlier post, but i know of that port...Its good but I prefer the Nes version even though the graghics and sound are worse. The gameplay just feels better in it to me.

Tatsujin

  • Hero Member
  • *****
  • Posts: 12311
Re: Mega Man 1 on the PC Engine
« Reply #10 on: September 28, 2009, 03:01:57 PM »
Thanks for the link, I didnt realize he was poster of here

Here's the houly place of every PCE Obeyer. so sure our brother Tom mustn't be absent from our guild.
www.pcedaisakusen.net
the home of your individual PC Engine collection!!
PCE Games coundown: 690/737 (47 to go or 93.6% clear)
PCE Shmups countdown: 111/111 (all clear!!)
Sega does what Nintendon't, but only NEC does better than both together!^^