Super Mario 64's source code has been decompiled and officially released

Discussion in 'GBAtemp & Scene News' started by Chary, Aug 26, 2019.

  1. Ecchi95

    Ecchi95 Advanced Member

    Newcomer
    3
    Jul 7, 2019
    United States
    Nintendo already confirmed Luigi was in Super Mario 64 in an Iwata Asks interview. It was 2-player. And pieces of that code are still there.
     
    Manana likes this.
  2. VzUh

    VzUh you are now reading my custom title

    Member
    2
    Feb 5, 2017
    Spain
    inside me
    if that's how it is...
    #FreeLuigiFromHisCodePrision
     
    zeveroth likes this.
  3. Ecchi95

    Ecchi95 Advanced Member

    Newcomer
    3
    Jul 7, 2019
    United States
    http://iwataasks.nintendo.com/interviews/#/wiiu/super-mario-3d-world/0/6

     
    zfreeman likes this.
  4. Pluupy

    Pluupy _(:3」∠)_

    Member
    10
    Sep 13, 2009
    United States
    But what about the DS enhanced port stuff?
     
  5. monkeyman4412

    monkeyman4412 Gbatemp's moronic trash

    Member
    8
    Jun 16, 2016
    United States
    Darn, I can't come up with something edgy
    Another long journey likely. I mean, I don't know how close sm64ds runs (source code wise) to sm64. I mean sm64ds had a shit ton of improvements from sm64. But if it's a lot different (point that it no longer even looks like the original source code) then well... another decompilation journey.
     
    Last edited by monkeyman4412, Aug 28, 2019
  6. Ecchi95

    Ecchi95 Advanced Member

    Newcomer
    3
    Jul 7, 2019
    United States
    The DS version looks more like Ocarina of Time. It uses relocatable binaries for everything like Ocarina of Time.
     
  7. Spazzery

    Spazzery Newbie

    Newcomer
    1
    Jun 30, 2019
    Estonia
    this is phenomenal! I can't wait to see what amazing things people can do with this! :yaysp::yaynds::yay3ds::yaywii::yayu::yayswitch::yaypsp::yayps3::yayone::gba:

    Now that I think, a 3DS port would be super awesome! :yaynds:
     
  8. evans112682

    evans112682 Member

    Newcomer
    4
    Mar 30, 2009
    United States
    Goldeneye 007 would be more interesting. Ported to the switch, with some online multiplayer.
     
  9. Shalashaska98

    Shalashaska98 GBAtemp Regular

    Member
    4
    Jan 17, 2018
    United States
    Yeah was gonna say that

    — Posts automatically merged - Please don't double post! —

    And add multi-player too
     
  10. monkeyman4412

    monkeyman4412 Gbatemp's moronic trash

    Member
    8
    Jun 16, 2016
    United States
    Darn, I can't come up with something edgy
    what do you mean by multi-player? Mario party supports local multiplayer. Now if you mean multiplayer like as in wifi or online multiplayer then sure yeah.
     
  11. Ecchi95

    Ecchi95 Advanced Member

    Newcomer
    3
    Jul 7, 2019
    United States
    I'll make a new thread about this and other games when I'm further along.

    I'm locating functions from Super Mario 64 in Mario Kart 64 (J) (V1.0) [!]. It's clear that it uses the Super Mario 64 engine, but some things are moved around and I don't know if that's the compiler's doing or Nintendo refactoring.

    Warning: Spoilers inside!
     
    Last edited by Ecchi95, Sep 4, 2019
    _DrBecks_ likes this.
  12. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23
    Nov 21, 2005
    United Kingdom
    Is that supposed to demonstrate the same engine? Most of those look like basic IO for an early 3d game console such that it would sooner call a common IO library (and both of those were early stage Nintendo in house games)
     
  13. Ecchi95

    Ecchi95 Advanced Member

    Newcomer
    3
    Jul 7, 2019
    United States
    The functions that aren't Main, or prefixed with "os" or "thread" are functions that only appear in first-party Nintendo 64 games. They are an engine Nintendo developed. The first game that used it was Super Mario 64, so it's referred to as Super Mario 64's engine.

    If you mean more specific things like scripts, I haven't found them yet. But what I've found so far are things that only appear in first-party Nintendo games in that exact form.
     
  14. Shalashaska98

    Shalashaska98 GBAtemp Regular

    Member
    4
    Jan 17, 2018
    United States
    I think u quoted the wrong person... Don't do it again or else...
     
  15. CrashOveride

    CrashOveride Advanced Member

    Newcomer
    1
    May 29, 2017
    United States
    The issue was that GoldenEye was compiled with -O2, making the decompilation process a LOT harder
     
  16. Ecchi95

    Ecchi95 Advanced Member

    Newcomer
    3
    Jul 7, 2019
    United States
    I wrote a tool now to plug in the symbols I give it for any N64 ROM. Output for Mario Kart 64 (J) (V1.0) [!]'s thread3_main:

    Code:
    Where? 2fc4
    002FC4 27BDFFA0
    002FCC v1 = 0x8014DC98
    002FDC 25CEF780
    002FE0 25EF4F80
    002FE4 2718A780
    002FE8 AC6E0000
    002FEC AC6F0004
    002FF0 AC780008
    002FFC AFBF0034
    003000 AFB50030
    003004 AFB4002C
    003008 AFB30028
    00300C AFB20024
    003010 AFB10020
    003014 AFB0001C
    003018 AFA40060
    00301C v0 = 0x80344F80
    003020 v1 = 0x8036A780
    003024 240A0000
    003028 240B0000
    00302C 240C0000
    003030 240D0000
    003034 240E0000
    003038 240F0000
    00303C v0 = 0x80344FA0
    003040 24080000
    003044 24090000
    003048 AC4FFFFC
    00304C AC4EFFF8
    003050 AC4DFFF4
    003054 AC4CFFF0
    003058 AC4BFFEC
    00305C AC4AFFE8
    003060 AC49FFE4
    003064 1443FFEF
    003068 AC48FFE0
    
    00306C JAL <setup_mesg_queues>
    
    003074 JAL <setup_game_memory>
    003084 26108570
    003088 2739A720
    003090 24180014
    003094 AFB80014
    003098 a2 = thread4_sound
    00309C AFB90010
    0030A0 a0 = gSoundThread
    0030A4 a1 = 0x4
    
    0030A8 JAL <create_thread>
    0030AC a3 = 0x0
    
    0030B0 JAL <osStartThread>
    0030B4 a0 = gSoundThread
    0030C0 261063C0
    0030C4 25088570
    0030CC 2409000A
    0030D0 AFA90014
    0030D4 a2 = thread5_game_loop
    0030D8 AFA80010
    0030DC a0 = gGameLoopThread
    0030E0 a1 = 0x5
    
    0030E4 JAL <create_thread>
    0030E8 a3 = 0x0
    
    0030EC JAL <osStartThread>
    0030F0 a0 = gGameLoopThread
    0030F8 2610C9A8
    0030FC s5 = MESG_START_GFX_SPTASK
    003100 s4 = MESG_VI_VBLANK
    003104 s3 = MESG_DP_COMPLETE
    003108 s2 = MESG_SP_COMPLETE
    00310C 27B10054
    003110 a0 = gIntrMesgQueue
    003114 a1 = 0xFFFFFFF4
    
    003118 JAL <osRecvMesg>
    00311C a2 = 0x1
    003120 v0 = sp54
    003124 (v0)
           case s2: //00315C
    00312C (v0)
           case s3: //00316C
    003134 (v0)
           case s4: //00314C
    00313C (v0)
           case s5: //00317C
    003144 break;   //003114
    003148 a0 = gIntrMesgQueue
    
    00314C JAL <handle_vblank>
    003154 break;   //003114
    003158 a0 = gIntrMesgQueue
    
    00315C JAL <handle_sp_complete>
    003164 break;   //003114
    003168 a0 = gIntrMesgQueue
    
    00316C JAL <handle_dp_complete>
    003174 break;   //003114
    003178 a0 = gIntrMesgQueue
    
    00317C JAL <start_gfx_sptask>
    003184 break;   //003114
    003188 a0 = gIntrMesgQueue
    003190 ra = sp34
    003194 s0 = sp1c
    003198 s1 = sp20
    00319C s2 = sp24
    0031A0 s3 = sp28
    0031A4 s4 = sp2c
    0031A8 s5 = sp30
    0031AC 03E00008
    0031B0 27BD0060
    Press any key to continue . . .
    


    Mario Kart 64 sets up the game memory on Thread 3 instead of Thread 5 like Super Mario 64.

    I found Super Mario 64's orbit_from_positions (envfx_snow) function in Mario Kart 64, which goes unused: (all thanks to stumbling upon the atan2s function originally from Mario 64's math_util)

    Code:
    Where? 1264c4
    1264C4 27BDFFD0
    1264C8 AFBF0014
    1264CC AFA60038
    1264D0 AFA7003C
    1264D4 C4860000
    1264D8 C4A40000
    1264DC C48A0004
    1264E0 C4A80004
    1264E4 46062001
    1264E8 C4860008
    1264EC C4A40008
    1264F0 460A4081
    1264F4 46000402
    1264F8 E7A0002C
    1264FC 46062381
    126500 E7A20028
    126504 460E7482
    126508 E7AE0024
    12650C E7B0001C
    126510 46021202
    126514 E7B20018
    126518 46088280
    
    12651C JAL <sqrtf>
    126520 46125300
    126524 C7B0001C
    126528 C7B20018
    12652C t6 = sp38
    126530 46128300
    
    126534 JAL <sqrtf>
    126538 E5C00000
    12653C C7AC0028
    
    126540 JAL <atan2s>
    126544 46000386
    126548 t7 = sp3c
    12654C A5E20000
    126550 C7AE0024
    
    126554 JAL <atan2s>
    126558 C7AC002C
    12655C t8 = sp40
    126560 A7020000
    126564 ra = sp14
    126568 27BD0030
    12656C 03E00008
    Press any key to continue . . .
    
     
  17. TastifulBurger

    TastifulBurger Newbie

    Newcomer
    1
    Sunday
    United States
    I'm more for a playable Waluigi and Disney in MP1 + MP2, like Knuckles in Sonic the Hedgehog 2 & Knuckles.
     
  18. Stealphie

    Stealphie GBAtemp Regular

    Member
    3
    Mar 27, 2019
    Brazil
    Rio Grande do Sul
    like the remake on wii, which had good online
     
Loading...