fixed more flaws found by greg :)
This commit is contained in:
@@ -2,15 +2,6 @@
|
|||||||
; PCE definitions. By Groepaz/Hitmem.
|
; PCE definitions. By Groepaz/Hitmem.
|
||||||
;
|
;
|
||||||
|
|
||||||
; FIXME: optimize zeropage usage
|
|
||||||
CURS_X = $30
|
|
||||||
CURS_Y = $31
|
|
||||||
SCREEN_PTR = $32 ;2
|
|
||||||
CHARCOLOR = $34
|
|
||||||
RVS = $35
|
|
||||||
BGCOLOR = $36
|
|
||||||
tickcount = $37 ;4
|
|
||||||
|
|
||||||
; FIXME: screen dimensions my change according to selected video mode
|
; FIXME: screen dimensions my change according to selected video mode
|
||||||
screenrows = (224/8)
|
screenrows = (224/8)
|
||||||
charsperline = 61
|
charsperline = 61
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ SYMBOLS {
|
|||||||
|
|
||||||
MEMORY {
|
MEMORY {
|
||||||
# FIXME: is this correct? the first 3? bytes cant be used?
|
# FIXME: is this correct? the first 3? bytes cant be used?
|
||||||
ZP: start = $03, size = $1A, type = rw, define = yes;
|
ZP: start = $03, size = $fd, type = rw, define = yes;
|
||||||
|
|
||||||
# reset-bank and hardware vectors
|
# reset-bank and hardware vectors
|
||||||
ROM0: start = $e000, size = $1ff6, file = %O ,fill = yes, define = yes;
|
ROM0: start = $e000, size = $1ff6, file = %O ,fill = yes, define = yes;
|
||||||
@@ -25,6 +25,8 @@ SEGMENTS {
|
|||||||
BSS: load = RAM, type = bss, define = yes;
|
BSS: load = RAM, type = bss, define = yes;
|
||||||
VECTORS: load = ROMV, type = rw, define = yes;
|
VECTORS: load = ROMV, type = rw, define = yes;
|
||||||
ZEROPAGE: load = ZP, type = zp, define = yes;
|
ZEROPAGE: load = ZP, type = zp, define = yes;
|
||||||
|
EXTZP: load = ZP, type = zp, define = yes, optional = yes;
|
||||||
|
APPZP: load = ZP, type = zp, define = yes, optional = yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
FEATURES {
|
FEATURES {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
.include "pce.inc"
|
.include "pce.inc"
|
||||||
|
.include "extzp.inc"
|
||||||
|
|
||||||
.export _clock
|
.export _clock
|
||||||
.importzp sreg
|
.importzp sreg
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
.include "pce.inc"
|
.include "pce.inc"
|
||||||
|
.include "extzp.inc"
|
||||||
|
|
||||||
|
.import PLOT
|
||||||
.export _clrscr
|
.export _clrscr
|
||||||
_clrscr:
|
_clrscr:
|
||||||
|
|
||||||
@@ -23,7 +25,11 @@ colloop:
|
|||||||
dey
|
dey
|
||||||
bne rowloop
|
bne rowloop
|
||||||
|
|
||||||
rts
|
; Go to the home position.
|
||||||
|
|
||||||
|
stz CURS_X
|
||||||
|
stz CURS_Y
|
||||||
|
jmp PLOT
|
||||||
|
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
; force the init constructor to be imported
|
; force the init constructor to be imported
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
.export _textcolor, _bgcolor, _bordercolor
|
.export _textcolor, _bgcolor, _bordercolor
|
||||||
|
|
||||||
.include "pce.inc"
|
.include "pce.inc"
|
||||||
|
.include "extzp.inc"
|
||||||
|
|
||||||
_textcolor:
|
_textcolor:
|
||||||
ldx CHARCOLOR ; get old value
|
ldx CHARCOLOR ; get old value
|
||||||
@@ -33,9 +34,10 @@ _bgcolor:
|
|||||||
|
|
||||||
_bordercolor:
|
_bordercolor:
|
||||||
lda #0
|
lda #0
|
||||||
txa
|
tax
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
.rodata
|
||||||
.export colors
|
.export colors
|
||||||
|
|
||||||
colors:
|
colors:
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
.include "pce.inc"
|
.include "pce.inc"
|
||||||
|
.include "extzp.inc"
|
||||||
|
|
||||||
.import vce_init
|
.import vce_init
|
||||||
.import psg_init
|
.import psg_init
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
.importzp tmp3,tmp4
|
.importzp tmp3,tmp4
|
||||||
|
|
||||||
.include "pce.inc"
|
.include "pce.inc"
|
||||||
|
.include "extzp.inc"
|
||||||
|
|
||||||
_cputcxy:
|
_cputcxy:
|
||||||
pha ; Save C
|
pha ; Save C
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
.import __BSS_SIZE__
|
.import __BSS_SIZE__
|
||||||
|
|
||||||
.include "pce.inc"
|
.include "pce.inc"
|
||||||
|
.include "extzp.inc"
|
||||||
|
|
||||||
.importzp sp
|
.importzp sp
|
||||||
.importzp ptr1,ptr2
|
.importzp ptr1,ptr2
|
||||||
@@ -77,7 +78,7 @@ start:
|
|||||||
tii $2000, $2001, $1FFF
|
tii $2000, $2001, $1FFF
|
||||||
|
|
||||||
; Initialize hardware
|
; Initialize hardware
|
||||||
stz TIMER_COUNT ; Timer off
|
stz TIMER_CTRL ; Timer off
|
||||||
lda #$07
|
lda #$07
|
||||||
sta IRQ_MASK ; Interrupts off
|
sta IRQ_MASK ; Interrupts off
|
||||||
stz IRQ_STATUS ; Acknowledge timer
|
stz IRQ_STATUS ; Acknowledge timer
|
||||||
|
|||||||
17
libsrc/pce/extzp.inc
Normal file
17
libsrc/pce/extzp.inc
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
;
|
||||||
|
; extzp.inc for the PC-Engine
|
||||||
|
;
|
||||||
|
; Groepaz/Hitmen, 2015-11-19
|
||||||
|
;
|
||||||
|
; Assembler include file that imports the runtime zero page locations used
|
||||||
|
; by the PC-Engine runtime, ready for usage in asm code.
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
.global CURS_X: zp
|
||||||
|
.global CURS_Y: zp
|
||||||
|
.global SCREEN_PTR: zp
|
||||||
|
.global CHARCOLOR: zp
|
||||||
|
.global RVS: zp
|
||||||
|
.global BGCOLOR: zp
|
||||||
|
.global tickcount: zp
|
||||||
17
libsrc/pce/extzp.s
Normal file
17
libsrc/pce/extzp.s
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
;
|
||||||
|
; Groepaz/Hitmen, 2015-11-19
|
||||||
|
;
|
||||||
|
; zeropage locations for exclusive use by the library
|
||||||
|
;
|
||||||
|
|
||||||
|
.include "extzp.inc"
|
||||||
|
|
||||||
|
.segment "EXTZP" : zeropage
|
||||||
|
|
||||||
|
CURS_X: .res 1
|
||||||
|
CURS_Y: .res 1
|
||||||
|
SCREEN_PTR: .res 2
|
||||||
|
CHARCOLOR: .res 1
|
||||||
|
RVS: .res 1
|
||||||
|
BGCOLOR: .res 1
|
||||||
|
tickcount: .res 4
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
.import popa, plot
|
.import popa, plot
|
||||||
|
|
||||||
.include "pce.inc"
|
.include "pce.inc"
|
||||||
|
.include "extzp.inc"
|
||||||
|
|
||||||
_gotoxy:
|
_gotoxy:
|
||||||
sta CURS_Y ; Set Y
|
sta CURS_Y ; Set Y
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
.export PLOT
|
.export PLOT
|
||||||
|
|
||||||
.include "pce.inc"
|
.include "pce.inc"
|
||||||
|
.include "extzp.inc"
|
||||||
|
|
||||||
PLOT:
|
PLOT:
|
||||||
bcs @getpos
|
bcs @getpos
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
.include "pce.inc"
|
.include "pce.inc"
|
||||||
|
.include "extzp.inc"
|
||||||
|
|
||||||
.export _revers
|
.export _revers
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
.include "pce.inc"
|
.include "pce.inc"
|
||||||
|
.include "extzp.inc"
|
||||||
|
|
||||||
.export _waitvblank
|
.export _waitvblank
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user