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