remove TABs

This commit is contained in:
Christian Groessler
2019-02-05 23:27:52 +01:00
parent 2190703a57
commit 58484449b4
21 changed files with 164 additions and 169 deletions

View File

@@ -3,7 +3,7 @@
;
; unsigned char getcpu (void);
;
.include "zeropage.inc"
.include "zeropage.inc"
.export _getcpu
; ---------------------------------------------------------------------------

View File

@@ -2,27 +2,27 @@
; jede jede@oric.org 2017-10-01
;
.export _cgetc
.import cursor
.include "telestrat.inc"
.proc _cgetc
; this routine could be quicker if we wrote in page 2 variables,
; this routine could be quicker if we wrote in page 2 variables,
; but it's better to use telemon routine in that case, because telemon can manage 4 I/O
ldx cursor ; if cursor equal to 0, then switch off cursor
beq switchoff_cursor
ldx #$00 ; x is the first screen
BRK_TELEMON(XCSSCR) ; display cursor
jmp loop ; could be replaced by a bne/beq but 'jmp' is cleaner than a bne/beq which could expect some matters
switchoff_cursor:
switchoff_cursor:
; at this step X is equal to $00, X must be set, because it's the id of the screen (telestrat can handle 4 virtuals screen)
BRK_TELEMON(XCOSCR) ; switch off cursor
loop:
BRK_TELEMON(XCOSCR) ; switch off cursor
loop:
BRK_TELEMON XRD0 ; waits until key is pressed
bcs loop
rts
.endproc
.endproc

View File

@@ -1,16 +1,16 @@
; jede jede@oric.org 2017-01-22
.export _close
.import addysp,popax
.include "zeropage.inc"
.import addysp,popax
.include "zeropage.inc"
.include "telestrat.inc"
.include "errno.inc"
.include "fcntl.inc"
.include "fcntl.inc"
; int open (const char* name, int flags, ...); /* May take a mode argument */
.proc _close
BRK_TELEMON XCLOSE ; launch primitive ROM
BRK_TELEMON XCLOSE ; launch primitive ROM
rts
.endproc

View File

@@ -1,16 +1,16 @@
;
; jede jede@oric.org 2017-02-25
;
;
.export _clrscr
.importzp sp
.include "telestrat.inc"
.proc _clrscr
; Switch to text mode
BRK_TELEMON(XTEXT)
BRK_TELEMON(XTEXT)
lda #<SCREEN
ldy #>SCREEN
@@ -21,18 +21,18 @@
ldx #>(SCREEN+SCREEN_XSIZE*SCREEN_YSIZE)
lda #' '
BRK_TELEMON XFILLM
; reset prompt position
lda #<(SCREEN+40)
sta ADSCRL
lda #>(SCREEN+40)
sta ADSCRH
; reset display position
lda #$01
sta SCRY
lda #$00
sta SCRX
sta SCRX
rts
.endproc
.endproc

View File

@@ -2,9 +2,9 @@
; jede jede@oric.org 2017-02-25
;
.export _gotox
.import popa
.importzp sp
.include "telestrat.inc"
@@ -13,4 +13,4 @@
.proc _gotox
sta SCRX
rts
.endproc
.endproc

View File

@@ -10,4 +10,4 @@
.proc _gotoy
sta SCRY
rts
.endproc
.endproc

View File

@@ -24,28 +24,28 @@ initmainargs:
ldx #0 ; Limit the length
L0: lda BUFEDT,x
beq L3
cmp #' '
bne L1
lda #0
beq L3
beq L3
cmp #' '
bne L1
lda #0
beq L3
L1: sta name,x
inx
cpx #FNAME_LEN
cpx #FNAME_LEN
bne L0
lda #0
L3:
sta name,x
lda #0
L3:
sta name,x
inc __argc ; argc always is equal to, at least, 1
ldy #1 * 2 ; Point to second argv slot
next: lda BUFEDT,x
beq done ; End of line reached
inx
cmp #' ' ; Skip leading spaces
beq next
beq next
found: cmp #'"' ; Is the argument quoted?
beq setterm ; Jump if so
@@ -58,12 +58,12 @@ setterm:sta term ; Set end of argument marker
txa ; Get low byte
clc
adc #<BUFEDT
bcc L4
inc L5+1
adc #<BUFEDT
bcc L4
inc L5+1
L4:
sta argv,y ; argv[y]=&arg
L5:
L5:
lda #>BUFEDT
sta argv+1,y
iny
@@ -92,16 +92,16 @@ argloop:lda BUFEDT,x
lda __argc ; Get low byte of argument count
cmp #MAXARGS ; Maximum number of arguments reached?
bcc next ; Parse next one if not
bcc next ; Parse next one if not
done: lda #<argv
ldx #>argv
sta __argv
stx __argv + 1
rts
.segment "INIT"
term: .res 1
@@ -113,8 +113,8 @@ name: .res FNAME_LEN + 1
args: .res SCREEN_XSIZE * 2 - 1
param_found:
.res 1
.res 1
; char* argv[MAXARGS+1]={name};
argv:
.addr name
argv:
.addr name
.res MAXARGS * 2

