It is currently Wed Aug 23, 2017 6:19 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat Jul 08, 2017 4:32 pm 
Offline
User avatar

Joined: Sun Jan 08, 2017 2:26 pm
Posts: 3
So I've been working on my own NES project recently (written in ASM6), and I've had some trouble making a working player animation with metasprites. For now, I'm just trying to get an idle animation where the player blinks periodically. I've tried making tables of Animation sequences, which contain the duration of the frame and the location of the metasprite, but nothing I've tried has proven successful, and I feel like my code is getting too confusing for it's own good, prompting me to wonder if I'm even going in the right direction, or if there's a much simpler way to do metasprite animations(probably the latter). I've looked through the wiki and forums, but I haven't been able to find anything suggesting a more effective method. Am I on the right track? Is there a better alternative to what I'm doing? I'd love to know! Attached is the code and chr. for the program. Code concerning player animation starts at lines 246, 416, 441, and 604.


Attachments:
mario.chr [8 KiB]
Downloaded 11 times
NESGame.asm [19.87 KiB]
Downloaded 17 times
Top
 Profile  
 
PostPosted: Sun Jul 09, 2017 1:07 am 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 181
What isn't working? I think your approach is fine.


Top
 Profile  
 
PostPosted: Sun Jul 09, 2017 10:36 am 
Offline
User avatar

Joined: Sun Jan 08, 2017 2:26 pm
Posts: 3
pubby wrote:
I think your approach is fine.


OK that's good to hear.

I think my main problem is in the UpdatePlayerAnim routine. What I want it to do is to change the PlayerFramePtr to the next frame of animation in the sequence every time that PlayerAnimCounter reaches zero then looping back to the beginning once it reads a frame length of zero, but that's proving to be easier said than done for me. I think the fact that DrawPlayerAnimFrame takes place during the NMI makes it harder to deal with, since the subroutine's already expecting the animation + frame to be loaded in to the two pointers. Is it possible for me to move updating sprites into the main loop, or does it need to be in vblank? Or should I just load an initial "default animation" during reset?


Top
 Profile  
 
PostPosted: Sun Jul 09, 2017 11:27 am 
Online
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1688
Location: DIGDUG
Quote:
Is it possible for me to move updating sprites...from vblank


The sprite / OAM DMA transfer needs to be during vblank. From a buffer. You can fill the buffer any time.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Sun Jul 09, 2017 12:02 pm 
Offline
User avatar

Joined: Sun Jan 08, 2017 2:26 pm
Posts: 3
Wow, hearing you say that now makes makes me realize how dumb that last question was. Thanks!

EDIT: Just got the idle animation working properly!


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot], tokumaru 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