Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .module LevelInit
- LVLInit:
- ;b level number
- ld a,0
- ld l,9
- dec b
- jr z,_draw ; check to see if we should count into the level data or stay at entry 1
- _loop:
- add a,l
- djnz _loop ;loop threw this until we hit the level count
- _draw:
- ld hl,LvlData
- ld a,e
- ld d,0
- add hl,de ; adjust hl to point to the buffer we are working with
- ld de,lvlbuffer
- ld bc,24
- ldir ;move it to ABS so we dont screw with the in file data
- ld b,8 ;hight of our maps
- __: ;dunno what to call this
- push bc
- ld b,8
- dec de ;dec de to the first byte inthe bit map
- ld a,(de)
- _drawloop:
- sra a
- call c,_Lpad ;lpad draws the lilypad
- djnz _drawloop
- pop bc
- djnz __
- _setupingamevars: ; ... ... im only so stupid... ... ...
- _Lpad: ; called during initial drawing increments drawing positions and calls lpadD
- ld ix,lilypad
- ld h,b ; save screen x counter
- pop bc ;restore screen y counter
- ld l,b ; save screen y counter
- push bc
- push af ; save flags for later
- ld a,8
- dec b
- jr z,_SXloop
- _SYloop:
- add l,a
- djnz _SYloop
- _SXloop:
- ld a,247
- ld b,h
- ld h,8
- _SXLOOP2:
- add a,h
- djnz _SXLoop2
- pop af
- push hl
- call LpadD
- pop hl
- ld b,h
- ret
- .endmodule
- LpadD:
- ;if C is set draw a lilypad at A x L y
- ;if C is unset draw a white box to clear it
- jr nc,_LpadDB
- ld ix,lilypad
- call iputspriteb
- ret
- _lpadDB:
- ld ix,Blanks
- call iputspriteb
- ret
Add Comment
Please, Sign In to add comment