Building DOSBox - Win32 Visual Studio 2005

The base instruction on here.

  1. Get the DOSBox source: Page / File
  2. Get the SDL win32 development libraries: Page / File
  3. Get the SDL_net win32 development libraries: Page / File
  4. Expand the DOSBox source and open dev\DosBox*visualc_net\dosbox.sln*
  5. Add dev*SDL-1.2.11\include* and dev*SDL_net-1.2.6\include* to the include paths
  6. Add dev*DXSDK\Include* to the include paths
  7. Turn off screen capture, set C_SSHOT 0 in config.h so we don’t need libpng
  8. Turn off internal debugger, set C_DEBUG 0 in config.h, so we don’t need curses support
  9. Remove zlib.lib, libpng.lib and curses.lib from the Linker Dependencies

TA-DA. Ok, so you have no debugging support, thus the reason for building you our version is reduced. But I added the following code, and got the information I was after.

In _CPU_Core_Normal_Run (src\cpu\core_normal.cpp) before the DEBUG_HeavyIsBreakpoint call (outside of the #if C_DEBUG block).

Bit16u ecl_offset = LoadMw( BaseDS + 0x4FCD);  
Bit32u dsbase = LoadMd(BaseDS );  
if( dsbase == 0x43240000 )  
{  
  if( ecl_offset != offset_last )  
  {  
    printf("ECL_offset: 0x%04x\r\n",ecl_offset);  
    offset_last = ecl_offset;  
  }  
}

The dsbase check was added because, for a span of time I was getting different results every second time around the loop, and I suspect that the instructions where not from my game code space, so I added a check that the data segment was my games before checking for changes. Worked a treat.