Log in

View Full Version : Megaman 1 on your PC-Engine/TG16



tomaitheous
09-24-2009, 09:35 PM
I've had this project for a while now (over a year, but haven't done much since the first few months of work). Figured some of you would get a kick out of this. All the source is there, but I also included a pre-assembled rom "megaman.pce". There's no region protection, so you can play it on PCE or TG16. Have fun...

Download here (http://75.126.152.9/~pcengine/megaman_0.91b.zip)

c0ldb33r
09-24-2009, 10:05 PM
whats with the batch file?

Damaniel
09-24-2009, 10:29 PM
whats with the batch file?

It's used to assemble the source files, assuming you have 'pceas' laying around somewhere.

I have to say I'm very impressed. :) I played with it and thought you did a good job of putting together the game (which I assumed was a well-executed remake), but I'm even more impressed by how you did it -- including simulating NES hardware on a PCE! Are you using the actual ROM for this?

tomaitheous
09-24-2009, 10:43 PM
It's used to assemble the source files, assuming you have 'pceas' laying around somewhere.

I have to say I'm very impressed. :) I played with it and thought you did a good job of putting together the game (which I assumed was a well-executed remake), but I'm even more impressed by how you did it -- including simulating NES hardware on a PCE! Are you using the actual ROM for this?

Yes. It works like this; it's the original NES rom running on the PCE (minus the header of course). The PCE cpu is backwards compatible with the original NES CPU. So the game rom itself is running the original code. All the video and sound is handled via emulation. It's translated into PCE format on the fly/realtime. The PCE isn't fast enough to monitor ports reads/writes, so *all* the hardware port writes are replace with JSRs. As you can see in the main ASM file. A 3 byte JSR opcode nicely replaces a 3byte STA/STX/STY opcode (or LDA/LDX/LDY for reading ports). So it's about 2% hack and 98% emulation. The source it generalized so it can be reused for other projects. I have a few other NES games running on the PCE with minimal additional code/tweaks to the same source.

eastbayarb
09-25-2009, 01:31 AM
This is pretty awesome! Is this playable on real PC Engine/TG16 hardware?

Reminds me of the Super Mario Bros 1 hack someone made long ago.

kedawa
09-25-2009, 04:16 AM
That's actually very interesting. I just discovered recently that there were several famicom collections released on PCE. I wonder if those games were ported in a similar fashion to what you've done with Megaman.

c0ldb33r
09-25-2009, 08:14 AM
I had no idea the PCE CPU was backward compatible with the NES one. Neat.

TheRedEye
09-25-2009, 03:53 PM
Could you theoretically enhance a Famicom game with this method? Like, could you redraw the sprites to use more colors, replace the music, etc.?

tomaitheous
09-25-2009, 05:08 PM
Could you theoretically enhance a Famicom game with this method? Like, could you redraw the sprites to use more colors, replace the music, etc.?

Yes, you can. That was the second purpose of this project. To do enhanced NES hacks. I provided the source/premission/etc in a thread over at RHDN, but I guess it didn't generate enough interest from the hacking community.


This is pretty awesome! Is this playable on real PC Engine/TG16 hardware?

Yes. I test all my code on the real PCE/SGX systems.


Reminds me of the Super Mario Bros 1 hack someone made long ago.

You mean the one by that Finland hacking group? They actually did something similar, but much more hacking and less emulation. Those game are also speed rated to run on a 50hz PAL PCE, so when played on a NTSC - the colors are slightly off and runs faster.

Arkhan
09-26-2009, 03:16 PM
I had no idea the PCE CPU was backward compatible with the NES one. Neat.


Yessir, the HuC6280A is backwards compatible. They're both 6502 CPUs :)

Now what I want to see tom, is an enhanced Mega Man 3 w/ PSG music. 32 byte the waves! :-D
:o


i played thru, its pretty nice. My only complaint is that it's mega man 1 :-D

What made you choose that one?

tomaitheous
09-26-2009, 04:49 PM
Yessir, the HuC6280A is backwards compatible. They're both 6502 CPUs :)

Well, they're both 65x family CPUs. 6502 itself is pretty basic compared to the revisions, though. /pet_peeve_off ;)


Now what I want to see tom, is an enhanced Mega Man 3 w/ PSG music. 32 byte the waves! :-D
:o


After 5 NES game projects like this, I'm think I'm done with these. But who knows...


i played thru, its pretty nice. My only complaint is that it's mega man 1 :-D

What made you choose that one?

Because it's classic :D

BeaglePuss
09-26-2009, 07:07 PM
Could a PCE, or TG game be played on an NES in a similar fashion? I'm assuming no, but I have to ask.

Arkhan
09-26-2009, 10:11 PM
pet peeve stuff!


65xx / 6502, same difference! :-D You say tomato, I say tomato!



Could a PCE, or TG game be played on an NES in a similar fashion? I'm assuming no, but I have to ask.

I'd go with no too, since the NES video capabilities aren't up to par with the PCE, and the CPU is not as great in terms of 65xx-ness

tomaitheous
09-27-2009, 12:31 AM
Could a PCE, or TG game be played on an NES in a similar fashion? I'm assuming no, but I have to ask.

Nope. PCE CPU is running at 7.16mhz VS the NES 1.79mhz - not to mention all the extra new instructions it has, additional addressing modes, and DMA like opcodes. Video hardware, besides being much more advance (they are 16bit generation video chips), is *nothing* like the NES video hardware. Audio hardware is *completely* different. PCE audio hardware is similar to Amiga PCM audio - it uses samples, that's why it's able to replicate that NES sound. The setup I have is completely emulating the video and audio hardware in realtime, this takes up the extra resource of the PCE CPU. Not to mention that PCE system allows the CPU to write to VRAM at *any* point in time - no home console does this in the 8 and 16bit generation.



65xx / 6502, same difference! You say tomato, I say tomato!

I say 65x like I say x86. I wouldn't say 8086 if I was talking about a 186/286/386 etc ;)

JohnnyBlaze
09-27-2009, 01:47 AM
Now what I want to see tom, is an enhanced Mega Man 3 w/ PSG music. 32 byte the waves!

Fuck THAT! Mega Man 2

Arkhan
09-27-2009, 03:18 PM
Fuck THAT! Mega Man 2


blah, i want to hear spark mans music though!

c0ldb33r
09-27-2009, 05:17 PM
This is pretty awesome! Is this playable on real PC Engine/TG16 hardware?
I can confirm that it's playable on real tg16 hardware. Great job tom - what's next?

http://i152.photobucket.com/albums/s182/c0ldb33r/th_002-4.jpg (http://s152.photobucket.com/albums/s182/c0ldb33r/?action=view&current=002-4.jpg)http://i152.photobucket.com/albums/s182/c0ldb33r/th_008-2.jpg (http://s152.photobucket.com/albums/s182/c0ldb33r/?action=view&current=008-2.jpg)

A Black Falcon
09-27-2009, 06:05 PM
After 5 NES game projects like this, I'm think I'm done with these. But who knows...

Five? What other ones? This is completely awesome... :)

