*UPDATES* - There is a problem with spaces in paths when using VSCode to build the project. If you run into issues, try moving the project folder from the Desktop to the C:\ (or any other path that doesn't contain spaces) [Thanks @Plazma Dolphin & @keithstone001] - Mesen is a very nice alternative emulator to FCEUX for game programming, check it out: www.mesen.ca/ [Thanks @Nesrocks Gaming Videos ]
Good computer users NEVER user the desktop to save files, especially due to all the clutter it causes. If you're a programmer, beginning or other wise, you need to learn proper folder structuring ASAP. That includes not using spaces in folder names, regardless of whether or not the OS allows it simply due to not all compilers recognizing it. And as a programmer, you never know when you're going to try something different.
@@sirgouki6207 So, the main tips are to never use the desktop to save files (What, just because it causes clutter?) and don't use spaces in folder names (which I assume is true of filenames too)?
@@inceptional It's not just that it's clutter on the desktop, it's that if you use the desktop this way you're mixing all kinds of clutter. The desktop is a soup of app links and other items on install, random temp files from things, it's very easy to accidentally mess with. By default you'll also copy the files over to every windows computer you log into with your personal account. Projects have huge numbers of files and backing all those tiny files over to every desktop is bad. The desktop was designed for light items, like shortcuts. The desktop should be disposable because that's how the OS treats it (Except for deleting a single shortcut. One PM thought that was really important to make a big deal about many years ago. Lots of things at Microsoft could be traced to one random PM or another. For example, I think I know who was responsible for complaining when you try to switch browsers). Many tools don't like files on the desktop for reasons, though it's not very common to not be able to handle it. You honestly don't want to use either Documents or Desktop for source code if you can avoid it because backing up to OneDrive is messy for source code even when you're one person. Using the VS20XX default option of C:\users\\source epos and backing up to github is far better and not very hard anymore. As for the spaces ... you shouldn't have to care. That attitude is fairly old. I'm not saying it doesn't happen, but it's rare enough nowadays that you shouldn't look at it as critical. If you hit it, you can usually solve it by either using quotes or the 8.3 file name (look it up). For "reasons" it shouldn't come up in modern software unless a toolmaker makes a mistake. Because tools are so likely to fail if they can't handle spaces nowadays it's almost certainly on an old tool or a tool used by a very limited set of people one way or another. I do not always follow the spaces rule nowadays. I am more likely to because I am old and crusty, but if the spaces naming is better I will avoid it. Additionally, if spaces is a thing that's supposed to work and if you avoid using spaces you're potentially creating software that's part of the problem. There's a time when we need to move past attitudes and except the small risk of bad old stuff. If you're aware, you can usually fix it early. I have only hit it once in the past half decade in a way that can't be fixed with quotes or 8.3 because the person who wrote it wasn't around the company anymore. I fixed the code. World moved on. Sometimes you might not be able to do this and you might have to rename your folders. I've also done this a few times in the past couple decades. More often a long time ago. Rarely a big deal when you hit it. The spaces in folders issue is not like the desktop. Saving projects on the desktop is bad all around. Spaces is low risk and something you should spend little time worrying about but be aware of. We're talking about 6502 stuff in this video, but modern programming shouldn't worry about 1980's problems.
I can't tell you how much I appreciate this video. Clear, patterned speech. Direct repeatable steps. Well designed structure and cadence. Masterfully done tutorial.
I am a computer engineering student and I honestly wish you'd teach me all my subjects. I like how detailed your explanations are and how you always back up what you say. Criminally underrated channel
Congratulations for the video. I'm an experienced software developer and a I've never found an easy assembly tutorial making me possible to approach the language.
to anyone following this video as of 4-2-2024, the extension used needs to be downgraded to v 1.2.4, otherwise the c65a macro assembler will have problems and fail to load.
I've always had a pretty good idea of how the NES works and know just enough asm to be dangerous.. but thanks to this and your other NES assembly videos, I just built my first NES rom today! Awesome stuff, looking forward to more from you. :)
That’s fantastic! Helping people like yourself is one of the big reasons why I started the channel. Thank you so much for the kind words! I’m thrilled that you’re out there assembling ROMs :D
@@pmanolak you can look at my comment about 6 months ago. I built a dev environment on a Debian 11 Linux VM. Let me know if my comment is clear enough to help.
I am having trouble finding NES assembler vids. Everyone seem to be doing tuts in C. But I want to do assembly. Are there any resources for writing using cc65 assembler?
Your videos have so much dedication and passion that you just can't help but be amazed. I really loved this particular video as I just got interested in creating video games for the NES. Thank you very much for what you do and with such quality and excellence.
If you're having problems finding ca65: Build without config when opening the CTRL+SHIFT+P menu, make sure you've opened the demo folder as a workspace.
I love how you explained what was happening at every step. I'm a total beginner and using Linux instead of Windows and it still all worked. I knew what I had to change because you took the time to go more in-depth than just listing off the steps.
Something useful is if you're having difficulty with getting it to compile install ca65 version 1.2.4 not the newest one because they removed some of the problem matchers.
I followed the described steps, but on macOS, and was able to build a demo ROM! I've installed cc65 with brew and set /usr/local/bin/cl65 as "executable" for cl65. Thank you for clear instructions, it was a breeze. I'll give a try to more of your tutorials :)
For those of you with macs in the year 2023, install both FCEUX and cc65 with brew. Set /opt/homebrew/bin/cl65 as "executable" for cl65. To start FCEUX, just type fceux into terminal.
@@davidbates3353 that's odd, but due to the same issue I stopped by homebrew project. fceux started to crash, since the latest update. (I use one installed from brew, and one downloaded.) I just starting it from terminal several times, and on 2-3rd start, it works. I also use Messen via Wine, which is also helped me. I am on MBP M2, latest Sonoma.
I never would have thought to explain what syntax highlighting is in a programming video, it is really awesome how you are able to get in the mind of a newbie.
When I first started programming most editors didn’t have syntax highlighting. So I remember vividly the first time I used an editor that did (Visual Basic 3.0 in windows 3.11) and how game changing it was.
For whatever reason I had to restart VSCode after editing the tasks.json, otherwise I just kept getting a cryptic error message "Error: The ca65 task detection didn't contribute a task for the following configuration". I'm on Linux though, so maybe its a quirk specific to my system.
I have over 10 years of software engineering experience. You've done a great job teaching this, especially for the beginners. Meanwhile I'm taking your build commands and setting up a Makefile and writing the system deps into a Brewfile, but I really like how you get people a simple dev environment right off the get go with VS Code.
I have to say that you are really good at making tutorials. I mean idk for which target group was that video? I thought for beginners because you make the steps so simple and clear. But also as an advanced programmer my self I learned something and did not get bored over topics I already know about. I really admire your teaching skills sir ^^.
Mm yeah I get this a lot. I didn't have a target audience for the video. I kinda just thought "What are the essential things you need to begin programming," narrowed down that list, and tried my best to be thorough explaining each part. In retrospect I could have probably cut a lot of the "Click this link, press this button" stuff and just showed it as I explained broader topics.
@@NesHacker pls do not get me wrong. I use Jetbrain products most of the time and vs code sparingly. I use it more for really small stuff where notepad ++ or gedit do not cut it. Therefore I am by no means an expert in this ide. And I have learned a lot. I think your skill in explaining is highly underrated. Sadly I have Linear Algebra Examen in like 6 days and can not start NES hacking ^^
Awesome video. I would like to add here a nice extension / ide, called Retro Assembler. It is able to compile not only for the nes, but other variants of the MOS65 family, the z80 and the gameboy cpu... Your videos are so great that it reignited my desire to build a simple game for the gameboy. Let's see what I can get out of that. Please keep it up!
First step, install VS Code and never having used it before, now starts writing 6502 assembly language. Next tutorial: Build & Fly Your Own Rocket - First step, install OpenVSP... 😂😂😂
I cannot get the hello to display in FCEUX - in VS Code, within the demo.nes, I see white text with red background displaying "null" and question marks on white diamonds. 14:06 shows two options in the search bar for 'select editor for demo.nes' with two choices "built-in" and "Hex Editor" and I only see "built in." I went through the steps for cc65 and downloading the demo project three times. Also per the pinned update at the top of this video's comments, I put moved everything from the Desktop to the C:\. I am just lost. I am going to stop for a while and wait to see if anybody has any comments or suggestions and then try to resume. Great videos, btw.
1. To see "Hex Editor" you have to install the "Hex Editor" extension by Microsoft. 2. I just ran through the demo, everything worked on my end. Are you opening the "demo.nes" ROM in FCEUX? You cannot open and play ROMs in VS Code. Cheers
I know this video is 2 years old by now, but I usually use Windows for this, but I'm trying to learn Linux so I've been trying to do this on Linux, but can't figure out how to path the cc65, could anyone help?
Today I learned a lot trial and error but finally succeeded in turning a jpg photo into a nes rom, loaded via n8 everdrive with only 4 colours on the palette it’s tricky to get the balance but wow it’s pretty cool it looks very effective especially horror themed images
You provided the tutorial for Windows. All of this should be possible on better OSs, so it would be appreciated if you could provide or link to a tutorial for them.
There sure is, you can use cc65. But honestly it’s fairly hard to write pure C for NES games especially when handling rendering code and such, so you end up having to do a lot of things in assembly anyway.
I'm at the specific step of defining the build task. I think I followed the instructions correctly, but when I open the command pallet and type configure default and press enter, the switched menu does not show ca65 so I am quite lost. EDIT: Okay, I know where I went wrong. your instructions just say now that we have the project files loaded, but I opened the files incorrectly for this tutorial. i was prompted to Open the Project Folder, but that's not correct either! you need to use the File Menu and Open Workspace from File specifically, then select the .code-workspace in order for the last steps to work correctly as well. I think this is an important distinction. this is a great video, and i'm saddened to see the silly, non-constructive comments on this diamond of a video.
This channel is a pure GEM! Finally a clear start on NES dev, time to dive in the other courses and fiddling with my childhood thank you! P. S.: Extra kudos for the Berkserk wallpaper!
If you're still struggling with this, I just got it working on Ubuntu by changing my first line to "executable": "~/develop/cc65/bin/cl65" in the cl65config.json. This is going to be dependent on where you installed your CC65, but changing the slashes from \\ to / was the key for me.
Amazing Video! I suddenly feel interested in taking a chance on NES development. To all those who read the comments, any idea on how to change the executable path in cl65config.json? I'm running VS Code in Linux, dist. Ubuntu 20.04.
Thanks! So for the cl65config.json file just delete line 2 (it starts with “executable”) If you installed cc65 via apt-get or whatever, it should be in your path, and the plugin should be able to automatically find it. Let me know if you run into any other issues, I haven’t tried the whole setup on Linux yet, so I’m curious to see how it goes!
@@NesHacker So this is the message I'm getting after following what you said on your comment. From what I can tell cl65 seems to be in path and if I run the same command in a terminal it compiles the NES ROM just fine. Not sure what I'm missing but I guess if I can get it to compile from the terminal I'll live with it. > Executing task: cl65 "/home/user/Projects/NES/DevEnvironmentDemo/demo.s" --verbose --target nes -o demo.nes < /bin/sh: line 1: cl65: command not found The terminal process "/bin/sh '-c', 'cl65 "/home/user/Projects/NES/DevEnvironmentDemo/demo.s" --verbose --target nes -o demo.nes'" failed to launch (exit code: 127).
@@NesHacker Oh and the ROM runs fine in FCEUX after compiling. Any further help would be appreciated for the sake of streamlining the process of compiling but thanks for all the info you've provided thus far. I love this channel.
@@NesHacker So did a little more digging and it looks like VSCode is trying to run using SH instead of BASH so I think I just need to dig through the settings to get it to use the correct shell for the terminal. I don't expect support on this but I'm just posting for posterity in case someone runs into the same issue I do.
Thank you so much for this, other and following videos. Finally a professional who understands the amateur's doubts and issues who’s trying to dive into a niche topic. Can't wait to watch more of your content and try it myself! Great filming equipment, video editing and pleasant voice btw. Please keep up your excellent work!
Brilliant work. Top notch tutorial video. Yes, the visuals are great, the audio is great and his interaction with the viewer is great, but he actually knows what he is doing and gets it across really well. Total professional.
Thank you so much for all your videos on NES development. I've watched them all a thousand times. I hope you keep uploading more on NES development. Thanks!
I like this, maybe you go into stuff a little to detailed but for complete coding beginners this could be a good thing. Im hyped for the rest of the series
Indeed, the idea is to help people who are just getting started both with coding and with 6502. For more advanced people the videos might be a bit too fundamental. Thanks for watching :D
I grew up playing Atari 2600 and NES. Now I work as a web developer but I have always been curious about game development. I'm gonna follow your videos just to see how far I can get. Thank you.
Really good video. I started with nesdoug tutorials. My tools are notepad++, cc65, ca64. As emulator i used fceux but mesen improved a lot have to say with his ppu and stability.
Heck yeah! I think sometimes folks get bent out of shape over the *exact* tools folks use, but it really comes down to personal preference and what you're trying to accomplish :D I switched from FCEUX to Mesen after viewers suggested it, it can still be a bit *crashy* for me, but honestly the interface is pretty good.
Hello, im using Notepad++ either, its cool low weight text editor and i like it. Can i ask please how can you compile demo.s to demo.nes file while using Notepad++? And does it means u only need demo.s file for making a game? Im just starting and cant find these simple answers, sry for dumb question 😢😢🥺
I wish VScode task configuration was more straight forward. I created .bat script instead that runs build commands. If you add ca65 and fceux binary folders to environment PATH variable then it's possible to call both executables by name. It is possible to call fceux/fceux64 with rom path and that will automatically open the rom.
Haha, I remember that feeling! Assembly definitely seemed super intimidating when I first started, but after learning the basics and working with it for a while I got more comfortable and it started to really enjoy it. I'm working on my next installment of the assembly crash course, which will come out next week... So make sure to watch the first part and drop me some questions on that video if you need help with anything :D
When I went to build default config, the .vs folder was filled with c_cpp_porperties, settings and launch json while erroring out the last 2 of the problemMatching items. (ls65-unresolved/config) any ideas why it would do that with your current workspace?
I would like to know how to create my own console like nes and sega! the. create my own games for that. in other words make it everything from scratch hardware and software maybe even the game engine! can you make videos on this? now that we have 3d printing and able to order circuit boards to make hardwares should be a great learning and fun project to create your nes or sega console with your own brand and features! such as adding hdmi or usb or hybrid of both emulation and naked.
That's incredibly ambitious... I love it! So building a system from the ground up is a pretty big undertaking, and I think it would be hard to just do one or two videos on the topic and make them good. That said, I too have thought about this from time to time, and one of the missions for the channel is to explore various aspects of the hardware and software design. So maybe over time I can approach the subject more and more :)
@@NesHacker well there be nothing else like this out there! this will also be the ultimate retro game development for the future world! so however many videos it takes! then after that your have copycats which will do more videos which you may not need to do it all by yourself! but we do need someone well verse in this subject to tackle this monster and lay it forward on the table so that those can learn and adapt and update any errors or add features that otherwise old consoles of that generation just didn't have or though of! to learn how to make and code your own console with your own games and seeing others make games for it sense this assembly code would be universal should allow for great projects and lot's of ambitious projects as well that can drive up the market and bring forth something old from the past a legacy that didn't die because we forgot about it but because we just reimagined the wheel and now it will never die! this is where games began after all! and now this should lay down the foundation until one day it is though in schools again!
I appreciate the sample code to get me started. NesDev is a bit overwhelming, but it makes more sense now that I have actual working code to reference. One question, and this may have been answered in another video, but when you start drawing the sprites there is a comment that says "Why do I need these here?" referring to the first two writes being blank sprites. Well, why DO you need those there? It seems that the first two sprites go blank at the end of the frame. Can you tell me why that is?
6:18 question why install ca65 if that not include assembler. AND not choose cc65 when it was that list LOL and yes this i have and use notepad. only need unpack
hey. I would give you a feedback in this video. I have been developing for, I don't know, 20 years+ and the most common problem with content you find is that people skip concepts and steps because they assume you know something. what you did here is amazing 👏 it was a great and simple explanation for anyone who wants to start. you mapped the timing in the video knowing that people might want to skip to next session and again, video and audio quality is soberb. take care with copyright strikes, specially because N-intendo is here. they blocked revenue for stacksmashing channel for showing some seconds of the plumber guy game. this is always automated verification so you might pass by changing a bit the colors, inverting the screen or applying whatever post effect you want. the audio is something you might want to keep out of the videos for sure. N-team are full of massive A-holes lawyers and 3rd party companies who win comission for striking videos 🤢 to finish in a good mood, congratulations. your recording and setup as your content gives me chills!
I compiled and everything works! However, I have two warnings that showed up... again, everything works but trying to understand the warnings. Both on the tasks.json file, lines 9 and 10 which are "$ld65-unresolved" and "$ld65-config". The warnings are "unrecognized problem matcher. Is the extension that contributes this problem matcher installed?"
Great; now I've gone down another rabbit-hole. "DAMN YOU!!" Thanks. Subscribed now and soaking it in. I code 6502 for C64 and a little bit for the BBC Micro I had shipped to Canada.
There was a promising CC65 replacment lib called KNES - the author also had a nes music tracker you could use with the lib. Released around 2010-11, not sure where the files can be found today, but the site is still on wayback machine.
Hi Ryan, thank you for your video. I was wondering if worth the effort to setup a raspberry pi for this kind of development. The reason I’m asking it’s because I don’t have windows pc today, just an old MacBook and a raspberry 4 (and I’m not in the mood to spend money on a PC just for testing assembly, maybe if I take it really seriously). Do you think it would be easier set the environment up for MacOS or for raspbian? Many thanks!
I could setup VS code and cc65. FCEUX it’s not working in raspbian, but I’m using Mednaffe. If I would need debug something, I’ll use FCEUX on Mac. For now I think it will work.
@@VamosViverFora Yeah I think a Linux box or raspberry pi will work great if you don't have a windows PC! I'm not sure what the best emulator will be for pi but you can try a few, like Higan, to see what works best. Also I'd stay away from Mac for this, cause most of the tooling just doesn't work as well (the programming tools are fine, but the emulators are mostly WINE ports of the windows versions and seem to run poorly).
The Pokemon cheating info is partly false. There is no way possible for mask ROMs to be corrupted by cheating. The chips aren't rewriteable so harmful code couldn't do anything to a normal cartridge. This myth probably comes from the cartridge locking up when accessing the bad save data and locking up. All that is necessary to fix it is to clear the save with the key combo held at power on. There was a similar problem with DK64, but with that game you couldn't reset the save so it required a cart programmer/copier to wipe it so you can play the game again.
Hello. thanks for the tutorial. everything works. but I have one problem. I don't know how to create a file: cl65config.json should I create it manually ?! will visual studio help me with this? wants to create a new project. and not open ready. greetings.
I do appreciate that you explain all the little things about editors, assemblers etc., but in all honesty that's probably not very valuable for your target audience: you might expect some basic knowledge from people who're trying to write code in assembly :) Putting a disclaimer in the video and some helpful links in the description is probably a better idea than bloating your video with software development basics. Never the less, a very interesting video!
Being a kind of homeless electrical engineer, I can only express my joy watching the machine my young brother was a fan. Sad, no Linux options offered.
I've tried using ca65 in the past but its only really set up for NROM games, unless you write a custom cfg and pray it maps label addresses correctly 🙏
Hmm, well I think for getting started it is totally fine. I haven’t done too much with building bigger games or using more complex mappers, so it will be a fun video to research and make, methinks.
As a JS dev I have no interest in writing console games but I like to watch these for entertainment. I was pleasantly surprised by how simple it is to set up your environment. I don't suppose there's a way you could write your code in C and only then compile it to Assembly?
You can code in C but it ends up beinf a lot of trouble to do things other than very simple demos because you need very fine control over the number of cycles you’re using a lot of times and doing most techniques in assembly ends up being easier. Assembly isn’t all the tough for old processors like the 6502, but I understand the aversion to it as it is often made out to be super advanced and scary.
@@NesHacker Do you know if NES games in 80s were made exclusively with assembly language or whether there were some made with high level languages (by which I mainly mean C)? It feels like large projects written entirely in assembly would be difficult to maintain...
I am almost positive they were written in assembly. Same for game boy games. Assembly programming and code organization isn’t much different than C to be honest. Lot of include files, external symbols, etc and let the linker do the rest.
please note if you use linux you may beable to bypass the source forge links as they may be in your package manager. all of it is in mine (garuda linux)inlcuding vscode however your milage may very.
The instruction for how to download VSCode was a little bit too detailed.Never mind, the whole video was a little bit to detailed lol maybe good for someone who has never touched a computer but wants to develop for the NES. ;)
@@NesHacker man, don't stop doing your nes thing, please don't do like the majority of other nes homebrew devs that just start a project too hard and left us hanging with an incomplete series.
@@NesHacker 😆 I can't wait to see you coding some simple game. Also, do you know if there is a way to code in C? Cuz I feel I little stuck when I look at assembly codes 🤣
Whenever I try to Run Build Task it always runs into an error that says " The string is missing the terminator: '. " Is there any way that I can fix this?