It is currently Sun Dec 09, 2018 4:25 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 343 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 23  Next
Author Message
PostPosted: Wed Jun 20, 2018 12:49 pm 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1786
Location: Gothenburg, Sweden
I think any NES tutorial is good for nesicide, asm6 or ca65. At least for me, translating the excercises from nesasm3 to asm6 helped me understand better what was going on and what it was to assemble a program. I should add that before 6502 assembly, my prior programming experience was *very* limited. Just BASIC and various small scripts, essentially. So i don't think it's too rough to try to make his example code work with another example, even if it is *slightly* more uphill.

If you're going for asm6, you'll find everything you need in the short readme file that comes included to be able to translate the tutorial as an excersise in-itself.

If you're going for ca65 or NESICIDE (which as others have pointed out is built on ca65), the example rainwarrior posted plus the (very large) reference guide of the cc suite will help you achieve the same. Link to the ca65 chapter here: https://cc65.github.io/doc/ca65.html

I've read it over and over and still have a lot to learn. Only a fraction of what is described in the reference is required to build a simple program. it's just a very versatile assembler that offers a lot of extra functionality beside the basics. Some of it is only relevant to other systems than the NES, so you can safely skip those parts for now.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Wed Jun 20, 2018 1:08 pm 
Offline

Joined: Sun Jun 17, 2018 6:41 pm
Posts: 150
rainwarrior wrote:
Personally I think ca65 is just fine for beginners too, especially if you have an example to work from.

...which is why I created this example:
http://forums.nesdev.com/viewtopic.php?t=11151


It said the system can't find the path specified.

EDIT: Wait, sorry, I'll see about bunnyboy..


Top
 Profile  
 
PostPosted: Wed Jun 20, 2018 1:31 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7005
Location: Canada
DocWaluigean wrote:
It said the system can't find the path specified.

If you open example.txt it will explain that you need to get cc65 and where to put it.


Top
 Profile  
 
PostPosted: Sat Jun 23, 2018 7:42 pm 
Offline

Joined: Sun Jun 17, 2018 6:41 pm
Posts: 150
Honest question about the NES coding.

I apparently found this viewtopic.php?p=58138#p58138 and I been thinking about the one found in the bunnyboy version about background.asm.

I am wondering is 100% complete base of NES with no codes or templates found from anyone possible? I am looking what code to put in where it's completely enough to consider NES compatibility.

There's the iNES part from Bunnyboy but the viewtopic.php?p=58138#p58138 one doesn't have iNES part in the beginning, and other forms of LetterROM.


Top
 Profile  
 
PostPosted: Sat Jun 23, 2018 8:06 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2118
Location: Fukuoka, Japan
I'm not sure that I understand your question but the ines header is only necessary so the emulator knows what hardware you are trying to use. A nes cartridge doesn't have any such thing so when creating the rom for a real nes, this header wont be necessary.

Since you are starting developing for the nes, it is best if you start with a very basic configuration (NROM) because for learning you don't need much memory or don't have any hardware specific requirements yet. Once you will understand more about the hardware, you will be able to ask more question on how to set the INES header for something that suits your needs.

I never used the bunnyboy tutorial myself but my guess is the ines header should be NROM based. As for the compiler, don't worry much about which one to use at first: just use the one that is suggested with the tutorial. Once you get enough experience switching to another compiler doesn't take much time.

edit:

And at first, just don't try to think too much. I would suggest to try to compile the existing example and check if they do works. Once this part is done, just try to modify the example and see what happens. Experiment is a important part of learning, especially for the nes.


Top
 Profile  
 
PostPosted: Sat Jun 23, 2018 8:14 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11009
Location: Rio de Janeiro - Brazil
If you're going to follow a tutorial, and have no previous experience with the programming language in question, it's better to use the same assembler used in the tutorial. If you're new to this, you'll have a hard time compensating for all the differences in tools if you pick software not covered in the lessons.

Once you understand the basics well, you'll be able to see the shortcomings in the tools you've been using, so you'll be better equipped to make the decision to change tools yourself, rather than relying on what others say is best.


Top
 Profile  
 
PostPosted: Sat Jun 23, 2018 8:40 pm 
Offline

Joined: Sun Jun 17, 2018 6:41 pm
Posts: 150
Banshaku wrote:
I'm not sure that I understand your question but the ines header is only necessary so the emulator knows what hardware you are trying to use. A nes cartridge doesn't have any such thing so when creating the rom for a real nes, this header wont be necessary.

Since you are starting developing for the nes, it is best if you start with a very basic configuration (NROM) because for learning you don't need much memory or don't have any hardware specific requirements yet. Once you will understand more about the hardware, you will be able to ask more question on how to set the INES header for something that suits your needs.

I never used the bunnyboy tutorial myself but my guess is the ines header should be NROM based. As for the compiler, don't worry much about which one to use at first: just use the one that is suggested with the tutorial. Once you get enough experience switching to another compiler doesn't take much time.

