Programming a 40KB NES Game (in Assembly)

Поделиться
HTML-код
  • Опубликовано: 26 янв 2025
  • ИгрыИгры

Комментарии • 308

  • @soryabuscompany
    @soryabuscompany 11 месяцев назад +302

    I've never seen a more thorough technical explanation of the NES in such a short time

    • @gblargg
      @gblargg 10 месяцев назад +11

      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.

    • @RedTail1-1
      @RedTail1-1 Месяц назад

      Pretty sure this guy was programming for the NES when it was new lol

  • @Arcad3n
    @Arcad3n 11 месяцев назад +113

    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.

  • @JadeLombax
    @JadeLombax 11 месяцев назад +135

    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.

    • @InkboxSoftware
      @InkboxSoftware  11 месяцев назад +37

      That's sounds way cool, do you have any stuff I can check out?

    • @JadeLombax
      @JadeLombax 10 месяцев назад

      ​@@InkboxSoftwareI have an Itch page w/ some of my games (Jadelombax is my username there), tried to post a link, but RUclips keeps deleting my responses.

    • @themadmallard
      @themadmallard 10 месяцев назад +17

      1kb? what platform are they made for?

    • @JadeLombax
      @JadeLombax 10 месяцев назад

      ​@@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.

    • @s3rverlord
      @s3rverlord 10 месяцев назад +29

      You can imagine that game in your brain and play it.

  • @skylark.kraken
    @skylark.kraken 5 месяцев назад +73

    0:02 I still find it remarkable how Golf on the NES became so popular that people started playing it IRL. They say that kids now adays go crazy over technology fads but they're the ones who created a sport from a game

    • @Raderade1-pt3om
      @Raderade1-pt3om 4 месяца назад +6

      Golf originated from a NES game!?

    • @mirabilis
      @mirabilis 3 месяца назад

      Never heard this before. Sauce? Ridiculous.

    • @skylark.kraken
      @skylark.kraken 3 месяца назад +9

      @@mirabilis golf simply didn’t exist before the NES invented it and the hype hasn’t died down

    • @mirabilis
      @mirabilis 3 месяца назад +2

      @@skylark.krakenI asked for a source. You guys are trolling me. People have been playing golf since at least 14th century.

    • @skylark.kraken
      @skylark.kraken 3 месяца назад +11

      @@mirabilis It's a conspiracy that golf is older, the Ilclubinati changed the date and origin of golf to make it seem more prestigious than simply being based on a NES game. They've been rewriting history books and influencing modern media that is set in the past that mentions golf (if you're watching something based in the 50s and they mention golf it just means they've been paid off). It's crazy how many people have been influenced by the Ilclubinati and have accepted their lies

  • @ego-lay_atman-bay
    @ego-lay_atman-bay 11 месяцев назад +163

    The end really caught me off guard. It was such a scott the woz ending.

    • @itskdog
      @itskdog 10 месяцев назад +9

      *3D Dot Game Heroes

    • @ego-lay_atman-bay
      @ego-lay_atman-bay 10 месяцев назад +16

      @@itskdog Yeah, I know, but I feel like that song is most commonly associated with scott the woz.

    • @Therap3
      @Therap3 10 месяцев назад +4

      ​@@itskdogwow I had no idea it was from that game. Thanks!

    • @NotSomebodyThatYouUsedToKnow
      @NotSomebodyThatYouUsedToKnow 9 месяцев назад +5

      A Scott vid was recommended after this lol

    • @kirabey8946
      @kirabey8946 8 месяцев назад +1

      Its the old one too...

  • @stefanmilicevic5322
    @stefanmilicevic5322 11 месяцев назад +25

    The amount of effort you put into each programming project is truly inspiring. Keep up the great work!

  • @coolbrotherf127
    @coolbrotherf127 10 месяцев назад +20

    It's so cool that Nintendo invented golf.

    • @KingLich451
      @KingLich451 8 дней назад

      atari invented all sports 😅

  • @bassguitarbill
    @bassguitarbill 11 месяцев назад +35

    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!

  • @StereoMadnessss
    @StereoMadnessss 11 месяцев назад +75

    Assembly is just amazing really on how small its code can be when it's compiled

    • @williamdrum9899
      @williamdrum9899 11 месяцев назад +20

      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

    • @bradallen8909
      @bradallen8909 10 месяцев назад +5

      Assembly isn’t compiled. It’s assembled.

    • @rethardotv5874
      @rethardotv5874 10 месяцев назад +1

      Shouldn’t be C with modern compilers as efficient as writing assembly?

    • @rya3190
      @rya3190 10 месяцев назад

      ​​@@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...

    • @rusi6219
      @rusi6219 7 месяцев назад

      ​@@rethardotv5874if that was the case you'd never see inline assembly in C code

  • @ETK_800
    @ETK_800 11 месяцев назад +8

    can't wait to see what you do on the gameboy. Love your videos!

  • @Adiee5Priv
    @Adiee5Priv 11 месяцев назад +14

    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

    • @ricarleite
      @ricarleite 10 месяцев назад +2

      But vram stores the pallet and table name information doesn't it

    • @Adiee5Priv
      @Adiee5Priv 10 месяцев назад +2

      @@ricarleite yes, but that's something else

    • @ricarleite
      @ricarleite 10 месяцев назад

      @@Adiee5Priv I mean he didn't claim vram stores a bitmap representation of the screen

    • @Adiee5Priv
      @Adiee5Priv 10 месяцев назад +1

      @@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

  • @alexandredecarvalho4357
    @alexandredecarvalho4357 11 месяцев назад +3

    We need more of these!! :D thank you for your explanations!

  • @famitronic9870
    @famitronic9870 10 месяцев назад +4

    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. 👍

  • @Sinistar1983
    @Sinistar1983 11 месяцев назад +10

    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.

    • @Bobbias
      @Bobbias 11 месяцев назад +2

      It's a shame their visual programming interface is awful though. Makes doing anything reasonably complex a nightmare without learning the actual scripting language.

    • @Sinistar1983
      @Sinistar1983 11 месяцев назад +1

      @@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.

  • @dinaari-vgm
    @dinaari-vgm 10 месяцев назад +4

    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

  • @FloatingSunfish
    @FloatingSunfish 11 месяцев назад +20

    The NES will always be my favorite console.
    It helped save the video game industry!

    • @nebularain3338
      @nebularain3338 5 месяцев назад +5

      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.

  • @huskenator857
    @huskenator857 11 месяцев назад +4

    Love your videos dude, can’t wait to see you unpack the gameboy color. Also Scott The Woz jump scare

  • @TheCoolestDylan
    @TheCoolestDylan 28 дней назад

    I love how you explain everything. I’ve been trying to learn nes dev and you making it make sense

  • @williamdrum9899
    @williamdrum9899 11 месяцев назад +8

    Later games used "bank switching" to fit more code/data than the NES's 64k address space would typically allow

    • @lemdixon01
      @lemdixon01 7 месяцев назад +2

      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.

    • @williamdrum9899
      @williamdrum9899 7 месяцев назад +3

      @@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

  • @IraKane
    @IraKane 10 месяцев назад +2

    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!🤪

  • @shinyagumon7015
    @shinyagumon7015 11 месяцев назад +259

    My guess is black magic or programming if there's a difference between the two 😂

    • @error.delete4945
      @error.delete4945 11 месяцев назад +48

      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.

    • @dacueba-games
      @dacueba-games 11 месяцев назад +14

      "Is this too much voodoo?"

    • @angeldude101
      @angeldude101 11 месяцев назад +22

      As a programmer and self-proclaimed sourcerer, no; there isn't a difference.

    • @designator7402
      @designator7402 11 месяцев назад

      ​@@error.delete4945 I will not remove the KillPidgeon() method from my code, no matter who the IRS sends!

    • @KertaDrake
      @KertaDrake 10 месяцев назад +3

      Simply speak the binary incantations and technomagic will occur. You use hex for hexes, of course.

  • @miasma82
    @miasma82 4 месяца назад +1

    I don't play any modern games. I love these old consoles so much. They bring back so many memories

  • @Holital
    @Holital 11 месяцев назад +2

    Yooooo I love your channel!!!

  • @Roid33
    @Roid33 11 месяцев назад +36

    Scott the Woz outro whatt

  • @Squigdude13
    @Squigdude13 10 месяцев назад +1

    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

  • @adryanlucas096
    @adryanlucas096 11 месяцев назад +10

    Clicked as soon as i saw the notification 🔥🔥🔥🔥🔥 ur videos are always the best!

  • @douggiebee
    @douggiebee 4 месяца назад

    That was incredible. I was just thinking that something like this would be very interesting, and here it was, waiting for me to find it.

  • @mukulnag1578
    @mukulnag1578 11 месяцев назад +1

    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

  • @PanoptesDreams
    @PanoptesDreams 10 месяцев назад +5

    Restrictions birth creativity

  • @1008md
    @1008md 10 месяцев назад

    That was amazing. I didn’t understand a lot but was still mesmerized!

  • @maximeeuziere
    @maximeeuziere Месяц назад

    Each 8x8px tile of the background nametables can use a distinct palette index. They are indeed grouped in chunks of 4 tiles internally because each index is encoded on 2 bits, and the whole chunk is represented by 8 bits (1 byte), but the index of each tile of the chunk can be set individually. ;)

  • @JJisntHere.
    @JJisntHere. 5 месяцев назад

    I like the microphone used here! really nostalgic sounding!

  • @merman1974
    @merman1974 9 месяцев назад

    That was a brilliant explanation and a fun game as a result. Great work.

  • @Controllerhead
    @Controllerhead 11 месяцев назад

    What a wonderful explanation, sure with i had this video when i started years ago. Great work!!!

  • @thechosenone729
    @thechosenone729 9 месяцев назад

    Amazing video as always thanks for your work.

  • @MoustiluigiRandom
    @MoustiluigiRandom 11 месяцев назад +1

    Amazingly well explained.

  • @intangiblematter_misc
    @intangiblematter_misc 10 месяцев назад +2

    I wasn't going to comment, just a really solid video.
    Then the Scott the Woz ending whiplash hit

  • @erdemmemisyazici3950
    @erdemmemisyazici3950 11 дней назад

    This is valuable knowledge. Thanks man.

  • @The-E-Base
    @The-E-Base 3 месяца назад

    3:03
    Fun fact, some later games (including a few bootlegs) use all 4 nametables.

  • @jabrowski_
    @jabrowski_ Месяц назад

    Bro great video. Liked and subbed

  • @RareSun
    @RareSun 10 месяцев назад +1

    Can't wait to watch the episode where you program a 3D Mario for the GameCube in 10 years.

  • @Mobik_
    @Mobik_ 10 месяцев назад +1

    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)

    • @InkboxSoftware
      @InkboxSoftware  10 месяцев назад +3

      You can use C for the NES, too, I just prefer assembly

  • @skRapKlan
    @skRapKlan 11 месяцев назад

    Nice work! Thanks for the cool video!

  • @BianicEpicVideos
    @BianicEpicVideos 5 месяцев назад +1

    Thank you for this video

  • @Clancydaenlightened
    @Clancydaenlightened 10 месяцев назад +2

    Hint they didn't do it with only 32k rom and ppu rom
    Kirby on nes was around a 1megabyte cartridge

  • @mcleodautomation
    @mcleodautomation 10 месяцев назад +1

    Your audio is SOO good - keep it up! Love the dry mic sound tbh.

  • @cdkw2
    @cdkw2 9 месяцев назад

    I would love to see the gbc videos, good luck!

  • @golvellius6855
    @golvellius6855 10 месяцев назад

    Incredible😮 i learned a lot in this video❤❤❤

  • @FernieAriel
    @FernieAriel 10 месяцев назад

    1:40 that’s the music from Goal 2, one of the best soccer games of all time. I’d recognize it anywhere.

  • @alexela_
    @alexela_ 11 месяцев назад +1

    Am I on time?! I'm enjoying it already

  • @taagoallas3336
    @taagoallas3336 11 месяцев назад +2

    It's always a good day when Inkbox uploads!

  • @oa_math
    @oa_math 6 месяцев назад +1

    Careful using Nintendo characters in your game, they might swat your house

  • @CeceliPS3
    @CeceliPS3 13 дней назад

    It's insane how difficult that is. It you did like a tech demo. Imagine coding the entire Kirby's Adventure back then. OOF

  • @majicweather4890
    @majicweather4890 5 месяцев назад +1

    Look up Micro Mages, it's made with only 40kb. Dude that made it also made a "making of" video

  • @Oler-yx7xj
    @Oler-yx7xj 7 месяцев назад

    Now I want to try to make NES games again. Touching it really made me appreciate how big a kilobyte is

  • @monchytales6857
    @monchytales6857 3 месяца назад

    fun fact: on reset it only clears certain parts of ram, this was exploited to make some games able to set ram values which are then used by other games to get extra lives or levels or such, famous example is using tennis to break super mario bros

  • @zed54
    @zed54 3 месяца назад

    Had this on in the background and the old scott the woz outro music jumpscared me

  • @ShinoSarna
    @ShinoSarna 11 месяцев назад +1

    You inspired me to try to make a version of Minecraft for NES.

  • @jumbledfox2098
    @jumbledfox2098 10 месяцев назад

    What an epic video!

  • @mirabilis
    @mirabilis 5 месяцев назад +2

    6:45 this left side masking is achieved by manipulating some bits at address $2001.

  • @ava0003
    @ava0003 3 месяца назад

    It would be cool if at different score thresholds, the color of the background changed

  • @EWARS_2
    @EWARS_2 11 месяцев назад +5

    Scott the Woz outro?! (Breakout?)

  • @ScreamLoud763
    @ScreamLoud763 3 месяца назад

    Mario was really made with 40,000 sets of 8 lightbulbs

  • @aplanebagel
    @aplanebagel 10 месяцев назад

    Well explained !

  • @anon_y_mousse
    @anon_y_mousse 10 месяцев назад +1

    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.

    • @rusi6219
      @rusi6219 7 месяцев назад +1

      C23 is what happens when python script kiddies infiltrate an established programming language

    • @anon_y_mousse
      @anon_y_mousse 7 месяцев назад

      @@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.

  • @lorenzodiambra5210
    @lorenzodiambra5210 5 месяцев назад +4

    the difficult thing was not to put them in 40 KB, but rather to make them run with 20 bit of RAM

  • @cube2fox
    @cube2fox 11 месяцев назад

    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.

  • @elijahvincent985
    @elijahvincent985 5 месяцев назад +1

    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?

    • @InkboxSoftware
      @InkboxSoftware  5 месяцев назад

      Yes, but it would require keeping track of PPU cycles

  • @ehippo1
    @ehippo1 11 месяцев назад

    Nice video ❤

  • @maazali6283
    @maazali6283 11 месяцев назад +1

    Your my inspiration to become a better programmer

  • @TheUKNutter
    @TheUKNutter 3 месяца назад +1

    4:48 what is this game from?! I remember it so well

    • @r3ebl
      @r3ebl 2 месяца назад +1

      Kirby

    • @Yehor-v7y
      @Yehor-v7y 21 день назад

      Kirby

    • @TheUKNutter
      @TheUKNutter 21 день назад

      It’s not Kirby

    • @Yehor-v7y
      @Yehor-v7y 17 дней назад

      @@TheUKNutter what

    • @TheUKNutter
      @TheUKNutter 16 дней назад

      @@Yehor-v7y talking about the music

  • @9a3eedi
    @9a3eedi 11 месяцев назад +2

    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

  • @KrunchyTheClown78
    @KrunchyTheClown78 8 дней назад

    I really wanna see videos like this about the Atari 7800.

  • @Lowkeychilldroid
    @Lowkeychilldroid 6 месяцев назад

    Daaaaam, this guy knows everything about hardware

  • @deusexmaximum8930
    @deusexmaximum8930 10 месяцев назад +1

    1:56 is or isn't

  • @ErdrickHero
    @ErdrickHero 10 месяцев назад +1

    I hope you're not just using GB Studio. A channel like this needs real programming.

    • @InkboxSoftware
      @InkboxSoftware  10 месяцев назад +2

      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

  • @codeway4374
    @codeway4374 10 месяцев назад

    Nice vid !

  • @modlich_303
    @modlich_303 11 месяцев назад +3

    what about the Minecraft? since you are moving on from NES, and that Minecraft is on NES, what's gonna be with that?

    • @retroboi128thegamedev
      @retroboi128thegamedev 5 месяцев назад

      The 8-bit Minecraft project is on the Commander X16, I don't think it would be possible on the NES without several compromises

  • @spg3331
    @spg3331 11 месяцев назад

    Loved playing the game boy color as a kid!

  • @KingF-hi4wg
    @KingF-hi4wg 11 месяцев назад

    I’d like to see this guy cover sega master system homebrew

  • @kamikazeeOG
    @kamikazeeOG Месяц назад +1

    Hehe. He said PPU

  • @DerKlemm-Crafter
    @DerKlemm-Crafter 11 месяцев назад +2

    You are one of the best programmers I have ever seen, though I don't understand much😅

  • @chobies5383
    @chobies5383 11 месяцев назад +1

    SCOOT THE WOZ OUTRO MUSIC?

  • @NikodAnimations
    @NikodAnimations 8 месяцев назад

    I think a jump is better represented by a parabola, with the amount going up constanly reduced by a constant number.

  • @williamfabuien1125
    @williamfabuien1125 5 месяцев назад

    I will continue to follow and watch I hope you make many more.

  • @deltapi8859
    @deltapi8859 10 месяцев назад

    beautiful svg art in the video.

  • @lafcursiax
    @lafcursiax 10 месяцев назад

    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...

  • @williamfabuien1125
    @williamfabuien1125 5 месяцев назад

    Great video brother

  • @bootime265
    @bootime265 11 месяцев назад +1

    time for a cool video

  • @Sky_kidharry
    @Sky_kidharry 8 месяцев назад

    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?

  • @Mobik_
    @Mobik_ 10 месяцев назад

    Scott the Woz?! Is that you at the end?!

  • @OmeedNOuhadi
    @OmeedNOuhadi 9 месяцев назад

    Congratulations!

  • @Only_Some
    @Only_Some 4 месяца назад

    wow innovation and not copying? cant wait to see what this video will entail

  • @potatogameryt
    @potatogameryt 10 месяцев назад

    Wait is it actually 60 frames per second for a CRT? I thought it was 24?

  • @ChaossX77
    @ChaossX77 10 месяцев назад

    Real original ending music.

  • @MarkRayers
    @MarkRayers 9 месяцев назад

    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.

  • @TheGuyWithAnOldBuick
    @TheGuyWithAnOldBuick 10 месяцев назад

    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

    • @InkboxSoftware
      @InkboxSoftware  10 месяцев назад

      I've mentioned mappers in this video here: ruclips.net/video/Lf1jer8y6Pc/видео.html
      Basically a mapper facilitates bank switching, where a section of memory can be switched out for another portion of memory from the cartridge.

  • @nunyabeeznutz5286
    @nunyabeeznutz5286 11 месяцев назад

    Fun fact you know what is also 40 KB? the maximum allowed size for metadata for images. Hmm makes you think...

  • @familiapdantas4646
    @familiapdantas4646 4 месяца назад

    This video remember me 2014

  • @lazysh508
    @lazysh508 9 месяцев назад

    really helpful