oamobjects.asm 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. .Section "oam objects" superfree
  2. ;relative pointers to objects:
  3. ObjectLUT:
  4. .dw (Object000-ObjectLUT)
  5. .dw (Object001-ObjectLUT)
  6. Object000:
  7. .db %11011010 ;object type designation
  8. ;bit3=subroutine? if set, this object has its own subroutine that must be executed every frame
  9. ;bit4=animate? if set, this object is animated(a special table for each object specifies the exact animation with commands for tileloading, waiting, animation loop etc)
  10. ;bit5=screen-bound? if set, this object must move in accordance with background layer 0
  11. ;bit6=object active? if set, this object is active and needs to be processed. if clear, this sprite doesnt need to be processed
  12. ;bit7=object present? if set, this slot has an object. if clear, its considered empty and can be overwritten
  13. .db %00000000 ;object type designation 2
  14. .db $02 ;number of subroutine. executed if bit6 of object type is set
  15. .db 0 ;tileset to use
  16. .db $00 ;current "frame" of tileset to display
  17. .db $08 ;starting tile in vram
  18. .db %00110110 ;palette and config
  19. .dw $80 ;x position
  20. .dw $80 ;y position
  21. .db 0 ;current frame in animation list
  22. .db 0 ;object command list to use
  23. .db 0 ;object offset in object list.
  24. .db 0 ;palette number to upload for this sprite
  25. .dw 0 ;object number
  26. .db 0 ;x-displacement
  27. .db 0 ;y-displacement
  28. .db 0 ;z-displacement
  29. .db 0 ;animation repeat counter for nop
  30. .db 0 ;collision subroutine
  31. .db 0 ;vector speed. 3bit + 3bit sub-pixel accuracy. msb set=target speed met.(speed=0: don't calc vector movement)
  32. .db 0 ;void
  33. .db 0 ;void
  34. .db 0 ;void
  35. .db 7 ;spare variable
  36. .db 0 ;spare variable
  37. .db 0 ;spare variable
  38. .db 0 ;spare variable
  39. .db 0 ;spare variable
  40. .db 0 ;spare variable
  41. ;cpu usage indicator
  42. Object001:
  43. .db %11101000 ;object type designation
  44. ;bit0=X position sign of sprite(usually 0)
  45. ;bit1=Object size flag
  46. ;bit2=collidable
  47. ;bit3=subroutine? if set, this object has its own subroutine that must be executed every frame
  48. ;bit4=animate? if set, this object is animated(a special table for each object specifies the exact animation with commands for tileloading, waiting, animation loop etc)
  49. ;bit5=bg-bound? if set, this object must move in accordance with background layer 0
  50. ;bit6=object active? if set, this object is active and needs to be drawn. if clear, this sprite doesnt need to be drawn, but must be processed, anyway
  51. ;bit7=object present? if set, this slot has an object. if clear, its considered empty and can be overwritten
  52. .db %00100000 ;object type designation 2
  53. ;bit7=pseudo 3d sprite that needs to be moved according to z-value when background moves
  54. ;bit6=don't upload tiles for this sprite. useful for stuff like particles and such where lots of sprites share the same tiles.
  55. ;bit5=don't upload palette for this sprite.
  56. ;bits0-3: current position in vector angle LUT (didn't fit anywhere else)
  57. .db 1 ;number of subroutine. executed if bit6 of object type is set
  58. .db 0 ;tileset to use
  59. .db $00 ;current "frame" of tileset to display
  60. .db $ff ;starting tile in vram
  61. .db %00110001 ;palette and config
  62. .dw 1*16 ;x position
  63. .dw 1 ;y position
  64. .db 0 ;current frame in animation list
  65. .db 0 ;object command list to use
  66. .db 0 ;object offset in object list.
  67. .db 0 ;palette number to upload for this sprite
  68. .dw 0 ;object number
  69. .db 0 ;x-displacement
  70. .db 0 ;y-displacement
  71. .db 0 ;z-displacement
  72. .db 0 ;animation repeat counter for nop
  73. .db 0 ;collision subroutine
  74. .db 0 ;vector speed. bit0-2:subpixel speed. bit3-5:pixel speed. bit7 set: target speed met
  75. .db 0 ;vector target speed. bit0-2:subpixel speed target. bit3-5:pixel speed target. bit6,7: movement type(direct, linear slow, linear fast, smooth)
  76. .db 0 ;vector direction. bit0-5:direction.0=facing up. bit6=turning direction.(set=clockwise) msb set=target direction met.
  77. .db 0 ;vector target dir. bit0-5:target direction.0=facing up. bit6,7: movement type(direct, linear slow, linear fast, smooth)
  78. .db 0 ;subpixel buffer. bit0-2:vector speed subpixel buffer. bit3-7: direction turn speed sub-pixel buffer.
  79. .db 0 ;spare variable
  80. .db 0 ;spare variable
  81. .db 0 ;spare variable
  82. .db 0 ;spare variable
  83. .db 0 ;spare variable
  84. .ends