Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hpcmips/stand/pbsdboot - Pbsdboot.exe is compiled f...
details: https://anonhg.NetBSD.org/src/rev/62b990b2ca04
branches: trunk
changeset: 483827:62b990b2ca04
user: takemura <takemura%NetBSD.org@localhost>
date: Sun Mar 19 11:10:57 2000 +0000
description:
- Pbsdboot.exe is compiled for WindowsCE 2.00.
Use Pbsdboot1.exe for Windows CE 1.01.
- Doesn't display 'MEMORI KA-DO'(Japanese KANA) if SystemDefaultLangID
isn't Japanese.
- Set up Windows color palette for 8 bpp machine.
diffstat:
sys/arch/hpcmips/stand/pbsdboot/Makefile | 15 +-
sys/arch/hpcmips/stand/pbsdboot/main.c | 179 +-
sys/arch/hpcmips/stand/pbsdboot/palette.c | 231 +
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.c | 3 +-
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.config | 3 +-
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.dsp | 4 +
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.h | 21 +-
sys/arch/hpcmips/stand/pbsdboot/pbsdboot.uu | 5399 +++++++++++-----------
sys/arch/hpcmips/stand/pbsdboot/pbsdboot1.uu | 2859 ++++++++++++
sys/arch/hpcmips/stand/pbsdboot/preference.c | 42 +-
10 files changed, 5868 insertions(+), 2888 deletions(-)
diffs (truncated from 8996 to 300 lines):
diff -r 46e7a0bc49b1 -r 62b990b2ca04 sys/arch/hpcmips/stand/pbsdboot/Makefile
--- a/sys/arch/hpcmips/stand/pbsdboot/Makefile Sun Mar 19 10:46:17 2000 +0000
+++ b/sys/arch/hpcmips/stand/pbsdboot/Makefile Sun Mar 19 11:10:57 2000 +0000
@@ -1,10 +1,19 @@
-# $NetBSD: Makefile,v 1.2 1999/12/04 02:43:48 takemura Exp $
+# $NetBSD: Makefile,v 1.3 2000/03/19 11:10:57 takemura Exp $
all: pbsdboot.exe
pbsdboot.exe: pbsdboot.uu
uudecode pbsdboot.uu
chmod 755 pbsdboot.exe
+ uudecode pbsdboot1.uu
+ chmod 755 pbsdboot1.exe
-uu: WMIPSDbg/pbsdboot.exe
- uuencode WMIPSDbg/pbsdboot.exe pbsdboot.exe > pbsdboot.uu
+uu::
+ if [ X"`strings WMIPSDbg/pbsdboot.exe | grep 'Compiled for WinCE'`" = \
+ X'Compiled for WinCE 1.01' ]; then \
+ echo This binary is compiled for WinCE 1.01; \
+ uuencode WMIPSDbg/pbsdboot.exe pbsdboot1.exe > pbsdboot1.uu; \
+ else \
+ echo This binary is compiled for WinCE 2.00; \
+ uuencode WMIPSDbg/pbsdboot.exe pbsdboot.exe > pbsdboot.uu; \
+ fi
diff -r 46e7a0bc49b1 -r 62b990b2ca04 sys/arch/hpcmips/stand/pbsdboot/main.c
--- a/sys/arch/hpcmips/stand/pbsdboot/main.c Sun Mar 19 10:46:17 2000 +0000
+++ b/sys/arch/hpcmips/stand/pbsdboot/main.c Sun Mar 19 11:10:57 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.32 2000/03/11 09:05:17 shin Exp $ */
+/* $NetBSD: main.c,v 1.33 2000/03/19 11:10:57 takemura Exp $ */
/*-
* Copyright (c) 1999 Shin Takemura.
@@ -39,6 +39,38 @@
#include <commctrl.h>
#include <res/resource.h>
+/*
+ * If you modify this program and update pbsdboot.uu,
+ * change version string which is coded in main.c
+ * appropriately.
+ *
+ * The version string is in format:
+ *
+ * Version A.B.C YYYY.MM.DD
+ *
+ * in where:
+ *
+ * A: Don't change this.
+ * B: Increment this number if you change program's behavior,
+ * fix some bugs or add new features.
+ * C: Increment this number if you change/add some
+ * parameters, constants, windows' resources.
+ * YYYY.MM.DD: date
+ */
+TCHAR *version_string =
+ TEXT("PocketBSD boot loader\r\n")
+ TEXT("Version 1.11.0 2000.03.19\r\n")
+#if ( _WIN32_WCE < 200 )
+ TEXT("Compiled for WinCE 1.01\r\n")
+#else
+ TEXT("Compiled for WinCE 2.00\r\n")
+#endif
+ TEXT("\r\n")
+ TEXT("Copyright(C) 1999 Shin Takemura,\r\n")
+ TEXT("All rights reserved.\r\n")
+ TEXT("\r\n")
+ TEXT("http://www.netbsd.org/Ports/hpcmips\r\n");
+
/*-----------------------------------------------------------------------------
type difinitions
@@ -82,6 +114,15 @@
TCHAR szAppName[ ] = TEXT("PocketBSD boot");
TCHAR szTitle[ ] = TEXT("Welcome to PocketBSD!");
+/*
+ * Wince_conf identify executable binary file.
+ */
+#if ( _WIN32_WCE < 200 )
+static char *wince_conf = "Compiled for WinCE 1.01";
+#else
+static char *wince_conf = "Compiled for WinCE 2.00";
+#endif
+
struct fb_type fb_types[] = {
{ BIFB_D2_M2L_3, TEXT(BIFBN_D2_M2L_3) },
{ BIFB_D2_M2L_3x2, TEXT(BIFBN_D2_M2L_3x2) },
@@ -238,18 +279,29 @@
TCHAR unicode_memory_card2[] = { UNICODE_MEMORY_CARD, TEXT('2'), TEXT('\\') };
#endif
-TCHAR* path_list[] = {
- TEXT("/"),
- TEXT("2:/"),
- TEXT("\\"),
- TEXT("\\My Documents\\"),
- TEXT("\\Storage Card\\"),
- TEXT("\\Storage Card1\\"),
- TEXT("\\Storage Card2\\"),
+#define LANGID_DEFAULT MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT)
+struct path_s path_list[] = {
+ { TEXT("/"),
+ LANGID_DEFAULT, 0 },
+ { TEXT("2:/"),
+ LANGID_DEFAULT, 0 },
+ { TEXT("\\"),
+ LANGID_DEFAULT, 0 },
+ { TEXT("\\My Documents\\"),
+ LANGID_DEFAULT, 0 },
+ { TEXT("\\Storage Card\\"),
+ LANGID_DEFAULT, PATH_SAVE },
+ { TEXT("\\Storage Card1\\"),
+ LANGID_DEFAULT, PATH_SAVE },
+ { TEXT("\\Storage Card2\\"),
+ LANGID_DEFAULT, PATH_SAVE },
#ifdef UNDER_CE
- unicode_memory_card,
- unicode_memory_card1,
- unicode_memory_card2,
+ { unicode_memory_card,
+ MAKELANGID(LANG_JAPANESE, SUBLANG_DEFAULT), PATH_SAVE },
+ { unicode_memory_card1,
+ MAKELANGID(LANG_JAPANESE, SUBLANG_DEFAULT), PATH_SAVE },
+ { unicode_memory_card2,
+ MAKELANGID(LANG_JAPANESE, SUBLANG_DEFAULT), PATH_SAVE },
#endif
};
int path_list_items = ARRAYSIZEOF(path_list);
@@ -384,7 +436,7 @@
fb_settings[0].platid_machine = pref.platid_machine;
} else {
TCHAR tmpbuf[PATHBUFLEN];
- wsprintf(tmpbuf, TEXT("%s%S"), path_list[0], "netbsd");
+ wsprintf(tmpbuf, TEXT("%s%S"), path_list[0].name, "netbsd");
SetDlgItemText(hWndMain, IDC_STATUS,
TEXT("preferences not loaded."));
@@ -410,10 +462,14 @@
* initialize kernel file name list.
*/
for (i = 0; i < path_list_items; i++) {
- TCHAR tmpbuf[1024];
- wsprintf(tmpbuf, TEXT("%s%S"), path_list[i], "netbsd");
- SendDlgItemMessage(hWndMain, IDC_KERNEL, CB_ADDSTRING, 0,
- (LPARAM)tmpbuf);
+ if (path_list[i].langid == LANGID_DEFAULT ||
+ path_list[i].langid == GetSystemDefaultLangID()) {
+ TCHAR tmpbuf[1024];
+ wsprintf(tmpbuf, TEXT("%s%S"),
+ path_list[i].name, "netbsd");
+ SendDlgItemMessage(hWndMain, IDC_KERNEL,
+ CB_ADDSTRING, 0, (LPARAM)tmpbuf);
+ }
}
#ifdef ADDITIONAL_KERNELS
for (i = 0; i < kernel_list_items; i++) {
@@ -474,6 +530,10 @@
case WM_INITDIALOG:
return (1);
+ case WM_PALETTECHANGED:
+ palette_check(hWnd);
+ break;
+
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDCANCEL:
@@ -490,35 +550,13 @@
{
switch (message) {
case WM_INITDIALOG:
- /*
- * If you modify this program and update pbsdboot.uu,
- * change version string which is coded in main.c
- * appropriately.
- *
- * The version string is in format:
- *
- * Version A.B.C YYYY.MM.DD
- *
- * in where:
- *
- * A: Don't change this.
- * B: Increment this number if you change program's behavior,
- * fix some bugs or add new features.
- * C: Increment this number if you change/add some
- * parameters, constants, windows' resources.
- * YYYY.MM.DD: date
- */
- SetDlgItemText(hWnd, IDC_ABOUT_EDIT,
- TEXT("PocketBSD boot loader\r\n")
- TEXT("Version 1.10.2 2000.02.27\r\n")
- TEXT("\r\n")
- TEXT("Copyright(C) 1999 Shin Takemura,\r\n")
- TEXT("All rights reserved.\r\n")
- TEXT("\r\n")
- TEXT("http://www02.u-page.so-net.ne.jp/ca2/takemura/\r\n")
- );
+ SetDlgItemText(hWnd, IDC_ABOUT_EDIT, version_string);
return (1);
+ case WM_PALETTECHANGED:
+ palette_check(hWnd);
+ break;
+
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_ABOUT_EDIT:
@@ -691,6 +729,10 @@
}
return (1);
+ case WM_PALETTECHANGED:
+ palette_check(hWnd);
+ break;
+
case WM_VSCROLL:
if ((HWND)lParam == GetDlgItem(hWnd, IDC_FB_ADDRSPIN)) {
long addr;
@@ -790,12 +832,19 @@
if (0 <= progress) {
SendDlgItemMessage(hDlgLoad, IDC_PROGRESS,
PBM_SETPOS, (WPARAM)progress, (LPARAM)NULL);
- } else
- if (pref.check_last_chance) {
- if (msg_printf(MB_YESNO | MB_ICONHAND,
- TEXT("Last chance..."),
- TEXT("Push OK to boot.")) != IDYES) {
- dlgStatus = IDCANCEL;
+ } else {
+ if (pref.check_last_chance) {
+ if (msg_printf(MB_YESNO | MB_ICONHAND,
+ TEXT("Last chance..."),
+ TEXT("Push OK to boot.")) != IDYES) {
+ dlgStatus = IDCANCEL;
+ }
+ }
+ palette_set(hDlgLoad);
+ if (palette_succeeded == -1) {
+ msg_printf(MSG_ERROR,
+ TEXT("Warning"),
+ TEXT("Sorry, palette failed"));
}
}
@@ -827,10 +876,9 @@
switch (message) {
case WM_CREATE:
sndPlaySound(TEXT("OpenProg"), SND_NODEFAULT | SND_ASYNC);
-
hWndCB = CommandBar_Create(hInst, hWnd, 1);
CommandBar_AddAdornments(hWndCB, STD_HELP, (DWORD)NULL);
-
+ palette_init(hWnd);
break;
case WM_PAINT:
@@ -843,6 +891,10 @@
}
break;
+ case WM_PALETTECHANGED:
+ palette_check(hWnd);
+ break;
+
case WM_HELP:
/*
MessageBox (NULL, TEXT("HELP NOT AVAILABLE"),
@@ -969,28 +1021,7 @@
wstrcpy(pref.kernel_name, wkernel_name);
wstrcpy(pref.options, woptions);
- if (where_pref_load_from) {
- pref_write(where_pref_load_from, &pref);
- } else {
- TCHAR *p, t;
- TCHAR *last_separator = NULL;
- TCHAR tmpbuf[PATHBUFLEN];
- for (p = wkernel_name; *p != 0; p++) {
- if (*p == TEXT('\\')) {
- last_separator = p;
- }
- }
- if (last_separator != NULL) {
- p = last_separator + 1;
- }
- t = *p;
- *p = 0;
- wsprintf(tmpbuf,
- TEXT("%s%s"),
- wkernel_name, PREFNAME);
- *p = t;
- pref_write(tmpbuf, &pref);
- }
+ pref_save(path_list, path_list_items);
SetBootInfo(&bi, &fb_settings[pref.setting_idx]);
Home |
Main Index |
Thread Index |
Old Index