It is currently Sat Oct 21, 2017 5:25 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Fun with sprites
PostPosted: Thu May 05, 2005 12:16 am 
Offline

Joined: Thu May 05, 2005 12:08 am
Posts: 4
Hi everyone. I'm learning nesasm, and I'm trying to do some fancy stuff with sprites. Is there any way in which I can READ from the sprite memory to see the state of each sprite, or am I limited to only writing to a sprite memory location? It seems a bit redundant to store the state of each sprite in both main memory and sprite memory.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 3:34 am 
Offline

Joined: Mon Sep 20, 2004 6:47 am
Posts: 48
you can read/write the sprite regs (not necesary supported by many emulators) but it slower than a ram copy and pasting to sprram through dma


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 1:52 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3470
Location: Indianapolis
If sprite memory can be read, it would probably only be safe to do during vblank. This is good maybe if you have only a couple sprites, but any significant amount of them is way more efficient to do DMA with.

It's not like you'll miss a page of RAM that much. :) You could always reclaim most of the RAM page at $0100 for other purposes, if you don't use the stack a whole lot.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 5:06 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19113
Location: NE Indiana, USA (NTSC)
Memblers wrote:
You could always reclaim most of the RAM page at $0100 for other purposes, if you don't use the stack a whole lot.

I seem to remember that one of your own games (Munchie Attack?) has a bug where it pushes to the stack but doesn't pop, and FCEU's real-time memory viewer shows that the stack pointer marches rawther rapidly through page $0100.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 05, 2005 7:02 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3470
Location: Indianapolis
tepples wrote:
Memblers wrote:
You could always reclaim most of the RAM page at $0100 for other purposes, if you don't use the stack a whole lot.

I seem to remember that one of your own games (Munchie Attack?) has a bug where it pushes to the stack but doesn't pop, and FCEU's real-time memory viewer shows that the stack pointer marches rawther rapidly through page $0100.


Haha, yeah I noticed that bug too, recently. It was Munchie Attack, the control routine had a useless PHA instruction when you push a certain direction. I only found it when I started using the top of that page for some variables (indirect address for multiple NMI vectors).


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 3:35 pm 
Offline

Joined: Thu May 05, 2005 12:08 am
Posts: 4
Thanks for the help! I'm not too good at the DMA stuff, but I guess it is pretty simple just to store the sprite states in the main memory.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 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