64 Bits: Nintendo's BIGGEST Mistake

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
we all know that the Nintendo 64 was called Nintendo 64 because it was the first 64-bit console which was super amazing back in 1996 and while back in 1996 almost no one except for the biggest nerds and theod what the heck that even meant featuring 64bit techology that produces amazing this was still something Nintendo proudly showed off in their commercials back then so let's talk about what that meant what the significance of it is and what they gained from their 64bits first of all we need to clarify in what way the N64 is a 64-bit console because to be honest even I wasn't sure what that was supposed to mean up until recently there are three ways to understand what 64 bits could mean in terms of consoles in terms of color depth it would mean more colors for example look at this image this only has white and black making it effectively a one bit color depth image the lowest color depth the N64 can use as four bits or 16 colors which looks something like this on a rainbow and the highest color depth the N64 can use and render is 32 bits which looks something like this though most games output in 16 bits increasing this to 64 bits it would look like this and I bet your monitor probably can't even render the difference maybe my video editor can render the difference either I'm not sure it would be impossible to tell the difference between 32bit and 64-bit color depth in an image anyway but the N64 can only use up to 32 bits per pixel for colors anyway so let's look at the second possible interpretation 64 bits in terms of audio bit rate well this one's pretty cut and dry the audio signal and outputs is 16 bits as simple as that which to be fair can sound great as you can tell from my example here but it is not 64 bits so let's take a look at the third interpretation what does it mean in terms of computing it simply means that internally the registers that the CPU uses are 64 bit white that's literally all all right next question you might have what is a register basically every time the N64 adds numbers it has to load them into registers first for example this code of increasing Mario's life counter when you collect the one up will load Mario's current amount of lives into a register then it adds one to it and then in the last line here it stores it back so was the N64 is 60 bit console in this sense well on the N64 there are two types of registers general purpose registers and floating Point registers general purpose registers can represent whole numbers while floating Point registers can represent numbers with decimals if you look at the instruction set there are multiple instructions supporting 64-bit general purpose registers and they work as intended so we can already say that yes the N64 is a 64-bit console in some capacity I just wanted to clarify that because I've heard some people say that the N64 is not a true 64-bit console it also supported 64-bit comments for floating points though this required the usage of two registers so whether this counts is somewhat arguable I guess but really in practice the floating Point processor can be used as a 64-bit processor with 16 registers instead of the 32bit processor with 32 registers and I have never seen an N64 game that does not use it like this there are practical reasons most N64 games use it as a 64-bit processor with 16 registers and it's not for Speed or accuracy but rather for safety I'll explain how does a safer in a bit let's first talk about what the point of having a 64-bit console is in the first place great so now we know that it is in fact fair to call the Nintendo 64 is 64-bit console but what does that mean in practice for us having more bits means you can add two gigantic numbers together with just an addition and code like this whereas if if you added two such big numbers together on a 32-bit machine your compiler would compile something that kind of looks like this this basically means you can do math with really big numbers numbers bigger than 4 billion more efficiently it also has a small advantage in moving data around for example you can move 64 bits of data like this whereas on a 32-bit machine the same data move would compile to something that looks like this it also lets you address more memory addressing is always relative to the value of a register in this example you can see me store something relative to the value of the T8 register 32 bits only allows you to address numbers up to 2 to the power 32 which is about 4 GB of data 64bits however lets you address numbers over a billion times bigger and there's nothing we can do to work around this on a 32-bit Nintendo 64 all right that's great but what tangible benefit does all that give us well the N64 Ram was just 4 megabytes or 8 megabytes with the expansion pack in size so the 4 GB limit really was 512 times bigger than we whatever needed to be and not a worry for us so the addressing did not matter the N64 fortunately is not CPU bound most of the time Mario 64 for example was compiled with debug Flex meaning mean that code could have run about 25% faster with the Press of a few keystrokes they reportedly compiled it without optimizations because they did not want to risk introducing new bugs from compiling with optimizations turned on WE later found out that by using the same compiler there were actually no new bucks introduced from turning on optimizations that's not to say that your compiled CPU code doesn't matter though generally the smaller your code the more performant your whole system will be this this is because the N64 is bottlenecked on memory speed and smaller code will need less memory transfers to run so not using compiler optimizations was an unfortunate decision but I guess better safe than sorry they did compile the Europe version with optimization store so good on them a fun fact the CPU on the N64 is so strong that if you look at the game I'm making the CPU finishes in just a few milliseconds even though we have 33 milliseconds to use for a frame at our disposal the CPU is 70% unused and this is with code that is optimized for size not speed since the N64 is bottlenecked by memory bandwidth and not CPU Cycles it meant that even if you were able to take advantage of the 64-bit instruction set you would see virtually no performance gains but let's just say for one second you were making a game that required a lot of CPU for some reason would you then benefit from the 64 bits well if we're actually looking at games that came out on the N64 such as Mario 64 these 64-bit instructions were only ever used in library functions that SGI programmed in assembly and the Mario 64 programmers did not used them a single time on purpose in fact I am not sure if the compiler they used was capable of producing 64 bit instructions for whole numbers and let's be real how often do you really need to do math with numbers bigger than 4 billion they did however use the floating Point 64-bit instructions a few times presumably on accident because it just makes the CPU half as fast for no perceivable benefit whenever it was used doubles or 64-bit floats are slightly more accurate but the accuracy was never needed one example of this happening is the shadow code removing doubles reportedly saves around half a millisecond in the castle area here or about 2% of the time Mario 64 spends rendering stuff in total without changing the color output of a single Pixel on the screen there's a 32-bit floating point mode that you can run on the N64 and it frees up half the floating Point registers and using this one saved me around 20 microc seconds though since the compiler still compiles double instructions sometimes if you're are not careful as we've seen in the shadow code and even I make that mistake sometimes this is prone to error and crashes and I think this is the reason every game runs the floating Point processor in 64-bit mode it is simply too prone to programmer error to not use the 64-bit mode I do plan on releasing my game in 32-bit mode but it will require a good bit of debugging to remove all the accidental 64-bit floats look at this code for example you may think this doesn't use any 64-bit floats but compilers are obliged by the C standards to use a 64 ft floats in situations like this which really sucks for us let me actually go back on something I said earlier the N64 is sometimes CPU bottleneck in practice and it's only if the program you wrote has a huge inefficiency somewhere this happens in two places in Mario 64 most prominently when you mark a complex object such as the submarine in DIA diad dox as a moving object Mario 64 recomputes all its triangle normals every tick instead end of computing them once the real fix here is just marking it a static with this one simple line of code here and it'll fix the lag almost entirely but let's just say that wasn't an option even if it wasn't an option 64 bits wouldn't help because the vertices you compute with all work on 16 bits and the normal and outputs are 32-bit float vectors and as you can see just applying a on line change already solve the entire leg so doing anything more complicated is overkill the other place with a huge inefficiency is something I've mentioned before in this video the Shadows this causes lack in places with many coins like around here in W's Fortress the real cause of lack here is that they redo the same recast five times which is a Hume amount of redundant math so the real fix here would be to just do the rast once and reuse the result but oh well let's again pretend that is not an option could 64-bit mode have helped here no actually avoiding 64-bit mode here would have been a huge Improvement because like I said before they accidentally used it which doubled the cycle count for some instructions for no perceivable benefit so while there was technically an upside to having access to 64 bits this was rarely used and accidentally using it was kind of a big risk the most useful thing you can do with it is flush our data in less Cycles which sure is technically a benefit but I doubt you would even make a hundredth of a millisecond of a difference in total frame time doing that not to mention the fact that copy pasting data should almost never happen anyway if you want an efficient program much worse accidentally using 64-bit mode when you didn't want to was very common and it lost them 50 times more time than 64-bit mode could have saved them in conclusion 64 bits would help you barely at all in fact had they dedicated the hardware cost and instruction space to having 16bit instructions on top of the 32-bit instructions this one would have been a much bigger Advantage we would be able to do math on signed 16-bit variables without all this casting overhead I expect the Merit from that to be at least four times as high as 64 bit registers and I also expect the hardware production cost for this to be little bit lower if anyone in the comments has knowledge on what it costs to produce Hardware like that let me know actually what you think how much cheaper it would be to have all 64 general purpose and floating Point registers be 2 bit registers instead of the setup we have right now so if there was basically no technical benefit to having 64 bits and it was more expensive to manufacture why would they ever go with 64 bits I'm assuming the people building the hardware knew from the get-go that 64-bit register widths wouldn't really have a big upside this was clearly not done for any performance benefits but do you know what's much more important than the quality of your console or your games Captain there's something heading our way extremely fast it's coming straight at us I've never seen anything like it before consumers thought more bits equals better graphics and that is probably the only reason this was done Adventure Nintendo 64 the fastest most powerful games console on earth now at after all the jump from 8 Bits to 16 bits in terms of Graphics was a gigantic visual Improvement and the jump from 16 bit to 32-bit computers was as well it made sense to leverage this perception to make it sound like a 64-bit console was going to be just as much of an improvement and it worked the N64 sold really well and look at what people said about it back then unfortunately I was still in my mother's womb when all this marketing happened so I don't have a firsthand account of how it felt back then but the people seem to be really into it it's somewhat unfortunate that marketing essentially meant we got a slower and more expensive console and slower games but I guess it at least helped sell a lot of units which in turns means we got a lot of games and honestly that's a deal I'm fine with taking and what is even funnier is that after the Nintendo 64 on the Nintendo GameCube they gave up on the whole 64-bit CPU the CPU in the GameCube is a 32bit one and that was definitely the right choice I hope you enjoyed this subscribe to see more Nintendo 64 technical breakdowns and optimizations shout outs to all my patreons without you guys I wouldn't be making these videos feel free to support my patreon to support the channel and development of my own Nintendo 64 game return to Yoshi's Island I'm currently in the process of finishing up the 12th level of this game and I'd say it's about 80% finished I'm going to be using every piece of Hardware knowledge I have to make this the most optimized game this console has ever seen and I hope you look forward to it see you [Music] wow here we go
Info
Channel: Kaze Emanuar
Views: 164,889
Rating: undefined out of 5
Keywords: super mario 64, kaze emanuar, n64, nintendo, mod, download, mario, rom, emulator, retro
Id: 3We_ZGOwmik
Channel Id: undefined
Length: 15min 32sec (932 seconds)
Published: Sat Apr 13 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.