I am working on a little program to make test scroll across the screen based on a user entered string
This part works fine. I added in a little sprite field in the background on the scrolling text
which works fine on FCUEX 2.2.2 but when I try it on my flash cart, I am using a famicom everdrive, the sprites don't show up in the background.
Does anyone have any idea what the issue might be?
I put a paste bin of the code here if anyone would be kind enough to look at it
https://pastebin.com/Wi44YFBf
Tested on FCUEX 2.2.2 but no sprites on flashcard (solved!)
Moderator: Moderators
Tested on FCUEX 2.2.2 but no sprites on flashcard (solved!)
- Attachments
-
- scrollnesmod.nes
- (40.02 KiB) Downloaded 208 times
Last edited by lazerbeat on Tue Sep 03, 2019 4:10 pm, edited 1 time in total.
Re: Tested fine on FCUEX 2.2.2 but no sprites on flashcard
It looks like your sprite DMA call is too late in the frame, after VBlank has ended. You'll want to do any writes to the PPU as quickly as possible once VBlank starts.
My games: http://www.bitethechili.com
Re: Tested fine on FCUEX 2.2.2 but no sprites on flashcard
The DMA routine must be called during V-Blank. So, try to call updatesprites in vblank.
Tip: try to change your code to work with NMI enabled rather than manual calling vblank and polling $2002, something like this:
Another tip: You don't need to test your game on the Everdrive to see the error, just do it in Mesen or Nestopia
Tip: try to change your code to work with NMI enabled rather than manual calling vblank and polling $2002, something like this:
Code: Select all
main_loop:
lda #0
sta nmiok
wait_nmi:
lda nmiok
beq wait_nmi
; game logic here
; ...
jmp main_loop
Code: Select all
nmi:
; preserve registers
pha
txa
pha
tya
pha
; Sprite DMA
lda #$00
sta $2003
lda #$02
sta $4014
; other vblank stuff here
; ...
lda #1
sta nmiok
; restore registers
pla
tay
pla
tax
pla
rti
Re: Tested on FCUEX 2.2.2 but no sprites on flashcard (solve
Thanks for the advice everyone that fixed the problem!
I will add this into the next version of my code. Thanks for the suggestion.NOOPr wrote: Tip: try to change your code to work with NMI enabled rather than manual calling vblank and polling $2002, something like this: