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.

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