Removed all references to PCem;

Added Japanese FDI support;
Added more extensions to floppy image selection.
This commit is contained in:
OBattler
2016-08-15 03:26:37 +02:00
parent 99c62a98ae
commit 929d34d4b4
20 changed files with 165 additions and 93 deletions

View File

@@ -582,7 +582,7 @@ pclog("video_card_available : %i\n", c);
new_SSI2001 != SSI2001 || new_sndcard != sound_card_current || new_voodoo != voodoo_enabled || new_SSI2001 != SSI2001 || new_sndcard != sound_card_current || new_voodoo != voodoo_enabled ||
new_dynarec != cpu_use_dynarec || new_fda != fdd_get_type(0) || new_fdb != fdd_get_type(1)) new_dynarec != cpu_use_dynarec || new_fda != fdd_get_type(0) || new_fdb != fdd_get_type(1))
{ {
if (alert("This will reset PCem!", "Okay to continue?", NULL, "OK", "Cancel", 0, 0) != 1) if (alert("This will reset 86Box!", "Okay to continue?", NULL, "OK", "Cancel", 0, 0) != 1)
continue; continue;
model = new_model; model = new_model;

View File

@@ -245,7 +245,7 @@ void deviceconfig_open(device_t *device)
if (!changed) if (!changed)
return; return;
if (alert("This will reset PCem!", "Okay to continue?", NULL, "OK", "Cancel", 0, 0) != 1) if (alert("This will reset 86Box!", "Okay to continue?", NULL, "OK", "Cancel", 0, 0) != 1)
continue; continue;
dialog_pos = 1; dialog_pos = 1;

View File

@@ -23,7 +23,7 @@ static char hd_size_new[20];
static int new_cdrom_channel; static int new_cdrom_channel;
static PcemHDC hdc_new[4]; static hard_disk_t hdc_new[4];
static DIALOG hdparams_dialog[]= static DIALOG hdparams_dialog[]=
{ {
@@ -484,7 +484,7 @@ int disc_hdconf()
if (c == 1) if (c == 1)
{ {
if (alert("This will reset PCem!", "Okay to continue?", NULL, "OK", "Cancel", 0, 0) == 1) if (alert("This will reset 86Box!", "Okay to continue?", NULL, "OK", "Cancel", 0, 0) == 1)
{ {
hdc[0] = hdc_new[0]; hdc[0] = hdc_new[0];
hdc[1] = hdc_new[1]; hdc[1] = hdc_new[1];

View File

@@ -118,7 +118,7 @@ static int cdrom_disabled()
if (!cdrom_enabled) if (!cdrom_enabled)
return D_O_K; return D_O_K;
if (alert("This will reset PCem!", "Okay to continue?", NULL, "OK", "Cancel", 0, 0) == 1) if (alert("This will reset 86Box!", "Okay to continue?", NULL, "OK", "Cancel", 0, 0) == 1)
{ {
atapi->exit(); atapi->exit();
cdrom_enabled = 0; cdrom_enabled = 0;
@@ -140,7 +140,7 @@ static int cdrom_empty()
return D_O_K; return D_O_K;
} }
if (alert("This will reset PCem!", "Okay to continue?", NULL, "OK", "Cancel", 0, 0) == 1) if (alert("This will reset 86Box!", "Okay to continue?", NULL, "OK", "Cancel", 0, 0) == 1)
{ {
cdrom_drive = -1; cdrom_drive = -1;
cdrom_enabled = 1; cdrom_enabled = 1;
@@ -161,7 +161,7 @@ static int cdrom_dev()
return D_O_K; return D_O_K;
} }
if (alert("This will reset PCem!", "Okay to continue?", NULL, "OK", "Cancel", 0, 0) == 1) if (alert("This will reset 86Box!", "Okay to continue?", NULL, "OK", "Cancel", 0, 0) == 1)
{ {
cdrom_drive = 1; cdrom_drive = 1;
cdrom_enabled = 1; cdrom_enabled = 1;
@@ -195,7 +195,7 @@ static MENU main_menu[]=
{NULL,NULL,NULL,0,NULL} {NULL,NULL,NULL,0,NULL}
}; };
static DIALOG pcem_gui[]= static DIALOG main_windows_gui[]=
{ {
{d_menu_proc, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, main_menu, NULL, NULL}, {d_menu_proc, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, main_menu, NULL, NULL},
{d_yield_proc, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, NULL, NULL, NULL}, {d_yield_proc, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, NULL, NULL, NULL},
@@ -208,7 +208,7 @@ void gui_enter()
int x = 1; int x = 1;
infocus = 0; infocus = 0;
dp = init_dialog(pcem_gui, 0); dp = init_dialog(main_windows_gui, 0);
show_mouse(screen); show_mouse(screen);
while (x && !(mouse_b & 2) && !key[KEY_ESC]) while (x && !(mouse_b & 2) && !key[KEY_ESC])
{ {

View File

@@ -1,7 +1,7 @@
#include "allegro-main.h" #include "allegro-main.h"
#include "plat-keyboard.h" #include "plat-keyboard.h"
int pcem_key[272]; int recv_key[272];
int rawinputkey[272]; int rawinputkey[272];
static int key_convert[128] = static int key_convert[128] =
@@ -43,7 +43,7 @@ void keyboard_poll_host()
if (key_idx == -1) if (key_idx == -1)
continue; continue;
if (key[c] != pcem_key[key_idx]) if (key[c] != recv_key[key_idx])
pcem_key[key_idx] = key[c]; recv_key[key_idx] = key[c];
} }
} }

View File

@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
} }
if (c == ROM_MAX) if (c == ROM_MAX)
{ {
printf("No ROMs present!\nYou must have at least one romset to use PCem."); printf("No ROMs present!\nYou must have at least one romset to use 86Box.");
return 0; return 0;
} }

View File

@@ -59,9 +59,15 @@ static struct
} }
loaders[]= loaders[]=
{ {
{"12", img_load, img_close, -1},
{"144", img_load, img_close, -1},
{"360", img_load, img_close, -1},
{"720", img_load, img_close, -1},
{"DSK", img_load, img_close, -1},
{"FLP", img_load, img_close, -1},
{"IMG", img_load, img_close, -1}, {"IMG", img_load, img_close, -1},
{"IMA", img_load, img_close, -1}, {"IMA", img_load, img_close, -1},
{"360", img_load, img_close, -1}, {"VFD", img_load, img_close, -1},
{"XDF", img_load, img_close, -1}, {"XDF", img_load, img_close, -1},
{"FDI", fdi_load, fdi_close, -1}, {"FDI", fdi_load, fdi_close, -1},
{0,0,0} {0,0,0}

View File

@@ -2,6 +2,7 @@
#include <stdint.h> #include <stdint.h>
#include "ibm.h" #include "ibm.h"
#include "disc.h" #include "disc.h"
#include "disc_img.h"
#include "disc_fdi.h" #include "disc_fdi.h"
#include "fdi2raw.h" #include "fdi2raw.h"
@@ -99,9 +100,23 @@ int fdi_hole(int drive)
void fdi_load(int drive, char *fn) void fdi_load(int drive, char *fn)
{ {
char header[26];
writeprot[drive] = fwriteprot[drive] = 1; writeprot[drive] = fwriteprot[drive] = 1;
fdi[drive].f = fopen(fn, "rb"); fdi[drive].f = fopen(fn, "rb");
if (!fdi[drive].f) return; if (!fdi[drive].f) return;
fread(char_header, 1, 25, f);
fseek(f, 0, SEEK_SET);
char_header[25] = 0;
if (strmp(char_header, "Formatted Disk Image file") != 0)
{
/* This is a Japanese FDI file. */
pclog("fdi_load(): Japanese FDI file detected, redirecting to IMG loader\n");
img_load(drive, *fn);
return;
}
fdi[drive].h = fdi2raw_header(fdi[drive].f); fdi[drive].h = fdi2raw_header(fdi[drive].f);
// if (!fdih[drive]) printf("Failed to load!\n"); // if (!fdih[drive]) printf("Failed to load!\n");
fdi[drive].lasttrack = fdi2raw_get_last_track(fdi[drive].h); fdi[drive].lasttrack = fdi2raw_get_last_track(fdi[drive].h);

View File

@@ -16,6 +16,7 @@ static struct
int hole; int hole;
int byte_period; int byte_period;
double bitcell_period_300rpm; double bitcell_period_300rpm;
uint32_t base;
} img[2]; } img[2];
#if 0 #if 0
@@ -249,10 +250,17 @@ void img_load(int drive, char *fn)
uint32_t bpt; uint32_t bpt;
uint8_t max_spt; /* Used for XDF detection. */ uint8_t max_spt; /* Used for XDF detection. */
int temp_rate; int temp_rate;
char ext[4];
int fdi;
if (!xdf_maps_initialized) initialize_xdf_maps(); /* Initialize XDF maps, will need them to properly register sectors in tracks. */ if (!xdf_maps_initialized) initialize_xdf_maps(); /* Initialize XDF maps, will need them to properly register sectors in tracks. */
writeprot[drive] = 0; ext[0] = fn[strlen(fn) - 3] | 0x60;
ext[1] = fn[strlen(fn) - 2] | 0x60;
ext[2] = fn[strlen(fn) - 1] | 0x60;
ext[3] = 0;
writeprot[drive] = 0;
img[drive].f = fopen(fn, "rb+"); img[drive].f = fopen(fn, "rb+");
if (!img[drive].f) if (!img[drive].f)
{ {
@@ -263,20 +271,48 @@ void img_load(int drive, char *fn)
} }
fwriteprot[drive] = writeprot[drive]; fwriteprot[drive] = writeprot[drive];
/* Read the BPB */ if (strcmp(ext, "fdi") == 0)
fseek(img[drive].f, 0x0B, SEEK_SET); {
fread(&bpb_bps, 1, 2, img[drive].f); /* This is a Japanese FDI image, so let's read the header */
fseek(img[drive].f, 0x13, SEEK_SET); pclog("img_load(): File is a Japanese FDI image...\n");
fread(&bpb_total, 1, 2, img[drive].f); fseek(img[drive].f, 0x10, SEEK_SET);
fseek(img[drive].f, 0x15, SEEK_SET); fread(&bpb_bps, 1, 2, img[drive].f);
bpb_mid = fgetc(img[drive].f); fseek(img[drive].f, 0x0C, SEEK_SET);
fseek(img[drive].f, 0x18, SEEK_SET); fread(&size, 1, 4, img[drive].f);
bpb_sectors = fgetc(img[drive].f); bpb_total = size / bpb_bps;
fseek(img[drive].f, 0x1A, SEEK_SET); fseek(img[drive].f, 0x08, SEEK_SET);
bpb_sides = fgetc(img[drive].f); fread(&(img[drive].base), 1, 4, img[drive].f);
fseek(img[drive].f, base + 0x15, SEEK_SET);
bpb_mid = fgetc(img[drive].f);
if (bpb_mid < 0xF0) bpb_mid = 0xF0;
fseek(img[drive].f, 0x14, SEEK_SET);
bpb_sectors = fgetc(img[drive].f);
fseek(img[drive].f, 0x18, SEEK_SET);
bpb_sides = fgetc(img[drive].f);
fseek(img[drive].f, -1, SEEK_END); fdi = 1;
size = ftell(img[drive].f) + 1; }
else
{
/* Read the BPB */
pclog("img_load(): File is a raw image...\n");
fseek(img[drive].f, 0x0B, SEEK_SET);
fread(&bpb_bps, 1, 2, img[drive].f);
fseek(img[drive].f, 0x13, SEEK_SET);
fread(&bpb_total, 1, 2, img[drive].f);
fseek(img[drive].f, 0x15, SEEK_SET);
bpb_mid = fgetc(img[drive].f);
fseek(img[drive].f, 0x18, SEEK_SET);
bpb_sectors = fgetc(img[drive].f);
fseek(img[drive].f, 0x1A, SEEK_SET);
bpb_sides = fgetc(img[drive].f);
base = 0;
fdi = 0;
fseek(img[drive].f, -1, SEEK_END);
size = ftell(img[drive].f) + 1;
}
img[drive].sides = 2; img[drive].sides = 2;
img[drive].sector_size = 512; img[drive].sector_size = 512;
@@ -285,7 +321,7 @@ void img_load(int drive, char *fn)
pclog("BPB reports %i sides and %i bytes per sector\n", bpb_sides, bpb_bps); pclog("BPB reports %i sides and %i bytes per sector\n", bpb_sides, bpb_bps);
if ((bpb_sides < 1) || (bpb_sides > 2) || (bpb_bps < 128) || (bpb_bps > 2048)) if (((bpb_sides < 1) || (bpb_sides > 2) || (bpb_bps < 128) || (bpb_bps > 2048)) && !fdi)
{ {
/* The BPB is giving us a wacky number of sides and/or bytes per sector, therefore it is most probably /* The BPB is giving us a wacky number of sides and/or bytes per sector, therefore it is most probably
not a BPB at all, so we have to guess the parameters from file size. */ not a BPB at all, so we have to guess the parameters from file size. */
@@ -358,7 +394,16 @@ void img_load(int drive, char *fn)
{ {
/* The BPB readings appear to be valid, so let's set the values. */ /* The BPB readings appear to be valid, so let's set the values. */
/* Number of tracks = number of total sectors divided by sides times sectors per track. */ /* Number of tracks = number of total sectors divided by sides times sectors per track. */
img[drive].tracks = ((uint32_t) bpb_total) / (((uint32_t) bpb_sides) * ((uint32_t) bpb_sectors)); if (fdi)
{
/* The image is a Japanese FDI, therefore we read the number of tracks from the header. */
fseek(img[drive].f, 0x1C, SEEK_SET);
fread(&(img[drive].tracks), 1, 4, img[drive].f);
}
else
{
img[drive].tracks = ((uint32_t) bpb_total) / (((uint32_t) bpb_sides) * ((uint32_t) bpb_sectors));
}
/* The rest we just set directly from the BPB. */ /* The rest we just set directly from the BPB. */
img[drive].sectors = bpb_sectors; img[drive].sectors = bpb_sectors;
img[drive].sides = bpb_sides; img[drive].sides = bpb_sides;
@@ -585,7 +630,7 @@ void img_seek(int drive, int track)
if (img[drive].sides == 2) if (img[drive].sides == 2)
{ {
fseek(img[drive].f, track * img[drive].sectors * img[drive].sector_size * 2, SEEK_SET); fseek(img[drive].f, base + (track * img[drive].sectors * img[drive].sector_size * 2), SEEK_SET);
// pclog("Seek: Current file position (H0) is: %08X\n", ftell(img[drive].f)); // pclog("Seek: Current file position (H0) is: %08X\n", ftell(img[drive].f));
fread(img[drive].track_data[0], img[drive].sectors * img[drive].sector_size, 1, img[drive].f); fread(img[drive].track_data[0], img[drive].sectors * img[drive].sector_size, 1, img[drive].f);
// pclog("Seek: Current file position (H1) is: %08X\n", ftell(img[drive].f)); // pclog("Seek: Current file position (H1) is: %08X\n", ftell(img[drive].f));
@@ -593,7 +638,7 @@ void img_seek(int drive, int track)
} }
else else
{ {
fseek(img[drive].f, track * img[drive].sectors * img[drive].sector_size, SEEK_SET); fseek(img[drive].f, base + (track * img[drive].sectors * img[drive].sector_size), SEEK_SET);
fread(img[drive].track_data[0], img[drive].sectors * img[drive].sector_size, 1, img[drive].f); fread(img[drive].track_data[0], img[drive].sectors * img[drive].sector_size, 1, img[drive].f);
} }
@@ -742,13 +787,13 @@ void img_writeback(int drive, int track)
if (img[drive].sides == 2) if (img[drive].sides == 2)
{ {
fseek(img[drive].f, track * img[drive].sectors * img[drive].sector_size * 2, SEEK_SET); fseek(img[drive].f, base + (track * img[drive].sectors * img[drive].sector_size * 2), SEEK_SET);
fwrite(img[drive].track_data[0], img[drive].sectors * img[drive].sector_size, 1, img[drive].f); fwrite(img[drive].track_data[0], img[drive].sectors * img[drive].sector_size, 1, img[drive].f);
fwrite(img[drive].track_data[1], img[drive].sectors * img[drive].sector_size, 1, img[drive].f); fwrite(img[drive].track_data[1], img[drive].sectors * img[drive].sector_size, 1, img[drive].f);
} }
else else
{ {
fseek(img[drive].f, track * img[drive].sectors * img[drive].sector_size, SEEK_SET); fseek(img[drive].f, base + (track * img[drive].sectors * img[drive].sector_size), SEEK_SET);
fwrite(img[drive].track_data[0], img[drive].sectors * img[drive].sector_size, 1, img[drive].f); fwrite(img[drive].track_data[0], img[drive].sectors * img[drive].sector_size, 1, img[drive].f);
} }
} }

View File

@@ -503,9 +503,9 @@ typedef struct
FILE *f; FILE *f;
int spt,hpc; /*Sectors per track, heads per cylinder*/ int spt,hpc; /*Sectors per track, heads per cylinder*/
int tracks; int tracks;
} PcemHDC; } hard_disk_t;
PcemHDC hdc[4]; hard_disk_t hdc[4];
/*Keyboard*/ /*Keyboard*/
int64_t keybsenddelay; int64_t keybsenddelay;
@@ -568,4 +568,6 @@ extern uint32_t eip_msr;
/* For the AMD K6. */ /* For the AMD K6. */
extern uint64_t star; extern uint64_t star;
#define emulator_version "1.00"
#define FPU_CW_Reserved_Bits (0xe0c0) #define FPU_CW_Reserved_Bits (0xe0c0)

View File

@@ -510,7 +510,7 @@ static void ide_identify(IDE *ide)
#ifdef RPCEMU_IDE #ifdef RPCEMU_IDE
ide_padstr((char *) (ide->buffer + 27), "RPCemuHD", 40); /* Model */ ide_padstr((char *) (ide->buffer + 27), "RPCemuHD", 40); /* Model */
#else #else
ide_padstr((char *) (ide->buffer + 27), "PCemHD", 40); /* Model */ ide_padstr((char *) (ide->buffer + 27), "86BoxHD", 40); /* Model */
#endif #endif
ide->buffer[20] = 3; /*Buffer type*/ ide->buffer[20] = 3; /*Buffer type*/
ide->buffer[21] = 512; /*Buffer size*/ ide->buffer[21] = 512; /*Buffer size*/
@@ -548,7 +548,7 @@ static void ide_atapi_identify(IDE *ide)
#ifdef RPCEMU_IDE #ifdef RPCEMU_IDE
ide_padstr((char *) (ide->buffer + 27), "RPCemuCD", 40); /* Model */ ide_padstr((char *) (ide->buffer + 27), "RPCemuCD", 40); /* Model */
#else #else
ide_padstr((char *) (ide->buffer + 27), "PCemCD", 40); /* Model */ ide_padstr((char *) (ide->buffer + 27), "86BoxCD", 40); /* Model */
#endif #endif
ide->buffer[49] = 0x200; /* LBA supported */ ide->buffer[49] = 0x200; /* LBA supported */
} }
@@ -3082,10 +3082,10 @@ static void atapicommand(int ide_board)
ide_padstr8(idebufferb + 8, 8, "RPCemu"); /* Vendor */ ide_padstr8(idebufferb + 8, 8, "RPCemu"); /* Vendor */
ide_padstr8(idebufferb + 16, 16, "RPCemuCD"); /* Product */ ide_padstr8(idebufferb + 16, 16, "RPCemuCD"); /* Product */
#else #else
ide_padstr8(idebufferb + 8, 8, "PCem"); /* Vendor */ ide_padstr8(idebufferb + 8, 8, "86Box"); /* Vendor */
ide_padstr8(idebufferb + 16, 16, "PCemCD"); /* Product */ ide_padstr8(idebufferb + 16, 16, "86BoxCD"); /* Product */
#endif #endif
ide_padstr8(idebufferb + 32, 4, "1.0"); /* Revision */ ide_padstr8(idebufferb + 32, 4, emulator_version); /* Revision */
idx = 36; idx = 36;
} }

View File

@@ -234,7 +234,7 @@ void initpc(int argc, char *argv[])
joystick_init(); joystick_init();
midi_init(); midi_init();
append_filename(config_file_default, pcempath, "pcem.cfg", 511); append_filename(config_file_default, pcempath, "86box.cfg", 511);
loadconfig(config_file); loadconfig(config_file);
pclog("Config loaded\n"); pclog("Config loaded\n");
@@ -512,7 +512,7 @@ void runpc()
if (win_title_update) if (win_title_update)
{ {
win_title_update=0; win_title_update=0;
sprintf(s, "86Box v1 - %i%% - %s - %s - %s", fps, model_getname(), models[model].cpu[cpu_manufacturer].cpus[cpu].name, (!mousecapture) ? "Click to capture mouse" : "Press F12-F8 or middle button to release mouse"); sprintf(s, "86Box v%s - %i%% - %s - %s - %s", emulator_version, fps, model_getname(), models[model].cpu[cpu_manufacturer].cpus[cpu].name, (!mousecapture) ? "Click to capture mouse" : "Press F12-F8 or middle button to release mouse");
set_window_title(s); set_window_title(s);
} }
done++; done++;

View File

@@ -4,7 +4,7 @@ extern "C" {
void keyboard_init(); void keyboard_init();
void keyboard_close(); void keyboard_close();
void keyboard_poll_host(); void keyboard_poll_host();
extern int pcem_key[272]; extern int recv_key[272];
extern int rawinputkey[272]; extern int rawinputkey[272];
#ifndef __unix #ifndef __unix

View File

@@ -369,7 +369,7 @@ static BOOL CALLBACK config_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
temp_voodoo != voodoo_enabled || temp_dynarec != cpu_use_dynarec || temp_always_serial != mouse_always_serial || temp_voodoo != voodoo_enabled || temp_dynarec != cpu_use_dynarec || temp_always_serial != mouse_always_serial ||
temp_fda_type != fdd_get_type(0) || temp_fdb_type != fdd_get_type(1) || temp_network_card_current != network_card_current) temp_fda_type != fdd_get_type(0) || temp_fdb_type != fdd_get_type(1) || temp_network_card_current != network_card_current)
{ {
if (MessageBox(NULL,"This will reset PCem!\nOkay to continue?","PCem",MB_OKCANCEL)==IDOK) if (MessageBox(NULL,"This will reset 86Box!\nOkay to continue?","86Box",MB_OKCANCEL)==IDOK)
{ {
savenvr(); savenvr();
model = temp_model; model = temp_model;

View File

@@ -77,6 +77,7 @@ void d3d_fs_init(HWND h)
{ {
int c; int c;
HRESULT hr; HRESULT hr;
char *emulator_title;
d3d_fs_w = GetSystemMetrics(SM_CXSCREEN); d3d_fs_w = GetSystemMetrics(SM_CXSCREEN);
d3d_fs_h = GetSystemMetrics(SM_CYSCREEN); d3d_fs_h = GetSystemMetrics(SM_CYSCREEN);
@@ -86,10 +87,11 @@ void d3d_fs_init(HWND h)
d3d_hwnd = h; d3d_hwnd = h;
sprintf(emulator_title, "86Box v%s", emulator_version);
d3d_device_window = CreateWindowEx ( d3d_device_window = CreateWindowEx (
0, 0,
szSubClassName, szSubClassName,
"86Box v1", emulator_title,
WS_POPUP, WS_POPUP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,

View File

@@ -138,7 +138,7 @@ static BOOL CALLBACK deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam
return TRUE; return TRUE;
} }
if (MessageBox(NULL, "This will reset PCem!\nOkay to continue?", "PCem", MB_OKCANCEL) != IDOK) if (MessageBox(NULL, "This will reset 86Box!\nOkay to continue?", "86Box", MB_OKCANCEL) != IDOK)
{ {
EndDialog(hdlg, 0); EndDialog(hdlg, 0);
return TRUE; return TRUE;

View File

@@ -45,7 +45,7 @@ static BOOL CALLBACK hdnew_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARA
char s[260]; char s[260];
HWND h; HWND h;
int c; int c;
PcemHDC hd[4]; hard_disk_t hd[4];
FILE *f; FILE *f;
uint8_t buf[512]; uint8_t buf[512];
switch (message) switch (message)
@@ -77,7 +77,7 @@ static BOOL CALLBACK hdnew_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARA
SendMessage(h, WM_GETTEXT, 511, (LPARAM)hd_new_name); SendMessage(h, WM_GETTEXT, 511, (LPARAM)hd_new_name);
if (!hd_new_name[0]) if (!hd_new_name[0])
{ {
MessageBox(ghwnd,"Please enter a valid filename","PCem error",MB_OK); MessageBox(ghwnd,"Please enter a valid filename","86Box error",MB_OK);
return TRUE; return TRUE;
} }
h = GetDlgItem(hdlg, IDC_EDIT1); h = GetDlgItem(hdlg, IDC_EDIT1);
@@ -92,24 +92,24 @@ static BOOL CALLBACK hdnew_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARA
if (hd_new_spt > 63) if (hd_new_spt > 63)
{ {
MessageBox(ghwnd, "Drive has too many sectors (maximum is 63)", "PCem error", MB_OK); MessageBox(ghwnd, "Drive has too many sectors (maximum is 63)", "86Box error", MB_OK);
return TRUE; return TRUE;
} }
if (hd_new_hpc > 16) if (hd_new_hpc > 16)
{ {
MessageBox(ghwnd, "Drive has too many heads (maximum is 16)", "PCem error", MB_OK); MessageBox(ghwnd, "Drive has too many heads (maximum is 16)", "86Box error", MB_OK);
return TRUE; return TRUE;
} }
if (hd_new_cyl > 16383) if (hd_new_cyl > 16383)
{ {
MessageBox(ghwnd, "Drive has too many cylinders (maximum is 16383)", "PCem error", MB_OK); MessageBox(ghwnd, "Drive has too many cylinders (maximum is 16383)", "86Box error", MB_OK);
return TRUE; return TRUE;
} }
f = fopen64(hd_new_name, "wb"); f = fopen64(hd_new_name, "wb");
if (!f) if (!f)
{ {
MessageBox(ghwnd, "Can't open file for write", "PCem error", MB_OK); MessageBox(ghwnd, "Can't open file for write", "86Box error", MB_OK);
return TRUE; return TRUE;
} }
memset(buf, 0, 512); memset(buf, 0, 512);
@@ -117,7 +117,7 @@ static BOOL CALLBACK hdnew_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARA
fwrite(buf, 512, 1, f); fwrite(buf, 512, 1, f);
fclose(f); fclose(f);
MessageBox(ghwnd, "Remember to partition and format the new drive", "PCem", MB_OK); MessageBox(ghwnd, "Remember to partition and format the new drive", "86Box", MB_OK);
EndDialog(hdlg, 1); EndDialog(hdlg, 1);
return TRUE; return TRUE;
@@ -159,7 +159,7 @@ BOOL CALLBACK hdsize_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPar
{ {
char s[260]; char s[260];
HWND h; HWND h;
PcemHDC hd[2]; hard_disk_t hd[2];
switch (message) switch (message)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
@@ -193,17 +193,17 @@ BOOL CALLBACK hdsize_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPar
if (hd_new_spt > 63) if (hd_new_spt > 63)
{ {
MessageBox(ghwnd,"Drive has too many sectors (maximum is 63)","PCem error",MB_OK); MessageBox(ghwnd,"Drive has too many sectors (maximum is 63)","86Box error",MB_OK);
return TRUE; return TRUE;
} }
if (hd_new_hpc > 16) if (hd_new_hpc > 16)
{ {
MessageBox(ghwnd,"Drive has too many heads (maximum is 16)","PCem error",MB_OK); MessageBox(ghwnd,"Drive has too many heads (maximum is 16)","86Box error",MB_OK);
return TRUE; return TRUE;
} }
if (hd_new_cyl > 16383) if (hd_new_cyl > 16383)
{ {
MessageBox(ghwnd,"Drive has too many cylinders (maximum is 16383)","PCem error",MB_OK); MessageBox(ghwnd,"Drive has too many cylinders (maximum is 16383)","86Box error",MB_OK);
return TRUE; return TRUE;
} }
@@ -239,7 +239,7 @@ static BOOL CALLBACK hdconf_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
{ {
char s[260]; char s[260];
HWND h; HWND h;
PcemHDC hd[4]; hard_disk_t hd[4];
FILE *f; FILE *f;
off64_t sz; off64_t sz;
switch (message) switch (message)
@@ -327,7 +327,7 @@ static BOOL CALLBACK hdconf_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
case IDOK: case IDOK:
if (hd_changed || cdrom_channel != new_cdrom_channel) if (hd_changed || cdrom_channel != new_cdrom_channel)
{ {
if (MessageBox(NULL, "This will reset PCem!\nOkay to continue?", "PCem", MB_OKCANCEL) == IDOK) if (MessageBox(NULL, "This will reset 86Box!\nOkay to continue?", "86Box", MB_OKCANCEL) == IDOK)
{ {
h = GetDlgItem(hdlg, IDC_EDIT_C_SPT); h = GetDlgItem(hdlg, IDC_EDIT_C_SPT);
SendMessage(h, WM_GETTEXT, 255, (LPARAM)s); SendMessage(h, WM_GETTEXT, 255, (LPARAM)s);
@@ -468,7 +468,7 @@ static BOOL CALLBACK hdconf_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
f = fopen64(openfilestring, "rb"); f = fopen64(openfilestring, "rb");
if (!f) if (!f)
{ {
MessageBox(ghwnd,"Can't open file for read","PCem error",MB_OK); MessageBox(ghwnd,"Can't open file for read","86Box error",MB_OK);
return TRUE; return TRUE;
} }
fseeko64(f, -1, SEEK_END); fseeko64(f, -1, SEEK_END);
@@ -530,7 +530,7 @@ static BOOL CALLBACK hdconf_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
f = fopen64(openfilestring, "rb"); f = fopen64(openfilestring, "rb");
if (!f) if (!f)
{ {
MessageBox(ghwnd,"Can't open file for read","PCem error",MB_OK); MessageBox(ghwnd,"Can't open file for read","86Box error",MB_OK);
return TRUE; return TRUE;
} }
fseeko64(f, -1, SEEK_END); fseeko64(f, -1, SEEK_END);
@@ -592,7 +592,7 @@ static BOOL CALLBACK hdconf_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
f = fopen64(openfilestring, "rb"); f = fopen64(openfilestring, "rb");
if (!f) if (!f)
{ {
MessageBox(ghwnd,"Can't open file for read","PCem error",MB_OK); MessageBox(ghwnd,"Can't open file for read","86Box error",MB_OK);
return TRUE; return TRUE;
} }
fseeko64(f, -1, SEEK_END); fseeko64(f, -1, SEEK_END);
@@ -654,7 +654,7 @@ static BOOL CALLBACK hdconf_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
f = fopen64(openfilestring, "rb"); f = fopen64(openfilestring, "rb");
if (!f) if (!f)
{ {
MessageBox(ghwnd,"Can't open file for read","PCem error",MB_OK); MessageBox(ghwnd,"Can't open file for read","86Box error",MB_OK);
return TRUE; return TRUE;
} }
fseeko64(f, -1, SEEK_END); fseeko64(f, -1, SEEK_END);

View File

@@ -9,7 +9,7 @@
#include "win.h" #include "win.h"
#include "video.h" #include "video.h"
extern "C" int pcem_key[272]; extern "C" int recv_key[272];
extern "C" void fatal(const char *format, ...); extern "C" void fatal(const char *format, ...);
extern "C" void pclog(const char *format, ...); extern "C" void pclog(const char *format, ...);
@@ -18,13 +18,13 @@ extern "C" void keyboard_init();
extern "C" void keyboard_close(); extern "C" void keyboard_close();
extern "C" void keyboard_poll(); extern "C" void keyboard_poll();
int pcem_key[272]; int recv_key[272];
void keyboard_init() void keyboard_init()
{ {
atexit(keyboard_close); atexit(keyboard_close);
memset(pcem_key, 0, sizeof(pcem_key)); memset(recv_key, 0, sizeof(recv_key));
pclog("Keyboard initialized!\n"); pclog("Keyboard initialized!\n");
} }
@@ -38,7 +38,7 @@ void keyboard_poll_host()
int c; int c;
for (c = 0; c < 272; c++) for (c = 0; c < 272; c++)
pcem_key[c] = rawinputkey[c]; recv_key[c] = rawinputkey[c];
if ((rawinputkey[0x1D] || rawinputkey[0x9D]) && if ((rawinputkey[0x1D] || rawinputkey[0x9D]) &&
(rawinputkey[0x38] || rawinputkey[0xB8]) && (rawinputkey[0x38] || rawinputkey[0xB8]) &&

View File

@@ -521,6 +521,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
MSG messages; /* Here messages to the application are saved */ MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */ WNDCLASSEX wincl; /* Data structure for the windowclass */
int c, d, bRet; int c, d, bRet;
char *emulator_title;
LARGE_INTEGER qpc_freq; LARGE_INTEGER qpc_freq;
HACCEL haccel; /* Handle to accelerator table */ HACCEL haccel; /* Handle to accelerator table */
@@ -557,11 +558,12 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
menu = LoadMenu(hThisInstance, TEXT("MainMenu")); menu = LoadMenu(hThisInstance, TEXT("MainMenu"));
initmenu(); initmenu();
sprintf(emulator_title, "86Box v%s", emulator_version);
/* The class is registered, let's create the program*/ /* The class is registered, let's create the program*/
hwnd = CreateWindowEx ( hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */ 0, /* Extended possibilites for variation */
szClassName, /* Classname */ szClassName, /* Classname */
"86Box v1", /* Title Text */ emulator_version, /* Title Text */
WS_OVERLAPPEDWINDOW&~WS_SIZEBOX, /* default window */ WS_OVERLAPPEDWINDOW&~WS_SIZEBOX, /* default window */
CW_USEDEFAULT, /* Windows decides the position */ CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */ CW_USEDEFAULT, /* where the window ends up on the screen */
@@ -642,7 +644,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
} }
if (c == ROM_MAX) if (c == ROM_MAX)
{ {
MessageBox(hwnd,"No ROMs present!\nYou must have at least one romset to use PCem.","PCem fatal error",MB_OK); MessageBox(hwnd,"No ROMs present!\nYou must have at least one romset to use 86Box.","86Box fatal error",MB_OK);
return 0; return 0;
} }
@@ -651,7 +653,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
if (!c) if (!c)
{ {
if (romset!=-1) MessageBox(hwnd,"Configured romset not available.\nDefaulting to available romset.","PCem error",MB_OK); if (romset!=-1) MessageBox(hwnd,"Configured romset not available.\nDefaulting to available romset.","86Box error",MB_OK);
for (c=0;c<ROM_MAX;c++) for (c=0;c<ROM_MAX;c++)
{ {
if (romspresent[c]) if (romspresent[c])
@@ -671,7 +673,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
if (!video_card_available(video_old_to_new(gfxcard))) if (!video_card_available(video_old_to_new(gfxcard)))
{ {
if (romset!=-1) MessageBox(hwnd,"Configured video BIOS not available.\nDefaulting to available romset.","PCem error",MB_OK); if (romset!=-1) MessageBox(hwnd,"Configured video BIOS not available.\nDefaulting to available romset.","86Box error",MB_OK);
for (c = GFX_MAX-1; c >= 0; c--) for (c = GFX_MAX-1; c >= 0; c--)
{ {
if (gfx_present[c]) if (gfx_present[c])
@@ -743,9 +745,9 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
} }
//; else //; else
// sleep(0); // sleep(0);
// if ((pcem_key[KEY_LCONTROL] || pcem_key[KEY_RCONTROL]) && pcem_key[KEY_END] && mousecapture) // if ((recv_key[KEY_LCONTROL] || recv_key[KEY_RCONTROL]) && recv_key[KEY_END] && mousecapture)
// if ((pcem_key[KEY_LCONTROL] || pcem_key[KEY_RCONTROL]) && pcem_key[0x58] && mousecapture) // if ((recv_key[KEY_LCONTROL] || recv_key[KEY_RCONTROL]) && recv_key[0x58] && mousecapture)
// if (pcem_key[0x58] && pcem_key[0x42] && mousecapture) // if (recv_key[0x58] && recv_key[0x42] && mousecapture)
{ {
ClipCursor(&oldclip); ClipCursor(&oldclip);
mousecapture=0; mousecapture=0;
@@ -765,18 +767,18 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
TranslateMessage(&messages); TranslateMessage(&messages);
DispatchMessage(&messages); DispatchMessage(&messages);
} }
// if ((pcem_key[KEY_LCONTROL] || pcem_key[KEY_RCONTROL]) && pcem_key[KEY_END] && mousecapture) // if ((recv_key[KEY_LCONTROL] || recv_key[KEY_RCONTROL]) && recv_key[KEY_END] && mousecapture)
if (pcem_key[0x58] && pcem_key[0x42] && mousecapture) if (recv_key[0x58] && recv_key[0x42] && mousecapture)
{ {
ClipCursor(&oldclip); ClipCursor(&oldclip);
ShowCursor(TRUE); ShowCursor(TRUE);
mousecapture=0; mousecapture=0;
} }
if ((pcem_key[0x1D] || pcem_key[0x9D]) && if ((recv_key[0x1D] || recv_key[0x9D]) &&
(pcem_key[0x38] || pcem_key[0xB8]) && (recv_key[0x38] || recv_key[0xB8]) &&
(pcem_key[0x51] || pcem_key[0xD1]) && (recv_key[0x51] || recv_key[0xD1]) &&
video_fullscreen) video_fullscreen)
{ {
leave_fullscreen(); leave_fullscreen();
@@ -987,7 +989,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
PostQuitMessage (0); /* send a WM_QUIT to the message queue */ PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break; break;
case IDM_DISC_A: case IDM_DISC_A:
if (!getfile(hwnd,"Disc image (*.IMG;*.IMA;*.FDI)\0*.IMG;*.IMA;*.FDI\0All files (*.*)\0*.*\0",discfns[0])) if (!getfile(hwnd,"Disc image (*.12;*.144;*.360;*.720;*.DSK;*.IMG;*.IMA;*.FDI;*.FLP;*.XDF;*.VFD)\0*.12;*.144;*.360;*.720;*.DSK;*.IMG;*.IMA;*.FDI;*.FLP;*.XDF;*.VFD\0All files (*.*)\0*.*\0",discfns[0]))
{ {
disc_close(0); disc_close(0);
disc_load(0, openfilestring); disc_load(0, openfilestring);
@@ -995,7 +997,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
} }
break; break;
case IDM_DISC_B: case IDM_DISC_B:
if (!getfile(hwnd,"Disc image (*.IMG;*.IMA;*.FDI)\0*.IMG;*.IMA;*.FDI\0All files (*.*)\0*.*\0",discfns[1])) if (!getfile(hwnd,"Disc image (*.12;*.144;*.360;*.720;*.DSK;*.IMG;*.IMA;*.FDI;*.FLP;*.XDF;*.VFD)\0*.12;*.144;*.360;*.720;*.DSK;*.IMG;*.IMA;*.FDI;*.FLP;*.XDF;*.VFD\0All files (*.*)\0*.*\0",discfns[1]))
{ {
disc_close(1); disc_close(1);
disc_load(1, openfilestring); disc_load(1, openfilestring);
@@ -1060,7 +1062,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (video_fullscreen_first) if (video_fullscreen_first)
{ {
video_fullscreen_first = 0; video_fullscreen_first = 0;
MessageBox(hwnd, "Use CTRL + ALT + PAGE DOWN to return to windowed mode", "PCem", MB_OK); MessageBox(hwnd, "Use CTRL + ALT + PAGE DOWN to return to windowed mode", "86Box", MB_OK);
} }
startblit(); startblit();
video_wait_for_blit(); video_wait_for_blit();
@@ -1092,7 +1094,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
pause = 1; pause = 1;
if (!getfile(hwnd, "Configuration (*.CFG)\0*.CFG\0All files (*.*)\0*.*\0", "")) if (!getfile(hwnd, "Configuration (*.CFG)\0*.CFG\0All files (*.*)\0*.*\0", ""))
{ {
if (MessageBox(NULL, "This will reset PCem!\nOkay to continue?", "PCem", MB_OKCANCEL) == IDOK) if (MessageBox(NULL, "This will reset 86Box!\nOkay to continue?", "86Box", MB_OKCANCEL) == IDOK)
{ {
loadconfig(openfilestring); loadconfig(openfilestring);
config_save(config_file_default); config_save(config_file_default);
@@ -1114,7 +1116,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case IDM_CDROM_DISABLED: case IDM_CDROM_DISABLED:
if (cdrom_enabled) if (cdrom_enabled)
{ {
if (MessageBox(NULL,"This will reset PCem!\nOkay to continue?","PCem",MB_OKCANCEL) != IDOK) if (MessageBox(NULL,"This will reset 86Box!\nOkay to continue?","86Box",MB_OKCANCEL) != IDOK)
break; break;
} }
if (!cdrom_enabled) if (!cdrom_enabled)
@@ -1145,7 +1147,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case IDM_CDROM_EMPTY: case IDM_CDROM_EMPTY:
if (!cdrom_enabled) if (!cdrom_enabled)
{ {
if (MessageBox(NULL,"This will reset PCem!\nOkay to continue?","PCem",MB_OKCANCEL) != IDOK) if (MessageBox(NULL,"This will reset 86Box!\nOkay to continue?","86Box",MB_OKCANCEL) != IDOK)
break; break;
} }
if ((cdrom_drive == 0) && cdrom_enabled) if ((cdrom_drive == 0) && cdrom_enabled)
@@ -1184,7 +1186,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
{ {
if (!cdrom_enabled) if (!cdrom_enabled)
{ {
if (MessageBox(NULL,"This will reset PCem!\nOkay to continue?","PCem",MB_OKCANCEL) != IDOK) if (MessageBox(NULL,"This will reset 86Box!\nOkay to continue?","86Box",MB_OKCANCEL) != IDOK)
break; break;
} }
old_cdrom_drive = cdrom_drive; old_cdrom_drive = cdrom_drive;
@@ -1225,7 +1227,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
{ {
if (!cdrom_enabled) if (!cdrom_enabled)
{ {
if (MessageBox(NULL,"This will reset PCem!\nOkay to continue?","PCem",MB_OKCANCEL) != IDOK) if (MessageBox(NULL,"This will reset 86Box!\nOkay to continue?","86Box",MB_OKCANCEL) != IDOK)
break; break;
} }
new_cdrom_drive = LOWORD(wParam)-IDM_CDROM_REAL; new_cdrom_drive = LOWORD(wParam)-IDM_CDROM_REAL;
@@ -1316,7 +1318,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (!(scancode & 0xf00)) if (!(scancode & 0xf00))
{ {
rawinputkey[scancode & 0x1ff] = !(rawKB.Flags & RI_KEY_BREAK); rawinputkey[scancode & 0x1ff] = !(rawKB.Flags & RI_KEY_BREAK);
pcem_key[scancode & 0x1ff] = rawinputkey[scancode & 0x1ff]; recv_key[scancode & 0x1ff] = rawinputkey[scancode & 0x1ff];
} }
} }
else else
@@ -1327,7 +1329,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (!(scancode & 0xf00)) if (!(scancode & 0xf00))
{ {
rawinputkey[scancode & 0x1ff] = !(rawKB.Flags & RI_KEY_BREAK); rawinputkey[scancode & 0x1ff] = !(rawKB.Flags & RI_KEY_BREAK);
pcem_key[scancode & 0x1ff] = rawinputkey[scancode & 0x1ff]; recv_key[scancode & 0x1ff] = rawinputkey[scancode & 0x1ff];
} }
} }
} }

View File

@@ -6,8 +6,8 @@ extern int mousecapture;
extern "C" { extern "C" {
#endif #endif
#define szClassName "PCemMainWnd" #define szClassName "86BoxMainWnd"
#define szSubClassName "PCemSubWnd" #define szSubClassName "86BoxSubWnd"
void leave_fullscreen(); void leave_fullscreen();