NintendoAge http://nintendoage.com/forum/ -Sqooner Nerdy Nights Sound: Part 4 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=23024 2018-04-19T11:11:27 -05.00 MetalSlime 19
I search the skeleton.zip originally wrote for NESASM3. Some one know somewhere I can find this? The link is broken.

I found an Nerdy Nights ca65 Remix at https://bitbucket.org/ddribin/nerdy-nights/src. but not the original file. I try to recreate it from ca65 files, but I have difficulties. ]]>
Nerdy Nights Sound: Part 4 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=23024 2014-12-01T14:18:22 -05.00 MetalSlime 19 Originally posted by: Baka94
 
Originally posted by: MetalSlime
    sta sleeping            ;did you do your homework and read Disch's document last week?
                            ;http://nesdevhandbook.googlepages.com/theframe.html
The document doesn't exist anymore. Any else place where I can read the same stuff? What is it about? Just general NMI stuff? I'd like to know so I know if I have learned this stuff (maybe just in different way?).

EDIT: Wait, is this just the thing that is used to prevent main loop from running more than once per frame?


http://wiki.nesdev.com/w/index.php/The_frame_and_NMIs  <--- Thar ye's be's! ]]>
Nerdy Nights Sound: Part 4 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=23024 2014-12-01T11:08:45 -05.00 MetalSlime 19 Originally posted by: MetalSlime
    sta sleeping            ;did you do your homework and read Disch's document last week?
                            ;http://nesdevhandbook.googlepages...
The document doesn't exist anymore. Any else place where I can read the same stuff? What is it about? Just general NMI stuff? I'd like to know so I know if I have learned this stuff (maybe just in different way?).

EDIT: Wait, is this just the thing that is used to prevent main loop from running more than once per frame?
]]>
Nerdy Nights Sound: Part 4 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=23024 2014-11-22T21:05:15 -05.00 MetalSlime 19 Nerdy Nights Sound: Part 4 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=23024 2014-11-06T04:29:04 -05.00 MetalSlime 19 Originally posted by: MetalSlime

Oops! I forgot that I was hosting something important on that domain and let it expire. I just re-purchased the domain, so it should be back up. Really sorry about that!
Hi MetalSlime!

It is very welcome if you publish these files again. I find your tutorials really interesting!

Cheers!

- user ]]>
Nerdy Nights Sound: Part 4 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=23024 2014-11-04T22:21:32 -05.00 MetalSlime 19 Nerdy Nights Sound: Part 4 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=23024 2014-10-31T13:20:14 -05.00 MetalSlime 19 Nerdy Nights Sound: Part 4 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=23024 2012-03-01T00:59:21 -05.00 MetalSlime 19 ]]> Nerdy Nights Sound: Part 4 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=23024 2012-03-01T00:30:23 -05.00 MetalSlime 19 The trouble comes from the fact that we have two different arbitrarily-sized things (the drawing buffer and the stack) using the same page of RAM.  There is a potential for conflict if they cross.
 
The 6502 uses the $0100-$01FF range of RAM for the stack.  The bottom of the stack is $01FF and when values are "pushed" onto the stack, they are placed in memory in descending memory addresses.  So for example, say we have an empty stack and we push some values to it like this:
 
lda #$01
pha
lda #$02
pha
lda #$03
pha
 
After this code is executed the stack in memory would look like this:
$01FD: #03
$01FE: #02
$01FF: #01
 
The first value is pushed into $01FF, then the next value into $01FE, and so on in reverse order.  That's what I meant by "counting backwards".
 
You can push values onto the stack manually with PHA, but the 6502 also pushes things onto the stack automatically behind the scenes.  For example, every time you call a subroutine with JSR, the 6502 will push a 2-byte return address onto the stack.  This allows the program to know where to return to when it encounters an RTS command.
 
So there is a danger anytime you choose to use the $0100 page of RAM to store game-related variables.  If you accidentally overwrite a memory location that is currently in use by the stack, things can go terribly wrong.  Look at the following code, assuming an empty stack:
 
jsr my_subroutine
 
; blah blah blah
 
my_subroutine:
   lda #$00
   sta $01FF
   rts
 
Here we call a subroutine with JSR, which pushes a 2-byte address onto the stack at $01FF and $01FE.  Then in the subroutine we change the value of $01FF.  When the program hits the RTS, it will pop the 2-byte return address off of the stack, but that address will be the wrong address (because we foolishly changed it!).
 
In practice, the stack usually doesn't grow very deep.  Anything pushed onto the stack is usually popped off soon after.  I've never seen the stack come even close to using all 256 bytes of the $0100 page.  Since memory is tight on the NES, it's quite common for programmers to use the "front" half of the $0100 page for game variables (like a drawing buffer) rather than seeing that RAM go to waste.
 
Hope that clears it up.  Let me know if you have any questions or need more clarification.s
]]>
Nerdy Nights Sound: Part 4 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=23024 2012-02-28T10:57:06 -05.00 MetalSlime 19
; Note: dbuffer starts at $0100. This is the stack page. The
; stack counts backwards from $1FF, and this program is small enough that there
; will never be a conflcit. But for larger programs, watch out.


What does this mean? In the add_to_dbuffer and draw_dbuffer subroutines you appear to be reading everything from $0100 until you hit the termination control (#$00) for a string length. I understand that in this situation we can only have from $0100 to $01FF in RAM for the stack (and therefore that is the maximum length of a buffer) because the sprite shadow OAM is in $0200 - $02FF, but I don't see anything in here that indicates there is a "counting backwards" sequence and I don't know what sort of trouble we could run into here. ]]>