|
|
| version 1.11, 2005/02/07 15:39:27 | version 1.12, 2005/02/09 20:11:36 |
|---|---|
| Line 13 | Line 13 |
| #include "newdisk.h" | #include "newdisk.h" |
| static const char fddui_title[] = "Select floppy image"; | static const OEMCHAR fddui_title[] = OEMTEXT("Select floppy image"); |
| static const char fddui_filter[] = \ | static const OEMCHAR fddui_filter[] = OEMTEXT("D88 image files (*.D88;*.D98)\0*.d88;*.88d;*.d98;*.98d\0Floppy disk images (*.XDF;*.HDM;*.DUP;*.2HD)\0*.xdf;*.hdm;*.dup;*.2hd;*.tfd\0All supported Files\0*.d88;*.88d;*.d98;*.98d;*.fdi;*.xdf;*.hdm;*.dup;*.2hd;*.tfd\0All files (*.*)\0*.*\0"); |
| "D88 image files (*.D88;*.D98)\0" \ | |
| "*.d88;*.88d;*.d98;*.98d\0" \ | |
| "Floppy disk images (*.XDF;*.HDM;*.DUP;*.2HD)\0" \ | |
| "*.xdf;*.hdm;*.dup;*.2hd;*.tfd\0" \ | |
| "All supported Files\0" \ | |
| "*.d88;*.88d;*.d98;*.98d;*.fdi;" \ | |
| "*.xdf;*.hdm;*.dup;*.2hd;*.tfd\0" \ | |
| "All files (*.*)\0*.*\0"; | |
| static const FILESEL fddui = {fddui_title, str_d88, fddui_filter, 3}; | static const FILESEL fddui = {fddui_title, str_d88, fddui_filter, 3}; |
| #if defined(SUPPORT_SASI) | #if defined(SUPPORT_SASI) |
| static const char sasiui_title[] = "Select SASI/IDE HDD image"; | static const OEMCHAR sasiui_title[] = OEMTEXT("Select SASI/IDE HDD image"); |
| #else | #else |
| static const char sasiui_title[] = "Select HDD image"; | static const OEMCHAR sasiui_title[] = OEMTEXT("Select HDD image"); |
| #endif | #endif |
| static const char sasiui_filter[] = \ | static const OEMCHAR sasiui_filter[] = OEMTEXT("Anex86 harddisk image files (*.HDI)\0*.hdi\0T98 harddisk image files (*.THD)\0*.thd\0T98-Next harddisk image files (*.NHD)\0*.nhd\0All supported Files\0*.thd;*.nhd;*.hdi\0"); |
| "Anex86 harddisk image files (*.HDI)\0" \ | |
| "*.hdi\0" \ | |
| "T98 harddisk image files (*.THD)\0" \ | |
| "*.thd\0" \ | |
| "T98-Next harddisk image files (*.NHD)\0" \ | |
| "*.nhd\0" \ | |
| "All supported Files\0" \ | |
| "*.thd;*.nhd;*.hdi\0"; | |
| static const FILESEL sasiui = {sasiui_title, str_thd, sasiui_filter, 4}; | static const FILESEL sasiui = {sasiui_title, str_thd, sasiui_filter, 4}; |
| #if defined(SUPPORT_SCSI) | #if defined(SUPPORT_SCSI) |
| static const char scsiui_title[] = "Select SCSI HDD image"; | static const OEMCHAR scsiui_title[] = OEMTEXT("Select SCSI HDD image"); |
| static const char scsiui_filter[] = \ | static const OEMCHAR scsiui_filter[] = OEMTEXT("Virtual98 harddisk image files (*.HDD)\0*.hdd\0"); |
| "Virtual98 harddisk image files (*.HDD)\0" \ | |
| "*.hdd\0"; | |
| static const FILESEL scsiui = {scsiui_title, str_hdd, scsiui_filter, 1}; | static const FILESEL scsiui = {scsiui_title, str_hdd, scsiui_filter, 1}; |
| #endif | #endif |
| static const char newdisk_title[] = "Create disk image"; | static const OEMCHAR newdisk_title[] = OEMTEXT("Create disk image"); |
| #if defined(SUPPORT_SCSI) | #if defined(SUPPORT_SCSI) |
| static const char newdisk_filter[] = \ | static const OEMCHAR newdisk_filter[] = OEMTEXT("D88 image files (*.D88;*.88D)\0*.d88;*.88d;*.d98;*.98d\0Anex86 harddisk image files (*.HDI)\0*.hdi\0T98 harddisk image files (*.THD)\0*.thd\0T98-Next harddisk image files (*.NHD)\0*.nhd\0Virtual98 harddisk image files (*.HDD)\0*.hdd\0"); |
| "D88 image files (*.D88;*.88D)\0" \ | |
| "*.d88;*.88d;*.d98;*.98d\0" \ | |
| "Anex86 harddisk image files (*.HDI)\0" \ | |
| "*.hdi\0" \ | |
| "T98 harddisk image files (*.THD)\0" \ | |
| "*.thd\0" \ | |
| "T98-Next harddisk image files (*.NHD)\0" \ | |
| "*.nhd\0" \ | |
| "Virtual98 harddisk image files (*.HDD)\0" \ | |
| "*.hdd\0"; | |
| #else | #else |
| static const char newdisk_filter[] = \ | static const OEMCHAR newdisk_filter[] = OEMTEXT("D88 image files (*.D88;*.88D)\0*.d88;*.88d;*.d98;*.98d\0Anex86 harddisk image files (*.HDI)\0*.hdi\0T98 harddisk image files (*.THD)\0*.thd\0T98-Next harddisk image files (*.NHD)\0*.nhd\0"); |
| "D88 image files (*.D88;*.88D)\0" \ | |
| "*.d88;*.88d;*.d98;*.98d\0" \ | |
| "Anex86 harddisk image files (*.HDI)\0" \ | |
| "*.hdi\0" \ | |
| "T98 harddisk image files (*.THD)\0" \ | |
| "*.thd\0" \ | |
| "T98-Next harddisk image files (*.NHD)\0" \ | |
| "*.nhd\0"; | |
| #endif | #endif |
| static const FILESEL newdiskui = {newdisk_title, str_d88, newdisk_filter, 1}; | static const FILESEL newdiskui = {newdisk_title, str_d88, newdisk_filter, 1}; |
| Line 80 static const FILESEL newdiskui = {newdis | Line 44 static const FILESEL newdiskui = {newdis |
| void dialog_changefdd(HWND hWnd, REG8 drv) { | void dialog_changefdd(HWND hWnd, REG8 drv) { |
| const char *p; | const OEMCHAR *p; |
| char path[MAX_PATH]; | OEMCHAR path[MAX_PATH]; |
| int readonly; | int readonly; |
| if (drv < 4) { | if (drv < 4) { |
| p = fdd_diskname(drv); | p = fdd_diskname(drv); |
| if ((p == NULL) || (p[0] == '\0')) { | if ((p == NULL) || (p[0] == '\0')) { |
| p = fddfolder; | p = fddfolder; |
| } | } |
| file_cpyname(path, p, sizeof(path)); | file_cpyname(path, p, NELEMENTS(path)); |
| if (dlgs_selectfile(hWnd, &fddui, path, sizeof(path), &readonly)) { | if (dlgs_selectfile(hWnd, &fddui, path, NELEMENTS(path), &readonly)) { |
| file_cpyname(fddfolder, path, sizeof(fddfolder)); | file_cpyname(fddfolder, path, NELEMENTS(fddfolder)); |
| sysmng_update(SYS_UPDATEOSCFG); | sysmng_update(SYS_UPDATEOSCFG); |
| diskdrv_setfdd(drv, path, readonly); | diskdrv_setfdd(drv, path, readonly); |
| toolwin_setfdd(drv, path); | toolwin_setfdd(drv, path); |
| Line 102 const char *p; | Line 66 const char *p; |
| void dialog_changehdd(HWND hWnd, REG8 drv) { | void dialog_changehdd(HWND hWnd, REG8 drv) { |
| UINT num; | UINT num; |
| const char *p; | const OEMCHAR *p; |
| const FILESEL *hddui; | const FILESEL *hddui; |
| char path[MAX_PATH]; | OEMCHAR path[MAX_PATH]; |
| num = drv & 0x0f; | num = drv & 0x0f; |
| p = NULL; | p = NULL; |
| Line 129 const FILESEL *hddui; | Line 93 const FILESEL *hddui; |
| if (p[0] == '\0') { | if (p[0] == '\0') { |
| p = hddfolder; | p = hddfolder; |
| } | } |
| file_cpyname(path, p, sizeof(path)); | file_cpyname(path, p, NELEMENTS(path)); |
| if (dlgs_selectfile(hWnd, hddui, path, sizeof(path), NULL)) { | if (dlgs_selectfile(hWnd, hddui, path, NELEMENTS(path), NULL)) { |
| file_cpyname(hddfolder, path, sizeof(hddfolder)); | file_cpyname(hddfolder, path, NELEMENTS(hddfolder)); |
| sysmng_update(SYS_UPDATEOSCFG); | sysmng_update(SYS_UPDATEOSCFG); |
| diskdrv_sethdd(drv, path); | diskdrv_sethdd(drv, path); |
| } | } |
| Line 140 const FILESEL *hddui; | Line 104 const FILESEL *hddui; |
| // ---- newdisk | // ---- newdisk |
| static const char str_newdisk[] = "newdisk"; | static const OEMCHAR str_newdisk[] = OEMTEXT("newdisk"); |
| static const UINT32 hddsizetbl[5] = {20, 41, 65, 80, 128}; | static const UINT32 hddsizetbl[5] = {20, 41, 65, 80, 128}; |
| static const UINT16 sasires[6] = { | static const UINT16 sasires[6] = { |
| Line 149 static const UINT16 sasires[6] = { | Line 113 static const UINT16 sasires[6] = { |
| IDC_NEWSASI30MB, IDC_NEWSASI40MB}; | IDC_NEWSASI30MB, IDC_NEWSASI40MB}; |
| static UINT8 makefdtype = DISKTYPE_2HD << 4; | static UINT8 makefdtype = DISKTYPE_2HD << 4; |
| static char disklabel[16+1]; | static OEMCHAR disklabel[16+1]; |
| static UINT hddsize; | static UINT hddsize; |
| static UINT hddminsize; | static UINT hddminsize; |
| static UINT hddmaxsize; | static UINT hddmaxsize; |
| Line 158 static LRESULT CALLBACK NewHddDlgProc(HW | Line 122 static LRESULT CALLBACK NewHddDlgProc(HW |
| WPARAM wp, LPARAM lp) { | WPARAM wp, LPARAM lp) { |
| UINT val; | UINT val; |
| char work[32]; | OEMCHAR work[32]; |
| switch (msg) { | switch (msg) { |
| case WM_INITDIALOG: | case WM_INITDIALOG: |
| SETLISTUINT32(hWnd, IDC_HDDSIZE, hddsizetbl); | SETLISTUINT32(hWnd, IDC_HDDSIZE, hddsizetbl); |
| SPRINTF(work, "(%d-%dMB)", hddminsize, hddmaxsize); | OEMSPRINTF(work, OEMTEXT("(%d-%dMB)"), hddminsize, hddmaxsize); |
| SetWindowText(GetDlgItem(hWnd, IDC_HDDLIMIT), work); | SetWindowText(GetDlgItem(hWnd, IDC_HDDLIMIT), work); |
| SetFocus(GetDlgItem(hWnd, IDC_HDDSIZE)); | SetFocus(GetDlgItem(hWnd, IDC_HDDSIZE)); |
| return(FALSE); | return(FALSE); |
| Line 172 static LRESULT CALLBACK NewHddDlgProc(HW | Line 136 static LRESULT CALLBACK NewHddDlgProc(HW |
| switch(LOWORD(wp)) { | switch(LOWORD(wp)) { |
| case IDOK: | case IDOK: |
| GetWindowText(GetDlgItem(hWnd, IDC_HDDSIZE), | GetWindowText(GetDlgItem(hWnd, IDC_HDDSIZE), |
| work, sizeof(work)); | work, NELEMENTS(work)); |
| val = (UINT)milstr_solveINT(work); | val = (UINT)milstr_solveINT(work); |
| if (val < hddminsize) { | if (val < hddminsize) { |
| val = hddminsize; | val = hddminsize; |
| Line 275 static LRESULT CALLBACK NewdiskDlgProc(H | Line 239 static LRESULT CALLBACK NewdiskDlgProc(H |
| switch(LOWORD(wp)) { | switch(LOWORD(wp)) { |
| case IDOK: | case IDOK: |
| GetWindowText(GetDlgItem(hWnd, IDC_DISKLABEL), | GetWindowText(GetDlgItem(hWnd, IDC_DISKLABEL), |
| disklabel, sizeof(disklabel)); | disklabel, NELEMENTS(disklabel)); |
| if (milstr_kanji1st(disklabel, sizeof(disklabel) - 1)) { | if (milstr_kanji1st(disklabel, NELEMENTS(disklabel) - 1)) { |
| disklabel[sizeof(disklabel) - 1] = '\0'; | disklabel[NELEMENTS(disklabel) - 1] = '\0'; |
| } | } |
| if (GetDlgItemCheck(hWnd, IDC_MAKE2DD)) { | if (GetDlgItemCheck(hWnd, IDC_MAKE2DD)) { |
| makefdtype = (DISKTYPE_2DD << 4); | makefdtype = (DISKTYPE_2DD << 4); |
| Line 312 static LRESULT CALLBACK NewdiskDlgProc(H | Line 276 static LRESULT CALLBACK NewdiskDlgProc(H |
| void dialog_newdisk(HWND hWnd) { | void dialog_newdisk(HWND hWnd) { |
| char path[MAX_PATH]; | OEMCHAR path[MAX_PATH]; |
| HINSTANCE hinst; | HINSTANCE hinst; |
| const char *ext; | const OEMCHAR *ext; |
| file_cpyname(path, fddfolder, sizeof(path)); | file_cpyname(path, fddfolder, NELEMENTS(path)); |
| file_cutname(path); | file_cutname(path); |
| file_catname(path, str_newdisk, sizeof(path)); | file_catname(path, str_newdisk, NELEMENTS(path)); |
| if (!dlgs_selectwritefile(hWnd, &newdiskui, path, sizeof(path))) { | if (!dlgs_selectwritefile(hWnd, &newdiskui, path, NELEMENTS(path))) { |
| return; | return; |
| } | } |
| hinst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE); | hinst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE); |