From c7e75f7f6247e61d8401aa34b3e0c90befc53a5a Mon Sep 17 00:00:00 2001 From: Pierre Gorin Date: Mon, 11 Dec 2023 16:45:39 +0100 Subject: [PATCH] add gums and superGuls --- pacMan/pacman.asm | 72 ++++++++++++++++++++++++++++------------------- pacMan/sprite.asm | 9 ++++-- 2 files changed, 50 insertions(+), 31 deletions(-) diff --git a/pacMan/pacman.asm b/pacMan/pacman.asm index 1332395..d619b19 100644 --- a/pacMan/pacman.asm +++ b/pacMan/pacman.asm @@ -21,35 +21,35 @@ section .data frame db 1 ; maze array maze db 26,22,22,22,22,22,22,22,22,22,22,22,22,30,31,22,22,22,22,22,22,22,22,22,22,22,22,27 - db 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,13,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,24 - db 25, 0,14,10,10,15, 0,14,10,10,10,15, 0,13,12, 0,14,10,10,10,15, 0,14,10,10,15, 0,24 - db 25, 0,13, 0, 0,12, 0,13, 0, 0, 0,12, 0,13,12, 0,13, 0, 0, 0,12, 0,13, 0, 0,12, 0,24 - db 25, 0,17,11,11,16, 0,17,11,11,11,16, 0,17,16, 0,17,11,11,11,16, 0,17,11,11,16, 0,24 - db 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,24 - db 25, 0,14,10,10,15, 0,14,15, 0,14,10,10,10,10,10,10,15, 0,14,15, 0,14,10,10,15, 0,24 - db 25, 0,17,11,11,16, 0,13,12, 0,17,11,11,19,18,11,11,16, 0,13,12, 0,17,11,11,16, 0,24 - db 25, 0, 0, 0, 0, 0, 0,13,12, 0, 0, 0, 0,13,12, 0, 0, 0, 0,13,12, 0, 0, 0, 0, 0, 0,24 - db 29,23,23,23,23,15, 0,13,21,10,10,15, 0,13,12, 0,14,10,10,20,12, 0,14,23,23,23,23,28 - db 0, 0, 0, 0, 0,25, 0,13,18,11,11,16, 0,17,16, 0,17,11,11,19,12, 0,24, 0, 0, 0, 0, 0 - db 0, 0, 0, 0, 0,25, 0,13,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,13,12, 0,24, 0, 0, 0, 0, 0 - db 0, 0, 0, 0, 0,25, 0,13,12, 0,38,23,36, 1, 1,37,23,39, 0,13,12, 0,24, 0, 0, 0, 0, 0 - db 22,22,22,22,22,16, 0,17,16, 0,24, 0, 0, 0, 0, 0, 0,25, 0,17,16, 0,17,22,22,22,22,22 - db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,24, 0, 0, 0, 0, 0, 0,25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - db 23,23,23,23,23,15, 0,14,15, 0,24, 0, 0, 0, 0, 0, 0,25, 0,14,15, 0,14,23,23,23,23,23 - db 0, 0, 0, 0, 0,25, 0,13,12, 0,41,22,22,22,22,22,22,40, 0,13,12, 0,24, 0, 0, 0, 0, 0 - db 0, 0, 0, 0, 0,25, 0,13,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,13,12, 0,24, 0, 0, 0, 0, 0 - db 0, 0, 0, 0, 0,25, 0,13,12, 0,14,10,10,10,10,10,10,15, 0,13,12, 0,24, 0, 0, 0, 0, 0 - db 26,22,22,22,22,16, 0,17,16, 0,17,11,11,19,18,11,11,16, 0,17,16, 0,17,22,22,22,22,27 - db 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,13,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,24 - db 25, 0,14,10,10,15, 0,14,10,10,10,15, 0,13,12, 0,14,10,10,10,15, 0,14,10,10,15, 0,24 - db 25, 0,17,11,19,12, 0,17,11,11,11,16, 0,17,16, 0,17,11,11,11,16, 0,13,18,11,16, 0,24 - db 25, 0, 0, 0,13,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,13,12, 0, 0, 0,24 - db 33,10,15, 0,13,12, 0,14,15, 0,14,10,10,10,10,10,10,15, 0,14,15, 0,13,12, 0,14,10,34 - db 32,11,16, 0,17,16, 0,13,12, 0,17,11,11,19,18,11,11,16, 0,13,12, 0,17,16, 0,17,11,35 - db 25, 0, 0, 0, 0, 0, 0,13,12, 0, 0, 0, 0,13,12, 0, 0, 0, 0,13,12, 0, 0, 0, 0, 0, 0,24 - db 25, 0,14,10,10,10,10,20,21,10,10,15, 0,13,12, 0,14,10,10,20,21,10,10,10,10,15, 0,24 - db 25, 0,17,11,11,11,11,11,11,11,11,16, 0,17,16, 0,17,11,11,11,11,11,11,11,11,16, 0,24 - db 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,24 + db 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,13,12, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,24 + db 25, 2,14,10,10,15, 2,14,10,10,10,15, 2,13,12, 2,14,10,10,10,15, 2,14,10,10,15, 2,24 + db 25, 3,13, 0, 0,12, 2,13, 0, 0, 0,12, 2,13,12, 2,13, 0, 0, 0,12, 2,13, 0, 0,12, 3,24 + db 25, 2,17,11,11,16, 2,17,11,11,11,16, 2,17,16, 2,17,11,11,11,16, 2,17,11,11,16, 2,24 + db 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,24 + db 25, 2,14,10,10,15, 2,14,15, 2,14,10,10,10,10,10,10,15, 2,14,15, 2,14,10,10,15, 2,24 + db 25, 2,17,11,11,16, 2,13,12, 2,17,11,11,19,18,11,11,16, 2,13,12, 2,17,11,11,16, 2,24 + db 25, 2, 2, 2, 2, 2, 2,13,12, 2, 2, 2, 2,13,12, 2, 2, 2, 2,13,12, 2, 2, 2, 2, 2, 2,24 + db 29,23,23,23,23,15, 2,13,21,10,10,15, 2,13,12, 2,14,10,10,20,12, 2,14,23,23,23,23,28 + db 0, 0, 0, 0, 0,25, 2,13,18,11,11,16, 0,17,16, 0,17,11,11,19,12, 2,24, 0, 0, 0, 0, 0 + db 0, 0, 0, 0, 0,25, 2,13,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,13,12, 2,24, 0, 0, 0, 0, 0 + db 0, 0, 0, 0, 0,25, 2,13,12, 0,38,23,36, 1, 1,37,23,39, 0,13,12, 2,24, 0, 0, 0, 0, 0 + db 22,22,22,22,22,16, 2,17,16, 0,24, 0, 0, 0, 0, 0, 0,25, 0,17,16, 2,17,22,22,22,22,22 + db 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,24, 0, 0, 0, 0, 0, 0,25, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0 + db 23,23,23,23,23,15, 2,14,15, 0,24, 0, 0, 0, 0, 0, 0,25, 0,14,15, 2,14,23,23,23,23,23 + db 0, 0, 0, 0, 0,25, 2,13,12, 0,41,22,22,22,22,22,22,40, 0,13,12, 2,24, 0, 0, 0, 0, 0 + db 0, 0, 0, 0, 0,25, 2,13,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,13,12, 2,24, 0, 0, 0, 0, 0 + db 0, 0, 0, 0, 0,25, 2,13,12, 0,14,10,10,10,10,10,10,15, 0,13,12, 2,24, 0, 0, 0, 0, 0 + db 26,22,22,22,22,16, 2,17,16, 0,17,11,11,19,18,11,11,16, 0,17,16, 2,17,22,22,22,22,27 + db 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,13,12, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,24 + db 25, 2,14,10,10,15, 2,14,10,10,10,15, 2,13,12, 2,14,10,10,10,15, 2,14,10,10,15, 2,24 + db 25, 2,17,11,19,12, 2,17,11,11,11,16, 2,17,16, 2,17,11,11,11,16, 2,13,18,11,16, 2,24 + db 25, 3, 2, 2,13,12, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,13,12, 2, 2, 3,24 + db 33,10,15, 2,13,12, 2,14,15, 2,14,10,10,10,10,10,10,15, 2,14,15, 2,13,12, 2,14,10,34 + db 32,11,16, 2,17,16, 2,13,12, 2,17,11,11,19,18,11,11,16, 2,13,12, 2,17,16, 2,17,11,35 + db 25, 2, 2, 2, 2, 2, 2,13,12, 2, 2, 2, 2,13,12, 2, 2, 2, 2,13,12, 2, 2, 2, 2, 2, 2,24 + db 25, 2,14,10,10,10,10,20,21,10,10,15, 2,13,12, 2,14,10,10,20,21,10,10,10,10,15, 2,24 + db 25, 2,17,11,11,11,11,11,11,11,11,16, 2,17,16, 2,17,11,11,11,11,11,11,11,11,16, 2,24 + db 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,24 db 29,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,28 ; --------------------------------------------------------------------- Column dw 28 ; number of columns @@ -139,6 +139,10 @@ section .text je DrawEmpty ; cmp al, 1 je DrawDoor + cmp al, 2 + je DrawGum + cmp al, 3 + je DrawSuperGum cmp al, 10 je DrawSmplwall1 cmp al, 11 @@ -207,6 +211,16 @@ section .text ; END WALL CHOICE ----------------- ; SET WALL ------------------------ + DrawGum: + mov si, gum + call drawWalls + jmp wallchoice + + DrawSuperGum: + mov si, superGum + call drawWalls + jmp wallchoice + DrawEmpty: ; tell which sprite he want to draw mov si, empty ; call the function to draw the tile call drawWalls ; return to the function where he will look which sprite to use diff --git a/pacMan/sprite.asm b/pacMan/sprite.asm index b32cfa8..38f7b70 100644 --- a/pacMan/sprite.asm +++ b/pacMan/sprite.asm @@ -370,8 +370,13 @@ section .data db 0x00, 0x57, 0x57, 0x57, 0x57, 0x00 ;gum - gum db 0x57, 0x57 - db 0x57, 0x57 + gum db 0x00,0x00,0x00,0x00,0x00,0x00 + db 0x00,0x00,0x00,0x00,0x00,0x00 + db 0x00,0x00,0x57,0x57,0x00,0x00 + db 0x00,0x00,0x57,0x57,0x00,0x00 + db 0x00,0x00,0x00,0x00,0x00,0x00 + db 0x00,0x00,0x00,0x00,0x00,0x00 + ; maze patterns sprite ------------------------------------------------ ; simple wall