Super Mario Bros.

Discussion in 'Technical Discussion' started by LocalH, Jul 2, 2010.

  1. Shadow Hog

    Shadow Hog

    "I'm a superdog!" Member
    Yeah, annoyed the crap out of me, too.

    I assume, given that it's more or less literally one byte incorrect, that there'd be a simple Game Genie/PAR code to fix it...?
     
  2. nineko

    nineko

    I am the Holy Cat Tech Member
    <!--quoteo(post=475075:date=Jul 4 2010, 10:45 AM:name=Lanzer)--><div class='quotetop'>QUOTE (Lanzer @ Jul 4 2010, 10:45 AM) <a href="index.php?act=findpost&pid=475075"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->Also, shouldn't someone update Mairtrus's wiki page to include this?<!--QuoteEnd--></div><!--QuoteEEnd-->AFAIK, Mairtrus doesn't even <I>have</I> a wiki page. Claiming it, I will write a first revision soon (just so we don't do a duplicate work).

    edit: <a href="http://info.sonicretro.org/User:Mairtrus" target="_blank">done</a>.
     
  3. SegaLoco

    SegaLoco

    W)(at did you say? Misfit
    <!--quoteo(post=475159:date=Jul 4 2010, 10:26 AM:name=Neo)--><div class='quotetop'>QUOTE (Neo @ Jul 4 2010, 10:26 AM) <a href="index.php?act=findpost&pid=475159"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><!--quoteo(post=475137:date=Jul 4 2010, 03:33 PM:name=SegaLoco)--><div class='quotetop'>QUOTE (SegaLoco @ Jul 4 2010, 03:33 PM) <a href="index.php?act=findpost&pid=475137"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->So is this essentially an NES emulator with the assembly already converted over<!--QuoteEnd--></div><!--QuoteEEnd-->
    This statement doesn't make any sense.
    <!--QuoteEnd--></div><!--QuoteEEnd-->
    Meaning, it emulates the SNES except for the 6502 processor?
     
  4. LocalH

    LocalH

    roxoring your soxors Tech Member
    3,277
    3
    18
    wouldn't you like to know
    Super Guitar Hero II
    Not exactly.

    The 6502 ASM is mostly converted straight into 68k ASM, with a few manual fixes.
    The PPU is emulated - the code "thinks" it's writing to a PPU, but it's really writing to RAM and the values translated to equivalent VDP commands. Haven't done a whole lot of observation in a good debugger.
    The APU is simulated - he wrote a music engine, converted the song data from the original NES data, and uses it in lieu of actual APU emulation.

    It's a sort of hybrid, in a way.
     
  5. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,719
    0
    0
    being an asshole =P
    If I recall correctly, he didn't emulate the APU because he didn't get something to work. Maybe he'll do it later?
     
  6. LocalH

    LocalH

    roxoring your soxors Tech Member
    3,277
    3
    18
    wouldn't you like to know
    Super Guitar Hero II
    I've been talking with Mairtrus, and am working on a more accurate palette. I have two, actually - one based on the YUV palette generated by home consoles, and one based on the RGB palette used on the Playchoice-10 (and on all those wonderful screenshots in Nintendo Power).

    YUV palette:
    <img src="http://img804.imageshack.us/img804/4954/smb4mdyuvpalettev1.png" border="0" class="linked-image" />

    RGB palette:
    <img src="http://img696.imageshack.us/img696/4343/smb4mdrgbpalettev1.png" border="0" class="linked-image" />

    YUV palette with Blargg's NTSC filter:
    <img src="http://img807.imageshack.us/img807/3865/smb4mdyuvpalettev1ntsc.png" border="0" class="linked-image" />

    RGB palette with Blargg's NTSC filter:
    <img src="http://img710.imageshack.us/img710/5083/smb4mdrgbpalettev1ntsc.png" border="0" class="linked-image" />
     
  7. LordOfSquad

    LordOfSquad

    tails is still a girl Member
    4,808
    7
    18
    Winnipeg, MB
    making cool music no one gives a shit about
    <!--quoteo(post=475351:date=Jul 4 2010, 09:38 PM:name=LocalH)--><div class='quotetop'>QUOTE (LocalH @ Jul 4 2010, 09:38 PM) <a href="index.php?act=findpost&pid=475351"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->I've been talking with Mairtrus, and am working on a more accurate palette. I have two, actually - one based on the YUV palette generated by home consoles, and one based on the RGB palette used on the Playchoice-10 (and on all those wonderful screenshots in Nintendo Power).<!--QuoteEnd--></div><!--QuoteEEnd-->

    That's excellent!

    Oh, I have a question. Theoretically, would it be possible to port over the All-Stars graphics (or enhance the game to benefit from the Genesis' extra power in any other way)?
     
  8. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,425
    72
    28
    SonLVL
    What I've heard in this topic reminds me of Sonic & Knuckles Collection, which also has converted instructions, emulated display, and a different sound system.

    Just a thought I had.
     
  9. LocalH

    LocalH

    roxoring your soxors Tech Member
    3,277
    3
    18
    wouldn't you like to know
    Super Guitar Hero II
    <!--quoteo(post=475352:date=Jul 4 2010, 11:47 PM:name=LordOfSquad)--><div class='quotetop'>QUOTE (LordOfSquad @ Jul 4 2010, 11:47 PM) <a href="index.php?act=findpost&pid=475352"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><!--quoteo(post=475351:date=Jul 4 2010, 09:38 PM:name=LocalH)--><div class='quotetop'>QUOTE (LocalH @ Jul 4 2010, 09:38 PM) <a href="index.php?act=findpost&pid=475351"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->I've been talking with Mairtrus, and am working on a more accurate palette. I have two, actually - one based on the YUV palette generated by home consoles, and one based on the RGB palette used on the Playchoice-10 (and on all those wonderful screenshots in Nintendo Power).<!--QuoteEnd--></div><!--QuoteEEnd-->

    That's excellent!

    Oh, I have a question. Theoretically, would it be possible to port over the All-Stars graphics (or enhance the game to benefit from the Genesis' extra power in any other way)?
    <!--QuoteEnd--></div><!--QuoteEEnd-->
    Yeah, and I'm pretty sure that the author is at least considering doing so in future versions. It seems like this was just more of a "proof of concept" type thing, but a hell of a proof of concept it is.
     
  10. LordOfSquad

    LordOfSquad

    tails is still a girl Member
    4,808
    7
    18
    Winnipeg, MB
    making cool music no one gives a shit about
    <!--quoteo(post=475357:date=Jul 4 2010, 10:08 PM:name=LocalH)--><div class='quotetop'>QUOTE (LocalH @ Jul 4 2010, 10:08 PM) <a href="index.php?act=findpost&pid=475357"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><!--quoteo(post=475352:date=Jul 4 2010, 11:47 PM:name=LordOfSquad)--><div class='quotetop'>QUOTE (LordOfSquad @ Jul 4 2010, 11:47 PM) <a href="index.php?act=findpost&pid=475352"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec--><!--quoteo(post=475351:date=Jul 4 2010, 09:38 PM:name=LocalH)--><div class='quotetop'>QUOTE (LocalH @ Jul 4 2010, 09:38 PM) <a href="index.php?act=findpost&pid=475351"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->I've been talking with Mairtrus, and am working on a more accurate palette. I have two, actually - one based on the YUV palette generated by home consoles, and one based on the RGB palette used on the Playchoice-10 (and on all those wonderful screenshots in Nintendo Power).<!--QuoteEnd--></div><!--QuoteEEnd-->

    That's excellent!

    Oh, I have a question. Theoretically, would it be possible to port over the All-Stars graphics (or enhance the game to benefit from the Genesis' extra power in any other way)?
    <!--QuoteEnd--></div><!--QuoteEEnd-->
    Yeah, and I'm pretty sure that the author is at least considering doing so in future versions. It seems like this was just more of a "proof of concept" type thing, but a hell of a proof of concept it is.
    <!--QuoteEnd--></div><!--QuoteEEnd-->

    That's pretty bitchin'. Hopefully the guy posts over here at some point, haha.
     
  11. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    0
    0
    Writing my own MD/Genesis sound driver :D
    In re sound emulation:<!--QuoteBegin-"Mairtrus on the Devster forum"+--><div class='quotetop'>QUOTE ("Mairtrus on the Devster forum")</div><div class='quotemain'><!--QuoteEBegin-->Onyl the PPU is emulated on the fly. For the APU, I create an enviropment in BEX (just ot made it fast) to simulate the APU conditions. The sound engine was write from scrath, but the new music data was done using the original music data.<!--QuoteEnd--></div><!--QuoteEEnd-->It is sorta possible to emulate the APU if you're willing to dedicate the time to generating the sample data in software, mixing, and writing to the FM chip's DAC. The PSG in the Genesis can't do much of what the 2A03 does (only the 50% duty, and in a more limited range), and the white noise engines are 100% different so you'll most likely never get perfect 2A03 noise emulation from the PSG. The question is: will emulating a 2A03 on the Z80 be slow?

    Also in re CONVERT GAME XYZ FOR ME PLZ: sheesh guys, it's his converter and he can do whatever the fuck he wants. Leave the guy alone and write your own converter.
     
  12. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,719
    0
    0
    being an asshole =P
    First of all, we don't need perfect emulation, only something that resembles it, so let's see:
    <ul><li>Triangle waves: I guess a good FM instrument could do it</li><li>Square waves: PSG can do it</li><li>Noise: PSG can do it; even if it works differently, it's still noise</li><li>1-bit PWM: Super Mario Bros doesn't even use it!</li></ul>
    The big problem here would be converting the triangle wave frequency into something useable by the YM2612.
     
  13. TmEE

    TmEE

    Master of OPL3-SA2/3 Tech Member
    1,726
    0
    16
    Estonia, Rapla City
    T-04YBSC-A !
    Slightly deformed sine can sound rather close to triangle channel sound... easy to achieve too on FM
    50% Square waves are piece of cake, either in FM or PSG... FM will give you better range though and you can get linear volume levels like NES does instead of log 9FM is log too, but there's enough resolution to get linear scale worked out).
    25% Square waves are tricky, you will not be able to get exact waveform, but you can approximate it... the sound will be slightly softer though
    12.5% Square waves are also tricky and a bit more bitch to approximate, and again sound will be a bit softer...


    Z80 does have enough oomph to emulate the 2A03 at decent sample rate, but I'm not gonna write that code :P
     
  14. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    Because it's <a href="http://www.pu7o.org/vgz/smbsmps.vgm" target="_blank">clearly</a> impossible to do semi-accurate renditions of NES music on an MD... </sarcasm>

    EDIT: BTW, that doesn't even use the PSG tones, I did the squares on FM just because.
     
  15. Overlord

    Overlord

    Aros gartref, diogelu'r GIG, achub bywydau Moderator
    17,818
    133
    43
    Berkshire, England
    Learning Cymraeg
    <!--quoteo(post=475535:date=Jul 5 2010, 08:00 PM:name=Puto)--><div class='quotetop'>QUOTE (Puto @ Jul 5 2010, 08:00 PM) <a href="index.php?act=findpost&pid=475535"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->Because it's <a href="http://www.pu7o.org/vgz/smbsmps.vgm" target="_blank">clearly</a> impossible to do semi-accurate renditions of NES music on an MD... </sarcasm>

    EDIT: BTW, that doesn't even use the PSG tones, I did the squares on FM just because.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Actually, this was the precise VGM I was thinking of when I was talking about how the music had been done better elsewhere on the system by our community =P
     
  16. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    That's not the VGM I posted back in october 2008, I changed this one to use FM instead of PSG tones just to prove a point =P
     
  17. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    0
    0
    Writing my own MD/Genesis sound driver :D
    Yeah, but would it still be possible to do the duty cycling and other stuff on the FM chip? Probably not so easily... And besides, the 2A03 emulator would just an exercise in Z80 programming =P
     
  18. Bibin

    Bibin

    DON'T LET THE SUN LAUGH AT YOU. Member
    882
    0
    0
    New York City
    Ghost in the Machine
    This is almost perfect!

    There's a small flaw in that mario's bounce height on the goombas isn't perfect.

    Funny how he didn't use the PSG for the overworld melody - that's the exact same kind of square wave used in the NES game :psyduck:


    <!--quoteo(post=476042:date=Jul 7 2010, 12:25 AM:name=Andlabs)--><div class='quotetop'>QUOTE (Andlabs @ Jul 7 2010, 12:25 AM) <a href="index.php?act=findpost&pid=476042"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->Yeah, but would it still be possible to do the duty cycling and other stuff on the FM chip? Probably not so easily... And besides, the 2A03 emulator would just an exercise in Z80 programming =P<!--QuoteEnd--></div><!--QuoteEEnd-->

    You can come really close to all of the 4 duty cycles and triangle wave of the NES on the YM2612 alone.


    Oh. I'm pretty sure the audio isn't converted from the original format - there are a few tonal errors, most noticeable in the end of level theme.
     
  19. LocalH

    LocalH

    roxoring your soxors Tech Member
    3,277
    3
    18
    wouldn't you like to know
    Super Guitar Hero II
    <!--quoteo(post=476050:date=Jul 7 2010, 12:43 AM:name=Bibin)--><div class='quotetop'>QUOTE (Bibin @ Jul 7 2010, 12:43 AM) <a href="index.php?act=findpost&pid=476050"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->There's a small flaw in that mario's bounce height on the goombas isn't perfect.<!--QuoteEnd--></div><!--QuoteEEnd-->
    I haven't noticed this, could you elaborate further?

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->Oh. I'm pretty sure the audio isn't converted from the original format - there are a few tonal errors, most noticeable in the end of level theme.<!--QuoteEnd--></div><!--QuoteEEnd-->
    All I know is what Mairtrus said, which was that he converted the sound data from the original NES data. I have noticed the tonal errors you mention, but I chalked them up to differences between the capabilities of the 2A03 and the 2612 - in the same vein, while making the more accurate palettes, I noticed that due to the 9-bit RGB that the MD generates, some colors are slightly off from the colors the NES generates, because the NES has no such 9-bit restriction (especially in the YUV palette, some of the pastels are impossible for the MD to generate without mucking about with highlight mode).
     
  20. Eviltaco64

    Eviltaco64

    Hopelessly Lost in Aisle 5 Member
    I downloaded this a few days ago, and may I say that I'm very impressed!

    To be honest, my first thought was: "Is the Genesis ALLOWED to play this game?" :P

    I played through a few levels though, and it seems to be very accurate. The Genesis rendition of the music sounds funny, but I'm so used to the classic 8-bit soundtrack.

    To Mairtrus, LocalH, and whoever else working on this project: Excellent job. :thumbsup: