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:
@@ -6,24 +6,29 @@
|
||||
|
||||
.export _screensize
|
||||
|
||||
.import popax
|
||||
.import xsize, ysize
|
||||
.importzp ptr1, ptr2
|
||||
.import popsreg
|
||||
.import screensize
|
||||
.importzp ptr1, sreg
|
||||
|
||||
.proc _screensize
|
||||
|
||||
sta ptr1 ; Store the y pointer
|
||||
sta ptr1 ; Store the y pointer
|
||||
stx ptr1+1
|
||||
jsr popsreg ; Get the x pointer into sreg
|
||||
jsr screensize ; Get screensize into X/Y
|
||||
tya ; Get Y size into A
|
||||
|
||||
jsr popax ; get the x pointer
|
||||
sta ptr2
|
||||
stx ptr2+1
|
||||
.IFP02
|
||||
ldy #0
|
||||
sta (ptr1),y
|
||||
txa
|
||||
sta (sreg),y
|
||||
.ELSE
|
||||
sta (ptr1)
|
||||
txa
|
||||
sta (sreg)
|
||||
.ENDIF
|
||||
|
||||
ldy #0
|
||||
lda xsize
|
||||
sta (ptr2),y
|
||||
lda ysize
|
||||
sta (ptr1),y
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
Reference in New Issue
Block a user