Removed (pretty inconsistently used) tab chars from source code base.
This commit is contained in:
@@ -6,46 +6,46 @@
|
||||
; 6.3.2001, 17.4.2003
|
||||
|
||||
|
||||
.export xsize, ysize
|
||||
.export screensize
|
||||
.importzp cursor_r, cursor_c
|
||||
.import _cursor
|
||||
.constructor initscrsize
|
||||
|
||||
.include "geossym.inc"
|
||||
.export xsize, ysize
|
||||
.export screensize
|
||||
.importzp cursor_r, cursor_c
|
||||
.import _cursor
|
||||
.constructor initscrsize
|
||||
|
||||
.include "geossym.inc"
|
||||
|
||||
.segment "INIT"
|
||||
.segment "INIT"
|
||||
|
||||
initscrsize:
|
||||
.ifdef __GEOS_CBM__
|
||||
lda graphMode
|
||||
bpl L1
|
||||
lda #80 ; 80 columns (more or less)
|
||||
.byte $2c
|
||||
L1: lda #40 ; 40 columns (more or less)
|
||||
sta xsize
|
||||
lda #25 ; something like that for Y size
|
||||
lda graphMode
|
||||
bpl L1
|
||||
lda #80 ; 80 columns (more or less)
|
||||
.byte $2c
|
||||
L1: lda #40 ; 40 columns (more or less)
|
||||
sta xsize
|
||||
lda #25 ; something like that for Y size
|
||||
.else
|
||||
lda #70 ; 70 columns (more or less)
|
||||
sta xsize
|
||||
lda #24 ; something like that for Y size
|
||||
lda #70 ; 70 columns (more or less)
|
||||
sta xsize
|
||||
lda #24 ; something like that for Y size
|
||||
.endif
|
||||
sta ysize
|
||||
lda #0
|
||||
sta cursor_c
|
||||
sta cursor_r
|
||||
jmp _cursor ; home and update cursor
|
||||
sta ysize
|
||||
lda #0
|
||||
sta cursor_c
|
||||
sta cursor_r
|
||||
jmp _cursor ; home and update cursor
|
||||
|
||||
.code
|
||||
|
||||
screensize:
|
||||
ldx xsize
|
||||
ldy ysize
|
||||
rts
|
||||
ldx xsize
|
||||
ldy ysize
|
||||
rts
|
||||
|
||||
.bss
|
||||
|
||||
xsize:
|
||||
.res 1
|
||||
.res 1
|
||||
ysize:
|
||||
.res 1
|
||||
.res 1
|
||||
|
||||
@@ -6,53 +6,53 @@
|
||||
; void cclearxy (unsigned char x, unsigned char y, unsigned char length);
|
||||
; void cclear (unsigned char length);
|
||||
|
||||
.export _cclearxy, _cclear
|
||||
.import popa, _gotoxy, fixcursor
|
||||
.importzp cursor_x, cursor_y, cursor_c
|
||||
.export _cclearxy, _cclear
|
||||
.import popa, _gotoxy, fixcursor
|
||||
.importzp cursor_x, cursor_y, cursor_c
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_cclearxy:
|
||||
pha ; Save the length
|
||||
jsr popa ; Get y
|
||||
jsr _gotoxy ; Call this one, will pop params
|
||||
pla ; Restore the length
|
||||
pha ; Save the length
|
||||
jsr popa ; Get y
|
||||
jsr _gotoxy ; Call this one, will pop params
|
||||
pla ; Restore the length
|
||||
|
||||
_cclear:
|
||||
cmp #0 ; Is the length zero?
|
||||
beq L9 ; Jump if done
|
||||
tax
|
||||
lda cursor_x ; left start
|
||||
sta r3L
|
||||
lda cursor_x+1
|
||||
sta r3L+1
|
||||
lda cursor_y ; level
|
||||
sta r2L
|
||||
clc
|
||||
adc #7
|
||||
sta r2H
|
||||
txa ; right end
|
||||
clc
|
||||
adc cursor_c
|
||||
sta cursor_c
|
||||
sta r4L
|
||||
ldx #r4
|
||||
ldy #3
|
||||
jsr DShiftLeft
|
||||
clc ; one pixel less
|
||||
lda r4L
|
||||
sbc #0
|
||||
sta r4L
|
||||
lda r4L+1
|
||||
sbc #0
|
||||
sta r4L+1
|
||||
lda curPattern ; store current pattern
|
||||
pha
|
||||
lda #0 ; set pattern to clear
|
||||
jsr SetPattern
|
||||
jsr Rectangle
|
||||
pla
|
||||
jsr SetPattern ; restore pattern
|
||||
jsr fixcursor
|
||||
L9: rts
|
||||
cmp #0 ; Is the length zero?
|
||||
beq L9 ; Jump if done
|
||||
tax
|
||||
lda cursor_x ; left start
|
||||
sta r3L
|
||||
lda cursor_x+1
|
||||
sta r3L+1
|
||||
lda cursor_y ; level
|
||||
sta r2L
|
||||
clc
|
||||
adc #7
|
||||
sta r2H
|
||||
txa ; right end
|
||||
clc
|
||||
adc cursor_c
|
||||
sta cursor_c
|
||||
sta r4L
|
||||
ldx #r4
|
||||
ldy #3
|
||||
jsr DShiftLeft
|
||||
clc ; one pixel less
|
||||
lda r4L
|
||||
sbc #0
|
||||
sta r4L
|
||||
lda r4L+1
|
||||
sbc #0
|
||||
sta r4L+1
|
||||
lda curPattern ; store current pattern
|
||||
pha
|
||||
lda #0 ; set pattern to clear
|
||||
jsr SetPattern
|
||||
jsr Rectangle
|
||||
pla
|
||||
jsr SetPattern ; restore pattern
|
||||
jsr fixcursor
|
||||
L9: rts
|
||||
|
||||
@@ -6,34 +6,34 @@
|
||||
|
||||
; unsigned char cgetc (void);
|
||||
|
||||
.export _cgetc
|
||||
.import cursor, _PromptOff
|
||||
.importzp cursor_x, cursor_y
|
||||
.export _cgetc
|
||||
.import cursor, _PromptOff
|
||||
.importzp cursor_x, cursor_y
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_cgetc:
|
||||
; show cursor if needed
|
||||
lda cursor
|
||||
beq L0
|
||||
lda cursor
|
||||
beq L0
|
||||
|
||||
; prepare cursor
|
||||
lda #7
|
||||
jsr InitTextPrompt
|
||||
lda cursor_x
|
||||
ldx cursor_x+1
|
||||
sta stringX
|
||||
stx stringX+1
|
||||
lda cursor_y
|
||||
sta stringY
|
||||
jsr PromptOn
|
||||
lda #7
|
||||
jsr InitTextPrompt
|
||||
lda cursor_x
|
||||
ldx cursor_x+1
|
||||
sta stringX
|
||||
stx stringX+1
|
||||
lda cursor_y
|
||||
sta stringY
|
||||
jsr PromptOn
|
||||
|
||||
L0: jsr GetNextChar
|
||||
tax
|
||||
beq L0
|
||||
pha
|
||||
jsr _PromptOff
|
||||
pla
|
||||
ldx #0
|
||||
rts
|
||||
L0: jsr GetNextChar
|
||||
tax
|
||||
beq L0
|
||||
pha
|
||||
jsr _PromptOff
|
||||
pla
|
||||
ldx #0
|
||||
rts
|
||||
|
||||
@@ -6,49 +6,49 @@
|
||||
; void chlinexy (unsigned char x, unsigned char y, unsigned char length);
|
||||
; void chline (unsigned char length);
|
||||
|
||||
.export _chlinexy, _chline
|
||||
.import popa, _gotoxy, fixcursor
|
||||
.importzp cursor_x, cursor_y, cursor_c
|
||||
.export _chlinexy, _chline
|
||||
.import popa, _gotoxy, fixcursor
|
||||
.importzp cursor_x, cursor_y, cursor_c
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_chlinexy:
|
||||
pha ; Save the length
|
||||
jsr popa ; Get y
|
||||
jsr _gotoxy ; Call this one, will pop params
|
||||
pla ; Restore the length
|
||||
pha ; Save the length
|
||||
jsr popa ; Get y
|
||||
jsr _gotoxy ; Call this one, will pop params
|
||||
pla ; Restore the length
|
||||
|
||||
_chline:
|
||||
cmp #0 ; Is the length zero?
|
||||
beq L9 ; Jump if done
|
||||
tax
|
||||
lda cursor_x ; left start
|
||||
sta r3L
|
||||
lda cursor_x+1
|
||||
sta r3L+1
|
||||
lda cursor_y ; level
|
||||
clc
|
||||
adc #4 ; in the middle of a cell
|
||||
sta r11L
|
||||
txa ; right end
|
||||
clc
|
||||
adc cursor_c
|
||||
sta cursor_c
|
||||
sta r4L
|
||||
lda #0
|
||||
sta r4L+1
|
||||
ldx #r4
|
||||
ldy #3
|
||||
jsr DShiftLeft
|
||||
clc ; one pixel less
|
||||
lda r4L
|
||||
sbc #0
|
||||
sta r4L
|
||||
lda r4L+1
|
||||
sbc #0
|
||||
sta r4L+1
|
||||
lda #%11111111 ; pattern
|
||||
jsr HorizontalLine
|
||||
jsr fixcursor
|
||||
L9: rts
|
||||
cmp #0 ; Is the length zero?
|
||||
beq L9 ; Jump if done
|
||||
tax
|
||||
lda cursor_x ; left start
|
||||
sta r3L
|
||||
lda cursor_x+1
|
||||
sta r3L+1
|
||||
lda cursor_y ; level
|
||||
clc
|
||||
adc #4 ; in the middle of a cell
|
||||
sta r11L
|
||||
txa ; right end
|
||||
clc
|
||||
adc cursor_c
|
||||
sta cursor_c
|
||||
sta r4L
|
||||
lda #0
|
||||
sta r4L+1
|
||||
ldx #r4
|
||||
ldy #3
|
||||
jsr DShiftLeft
|
||||
clc ; one pixel less
|
||||
lda r4L
|
||||
sbc #0
|
||||
sta r4L
|
||||
lda r4L+1
|
||||
sbc #0
|
||||
sta r4L+1
|
||||
lda #%11111111 ; pattern
|
||||
jsr HorizontalLine
|
||||
jsr fixcursor
|
||||
L9: rts
|
||||
|
||||
@@ -5,45 +5,45 @@
|
||||
|
||||
; void clrscr (void);
|
||||
|
||||
.export _clrscr
|
||||
.import fixcursor
|
||||
.importzp cursor_c, cursor_r
|
||||
.export _clrscr
|
||||
.import fixcursor
|
||||
.importzp cursor_c, cursor_r
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "const.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "const.inc"
|
||||
|
||||
_clrscr:
|
||||
lda curPattern ; save current pattern
|
||||
pha
|
||||
lda #0 ; set pattern to clear
|
||||
jsr SetPattern
|
||||
ldx #0
|
||||
stx r3L
|
||||
stx r3H
|
||||
stx r2L
|
||||
stx cursor_c
|
||||
stx cursor_r
|
||||
jsr fixcursor ; home cursor
|
||||
lda curPattern ; save current pattern
|
||||
pha
|
||||
lda #0 ; set pattern to clear
|
||||
jsr SetPattern
|
||||
ldx #0
|
||||
stx r3L
|
||||
stx r3H
|
||||
stx r2L
|
||||
stx cursor_c
|
||||
stx cursor_r
|
||||
jsr fixcursor ; home cursor
|
||||
.ifdef __GEOS_CBM__
|
||||
lda #199
|
||||
sta r2H
|
||||
lda graphMode
|
||||
bpl L40
|
||||
lda #>639 ; 80 columns
|
||||
ldx #<639
|
||||
bne L99
|
||||
L40: lda #>319 ; 40 columns
|
||||
ldx #<319
|
||||
lda #199
|
||||
sta r2H
|
||||
lda graphMode
|
||||
bpl L40
|
||||
lda #>639 ; 80 columns
|
||||
ldx #<639
|
||||
bne L99
|
||||
L40: lda #>319 ; 40 columns
|
||||
ldx #<319
|
||||
L99:
|
||||
.else
|
||||
lda #191
|
||||
sta r2H
|
||||
lda #>559
|
||||
ldx #<559
|
||||
lda #191
|
||||
sta r2H
|
||||
lda #>559
|
||||
ldx #<559
|
||||
.endif
|
||||
sta r4H
|
||||
stx r4L
|
||||
jsr Rectangle
|
||||
pla
|
||||
jmp SetPattern ; restore pattern
|
||||
sta r4H
|
||||
stx r4L
|
||||
jsr Rectangle
|
||||
pla
|
||||
jmp SetPattern ; restore pattern
|
||||
|
||||
@@ -22,70 +22,70 @@
|
||||
; HOME = KEY_ENTER, KEY_HOME = REV_ON,
|
||||
; UPLINE = ?, KEY_UPARROW = GOTOY, ...
|
||||
|
||||
.export _cputcxy, _cputc
|
||||
.import _gotoxy, fixcursor
|
||||
.import popa
|
||||
.import xsize,ysize
|
||||
.importzp cursor_x, cursor_y, cursor_c, cursor_r
|
||||
.export _cputcxy, _cputc
|
||||
.import _gotoxy, fixcursor
|
||||
.import popa
|
||||
.import xsize,ysize
|
||||
.importzp cursor_x, cursor_y, cursor_c, cursor_r
|
||||
|
||||
.include "const.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "const.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
|
||||
_cputcxy:
|
||||
pha ; Save C
|
||||
jsr popa ; Get Y
|
||||
jsr _gotoxy ; Set cursor, drop x
|
||||
pla ; Restore C
|
||||
pha ; Save C
|
||||
jsr popa ; Get Y
|
||||
jsr _gotoxy ; Set cursor, drop x
|
||||
pla ; Restore C
|
||||
|
||||
; Plot a character - also used as internal function
|
||||
|
||||
_cputc:
|
||||
tax ; save character
|
||||
tax ; save character
|
||||
; some characters 0-31 are not safe for PutChar
|
||||
cmp #$20
|
||||
bcs L1
|
||||
cmp #CR
|
||||
beq do_cr
|
||||
cmp #LF
|
||||
beq do_lf
|
||||
cmp #KEY_DELETE
|
||||
bne L0
|
||||
ldx #BACKSPACE
|
||||
sec
|
||||
bcs L2
|
||||
L0: rts
|
||||
cmp #$20
|
||||
bcs L1
|
||||
cmp #CR
|
||||
beq do_cr
|
||||
cmp #LF
|
||||
beq do_lf
|
||||
cmp #KEY_DELETE
|
||||
bne L0
|
||||
ldx #BACKSPACE
|
||||
sec
|
||||
bcs L2
|
||||
L0: rts
|
||||
|
||||
L1: clc
|
||||
L2: php
|
||||
lda cursor_x
|
||||
sta r11L
|
||||
lda cursor_x+1
|
||||
sta r11H
|
||||
lda cursor_y
|
||||
clc
|
||||
adc #6 ; 6 pixels down to the baseline
|
||||
sta r1H
|
||||
txa
|
||||
jsr PutChar
|
||||
plp
|
||||
bcs fix_cursor
|
||||
L1: clc
|
||||
L2: php
|
||||
lda cursor_x
|
||||
sta r11L
|
||||
lda cursor_x+1
|
||||
sta r11H
|
||||
lda cursor_y
|
||||
clc
|
||||
adc #6 ; 6 pixels down to the baseline
|
||||
sta r1H
|
||||
txa
|
||||
jsr PutChar
|
||||
plp
|
||||
bcs fix_cursor
|
||||
|
||||
inc cursor_c
|
||||
lda cursor_c
|
||||
cmp xsize ; hit right margin?
|
||||
bne fix_cursor
|
||||
lda #0 ; yes - do cr+lf
|
||||
sta cursor_c
|
||||
do_lf: inc cursor_r
|
||||
lda cursor_r
|
||||
cmp ysize ; hit bottom margin?
|
||||
bne fix_cursor
|
||||
dec cursor_r ; yes - stay in the last line
|
||||
inc cursor_c
|
||||
lda cursor_c
|
||||
cmp xsize ; hit right margin?
|
||||
bne fix_cursor
|
||||
lda #0 ; yes - do cr+lf
|
||||
sta cursor_c
|
||||
do_lf: inc cursor_r
|
||||
lda cursor_r
|
||||
cmp ysize ; hit bottom margin?
|
||||
bne fix_cursor
|
||||
dec cursor_r ; yes - stay in the last line
|
||||
|
||||
fix_cursor:
|
||||
jmp fixcursor
|
||||
jmp fixcursor
|
||||
|
||||
do_cr: lda #0
|
||||
sta cursor_c
|
||||
beq fix_cursor
|
||||
do_cr: lda #0
|
||||
sta cursor_c
|
||||
beq fix_cursor
|
||||
|
||||
@@ -6,43 +6,43 @@
|
||||
; void cvlinexy (unsigned char x, unsigned char y, unsigned char length);
|
||||
; void cvline (unsigned char length);
|
||||
|
||||
.export _cvlinexy, _cvline
|
||||
.import popa, _gotoxy, fixcursor
|
||||
.importzp cursor_x, cursor_y, cursor_r
|
||||
.export _cvlinexy, _cvline
|
||||
.import popa, _gotoxy, fixcursor
|
||||
.importzp cursor_x, cursor_y, cursor_r
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_cvlinexy:
|
||||
pha ; Save the length
|
||||
jsr popa ; Get y
|
||||
jsr _gotoxy ; Call this one, will pop params
|
||||
pla ; Restore the length
|
||||
pha ; Save the length
|
||||
jsr popa ; Get y
|
||||
jsr _gotoxy ; Call this one, will pop params
|
||||
pla ; Restore the length
|
||||
|
||||
_cvline:
|
||||
cmp #0 ; Is the length zero?
|
||||
beq L9 ; Jump if done
|
||||
tax
|
||||
lda cursor_x ; x position
|
||||
clc
|
||||
adc #3 ; in the middle of cell
|
||||
sta r4L
|
||||
lda cursor_x+1
|
||||
adc #0
|
||||
sta r4L+1
|
||||
lda cursor_y ; top start
|
||||
sta r3L
|
||||
txa ; bottom end
|
||||
clc
|
||||
adc cursor_r
|
||||
sta cursor_r
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
clc ; one pixel less
|
||||
sbc #0
|
||||
sta r3H
|
||||
lda #%11111111 ; pattern
|
||||
jsr VerticalLine
|
||||
jsr fixcursor
|
||||
L9: rts
|
||||
cmp #0 ; Is the length zero?
|
||||
beq L9 ; Jump if done
|
||||
tax
|
||||
lda cursor_x ; x position
|
||||
clc
|
||||
adc #3 ; in the middle of cell
|
||||
sta r4L
|
||||
lda cursor_x+1
|
||||
adc #0
|
||||
sta r4L+1
|
||||
lda cursor_y ; top start
|
||||
sta r3L
|
||||
txa ; bottom end
|
||||
clc
|
||||
adc cursor_r
|
||||
sta cursor_r
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
clc ; one pixel less
|
||||
sbc #0
|
||||
sta r3H
|
||||
lda #%11111111 ; pattern
|
||||
jsr VerticalLine
|
||||
jsr fixcursor
|
||||
L9: rts
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
; unsigned char __fastcall__ revers (unsigned char onoff);
|
||||
;
|
||||
|
||||
.export _textcolor, _bgcolor, _bordercolor, _revers
|
||||
.import return0
|
||||
.export _textcolor, _bgcolor, _bordercolor, _revers
|
||||
.import return0
|
||||
|
||||
_textcolor = return0
|
||||
_bgcolor = return0
|
||||
_bordercolor = return0
|
||||
_revers = return0
|
||||
_textcolor = return0
|
||||
_bgcolor = return0
|
||||
_bordercolor = return0
|
||||
_revers = return0
|
||||
|
||||
@@ -8,37 +8,37 @@
|
||||
; void gotoy (unsigned char y);
|
||||
; void gotoxy (unsigned char x, unsigned char y);
|
||||
|
||||
.export _gotox, _gotoy, _gotoxy, fixcursor
|
||||
.import popa
|
||||
.importzp cursor_x, cursor_y, cursor_c, cursor_r
|
||||
.export _gotox, _gotoy, _gotoxy, fixcursor
|
||||
.import popa
|
||||
.importzp cursor_x, cursor_y, cursor_c, cursor_r
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "jumptab.inc"
|
||||
|
||||
_gotox:
|
||||
sta cursor_c
|
||||
jmp fixcursor
|
||||
sta cursor_c
|
||||
jmp fixcursor
|
||||
|
||||
_gotoy:
|
||||
sta cursor_r
|
||||
jmp fixcursor
|
||||
sta cursor_r
|
||||
jmp fixcursor
|
||||
|
||||
_gotoxy:
|
||||
sta cursor_r
|
||||
jsr popa
|
||||
sta cursor_c
|
||||
sta cursor_r
|
||||
jsr popa
|
||||
sta cursor_c
|
||||
|
||||
; convert 8x8 x/y coordinates to GEOS hires
|
||||
fixcursor:
|
||||
lda cursor_c
|
||||
sta cursor_x
|
||||
lda #0
|
||||
sta cursor_x+1
|
||||
ldx #cursor_x
|
||||
ldy #3
|
||||
jsr DShiftLeft
|
||||
lda cursor_r
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
sta cursor_y
|
||||
rts
|
||||
lda cursor_c
|
||||
sta cursor_x
|
||||
lda #0
|
||||
sta cursor_x+1
|
||||
ldx #cursor_x
|
||||
ldy #3
|
||||
jsr DShiftLeft
|
||||
lda cursor_r
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
sta cursor_y
|
||||
rts
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
; unsigned char kbhit (void);
|
||||
|
||||
.export _kbhit
|
||||
.export _kbhit
|
||||
|
||||
.include "geossym.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_kbhit:
|
||||
ldx #0 ; High byte of result
|
||||
lda pressFlag
|
||||
rol ; Bit 7 is new key flag
|
||||
txa ; A = 0
|
||||
rol
|
||||
rts
|
||||
ldx #0 ; High byte of result
|
||||
lda pressFlag
|
||||
rol ; Bit 7 is new key flag
|
||||
txa ; A = 0
|
||||
rol
|
||||
rts
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
; unsigned char wherex (void);
|
||||
; unsigned char wherey (void);
|
||||
|
||||
.export _wherex, _wherey
|
||||
.importzp cursor_c, cursor_r
|
||||
.export _wherex, _wherey
|
||||
.importzp cursor_c, cursor_r
|
||||
|
||||
_wherex:
|
||||
lda cursor_c
|
||||
ldx #0
|
||||
rts
|
||||
lda cursor_c
|
||||
ldx #0
|
||||
rts
|
||||
|
||||
_wherey:
|
||||
lda cursor_r
|
||||
ldx #0
|
||||
rts
|
||||
lda cursor_r
|
||||
ldx #0
|
||||
rts
|
||||
|
||||
Reference in New Issue
Block a user