1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 04:30:10 +00:00

Merge pull request #1 from cc65/master

Update
This commit is contained in:
Stefan 2017-11-14 03:36:03 +01:00 committed by GitHub
commit 88e96ff4d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 100 additions and 33 deletions

View File

@ -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

View File

@ -407,6 +407,7 @@ Here is a description of all the command line options:
<item>sim6502
<item>sim65c02
<item>supervision
<item>telestrat
<item>vic20
</itemize>
@ -941,6 +942,10 @@ The compiler defines several macros at startup:
This macro is defined if the target is the Supervision (-t supervision).
<tag><tt>__TELESTRAT__</tt></tag>
This macro is defined if the target is the Telestrat (-t telestrat).
<tag><tt>__TIME__</tt></tag>
This macro expands to the time of translation of the preprocessing

View File

@ -9,10 +9,7 @@
<date>2017-01-22
<abstract>
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.
</abstract>
<!-- Table of contents -->
@ -123,13 +120,12 @@ structures; accessing the struct fields will access the chip registers.
TGI drivers is available on Oric Telestrat with some functions :
<itemize>
<item>
<item>tgi_done
<item>tgi_install
<item>tgi_init
<item>tgi_clear
<item>tgi_line
<item>tgi_setpixel
<item>tgi_getmaxx
<item>tgi_getmaxy
</itemize>

View File

@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 2002 Debrune Jérome, <jede@oric.org> */
/* (C) 2002 Debrune Jérome, <jede@oric.org> */
/* (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[] */

View File

@ -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);

View File

@ -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__)

View File

@ -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

View File

@ -79,6 +79,7 @@ COUNT:
READJOY:
lda JOY_DATA
eor #$FF
ldx #0
rts

View File

@ -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
ldx #>EUNKNOWN
rts
.endproc

View File

@ -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

View File

@ -1,5 +1,5 @@
;
; 2017-02-12, Piotr Fusik
; 2017-11-07, 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,23 @@ buildHuffmanTree_clear:
buildHuffmanTree_countCodeLengths:
ldx literalSymbolCodeLength,y
inc nBitCode_literalCount,x
inc nBitCode_totalCount,x
bne buildHuffmanTree_notAllLiterals
stx allLiteralsCodeLength
buildHuffmanTree_notAllLiterals:
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
@ -396,26 +397,40 @@ 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_totalCount,x
bcs fetchCode_nextBit
; clc
adc nBitCode_controlCount,x
bcs fetchCode_control
sbc nBitCode_literalCount,x
bcs fetchCode_notLiteral
; literal code
; clc
adc nBitCode_literalOffset,x
tax
lda codeToLiteralSymbol,x
fetchCode_allLiterals:
clc
rts
fetchCode_control:
; code >= 256, must be control
fetchCode_ge256:
; sec
adc nBitCode_controlOffset-1,x
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
lda codeToControlSymbol-1,x
lda codeToControlSymbol,x
and #$1f ; make distance symbols zero-based
tax
sec
; sec
rts
; Read A minus 1 bits, but no more than 8
@ -517,16 +532,16 @@ 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
allLiteralsCodeLength:
.res 1
codeToLiteralSymbol:
.res 256