Page 1 of 1

NES ASM Help!

Posted: Sat Jan 09, 2016 5:33 pm
by Yoshimaster96
Why doesn't the "loadchr" routine work?
https://www.dropbox.com/s/d2ygfvuqwev77zx/PROJ.zip?dl=0

Re: NES ASM Help!

Posted: Sat Jan 09, 2016 6:16 pm
by dougeff
Lots of things wrong with this code...

1.you define 1 $4000 byte prg bank, yet are using 2.
2.NESASM devides banks into $2000 byte chunks, so the last prg bank would be bank 4, the graphics bank 5 (I could be wrong, it's been a while since I used NESASM)
3.You're writing to the PPU with rendering on, and you didn't check to see if you're in v-blank first.
4.You didn't wait 2-3 v-blanks before writing to the PPU
5.You didn't disable Interrupts
6...There could be more, but

I'll let someone else reply. I'm going to be busy for the next few hours.


(and put a "pause" at the end of your make.bat file, so you can read the errors, if there are any)

Re: NES ASM Help!

Posted: Sat Jan 09, 2016 9:02 pm
by dougeff
Here, I made you a file...

I dropped your code into a blank template I made for NESASM3 (and I included NESASM3). It appears to work.

http://dl.dropboxusercontent.com/s/7e6y ... /Fixed.zip

Re: NES ASM Help!

Posted: Sun Jan 10, 2016 6:37 am
by Yoshimaster96
Getting rid of the vblankwait seems to work.

Re: NES ASM Help!

Posted: Sun Jan 10, 2016 7:54 am
by dougeff
And doing everything while rendering is off...yes.