Arkhan
09-27-2009, 09:43 PM
Five? What other ones? This is completely awesome... :)


dragon quest is one of em . :)

the rest are irrelevant! MORE DRAGON QUEST! O_O :)


you know that is one series that would have shined like mad on the PC Engine....

tomaitheous
09-27-2009, 10:29 PM
Five? What other ones? This is completely awesome... :)

Megaman 1, Dragon Warrior 1, Castlevania 1, SMB 1 (this was kinda for the hacker Hamtaro's inquiry in it, but he never replied back. Also for myself as well though), and finally RoboWarrior.

All are fully playable except robowarrior which has a weird lockup bug if you open your item menu about halfway into the first level. It's because I haven't finished locating all the port writes and mapper calls. This is were I stopped all these projects. Castlevania needs a little more audio work, but else the game is beatable. SMB needs some audio work and I somehow broke the title screen, but otherwise beatable. Dragon Warrior 1 is almost complete, but uses an old audio engine so it might need some tweaks and the last boss tile mode needs emulation (bank selection) - but otherwise it's fine, playable, beatable, and on CD too ;) I even added in a cheat if you press start+select and rotate the directional pad to give you max gold and experience :D

I don't know if I'll finish any of these. The proof of concept was the compelling part about doing them, now it's kind of a drag to work on (it's tedious work for R&D and debugging). I can upload Castlevania 1 is anyone is really interested in it (although it's not done, but technically neither is Megaman).

NayusDante
09-28-2009, 02:30 PM
My suggestion is to do a more proper implementation of the Wily Wars idea. MM1-3, with enhanced graphics and music, but this time staying faithful to the original gameplay. Timing on Genesis didn't feel right since I grew up with the NES versions.

acem77
09-28-2009, 06:05 PM
Megaman 1, Dragon Warrior 1, Castlevania 1, SMB 1 (this was kinda for the hacker Hamtaro's inquiry in it, but he never replied back. Also for myself as well though), and finally RoboWarrior.

All are fully playable except robowarrior which has a weird lockup bug if you open your item menu about halfway into the first level. It's because I haven't finished locating all the port writes and mapper calls. This is were I stopped all these projects. Castlevania needs a little more audio work, but else the game is beatable. SMB needs some audio work and I somehow broke the title screen, but otherwise beatable. Dragon Warrior 1 is almost complete, but uses an old audio engine so it might need some tweaks and the last boss tile mode needs emulation (bank selection) - but otherwise it's fine, playable, beatable, and on CD too ;) I even added in a cheat if you press start+select and rotate the directional pad to give you max gold and experience :D

I don't know if I'll finish any of these. The proof of concept was the compelling part about doing them, now it's kind of a drag to work on (it's tedious work for R&D and debugging). I can upload Castlevania 1 is anyone is really interested in it (although it's not done, but technically neither is Megaman).


Crap I am very impressed! every time i think i saw it all i find something like this :)

AB Positive
09-29-2009, 12:34 PM
I can confirm that it's playable on real tg16 hardware. Great job tom - what's next?

http://i152.photobucket.com/albums/s182/c0ldb33r/th_002-4.jpg (http://s152.photobucket.com/albums/s182/c0ldb33r/?action=view&current=002-4.jpg)http://i152.photobucket.com/albums/s182/c0ldb33r/th_008-2.jpg (http://s152.photobucket.com/albums/s182/c0ldb33r/?action=view&current=008-2.jpg)


Huh... That card looks familiar! :D

Kamigami
09-21-2012, 04:21 PM
is this project still running
?

buzz_n64
09-21-2012, 05:10 PM
If you could make TG-16 SMB carts for under $50, I would totally get one. Would love a link to that file or video.

eastbayarb
09-21-2012, 05:40 PM
I am gonna try this on my neoflash cart and core grafx2 when I come home from out of state.

Are any of the other NES converted games available for download?

c0ldb33r
09-21-2012, 06:28 PM
I am gonna try this on my neoflash cart and core grafx2 when I come home from out of state.

Are any of the other NES converted games available for download?
There are megaman 1 super CD's floating around. I'd like to get one but am always how pricey they are :(

eastbayarb
09-21-2012, 06:41 PM
Wow megaman1 superCD...I have the super hucard CD (pce/tg16 games on a CD), but many don't work, presumably due to the system's low amount of RAM.

I always thought someone could take the super hucard CD concept and have hucard games utilize the Arcade Card's extra RAM.

tomaitheous
09-21-2012, 07:16 PM
More info can be found here: http://pcedev.wordpress.com

Also, the 'downloads and links' sections contain... *ehm*... resources. There's a build that uses Red Book audio tracks in place of the PSG music tracks ( https://www.youtube.com/watch?v=4IvnRaCU7OQ ), but it's not available for public release yet. Otherwise the SuperCD one available is the same as the 'rom' one, except it boots off the CD units (no need for a flash card). This is my Megaman project; Nobody elses'. And I'm *not* the one who's selling those CD-Rs with the manual and case (yes, they're CD-Rs). I have nothing to do with that.

The SuperHucard ISO games don't work because the games aren't finish being hacked. They were machine hacked; a util that searched the binarys for specific opcodes and patched them, but none of the games are finalized. It can be done, but with release of flash cards - no one has really bothered. Plus it's limited to 256k rom images and smaller. No, the arcade card won't help in that instance.

Edit: Oh, there are other games on the site. NES games running on PCE/TG16. The way it work is; the original NES code runs on the TG16 CPU (but 4 times the speed), but the video, audio, and mapper/IO is emulated on the fly. This backend emulation is a library I've written to be reused for other NES games. But the games have to *recompiled*, or rather the emulation code has to be re-assembled for each type of NES rom. Sometimes there needs to be small tweaks to each game (like timing of on screen effects since the TG16 is running game logic much-much faster in a single frame instance). The port read and write opcodes need to be patched for the binaries too, but that's getting out of scope of this thread. Anyway, Megaman has the newest emulation cores and refinement, while the other games do not (graphic glitches and sound glitches). There is no 'frame delay' or such in the emulation since it's done on the fly (some emulators have a 1 or 2 frame delay from the controller input to the game) and.... some games have less or no slowdown since the CPU is running much faster (can get more game logic done in a single frame). Megaman has no slowdown running on the PCE/TG16 for example.

Edit 2: fixed wrong youtube link

Kamigami
09-21-2012, 07:24 PM
honestly i don't get the point on having just a straight port to the TG
the whole thing is to get enanched version of a famicom game
so what would be very beautiful is a smb1 with arranged tracks

http://www.youtube.com/watch?v=MmkDEsK7b-k

EDIT: to the guy asking for a smb1 card

tomaitheous
09-21-2012, 07:32 PM
honestly i don't get the point on having just a straight port to the TG
the whole thing is to get enanched version of a famicom game
so what would be very beautiful is a smb1 with arranged tracks

http://www.youtube.com/watch?v=MmkDEsK7b-k

EDIT: to the guy asking for a smb1 card

Adding CD audio tracks for SMB1 would be pretty easy. Upgraded graphics as well. But... it's SMB1.. so I didn't really have much motivation to do so. Nor has any hacker approached me in doing so.

Kamigami
09-21-2012, 08:53 PM
just tried SMB1 on emulator
it works great timing wise, there are just some sample missing/not playing well (like the jump sound)

but indeed, great stuff you have there.

Hope someone help with that arranged track if there's enough interest in it.
(i have some)

this instantly makes me to think about having this gamea played in rgb (pc-e can output rgb)
which is great considering there's no other way nes/famicom could do that
(unless you considering desoldering stuff from playchoice etc)

eastbayarb
09-21-2012, 09:11 PM
Both my NES and PCE Cpre Grafx2 are RGB modded. It is simply stunning...

ccovell
09-21-2012, 09:45 PM
this instantly makes me to think about having this gamea played in rgb (pc-e can output rgb)
which is great considering there's no other way nes/famicom could do that (unless you considering desoldering stuff from playchoice etc)

Buy one of these:
http://www.chrismcovell.com/gotRGB/rgb_menu_fctitler.jpg

http://en.wikipedia.org/wiki/Famicom_Titler

No desoldering needed at all.

Kamigami
09-21-2012, 10:05 PM
Buy one of these:
http://www.chrismcovell.com/gotRGB/rgb_menu_fctitler.jpg

http://en.wikipedia.org/wiki/Famicom_Titler

No desoldering needed at all.

lol, yes i could

i dont even remember for what it has been sold lately on yhj
that was not a bargain certainly è___é

uh, it does work with the disk system?

btw Chris,
while i have the chance to do it
truly amazing site you got there.
Actually even too much of cool stuff for a single site. ^_^

Greg2600
09-22-2012, 11:56 AM
Wow, these play really well. Some of the audio is off/slow, but really great job. Wish this were to continue! I actually had no idea TG was capable of "backward" cap. to the NES.

Kamigami
09-22-2012, 04:59 PM
Adding CD audio tracks for SMB1 would be pretty easy. Upgraded graphics as well. But... it's SMB1.. so I didn't really have much motivation to do so. Nor has any hacker approached me in doing so.


i'm not an hacker but i'm definitely dying for an enhanced version of SMB1 ^^;

sheath
09-22-2012, 05:40 PM
This is completely awesome! The link in the original post seems to be timing out right now, but I will be thrilled to check it out when I can get a hold of it. I'm also very keen on seeing Castlevania and the others. Oh hey, found them all, including an R-Type 2 demo. Awesome! Turbo Everdrive is about to get a workout.

Greg2600
09-22-2012, 06:38 PM
This is completely awesome! The link in the original post seems to be timing out right now, but I will be thrilled to check it out when I can get a hold of it. I'm also very keen on seeing Castlevania and the others. Oh hey, found them all, including an R-Type 2 demo. Awesome! Turbo Everdrive is about to get a workout.

http://pcedev.wordpress.com/downloads-and-links/

MarioMania
09-22-2012, 11:28 PM
How about Mega Man Anniversary Collection on HuCard

Mega Man 1-6

tomaitheous
10-25-2012, 11:37 AM
How about Mega Man Anniversary Collection on HuCard

Mega Man 1-6

Heh, it seems to be getting there...

https://www.youtube.com/watch?v=ljtxuk9KDCg

Peonpiate
10-25-2012, 12:26 PM
Would SMB 3 be possible to get running on a PCE ?

tomaitheous
02-22-2014, 11:11 PM
Would SMB 3 be possible to get running on a PCE ?
Yes... (only to answer your question 2 years later....:P )

Lots of new stuff happening with Megaman1. A lot of work has been done to revamp the graphics and sound for an upgrade (new enemies, two new levels+bosses, changed level layouts, some new moves/weapons, 6button pad support, etc). The game is getting a big make over for PCE (like Megaman Powered Up, but PCE/TG16 style).

You can see progress here: http://pcedev.wordpress.com

XYXZYZ
02-24-2014, 10:44 AM
Would it be theoretically possible to make an adapter to play NES carts on a TG-16?

tomaitheous
02-25-2014, 09:11 AM
Would it be theoretically possible to make an adapter to play NES carts on a TG-16?

Maybe. It would need a chip that could identify lda XXXX and sta XXXX (with XXXX being specific ports) and change them to JSRs instead. Not sure how possible that would be.


Some WIP of the sprite upgrades: https://www.youtube.com/watch?v=5i48xMQX7NI

TheRedEye
02-25-2014, 03:37 PM
Are all 6502s compatible? Could you get 2600 code running on the NES?

(obviously the graphics would be a nightmare since they're handled completely differently but, just in theory)

BricatSegaFan
02-25-2014, 06:03 PM
So theoretically could you run 2600 code on Nes then translate that to the TG16?

Jk I just wanted in on this theoretical talk

bigbacon
02-25-2014, 06:15 PM
Maybe. It would need a chip that could identify lda XXXX and sta XXXX (with XXXX being specific ports) and change them to JSRs instead. Not sure how possible that would be.


Some WIP of the sprite upgrades: https://www.youtube.com/watch?v=5i48xMQX7NI


this is pretty awesome!

tomaitheous
02-26-2014, 07:32 PM
The graphics routines for 2600 games would need to be re-written, that's for sure. Completely different architecture. The NES doesn't use the full 16bit logical address range for the 6502, so on the PCE I'm able to put my emulation code in those areas. The ZP and stack regs on different on the PCE than the NES as well, but there's a clever trick to map ram into both 8k pages (so that ZP addressing runs correctly on the PCE for NES roms), but this wastes 8k of the 16bit logical range. Not a big deal, but still a waste. The 2600 might have lots of different regs mapped to different parts of the logical address range, so that can make it a pain as well. Meaning you'll have to re-write stuff rather than just emulating it (like I do with NES roms on PCE).

Short version: If the 2600 game is running on the NES, then yeah it should work on the PCE as well. If not, then you're looking at rewriting a lot of the 2600 game code to run it on PCE.