]> git.sur5r.net Git - cc65/commitdiff
Merge pull request #507 from jedeoric/master
authorOliver Schmidt <ol.sc@web.de>
Wed, 25 Oct 2017 14:49:14 +0000 (14:49 +0000)
committerGitHub <noreply@github.com>
Wed, 25 Oct 2017 14:49:14 +0000 (14:49 +0000)
[telestrat] tgi_line & tgi_outtext are available, toascii.s added, doc updated

asminc/telestrat.inc
doc/telestrat.sgml
libsrc/telestrat/tgi/telestrat-228-200-3.s
libsrc/telestrat/tgi/telestrat-240-200-2.s

index 424047725f2524aa69caec15106ab2886d4fb443..737c4b6aeedba94e42b8bf793242fbe9078fe06b 100644 (file)
@@ -17,12 +17,12 @@ FNAME_LEN       = 11            ; maximum length of file-name
 
 ; ---------------------------------------------------------------------------
 ; I/O Identifier
-; this identifers are used for channel management
+; theses identifers are used for channel management
 ; 
 
-XKBD            = $80           ; Keyboard
+XKBD            = $80           ; keyboard
 XRSE            = $83           ; RS232 in
-XSCR            = $88           ; Screen
+XSCR            = $88           ; screen
 XRSS            = $90           ; RS232 out
 
 
@@ -152,7 +152,7 @@ SCREEN          := $BB80
 XRD0             = $08
 XRDW0            = $0C
 XWR0             = $10 
-XWSTR0           = $14 
+XWSTR0           = $14          ; write a string in text mode
 XTEXT            = $19
 XHIRES           = $1A
 XFILLM           = $1C
@@ -165,16 +165,16 @@ XCSSCR           = $35          ; switch on cursor
 XCLOSE           = $3A          ; only in TELEMON 3.x Close file
 XFWRITE          = $3B          ; only in TELEMON 3.x write file
 XSONPS           = $40
-XOUPS            = $42
+XOUPS            = $42          ; send Oups sound into PSG
 XPLAY            = $43
 XSOUND           = $44 
 XMUSIC           = $45 
 XZAP             = $46
 XSHOOT           = $47
-XSOUT            = $67          ; Send A register to RS232, available in telemon 2.4 & 3.x
-XHRSSE           = $8C          ; Put in X and Y
-XDRAWA           = $8D          ; Draw a line 
-XDRAWR           = $8E          ; Draw a line 
+XSOUT            = $67          ; send A register to RS232, available in telemon 2.4 & 3.x
+XHRSSE           = $8C          ; set hires position cursor
+XDRAWA           = $8D          ; draw a line 
+XDRAWR           = $8E          ; draw a line 
 XCIRCL           = $8F
 XCURSE           = $90
 XCURMO           = $91
@@ -184,7 +184,7 @@ XBOX             = $94
 XABOX            = $95
 XFILL            = $96
 XCHAR            = $97
-XSCHAR           = $98          ; Draw a string
+XSCHAR           = $98          ; draw a string in hires
 XEXPLO           = $9C 
 XPING            = $9D
 
@@ -199,7 +199,7 @@ SCRX             := $220
 SCRY             := $224
 ADSCRL           := $218
 ADSCRH           := $21C
-HRSPAT           := $2AA        ; Hires pattern : it's used to draw pattern for a line or a circle
+HRSPAT           := $2AA        ; hires pattern : it's used to draw pattern for a line or a circle
 IRQVECTOR        := $2FA
 
 
index 243097a84962cf4ae2bef84ba65e79abc4ab25be..2d05f898539648e432ec553c40349566bc7243d1 100644 (file)
@@ -9,9 +9,10 @@
 <date>2017-01-22
 
 <abstract>
-An overview over the Telestrat (<url name="Telemon 3.0"
-url="http://orix.oric.org">) runtime system as it is implemented for the
-cc65 C compiler.
+
+An overview over the Telestrat (Telemon 2.4 & Telemon 3.x : http://orix.oric.org) runtime system as it is implemented for the cc65 C
+compiler.)
+
 </abstract>
 
 <!-- Table of contents -->
@@ -117,6 +118,21 @@ structures; accessing the struct fields will access the chip registers.
 
 <sect>Loadable drivers<p>
 
