;sorry, but this source is not very commented. ;i may do this later, and upload it separatly. #include "asm86.h" #include "ti86asm.inc" altflags equ $23 ;iy offset altfont equ 0 ;enable user font altexec equ 2 ;enable user interrupt routine alton equ 3 ;enable user on routine altlink equ 4 ;enable user link routine altexpr equ 6 ;enable [sqrt]EXPR altoff equ 7 ;enable user off routine eshflags equ $24 ;iy offset eshparse equ 0 ;enable [sqrt]PARSE eshform equ 1 ;enable [sqrt]FORM eshexec equ 2 ;enable [sqrt]EXEC eshhome equ 4 ;enable [sqrt]HOME eshcmdtok equ 5 ;enable [sqrt]CMDTOK eshkey equ 6 ;enable [sqrt]KEY eshgrf equ 7 ;enable [sqrt]GRF sqrtEXPR equ $5988 sqrtPARSE equ $59b3 sqrtEXEC equ $59f4 sqrtFORM equ $5a13 sqrtCMDTOK equ $5a37 sqrtHOME equ $5a69 sqrtKEY equ $5a92 sqrtGRF equ $5ab6 .org _asm_exec_ram ;---------------------------------Identification Junk------------ nop jp Page1 .dw $0000 .dw Descript ;----------------------------------------------------------------- Page1: call DispTitle ;displays the top bar call DAltFont call DAltExec call DAltOn call DAltLink call DAltExpr call DAltOff jp Setup1 DispTitle: call _runindicoff ;take a wild guess call _clrScrn ;clear LCD and Text Shadow ld hl,$0001 ;propare to put text here ld (_penCol),hl ;load it to the proper place ld hl,TitleStr ;load the text to output call _vputs ;system call to display variable width text ld hl,$FC00 ;Video Memory Address to put bar call Invert ;inverts 7 lines of the screen starting at hl ret DAltFont: ld hl,$0802 ld (_penCol),hl ld hl,AltFont call _vputs ld a,$6E ld (_penCol),a bit altfont,(iy+altflags) ;check if altfont is installed call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret DAltExec: ld hl,$1002 ld (_penCol),hl ld hl,AltExec call _vputs ld a,$6E ld (_penCol),a bit altexec,(iy+altflags) call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret DAltOn: ld hl,$1802 ld (_penCol),hl ld hl,AltOn call _vputs ld a,$6E ld (_penCol),a bit alton,(iy+altflags) call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret DAltLink: ld hl,$2002 ld (_penCol),hl ld hl,AltLink call _vputs ld a,$6E ld (_penCol),a bit altlink,(iy+altflags) call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret DAltExpr: ld hl,$2802 ld (_penCol),hl ld hl,AltExpr call _vputs ld a,$6E ld (_penCol),a bit altexpr,(iy+altflags) call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret DAltOff: ld hl,$3002 ld (_penCol),hl ld hl,AltOff call _vputs ld a,$6E ld (_penCol),a bit altoff,(iy+altflags) call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret Setup1: ld a,$07 ld (Items),a ld hl,Pos ld (hl),$01 call MakeNew GetKey1: call _getkey cp kExit jp z,Exit cp kUp call z,MoveUp cp kDown call z,MoveDown cp kNext jp z,Page2 cp kVarx jp z,Check1 jr GetKey1 Check1: ld a,(Pos) cp $01 jp z,SAltFont cp $02 jp z,SAltExec cp $03 jp z,SAltOn cp $04 jp z,SAltLink cp $05 jp z,SAltExpr cp $06 jp z,SAltOff SAltFont: bit altfont,(iy+altflags) jr nz,FontSwitch set altfont,(iy+altflags) jr FontDone FontSwitch: res altfont,(iy+altflags) FontDone: call DelOld call DAltFont call MakeNew jp GetKey1 SAltExec: bit altexec,(iy+altflags) jr nz,ExecSwitch set altexec,(iy+altflags) jr ExecDone ExecSwitch: res altexec,(iy+altflags) ExecDone: call DelOld call DAltExec call MakeNew jp GetKey1 SAltOn: bit alton,(iy+altflags) jr nz,OnSwitch set alton,(iy+altflags) jr OnDone OnSwitch: res alton,(iy+altflags) OnDone: call DelOld call DAltOn call MakeNew jp GetKey1 SAltLink: bit altlink,(iy+altflags) jr nz,LinkSwitch set altlink,(iy+altflags) jr LinkDone LinkSwitch: res altlink,(iy+altflags) LinkDone: call DelOld call DAltLink call MakeNew jp GetKey1 SAltExpr: bit altexpr,(iy+altflags) jr nz,ExprSwitch set altexpr,(iy+altflags) jr ExprDone ExprSwitch: res altexpr,(iy+altflags) ExprDone: call DelOld call DAltExpr call MakeNew jp GetKey1 SAltOff: bit altoff,(iy+altflags) jr nz,OffSwitch set altoff,(iy+altflags) jr OffDone OffSwitch: res altoff,(iy+altflags) OffDone: call DelOld call DAltOff call MakeNew jp GetKey1 Page2: ;the second page of info call DispTitle ;put the title bar back again call DParse call DForm call DExec call DHome call DCmdTok call DKey call DGrf jp Setup2 DParse: ld hl,$0802 ld (_penCol),hl ld hl,EshParse call _vputs ld a,$66 ld (_penCol),a ld hl,sqrtPARSE rst 20h rst 10h call c,SetNo call nc,SetYes call _vputs bit eshparse,(iy+eshflags) call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret DForm: ld hl,$1002 ld (_penCol),hl ld hl,EshForm call _vputs ld a,$66 ld (_penCol),a ld hl,sqrtFORM rst 20h rst 10h call c,SetNo call nc,SetYes call _vputs bit eshform,(iy+eshflags) call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret DExec: ld hl,$1802 ld (_penCol),hl ld hl,EshExec call _vputs ld a,$66 ld (_penCol),a ld hl,sqrtEXEC rst 20h rst 10h call c,SetNo call nc,SetYes call _vputs bit eshexec,(iy+eshflags) call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret DHome: ld hl,$2002 ld (_penCol),hl ld hl,EshHome call _vputs ld a,$66 ld (_penCol),a ld hl,sqrtHOME rst 20h rst 10h call c,SetNo call nc,SetYes call _vputs bit eshhome,(iy+eshflags) call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret DCmdTok ld hl,$2802 ld (_penCol),hl ld hl,EshCmdTok call _vputs ld a,$66 ld (_penCol),a ld hl,sqrtCMDTOK rst 20h rst 10h call c,SetNo call nc,SetYes call _vputs bit eshcmdtok,(iy+eshflags) call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret DKey: ld hl,$3002 ld (_penCol),hl ld hl,EshKey call _vputs ld a,$66 ld (_penCol),a ld hl,sqrtKEY rst 20h rst 10h call c,SetNo call nc,SetYes call _vputs bit eshkey,(iy+eshflags) call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret DGrf: ld hl,$3802 ld (_penCol),hl ld hl,EshGrf call _vputs ld a,$66 ld (_penCol),a ld hl,sqrtGRF rst 20h rst 10h call c,SetNo call nc,SetYes call _vputs bit eshgrf,(iy+eshflags) call nz,SetOn call z,SetOff ;display yes if it is. no if it isn't call _vputs ret Setup2: ld a,$08 ld (Items),a ld hl,Pos ld (hl),$01 call MakeNew GetKey2: call _getkey cp kExit jp z,Exit cp kUp call z,MoveUp cp kDown call z,MoveDown cp kNext jp z,Page1 cp kVarx jp z,Check2 jr GetKey2 Check2: ld a,(Pos) cp $01 jp z,SParse cp $02 jp z,SForm cp $03 jp z,SExec cp $04 jp z,SHome cp $05 jp z,SCmdTok cp $06 jp z,SKey cp $07 jp z,SGrf SParse: ld hl,sqrtPARSE rst 20h rst 10h jp c,GetKey2 bit eshparse,(iy+eshflags) jr nz,ParseSwitch set eshparse,(iy+eshflags) jr ParseDone ParseSwitch: res eshparse,(iy+eshflags) ParseDone: call DelOld call DParse call MakeNew jp GetKey2 SForm: ld hl,sqrtFORM rst 20h rst 10h jp c,GetKey2 bit eshform,(iy+eshflags) jr nz,FormSwitch set eshform,(iy+eshflags) jr FormDone FormSwitch: res eshform,(iy+eshflags) FormDone: call DelOld call DForm call MakeNew jp GetKey2 SExec: ld hl,sqrtEXEC rst 20h rst 10h jp c,GetKey2 bit eshexec,(iy+eshflags) jr nz,ExeSwitch set eshexec,(iy+eshflags) jr ExeDone ExeSwitch: res eshexec,(iy+eshflags) ExeDone: call DelOld call DExec call MakeNew jp GetKey2 SHome: ld hl,sqrtHOME rst 20h rst 10h jp c,GetKey2 bit eshhome,(iy+eshflags) jr nz,HomeSwitch set eshhome,(iy+eshflags) jr HomeDone HomeSwitch: res eshhome,(iy+eshflags) HomeDone: call DelOld call DHome call MakeNew jp GetKey2 SCmdTok ld hl,sqrtCMDTOK rst 20h rst 10h jp c,GetKey2 bit eshcmdtok,(iy+eshflags) jr nz,CmdSwitch set eshcmdtok,(iy+eshflags) jr CmdDone CmdSwitch: res eshcmdtok,(iy+eshflags) CmdDone: call DelOld call DCmdTok call MakeNew jp GetKey2 SKey: ld hl,sqrtKEY rst 20h rst 10h jp c,GetKey2 bit eshkey,(iy+eshflags) jr nz,KeySwitch set eshkey,(iy+eshflags) jr KeyDone KeySwitch: res eshkey,(iy+eshflags) KeyDone: call DelOld call DKey call MakeNew jp GetKey2 SGrf: ld hl,sqrtGRF rst 20h rst 10h jp c,GetKey2 bit eshgrf,(iy+eshflags) jr nz,GrfSwitch set eshgrf,(iy+eshflags) jr GrfDone GrfSwitch: res eshgrf,(iy+eshflags) GrfDone: call DelOld call DGrf call MakeNew jp GetKey2 Exit: jp _clrScrn MoveUp: call DelOld ;take out the old bar ld hl,Pos ;get the old pos dec (hl) ;down one ld a,$00 ;used to see if its at the top cp (hl) ; the check call z,ScrollDown ;where to go if it is at the top call MakeNew ;draw a new bar xor a ret MoveDown: call DelOld ld hl,Pos inc (hl) ld a,(Items) cp (hl) call z,ScrollUp call MakeNew xor a ret ScrollUp: ld hl,Pos ;check position pointer ld (hl),$01 ;put it back at the top ret ScrollDown: ld hl,Pos ld a,(Items) dec a ld (hl),a ret MakeNew: ld a,(Pos) ;load the position 1-7 ld h,a ;into h ld l,$80 ; call MUL_HL ;Position*80=New Position ld de,$FC00 ;add offset add hl,de call Invert ;draw the bar ret DelOld: ld a,(Pos) ld h,a ld l,$80 call MUL_HL ld de,$FC00 add hl,de call Invert ret Invert: ld bc,112 InvertLoop: ld a,(hl) cpl ld (hl),a inc hl dec bc ld a,b or c jr nz,InvertLoop ret SetYes: ld hl,YesMsg ret SetNo: ld hl,NoMsg ret SetOff: ld hl,OffMsg ret SetOn: ld hl,OnMsg ret ;-------------Strings Used in Prog------------- TitleStr: .db "System Manager by Chicane v.1",0 Descript: .db "System Manager",0 YesMsg: .db "Yes/",0 NoMsg: .db "No/",0 OnMsg: .db "On ",0 OffMsg: .db "Off",0 AltFont: .db "User Defined Fonts",0 AltExec: .db "User Interrupt Routine",0 AltOn: .db "User-On Routine",0 AltLink: .db "User Link Routine",0 AltExpr: .db "User Expression Routine",0 AltOff: .db "User-Off Routine",0 EshParse: .db $10,"Parse",0 EshForm: .db $10,"Form",0 EshExec: .db $10,"Exec",0 EshHome: .db $10,"Home",0 EshCmdTok: .db $10,"CmdTok",0 EshKey: .db $10,"Key",0 EshGrf: .db $10,"Grf",0 Pos: .db 0 Items: .db 0 .end