From 7435c2f3ca932a9945757cb0ec755ba6613b6157 Mon Sep 17 00:00:00 2001 From: jede Date: Thu, 26 Oct 2017 22:00:12 +0200 Subject: [PATCH 01/13] Fix doc/telestrat.sgml --- doc/telestrat.sgml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/doc/telestrat.sgml b/doc/telestrat.sgml index 2d05f8985..d85dac2a3 100644 --- a/doc/telestrat.sgml +++ b/doc/telestrat.sgml @@ -9,10 +9,7 @@ 2017-01-22 - -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.) - +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. From 807b55862d7f51a8d1106a501d4be82d9c15e9de Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 28 Oct 2017 00:37:47 +0200 Subject: [PATCH 02/13] Now mkdir is working --- asminc/telestrat.inc | 1 + libsrc/telestrat/oserror.s | 17 +++++++++++++++++ libsrc/telestrat/sysmkdir.s | 30 ++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 libsrc/telestrat/oserror.s create mode 100644 libsrc/telestrat/sysmkdir.s diff --git a/asminc/telestrat.inc b/asminc/telestrat.inc index 737c4b6ae..cb28919c2 100644 --- a/asminc/telestrat.inc +++ b/asminc/telestrat.inc @@ -171,6 +171,7 @@ XSOUND = $44 XMUSIC = $45 XZAP = $46 XSHOOT = $47 +XMKDIR = $4B ; create a folder. Only available in telemon 3.x 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 diff --git a/libsrc/telestrat/oserror.s b/libsrc/telestrat/oserror.s new file mode 100644 index 000000000..e3b9e619a --- /dev/null +++ b/libsrc/telestrat/oserror.s @@ -0,0 +1,17 @@ +; +; Jede, 2017-10-27 +; +; int __fastcall__ _osmaperrno (unsigned char oserror); +; /* Map a system specific error into a system independent code */ +; + + .include "errno.inc" + .export __osmaperrno + +.proc __osmaperrno + + lda #EUNKNOWN + rts + +.endproc diff --git a/libsrc/telestrat/sysmkdir.s b/libsrc/telestrat/sysmkdir.s new file mode 100644 index 000000000..26d97c4b0 --- /dev/null +++ b/libsrc/telestrat/sysmkdir.s @@ -0,0 +1,30 @@ +; +; Jede (jede@oric.org), 2017-10-27 +; +; unsigned char _sysmkdir (const char* name, ...); +; + + .export __sysmkdir + .import addysp, popax + + .include "telestrat.inc" + .include "zeropage.inc" + + +__sysmkdir: + ; Throw away all parameters except the name + dey + dey + jsr addysp + + ; Get name + jsr popax + + ; Call telemon primitive + + BRK_TELEMON(XMKDIR) + + rts + + + From eae485dc64c0ea1aab567fe7500122beda9b9eb0 Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 28 Oct 2017 00:40:56 +0200 Subject: [PATCH 03/13] Empty item removed --- doc/telestrat.sgml | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/telestrat.sgml b/doc/telestrat.sgml index d85dac2a3..b640e5aa8 100644 --- a/doc/telestrat.sgml +++ b/doc/telestrat.sgml @@ -120,7 +120,6 @@ structures; accessing the struct fields will access the chip registers. TGI drivers is available on Oric Telestrat with some functions : - tgi_install tgi_init tgi_clear From d3451bb299d726651b3fd002d1d314563e7a16b2 Mon Sep 17 00:00:00 2001 From: Piotr Fusik Date: Mon, 6 Nov 2017 19:46:26 +0100 Subject: [PATCH 04/13] Fix 256 codes of same length --- libsrc/zlib/inflatemem.s | 44 ++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/libsrc/zlib/inflatemem.s b/libsrc/zlib/inflatemem.s index 27802fbff..f49c5fc79 100644 --- a/libsrc/zlib/inflatemem.s +++ b/libsrc/zlib/inflatemem.s @@ -1,5 +1,5 @@ ; -; 2017-02-12, Piotr Fusik +; 2017-11-06, Piotr Fusik ; ; unsigned __fastcall__ inflatemem (char* dest, const char* source); ; @@ -103,7 +103,7 @@ inflate_blockLoop: ; ldy #0 sty getBit_buffer ; ignore bits until byte boundary jsr getWord ; skip the length we don't need - jsr getWord ; get the two's complement length + jsr getWord ; get the one's complement length sta inflateStored_pageCounter bcs inflateStored_firstByte ; jmp inflateStored_copyByte: @@ -332,7 +332,7 @@ inflateDynamic_storeControl: ; Build Huffman trees basing on code lengths (in bits) ; stored in the *SymbolCodeLength arrays buildHuffmanTree: -; Clear nBitCode_totalCount, nBitCode_literalCount, nBitCode_controlCount +; Clear nBitCode_literalCount, nBitCode_controlCount tya ; lda #0 buildHuffmanTree_clear: @@ -344,22 +344,20 @@ buildHuffmanTree_clear: buildHuffmanTree_countCodeLengths: ldx literalSymbolCodeLength,y inc nBitCode_literalCount,x - inc nBitCode_totalCount,x cpy #CONTROL_SYMBOLS bcs buildHuffmanTree_noControlSymbol ldx controlSymbolCodeLength,y inc nBitCode_controlCount,x - inc nBitCode_totalCount,x buildHuffmanTree_noControlSymbol: iny bne buildHuffmanTree_countCodeLengths ; Calculate offsets of symbols sorted by code length ; lda #0 - ldx #$100-3*TREE_SIZE + ldx #$100-4*TREE_SIZE buildHuffmanTree_calculateOffsets: - sta nBitCode_literalOffset+3*TREE_SIZE-$100,x + sta nBitCode_literalOffset+4*TREE_SIZE-$100,x clc - adc nBitCode_literalCount+3*TREE_SIZE-$100,x + adc nBitCode_literalCount+4*TREE_SIZE-$100,x inx bne buildHuffmanTree_calculateOffsets ; Put symbols in their place in the sorted array @@ -397,26 +395,26 @@ fetchCode_nextBit: rol a inx sec - sbc nBitCode_totalCount,x + sbc nBitCode_literalCount,x + bcc fetchCode_literal +; sec + sbc nBitCode_controlCount,x bcs fetchCode_nextBit ; clc - adc nBitCode_controlCount,x - bcs fetchCode_control + adc nBitCode_controlOffset,x + tax + lda codeToControlSymbol,x + and #$1f ; make distance symbols zero-based + tax +; sec + rts +fetchCode_literal: ; clc adc nBitCode_literalOffset,x tax lda codeToLiteralSymbol,x clc rts -fetchCode_control: -; sec - adc nBitCode_controlOffset-1,x - tax - lda codeToControlSymbol-1,x - and #$1f ; make distance symbols zero-based - tax - sec - rts ; Read A minus 1 bits, but no more than 8 getAMinus1BitsMax8: @@ -517,14 +515,12 @@ controlSymbolCodeLength: ; Huffman trees. nBitCode_clearFrom: -nBitCode_totalCount: - .res 2*TREE_SIZE nBitCode_literalCount: - .res TREE_SIZE + .res 2*TREE_SIZE nBitCode_controlCount: .res 2*TREE_SIZE nBitCode_literalOffset: - .res TREE_SIZE + .res 2*TREE_SIZE nBitCode_controlOffset: .res 2*TREE_SIZE From afcfba935594879742d85469d3cb1c38a25fa6f4 Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Mon, 6 Nov 2017 21:02:14 +0100 Subject: [PATCH 05/13] Use macro actually defined in cbm_filetype.h. --- include/dirent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/dirent.h b/include/dirent.h index b5e1be135..124c7f224 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -107,7 +107,7 @@ struct dirent { #define _DE_ISREG(t) (((t) & _CBM_T_REG) != 0) #define _DE_ISDIR(t) ((t) == _CBM_T_DIR) -#define _DE_ISLBL(t) ((t) == _CBM_T_HDR) +#define _DE_ISLBL(t) ((t) == _CBM_T_HEADER) #define _DE_ISLNK(t) ((t) == _CBM_T_LNK) #elif defined(__LYNX__) From 84edf4cbfd22e5e20670769ea00adaeb27d12a6f Mon Sep 17 00:00:00 2001 From: Piotr Fusik Date: Tue, 7 Nov 2017 20:10:19 +0100 Subject: [PATCH 06/13] Fix more than 256 codes of same length. Fix all 256 literal codes of same length. --- libsrc/zlib/inflatemem.s | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/libsrc/zlib/inflatemem.s b/libsrc/zlib/inflatemem.s index f49c5fc79..bc89f2016 100644 --- a/libsrc/zlib/inflatemem.s +++ b/libsrc/zlib/inflatemem.s @@ -1,5 +1,5 @@ ; -; 2017-11-06, Piotr Fusik +; 2017-11-07, Piotr Fusik ; ; unsigned __fastcall__ inflatemem (char* dest, const char* source); ; @@ -344,6 +344,9 @@ buildHuffmanTree_clear: buildHuffmanTree_countCodeLengths: ldx literalSymbolCodeLength,y inc nBitCode_literalCount,x + bne buildHuffmanTree_notAllLiterals + stx allLiteralsCodeLength +buildHuffmanTree_notAllLiterals: cpy #CONTROL_SYMBOLS bcs buildHuffmanTree_noControlSymbol ldx controlSymbolCodeLength,y @@ -394,12 +397,33 @@ fetchCode_nextBit: jsr getBit rol a inx + bcs fetchCode_ge256 +; are all 256 literal codes of this length? + cpx allLiteralsCodeLength + beq fetchCode_allLiterals +; is it literal code of length X? sec sbc nBitCode_literalCount,x - bcc fetchCode_literal + bcs fetchCode_notLiteral +; literal code +; clc + adc nBitCode_literalOffset,x + tax + lda codeToLiteralSymbol,x +fetchCode_allLiterals: + clc + rts +; code >= 256, must be control +fetchCode_ge256: +; sec + sbc nBitCode_literalCount,x + sec +; is it control code of length X? +fetchCode_notLiteral: ; sec sbc nBitCode_controlCount,x bcs fetchCode_nextBit +; control code ; clc adc nBitCode_controlOffset,x tax @@ -408,13 +432,6 @@ fetchCode_nextBit: tax ; sec rts -fetchCode_literal: -; clc - adc nBitCode_literalOffset,x - tax - lda codeToLiteralSymbol,x - clc - rts ; Read A minus 1 bits, but no more than 8 getAMinus1BitsMax8: @@ -523,6 +540,8 @@ nBitCode_literalOffset: .res 2*TREE_SIZE nBitCode_controlOffset: .res 2*TREE_SIZE +allLiteralsCodeLength: + .res 1 codeToLiteralSymbol: .res 256 From e4a235b23370d3842ce1c048ecbcf23d4498cfe2 Mon Sep 17 00:00:00 2001 From: "U-AMAIISDOM\\fcaruso" Date: Thu, 9 Nov 2017 13:51:04 +0100 Subject: [PATCH 07/13] Correct bits in gamate joystick detection --- libsrc/gamate/joy/gamate-stdjoy.s | 1 + 1 file changed, 1 insertion(+) diff --git a/libsrc/gamate/joy/gamate-stdjoy.s b/libsrc/gamate/joy/gamate-stdjoy.s index d10eb6f41..f6b303dba 100644 --- a/libsrc/gamate/joy/gamate-stdjoy.s +++ b/libsrc/gamate/joy/gamate-stdjoy.s @@ -79,6 +79,7 @@ COUNT: READJOY: lda JOY_DATA + eor #$ff ldx #0 rts From bf0ae229691ccbdb17b57e0b865f30445f6b0b3e Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Thu, 9 Nov 2017 16:36:06 +0100 Subject: [PATCH 08/13] Update gamate-stdjoy.s --- libsrc/gamate/joy/gamate-stdjoy.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/gamate/joy/gamate-stdjoy.s b/libsrc/gamate/joy/gamate-stdjoy.s index f6b303dba..a5bd24ef2 100644 --- a/libsrc/gamate/joy/gamate-stdjoy.s +++ b/libsrc/gamate/joy/gamate-stdjoy.s @@ -79,7 +79,7 @@ COUNT: READJOY: lda JOY_DATA - eor #$ff + eor #$ff ldx #0 rts From 0a61b061c70d538453c1ffe3f846f06f078c9b71 Mon Sep 17 00:00:00 2001 From: Fabrizio Caruso Date: Thu, 9 Nov 2017 16:42:52 +0100 Subject: [PATCH 09/13] Update gamate-stdjoy.s --- libsrc/gamate/joy/gamate-stdjoy.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/gamate/joy/gamate-stdjoy.s b/libsrc/gamate/joy/gamate-stdjoy.s index a5bd24ef2..801b40acd 100644 --- a/libsrc/gamate/joy/gamate-stdjoy.s +++ b/libsrc/gamate/joy/gamate-stdjoy.s @@ -79,7 +79,7 @@ COUNT: READJOY: lda JOY_DATA - eor #$ff + eor #$FF ldx #0 rts From 2fd99e9dece66a09336f50c9a67a04a81be18824 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 9 Nov 2017 17:36:21 +0100 Subject: [PATCH 10/13] Missing declaration --- include/atmos.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/atmos.h b/include/atmos.h index c642f9e2a..d9f6d103b 100644 --- a/include/atmos.h +++ b/include/atmos.h @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 2002 Debrune Jérome, */ +/* (C) 2002 Debrune Jérome, */ /* (C) 2003-2013 Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ @@ -129,6 +129,7 @@ /* The addresses of the static drivers */ extern void atmos_pase_joy[]; /* Referred to by joy_static_stddrv[] */ +extern void atmos_ijk_joy[]; extern void atmos_acia_ser[]; extern void atmos_228_200_3_tgi[]; extern void atmos_240_200_2_tgi[]; /* Referred to by tgi_static_stddrv[] */ From 64ed0a1937fe9ab172c7a12bfe06d9f06130470a Mon Sep 17 00:00:00 2001 From: jede Date: Fri, 10 Nov 2017 10:58:01 +0100 Subject: [PATCH 11/13] Doc modified --- doc/telestrat.sgml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/telestrat.sgml b/doc/telestrat.sgml index b640e5aa8..76b3cdd30 100644 --- a/doc/telestrat.sgml +++ b/doc/telestrat.sgml @@ -120,12 +120,12 @@ structures; accessing the struct fields will access the chip registers. TGI drivers is available on Oric Telestrat with some functions : +tgi_done tgi_install tgi_init tgi_clear +tgi_line tgi_setpixel -tgi_getmaxx -tgi_getmaxy From 3c97a04b252df1903f03ef3b9883f2eed675d496 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 12 Nov 2017 10:42:09 +0100 Subject: [PATCH 12/13] Fix cc65 doc for telestrat target --- doc/cc65.sgml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/cc65.sgml b/doc/cc65.sgml index cd94f50ac..11a5937b2 100644 --- a/doc/cc65.sgml +++ b/doc/cc65.sgml @@ -407,6 +407,7 @@ Here is a description of all the command line options: sim6502 sim65c02 supervision + telestrat vic20 @@ -941,6 +942,10 @@ The compiler defines several macros at startup: This macro is defined if the target is the Supervision (-t supervision). + __TELESTRAT__ + + This macro is defined if the target is the Telestrat (-t telestrat). + __TIME__ This macro expands to the time of translation of the preprocessing From 06794b221d0bd26c90baad71fbbd23ad5301fe16 Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Mon, 13 Nov 2017 20:38:22 +0100 Subject: [PATCH 13/13] Made cbm_k_untlk() available. --- include/cbm.h | 1 + libsrc/cbm/c_untlk.s | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/cbm.h b/include/cbm.h index a4b232406..da63375b2 100644 --- a/include/cbm.h +++ b/include/cbm.h @@ -209,6 +209,7 @@ void __fastcall__ cbm_k_setnam (const char* Name); void __fastcall__ cbm_k_talk (unsigned char dev); void cbm_k_udtim (void); void cbm_k_unlsn (void); +void cbm_k_untlk (void); diff --git a/libsrc/cbm/c_untlk.s b/libsrc/cbm/c_untlk.s index 1d71c168b..3865564cd 100644 --- a/libsrc/cbm/c_untlk.s +++ b/libsrc/cbm/c_untlk.s @@ -1,11 +1,11 @@ ; ; Ullrich von Bassewitz, 03.06.1999 ; -; void cbm_untlk (void); +; void cbm_k_untlk (void); ; - .export _cbm_untlk + .export _cbm_k_untlk .import UNTLK -_cbm_untlk = UNTLK +_cbm_k_untlk = UNTLK