Login | ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/aysalia/trunk/Aysalia DOS/Source/Menu/AyDosMnu.asm
(Generate patch)

Comparing trunk/Aysalia DOS/Source/Menu/AyDosMnu.asm (file contents):
Revision 26 by daniel-marschall, Fri Dec 7 09:22:50 2018 UTC vs.
Revision 27 by daniel-marschall, Fri Dec 7 23:18:13 2018 UTC

# Line 5 | Line 5
5   ; (C) 2018 Daniel Marschall, ViaThinkSoft
6  
7   .model small
8 < .stack 10h
8 > .stack 100h
9  
10   ; -------------------------------------------------------
11  
# Line 82 | Line 82 | setup_paramblk PROC
82   setup_paramblk ENDP
83  
84   set_numlock_on PROC
85 +    push es
86 +
87 +    ; In Windows 98+, we cannot access the BIOS Data Area,
88 +    ; so we use this technique to check if we are inside Windows.
89 +    ; This code was taken from http://www.fysnet.net/chkwin.htm
90 +    xor     ax,ax         ; point es:di to 0000:0000h
91 +    mov     es,ax         ;  
92 +    mov     di,ax         ;
93 +    mov     ax,1602h      ; Get API entry point
94 +    int     2Fh           ;   call to multiplex interrupt
95 +    mov     ax,es         ;
96 +    or      ax,ax         ; if es:di doesn't point to 0000:0000h
97 +    jnz     short is_win  ;   then Windows is running a DOS box
98 +    or      di,di         ; else
99 +    jnz     short is_win  ;   we are in True DOS
100 +
101 +    ; Now the actual code that sets numlock on
102      push    ds
103      mov     ax, 40h
104      mov     ds, ax        ; Go to BIOS Data Area ( http://stanislavs.org/helppc/bios_data_area.html )
# Line 90 | Line 107 | set_numlock_on PROC
107      or      al, 20h       ; Set bit 5 (numlock) to 1
108      mov     [bx], al      ; Write
109      pop     ds
110 +    
111 + is_win:
112 +    pop es
113      ret
114   set_numlock_on ENDP
115  
# Line 140 | Line 160 | print_color_string PROC
160   print_color_string_again:
161      mov     bx, dx
162      mov     al, [bx]
163 <    cmp     al, 0         ; is the character zero? then we are done
164 <    je      print_color_string_end
163 >    test    al, al        ; is the character zero? then we are done
164 >    jz      print_color_string_end
165      mov     bl, cl
166      int     10h
167      add     dx, 1         ; go to next character
# Line 195 | Line 215 | print_gameover_message PROC
215      ; Keep cursor position
216  
217      ; Set background color
218 <    mov     bl, 4    ; dark red background
218 >    mov     bl, 4         ; dark red background
219      call    set_bg_color
220      
221      ; Set text color
222 <    mov     cl, 0Fh  ; white font
222 >    mov     cl, 0Fh       ; white font
223      lea     dx, gameover1
224      call    print_color_string
225      
# Line 265 | Line 285 | prog1:
285      call    setup_paramblk
286  
287      ; Start game 1
288 <    mov     ah, 4Bh       ; execute
289 <    mov     al, 00h       ; load and execute
270 <    mov     bx, paramblk
288 >    mov     ax, @data     ; ds:dx = ASCIZ program name (must include extension)
289 >    mov     ds, ax
290      lea     dx, exename1
291 <    int     21h
291 >    mov     ax, @data     ; es:bx = Parameter block
292 >    mov     es, ax
293 >    mov     bx, paramblk
294 >    mov     ah, 4Bh       ; execute
295 >    mov     al, 00h       ; load and execute
296 >    int     21h           ; DOS API
297      
298      ; Is everything OK? Or is the GAM file missing?
299      jc      error
# Line 285 | Line 309 | prog2:
309      call    setup_paramblk
310  
311      ; Start game 2
312 <    mov     ah, 4Bh       ; execute
313 <    mov     al, 00h       ; load and execute
290 <    mov     bx, paramblk
312 >    mov     ax, @data     ; ds:dx = ASCIZ program name (must include extension)
313 >    mov     ds, ax
314      lea     dx, exename2
315 <    int     21h
315 >    mov     ax, @data     ; es:bx = Parameter block
316 >    mov     es, ax
317 >    mov     bx, paramblk
318 >    mov     ah, 4Bh       ; execute
319 >    mov     al, 00h       ; load and execute
320 >    int     21h           ; DOS API
321      
322      ; Is everything OK? Or is the GAM file missing?
323      jc      error

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines