Hello everyone! I have been a lurker on this site for a few years now, but finally registered today. As with most newbies here I have these lofty goals of developing my own NES games. I've read the Nerdy Nights, NESprgmn, NinTech, and Metopal tutorials ("I AM EXTRA") and feel I have an adequate understanding of the architecture and assembly language. One of the issues I keep running into, however is the availability of tools for game building, more specifically an IDE (Integrated Development Environment). It looks like there was some work with NESIDE and there are piecemeal tools such as YY-CHR, Tile Molester, Notepad++, NESASM3, and NESTICLE that have been recommended, but nothing that's all inclusive. I've looked into building my own IDE using C# and although I have made some progress (CHR and Background Builder works), I hit a road block when I got into the assembler portion of program. While some of the struggle is due to my lack of ASM language experience, most has to do with hardware timing, code optimization, and the compiler.
For example, recently I was trying to figure out how I could build a generic stack of PPU changes that can be popped off during the VBlank and be built outside of this time. This was my attempt at a solution:
Input Variables:
StackSize - 1 byte integer (0 to 255) that tracks how many elements are in the stack. (Assumed to be on Zero Page)
StartHiByte - 2 byte address that points to the start of stack for where the High Byte of the PPU address will be stored
StartLowByte - 2 byte address that points to the start of the stack where the Low Byte of the PPU address will be stored
StartValue - 2 byte address that points to the start of the stack where the Value Byte that will be stored at the PPU address
Algorithm:
By my estimate (and please correct me if I am wrong):
ROM Cost: 26 Bytes
Cycle Cost: 6 + 29 * StackSize
At 2200 cycles available to make PPU changes that gives me about 75 value changes per VBlank.
I understand that if the changes are ordered, such as with Sprite RAM, I can DMA more efficiently.
So my questions for everyone are:
1. How does everyone else manage their PPU changes and VBlank Timing? Am I even in the ballpark?
2. And is there a single repository of algorithms somewhere (such as nametable compression).
3. What one tool would make programming NES games easier for you?
Thank you!
[EDIT:] Grammar
For example, recently I was trying to figure out how I could build a generic stack of PPU changes that can be popped off during the VBlank and be built outside of this time. This was my attempt at a solution:
Input Variables:
StackSize - 1 byte integer (0 to 255) that tracks how many elements are in the stack. (Assumed to be on Zero Page)
StartHiByte - 2 byte address that points to the start of stack for where the High Byte of the PPU address will be stored
StartLowByte - 2 byte address that points to the start of the stack where the Low Byte of the PPU address will be stored
StartValue - 2 byte address that points to the start of the stack where the Value Byte that will be stored at the PPU address
Algorithm:
Code:
LDA $2002 ; Reset Hi/Low Bit
LDX StackSize ; Load Stack Size into X Register
NextLabel:
LDA StartHiByte, X;
STA $2006
LDA StartLowByte, X;
STA $2006
LDA StartValue, X;
STA $2007
DEX
BNE NextLabel:
LDX StackSize ; Load Stack Size into X Register
NextLabel:
LDA StartHiByte, X;
STA $2006
LDA StartLowByte, X;
STA $2006
LDA StartValue, X;
STA $2007
DEX
BNE NextLabel:
By my estimate (and please correct me if I am wrong):
ROM Cost: 26 Bytes
Cycle Cost: 6 + 29 * StackSize
At 2200 cycles available to make PPU changes that gives me about 75 value changes per VBlank.
I understand that if the changes are ordered, such as with Sprite RAM, I can DMA more efficiently.
So my questions for everyone are:
1. How does everyone else manage their PPU changes and VBlank Timing? Am I even in the ballpark?
2. And is there a single repository of algorithms somewhere (such as nametable compression).
3. What one tool would make programming NES games easier for you?
Thank you!
[EDIT:] Grammar