wannabe developer

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

laserbeak43
Rookie
Posts: 21
Joined: Thu Aug 04, 2005 3:11 am
Contact:

wannabe developer

Post by laserbeak43 »

hi i was wondering if anyone could point me in the right direction to learn assembly language. i want to do things with the spc and whatever other thing inside the nes or the carts that make music.

any books(prefferably downloadable) that you reccomend reading?
whats steps should i take to learn?
how long will it take me to learn?
whicker
Trooper
Posts: 479
Joined: Sat Nov 27, 2004 4:33 am

Post by whicker »

to make music, you shouldn't need to know assembly language.
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

Have a look at the documents at zophar.net and http://snescentral.edgeemu.com/ ...
I'm sure others can point out some links as well.
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
laserbeak43
Rookie
Posts: 21
Joined: Thu Aug 04, 2005 3:11 am
Contact:

Post by laserbeak43 »

whicker wrote:to make music, you shouldn't need to know assembly language.

not all people who make music want to be stars. some of us want to work behind the scenes as engineers of one thing or another. actualy there are more professional music developers then there are celebs :D
laserbeak43
Rookie
Posts: 21
Joined: Thu Aug 04, 2005 3:11 am
Contact:

Post by laserbeak43 »

creaothceann wrote:Have a look at the documents at zophar.net and http://snescentral.edgeemu.com/ ...
I'm sure others can point out some links as well.
thanks i'll check it out.
i found a couple pages when i was browsing the forum last night too.. :D
laserbeak43
Rookie
Posts: 21
Joined: Thu Aug 04, 2005 3:11 am
Contact:

Post by laserbeak43 »

http://snescentral.edgeemu.com/Development/index.html

dont think he'll have much info anytime soon....
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

Mmmh... too bad.
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
neviksti
Lurker
Posts: 122
Joined: Thu Jul 29, 2004 6:15 am

Post by neviksti »

Seriously, if you already know how to program (the ability to break any problem down into manageable parts that can be represented in code), then you can teach yourself without problem.

All you need then is:
- documentation on the CPU so you can program
- documentation on the console hardware good enough to get you started

an added bonus would be (but not necessary)
- some simple demos showing a rough layout of a program so that getting started is not so daunting


Luckily all three have been available for quite awhile. The first is just from the makers of the CPU, the second was leaked from Nintendo ages ago, and the third I wipped up quite awhile ago as well.

You can find everything at:
http://nesdev.parodius.com/
It's a big page so just search for "SNESdev Starter Kit".


People without assembly language experience often make the mistake of skipping reading the documents and going straight at the code ... which often leads to failure. You won't be able to learn the code for this CPU without reading about the CPU. Or at the very least, skim the documentation, then have it next to you for reference while you go through the code.


Lastly, you mentioned you are more interested in the SPC700 ... luckily for you, the SPC700 is a really nice and easy chip to program for (definitely much more "beginner friendly" than the 65816). If you want me to share some code so that you can program for the SPC700 (and just skip the main SNES stuff for now), I can do that. It may indeed be a better starting place. (However, the Audio DSP itself is a bit quirky in that we don't understand all of the details (or at least I don't). However the information is definitely good enough to get you started.)


Before diving into assembly language programming it helps if you understand the ideas of
- registers
- a stack
- an interrupt
- processor status reg / flags
- conditional jumps
- subroutines (calls)
- variables, and different memory addressing modes (direct, indirect, indexed, etc)

If not, do not worry, these are simple ideas and can be taught in literally just a short conversation. Don't get me wrong, as with any new programming language you take on, it WILL take awhile to feel comfortable programming in it and feel you have mastered it. But learning it is not as bad as people make it sound.

EDIT: Hmm... this was meant to be encouraging, but rereading it, the necessitated terseness for such a huge subject came off a bit harsh. It was not meant so. You can do this. Just take your time and enjoy it.
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

neviksti:

Keep in mind some people may have never had exposure to electronics or how CPU's work before or their internals. Grasping assembly language can be more difficult for someone who has no electrical or CPU architectural background. That kind of stuff can be difficult to teach yourself from the CPU technical documentation.


