Renamed INITBSS to INIT and INIT to ONCE.
The way we want to use the INITBSS segment - and especially the fact that it won't have the type bss on all ROM based targets - means that the name INITBSS is misleading. After all INIT is the best name from my perspective as it serves several purposes and therefore needs a rather generic name. Unfortunately this means that the current INIT segment needs to be renamed too. Looking for a short (ideally 4 letter) name I came up with ONCE as it contains all code (and data) accessed only once during initialization.
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
.include "apple2.inc"
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.ifdef __APPLE2ENH__
|
||||
initconio:
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
.import initlib, donelib
|
||||
.import callmain
|
||||
.import __LC_START__, __LC_LAST__ ; Linker generated
|
||||
.import __INIT_RUN__, __INIT_SIZE__ ; Linker generated
|
||||
.import __INITBSS_RUN__ ; Linker generated
|
||||
.import __ONCE_RUN__, __ONCE_SIZE__ ; Linker generated
|
||||
.import __INIT_RUN__ ; Linker generated
|
||||
|
||||
.include "zeropage.inc"
|
||||
.include "apple2.inc"
|
||||
@@ -29,14 +29,14 @@
|
||||
bit $C081
|
||||
|
||||
; Set the source start address.
|
||||
lda #<(__INITBSS_RUN__ + __INIT_SIZE__)
|
||||
ldy #>(__INITBSS_RUN__ + __INIT_SIZE__)
|
||||
lda #<(__INIT_RUN__ + __ONCE_SIZE__)
|
||||
ldy #>(__INIT_RUN__ + __ONCE_SIZE__)
|
||||
sta $9B
|
||||
sty $9C
|
||||
|
||||
; Set the source last address.
|
||||
lda #<(__INITBSS_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__)
|
||||
ldy #>(__INITBSS_RUN__ + __INIT_SIZE__ + __LC_LAST__ - __LC_START__)
|
||||
lda #<(__INIT_RUN__ + __ONCE_SIZE__ + __LC_LAST__ - __LC_START__)
|
||||
ldy #>(__INIT_RUN__ + __ONCE_SIZE__ + __LC_LAST__ - __LC_START__)
|
||||
sta $96
|
||||
sty $97
|
||||
|
||||
@@ -51,25 +51,25 @@
|
||||
jsr $D39A ; BLTU2
|
||||
|
||||
; Set the source start address.
|
||||
lda #<__INITBSS_RUN__
|
||||
ldy #>__INITBSS_RUN__
|
||||
lda #<__INIT_RUN__
|
||||
ldy #>__INIT_RUN__
|
||||
sta $9B
|
||||
sty $9C
|
||||
|
||||
; Set the source last address.
|
||||
lda #<(__INITBSS_RUN__ + __INIT_SIZE__)
|
||||
ldy #>(__INITBSS_RUN__ + __INIT_SIZE__)
|
||||
lda #<(__INIT_RUN__ + __ONCE_SIZE__)
|
||||
ldy #>(__INIT_RUN__ + __ONCE_SIZE__)
|
||||
sta $96
|
||||
sty $97
|
||||
|
||||
; Set the destination last address.
|
||||
lda #<(__INIT_RUN__ + __INIT_SIZE__)
|
||||
ldy #>(__INIT_RUN__ + __INIT_SIZE__)
|
||||
lda #<(__ONCE_RUN__ + __ONCE_SIZE__)
|
||||
ldy #>(__ONCE_RUN__ + __ONCE_SIZE__)
|
||||
sta $94
|
||||
sty $95
|
||||
|
||||
; Call into Applesoft Block Transfer Up -- which handles moving
|
||||
; overlapping blocks upwards well -- to move the INIT segment.
|
||||
; overlapping blocks upwards well -- to move the ONCE segment.
|
||||
jsr $D39A ; BLTU2
|
||||
|
||||
; Delegate all further processing, to keep the STARTUP segment small.
|
||||
@@ -109,7 +109,7 @@ exit: ldx #$02
|
||||
; We're done
|
||||
jmp done
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
; Save the zero-page locations that we need.
|
||||
init: ldx #zpspace-1
|
||||
@@ -201,7 +201,7 @@ q_param:.byte $04 ; param_count
|
||||
; Final jump when we're done
|
||||
done: jmp DOSWARM ; Potentially patched at runtime
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
zpsave: .res zpspace
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
; - Apple II ProDOS 8 TechNote #23, ProDOS 8 Changes and Minutia
|
||||
; - ProDOS TechRefMan, chapter 5.2.4
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initdostype:
|
||||
lda $BF00
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
.include "errno.inc"
|
||||
.include "../filedes.inc"
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initiobuf:
|
||||
; Convert end address highbyte to table index
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
; Identify machine according to:
|
||||
; Apple II Miscellaneous TechNote #7, Apple II Family Identification
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initostype:
|
||||
sec
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
.include "apple2.inc"
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initirq:
|
||||
; Check for ProDOS
|
||||
|
||||
@@ -46,10 +46,10 @@ FNAM_LEN = $280
|
||||
FNAM = $281
|
||||
REM = $B2 ; BASIC token-code
|
||||
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; Get possible command-line arguments. Goes into the special ONCE segment,
|
||||
; which may be reused after the startup code is run.
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmainargs:
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
.include "mli.inc"
|
||||
.include "filedes.inc"
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
raisefilelevel:
|
||||
; Raise file level
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
.include "filedes.inc"
|
||||
.include "apple2.inc"
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initprompt:
|
||||
; Set prompt <> ']' to let DOS 3.3 know that we're
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
_rebootafterexit := return
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initreboot:
|
||||
; Quit to PWRUP
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
.import start
|
||||
.export _cas_init
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
_cas_init:
|
||||
.ifdef DEBUG
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
; ------------------------------------------------------------------------
|
||||
; DOS type detection
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
detect: lda DOS
|
||||
cmp #'S' ; SpartaDOS
|
||||
|
||||
@@ -20,7 +20,7 @@ SPACE = 32 ; SPACE char.
|
||||
; --------------------------------------------------------------------------
|
||||
; Get command line
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmainargs:
|
||||
lda #0
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initirq:
|
||||
lda VVBLKD
|
||||
|
||||
@@ -180,7 +180,7 @@ update_colors:
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
pm_init:
|
||||
lda #0
|
||||
|
||||
@@ -26,7 +26,7 @@ SHRAM_HANDLERS = 1
|
||||
BUFSZ = 128 ; bounce buffer size
|
||||
BUFSZ_SIO = 256
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
; Turn off ROMs, install system and interrupt wrappers, set new chargen pointer
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ SCREEN_BUF = $4000 - SCREEN_BUF_SIZE
|
||||
|
||||
.export screen_setup_20x24
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
screen_setup_20x24:
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initirq:
|
||||
lda VVBLKD
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
;--------------------------------------------------------------------------
|
||||
; Put this constructor into a segment that can be re-used by programs.
|
||||
;
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
; Turn the capitals lock off.
|
||||
|
||||
|
||||
@@ -55,10 +55,10 @@
|
||||
.endproc
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Switch the cursor off. Code goes into the INIT segment
|
||||
; Switch the cursor off. Code goes into the ONCE segment
|
||||
; which may be reused after it is run.
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initcgetc:
|
||||
lsr STATUS
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initirq:
|
||||
lda IRQVec
|
||||
|
||||
@@ -17,10 +17,10 @@ REM = $9d ; BASIC token-code
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; Get possible command-line arguments. Goes into the special ONCE segment,
|
||||
; which may be reused after the startup code is run
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.proc initmainargs
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ L9: lda ptr3
|
||||
;--------------------------------------------------------------------------
|
||||
; initstdin: Reset the stdin console.
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initstdin:
|
||||
ldx #<-1
|
||||
|
||||
@@ -42,7 +42,7 @@ L2: jsr KBDREAD ; Read char and return in A
|
||||
.bss
|
||||
keyvec: .res 2
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
initcgetc:
|
||||
|
||||
; Save the old vector
|
||||
|
||||
@@ -108,7 +108,7 @@ L2: lda zpsave,x
|
||||
; ------------------------------------------------------------------------
|
||||
; Data
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
zpsave: .res zpspace
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initirq:
|
||||
lda IRQVec
|
||||
|
||||
@@ -32,10 +32,10 @@ MAXARGS = 10 ; Maximum number of arguments allowed
|
||||
REM = $8f ; BASIC token-code
|
||||
NAME_LEN = 16 ; Maximum length of command-name
|
||||
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; Get possible command-line arguments. Goes into the special ONCE segment,
|
||||
; which may be reused after the startup code is run
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmainargs:
|
||||
|
||||
@@ -127,7 +127,7 @@ done: lda #<argv
|
||||
stx __argv + 1
|
||||
rts
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
term: .res 1
|
||||
name: .res NAME_LEN + 1
|
||||
|
||||
@@ -29,7 +29,7 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||
; --------------------------------------------------------------------------
|
||||
; Initialize the mouse sprite.
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmcb:
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ BCD2dec:tax
|
||||
; Constructor that writes to the 1/10 sec register of the TOD to kick it
|
||||
; into action. If this is not done, the clock hangs. We will read the register
|
||||
; and write it again, ignoring a possible change in between.
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.proc initsystime
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ L2: jsr KBDREAD ; Read char and return in A
|
||||
.constructor initkbd
|
||||
.destructor donekbd
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.proc initkbd
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ L2: lda zpsave,x
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
zpsave: .res zpspace
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initirq:
|
||||
lda IRQVec
|
||||
|
||||
@@ -32,10 +32,10 @@ MAXARGS = 10 ; Maximum number of arguments allowed
|
||||
REM = $8f ; BASIC token-code
|
||||
NAME_LEN = 16 ; Maximum length of command-name
|
||||
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; Get possible command-line arguments. Goes into the special ONCE segment,
|
||||
; which may be reused after the startup code is run
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmainargs:
|
||||
|
||||
@@ -126,7 +126,7 @@ done: lda #<argv
|
||||
stx __argv + 1
|
||||
rts
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
term: .res 1
|
||||
name: .res NAME_LEN + 1
|
||||
|
||||
@@ -34,7 +34,7 @@ Start:
|
||||
tsx
|
||||
stx spsave ; Save the system stack ptr
|
||||
|
||||
; Save space by putting some of the start-up code in the INIT segment,
|
||||
; Save space by putting some of the start-up code in the ONCE segment,
|
||||
; which can be re-used by the BSS segment, the heap and the C stack.
|
||||
|
||||
jsr init
|
||||
@@ -79,7 +79,7 @@ L2: lda zpsave,x
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
init:
|
||||
|
||||
@@ -111,7 +111,7 @@ L1: lda sp,x
|
||||
; ------------------------------------------------------------------------
|
||||
; Data
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
mmusave:.res 1
|
||||
spsave: .res 1
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initirq:
|
||||
lda IRQVec
|
||||
|
||||
@@ -32,10 +32,10 @@ MAXARGS = 10 ; Maximum number of arguments allowed
|
||||
REM = $8f ; BASIC token-code
|
||||
NAME_LEN = 16 ; Maximum length of command-name
|
||||
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; Get possible command-line arguments. Goes into the special ONCE segment,
|
||||
; which may be reused after the startup code is run
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmainargs:
|
||||
|
||||
@@ -125,7 +125,7 @@ done: lda #<argv
|
||||
stx __argv + 1
|
||||
rts
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
term: .res 1
|
||||
name: .res NAME_LEN + 1
|
||||
|
||||
@@ -30,7 +30,7 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||
; --------------------------------------------------------------------------
|
||||
; Initialize the mouse sprite.
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmcb:
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
.export soft80_charset
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
soft80_charset:
|
||||
.byte $0f,$03,$0f,$00,$0f,$07,$05,$0e
|
||||
.byte $0f,$05,$0e,$0b,$0f,$0b,$0f,$0f
|
||||
|
||||
@@ -56,7 +56,7 @@ soft80_shutdown:
|
||||
sta CIA2_PRA
|
||||
jmp $FF5B ; Initialize video I/O
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
firstinit:
|
||||
; copy charset to RAM under I/O
|
||||
sei
|
||||
@@ -146,7 +146,7 @@ soft80_bitmapyhi_data:
|
||||
soft80_tables_data_end:
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
soft80_internal_cellcolor:
|
||||
.res 1
|
||||
soft80_internal_bgcolor:
|
||||
|
||||
@@ -60,7 +60,7 @@ soft80mono_shutdown:
|
||||
sta VIC_VIDEO_ADR
|
||||
rts
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
firstinit:
|
||||
; copy charset to RAM under I/O
|
||||
sei
|
||||
@@ -150,7 +150,7 @@ soft80_bitmapyhi_data:
|
||||
soft80_tables_data_end:
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
soft80mono_internal_cellcolor:
|
||||
.res 1
|
||||
soft80mono_internal_bgcolor:
|
||||
|
||||
@@ -63,7 +63,7 @@ BCD2dec:tax
|
||||
; Constructor that writes to the 1/10 sec register of the TOD to kick it
|
||||
; into action. If this is not done, the clock hangs. We will read the register
|
||||
; and write it again, ignoring a possible change in between.
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.proc initsystime
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
.importzp devnum
|
||||
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
curunit:
|
||||
.res 1
|
||||
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.proc initcurunit
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
.export _mouse_def_pointercolor
|
||||
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
_mouse_def_pointercolor:
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
.export _mouse_def_pointershape
|
||||
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
_mouse_def_pointershape:
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
;--------------------------------------------------------------------------
|
||||
; initstdin: Open the stdin file descriptors for the keyboard
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.proc initstdin
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
;--------------------------------------------------------------------------
|
||||
; initstdout: Open the stdout and stderr file descriptors for the screen.
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.proc initstdout
|
||||
|
||||
|
||||
@@ -35,10 +35,10 @@ MAXARGS = 10 ; Maximum number of arguments allowed
|
||||
REM = $8f ; BASIC token-code
|
||||
NAME_LEN = 16 ; Maximum length of command-name
|
||||
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; Get possible command-line arguments. Goes into the special ONCE segment,
|
||||
; which may be reused after the startup code is run.
|
||||
;
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmainargs:
|
||||
|
||||
@@ -144,7 +144,7 @@ done: lda #<argv
|
||||
stx __argv + 1
|
||||
rts
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
term: .res 1
|
||||
name: .res NAME_LEN + 1
|
||||
|
||||
@@ -31,7 +31,7 @@ VIC_SPR_Y = (VIC_SPR0_Y + 2*MOUSE_SPR) ; Sprite Y register
|
||||
; --------------------------------------------------------------------------
|
||||
; Initialize the mouse sprite.
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmcb:
|
||||
|
||||
|
||||
@@ -35,10 +35,10 @@ MAXARGS = 10 ; Maximum number of arguments allowed
|
||||
REM = $8f ; BASIC token-code
|
||||
NAME_LEN = 16 ; Maximum length of command-name
|
||||
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; Get possible command-line arguments. Goes into the special ONCE segment,
|
||||
; which may be reused after the startup code is run.
|
||||
;
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmainargs:
|
||||
|
||||
@@ -142,7 +142,7 @@ done: lda #<argv
|
||||
stx __argv + 1
|
||||
rts
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
term: .res 1
|
||||
name: .res NAME_LEN + 1
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
cwd_init := initcwd
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
__cwd: .res __cwd_buf_size
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ __heaplast:
|
||||
|
||||
; Initialization. Will be called from startup!
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initheap:
|
||||
sec
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
.endproc
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
initclock:
|
||||
lda #0
|
||||
ldx #3
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
.macpack longbranch
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
initconio:
|
||||
lda #0
|
||||
sta LCD_XPOS
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
.include "extzp.inc"
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
; a constructor
|
||||
;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
;
|
||||
.export NMIStub
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
NMIStub:
|
||||
; A is saved by the BIOS
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
.include "geossym.inc"
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initscrsize:
|
||||
.ifdef __GEOS_CBM__
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
.include "const.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
; Setup arguments for main
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ update_clock:
|
||||
;-----------------------------------------------------------------------------
|
||||
; Enable the interrupt that update_clock needs.
|
||||
;
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
init_clock:
|
||||
lda #%10000000
|
||||
tsb VTIMCTLA
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
.include "lynx.inc"
|
||||
.import __STARTOFDIRECTORY__
|
||||
.import __RAM_START__
|
||||
.import __CODE_SIZE__,__DATA_SIZE__,__RODATA_SIZE__
|
||||
.import __STARTUP_SIZE__,__INIT_SIZE__,__LOWCODE_SIZE__
|
||||
.import __CODE_SIZE__, __DATA_SIZE__, __RODATA_SIZE__
|
||||
.import __STARTUP_SIZE__, __ONCE_SIZE__, __LOWCODE_SIZE__
|
||||
.import __BLOCKSIZE__
|
||||
.export __DEFDIR__: absolute = 1
|
||||
|
||||
@@ -17,15 +17,14 @@
|
||||
.segment "DIRECTORY"
|
||||
|
||||
__DIRECTORY_START__:
|
||||
off0=__STARTOFDIRECTORY__+(__DIRECTORY_END__-__DIRECTORY_START__)
|
||||
blocka=off0/__BLOCKSIZE__
|
||||
off0 = __STARTOFDIRECTORY__ + (__DIRECTORY_END__ - __DIRECTORY_START__)
|
||||
blocka = off0 / __BLOCKSIZE__
|
||||
; Entry 0 - first executable
|
||||
block0=off0/__BLOCKSIZE__
|
||||
len0=__STARTUP_SIZE__+__INIT_SIZE__+__CODE_SIZE__+__DATA_SIZE__+__RODATA_SIZE__+__LOWCODE_SIZE__
|
||||
block0 = off0 / __BLOCKSIZE__
|
||||
len0 = __STARTUP_SIZE__ + __ONCE_SIZE__ + __CODE_SIZE__ + __DATA_SIZE__ + __RODATA_SIZE__ + __LOWCODE_SIZE__
|
||||
.byte <block0
|
||||
.word off0 & (__BLOCKSIZE__ - 1)
|
||||
.byte $88
|
||||
.word __RAM_START__
|
||||
.word len0
|
||||
__DIRECTORY_END__:
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initirq:
|
||||
lda #<IRQStub
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; Get possible command-line arguments. Goes into the special ONCE segment,
|
||||
; which may be reused after the startup code is run
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.proc initmainargs
|
||||
|
||||
|
||||
@@ -75,10 +75,10 @@ putchar:
|
||||
jmp ppubuf_put
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
; Initialize the conio subsystem. Code goes into the INIT segment, which may
|
||||
; Initialize the conio subsystem. Code goes into the ONCE segment, which may
|
||||
; be reused after startup.
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initconio:
|
||||
jsr ppuinit
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initirq:
|
||||
rts
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; Get possible command-line arguments. Goes into the special ONCE segment,
|
||||
; which may be reused after the startup code is run
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.proc initmainargs
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
.include "zeropage.inc"
|
||||
|
||||
; Initialize one-character buffer that is filled by kbhit()
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
initcgetc:
|
||||
lda #$00
|
||||
sta CHARBUF ; No character in buffer initially
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
.endproc
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
initclock:
|
||||
lda #0
|
||||
ldx #3
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
.macpack longbranch
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
initconio:
|
||||
jsr vce_init
|
||||
jsr psg_init
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
.include "extzp.inc"
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
; a constructor
|
||||
;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
.export psg_init
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
psg_init:
|
||||
clx
|
||||
stz PSG_GLOBAL_PAN ; Clear global balance
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
.export vce_init
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
vce_init:
|
||||
; Set CTA to zero
|
||||
stz VCE_ADDR_LO
|
||||
|
||||
@@ -94,7 +94,7 @@ L2: lda zpsave,x
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
zpsave: .res zpspace
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initirq:
|
||||
lda IRQVec
|
||||
|
||||
@@ -16,10 +16,10 @@ NAME_LEN = 16 ; Maximum length of command-name
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; Get possible command-line arguments. Goes into the special ONCE segment,
|
||||
; which may be reused after the startup code is run
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.proc initmainargs
|
||||
|
||||
@@ -111,7 +111,7 @@ done: lda #<argv
|
||||
|
||||
.endproc
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
term: .res 1
|
||||
name: .res NAME_LEN + 1
|
||||
|
||||
@@ -59,7 +59,7 @@ L2: sta ENABLE_ROM ; Bank in the ROM
|
||||
.constructor initkbd
|
||||
.destructor donekbd
|
||||
|
||||
.segment "INIT" ; Special init code segment may get overwritten
|
||||
.segment "ONCE" ; Special init code segment may get overwritten
|
||||
|
||||
.proc initkbd
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ spsave: .res 1
|
||||
|
||||
irqcount: .byte 0
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
zpsave: .res zpspace
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ MAXARGS = 10 ; Maximum number of arguments allowed
|
||||
REM = $8f ; BASIC token-code
|
||||
NAME_LEN = 16 ; Maximum length of command-name
|
||||
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; Get possible command-line arguments. Goes into the special ONCE segment,
|
||||
; which may be reused after the startup code is run
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmainargs:
|
||||
|
||||
@@ -125,7 +125,7 @@ done: lda #<argv
|
||||
stx __argv + 1
|
||||
rts
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
term: .res 1
|
||||
name: .res NAME_LEN + 1
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
; --------------------------------------------------------------------------
|
||||
; Initialize library modules
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.proc initlib
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
; Initialization code. This is a constructor, so it is called on startup if
|
||||
; the linker has detected references to this module.
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
.proc initstkchk
|
||||
|
||||
@@ -101,7 +101,7 @@ Fail: lda #4
|
||||
; ----------------------------------------------------------------------------
|
||||
; Data
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
; Initial stack pointer value. Stack is reset to this in case of overflows to
|
||||
; allow program exit processing.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
.constructor initmainargs, 24
|
||||
.import __argc, __argv, args
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmainargs:
|
||||
lda #<__argv
|
||||
|
||||
@@ -86,7 +86,7 @@ L2: lda zpsave,x
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
zpsave: .res zpspace
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initirq:
|
||||
lda IRQVec
|
||||
|
||||
@@ -32,10 +32,10 @@ MAXARGS = 10 ; Maximum number of arguments allowed
|
||||
REM = $8f ; BASIC token-code
|
||||
NAME_LEN = 16 ; Maximum length of command-name
|
||||
|
||||
; Get possible command-line arguments. Goes into the special INIT segment,
|
||||
; Get possible command-line arguments. Goes into the special ONCE segment,
|
||||
; which may be reused after the startup code is run
|
||||
|
||||
.segment "INIT"
|
||||
.segment "ONCE"
|
||||
|
||||
initmainargs:
|
||||
|
||||
@@ -125,7 +125,7 @@ done: lda #<argv
|
||||
stx __argv + 1
|
||||
rts
|
||||
|
||||
.segment "INITBSS"
|
||||
.segment "INIT"
|
||||
|
||||
term: .res 1
|
||||
name: .res NAME_LEN + 1
|
||||
|
||||
Reference in New Issue
Block a user