Shut up few DPRINT1s, and demote some DPRINT1s to DPRINTs but disable NDEBUG for now (enable it and you'll shut up the DPRINTs).
svn path=/branches/ntvdm/; revision=61451
Make colors appearing in CGA mode 4, but still buggy concerning the computation of the resolution (either the X-dimension is twice big or the Y-dimension is twice small), and the position of the pixels...
However the VGA registers are (almost) similar to http://www.brokenthorn.com/Resources/OSDevVid2.html and putting them equal to the settings given there don't change anything new...
svn path=/branches/ntvdm/; revision=61435
- Fix palette setting for EGA modes, fixes Rescue-Rover menu colors amongst others.
Some of the palettes were adapted (read: translated from DAC registers settings) from DOSBox;
and I've also used http://www.brokenthorn.com/Resources/OSDevVid2.html for some settings.
This should be reviewed to fix / remove redundancies or errors.
- Attempt to implement basic palette enablig/disabling flag (via AC palette regs).
- I've introduced (commented) DbgPrint's for testing AC regs setting. I will remove them when everything is ok.
svn path=/branches/ntvdm/; revision=61419
- BIOS: Fix setting video page parameters when setting mode, and effectively fix setting of video page (fix the involved CRTC registers !!).
Now Advanced NetWars works without flickering.
- VGA: Fix code presentation.
svn path=/branches/ntvdm/; revision=61390
Implement and export (and define in vddsvc.h) call_ica_hw_interrupt and VDDSimulateInterrupt macro.
ICA = Interrupt Controller Adapter (in windows terminology)
svn path=/branches/ntvdm/; revision=61372
Load VDDs registered in HKLM\SYSTEM\CurrentControlSet\Control\VirtualDeviceDrivers key, value "VDD" (of type REG_MULTI_SZ).
I still don't call FreeLibrary to unload them at the end of NTVDM's lifetime (otherwise we would have to store their handles in an array).
svn path=/branches/ntvdm/; revision=61370
- Implement and export VDDInstallIOHook and VDDDeInstallIOHook; rework EmulatorRead/WriteIo to take into account for different port handlers' sizes (byte, word, dword). Still WIP and may be subject to renamings... RegisterIoPort needs to be converted.
- Stubplement and export getIntelRegistersPointer.
- Export c_get/setXX functions which are aliases to get/setXX functions, for MIPS NTVDM compatibility.
svn path=/branches/ntvdm/; revision=61358
- Simplify EmulatorReadMemory (first MMIO-mapped devices copy their memory image back to the VM' memory area, then data is read via RtlCopyMemory), and EmulatorWriteMemory (simplify VgaBuffer computation and rename this variable accordingly, for readability purposes).
- Fix Sim32pGetVDMPointer and MGetVdmPointer prototypes.
svn path=/branches/ntvdm/; revision=61356
Hackplement BOP_CMD function 0x08: "Launch external command". Still WIP.
Explanation: Launching a command from command.com starts (under certain conditions not implemented there) "cmd.exe /c <the_command>"
See https://groups.google.com/forum/#!topic/microsoft.public.win2000.cmdprompt.admin/n5KbegKJuE0
and http://technet.microsoft.com/en-us/library/cc723564.aspx#XSLTsection123121120120
subsection "CMD.EXE and COMMAND.COM":
"Be aware that a command shell is not an MS-DOS command prompt, even though it shares the same icon.
The Windows NT command shell is a full 32-bit Windows NT console application that resides in the CMD.EXE executable file.
The MS-DOS command prompt is a 16-bit DOS application that resides in the COMMAND.COM executable file.
Because COMMAND.COM is a 16-bit DOS executable, Windows NT executes this shell within a Windows NT virtual DOS machine (VDM).
COMMAND.COM is supplied primarily for compatibility with MS-DOS.
[...]
This behavior reveals a quite subtle feature of Windows NT that is very important. The 16-bit MS-DOS shell (COMMAND.COM)
that ships with Windows NT is specially designed for Windows NT. When a command is entered for execution by this shell,
it does not actually execute it. Instead, it packages the command text and sends it to a 32-bit CMD.EXE command shell for
execution. Because all commands are actually executed by CMD.EXE (the Windows NT command shell), the 16-bit shell inherits
all the features and facilities of the full Windows NT shell."
svn path=/branches/ntvdm/; revision=61290
- Halfplement and export VdmMapFlat
- Make mention of the existence of VdmFlushCache and VdmUnmapFlat, which are not exported in x86 builds (macros are therefore defined to just return TRUE) but are exported in MIPS... builds...
See VDDSVC.H and NT_VDD.H in the DDK
(those headers don't exist in ROS; we'll have to create them later on).
svn path=/branches/ntvdm/; revision=61288
Studying the "vddtest" example mentioned in revision 61283 allowed me to see that valid VDD DLL "handles" start at 1 and cannot be equal to zero.
Add helper macros to convert from indices to handles. Fixes "vddtest" example.
Have fun at running it :)
svn path=/branches/ntvdm/; revision=61287
- Thanks Thomas for having pointed me towards the fact that the NTVDM exports were really STDCALL and not CDECL (as I've thought first, because originally I was checking whether the getXX() functions were stdcall or not, and distinguishing VOID stdcall or cdecl functions without the symbols was hopeless).
- Halfplement and export Sim32pGetVDMPointer and MGetVdmPointer, needed to run correctly the RageStorm "galaxy" sample mentioned yesterday (see revision 61283). Now it loads and the dispatch call works \o/
- VDD_INIT_PROC and VDD_DISPATCH_PROC have the same signature --> rename them to VDD_PROC.
Have fun at testing!
svn path=/branches/ntvdm/; revision=61286
Implement basic VDD support:
implement the (un)register & dispatch call BOP (called BOP_3RDPARTY): see "Undocumented DOS" by Schulman et al. page 267 (as always ;) ), as well as:
http://www.ragestorm.net/tutorial?id=27 - "Tutorial - Calling Win32 from DOS"
http://www.airborn.com.au/layout/vddtest.html - "DOS to 32 bit DLL under XP - an example" (almost the same explanations as the previous article)
http://sta.c64.org/blog/dosvddaccess.html - "Accessing Windows device drivers from DOS programs"
and...
... your lovely Win2k / Win2k3 DDK section: "Device Technologies/Other Devices/Devices Requiring VDDs" !!
Ready to test? :D
svn path=/branches/ntvdm/; revision=61283
- As already done for interrupts and I/O ports, add a registering system for BOPs.
- INT32: Move ControlBop to the 32-bit interrupts module where it is used only.
- DOS: Add (un)documented BOP_DOS (0x50) and BOP_CMD(0x54) used respectively by NTIO.SYS/NTDOS.SYS and by COMMAND.COM.
It appears that they take an extra parameter (so, skip 1 byte-instruction after the BOP instruction as we do for the Control BOP 0xFF).
See "Undocumented DOS 2nd edition" by Schulman et al., page 267.
svn path=/branches/ntvdm/; revision=61278
- Add/fix few comments;
- Don't forget to redisable access to AC registers after modifying them in int 10h. Usurp, please retest Rescue Rover 2 :)
- Make EmulatorGet/Set/ClearFlag internal functions only and use set/get<FLAG> instead.
svn path=/branches/ntvdm/; revision=61263
Fix the file reading subfunction (AH = 3Fh) of INT 21h.
When reading from the console, it always stops on a carriage return.
svn path=/branches/ntvdm/; revision=61256
Rewrite the VGA emulation.
Nah, it's a joke!
- Store VGA registers setup in VGA_REGISTERS structure.
- Improve BiosSetVideoMode and introduce a VgaSetRegisters function for setting VGA regs.
- Initialize Bda->CrtBasePort: it is used to determine the address of some I/O ports which depend on whether we are in color or monochrome mode.
- Add UnregisterIoPort in io.c (and fix some DPRINTs) (needed for VGA).
- When setting the misc. VGA register, check whether we're going to monochrome emulation, and reset some port addresses in that case.
svn path=/branches/ntvdm/; revision=61246
- Last race condition fix (see revision 61230).
- Add a comment why we do twice the same emptiness check (one before holding the mutex and one just after).
svn path=/branches/ntvdm/; revision=61239
- Remove some DPRINTs.
- Fix a bug in VgaEnterGraphicsMode (erroneous change of the real saved resolution when going into DoubleVision(TM) mode).
- Do not update the text cursor when being in graphics mode (otherwise I've already hit some ScanlineSize==0 problems) <-- [TheFlash], can you recheck that, please?
- Little optimisation: do not do anything in VgaRefreshDisplay if nothing has to be done.
svn path=/branches/ntvdm/; revision=61157
- Move some PS/2 initialization from bios.c to ps2.c
- NULLify interrupt entries which are in fact pointers to data tables.
- Add a framework for adding I/O port handlers.
svn path=/branches/ntvdm/; revision=61107
The 486 doesn't have AC, VIF, VIP or ID.
Fix and simplify POPF.
[NTVDM]
Fix the count in the XMS copy function (INT 15h, AH = 87h).
svn path=/branches/ntvdm/; revision=61082
- Get rid of EmulatorGetRegister and EmulatorSetRegister and replace their calls with the proper definitions.
- Get rid of the enums EMULATOR_REG_* and use the FAST486_REG_* definitions instead.
svn path=/branches/ntvdm/; revision=61034
- Implement and export getEFLAGS and setEFLAGS.
- Do some code reorganization (move all registers-related functions into "registers.c").
svn path=/branches/ntvdm/; revision=61033