Skip to content

Commit

Permalink
fix windows resource (T.Yui)
Browse files Browse the repository at this point in the history
  • Loading branch information
yui committed Mar 24, 2005
1 parent 0ab890f commit 49cd904
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 127 deletions.
11 changes: 6 additions & 5 deletions pccore.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ static void pccore_set(void) {
// HDDの接続 (I/Oの使用状態が変わるので..
if (np2cfg.dipsw[1] & 0x20) {
pccore.hddif |= PCHDD_IDE;
#if defined(SUPPORT_IDEIO)
sxsi_setdevtype(0x02, SXSIDEV_CDROM);
#endif
}
else {
sxsi_setdevtype(0x02, SXSIDEV_NC);
}

// 拡張メモリ
Expand Down Expand Up @@ -222,11 +228,6 @@ void pccore_init(void) {
dispsync_initialize();
sxsi_initialize();

// CDドライブの接続
#if defined(SUPPORT_IDEIO)
sxsi_setdevtype(0x02, SXSIDEV_CDROM);
#endif

font_initialize();
font_load(np2cfg.fontfile, TRUE);
maketext_initialize();
Expand Down
16 changes: 1 addition & 15 deletions win9x/NP21.RC
Original file line number Diff line number Diff line change
Expand Up @@ -761,21 +761,6 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "E&xit", IDM_EXIT
END
POPUP "&HardDisk"
BEGIN
POPUP "SASI-&1"
BEGIN
MENUITEM "&Open...", IDM_SASI1OPEN
MENUITEM SEPARATOR
MENUITEM "&Remove", IDM_SASI1EJECT
END
POPUP "SASI-&2"
BEGIN
MENUITEM "&Open...", IDM_SASI2OPEN
MENUITEM SEPARATOR
MENUITEM "&Remove", IDM_SASI2EJECT
END
END
POPUP "&Screen"
BEGIN
MENUITEM "&Window", IDM_WINDOW
Expand Down Expand Up @@ -1046,6 +1031,7 @@ BEGIN
IDS_STATLOAD7 "Load 7"
IDS_STATLOAD8 "Load 8"
IDS_STATLOAD9 "Load 9"
IDS_HDD "&HardDisk"
IDS_OPEN "&Open..."
IDS_EJECT "&Eject"
IDS_REMOVE "&Remove"
Expand Down
22 changes: 18 additions & 4 deletions win9x/dialog/d_disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ static const TCHAR sasiui_filter[] = \
_T("*.thd;*.nhd;*.hdi\0");
static const FILESEL sasiui = {sasiui_title, tchar_thd, sasiui_filter, 4};

#if defined(SUPPORT_IDEIO)
static const TCHAR isoui_title[] = _T("Select ISO-9660 image");
static const TCHAR tchar_iso[] = _T("iso");
static const TCHAR isoui_filter[] = \
_T("ISO-9660 image files\0") \
_T("*.iso;*.img\0") \
_T("All Files\0") \
_T("*.*\0");
static const FILESEL isoui = {isoui_title, tchar_iso, isoui_filter, 1};
#endif

#if defined(SUPPORT_SCSI)
static const TCHAR scsiui_title[] = _T("Select SCSI HDD image");
static const TCHAR scsiui_filter[] = \
Expand Down Expand Up @@ -107,27 +118,30 @@ const OEMCHAR *p;
const FILESEL *hddui;
OEMCHAR path[MAX_PATH];

p = diskdrv_getsxsi(drv);
num = drv & 0x0f;
p = NULL;
hddui = NULL;
if (!(drv & 0x20)) { // SASI/IDE
if (num < 2) {
p = np2cfg.sasihdd[num];
hddui = &sasiui;
}
#if defined(SUPPORT_IDEIO)
else if (num == 2) {
hddui = &isoui;
}
#endif
}
#if defined(SUPPORT_SCSI)
else { // SCSI
if (num < 4) {
p = np2cfg.scsihdd[num];
hddui = &scsiui;
}
}
#endif
if (hddui == NULL) {
return;
}
if (p[0] == '\0') {
if ((p == NULL) || (p[0] == '\0')) {
p = hddfolder;
}
file_cpyname(path, p, NELEMENTS(path));
Expand Down
114 changes: 74 additions & 40 deletions win9x/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void menu_addmenubar(HMENU popup, HMENU menubar) {
}

static void insertresmenu(HMENU menu, UINT pos, UINT flag,
UINT item, UINT str) {
UINT32 item, UINT str) {

TCHAR tmp[128];

Expand Down Expand Up @@ -189,48 +189,67 @@ void sysmenu_setscrnmul(UINT8 value) {

typedef struct {
UINT16 title;
UINT16 items;
MENUITEMS item[1];
} SUBMITEMS;

typedef struct {
UINT16 title;
UINT16 items;
MENUITEMS item[3];
} DISKMENU;

static const DISKMENU fddmenu[4] = {
{IDS_FDD1, {{IDM_FDD1OPEN, IDS_OPEN},
{0, 0},
{IDM_FDD1EJECT, IDS_EJECT}}},
{IDS_FDD2, {{IDM_FDD2OPEN, IDS_OPEN},
{0, 0},
{IDM_FDD2EJECT, IDS_EJECT}}},
{IDS_FDD3, {{IDM_FDD3OPEN, IDS_OPEN},
{0, 0},
{IDM_FDD3EJECT, IDS_EJECT}}},
{IDS_FDD4, {{IDM_FDD4OPEN, IDS_OPEN},
{0, 0},
{IDM_FDD4EJECT, IDS_EJECT}}}};

static void insdiskmenu(HMENU hMenu, UINT pos, const DISKMENU *m) {
} SUBMITEM3;

static const SUBMITEM3 fddmenu[4] = {
{IDS_FDD1, 3,
{{IDM_FDD1OPEN, IDS_OPEN}, {0, 0}, {IDM_FDD1EJECT, IDS_EJECT}}},
{IDS_FDD2, 3,
{{IDM_FDD2OPEN, IDS_OPEN}, {0, 0}, {IDM_FDD2EJECT, IDS_EJECT}}},
{IDS_FDD3, 3,
{{IDM_FDD3OPEN, IDS_OPEN}, {0, 0}, {IDM_FDD3EJECT, IDS_EJECT}}},
{IDS_FDD4, 3,
{{IDM_FDD4OPEN, IDS_OPEN}, {0, 0}, {IDM_FDD4EJECT, IDS_EJECT}}}};

#if defined(SUPPORT_IDEIO)
static const SUBMITEM3 side[3] = {
{IDS_IDE0, 3,
{{IDM_IDE0OPEN, IDS_OPEN}, {0, 0}, {IDM_IDE0EJECT, IDS_REMOVE}}},
{IDS_IDE1, 3,
{{IDM_IDE1OPEN, IDS_OPEN}, {0, 0}, {IDM_IDE1EJECT, IDS_REMOVE}}},
{IDS_IDE2, 3,
{{IDM_IDE2OPEN, IDS_OPEN}, {0, 0}, {IDM_IDE2EJECT, IDS_EJECT}}}};
#else
static const SUBMITEM3 ssasi[2] = {
{IDS_SASI1, 3,
{{IDM_IDE0OPEN, IDS_OPEN}, {0, 0}, {IDM_IDE0EJECT, IDS_REMOVE}}},
{IDS_SASI2, 3,
{{IDM_IDE1OPEN, IDS_OPEN}, {0, 0}, {IDM_IDE1EJECT, IDS_REMOVE}}}};
#endif

#if defined(SUPPORT_SCSI)
static const SUBMITEM3 sscsi[4] = {
{IDS_SCSI0, 3,
{{IDM_SCSI0OPEN, IDS_OPEN}, {0, 0}, {IDM_SCSI0EJECT, IDS_REMOVE}}},
{IDS_SCSI1, 3,
{{IDM_SCSI1OPEN, IDS_OPEN}, {0, 0}, {IDM_SCSI1EJECT, IDS_REMOVE}}},
{IDS_SCSI2, 3,
{{IDM_SCSI2OPEN, IDS_OPEN}, {0, 0}, {IDM_SCSI2EJECT, IDS_REMOVE}}},
{IDS_SCSI3, 3,
{{IDM_SCSI3OPEN, IDS_OPEN}, {0, 0}, {IDM_SCSI3EJECT, IDS_REMOVE}}}};
#endif

HMENU hSubMenu;

static void insdiskmenu(HMENU hMenu, UINT pos, const void *item) {

HMENU hSubMenu;
const SUBMITEMS *smi;

hSubMenu = CreatePopupMenu();
insertresmenus(hSubMenu, 0, m->item, 3);
smi = (SUBMITEMS *)item;
insertresmenus(hSubMenu, 0, smi->item, smi->items);
insertresmenu(hMenu, pos, MF_BYPOSITION | MF_POPUP,
(UINT)hSubMenu, m->title);
(UINT)hSubMenu, smi->title);
}

#if defined(SUPPORT_SCSI)
static const DISKMENU scsimenu[4] = {
{IDS_SCSI0, {{IDM_SCSI0OPEN, IDS_OPEN},
{0, 0},
{IDM_SCSI0EJECT, IDS_REMOVE}}},
{IDS_SCSI1, {{IDM_SCSI1OPEN, IDS_OPEN},
{0, 0},
{IDM_SCSI1EJECT, IDS_REMOVE}}},
{IDS_SCSI2, {{IDM_SCSI2OPEN, IDS_OPEN},
{0, 0},
{IDM_SCSI2EJECT, IDS_REMOVE}}},
{IDS_SCSI3, {{IDM_SCSI3OPEN, IDS_OPEN},
{0, 0},
{IDM_SCSI3EJECT, IDS_REMOVE}}}};
#endif

#if defined(SUPPORT_STATSAVE)
static const TCHAR xmenu_stat[] = _T("S&tat");
Expand Down Expand Up @@ -262,6 +281,7 @@ void xmenu_initialize(void) {

HMENU hMenu;
HMENU hSubMenu;
UINT subpos;
UINT i;

hMenu = np2class_gethmenu(hWndMain);
Expand All @@ -276,15 +296,29 @@ void xmenu_initialize(void) {
IDM_WAVEREC, IDS_WAVEREC);
#endif

hSubMenu = CreatePopupMenu();
subpos = 0;
#if defined(SUPPORT_IDEIO)
for (i=0; i<NELEMENTS(side); i++) {
insdiskmenu(hSubMenu, subpos++, side + i);
}
#else
for (i=0; i<NELEMENTS(ssasi); i++) {
insdiskmenu(hSubMenu, subpos++, ssasi + i);
}
#endif
#if defined(SUPPORT_SCSI)
hSubMenu = GetSubMenu(hMenu, 1);
AppendMenu(hSubMenu, MF_SEPARATOR, 0, NULL);
for (i=0; i<4; i++) {
insdiskmenu(hSubMenu, i + 3, scsimenu + i);
subpos++;
for (i=0; i<NELEMENTS(sscsi); i++) {
insdiskmenu(hSubMenu, subpos++, sscsi + i);
}
#endif
insertresmenu(hMenu, 1, MF_BYPOSITION | MF_POPUP,
(UINT32)hSubMenu, IDS_HDD);

for (i=4; i--;) {
for (i=4; i>0;) {
i--;
if (np2cfg.fddequip & (1 << i)) {
insdiskmenu(hMenu, 1, fddmenu + i);
}
Expand Down
22 changes: 18 additions & 4 deletions win9x/np2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,25 +443,38 @@ static void np2cmd(HWND hWnd, UINT16 cmd) {
toolwin_setfdd(3, NULL);
break;

case IDM_SASI1OPEN:
case IDM_IDE0OPEN:
winuienter();
dialog_changehdd(hWnd, 0x00);
winuileave();
break;

case IDM_SASI1EJECT:
case IDM_IDE0EJECT:
diskdrv_sethdd(0x00, NULL);
break;

case IDM_SASI2OPEN:
case IDM_IDE1OPEN:
winuienter();
dialog_changehdd(hWnd, 0x01);
winuileave();
break;

case IDM_SASI2EJECT:
case IDM_IDE1EJECT:
diskdrv_sethdd(0x01, NULL);
break;

#if defined(SUPPORT_IDEIO)
case IDM_IDE2OPEN:
winuienter();
dialog_changehdd(hWnd, 0x02);
winuileave();
break;

case IDM_IDE2EJECT:
diskdrv_sethdd(0x02, NULL);
break;
#endif

#if defined(SUPPORT_SCSI)
case IDM_SCSI0OPEN:
winuienter();
Expand Down Expand Up @@ -503,6 +516,7 @@ static void np2cmd(HWND hWnd, UINT16 cmd) {
diskdrv_sethdd(0x23, NULL);
break;
#endif

case IDM_WINDOW:
changescreen(scrnmode & (~SCRNMODE_FULLSCREEN));
break;
Expand Down
16 changes: 1 addition & 15 deletions win9x/np2.rc
Original file line number Diff line number Diff line change
Expand Up @@ -761,21 +761,6 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "E&xit", IDM_EXIT
END
POPUP "&HardDisk"
BEGIN
POPUP "SASI-&1"
BEGIN
MENUITEM "&Open...", IDM_SASI1OPEN
MENUITEM SEPARATOR
MENUITEM "&Remove", IDM_SASI1EJECT
END
POPUP "SASI-&2"
BEGIN
MENUITEM "&Open...", IDM_SASI2OPEN
MENUITEM SEPARATOR
MENUITEM "&Remove", IDM_SASI2EJECT
END
END
POPUP "&Screen"
BEGIN
MENUITEM "&Window", IDM_WINDOW
Expand Down Expand Up @@ -1044,6 +1029,7 @@ BEGIN
IDS_STATLOAD7 "Load 7"
IDS_STATLOAD8 "Load 8"
IDS_STATLOAD9 "Load 9"
IDS_HDD "&HardDisk"
IDS_OPEN "&Open..."
IDS_EJECT "&Eject"
IDS_REMOVE "&Remove"
Expand Down
16 changes: 1 addition & 15 deletions win9x/np2res.rc
Original file line number Diff line number Diff line change
Expand Up @@ -573,21 +573,6 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "E&xit", IDM_EXIT
END
POPUP "&HardDisk"
BEGIN
POPUP "SASI-&1"
BEGIN
MENUITEM "&Open...", IDM_SASI1OPEN
MENUITEM SEPARATOR
MENUITEM "&Remove", IDM_SASI1EJECT
END
POPUP "SASI-&2"
BEGIN
MENUITEM "&Open...", IDM_SASI2OPEN
MENUITEM SEPARATOR
MENUITEM "&Remove", IDM_SASI2EJECT
END
END
POPUP "&Screen"
BEGIN
MENUITEM "&Window", IDM_WINDOW
Expand Down Expand Up @@ -792,6 +777,7 @@ BEGIN
IDS_STATLOAD7 "Load 7"
IDS_STATLOAD8 "Load 8"
IDS_STATLOAD9 "Load 9"
IDS_HDD "&HardDisk"
IDS_OPEN "&Open..."
IDS_EJECT "&Eject"
IDS_REMOVE "&Remove"
Expand Down
Loading

0 comments on commit 49cd904

Please sign in to comment.