From 58484449b4842517d09618bc1c5dad59373250ef Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Tue, 5 Feb 2019 23:27:52 +0100 Subject: [PATCH] remove TABs --- asminc/smc.inc | 22 +++++++------- asminc/telestrat.inc | 2 +- cfg/telestrat.cfg | 2 +- include/_tia.h | 56 +++++++++++++++++------------------ libsrc/common/getcpu.s | 2 +- libsrc/telestrat/cgetc.s | 20 ++++++------- libsrc/telestrat/close.s | 14 ++++----- libsrc/telestrat/clrscr.s | 18 +++++------ libsrc/telestrat/gotox.s | 6 ++-- libsrc/telestrat/gotoy.s | 2 +- libsrc/telestrat/mainargs.s | 48 +++++++++++++++--------------- libsrc/telestrat/open.s | 20 ++++++------- libsrc/telestrat/read.s | 10 +++---- libsrc/telestrat/wherex.s | 4 +-- libsrc/telestrat/wherey.s | 6 ++-- libsrc/telestrat/write.s | 40 ++++++++++++------------- samples/atari2600hello.c | 54 ++++++++++++++++----------------- src/cc65/codegen.c | 4 +-- src/cc65/pragma.c | 6 ++-- src/common/intptrstack.h | 4 +-- testcode/lib/gamate/lcdtest.s | 3 +- 21 files changed, 169 insertions(+), 174 deletions(-) diff --git a/asminc/smc.inc b/asminc/smc.inc index 0583f79e0..137c2d49a 100644 --- a/asminc/smc.inc +++ b/asminc/smc.inc @@ -63,7 +63,7 @@ _SMCDesignator: statement ldy #opcode sty _SMCDesignator .else - .error "Invalid usage of macro 'SMC_TransferOpcode'" + .error "Invalid usage of macro 'SMC_TransferOpcode'" .endif .endmacro @@ -75,7 +75,7 @@ _SMCDesignator: statement .elseif .match ({register}, y) ldy _SMCDesignator .else - .error "Invalid usage of macro 'SMC_LoadOpcode'" + .error "Invalid usage of macro 'SMC_LoadOpcode'" .endif .endmacro @@ -87,7 +87,7 @@ _SMCDesignator: statement .elseif .match ({register}, y) sty _SMCDesignator .else - .error "Invalid usage of macro 'SMC_StoreOpcode'" + .error "Invalid usage of macro 'SMC_StoreOpcode'" .endif .endmacro @@ -102,7 +102,7 @@ _SMCDesignator: statement ldy #(<(destination - _SMCDesignator - 2)) sty _SMCDesignator+1 .else - .error "Invalid usage of macro 'SMC_ChangeBranch'" + .error "Invalid usage of macro 'SMC_ChangeBranch'" .endif .endmacro @@ -117,7 +117,7 @@ _SMCDesignator: statement ldy value sty _SMCDesignator+1 .else - .error "Invalid usage of macro 'SMC_TransferValue'" + .error "Invalid usage of macro 'SMC_TransferValue'" .endif .endmacro @@ -129,7 +129,7 @@ _SMCDesignator: statement .elseif .match ({register}, y) ldy _SMCDesignator+1 .else - .error "Invalid usage of macro 'SMC_LoadValue'" + .error "Invalid usage of macro 'SMC_LoadValue'" .endif .endmacro @@ -141,7 +141,7 @@ _SMCDesignator: statement .elseif .match ({register}, y) sty _SMCDesignator+1 .else - .error "Invalid usage of macro 'SMC_StoreValue'" + .error "Invalid usage of macro 'SMC_StoreValue'" .endif .endmacro @@ -169,7 +169,7 @@ SMC_StoreValue label, register ldy value sty _SMCDesignator+2 .else - .error "Invalid usage of macro 'SMC_TransferHighByte'" + .error "Invalid usage of macro 'SMC_TransferHighByte'" .endif .endmacro @@ -181,7 +181,7 @@ SMC_StoreValue label, register .elseif .match ({register}, y) ldy _SMCDesignator+2 .else - .error "Invalid usage of macro 'SMC_LoadHighByte'" + .error "Invalid usage of macro 'SMC_LoadHighByte'" .endif .endmacro @@ -193,7 +193,7 @@ SMC_StoreValue label, register .elseif .match ({register}, y) sty _SMCDesignator+2 .else - .error "Invalid usage of macro 'SMC_StoreHighByte'" + .error "Invalid usage of macro 'SMC_StoreHighByte'" .endif .endmacro @@ -241,7 +241,7 @@ SMC_StoreValue label, register sty _SMCDesignator+2 .endif .else - .error "Invalid usage of macro 'SMC_TransferAddressSingle'" + .error "Invalid usage of macro 'SMC_TransferAddressSingle'" .endif .endmacro diff --git a/asminc/telestrat.inc b/asminc/telestrat.inc index df607e375..9322ec114 100644 --- a/asminc/telestrat.inc +++ b/asminc/telestrat.inc @@ -367,5 +367,5 @@ XRWTS := $FFAA ; MACRO .macro BRK_TELEMON value - .byte $00,value + .byte $00,value .endmacro diff --git a/cfg/telestrat.cfg b/cfg/telestrat.cfg index 14ae30311..db897133e 100644 --- a/cfg/telestrat.cfg +++ b/cfg/telestrat.cfg @@ -2,7 +2,7 @@ SYMBOLS { __ORIXHDR__: type = import; __STACKSIZE__: type = weak, value = $0800; # 2K stack __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 { ZP: file = "", define = yes, start = $00B0, size = $003A; diff --git a/include/_tia.h b/include/_tia.h index c89c04d6c..67c08ea18 100644 --- a/include/_tia.h +++ b/include/_tia.h @@ -11,60 +11,60 @@ /* TIA write / read registers */ struct __tia { union { - unsigned char vsync; - unsigned char cxm0p; + unsigned char vsync; + unsigned char cxm0p; }; union { - unsigned char vblank; - unsigned char cxm1p; + unsigned char vblank; + unsigned char cxm1p; }; union { - unsigned char wsync; - unsigned char cxp0fb; + unsigned char wsync; + unsigned char cxp0fb; }; union { - unsigned char rsync; - unsigned char cxp1fb; + unsigned char rsync; + unsigned char cxp1fb; }; union { - unsigned char nusiz0; - unsigned char cxm0fb; + unsigned char nusiz0; + unsigned char cxm0fb; }; union { - unsigned char nusiz1; - unsigned char cxm1fb; + unsigned char nusiz1; + unsigned char cxm1fb; }; union { - unsigned char colup0; - unsigned char cxblpf; + unsigned char colup0; + unsigned char cxblpf; }; union { - unsigned char colup1; - unsigned char cxppmm; + unsigned char colup1; + unsigned char cxppmm; }; union { - unsigned char colupf; - unsigned char inpt0; + unsigned char colupf; + unsigned char inpt0; }; union { - unsigned char colubk; - unsigned char inpt1; + unsigned char colubk; + unsigned char inpt1; }; union { - unsigned char ctrlpf; - unsigned char inpt2; + unsigned char ctrlpf; + unsigned char inpt2; }; union { - unsigned char refp0; - unsigned char inpt3; + unsigned char refp0; + unsigned char inpt3; }; union { - unsigned char refp1; - unsigned char inpt4; + unsigned char refp1; + unsigned char inpt4; }; union { - unsigned char pf0; - unsigned char inpt5; + unsigned char pf0; + unsigned char inpt5; }; unsigned char pf1; unsigned char pf2; diff --git a/libsrc/common/getcpu.s b/libsrc/common/getcpu.s index 51ccd5a4a..ab6a8aef9 100644 --- a/libsrc/common/getcpu.s +++ b/libsrc/common/getcpu.s @@ -3,7 +3,7 @@ ; ; unsigned char getcpu (void); ; - .include "zeropage.inc" + .include "zeropage.inc" .export _getcpu ; --------------------------------------------------------------------------- diff --git a/libsrc/telestrat/cgetc.s b/libsrc/telestrat/cgetc.s index 6a6b23318..cad8814af 100644 --- a/libsrc/telestrat/cgetc.s +++ b/libsrc/telestrat/cgetc.s @@ -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 diff --git a/libsrc/telestrat/close.s b/libsrc/telestrat/close.s index 40e2c10b3..17f6327f0 100644 --- a/libsrc/telestrat/close.s +++ b/libsrc/telestrat/close.s @@ -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 diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s index 31c8ee205..1f90a7ca5 100644 --- a/libsrc/telestrat/clrscr.s +++ b/libsrc/telestrat/clrscr.s @@ -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 @@ -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 diff --git a/libsrc/telestrat/gotox.s b/libsrc/telestrat/gotox.s index d6af0e4dd..f16c05b71 100644 --- a/libsrc/telestrat/gotox.s +++ b/libsrc/telestrat/gotox.s @@ -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 diff --git a/libsrc/telestrat/gotoy.s b/libsrc/telestrat/gotoy.s index ed7101c80..05ed71de7 100644 --- a/libsrc/telestrat/gotoy.s +++ b/libsrc/telestrat/gotoy.s @@ -10,4 +10,4 @@ .proc _gotoy sta SCRY rts -.endproc +.endproc diff --git a/libsrc/telestrat/mainargs.s b/libsrc/telestrat/mainargs.s index 0c9e799da..b7ffb4ec7 100644 --- a/libsrc/telestrat/mainargs.s +++ b/libsrc/telestrat/mainargs.s @@ -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 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 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 diff --git a/libsrc/telestrat/open.s b/libsrc/telestrat/open.s index 08910f4f2..f59d3d31a 100644 --- a/libsrc/telestrat/open.s +++ b/libsrc/telestrat/open.s @@ -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 diff --git a/libsrc/telestrat/read.s b/libsrc/telestrat/read.s index 75766cda2..76de9d0ac 100644 --- a/libsrc/telestrat/read.s +++ b/libsrc/telestrat/read.s @@ -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 - - diff --git a/libsrc/telestrat/wherex.s b/libsrc/telestrat/wherex.s index 0dd5139e1..8616003c8 100644 --- a/libsrc/telestrat/wherex.s +++ b/libsrc/telestrat/wherex.s @@ -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 diff --git a/libsrc/telestrat/wherey.s b/libsrc/telestrat/wherey.s index 962608ca2..c05b5f5c8 100644 --- a/libsrc/telestrat/wherey.s +++ b/libsrc/telestrat/wherey.s @@ -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 diff --git a/libsrc/telestrat/write.s b/libsrc/telestrat/write.s index 6498283fb..68aef42d6 100644 --- a/libsrc/telestrat/write.s +++ b/libsrc/telestrat/write.s @@ -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 - - diff --git a/samples/atari2600hello.c b/samples/atari2600hello.c index e4f7893b7..4785ad90b 100644 --- a/samples/atari2600hello.c +++ b/samples/atari2600hello.c @@ -25,32 +25,32 @@ void main(void) { bss_v = 0x88; // Testing BSS variable for/*ever*/(;;) { - // Vertical Sync signal - TIA.vsync = 0x02; - TIA.wsync = 0x00; - TIA.wsync = 0x00; - TIA.wsync = 0x00; - TIA.vsync = 0x00; - - // Vertical Blank timer setting - RIOT.tim64t = VBLANK_TIM64; - - // Doing frame computation during blank - TIA.colubk = color++; // Update color - - // Wait for end of Vertical Blank - while (RIOT.timint == 0) {} - TIA.wsync = 0x00; - TIA.vblank = 0x00; // Turn on beam - - // Display frame - RIOT.t1024t = KERNAL_T1024; - while (RIOT.timint == 0) {} - TIA.wsync = 0x00; - TIA.vblank = 0x02; // Turn off beam - - // Overscan - RIOT.tim64t = OVERSCAN_TIM64; - while (RIOT.timint == 0) {} + // Vertical Sync signal + TIA.vsync = 0x02; + TIA.wsync = 0x00; + TIA.wsync = 0x00; + TIA.wsync = 0x00; + TIA.vsync = 0x00; + + // Vertical Blank timer setting + RIOT.tim64t = VBLANK_TIM64; + + // Doing frame computation during blank + TIA.colubk = color++; // Update color + + // Wait for end of Vertical Blank + while (RIOT.timint == 0) {} + TIA.wsync = 0x00; + TIA.vblank = 0x00; // Turn on beam + + // Display frame + RIOT.t1024t = KERNAL_T1024; + while (RIOT.timint == 0) {} + TIA.wsync = 0x00; + TIA.vblank = 0x02; // Turn off beam + + // Overscan + RIOT.tim64t = OVERSCAN_TIM64; + while (RIOT.timint == 0) {} } } diff --git a/src/cc65/codegen.c b/src/cc65/codegen.c index 0f7b45968..a611f4f6a 100644 --- a/src/cc65/codegen.c +++ b/src/cc65/codegen.c @@ -4256,7 +4256,7 @@ void g_initauto (unsigned Label, unsigned Size) AddCodeLine ("lda %s,y", GetLabelName (CF_STATIC, Label, 0)); AddCodeLine ("sta (sp),y"); AddCodeLine ("iny"); - AddCmpCodeIfSizeNot256 ("cpy #$%02X", Size); + AddCmpCodeIfSizeNot256 ("cpy #$%02X", Size); 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 ("sta %s,y", GetLabelName (CF_STATIC, VarLabel, 0)); AddCodeLine ("iny"); - AddCmpCodeIfSizeNot256 ("cpy #$%02X", Size); + AddCmpCodeIfSizeNot256 ("cpy #$%02X", Size); AddCodeLine ("bne %s", LocalLabelName (CodeLabel)); } else { /* Use the easy way here: memcpy() */ diff --git a/src/cc65/pragma.c b/src/cc65/pragma.c index 1a24a08d9..b05ef6122 100644 --- a/src/cc65/pragma.c +++ b/src/cc65/pragma.c @@ -898,9 +898,9 @@ static void ParsePragma (void) FlagPragma (&B, &StaticLocals); break; - case PRAGMA_WRAPPED_CALL: - WrappedCallPragma(&B); - break; + case PRAGMA_WRAPPED_CALL: + WrappedCallPragma(&B); + break; case PRAGMA_WARN: WarnPragma (&B); diff --git a/src/common/intptrstack.h b/src/common/intptrstack.h index a7b1c6683..4e9cf08f4 100644 --- a/src/common/intptrstack.h +++ b/src/common/intptrstack.h @@ -47,8 +47,8 @@ typedef struct IntPtrStack IntPtrStack; struct IntPtrInner { - long val; - void *ptr; + long val; + void *ptr; }; struct IntPtrStack { unsigned Count; diff --git a/testcode/lib/gamate/lcdtest.s b/testcode/lib/gamate/lcdtest.s index 3a8d72226..56ed82a79 100644 --- a/testcode/lib/gamate/lcdtest.s +++ b/testcode/lib/gamate/lcdtest.s @@ -13,7 +13,7 @@ psa: .word 0 .bss temp_x: .byte 0 temp_y: .byte 0 -temp_a: .byte 0 +temp_a: .byte 0 irq_count: .byte 0 nmi_count: .byte 0 psx: .byte 0 @@ -419,4 +419,3 @@ printsign1: ldy temp_y rts .endproc - -- 2.39.2