aboutsummaryrefslogtreecommitdiff
path: root/dostsr.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-04-03 21:23:10 +0200
committerJavier <dev.git@javispedro.com>2022-04-03 21:23:10 +0200
commita5abb118e0e61587adfa7b4e4cc72948311381d3 (patch)
treeb226705401bd0b4c78399c621cebc1fbab6003b9 /dostsr.h
parent7d93442564b57c2d292df7f823c2115d3e0b8c12 (diff)
downloadvbados-a5abb118e0e61587adfa7b4e4cc72948311381d3.tar.gz
vbados-a5abb118e0e61587adfa7b4e4cc72948311381d3.zip
try to handle graphical cursor rendering in a more generic way
Diffstat (limited to 'dostsr.h')
-rw-r--r--dostsr.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/dostsr.h b/dostsr.h
index e64c93e..7f1200b 100644
--- a/dostsr.h
+++ b/dostsr.h
@@ -25,6 +25,7 @@
#include "vbox.h"
#include "int2fwin.h"
+#include "int10vga.h"
#define USE_VIRTUALBOX 1
#define USE_INT2F 1
@@ -34,6 +35,9 @@
#define GRAPHIC_CURSOR_WIDTH 16
#define GRAPHIC_CURSOR_HEIGHT 16
+#define GRAPHIC_CURSOR_SCANLINE_LEN 2
+#define GRAPHIC_CURSOR_MASK_LEN (GRAPHIC_CURSOR_HEIGHT * GRAPHIC_CURSOR_SCANLINE_LEN)
+#define GRAPHIC_CURSOR_DATA_LEN (2 * GRAPHIC_CURSOR_MASK_LEN)
#define VERSION_MAJOR 0
#define VERSION_MINOR 3
@@ -55,16 +59,15 @@ typedef struct tsrdata {
bool usewheel;
// Video settings
- /** Current video mode. */
- uint8_t screen_mode;
- /** Active video page. */
- uint8_t screen_page;
+ /** Information of the current video mode. */
+ struct modeinfo video_mode;
/** Max (virtual) coordinates of full screen in the current mode.
* Used for rendering graphic cursor, mapping absolute coordinates,
* and initializing the default min/max window. */
struct point screen_max;
- /** Some graphic modes have pixel doubling, so the virtual coordinates
- * are double vs real framebuffer coordinates. */
+ /** In some modes, the virtual coordinates are larger than the
+ * physical screen coordinates.
+ * real coordinates = virtual coordinates * screen_scale. */
struct point screen_scale;
// Detected mouse hardware
@@ -89,7 +92,7 @@ typedef struct tsrdata {
/** Hotspot for the graphic cursor. */
struct point cursor_hotspot;
/** Masks for the graphic cursor. */
- uint16_t cursor_graphic[GRAPHIC_CURSOR_HEIGHT*2];
+ uint16_t cursor_graphic[GRAPHIC_CURSOR_DATA_LEN/sizeof(uint16_t)];
// Current mouse status
/** Current cursor position (in pixels). */