mirror of
https://github.com/cc65/cc65.git
synced 2025-02-23 18:29:05 +00:00
more cleanup and fixing
This commit is contained in:
parent
891cb97b2f
commit
9e1d39a409
@ -11,7 +11,7 @@ CRAM_PTR = $34 ;2
|
|||||||
CHARCOLOR = $36
|
CHARCOLOR = $36
|
||||||
RVS = $37
|
RVS = $37
|
||||||
BGCOLOR = $38
|
BGCOLOR = $38
|
||||||
_tickcount = $39 ;2
|
_tickcount = $39 ;4
|
||||||
|
|
||||||
screenrows = (224/8)
|
screenrows = (224/8)
|
||||||
charsperline = (512/8)
|
charsperline = (512/8)
|
||||||
@ -74,11 +74,13 @@ CDR_MEM_ENABLE = $1807
|
|||||||
.byte $ad
|
.byte $ad
|
||||||
.word arg1
|
.word arg1
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
;; sta abs
|
;; sta abs
|
||||||
.macro staio arg1
|
.macro staio arg1
|
||||||
.byte $8d
|
.byte $8d
|
||||||
.word arg1
|
.word arg1
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
;; stz abs
|
;; stz abs
|
||||||
.macro stzio arg1
|
.macro stzio arg1
|
||||||
.byte $9c
|
.byte $9c
|
||||||
|
23
cfg/pce.cfg
23
cfg/pce.cfg
@ -28,13 +28,18 @@ SEGMENTS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FEATURES {
|
FEATURES {
|
||||||
CONDES: segment = STARTUP,
|
CONDES: type = constructor,
|
||||||
type=constructor,
|
label = __CONSTRUCTOR_TABLE__,
|
||||||
label=__CONSTRUCTOR_TABLE__,
|
count = __CONSTRUCTOR_COUNT__,
|
||||||
count=__CONSTRUCTOR_COUNT__;
|
segment = INIT;
|
||||||
|
CONDES: type = destructor,
|
||||||
CONDES: segment = STARTUP,
|
label = __DESTRUCTOR_TABLE__,
|
||||||
type=destructor,
|
count = __DESTRUCTOR_COUNT__,
|
||||||
label=__DESTRUCTOR_TABLE__,
|
segment = RODATA;
|
||||||
count=__DESTRUCTOR_COUNT__;
|
# FIXME: interruptor support is missing
|
||||||
|
# CONDES: type = interruptor,
|
||||||
|
# label = __INTERRUPTOR_TABLE__,
|
||||||
|
# count = __INTERRUPTOR_COUNT__,
|
||||||
|
# segment = RODATA,
|
||||||
|
# import = __CALLIRQ__;
|
||||||
}
|
}
|
||||||
|
@ -28,13 +28,9 @@
|
|||||||
/* */
|
/* */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _PCE_H
|
#ifndef _PCE_H
|
||||||
#define _PCE_H
|
#define _PCE_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Check for errors */
|
/* Check for errors */
|
||||||
#if !defined(__PCE__)
|
#if !defined(__PCE__)
|
||||||
# error This module may only be used when compiling for the PCE!
|
# error This module may only be used when compiling for the PCE!
|
||||||
@ -69,8 +65,8 @@
|
|||||||
#define COLOR_LIGHTBLUE 0x0E
|
#define COLOR_LIGHTBLUE 0x0E
|
||||||
#define COLOR_GRAY3 0x0F
|
#define COLOR_GRAY3 0x0F
|
||||||
|
|
||||||
#define CLOCKS_PER_SEC 50 // ???
|
#define CLOCKS_PER_SEC 50 // FIXME: is this correct?
|
||||||
#define CLK_TCK 50 // ?!?
|
#define CLK_TCK 50 // FIXME: is this correct?
|
||||||
|
|
||||||
#define TV_NTSC 0
|
#define TV_NTSC 0
|
||||||
#define TV_PAL 1
|
#define TV_PAL 1
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
;
|
|
||||||
; CC65 runtime: call function via pointer in ax
|
|
||||||
;
|
|
||||||
|
|
||||||
.export callax
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
callax:
|
|
||||||
sta vec
|
|
||||||
stx vec+1
|
|
||||||
jmp (vec) ; jump there
|
|
||||||
|
|
||||||
.bss
|
|
||||||
|
|
||||||
vec:
|
|
||||||
.res 2
|
|
@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
.proc _clock
|
.proc _clock
|
||||||
|
|
||||||
ldy #0 ; Byte 3 is always zero
|
lda _tickcount+3
|
||||||
sty sreg+1
|
sta sreg+1
|
||||||
sty sreg
|
lda _tickcount+2
|
||||||
|
sta sreg
|
||||||
ldx _tickcount+1
|
ldx _tickcount+1
|
||||||
lda _tickcount
|
lda _tickcount
|
||||||
rts
|
rts
|
||||||
|
@ -1,96 +0,0 @@
|
|||||||
;
|
|
||||||
; Ullrich von Bassewitz, 20.11.2000
|
|
||||||
;
|
|
||||||
; CC65 runtime: Support for calling module constructors/destructors
|
|
||||||
;
|
|
||||||
; The condes routine must be called with the table address in a/x and the
|
|
||||||
; size of the table in y. The current implementation limits the table size
|
|
||||||
; to 254 bytes (127 vectors) but this shouldn't be problem for now and may
|
|
||||||
; be changed later.
|
|
||||||
;
|
|
||||||
; libinit and libdone call condes with the predefined module constructor and
|
|
||||||
; destructor tables, they must be called from the platform specific startup
|
|
||||||
; code.
|
|
||||||
|
|
||||||
|
|
||||||
.export initlib, donelib, condes
|
|
||||||
|
|
||||||
.import callax
|
|
||||||
.import __CONSTRUCTOR_TABLE__, __CONSTRUCTOR_COUNT__
|
|
||||||
.import __DESTRUCTOR_TABLE__, __DESTRUCTOR_COUNT__
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
|
||||||
; Initialize library modules
|
|
||||||
|
|
||||||
.proc initlib
|
|
||||||
|
|
||||||
lda #<__CONSTRUCTOR_TABLE__
|
|
||||||
ldx #>__CONSTRUCTOR_TABLE__
|
|
||||||
ldy #<(__CONSTRUCTOR_COUNT__*2)
|
|
||||||
bne condes
|
|
||||||
rts
|
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
|
||||||
; Cleanup library modules
|
|
||||||
|
|
||||||
.proc donelib
|
|
||||||
|
|
||||||
lda #<__DESTRUCTOR_TABLE__
|
|
||||||
ldx #>__DESTRUCTOR_TABLE__
|
|
||||||
ldy #<(__DESTRUCTOR_COUNT__*2)
|
|
||||||
bne condes
|
|
||||||
rts
|
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
|
||||||
; Generic table call handler
|
|
||||||
|
|
||||||
.proc condes
|
|
||||||
|
|
||||||
sta getbyt+1
|
|
||||||
stx getbyt+2
|
|
||||||
sty index
|
|
||||||
|
|
||||||
loop: ldy index
|
|
||||||
beq done
|
|
||||||
dey
|
|
||||||
jsr getbyt
|
|
||||||
tax
|
|
||||||
dey
|
|
||||||
jsr getbyt
|
|
||||||
sty index
|
|
||||||
jsr callax
|
|
||||||
.ifpc02
|
|
||||||
bra loop
|
|
||||||
.else
|
|
||||||
jmp loop
|
|
||||||
.endif
|
|
||||||
|
|
||||||
done: rts
|
|
||||||
|
|
||||||
.endproc
|
|
||||||
|
|
||||||
|
|
||||||
; --------------------------------------------------------------------------
|
|
||||||
; Data. The getbyte routine is placed in the data segment cause it's patched
|
|
||||||
; at runtime.
|
|
||||||
|
|
||||||
.bss
|
|
||||||
|
|
||||||
index: .byte 0
|
|
||||||
|
|
||||||
.data
|
|
||||||
|
|
||||||
getbyt:
|
|
||||||
;;getbyt_:
|
|
||||||
lda $FFFF,y
|
|
||||||
rts
|
|
@ -5,7 +5,6 @@
|
|||||||
.import vdc_init
|
.import vdc_init
|
||||||
|
|
||||||
.export initconio
|
.export initconio
|
||||||
.export _conio_init
|
|
||||||
|
|
||||||
.constructor initconio, 24
|
.constructor initconio, 24
|
||||||
|
|
||||||
@ -46,8 +45,6 @@ set_palette:
|
|||||||
stz VCE_DATA_LO
|
stz VCE_DATA_LO
|
||||||
stz VCE_DATA_HI
|
stz VCE_DATA_HI
|
||||||
|
|
||||||
; so it will get linked in
|
|
||||||
_conio_init:
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;----------------------------------------------------------------------------
|
;----------------------------------------------------------------------------
|
||||||
|
@ -7,37 +7,38 @@
|
|||||||
; This must be the *first* file on the linker command line
|
; This must be the *first* file on the linker command line
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _exit
|
.export _exit
|
||||||
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
||||||
.import initlib, donelib
|
|
||||||
.import push0, _main, zerobss
|
|
||||||
.import initheap
|
|
||||||
.import tmp1,tmp2,tmp3
|
|
||||||
|
|
||||||
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
.import initlib, donelib
|
||||||
;; .import __SRAM_START__, __SRAM_SIZE__ ; Linker generated
|
.import push0, _main, zerobss
|
||||||
.import __ROM0_START__, __ROM0_SIZE__ ; Linker generated
|
.import initheap
|
||||||
.import __ROM_START__, __ROM_SIZE__ ; Linker generated
|
.import tmp1,tmp2,tmp3
|
||||||
.import __STARTUP_LOAD__,__STARTUP_RUN__, __STARTUP_SIZE__ ; Linker generated
|
|
||||||
.import __CODE_LOAD__,__CODE_RUN__, __CODE_SIZE__ ; Linker generated
|
|
||||||
.import __RODATA_LOAD__,__RODATA_RUN__, __RODATA_SIZE__ ; Linker generated
|
|
||||||
.import __DATA_LOAD__,__DATA_RUN__, __DATA_SIZE__ ; Linker generated
|
|
||||||
.import __BSS_SIZE__
|
|
||||||
|
|
||||||
.include "pce.inc"
|
; Linker generated
|
||||||
|
.import __RAM_START__, __RAM_SIZE__
|
||||||
|
.import __ROM0_START__, __ROM0_SIZE__
|
||||||
|
.import __ROM_START__, __ROM_SIZE__
|
||||||
|
.import __STARTUP_LOAD__,__STARTUP_RUN__, __STARTUP_SIZE__
|
||||||
|
.import __CODE_LOAD__,__CODE_RUN__, __CODE_SIZE__
|
||||||
|
.import __RODATA_LOAD__,__RODATA_RUN__, __RODATA_SIZE__
|
||||||
|
.import __DATA_LOAD__,__DATA_RUN__, __DATA_SIZE__
|
||||||
|
.import __BSS_SIZE__
|
||||||
|
|
||||||
.importzp sp
|
.include "pce.inc"
|
||||||
.importzp ptr1,ptr2
|
|
||||||
|
.importzp sp
|
||||||
|
.importzp ptr1,ptr2
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; Create an empty LOWCODE segment to avoid linker warnings
|
; Create an empty LOWCODE segment to avoid linker warnings
|
||||||
|
|
||||||
.segment "LOWCODE"
|
.segment "LOWCODE"
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; Place the startup code in a special segment.
|
; Place the startup code in a special segment.
|
||||||
|
|
||||||
.segment "STARTUP"
|
.segment "STARTUP"
|
||||||
|
|
||||||
start:
|
start:
|
||||||
|
|
||||||
@ -47,32 +48,32 @@ start:
|
|||||||
|
|
||||||
sei
|
sei
|
||||||
nop
|
nop
|
||||||
csh ; set high speed CPU mode
|
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
|
||||||
|
|
||||||
; at startup all MPRs are set to 0, so init them
|
; at startup all MPRs are set to 0, so init them
|
||||||
lda #$ff
|
lda #$ff
|
||||||
tam #1 ; 0000-1FFF = Hardware page
|
tam #%00000001 ; 0000-1FFF = Hardware page
|
||||||
lda #$F8
|
lda #$F8
|
||||||
tam #2 ; 2000-3FFF = Work RAM
|
tam #%00000010 ; 2000-3FFF = Work RAM
|
||||||
;lda #$F7
|
;lda #$F7
|
||||||
;tam #2 ; 4000-5FFF = Save RAM
|
;tam #%00000100 ; 4000-5FFF = Save RAM
|
||||||
;lda #1
|
;lda #1
|
||||||
;tam #3 ; 6000-7FFF Page 2
|
;tam #%00001000 ; 6000-7FFF Page 2
|
||||||
;lda #2
|
;lda #2
|
||||||
;tam #4 ; 8000-9FFF Page 3
|
;tam #%00010000 ; 8000-9FFF Page 3
|
||||||
;lda #3
|
;lda #3
|
||||||
;tam #5 ; A000-BFFF Page 4
|
;tam #%00100000 ; A000-BFFF Page 4
|
||||||
;lda #4
|
;lda #4
|
||||||
;tam #6 ; C000-DFFF Page 5
|
;tam #%01000000 ; C000-DFFF Page 5
|
||||||
;lda #0
|
;lda #0
|
||||||
;tam #7 ; e000-fFFF hucard/syscard bank 0
|
;tam #%10000000 ; e000-fFFF hucard/syscard bank 0
|
||||||
|
|
||||||
; Clear work RAM (2000-3FFF)
|
; Clear work RAM (2000-3FFF)
|
||||||
stz <$00
|
stz <$00
|
||||||
@ -88,110 +89,87 @@ start:
|
|||||||
.import vdc_init
|
.import vdc_init
|
||||||
jsr vdc_init
|
jsr vdc_init
|
||||||
|
|
||||||
;; jsr joy_init
|
|
||||||
|
|
||||||
; Turn on background and VD interrupt/IRQ1
|
; Turn on background and VD interrupt/IRQ1
|
||||||
|
|
||||||
lda #$05
|
lda #$05
|
||||||
sta IRQ_MASK ; IRQ1=on
|
sta IRQ_MASK ; IRQ1=on
|
||||||
|
|
||||||
cli
|
cli
|
||||||
|
|
||||||
; Clear the BSS data
|
; Clear the BSS data
|
||||||
|
jsr zerobss
|
||||||
|
|
||||||
jsr zerobss
|
; Copy the .data segment to RAM
|
||||||
|
lda #<(__DATA_LOAD__)
|
||||||
; Copy the .data segment to RAM
|
sta ptr1
|
||||||
|
lda #>(__DATA_LOAD__)
|
||||||
lda #<(__DATA_LOAD__)
|
sta ptr1+1
|
||||||
;;lda #<(__ROM0_START__ + __STARTUP_SIZE__+ __CODE_SIZE__+ __RODATA_SIZE__)
|
lda #<(__DATA_RUN__)
|
||||||
;;lda #<(__ROM_START__ + __CODE_SIZE__+ __RODATA_SIZE__)
|
sta ptr2
|
||||||
sta ptr1
|
lda #>(__DATA_RUN__)
|
||||||
lda #>(__DATA_LOAD__)
|
sta ptr2+1
|
||||||
;;lda #>(__ROM_START__ + __CODE_SIZE__+ __RODATA_SIZE__)
|
|
||||||
sta ptr1+1
|
|
||||||
lda #<(__DATA_RUN__)
|
|
||||||
;;lda #<(__SRAM_START__)
|
|
||||||
sta ptr2
|
|
||||||
lda #>(__DATA_RUN__)
|
|
||||||
;;lda #>(__SRAM_START__)
|
|
||||||
sta ptr2+1
|
|
||||||
|
|
||||||
ldx #>(__DATA_SIZE__)
|
|
||||||
|
|
||||||
|
ldx #>(__DATA_SIZE__)
|
||||||
@l2:
|
@l2:
|
||||||
beq @s1 ; no more full pages
|
beq @s1 ; no more full pages
|
||||||
|
|
||||||
; copy one page
|
; copy one page
|
||||||
ldy #0
|
ldy #0
|
||||||
@l1:
|
@l1:
|
||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
sta (ptr2),y
|
sta (ptr2),y
|
||||||
iny
|
iny
|
||||||
bne @l1
|
bne @l1
|
||||||
|
|
||||||
inc ptr1+1
|
inc ptr1+1
|
||||||
inc ptr2+1
|
inc ptr2+1
|
||||||
|
|
||||||
dex
|
dex
|
||||||
bne @l2
|
bne @l2
|
||||||
|
|
||||||
; copy remaining bytes
|
; copy remaining bytes
|
||||||
@s1:
|
@s1:
|
||||||
|
; copy one page
|
||||||
; copy one page
|
ldy #0
|
||||||
ldy #0
|
|
||||||
@l3:
|
@l3:
|
||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
sta (ptr2),y
|
sta (ptr2),y
|
||||||
iny
|
iny
|
||||||
cpy #<(__DATA_SIZE__)
|
cpy #<(__DATA_SIZE__)
|
||||||
bne @l3
|
bne @l3
|
||||||
|
|
||||||
; setup the stack
|
; setup the stack
|
||||||
|
lda #<(__RAM_START__+__RAM_SIZE__)
|
||||||
|
sta sp
|
||||||
|
lda #>(__RAM_START__+__RAM_SIZE__)
|
||||||
|
sta sp+1
|
||||||
|
|
||||||
; lda #<(__RAM_START__ + __DATA_SIZE__ + __BSS_SIZE__)
|
; Init the Heap
|
||||||
lda #<(__RAM_START__+__RAM_SIZE__)
|
jsr initheap
|
||||||
sta sp
|
|
||||||
; lda #>(__RAM_START__ + __DATA_SIZE__ + __BSS_SIZE__)
|
|
||||||
lda #>(__RAM_START__+__RAM_SIZE__)
|
|
||||||
sta sp+1 ; Set argument stack ptr
|
|
||||||
|
|
||||||
; Init the Heap
|
; Call module constructors
|
||||||
jsr initheap
|
jsr initlib
|
||||||
|
|
||||||
;jmp *
|
;; FIXME: this should be called from a constructor instead
|
||||||
|
.import initconio
|
||||||
|
jsr initconio
|
||||||
|
|
||||||
; Call module constructors
|
; Pass an empty command line
|
||||||
|
jsr push0 ; argc
|
||||||
|
jsr push0 ; argv
|
||||||
|
|
||||||
jsr initlib
|
ldy #4 ; Argument size
|
||||||
|
jsr _main ; call the users code
|
||||||
;; FIXME: this should be called from a constructor instead
|
|
||||||
.import initconio
|
|
||||||
jsr initconio
|
|
||||||
|
|
||||||
; Pass an empty command line
|
|
||||||
|
|
||||||
|
|
||||||
;jmp *
|
|
||||||
|
|
||||||
jsr push0 ; argc
|
|
||||||
jsr push0 ; argv
|
|
||||||
go:
|
|
||||||
ldy #4 ; Argument size
|
|
||||||
jsr _main ; call the users code
|
|
||||||
|
|
||||||
; Call module destructors. This is also the _exit entry.
|
|
||||||
|
|
||||||
|
; Call module destructors. This is also the _exit entry.
|
||||||
_exit:
|
_exit:
|
||||||
jsr donelib ; Run module destructors
|
jsr donelib ; Run module destructors
|
||||||
|
|
||||||
; reset the PCEngine
|
; reset the PCEngine (start over)
|
||||||
|
jmp start
|
||||||
jmp start
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; System V-Blank Interupt
|
; System V-Blank Interupt
|
||||||
|
; FIXME: hooks should be provided so the user can abuse the IRQ
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
|
|
||||||
_irq1:
|
_irq1:
|
||||||
@ -201,10 +179,13 @@ _irq1:
|
|||||||
|
|
||||||
|
|
||||||
inc _tickcount
|
inc _tickcount
|
||||||
bne @s
|
bne @s1
|
||||||
inc _tickcount+1
|
inc _tickcount+1
|
||||||
@s:
|
bne @s1
|
||||||
|
inc _tickcount+2
|
||||||
|
bne @s1
|
||||||
|
inc _tickcount+3
|
||||||
|
@s1:
|
||||||
; Acknowlege interrupt
|
; Acknowlege interrupt
|
||||||
ldaio VDC_CTRL
|
ldaio VDC_CTRL
|
||||||
|
|
||||||
@ -227,14 +208,10 @@ initmainargs:
|
|||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; hardware vectors
|
; hardware vectors
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
.segment "VECTORS"
|
.segment "VECTORS"
|
||||||
;;.org $fff6
|
|
||||||
|
|
||||||
.word _irq2 ; $fff6 IRQ2 (External IRQ, BRK)
|
|
||||||
.word _irq1 ; $fff8 IRQ1 (VDC)
|
|
||||||
.word _timer ; $fffa Timer
|
|
||||||
.word _nmi ; $fffc NMI
|
|
||||||
.word start ; $fffe reset
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.word _irq2 ; $fff6 IRQ2 (External IRQ, BRK)
|
||||||
|
.word _irq1 ; $fff8 IRQ1 (VDC)
|
||||||
|
.word _timer ; $fffa Timer
|
||||||
|
.word _nmi ; $fffc NMI
|
||||||
|
.word start ; $fffe reset
|
||||||
|
@ -25,11 +25,6 @@
|
|||||||
|
|
||||||
; Button state masks (8 values)
|
; Button state masks (8 values)
|
||||||
|
|
||||||
;extern const unsigned char joy_masks[8];
|
|
||||||
|
|
||||||
.export _joy_masks
|
|
||||||
|
|
||||||
_joy_masks:
|
|
||||||
.byte $10 ; JOY_UP
|
.byte $10 ; JOY_UP
|
||||||
.byte $40 ; JOY_DOWN
|
.byte $40 ; JOY_DOWN
|
||||||
.byte $80 ; JOY_LEFT
|
.byte $80 ; JOY_LEFT
|
||||||
|
@ -1,19 +1,23 @@
|
|||||||
|
PC-Engine (PCE) target support for cc65. this is still work in progress and
|
||||||
|
a couple of things need to be fixed:
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
joystick support should get verified on real hw, the masks for buttons may be
|
joystick support should get verified on real hw
|
||||||
wrong.
|
- the masks for buttons may be wrong.
|
||||||
|
- 6 button gamepads are different and need slightly different code
|
||||||
clock() does not work for unknown reasons
|
|
||||||
|
|
||||||
get_tv() is a dummy function and always returns 0
|
|
||||||
|
|
||||||
revers() is a dummy function, actual reverse output is not supported yet
|
revers() is a dummy function, actual reverse output is not supported yet
|
||||||
|
|
||||||
waitvblank() is missing
|
waitvblank() is missing
|
||||||
|
get_tv() is missing
|
||||||
|
|
||||||
some graphical petscii chars should get added to the charset
|
some graphical petscii chars should get added to the charset
|
||||||
|
|
||||||
conio-init should get initialized from a constructor rather than always get
|
conio-init should get initialized from a constructor rather than always get
|
||||||
called from crt0
|
called from crt0 (which for some reason doesnt work) -> see conio.s, it should
|
||||||
|
get linked if _any_ of the conio function is used
|
||||||
|
|
||||||
|
interruptor support in crt0 (and cfg) is missing
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -29,3 +33,16 @@ w/s/a/d up/down/left/right
|
|||||||
numpad 2 (?) button
|
numpad 2 (?) button
|
||||||
numpad 3 (?) button
|
numpad 3 (?) button
|
||||||
enter (start) button
|
enter (start) button
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
some useful resources on PCE coding:
|
||||||
|
|
||||||
|
http://blog.blockos.org/?tag=pc-engine
|
||||||
|
http://pcedev.blockos.org/viewforum.php?f=5
|
||||||
|
http://www.romhacking.net/?page=documents&category=&platform=4&game=&author=&perpage=20&level=&title=&desc=&docsearch=Go
|
||||||
|
http://archaicpixels.com/Main_Page
|
||||||
|
|
||||||
|
http://www.magicengine.com/mkit/doc.html
|
||||||
|
|
||||||
|
https://github.com/uli/huc
|
||||||
|
http://www.zeograd.com/parse.php?src=hucf
|
12
testcode/lib/pce/Makefile
Normal file
12
testcode/lib/pce/Makefile
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
all: conio.pce
|
||||||
|
|
||||||
|
conio.pce: conio.c
|
||||||
|
../../../bin/cl65 -t pce conio.c ../../../joy/pce-stdjoy.joy --mapfile conio.map -o conio.pce
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) conio.pce
|
||||||
|
|
||||||
|
test: conio.pce
|
||||||
|
mednafen -force_module pce conio.pce
|
||||||
|
|
@ -9,6 +9,7 @@ void main(void)
|
|||||||
{
|
{
|
||||||
int stackvar = 42;
|
int stackvar = 42;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
clock_t clk;
|
||||||
|
|
||||||
joy_install(&joy_static_stddrv);
|
joy_install(&joy_static_stddrv);
|
||||||
|
|
||||||
@ -39,7 +40,9 @@ void main(void)
|
|||||||
++datavar; ++stackvar;
|
++datavar; ++stackvar;
|
||||||
|
|
||||||
gotoxy(0,8);
|
gotoxy(0,8);
|
||||||
cprintf("clock: %08x", clock());
|
clk = clock();
|
||||||
|
cprintf("clock: %08lx", clk);
|
||||||
|
|
||||||
for (i = 0; i < 4; ++i)
|
for (i = 0; i < 4; ++i)
|
||||||
{
|
{
|
||||||
gotoxy(0, 12 + i);
|
gotoxy(0, 12 + i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user