support for .zeropage segment in GEOS

git-svn-id: svn://svn.cc65.org/cc65/trunk@1834 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
izydorst
2002-12-23 22:14:14 +00:00
parent 31e4d80ac8
commit dc207514dd
13 changed files with 33 additions and 173 deletions

View File

@@ -3,43 +3,16 @@
; (.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
@@ -57,9 +30,9 @@ regbank = $a3 ; 6 bytes hopefully not used by Kernal
; 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
@@ -76,12 +49,11 @@ regbank = $a3 ; 6 bytes hopefully not used by Kernal
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

View File

@@ -1,110 +0,0 @@
; 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