TXT system calls

Added the system calls for most of the text routines, and added them to the documentation.
This commit is contained in:
Peter Weingartner 2022-03-12 22:08:54 -05:00
parent d8bf48e4d3
commit 8841764f66
10 changed files with 12323 additions and 12114 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -214,7 +214,7 @@ extern void txt_set_cursor(short screen, short enable, short rate, char c);
*
* @return 0 on success, any other number means the region was invalid
*/
extern short txt_set_region(short screen, p_rect region);
extern short txt_get_region(short screen, p_rect region);
/**
* Set a region to restrict further character display, scrolling, etc.

File diff suppressed because it is too large Load diff

View file

@ -48,7 +48,6 @@
#define KFN_CHAN_REGISTER 0x19 /* Register a channel device driver */
#define KFN_CHAN_OPEN 0x1A /* Open a channel device */
#define KFN_CHAN_CLOSE 0x1B /* Close an open channel (not for files) */
#define KFN_TEXT_SETSIZES 0x1C /* Adjusts the screen size based on the current graphics mode */
/* Block device system calls */
@ -95,6 +94,26 @@
#define KFN_KBD_LAYOUT 0x54 /* Set the translation tables for the keyboard */
#define KFN_ERR_MESSAGE 0x55 /* Return an error description, given an error number */
/* Text Device Calls */
#define KFN_TEXT_INIT_SCREEN 0x60 /* Reset a screen to its default mode */
#define KFN_TXT_GET_CAPS 0x61 /* Get the capabilities of a screen */
#define KFN_TXT_SET_MODE 0x62 /* Set the display mode of a screen */
#define KFN_TEXT_SETSIZES 0x63 /* Adjusts the screen size based on the current graphics mode */
#define KFN_TXT_SET_RESOLUTION 0x64 /* Set the base display resolution for a screen */
#define KFN_TXT_SET_BORDER 0x65 /* Set the size of the border */
#define KFN_TXT_SET_BORDERCOLOR 0x66 /* Set the border color */
#define KFN_TXT_SET_FONT 0x67 /* Set the font for the screen's text mode (if applicable) */
#define KFN_TXT_SET_CURSOR 0x68 /* Set the text-mode cursor look */
#define KFN_TXT_SET_REGION 0x69 /* Sets the clipping/scrolling region for further text operations */
#define KFN_TXT_GET_REGION 0x6A /* Gets the current clipping/scrolling region */
#define KFN_TXT_SET_COLOR 0x6B /* Sets the foreground and background text colors */
#define KFN_TXT_GET_COLOR 0x6C /* Gets the foreground and background text colors */
#define KFN_TXT_SET_XY 0x6D /* Sets the cursor's position */
#define KFN_TXT_GET_XY 0x6E /* Gets the cursor's position */
#define KFN_TXT_SCROLL 0x6F /* Scroll the current region */
// #define KFN_TXT_FILL 0x70 /* Fill the current region */
/*
* Call into the kernel (provided by assembly)
*/

View file

@ -110,10 +110,6 @@ unsigned long syscall_dispatch(int32_t function, int32_t param0, int32_t param1,
case KFN_CHAN_REGISTER:
return cdev_register((p_dev_chan)param0);
case KFN_TEXT_SETSIZES:
txt_setsizes((short)param0);
return 0;
default:
return ERR_GENERAL;
}
@ -253,6 +249,87 @@ unsigned long syscall_dispatch(int32_t function, int32_t param0, int32_t param1,
default:
return ERR_GENERAL;
}
break;
case 0x60:
/* Text mode operations */
switch (function) {
case KFN_TEXT_INIT_SCREEN:
/* Reset a screen to its default mode */
txt_init_screen((short)param0);
return 0;
case KFN_TXT_GET_CAPS:
/* Get the capabilities of a screen */
return (unsigned long)txt_get_capabilities((short)param0);
case KFN_TXT_SET_MODE:
/* Set the display mode of a screen */
return txt_set_mode((short)param0, (short)param1);
case KFN_TEXT_SETSIZES:
/* Adjusts the screen size based on the current graphics mode */
return txt_setsizes((short)param0);
case KFN_TXT_SET_RESOLUTION:
/* Set the base display resolution for a screen */
return txt_set_resolution((short)param0, (short)param1, (short)param2);
case KFN_TXT_SET_BORDER:
/* Set the size of the border */
txt_set_border((short)param0, (short)param1, (short)param2);
return 0;
case KFN_TXT_SET_BORDERCOLOR:
/* Set the border color */
txt_set_border_color((short)param0, (unsigned char)param1, (unsigned char)param2, (unsigned char)param3);
return 0;
case KFN_TXT_SET_FONT:
/* Set the font for the screen's text mode (if applicable) */
return txt_set_font((short)param0, (short)param1, (short)param2, (unsigned char *)param3);
case KFN_TXT_SET_CURSOR:
/* Set the text-mode cursor look */
txt_set_cursor((short)param0, (short)param1, (short)param2, (char)param3);
return 0;
case KFN_TXT_SET_REGION:
/* Sets the clipping/scrolling region for further text operations */
return txt_set_region((short)param0, (p_rect)param1);
case KFN_TXT_GET_REGION:
/* Gets the current clipping/scrolling region */
return txt_get_region((short)param0, (p_rect)param1);
case KFN_TXT_SET_COLOR:
/* Sets the foreground and background text colors */
return txt_set_color((short)param0, (unsigned char)param1, (unsigned char)param2);
case KFN_TXT_GET_COLOR:
/* Gets the foreground and background text colors */
txt_get_color((short)param0, (unsigned char *)param1, (unsigned char *)param2);
return 0;
case KFN_TXT_SET_XY:
/* Sets the cursor's position */
txt_set_xy((short)param0, (short)param1, (short)param2);
return 0;
case KFN_TXT_GET_XY:
/* Gets the cursor's position */
txt_get_xy((short)param0, (p_point)param1);
return 0;
case KFN_TXT_SCROLL:
/* Scroll the current region */
txt_scroll((short)param0, (short)param1, (short)param2);
return 0;
default:
return ERR_GENERAL;
}
break;
default:
break;