+<sect1>TGI<p>
+
+TGI drivers is available on Oric Telestrat with some functions :
+
+<itemize>
+<item>
+<item>tgi_install
+<item>tgi_init
+<item>tgi_clear
+<item>tgi_setpixel
+<item>tgi_getmaxx
+<item>tgi_getmaxy
+</itemize>
+
+
 <sect1>Extended memory drivers<p>
 
 No extended memory drivers are currently available for the Telestrat.
@@ -143,7 +159,7 @@ Telestrat manages also mouse, but it had been no handled yet in this version.
 
 <descrip>
 
-Telestrat has a RS232 port, but it's not used
+Telestrat has a RS232 port, but it's not usable in cc65.
 
 </descrip>
 
index e20c2c8777caa8dd29638d87206cd7029dba1e3f..09c308e269b52ed493083fe6e8b85a0ac335f8c1 100644 (file)
@@ -255,14 +255,16 @@ GETDEFPALETTE:
 ;
 
 SETPIXEL:
+        lda #$80
         
+SETPIXELSETMODE:
+        sta HRSFB
         lda X1
         sta HRS1
         lda Y1
         sta HRS2
         
-        lda #$80
-        sta HRSFB
+
         
         BRK_TELEMON(XCURSE)
         
@@ -286,8 +288,24 @@ GETPIXEL:
 
 LINE:
         ; not done yet
+        lda   X1
+        sta   HRS1
+        lda   Y1
+        sta   HRS2
+        
+        lda   X2
+        sta   HRS3
+        lda   Y2
+        sta   HRS4
+        
+        lda   #$ff
+        sta   HRSPAT
+
+        BRK_TELEMON(XDRAWA)
         rts
 
+     
+        
 CIRCLE:
         ; not done yet
         rts
@@ -332,5 +350,25 @@ TEXTSTYLE:
 ;
 
 OUTTEXT:
-        ; not done yet
+        ; put hires cursor in X & Y
+        lda   #$00
+        jsr   SETPIXELSETMODE
+        
+        
+        ; count the length of the string
+        ldy   #$00
+loop:        
+        lda   (ptr3),y
+        beq   out
+        iny
+        bne   loop
+out:
+        ; XSCHAR routine from telemon needs to have the length of the string in X register
+        ; copy Y register to X register. It could be optimized in 65C02 with TYX
+        tya 
+        tax
+    
+        lda   ptr3     ; XSCHAR needs in A and Y the adress of the string        
+        ldy   ptr3+1    
+        BRK_TELEMON(XSCHAR)
         rts
index fcc1ce3f2d103f096dedd0c5871751fbd6e89d6e..8a30ddd45f85e779fc9572fc9752c2fdabce2779 100644 (file)
@@ -125,7 +125,7 @@ INIT:
 ; Switch into graphics mode
 
         BRK_TELEMON(XHIRES)
-
+      
 ; Done, reset the error code
 
         lda     #TGI_ERR_OK
@@ -248,14 +248,16 @@ GETDEFPALETTE:
 ;
 
 SETPIXEL:
+        lda #$80       ; curset on 
+SETPIXELSETMODE:        
+        sta HRSFB
         
         lda X1
         sta HRS1
         lda Y1
         sta HRS2
         
-        lda #$80       ; curset on 
-        sta HRSFB
+        
         
         BRK_TELEMON(XCURSE)
 
@@ -278,9 +280,24 @@ GETPIXEL:
 ;
 
 LINE:
-        ; not done yet
-        rts
 
+        lda   X1
+        sta   HRS1
+        lda   Y1
+        sta   HRS2
+
+        lda   X2
+        sta   HRS3
+        lda   Y2
+        sta   HRS4
+        
+        lda   #$ff
+        sta   HRSPAT
+
+        BRK_TELEMON(XDRAWA)
+
+        rts
+        
 CIRCLE:    
         ; not done yet
         rts      
@@ -325,5 +342,25 @@ TEXTSTYLE:
 ;
 
 OUTTEXT:
-        ; Not done yet
+        ; put hires cursor in X & Y
+        lda   #$00
+        jsr   SETPIXELSETMODE
+        
+        
+        ; count the length of the string
+        ldy   #$00
+loop:        
+        lda   (ptr3),y
+        beq   out
+        iny
+        bne   loop
+out:
+        ; XSCHAR routine from telemon needs to have the length of the string in X register
+        ; copy Y register to X register. It could be optimized in 65C02 with TYX
+        tya 
+        tax
+    
+        lda   ptr3     ; XSCHAR needs in A and Y the adress of the string        
+        ldy   ptr3+1    
+        BRK_TELEMON(XSCHAR)
         rts