]> git.sur5r.net Git - cc65/commitdiff
simple conio test works again
authormrdudz <mrdudz@users.noreply.github.com>
Sun, 12 Jul 2015 08:32:55 +0000 (10:32 +0200)
committermrdudz <mrdudz@users.noreply.github.com>
Sun, 12 Jul 2015 08:32:55 +0000 (10:32 +0200)
cfg/pce.cfg
libsrc/pce/_scrsize.s
libsrc/pce/crt0.s
libsrc/pce/vce.s
libsrc/pce/vdc.s
libsrc/pce/vga.inc

index b08e63814a2292f36304adc7aa2f756bca44fde9..f848fd737042ea50861c3d7cf5f70e56aad0e631 100644 (file)
@@ -1,5 +1,5 @@
 SYMBOLS {
-    __STACKSIZE__: type = weak, value = $0300; # 3 pages stack
+        __STACKSIZE__: type = weak, value = $0300; # 3 pages stack
 }
 MEMORY {
 
@@ -18,7 +18,7 @@ MEMORY {
     # Hardware Vectors at End of 2nd 8K ROM
        ROMV: start = $fff6, size = $a, file = %O,fill = yes;
 
-       ROM: start = $6000, size = $8000, file = %O, fill = yes,define=yes;
+#      ROM: start = $6000, size = $8000, file = %O, fill = yes,define=yes;
 
 
        # standard 2k SRAM (-zeropage)
@@ -43,8 +43,8 @@ SEGMENTS {
     STARTUP: load = ROM0, type = ro, define = yes;
 
     INIT:     load = ROM0,            type = ro,  define = yes, optional = yes;
-       CODE: load = ROM, type = ro, define = yes;
-    RODATA: load = ROM, type = ro, define = yes;
+       CODE: load = ROM0, type = ro, define = yes;
+    RODATA: load = ROM0, type = ro, define = yes;
 
        DATA: load = ROM0, run= RAM, type = rw, define = yes;
 #      BSS: load = RAM2, type = bss, define = yes;
@@ -58,12 +58,13 @@ SEGMENTS {
 
 }
 FEATURES {
-    CONDES: segment = STARTUP,
-           type=constructor,
-           label=__CONSTRUCTOR_TABLE__,
-           count=__CONSTRUCTOR_COUNT__;
-    CONDES: segment = STARTUP,
-           type=destructor,
-           label=__DESTRUCTOR_TABLE__,
-           count=__DESTRUCTOR_COUNT__;
+        CONDES: segment = STARTUP,
+        type=constructor,
+        label=__CONSTRUCTOR_TABLE__,
+        count=__CONSTRUCTOR_COUNT__;
+
+        CONDES: segment = STARTUP,
+        type=destructor,
+        label=__DESTRUCTOR_TABLE__,
+        count=__DESTRUCTOR_COUNT__;
 }
index 17b23b70932b686d28326a874dcd4a071587c10f..6e2b84a4149ee2df1fb58ec0b897a65d36357ef6 100644 (file)
@@ -2,16 +2,14 @@
 ; Screen size variables
 ;
 
-
-
-.export _screensize
+                .export _screensize
 _screensize:
-        ldx     xsize
-        ldy     ysize
-        rts
+                ldx     xsize
+                ldy     ysize
+                rts
 
 .rodata
-       .export         xsize, ysize
+                .export xsize, ysize
 
-xsize:         .byte 64
-ysize: .byte 28
+xsize:          .byte 64
+ysize:          .byte 28
index 43ca5d60220568bcb3ebe6d8037f1a41374ac01f..c6c0dabb87ff0795a4bc54315d67c2ed4ecc3712 100644 (file)
@@ -43,56 +43,60 @@ start:
 
 ; setup the CPU and System-IRQ
 
-                        ; Initialize CPU
-
-                        sei
-                        nop
-                        csh
-                        nop
-                        cld
-                        nop
-
-                        ; Setup stack and memory mapping
-                        ldx     #$FF    ; Stack top ($21FF)
-                        txs
-                        txa
-                        tam     #0      ; 0000-1FFF = Hardware page
-
-                        lda     #$F8
-                        tam     #1      ; 2000-3FFF = Work RAM
-
-                        lda     #$F7
-                        tam     #2      ; 4000-5FFF = Save RAM
-
-                                               lda     #1
-                        tam     #3      ; 6000-7FFF  Page 2
-                                               lda     #2
-                        tam     #4      ; 8000-9FFF  Page 3
-                                               lda     #3
-                        tam     #5      ; A000-BFFF  Page 4
-                                               lda     #4
-                        tam     #6      ; C000-DFFF  Page 5
-
-                        ; Initialize hardware
-                        stz     TIMER_COUNT   ; Timer off
-                        lda     #$07
-                        sta     IRQ_MASK     ; Interrupts off
-                        stz     IRQ_STATUS   ; Acknowledge timer
-
-                        ; Clear work RAM
-                        stz     <$00
-                        tii     $2000, $2001, $1FFF
-
-                                               ;; i dont know why the heck this one doesnt
-                                               ;; work when called from a constructor :/
-                                               .import vdc_init
-                                               jsr     vdc_init
+                ; Initialize CPU
+
+                sei
+                nop
+                csh     ; set high speed CPU mode
+                nop
+                cld
+                nop
+
+                ; Setup stack and memory mapping
+                ldx     #$FF    ; Stack top ($21FF)
+                txs
+
+                ; at startup all MPRs are set to 0, so init them
+                lda     #$ff
+                tam     #1         ; 0000-1FFF = Hardware page
+                lda     #$F8
+                tam     #2         ; 2000-3FFF = Work RAM
+                ;lda     #$F7
+                ;tam     #2      ; 4000-5FFF = Save RAM
+                ;lda     #1
+                ;tam     #3      ; 6000-7FFF  Page 2
+                ;lda     #2
+                ;tam     #4      ; 8000-9FFF  Page 3
+                ;lda     #3
+                ;tam     #5      ; A000-BFFF  Page 4
+                ;lda     #4
+                ;tam     #6      ; C000-DFFF  Page 5
+                ;lda     #0
+                ;tam     #7      ; e000-fFFF  hucard/syscard bank 0
+
+                ; Clear work RAM (2000-3FFF)
+                stz     <$00
+                tii     $2000, $2001, $1FFF
+
+                ; Initialize hardware
+                stz     TIMER_COUNT   ; Timer off
+                lda     #$07
+                sta     IRQ_MASK     ; Interrupts off
+                stz     IRQ_STATUS   ; Acknowledge timer
+
+                ;; i dont know why the heck this one doesnt
+                ;; work when called from a constructor :/
+                        .import vdc_init
+                        jsr     vdc_init
+
 ;;                        jsr     joy_init
 
-                        ; Turn on background and VD interrupt/IRQ1
-                        lda     #$05
-                        sta     IRQ_MASK           ; IRQ1=on
-                        cli
+                ; Turn on background and VD interrupt/IRQ1
+
+                lda     #$05
+                sta     IRQ_MASK           ; IRQ1=on
+
+                cli
 
 ; Clear the BSS data
 
@@ -162,8 +166,10 @@ start:
 ; Call module constructors
 
                jsr     initlib
-;              .import initconio
-;              jsr initconio
+
+               .import initconio
+               jsr initconio
+
 ; Pass an empty command line
 
 
@@ -189,34 +195,34 @@ _exit:
 ; ------------------------------------------------------------------------
 
 _irq1:
-                        pha
-                        phx
-                        phy
+                pha
+                phx
+                phy
 
 
-               inc _tickcount
-               bne @s
-               inc _tickcount+1
+                inc _tickcount
+                bne @s
+                inc _tickcount+1
 @s:
 
-                        ; Acknowlege interrupt
-                                               ldaio VDC_CTRL
+                ; Acknowlege interrupt
+                ldaio VDC_CTRL
 
-                                               ply
-                        plx
-                        pla
-                        rti
+                ply
+                plx
+                pla
+                rti
 _irq2:
-                        rti
+                rti
 _nmi:
-                        rti
+                rti
 _timer:
-                        stz     IRQ_STATUS
-                        rti
+                stz     IRQ_STATUS
+                rti
 
-       .export initmainargs
+                .export initmainargs
 initmainargs:
-       rts
+                rts
 
 ; ------------------------------------------------------------------------
 ; hardware vectors
index a5c91997092325cb7996d1cea2ecd29b3d606143..1f96c062c175f089c1b20fb4d38abd8e19cf742b 100644 (file)
@@ -1,6 +1,7 @@
 
-                                               .include "pcengine.inc"
-            .export vce_init
+                        .include "pcengine.inc"
+
+                        .export vce_init
 
 vce_init:
                         stz     VCE_ADDR_LO   ;
index a203cb058b02f4e52157d09db44b980cec896717..47efdff55091b5dd8c5fe26d55a9acb21ffb2191 100644 (file)
@@ -1,15 +1,12 @@
 
-                               .include "pcengine.inc"
+                        .include "pcengine.inc"
 
 HIRES = 1
 
-            .export vdc_init
+                        .export vdc_init
 
 vdc_init:
-                        ;;lda     $0000
-                                               ;;.byte $ad,0,0
-
-                                               ldaio   VDC_CTRL
+                        ldaio   VDC_CTRL
 
                         VREG    $00, $0000 ; MAWR
                         VREG    $01, $0000 ; MARR
@@ -39,8 +36,5 @@ vdc_init:
 
                         .endif
 
-                        ;;lda     $0000
-                                               ;;.byte $ad,0,0
-
-                                               ldaio VDC_CTRL
+                        ldaio VDC_CTRL
                         rts
index 6cbdd010cfc9394542dbd91e5a91ac8aeb87a816..2f9408f9a350e4cd294aeb284ff2e0cad2144487 100644 (file)
@@ -1,4 +1,6 @@
 
+; VGA charset for the PC-Engine conio implementation
+
         .byte     $00, $00, $00, $00, $00, $00, $00, $00 
         .byte     $7E, $81, $A5, $81, $BD, $99, $81, $7E 
         .byte     $7E, $FF, $DB, $FF, $C3, $E7, $FF, $7E