]> git.sur5r.net Git - cc65/commitdiff
Working
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 21 Jun 2002 21:15:46 +0000 (21:15 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 21 Jun 2002 21:15:46 +0000 (21:15 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1317 b7a2c559-68d2-44c3-8de9-860c34a00d81

asminc/tgi-kernel.inc
include/tgi/tgi-kernel.h
libsrc/tgi/tgi-kernel.s
libsrc/tgi/tgi_getxres.s
libsrc/tgi/tgi_getyres.s

index 554cde1963b092206ad87900c50784159137cf1b..96183bf69f99279f83ba9b50af0af96ea603120f 100644 (file)
@@ -66,6 +66,8 @@ TGI_HDR_JUMPCOUNT       = 12            ; Number of jump vectors
        .global _tgi_drv                ; Pointer to driver
        .global _tgi_error              ; Last error code
         .global _tgi_mode               ; Graphics mode or zero
+        .global _tgi_xres               ; X resolution of the current mode
+        .global _tgi_yres               ; Y resolution of the current mode 
 
 ;------------------------------------------------------------------------------
 ; Driver entry points
index 263fac5140b0976bfc3243834b744b8ef72791d8..3e11ba94fbf82b692c6410c22d83a84181fcc6c3 100644 (file)
@@ -80,6 +80,8 @@ typedef struct {
 extern tgi_drv_header* tgi_drv;        /* Pointer to driver */
 extern unsigned char   tgi_error;      /* Last error code */
 extern unsigned char    tgi_mode;       /* Graphics mode or zero */
+extern unsigned         tgi_xres;       /* X resolution of the current mode */
+extern unsigned         tgi_yres;       /* Y resolution of the current mode */
 
 
 
@@ -91,7 +93,7 @@ extern unsigned char    tgi_mode;       /* Graphics mode or zero */
 
 const char* __fastcall__ tgi_map_mode (unsigned char mode);
 /* Map a tgi mode to a driver name. Returns NULL if no driver available. */
-                      
+
 void __fastcall__ tgi_setup (void);
 /* Setup the driver and graphics kernel once the driver is loaded */
 
index 3d1ab24b11f8da3735be050d9ba63f729e632728..521ecb7417b91071c9a1d5508a9462b078696df0 100644 (file)
@@ -18,7 +18,9 @@
 _tgi_drv:      .res    2               ; Pointer to driver
 _tgi_error:    .res    1               ; Last error code
 _tgi_mode:      .res    1               ; Graphics mode or zero
-
+_tgi_xres:      .res    2               ; X resolution of the current mode
+_tgi_yres:      .res    2               ; Y resolution of the current mode
+        
 
 .data
 
@@ -51,17 +53,33 @@ copy:   lda     (ptr1),y
 
 
 _tgi_setup:
-       jsr     tgi_set_ptr
+       jsr     tgi_set_ptr             ; load _tgi_drv into ptr1
+
+; Copy the jump vectors
 
         ldy     #TGI_HDR_JUMPTAB
         ldx     #0
-
 @L1:    inx                             ; Skip JMP opcode
         jsr     copy                    ; Copy one byte
         jsr     copy                    ; Copy one byte
         cpx     #(TGI_HDR_JUMPCOUNT*3)
         bne     @L1
 
+; Copy the screen dimensions
+
+        ldy     #TGI_HDR_XRES
+        lda     (ptr1),y
+        sta     _tgi_xres
+        iny
+        lda     (ptr1),y
+        sta     _tgi_xres+1
+        ldy     #TGI_HDR_YRES
+        lda     (ptr1),y
+        sta     _tgi_yres
+        iny
+        lda     (ptr1),y
+        sta     _tgi_yres+1
+
 ; Initialize variables
 
         lda     #$00
index 0bb58fe430f5c594f9f58bea5dc8ffcb28ef1987..2a85205c8cc20fcc5c2d52cfefe9b0e81c3ce8ee 100644 (file)
@@ -7,13 +7,11 @@
 
         .include        "tgi-kernel.inc"
         .export         _tgi_getxres
-        .import         ldaxidx
 
 
 _tgi_getxres:
-        lda     _tgi_drv
-        ldx     _tgi_drv+1
-        ldy     #TGI_HDR_XRES+1
-        jmp     ldaxidx
+        lda     _tgi_xres
+        ldx     _tgi_xres+1
+        rts
 
 
index 4b8b26d45d4b17bfdde7424fa9ef367d50dd2833..172d64f12d1812ddd76eb9d53b046bd1d014b8df 100644 (file)
@@ -11,9 +11,8 @@
 
 
 _tgi_getyres:
-        lda     _tgi_drv
-        ldx     _tgi_drv+1
-        ldy     #TGI_HDR_YRES+1
-        jmp     ldaxidx
+        lda     _tgi_yres
+        ldx     _tgi_yres+1
+        rts