Normalized coding style.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5497 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
void _afailed (char* file, unsigned line)
|
void _afailed (char* file, unsigned line)
|
||||||
{
|
{
|
||||||
|
|
||||||
ExitTurbo();
|
ExitTurbo();
|
||||||
|
|
||||||
drawWindow.top = 0;
|
drawWindow.top = 0;
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
; Copy the data segment from the LOAD to the RUN location
|
; Copy the data segment from the LOAD to the RUN location
|
||||||
;
|
;
|
||||||
|
|
||||||
.export copydata
|
.export copydata
|
||||||
.import __DATA_LOAD__, __DATA_RUN__, __DATA_SIZE__
|
.import __DATA_LOAD__, __DATA_RUN__, __DATA_SIZE__
|
||||||
.include "geossym.inc"
|
|
||||||
.include "jumptab.inc"
|
.include "geossym.inc"
|
||||||
|
.include "jumptab.inc"
|
||||||
|
|
||||||
copydata:
|
copydata:
|
||||||
lda #<__DATA_SIZE__ ; no need to check if it is == 0
|
lda #<__DATA_SIZE__ ; no need to check if it is == 0
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
; Maciej 'YTM/Elysium' Witkowiak, 15.07.2001
|
; Maciej 'YTM/Elysium' Witkowiak, 15.07.2001
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _memcpy
|
.export _memcpy
|
||||||
.import _MoveData
|
.import _MoveData
|
||||||
|
|
||||||
_memcpy = _MoveData
|
_memcpy = _MoveData
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
; Maciej 'YTM/Elysium' Witkowiak, 15.07.2001
|
; Maciej 'YTM/Elysium' Witkowiak, 15.07.2001
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _memmove
|
.export _memmove
|
||||||
.import _MoveData
|
.import _MoveData
|
||||||
|
|
||||||
_memmove = _MoveData
|
_memmove = _MoveData
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
; Maciej 'YTM/Elysium' Witkowiak, 20.08.2003
|
; Maciej 'YTM/Elysium' Witkowiak, 20.08.2003
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _memset, _bzero, __bzero
|
.export _memset, _bzero, __bzero
|
||||||
.import _ClearRam, _FillRam
|
.import _ClearRam, _FillRam
|
||||||
|
|
||||||
_bzero = _ClearRam
|
_bzero = _ClearRam
|
||||||
__bzero = _ClearRam
|
__bzero = _ClearRam
|
||||||
_memset = _FillRam
|
_memset = _FillRam
|
||||||
|
|||||||
@@ -5,21 +5,21 @@
|
|||||||
; Zero the bss segment.
|
; Zero the bss segment.
|
||||||
;
|
;
|
||||||
|
|
||||||
.export zerobss
|
.export zerobss
|
||||||
.import __BSS_RUN__, __BSS_SIZE__
|
.import __BSS_RUN__, __BSS_SIZE__
|
||||||
|
|
||||||
.include "jumptab.inc"
|
.include "jumptab.inc"
|
||||||
.include "geossym.inc"
|
.include "geossym.inc"
|
||||||
|
|
||||||
.code
|
.code
|
||||||
|
|
||||||
zerobss:
|
zerobss:
|
||||||
lda #<__BSS_SIZE__
|
lda #<__BSS_SIZE__
|
||||||
ldx #>__BSS_SIZE__
|
ldx #>__BSS_SIZE__
|
||||||
sta r0L
|
sta r0L
|
||||||
stx r0H
|
stx r0H
|
||||||
lda #<__BSS_RUN__
|
lda #<__BSS_RUN__
|
||||||
ldx #>__BSS_RUN__
|
ldx #>__BSS_RUN__
|
||||||
sta r1L
|
sta r1L
|
||||||
stx r1H
|
stx r1H
|
||||||
jmp ClearRam
|
jmp ClearRam
|
||||||
|
|||||||
@@ -7,14 +7,14 @@
|
|||||||
|
|
||||||
S_OBJS += _scrsize.o \
|
S_OBJS += _scrsize.o \
|
||||||
cclear.o \
|
cclear.o \
|
||||||
chline.o \
|
|
||||||
cvline.o \
|
|
||||||
cgetc.o \
|
cgetc.o \
|
||||||
|
chline.o \
|
||||||
clrscr.o \
|
clrscr.o \
|
||||||
color.o \
|
color.o \
|
||||||
cputc.o \
|
|
||||||
cpputs.o \
|
cpputs.o \
|
||||||
|
cputc.o \
|
||||||
cursor.o \
|
cursor.o \
|
||||||
|
cvline.o \
|
||||||
gotoxy.o \
|
gotoxy.o \
|
||||||
kbhit.o \
|
kbhit.o \
|
||||||
revers.o \
|
revers.o \
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Maciej 'YTM/Elysium' Witkowiak
|
; Maciej 'YTM/Elysium' Witkowiak
|
||||||
;
|
;
|
||||||
@@ -7,44 +6,46 @@
|
|||||||
; 6.3.2001, 17.4.2003
|
; 6.3.2001, 17.4.2003
|
||||||
|
|
||||||
|
|
||||||
.include "geossym.inc"
|
.export xsize, ysize
|
||||||
|
.export screensize
|
||||||
|
.importz cursor_r, cursor_c
|
||||||
|
.import _cursor
|
||||||
|
.constructor initscrsize
|
||||||
|
|
||||||
|
.include "geossym.inc"
|
||||||
|
|
||||||
.export xsize, ysize
|
.segment "INIT"
|
||||||
.export screensize
|
|
||||||
.importzp cursor_r, cursor_c
|
|
||||||
.import _cursor
|
|
||||||
.constructor initscrsize
|
|
||||||
|
|
||||||
.segment "INIT"
|
|
||||||
|
|
||||||
initscrsize:
|
initscrsize:
|
||||||
.ifdef __GEOS_CBM__
|
.ifdef __GEOS_CBM__
|
||||||
lda graphMode
|
lda graphMode
|
||||||
bpl L1
|
bpl L1
|
||||||
lda #80 ; 80 columns (more or less)
|
lda #80 ; 80 columns (more or less)
|
||||||
.byte $2c
|
.byte $2c
|
||||||
L1: lda #40 ; 40 columns (more or less)
|
L1: lda #40 ; 40 columns (more or less)
|
||||||
sta xsize
|
sta xsize
|
||||||
lda #24 ; something like that for Y size
|
lda #24 ; something like that for Y size
|
||||||
.else
|
.else
|
||||||
lda #70 ; 70 columns (more or less)
|
lda #70 ; 70 columns (more or less)
|
||||||
sta xsize
|
sta xsize
|
||||||
lda #23 ; something like that for Y size
|
lda #23 ; something like that for Y size
|
||||||
.endif
|
.endif
|
||||||
sta ysize
|
sta ysize
|
||||||
ldx #1
|
ldx #1
|
||||||
stx cursor_r
|
stx cursor_r
|
||||||
dex
|
dex
|
||||||
stx cursor_c
|
stx cursor_c
|
||||||
txa
|
txa
|
||||||
jmp _cursor ; home and update cursor
|
jmp _cursor ; home and update cursor
|
||||||
|
|
||||||
screensize:
|
screensize:
|
||||||
ldx xsize
|
ldx xsize
|
||||||
ldy ysize
|
ldy ysize
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
|
|
||||||
xsize: .res 1
|
xsize:
|
||||||
ysize: .res 1
|
.res 1
|
||||||
|
ysize:
|
||||||
|
.res 1
|
||||||
|
|||||||
@@ -6,46 +6,46 @@
|
|||||||
; void cclearxy (unsigned char x, unsigned char y, unsigned char length);
|
; void cclearxy (unsigned char x, unsigned char y, unsigned char length);
|
||||||
; void cclear (unsigned char length);
|
; void cclear (unsigned char length);
|
||||||
|
|
||||||
|
.export _cclearxy, _cclear
|
||||||
|
.import popa, _gotoxy, fixcursor
|
||||||
|
.importzp cursor_x, cursor_y, cursor_c
|
||||||
|
|
||||||
.include "jumptab.inc"
|
.include "jumptab.inc"
|
||||||
.include "geossym.inc"
|
.include "geossym.inc"
|
||||||
|
|
||||||
.export _cclearxy, _cclear
|
|
||||||
.import popa, _gotoxy, fixcursor
|
|
||||||
.importzp cursor_x, cursor_y, cursor_c
|
|
||||||
|
|
||||||
_cclearxy:
|
_cclearxy:
|
||||||
pha ; Save the length
|
pha ; Save the length
|
||||||
jsr popa ; Get y
|
jsr popa ; Get y
|
||||||
jsr _gotoxy ; Call this one, will pop params
|
jsr _gotoxy ; Call this one, will pop params
|
||||||
pla ; Restore the length
|
pla ; Restore the length
|
||||||
|
|
||||||
_cclear:
|
_cclear:
|
||||||
cmp #0 ; Is the length zero?
|
cmp #0 ; Is the length zero?
|
||||||
beq L9 ; Jump if done
|
beq L9 ; Jump if done
|
||||||
tax
|
tax
|
||||||
lda cursor_x ; left start
|
lda cursor_x ; left start
|
||||||
sta r3L
|
sta r3L
|
||||||
lda cursor_x+1
|
lda cursor_x+1
|
||||||
sta r3L+1
|
sta r3L+1
|
||||||
lda cursor_y ; level
|
lda cursor_y ; level
|
||||||
sta r2L
|
sta r2L
|
||||||
clc
|
clc
|
||||||
adc #8
|
adc #8
|
||||||
sta r2H
|
sta r2H
|
||||||
txa ; right end
|
txa ; right end
|
||||||
clc
|
clc
|
||||||
adc cursor_c
|
adc cursor_c
|
||||||
sta cursor_c
|
sta cursor_c
|
||||||
sta r4L
|
sta r4L
|
||||||
ldx #r4
|
ldx #r4
|
||||||
ldy #3
|
ldy #3
|
||||||
jsr DShiftLeft
|
jsr DShiftLeft
|
||||||
lda curPattern ; store current pattern
|
lda curPattern ; store current pattern
|
||||||
pha
|
pha
|
||||||
lda #0 ; set pattern to clear
|
lda #0 ; set pattern to clear
|
||||||
jsr SetPattern
|
jsr SetPattern
|
||||||
jsr Rectangle
|
jsr Rectangle
|
||||||
pla
|
pla
|
||||||
jsr SetPattern ; restore pattern
|
jsr SetPattern ; restore pattern
|
||||||
jsr fixcursor
|
jsr fixcursor
|
||||||
L9: rts
|
L9: rts
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Maciej 'YTM/Elysium' Witkowiak
|
; Maciej 'YTM/Elysium' Witkowiak
|
||||||
;
|
;
|
||||||
@@ -16,25 +15,25 @@
|
|||||||
|
|
||||||
_cgetc:
|
_cgetc:
|
||||||
; show cursor if needed
|
; show cursor if needed
|
||||||
lda cursor_flag
|
lda cursor_flag
|
||||||
beq L0
|
beq L0
|
||||||
|
|
||||||
jsr update_cursor
|
jsr update_cursor
|
||||||
lda cursor_x
|
lda cursor_x
|
||||||
ldx cursor_x+1
|
ldx cursor_x+1
|
||||||
sta stringX
|
sta stringX
|
||||||
stx stringX+1
|
stx stringX+1
|
||||||
lda cursor_y
|
lda cursor_y
|
||||||
sec
|
sec
|
||||||
sbc curHeight
|
sbc curHeight
|
||||||
sta stringY
|
sta stringY
|
||||||
jsr PromptOn
|
jsr PromptOn
|
||||||
|
|
||||||
L0: jsr GetNextChar
|
L0: jsr GetNextChar
|
||||||
tax
|
tax
|
||||||
beq L0
|
beq L0
|
||||||
pha
|
pha
|
||||||
jsr PromptOff
|
jsr PromptOff
|
||||||
pla
|
pla
|
||||||
ldx #0
|
ldx #0
|
||||||
rts
|
rts
|
||||||
|
|||||||
@@ -6,40 +6,40 @@
|
|||||||
; void chlinexy (unsigned char x, unsigned char y, unsigned char length);
|
; void chlinexy (unsigned char x, unsigned char y, unsigned char length);
|
||||||
; void chline (unsigned char length);
|
; void chline (unsigned char length);
|
||||||
|
|
||||||
|
.export _chlinexy, _chline
|
||||||
|
.import popa, _gotoxy, fixcursor
|
||||||
|
.importzp cursor_x, cursor_y, cursor_c
|
||||||
|
|
||||||
.include "jumptab.inc"
|
.include "jumptab.inc"
|
||||||
.include "geossym.inc"
|
.include "geossym.inc"
|
||||||
|
|
||||||
.export _chlinexy, _chline
|
|
||||||
.import popa, _gotoxy, fixcursor
|
|
||||||
.importzp cursor_x, cursor_y, cursor_c
|
|
||||||
|
|
||||||
_chlinexy:
|
_chlinexy:
|
||||||
pha ; Save the length
|
pha ; Save the length
|
||||||
jsr popa ; Get y
|
jsr popa ; Get y
|
||||||
jsr _gotoxy ; Call this one, will pop params
|
jsr _gotoxy ; Call this one, will pop params
|
||||||
pla ; Restore the length
|
pla ; Restore the length
|
||||||
|
|
||||||
_chline:
|
_chline:
|
||||||
cmp #0 ; Is the length zero?
|
cmp #0 ; Is the length zero?
|
||||||
beq L9 ; Jump if done
|
beq L9 ; Jump if done
|
||||||
tax
|
tax
|
||||||
lda cursor_x ; left start
|
lda cursor_x ; left start
|
||||||
sta r3L
|
sta r3L
|
||||||
lda cursor_x+1
|
lda cursor_x+1
|
||||||
sta r3L+1
|
sta r3L+1
|
||||||
lda cursor_y ; level
|
lda cursor_y ; level
|
||||||
sec
|
sec
|
||||||
sbc #4 ; in the middle of a cell
|
sbc #4 ; in the middle of a cell
|
||||||
sta r11L
|
sta r11L
|
||||||
txa ; right end
|
txa ; right end
|
||||||
clc
|
clc
|
||||||
adc cursor_c
|
adc cursor_c
|
||||||
sta cursor_c
|
sta cursor_c
|
||||||
sta r4L
|
sta r4L
|
||||||
ldx #r4
|
ldx #r4
|
||||||
ldy #3
|
ldy #3
|
||||||
jsr DShiftLeft
|
jsr DShiftLeft
|
||||||
lda #%11111111 ; pattern
|
lda #%11111111 ; pattern
|
||||||
jsr HorizontalLine
|
jsr HorizontalLine
|
||||||
jsr fixcursor
|
jsr fixcursor
|
||||||
L9: rts
|
L9: rts
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Maciej 'YTM/Elysium' Witkowiak
|
; Maciej 'YTM/Elysium' Witkowiak
|
||||||
;
|
;
|
||||||
@@ -7,48 +6,47 @@
|
|||||||
; void clrscr (void);
|
; void clrscr (void);
|
||||||
|
|
||||||
.export _clrscr
|
.export _clrscr
|
||||||
|
.import fixcursor
|
||||||
|
.importzp cursor_c, cursor_r
|
||||||
|
|
||||||
.include "jumptab.inc"
|
.include "jumptab.inc"
|
||||||
.include "geossym.inc"
|
.include "geossym.inc"
|
||||||
.include "const.inc"
|
.include "const.inc"
|
||||||
|
|
||||||
.import fixcursor
|
|
||||||
.importzp cursor_c, cursor_r
|
|
||||||
|
|
||||||
_clrscr:
|
_clrscr:
|
||||||
lda #ST_WR_FORE | ST_WR_BACK
|
lda #ST_WR_FORE | ST_WR_BACK
|
||||||
sta dispBufferOn
|
sta dispBufferOn
|
||||||
lda curPattern ; save current pattern
|
lda curPattern ; save current pattern
|
||||||
pha
|
pha
|
||||||
lda #0 ; set pattern to clear
|
lda #0 ; set pattern to clear
|
||||||
jsr SetPattern
|
jsr SetPattern
|
||||||
ldx #0
|
ldx #0
|
||||||
stx r3L
|
stx r3L
|
||||||
stx r3H
|
stx r3H
|
||||||
stx r2L
|
stx r2L
|
||||||
stx cursor_c
|
stx cursor_c
|
||||||
inx
|
inx
|
||||||
stx cursor_r
|
stx cursor_r
|
||||||
jsr fixcursor ; home cursor
|
jsr fixcursor ; home cursor
|
||||||
.ifdef __GEOS_CBM__
|
.ifdef __GEOS_CBM__
|
||||||
lda #199
|
lda #199
|
||||||
sta r2H
|
sta r2H
|
||||||
lda graphMode
|
lda graphMode
|
||||||
bpl L40
|
bpl L40
|
||||||
lda #>639 ; 80 columns
|
lda #>639 ; 80 columns
|
||||||
ldx #<639
|
ldx #<639
|
||||||
bne L99
|
bne L99
|
||||||
L40: lda #>319 ; 40 columns
|
L40: lda #>319 ; 40 columns
|
||||||
ldx #<319
|
ldx #<319
|
||||||
L99:
|
L99:
|
||||||
.else
|
.else
|
||||||
lda #191
|
lda #191
|
||||||
sta r2H
|
sta r2H
|
||||||
lda #>559
|
lda #>559
|
||||||
ldx #<559
|
ldx #<559
|
||||||
.endif
|
.endif
|
||||||
sta r4H
|
sta r4H
|
||||||
stx r4L
|
stx r4L
|
||||||
jsr Rectangle
|
jsr Rectangle
|
||||||
pla
|
pla
|
||||||
jmp SetPattern ; restore pattern
|
jmp SetPattern ; restore pattern
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Maciej 'YTM/Elysium' Witkowiak
|
; Maciej 'YTM/Elysium' Witkowiak
|
||||||
;
|
;
|
||||||
@@ -10,11 +9,11 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
.export _textcolor, _bgcolor, _bordercolor
|
.export _textcolor, _bgcolor, _bordercolor
|
||||||
|
|
||||||
; for GEOS 2.0 there is no color support, perhaps Wheels has it
|
; for GEOS 2.0 there is no color support, perhaps Wheels has it
|
||||||
|
|
||||||
_textcolor:
|
_textcolor:
|
||||||
_bgcolor:
|
_bgcolor:
|
||||||
_bordercolor:
|
_bordercolor:
|
||||||
rts
|
rts
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Maciej 'YTM/Elysium' Witkowiak
|
; Maciej 'YTM/Elysium' Witkowiak
|
||||||
;
|
;
|
||||||
@@ -12,7 +11,6 @@
|
|||||||
; does not update cursor position
|
; does not update cursor position
|
||||||
|
|
||||||
.export _cpputsxy, _cpputs
|
.export _cpputsxy, _cpputs
|
||||||
|
|
||||||
.import _gotoxy
|
.import _gotoxy
|
||||||
.import popa
|
.import popa
|
||||||
.importzp cursor_x, cursor_y
|
.importzp cursor_x, cursor_y
|
||||||
@@ -22,24 +20,24 @@
|
|||||||
.include "jumptab.inc"
|
.include "jumptab.inc"
|
||||||
|
|
||||||
_cpputsxy:
|
_cpputsxy:
|
||||||
sta r0L ; Save s for later
|
sta r0L ; Save s for later
|
||||||
stx r0H
|
stx r0H
|
||||||
jsr popa ; Get Y
|
jsr popa ; Get Y
|
||||||
jsr _gotoxy ; Set cursor, pop x
|
jsr _gotoxy ; Set cursor, pop x
|
||||||
jmp L0 ; Same as cputs...
|
jmp L0 ; Same as cputs...
|
||||||
|
|
||||||
_cpputs:
|
_cpputs:
|
||||||
sta r0L ; Save s
|
sta r0L ; Save s
|
||||||
stx r0H
|
stx r0H
|
||||||
L0: ldy #0
|
L0: ldy #0
|
||||||
lda (r0),y
|
lda (r0),y
|
||||||
bne L1 ; Jump if there's something
|
bne L1 ; Jump if there's something
|
||||||
rts
|
rts
|
||||||
|
|
||||||
L1: lda cursor_x
|
L1: lda cursor_x
|
||||||
sta r11L
|
sta r11L
|
||||||
lda cursor_x+1
|
lda cursor_x+1
|
||||||
sta r11H
|
sta r11H
|
||||||
lda cursor_y
|
lda cursor_y
|
||||||
sta r1H
|
sta r1H
|
||||||
jmp PutString
|
jmp PutString
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Maciej 'YTM/Elysium' Witkowiak
|
; Maciej 'YTM/Elysium' Witkowiak
|
||||||
;
|
;
|
||||||
@@ -24,7 +23,6 @@
|
|||||||
; UPLINE = ?, KEY_UPARROW = GOTOY, ...
|
; UPLINE = ?, KEY_UPARROW = GOTOY, ...
|
||||||
|
|
||||||
.export _cputcxy, _cputc, update_cursor
|
.export _cputcxy, _cputc, update_cursor
|
||||||
|
|
||||||
.import _gotoxy, fixcursor
|
.import _gotoxy, fixcursor
|
||||||
.import popa
|
.import popa
|
||||||
.import xsize,ysize
|
.import xsize,ysize
|
||||||
@@ -35,9 +33,9 @@
|
|||||||
.include "jumptab.inc"
|
.include "jumptab.inc"
|
||||||
|
|
||||||
_cputcxy:
|
_cputcxy:
|
||||||
pha ; Save C
|
pha ; Save C
|
||||||
jsr popa ; Get Y
|
jsr popa ; Get Y
|
||||||
jsr _gotoxy ; Set cursor, drop x
|
jsr _gotoxy ; Set cursor, drop x
|
||||||
pla ; Restore C
|
pla ; Restore C
|
||||||
|
|
||||||
; Plot a character - also used as internal function
|
; Plot a character - also used as internal function
|
||||||
@@ -45,58 +43,58 @@ _cputcxy:
|
|||||||
_cputc:
|
_cputc:
|
||||||
tax ; save character
|
tax ; save character
|
||||||
; some characters 0-31 are not safe for PutChar
|
; some characters 0-31 are not safe for PutChar
|
||||||
cmp #$20
|
cmp #$20
|
||||||
bcs L1
|
bcs L1
|
||||||
cmp #CR
|
cmp #CR
|
||||||
beq do_cr
|
beq do_cr
|
||||||
cmp #LF
|
cmp #LF
|
||||||
beq do_lf
|
beq do_lf
|
||||||
cmp #KEY_DELETE
|
cmp #KEY_DELETE
|
||||||
bne L0
|
bne L0
|
||||||
ldx #BACKSPACE
|
ldx #BACKSPACE
|
||||||
sec
|
sec
|
||||||
bcs L2
|
bcs L2
|
||||||
L0: rts
|
L0: rts
|
||||||
|
|
||||||
L1: clc
|
L1: clc
|
||||||
L2: php
|
L2: php
|
||||||
lda cursor_x
|
lda cursor_x
|
||||||
sta r11L
|
sta r11L
|
||||||
lda cursor_x+1
|
lda cursor_x+1
|
||||||
sta r11H
|
sta r11H
|
||||||
lda cursor_y
|
lda cursor_y
|
||||||
sta r1H
|
sta r1H
|
||||||
txa
|
txa
|
||||||
jsr PutChar
|
jsr PutChar
|
||||||
plp
|
plp
|
||||||
bcs update_cursor
|
bcs update_cursor
|
||||||
|
|
||||||
inc cursor_c
|
inc cursor_c
|
||||||
lda cursor_c
|
lda cursor_c
|
||||||
cmp xsize ; hit right margin?
|
cmp xsize ; hit right margin?
|
||||||
bne update_cursor
|
bne update_cursor
|
||||||
lda #0 ; yes - do cr+lf
|
lda #0 ; yes - do cr+lf
|
||||||
sta cursor_c
|
sta cursor_c
|
||||||
do_lf: inc cursor_r
|
do_lf: inc cursor_r
|
||||||
lda cursor_r
|
lda cursor_r
|
||||||
cmp ysize ; hit bottom margin?
|
cmp ysize ; hit bottom margin?
|
||||||
bne update_cursor
|
bne update_cursor
|
||||||
dec cursor_r ; yes - stay in the last line
|
dec cursor_r ; yes - stay in the last line
|
||||||
|
|
||||||
update_cursor:
|
update_cursor:
|
||||||
jsr fixcursor
|
jsr fixcursor
|
||||||
lda cursor_x
|
lda cursor_x
|
||||||
sta r4L
|
sta r4L
|
||||||
lda cursor_x+1
|
lda cursor_x+1
|
||||||
sta r4H
|
sta r4H
|
||||||
lda cursor_y
|
lda cursor_y
|
||||||
sec
|
sec
|
||||||
sbc curHeight
|
sbc curHeight
|
||||||
sta r5L
|
sta r5L
|
||||||
lda #1 ; update cursor prompt position
|
lda #1 ; update cursor prompt position
|
||||||
sta r3L
|
sta r3L
|
||||||
jmp PosSprite
|
jmp PosSprite
|
||||||
|
|
||||||
do_cr: lda #0
|
do_cr: lda #0
|
||||||
sta cursor_c
|
sta cursor_c
|
||||||
beq update_cursor
|
beq update_cursor
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Maciej 'YTM/Elysium' Witkowiak
|
; Maciej 'YTM/Elysium' Witkowiak
|
||||||
;
|
;
|
||||||
@@ -9,20 +8,21 @@
|
|||||||
.export _cursor
|
.export _cursor
|
||||||
.import update_cursor
|
.import update_cursor
|
||||||
.importzp cursor_flag
|
.importzp cursor_flag
|
||||||
|
|
||||||
.include "jumptab.inc"
|
.include "jumptab.inc"
|
||||||
.include "geossym.inc"
|
.include "geossym.inc"
|
||||||
|
|
||||||
_cursor:
|
_cursor:
|
||||||
|
|
||||||
tay ; onoff into Y
|
tay ; onoff into Y
|
||||||
ldx #0 ; High byte of result
|
ldx #0 ; High byte of result
|
||||||
lda cursor_flag ; Get old value
|
lda cursor_flag ; Get old value
|
||||||
pha
|
pha
|
||||||
sty cursor_flag ; Set new value
|
sty cursor_flag ; Set new value
|
||||||
tya
|
tya
|
||||||
beq L1
|
beq L1
|
||||||
lda curHeight ; prepare cursor
|
lda curHeight ; prepare cursor
|
||||||
jsr InitTextPrompt
|
jsr InitTextPrompt
|
||||||
jsr update_cursor ; place it on screen
|
jsr update_cursor ; place it on screen
|
||||||
L1: pla
|
L1: pla
|
||||||
rts
|
rts
|
||||||
|
|||||||
@@ -6,41 +6,41 @@
|
|||||||
; void cvlinexy (unsigned char x, unsigned char y, unsigned char length);
|
; void cvlinexy (unsigned char x, unsigned char y, unsigned char length);
|
||||||
; void cvline (unsigned char length);
|
; void cvline (unsigned char length);
|
||||||
|
|
||||||
|
.export _cvlinexy, _cvline
|
||||||
|
.import popa, _gotoxy, fixcursor
|
||||||
|
.importzp cursor_x, cursor_y, cursor_r
|
||||||
|
|
||||||
.include "jumptab.inc"
|
.include "jumptab.inc"
|
||||||
.include "geossym.inc"
|
.include "geossym.inc"
|
||||||
|
|
||||||
.export _cvlinexy, _cvline
|
|
||||||
.import popa, _gotoxy, fixcursor
|
|
||||||
.importzp cursor_x, cursor_y, cursor_r
|
|
||||||
|
|
||||||
_cvlinexy:
|
_cvlinexy:
|
||||||
pha ; Save the length
|
pha ; Save the length
|
||||||
jsr popa ; Get y
|
jsr popa ; Get y
|
||||||
jsr _gotoxy ; Call this one, will pop params
|
jsr _gotoxy ; Call this one, will pop params
|
||||||
pla ; Restore the length
|
pla ; Restore the length
|
||||||
|
|
||||||
_cvline:
|
_cvline:
|
||||||
cmp #0 ; Is the length zero?
|
cmp #0 ; Is the length zero?
|
||||||
beq L9 ; Jump if done
|
beq L9 ; Jump if done
|
||||||
tax
|
tax
|
||||||
lda cursor_x ; x position
|
lda cursor_x ; x position
|
||||||
clc
|
clc
|
||||||
adc #4 ; in the middle of cell
|
adc #4 ; in the middle of cell
|
||||||
sta r4L
|
sta r4L
|
||||||
lda cursor_x+1
|
lda cursor_x+1
|
||||||
adc #0
|
adc #0
|
||||||
sta r4L+1
|
sta r4L+1
|
||||||
lda cursor_y ; top start
|
lda cursor_y ; top start
|
||||||
sta r3L
|
sta r3L
|
||||||
txa ; bottom end
|
txa ; bottom end
|
||||||
clc
|
clc
|
||||||
adc cursor_r
|
adc cursor_r
|
||||||
sta cursor_r
|
sta cursor_r
|
||||||
sta r3H
|
sta r3H
|
||||||
asl r3H
|
asl r3H
|
||||||
asl r3H
|
asl r3H
|
||||||
asl r3H
|
asl r3H
|
||||||
lda #%11111111 ; pattern
|
lda #%11111111 ; pattern
|
||||||
jsr VerticalLine
|
jsr VerticalLine
|
||||||
jsr fixcursor
|
jsr fixcursor
|
||||||
L9: rts
|
L9: rts
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Maciej 'YTM/Elysium' Witkowiak
|
; Maciej 'YTM/Elysium' Witkowiak
|
||||||
;
|
;
|
||||||
@@ -15,30 +14,33 @@
|
|||||||
|
|
||||||
.include "jumptab.inc"
|
.include "jumptab.inc"
|
||||||
|
|
||||||
_gotox: sta cursor_c
|
_gotox:
|
||||||
jmp fixcursor
|
sta cursor_c
|
||||||
|
jmp fixcursor
|
||||||
|
|
||||||
_gotoy: sta cursor_r
|
_gotoy:
|
||||||
inc cursor_r
|
sta cursor_r
|
||||||
jmp fixcursor
|
inc cursor_r
|
||||||
|
jmp fixcursor
|
||||||
|
|
||||||
_gotoxy: sta cursor_r
|
_gotoxy:
|
||||||
inc cursor_r
|
sta cursor_r
|
||||||
jsr popa
|
inc cursor_r
|
||||||
sta cursor_c
|
jsr popa
|
||||||
|
sta cursor_c
|
||||||
|
|
||||||
; convert 8x8 x/y coordinates to GEOS hires
|
; convert 8x8 x/y coordinates to GEOS hires
|
||||||
fixcursor:
|
fixcursor:
|
||||||
lda cursor_c
|
lda cursor_c
|
||||||
sta cursor_x
|
sta cursor_x
|
||||||
lda #0
|
lda #0
|
||||||
sta cursor_x+1
|
sta cursor_x+1
|
||||||
lda cursor_r
|
lda cursor_r
|
||||||
sta cursor_y
|
sta cursor_y
|
||||||
ldx #cursor_x
|
ldx #cursor_x
|
||||||
ldy #3
|
ldy #3
|
||||||
jsr DShiftLeft
|
jsr DShiftLeft
|
||||||
asl cursor_y
|
asl cursor_y
|
||||||
asl cursor_y
|
asl cursor_y
|
||||||
asl cursor_y
|
asl cursor_y
|
||||||
rts
|
rts
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Maciej 'YTM/Elysium' Witkowiak
|
; Maciej 'YTM/Elysium' Witkowiak
|
||||||
;
|
;
|
||||||
@@ -10,13 +9,10 @@
|
|||||||
|
|
||||||
.include "geossym.inc"
|
.include "geossym.inc"
|
||||||
|
|
||||||
.proc _kbhit
|
_kbhit:
|
||||||
|
ldx #0 ; High byte of result
|
||||||
ldx #0 ; High byte of result
|
lda pressFlag
|
||||||
lda pressFlag
|
rol ; Bit 7 is new key flag
|
||||||
rol ; Bit 7 is new key flag
|
txa ; A = 0
|
||||||
txa ; A = 0
|
rol
|
||||||
rol
|
rts
|
||||||
rts
|
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Maciej 'YTM/Elysium' Witkowiak
|
; Maciej 'YTM/Elysium' Witkowiak
|
||||||
;
|
;
|
||||||
@@ -13,24 +12,24 @@
|
|||||||
.include "const.inc"
|
.include "const.inc"
|
||||||
|
|
||||||
_revers:
|
_revers:
|
||||||
tax
|
tax
|
||||||
bne L0 ; turn on
|
bne L0 ; turn on
|
||||||
lda #0
|
lda #0
|
||||||
.byte $2c
|
.byte $2c
|
||||||
L0: lda #SET_REVERSE
|
L0: lda #SET_REVERSE
|
||||||
sta tmp1
|
sta tmp1
|
||||||
|
|
||||||
lda currentMode
|
lda currentMode
|
||||||
tax
|
tax
|
||||||
and #SET_REVERSE
|
and #SET_REVERSE
|
||||||
tay ; store old value
|
tay ; store old value
|
||||||
txa
|
txa
|
||||||
and #%11011111 ; mask out
|
and #%11011111 ; mask out
|
||||||
ora tmp1 ; set new value
|
ora tmp1 ; set new value
|
||||||
sta currentMode
|
sta currentMode
|
||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
tya
|
tya
|
||||||
beq L1
|
beq L1
|
||||||
lda #1
|
lda #1
|
||||||
L1: rts
|
L1: rts
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Maciej 'YTM/Elysium' Witkowiak
|
; Maciej 'YTM/Elysium' Witkowiak
|
||||||
;
|
;
|
||||||
@@ -12,10 +11,12 @@
|
|||||||
.export _wherex, _wherey
|
.export _wherex, _wherey
|
||||||
.importzp cursor_c, cursor_r
|
.importzp cursor_c, cursor_r
|
||||||
|
|
||||||
_wherex: lda cursor_c
|
_wherex:
|
||||||
ldx #0
|
lda cursor_c
|
||||||
rts
|
ldx #0
|
||||||
|
rts
|
||||||
|
|
||||||
_wherey: lda cursor_r
|
_wherey:
|
||||||
ldx #0
|
lda cursor_r
|
||||||
rts
|
ldx #0
|
||||||
|
rts
|
||||||
|
|||||||
Reference in New Issue
Block a user