Programming the NES - Everything you need to know

Поділитися
Вставка

КОМЕНТАРІ • 130

  • @jatoxo
    @jatoxo Рік тому +18

    I wrote an NES emulator but this was still pretty entertaining. For once seeing things from the perspective of the developer instead of the hardware

    • @StephenAnimations
      @StephenAnimations 3 місяці тому

      How'd you handle converting the ntsc signal to a pixel color?

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

      @@StephenAnimations The PPU still works with pixels, so you can just map the NTSC color byte for the current pixel from the PPU's current color palette to an RGB color using a pre generated color palette (which might be different depending on the console region) and fill an image buffer with the color while the PPU goes through each pixel

  • @mattgio1172
    @mattgio1172 2 роки тому +42

    I doubt I'll ever make a game - but you do such an amazing job of explaining it all! It's super interesting! Also - the music is SO good!

  • @anon_y_mousse
    @anon_y_mousse 2 роки тому +81

    It's almost like there's some cosmic force pushing me to write a game. I have had some ideas floating around for a few decades. Though I'm not so sure I'd want to be limited by the NES, I suppose it would actually work for what I want to do.

    • @InkboxSoftware
      @InkboxSoftware  2 роки тому +29

      Just do it 🗸

    • @jc_dogen
      @jc_dogen Рік тому +17

      maybe try pc engine/turbografx? it's still 6502 but running a lot faster, with more ram, sprites, colors, etc

    • @victor_silva6142
      @victor_silva6142 Рік тому +5

      Just do-it-yourself!🎉🎉🎉

    • @dingusbingus7463
      @dingusbingus7463 Рік тому +2

      @@jc_dogenDepends on the game he wants to make, NES/FC has a lot of charm, the PCE wasn't as popular because of its original price, a lot of people missed out on it because of the price difference until now

    • @Nbrother1607
      @Nbrother1607 Рік тому +1

      another interesting option is the x16 (i haven't tried it yet)

  • @iRemainNameless
    @iRemainNameless Рік тому +2

    How does one ever first start understanding this? Impressive for sure

  • @RealHubertCZGameplayLetsPlay
    @RealHubertCZGameplayLetsPlay 2 роки тому +11

    Great video. I dont plan to program anything on NES, but its cool to see how its done. BTW you deserve well more subs and views

  • @wormwoodroadshow
    @wormwoodroadshow 2 роки тому +11

    Thanks for the excellent starter guide. I believe that programming games for the NES in C is also viable (though it comes with drawbacks of its own). The book "Making Games for The NES" by Steven Hugg is a good tutorial.

    • @thinksie
      @thinksie 2 роки тому +2

      If you have a good compiler, then maybe, but sometimes trying to make sense of something not working correctly would be much harder in C in my opinion, because if you make it in C you may not know some quirks that exist and can destroy your day lol

    • @eldiesoft2198
      @eldiesoft2198 11 місяців тому

      I got that book, and while it is a pretty good tutorial, it does have its drawbacks.
      For one thing, it is a book, and unlike an online forum, it can't be updated if new info or techniques come out. A lot of the software that the book recommends is either from an abandoned project, like Famitracker for the music, or were not made in English, and do not have the best English translation (unfortunately, documentation seems to be a problem across the board with programmers).
      Secondly, the book is specifically for making a platformer. If you want to make a game that is anything but a platformer that scrolls on the Y-axis, then you are probably out of luck. It tells you that you CAN make these types of games, but not HOW.
      Thirdly, it uses a specific IDE (integrated development environment) called 8BitWorkshop, which has its own sprite sheets, sound libraries and compilers, so it doesn't tell you how to make games with something like VSCode (I know that's kinda petty, but I like VSCode).
      Finally, it has great information about sprite and music data, but but doesn't go much further than their own tutorials. If you want to make a sprite that's bigger than 8x8 pixels or import your own audio or music, the guide pretty much says "figure it out," without providing any resources or other guides, and when they do, it's probably a dead link, like Famitracker (sorry to bring that up again, but that is what gave me the most grief when working with it).
      But besides that, it gives a great foundation for making NES games and understanding NES hardware. I would pick it up if you are interested.

  • @YourAppleSalesman
    @YourAppleSalesman Рік тому +1

    This is a great video, while i don’t understand 6502 assembly, i definitely wanna learn it and start development for the nes, im not exactly sure where or what to start with, but your video has made me view the nes/famicom in a completely different angle, in a good way

  • @BryanChance
    @BryanChance Рік тому +1

    Super! All in one video to get started with NES programming.

  • @storebrandchocopops8041
    @storebrandchocopops8041 Рік тому +3

    Inkbox: "So we need to set this to $FF, not $00, to make sure the VBlank registers are ready for writing and now we'll store the variable at the CHRROM address..."
    Me, enjoying the computer words and comprehending nothing: "ah yes, of course"
    Fr though, really enjoyed this, I became curious as to how older games were programmed back in the day out of nowhere and this was a really interesting and somehow terrifying insight into what an absolute nightmare Assembly is to program in!

    • @InkboxSoftware
      @InkboxSoftware  Рік тому +3

      Assembly might seem complicated, but these old machines are really simply designed and the documentation is very thorough. 6502 Assembly isn't harder than any other programming language, I would highly recommend giving it a go.

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

      I'd recommend you check out Retro Video Game Mechanics Explained, and Displaced Gamers, if you like this sort of thing

  • @EricGranata
    @EricGranata 2 роки тому +5

    Yeah! I remember when you had 16 subs. 😊 Congrats on the success.

  • @CelestialHunter-
    @CelestialHunter- Рік тому

    That Gymnopedie 1 rendition is from heaven

  • @theleviathan3902
    @theleviathan3902 Рік тому +1

    everybody sleepin on my boy inkbox when he makin some good shit, def gonna get my old ass NES out and try some dis

  • @NonTwinBrothers
    @NonTwinBrothers Рік тому +1

    Darn, no description link to the chiptune cover of Gymnopedies?

  • @whodidthissmh
    @whodidthissmh 2 роки тому +3

    I was looking for this exactly the other day!

  • @KrunchyTheClown78
    @KrunchyTheClown78 6 місяців тому

    You should do this type of video for the the Atari 7800, because it also deserves to have a much larger homebrew community, its even more interesting than the NES.

  • @EndlessLands
    @EndlessLands Рік тому +9

    Depending on the assembler and linker, there can be issues with:
    .byte "NES"
    .byte $1A
    On some, this will result in the hex dump of the header showing as "CE C5 D3 1A" which will be an incorrect header. There are some ways to fix this that I haven't figured out yet. It seems to be related to PETSCII character translation. But an easy work around is to use this instead as the first header line:
    .byte $4E, $45, $53, $1A
    This will ensure the "NES" is properly in the header.

    • @cuphead8891
      @cuphead8891 4 місяці тому

      Thanks man, helped me a lot :)
      But still the file is 41 KB help :(

    • @cuphead8891
      @cuphead8891 3 місяці тому

      nvm im just dum :)

  • @papipunkrock
    @papipunkrock 3 місяці тому

    Came for the info, stayed for the music

  • @shuttittuppitt9355
    @shuttittuppitt9355 Рік тому

    Not (much) related, but the guys that programmed "Disney's Pocahontas" for the Sega Genesis (a good game) said that they also tried to port it to the SNES, but that it was a LOT more difficult to do that, leading them to eventually give up.

  • @thedave4369
    @thedave4369 Рік тому

    Awesome! I would love to see such a video for the Game Boy as well!

  • @ShahabSheikhzadeh
    @ShahabSheikhzadeh Рік тому

    You deserve 100k+ subscriptions. This is a great educational video.

  • @Weirdo_Studios206
    @Weirdo_Studios206 Рік тому +1

    Honestly didn't even realize that you can code for an NES still. I gotta try making a game at some point on it.

  • @martin128
    @martin128 9 місяців тому

    Great video, thanks for explaining all of this. This would be just a headache if i didnt know any of this.

  • @wawztzta8296
    @wawztzta8296 Рік тому

    holy shit i was listening to this in the background and noticed the awesome rendition of chopin's ballade no 1!

  • @NunyaBizznezz6969
    @NunyaBizznezz6969 Рік тому

    Great video. And if I may, thank goodness for high level programming languages!

  • @AnonymousAccount514
    @AnonymousAccount514 Рік тому +1

    UA-cam is the best thing ever

  • @Xplouding
    @Xplouding Рік тому

    Excellent video!! I think everything is very clear, thank you! It would be nice, a high level explanation like in this video, but about mappers. Nice channel, greetings!

  • @Nikku4211
    @Nikku4211 Рік тому +3

    Mesen is a more accurate NES emulator and has a really good debugger as well.

  • @nickgennady
    @nickgennady Рік тому +1

    Wow very helpful. Subscribed. Can RESET and NMI be written after segments, or do they need to be defined prior to being referenced like functions in C? I am very picky about how my code is structured.

    • @InkboxSoftware
      @InkboxSoftware  Рік тому +2

      No such restrictions, feel free to reference it in any order

  • @violator1017
    @violator1017 Рік тому +1

    After your amazing video, I have nothing to say... except : please, make other NES related videos !
    You're SO GOOD man that even a half moron like me is able to understand the way the NES works...
    Fantastic teaching skills soooooo INSTA-SUB here ! 👍👍👍

  • @Koridai011
    @Koridai011 11 місяців тому

    I used theses methods on wine with my mac, can you use batch with wine

    • @AkamiChannel
      @AkamiChannel 6 місяців тому

      I don't know, but you can figure out how to execute the commands just in your terminal on mac. You may need to figure out where the ca65 and ld65 files are located so you can execute them as commands

  • @retrogamestudios6688
    @retrogamestudios6688 2 роки тому +2

    Excellent keep it up

  • @lilithcal
    @lilithcal Рік тому +1

    My assembly from that era is 8080/Z80. Does the assembler give you the ability to give names to the common addresses you regularly use?

  • @andyortlieb3768
    @andyortlieb3768 Рік тому +1

    You know it's retro when notepad++ shows up

  • @ramakrishnamishra8179
    @ramakrishnamishra8179 2 роки тому +2

    awesome

  • @guestguest8278
    @guestguest8278 2 роки тому +5

    New upload?

  • @draynaruegames
    @draynaruegames 8 місяців тому

    This has been a huge help in getting me started on NES game development. Only issue I'm running into right now is that I can't get YY-CHR to create an 8kb .CHR file, for whatever reason any new file I create is 16kb big instead of 8kb. Any tips on how I can create an 8kb file?

    • @InkboxSoftware
      @InkboxSoftware  8 місяців тому +1

      I have not yet found a way to create anything other than the default 16KB file through YYCHR itself, what I do is copy an another 8KB file (usually a CHR ROM file from another project), open it in YYCHR, then clear the contents for a fresh start

  • @StephenAnimations
    @StephenAnimations Рік тому

    Underated channel

  • @flameofthephoenix8395
    @flameofthephoenix8395 Рік тому

    Oh, I see. I thought this was talking about programming an emulator. Either way it's interesting.

  • @bb.cute.channel
    @bb.cute.channel 2 роки тому +4

    How about programming for SNES and Wii? 👍👍👍👍

    • @elipticalecliptic481
      @elipticalecliptic481 2 роки тому +4

      pretty sure you could program in C or another high-level language for the Wii
      that being said, I'd also be super interested in a video for that

    • @anon_y_mousse
      @anon_y_mousse 2 роки тому +4

      @@elipticalecliptic481 You could program in C for the NES too, it'd just be a bit harder in some areas and easier in others.

    • @4rumani
      @4rumani Рік тому

      @@anon_y_mousse No

  • @famitronic9870
    @famitronic9870 10 місяців тому +1

    I’m a bit confused, I’m trying to compile my background, but it only loads the first 16 lines, so it only draws half of the background. How can I get my full background to draw if I’m using a full 960 bytes (32 rows) for the background?

    • @InkboxSoftware
      @InkboxSoftware  10 місяців тому +1

      Make sure that when you copy your background data to VRAM your loop runs 960 (3C0) times. Reach out with your code if you're still having trouble.

    • @famitronic9870
      @famitronic9870 10 місяців тому

      @@InkboxSoftware Thank you! I’m gonna give it a shot when I got free time 👍

    • @famitronic9870
      @famitronic9870 10 місяців тому

      @@InkboxSoftware I couldn’t quite figure it out, so I reached out via email if you get the chance.

  • @deafomega
    @deafomega 2 роки тому

    it took me a while to realize the odd sounds i kept hearing were part of the background music

  • @artmanstudios7037
    @artmanstudios7037 Рік тому

    Can you tell us on how would you go about making your very own console and game from this in making your own brand? Instead of making it for the NES system. And Talk about the hardware and software side,

  • @SHD69
    @SHD69 2 роки тому +2

    nice!

  • @digitalalchemy1438
    @digitalalchemy1438 Рік тому +1

    Why do you need a CLI to evoke the NMI, as it is non maskable?

    • @InkboxSoftware
      @InkboxSoftware  Рік тому

      Earlier in the program we used the instruction SEI, the Set Interrupt Disable instruction, to return to normal NMI functionality we use CLI, the Clear Interrupt Disable instruction.

  • @kez963
    @kez963 Рік тому

    Omg thank you! 😄

  • @perguto
    @perguto Рік тому

    9:55 nice totally legit Visual Studio you got there. +100 Social Credit

  • @LunaticEdit
    @LunaticEdit 8 місяців тому

    I feel stupid for spending 30 minutes trying to understand why rts was failing but realized he was clearing the stack segment ($100). So if you're following along and use procs, make sure you DONT clear the stack, you kinda need it.

    • @InkboxSoftware
      @InkboxSoftware  8 місяців тому

      Did you call JSR for your PROC?

    • @LunaticEdit
      @LunaticEdit 8 місяців тому

      Yup. The problem was obvious once I debugged with Mesen and saw RTS was returning to $0000.@@InkboxSoftware

  • @m4ank
    @m4ank 5 місяців тому

    4:05 Wrong. The .PNG format was created in 1994, ~10 years after the NES was first released, or even created.

    • @PloopChute
      @PloopChute 7 днів тому

      You might want go back and listen again. He said "The NES was around long BEFORE the .jpg or .png existed"
      If you want to be an insufferable pedant, at least pay attention before you rush in with your eager "Ackchyually" comments.

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

      @@PloopChute na bru dis was 4 months ago

    • @PloopChute
      @PloopChute 22 години тому

      @m4ank So? You were still wrong. 5 day ago, 5 months ago, even 5 years ago, still wrong.

    • @m4ank
      @m4ank 14 годин тому

      @@PloopChute ok jah,,,

  • @JarppaGuru
    @JarppaGuru 9 місяців тому

    this is all we need know. now we can make NES BASIC. pad is byte you can make keyboard LOL

  • @ClassyJacket
    @ClassyJacket Рік тому

    Great video but I got lost on the batch file segment. The cmd gave me errors just like you said might happen in that one part. It says this:
    cc65\bin\ca65 program\cart.s -o program\cart.o -t nes
    program\cart.s:15: Error: ':' expected
    cc65\bin\ld65 program\cart.o -o program\cart.nes -t nes
    ld65:Error: Input file 'program\cart.o' not found
    Did I make a syntax mistake or is there something more to the problem I don't understand?

    • @InkboxSoftware
      @InkboxSoftware  Рік тому +1

      It looks like on line 15 of your assembly code you have an error, fix that and it should compile.

    • @ClassyJacket
      @ClassyJacket Рік тому

      @@InkboxSoftware It was such a simple issue, so embarrassed not really but you know what I mean thank you very much for helping!!!🤘👽👍

  • @juliocesarcastaneda8215
    @juliocesarcastaneda8215 Рік тому

    Could you do a tutorial on how to put NESOS on the NES

  • @micknin-
    @micknin- Рік тому

    How can I configure the size of the Chr rom?
    games like Kirby’s Adventure, super mario Bros 3 and gimmick! has the Chr rom bigger than 8k.

    • @doomtho42
      @doomtho42 Рік тому

      The 4th byte under the “HEADER” segment determines the “amount of CHR ROM in 8K units.” So, for example, if you were to change that value from $01 to $02 you would have a CHR ROM of 16K.
      The PRG ROM can be changed in a similar manner with the 3rd byte in that segment, except for that one each unit of memory equates to 16K instead of 8K.

  • @pedroxdw
    @pedroxdw Рік тому

    Hi, Inkbox! I hope this question isn't stupid... In YY-CHR (build 2021/06/06) when I click on "File > New" I get a new file, but, it has 1 024 tiles instead of 512 and that's why my code doesn't compile. Is there a solution? By the way, your videos are great! Keep going! (Sorry if my English grammar/orthography isn't perfect, English isn't my native language.)

    • @InkboxSoftware
      @InkboxSoftware  Рік тому

      That's something that happens to me too, and I don't know how to create a default smaller file. What I do is just copy a file of the size I want and then treat that like my new file.
      There are ways to increase the amount of CHR ROM in an NES file, but if you want the standard amount, just follow the above.

    • @pedroxdw
      @pedroxdw Рік тому

      @@InkboxSoftware OK. Thank you for your help!

  • @TheBxzr
    @TheBxzr Рік тому

    I keep getting errors about how "....\ca65" is not recognized as an internal or external command, and it doesn't seem like the batch file is recognising it as a command. Is my cc65 okay, because there is no bin folder either?

    • @InkboxSoftware
      @InkboxSoftware  Рік тому

      Make sure your command points to wherever your ca65.exe is located, you may just want to use the full path from your C drive if you're having troubles with the syntax

  • @brockpiano
    @brockpiano Рік тому

    Is it possible to manually write sprite data? Like just using a text editor instead of YYCHR.

    • @InkboxSoftware
      @InkboxSoftware  Рік тому +2

      Sure, at the end of the day the CHR ROM is just binary data, you can use a byte editor to directly edit a file as you wish.

    • @brockpiano
      @brockpiano Рік тому

      @@InkboxSoftware Alright, thanks
      Also, i'm trying to compile the code (9:48) in ca65 but it's giving me:
      Error: Symbol 'RESET' is undefined
      Error: Symbol 'NMI' is undefined
      Nevermind, I don't know what I did but it works now

  • @trxgreder
    @trxgreder Рік тому

    very cool, one thing though. in command prompt, it doesnt do anything when i run compile.bat

  • @aweawd
    @aweawd Рік тому

    I can't do this, I did exactly what you said, and I'm still only getting a gray screen when I should be getting a mushroom.

    • @InkboxSoftware
      @InkboxSoftware  Рік тому

      I'd check your code for a loop that isn't properly closed, and make sure you've allowed interrupts at the end.

    • @aweawd
      @aweawd Рік тому

      @@InkboxSoftware Thank you I've fixed it.

  • @ltecheroffical
    @ltecheroffical 4 місяці тому

    Some emulators emulate the NES better than FCEUX by taking into account the fact due to stuff in the real world then the RAM doesn't start at zero, but random values

  • @Nbrother1607
    @Nbrother1607 Рік тому

    maybe you should do another one for the x16

  • @Destroyanad
    @Destroyanad Рік тому

    How do i reference cc65 in my .bat file at 10:22 ?

  • @thalison-dev
    @thalison-dev 4 місяці тому

    How does one learn that? nesdev wiki isn't a fun place to start out, there is no example codes for you to compile and get code running. nerdy nights isn't suited for cc65.

    • @InkboxSoftware
      @InkboxSoftware  4 місяці тому

      I think a lot of new NES developers start out following video tutorials similar to this one, then once we understand how the basics of the machine works nesdev wiki really becomes the bible to you. At least, that's how I got started.

  • @cheesirehat
    @cheesirehat 7 місяців тому

    How do i get my palette data?

  • @R2AUK
    @R2AUK Рік тому

    🤯 ❤

  • @Adiee5Priv
    @Adiee5Priv Рік тому

    so you've basically covered most of the nerdy nights in one video?

  • @WindowsDrawer
    @WindowsDrawer Рік тому

    I make geometry dash in nes soon it seems easy to do

    • @Destroyanad
      @Destroyanad Рік тому

      How did it turn out?

    • @WindowsDrawer
      @WindowsDrawer Рік тому

      @@Destroyanad I didn't finish it i only made flappy bird bc the scrolling things were too hard and vacation ended

  • @LifeIsGood-qg3xv
    @LifeIsGood-qg3xv 7 місяців тому +2

    "Everything you need to know"
    **only shows how to display a sprite**

  • @kennyroger22
    @kennyroger22 Рік тому

    faz esse tutorial para SNES..
    sou do brasil

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

    Dang u can program anything I wish

  • @The-E-Base
    @The-E-Base Рік тому

    0:29 -- Well, there goes this option...
    ------
    Guess i'll lose hope

  • @jengelenm
    @jengelenm Рік тому

    I want to make a NES game, wtf did i get myself into OH LORD!

    • @Destroyanad
      @Destroyanad Рік тому

      How did your project turn out? I'm learning how to make an NES game too, but i'm thinking the same thing XD

  • @b213videoz
    @b213videoz 9 місяців тому

    Oh please.. NES... Genesis!

  • @beforth
    @beforth 5 днів тому

    Unreadable code... next time use light letters over dark background.

  • @Tutterzoid
    @Tutterzoid 3 місяці тому +1

    Hope in future video tuts that you DON'T play that background music AT ALL :(

  • @retrogamestudios6688
    @retrogamestudios6688 2 роки тому +2

    Fourth

  • @Potatogaming47
    @Potatogaming47 7 місяців тому

    ill code'

  • @thepeternetwork
    @thepeternetwork Рік тому

    I'll stick to Mario Maker. I do better visually.

  • @khayoblego3294
    @khayoblego3294 2 роки тому +2

    First

  • @crawhey
    @crawhey Рік тому

    lol mor on sprites lol