1 SECTION code_driver 2 3 PUBLIC box 4 PUBLIC _box 5 6 GLOBAL __tempx_s 7 GLOBAL __tempy_s 8 GLOBAL __mode 9 GLOBAL gmode 10 GLOBAL __fillstyle 11 GLOBAL asm_box 12 13 14 INCLUDE "target/gb/def/gb_globals.def" 15 16; void __LIB__ box(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t __fillstyle) __smallc; 17box: 18_box: ; Banked 19 PUSH BC 20 21 LD A,(__mode) 22 CP G_MODE 23 CALL NZ,gmode 24 25 LD HL,sp+12 ; Skip return address and registers 26 LD A,(HL) ; B = x1 27 LD (__tempx_s),A 28 ld hl,sp+10 29 LD A,(HL) ; C = y1 30 LD (__tempy_s),A 31 ld hl,sp+8 32 LD A,(HL) ; D = x2 33 LD (__tempx_s+1),A 34 ld hl,sp+6 35 LD A,(HL) ; E = y2 36 LD (__tempy_s+1),A 37 ld hl,sp+4 38 LD A,(HL) 39 LD (__fillstyle),A 40 CALL asm_box 41 POP BC 42 RET