View file

@ -109,10 +109,6 @@ unsigned long syscall_dispatch(int32_t function, int32_t param0, int32_t param1,
case KFN_CHAN_REGISTER:
return cdev_register((p_dev_chan)param0);
case KFN_TEXT_SETSIZES:
text_setsizes((short)param0);
return 0;
default:
return ERR_GENERAL;
}
@ -245,6 +241,86 @@ unsigned long syscall_dispatch(int32_t function, int32_t param0, int32_t param1,
return ERR_GENERAL;
}
case 0x60:
/* Text mode operations */
switch (function) {
case KFN_TEXT_INIT_SCREEN:
/* Reset a screen to its default mode */
txt_init_screen((short)param0);
return 0;
case KFN_TXT_GET_CAPS:
/* Get the capabilities of a screen */
return (unsigned long)txt_get_capabilities((short)param0);
case KFN_TXT_SET_MODE:
/* Set the display mode of a screen */
return txt_set_mode((short)param0, (short)param1);
case KFN_TEXT_SETSIZES:
/* Adjusts the screen size based on the current graphics mode */
return txt_setsizes((short)param0);
case KFN_TXT_SET_RESOLUTION:
/* Set the base display resolution for a screen */
return txt_set_resolution((short)param0, (short)param1, (short)param2);
case KFN_TXT_SET_BORDER:
/* Set the size of the border */
txt_set_border((short)param0, (short)param1, (short)param2);
return 0;
case KFN_TXT_SET_BORDERCOLOR:
/* Set the border color */
txt_set_border_color((short)param0, (unsigned char)param1, (unsigned char)param2, (unsigned char)param3);
return 0;
case KFN_TXT_SET_FONT:
/* Set the font for the screen's text mode (if applicable) */
return txt_set_font((short)param0, (short)param1, (short)param2, (unsigned char *)param3);
case KFN_TXT_SET_CURSOR:
/* Set the text-mode cursor look */
txt_set_cursor((short)param0, (short)param1, (short)param2, (char)param3);
return 0;
case KFN_TXT_SET_REGION:
/* Sets the clipping/scrolling region for further text operations */
return txt_set_region((short)param0, (p_rect)param1);
case KFN_TXT_GET_REGION:
/* Gets the current clipping/scrolling region */
return txt_get_region((short)param0, (p_rect)param1);
case KFN_TXT_SET_COLOR:
/* Sets the foreground and background text colors */
return txt_set_color((short)param0, (unsigned char)param1, (unsigned char)param2);
case KFN_TXT_GET_COLOR:
/* Gets the foreground and background text colors */
txt_get_color((short)param0, (unsigned char *)param1, (unsigned char *)param2);
return 0;
case KFN_TXT_SET_XY:
/* Sets the cursor's position */
txt_set_xy((short)param0, (short)param1, (short)param2);
return 0;
case KFN_TXT_GET_XY:
/* Gets the cursor's position */
txt_get_xy((short)param0, (p_point)param1);
return 0;
case KFN_TXT_SCROLL:
/* Scroll the current region */
txt_scroll((short)param0, (short)param1, (short)param2);
return 0;
default:
return ERR_GENERAL;
}
break;
default:
break;
}

16611
src/mapfile

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,7 @@
#define __VERSION_H
#define VER_MAJOR 0
#define VER_MINOR 3
#define VER_BUILD 8
#define VER_MINOR 4
#define VER_BUILD 1
#endif