trs80m1: report presence of hr1g globally
authorAlan Cox <alan@linux.intel.com>
Fri, 6 Jul 2018 00:12:51 +0000 (01:12 +0100)
committerAlan Cox <alan@linux.intel.com>
Fri, 6 Jul 2018 00:12:51 +0000 (01:12 +0100)
We need this unfortunate visibility because if you have an HR1G you can't have
an Alpha joystick (polling the joystick turns off the graphics card!)

Kernel/platform-trs80m1/devgfx.c
Kernel/platform-trs80m1/devgfx.h

index d7feb4d..047ebcb 100644 (file)
@@ -17,6 +17,7 @@ __sfr __at 0x82 gfx_data;
 __sfr __at 0x83 gfx_ctrl;
 __sfr __at 0xFF ioctrl;
 
+uint8_t has_hr1g;
 static uint8_t max_mode = 0;
 
 static struct display trsdisplay[4] = {
@@ -162,6 +163,7 @@ void gfx_init(void)
     if (hrg_data != 0xFF) {    /* We ought to test more carefully */
       max_mode = 1;
       displaymap[1] = 3;
+      has_hr1g = 1;
     }
   } else if (trs80_model == TRS80_MODEL3) {
     /* The model 3 might have an 80-Grafix UDG card, or a Graphyx
index db1ac10..ba30f99 100644 (file)
@@ -6,4 +6,6 @@
 extern int gfx_ioctl(uint8_t minor, uarg_t arg, char *ptr);
 extern void gfx_init(void);
 
+extern uint8_t has_hr1g;
+
 #endif