1
0
mirror of https://github.com/cc65/cc65.git synced 2026-04-22 01:16:54 +00:00

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
+11 -4
View File
@@ -4,11 +4,18 @@
; Screen size variables
;
.export xsize, ysize
.export screensize
.data
; We will return the values directly instead of banking in the ROM and calling
; SCREEN which is a lot more overhead in code size and CPU cycles.
.proc screensize
ldx #40
ldy #25
rts
.endproc
xsize: .byte 40
ysize: .byte 25
+3 -4
View File
@@ -8,7 +8,6 @@
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
.import popa, _gotoxy
.import xsize
.import PLOT
.include "plus4.inc"
@@ -50,7 +49,7 @@ cputdirect:
advance:
iny
cpy xsize
cpy #XSIZE
bne L3
jsr newline ; new line
ldy #0 ; + cr
@@ -59,13 +58,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
+6
View File
@@ -41,6 +41,12 @@ IRQVec = $0314
BRKVec = $0316
NMIVec = $0318
; ---------------------------------------------------------------------------
; Screen size
XSIZE = 40
YSIZE = 25
; ---------------------------------------------------------------------------
; I/O