Programming My Own 40KB NES Game
ฝัง
- เผยแพร่เมื่อ 24 ส.ค. 2024
- The Nintendo Entertainment System (released as the Family Computer in Japan) is the world's most iconic home game console. With a Ricoh 2A03 CPU based on the popular MOS 6502, it had 2KB of RAM, 2KB of VRAM, and with the built in Picture Processing Unit and Audio Processing Unit, was used to run some of the world's most popular games ever released.
Although early NES games were design for 40KB cartriges (32KB of PRG ROM and 8KB of CHR ROM), later advancements led to larger chips being used, and more game content being added, but the system itself remained the same. In order to bridge this gap, Mapper Chips were developed to allow the system access to certain parts of the PRG or CHR ROM sections.
I've created a new NES title to show how programming an NES game from scratch can be accomplished. No Internet for the NES is available now: notin.tokyo/no...
Development help:
www.nesdev.org...
Further reading:
www.copetti.or...
I've never seen a more thorough technical explanation of the NES in such a short time
Came here to say that as well. It sounds like it will be a quick gloss over, but then covers the important conceptual details of how subtle things like split-screen scrolling work. Well-done.
I got into coding super tiny games a few years ago. I've made scaled-down Mario & Zelda games in about 1KB, working on some ideas for Metroid.
That's sounds way cool, do you have any stuff I can check out?
@@InkboxSoftwareI have an Itch page w/ some of my games (Jadelombax is my username there), tried to post a link, but TH-cam keeps deleting my responses.
1kb? what platform are they made for?
@@themadmallard Been using Pico-8 due to its ease of use and short syntax. It's not assembly, but things can still get crazy cryptic when you're optimizing bytes.
You can imagine that game in your brain and play it.
The end really caught me off guard. It was such a scott the woz ending.
*3D Dot Game Heroes
@@itskdog Yeah, I know, but I feel like that song is most commonly associated with scott the woz.
@@itskdogwow I had no idea it was from that game. Thanks!
A Scott vid was recommended after this lol
Its the old one too...
The game boy color has one of my all time favorite visual styles for a retro console. Games like Mina the Hollower demonstrate how great it looks, it’s so appealing! Excited for that episode.
The way the Famicom/NES handles data will never fail to amaze me
Assembly is just amazing really on how small its code can be when it's compiled
6502 in particular is tiny. Most modern cpus use 4 bytes per instruction at all times but we have much more room now so it hardly matters. NES code size is mostly negligible when it comes to file size. It's the data tables that hog the most cartridge space
Assembly isn’t compiled. It’s assembled.
Shouldn’t be C with modern compilers as efficient as writing assembly?
@@rethardotv5874If you cut out bigger libraries (or go without a standard), and remove the elf file cushions, you can get C down to assembly sized programs. A guy made a QR-based snake game a little while back and was finding his assembly program was larger than his trimmed down C.
edit: I should probably note, this is likely due to the optimization for a very common architecture, x86. I'm not sure how efficient one for say the 6502, PowerPC, or Risc-v would be...
@@rethardotv5874if that was the case you'd never see inline assembly in C code
The amount of effort you put into each programming project is truly inspiring. Keep up the great work!
I love your NES videos, but as I actually have a bit of experience programming on the DMG, I'm looking forward even more to your future projects!
It's so cool that Nintendo invented golf.
Scott the Woz outro whatt
The NES will always be my favorite console.
It helped save the video game industry!
Only in the USA. The rest of the world was fine. In fact, the UK had a home computer/bedroom coder boom from 1982-1990 where games made millions.
Can't wait to see what game you make on the GBC. Its a personal favorite of mine to code on as well. And with how awesome GB studio is its now more accessible than ever to work with. And in case you're wondering my GBC game is called Eternal Memory.
It's a shame their visual programming interface is awful though. Makes doing anything reasonably complex a nightmare without learning the actual scripting language.
@@Bobbias I don't think its that bad honestly plus it's actually really competent at making more complex games. I've managed to create a pseudo real time reflection using just the stock visual scripting.
I have been programming games for over 10 years now, C#, gdscript and back in the days of the NES I programmend in BASIC using an MSX....but I'm nobody! You are my hero!🤪
My guess is black magic or programming if there's a difference between the two 😂
a great programmers code is like a master close up magicians act: nothing flashy under the surface, super efficient and seamless.
The average programmers code is like a magician you hired last minute for your kids birthday party: it kind of works sometimes but is otherwise a total mess of copied tricks and a pigeon in a hat, and the pigeon is dead and useless but they kept it in the act anyway.
"Is this too much voodoo?"
As a programmer and self-proclaimed sourcerer, no; there isn't a difference.
@@error.delete4945 I will not remove the KillPidgeon() method from my code, no matter who the IRS sends!
Simply speak the binary incantations and technomagic will occur. You use hex for hexes, of course.
This is one of the best summarized explanations on how to build an nes game from scratch that I’ve seen! Thanks for the great video. 👍
can't wait to see what you do on the gameboy. Love your videos!
Love your videos dude, can’t wait to see you unpack the gameboy color. Also Scott The Woz jump scare
Sidenote: Image data is NOT loaded into vram, PPU reads image data directly from chr rom, that's why image data is stored in a separate chip from program itself
But vram stores the pallet and table name information doesn't it
@@ricarleite yes, but that's something else
@@Adiee5Priv I mean he didn't claim vram stores a bitmap representation of the screen
@@ricarleite ah, yes, i was reffering to a one scene, where it was visualised that way, but it seems like i didn't include the timestamp
We need more of these!! :D thank you for your explanations!
I like the microphone used here! really nostalgic sounding!
Later games used "bank switching" to fit more code/data than the NES's 64k address space would typically allow
That sounds a bit like multiplexing which gives more capability to a limited resource by working on one bank or area of the screen at one time, which happens so fast that the person playing the game can't see this.
@@lemdixon01 It's more like an HDMI splitter where you can have your Switch, Xbox, and DVD player all plugged in at once but you can only see one at a time
This is amazing... As some how now works closely with cpu hardware and firmware learning about the limitation that we went through is fascinating... And i see how some of the stuff/limitations from 90 is till there in mordern cpu... We just find more ways to go around them
Your audio is SOO good - keep it up! Love the dry mic sound tbh.
went from a random recommended video to wanting to get one of those romhack carts from back in the day you could load games onto
Scott the Woz outro?! (Breakout?)
Now I want to try to make NES games again. Touching it really made me appreciate how big a kilobyte is
ive been making a 32kb game for pico-8 and now i appreciate the wizardry that is needed to truly craft something playable within the limitations
The good thing about the GBC is that you can actually use cool things, like C instead of Assembly. I did the iconic DVD bouncing logo and made it run into original hardware (GBC and GBA)
You can use C for the NES, too, I just prefer assembly
Clicked as soon as i saw the notification 🔥🔥🔥🔥🔥 ur videos are always the best!
Can't wait to watch the episode where you program a 3D Mario for the GameCube in 10 years.
Careful using Nintendo characters in your game, they might swat your house
Amazingly well explained.
You'd be surprised by how much you can do if you have a couple of kilobytes of storage space, if you just didn't have any of the bloat of modern software
Hint they didn't do it with only 32k rom and ppu rom
Kirby on nes was around a 1megabyte cartridge
That was amazing. I didn’t understand a lot but was still mesmerized!
Yooooo I love your channel!!!
I wasn't going to comment, just a really solid video.
Then the Scott the Woz ending whiplash hit
Im So Glad NES Actually Saved American Video Game Industry Back in 1988. Rest of The World (Included Japan) Were Fine While America Had Video Game Crash in 1983.
That was a brilliant explanation and a fun game as a result. Great work.
Daaaaam, this guy knows everything about hardware
1:40 that’s the music from Goal 2, one of the best soccer games of all time. I’d recognize it anywhere.
I would love to see the gbc videos, good luck!
What a wonderful explanation, sure with i had this video when i started years ago. Great work!!!
Look up Micro Mages, it's made with only 40kb. Dude that made it also made a "making of" video
Thank you for this video
Am I on time?! I'm enjoying it already
3:56 I wouldn't be surprised if they were morse code lol
Super mario bros was made in assembly and most of the prg rom isnt full because compiled assembly code isnt that big and they moved the compiled assembly to the rom and they made sure it didnt go to the blank prg area so that is how super mario bros was made in 40k (a lot of the rom is 0s)
Thank you for reading.
Amazing video as always thanks for your work.
It's always a good day when Inkbox uploads!
Restrictions birth creativity
I will continue to follow and watch I hope you make many more.
Nice work! Thanks for the cool video!
Back then, creating video games was really an art. Nowadays, no one gives a shit about memory usage. Therefore, there are so many shitty games that require 50GB.
Star wars outlaws and the modern Ubisoft games are the shittiest games right there
You inspired me to try to make a version of Minecraft for NES.
Scott the Woz?! Is that you at the end?!
I think a jump is better represented by a parabola, with the amount going up constanly reduced by a constant number.
If you were using C, it'd be awesome to have a C23 compliant compiler to handle resource embedding. Towards that end, the oscar64 project intrigues me. It's intended for the C64, but it shouldn't be too difficult to modify it for other 6502 based systems.
C23 is what happens when python script kiddies infiltrate an established programming language
@@rusi6219 For a lot of the things I see getting added to C and C++ both these past few revisions, yeah. I hate constexpr and consteval and they're adding constexpr to C.
1:50 - Whats stopping you from building and programming a cartridge with an attached RJ45 port, for whatever godforsaken purpose? 😉
Congratulations!
Great video brother
6:45 this left side masking is achieved by manipulating some bits at address $2001.
Loved playing the game boy color as a kid!
I totally understood everything.
time for a cool video
Your my inspiration to become a better programmer
Now I'm really interested in the difference between NES and GBC. Especially black cartridge games look quite similar to NES games, apart from the resolution.
I hope you're not just using GB Studio. A channel like this needs real programming.
I've doing it all in assembly for now, but I might use some music tools later since making music for these machines is like writing a whole program on its own
beautiful svg art in the video.
Incredible😮 i learned a lot in this video❤❤❤
golf on mars has been demaked on the NES? 😲
SCOOT THE WOZ OUTRO MUSIC?
What a great idea for a homebrew NES game! It would have been cool if a game like this had been built into the NES so we could have played something even without a cartridge inserted. I wonder how feasible it would be for someone to hack that feature into an NES...
Question: is it possible to alter the color pallete of a sprite on a per-LINE basis rather than a per-cell basis if coded correctly? Sorta like how the Atari 2600 did to give the illusion of extra colors for a single sprite?
Yes, but it would require keeping track of PPU cycles
When I saw the no internet screen I was certain it was a segue to a vpn commercial
What an epic video!
I’d like to see this guy cover sega master system homebrew
Real original ending music.
what about the Minecraft? since you are moving on from NES, and that Minecraft is on NES, what's gonna be with that?
The 8-bit Minecraft project is on the Commander X16, I don't think it would be possible on the NES without several compromises
Nice vid !
really helpful
Well explained !
You are one of the best programmers I have ever seen, though I don't understand much😅
Loved it!
Can you make this game for the Atari 2600?
Sure, why not?
@@InkboxSoftware will you do it in a video?
No, I've never touched the Atari 2600
@@InkboxSoftware you could use a tutorial like Truttle1 did
@@thedinobros1218 i can't believe that truttle1's video on the atari came out only like less than a day before this video came out
A few swag genesis games utilize alternating color palettes as a way to save space as frames of a sprite are stored in individual colors of the sprites, with the limitations of the nes having it so sprites can only alternate 3 colors, this can allow only 2-3 sprites created by alternate color palettes but nonetheless could this be utilized so background sprites can be “animated” if you can change the colors of the palettes?
I learned something today!
1:56 is or isn't
Very interesting but also too complicated for me, love it though
would you be willing to do a video with an in depth explanation of mappers? I've been digging around on nes games that are over 40kb, but I'm having trouble grasping the concept
I've mentioned mappers in this video here: th-cam.com/video/Lf1jer8y6Pc/w-d-xo.html
Basically a mapper facilitates bank switching, where a section of memory can be switched out for another portion of memory from the cartridge.
Before the libraries of 50k lines of code that put a dialogue screen up.
Back to the time when software & hardware were working very close to each other 🤷♂️
Register is your number and every kb of Ram have to be used wisely..
6502 is pretty much considered to have the most fun asm to work on, unlike later asm dialect
Now it's hundreds of abstract layers in-between them, a simple variable can cost upto 3-4 instructions to fetch actual boxed value 🙄
Yay! Waiting for GBA videos!
Scott the woz ending jumpscare
Nice video ❤
Fun fact you know what is also 40 KB? the maximum allowed size for metadata for images. Hmm makes you think...
32 kb + 8 kb is the magic number
Pls can you review the megaman 2 ,3 and ducktales architecture ?
No mentioning why 40KB games are still made by homebrewers,except at how nes games are made along with some history behind it,mmmm.
this was literally a video about a homebrewer making a game in 40kb
And he uses Scott the Woz outro
i heard it