; Assembly Source File ; Created 12/20/2001, 8:00:42 PM ; Home Screen Restore - Restores the Home Screen Application to its original state ; after an assembly language program messes it up. ; Copyright (C) 2001-2002 Greg Dietsche ; ; This program 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 of the License, or ; (at your option) any later version. ; ; This program 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 this program; if not, write to the Free Software ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ; ;Contact Information: ;Email: gforce@calc.org ;Webpage: http://gforce.calc.org include "os.h" ;;;;;;;;;;;;;;;;;;;;; ;;my macros... these aren't found in os.h at the moment... ;;;;;;;;;;;;;;;;;;;;; ;this macro requires that a4 be initialized with move.l $c8,a4 ;prior to its use ROM_CALL3 macro move.l \1*4(a4),a0 jsr (a0) endm ;this macro makes use of the line 1111 emulator for making rom calls... ROM_CALLF macro dc.w $F800+\1 endm ;makes use of the line 1010 emulator... error codes are those listed in the calc's guide book... ERR_THROW macro dc.w $A000+\1 endm ;;;;;;;;;;;;;;;;;;;;;; xdef _main xdef _ti89 xdef _ti92plus xdef _nostub ;i don't feel like commenting, so i hope this code is self-explanatory ;the outline is as follows: ;detect calc, use memset to draw the bottom line on the screen ;call EV_switch, and pushkey twice ;send a CM_ACTIVATE event _main: movem.l a4/d3,-(sp) link a6,#-14 move.l $c8,a4 move.l #30,-(sp) move.w #$ff,-(sp) move.l a4,d0 swap d0 lsr.w #6,d0 tst.b d0 bne Restore92pScreen pea.l $56e6 bra RestoreTheScreen Restore92pScreen: pea.l $5a2e RestoreTheScreen: ROM_CALL3 memset moveq.w #1,d3 TheLoop: move.w #264,-(sp) ROM_CALL3 pushkey ROM_CALL3 EV_switch dbra.w d3,TheLoop move.w #$703,-14(a6) pea -14(a6) move.w #-1,-(sp) ROM_CALL3 EV_sendEvent pea.l ProgName(pc) ROM_CALL3 ST_helpMsg unlk a6 movem.l (sp)+,a4/d3 rts ProgName: dc.b 'HSR v2.0',0