View File

@@ -1,13 +1,13 @@
.export _open
.import addysp,popax
.importzp sp,tmp2,tmp3,tmp1
.include "telestrat.inc"
.include "errno.inc"
.include "fcntl.inc"
.include "fcntl.inc"
; int open (const char* name, int flags, ...); /* May take a mode argument */
.proc _open
@@ -17,8 +17,8 @@
dey ; ...checked (it generates a c compiler warning)
dey
dey
beq parmok ; Branch if parameter count ok
jsr addysp ; Fix stack, throw away unused parameters
beq parmok ; Branch if parameter count ok
jsr addysp ; Fix stack, throw away unused parameters
; Parameters ok. Pop the flags and save them into tmp3
@@ -26,8 +26,8 @@ parmok:
jsr popax ; Get flagss
sta tmp3 ; save flags
; Get the filename from stack and parse it. Bail out if is not ok
jsr popax ; Get name
ldy tmp3 ; Get flags again
BRK_TELEMON XOPEN ; launch primitive ROM
jsr popax ; Get name
ldy tmp3 ; Get flags again
BRK_TELEMON XOPEN ; launch primitive ROM
rts
.endproc

View File

@@ -8,7 +8,7 @@
.include "zeropage.inc"
.include "telestrat.inc"
;int read (int fd, void* buf, unsigned count);
.proc _read
@@ -20,22 +20,20 @@
stx PTR_READ_DEST+1
sta ptr2 ; in order to calculate nb of bytes read
stx ptr2+1 ;
; jsr popax ; fp pointer don't care in this version
lda ptr1 ;
lda ptr1 ;
ldy ptr1+1 ;
BRK_TELEMON XFREAD ; calls telemon30 routine
; compute nb of bytes read
lda PTR_READ_DEST+1
sec
sbc ptr2+1
tax
tax
lda PTR_READ_DEST
sec
sbc ptr2
; Here A and X contains number of bytes read
rts
.endproc

View File

@@ -2,7 +2,7 @@
; jede jede@oric.org 2017-02-25
;
.export _wherex
.importzp sp
.include "telestrat.inc"
@@ -11,4 +11,4 @@
ldx #$00
lda SCRX
rts
.endproc
.endproc

View File

@@ -1,12 +1,12 @@
;
; jede jede@oric.org 2017-02-25
;
;
.export _wherey
.include "telestrat.inc"
.proc _wherey
ldx #$00
lda SCRY
rts
.endproc
.endproc

View File

@@ -23,34 +23,34 @@
jsr popax ; get fd and discard
; if fd=0001 then it stdout
cpx #0
beq next
jmp L1
next:
cmp #1
beq L1
cpx #0
beq next
jmp L1
next:
cmp #1
beq L1
; here it's a file opened
lda ptr1
sta PTR_READ_DEST
lda ptr1+1
sta PTR_READ_DEST+1
lda ptr3
ldy ptr3+1
lda ptr1
sta PTR_READ_DEST
lda ptr1+1
sta PTR_READ_DEST+1
lda ptr3
ldy ptr3+1
BRK_TELEMON XFWRITE
; compute nb of bytes written
lda PTR_READ_DEST+1
sec
sbc ptr1+1
tax
tax
lda PTR_READ_DEST
sec
sbc ptr1
rts
L1: inc ptr2
bne L2
inc ptr2+1
@@ -63,10 +63,10 @@ L2: ldy #0
BRK_TELEMON XWR0 ; macro send char to screen (channel 0 in telemon terms)
lda #$0D ; return to the beggining of the line
BRK_TELEMON XWR0 ; macro
ldx #$0D
L3:
L3:
BRK_TELEMON XWR0 ; macro
inc ptr1
@@ -81,5 +81,3 @@ L9: lda ptr3
rts
.endproc