1; Platform specific colour transformation 2; 3; Entry: a = colour 4; Exit: a = colour to use on screen 5; Used: hl,bc,f 6; 7 8 SECTION code_clib 9 PUBLIC conio_map_colour 10 11 EXTERN __CLIB_CONIO_NATIVE_COLOUR 12 13conio_map_colour: 14 ld c,__CLIB_CONIO_NATIVE_COLOUR 15 rr c 16 ret c 17 18 and 15 19 ld c,a 20 ld b,0 21 ld hl,table 22 add hl,bc 23 ld a,(hl) 24 ret 25 26 SECTION rodata_clib 27table: 28 defb $0 ;BLACK -> BLACK 29 defb $1 ;BLUE -> BLUE 30 defb $4 ;GREEN -> GREEN 31 defb $5 ;CYAN -> CYAN 32 defb $2 ;RED -> RED 33 defb $3 ;MAGENTA -> MAGENTA 34 defb $2 ;BROWN -> RED 35 defb $7 ;LIGHTGRAY -> WHITE 36 defb $7 ;DARKGRAY -> WHITE 37 defb $1 ;LIGHTBLUE -> BLUE 38 defb $4 ;LIGHTGREEN -> GREEN 39 defb $5 ;LIGHTCYAN -> CYAN 40 defb $2 ;LIGHTRED -> RED 41 defb $3 ;LIGHTMAGENTA -> MAGENTA 42 defb $6 ;YELLOW -> YELLOW 43 defb $7 ;WHITE -> WHITE 44 45