]> git.sur5r.net Git - cc65/commitdiff
Consistently place constructors (and their exclusive subroutines) in "INIT".
authorOliver Schmidt <ol.sc@web.de>
Fri, 9 Oct 2015 19:44:20 +0000 (21:44 +0200)
committerOliver Schmidt <ol.sc@web.de>
Fri, 9 Oct 2015 19:44:20 +0000 (21:44 +0200)
libsrc/atari5200/conioscreen.s
libsrc/c128/systime.s
libsrc/c64/systime.s
libsrc/osic1p/cgetc.s
libsrc/pce/clock.s
libsrc/pce/conio.s
libsrc/pce/psg.s
libsrc/pce/vce.s

index 412dd582d6ddc8c8eafe890107535fbb10a46451..660276675df3694fccec23604e09eb21543419dd 100644 (file)
@@ -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
index 0a7f8f367715f96079582f333ef637685cc276d1..e12d016b810fdcab189c975da586feb88c71f8e5 100644 (file)
@@ -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
-
index a00df13977fa828864d68137fffb18240792e672..f8cd1b71463b4e2ad5c783a7accf357a068c5fd1 100644 (file)
@@ -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
-
index 0c7c69488f3b82b6af42f5ef93c3ac96aec62b83..5ddca2870d2d0dabdd40a95929f4a7065ea1daaf 100644 (file)
         .include        "zeropage.inc"\r
 \r
 ; Initialize one-character buffer that is filled by kbhit()\r
+        .segment        "INIT"\r
 initcgetc:\r
         lda     #$00\r
         sta     CHARBUF         ; No character in buffer initially\r
         rts\r
 \r
 ; Input routine from 65V PROM MONITOR, show cursor if enabled\r
+        .code\r
 _cgetc:\r
         lda     CHARBUF         ; character in buffer available?\r
         beq     nobuffer\r
index 8fda58adc9dc62dca17584f61d2f5ee7b43b4e9f..261739df875f5e8cdc207e3d01baba91bb976a22 100644 (file)
@@ -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
index 1428ef59f17616bb4f9c341195a9a82c8b663316..64df870189894a7120aa9a021f45a98a16ee8268 100644 (file)
@@ -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:
index 17d26b9418ec36f0ce3fd86363b25931509e0ff0..b1d610fa1b925f63f94921ca7548537807307232 100644 (file)
@@ -1,8 +1,8 @@
-
         .include        "pce.inc"
 
         .export         psg_init
 
+        .segment        "INIT"
 psg_init:
         clx
         stz     PSG_GLOBAL_PAN          ; Clear global balance
index 3c19fd55bcc957a13139a762b245b0b05e112c6b..af69c5ed1def88a8de37362bbc7043c20c3298a0 100644 (file)
@@ -1,8 +1,8 @@
-
         .include        "pce.inc"
 
         .export         vce_init
 
+        .segment        "INIT"
 vce_init:
         ; Set CTA to zero
         stz     VCE_ADDR_LO