mirror of
https://github.com/cc65/cc65.git
synced 2025-01-08 20:31:31 +00:00
Consistently place constructors (and their exclusive subroutines) in "INIT".
This commit is contained in:
parent
575f859a03
commit
326da85145
@ -7,9 +7,10 @@
|
||||
SCREEN_BUF_SIZE = 20 * 24
|
||||
SCREEN_BUF = $4000 - SCREEN_BUF_SIZE
|
||||
|
||||
.code
|
||||
.export screen_setup_20x24
|
||||
|
||||
.segment "INIT"
|
||||
|
||||
screen_setup_20x24:
|
||||
|
||||
; initialize SAVMSC
|
||||
@ -79,5 +80,4 @@ dlist: .repeat 3
|
||||
|
||||
.assert ((* >> 10) = (dlist >> 10)), error, "Display list crosses 1K boundary"
|
||||
|
||||
|
||||
.end
|
||||
|
@ -63,6 +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"
|
||||
|
||||
.proc initsystime
|
||||
|
||||
@ -78,7 +79,6 @@ BCD2dec:tax
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; TM struct with date set to 1970-01-01
|
||||
.data
|
||||
@ -92,4 +92,3 @@ TM: .word 0 ; tm_sec
|
||||
.word 0 ; tm_wday
|
||||
.word 0 ; tm_yday
|
||||
.word 0 ; tm_isdst
|
||||
|
||||
|
@ -63,6 +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"
|
||||
|
||||
.proc initsystime
|
||||
|
||||
@ -81,7 +82,6 @@ BCD2dec:tax
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; TM struct with date set to 1970-01-01
|
||||
.data
|
||||
@ -95,4 +95,3 @@ TM: .word 0 ; tm_sec
|
||||
.word 0 ; tm_wday
|
||||
.word 0 ; tm_yday
|
||||
.word 0 ; tm_isdst
|
||||
|
||||
|
@ -11,12 +11,14 @@
|
||||
.include "zeropage.inc"
|
||||
|
||||
; Initialize one-character buffer that is filled by kbhit()
|
||||
.segment "INIT"
|
||||
initcgetc:
|
||||
lda #$00
|
||||
sta CHARBUF ; No character in buffer initially
|
||||
rts
|
||||
|
||||
; Input routine from 65V PROM MONITOR, show cursor if enabled
|
||||
.code
|
||||
_cgetc:
|
||||
lda CHARBUF ; character in buffer available?
|
||||
beq nobuffer
|
||||
|
@ -5,9 +5,11 @@
|
||||
.include "pce.inc"
|
||||
.include "extzp.inc"
|
||||
|
||||
.forceimport ticktock
|
||||
.export _clock
|
||||
.forceimport ticktock
|
||||
.importzp sreg
|
||||
.constructor initclock
|
||||
|
||||
|
||||
.proc _clock
|
||||
|
||||
@ -21,8 +23,7 @@
|
||||
|
||||
.endproc
|
||||
|
||||
.constructor initclock
|
||||
|
||||
.segment "INIT"
|
||||
initclock:
|
||||
lda #0
|
||||
ldx #3
|
||||
|
@ -1,14 +1,16 @@
|
||||
.include "pce.inc"
|
||||
.include "extzp.inc"
|
||||
|
||||
.import vce_init
|
||||
.import psg_init
|
||||
.import vdc_init
|
||||
.import vce_init
|
||||
.import psg_init
|
||||
.import colors
|
||||
.importzp ptr1, tmp1
|
||||
|
||||
.constructor initconio
|
||||
|
||||
.macpack longbranch
|
||||
|
||||
.segment "INIT"
|
||||
initconio:
|
||||
jsr vce_init
|
||||
jsr psg_init
|
||||
@ -20,7 +22,6 @@ initconio:
|
||||
st2 #>$0088
|
||||
rts
|
||||
|
||||
.import colors
|
||||
set_palette:
|
||||
stz VCE_ADDR_LO
|
||||
stz VCE_ADDR_HI
|
||||
@ -48,11 +49,6 @@ set_palette:
|
||||
|
||||
rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
;
|
||||
;----------------------------------------------------------------------------
|
||||
|
||||
.importzp ptr1, tmp1
|
||||
conio_init:
|
||||
; Load font
|
||||
st0 #VDC_MAWR
|
||||
@ -80,13 +76,11 @@ conio_init:
|
||||
sta tmp1
|
||||
jsr copy
|
||||
|
||||
|
||||
ldx #0
|
||||
stx BGCOLOR
|
||||
inx
|
||||
stx CHARCOLOR
|
||||
|
||||
|
||||
rts
|
||||
|
||||
copy:
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
.include "pce.inc"
|
||||
|
||||
.export psg_init
|
||||
|
||||
.segment "INIT"
|
||||
psg_init:
|
||||
clx
|
||||
stz PSG_GLOBAL_PAN ; Clear global balance
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
.include "pce.inc"
|
||||
|
||||
.export vce_init
|
||||
|
||||
.segment "INIT"
|
||||
vce_init:
|
||||
; Set CTA to zero
|
||||
stz VCE_ADDR_LO
|
||||
|
Loading…
Reference in New Issue
Block a user