Page 1 of 1

Need help with some basics

Posted: Wed Nov 18, 2020 2:23 pm
by zerqs
Hi Keith
thank you so mutch for your awsome videos.
They helped me a great deal on my journey to learn 6502.
i think i have fair grasp on the opcodes and how to use them,but..
i cant get my head around how to structure a project and how to do certain
basic things for a game, so im left with more questions than answers. :Clueless:
(Im developing for the nes)
heres a few things i struggle with:
- animating a players walk cycle.
-shoud i do one big rutine that does it all, check direction,is he jumping? is he running etc
or shoud this be done in smaller subrutines?
- is it ok to use subrutines inside subrutines, is it ok to nest them 2-3 levels deep?
or is that seen as bad practice?
- since the nes copy sprites to the OAM inside the NMI -RTI block can i call the OAM sprite copy rutine more than once
inside the NMI?

I feels like i miss some critical information to make it all click.

anny help is mutch appreciated

Re: Need help with some basics

Posted: Wed Nov 18, 2020 6:44 pm
by zerqs
ok, made some kind of progress on the animation part.. :-P

Re: Need help with some basics

Posted: Sun Nov 22, 2020 8:03 am
by akuyou
Break your program down into small parts. It's fine to nest multiple subroutines, as many as you want, so long as you don't run out of stack space.

You don't need to break up the main loop, but you can, whatever you find easiest (I'd break it into parts)

I'm not sure what you mean about multiple sprite copies in the NMI, what you can do in the NMI tends to come down to speed, if you do too much VBlank will end before your transfer has completed.