--- xmil/win9x/xmil.cpp 2004/08/03 11:02:00 1.3 +++ xmil/win9x/xmil.cpp 2004/08/05 11:30:12 1.7 @@ -22,8 +22,7 @@ #include "z80core.h" #include "pccore.h" -#include "x1_io.h" -#include "x1_crtc.h" +#include "iocore.h" #include "timing.h" #include "draw.h" #include "fdd_ini.h" @@ -45,6 +44,7 @@ static const OEMCHAR szClassName[] = OEM HWND hWndMain; HINSTANCE hInst; HINSTANCE hPreI; + OEMCHAR modulefile[MAX_PATH]; OEMCHAR fddfolder[MAX_PATH]; OEMCHAR bmpfilefolder[MAX_PATH]; @@ -98,7 +98,7 @@ static void dispbmp(HINSTANCE hinst, HDC HDC hmdc; hbmp = LoadBitmap(hinst, res); - GetObject(hbmp, sizeof(BITMAP), &bmp); + GetObject(hbmp, sizeof(bmp), &bmp); hmdc = CreateCompatibleDC(hdc); SelectObject(hmdc, hbmp); BitBlt(hdc, x, y, bmp.bmWidth, bmp.bmHeight, hmdc, 0, 0, SRCCOPY); @@ -258,15 +258,15 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT break; case IDM_WIDTH80: - crtc.TXT_XL = 80; - crtc.GRP_XL = 640; + crtc.s.TXT_XL = 80; + crtc.s.GRP_XL = 640; vrambank_patch(); scrnallflash = 1; break; case IDM_WIDTH40: - crtc.TXT_XL = 40; - crtc.GRP_XL = 320; + crtc.s.TXT_XL = 40; + crtc.s.GRP_XL = 320; vrambank_patch(); scrnallflash = 1; break; @@ -434,15 +434,15 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT PatBlt(hdc, 0, 0, width, height, PATCOPY); SelectObject(hdc, hbrush); - dispbmp(hinst, hdc, "XMILBMP", + dispbmp(hinst, hdc, OEMTEXT("XMILBMP"), (width - 201) / 2, (height - 31) / 2); - dispbmp(hinst, hdc, "ZILOG", + dispbmp(hinst, hdc, OEMTEXT("ZILOG"), width - (101 + 8 + 41 + 8 + 68 + 1), height - 38); - dispbmp(hinst, hdc, "TURBOZ", + dispbmp(hinst, hdc, OEMTEXT("TURBOZ"), width - (101 + 8 + 68 + 1), height - 18); - dispbmp(hinst, hdc, "OPMSOUND", + dispbmp(hinst, hdc, OEMTEXT("OPMSOUND"), width - (68 + 1), height - (25 + 1)); } else { @@ -643,7 +643,8 @@ int WINAPI WinMain(HINSTANCE hInstance, return(FALSE); } - file_setcd(__argv[0]); + GetModuleFileName(NULL, modulefile, sizeof(modulefile)); + file_setcd(modulefile); initload(); hInst = hInstance; @@ -673,7 +674,7 @@ int WINAPI WinMain(HINSTANCE hInstance, WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX, xmiloscfg.winx, xmiloscfg.winy, - SCREEN_WIDTH, SCREEN_HEIGHT, + SURFACE_WIDTH, SURFACE_HEIGHT, NULL, NULL, hInstance, NULL); hWndMain = hWnd; scrnmng_initialize(); @@ -714,7 +715,7 @@ int WINAPI WinMain(HINSTANCE hInstance, if (scrnmng_create(scrnmode) != SUCCESS) { scrnmode ^= SCRNMODE_FULLSCREEN; if (scrnmng_create(scrnmode) != SUCCESS) { - MessageBox(hWnd, "Couldn't create DirectDraw Object", + MessageBox(hWnd, OEMTEXT("Couldn't create DirectDraw Object"), szProgName, MB_OK); return(FALSE); } @@ -724,10 +725,10 @@ int WINAPI WinMain(HINSTANCE hInstance, juliet_load(); juliet_prepare(); - juliet2_reset(); +// juliet2_reset(); if (soundmng_initialize() == SUCCESS) { - soundmng_pcmload(SOUND_PCMSEEK, "fddseek.wav", 0); - soundmng_pcmload(SOUND_PCMSEEK1, "fddseek1.wav", 0); + soundmng_pcmload(SOUND_PCMSEEK, OEMTEXT("fddseek.wav"), 0); + soundmng_pcmload(SOUND_PCMSEEK1, OEMTEXT("fddseek1.wav"), 0); soundmng_pcmvolume(SOUND_PCMSEEK, xmilcfg.MOTORVOL); soundmng_pcmvolume(SOUND_PCMSEEK1, xmilcfg.MOTORVOL); } @@ -735,6 +736,7 @@ int WINAPI WinMain(HINSTANCE hInstance, pccore_initialize(); pccore_reset(); +#if !defined(UNICODE) if (__argc > 1) { for (int i=1; i<__argc; i++) { if (is_d8ufile(__argv[i])) { @@ -744,6 +746,7 @@ int WINAPI WinMain(HINSTANCE hInstance, } } } +#endif scrndraw_redraw(); @@ -771,12 +774,12 @@ int WINAPI WinMain(HINSTANCE hInstance, timing_setcount(0); joymng_sync(); mousemng_sync(); - juliet2_sync(25); +// juliet2_sync(25); x1r_exec(); x1f_sync(); } soundmng_sync(); - juliet2_exec(); +// juliet2_exec(); } } else {