From 93f202850ab2350da3e32a6a790248ca618c9a08 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 22 Oct 2017 23:06:56 +0200 Subject: [PATCH 1/6] toascii.s added, doc updated, tgi_line & tgi_outtext are available --- asminc/telestrat.inc | 8 ++-- doc/telestrat.sgml | 19 ++++++++- libsrc/telestrat/tgi/telestrat-228-200-3.s | 40 +++++++++++++++++- libsrc/telestrat/tgi/telestrat-240-200-2.s | 49 +++++++++++++++++++--- libsrc/telestrat/toascii.s | 14 +++++++ 5 files changed, 117 insertions(+), 13 deletions(-) create mode 100644 libsrc/telestrat/toascii.s diff --git a/asminc/telestrat.inc b/asminc/telestrat.inc index 424047725..352aa0657 100644 --- a/asminc/telestrat.inc +++ b/asminc/telestrat.inc @@ -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,14 +165,14 @@ 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 ; sends 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 +XHRSSE = $8C ; Set hires position cursor XDRAWA = $8D ; Draw a line XDRAWR = $8E ; Draw a line XCIRCL = $8F @@ -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 diff --git a/doc/telestrat.sgml b/doc/telestrat.sgml index fda4dee86..0c85c68c5 100644 --- a/doc/telestrat.sgml +++ b/doc/telestrat.sgml @@ -9,7 +9,7 @@ 2017-01-22 -An overview over the Telestrat (Telemon 3.0 : http://orix.oric.org) runtime system as it is implemented for the cc65 C +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.) @@ -113,6 +113,21 @@ structures; accessing the struct fields will access the chip registers. Loadable drivers

+TGI

+ +TGI drivers is available on Oric Telestrat with some functions : + + + +tgi_install +tgi_init +tgi_clear +tgi_setpixel +tgi_getmaxx +tgi_getmaxy + + + Extended memory drivers

No extended memory drivers are currently available for the Telestrat. @@ -139,7 +154,7 @@ Telestrat manages also mouse, but it had been no handled yet in this version. -Telestrat has a RS232 port, but it's not used +Telestrat has a RS232 port, but it's not usable in cc65. diff --git a/libsrc/telestrat/tgi/telestrat-228-200-3.s b/libsrc/telestrat/tgi/telestrat-228-200-3.s index e20c2c877..a4313b092 100644 --- a/libsrc/telestrat/tgi/telestrat-228-200-3.s +++ b/libsrc/telestrat/tgi/telestrat-228-200-3.s @@ -286,9 +286,27 @@ 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 diff --git a/libsrc/telestrat/tgi/telestrat-240-200-2.s b/libsrc/telestrat/tgi/telestrat-240-200-2.s index fcc1ce3f2..8a30ddd45 100644 --- a/libsrc/telestrat/tgi/telestrat-240-200-2.s +++ b/libsrc/telestrat/tgi/telestrat-240-200-2.s @@ -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 diff --git a/libsrc/telestrat/toascii.s b/libsrc/telestrat/toascii.s new file mode 100644 index 000000000..77f050021 --- /dev/null +++ b/libsrc/telestrat/toascii.s @@ -0,0 +1,14 @@ +; +; char __fastcall__ toascii (char c); +; /* Convert a target-specific character to ASCII. */ +; + +.export _toascii + +.proc _toascii + +; .X must be zero, on return. + ldx #>$0000 + rts + +.endproc From 0517a2c2ab75de45e3a3d80894edf2dff1f8e935 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 22 Oct 2017 23:12:12 +0200 Subject: [PATCH 2/6] removing extra spaces --- libsrc/telestrat/tgi/telestrat-228-200-3.s | 2 -- 1 file changed, 2 deletions(-) diff --git a/libsrc/telestrat/tgi/telestrat-228-200-3.s b/libsrc/telestrat/tgi/telestrat-228-200-3.s index a4313b092..1ce4fc927 100644 --- a/libsrc/telestrat/tgi/telestrat-228-200-3.s +++ b/libsrc/telestrat/tgi/telestrat-228-200-3.s @@ -300,13 +300,11 @@ LINE: sta HRSPAT BRK_TELEMON(XDRAWA) - rts CIRCLE: - ; not done yet rts From 1403d797f0bd1818cbafb8f5311e745762098f5e Mon Sep 17 00:00:00 2001 From: jede Date: Mon, 23 Oct 2017 20:52:22 +0200 Subject: [PATCH 3/6] Remove toascii.s --- libsrc/telestrat/toascii.s | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 libsrc/telestrat/toascii.s diff --git a/libsrc/telestrat/toascii.s b/libsrc/telestrat/toascii.s deleted file mode 100644 index 77f050021..000000000 --- a/libsrc/telestrat/toascii.s +++ /dev/null @@ -1,14 +0,0 @@ -; -; char __fastcall__ toascii (char c); -; /* Convert a target-specific character to ASCII. */ -; - -.export _toascii - -.proc _toascii - -; .X must be zero, on return. - ldx #>$0000 - rts - -.endproc From ed4458c1621d340b948acd08e431f3fb066b1a7c Mon Sep 17 00:00:00 2001 From: jede Date: Mon, 23 Oct 2017 23:00:43 +0200 Subject: [PATCH 4/6] Comment correction --- asminc/telestrat.inc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/asminc/telestrat.inc b/asminc/telestrat.inc index 352aa0657..9b2202110 100644 --- a/asminc/telestrat.inc +++ b/asminc/telestrat.inc @@ -20,9 +20,9 @@ FNAME_LEN = 11 ; maximum length of file-name ; this 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 @@ -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 ; sends Oups sound into PSG +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 ; Set hires position cursor -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 in hires +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 From ebfd218f62e94b91f80f8e9effef1e658926163a Mon Sep 17 00:00:00 2001 From: jede Date: Mon, 23 Oct 2017 23:02:54 +0200 Subject: [PATCH 5/6] Comment correction --- asminc/telestrat.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asminc/telestrat.inc b/asminc/telestrat.inc index 9b2202110..737c4b6ae 100644 --- a/asminc/telestrat.inc +++ b/asminc/telestrat.inc @@ -17,7 +17,7 @@ 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 From 3bc0843afc7ed291ca3c8278631d159f9387013c Mon Sep 17 00:00:00 2001 From: jede Date: Mon, 23 Oct 2017 23:25:08 +0200 Subject: [PATCH 6/6] FIX label for setpixelmode --- libsrc/telestrat/tgi/telestrat-228-200-3.s | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libsrc/telestrat/tgi/telestrat-228-200-3.s b/libsrc/telestrat/tgi/telestrat-228-200-3.s index 1ce4fc927..09c308e26 100644 --- a/libsrc/telestrat/tgi/telestrat-228-200-3.s +++ b/libsrc/telestrat/tgi/telestrat-228-200-3.s @@ -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)