Simple SNES shoot-'em-up game.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5 KiB

  1. ; Memory layout:
  2. ; 0000-000F: scratch space for functions.
  3. ; 0010-0011: controller state of joypad #1.
  4. ; 0012-0013: controller state of joypad #2.
  5. ; 0014-0016: 24-bit counter of vblanks.
  6. ; 0017-0019: RGB color values to use for background color, from [0-31].
  7. ; 001A-001B: 16-bit pointer to next random byte.
  8. ; [gap]
  9. ; 0020-0021: (x, y) coordinates of player.
  10. ; 0022: shot cooldown timer.
  11. ; 0023: next-shot state.
  12. ; [gap]
  13. ; 0030-003F: (x, y) velocities of each of the 8 possible shot states.
  14. ; 0040-009F: {sprite, x, y, x-velocity, y-velocity, unused} per player shot.
  15. ; If sprite is 0, the shot is disabled.
  16. ; 00A0-00FF: As above, for enemy shots.
  17. ; [gap]
  18. ; Sprite table buffers -- copied each frame to OAM during VBlank, using DMA.
  19. ; 1000-11FF: table 1 (4 bytes each: x/y coord, tile #, flip/priority/palette)
  20. ; 1200-121F: table 2 (2 bits each: high x-coord bit, size)
  21. ; 1220-12A0: scratch table. One byte per sprite for high x-coord & size.
  22. .define joy1 $10
  23. .define joy2 $12
  24. .define vBlankCounter $14
  25. .define backgroundRed $17
  26. .define backgroundGreen $18
  27. .define backgroundBlue $19
  28. .define randomBytePtr $1A
  29. .define playerX $20
  30. .define playerY $21
  31. .define shotCooldown $22
  32. .define nextShotState $23
  33. .define shotVelocityTable $30
  34. .define playerShotArray $40
  35. .define playerShotArrayLength 16
  36. .define enemyShotArray $A0
  37. .define enemyShotArrayLength 16
  38. .define shotSize 6
  39. .define numSprites 128
  40. .define spriteTableStart $1000
  41. .define spriteTable1Size $200
  42. .define spriteTable2Start $1200
  43. .define spriteTableSize $220
  44. .define spriteTableScratchStart $1220