edit:

And at first, just don't try to think too much. I would suggest to try to compile the existing example and check if they do works. Once this part is done, just try to modify the example and see what happens. Experiment is a important part of learning, especially for the nes.


What tutorial did you learn beside bunnyboy?

And also, it's pretty impossible for me to not think too much, as I'm often feel like missing out important details, like what everything does in the background / sprite.asm. but I kind of understand your point.


Top
 Profile  
 
PostPosted: Sat Jun 23, 2018 8:42 pm 
Offline

Joined: Sun Jun 17, 2018 6:41 pm
Posts: 150
tokumaru wrote:
If you're going to follow a tutorial, and have no previous experience with the programming language in question, it's better to use the same assembler used in the tutorial. If you're new to this, you'll have a hard time compensating for all the differences in tools if you pick software not covered in the lessons.

Once you understand the basics well, you'll be able to see the shortcomings in the tools you've been using, so you'll be better equipped to make the decision to change tools yourself, rather than relying on what others say is best.


I have minor experiences in BASIC languages, from PRINT and INC through partially on DATA and GOTO / @ symbols.


Top
 Profile  
 
PostPosted: Sat Jun 23, 2018 9:30 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11009
Location: Rio de Janeiro - Brazil
DocWaluigean wrote:
I have minor experiences in BASIC languages, from PRINT and INC through partially on DATA and GOTO / @ symbols.

If you have zero experience with any kind of assembly language, and plan on following an NES programming tutorial, better use the tools the tutorial uses. When starting out, we often don't know what tools do what and how, so it's very hard to make substitutions on our own. Once you're more acquainted with how things work and how everything is put together, you can try other tools if you think any of the ones you're using aren't as good as they could be.


Top
 Profile  
 
PostPosted: Sat Jun 23, 2018 9:42 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2118
Location: Fukuoka, Japan
DocWaluigean wrote:

What tutorial did you learn beside bunnyboy?

And also, it's pretty impossible for me to not think too much, as I'm often feel like missing out important details, like what everything does in the background / sprite.asm. but I kind of understand your point.


I started to be interested in nes programming around, hmmmm, 2007/2008, just before joining nesdev. At the time, I think Bunnyboy was writing those tutorials so the only thing I had was the current documents available on nesdev. I may have use some other online tutorials but today they would be inadequate since we know more about the inner working compare to was avaible before 2008.

I know what you mean that you want to not miss out, that is normal and will react the same too :lol: But with your current background and the fact that a the nes is a little bit complicated to grasp from the beginning, the best thing is to follow the current tutorials, one by one, play with the code inside it and see what it does. The thing you will have the most fun with is when you can modify one and it does what you expect.

At first you won't understand all the code, which is expected. The more you will play with them, the more you will be able to ask questions regarding what you don't understand. For now, just don't rush and have fun playing with the samples with the tutorial!


Top
 Profile  
 
PostPosted: Sun Jun 24, 2018 1:24 pm 
Offline

Joined: Sun Jun 17, 2018 6:41 pm
Posts: 150
Banshaku wrote:
DocWaluigean wrote:

What tutorial did you learn beside bunnyboy?

And also, it's pretty impossible for me to not think too much, as I'm often feel like missing out important details, like what everything does in the background / sprite.asm. but I kind of understand your point.


I started to be interested in nes programming around, hmmmm, 2007/2008, just before joining nesdev. At the time, I think Bunnyboy was writing those tutorials so the only thing I had was the current documents available on nesdev. I may have use some other online tutorials but today they would be inadequate since we know more about the inner working compare to was avaible before 2008.

I know what you mean that you want to not miss out, that is normal and will react the same too :lol: But with your current background and the fact that a the nes is a little bit complicated to grasp from the beginning, the best thing is to follow the current tutorials, one by one, play with the code inside it and see what it does. The thing you will have the most fun with is when you can modify one and it does what you expect.

At first you won't understand all the code, which is expected. The more you will play with them, the more you will be able to ask questions regarding what you don't understand. For now, just don't rush and have fun playing with the samples with the tutorial!


Thanks.

Hmmm, well I'm on Week 3 right now, and I am still fuzzed about A X and Y on how does register works. I understood about Opcodes and Oprahand [like DIM / DEF and PRINT / GOTO stuff] but the register still puzzled me.

Is it like a temporary data to hold the specific mathematics up to 3 times during any changes?


Top
 Profile  
 
PostPosted: Sun Jun 24, 2018 3:38 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 940
Location: cypress, texas
DocWaluigean wrote:
Hmmm, well I'm on Week 3 right now, and I am still fuzzed about A X and Y on how does register works. I understood about Opcodes and Oprahand [like DIM / DEF and PRINT / GOTO stuff] but the register still puzzled me.

