;-------------------------------------------------------- ; File Created by SDCC : free open source ISO C Compiler ; Version 4.5.0 #15242 (Mac OS X x86_64) ;-------------------------------------------------------- .module bt2 .optsdcc -mz80 sdcccall(1) ;-------------------------------------------------------- ; Public variables in this module ;-------------------------------------------------------- .globl b_pop_level_guard .globl _pop_level_guard .globl _tk_gs_tile .globl _tk_guard_room ;-------------------------------------------------------- ; special function registers ;-------------------------------------------------------- ;-------------------------------------------------------- ; ram data ;-------------------------------------------------------- .area _DATA _tk_guard_room:: .ds 1 _tk_gs_tile:: .ds 8 ;-------------------------------------------------------- ; ram data ;-------------------------------------------------------- .area _INITIALIZED ;-------------------------------------------------------- ; absolute external ram data ;-------------------------------------------------------- .area _DABS (ABS) ;-------------------------------------------------------- ; global & static initialisations ;-------------------------------------------------------- .area _HOME .area _GSINIT .area _GSFINAL .area _GSINIT ;-------------------------------------------------------- ; Home ;-------------------------------------------------------- .area _HOME .area _HOME ;-------------------------------------------------------- ; code ;-------------------------------------------------------- .area _CODE ;bt2.c:6: uint8_t pop_level_guard(uint8_t room, uint8_t *tile, int8_t *dir, ; --------------------------------- ; Function pop_level_guard ; --------------------------------- b_pop_level_guard = 0 _pop_level_guard:: call ___sdcc_enter_ix push af push af ;bt2.c:9: if (room < 1 || room > TK_ROOMS) return 0; ld a, 7 (ix) sub a, #0x01 jr C, 00101$ ld a, #0x08 sub a, 7 (ix) jr NC, 00102$ 00101$: xor a, a jr 00108$ 00102$: ;bt2.c:10: if (tk_gs_tile[room - 1] < 30) { ld bc, #_tk_gs_tile+0 ld a, 7 (ix) dec a ld l, a rlca sbc a, a ld h, a add hl, bc ld l, (hl) ;bt2.c:11: *tile = tk_gs_tile[room - 1]; *dir = 0; *color = 0; *skill = 1; ld e, 8 (ix) ld d, 9 (ix) ld c, 10 (ix) ld b, 11 (ix) ld a, 12 (ix) ld -4 (ix), a ld a, 13 (ix) ld -3 (ix), a ld a, 14 (ix) ld -2 (ix), a ld a, 15 (ix) ld -1 (ix), a ;bt2.c:10: if (tk_gs_tile[room - 1] < 30) { ;bt2.c:11: *tile = tk_gs_tile[room - 1]; *dir = 0; *color = 0; *skill = 1; ld a,l cp a,#0x1e jr NC, 00105$ ld (de), a xor a, a ld (bc), a pop hl ld (hl), #0x00 ;bt2.c:12: return 1; ex de,hl pop hl push hl push de ld (hl), #0x01 jr 00108$ 00105$: ;bt2.c:14: if (room == tk_guard_room) { ld a, 7 (ix) ld hl, #_tk_guard_room sub a, (hl) jr NZ, 00107$ ;bt2.c:15: *tile = 11; *dir = 0; *color = 0; *skill = 1; ld a, #0x0b ld (de), a xor a, a ld (bc), a pop hl ld (hl), #0x00 ;bt2.c:16: return 1; ex de,hl pop hl push hl push de ld (hl), #0x01 jr 00108$ 00107$: ;bt2.c:18: return 0; xor a, a 00108$: ;bt2.c:19: } ld sp, ix pop ix ret .area _CODE .area _INITIALIZER .area _CABS (ABS)