My recommendation is to read some of the documents and take a small code example from somewhere and comment out what you think several of the instructions do. Then post here or another suitable message board what you think it does for further clarification.

I'm of the school of thought you may not be able to fully comprehend all these concepts without asking some questions and getting some interactions from others.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
neviksti
Lurker
Posts: 122
Joined: Thu Jul 29, 2004 6:15 am

Post by neviksti »

Sure, it's by no means an easy task. As I said, it will take some time.

Yet, the concepts themselves aren't difficult. I've taught two people assembly language in person (so it was easier), and they were able to grasp the main concepts without a problem in the first day. (Because the main concepts aren't that difficult.) But, depending on their skill, it took them several months before they could really get how everything fit together and could program without needing to ask me questions or anything. An important thing is that once they got the main concepts that they gained a working knowledge by applying what they learned and learning more as they ran into common questions as they program. (And yes, as Nightcrawler suggested, I started them by having them edit simple existing code instead of writing something from scratch. I found it especially important that there was some simple "feedback" they could see for their code. That's why I included the ultrasimple "PrintNum" and "PrintString" macros in the starter kit.)

It takes a while to master. But anyone that can program (the ability to break any problem down into manageable parts that can be represented in code), can do it. Just take your time and enjoy.


I feel the most important lesson in life/work/hobbies/what-have-you is to "learn how to learn" (for lack of a better phrase). Sure this includes asking others for help and guidance, but ultimately one needs to learn where to look for information and how to absorb that information to make it work for them.

I'm not sure how this all got such a philosophical tone. I definitely got this topic off track. Sorry.

Good luck with your projects laserbeak43 :)
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

neviksti wrote: I feel the most important lesson in life/work/hobbies/what-have-you is to "learn how to learn" (for lack of a better phrase). Sure this includes asking others for help and guidance, but ultimately one needs to learn where to look for information and how to absorb that information to make it work for them.
Nice quote. I agree with that. Learning to be a good 'self-learner' can be a very a valuable skill. Especially when it comes to SNES hacking or programming. My gripe with most 'newbies' on the net is they want everything spoon fed to them. That's not how it works. Help is available, but only to those who want to help themselves first.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
laserbeak43
Rookie
Posts: 21
Joined: Thu Aug 04, 2005 3:11 am
Contact:

Post by laserbeak43 »

wow thanks for this info!!! i found this in a flood of emails i had in my inbox(1000+) while cleaning. i will get to it imediately.
laserbeak43
Rookie
Posts: 21
Joined: Thu Aug 04, 2005 3:11 am
Contact:

Post by laserbeak43 »

neviksti
i've downloaded your starter kit and have just opened the readme. since i am mainly concentrating on sound is there a place you reccomend i start first?
laserbeak43
Rookie
Posts: 21
Joined: Thu Aug 04, 2005 3:11 am
Contact:

Post by laserbeak43 »

hmmm got any written versions of that assembly tutorial you were talking about?? :shock:
neviksti
Lurker
Posts: 122
Joined: Thu Jul 29, 2004 6:15 am

Post by neviksti »

laserbeak43 wrote:neviksti
i've downloaded your starter kit and have just opened the readme. since i am mainly concentrating on sound is there a place you reccomend i start first?
I don't really remember what is in the starter kit anymore.
The bare bones for getting started with the APU is a copy of the bootstrap rom and the APU documentation... and some rudimentary understanding of the SNES to be able to write code for the 65816 side of the "bootstrap process".

I'm pretty sure the APU documentation is in the kit. I don't know about the rest. If you don't mind waiting, I can probably talk with you (and others that are interested) using instant messaging / IRC / whatnot this weekend. I can provide example code, answer questions, etc.
laserbeak43 wrote:hmmm got any written versions of that assembly tutorial you were talking about??
I started one and it sucked. I put in too many details, and it read like a textbook instead of a summary. I felt most comments I made were important for absolute beginners, but that I probably should have instead had a "pass by summary", then another pass in more depth, then the docs to referr to for as much depth as you want.

I never even got around to planning out the 'second attempt' (and that was a year ago), so I can tell you it is not going to happen.

