Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; check if there's even enough memory free
- ld hl,MAPSIZE+16
- bcall EnoughMem
- jr nc,HasEnoughMem
- bcall ErrMemory
- ret
- HasEnoughMem:
- ; create appvar
- ld hl, AllocName
- rst 20h
- ld hl,MAPSIZE+16
- bcall CreateAppVar
- ld hl,16 ; not offsetting the data address before you write to it seems to
- ; give the variable an invalid size and I don't know how much to offset, so 16
- add hl,de
- ld (MapPointer),hl
- ; should set the map to all tile 1
- ld bc, MAPSIZE
- ld a,1
- bcall MemSet
- ; do whatever that uses the allocated memory
- ; free up the memory allocated
- ld hl, AllocName
- rst 20h
- bcall ChkFindSym
- ret C
- bcall DelVar
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement