1 ; _____________________________________________ 2 ; | | 3 ; | Project: APPLER | 4 ; | File: HELP.ASM | 5 ; | Compiler: 16-bit TASM (2.5) | 6 ; | | 7 ; | Subject: Help Screen | 8 ; | | 9 ; | Author: Emil Dotchevski | 10 ; |_____________________________________________| 11 12 include GLOBALS.INC 13 include INTERFAC.INC 14 include CONIO.INC 15 16 Help segment public 17 assume cs:Help,ds:Help,es:Emulate 18 19 ScreenIOParams SIO_ParamStruc <1,Help,0,0,offset Screen,seg Screen,1,0,1,1> 20 GetKeyParams RK_ParamStruc <1,Fkey,0,0,0,?,ShowAll,0> 21 22 Print macro y,x,Str 23 gotoxy y,x 24 mov bx,offset Str 25 ScreenIOservice _STRINGPRINT 26 endm 27 28 29 HelpInInit proc far 30 cli 31 push ax ds es 32 mov ax,Emulate 33 mov es,ax 34 mov al,es:[C000] 35 mov cs:KeyPressed,al 36 mov es:[C000],0 37 call DebugKeysOn 38 assume ds:CONio 39 mov ax,CONio 40 mov ds,ax 41 mov SIO_ParamsOfs, offset ScreenIOParams 42 mov SIO_ParamsSeg, seg ScreenIOParams 43 mov RK_ParamsOfs, offset GetKeyParams 44 mov RK_ParamsSeg, seg GetKeyParams 45 pop es ds ax 46 call UnSetBreaks 47 sti 48 ret 49 HelpInInit endp 50 51 KeyPressed db 0 52 HelpOutInit proc far 53 cli 54 push ax es 55 mov ax,Emulate 56 mov es,ax 57 mov al,KeyPressed 58 mov es:[C000],al 59 mov ax,seg T_Iflags 60 mov es,ax 61 assume es:seg T_Iflags 62 mov byte ptr es:T_Iflags,00000010b 63 assume es:Emulate 64 pop es ax 65 call AppleKeysOn 66 call SetBreaks 67 ret 68 HelpOutInit endp 69 70 assume cs:Help,ds:Help,es:Emulate 71 72 HelpMainRet: push cs 73 pop ds 74 HelpLoop: call ReadKey 75 cmp al,0Ch 76 jne HelpLoop 77 call GoAppleII 78 jmp HelpLoop 79 80 81 Fkey proc far 82 cmp al,9 83 jne FkeyRet 84 call GoAppleII 85 FkeyRet: ret 86 Fkey endp 87 88 89 90 ShowAll proc far 91 push ax bx cx dx si bp ds es 92 push cs 93 pop ds 94 ScreenIOservice _CLEARSCREEN 95 call ShowTitle 96 call ShowKeys 97 call ShowHints 98 call ShowFuncKeys 99 pop es ds bp si dx cx bx ax 100 ret 101 ShowAll endp 102 103 104 ; -- Draw box -------------------------- 105 ; Entry: 106 ; AH = Active Flag Bit 107 ; CX = HTAB & VTAB 108 ; BX = Offset of the strings 109 ; DL = Length of the box line - 1 110 ; DH = Number of lines - 1 111 ; Destroy: 112 ; AX,BX,CX,DX 113 DB_CX dw ? 114 DrawBox: mov ax,cx 115 add ax,80 * 2 116 mov cs:DB_CX,ax 117 mov ah,7 118 ScreenIOservice _STRINGPRINT 119 mov bx,ScreenIOparams.SP_bx 120 dec dh 121 mov al,dh 122 mov dx,cs:DB_CX 123 DB_Loop1: mov cx,dx 124 add dx,80 * 2 125 ScreenIOservice _STRINGPRINT 126 dec al 127 jnz DB_Loop1 128 mov cx,dx 129 mov bx,ScreenIOparams.SP_bx 130 ScreenIOservice _STRINGPRINT 131 ret 132 133 134 135 STi_Str db 1,3Fh,' APPLER HELP SCREEN ',0 136 ShowTitle: print 1,0,STi_Str 137 ret 138 139 ST_Str db 'ÚKeysÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿',0 140 db '³ ³',0 141 db 'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ',0 142 ST_Str1 db 1,0Fh,'At any time:',0 143 ST_Str2 db 1,7,' Debugger',0 144 ST_Str3 db 1,7,' File Manager',0 145 ST_Str4 db 1,7,' Disk Manager',0 146 ST_Str5 db 1,7,' Keyboard Setup',0 147 ST_Str6 db 1,7,' About Appler',0 148 ST_Str7 db 1,7,' This Help Srceen',0 149 ST_Str8 db 1,7,' DOS Shell',0 150 ST_Str9 db 1,7,' Quit Appler',0 151 ST_Str10 db 1,0Fh,'While the Apple ][ is running:',0 152 ST_Str11 db 1,7,' Apple ][ Reset',0 153 ST_Str12 db 1,7,' Toggle Realtime Mode',0 154 ShowKeys: gotoxy 3,0 155 mov bx,offset ST_Str 156 mov dh,17 157 call DrawBox 158 print 5,2,ST_Str1 159 print 7,4,ST_Str2 160 print 8,4,ST_Str3 161 print 9,4,ST_Str4 162 print 10,4,ST_Str5 163 print 11,4,ST_Str6 164 print 12,4,ST_Str7 165 print 13,4,ST_Str8 166 print 14,4,ST_Str9 167 print 16,2,ST_Str10 168 print 18,4,ST_Str11 169 print 19,4,ST_Str12 170 ret 171 172 SE_Str db 'ÚSome HintsÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿',0 173 db '³ ³',0 174 db 'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ',0 175 SE_Str1 db 1,0Fh,'To boot a disk:',1,7,' Enter Disk Manager,',0 176 SE_Str2 db 1,7,'highlight the .DSK file you want to',0 177 SE_Str3 db 1,7,'boot, then press the key.',0 178 SE_Str4 db 1,0Fh,'To run a file:',1,7,' Enter File Manager,',0 179 SE_Str5 db 1,7,'highlight the .APL file you want to',0 180 SE_Str6 db 1,7,'run, then press the key.',0 181 SE_Str7 db 1,0Fh,'To remap a key: ',1,7,'Enter Keyboard Setup',0 182 SE_Str8 db 1,7,'hit the key you want remapped, then',0 183 SE_Str9 db 1,7,'pick an ASCII code to assign to it.',0 184 SE_Str10 db 1,0Fh,'Realtime Mode:',1,7,' When realtime mode is',0 185 SE_Str11 db 1,7,'ON, the emulator matches the speed',0 186 SE_Str12 db 1,7,'of a real Apple ][ at 1 MHz. This',0 187 SE_Str13 db 1,7,'requires at least a 386 CPU, or else',0 188 SE_Str14 db 1,7,'realtime mode turns OFF, and the',0 189 SE_Str15 db 1,7,'emulator will likely run faster.',0 190 191 ShowHints: gotoxy 3,40 192 mov bx,offset SE_Str 193 mov dh,20 194 call DrawBox 195 print 5,42,SE_Str1 196 print 6,42,SE_Str2 197 print 7,42,SE_Str3 198 print 9,42,SE_Str4 199 print 10,42,SE_Str5 200 print 11,42,SE_Str6 201 print 13,42,SE_Str7 202 print 14,42,SE_Str8 203 print 15,42,SE_Str9 204 print 17,42,SE_Str10 205 print 18,42,SE_Str11 206 print 19,42,SE_Str12 207 print 20,42,SE_Str13 208 print 21,42,SE_Str14 209 print 22,42,SE_Str15 210 ret 211 212 213 SFK_Str db '1 2 3 4 5 ' 214 db '6 7 8 9 10 ',0 215 SFK_FkeysMain dw SFK_None,SFK_None,SFK_None,SFK_None,SFK_None 216 dw SFK_None,SFK_None,SFK_None,SFK_None,SFK_Apple 217 SFK_None db ' ',0 218 SFK_Apple db 1,3Fh,'Apple ',1,3Fh,0 219 220 ShowFuncKeys: gotoxy 19h,0 221 mov bx,offset SFK_Str 222 mov ah,7 223 ScreenIOservice _STRINGPRINT 224 gotoxy 19h,1 225 xor si,si 226 mov ah,3Fh 227 SFK_Loop0: mov bx,cs:SFK_FkeysMain[si] 228 ScreenIOservice _STRINGPRINT 229 add cx,4 230 add si,2 231 cmp si,20 232 jb SFK_Loop0 233 ret 234 235 GoAppleII: push ax es 236 mov ax,Emulate 237 mov es,ax 238 mov al,C050 239 ScreenIOservice _SetScreen 240 SwitchToProcess PID_EMULATOR 241 pop es ax 242 ret 243 244 Help ends 245 246 END