Jump to content
IGNORED

Learning to code for SNES from absolute scratch?


Kirk_Johnston

Recommended Posts

OK, I want to make something for SNES. I have no problem with game design, making art, understanding gameplay, etc, but I don't have the slightest clue how to actually start coding from the very beginning in terms of figuring out how to do anything on the actual SNES. I've had a look at a few online resources that are supposed to be guides to get started creating stuff for SNES, but I can't for the life of me even get through the first few steps around setting up everything that's initially required for the development and learning environment, be it the coding software or whatever else is needed. Also, I've never programmed a line of Assembly, so that's a total foreign language too, and anything that assumes even rudimentary knowledge of that or how to run compilers and debuggers and the like is jumping way too far ahead for a noob like me. Even something telling me to go to github and get some source files or whatever, without explicit step by step instructions of where to go and what to click and so on, is not a clear instruction and assumes far too much knowledge of even github. Lastly, I do not have a physical SNES, so that can't be assumed either. I have a PC and at best either a SNES emulator or the SNES Classic Mini that I can download SNES stuff onto to test.

 

So, does anyone know where I can go about finding out how to code stuff for SNES from the very first possible steps, and something that's so simple that a total noob could actually follow it without being bewildered within the first few sentences?

 

Thanks.

 

PS. Hopefully this is one correct place to ask for such help. Someone else pointed me here. At least I think this is where they were pointing me.

Edited by Kirk_Johnston
Link to comment
Share on other sites

There are not a lot of SNES tutorials out there - I had a lot of issues following all of them.  So I don't really think that exists yet - maybe I'll write on someday!  In fact, until recently it was hard to even find a working hello world example for the snes in 65c816 assembly.  So you are definitely not alone.  This was one of the reasons the SNES homebrew scene is so small for a very long time.  The SNES is not an easy system to bootstrap and I definitely do not recommend starting completely from scratch; it's much easier to get started by hacking a working project into something else.  So that's one thing I would recommend you try, which I will explain shortly but will not be going into every single step tonight.  TrashLid and I did eventually fix the broken hello world that was appearing pretty high on google in 2021, but it was extremely difficult for me to even read, let alone fix, at the time.  I had to do a ton of reading about 65c816 assembly language to even understand NovaSquirrel's analysis about why the original SlithyMatt's hello world was broken.  Here is the fixed hello world repository if you want to try reading it:

 

https://github.com/TrashLid/snes-hello
 
You'll definitely want to get git installed to clone this.  The installation procedure is a little different depending on what operating system you use, so me knowing that will help give you more specific help.  Each operating system has a different way to launch the "shell" too, which is a program that lets you run programs by typing commands instead of clicking on icons.  I notice Super Nintendo developers tend to use MSYS2 when they are on Windows (that's the shell I use).  Most assemblers afaik are typically run through the shell (in fact, I don't know how to run them through the GUI at all), so you should get comfortable launching that, but again, without knowing what OS you are using, it's hard for me to give more specific instructions.  Then just type "git clone https://github.com/TrashLid/snes-hello" in the shell to clone the repository.

 

Run the build script in that repo by typing "./build.sh" which will have cl65 generate hello.smc.  (I think .sfc is the preferred file extension, that is an issue I want to file against the upstream repo, but whatever it's nbd).  Mesen is the best debugging emulator these days, so use that to run it.  Version 2 is now out:  https://www.mesen.ca/

 

I had to basically read almost the entire "Programming the 65816" manual by Eyes & Lichty before things began to click:

 

https://www.amazon.com/Programming-65816-Including-65C02-65802/dp/0893037893

 

It's a very good book, but I do not like the pictures that try to explain the complex addressing modes, which I don't recommend even looking at until you've learned the simple addressing modes.  There is also information you don't need in there since the book keeps bouncing around talking about different CPUs - the SNES has a 65c816, so don't worry too much about the others.  Please buy a copy and read it!

 

There's clc_xce's tutorials, which I think you should also try and post about any trouble or questions you have with it.  It may be an intimidating amount of stuff to learn but just take it once step at a time.  I don't really know which step specifically you got stuck on the last time you tried these, so I can't give a much better answer than that.

 

Then there's also bazz's tutorials (https://wiki.superfamicom.org/learning-65816-assembly) which are the traditional way people in the SNES scene learn how to program it in assembly.

 

The reason I'm telling you all this about how hard it was is because I want you to know that I get it.  I don't like the way people have been treating you for not knowing how to program in assembly.  There are not many people who understand the 65x architecture, and there won't be until we start being kind to each other.  I am a professional software engineer, and the SNES is by far the most challenging platform to develop for that I have encountered in my career - the SPC700 and enhancement chips were definitely out of reach for me for awhile.  But I learned a little bit with each tutorial, book, and document, and kept bouncing around reading different things back and forth, and they gradually became easier to understand.  I don't think I understood any of them 100% the first time I read them.

 

Let me know if you have any questions or need me to go into any more detail on any of this.

  • Like 1
Link to comment
Share on other sites

On 2/20/2023 at 7:44 PM, jeffythedragonslayer said:

Also, I just noticed this thread is not in the SNES section. I have no idea why someone told you to post here.  When I tried to come back and looked for this thread, I didn't see it and thought you deleted it.

 

 

 

 

Hey Jeff,

 

I told Kirk to visit the Collectorvision thread in the Colecovision form to reach out to the developer, since they have released a handful of SNES games in the past.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...