?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. PASS_LENGTH:                    equ 16
  2. MAP_WIDTH:                      equ 16
  3. MAP_HEIGHT:                     equ 12
  4. MAX_OBJECTS:                    equ 10
  5. ACCELERATE_STEP:                equ 13
  6. MAX_SPEED:                      equ 6
  7. OBJECT_DATA_SIZE:               equ oData
  8. ; FONT: if MACHINE == 48               
  9. ;               equ #3D00
  10. ;       endif
  11. ;       if MACHINE == 48               
  12. ;               equ cartrigeFont - 256
  13. ;       endif
  14. TEXT_END:                       equ 0
  15. ATTR_ADDR:                      equ #5800
  16.         struct oData
  17. x               byte    // 0
  18. y               byte    // 1
  19. preX            byte    // 2
  20. preY            byte    // 3
  21. cellId          byte   
  22. spriteId        byte   
  23. direction       byte   
  24. launchTime      byte    ; time before the object starts to move
  25. color           byte    ; color (8 bit)
  26. targetL:        byte    ; address of target object data
  27. targetH:        byte    ; ------//-------
  28. delta           byte    ; delta for velocity
  29. accelerate      byte    ; velocity for object (FIXME rename to velocity)
  30. step:           byte    ; step for delta
  31. isMovable       byte    ; 0 - false, !=0 - true
  32. needDraw:       byte    ; 0 - redraw every frame, !0 - no redraw
  33. isDestroyed     byte    ; object destroyed
  34. exec            dw      ; The address of the procedure executed every frame for the current object. #0000 = not called.
  35.                 ; the order of the next 6 bytes cannot be changed !!!
  36. scrAddrL:       byte
  37. scrAddrH:       byte
  38. sprAddrL:       byte
  39. sprAddrH:       byte
  40. drawMethod:     byte    ; !=0 = 3x2, ==0 = 2x2
  41. bit:            byte    ; bit 0-7 of X coordinate
  42.  
  43.  
  44. clearSide:      byte    ; the side on which you want to clean up the sprite tail. 0 = do not clean
  45. clrScrAddrL:    byte    ; the address of the screen where the cleaning will take place.
  46. clrScrAddrH:    byte    ; --------------//--------------
  47.  
  48.                 ; introduce a variable drawOnce? for example, for an exit door, it is an object,
  49.                 ; but it makes no sense to print it every frame, it is enough when the level is initialized.
  50.  
  51. animationId:    byte
  52. n1:             byte    ; --//--       
  53. isFinalClean:   byte    ; whether the tail of the sprite needs to be cleaned or not when the sprite is stopped
  54. id:             byte    ; id of this object in objects map
  55.         ends
  56.  
  57.  
  58.  
  59.         struct DIRECTION
  60. NONE:   byte
  61. LEFT:   byte
  62. RIGHT:  block 2
  63. UP:     block 4
  64. DOWN:   block 8
  65. FIRE
  66.         ends
  67.  
  68.         //-------------------------------------------------------------
  69.         module INK
  70. BLACK   equ 0
  71. BLUE    equ 1
  72. RED     equ 2
  73. PURPLE  equ 3
  74. GREEN   equ 4
  75. CYAN    equ 5
  76. YELLOW  equ 6
  77. WHITE   equ 7
  78.         endmodule
  79.  
  80.         module PAPER
  81. BLACK   equ INK.BLACK << 3
  82. BLUE    equ INK.BLUE << 3
  83. RED     equ INK.RED << 3
  84. PURPLE  equ INK.PURPLE << 3
  85. GREEN   equ INK.GREEN << 3
  86. CYAN    equ INK.CYAN << 3
  87. YELLOW  equ INK.YELLOW << 3
  88. WHITE   equ INK.WHITE << 3
  89.         endmodule
  90. BRIGHTNESS equ %01000000
  91.         //-------------------------------------------------------------
  92.  
  93.         ; macros for set update procedure of object
  94.         macro SET_EXEC_IX address
  95.         ld (ix+oData.exec),low address
  96.         ld (ix+oData.exec + 1),high address
  97.         endm
  98. ;       macro SET_EXEC_IY address
  99. ;       ld (iy+oData.exec),low address
  100. ;       ld (iy+oData.exec + 1),high address
  101. ;       endm
  102.  
  103.         macro SET_SPRITE_ADDR_IX address
  104.         ld (ix+oData.sprAddrL),low address
  105.         ld (ix+oData.sprAddrH),high address
  106.         endm
  107.  
  108. ;       macro SET_SPRITE_ADDR_IY address
  109. ;       ld (iy+oData.sprAddrL),low address
  110. ;       ld (iy+oData.sprAddrH),high address
  111. ;       endm
  112.  
  113.  
  114.  
  115.  
  116.         ; for DEBUG
  117.  
  118.         macro BORDER color
  119.         if DEBUG
  120.         ld a,color
  121.         out (254),a
  122.         endif
  123.         endm