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.

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