; Atic Atac for Sinclair ZX Spectrum ; (c) 1983 Ashby Computers and Graphics Ltd. ; ; Disassembled by obo ; ; Differences from original release: ; 6009: C0->00 - disable protection check on FRAMES sysvar after loading ; 7E91: B0->05 - new LSB of JP (HL) instruction (below) ; 7E92: 5C->D5 - new MSB of JP (HL) instruction ; 971F: D4->D3 - fixed typo in congratulations message ; D505: 00->E9 - JP (HL) instruction moved from printer buffer display: equ &4000 attrs: equ &5800 sysvar_FRAMES: equ &5c78 org &5e00 menu_selection: db 0 charset_addr: dw 0 last_FRAMES: db 0 in_handlers: db 0 ; flag set but never read rand8: dw 0 ; only low 8 bits are meaningfully random ds 9 width_bytes: db 0 height_lines: db 0 counter_low: db 0 counter_high: db 0 game_flags: db 0 ; b0 set if room content drawn saved_graphic: db 0 saved_x: db 0 saved_y: db 0 some_height: db 0 some_width: db 0 room_attr: db 0 room_ptr: dw 0 room_width: db 0 room_height: db 0 pickup_flags: db 0 pickup_pressed: db 0 lives: db 0 text_attr: db 0 line_counter: db 0 line_flags: db 0 num_creatures: db 0 ; number of creatures processed this frame last_creat_room:db 0 creature_delay: db 0 player_energy: db 0 chicken_level: db 0 ; last drawn chicken level score_bcd: db 0, 0, 0 in_doorway: db 0 door_timer: db 0 walk_counter: db 0 inventory1: db 0, 0, 0, 0 inventory2: db 0, 0, 0, 0 inventory3: db 0, 0, 0, 0 flash_timer: db 0 ; score flash timer clock_hours: db 0 clock_minutes: db 0 clock_seconds: db 0 visited_rooms: ds 20 ; visit rooms bit array visited_percent:db 0 food_ptr: dw 0 org &6000 start: di ld sp, menu_selection ld a, (sysvar_FRAMES+1) cp &25 ; is frames MSB as expected? nop ; was RET NZ for copy-protection check jp reset_menu ; Initial game state data player_init: db 0, 0, 0, 0, 0, 0, 0, 0 weapon_init: db 0, 0, 0, 0, 0, 0, 0, 0 sound_init: db 0, 0, 0, 0, 0, 0, 0, 0 acg_key_init: db &8c, 0, 0, &58, &58, &46, 0, 0 db &8d, 0, 0, &58, &58, &46, 0, 0 db &8e, 0, 0, &58, &58, &46, 0, 0 green_key_init: db &81, 5, 0, &70, &60, &44, 0, 0 ; green key red_key_init: db &81, &17, 0, &80, &40, &42, 0, 0 ; red key cyan_key_init: db &81, &53, 0, &58, &58, &45, 0, 0 ; cyan key db &81, &66, 0, &30, &87, &46, 0, 0 ; yellow key db &80, 9, 0, &40, &40, &42, 0, 0 ; leaf db 0, 0, 0, 0, 0, 0, 0, 0 ; tombstone1 db 0, 0, 0, 0, 0, 0, 0, 0 ; tombstone2 db 0, 0, 0, 0, 0, 0, 0, 0 ; tombstone3 db 0, 0, 0, 0, 0, 0, 0, 0 ; tombstone4 db &8a, 5, 0, &40, &70, &46, 0, 0 ; crucafix db &8b, &30, 0, &40, &70, &45, 0, 0 ; spanner db &82, &3b, 0, &60, &60, &44, 0, 0 ; wine db &83, &48, 0, &70, &70, &45, 0, 0 ; coin db &84, &64, 0, &80, &80, &46, 0, 0 ; wing db &85, &6b, 0, &40, &40, &45, 0, 0 ; whip db &86, &13, 0, &50, &50, &44, 0, 0 ; frog's leg db &87, &84, 0, &60, &40, &43, 0, 0 ; jewel db &88, &1f, 0, &70, &70, &42, 0, 0 ; money bag db &89, &49, 0, &50, &40, &47, 0, 0 ; skull food_init: db &50, &27, 0, &57, &67, &43, 0, 0 ; can db &50, &7f, 0, &40, &40, &46, 0, 0 db &50, &1e, 0, &50, &57, &46, 0, 0 db &50, &0c, 0, &60, &60, &43, 0, 0 db &50, &67, 0, &57, &40, &42, 0, 0 db &50, &41, 0, &57, &67, &42, 0, 0 db &51, &75, 0, &30, &40, &44, 0, 0 ; candy db &51, &83, 0, &30, &40, &46, 0, 0 db &51, &0c, 0, &60, &70, &42, 0, 0 db &51, &68, 0, &57, &40, &43, 0, 0 db &51, &45, 0, &57, &46, &45, 0, 0 db &51, &46, 0, &43, &7b, &45, 0, 0 db &52, &86, 0, &47, &60, &43, 0, 0 ; chop db &52, &6e, 0, &60, &77, &42, 0, 0 db &52, &7d, 0, &57, &67, &43, 0, 0 db &52, &6a, 0, &30, &67, &42, 0, 0 db &52, &3e, 0, &43, &7b, &42, 0, 0 db &52, &35, 0, &57, &67, &43, 0, 0 db &53, &2b, 0, &40, &80, &46, 0, 0 ; lollipop db &53, &8a, 0, &57, &67, &45, 0, 0 db &53, 9, 0, &80, &90, &44, 0, 0 db &53, &70, 0, &80, &90, &43, 0, 0 db &53, &74, 0, &57, &87, &42, 0, 0 db &53, &33, 0, &57, &67, &45, 0, 0 db &54, &78, 0, &37, &37, &47, 0, 0 ; icecream db &54, &8a, 0, &7f, &7f, &47, 0, 0 db &54, &0b, 0, &57, &67, &46, 0, 0 db &54, &65, 0, &57, &87, &46, 0, 0 db &54, &53, 0, &43, &7b, &47, 0, 0 db &54, &4c, 0, &6b, &7b, &46, 0, 0 db &55, &7b, 0, &50, &60, &45, 0, 0 ; pudding db &55, &87, 0, &57, &67, &45, 0, 0 db &55, &0d, 0, &30, &67, &43, 0, 0 db &55, &66, 0, &43, &87, &43, 0, 0 db &55, &53, 0, &6b, &7b, &42, 0, 0 db &55, &4f, 0, &57, &67, &47, 0, 0 db &56, &7e, 0, &37, &80, &44, 0, 0 ; apple db &56, &8c, 0, &57, &67, &44, 0, 0 db &56, &70, 0, &30, &90, &44, 0, 0 db &56, &66, 0, &6b, &87, &44, 0, 0 db &56, &3c, 0, &43, &7b, &42, 0, 0 db &56, &39, 0, &43, &7b, &42, 0, 0 db &57, &7e, 0, &87, &80, &47, 0, 0 ; bottle db &57, &24, 0, &60, &70, &47, 0, 0 db &57, &70, 0, &57, &90, &47, 0, 0 db &57, &12, 0, &57, &40, &47, 0, 0 db &57, &5e, 0, &57, &67, &47, 0, 0 db &57, &1d, 0, &30, &67, &47, 0, 0 db &50, &17, 0, &40, &40, &42, 0, 0 ; can db &50, &73, 0, &30, &67, &42, 0, 0 db &50, 7, 0, &57, &67, &43, 0, 0 db &50, 2, 0, &57, &67, &43, 0, 0 db &51, &0f, 0, &57, &67, &43, 0, 0 ; candy db &51, &3a, 0, &30, &48, &43, 0, 0 db &51, &41, 0, &80, &67, &42, 0, 0 db &51, &85, 0, &43, &7b, &42, 0, 0 db &52, &6c, 0, &57, &47, &43, 0, 0 ; chop db &52, &3a, 0, &57, &48, &43, 0, 0 db &52, &69, 0, &30, &40, 3, 0, 0 db &52, &80, 0, &30, &40, 3, 0, 0 db &53, 4, 0, &57, &67, &42, 0, 0 ; lollipop db &53, &4b, 0, &30, &88, &42, 0, 0 db &53, &11, 0, &57, &67, &46, 0, 0 db &53, &80, 0, &57, &40, &44, 0, 0 db &54, &69, 0, &30, &67, &46, 0, 0 ; icecream db &54, &35, 0, &57, &90, &46, 0, 0 db &54, &69, 0, &30, &90, &46, 0, 0 db &54, &80, 0, &80, &80, &44, 0, 0 db &55, &57, 0, &57, &40, &46, 0, 0 ; pudding db &55, &35, 0, &57, &40, &46, 0, 0 db &55, &25, 0, &6b, &7b, &43, 0, 0 db &55, &1b, 0, &57, &67, &44, 0, 0 db &56, &58, 0, &57, &40, &44, 0, 0 ; apple db &56, &4e, 0, &67, &40, &42, 0, 0 db &56, &37, 0, &57, &67, &46, 0, 0 db &56, &85, 0, &6b, &7b, &44, 0, 0 db &57, &5b, 0, &57, &67, &47, 0, 0 ; bottle db &57, &4e, 0, &40, &67, &47, 0, 0 db &57, &49, 0, &57, &67, &47, 0, 0 db &57, &28, 0, &57, &67, &47, 0, 0 db &a1, &50, 0, &57, &40, &42, 0, 0 ; mushroom db &a1, &43, 0, &6b, &54, &42, 1, 0 db &a1, &40, 0, &43, &7b, &42, 2, 0 db &a1, &8f, 0, &57, &8f, &42, 3, 0 db &a1, &8f, 0, &43, &7b, &42, 4, 0 db &a1, &8f, 0, &6b, &7b, &42, 5, 0 db &a1, &45, 0, &80, &67, &42, 6, 0 db &a1, &38, 0, &6b, &54, &42, 7, 0 db &a1, &74, 0, &30, &40, &42, 6, 0 db &a1, &74, 0, &30, &88, &42, 5, 0 db &a1, &74, 0, &78, &88, &42, 4, 0 db &a1, &74, 0, &80, &40, &42, 3, 0 db &a1, &54, 0, &57, &40, &42, 2, 0 db &a1, &3b, 0, &43, &7b, &42, 1, 0 db &a1, &3b, 0, &6b, &7b, &42, 0, 0 db &a1, &53, 0, &80, &40, &42, 1, 0 db &31, 0, 0, 0, 0, 0, 0, 0 ; blank db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; creature 1 db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; creature 2 db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; creature 3 byte_640D: db &70, &17, 0, &50, &50, &47, 0, 0, 0, 0, 0, &68, &68, 0, 0, 0 ; mummy db &7c, &6d, 0, &50, &50, &44, 0, 0, 0, 0, 0, &72, &72, 0, 0, 0 ; dracula db &78, &43, 0, &50, &50, &43, 0, 0, 0, 0, 0, &72, &72, 0, 0, 0 ; devil db &74, &55, 0, &50, &50, &42, 0, 0, 0, 0, 0, &50, &60, 0, 0, 0 ; frankenstein db &9c, &56, 0, &58, &38, &42, 0, 0, 0, 0, 0, &50, &60, 0, 0, 0 ; hunchback ; Key: _r/_g/_b/_y suffix for locked door colours, _s for stairs (one end is large doorway) door_07_00: db 2, 7, &34, &50, &1f, 0, 4, &56 db 2, 0, &34, &50, &b7, &80, 4, 6 door_19_00: db 2, &19, &34, &a0, &6f, &60, &b7, 3 db 2, 0, &34, 8, &6f, &e0, 6, 3 door_01_00_c: db &0a, 1, &34, &50, &b7, &80, 4, 6 db &0a, 0, &34, &50, &1f, 0, 4, &56 door_02_01: db 2, 2, &34, &a0, &6f, &60, &b7, 3 db 2, 1, &34, 8, &6f, &e0, 6, 3 door_03_02: db 2, 3, &34, &a0, &6f, &60, &b7, 3 db 2, 2, &34, 8, &6f, &e0, 6, 3 door_04_03: db 2, 4, &34, &50, &1f, 0, 4, &56 db 2, 3, &34, &50, &b7, &80, 4, 6 door_19_04: db 2, &19, &34, 8, &6f, &e0, 6, 3 db 2, 4, &34, &80, &6f, &60, &b7, 3 door_05_04: db 2, 5, &34, &50, &1f, 0, 4, &56 db 2, 4, &34, &50, &b7, &80, 4, 6 door_06_05: db 2, 6, &34, 8, &6f, &e0, 6, 3 db 2, 5, &34, &a0, &6f, &60, &b7, 3 door_1A_06_s: db 3, &1a, &38, &48, &b6, &80, &16, 8 db 2, 6, &34, &50, &3f, 0, 4, &56 door_08_06_g: db 9, 8, &34, &50, &1f, 0, 4, &56 db 9, 6, &34, &50, &97, &80, 4, 6 door_07_06: db 2, 7, &34, 8, &6f, &e0, 6, 3 db 2, 6, &34, &a0, &6f, &60, &b7, 3 door_09_08: db 2, 9, &34, &50, &1f, 0, 4, &57 db 2, 8, &34, &50, &b7, &80, 4, 6 door_0A_09: db 2, &0a, &34, &a0, &6f, &60, &b7, 3 db 2, 9, &34, 8, &6f, &e0, 6, 3 door_0B_0A: db 2, &0b, &34, &a0, &6f, &60, &b7, 3 db 2, &0a, &34, 8, &6f, &e0, 6, 3 door_0C_0B: db 2, &0c, &34, &a0, &6f, &60, &b7, 3 db 2, &0b, &34, 8, &6f, &e0, 6, 3 door_0D_0C: db 2, &0d, &34, &a0, &6f, &60, &b7, 3 db 2, &0c, &34, 8, &6f, &e0, 6, 3 door_0E_0D: db 2, &0e, &34, &50, &b7, &80, 4, 6 db 2, &0d, &34, &50, &1f, 0, 4, &56 door_0F_0E: db 2, &0f, &34, &50, &b7, &80, 4, 6 db 2, &0e, &34, &50, &1f, 0, 4, &56 door_10_0F: db 2, &10, &34, &50, &b7, &80, 4, 6 db 2, &0f, &34, &50, &1f, 0, 4, &56 door_11_10_r: db 8, &11, &34, &50, &b7, &80, 4, 6 db 8, &10, &34, &50, &1f, 0, 4, &56 door_12_11: db 2, &12, &34, &50, &b7, &80, 4, 6 db 2, &11, &34, &50, &1f, 0, 4, &56 door_13_12: db 2, &13, &34, &50, &b7, &80, 4, 6 db 2, &12, &34, &50, &1f, 0, 4, &56 door_14_13: db 2, &14, &34, 8, &6f, &e0, 6, 3 db 2, &13, &34, &a0, &6f, &60, &b7, 3 door_15_14: db 2, &15, &34, 8, &6f, &e0, 6, 3 db 2, &14, &34, &a0, &6f, &60, &b7, 3 door_16_15: db 2, &16, &34, 8, &6f, &e0, 6, 3 db 2, &15, &34, &a0, &6f, &60, &b7, 3 door_17_16_r: db 8, &17, &34, 8, &6f, &e0, 6, 3 db 8, &16, &34, &a0, &6f, &60, &b7, 3 door_18_17_g: db 9, &18, &34, &50, &1f, 0, 4, &56 db 9, &17, &34, &50, &b7, &80, 4, 6 door_18_02: db 2, &18, &34, &50, &b7, &80, 4, 6 db 2, 2, &34, &50, &3f, 0, 4, &56 door_1A_1B: db 2, &1a, &34, &50, &28, 0, 4, &56 db 2, &1b, &34, &50, &b7, &80, 4, 6 door_1B_1C_s: db 2, &1b, &34, &a0, &6f, &60, &b7, 3 db 3, &1c, &74, 8, &77, &e0, 8, &f5 door_1C_1D: db 2, &1c, &34, &98, &6f, &60, &af, 3 db 1, &1d, &34, &18, &6f, &e0, 6, 3 door_1E_1F: db 2, &1e, &34, &50, &1f, 0, 4, &56 db 2, &1f, &34, &50, &b7, &80, 4, 6 door_1F_20: db 2, &1f, &34, 8, &6f, &e0, 6, 3 db 2, &20, &34, &a0, &6f, &60, &b7, 3 door_20_21: db 2, &20, &34, 8, &6f, &e0, 6, 3 db 2, &21, &34, &a0, &6f, &60, &b7, 3 door_21_22: db 2, &21, &34, &50, &b7, &80, 4, 6 db 2, &22, &34, &50, &1f, 0, 4, &56 door_22_23: db 2, &22, &34, &50, &b7, &80, 4, 6 db 2, &23, &34, &50, &1f, 0, 4, &56 door_23_24: db 2, &23, &34, &a0, &6f, &60, &b7, 3 db 2, &24, &34, 8, &6f, &e0, 6, 3 door_24_25: db 2, &24, &34, &a0, &6f, &60, &b7, 3 db 2, &25, &34, 8, &6f, &e0, 6, 3 door_25_1E_c: db &0a, &25, &34, &50, &1f, 0, 4, &56 db &0a, &1e, &34, &50, &b7, &80, 4, 6 door_24_26_s: db 2, &24, &34, &50, &3f, 0, 4, &56 db 3, &26, &38, &48, &b6, &80, &16, 8 door_03_26: db 2, 2, &34, &50, &97, &80, 4, 6 db 2, &26, &34, &50, &28, 0, 4, &56 door_27_28: db 2, &27, &34, &50, &b7, &80, 4, 6 db 2, &28, &34, &50, &1f, 0, 4, &56 door_28_29_c: db &0a, &28, &34, &50, &b7, &80, 4, 6 db &0a, &29, &34, &50, &1f, 0, 4, &56 door_29_2A: db 2, &29, &34, 8, &6f, &e0, 6, 3 db 2, &2a, &34, &a0, &6f, &60, &b7, 3 door_2A_2B: db 2, &2a, &34, 8, &6f, &e0, 6, 3 db 2, &2b, &34, &a0, &6f, &60, &b7, 3 door_2B_2C: db 2, &2b, &34, &50, &1f, 0, 4, &56 db 2, &2c, &34, &50, &b7, &80, 4, 6 door_2C_2D: db 2, &2c, &34, &50, &1f, 0, 4, &56 db 2, &2d, &34, &50, &b7, &80, 4, 6 door_2D_2E_g: db 9, &2d, &34, &a0, &6f, &60, &b7, 3 db 9, &2e, &34, 8, &6f, &e0, 6, 3 door_2E_27: db 2, &2e, &34, &a0, &6f, &60, &b7, 3 db 2, &27, &34, 8, &6f, &e0, 6, 3 door_27_2F_s: db 2, &27, &34, &50, &1f, 0, 4, &56 db 3, &2f, &38, &48, &b6, &80, &16, 8 door_20_2F_y: db &0b, &20, &34, &50, &97, &80, 4, 6 db &0b, &2f, &34, &50, &28, 0, 4, &56 door_30_31: db 1, &30, &34, &50, &a7, &80, 4, 6 db 1, &31, &34, &50, &27, 0, 4, &56 door_31_32: db 1, &31, &34, &50, &af, &80, 4, 6 db 1, &32, &34, &50, &27, 0, 4, &56 door_32_33: db 1, &32, &34, &50, &af, &80, 4, 6 db 1, &33, &34, &50, &2f, 0, 4, &56 door_33_34: db 1, &33, &34, &50, &a7, &80, 4, 6 db 1, &34, &34, &50, &27, 0, 4, &56 door_34_35: db 1, &34, &34, &50, &af, &80, 4, 6 db 1, &35, &34, &50, &2f, 0, 4, &56 door_33_36: db 1, &33, &34, &90, &6f, &60, &b7, 3 db 1, &36, &34, &10, &6f, &e0, 6, 3 door_36_37: db 1, &36, &34, &98, &6f, &60, &b7, 3 db 1, &37, &34, &10, &6f, &e0, 6, 3 door_37_38: db 1, &37, &34, &98, &6f, &60, &b7, 3 db 1, &38, &34, &18, &6f, &e0, 6, 3 door_38_39: db 1, &38, &34, &50, &a7, &80, 4, 6 db 1, &39, &34, &50, &2f, 0, 4, &56 door_38_3A_g: db &0d, &38, &34, &90, &6f, &60, &b7, 3 db &0d, &3a, &34, &18, &6f, &e0, 6, 3 door_39_3B: db 1, &39, &34, &90, &6f, &60, &b7, 3 db 1, &3b, &34, &18, &6f, &e0, 6, 3 door_3A_3B: db 1, &3a, &34, &50, &a7, &80, 4, 6 db 1, &3b, &34, &50, &2f, 0, 4, &56 door_3B_3C_g: db &0d, &3b, &34, &50, &a7, &80, 4, 6 db &0d, &3c, &34, &50, &2f, 0, 4, &56 door_3B_3D: db 1, &3b, &34, &90, &6f, &60, &b7, 3 db 1, &3d, &34, &18, &6f, &e0, 6, 3 door_3C_3E: db 1, &3c, &34, &90, &6f, &60, &b7, 3 db 1, &3e, &34, &18, &6f, &e0, 6, 3 door_3D_3E: db 1, &3d, &34, &50, &a7, &80, 4, 6 db 1, &3e, &34, &50, &2f, 0, 4, &56 door_3D_3F_c: db &0e, &3d, &34, &90, &6f, &60, &b7, 3 db &0e, &3f, &34, &10, &6f, &e0, 6, 3 door_34_40: db 1, &3f, &34, &98, &6f, &60, &b7, 3 db 1, &40, &34, &18, &6f, &e0, 6, 3 door_40_41: db 1, &40, &34, &90, &6f, &60, &b7, 3 db 1, &41, &34, &18, &6f, &e0, 6, 3 door_40_42: db 1, &40, &34, &50, &2f, 0, 4, &56 db 1, &42, &34, &50, &af, &80, 4, 6 door_42_43: db 1, &42, &34, &50, &27, 0, 4, &56 db 1, &43, &34, &50, &a7, &80, 4, 6 door_43_44: db 1, &43, &34, &90, &6f, &60, &b7, 3 db 1, &44, &34, &10, &6f, &e0, 6, 3 door_44_45_r: db &0c, &44, &34, &98, &6f, &60, &b7, 3 db &0c, &45, &34, &18, &6f, &e0, 6, 3 door_43_46: db 1, &43, &34, &50, &2f, 0, 4, &56 db 1, &46, &34, &50, &a7, &80, 4, 6 door_46_47: db 1, &46, &34, &18, &6f, &e0, 6, 3 db 1, &47, &34, &98, &6f, &60, &b7, 3 door_47_48_r: db &0c, &47, &34, &10, &6f, &e0, 6, 3 db &0c, &48, &34, &90, &6f, &60, &b7, 3 door_48_49: db 1, &48, &34, &50, &a7, &80, 4, 6 db 1, &49, &34, &50, &27, 0, 4, &56 door_48_4A_c: db &0e, &48, &34, &18, &6f, &e0, 6, 3 db &0e, &4a, &34, &98, &6f, &60, &b7, 3 door_4A_4B: db 1, &4a, &34, &10, &6f, &e0, 6, 3 db 1, &4b, &34, &90, &6f, &60, &b7, 3 door_4B_4C: db 1, &4b, &34, &50, &2f, 0, 4, &56 db 1, &4c, &34, &50, &a7, &80, 4, 6 door_48_4D: db 1, &48, &34, &50, &2f, 0, 4, &56 db 1, &4d, &34, &50, &af, &80, 4, 6 door_4D_4E_r: db &0c, &4d, &34, &50, &27, 0, 4, &56 db &0c, &4e, &34, &50, &a7, &80, 4, 6 door_4E_4F: db 1, &4e, &34, &90, &6f, &60, &b7, 3 db 1, &4f, &34, &10, &6f, &e0, 6, 3 door_4F_50: db 1, &4f, &34, &98, &6f, &60, &b7, 3 db 1, &50, &34, &18, &6f, &e0, 6, 3 door_50_51: db 1, &50, &34, &50, &a7, &80, 4, 6 db 1, &51, &34, &50, &27, 0, 4, &56 door_50_52_g: db &0d, &50, &34, &90, &6f, &60, &b7, 3 db &0d, &52, &34, &10, &6f, &e0, 6, 3 door_52_53: db 1, &52, &34, &98, &6f, &60, &b7, 3 db 1, &53, &34, &18, &6f, &e0, 6, 3 door_1D_43: db 1, &1d, &34, &90, &6f, &60, &b7, 3 db 1, &43, &34, &18, &6f, &e0, 6, 3 door_46_51: db 1, &46, &34, &50, &2f, 0, 4, &56 db 1, &51, &34, &50, &af, &80, 4, 6 door_4C_55: db 1, &4c, &34, &18, &6f, &e0, 6, 3 db 1, &55, &34, &90, &6f, &60, &b7, 3 door_54_55: db 1, &54, &34, &90, &6f, &60, &b7, 3 db 1, &55, &34, &18, &6f, &e0, 6, 3 door_54_30: db 1, &54, &34, &18, &6f, &e0, 6, 3 db 1, &30, &34, &90, &6f, &60, &b7, 3 door_2D_75: db 2, &2d, &34, 8, &6f, &e0, 6, 3 db 2, &75, &34, &a0, &6f, &60, &b7, 3 door_75_76: db 2, &75, &34, &50, &b7, &80, 4, 6 db 2, &76, &34, &50, &1f, 0, 4, &56 door_76_77: db 2, &76, &34, &a0, &6f, &60, &b7, 3 db 2, &77, &34, 8, &6f, &e0, 6, 3 door_77_78: db 2, &77, &34, &a0, &6f, &60, &b7, 3 db 2, &78, &34, 8, &6f, &e0, 6, 3 door_78_79: db 2, &78, &34, &50, &b7, &80, 4, 6 db 2, &79, &34, &50, &1f, 0, 4, &56 door_79_7A: db 2, &79, &34, &50, &b7, &80, 4, 6 db 2, &7a, &34, &50, &1f, 0, 4, &56 door_7A_7B: db 2, &7a, &34, 8, &6f, &e0, 6, 3 db 2, &7b, &34, &a0, &6f, &60, &b7, 3 door_7B_7C_y: db &0b, &7b, &34, 8, &6f, &e0, 6, 3 db &0b, &7c, &34, &a0, &6f, &60, &b7, 3 door_7C_7D_y: db &0b, &7c, &34, &50, &1f, 0, 4, &56 db &0b, &7d, &34, &50, &b7, &80, 4, 6 door_7D_76: db 2, &7d, &34, &50, &1f, 0, 4, &56 db 2, &76, &34, &50, &b7, &80, 4, 6 door_7A_7E_r: db 8, &7a, &34, &a0, &6f, &60, &b7, 3 db 8, &7e, &34, 8, &6f, &e0, 6, 3 door_7E_29: db 2, &7e, &34, &50, &1f, 0, 4, &56 db 2, &29, &34, &50, &b7, &80, 4, 6 door_21_88: db 2, &21, &34, &50, &1f, 0, 4, &56 db 2, &88, &34, &50, &b7, &80, 4, 6 door_7F_80_g: db 9, &7f, &34, &a0, &6f, &60, &b7, 3 db 9, &80, &34, 8, &6f, &e0, 6, 3 door_80_82: db 2, &80, &34, &50, &b7, &80, 4, 6 db 2, &82, &34, &50, &1f, 0, 4, &56 door_82_81: db 2, &82, &34, 8, &6f, &e0, 6, 3 db 2, &81, &34, &a0, &6f, &60, &b7, 3 door_81_7F: db 2, &81, &34, &50, &1f, 0, 4, &56 db 2, &7f, &34, &50, &b7, &80, 4, 6 door_82_87_c: db &0a, &82, &34, &a0, &6f, &60, &b7, 3 db &0a, &87, &34, 8, &6f, &e0, 6, 3 door_87_88: db 2, &87, &34, &a0, &6f, &60, &b7, 3 db 2, &88, &34, 8, &6f, &e0, 6, 3 door_87_8B: db 2, &87, &34, &50, &b7, &80, 4, 6 db 2, &8b, &34, &50, &1f, 0, 4, &56 door_8B_8C: db 2, &8b, &34, &50, &b7, &80, 4, 6 db 2, &8c, &34, &50, &1f, 0, 4, &56 door_8C_8D_g: db 9, &8c, &34, &50, &b7, &80, 4, 6 db 9, &8d, &34, &50, &1f, 0, 4, &56 door_83_84_r: db 8, &83, &34, &a0, &6f, &60, &b7, 3 db 8, &84, &34, 8, &6f, &e0, 6, 3 door_84_86: db 2, &84, &34, &50, &b7, &80, 4, 6 db 2, &86, &34, &50, &1f, 0, 4, &56 door_86_85: db 2, &86, &34, 8, &6f, &e0, 6, 3 db 2, &85, &34, &a0, &6f, &60, &b7, 3 door_85_83: db 2, &85, &34, &50, &1f, 0, 4, &56 db 2, &83, &34, &50, &b7, &80, 4, 6 door_84_89_y: db &0b, &84, &34, &a0, &6f, &60, &b7, 3 db &0b, &89, &34, 8, &6f, &e0, 6, 3 door_89_8D: db 2, &89, &34, &50, &1f, 0, 4, &56 db 2, &8d, &34, &50, &b7, &80, 4, 6 door_89_8A: db 2, &89, &34, &a0, &6f, &60, &b7, 3 db 2, &8a, &34, 8, &6f, &e0, 6, 3 door_8A_23_g: db 9, &8a, &34, &50, &1f, 0, 4, &56 db 9, &23, &34, &50, &b7, &80, 4, 6 door_13_73: db 2, &13, &34, 8, &6f, &e0, 6, 3 db 2, &73, &34, &a0, &6f, &60, &b7, 3 door_11_6B: db 2, &11, &34, &80, &6f, &60, &b7, 3 db 2, &6b, &34, 8, &6f, &e0, 6, 3 door_6B_6C: db 2, &6b, &34, &a0, &6f, &60, &b7, 3 db 2, &6c, &34, 8, &6f, &e0, 6, 3 door_6C_03_c: db &0a, &6c, &34, &a0, &6f, &60, &b7, 3 db &0a, 3, &34, 8, &6f, &e0, 6, 3 door_0F_6D_g: db 9, &0f, &34, &80, &6f, &60, &b7, 3 db 9, &6d, &34, 8, &6f, &e0, 6, 3 door_6D_6E: db 2, &6d, &34, &a0, &6f, &60, &b7, 3 db 2, &6e, &34, 8, &6f, &e0, 6, 3 door_6E_05: db 2, &6e, &34, &a0, &6f, &60, &b7, 3 db 2, 5, &34, 8, &6f, &e0, 6, 3 door_0D_6F_c: db &0a, &0d, &34, &50, &b7, &80, 4, 6 db &0a, &6f, &34, &50, &1f, 0, 4, &56 door_6F_70: db 2, &6f, &34, &50, &b7, &80, 4, 6 db 2, &70, &34, &70, &1f, 0, 4, &56 door_70_71_s: db 2, &70, &34, &30, &1f, 0, 4, &56 db 3, &71, &38, &48, &b6, &80, &16, 8 door_71_72_s: db 2, &71, &34, &50, &28, 0, 4, &56 db 3, &72, &38, &48, &b6, &80, &16, 8 door_72_35: db 2, &72, &34, &50, &28, 0, 4, &56 db 1, &35, &34, &50, &a7, &80, 4, 6 door_30_74: db 1, &30, &34, &18, &6f, &e0, 6, 3 db 1, &74, &34, &90, &6f, &60, &b7, 3 door_56_57: db 2, &56, &34, &a0, &6f, &60, &b7, 3 db 2, &57, &34, 8, &6f, &e0, 6, 3 door_57_58_g: db 9, &57, &34, &a0, &6f, &60, &b7, 3 db 9, &58, &34, 8, &6f, &e0, 6, 3 door_58_59: db 2, &58, &34, &a0, &6f, &60, &b7, 3 db 2, &59, &34, 8, &6f, &e0, 6, 3 door_5A_5B: db 2, &5a, &34, &a0, &6f, &60, &b7, 3 db 2, &5b, &34, 8, &6f, &e0, 6, 3 door_5B_5C_r: db 8, &5b, &34, &a0, &6f, &60, &b7, 3 db 8, &5c, &34, 8, &6f, &e0, 6, 3 door_5C_5D_g: db 9, &5c, &34, &a0, &6f, &60, &b7, 3 db 9, &5d, &34, 8, &6f, &e0, 6, 3 door_5E_5F_r: db 8, &5e, &34, &a0, &6f, &60, &b7, 3 db 8, &5f, &34, 8, &6f, &e0, 6, 3 door_5F_60_r: db 8, &5f, &34, &a0, &6f, &60, &b7, 3 db 8, &60, &34, 8, &6f, &e0, 6, 3 door_60_61: db 2, &60, &34, &a0, &6f, &60, &b7, 3 db 2, &61, &34, 8, &6f, &e0, 6, 3 door_62_63: db 2, &62, &34, &a0, &6f, &60, &b7, 3 db 2, &63, &34, 8, &6f, &e0, 6, 3 door_63_64: db 2, &63, &34, &a0, &6f, &60, &b7, 3 db 2, &64, &34, 8, &6f, &e0, 6, 3 door_64_65_y: db &0b, &64, &34, &a0, &6f, &60, &b7, 3 db &0b, &65, &34, 8, &6f, &e0, 6, 3 door_56_5A: db 2, &56, &34, &50, &b7, &80, 4, 6 db 2, &5a, &34, &50, &1f, 0, 4, &56 door_5A_5E_c: db &0a, &5a, &34, &50, &b7, &80, 4, 6 db &0a, &5e, &34, &50, &1f, 0, 4, &56 door_5E_62: db 2, &5e, &34, &50, &b7, &80, 4, 6 db 2, &62, &34, &50, &1f, 0, 4, &56 door_57_5B: db 2, &57, &34, &50, &b7, &80, 4, 6 db 2, &5b, &34, &50, &1f, 0, 4, &56 door_5B_5F_g: db 9, &5b, &34, &30, &b7, &80, 4, 6 db 9, &5f, &34, &30, &1f, 0, 4, &56 door_5F_63_c: db &0a, &5f, &34, &50, &b7, &80, 4, 6 db &0a, &63, &34, &50, &1f, 0, 4, &56 door_58_5C: db 2, &58, &34, &50, &b7, &80, 4, 6 db 2, &5c, &34, &50, &1f, 0, 4, &56 door_5C_60_r: db 8, &5c, &34, &70, &b7, &80, 4, 6 db 8, &60, &34, &70, &1f, 0, 4, &56 door_60_64_c: db &0a, &60, &34, &50, &b7, &80, 4, 6 db &0a, &64, &34, &50, &1f, 0, 4, &56 door_59_5D_y: db &0b, &59, &34, &50, &b7, &80, 4, 6 db &0b, &5d, &34, &50, &1f, 0, 4, &56 door_5D_61: db 2, &5d, &34, &50, &b7, &80, 4, 6 db 2, &61, &34, &50, &1f, 0, 4, &56 door_61_65: db 2, &61, &34, &50, &b7, &80, 4, 6 db 2, &65, &34, &50, &1f, 0, 4, &56 door_67_56_c: db &0a, &67, &34, &50, &b7, &80, 4, 6 db &0a, &56, &34, &50, &1f, 0, 4, &56 door_68_59_r: db 8, &68, &34, &50, &b7, &80, 4, 6 db 8, &59, &34, &50, &1f, 0, 4, &56 door_69_56_y: db &0b, &69, &34, &a0, &6f, &60, &b7, 3 db &0b, &56, &34, 8, &6f, &e0, 6, 3 door_6A_62_g: db 9, &6a, &34, &a0, &6f, &60, &b7, 3 db 9, &62, &34, 8, &6f, &e0, 6, 3 door_66_5B_y: db &0b, &66, &34, &30, &1f, 0, 4, &56 db &0b, &5b, &34, &70, &b7, &80, 4, 6 door_66_5C_y: db &0b, &66, &34, &70, &1f, 0, 4, &56 db &0b, &5c, &34, &30, &b7, &80, 4, 6 door_66_5F_y: db &0b, &66, &34, &30, &b7, &80, 4, 6 db &0b, &5f, &34, &70, &1f, 0, 4, &56 door_66_60_y: db &0b, &66, &34, &70, &b7, &80, 4, 6 db &0b, &60, &34, &30, &1f, 0, 4, &56 door_65_1B: db 2, &65, &34, &a0, &6f, &60, &b7, 3 db 2, &1b, &34, 8, &6f, &e0, 6, 3 door_40_8F: db 1, &40, &34, &50, &a7, &80, 4, 6 db 1, &8f, &34, &50, &2f, 0, 4, &56 door_54_90: db 1, &54, &34, &50, &a7, &80, 4, 6 db 1, &90, &34, &50, &2f, 0, 4, &56 door_90_91: db 1, &90, &34, &50, &a7, &80, 4, 6 db 1, &91, &34, &50, &2f, 0, 4, &56 door_91_92: db 1, &91, &34, &90, &6f, &60, &b7, 3 db 1, &92, &34, &18, &6f, &e0, 6, 3 door_92_93: db 1, &92, &34, &90, &6f, &60, &b7, 3 db 1, &93, &34, &18, &6f, &e0, 6, 3 door_93_94: db 1, &93, &34, &90, &6f, &60, &b7, 3 db 1, &94, &34, &18, &6f, &e0, 6, 3 door_3A_94: db 1, &3a, &34, &50, &2f, 0, 4, &56 db 1, &94, &34, &50, &a7, &80, 4, 6 trap_73_74: db &19, &73, &34, &50, &70, 3, &24, &e4 db &1b, &74, &34, &48, &74, 3, 0, 0 trap_03_65: db &19, 3, &34, &30, &70, 3, &24, &e4 db &1b, &65, &34, &38, &74, 3, 0, 0 trap_61_4B: db &19, &61, &34, &50, &70, 3, &24, &e4 db &1b, &4b, &34, &48, &74, 3, 0, 0 trap_2D_8D: db &19, &2d, &34, &50, &90, 3, &24, &e4 db &1b, &8d, &34, &48, &94, 3, 0, 0 trap_76_84: db &19, &76, &34, &50, &70, 3, &24, &e4 db &1b, &84, &34, &48, &74, 3, 0, 0 trap_8B_6C: db &19, &8b, &34, &50, &70, 3, &24, &e4 db &1b, &6c, &34, &48, &74, 3, 0, 0 trap_8D_6E: db &19, &8d, &34, &50, &50, 3, &24, &e4 db &1b, &6e, &34, &48, &54, 3, 0, 0 trap_21_03: db &19, &21, &34, &70, &70, 3, &24, &e4 db &1b, 3, &34, &68, &74, 3, 0, 0 trap_15_66: db &19, &15, &34, &50, &80, 3, &24, &e4 db &1b, &66, &34, &48, &74, 3, 0, 0 trap_78_8A: db &19, &78, &34, &70, &70, 3, &24, &e4 db &1b, &8a, &34, &68, &74, 3, 0, 0 trap_29_09: db &19, &29, &34, &50, &80, 3, &24, &e4 db &1b, 9, &34, &48, &74, 3, 0, 0 picture_0B_0C: db &11, &0b, 0, &50, &97, &81, 0, 0 db &11, &0c, 0, &50, &97, &81, 0, 0 barrels_91_3D: db &27, &91, 0, &50, &8f, 0, 0, 0 db &27, &3d, 0, &5f, &5f, 0, 0, 0 knight_1F_21: db &1e, &1f, 0, &98, &67, &60, 0, 0 db &1e, &21, 0, 8, &67, &e0, 0, 0 knight_25_23: db &1e, &25, 0, &98, &67, &60, 0, 0 db &1e, &23, 0, 8, &67, &e0, 0, 0 knight_00_06: db &1e, 0, 0, &98, &3f, &60, 0, 0 db &1e, 6, 0, &38, &47, 0, 0, 0 knight_00_06_2: db &1e, 0, 0, &98, &8f, &60, 0, 0 db &1e, 6, 0, &78, &47, 0, 0, 0 knight_01_03: db &1e, 1, 0, &58, &27, 0, 0, 0 db &1e, 3, 0, &58, &27, 0, 0, 0 knight_05_07: db &1e, 5, 0, &58, &b7, &80, 0, 0 db &1e, 7, 0, &58, &b7, &80, 0, 0 knight_17_15: db &1e, &17, 0, &58, &27, 0, 0, 0 db &1e, &15, 0, &78, &97, &80, 0, 0 knight_15_13: db &1e, &15, 0, &38, &97, &80, 0, 0 db &1e, &13, 0, &58, &27, 0, 0, 0 knight_88_8A: db &1e, &88, 0, 8, &3f, &e0, 0, 0 db &1e, &8a, 0, 8, &47, &e0, 0, 0 knight_88_8A_2: db &1e, &88, 0, 8, &8f, &e0, 0, 0 db &1e, &8a, 0, 8, &87, &e0, 0, 0 knight_27_2B: db &1e, &27, 0, &38, &27, 0, 0, 0 db &1e, &2b, 0, &38, &27, 0, 0, 0 knight_27_2B_2: db &1e, &27, 0, &78, &27, 0, 0, 0 db &1e, &2b, 0, &78, &27, 0, 0, 0 knight_56_24: db &1e, &56, 0, &38, &27, 0, 0, 0 db &1e, &24, 0, &38, &47, 0, 0, 0 knight_56_24_2: db &1e, &56, 0, &78, &27, 0, 0, 0 db &1e, &24, 0, &78, &47, 0, 0, 0 knight_7C_7A: db &1e, &7c, 0, &38, &27, 0, 0, 0 db &1e, &7a, 0, &38, &27, 0, 0, 0 knight_7C_7A_2: db &1e, &7c, 0, &78, &27, 0, 0, 0 db &1e, &7a, 0, &78, &27, 0, 0, 0 knight_09_7F: db &1e, 9, 0, 8, &3f, &e0, 0, 0 db &1e, &7f, 0, &38, &b7, &80, 0, 0 knight_09_7F_2: db &1e, 9, 0, 8, &8f, &e0, 0, 0 db &1e, &7f, 0, &78, &b7, &80, 0, 0 table_0D_13: db &12, &0d, 0, &38, &50, 4, &cc, &49 db &12, &13, 0, &70, &90, 4, &cc, &49 table_63_5D: db &12, &63, 0, &38, &50, 4, &cc, &49 db &12, &5d, 0, &70, &50, 4, &cc, &49 table_18_88: db &12, &18, 0, &48, &50, 4, &cc, &49 db &12, &88, 0, &70, &50, 4, &cc, &49 table_7A_81: db &12, &7a, 0, &38, &50, 4, &cc, &49 db &12, &81, 0, &70, &50, 4, &cc, &49 table_18_6D: db &12, &18, 0, &58, &80, 4, &cc, &49 db &12, &6d, 0, &30, &90, 4, &cc, &49 table_5B_5C: db &12, &5b, 0, &38, &50, 4, &cc, &49 db &12, &5c, 0, &70, &50, 4, &cc, &49 table_6A_1B: db &12, &6a, 0, &78, &98, 4, &cc, &49 db &12, &1b, 0, &70, &50, 4, &cc, &49 table_2E_7D: db &12, &2e, 0, &38, &57, 4, &cc, &49 db &12, &7d, 0, &48, &50, 4, &cc, &49 table_2E_7D_2: db &12, &2e, 0, &60, &7f, 4, &cc, &49 db &12, &7d, 0, &58, &80, 4, &cc, &49 table_2A_2D: db &12, &2a, 0, &38, &57, 4, &cc, &49 db &12, &2d, 0, &30, &80, 4, &cc, &49 table_2A_2D_2: db &12, &2a, 0, &60, &7f, 4, &cc, &49 db &12, &2d, 0, &70, &80, 4, &cc, &49 shields_8D_8C: db &1c, &8d, 0, &28, &67, &e0, 0, 0 db &1d, &8c, 0, &28, &67, &e0, 0, 0 trophies_8B_8C: db &15, &8b, 0, &88, &6f, &40, 0, 0 db &16, &8c, 0, &88, &67, &40, 0, 0 shields_16_14: db &1c, &16, 0, &58, &37, 0, 0, 0 db &1d, &14, 0, &58, &97, &80, 0, 0 trophies_0E_12: db &15, &0e, 0, &28, &57, &e0, 0, 0 db &16, &12, 0, &88, &6f, &40, 0, 0 shields_0F_11: db &1c, &0f, 0, &28, &67, &e0, 0, 0 db &1d, &11, 0, &28, &67, &e0, 0, 0 trophies_10_73: db &15, &10, 0, &88, &6f, &40, 0, 0 db &16, &73, 0, &58, &97, &80, 0, 0 shields_08_18: db &1c, 8, 0, &88, &67, &40, 0, 0 db &1d, &18, 0, &88, &67, &40, 0, 0 trophies_6F_0E: db &15, &6f, 0, &28, &67, &e0, 0, 0 db &16, &0e, 0, &28, &77, &e0, 0, 0 pic_shi_00_19: db &25, 0, 0, &28, &17, 0, 0, 0 db &1d, &19, 0, &58, &37, 0, 0, 0 pic_tro_00_0B: db &11, 0, 0, &78, &1c, 0, 0, 0 db &16, &0b, 0, &58, &37, 0, 0, 0 shields_00_19: db &1c, 0, 0, &38, &b7, &80, 0, 0 db &1d, &19, 0, &58, &97, &80, 0, 0 trophies_00_0B: db &15, 0, 0, &78, &b7, &80, 0, 0 db &16, &0b, 0, &58, &97, &81, 0, 0 pic_tro_04_15: db &11, 4, 0, &28, &47, &e1, 0, 0 db &15, &15, 0, &58, &37, 0, 0, 0 tro_pic_04_14: db &16, 4, 0, &28, &87, &e0, 0, 0 db &25, &14, 0, &58, &37, 0, 0, 0 pic_tro_73_6E: db &11, &73, 0, &58, &3c, 0, 0, 0 db &16, &6e, 0, &58, &b7, &80, 0, 0 shi_pic_6D_0E: db &1c, &6d, 0, &58, &b7, &80, 0, 0 db &25, &0e, 0, &88, &6f, &40, 0, 0 pic_shi_07_06: db &25, 7, 0, &a8, &6f, &40, 0, 0 db &1c, 6, 0, &38, &97, &80, 0, 0 shields_06_01: db &1c, 6, 0, &78, &97, &80, 0, 0 db &1d, 1, 0, &a8, &67, &40, 0, 0 pic_shi_18_17: db &11, &18, 0, &28, &6f, &e1, 0, 0 db &1d, &17, 0, &a8, &67, &40, 0, 0 trophies_87_89: db &15, &87, 0, &38, &17, 0, 0, 0 db &16, &89, 0, &38, &b7, &80, 0, 0 trophies_87_89_2:db &16, &87, 0, &78, &17, 0, 0, 0 db &15, &89, 0, &78, &b7, &80, 0, 0 shi_pic_00_82: db &1d, 0, 0, 8, &47, &e0, 0, 0 db &16, &82, 0, &38, &b7, &80, 0, 0 trophies_00_82: db &16, 0, 0, 8, &87, &e0, 0, 0 db &15, &82, 0, &78, &b7, &80, 0, 0 pic_shi_66_61: db &11, &66, 0, &a0, &47, &61, 0, 0 db &1d, &61, 0, &a8, &6f, &60, 0, 0 tro_pic_66_5D: db &15, &66, 0, &a8, &87, &60, 0, 0 db &25, &5d, 0, &a8, &6f, &60, 0, 0 tro_shi_66_65: db &16, &66, 0, 8, &47, &e0, 0, 0 db &1d, &65, 0, &58, &b7, &80, 0, 0 shi_tro_66_64: db &1c, &66, 0, 8, &87, &e0, 0, 0 db &16, &64, 0, &58, &b7, &80, 0, 0 pic_tro_63_62: db &11, &63, 0, &58, &b7, &81, 0, 0 db &15, &62, 0, &50, &b7, &80, 0, 0 trophies_70_0D: db &16, &70, 0, &38, &b7, &80, 0, 0 db &15, &0d, 0, 8, &6f, &e0, 0, 0 shi_tro_70_0C: db &1d, &70, 0, &78, &b7, &80, 0, 0 db &16, &0c, 0, &58, &37, 0, 0, 0 trophies_09_7F: db &16, 9, 0, &a8, &47, &40, 0, 0 db &15, &7f, 0, 8, &60, &e0, 0, 0 pic_shi_09_7F: db &11, 9, 0, &a0, &87, &41, 0, 0 db &1d, &7f, 0, &58, &17, 0, 0, 0 tro_pic_5A_27: db &15, &5a, 0, 8, &47, &e0, 0, 0 db &25, &27, 0, &a8, &47, &60, 0, 0 tro_shi_5A_27: db &16, &5a, 0, 8, &87, &e0, 0, 0 db &1d, &27, 0, &a8, &87, &60, 0, 0 shi_tro_29_7E: db &1c, &29, 0, &a8, &47, &60, 0, 0 db &16, &7e, 0, &a8, &60, &60, 0, 0 pic_tro_29_7E: db &11, &29, 0, &a0, &87, &61, 0, 0 db &15, &7e, 0, &58, &b7, &80, 0, 0 clock_0D_13: db &10, &0d, &34, &30, &27, 1, 4, &56 db &10, &13, &34, &30, &b7, &81, 4, 6 clock_09_17: db &10, 9, &34, &30, &27, 1, 4, &56 db &10, &17, &34, &30, &b7, &81, 4, 6 clock_17_35: db &10, &35, &34, &88, &6f, &61, &b7, 3 db &10, &8f, &34, &18, &6f, &e1, 6, 3 clock_67_68: db &10, &67, &34, &98, &6f, &61, &b7, 3 db &10, &68, &34, 8, &6f, &e1, 6, 3 clock_8D_22: db &10, &8d, &34, &78, &4f, &61, &b7, 3 db &10, &22, &34, &28, &6f, &e1, 6, 3 clock_75_0A: db &10, &76, &34, &30, &27, 1, 4, &56 db &10, &75, &34, &30, &b7, &81, 4, 6 bookcase_0A_16: db &17, &0a, &34, &40, &47, 0, 4, &56 db &17, &16, &34, &40, &97, &80, 4, 6 bookcase_3D_49: db &17, &3d, &34, &48, &37, 0, 4, &56 db &17, &49, &34, &50, &af, &80, 4, 6 bookcase_69_6A: db &17, &69, &34, &40, &b7, &80, 4, 6 db &17, &6a, &34, &40, &27, 0, 4, &56 bookcase_6C_6E: db &17, &6c, &34, &40, &b7, &80, 4, 6 db &17, &6e, &34, &40, &27, 0, 4, &56 bookcase_3E_41: db &17, &3e, &34, &88, &77, &60, &b7, 3 db &17, &41, &34, &48, &a7, &80, 4, 6 barrel_45_53: db &1a, &45, &34, &50, &37, 0, 4, &56 db &1a, &53, &34, &50, &a4, &a0, 4, 6 barrel_4C_4E: db &1a, &4c, &34, &88, &6f, &40, &b7, 3 db &1a, &4e, &34, &18, &6f, &e0, 6, 3 barrel_4E_38: db &1a, &38, &34, &50, &37, 0, 4, &56 db &1a, &4b, &34, &50, &a7, &a0, 4, 6 barrel_6B_6D: db &1a, &6b, &34, &50, &b7, &a0, 4, 6 db &1a, &6d, &34, &50, &27, 0, 4, &56 barrel_8A_08: db &1a, &8a, &34, &98, &6f, &60, &b7, 3 db &1a, 8, &34, &28, &6f, &e1, 6, 3 acgexit_00_8E: db &24, 0, &c4, &98, &7f, &40, &ba, &d6 db &24, &8e, &c4, 0, &7f, &e0, 8, &d6 skeleton_53_8F: db &26, &53, 0, &80, &77, &61, 0, 0 db &26, &8f, 0, &80, &77, &61, 0, 0 skeleton_33_55: db &26, &33, 0, &18, &6f, &e1, 0, 0 db &26, &55, 0, &50, &a7, &81, 0, 0 room_table: dw room_00, room_01, room_02, room_03, room_04, room_05, room_06, room_07; 0 dw room_08, room_09, room_0A, room_0B, room_0C, room_0D, room_0E, room_0F; 8 dw room_10, room_11, room_12, room_13, room_14, room_15, room_16, room_17; &10 dw room_18, room_19, room_1A, room_1B, room_1C, room_1D, room_1E, room_1F; &18 dw room_20, room_21, room_22, room_23, room_24, room_25, room_26, room_27; &20 dw room_28, room_29, room_2A, room_2B, room_2C, room_2D, room_2E, room_2F; &28 dw room_30, room_31, room_32, room_33, room_34, room_35, room_36, room_37; &30 dw room_38, room_39, room_3A, room_3B, room_3C, room_3D, room_3E, room_3F; &38 dw room_40, room_41, room_42, room_43, room_44, room_45, room_46, room_47; &40 dw room_48, room_49, room_4A, room_4B, room_4C, room_4D, room_4E, room_4F; &48 dw room_50, room_51, room_52, room_53, room_54, room_55, room_56, room_57; &50 dw room_58, room_59, room_5A, room_5B, room_5C, room_5D, room_5E, room_5F; &58 dw room_60, room_61, room_62, room_63, room_64, room_65, room_66, room_67; &60 dw room_68, room_69, room_6A, room_6B, room_6C, room_6D, room_6E, room_6F; &68 dw room_70, room_71, room_72, room_73, room_74, room_75, room_76, room_77; &70 dw room_78, room_79, room_7A, room_7B, room_7C, room_7D, room_7E, room_7F; &78 dw room_80, room_81, room_82, room_83, room_84, room_85, room_86, room_87; &80 dw room_88, room_89, room_8A, room_8B, room_8C, room_8D, room_8E, room_8F; &88 dw room_90, room_91, room_92, room_93, room_94, room_none; &90 room_00: dw door_07_00 dw door_19_00 dw door_01_00_c dw acgexit_00_8E dw knight_00_06 dw knight_00_06_2 dw pic_shi_00_19 dw pic_tro_00_0B dw shields_00_19 dw trophies_00_0B dw shi_pic_00_82 dw trophies_00_82 dw 0 room_01: dw door_01_00_c dw door_02_01 dw knight_01_03 dw shields_06_01 dw 0 room_02: dw door_02_01 dw door_03_02 dw door_18_02 dw door_03_26 dw 0 room_03: dw door_03_02 dw door_04_03 dw door_6C_03_c dw trap_03_65 dw trap_21_03 dw knight_01_03 dw 0 room_04: dw door_04_03 dw door_19_04 dw door_05_04 dw pic_tro_04_15 dw tro_pic_04_14 dw 0 room_05: dw door_05_04 dw door_06_05 dw door_6E_05 dw knight_05_07 dw 0 room_06: dw door_06_05 dw door_1A_06_s dw door_08_06_g dw door_07_06 dw knight_00_06 dw knight_00_06_2 dw pic_shi_07_06 dw shields_06_01 dw 0 room_07: dw door_07_00 dw door_07_06 dw knight_05_07 dw pic_shi_07_06 dw 0 room_08: dw door_08_06_g dw door_09_08 dw shields_08_18 dw barrel_8A_08 dw 0 room_09: dw door_09_08 dw door_0A_09 dw trap_29_09 dw clock_09_17 dw knight_09_7F dw knight_09_7F_2 dw trophies_09_7F dw pic_shi_09_7F dw 0 room_0A: dw door_0A_09 dw door_0B_0A dw bookcase_0A_16 dw trophies_00_0B dw 0 room_0B: dw door_0B_0A dw door_0C_0B dw picture_0B_0C dw pic_tro_00_0B dw 0 room_0C: dw door_0C_0B dw door_0D_0C dw picture_0B_0C dw shi_tro_70_0C dw 0 room_0D: dw door_0D_0C dw door_0E_0D dw door_0D_6F_c dw clock_0D_13 dw table_0D_13 dw trophies_70_0D dw 0 room_0E: dw door_0E_0D dw door_0F_0E dw trophies_0E_12 dw trophies_6F_0E dw shi_pic_6D_0E dw 0 room_0F: dw door_0F_0E dw door_10_0F dw door_0F_6D_g dw shields_0F_11 dw 0 room_10: dw door_10_0F dw door_11_10_r dw trophies_10_73 dw 0 room_11: dw door_11_10_r dw door_12_11 dw door_11_6B dw shields_0F_11 dw 0 room_12: dw door_12_11 dw door_13_12 dw trophies_0E_12 dw 0 room_13: dw door_13_12 dw door_14_13 dw door_13_73 dw table_0D_13 dw clock_0D_13 dw knight_15_13 dw 0 room_14: dw door_14_13 dw door_15_14 dw shields_16_14 dw tro_pic_04_14 dw 0 room_15: dw door_15_14 dw door_16_15 dw trap_15_66 dw pic_tro_04_15 dw knight_17_15 dw knight_15_13 dw 0 room_16: dw door_16_15 dw door_17_16_r dw shields_16_14 dw bookcase_0A_16 dw 0 room_17: dw door_17_16_r dw door_18_17_g dw clock_09_17 dw pic_shi_18_17 dw knight_17_15 dw 0 room_18: dw door_18_17_g dw door_18_02 dw shields_08_18 dw table_18_88 dw table_18_6D dw pic_shi_18_17 dw 0 room_19: dw door_19_00 dw door_19_04 dw pic_shi_00_19 dw shields_00_19 dw 0 room_1A: dw door_1A_06_s dw door_1A_1B dw 0 room_1B: dw door_1A_1B dw door_1B_1C_s dw door_65_1B dw table_6A_1B dw 0 room_1C: dw door_1B_1C_s dw door_1C_1D dw 0 room_1D: dw door_1C_1D dw door_1D_43 dw 0 room_1E: dw door_1E_1F dw door_25_1E_c dw 0 room_1F: dw door_1E_1F dw door_1F_20 dw knight_1F_21 dw 0 room_20: dw door_1F_20 dw door_20_21 dw door_20_2F_y dw 0 room_21: dw door_20_21 dw door_21_22 dw door_21_88 dw trap_21_03 dw knight_1F_21 dw 0 room_22: dw door_21_22 dw door_22_23 dw clock_8D_22 dw 0 room_23: dw door_22_23 dw door_23_24 dw door_8A_23_g dw knight_25_23 dw 0 room_24: dw door_23_24 dw door_24_25 dw door_24_26_s dw knight_56_24 dw knight_56_24_2 dw 0 room_25: dw door_24_25 dw door_25_1E_c dw knight_25_23 dw 0 room_26: dw door_24_26_s dw door_03_26 dw 0 room_27: dw door_27_28 dw door_2E_27 dw door_27_2F_s dw knight_27_2B dw knight_27_2B_2 dw tro_pic_5A_27 dw tro_shi_5A_27 dw 0 room_28: dw door_27_28 dw door_28_29_c dw 0 room_29: dw door_28_29_c dw door_29_2A dw door_7E_29 dw trap_29_09 dw shi_tro_29_7E dw pic_tro_29_7E dw 0 room_2A: dw door_29_2A dw door_2A_2B dw table_2A_2D dw table_2A_2D_2 dw 0 room_2B: dw door_2A_2B dw door_2B_2C dw knight_27_2B dw knight_27_2B_2 dw 0 room_2C: dw door_2B_2C dw door_2C_2D dw 0 room_2D: dw door_2C_2D dw door_2D_2E_g dw door_2D_75 dw trap_2D_8D dw table_2A_2D dw table_2A_2D_2 dw 0 room_2E: dw door_2D_2E_g dw door_2E_27 dw table_2E_7D dw table_2E_7D_2 dw 0 room_2F: dw door_27_2F_s dw door_20_2F_y dw 0 room_30: dw door_30_31 dw door_54_30 dw door_30_74 dw 0 room_31: dw door_30_31 dw door_31_32 dw 0 room_32: dw door_31_32 dw door_32_33 dw 0 room_33: dw door_32_33 dw door_33_34 dw door_33_36 dw skeleton_33_55 dw 0 room_34: dw door_33_34 dw door_34_35 dw 0 room_35: dw door_34_35 dw door_72_35 dw clock_17_35 dw 0 room_36: dw door_33_36 dw door_36_37 dw 0 room_37: dw door_36_37 dw door_37_38 dw 0 room_38: dw door_37_38 dw door_38_39 dw door_38_3A_g dw barrel_4E_38 dw 0 room_39: dw door_38_39 dw door_39_3B dw 0 room_3A: dw door_38_3A_g dw door_3A_3B dw door_3A_94 dw 0 room_3B: dw door_39_3B dw door_3A_3B dw door_3B_3C_g dw door_3B_3D dw 0 room_3C: dw door_3B_3C_g dw door_3C_3E dw 0 room_3D: dw door_3B_3D dw door_3D_3E dw door_3D_3F_c dw bookcase_3D_49 dw barrels_91_3D dw 0 room_3E: dw door_3C_3E dw door_3D_3E dw bookcase_3E_41 dw 0 room_3F: dw door_3D_3F_c dw door_34_40 dw 0 room_40: dw door_34_40 dw door_40_41 dw door_40_42 dw door_40_8F dw 0 room_41: dw door_40_41 dw bookcase_3E_41 dw 0 room_42: dw door_40_42 dw door_42_43 dw 0 room_43: dw door_42_43 dw door_43_44 dw door_43_46 dw door_1D_43 dw 0 room_44: dw door_43_44 dw door_44_45_r dw 0 room_45: dw door_44_45_r dw barrel_45_53 dw 0 room_46: dw door_43_46 dw door_46_47 dw door_46_51 dw 0 room_47: dw door_46_47 dw door_47_48_r dw 0 room_48: dw door_47_48_r dw door_48_49 dw door_48_4A_c dw door_48_4D dw 0 room_49: dw door_48_49 dw bookcase_3D_49 dw 0 room_4A: dw door_48_4A_c dw door_4A_4B dw 0 room_4B: dw door_4A_4B dw door_4B_4C dw trap_61_4B dw barrel_4E_38 dw 0 room_4C: dw door_4B_4C dw door_4C_55 dw barrel_4C_4E dw 0 room_4D: dw door_48_4D dw door_4D_4E_r dw 0 room_4E: dw door_4D_4E_r dw door_4E_4F dw barrel_4C_4E dw 0 room_4F: dw door_4E_4F dw door_4F_50 dw 0 room_50: dw door_4F_50 dw door_50_51 dw door_50_52_g dw 0 room_51: dw door_50_51 dw door_46_51 dw 0 room_52: dw door_50_52_g dw door_52_53 dw 0 room_53: dw door_52_53 dw barrel_45_53 dw skeleton_53_8F dw 0 room_54: dw door_54_55 dw door_54_30 dw door_54_90 dw 0 room_55: dw door_4C_55 dw door_54_55 dw skeleton_33_55 dw 0 room_56: dw door_56_57 dw door_56_5A dw door_67_56_c dw door_69_56_y dw knight_56_24 dw knight_56_24_2 dw 0 room_57: dw door_56_57 dw door_57_58_g dw door_57_5B dw 0 room_58: dw door_57_58_g dw door_58_59 dw door_58_5C dw 0 room_59: dw door_58_59 dw door_59_5D_y dw door_68_59_r dw 0 room_5A: dw door_5A_5B dw door_56_5A dw door_5A_5E_c dw tro_pic_5A_27 dw tro_shi_5A_27 dw 0 room_5B: dw door_5A_5B dw door_5B_5C_r dw door_57_5B dw door_5B_5F_g dw door_66_5B_y dw table_5B_5C dw 0 room_5C: dw door_5B_5C_r dw door_5C_5D_g dw door_58_5C dw door_5C_60_r dw door_66_5C_y dw table_5B_5C dw 0 room_5D: dw door_5C_5D_g dw door_59_5D_y dw door_5D_61 dw table_63_5D dw tro_pic_66_5D dw 0 room_5E: dw door_5E_5F_r dw door_5A_5E_c dw door_5E_62 dw 0 room_5F: dw door_5E_5F_r dw door_5F_60_r dw door_5B_5F_g dw door_5F_63_c dw door_66_5F_y dw 0 room_60: dw door_5F_60_r dw door_60_61 dw door_5C_60_r dw door_60_64_c dw door_66_60_y dw 0 room_61: dw door_60_61 dw door_5D_61 dw door_61_65 dw trap_61_4B dw pic_shi_66_61 dw 0 room_62: dw door_62_63 dw door_5E_62 dw door_6A_62_g dw pic_tro_63_62 dw 0 room_63: dw door_62_63 dw door_63_64 dw door_5F_63_c dw table_63_5D dw pic_tro_63_62 dw 0 room_64: dw door_63_64 dw door_64_65_y dw door_60_64_c dw shi_tro_66_64 dw 0 room_65: dw door_64_65_y dw door_61_65 dw door_65_1B dw trap_03_65 dw tro_shi_66_65 dw 0 room_66: dw door_66_5B_y dw door_66_5C_y dw door_66_5F_y dw door_66_60_y dw trap_15_66 dw pic_shi_66_61 dw tro_pic_66_5D dw tro_shi_66_65 dw shi_tro_66_64 dw 0 room_67: dw door_67_56_c dw clock_67_68 dw 0 room_68: dw door_68_59_r dw clock_67_68 dw 0 room_69: dw door_69_56_y dw bookcase_69_6A dw 0 room_6A: dw door_6A_62_g dw bookcase_69_6A dw table_6A_1B dw 0 room_6B: dw door_11_6B dw door_6B_6C dw barrel_6B_6D dw 0 room_6C: dw door_6B_6C dw door_6C_03_c dw trap_8B_6C dw bookcase_6C_6E dw 0 room_6D: dw door_0F_6D_g dw door_6D_6E dw barrel_6B_6D dw shi_pic_6D_0E dw table_18_6D dw 0 room_6E: dw door_6D_6E dw door_6E_05 dw trap_8D_6E dw bookcase_6C_6E dw pic_tro_73_6E dw 0 room_6F: dw door_0D_6F_c dw door_6F_70 dw trophies_6F_0E dw 0 room_70: dw door_6F_70 dw door_70_71_s dw trophies_70_0D dw shi_tro_70_0C dw 0 room_71: dw door_70_71_s dw door_71_72_s dw 0 room_72: dw door_71_72_s dw door_72_35 dw 0 room_73: dw door_13_73 dw trap_73_74 dw trophies_10_73 dw pic_tro_73_6E dw 0 room_74: dw door_30_74 dw trap_73_74 dw 0 room_75: dw door_2D_75 dw door_75_76 dw clock_75_0A dw 0 room_76: dw door_75_76 dw door_76_77 dw door_7D_76 dw trap_76_84 dw clock_75_0A dw 0 room_77: dw door_76_77 dw door_77_78 dw 0 room_78: dw door_77_78 dw door_78_79 dw trap_78_8A dw 0 room_79: dw door_78_79 dw door_79_7A dw 0 room_7A: dw door_79_7A dw door_7A_7B dw door_7A_7E_r dw table_7A_81 dw knight_7C_7A dw knight_7C_7A_2 dw 0 room_7B: dw door_7A_7B dw door_7B_7C_y dw 0 room_7C: dw door_7B_7C_y dw door_7C_7D_y dw knight_7C_7A dw knight_7C_7A_2 dw 0 room_7D: dw door_7C_7D_y dw door_7D_76 dw table_2E_7D dw table_2E_7D_2 dw 0 room_7E: dw door_7A_7E_r dw door_7E_29 dw shi_tro_29_7E dw pic_tro_29_7E dw 0 room_7F: dw door_7F_80_g dw door_81_7F dw knight_09_7F dw knight_09_7F_2 dw 0 room_80: dw door_7F_80_g dw door_80_82 dw 0 room_81: dw door_82_81 dw door_81_7F dw table_7A_81 dw 0 room_82: dw door_80_82 dw door_82_81 dw door_82_87_c dw shi_pic_00_82 dw trophies_00_82 dw 0 room_83: dw door_83_84_r dw door_85_83 dw 0 room_84: dw door_83_84_r dw door_84_86 dw door_84_89_y dw trap_76_84 dw 0 room_85: dw door_86_85 dw door_85_83 dw 0 room_86: dw door_84_86 dw door_86_85 dw 0 room_87: dw door_82_87_c dw door_87_88 dw door_87_8B dw trophies_87_89 dw trophies_87_89_2 dw 0 room_88: dw door_21_88 dw door_87_88 dw table_18_88 dw knight_88_8A dw knight_88_8A_2 dw 0 room_89: dw door_84_89_y dw door_89_8D dw door_89_8A dw trophies_87_89 dw trophies_87_89_2 dw 0 room_8A: dw door_89_8A dw door_8A_23_g dw trap_78_8A dw barrel_8A_08 dw knight_88_8A dw knight_88_8A_2 dw 0 room_8B: dw door_87_8B dw door_8B_8C dw trap_8B_6C dw trophies_8B_8C dw 0 room_8C: dw door_8B_8C dw door_8C_8D_g dw shields_8D_8C dw trophies_8B_8C dw 0 room_8D: dw door_8C_8D_g dw door_89_8D dw trap_2D_8D dw trap_8D_6E dw shields_8D_8C dw clock_8D_22 dw 0 room_8E: dw acgexit_00_8E dw 0 room_8F: dw door_40_8F dw clock_17_35 dw skeleton_53_8F dw 0 room_90: dw door_54_90 dw door_90_91 dw 0 room_91: dw door_90_91 dw door_91_92 dw barrels_91_3D dw 0 room_92: dw door_91_92 dw door_92_93 dw 0 room_93: dw door_92_93 dw door_93_94 dw 0 room_94: dw door_93_94 dw door_3A_94 dw 0 room_none: dw 0 reset_menu: ld hl, menu_selection ld b, width_bytes - menu_selection loc_7C1E: ld (hl), 0 ; clear menu data inc hl djnz loc_7C1E ld hl, charset - 256 ld (charset_addr), hl main_menu: call clear_screen ; clear display, attributes, and set black border call draw_menu_icons ; draw menu icons for controls and player acharacters menu_loop: call draw_menu_text ld a, &f7 ; xxx54321 out (&fd), a in a, (&fe) cpl ; set bits now mean pressed keys ld e, a ld a, (menu_selection) bit 0, e ; 1 pressed? jr z, loc_7C43 ; jump if not and &f9 ; select Keyboard loc_7C43: bit 1, e ; 2 pressed? jr z, loc_7C4B ; jump if not and &f9 or 2 ; select Kempston joystick loc_7C4B: bit 2, e ; 3 pressed? jr z, loc_7C53 ; jump if not and &f9 or 4 ; select Cursor joystick loc_7C53: bit 3, e ; 4 pressed? jr z, loc_7C59 ; jump if not and &e7 ; select Knight loc_7C59: bit 4, e ; 5 pressed? jr z, loc_7C61 ; jump if not and &e7 or 8 ; select Wizard loc_7C61: ld d, a ld a, &ef ; xxx67890 out (&fd), a in a, (&fe) cpl ; set bits now mean pressed keys ld e, a ld a, d bit 4, e ; 6 pressed? jr z, loc_7C73 ; jump if not and &e7 or &10 ; select Serf loc_7C73: ld (menu_selection), a ld c, a bit 0, e ; 0 pressed? jp nz, start_game ; jump if so ld hl, menu_attrs ld b, 3 ld a, c call set_menu_attrs ; highlight keyboard/kempston/cursor ld b, 3 ld a, c rrca rrca call set_menu_attrs ; highlight knight/wizard/serf jp menu_loop ; set menu attrs to reflect current selection set_menu_attrs: rrca loc_7C91: and 3 jr z, loc_7C9C call set_flash_off loc_7C98: dec a djnz loc_7C91 ret loc_7C9C: call set_flash_on jr loc_7C98 set 7, (hl) ; flash on inc hl set_flash_off: res 7, (hl) ; clear flash attribute inc hl ret res 7, (hl) ; clear flash attribute inc hl set_flash_on: set 7, (hl) ; set flash attribute inc hl ret draw_menu_text: ld hl, charset - 256 ld (charset_addr), hl ld de, menu_attrs exx ld hl, menu_ycoords ld de, menu_options ; "1 KEYBOAR" ld b, 7 ; 7 lines loc_7CC1: exx ld a, (de) ; text attribute colour ld (text_attr), a inc de exx push bc ld a, (hl) ; next text character inc hl push hl ld h, a ld l, &58 ; x coord for text call print_text exx pop hl pop bc inc de djnz loc_7CC1 ld hl, &b800 ; copyright at 0,184 ld de, copyright_msg call colour_text ; show a line of text, first byte is attr ld hl, &20 ; header at 32,0 ld de, header_msg jp colour_text ; show a line of text, first byte is attr menu_attrs: db &45, &45, &45, &45, &45, &45, &47 menu_ycoords: db &10, &28, &40, &58, &70, &88, &a0 menu_options: db '1 KEYBOAR' db &c4 db '2 KEMPSTON JOYSTIC' db &cb db '3 CURSOR JOYSTIC' db &cb db '4 KNIGH' db &d4 db '5 WIZAR' db &c4 db '6 SER' db &c6 db '0 START GAM' db &c5 copyright_msg: db &47 db '%1983 A.C.G. ALL RIGHTS RESERVE' db &c4 header_msg: db &47 db 'ATICATAC GAME SELECTIO' db &ce print_text: push hl call xy_to_display ; convert coords in HL to display address in HL ld a, (text_attr) ex af, af' exx pop hl call xy_to_attr ; convert pixel coords in HL to attribute address jp loc_A1FF start_game: call clear_game_data ; clear 5E10-5FFF ld a, 3 ; 3 lives on startup ld (lives), a ld hl, food_items ld (food_ptr), hl call clear_screen ; clear display, attributes, and set black border call draw_side_panel ; draw side panel background scroll call draw_lives ; draw lives sprites in side panel call place_key_pieces ; set locations of ACG key pieces call set_key_positions ; set positions of red/green/cyan keys, and mummy call reset_game_state ; copy initial game state to working state area call randomise_doors ; randomise which doors can open/close call prepare_player ; prepare player to spawn jp enter_room main_loop: ld sp, menu_selection ei xor a loc_7DC8: ld (num_creatures), a ; number of creatures processed this frame ld ix, acg_key_1 ; first entity ld a, (game_flags) ; b0 set if room content drawn bit 0, a ; room content drawn? jr nz, loc_7DDC ; jump if so ld ix, linked_items ; pairs of linked items, including doors jr draw_room loc_7DDC: ld a, (sysvar_FRAMES) ld c, a ld a, (last_FRAMES) cp c ; same frame as last time? call nz, run_player ; call if not ld a, (player_room) cp (ix+1) ; entity in player room? ld hl, loop_return jp z, process_action ; jump if so loop_return: ld de, 8 ; entity size add ix, de ; next entity push ix pop hl ld de, creature1 ; end marker and a sbc hl, de ; end of list? jr c, loc_7DDC ; jump if not loc_7E03: ld a, (sysvar_FRAMES) ld c, a ld a, (last_FRAMES) cp c ; same frame as last time? call nz, run_player ; call if not ld hl, loop2_return jr process_action loop2_return: ld de, &10 ; 16 bytes per linked entity pair add ix, de ; next pair push ix pop hl ld de, linked_items ; pairs of linked items, including doors and a sbc hl, de jr c, loc_7E03 draw_room: ld a, (player_room) ld l, a ld h, 0 add hl, hl ; * 2 (bytes per entry) ld bc, room_table add hl, bc ld a, (hl) ; room data LSB inc hl ld h, (hl) ; room data MSB ld l, a ld (room_ptr), hl decor_loop: ld hl, (room_ptr) ld a, (hl) ; room item LSB inc hl inc hl ld (room_ptr), hl dec hl ld h, (hl) ; room item MSB ld l, a or h ; end of list? jr nz, loc_7E93 ; jump if not ld hl, (counter_low) inc hl ; advance game loop counter ld (counter_low), hl ld hl, game_flags ; b0 set if room content drawn bit 0, (hl) ; room drawn yet? jr nz, loc_7E55 ; jump if so call draw_entities ; draw all non-monster entities in the current room loc_7E55: ld hl, game_flags ; b0 set if room content drawn set 0, (hl) ; mark room as drawn ld hl, (rand8) ; another random number source ld de, (sysvar_FRAMES) add hl, de ; add in frames ld a, (counter_low) add a, l ; add in counter low ld l, a ld (rand8), hl ; only low 8 bits are meaningfully random call check_pickup_key ; check whether pick-up key has been pressed call check_pause ; check for pause key, return when not paused call replenish_food ; periodically replenish consumed food ld a, (player_room) cp &8e ; end room? jp z, game_complete ; congratulate player on completion jp main_loop process_action: push hl ; push return location run_handler: ld hl, handler_table lookup_graphic: ld c, (ix+0) lookup_c_hl: ld b, 0 sla c rl b ; * 2 (bytes per entry) add hl, bc ld a, (hl) ; LSB inc hl ld h, (hl) ; MSB ld l, a jp jp_hl loc_7E93: ld bc, decor_loop push bc ld bc, room_table and a sbc hl, bc push hl pop ix ld a, (player_room) cp (ix+1) ; in player room? jr z, loc_7EAD ; jump if so ld bc, 8 add ix, bc loc_7EAD: ld hl, handler_table2 jr lookup_graphic ; run player, weapon, and sound handlers run_player: di push ix ld a, 1 ld (in_handlers), a ; flag set but never read ld ix, player loc_7EBE: ld hl, handler_loop push hl jp run_handler handler_loop: ld de, 8 ; 8 bytes per entry add ix, de ; next entry push ix pop hl ld de, acg_key_1 ; end marker and a sbc hl, de ; end of list? jr c, loc_7EBE ; jump if not call clock_tick ; advance the clock 1 frame ld a, (sysvar_FRAMES) ld (last_FRAMES), a xor a ld (in_handlers), a ; flag set but never read pop ix ei ret handler_table: dw h_creat_delay, h_knight, h_knight, h_knight; 0 dw h_knight, h_knight, h_knight, h_knight; 4 ; extra delay applied to inactive creatures dw h_knight, h_knight, h_knight, h_knight; 8 dw h_knight, h_knight, h_knight, h_knight; &0c dw h_knight, h_wizard, h_wizard, h_wizard; &10 dw h_wizard, h_wizard, h_wizard, h_wizard; &14 dw h_wizard, h_wizard, h_wizard, h_wizard; &18 dw h_wizard, h_wizard, h_wizard, h_wizard; &1c dw h_wizard, h_serf, h_serf, h_serf; &20 dw h_serf, h_serf, h_serf, h_serf; &24 dw h_serf, h_serf, h_serf, h_serf; &28 dw h_serf, h_serf, h_serf, h_serf; &2c dw h_serf, h_blank, h_creat_delay, h_creat_delay; &30 dw h_fireball, h_fireball, h_fireball, h_fireball; &34 dw h_sword, h_sword, h_sword, h_sword; &38 dw h_sword, h_sword, h_sword, h_sword; &3c dw h_axe, h_axe, h_axe, h_axe; &40 dw h_axe, h_axe, h_axe, h_axe; &44 dw h_creat_delay, h_creat_delay, h_creat_delay, h_creat_delay; &48 dw h_pumpkin_spider, h_pumpkin_spider, h_ghostlet, h_ghostlet; &4c dw h_food, h_food, h_food, h_food; &50 dw h_food, h_food, h_food, h_food; &54 dw h_sparkles, h_sparkles, h_sparkles, h_sparkles; &58 dw h_pumpkin_spider, h_pumpkin_spider, h_spikey_ghost, h_spikey_ghost; &5c dw h_blob, h_blob, h_ghoul, h_ghoul; &60 dw h_sound_effect, h_sound_effect2, h_player_appear, h_death; &64 dw h_spikey_ghost, h_spikey_ghost, h_batlet, h_batlet; &68 dw h_pop, h_pop, h_pop, h_pop; &6c dw h_mummy, h_mummy, h_mummy, h_mummy; &70 dw h_frankenstein, h_frankenstein, h_frankenstein, h_frankenstein; &74 dw h_devil, h_devil, h_devil, h_devil; &78 dw h_dracula, h_dracula, h_dracula, h_dracula; &7c dw h_pickup_item, h_pickup_item, h_pickup_item, h_pickup_item; &80 dw h_pickup_item, h_pickup_item, h_pickup_item, h_pickup_item; &84 dw h_pickup_item, h_pickup_item, h_pickup_item, h_pickup_item; &88 dw h_pickup_item, h_pickup_item, h_pickup_item, h_tombstone; &8c dw h_witch, h_witch, h_witch, h_witch; &90 dw h_monk_bat, h_monk_bat, h_monk_bat, h_monk_bat; &94 dw h_monk_bat, h_monk_bat, h_monk_bat, h_monk_bat; &98 dw h_hunchback, h_hunchback, h_hunchback, h_hunchback; &9c dw h_food_eaten, h_mushroom ; &a0 handler_table2: dw h_creat_delay, h_door_exit, h_door_exit, h_big_door_exit; 0 dw h_creat_delay, h_creat_delay, h_creat_delay, h_creat_delay; 4 ; extra delay applied to inactive creatures dw h_door_locked, h_door_locked, h_door_locked, h_door_locked; 8 dw h_cave_locked, h_cave_locked, h_cave_locked, h_cave_locked; &0c dw h_clock, h_room_item, h_room_item, h_creat_delay; &10 dw h_creat_delay, h_room_item, h_room_item, h_bookcase; &14 dw h_trap_closed, h_trap_open, h_barrel, h_room_item; &18 dw h_room_item, h_room_item, h_room_item, h_creat_delay; &1c dw h_door_closed, h_door_open, h_door_closed, h_door_open; &20 dw h_acg_exit, h_room_item, h_room_item, h_room_item; &24 ; extra delay applied to inactive creatures h_creat_delay: push ix pop hl ld de, creature1 ; end marker and a sbc hl, de ; subtract from entity address ld a, h and a ; before creature 1? ret nz ; return if so ld a, l cp &30 ; after creature3 (16 bytes &0eac) ret nc ; return if so ld hl, &c0 ; delay to keep game speed stable delay_loop: dec hl ld a, h or l jr nz, delay_loop ret ; clear screen and attrs of play area clear_play_area: ld hl, display ld bc, &18c0 ; 24x192 xor a ; fill C rows of B columns of value A at address HL fill_bc_hl_a: push bc push hl ld de, &20 ; line stride is 32 bytes loc_809F: ld (hl), a inc hl djnz loc_809F pop hl add hl, de pop bc dec c jr nz, fill_bc_hl_a ; fill C rows of B columns of value A at address HL ret ; clear display, attributes, and set black border clear_screen: call clear_attrs ; clear attribute file call clear_display ; clear display file xor a out (&fe), a ; black border ret ; clear display file clear_display: ld hl, display ld b, &58 loc_80B9: ld c, 0 loc_80BB: ld (hl), c inc hl ld a, h cp b jr nz, loc_80BB ret ; clear attribute file clear_attrs: ld hl, attrs ld b, &5b ld c, 0 jr loc_80BB ; clear 5E10-5FFF clear_game_data: ld hl, width_bytes ld b, &60 ; clear up to address 6000 jr loc_80B9 ; wizard character handler h_wizard: ld bc, &2020 ; walk deceleration ld de, &2020 ; walk acceleration ld hl, &2020 ; unused call control_player ; read controls and apply player movement ld e, (ix+6) ; x velocity ld d, (ix+7) ; y velocity ld a, d or e ; is player moving? jr z, loc_811D ; jump if not ld a, (sysvar_FRAMES) and 3 ; 1/4 update rate jr nz, loc_811D ; jump if not time ld a, (ix+0) and 3 ; keep animation frame bits add a, &11 ; add base wizard graphic ld (ix+0), a ld a, d and a ; moving down? jp p, loc_8100 ; jump if so neg ; abs loc_8100: ld c, a ld a, e and a ; moving right? jp p, loc_8108 ; jump if so neg ; abs loc_8108: cp c ; moving more up/down than left/right? jr nc, loc_8128 ; jump if so ld a, d and a ; moving up? ld a, (ix+0) jp m, loc_8115 ; jump if so add a, 4 ; offset to down sprites loc_8115: add a, 8 ; offset to right sprites loc_8117: ld (ix+0), a ; set animation graphic call walk_sound ; play walk clicks if due loc_811D: call read_controls ; return controls in A (FUDLR order, negative logic) and &10 ; fire pressed? call z, wizard_fire ; call if so (fire weapon) jp loc_8E78 loc_8128: ld a, e and a ; moving left? ld a, (ix+0) jp m, loc_8117 ; jump if so add a, 4 ; offset to down sprites jr loc_8117 ; fire knight weapon knight_fire: ld a, (weapon) and a ; weapon active? ret nz ; return if so (only one allowed) ld a, (in_doorway) and a ; standing in doorway? ret nz ; return if so (can't fire) call axe_sound ; play axe throw sound call throw_weapon ; throw the current character's weapon ld hl, weapon ld (hl), &40 ; base axe graphic jr loc_8160 ; fire wizard weapon wizard_fire: ld a, (weapon) and a ; weapon active? ret nz ; return if so ld a, (in_doorway) and a ; standing in doorway? ret nz ; return if so (can't fire) call fireball_sound ; play fireball throw sound call throw_weapon ; throw the current character's weapon ld hl, weapon ld (hl), &34 ; base fireball graphic loc_8160: inc hl ld a, (ix+1) ; player room ld (hl), a ; set weapon room inc hl inc hl ld a, (ix+3) ; player xpos ld (hl), a ; set weapon xpos inc hl ld a, (ix+4) ; player ypos ld (hl), a ; set weapon ypos push ix ld ix, weapon call draw_entity ; draw entity graphic (no attrs) pop ix ret ; throw the current character's weapon throw_weapon: ld hl, weapon+6 ld a, &30 ld (sound+7), a ld a, 0 ld (weapon+2), a ld a, (ix+6) or (ix+7) jr z, loc_81B3 ld a, (ix+6) and a jr z, loc_81A0 jp m, loc_819E ld a, 4 jr loc_81A0 loc_819E: ld a, -4 loc_81A0: ld (hl), a inc hl ld a, (ix+7) and a jr z, loc_81B1 jp m, loc_81AF ld a, 4 jr loc_81B1 loc_81AF: ld a, -4 loc_81B1: ld (hl), a ret loc_81B3: ld a, (ix+0) dec a and &0c jr z, loc_81C9 cp 4 jr z, loc_81CF cp 8 jr nz, loc_81D5 ld (hl), 0 ; x velocity inc hl ld (hl), -4 ; y velocity (up) ret loc_81C9: ld (hl), -4 ; x velocity (left) inc hl ld (hl), 0 ; y velocity ret loc_81CF: ld (hl), 4 ; set x velocity (right) inc hl ld (hl), 0 ; set y velocity ret loc_81D5: ld (hl), 0 ; set x velocity (none) inc hl ld (hl), 4 ; set y velocity (down) ret ; axe animation handler h_axe: call save_entity ; save entity position for undraw ld a, (sysvar_FRAMES) cpl ; cycle backwards rra ; 1/2 animation rate and 7 ; 8 animation frames add a, &40 ; base axe graphic ld (ix+0), a ld (ix+5), &42 ; bright red jr weapon_handler ; fireball animation handler h_fireball: call save_entity ; save entity position for undraw ld a, (ix+0) inc a ; cycle &0eac processing loop and 3 ; 4 animation frames add a, &34 ; base fireball graphic ld (ix+0), a ld a, (sysvar_FRAMES) rla and 2 ; two possible colours add a, &45 ; bright cyan or white ld (ix+5), a weapon_handler: ld de, (room_width) ld a, (player_room) cp (ix+1) ; weapon in player room? jr nz, remove_entity ; jump if not (remove) dec (ix+&0f) ; existed too long? jr z, loc_826F ; jump if so (remove) bit 0, (ix+2) jr nz, loc_826F ld a, (ix+3) ; weapon xpos add a, (ix+6) ; add x velocity ld c, a sub &58 ; subtract room x centre jp p, loc_822E ; jump if in right half neg ; abs loc_822E: cp e ; hit screen edge? jr nc, loc_825D ; jump if so (bounce) loc_8231: ld a, (ix+4) ; weapon ypos add a, (ix+7) ; add y velocity ld b, a sub &68 ; subtract room y centre jp p, loc_823F ; jump if in bottom half neg ; abs loc_823F: cp d ; hit screen edge? jr nc, loc_824B ; jump if so (bounce) loc_8242: ld (ix+3), c ; set updated xpos ld (ix+4), b ; set updated ypos jp loc_8E8E loc_824B: ld b, (ix+4) ; weapon ypos ld a, (ix+7) ; y velocity neg ; invert (bounce) ld (ix+7), a push bc call bounce_sound ; weapon bounce sound pop bc jr loc_8242 loc_825D: ld c, (ix+3) ; weapon xpos ld a, (ix+6) ; x velocity neg ; invert (bounce) ld (ix+6), a push bc call bounce_sound ; weapon bounce sound pop bc jr loc_8231 loc_826F: call undraw_entity call weapon_pop ; weapon disappearing sound ld a, (room_attr) ld (ix+5), a call set_entity_attrs2 ; set attrs covering previous and new position remove_entity: ld (ix+0), 0 ; clear entity graphic ret ; fire serf weapon, if not active serf_fire: ld a, (weapon) and a ; weapon active? ret nz ; return if so ld a, (in_doorway) and a ; standing in doorway? ret nz ; return if so call sword_sound ; play sword throw sound call throw_weapon ; throw the current character's weapon ld c, 0 ld a, (hl) and a ; y velocity zero? jr z, loc_82B6 ; jump if so jp p, loc_829E ; jump if down ld c, 4 ; offset to up graphic loc_829E: dec hl ld a, (hl) and a ; x velocity zero? jr z, loc_82A7 ; jump if so jp p, loc_82B3 ; jump if right dec c ; up/left or down/left loc_82A7: ld a, c and 7 ; 8 possible directions add a, &38 ; base sword graphic ld hl, weapon ld (hl), a jp loc_8160 loc_82B3: inc c jr loc_82A7 loc_82B6: dec hl bit 7, (hl) jr z, loc_82BF ld c, 6 jr loc_82A7 loc_82BF: ld c, 2 jr loc_82A7 ; set sword direction to match player direction set_sword_dir: ld c, 0 ; down ld a, (hl) and a jr z, loc_82E4 jp p, loc_82CE ld c, 4 ; up loc_82CE: dec hl ld a, (hl) and a jr z, loc_82D7 jp p, loc_82E1 dec c ; up-left or down-left loc_82D7: ld a, c and 7 ; 8 positions add a, &38 ; base sword graphic ld hl, weapon ld (hl), a ret loc_82E1: inc c ; up-right or down-right jr loc_82D7 loc_82E4: dec hl bit 7, (hl) jr z, loc_82ED ld c, 6 ; facing left jr loc_82D7 loc_82ED: ld c, 2 ; facing right jr loc_82D7 ; sword animation handler h_sword: call save_entity ; save entity position for undraw ld (ix+5), &46 ; bright yellow ld hl, weapon+7 call set_sword_dir ; set sword direction to match player direction jp weapon_handler ; small bat handler h_batlet: ld a, (player_room) cp (ix+1) jp nz, delay_remove call save_entity ; save entity position for undraw ld hl, num_creatures ; number of creatures processed this frame inc (hl) call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; touching player? jp z, hurt_and_pop ; jump if so call chk_weapon_hit ; check if weapon has hit entity dec e ; hit by weapon? jp z, pop_creature ; jump if so ld (ix+&0f), 0 ; live for 256 frames in different room ld de, (room_width) ld a, (ix+9) ; movement counter inc a and &0f ; 16-frames between movement changes ld (ix+9), a jp nz, loc_833A ; jump if no change ld a, r and 7 ; 3-bit random behaviour ld (ix+8), a loc_833A: call get_rnd_velocity ; random velocity used for batlet ld (ix+5), &43 ; bright magenta jr nz, loc_8344 ; jump if using first (decreasing) entry inc hl ; advance to second (increasing) entry loc_8344: ld a, (hl) ; get velocity from table bit 1, (ix+8) ; random direction down? jr nz, loc_834D ; jump if so neg ; invert to go up loc_834D: add a, (ix+4) ; add velocity to ypos ld c, a sub &68 ; subtract room y centre jr c, loc_835A ; jump if in top screen half cp d jr nc, loc_83A2 jr loc_835F loc_835A: neg ; abs cp d ; within screen height? jr nc, loc_83A8 ; jump if not loc_835F: ld (ix+4), c ; update ypos loc_8362: call get_rnd_velocity ; random velocity used for batlet jr z, loc_8368 ; jump if using first (decreasing) entry inc hl ; advance to second (increasing) entry loc_8368: ld a, (hl) ; get velocity from table bit 0, (ix+8) ; random direction right? jr nz, loc_8371 ; jump if so neg ; invert to go left loc_8371: add a, (ix+3) ; add velocity to xpos ld c, a sub &58 ; subtract room x centre jr c, loc_837E ; jump if in left half cp e ; within room width? jr nc, loc_83B4 ; jump if not jr loc_8383 loc_837E: neg ; abs cp e ; within room width? jr nc, loc_83AE ; jump if not loc_8383: ld (ix+3), c ; update xpos ld a, (ix+9) rra rra ; 1/4 animation rate and 1 ; 2 animation frames ld c, a ld a, (ix+0) and &fe ; strip animation bit add a, c ld (ix+0), a ; set animation graphic ld a, (player) cp &31 ; player active? jp nc, pop_creature ; jump if not jp loc_8E8E loc_83A2: res 1, (ix+8) ; move left away from room bounds jr loc_8362 loc_83A8: set 1, (ix+8) ; move right away from room bounds jr loc_8362 loc_83AE: set 0, (ix+8) ; move down away from room bounds jr loc_8383 loc_83B4: res 0, (ix+8) ; move up away from room bounds jr loc_8383 ; random velocity used for batlet get_rnd_velocity: ld c, (ix+9) ; movement counter sla c ; * 2 bytes per entry ld b, 0 ld hl, rnd_velocities ; random velocities (0-3) add hl, bc bit 2, (ix+8) ; decide on using first or second entry ret rnd_velocities: db 3, 0 db 3, 0 ; random velocities (0-3) db 3, 1 db 3, 1 db 3, 1 db 2, 2 db 2, 2 db 2, 2 db 2, 2 db 2, 2 db 2, 2 db 1, 3 db 1, 3 db 1, 3 db 0, 3 db 0, 3 ; check whether to add new room creatures chk_creatures: ld a, (last_creat_room) ; last room creature created in ld c, a ld a, (player_room) cp c ; player in different room? jr nz, loc_844F ; jump if so ld hl, creature_delay ld a, (hl) and a ; time to appear? jr z, loc_8458 ; jump if so dec (hl) ; reduce delay timer ret nz ; return if not yet time add_creature: ld hl, creature1 ; first creature slot ld de, &10 ; 16 bytes per creature ld b, 3 ; 3 room creatures loc_8405: ld a, (hl) and a ; free slot? jr z, loc_840D ; jump if so add hl, de djnz loc_8405 ret ; no free slots loc_840D: ex de, hl ld hl, creature_default ; default entity data for creature ld bc, &10 ; 16 bytes of entity data push de ldir ; copy template pop hl push hl inc hl ld a, (player_room) ld (hl), a inc hl push hl ld hl, creatures ; creature table ld a, (sysvar_FRAMES) and &0f ; 16 creatures entries to choose from ld e, a ld d, 0 add hl, de ld a, (hl) ; new creature graphic pop hl ld (hl), a ; set graphic ld de, (room_width) ld b, e call rnd_coord ; random coord less than interior size B ld (hl), a ; set x ld b, d call rnd_coord ; random coord less than interior size B ld (hl), a ; set y pop de push ix ld ix, 0 add ix, de call rnd_movement ; set random movement call draw_entity ; draw entity graphic (no attrs) pop ix ret loc_844F: ld (last_creat_room), a ld a, &20 ; delay 32 frames before next creature ld (creature_delay), a ret loc_8458: ld a, r and &0f ; 1/16 chance of appearing ret nz ; return if not jr add_creature ; add creature ; pumpkin and spider handler h_pumpkin_spider: call save_entity ; save entity position for undraw ld a, (player_room) cp (ix+1) ; in player room? jp nz, delay_remove ; jump if not ld hl, num_creatures ; number of creatures processed this frame inc (hl) call chk_weapon_hit ; check if weapon has hit entity dec e ; hit by weapon? jp z, pop_creature ; jump if so call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; touching player? jp z, hurt_and_pop ; jump if so ld de, (room_width) ld (ix+&0f), 0 ; live for 256 frames in different room ld (ix+5), &46 ; bright yellow ld a, (ix+7) and &0f ; 4-bit animation counter 0? jr nz, loc_8497 ; jump if not ld a, r and 3 ; 2-bit random x and y direction ld (ix+6), a ; set directions loc_8497: bit 0, (ix+7) ; unchanged movement this frame? jr nz, loc_84BF ; jump if so bit 0, (ix+6) ; move left? jp z, loc_854A ; jump if so ld a, (ix+8) cp 2 ; at right speed limit? jr z, loc_84AE ; jump if so inc (ix+8) ; faster right loc_84AE: bit 1, (ix+6) ; move up? jp z, loc_8558 ; jump if so ld a, (ix+9) cp 2 ; at down speed limit? jr z, loc_84BF ; jump if so inc (ix+9) ; faster down loc_84BF: inc (ix+7) ; increase animation counter ld a, (ix+7) and 1 ; 2 animation frames xor (ix+0) ; combine, for 1/2 animation rate ld (ix+0), a ; set animation graphic monster_move: ld a, (ix+3) ; xpos add a, (ix+8) ; add x velocity ld c, a ; save new xpos sub &58 ; subtract room centre x jr c, loc_84E8 ; jump if negative (left half) cp e ; within room width? jr c, loc_84F8 ; jump if so res 0, (ix+6) ; set direction to left ld (ix+8), -2 ; bounce left away from wall ld c, (ix+3) ; current xpos jr loc_84F8 loc_84E8: neg ; abs cp e ; within room width? jr c, loc_84F8 ; jump if so set 0, (ix+6) ; set direction to right ld c, (ix+3) ; current xpos ld (ix+8), 2 ; bounce right away from wall loc_84F8: ld a, (ix+4) ; ypos add a, (ix+9) ; add y velocity ld b, a ; save new ypos sub &68 ; subtract room centre y jr c, loc_8513 ; jump if negative (top half) cp d ; within screen height? jr c, loc_8523 ; jump if so res 1, (ix+6) ; set direction to up ld (ix+9), -2 ; bounce up away from wall ld b, (ix+4) ; current ypos jr loc_8523 loc_8513: neg ; abs cp d ; within screen height? jr c, loc_8523 ; jump if so set 1, (ix+6) ; set direction to down ld b, (ix+4) ld (ix+9), 2 ; bounce down away from wall loc_8523: ld (ix+3), c ; set new xpos ld (ix+4), b ; set new ypos ld a, (player_room) cp (ix+1) ; in player room? ret nz ; return if not ld a, (ix+0) ; entity graphic and &fc ; strip 2 animation bits cp &9c ; is it hunchback? jr z, keep_special ; jump if so and &f0 cp &70 ; is it mummy/frankenstein/devil/dracula? jr z, keep_special ; jump if so ld a, (player) cp &31 ; is player active? jp nc, pop_creature ; jump if not (pop non-special creature types) keep_special: jp loc_8E8E loc_854A: ld a, (ix+8) cp -2 ; at left speed limit? jp z, loc_84AE ; jump if so dec (ix+8) ; faster left jp loc_84AE loc_8558: ld a, (ix+9) cp -2 ; at up speed limit? jp z, loc_84BF ; jump if so dec (ix+9) ; faster up jp loc_84BF ; check if weapon has hit entity chk_weapon_hit: ld a, (weapon+1) ; weapon room ld e, 0 ; no weapon hit detected cp (ix+1) ; in entity room? ret nz ; return if not ld a, (weapon) and a ; is weapon active? ret z ; return if not ld a, (weapon+3) ; weapon xpos sub (ix+3) ; subtract entity x jp p, loc_857F ; jump if postive neg ; abs loc_857F: cp &0c ; within weapon x size? ret nc ; return if not ld a, (weapon+4) ; weapon ypos sub (ix+4) ; subtract entity y jp p, loc_858D ; jump if positive neg ; abs loc_858D: cp &0c ; within weapon y size? ret nc ; return if not ld a, 1 ; 1 frame before removal ld (weapon+2), a ; set weapon frames left ld e, 1 ; weapon hit detected ret ; random coord less than interior size B rnd_coord: ld a, b sub 8 ld b, a ld a, r inc hl loc_859F: cp b jr c, loc_85A5 sub b jr loc_859F loc_85A5: ld c, a ld a, r bit 1, a ld a, &60 jr z, loc_85B0 add a, c ret loc_85B0: sub c ret ; check if enemy is touching player (returns E=1) enemy_touching: ld a, (player_room) ld e, 0 ; is not touching player cp (ix+1) ; in player room? ret nz ; return if not ld a, (player) and a ; does player exist? ret z ; return if not cp &31 ; active player? ret nc ; return if not ld a, (player_x) sub (ix+3) ; right of player? jp p, loc_85CE ; jump if not neg ; abs loc_85CE: cp &0c ; too far from player? ret nc ; return if so ld a, (player_y) sub (ix+4) ; below player? jp p, loc_85DC ; jump if not neg ; abs loc_85DC: cp &0c ; too far from player? ret nc ; return if so ld a, 1 ld (player_contact), a call touching_sound ; play monster touched sound ld e, 1 ; is touching player ret hurt_and_pop: call damage_32 ; reduce health by 32 jp pop_creature delay_remove: dec (ix+&0f) ; auto-remove timer for monsters ret nz ; return if still alive jp remove_entity ; monster appearance sparkle handler h_sparkles: call save_entity ; save entity position for undraw ld a, (player_room) cp (ix+1) ; in player room? jp nz, delay_remove ; jump if not ld hl, num_creatures ; number of creatures processed this frame inc (hl) dec (ix+&0e) ; sparkled long enough? jr z, to_creature ; jump if so ld a, (ix+&0e) and 3 ; 4 animation frames add a, &58 ; base sparkle graphic ld (ix+0), a ld (ix+&0f), &80 ; live for 128 frames outside player room ld a, (player) cp &31 ; player active? jp nc, pop_creature ; jump if not jp loc_8E8E to_creature: ld a, (ix+2) ; creature graphic ld (ix+0), a ; convert sparkle to creature jp loc_8E8E ; small ghost handler h_ghostlet: call save_entity ; save entity position for undraw ld a, (player_room) cp (ix+1) ; in player room? jp nz, delay_remove ; jump if not ld hl, num_creatures ; number of creatures processed this frame inc (hl) call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; touching player? jp z, hurt_and_pop ; jump if so call chk_weapon_hit ; check if weapon has hit entity dec e ; hit by weapon? jp z, pop_creature ; jump if so ld (ix+5), &45 ; bright cyan inc (ix+7) ; increment movement counter call z, rnd_movement ; change movement every 256 frames ld a, (ix+7) rra rra ; 1/4 animation rate and 1 ; 2 animation frames ld c, a ld a, (ix+0) and &fe ; strip animation bit add a, c ld (ix+0), a ; set animation graphic ld de, (room_width) ld (ix+&0f), 0 ; live for 256 frames in different room jp monster_move ; common monster movement ; spikey ghost handler h_spikey_ghost: call save_entity ; save entity position for undraw ld a, (player_room) cp (ix+1) ; in player room? jp nz, delay_remove ; jump if not ld hl, num_creatures ; number of creatures processed this frame inc (hl) ld (ix+&0f), 0 ; live for 256 frames in different room call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; touching player? jp z, hurt_and_pop ; jump if so call chk_weapon_hit ; check if weapon has hit entity dec e ; hit by weapon? jp z, pop_creature ; jump if so ld a, (ix+&0a) ; vertical velocity rra ; 1/2 animation rate and 1 ; 2 animation frames ld c, a ld a, (ix+0) and &fe ; strip animation bit add a, c ld (ix+0), a ; set graphic ld de, (room_width) inc (ix+&0a) ; bounce speed ld a, (ix+&0a) cp 7 ; max bounce speed? jr nz, loc_86B9 ; jump if not call rnd_movement ; random vertical offset ld (ix+&0a), -7 ; bounce back up loc_86B9: sra a ; 1/2 bounce speed add a, (ix+4) ; add to y position ld c, a ; save result sub &68 ; subtract vertical centre jp p, loc_86E1 ; jump if positive (lower screen half) neg ; abs cp d ; out of screen top? jr c, loc_86DB ; jump if not ld (ix+9), 2 ; kick down away from wall set 1, (ix+6) bit 7, (ix+&0a) jr z, loc_86DB ld (ix+&0a), 0 loc_86DB: ld (ix+4), c ; set y position jp monster_move ; common monster movement loc_86E1: cp d ; out of screen bottom? jr c, loc_86DB ; jump if not res 1, (ix+6) ld (ix+9), -2 ; kick up away from wall ld (ix+&0a), -7 ; bounce back up at -7 pixels/frame jr loc_86DB ; set random movement rnd_movement: ld a, r bit 0, a ; use x speed of 1? jr z, rnd_move_y1 ; jump if so and 4 sub 2 ; y velocity is +/- 2 loc_86FC: ld (ix+9), a ; set y something? ld a, r rra bit 0, a ; use y speed of 1? jr z, rnd_move_x1 ; jump if so and 4 sub 2 ; x velocity is +/- 2 loc_870A: ld (ix+8), a ; set x something? ret rnd_move_y1: and 2 sub 1 ; y velocity is +/- 1 jr loc_86FC rnd_move_x1: and 2 sub 1 ; x velocity is +/- 1 jr loc_870A h_blob: call save_entity ; save entity position for undraw ld a, (player_room) cp (ix+1) jp nz, delay_remove ld hl, num_creatures ; number of creatures processed this frame inc (hl) ld (ix+&0f), 0 ; live for 256 frames in different room call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; touching player? jp z, hurt_and_pop ; jump if so call chk_weapon_hit ; check if weapon has hit entity dec e ; hit by weapon? jp z, pop_creature ; jump if so ld de, (room_width) dec (ix+&0d) jr nz, loc_874C ld (ix+&0d), &11 call rnd_movement ; set random movement loc_874C: ld a, (ix+&0d) rra and 1 ; 2 animation frames ld c, a ld a, (ix+0) and &fe ; clear b0 add a, c ld (ix+0), a jp monster_move ; common monster movement pop_creature: ld a, (ix+5) ; save creature attr push af ld a, (room_attr) ld (ix+5), a ; undraw to room attr call undraw_entity call set_entity_attrs2 ; set attrs covering previous and new position pop af ld (ix+5), a ld (ix+0), &6c ; base pop graphic ld (ix+&0e), &10 ; 16 animation frames (4 loops of 4) ld bc, &0155 call add_score_bc_bcd ; add 155 score call draw_entity ; draw entity graphic (no attrs) jp set_entity_attrs2 ; set attrs covering previous and new position ; creature death pop animation handler h_pop: call save_entity ; save entity position for undraw ld a, (player_room) cp (ix+1) ; in player room? jp nz, delay_remove ; jump if not dec (ix+&0e) ; final animation frame? jp z, loc_826F ; jump if so ld a, (ix+&0e) and 3 ; 4 animation frames add a, &6c ; base pop graphic ld (ix+0), a ; set animation graphic jp loc_8E8E ; Ghoul handler h_ghoul: call save_entity ; save entity position for undraw ld a, (player_room) cp (ix+1) ; in player room? jp nz, delay_remove ; jump if not ld hl, num_creatures ; number of creatures processed this frame inc (hl) call chk_weapon_hit ; check if weapon has hit entity dec e ; hit by weapon? jp z, pop_creature ; jump if so call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; touching player? jp z, hurt_and_pop ; jump if so ld de, (room_width) ld (ix+&0f), 0 ; live for 256 frames in different room ld (ix+5), &46 ; bright yellow ld a, (ix+7) and 7 ; 3-bit animation counter 0? jr nz, loc_87DE ; jump if not ld a, r and 3 ; 2-bit random direction ld (ix+6), a ; set directions loc_87DE: bit 0, (ix+7) ; alternating behaviour &0eac frame jr nz, loc_8804 ; jump if odd frame (continue movement) bit 0, (ix+6) ; moving left? jr z, loc_8815 ; jump if so ld a, (ix+8) cp 2 ; at right speed limit? jr z, loc_87F4 ; jump if so inc (ix+8) ; faster right loc_87F4: bit 1, (ix+6) ; moving up? jr z, loc_8821 ; jump if so ld a, (ix+9) cp 2 ; at down speed limit? jr z, loc_8804 ; jump if so inc (ix+9) ; faster down loc_8804: inc (ix+7) ; increase animation counter ld a, (ix+7) and 1 ; 2 animation frames xor (ix+0) ; gives 1/2 animation rate ld (ix+0), a jp monster_move ; common monster movement loc_8815: ld a, (ix+8) cp -2 ; at left speed limit? jr z, loc_87F4 ; jump if so dec (ix+8) ; faster left jr loc_87F4 loc_8821: ld a, (ix+9) cp -2 ; at up speed limit? jr z, loc_8804 ; jump if so dec (ix+9) ; faster up jr loc_8804 ; set movement towards coords in DE attract_de: ld c, 0 ld a, d cp (ix+4) ; ypos match? jr z, loc_8848 ; jump if so jr nc, loc_8850 ; jump if greater (move down) ld (ix+9), -1 ; move up loc_883B: ld a, e cp (ix+3) ; same xpos? jr z, loc_8856 ; jump if so jr nc, loc_885D ; jump if greater (move right) ld (ix+8), -1 ; move left ret loc_8848: ld (ix+9), 0 ; no y movement set 0, c ; flag same ypos jr loc_883B loc_8850: ld (ix+9), 1 ; move down jr loc_883B loc_8856: ld (ix+8), 0 ; no x movement set 1, c ; flag same xpos ret loc_885D: ld (ix+8), 1 ; move right ret ; Mummy handler h_mummy: call save_entity ; save entity position for undraw call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; touching player? call z, damage_8 ; call if so (reduce health by 8) ld hl, leaf ld a, (hl) and a ; does leaf exist? jr z, loc_8881 ; jump if not inc hl ld a, (hl) cp (ix+1) ; is leaf in mummy room? jr nz, loc_8881 ; jump if not inc hl inc hl ld e, (hl) ; leaf x inc hl ld d, (hl) ; leaf y jr loc_88D7 ; leaf attracts mummy loc_8881: bit 7, (ix+6) ; is mummy angry with player? jr nz, loc_88FD ; jump if so ld hl, red_key ld a, (hl) and a ; does red key exist? jr z, loc_88F9 ; jump if not inc hl ld a, (hl) cp (ix+1) ; is red key in mummy room? jr nz, loc_88F9 ; jump if not ld d, (ix+&0c) ; current target x ld e, (ix+&0b) ; current target y call attract_de ; set movement towards coords in DE ld a, c cp 3 ; reached target x+y position? jr z, loc_88B5 ; jump if so loc_88A3: ld a, (counter_low) rra rra and 3 ; 4 animation frames add a, &70 ; base mummy graphic ld (ix+0), a ; set animation graphic ld de, &3838 ; allowed to roam 56x56 from room centre jp chk_move_away loc_88B5: bit 6, (ix+6) ; moving up/left? jr z, loc_88C9 ; jump if so ld (ix+&0b), &8c ; new target x ld (ix+&0c), &68 ; new target y (below red key) res 6, (ix+6) ; move up-left jr loc_88A3 loc_88C9: ld (ix+&0b), &68 ; new target x (left of red key) ld (ix+&0c), &38 ; new target y set 6, (ix+6) ; move down-right jr loc_88A3 loc_88D7: call attract_de ; set movement towards coords in DE ld a, c cp 3 ; has mummy reached leaf position? jr nz, loc_88A3 ; jump if not push ix ld ix, leaf ld a, (player_room) cp (ix+1) ; if leaf in player room? jr nz, loc_88F0 call draw_entity ; undraw leaf loc_88F0: pop ix ld a, &6b ; room 6B ld (leaf+1), a ; move leaf to room 6B jr loc_88B5 loc_88F9: set 7, (ix+6) ; mummy now angry with player loc_88FD: ld de, (player_x) call attract_de ; set movement towards coords in DE jr loc_88A3 ; Dracula handler h_dracula: call save_entity ; save entity position for undraw call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; is touching player? call z, damage_8 ; call if so (reduce health by 8) ld de, &468a ; yellow crucafix object call check_carrying ; is player carrying crucafix? jr nz, loc_8931 ; jump if not ld de, (player_x) ; current player position call attract_de ; set movement towards coords in DE ld a, (ix+8) ; x velocity neg ; invert (run away!) ld (ix+8), a ld a, (ix+9) ; y velocity neg ; invert (run away!) ld (ix+9), a jr loc_8940 loc_8931: ld a, (player_room) cp (ix+1) ; is Dracula in the player room? jr nz, loc_8952 ; jump if not ld de, (player_x) call attract_de ; set movement towards coords in DE loc_8940: ld a, (counter_low) rra rra ; 1/4 animation rate and 3 ; 4 animation frames add a, &7c ; base Dracula graphic ld (ix+0), a ; set animation graphic ld de, &3434 ; allowed to roam 52x52 from room centre jp chk_move_away loc_8952: ld (ix+&0b), &68 ; new target x (centre) ld (ix+&0c), &68 ; new target y (centre) call attract_de ; set movement towards coords in DE ld a, (sysvar_FRAMES) and a ; frame 0 of 50? jp nz, loc_8940 ; jump if not ld a, r and &7f ; random 7-bit room number ld c, a call get_room_style ; get style of room in A, returns style (0-B) cp 3 ; non-square room? jp nc, loc_8940 ; jump if so (ignore) ld a, (player_room) cp c ; current player room? jp z, loc_8940 ; jump if so (ignore) ld (ix+1), c ; move Dracula to new room jr loc_8940 ; get style of room in A, returns style (0-B) get_room_style: ld l, a ld h, 0 ld de, room_attrs ; room attr colour and style (0-B) add hl, hl add hl, de inc hl ld a, (hl) ; first byte is room style (0-C) ret ; Frankenstein handler h_frankenstein: call save_entity ; save entity position for undraw call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; touching player? jr nz, loc_89A5 ; jump if not ld de, &458b ; cyan spanner call check_carrying ; carrying spanner? jr nz, loc_89A2 ; jump if not ld bc, &1000 call add_score_bc_bcd ; add 1000 points jp pop_creature loc_89A2: call damage_8 ; reduce health by 8 loc_89A5: ld de, (player_x) call attract_de ; set movement towards coords in DE ld a, (counter_low) rra rra and 3 add a, &74 ; base frankenstein graphic ld (ix+0), a ld de, &3434 ; 52x52 centre prison area if player is dead chk_move_away: ld a, (player) cp &31 ; is player active? jp c, monster_move ; jump if so ld de, (player_x) call attract_de ; set movement towards coords in DE ld a, (ix+8) ; x movement neg ; away from player ld (ix+8), a ld c, a ld a, (ix+9) ; y movement neg ; away from player ld (ix+9), a ld de, &3434 ; allowed to roam 52x52 from room centre and c ; should be OR C maybe? (either movement) jp nz, monster_move ; common monster movement ld (ix+8), 1 ; move right ld (ix+9), 1 ; move up jp monster_move ; common monster movement ; Devil handler h_devil: call save_entity ; save entity position for undraw call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; touching player? call z, damage_8 ; call if so (reduce health by 8) ld de, (player_x) call attract_de ; set movement towards coords in DE ld a, (ix+0) and &fc ; strip animation frame bits ld c, a ld a, (counter_low) rra rra ; 1/4 animation rate and 3 ; 4 animation frames add a, c ld (ix+0), a ; set animation graphic ld de, &3434 ; allowed to roam 52x52 from room centre jp chk_move_away ; reduce health by 16 ; damage_16: ld a, (player_energy) sub &10 jr c, player_dead_pop jr loc_8A25 ; reduce health by 8 damage_8: ld a, (player_energy) sub 8 jr c, player_dead_pop loc_8A25: ld (player_energy), a jp draw_chicken ; draw chicken energy bar player_dead_pop: pop hl ; don't return to entity handler jp player_dead ; witch handler h_witch: call save_entity ; save entity position for undraw ld a, (player_room) cp (ix+1) ; in player room? jp nz, delay_remove ; jump if not ld hl, num_creatures ; number of creatures processed this frame inc (hl) call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; touching player? jp z, hurt_and_pop ; jump if so call chk_weapon_hit ; check if weapon has hit entity dec e ; hit by weapon? jp z, pop_creature ; jump if so dec (ix+&0d) ; movement timer expired? jr nz, loc_8A5D ; jump if not call rnd_movement ; set random movement sra (ix+9) ; halve y velocity (to 1 or 0) ld (ix+&0d), &10 ; 16 frames before changing movement loc_8A5D: ld a, (ix+0) and &fc ; strip animation bits bit 7, (ix+8) ; moving left? jr nz, loc_8A6A ; jump if so add a, 2 ; offset to right-facing graphics loc_8A6A: ld c, a ld a, (ix+&0d) rra ; 1/2 animation rate and 1 ; 2 animation frames add a, c ld (ix+0), a ; set animation graphic ld de, (room_width) ld (ix+5), &43 ; bright magenta jp monster_move ; common monster movement ; monk and large bat handler h_monk_bat: call save_entity ; save entity position for undraw ld a, (player_room) cp (ix+1) ; in player room? jp nz, delay_remove ; jump if not ld hl, num_creatures ; number of creatures processed this frame inc (hl) call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; touching player? jp z, hurt_and_pop ; jump if so call chk_weapon_hit ; check if weapon has hit entity dec e ; hit by weapon? jp z, pop_creature ; jump if so (pop) dec (ix+&0d) ; movement timer expired? jr nz, loc_8AB8 ; jump if not call rnd_movement ; set random movement ld a, (sysvar_FRAMES) and 4 sub 2 ; +/- 2 ld (ix+8), a ; set x velocity sra (ix+9) ; halve y velocity (to 1 or 0) ld (ix+&0d), &20 ; 32 frames before changing behaviour loc_8AB8: ld a, (ix+0) and &fc ; strip animation bits bit 7, (ix+8) ; moving left? jr nz, loc_8AC5 ; jump if so add a, 2 ; offset to right-facing graphics loc_8AC5: ld c, a ld a, (ix+&0d) rra ; 1/2 animation rate and 1 ; 2 animation frames add a, c ld (ix+0), a ; set animation graphic ld de, (room_width) ld (ix+5), &42 ; bright red jp monster_move ; common monster movement ; check for hunchback items on the floor (return C=1) chk_hunch_loot: ld hl, wine ; first of 8 items hunchback reacts to ld de, 8 ; 8 bytes per entry ld b, 8 ; 8 entries loc_8AE3: push hl ld a, (hl) and a ; unused slot? jr z, loc_8AF8 ; jump if so inc hl ld a, (hl) ; room number cp (ix+1) ; in hunchback room? jr nz, loc_8AF8 ; jump if not pop de inc hl inc hl ld e, (hl) ; item x inc hl ld d, (hl) ; item y ld c, 1 ; entry found ret loc_8AF8: pop hl add hl, de ; advance to next entry djnz loc_8AE3 ld c, 0 ; not found ret ; Hunchback handler h_hunchback: call save_entity ; save entity position for undraw call enemy_touching ; check if enemy is touching player (returns E=1) dec e ; touching player? call z, damage_16 ; call if so (reduce health by 16) xor a ld (ix+9), a ; no x movement ld (ix+8), a ; no y movement call chk_hunch_loot ; check for hunchback items on the floor (return C=1) dec c ; hunchback item in room? jp nz, loc_8B59 ; jump if not call attract_de ; hunchback attracted to item ld a, c cp 3 ; hunchback reached item? jr nz, loc_8B45 ; jump if not call chk_hunch_loot ; check for hunchback items on the floor (return C=1) ld de, 4 ; HL is 4 bytes into entity and a sbc hl, de ; start of item entity push ix ld ix, 0 ex de, hl add ix, de ; item entity now in IX ld a, (player_room) cp (ix+1) ; in player room? jr nz, loc_8B3C ; jump if not call draw_entity ; undraw item loc_8B3C: ld (ix+0), 0 ; remove item pop ix jp loc_8B59 loc_8B45: ld a, (ix+0) and &fc ; strip animation bits ld c, a ld a, (counter_low) rra rra ; 1/4 animation rate and 3 ; 4 animation frames add a, c ld (ix+0), a ; set animation graphic ld de, &3c3c loc_8B59: ld a, (player) cp &31 ; player active? jp c, monster_move ; jump if so ld de, &3a58 ; coords below top door call attract_de ; move towards door jp monster_move ; common monster movement creature_default:db &58, 0, &5c, &68, &68, &44, 0, 0, 2, 2, 0, 0, 0, &10, &20, 0 creatures: db &5c ; spider db &5e ; spikey db &98 ; bat db &98 ; bat db &90 ; witch db &90 ; witch db &94 ; monk db &94 ; monk db &5c ; spider db &5e ; spikey db &60 ; blob db &62 ; ghoul db &4c ; pumpkin db &4e ; ghostlet db &68 ; ghost db &6a ; batlet ; draw chicken energy bar draw_chicken: ld a, (player_energy) srl a srl a srl a ld c, a ld a, (chicken_level) ; last drawn chicken level srl a srl a srl a ld b, a cp c ret z ld a, (g_chicken_full+1) ; full chicken height ld e, a ld a, (g_chicken_empty+1) ; empty chicken height ld d, a push ix ld ix, chicken_entity push de jr c, loc_8C12 ld a, (g_chicken_empty) ld e, a ld d, 0 ld a, c push bc call mult_de_a ; HL = DE * A pop bc ld de, (chicken_empty_addr) push de add hl, de ld (chicken_empty_addr), hl ld e, (hl) inc hl ld d, (hl) ld a, (g_chicken_empty+1) sub c jr z, loc_8BFC push de ld (hl), a ld a, (g_chicken_empty) dec hl ld (hl), a push hl ld a, &14 ; empty chicken graphic ld (ix+0), a ld hl, &77c8 ; chicken draw coords ld a, h sub c ld h, a ld (chicken_entity+3), hl ; coords call draw_rot_obj ld hl, (chicken_entity+3) call xy_to_display ; convert coords in HL to display address in HL ld a, (g_chicken_empty) ld b, a loc_8BF2: ld (hl), 0 inc l djnz loc_8BF2 pop hl pop de ld (hl), e inc hl ld (hl), d loc_8BFC: pop hl ld (chicken_empty_addr), hl loc_8C00: pop de ld a, e ld (g_chicken_full+1), a ld a, d ld (g_chicken_empty+1), a pop ix ld a, (player_energy) ld (chicken_level), a ; last drawn chicken level ret loc_8C12: ld a, c ld (g_chicken_full+1), a ld a, &13 ; full chicken graphic ld (ix+0), a ld hl, &77c8 ld (chicken_entity+3), hl ; coords call draw_rot_obj ld b, 6 loc_8C26: ld (hl), 0 inc l djnz loc_8C26 jr loc_8C00 chicken_entity: db 0, 0, 0, 0, 0, 0, 0, 0 game_over: call clear_play_area ; clear screen and attrs of play area ld hl, charset - 256 ld (charset_addr), hl ld hl, &3040 ; game over at 64,48 ld de, gameover_msg call colour_text ; show a line of text, first byte is attr call game_stats ; show game statistics loc_8C4A: ld b, &14 ; 20 loops of 65536 delay ld hl, 0 gameover_delay: dec hl ld a, h or l jr nz, gameover_delay djnz gameover_delay jp main_menu gameover_msg: db &47 ; bright white db 'GAME OVE' db &d2 ; food item handler h_food: call save_entity ; save entity position for undraw call check_touching ; touching food? jr c, loc_8C6E ; jump if so jp draw_16x16 ; draw 16x16 entity loc_8C6E: call undraw_entity ld (ix+0), 0 ; remove food item call eat_sound ld c, &40 ; food adds 64 health ld a, (player_energy) add a, c ; add food value jr c, loc_8C84 cp &f0 ; exceeded maximum? jr c, loc_8C86 ; jump if not loc_8C84: ld a, &f0 ; cap energy at maximum loc_8C86: ld (player_energy), a jp draw_chicken ; draw chicken energy bar ; flash score on game start flash_score: dec a ; timer expired? ld (flash_timer), a ; score flash timer jr z, loc_8CA7 ; jump if so (stop flash) and &0f ; 16th frame? call z, start_beep ; call if so (beep) ld hl, display+&10c8 call xy_to_attr ; convert pixel coords in HL to attribute address ld b, 6 loc_8C9F: ld a, (hl) or &80 ; enable flash attribute ld (hl), a inc hl djnz loc_8C9F ret loc_8CA7: ld hl, display+&10c8 call xy_to_attr ; convert pixel coords in HL to attribute address ld b, 6 loc_8CAF: ld a, (hl) and &7f ; disable flash attribute ld (hl), a inc hl djnz loc_8CAF ret ; player appear handler for game start h_player_appear: ld a, (flash_timer) ; score flash timer and a ; score flash timer active? jr nz, flash_score ; jump if so ld a, (sysvar_FRAMES) and 3 ; 0 in range 0-3? jp nz, loc_8D12 ; jump if not inc (ix+6) ; increase drawn height ld a, (ix+7) ; player spawn sprite call get_sprite_addr ; return address of sprite A in DE ld a, (de) ; normal player sprite height cp (ix+6) ; reached full reveal height? jr z, loc_8D32 ; jump if so loc_8CD4: push de push hl ld b, h ld c, l ld a, (ix+4) ld (ix+2), a sub (ix+6) ld (ix+4), a ld l, (ix+6) ld h, 0 add hl, hl add hl, de ld a, h ld (bc), a dec bc ld a, l ld (bc), a push hl ld c, (hl) ld b, (ix+0) push bc ld (hl), 1 ld a, (ix+7) ; player spawn sprite ld (ix+0), a ; set player graphic call draw_entity ; draw entity graphic (no attrs) pop bc pop hl ld (hl), c ld (ix+0), b ld a, (ix+2) ld (ix+4), a pop hl pop de ld (hl), d dec hl ld (hl), e loc_8D12: ld a, (ix+5) push af ld a, (sysvar_FRAMES) rrca rrca ; 1/4 colour change rate and 7 ; ink 0-7 jr nz, loc_8D20 ; jump if not black inc a ; convert black to blue loc_8D20: or &40 ; add bright bit ld (ix+5), a ; set player attr ld a, (ix+6) call set_appear_w_h ; set spawn appearance width/height pop af ld (ix+5), a jp appear_sound ; player appearance sound loc_8D32: ld a, (ix+7) ; player spawn sprite ld (ix+0), a ; set player graphic ld (ix+6), 0 ; no x movement ld (ix+7), 0 ; no y movement ld (ix+2), 0 ; no auto-steps ret ; player death animation handler h_death: ld a, (sysvar_FRAMES) and 3 ; 3/4 animation rate for death jr z, loc_8D12 ; jump if colouring this frame instead dec (ix+6) ; reduce player visible height jp m, loc_8D5B ; jump if after zero ld a, (ix+7) ; player spawn sprite call get_sprite_addr ; return address of sprite A in DE jp loc_8CD4 loc_8D5B: call place_tombstone ; place a tombstone at the player position jp prepare_player ; prepare player to spawn ; copy initial game state to working state area reset_game_state: ld hl, player_init ; initial game state ld de, player ; working game state ld bc, &1570 ; 0x10000-player, rather than real init data size! ldir ret ; reduce auto-walk counter auto_walk_step: ld a, (ix+2) and &0f ; auto-walk active? ret z ; return if not dec (ix+2) ; take a step ret ; read controls and apply player movement control_player: ld a, (player_room) ld (some_room+1), a ; blank entity? push bc push de push hl call auto_walk_step ; reduce auto-walk counter ld a, (ix+2) or &30 ; can move left/right or up/down ld (ix+2), a call save_entity ; save entity position for undraw call read_controls ; return controls in A (FUDLR order, negative logic) ld c, a ; FUDLR pop hl ld de, 0 ; no movement yet bit 1, c ; left pressed? jr nz, loc_8D9E ; jump if not ld a, b neg ; negate for left ld e, a loc_8D9E: bit 0, c ; right pressed? jr nz, loc_8DA3 ; jump if not ld e, b loc_8DA3: bit 2, c ; down pressed? jr nz, loc_8DA8 ; jump if not ld d, b loc_8DA8: bit 3, c ; up pressed? jr nz, loc_8DB0 ; jump if not ld a, b neg ; negate for up ld d, a loc_8DB0: pop hl ; DE value from function entry call slow_player ; decelerate player movement pop hl ; BC value from function entry call move_player ; apply player movement, including auto-walk call chk_wall_move ; check if walls are blocking movement in DE call check_doorway ; check if player is standing in a doorway call chk_decor_move ; check if decor is blocking movement in DE jp apply_move ; apply movement in DE ; serf character handler h_serf: ld bc, &2020 ; walk deceleration ld de, &0101 ; walk acceleration ld hl, &0707 ; unused call control_player ; read controls and apply player movement ld e, (ix+6) ; x velocity ld d, (ix+7) ; y velocity ld a, d or e ; is player moving? jr z, loc_8E0F ; jump if not ld a, (sysvar_FRAMES) and 3 ; 1/4 update rate jr nz, loc_8E0F ; jump if not time ld a, (ix+0) and 3 ; keep animation frame bits add a, &21 ; add base serf graphic ld (ix+0), a ld a, d and a ; moving down? jp p, loc_8DF2 ; jump if so neg ; abs loc_8DF2: ld c, a ld a, e and a ; moving right? jp p, loc_8DFA ; jump if so neg ; abs loc_8DFA: cp c ; moving more up/down than left/right? jr nc, loc_8E1A ; jump if so ld a, d and a ; moving up? ld a, (ix+0) jp m, loc_8E07 ; jump if so add a, 4 ; offset to down sprites loc_8E07: add a, 8 ; offset to right sprites loc_8E09: ld (ix+0), a call walk_sound ; play walk clicks if due loc_8E0F: call read_controls ; return controls in A (FUDLR order, negative logic) and &10 ; fire pressed? call z, serf_fire ; call if so (fire weapon) jp loc_8E78 loc_8E1A: ld a, e and a ; moving left? ld a, (ix+0) jp m, loc_8E09 ; jump if so add a, 4 ; offset to right sprites jr loc_8E09 ; knight character handler h_knight: ld bc, &2020 ; walk deceleration ld de, &0303 ; walk acceleration ld hl, &0707 ; unused call control_player ; read controls and apply player movement ld e, (ix+6) ; current x velocity ld d, (ix+7) ; current y velocity ld a, d or e ; player moving? jr z, loc_8E70 ; jump if not ld a, (sysvar_FRAMES) and 3 ; 1/4 update rate jr nz, loc_8E70 ; jump if not time ld a, (ix+0) and 3 ; keep animation frame bits inc a ; add base knight graphic ld (ix+0), a ld a, d and a ; moving down? jp p, loc_8E53 ; jump if so neg ; abs loc_8E53: ld c, a ld a, e and a ; moving right? jp p, loc_8E5B ; jump if so neg ; abs loc_8E5B: cp c ; moving more up/down than left/right? jr nc, loc_8E94 ; jump if so ld a, d and a ; moving up? ld a, (ix+0) jp m, loc_8E68 ; jump if so add a, 4 ; offset to down sprites loc_8E68: add a, 8 ; offset to right sprites loc_8E6A: ld (ix+0), a call walk_sound ; play walk clicks if due loc_8E70: call read_controls ; return controls in A (FUDLR order, negative logic) and &10 ; fire pressed? call z, knight_fire ; call if so (fire weapon) loc_8E78: call chk_creatures ; check whether to add new room creatures ld a, (counter_low) and &0f ; 16th game loop? jr nz, loc_8E8E ; jump if not ld a, (player_energy) dec a ; reduce health by 1 jr z, player_dead ld (player_energy), a call draw_chicken ; draw chicken energy bar loc_8E8E: call draw_entity_disp ; draw entity to display (no attrs) jp set_entity_attrs2 ; set attrs covering previous and new position loc_8E94: ld a, e and a ; moving left? ld a, (ix+0) jp m, loc_8E6A ; jump if so (use left sprites) add a, 4 ; offset to down sprites jr loc_8E6A player_dead: ld a, (lives) and a ; no lives left? jp z, game_over ; jump if so dec a ; lose a life ld (lives), a ld a, (ix+0) dec a cp &30 ; is player active? jr c, loc_8EC6 ; jump if so ld a, (player) loc_8EB6: ld (player_steps_y), a call get_sprite_addr ; return address of sprite A in DE ld a, (de) ld (player_steps_x), a ld a, &67 ; blank graphic, death handler ld (player), a ret loc_8EC6: ld a, (saved_x) ld (player_x), a ld a, (saved_y) ld (player_y), a ld a, (saved_graphic) jr loc_8EB6 ; reduce health by 32 damage_32: ld a, (player_energy) sub &20 ; lose 32 health jr z, loc_8EE1 jr nc, loc_8EE9 ; jump if positive xor a loc_8EE1: ld (player_energy), a call draw_chicken ; draw chicken energy bar jr player_dead loc_8EE9: ld (player_energy), a jp draw_chicken ; draw chicken energy bar ; apply player movement, including auto-walk move_player: ld a, (ix+2) and &0f ; auto-walk active? jr nz, auto_walk ; jump if so ld a, e ; x acceleration add a, (ix+6) ; add x velocity jp m, loc_8F21 ; jump if moving left cp l ; max x velocity? jr c, loc_8F01 ; jump if not ld a, l ; limit velocity to max loc_8F01: ld (ix+6), a ; update x velocity ld a, d ; y acceleration add a, (ix+7) ; add y velocity jp m, loc_8F2B ; jump if moving up cp h ; max y velocity? jr c, loc_8F0F ; jump if not ld a, h ; limit velocity to max loc_8F0F: ld (ix+7), a ; update y velocity ld a, (ix+6) call get_signed_b7_4 ; return signed top nibble ld e, a ; x offset ld a, (ix+7) call get_signed_b7_4 ; return signed top nibble ld d, a ; y move offset ret loc_8F21: neg ; abs cp l ; max x velocity? jr c, loc_8F27 ; jump if not ld a, l ; limit velocity to max loc_8F27: neg ; re-negate jr loc_8F01 loc_8F2B: neg ; abs cp h ; max y velocity? jr c, loc_8F31 ; jump if not ld a, h ; limit velocity to max loc_8F31: neg ; re-negate jr loc_8F0F auto_walk: ld a, (ix+6) ; x velocity and a ; x movement? jp m, loc_8F52 ; jump if left and &f0 ; any non-fractional movement? jr z, loc_8F42 ; jump if not ld a, 2 ; walk right 2 pixels loc_8F42: ld e, a ; x walk in e ld a, (ix+7) and a ; auto-walk up/down? jp m, loc_8F5C ; jump if up and &f0 ; any non-fractional movement? jr z, loc_8F50 ; jump if not ld a, 2 ; walk down 2 pixels loc_8F50: ld d, a ; y walk in d ret loc_8F52: neg ; negate for left and &f0 ; any non-fractional movement? jr z, loc_8F42 ; jump if not ld a, -2 ; walk left 2 pixels jr loc_8F42 loc_8F5C: neg ; negate for up and &f0 ; any non-fractional movement? jr z, loc_8F50 ; jump if not ld a, -2 ; walk up 2 pixels jr loc_8F50 apply_move: bit 4, (ix+2) ; x movement allowed? jr nz, loc_8F73 ; jump if not ld a, e ; delta x add a, (ix+3) ; apply x movement ld (ix+3), a loc_8F73: bit 5, (ix+2) ; y movement allowed? ret nz ; return if not ld a, d ; delta y add a, (ix+4) ; apply y movement ld (ix+4), a ret ; return signed top nibble get_signed_b7_4: and a ; positive? jp p, loc_8F8F ; jump if so neg ; negate rrca rrca rrca rrca ; high nibble to low nibble and &0f ; keep low nibble neg ; re-negate ret loc_8F8F: rrca rrca rrca rrca ; high nibble to low nibble and &0f ; keep low nibble ret ; decelerate player movement slow_player: ld a, (ix+2) and &0f ; is auto-walk active? ret nz ; return if so ld a, (ix+6) and a ; x movement? jr z, loc_8FAD ; jump if not jp m, loc_8FBE ; jump if left sub l ; decelerate jp p, loc_8FAA ; jump if still positive stop_x: xor a ; stopped on x axis loc_8FAA: ld (ix+6), a ; update x velocity loc_8FAD: ld a, (ix+7) and a ; y movement? ret z ; return if not jp m, loc_8FC4 ; jump if moving up sub h ; decelerate jp p, loc_8FBA ; jump if still positive stop_y: xor a ; clear auto-walk up/down loc_8FBA: ld (ix+7), a ; update y velocity ret loc_8FBE: add a, l ; decelerate jp m, loc_8FAA ; jump if still negative jr stop_x ; stopped on x axis loc_8FC4: add a, h ; decelerate jp m, loc_8FBA ; jump if negative jr stop_y ; stopped on y axis ; check if walls are blocking movement in DE chk_wall_move: push de ld a, e add a, (ix+3) ; apply x movement ld e, a ld d, (ix+4) ; apply y movement ld b, &10 ; x bit mask call chk_walls ; check if position is within room interior pop de push de ld e, (ix+3) ld a, d add a, (ix+4) ld d, a ld b, &20 call chk_walls ; check if position is within room interior pop de ret ; check if position is within room interior chk_walls: ld hl, room_width ld a, e ; player x sub &58 ; subtract room centre x jp p, loc_8FF4 neg ; abs loc_8FF4: cp (hl) ; within room width? ret nc ; return if so inc hl ld a, d ; player y sub &68 ; subtract room centre y jp p, loc_8FFF neg ; abs loc_8FFF: cp (hl) ; within room height? ret nc ; return if so ld a, b cpl and (ix+2) ; clear bit in B ld (ix+2), a ret ; check if decor is blocking movement in DE chk_decor_move: push de ld a, e add a, (ix+3) ld e, a ld d, (ix+4) ld a, &10 ; bit for x movement allowed ex af, af' call chk_decor ; check if room decor is blocking movement pop de push de ld e, (ix+3) ld a, d add a, (ix+4) ld d, a ld a, &20 ; bit for y movement allowed ex af, af' call chk_decor ; check if room decor is blocking movement pop de ret ; check if room decor is blocking movement chk_decor: ld c, (ix+1) ld b, 0 ld hl, room_table sla c rl b ; * 2 (bytes per entry) add hl, bc ld c, (hl) inc hl ld b, (hl) loc_903B: ld a, (bc) ; room item LSB inc bc ld l, a ld a, (bc) ; room item MSB inc bc ld h, a or l ret z push bc ld bc, room_table and a sbc hl, bc inc hl ld a, (hl) cp (ix+1) ; in player room? jr z, loc_9055 ; jump if so ld bc, 8 ; 8 bytes per entry add hl, bc ; next (linked) entry loc_9055: inc hl inc hl ld c, (hl) ; x inc hl ld b, (hl) ; y inc hl ld a, (hl) ; flags inc hl bit 2, a jr nz, loc_909B bit 3, a jr nz, loc_9098 ld a, (hl) sra a sra a and &fc add a, c sub e neg ld c, a ld a, (hl) rlca rlca and &3c inc hl cp c jr c, loc_9098 ld a, (hl) sra a sra a and &fc add a, b sub d ld b, a ld a, (hl) inc hl rlca rlca and &3c cp b jr c, loc_9098 ex af, af' ld c, a ex af, af' ld a, c cpl and (ix+2) ; disallow movement bit loc_9095: ld (ix+2), a loc_9098: pop bc jr loc_903B loc_909B: ld a, (hl) sra a sra a and &fc add a, c sub e neg ld c, a ld a, (hl) rlca rlca and &3c inc hl cp c jr c, loc_9098 ld a, (hl) sra a sra a and &fc add a, b sub d ld b, a ld a, (hl) inc hl rlca rlca and &3c cp b jr c, loc_9098 ex af, af' ld c, a ex af, af' ld a, c or (ix+2) ; allow movement bit jr loc_9095 ; check if player has left through a door check_exit: ld a, (player_contact) and &0f ; touching enemy? ret nz ; return if so [check] ld a, (player) dec a cp &30 ; player active? ret nc ; return if not bit 6, (ix+5) ; top/bottom door? jr z, loc_90E1 ; jump if so srl c ; halve vertical distance loc_90E1: ld a, (player_x) sub (ix+3) ; x distance cp c ; within range? ret nc ; return if not bit 6, (ix+5) ; left/right door? jr nz, loc_90F1 ; jump if so srl b ; halve horiztonal distance loc_90F1: ld a, (player_y) sub (ix+4) ; y distance to exit neg cp b ; within range? ret ; return no-carry if not ; check if player is touching entity check_touching: ld a, (player_x) sub (ix+3) ; x distance jp p, loc_9106 neg ; abs loc_9106: cp &0c ; within range? ret nc ; return if not ld a, (player_y) sub (ix+4) ; y distance jp p, loc_9114 neg ; abs loc_9114: cp &0c ; within range? ret ; return no-carry if not ; move player to room linked to entity (usually door) change_room: call get_linked_door ; get connected door exit ld a, (ix+1) ld (player_room), a ; move player to connected room ld a, (ix+2) ; bits 3-0 used for x offset rlca ; * 2 and &1e add a, (ix+3) ; add x ld (player_x), a ; set player x to exit ld a, (ix+2) ; bits 7-4 used for y offset rrca rrca rrca ; * 2 (effectively) and &1e neg ; invert add a, (ix+4) ; add y ld (player_y), a ; set player y to exit call set_entry_walk ; auto-walk into the room ld a, (player_contact) or &0f ld (player_contact), a enter_room: ld a, (player_room) call visit_room ; mark room A as visited call clear_play_area ; clear screen and attrs of play area call draw_room_frame ; draw lines that make up outer room frame call draw_panel_attrs ; draw side-panel colours, which follow room colour call draw_inventory ; draw any items in player inventory call entry_sound ; room entry sound effect jp main_loop ; open door handler h_door_open: ld a, (counter_low) and 1 ; 2 alternating tasks jp nz, h_door_exit ; jump if we're checking exits this time ld a, (door_timer) and a ; door timer expired? jr z, loc_9174 ; jump if so dec a ; reduce timer ld (door_timer), a jp h_door_exit ; jump to check exits loc_9174: ld a, (in_doorway) and a ; player standing in doorway? jp nz, h_door_exit ; jump if so (run exit logic only) jr loc_9193 h_door_closed: ld a, (counter_low) ; closed door handler and 1 ; 2 alternating tasks jp nz, h_room_item ; jump if we're drawing this time ld a, (door_timer) and a ; door timer expired? jp z, loc_9193 ; jump if so dec a ld (door_timer), a jp h_room_item ; draw room item loc_9193: ld a, &5e ; 0x5E * 2 / 50 = 3.76 seconds, due to halved timer processing ld (door_timer), a ld a, (ix+5) ; save door attr push af or 3 ld (ix+5), a call draw_rot_obj ; undraw door ld a, (ix+0) ; entity type xor 1 ; toggle open/close state call set_door_type ; set door type for both linked entities call draw_rot_obj ; redraw door pop af ld (ix+5), a ; restore door attr call update_door ; update solid/passable door state call h_room_item ; draw room item jp door_sound ; door sound (short burst of white noise) ; closed trapdoor handler h_trap_closed: ld a, (counter_low) and a jp nz, h_room_item ; draw room item jr trap_common h_trap_open: ld a, (rand8) ; open trapdoor handler and a ; zero? jp nz, chk_trap_exit ; jump if not trap_common: ld a, (ix+5) push af or 3 ld (ix+5), a call draw_rot_obj ld a, (ix+0) xor 1 ; toggle open/closed state ld (ix+0), a call draw_rot_obj pop af ld (ix+5), a call h_room_item ; draw room item jp door_sound ; door sound (short burst of white noise) ; big door exit handler h_big_door_exit: ld bc, &2020 ; 32x32 size jr loc_91F5 ; door exit handler h_door_exit: ld bc, &1111 ; 17x17 exit size loc_91F5: call check_exit ; check if player has left through a door call c, change_room ; move player to room linked to entity (usually door) jp h_room_item ; draw room item ; draw room item h_room_item: ld e, (ix+3) ; xpos ld d, (ix+4) ; ypos dec d ld c, (ix+0) ; graphic ld b, (ix+5) ; attr call draw_bc_at_de ; B=attr, C=graphic, E=xpos, D=ypos ld a, (game_flags) ; b0 set if room content drawn and a ; room content drawn? ret nz ; return if so draw_rot_obj: ld e, (ix+3) ; xpos ld d, (ix+4) ; ypos ld c, (ix+0) ; graphic index ld b, (ix+5) ; orientation jp draw_orientation ; return if player has required key (C if opened, NC if locked) check_key_colour: ld a, (ix+0) and 3 ; locked door colour index ld hl, key_attrs call add_hl_a ; HL = HL + A ld d, (hl) ; key colour attr ld e, &81 ; key graphic call check_carrying ; is player carrying the required key colour? jp nz, loc_923F ; jump if not call enter_door ; enter linked object (door etc.) ld bc, &1111 ; 17x17 size jp check_exit ; check if player has left through a door loc_923F: call loc_9565 and a ; door locked ret ; coloured locked door handler h_door_locked: call check_key_colour ; does player have the required key colour? jp nc, h_room_item ; jump if not ld a, 2 ; open door graphic loc_924C: call set_door_type ; set door type for both linked entities jp change_room ; move player to room linked to entity (usually door) ; coloured cave locked door handler h_cave_locked: call check_key_colour ; return if player has required key (C if opened, NC if locked) jp nc, h_room_item ; draw room item ld a, 1 ; open cave graphic jr loc_924C key_attrs: db &42 ; red db &44 ; green db &45 ; cyan db &46 ; yellow ; set door type for both linked entities set_door_type: push ix pop hl ld (hl), a ; set door graphic ex af, af' ld a, l xor 8 ; linked entry ld l, a ex af, af' ld (hl), a ; set linked door graphic ret ; HL = HL + A add_hl_a: add a, l ld l, a ld a, h adc a, 0 ld h, a ret ; check if player is carrying object E with colour D check_carrying: ld b, 3 ; 3 inventory slots to search ld hl, inventory1+2 loc_9278: ld a, (hl) ; item colour cp e ; match? inc hl jr nz, loc_9280 ; jump if not ld a, (hl) ; item graphic cp d ; match? ret z ; return if so loc_9280: inc hl inc hl inc hl ; next inventory slot djnz loc_9278 ret ; get connected door exit get_linked_door: push ix pop hl ld a, l xor 8 ; swap 8-byte entry ld l, a push hl pop ix ret ; draw all non-monster entities in the current room draw_entities: ld ix, player loc_9295: ld a, (ix+0) and a ; slot used? jr z, loc_92A6 ; jump if not ld a, (player_room) cp (ix+1) ; in player room? jr nz, loc_92A6 ; jump if not call draw_entity ; draw entity graphic (no attrs) loc_92A6: ld de, 8 ; 8 bytes per entry add ix, de push ix pop hl ld de, creature1 ; end marker and a sbc hl, de ; more 8-byte entries to process? jr c, loc_9295 ; jump back if so loc_92B6: ld a, (ix+0) and a ; slot used? jr z, loc_92C7 ; jump if not ld a, (player_room) cp (ix+1) ; in player room? jr nz, loc_92C7 ; jump if not call draw_entity ; draw entity graphic (no attrs) loc_92C7: ld de, &10 ; 16 bytes per entry add ix, de push ix pop hl ld de, linked_items ; end of 16-byte entities and a sbc hl, de ; more 16-byte entries to draw? jr c, loc_92B6 ; jump back if so ret ; clear pickup key flag pickup_released: ld a, (pickup_flags) and &fd ; clear b1 (pickup key not pressed) ld (pickup_flags), a draw_16x16: ld a, &10 ; 16 lines high by default ; set spawn appearance width/height set_appear_w_h: ld (height_lines), a ld a, (ix+3) and 7 ; x aligned on cell boundary? ld a, 2 ; 2 bytes wide jr z, loc_92EF inc a ; extra byte needed loc_92EF: ld (width_bytes), a jp set_entity_attrs2 ; set attrs covering previous and new position ; pickup item handler h_pickup_item: call save_entity ; save entity position for undraw ld a, (pickup_pressed) and a ; if pick-up key pressed? jr z, pickup_released ; jump if not ld a, (pickup_flags) and 3 ; is pick-up allowed? jr nz, draw_16x16 ; jump if not ld a, (player) dec a cp &30 ; is player active? jr nc, draw_16x16 ; jump if not call check_touching ; is player touching item? jr nc, draw_16x16 ; jump if not ld a, (pickup_flags) or 3 ; disallow further pickups ld (pickup_flags), a call drop_item ; drop last item in inventory call shift_inventory ; move items 1+2 to slots 2+3 call add_inventory ; add item to inventory slot 1 jp draw_inventory ; draw any items in player inventory ; add item to inventory slot 1 add_inventory: ld hl, inventory1 push ix pop de ld (hl), e ; entity LSB inc hl ld (hl), d ; entity MSB inc hl ld a, (ix+0) ld (hl), a ; graphic inc hl ld a, (ix+5) ld (hl), a call undraw_entity ld a, (room_attr) ld (ix+5), a call set_entity_attrs2 ; set attrs covering previous and new position ld (ix+0), 0 jp inventory_sound ; move items 1+2 to slots 2+3 shift_inventory: ld hl, inventory2+3 ld de, inventory3+3 ld bc, 8 ; 2 items * 4 bytes lddr ; shift up items ret ; drop last item in inventory drop_item: ld hl, inventory3 ld e, (hl) inc hl ld d, (hl) inc hl ld a, d or e ret z ; return if no item to drop push de ld a, (hl) ; graphic idx inc hl ld (de), a inc de ld a, (player_room) ld (de), a ; set item room inc de ld a, &80 ld (de), a inc de ld a, (player_x) ld (de), a ; set item xpos inc de ld a, (player_y) ld (de), a ; set item ypos inc de ld a, (hl) ; inventory colour ld (de), a ; set item attr pop de call drop_sound push ix push de pop ix call draw_entity ; draw entity graphic (no attrs) pop ix ret ; check whether pick-up key has been pressed check_pickup_key: ld a, &7e ; read V/C/X/Z/Shift and B/N/M/Sym/Space rows out (&fd), a in a, (&fe) cpl and 2 ; non-zero if Symbol Shift or Z pressed ld (pickup_pressed), a ret read_cursor: ld a, &ef out (&fd), a in a, (&fe) ; xxx67890 ld c, a and 8 ; 7 key ld e, a ld a, c rrca ; 0xxx6789 rrca ; 90xxx678 and &45 ; ?+6+8 keys or e ld e, a rrca ; 890xxx67 rrca ; 7890xxx6 and &10 ; 0 key or e and &1f ld e, a ld a, &f7 ; xxx54321 out (&fd), a in a, (&fe) rra ; 1xxx5432 rra ; 21xxx543 rra ; 321xxx54 and 2 ; 5 key or e ret ; return controls in A (FUDLR order, negative logic) read_controls: ld a, (menu_selection) and 6 jr z, read_keyboard cp 4 jr z, read_cursor in a, (&1f) ; read Kempston joystick cpl ret read_keyboard: ld a, &fb out (&fd), a in a, (&fe) ; xxxTREWQ ld c, a rra and 1 ; W key ld e, a ld a, c rla and 2 ; Q key or e ld e, a ld a, c and &1c ; ___TRE__ or e ; ___TREQW ret h_blank: ld a, (player) dec a cp &30 ; is player active? ret nc ; return if not ld a, (pickup_pressed) and a ; pick-up key down? jr z, loc_9417 ; jump if not ld a, (pickup_flags) and 3 ; pick-up allowed? jr nz, loc_940E ; jump if not or 2 ; pickup key pressed ld (pickup_flags), a call drop_item ; drop last item in inventory call shift_inventory ; move items 1+2 to slots 2+3 ld hl, 0 ld (inventory1), hl ld (inventory1+2), hl call draw_inventory ; draw any items in player inventory loc_940E: ld a, (pickup_flags) and &fe ; pickup key not processed ld (pickup_flags), a ret loc_9417: ld a, (pickup_flags) and &fd ; pickup key released ld (pickup_flags), a jr loc_940E h_barrel: ld a, (player) sub &21 ; subtract serf base graphic jr loc_9433 h_bookcase: ld a, (player) sub &11 ; subtract wizard base graphic jr loc_9433 h_clock: ld a, (player) dec a ; subtract knight base graphic loc_9433: cp &10 ; required player type to pass through? jr nc, loc_943D ; jump if not call enter_door ; enter linked object (door etc.) jp h_door_exit ; door exit handler loc_943D: call loc_9565 jp h_room_item ; draw room item ; prepare player to spawn prepare_player: ld a, (menu_selection) rlca and &30 ; base character graphic add a, 8 ; offset to desired facing direction ld (player_template+7), a ; set spawn graphic ld a, (player_room) ; current player room ld (player_template+1), a ; respawn in same room ld hl, player_template ld de, player ld bc, 8 ; player entity size ldir ; copy to live player ld a, &68 ; flash score for 104 frames ld (flash_timer), a ; score flash timer ld a, (lives) cp 3 ; first game spawn? (full lives) jr z, loc_9476 ; jump if so (skip drawing player) push ix ld ix, player call draw_entity ; draw entity graphic (no attrs) pop ix loc_9476: ld a, &f0 ; starting energy ld (player_energy), a call draw_chicken ; draw chicken energy bar jp draw_lives ; draw lives sprites in side panel player_template:db &66, 0, 0, &60, &68, &47, &ff, 0 ; blank graphic and h_player_appear handler ; check for pause key, return when not paused check_pause: di ; disable interrupts to suspend FRAMES counter advance ld a, &7e out (&fd), a in a, (&fe) bit 0, a ; pause (space/shift) pressed? ret nz ; return if not cpl and &1e ; any other key on the same row pressed? ret nz ; return if so loc_9497: ld a, &7e out (&fd), a in a, (&fe) bit 0, a ; space/shift pressed? jr z, loc_9497 ; jump if so (wait until released) loc_94A1: ld a, &7e out (&fd), a in a, (&fe) bit 0, a ; space/shift pressed? jr nz, loc_94A1 ; jump if not (main pause loop) loc_94AB: ld a, &7e out (&fd), a in a, (&fe) bit 0, a ; space/shift pressed? jr z, loc_94AB ; jump if so (wait until pause key released) ret ; set locations of ACG key pieces place_key_pieces: ld a, (sysvar_FRAMES) ld c, a ld a, (counter_low) add a, c and 7 ld c, a add a, a ; * 2 add a, c ; * 3 (3 key pieces per entry) ld l, a ld h, 0 ld bc, acg_key_rooms add hl, bc ex de, hl ld hl, acg_key_init+1 ; first key piece room ld bc, 8 ; 8 bytes per entity ld a, 3 ; 3 key pieces loc_94D3: ex af, af' ld a, (de) ld (hl), a add hl, bc inc de ex af, af' dec a jr nz, loc_94D3 ret acg_key_rooms: db &81, &45, &7c db &85, &49, &2b db &6a, &3b, &7c db &69, &71, &2b db &67, &85, &7c db &68, &7f, &2b db &4d, &73, &7c db &17, &10, &2b ; randomise which doors can open/close randomise_doors: ld a, (counter_low) ld l, a ; set ROM addr LSB ld a, (sysvar_FRAMES) ; 0-49 and &0f ; limit to 4K (0000-0FFF) or &10 ; add 4K (1000-1FFF) ld h, a ; set ROM addr MSB exx ld hl, linked_items ; pairs of linked items, including doors ld de, linked_items+8 ; pairs of linked items, including doors ld bc, &10 ; 16 bytes per entry loc_950B: exx ld a, (hl) ; read ROM byte inc hl exx cp &70 ; ROM value >= 0x70 (~56% chance) jr nc, loc_951F ; jump if so (door always open) ld a, (de) cp (hl) ; same value? jr nz, loc_951F ; jump if not (no change) cp 1 ; cave doorway? jr z, loc_9526 ; jump if so cp 2 ; normal doorway? jr z, loc_9542 ; jump if so loc_951F: add hl, bc ; next entry ex de, hl add hl, bc ; next entry ret c ; return if hit end of RAM ex de, hl jr loc_950B loc_9526: ld a, &22 ; mode? loc_9528: ld (de), a ld (hl), a push de inc de inc de inc de inc de inc de ; + 5 ld a, (de) or 8 ld (de), a pop de push hl inc hl inc hl inc hl inc hl inc hl ld a, (hl) or 8 ld (hl), a pop hl jr loc_951F loc_9542: ld a, &20 ; mode? jr loc_9528 ; update solid/passable door state update_door: ld a, (ix+0) and 1 ; is door open? jr z, loc_9565 ; jump if so enter_door: ld a, (ix+5) ; enter linked object (door etc.) and &f7 ; object is solid ld (ix+5), a push ix call get_linked_door ; get connected door exit ld a, (ix+5) and &f7 ; linked object is solid ld (ix+5), a pop ix ret loc_9565: ld a, (ix+5) or 8 ; object can be passed through ld (ix+5), a push ix call get_linked_door ; get connected door exit ld a, (ix+5) or 8 ; linked object can be passed through ld (ix+5), a pop ix ret ; check if player is standing in a doorway check_doorway: push de ld b, 0 ld hl, (room_width) inc l ; increase interior width inc h ; increase interior height ld e, (ix+3) ; player x ld d, (ix+4) ; player y ld a, e sub &58 ; subtract room centre x jp p, loc_9593 neg ; abs loc_9593: cp l ; within interior width? jr c, loc_9597 ; jump if so inc b ; mark as in left/right doorway loc_9597: ld a, d sub &68 ; subtract room centre y jp p, loc_959F neg ; abs loc_959F: cp h ; within interior height? jr c, loc_95A3 ; jump if so inc b ; mark as in top/bottom doorway loc_95A3: ld a, b ld (in_doorway), a ; non-zero if in a doorway pop de ret ; place a tombstone at the player position place_tombstone: ld hl, tombstone1 ; tombstone entities ld de, 8 ; 8 bytes per entity ld b, 4 ; 4 tombstone slots loc_95B1: ld a, (hl) and a ; free slot? jr z, loc_95B9 ; jump if so add hl, de ; next slot djnz loc_95B1 ret loc_95B9: ld a, &45 ; bright cyan ld (player_attr), a push hl ld (hl), &8f ; tombstone graphic ex de, hl inc de ld hl, player_room ; copy remaining details from player entity ld bc, 7 ; 8 bytes minus the graphic we've written ldir pop hl ; jump return address ; draw entity in HL draw_entity_hl: push ix push hl pop ix call draw_entity ; draw entity graphic (no attrs) pop ix ret ; Attributes: thunk h_tombstone: jp draw_16x16 ; draw 16x16 entity ; advance the clock 1 frame clock_tick: ld a, (sysvar_FRAMES) cp 50 ; 1 second elapsed? ret c ; return if not sub 50 ; subtract 1 second ld (sysvar_FRAMES), a ; store back [this keeps LSB in 0-49 range!] ld hl, clock_seconds ld a, (hl) inc a ; add a second daa ld (hl), a cp &60 ; 60 seconds? jr nz, loc_9604 ; jump if not ld (hl), 0 ; reset seconds dec hl ld a, (hl) inc a ; add a minute daa ld (hl), a cp &60 ; 60 minutes? jr nz, loc_9604 ; jump if not ld (hl), 0 ; reset minutes dec hl ld a, (hl) inc a ; add an hour daa and &0f ; clip hours to 0-15 ld (hl), a loc_9604: ld hl, &40c8 ; time coords ; print clock time at position HL print_clock: call xy_to_display ; convert coords in HL to display address in HL ld de, clock_hours ld b, 2 call print_bcd_digit ; print a single BCD digit ld de, clock_seconds inc hl ld b, 1 jp print_bcd_bytes ; print B BCD bytes at DE ; ACG exit door handler h_acg_exit: ld hl, inventory1+2 ; graphic idx ld de, 4 ; 4 bytes per inventory slot ld a, (hl) cp &8c ; ACG key part 1? jr nz, loc_963B ; jump if not add hl, de ; next slot ld a, (hl) cp &8d ; ACG key part 2? jr nz, loc_963B ; jump if not add hl, de ; next slot ld a, (hl) cp &8e ; ACG key part 3? jr nz, loc_963B ; jump if not call enter_door ; enter linked object (door etc.) ld bc, &3020 ; 48x32 jp loc_91F5 loc_963B: call loc_9565 jp h_room_item ; draw room item ; show game statistics game_stats: call calc_visited ; calculate percentage of rooms visited ld hl, &4040 ; time header at 64,64 ld de, time_msg call colour_text ; show a line of text, first byte is attr ld hl, &5040 ; score header at 64,80 ld de, score_msg call colour_text ; show a line of text, first byte is attr ld hl, &6040 ; percent header at 64,96 ld de, percent_msg call colour_text ; show a line of text, first byte is attr ld hl, digit_charset ld (charset_addr), hl ld hl, &4080 ; clock at 128,64 call print_clock ; print clock time at position HL ld hl, &5080 ; score at 128,80 call print_score ; print player score at position HL ld hl, &6080 ; percent at 128,96 call xy_to_display ; convert coords in HL to display address in HL ld de, visited_percent ld b, 1 jp print_bcd_bytes ; print B BCD bytes at DE time_msg: db &45 ; bright cyan db 'TIME ' db '# ' db &a0 score_msg: db &45 ; bright cyan db 'SCORE ' db &a0 percent_msg: db &45 ; bright cyan db '$ ' db &a0 ; mark room A as visited visit_room: ld c, a ; room A srl c srl c srl c ld b, 0 ld hl, visited_rooms ; visit rooms bit array add hl, bc rlca rlca rlca and &38 or &c6 ld (loc_96C6+1), a ; self-modify bit in SET below loc_96C6: set 0, (hl) ; mark room as visited ret ; calculate percentage of rooms visited calc_visited: ld hl, visited_rooms ; visit rooms bit array ld bc, &0813 ; 8*19 bits covers all rooms ld d, 3 ; D decremented for every visited room xor a loc_96D2: push bc ld e, (hl) ; 8 visited bits inc hl loc_96D5: rr e jr nc, loc_96E1 dec d ; counter zero? jr nz, loc_96E1 ; jump if not ld d, 3 ; reset counter add a, 2 ; add 2% for every 3 visited rooms daa loc_96E1: djnz loc_96D5 pop bc dec c jr nz, loc_96D2 inc a ; add 1% to total ld (visited_percent), a ret game_complete: ld hl, player ; congratulate player on completion call draw_entity_hl ; undraw player ld hl, charset - 256 ld (charset_addr), hl ld hl, &2040 ; congratulations at 64,32 ld de, congrat_msg call colour_text ; show a line of text, first byte is attr ld hl, &3040 ; escaped message at 64,48 ld de, escape_msg call colour_text ; show a line of text, first byte is attr call game_stats ; show game statistics jp loc_8C4A congrat_msg: db &47 db 'CONGRATULATION' db &d3 escape_msg: db &47 db 'YOU HAVE ESCAPE' db &c4 chk_trap_exit: ld bc, &1818 ; 24x24 call check_exit ; fallen into trap door? jp nc, h_room_item ; jump if not call clear_play_area ; clear screen and attrs of play area ld a, &96 ; room 150 is trap door tunnel push ix call draw_room_a ; draw trap door lines pop ix ld b, &80 ; 128 frames of tunnel animation loc_9748: ld a, (sysvar_FRAMES) ld c, a loc_974C: push bc ld a, b cpl ; ~frame counter is effect frequency ld b, a call click ; short beep pop bc ld a, (sysvar_FRAMES) cp c ; same frame? jr z, loc_974C ; loop back to continue sound effect and 7 ; frame 1-7? ld a, 0 ; black jr nz, loc_9762 ; jump if so (use black) ld a, &47 ; bright white loc_9762: ld l, a ld h, a ld (attrs+&016b), hl ld (attrs+&018b), hl push bc call draw_tunnel_attrs pop bc djnz loc_9748 ; loop until end of effect jp change_room ; move player to room linked to entity (usually door) draw_tunnel_attrs: ld bc, &170b ; 23x11 (for 24x24 final area) ld hl, attrs+&02e0 ld de, &20 ; line pitch is 32 bytes loc_977D: push hl and a sbc hl, de inc l ld a, (hl) pop hl push bc loc_9785: ld (hl), a ; draw horizontal bar inc l ; forwards djnz loc_9785 pop bc push bc loc_978B: ld (hl), a ; draw vertical bar and a ; backwards sbc hl, de djnz loc_978B pop bc push bc loc_9793: ld (hl), a ; draw horizontal bar dec l ; backwards djnz loc_9793 pop bc push bc loc_9799: ld (hl), a ; draw vertical bar add hl, de ; forwards djnz loc_9799 ld (hl), a and a sbc hl, de inc l pop bc dec b dec b dec c jr nz, loc_977D ret points_trap: db &5c, &63 db &63, &63 db &63, &5c db &5c, &5c db &54, &6b db &6b, &6b db &6b, &54 db &54, &54 db &4c, &73 db &73, &73 db &73, &4c db &4c, &4c db &44, &7b db &7b, &7b db &7b, &44 db &44, &44 db &3c, &83 db &83, &83 db &83, &3c db &3c, &3c db &34, &8b db &8b, &8b db &8b, &34 db &34, &34 db &2c, &93 db &93, &93 db &93, &2c db &2c, &2c db &24, &9b db &9b, &9b db &9b, &24 db &24, &24 db &1c, &a3 db &a3, &a3 db &a3, &1c db &1c, &1c db &14, &ab db &ab, &ab db &ab, &14 db &14, &14 db &0c, &b3 db &b3, &b3 db &b3, &0c db &0c, &0c db 4, &bb db &bb, &bb db &bb, 4 db 4, 4 lines_trap: db 0, 1, 3, &ff db 2, 1, 3, &ff db 4, 5, 7, &ff db 6, 5, 7, &ff db 8, 9, &0b, &ff db &0a, 9, &0b, &ff db &0c, &0d, &0f, &ff db &0e, &0d, &0f, &ff db &10, &11, &13, &ff db &12, &11, &13, &ff db &14, &15, &17, &ff db &16, &15, &17, &ff db &18, &19, &1b, &ff db &1a, &19, &1b, &ff db &1c, &1d, &1f, &ff db &1e, &1d, &1f, &ff db &20, &21, &23, &ff db &22, &21, &23, &ff db &24, &25, &27, &ff db &26, &25, &27, &ff db &28, &29, &2b, &ff db &2a, &29, &2b, &ff db &2c, &2d, &2f, &ff db &2e, &2d, &2f, &ff db &ff ; auto-walk into the room set_entry_walk: ld a, (ix+5) ; b7-6 is door facing direction (00=down, 01=left, 10=up, 11=right) rlca rlca ; move to b1-0 rlca ; * 2 and 6 ; mask to look-up offset ld c, a ld b, 0 ld hl, walk_dir add hl, bc ld a, (hl) inc hl ld (player_steps_x), a ld a, (hl) ld (player_steps_y), a ret walk_dir: db 0, &20 ; walk down db -&20, 0 ; walk left db 0, -&20 ; walk up db &20, 0 ; walk right ; mushroom handler h_mushroom: call save_entity ; save entity position for undraw call check_touching ; check if player is touching entity jr c, loc_98B1 loc_9893: ld a, (counter_low) cpl and 3 ; time to change colour? (every 4 frames) jr nz, loc_989E ; jump if not inc (ix+6) ; cycle colour loc_989E: ld a, (ix+6) and 3 ; 4 possible colours ld c, a ld b, 0 ld hl, mushroom_attrs add hl, bc ld a, (hl) ; new mushroom attr ld (ix+5), a ; set colour jp draw_16x16 ; draw 16x16 entity loc_98B1: ld a, (player_energy) dec a ld (player_energy), a jp z, mushroom_death call draw_chicken ; draw chicken energy bar call touching_sound ; play monster touched sound jp loc_9893 mushroom_attrs: db &42 ; bright red db &43 ; bright magenta db &46 ; bright yellow db &43 ; bright magenta mushroom_death: call undraw_entity ld (ix+0), 0 ; remove mushroom jp player_dead ; set positions of red/green/cyan keys, and mummy set_key_positions: ld a, (sysvar_FRAMES) ld hl, green_key_rooms call get_key_room ld (green_key_init+1), a ; set green key room ld a, (sysvar_FRAMES) ld c, a ld a, (counter_low) add a, c ld hl, red_key_rooms call get_key_room ld (red_key_init+1), a ; set red key room ld (byte_640D+1), a ; set Mummy room to match ld a, (sysvar_FRAMES+1) ld c, a ld a, (counter_high) add a, c ld hl, cyan_key_rooms call get_key_room ld (cyan_key_init+1), a ; set cyan key room ret get_key_room: and 7 ld c, a ld b, 0 add hl, bc ld a, (hl) ret green_key_rooms:db 5, 6, 7, &6d, &25, &24, &23, &22 red_key_rooms: db &17, &13, 9, &0d, &89, &87, &80, &85 cyan_key_rooms: db &53, &8f, &41, &94, &33, &91, &39, &4c ; periodically replenish consumed food replenish_food: ld a, (counter_low) ld c, a ld a, (counter_high) and 1 or c ; 9-bit counter value zero? ret nz ; return if not ld hl, (food_ptr) ld de, 8 ; 8 bytes per item add hl, de ; next food item ld (food_ptr), hl push hl pop ix ld de, food_end ; end marker and a sbc hl, de ; end of list? jr nc, loc_995B ; jump if so ld a, (player_room) cp (ix+1) ; in player room? ret z ; return if so ld a, (ix+0) and a ; does food still exist? ret nz ; return if so ld a, (sysvar_FRAMES) ; pseudo random value and 7 ; 8 available food items add a, &50 ; add food base graphic ld (ix+0), a ; set food graphic (replenish) ret loc_995B: ld hl, food_items ld (food_ptr), hl ret draw_orientation: ld hl, disp_funcs jump_table_b: push bc ld a, b rlca rlca rlca ; move b7-5 to b2-0 and 7 ld c, a jp lookup_c_hl disp_funcs: dw draw_disp_0 ; normal dw draw_disp_1 dw draw_disp_2 dw draw_disp_3 dw draw_disp_4 ; 180 degrees dw draw_disp_5 dw draw_disp_6 ; right 90 degrees dw draw_disp_7 ; left 90 degrees ; B=attr, C=graphic, E=xpos, D=ypos draw_bc_at_de: ld hl, attr_funcs jr jump_table_b attr_funcs: dw draw_attr_0 dw draw_attr_1 dw draw_attr_2 dw draw_attr_3 dw draw_attr_4 dw draw_attr_5 dw draw_attr_6 dw draw_attr_7 ; C=gfx idx, DE=coords get_gfx_data: ld hl, gfx_data dec c ; 1-based ld b, 0 sla c rl b add hl, bc ld a, (hl) inc hl ld h, (hl) ld l, a ex de, hl call xy_to_display ; convert coords in HL to display address in HL ld a, (de) ld b, a inc de ld a, (de) ld c, a inc de ret ; IN: C=gfx idx, DE=coords OUT: HL=attr addr, DE=attr data, B=width, C=height get_gfx_attrs: ld hl, gfx_attrs dec c ; 1-based ld b, 0 sla c rl b add hl, bc ld a, (hl) inc hl ld h, (hl) ld l, a ex de, hl call xy_to_attr ; convert pixel coords in HL to attribute address ld a, (de) ld b, a inc de ld a, (de) ld c, a inc de ret draw_disp_0: pop bc call get_blend_instr ; map A=0-2 to Z80 opcode used to blend graphics data ld (loc_99D7), a call get_gfx_data ; C=gfx idx, DE=coords loc_99D3: push bc push hl loc_99D5: ld a, (de) inc de loc_99D7: nop ld (hl), a inc l djnz loc_99D5 pop hl call pixel_line_up ; move up 1 display line in HL pop bc dec c jr nz, loc_99D3 ret draw_disp_1: pop bc call get_blend_instr ; map A=0-2 to Z80 opcode used to blend graphics data ld (blend_instr), a call get_gfx_data ; C=gfx idx, DE=coords loc_99EF: push bc push hl call add_de_b ; add B to DE loc_99F4: dec de ld a, (de) ; graphic data byte call mirror_a ; mirror bits in A blend_instr: nop ld (hl), a ; write to display inc l djnz loc_99F4 pop hl call pixel_line_up ; move up 1 display line in HL pop bc call add_de_b ; add B to DE dec c jr nz, loc_99EF ret draw_disp_2: pop bc call get_blend_instr ; map A=0-2 to Z80 opcode used to blend graphics data ld (loc_9A36), a call get_gfx_data ; C=gfx idx, DE=coords ld a, b exx ld l, 1 ld b, a exx call add_de_b ; add B to DE dec de loc_9A1E: push bc push de push hl loc_9A21: ld a, (de) exx and l jr z, loc_9A27 scf loc_9A27: rl h exx call add_de_b ; add B to DE dec c ld a, c and 7 jr nz, loc_9A21 exx ld a, h exx loc_9A36: nop ld (hl), a inc l ld a, c and a jr nz, loc_9A21 pop hl call pixel_line_up ; move up 1 display line in HL pop de pop bc exx rlc l exx jr nc, loc_9A1E exx dec b exx ret z dec de jr loc_9A1E draw_disp_3: pop bc call get_blend_instr ; map A=0-2 to Z80 opcode used to blend graphics data ld (loc_9A78), a call get_gfx_data ; C=gfx idx, DE=coords ld a, b exx ld b, a ld l, &80 exx loc_9A60: push bc push de push hl loc_9A63: ld a, (de) exx and l jr z, loc_9A69 scf loc_9A69: rl h exx call add_de_b ; add B to DE dec c ld a, c and 7 jr nz, loc_9A63 exx ld a, h exx loc_9A78: nop ld (hl), a inc l ld a, c and a jr nz, loc_9A63 pop hl call pixel_line_up ; move up 1 display line in HL pop de pop bc exx rrc l exx jr nc, loc_9A60 exx dec b exx ret z inc de jr loc_9A60 ; mirror bits in A mirror_a: push bc ld b, 8 loc_9A95: rla rr c djnz loc_9A95 ld a, c pop bc ret ; add B to DE add_de_b: ld a, b add a, e ld e, a ld a, d adc a, 0 ld d, a ret ; subtract B from DE sbc_de_b: ld a, e sub b ld e, a ld a, d sbc a, 0 ld d, a ret ; HL = DE * A mult_de_a: ld hl, 0 ld b, 8 loc_9AB2: add hl, hl rlca jr nc, loc_9AB7 add hl, de loc_9AB7: djnz loc_9AB2 ret ; HL = DE + B * C hl_de_b_c: push hl push de ld a, b ld e, c dec e ; convert 1-based to 0-based ld d, 0 push bc call mult_de_a ; HL = DE * A pop bc pop de add hl, de ex de, hl pop hl ret draw_disp_4: pop bc call get_blend_instr ; map A=0-2 to Z80 opcode used to blend graphics data ld (loc_9ADD), a call get_gfx_data ; C=gfx idx, DE=coords call hl_de_b_c ; HL = DE + B * C loc_9AD8: push bc push de push hl loc_9ADB: ld a, (de) inc de loc_9ADD: nop ld (hl), a inc l djnz loc_9ADB pop hl call pixel_line_up ; move up 1 display line in HL pop de pop bc call sbc_de_b ; subtract B from DE dec c jr nz, loc_9AD8 ret draw_disp_5: pop bc call get_blend_instr ; map A=0-2 to Z80 opcode used to blend graphics data ld (loc_9B06), a call get_gfx_data ; C=gfx idx, DE=coords call hl_de_b_c ; HL = DE + B * C call add_de_b ; add B to DE loc_9AFF: push bc push hl loc_9B01: dec de ld a, (de) call mirror_a ; mirror bits in A loc_9B06: nop ld (hl), a inc l djnz loc_9B01 pop hl call pixel_line_up ; move up 1 display line in HL pop bc dec c jr nz, loc_9AFF ret draw_disp_6: pop bc call get_blend_instr ; map A=0-2 to Z80 opcode used to blend graphics data ld (loc_9B43), a call get_gfx_data ; C=gfx idx, DE=coords ld a, b exx ld b, a ld l, 1 exx call add_de_b ; add B to DE dec de call hl_de_b_c ; HL = DE + B * C loc_9B2B: push bc push de push hl loc_9B2E: ld a, (de) exx and l jr z, loc_9B34 scf loc_9B34: rl h exx call sbc_de_b ; subtract B from DE dec c ld a, c and 7 jr nz, loc_9B2E exx ld a, h exx loc_9B43: nop ld (hl), a inc l ld a, c and a jr nz, loc_9B2E pop hl call pixel_line_up ; move up 1 display line in HL pop de pop bc exx rlc l exx jr nc, loc_9B2B exx dec b exx ret z dec de jr loc_9B2B draw_disp_7: pop bc call get_blend_instr ; map A=0-2 to Z80 opcode used to blend graphics data ld (loc_9B88), a call get_gfx_data ; C=gfx idx, DE=coords ld a, b exx ld b, a ld l, &80 exx call hl_de_b_c ; HL = DE + B * C loc_9B70: push bc push de push hl loc_9B73: ld a, (de) exx and l jr z, loc_9B79 scf loc_9B79: rl h exx call sbc_de_b ; subtract B from DE dec c ld a, c and 7 jr nz, loc_9B73 exx ld a, h exx loc_9B88: nop ld (hl), a inc l ld a, c and a jr nz, loc_9B73 pop hl call pixel_line_up ; move up 1 display line in HL pop de pop bc exx rrc l exx jr nc, loc_9B70 exx dec b exx ret z inc de jr loc_9B70 ; convert coords in HL to display address in HL xy_to_display: ld a, l rrca rrca rrca and &1f ld l, a ld a, h rlca rlca and &e0 or l ld l, a ld a, h and 7 ex af, af' ld a, h rrca rrca rrca and &18 or &40 ld h, a ex af, af' or h ld h, a ret pixel_line_down: inc h ld a, h and 7 ret nz ld a, l add a, &20 ld l, a and &e0 ret z ld a, h sub 8 ld h, a ret ; convert pixel coords in HL to attribute address xy_to_attr: push bc ld a, l rrca rrca rrca and &1f ld l, a ld a, h rlca rlca ld c, a and &e0 or l ld l, a ld a, c and 3 or &58 ld h, a pop bc ret ; draw lines that make up outer room frame draw_room_frame: xor a ld (game_flags), a ; b0 set if room content drawn ld a, (player_room) draw_room_a: ld bc, room_attrs ; room attr colour and style (0-B) ld l, a ld h, 0 add hl, hl ; 2 bytes per entry add hl, bc ld a, (hl) ; attr colour inc hl ld (room_attr), a exx ld hl, attrs ld bc, &1818 ; 24x24 room area ld a, (room_attr) call fill_bc_hl_a ; fill C rows of B columns of value A at address HL exx ld l, (hl) ; style? ld h, 0 add hl, hl ; * 2 ld c, l ld b, h add hl, hl ; * 4 add hl, bc ; * 6 ld bc, room_styles add hl, bc ld a, (hl) inc hl ld (room_width), a ld a, (hl) inc hl ld (room_height), a ld e, (hl) ; points LSB inc hl ld d, (hl) ; points MSB inc hl ld a, (hl) ; lines LSB inc hl ld h, (hl) ; lines MSB ld l, a push de pop ix push bc loc_9C2E: pop bc ld a, (hl) ; x of first point inc hl cp &ff ; end marker? ret z ; return if so sla a ; * 2 (bytes per point) ld (loc_9C3D+2), a ; offset of source x inc a ld (loc_9C40+2), a ; offset of source y loc_9C3D: ld c, (ix+0) ; source x loc_9C40: ld b, (ix+0) ; source y loc_9C43: push bc ld a, (hl) ; next point x inc hl cp &ff ; end marker? jr z, loc_9C2E ; jump if so (next source point) sla a ; * 2 (bytes per point) ld (loc_9C53+2), a ; offset of target x inc a ld (loc_9C56+2), a ; offset of target y loc_9C53: ld e, (ix+0) ; target x loc_9C56: ld d, (ix+0) ; target y push hl call draw_line_bc_de ; draw line from (B,C) to (D,E) pop hl pop bc jr loc_9C43 ; next target point ; plot pixel at L,H plot_l_h: ld a, l and 7 inc a ld b, a xor a scf loc_9C68: rra djnz loc_9C68 push hl push af ex af, af' push af call xy_to_display ; convert coords in HL to display address in HL pop af ex af, af' pop af or (hl) ; merge pixel ld (hl), a ; write to display pop hl ret ; draw line from (B,C) to (D,E) draw_line_bc_de: ld h, b ; move source point to HL ld l, c ld c, 0 ; clear flags ld a, h sub d ; drawing upwards? jr nc, loc_9C85 ; jump if so neg ; abs set 0, c ; flag drawing down loc_9C85: ld b, a ; vertical count ld a, l sub e ; drawing left? jr nc, loc_9C8E ; jump if so neg ; abs set 1, c ; flag drawing right loc_9C8E: cp b ; drawing more horiz than vert? ex af, af' ld a, c ld (line_flags), a ex af, af' jp c, loc_9CD6 ; jump if so ld (line_counter), a ; horiz counter push de push hl ld e, a ; horiz line size ld d, 0 ld l, d ld h, b ; vert line size call line_slope ; determine Bresenham line slope step ld a, (line_flags) bit 0, a jr nz, loc_9CAF call minus_de ; HL = -DE loc_9CAF: ld a, (line_flags) bit 1, a ; drawing down? ld c, 1 ; y step jr nz, loc_9CBA ; jump if so ld c, -1 ; y step loc_9CBA: ex de, hl pop hl ld a, (line_counter) inc a ld b, a ld a, e ex af, af' loc_9CC3: push bc call plot_l_h ; plot pixel at L,H ld a, l ex af, af' ld l, a add hl, de ; step partial x ld a, l ex af, af' pop bc add a, c ; step y ld l, a djnz loc_9CC3 pop hl jp plot_l_h ; plot pixel at L,H loc_9CD6: ex af, af' ld a, b ld (line_counter), a ; vert counter ex af, af' push de push hl ld e, b ld d, 0 ld l, d ld h, a call line_slope ; determine Bresenham line slope step ld a, (line_flags) bit 1, a ; drawing right? jr nz, loc_9CF0 ; jump if so call minus_de ; HL = -DE loc_9CF0: ld a, (line_flags) bit 0, a ; drawing right? ld c, 1 ; x step jr nz, loc_9CFB ; jump if so ld c, -1 ; x step loc_9CFB: ex de, hl pop hl ld a, (line_counter) inc a ld b, a ld a, e ex af, af' loc_9D04: push bc call plot_l_h ; plot pixel at L,H ld a, h ex af, af' ld h, l ld l, a add hl, de ; step partial y ld a, l ld l, h ex af, af' pop bc add a, c ; step x ld h, a djnz loc_9D04 pop hl jp plot_l_h ; plot pixel at L,H ; map A=0-2 to Z80 opcode used to blend graphics data get_blend_instr: ld a, b and 3 ret z ; return: NOP cp 1 ld a, &ae ret nz ; return: XOR (HL) add a, 8 ret ; return: OR (HL) draw_attr_0: pop bc call get_gfx_attrs ; IN: C=gfx idx, DE=coords OUT: HL=attr addr, DE=attr data, B=width, C=height loc_9D29: push bc push hl loc_9D2B: ld a, (de) ; attr byte inc de and a ; skip attr? jr z, loc_9D38 ; jump if so cp &ff ; use room attr? jr nz, loc_9D37 ; jump if not ld a, (room_attr) loc_9D37: ld (hl), a ; set attr loc_9D38: inc l djnz loc_9D2B pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop bc dec c jr nz, loc_9D29 ret draw_attr_1: pop bc call get_gfx_attrs ; IN: C=gfx idx, DE=coords OUT: HL=attr addr, DE=attr data, B=width, C=height dec de loc_9D4C: call add_de_b ; add B to DE push bc push de push hl loc_9D52: ld a, (de) ; attr byte dec de and a ; skip attr? jr z, loc_9D5F ; jump if so cp &ff ; use room attr? jr nz, loc_9D5E ; jump if not ld a, (room_attr) loc_9D5E: ld (hl), a ; set attr loc_9D5F: inc l djnz loc_9D52 pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop de pop bc dec c jr nz, loc_9D4C ret draw_attr_2: pop bc call get_gfx_attrs ; IN: C=gfx idx, DE=coords OUT: HL=attr addr, DE=attr data, B=width, C=height ld a, b exx ld b, a exx call add_de_b ; add B to DE loc_9D7A: dec de push bc push de push hl loc_9D7E: ld a, (de) ; attr byte and a ; skip attr? jr z, loc_9D8A ; jump if so cp &ff ; use room attr? jr nz, loc_9D89 ; jump if not ld a, (room_attr) loc_9D89: ld (hl), a ; set attr loc_9D8A: call add_de_b ; add B to DE inc l dec c jr nz, loc_9D7E pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop de pop bc exx dec b exx jr nz, loc_9D7A ret draw_attr_3: pop bc call get_gfx_attrs ; IN: C=gfx idx, DE=coords OUT: HL=attr addr, DE=attr data, B=width, C=height ld a, b exx ld b, a exx loc_9DA8: push bc push de push hl loc_9DAB: ld a, (de) and a ; skip attr? jr z, loc_9DB7 ; jump if so cp &ff ; use room attr? jr nz, loc_9DB6 ; jump if not ld a, (room_attr) loc_9DB6: ld (hl), a ; set attr loc_9DB7: call add_de_b ; add B to DE inc l dec c jr nz, loc_9DAB pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop de pop bc inc de exx dec b exx jr nz, loc_9DA8 ret draw_attr_4: pop bc call get_gfx_attrs ; IN: C=gfx idx, DE=coords OUT: HL=attr addr, DE=attr data, B=width, C=height call hl_de_b_c ; HL = DE + B * C loc_9DD5: push bc push de push hl loc_9DD8: ld a, (de) inc de and a ; skip attr? jr z, loc_9DE5 ; jump if so cp &ff ; use room attr? jr nz, loc_9DE4 ; jump if not ld a, (room_attr) loc_9DE4: ld (hl), a ; set attr loc_9DE5: inc l djnz loc_9DD8 pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop de pop bc call sbc_de_b ; subtract B from DE dec c jr nz, loc_9DD5 ret draw_attr_5: pop bc call get_gfx_attrs ; IN: C=gfx idx, DE=coords OUT: HL=attr addr, DE=attr data, B=width, C=height call hl_de_b_c ; HL = DE + B * C call add_de_b ; add B to DE dec de loc_9E03: push bc push hl loc_9E05: ld a, (de) dec de and a ; skip attr? jr z, loc_9E12 ; jump if so cp &ff ; use room attr? jr nz, loc_9E11 ; jump if not ld a, (room_attr) loc_9E11: ld (hl), a ; set attr loc_9E12: inc l djnz loc_9E05 pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop bc dec c jr nz, loc_9E03 ret draw_attr_6: pop bc call get_gfx_attrs ; IN: C=gfx idx, DE=coords OUT: HL=attr addr, DE=attr data, B=width, C=height ld a, b exx ld b, a exx call hl_de_b_c ; HL = DE + B * C call add_de_b ; add B to DE loc_9E2F: dec de push bc push de push hl loc_9E33: ld a, (de) and a ; skip attr? jr z, loc_9E3F ; jump if so cp &ff ; use room attr? jr nz, loc_9E3E ; jump if not ld a, (room_attr) loc_9E3E: ld (hl), a ; set attr loc_9E3F: call sbc_de_b ; subtract B from DE inc l dec c jr nz, loc_9E33 pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop de pop bc exx dec b exx jr nz, loc_9E2F ret draw_attr_7: pop bc call get_gfx_attrs ; IN: C=gfx idx, DE=coords OUT: HL=attr addr, DE=attr data, B=width, C=height ld a, b exx ld b, a exx call hl_de_b_c ; HL = DE + B * C loc_9E60: push bc push de push hl loc_9E63: ld a, (de) and a ; skip attr? jr z, loc_9E6F ; jump if so cp &ff ; use room attr? jr nz, loc_9E6E ; jump if not ld a, (room_attr) loc_9E6E: ld (hl), a ; set attr loc_9E6F: call sbc_de_b ; subtract B from DE inc l dec c jr nz, loc_9E63 pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop de pop bc inc de exx dec b exx jr nz, loc_9E60 ret ; return address of sprite A in DE get_sprite_a: ld a, (saved_graphic) ; return address of sprite A in DE get_sprite_addr: dec a ld l, a ld h, 0 add hl, hl ld bc, sprite_table add hl, bc ld e, (hl) inc hl ld d, (hl) ret ; return addr of entity sprite addr in DE get_entity_sprite: ld a, (ix+0) jr get_sprite_addr ; return address of sprite A in DE loc_9E9B: ld a, c and a jr z, loc_9EAF dec c call draw_sprite23 exx ld a, c and a jr z, loc_9EAC loc_9EA8: dec c call draw_sprite2 loc_9EAC: exx jr loc_9E9B loc_9EAF: exx ld a, c and a jr nz, loc_9EA8 loc_9EB4: exx loc_9EB5: ld a, (some_height) ld c, a ld a, (some_width) or c ; width and height zero? ret z ; return if so xor a ld (some_height), a exx ld a, (some_width) ld c, a xor a loc_9EC8: ld (some_width), a exx jr loc_9E9B draw_unshifted: ex de, hl ex (sp), hl ld a, d xor (hl) ld (hl), a inc l ld a, e xor (hl) ld (hl), a pop de dec l jp pixel_line_up ; move up 1 display line in HL draw_sprite23: ex de, hl push de ld d, (hl) inc hl ld e, (hl) inc hl ex de, hl xor a jr_23: jr $ add hl, hl adc a, a add hl, hl adc a, a add hl, hl adc a, a add hl, hl adc a, a add hl, hl adc a, a add hl, hl adc a, a add hl, hl adc a, a ex de, hl ex (sp), hl xor (hl) ld (hl), a inc l draw_2_bytes: ld a, d xor (hl) ld (hl), a inc l ld a, e xor (hl) ld (hl), a pop de dec l dec l pixel_line_up: dec h ; move up 1 display line in HL ld a, h cpl and 7 ret nz ld a, l sub &20 ld l, a ret c ld a, h add a, 8 ld h, a ret ; draw 2-byte unshifted graphic draw_unshifted2: ex de, hl ex (sp), hl ld a, d xor (hl) ld (hl), a inc l ld a, e xor (hl) ld (hl), a pop de dec l jp pixel_line_up ; move up 1 display line in HL draw_sprite2: ex de, hl push de ld d, (hl) inc hl ld e, (hl) inc hl ex de, hl xor a jr_2: jr $ add hl, hl adc a, a add hl, hl adc a, a add hl, hl adc a, a add hl, hl adc a, a add hl, hl adc a, a add hl, hl adc a, a add hl, hl adc a, a ex de, hl ex (sp), hl xor (hl) ld (hl), a ; first byte inc l jr draw_2_bytes draw2_entity: call prepare_draw2_de jr loc_9F4D undraw_entity_de: call prepare_draw23_de jr loc_9F59 ; draw entity graphic (no attrs) draw_entity: call prepare_draw2 ; prepare for 2-byte drawing loc_9F4D: exx xor a ld (some_height), a ld c, a jp loc_9E9B undraw_entity: call prepare_draw23 ; prepare for 2-3 byte drawing loc_9F59: exx xor a ld c, a ld (some_width), a ld a, (some_height) ld (height_lines), a ld a, l and 7 ; aligned to cell boundary? ld a, 2 ; 2 bytes wide jr z, loc_9F6D ; jump if so inc a ; 3 bytes needed loc_9F6D: ld (width_bytes), a exx jp loc_9E9B push de call prepare_draw23_de exx pop de call prepare_draw2_de exx jr loc_9FD1 ; prepare for 2-3 byte drawing prepare_draw23: call get_sprite_a ; return address of sprite A in DE prepare_draw23_de: ld hl, (saved_x) ld a, l ; xpos (b2-0 determine shifting) dec a rlca ; * 2 (bytes per: add hl,hl;adc a,a) and &0e ; relative jump offset cp &0e ; originally unshifted? jr nz, loc_9F91 ; jump if not (use calculated offset) ld a, -&18 ; jr offset back to 'draw_unshifted' loc_9F91: ld (jr_23+1), a ; set jr offset for data shifting call xy_to_display ; convert coords in HL to display address in HL ld a, (de) ld (some_height), a loc_9F9B: ld c, 0 inc de ret ; prepare for 2-byte drawing prepare_draw2: call get_entity_sprite ; return addr of entity sprite addr in DE prepare_draw2_de: ld l, (ix+3) ; x ld h, (ix+4) ; y ld a, l ; xpos (b2-0 determine shifting) dec a rlca ; * 2 (bytes per: add hl,hl;adc a,a) and &0e ; relative jump offset cp &0e ; originally unshifted? jr nz, loc_9FB3 ; jump if not (use calculated offset) ld a, -&18 ; r offset back to 'draw_unshifted' loc_9FB3: ld (jr_2+1), a ; set jr offset for data shifting ld a, 2 ; 2 bytes wide jr z, loc_9FBB inc a ; any shift requires 3 bytes loc_9FBB: ld (width_bytes), a call xy_to_display ; convert coords in HL to display address in HL ld a, (de) ld (some_width), a ld (height_lines), a jr loc_9F9B ; draw entity to display (no attrs) draw_entity_disp: call prepare_draw2 ; prepare for 2-byte drawing exx call prepare_draw23 ; prepare for 2-3 byte drawing loc_9FD1: ld a, (saved_y) sub (ix+4) jp z, loc_9EB5 jp m, loc_9FEC ld c, a ld a, (some_height) cp c jp c, loc_9EB5 sub c ld (some_height), a jp loc_9E9B loc_9FEC: exx neg ld c, a ld a, (some_width) cp c jp c, loc_9EB4 sub c jp loc_9EC8 ; save entity position for undraw save_entity: ld a, (ix+3) ld (saved_x), a ld a, (ix+4) ld (saved_y), a ld a, (ix+0) ld (saved_graphic), a ret ; paint entity with its current attr colour set_entity_attrs: ld a, (ix+3) ; xpos ld (saved_x), a ld a, (ix+4) ; ypos ld (saved_y), a set_entity_attrs2: ld l, (ix+3) ; xpos ld h, (ix+4) ; ypos ld d, (ix+5) ; entity attr ld a, (room_attr) ld e, a ld a, (width_bytes) ld b, a ld a, (height_lines) rrca rrca inc a rrca and &1f inc a ld c, a ; attr height push bc ld b, 0 ld a, (saved_x) cp l ; same as previous xpos? jr z, loc_A043 ; jump if so (no change) jr c, loc_A042 ; jump if less (moving left, add 1) inc b ; moving right (add 2) loc_A042: inc b loc_A043: ld a, (saved_y) cp h ; ypos unchanged? ld a, b jr z, loc_A050 ; jump if so (no change) jr c, loc_A04E ; jump if less (moving up, add 4) add a, 4 ; moving down (add 8) loc_A04E: add a, 4 loc_A050: ld b, a ; handler table index call xy_to_attr ; convert pixel coords in HL to attribute address ld a, b pop bc push hl ld hl, attr_handlers ; 3x3 handlers (in 4x3 table) to cover attr for moving entity sla a ; * 2 (bytes per entry) call add_hl_a ; HL = HL + A ld a, (hl) ; handler LSB inc hl ld h, (hl) ; handler MSB ld l, a jp (hl) ; execute handler attr_handlers: dw attr_draw_c, attr_draw_r, attr_draw_l, h_creat_delay ; 3x3 handlers (in 4x3 table) to cover attr for moving entity dw attr_draw_d, attr_draw_dr, attrs_draw_dl, h_creat_delay ; extra delay applied to inactive creatures dw attr_draw_u, attr_draw_ur, attr_draw_ul ; draw attrs for moving up ; draw attrs for unchanged position attr_draw_c: pop hl loc_A07B: push bc push hl loc_A07D: ld (hl), d ; entity attr inc l djnz loc_A07D pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop bc dec c jr nz, loc_A07B ret ; draw attrs for moving right attr_draw_r: pop hl loc_A08E: push bc push hl dec l ld (hl), e ; room attr inc l loc_A093: ld (hl), d ; entity attr inc l djnz loc_A093 pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop bc dec c jr nz, loc_A08E ret ; draw attrs for moving left attr_draw_l: pop hl loc_A0A4: push bc push hl loc_A0A6: ld (hl), d ; entity attr inc l djnz loc_A0A6 ld (hl), e ; room attr pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop bc dec c jr nz, loc_A0A4 ret ; draw attrs for moving down attr_draw_d: pop hl loc_A0B8: push bc push hl loc_A0BA: ld (hl), d ; entity attr inc l djnz loc_A0BA pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop bc dec c jr nz, loc_A0B8 cond_room_row: ld a, h cp &58 ; out of screen top? ret c ; return if so loc_A0CD: ld (hl), e ; room attr inc l djnz loc_A0CD ret ; draw attrs for moving down-right attr_draw_dr: pop hl loc_A0D3: push bc push hl dec l ld (hl), e ; room attr inc l loc_A0D8: ld (hl), d inc l djnz loc_A0D8 pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop bc dec c jr nz, loc_A0D3 dec l ld (hl), e inc l jr cond_room_row ; draw attrs for moving up attr_draw_u: pop hl push bc push hl push bc ld bc, &20 ; line pitch add hl, bc ; down a row pop bc loc_A0F5: ld (hl), e ; entity attr inc l djnz loc_A0F5 pop hl pop bc jp loc_A07B ; draw attrs for moving up-left attr_draw_ul: pop hl push bc push hl push bc ld bc, &20 ; line pitch add hl, bc ; down a row pop bc inc b ; extra row loc_A108: ld (hl), e inc l djnz loc_A108 pop hl pop bc jr loc_A0A4 ; draw attrs for moving down-left attrs_draw_dl: pop hl loc_A111: push bc push hl loc_A113: ld (hl), d ; room attr inc l djnz loc_A113 ld (hl), e ; entity attr pop hl ld bc, &20 ; line pitch and a sbc hl, bc ; up a row pop bc dec c jr nz, loc_A111 inc b jp cond_room_row ; draw attrs for moving up-right attr_draw_ur: pop hl push bc push hl push bc ld bc, &20 ; line pitch add hl, bc ; down a row pop bc dec l inc b ; extra row loc_A132: ld (hl), e ; entity attr inc l djnz loc_A132 pop hl pop bc jp loc_A08E ; draw any items in player inventory draw_inventory: ld de, &2cc8 ; coords of first inventory item ld hl, inventory1 ld b, 3 ; 3 items to draw loc_A143: call draw_inv_item ; draw inventory item at position DE ld a, e add a, &10 ; next inventory position ld e, a djnz loc_A143 ret ; draw inventory item at position DE draw_inv_item: push bc push de push ix ld ix, entity_to_draw ld a, (hl) ; entity LSB inc hl or (hl) ; object in this slot? inc hl ld a, (hl) jr nz, loc_A15E ; jump if so ld a, &31 ; blank space loc_A15E: inc hl ld (ix+0), a ; set graphic ld (ix+3), e ; set xpos ld (ix+4), d ; set ypos ld a, (hl) inc hl ld (ix+5), a ; set attr push hl call clear_sprite call draw_entity ; draw entity graphic (no attrs) call set_entity_attrs ; paint entity with its current attr colour pop hl pop ix pop de pop bc ret entity_to_draw: db 0, 0, 0, 0, 0, 0, 0, 0 clear_sprite: ld l, (ix+3) ld h, (ix+4) call xy_to_display ; convert coords in HL to display address in HL ld b, &14 ; 20 pixels high loc_A190: ld (hl), 0 ; clear 2 bytes wide inc l ld (hl), 0 dec l call pixel_line_up ; move up 1 display line in HL djnz loc_A190 ret ; add BC to current score add_score_bc_bcd: ld hl, score_bcd+2 ; end of score is 1s ld a, (hl) add a, c ; add 10s and 1s daa ld (hl), a dec hl ld a, (hl) adc a, b ; add 1000s and 100s daa ld (hl), a dec hl ld a, (hl) adc a, 0 ; carry 10000s daa ld (hl), a loc_A1AE: ld hl, digit_charset ld (charset_addr), hl ld hl, display+&10c8 ; print player score at position HL print_score: call xy_to_display ; convert coords in HL to display address in HL ld de, score_bcd ld b, 3 ; 3 bytes = 6 digits print_bcd_bytes: ld a, (de) ; print B BCD bytes at DE rrca rrca rrca rrca and &0f call print_char ; print a single character ; print a single BCD digit print_bcd_digit: ld a, (de) and &0f call print_char ; print a single character inc de djnz print_bcd_bytes ; print B BCD bytes at DE ret ; print a single character print_char: push bc push de push hl ld l, a ld h, 0 add hl, hl add hl, hl add hl, hl ld de, (charset_addr) add hl, de ex de, hl pop hl ld b, 8 ; 8 lines in character cell loc_A1E5: ld a, (de) ld (hl), a inc de ; next source byte inc h ; next pixel line djnz loc_A1E5 pop de pop bc ld a, h sub 8 ; back to start address ld h, a inc l ; next position to the right ret ; show a line of text, first byte is attr colour_text: push hl call xy_to_display ; convert coords in HL to display address in HL ld a, (de) ; text attr colour ex af, af' inc de exx ; display addr in HL pop hl call xy_to_attr ; convert pixel coords in HL to attribute address loc_A1FF: exx ; attr addr in HL' ld a, (de) bit 7, a ; last character? jr nz, loc_A210 ; jump if so call print_char ; print a single character inc de exx ex af, af' ld (hl), a ; set attr inc l ex af, af' jr loc_A1FF loc_A210: and &7f ; strip end marker b7 call print_char ; print a single character exx ex af, af' ld (hl), a ; set attr ret ; draw side panel background scroll draw_side_panel: ld hl, panel_chars ld (charset_addr), hl ld hl, &c0 ld de, panel_data ld bc, &0818 ; 8x24 loc_A228: push bc push hl call xy_to_display ; convert coords in HL to display address in HL loc_A22D: ld a, (de) inc de call print_char ; print a single character djnz loc_A22D pop hl ld a, h add a, 8 ld h, a pop bc dec c jr nz, loc_A228 jp loc_A1AE ; draw side-panel colours, which follow room colour draw_panel_attrs: ld hl, &c0 call xy_to_attr ; convert pixel coords in HL to attribute address ld bc, &0818 ; 8x24 ld a, (room_attr) cpl ; invert for colour contrast and 7 cp 2 jr nc, loc_A255 ; red or brighter? ld a, &44 ; change blue to bright green loc_A255: ld e, a ; save attr value push de loc_A257: push bc push hl loc_A259: ld (hl), e ; set panel attr inc l djnz loc_A259 pop hl ld bc, &20 ; line pitch add hl, bc ; down a row pop bc dec c jr nz, loc_A257 ld hl, &90c8 call xy_to_attr ; convert pixel coords in HL to attribute address ld a, (room_attr) ld bc, &0303 ; 3x3 (rosette body) call fill_bc_hl_a ; fill C rows of B columns of value A at address HL inc l ld (hl), a add hl, de ld bc, &0202 ; 2x2 (rosette tail) call fill_bc_hl_a ; fill C rows of B columns of value A at address HL ld hl, &98d0 call xy_to_attr ; convert pixel coords in HL to attribute address pop de ld (hl), e ; rosette centre ld hl, loc_7DC8 call xy_to_attr ; convert pixel coords in HL to attribute address ld bc, &0603 ; 6x3 ld a, &47 ; bright white (lives) call fill_bc_hl_a ; fill C rows of B columns of value A at address HL ld hl, &5fc8 call xy_to_attr ; convert pixel coords in HL to attribute address ld bc, &0604 ; 6x4 ld a, &46 ; bright yellow (chicken) call fill_bc_hl_a ; fill C rows of B columns of value A at address HL ld hl, &48c8 call xy_to_attr ; convert pixel coords in HL to attribute address ld bc, &0601 ; 6x1 ld a, &45 ; bright cyan (score caption) call fill_bc_hl_a ; fill C rows of B columns of value A at address HL ld bc, &0601 ; 6x1 ld a, &47 ; bright white (score) call fill_bc_hl_a ; fill C rows of B columns of value A at address HL ld hl, &38c8 call xy_to_attr ; convert pixel coords in HL to attribute address ld bc, &0601 ; 6x1 ld a, &43 ; bright magenta (time caption) call fill_bc_hl_a ; fill C rows of B columns of value A at address HL ld bc, &0601 ld a, &47 ; bright white (time) jp fill_bc_hl_a ; fill C rows of B columns of value A at address HL ; draw lives sprites in side panel draw_lives: push ix ld ix, entity_to_draw ld a, (menu_selection) rlca and &30 ; extract character type from menu or 1 ; offset to first graphic ld (ix+0), a ; character type ld (ix+5), &47 ; bright white ld hl, &8dc8 ; coords of lives in side panel ld (ix+3), l ld (ix+4), h ld a, (lives) ld c, a ; number of lives to show ld b, 3 ; up to 3 lives to draw loc_A2F2: push bc call clear_sprite ; clear lives location ld a, c and a ; life to show? jr z, loc_A2FD ; jump if not call draw_entity ; draw player character loc_A2FD: ld a, (ix+3) add a, &10 ; offset to next life position ld (ix+3), a pop bc dec c jp p, loc_A30C ld c, 0 ; min lives is zero loc_A30C: djnz loc_A2F2 ; draw remaining slots pop ix ret ; draw menu icons for controls and player acharacters draw_menu_icons: ld ix, entity_to_draw ld hl, menu_entities ; entities for icons in the menu position ld b, 9 ; 3*2 icons for controls, 3 player characters loc_A31A: push bc ld de, entity_to_draw ld bc, 8 ldir push hl push de call draw_entity ; draw entity graphic (no attrs) call set_entity_attrs ; paint entity with its current attr colour pop de pop hl pop bc djnz loc_A31A ret menu_entities: db &32, 0, 0, &20, &4f, &46, 0, 0 ; cursor (left) db &33, 0, 0, &30, &4f, &46, 0, 0 ; cursor (right) db &4a, 0, 0, &20, &37, &44, 0, 0 ; kempston (left) db &4b, 0, 0, &30, &37, &44, 0, 0 ; kempston (right) db &48, 0, 0, &20, &1c, &43, 0, 0 ; keyboard (left) db &49, 0, 0, &30, &1c, &43, 0, 0 ; keyboard (right) db 1, 0, 0, &28, &67, &47, 0, 0 ; knight (facing left) db &11, 0, 0, &28, &7f, &47, 0, 0 ; wizard (facing left) db &21, 0, 0, &28, &97, &47, 0, 0 ; serf (facing left) ; determine Bresenham line slope step line_slope: ld l, h ld h, 0 exx ld hl, 0 ld b, 8 loc_A382: exx sla l rl h push hl and a sbc hl, de jr c, loc_A399 pop af exx add hl, hl inc hl loc_A391: djnz loc_A382 push hl exx ld e, l ld d, h pop hl ret loc_A399: pop hl exx add hl, hl jr loc_A391 ; HL = -DE minus_de: push de ex de, hl ld hl, 0 and a sbc hl, de pop de ret click: ld c, 1 ; length 1 for a short click beep: ld a, &10 ; freq B (low is higher), length C out (&fe), a push bc loc_A3AF: djnz $ pop bc push bc xor a out (&fe), a loc_A3B6: djnz $ pop bc dec c jr nz, beep ; freq B (low is higher), length C ret inventory_sound: ld bc, &4040 jr beep ; freq B (low is higher), length C drop_sound: ld bc, &2080 ; long high beep jr beep ; freq B (low is higher), length C ; play walk clicks if due walk_sound: ld hl, walk_counter inc (hl) ld a, (hl) bit 1, a ; low click time? jr z, walk_low ; jump if so and 1 ; click this frame? ret z ; return if not ld bc, &4004 ; high beep jr beep ; freq B (low is higher), length C walk_low: and 1 ; click this frame? ret z ; return if not ld bc, &6004 ; low beep jr beep ; freq B (low is higher), length C start_beep: ld bc, &8060 ; long low beep jr beep ; freq B (low is higher), length C ; play monster touched sound touching_sound: ld bc, &6410 queue_sound: ld hl, sound ld (hl), b ; blank graphic with required sound handler (64 or 65) inc hl ld (hl), c ; effect counter ret ; play next note of sound effect h_sound_effect: dec (ix+1) ; hit sound counter jr z, clear_sound ld a, (ix+1) ; also used for freq and length ld c, a xor &43 ld b, a jp beep ; freq B (low is higher), length C clear_sound: ld (ix+0), 0 ret ; room entry sound effect entry_sound: ld bc, &650a jr queue_sound ; play next note of sound effect h_sound_effect2: dec (ix+1) ; effect counter jr z, clear_sound ld a, (ix+1) ; also used for freq and length ld c, a rlca rlca rlca cpl xor &40 ld b, a jp beep ; freq B (low is higher), length C ; play axe throw sound axe_sound: ld d, &0c loc_A41D: ld a, d rrca ld b, a ; set freq call click dec d jr nz, loc_A41D ret ; play sword throw sound sword_sound: ld d, &10 loc_A429: ld a, d rlca rlca xor 7 rlca rlca ld b, a ; set freq call click dec d jr nz, loc_A429 ret ; play fireball throw sound fireball_sound: ld d, 8 loc_A43A: ld a, d cpl rlca ld b, a ; set freq call click dec d jr nz, loc_A43A ret ; weapon disappearing sound weapon_pop: ld a, (num_creatures) ; number of creatures processed this frame inc a rlca rlca rlca rlca ; * 16 or &0f ; + 15 and &7f ; 7-bit ld d, a loc_A452: ld a, d xor &20 ld b, a call click dec d ret z dec d ret z jr loc_A452 appear_sound: ld a, (ix+6) ; player appearance sound cpl rlca and &3f or &40 ld b, a ld c, &10 jp beep ; freq B (low is higher), length C door_sound: ld bc, &0830 ; 48 bytes * 8 bits to output ld hl, 0 ; ROM start loc_A474: ld e, (hl) ; read ROM byte for white noise inc hl push bc loc_A477: rrc e ; rotate to use &0eac bit of the byte ld a, e and &10 ; keep speaker bit out (&fe), a ; click djnz loc_A477 ; loop for &0eac bit in the byte pop bc dec c ; done all bytes? jr nz, loc_A474 ; jump back if not ret eat_sound: ld bc, &a010 ; A0 is blank graphic with food-eaten handler (below) jp queue_sound ; eaten food sound effect handler h_food_eaten: dec (ix+1) jp m, clear_sound ld c, (ix+1) ld b, 0 ld hl, eat_tone_table add hl, bc ld b, (hl) ld c, 8 ; duration jp beep ; freq B (low is higher), length C eat_tone_table: db &80, &90, &80, &90, &80, &90, &80, &90 db &80, &70, &60, &50, &40, &30, &20, &10 ; weapon bounce sound bounce_sound: ld d, &40 dec d ret z ld a, d rrca rrca rrca ld b, a ld c, 4 jp beep ; freq B (low is higher), length C sprite_table: dw g_knight_left1, g_knight_left2, g_knight_left3, g_knight_left2; 0 dw g_knight_right1, g_knight_right2, g_knight_right3, g_knight_right2; 4 dw g_knight_up1, g_knight_up2, g_knight_up3, g_knight_up2; 8 dw g_knight_down1, g_knight_down2, g_knight_down3, g_knight_down2; &0c dw g_wizard_left1, g_wizard_left2, g_wizard_left3, g_wizard_left2; &10 dw g_wizard_right1, g_wizard_right2, g_wizard_right3, g_wizard_right2; &14 dw g_wizard_up1, g_wizard_up2, g_wizard_up3, g_wizard_up2; &18 dw g_wizard_down1, g_wizard_down2, g_wizard_down3, g_wizard_down2; &1c dw g_serf_left1, g_serf_left2, g_serf_left3, g_serf_left2; &20 dw g_serf_right1, g_serf_right2, g_serf_right3, g_serf_right2; &24 dw g_serf_up1, g_serf_up2, g_serf_up3, g_serf_up2; &28 dw g_serf_down1, g_serf_down2, g_serf_down3, g_serf_down2; &2c dw g_blank, g_cursor_l, g_cursor_r, g_fireball1; &30 dw g_fireball2, g_fireball2, g_fireball3, g_sword1; &34 dw g_sword2, g_sword3, g_sword4, g_sword5; &38 dw g_sword6, g_sword7, g_sword8, g_axe1; &3c dw g_axe2, g_axe3, g_axe4, g_axe5; &40 dw g_axe6, g_axe7, g_axe8, g_keyboard_l; &44 dw g_keyboard_r, g_kempston_l, g_kempston_r, g_pumpkin1; &48 dw g_pumpkin2, g_ghostlet1, g_ghostlet2, g_can; &4c dw g_candy, g_chop, g_lollipop, g_icecream; &50 dw g_dessert, g_apple, g_bottle, g_sparkle1; &54 dw g_sparkle2, g_sparkle3, g_sparkle4, g_spider1; &58 dw g_spider2, g_spikey1, g_spikey2, g_blob1; &5c dw g_blob2, g_ghoul1, g_ghoul2, g_none; &60 dw g_none, g_none, g_none, g_ghost1; &64 dw g_ghost2, g_bat1, g_bat2, g_pop1; &68 dw g_pop2, g_pop3, g_pop4, g_mummy1; &6c dw g_mummy2, g_mummy3, g_mummy2, g_franken1; &70 dw g_franken2, g_franken3, g_franken2, g_devil1; &74 dw g_devil2, g_devil3, g_devil2, g_dracula1; &78 dw g_dracula2, g_dracula3, g_dracula2, g_leaf; &7c dw g_key, g_wine, g_coin, g_wing; &80 dw g_whip, g_frogsleg, g_gem, g_moneybag; &84 dw g_skull, g_crucifix, g_spanner, g_acg_key1; &88 dw g_acg_key2, g_acg_key3, g_tombstone, g_witch_l1; &8c dw g_witch_l2, g_witch_r1, g_witch_r2, g_monk_l1; &90 dw g_monk_l2, g_monk_r1, g_monk_r2, g_bat_l1; &94 dw g_bat_l2, g_bat_r1, g_bat_r2, g_hunchback1; &98 dw g_hunchback2, g_hunchback3, g_hunchback2, g_none; &9c dw g_mushroom ; &a0 gfx_data: dw g_cave_door_frame dw g_door_frame dw g_bigdoor_frame dw g_none dw g_none dw g_none dw g_none dw g_door_locked dw g_door_locked dw g_door_locked dw g_door_locked dw g_cave_locked dw g_cave_locked dw g_cave_locked dw g_cave_locked dw g_clock dw g_ghost_picture dw g_table dw g_chicken_full chicken_empty_addr:dw g_chicken_empty dw g_wall_antlers dw g_wall_trophy dw g_bookcase dw g_trap_closed dw g_trap_open dw g_barrel dw g_rug dw g_acg_shield dw g_wall_shield dw g_suit_armour dw g_none dw g_door_shut dw g_door_frame dw g_cave_door_shut dw g_cave_door_frame dw g_acg_door dw g_pumpkin_picture dw g_skeleton dw g_barrel_stack gfx_attrs: dw a_cave_door_frame dw a_door_frame dw a_bigdoor_frame dw g_none dw g_none dw g_none dw g_none dw a_red_locked dw a_green_locked dw a_cyan_locked dw a_yellow_locked dw a_red_cave_locked dw a_green_cave_locked dw a_cyan_cave_locked dw a_yellow_cave_locked dw a_clock dw a_ghost_picture dw a_table dw g_none ; full chicken attrs handled separately dw g_none ; empty chicken attrs handled separately dw a_wall_antlers dw a_wall_trophy dw a_bookcase dw a_trap_closed dw a_trap_open dw a_barrel dw a_rug dw a_acg_shield dw a_wall_shield dw a_suit_armour dw g_none dw a_door_shut dw a_door_frame dw a_cave_door_shut dw a_cave_door_frame dw a_acg_door dw a_pumpkin_picture dw a_skeleton dw a_barrel_stack g_door_locked: db 4, &18 db &ff, &1b, &30, &ff db &1f, &1b, &30, &f8 db 2, &1b, &30, &40 db &3e, &1b, &30, &7c db &7f, &33, &18, &3e db 7, &33, &18, &20 db &f8, &33, &18, &1f db &f8, &33, 0, &1f db 8, &63, 7, 8 db &f0, &63, &17, &0f db &f0, &63, &19, &0f db &1e, &63, &0e, 8 db &fe, &c3, 0, &1f db &f8, &c3, 6, &1f db &cc, &c3, 6, &33 db &3e, &c3, 6, &7c db &7d, &80, 1, &be db &3b, &f0, &0f, &dc db &17, &bf, &fd, &e8 db 7, &7b, &de, &e0 db 3, &7b, &de, &c0 db 0, &77, &ee, 0 db 0, 7, &e0, 0 db 0, 0, 0, 0 a_red_locked: db 4, 3 db &43, &42, &42, &43 db &43, &42, &46, &43 db &43, &43, &43, &43 a_green_locked: db 4, 3 db &43, &44, &44, &43 db &43, &44, &46, &43 db &43, &43, &43, &43 a_cyan_locked: db 4, 3 db &43, &45, &45, &43 db &43, &45, &46, &43 db &43, &43, &43, &43 a_yellow_locked:db 4, 3 db &43, &46, &46, &43 db &43, &46, &43, &43 db &43, &43, &43, &43 a_red_cave_locked:db 4, 3 db &ff, &42, &42, &ff db &ff, &42, &46, &ff db &ff, &ff, &ff, &ff a_green_cave_locked:db 4, 3 db &ff, &44, &44, &ff db &ff, &44, &46, &ff db &ff, &ff, &ff, &ff a_cyan_cave_locked:db 4, 3 db &ff, &45, &45, &ff db &ff, &45, &46, &ff db &ff, &ff, &ff, &ff a_yellow_cave_locked:db 4, 3 db &ff, &46, &46, &ff db &ff, &46, &43, &ff db &ff, &ff, &ff, &ff g_door_frame: db 4, &18 db &ff, 0, 0, &ff db &1f, 0, 0, &f8 db 2, 0, 0, &40 db &3e, 0, 0, &7c db &7c, 0, 0, &3e db 4, 0, 0, &20 db &f8, 0, 0, &1f db &f8, 0, 0, &1f db 8, 0, 0, 8 db &f0, 0, 0, &0f db &f0, 0, 0, &0f db &10, 0, 0, 8 db &f0, 0, 0, &1f db &f8, 0, 0, &1f db &cc, 0, 0, &33 db &3e, 0, 0, &7c db &7d, &80, 1, &be db &3b, &f0, &0f, &dc db &17, &bf, &fd, &e8 db 7, &7b, &de, &e0 db 3, &7b, &de, &c0 db 0, &77, &ee, 0 db 0, 7, &e0, 0 db 0, 0, 0, 0 a_door_frame: db 4, 3 db &43, 0, 0, &43 db &43, 0, 0, &43 db &43, &43, &43, &43 a_cave_door_frame:db 4, 3 db &ff, &ff, &ff, &ff db &ff, &ff, &ff, &ff db &ff, &ff, &ff, &ff g_table: db 4, &16 db &60, 0, 0, 6 db &70, 0, 0, &0e db &30, 0, 0, &0c db &30, 0, 0, &0c db &70, 0, 0, &0e db &70, 0, 0, &0e db &78, 0, 0, &1e db &3f, &ff, &ff, &fc db &7f, &ff, &ff, &fe db &80, 0, 0, 1 db &7f, &ff, &ff, &fe db &ff, &ff, &ff, &ff db &ff, &ff, &ff, &ff db &ff, &ff, &ff, &ff db &7f, &ff, &ff, &fe db &7f, &ff, &ff, &fe db &7f, &ff, &ff, &fe db &3f, &ff, &ff, &fc db &3f, &ff, &ff, &fc db &1f, &ff, &ff, &f8 db &1f, &ff, &ff, &f8 db &0f, &ff, &ff, &f0 a_table: db 4, 3 db &45, &45, &45, &45 db &42, &42, &42, &42 db &42, &42, &42, &42 room_attrs: dw &42, &0243, &0344, &0245, &0446, &0247, &0346, &0245; 0 dw &0444, &43, &0342, &0343, &0344, &45, &0446, &0447; 8 ; room attr colour and style (0-B) dw &0446, &0445, &0444, &43, &0342, &0343, &0344, &45; 16 dw &0446, &0347, &0546, &45, &0844, &0143, &0442, &0243; 24 dw &0344, &0245, &0446, &0247, &0346, &0245, &0544, &43; 32 dw &0442, &43, &0344, &45, &0446, &47, &0346, &0545; 40 dw &0144, &0a43, &0a42, &0143, &0a44, &0145, &0946, &0947; 48 dw &0146, &0145, &0144, &0143, &0142, &0143, &0144, &0945; 56 dw &0146, &0147, &0a46, &0145, &0944, &0143, &0142, &0943; 64 dw &0145, &0a45, &0946, &0147, &0146, &0a45, &0144, &0943; 72 dw &0142, &0a43, &0944, &0145, &0146, &0147, &46, &45; 80 dw &44, &43, &42, &47, &43, &44, &45, &46; 88 dw &47, &46, &45, &44, &43, &42, &43, &44; 96 dw &45, &46, &47, &46, &45, &44, &43, &0442; 104 dw &43, &0544, &0545, &0346, &0147, &46, &45, &0344; 112 dw &43, &0442, &43, &0344, &45, &0446, &47, &46; 120 dw &45, &44, &43, &42, &43, &44, &45, &46; 128 dw &47, &46, &45, &0444, &0443, &0442, &0b47, &0143; 136 dw &0144, &0145, &0146, &0147, &0146, 0, &0c00; 144 room_styles: db &38 ; style 0 = plain square db &38 dw points_square dw lines_rect db &28 ; style 1 = cave square db &28 dw points_cav_square dw lines_cav_square db &38 ; style 2 = octagonal square db &38 dw points_2 dw line_octagon db &38 ; style 3 = wide rectangle db &18 dw points_wide dw lines_rect db &18 ; style 4 = tall rectangle db &38 dw points_tall dw lines_rect db &10 ; style 5 = stairs high@bottom db &30 dw stair_points_b dw stair_lines db &10 ; style 6 = stairs high@top db &30 dw stair_points_t dw stair_lines db &30 ; style 7 = stairs high@right db &10 dw stair_points_r dw stair_lines db &30 ; style 8 = stairs high@left db &10 dw stair_points_l dw stair_lines db &30 ; style 9 = wide cave db &18 dw points_cav_wide dw lines_cav_long db &18 ; style 10 = tall cave db &30 dw points_cav_tall dw lines_cav_long db &38 ; style 11 = final room db &38 dw points_final dw lines_final db &38 ; style 12 = trapdoor tunnel db &38 dw points_trap dw lines_trap points_final: db 4, &bf db 4, 0 db &1f, &bf db &1f, 0 lines_final: db 0, 1, &ff db 2, 3, &ff db &ff points_square: db 4, &bb db 4, 4 db &bb, 4 db &bb, &bb db &1f, &a0 db &1f, &1f db &a0, &1f db &a0, &a0 lines_rect: db 0, 1, 3, 4, &ff db 2, 1, 3, 6, &ff db 5, 1, 4, 6, &ff db 7, 3, 4, 6, &ff db &ff points_cav_square:db &93, 5 db &24, &7d db &25, &7d db 2, &8e db &11, &ad db &26, &b7 db &46, &ad db &4f, &90 db &3b, &96 db &2e, &90 db &79, &ad db &70, &90 db &8c, &b9 db &97, &b4 db &7a, &96 db &81, &93 db &8a, &99 db &82, &94 db &97, &85 db &a2, &bf db &b9, &9c db &b8, &9b db &ad, &79 db &ae, &79 db &91, &71 db &90, &70 db &90, &4f db &ad, &46 db &28, &72 db &2f, &70 db &12, &79 db &11, &78 db &0a, &74 db &12, &46 db &2f, &4f db &26, &3c db &2f, &3c db 5, &2c db &17, &2c db &2f, &2b db &17, &13 db &37, &24 db &38, &25 db &24, 2 db &23, 1 db &46, &12 db &4f, &2f db &79, &12 db &70, &2f db &83, &26 db &83, &2f db &94, &2f db &9c, &37 db &9b, &38 db &be, &23 db &bf, &24 db &ac, &17 db &93, &17 lines_cav_square:db 0, &2f, &31, &39, &ff db 1, &ff db 2, &ff db 3, 1, 4, &20, &ff db 4, &ff db 5, 6, 8, 4, &ff db 6, &ff db 7, 6, 8, &0b, &ff db 8, &ff db 9, 8, 4, 2, &ff db &0a, &0c, &0b, 6, &ff db &0b, &ff db &0c, &ff db &0d, &13, &0c, &11, &ff db &0e, &0f, &0c, &0b, &ff db &0f, &ff db &10, &ff db &11, &10, &ff, &12, &15, &18, &10, &ff db &13, &10, &ff db &14, &17, &13, &ff db &15, &ff db &16, &19, &ff db &17, &ff db &18, &ff db &19, &ff db &1a, &19, &35, &ff db &1b, &1a, &36, &16, &ff db &1c, 2, &1d, &1e, &ff db &1d, &ff db &1e, &ff db &1f, &ff db &20, &1f, &ff db &21, &1e, &22, &25, &ff db &22, &1d, &ff db &23, &22, &24, &25, &ff db &24, &ff db &25, &ff db &26, &24, &25, &28, &ff db &27, &24, &29, &28, &ff db &28, &ff db &29, &ff db &2a, &ff db &2b, &29, &ff db &2c, &28, &2d, &ff db &2d, &ff db &2e, &2a, &2d, &ff db &2f, &2d, &30, &ff db &30, &31, &2e, &ff db &31, &ff db &32, &31, &33, &39, &ff db &33, &ff db &34, &33, &36, &ff db &35, &ff db &36, &ff db &37, &ff db &38, &33, &37, &39, &ff db &39, &ff db &ff points_2: db 2, &a3 db 2, &1c db &1c, 2 db &a3, 2 db &bd, &1c db &bd, &a3 db &a3, &bd db &1c, &bd db &30, &a0 db &1f, &8f db &1f, &30 db &30, &1f db &8f, &1f db &a0, &30 db &a0, &8f db &8f, &a0 line_octagon: db 0, 9, 7, 1, &ff db 2, 1, 3, &0b, &ff db 4, 3, 5, &0d, &ff db 6, 5, &0f, 7, &ff db 8, 7, 9, &0f, &ff db &0a, 1, 9, &0b, &ff db &0c, 3, &0b, &0d, &ff db &0e, 5, &0d, &0f, &ff db &ff points_wide: db 3, &9c db 3, &23 db &bc, &23 db &bc, &9c db &1f, &80 db &1f, &3f db &a0, &3f db &a0, &80 points_tall: db &23, 3 db &9c, 3 db &9c, &bc db &23, &bc db &3f, &1f db &80, &1f db &80, &a0 db &3f, &a0 stair_points_t: db &8a, &ba db 8, 4 db &35, &bb db &8a, &bb db &b7, 4 db &38, &28 db &38, &3d db &3d, &3d db &3d, &51 db &41, &51 db &41, &63 db &45, &63 db &45, &73 db &48, &73 db &48, &81 db &4b, &81 db &4b, &8d db &4e, &8d db &4e, &97 db &50, &97 db &50, &9f db &6f, &9f db &6f, &97 db &71, &97 db &71, &8d db &74, &8d db &74, &81 db &77, &81 db &77, &73 db &7a, &73 db &7a, &63 db &7e, &63 db &7e, &51 db &82, &51 db &82, &3d db &87, &3d db &87, &28 db &35, &ba stair_lines: db 1, &ff db 2, 3, 1, &ff db 3, &ff db 4, 1, 3, &ff db 5, 1, &ff db 6, &23, 5, &ff db 7, &ff db 8, &21, 7, &ff db 9, &ff db &0a, &1f, 9, &ff db &0b, &ff db &0c, &1d, &0b, &ff db &0d, &ff db &0e, &1b, &0d, &ff db &0f, &ff db &10, &19, &0f, &ff db &11, &ff db &12, &17, &11, 2, &ff db &17, 3, &ff db &18, &17, &ff db &19, &ff db &1a, &19, &ff db &1b, &ff db &1c, &1b, &ff db &1d, &ff db &1e, &1d, &ff db &1f, &ff db &20, &1f, &ff db &21, &ff db &22, &21, &ff db &23, &ff db &24, 4, 5, &23, &ff db &25, &ff db &ff stair_points_b: db &8a, 5 db 8, &bb db &38, 4 db &8a, 4 db &b7, &bb db &38, &97 db &38, &82 db &3d, &82 db &3d, &6e db &41, &6e db &41, &5c db &45, &5c db &45, &4c db &48, &4c db &48, &3e db &4b, &3e db &4b, &32 db &4e, &32 db &4e, &28 db &50, &28 db &50, &20 db &6f, &20 db &6f, &28 db &71, &28 db &71, &32 db &74, &32 db &74, &3e db &77, &3e db &77, &4c db &7a, &4c db &7a, &5c db &7e, &5c db &7e, &6e db &82, &6e db &82, &82 db &87, &82 db &87, &97 db &35, 5 stair_points_r: db 5, &8a db &bb, 8 db 4, &38 db 4, &8a db &bb, &b7 db &97, &38 db &82, &38 db &82, &3d db &64, &3d db &6e, &41 db &5c, &41 db &5c, &45 db &4c, &45 db &4c, &48 db &3e, &48 db &3e, &4b db &32, &4b db &32, &4e db &28, &4e db &28, &50 db &20, &50 db &20, &6f db &28, &6f db &28, &71 db &32, &71 db &32, &74 db &3e, &74 db &3e, &77 db &4c, &77 db &4c, &7a db &5c, &7a db &5c, &7e db &6e, &7e db &6e, &82 db &82, &82 db &82, &87 db &97, &87 db 5, &35 stair_points_l: db &ba, &8a db 4, 8 db &bb, &35 db &bb, &8a db 4, &b7 db &28, &38 db &3d, &38 db &3d, &3d db &51, &3d db &51, &41 db &63, &41 db &63, &45 db &73, &45 db &73, &48 db &81, &48 db &81, &4b db &8d, &4b db &8d, &4e db &97, &4e db &97, &50 db &9f, &50 db &9f, &6f db &97, &6f db &97, &71 db &8d, &71 db &8d, &74 db &81, &74 db &81, &77 db &73, &77 db &73, &7a db &63, &7a db &63, &7e db &51, &7e db &51, &82 db &3d, &82 db &3d, &87 db &28, &87 db &ba, &35 g_knight_down1: db &12 db &3c, 0 db &3c, &f0 db &1f, &78 db &1b, &94 db 5, &4e db &6b, &6e db &e9, &2c db &ef, &e8 db &44, &40 db &26, &c8 db &20, 8 db &30, &18 db &3f, &f8 db &13, &f0 db &13, &f0 db 9, &e0 db 5, &c0 db 2, &80 g_knight_down2: db &12 db &1e, &f0 db &0e, &e0 db 5, &40 db 3, &f0 db &65, &4c db &eb, &6e db &e9, &2e db &6f, &ec db 4, &40 db &26, &c8 db &20, 8 db &30, &18 db &3f, &f8 db &13, &f0 db &13, &f0 db 9, &e0 db 5, &c0 db 2, &80 g_knight_down3: db &12 db 0, &78 db &1e, &78 db &3d, &f0 db &53, &b0 db &e5, &40 db &eb, &6c db &69, &2e db &2f, &ee db 4, &44 db &26, &c8 db &20, 8 db &30, &18 db &3f, &f8 db &13, &f0 db &13, &f0 db 9, &e0 db 5, &c0 db 2, &80 g_knight_up1: db &12 db &3c, 0 db &3c, &f0 db &1f, &78 db &1b, &94 db 7, &ce db &6f, &ee db &ef, &ec db &ef, &e8 db &40, 0 db &3f, &f8 db &27, &f8 db &27, &f8 db &30, &38 db &13, &f0 db &13, &f0 db 9, &e0 db 5, &c0 db 2, &80 g_knight_up2: db &12 db &1e, &f0 db &0e, &e0 db 5, &40 db 3, &80 db &67, &cc db &ef, &ee db &ef, &ee db &6f, &ec db 0, 0 db &3f, &f8 db &27, &f8 db &27, &f8 db &30, &38 db &13, &f0 db &13, &f0 db 9, &e0 db 5, &c0 db 2, &80 g_knight_up3: db &12 db 0, &78 db &1e, &78 db &3d, &f0 db &53, &b0 db &e7, &c0 db &ef, &ec db &6f, &ee db &2f, &ee db 0, 4 db &3f, &f8 db &27, &f8 db &27, &f8 db &30, &38 db &13, &f0 db &13, &f0 db 9, &e0 db 5, &c0 db 2, &80 g_knight_left1: db &12 db &0c, &70 db &1c, &38 db &3b, &98 db &37, &60 db 6, &10 db &37, 8 db &27, &98 db &1f, &f0 db &67, &80 db &6b, &7c db &1a, &fc db 1, &fc db &1f, &fc db 8, 8 db 9, &f8 db 4, &f0 db 2, &e0 db 1, &40 g_knight_left2: db &12 db 7, &c0 db 3, &c0 db 0, 0 db 3, &f0 db 6, &38 db 4, &18 db &0f, &98 db &1f, &f0 db &67, &80 db &6b, &7c db &1a, &fc db 1, &fc db &1f, &fc db 8, 8 db 9, &f8 db 4, &f0 db 2, &e0 db 1, &40 g_knight_left3: db &12 db &0c, &70 db &1c, &38 db &3b, &d8 db &37, &e0 db 4, &74 db 8, &3a db 7, &1e db &1f, &f8 db &67, &80 db &6b, &7c db &1a, &fc db 1, &fc db &1f, &fc db 8, 8 db 9, &f8 db 4, &f0 db 2, &e0 db 1, &40 g_knight_right1:db &12 db &0e, &30 db &1c, &38 db &1b, &dc db 7, &ec db &2e, &20 db &5c, &10 db &78, &e0 db &1f, &f8 db 1, &e6 db &3e, &d6 db &27, &58 db &27, &80 db &27, &f8 db &10, &30 db &13, &f0 db 9, &e0 db 5, &c0 db 2, &80 g_knight_right2:db &12 db 3, &e0 db 3, &c0 db 0, 0 db &0f, &c0 db &1c, &60 db &18, &20 db &19, &f0 db &0f, &f8 db 1, &e6 db &3e, &d6 db &27, &58 db &27, &80 db &27, &f8 db &10, &30 db &13, &f0 db 9, &e0 db 5, &c0 db 2, &80 g_knight_right3:db &12 db &0e, &30 db &1c, &38 db &18, &dc db 6, &ec db 8, &60 db &10, &ec db &19, &e4 db &0f, &f8 db 1, &e6 db &3e, &d6 db &27, &58 db &27, &80 db &27, &f8 db &10, &30 db &13, &f0 db 9, &e0 db 5, &c0 db 2, &80 g_none: db 0 db 0 g_blank: db &10 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 g_leaf: db &10 db 0, 3 db 0, &3f db 0, &fa db 3, &f2 db 6, &0a db &0f, &da db &1f, &bc db &3f, &3c db &20, &b8 db &7d, &b8 db &7b, &b0 db &f3, &a0 db &9b, &c0 db &db, &80 db &de, 0 db &f8, 0 g_key: db &0a db &0c, 0 db &1e, &17 db &12, &12 db &7b, &1a db &cf, &ff db &cf, &ff db &7b, 0 db &12, 0 db &1e, 0 db &0c, 0 g_wine: db &14 db &19, &fc db &19, &fc db &19, &c0 db &19, &dc db &19, &dc db &19, &dc db &19, &dc db &19, &dc db &19, &dc db &19, &dc db &19, &c0 db &19, &fc db &1c, &fc db &0e, &f8 db 3, &60 db 1, &40 db 1, &40 db 1, &40 db 2, &e0 db 1, &c0 g_bottle: db &14 db &19, &f0 db &19, &f0 db &19, &f0 db &19, &f0 db &19, &f0 db &19, &f0 db &19, &f0 db &19, &f0 db &19, &f0 db 9, &e0 db &0d, &e0 db &0d, &e0 db 5, &c0 db 5, &c0 db 6, &c0 db 2, &80 db 2, &80 db 2, &80 db 5, &c0 db 3, &80 g_wing: db &10 db &a0, 0 db &b0, 0 db &98, 0 db &af, &80 db &d0, 0 db &df, &c0 db &6f, &e0 db &73, &f0 db &3c, &74 db &3f, &88 db &1f, &f8 db &0f, &f8 db 7, &f8 db 3, &fc db 0, &fe db 0, &1f g_whip: db &10 db &c0, 0 db &e0, 2 db &e0, &0c db 0, &30 db &c0, &30 db &e0, &40 db &e0, &c0 db &40, &80 db 0, &30 db &e0, &36 db &70, 6 db &70, 3 db &2c, &1e db &1e, &ec db &0e, &e0 db 4, &60 g_frogsleg: db &10 db &90, 8 db &b1, &0e db &f6, &1e db &7c, &37 db &78, &67 db &30, &cf db &31, &9e db &33, &3c db &32, &78 db &76, &f0 db &76, &f0 db &75, &e0 db &e7, &c0 db &3f, 0 db &3e, 0 db &18, 0 g_dessert: db &10 db 5, &e0 db 0, 0 db &33, &fc db &67, &fe db 0, 0 db &c7, &ff db &ff, &ff db 0, 0 db &6f, &fe db &67, &3e db &7b, &de db &3f, &ec db &0b, &e8 db &0c, &f0 db &0f, &80 db 7, 0 g_apple: db &10 db 3, &e0 db &0f, &f8 db &1f, &fc db &3f, &fe db &7f, &fe db &7f, &ff db &7f, &ff db &67, &ff db &63, &ff db &33, &ff db &3b, 6 db &1f, &f8 db &0e, &dc db 1, &86 db 7, &7b db 6, &3c panel_chars: db 0, 0, 0, 0, 0, 0, 0, 0 ; 0 db 0, 0, 3, &0f, &1f, &3d, &7e, &79; 8 db 0, 0, &ff, &ff, &ff, &b4, &4a, 0; &10 db 0, 0, &80, &fe, &ff, &d5, &ad, &42; &18 db 0, 0, 0, 0, &f0, &7f, &56, &50; &20 db 0, 0, 0, 0, 3, &ff, &b5, &44; &28 db 0, 0, 1, &1f, &ff, &da, &25, &41; &30 db 0, 7, &ff, &fe, &fc, &fc, &d8, &3f; &38 db 0, &f0, 8, 4, 2, 2, 2, &f1; &40 db &d0, &ca, &e0, &c0, &c0, &c0, &60, &60; &48 db &3b, &1b, &1b, &1b, &1b, &19, &0c, &0c; &50 db &89, &89, &85, &85, &fd, &81, &81, &81; &58 db &0c, 6, 3, 3, 3, 1, 1, 1 ; &60 db &41, &42, &fc, 0, 0, &80, &80, &80; &68 db &60, &30, &1c, 6, &3e, &1c, &0c, 6; &70 db &0c, &18, &18, &18, &0c, &0c, &0c, &0c; &78 db 6, 6, 6, 6, 6, 6, 6, 6 ; &80 db 6, 6, 6, 6, 6, 6, &0c, &0c; &88 db &0c, &0c, &0c, &18, &18, &18, &18, &18; &90 db &18, &30, &30, &30, &30, &30, &30, &30; &98 db &30, &60, &60, &60, &60, &60, &60, &60; &a0 db &60, &60, &60, &60, &30, &30, &30, &18; &a8 db &0c, &18, &18, &18, &30, &30, &18, &30; &b0 db &30, &38, &0c, 6, &0c, &18, &18, &18; &b8 db &0c, &0c, &0c, &0c, &0c, 6, 6, 6; &c0 db 6, 6, 6, 6, 3, 3, 3, 3 ; &c8 db 3, 3, 3, 3, 3, 3, 3, 3 ; &d0 db 3, 3, 3, 3, 3, 6, 6, 6 ; &d8 db 6, 6, 6, 6, &0c, &0c, &0c, &0c; &e0 db &0c, &18, &18, &18, &18, &30, &30, &30; &e8 db &30, &60, &60, &60, &7f, &7e, &0c, &18; &f0 db 0, 0, &0c, &1e, &1d, &0b, 7, &37; &f8 db &7f, &ff, &80, &7f, &ff, &c1, &80, 0; &0100 db 0, &80, &98, &3c, &dc, &e8, &f0, &76; &0108 db 1, 3, 3, 3, 6, 6, &0c, &7f; &0110 db &80, 0, 0, 0, 0, 0, 0, &fc; &0118 db &70, &f0, &18, &fc, &f8, &c0, &c0, &c0; &0120 db &6e, &ec, &ec, &ec, &ec, &ec, &6e, &37; &0128 db &3e, &49, &49, &49, &49, &2a, &1c, 8; &0130 db &3b, &1b, &1b, &1b, &1b, &1b, &3b, &76; &0138 db 0, &80, &80, &80, &80, &80, 0, 0; &0140 db 0, 3, 7, &0e, 7, 1, 0, 0 ; &0148 db &fd, &c3, &df, &2f, &97, &eb, &77, &31; &0150 db &c2, &c1, &81, &81, 1, &fd, 5, 5; &0158 db &c0, &60, &60, &60, &30, &18, &0f, 7; &0160 db 7, &0b, &1d, &1e, &0c, 0, 0, &ff; &0168 db &80, &c1, &ff, &7f, &80, &ff, &7f, &3e; &0170 db &f0, &e8, &dc, &3c, &9b, &9f, &7c, &e0; &0178 db 0, 0, 0, &3f, &ff, &c0, 0, 0; &0180 db 0, 0, 0, 0, &f0, &ff, &0f, 0; &0188 db &30, &3f, &30, &18, &18, &0c, &fe, &ff; &0190 db &89, &f1, 1, 1, 2, 4, 8, &f0; &0198 db &ff, 0, 0, 0, 0, 0, 0, 0 ; &01a0 db &ff, &ff, &ff, &ff, &ff, &ff, &ff, &ff; &01a8 db &ff, &ff, &7f, &7b, &7b, &39, &39, &38; &01b0 db 0, 0, &80, &80, &80, &80, &c0, &c0; &01b8 db &10, &10, &10, 0, 0, 0, 0, 0; &01c0 db &60, &20, &10, 0, 0, 0, 0, 0; &01c8 db &c0, &c0, &c0, &60, &60, &60, &30, &30; &01d0 db &30, &18, &18, &18, &18, &30, &30, &30; &01d8 db &18, &0c, &0c, &0c, &0c, &0c, &0c, &0c; &01e0 db &0c, &0c, &0c, &0c, &0c, &0c, &0c, &0c; &01e8 db &0c, &0c, &0c, &0c, &18, &18, &18, &18; &01f0 db &18, &30, &30, &30, &30, &60, &60, &60; &01f8 db &60, &60, &60, &c0, &c0, &c0, &c0, &c0; &0200 db &c0, &c0, &c0, &c0, &c0, &c0, &c0, &c0; &0208 db &60, &60, &60, &60, &60, &30, &30, &30; &0210 db &18, &18, &18, &0c, &0c, &0c, &0c, 6; &0218 db 6, 6, 6, 6, 3, 3, 3, 3 ; &0220 db 3, 3, 3, 3, 3, 3, 3, 3 ; &0228 db 6, 6, 6, 6, 6, &0c, &0c, &0c; &0230 db &0c, &18, &18, &18, &18, &30, &30, &30; &0238 db &60, &60, &60, &c0, &c0, &c0, &80, &80; &0240 db 7, &0f, &0f, 7, 1, &0f, 7, 0; &0248 db &c3, &e7, &0f, &ce, &ef, &e7, &c3, 0; &0250 db &c3, &e7, &8f, &0e, &1f, &e7, &c3, 0; &0258 db &8f, &cf, &ee, &ef, &ef, &ce, &8e, 0; &0260 db &cf, &ef, &6e, &ef, &ce, &cf, &ef, 0; &0268 db &80, &80, 0, &c0, 0, &e0, &e0, 0; &0270 db 0, 0, 8, &1e, &27, &23, &71, &5f; &0278 db 0, 0, &40, &40, &80, &80, 0, &c3; &0280 db 0, 0, 0, 0, 0, 0, 0, &16 ; &0288 db 0, 0, 0, 5, 3, 3, 3, &33 ; &0290 db 0, 0, 0, &ac, &18, &18, &18, &18; &0298 db &4f, &22, &1f, 5, &7f, &47, &3b, 0; &02a0 db &ef, &6c, &2c, &ac, &4c, &ce, &87, 0; &02a8 db &be, &18, &18, &18, &18, &9c, &0c, 0; &02b0 db &fb, &db, &db, &db, &db, &fb, &61, 0; &02b8 db &18, &18, &18, &18, &18, &de, &8c, 0; &02c0 db &fe, &fe, &fe, &38, &38, &38, &38, 0; &02c8 db &7c, &7c, &38, &38, &38, &7c, &7c, 0; &02d0 db &82, &ee, &fe, &fe, &d6, &d6, &d6, 0; &02d8 db &f8, &f8, &e0, &fc, &e0, &fe, &fe, 0; &02e0 db 0, &18, &18, 0, 0, &18, &18, 0; &02e8 panel_data: db 1, 2, 3, 4, 5, 6, 7, 8 ; 0 db 9, &4f, &50, &51, &52, &53, &0a, &0b; 8 db &0e, &54, &55, &56, &57, &58, &0c, &0d; 16 db &0f, 0, 0, 0, 0, 0, 0, &3a; 24 db &10, 0, 0, 0, 0, 0, 0, &3b; 32 db &11, 0, 0, 0, 0, 0, 0, &3c; 40 db &12, 0, 0, 0, 0, 0, 0, &3d; 48 db &13, 0, &59, &5a, &5b, &5c, 0, &3e; 56 db &14, 0, 0, 0, &5d, 0, 0, &3f; 64 db &15, &49, &4a, &4b, &4c, &4d, &4e, &40; 72 db &16, 0, 0, 0, 0, 0, 0, &41; 80 db &17, 0, 0, 0, 0, 0, 0, &42; 88 db &18, 0, 0, 0, 0, 0, 0, &43; 96 db &19, 0, 0, 0, 0, 0, 0, &44; 104 db &1a, 0, 0, 0, 0, 0, 0, &45; 112 db &1b, 0, 0, 0, 0, 0, 0, &46; 120 db &1c, 0, 0, 0, 0, 0, 0, &47; 128 db &1d, 0, 0, 0, 0, 0, 0, &48; 136 db &1e, &1f, &20, &21, 0, 0, &22, &23; 144 db &24, &25, &26, &27, &28, &29, &2a, &2b; 152 db &2c, &2d, &2e, &2f, &30, &31, &32, &33; 160 db 0, &34, &35, 0, 0, 0, 0, 0; 168 db 0, 0, &36, &37, 0, 0, 0, 0; 176 db 0, 0, &38, &39, 0, 0, 0, 0; 184 g_bigdoor_frame:db 6, &20 db &ff, &fe, 0, 0, &3f, &ff db 0, &fe, 0, 0, &7f, 0 db 1, &fc, 0, 0, &3f, &80 db 0, 0, 0, 0, 0, 0 db 1, &f8, 0, 0, &1f, &80 db 3, &f8, 0, 0, &1f, &c0 db 3, &f0, 0, 0, &0f, &c0 db 0, 0, 0, 0, 0, 0 db 7, &e0, 0, 0, 7, &e0 db &0f, &e0, 0, 0, 7, &f0 db &0f, &c0, 0, 0, 3, &f0 db 0, 0, 0, 0, 0, 0 db &1f, &80, 0, 0, 1, &f8 db &1f, &80, 0, 0, 1, &f8 db &1f, &80, 0, 0, 1, &f8 db &10, 0, 0, 0, 0, 8 db 7, &80, 0, 0, 1, &e0 db &1f, &80, 0, 0, 1, &f8 db &1f, 0, 0, 0, 0, &f8 db &0e, &40, 0, 0, 2, &70 db 8, &e0, 0, 0, 7, &10 db 3, &f4, 0, 0, &2f, &c0 db 7, &ef, 0, 0, &f7, &e0 db 3, &ce, &77, &ee, &73, &c0 db 1, &de, &f6, &6f, &7b, &80 db 0, &9e, &f6, &6f, &79, 0 db 0, &3c, &e6, &67, &3c, 0 db 0, &1d, &ee, &ee, &b8, 0 db 0, 1, &ee, &77, &80, 0 db 0, 0, 8, &10, 0, 0 db 0, 0, &0f, &f0, 0, 0 db 0, 0, 0, 0, 0, 0 a_bigdoor_frame:db 6, 4 db &43, &43, 0, 0, &43, &43 db &43, &43, 0, 0, &43, &43 db &43, &43, &43, &43, &43, &43 db &43, &43, &43, &43, &43, &43 g_ghost_picture:db 4, &18 db 0, 0, 0, 0 db 0, 0, 0, 0 db 3, &80, 1, &c0 db 7, &c6, &63, &e0 db 6, &7f, &fe, &60 db 3, &ff, &ff, &c0 db 1, &80, 1, &80 db 1, &80, 1, &80 db 3, &8c, &31, &c0 db 7, &8f, &f1, &e0 db 3, &0c, &30, &c0 db &0b, &0f, &f0, &d0 db &0f, &0c, &90, &f0 db 7, &0d, &b0, &e0 db 6, 7, &e0, &60 db &0e, 3, &c0, &70 db &1e, 0, 0, &78 db &37, &ff, &ff, &ec db &1f, &ff, &ff, &f4 db &35, &ff, &ff, &ac db &1b, &1c, &31, &d8 db &0e, 6, &60, &70 db 0, 0, 0, 0 db 0, 0, 0, 0 a_ghost_picture:db 4, 3 db &ff, &ff, &ff, &ff db &ff, &ff, &ff, &ff db &ff, &ff, &ff, &ff g_serf_down1: db &12 db &1f, &38 db &17, &38 db &0e, &3c db 1, &5e db 3, &de db &27, &ee db &77, &70 db &77, &f4 db &77, &74 db &45, &d0 db 0, &80 db &0a, &28 db &1b, &6c db 8, &0c db &1c, &14 db &17, &fc db &0d, &e8 db 7, &50 g_serf_down2: db &12 db &0f, &f8 db &0d, &68 db 6, &30 db 1, &40 db &23, &e2 db &37, &f6 db &37, &76 db &17, &f4 db &17, &74 db 5, &d0 db 0, &80 db &0a, &28 db &1b, &6c db 8, &0c db &1c, &14 db &17, &fc db &0d, &e8 db 7, &50 g_serf_down3: db &12 db 7, &7c db 7, &74 db &1f, &58 db &3d, &60 db &3d, &e0 db &3b, &f2 db 7, &77 db &17, &f7 db &17, &77 db 5, &d2 db 0, &80 db &0a, &28 db &1b, &6c db 8, &0c db &1c, &14 db &17, &fc db &0d, &e8 db 7, &a0 g_serf_up1: db &12 db &1e, &40 db &1e, &70 db &0a, &b0 db 7, &d8 db &0f, &d8 db &4f, &e8 db &ef, &e0 db &ec, &6c db &e2, &4c db &8d, &a8 db &15, &70 db &1b, &d0 db &3a, &98 db &2b, &68 db &15, &d0 db &2f, &b8 db &13, &50 db &0a, &a0 g_serf_up2: db &12 db &0e, &e0 db &0e, &e0 db 2, &80 db 7, &c0 db &47, &c4 db &6f, &ec db &6f, &ec db &2c, &68 db &23, &88 db &0d, &a0 db &15, &70 db &1b, &d0 db &3a, &98 db &2b, &68 db &15, &d0 db &2f, &b8 db &13, &50 db &0a, &a0 g_serf_up3: db &12 db 4, &f0 db &1c, &f0 db &1a, &a0 db &37, &c0 db &37, &e0 db &2f, &e4 db &0f, &ee db &6c, &3e db &63, &8e db &2d, &a2 db &15, &70 db &1b, &d0 db &3a, &98 db &2b, &68 db &15, &d0 db &2f, &b8 db &13, &50 db &0a, &a0 g_serf_left1: db &12 db 3, &70 db &0f, &78 db &3f, &1c db &fb, &ec db &cb, &10 db &77, &88 db 7, &c8 db &37, &88 db &77, &30 db &0f, &c0 db &11, &50 db &60, &b8 db &68, &68 db &19, &d0 db 7, &a8 db &19, &58 db &16, &f0 db &0a, &a0 g_serf_left2: db &12 db &3f, &e0 db &2f, &e0 db &24, &c0 db &19, &e0 db 3, &f0 db 6, &38 db 6, &18 db 7, &18 db 7, &30 db &0f, &c0 db &11, &50 db &60, &b8 db &68, &68 db &19, &d0 db 7, &a8 db &19, &58 db &16, &f0 db &0a, &a0 g_serf_left3: db &12 db 3, &f0 db &3a, &f8 db &5a, &5c db &4d, &9c db &30, &30 db 7, &f8 db 8, &7a db &18, &1a db 7, &3c db &0f, &c0 db &11, &50 db &60, &b8 db &68, &68 db &19, &d0 db 7, &a8 db &19, &58 db &16, &f0 db &0a, &a0 g_serf_right1: db &12 db &0f, &c0 db &1f, &5c db &3a, &5a db &39, &b2 db &0c, &0c db &1f, &e0 db &5e, &10 db &58, &18 db &3c, &e0 db 3, &f0 db 5, &88 db &1d, 6 db &16, &16 db &0b, &98 db &15, &e0 db &1a, &98 db &0f, &e8 db 5, &50 g_serf_right2: db &12 db 7, &fc db 7, &f4 db 3, &24 db 7, &98 db &0f, &c0 db &1c, &60 db &18, &60 db &18, &e0 db &0c, &e0 db 3, &f0 db 5, &88 db &1d, 6 db &16, &16 db &0b, &98 db &15, &e0 db &1a, &98 db &0f, &e8 db 5, &50 g_serf_right3: db &12 db &0e, &c0 db &1e, &f0 db &31, &fc db &37, &df db 8, &d3 db &11, &ee db &13, &e0 db &11, &ec db &0c, &ee db 3, &f0 db 5, &88 db &1d, 6 db &16, &16 db &0b, &98 db &15, &e0 db &1a, &98 db &0f, &e8 db 5, &50 g_clock: db 4, &20 db 0, &3f, &fc, 0 db 0, &70, &0e, 0 db 0, &77, &ee, 0 db 0, &67, &e6, 0 db 0, &67, &e6, 0 db 0, &6b, &f6, 0 db 0, &e8, &f7, 0 db 0, &cf, &f3, 0 db 0, &df, &fb, 0 db 0, &df, &fb, 0 db 0, &c0, 3, 0 db 0, &ff, &ff, 0 db 0, &ff, &ff, 0 db 1, &f9, &9f, &80 db 1, &e0, 7, &80 db 1, &c0, 3, &80 db 1, &f7, &8f, &80 db 1, &c0, &43, &80 db 1, &e0, &27, &80 db 6, &79, &9e, &60 db 6, &9f, &f9, &60 db 6, &e7, &e7, &60 db 7, &69, &96, &e0 db 6, &ee, &77, &60 db 6, &f7, &6f, &60 db 7, &6e, &f6, &e0 db 6, &ef, &77, &60 db 6, &f6, &ef, &60 db 1, &6f, &76, 0 db 0, &6e, &f6, 0 db 0, &1f, &68, 0 db 0, 3, &e0, 0 a_clock: db 4, 4 db &45, &45, &45, &45 db &45, &45, &45, &45 db &45, &45, &45, &45 db &45, &45, &45, &45 g_wizard_down1: db &14 db &3c, 0 db &4c, &f0 db &1f, &68 db &1b, &84 db 6, &6e db &6c, &6e db &ee, &ec db &ef, &e8 db &44, &40 db &16, &d0 db &18, &30 db &1f, &f0 db &1e, &70 db &0c, &e0 db &0c, &e0 db 4, &c0 db 6, &40 db 3, &80 db 3, &80 db 1, 0 g_wizard_down2: db &14 db &1e, &f0 db &26, &c8 db 5, &40 db 3, &80 db &66, &cc db &ec, &6e db &ee, &ee db &6f, &ec db 4, &40 db &16, &d0 db &18, &30 db &1f, &f0 db &1e, &70 db &0c, &e0 db &0c, &e0 db 4, &c0 db 6, &40 db 3, &80 db 3, &80 db 1, 0 g_wizard_down3: db &14 db 0, &78 db &1e, &64 db &2d, &f0 db &43, &b0 db &e6, &c0 db &ec, &6c db &6e, &ee db &2f, &ee db 4, &44 db &16, &d0 db &18, &30 db &1f, &f0 db &1e, &70 db &0c, &e0 db &0c, &e0 db 4, &c0 db 6, &40 db 3, &80 db 3, &80 db 1, 0 g_wizard_up1: db &14 db &1e, 0 db &26, &78 db &0f, &d4 db &0d, &c2 db 3, &e7 db &3e, &f7 db &ff, &f6 db &77, &f4 db &20, 0 db &0f, &f8 db &0d, &f8 db 8, &f8 db &0d, &f8 db 7, &f0 db 7, &70 db 2, &20 db 3, &60 db 1, &c0 db 1, &c0 db 0, &80 g_wizard_up2: db &14 db &0f, &78 db &13, &64 db 2, &a0 db 1, &c0 db &33, &e6 db &77, &f7 db &77, &f7 db &37, &f6 db 0, 0 db &0f, &f8 db &0d, &f8 db 8, &f8 db &0d, &f8 db 7, &f0 db 7, &70 db 2, &20 db 3, &60 db 1, &c0 db 1, &c0 db 0, &80 g_wizard_up3: db &14 db 0, &3c db &0f, &32 db &16, &f8 db &21, &d8 db &73, &e0 db &77, &f6 db &37, &f7 db &17, &f7 db 0, 2 db &0f, &f8 db &0d, &f8 db 8, &f8 db &0d, &f8 db 7, &f0 db 7, &70 db 2, &20 db 3, &60 db 1, &c0 db 1, &c0 db 0, &80 g_wizard_left1: db &14 db &0c, &f0 db &1c, &38 db &33, &98 db &47, &60 db 6, &10 db &37, 8 db 7, &98 db &31, &f0 db &35, &80 db &0d, &78 db 0, &d8 db &1f, &88 db &0f, &d8 db 5, &f0 db 5, &f0 db 2, &e0 db 2, &e0 db 1, &c0 db 1, &c0 db 0, &80 g_wizard_left2: db &14 db 7, &c0 db 9, &c0 db 0, 0 db 3, &f0 db 6, &38 db 4, &18 db 7, &98 db &31, &f0 db &35, &80 db &0d, &78 db 0, &d8 db &1f, &88 db &0f, &d8 db 5, &f0 db 5, &f0 db 2, &e0 db 2, &e0 db 1, &c0 db 1, &c0 db 0, &80 g_wizard_left3: db &14 db 3, &f0 db &1c, &38 db &33, &d8 db &47, &e0 db 4, &74 db 8, &3a db 7, &1e db &31, &f8 db &35, &80 db &0d, &78 db 0, &d8 db &1f, &88 db &0f, &d8 db 5, &f0 db 5, &f0 db 2, &e0 db 2, &e0 db 1, &c0 db 1, &c0 db 0, &80 g_wizard_right1:db &14 db &0f, &30 db &1c, &38 db &1b, &cc db 7, &e2 db &2e, &20 db &5c, &10 db &78, &e0 db &1f, &8c db 1, &ac db &1e, &b0 db &1b, 0 db &11, &f8 db &1b, &f0 db &0f, &a0 db &0f, &a0 db 7, &40 db 7, &40 db 3, &80 db 3, &80 db 1, 0 g_wizard_right2:db &14 db 3, &e0 db 3, &90 db 0, 0 db &0f, &c0 db &1c, &60 db &18, &20 db &19, &e0 db &0f, &8c db 1, &ac db &1e, &b0 db &1b, 0 db &11, &f8 db &1b, &f0 db &0f, &a0 db &0f, &a0 db 7, &40 db 7, &40 db 3, &80 db 3, &80 db 1, 0 g_wizard_right3:db &14 db &0f, &30 db &1c, &38 db &19, &cc db 6, &e2 db 8, &60 db &10, &ec db &19, &e0 db &0f, &8c db 1, &ac db &1e, &b0 db &1b, 0 db &11, &f8 db &1b, &f0 db &0f, &a0 db &0f, &a0 db 7, &40 db 7, &40 db 3, &80 db 3, &80 db 1, 0 g_sword7: db &0c db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, &20 db 0, &10 db 0, &12 db &7f, &df db &ff, &df db 0, &12 db 0, &10 db 0, &20 g_sword4: db &0d db 0, 0 db 0, &1c db 1, &dc db 0, &7c db 0, &30 db 0, &d8 db 1, &c8 db 3, &88 db 7, 0 db &0e, 0 db &1c, 0 db &18, 0 db &10, 0 g_sword5: db &10 db 1, &80 db 3, &c0 db 1, &80 db 1, &80 db 7, &e0 db 8, &10 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 0, &80 g_sword6: db &0d db 0, 0 db 0, 0 db &38, 0 db &3b, &80 db &3e, 0 db &0c, 0 db &1b, 0 db &13, &80 db &11, &c0 db 0, &e0 db 0, &70 db 0, &38 db 0, &1c g_sword3: db &0c db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 4, 0 db 8, 0 db &48, 0 db &fd, &ff db &fd, &fe db &48, 0 db 8, 0 db 4, 0 g_sword2: db &0c db 0, 0 db 0, 8 db 0, &18 db 0, &38 db 0, &70 db 0, &e0 db &11, &c0 db &13, &80 db &1d, 0 db &0c, 0 db &3e, 0 db &3b, &80 db &38, 0 g_sword1: db &10 db 1, 0 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 8, &10 db 7, &e0 db 1, &80 db 1, &80 db 3, &c0 db 1, &80 g_sword8: db &10 db 0, 0 db 0, 0 db &10, 0 db &18, 0 db &1c, 0 db &0e, 0 db 7, 0 db 3, &88 db 1, &c8 db 0, &d8 db 0, &30 db 0, &7c db 1, &dc db 0, &1c db 0, 0 db 0, 0 g_axe1: db &10 db 0, 0 db 0, 0 db &3c, 0 db &7e, 0 db &c3, 0 db &3c, 0 db &18, 0 db &3d, &ff db &3d, &ff db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 g_axe2: db &10 db 0, 0 db 0, 4 db 0, &0e db 0, &1c db 0, &38 db &3c, &70 db &60, &e0 db &d9, &c0 db &ba, &80 db &bf, 0 db &8e, 0 db &1c, 0 db 8, 0 db 0, 0 db 0, 0 db 0, 0 g_axe3: db &10 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 9, &80 db &18, 0 db &35, &80 db &37, &80 db &37, &80 db &35, &80 db &18, 0 db 8, 0 g_axe4: db &10 db 0, 0 db &20, 0 db &70, 0 db &38, 0 db &1c, 0 db &0e, 0 db 7, 0 db 3, &80 db 1, &40 db 0, &e0 db 4, &70 db 5, &f8 db 5, &d0 db 6, &c0 db 3, 0 db 1, &e0 g_axe5: db &10 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db &ff, &bc db &ff, &bc db 0, &18 db 0, &3c db 0, &c3 db 0, &7e db 0, &3c db 0, 0 db 0, 0 g_axe6: db &10 db 0, 0 db 0, 0 db 0, 0 db 0, &10 db 0, &38 db 0, &71 db 0, &fd db 1, &5d db 3, &9b db 7, 6 db &0e, &3c db &1c, 0 db &38, 0 db &70, 0 db &20, 0 db 0, 0 g_axe7: db &10 db 0, &10 db 0, &18 db 1, &ac db 1, &ec db 1, &ec db 1, &ac db 0, &18 db 1, &90 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 g_axe8: db &10 db 7, &80 db 0, &c0 db 3, &60 db &0b, &a0 db &1f, &a0 db &0e, &20 db 7, 0 db 2, &80 db 1, &c0 db 0, &e0 db 0, &70 db 0, &38 db 0, &1c db 0, &0e db 0, 4 db 0, 0 g_fireball1: db &0f db 0, 0 db 0, 0 db 0, 0 db 0, &24 db 0, &80 db 9, &80 db 2, &d0 db &0d, &60 db 6, &f0 db &43, &42 db 5, &a0 db &12, &a0 db 0, 0 db 0, 0 db 1, 0 g_fireball2: db &0f db 0, 0 db 0, 8 db 0, 0 db &20, &80 db 1, 0 db 3, &a0 db 2, 8 db &15, &f0 db 5, &a8 db 6, &60 db 1, &80 db 8, &20 db 4, &80 db 0, &10 db 0, 0 db &0f, 0 db 0, 0 db &80, 0 db 0, 1 db 0, 4 db &10, 1 db &82, 3 db &60, &45 db &68, &0e db &b0, 7 db &42, 9 db &90, 1 db 0, &20 db 0, 0 db 8, &10 db &80 g_fireball3: db &0f db 0, 0 db 1, 0 db &10, 4 db 0, 0 db 0, &40 db 1, &90 db 7, &40 db 5, &e2 db &17, &68 db 3, &c0 db 9, &c0 db 0, 2 db 1, 0 db 0, 0 db 0, 0 g_cursor_l: db &14 db 0, 1 db 0, 3 db 0, 7 db 0, &0f db 0, &1f db 0, &43 db 0, &c3 db 1, &c3 db 3, &f8 db 7, &f8 db 7, &f8 db 3, &f8 db 1, &c3 db 0, &c3 db 0, &43 db 0, &1f db 0, &0f db 0, 7 db 0, 3 db 0, 1 g_cursor_r: db &14 db &80, 0 db &c0, 0 db &e0, 0 db &f0, 0 db &f8, 0 db &c2, 0 db &c3, 0 db &c3, &80 db &1f, &c0 db &1f, &e0 db &1f, &e0 db &1f, &c0 db &c3, &80 db &c3, 0 db &c2, 0 db &f8, 0 db &f0, 0 db &e0, 0 db &c0, 0 db &80, 0 g_keyboard_l: db &10 db &0f, &ff db &0f, &ff db 9, &24 db 9, &24 db &0f, &ff db 9, &24 db 9, &24 db &0f, &ff db &0c, &92 db &0c, &92 db 7, &ff db 8, 0 db &0f, &ff db 8, &45 db &0d, &11 db 7, &ff g_keyboard_r: db &10 db &ff, &f8 db &ff, &f8 db &92, &48 db &92, &48 db &ff, &f8 db &92, &48 db &92, &48 db &ff, &f8 db &49, &38 db &49, &38 db &ff, &f0 db 0, 8 db &ff, &f8 db &ff, &f8 db &ff, &f8 db &ff, &f0 g_kempston_l: db &17 db 0, &c7 db 1, &8f db 3, &1f db 0, 0 db 3, &1f db 1, &8f db 0, &c7 db 0, 0 db 0, &33 db 0, &0b db 0, &0b db 0, &0b db 0, 1 db 0, 1 db 0, 0 db 0, 3 db 0, 7 db 0, &0f db 0, 9 db 0, 9 db 0, &0c db 0, 6 db 0, 3 g_kempston_r: db &17 db &ff, 0 db &ff, &80 db &ff, &c0 db 0, 0 db &ff, &c0 db &ff, &80 db &ff, 0 db 0, 0 db &fc, 0 db &f0, 0 db &f0, 0 db &f0, 0 db &80, 0 db &80, 0 db 0, 0 db &c0, 0 db &e0, 0 db &f0, 0 db &f0, 0 db &f0, 0 db &70, 0 db &60, 0 db &c0, 0 g_cave_door_frame:db 4, &18 db &ff, 0, 0, &ff db 3, 0, 0, &b0 db 3, 0, 0, &b0 db 7, 0, 0, &98 db &0d, 0, 0, &98 db &18, &80, 1, &0e db &38, &80, 1, &0c db &78, &80, 1, &18 db &58, &80, 1, &30 db &cc, &80, 1, &38 db &8c, &40, 2, &2c db &0c, &40, 2, &26 db &0c, &40, 2, &3b db &1c, &40, 2, &e1 db &34, &40, 2, &83 db &62, &20, 4, &86 db &f2, &20, 4, &86 db &7f, &2c, 5, &4c db &0f, &62, &25, &4c db 3, &c1, &7d, &58 db 0, &f0, &df, &78 db 0, &3d, &87, &f0 db 0, &0f, 0, &c0 db 0, 2, 0, 0 g_pumpkin1: db &13 db 7, &e0 db &1f, &f8 db &3f, &fc db &7d, &be db &7b, &9e db &f5, &0f db &ef, &67 db &f6, &67 db &ff, &ff db &ff, &7f db &ea, &47 db &f7, &cf db &7b, &ce db &7f, &fe db &3f, &fc db &0d, &b0 db 1, &c0 db 0, &e0 db 0, &60 g_pumpkin2: db &13 db 7, &e0 db &1f, &f8 db &3f, &fc db &7d, &fe db &79, &be db &f0, &5f db &e6, &ef db &e6, &77 db &ff, &ff db &fe, &ff db &e2, &6f db &f3, &df db &73, &ff db &7f, &fe db &3f, &fc db &0d, &b0 db 1, &c0 db 0, &e0 db 0, &60 lines_cav_long: db 0, &17, 1, 4, &ff db 1, &ff db 2, 3, &19, 1, &ff db 3, &ff db 4, &ff db 5, 6, &1b, 3, &ff db 6, &ff db 7, 8, 6, &1d, &ff db 8, &ff db 9, 4, &33, &0a, &ff db &0a, &ff db &0b, &0d, &1f, 8, &ff db &0c, &ff db &0d, &ff db &0e, &0f, &0d, &0c, &ff db &0f, &ff db &10, &31, &0a, &35, &ff db &11, &12, &23, &0f, &ff db &12, &ff db &13, &36, &35, &ff db &14, &25, &15, &12, &ff db &15, &ff db &16, &17, 4, &33, &ff db &17, &ff db &18, &19, &17, 1, &ff db &19, &ff db &1a, &1b, &19, 3, &ff db &1b, &ff db &1c, &1d, &1b, 6, &ff db &1d, &ff db &1e, &1f, &1d, 8, &ff db &1f, &ff db &20, &0d, &1f, &ff db &21, &ff db &22, &23, &21, &0f, &ff db &23, &ff db &24, &25, &23, &12, &ff db &25, &ff db &26, &25, &27, &15, &ff db &27, &ff db &28, &27, &29, &3c, &ff db &29, &ff db &2a, &2b, &3a, &29, &ff db &2b, &ff db &2c, &2d, &2b, &38, &ff db &2d, &ff db &2e, &2f, &2d, &36, &ff db &2f, &ff db &30, &13, &31, &2f, &ff db &31, &ff db &32, &33, &31, &0a, &ff db &33, &ff, &34, &ff db &35, &34, &ff db &36, &ff db &37, &2d, &38, &36, &ff db &38, &ff db &39, &2b, &38, &3a, &ff db &3a, &ff db &3b, &3a, &29, &3c, &ff db &3c, &ff db &3d, &15, &3c, &27, &ff db &ff points_cav_tall:db &79, &0a db &86, 4 db &91, 4 db &a6, &19 db &46, &0a db &9b, &38 db &a7, &4b db &9a, &58 db &aa, &68 db &37, 1 db &2a, 7 db &9b, &7e db &9b, &87 db &9b, &8f db &a8, &8f db &95, &a1 db &2a, &1e db &95, &b8 db &88, &be db &24, &30 db &79, &b5 db &46, &b5 db &4f, &27 db &70, &27 db &79, &23 db &82, &23 db &8f, &30 db &84, &47 db &89, &52 db &80, &5b db &8b, &66 db &85, &74 db &85, &7d db &89, &80 db &81, &88 db &81, &99 db &77, &9d db &70, &98 db &4f, &98 db &46, &9c db &3d, &9c db &30, &8f db &3b, &78 db &36, &6d db &3f, &64 db &34, &59 db &3a, &4c db &3a, &42 db &36, &3f db &3e, &37 db &3e, &26 db &47, &22 db &24, &38 db &18, &30 db &24, &41 db &15, &57 db &25, &67 db &18, &74 db &24, &87 db &18, &a6 db &2e, &bb db &39, &bb points_cav_wide:db &0a, &79 db 4, &86 db 4, &91 db &19, &a6 db &0a, &46 db &38, &9b db &4b, &a7 db &58, &9a db &68, &aa db 1, &37 db 7, &2a db &7e, &9b db &87, &9b db &8f, &9b db &8f, &a8 db &a1, &95 db &1e, &2a db &b8, &95 db &be, &88 db &30, &24 db &b5, &79 db &b5, &46 db &27, &4f db &27, &70 db &23, &79 db &23, &82 db &30, &8f db &47, &84 db &52, &89 db &5b, &80 db &66, &8b db &74, &85 db &7d, &85 db &80, &89 db &88, &81 db &99, &81 db &9d, &77 db &98, &70 db &98, &4f db &9c, &46 db &9c, &3d db &8f, &30 db &78, &3b db &6d, &36 db &64, &3f db &59, &34 db &4c, &3a db &42, &3a db &3f, &36 db &37, &3e db &26, &3e db &22, &47 db &38, &24 db &30, &18 db &41, &24 db &57, &15 db &67, &25 db &74, &18 db &87, &24 db &a6, &18 db &bb, &2e db &bb, &39 charset: db 0, 0, 0, 0, 0, 0, 0, 0 ; space db &18, &18, &18, &18, &18, 0, &18, &18 ; ! db &28, &28, 0, 0, 0, 0, 0, 0 ; " db 0, &18, &18, 0, 0, &18, &18, 0 ; : db 0, &62, &64, 8, &10, &26, &46, 0 ; % db &3c, &42, &99, &a1, &a1, &99, &42, &3c ; (c) db 0, 0, 0, 0, 0, 0, 0, 0 ; space db &10, &10, 0, 0, 0, 0, 0, 0 ; ' db 8, &18, &18, &18, &18, &18, &18, 8 db &10, &18, &18, &18, &18, &18, &18, &10 db 0, &14, &58, &3e, &7c, &1a, &28, 0 ; * db 0, &18, &18, &7e, &78, &18, &18, 0 ; + db 0, 0, 0, 0, 0, 0, &20, &20 ; , db 0, 0, 0, &7e, &7e, 0, 0, 0 ; - db 0, 0, 0, 0, 0, 0, &18, &18 ; . db &0c, &0c, &18, &18, &30, &30, &60, &60 ; / digit_charset: db &7c, &fe, &c6, &c6, &c6, &fe, &7c, 0 ; 0 db &18, &38, &58, &18, &18, &18, &3c, 0 ; 1 db &7c, &fe, 6, &7c, &c0, &fe, &fe, 0 ; 2 db &fe, &fc, 8, &1c, 6, &fe, &fc, 0 ; 3 db &0c, &1c, &3c, &6c, &fe, &0c, &0c, 0 ; 4 db &fe, &fe, &c0, &fc, 6, &fe, &7c, 0 ; 5 db &7c, &fe, &c0, &fc, &c6, &fe, &7c, 0 ; 6 db &fe, &fc, &0c, &18, &18, &30, &30, 0 ; 7 db &7c, &fe, &c6, &7c, &c6, &fe, &7c, 0 ; 8 db &7c, &fe, &c6, &7e, 6, &fe, &7c, 0 ; 9 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0 db &38, &38, &6c, &7c, &ee, &ee, &c6, 0 ; A db &fc, &fe, &e6, &fc, &e6, &fe, &fc, 0 ; B db &3c, &7e, &f8, &e0, &f8, &7e, &3c, 0 ; C db &f8, &fc, &fe, &c6, &fe, &fc, &f8, 0 ; D db &f8, &f8, &e0, &fc, &e0, &fe, &fe, 0 ; E db &fe, &fe, &e0, &fc, &e0, &e0, &e0, 0 ; F db &3c, &7e, &f8, &e0, &fe, &7e, &3a, 0 ; G db &ee, &ee, &fe, &fe, &fe, &ee, &ee, 0 ; H db &7c, &7c, &38, &38, &38, &7c, &7c, 0 ; I db &0e, &0e, &0e, &0e, &ee, &7c, &38, 0 ; J db &ee, &ec, &f8, &f8, &f8, &ec, &ee, 0 ; K db &e0, &e0, &e0, &e0, &fe, &fe, &fe, 0 ; L db &82, &ee, &fe, &fe, &d6, &d6, &d6, 0 ; M db &8e, &ce, &ee, &fe, &ee, &e6, &e2, 0 ; N db &38, &7c, &fe, &ee, &fe, &7c, &38, 0 ; O db &fc, &fe, &e6, &fe, &fc, &e0, &e0, 0 ; P db &38, &7c, &fe, &ee, &fe, &7c, &3e, 0 ; Q db &fc, &fe, &e6, &fe, &fc, &ec, &ee, 0 ; R db &7c, &fe, &f0, &7c, &1e, &fe, &7c, 0 ; S db &fe, &fe, &fe, &38, &38, &38, &38, 0 ; T db &ee, &ee, &ee, &ee, &fe, &fe, &7c, 0 ; U db &ee, &ee, &6c, &7c, &38, &38, &10, 0 ; V db &d6, &d6, &d6, &fe, &fe, &ee, &82, 0 ; W db &ee, &ee, &6c, &38, &6c, &ee, &ee, 0 ; X db &ee, &6c, &7c, &38, &38, &38, &38, 0 ; Y db &fe, &fc, &f8, &10, &3e, &7e, &fe, 0 ; Z g_can: db &14 db 7, &e0 db &18, &18 db &2f, &f4 db &7e, &1e db &3e, &34 db &3e, &54 db &3e, &ec db &3d, &dc db &3d, &bc db &39, &dc db &23, &bc db &27, &7c db &26, &bc db &2f, &fc db &38, &1c db &20, &c4 db &5d, &22 db &20, &c4 db &18, &18 db 7, &e0 g_moneybag: db &10 db &1f, &f8 db &7f, &7e db &f8, &1e db &f0, &4f db &f8, &0f db &f9, &7f db &fc, &0f db &7f, &7f db &7f, &ff db &3e, &1e db &1d, &ee db &87, &b4 db &7f, &18 db &ce, 4 db &11, &34 db &0e, &c8 g_coin: db &10 db 7, &a0 db &1f, &e8 db &3b, &74 db &6a, &9a db &5f, &da db &d8, &cd db &b0, &75 db &fc, &75 db &f2, &35 db &c0, &1d db &c8, &1d db &76, &3a db &70, &3a db &38, &74 db &1f, &e8 db 7, &a0 g_gem: db &0d db &1f, &f8 db &28, &14 db &48, &12 db &9a, &b1 db &f7, &ef db &d5, &58 db &a7, &b5 db &f7, &f1 db 8, &0f db &f7, &f1 db &77, &52 db &37, &d4 db &17, &f8 g_candy: db &10 db &10, 0 db &38, 0 db &44, 0 db &82, 0 db &7f, 0 db &3f, &80 db &10, &40 db 8, &20 db 7, &f0 db 3, &f8 db 1, 4 db 0, &82 db 0, &7f db 0, &3e db 0, &14 db 0, 8 g_chop: db &14 db &0f, &fc db &10, 2 db &11, &c1 db &11, &c3 db &18, &0e db &0f, &fc db &0f, &f8 db 7, &f8 db 7, &f0 db 7, &f0 db 3, &e0 db 3, &e0 db 3, &c0 db 0, 0 db 1, &80 db 1, &80 db 1, &80 db 1, &c0 db 7, &e0 db 7, &60 g_lollipop: db &12 db 0, &18 db 0, &38 db 0, &30 db 0, &70 db 0, &60 db 0, &e0 db &0f, &40 db &3f, &c0 db &7f, &e0 db &7f, &e0 db &ff, &f0 db &cf, &f0 db &cf, &f0 db &c7, &f0 db &61, &e0 db &71, &e0 db &3f, &c0 db &0f, 0 g_icecream: db &12 db 0, 1 db 0, &0f db 0, &54 db 3, &fe db &15, &54 db &3f, &fc db &7d, &54 db 7, &f8 db &c9, &d0 db &d0, &f8 db &e8, &d0 db &f2, &70 db &79, &50 db &74, &60 db &3d, &40 db &0f, 0 g_sparkle1: db &0c db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 2, 0 db 1, &40 db 4, &20 db 2, &80 db &0a, &a0 db 0, &50 db 1, 0 db 4, &40 g_sparkle2: db &0d db 0, 0 db 0, 0 db 0, 0 db 0, &80 db 2, 0 db 9, &50 db 4, &80 db 2, &d0 db &0b, &88 db 1, &a0 db &15, 8 db 0, &a0 db 2, 0 g_sparkle3: db &0f db 0, 0 db 1, &20 db 2, 8 db &80, &a0 db &22, &14 db &14, &60 db 3, &50 db &55, &82 db 9, &74 db &13, &40 db &24, &50 db 1, &94 db &0a, &40 db 0, &10 db 1, 0 g_sparkle4: db &10 db 0, &80 db &12, 8 db 0, &40 db &2a, 2 db 0, &a8 db &85, &40 db &12, &52 db &45, &a8 db &11, &14 db 5, &28 db &52, &52 db 5, 0 db 8, &90 db &22, &44 db 9, &20 db 0, &40 g_cave_locked: db 4, &18 db &ff, &1b, &18, &ff db 3, &1b, &18, &b0 db 3, &1b, &18, &b0 db 7, &1b, &18, &98 db &0d, &33, &0c, &98 db &1a, &33, &0c, &98 db &3a, &33, &0c, &ec db &7a, &33, 0, &58 db &5a, &63, &0e, &70 db &ce, &63, &17, &78 db &8c, &63, &19, &2c db &0c, &63, &0e, &26 db &0c, &c3, 0, &23 db &1c, &c3, 3, &21 db &32, &c3, 3, &43 db &62, &43, 2, &46 db &f8, 0, 0, &86 db &7f, &c0, 3, &0c db &0f, &38, &1c, &0c db 3, &c7, &fc, &18 db 0, &f0, &df, &38 db 0, &3d, &87, &f0 db 0, &0f, 0, &c0 db 0, 2, 0, 0 g_spider1: db &0e db &0c, &30 db &0c, &30 db &c0, 3 db &c6, &63 db &60, 6 db &1f, &f8 db &39, &9c db &74, &2e db &76, &6e db &79, &9e db &7f, &fe db &3f, &fc db &1f, &f8 db &0f, &f0 g_spider2: db &0e db 0, 0 db &60, 6 db &66, &66 db 6, &60 db &33, &cc db &1f, &f8 db &39, &9c db &74, &2e db &76, &6e db &79, &9e db &7f, &fe db &3f, &fc db &1f, &f8 db &0f, &f0 g_spikey1: db &10 db 3, &ff db &ff, &fc db &3f, &f0 db &0f, &fc db &3f, &ff db &ff, &fc db &3f, &f8 db &13, &9e db &65, &2f db &ed, &68 db &33, &9e db &3f, &f1 db &67, &f8 db 3, &b8 db 3, &1c db 2, 0 g_spikey2: db &10 db &ff, &80 db &7f, &ff db &0f, &fc db &3f, &f0 db &ff, &ff db &7f, &fe db &1f, &fc db &33, &98 db &65, &2f db &7d, &6e db &73, &98 db &1f, &f8 db &3f, &f8 db &7f, &6e db &63, &62 db 1, &20 g_blob1: db &0b db &0e, &e0 db &1f, &f0 db &39, &38 db &34, &90 db &36, &d8 db &39, &38 db &1f, &f0 db &0f, &e0 db &1c, &70 db &38, &38 db &f0, &1e g_blob2: db 9 db &0e, &e0 db &1f, &f0 db &39, &38 db &34, &98 db &36, &d8 db &39, &38 db &1f, &f0 db &3f, &f8 db &f8, &3e g_ghoul1: db &14 db 1, &c0 db 3, &80 db 3, 0 db 3, 0 db &83, &81 db &87, &c1 db &8f, &e1 db &cf, &f3 db &df, &f3 db &df, &fb db &df, &fb db &df, &fb db &d9, &9b db &d9, &9b db &19, &98 db &19, &98 db &19, &98 db &1f, &f8 db &0f, &f0 db 7, &e0 g_ghoul2: db &14 db 3, &80 db 1, &c0 db 0, &c0 db 0, &c0 db 1, &c0 db 3, &e0 db &87, &f1 db &8f, &f1 db &8f, &f9 db &df, &fb db &df, &fb db &df, &fb db &d9, &9b db &d9, &9b db &d9, &9b db &d9, &9b db &99, &99 db &0f, &f0 db &0f, &f0 db 7, &e0 g_ghost1: db &10 db 3, &c0 db 7, &e0 db &7f, &fe db &ff, &ff db &ff, &ff db &7f, &fe db &3f, &fe db &1f, &fc db &1c, &ec db &18, &44 db &18, &44 db &1c, &44 db &0c, &cc db &0f, &f8 db 7, &f0 db 3, &c0 g_ghost2: db &10 db &78, &0c db &fc, &1e db &fe, &3f db &ff, &ff db &7f, &ff db &3f, &fe db &1f, &fc db &1f, &fc db &1c, &ec db &18, &44 db &18, &44 db &1c, &44 db &0c, &cc db &0f, &f8 db 7, &f0 db 3, &c0 g_bat1: db &12 db 0, 0 db 0, 0 db 0, 0 db 4, &40 db &0c, &60 db 3, &80 db 7, &c0 db 6, &c0 db &0d, &60 db &1f, &f0 db &1c, &70 db &38, &38 db &30, &18 db &60, &0c db &40, 4 db &c0, 6 db &80, 2 db &80, 2 g_bat2: db &0e db &80, 2 db &80, 2 db &80, 2 db &40, 4 db &60, &0c db &64, &4c db &3c, &78 db &3b, &b8 db &17, &d0 db 6, &c0 db 5, &40 db &0f, &e0 db &0c, &60 db 8, &20 g_chicken_empty:db 6, &1e db 0, 0, &0f, &ff, &f8, 0 db 0, 0, &ff, &fe, &3e, 0 db 0, 7, &ff, &fd, &df, &80 db 0, &1f, &e7, 1, &e8, &c0 db 0, &7e, &e4, &f0, &e7, &60 db 1, &f6, &73, &fc, &73, &80 db 3, &33, &27, &f8, &33, &c0 db 4, &18, &0f, &fd, &38, &c0 db 8, 0, &0f, &fd, &18, &e0 db 0, 0, &1f, &fd, &18, &e0 db 0, 0, &1f, &fd, &18, &e0 db 0, 0, &3f, &fd, &18, &e0 db 0, 0, &3f, &fb, &38, &e0 db 0, 0, &7f, &fb, &38, &e8 db 0, 0, &7f, &f6, &71, &d8 db 0, &1e, &df, &ee, &71, &dc db 0, &0d, &3f, &dc, &f3, &bc db 0, 2, &ff, &3c, &e3, &78 db 0, 5, &e0, &79, &e3, &70 db 0, &0b, &9e, &f1, &d8, &e0 db 0, &17, &3e, &e3, &bf, &c0 db &0c, &2e, &1f, &1b, &7f, &80 db &1e, &dc, 7, &fc, &fe, 0 db &37, &b8, 1, &bb, &f8, 0 db &33, &f0, 0, &3f, &e0, 0 db &1d, &e0, 0, 0, 0, 0 db 3, &c0, 0, 0, 0, 0 db 6, &e0, 0, 0, 0, 0 db 6, &60, 0, 0, 0, 0 db 3, &c0, 0, 0, 0, 0 g_chicken_full: db 6, &1e db 0, 0, &ff, &ff, &fe, 0 db 0, 7, &ff, &ff, &ff, &80 db 0, &1f, &ff, &0f, &ff, &c0 db 0, &7f, &fe, &f7, &ff, &e0 db 1, &ff, &f9, &bb, &ff, &f0 db 3, &ff, &f7, &fd, &ff, &f8 db 7, &ff, &ef, &f5, &ff, &fc db &0f, &ff, &df, &de, &ff, &ec db &1f, &df, &5d, &be, &ff, &fe db &36, &fd, &bf, &f6, &de, &fe db &3f, &ff, &b7, &fe, &ff, &fe db &1b, &bf, &7e, &be, &ff, &ba db &0e, &fb, &7f, &fd, &bb, &fa db 7, &be, &f7, &7d, &ff, &fe db 1, &f6, &ff, &db, &ff, &fe db 0, &dd, &fe, &f7, &ff, &7e db 0, &3b, &77, &ed, &7f, &de db 0, &17, &fe, &df, &ff, &ec db 0, &0b, &ff, &3f, &fb, &f8 db 0, &1f, &c0, &fb, &ff, &b0 db 0, &1f, &bf, &ff, &bf, &e0 db &0c, &2f, &37, &bf, &fb, &c0 db &1e, &de, &1d, &fb, &ff, &80 db &37, &b8, 7, &bf, &be, 0 db &33, &f0, 1, &fb, &f8, 0 db &1d, &e0, 0, &3f, &e0, 0 db 3, &c0, 0, 0, 0, 0 db 6, &e0, 0, 0, 0, 0 db 6, &60, 0, 0, 0, 0 db 3, &c0, 0, 0, 0, 0 g_pop1: db &0b db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 3, &40 db 5, &c0 db 7, &60 db 6, &a0 db 3, &c0 db 1, 0 g_pop2: db &0d db 0, 0 db 0, 0 db 0, 0 db 0, &80 db 1, &a0 db &0b, &48 db 2, &f0 db &1f, &40 db 6, &f8 db 7, &b0 db 9, &c8 db 2, &a0 db 2, &90 g_pop3: db &0f db 0, 0 db 5, 0 db &11, &10 db 9, &10 db 4, &24 db &38, 8 db 0, &10 db &70, 0 db 0, &0e db &10, 0 db &64, &2c db &0a, &92 db &12, &a8 db 2, &80 db 0, &80 g_pop4: db &10 db 1, 0 db &11, &10 db 8, &20 db 0, 2 db &40, 4 db &20, 0 db 0, 0 db &c0, 0 db 0, 3 db 0, 0 db &40, 2 db &80, 1 db 0, 0 db &20, 4 db &44, &82 db 4, &80 g_wall_antlers: db 4, &10 db 0, 3, &c0, 0 db 0, 4, &20, 0 db 0, 8, &10, 0 db 0, &13, &c8, 0 db 0, &27, &e4, 0 db 0, &2d, &b4, 0 db 0, &49, &92, 0 db 0, &7f, &fe, 0 db 3, &f9, &9f, &c0 db 7, &f5, &af, &e0 db &0f, &f6, &6f, &f0 db &1c, &b9, &9d, &38 db &30, &9f, &f9, &0c db &20, &8f, &f1, 4 db 0, &c0, 3, 0 db 0, &3f, &fc, 0 g_wall_trophy: db 2, &10 db 3, &c0 db 4, &20 db 8, &10 db &13, &c8 db &27, &e4 db &2d, &b4 db &4d, &b2 db &4f, &f2 db &49, &92 db &94, &29 db &b6, &6d db &b9, &9d db &bf, &fd db &98, &19 db &c0, 3 db &3f, &fc g_bookcase: db 5, &20 db &1f, &ff, &ff, &ff, &f8 db &18, 0, 0, 0, &18 db &14, 0, 0, 0, &28 db &13, &ff, &ff, &ff, &c8 db &12, 0, 0, 0, &48 db &12, 0, 0, 0, &48 db &12, 0, 0, 0, &48 db &3f, &ff, &ff, &ff, &fc db &30, 0, 0, 0, &0c db &28, 0, 0, 0, &14 db &24, 0, 0, 0, &24 db &23, &ff, &ff, &ff, &c4 db &22, 0, 0, 0, &44 db &22, 0, 0, 0, &44 db &22, 0, 0, 0, &44 db &7f, &ff, &ff, &ff, &fe db &60, 0, 0, 0, 6 db &50, &c6, &f6, &ef, &0a db &48, &c7, &f6, &ed, &12 db &47, &ce, &f6, &eb, &e2 db &44, &ce, &f6, &ed, &22 db &44, &dc, &f6, &eb, &22 db &44, &dc, &f6, &ed, &22 db &44, &f8, &f6, &eb, &22 db &ff, &ff, &ff, &ff, &ff db 0, 0, 0, 0, 0 db &ff, &ff, &ff, &ff, &ff db &7f, &ff, &ff, &ff, &fe db &3f, &ff, &ff, &ff, &fc db &1f, &ff, &ff, &ff, &f8 db &0f, &ff, &ff, &ff, &f0 db 7, &ff, &ff, &ff, &e0 g_trap_open: db 4, &20 db 0, &3c, &f0, 0 db &0e, &66, &f9, &c0 db &1f, &5e, &bb, &f8 db &3f, &5c, &d1, &fc db &77, &58, &55, &fe db &7b, &6b, &56, &0e db &dd, &bb, &77, &f6 db &df, &d8, 1, &8e db &4f, 0, 0, &76 db &63, 0, 0, &f2 db &3e, 0, 0, &f0 db 0, 0, 0, &ce db &7e, 0, 0, &1f db &3f, 0, 0, &7f db &de, 0, 0, &5f db &db, 0, 0, &63 db &be, 0, 0, &3e db &e0, 0, 0, 0 db &0e, 0, 0, &3e db &7e, 0, 0, &7f db &4e, 0, 0, &43 db &73, 0, 0, &7d db &3f, 0, 0, &0f db 0, 0, 0, &e3 db &3f, &36, &7d, &78 db &7f, &ee, &fe, &bc db &6f, &ee, &be, &bc db &2f, &da, &be, &cc db &37, &de, &bf, &78 db &19, &da, &c7, &60 db &0f, &ce, &7e, 0 db 1, &c6, 0, 0 g_trap_closed: db 4, &20 db 0, &3c, &f0, 0 db &0e, &66, &f9, &c0 db &1f, &5e, &bb, &f8 db &3f, &5c, &d1, &fc db &77, &58, &55, &fe db &7b, &6b, &56, &0e db &dd, &bb, &77, &f6 db &df, &d8, 1, &8e db &4f, &ff, &ff, &76 db &63, &92, &49, &f2 db &3e, &92, &49, &f0 db 0, &ff, &f9, &ce db &7e, &ea, &ad, &1f db &3f, &ff, &f9, &7f db &de, &92, &49, &5f db &db, &92, &49, &63 db &be, &92, &49, &3e db &e0, &92, &49, 0 db &0e, &ff, &f9, &3e db &7e, &ea, &ad, &7f db &4e, &ff, &f9, &43 db &73, &92, &49, &7d db &3f, &92, &49, &0f db 0, &ff, &ff, &e3 db &3f, &36, &7d, &78 db &7f, &ee, &fe, &bc db &6f, &ee, &be, &bc db &2f, &da, &be, &cc db &37, &de, &bf, &78 db &19, &da, &c7, &60 db &0f, &ce, &7e, 0 db 1, &c6, 0, 0 g_rug: db 6, &27 db 0, 3, &80, 0, 2, 0 db 0, 7, &c0, 0, &0d, 0 db 0, 7, &c0, 0, &1e, 0 db 0, 7, &c0, 0, &1f, 0 db 0, 3, &c0, 0, &1f, 0 db 0, 3, &80, 0, &3e, 0 db 0, 3, &80, 0, &3c, 0 db 0, 3, &80, 0, &7c, 0 db 0, 3, &80, 0, &78, 0 db 0, 3, &80, 0, &70, 0 db 0, 2, &80, 0, &f0, 0 db 0, 7, &80, 0, &b0, 0 db 0, 7, &c7, &e1, &f0, 0 db 0, 6, &7e, &3b, &20, 0 db 0, 7, &fd, &df, &e0, 0 db 3, &cf, &1e, &3c, &e0, 0 db &0f, &fe, &ef, &fb, &70, 0 db &79, &bf, &1c, &fc, &de, 0 db &bb, &d9, &fb, &67, &f3, &f0 db &ff, &f6, &fc, &db, &1e, &7f db &bb, &d9, &8f, &e6, &ef, &ce db &e9, &bf, &76, &3f, &1c, 3 db &0f, &fb, &8d, &d9, &f0, 0 db 3, &cc, &fe, &36, &e0, 0 db 0, 7, &c7, &f9, &e0, 0 db 0, 7, &ff, &ff, &20, 0 db 0, 4, &c7, &e1, &f0, 0 db 0, 7, &80, 0, &b0, 0 db 0, 2, &80, 0, &f0, 0 db 0, 3, &80, 0, &50, 0 db 0, 2, &80, 0, &78, 0 db 0, 3, &80, 0, &7c, 0 db 0, 3, &80, 0, &3c, 0 db 0, 3, &80, 0, &3e, 0 db 0, 3, &c0, 0, &1f, 0 db 0, 7, &c0, 0, &1f, 0 db 0, 7, &c0, 0, &1e, 0 db 0, 7, &c0, 0, &0d, 0 db 0, 3, &80, 0, 2, 0 a_wall_antlers: db 4, 2 db &47, &47, &47, &47 db &47, &47, &47, &47 a_wall_trophy: db 2, 2 db &45, &45, &45, &45 a_bookcase: db 5, 4 db &46, &46, &46, &46, &46 db &46, &46, &46, &46, &46 db &46, &45, &43, &44, &46 db &46, &46, &46, &46, &46 a_trap_open: db 4, 4 db &43, &43, &43, &43 db &43, 0, 0, &43 db &43, 0, 0, &43 db &43, &43, &43, &43 a_trap_closed: db 4, 4 db &43, &43, &43, &43 db &43, &46, &46, &43 db &43, &46, &46, &43 db &43, &43, &43, &43 a_rug: db 6, 5 db 7, 7, 7, 7, 7, 7 db 7, 7, 7, 7, 7, 7 db 7, 7, 7, 7, 7, 7 db 7, 7, 7, 7, 7, 7 db 7, 7, 7, 7, 7, 7 g_acg_shield: db 2, &10 db 1, &80 db 7, &e0 db &0f, &f0 db &1f, &d8 db &30, &0c db &3f, &dc db &7f, &fe db &7f, &fe db &54, &42 db &d5, &db db &c5, &d3 db &d5, &df db &c4, &43 db &ff, &ff db &e7, &e7 db &81, &81 g_wall_shield: db 2, &10 db 1, &80 db 7, &e0 db 8, &10 db &19, &98 db &39, &9c db &30, &0c db &75, &ae db &7f, &fe db &7f, &fe db &dc, &2f db &d7, &eb db &c4, &23 db &d7, &eb db &fd, &7f db &e7, &e7 db &81, &81 g_suit_armour: db 2, &20 db &30, &0c db &1c, &38 db &1e, &7a db &0e, &72 db 6, &62 db &0a, &52 db &1c, &3a db &0a, &52 db 7, &e2 db &47, &e7 db &47, &e2 db 7, &e0 db &60, 6 db &67, &e6 db &a6, &65 db &cc, &33 db &ad, &b5 db &6d, &b6 db &7f, &fe db &7f, &fe db &78, &1e db &37, &ec db 3, &c0 db 7, &e0 db &0e, &70 db &19, &98 db 7, &e0 db &0f, &f0 db 7, &e0 db 3, &c0 db 0, 0 db 0, 0 a_acg_shield: db 2, 2 db &43, &47 db &47, &43 a_wall_shield: db 2, 2 db &ff, &ff db &ff, &ff a_suit_armour: db 2, 4 db &45, &45 db &45, &45 db &45, &45 db &45, &45 a_cave_door_shut:db 4, 3 db &ff, &47, &47, &ff db &ff, &47, &47, &ff db &ff, &ff, &ff, &ff a_door_shut: db 4, 3 db &43, &47, &47, &43 db &43, &47, &47, &43 db &43, &43, &43, &43 g_door_shut: db 4, &18 db &ff, &3b, &dc, &ff db &1f, &3b, &dc, &f8 db &0c, &3b, &dc, &40 db &3e, &3b, &dc, &7c db &7c, 0, 0, &3e db 4, &7b, &ce, &20 db &f8, &7b, &d7, &1f db &f8, &7b, &d1, &1f db 8, &7b, &ce, 8 db &f0, &7b, &c0, &0f db &f0, 0, 0, &0f db &10, &fb, &df, 8 db &f0, &fb, &df, &1f db &f8, &7b, &de, &1f db &cc, &3b, &dc, &33 db &3f, &0b, &d0, &7c db &7d, &80, 1, &be db &3b, &f0, &0f, &dc db &17, &bf, &fd, &e8 db 7, &7b, &de, &e0 db 3, &7b, &de, &c0 db 0, &77, &ee, 0 db 0, 7, &e0, 0 db 0, 0, 0, 0 g_cave_door_shut:db 4, &18 db &ff, &3b, &dc, &ff db 3, &3b, &dc, &b0 db 3, &3b, &dc, &b0 db 7, &3b, &dc, &98 db &0d, 0, 0, &98 db &1a, &7b, &ce, &4e db &3a, &7b, &d7, &ec db &7a, &7b, &d1, &58 db &5a, &7b, &ce, &70 db &ce, &7b, &c0, &78 db &8c, 0, 0, &2c db &0c, &fb, &df, &26 db &0c, &fb, &df, &23 db &1c, &7b, &de, &21 db &32, &3b, &dc, &43 db &62, &0b, &d0, &46 db &f1, 0, 0, &86 db &7f, &c0, 3, &0c db &0f, &38, &1c, &0c db 3, &c7, &fc, &18 db 0, &f0, &df, &38 db 0, &3d, &87, &f0 db 0, &0f, 0, &c0 db 0, 2, 0, 0 g_mummy1: db &18 db &0f, 0 db &0f, &78 db 3, &78 db 4, &30 db 7, &70 db 7, &40 db 1, &f0 db 7, &e0 db &0e, &20 db &0f, &e0 db &0f, &e0 db 4, &20 db &cf, &e5 db &e8, &67 db &f7, &cb db &5b, &be db &17, &d4 db 3, &80 db 7, &c0 db &0c, &60 db &0f, &e0 db &0d, &60 db 7, &c0 db 3, &80 g_mummy2: db &18 db &0f, &e8 db &0f, &e8 db 3, &30 db 4, &70 db 7, &40 db 7, &f0 db 1, &e0 db 7, &e0 db 7, &10 db 7, &f0 db 7, &f0 db 2, &10 db &af, &e5 db &78, &67 db &f7, &cb db &5b, &be db &17, &d4 db 3, &80 db 7, &c0 db &0c, &60 db &0f, &e0 db &0d, &60 db 7, &c0 db 3, &80 g_mummy3: db &18 db 0, &78 db &0f, &78 db &0f, &30 db 7, &70 db 4, &40 db 7, &70 db 7, &70 db 1, &e0 db 7, &10 db 7, &f0 db 7, &f0 db 2, &10 db &a7, &f5 db &e4, &37 db &f3, &eb db &5b, &fe db &17, &f4 db 1, &c0 db 3, &e0 db 6, &30 db 7, &f0 db 6, &b0 db 3, &e0 db 1, &c0 g_franken1: db &18 db &3e, 0 db &1e, &60 db 0, &f0 db &0e, &70 db &0e, &b0 db &0e, &c4 db &4f, &e4 db &4f, &ea db &a0, &0a db &af, &ee db &ee, &ee db &fe, &fe db &ff, &fe db &7e, &fc db &0f, &e0 db &20, 8 db &37, &d8 db &24, &48 db &0f, &e0 db &14, &50 db &16, &d0 db &10, &10 db &1a, &b0 db &0f, &e0 g_franken2: db &18 db &1e, &f0 db &1e, &f0 db 0, 0 db &0e, &e0 db &4e, &e4 db &4e, &e4 db &af, &ea db &af, &ea db &e0, &0e db &ef, &ee db &ef, &ee db &fe, &fe db &ff, &fe db &7e, &fc db &0f, &e0 db &20, 8 db &37, &d8 db &24, &48 db &0f, &e0 db &14, &50 db &16, &d0 db &10, &10 db &1a, &b0 db &0f, &e0 g_franken3: db &18 db 0, &f8 db &0c, &f0 db &1e, 0 db &1c, &e0 db &1a, &e0 db &46, &e0 db &4f, &e0 db &ae, &e4 db &0a, &a0 db &ef, &ea db &ef, &ee db &fe, &fe db &ff, &fe db &7e, &fc db &0f, &f0 db &20, 8 db &37, &d8 db &24, &48 db &0f, &e0 db &14, &50 db &16, &d0 db &10, &10 db &1a, &b0 db &0f, &e0 g_devil1: db &18 db &0c, 7 db &0c, &63 db 0, &65 db &0c, 4 db &0c, &ec db &0e, &f8 db &0f, &d0 db &0f, &c0 db 5, &40 db &0b, &a0 db &0d, &60 db &ab, &a8 db &ff, &ff db &3f, &fc db 7, &c0 db &0a, &a0 db &11, &10 db &14, &50 db &16, &d0 db &31, &18 db &7b, &bc db &6f, &ec db &47, &c4 db &40, 4 g_devil2: db &18 db 6, &c7 db 6, &c3 db 0, 5 db 6, &c4 db 6, &cc db 6, &d8 db 7, &d0 db 7, &c0 db 5, &40 db &0b, &a0 db &0d, &60 db &ab, &aa db &ff, &fe db &3f, &f8 db 7, &c0 db &0a, &a0 db &11, &10 db &14, &50 db &16, &d0 db &31, &18 db &7b, &bc db &6f, &ec db &47, &c4 db &40, 4 g_devil3: db &18 db 0, &37 db 6, &33 db 6, 5 db 0, &34 db 7, &3c db 7, &78 db 3, &f0 db 7, &f0 db 2, &a0 db 5, &d0 db 6, &b0 db &a5, &d5 db &ff, &ff db &3f, &fc db 3, &e0 db 5, &50 db 8, &88 db &0a, &28 db &0b, &68 db &18, &8c db &39, &ce db &37, &f6 db &23, &e2 db &20, 2 g_dracula1: db &18 db 0, &f0 db &0c, 0 db &1c, &c0 db &38, &c0 db &b4, &c2 db &ce, &de db &f7, &de db &f7, &de db &f8, &3e db &7f, &fc db &7f, &fc db &6b, &ac db &23, &88 db &3f, &f8 db &0f, &e0 db &3a, &b8 db &72, &9c db &41, 4 db &54, &54 db &16, &d0 db &19, &30 db &1b, &b0 db &0f, &e0 db 7, &c0 g_dracula2: db &18 db &1e, &f0 db &0e, &e0 db 0, 0 db 6, &c0 db &86, &c2 db &f6, &de db &f7, &de db &f7, &de db &f8, &3e db &7f, &fc db &7f, &fc db &6b, &ac db &23, &88 db &3f, &f8 db &0f, &e0 db &3a, &b8 db &72, &9c db &41, 4 db &54, &54 db &16, &d0 db &19, &30 db &1b, &b0 db &0f, &e0 db 7, &c0 g_dracula3: db &18 db &1e, 0 db 0, &60 db 6, &70 db 6, &38 db &86, &5a db &f6, &e6 db &f7, &de db &f7, &de db &f8, &3e db &7f, &fc db &7f, &ec db &6b, &ac db &23, &88 db &3f, &f8 db &0f, &e0 db &3a, &b8 db &72, &9c db &41, 4 db &54, &54 db &16, &d0 db &19, &30 db &1b, &b0 db &0f, &e0 db 7, &c0 g_tombstone: db &15 db &22, 0 db &4b, &c0 db &56, &80 db &37, &60 db &fb, 0 db &7b, &80 db &fd, &80 db &7d, &ce db &9e, &ae db &9e, &77 db &2f, &f9 db &4f, &f6 db 7, &ec db 7, &c0 db &0f, &d8 db &1f, &dc db &3d, &ec db &3d, &e2 db &3a, &dc db &16, &b8 db 0, &70 g_crucifix: db &12 db 1, &80 db 3, &c0 db 3, &c0 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 1, &80 db 3, &c0 db &66, &66 db &fd, &bf db &fd, &bf db &66, &66 db 3, &c0 db 1, &80 db 3, &c0 db 3, &c0 db 1, &80 g_skull: db &0f db 2, &d0 db 3, &50 db 4, &a8 db &0c, 8 db &1c, &c8 db &38, &44 db &30, &84 db &76, &32 db &7b, &5a db &73, &1a db &79, &12 db &38, 2 db &3f, 2 db &1f, &fc db 7, &f0 g_witch_l1: db &16 db 0, &0a db 7, &da db 0, &ba db &3c, &d8 db 7, &fc db 7, &fe db 7, &fe db 5, &ff db &1d, &ff db &3e, &f7 db &e6, &f6 db &c3, &78 db 9, &60 db &0f, &c0 db &0f, &c0 db &2f, &20 db &3b, &40 db &16, &e0 db &0d, &f0 db 3, &f8 db 7, &fc db 8, &1f g_witch_l2: db &16 db 0, &80 db 7, &d5 db 0, &ba db &3c, &d4 db 7, &fc db 7, &fe db 7, &fe db 5, &ff db &0d, &ff db &1e, &f7 db &76, &f6 db &e3, &7c db &49, &60 db &0f, &c0 db &0f, 0 db &2f, &20 db &3b, &40 db &16, &e0 db &0d, &f0 db 3, &f8 db 7, &fc db 8, &1f g_witch_r1: db &16 db &10, 0 db &ab, &e0 db &5d, 0 db &2b, &3c db &3f, &e0 db &7f, &e0 db &7f, &e0 db &ff, &a0 db &ff, &b0 db &ef, &78 db &6f, &6e db &3e, &c7 db 6, &92 db 3, &f0 db 0, &f0 db 4, &f4 db 2, &dc db 7, &68 db &0f, &b0 db &1f, &c0 db &3f, &e0 db &f8, &10 g_witch_r2: db &16 db &50, 0 db &ab, &e0 db &5d, 0 db &2b, &3c db &3f, &e0 db &7f, &e0 db &7f, &e0 db &ff, &a0 db &ff, &b8 db &ef, &7c db &6f, &67 db &3e, &c3 db 6, &90 db 3, &f0 db 0, &f0 db 4, &f4 db 2, &dc db 7, &68 db &0f, &b0 db &1f, &c0 db &3f, &e0 db &f8, &10 g_monk_l1: db &13 db &0c, &ce db &1f, &fc db &3f, &f8 db &2f, &b0 db &17, &b0 db &3b, &10 db &3d, &b0 db &7e, &f0 db &ff, &70 db &e3, &70 db &1d, &70 db &0a, &e0 db &15, &c6 db &24, &3c db &47, &fc db &4f, &f8 db &7f, &e0 db &3f, &80 db &1e, 0 g_monk_l2: db &13 db 3, 0 db &1f, &ff db &0f, &fc db &37, &b0 db &3b, &b0 db &7d, &10 db &7e, &d0 db &ff, &70 db &e7, &b0 db &0b, &b0 db &0d, &70 db &0c, &e0 db &17, &c0 db &26, &1f db &47, &fc db &4f, &f8 db &7f, &e0 db &3f, &80 db &1e, 0 g_monk_r1: db &13 db 0, &c0 db &ff, &f8 db &3f, &f0 db &0d, &ec db &0d, &dc db 8, &be db &0d, &7e db &0e, &ff db &0d, &e7 db &0d, &d0 db &0e, &b0 db 7, &30 db 3, &e8 db &f8, &64 db &3f, &e2 db &1f, &f2 db 7, &f3 db 1, &fc db 0, &78 g_monk_r2: db &13 db &73, &30 db &3f, &f8 db &1f, &fc db &0d, &f4 db &0d, &e8 db 8, &dc db &0d, &bc db &0f, &7e db &0e, &ff db &0e, &c7 db &0e, &b8 db 7, &50 db &63, &a8 db &3c, &24 db &3f, &e2 db &1f, &f2 db 7, &fe db 1, &fc db 0, &78 g_bat_l1: db &13 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db &67, &f0 db &ff, &ff db &bf, &fe db &df, &80 db &f7, &f0 db &dc, &10 db &25, &f8 db &0b, &e8 db &0c, &18 db 7, &f8 db 3, &f8 db 0, &fc db 0, &1f g_bat_l2: db &0d db 0, &1f db 0, &fc db 3, &f8 db 7, 4 db 8, &38 db 7, &90 db &67, &e0 db &ff, &9f db &bf, &fe db &df, &f0 db &f0, 0 db &b0, 0 db &20, 0 g_bat_r1: db &0d db &f8, 0 db &3f, 0 db &1f, &c0 db &2f, &e0 db &1c, &10 db 9, &e0 db 7, &e6 db &f9, &ff db &7f, &fd db &0f, &fb db 0, &0f db 0, &0d db 0, 4 g_bat_r2: db &13 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db 0, 0 db &0f, &e6 db &ff, &ff db &7f, &fd db 1, &fb db &0f, &ef db 8, &6d db &1f, &a4 db &27, &d0 db &18, &30 db &1f, &e0 db &1f, &c0 db &3f, 0 db &f8, 0 g_barrel: db 4, &20 db 0, &0f, &f0, 0 db 0, &70, &0e, 0 db 1, &87, &b1, &80 db 2, &7b, &de, &40 db 4, &fd, &ef, &a0 db &0b, &7e, &f7, &d0 db &17, &bf, &7b, &e8 db &17, &df, &bd, &e8 db &2f, &ff, &ff, &f4 db &6e, &63, &8f, &b6 db &5e, &49, &27, &ba db &56, &49, &24, &2a db &5e, &63, &8c, &ba db &dc, &49, &24, &fb db &ee, &49, &24, &f7 db &af, &63, &8c, &b5 db &b7, &ff, &ff, &ed db &bb, &df, &f7, &dd db &9d, &ef, &fb, &b9 db &ce, &77, &fe, &73 db &c7, &8f, &f1, &e3 db &63, &f0, &0f, &c6 db &70, &ff, &ff, &0e db &38, &1f, &f8, &1c db &1e, 0, &40, &78 db &0f, &c0, &23, &f0 db 3, &ff, &ff, &c0 db 0, &ff, &ff, 0 db 0, &1f, &f8, 0 db 0, 0, 0, 0 db 0, 0, 0, 0 db 0, 0, 0, 0 a_barrel: db 4, 4 db &46, &46, &46, &46 db &46, &46, &46, &46 db &46, &46, &46, &46 db &46, &46, &46, &46 g_acg_door: db 8, &28 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0, 0, 0, 0 db 0, &3c, 0, 0, 0, 0, &3c, 0 db 0, &42, 0, 0, 0, 0, &42, 0 db 0, &bd, 0, 0, 0, 0, &bd, 0 db 0, &ef, 0, 0, 0, 0, &f7, 0 db &ff, &eb, &ff, &ff, &7f, &ff, &f7, &ff db 0, &6a, &1f, &ff, &7f, &f8, &56, 0 db 0, &5a, &3f, &ff, &7f, &fc, &52, 0 db 0, &d6, &3f, &e3, &63, &fc, &6b, 0 db 0, &d6, &7f, &d1, &51, &fe, &6b, 0 db 0, &b6, &7f, &d1, &51, &fe, &69, 0 db 0, &b6, &ff, &cd, &4d, &ff, &6d, 0 db 1, &b6, &ff, &e3, &63, &ff, &6d, &80 db 1, &a4, &ff, &ff, &ff, &ff, &25, &80 db 1, &2c, &ff, &36, &30, &ff, &34, &80 db 1, &6c, &ff, &34, &e6, &ff, &36, &80 db 3, &6c, &ff, 4, &e4, &ff, &36, &c0 db 3, &6c, &ff, 4, &e4, &ff, &36, &c0 db 2, &6c, &ff, &34, &e7, &ff, &36, &40 db 2, &6c, &ff, &34, &e7, &ff, &36, &40 db 6, &cc, &7f, &8e, &30, &fe, &33, &60 db 4, &cc, &7f, &ff, &ff, &fe, &33, &20 db 7, &f4, &3f, &ff, &7f, &fc, &2f, &e0 db &1f, &fc, &1f, &ff, &7f, &f8, &3f, &f8 db &38, &0e, &0f, &ff, &7f, &f0, &70, &1c db &67, &f3, 3, &ff, &7f, &c0, &cf, &e6 db &5f, &fd, 0, &7f, &fe, 0, &bf, &fa db &3f, &fe, 0, 7, &60, 0, &7f, &fc db 0, 0, 0, 0, 0, 0, 0, 0 db &7f, &ff, &ff, &ff, &ff, &ff, &ff, &fe db &7f, &ff, &ff, &ff, &ff, &ff, &ff, &fe db &ff, &ff, &ff, &ff, &ff, &ff, &ff, &ff db 0, 0, 0, 0, 0, 0, 0, 0 db &aa, &aa, &aa, &aa, &aa, &aa, &aa, &aa db &55, &55, &55, &55, &55, &55, &55, &56 db &2a, &aa, &aa, &aa, &aa, &aa, &aa, &ac db 0, 0, 0, 0, 0, 0, 0, 0 a_acg_door: db 8, 5 db &ff, &47, &43, &43, &43, &43, &47, &ff db &ff, &47, &43, &43, &43, &43, &47, &ff db &47, &47, &43, &43, &43, &43, &47, &47 db &47, &47, &43, &43, &43, &43, &47, &47 db &46, &46, &46, &46, &46, &46, &46, &46 g_acg_key1: db &0b db &0c, &ce db &0c, &df db &0f, &d8 db &0f, &d8 db &0c, &d8 db &0c, &df db 7, &fe db &3f, &ff db &5f, &ff db &40, 0 db &3f, &ff g_acg_key2: db &0f db &3c, 0 db &7e, 0 db &66, 0 db &6e, 1 db &60, 1 db &7e, 3 db &3c, &0f db &ff, &f0 db &ff, &ff db 0, &0f db &ff, &f0 db 0, &0f db 0, 3 db 0, 1 db 0, 1 g_acg_key3: db &13 db &1c, 0 db &7f, 0 db &7f, 0 db &c3, &80 db &c3, &c0 db &81, &dc db &81, &66 db &1b, &42 db &9f, &73 db &c7, &b1 db &c7, &b1 db &9f, &73 db &1b, &42 db &81, &66 db &81, &bc db &c3, &80 db &f8, &80 db &7f, 0 db &1c, 0 g_mushroom: db &10 db 0, &70 db 0, &fc db 0, &7e db 0, &7e db 0, &fc db 0, &fc db &7e, &3c db &cf, &c8 db &6f, &f0 db &ff, &3c db &7f, &3e db &77, &f3 db &33, &f3 db &1f, &9e db &0f, &fc db 3, &f0 g_pumpkin_picture:db 4, &10 db 1, &ff, &ff, &80 db 1, &ff, &ff, &80 db 1, &80, 1, &80 db 1, &87, &e1, &80 db 3, &8d, &31, &c0 db 3, &18, &98, &c0 db 3, &13, &c8, &c0 db 3, &16, &68, &c0 db 7, &1f, &f8, &e0 db 6, &19, &98, &60 db 6, &19, &98, &60 db 6, &0f, &f0, &60 db &0e, 0, 0, &70 db &0c, 0, 0, &30 db &0f, &ff, &ff, &f0 db &0f, &ff, &ff, &f0 a_pumpkin_picture:db 4, 2 db &46, &46, &46, &46 db &46, &46, &46, &46 g_spanner: db &10 db &20, 0 db &70, 0 db &78, 0 db &3c, 0 db &1e, 0 db &0f, 0 db 7, &80 db 3, &c0 db 1, &e0 db 0, &f8 db 0, &7e db 0, &7f db 0, &7f db 0, &63 db 0, &63 db 0, &22 g_ghostlet1: db &0b db 9, &10 db &dd, &b9 db &ff, &ff db &7f, &ff db &3f, &fe db &1c, &9c db &0a, &2c db &0b, &6c db &0c, &98 db 7, &f0 db 1, &e0 g_ghostlet2: db &0b db 0, 0 db 0, 0 db 1, 1 db &d7, &d7 db &ff, &ff db &f9, &3e db &74, &5c db &36, &d8 db &19, &30 db &0f, &e0 db 3, &c0 g_skeleton: db 5, &28 db 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0 db 0, 0, 0, 0, 0 db 0, 0, &60, 0, 0 db 0, &e0, &78, 0, 0 db 0, &fc, &ec, &40, 0 db 0, &6e, &c6, &70, 0 db 0, &c1, &c3, &60, 0 db 0, &c6, &a1, &c0, 0 db 0, &bf, &30, &80, 0 db 0, &7c, &1c, 0, 0 db 0, &6b, &9f, 0, 0 db &ff, &50, &4e, &ff, 0 db 0, &24, &e1, 0, 0 db 0, &28, &10, 0, 0 db 0, &12, &60, 0, 0 db 0, &14, &30, 0, 0 db 0, &14, &18, 0, 0 db 0, &14, &46, 0, 0 db 0, &0c, &99, 0, 0 db 0, 2, &ae, &e0, 0 db 0, 6, &7b, &60, 0 db &50, &0c, &e7, &30, 0 db &27, &18, &87, &18, &50 db &17, &78, &ff, &0b, &98 db 7, 0, &7e, 3, &b0 db 5, 0, &3c, 3, &80 db 5, 0, 0, 0, &e0 db &0b, 0, 0, 0, &40 db &14, 0, 0, 0, &f0 db &14, 0, 0, 0, &28 db &68, 0, 0, 0, &2e db &f0, 0, 0, 0, &1f db &b8, 0, 0, 0, &1b db &f8, 0, 0, 0, &1f db &70, 0, 0, 0, &0e a_skeleton: db 5, 5 db &ff, &ff, &ff, &ff, &ff db &ff, &47, &47, &47, &ff db &ff, &47, &47, &ff, &ff db &47, &47, &47, &47, &47 db &47, &ff, &ff, &ff, &47 g_hunchback1: db &18 db 0, &3c db &3c, &38 db &1c, 0 db 0, &38 db &0e, &38 db &0e, &38 db &0f, &38 db &67, &f8 db 3, &f8 db &60, 0 db &77, &f8 db &37, &38 db &37, &78 db &43, &9c db &1d, &8c db 6, &c2 db &7b, &62 db &7f, &72 db &53, &62 db &73, &44 db &3e, &cc db &1e, &f8 db 5, &f0 db 3, &e0 g_hunchback2: db &18 db &0f, &3c db 7, &38 db 0, 0 db 7, &38 db 7, &38 db 7, &38 db 7, &38 db &37, &f8 db 7, &f8 db &30, 0 db &27, &f8 db &26, &78 db &26, &f8 db 3, &9c db &1d, &8c db 6, &cc db &7b, &66 db &7f, &66 db &53, &66 db &73, &4c db &3e, &cc db &1e, &f8 db 5, &f0 db 3, &e0 g_hunchback3: db &18 db &0f, 0 db 7, &3c db 0, &38 db 7, 0 db 7, &38 db 7, &3c db 7, &3c db &67, &f8 db 7, &f8 db &60, 0 db &77, &f8 db &37, &38 db &37, &38 db &43, &9c db &1d, &8c db 6, &c2 db &7b, &62 db &7f, &72 db &53, &62 db &73, &44 db &3e, &cc db &1e, &f8 db 5, &f0 db 3, &e0 g_barrel_stack: db 5, &1b db 3, &c0, &3c, 3, &c0 db &0f, &f0, &ff, &0f, &f0 db &1f, &f9, &ff, &9f, &f8 db &1f, &f9, &ff, &9f, &f8 db &2f, &f6, &ff, &6f, &f4 db &43, &c0, &3c, 3, &c4 db &30, &0f, 0, &f0, &0c db &2c, &3f, &c3, &fc, &34 db &23, &7f, &e7, &fe, &c4 db &30, &7f, &e7, &fe, &0c db &2c, &bf, &db, &fc, &34 db &13, &8f, 0, &f1, &c8 db &10, &c0, &3c, 3, 8 db &0c, &b0, &ff, &0d, &30 db 3, &8d, &ff, &b1, &c0 db 0, &c1, &ff, &83, 0 db 0, &d2, &ff, &4b, 0 db 0, &4e, &3c, &72, 0 db 0, &43, 0, &c2, 0 db 0, &32, &c3, &4c, 0 db 0, &0e, &3c, &70, 0 db 0, 3, 0, &c0, 0 db 0, 2, &c3, &40, 0 db 0, 1, &3c, &80, 0 db 0, 1, 0, &80, 0 db 0, 0, &c3, 0, 0 db 0, 0, &3c, 0, 0 a_barrel_stack: db 5, 4 db &43, &43, &43, &43, &43 db &43, &43, &43, &43, &43 db &43, &43, &43, &43, &43 db &43, &43, &43, &43, &43 jp_hl: jp (hl) ; moved from 5B80 in original code ; Note: data below must be aligned to 16-byte boundary org &ea90 player: db 0 player_room: db 0 player_contact: db 0 player_x: db 0 player_y: db 0 player_attr: db 0 player_steps_x: db 0 player_steps_y: db 0 weapon: ds 8 sound: ds 8 acg_key_1: ds 8 acg_key_2: ds 8 acg_key_3: ds 8 green_key: ds 8 red_key: ds 8 cyan_key: ds 8 yellow_key: ds 8 leaf: ds 8 tombstone1: ds 8 tombstone2: ds 8 tombstone3: ds 8 tombstone4: ds 8 crucafix: ds 8 spanner: ds 8 wine: ds 8 coin: ds 8 wing: ds 8 whip: ds 8 frogsleg: ds 8 jewel: ds 8 moneybag: ds 8 skull: ds 8 food_items: ds 640 food_end: ds 128 some_room: ds 8 creature1: ds 16 creature2: ds 16 creature3: ds 16 mummy: ds 16 dracula: ds 16 devil: ds 16 frankenstein: ds 16 hunchback: ds 16 linked_items: ds 4384 end start