home *** CD-ROM | disk | FTP | other *** search
- ;DosShell 83z v. 0.93
- ;By: Ahmed El-Helw
- ;August 5, 1997
- ;Copyright (C) 1997
-
- .NOLIST
- #define equ .equ
- #define EQU .equ
- #define end .end
- #include "Ti83asm.inc"
- .INCLUDE "tokens.inc"
- .LIST
- #DEFINE curcont 8265h ;This is var for the contrast
- kEnter .EQU 05h
- kQuit .EQU 40h
-
- .org 9327h
-
- maininit:
- call _clrLCDFull ;Clear Screen
- call _runIndicOff ;Turns off Runindicator
- ld a,44d
- ld (curcont),a
-
- init:
- call _clrLCDFull
- call _grbufcpy_v ;Copys Graph to screen
- SET textinverse, (iy+textflags) ;Toggle text inverse on
- call _homeup ;Goto 0,0 of screen
- ld hl,doshell ;Load String DosShell
- call _puts ;Required to end string on screen
- RES textinverse, (iy+textflags) ;Reset text inverse (off)
- ld hl,10*256+15 ;ld Penrow*256+pencol into hl
- ld (pencol),hl ;load hl into pencol
- ld hl,author ;Load string author
- call _vputs ;Required string to end string on screen
- ld hl,17*256+25
- ld (pencol),hl
- ld hl,dir
- call _vputs
-
- ;------------Edit Here ----------------------------
- ld hl,25*256+15
- ld (pencol),hl
- ld hl,option1
- call _vputs
- ld hl,32*256+15
- ld (pencol),hl
- ld hl,option2
- call _vputs
- ld hl,39*256+15
- ld (pencol),hl
- ld hl,option3
- call _vputs
-
- ;------------End Edit Here ----------------------------
-
-
- ;------------Edit Here ----------------------------
-
- mainloop: ;Main program loop, with direct input
- ld a,0ffh ;Reset port
- out (1),a
- ld a,0fdh ;Loads in the new key port to search for key in
- out (1),a
- in a,(1)
- cp 191 ;If key is clear
- jp z,quit ;Exit label (quit)
- cp 253 ;If key is plus
- jp z,more ;Increase contrast label (more)
- cp 251 ;If key is minus
- jp z,less ;decrease contrast label (less)
- cp 239 ;If key is Divided By
- jp z,directory
- cp 247
- jp z,off
- ld a,0ffh
- out (1),a
- ld a,0efh
- out (1),a
- in a,(1)
- cp 253
- jp z,one
- ld a,0ffh
- out (1),a
- ld a,0f7h
- out (1),a
- in a,(1)
- cp 253
- jp z,two
- ld a,0ffh
- out (1),a
- ld a,0fbh
- out (1),a
- in a,(1)
- cp 253
- jp z,three
- jp nz,mainloop
-
- ;-----------End Editions-----------------
-
- more: ;increase contrast by 1d
- call delay
- ld a,(curcont) ;Loads current contrast from var into a
- cp 62d ;If max
- jp z,nomore ;Goto no more
- ld a,(curcont)
- ld b,1d ;Load 1d to b
- add a,b ;Add a and b
- ld (curcont),a ;Load a into var
- ld a,(curcont)
- or 0C0h ;Actually change contrast
- call _lcd_busy
- out (LCDINSTPORT),a
- jp mainloop
- less: ;decrease contrast
- call delay
- ld a,(curcont)
- cp 23d
- jr z,noless
- ld a,(curcont)
- ld b,1d
- sub b
- ld (curcont),a
- ld a,(curcont)
- or 0C0h
- call _lcd_busy
- out (LCDINSTPORT),a
- jp mainloop
- nomore:
- jp mainloop
- noless:
- jp mainloop
-
- ;-------------------Edit Here-------------------------------
- one:
- call _clrLCDFull ;Clear Screen
- ld a,1 ;Load 1->a
- call _setxxop1 ;Store a to OP1
- call _stox ;Store op 1 to "X", the calculator basic x
- jp exit ;Goto exit
-
- two:
- call _clrLCDFull
- ld a,2
- call _setxxop1
- call _stox
- jp exit
-
- three:
- call _clrLCDFull
- ld a,3
- call _setxxop1
- call _stox
- jp exit
-
- ;--------------------End Editions Here ----------------------------------
-
- delay: ;Produces a delay
- PUSH AF
- PUSH BC
- LD BC, $3000
- delayLoop:
- DEC BC
- LD A, B
- OR C
- JR NZ, delayLoop
- POP BC
- POP AF
- ret
-
- Directory:
- call _clrLCDFull
- LD HL, (PROGPTR) ; get offset to program/list table
-
- LD A, 4 ; four programs/keypress
-
- main_loop:
- LD (count), A ; store latest update of count
-
- LD A, (HL) ; get type of data
- AND 01FH ; mask out bits 0-4
-
- CP 05H ; program
- JR Z, program
- CP 06H ; protected program
- JR Z, program
-
- CP 01H ; real list
- JR Z, list
-
- CP 0DH ; complex list
- JR Z, list
-
- JR the_end ; unknown/end of list
-
- program:
- DEC HL ; move back 3 bytes to length-of-name
- DEC HL
- DEC HL
-
- CP 06h ; display '*' for protected programs
- JR Z, protected
- LD A, ' '
- JR go_on
-
- protected:
- LD A, '*'
-
- go_on:
- CALL _PUTC
-
- LD B, (HL) ; load length-of-string
-
- program_loop:
- DEC HL ; move backwards to next char
- LD A, (HL) ; load char
- CALL _PUTC ; display char
- DJNZ program_loop
-
- DEC HL ; move backwards to next item
- CALL _NEWLINE
-
- LD A, (count) ; have we displayed four programs?
- DEC A
- JR NZ, main_loop
-
- key_loop:
- PUSH HL
- CALL _GETKEY ; wait for key
- POP HL
- CP kQuit
- JR Z, the_end
- CP kEnter ; enter key?
- JR NZ, key_loop ; no
- LD A, 4 ; four programs/keypress
- JR main_loop
-
- list:
- DEC HL ; move back 3 bytes to length-of-name
- DEC HL
- DEC HL
- LD B, (HL) ; load length-of-string
- list_loop:
- DEC HL ; move backwards to next char
- DJNZ list_loop
-
- DEC HL ; move backwards to next item
-
- LD A, (count) ; no change really, load A
- JP main_loop
-
- the_end:
- call wfk
- jp init
- wfk:
- call _getkey
- cp kEnter
- jp nz,wfk
- ret
-
- quit:
- ld a,0
- call _setxxop1
- call _stox
- jp exit
-
-
- exit:
- call _clrLCDFULL
- ret
-
- off:
- DI ; disable interrupts
- LD A,001H
- OUT (003H),A ; turn off screen
- LD A,000H
- OUT (004H),A
- EX AF,AF'
- EXX
- EI ; enable interrupts
- jp init
-
- doshell:
- .db "DosShell v. 0.93",0
- author:
- .db "By: Ahmed El-Helw",0
- dir:
- .db "M - Dir C:\>",0
- count:
- .DB 00h
-
- ;----------------Edit Here ---------------
-
- option1:
- .db " 1. Spaze Invaders ",0
- option2:
- .db " 2. Insane Game ",0
- option3:
- .db " 3. Turbo Breakout II ",0
-
- ;--------------End Edit Here -------------
-
- .end
- END
-