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.

62 lines
2.0 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. ; 001C-001D: 16-bit high-score.
  9. ; [gap]
  10. ; 0020-0021: (x, y) coordinates of player.
  11. ; 0022: player health.
  12. ; 0023: shot cooldown timer.
  13. ; 0024: next-shot state.
  14. ; 0025: number of frames until the next enemy ship spawns.
  15. ; 0026-0027: player score.
  16. ; [gap]
  17. ; 0030-003F: (x, y) velocities of each of the 8 possible shot states.
  18. ; 0040-009F: {sprite, x, y, x-velocity, y-velocity, unused} per player shot.
  19. ; If sprite is 0, the shot is disabled.
  20. ; 00A0-015F: As above, for enemy shots.
  21. ; 0160-????: {sprite, x, y, move AI type, shoot AI type, shot cooldown}
  22. ; per enemy ship.
  23. ; [gap]
  24. ; Sprite table buffers -- copied each frame to OAM during VBlank, using DMA.
  25. ; 1000-11FF: table 1 (4 bytes each: x/y coord, tile #, flip/priority/palette)
  26. ; 1200-121F: table 2 (2 bits each: high x-coord bit, size)
  27. ; 1220-12A0: scratch table. One byte per sprite for high x-coord & size.
  28. .define joy1 $10
  29. .define joy2 $12
  30. .define vBlankCounter $14
  31. .define backgroundRed $17
  32. .define backgroundGreen $18
  33. .define backgroundBlue $19
  34. .define randomBytePtr $1A
  35. .define highScore $1C
  36. .define playerX $20
  37. .define playerY $21
  38. .define playerHealth $22
  39. .define shotCooldown $23
  40. .define nextShotState $24
  41. .define enemyShipSpawnCooldown $25
  42. .define playerScore $26
  43. .define shotVelocityTable $30
  44. .define playerShotArray $40
  45. .define playerShotArrayLength 16
  46. .define enemyShotArray $A0
  47. .define enemyShotArrayLength 32
  48. .define shotSize 6
  49. .define enemyShipArray $160
  50. .define enemyShipArrayLength 8
  51. .define enemyShipSize 6
  52. .define numSprites 128
  53. .define spriteTableStart $1000
  54. .define spriteTable1Size $200
  55. .define spriteTable2Start $1200
  56. .define spriteTableSize $220
  57. .define spriteTableScratchStart $1220