don't click here

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
    6,308
    486
    63
    italy
    AFAIK, Mairtrus doesn't even have a wiki page. Claiming it, I will write a first revision soon (just so we don't do a duplicate work).

    edit: done.
     
  3. SegaLoco

    SegaLoco

    W)(at did you say? Banned
    Meaning, it emulates the SNES except for the 6502 processor?
     
  4. LocalH

    LocalH

    roxoring your soxors Tech Member
    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,718
    1
    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
    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]

    RGB palette:
    [​IMG]

    YUV palette with Blargg's NTSC filter:
    [​IMG]

    RGB palette with Blargg's NTSC filter:
    [​IMG]
     
  7. LordOfSquad

    LordOfSquad

    bobs over baghdad Member
    5,202
    243
    43
    Winnipeg, MB
    making cool music no one gives a shit about
    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

    Kate the Wolf Tech Member
    4,742
    338
    63
    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
    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

    bobs over baghdad Member
    5,202
    243
    43
    Winnipeg, MB
    making cool music no one gives a shit about
    That's pretty bitchin'. Hopefully the guy posts over here at some point, haha.
     
  11. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    1
    0
    Writing my own MD/Genesis sound driver :D
    In re sound emulation:
    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,718
    1
    0
    being an asshole =P
    First of all, we don't need perfect emulation, only something that resembles it, so let's see:
    • Triangle waves: I guess a good FM instrument could do it
    • Square waves: PSG can do it
    • Noise: PSG can do it; even if it works differently, it's still noise
    • 1-bit PWM: Super Mario Bros doesn't even use it!

    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
    2
    18
    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 clearly 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

    Now playable in Smash Bros Ultimate Moderator
    19,240
    972
    93
    Long-term happiness
    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
    1
    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
    881
    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:


    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
    I haven't noticed this, could you elaborate further?

    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: