From 4706db1e37c9dc47b53d32a36f86dee9b36d3a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20CHARTIER?= Date: Fri, 17 Nov 2023 13:50:30 +0100 Subject: [PATCH 01/60] Add code to display sprites --- src/_test_sprites.asm | 34 ++++++++++++++ src/constants.asm | 55 ++++++++++++++++++++++ src/entry.asm | 4 ++ src/main.asm | 26 +++++++++++ src/sprites.asm | 105 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 224 insertions(+) create mode 100644 src/_test_sprites.asm create mode 100644 src/constants.asm create mode 100644 src/entry.asm create mode 100644 src/main.asm create mode 100644 src/sprites.asm diff --git a/src/_test_sprites.asm b/src/_test_sprites.asm new file mode 100644 index 0000000..b3ade4f --- /dev/null +++ b/src/_test_sprites.asm @@ -0,0 +1,34 @@ +start: + ; Set video mode to 320x200 256 colors graphic mode + mov ax, 0013h + int 10h + push 0a000h + pop es + + ; TEMP: Draw all the sprites + call draw_spritesheet + + ; TEMP: Randomly add a ghost with eyes + mov ax, 80 + mov bx, 160 + call calculate_screen_position + push dx + mov ax, BLINKY_1 + call calculate_spritesheet_position + call draw_sprite + pop dx + mov ax, EYES_RIGHT + call calculate_spritesheet_position + call draw_sprite + + ; Exit + jmp exit + + + +exit: + ; Wait for key and terminate the program + mov al,01h ; Clear buffer + mov ah,0ch ; Read key + int 21h ; Execute + int 20h ; Exit \ No newline at end of file diff --git a/src/constants.asm b/src/constants.asm new file mode 100644 index 0000000..b82dece --- /dev/null +++ b/src/constants.asm @@ -0,0 +1,55 @@ +%define SCREEN_WIDTH 320 +%define SCREEN_HEIGHT 200 +%define SPRITE_SIZE 16 + +%define BLINKY_1 0 +%define BLINKY_2 1 +%define PINKY_1 2 +%define PINK_2 3 +%define INKY_1 4 +%define INKY_2 5 +%define CLYDE_1 6 +%define CLYDE_2 7 +%define AFRAID_1 8 +%define AFRAID_2 9 +%define AFRAID_3 10 +%define AFRAID_4 11 +%define EYES_RIGHT 12 +%define EYES_LEFT 13 +%define EYES_UP 14 +%define EYES_DOWN 15 +%define PACMAN_RIGHT_1 16 +%define PACMAN_RIGHT_2 17 +%define PACMAN_UP_1 18 +%define PACMAN_UP_2 19 +%define PACMAN_LEFT_1 20 +%define PACMAN_LEFT_2 21 +%define PACMAN_DOWN_1 22 +%define PACMAN_DOWN_2 23 +%define CHERRY 24 +%define STRAWBERRY 25 +%define ORANGE 26 +%define APPLE 27 +%define MELON 28 +%define GALAXIAN 29 +%define BELL 30 +%define KEY 31 +%define PACMAN_FULL 32 +%define PACMAN_DEATH_1 33 +%define PACMAN_DEATH_2 34 +%define PACMAN_DEATH_3 35 +%define PACMAN_DEATH_4 36 +%define PACMAN_DEATH_5 37 +%define PACMAN_DEATH_6 38 +%define PACMAN_DEATH_7 39 +%define PACMAN_DEATH_8 40 +%define PACMAN_DEATH_9 41 +%define PACMAN_DEATH_10 42 +%define DOT 43 +%define POWER_PELLET 44 + + + +section .data + palette db 0, 44, 40, 15, 66, 33, 84, 52, 88, 48, 78, 3, 65, 0 + spritesheet dd 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x20222002, 0x20022202, 0x20020002, 0x20002002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22202202, 0x20220222, 0x02002200, 0x00220020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x60666006, 0x60066606, 0x60060006, 0x60006006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66606606, 0x60660666, 0x06006600, 0x00660060, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x70777007, 0x70077707, 0x70070007, 0x70007007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77707707, 0x70770777, 0x07007700, 0x00770070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x40444004, 0x40044404, 0x40040004, 0x40004004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44404404, 0x40440444, 0x04004400, 0x00440040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x50555005, 0x50055505, 0x50050005, 0x50005005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x55505505, 0x50550555, 0x05005500, 0x00550050, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x30333003, 0x30033303, 0x30030003, 0x30003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x33303303, 0x30330333, 0x03003300, 0x00330030, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x30030000, 0x00300300, 0x33330000, 0x00333300, 0x55330000, 0x00553300, 0x55330000, 0x00553300, 0x30030000, 0x00300300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300300, 0x00003003, 0x00333300, 0x00003333, 0x00335500, 0x00003355, 0x00335500, 0x00003355, 0x00300300, 0x00003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00550000, 0x00005500, 0x30550300, 0x00305503, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x00330000, 0x00003300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00330000, 0x00003300, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x30550300, 0x00305503, 0x00550000, 0x00005500, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00000011, 0x11111100, 0x00000010, 0x11111100, 0x00000000, 0x10111101, 0x00000000, 0x00111101, 0x00000000, 0x00101101, 0x00000000, 0x00111101, 0x00000000, 0x10111101, 0x00000000, 0x11111100, 0x00000000, 0x11111100, 0x00000010, 0x11110100, 0x00000011, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00001011, 0x11111101, 0x00000000, 0x00101101, 0x00000000, 0x11111101, 0x00000000, 0x11111101, 0x00001011, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100100, 0x00001100, 0x00101100, 0x00101100, 0x00111100, 0x00101101, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11010000, 0x00001111, 0x11000000, 0x00101111, 0x01000000, 0x00101111, 0x00000000, 0x00111111, 0x00000000, 0x00111101, 0x00000000, 0x00111100, 0x00000000, 0x00111101, 0x00000000, 0x00111111, 0x01000000, 0x00101111, 0x11000000, 0x00101111, 0x11010000, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110000, 0x00111111, 0x01000000, 0x00111111, 0x00000000, 0x00111100, 0x01000000, 0x00111111, 0x11110000, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00101101, 0x00111100, 0x00001101, 0x00110100, 0x00001001, 0x00110000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x00111100, 0x00101101, 0x00101100, 0x00101100, 0x00100100, 0x00001100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00cc0000, 0x00000000, 0x00cccc00, 0x00000000, 0x00000ccc, 0x0c000000, 0x00000c00, 0xc0220200, 0x0000c000, 0x222c2200, 0x0000000c, 0x20222200, 0x0000222c, 0x02222300, 0x0020222c, 0x02322200, 0x00202222, 0x02220200, 0x00202232, 0x02000000, 0x00202223, 0x00000000, 0x00002222, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x93990000, 0x00009099, 0x99290200, 0x00002299, 0x29222200, 0x00202322, 0x22222300, 0x00202223, 0x23232200, 0x00202222, 0x22222200, 0x00203222, 0x23320200, 0x00002222, 0x22220200, 0x00002222, 0x32220000, 0x00000023, 0x22020000, 0x00000022, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00009009, 0x0c000000, 0x00909999, 0x0c000000, 0x00009909, 0xcc440000, 0x000044c4, 0x4c440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44440400, 0x00404444, 0x44440400, 0x00404444, 0x44040000, 0x00004044, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000c0, 0x0c220200, 0x00002202, 0x2c222200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222322, 0x22222200, 0x00222322, 0x22220200, 0x00203222, 0x22220200, 0x00202222, 0x22220000, 0x00002222, 0x20020000, 0x00002022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00b00000, 0x00000000, 0xbb0b0000, 0x000000bb, 0x0b000000, 0x00000000, 0x93000000, 0x00000090, 0x9b990000, 0x00009099, 0xb9b30900, 0x0000b999, 0x999b0900, 0x0000993b, 0x99b99300, 0x0090b9b9, 0x3b999b00, 0x00903b99, 0x99b99300, 0x009099b9, 0x3b9b0900, 0x0000993b, 0xb9990900, 0x0000b999, 0x999b0000, 0x0000909b, 0x99000000, 0x000000b0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x22005000, 0x00500020, 0x22025000, 0x00500022, 0x12225100, 0x00502112, 0x12115100, 0x00501111, 0x11115500, 0x00501511, 0x01510500, 0x00005501, 0x01550000, 0x00005005, 0x01050000, 0x00000005, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000010, 0x1d010000, 0x000010d1, 0x11110000, 0x00001111, 0xd1110000, 0x00001111, 0x111d0000, 0x00001111, 0x111d0100, 0x00101111, 0x111d0100, 0x00101111, 0x11110100, 0x00101111, 0x11d11100, 0x00111111, 0x11d11100, 0x00111111, 0x11111100, 0x00111111, 0xaaaa1a00, 0x00a1aa33, 0xaaaa0a00, 0x00a0aa33, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xaa000000, 0x000000a0, 0x00aa0000, 0x0000a00a, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x3d000000, 0x000000d0, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00001111, 0x10110100, 0x00101111, 0x10111100, 0x10111111, 0x10111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001011, 0x10110000, 0x00111111, 0x10111101, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001111, 0x10110100, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11110000, 0x00001011, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11111101, 0x00111111, 0x11111111, 0x10111111, 0x10111101, 0x00111111, 0x00110100, 0x00001101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11110100, 0x00001111, 0x11111101, 0x00111111, 0x10111101, 0x00111111, 0x00111100, 0x00101101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11010000, 0x00000011, 0x10000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000001, 0x10000000, 0x00000010, 0x00000100, 0x00000100, 0x00100000, 0x00001000, 0x00000000, 0x00000000, 0x00001100, 0x00100100, 0x00000000, 0x00000000, 0x00100000, 0x00001000, 0x00000100, 0x00000100, 0x10000000, 0x00000010, 0x00010000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x08000000, 0x00000080, 0x08000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x88000000, 0x00000088, 0x88080000, 0x00008088, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88080000, 0x00008088, 0x88000000, 0x00000088, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/src/entry.asm b/src/entry.asm new file mode 100644 index 0000000..4973365 --- /dev/null +++ b/src/entry.asm @@ -0,0 +1,4 @@ +org 100h + +section .text +jump start \ No newline at end of file diff --git a/src/main.asm b/src/main.asm new file mode 100644 index 0000000..2338b5d --- /dev/null +++ b/src/main.asm @@ -0,0 +1,26 @@ +start: + ; Set video mode to 320x200 256 colors graphic mode + mov ax, 0013h + int 10h + push 0a000h + pop es + + + ;;;;;;;;;;;;;;;;;;;;;; + ;; ;; + ;; MAIN CODE HERE ;; + ;; ;; + ;;;;;;;;;;;;;;;;;;;;;; + + + ; Exit + jmp exit + + + +exit: + ; Wait for key and terminate the program + mov al,01h ; Clear buffer + mov ah,0ch ; Read key + int 21h ; Execute + int 20h ; Exit \ No newline at end of file diff --git a/src/sprites.asm b/src/sprites.asm new file mode 100644 index 0000000..63dd44f --- /dev/null +++ b/src/sprites.asm @@ -0,0 +1,105 @@ +draw_spritesheet: + mov cx, 0 + .loop: + push cx + ; Set y coord + mov ax, cx + and ax, 0xf0 + ; Set x coord + mov bx, cx + and bx, 0xf + shl bx, 4 + call calculate_screen_position + ; Set sprite + mov ax, cx + call calculate_spritesheet_position + call draw_sprite + ; Repeat + pop cx + inc cx + cmp cx, 64 + jb .loop + ret + + + + + +calculate_screen_position: + ; Set first position on screen + ; Parameters: y coord in ax, x coord in bx + ; Result in dx + ; Override: ax, bx, dx + push bx + mov bx, SCREEN_WIDTH + mul bx + pop bx + add ax, bx + mov dx, ax + ret + +calculate_spritesheet_position: + ; Set first position on spritesheet + ; Parameter: sprite ID in ax + ; Result in bx + ; Override: ax, bx + push dx + mov dx, SPRITE_SIZE * SPRITE_SIZE + mul dx + shr ax, 1 ; Because there are two pixels in a byte + mov bx, ax + pop dx + ret + +draw_sprite: + ; TODO: Dynamic sprite size (DSP) + ; bx: Base position on spritesheet + ; cx: Index on sprite + ; dx: Pos on screen + + ; Decrement as increment is at the beginning of the loop + dec dx + ; Number of pixels draw + mov cx, 0x00ff ; TODO: DSP + +.draw_loop: + inc dx + inc cl ; TODO: DSP + + ; Read the color index + push cx + shr cx, 1 ; Because there are two pixels in a byte + mov di, spritesheet + add di, bx + add di, cx + int3 ; ################################ DEBUG ################################ + mov al, [ds:di] + + ; Check if the color is in the high or low nibble + pop cx + test cl, 1 ; TODO: DSP + jnz .low_byte + shr ax, 4 +.low_byte: + and ax, 0xf ; TODO: DSP + je .transparent_skip + + ; Get color from palette + mov di, palette + add di, ax + mov al, [ds:di] + + ; Set the pixel + mov di, dx + mov [es:di], al + + ; If we need to go to the next line +.transparent_skip: + not cl + test cl, 0xf ; TODO: DSP + not cl + jne .draw_loop + add dx, SCREEN_WIDTH - SPRITE_SIZE + cmp cl, 0xff + jne .draw_loop + ret \ No newline at end of file From fa47f27cd8c5ea3ee3d39161502c2e3a2f6eaee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:02:40 +0100 Subject: [PATCH 02/60] testben azerty --- src/commit test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/commit test.txt diff --git a/src/commit test.txt b/src/commit test.txt new file mode 100644 index 0000000..e69de29 From 715c3a0261a882fca42a3a35ee72085d381a9993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:04:11 +0100 Subject: [PATCH 03/60] Delete commit test.txt --- src/commit test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/commit test.txt diff --git a/src/commit test.txt b/src/commit test.txt deleted file mode 100644 index e69de29..0000000 From b0685e0e9a200fecd62b670b1c454888c2bff9dc Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Fri, 17 Nov 2023 15:04:29 +0100 Subject: [PATCH 04/60] Linked all files between them --- src/_test_sprites.asm | 7 +++++++ src/build-pacman.cmd | 9 +++++++++ src/entry.asm | 4 +++- src/main.asm | 4 ++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/build-pacman.cmd diff --git a/src/_test_sprites.asm b/src/_test_sprites.asm index b3ade4f..7e833b4 100644 --- a/src/_test_sprites.asm +++ b/src/_test_sprites.asm @@ -1,3 +1,10 @@ +org 100h + +%include "constants.asm" +%include "sprites.asm" + +section .text + start: ; Set video mode to 320x200 256 colors graphic mode mov ax, 0013h diff --git a/src/build-pacman.cmd b/src/build-pacman.cmd new file mode 100644 index 0000000..9044b1c --- /dev/null +++ b/src/build-pacman.cmd @@ -0,0 +1,9 @@ +@echo off +set "SCRIPT_DIR=%~dp0" +set "ROOT_DIR=%SCRIPT_DIR%..\.." +set "NASM=%ROOT_DIR%\nasm\nasm" +set "BIN_DIR=%ROOT_DIR%\bin" + +"%NASM%" _test_sprites.asm -f bin -o "%BIN_DIR%\sprites.com" + +pause diff --git a/src/entry.asm b/src/entry.asm index 4973365..27501e9 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -1,4 +1,6 @@ org 100h section .text -jump start \ No newline at end of file +jmp start + +%include "main.asm" \ No newline at end of file diff --git a/src/main.asm b/src/main.asm index 2338b5d..ca3af5c 100644 --- a/src/main.asm +++ b/src/main.asm @@ -1,3 +1,7 @@ + +;%ifndef "entry.asm" +;%endif "entry.asm" + start: ; Set video mode to 320x200 256 colors graphic mode mov ax, 0013h From 890673e9a390f4f6342db4669e3ee936bf2a1817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Mon, 20 Nov 2023 15:38:21 +0100 Subject: [PATCH 05/60] trying to move the ghosts --- src/build-pacman.cmd | 9 -- src/entry.asm | 6 +- src/main.asm | 216 +++++++++++++++++++++++++++++++++++++++++-- src/sprites.asm | 1 + 4 files changed, 210 insertions(+), 22 deletions(-) delete mode 100644 src/build-pacman.cmd diff --git a/src/build-pacman.cmd b/src/build-pacman.cmd deleted file mode 100644 index 9044b1c..0000000 --- a/src/build-pacman.cmd +++ /dev/null @@ -1,9 +0,0 @@ -@echo off -set "SCRIPT_DIR=%~dp0" -set "ROOT_DIR=%SCRIPT_DIR%..\.." -set "NASM=%ROOT_DIR%\nasm\nasm" -set "BIN_DIR=%ROOT_DIR%\bin" - -"%NASM%" _test_sprites.asm -f bin -o "%BIN_DIR%\sprites.com" - -pause diff --git a/src/entry.asm b/src/entry.asm index 27501e9..17cf302 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -1,6 +1,6 @@ org 100h -section .text -jmp start +%include "constants.asm" -%include "main.asm" \ No newline at end of file +%include "main.asm" +%include "sprites.asm" \ No newline at end of file diff --git a/src/main.asm b/src/main.asm index ca3af5c..ee4e85d 100644 --- a/src/main.asm +++ b/src/main.asm @@ -1,13 +1,27 @@ + ;%ifndef "entry.asm" ;%endif "entry.asm" + +section .bss + +buffScreen resb SPRITE_SIZE*SPRITE_SIZE ; where is stored the backuped screen + +section .data + +xPos dw 0 +xVelocity dw 1 + + +section .text + start: ; Set video mode to 320x200 256 colors graphic mode mov ax, 0013h int 10h - push 0a000h - pop es + + ;;;;;;;;;;;;;;;;;;;;;; @@ -17,14 +31,196 @@ start: ;;;;;;;;;;;;;;;;;;;;;; - ; Exit - jmp exit + +;------------------------------------------------------------------ + +;THE GAME LOOP + +;------------- + + + + + mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) + call clearScreen + + gameloop: + +; backup the screen before display ghost + mov si, [xPos] ; give the position to begin to save the screen + call saveScreen ; store the state of the screen before display the ghost + +; display the selected ghost + mov ax, [xPos] + mov bx, 160 + call calculate_screen_position + push dx + mov ax, BLINKY_1 + call calculate_spritesheet_position + call draw_sprite + pop dx + + +;waiting... + call waiting + call waiting + call waiting + call waiting + call waiting + call waiting + call waiting + + +;restore the backuped screen above the ghost + call clearGhost + +;move the ghost + call changePos + +;return to the beggining of the gameloop + jmp gameloop + + + + + + +;------------------------------------------------------------------ + +;THE FUNCTIONS + +;------------- + + +;!!!PARAMETERS!!!; +;to select the color to use to fill, you need this color into 'al' +clearScreen: + + ;stosb copy byte per byte the content of al to es:di, di increasing. + ;so we set the adress of the segments and the offsets + + ;set the destination 'es:di' : + + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + + mov di, 0 ; begin the offset (pixel position) at 0 + + mov cx, 200*320 ; how many times 'rep' action will be repeated + rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 + +ret ; go back in the game loop + + +;!!!PARAMETERS!!!; +;input the position of the ghost which will be displayed, into 'si' +saveScreen: + + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + + ;set the destinatin 'es:di'. Here , the begginning of the screen backup in [bufferScreen] + push ds ; ds is the data segment where is [bufferScreen] + pop es ; put it as the destination segment of movsb + lea di, [buffScreen] ; load the effective adress (L.E.A.) of the backup in the destination offset + + ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) + push 0xA000 ; video memory adress = 0xA000 + pop ds ; define it as the adress of the source segment + ;'si' had been set up before + + ;mov, byte per byte the content into buffscreen + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues + + ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning + push es + pop ds + +ret ; go back in the game loop + + +;!!!PARAMETERS!!!; +;to select the ghost to print, you need to put the sprite address in 'si' (using 'lea si, blinky') +displayGhost: + + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + + ;set the destinatin 'es:di'. Here , the screen at the xPos position + mov di, [xPos] ; the offset destination is xPos + ;the destination 'es' is already at its right value : the data segment 0x489D + + ;select the source 'ds:si' of the movsb function + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + ;'si' had been set up before + + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues + +ret ; go back in the game loop + + +clearGhost: + + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + + ;set the source 'ds:si' of the movsb function + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, [xPos] ; define the offset destination as the same xPos, where was displayed the ghost + + ;set the source 'ds:si' as the backup of the screen + ;ds is already set as 0x489D where is the backup at [buffScreen] + lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset + + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues + +ret ; go back in the game loop + + +waiting: + push cx + mov cx, 0x0FFF ; how many times we repeat the loop + waitloop: + loop waitloop ; we jump FFFF times, so , many times, to make a delay in the program + pop cx + +ret ; go back in the game loop + +changePos: +;switch the direction if the ghost reached a side of the screen + cmp word [xPos], SCREEN_WIDTH - SPRITE_SIZE + jb .noflip + neg word [xVelocity] + .noflip: -exit: - ; Wait for key and terminate the program - mov al,01h ; Clear buffer - mov ah,0ch ; Read key - int 21h ; Execute - int 20h ; Exit \ No newline at end of file +;inc/decremente the position + mov bx, [xPos] + add bx, [xVelocity] + mov [xPos], bx +ret \ No newline at end of file diff --git a/src/sprites.asm b/src/sprites.asm index 63dd44f..43f84a8 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -1,3 +1,4 @@ + draw_spritesheet: mov cx, 0 .loop: From faa2d29520d1fdb938ec5fcc4b0ea3a35001562c Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Mon, 20 Nov 2023 15:50:27 +0100 Subject: [PATCH 06/60] clock set up --- src/_test_sprites.asm | 229 +++++++++++++++++++++++++++++++++++------- src/build-pacman.cmd | 2 - 2 files changed, 194 insertions(+), 37 deletions(-) diff --git a/src/_test_sprites.asm b/src/_test_sprites.asm index 7e833b4..6dd34c7 100644 --- a/src/_test_sprites.asm +++ b/src/_test_sprites.asm @@ -1,41 +1,200 @@ +;print a sprite 8 x 8 bytes on the screen + org 100h -%include "constants.asm" -%include "sprites.asm" +section .data + +xPos dw 0 + +xVelocity dw 1 + +sprite db 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00 + db 0x00, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00 + db 0x28, 0x28, 0x0F, 0x0F, 0x28, 0x0F, 0x0F, 0x28 + db 0x28, 0x28, 0x2C, 0x21, 0x28, 0x0F, 0x21, 0x28 + db 0x28, 0x28, 0x0F, 0x0F, 0x28, 0x0F, 0x0F, 0x28 + db 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28 + db 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28 + db 0x00, 0x28, 0x28, 0x00, 0x28, 0x28, 0x00, 0x28 + +sprite2 db 0x00, 0x00, 0x34, 0x34, 0x34, 0x34, 0x00, 0x00 + db 0x00, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x00 + db 0x34, 0x34, 0x0F, 0x0F, 0x34, 0x0F, 0x0F, 0x34 + db 0x34, 0x34, 0x0F, 0x21, 0x34, 0x0F, 0x21, 0x34 + db 0x34, 0x34, 0x0F, 0x0F, 0x34, 0x0F, 0x0F, 0x34 + db 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 + db 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 + db 0x00, 0x34, 0x34, 0x00, 0x34, 0x34, 0x00, 0x34 + +sprite3 db 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00 + db 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00 + db 0x42, 0x42, 0x0F, 0x0F, 0x42, 0x0F, 0x0F, 0x42 + db 0x42, 0x42, 0x0F, 0x21, 0x42, 0x0F, 0x21, 0x42 + db 0x42, 0x42, 0x0F, 0x0F, 0x42, 0x0F, 0x0F, 0x42 + db 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42 + db 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42 + db 0x00, 0x42, 0x42, 0x00, 0x42, 0x42, 0x00, 0x42 + +sprite4 db 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x00, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00 + db 0x54, 0x54, 0x0F, 0x0F, 0x54, 0x0F, 0x0F, 0x54 + db 0x54, 0x54, 0x0F, 0x21, 0x54, 0x0F, 0x21, 0x54 + db 0x54, 0x54, 0x0F, 0x0F, 0x54, 0x0F, 0x0F, 0x54 + db 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54 + db 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54 + db 0x00, 0x54, 0x54, 0x00, 0x54, 0x54, 0x00, 0x54 + +maze db 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x00, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x54, 0x54, 0x0F, 0x0F, 0x54, 0x0F, 0x0F, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x54, 0x54, 0x0F, 0x21, 0x54, 0x0F, 0x21, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x54, 0x54, 0x0F, 0x0F, 0x54, 0x0F, 0x0F, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x00, 0x54, 0x54, 0x00, 0x54, 0x54, 0x00, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x00, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x54, 0x54, 0x0F, 0x0F, 0x54, 0x0F, 0x0F, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x54, 0x54, 0x0F, 0x21, 0x54, 0x0F, 0x21, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x54, 0x54, 0x0F, 0x0F, 0x54, 0x0F, 0x0F, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 + db 0x00, 0x54, 0x54, 0x00, 0x54, 0x54, 0x00, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 +base: equ 0xf9fe +old_time: equ base+0x06 +;[0, 40, 65, 84, 0, 52, 78, 66, 0, 44, 0, 33, 48, 3, 88, 15] section .text -start: - ; Set video mode to 320x200 256 colors graphic mode - mov ax, 0013h +mov ax, 0013h ; Set Video Mode 4F02h (VBE mode 101h) - 640x480, 256 colors +;mov bx, 101h ; VBE mode 101h +int 10h + +GameLoop: + +mov al, 0FFh +;call printMaze +mov di, [xPos] +mov si, sprite +call changeColor +call printGhost +mov bx, [xPos] +add bx, [xVelocity] +mov word [xPos], bx + +mov ah, 00h +int 1ah ; BIOS clock read +cmp dx, [old_time] ; Wait for change +je GameLoop ; Loop +mov [old_time], dx + +call clearScreen + +cmp word [xPos], 320-8 +je ChangeVelocity +cmp word [xPos], 0 +je ChangeVelocity +jmp GameLoop + + +; mov di, 12 +; mov si, sprite2 +; call printGhost + +; mov di, 24 +; mov si, sprite3 +; call printGhost + +; mov di, 36 +; mov si, sprite4 +; call printGhost + + +;reset the keyboard buffer and then wait for a keypress : + +Exit: +mov ax, 0C01h ; +int 21h + +;dos box default video mode +mov ax, 03h +int 21h + +int 20h ;quit + + + + + +the_functions: + +; need to set the color of filling in al +clearScreen: +mov ax, 0xA000 +mov es, ax +mov di, 0 +mov cx, 320*200 +rep stosb +ret + +printMaze: +mov ax, 0xA000 +mov es, ax +mov di, 48 +mov si, maze +mov dx, 16 +loopy5: + mov cx, 16 + rep movsb + add di, 640-16 + dec dx + jnz loopy5 +ret + +printGhost: +mov ax, 0xA000 +mov es, ax +mov dx, 8 +loopyy: + mov cx, 8 + rep movsb + add di, 320-8 + dec dx + jnz loopyy +ret + +ChangeVelocity: +neg word [xVelocity] +jmp GameLoop + +changeColor: +cmp word [xVelocity], 0 +jg continue +mov si, sprite2 +continue: +ret + +; ----------------------------------------------- +; Load palette. +; bx = start of DAC registers (=start color) +; cx = number of DAC registers (=number of color) +; es:dx = source buffer +gfxLoadPalette: + mov ax, 1012h ; ah=10h -> set color / al=12h -> selects block of DAC register subfn. int 10h - push 0a000h - pop es - - ; TEMP: Draw all the sprites - call draw_spritesheet - - ; TEMP: Randomly add a ghost with eyes - mov ax, 80 - mov bx, 160 - call calculate_screen_position - push dx - mov ax, BLINKY_1 - call calculate_spritesheet_position - call draw_sprite - pop dx - mov ax, EYES_RIGHT - call calculate_spritesheet_position - call draw_sprite - - ; Exit - jmp exit - - - -exit: - ; Wait for key and terminate the program - mov al,01h ; Clear buffer - mov ah,0ch ; Read key - int 21h ; Execute - int 20h ; Exit \ No newline at end of file + ret + +; ----------------------------------------------- +; Wait for vertical sync. +; scraps ax and dx +gfxWaitForVSync: + mov dx, 0x3DA +.loop1: + in al, dx + test al, 8 + jnz .loop1 +.loop2: + in al, dx + test al, 8 + jz .loop2 + ret \ No newline at end of file diff --git a/src/build-pacman.cmd b/src/build-pacman.cmd index 9044b1c..509f017 100644 --- a/src/build-pacman.cmd +++ b/src/build-pacman.cmd @@ -5,5 +5,3 @@ set "NASM=%ROOT_DIR%\nasm\nasm" set "BIN_DIR=%ROOT_DIR%\bin" "%NASM%" _test_sprites.asm -f bin -o "%BIN_DIR%\sprites.com" - -pause From 7307a873a89a231afeed416ba15698dbfe9e9161 Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Mon, 20 Nov 2023 16:13:03 +0100 Subject: [PATCH 07/60] Fix the clock --- src/_test_sprites.asm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/_test_sprites.asm b/src/_test_sprites.asm index 6dd34c7..f4ec6d6 100644 --- a/src/_test_sprites.asm +++ b/src/_test_sprites.asm @@ -72,6 +72,14 @@ int 10h GameLoop: +mov ah, 00h +int 1ah ; BIOS clock read +cmp dx, [old_time] ; Wait for change +je GameLoop ; Loop +mov [old_time], dx + +call clearScreen + mov al, 0FFh ;call printMaze mov di, [xPos] @@ -82,13 +90,7 @@ mov bx, [xPos] add bx, [xVelocity] mov word [xPos], bx -mov ah, 00h -int 1ah ; BIOS clock read -cmp dx, [old_time] ; Wait for change -je GameLoop ; Loop -mov [old_time], dx -call clearScreen cmp word [xPos], 320-8 je ChangeVelocity From fc3d3ae1243745b92e53a6e51129a3bbeb685125 Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Mon, 20 Nov 2023 17:01:58 +0100 Subject: [PATCH 08/60] clock 2 --- src/build-pacman.cmd | 2 +- src/moving_ghost.asm | 194 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 src/moving_ghost.asm diff --git a/src/build-pacman.cmd b/src/build-pacman.cmd index 509f017..0c275a2 100644 --- a/src/build-pacman.cmd +++ b/src/build-pacman.cmd @@ -4,4 +4,4 @@ set "ROOT_DIR=%SCRIPT_DIR%..\.." set "NASM=%ROOT_DIR%\nasm\nasm" set "BIN_DIR=%ROOT_DIR%\bin" -"%NASM%" _test_sprites.asm -f bin -o "%BIN_DIR%\sprites.com" +"%NASM%" moving_ghost.asm -f bin -o "%BIN_DIR%\sprites.com" diff --git a/src/moving_ghost.asm b/src/moving_ghost.asm new file mode 100644 index 0000000..465d4d5 --- /dev/null +++ b/src/moving_ghost.asm @@ -0,0 +1,194 @@ +org 100h + +%define SPRITEW 16 +%define SCREEN_WIDTH 320 +section .bss +buffScreen resb SPRITEW*SPRITEW ; where is stored the backuped screen +section .data +xPos dw 0 +xVelocity dw 1 +base: equ 0xf9fe +old_time: equ base+0x06 +; draw the radioactive ghost +blinky db 0xFF, 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF, 0xFF + db 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF + db 0x0A, 0x0A, 0x0f, 0x00, 0x0A, 0x0f, 0x00, 0x0A + db 0x0A, 0x0A, 0x0f, 0x0f, 0x0A, 0x0f, 0x0f, 0x0A + db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A + db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A + db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A + db 0x0A, 0xFF, 0x0A, 0x0A, 0xFF, 0x0A, 0x0A, 0x0A + + db 0xFF, 0xFF, 0x0A, 0x0A, 0x0A, 0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x0A, 0x0A, 0x0A + db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A + db 0x0A, 0xFF, 0x0A, 0x0A, 0xFF, 0x0A, 0x0A, 0x0A + +section .text +;set the video mode + mov ah, 00h ; set video mode requirement + mov al, 13h ; set video mode option to 320 x 200 256 colors + int 10h ; call the dos interupt regarding to ax +;clear the screen + mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) + call clearScreen +;------------------------------------------------------------------ +;THE GAME LOOP +;------------- + +; backup the screen before display ghost + mov si, [xPos] ; give the position to begin to save the screen + call saveScreen ; store the state of the screen before display the ghost +; display the selected ghost + lea si, blinky ; selecting the sprite + call displayGhost + pusha + +gameloop: +; ;waiting... +; call waiting + mov ax, 0000h + int 1ah ; BIOS clock read + cmp dx, [old_time] ; Wait for change + je gameloop ; Loop + mov [old_time], dx + + popa + +;restore the backuped screen above the ghost + call clearGhost +;move the ghost + call changePos + +; backup the screen before display ghost + mov si, [xPos] ; give the position to begin to save the screen + call saveScreen ; store the state of the screen before display the ghost +; display the selected ghost + lea si, blinky ; selecting the sprite + call displayGhost + pusha +;return to the beggining of the gameloop + jmp gameloop +;------------------------------------------------------------------ +;THE FUNCTIONS +;------------- +;!!!PARAMETERS!!!; +;to select the color to use to fill, you need this color into 'al' +clearScreen: + + ;stosb copy byte per byte the content of al to es:di, di increasing. + ;so we set the adress of the segments and the offsets + ;set the destination 'es:di' : + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, 0 ; begin the offset (pixel position) at 0 + mov cx, 200*320 ; how many times 'rep' action will be repeated + rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 +ret ; go back in the game loop +;!!!PARAMETERS!!!; +;input the position of the ghost which will be displayed, into 'si' +saveScreen: + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + ;set the destinatin 'es:di'. Here , the begginning of the screen backup in [bufferScreen] + push ds ; ds is the data segment where is [bufferScreen] + pop es ; put it as the destination segment of movsb + lea di, [buffScreen] ; load the effective adress (L.E.A.) of the backup in the destination offset + ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) + push 0xA000 ; video memory adress = 0xA000 + pop ds ; define it as the adress of the source segment + ;'si' had been set up before + + ;mov, byte per byte the content into buffscreen + mov dx, SPRITEW ; set the counter for 8 lines per sprite + .eachLine: + mov cx, SPRITEW ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues + + ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning + push es + pop ds + +ret ; go back in the game loop +;!!!PARAMETERS!!!; +;to select the ghost to print, you need to put the sprite address in 'si' (using 'lea si, blinky') +displayGhost: + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + ;set the destinatin 'es:di'. Here , the screen at the xPos position + mov di, [xPos] ; the offset destination is xPos + ;the destination 'es' is already at its right value : the data segment 0x489D + ;select the source 'ds:si' of the movsb function + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + ;'si' had been set up before + + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITEW ; set the counter for 8 lines per sprite + + .eachLine: + mov cx, SPRITEW ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + add di, SCREEN_WIDTH - SPRITEW ; increment the position register to the next line + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues +ret ; go back in the game loop +clearGhost: + + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + ;set the source 'ds:si' of the movsb function + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, [xPos] ; define the offset destination as the same xPos, where was displayed the ghost + ;set the source 'ds:si' as the backup of the screen + ;ds is already set as 0x489D where is the backup at [buffScreen] + lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITEW ; set the counter for 8 lines per sprite + .eachLine: + mov cx, SPRITEW ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + add di, SCREEN_WIDTH - SPRITEW ; increment the position register to the next line + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues +ret ; go back in the game loop +waiting: + mov cx, 0xFFFF ; how many times we repeat the loop + waitloop: + loop waitloop ; we jump FFFF times, so , many times, to make a delay in the program +ret ; go back in the game loop +changePos: +;switch the direction if the ghost reached a side of the screen + cmp word [xPos], SCREEN_WIDTH - SPRITEW + jb .noflip + neg word [xVelocity] + .noflip: +;inc/decremente the position + mov bx, [xPos] + add bx, [xVelocity] + mov [xPos], bx +ret \ No newline at end of file From 45ede5594002fae2245fabe28ae2a1e5c39eca6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Mon, 20 Nov 2023 17:06:43 +0100 Subject: [PATCH 09/60] continue to try it is needed to fix that the pac-man is not erased, but it have to be erased from a pellet-dynamic background buffer --- src/main.asm | 30 +++++++++++++++++++----------- src/sprites.asm | 1 + 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/main.asm b/src/main.asm index ee4e85d..190bf11 100644 --- a/src/main.asm +++ b/src/main.asm @@ -20,6 +20,7 @@ start: ; Set video mode to 320x200 256 colors graphic mode mov ax, 0013h int 10h + @@ -40,22 +41,24 @@ start: - + mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) call clearScreen gameloop: - + push 0xA000 + pop es ; backup the screen before display ghost mov si, [xPos] ; give the position to begin to save the screen call saveScreen ; store the state of the screen before display the ghost ; display the selected ghost - mov ax, [xPos] - mov bx, 160 + + mov ax, 80 + mov bx, [xPos] call calculate_screen_position push dx - mov ax, BLINKY_1 + mov ax, PACMAN_FULL call calculate_spritesheet_position call draw_sprite pop dx @@ -63,12 +66,6 @@ start: ;waiting... call waiting - call waiting - call waiting - call waiting - call waiting - call waiting - call waiting ;restore the backuped screen above the ghost @@ -82,6 +79,15 @@ start: +mov ax, 0C01h ; +int 21h + +;dos box default video mode +mov ax, 03h +int 21h + +int 20h ;quit + @@ -141,6 +147,8 @@ saveScreen: ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning push es pop ds + push 0xA000 + pop es ret ; go back in the game loop diff --git a/src/sprites.asm b/src/sprites.asm index 43f84a8..ffb1a27 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -92,6 +92,7 @@ draw_sprite: ; Set the pixel mov di, dx + mov [es:di], al ; If we need to go to the next line From 68121024581b8de16843d1141084b0a92d3295e3 Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Tue, 21 Nov 2023 15:37:29 +0100 Subject: [PATCH 10/60] New architecture --- src/Collider.asm | 0 src/Initialization.asm | 11 ++ src/Keyboard.asm | 6 + src/MoveSprites.asm | 90 ++++++++++++++ src/Scoring.asm | 0 src/_test_sprites.asm | 259 ++++++++++------------------------------- src/build-pacman.cmd | 2 +- src/entry.asm | 9 +- src/main.asm | 65 +++++++---- src/moving_ghost.asm | 194 ------------------------------ 10 files changed, 223 insertions(+), 413 deletions(-) create mode 100644 src/Collider.asm create mode 100644 src/Initialization.asm create mode 100644 src/Keyboard.asm create mode 100644 src/MoveSprites.asm create mode 100644 src/Scoring.asm delete mode 100644 src/moving_ghost.asm diff --git a/src/Collider.asm b/src/Collider.asm new file mode 100644 index 0000000..e69de29 diff --git a/src/Initialization.asm b/src/Initialization.asm new file mode 100644 index 0000000..235b2cc --- /dev/null +++ b/src/Initialization.asm @@ -0,0 +1,11 @@ +SetVideoMode: +;set the video mode + mov ah, 00h ; set video mode requirement + mov al, 13h ; set video mode option to 320 x 200 256 colors + int 10h ; call the dos interupt regarding to ax + push 0a000h + pop es +SetScreen: +;clear the screen + mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) + call clearScreen \ No newline at end of file diff --git a/src/Keyboard.asm b/src/Keyboard.asm new file mode 100644 index 0000000..db16ef3 --- /dev/null +++ b/src/Keyboard.asm @@ -0,0 +1,6 @@ +exit: + ; Wait for key and terminate the program + mov al,01h ; Clear buffer + mov ah,0ch ; Read key + int 21h ; Execute + int 20h ; Exit \ No newline at end of file diff --git a/src/MoveSprites.asm b/src/MoveSprites.asm new file mode 100644 index 0000000..e59adc7 --- /dev/null +++ b/src/MoveSprites.asm @@ -0,0 +1,90 @@ +clearScreen: + + ;stosb copy byte per byte the content of al to es:di, di increasing. + ;so we set the adress of the segments and the offsets + ;set the destination 'es:di' : + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, 0 ; begin the offset (pixel position) at 0 + mov cx, 200*320 ; how many times 'rep' action will be repeated + rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 +ret ; go back in the game loop +;!!!PARAMETERS!!!; +;input the position of the ghost which will be displayed, into 'si' +saveScreen: + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + ;set the destinatin 'es:di'. Here , the begginning of the screen backup in [bufferScreen] + push ds ; ds is the data segment where is [bufferScreen] + pop es ; put it as the destination segment of movsb + lea di, [buffScreen] ; load the effective adress (L.E.A.) of the backup in the destination offset + ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) + push 0xA000 ; video memory adress = 0xA000 + pop ds ; define it as the adress of the source segment + ;'si' had been set up before + + ;mov, byte per byte the content into buffscreen + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues + + ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning + push es + pop ds + +ret ; go back in the game loop +displayGhost: + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + ;set the destinatin 'es:di'. Here , the screen at the xPos position + mov di, [xPos] ; the offset destination is xPos + ;the destination 'es' is already at its right value : the data segment 0x489D + ;select the source 'ds:si' of the movsb function + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + ;'si' had been set up before + + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues +ret ; go back in the game loop +clearGhost: + + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + ;set the source 'ds:si' of the movsb function + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, [xPos] ; define the offset destination as the same xPos, where was displayed the ghost + ;set the source 'ds:si' as the backup of the screen + ;ds is already set as 0x489D where is the backup at [buffScreen] + lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues +ret ; go back in the game loop +changePos: +;switch the direction if the ghost reached a side of the screen + cmp word [xPos], SCREEN_WIDTH - SPRITE_SIZE + jb .noflip + neg word [xVelocity] + .noflip: +;inc/decremente the position + mov bx, [xPos] + add bx, [xVelocity] + mov [xPos], bx +ret \ No newline at end of file diff --git a/src/Scoring.asm b/src/Scoring.asm new file mode 100644 index 0000000..e69de29 diff --git a/src/_test_sprites.asm b/src/_test_sprites.asm index f4ec6d6..7f4daf2 100644 --- a/src/_test_sprites.asm +++ b/src/_test_sprites.asm @@ -1,202 +1,69 @@ -;print a sprite 8 x 8 bytes on the screen - -org 100h - +; org 100h + +; %define SPRITE_SIZE 16 +; %define SCREEN_WIDTH 320 +section .bss +buffScreen resb SPRITE_SIZE*SPRITE_SIZE ; where is stored the backuped screen section .data - -xPos dw 0 - +xPos dw 0 xVelocity dw 1 - -sprite db 0x00, 0x00, 0x28, 0x28, 0x28, 0x28, 0x00, 0x00 - db 0x00, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x00 - db 0x28, 0x28, 0x0F, 0x0F, 0x28, 0x0F, 0x0F, 0x28 - db 0x28, 0x28, 0x2C, 0x21, 0x28, 0x0F, 0x21, 0x28 - db 0x28, 0x28, 0x0F, 0x0F, 0x28, 0x0F, 0x0F, 0x28 - db 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28 - db 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28 - db 0x00, 0x28, 0x28, 0x00, 0x28, 0x28, 0x00, 0x28 - -sprite2 db 0x00, 0x00, 0x34, 0x34, 0x34, 0x34, 0x00, 0x00 - db 0x00, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x00 - db 0x34, 0x34, 0x0F, 0x0F, 0x34, 0x0F, 0x0F, 0x34 - db 0x34, 0x34, 0x0F, 0x21, 0x34, 0x0F, 0x21, 0x34 - db 0x34, 0x34, 0x0F, 0x0F, 0x34, 0x0F, 0x0F, 0x34 - db 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 - db 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 - db 0x00, 0x34, 0x34, 0x00, 0x34, 0x34, 0x00, 0x34 - -sprite3 db 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x00, 0x00 - db 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x00 - db 0x42, 0x42, 0x0F, 0x0F, 0x42, 0x0F, 0x0F, 0x42 - db 0x42, 0x42, 0x0F, 0x21, 0x42, 0x0F, 0x21, 0x42 - db 0x42, 0x42, 0x0F, 0x0F, 0x42, 0x0F, 0x0F, 0x42 - db 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42 - db 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42 - db 0x00, 0x42, 0x42, 0x00, 0x42, 0x42, 0x00, 0x42 - -sprite4 db 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x00, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00 - db 0x54, 0x54, 0x0F, 0x0F, 0x54, 0x0F, 0x0F, 0x54 - db 0x54, 0x54, 0x0F, 0x21, 0x54, 0x0F, 0x21, 0x54 - db 0x54, 0x54, 0x0F, 0x0F, 0x54, 0x0F, 0x0F, 0x54 - db 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54 - db 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54 - db 0x00, 0x54, 0x54, 0x00, 0x54, 0x54, 0x00, 0x54 - -maze db 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x00, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x54, 0x54, 0x0F, 0x0F, 0x54, 0x0F, 0x0F, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x54, 0x54, 0x0F, 0x21, 0x54, 0x0F, 0x21, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x54, 0x54, 0x0F, 0x0F, 0x54, 0x0F, 0x0F, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x00, 0x54, 0x54, 0x00, 0x54, 0x54, 0x00, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x00, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x54, 0x54, 0x0F, 0x0F, 0x54, 0x0F, 0x0F, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x54, 0x54, 0x0F, 0x21, 0x54, 0x0F, 0x21, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x54, 0x54, 0x0F, 0x0F, 0x54, 0x0F, 0x0F, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 - db 0x00, 0x54, 0x54, 0x00, 0x54, 0x54, 0x00, 0x54, 0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00 base: equ 0xf9fe old_time: equ base+0x06 -;[0, 40, 65, 84, 0, 52, 78, 66, 0, 44, 0, 33, 48, 3, 88, 15] - +; draw the radioactive ghost +; blinky db 0xFF, 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF, 0xFF +; db 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF +; db 0x0A, 0x0A, 0x0f, 0x00, 0x0A, 0x0f, 0x00, 0x0A +; db 0x0A, 0x0A, 0x0f, 0x0f, 0x0A, 0x0f, 0x0f, 0x0A +; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A +; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A +; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A +; db 0x0A, 0xFF, 0x0A, 0x0A, 0xFF, 0x0A, 0x0A, 0x0A + +; db 0xFF, 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF, 0xFF +; db 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF +; db 0x0A, 0x0A, 0x0f, 0x00, 0x0A, 0x0f, 0x00, 0x0A +; db 0x0A, 0x0A, 0x0f, 0x0f, 0x0A, 0x0f, 0x0f, 0x0A +; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A +; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A +; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A +; db 0x0A, 0xFF, 0x0A, 0x0A, 0xFF, 0x0A, 0x0A, 0x0A + +; db 0xFF, 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF, 0xFF +; db 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF +; db 0x0A, 0x0A, 0x0f, 0x00, 0x0A, 0x0f, 0x00, 0x0A +; db 0x0A, 0x0A, 0x0f, 0x0f, 0x0A, 0x0f, 0x0f, 0x0A +; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A +; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A +; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A +; db 0x0A, 0xFF, 0x0A, 0x0A, 0xFF, 0x0A, 0x0A, 0x0A +; db 0xFF, 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF, 0xFF +; db 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF +; db 0x0A, 0x0A, 0x0f, 0x00, 0x0A, 0x0f, 0x00, 0x0A +; db 0x0A, 0x0A, 0x0f, 0x0f, 0x0A, 0x0f, 0x0f, 0x0A +; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A +; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A +; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A +; db 0x0A, 0xFF, 0x0A, 0x0A, 0xFF, 0x0A, 0x0A, 0x0A + section .text -mov ax, 0013h ; Set Video Mode 4F02h (VBE mode 101h) - 640x480, 256 colors -;mov bx, 101h ; VBE mode 101h -int 10h - -GameLoop: - -mov ah, 00h -int 1ah ; BIOS clock read -cmp dx, [old_time] ; Wait for change -je GameLoop ; Loop -mov [old_time], dx - -call clearScreen - -mov al, 0FFh -;call printMaze -mov di, [xPos] -mov si, sprite -call changeColor -call printGhost -mov bx, [xPos] -add bx, [xVelocity] -mov word [xPos], bx - - - -cmp word [xPos], 320-8 -je ChangeVelocity -cmp word [xPos], 0 -je ChangeVelocity -jmp GameLoop - - -; mov di, 12 -; mov si, sprite2 -; call printGhost - -; mov di, 24 -; mov si, sprite3 -; call printGhost - -; mov di, 36 -; mov si, sprite4 -; call printGhost - - -;reset the keyboard buffer and then wait for a keypress : - -Exit: -mov ax, 0C01h ; -int 21h - -;dos box default video mode -mov ax, 03h -int 21h - -int 20h ;quit - - - - - -the_functions: - -; need to set the color of filling in al -clearScreen: -mov ax, 0xA000 -mov es, ax -mov di, 0 -mov cx, 320*200 -rep stosb -ret - -printMaze: -mov ax, 0xA000 -mov es, ax -mov di, 48 -mov si, maze -mov dx, 16 -loopy5: - mov cx, 16 - rep movsb - add di, 640-16 - dec dx - jnz loopy5 -ret - -printGhost: -mov ax, 0xA000 -mov es, ax -mov dx, 8 -loopyy: - mov cx, 8 - rep movsb - add di, 320-8 - dec dx - jnz loopyy -ret - -ChangeVelocity: -neg word [xVelocity] -jmp GameLoop - -changeColor: -cmp word [xVelocity], 0 -jg continue -mov si, sprite2 -continue: -ret - -; ----------------------------------------------- -; Load palette. -; bx = start of DAC registers (=start color) -; cx = number of DAC registers (=number of color) -; es:dx = source buffer -gfxLoadPalette: - mov ax, 1012h ; ah=10h -> set color / al=12h -> selects block of DAC register subfn. - int 10h - ret - -; ----------------------------------------------- -; Wait for vertical sync. -; scraps ax and dx -gfxWaitForVSync: - mov dx, 0x3DA -.loop1: - in al, dx - test al, 8 - jnz .loop1 -.loop2: - in al, dx - test al, 8 - jz .loop2 - ret \ No newline at end of file +;------------------------------------------------------------------ +;THE GAME LOOP +;------------- + +; backup the screen before display ghost + +;------------------------------------------------------------------ +;THE FUNCTIONS +;------------- +;!!!PARAMETERS!!!; +;to select the color to use to fill, you need this color into 'al' + +;!!!PARAMETERS!!!; +;to select the ghost to print, you need to put the sprite address in 'si' (using 'lea si, blinky') + +; waiting: +; mov cx, 0xFFFF ; how many times we repeat the loop +; waitloop: +; loop waitloop ; we jump FFFF times, so , many times, to make a delay in the program +; ret ; go back in the game loop diff --git a/src/build-pacman.cmd b/src/build-pacman.cmd index 0c275a2..52e90f6 100644 --- a/src/build-pacman.cmd +++ b/src/build-pacman.cmd @@ -4,4 +4,4 @@ set "ROOT_DIR=%SCRIPT_DIR%..\.." set "NASM=%ROOT_DIR%\nasm\nasm" set "BIN_DIR=%ROOT_DIR%\bin" -"%NASM%" moving_ghost.asm -f bin -o "%BIN_DIR%\sprites.com" +"%NASM%" Entry.asm -f bin -o "%BIN_DIR%\sprites.com" diff --git a/src/entry.asm b/src/entry.asm index 27501e9..a8d79bf 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -3,4 +3,11 @@ org 100h section .text jmp start -%include "main.asm" \ No newline at end of file +%include "Constants.asm" +%include "Sprites.asm" +%include "Main.asm" +%include "Initialization.asm" +%include "Keyboard.asm" +%include "Collider.asm" +%include "MoveSprites.asm" +%include "Scoring.asm" \ No newline at end of file diff --git a/src/main.asm b/src/main.asm index ca3af5c..84dd931 100644 --- a/src/main.asm +++ b/src/main.asm @@ -1,30 +1,53 @@ +section .bss + buffScreen resb SPRITE_SIZE*SPRITE_SIZE ; where is stored the backuped screen -;%ifndef "entry.asm" -;%endif "entry.asm" +section .data + xPos dw 0 + xVelocity dw 1 + base: equ 0xf9fe + old_time: equ base+0x06 +section .text start: - ; Set video mode to 320x200 256 colors graphic mode - mov ax, 0013h - int 10h - push 0a000h - pop es - - - ;;;;;;;;;;;;;;;;;;;;;; - ;; ;; - ;; MAIN CODE HERE ;; - ;; ;; - ;;;;;;;;;;;;;;;;;;;;;; - + + call SetVideoMode + call SetScreen + + mov si, [xPos] ; give the position to begin to save the screen + call saveScreen ; store the state of the screen before display the ghost +; display the selected ghost + lea si, BLINKY_1 ; selecting the sprite + call displayGhost + pusha + +gameloop: +; ;waiting... +; call waiting + mov ax, 0000h + int 1ah ; BIOS clock read + cmp dx, [old_time] ; Wait for change + je gameloop ; Loop + mov [old_time], dx + + popa + +;restore the backuped screen above the ghost + call clearGhost +;move the ghost + call changePos + +; backup the screen before display ghost + mov si, [xPos] ; give the position to begin to save the screen + call saveScreen ; store the state of the screen before display the ghost +; display the selected ghost + lea si, BLINKY_1 ; selecting the sprite + call displayGhost + pusha +;return to the beggining of the gameloop + jmp gameloop ; Exit jmp exit -exit: - ; Wait for key and terminate the program - mov al,01h ; Clear buffer - mov ah,0ch ; Read key - int 21h ; Execute - int 20h ; Exit \ No newline at end of file diff --git a/src/moving_ghost.asm b/src/moving_ghost.asm deleted file mode 100644 index 465d4d5..0000000 --- a/src/moving_ghost.asm +++ /dev/null @@ -1,194 +0,0 @@ -org 100h - -%define SPRITEW 16 -%define SCREEN_WIDTH 320 -section .bss -buffScreen resb SPRITEW*SPRITEW ; where is stored the backuped screen -section .data -xPos dw 0 -xVelocity dw 1 -base: equ 0xf9fe -old_time: equ base+0x06 -; draw the radioactive ghost -blinky db 0xFF, 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF, 0xFF - db 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF - db 0x0A, 0x0A, 0x0f, 0x00, 0x0A, 0x0f, 0x00, 0x0A - db 0x0A, 0x0A, 0x0f, 0x0f, 0x0A, 0x0f, 0x0f, 0x0A - db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A - db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A - db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A - db 0x0A, 0xFF, 0x0A, 0x0A, 0xFF, 0x0A, 0x0A, 0x0A - - db 0xFF, 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF, 0xFF - db 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF - db 0x0A, 0x0A, 0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x0A, 0x0A, 0xFF, 0x0A, 0x0A, 0x0A - -section .text -;set the video mode - mov ah, 00h ; set video mode requirement - mov al, 13h ; set video mode option to 320 x 200 256 colors - int 10h ; call the dos interupt regarding to ax -;clear the screen - mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) - call clearScreen -;------------------------------------------------------------------ -;THE GAME LOOP -;------------- - -; backup the screen before display ghost - mov si, [xPos] ; give the position to begin to save the screen - call saveScreen ; store the state of the screen before display the ghost -; display the selected ghost - lea si, blinky ; selecting the sprite - call displayGhost - pusha - -gameloop: -; ;waiting... -; call waiting - mov ax, 0000h - int 1ah ; BIOS clock read - cmp dx, [old_time] ; Wait for change - je gameloop ; Loop - mov [old_time], dx - - popa - -;restore the backuped screen above the ghost - call clearGhost -;move the ghost - call changePos - -; backup the screen before display ghost - mov si, [xPos] ; give the position to begin to save the screen - call saveScreen ; store the state of the screen before display the ghost -; display the selected ghost - lea si, blinky ; selecting the sprite - call displayGhost - pusha -;return to the beggining of the gameloop - jmp gameloop -;------------------------------------------------------------------ -;THE FUNCTIONS -;------------- -;!!!PARAMETERS!!!; -;to select the color to use to fill, you need this color into 'al' -clearScreen: - - ;stosb copy byte per byte the content of al to es:di, di increasing. - ;so we set the adress of the segments and the offsets - ;set the destination 'es:di' : - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - mov di, 0 ; begin the offset (pixel position) at 0 - mov cx, 200*320 ; how many times 'rep' action will be repeated - rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 -ret ; go back in the game loop -;!!!PARAMETERS!!!; -;input the position of the ghost which will be displayed, into 'si' -saveScreen: - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - ;set the destinatin 'es:di'. Here , the begginning of the screen backup in [bufferScreen] - push ds ; ds is the data segment where is [bufferScreen] - pop es ; put it as the destination segment of movsb - lea di, [buffScreen] ; load the effective adress (L.E.A.) of the backup in the destination offset - ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) - push 0xA000 ; video memory adress = 0xA000 - pop ds ; define it as the adress of the source segment - ;'si' had been set up before - - ;mov, byte per byte the content into buffscreen - mov dx, SPRITEW ; set the counter for 8 lines per sprite - .eachLine: - mov cx, SPRITEW ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues - - ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning - push es - pop ds - -ret ; go back in the game loop -;!!!PARAMETERS!!!; -;to select the ghost to print, you need to put the sprite address in 'si' (using 'lea si, blinky') -displayGhost: - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - ;set the destinatin 'es:di'. Here , the screen at the xPos position - mov di, [xPos] ; the offset destination is xPos - ;the destination 'es' is already at its right value : the data segment 0x489D - ;select the source 'ds:si' of the movsb function - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - ;'si' had been set up before - - ;mov, byte per byte the content of the ghost in the video memory - mov dx, SPRITEW ; set the counter for 8 lines per sprite - - .eachLine: - mov cx, SPRITEW ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - add di, SCREEN_WIDTH - SPRITEW ; increment the position register to the next line - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues -ret ; go back in the game loop -clearGhost: - - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - ;set the source 'ds:si' of the movsb function - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - mov di, [xPos] ; define the offset destination as the same xPos, where was displayed the ghost - ;set the source 'ds:si' as the backup of the screen - ;ds is already set as 0x489D where is the backup at [buffScreen] - lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset - ;mov, byte per byte the content of the ghost in the video memory - mov dx, SPRITEW ; set the counter for 8 lines per sprite - .eachLine: - mov cx, SPRITEW ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - add di, SCREEN_WIDTH - SPRITEW ; increment the position register to the next line - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues -ret ; go back in the game loop -waiting: - mov cx, 0xFFFF ; how many times we repeat the loop - waitloop: - loop waitloop ; we jump FFFF times, so , many times, to make a delay in the program -ret ; go back in the game loop -changePos: -;switch the direction if the ghost reached a side of the screen - cmp word [xPos], SCREEN_WIDTH - SPRITEW - jb .noflip - neg word [xVelocity] - .noflip: -;inc/decremente the position - mov bx, [xPos] - add bx, [xVelocity] - mov [xPos], bx -ret \ No newline at end of file From 46d41aa3067fe8405925ae2e9c5ffe935b4eb87d Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Tue, 21 Nov 2023 17:01:06 +0100 Subject: [PATCH 11/60] Move right --- src/Initialization.asm | 5 +++- src/Keyboard.asm | 29 ++++++++++++++++++++ src/build-pacman.cmd | 2 +- src/entry.asm | 16 +++++------ src/main.asm | 29 +++++++++----------- src/{MoveSprites.asm => move_sprites.asm} | 33 ++++++++++++++++++++++- src/sprites.asm | 27 ------------------- 7 files changed, 87 insertions(+), 54 deletions(-) rename src/{MoveSprites.asm => move_sprites.asm} (91%) diff --git a/src/Initialization.asm b/src/Initialization.asm index 235b2cc..6a859db 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -1,3 +1,4 @@ +section .text SetVideoMode: ;set the video mode mov ah, 00h ; set video mode requirement @@ -5,7 +6,9 @@ SetVideoMode: int 10h ; call the dos interupt regarding to ax push 0a000h pop es + ret SetScreen: ;clear the screen mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) - call clearScreen \ No newline at end of file + call clearScreen + ret \ No newline at end of file diff --git a/src/Keyboard.asm b/src/Keyboard.asm index db16ef3..9d86832 100644 --- a/src/Keyboard.asm +++ b/src/Keyboard.asm @@ -1,3 +1,32 @@ +org 100h +section .data + keyPressed dw 0 + +section .text +readKeyboard: + ; Read next key in buffer: + xor ax, ax + int 16h + + ; Overwrite the first char in 'charDump' with received char: + mov [keyPressed] ,al + + cmp byte [keyPressed] ,1Bh + je MoveLeft + + cmp byte [keyPressed] ,100 + je MoveRight + + cmp byte [keyPressed] ,18h + je MoveUp + + cmp byte [keyPressed] ,19h + je MoveDown + + ; Compare the red char with ESCAPE (ASCII #27) + cmp byte [keyPressed] ,27 + jne readKeyboard ; Loop while not "escape". + exit: ; Wait for key and terminate the program mov al,01h ; Clear buffer diff --git a/src/build-pacman.cmd b/src/build-pacman.cmd index 52e90f6..2c7ecfd 100644 --- a/src/build-pacman.cmd +++ b/src/build-pacman.cmd @@ -4,4 +4,4 @@ set "ROOT_DIR=%SCRIPT_DIR%..\.." set "NASM=%ROOT_DIR%\nasm\nasm" set "BIN_DIR=%ROOT_DIR%\bin" -"%NASM%" Entry.asm -f bin -o "%BIN_DIR%\sprites.com" +"%NASM%" entry.asm -f bin -o "%BIN_DIR%\sprites.com" diff --git a/src/entry.asm b/src/entry.asm index a8d79bf..be5a7dc 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -3,11 +3,11 @@ org 100h section .text jmp start -%include "Constants.asm" -%include "Sprites.asm" -%include "Main.asm" -%include "Initialization.asm" -%include "Keyboard.asm" -%include "Collider.asm" -%include "MoveSprites.asm" -%include "Scoring.asm" \ No newline at end of file +%include "constants.asm" +%include "sprites.asm" +%include "main.asm" +%include "initialization.asm" +%include "keyboard.asm" +%include "collider.asm" +%include "move_sprites.asm" +%include "scoring.asm" \ No newline at end of file diff --git a/src/main.asm b/src/main.asm index 84dd931..e825655 100644 --- a/src/main.asm +++ b/src/main.asm @@ -2,8 +2,6 @@ section .bss buffScreen resb SPRITE_SIZE*SPRITE_SIZE ; where is stored the backuped screen section .data - xPos dw 0 - xVelocity dw 1 base: equ 0xf9fe old_time: equ base+0x06 @@ -11,13 +9,8 @@ section .text start: call SetVideoMode - call SetScreen - - mov si, [xPos] ; give the position to begin to save the screen - call saveScreen ; store the state of the screen before display the ghost -; display the selected ghost - lea si, BLINKY_1 ; selecting the sprite - call displayGhost + ;call SetScreen + call DrawSprite pusha gameloop: @@ -31,17 +24,21 @@ gameloop: popa + call readKeyboard ;restore the backuped screen above the ghost - call clearGhost + call clearScreen ;move the ghost - call changePos + ;call changePos ; backup the screen before display ghost - mov si, [xPos] ; give the position to begin to save the screen - call saveScreen ; store the state of the screen before display the ghost -; display the selected ghost - lea si, BLINKY_1 ; selecting the sprite - call displayGhost + mov ax, 80 + mov bx, 160 + call calculate_screen_position + push dx + mov ax, PACMAN_RIGHT_2 + call calculate_spritesheet_position + call draw_sprite + pop dx pusha ;return to the beggining of the gameloop jmp gameloop diff --git a/src/MoveSprites.asm b/src/move_sprites.asm similarity index 91% rename from src/MoveSprites.asm rename to src/move_sprites.asm index e59adc7..bd16f3a 100644 --- a/src/MoveSprites.asm +++ b/src/move_sprites.asm @@ -1,3 +1,9 @@ +section .data + xPos dw 160 + yPos dw 80 + xVelocity dw 16 + +section .text clearScreen: ;stosb copy byte per byte the content of al to es:di, di increasing. @@ -87,4 +93,29 @@ changePos: mov bx, [xPos] add bx, [xVelocity] mov [xPos], bx -ret \ No newline at end of file +ret + +DrawSprite: + mov ax, [yPos] + mov bx, [xPos] + call calculate_screen_position + mov ax, PACMAN_RIGHT_2 + call calculate_spritesheet_position + call draw_sprite + ret + +MoveRight: + mov bx, [xVelocity] + add [xPos], bx + ;call clearScreen + call DrawSprite + ret + +MoveLeft: + ret + +MoveUp: + ret + +MoveDown: + ret \ No newline at end of file diff --git a/src/sprites.asm b/src/sprites.asm index 63dd44f..5ce8041 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -1,30 +1,3 @@ -draw_spritesheet: - mov cx, 0 - .loop: - push cx - ; Set y coord - mov ax, cx - and ax, 0xf0 - ; Set x coord - mov bx, cx - and bx, 0xf - shl bx, 4 - call calculate_screen_position - ; Set sprite - mov ax, cx - call calculate_spritesheet_position - call draw_sprite - ; Repeat - pop cx - inc cx - cmp cx, 64 - jb .loop - ret - - - - - calculate_screen_position: ; Set first position on screen ; Parameters: y coord in ax, x coord in bx From b4d6040979285c0bafac62311071e474c6bdf3e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Tue, 21 Nov 2023 17:04:08 +0100 Subject: [PATCH 12/60] structured continuing --- src/Initialization.asm | 51 +++++++++++++++++++++++++++ src/entry.asm | 14 +++++++- src/main.asm | 3 ++ src/move_sprites.asm | 79 ++++++++++++++++++++++++++++++++++++++++++ src/sprites.asm | 3 ++ 5 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 src/Initialization.asm create mode 100644 src/move_sprites.asm diff --git a/src/Initialization.asm b/src/Initialization.asm new file mode 100644 index 0000000..8c0c396 --- /dev/null +++ b/src/Initialization.asm @@ -0,0 +1,51 @@ +section .bss + + background_buffer resb SCREEN_WIDTH*SCREEN_HEIGHT ; where is stored the dynamic background (pellet diappearing) to restore the screen after the ghost passage + + +section .text + + BuildBackground: + mov al, 0x78 ; color of the background (simulate the maze) (to be change) + + pop es ; put it as the destination segment of stosb + lea di, [background_buffer] ; load the effective adress (L.E.A.) of the backup in the destination offset + ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) + push + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for 8 pixel per line + rep stosb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + + ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning + push es + pop ds + + ret + + SetVideoMode: + ;set the video mode + mov ah, 00h ; set video mode requirement + mov al, 13h ; set video mode option to 320 x 200 256 colors + int 10h ; call the dos interupt regarding to ax + + ; move the adress of video memory 'A000' in the register which contains the address of the destination segment used by the automatic data transfer functions (like movs, stos, ...) + push 0xA000 + pop es + ret + + ClearScreen: + ;clear the screen by filling it with a unique color (stored in al) + mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) + call FillScreen + ret + + FillScreen: + ;stosb copy byte per byte the content of al to es:di, di increasing. + ;so we set the adress of the segments and the offsets + ;set the destination 'es:di' : + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, 0 ; begin the offset (pixel position) at 0 + mov cx, 200*320 ; how many times 'rep' action will be repeated + rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 + ret \ No newline at end of file diff --git a/src/entry.asm b/src/entry.asm index 17cf302..a499135 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -2,5 +2,17 @@ org 100h %include "constants.asm" +<<<<<<< Updated upstream %include "main.asm" -%include "sprites.asm" \ No newline at end of file +%include "sprites.asm" +======= +%include "constants.asm" +%include "main.asm" +%include "sprites.asm" +%include "initialization.asm" +%include "keyboard.asm" +%include "collider.asm" +%include "move_sprites.asm" +%include "scoring.asm" + +>>>>>>> Stashed changes diff --git a/src/main.asm b/src/main.asm index 190bf11..f8716fd 100644 --- a/src/main.asm +++ b/src/main.asm @@ -1,4 +1,5 @@ +<<<<<<< Updated upstream ;%ifndef "entry.asm" ;%endif "entry.asm" @@ -7,6 +8,8 @@ section .bss buffScreen resb SPRITE_SIZE*SPRITE_SIZE ; where is stored the backuped screen +======= +>>>>>>> Stashed changes section .data diff --git a/src/move_sprites.asm b/src/move_sprites.asm new file mode 100644 index 0000000..f503171 --- /dev/null +++ b/src/move_sprites.asm @@ -0,0 +1,79 @@ +;!!!PARAMETERS!!!; +;input the position of the ghost which will be displayed, into 'si' +saveScreen: + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + ;set the destinatin 'es:di'. Here , the begginning of the screen backup in [bufferScreen] + push ds ; ds is the data segment where is [bufferScreen] + pop es ; put it as the destination segment of movsb + lea di, [buffScreen] ; load the effective adress (L.E.A.) of the backup in the destination offset + ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) + push 0xA000 ; video memory adress = 0xA000 + pop ds ; define it as the adress of the source segment + ;'si' had been set up before + + ;mov, byte per byte the content into buffscreen + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues + + ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning + push es + pop ds + +ret ; go back in the game loop +displayGhost: + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + ;set the destinatin 'es:di'. Here , the screen at the xPos position + mov di, [xPos] ; the offset destination is xPos + ;the destination 'es' is already at its right value : the data segment 0x489D + ;select the source 'ds:si' of the movsb function + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + ;'si' had been set up before + + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues +ret ; go back in the game loop +clearGhost: + + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + ;set the source 'ds:si' of the movsb function + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, [xPos] ; define the offset destination as the same xPos, where was displayed the ghost + ;set the source 'ds:si' as the backup of the screen + ;ds is already set as 0x489D where is the backup at [buffScreen] + lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues +ret ; go back in the game loop +changePos: +;switch the direction if the ghost reached a side of the screen + cmp word [xPos], SCREEN_WIDTH - SPRITE_SIZE + jb .noflip + neg word [xVelocity] + .noflip: +;inc/decremente the position + mov bx, [xPos] + add bx, [xVelocity] + mov [xPos], bx +ret \ No newline at end of file diff --git a/src/sprites.asm b/src/sprites.asm index ffb1a27..993ab49 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -1,3 +1,4 @@ +<<<<<<< Updated upstream draw_spritesheet: mov cx, 0 @@ -26,6 +27,8 @@ draw_spritesheet: +======= +>>>>>>> Stashed changes calculate_screen_position: ; Set first position on screen ; Parameters: y coord in ax, x coord in bx From 143ab3588ace0e59b4f81aa0457b889f4c4f26ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Tue, 21 Nov 2023 17:05:32 +0100 Subject: [PATCH 13/60] a --- src/Initialization.asm | 51 ------------- src/_test_sprites.asm | 41 ---------- src/constants.asm | 2 +- src/entry.asm | 6 ++ src/initialization.asm | 0 src/keyboard.asm | 0 src/main.asm | 170 ++--------------------------------------- src/move_sprites.asm | 114 +++++++++++++++++++++++++++ src/sprites.asm | 22 ------ 9 files changed, 127 insertions(+), 279 deletions(-) delete mode 100644 src/_test_sprites.asm create mode 100644 src/initialization.asm create mode 100644 src/keyboard.asm diff --git a/src/Initialization.asm b/src/Initialization.asm index 8c0c396..e69de29 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -1,51 +0,0 @@ -section .bss - - background_buffer resb SCREEN_WIDTH*SCREEN_HEIGHT ; where is stored the dynamic background (pellet diappearing) to restore the screen after the ghost passage - - -section .text - - BuildBackground: - mov al, 0x78 ; color of the background (simulate the maze) (to be change) - - pop es ; put it as the destination segment of stosb - lea di, [background_buffer] ; load the effective adress (L.E.A.) of the backup in the destination offset - ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) - push - mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for 8 pixel per line - rep stosb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - - ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning - push es - pop ds - - ret - - SetVideoMode: - ;set the video mode - mov ah, 00h ; set video mode requirement - mov al, 13h ; set video mode option to 320 x 200 256 colors - int 10h ; call the dos interupt regarding to ax - - ; move the adress of video memory 'A000' in the register which contains the address of the destination segment used by the automatic data transfer functions (like movs, stos, ...) - push 0xA000 - pop es - ret - - ClearScreen: - ;clear the screen by filling it with a unique color (stored in al) - mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) - call FillScreen - ret - - FillScreen: - ;stosb copy byte per byte the content of al to es:di, di increasing. - ;so we set the adress of the segments and the offsets - ;set the destination 'es:di' : - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - mov di, 0 ; begin the offset (pixel position) at 0 - mov cx, 200*320 ; how many times 'rep' action will be repeated - rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 - ret \ No newline at end of file diff --git a/src/_test_sprites.asm b/src/_test_sprites.asm deleted file mode 100644 index 7e833b4..0000000 --- a/src/_test_sprites.asm +++ /dev/null @@ -1,41 +0,0 @@ -org 100h - -%include "constants.asm" -%include "sprites.asm" - -section .text - -start: - ; Set video mode to 320x200 256 colors graphic mode - mov ax, 0013h - int 10h - push 0a000h - pop es - - ; TEMP: Draw all the sprites - call draw_spritesheet - - ; TEMP: Randomly add a ghost with eyes - mov ax, 80 - mov bx, 160 - call calculate_screen_position - push dx - mov ax, BLINKY_1 - call calculate_spritesheet_position - call draw_sprite - pop dx - mov ax, EYES_RIGHT - call calculate_spritesheet_position - call draw_sprite - - ; Exit - jmp exit - - - -exit: - ; Wait for key and terminate the program - mov al,01h ; Clear buffer - mov ah,0ch ; Read key - int 21h ; Execute - int 20h ; Exit \ No newline at end of file diff --git a/src/constants.asm b/src/constants.asm index b82dece..892f13e 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -49,7 +49,7 @@ %define POWER_PELLET 44 - section .data + palette db 0, 44, 40, 15, 66, 33, 84, 52, 88, 48, 78, 3, 65, 0 spritesheet dd 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x20222002, 0x20022202, 0x20020002, 0x20002002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22202202, 0x20220222, 0x02002200, 0x00220020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x60666006, 0x60066606, 0x60060006, 0x60006006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66606606, 0x60660666, 0x06006600, 0x00660060, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x70777007, 0x70077707, 0x70070007, 0x70007007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77707707, 0x70770777, 0x07007700, 0x00770070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x40444004, 0x40044404, 0x40040004, 0x40004004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44404404, 0x40440444, 0x04004400, 0x00440040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x50555005, 0x50055505, 0x50050005, 0x50005005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x55505505, 0x50550555, 0x05005500, 0x00550050, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x30333003, 0x30033303, 0x30030003, 0x30003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x33303303, 0x30330333, 0x03003300, 0x00330030, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x30030000, 0x00300300, 0x33330000, 0x00333300, 0x55330000, 0x00553300, 0x55330000, 0x00553300, 0x30030000, 0x00300300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300300, 0x00003003, 0x00333300, 0x00003333, 0x00335500, 0x00003355, 0x00335500, 0x00003355, 0x00300300, 0x00003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00550000, 0x00005500, 0x30550300, 0x00305503, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x00330000, 0x00003300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00330000, 0x00003300, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x30550300, 0x00305503, 0x00550000, 0x00005500, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00000011, 0x11111100, 0x00000010, 0x11111100, 0x00000000, 0x10111101, 0x00000000, 0x00111101, 0x00000000, 0x00101101, 0x00000000, 0x00111101, 0x00000000, 0x10111101, 0x00000000, 0x11111100, 0x00000000, 0x11111100, 0x00000010, 0x11110100, 0x00000011, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00001011, 0x11111101, 0x00000000, 0x00101101, 0x00000000, 0x11111101, 0x00000000, 0x11111101, 0x00001011, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100100, 0x00001100, 0x00101100, 0x00101100, 0x00111100, 0x00101101, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11010000, 0x00001111, 0x11000000, 0x00101111, 0x01000000, 0x00101111, 0x00000000, 0x00111111, 0x00000000, 0x00111101, 0x00000000, 0x00111100, 0x00000000, 0x00111101, 0x00000000, 0x00111111, 0x01000000, 0x00101111, 0x11000000, 0x00101111, 0x11010000, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110000, 0x00111111, 0x01000000, 0x00111111, 0x00000000, 0x00111100, 0x01000000, 0x00111111, 0x11110000, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00101101, 0x00111100, 0x00001101, 0x00110100, 0x00001001, 0x00110000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x00111100, 0x00101101, 0x00101100, 0x00101100, 0x00100100, 0x00001100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00cc0000, 0x00000000, 0x00cccc00, 0x00000000, 0x00000ccc, 0x0c000000, 0x00000c00, 0xc0220200, 0x0000c000, 0x222c2200, 0x0000000c, 0x20222200, 0x0000222c, 0x02222300, 0x0020222c, 0x02322200, 0x00202222, 0x02220200, 0x00202232, 0x02000000, 0x00202223, 0x00000000, 0x00002222, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x93990000, 0x00009099, 0x99290200, 0x00002299, 0x29222200, 0x00202322, 0x22222300, 0x00202223, 0x23232200, 0x00202222, 0x22222200, 0x00203222, 0x23320200, 0x00002222, 0x22220200, 0x00002222, 0x32220000, 0x00000023, 0x22020000, 0x00000022, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00009009, 0x0c000000, 0x00909999, 0x0c000000, 0x00009909, 0xcc440000, 0x000044c4, 0x4c440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44440400, 0x00404444, 0x44440400, 0x00404444, 0x44040000, 0x00004044, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000c0, 0x0c220200, 0x00002202, 0x2c222200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222322, 0x22222200, 0x00222322, 0x22220200, 0x00203222, 0x22220200, 0x00202222, 0x22220000, 0x00002222, 0x20020000, 0x00002022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00b00000, 0x00000000, 0xbb0b0000, 0x000000bb, 0x0b000000, 0x00000000, 0x93000000, 0x00000090, 0x9b990000, 0x00009099, 0xb9b30900, 0x0000b999, 0x999b0900, 0x0000993b, 0x99b99300, 0x0090b9b9, 0x3b999b00, 0x00903b99, 0x99b99300, 0x009099b9, 0x3b9b0900, 0x0000993b, 0xb9990900, 0x0000b999, 0x999b0000, 0x0000909b, 0x99000000, 0x000000b0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x22005000, 0x00500020, 0x22025000, 0x00500022, 0x12225100, 0x00502112, 0x12115100, 0x00501111, 0x11115500, 0x00501511, 0x01510500, 0x00005501, 0x01550000, 0x00005005, 0x01050000, 0x00000005, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000010, 0x1d010000, 0x000010d1, 0x11110000, 0x00001111, 0xd1110000, 0x00001111, 0x111d0000, 0x00001111, 0x111d0100, 0x00101111, 0x111d0100, 0x00101111, 0x11110100, 0x00101111, 0x11d11100, 0x00111111, 0x11d11100, 0x00111111, 0x11111100, 0x00111111, 0xaaaa1a00, 0x00a1aa33, 0xaaaa0a00, 0x00a0aa33, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xaa000000, 0x000000a0, 0x00aa0000, 0x0000a00a, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x3d000000, 0x000000d0, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00001111, 0x10110100, 0x00101111, 0x10111100, 0x10111111, 0x10111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001011, 0x10110000, 0x00111111, 0x10111101, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001111, 0x10110100, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11110000, 0x00001011, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11111101, 0x00111111, 0x11111111, 0x10111111, 0x10111101, 0x00111111, 0x00110100, 0x00001101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11110100, 0x00001111, 0x11111101, 0x00111111, 0x10111101, 0x00111111, 0x00111100, 0x00101101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11010000, 0x00000011, 0x10000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000001, 0x10000000, 0x00000010, 0x00000100, 0x00000100, 0x00100000, 0x00001000, 0x00000000, 0x00000000, 0x00001100, 0x00100100, 0x00000000, 0x00000000, 0x00100000, 0x00001000, 0x00000100, 0x00000100, 0x10000000, 0x00000010, 0x00010000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x08000000, 0x00000080, 0x08000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x88000000, 0x00000088, 0x88080000, 0x00008088, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88080000, 0x00008088, 0x88000000, 0x00000088, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/src/entry.asm b/src/entry.asm index a499135..e2e3715 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -1,7 +1,10 @@ org 100h %include "constants.asm" +%include "sprites.asm" +%include "initialization.asm" +<<<<<<< Updated upstream <<<<<<< Updated upstream %include "main.asm" %include "sprites.asm" @@ -16,3 +19,6 @@ org 100h %include "scoring.asm" >>>>>>> Stashed changes +======= +%include "main.asm" +>>>>>>> Stashed changes diff --git a/src/initialization.asm b/src/initialization.asm new file mode 100644 index 0000000..e69de29 diff --git a/src/keyboard.asm b/src/keyboard.asm new file mode 100644 index 0000000..e69de29 diff --git a/src/main.asm b/src/main.asm index f8716fd..5c25995 100644 --- a/src/main.asm +++ b/src/main.asm @@ -1,6 +1,7 @@ <<<<<<< Updated upstream +<<<<<<< Updated upstream ;%ifndef "entry.asm" ;%endif "entry.asm" @@ -17,25 +18,15 @@ xPos dw 0 xVelocity dw 1 +======= +>>>>>>> Stashed changes section .text start: ; Set video mode to 320x200 256 colors graphic mode - mov ax, 0013h - int 10h - - - - + call set_video + - ;;;;;;;;;;;;;;;;;;;;;; - ;; ;; - ;; MAIN CODE HERE ;; - ;; ;; - ;;;;;;;;;;;;;;;;;;;;;; - - - ;------------------------------------------------------------------ ;THE GAME LOOP @@ -45,6 +36,7 @@ start: + call fill_color_ mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) call clearScreen @@ -57,15 +49,6 @@ start: ; display the selected ghost - mov ax, 80 - mov bx, [xPos] - call calculate_screen_position - push dx - mov ax, PACMAN_FULL - call calculate_spritesheet_position - call draw_sprite - pop dx - ;waiting... call waiting @@ -94,144 +77,3 @@ int 20h ;quit -;------------------------------------------------------------------ - -;THE FUNCTIONS - -;------------- - - -;!!!PARAMETERS!!!; -;to select the color to use to fill, you need this color into 'al' -clearScreen: - - ;stosb copy byte per byte the content of al to es:di, di increasing. - ;so we set the adress of the segments and the offsets - - ;set the destination 'es:di' : - - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - - mov di, 0 ; begin the offset (pixel position) at 0 - - mov cx, 200*320 ; how many times 'rep' action will be repeated - rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 - -ret ; go back in the game loop - - -;!!!PARAMETERS!!!; -;input the position of the ghost which will be displayed, into 'si' -saveScreen: - - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - - ;set the destinatin 'es:di'. Here , the begginning of the screen backup in [bufferScreen] - push ds ; ds is the data segment where is [bufferScreen] - pop es ; put it as the destination segment of movsb - lea di, [buffScreen] ; load the effective adress (L.E.A.) of the backup in the destination offset - - ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) - push 0xA000 ; video memory adress = 0xA000 - pop ds ; define it as the adress of the source segment - ;'si' had been set up before - - ;mov, byte per byte the content into buffscreen - mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite - - .eachLine: - mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues - - ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning - push es - pop ds - push 0xA000 - pop es - -ret ; go back in the game loop - - -;!!!PARAMETERS!!!; -;to select the ghost to print, you need to put the sprite address in 'si' (using 'lea si, blinky') -displayGhost: - - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - - ;set the destinatin 'es:di'. Here , the screen at the xPos position - mov di, [xPos] ; the offset destination is xPos - ;the destination 'es' is already at its right value : the data segment 0x489D - - ;select the source 'ds:si' of the movsb function - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - ;'si' had been set up before - - ;mov, byte per byte the content of the ghost in the video memory - mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite - - .eachLine: - mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues - -ret ; go back in the game loop - - -clearGhost: - - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - - ;set the source 'ds:si' of the movsb function - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - mov di, [xPos] ; define the offset destination as the same xPos, where was displayed the ghost - - ;set the source 'ds:si' as the backup of the screen - ;ds is already set as 0x489D where is the backup at [buffScreen] - lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset - - ;mov, byte per byte the content of the ghost in the video memory - mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite - - .eachLine: - mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues - -ret ; go back in the game loop - - -waiting: - push cx - mov cx, 0x0FFF ; how many times we repeat the loop - waitloop: - loop waitloop ; we jump FFFF times, so , many times, to make a delay in the program - pop cx - -ret ; go back in the game loop - - -changePos: - -;switch the direction if the ghost reached a side of the screen - cmp word [xPos], SCREEN_WIDTH - SPRITE_SIZE - jb .noflip - neg word [xVelocity] - .noflip: - -;inc/decremente the position - mov bx, [xPos] - add bx, [xVelocity] - mov [xPos], bx -ret \ No newline at end of file diff --git a/src/move_sprites.asm b/src/move_sprites.asm index f503171..aeed671 100644 --- a/src/move_sprites.asm +++ b/src/move_sprites.asm @@ -1,12 +1,57 @@ +<<<<<<< Updated upstream ;!!!PARAMETERS!!!; ;input the position of the ghost which will be displayed, into 'si' saveScreen: ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time ;so we set the adress of the segments and the offsets +======= +section .bss + +background_buffer resb SCREEN_WIDTH*_HEIGHT ; where is stored the dynamic background (pellet or not) to restore it behind the ghosts + +section .data + + xPos dw 0 + xVelocity dw 1 + + + +;!!!PARAMETERS!!!; +;to select the color to use to fill, you need this color into 'al' +clearScreen: + + ;stosb copy byte per byte the content of al to es:di, di increasing. + ;so we set the adress of the segments and the offsets + + ;set the destination 'es:di' : + + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + + mov di, 0 ; begin the offset (pixel position) at 0 + + mov cx, 200*320 ; how many times 'rep' action will be repeated + rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 + +ret ; go back in the game loop + + +;!!!PARAMETERS!!!; +;input the position of the ghost which will be displayed, into 'si' +saveScreen: + + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + +>>>>>>> Stashed changes ;set the destinatin 'es:di'. Here , the begginning of the screen backup in [bufferScreen] push ds ; ds is the data segment where is [bufferScreen] pop es ; put it as the destination segment of movsb lea di, [buffScreen] ; load the effective adress (L.E.A.) of the backup in the destination offset +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) push 0xA000 ; video memory adress = 0xA000 pop ds ; define it as the adress of the source segment @@ -14,6 +59,10 @@ saveScreen: ;mov, byte per byte the content into buffscreen mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes .eachLine: mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) @@ -23,6 +72,7 @@ saveScreen: ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning push es pop ds +<<<<<<< Updated upstream ret ; go back in the game loop displayGhost: @@ -31,6 +81,25 @@ displayGhost: ;set the destinatin 'es:di'. Here , the screen at the xPos position mov di, [xPos] ; the offset destination is xPos ;the destination 'es' is already at its right value : the data segment 0x489D +======= + push 0xA000 + pop es + +ret ; go back in the game loop + + +;!!!PARAMETERS!!!; +;to select the ghost to print, you need to put the sprite address in 'si' (using 'lea si, blinky') +displayGhost: + + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + + ;set the destinatin 'es:di'. Here , the screen at the xPos position + mov di, [xPos] ; the offset destination is xPos + ;the destination 'es' is already at its right value : the data segment 0x489D + +>>>>>>> Stashed changes ;select the source 'ds:si' of the movsb function push 0xA000 ; video memory adress = 0xA000 pop es ; define it as the adress of the destination segment @@ -45,33 +114,78 @@ displayGhost: add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties jnz .eachLine ; while the flag != 0, it continues +<<<<<<< Updated upstream +ret ; go back in the game loop +======= + ret ; go back in the game loop + + +>>>>>>> Stashed changes clearGhost: ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time ;so we set the adress of the segments and the offsets +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes ;set the source 'ds:si' of the movsb function push 0xA000 ; video memory adress = 0xA000 pop es ; define it as the adress of the destination segment mov di, [xPos] ; define the offset destination as the same xPos, where was displayed the ghost +<<<<<<< Updated upstream + ;set the source 'ds:si' as the backup of the screen + ;ds is already set as 0x489D where is the backup at [buffScreen] + lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite +======= + ;set the source 'ds:si' as the backup of the screen ;ds is already set as 0x489D where is the backup at [buffScreen] lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset + ;mov, byte per byte the content of the ghost in the video memory mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + +>>>>>>> Stashed changes .eachLine: mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties jnz .eachLine ; while the flag != 0, it continues +<<<<<<< Updated upstream +ret ; go back in the game loop +changePos: +======= + +ret ; go back in the game loop + + +waiting: + push cx + mov cx, 0x0FFF ; how many times we repeat the loop + waitloop: + loop waitloop ; we jump FFFF times, so , many times, to make a delay in the program + pop cx + ret ; go back in the game loop + + changePos: + +>>>>>>> Stashed changes ;switch the direction if the ghost reached a side of the screen cmp word [xPos], SCREEN_WIDTH - SPRITE_SIZE jb .noflip neg word [xVelocity] .noflip: +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes ;inc/decremente the position mov bx, [xPos] add bx, [xVelocity] diff --git a/src/sprites.asm b/src/sprites.asm index 993ab49..b3bde62 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -1,27 +1,5 @@ <<<<<<< Updated upstream -draw_spritesheet: - mov cx, 0 - .loop: - push cx - ; Set y coord - mov ax, cx - and ax, 0xf0 - ; Set x coord - mov bx, cx - and bx, 0xf - shl bx, 4 - call calculate_screen_position - ; Set sprite - mov ax, cx - call calculate_spritesheet_position - call draw_sprite - ; Repeat - pop cx - inc cx - cmp cx, 64 - jb .loop - ret From 7452cb1fe00bd290722fd4acff7f07b7ff87aa0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Tue, 21 Nov 2023 17:07:09 +0100 Subject: [PATCH 14/60] last update --- src/Initialization.asm | 51 +++++++++++++ src/_test_sprites.asm | 41 ++++++++++ src/constants.asm | 2 +- src/entry.asm | 6 -- src/initialization.asm | 51 +++++++++++++ src/main.asm | 170 +++++++++++++++++++++++++++++++++++++++-- src/move_sprites.asm | 114 --------------------------- src/sprites.asm | 22 ++++++ 8 files changed, 330 insertions(+), 127 deletions(-) create mode 100644 src/_test_sprites.asm diff --git a/src/Initialization.asm b/src/Initialization.asm index e69de29..8c0c396 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -0,0 +1,51 @@ +section .bss + + background_buffer resb SCREEN_WIDTH*SCREEN_HEIGHT ; where is stored the dynamic background (pellet diappearing) to restore the screen after the ghost passage + + +section .text + + BuildBackground: + mov al, 0x78 ; color of the background (simulate the maze) (to be change) + + pop es ; put it as the destination segment of stosb + lea di, [background_buffer] ; load the effective adress (L.E.A.) of the backup in the destination offset + ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) + push + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for 8 pixel per line + rep stosb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + + ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning + push es + pop ds + + ret + + SetVideoMode: + ;set the video mode + mov ah, 00h ; set video mode requirement + mov al, 13h ; set video mode option to 320 x 200 256 colors + int 10h ; call the dos interupt regarding to ax + + ; move the adress of video memory 'A000' in the register which contains the address of the destination segment used by the automatic data transfer functions (like movs, stos, ...) + push 0xA000 + pop es + ret + + ClearScreen: + ;clear the screen by filling it with a unique color (stored in al) + mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) + call FillScreen + ret + + FillScreen: + ;stosb copy byte per byte the content of al to es:di, di increasing. + ;so we set the adress of the segments and the offsets + ;set the destination 'es:di' : + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, 0 ; begin the offset (pixel position) at 0 + mov cx, 200*320 ; how many times 'rep' action will be repeated + rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 + ret \ No newline at end of file diff --git a/src/_test_sprites.asm b/src/_test_sprites.asm new file mode 100644 index 0000000..7e833b4 --- /dev/null +++ b/src/_test_sprites.asm @@ -0,0 +1,41 @@ +org 100h + +%include "constants.asm" +%include "sprites.asm" + +section .text + +start: + ; Set video mode to 320x200 256 colors graphic mode + mov ax, 0013h + int 10h + push 0a000h + pop es + + ; TEMP: Draw all the sprites + call draw_spritesheet + + ; TEMP: Randomly add a ghost with eyes + mov ax, 80 + mov bx, 160 + call calculate_screen_position + push dx + mov ax, BLINKY_1 + call calculate_spritesheet_position + call draw_sprite + pop dx + mov ax, EYES_RIGHT + call calculate_spritesheet_position + call draw_sprite + + ; Exit + jmp exit + + + +exit: + ; Wait for key and terminate the program + mov al,01h ; Clear buffer + mov ah,0ch ; Read key + int 21h ; Execute + int 20h ; Exit \ No newline at end of file diff --git a/src/constants.asm b/src/constants.asm index 892f13e..b82dece 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -49,7 +49,7 @@ %define POWER_PELLET 44 -section .data +section .data palette db 0, 44, 40, 15, 66, 33, 84, 52, 88, 48, 78, 3, 65, 0 spritesheet dd 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x20222002, 0x20022202, 0x20020002, 0x20002002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22202202, 0x20220222, 0x02002200, 0x00220020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x60666006, 0x60066606, 0x60060006, 0x60006006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66606606, 0x60660666, 0x06006600, 0x00660060, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x70777007, 0x70077707, 0x70070007, 0x70007007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77707707, 0x70770777, 0x07007700, 0x00770070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x40444004, 0x40044404, 0x40040004, 0x40004004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44404404, 0x40440444, 0x04004400, 0x00440040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x50555005, 0x50055505, 0x50050005, 0x50005005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x55505505, 0x50550555, 0x05005500, 0x00550050, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x30333003, 0x30033303, 0x30030003, 0x30003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x33303303, 0x30330333, 0x03003300, 0x00330030, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x30030000, 0x00300300, 0x33330000, 0x00333300, 0x55330000, 0x00553300, 0x55330000, 0x00553300, 0x30030000, 0x00300300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300300, 0x00003003, 0x00333300, 0x00003333, 0x00335500, 0x00003355, 0x00335500, 0x00003355, 0x00300300, 0x00003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00550000, 0x00005500, 0x30550300, 0x00305503, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x00330000, 0x00003300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00330000, 0x00003300, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x30550300, 0x00305503, 0x00550000, 0x00005500, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00000011, 0x11111100, 0x00000010, 0x11111100, 0x00000000, 0x10111101, 0x00000000, 0x00111101, 0x00000000, 0x00101101, 0x00000000, 0x00111101, 0x00000000, 0x10111101, 0x00000000, 0x11111100, 0x00000000, 0x11111100, 0x00000010, 0x11110100, 0x00000011, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00001011, 0x11111101, 0x00000000, 0x00101101, 0x00000000, 0x11111101, 0x00000000, 0x11111101, 0x00001011, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100100, 0x00001100, 0x00101100, 0x00101100, 0x00111100, 0x00101101, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11010000, 0x00001111, 0x11000000, 0x00101111, 0x01000000, 0x00101111, 0x00000000, 0x00111111, 0x00000000, 0x00111101, 0x00000000, 0x00111100, 0x00000000, 0x00111101, 0x00000000, 0x00111111, 0x01000000, 0x00101111, 0x11000000, 0x00101111, 0x11010000, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110000, 0x00111111, 0x01000000, 0x00111111, 0x00000000, 0x00111100, 0x01000000, 0x00111111, 0x11110000, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00101101, 0x00111100, 0x00001101, 0x00110100, 0x00001001, 0x00110000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x00111100, 0x00101101, 0x00101100, 0x00101100, 0x00100100, 0x00001100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00cc0000, 0x00000000, 0x00cccc00, 0x00000000, 0x00000ccc, 0x0c000000, 0x00000c00, 0xc0220200, 0x0000c000, 0x222c2200, 0x0000000c, 0x20222200, 0x0000222c, 0x02222300, 0x0020222c, 0x02322200, 0x00202222, 0x02220200, 0x00202232, 0x02000000, 0x00202223, 0x00000000, 0x00002222, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x93990000, 0x00009099, 0x99290200, 0x00002299, 0x29222200, 0x00202322, 0x22222300, 0x00202223, 0x23232200, 0x00202222, 0x22222200, 0x00203222, 0x23320200, 0x00002222, 0x22220200, 0x00002222, 0x32220000, 0x00000023, 0x22020000, 0x00000022, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00009009, 0x0c000000, 0x00909999, 0x0c000000, 0x00009909, 0xcc440000, 0x000044c4, 0x4c440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44440400, 0x00404444, 0x44440400, 0x00404444, 0x44040000, 0x00004044, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000c0, 0x0c220200, 0x00002202, 0x2c222200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222322, 0x22222200, 0x00222322, 0x22220200, 0x00203222, 0x22220200, 0x00202222, 0x22220000, 0x00002222, 0x20020000, 0x00002022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00b00000, 0x00000000, 0xbb0b0000, 0x000000bb, 0x0b000000, 0x00000000, 0x93000000, 0x00000090, 0x9b990000, 0x00009099, 0xb9b30900, 0x0000b999, 0x999b0900, 0x0000993b, 0x99b99300, 0x0090b9b9, 0x3b999b00, 0x00903b99, 0x99b99300, 0x009099b9, 0x3b9b0900, 0x0000993b, 0xb9990900, 0x0000b999, 0x999b0000, 0x0000909b, 0x99000000, 0x000000b0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x22005000, 0x00500020, 0x22025000, 0x00500022, 0x12225100, 0x00502112, 0x12115100, 0x00501111, 0x11115500, 0x00501511, 0x01510500, 0x00005501, 0x01550000, 0x00005005, 0x01050000, 0x00000005, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000010, 0x1d010000, 0x000010d1, 0x11110000, 0x00001111, 0xd1110000, 0x00001111, 0x111d0000, 0x00001111, 0x111d0100, 0x00101111, 0x111d0100, 0x00101111, 0x11110100, 0x00101111, 0x11d11100, 0x00111111, 0x11d11100, 0x00111111, 0x11111100, 0x00111111, 0xaaaa1a00, 0x00a1aa33, 0xaaaa0a00, 0x00a0aa33, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xaa000000, 0x000000a0, 0x00aa0000, 0x0000a00a, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x3d000000, 0x000000d0, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00001111, 0x10110100, 0x00101111, 0x10111100, 0x10111111, 0x10111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001011, 0x10110000, 0x00111111, 0x10111101, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001111, 0x10110100, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11110000, 0x00001011, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11111101, 0x00111111, 0x11111111, 0x10111111, 0x10111101, 0x00111111, 0x00110100, 0x00001101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11110100, 0x00001111, 0x11111101, 0x00111111, 0x10111101, 0x00111111, 0x00111100, 0x00101101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11010000, 0x00000011, 0x10000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000001, 0x10000000, 0x00000010, 0x00000100, 0x00000100, 0x00100000, 0x00001000, 0x00000000, 0x00000000, 0x00001100, 0x00100100, 0x00000000, 0x00000000, 0x00100000, 0x00001000, 0x00000100, 0x00000100, 0x10000000, 0x00000010, 0x00010000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x08000000, 0x00000080, 0x08000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x88000000, 0x00000088, 0x88080000, 0x00008088, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88080000, 0x00008088, 0x88000000, 0x00000088, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/src/entry.asm b/src/entry.asm index e2e3715..a499135 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -1,10 +1,7 @@ org 100h %include "constants.asm" -%include "sprites.asm" -%include "initialization.asm" -<<<<<<< Updated upstream <<<<<<< Updated upstream %include "main.asm" %include "sprites.asm" @@ -19,6 +16,3 @@ org 100h %include "scoring.asm" >>>>>>> Stashed changes -======= -%include "main.asm" ->>>>>>> Stashed changes diff --git a/src/initialization.asm b/src/initialization.asm index e69de29..8c0c396 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -0,0 +1,51 @@ +section .bss + + background_buffer resb SCREEN_WIDTH*SCREEN_HEIGHT ; where is stored the dynamic background (pellet diappearing) to restore the screen after the ghost passage + + +section .text + + BuildBackground: + mov al, 0x78 ; color of the background (simulate the maze) (to be change) + + pop es ; put it as the destination segment of stosb + lea di, [background_buffer] ; load the effective adress (L.E.A.) of the backup in the destination offset + ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) + push + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for 8 pixel per line + rep stosb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + + ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning + push es + pop ds + + ret + + SetVideoMode: + ;set the video mode + mov ah, 00h ; set video mode requirement + mov al, 13h ; set video mode option to 320 x 200 256 colors + int 10h ; call the dos interupt regarding to ax + + ; move the adress of video memory 'A000' in the register which contains the address of the destination segment used by the automatic data transfer functions (like movs, stos, ...) + push 0xA000 + pop es + ret + + ClearScreen: + ;clear the screen by filling it with a unique color (stored in al) + mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) + call FillScreen + ret + + FillScreen: + ;stosb copy byte per byte the content of al to es:di, di increasing. + ;so we set the adress of the segments and the offsets + ;set the destination 'es:di' : + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, 0 ; begin the offset (pixel position) at 0 + mov cx, 200*320 ; how many times 'rep' action will be repeated + rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 + ret \ No newline at end of file diff --git a/src/main.asm b/src/main.asm index 5c25995..f8716fd 100644 --- a/src/main.asm +++ b/src/main.asm @@ -1,7 +1,6 @@ <<<<<<< Updated upstream -<<<<<<< Updated upstream ;%ifndef "entry.asm" ;%endif "entry.asm" @@ -18,15 +17,25 @@ xPos dw 0 xVelocity dw 1 -======= ->>>>>>> Stashed changes section .text start: ; Set video mode to 320x200 256 colors graphic mode - call set_video - + mov ax, 0013h + int 10h + + + + + ;;;;;;;;;;;;;;;;;;;;;; + ;; ;; + ;; MAIN CODE HERE ;; + ;; ;; + ;;;;;;;;;;;;;;;;;;;;;; + + + ;------------------------------------------------------------------ ;THE GAME LOOP @@ -36,7 +45,6 @@ start: - call fill_color_ mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) call clearScreen @@ -49,6 +57,15 @@ start: ; display the selected ghost + mov ax, 80 + mov bx, [xPos] + call calculate_screen_position + push dx + mov ax, PACMAN_FULL + call calculate_spritesheet_position + call draw_sprite + pop dx + ;waiting... call waiting @@ -77,3 +94,144 @@ int 20h ;quit +;------------------------------------------------------------------ + +;THE FUNCTIONS + +;------------- + + +;!!!PARAMETERS!!!; +;to select the color to use to fill, you need this color into 'al' +clearScreen: + + ;stosb copy byte per byte the content of al to es:di, di increasing. + ;so we set the adress of the segments and the offsets + + ;set the destination 'es:di' : + + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + + mov di, 0 ; begin the offset (pixel position) at 0 + + mov cx, 200*320 ; how many times 'rep' action will be repeated + rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 + +ret ; go back in the game loop + + +;!!!PARAMETERS!!!; +;input the position of the ghost which will be displayed, into 'si' +saveScreen: + + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + + ;set the destinatin 'es:di'. Here , the begginning of the screen backup in [bufferScreen] + push ds ; ds is the data segment where is [bufferScreen] + pop es ; put it as the destination segment of movsb + lea di, [buffScreen] ; load the effective adress (L.E.A.) of the backup in the destination offset + + ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) + push 0xA000 ; video memory adress = 0xA000 + pop ds ; define it as the adress of the source segment + ;'si' had been set up before + + ;mov, byte per byte the content into buffscreen + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues + + ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning + push es + pop ds + push 0xA000 + pop es + +ret ; go back in the game loop + + +;!!!PARAMETERS!!!; +;to select the ghost to print, you need to put the sprite address in 'si' (using 'lea si, blinky') +displayGhost: + + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + + ;set the destinatin 'es:di'. Here , the screen at the xPos position + mov di, [xPos] ; the offset destination is xPos + ;the destination 'es' is already at its right value : the data segment 0x489D + + ;select the source 'ds:si' of the movsb function + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + ;'si' had been set up before + + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues + +ret ; go back in the game loop + + +clearGhost: + + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + + ;set the source 'ds:si' of the movsb function + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, [xPos] ; define the offset destination as the same xPos, where was displayed the ghost + + ;set the source 'ds:si' as the backup of the screen + ;ds is already set as 0x489D where is the backup at [buffScreen] + lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset + + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues + +ret ; go back in the game loop + + +waiting: + push cx + mov cx, 0x0FFF ; how many times we repeat the loop + waitloop: + loop waitloop ; we jump FFFF times, so , many times, to make a delay in the program + pop cx + +ret ; go back in the game loop + + +changePos: + +;switch the direction if the ghost reached a side of the screen + cmp word [xPos], SCREEN_WIDTH - SPRITE_SIZE + jb .noflip + neg word [xVelocity] + .noflip: + +;inc/decremente the position + mov bx, [xPos] + add bx, [xVelocity] + mov [xPos], bx +ret \ No newline at end of file diff --git a/src/move_sprites.asm b/src/move_sprites.asm index aeed671..f503171 100644 --- a/src/move_sprites.asm +++ b/src/move_sprites.asm @@ -1,57 +1,12 @@ -<<<<<<< Updated upstream ;!!!PARAMETERS!!!; ;input the position of the ghost which will be displayed, into 'si' saveScreen: ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time ;so we set the adress of the segments and the offsets -======= -section .bss - -background_buffer resb SCREEN_WIDTH*_HEIGHT ; where is stored the dynamic background (pellet or not) to restore it behind the ghosts - -section .data - - xPos dw 0 - xVelocity dw 1 - - - -;!!!PARAMETERS!!!; -;to select the color to use to fill, you need this color into 'al' -clearScreen: - - ;stosb copy byte per byte the content of al to es:di, di increasing. - ;so we set the adress of the segments and the offsets - - ;set the destination 'es:di' : - - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - - mov di, 0 ; begin the offset (pixel position) at 0 - - mov cx, 200*320 ; how many times 'rep' action will be repeated - rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 - -ret ; go back in the game loop - - -;!!!PARAMETERS!!!; -;input the position of the ghost which will be displayed, into 'si' -saveScreen: - - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - ->>>>>>> Stashed changes ;set the destinatin 'es:di'. Here , the begginning of the screen backup in [bufferScreen] push ds ; ds is the data segment where is [bufferScreen] pop es ; put it as the destination segment of movsb lea di, [buffScreen] ; load the effective adress (L.E.A.) of the backup in the destination offset -<<<<<<< Updated upstream -======= - ->>>>>>> Stashed changes ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) push 0xA000 ; video memory adress = 0xA000 pop ds ; define it as the adress of the source segment @@ -59,10 +14,6 @@ saveScreen: ;mov, byte per byte the content into buffscreen mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite -<<<<<<< Updated upstream -======= - ->>>>>>> Stashed changes .eachLine: mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) @@ -72,7 +23,6 @@ saveScreen: ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning push es pop ds -<<<<<<< Updated upstream ret ; go back in the game loop displayGhost: @@ -81,25 +31,6 @@ displayGhost: ;set the destinatin 'es:di'. Here , the screen at the xPos position mov di, [xPos] ; the offset destination is xPos ;the destination 'es' is already at its right value : the data segment 0x489D -======= - push 0xA000 - pop es - -ret ; go back in the game loop - - -;!!!PARAMETERS!!!; -;to select the ghost to print, you need to put the sprite address in 'si' (using 'lea si, blinky') -displayGhost: - - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - - ;set the destinatin 'es:di'. Here , the screen at the xPos position - mov di, [xPos] ; the offset destination is xPos - ;the destination 'es' is already at its right value : the data segment 0x489D - ->>>>>>> Stashed changes ;select the source 'ds:si' of the movsb function push 0xA000 ; video memory adress = 0xA000 pop es ; define it as the adress of the destination segment @@ -114,78 +45,33 @@ displayGhost: add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties jnz .eachLine ; while the flag != 0, it continues -<<<<<<< Updated upstream -ret ; go back in the game loop -======= - ret ; go back in the game loop - - ->>>>>>> Stashed changes clearGhost: ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time ;so we set the adress of the segments and the offsets -<<<<<<< Updated upstream -======= - ->>>>>>> Stashed changes ;set the source 'ds:si' of the movsb function push 0xA000 ; video memory adress = 0xA000 pop es ; define it as the adress of the destination segment mov di, [xPos] ; define the offset destination as the same xPos, where was displayed the ghost -<<<<<<< Updated upstream - ;set the source 'ds:si' as the backup of the screen - ;ds is already set as 0x489D where is the backup at [buffScreen] - lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset - ;mov, byte per byte the content of the ghost in the video memory - mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite -======= - ;set the source 'ds:si' as the backup of the screen ;ds is already set as 0x489D where is the backup at [buffScreen] lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset - ;mov, byte per byte the content of the ghost in the video memory mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite - ->>>>>>> Stashed changes .eachLine: mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties jnz .eachLine ; while the flag != 0, it continues -<<<<<<< Updated upstream -ret ; go back in the game loop -changePos: -======= - -ret ; go back in the game loop - - -waiting: - push cx - mov cx, 0x0FFF ; how many times we repeat the loop - waitloop: - loop waitloop ; we jump FFFF times, so , many times, to make a delay in the program - pop cx - ret ; go back in the game loop - - changePos: - ->>>>>>> Stashed changes ;switch the direction if the ghost reached a side of the screen cmp word [xPos], SCREEN_WIDTH - SPRITE_SIZE jb .noflip neg word [xVelocity] .noflip: -<<<<<<< Updated upstream -======= - ->>>>>>> Stashed changes ;inc/decremente the position mov bx, [xPos] add bx, [xVelocity] diff --git a/src/sprites.asm b/src/sprites.asm index b3bde62..993ab49 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -1,5 +1,27 @@ <<<<<<< Updated upstream +draw_spritesheet: + mov cx, 0 + .loop: + push cx + ; Set y coord + mov ax, cx + and ax, 0xf0 + ; Set x coord + mov bx, cx + and bx, 0xf + shl bx, 4 + call calculate_screen_position + ; Set sprite + mov ax, cx + call calculate_spritesheet_position + call draw_sprite + ; Repeat + pop cx + inc cx + cmp cx, 64 + jb .loop + ret From d300be6a1147b4cebb0a7be95b29237755663d3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Tue, 21 Nov 2023 17:09:01 +0100 Subject: [PATCH 15/60] delete test --- src/_test_sprites.asm | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/_test_sprites.asm diff --git a/src/_test_sprites.asm b/src/_test_sprites.asm deleted file mode 100644 index 7e833b4..0000000 --- a/src/_test_sprites.asm +++ /dev/null @@ -1,41 +0,0 @@ -org 100h - -%include "constants.asm" -%include "sprites.asm" - -section .text - -start: - ; Set video mode to 320x200 256 colors graphic mode - mov ax, 0013h - int 10h - push 0a000h - pop es - - ; TEMP: Draw all the sprites - call draw_spritesheet - - ; TEMP: Randomly add a ghost with eyes - mov ax, 80 - mov bx, 160 - call calculate_screen_position - push dx - mov ax, BLINKY_1 - call calculate_spritesheet_position - call draw_sprite - pop dx - mov ax, EYES_RIGHT - call calculate_spritesheet_position - call draw_sprite - - ; Exit - jmp exit - - - -exit: - ; Wait for key and terminate the program - mov al,01h ; Clear buffer - mov ah,0ch ; Read key - int 21h ; Execute - int 20h ; Exit \ No newline at end of file From d1cd54e2c9a44bfdecaabddc57124848d4458849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Tue, 21 Nov 2023 17:09:57 +0100 Subject: [PATCH 16/60] fix names --- ...Initialization.asm => Minitialization.asm} | 0 src/initialization.asm | 51 ------------------- 2 files changed, 51 deletions(-) rename src/{Initialization.asm => Minitialization.asm} (100%) delete mode 100644 src/initialization.asm diff --git a/src/Initialization.asm b/src/Minitialization.asm similarity index 100% rename from src/Initialization.asm rename to src/Minitialization.asm diff --git a/src/initialization.asm b/src/initialization.asm deleted file mode 100644 index 8c0c396..0000000 --- a/src/initialization.asm +++ /dev/null @@ -1,51 +0,0 @@ -section .bss - - background_buffer resb SCREEN_WIDTH*SCREEN_HEIGHT ; where is stored the dynamic background (pellet diappearing) to restore the screen after the ghost passage - - -section .text - - BuildBackground: - mov al, 0x78 ; color of the background (simulate the maze) (to be change) - - pop es ; put it as the destination segment of stosb - lea di, [background_buffer] ; load the effective adress (L.E.A.) of the backup in the destination offset - ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) - push - mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for 8 pixel per line - rep stosb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - - ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning - push es - pop ds - - ret - - SetVideoMode: - ;set the video mode - mov ah, 00h ; set video mode requirement - mov al, 13h ; set video mode option to 320 x 200 256 colors - int 10h ; call the dos interupt regarding to ax - - ; move the adress of video memory 'A000' in the register which contains the address of the destination segment used by the automatic data transfer functions (like movs, stos, ...) - push 0xA000 - pop es - ret - - ClearScreen: - ;clear the screen by filling it with a unique color (stored in al) - mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) - call FillScreen - ret - - FillScreen: - ;stosb copy byte per byte the content of al to es:di, di increasing. - ;so we set the adress of the segments and the offsets - ;set the destination 'es:di' : - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - mov di, 0 ; begin the offset (pixel position) at 0 - mov cx, 200*320 ; how many times 'rep' action will be repeated - rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 - ret \ No newline at end of file From e82b55fa85ff4758babaaede5c6568820227fc62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Tue, 21 Nov 2023 17:10:34 +0100 Subject: [PATCH 17/60] fix names --- src/{Minitialization.asm => Initialization.asm} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{Minitialization.asm => Initialization.asm} (100%) diff --git a/src/Minitialization.asm b/src/Initialization.asm similarity index 100% rename from src/Minitialization.asm rename to src/Initialization.asm From 2b0c623e13e3057ecf32ab4458c3286f705f5f3e Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Tue, 21 Nov 2023 21:52:07 +0100 Subject: [PATCH 18/60] Movements work but no automatization --- src/Keyboard.asm | 55 ++++++++++++++++++++++++++++++++++++-------- src/main.asm | 13 +++-------- src/move_sprites.asm | 41 ++++++++++++++++++++++++--------- 3 files changed, 79 insertions(+), 30 deletions(-) diff --git a/src/Keyboard.asm b/src/Keyboard.asm index 9d86832..21f4109 100644 --- a/src/Keyboard.asm +++ b/src/Keyboard.asm @@ -1,31 +1,68 @@ org 100h section .data keyPressed dw 0 + oldKeyPressed dw 100 section .text readKeyboard: ; Read next key in buffer: xor ax, ax + mov ah, 01h + int 16h + cmp al, 0 + je NoKey + int 16h - ; Overwrite the first char in 'charDump' with received char: mov [keyPressed] ,al - cmp byte [keyPressed] ,1Bh - je MoveLeft + cmp byte [keyPressed] ,113 + je ChangeKeyL cmp byte [keyPressed] ,100 - je MoveRight + je ChangeKeyR - cmp byte [keyPressed] ,18h - je MoveUp + cmp byte [keyPressed] ,122 + je ChangeKeyU - cmp byte [keyPressed] ,19h - je MoveDown + cmp byte [keyPressed] ,115 + je ChangeKeyD ; Compare the red char with ESCAPE (ASCII #27) cmp byte [keyPressed] ,27 - jne readKeyboard ; Loop while not "escape". + je exit ; Loop while not "escape". + + xor ax, ax +NoKey: + ret + +ChangeKeyL: + pusha + mov bx, [keyPressed] + mov [oldKeyPressed], bx + popa + jmp MoveLeft + +ChangeKeyR: + pusha + mov bx, [keyPressed] + mov [oldKeyPressed], bx + popa + jmp MoveRight + +ChangeKeyU: + pusha + mov bx, [keyPressed] + mov [oldKeyPressed], bx + popa + jmp MoveUp + +ChangeKeyD: + pusha + mov bx, [keyPressed] + mov [oldKeyPressed], bx + popa + jmp MoveDown exit: ; Wait for key and terminate the program diff --git a/src/main.asm b/src/main.asm index e825655..95246a8 100644 --- a/src/main.asm +++ b/src/main.asm @@ -23,22 +23,15 @@ gameloop: mov [old_time], dx popa - + ;call DrawSprite call readKeyboard ;restore the backuped screen above the ghost call clearScreen ;move the ghost - ;call changePos + call changePos ; backup the screen before display ghost - mov ax, 80 - mov bx, 160 - call calculate_screen_position - push dx - mov ax, PACMAN_RIGHT_2 - call calculate_spritesheet_position - call draw_sprite - pop dx + call DrawSprite pusha ;return to the beggining of the gameloop jmp gameloop diff --git a/src/move_sprites.asm b/src/move_sprites.asm index bd16f3a..70bbdba 100644 --- a/src/move_sprites.asm +++ b/src/move_sprites.asm @@ -1,7 +1,8 @@ section .data xPos dw 160 yPos dw 80 - xVelocity dw 16 + xVelocity dw 1 + PACMANDir dw PACMAN_RIGHT_2 section .text clearScreen: @@ -85,21 +86,23 @@ clearGhost: ret ; go back in the game loop changePos: ;switch the direction if the ghost reached a side of the screen - cmp word [xPos], SCREEN_WIDTH - SPRITE_SIZE - jb .noflip - neg word [xVelocity] - .noflip: -;inc/decremente the position - mov bx, [xPos] - add bx, [xVelocity] - mov [xPos], bx -ret + cmp byte [oldKeyPressed] ,113 + je MoveLeft + + cmp byte [oldKeyPressed] ,100 + je MoveRight + + cmp byte [oldKeyPressed] ,122 + je MoveUp + + cmp byte [oldKeyPressed] ,115 + je MoveDown DrawSprite: mov ax, [yPos] mov bx, [xPos] call calculate_screen_position - mov ax, PACMAN_RIGHT_2 + mov ax, [PACMANDir] call calculate_spritesheet_position call draw_sprite ret @@ -107,15 +110,31 @@ DrawSprite: MoveRight: mov bx, [xVelocity] add [xPos], bx + mov word [PACMANDir], PACMAN_RIGHT_2 ;call clearScreen call DrawSprite ret MoveLeft: + mov bx, [xVelocity] + sub [xPos], bx + mov word [PACMANDir], PACMAN_LEFT_2 + ;call clearScreen + call DrawSprite ret MoveUp: + mov bx, [xVelocity] + sub [yPos], bx + mov word [PACMANDir], PACMAN_UP_2 + ;call clearScreen + call DrawSprite ret MoveDown: + mov bx, [xVelocity] + add [yPos], bx + mov word [PACMANDir], PACMAN_DOWN_2 + ;call clearScreen + call DrawSprite ret \ No newline at end of file From cc0d9eddf40396e579ad41336c7a44a3a7925b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Tue, 21 Nov 2023 22:15:31 +0100 Subject: [PATCH 19/60] =?UTF-8?q?mise=20en=20forme=20=C3=A0=20deux=20balle?= =?UTF-8?q?s=20(oui=20L=C3=A9o,=20"pan=20pan")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Initialization.asm | 51 ------------------------------------------ src/entry.asm | 5 ++--- src/main.asm | 8 +------ 3 files changed, 3 insertions(+), 61 deletions(-) delete mode 100644 src/Initialization.asm diff --git a/src/Initialization.asm b/src/Initialization.asm deleted file mode 100644 index 8c0c396..0000000 --- a/src/Initialization.asm +++ /dev/null @@ -1,51 +0,0 @@ -section .bss - - background_buffer resb SCREEN_WIDTH*SCREEN_HEIGHT ; where is stored the dynamic background (pellet diappearing) to restore the screen after the ghost passage - - -section .text - - BuildBackground: - mov al, 0x78 ; color of the background (simulate the maze) (to be change) - - pop es ; put it as the destination segment of stosb - lea di, [background_buffer] ; load the effective adress (L.E.A.) of the backup in the destination offset - ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) - push - mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for 8 pixel per line - rep stosb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - - ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning - push es - pop ds - - ret - - SetVideoMode: - ;set the video mode - mov ah, 00h ; set video mode requirement - mov al, 13h ; set video mode option to 320 x 200 256 colors - int 10h ; call the dos interupt regarding to ax - - ; move the adress of video memory 'A000' in the register which contains the address of the destination segment used by the automatic data transfer functions (like movs, stos, ...) - push 0xA000 - pop es - ret - - ClearScreen: - ;clear the screen by filling it with a unique color (stored in al) - mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) - call FillScreen - ret - - FillScreen: - ;stosb copy byte per byte the content of al to es:di, di increasing. - ;so we set the adress of the segments and the offsets - ;set the destination 'es:di' : - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - mov di, 0 ; begin the offset (pixel position) at 0 - mov cx, 200*320 ; how many times 'rep' action will be repeated - rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 - ret \ No newline at end of file diff --git a/src/entry.asm b/src/entry.asm index a499135..49a17b7 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -2,10 +2,10 @@ org 100h %include "constants.asm" -<<<<<<< Updated upstream + %include "main.asm" %include "sprites.asm" -======= + %include "constants.asm" %include "main.asm" %include "sprites.asm" @@ -15,4 +15,3 @@ org 100h %include "move_sprites.asm" %include "scoring.asm" ->>>>>>> Stashed changes diff --git a/src/main.asm b/src/main.asm index f8716fd..dba094d 100644 --- a/src/main.asm +++ b/src/main.asm @@ -1,15 +1,9 @@ -<<<<<<< Updated upstream - -;%ifndef "entry.asm" -;%endif "entry.asm" - section .bss buffScreen resb SPRITE_SIZE*SPRITE_SIZE ; where is stored the backuped screen -======= ->>>>>>> Stashed changes + section .data From 77fe18069577b50c845bd279913954ccdadeeb4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Tue, 21 Nov 2023 22:16:50 +0100 Subject: [PATCH 20/60] =?UTF-8?q?voil=C3=A0=20je=20remets=20sans=20le=20I?= =?UTF-8?q?=20majuscule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/initialization.asm | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/initialization.asm diff --git a/src/initialization.asm b/src/initialization.asm new file mode 100644 index 0000000..8c0c396 --- /dev/null +++ b/src/initialization.asm @@ -0,0 +1,51 @@ +section .bss + + background_buffer resb SCREEN_WIDTH*SCREEN_HEIGHT ; where is stored the dynamic background (pellet diappearing) to restore the screen after the ghost passage + + +section .text + + BuildBackground: + mov al, 0x78 ; color of the background (simulate the maze) (to be change) + + pop es ; put it as the destination segment of stosb + lea di, [background_buffer] ; load the effective adress (L.E.A.) of the backup in the destination offset + ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) + push + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for 8 pixel per line + rep stosb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + + ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning + push es + pop ds + + ret + + SetVideoMode: + ;set the video mode + mov ah, 00h ; set video mode requirement + mov al, 13h ; set video mode option to 320 x 200 256 colors + int 10h ; call the dos interupt regarding to ax + + ; move the adress of video memory 'A000' in the register which contains the address of the destination segment used by the automatic data transfer functions (like movs, stos, ...) + push 0xA000 + pop es + ret + + ClearScreen: + ;clear the screen by filling it with a unique color (stored in al) + mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) + call FillScreen + ret + + FillScreen: + ;stosb copy byte per byte the content of al to es:di, di increasing. + ;so we set the adress of the segments and the offsets + ;set the destination 'es:di' : + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, 0 ; begin the offset (pixel position) at 0 + mov cx, 200*320 ; how many times 'rep' action will be repeated + rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 + ret \ No newline at end of file From d7912794b559049be23a08107016cb7a792e95cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Wed, 22 Nov 2023 04:12:44 +0100 Subject: [PATCH 21/60] updated all the structure adding some functions The code is supposed to display pacman and make it moving to the right, but i have a problem: in initialize.asm, in the function BuildBackgroundBuffer: , each time it come to the "rep stosb" part, in turbo debug, i can see that the code jump to anywhere. when running entry.asm, with the jump exit i put in main.asm, we should have a background and a pacman --- src/collider.asm | 0 src/entry.asm | 10 +- src/initialization.asm | 99 ++++++++++++----- src/main.asm | 234 +++------------------------------------ src/move_sprites.asm | 108 ++++++------------ src/scoring.asm | 0 src/sprites.asm | 245 ++++++++++++++++++++++++----------------- 7 files changed, 275 insertions(+), 421 deletions(-) create mode 100644 src/collider.asm create mode 100644 src/scoring.asm diff --git a/src/collider.asm b/src/collider.asm new file mode 100644 index 0000000..e69de29 diff --git a/src/entry.asm b/src/entry.asm index 49a17b7..1d07cc7 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -1,13 +1,9 @@ org 100h -%include "constants.asm" - - -%include "main.asm" -%include "sprites.asm" +jmp start %include "constants.asm" -%include "main.asm" + %include "sprites.asm" %include "initialization.asm" %include "keyboard.asm" @@ -15,3 +11,5 @@ org 100h %include "move_sprites.asm" %include "scoring.asm" +%include "main.asm" + diff --git a/src/initialization.asm b/src/initialization.asm index 8c0c396..d70e19f 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -1,51 +1,98 @@ section .bss - background_buffer resb SCREEN_WIDTH*SCREEN_HEIGHT ; where is stored the dynamic background (pellet diappearing) to restore the screen after the ghost passage + background_buffer resb SCREEN_WIDTH*SCREEN_HEIGHT ; where is stored the dynamic background (dynamic cuz gums are disappearing). Used to restore the screen after a ghost's passage +section .data + + base: equ 0xf9fe + old_time: equ base+0x06 section .text - BuildBackground: - mov al, 0x78 ; color of the background (simulate the maze) (to be change) - - pop es ; put it as the destination segment of stosb - lea di, [background_buffer] ; load the effective adress (L.E.A.) of the backup in the destination offset - ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) - push - mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for 8 pixel per line - rep stosb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + GetClockAndCompare: + + mov ax, 0 + int 1ah ; BIOS clock read + cmp dx, [old_time] ; Wait for change + je gameloop ; Loop + mov [old_time], dx - ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning - push es - pop ds + popa ret SetVideoMode: - ;set the video mode - mov ah, 00h ; set video mode requirement + + mov ah, 00h ; chose the video mode setting function at the 10h interruption mov al, 13h ; set video mode option to 320 x 200 256 colors int 10h ; call the dos interupt regarding to ax - ; move the adress of video memory 'A000' in the register which contains the address of the destination segment used by the automatic data transfer functions (like movs, stos, ...) + ; write the adress of video memory (A000) in the register which contains the address of the destination segment used by the automatic data transfer functions (like movs, stos, ...) push 0xA000 pop es - ret - ClearScreen: - ;clear the screen by filling it with a unique color (stored in al) - mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) - call FillScreen ret FillScreen: - ;stosb copy byte per byte the content of al to es:di, di increasing. - ;so we set the adress of the segments and the offsets + + ;stosb copy byte per byte the content from 'al' to 'es:di', di increasing. + ;set the destination 'es:di' : push 0xA000 ; video memory adress = 0xA000 pop es ; define it as the adress of the destination segment mov di, 0 ; begin the offset (pixel position) at 0 - mov cx, 200*320 ; how many times 'rep' action will be repeated + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; how many times 'rep' action will be repeated rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 - ret \ No newline at end of file + ret + + ClearScreen: + ;clear the screen by filling it with a unique color (stored in al) + mov al, 0x09 ; color to fill the screen (white = 0x0F, black = 0x00) + call FillScreen + ret + + BuildBackgroundBuffer: + ;source of stosb 'al' + mov al, 0x78 ; color of the background (simulate the maze) (to be change) + + ;destination of stosb 'es:di' + ;push ds ; adress of the data segment (even if 'es' probably already contains '0x489D') + ;pop es + lea di, [background_buffer] ; load the effective adress (L.E.A.) of the backup in the destination offset 'di' + + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for rep + rep stosb ; to copy al into each byte of the target adress es:di byte per byte + + ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning + + ret + + DisplayMaze: + + ;HEART OF THE FUNCTION : 'movsb' writes byte per byte the content from 'ds:si' to 'es:di', increasing both si and di each time it is executed + + ;set source 'ds:si' + push 0x489D ; adress of the data segment + pop ds + lea si, [background_buffer] ; load the effective adress (L.E.A.) of the dynamic background buffer + + ;set destination 'es:di' + push 0xA000 ; adress of the video memory + pop es + mov di, 0 ; from the beginning of the screen + + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for rep + rep movsb ; 'movsb' writes byte per byte the content from 'ds:si' to 'es:di', increasing both si and di each time it is executed + + ret + + FirstDisplayPacMan: + + ;mov x_PacManPosition, 30 + ;mov y_PacManPosition, 30 + ;mov frameOf_PacMan, PACMAN_FULL + + call Display_PacMan + + + \ No newline at end of file diff --git a/src/main.asm b/src/main.asm index dba094d..a8a3984 100644 --- a/src/main.asm +++ b/src/main.asm @@ -1,231 +1,31 @@ - - -section .bss - -buffScreen resb SPRITE_SIZE*SPRITE_SIZE ; where is stored the backuped screen - - -section .data - -xPos dw 0 -xVelocity dw 1 - - section .text -start: - ; Set video mode to 320x200 256 colors graphic mode - mov ax, 0013h - int 10h - + start: - + call SetVideoMode + call ClearScreen + call BuildBackgroundBuffer ; !!!!!THE ERROR IS IN THIS FUNCTION!!!!!! + call DisplayMaze + ;call FirstDisplayGhosts + call FirstDisplayPacMan + jmp exit - ;;;;;;;;;;;;;;;;;;;;;; - ;; ;; - ;; MAIN CODE HERE ;; - ;; ;; - ;;;;;;;;;;;;;;;;;;;;;; - - - -;------------------------------------------------------------------ + pusha ; for the clock, maybe not usefull +;----------------------------------------------------------------------------------------- ;THE GAME LOOP - -;------------- - - - - - mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) - call clearScreen - gameloop: - push 0xA000 - pop es -; backup the screen before display ghost - mov si, [xPos] ; give the position to begin to save the screen - call saveScreen ; store the state of the screen before display the ghost +;------------------------------------------------- -; display the selected ghost - - mov ax, 80 - mov bx, [xPos] - call calculate_screen_position - push dx - mov ax, PACMAN_FULL - call calculate_spritesheet_position - call draw_sprite - pop dx - + call GetClockAndCompare -;waiting... - call waiting - + call Move_PacMan -;restore the backuped screen above the ghost - call clearGhost -;move the ghost - call changePos - -;return to the beggining of the gameloop +;------------------------------------------------- +; GOTO GAME LOOP jmp gameloop +;----------------------------------------------------------------------------------------- - - -mov ax, 0C01h ; -int 21h - -;dos box default video mode -mov ax, 03h -int 21h - -int 20h ;quit - - - - -;------------------------------------------------------------------ - -;THE FUNCTIONS - -;------------- - - -;!!!PARAMETERS!!!; -;to select the color to use to fill, you need this color into 'al' -clearScreen: - - ;stosb copy byte per byte the content of al to es:di, di increasing. - ;so we set the adress of the segments and the offsets - - ;set the destination 'es:di' : - - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - - mov di, 0 ; begin the offset (pixel position) at 0 - - mov cx, 200*320 ; how many times 'rep' action will be repeated - rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 - -ret ; go back in the game loop - - -;!!!PARAMETERS!!!; -;input the position of the ghost which will be displayed, into 'si' -saveScreen: - - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - - ;set the destinatin 'es:di'. Here , the begginning of the screen backup in [bufferScreen] - push ds ; ds is the data segment where is [bufferScreen] - pop es ; put it as the destination segment of movsb - lea di, [buffScreen] ; load the effective adress (L.E.A.) of the backup in the destination offset - - ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) - push 0xA000 ; video memory adress = 0xA000 - pop ds ; define it as the adress of the source segment - ;'si' had been set up before - - ;mov, byte per byte the content into buffscreen - mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite - - .eachLine: - mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues - - ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning - push es - pop ds - push 0xA000 - pop es - -ret ; go back in the game loop - - -;!!!PARAMETERS!!!; -;to select the ghost to print, you need to put the sprite address in 'si' (using 'lea si, blinky') -displayGhost: - - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - - ;set the destinatin 'es:di'. Here , the screen at the xPos position - mov di, [xPos] ; the offset destination is xPos - ;the destination 'es' is already at its right value : the data segment 0x489D - - ;select the source 'ds:si' of the movsb function - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - ;'si' had been set up before - - ;mov, byte per byte the content of the ghost in the video memory - mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite - - .eachLine: - mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues - -ret ; go back in the game loop - - -clearGhost: - - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - - ;set the source 'ds:si' of the movsb function - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - mov di, [xPos] ; define the offset destination as the same xPos, where was displayed the ghost - - ;set the source 'ds:si' as the backup of the screen - ;ds is already set as 0x489D where is the backup at [buffScreen] - lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset - - ;mov, byte per byte the content of the ghost in the video memory - mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite - - .eachLine: - mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues - -ret ; go back in the game loop - - -waiting: - push cx - mov cx, 0x0FFF ; how many times we repeat the loop - waitloop: - loop waitloop ; we jump FFFF times, so , many times, to make a delay in the program - pop cx - -ret ; go back in the game loop - - -changePos: - -;switch the direction if the ghost reached a side of the screen - cmp word [xPos], SCREEN_WIDTH - SPRITE_SIZE - jb .noflip - neg word [xVelocity] - .noflip: - -;inc/decremente the position - mov bx, [xPos] - add bx, [xVelocity] - mov [xPos], bx -ret \ No newline at end of file +exit: \ No newline at end of file diff --git a/src/move_sprites.asm b/src/move_sprites.asm index f503171..e11fd8f 100644 --- a/src/move_sprites.asm +++ b/src/move_sprites.asm @@ -1,79 +1,41 @@ -;!!!PARAMETERS!!!; -;input the position of the ghost which will be displayed, into 'si' -saveScreen: - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - ;set the destinatin 'es:di'. Here , the begginning of the screen backup in [bufferScreen] - push ds ; ds is the data segment where is [bufferScreen] - pop es ; put it as the destination segment of movsb - lea di, [buffScreen] ; load the effective adress (L.E.A.) of the backup in the destination offset - ;set the source 'ds:si' to A000:xpos (it's needed to have si defined before the call) - push 0xA000 ; video memory adress = 0xA000 - pop ds ; define it as the adress of the source segment - ;'si' had been set up before - - ;mov, byte per byte the content into buffscreen - mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite - .eachLine: - mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues - - ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning - push es - pop ds - -ret ; go back in the game loop -displayGhost: - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - ;set the destinatin 'es:di'. Here , the screen at the xPos position - mov di, [xPos] ; the offset destination is xPos - ;the destination 'es' is already at its right value : the data segment 0x489D - ;select the source 'ds:si' of the movsb function - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - ;'si' had been set up before - - ;mov, byte per byte the content of the ghost in the video memory - mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite - - .eachLine: - mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues -ret ; go back in the game loop -clearGhost: - - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets - ;set the source 'ds:si' of the movsb function - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - mov di, [xPos] ; define the offset destination as the same xPos, where was displayed the ghost - ;set the source 'ds:si' as the backup of the screen - ;ds is already set as 0x489D where is the backup at [buffScreen] - lea si, [buffScreen]; load the effective adress (L.E.A.) of the backup in the destination offset - ;mov, byte per byte the content of the ghost in the video memory - mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite - .eachLine: - mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues -ret ; go back in the game loop + +section .data + +x_PacManVelocity dw 0 ; PacMan's translation vector on x axis (px/screen update) (if it=-3, pac man will go down 3 pixel, 24 times per second) +y_PacManVelocity dw 0 ; PacMan's translation vector on y axis (px/screen update) (if it=+2, pac man will go right 2 pixel, 24 times per second) + +x_BlinkyVelocity dw 0 ; Blinky's translation vector on x axis (px/screen update) (if it=-3, Blinky will go down 3 pixel, 24 times per second) +y_BlinkyVelocity dw 0 ; Blinky's translation vector on y axis (px/screen update) (if it=+2, Blinky will go right 2 pixel, 24 times per second) + +x_PinkyVelocity dw 0 ; Pinky's translation vector on x axis (px/screen update) (if it=-3, Pinky will go down 3 pixel, 24 times per second) +y_PinkyVelocity dw 0 ; Pinky's translation vector on y axis (px/screen update) (if it=+2, Pinky will go right 2 pixel, 24 times per second) + +x_ClydeVelocity dw 0 ; Clyde's translation vector on x axis (px/screen update) (if it=-3, Clyde will go down 3 pixel, 24 times per second) +y_ClydeVelocity dw 0 ; Clyde's translation vector on y axis (px/screen update) (if it=+2, Clyde will go right 2 pixel, 24 times per second) + +x_InkyVelocity dw 0 ; Inky's translation vector on x axis (px/screen update) (if it=-3, Inky will go down 3 pixel, 24 times per second) +y_InkyVelocity dw 0 ; Inky's translation vector on y axis (px/screen update) (if it=+2, Inky will go right 2 pixel, 24 times per second) + +section .text + + changePos: ;switch the direction if the ghost reached a side of the screen - cmp word [xPos], SCREEN_WIDTH - SPRITE_SIZE + cmp word [x_PacManPosition], SCREEN_WIDTH - SPRITE_SIZE jb .noflip - neg word [xVelocity] + neg word [x_PacManVelocity] .noflip: ;inc/decremente the position - mov bx, [xPos] - add bx, [xVelocity] - mov [xPos], bx + mov bx, [x_PacManPosition] + add bx, [x_PacManVelocity] + mov [x_PacManPosition], bx +ret + +Move_PacMan: + + call ClearPacMan + mov bx, 1 + mov [x_PacManVelocity], bx + call changePos + call Display_PacMan ret \ No newline at end of file diff --git a/src/scoring.asm b/src/scoring.asm new file mode 100644 index 0000000..e69de29 diff --git a/src/sprites.asm b/src/sprites.asm index 993ab49..6bd651b 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -1,110 +1,157 @@ -<<<<<<< Updated upstream - -draw_spritesheet: - mov cx, 0 - .loop: - push cx - ; Set y coord - mov ax, cx - and ax, 0xf0 - ; Set x coord - mov bx, cx - and bx, 0xf - shl bx, 4 - call calculate_screen_position - ; Set sprite - mov ax, cx - call calculate_spritesheet_position - call draw_sprite - ; Repeat - pop cx - inc cx - cmp cx, 64 - jb .loop + +section .data + +x_PacManPosition dw 10 ; x position of pacman at the beginning (it will be changed each time it will move) +y_PacManPosition dw 10 ; y position of pacman at the beginning (it will be changed each time it will move) +frameOf_PacMan dw PACMAN_FULL + +afraid db 0 ; 0 : normal ghost animation, 1 : afraid ghost animation + +x_BlinkyPosition dw 30 ; x position of Blinky at the beginning (it will be changed each time it will move) +y_BlinkyPosition dw 100 ; y position of Blinky at the beginning (it will be changed each time it will move) +frameOf_Blinky dw BLINKY_1 + +x_PinkyPosition dw 50 ; x position of Pinky at the beginning (it will be changed each time it will move) +y_PinkyPosition dw 100 ; y position of Pinky at the beginning (it will be changed each time it will move) +frameOf_Pinky dw PINKY_1 + +x_ClydePosition dw 70 ; x position of Clyde at the beginning (it will be changed each time it will move) +y_ClydePosition dw 100 ; y position of Clyde at the beginning (it will be changed each time it will move) +frameOf_Clyde dw CLYDE_1 + +x_InkyPosition dw 90 ; x position of Inky at the beginning (it will be changed each time it will move) +y_InkyPosition dw 100 ; y position of Inky at the beginning (it will be changed each time it will move) +frameOf_Inky dw INKY_1 + +section .text + + + Display_PacMan: + mov bx, [x_PacManPosition] + mov ax, [y_PacManPosition] + call calculate_screen_position + + mov ax, [frameOf_PacMan] + call calculate_spritesheet_position + call draw_sprite ret + + ClearPacMan: + ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time + ;so we set the adress of the segments and the offsets + + ;set the source 'ds:si' as the backup of the screen + ;ds is already set as 0x489D where is the backup at [buffScreen] + lea si, [background_buffer]; load the effective adress (L.E.A.) of the backup in the destination offset + ;set the source 'ds:si' of the movsb function + push 0xA000 ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, [x_PacManPosition] ; define the offset destination as the same xPos, where was displayed the ghost + + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues +ret ; go back in the game loop -======= ->>>>>>> Stashed changes -calculate_screen_position: - ; Set first position on screen - ; Parameters: y coord in ax, x coord in bx - ; Result in dx - ; Override: ax, bx, dx - push bx - mov bx, SCREEN_WIDTH - mul bx - pop bx - add ax, bx - mov dx, ax + calculate_screen_position: + ; Set first position on screen + ; Parameters: y coord in ax, x coord in bx + ; Result in dx + ; Override: ax, bx, dx + push bx + mov bx, SCREEN_WIDTH + mul bx + pop bx + add ax, bx + mov dx, ax ret -calculate_spritesheet_position: - ; Set first position on spritesheet - ; Parameter: sprite ID in ax - ; Result in bx - ; Override: ax, bx - push dx - mov dx, SPRITE_SIZE * SPRITE_SIZE - mul dx - shr ax, 1 ; Because there are two pixels in a byte - mov bx, ax - pop dx + calculate_spritesheet_position: + ; Set first position on spritesheet + ; Parameter: sprite ID in ax + ; Result in bx + ; Override: ax, bx + push dx + mov dx, SPRITE_SIZE * SPRITE_SIZE + mul dx + shr ax, 1 ; Because there are two pixels in a byte + mov bx, ax + pop dx ret -draw_sprite: - ; TODO: Dynamic sprite size (DSP) - ; bx: Base position on spritesheet - ; cx: Index on sprite - ; dx: Pos on screen - - ; Decrement as increment is at the beginning of the loop - dec dx - ; Number of pixels draw - mov cx, 0x00ff ; TODO: DSP - -.draw_loop: - inc dx - inc cl ; TODO: DSP - - ; Read the color index - push cx - shr cx, 1 ; Because there are two pixels in a byte - mov di, spritesheet - add di, bx - add di, cx - int3 ; ################################ DEBUG ################################ - mov al, [ds:di] - - ; Check if the color is in the high or low nibble - pop cx - test cl, 1 ; TODO: DSP - jnz .low_byte - shr ax, 4 -.low_byte: - and ax, 0xf ; TODO: DSP - je .transparent_skip - - ; Get color from palette - mov di, palette - add di, ax - mov al, [ds:di] - - ; Set the pixel - mov di, dx - - mov [es:di], al - - ; If we need to go to the next line -.transparent_skip: - not cl - test cl, 0xf ; TODO: DSP - not cl - jne .draw_loop - add dx, SCREEN_WIDTH - SPRITE_SIZE - cmp cl, 0xff - jne .draw_loop + draw_sprite: + + + + ; TODO: Dynamic sprite size (DSP) + ; bx: Base position on spritesheet + ; cx: Index on sprite + ; dx: Pos on screen + + ; Decrement as increment is at the beginning of the loop + dec dx + ; Number of pixels draw -1 , but just to have a cx = 0000 after the first increment of the loop + mov cx, 0x00ff ; TODO: DSP + + .draw_loop: + inc dx ; position in the video memory + inc cl ; TODO: DSP ; the first execution makes cx = 0000. cl = 00, it will increment until FF + + ; Read the color index + push cx ; cx contains, in cl the pixels counter from 0 to FF + shr cx, 1 ; Because there are two pixels in a byte, cx now contains the index of the byte corresponding to this pixel in the sprite + mov di, spritesheet ; di contains the offset of the spritesheet + add di, bx ; di contains the offset of the sprite + add di, cx ; di contains the offset of the byte (from which we want to print the pixel) + int3 ; ################################ DEBUG ################################ + mov al, [ds:di] ; al contains the value of this byte (see above) + + ; Check if the color is in the high or low nibble + pop cx ; cl contains the index of the pixel in the sprite (from 00 to FF, for 256 pixels) + + test cl, 1 ; TODO: DSP ; if cl is evenor odd, we will read the high or the low nibbble + jnz .low_byte + shr ax, 4 ; we move the first nible in the second one + .low_byte: + and ax, 0xf ; TODO: DSP ; we want to keep only the second nibble (either the first or the second pixel of the byte if we shifted before or not) + ; and it also allows to set the flag, to know if the actual nibble is 0xF, so a transpaent pixel + je .transparent_skip + + ; Get color from palette + mov di, palette ; di contains the offset of the list of colors , the palette + add di, ax ; we move the offset to the Xeme color + + push 0x489D + pop ds + mov al, [ds:di] ;and store the code of this color in al + + ; Set the pixel + mov di, dx ; di contains the offset corresponding to the position in video memory of the pixel we want to write + + push 0xA000 + pop ds + mov [es:di], al ; writing in video memory + + ; If we need to go to the next line + .transparent_skip: + ;it first test if the last nibble of cl is equal to 0xF (if it is equal, ZF = 0) + not cl + test cl, 0xf ; TODO: DSP + not cl + jne .draw_loop + ; if we reached the end of the 16 bits (the last nibble is equal to 0b1111), we move the video memory writing position to the next line by adding the width of the screen + add dx, SCREEN_WIDTH - SPRITE_SIZE + ; now we check if we have finished + cmp cl, 0xff + jne .draw_loop ret \ No newline at end of file From 1641598a244fdaf5cee089bbbd36533c1f676731 Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Wed, 22 Nov 2023 17:08:27 +0100 Subject: [PATCH 22/60] Movement + automation --- src/Keyboard.asm | 2 +- src/main.asm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Keyboard.asm b/src/Keyboard.asm index 21f4109..ad14f0a 100644 --- a/src/Keyboard.asm +++ b/src/Keyboard.asm @@ -11,7 +11,7 @@ readKeyboard: int 16h cmp al, 0 je NoKey - + xor ax, ax int 16h ; Overwrite the first char in 'charDump' with received char: mov [keyPressed] ,al diff --git a/src/main.asm b/src/main.asm index 95246a8..e2b941f 100644 --- a/src/main.asm +++ b/src/main.asm @@ -37,7 +37,7 @@ gameloop: jmp gameloop ; Exit - jmp exit + ;jmp exit From 955ee17393d498d5326b95d703c08f8cfc73ea30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20CHARTIER?= Date: Wed, 22 Nov 2023 21:10:41 +0100 Subject: [PATCH 23/60] Fix keyboard buffer reading Also changed the read keys to be the arrow keys --- src/Keyboard.asm | 86 ++++++++++++++++++----------------------------- src/constants.asm | 6 ++++ src/main.asm | 6 ++++ src/sprites.asm | 1 - 4 files changed, 44 insertions(+), 55 deletions(-) diff --git a/src/Keyboard.asm b/src/Keyboard.asm index ad14f0a..6124b9b 100644 --- a/src/Keyboard.asm +++ b/src/Keyboard.asm @@ -5,68 +5,46 @@ section .data section .text readKeyboard: - ; Read next key in buffer: - xor ax, ax + ; Don't do anything if no key was pressed mov ah, 01h int 16h - cmp al, 0 - je NoKey - xor ax, ax - int 16h - ; Overwrite the first char in 'charDump' with received char: - mov [keyPressed] ,al - - cmp byte [keyPressed] ,113 - je ChangeKeyL + jz .skipBufferRead - cmp byte [keyPressed] ,100 - je ChangeKeyR - - cmp byte [keyPressed] ,122 - je ChangeKeyU + ; Read last key in buffer: + .keepReadingBuffer: + int3 + mov ah, 00h + int 16h + mov bx, ax + mov ah, 01h + int 16h + jnz .keepReadingBuffer - cmp byte [keyPressed] ,115 - je ChangeKeyD + ; Overwrite the first char in 'charDump' with received char: + mov ax, [keyPressed] + mov [oldKeyPressed], ax + mov [keyPressed], bh - ; Compare the red char with ESCAPE (ASCII #27) - cmp byte [keyPressed] ,27 - je exit ; Loop while not "escape". + .skipBufferRead: - xor ax, ax -NoKey: - ret + ; Exit if ESCAPE + cmp byte [keyPressed], EXIT_KEY_SCANCODE + je exit -ChangeKeyL: - pusha - mov bx, [keyPressed] - mov [oldKeyPressed], bx - popa - jmp MoveLeft + ; Left + cmp byte [keyPressed], LEFT_KEY_SCANCODE + je MoveLeft -ChangeKeyR: - pusha - mov bx, [keyPressed] - mov [oldKeyPressed], bx - popa - jmp MoveRight + ; Right + cmp byte [keyPressed], RIGHT_KEY_SCANCODE + je MoveRight -ChangeKeyU: - pusha - mov bx, [keyPressed] - mov [oldKeyPressed], bx - popa - jmp MoveUp + ; Up + cmp byte [keyPressed], UP_KEY_SCANCODE + je MoveUp -ChangeKeyD: - pusha - mov bx, [keyPressed] - mov [oldKeyPressed], bx - popa - jmp MoveDown + ; Down + cmp byte [keyPressed], DOWN_KEY_SCANCODE + je MoveDown -exit: - ; Wait for key and terminate the program - mov al,01h ; Clear buffer - mov ah,0ch ; Read key - int 21h ; Execute - int 20h ; Exit \ No newline at end of file + ret diff --git a/src/constants.asm b/src/constants.asm index b82dece..335ad4b 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -2,6 +2,12 @@ %define SCREEN_HEIGHT 200 %define SPRITE_SIZE 16 +%define UP_KEY_SCANCODE 48h +%define DOWN_KEY_SCANCODE 50h +%define LEFT_KEY_SCANCODE 4bh +%define RIGHT_KEY_SCANCODE 4dh +%define EXIT_KEY_SCANCODE 01h + %define BLINKY_1 0 %define BLINKY_2 1 %define PINKY_1 2 diff --git a/src/main.asm b/src/main.asm index e2b941f..1f9c967 100644 --- a/src/main.asm +++ b/src/main.asm @@ -41,3 +41,9 @@ gameloop: +exit: + ; Wait for key and terminate the program + mov al,01h ; Clear buffer + mov ah,0ch ; Read key + int 21h ; Execute + int 20h ; Exit diff --git a/src/sprites.asm b/src/sprites.asm index 5ce8041..0ec5f1b 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -45,7 +45,6 @@ draw_sprite: mov di, spritesheet add di, bx add di, cx - int3 ; ################################ DEBUG ################################ mov al, [ds:di] ; Check if the color is in the high or low nibble From 751ce73f6eba7c2964f87db8f58d010cb8d5512e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Mon, 27 Nov 2023 11:25:18 +0100 Subject: [PATCH 24/60] =?UTF-8?q?bloqu=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if you set the width to 32, the height to 20 in constants , it will work in the turbo debuger. (run entry) --- src/initialization.asm | 13 ++-- src/main.asm | 29 ++++++-- src/sprites.asm | 164 +++++++++++++++++++---------------------- 3 files changed, 105 insertions(+), 101 deletions(-) diff --git a/src/initialization.asm b/src/initialization.asm index d70e19f..aad0c3f 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -10,6 +10,7 @@ section .data section .text GetClockAndCompare: + pusha mov ax, 0 int 1ah ; BIOS clock read @@ -47,19 +48,19 @@ section .text ClearScreen: ;clear the screen by filling it with a unique color (stored in al) - mov al, 0x09 ; color to fill the screen (white = 0x0F, black = 0x00) + mov al, 0x85 ; color to fill the screen (white = 0x0F, black = 0x00) call FillScreen ret BuildBackgroundBuffer: ;source of stosb 'al' - mov al, 0x78 ; color of the background (simulate the maze) (to be change) + mov al, 0x36 ; color of the background (simulate the maze) (to be change) ;destination of stosb 'es:di' - ;push ds ; adress of the data segment (even if 'es' probably already contains '0x489D') - ;pop es + push ds ; adress of the data segment (even if 'es' probably already contains '0x489D') + pop es lea di, [background_buffer] ; load the effective adress (L.E.A.) of the backup in the destination offset 'di' - + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for rep rep stosb ; to copy al into each byte of the target adress es:di byte per byte @@ -83,7 +84,7 @@ section .text mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for rep rep movsb ; 'movsb' writes byte per byte the content from 'ds:si' to 'es:di', increasing both si and di each time it is executed - + ret FirstDisplayPacMan: diff --git a/src/main.asm b/src/main.asm index a8a3984..7775492 100644 --- a/src/main.asm +++ b/src/main.asm @@ -1,17 +1,24 @@ section .text start: - + call SetVideoMode call ClearScreen - call BuildBackgroundBuffer ; !!!!!THE ERROR IS IN THIS FUNCTION!!!!!! + + + call BuildBackgroundBuffer + call DisplayMaze - ;call FirstDisplayGhosts + jmp exit + call FirstDisplayPacMan + + + + ;call FirstDisplayGhosts - jmp exit + - pusha ; for the clock, maybe not usefull ;----------------------------------------------------------------------------------------- ;THE GAME LOOP @@ -28,4 +35,14 @@ section .text jmp gameloop ;----------------------------------------------------------------------------------------- -exit: \ No newline at end of file +exit: +;reset the keyboard buffer and then wait for a keypress : +mov ax, 0C01h ; +int 21h + +;dos box default video mode +mov ax, 03h +int 21h + + +int 20h ;quit \ No newline at end of file diff --git a/src/sprites.asm b/src/sprites.asm index 6bd651b..1ba88ce 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -27,11 +27,11 @@ section .text Display_PacMan: - mov bx, [x_PacManPosition] - mov ax, [y_PacManPosition] + mov bx, 0;[x_PacManPosition] + mov ax, 0;[y_PacManPosition] call calculate_screen_position - mov ax, [frameOf_PacMan] + mov ax, PACMAN_RIGHT_2;[frameOf_PacMan] call calculate_spritesheet_position call draw_sprite ret @@ -64,94 +64,80 @@ ret ; go back in the game loop calculate_screen_position: - ; Set first position on screen - ; Parameters: y coord in ax, x coord in bx - ; Result in dx - ; Override: ax, bx, dx - push bx - mov bx, SCREEN_WIDTH - mul bx - pop bx - add ax, bx - mov dx, ax + ; Set first position on screen + ; Parameters: y coord in ax, x coord in bx + ; Result in dx + ; Override: ax, bx, dx + push bx + mov bx, SCREEN_WIDTH + mul bx + pop bx + add ax, bx + mov dx, ax ret - calculate_spritesheet_position: - ; Set first position on spritesheet - ; Parameter: sprite ID in ax - ; Result in bx - ; Override: ax, bx - push dx - mov dx, SPRITE_SIZE * SPRITE_SIZE - mul dx - shr ax, 1 ; Because there are two pixels in a byte - mov bx, ax - pop dx +calculate_spritesheet_position: + ; Set first position on spritesheet + ; Parameter: sprite ID in ax + ; Result in bx + ; Override: ax, bx + push dx + mov dx, SPRITE_SIZE * SPRITE_SIZE + mul dx + shr ax, 1 ; Because there are two pixels in a byte + mov bx, ax + pop dx ret - draw_sprite: - - - - ; TODO: Dynamic sprite size (DSP) - ; bx: Base position on spritesheet - ; cx: Index on sprite - ; dx: Pos on screen - - ; Decrement as increment is at the beginning of the loop - dec dx - ; Number of pixels draw -1 , but just to have a cx = 0000 after the first increment of the loop - mov cx, 0x00ff ; TODO: DSP - - .draw_loop: - inc dx ; position in the video memory - inc cl ; TODO: DSP ; the first execution makes cx = 0000. cl = 00, it will increment until FF - - ; Read the color index - push cx ; cx contains, in cl the pixels counter from 0 to FF - shr cx, 1 ; Because there are two pixels in a byte, cx now contains the index of the byte corresponding to this pixel in the sprite - mov di, spritesheet ; di contains the offset of the spritesheet - add di, bx ; di contains the offset of the sprite - add di, cx ; di contains the offset of the byte (from which we want to print the pixel) - int3 ; ################################ DEBUG ################################ - mov al, [ds:di] ; al contains the value of this byte (see above) - - ; Check if the color is in the high or low nibble - pop cx ; cl contains the index of the pixel in the sprite (from 00 to FF, for 256 pixels) - - test cl, 1 ; TODO: DSP ; if cl is evenor odd, we will read the high or the low nibbble - jnz .low_byte - shr ax, 4 ; we move the first nible in the second one - .low_byte: - and ax, 0xf ; TODO: DSP ; we want to keep only the second nibble (either the first or the second pixel of the byte if we shifted before or not) - ; and it also allows to set the flag, to know if the actual nibble is 0xF, so a transpaent pixel - je .transparent_skip - - ; Get color from palette - mov di, palette ; di contains the offset of the list of colors , the palette - add di, ax ; we move the offset to the Xeme color - - push 0x489D - pop ds - mov al, [ds:di] ;and store the code of this color in al - - ; Set the pixel - mov di, dx ; di contains the offset corresponding to the position in video memory of the pixel we want to write - - push 0xA000 - pop ds - mov [es:di], al ; writing in video memory - - ; If we need to go to the next line - .transparent_skip: - ;it first test if the last nibble of cl is equal to 0xF (if it is equal, ZF = 0) - not cl - test cl, 0xf ; TODO: DSP - not cl - jne .draw_loop - ; if we reached the end of the 16 bits (the last nibble is equal to 0b1111), we move the video memory writing position to the next line by adding the width of the screen - add dx, SCREEN_WIDTH - SPRITE_SIZE - ; now we check if we have finished - cmp cl, 0xff - jne .draw_loop +draw_sprite: + ; TODO: Dynamic sprite size (DSP) + ; bx: Base position on spritesheet + ; cx: Index on sprite + ; dx: Pos on screen + + ; Decrement as increment is at the beginning of the loop + dec dx + ; Number of pixels draw + mov cx, 0x00ff ; TODO: DSP + +.draw_loop: + inc dx + inc cl ; TODO: DSP + + ; Read the color index + push cx + shr cx, 1 ; Because there are two pixels in a byte + mov di, spritesheet + add di, bx + add di, cx + ;int3 ; ################################ DEBUG ################################ + mov al, [ds:di] + + ; Check if the color is in the high or low nibble + pop cx + test cl, 1 ; TODO: DSP + jnz .low_byte + shr ax, 4 +.low_byte: + and ax, 0xf ; TODO: DSP + je .transparent_skip + + ; Get color from palette + mov di, palette + add di, ax + mov al, [ds:di] + + ; Set the pixel + mov di, dx + mov [es:di], al + + ; If we need to go to the next line +.transparent_skip: + not cl + test cl, 0xf ; TODO: DSP + not cl + jne .draw_loop + add dx, SCREEN_WIDTH - SPRITE_SIZE + cmp cl, 0xff + jne .draw_loop ret \ No newline at end of file From 6801dd18ff48ebbe3b6e4f5eb100ae7da7d2062d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:35:10 +0100 Subject: [PATCH 25/60] fixed the problem of working only in turbo debugger using cs->ds before movsb and not 0x489D->ds also tried to have a symbol map also deleted the empty files --- src/collider.asm | 0 src/constants.asm | 2 +- src/entry.asm | 4 +-- src/initialization.asm | 4 +-- src/keyboard.asm | 0 src/keyboard_scanner.asm | 61 ++++++++++++++++++++++++++++++++++++++++ src/main.asm | 1 + src/scoring.asm | 0 8 files changed, 66 insertions(+), 6 deletions(-) delete mode 100644 src/collider.asm delete mode 100644 src/keyboard.asm create mode 100644 src/keyboard_scanner.asm delete mode 100644 src/scoring.asm diff --git a/src/collider.asm b/src/collider.asm deleted file mode 100644 index e69de29..0000000 diff --git a/src/constants.asm b/src/constants.asm index b82dece..7c13486 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -1,5 +1,5 @@ %define SCREEN_WIDTH 320 -%define SCREEN_HEIGHT 200 +%define SCREEN_HEIGHT 177 %define SPRITE_SIZE 16 %define BLINKY_1 0 diff --git a/src/entry.asm b/src/entry.asm index 1d07cc7..4fa9c41 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -1,3 +1,4 @@ +[map symbols pac.map] org 100h jmp start @@ -6,10 +7,7 @@ jmp start %include "sprites.asm" %include "initialization.asm" -%include "keyboard.asm" -%include "collider.asm" %include "move_sprites.asm" -%include "scoring.asm" %include "main.asm" diff --git a/src/initialization.asm b/src/initialization.asm index aad0c3f..a9131a8 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -48,7 +48,7 @@ section .text ClearScreen: ;clear the screen by filling it with a unique color (stored in al) - mov al, 0x85 ; color to fill the screen (white = 0x0F, black = 0x00) + mov al, 0x90 ; color to fill the screen (white = 0x0F, black = 0x00) call FillScreen ret @@ -73,7 +73,7 @@ section .text ;HEART OF THE FUNCTION : 'movsb' writes byte per byte the content from 'ds:si' to 'es:di', increasing both si and di each time it is executed ;set source 'ds:si' - push 0x489D ; adress of the data segment + push cs ; adress of the data segment pop ds lea si, [background_buffer] ; load the effective adress (L.E.A.) of the dynamic background buffer diff --git a/src/keyboard.asm b/src/keyboard.asm deleted file mode 100644 index e69de29..0000000 diff --git a/src/keyboard_scanner.asm b/src/keyboard_scanner.asm new file mode 100644 index 0000000..0785a2f --- /dev/null +++ b/src/keyboard_scanner.asm @@ -0,0 +1,61 @@ +[map symbols exo.map] +org 100h + +section .bss + +keyboard_map resb 256 +old_interrupt_segment resb 1 +old_interrupt_offset resb 1 + +section .text + + mainloop: + call keyboard_initialization + call keyboard_run + call keyboard_done + + jmp mainloop + + keyboard_initialization: + mov ah, 35h ; select the function of 21h that get the interrupt value of a vector + mov al, 09h ; the int XX function we want the result stored in es:bx (here vector number 9) + int 21h ; call the interruption + ;save the result in memory + mov ax, es + mov [old_interrupt_segment], ax + mov [old_interrupt_offset], bx + + ret + + keyboard_run: + mov ax, 2509h + + ret + + keyboard_done: + mov ax, 2509h + + push ds + mov ax, [old_interrupt_segment] + mov ds, ax + mov dx, [old_interrupt_offset] + int 21h + + pop ds + ret + + keyboard_handler: + pusha + in al, 60h + mov bl, al + and al, 0b01111111 ; save the number of the scan code + and bl, 0b10000000 ; save the state of the key (pressed or released) + mov [cs:keyboard_map], bl + mov al, 0x20 + out 0x20, al + popa + iret ; interrupt return + + + exit: + int 20h ;quit \ No newline at end of file diff --git a/src/main.asm b/src/main.asm index 7775492..f60736e 100644 --- a/src/main.asm +++ b/src/main.asm @@ -1,3 +1,4 @@ + section .text start: diff --git a/src/scoring.asm b/src/scoring.asm deleted file mode 100644 index e69de29..0000000 From e2fef5274ec836e6babea86726cc6f566a4e8a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Wed, 29 Nov 2023 00:34:27 +0100 Subject: [PATCH 26/60] fixed moving ghost with 1 little bug the ghost is moving quite well, using now a background buffer to restore, and a screen buffer to update the screen after calculation. Also, now, the ghost change his eyes, thanks to the change pos function, you'll see my cook. BUT!!!! black pixel are randomly appearing after the ghost passage when it comes to the top of the screen only. very weird ! --- src/constants.asm | 5 +- src/entry.asm | 2 +- src/heapLibrary.inc | 20 ++++++++ src/initialization.asm | 102 ++++++++++++++++++++++++++++++--------- src/keyboard_scanner.asm | 61 ----------------------- src/main.asm | 37 +++++--------- src/move_sprites.asm | 48 ++++++++++++------ src/pac.map | 94 ++++++++++++++++++++++++++++++++++++ src/sprites.asm | 98 ++++++++++++++++++++++++++++--------- 9 files changed, 316 insertions(+), 151 deletions(-) create mode 100644 src/heapLibrary.inc delete mode 100644 src/keyboard_scanner.asm create mode 100644 src/pac.map diff --git a/src/constants.asm b/src/constants.asm index 7c13486..72807c3 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -1,5 +1,5 @@ %define SCREEN_WIDTH 320 -%define SCREEN_HEIGHT 177 +%define SCREEN_HEIGHT 200 %define SPRITE_SIZE 16 %define BLINKY_1 0 @@ -51,5 +51,8 @@ section .data + + + palette db 0, 44, 40, 15, 66, 33, 84, 52, 88, 48, 78, 3, 65, 0 spritesheet dd 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x20222002, 0x20022202, 0x20020002, 0x20002002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22202202, 0x20220222, 0x02002200, 0x00220020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x60666006, 0x60066606, 0x60060006, 0x60006006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66606606, 0x60660666, 0x06006600, 0x00660060, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x70777007, 0x70077707, 0x70070007, 0x70007007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77707707, 0x70770777, 0x07007700, 0x00770070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x40444004, 0x40044404, 0x40040004, 0x40004004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44404404, 0x40440444, 0x04004400, 0x00440040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x50555005, 0x50055505, 0x50050005, 0x50005005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x55505505, 0x50550555, 0x05005500, 0x00550050, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x30333003, 0x30033303, 0x30030003, 0x30003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x33303303, 0x30330333, 0x03003300, 0x00330030, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x30030000, 0x00300300, 0x33330000, 0x00333300, 0x55330000, 0x00553300, 0x55330000, 0x00553300, 0x30030000, 0x00300300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300300, 0x00003003, 0x00333300, 0x00003333, 0x00335500, 0x00003355, 0x00335500, 0x00003355, 0x00300300, 0x00003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00550000, 0x00005500, 0x30550300, 0x00305503, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x00330000, 0x00003300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00330000, 0x00003300, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x30550300, 0x00305503, 0x00550000, 0x00005500, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00000011, 0x11111100, 0x00000010, 0x11111100, 0x00000000, 0x10111101, 0x00000000, 0x00111101, 0x00000000, 0x00101101, 0x00000000, 0x00111101, 0x00000000, 0x10111101, 0x00000000, 0x11111100, 0x00000000, 0x11111100, 0x00000010, 0x11110100, 0x00000011, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00001011, 0x11111101, 0x00000000, 0x00101101, 0x00000000, 0x11111101, 0x00000000, 0x11111101, 0x00001011, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100100, 0x00001100, 0x00101100, 0x00101100, 0x00111100, 0x00101101, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11010000, 0x00001111, 0x11000000, 0x00101111, 0x01000000, 0x00101111, 0x00000000, 0x00111111, 0x00000000, 0x00111101, 0x00000000, 0x00111100, 0x00000000, 0x00111101, 0x00000000, 0x00111111, 0x01000000, 0x00101111, 0x11000000, 0x00101111, 0x11010000, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110000, 0x00111111, 0x01000000, 0x00111111, 0x00000000, 0x00111100, 0x01000000, 0x00111111, 0x11110000, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00101101, 0x00111100, 0x00001101, 0x00110100, 0x00001001, 0x00110000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x00111100, 0x00101101, 0x00101100, 0x00101100, 0x00100100, 0x00001100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00cc0000, 0x00000000, 0x00cccc00, 0x00000000, 0x00000ccc, 0x0c000000, 0x00000c00, 0xc0220200, 0x0000c000, 0x222c2200, 0x0000000c, 0x20222200, 0x0000222c, 0x02222300, 0x0020222c, 0x02322200, 0x00202222, 0x02220200, 0x00202232, 0x02000000, 0x00202223, 0x00000000, 0x00002222, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x93990000, 0x00009099, 0x99290200, 0x00002299, 0x29222200, 0x00202322, 0x22222300, 0x00202223, 0x23232200, 0x00202222, 0x22222200, 0x00203222, 0x23320200, 0x00002222, 0x22220200, 0x00002222, 0x32220000, 0x00000023, 0x22020000, 0x00000022, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00009009, 0x0c000000, 0x00909999, 0x0c000000, 0x00009909, 0xcc440000, 0x000044c4, 0x4c440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44440400, 0x00404444, 0x44440400, 0x00404444, 0x44040000, 0x00004044, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000c0, 0x0c220200, 0x00002202, 0x2c222200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222322, 0x22222200, 0x00222322, 0x22220200, 0x00203222, 0x22220200, 0x00202222, 0x22220000, 0x00002222, 0x20020000, 0x00002022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00b00000, 0x00000000, 0xbb0b0000, 0x000000bb, 0x0b000000, 0x00000000, 0x93000000, 0x00000090, 0x9b990000, 0x00009099, 0xb9b30900, 0x0000b999, 0x999b0900, 0x0000993b, 0x99b99300, 0x0090b9b9, 0x3b999b00, 0x00903b99, 0x99b99300, 0x009099b9, 0x3b9b0900, 0x0000993b, 0xb9990900, 0x0000b999, 0x999b0000, 0x0000909b, 0x99000000, 0x000000b0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x22005000, 0x00500020, 0x22025000, 0x00500022, 0x12225100, 0x00502112, 0x12115100, 0x00501111, 0x11115500, 0x00501511, 0x01510500, 0x00005501, 0x01550000, 0x00005005, 0x01050000, 0x00000005, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000010, 0x1d010000, 0x000010d1, 0x11110000, 0x00001111, 0xd1110000, 0x00001111, 0x111d0000, 0x00001111, 0x111d0100, 0x00101111, 0x111d0100, 0x00101111, 0x11110100, 0x00101111, 0x11d11100, 0x00111111, 0x11d11100, 0x00111111, 0x11111100, 0x00111111, 0xaaaa1a00, 0x00a1aa33, 0xaaaa0a00, 0x00a0aa33, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xaa000000, 0x000000a0, 0x00aa0000, 0x0000a00a, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x3d000000, 0x000000d0, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00001111, 0x10110100, 0x00101111, 0x10111100, 0x10111111, 0x10111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001011, 0x10110000, 0x00111111, 0x10111101, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001111, 0x10110100, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11110000, 0x00001011, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11111101, 0x00111111, 0x11111111, 0x10111111, 0x10111101, 0x00111111, 0x00110100, 0x00001101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11110100, 0x00001111, 0x11111101, 0x00111111, 0x10111101, 0x00111111, 0x00111100, 0x00101101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11010000, 0x00000011, 0x10000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000001, 0x10000000, 0x00000010, 0x00000100, 0x00000100, 0x00100000, 0x00001000, 0x00000000, 0x00000000, 0x00001100, 0x00100100, 0x00000000, 0x00000000, 0x00100000, 0x00001000, 0x00000100, 0x00000100, 0x10000000, 0x00000010, 0x00010000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x08000000, 0x00000080, 0x08000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x88000000, 0x00000088, 0x88080000, 0x00008088, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88080000, 0x00008088, 0x88000000, 0x00000088, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/src/entry.asm b/src/entry.asm index 4fa9c41..dc4f14f 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -4,7 +4,7 @@ org 100h jmp start %include "constants.asm" - +%include "heapLibrary.inc" %include "sprites.asm" %include "initialization.asm" %include "move_sprites.asm" diff --git a/src/heapLibrary.inc b/src/heapLibrary.inc new file mode 100644 index 0000000..1027415 --- /dev/null +++ b/src/heapLibrary.inc @@ -0,0 +1,20 @@ +; functions to allocate and then use the heap (which is a part of memory located out of the 64kio of memory containing the code, data, bss section) + +section .bss + nextFreeSegment resw 1 + +section .text + heapInit: + mov ax, cs ; we get the adress of the beginning of the code, data, etc... (64Kio) + add ax,1000h ; we jump to after the end of this window (1000h = 64Kio = 65 536) + mov cs:[nextFreeSegment],ax ; the nextFreeSegment variable, in bss, contains the segment adress of the beginning of the 'heap' + ret + + ; this function will allocate a piece of the heap : + ; in ax, put how many paragraphs (16 bits) (cause a paragraph is a segment with the offset=0 , and between two segment at the offset 0, there are 16 bits) + ; the segment corresponding to this space allocated is moved in bx + ; then, we change the value of the next segment available, at the end at the one just created + heapAllocParagraph: + mov bx, cs:[nextFreeSegment] ; we + add cs:[nextFreeSegment], ax + ret diff --git a/src/initialization.asm b/src/initialization.asm index a9131a8..d669771 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -1,6 +1,7 @@ section .bss - background_buffer resb SCREEN_WIDTH*SCREEN_HEIGHT ; where is stored the dynamic background (dynamic cuz gums are disappearing). Used to restore the screen after a ghost's passage + BackgroundBufferSegment resw 1 ; where is stored the dynamic background (dynamic cuz gums are disappearing). Used to restore the screen after a ghost's passage + ScreenBufferSegment resw 1 section .data @@ -22,6 +23,33 @@ section .text ret + BuildScreenBuffer: + call heapInit + mov ax, (SCREEN_HEIGHT*SCREEN_WIDTH/16) ; in ax, the number of paragraph to allocate (1 para = 16bits) + call heapAllocParagraph + mov [ScreenBufferSegment],bx + + ret + + UpdateScreen: + push ds + push es + + mov ax,cs:[ScreenBufferSegment] + mov ds,ax ; backBuffer segment adress + mov ax,0xa000 ; video memory segment adress + mov es,ax + xor si,si ; beginning of the backbuffer (0) + xor di,di ; beginning of the video memory (0) + mov cx, SCREEN_HEIGHT*SCREEN_WIDTH + rep movsb + + pop es + pop ds + ret + + + SetVideoMode: mov ah, 00h ; chose the video mode setting function at the 10h interruption @@ -29,71 +57,97 @@ section .text int 10h ; call the dos interupt regarding to ax ; write the adress of video memory (A000) in the register which contains the address of the destination segment used by the automatic data transfer functions (like movs, stos, ...) - push 0xA000 + push word [ScreenBufferSegment] pop es ret + ClearScreen: + ;clear the screen by filling it with a unique color (stored in al) + mov al, 0x83 ; color to fill the screen (white = 0x0F, black = 0x00) + call FillScreen + ret + FillScreen: ;stosb copy byte per byte the content from 'al' to 'es:di', di increasing. ;set the destination 'es:di' : - push 0xA000 ; video memory adress = 0xA000 + push word [ScreenBufferSegment] ; video memory adress = 0xA000 pop es ; define it as the adress of the destination segment mov di, 0 ; begin the offset (pixel position) at 0 mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; how many times 'rep' action will be repeated rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 ret - ClearScreen: - ;clear the screen by filling it with a unique color (stored in al) - mov al, 0x90 ; color to fill the screen (white = 0x0F, black = 0x00) - call FillScreen - ret + BuildBackgroundBuffer: + mov ax, (SCREEN_HEIGHT*SCREEN_WIDTH/16) ; in ax, the number of paragraph to allocate (1 para = 16bits) + call heapAllocParagraph + mov [BackgroundBufferSegment],bx + + ret + + MazeToBGbuffer: ;source of stosb 'al' mov al, 0x36 ; color of the background (simulate the maze) (to be change) ;destination of stosb 'es:di' - push ds ; adress of the data segment (even if 'es' probably already contains '0x489D') - pop es - lea di, [background_buffer] ; load the effective adress (L.E.A.) of the backup in the destination offset 'di' - + push word [BackgroundBufferSegment] + pop es + xor di,di + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for rep rep stosb ; to copy al into each byte of the target adress es:di byte per byte ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning - ret DisplayMaze: - + push es + push ds ;HEART OF THE FUNCTION : 'movsb' writes byte per byte the content from 'ds:si' to 'es:di', increasing both si and di each time it is executed + ;set destination 'es:di' + push word [ScreenBufferSegment] + pop es + xor di, di + ;set source 'ds:si' - push cs ; adress of the data segment + push word [BackgroundBufferSegment] pop ds - lea si, [background_buffer] ; load the effective adress (L.E.A.) of the dynamic background buffer + xor si, si - ;set destination 'es:di' - push 0xA000 ; adress of the video memory - pop es - mov di, 0 ; from the beginning of the screen + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for rep rep movsb ; 'movsb' writes byte per byte the content from 'ds:si' to 'es:di', increasing both si and di each time it is executed + pop ds + pop es ret FirstDisplayPacMan: - ;mov x_PacManPosition, 30 - ;mov y_PacManPosition, 30 - ;mov frameOf_PacMan, PACMAN_FULL + mov word [x_PacManPosition], 30 + mov word [y_PacManPosition], 30 + mov word [frameOf_PacMan], PACMAN_RIGHT_2 call Display_PacMan - + ret + + FirstDisplayGhosts: + ;PINKY ONLY + + mov word [x_PinkyPosition], 30 + mov word [y_PinkyPosition], 30 + mov word [frameOf_Pinky], PINKY_1 + mov word [frameOf_Pinky_eyes], EYES_UP + call Display_Pinky + mov word [x_PinkyVelocity], 1 + mov word [y_PinkyVelocity], -1 + + ret \ No newline at end of file diff --git a/src/keyboard_scanner.asm b/src/keyboard_scanner.asm deleted file mode 100644 index 0785a2f..0000000 --- a/src/keyboard_scanner.asm +++ /dev/null @@ -1,61 +0,0 @@ -[map symbols exo.map] -org 100h - -section .bss - -keyboard_map resb 256 -old_interrupt_segment resb 1 -old_interrupt_offset resb 1 - -section .text - - mainloop: - call keyboard_initialization - call keyboard_run - call keyboard_done - - jmp mainloop - - keyboard_initialization: - mov ah, 35h ; select the function of 21h that get the interrupt value of a vector - mov al, 09h ; the int XX function we want the result stored in es:bx (here vector number 9) - int 21h ; call the interruption - ;save the result in memory - mov ax, es - mov [old_interrupt_segment], ax - mov [old_interrupt_offset], bx - - ret - - keyboard_run: - mov ax, 2509h - - ret - - keyboard_done: - mov ax, 2509h - - push ds - mov ax, [old_interrupt_segment] - mov ds, ax - mov dx, [old_interrupt_offset] - int 21h - - pop ds - ret - - keyboard_handler: - pusha - in al, 60h - mov bl, al - and al, 0b01111111 ; save the number of the scan code - and bl, 0b10000000 ; save the state of the key (pressed or released) - mov [cs:keyboard_map], bl - mov al, 0x20 - out 0x20, al - popa - iret ; interrupt return - - - exit: - int 20h ;quit \ No newline at end of file diff --git a/src/main.asm b/src/main.asm index f60736e..4a19649 100644 --- a/src/main.asm +++ b/src/main.asm @@ -2,33 +2,33 @@ section .text start: - call SetVideoMode - call ClearScreen - - - call BuildBackgroundBuffer + call BuildScreenBuffer ; set of functions allowing to write not directly in the video memory but in a buffer + ;call ClearScreen + call BuildBackgroundBuffer + call MazeToBGbuffer call DisplayMaze - jmp exit + ;call FirstDisplayPacMan + call FirstDisplayGhosts + - call FirstDisplayPacMan - ;call FirstDisplayGhosts - + ;----------------------------------------------------------------------------------------- ;THE GAME LOOP gameloop: ;------------------------------------------------- - - call GetClockAndCompare - - call Move_PacMan + + call ClearPinky + call changePinkyPosition + call Display_Pinky + call UpdateScreen ;------------------------------------------------- @@ -36,14 +36,3 @@ section .text jmp gameloop ;----------------------------------------------------------------------------------------- -exit: -;reset the keyboard buffer and then wait for a keypress : -mov ax, 0C01h ; -int 21h - -;dos box default video mode -mov ax, 03h -int 21h - - -int 20h ;quit \ No newline at end of file diff --git a/src/move_sprites.asm b/src/move_sprites.asm index e11fd8f..942359c 100644 --- a/src/move_sprites.asm +++ b/src/move_sprites.asm @@ -19,23 +19,39 @@ y_InkyVelocity dw 0 ; Inky's translation vector on y axis (px/screen update) (if section .text -changePos: +changePinkyPosition: ;switch the direction if the ghost reached a side of the screen - cmp word [x_PacManPosition], SCREEN_WIDTH - SPRITE_SIZE - jb .noflip - neg word [x_PacManVelocity] - .noflip: + cmp word [x_PinkyPosition], SCREEN_WIDTH - SPRITE_SIZE + jb .noXflip + neg word [x_PinkyVelocity] + mov word [frameOf_Pinky_eyes], EYES_LEFT + cmp word [x_PinkyVelocity], 1 + jne .noEyesRight + mov word [frameOf_Pinky_eyes], EYES_RIGHT + .noEyesRight: + .noXflip: + + cmp word [y_PinkyPosition], SCREEN_HEIGHT - SPRITE_SIZE + jb .noYflip + neg word [y_PinkyVelocity] + mov word [frameOf_Pinky_eyes], EYES_UP + cmp word [y_PinkyVelocity], 1 + jne .noEyesDown + mov word [frameOf_Pinky_eyes], EYES_DOWN + .noEyesDown: + .noYflip: ;inc/decremente the position - mov bx, [x_PacManPosition] - add bx, [x_PacManVelocity] - mov [x_PacManPosition], bx -ret + mov bx, [x_PinkyPosition] + add bx, [x_PinkyVelocity] + mov [x_PinkyPosition], bx + + mov ax, [y_PinkyPosition] + add ax, [y_PinkyVelocity] + mov [y_PinkyPosition], ax + -Move_PacMan: + + - call ClearPacMan - mov bx, 1 - mov [x_PacManVelocity], bx - call changePos - call Display_PacMan -ret \ No newline at end of file + +ret diff --git a/src/pac.map b/src/pac.map new file mode 100644 index 0000000..b0f15e7 --- /dev/null +++ b/src/pac.map @@ -0,0 +1,94 @@ + +- NASM Map file --------------------------------------------------------------- + +Source file: entry.asm +Output file: C:\Users\BenoitDEKEYN\Desktop\Projets\PacMan\algosup-workshop-master\bin\prog.com + +-- Symbols -------------------------------------------------------------------- + +---- No Section --------------------------------------------------------------- + +Value Name +0000F9FE base +0000FA04 old_time + + +---- Section .text ------------------------------------------------------------ + +Real Virtual Name + 103 103 heapInit + 10D 10D heapAllocParagraph + 118 118 Display_PacMan + 12C 12C Display_Pinky + 14B 14B ClearPacMan + 156 156 ClearPinky + 161 161 ClearSprite + 179 179 ClearSprite.eachLine + 188 188 calculate_screen_position + 194 194 calculate_spritesheet_position + 1A0 1A0 draw_sprite + 1A5 1A5 draw_sprite.draw_loop + 1BE 1BE draw_sprite.low_byte + 1D5 1D5 draw_sprite.transparent_skip + 1E9 1E9 GetClockAndCompare + 1FD 1FD BuildScreenBuffer + 20B 20B UpdateScreen + 224 224 SetVideoMode + 230 230 ClearScreen + 236 236 FillScreen + 244 244 BuildBackgroundBuffer + 24F 24F MazeToBGbuffer + 25E 25E DisplayMaze + 276 276 FirstDisplayPacMan + 28C 28C FirstDisplayGhosts + 2B4 2B4 changePinkyPosition + 2D3 2D3 changePinkyPosition.noEyesRight + 2D3 2D3 changePinkyPosition.noXflip + 2F2 2F2 changePinkyPosition.noEyesDown + 2F2 2F2 changePinkyPosition.noYflip + 309 309 start + 31B 31B gameloop + +---- Section .data ------------------------------------------------------------ + +Real Virtual Name + 32C 32C palette + 33A 33A spritesheet + 233A 233A x_PacManPosition + 233C 233C y_PacManPosition + 233E 233E frameOf_PacMan + 2340 2340 afraid + 2341 2341 x_BlinkyPosition + 2343 2343 y_BlinkyPosition + 2345 2345 frameOf_Blinky + 2347 2347 frameOf_Blinky_eyes + 2349 2349 x_PinkyPosition + 234B 234B y_PinkyPosition + 234D 234D frameOf_Pinky + 234F 234F frameOf_Pinky_eyes + 2351 2351 x_ClydePosition + 2353 2353 y_ClydePosition + 2355 2355 frameOf_Clyde + 2357 2357 frameOf_Clyde_eyes + 2359 2359 x_InkyPosition + 235B 235B y_InkyPosition + 235D 235D frameOf_Inky + 235F 235F frameOf_Inky_eyes + 2361 2361 x_PacManVelocity + 2363 2363 y_PacManVelocity + 2365 2365 x_BlinkyVelocity + 2367 2367 y_BlinkyVelocity + 2369 2369 x_PinkyVelocity + 236B 236B y_PinkyVelocity + 236D 236D x_ClydeVelocity + 236F 236F y_ClydeVelocity + 2371 2371 x_InkyVelocity + 2373 2373 y_InkyVelocity + +---- Section .bss ------------------------------------------------------------- + +Real Virtual Name + 2378 2378 nextFreeSegment + 237A 237A BackgroundBufferSegment + 237C 237C ScreenBufferSegment + diff --git a/src/sprites.asm b/src/sprites.asm index 1ba88ce..1e5f88b 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -3,64 +3,106 @@ section .data x_PacManPosition dw 10 ; x position of pacman at the beginning (it will be changed each time it will move) y_PacManPosition dw 10 ; y position of pacman at the beginning (it will be changed each time it will move) -frameOf_PacMan dw PACMAN_FULL +frameOf_PacMan dw PACMAN_RIGHT_2 afraid db 0 ; 0 : normal ghost animation, 1 : afraid ghost animation x_BlinkyPosition dw 30 ; x position of Blinky at the beginning (it will be changed each time it will move) y_BlinkyPosition dw 100 ; y position of Blinky at the beginning (it will be changed each time it will move) frameOf_Blinky dw BLINKY_1 +frameOf_Blinky_eyes dw EYES_RIGHT x_PinkyPosition dw 50 ; x position of Pinky at the beginning (it will be changed each time it will move) y_PinkyPosition dw 100 ; y position of Pinky at the beginning (it will be changed each time it will move) frameOf_Pinky dw PINKY_1 +frameOf_Pinky_eyes dw EYES_RIGHT x_ClydePosition dw 70 ; x position of Clyde at the beginning (it will be changed each time it will move) y_ClydePosition dw 100 ; y position of Clyde at the beginning (it will be changed each time it will move) frameOf_Clyde dw CLYDE_1 +frameOf_Clyde_eyes dw EYES_RIGHT x_InkyPosition dw 90 ; x position of Inky at the beginning (it will be changed each time it will move) y_InkyPosition dw 100 ; y position of Inky at the beginning (it will be changed each time it will move) frameOf_Inky dw INKY_1 +frameOf_Inky_eyes dw EYES_RIGHT section .text + Display_PacMan: - mov bx, 0;[x_PacManPosition] - mov ax, 0;[y_PacManPosition] + mov bx, [x_PacManPosition] + mov ax, [y_PacManPosition] call calculate_screen_position - mov ax, PACMAN_RIGHT_2;[frameOf_PacMan] + mov ax, [frameOf_PacMan] call calculate_spritesheet_position call draw_sprite ret + + Display_Pinky: + mov bx, [x_PinkyPosition] + mov ax, [y_PinkyPosition] + call calculate_screen_position + push dx + mov ax, [frameOf_Pinky] + call calculate_spritesheet_position + call draw_sprite + pop dx + mov ax, [frameOf_Pinky_eyes] + call calculate_spritesheet_position + call draw_sprite + + ret ClearPacMan: - ;movsb mov byte per byte the content of ds:si to es:di, increasing both si and di each time - ;so we set the adress of the segments and the offsets + mov ax, [y_PacManPosition] + mov bx, [x_PacManPosition] + call ClearSprite + ret - ;set the source 'ds:si' as the backup of the screen - ;ds is already set as 0x489D where is the backup at [buffScreen] - lea si, [background_buffer]; load the effective adress (L.E.A.) of the backup in the destination offset + ClearPinky: + mov ax, [y_PinkyPosition] + mov bx, [x_PinkyPosition] + call ClearSprite + ret - ;set the source 'ds:si' of the movsb function - push 0xA000 ; video memory adress = 0xA000 - pop es ; define it as the adress of the destination segment - mov di, [x_PacManPosition] ; define the offset destination as the same xPos, where was displayed the ghost + ClearSprite: - - ;mov, byte per byte the content of the ghost in the video memory - mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite + mov cx, SCREEN_WIDTH + mul cx + add bx, ax + + + + ;set the destination 'es:di' of the movsb function + push word [ScreenBufferSegment] + pop es ; define it as the adress of the destination segment + mov di, bx ; define the offset destination as the same xPos, where was displayed the ghost + + ;set the source 'ds:si' as the backup of the background + push word [BackgroundBufferSegment]; load the effective adress (L.E.A.) of the backup in the destination offset + pop ds + mov si, di + + + + + + ;mov, byte per byte the content of the ghost in the video memory + mov dx, SPRITE_SIZE ; set the counter for 8 lines per sprite - .eachLine: - mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line - rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line - dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties - jnz .eachLine ; while the flag != 0, it continues + .eachLine: + mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line + rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) + add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line + dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties + jnz .eachLine ; while the flag != 0, it continues -ret ; go back in the game loop + push cs + pop ds + ret calculate_screen_position: @@ -90,6 +132,8 @@ calculate_spritesheet_position: ret draw_sprite: + push es + ; TODO: Dynamic sprite size (DSP) ; bx: Base position on spritesheet ; cx: Index on sprite @@ -129,7 +173,11 @@ draw_sprite: ; Set the pixel mov di, dx + + push word [ScreenBufferSegment] + pop es mov [es:di], al + ; If we need to go to the next line .transparent_skip: @@ -140,4 +188,6 @@ draw_sprite: add dx, SCREEN_WIDTH - SPRITE_SIZE cmp cl, 0xff jne .draw_loop - ret \ No newline at end of file + + pop es +ret \ No newline at end of file From 2aa5c1b78faae8fb70b80a9bb0ab626c2a9a974c Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Wed, 29 Nov 2023 19:44:14 +0100 Subject: [PATCH 27/60] All maze's sprites + how to print them in comment --- src/constants.asm | 144 ++++++++++++++++++++++++++++++++++++++++++++++ src/main.asm | 65 +++++++++++++++++++++ src/sprites.asm | 14 ++++- 3 files changed, 222 insertions(+), 1 deletion(-) diff --git a/src/constants.asm b/src/constants.asm index 335ad4b..530017e 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -59,3 +59,147 @@ section .data palette db 0, 44, 40, 15, 66, 33, 84, 52, 88, 48, 78, 3, 65, 0 spritesheet dd 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x20222002, 0x20022202, 0x20020002, 0x20002002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22202202, 0x20220222, 0x02002200, 0x00220020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x60666006, 0x60066606, 0x60060006, 0x60006006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66606606, 0x60660666, 0x06006600, 0x00660060, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x70777007, 0x70077707, 0x70070007, 0x70007007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77707707, 0x70770777, 0x07007700, 0x00770070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x40444004, 0x40044404, 0x40040004, 0x40004004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44404404, 0x40440444, 0x04004400, 0x00440040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x50555005, 0x50055505, 0x50050005, 0x50005005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x55505505, 0x50550555, 0x05005500, 0x00550050, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x30333003, 0x30033303, 0x30030003, 0x30003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x33303303, 0x30330333, 0x03003300, 0x00330030, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x30030000, 0x00300300, 0x33330000, 0x00333300, 0x55330000, 0x00553300, 0x55330000, 0x00553300, 0x30030000, 0x00300300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300300, 0x00003003, 0x00333300, 0x00003333, 0x00335500, 0x00003355, 0x00335500, 0x00003355, 0x00300300, 0x00003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00550000, 0x00005500, 0x30550300, 0x00305503, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x00330000, 0x00003300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00330000, 0x00003300, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x30550300, 0x00305503, 0x00550000, 0x00005500, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00000011, 0x11111100, 0x00000010, 0x11111100, 0x00000000, 0x10111101, 0x00000000, 0x00111101, 0x00000000, 0x00101101, 0x00000000, 0x00111101, 0x00000000, 0x10111101, 0x00000000, 0x11111100, 0x00000000, 0x11111100, 0x00000010, 0x11110100, 0x00000011, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00001011, 0x11111101, 0x00000000, 0x00101101, 0x00000000, 0x11111101, 0x00000000, 0x11111101, 0x00001011, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100100, 0x00001100, 0x00101100, 0x00101100, 0x00111100, 0x00101101, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11010000, 0x00001111, 0x11000000, 0x00101111, 0x01000000, 0x00101111, 0x00000000, 0x00111111, 0x00000000, 0x00111101, 0x00000000, 0x00111100, 0x00000000, 0x00111101, 0x00000000, 0x00111111, 0x01000000, 0x00101111, 0x11000000, 0x00101111, 0x11010000, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110000, 0x00111111, 0x01000000, 0x00111111, 0x00000000, 0x00111100, 0x01000000, 0x00111111, 0x11110000, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00101101, 0x00111100, 0x00001101, 0x00110100, 0x00001001, 0x00110000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x00111100, 0x00101101, 0x00101100, 0x00101100, 0x00100100, 0x00001100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00cc0000, 0x00000000, 0x00cccc00, 0x00000000, 0x00000ccc, 0x0c000000, 0x00000c00, 0xc0220200, 0x0000c000, 0x222c2200, 0x0000000c, 0x20222200, 0x0000222c, 0x02222300, 0x0020222c, 0x02322200, 0x00202222, 0x02220200, 0x00202232, 0x02000000, 0x00202223, 0x00000000, 0x00002222, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x93990000, 0x00009099, 0x99290200, 0x00002299, 0x29222200, 0x00202322, 0x22222300, 0x00202223, 0x23232200, 0x00202222, 0x22222200, 0x00203222, 0x23320200, 0x00002222, 0x22220200, 0x00002222, 0x32220000, 0x00000023, 0x22020000, 0x00000022, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00009009, 0x0c000000, 0x00909999, 0x0c000000, 0x00009909, 0xcc440000, 0x000044c4, 0x4c440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44440400, 0x00404444, 0x44440400, 0x00404444, 0x44040000, 0x00004044, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000c0, 0x0c220200, 0x00002202, 0x2c222200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222322, 0x22222200, 0x00222322, 0x22220200, 0x00203222, 0x22220200, 0x00202222, 0x22220000, 0x00002222, 0x20020000, 0x00002022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00b00000, 0x00000000, 0xbb0b0000, 0x000000bb, 0x0b000000, 0x00000000, 0x93000000, 0x00000090, 0x9b990000, 0x00009099, 0xb9b30900, 0x0000b999, 0x999b0900, 0x0000993b, 0x99b99300, 0x0090b9b9, 0x3b999b00, 0x00903b99, 0x99b99300, 0x009099b9, 0x3b9b0900, 0x0000993b, 0xb9990900, 0x0000b999, 0x999b0000, 0x0000909b, 0x99000000, 0x000000b0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x22005000, 0x00500020, 0x22025000, 0x00500022, 0x12225100, 0x00502112, 0x12115100, 0x00501111, 0x11115500, 0x00501511, 0x01510500, 0x00005501, 0x01550000, 0x00005005, 0x01050000, 0x00000005, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000010, 0x1d010000, 0x000010d1, 0x11110000, 0x00001111, 0xd1110000, 0x00001111, 0x111d0000, 0x00001111, 0x111d0100, 0x00101111, 0x111d0100, 0x00101111, 0x11110100, 0x00101111, 0x11d11100, 0x00111111, 0x11d11100, 0x00111111, 0x11111100, 0x00111111, 0xaaaa1a00, 0x00a1aa33, 0xaaaa0a00, 0x00a0aa33, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xaa000000, 0x000000a0, 0x00aa0000, 0x0000a00a, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x3d000000, 0x000000d0, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00001111, 0x10110100, 0x00101111, 0x10111100, 0x10111111, 0x10111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001011, 0x10110000, 0x00111111, 0x10111101, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001111, 0x10110100, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11110000, 0x00001011, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11111101, 0x00111111, 0x11111111, 0x10111111, 0x10111101, 0x00111111, 0x00110100, 0x00001101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11110100, 0x00001111, 0x11111101, 0x00111111, 0x10111101, 0x00111111, 0x00111100, 0x00101101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11010000, 0x00000011, 0x10000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000001, 0x10000000, 0x00000010, 0x00000100, 0x00000100, 0x00100000, 0x00001000, 0x00000000, 0x00000000, 0x00001100, 0x00100100, 0x00000000, 0x00000000, 0x00100000, 0x00001000, 0x00000100, 0x00000100, 0x10000000, 0x00000010, 0x00010000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x08000000, 0x00000080, 0x08000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x88000000, 0x00000088, 0x88080000, 0x00008088, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88080000, 0x00008088, 0x88000000, 0x00000088, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 + + OTL db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + OTR db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + + OBL db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + OBR db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 + db 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + ITL db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + + ITR db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + + IBR db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + IBL db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + LG db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + LD db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + + LU db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + LB db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + Dot db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + PD db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x00, 0x00 + db 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x00 + db 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x00 + db 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + E db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + Inter db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \ No newline at end of file diff --git a/src/main.asm b/src/main.asm index 1f9c967..ba4bc0c 100644 --- a/src/main.asm +++ b/src/main.asm @@ -11,6 +11,71 @@ start: call SetVideoMode ;call SetScreen call DrawSprite + + ; mov si, OTL + ; mov di, 0 + ; call DrawMaze + + ; mov si, OTR + ; mov di, 8 + ; call DrawMaze + + ; mov si, OBL + ; mov di, 320*8 + ; call DrawMaze + + ; mov si, OBR + ; mov di, 320*8+8 + ; call DrawMaze + + ; mov si, ITL + ; mov di, 16 + ; call DrawMaze + + ; mov si, ITR + ; mov di, 24 + ; call DrawMaze + + ; mov si, IBL + ; mov di, 320*8+16 + ; call DrawMaze + + ; mov si, IBR + ; mov di, 320*8+24 + ; call DrawMaze + + ; mov si, LG + ; mov di, 320*16 + ; call DrawMaze + + ; mov si, LD + ; mov di, 320*16+8 + ; call DrawMaze + + ; mov si, LU + ; mov di, 320*24 + ; call DrawMaze + + ; mov si, LB + ; mov di, 320*24+8 + ; call DrawMaze + + ; mov si, Dot + ; mov di, 320*16+16 + ; call DrawMaze + + ; mov si, PD + ; mov di, 320*16+24 + ; call DrawMaze + + ; mov si, E + ; mov di, 320*24+16 + ; call DrawMaze + + ; mov si, Inter + ; mov di, 320*24+24 + ; call DrawMaze + pusha gameloop: diff --git a/src/sprites.asm b/src/sprites.asm index 0ec5f1b..5156d41 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -74,4 +74,16 @@ draw_sprite: add dx, SCREEN_WIDTH - SPRITE_SIZE cmp cl, 0xff jne .draw_loop - ret \ No newline at end of file + ret + +DrawMaze: + mov ax, 0xA000 + mov es, ax + mov dx, 8 + .eachLine: + mov cx, 8 + rep movsb + add di, 320-8 + dec dx + jnz .eachLine + ret \ No newline at end of file From 594537421749a6e03f009c3719b786025d179155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Fri, 1 Dec 2023 09:35:08 +0100 Subject: [PATCH 28/60] Edit gitignore Edit gitignore to remove debug file "pac.map" --- .gitignore | 1 + src/pac.map | 94 ----------------------------------------------------- 2 files changed, 1 insertion(+), 94 deletions(-) delete mode 100644 src/pac.map diff --git a/.gitignore b/.gitignore index da8d1e2..01183cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode/settings.json +./src/pac.map \ No newline at end of file diff --git a/src/pac.map b/src/pac.map deleted file mode 100644 index b0f15e7..0000000 --- a/src/pac.map +++ /dev/null @@ -1,94 +0,0 @@ - -- NASM Map file --------------------------------------------------------------- - -Source file: entry.asm -Output file: C:\Users\BenoitDEKEYN\Desktop\Projets\PacMan\algosup-workshop-master\bin\prog.com - --- Symbols -------------------------------------------------------------------- - ----- No Section --------------------------------------------------------------- - -Value Name -0000F9FE base -0000FA04 old_time - - ----- Section .text ------------------------------------------------------------ - -Real Virtual Name - 103 103 heapInit - 10D 10D heapAllocParagraph - 118 118 Display_PacMan - 12C 12C Display_Pinky - 14B 14B ClearPacMan - 156 156 ClearPinky - 161 161 ClearSprite - 179 179 ClearSprite.eachLine - 188 188 calculate_screen_position - 194 194 calculate_spritesheet_position - 1A0 1A0 draw_sprite - 1A5 1A5 draw_sprite.draw_loop - 1BE 1BE draw_sprite.low_byte - 1D5 1D5 draw_sprite.transparent_skip - 1E9 1E9 GetClockAndCompare - 1FD 1FD BuildScreenBuffer - 20B 20B UpdateScreen - 224 224 SetVideoMode - 230 230 ClearScreen - 236 236 FillScreen - 244 244 BuildBackgroundBuffer - 24F 24F MazeToBGbuffer - 25E 25E DisplayMaze - 276 276 FirstDisplayPacMan - 28C 28C FirstDisplayGhosts - 2B4 2B4 changePinkyPosition - 2D3 2D3 changePinkyPosition.noEyesRight - 2D3 2D3 changePinkyPosition.noXflip - 2F2 2F2 changePinkyPosition.noEyesDown - 2F2 2F2 changePinkyPosition.noYflip - 309 309 start - 31B 31B gameloop - ----- Section .data ------------------------------------------------------------ - -Real Virtual Name - 32C 32C palette - 33A 33A spritesheet - 233A 233A x_PacManPosition - 233C 233C y_PacManPosition - 233E 233E frameOf_PacMan - 2340 2340 afraid - 2341 2341 x_BlinkyPosition - 2343 2343 y_BlinkyPosition - 2345 2345 frameOf_Blinky - 2347 2347 frameOf_Blinky_eyes - 2349 2349 x_PinkyPosition - 234B 234B y_PinkyPosition - 234D 234D frameOf_Pinky - 234F 234F frameOf_Pinky_eyes - 2351 2351 x_ClydePosition - 2353 2353 y_ClydePosition - 2355 2355 frameOf_Clyde - 2357 2357 frameOf_Clyde_eyes - 2359 2359 x_InkyPosition - 235B 235B y_InkyPosition - 235D 235D frameOf_Inky - 235F 235F frameOf_Inky_eyes - 2361 2361 x_PacManVelocity - 2363 2363 y_PacManVelocity - 2365 2365 x_BlinkyVelocity - 2367 2367 y_BlinkyVelocity - 2369 2369 x_PinkyVelocity - 236B 236B y_PinkyVelocity - 236D 236D x_ClydeVelocity - 236F 236F y_ClydeVelocity - 2371 2371 x_InkyVelocity - 2373 2373 y_InkyVelocity - ----- Section .bss ------------------------------------------------------------- - -Real Virtual Name - 2378 2378 nextFreeSegment - 237A 237A BackgroundBufferSegment - 237C 237C ScreenBufferSegment - From 4bf1bf428174b7d2c8873bbfff78dcde193ef5f6 Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Fri, 1 Dec 2023 09:44:26 +0100 Subject: [PATCH 29/60] Delete test sprite (unused) --- src/_test_sprites.asm | 69 ------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 src/_test_sprites.asm diff --git a/src/_test_sprites.asm b/src/_test_sprites.asm deleted file mode 100644 index 7f4daf2..0000000 --- a/src/_test_sprites.asm +++ /dev/null @@ -1,69 +0,0 @@ -; org 100h - -; %define SPRITE_SIZE 16 -; %define SCREEN_WIDTH 320 -section .bss -buffScreen resb SPRITE_SIZE*SPRITE_SIZE ; where is stored the backuped screen -section .data -xPos dw 0 -xVelocity dw 1 -base: equ 0xf9fe -old_time: equ base+0x06 -; draw the radioactive ghost -; blinky db 0xFF, 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF, 0xFF -; db 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF -; db 0x0A, 0x0A, 0x0f, 0x00, 0x0A, 0x0f, 0x00, 0x0A -; db 0x0A, 0x0A, 0x0f, 0x0f, 0x0A, 0x0f, 0x0f, 0x0A -; db 0x0A, 0x0A, 0x0A, 0x0A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db 0xFF, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF -; db 0x0A, 0x0A, 0x0f, 0x00, 0x0A, 0x0f, 0x00, 0x0A -; db 0x0A, 0x0A, 0x0f, 0x0f, 0x0A, 0x0f, 0x0f, 0x0A -; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A -; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A -; db 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A -; db 0x0A, 0xFF, 0x0A, 0x0A, 0xFF, 0x0A, 0x0A, 0x0A - -section .text - -;------------------------------------------------------------------ -;THE GAME LOOP -;------------- - -; backup the screen before display ghost - -;------------------------------------------------------------------ -;THE FUNCTIONS -;------------- -;!!!PARAMETERS!!!; -;to select the color to use to fill, you need this color into 'al' - -;!!!PARAMETERS!!!; -;to select the ghost to print, you need to put the sprite address in 'si' (using 'lea si, blinky') - -; waiting: -; mov cx, 0xFFFF ; how many times we repeat the loop -; waitloop: -; loop waitloop ; we jump FFFF times, so , many times, to make a delay in the program -; ret ; go back in the game loop From a5a5694ee781de6a3bf70c28ced645c6efb27f1f Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Fri, 1 Dec 2023 10:11:37 +0100 Subject: [PATCH 30/60] Merge dev branch to current --- .gitignore | 3 +- src/Initialization.asm | 165 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 154 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 01183cb..c3465e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .vscode/settings.json -./src/pac.map \ No newline at end of file +./src/pac.map +./src/build-pacman.com \ No newline at end of file diff --git a/src/Initialization.asm b/src/Initialization.asm index 6a859db..d669771 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -1,14 +1,153 @@ +section .bss + + BackgroundBufferSegment resw 1 ; where is stored the dynamic background (dynamic cuz gums are disappearing). Used to restore the screen after a ghost's passage + ScreenBufferSegment resw 1 + +section .data + + base: equ 0xf9fe + old_time: equ base+0x06 + section .text -SetVideoMode: -;set the video mode - mov ah, 00h ; set video mode requirement - mov al, 13h ; set video mode option to 320 x 200 256 colors - int 10h ; call the dos interupt regarding to ax - push 0a000h - pop es - ret -SetScreen: -;clear the screen - mov al, 0x18 ; color to fill the screen (white = 0x0F, black = 0x00) - call clearScreen - ret \ No newline at end of file + + GetClockAndCompare: + pusha + + mov ax, 0 + int 1ah ; BIOS clock read + cmp dx, [old_time] ; Wait for change + je gameloop ; Loop + mov [old_time], dx + + popa + + ret + + BuildScreenBuffer: + call heapInit + mov ax, (SCREEN_HEIGHT*SCREEN_WIDTH/16) ; in ax, the number of paragraph to allocate (1 para = 16bits) + call heapAllocParagraph + mov [ScreenBufferSegment],bx + + ret + + UpdateScreen: + push ds + push es + + mov ax,cs:[ScreenBufferSegment] + mov ds,ax ; backBuffer segment adress + mov ax,0xa000 ; video memory segment adress + mov es,ax + xor si,si ; beginning of the backbuffer (0) + xor di,di ; beginning of the video memory (0) + mov cx, SCREEN_HEIGHT*SCREEN_WIDTH + rep movsb + + pop es + pop ds + ret + + + + SetVideoMode: + + mov ah, 00h ; chose the video mode setting function at the 10h interruption + mov al, 13h ; set video mode option to 320 x 200 256 colors + int 10h ; call the dos interupt regarding to ax + + ; write the adress of video memory (A000) in the register which contains the address of the destination segment used by the automatic data transfer functions (like movs, stos, ...) + push word [ScreenBufferSegment] + pop es + + ret + + ClearScreen: + ;clear the screen by filling it with a unique color (stored in al) + mov al, 0x83 ; color to fill the screen (white = 0x0F, black = 0x00) + call FillScreen + ret + + FillScreen: + + ;stosb copy byte per byte the content from 'al' to 'es:di', di increasing. + + ;set the destination 'es:di' : + push word [ScreenBufferSegment] ; video memory adress = 0xA000 + pop es ; define it as the adress of the destination segment + mov di, 0 ; begin the offset (pixel position) at 0 + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; how many times 'rep' action will be repeated + rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 + ret + + + + BuildBackgroundBuffer: + mov ax, (SCREEN_HEIGHT*SCREEN_WIDTH/16) ; in ax, the number of paragraph to allocate (1 para = 16bits) + call heapAllocParagraph + mov [BackgroundBufferSegment],bx + + ret + + MazeToBGbuffer: + ;source of stosb 'al' + mov al, 0x36 ; color of the background (simulate the maze) (to be change) + + ;destination of stosb 'es:di' + push word [BackgroundBufferSegment] + pop es + xor di,di + + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for rep + rep stosb ; to copy al into each byte of the target adress es:di byte per byte + + ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning + ret + + DisplayMaze: + push es + push ds + ;HEART OF THE FUNCTION : 'movsb' writes byte per byte the content from 'ds:si' to 'es:di', increasing both si and di each time it is executed + + ;set destination 'es:di' + push word [ScreenBufferSegment] + pop es + xor di, di + + ;set source 'ds:si' + push word [BackgroundBufferSegment] + pop ds + xor si, si + + + + mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for rep + rep movsb ; 'movsb' writes byte per byte the content from 'ds:si' to 'es:di', increasing both si and di each time it is executed + + pop ds + pop es + ret + + FirstDisplayPacMan: + + mov word [x_PacManPosition], 30 + mov word [y_PacManPosition], 30 + mov word [frameOf_PacMan], PACMAN_RIGHT_2 + + call Display_PacMan + ret + + FirstDisplayGhosts: + ;PINKY ONLY + + mov word [x_PinkyPosition], 30 + mov word [y_PinkyPosition], 30 + mov word [frameOf_Pinky], PINKY_1 + mov word [frameOf_Pinky_eyes], EYES_UP + call Display_Pinky + mov word [x_PinkyVelocity], 1 + mov word [y_PinkyVelocity], -1 + + ret + + \ No newline at end of file From c87226c5957c5a65ab6be80d89345b7957f25ff4 Mon Sep 17 00:00:00 2001 From: Maxime CARON <145995231+MaximeAlgosup@users.noreply.github.com> Date: Fri, 1 Dec 2023 10:30:19 +0100 Subject: [PATCH 31/60] Update gitignore Ignore all settings files --- .gitignore | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c3465e8..8ed50e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ - -.vscode/settings.json -./src/pac.map -./src/build-pacman.com \ No newline at end of file +.vscode/* +.vscode +*/*.map +*/*.com +*/*.cmd +bin/ +nasm/ From e62fdc91092d7b8839381296dafe9cd97fd78a73 Mon Sep 17 00:00:00 2001 From: Maxime CARON <145995231+MaximeAlgosup@users.noreply.github.com> Date: Fri, 1 Dec 2023 10:45:49 +0100 Subject: [PATCH 32/60] Edit initialization Remove unused functions --- src/Initialization.asm | 31 +++---------------------------- src/initialization.asm | 31 +++---------------------------- 2 files changed, 6 insertions(+), 56 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index d669771..a5d4177 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -1,28 +1,11 @@ section .bss - BackgroundBufferSegment resw 1 ; where is stored the dynamic background (dynamic cuz gums are disappearing). Used to restore the screen after a ghost's passage ScreenBufferSegment resw 1 section .data - - base: equ 0xf9fe - old_time: equ base+0x06 - + section .text - GetClockAndCompare: - pusha - - mov ax, 0 - int 1ah ; BIOS clock read - cmp dx, [old_time] ; Wait for change - je gameloop ; Loop - mov [old_time], dx - - popa - - ret - BuildScreenBuffer: call heapInit mov ax, (SCREEN_HEIGHT*SCREEN_WIDTH/16) ; in ax, the number of paragraph to allocate (1 para = 16bits) @@ -64,14 +47,8 @@ section .text ClearScreen: ;clear the screen by filling it with a unique color (stored in al) - mov al, 0x83 ; color to fill the screen (white = 0x0F, black = 0x00) - call FillScreen - ret - - FillScreen: - - ;stosb copy byte per byte the content from 'al' to 'es:di', di increasing. - + mov al, 0x00 ; color to fill the screen (white = 0x0F, black = 0x00) + ;set the destination 'es:di' : push word [ScreenBufferSegment] ; video memory adress = 0xA000 pop es ; define it as the adress of the destination segment @@ -80,8 +57,6 @@ section .text rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 ret - - BuildBackgroundBuffer: mov ax, (SCREEN_HEIGHT*SCREEN_WIDTH/16) ; in ax, the number of paragraph to allocate (1 para = 16bits) call heapAllocParagraph diff --git a/src/initialization.asm b/src/initialization.asm index d669771..a5d4177 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -1,28 +1,11 @@ section .bss - BackgroundBufferSegment resw 1 ; where is stored the dynamic background (dynamic cuz gums are disappearing). Used to restore the screen after a ghost's passage ScreenBufferSegment resw 1 section .data - - base: equ 0xf9fe - old_time: equ base+0x06 - + section .text - GetClockAndCompare: - pusha - - mov ax, 0 - int 1ah ; BIOS clock read - cmp dx, [old_time] ; Wait for change - je gameloop ; Loop - mov [old_time], dx - - popa - - ret - BuildScreenBuffer: call heapInit mov ax, (SCREEN_HEIGHT*SCREEN_WIDTH/16) ; in ax, the number of paragraph to allocate (1 para = 16bits) @@ -64,14 +47,8 @@ section .text ClearScreen: ;clear the screen by filling it with a unique color (stored in al) - mov al, 0x83 ; color to fill the screen (white = 0x0F, black = 0x00) - call FillScreen - ret - - FillScreen: - - ;stosb copy byte per byte the content from 'al' to 'es:di', di increasing. - + mov al, 0x00 ; color to fill the screen (white = 0x0F, black = 0x00) + ;set the destination 'es:di' : push word [ScreenBufferSegment] ; video memory adress = 0xA000 pop es ; define it as the adress of the destination segment @@ -80,8 +57,6 @@ section .text rep stosb ; store (byte per byte) the content of al into es:di, es = 0xA000, di increasing from 0 to 200*320 ret - - BuildBackgroundBuffer: mov ax, (SCREEN_HEIGHT*SCREEN_WIDTH/16) ; in ax, the number of paragraph to allocate (1 para = 16bits) call heapAllocParagraph From 0d69c319cb1c23b75010c690ef12f6b16b5a0b21 Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Fri, 1 Dec 2023 12:19:18 +0100 Subject: [PATCH 33/60] Delete changePos function unused --- src/move_sprites.asm | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/move_sprites.asm b/src/move_sprites.asm index d1f9ac3..d87cea2 100644 --- a/src/move_sprites.asm +++ b/src/move_sprites.asm @@ -22,20 +22,6 @@ section .data section .text -changePos: -;switch the direction if the ghost reached a side of the screen - cmp byte [oldKeyPressed] ,113 - je MoveLeft - - cmp byte [oldKeyPressed] ,100 - je MoveRight - - cmp byte [oldKeyPressed] ,122 - je MoveUp - - cmp byte [oldKeyPressed] ,115 - je MoveDown - DrawSprite: mov ax, [yPos] mov bx, [xPos] From 63308a603776ac59e6685fdf12d887161f2aa658 Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Fri, 1 Dec 2023 12:22:15 +0100 Subject: [PATCH 34/60] Remove wrong named files --- src/Collider.asm | 0 src/Keyboard.asm | 50 ------------------------------------------------ src/Scoring.asm | 0 3 files changed, 50 deletions(-) delete mode 100644 src/Collider.asm delete mode 100644 src/Keyboard.asm delete mode 100644 src/Scoring.asm diff --git a/src/Collider.asm b/src/Collider.asm deleted file mode 100644 index e69de29..0000000 diff --git a/src/Keyboard.asm b/src/Keyboard.asm deleted file mode 100644 index 6124b9b..0000000 --- a/src/Keyboard.asm +++ /dev/null @@ -1,50 +0,0 @@ -org 100h -section .data - keyPressed dw 0 - oldKeyPressed dw 100 - -section .text -readKeyboard: - ; Don't do anything if no key was pressed - mov ah, 01h - int 16h - jz .skipBufferRead - - ; Read last key in buffer: - .keepReadingBuffer: - int3 - mov ah, 00h - int 16h - mov bx, ax - mov ah, 01h - int 16h - jnz .keepReadingBuffer - - ; Overwrite the first char in 'charDump' with received char: - mov ax, [keyPressed] - mov [oldKeyPressed], ax - mov [keyPressed], bh - - .skipBufferRead: - - ; Exit if ESCAPE - cmp byte [keyPressed], EXIT_KEY_SCANCODE - je exit - - ; Left - cmp byte [keyPressed], LEFT_KEY_SCANCODE - je MoveLeft - - ; Right - cmp byte [keyPressed], RIGHT_KEY_SCANCODE - je MoveRight - - ; Up - cmp byte [keyPressed], UP_KEY_SCANCODE - je MoveUp - - ; Down - cmp byte [keyPressed], DOWN_KEY_SCANCODE - je MoveDown - - ret diff --git a/src/Scoring.asm b/src/Scoring.asm deleted file mode 100644 index e69de29..0000000 From 9dde172e8a2f61c15f383a11535882bf6a57296e Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Fri, 1 Dec 2023 12:23:16 +0100 Subject: [PATCH 35/60] Creation of the keyboard file with the good name --- src/keyboard.asm | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/keyboard.asm diff --git a/src/keyboard.asm b/src/keyboard.asm new file mode 100644 index 0000000..9b4b1d1 --- /dev/null +++ b/src/keyboard.asm @@ -0,0 +1,46 @@ +section .data + keyPressed dw 0 + +section .text +readKeyboard: + ; Don't do anything if no key was pressed + mov ah, 01h + int 16h + jz .skipBufferRead + + ; Read last key in buffer: + .keepReadingBuffer: + int3 + mov ah, 00h + int 16h + mov bx, ax + mov ah, 01h + int 16h + jnz .keepReadingBuffer + + ; Overwrite the first char in 'charDump' with received char: + mov [keyPressed], bh + + .skipBufferRead: + + ; Exit if ESCAPE + cmp byte [keyPressed], EXIT_KEY_SCANCODE + je exit + + ; Left + cmp byte [keyPressed], LEFT_KEY_SCANCODE + je MoveLeft + + ; Right + cmp byte [keyPressed], RIGHT_KEY_SCANCODE + je MoveRight + + ; Up + cmp byte [keyPressed], UP_KEY_SCANCODE + je MoveUp + + ; Down + cmp byte [keyPressed], DOWN_KEY_SCANCODE + je MoveDown + + ret From 1b82bf602b2a7356be5c8eef1929b7f9c74ef246 Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Fri, 1 Dec 2023 14:55:38 +0100 Subject: [PATCH 36/60] merged codes versions Discarded unused functions Need to generalize ghost display --- src/entry.asm | 1 + src/keyboard.asm | 31 +++++++++++++++++++++++++++---- src/main.asm | 6 +++++- src/move_sprites.asm | 35 +++++++---------------------------- src/sprites.asm | 2 -- 5 files changed, 40 insertions(+), 35 deletions(-) diff --git a/src/entry.asm b/src/entry.asm index 5134680..e8df54a 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -3,6 +3,7 @@ org 100h jmp start +%include "heapLibrary.inc" %include "constants.asm" %include "sprites.asm" %include "main.asm" diff --git a/src/keyboard.asm b/src/keyboard.asm index 9b4b1d1..a9e6783 100644 --- a/src/keyboard.asm +++ b/src/keyboard.asm @@ -29,18 +29,41 @@ readKeyboard: ; Left cmp byte [keyPressed], LEFT_KEY_SCANCODE - je MoveLeft + jne .NoLeft + mov word[x_PacManVelocity], -1 + mov word[y_PacManVelocity], 0 + call changePacManPosition + mov word[frameOf_PacMan], PACMAN_LEFT_2 + .NoLeft: ; Right cmp byte [keyPressed], RIGHT_KEY_SCANCODE - je MoveRight + jne .NoRight + mov word[x_PacManVelocity], 1 + mov word[y_PacManVelocity], 0 + call changePacManPosition + mov word[frameOf_PacMan], PACMAN_RIGHT_2 + .NoRight: ; Up cmp byte [keyPressed], UP_KEY_SCANCODE - je MoveUp + jne .NoUp + mov word[x_PacManVelocity], 0 + mov word[y_PacManVelocity], -1 + call changePacManPosition + mov word[frameOf_PacMan], PACMAN_UP_2 + .NoUp: ; Down cmp byte [keyPressed], DOWN_KEY_SCANCODE - je MoveDown + jne .NoDown + mov word[x_PacManVelocity], 0 + mov word[y_PacManVelocity], 1 + call changePacManPosition + mov word[frameOf_PacMan], PACMAN_DOWN_2 + .NoDown: ret + + exit: + int 20h diff --git a/src/main.asm b/src/main.asm index b364f13..d53ffd9 100644 --- a/src/main.asm +++ b/src/main.asm @@ -11,7 +11,7 @@ section .text call BuildBackgroundBuffer call MazeToBGbuffer call DisplayMaze - ;call FirstDisplayPacMan + call FirstDisplayPacMan call FirstDisplayGhosts @@ -27,7 +27,11 @@ section .text gameloop: ;------------------------------------------------- call ClearPinky + call ClearPacMan + call readKeyboard call changePinkyPosition + call Display_PacMan + call Display_Pinky call UpdateScreen diff --git a/src/move_sprites.asm b/src/move_sprites.asm index d87cea2..30ba633 100644 --- a/src/move_sprites.asm +++ b/src/move_sprites.asm @@ -31,36 +31,15 @@ DrawSprite: call draw_sprite ret -MoveRight: - mov bx, [xVelocity] - add [xPos], bx - mov word [PACMANDir], PACMAN_RIGHT_2 - ;call clearScreen - call DrawSprite - ret - -MoveLeft: - mov bx, [xVelocity] - sub [xPos], bx - mov word [PACMANDir], PACMAN_LEFT_2 - ;call clearScreen - call DrawSprite - ret +changePacManPosition: -MoveUp: - mov bx, [xVelocity] - sub [yPos], bx - mov word [PACMANDir], PACMAN_UP_2 - ;call clearScreen - call DrawSprite - ret + mov bx, [x_PacManPosition] + add bx, [x_PacManVelocity] + mov [x_PacManPosition], bx -MoveDown: - mov bx, [xVelocity] - add [yPos], bx - mov word [PACMANDir], PACMAN_DOWN_2 - ;call clearScreen - call DrawSprite + mov ax, [y_PacManPosition] + add ax, [y_PacManVelocity] + mov [y_PacManPosition], ax ret changePinkyPosition: diff --git a/src/sprites.asm b/src/sprites.asm index fa3ed40..f22adb8 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -1,5 +1,3 @@ -calculate_screen_position: - section .data x_PacManPosition dw 10 ; x position of pacman at the beginning (it will be changed each time it will move) From cd006265a6b9390a96942f4d5e71aae51e226b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Fri, 1 Dec 2023 15:09:37 +0100 Subject: [PATCH 37/60] delete old functions to finish the big merge dlete drawSprite to only Pacman (now Display_PacMan) and delet [xpos] and [yPos], obsolete) --- src/move_sprites.asm | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/move_sprites.asm b/src/move_sprites.asm index 30ba633..b379e20 100644 --- a/src/move_sprites.asm +++ b/src/move_sprites.asm @@ -1,6 +1,4 @@ section .data - xPos dw 160 - yPos dw 80 xVelocity dw 1 PACMANDir dw PACMAN_RIGHT_2 @@ -22,15 +20,6 @@ section .data section .text -DrawSprite: - mov ax, [yPos] - mov bx, [xPos] - call calculate_screen_position - mov ax, [PACMANDir] - call calculate_spritesheet_position - call draw_sprite - ret - changePacManPosition: mov bx, [x_PacManPosition] From 1ac23bbf5e09dc4d38d124e5d8b9156a73072906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Fri, 1 Dec 2023 16:09:37 +0100 Subject: [PATCH 38/60] 4 ghosts moving and pacman oriented by keyboard the background has to be replaced by the maze the ghosts are moving, bumping to the sides of the screen, changing their eyes position. Pacman can be oriented by the arrow s of the keyboard --- src/Initialization.asm | 31 +++++++-- src/initialization.asm | 31 +++++++-- src/main.asm | 15 ++++- src/move_sprites.asm | 142 ++++++++++++++++++++++++++++++++++------- src/sprites.asm | 73 +++++++++++++++++++-- 5 files changed, 255 insertions(+), 37 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index a5d4177..df4b61d 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -105,24 +105,47 @@ section .text FirstDisplayPacMan: - mov word [x_PacManPosition], 30 - mov word [y_PacManPosition], 30 + mov word [x_PacManPosition], 100 + mov word [y_PacManPosition], 100 mov word [frameOf_PacMan], PACMAN_RIGHT_2 call Display_PacMan ret FirstDisplayGhosts: - ;PINKY ONLY mov word [x_PinkyPosition], 30 mov word [y_PinkyPosition], 30 mov word [frameOf_Pinky], PINKY_1 mov word [frameOf_Pinky_eyes], EYES_UP call Display_Pinky - mov word [x_PinkyVelocity], 1 + mov word [x_PinkyVelocity], 0 mov word [y_PinkyVelocity], -1 + mov word [x_BlinkyPosition], 274 + mov word [y_BlinkyPosition], 30 + mov word [frameOf_Blinky], BLINKY_1 + mov word [frameOf_Blinky_eyes], EYES_RIGHT + call Display_Blinky + mov word [x_BlinkyVelocity], 1 + mov word [y_BlinkyVelocity], 0 + + mov word [x_InkyPosition], 30 + mov word [y_InkyPosition], 146 + mov word [frameOf_Inky], INKY_1 + mov word [frameOf_Inky_eyes], EYES_DOWN + call Display_Inky + mov word [x_InkyVelocity], 0 + mov word [y_InkyVelocity], 1 + + mov word [x_ClydePosition], 274 + mov word [y_ClydePosition], 146 + mov word [frameOf_Clyde], CLYDE_1 + mov word [frameOf_Clyde_eyes], EYES_LEFT + call Display_Clyde + mov word [x_ClydeVelocity], -1 + mov word [y_ClydeVelocity], 0 + ret \ No newline at end of file diff --git a/src/initialization.asm b/src/initialization.asm index a5d4177..df4b61d 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -105,24 +105,47 @@ section .text FirstDisplayPacMan: - mov word [x_PacManPosition], 30 - mov word [y_PacManPosition], 30 + mov word [x_PacManPosition], 100 + mov word [y_PacManPosition], 100 mov word [frameOf_PacMan], PACMAN_RIGHT_2 call Display_PacMan ret FirstDisplayGhosts: - ;PINKY ONLY mov word [x_PinkyPosition], 30 mov word [y_PinkyPosition], 30 mov word [frameOf_Pinky], PINKY_1 mov word [frameOf_Pinky_eyes], EYES_UP call Display_Pinky - mov word [x_PinkyVelocity], 1 + mov word [x_PinkyVelocity], 0 mov word [y_PinkyVelocity], -1 + mov word [x_BlinkyPosition], 274 + mov word [y_BlinkyPosition], 30 + mov word [frameOf_Blinky], BLINKY_1 + mov word [frameOf_Blinky_eyes], EYES_RIGHT + call Display_Blinky + mov word [x_BlinkyVelocity], 1 + mov word [y_BlinkyVelocity], 0 + + mov word [x_InkyPosition], 30 + mov word [y_InkyPosition], 146 + mov word [frameOf_Inky], INKY_1 + mov word [frameOf_Inky_eyes], EYES_DOWN + call Display_Inky + mov word [x_InkyVelocity], 0 + mov word [y_InkyVelocity], 1 + + mov word [x_ClydePosition], 274 + mov word [y_ClydePosition], 146 + mov word [frameOf_Clyde], CLYDE_1 + mov word [frameOf_Clyde_eyes], EYES_LEFT + call Display_Clyde + mov word [x_ClydeVelocity], -1 + mov word [y_ClydeVelocity], 0 + ret \ No newline at end of file diff --git a/src/main.asm b/src/main.asm index d53ffd9..513214e 100644 --- a/src/main.asm +++ b/src/main.asm @@ -26,13 +26,26 @@ section .text ;THE GAME LOOP gameloop: ;------------------------------------------------- + ;clear all call ClearPinky + call ClearBlinky + call ClearInky + call ClearClyde call ClearPacMan + call readKeyboard + call changePinkyPosition - call Display_PacMan + call changeBlinkyPosition + call changeInkyPosition + call changeClydePosition + call Display_PacMan call Display_Pinky + call Display_Blinky + call Display_Inky + call Display_Clyde + call UpdateScreen diff --git a/src/move_sprites.asm b/src/move_sprites.asm index b379e20..afa6fd3 100644 --- a/src/move_sprites.asm +++ b/src/move_sprites.asm @@ -1,6 +1,4 @@ section .data - xVelocity dw 1 - PACMANDir dw PACMAN_RIGHT_2 x_PacManVelocity dw 0 ; PacMan's translation vector on x axis (px/screen update) (if it=-3, pac man will go down 3 pixel, 24 times per second) y_PacManVelocity dw 0 ; PacMan's translation vector on y axis (px/screen update) (if it=+2, pac man will go right 2 pixel, 24 times per second) @@ -21,7 +19,6 @@ section .data section .text changePacManPosition: - mov bx, [x_PacManPosition] add bx, [x_PacManVelocity] mov [x_PacManPosition], bx @@ -31,33 +28,130 @@ changePacManPosition: mov [y_PacManPosition], ax ret -changePinkyPosition: -;switch the direction if the ghost reached a side of the screen - cmp word [x_PinkyPosition], SCREEN_WIDTH - SPRITE_SIZE +changeGhostPosition: + + ;switch the direction if the ghost reached a side of the screen + cmp bx, SCREEN_WIDTH - SPRITE_SIZE jb .noXflip - neg word [x_PinkyVelocity] - mov word [frameOf_Pinky_eyes], EYES_LEFT - cmp word [x_PinkyVelocity], 1 + neg dx + + .noXflip: + cmp ax, SCREEN_HEIGHT - SPRITE_SIZE + jb .noYflip + neg cx + + .noYflip: + ;inc/decremente the position + add ax, cx + add bx, dx + + ret + +changeGhostFrames: + + cmp dx, 1 jne .noEyesRight - mov word [frameOf_Pinky_eyes], EYES_RIGHT + mov ax, EYES_RIGHT .noEyesRight: - .noXflip: - cmp word [y_PinkyPosition], SCREEN_HEIGHT - SPRITE_SIZE - jb .noYflip - neg word [y_PinkyVelocity] - mov word [frameOf_Pinky_eyes], EYES_UP - cmp word [y_PinkyVelocity], 1 + cmp dx, -1 + jne .noEyesLeft + mov ax, EYES_LEFT + .noEyesLeft: + + cmp cx, 1 jne .noEyesDown - mov word [frameOf_Pinky_eyes], EYES_DOWN + mov ax, EYES_DOWN .noEyesDown: - .noYflip: -;inc/decremente the position - mov bx, [x_PinkyPosition] - add bx, [x_PinkyVelocity] - mov [x_PinkyPosition], bx + + cmp cx, -1 + jne .noEyesUp + mov ax, EYES_UP + .noEyesUp: + + ret + +changePinkyPosition: mov ax, [y_PinkyPosition] - add ax, [y_PinkyVelocity] - mov [y_PinkyPosition], ax + mov bx, [x_PinkyPosition] + mov cx, [y_PinkyVelocity] + mov dx, [x_PinkyVelocity] + + call changeGhostPosition + + mov word [y_PinkyPosition], ax + mov word [x_PinkyPosition], bx + mov word [y_PinkyVelocity], cx + mov word [x_PinkyVelocity], dx + + call changeGhostFrames + + mov word [frameOf_Pinky_eyes], ax + ret + +changeInkyPosition: + + mov ax, [y_InkyPosition] + mov bx, [x_InkyPosition] + mov cx, [y_InkyVelocity] + mov dx, [x_InkyVelocity] + + call changeGhostPosition + + mov word [y_InkyPosition], ax + mov word [x_InkyPosition], bx + mov word [y_InkyVelocity], cx + mov word [x_InkyVelocity], dx + + call changeGhostFrames + + mov word [frameOf_Inky_eyes], ax + + ret + +changeClydePosition: + + mov ax, [y_ClydePosition] + mov bx, [x_ClydePosition] + mov cx, [y_ClydeVelocity] + mov dx, [x_ClydeVelocity] + + call changeGhostPosition + + mov word [y_ClydePosition], ax + mov word [x_ClydePosition], bx + mov word [y_ClydeVelocity], cx + mov word [x_ClydeVelocity], dx + + call changeGhostFrames + + mov word [frameOf_Clyde_eyes], ax + + ret + +changeBlinkyPosition: + + mov ax, [y_BlinkyPosition] + mov bx, [x_BlinkyPosition] + mov cx, [y_BlinkyVelocity] + mov dx, [x_BlinkyVelocity] + + call changeGhostPosition + + mov word [y_BlinkyPosition], ax + mov word [x_BlinkyPosition], bx + mov word [y_BlinkyVelocity], cx + mov word [x_BlinkyVelocity], dx + + call changeGhostFrames + + mov word [frameOf_Blinky_eyes], ax + + ret + + + + + \ No newline at end of file diff --git a/src/sprites.asm b/src/sprites.asm index f22adb8..3efe174 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -6,13 +6,13 @@ section .data afraid db 0 ; 0 : normal ghost animation, 1 : afraid ghost animation - x_BlinkyPosition dw 30 ; x position of Blinky at the beginning (it will be changed each time it will move) - y_BlinkyPosition dw 100 ; y position of Blinky at the beginning (it will be changed each time it will move) + x_BlinkyPosition dw 274 ; x position of Blinky at the beginning (it will be changed each time it will move) + y_BlinkyPosition dw 30 ; y position of Blinky at the beginning (it will be changed each time it will move) frameOf_Blinky dw BLINKY_1 frameOf_Blinky_eyes dw EYES_RIGHT - x_PinkyPosition dw 50 ; x position of Pinky at the beginning (it will be changed each time it will move) - y_PinkyPosition dw 100 ; y position of Pinky at the beginning (it will be changed each time it will move) + x_PinkyPosition dw 30 ; x position of Pinky at the beginning (it will be changed each time it will move) + y_PinkyPosition dw 30 ; y position of Pinky at the beginning (it will be changed each time it will move) frameOf_Pinky dw PINKY_1 frameOf_Pinky_eyes dw EYES_RIGHT @@ -53,6 +53,53 @@ section .text ret + Display_Blinky: + mov bx, [x_BlinkyPosition] + mov ax, [y_BlinkyPosition] + call calculate_screen_position + push dx + mov ax, [frameOf_Blinky] + call calculate_spritesheet_position + call draw_sprite + pop dx + mov ax, [frameOf_Blinky_eyes] + call calculate_spritesheet_position + call draw_sprite + + ret + + Display_Inky: + mov bx, [x_InkyPosition] + mov ax, [y_InkyPosition] + call calculate_screen_position + push dx + mov ax, [frameOf_Inky] + call calculate_spritesheet_position + call draw_sprite + pop dx + mov ax, [frameOf_Inky_eyes] + call calculate_spritesheet_position + call draw_sprite + + ret + + Display_Clyde: + mov bx, [x_ClydePosition] + mov ax, [y_ClydePosition] + call calculate_screen_position + push dx + mov ax, [frameOf_Clyde] + call calculate_spritesheet_position + call draw_sprite + pop dx + mov ax, [frameOf_Clyde_eyes] + call calculate_spritesheet_position + call draw_sprite + + ret + + + ClearPacMan: mov ax, [y_PacManPosition] mov bx, [x_PacManPosition] @@ -64,6 +111,24 @@ section .text mov bx, [x_PinkyPosition] call ClearSprite ret + + ClearInky: + mov ax, [y_InkyPosition] + mov bx, [x_InkyPosition] + call ClearSprite + ret + + ClearBlinky: + mov ax, [y_BlinkyPosition] + mov bx, [x_BlinkyPosition] + call ClearSprite + ret + + ClearClyde: + mov ax, [y_ClydePosition] + mov bx, [x_ClydePosition] + call ClearSprite + ret ClearSprite: mov cx, SCREEN_WIDTH From 2c58bf4797f054c9ec2306ec2869f624a810b91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Sat, 2 Dec 2023 13:10:46 +0100 Subject: [PATCH 39/60] done the basic algorithm to load the maze from a table we draw the maze in data, where each nibble = a 8x8 bloc of maze. the maze 's sprites are stored in MazeSprites , where each byte is a 256 color. the function to draw the maze in the background buffer is 'MazeToBGbuffer' we have to keep in mind the little endian in the drawing of the maze in the table (the model) --- src/Initialization.asm | 110 ++++++++++++-- src/constants.asm | 328 +++++++++++++++++++++++------------------ src/initialization.asm | 110 ++++++++++++-- src/keyboard.asm | 2 - src/main.asm | 11 +- src/sprites.asm | 12 -- 6 files changed, 385 insertions(+), 188 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index df4b61d..77c4e17 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -47,7 +47,7 @@ section .text ClearScreen: ;clear the screen by filling it with a unique color (stored in al) - mov al, 0x00 ; color to fill the screen (white = 0x0F, black = 0x00) + mov al, 0x29 ; color to fill the screen (white = 0x0F, black = 0x00) ;set the destination 'es:di' : push word [ScreenBufferSegment] ; video memory adress = 0xA000 @@ -64,20 +64,100 @@ section .text ret - MazeToBGbuffer: - ;source of stosb 'al' - mov al, 0x36 ; color of the background (simulate the maze) (to be change) - - ;destination of stosb 'es:di' - push word [BackgroundBufferSegment] + + + + + + + + + + + + + + + MazeToBGbuffer: + int3 + xor dx, dx + push word [BackgroundBufferSegment] pop es - xor di,di + ;ds is ok + .eachBlocsLine: + mov dl, 0 ; blocs in a line + .eachBlocOfTheLine: + push dx + mov ax, 0xA00 ; number of pixels in a bloc's line + mov bl, dh + and bx, 0x00FF + mul bx + mov di, ax ; di contains the number of pixels in complete lines + pop dx + + push dx + mov ax, 40 ; number of blocs in a bloc's line + mov bl, dh + mul bl + mov cx, ax ; cx contains the number of blocs in complete lines + pop dx + + push dx + and dx, 0x00FF + add cx, dx ; cx now contains the number of complete blocs + pop dx + + push dx + mov ax, 8 + mov bl, dl + mul bl + add di, ax ; di now contains the position to write the next bloc + pop dx + + push cx + shr cx, 1 ; from the 'cx'ième pixel, we convert it into the 'cx'ième byte where it is stored (1 byte = 2 nibbles = 2 pixels) + mov si, MazeModel + add si, cx + mov al, [ds:si] ; now al contains the 2 hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel + + ;check if the hexa code is in the high or low nibble, by looking at the parity of the counter + pop cx + test cl, 1 ; + jnz .NoSecondNibble + shr ax, 4 + .NoSecondNibble: + + push dx + ; pick the sprite to display following the hexacode + and ax, 0xf ; keep only the concerned nibble containing the hexa code + ; Get the offset of the sprite, following the hexa code + mov si, MazeSpriteSheet + mov bx, 8*8 + mul bx + add si, ax ; si contains the offset of the sprite to display + pop dx + + ;we draw the bloc + push cx + push dx + mov dx,8 + .eachPixelsLine: + mov cx, 8 + rep movsb + add di, SCREEN_WIDTH - 8 + dec dx + jnz .eachPixelsLine + pop dx + pop cx + + inc dl + cmp dl, 40 + jne .eachBlocOfTheLine + inc dh + cmp dh, 25 + jne .eachBlocsLine + ret - mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for rep - rep stosb ; to copy al into each byte of the target adress es:di byte per byte - - ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning - ret DisplayMaze: push es @@ -101,7 +181,7 @@ section .text pop ds pop es - ret + ret FirstDisplayPacMan: @@ -110,7 +190,7 @@ section .text mov word [frameOf_PacMan], PACMAN_RIGHT_2 call Display_PacMan - ret + ret FirstDisplayGhosts: diff --git a/src/constants.asm b/src/constants.asm index 1ac4860..c422fff 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -8,6 +8,7 @@ %define RIGHT_KEY_SCANCODE 4dh %define EXIT_KEY_SCANCODE 01h + %define BLINKY_1 0 %define BLINKY_2 1 %define PINKY_1 2 @@ -54,155 +55,196 @@ %define DOT 43 %define POWER_PELLET 44 +;not used, just there to see the matching table to write the maze just below +%define EMPTY 0 +%define OUT_TOP_LEFT_CORNER 1 +%define OUT_TOP_RIGHT_CORNER 2 +%define OUT_BOTTOM_LEFT_CORNER 3 +%define OUT_BOTTOM_RIGHT_CORNER 4 +%define IN_TOP_LEFT_CORNER 5 +%define IN_TOP_RIGHT_CORNER 6 +%define IN_BOTTOM_LEFT_CORNER 7 +%define IN_BOTTOM_RIGHT_CORNER 8 +%define TOP_LINE 9 +%define BOTTOM_LINE 0xA +%define LEFT_LINE 0xB +%define RIGHT_LINE 0xC +%define PELLET 0xD +%define SUPER_PELLET 0xE +%define BACKGROUND 0xF section .data - + MazeModel dd 0x99999919, 0x99999999, 0x99999999, 0x99999999, 0x92999999 + dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD + dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD + dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD + dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD + dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD + dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDD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DDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD + dd 0xAAAAAA4A, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xA3AAAAAA palette db 0, 44, 40, 15, 66, 33, 84, 52, 88, 48, 78, 3, 65, 0 spritesheet dd 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x20222002, 0x20022202, 0x20020002, 0x20002002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22202202, 0x20220222, 0x02002200, 0x00220020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x60666006, 0x60066606, 0x60060006, 0x60006006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66606606, 0x60660666, 0x06006600, 0x00660060, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x70777007, 0x70077707, 0x70070007, 0x70007007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77707707, 0x70770777, 0x07007700, 0x00770070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x40444004, 0x40044404, 0x40040004, 0x40004004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44404404, 0x40440444, 0x04004400, 0x00440040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x50555005, 0x50055505, 0x50050005, 0x50005005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x55505505, 0x50550555, 0x05005500, 0x00550050, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x30333003, 0x30033303, 0x30030003, 0x30003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x33303303, 0x30330333, 0x03003300, 0x00330030, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x30030000, 0x00300300, 0x33330000, 0x00333300, 0x55330000, 0x00553300, 0x55330000, 0x00553300, 0x30030000, 0x00300300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300300, 0x00003003, 0x00333300, 0x00003333, 0x00335500, 0x00003355, 0x00335500, 0x00003355, 0x00300300, 0x00003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00550000, 0x00005500, 0x30550300, 0x00305503, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x00330000, 0x00003300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00330000, 0x00003300, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x30550300, 0x00305503, 0x00550000, 0x00005500, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00000011, 0x11111100, 0x00000010, 0x11111100, 0x00000000, 0x10111101, 0x00000000, 0x00111101, 0x00000000, 0x00101101, 0x00000000, 0x00111101, 0x00000000, 0x10111101, 0x00000000, 0x11111100, 0x00000000, 0x11111100, 0x00000010, 0x11110100, 0x00000011, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00001011, 0x11111101, 0x00000000, 0x00101101, 0x00000000, 0x11111101, 0x00000000, 0x11111101, 0x00001011, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100100, 0x00001100, 0x00101100, 0x00101100, 0x00111100, 0x00101101, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11010000, 0x00001111, 0x11000000, 0x00101111, 0x01000000, 0x00101111, 0x00000000, 0x00111111, 0x00000000, 0x00111101, 0x00000000, 0x00111100, 0x00000000, 0x00111101, 0x00000000, 0x00111111, 0x01000000, 0x00101111, 0x11000000, 0x00101111, 0x11010000, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110000, 0x00111111, 0x01000000, 0x00111111, 0x00000000, 0x00111100, 0x01000000, 0x00111111, 0x11110000, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00101101, 0x00111100, 0x00001101, 0x00110100, 0x00001001, 0x00110000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x00111100, 0x00101101, 0x00101100, 0x00101100, 0x00100100, 0x00001100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00cc0000, 0x00000000, 0x00cccc00, 0x00000000, 0x00000ccc, 0x0c000000, 0x00000c00, 0xc0220200, 0x0000c000, 0x222c2200, 0x0000000c, 0x20222200, 0x0000222c, 0x02222300, 0x0020222c, 0x02322200, 0x00202222, 0x02220200, 0x00202232, 0x02000000, 0x00202223, 0x00000000, 0x00002222, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x93990000, 0x00009099, 0x99290200, 0x00002299, 0x29222200, 0x00202322, 0x22222300, 0x00202223, 0x23232200, 0x00202222, 0x22222200, 0x00203222, 0x23320200, 0x00002222, 0x22220200, 0x00002222, 0x32220000, 0x00000023, 0x22020000, 0x00000022, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00009009, 0x0c000000, 0x00909999, 0x0c000000, 0x00009909, 0xcc440000, 0x000044c4, 0x4c440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44440400, 0x00404444, 0x44440400, 0x00404444, 0x44040000, 0x00004044, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000c0, 0x0c220200, 0x00002202, 0x2c222200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222322, 0x22222200, 0x00222322, 0x22220200, 0x00203222, 0x22220200, 0x00202222, 0x22220000, 0x00002222, 0x20020000, 0x00002022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00b00000, 0x00000000, 0xbb0b0000, 0x000000bb, 0x0b000000, 0x00000000, 0x93000000, 0x00000090, 0x9b990000, 0x00009099, 0xb9b30900, 0x0000b999, 0x999b0900, 0x0000993b, 0x99b99300, 0x0090b9b9, 0x3b999b00, 0x00903b99, 0x99b99300, 0x009099b9, 0x3b9b0900, 0x0000993b, 0xb9990900, 0x0000b999, 0x999b0000, 0x0000909b, 0x99000000, 0x000000b0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x22005000, 0x00500020, 0x22025000, 0x00500022, 0x12225100, 0x00502112, 0x12115100, 0x00501111, 0x11115500, 0x00501511, 0x01510500, 0x00005501, 0x01550000, 0x00005005, 0x01050000, 0x00000005, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000010, 0x1d010000, 0x000010d1, 0x11110000, 0x00001111, 0xd1110000, 0x00001111, 0x111d0000, 0x00001111, 0x111d0100, 0x00101111, 0x111d0100, 0x00101111, 0x11110100, 0x00101111, 0x11d11100, 0x00111111, 0x11d11100, 0x00111111, 0x11111100, 0x00111111, 0xaaaa1a00, 0x00a1aa33, 0xaaaa0a00, 0x00a0aa33, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xaa000000, 0x000000a0, 0x00aa0000, 0x0000a00a, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x3d000000, 0x000000d0, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00001111, 0x10110100, 0x00101111, 0x10111100, 0x10111111, 0x10111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001011, 0x10110000, 0x00111111, 0x10111101, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001111, 0x10110100, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11110000, 0x00001011, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11111101, 0x00111111, 0x11111111, 0x10111111, 0x10111101, 0x00111111, 0x00110100, 0x00001101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11110100, 0x00001111, 0x11111101, 0x00111111, 0x10111101, 0x00111111, 0x00111100, 0x00101101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11010000, 0x00000011, 0x10000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000001, 0x10000000, 0x00000010, 0x00000100, 0x00000100, 0x00100000, 0x00001000, 0x00000000, 0x00000000, 0x00001100, 0x00100100, 0x00000000, 0x00000000, 0x00100000, 0x00001000, 0x00000100, 0x00000100, 0x10000000, 0x00000010, 0x00010000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x08000000, 0x00000080, 0x08000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x88000000, 0x00000088, 0x88080000, 0x00008088, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88080000, 0x00008088, 0x88000000, 0x00000088, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - OTL db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 - db 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - OTR db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + MazeSpriteSheet db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Empty 0 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - OBL db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - OBR db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 - db 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - ITL db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 - - ITR db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - - IBR db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - IBL db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - LG db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - LD db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - - LU db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - LB db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - Dot db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - PD db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x00, 0x00 - db 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x00 - db 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x00 - db 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - E db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - Inter db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \ No newline at end of file + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Out Top Left Corner 1 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Out Top Right Corner 2 + db 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 ; Out Bottom Left Corner 3 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 + db 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Out Bottom Right Corner 4 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; In Top Left Corner 5 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; In Top Right Corner 6 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 ; In Bottom Left Corner 7 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 ; In Bottom Right Corner 8 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Top Line 9 + db 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Bottom Line 10 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Left Line 11 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 ; Right Line 12 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Pellet 13 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Super Pellet 14 + db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x00, 0x00 + db 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x00 + db 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x00 + db 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Background 15 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 diff --git a/src/initialization.asm b/src/initialization.asm index df4b61d..77c4e17 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -47,7 +47,7 @@ section .text ClearScreen: ;clear the screen by filling it with a unique color (stored in al) - mov al, 0x00 ; color to fill the screen (white = 0x0F, black = 0x00) + mov al, 0x29 ; color to fill the screen (white = 0x0F, black = 0x00) ;set the destination 'es:di' : push word [ScreenBufferSegment] ; video memory adress = 0xA000 @@ -64,20 +64,100 @@ section .text ret - MazeToBGbuffer: - ;source of stosb 'al' - mov al, 0x36 ; color of the background (simulate the maze) (to be change) - - ;destination of stosb 'es:di' - push word [BackgroundBufferSegment] + + + + + + + + + + + + + + + MazeToBGbuffer: + int3 + xor dx, dx + push word [BackgroundBufferSegment] pop es - xor di,di + ;ds is ok + .eachBlocsLine: + mov dl, 0 ; blocs in a line + .eachBlocOfTheLine: + push dx + mov ax, 0xA00 ; number of pixels in a bloc's line + mov bl, dh + and bx, 0x00FF + mul bx + mov di, ax ; di contains the number of pixels in complete lines + pop dx + + push dx + mov ax, 40 ; number of blocs in a bloc's line + mov bl, dh + mul bl + mov cx, ax ; cx contains the number of blocs in complete lines + pop dx + + push dx + and dx, 0x00FF + add cx, dx ; cx now contains the number of complete blocs + pop dx + + push dx + mov ax, 8 + mov bl, dl + mul bl + add di, ax ; di now contains the position to write the next bloc + pop dx + + push cx + shr cx, 1 ; from the 'cx'ième pixel, we convert it into the 'cx'ième byte where it is stored (1 byte = 2 nibbles = 2 pixels) + mov si, MazeModel + add si, cx + mov al, [ds:si] ; now al contains the 2 hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel + + ;check if the hexa code is in the high or low nibble, by looking at the parity of the counter + pop cx + test cl, 1 ; + jnz .NoSecondNibble + shr ax, 4 + .NoSecondNibble: + + push dx + ; pick the sprite to display following the hexacode + and ax, 0xf ; keep only the concerned nibble containing the hexa code + ; Get the offset of the sprite, following the hexa code + mov si, MazeSpriteSheet + mov bx, 8*8 + mul bx + add si, ax ; si contains the offset of the sprite to display + pop dx + + ;we draw the bloc + push cx + push dx + mov dx,8 + .eachPixelsLine: + mov cx, 8 + rep movsb + add di, SCREEN_WIDTH - 8 + dec dx + jnz .eachPixelsLine + pop dx + pop cx + + inc dl + cmp dl, 40 + jne .eachBlocOfTheLine + inc dh + cmp dh, 25 + jne .eachBlocsLine + ret - mov cx, SCREEN_WIDTH*SCREEN_HEIGHT ; set the counter for rep - rep stosb ; to copy al into each byte of the target adress es:di byte per byte - - ; as es was containing ds, and ds was changed , we need to revert es and ds as in the begginning - ret DisplayMaze: push es @@ -101,7 +181,7 @@ section .text pop ds pop es - ret + ret FirstDisplayPacMan: @@ -110,7 +190,7 @@ section .text mov word [frameOf_PacMan], PACMAN_RIGHT_2 call Display_PacMan - ret + ret FirstDisplayGhosts: diff --git a/src/keyboard.asm b/src/keyboard.asm index a9e6783..24d4dd1 100644 --- a/src/keyboard.asm +++ b/src/keyboard.asm @@ -65,5 +65,3 @@ readKeyboard: ret - exit: - int 20h diff --git a/src/main.asm b/src/main.asm index 513214e..02e4bfc 100644 --- a/src/main.asm +++ b/src/main.asm @@ -7,10 +7,14 @@ section .text call SetVideoMode call BuildScreenBuffer ; set of functions allowing to write not directly in the video memory but in a buffer - ;call ClearScreen + call ClearScreen + call UpdateScreen + call BuildBackgroundBuffer call MazeToBGbuffer call DisplayMaze + call UpdateScreen + jmp exit call FirstDisplayPacMan call FirstDisplayGhosts @@ -54,3 +58,8 @@ section .text jmp gameloop ;----------------------------------------------------------------------------------------- +exit: +;reset the keyboard buffer and then wait for a keypress : + mov ax, 0C01h ; + int 21h + diff --git a/src/sprites.asm b/src/sprites.asm index 3efe174..c75e291 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -242,15 +242,3 @@ section .text jne .draw_loop pop es ret - - DrawMaze: - mov ax, 0xA000 - mov es, ax - mov dx, 8 - .eachLine: - mov cx, 8 - rep movsb - add di, 320-8 - dec dx - jnz .eachLine - ret \ No newline at end of file From 52ed63bba14a9130836d104bc529f96beb5ebc05 Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Sun, 3 Dec 2023 16:57:04 +0100 Subject: [PATCH 40/60] Maze tables Creation of the upper, lower, and total tables of the maze in big and little endians. --- src/Initialization.asm | 2 +- src/constants.asm | 236 +++++++++++++++++++++++++++++++++++++---- src/initialization.asm | 2 +- 3 files changed, 217 insertions(+), 23 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index 77c4e17..c439b3e 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -116,7 +116,7 @@ section .text push cx shr cx, 1 ; from the 'cx'ième pixel, we convert it into the 'cx'ième byte where it is stored (1 byte = 2 nibbles = 2 pixels) - mov si, MazeModel + mov si, MazeModel4LE add si, cx mov al, [ds:si] ; now al contains the 2 hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel diff --git a/src/constants.asm b/src/constants.asm index c422fff..12d5593 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -56,7 +56,7 @@ %define POWER_PELLET 44 ;not used, just there to see the matching table to write the maze just below -%define EMPTY 0 +%define INTER 0 %define OUT_TOP_LEFT_CORNER 1 %define OUT_TOP_RIGHT_CORNER 2 %define OUT_BOTTOM_LEFT_CORNER 3 @@ -102,17 +102,211 @@ section .data dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD dd 0xAAAAAA4A, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xA3AAAAAA + MazeModel2BE dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFF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64A, 0xAA4AA35A, 0xFFFFDCA6, 0xFFFFFFFF + dd 0x999979BD, 0x8DD79899, 0x99999979, 0xFFFFDC98, 0xFFFFFFFF + dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xFFFFDCDD, 0xFFFFFFFF + dd 0xAAAAAA4A, 0xAAAAAAAA, 0xAAAAAAAA, 0xFFFFA3AA, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + palette db 0, 44, 40, 15, 66, 33, 84, 52, 88, 48, 78, 3, 65, 0 spritesheet dd 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x20222002, 0x20022202, 0x20020002, 0x20002002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22202202, 0x20220222, 0x02002200, 0x00220020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x60666006, 0x60066606, 0x60060006, 0x60006006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66606606, 0x60660666, 0x06006600, 0x00660060, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x70777007, 0x70077707, 0x70070007, 0x70007007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77707707, 0x70770777, 0x07007700, 0x00770070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x40444004, 0x40044404, 0x40040004, 0x40004004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44404404, 0x40440444, 0x04004400, 0x00440040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x50555005, 0x50055505, 0x50050005, 0x50005005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x55505505, 0x50550555, 0x05005500, 0x00550050, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x30333003, 0x30033303, 0x30030003, 0x30003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x33303303, 0x30330333, 0x03003300, 0x00330030, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x30030000, 0x00300300, 0x33330000, 0x00333300, 0x55330000, 0x00553300, 0x55330000, 0x00553300, 0x30030000, 0x00300300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300300, 0x00003003, 0x00333300, 0x00003333, 0x00335500, 0x00003355, 0x00335500, 0x00003355, 0x00300300, 0x00003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00550000, 0x00005500, 0x30550300, 0x00305503, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x00330000, 0x00003300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00330000, 0x00003300, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x30550300, 0x00305503, 0x00550000, 0x00005500, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00000011, 0x11111100, 0x00000010, 0x11111100, 0x00000000, 0x10111101, 0x00000000, 0x00111101, 0x00000000, 0x00101101, 0x00000000, 0x00111101, 0x00000000, 0x10111101, 0x00000000, 0x11111100, 0x00000000, 0x11111100, 0x00000010, 0x11110100, 0x00000011, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00001011, 0x11111101, 0x00000000, 0x00101101, 0x00000000, 0x11111101, 0x00000000, 0x11111101, 0x00001011, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100100, 0x00001100, 0x00101100, 0x00101100, 0x00111100, 0x00101101, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11010000, 0x00001111, 0x11000000, 0x00101111, 0x01000000, 0x00101111, 0x00000000, 0x00111111, 0x00000000, 0x00111101, 0x00000000, 0x00111100, 0x00000000, 0x00111101, 0x00000000, 0x00111111, 0x01000000, 0x00101111, 0x11000000, 0x00101111, 0x11010000, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110000, 0x00111111, 0x01000000, 0x00111111, 0x00000000, 0x00111100, 0x01000000, 0x00111111, 0x11110000, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00101101, 0x00111100, 0x00001101, 0x00110100, 0x00001001, 0x00110000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x00111100, 0x00101101, 0x00101100, 0x00101100, 0x00100100, 0x00001100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00cc0000, 0x00000000, 0x00cccc00, 0x00000000, 0x00000ccc, 0x0c000000, 0x00000c00, 0xc0220200, 0x0000c000, 0x222c2200, 0x0000000c, 0x20222200, 0x0000222c, 0x02222300, 0x0020222c, 0x02322200, 0x00202222, 0x02220200, 0x00202232, 0x02000000, 0x00202223, 0x00000000, 0x00002222, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x93990000, 0x00009099, 0x99290200, 0x00002299, 0x29222200, 0x00202322, 0x22222300, 0x00202223, 0x23232200, 0x00202222, 0x22222200, 0x00203222, 0x23320200, 0x00002222, 0x22220200, 0x00002222, 0x32220000, 0x00000023, 0x22020000, 0x00000022, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00009009, 0x0c000000, 0x00909999, 0x0c000000, 0x00009909, 0xcc440000, 0x000044c4, 0x4c440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44440400, 0x00404444, 0x44440400, 0x00404444, 0x44040000, 0x00004044, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000c0, 0x0c220200, 0x00002202, 0x2c222200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222322, 0x22222200, 0x00222322, 0x22220200, 0x00203222, 0x22220200, 0x00202222, 0x22220000, 0x00002222, 0x20020000, 0x00002022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00b00000, 0x00000000, 0xbb0b0000, 0x000000bb, 0x0b000000, 0x00000000, 0x93000000, 0x00000090, 0x9b990000, 0x00009099, 0xb9b30900, 0x0000b999, 0x999b0900, 0x0000993b, 0x99b99300, 0x0090b9b9, 0x3b999b00, 0x00903b99, 0x99b99300, 0x009099b9, 0x3b9b0900, 0x0000993b, 0xb9990900, 0x0000b999, 0x999b0000, 0x0000909b, 0x99000000, 0x000000b0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x22005000, 0x00500020, 0x22025000, 0x00500022, 0x12225100, 0x00502112, 0x12115100, 0x00501111, 0x11115500, 0x00501511, 0x01510500, 0x00005501, 0x01550000, 0x00005005, 0x01050000, 0x00000005, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000010, 0x1d010000, 0x000010d1, 0x11110000, 0x00001111, 0xd1110000, 0x00001111, 0x111d0000, 0x00001111, 0x111d0100, 0x00101111, 0x111d0100, 0x00101111, 0x11110100, 0x00101111, 0x11d11100, 0x00111111, 0x11d11100, 0x00111111, 0x11111100, 0x00111111, 0xaaaa1a00, 0x00a1aa33, 0xaaaa0a00, 0x00a0aa33, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xaa000000, 0x000000a0, 0x00aa0000, 0x0000a00a, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x3d000000, 0x000000d0, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00001111, 0x10110100, 0x00101111, 0x10111100, 0x10111111, 0x10111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001011, 0x10110000, 0x00111111, 0x10111101, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001111, 0x10110100, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11110000, 0x00001011, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11111101, 0x00111111, 0x11111111, 0x10111111, 0x10111101, 0x00111111, 0x00110100, 0x00001101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11110100, 0x00001111, 0x11111101, 0x00111111, 0x10111101, 0x00111111, 0x00111100, 0x00101101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11010000, 0x00000011, 0x10000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000001, 0x10000000, 0x00000010, 0x00000100, 0x00000100, 0x00100000, 0x00001000, 0x00000000, 0x00000000, 0x00001100, 0x00100100, 0x00000000, 0x00000000, 0x00100000, 0x00001000, 0x00000100, 0x00000100, 0x10000000, 0x00000010, 0x00010000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x08000000, 0x00000080, 0x08000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x88000000, 0x00000088, 0x88080000, 0x00008088, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88080000, 0x00008088, 0x88000000, 0x00000088, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - MazeSpriteSheet db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Empty 0 - db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 - db 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + MazeSpriteSheet db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Inter 0 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Out Top Left Corner 1 db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 @@ -155,31 +349,31 @@ section .data db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; In Top Right Corner 6 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 ; In Bottom Left Corner 7 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 ; In Bottom Left Corner 7 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 ; In Bottom Right Corner 8 - db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; In Bottom Right Corner 8 + db 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 diff --git a/src/initialization.asm b/src/initialization.asm index 77c4e17..c439b3e 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -116,7 +116,7 @@ section .text push cx shr cx, 1 ; from the 'cx'ième pixel, we convert it into the 'cx'ième byte where it is stored (1 byte = 2 nibbles = 2 pixels) - mov si, MazeModel + mov si, MazeModel4LE add si, cx mov al, [ds:si] ; now al contains the 2 hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel From dc8ba035c0c1892c68b0728bead66ee036949fdf Mon Sep 17 00:00:00 2001 From: Maxime THIZEAU Date: Sun, 3 Dec 2023 22:21:51 +0100 Subject: [PATCH 41/60] Maze table version horizontal Creation of the tables for the maze in horizontal in little and big endians. --- src/Initialization.asm | 2 +- src/constants.asm | 64 ++++++++++++++++++++++++++++++++++++++---- src/initialization.asm | 2 +- 3 files changed, 60 insertions(+), 8 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index c439b3e..264e01d 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -116,7 +116,7 @@ section .text push cx shr cx, 1 ; from the 'cx'ième pixel, we convert it into the 'cx'ième byte where it is stored (1 byte = 2 nibbles = 2 pixels) - mov si, MazeModel4LE + mov si, MazeModel5LE add si, cx mov al, [ds:si] ; now al contains the 2 hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel diff --git a/src/constants.asm b/src/constants.asm index 12d5593..6c55303 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -102,7 +102,7 @@ section .data dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD dd 0xAAAAAA4A, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xA3AAAAAA - MazeModel2BE dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + MazeModel2BE dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF dd 0x19999999, 0x99999219, 0x99999999, 0X9992FFFF, 0xFFFFFFFF @@ -120,16 +120,16 @@ section .data dd 0xFFFFFBDC, 0xBF5AAAAA, 0xA6FCBDCF, 0xFFFFFFFF, 0xFFFFFFFF dd 0x999998D7, 0x8FCFFFFF, 0xFBF78D79, 0x9999FFFF, 0xFFFFFFFF dd 0xFFFFFFDF, 0xFFCFFFFF, 0xFBFFFDFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF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 0x19999999, 0x99999219, 0x99999999, 0X9992FFFF, 0xFFFFFFFF @@ -252,7 +252,7 @@ section .data dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - MazeModel4LE dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + MazeModel4LE dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF dd 0x99999919, 0x19929999, 0x99999999, 0XFFFF9299, 0xFFFFFFFF @@ -296,6 +296,58 @@ section .data dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF +MazeModel5BE dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0x19999999, 0x99999999, 0x92FFFFF1, 0x99999999, 0x99999992 + dd 0xBDDDDDDD, 0xDDDDDDDD, 0xDCFFFFFB, 0xDDDDDDDD, 0xDDDDDDDC + dd 0xBD56D5A6, 0xD5AAAAA6, 0xD7999998, 0xD5AAAAA6, 0xD56D56DC + dd 0xBDCBDCFB, 0xDC199998, 0xDDDDDDDD, 0xD7999998, 0xDCBD78DC + dd 0xBDCBECFB, 0xD78DDDDD, 0xD5AAAAA6, 0xDDDDDDDD, 0xDCBEDDDC + dd 0xBDCBDCFB, 0xDDDD5AA6, 0xDCFFFFFB, 0xD5AA6DD5, 0xA34AA6DC + dd 0xBD78D798, 0xD56DC198, 0xD7999998, 0xD792BDD7, 0x999998DC + dd 0xBDDDDDDD, 0xDCBD78FF, 0xFFFFFFFF, 0xFFFCBDDD, 0xDDDDDDDC + dd 0x4AAA6D56, 0xDCBDDDF5, 0xAAAAAAAA, 0xA6FCBD5A, 0xA6D5AAA3 + dd 0x99998DCB, 0xDC4AA6FC, 0x19999999, 0x2BF78DCF, 0xFBD79999 + dd 0xFFFFDDCB, 0xDCFFFBFC, 0xBFFFFFFF, 0xCBFDDDCF, 0xFBDFFFFF + dd 0xAAAA6DCB, 0xDC1998FC, 0x4AAAAAAA, 0x3BF56DCF, 0xFBD5AAAA + dd 0x19998D78, 0xDCBDDDF7, 0x99999999, 0x98FCBD79, 0x98D79992 + dd 0xBDDDDDDD, 0xDCBD56FF, 0xFFFFFFFF, 0xFFFCBDDD, 0xDDDDDDDC + dd 0xBD5AAAA6, 0xDCBDC4AA, 0xAA6D56D5, 0xAAA3BD5A, 0xAA6D56DC + dd 0xBDC19998, 0xD78D7999, 0x998DCBD7, 0x99998DCF, 0x198D78DC + dd 0xBDCBEDDD, 0xDDDDDDDD, 0xDDDDCBDD, 0xDDDDDDCF, 0xBDDEDDDC + dd 0xBDCBD5AA, 0x6D56D5A6, 0xD5AA34AA, 0x6D5AAA3F, 0xBD5AA6DC + dd 0xBD78D799, 0x8DCBD798, 0xD7999999, 0x8D799999, 0x8D7998DC + dd 0xBDDDDDDD, 0xDDCBDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDC + dd 0x4AAAAAAA, 0xAA34AAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAA3 + +MazeModel5LE dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF + dd 0x99999919, 0x99999999, 0xF1FFFF92, 0x99999999, 0x92999999 + dd 0xDDDDDDBD, 0xDDDDDDDD, 0xFBFFFFDC, 0xDDDDDDDD, 0xDCDDDDDD + dd 0xA6D556BD, 0xA6AAAAD5, 0x989999D7, 0xA6AAAAD5, 0xDC566DD5 + dd 0xFBDCCBBD, 0x989919DC, 0xDDDDDDDD, 0x989999D7, 0xDC78BDDC + dd 0xFBECCBBD, 0xDDDD8DD7, 0xA6AAAAD5, 0xDDDDDDDD, 0xDCDDBEDC + dd 0xFBDCCBBD, 0xA65ADDDD, 0xFBFFFFDC, 0xD56DAAD5, 0xDCA64AA3 + dd 0x98D778BD, 0x98C16DD5, 0x989999D7, 0xD7BD92D7, 0xDC989999 + dd 0xDDDDDDBD, 0xFF78BDDC, 0xFFFFFFFF, 0xDDBDFCFF, 0xDCDDDDDD + dd 0x566DAA4A, 0xF5DDBDDC, 0xAAAAAAAA, 0x5ABDFCA6, 0xA3AAD5A6 + dd 0xCB8D9999, 0xFCA64ADC, 0x99999919, 0xCF8DF72B, 0x9999D7FB + dd 0xCBDDFFFF, 0xFCFBFFDC, 0xFFFFFFBF, 0xCFDDFDCB, 0xFFFFDFFB + dd 0xCB6DAAAA, 0xFC9819DC, 0xAAAAAA4A, 0xCF6DF53B, 0xAAAAD5FB + dd 0x788D9919, 0xF7DDBDDC, 0x99999999, 0x79BDFC98, 0x9299D798 + dd 0xDDDDDDBD, 0xFF56BDDC, 0xFFFFFFFF, 0xDDBDFCFF, 0xDCDDDDDD + dd 0xA6AA5ABD, 0xAAC4BDDC, 0xD5566DAA, 0x5ABDA3AA, 0xDC566DAA + dd 0x9899C1BD, 0x99798DD7, 0xD7CB8D99, 0xCF8D9999, 0xDC788D19 + dd 0xDDEDCBBD, 0xDDDDDDDD, 0xDDCBDDDD, 0xCFDDDDDD, 0xDCDDDEBD + dd 0xAAD5CBBD, 0xA6D5566D, 0xAA34AAD5, 0x3FAA5A6D, 0xDCA65ABD + dd 0x99D778BD, 0x98D7CB8D, 0x999999D7, 0x9999798D, 0xDC98798D + dd 0xDDDDDDBD, 0xDDDDCBDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD + dd 0xAAAAAA4A, 0xAAAA34AA, 0xAAAAAAAA, 0xAAAAAAAA, 0xA3AAAAAA + palette db 0, 44, 40, 15, 66, 33, 84, 52, 88, 48, 78, 3, 65, 0 spritesheet dd 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x20222002, 0x20022202, 0x20020002, 0x20002002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22202202, 0x20220222, 0x02002200, 0x00220020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x60666006, 0x60066606, 0x60060006, 0x60006006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66606606, 0x60660666, 0x06006600, 0x00660060, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x70777007, 0x70077707, 0x70070007, 0x70007007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77707707, 0x70770777, 0x07007700, 0x00770070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x40444004, 0x40044404, 0x40040004, 0x40004004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44404404, 0x40440444, 0x04004400, 0x00440040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x50555005, 0x50055505, 0x50050005, 0x50005005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x55505505, 0x50550555, 0x05005500, 0x00550050, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x30333003, 0x30033303, 0x30030003, 0x30003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x33303303, 0x30330333, 0x03003300, 0x00330030, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x30030000, 0x00300300, 0x33330000, 0x00333300, 0x55330000, 0x00553300, 0x55330000, 0x00553300, 0x30030000, 0x00300300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300300, 0x00003003, 0x00333300, 0x00003333, 0x00335500, 0x00003355, 0x00335500, 0x00003355, 0x00300300, 0x00003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00550000, 0x00005500, 0x30550300, 0x00305503, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x00330000, 0x00003300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00330000, 0x00003300, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x30550300, 0x00305503, 0x00550000, 0x00005500, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00000011, 0x11111100, 0x00000010, 0x11111100, 0x00000000, 0x10111101, 0x00000000, 0x00111101, 0x00000000, 0x00101101, 0x00000000, 0x00111101, 0x00000000, 0x10111101, 0x00000000, 0x11111100, 0x00000000, 0x11111100, 0x00000010, 0x11110100, 0x00000011, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00001011, 0x11111101, 0x00000000, 0x00101101, 0x00000000, 0x11111101, 0x00000000, 0x11111101, 0x00001011, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100100, 0x00001100, 0x00101100, 0x00101100, 0x00111100, 0x00101101, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11010000, 0x00001111, 0x11000000, 0x00101111, 0x01000000, 0x00101111, 0x00000000, 0x00111111, 0x00000000, 0x00111101, 0x00000000, 0x00111100, 0x00000000, 0x00111101, 0x00000000, 0x00111111, 0x01000000, 0x00101111, 0x11000000, 0x00101111, 0x11010000, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110000, 0x00111111, 0x01000000, 0x00111111, 0x00000000, 0x00111100, 0x01000000, 0x00111111, 0x11110000, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00101101, 0x00111100, 0x00001101, 0x00110100, 0x00001001, 0x00110000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x00111100, 0x00101101, 0x00101100, 0x00101100, 0x00100100, 0x00001100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00cc0000, 0x00000000, 0x00cccc00, 0x00000000, 0x00000ccc, 0x0c000000, 0x00000c00, 0xc0220200, 0x0000c000, 0x222c2200, 0x0000000c, 0x20222200, 0x0000222c, 0x02222300, 0x0020222c, 0x02322200, 0x00202222, 0x02220200, 0x00202232, 0x02000000, 0x00202223, 0x00000000, 0x00002222, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x93990000, 0x00009099, 0x99290200, 0x00002299, 0x29222200, 0x00202322, 0x22222300, 0x00202223, 0x23232200, 0x00202222, 0x22222200, 0x00203222, 0x23320200, 0x00002222, 0x22220200, 0x00002222, 0x32220000, 0x00000023, 0x22020000, 0x00000022, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00009009, 0x0c000000, 0x00909999, 0x0c000000, 0x00009909, 0xcc440000, 0x000044c4, 0x4c440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44440400, 0x00404444, 0x44440400, 0x00404444, 0x44040000, 0x00004044, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000c0, 0x0c220200, 0x00002202, 0x2c222200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222322, 0x22222200, 0x00222322, 0x22220200, 0x00203222, 0x22220200, 0x00202222, 0x22220000, 0x00002222, 0x20020000, 0x00002022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00b00000, 0x00000000, 0xbb0b0000, 0x000000bb, 0x0b000000, 0x00000000, 0x93000000, 0x00000090, 0x9b990000, 0x00009099, 0xb9b30900, 0x0000b999, 0x999b0900, 0x0000993b, 0x99b99300, 0x0090b9b9, 0x3b999b00, 0x00903b99, 0x99b99300, 0x009099b9, 0x3b9b0900, 0x0000993b, 0xb9990900, 0x0000b999, 0x999b0000, 0x0000909b, 0x99000000, 0x000000b0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x22005000, 0x00500020, 0x22025000, 0x00500022, 0x12225100, 0x00502112, 0x12115100, 0x00501111, 0x11115500, 0x00501511, 0x01510500, 0x00005501, 0x01550000, 0x00005005, 0x01050000, 0x00000005, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000010, 0x1d010000, 0x000010d1, 0x11110000, 0x00001111, 0xd1110000, 0x00001111, 0x111d0000, 0x00001111, 0x111d0100, 0x00101111, 0x111d0100, 0x00101111, 0x11110100, 0x00101111, 0x11d11100, 0x00111111, 0x11d11100, 0x00111111, 0x11111100, 0x00111111, 0xaaaa1a00, 0x00a1aa33, 0xaaaa0a00, 0x00a0aa33, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xaa000000, 0x000000a0, 0x00aa0000, 0x0000a00a, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x3d000000, 0x000000d0, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00001111, 0x10110100, 0x00101111, 0x10111100, 0x10111111, 0x10111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001011, 0x10110000, 0x00111111, 0x10111101, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001111, 0x10110100, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11110000, 0x00001011, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11111101, 0x00111111, 0x11111111, 0x10111111, 0x10111101, 0x00111111, 0x00110100, 0x00001101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11110100, 0x00001111, 0x11111101, 0x00111111, 0x10111101, 0x00111111, 0x00111100, 0x00101101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11010000, 0x00000011, 0x10000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000001, 0x10000000, 0x00000010, 0x00000100, 0x00000100, 0x00100000, 0x00001000, 0x00000000, 0x00000000, 0x00001100, 0x00100100, 0x00000000, 0x00000000, 0x00100000, 0x00001000, 0x00000100, 0x00000100, 0x10000000, 0x00000010, 0x00010000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x08000000, 0x00000080, 0x08000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x88000000, 0x00000088, 0x88080000, 0x00008088, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88080000, 0x00008088, 0x88000000, 0x00000088, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/src/initialization.asm b/src/initialization.asm index c439b3e..264e01d 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -116,7 +116,7 @@ section .text push cx shr cx, 1 ; from the 'cx'ième pixel, we convert it into the 'cx'ième byte where it is stored (1 byte = 2 nibbles = 2 pixels) - mov si, MazeModel4LE + mov si, MazeModel5LE add si, cx mov al, [ds:si] ; now al contains the 2 hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel From 768d0f5bbb6487423379d5a804f59460036b72e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Mon, 4 Dec 2023 14:14:56 +0100 Subject: [PATCH 42/60] add the previous work on sprites on the new background aka the maze there are many bugs with the function which display and clear the sprites, but there is something intresting. --- src/constants.asm | 2 +- src/main.asm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/constants.asm b/src/constants.asm index 6c55303..35e5391 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -56,7 +56,7 @@ %define POWER_PELLET 44 ;not used, just there to see the matching table to write the maze just below -%define INTER 0 +%define INTER 0 %define OUT_TOP_LEFT_CORNER 1 %define OUT_TOP_RIGHT_CORNER 2 %define OUT_BOTTOM_LEFT_CORNER 3 diff --git a/src/main.asm b/src/main.asm index 02e4bfc..dba09ca 100644 --- a/src/main.asm +++ b/src/main.asm @@ -14,7 +14,7 @@ section .text call MazeToBGbuffer call DisplayMaze call UpdateScreen - jmp exit + call FirstDisplayPacMan call FirstDisplayGhosts From 9eb38181e4aef3748fdfc45287b661ebfcffcee7 Mon Sep 17 00:00:00 2001 From: Maxime CARON <145995231+MaximeAlgosup@users.noreply.github.com> Date: Mon, 4 Dec 2023 14:47:07 +0100 Subject: [PATCH 43/60] Add clock to dev Add clock to ensure that we have 24 frame per second --- src/constants.asm | 6 ++++++ src/main.asm | 42 +++++++++++++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/constants.asm b/src/constants.asm index 35e5391..8dac309 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -72,6 +72,12 @@ %define PELLET 0xD %define SUPER_PELLET 0xE %define BACKGROUND 0xF +; Clock cycle per second and desired FPS +%define CCPS 3000000 +%define FPS 24 + +; Clock percision is in µs +%define PERIOD CCPS / FPS section .data diff --git a/src/main.asm b/src/main.asm index dba09ca..7834c0e 100644 --- a/src/main.asm +++ b/src/main.asm @@ -1,6 +1,9 @@ section .bss buffScreen resb SPRITE_SIZE*SPRITE_SIZE ; where is stored the backuped screen +section .data + timestamp_of_next_frame dd 0, 0 ; timestamp of the next frame + section .text start: @@ -18,19 +21,19 @@ section .text call FirstDisplayPacMan call FirstDisplayGhosts - - - - - - - + ; Display the period + mov eax, PERIOD + shr eax, 16 + ; Store the current time + rdtsc + mov [timestamp_of_next_frame], eax ;----------------------------------------------------------------------------------------- ;THE GAME LOOP gameloop: ;------------------------------------------------- ;clear all + call waitLoop call ClearPinky call ClearBlinky call ClearInky @@ -58,8 +61,25 @@ section .text jmp gameloop ;----------------------------------------------------------------------------------------- -exit: -;reset the keyboard buffer and then wait for a keypress : - mov ax, 0C01h ; - int 21h + exit: + ;reset the keyboard buffer and then wait for a keypress : + mov ax, 0C01h ; + int 21h +;----------------------------------------------------------------------------------------- +; WAIT FOR THE NEXT FRAME + waitLoop: + .wait_for_next_frame: + ; Read the current time + rdtsc + + ; If not yet the correct time, keep going + cmp eax, [timestamp_of_next_frame] + jb .wait_for_next_frame + + ; Set next wait time + ; mov eax, [timestamp_of_next_frame] + add eax, PERIOD + mov [timestamp_of_next_frame], eax + ret +;----------------------------------------------------------------------------------------- From 8bdbdd8c5300e38e73e380cdb7c072bfa195a6f6 Mon Sep 17 00:00:00 2001 From: Malo-Archimbaud Date: Mon, 4 Dec 2023 14:57:03 +0100 Subject: [PATCH 44/60] Update main.asm Escape key fixed --- src/main.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.asm b/src/main.asm index dba09ca..292b28e 100644 --- a/src/main.asm +++ b/src/main.asm @@ -59,7 +59,7 @@ section .text ;----------------------------------------------------------------------------------------- exit: -;reset the keyboard buffer and then wait for a keypress : - mov ax, 0C01h ; - int 21h + mov ax, 3h + int 10h + int 20h From cca173dcea4cb05a8ec12f00eeab02c40a28f622 Mon Sep 17 00:00:00 2001 From: Malo-Archimbaud Date: Mon, 4 Dec 2023 15:52:46 +0100 Subject: [PATCH 45/60] Update keyboard.asm fixed keys --- src/keyboard.asm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/keyboard.asm b/src/keyboard.asm index 24d4dd1..d5be30f 100644 --- a/src/keyboard.asm +++ b/src/keyboard.asm @@ -1,5 +1,6 @@ section .data keyPressed dw 0 + changed db 0 section .text readKeyboard: @@ -34,6 +35,7 @@ readKeyboard: mov word[y_PacManVelocity], 0 call changePacManPosition mov word[frameOf_PacMan], PACMAN_LEFT_2 + inc byte[changed] .NoLeft: ; Right @@ -43,6 +45,7 @@ readKeyboard: mov word[y_PacManVelocity], 0 call changePacManPosition mov word[frameOf_PacMan], PACMAN_RIGHT_2 + inc byte[changed] .NoRight: ; Up @@ -52,6 +55,7 @@ readKeyboard: mov word[y_PacManVelocity], -1 call changePacManPosition mov word[frameOf_PacMan], PACMAN_UP_2 + inc byte[changed] .NoUp: ; Down @@ -61,7 +65,14 @@ readKeyboard: mov word[y_PacManVelocity], 1 call changePacManPosition mov word[frameOf_PacMan], PACMAN_DOWN_2 + inc byte[changed] .NoDown: + cmp byte [changed], 0 + jne .NoChange + call changePacManPosition + .NoChange: + + and byte [changed], 00 ret From 406d56c9e364090019f786462b62371bce02c79d Mon Sep 17 00:00:00 2001 From: Malo-Archimbaud Date: Mon, 4 Dec 2023 21:16:20 +0100 Subject: [PATCH 46/60] Update move_sprites.asm fixed wrong eye sprite when speed different than 1 or -1 --- src/move_sprites.asm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/move_sprites.asm b/src/move_sprites.asm index afa6fd3..3575eac 100644 --- a/src/move_sprites.asm +++ b/src/move_sprites.asm @@ -49,23 +49,23 @@ changeGhostPosition: changeGhostFrames: - cmp dx, 1 - jne .noEyesRight + cmp dx, 0 + jle .noEyesRight mov ax, EYES_RIGHT .noEyesRight: - cmp dx, -1 - jne .noEyesLeft + cmp dx, 0 + jge .noEyesLeft mov ax, EYES_LEFT .noEyesLeft: - cmp cx, 1 - jne .noEyesDown + cmp cx, 0 + jle .noEyesDown mov ax, EYES_DOWN .noEyesDown: - cmp cx, -1 - jne .noEyesUp + cmp cx, 0 + jge .noEyesUp mov ax, EYES_UP .noEyesUp: From 939ef5862af796eb8202ab147099b95628c99ef1 Mon Sep 17 00:00:00 2001 From: Malo-Archimbaud Date: Tue, 5 Dec 2023 23:52:27 +0100 Subject: [PATCH 47/60] changed Pac-Man and ghosts spawn coordinates --- src/Initialization.asm | 28 ++++++++++++++-------------- src/initialization.asm | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index 264e01d..ef516b7 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -185,41 +185,41 @@ section .text FirstDisplayPacMan: - mov word [x_PacManPosition], 100 - mov word [y_PacManPosition], 100 + mov word [x_PacManPosition], 160 + mov word [y_PacManPosition], 132 mov word [frameOf_PacMan], PACMAN_RIGHT_2 call Display_PacMan ret FirstDisplayGhosts: - - mov word [x_PinkyPosition], 30 - mov word [y_PinkyPosition], 30 + ;pinky + mov word [x_PinkyPosition], 160 + mov word [y_PinkyPosition], 108 mov word [frameOf_Pinky], PINKY_1 mov word [frameOf_Pinky_eyes], EYES_UP call Display_Pinky mov word [x_PinkyVelocity], 0 mov word [y_PinkyVelocity], -1 - - mov word [x_BlinkyPosition], 274 - mov word [y_BlinkyPosition], 30 + ;blinky + mov word [x_BlinkyPosition], 160 + mov word [y_BlinkyPosition], 84 mov word [frameOf_Blinky], BLINKY_1 mov word [frameOf_Blinky_eyes], EYES_RIGHT call Display_Blinky mov word [x_BlinkyVelocity], 1 mov word [y_BlinkyVelocity], 0 - - mov word [x_InkyPosition], 30 - mov word [y_InkyPosition], 146 + ;inky + mov word [x_InkyPosition], 144 + mov word [y_InkyPosition], 108 mov word [frameOf_Inky], INKY_1 mov word [frameOf_Inky_eyes], EYES_DOWN call Display_Inky mov word [x_InkyVelocity], 0 mov word [y_InkyVelocity], 1 - - mov word [x_ClydePosition], 274 - mov word [y_ClydePosition], 146 + ;clyde + mov word [x_ClydePosition], 176 + mov word [y_ClydePosition], 108 mov word [frameOf_Clyde], CLYDE_1 mov word [frameOf_Clyde_eyes], EYES_LEFT call Display_Clyde diff --git a/src/initialization.asm b/src/initialization.asm index 264e01d..ef516b7 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -185,41 +185,41 @@ section .text FirstDisplayPacMan: - mov word [x_PacManPosition], 100 - mov word [y_PacManPosition], 100 + mov word [x_PacManPosition], 160 + mov word [y_PacManPosition], 132 mov word [frameOf_PacMan], PACMAN_RIGHT_2 call Display_PacMan ret FirstDisplayGhosts: - - mov word [x_PinkyPosition], 30 - mov word [y_PinkyPosition], 30 + ;pinky + mov word [x_PinkyPosition], 160 + mov word [y_PinkyPosition], 108 mov word [frameOf_Pinky], PINKY_1 mov word [frameOf_Pinky_eyes], EYES_UP call Display_Pinky mov word [x_PinkyVelocity], 0 mov word [y_PinkyVelocity], -1 - - mov word [x_BlinkyPosition], 274 - mov word [y_BlinkyPosition], 30 + ;blinky + mov word [x_BlinkyPosition], 160 + mov word [y_BlinkyPosition], 84 mov word [frameOf_Blinky], BLINKY_1 mov word [frameOf_Blinky_eyes], EYES_RIGHT call Display_Blinky mov word [x_BlinkyVelocity], 1 mov word [y_BlinkyVelocity], 0 - - mov word [x_InkyPosition], 30 - mov word [y_InkyPosition], 146 + ;inky + mov word [x_InkyPosition], 144 + mov word [y_InkyPosition], 108 mov word [frameOf_Inky], INKY_1 mov word [frameOf_Inky_eyes], EYES_DOWN call Display_Inky mov word [x_InkyVelocity], 0 mov word [y_InkyVelocity], 1 - - mov word [x_ClydePosition], 274 - mov word [y_ClydePosition], 146 + ;clyde + mov word [x_ClydePosition], 176 + mov word [y_ClydePosition], 108 mov word [frameOf_Clyde], CLYDE_1 mov word [frameOf_Clyde_eyes], EYES_LEFT call Display_Clyde From 7f0016ea8fe353ed5577b70d6d09cb95683360ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Thu, 7 Dec 2023 09:10:48 +0100 Subject: [PATCH 48/60] changed the way to draw the background buffer from the maze model Now, each bloc is encoded by a byte, corresponding to a kind of bloc. However, there is a bloc on the right, not displayed, I am trying to fix it. Btw, the current maze is random , with a red square on each screen to easily validate the displaying. --- src/Initialization.asm | 16 +- src/constants.asm | 342 ++++++----------------------------------- src/initialization.asm | 16 +- src/main.asm | 1 + 4 files changed, 58 insertions(+), 317 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index 264e01d..8617624 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -114,22 +114,14 @@ section .text add di, ax ; di now contains the position to write the next bloc pop dx - push cx - shr cx, 1 ; from the 'cx'ième pixel, we convert it into the 'cx'ième byte where it is stored (1 byte = 2 nibbles = 2 pixels) - mov si, MazeModel5LE + mov si, MazeModel add si, cx - mov al, [ds:si] ; now al contains the 2 hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel + mov al, [ds:si] ; now al contains the hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel + + - ;check if the hexa code is in the high or low nibble, by looking at the parity of the counter - pop cx - test cl, 1 ; - jnz .NoSecondNibble - shr ax, 4 - .NoSecondNibble: - push dx ; pick the sprite to display following the hexacode - and ax, 0xf ; keep only the concerned nibble containing the hexa code ; Get the offset of the sprite, following the hexa code mov si, MazeSpriteSheet mov bx, 8*8 diff --git a/src/constants.asm b/src/constants.asm index 35e5391..771337e 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -56,309 +56,65 @@ %define POWER_PELLET 44 ;not used, just there to see the matching table to write the maze just below -%define INTER 0 -%define OUT_TOP_LEFT_CORNER 1 -%define OUT_TOP_RIGHT_CORNER 2 -%define OUT_BOTTOM_LEFT_CORNER 3 -%define OUT_BOTTOM_RIGHT_CORNER 4 -%define IN_TOP_LEFT_CORNER 5 -%define IN_TOP_RIGHT_CORNER 6 -%define IN_BOTTOM_LEFT_CORNER 7 -%define IN_BOTTOM_RIGHT_CORNER 8 -%define TOP_LINE 9 -%define BOTTOM_LINE 0xA -%define LEFT_LINE 0xB -%define RIGHT_LINE 0xC -%define PELLET 0xD -%define SUPER_PELLET 0xE -%define BACKGROUND 0xF +%define INTER 00 +%define OUT_TOP_LEFT_CORNER 01 +%define OUT_TOP_RIGHT_CORNER 02 +%define OUT_BOTTOM_LEFT_CORNER 03 +%define OUT_BOTTOM_RIGHT_CORNER 04 +%define IN_TOP_LEFT_CORNER 05 +%define IN_TOP_RIGHT_CORNER 06 +%define IN_BOTTOM_LEFT_CORNER 07 +%define IN_BOTTOM_RIGHT_CORNER 08 +%define TOP_LINE 09 +%define BOTTOM_LINE 0x0A +%define LEFT_LINE 0x0B +%define RIGHT_LINE 0x0C +%define PELLET 0x0D +%define SUPER_PELLET 0x0E +%define BACKGROUND 0x0F section .data - MazeModel dd 0x99999919, 0x99999999, 0x99999999, 0x99999999, 0x92999999 - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD,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x00, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x02, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x01, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x00 - MazeModel4BE dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0x19999999, 0x99999219, 0x99999999, 0X9992FFFF, 0xFFFFFFFF - dd 0xBDDDDDDD, 0xDDDDDCBD, 0xDDDDDDDD, 0xDDDCFFFF, 0xFFFFFFFF - dd 0xBD5AA6D5, 0xAAA6DCBD, 0x5AAA6D5A, 0xA6DCFFFF, 0xFFFFFFFF - dd 0xBECFFBDC, 0xFFFBDCBD, 0xCFFFBDCF, 0xFBECFFFF, 0xFFFFFFFF - dd 0xBD7998D7, 0x9998D78D, 0x79998D79, 0x98DCFFFF, 0xFFFFFFFF - dd 0xBDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDCFFFF, 0xFFFFFFFF - dd 0xBD5AA6D5, 0x6D5AAAAA, 0xA6D56D5A, 0xA6DCFFFF, 0xFFFFFFFF - dd 0xBD7998DC, 0xBD799219, 0x98DCBD79, 0x98DCFFFF, 0xFFFFFFFF - dd 0xBDDDDDDC, 0xBDDDDCBD, 0xDDDCBDDD, 0xDDDCFFFF, 0xFFFFFFFF - dd 0x4AAAA6DC, 0x4AA6FCBF, 0x5AA3BD5A, 0xAAA3FFFF, 0xFFFFFFFF - dd 0xFFFFFBDC, 0x1998F78F, 0x7992BDCF, 0xFFFFFFFF,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FFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - -MazeModel5BE dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0x19999999, 0x99999999, 0x92FFFFF1, 0x99999999, 0x99999992 - dd 0xBDDDDDDD, 0xDDDDDDDD, 0xDCFFFFFB, 0xDDDDDDDD, 0xDDDDDDDC - dd 0xBD56D5A6, 0xD5AAAAA6, 0xD7999998, 0xD5AAAAA6, 0xD56D56DC - dd 0xBDCBDCFB, 0xDC199998, 0xDDDDDDDD, 0xD7999998, 0xDCBD78DC - dd 0xBDCBECFB, 0xD78DDDDD, 0xD5AAAAA6, 0xDDDDDDDD, 0xDCBEDDDC - dd 0xBDCBDCFB, 0xDDDD5AA6, 0xDCFFFFFB, 0xD5AA6DD5, 0xA34AA6DC - dd 0xBD78D798, 0xD56DC198, 0xD7999998, 0xD792BDD7, 0x999998DC - dd 0xBDDDDDDD, 0xDCBD78FF, 0xFFFFFFFF, 0xFFFCBDDD, 0xDDDDDDDC - dd 0x4AAA6D56, 0xDCBDDDF5, 0xAAAAAAAA, 0xA6FCBD5A, 0xA6D5AAA3 - dd 0x99998DCB, 0xDC4AA6FC, 0x19999999, 0x2BF78DCF, 0xFBD79999 - dd 0xFFFFDDCB, 0xDCFFFBFC, 0xBFFFFFFF, 0xCBFDDDCF, 0xFBDFFFFF - dd 0xAAAA6DCB, 0xDC1998FC, 0x4AAAAAAA, 0x3BF56DCF, 0xFBD5AAAA - dd 0x19998D78, 0xDCBDDDF7, 0x99999999, 0x98FCBD79, 0x98D79992 - dd 0xBDDDDDDD, 0xDCBD56FF, 0xFFFFFFFF, 0xFFFCBDDD, 0xDDDDDDDC - dd 0xBD5AAAA6, 0xDCBDC4AA, 0xAA6D56D5, 0xAAA3BD5A, 0xAA6D56DC - dd 0xBDC19998, 0xD78D7999, 0x998DCBD7, 0x99998DCF, 0x198D78DC - dd 0xBDCBEDDD, 0xDDDDDDDD, 0xDDDDCBDD, 0xDDDDDDCF, 0xBDDEDDDC - dd 0xBDCBD5AA, 0x6D56D5A6, 0xD5AA34AA, 0x6D5AAA3F, 0xBD5AA6DC - dd 0xBD78D799, 0x8DCBD798, 0xD7999999, 0x8D799999, 0x8D7998DC - dd 0xBDDDDDDD, 0xDDCBDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDC - dd 0x4AAAAAAA, 0xAA34AAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAA3 -MazeModel5LE dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0x99999919, 0x99999999, 0xF1FFFF92, 0x99999999, 0x92999999 - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xFBFFFFDC, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xA6D556BD, 0xA6AAAAD5, 0x989999D7, 0xA6AAAAD5, 0xDC566DD5 - dd 0xFBDCCBBD, 0x989919DC, 0xDDDDDDDD, 0x989999D7, 0xDC78BDDC - dd 0xFBECCBBD, 0xDDDD8DD7, 0xA6AAAAD5, 0xDDDDDDDD, 0xDCDDBEDC - dd 0xFBDCCBBD, 0xA65ADDDD, 0xFBFFFFDC, 0xD56DAAD5, 0xDCA64AA3 - dd 0x98D778BD, 0x98C16DD5, 0x989999D7, 0xD7BD92D7, 0xDC989999 - dd 0xDDDDDDBD, 0xFF78BDDC, 0xFFFFFFFF, 0xDDBDFCFF, 0xDCDDDDDD - dd 0x566DAA4A, 0xF5DDBDDC, 0xAAAAAAAA, 0x5ABDFCA6, 0xA3AAD5A6 - dd 0xCB8D9999, 0xFCA64ADC, 0x99999919, 0xCF8DF72B, 0x9999D7FB - dd 0xCBDDFFFF, 0xFCFBFFDC, 0xFFFFFFBF, 0xCFDDFDCB, 0xFFFFDFFB - dd 0xCB6DAAAA, 0xFC9819DC, 0xAAAAAA4A, 0xCF6DF53B, 0xAAAAD5FB - dd 0x788D9919, 0xF7DDBDDC, 0x99999999, 0x79BDFC98, 0x9299D798 - dd 0xDDDDDDBD, 0xFF56BDDC, 0xFFFFFFFF, 0xDDBDFCFF, 0xDCDDDDDD - dd 0xA6AA5ABD, 0xAAC4BDDC, 0xD5566DAA, 0x5ABDA3AA, 0xDC566DAA - dd 0x9899C1BD, 0x99798DD7, 0xD7CB8D99, 0xCF8D9999, 0xDC788D19 - dd 0xDDEDCBBD, 0xDDDDDDDD, 0xDDCBDDDD, 0xCFDDDDDD, 0xDCDDDEBD - dd 0xAAD5CBBD, 0xA6D5566D, 0xAA34AAD5, 0x3FAA5A6D, 0xDCA65ABD - dd 0x99D778BD, 0x98D7CB8D, 0x999999D7, 0x9999798D, 0xDC98798D - dd 0xDDDDDDBD, 0xDDDDCBDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xAAAAAA4A, 0xAAAA34AA, 0xAAAAAAAA, 0xAAAAAAAA, 0xA3AAAAAA palette db 0, 44, 40, 15, 66, 33, 84, 52, 88, 48, 78, 3, 65, 0 spritesheet dd 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x20222002, 0x20022202, 0x20020002, 0x20002002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22202202, 0x20220222, 0x02002200, 0x00220020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x60666006, 0x60066606, 0x60060006, 0x60006006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66606606, 0x60660666, 0x06006600, 0x00660060, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x70777007, 0x70077707, 0x70070007, 0x70007007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77707707, 0x70770777, 0x07007700, 0x00770070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x40444004, 0x40044404, 0x40040004, 0x40004004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44404404, 0x40440444, 0x04004400, 0x00440040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x50555005, 0x50055505, 0x50050005, 0x50005005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x55505505, 0x50550555, 0x05005500, 0x00550050, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x30333003, 0x30033303, 0x30030003, 0x30003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x33303303, 0x30330333, 0x03003300, 0x00330030, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x30030000, 0x00300300, 0x33330000, 0x00333300, 0x55330000, 0x00553300, 0x55330000, 0x00553300, 0x30030000, 0x00300300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300300, 0x00003003, 0x00333300, 0x00003333, 0x00335500, 0x00003355, 0x00335500, 0x00003355, 0x00300300, 0x00003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00550000, 0x00005500, 0x30550300, 0x00305503, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x00330000, 0x00003300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00330000, 0x00003300, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x30550300, 0x00305503, 0x00550000, 0x00005500, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00000011, 0x11111100, 0x00000010, 0x11111100, 0x00000000, 0x10111101, 0x00000000, 0x00111101, 0x00000000, 0x00101101, 0x00000000, 0x00111101, 0x00000000, 0x10111101, 0x00000000, 0x11111100, 0x00000000, 0x11111100, 0x00000010, 0x11110100, 0x00000011, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00001011, 0x11111101, 0x00000000, 0x00101101, 0x00000000, 0x11111101, 0x00000000, 0x11111101, 0x00001011, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100100, 0x00001100, 0x00101100, 0x00101100, 0x00111100, 0x00101101, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11010000, 0x00001111, 0x11000000, 0x00101111, 0x01000000, 0x00101111, 0x00000000, 0x00111111, 0x00000000, 0x00111101, 0x00000000, 0x00111100, 0x00000000, 0x00111101, 0x00000000, 0x00111111, 0x01000000, 0x00101111, 0x11000000, 0x00101111, 0x11010000, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110000, 0x00111111, 0x01000000, 0x00111111, 0x00000000, 0x00111100, 0x01000000, 0x00111111, 0x11110000, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00101101, 0x00111100, 0x00001101, 0x00110100, 0x00001001, 0x00110000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x00111100, 0x00101101, 0x00101100, 0x00101100, 0x00100100, 0x00001100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00cc0000, 0x00000000, 0x00cccc00, 0x00000000, 0x00000ccc, 0x0c000000, 0x00000c00, 0xc0220200, 0x0000c000, 0x222c2200, 0x0000000c, 0x20222200, 0x0000222c, 0x02222300, 0x0020222c, 0x02322200, 0x00202222, 0x02220200, 0x00202232, 0x02000000, 0x00202223, 0x00000000, 0x00002222, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x93990000, 0x00009099, 0x99290200, 0x00002299, 0x29222200, 0x00202322, 0x22222300, 0x00202223, 0x23232200, 0x00202222, 0x22222200, 0x00203222, 0x23320200, 0x00002222, 0x22220200, 0x00002222, 0x32220000, 0x00000023, 0x22020000, 0x00000022, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00009009, 0x0c000000, 0x00909999, 0x0c000000, 0x00009909, 0xcc440000, 0x000044c4, 0x4c440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44440400, 0x00404444, 0x44440400, 0x00404444, 0x44040000, 0x00004044, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000c0, 0x0c220200, 0x00002202, 0x2c222200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222322, 0x22222200, 0x00222322, 0x22220200, 0x00203222, 0x22220200, 0x00202222, 0x22220000, 0x00002222, 0x20020000, 0x00002022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00b00000, 0x00000000, 0xbb0b0000, 0x000000bb, 0x0b000000, 0x00000000, 0x93000000, 0x00000090, 0x9b990000, 0x00009099, 0xb9b30900, 0x0000b999, 0x999b0900, 0x0000993b, 0x99b99300, 0x0090b9b9, 0x3b999b00, 0x00903b99, 0x99b99300, 0x009099b9, 0x3b9b0900, 0x0000993b, 0xb9990900, 0x0000b999, 0x999b0000, 0x0000909b, 0x99000000, 0x000000b0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x22005000, 0x00500020, 0x22025000, 0x00500022, 0x12225100, 0x00502112, 0x12115100, 0x00501111, 0x11115500, 0x00501511, 0x01510500, 0x00005501, 0x01550000, 0x00005005, 0x01050000, 0x00000005, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000010, 0x1d010000, 0x000010d1, 0x11110000, 0x00001111, 0xd1110000, 0x00001111, 0x111d0000, 0x00001111, 0x111d0100, 0x00101111, 0x111d0100, 0x00101111, 0x11110100, 0x00101111, 0x11d11100, 0x00111111, 0x11d11100, 0x00111111, 0x11111100, 0x00111111, 0xaaaa1a00, 0x00a1aa33, 0xaaaa0a00, 0x00a0aa33, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xaa000000, 0x000000a0, 0x00aa0000, 0x0000a00a, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x3d000000, 0x000000d0, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00001111, 0x10110100, 0x00101111, 0x10111100, 0x10111111, 0x10111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001011, 0x10110000, 0x00111111, 0x10111101, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001111, 0x10110100, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11110000, 0x00001011, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11111101, 0x00111111, 0x11111111, 0x10111111, 0x10111101, 0x00111111, 0x00110100, 0x00001101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11110100, 0x00001111, 0x11111101, 0x00111111, 0x10111101, 0x00111111, 0x00111100, 0x00101101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11010000, 0x00000011, 0x10000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000001, 0x10000000, 0x00000010, 0x00000100, 0x00000100, 0x00100000, 0x00001000, 0x00000000, 0x00000000, 0x00001100, 0x00100100, 0x00000000, 0x00000000, 0x00100000, 0x00001000, 0x00000100, 0x00000100, 0x10000000, 0x00000010, 0x00010000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x08000000, 0x00000080, 0x08000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x88000000, 0x00000088, 0x88080000, 0x00008088, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88080000, 0x00008088, 0x88000000, 0x00000088, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - MazeSpriteSheet db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Inter 0 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + MazeSpriteSheet db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 ; Inter 0 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Out Top Left Corner 1 db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 diff --git a/src/initialization.asm b/src/initialization.asm index 264e01d..8617624 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -114,22 +114,14 @@ section .text add di, ax ; di now contains the position to write the next bloc pop dx - push cx - shr cx, 1 ; from the 'cx'ième pixel, we convert it into the 'cx'ième byte where it is stored (1 byte = 2 nibbles = 2 pixels) - mov si, MazeModel5LE + mov si, MazeModel add si, cx - mov al, [ds:si] ; now al contains the 2 hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel + mov al, [ds:si] ; now al contains the hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel + + - ;check if the hexa code is in the high or low nibble, by looking at the parity of the counter - pop cx - test cl, 1 ; - jnz .NoSecondNibble - shr ax, 4 - .NoSecondNibble: - push dx ; pick the sprite to display following the hexacode - and ax, 0xf ; keep only the concerned nibble containing the hexa code ; Get the offset of the sprite, following the hexa code mov si, MazeSpriteSheet mov bx, 8*8 diff --git a/src/main.asm b/src/main.asm index dba09ca..3951004 100644 --- a/src/main.asm +++ b/src/main.asm @@ -14,6 +14,7 @@ section .text call MazeToBGbuffer call DisplayMaze call UpdateScreen + jmp exit call FirstDisplayPacMan call FirstDisplayGhosts From 88a72ea00d6242448734beecb156728aa4ab0d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:15:13 +0100 Subject: [PATCH 49/60] maze fixed the content of the maze model is random , but we just have to define it. to fix the bug, just added a "xor ax, ax" to unpolluate the register --- src/Initialization.asm | 27 ++---- src/constants.asm | 191 ----------------------------------------- src/entry.asm | 1 + src/initialization.asm | 27 ++---- src/maze.asm | 191 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 204 insertions(+), 233 deletions(-) create mode 100644 src/maze.asm diff --git a/src/Initialization.asm b/src/Initialization.asm index 8617624..c8e20bd 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -2,7 +2,6 @@ section .bss BackgroundBufferSegment resw 1 ; where is stored the dynamic background (dynamic cuz gums are disappearing). Used to restore the screen after a ghost's passage ScreenBufferSegment resw 1 -section .data section .text @@ -65,22 +64,8 @@ section .text ret - - - - - - - - - - - - - MazeToBGbuffer: - int3 - xor dx, dx + xor dx, dx ; dh and dl are counters : dh will always contains the number of complete lines, dl contains the number of complete blocs in this line push word [BackgroundBufferSegment] pop es ;ds is ok @@ -88,9 +73,9 @@ section .text mov dl, 0 ; blocs in a line .eachBlocOfTheLine: push dx - mov ax, 0xA00 ; number of pixels in a bloc's line + mov ax, 8*SCREEN_WIDTH ; number of pixels in a bloc's line = 320*8 = 8*8*(40 blocs in a line) mov bl, dh - and bx, 0x00FF + and bx, 0x00FF mul bx mov di, ax ; di contains the number of pixels in complete lines pop dx @@ -116,9 +101,9 @@ section .text mov si, MazeModel add si, cx + xor ax, ax mov al, [ds:si] ; now al contains the hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel - push dx ; pick the sprite to display following the hexacode @@ -144,10 +129,10 @@ section .text inc dl cmp dl, 40 - jne .eachBlocOfTheLine + jb .eachBlocOfTheLine inc dh cmp dh, 25 - jne .eachBlocsLine + jb .eachBlocsLine ret diff --git a/src/constants.asm b/src/constants.asm index 771337e..ce4d416 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -55,198 +55,7 @@ %define DOT 43 %define POWER_PELLET 44 -;not used, just there to see the matching table to write the maze just below -%define INTER 00 -%define OUT_TOP_LEFT_CORNER 01 -%define OUT_TOP_RIGHT_CORNER 02 -%define OUT_BOTTOM_LEFT_CORNER 03 -%define OUT_BOTTOM_RIGHT_CORNER 04 -%define IN_TOP_LEFT_CORNER 05 -%define IN_TOP_RIGHT_CORNER 06 -%define IN_BOTTOM_LEFT_CORNER 07 -%define IN_BOTTOM_RIGHT_CORNER 08 -%define TOP_LINE 09 -%define BOTTOM_LINE 0x0A -%define LEFT_LINE 0x0B -%define RIGHT_LINE 0x0C -%define PELLET 0x0D -%define SUPER_PELLET 0x0E -%define BACKGROUND 0x0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09, 0x09, 0x09, 0x09, 0x08, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x07, 0x09, 0x09, 0x09, 0x09, 0x09, 0x08, 0x0D, 0x0C, 0x0B, 0x0D, 0x07, 0x08, 0x0D, 0x0C - db 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F - db 0x00, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x02, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x01, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x00 - - palette db 0, 44, 40, 15, 66, 33, 84, 52, 88, 48, 78, 3, 65, 0 spritesheet dd 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x20222002, 0x20022202, 0x20020002, 0x20002002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22202202, 0x20220222, 0x02002200, 0x00220020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x60666006, 0x60066606, 0x60060006, 0x60006006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66606606, 0x60660666, 0x06006600, 0x00660060, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x70777007, 0x70077707, 0x70070007, 0x70007007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77707707, 0x70770777, 0x07007700, 0x00770070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x40444004, 0x40044404, 0x40040004, 0x40004004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44404404, 0x40440444, 0x04004400, 0x00440040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x50555005, 0x50055505, 0x50050005, 0x50005005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x55505505, 0x50550555, 0x05005500, 0x00550050, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x30333003, 0x30033303, 0x30030003, 0x30003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x33303303, 0x30330333, 0x03003300, 0x00330030, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x30030000, 0x00300300, 0x33330000, 0x00333300, 0x55330000, 0x00553300, 0x55330000, 0x00553300, 0x30030000, 0x00300300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300300, 0x00003003, 0x00333300, 0x00003333, 0x00335500, 0x00003355, 0x00335500, 0x00003355, 0x00300300, 0x00003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00550000, 0x00005500, 0x30550300, 0x00305503, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x00330000, 0x00003300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00330000, 0x00003300, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x30550300, 0x00305503, 0x00550000, 0x00005500, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00000011, 0x11111100, 0x00000010, 0x11111100, 0x00000000, 0x10111101, 0x00000000, 0x00111101, 0x00000000, 0x00101101, 0x00000000, 0x00111101, 0x00000000, 0x10111101, 0x00000000, 0x11111100, 0x00000000, 0x11111100, 0x00000010, 0x11110100, 0x00000011, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00001011, 0x11111101, 0x00000000, 0x00101101, 0x00000000, 0x11111101, 0x00000000, 0x11111101, 0x00001011, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100100, 0x00001100, 0x00101100, 0x00101100, 0x00111100, 0x00101101, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11010000, 0x00001111, 0x11000000, 0x00101111, 0x01000000, 0x00101111, 0x00000000, 0x00111111, 0x00000000, 0x00111101, 0x00000000, 0x00111100, 0x00000000, 0x00111101, 0x00000000, 0x00111111, 0x01000000, 0x00101111, 0x11000000, 0x00101111, 0x11010000, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110000, 0x00111111, 0x01000000, 0x00111111, 0x00000000, 0x00111100, 0x01000000, 0x00111111, 0x11110000, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00101101, 0x00111100, 0x00001101, 0x00110100, 0x00001001, 0x00110000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x00111100, 0x00101101, 0x00101100, 0x00101100, 0x00100100, 0x00001100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00cc0000, 0x00000000, 0x00cccc00, 0x00000000, 0x00000ccc, 0x0c000000, 0x00000c00, 0xc0220200, 0x0000c000, 0x222c2200, 0x0000000c, 0x20222200, 0x0000222c, 0x02222300, 0x0020222c, 0x02322200, 0x00202222, 0x02220200, 0x00202232, 0x02000000, 0x00202223, 0x00000000, 0x00002222, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x93990000, 0x00009099, 0x99290200, 0x00002299, 0x29222200, 0x00202322, 0x22222300, 0x00202223, 0x23232200, 0x00202222, 0x22222200, 0x00203222, 0x23320200, 0x00002222, 0x22220200, 0x00002222, 0x32220000, 0x00000023, 0x22020000, 0x00000022, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00009009, 0x0c000000, 0x00909999, 0x0c000000, 0x00009909, 0xcc440000, 0x000044c4, 0x4c440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44440400, 0x00404444, 0x44440400, 0x00404444, 0x44040000, 0x00004044, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000c0, 0x0c220200, 0x00002202, 0x2c222200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222322, 0x22222200, 0x00222322, 0x22220200, 0x00203222, 0x22220200, 0x00202222, 0x22220000, 0x00002222, 0x20020000, 0x00002022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00b00000, 0x00000000, 0xbb0b0000, 0x000000bb, 0x0b000000, 0x00000000, 0x93000000, 0x00000090, 0x9b990000, 0x00009099, 0xb9b30900, 0x0000b999, 0x999b0900, 0x0000993b, 0x99b99300, 0x0090b9b9, 0x3b999b00, 0x00903b99, 0x99b99300, 0x009099b9, 0x3b9b0900, 0x0000993b, 0xb9990900, 0x0000b999, 0x999b0000, 0x0000909b, 0x99000000, 0x000000b0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x22005000, 0x00500020, 0x22025000, 0x00500022, 0x12225100, 0x00502112, 0x12115100, 0x00501111, 0x11115500, 0x00501511, 0x01510500, 0x00005501, 0x01550000, 0x00005005, 0x01050000, 0x00000005, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000010, 0x1d010000, 0x000010d1, 0x11110000, 0x00001111, 0xd1110000, 0x00001111, 0x111d0000, 0x00001111, 0x111d0100, 0x00101111, 0x111d0100, 0x00101111, 0x11110100, 0x00101111, 0x11d11100, 0x00111111, 0x11d11100, 0x00111111, 0x11111100, 0x00111111, 0xaaaa1a00, 0x00a1aa33, 0xaaaa0a00, 0x00a0aa33, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xaa000000, 0x000000a0, 0x00aa0000, 0x0000a00a, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x3d000000, 0x000000d0, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00001111, 0x10110100, 0x00101111, 0x10111100, 0x10111111, 0x10111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001011, 0x10110000, 0x00111111, 0x10111101, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001111, 0x10110100, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11110000, 0x00001011, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11111101, 0x00111111, 0x11111111, 0x10111111, 0x10111101, 0x00111111, 0x00110100, 0x00001101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11110100, 0x00001111, 0x11111101, 0x00111111, 0x10111101, 0x00111111, 0x00111100, 0x00101101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11010000, 0x00000011, 0x10000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000001, 0x10000000, 0x00000010, 0x00000100, 0x00000100, 0x00100000, 0x00001000, 0x00000000, 0x00000000, 0x00001100, 0x00100100, 0x00000000, 0x00000000, 0x00100000, 0x00001000, 0x00000100, 0x00000100, 0x10000000, 0x00000010, 0x00010000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x08000000, 0x00000080, 0x08000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x88000000, 0x00000088, 0x88080000, 0x00008088, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88080000, 0x00008088, 0x88000000, 0x00000088, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 - MazeSpriteSheet db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 ; Inter 0 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Out Top Left Corner 1 - db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 - db 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Out Top Right Corner 2 - db 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 ; Out Bottom Left Corner 3 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 - db 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Out Bottom Right Corner 4 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; In Top Left Corner 5 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; In Top Right Corner 6 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 ; In Bottom Left Corner 7 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; In Bottom Right Corner 8 - db 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Top Line 9 - db 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Bottom Line 10 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Left Line 11 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 ; Right Line 12 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 - - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Pellet 13 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Super Pellet 14 - db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x00, 0x00 - db 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x00 - db 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x00 - db 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Background 15 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 diff --git a/src/entry.asm b/src/entry.asm index e8df54a..03704b6 100644 --- a/src/entry.asm +++ b/src/entry.asm @@ -5,6 +5,7 @@ jmp start %include "heapLibrary.inc" %include "constants.asm" +%include "maze.asm" %include "sprites.asm" %include "main.asm" %include "initialization.asm" diff --git a/src/initialization.asm b/src/initialization.asm index 8617624..c8e20bd 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -2,7 +2,6 @@ section .bss BackgroundBufferSegment resw 1 ; where is stored the dynamic background (dynamic cuz gums are disappearing). Used to restore the screen after a ghost's passage ScreenBufferSegment resw 1 -section .data section .text @@ -65,22 +64,8 @@ section .text ret - - - - - - - - - - - - - MazeToBGbuffer: - int3 - xor dx, dx + xor dx, dx ; dh and dl are counters : dh will always contains the number of complete lines, dl contains the number of complete blocs in this line push word [BackgroundBufferSegment] pop es ;ds is ok @@ -88,9 +73,9 @@ section .text mov dl, 0 ; blocs in a line .eachBlocOfTheLine: push dx - mov ax, 0xA00 ; number of pixels in a bloc's line + mov ax, 8*SCREEN_WIDTH ; number of pixels in a bloc's line = 320*8 = 8*8*(40 blocs in a line) mov bl, dh - and bx, 0x00FF + and bx, 0x00FF mul bx mov di, ax ; di contains the number of pixels in complete lines pop dx @@ -116,9 +101,9 @@ section .text mov si, MazeModel add si, cx + xor ax, ax mov al, [ds:si] ; now al contains the hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel - push dx ; pick the sprite to display following the hexacode @@ -144,10 +129,10 @@ section .text inc dl cmp dl, 40 - jne .eachBlocOfTheLine + jb .eachBlocOfTheLine inc dh cmp dh, 25 - jne .eachBlocsLine + jb .eachBlocsLine ret diff --git a/src/maze.asm b/src/maze.asm new file mode 100644 index 0000000..976a985 --- /dev/null +++ b/src/maze.asm @@ -0,0 +1,191 @@ +;not used, just there to see the matching table to write the maze just below +%define INTER 00 +%define OUT_TOP_LEFT_CORNER 01 +%define OUT_TOP_RIGHT_CORNER 02 +%define OUT_BOTTOM_LEFT_CORNER 03 +%define OUT_BOTTOM_RIGHT_CORNER 04 +%define IN_TOP_LEFT_CORNER 05 +%define IN_TOP_RIGHT_CORNER 06 +%define IN_BOTTOM_LEFT_CORNER 07 +%define IN_BOTTOM_RIGHT_CORNER 08 +%define TOP_LINE 09 +%define BOTTOM_LINE 0x0A +%define LEFT_LINE 0x0B +%define RIGHT_LINE 0x0C +%define PELLET 0x0D +%define SUPER_PELLET 0x0E +%define BACKGROUND 0x0F + + +section .data + + MazeModel db 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x09, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x08, 0x0F, 0x0F, 0x02, 0x03, 0x08, 0x02, 0x0F, 0x0F, 0x0F, 0x02, 0x00 + db 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F + db 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F,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x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x00 + + + MazeSpriteSheet db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 ; Inter 0 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Out Top Left Corner 1 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Out Top Right Corner 2 + db 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 ; Out Bottom Left Corner 3 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 + db 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Out Bottom Right Corner 4 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; In Top Left Corner 5 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; In Top Right Corner 6 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 ; In Bottom Left Corner 7 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; In Bottom Right Corner 8 + db 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Top Line 9 + db 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Bottom Line 10 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Left Line 11 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 ; Right Line 12 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Pellet 13 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Super Pellet 14 + db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x00, 0x00 + db 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x00 + db 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x00 + db 0x00, 0x00, 0x0E, 0x0E, 0x0E, 0x0E, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Background 15 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \ No newline at end of file From 105d92e4c4775ebf9346cd1ed72e39dd62a433fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:37:04 +0100 Subject: [PATCH 50/60] updated the right maze model updated the design, the maze is the right one now --- src/Initialization.asm | 2 +- src/initialization.asm | 2 +- src/maze.asm | 52 +++++++++++++++++++++--------------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index c8e20bd..9daea36 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -73,7 +73,7 @@ section .text mov dl, 0 ; blocs in a line .eachBlocOfTheLine: push dx - mov ax, 8*SCREEN_WIDTH ; number of pixels in a bloc's line = 320*8 = 8*8*(40 blocs in a line) + mov ax, 8*SCREEN_WIDTH ; number of pixels in a bloc's line = 320*8 = (8*8 pixels)*(40 blocs in a line) mov bl, dh and bx, 0x00FF mul bx diff --git a/src/initialization.asm b/src/initialization.asm index c8e20bd..9daea36 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -73,7 +73,7 @@ section .text mov dl, 0 ; blocs in a line .eachBlocOfTheLine: push dx - mov ax, 8*SCREEN_WIDTH ; number of pixels in a bloc's line = 320*8 = 8*8*(40 blocs in a line) + mov ax, 8*SCREEN_WIDTH ; number of pixels in a bloc's line = 320*8 = (8*8 pixels)*(40 blocs in a line) mov bl, dh and bx, 0x00FF mul bx diff --git a/src/maze.asm b/src/maze.asm index 976a985..4b8f3e1 100644 --- a/src/maze.asm +++ b/src/maze.asm @@ -19,32 +19,32 @@ section .data - MazeModel db 0x00, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x09, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x08, 0x0F, 0x0F, 0x02, 0x03, 0x08, 0x02, 0x0F, 0x0F, 0x0F, 0x02, 0x00 - db 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F - db 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 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 0x09, 0x09, 0x09, 0x08, 0x0D, 0x07, 0x09, 0x09, 0x09, 0x09, 0x09, 0x08, 0x0D, 0x07, 0x09, 0x09, 0x08, 0x0D, 0x0C + db 0xB, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0C, 0x0B, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0C + db 0x4, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x03, 0x04, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x03 + MazeSpriteSheet db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 ; Inter 0 db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 From ecc9005470ca0ab9f77f1406944d367691bd1348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:54:25 +0100 Subject: [PATCH 51/60] delete the debug codes --- src/Initialization.asm | 4 ---- src/initialization.asm | 4 ---- src/main.asm | 1 - 3 files changed, 9 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index 9daea36..d8a417d 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -80,24 +80,20 @@ section .text mov di, ax ; di contains the number of pixels in complete lines pop dx - push dx mov ax, 40 ; number of blocs in a bloc's line mov bl, dh mul bl mov cx, ax ; cx contains the number of blocs in complete lines - pop dx push dx and dx, 0x00FF add cx, dx ; cx now contains the number of complete blocs pop dx - push dx mov ax, 8 mov bl, dl mul bl add di, ax ; di now contains the position to write the next bloc - pop dx mov si, MazeModel add si, cx diff --git a/src/initialization.asm b/src/initialization.asm index 9daea36..d8a417d 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -80,24 +80,20 @@ section .text mov di, ax ; di contains the number of pixels in complete lines pop dx - push dx mov ax, 40 ; number of blocs in a bloc's line mov bl, dh mul bl mov cx, ax ; cx contains the number of blocs in complete lines - pop dx push dx and dx, 0x00FF add cx, dx ; cx now contains the number of complete blocs pop dx - push dx mov ax, 8 mov bl, dl mul bl add di, ax ; di now contains the position to write the next bloc - pop dx mov si, MazeModel add si, cx diff --git a/src/main.asm b/src/main.asm index 3951004..dba09ca 100644 --- a/src/main.asm +++ b/src/main.asm @@ -14,7 +14,6 @@ section .text call MazeToBGbuffer call DisplayMaze call UpdateScreen - jmp exit call FirstDisplayPacMan call FirstDisplayGhosts From 0530af30cf7b715c9d53abfbcecdfde8f237489d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:55:21 +0100 Subject: [PATCH 52/60] deleted ALL debug codes --- src/main.asm | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.asm b/src/main.asm index dba09ca..fe5bb8e 100644 --- a/src/main.asm +++ b/src/main.asm @@ -8,7 +8,6 @@ section .text call BuildScreenBuffer ; set of functions allowing to write not directly in the video memory but in a buffer call ClearScreen - call UpdateScreen call BuildBackgroundBuffer call MazeToBGbuffer From e722e3c98fe44f7e857dabd19e64a305a4018313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:00:11 +0100 Subject: [PATCH 53/60] resolved basic constant's conflicts redefinition of mazeModel , I keep only the maze.asm's constants --- src/constants.asm | 289 +--------------------------------------------- 1 file changed, 1 insertion(+), 288 deletions(-) diff --git a/src/constants.asm b/src/constants.asm index db225c8..58e8f50 100644 --- a/src/constants.asm +++ b/src/constants.asm @@ -55,23 +55,6 @@ %define DOT 43 %define POWER_PELLET 44 -;not used, just there to see the matching table to write the maze just below -%define INTER 0 -%define OUT_TOP_LEFT_CORNER 1 -%define OUT_TOP_RIGHT_CORNER 2 -%define OUT_BOTTOM_LEFT_CORNER 3 -%define OUT_BOTTOM_RIGHT_CORNER 4 -%define IN_TOP_LEFT_CORNER 5 -%define IN_TOP_RIGHT_CORNER 6 -%define IN_BOTTOM_LEFT_CORNER 7 -%define IN_BOTTOM_RIGHT_CORNER 8 -%define TOP_LINE 9 -%define BOTTOM_LINE 0xA -%define LEFT_LINE 0xB -%define RIGHT_LINE 0xC -%define PELLET 0xD -%define SUPER_PELLET 0xE -%define BACKGROUND 0xF ; Clock cycle per second and desired FPS %define CCPS 3000000 %define FPS 24 @@ -82,277 +65,7 @@ section .data - MazeModel dd 0x99999919, 0x99999999, 0x99999999, 0x99999999, 0x92999999 - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xDDDDDDBD, 0xDDDDDDDD, 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F, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0x19999999, 0x99999999, 0x92FFFFF1, 0x99999999, 0x99999992 - dd 0xBDDDDDDD, 0xDDDDDDDD, 0xDCFFFFFB, 0xDDDDDDDD, 0xDDDDDDDC - dd 0xBD56D5A6, 0xD5AAAAA6, 0xD7999998, 0xD5AAAAA6, 0xD56D56DC - dd 0xBDCBDCFB, 0xDC199998, 0xDDDDDDDD, 0xD7999998, 0xDCBD78DC - dd 0xBDCBECFB, 0xD78DDDDD, 0xD5AAAAA6, 0xDDDDDDDD, 0xDCBEDDDC - dd 0xBDCBDCFB, 0xDDDD5AA6, 0xDCFFFFFB, 0xD5AA6DD5, 0xA34AA6DC - dd 0xBD78D798, 0xD56DC198, 0xD7999998, 0xD792BDD7, 0x999998DC - dd 0xBDDDDDDD, 0xDCBD78FF, 0xFFFFFFFF, 0xFFFCBDDD, 0xDDDDDDDC - dd 0x4AAA6D56, 0xDCBDDDF5, 0xAAAAAAAA, 0xA6FCBD5A, 0xA6D5AAA3 - dd 0x99998DCB, 0xDC4AA6FC, 0x19999999, 0x2BF78DCF, 0xFBD79999 - dd 0xFFFFDDCB, 0xDCFFFBFC, 0xBFFFFFFF, 0xCBFDDDCF, 0xFBDFFFFF - dd 0xAAAA6DCB, 0xDC1998FC, 0x4AAAAAAA, 0x3BF56DCF, 0xFBD5AAAA - dd 0x19998D78, 0xDCBDDDF7, 0x99999999, 0x98FCBD79, 0x98D79992 - dd 0xBDDDDDDD, 0xDCBD56FF, 0xFFFFFFFF, 0xFFFCBDDD, 0xDDDDDDDC - dd 0xBD5AAAA6, 0xDCBDC4AA, 0xAA6D56D5, 0xAAA3BD5A, 0xAA6D56DC - dd 0xBDC19998, 0xD78D7999, 0x998DCBD7, 0x99998DCF, 0x198D78DC - dd 0xBDCBEDDD, 0xDDDDDDDD, 0xDDDDCBDD, 0xDDDDDDCF, 0xBDDEDDDC - dd 0xBDCBD5AA, 0x6D56D5A6, 0xD5AA34AA, 0x6D5AAA3F, 0xBD5AA6DC - dd 0xBD78D799, 0x8DCBD798, 0xD7999999, 0x8D799999, 0x8D7998DC - dd 0xBDDDDDDD, 0xDDCBDDDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDDDDDDDC - dd 0x4AAAAAAA, 0xAA34AAAA, 0xAAAAAAAA, 0xAAAAAAAA, 0xAAAAAAA3 - -MazeModel5LE dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF - dd 0x99999919, 0x99999999, 0xF1FFFF92, 0x99999999, 0x92999999 - dd 0xDDDDDDBD, 0xDDDDDDDD, 0xFBFFFFDC, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xA6D556BD, 0xA6AAAAD5, 0x989999D7, 0xA6AAAAD5, 0xDC566DD5 - dd 0xFBDCCBBD, 0x989919DC, 0xDDDDDDDD, 0x989999D7, 0xDC78BDDC - dd 0xFBECCBBD, 0xDDDD8DD7, 0xA6AAAAD5, 0xDDDDDDDD, 0xDCDDBEDC - dd 0xFBDCCBBD, 0xA65ADDDD, 0xFBFFFFDC, 0xD56DAAD5, 0xDCA64AA3 - dd 0x98D778BD, 0x98C16DD5, 0x989999D7, 0xD7BD92D7, 0xDC989999 - dd 0xDDDDDDBD, 0xFF78BDDC, 0xFFFFFFFF, 0xDDBDFCFF, 0xDCDDDDDD - dd 0x566DAA4A, 0xF5DDBDDC, 0xAAAAAAAA, 0x5ABDFCA6, 0xA3AAD5A6 - dd 0xCB8D9999, 0xFCA64ADC, 0x99999919, 0xCF8DF72B, 0x9999D7FB - dd 0xCBDDFFFF, 0xFCFBFFDC, 0xFFFFFFBF, 0xCFDDFDCB, 0xFFFFDFFB - dd 0xCB6DAAAA, 0xFC9819DC, 0xAAAAAA4A, 0xCF6DF53B, 0xAAAAD5FB - dd 0x788D9919, 0xF7DDBDDC, 0x99999999, 0x79BDFC98, 0x9299D798 - dd 0xDDDDDDBD, 0xFF56BDDC, 0xFFFFFFFF, 0xDDBDFCFF, 0xDCDDDDDD - dd 0xA6AA5ABD, 0xAAC4BDDC, 0xD5566DAA, 0x5ABDA3AA, 0xDC566DAA - dd 0x9899C1BD, 0x99798DD7, 0xD7CB8D99, 0xCF8D9999, 0xDC788D19 - dd 0xDDEDCBBD, 0xDDDDDDDD, 0xDDCBDDDD, 0xCFDDDDDD, 0xDCDDDEBD - dd 0xAAD5CBBD, 0xA6D5566D, 0xAA34AAD5, 0x3FAA5A6D, 0xDCA65ABD - dd 0x99D778BD, 0x98D7CB8D, 0x999999D7, 0x9999798D, 0xDC98798D - dd 0xDDDDDDBD, 0xDDDDCBDD, 0xDDDDDDDD, 0xDDDDDDDD, 0xDCDDDDDD - dd 0xAAAAAA4A, 0xAAAA34AA, 0xAAAAAAAA, 0xAAAAAAAA, 0xA3AAAAAA + palette db 0, 44, 40, 15, 66, 33, 84, 52, 88, 48, 78, 3, 65, 0 spritesheet dd 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x20222002, 0x20022202, 0x20020002, 0x20002002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x22000000, 0x00000022, 0x22220000, 0x00002222, 0x22220200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22222202, 0x20222222, 0x22202202, 0x20220222, 0x02002200, 0x00220020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x60666006, 0x60066606, 0x60060006, 0x60006006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x66000000, 0x00000066, 0x66660000, 0x00006666, 0x66660600, 0x00606666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666600, 0x00666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66666606, 0x60666666, 0x66606606, 0x60660666, 0x06006600, 0x00660060, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x70777007, 0x70077707, 0x70070007, 0x70007007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x77000000, 0x00000077, 0x77770000, 0x00007777, 0x77770700, 0x00707777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777700, 0x00777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77777707, 0x70777777, 0x77707707, 0x70770777, 0x07007700, 0x00770070, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x40444004, 0x40044404, 0x40040004, 0x40004004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x44000000, 0x00000044, 0x44440000, 0x00004444, 0x44440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44444404, 0x40444444, 0x44404404, 0x40440444, 0x04004400, 0x00440040, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x50555005, 0x50055505, 0x50050005, 0x50005005, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x55000000, 0x00000055, 0x55550000, 0x00005555, 0x55550500, 0x00505555, 0x55555500, 0x00555555, 0x55555500, 0x00555555, 0x85585500, 0x00558558, 0x85585505, 0x50558558, 0x55555505, 0x50555555, 0x55555505, 0x50555555, 0x58855805, 0x50855885, 0x85588505, 0x50588558, 0x55555505, 0x50555555, 0x55505505, 0x50550555, 0x05005500, 0x00550050, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x30333003, 0x30033303, 0x30030003, 0x30003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x33000000, 0x00000033, 0x33330000, 0x00003333, 0x33330300, 0x00303333, 0x33333300, 0x00333333, 0x33333300, 0x00333333, 0x23323300, 0x00332332, 0x23323303, 0x30332332, 0x33333303, 0x30333333, 0x33333303, 0x30333333, 0x32233203, 0x30233223, 0x23322303, 0x30322332, 0x33333303, 0x30333333, 0x33303303, 0x30330333, 0x03003300, 0x00330030, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x30030000, 0x00300300, 0x33330000, 0x00333300, 0x55330000, 0x00553300, 0x55330000, 0x00553300, 0x30030000, 0x00300300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300300, 0x00003003, 0x00333300, 0x00003333, 0x00335500, 0x00003355, 0x00335500, 0x00003355, 0x00300300, 0x00003003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00550000, 0x00005500, 0x30550300, 0x00305503, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x00330000, 0x00003300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00330000, 0x00003300, 0x30330300, 0x00303303, 0x30330300, 0x00303303, 0x30550300, 0x00305503, 0x00550000, 0x00005500, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00000011, 0x11111100, 0x00000010, 0x11111100, 0x00000000, 0x10111101, 0x00000000, 0x00111101, 0x00000000, 0x00101101, 0x00000000, 0x00111101, 0x00000000, 0x10111101, 0x00000000, 0x11111100, 0x00000000, 0x11111100, 0x00000010, 0x11110100, 0x00000011, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00001011, 0x11111101, 0x00000000, 0x00101101, 0x00000000, 0x11111101, 0x00000000, 0x11111101, 0x00001011, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00100100, 0x00001100, 0x00101100, 0x00101100, 0x00111100, 0x00101101, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11010000, 0x00001111, 0x11000000, 0x00101111, 0x01000000, 0x00101111, 0x00000000, 0x00111111, 0x00000000, 0x00111101, 0x00000000, 0x00111100, 0x00000000, 0x00111101, 0x00000000, 0x00111111, 0x01000000, 0x00101111, 0x11000000, 0x00101111, 0x11010000, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110000, 0x00111111, 0x01000000, 0x00111111, 0x00000000, 0x00111100, 0x01000000, 0x00111111, 0x11110000, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00101101, 0x00111100, 0x00001101, 0x00110100, 0x00001001, 0x00110000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x10111101, 0x00111111, 0x00111101, 0x00111101, 0x00111101, 0x00111101, 0x00111100, 0x00101101, 0x00101100, 0x00101100, 0x00100100, 0x00001100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00cc0000, 0x00000000, 0x00cccc00, 0x00000000, 0x00000ccc, 0x0c000000, 0x00000c00, 0xc0220200, 0x0000c000, 0x222c2200, 0x0000000c, 0x20222200, 0x0000222c, 0x02222300, 0x0020222c, 0x02322200, 0x00202222, 0x02220200, 0x00202232, 0x02000000, 0x00202223, 0x00000000, 0x00002222, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x93990000, 0x00009099, 0x99290200, 0x00002299, 0x29222200, 0x00202322, 0x22222300, 0x00202223, 0x23232200, 0x00202222, 0x22222200, 0x00203222, 0x23320200, 0x00002222, 0x22220200, 0x00002222, 0x32220000, 0x00000023, 0x22020000, 0x00000022, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00009009, 0x0c000000, 0x00909999, 0x0c000000, 0x00009909, 0xcc440000, 0x000044c4, 0x4c440400, 0x00404444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44444400, 0x00444444, 0x44440400, 0x00404444, 0x44440400, 0x00404444, 0x44040000, 0x00004044, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000c0, 0x0c220200, 0x00002202, 0x2c222200, 0x00202222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222222, 0x22222200, 0x00222322, 0x22222200, 0x00222322, 0x22220200, 0x00203222, 0x22220200, 0x00202222, 0x22220000, 0x00002222, 0x20020000, 0x00002022, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00b00000, 0x00000000, 0xbb0b0000, 0x000000bb, 0x0b000000, 0x00000000, 0x93000000, 0x00000090, 0x9b990000, 0x00009099, 0xb9b30900, 0x0000b999, 0x999b0900, 0x0000993b, 0x99b99300, 0x0090b9b9, 0x3b999b00, 0x00903b99, 0x99b99300, 0x009099b9, 0x3b9b0900, 0x0000993b, 0xb9990900, 0x0000b999, 0x999b0000, 0x0000909b, 0x99000000, 0x000000b0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000000, 0x00000000, 0x22005000, 0x00500020, 0x22025000, 0x00500022, 0x12225100, 0x00502112, 0x12115100, 0x00501111, 0x11115500, 0x00501511, 0x01510500, 0x00005501, 0x01550000, 0x00005005, 0x01050000, 0x00000005, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000010, 0x1d010000, 0x000010d1, 0x11110000, 0x00001111, 0xd1110000, 0x00001111, 0x111d0000, 0x00001111, 0x111d0100, 0x00101111, 0x111d0100, 0x00101111, 0x11110100, 0x00101111, 0x11d11100, 0x00111111, 0x11d11100, 0x00111111, 0x11111100, 0x00111111, 0xaaaa1a00, 0x00a1aa33, 0xaaaa0a00, 0x00a0aa33, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xaa000000, 0x000000a0, 0x00aa0000, 0x0000a00a, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0xaaaa0000, 0x0000a0aa, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x3d000000, 0x000000d0, 0x3d000000, 0x00000030, 0x3d000000, 0x00000033, 0x3d000000, 0x00000030, 0x03000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11010000, 0x00000011, 0x11110100, 0x00001111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001001, 0x00110000, 0x00001101, 0x00110100, 0x00101101, 0x00111100, 0x00111101, 0x00111101, 0x10111101, 0x00111111, 0x11111100, 0x00101111, 0x11111100, 0x00101111, 0x11110100, 0x00001111, 0x11010000, 0x00000011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00001111, 0x10110100, 0x00101111, 0x10111100, 0x10111111, 0x10111111, 0x11111101, 0x00111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001011, 0x10110000, 0x00111111, 0x10111101, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x11111100, 0x00101111, 0x10110000, 0x00001011, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00001111, 0x10110100, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11110000, 0x00001011, 0x11111111, 0x10111111, 0x11111111, 0x10111111, 0x11111101, 0x00111111, 0x10110100, 0x00001111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11111101, 0x00111111, 0x11111111, 0x10111111, 0x10111101, 0x00111111, 0x00110100, 0x00001101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11110000, 0x00001011, 0x11110100, 0x00001111, 0x11111101, 0x00111111, 0x10111101, 0x00111111, 0x00111100, 0x00101101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11000000, 0x00000010, 0x11010000, 0x00000011, 0x10000000, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000001, 0x10000000, 0x00000010, 0x00000100, 0x00000100, 0x00100000, 0x00001000, 0x00000000, 0x00000000, 0x00001100, 0x00100100, 0x00000000, 0x00000000, 0x00100000, 0x00001000, 0x00000100, 0x00000100, 0x10000000, 0x00000010, 0x00010000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x08000000, 0x00000080, 0x08000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x88000000, 0x00000088, 0x88080000, 0x00008088, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88880000, 0x00008888, 0x88080000, 0x00008088, 0x88000000, 0x00000088, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 From c8e5939fb1c930902bb38b099c030ee521f7eebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:06:36 +0100 Subject: [PATCH 54/60] changed some colors and names the "inter" tile is now same color than background (not random) In comments and function's names, I rename 'bloc' by 'tile' --- src/Initialization.asm | 26 +++++++++++++------------- src/initialization.asm | 26 +++++++++++++------------- src/maze.asm | 16 ++++++++-------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index 04cb9f7..cb64ae1 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -65,40 +65,40 @@ section .text MazeToBGbuffer: - xor dx, dx ; dh and dl are counters : dh will always contains the number of complete lines, dl contains the number of complete blocs in this line + xor dx, dx ; dh and dl are counters : dh will always contains the number of complete lines, dl contains the number of complete Tiles in this line push word [BackgroundBufferSegment] pop es ;ds is ok - .eachBlocsLine: - mov dl, 0 ; blocs in a line - .eachBlocOfTheLine: + .eachTilesLine: + mov dl, 0 ; Tiles in a line + .eachTileOfTheLine: push dx - mov ax, 8*SCREEN_WIDTH ; number of pixels in a bloc's line = 320*8 = (8*8 pixels)*(40 blocs in a line) + mov ax, 8*SCREEN_WIDTH ; number of pixels in a Tile's line = 320*8 = (8*8 pixels)*(40 Tiles in a line) mov bl, dh and bx, 0x00FF mul bx mov di, ax ; di contains the number of pixels in complete lines pop dx - mov ax, 40 ; number of blocs in a bloc's line + mov ax, 40 ; number of Tiles in a Tile's line mov bl, dh mul bl - mov cx, ax ; cx contains the number of blocs in complete lines + mov cx, ax ; cx contains the number of Tiles in complete lines push dx and dx, 0x00FF - add cx, dx ; cx now contains the number of complete blocs + add cx, dx ; cx now contains the number of complete Tiles pop dx mov ax, 8 mov bl, dl mul bl - add di, ax ; di now contains the position to write the next bloc + add di, ax ; di now contains the position to write the next Tile mov si, MazeModel add si, cx xor ax, ax - mov al, [ds:si] ; now al contains the hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel + mov al, [ds:si] ; now al contains the hexa codes (for sprite) of the byte where is the 'cx'ème Tile of mazemodel push dx @@ -110,7 +110,7 @@ section .text add si, ax ; si contains the offset of the sprite to display pop dx - ;we draw the bloc + ;we draw the Tile push cx push dx mov dx,8 @@ -125,10 +125,10 @@ section .text inc dl cmp dl, 40 - jb .eachBlocOfTheLine + jb .eachTileOfTheLine inc dh cmp dh, 25 - jb .eachBlocsLine + jb .eachTilesLine ret diff --git a/src/initialization.asm b/src/initialization.asm index 04cb9f7..cb64ae1 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -65,40 +65,40 @@ section .text MazeToBGbuffer: - xor dx, dx ; dh and dl are counters : dh will always contains the number of complete lines, dl contains the number of complete blocs in this line + xor dx, dx ; dh and dl are counters : dh will always contains the number of complete lines, dl contains the number of complete Tiles in this line push word [BackgroundBufferSegment] pop es ;ds is ok - .eachBlocsLine: - mov dl, 0 ; blocs in a line - .eachBlocOfTheLine: + .eachTilesLine: + mov dl, 0 ; Tiles in a line + .eachTileOfTheLine: push dx - mov ax, 8*SCREEN_WIDTH ; number of pixels in a bloc's line = 320*8 = (8*8 pixels)*(40 blocs in a line) + mov ax, 8*SCREEN_WIDTH ; number of pixels in a Tile's line = 320*8 = (8*8 pixels)*(40 Tiles in a line) mov bl, dh and bx, 0x00FF mul bx mov di, ax ; di contains the number of pixels in complete lines pop dx - mov ax, 40 ; number of blocs in a bloc's line + mov ax, 40 ; number of Tiles in a Tile's line mov bl, dh mul bl - mov cx, ax ; cx contains the number of blocs in complete lines + mov cx, ax ; cx contains the number of Tiles in complete lines push dx and dx, 0x00FF - add cx, dx ; cx now contains the number of complete blocs + add cx, dx ; cx now contains the number of complete Tiles pop dx mov ax, 8 mov bl, dl mul bl - add di, ax ; di now contains the position to write the next bloc + add di, ax ; di now contains the position to write the next Tile mov si, MazeModel add si, cx xor ax, ax - mov al, [ds:si] ; now al contains the hexa codes (for sprite) of the byte where is the 'cx'ème bloc of mazemodel + mov al, [ds:si] ; now al contains the hexa codes (for sprite) of the byte where is the 'cx'ème Tile of mazemodel push dx @@ -110,7 +110,7 @@ section .text add si, ax ; si contains the offset of the sprite to display pop dx - ;we draw the bloc + ;we draw the Tile push cx push dx mov dx,8 @@ -125,10 +125,10 @@ section .text inc dl cmp dl, 40 - jb .eachBlocOfTheLine + jb .eachTileOfTheLine inc dh cmp dh, 25 - jb .eachBlocsLine + jb .eachTilesLine ret diff --git a/src/maze.asm b/src/maze.asm index 4b8f3e1..d59a502 100644 --- a/src/maze.asm +++ b/src/maze.asm @@ -46,14 +46,14 @@ section .data db 0x4, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x03, 0x04, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x03 - MazeSpriteSheet db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 ; Inter 0 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 - db 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27 + MazeSpriteSheet db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Inter 0 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; Out Top Left Corner 1 db 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01 From 7d77e7ecbf847684eca78fea2696b9e252cc0122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:18:41 +0100 Subject: [PATCH 55/60] =?UTF-8?q?in=20comments=20=20:=20'=C3=A8me'=20->=20?= =?UTF-8?q?'th'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Initialization.asm | 2 +- src/initialization.asm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index cb64ae1..943367b 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -98,7 +98,7 @@ section .text mov si, MazeModel add si, cx xor ax, ax - mov al, [ds:si] ; now al contains the hexa codes (for sprite) of the byte where is the 'cx'ème Tile of mazemodel + mov al, [ds:si] ; now al contains the hexa codes (for sprite) of the byte where is the 'cx'th Tile of mazemodel push dx diff --git a/src/initialization.asm b/src/initialization.asm index cb64ae1..943367b 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -98,7 +98,7 @@ section .text mov si, MazeModel add si, cx xor ax, ax - mov al, [ds:si] ; now al contains the hexa codes (for sprite) of the byte where is the 'cx'ème Tile of mazemodel + mov al, [ds:si] ; now al contains the hexa codes (for sprite) of the byte where is the 'cx'th Tile of mazemodel push dx From 4042ef0241fd58d51339869264927b92213abeb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:28:47 +0100 Subject: [PATCH 56/60] added a comment to the MazeToBGbuffer function --- src/Initialization.asm | 1 + src/initialization.asm | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Initialization.asm b/src/Initialization.asm index 943367b..afb8de0 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -63,6 +63,7 @@ section .text ret + ; read the Maze model from the maze.asm, and build each bloc according to the hexacode, drawing the background into the background buffer MazeToBGbuffer: xor dx, dx ; dh and dl are counters : dh will always contains the number of complete lines, dl contains the number of complete Tiles in this line diff --git a/src/initialization.asm b/src/initialization.asm index 943367b..afb8de0 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -63,6 +63,7 @@ section .text ret + ; read the Maze model from the maze.asm, and build each bloc according to the hexacode, drawing the background into the background buffer MazeToBGbuffer: xor dx, dx ; dh and dl are counters : dh will always contains the number of complete lines, dl contains the number of complete Tiles in this line From c37537d56c77c727a0feff6a60bac35cc5d2ca51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Fri, 8 Dec 2023 01:43:29 +0100 Subject: [PATCH 57/60] fixed the restoring brutally now, it works, but instead of clearing the sprites one by one, I just redisplay the maze at each beginning of the gameloop --- src/keyboard.asm | 2 +- src/main.asm | 32 ++++++++++++++++++++++++-------- src/sprites.asm | 1 + 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/keyboard.asm b/src/keyboard.asm index d5be30f..98fe876 100644 --- a/src/keyboard.asm +++ b/src/keyboard.asm @@ -11,7 +11,7 @@ readKeyboard: ; Read last key in buffer: .keepReadingBuffer: - int3 + mov ah, 00h int 16h mov bx, ax diff --git a/src/main.asm b/src/main.asm index 9534769..2a011ca 100644 --- a/src/main.asm +++ b/src/main.asm @@ -15,10 +15,10 @@ section .text call BuildBackgroundBuffer call MazeToBGbuffer call DisplayMaze - call UpdateScreen - call FirstDisplayPacMan call FirstDisplayGhosts + call UpdateScreen + ; Display the period mov eax, PERIOD @@ -27,17 +27,22 @@ section .text rdtsc mov [timestamp_of_next_frame], eax + ;mov cx, 0 + ;push cx + ;----------------------------------------------------------------------------------------- ;THE GAME LOOP gameloop: ;------------------------------------------------- - ;clear all + call waitLoop - call ClearPinky - call ClearBlinky - call ClearInky - call ClearClyde - call ClearPacMan + + ;call ClearPinky + ;call ClearBlinky + ;call ClearInky + ;call ClearClyde + ;call ClearPacMan + call DisplayMaze call readKeyboard @@ -53,6 +58,12 @@ section .text call Display_Clyde call UpdateScreen + ;pop cx + ;inc cx + ;cmp cx, 10 + ;je DebugExit + ;push cx + ;------------------------------------------------- @@ -60,6 +71,11 @@ section .text jmp gameloop ;----------------------------------------------------------------------------------------- +DebugExit: +;reset the keyboard buffer and then wait for a keypress : +mov ax, 0C01h ; +int 21h + exit: mov ax, 3h int 10h diff --git a/src/sprites.asm b/src/sprites.asm index c75e291..d9245d4 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -131,6 +131,7 @@ section .text ret ClearSprite: + mov cx, SCREEN_WIDTH mul cx add bx, ax From 77a36414deb03d4a2233f55b1c9861d792cf1a90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Fri, 8 Dec 2023 01:50:12 +0100 Subject: [PATCH 58/60] ok definetly fixed it well while restoring the bloc of 16x16 pixels from the background buffer to the screen buffer, to go to the next line, I increment 'di' (destination offset) by the screen width, but I forgot to increment 'si' (source offset) too. --- src/main.asm | 12 ++++++------ src/sprites.asm | 10 ++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main.asm b/src/main.asm index 2a011ca..dca9bc8 100644 --- a/src/main.asm +++ b/src/main.asm @@ -37,12 +37,12 @@ section .text call waitLoop - ;call ClearPinky - ;call ClearBlinky - ;call ClearInky - ;call ClearClyde - ;call ClearPacMan - call DisplayMaze + call ClearPinky + call ClearBlinky + call ClearInky + call ClearClyde + call ClearPacMan + ;call DisplayMaze call readKeyboard diff --git a/src/sprites.asm b/src/sprites.asm index d9245d4..bf1330c 100644 --- a/src/sprites.asm +++ b/src/sprites.asm @@ -131,7 +131,8 @@ section .text ret ClearSprite: - + push es + push ds mov cx, SCREEN_WIDTH mul cx add bx, ax @@ -149,12 +150,13 @@ section .text .eachLine: mov cx, SPRITE_SIZE ; set the counter for 8 pixel per line rep movsb ; to mov the source from adress ds:si into the target from adress es:di byte per byte, 8 time (8 bits) - add di, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line + add di, SCREEN_WIDTH - SPRITE_SIZE + add si, SCREEN_WIDTH - SPRITE_SIZE ; increment the position register to the next line dec dx ; decrementatin de dx, when it reach 0, the flag is 0 too cause of the dec propreties jnz .eachLine ; while the flag != 0, it continues - push cs - pop ds + pop ds + pop es ret From ea97ac011817354bf95dcace59379de642e4ff48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Fri, 8 Dec 2023 01:56:57 +0100 Subject: [PATCH 59/60] just verified that it works with the different velocities too --- src/Initialization.asm | 6 +++--- src/initialization.asm | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index afb8de0..bb4dd1f 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -174,14 +174,14 @@ section .text mov word [frameOf_Pinky_eyes], EYES_UP call Display_Pinky mov word [x_PinkyVelocity], 0 - mov word [y_PinkyVelocity], -1 + mov word [y_PinkyVelocity], -2 ;blinky mov word [x_BlinkyPosition], 160 mov word [y_BlinkyPosition], 84 mov word [frameOf_Blinky], BLINKY_1 mov word [frameOf_Blinky_eyes], EYES_RIGHT call Display_Blinky - mov word [x_BlinkyVelocity], 1 + mov word [x_BlinkyVelocity], 5 mov word [y_BlinkyVelocity], 0 ;inky mov word [x_InkyPosition], 144 @@ -190,7 +190,7 @@ section .text mov word [frameOf_Inky_eyes], EYES_DOWN call Display_Inky mov word [x_InkyVelocity], 0 - mov word [y_InkyVelocity], 1 + mov word [y_InkyVelocity], 3 ;clyde mov word [x_ClydePosition], 176 mov word [y_ClydePosition], 108 diff --git a/src/initialization.asm b/src/initialization.asm index afb8de0..bb4dd1f 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -174,14 +174,14 @@ section .text mov word [frameOf_Pinky_eyes], EYES_UP call Display_Pinky mov word [x_PinkyVelocity], 0 - mov word [y_PinkyVelocity], -1 + mov word [y_PinkyVelocity], -2 ;blinky mov word [x_BlinkyPosition], 160 mov word [y_BlinkyPosition], 84 mov word [frameOf_Blinky], BLINKY_1 mov word [frameOf_Blinky_eyes], EYES_RIGHT call Display_Blinky - mov word [x_BlinkyVelocity], 1 + mov word [x_BlinkyVelocity], 5 mov word [y_BlinkyVelocity], 0 ;inky mov word [x_InkyPosition], 144 @@ -190,7 +190,7 @@ section .text mov word [frameOf_Inky_eyes], EYES_DOWN call Display_Inky mov word [x_InkyVelocity], 0 - mov word [y_InkyVelocity], 1 + mov word [y_InkyVelocity], 3 ;clyde mov word [x_ClydePosition], 176 mov word [y_ClydePosition], 108 From 88c2c1e38cd044874f46822b4a09e833d3f70b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20de=20Keyn?= <146000855+benoitdekeyn-algosup@users.noreply.github.com> Date: Fri, 8 Dec 2023 09:06:43 +0100 Subject: [PATCH 60/60] removed the velocity changes --- src/Initialization.asm | 6 +++--- src/initialization.asm | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Initialization.asm b/src/Initialization.asm index bb4dd1f..afb8de0 100644 --- a/src/Initialization.asm +++ b/src/Initialization.asm @@ -174,14 +174,14 @@ section .text mov word [frameOf_Pinky_eyes], EYES_UP call Display_Pinky mov word [x_PinkyVelocity], 0 - mov word [y_PinkyVelocity], -2 + mov word [y_PinkyVelocity], -1 ;blinky mov word [x_BlinkyPosition], 160 mov word [y_BlinkyPosition], 84 mov word [frameOf_Blinky], BLINKY_1 mov word [frameOf_Blinky_eyes], EYES_RIGHT call Display_Blinky - mov word [x_BlinkyVelocity], 5 + mov word [x_BlinkyVelocity], 1 mov word [y_BlinkyVelocity], 0 ;inky mov word [x_InkyPosition], 144 @@ -190,7 +190,7 @@ section .text mov word [frameOf_Inky_eyes], EYES_DOWN call Display_Inky mov word [x_InkyVelocity], 0 - mov word [y_InkyVelocity], 3 + mov word [y_InkyVelocity], 1 ;clyde mov word [x_ClydePosition], 176 mov word [y_ClydePosition], 108 diff --git a/src/initialization.asm b/src/initialization.asm index bb4dd1f..afb8de0 100644 --- a/src/initialization.asm +++ b/src/initialization.asm @@ -174,14 +174,14 @@ section .text mov word [frameOf_Pinky_eyes], EYES_UP call Display_Pinky mov word [x_PinkyVelocity], 0 - mov word [y_PinkyVelocity], -2 + mov word [y_PinkyVelocity], -1 ;blinky mov word [x_BlinkyPosition], 160 mov word [y_BlinkyPosition], 84 mov word [frameOf_Blinky], BLINKY_1 mov word [frameOf_Blinky_eyes], EYES_RIGHT call Display_Blinky - mov word [x_BlinkyVelocity], 5 + mov word [x_BlinkyVelocity], 1 mov word [y_BlinkyVelocity], 0 ;inky mov word [x_InkyPosition], 144 @@ -190,7 +190,7 @@ section .text mov word [frameOf_Inky_eyes], EYES_DOWN call Display_Inky mov word [x_InkyVelocity], 0 - mov word [y_InkyVelocity], 3 + mov word [y_InkyVelocity], 1 ;clyde mov word [x_ClydePosition], 176 mov word [y_ClydePosition], 108