1 SECTION code_driver 2 3 PUBLIC plot 4 PUBLIC _plot 5 6 GLOBAL __mode 7 GLOBAL gmode 8 GLOBAL __fgcolour 9 GLOBAL __bgcolour 10 GLOBAL __draw_mode 11 GLOBAL asm_plot 12 13 INCLUDE "target/gb/def/gb_globals.def" 14 15 ;; Old, compatible version of plot() 16;void __LIB__ plot(uint8_t x, uint8_t y, uint8_t colour, uint8_t mode) __smallc; 17 PUBLIC plot 18 PUBLIC _plot 19plot: 20_plot: ; Banked 21 PUSH BC 22 23 LD A,(__mode) 24 CP G_MODE 25 CALL NZ,gmode 26 27 LD HL,sp+10 ; Skip return address and registers 28 LD B,(HL) ; B = x 29 ld hl,sp+8 30 LD C,(HL) ; C = y 31 ld hl,sp+6 32 LD A,(HL) ; colour 33 LD (__fgcolour),A 34 ld hl,sp+4 35 LD A,(HL) ; mode 36 LD (__draw_mode),A 37 38 CALL asm_plot 39 40 POP BC 41 RET