X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libsrc%2Fconio%2Fscrsize.s;h=6582568d77820df29fd246a998556cea65aaaf08;hb=a03b3574b65a6167ac1207e66b83888eb0ca8465;hp=0779fb1e5ce1f07dd311b4186aeb7c03c7314cfa;hpb=826a9545e44dd9ae620bd33dd2ae537f95f0a2c4;p=cc65 diff --git a/libsrc/conio/scrsize.s b/libsrc/conio/scrsize.s index 0779fb1e5..6582568d7 100644 --- a/libsrc/conio/scrsize.s +++ b/libsrc/conio/scrsize.s @@ -4,27 +4,32 @@ ; void screensize (unsigned char* x, unsigned char* y); ; - .export _screensize - - .import popax - .import xsize, ysize - .importzp ptr1, ptr2 - -.proc _screensize - - sta ptr1 ; Store the y pointer - stx ptr1+1 - - jsr popax ; get the x pointer - sta ptr2 - stx ptr2+1 - - ldy #0 - lda xsize - sta (ptr2),y - lda ysize - sta (ptr1),y - rts + .export _screensize + + .import popsreg + .import screensize + .importzp ptr1, sreg + +.proc _screensize + + 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 + +.IFP02 + ldy #0 + sta (ptr1),y + txa + sta (sreg),y +.ELSE + sta (ptr1) + txa + sta (sreg) +.ENDIF + + rts .endproc