-
Notifications
You must be signed in to change notification settings - Fork 0
Maze Model Buffer
BuildMazeModelBuffer
The maze model buffer is a clone of the original Maze Model, here to be modified during the game, by deleting pellets. Each time pacman eats a pellet, the hexa code of the pellet's tile in this buffer, is replaced by the hexa code of the background tile. Objectively, this function create a 25 by 40 array of bytes, each byte being the hexa code of a maze's tile. This function write the maze model buffer in the bss section.
This function needs to reserve the size of the buffer in the bss section. This function needs to include the heap library.
The function which clones the MazeModel into the bss section :
BuildMazeModelBuffer:
; clone the MazeModel to be modified while keeping the original
;set the destination 'es:di'
push ds
pop es
mov di, MazeModelBuffer
;set the source 'ds:si'
mov si, MazeModel
mov cx, MAZE_HEIGHT*MAZE_WIDTH
rep movsb
ret
You only need to call this function once at the beginning of the program. This function is needed to detect which pellets have been eated or not.
Benoît DE KEYN