Super Mario 64 running on a Gameboy Advance
Вставка
- Опубліковано 2 жов 2024
- This is not actually Super Mario 64: it's my attempt at rewriting SM64 for the GBA.
I initially considered attempting a port, but the GBA is an order of magnitude slower than the N64 and has no GPU or native support for floating-point numbers.
So far, I've implemented a basic physics and collision system, along with a fully 3D camera, rasterization, texture-mapping, transparency support, etc.
Because the code is written from-scratch, I should be in a position to release the code into the public domain in the future: although I can't distribute it with Nintendo's assets, obviously.
A few points:
- Please stop suggesting that I should use this or that engine, or that I should build on top of OpenLara. Neither are good options.
- Yes, I have seen Asterix and Obelix.
- No, this is not based on any existing codebase. Rendering, physics, etc. is all done using hand-written code.
- I'll probably release the code as open source at some point, but I can't legally distribute anything with Nintendo's assets in it: so I'll have to make some sort of asset extraction tool to go along with it.
- Yes, this works on physical hardware (folks have tested it on both an original GBA and a 3DS and both work)
Also tested on gbarunner3 with a DS Lite. It works but with more broken textures and poligons.
I can tell that it's a software renderer from the warping between the near clipping plane and camera origin. Does GBA not have support for textured triangles? If it has support for 2D shaders I have a black magic Sega Genesis-style arbitrary quad shader that might interest you.
@@wasabithumbs6294It _has_ to be a software renderer-the GBA has no 3D rendering hardware! (It does have pretty nifty hardware 2D rendering capabilities that you can harness to achieve some 3d-ish effects if you're creative.)
@@wasabithumbs6294 It has nothing of the sort. The best it has is some very primitive sprite/tile rendering capabilities akin to the SNES. Sadly, pretty much none of this is useful for doing proper 3D: so the only reasonable approach is to use one of the bitmap rendering modes and do things entirely in software.
Regarding the warping, that's now resolved. Turns out, it was a precision bug.
i think you should make mario a 2d model.
Dear Mario:
Please come to the castle. I've baked a cake for you.
Yours truly--
Princess Toadstool (Peach)
Mario: 🔺️
be there or be… triangle?
Instead of the cake the game got baked
🟧 bowser
Honest Mario reaction: 🔺
Y̴͎̾Ą̵̚H̵̳̀Ḧ̴̛̰̭̺́̈́O̷͓̓̚Ö̷͔̲͠O̴̗͙̚
Ah yes, Super Mario Advance 5: Super Mario 64.
5? 6? 4? Make up your mind
Erm actually, New Super Mario Bros is Mario Advance 5,,,,
This is clearly Super Mario Advance 64: Super Mario 64 (Advance) (64)
@CaptainStage Super Mario Advance 3: Super Mario World 2: Yoshi’s Island
It’s more like super Mario advance 6: super Mario 64 (since SMA5 was meant to be Super Mario Bros)
tbh super mario 64 ds is just mario advance 5 (and smb deluxe is advance 0)
this is peak videogaming
9 fps, 120x80 resolution... what's not to love? 😅
Shoutouts to @SimpleFlips
Kaze, he's got Mario down to just 1 polygon. Can't beat that optimization. Right?
@@rafaelleone678 That's a sentence I haven't read in a long time.
this is peak vi
"DeAr MaRiO. CoMe To ThE cAsTlE, i'M bAkEd".
-pEeCh
Peach took that last hit of LSD
"Deer Mario. You sound like a deer, Mario. There was too much weed in that cake"
-peacheech
Super Mario 64 GBA, the true remake before Super Mario 64 DS
And what about Super Mario 64 GB?
Demake*
@@Yassoune the game and watch version too
@TLLGuy
Super Mario 64 Hanafuda
Nathaniel Bandy's here
I hope a green triangle is unlockable
Green triangle is real 2041
Legend has it that Green Triangle is hidden somewhere in Dire Dire Docks...
he is hidden inside that 6 polygon box in Jolly Rodgers Bay
I heard that in the sequel, everyone is going to be dodecahedrons instead, and there’s going to be a secret purple dodecahedron unlocked after doing some crazy stuff
Just have to run around the statue 100 times
The era of "Can it run Doom" is over
Let the era of "Can it run Super Mario 64" begin
can it run doom is still alive, can it run sm64 was just born
@@RainbowNoob127Official Funnily enough, we also got Mario64 running in Doom. The universe is expanding too fast
Now we need to run Doom in Super Mario 64
@@RainbowNoob127Officialyeah it was a joke they weren’t really saying no one was gonna do the doom thing any more😊
real
Ah yes, Mario, the famous red Italian triangle.
Someone suggested I call him 'Triangle Man' for copyright reasons and put a triangle on the hat instead.
@@jsbarrettoMario becoming a KKK member real?
You might end up stepping on They Might Be Giants' toes there, given Triangle man is the bad guy of their hit song "Particle Man"@JoshuaBarretto
@@jsbarretto You could turn it into a Silent Hill reference, Triangle Head.
Music makes him lose control.
Basic and pixelated it may be, but full texture mapping on a 3D environment with over 1000 polygons running on a GBA at a frame rate of more than 2 is undeniably impressive. I eagerly await more!
Framerate looks like 15-20fps here, even better in some areas!
If they really made a game out of this, I imagine the characters would have to be pre-rendered sprites like Mario Kart 64 to save on the poly count.
@@thebasketballhistorian3291 yeah
Based pfp!
@@MelindaSordinoIsLiterallyMe Thanks! Happy Pride Month.
@@stuff31 Thank you, happy Pride Month to you too!
This is what video games will look like in 2005.
I, too, enjoy moving through time in reverse
1989*
2005?
Super Mario 64's development started in 1995, and the game was finished in 1996!
@@---Dr._Eggman---Super Mario 64 DS
and they're like "WOW ITS SO REALISTIC"
Makes you appreciate the jump from the GBA to the DS
The psp came out at the same time as the ds, that thing was from the future
@@ragecandythat thing is literally a smartphone without the Sim card slot lol
just wait until you see what the PSP was capable of for a 2004 handheld
@@ragecandy ua-cam.com/video/Ad0YogcnbRM/v-deo.html
@@ragecandy Anyone who dismissed either the DS or the PSP because of petty console war BS missed out on a treasure trove of games.
"Super Mario FX would be the Best Mario Game ever!"
Super Mario FX if Launched:
It would have probably looked a bit better than this
It'd probably look a lot more like Mario RPG crossed with Star Fox.
@@adrenaliner91 Super Mario FX was a rumor about an Mario Game did in a FX-Chip (same chip created for Star Fox), and honestly I don't think it would be cool, of course it would be interesting but just that.
@@CT_Doll I know. But I think it would be less of a pixel mess.
super mario fx is just the snes FX chip name, an game called "Super Mario FX" was never announced or developed
This is probably the most insane tech demo I've seen for GBA. Absolutely insane. Solid work mate
nah .... look on tomb rider or driver ....
Much respect to OP, but this has nothing on the guy who got Tomb Raider running on GBA.
I know this project is just a demonstration "because I can" and I understand and appreciate the amount of work put into this, but I can't help but laugh at the idea making a GBA port of Mario 64, also those graphics give me strong Atari 2600 vibes.
Doing stuff that shouldn't be possible is just fun, I think
Played this on a Burger King hand dryer once.
Sounds like you were on drugs.
Peach: I baked a cake 4u :D
Mario: 🔺
This is absolutely astonishing! I've never seen this many textured polygons on a GBA before! If you're not breaking new ground, you're right on the cusp of it!
I mean there are some gba games like this that released when the console was still active
@@sometf2player752 I've seen them, yeah. I stand by what I said. This is seriously impressive!
Thanks! I think it's definitely starting to push the limits of what the thing can do. I've a few more ideas to make it a bit more efficient. My goal is 20 fps: that's the threshold I consider a game like SM64 to be playable at.
have you seen open lara?
Raylight's BlueRoses engine did similar stuff like the ports of Smashing Drive, Street Racing Syndicate and Big Mutha Truckers
Super Mario, 64 pixels on screen 😂😂
😂😂😂😂
Even though the video is mute, I was able to mentally hear Mario running
Video Games are BACK
Oh my god, it's YOU
Holy hell, it’s the one and only hbomberguy! What an unexpected face!
@@isabellev9576 no IM the hbomberguy actually the op is my doppelganger
Videogames are b-ACK!
Hey, it's hbomberguy, the first american
"LOD_0 Mario can't hurt you, he isn't real."
LOD_0 Mario:
I'm currently working on a model for Mario with < 100 triangles. For reference, the infamously low-poly SM64 model has over 400. It's going to look whacky as hell, but it's necessary to keep the thing playable.
@@jsbarrettoThe low poly model of 64 could do as reference or Kart DS could be some good ones too
Mario from kart DS has 195 tris@@BrickmanZero
Well fun fact sm64ds Mario is actually lower poly than the original. It wasn't due to poly count why he looked like that but rather tech at the time and the skill level they had.
@@jsbarretto Would it be possible to just not use a model? like mario kart 64?
fuck SM64DS, real gamers play SM64GB
Super Mario 64 Advance
My mans is running so lite he couldn't even afford an HUD.
Jokes aside, proper respects to you for this.
The texture warping’s pretty intense (moreso than just affine distortion), but still getting something recognizably 3d on a gba is impressive
Yes, the frame-rate really is that low. I'm working on it.
I don't think anyone was complaining, like this is a full 3d no tricks game on the gba. Like this is really cool no way anyone at Nintendo could of done Mario advanced 64
@@Izzythemaker127 Nintendo programmers drool on plastic donuts on their work breaks
This is still super impressive though! The GBA was weaker than the SNES so full 3D like this is amazing
No, snes is weaker than gba.
@@kainthedragoon8081 the SNES is weaker. the GBA actually did have some full 3D games.
Pannenkoek didn't turn Mario into a traffic cone, you did!
Maybe one day and then we'll get a highly detailed 4 hour video on how it works.
I just want to know if this port has any invisible walls
@@dominicjannazo7144 Don't worry I'm sure that pannen video will be out within a year or 2
Hahaha I get it!
"pc is better than console"
Bro's PC:
"console is better than pc"
Bro's console (it's also capped at 30fps):
@@Bruh-zx2mcliterally a nintendo switch moment (i don't understand how anyone enjoys ported games on that abomination)
@@mariotime7821 not "literally" whatsoever. god you're spoiled.
@@Bruh-zx2mcstill better than intel hd.
Honestly I think both are good
I love how it looks like an attempt at one of the first 3d PC games
This dude deserves more than 1k subs bro this is an accomplishment
I can only imagine the GBA screaming in pain
What the actual heck- I didn’t think something just as insane as putting Super Mario Galaxy on the DS could exist, but I think we just found a worthy contender. This looks absolutely incredible!
You've just let me know that this is a thing and now I'm amazed.
RIP portable Super Mario Sunshine, then
@@EvdafawthI mean... there's a Mario 64DS rom hack with Mario sunshine... not the real deal, but still an ok option!
@@Evdafawth Mario Sunshine 3DS
Running on that Super FX chip
Nah, this is all the mighty ARM7 baby! We don't need silly enhancement chips anymore. It's 2001, the future!
@@kitterbughi kururin
Erm, ackshually the snes had the super FX chip, not the GBA
@@HedgeRobo That's the joke, the GBA has enough grunt to not need a dedicated 3D chip!
@@redpheonix1000 so... How will I explain the N64 DD connected to my DS?
00:15 I thought our red triangle friend was going for a lakitu skip
Super Red Triangle Brothers
This will be SM64 in 2002.
A small step for humanity, a big YAHOO for Mario.
and you even managed to get it to run better than super monkey ball jr!
but seriously, this is astonishing! Even just this little proof of concept is super impressive!
One random thing this makes me nostalgic on: When a 3D platforming game would come on Xbox, Gamecube, PS2, and the Gameboy Advanced and the GBA version would be a completely different 2D game! I'm so weirdly nostalgic on that despite games being different now LOL
Modern devs: We can't do X because of engine/platform limitations
Joshua Barretto: Hey guys I made a Mario64 recretation from scratch in the GBA
They weren't joking about the power of the GBA
The A in GBA isn't for avocado.
With the power of Gameboy in your hands, now you're playing with powa'h!
That is pretty powerful though. The N64 was only 5 years old at that point
So, it's Super Mario 32!
Super Mario 6.4.
@@DaRkLoRdZoRc Super Mario [6:4]
But first, we need to talk about parallel universes!
The parallel universe:
Nintendo: “eh…60 bucks!”
Congratulations on your work, it’s a great achievement.
*SUPER TRIANGLE 32*
If one day it looks as good as Asterix & Obelix XXL GBA, I will not complain
*wipes tear from eye* It's beautiful...
N64: look what they need to mimic a fraction of our power
The latest tech demo will make you eat those words
Haha this is fucking cool. I like how much you're doing from scratch, too; cool to be working with such old hardware.
we have reached the point where we dont care if it can run doom but if it can run mario 64. and i love it
I was expecting this to be a joke video. This is very impressive.
At least this beats having the EXACT same game ported 100 times
Doom?
@@tvyantariki6884no! Minesweeper
probably tetris
@@axelsjourneyOr the original Super Mario Bros.
That's dope! I remember playing V-Rally 3 on the GBA and I always assumed there was something like a SuperFX chip on the cartridge I was today minus a month years old when I learned the GBA had native 3D support.
The GBA doesn't have native 3D support, this is all being rendered in software, pixel-by-pixel, with a lot of hand-written maths.
The fact it only took 3 months to make the progress you have is astonishing.
Oh god... Deoxys made its way to the Mario universe
would love to see a 3d rendered 2d Mario like the one 'Mario vs Donkey Kong"
Really insane work here man
To cut down on polygons for enemies that would be genius. King bobomb and the Chuckyas are already 90% sprite anyway.
Yes Mario and enemies need to be sprits to help in reducing polygons.
this is absolutely horrific, please keep developping it further
Couldn't have said it better.
STARWALKER PROFILE PIC BASED
And once finished someday, then it should be called, supermario 32,hahaa🤣
Thanks for recommending me this yt i love it
this is absolutely incredible! if triangle mario was replaced with a sprite this would look almost perfect! i wonder if anything could be done about the texture warping, since at the moment that looks like the biggest limitation here. like i said, a version of this with 2d sprites for mario and enemies would be completely indistinguishable from an actual nintendo product!
Things can always be done, this is just a very early experiment. I shall be posting more.
so much storage space spent on the "so long gay bowser" audio clip that this is what it has to look like.
That texture warping is crazy
There's definitely a bug in there... yet to find it. The less-insane warping for more distant polygons is just an unfortunate produce of affine texture mapping.
@@jsbarretto love your work keep going!
@@jsbarretto Okay then, why not do full perspective correct mapping at the edges, like -other engine- ? You already divide a lot for the vertices. There gotta be a balance. For some reason I could not find the definitive assembler code. There has to be code which is compatible with your license. Wikipedia has this iteration code which only needs 2 MUL instructions to refine a result. When we go along an edge, or when we sort all vertices by z values back to front first, we can use the last 1/z as start value. It would even be a good idea to use floats and sort everything by their mantissa. Yeah, slow bus. So need to try out.
Clipping is hard. I understood that we use normalized device coordinates so that we at least clip on simple planes with normals of the kind (110) (011) etc.. Could even shear everything and have 4 of the six clipping planes be axis aligned. Then to clip an edge, you don't need to multiply, but I think still need to divide? Cutting always gives a rational number. Cannot sort these by z, but you still only need one division per vertex projection in total: Homogenous coordinates.
It is just so weird that after that you multiply every projected coordinate to fill the screen .. even for triangles which are not even close to the border. Also NDC don't work with portals ( Descent, Duke Nukem, even Tomb Raider has portals into rooms).
@@ArneChristianRosenfeldt Divisions are very costly. The GBA is not very quick. I have about a dozen CPU cycles per pixel, and that's it. I would love to implement perspective correction, but just don't have the budget. That said, I've fixed the specific issue you're seeing in the video now though.
@@jsbarretto I read that the clipping was a precision bug. Near plane too close? I would also love to witness the far plane. 32 bit should give enough precision for low res rendering.
Correction is not supposed to happen per pixel. Just per edge (start and end) on polygons with large relative z and large screen space, as in the other games. Then roughly divide polygons in floors and walls. Render wall vertically.
GBA has 12 MHz and most instructions run at a single cycle. I am not sure about the bus, but I feel like while projecting we have the system bus for us. I have a problem with the iteration method for division: how to stop at the correct precision? I thought that along an edge I could use binary subdivision. The first nodes will need more iterations to get the necessary precision, but the finer subdivisions (starting with the average of both sides) then only need one. May want to switch the code path. Or only need non -> affine .
WRAM is quite huge. So we can just use a 1/z table .. and floats.
I often forget how tiny RAM is. I read that N64 can cache a dozen transformed vertices. So in a mesh you go from triangle to triangle on a shared edge and may even not need to transform the third one. Jaguar has no dedicated data cache, and basically you have to load the third vertex. GBA has 32 kB shared cache. So it is tempting to store a lot of transformed vertices. Then it is possible to bucket sort their z mantissa. Some profiling allows us to optimize the number of buckets. per bucket I would quick sort. Buffer overruns .. ah we need a linked list anyway as in PSX. Or use 1/z lookup table to split overflowing buckets. Vertices are quite huge. Xyz uv light. W? But after culling, still 256 vertices could be cached with all the divisions shenanigans.
Nah, we don't have Super Mario 64 DS, we got Super Mario 64 Advance 💀
I’ll be damned. If you squint your eyes and back away from the screen, your brain fills in the missing details. I would say that’s a success!
I decided to check out your first version of this after seeing your latest video. It's insane how much progress you have made. You're doing great!
Man I miss the days of playing as Arriow
This is the closest thing we will have to a "Super Mario FX"
Very impressive job!^^
hola
Why does this remind me of Astérix & Obélix XXL on GBA ? This game was a technical marvel cause it was a legit full 3D game on a GBA
This is genuinely impressive!! if imagine mario would be a pre-rendered sprite, a long with the enemies and obstacles
Now i’m thinking of another timeline where we got Super Triangle 64 and Mario never got a 3d game to this day
Me: Mom, can I get a DS so I can play the new Mario 64 DS?
Mom: No, you already own a GameBoy.
The GameBoy:
This is what video games will look like in 2035
have you tried the idea of making Mario be a bunch of sprites but like built in away that's like a DOOM monster somewhat, like 8 sprites for an angle being faced?
I've considered that, yes. That's my backup plan if nothing else ends up being workable. I'd prefer to get a proper 3D model in though, even if it's very primitive.
The poor texture mapping is trying its best haha. Great work.
George Wood voice: Super Mario 64 on the GBA was built on SiliconGraphics computers.
as a lover of traffic cones, i am ready to play SM64 as a traffic cone.
It’s crazy how good this looks
Who needs rom hacks when you can play super mario 64 portably in 2001
damn thats pretty cool nice work. i hope nintendo doesn't hurt you like so many others
This simultaneously looks like total ass and is a feat of true beauty. I am thoroughly impressed.
Ah yes, my favorite video game "Tiny Gnome with Comically Oversized Hat Adventures 64"
(Seriously though, this is supercool to see, really nice work!!)
I'am a gnome
"Woah, nice graphics! I'd like to get my hands on that game!"
"You mean you haven't played it yet? We can play it on my gameboy advance!"
@@ExaltedTilemaker "Super mario 64 is pretty Rad, those little brown goombas are pretty bad!"
@@Fatih_M177 "Beat up King Bob-omb, he's pretty sick, or have a footrace with Koopa the Quick!"
that's simply crazy, i love that
Just wanted to say, this is an impressive feat you've accomplished. I can't wait to see how far you can go with this. There is something magical about 3d games running on gba. Anyway, thanks!
Thanks! It gives me a lot of joy to see just how far the GBA can be pushes.
This was so cool to see. I would have been so hyped as a kid to have sm64 portable no matter what the quality was. Very fun to watch
super mario 64 ds if nintendo knew what they were doing
Could be much cooler to see Mario 64 on Sega Saturn. It will be truly crazy
And, honestly, infinitely easier! The Saturn has a much faster CPU, multiple cores, dedicated polygon rendering support in its video chip, etc. That said, playing SM64 on a GBA was my childhood dream and so that's the goal I've set myself.
@@jsbarretto It would be cool to see. I'm assuming using code from the decomp wouldn't be very useful, due to the gba's cpu lol
Someone is doing a port to Saturn already, forgot the name
@@MarioKartSuperCircuit Sadly not, it's pretty heavily reliant on floating point support and, frankly, isn't terribly efficient anyway. I might use it as a conceptual reference for stuff like "how high can he jump?" or "what states can be in at different points and when does certain logic apply?"
@@jsbarretto Don't quote me on this, but I think I saw somewhere that the Saturn was such a beast of a 2D console that it's 3D capabilities are just a consequence of that. It can transform and manipulate 2D sprites in such a way that it _can_ use them as 3D polygons, which is also the reason why that console renders it's primitives in quads instead of triangles. It's all sprites and is probably as insane as it sounds.
Would this possible to run on an actual GBA, or is this only possible because of emulation?
It should be possible! Someone tried it yesterday. Sadly it didn't work because of a specific bug, but that's almost certainly just a silly mistake on my part, so it should be 100% functional on real hardware once that's fixed.
GBA: I CAN’T DO IT…I’M DYING…
Joshua: suck it up you’ll live…
O i remember playing this, Super Triangle 64, from the famous video game franchise Super Triangle Bros.
But there isn't it already a new 3D engine for the GBA? I believe that at least it must have a better frame rate
But isn't there
When you're this close to the metal, it's basically impossible to write a generic engine for something like this. I'm down to inspecting every CPU instruction in some of the inner loops to make it run as quickly as it possibly can. I believe you can find a few existing engines, but they mostly aren't designed to handle the sort of thing that I need to get this to be playable. Besides, none of them are written in Rust and also I like the challenge of writing things myself :)
@@jsbarretto have you checked about the UA-camr 3Dsage's GBA engine? Maybe he could share the source code, so you can adapt it in rust. It seems very efficient
@@cvabdsI think there's a bit of a fundamental misunderstanding here. In the world of modern GPUs and rendering pipelines, engines are easier to swap out. But at this level, they are not. 3DSage's engine is designed to ingest a specific kind of 3D data with a specific representation and has limitations that would make it unsuitable for this application. Equally, the code I've written wouldn't be suitable for his application. The problem to be solved here is not one of making an arbitrarily general or arbitrarily fast engine: those two goals are inherently in conflict because more generality means poorer performance due to the limitations of the device. I can promise you that the best approach is to write the thing from scratch, not to spend indefinite time porting someone else's code that wouldn't be more efficient or useful anyway.
@@jsbarretto thanks you are the best I bet you can't port templeOS to it
So retro slide but real:
Great work man. This looks like a really fun project. Enjoy :)
I always wanted to play Mario 64 as the spaceship from Asteroids
This is where it all began
🔺️
Now we need to recreate it into Geometry Dash!
Jokes aside, this is incredible. Running a whole 3d model with thousand of triangles, AND being able to move around, all of this on a gameboy advance... impressive, i didnt know it was possible. I thought the console wasn't powerful enough.
(Someone should really recreate it into gd tho)
I always forget that the GBA had 3D games like Doom and Duke Nukem.
Well, not "3D" 3D, but- you get what i mean.
Now this is true
Engineergaming
GE-
This has to be ugliest thing I've seen all year
I FUCKING LOVE IT!!