Subversion Repositories aysalia

Compare Revisions

Regard whitespace Rev 26 → Rev 27

/trunk/Aysalia DOS/AyDos.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/Aysalia DOS/AyDos.mnu
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/Aysalia DOS/Source/AyDos.dpr
8,6 → 8,12
// centers the window and changes the window title and icon at runtime.
 
uses
 
 
 
dialogs,
 
 
SysUtils,
ShellAPI,
Windows,
17,6 → 23,7
 
const
DOSBOX_EXE = 'DOSBox.exe';
AYDOS_MNU = 'AyDos.mnu';
 
var
hPsApiDll: Cardinal = 0;
179,10 → 186,52
until (result <> WAIT_TIMEOUT);
end;
 
function CanRunDosBox: boolean;
var
windir: array[0..MAX_PATH] of char;
osVerInfo: TOSVersionInfo;
begin
osVerInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
if GetVersionEx(osVerInfo) then
begin
// DOSBox does not work with Windows 95
// It works on Windows 98 (but the VC++ Runtime must be installed)
if osVerInfo.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS then
begin
result := (osVerInfo.dwMajorVersion > 4) or
((osVerInfo.dwMajorVersion = 4) and (osVerInfo.dwMinorVersion >= 10{Win98}));
end
else if osVerInfo.dwPlatformId = VER_PLATFORM_WIN32_NT then
begin
result := true;
end
else
begin
// This should not happen
result := false;
end;
end
else
begin
if GetWindowsDirectory(windir, sizeof(windir)) > 0 then
begin
// In case GetVersionEx fails, we are trying to see if command.com exists
result := FileExists(windir + '\command.com');
end
else
begin
// This should never happen
result := false;
end;
end;
end;
 
function Main: Integer;
var
sFile: string;
begin
if CanRunDosBox then
begin
ShellExecuteWait(0, 'open', DOSBOX_EXE, '-noconsole -conf DOSBox.conf',
PChar(ExtractFilePath(ParamStr(0))), SW_NORMAL);
 
191,6 → 240,18
 
sFile := IncludeTrailingBackslash(ExtractFilePath(ParamStr(0))) + 'stderr.txt';
if FileExists(sFile) then DeleteFile(PChar(sFile));
end
else
begin
// SEE_MASK_CLASSNAME cannot be used with pure MZ files (it does only work for NE/PE files!)
// So we need to do the dirty rename-hack...
RenameFile('AyDos.mnu', 'AyDos.com');
try
ShellExecuteWait(0, 'open', 'AyDos.com', '', PChar(ExtractFilePath(ParamStr(0))), SW_NORMAL);
finally
RenameFile('AyDos.com', 'AyDos.mnu');
end;
end;
 
result := 0;
end;
/trunk/Aysalia DOS/Source/AyDos.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/Aysalia DOS/Source/Menu/AyDos.mnu
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/Aysalia DOS/Source/Menu/AyDosMnu.asm
5,7 → 5,7
; (C) 2018 Daniel Marschall, ViaThinkSoft
 
.model small
.stack 10h
.stack 100h
 
; -------------------------------------------------------
 
82,6 → 82,23
setup_paramblk ENDP
 
set_numlock_on PROC
push es
 
; In Windows 98+, we cannot access the BIOS Data Area,
; so we use this technique to check if we are inside Windows.
; This code was taken from http://www.fysnet.net/chkwin.htm
xor ax,ax ; point es:di to 0000:0000h
mov es,ax ;
mov di,ax ;
mov ax,1602h ; Get API entry point
int 2Fh ; call to multiplex interrupt
mov ax,es ;
or ax,ax ; if es:di doesn't point to 0000:0000h
jnz short is_win ; then Windows is running a DOS box
or di,di ; else
jnz short is_win ; we are in True DOS
 
; Now the actual code that sets numlock on
push ds
mov ax, 40h
mov ds, ax ; Go to BIOS Data Area ( http://stanislavs.org/helppc/bios_data_area.html )
90,6 → 107,9
or al, 20h ; Set bit 5 (numlock) to 1
mov [bx], al ; Write
pop ds
is_win:
pop es
ret
set_numlock_on ENDP
 
140,8 → 160,8
print_color_string_again:
mov bx, dx
mov al, [bx]
cmp al, 0 ; is the character zero? then we are done
je print_color_string_end
test al, al ; is the character zero? then we are done
jz print_color_string_end
mov bl, cl
int 10h
add dx, 1 ; go to next character
265,11 → 285,15
call setup_paramblk
 
; Start game 1
mov ax, @data ; ds:dx = ASCIZ program name (must include extension)
mov ds, ax
lea dx, exename1
mov ax, @data ; es:bx = Parameter block
mov es, ax
mov bx, paramblk
mov ah, 4Bh ; execute
mov al, 00h ; load and execute
mov bx, paramblk
lea dx, exename1
int 21h
int 21h ; DOS API
; Is everything OK? Or is the GAM file missing?
jc error
285,11 → 309,15
call setup_paramblk
 
; Start game 2
mov ax, @data ; ds:dx = ASCIZ program name (must include extension)
mov ds, ax
lea dx, exename2
mov ax, @data ; es:bx = Parameter block
mov es, ax
mov bx, paramblk
mov ah, 4Bh ; execute
mov al, 00h ; load and execute
mov bx, paramblk
lea dx, exename2
int 21h
int 21h ; DOS API
; Is everything OK? Or is the GAM file missing?
jc error