@@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
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.
@@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
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.
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
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.
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
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.
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.
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.
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!
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.
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?
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.
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!
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?
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
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?
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
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.
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,
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?
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.
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
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.
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.
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.
@@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
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
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 ! 👍👍👍
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.)
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.
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.
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
How'd you handle converting the ntsc signal to a pixel color?
@@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
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.
Just do it 🗸
maybe try pc engine/turbografx? it's still 6502 but running a lot faster, with more ram, sprites, colors, etc
Just do-it-yourself!🎉🎉🎉
@@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
another interesting option is the x16 (i haven't tried it yet)
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!
Super! All in one video to get started with NES programming.
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.
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
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.
How does one ever first start understanding this? Impressive for sure
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
I was looking for this exactly the other day!
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
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.
Thanks man, helped me a lot :)
But still the file is 41 KB help :(
nvm im just dum :)
Darn, no description link to the chiptune cover of Gymnopedies?
That Gymnopedie 1 rendition is from heaven
Yeah! I remember when you had 16 subs. 😊 Congrats on the success.
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.
TH-cam is the best thing ever
Great video, thanks for explaining all of this. This would be just a headache if i didnt know any of this.
Honestly didn't even realize that you can code for an NES still. I gotta try making a game at some point on it.
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.
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!
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.
I'd recommend you check out Retro Video Game Mechanics Explained, and Displaced Gamers, if you like this sort of thing
You deserve 100k+ subscriptions. This is a great educational video.
New upload?
everybody sleepin on my boy inkbox when he makin some good shit, def gonna get my old ass NES out and try some dis
Awesome! I would love to see such a video for the Game Boy as well!
Mesen is a more accurate NES emulator and has a really good debugger as well.
holy shit i was listening to this in the background and noticed the awesome rendition of chopin's ballade no 1!
Great video. And if I may, thank goodness for high level programming languages!
Came for the info, stayed for the music
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?
Yes it does
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?
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.
@@InkboxSoftware Thank you! I’m gonna give it a shot when I got free time 👍
@@InkboxSoftware I couldn’t quite figure it out, so I reached out via email if you get the chance.
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.
No such restrictions, feel free to reference it in any order
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!
Excellent keep it up
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?
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
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?
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
very cool, one thing though. in command prompt, it doesnt do anything when i run compile.bat
Why do you need a CLI to evoke the NMI, as it is non maskable?
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.
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,
How about programming for SNES and Wii? 👍👍👍👍
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
@@elipticalecliptic481 You could program in C for the NES too, it'd just be a bit harder in some areas and easier in others.
@@anon_y_mousse No
Underated channel
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?
It looks like on line 15 of your assembly code you have an error, fix that and it should compile.
@@InkboxSoftware It was such a simple issue, so embarrassed not really but you know what I mean thank you very much for helping!!!🤘👽👍
awesome
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.
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.
maybe you should do another one for the x16
How do i reference cc65 in my .bat file at 10:22 ?
I used theses methods on wine with my mac, can you use batch with wine
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
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.
I'd check your code for a loop that isn't properly closed, and make sure you've allowed interrupts at the end.
@@InkboxSoftware Thank you I've fixed it.
Omg thank you! 😄
4:05 Wrong. The .PNG format was created in 1994, ~10 years after the NES was first released, or even created.
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.
@@PloopChute na bru dis was 4 months ago
@m4ank So? You were still wrong. 5 day ago, 5 months ago, even 5 years ago, still wrong.
@@PloopChute ok jah,,,
@m4ank Lol. It's funny when someone can't admit they were wrong, so they turn into a clown rather than admit it. Life must be going well for you. /s.
How do i get my palette data?
nice!
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.
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.
it took me a while to realize the odd sounds i kept hearing were part of the background music
Could you do a tutorial on how to put NESOS on the NES
It's a rom link in that video
Oh, I see. I thought this was talking about programming an emulator. Either way it's interesting.
Is it possible to manually write sprite data? Like just using a text editor instead of YYCHR.
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.
@@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
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
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 ! 👍👍👍
You know it's retro when notepad++ shows up
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.)
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.
@@InkboxSoftware OK. Thank you for your help!
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.
Did you call JSR for your PROC?
Yup. The problem was obvious once I debugged with Mesen and saw RTS was returning to $0000.@@InkboxSoftware
so you've basically covered most of the nerdy nights in one video?
faz esse tutorial para SNES..
sou do brasil
this is all we need know. now we can make NES BASIC. pad is byte you can make keyboard LOL
9:55 nice totally legit Visual Studio you got there. +100 Social Credit
🤯 ❤
Dang u can program anything I wish
0:29 -- Well, there goes this option...
------
Guess i'll lose hope
I make geometry dash in nes soon it seems easy to do
How did it turn out?
@@Destroyanad I didn't finish it i only made flappy bird bc the scrolling things were too hard and vacation ended
I want to make a NES game, wtf did i get myself into OH LORD!
How did your project turn out? I'm learning how to make an NES game too, but i'm thinking the same thing XD
Oh please.. NES... Genesis!
"Everything you need to know"
**only shows how to display a sprite**
Unreadable code... next time use light letters over dark background.
ill code'
Hope in future video tuts that you DON'T play that background music AT ALL :(
lol mor on sprites lol
Fourth
Bruh
First
Bruh
I'll stick to Mario Maker. I do better visually.