; ; screen.s ; ; Screen mode information caching (TMA) ; ; © 1994-1998 Straylight ; ;----- Licensing note ------------------------------------------------------- ; ; This file is part of Straylight's Quartz library. ; ; Quartz is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2, or (at your option) ; any later version. ; ; Quartz is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with Quartz. If not, write to the Free Software Foundation, ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ;----- Standard header ------------------------------------------------------ GET libs:header GET libs:swis ;----- External dependencies ------------------------------------------------ ; ; None. ;----- Main code ------------------------------------------------------------ AREA |Quartz$$Code|,CODE,READONLY ; --- screen_getInfo --- ; ; On entry: -- ; ; On exit: R0 == pointer to screen information block ; ; Use: This call returns a pointer to a block of information ; about the current screen modes. The offset for different ; bits of data are defined in screen.sh EXPORT screen_getInfo screen_getInfo ROUT LDR R0,screen__wSpace ;Get my workspace ADD R0,R0,#4 ;Point to the data block MOVS PC,R14 ;Return to caller LTORG ; --- screen__cache --- ; ; On entry: -- ; ; On exit: -- ; ; Use: Caches screen information for the current mode screen__cache ROUT STMFD R13!,{R0-R10,R14} ;Stack some registers LDR R12,screen__wSpace ;Locate my workspace ; --- Now read relevent mode variables --- MOV R3,#1 ;A useful value MOV R0,#-1 ;Get info on current mode MOV R1,#4 ;XEigFactor SWI OS_ReadModeVariable ;Read its value MOV R4,R2 ;Look after xEig MOV R9,R3,LSL R4 ;Get dx correctly MOV R1,#5 ;YEigFactor SWI OS_ReadModeVariable ;Read its value MOV R5,R2 ;Look after yEig MOV R10,R3,LSL R5 ;Get dy correctly MOV R1,#9 ;Log2BPP SWI OS_ReadModeVariable ;Read its value MOV R6,R3,LSL R2 ;Calculate bpp MOV R1,#11 ;XWindLimit SWI OS_ReadModeVariable ;Read its value ADD R2,R2,#1 ;Calculate screen width MOV R7,R2,LSL R4 ;width=(XwindLimit+1)<