]> git.sur5r.net Git - cc65/blobdiff - libsrc/nes/cputc.s
don't use constructor to setup runtime stack
[cc65] / libsrc / nes / cputc.s
index 0fcbe5d77c4d94cbf92d59dcf89d7b05283557bb..255b5f403da1abe5ef1f3a7049bca12a17c89137 100644 (file)
@@ -7,7 +7,7 @@
 ;
 
        .export         _cputcxy, _cputc, cputdirect, putchar
-       .export         newline               
+       .export         newline
         .constructor    conioinit
        .import         popa, _gotoxy
         .import         ppuinit, paletteinit, ppubuf_put
        .include        "nes.inc"
 
 ;-----------------------------------------------------------------------------
+                      
+.code
 
 _cputcxy:
-       pha                     ; Save C
-       jsr     popa            ; Get Y
+       pha                     ; Save C
+       jsr     popa            ; Get Y
        jsr     _gotoxy         ; Set cursor, drop x
-       pla                     ; Restore C
+       pla                     ; Restore C
 
 ; Plot a character - also used as internal function
 
@@ -67,13 +69,16 @@ plot:       ldy     CURS_X
 ; position in Y
 
 putchar:
-       ora     RVS             ; Set revers bit
+       ora     RVS             ; Set revers bit
         ldy     SCREEN_PTR+1
        ldx     SCREEN_PTR
                jmp     ppubuf_put
 
 ;-----------------------------------------------------------------------------
-; Initialize the conio subsystem
+; Initialize the conio subsystem. Code goes into the INIT segment, which may
+; be reused after startup.
+
+.segment        "INIT"
 
 conioinit:
         jsr     ppuinit