Is it like a temporary data to hold the specific mathematics up to 3 times during any changes?
General purpose registers on the NES are A, X, and Y. They are all 8bit boxes that can hold any value from:
Decimal: #0 to #255
Hexidecimal: #$00 to #$FF
Binary: #00000000b to #11111111b; <asm6 (or: #%00000000 to #%11111111)

The three formats listed above can be explored further, pretty easily, with Windows Calculator in Programmer mode. :)

tepples told me that registers A, X, and Y, on the NES, never lose their value unless an instruction changes it. So you can store a value in X, jsr a function that doesn't change X, and then use X confidently knowing that X still holds the value. This reduces, pointless, stores (stx, sta, sty) and loads (ldx, lda, ldy) and you save 4 bytes and 7 cycles, for zeropage addresses, for each pair you can eliminate! :D

For me, the 6502's creator, MOS Technology,'s programming manual's appendicies are so helpful. They show each instruction and its bytes and cycles used, among other things. I don't remember the pdf's name, but you can find it easily with a duckduckgo.com search. :) (I printed the appendicies out for easy searching, but there are other webpages with the info too.) The NES' 2A03 is a special type of 6502 processor.

edit: msc6500_family_programming_manual.pdf that's a later edition than the 1st edition appendicies I printed out a long time ago, but this edition's appendicies are more correct and understandable. :) Small tip: print this pdf's page 198 in landscape mode.


Top
 Profile  
 
PostPosted: Sun Jun 24, 2018 4:32 pm 
Online
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2347
Location: DIGDUG
A is a more general purpose register. Math and bit operations are done with A.

X and Y are more for an index to an array, or counting a loop. LDA array, X gets the Xth element of an array.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Sun Jun 24, 2018 5:02 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 940
Location: cypress, texas
dougeff wrote:
A is a more general purpose register. Math and bit operations are done with A.

X and Y are more for an index to an array, or counting a loop. LDA array, X gets the Xth element of an array.
:D "General purpose" was supposed to say that you can load/store/"do math with" those registers. Unlike the Stack Pointer and Processor Status registers; though you can (carefully) load/store them with tsx/txs and plp/php; but, they have to be used carefully, especially the Stack Pointer, or your nes game will can perish instantly until you fix it. A,X, and Y don't need to be used very carefully, but, as dougeff teaches, each of them (A, X, and Y) are different (can/must be used in different ways/for different purposes). :)

edit: Sorry. The word should be "can", I think, because editing the Processor Status register incorrectly would probably not make a game "perish"; nevertheless, it is definitly possible.


Last edited by unregistered on Mon Jun 25, 2018 2:54 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sun Jun 24, 2018 5:48 pm 
Offline

Joined: Sun Jun 17, 2018 6:41 pm
Posts: 150
unregistered wrote:
DocWaluigean wrote:
Hmmm, well I'm on Week 3 right now, and I am still fuzzed about A X and Y on how does register works. I understood about Opcodes and Oprahand [like DIM / DEF and PRINT / GOTO stuff] but the register still puzzled me.

Is it like a temporary data to hold the specific mathematics up to 3 times during any changes?
General purpose registers on the NES are A, X, and Y. They are all 8bit boxes that can hold any value from:
Decimal: #0 to #255
Hexidecimal: #$00 to #$FF
Binary: #00000000b to #11111111b; <asm6 (or: #%00000000 to #%11111111)

The three formats listed above can be explored further, pretty easily, with Windows Calculator in Programmer mode. :)

tepples told me that registers A, X, and Y, on the NES, never lose their value unless an instruction changes it. So you can store a value in X, jsr a function that doesn't change X, and then use X confidently knowing that X still holds the value. This reduces, pointless, stores (stx, sta, sty) and loads (ldx, lda, ldy) and you save 4 bytes and 7 cycles, for zeropage addresses, for each pair you can eliminate! :D

For me, the 6502's creator, MOS Technology,'s programming manual's appendicies are so helpful. They show each instruction and its bytes and cycles used, among other things. I don't remember the pdf's name, but you can find it easily with a duckduckgo.com search. :) (I printed the appendicies out for easy searching, but there are other webpages with the info too.) The NES' 2A03 is a special type of 6502 processor.

edit: msc6500_family_programming_manual.pdf that's a later edition than the 1st edition appendicies I printed out a long time ago, but this edition's appendicies are more correct and understandable. :) Small tip: print this pdf's page 198 in landscape mode.


Thanks for PDF!

But this is what I don't understand.

Is it a separate engine, like the Address? Or is it a form of abilities like RAM or DATA styles?

Like how does the register of A X Y [and P Z ] works? Or they work as a special form of variables like, a temporary placement of " A = X + Y" until the new replacement happens like "STA" or "LDA"?
I don't like to say this much, but can you explain like if I'm in Elementary School to help me understand about register? [It's very owned variables, like no other regular variables can use?]

Or it's like a "magic effects" but in programming, like the A represent the stages of Mario Bros. your in, X represent your health, and Y represent your Mario life?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 343 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 23  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: dougeff, Google Adsense [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group