- Add a missing "goto Cleanup;"
- Add DPRINT1s at the beginning and the end of ntvdm, so that one can easily localize in debug logs where one started it. Suggested by Vampyre ;)
svn path=/branches/ntvdm/; revision=60860
Implement the CMOS and Real Time Clock (RTC).
Improve the performance of the PIT and RTC (correctly this time).
svn path=/branches/ntvdm/; revision=60854
Fix the type of a variable.
[NTVDM]
Introduce a BOP handler table for the 256 possible BOP functions and use it.
svn path=/branches/ntvdm/; revision=60818
Revert a previous incorrect fix for the PIT.
Modify the PitDecrementCount function to take a parameter instead
of it being called multiple times (which is slower).
svn path=/branches/ntvdm/; revision=60816
- Introduce a Fast486Initialize which is used to set up the CPU callbacks (and use default ones if some of the given callbacks are NULL), and to reset it the first time. Now Fast486Reset is meant to be used for only resetting the CPU to a safe state.
- Hence we are now sure that State->WhateverCallback is never NULL (and is theoretically valid), so don't do NULL-checks when calling them, but call them directly. The default cases for those checks become the default calls for the default callbacks.
- Remove the now-unneeded EmulatorIdle function.
svn path=/branches/ntvdm/; revision=60814
BOP numbers are 1 byte and map to a function (over 255). But one can pass additional "parameters" to those functions by adding extra bytes, however such functions must advance "by hand" the instruction pointer.
[NTVDM]
- Take into account our previous remark for the BIOS interrupt stubs, and comment them.
- Rework EmulatorBiosOperation (move almost all of its existing code into subfunctions in bop.c) so that one can call many other BOP functions in the future (WIP). The BOP number (still called) EMULATOR_INT_BOP (of value 0xFF) is used for internal 16 --> 32 bit switching for our 32bit bios.
- It appears that the IoRead/WriteCallback and IdleCallback must not be NULL for using fast486. I'm committing a temporary fix that I will definitely fix in a subsequent commit.
svn path=/branches/ntvdm/; revision=60812
- The DosErrorLevel is stored as a WORD: its LOWORD is the return code and the HIWORD is the termination code.
- When copying CurrentDirectories[...], be sure that we copy maximum DOS_DIR_LENGTH chars.
- Implement (or stubplement) bunch of INT 21h functions: 0x03, 0x04, 0x05, 0x0C, 0x0D, 0x26, 0x37, 0x47, 0x4D and 0x50. Functions 0x18, 0x1D, 0x1E and 0x20 are NULL functions present in DOS for CP/M compatibility only.
- Fix DOS version querying.
- Use set/getAX() instead of EmulatorSet/GetRegister, and use setCF instead of EmulatorSetFlag.
svn path=/branches/ntvdm/; revision=60790
Improve performance by computing the resolution required by the PIT,
and then using the standard tick count instead of performance counters
when that resolution is low.
svn path=/branches/ntvdm/; revision=60783
- DOS: the DOS file attributes are one byte.
- BIOS: don't use hardcoded values; use the SEG_OFF_TO_PTR macro introduced earlier; use get/setAX instead of EmulatorGet/SetRegister.
svn path=/branches/ntvdm/; revision=60781
The PS/2 should latch the last value that was read in the case of multiple reads.
Modify the BIOS keyboard IRQ handler to support hooks.
svn path=/branches/ntvdm/; revision=60773
Implement all the missing INT 16h functions but 03h. Also, for simplification purposes (should be fixed later on) act exactly the same for INT 00h and 10h, and for INT 01h and 11h.
Finally, one has to implement setting the BIOS KeybdShiftFlags flag.
svn path=/branches/ntvdm/; revision=60770
- Remove an unneeded inclusion to the CRT header: limits.h (and use instead NDK definitions for max/min long values).
- Remove unneeded comments...
[NTVDM]
Remove an unneeded add_dependencies(...) command.
svn path=/branches/ntvdm/; revision=60767
Separate external interrupts from interrupt signals (which are
interrupts whose number is not known until they can be serviced,
just like hardware interrupts on a real CPU).
[NTVDM]
Improve the PIC emulation code (IRQ priorities, etc...).
Instead of checking for interrupts in the main loop, move the
PS/2 input parsing to a different thread.
Improve BIOS keyboard IRQ handling.
svn path=/branches/ntvdm/; revision=60761
Remove the code that performs waiting in 32-bit mode since that blocks the emulator
and prevents interrupts from working.
Implement a 16-bit waiting system in the interrupt handlers.
Fix the PS/2 interrupt code.
svn path=/branches/ntvdm/; revision=60739
Implement the hardware interrupt system.
Modify Soft386Interrupt to assume hardware interrupts, because
software interrupts from outside the emulator may cause race conditions.
svn path=/branches/ntvdm/; revision=60696
Change the instruction in the interrupt handlers to "INC SP" twice
instead of one "ADD SP, 2". It's shorter and supported by soft386 already.
svn path=/branches/ntvdm/; revision=60397
Implement the LES and LDS instructions.
Add optional support for BOPs (NTVDM-specific).
Fix prefix handling in some functions.
[NTVDM]
Enable BOPs for Soft386 (when NEW_EMULATOR is defined).
Fix the calling convention issue (softx86 uses cdecl, soft386 uses stdcall).
svn path=/branches/ntvdm/; revision=60395
Start implementing a new emulator library to provide 386/486 emulation support to NTVDM
and perhaps other components aswell.
svn path=/branches/ntvdm/; revision=59752
Do not rely on the internal format for console handles. Instead, use a more reliable way, by checking for success when calling a simple console function acting on in/out console handles.
svn path=/branches/ntvdm/; revision=59746
Make the BIOS Data Area accessible to other parts of ntvdm.
Properly redirect read/write access to the console to the keyboard and VGA systems, respectively.
svn path=/branches/ntvdm/; revision=59741
Synchronize with trunk again for SetConsolePalette.
Implement VGA palettes for graphics mode and DAC register access.
svn path=/branches/ntvdm/; revision=59713
Keep a list of current directories for all drives.
Implement functions that change the default drive and current directory.
svn path=/branches/ntvdm/; revision=59700
Use DOS_CMDLINE_LENGTH instead of MAX_PATH.
Fix bug in DosInitializePsp which allowed writing past the end of the Program Segment Prefix (PSP).
svn path=/branches/ntvdm/; revision=59693
- Use up to 256 parameters for programs (as suggested by the parsing while loop), but don't hardcode this values in many other places.
- The passed command line to ntvdm should be as long as MAX_PATH.
svn path=/branches/ntvdm/; revision=59691
Synchronize with trunk again to fix important bugs in the build system.
Implement register control functions which should be exported (Adapted from a patch by Hermes Belusca-Maito).
The actual export is temporarily disabled because a bug in the build system compiles ntvdm as a DLL instead of an EXE.
svn path=/branches/ntvdm/; revision=59684
- Enable TESTING by default until the correct way to load ntvdm is found.
- Calculate the character height instead of hardcoding in the BDA.
svn path=/branches/ntvdm/; revision=59678
- Fix usage of the console framebuffer mutex (used only with graphics screen buffers).
- Do not check for text/graphics mode when updating each scan line, in VgaUpdateFramebuffer.
svn path=/branches/ntvdm/; revision=59673
- Check return value of VgaEnterGraphicsMode (because CreateConsoleScreenBuffer can fail), and create VgaEnterTextMode and VgaLeaveTextMode helpers.
- Don't declare variables inside loops.
svn path=/branches/ntvdm/; revision=59668
- Don't leak console input/output handles when opening them in BiosInitialize.
- Deinitialize the emulator in the reverse order it was initialized.
- Simplify VgaGetVideoBaseAddress and VgaGetVideoLimitAddress and use the former one in VgaTranslate[Read-Write]Address.
- Use only unicode Win32 APIs where it's needed.
svn path=/branches/ntvdm/; revision=59659
Implement Video Graphics Array (VGA) support.
Replace the old BIOS video code with new code that uses the VGA.
svn path=/branches/ntvdm/; revision=59648
Modify the flags on the stack instead of the flags register directly.
The flags register is restored during IRET so changing it directly does nothing.
svn path=/branches/ntvdm/; revision=59566
Remove the old "INT 0xFF" hack and instead use an invalid opcode sequence for emulator operations.
Fix the flags register update bug.
svn path=/branches/ntvdm/; revision=59565