mirror of
https://github.com/cc65/cc65.git
synced 2024-06-09 06:29:38 +00:00
remove TABs
This commit is contained in:
parent
2190703a57
commit
58484449b4
|
@ -63,7 +63,7 @@ _SMCDesignator: statement
|
||||||
ldy #opcode
|
ldy #opcode
|
||||||
sty _SMCDesignator
|
sty _SMCDesignator
|
||||||
.else
|
.else
|
||||||
.error "Invalid usage of macro 'SMC_TransferOpcode'"
|
.error "Invalid usage of macro 'SMC_TransferOpcode'"
|
||||||
.endif
|
.endif
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ _SMCDesignator: statement
|
||||||
.elseif .match ({register}, y)
|
.elseif .match ({register}, y)
|
||||||
ldy _SMCDesignator
|
ldy _SMCDesignator
|
||||||
.else
|
.else
|
||||||
.error "Invalid usage of macro 'SMC_LoadOpcode'"
|
.error "Invalid usage of macro 'SMC_LoadOpcode'"
|
||||||
.endif
|
.endif
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ _SMCDesignator: statement
|
||||||
.elseif .match ({register}, y)
|
.elseif .match ({register}, y)
|
||||||
sty _SMCDesignator
|
sty _SMCDesignator
|
||||||
.else
|
.else
|
||||||
.error "Invalid usage of macro 'SMC_StoreOpcode'"
|
.error "Invalid usage of macro 'SMC_StoreOpcode'"
|
||||||
.endif
|
.endif
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ _SMCDesignator: statement
|
||||||
ldy #(<(destination - _SMCDesignator - 2))
|
ldy #(<(destination - _SMCDesignator - 2))
|
||||||
sty _SMCDesignator+1
|
sty _SMCDesignator+1
|
||||||
.else
|
.else
|
||||||
.error "Invalid usage of macro 'SMC_ChangeBranch'"
|
.error "Invalid usage of macro 'SMC_ChangeBranch'"
|
||||||
.endif
|
.endif
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ _SMCDesignator: statement
|
||||||
ldy value
|
ldy value
|
||||||
sty _SMCDesignator+1
|
sty _SMCDesignator+1
|
||||||
.else
|
.else
|
||||||
.error "Invalid usage of macro 'SMC_TransferValue'"
|
.error "Invalid usage of macro 'SMC_TransferValue'"
|
||||||
.endif
|
.endif
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ _SMCDesignator: statement
|
||||||
.elseif .match ({register}, y)
|
.elseif .match ({register}, y)
|
||||||
ldy _SMCDesignator+1
|
ldy _SMCDesignator+1
|
||||||
.else
|
.else
|
||||||
.error "Invalid usage of macro 'SMC_LoadValue'"
|
.error "Invalid usage of macro 'SMC_LoadValue'"
|
||||||
.endif
|
.endif
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ _SMCDesignator: statement
|
||||||
.elseif .match ({register}, y)
|
.elseif .match ({register}, y)
|
||||||
sty _SMCDesignator+1
|
sty _SMCDesignator+1
|
||||||
.else
|
.else
|
||||||
.error "Invalid usage of macro 'SMC_StoreValue'"
|
.error "Invalid usage of macro 'SMC_StoreValue'"
|
||||||
.endif
|
.endif
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ SMC_StoreValue label, register
|
||||||
ldy value
|
ldy value
|
||||||
sty _SMCDesignator+2
|
sty _SMCDesignator+2
|
||||||
.else
|
.else
|
||||||
.error "Invalid usage of macro 'SMC_TransferHighByte'"
|
.error "Invalid usage of macro 'SMC_TransferHighByte'"
|
||||||
.endif
|
.endif
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ SMC_StoreValue label, register
|
||||||
.elseif .match ({register}, y)
|
.elseif .match ({register}, y)
|
||||||
ldy _SMCDesignator+2
|
ldy _SMCDesignator+2
|
||||||
.else
|
.else
|
||||||
.error "Invalid usage of macro 'SMC_LoadHighByte'"
|
.error "Invalid usage of macro 'SMC_LoadHighByte'"
|
||||||
.endif
|
.endif
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ SMC_StoreValue label, register
|
||||||
.elseif .match ({register}, y)
|
.elseif .match ({register}, y)
|
||||||
sty _SMCDesignator+2
|
sty _SMCDesignator+2
|
||||||
.else
|
.else
|
||||||
.error "Invalid usage of macro 'SMC_StoreHighByte'"
|
.error "Invalid usage of macro 'SMC_StoreHighByte'"
|
||||||
.endif
|
.endif
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ SMC_StoreValue label, register
|
||||||
sty _SMCDesignator+2
|
sty _SMCDesignator+2
|
||||||
.endif
|
.endif
|
||||||
.else
|
.else
|
||||||
.error "Invalid usage of macro 'SMC_TransferAddressSingle'"
|
.error "Invalid usage of macro 'SMC_TransferAddressSingle'"
|
||||||
.endif
|
.endif
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
|
|
|
@ -367,5 +367,5 @@ XRWTS := $FFAA
|
||||||
; MACRO
|
; MACRO
|
||||||
|
|
||||||
.macro BRK_TELEMON value
|
.macro BRK_TELEMON value
|
||||||
.byte $00,value
|
.byte $00,value
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
|
@ -2,7 +2,7 @@ SYMBOLS {
|
||||||
__ORIXHDR__: type = import;
|
__ORIXHDR__: type = import;
|
||||||
__STACKSIZE__: type = weak, value = $0800; # 2K stack
|
__STACKSIZE__: type = weak, value = $0800; # 2K stack
|
||||||
__GRAB__: type = weak, value = 0; # 0=don't grab graphics RAM, 1=grab graphics RAM
|
__GRAB__: type = weak, value = 0; # 0=don't grab graphics RAM, 1=grab graphics RAM
|
||||||
__RAMEND__: type = weak, value = $9800 + $1C00 * __GRAB__;
|
__RAMEND__: type = weak, value = $9800 + $1C00 * __GRAB__;
|
||||||
}
|
}
|
||||||
MEMORY {
|
MEMORY {
|
||||||
ZP: file = "", define = yes, start = $00B0, size = $003A;
|
ZP: file = "", define = yes, start = $00B0, size = $003A;
|
||||||
|
|
|
@ -11,60 +11,60 @@
|
||||||
/* TIA write / read registers */
|
/* TIA write / read registers */
|
||||||
struct __tia {
|
struct __tia {
|
||||||
union {
|
union {
|
||||||
unsigned char vsync;
|
unsigned char vsync;
|
||||||
unsigned char cxm0p;
|
unsigned char cxm0p;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char vblank;
|
unsigned char vblank;
|
||||||
unsigned char cxm1p;
|
unsigned char cxm1p;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char wsync;
|
unsigned char wsync;
|
||||||
unsigned char cxp0fb;
|
unsigned char cxp0fb;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char rsync;
|
unsigned char rsync;
|
||||||
unsigned char cxp1fb;
|
unsigned char cxp1fb;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char nusiz0;
|
unsigned char nusiz0;
|
||||||
unsigned char cxm0fb;
|
unsigned char cxm0fb;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char nusiz1;
|
unsigned char nusiz1;
|
||||||
unsigned char cxm1fb;
|
unsigned char cxm1fb;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char colup0;
|
unsigned char colup0;
|
||||||
unsigned char cxblpf;
|
unsigned char cxblpf;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char colup1;
|
unsigned char colup1;
|
||||||
unsigned char cxppmm;
|
unsigned char cxppmm;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char colupf;
|
unsigned char colupf;
|
||||||
unsigned char inpt0;
|
unsigned char inpt0;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char colubk;
|
unsigned char colubk;
|
||||||
unsigned char inpt1;
|
unsigned char inpt1;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char ctrlpf;
|
unsigned char ctrlpf;
|
||||||
unsigned char inpt2;
|
unsigned char inpt2;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char refp0;
|
unsigned char refp0;
|
||||||
unsigned char inpt3;
|
unsigned char inpt3;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char refp1;
|
unsigned char refp1;
|
||||||
unsigned char inpt4;
|
unsigned char inpt4;
|
||||||
};
|
};
|
||||||
union {
|
union {
|
||||||
unsigned char pf0;
|
unsigned char pf0;
|
||||||
unsigned char inpt5;
|
unsigned char inpt5;
|
||||||
};
|
};
|
||||||
unsigned char pf1;
|
unsigned char pf1;
|
||||||
unsigned char pf2;
|
unsigned char pf2;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
;
|
;
|
||||||
; unsigned char getcpu (void);
|
; unsigned char getcpu (void);
|
||||||
;
|
;
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.export _getcpu
|
.export _getcpu
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
|
|
|
@ -2,27 +2,27 @@
|
||||||
; jede jede@oric.org 2017-10-01
|
; jede jede@oric.org 2017-10-01
|
||||||
;
|
;
|
||||||
.export _cgetc
|
.export _cgetc
|
||||||
|
|
||||||
.import cursor
|
.import cursor
|
||||||
|
|
||||||
.include "telestrat.inc"
|
.include "telestrat.inc"
|
||||||
|
|
||||||
.proc _cgetc
|
.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
|
; 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
|
ldx cursor ; if cursor equal to 0, then switch off cursor
|
||||||
beq switchoff_cursor
|
beq switchoff_cursor
|
||||||
|
|
||||||
ldx #$00 ; x is the first screen
|
ldx #$00 ; x is the first screen
|
||||||
BRK_TELEMON(XCSSCR) ; display cursor
|
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
|
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)
|
; 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
|
BRK_TELEMON(XCOSCR) ; switch off cursor
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
BRK_TELEMON XRD0 ; waits until key is pressed
|
BRK_TELEMON XRD0 ; waits until key is pressed
|
||||||
bcs loop
|
bcs loop
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
; jede jede@oric.org 2017-01-22
|
; jede jede@oric.org 2017-01-22
|
||||||
|
|
||||||
.export _close
|
.export _close
|
||||||
|
|
||||||
.import addysp,popax
|
.import addysp,popax
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "telestrat.inc"
|
.include "telestrat.inc"
|
||||||
.include "errno.inc"
|
.include "errno.inc"
|
||||||
.include "fcntl.inc"
|
.include "fcntl.inc"
|
||||||
|
|
||||||
; int open (const char* name, int flags, ...); /* May take a mode argument */
|
; int open (const char* name, int flags, ...); /* May take a mode argument */
|
||||||
.proc _close
|
.proc _close
|
||||||
BRK_TELEMON XCLOSE ; launch primitive ROM
|
BRK_TELEMON XCLOSE ; launch primitive ROM
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
;
|
;
|
||||||
; jede jede@oric.org 2017-02-25
|
; jede jede@oric.org 2017-02-25
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _clrscr
|
.export _clrscr
|
||||||
|
|
||||||
.importzp sp
|
.importzp sp
|
||||||
|
|
||||||
.include "telestrat.inc"
|
.include "telestrat.inc"
|
||||||
|
|
||||||
.proc _clrscr
|
.proc _clrscr
|
||||||
; Switch to text mode
|
; Switch to text mode
|
||||||
BRK_TELEMON(XTEXT)
|
BRK_TELEMON(XTEXT)
|
||||||
|
|
||||||
lda #<SCREEN
|
lda #<SCREEN
|
||||||
ldy #>SCREEN
|
ldy #>SCREEN
|
||||||
|
@ -21,18 +21,18 @@
|
||||||
ldx #>(SCREEN+SCREEN_XSIZE*SCREEN_YSIZE)
|
ldx #>(SCREEN+SCREEN_XSIZE*SCREEN_YSIZE)
|
||||||
lda #' '
|
lda #' '
|
||||||
BRK_TELEMON XFILLM
|
BRK_TELEMON XFILLM
|
||||||
|
|
||||||
|
|
||||||
; reset prompt position
|
; reset prompt position
|
||||||
lda #<(SCREEN+40)
|
lda #<(SCREEN+40)
|
||||||
sta ADSCRL
|
sta ADSCRL
|
||||||
lda #>(SCREEN+40)
|
lda #>(SCREEN+40)
|
||||||
sta ADSCRH
|
sta ADSCRH
|
||||||
|
|
||||||
; reset display position
|
; reset display position
|
||||||
lda #$01
|
lda #$01
|
||||||
sta SCRY
|
sta SCRY
|
||||||
lda #$00
|
lda #$00
|
||||||
sta SCRX
|
sta SCRX
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
; jede jede@oric.org 2017-02-25
|
; jede jede@oric.org 2017-02-25
|
||||||
;
|
;
|
||||||
.export _gotox
|
.export _gotox
|
||||||
|
|
||||||
.import popa
|
.import popa
|
||||||
|
|
||||||
.importzp sp
|
.importzp sp
|
||||||
|
|
||||||
.include "telestrat.inc"
|
.include "telestrat.inc"
|
||||||
|
@ -13,4 +13,4 @@
|
||||||
.proc _gotox
|
.proc _gotox
|
||||||
sta SCRX
|
sta SCRX
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
|
@ -10,4 +10,4 @@
|
||||||
.proc _gotoy
|
.proc _gotoy
|
||||||
sta SCRY
|
sta SCRY
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
|
@ -24,28 +24,28 @@ initmainargs:
|
||||||
|
|
||||||
ldx #0 ; Limit the length
|
ldx #0 ; Limit the length
|
||||||
L0: lda BUFEDT,x
|
L0: lda BUFEDT,x
|
||||||
beq L3
|
beq L3
|
||||||
cmp #' '
|
cmp #' '
|
||||||
bne L1
|
bne L1
|
||||||
lda #0
|
lda #0
|
||||||
beq L3
|
beq L3
|
||||||
L1: sta name,x
|
L1: sta name,x
|
||||||
inx
|
inx
|
||||||
cpx #FNAME_LEN
|
cpx #FNAME_LEN
|
||||||
bne L0
|
bne L0
|
||||||
lda #0
|
lda #0
|
||||||
L3:
|
L3:
|
||||||
sta name,x
|
sta name,x
|
||||||
inc __argc ; argc always is equal to, at least, 1
|
inc __argc ; argc always is equal to, at least, 1
|
||||||
|
|
||||||
|
|
||||||
ldy #1 * 2 ; Point to second argv slot
|
ldy #1 * 2 ; Point to second argv slot
|
||||||
|
|
||||||
next: lda BUFEDT,x
|
next: lda BUFEDT,x
|
||||||
beq done ; End of line reached
|
beq done ; End of line reached
|
||||||
inx
|
inx
|
||||||
cmp #' ' ; Skip leading spaces
|
cmp #' ' ; Skip leading spaces
|
||||||
beq next
|
beq next
|
||||||
|
|
||||||
found: cmp #'"' ; Is the argument quoted?
|
found: cmp #'"' ; Is the argument quoted?
|
||||||
beq setterm ; Jump if so
|
beq setterm ; Jump if so
|
||||||
|
@ -58,12 +58,12 @@ setterm:sta term ; Set end of argument marker
|
||||||
|
|
||||||
txa ; Get low byte
|
txa ; Get low byte
|
||||||
clc
|
clc
|
||||||
adc #<BUFEDT
|
adc #<BUFEDT
|
||||||
bcc L4
|
bcc L4
|
||||||
inc L5+1
|
inc L5+1
|
||||||
L4:
|
L4:
|
||||||
sta argv,y ; argv[y]=&arg
|
sta argv,y ; argv[y]=&arg
|
||||||
L5:
|
L5:
|
||||||
lda #>BUFEDT
|
lda #>BUFEDT
|
||||||
sta argv+1,y
|
sta argv+1,y
|
||||||
iny
|
iny
|
||||||
|
@ -92,16 +92,16 @@ argloop:lda BUFEDT,x
|
||||||
|
|
||||||
lda __argc ; Get low byte of argument count
|
lda __argc ; Get low byte of argument count
|
||||||
cmp #MAXARGS ; Maximum number of arguments reached?
|
cmp #MAXARGS ; Maximum number of arguments reached?
|
||||||
bcc next ; Parse next one if not
|
bcc next ; Parse next one if not
|
||||||
|
|
||||||
|
|
||||||
done: lda #<argv
|
done: lda #<argv
|
||||||
ldx #>argv
|
ldx #>argv
|
||||||
sta __argv
|
sta __argv
|
||||||
stx __argv + 1
|
stx __argv + 1
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
.segment "INIT"
|
.segment "INIT"
|
||||||
|
|
||||||
term: .res 1
|
term: .res 1
|
||||||
|
@ -113,8 +113,8 @@ name: .res FNAME_LEN + 1
|
||||||
args: .res SCREEN_XSIZE * 2 - 1
|
args: .res SCREEN_XSIZE * 2 - 1
|
||||||
|
|
||||||
param_found:
|
param_found:
|
||||||
.res 1
|
.res 1
|
||||||
; char* argv[MAXARGS+1]={name};
|
; char* argv[MAXARGS+1]={name};
|
||||||
argv:
|
argv:
|
||||||
.addr name
|
.addr name
|
||||||
.res MAXARGS * 2
|
.res MAXARGS * 2
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
.export _open
|
.export _open
|
||||||
|
|
||||||
.import addysp,popax
|
.import addysp,popax
|
||||||
|
|
||||||
.importzp sp,tmp2,tmp3,tmp1
|
.importzp sp,tmp2,tmp3,tmp1
|
||||||
|
|
||||||
|
|
||||||
.include "telestrat.inc"
|
.include "telestrat.inc"
|
||||||
.include "errno.inc"
|
.include "errno.inc"
|
||||||
.include "fcntl.inc"
|
.include "fcntl.inc"
|
||||||
|
|
||||||
; int open (const char* name, int flags, ...); /* May take a mode argument */
|
; int open (const char* name, int flags, ...); /* May take a mode argument */
|
||||||
.proc _open
|
.proc _open
|
||||||
|
@ -17,8 +17,8 @@
|
||||||
dey ; ...checked (it generates a c compiler warning)
|
dey ; ...checked (it generates a c compiler warning)
|
||||||
dey
|
dey
|
||||||
dey
|
dey
|
||||||
beq parmok ; Branch if parameter count ok
|
beq parmok ; Branch if parameter count ok
|
||||||
jsr addysp ; Fix stack, throw away unused parameters
|
jsr addysp ; Fix stack, throw away unused parameters
|
||||||
|
|
||||||
; Parameters ok. Pop the flags and save them into tmp3
|
; Parameters ok. Pop the flags and save them into tmp3
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ parmok:
|
||||||
jsr popax ; Get flagss
|
jsr popax ; Get flagss
|
||||||
sta tmp3 ; save flags
|
sta tmp3 ; save flags
|
||||||
; Get the filename from stack and parse it. Bail out if is not ok
|
; Get the filename from stack and parse it. Bail out if is not ok
|
||||||
jsr popax ; Get name
|
jsr popax ; Get name
|
||||||
ldy tmp3 ; Get flags again
|
ldy tmp3 ; Get flags again
|
||||||
BRK_TELEMON XOPEN ; launch primitive ROM
|
BRK_TELEMON XOPEN ; launch primitive ROM
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "telestrat.inc"
|
.include "telestrat.inc"
|
||||||
|
|
||||||
;int read (int fd, void* buf, unsigned count);
|
;int read (int fd, void* buf, unsigned count);
|
||||||
|
|
||||||
.proc _read
|
.proc _read
|
||||||
|
@ -20,22 +20,20 @@
|
||||||
stx PTR_READ_DEST+1
|
stx PTR_READ_DEST+1
|
||||||
sta ptr2 ; in order to calculate nb of bytes read
|
sta ptr2 ; in order to calculate nb of bytes read
|
||||||
stx ptr2+1 ;
|
stx ptr2+1 ;
|
||||||
|
|
||||||
; jsr popax ; fp pointer don't care in this version
|
; jsr popax ; fp pointer don't care in this version
|
||||||
|
|
||||||
lda ptr1 ;
|
lda ptr1 ;
|
||||||
ldy ptr1+1 ;
|
ldy ptr1+1 ;
|
||||||
BRK_TELEMON XFREAD ; calls telemon30 routine
|
BRK_TELEMON XFREAD ; calls telemon30 routine
|
||||||
; compute nb of bytes read
|
; compute nb of bytes read
|
||||||
lda PTR_READ_DEST+1
|
lda PTR_READ_DEST+1
|
||||||
sec
|
sec
|
||||||
sbc ptr2+1
|
sbc ptr2+1
|
||||||
tax
|
tax
|
||||||
lda PTR_READ_DEST
|
lda PTR_READ_DEST
|
||||||
sec
|
sec
|
||||||
sbc ptr2
|
sbc ptr2
|
||||||
; Here A and X contains number of bytes read
|
; Here A and X contains number of bytes read
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
; jede jede@oric.org 2017-02-25
|
; jede jede@oric.org 2017-02-25
|
||||||
;
|
;
|
||||||
.export _wherex
|
.export _wherex
|
||||||
|
|
||||||
.importzp sp
|
.importzp sp
|
||||||
|
|
||||||
.include "telestrat.inc"
|
.include "telestrat.inc"
|
||||||
|
@ -11,4 +11,4 @@
|
||||||
ldx #$00
|
ldx #$00
|
||||||
lda SCRX
|
lda SCRX
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
;
|
;
|
||||||
; jede jede@oric.org 2017-02-25
|
; jede jede@oric.org 2017-02-25
|
||||||
;
|
;
|
||||||
.export _wherey
|
.export _wherey
|
||||||
|
|
||||||
.include "telestrat.inc"
|
.include "telestrat.inc"
|
||||||
|
|
||||||
.proc _wherey
|
.proc _wherey
|
||||||
ldx #$00
|
ldx #$00
|
||||||
lda SCRY
|
lda SCRY
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
|
@ -23,34 +23,34 @@
|
||||||
jsr popax ; get fd and discard
|
jsr popax ; get fd and discard
|
||||||
|
|
||||||
; if fd=0001 then it stdout
|
; if fd=0001 then it stdout
|
||||||
cpx #0
|
cpx #0
|
||||||
beq next
|
beq next
|
||||||
jmp L1
|
jmp L1
|
||||||
next:
|
next:
|
||||||
cmp #1
|
cmp #1
|
||||||
beq L1
|
beq L1
|
||||||
|
|
||||||
; here it's a file opened
|
; here it's a file opened
|
||||||
lda ptr1
|
lda ptr1
|
||||||
sta PTR_READ_DEST
|
sta PTR_READ_DEST
|
||||||
lda ptr1+1
|
lda ptr1+1
|
||||||
sta PTR_READ_DEST+1
|
sta PTR_READ_DEST+1
|
||||||
lda ptr3
|
lda ptr3
|
||||||
ldy ptr3+1
|
ldy ptr3+1
|
||||||
BRK_TELEMON XFWRITE
|
BRK_TELEMON XFWRITE
|
||||||
; compute nb of bytes written
|
; compute nb of bytes written
|
||||||
|
|
||||||
|
|
||||||
lda PTR_READ_DEST+1
|
lda PTR_READ_DEST+1
|
||||||
sec
|
sec
|
||||||
sbc ptr1+1
|
sbc ptr1+1
|
||||||
tax
|
tax
|
||||||
lda PTR_READ_DEST
|
lda PTR_READ_DEST
|
||||||
sec
|
sec
|
||||||
sbc ptr1
|
sbc ptr1
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
L1: inc ptr2
|
L1: inc ptr2
|
||||||
bne L2
|
bne L2
|
||||||
inc ptr2+1
|
inc ptr2+1
|
||||||
|
@ -63,10 +63,10 @@ L2: ldy #0
|
||||||
BRK_TELEMON XWR0 ; macro send char to screen (channel 0 in telemon terms)
|
BRK_TELEMON XWR0 ; macro send char to screen (channel 0 in telemon terms)
|
||||||
lda #$0D ; return to the beggining of the line
|
lda #$0D ; return to the beggining of the line
|
||||||
BRK_TELEMON XWR0 ; macro
|
BRK_TELEMON XWR0 ; macro
|
||||||
|
|
||||||
|
|
||||||
ldx #$0D
|
ldx #$0D
|
||||||
L3:
|
L3:
|
||||||
BRK_TELEMON XWR0 ; macro
|
BRK_TELEMON XWR0 ; macro
|
||||||
|
|
||||||
inc ptr1
|
inc ptr1
|
||||||
|
@ -81,5 +81,3 @@ L9: lda ptr3
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,32 +25,32 @@ void main(void) {
|
||||||
bss_v = 0x88; // Testing BSS variable
|
bss_v = 0x88; // Testing BSS variable
|
||||||
|
|
||||||
for/*ever*/(;;) {
|
for/*ever*/(;;) {
|
||||||
// Vertical Sync signal
|
// Vertical Sync signal
|
||||||
TIA.vsync = 0x02;
|
TIA.vsync = 0x02;
|
||||||
TIA.wsync = 0x00;
|
TIA.wsync = 0x00;
|
||||||
TIA.wsync = 0x00;
|
TIA.wsync = 0x00;
|
||||||
TIA.wsync = 0x00;
|
TIA.wsync = 0x00;
|
||||||
TIA.vsync = 0x00;
|
TIA.vsync = 0x00;
|
||||||
|
|
||||||
// Vertical Blank timer setting
|
// Vertical Blank timer setting
|
||||||
RIOT.tim64t = VBLANK_TIM64;
|
RIOT.tim64t = VBLANK_TIM64;
|
||||||
|
|
||||||
// Doing frame computation during blank
|
// Doing frame computation during blank
|
||||||
TIA.colubk = color++; // Update color
|
TIA.colubk = color++; // Update color
|
||||||
|
|
||||||
// Wait for end of Vertical Blank
|
// Wait for end of Vertical Blank
|
||||||
while (RIOT.timint == 0) {}
|
while (RIOT.timint == 0) {}
|
||||||
TIA.wsync = 0x00;
|
TIA.wsync = 0x00;
|
||||||
TIA.vblank = 0x00; // Turn on beam
|
TIA.vblank = 0x00; // Turn on beam
|
||||||
|
|
||||||
// Display frame
|
// Display frame
|
||||||
RIOT.t1024t = KERNAL_T1024;
|
RIOT.t1024t = KERNAL_T1024;
|
||||||
while (RIOT.timint == 0) {}
|
while (RIOT.timint == 0) {}
|
||||||
TIA.wsync = 0x00;
|
TIA.wsync = 0x00;
|
||||||
TIA.vblank = 0x02; // Turn off beam
|
TIA.vblank = 0x02; // Turn off beam
|
||||||
|
|
||||||
// Overscan
|
// Overscan
|
||||||
RIOT.tim64t = OVERSCAN_TIM64;
|
RIOT.tim64t = OVERSCAN_TIM64;
|
||||||
while (RIOT.timint == 0) {}
|
while (RIOT.timint == 0) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4256,7 +4256,7 @@ void g_initauto (unsigned Label, unsigned Size)
|
||||||
AddCodeLine ("lda %s,y", GetLabelName (CF_STATIC, Label, 0));
|
AddCodeLine ("lda %s,y", GetLabelName (CF_STATIC, Label, 0));
|
||||||
AddCodeLine ("sta (sp),y");
|
AddCodeLine ("sta (sp),y");
|
||||||
AddCodeLine ("iny");
|
AddCodeLine ("iny");
|
||||||
AddCmpCodeIfSizeNot256 ("cpy #$%02X", Size);
|
AddCmpCodeIfSizeNot256 ("cpy #$%02X", Size);
|
||||||
AddCodeLine ("bne %s", LocalLabelName (CodeLabel));
|
AddCodeLine ("bne %s", LocalLabelName (CodeLabel));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4281,7 +4281,7 @@ void g_initstatic (unsigned InitLabel, unsigned VarLabel, unsigned Size)
|
||||||
AddCodeLine ("lda %s,y", GetLabelName (CF_STATIC, InitLabel, 0));
|
AddCodeLine ("lda %s,y", GetLabelName (CF_STATIC, InitLabel, 0));
|
||||||
AddCodeLine ("sta %s,y", GetLabelName (CF_STATIC, VarLabel, 0));
|
AddCodeLine ("sta %s,y", GetLabelName (CF_STATIC, VarLabel, 0));
|
||||||
AddCodeLine ("iny");
|
AddCodeLine ("iny");
|
||||||
AddCmpCodeIfSizeNot256 ("cpy #$%02X", Size);
|
AddCmpCodeIfSizeNot256 ("cpy #$%02X", Size);
|
||||||
AddCodeLine ("bne %s", LocalLabelName (CodeLabel));
|
AddCodeLine ("bne %s", LocalLabelName (CodeLabel));
|
||||||
} else {
|
} else {
|
||||||
/* Use the easy way here: memcpy() */
|
/* Use the easy way here: memcpy() */
|
||||||
|
|
|
@ -898,9 +898,9 @@ static void ParsePragma (void)
|
||||||
FlagPragma (&B, &StaticLocals);
|
FlagPragma (&B, &StaticLocals);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PRAGMA_WRAPPED_CALL:
|
case PRAGMA_WRAPPED_CALL:
|
||||||
WrappedCallPragma(&B);
|
WrappedCallPragma(&B);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PRAGMA_WARN:
|
case PRAGMA_WARN:
|
||||||
WarnPragma (&B);
|
WarnPragma (&B);
|
||||||
|
|
|
@ -47,8 +47,8 @@
|
||||||
|
|
||||||
typedef struct IntPtrStack IntPtrStack;
|
typedef struct IntPtrStack IntPtrStack;
|
||||||
struct IntPtrInner {
|
struct IntPtrInner {
|
||||||
long val;
|
long val;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
};
|
};
|
||||||
struct IntPtrStack {
|
struct IntPtrStack {
|
||||||
unsigned Count;
|
unsigned Count;
|
||||||
|
|
|
@ -13,7 +13,7 @@ psa: .word 0
|
||||||
.bss
|
.bss
|
||||||
temp_x: .byte 0
|
temp_x: .byte 0
|
||||||
temp_y: .byte 0
|
temp_y: .byte 0
|
||||||
temp_a: .byte 0
|
temp_a: .byte 0
|
||||||
irq_count: .byte 0
|
irq_count: .byte 0
|
||||||
nmi_count: .byte 0
|
nmi_count: .byte 0
|
||||||
psx: .byte 0
|
psx: .byte 0
|
||||||
|
@ -419,4 +419,3 @@ printsign1:
|
||||||
ldy temp_y
|
ldy temp_y
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user