;Picture Viewer by chicane ;version .5 ;this is a simple port of the mini-shell code to view pictures instead of ;programs. #include "asm86.h" #include "ti86asm.inc" #include "ti86ops.inc" _MOV10TOOP1 equ $42D7 ;Move 10bytes a hl to OP1 _homeup equ $4A95 ;resets _curRow etc. _dispahl equ $4a33 ;displays ahl decimal _get_word_ahl equ $521d _pop_OP1 equ $47B7 _push_OP1 equ $4813 _PrevVar equ $514F _NextVar equ $514B _runoff equ $4AB1 _runon equ $4AAD _load_ram_ahl equ $462F .org _asm_exec_ram ASMstart: call _runoff ;turn busy indicator off call _clrScrn ;clear the screen call clrPlot ;cleat the _plotSScrn Display: ld hl,$0001 ;duh ld (_penCol), hl ;set up where to put text ld hl,PrgmName ;load the text address call _vputs ;output in variable width text format. ld a,$59 ld (_penCol),a ld hl,Version ;same as above call _vputs ld hl,$3919 ld (_penCol),hl ;blah blah ld hl,EMail call _vputs ld hl,$FF90 call Invert ;Draws a black bar(reverse) ld hl,$FC00 call Invert DispBox: set 3,(iy+5) ;set reverse video mode ld hl,$0301 ;output the "Pictures Size" text ld (_curRow),hl ld hl,PixMenu call _puts ld hl,$0405 ld (_curRow),hl ld hl,System call _puts res 3,(iy+5) ;reset reverse video mode FreeMem: ;Free memory on calc ld hl,$0506 ;place to put text ld (_curRow),hl ;load it in call _MEMCHK ;the actual check call _dispahl ;Display the number of bytes ld hl,ByteString ;add "bytes free" after number call _puts ;put it to screen FirstPix: ld hl,FirstPic ;Load address of the first posible picture name into hl rst 20h ;Move 10 bytes at hl to OP1 xor a ;clear a call _NextVar jr c,NoPix call DispInfo jp GetKey1 NoPix: call _clrScrn ;clear somthing call _homeup ;reset _curRow etc ld hl,NoPics ;load the string into hl call _puts ;output it ret ;exit to ti-os GetKey1: ;Key Check Routine call _getkey ;Gets last key pressed cp kExit jp z,Exit cp kUp call z,PrevVar cp kDown call z,NextVar cp kDel jr z,Delete cp kEnter jp z,DrawPic jr GetKey1 ;<-------Utility Routines----------> Delete: ;Delete current Picture rst 10h ;find address call _delvar ;delete it xor a ;clear a jp ASMstart ;restart clrPlot: ;clears the _plotSScrn ld hl,$C9FA ;this routine written by Dark Ryder ld de,$C9FB ;no need to explain ld bc,$3FF ld a,(hl) ldir ret Invert: ;Inverts a 7 line place on the screen. ld bc,112 ;written by Andreas Ess InvertLoop: ld a,(hl) cpl ld (hl),a inc hl dec bc ld a,b or c jr nz,InvertLoop ret PrevVar: xor a ;clear a call _PrevVar ;the actuall call xor a ;clear it again ret c ;return if no more found jr DispInfo ;else Display the pictures name NextVar: ;Finds the next Picture xor a ;clear a call _NextVar ;opposite of $514F xor a ret c ;same as above jr DispInfo ;blah, blah DispInfo: ld hl,$0302 ;place to start text ld (_curRow),hl ;load it into _penCol ld hl,_OP1+2 ;what to display call _puts ;output to screen ld hl,ClearLine ;add spaces to end to cover up previous picture if was a longer name call _puts ;output ld hl,$0D02 ld (_curRow),hl xor a ;clear a call _push_OP1 rst 10h ld a,b ; ld h,d ;move pointer bcd->ahl ld l,e ; call _get_word_ahl ex de,hl xor a ;clear a call _dispahl ;display hl (a is 0 so it wont show) call _pop_OP1 ;pop op1 ret DrawPic: rst 10h ld a,b ex de,hl call _load_ram_ahl inc hl inc hl ld de,$FC00 ld bc,$3F0 ldir call _runon call $4D40 jp ASMstart Exit: jp _clrScrn ;clear it again and dont come back! ;<------------ Strings used in program--------------> ByteString: .db " bytes",0 NoPics: .db "No Pictures!",0 System: .db " Free Mem ",0 PixMenu: .db " Picture Size ",0 FirstPic: .db $11,$01,$00 ClearLine: .db $00,$00,$00,$00,$00,$00,$00,0 EMail: .db "chicane@reninet.com",0 PrgmName: .db "Pic Viewer",0 Version: .db "Version 0.5",0 .end