1 2 3 SECTION code_clib 4 PUBLIC generic_console_ioctl 5 6 EXTERN __console_w 7 EXTERN generic_console_font32 8 EXTERN generic_console_udg32 9 EXTERN __fp1100_mode 10 11 INCLUDE "target/fp1100/def/fp1100.def" 12 INCLUDE "ioctl.def" 13 14 PUBLIC CLIB_GENCON_CAPS 15 defc CLIB_GENCON_CAPS = CAP_GENCON_FG_COLOUR | CAP_GENCON_BG_COLOUR | CAP_GENCON_INVERSE 16 17generic_console_ioctl: 18 ex de,hl 19 ld c,(hl) ;bc = where we point to 20 inc hl 21 ld b,(hl) 22 cp IOCTL_GENCON_SET_FONT32 23 jr nz,check_set_udg 24 ld (generic_console_font32),bc 25success: 26 and a 27 ret 28check_set_udg: 29 cp IOCTL_GENCON_SET_UDGS 30 jr nz,check_set_mode 31 ld (generic_console_udg32),bc 32 jr success 33check_set_mode: 34 cp IOCTL_GENCON_SET_MODE 35 jr nz,failure 36 ld a,c 37 ld b,0 38 ld l,40 39 and 1 40 jr z,setmode 41 ld b,1 42 ld l,80 43 dec a 44 jr z,setmode 45failure: 46 scf 47 ret 48 49setmode: 50 ld a,c 51 ld (__fp1100_mode),a 52 ld a,l 53 ld (__console_w),a 54 ld a,SUB_SCREENSIZE 55 call TRNC2 56 and a 57 ret 58