Guest User

Untitled

a guest
Dec 10th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .module LevelInit
  2. LVLInit:
  3. ;b level number
  4.  ld a,0
  5.  ld l,9
  6.  dec b
  7.  jr z,_draw  ; check to see if we should count into the level data or stay at entry 1
  8.  _loop:
  9.  add a,l
  10.  djnz _loop ;loop threw this until we hit the level count
  11. _draw:
  12.  ld hl,LvlData
  13.  ld a,e
  14.  ld d,0
  15.  add hl,de ; adjust hl to point to the buffer we are working with
  16.  ld de,lvlbuffer
  17.  ld bc,24
  18.  ldir    ;move it to ABS so we dont screw with the in file data
  19.  ld b,8 ;hight of our maps
  20. __: ;dunno what to call this
  21.  push bc
  22.   ld b,8
  23.   dec de       ;dec de to the first byte inthe bit map
  24.   ld a,(de)
  25. _drawloop:
  26.   sra a
  27.  
  28.   call c,_Lpad  ;lpad draws the lilypad
  29.   djnz _drawloop
  30.  pop bc
  31.  djnz __
  32.  
  33. _setupingamevars: ; ... ... im only so stupid... ... ...
  34.  
  35.  
  36.  
  37. _Lpad: ; called during initial drawing increments drawing positions and calls lpadD
  38.   ld ix,lilypad
  39.   ld h,b  ; save screen x counter
  40.  pop bc  ;restore screen y counter
  41.  ld l,b  ; save screen y counter
  42.  push bc
  43.   push af ; save flags for later
  44.    ld a,8
  45.    dec b
  46.    jr z,_SXloop
  47. _SYloop:
  48.    add l,a
  49.    djnz _SYloop
  50. _SXloop:
  51.    ld a,247
  52.    ld b,h
  53.    ld h,8
  54. _SXLOOP2:
  55.    add a,h
  56.    djnz _SXLoop2
  57.   pop af
  58.   push hl
  59.    call LpadD
  60.   pop hl
  61.   ld b,h
  62.  ret
  63.  
  64.    
  65. .endmodule
  66.    
  67. LpadD:
  68. ;if C is set draw a lilypad at A x L y
  69. ;if C is unset draw a white box to clear it
  70.  jr nc,_LpadDB
  71.  ld ix,lilypad
  72.  call iputspriteb
  73.  ret
  74. _lpadDB:
  75.  ld ix,Blanks
  76.  call iputspriteb
  77.  ret
Add Comment
Please, Sign In to add comment