-3

Im trying to write a game in 6502 assembly langage but my sprite does not want to move:My sprite is at $200 so I did the follow:

Spriteloop:
    LDX $200 ;loading content of $200 address in X register
    INX  ;increment the number
    JMP Spriteloop ;loop back to move again

However,it doesnt work,my sprite does not move.

Thank you

J.Wilson
  • 51
  • 7

2 Answers2

2

You need to store X back into the memory register. I think it is STOX or STX? Been a while since I used any 6502 assembly.

TeasingDart
  • 371
  • 1
  • 6
0

Are you using OAMDMA to copy page 2 to VRAM in PPU? If you don't do this the sprites won't move. The system RAM is not connected to PPU so you need to copy it over.

Keep in mind that VRAM updates should be done during VBlank to prevent graphical glitches.

NMITIMEN
  • 75
  • 1
  • 7
  • 1
    Welcome to Stack Overflow. Just FYI, this question is 4 years old, and the user who asked it hasn't logged on since about a month after they posted this. (You can see that by clicking on their username: https://stackoverflow.com/users/5464282/j-wilson). Worth keeping in mind before answering old questions. I think your question is rhetorical and intended for the benefit of (unlikely) future readers, not actually hoping for a response from the OP, so that's fine. But scattering useful tidbits around on multiple simple questions makes it unlikely to be seen. – Peter Cordes Oct 20 '19 at 06:24
  • Anyway, I think this looks like a duplicate of the other one you answered recently (I follow the `[assembly]` tag, among others, so I saw your answers bump both of those questions in the recent-activity list.) – Peter Cordes Oct 20 '19 at 06:26