--- np2/macos9/np2.cpp 2004/01/22 04:59:48 1.25 +++ np2/macos9/np2.cpp 2004/03/12 18:19:58 1.32 @@ -20,6 +20,7 @@ #include "pc9861k.h" #include "mpu98ii.h" #include "timing.h" +#include "keystat.h" #include "debugsub.h" #include "bios.h" #include "scrndraw.h" @@ -109,8 +110,30 @@ static void MenuBarInit(void) { if (hmenu) { AppendResMenu(hmenu, 'DRVR'); } +#if !defined(SUPPORT_SCSI) + hmenu = GetMenuHandle(IDM_HARDDISK); + if (hmenu) { + DeleteMenuItem(hmenu, 7); + DeleteMenuItem(hmenu, 6); + DeleteMenuItem(hmenu, 5); + DeleteMenuItem(hmenu, 4); + DeleteMenuItem(hmenu, 3); + } +#endif + if (!np2oscfg.I286SAVE) { + hmenu = GetMenuHandle(IDM_OTHER); + if (hmenu) { + DeleteMenuItem(hmenu, 10); + } + } InsertMenu(GetMenu(IDM_SASI1), -1); InsertMenu(GetMenu(IDM_SASI2), -1); +#if defined(SUPPORT_SCSI) + InsertMenu(GetMenu(IDM_SCSI0), -1); + InsertMenu(GetMenu(IDM_SCSI1), -1); + InsertMenu(GetMenu(IDM_SCSI2), -1); + InsertMenu(GetMenu(IDM_SCSI3), -1); +#endif InsertMenu(GetMenu(IDM_KEYBOARD), -1); InsertMenu(GetMenu(IDM_SOUND), -1); InsertMenu(GetMenu(IDM_MEMORY), -1); @@ -184,20 +207,68 @@ static void HandleMenuChoice(long wParam diskdrv_setfdd(1, NULL, 0); break; + case IDM_FDD3OPEN: + dialog_changefdd(2); + break; + + case IDM_FDD3EJECT: + diskdrv_setfdd(2, NULL, 0); + break; + + case IDM_FDD4OPEN: + dialog_changefdd(3); + break; + + case IDM_FDD4EJECT: + diskdrv_setfdd(3, NULL, 0); + break; + case IDM_SASI1OPEN: - dialog_changehdd(0); + dialog_changehdd(0x00); break; case IDM_SASI1REMOVE: - diskdrv_sethdd(0, NULL); + diskdrv_sethdd(0x00, NULL); break; case IDM_SASI2OPEN: - dialog_changehdd(1); + dialog_changehdd(0x01); break; case IDM_SASI2REMOVE: - diskdrv_sethdd(1, NULL); + diskdrv_sethdd(0x01, NULL); + break; + + case IDM_SCSI0OPEN: + dialog_changehdd(0x20); + break; + + case IDM_SCSI0REMOVE: + diskdrv_sethdd(0x20, NULL); + break; + + case IDM_SCSI1OPEN: + dialog_changehdd(0x21); + break; + + case IDM_SCSI1REMOVE: + diskdrv_sethdd(0x21, NULL); + break; + + case IDM_SCSI2OPEN: + dialog_changehdd(0x22); + break; + + case IDM_SCSI2REMOVE: + diskdrv_sethdd(0x22, NULL); + break; + + case IDM_SCSI3OPEN: + dialog_changehdd(0x23); + break; + + case IDM_SCSI3REMOVE: + diskdrv_sethdd(0x23, NULL); break; case IDM_ROLNORMAL: @@ -267,6 +338,10 @@ static void HandleMenuChoice(long wParam update |= SYS_UPDATECFG; break; + case IDM_MIDIOPT: + MPU98DialogProc(); + break; + case IDM_MIDIPANIC: rs232c_midipanic(); mpu98ii_midipanic(); @@ -333,6 +408,12 @@ static void HandleMenuChoice(long wParam update |= SYS_UPDATEOSCFG; break; + case IDM_F11USER: + menu_setf11key(4); + mackbd_resetf11(); + update |= SYS_UPDATEOSCFG; + break; + case IDM_F12MOUSE: menu_setf12key(0); mackbd_resetf12(); @@ -351,6 +432,12 @@ static void HandleMenuChoice(long wParam update |= SYS_UPDATEOSCFG; break; + case IDM_F12USER: + menu_setf12key(4); + mackbd_resetf12(); + update |= SYS_UPDATEOSCFG; + break; + case IDM_BEEPOFF: menu_setbeepvol(0); beep_setvol(0); @@ -459,6 +546,10 @@ static void HandleMenuChoice(long wParam dialog_writebmp(); break; + case IDM_CALENDAR: + CalendarDialogProc(); + break; + case IDM_DISPCLOCK: menu_setdispclk(np2oscfg.DISPCLK ^ 1); update |= SYS_UPDATECFG; @@ -671,11 +762,11 @@ static int flagload(const char *ext) { ret = IDOK; getstatfilename(path, ext, sizeof(path)); r = statsave_check(path, buf, sizeof(buf)); - if (r & (~NP2FLAG_DISKCHG)) { + if (r & (~STATFLAG_DISKCHG)) { ResumeErrorDialogProc(); ret = IDCANCEL; } - else if (r & NP2FLAG_DISKCHG) { + else if (r & STATFLAG_DISKCHG) { ret = ResumeWarningDialogProc(buf); } if (ret == IDOK) { @@ -703,6 +794,8 @@ int main(int argc, char *argv[]) { TRACEINIT(); + keystat_initialize(); + SetRect(&wRect, np2oscfg.posx, np2oscfg.posy, 100, 100); hWndMain = NewWindow(0, &wRect, "\pNeko Project II", FALSE, noGrowDocProc, (WindowPtr)-1, TRUE, 0);