Anyway, if you and/or others want a quick APU / assembly language tutorial, I can set aside time this weekend (Sat. is best for me). PM with what times are good for you and we can probably work something out.
laserbeak43
Rookie
Posts: 21
Joined: Thu Aug 04, 2005 3:11 am
Contact:

Post by laserbeak43 »

that's be great!!. i live on the east coast use. ad saturday in the morning would be great for me!

-edit-
i will also ask the few coders that i know if they are interested but i highly doubt it :)
laserbeak43
Rookie
Posts: 21
Joined: Thu Aug 04, 2005 3:11 am
Contact:

Post by laserbeak43 »

hey neviksti we started one day then i never saw you online again. did i scare you off? :) i'd really love to have your help!!
undisbeliever
Rookie
Posts: 35
Joined: Sat Aug 21, 2004 2:31 am
Location: is an eight lettered word

Post by undisbeliever »

laserbeak43 wrote:http://snescentral.edgeemu.com/Development/index.html

dont think he'll have much info anytime soon....
I understand that I haven't updated my site in a while, never really had the time (or a reliable computer to do it on).

Given time (and some Pink Floyd records), I'll have the asmembly tutorial finished, the rest is up to public encuragement
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

We have plenty of hardware information on the SNES including the current and most accurate SNES hardware docs by Anomie. Many sites don't have those. Not to mention, we've got sample assembly source code and more.

http://www.romhacking.net
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
laserbeak43
Rookie
Posts: 21
Joined: Thu Aug 04, 2005 3:11 am
Contact:

Post by laserbeak43 »

wow nice! thanks guys!!!
laserbeak43
Rookie
Posts: 21
Joined: Thu Aug 04, 2005 3:11 am
Contact:

Post by laserbeak43 »

undisbeliever wrote:
laserbeak43 wrote:http://snescentral.edgeemu.com/Development/index.html

dont think he'll have much info anytime soon....
I understand that I haven't updated my site in a while, never really had the time (or a reliable computer to do it on).

Given time (and some Pink Floyd records), I'll have the asmembly tutorial finished, the rest is up to public encuragement
yeah i think you will be taking a break from the rest then :) maybe i can help you when i better understand this stuff.
laserbeak43
Rookie
Posts: 21
Joined: Thu Aug 04, 2005 3:11 am
Contact:

Post by laserbeak43 »

Nightcrawler wrote:We have plenty of hardware information on the SNES including the current and most accurate SNES hardware docs by Anomie. Many sites don't have those. Not to mention, we've got sample assembly source code and more.

http://www.romhacking.net
all of anomie's guides are hardware guides. no tutorials on how to start using assembler.
undisbeliever
Rookie
Posts: 35
Joined: Sat Aug 21, 2004 2:31 am
Location: is an eight lettered word

Post by undisbeliever »

I know, It took me a while to learn how to use wla-65816 (I know there are easier assemblers to use, but I needed one that is supported by a mac and linux AND I needed one that would be able to handle large projects).

There are no tutorials on how to use it, It really annoys me
Last edited by undisbeliever on Tue May 09, 2006 10:52 am, edited 1 time in total.
undisbeliever
Rookie
Posts: 35
Joined: Sat Aug 21, 2004 2:31 am
Location: is an eight lettered word

Post by undisbeliever »

But rest assured, I'm only an idoit (IQ not worth mentioning, cause I pride my self on my common sense and stupidity instead of my intelligence).
SO if I can figgure it out, I'm sure laserbeak43 can :wink: .
Nightcrawler
Romhacking God
Posts: 922
Joined: Wed Jul 28, 2004 11:27 pm
Contact:

Post by Nightcrawler »

laserbeak43 wrote:
Nightcrawler wrote:We have plenty of hardware information on the SNES including the current and most accurate SNES hardware docs by Anomie. Many sites don't have those. Not to mention, we've got sample assembly source code and more.

http://www.romhacking.net
all of anomie's guides are hardware guides. no tutorials on how to start using assembler.
Yeah.. that's what assembly IS... You're going to need those if you ever hope to do anything with SNES assembly. And I suppose you couldn't take 5 seconds to look at the rest of the documents or you'd find these..

Assembly Documents
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
Post Reply