.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
- .include "../inc/cursor.inc"
.export _cclearxy, _cclear
.import popa, _gotoxy, fixcursor
+ .importzp cursor_x, cursor_y, cursor_c
_cclearxy:
pha ; Save the length
.export _cgetc
.import update_cursor
+ .importzp cursor_x, cursor_y, cursor_flag
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
- .include "../inc/cursor.inc"
_cgetc:
; show cursor if needed
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
- .include "../inc/cursor.inc"
.export _chlinexy, _chline
.import popa, _gotoxy, fixcursor
+ .importzp cursor_x, cursor_y, cursor_c
_chlinexy:
pha ; Save the length
.import _gotoxy
.import popa
+ .importzp cursor_x, cursor_y
.include "../inc/const.inc"
.include "../inc/geossym.inc"
.include "../inc/jumptab.inc"
- .include "../inc/cursor.inc"
_cpputsxy:
sta r0L ; Save s for later
.import _gotoxy, fixcursor
.import popa
.import xsize,ysize
+ .importzp cursor_x, cursor_y, cursor_c, cursor_r
.include "../inc/const.inc"
.include "../inc/geossym.inc"
.include "../inc/jumptab.inc"
- .include "../inc/cursor.inc"
_cputcxy:
pha ; Save C
;
; Maciej 'YTM/Elysium' Witkowiak
;
-; 27.10.2001
+; 27.10.2001, 23.12.2002
; unsigned char cursor (unsigned char onoff);
+ .exportzp cursor_x, cursor_y, cursor_flag
+ .exportzp cursor_c, cursor_r
.export _cursor
.import update_cursor
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
- .include "../inc/cursor.inc"
_cursor:
jsr update_cursor ; place it on screen
L1: pla
rts
+
+.zeropage
+
+cursor_x: .res 2 ; Cursor column (word)
+cursor_y: .res 1 ; Cursor row
+cursor_flag: .res 1 ; Cursor on/off (0-off)
+
+cursor_c: .res 1 ; Cursor column (0-39/79)
+cursor_r: .res 1 ; Cursor row (0-24)
.include "../inc/jumptab.inc"
.include "../inc/geossym.inc"
- .include "../inc/cursor.inc"
.export _cvlinexy, _cvline
.import popa, _gotoxy, fixcursor
+ .importzp cursor_x, cursor_y, cursor_r
_cvlinexy:
pha ; Save the length
.export _gotox, _gotoy, _gotoxy, fixcursor
.import popa
+ .importzp cursor_x, cursor_y, cursor_c, cursor_r
.include "../inc/jumptab.inc"
- .include "../inc/cursor.inc"
_gotox: sta cursor_c
jmp fixcursor
; unsigned char wherey (void);
.export _wherex, _wherey
- .importzp tmp1, tmp2
+ .importzp cursor_c, cursor_r
.include "../inc/jumptab.inc"
- .include "../inc/cursor.inc"
_wherex: lda cursor_c
rts
; (.cvt header must be the *first* one)
; Maciej 'YTM/Elysium' Witkowiak
-; 26.10.99, 10.3.2000, 15.8.2001
+; 26.10.99, 10.3.2000, 15.8.2001, 23.12.2002
-; no __hinit
-
- .export _exit
+ .import __RAM_START__, __RAM_SIZE__ ; Linker generated
.import initlib, donelib
.import pushax
.import _main
+ .import _MainLoop, _EnterDeskTop
.import zerobss
-
-; ------------------------------------------------------------------------
-; Define and export the ZP variables for the C64 runtime
-
- .exportzp sp, sreg, regsave, regbank
- .exportzp ptr1, ptr2, ptr3, ptr4
- .exportzp tmp1, tmp2, tmp3, tmp4
-
-sp = $72 ; stack pointer
-sreg = $74 ; secondary register/high 16 bit for longs
-regsave = $76 ; slot to save/restore (E)AX into
-ptr1 = $7A ;
-ptr2 = $7C
-ptr3 = $7E
-ptr4 = $70
-tmp1 = $fb
-tmp2 = $fc
-tmp3 = $fd
-tmp4 = $fe
-
-regbank = $a3 ; 6 bytes hopefully not used by Kernal
-
-; ------------------------------------------------------------------------
-
-; .org $0400-508 ; $0400 - length of .cvt header
-; .include "cvthead.s"
-
- .reloc
+ .importzp sp
+ .export _exit
; ------------------------------------------------------------------------
; Create an empty LOWCODE segment to avoid linker warnings
; Setup stack
- lda #<$6000
+ lda #<(__RAM_START__ + __RAM_SIZE__)
sta sp
- lda #>$6000
+ lda #>(__RAM_START__ + __RAM_SIZE__)
sta sp+1 ; Set argument stack ptr
; Call module constructors
cli
ldy #4 ; Argument size
jsr _main ; call the users code
- jmp $c1c3 ; jump to GEOS MainLoop
+ jmp _MainLoop ; jump to GEOS MainLoop
; Call module destructors. This is also the _exit entry which must be called
; explicitly by the code.
_exit: jsr donelib ; Run module destructors
- jmp $c22c ; EnterDeskTop
-
+ jmp _EnterDeskTop ; return control to the system
+++ /dev/null
-
-; NOTE THAT EASIER AND SAFER WAY OF GETTING HEADER IS TO GENERATE IT !!!
-
-; Maciej 'YTM/Alliance' Witkowiak
-; 28.02.2000
-
-; This is .cvt header for GEOS files, it is recognized by Convert v2.5 for GEOS
-; and Star Commander (when copying GEOS files to/from .d64 images)
-; This is only an example, and you should customize file header values (such as
-; Author, Class, Date, filename) either here for all GEOS apps or manually later
-; in GEOS environment using specialized apps or disk editor
-
-; currently only SEQUENTIAL structure is supported, no overlays
-
-; defineable values are marked with ';**' in comment line, please be careful with
-; string lengths
-
-
-; .org $0400-508 ; $0400 - length of .cvt header
-
- .segment "HEADER"
-
- .include "../inc/const.inc"
-
-ProgType = APPLICATION ;** may be one of:
- ; APPLICATION
- ; ASSEMBLY
- ; DESK_ACC (unusable, unless you will fix end address in header before run)
- ; PRINTER (unusable, unless you change $0400 to $7900 here and in crt0.s)
- ; INPUT_DEVICE (like above but change $0400 to $fe80, you have $017a bytes)
- ; AUTO_EXEC (you need to fit in $0400-$4fff area)
- ; INPUT_128 (like INPUT_DEVICE but change $0400 to $fd80, you have $017a bytes)
-
- .byte USR | $80 ; DOS filetype
- .word 0 ; T&S, will be fixed by converter
-
- .byte "filename" ;** DOS filename (16 chars with $a0 padding)
- .byte $a0,$a0,$a0,$a0,$a0,$a0,$a0,$a0
-
- .word 0 ; header T&S
-
- .byte SEQUENTIAL ; GEOS structure
- .byte ProgType ; GEOS filetype
- .byte 00 ;** year 2000=00 or 100?
- .byte 02 ;** month
- .byte 28 ;** day
- .byte 18 ;** hour
- .byte 58 ;** minute
-
- .word 0 ; size in blocks, will be fixed by converter
-
- .byte "PRG formatted GEOS file V1.0"
- ; converter stamp
- .res $c4 ; some bytes are left
-
- .byte 3, 21, 63 | $80 ; icon picture header, 63 bytes follow
-
- ;** hey, uberhacker! edit icon here!!! ;-))
- .byte %11111111, %11111111, %11111111
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %10000000, %00000000, %00000001
- .byte %11111111, %11111111, %11111111
-
- .byte USR | $80 ;again DOS type
- .byte ProgType ;again GEOS type
- .byte SEQUENTIAL ;structure
- .word $0400 ;ProgStart
- .word $0400-1 ;ProgEnd (needs proper value for DESK_ACC)
- .word $0400 ;ProgExec
-
- .byte "Filename" ;**GEOS class (12 chars)
- .byte $20,$20,$20,$20 ; padding with spaces to 12
-
- .byte "V1.0",0 ;**version
- .word 0
-
- .byte %01000000 ;**40/80 columns capability
-; B7 B6
-; 0 0 - runs under GEOS128 but only in 40 column mode
-; 0 1 - runs under GEOS128 in both 40/80 column modes
-; 1 0 - does not run under GEOS128
-; 1 1 - runs under GEOS128 but only in 80 column mode
-
-
- .byte "Author" ;**author's name (63 chars)
- .byte 0 ; +terminator
- .res (63-7) ; padding to 63
-
- .byte "Compiled with cc65" ;**note (95 chars)
- .byte 0 ; +terminator
- .res (95-18) ; padding to 95
-
- ; end of header, code follows
+++ /dev/null
-
-;
-; Maciej 'YTM/Elysium' Witkowiak
-;
-; 27.10.2001
-; 06.03.2002
-
-cursor_x = $D3 ; Cursor column (word)
-cursor_y = $D5 ; Cursor row
-cursor_flag = $D6 ; Cursor on/off (0-off)
-
-cursor_c = $D7 ; Cursor column (0-39/79)
-cursor_r = $D8 ; Cursor row (0-24)
MEMORY {
+ ZP: start = $58, size = $28, type = rw, define = yes;
HEADER: start = $204, size = 508, file = %O;
- RAM: start = $400, size = $5C00, file = %O;
+ RAM: start = $400, size = $5C00, define = yes, file = %O;
}
SEGMENTS {
HEADER: load = HEADER, type = ro;
RODATA: load = RAM, type = ro;
DATA: load = RAM, type = rw;
BSS: load = RAM, type = bss, define = yes;
+ ZEROPAGE: load = ZP, type = zp;
}
FEATURES {
CONDES: segment = RODATA,
count = __DESTRUCTOR_COUNT__;
}
SYMBOLS {
- __STACKSIZE__ = $800; # 2K stack
+ __STACKSIZE__ = $400; # 1K stack
}