@@ 48,7 48,7 @@ void trimstr(char *src, char *dest) {
/* leading whitespace */
int a, b, len = strlen(src) + 1;
for (a = 0; a < len; a++) {
- if (src[a] != ' ') {
+ if (src[a] != ' ' && src[a] != '\t') {
break;
}
}
@@ 299,7 299,7 @@ void lint(char *filepath, char *output, bool do_debug) {
set_line_value(trimed, value);
set_line_comment(trimed, comment);
ucstr(key);
- strcat(output, " ");
+ strcat(output, "\t");
strcat(output, key);
strcat(output, " ");
if (has_comment(line)) {
@@ 319,7 319,7 @@ void lint(char *filepath, char *output, bool do_debug) {
set_line_key(trimed, key);
set_line_value(trimed, value);
set_line_comment(trimed, comment);
- strcat(output, " ");
+ strcat(output, "\t");
strcat(output, key);
strcat(output, " ");
if (has_comment(line)) {
@@ 333,7 333,7 @@ void lint(char *filepath, char *output, bool do_debug) {
skipped_last = false;
directives++;
} else if (is_inline_comment(trimed)) {
- strcat(output, " ");
+ strcat(output, "\t");
strcat(output, trimed);
skipped_last = false;
comments++;
@@ 391,12 391,12 @@ void lint(char *filepath, char *output, bool do_debug) {
}
if (do_debug) {
printf("Linted %d lines: \n", count);
- printf(" %d labels\n", labels);
- printf(" %d opcodes\n", opcodes);
- printf(" %d directives\n", directives);
- printf(" %d spacers\n", spacers);
- printf(" %d variables\n", variables);
- printf(" %d constants\n", constants);
+ printf("\t%d labels\n", labels);
+ printf("\t%d opcodes\n", opcodes);
+ printf("\t%d directives\n", directives);
+ printf("\t%d spacers\n", spacers);
+ printf("\t%d variables\n", variables);
+ printf("\t%d constants\n", constants);
}
fclose(fr);
}
@@ 416,12 416,12 @@ void show_help() {
}
int main(int argc, char *argv[]) {
+ bool do_debug = false, do_inplace = false;
+ int i;
if (argc < 2) {
show_help();
exit(0);
}
- bool do_debug = false, do_inplace = false;
- int i;
for (i = 1; i < argc; i++) {
if (argv[i][1] == '?') {
show_help();
@@ 1,10 1,10 @@
;; Variables
- .enum $0000 ; Directive comment
+ .enum $0000 ; Directive comment
pos_x .dsb 1 ; Variable comment
pos_y .dsb 1
- .ende
+ .ende
;; Constants
@@ 12,35 12,35 @@ SPRITE_Y .equ $0200 ; Constant comment
SPRITE_XY .equ $0203
RESET:
- NOP
+ NOP
Forever:
- JMP Forever
+ JMP Forever
NMI:
- RTI
+ RTI
;; Routines
CheckCollision: ; Routine comment
- LDA pos_y
- CMP #$88 ; Opcode comment
- BCC @done
- ; Inline comment
- LDA #$88
- STA pos_y
+ LDA pos_y
+ CMP #$88 ; Opcode comment
+ BCC @done
+ ; Inline comment
+ LDA #$88
+ STA pos_y
@done:
- RTS
+ RTS
;; Tables
Table:
- .db $40,$46,$4c,$52,$58,$5e,$63,$68
+ .db $40,$46,$4c,$52,$58,$5e,$63,$68
;; Vectors
- .pad $FFFA
- .dw NMI
- .dw RESET
- .dw 0
- .incbin "src/sprite.chr"
+ .pad $FFFA
+ .dw NMI
+ .dw RESET
+ .dw 0
+ .incbin "src/sprite.chr"