Need help with some basics

6502, 65c02, and 6280 CPU programming
Post Reply
zerqs
Posts: 2
Joined: Sun Nov 01, 2020 8:10 pm

Need help with some basics

Post by zerqs » Wed Nov 18, 2020 2:23 pm

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

zerqs
Posts: 2
Joined: Sun Nov 01, 2020 8:10 pm

Re: Need help with some basics

Post by zerqs » Wed Nov 18, 2020 6:44 pm

ok, made some kind of progress on the animation part.. :-P
Attachments
clean.gif
clean.gif (209.43 KiB) Viewed 3275 times

User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: Need help with some basics

Post by akuyou » Sun Nov 22, 2020 8:03 am

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.
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

Post Reply

Return to “General 6502 Programming”