Exploring Ocarina of Time’s Decompiled Codebase

Поділитися
Вставка
  • Опубліковано 17 гру 2024

КОМЕНТАРІ • 278

  • @benvillalobos
    @benvillalobos  2 місяці тому +54

    Hey folks! This video recently hit 100k views, which is absolutely mind-blowing. This has become a series and I'm getting close to cracking that opening cinematic! Some context and corrections below:
    What this codebase is: I called it "source code" but it's really not. Here's the deal: First, Nintendo wrote the original C "source code" for Ocarina of Time. To run it on an N64, they compiled it down to "machine code" that the N64 understands, but is tough for humans to read. The ZeldaRET team then analyzed that machine code and reverse-engineered it into C code that compiles back to the original machine code. So, while both codebases create the same game, they aren’t the same code.
    Mistakes will be made: I hadn’t touched C in over a decade before this, and I record these off-the-cuff to keep it interesting. Minor mistakes are edited out, and future videos will include corrections when possible. My aim here is to share the process of diving into unknown territory and learning along the way. As one viewer put it, this is like exploring the Water Temple for the first time-but in C.
    Check out the comments: The comments have been an incredible resource for corrections and in-depth explanations. The community here has been awesome.
    A huge thank you to everyone who's enjoying the series. I'm glad this is as fun for others as it is for me.

    • @frightfactoryYT
      @frightfactoryYT Місяць тому +1

      Great stuff bro. Thought you had 2-300k subs upon clicking lol. I'm a new creator and get the same comments, so now I understand how they feel ;) Hope you keep growing, you deserve it

  • @iosefka7774
    @iosefka7774 2 місяці тому +252

    I suppose I cannot exactly blame you for misunderstanding the DmaHandler typedef given that your IDE did not actually take you to the definition of s32 for whatever reason, and function pointer syntax in C is miserable
    In case it is not mentioned later in the video, and in case anyone is curious:
    'typedef s32 (*DmaHandler)(args...)' means that we are defining a type named DmaHandler, which can hold pointers to functions which have the arguments (args...) and return a value of type s32.
    The definition for s32 itself would look something like 'typedef ... s32'. The name of the type comes last usually.
    EDIT: Some more notes:
    13:45 - A double is a 64-bit floating point value. A 'long long' is a generic type defined to hold at least as much as a 'long'. (It is vague because C's standard does not like to give actual bit counts to anything, so as to be more portable, but on most systems you will ever use, a 'long long' will be defined *in the implementation of the standard* as a 64-bit integer.)
    17:55 - A short is usually 16 bits

    • @benvillalobos
      @benvillalobos  2 місяці тому +35

      Thank you for such a detailed comment! Your explanation on DEFINE_GAMESTATE is extremely helpful, cheers!

    • @gorgonflabish
      @gorgonflabish 2 місяці тому +12

      That's why I love humans

    • @htspencer9084
      @htspencer9084 2 місяці тому +1

      You're a complete boss :D

    • @SimoneN64
      @SimoneN64 2 місяці тому +12

      Small correction: the N64 does not run any operating system. The code runs bare metal. The way those processes are created and handled is via interrupts. Each time a "process" has to run, the cpu jumps to the global exception handler and from there it jumps to the appropriate code (the "process" code)

    • @iosefka7774
      @iosefka7774 2 місяці тому +5

      ​@@SimoneN64 That seems like an OS? It is obviously far simpler than Windows or Linux, but those are not the only kinds of operating systems. I'm slowly confused by what distinction you imagine there is. Even an OS like Windows does not run code in some magical place; it is still on the CPU, just perhaps in a lower privilege level. And, it also uses interrupts to implement its scheduler!

  • @biggc181
    @biggc181 2 місяці тому +199

    I wish there was more content like this on the platform. I absolutely love watching breakdown of old games. Impressive C knowledge bro

    • @benvillalobos
      @benvillalobos  2 місяці тому +19

      Thanks for the kind words, more to come soon!

  • @Lansolot
    @Lansolot 2 місяці тому +101

    If you were alive during OOT it was an experience. Everyday go home play, get stuck goto school and at the lunch table everyone would be trying to help each other get further. It was so fun when you found out something the group didn't know. A time when running to guides was way way less common.

    • @capturedlondon
      @capturedlondon 2 місяці тому +7

      I took the day off work to buy it

    • @riseofdayzofficial
      @riseofdayzofficial 2 місяці тому +2

      You know what’s insane the same thing happened to breath of the wild for me in school and everyone would ask how to get the master sword… but I love all the old games better

    • @DanielChristensen-mb5qr
      @DanielChristensen-mb5qr 2 місяці тому +5

      Yeah those days were truly magical. My best friend and I resorted to calling a national "nintendo hotline" with a minute fee, where we'd get guidance on how to get unstuck in the Water Temple

    • @Lansolot
      @Lansolot 2 місяці тому +3

      @@DanielChristensen-mb5qr The water temple was our depression period lmao. No one could figure it out for weeks

    • @ayotundeayoko5861
      @ayotundeayoko5861 2 місяці тому +1

      my siblings and I pooled our allowance money to get this gem - probably a monthly wage back then in 1999 Nigeria. Booting it in the N64 was a surreal experience. Good times

  • @joshbenchpress
    @joshbenchpress 2 місяці тому +59

    hey mate, randomly got this in my youtube algorithm. i'm a dev from australia, and i thought this was a really great watch. very fun to see old games dissected and the thought patterns behind them

  • @grogu808
    @grogu808 6 днів тому +1

    Epic, super-interesting content!!! Also love the style of the video

  • @ChairmanMeow1
    @ChairmanMeow1 2 місяці тому +6

    Best game man has ever made. Complete game changer in so many ways.

  • @CookieCurls
    @CookieCurls 2 дні тому

    When I worked at Riot Games, I sometimes had to go through old code bases with no guidance and no documentation. I felt like an idiot, struggling to make sense of it all for long periods of time. This helped my imposter syndrome a bit to see someone else do something similar. Thank you 😂

  • @nazart7830
    @nazart7830 2 місяці тому +8

    I’m currently studying CS, I really underestimated how hard it is but I find this super interesting. Thanks UA-cam algorithm for recommending this dudes channel, great video dude

    • @benvillalobos
      @benvillalobos  2 місяці тому +1

      There's always something to learn, no matter how long you've been at it :) cheers!

  • @NickoBanaa
    @NickoBanaa Місяць тому +1

    Man, what a nice and different video, i'm not into the code word, but that breakdown of the game was amazing, make more content like this.

  • @clublulu399
    @clublulu399 Місяць тому +10

    As a Zelda Fan & Coder, it makes me really appreciate looking at this code and being able to understand it.

  • @beogeek
    @beogeek 2 місяці тому +8

    This is my most memorable game I ever played, I think I was around 11 years old when I played it and it took me like 3 months to finish and it was breathtaking all the way through. I did .net and java in university so I could somewhat follow along. What really strikes me is that this was created all by hand, no AI sh*t, nothing, just pure good old fashioned human ingenuity. Loved this video, enjoyed watching every minute of it! Kudos to you mate!

    • @benvillalobos
      @benvillalobos  2 місяці тому +1

      Thanks for the extremely kind comment :D

    • @beogeek
      @beogeek 2 місяці тому

      @@benvillalobos You're most welcome, definitly make more content along the lines of this video, I'm sure many will appreciate the content!

  • @Minty_Meeo
    @Minty_Meeo 2 місяці тому +21

    do {...} while(0) is a common idiom for C macros to ensure the body of the macro is a single statement that requires a semicolon after it. Basically, it makes the syntax when using macros identical to when calling a function.

    • @DanielChristensen-mb5qr
      @DanielChristensen-mb5qr 2 місяці тому

      do (...) while(x) can also be used as one would use a while loop but ensure the loop runs once before evaluating if it should run again

    • @Minty_Meeo
      @Minty_Meeo 2 місяці тому +9

      Yes, but that's a more commonly understood fact because that's the intended use of do-while loops.

  • @alexh1687
    @alexh1687 2 місяці тому +4

    I feel like such a dum-dum every time I try to read a big C project like this alone (coming from a higher level background like C#, js etc).
    It's so cool to get through it with you and see you have the same question I would have along the way, plus it's easier to see in video format, would love to see other things like these !

  • @bishcp
    @bishcp Місяць тому

    Subscribed!
    Never seen your channel, but as a lifelong Zelda fan who recently stumbled into Tech I can say the timing could have never been better

  • @KingBakura
    @KingBakura 2 місяці тому +15

    OoT started off as an N64DD game originally. So it's interesting that the devs left a lot of that disk drive boot code in the game at the beginning. Also, they were gonna use the storage on the disk to save things like link's footprints in sandy areas etc. It was going to be a persistent open world game, so it's cool to see when they downgraded the game, they left a lot of that ambitious stuff in the code base.

  • @User-oh8vi
    @User-oh8vi Місяць тому

    Thanks for posting a video like this. I wondered how programmers often delve into codebases and I wanted to learn from them and you're my first concrete example of how it's done.

  • @jasonknoll5170
    @jasonknoll5170 Місяць тому

    Dude thank you for covering this! I'm on a binge of looking at old game source code and trying to mess with it -- please keep it up. I start with doom/wolfenstein, but just as OOT, there are more games out there! Keep it up man

    • @jasonknoll5170
      @jasonknoll5170 Місяць тому

      brb watching more of your series on this

  • @Okla_Soft
    @Okla_Soft 2 місяці тому +9

    Instantly subbed. I’ve been wanting someone to explore the codebase of this game for a while.
    The decomp is wonderful
    I also started streaming/playing master quest and managed to beat the Demi tree so far.
    🤘🤘

  • @MortMort
    @MortMort 2 місяці тому +1

    This was super fun to watch!
    Would be neat to also see how they go about doing some actions like, how does their ledge detection work, or what goes into Links Attack, etc you name it!

  • @tugaric
    @tugaric 2 місяці тому +3

    Ocarina of time... What a beautiful memory ❤

  • @ShadyRonin
    @ShadyRonin Місяць тому

    This video is incredible man. Thank you for this

  • @InTheNickofTime
    @InTheNickofTime 2 місяці тому

    This is the equivalent of staring at an absolute breathtaking sunset for me. Video game code is so amazing, I just adore it.

  • @simonvandenbroek6384
    @simonvandenbroek6384 17 днів тому

    After 6 years of coding and a life-time of ocarina of time worshipping, I am ready for this video.

  • @ShadeAnris
    @ShadeAnris 2 місяці тому +1

    wow awesome video! Im glad youtube put this in my feed its a super interesting watch

  • @robertjif6337
    @robertjif6337 2 місяці тому +5

    I never write production C in my life, seeing this, I'm truly is a quiche eater

  • @goomoonryonglucifer7192
    @goomoonryonglucifer7192 2 місяці тому +84

    Took me 10 mins to remember I don't understand coding 🤣

    • @TimeConvolution
      @TimeConvolution 2 місяці тому +21

      Just because you don’t understand decompiled C that came out of Japan doesn’t mean coding is beyond your comprehension

    • @spht9ng
      @spht9ng 2 місяці тому +1

      If you ever want to fall down the rabbit hole, check out the free course CS50 by Harvard

    • @FauxFaFox
      @FauxFaFox 2 місяці тому +10

      Wait this is coding? I thought this was ASMR.

  • @digitalhero7488
    @digitalhero7488 2 місяці тому

    Great idea ! And you are right about the music its so good.

  • @TheMadisonHang
    @TheMadisonHang Місяць тому

    i was ready for this, 20 years ago
    lets go

  • @clutchyfinger
    @clutchyfinger 2 місяці тому +1

    Wow I love that they were using actual musical notation for the ocarina code. I mean of course they were, but you just never think about it unless you see it in text.

  • @tobytherock
    @tobytherock 2 місяці тому

    im only 10 minutes in but im really enjoying how you're explaining all this. i've been modding zelda oot since like, 2010, but it was all hex values and very rudimentary programs that could only do so much. ever since the game was decompiled, it's been my understanding its the premiere way to mod oot now, but i've never been able to interpret code quite like this. i don't know if you plan to go further, but i would watch a series of this. its pretty good

  • @theterabyte
    @theterabyte 2 місяці тому

    I didn't know about mermaid, that's really cool! Thanks for making the video, found it fascinating

  • @RJR3006
    @RJR3006 2 місяці тому

    i just started my first year as CS undergrad, i may not understand everything just yet but the concept of this video is interesting and this was enjoyable to watch. nice video man

    • @benvillalobos
      @benvillalobos  2 місяці тому +2

      Thanks for the kind comment, good luck on the journey!

    • @RJR3006
      @RJR3006 2 місяці тому +1

      @@benvillalobos thank you, and also if you plan on looking into any other games if its possible to access the codebase for mario 64 or Mario galaxy ill definitely be tuning in 😩

  • @hroland
    @hroland 2 місяці тому

    Oh this is incredible, please make more!!

  • @eti360
    @eti360 Місяць тому

    i used this as my asmr video to calm myself before sleeping

  • @justindorsey2084
    @justindorsey2084 2 місяці тому

    Congrats on making a hit video!
    I found this super interesting. It made a great background video for me while I was studying. It helped me get in the right mindset to try to comprehend the geologic functions of volcanoes. Like coding to understand one thing in geology you need to understand [x] prior functions that make our world turn the way it does. So, thank you for your help!
    It was fun getting lost in this code of a game I also loved as a kid. When we saw "sword health" I became very curious and personally would've gotten lost down that rabbit hole for awhile, so if you ever figure out what "sword health" is, let me know!
    Also curious, how many total lines of code the game is, just for funsies.
    Hope to see more like this from you if you so desire to continue down this rabbit hole. As others have mentioned I'd love to see the likes of FF7, other FF titles, other Zelda titles, and since you seem to like the SuperNin era based on your choice of music, Chrono Trigger would be a neat one.

    • @benvillalobos
      @benvillalobos  2 місяці тому +1

      Oh man I wouldn't be surprised if the entire codebase was in the 100k+ range. Codebases have the habit of becoming jungles over time (or dungeons in this case).
      I took a note to check on sword health next time I see it. Cheers, and good luck on your studies!

  • @lucaslasvegas5170
    @lucaslasvegas5170 2 місяці тому

    Just found you and really enjoying the video so far. :-) I know it's been two weeks but I think I can add a bit of background to two things in the initial #includes:
    CIC is Nintendo's copy protection chip. One's on the cartridge, one in the console.
    N64DD is the Nintendo 64 Disc Drive, a failed addon to the N64. OOT was initially developed as a disc based game for this addon.

  • @scraphex
    @scraphex 2 місяці тому +1

    would love to see a whole series of this with Nintendo's N64 games.

  • @realdomdom
    @realdomdom 17 днів тому

    Cracked myself up at "What is fb?". Good stuff.

  • @TheMadisonHang
    @TheMadisonHang Місяць тому

    @3:45 the way you talk about source code,
    reminds me of a way to approach sheet music

  • @IAmNotASandwich453
    @IAmNotASandwich453 2 місяці тому +3

    Damn, I didnt even know we have access to a decompiled version of OoT. I need to check out that code asap :D This game is literally what even got me into Programming 11 years ago, bc watching Speedruns of it was so mesmerizing. :)

  • @waltermundt
    @waltermundt 18 днів тому

    39:10 do { ... } while (0) is an old C trick for defining a multi-statement macro that syntactically sort of behaves from the outside like a function call. It's the nearest macro equivalent to an inline function definition.

  • @-iIIiiiiiIiiiiIIIiiIi-
    @-iIIiiiiiIiiiiIIIiiIi- 2 місяці тому +1

    Dis dude's hair is on another level. It's like, 'what if Akira Toriyama designed Max Fischer from Rushmore?'

  • @Pablo1517
    @Pablo1517 2 місяці тому +9

    Now you can see why companies hesitate to release super old titles that they haven't touched in ages, as well as why it takes so long. This is the sort of thing I do for a living. Not being able to debug the code while trying to figure out what's happening is a nightmare.

    • @SuperM789
      @SuperM789 2 місяці тому +1

      and also why they usually just emulate it.

    • @thewhitefalcon8539
      @thewhitefalcon8539 Місяць тому

      Volunteers made a customizable PC version in a matter of months, what are you talking about?

    • @samegabi42
      @samegabi42 26 днів тому

      @@SuperM789a lot of times it’s not enough, even then companies like Nintendo will want to update UI elements to match newer consoles along with a handful of features

  • @mattshu
    @mattshu 2 місяці тому

    high quality content you're going places so i'm subbin to follow!

  • @GabrielDucharme
    @GabrielDucharme 2 місяці тому

    I would watch 300 hours of this.

  • @devinw9088
    @devinw9088 2 місяці тому +5

    That title song hits so hard for me. It’s just a wash of good nostalgia coming over me.

  • @Ignawesome
    @Ignawesome 2 місяці тому +3

    From what I saw here, I would assume newf was the string used to initialize the new save file name, i.e. filling it with blanks for final builds, but for debug builds the string was "ZELDAZ"

  • @bayelrey8028
    @bayelrey8028 26 днів тому

    Oh this is so dope

  • @alexanderzin
    @alexanderzin 2 місяці тому

    Subscribed in hope for more videos like this.

  • @ROTOBAfilms
    @ROTOBAfilms 6 днів тому

    It is the best game ever made, i get goosebumps!!!

  • @spectrecular9721
    @spectrecular9721 2 місяці тому +3

    17:30 - I imagine that's just the "magic numbers" of a Zelda save file format:
    en.m.wikipedia.org/wiki/List_of_file_signatures

  • @ItsHydraX8
    @ItsHydraX8 2 місяці тому +1

    Not a coder, but im interested in it and this was fun to watch you poke through this although I understood very little. Would love to see more poking around if youre up to it!

  • @DrinkPetrolForJesus
    @DrinkPetrolForJesus 2 місяці тому

    I have been blessed by the algorithm - this is awesome thanks.
    If you're taking suggestions: Goldeneye please

  • @VysetheBattleMaster
    @VysetheBattleMaster Місяць тому

    Over the years people have explored this game so hard like it’s the video game form of the Da Vinci code haha. I played this game so many times over the years and even did glitch speedruns when I got older that were fun. OOT itself is this weird game to me that feels very biblical in a lot of ways, and I’ve developed a deep personal connection to it after playing it so much, and mastering the different versions. I can’t really explain why though. I think the SRW series gives me that feeling too, but I dunno. It’s just a mindblowingly cool game.

  • @zyhru
    @zyhru 2 місяці тому +1

    man i wish i can write code like this look so fun

  • @jvizcode4845
    @jvizcode4845 2 місяці тому

    This was pretty fun to watch. Super Mario 64 code is also great to analyze.

    • @johnsmith8981
      @johnsmith8981 2 місяці тому

      How did you link to a ty search like that?

  • @trile2799
    @trile2799 Місяць тому

    Please continue doing this z64 video series. Triple Like!

  • @xfaon
    @xfaon 2 місяці тому +1

    my childhood game!

  • @devfagundes
    @devfagundes 2 місяці тому

    What a nice video. Thanks

  • @pixelcatcher123
    @pixelcatcher123 2 місяці тому

    Really cool stuff hope i see more

  • @faruzzy
    @faruzzy 2 місяці тому

    What a time to be alive!

  • @Sanctinious115
    @Sanctinious115 18 днів тому

    Man you gotta link the playlist to the Nintendo ost that you were listening to! It’s so good

  • @jumpkut
    @jumpkut Місяць тому

    08:45 DKC bangers make me feel some type of way

  • @Brombatti
    @Brombatti 2 місяці тому +1

    really cool video, an instant subscribe
    So, have idea to make more this kinda of videos?
    Greetings from Brazil

    • @benvillalobos
      @benvillalobos  2 місяці тому +1

      It's already a series ;) Thanks for the comment!

  • @Gijontin
    @Gijontin 2 місяці тому +1

    Just started to dabble in C to learn some programming, this video sure is pretty insightfully for me even though I don't understand too much.
    Mainly I just wanted to throw in the analogy that watching this is like playing through Water Temple for the first time but in C :P

  • @paulbollerman
    @paulbollerman 4 дні тому

    Does the ocarinanotes struct maybe indicate that they dynamically generated the notes based on a midi input? So instead of manually mapping a c or d or e note to the controller buttons it automatically determined the buttons?

  • @Satoru-z1m
    @Satoru-z1m 2 місяці тому

    I feel like an alien reading another alien's language

  • @ultimat3lifeform
    @ultimat3lifeform 2 місяці тому

    That blue paint/and/or wallpaper reminds me of a certain Scott that says hey all

  • @seevaq
    @seevaq 26 днів тому +1

    "ZELDAZ" is probably a "magic number", it must be this exact value. If not, it is sure that the file is not valid.

  • @david.cr96
    @david.cr96 2 місяці тому +1

    Those kind of markers like the "ZELDAZ" string can be really useful when you have to look at a random piece of binary memory and figure out what is wrong with it.

  • @igorgiuseppe1862
    @igorgiuseppe1862 2 місяці тому

    19:00 i dont know the reason why they coded it like this, but probably the logic goes like this:
    is doubleMagicAcquired= a flag that is checked at the great fairy that doubles your magic, to see if its should display the cutscene and double it, or if that already happened.
    yes, you can infer this information from magicLevel, with something like: if magicLevel==16: play the cutscene, multiply magicLevel by 2, recover health to healthCapacity, and recover mana to magicLevel, else recover health to healthCapacity, and recover mana to magicLevel (skip the cutscene)...
    but that assume that the programer who coded this system already knew the value of the magicLevels that the final game would use, if the beta testers decided that the game is too easy or too hard with the current maximum magicLevel and change it to, lets say 24 (and 48 when doubled), that would have required found this hardcoded reference to the 16 number (if magicLevel==16)
    and if this value change again and again, the same problem would repeat, so it make sense to have 2 variables, one to see if the magic was already increased and other to register the final value.
    i dont know why 1 and 2 values were used.

  • @davidbundgaard
    @davidbundgaard 2 місяці тому +1

    ZELDAZ is the equivalent to BM in a .bmp file or JFIF in a jpg file, or MZ in a executable PE/COFF file from Windows.

  • @maxdignitas3698
    @maxdignitas3698 2 місяці тому +1

    Rode the algorithm all the way here!

  • @MissingAFew
    @MissingAFew Місяць тому

    A video on how to compile into a useful rom would be helpful !

  • @LuisaFalcone-t8h
    @LuisaFalcone-t8h Місяць тому

    Not going to lie, when I saw the thumbnail I thought it was Dave Grohl playing zelda.

  • @Rod-f6m
    @Rod-f6m 2 місяці тому

    bro you gotta keep doing these videos! this was so informative!

  • @nmnml5602
    @nmnml5602 2 місяці тому

    This is me trying to review one of my coworkers Pull Requests

  • @fdwr
    @fdwr 2 місяці тому

    The preprocessor conditionals are curious because those cannot come from decompilation. One could tediously derive local variable and struct field purposes to name them, but you cannot unwind macros or code that was never in the binary.

  • @dannynoon013910
    @dannynoon013910 2 місяці тому +1

    Guessing the ZELDAZ might be an error checker for corrupt saves - ie the bytes need to start with that string to be a zelda save just a guess though

  • @purpasmart_4831
    @purpasmart_4831 2 місяці тому +7

    fb stands for framebuffer, sp stands for stack pointer. Stack Top gets the element from the top of the stack. Surprised you didn't know that, it's usually tought in Comp Sci

  • @h3r3si43
    @h3r3si43 16 днів тому

    what is the song in the background ? 4:00
    Amazing video !

    • @benvillalobos
      @benvillalobos  14 днів тому

      Waterworld SNES soundtrack - Map. The playlist used is in the description. Cheers!

  • @NoHandlebars87
    @NoHandlebars87 14 днів тому

    OoT is my #1.

  • @loganmahoney2284
    @loganmahoney2284 Місяць тому

    Love this

  • @YaroKasear
    @YaroKasear 2 місяці тому

    If my understanding of the TriForce% from GDC and my own experience with programming is any help: Overlays aren't menus. Menus are overlays.
    This game, and probably a lot of other games on the N64, tend to use a design pattern where an instance of an object will usually have its methods (Code for acting on their data structure proper.) copied into RAM and executed there, presumably to maximize performance as at this point ROM chips were definitely a lot slower than consoles. I don't know if we saw any of the actual overlay-loading code, but my guess is most the game states, like other objects, make use of this system.

  • @BariDavidGloriaGarcia2290
    @BariDavidGloriaGarcia2290 Місяць тому

    awesome!

  • @timo_v8t
    @timo_v8t 8 днів тому

    I listen to this before sleeping. I don’t know shit about coding, I’m not a native English speaker, I just like Zelda. lol

  • @TheVistaGroup
    @TheVistaGroup 2 місяці тому +3

    This was fun man, thanks! SNES Drunk background music?

  • @BenTJacobson
    @BenTJacobson Місяць тому

    How did they get symbols (variable names, function names, files, etc) out of decompiling the ROM?

    • @Clownacy
      @Clownacy 19 днів тому

      The ROM contains a bunch of debug messages, containing the names of variables, functions, and files.

  • @rosen8757
    @rosen8757 2 місяці тому +2

    This is not the source code for ocarina of time, this is a decompiled version

    • @Digitalgems9000
      @Digitalgems9000 2 місяці тому

      isn't it similar enough though? function names and stuff are the original, correct? maybe just comments are missing?

    • @rosen8757
      @rosen8757 2 місяці тому +2

      @@Digitalgems9000 actually no, functions, function names and in fact all code is not the same. A decompiler takes machine instructions and translates it into C code that would compile into the original. So functions you see in this version may not even exist in the original.
      It's the people working on the decompiled version going through and naming things when they try to figure out what it actually represents.
      And that is why it's misleading to call this the source code for Ocarina of Time because the original source code will be totally different.

    • @Digitalgems9000
      @Digitalgems9000 2 місяці тому

      @@rosen8757 ohh yeah that makes sense. i agree then, it's not the same at all. i thought a decompiler could xfer the function names and stuff

    • @Digitalgems9000
      @Digitalgems9000 2 місяці тому

      @@rosen8757 because i have a codebase for a game called risk your life 2, by planetwide games. it was a big mmo back in the day, and it even has the comments and the old visual studio build files. server library and client side engine. the whole shebang. it's gigantic. looks like a team or studio had to work on it it's so big.

    • @rosen8757
      @rosen8757 2 місяці тому

      @@Digitalgems9000 in some cases it can, for example if the N64 architecture has some system calls at specific values and the decompiler knows this it can mark those function calls with a correct name, but for any user code no.

  • @spongemanhere
    @spongemanhere 2 місяці тому +1

    i have no idea what is going on but i enjoyed this anyway

  • @Ver2ion
    @Ver2ion 2 місяці тому +3

    i love the mysterious bg music to this

  • @sofakng163
    @sofakng163 Місяць тому

    Do you have a theme or layout for Visual Studio Code? (it looks like you are using that)
    I really like your setup

    • @benvillalobos
      @benvillalobos  Місяць тому

      The theme is One Dark Pro by `binaryify`. In terms of layout, I have my Primary Side Bar shifted to the right (you can right click it to move it to the opposite side).
      imo the side bar is cleaner on the right since it doesn't move the code around as you close/open it

    • @sofakng163
      @sofakng163 Місяць тому +1

      @@benvillalobos thanks! I agree about the primary bar. It's the way Visual Studio has it as well of course.

  • @ganondalf8090
    @ganondalf8090 2 місяці тому +1

    i wish people would do stuff like this with other games, like for an actual dev to go through some leaked source (wouldn't touch any rockstar stuff with a 6 foot pole tho) and talk about what's good, what's shit, etc

    • @ganondalf8090
      @ganondalf8090 2 місяці тому +1

      like ive literally been looking for this kinda thing pretty much since the sm64 decomp finished

  • @Deczkin
    @Deczkin 2 місяці тому

    what's the music around 5:46?

    • @benvillalobos
      @benvillalobos  2 місяці тому

      @@Deczkin the Tetris attack song around the 10 minute mark here: ua-cam.com/video/SLgms78JVo0/v-deo.html thanks for the reminder to credit the playlist in the description!

  • @ryanlintott6135
    @ryanlintott6135 25 днів тому

    Those _Init and _Main methods appear to never be called anywhere because they are being set as function pointers to the "state" struct
    You can see that happen in that SET_NEXT_GAMESTATE macro, ie
    "(state)->init = newInit"
    It's just a way to make a generic state object that can run custom "_init" and "_main" methods. The state->main method is invoked in the update loop and state->init is run on inititization of the new gamestate

  • @lordnibbla
    @lordnibbla 2 місяці тому

    Good shit I can vibe to.

  • @maseay91
    @maseay91 Місяць тому

    Thanks for being smart.. making life fun for us all :) I could never lol

  • @p2k7777
    @p2k7777 21 день тому

    38:55 look up do {...} while (0) in macros
    it's so the macro's expansion doesn't end in a semicolon

  • @gg-gn3re
    @gg-gn3re 2 місяці тому

    13:51 no a double is a floating point, longs are integers. both are still used today as is the language that is made in ~.~