Make screensize() fetch the values dynamically instead of using variables

that are set on startup. This is needed to support the C128, which can switch
the screen size at runtime.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2042 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-04-09 19:34:57 +00:00
parent 8632683f11
commit 37178d5141
25 changed files with 153 additions and 158 deletions

View File

@@ -4,12 +4,16 @@
; Screen size variables
;
.export xsize, ysize
.export screensize
.rodata
xsize: .byte 40
ysize: .byte 25
.include "cbm510.inc"
.proc screensize
ldx #XSIZE
ldy #YSIZE
rts
.endproc

View File

@@ -192,6 +192,12 @@ MoniSegSave = $03f0
wstvec = $03F8
WstFlag = $03FA ; Warm start flag
; ---------------------------------------------------------------------------
; Screen size
XSIZE = 40
YSIZE = 25
;-----------------------------------------------------------------------------
; I/O Definitions

View File

@@ -10,7 +10,6 @@
.import PLOT
.import popa, _gotoxy
.import xsize
.include "cbm510.inc"
@@ -53,7 +52,7 @@ cputdirect:
advance:
iny
cpy xsize
cpy #XSIZE
bne L3
jsr newline ; new line
ldy #0 ; + cr
@@ -62,13 +61,13 @@ L3: sty CURS_X
newline:
clc
lda xsize
lda #XSIZE
adc SCREEN_PTR
sta SCREEN_PTR
bcc L4
inc SCREEN_PTR+1
clc
L4: lda xsize
L4: lda #XSIZE
adc CRAM_PTR
sta CRAM_PTR
bcc L5