Commit 0e607784 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 0.4.7

Mon Nov 1 14:40:21 1993 julliard@di.epfl.ch (Alexandre Julliard) * [if1632/user.spec] Removed some duplicate entries. * [include/dialog.h] [windows/dialog.c] Implemented dialog units and fonts. Added preliminary loading of dialog resources. Preliminary implementation of DialogBox(). Implemented Get/SetDlgItem* functions. * [windows/win.c] Implemented WM_PARENTNOTIFY message. Implemented CreateWindowEx() and GetWindow(). Completed DestroyWindow(). Mon Nov 1 18:19:34 1993 Erik Bos * [loader/signal.c] Added support for int 0x11 & 0x12. * [loader/int21.c] Improved function handling. Sun Oct 31 12:38:09 1993 David Metcalfe <david@prism.demon.co.uk> * [objects/font.c] Implemented GetCharWidth(). Wed Oct 27 09:56:06 1993 John Brezak <brezak@ch.hp.com> * [Makefile] Use GNU malloc. * [include/int21.h include/wine.h] Change sc_eflags to sc_efl . * [include/wine.h] Fix misplaced #endif Include <signal.h> for NetBSD * [loader/int21.c] Don't include <sys/vfs.h> in NetBSD Do include <sys/mount.h> in NetBSD Cleanup some lint. Mon Oct 26 17:59:01 1993 Erik Bos * [include/int21.h] Added. * [loader/int21.c] Added support for many dos ints. * [misc/file.c] [include/files.h] Moved OPEN_MAX and DosDriveStruct to files.h. Sun Oct 24 13:36:50 1993 David Metcalfe <david@prism.demon.co.uk> * [controls/button.c] Implemented CHECKBOX, AUTOCHECKBOX, 3STATE, AUTO3STATE, RADIOBUTTON, AUTORADIOBUTTON, GROUPBOX controls, together with a preliminary USERBUTTON control. * [objects/text.c] Corrected bugs in TEXT_NextLine() and added handling of prefix character. * [controls/button.c] Disabled focus handling by commenting out SetFocus() calls until serious bug can be found. Oct 20, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte) * [controls/listbox.c] Listbox control window Painting cleanup, new messages processed. * [controls/scroll.c] Scroll bar control window Painting cleanup. * [controls/combo.c] Combo box control window Painting cleanup. Tue Oct 12 17:50:11 1993 julliard@di.epfl.ch (Alexandre Julliard) * [objects/color.c] [objects/palette.c] [windows/syscolor.c] Better support for the private color map. Using a private map is now the default. * [windows/win.c] Bug fix. * [include/dialog.h] [windows/dialog.c] Implemented CreateDialog*() and IsDialogMessage(). * [misc/xt.c] [windows/defwnd.c] Moved DefWindowProc() to defwnd.c. Added WM_NCCREATE, WM_NCDESTROY and WM_CTLCOLOR handling. * [windows/defdlg.c] Started the implementation of DefDlgProc(). * [windows/win.c] Added WM_NCCREATE and WM_NCDESTROY messages. Implemented IsChild(). Tue Oct 12 17:50:20 1993 David Metcalfe <david@prism.demon.co.uk> * [windows/focus.c] Implemented GetFocus() and SetFocus(). * [windows/event.c] Added processing of FocusIn and FocusOut events. * [windows/graphics.c] Added DrawFocusRect(). Sat Oct 9 14:36:57 1993 Erik Bos * [loader/int1a.c] Added more function handling. Wed Oct 6 12:21:22 1993 Erik Bos * [loader/signal.c] Split signal.c into int1a.c, int21.c and signal.c. Tue Oct 5 22:12:40 1993 David Metcalfe * [controls/static.c] [control/widgets.c] Static control class. * [objects/text.c] Added processing of additional DT_ flags to DrawText(). * [windows/win.c] [misc/xt.c] Added SetWindowText() and WM_SETTEXT processing. Tue Oct 5 22:12:40 1993 Martin Ayotte * [controls/listbox.c] Listbox control window * [controls/scroll.c] Scroll bar control window * [controls/combo.c] Combo box control window * [include/combo.h] Combo box definitions * [include/listbox.h] Listbox definitions * [include/scroll.h] Scroll bar definitions Sat Oct 2 09:35:54 1993 Bob Amstadt (bob at pooh) * [if1632/callback.c] Fixed bug in MakeProcInstance(). * [debugger/info.c] Changed x/w and x/b to display in hex. * [debugger/i386-pinsn.c] Added code to properly unassemble 16-bit indexing. Fri Oct 1 08:29:05 1993 Bob Amstadt (bob at pooh) * [loader/files.c] [misc/profile.c] System initialization file is now called "wine.ini" and can be located in the current directory, the user's home directory, or any directories specified in the WINEPATH environment variable. * [tools/build.c] [if1632/call.S] [include/regfunc.h] Changed register function stack to match sigcontext structure. Thu Sep 30 22:30:21 1993 Bob Amstadt (bob at pooh) * [loader/files.c] Created function to search a path for files to load. * [loader/wine.c] Modified exe and dll file loading to search through path specified by the environment variable WINEPATH. Thu Sep 30 22:30:21 1993 Eric Youngdale * [loader/signal.c] Bug fix. Thu Sep 30 22:30:21 1993 John Brezak * [debugger/dbg.y] [debugger/debug.l] [debugger/dtest.c] [debugger/obstack.h] Updates to allow debugger to function under NetBSD.
parent f0b2354c
Mon Nov 1 14:40:21 1993 julliard@di.epfl.ch (Alexandre Julliard)
* [if1632/user.spec]
Removed some duplicate entries.
* [include/dialog.h] [windows/dialog.c]
Implemented dialog units and fonts.
Added preliminary loading of dialog resources.
Preliminary implementation of DialogBox().
Implemented Get/SetDlgItem* functions.
* [windows/win.c]
Implemented WM_PARENTNOTIFY message.
Implemented CreateWindowEx() and GetWindow().
Completed DestroyWindow().
Mon Nov 1 18:19:34 1993 Erik Bos
* [loader/signal.c]
Added support for int 0x11 & 0x12.
* [loader/int21.c]
Improved function handling.
Sun Oct 31 12:38:09 1993 David Metcalfe <david@prism.demon.co.uk>
* [objects/font.c]
Implemented GetCharWidth().
Wed Oct 27 09:56:06 1993 John Brezak <brezak@ch.hp.com>
* [Makefile]
Use GNU malloc.
* [include/int21.h include/wine.h]
Change sc_eflags to sc_efl .
* [include/wine.h]
Fix misplaced #endif
Include <signal.h> for NetBSD
* [loader/int21.c]
Don't include <sys/vfs.h> in NetBSD
Do include <sys/mount.h> in NetBSD
Cleanup some lint.
Mon Oct 26 17:59:01 1993 Erik Bos
* [include/int21.h]
Added.
* [loader/int21.c]
Added support for many dos ints.
* [misc/file.c] [include/files.h]
Moved OPEN_MAX and DosDriveStruct to files.h.
Sun Oct 24 13:36:50 1993 David Metcalfe <david@prism.demon.co.uk>
* [controls/button.c]
Implemented CHECKBOX, AUTOCHECKBOX, 3STATE, AUTO3STATE,
RADIOBUTTON, AUTORADIOBUTTON, GROUPBOX controls, together with
a preliminary USERBUTTON control.
* [objects/text.c]
Corrected bugs in TEXT_NextLine() and added handling of prefix
character.
* [controls/button.c]
Disabled focus handling by commenting out SetFocus() calls until
serious bug can be found.
Oct 20, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/listbox.c]
Listbox control window
Painting cleanup, new messages processed.
* [controls/scroll.c]
Scroll bar control window
Painting cleanup.
* [controls/combo.c]
Combo box control window
Painting cleanup.
Tue Oct 12 17:50:11 1993 julliard@di.epfl.ch (Alexandre Julliard)
* [objects/color.c] [objects/palette.c] [windows/syscolor.c]
Better support for the private color map.
Using a private map is now the default.
* [windows/win.c]
Bug fix.
* [include/dialog.h] [windows/dialog.c]
Implemented CreateDialog*() and IsDialogMessage().
* [misc/xt.c] [windows/defwnd.c]
Moved DefWindowProc() to defwnd.c.
Added WM_NCCREATE, WM_NCDESTROY and WM_CTLCOLOR handling.
* [windows/defdlg.c]
Started the implementation of DefDlgProc().
* [windows/win.c]
Added WM_NCCREATE and WM_NCDESTROY messages.
Implemented IsChild().
Tue Oct 12 17:50:20 1993 David Metcalfe <david@prism.demon.co.uk>
* [windows/focus.c]
Implemented GetFocus() and SetFocus().
* [windows/event.c]
Added processing of FocusIn and FocusOut events.
* [windows/graphics.c]
Added DrawFocusRect().
Sat Oct 9 14:36:57 1993 Erik Bos
* [loader/int1a.c]
Added more function handling.
Wed Oct 6 12:21:22 1993 Erik Bos
* [loader/signal.c]
Split signal.c into int1a.c, int21.c and signal.c.
Tue Oct 5 22:12:40 1993 David Metcalfe
* [controls/static.c] [control/widgets.c]
Static control class.
* [objects/text.c]
Added processing of additional DT_ flags to DrawText().
* [windows/win.c] [misc/xt.c]
Added SetWindowText() and WM_SETTEXT processing.
Tue Oct 5 22:12:40 1993 Martin Ayotte
* [controls/listbox.c]
Listbox control window
* [controls/scroll.c]
Scroll bar control window
* [controls/combo.c]
Combo box control window
* [include/combo.h]
Combo box definitions
* [include/listbox.h]
Listbox definitions
* [include/scroll.h]
Scroll bar definitions
Sat Oct 2 09:35:54 1993 Bob Amstadt (bob at pooh)
* [if1632/callback.c]
Fixed bug in MakeProcInstance().
* [debugger/info.c]
Changed x/w and x/b to display in hex.
* [debugger/i386-pinsn.c]
Added code to properly unassemble 16-bit indexing.
Fri Oct 1 08:29:05 1993 Bob Amstadt (bob at pooh)
* [loader/files.c] [misc/profile.c]
System initialization file is now called "wine.ini" and can
be located in the current directory, the user's home directory,
or any directories specified in the WINEPATH environment variable.
* [tools/build.c] [if1632/call.S] [include/regfunc.h]
Changed register function stack to match sigcontext structure.
Thu Sep 30 22:30:21 1993 Bob Amstadt (bob at pooh)
* [loader/files.c]
Created function to search a path for files to load.
* [loader/wine.c]
Modified exe and dll file loading to search through path
specified by the environment variable WINEPATH.
Thu Sep 30 22:30:21 1993 Eric Youngdale
* [loader/signal.c]
Bug fix.
Thu Sep 30 22:30:21 1993 John Brezak
* [debugger/dbg.y] [debugger/debug.l] [debugger/dtest.c]
[debugger/obstack.h]
Updates to allow debugger to function under NetBSD.
Tue Sep 28 19:59:21 1993 David Metcalfe
* [windows/win.c]
......
######################################################################
# These variables are inherited by the sub-makefiles
DEBUGOPTS=
DEBUGOPTS=-DDEBUG_RESOURCE
COPTS=-O2 -m486
INCLUDE_DIR=include
LDFLAGS=
......@@ -18,7 +18,7 @@ all: $(TARGET)
dummy:
clean:
rm -f *~ *.o
rm -f *~ *.o *#
@for i in tools $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done
$(TARGET): dummy
......
......@@ -18,15 +18,42 @@ in the file "bsdmake.patch". This release requires NetBSD-current.
All:
To build Wine, first do a "make depend" and then a "make". The
executable "wine" will be built.
executable "wine" will be built. "wine" will load and run Windows'
executables. You must specify the entire path to the executable,
have the executable in the current directory, or specify a load
path with environment variable WINEPATH.
Grab a copy of Windows sol.exe (Solitaire) and run it with the command:
For example, to run Windows' solitaire:
wine sol.exe
export WINEPATH=/dos/windows;/dos/windows/system
wine sol
Have a nice game of solitaire, but be careful. Emulation isn't perfect.
So, occassionally it will crash.
WHAT'S NEW with version 0.4.7: (see ChangeLog for details)
- More dialog box functions
- More DOS interrupts
- NetBSD compatibility patches
WHAT'S NEW with version 0.4.5: (see ChangeLog for details)
- Bug fixes
- focus routines
- dialog box functions
- improvements to control windows
WHAT'S NEW with version 0.4.4: (see ChangeLog for details)
- Bug fixes
- New static control class
- Preliminary listbox, combobox and scrollbar controls
- System initialization file is now called "wine.ini", and
may be located in the user's current directory, the
user's home directory or any directory specified by
the WINEPATH environment variable.
- The loader now searches the directories specified by the
WINEPATH environment variable for programs and DLLs.
- Internal debugger now works on 386BSD.
WHAT'S NEW with version 0.4.3: (see ChangeLog for details)
- Bug fixes
- Resource loading now able to load DLL resources
......
Date: Sun, 26 Sep 93 03:18:19 EDT
From: eric@tantalus.nrl.navy.mil (Eric Youngdale)
Message-Id: <9309260718.AA13966@tantalus.nrl.navy.mil>
To: bob@amscons.amscons.com
Cc: linux-activists@Niksula.hut.fi
In-Reply-To: Bob Amstadt's message of Sat, 25 Sep 1993 23:36:32 +0300
<m0oggMt-000CrhC@amscons.amscons.com>
X-Mn-Key: WABI
>I may just be dreaming, but I'm beginning to like the idea of a built
>in debugger.
So do I. I like it so much that I wrote one. It turns out that the
disassembly code in gdb is pretty much localized to one source file, and this
was easy to splice into a simple program. In addition, there are 2 variables
that you set if you are disassembling 16 bit code, so it makes it all the
better.
Anyway, there is a parser that understands a limited set of gdb
commands (very limited, but the 'x' command is pretty functional as long as you
stick to numeric rather than symbolic addresses). The parser understands $pc
and $sp for your convenience, and you can do things like "x/10i $pc" and "info
regs" to see what is going on. In principle you can do "x/x", "x/s", "x/d",
"x/w", "x/b", "x/i" and "x/c". I implemented an "info stack" command that
simply dumps a number of bytes from the stack onto the screen, but it currently
makes no attempt to actually interpret the stack frames.
This will probably not work on non-linux systems, and I have no idea
how much work it will be to fix it. To start with we need some simple macros
to determine (based upon a segment selector) whether we are in a 16 bit or a 32
bit segment, but this should be pretty easy to fix. I shamelessly ripped off a
bunch of files from gdb, and I obviously picked the ones for linux. For other
systems you may need to make adjustments to these files somehow. It is too
late in the evening to worry about this now.
It will probably be easy to modify the parser to allow you to change
memory locations and/or register values and then continue execution. Also,
some of the hooks for using readline with the parser are in place, but it does
not work reliably for some reason, so I left it out for now. Adding gnu
readline really would bloat the package a lot. Instead I could use Rich Salz's
editlib (the canonical test case for the DLL tools), which has a command line
history feature that could be an acceptable substitute - this is much smaller
than gnu readline, but I am not sure what features are present.
-Eric
......@@ -6,7 +6,7 @@ diff -ruN ../Backup//Makefile ./Makefile
# These definitions are for the top level
TARGET=wine
-LIBS=-L. -L/usr/X386/lib -lXext -lXaw -lXt -lXmu -lX11 -lm
+LIBS=-L. -L/usr/X386/lib -lXext -lXaw -lXt -lXmu -lX11 -lm -li386
+LIBS=-L. -L/usr/X386/lib -lXext -lXaw -lXt -lXmu -lX11 -lm -li386 -lgnumalloc
OBJS=if1632/if1632.o controls/controls.o loader/loader.o \
memory/memory.o misc/misc.o objects/objects.o windows/windows.o
SUBDIRS=if1632 controls loader memory misc objects windows
......@@ -122,3 +122,12 @@ diff -ruN ../Backup//windows/Makefile ./windows/Makefile
+.if exists(.depend)
+.include ".depend"
+.endif
--- debugger/Makefile.orig Thu Sep 30 07:29:39 1993
+++ debugger/Makefile Thu Sep 30 07:27:00 1993
@@ -37,3 +37,6 @@
depend: dbg.tab.c dbg.tab.h lex.yy.c
$(CC) $(CFLAGS) -M *.c > .depend
+.if exists(.depend)
+.include ".depend"
+.endif
CFLAGS=$(COPTS) $(DEBUGOPTS) -I$(INCLUDE_DIR)
OBJS=menu.o widgets.o button.o SmeMenuButto.o WinLabel.o WinCommand.o \
WinMenuButto.o
OBJS=menu.o widgets.o button.o scroll.o listbox.o combo.o static.o \
SmeMenuButto.o WinLabel.o WinCommand.o \
WinMenuButto.o
default: controls.o
......@@ -9,7 +10,7 @@ controls.o: $(OBJS)
$(LD) -r -o controls.o $(OBJS)
clean:
rm -f *.o *~ *.s dll_* *.a
rm -f *.o *~ *.s dll_* *.a *#
depend:
$(CC) $(CFLAGS) -M *.c > .depend
......
/*
* Interface code to COMBOBOX widget
*
* Copyright Martin Ayotte, 1993
*
*/
/*
#define DEBUG_COMBO
*/
static char Copyright[] = "Copyright Martin Ayotte, 1993";
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include "windows.h"
#include "combo.h"
#include "heap.h"
#include "win.h"
#include "dirent.h"
#include <sys/stat.h>
LPHEADCOMBO ComboGetStorageHeader(HWND hwnd);
int CreateComboStruct(HWND hwnd);
void COMBOBOX_CreateComboBox(LPSTR className, LPSTR comboLabel, HWND hwnd)
{
WND *wndPtr = WIN_FindWndPtr(hwnd);
WND *parentPtr = WIN_FindWndPtr(wndPtr->hwndParent);
DWORD style;
char widgetName[15];
#ifdef DEBUG_COMBO
printf("combo: label = %s, x = %d, y = %d\n", comboLabel,
wndPtr->rectClient.left, wndPtr->rectClient.top);
printf(" width = %d, height = %d\n",
wndPtr->rectClient.right - wndPtr->rectClient.left,
wndPtr->rectClient.bottom - wndPtr->rectClient.top);
#endif
if (!wndPtr)
return;
style = wndPtr->dwStyle & 0x0000FFFF;
/*
if ((style & LBS_NOTIFY) == LBS_NOTIFY)
*/
sprintf(widgetName, "%s%d", className, wndPtr->wIDmenu);
wndPtr->winWidget = XtVaCreateManagedWidget(widgetName,
compositeWidgetClass,
parentPtr->winWidget,
XtNx, wndPtr->rectClient.left,
XtNy, wndPtr->rectClient.top,
XtNwidth, wndPtr->rectClient.right -
wndPtr->rectClient.left,
XtNheight, 16,
NULL );
GlobalUnlock(hwnd);
GlobalUnlock(wndPtr->hwndParent);
}
/***********************************************************************
* WIDGETS_ComboWndProc
*/
LONG COMBOBOX_ComboBoxWndProc( HWND hwnd, WORD message,
WORD wParam, LONG lParam )
{
WORD wRet;
RECT rect;
int y;
int width, height;
WND *wndPtr;
LPHEADCOMBO lphc;
char str[128];
static RECT rectsel;
switch(message)
{
case WM_CREATE:
CreateComboStruct(hwnd);
wndPtr = WIN_FindWndPtr(hwnd);
width = wndPtr->rectClient.right - wndPtr->rectClient.left;
height = wndPtr->rectClient.bottom - wndPtr->rectClient.top;
lphc = ComboGetStorageHeader(hwnd);
if (lphc == NULL) return 0;
lphc->hWndDrop = CreateWindow("BUTTON", "",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | BS_PUSHBUTTON,
width - 16, 0, 16, 16, hwnd, 1, wndPtr->hInstance, 0L);
lphc->hWndEdit = CreateWindow("STATIC", "",
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | SS_LEFT,
0, 0, width - 16, 16, hwnd, 1, wndPtr->hInstance, 0L);
lphc->hWndLBox = CreateWindow("LISTBOX", "",
WS_CHILD | WS_CLIPCHILDREN | WS_BORDER | WS_VSCROLL | LBS_NOTIFY,
wndPtr->rectClient.left, wndPtr->rectClient.top + 16, width, height,
wndPtr->hwndParent, 1, wndPtr->hInstance, (LPSTR)MAKELONG(0, hwnd));
/*
ShowWindow(lphc->hWndLBox, SW_HIDE);
*/
InvalidateRect(lphc->hWndEdit, NULL, TRUE);
UpdateWindow(lphc->hWndEdit);
InvalidateRect(lphc->hWndDrop, NULL, TRUE);
UpdateWindow(lphc->hWndDrop);
#ifdef DEBUG_COMBO
printf("Combo Creation Drop=%X LBox=%X!\n", lphc->hWndDrop, lphc->hWndLBox);
#endif
return 0;
case WM_DESTROY:
lphc = ComboGetStorageHeader(hwnd);
DestroyWindow(lphc->hWndDrop);
DestroyWindow(lphc->hWndEdit);
DestroyWindow(lphc->hWndLBox);
free(lphc);
#ifdef DEBUG_COMBO
printf("Combo WM_DESTROY !\n");
#endif
return 0;
case WM_COMMAND:
wndPtr = WIN_FindWndPtr(hwnd);
lphc = ComboGetStorageHeader(hwnd);
if (lphc == NULL) return 0;
if (LOWORD(lParam) == lphc->hWndDrop) {
if (HIWORD(lParam) != BN_CLICKED) return 0;
#ifdef DEBUG_COMBO
printf("CB_SHOWDROPDOWN !\n");
#endif
lphc->dwState = lphc->dwState ^ CB_SHOWDROPDOWN;
if ((lphc->dwState & CB_SHOWDROPDOWN) == CB_SHOWDROPDOWN) {
ShowWindow(lphc->hWndLBox, SW_SHOW);
}
else {
ShowWindow(lphc->hWndLBox, SW_HIDE);
y = SendMessage(lphc->hWndLBox, LB_GETCURSEL, 0, 0L);
SendMessage(lphc->hWndLBox, LB_GETTEXT, (WORD)y, (LPARAM)str);
SendMessage(lphc->hWndEdit, WM_SETTEXT, (WORD)y, (LPARAM)str);
printf("combo hide\n");
}
}
if (LOWORD(lParam) == lphc->hWndLBox) {
switch(HIWORD(lParam))
{
case LBN_SELCHANGE:
lphc->dwState = lphc->dwState ^ CB_SHOWDROPDOWN;
ShowWindow(lphc->hWndLBox, SW_HIDE);
y = SendMessage(lphc->hWndLBox, LB_GETCURSEL, 0, 0L);
SendMessage(lphc->hWndLBox, LB_GETTEXT, (WORD)y, (LPARAM)str);
SendMessage(lphc->hWndEdit, WM_SETTEXT, (WORD)y, (LPARAM)str);
SendMessage(GetParent(hwnd), WM_COMMAND, wndPtr->wIDmenu,
MAKELONG(hwnd, CBN_SELCHANGE));
break;
case LBN_DBLCLK:
SendMessage(GetParent(hwnd), WM_COMMAND, wndPtr->wIDmenu,
MAKELONG(hwnd, CBN_DBLCLK));
break;
}
}
break;
case WM_LBUTTONDOWN:
printf("Combo WM_LBUTTONDOWN wParam=%x lParam=%lX !\n", wParam, lParam);
break;
case WM_KEYDOWN:
printf("Combo WM_KEYDOWN wParam %X!\n", wParam);
break;
case WM_CTLCOLOR:
return(SendMessage(GetParent(hwnd), WM_CTLCOLOR, wParam, lParam));
case WM_PAINT:
lphc = ComboGetStorageHeader(hwnd);
InvalidateRect(lphc->hWndEdit, NULL, TRUE);
UpdateWindow(lphc->hWndEdit);
InvalidateRect(lphc->hWndDrop, NULL, TRUE);
UpdateWindow(lphc->hWndDrop);
if ((lphc->dwState & CB_SHOWDROPDOWN) == CB_SHOWDROPDOWN) {
InvalidateRect(lphc->hWndLBox, NULL, TRUE);
UpdateWindow(lphc->hWndLBox);
}
break;
case WM_MOUSEMOVE:
if ((wParam & MK_LBUTTON) != 0) {
y = HIWORD(lParam);
if (y < 4) {
lphc = ComboGetStorageHeader(hwnd);
}
GetClientRect(hwnd, &rect);
if (y > (rect.bottom - 4)) {
lphc = ComboGetStorageHeader(hwnd);
}
}
case CB_ADDSTRING:
#ifdef DEBUG_COMBO
printf("CB_ADDSTRING '%s' !\n", (LPSTR)lParam);
#endif
lphc = ComboGetStorageHeader(hwnd);
return(SendMessage(lphc->hWndLBox, LB_ADDSTRING, wParam, lParam));
case CB_GETLBTEXT:
printf("CB_GETLBTEXT #%u !\n", wParam);
lphc = ComboGetStorageHeader(hwnd);
return(SendMessage(lphc->hWndLBox, LB_GETTEXT, wParam, lParam));
case CB_INSERTSTRING:
printf("CB_INSERTSTRING '%s' !\n", (LPSTR)lParam);
lphc = ComboGetStorageHeader(hwnd);
return(SendMessage(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam));
case CB_DELETESTRING:
printf("CB_DELETESTRING #%u !\n", wParam);
lphc = ComboGetStorageHeader(hwnd);
return(SendMessage(lphc->hWndLBox, LB_DELETESTRING, wParam, 0L));
case CB_RESETCONTENT:
printf("CB_RESETCONTENT !\n");
lphc = ComboGetStorageHeader(hwnd);
return(SendMessage(lphc->hWndLBox, LB_RESETCONTENT, 0, 0L));
case CB_DIR:
printf("ComboBox CB_DIR !\n");
return(SendMessage(lphc->hWndLBox, LB_DIR, wParam, lParam));
case CB_FINDSTRING:
return(SendMessage(lphc->hWndLBox, LB_FINDSTRING, wParam, lParam));
case CB_GETCOUNT:
return(SendMessage(lphc->hWndLBox, LB_GETCOUNT, 0, 0L));
case CB_GETCURSEL:
printf("ComboBox CB_GETCURSEL !\n");
return(SendMessage(lphc->hWndLBox, LB_GETCOUNT, 0, 0L));
case CB_SETCURSEL:
printf("ComboBox CB_SETCURSEL wParam=%x !\n", wParam);
return(SendMessage(lphc->hWndLBox, LB_GETCOUNT, wParam, 0L));
default:
return DefWindowProc( hwnd, message, wParam, lParam );
}
return 0;
}
LPHEADCOMBO ComboGetStorageHeader(HWND hwnd)
{
WND *wndPtr;
LPHEADCOMBO lphc;
wndPtr = WIN_FindWndPtr(hwnd);
lphc = *((LPHEADCOMBO *)&wndPtr->wExtra[1]);
return lphc;
}
int CreateComboStruct(HWND hwnd)
{
WND *wndPtr;
LPHEADCOMBO lphc;
wndPtr = WIN_FindWndPtr(hwnd);
lphc = (LPHEADCOMBO)malloc(sizeof(HEADCOMBO));
*((LPHEADCOMBO *)&wndPtr->wExtra[1]) = lphc;
lphc->dwState = 0;
return TRUE;
}
/*
* Static control
*
* Copyright David W. Metcalfe, 1993
*
*/
static char Copyright[] = "Copyright David W. Metcalfe, 1993";
#include <windows.h>
#include "win.h"
#include "user.h"
LONG StaticWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam);
static LONG PaintTextfn(HWND hwnd);
static LONG PaintRectfn(HWND hwnd);
static LONG PaintFramefn(HWND hwnd);
static COLORREF color_windowframe, color_background, color_window,
color_windowtext;
#define NOTIFY_PARENT(hWndCntrl, wNotifyCode) \
SendMessage(GetParent(hWndCntrl), WM_COMMAND, \
GetDlgCtrlID(hWndCntrl), MAKELPARAM(hWndCntrl, wNotifyCode));
#define DIM(array) ((sizeof array)/(sizeof array[0]))
typedef struct
{
LONG (*paintfn)();
} STATICFN;
#define MAX_STATIC_TYPE 12
static STATICFN staticfn[MAX_STATIC_TYPE] =
{
{ (LONG(*)())PaintTextfn }, /* SS_LEFT */
{ (LONG(*)())PaintTextfn }, /* SS_CENTER */
{ (LONG(*)())PaintTextfn }, /* SS_RIGHT */
{ (LONG(*)())NULL }, /* SS_ICON */
{ (LONG(*)())PaintRectfn }, /* SS_BLACKRECT */
{ (LONG(*)())PaintRectfn }, /* SS_GRAYRECT */
{ (LONG(*)())PaintRectfn }, /* SS_WHITERECT */
{ (LONG(*)())PaintFramefn }, /* SS_BLACKFRAME */
{ (LONG(*)())PaintFramefn }, /* SS_GRAYFRAME */
{ (LONG(*)())PaintFramefn }, /* SS_WHITEFRAME */
{ (LONG(*)())PaintTextfn }, /* SS_SIMPLE */
{ (LONG(*)())PaintTextfn } /* SS_LEFTNOWORDWRAP */
};
LONG StaticWndProc(HWND hWnd, WORD uMsg, WORD wParam, LONG lParam)
{
LONG lResult = 0;
HDC hDC;
RECT rc;
LPSTR textPtr;
WND *wndPtr = WIN_FindWndPtr(hWnd);
LONG style = wndPtr->dwStyle & 0x0000000F;
switch (uMsg) {
case WM_ENABLE:
InvalidateRect(hWnd, NULL, FALSE);
break;
case WM_CREATE:
if (style < 0L || style >= (LONG)DIM(staticfn))
lResult = -1L;
else
{
/* initialise colours */
color_windowframe = GetSysColor(COLOR_WINDOWFRAME);
color_background = GetSysColor(COLOR_BACKGROUND);
color_window = GetSysColor(COLOR_WINDOW);
color_windowtext = GetSysColor(COLOR_WINDOWTEXT);
lResult = 0L;
}
break;
case WM_PAINT:
if (staticfn[style].paintfn)
(staticfn[style].paintfn)(hWnd);
break;
case WM_SYSCOLORCHANGE:
color_windowframe = GetSysColor(COLOR_WINDOWFRAME);
color_background = GetSysColor(COLOR_BACKGROUND);
color_window = GetSysColor(COLOR_WINDOW);
color_windowtext = GetSysColor(COLOR_WINDOWTEXT);
InvalidateRect(hWnd, NULL, TRUE);
break;
case WM_SETTEXT:
if (wndPtr->hText)
USER_HEAP_FREE(wndPtr->hText);
wndPtr->hText = USER_HEAP_ALLOC(GMEM_MOVEABLE,
strlen((LPSTR)lParam) + 1);
textPtr = (LPSTR)USER_HEAP_ADDR(wndPtr->hText);
strcpy(textPtr, (LPSTR)lParam);
InvalidateRect(hWnd, NULL, TRUE);
break;
default:
lResult = DefWindowProc(hWnd, uMsg, wParam, lParam);
break;
}
GlobalUnlock(hWnd);
return lResult;
}
static LONG PaintTextfn(HWND hwnd)
{
PAINTSTRUCT ps;
RECT rc;
HDC hdc;
HBRUSH hBrush;
HANDLE hText;
char *text;
int textlen;
WORD wFormat;
WND *wndPtr = WIN_FindWndPtr(hwnd);
LONG style = wndPtr->dwStyle;
hdc = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rc);
textlen = GetWindowTextLength(hwnd);
hText = LocalAlloc(LMEM_MOVEABLE, textlen+1);
text = LocalLock(hText);
GetWindowText(hwnd, text, textlen+1);
switch (style & 0x0000000F)
{
case SS_LEFT:
wFormat = DT_LEFT | DT_EXPANDTABS | DT_WORDBREAK;
break;
case SS_CENTER:
wFormat = DT_CENTER | DT_EXPANDTABS | DT_WORDBREAK;
break;
case SS_RIGHT:
wFormat = DT_RIGHT | DT_EXPANDTABS | DT_WORDBREAK;
break;
case SS_SIMPLE:
wFormat = DT_LEFT | DT_SINGLELINE | DT_VCENTER;
break;
case SS_LEFTNOWORDWRAP:
wFormat = DT_LEFT | DT_SINGLELINE | DT_EXPANDTABS | DT_VCENTER;
break;
}
if (style & SS_NOPREFIX)
wFormat |= DT_NOPREFIX;
hBrush = SendMessage(GetParent(hwnd), WM_CTLCOLOR, (WORD)hdc,
MAKELONG(hwnd, CTLCOLOR_STATIC));
if (hBrush == (HBRUSH)NULL) hBrush = GetStockObject(WHITE_BRUSH);
FillRect(hdc, &rc, hBrush);
DrawText(hdc, text, textlen, &rc, wFormat);
LocalUnlock(hText);
LocalFree(hText);
GlobalUnlock(hwnd);
EndPaint(hwnd, &ps);
}
static LONG PaintRectfn(HWND hwnd)
{
PAINTSTRUCT ps;
RECT rc;
HDC hdc;
HPEN hOldPen, hPen;
HBRUSH hOldBrush, hBrush;
WND *wndPtr = WIN_FindWndPtr(hwnd);
hdc = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rc);
switch (wndPtr->dwStyle & 0x0000000F)
{
case SS_BLACKRECT:
hPen = CreatePen(PS_SOLID, 1, color_windowframe);
hBrush = CreateSolidBrush(color_windowframe);
break;
case SS_GRAYRECT:
hPen = CreatePen(PS_SOLID, 1, color_background);
hBrush = CreateSolidBrush(color_background);
break;
case SS_WHITERECT:
hPen = CreatePen(PS_SOLID, 1, color_window);
hBrush = CreateSolidBrush(color_window);
break;
}
hOldPen = (HPEN)SelectObject(hdc, (HANDLE)hPen);
hOldBrush = (HBRUSH)SelectObject(hdc, (HANDLE)hBrush);
Rectangle(hdc, rc.left, rc.top, rc.right, rc.bottom);
SelectObject(hdc, (HANDLE)hOldPen);
SelectObject(hdc, (HANDLE)hOldBrush);
DeleteObject((HANDLE)hPen);
DeleteObject((HANDLE)hBrush);
GlobalUnlock(hwnd);
EndPaint(hwnd, &ps);
}
static LONG PaintFramefn(HWND hwnd)
{
PAINTSTRUCT ps;
RECT rc;
HDC hdc;
HPEN hOldPen, hPen;
HBRUSH hOldBrush, hBrush;
WND *wndPtr = WIN_FindWndPtr(hwnd);
hdc = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rc);
switch (wndPtr->dwStyle & 0x0000000F)
{
case SS_BLACKFRAME:
hPen = CreatePen(PS_SOLID, 1, color_windowframe);
break;
case SS_GRAYFRAME:
hPen = CreatePen(PS_SOLID, 1, color_background);
break;
case SS_WHITEFRAME:
hPen = CreatePen(PS_SOLID, 1, color_window);
break;
}
hBrush = CreateSolidBrush(color_window);
hOldPen = (HPEN)SelectObject(hdc, (HANDLE)hPen);
hOldBrush = (HBRUSH)SelectObject(hdc, (HANDLE)hBrush);
Rectangle(hdc, rc.left, rc.top, rc.right, rc.bottom);
SelectObject(hdc, (HANDLE)hOldPen);
SelectObject(hdc, (HANDLE)hOldBrush);
DeleteObject((HANDLE)hPen);
DeleteObject((HANDLE)hBrush);
GlobalUnlock(hwnd);
EndPaint(hwnd, &ps);
}
......@@ -8,21 +8,32 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include "windows.h"
#include "win.h"
#include "dialog.h"
LONG ButtonWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam );
static LONG WIDGETS_StaticWndProc( HWND hwnd, WORD message,
LONG StaticWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam );
LONG SCROLLBAR_ScrollBarWndProc( HWND hwnd, WORD message,
WORD wParam, LONG lParam );
LONG LISTBOX_ListBoxWndProc( HWND hwnd, WORD message,
WORD wParam, LONG lParam );
LONG COMBOBOX_ComboBoxWndProc( HWND hwnd, WORD message,
WORD wParam, LONG lParam );
#define NB_BUILTIN_CLASSES 2
static WNDCLASS WIDGETS_BuiltinClasses[NB_BUILTIN_CLASSES] =
static WNDCLASS WIDGETS_BuiltinClasses[] =
{
{ 0, (LONG(*)())ButtonWndProc, 0, 0, 0, 0, 0, 0, NULL, "BUTTON" },
{ 0, (LONG(*)())WIDGETS_StaticWndProc, 0, 0, 0, 0, 0, 0, NULL, "STATIC" }
{ 0, (LONG(*)())ButtonWndProc, 0, 2, 0, 0, 0, 0, NULL, "BUTTON" },
{ 0, (LONG(*)())StaticWndProc, 0, 0, 0, 0, 0, 0, NULL, "STATIC" },
{ 0, (LONG(*)())SCROLLBAR_ScrollBarWndProc, 0, 8, 0, 0, 0, 0, NULL, "SCROLLBAR" },
{ 0, (LONG(*)())LISTBOX_ListBoxWndProc, 0, 8, 0, 0, 0, 0, NULL, "LISTBOX" },
{ 0, (LONG(*)())COMBOBOX_ComboBoxWndProc, 0, 8, 0, 0, 0, 0, NULL, "COMBOBOX" },
{ 0, (LONG(*)())DefDlgProc, 0, DLGWINDOWEXTRA, 0, 0, 0, 0, NULL, DIALOG_CLASS_NAME }
};
static FARPROC WndProc32[NB_BUILTIN_CLASSES];
#define NB_BUILTIN_CLASSES \
(sizeof(WIDGETS_BuiltinClasses)/sizeof(WIDGETS_BuiltinClasses[0]))
/***********************************************************************
......@@ -33,56 +44,9 @@ static FARPROC WndProc32[NB_BUILTIN_CLASSES];
BOOL WIDGETS_Init()
{
int i;
WNDCLASS * pClass = WIDGETS_BuiltinClasses;
for (i = 0; i < NB_BUILTIN_CLASSES; i++, pClass++)
for (i = 0; i < NB_BUILTIN_CLASSES; i++)
{
if (!RegisterClass(pClass)) return FALSE;
if (!RegisterClass(&WIDGETS_BuiltinClasses[i])) return FALSE;
}
return TRUE;
}
/**********************************************************************
* WIDGETS_Call32WndProc
*
* Call the window procedure of a built-in class.
*/
LONG WIDGETS_Call32WndProc( FARPROC func, HWND hwnd, WORD message,
WORD wParam, LONG lParam )
{
unsigned int i = (unsigned int) func;
if (!i || (i > NB_BUILTIN_CLASSES)) return 0;
return (*WndProc32[i-1])( hwnd, message, wParam, lParam );
}
/***********************************************************************
* WIDGETS_StaticWndProc
*/
static LONG WIDGETS_StaticWndProc( HWND hwnd, WORD message,
WORD wParam, LONG lParam )
{
switch(message)
{
case WM_CREATE:
return 0;
case WM_PAINT:
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
hdc = BeginPaint( hwnd, &ps );
GetClientRect( hwnd, &rect );
DrawText(hdc, "Static", -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER );
EndPaint( hwnd, &ps );
return 0;
}
default:
return DefWindowProc( hwnd, message, wParam, lParam );
}
}
CFLAGS=-g -I../include # -DUSE_READLINE
CFLAGS=-g -I../include -DUSE_READLINE
LIBS= readline/libedit.a
OBJS=dbg.tab.o hash.o lex.yy.o info.o i386-pinsn.o
#YACC=bison -v -d
YACC=yacc -b dbg -d
#LEX=flex
LEX=lex
debugger.o: ${OBJS} readline/libedit.a
(cd readline; make)
......@@ -18,10 +22,10 @@ lex.yy.o: lex.yy.c
lex.yy.c: debug.l
flex -I debug.l
${LEX} -I debug.l
dbg.tab.c dbg.tab.h: dbg.y
bison -v -d dbg.y
${YACC} dbg.y
dtest: dtest.o debugger.o
gcc -o dtest dtest.o debugger.o
......@@ -29,3 +33,7 @@ dtest: dtest.o debugger.o
clean:
rm -f *.o main dbg.tab.* lex.yy.* *.output *~ *# dtest
(cd readline; make clean)
depend: dbg.tab.c dbg.tab.h lex.yy.c
$(CC) $(CFLAGS) -M *.c > .depend
......@@ -115,7 +115,7 @@ wine_debug(int * regs)
yyin = stdin;
regval = regs;
/* This only works for linux - NetBSD will need something different here. */
#ifdef linux
if((SC_CS & 7) != 7) {
dbg_mask = 0xffffffff;
dbg_mode = 32;
......@@ -123,6 +123,16 @@ wine_debug(int * regs)
dbg_mask = 0xffff;
dbg_mode = 16;
};
#endif
#ifdef __NetBSD__
if(SC_CS == 0x1f) {
dbg_mask = 0xffffffff;
dbg_mode = 32;
} else {
dbg_mask = 0xffff;
dbg_mode = 16;
};
#endif
/* This is intended to read the entry points from the Windows image, and
insert them in the hash table. It does not work yet, so it is commented out. */
......
......@@ -24,6 +24,7 @@ extern char * readline(char *);
static char * make_symbol(char *);
void flush_symbols();
static int syntax_error;
extern int yylval;
%}
DIGIT [0-9]
......
......@@ -56,25 +56,16 @@ main(){
char * pnt;
#ifdef linux
segv_act.sa_handler = (__sighandler_t) win_fault;
/* Point to the top of the stack, minus 4 just in case, and make
it aligned */
sigaction(SIGSEGV, &segv_act, NULL);
#endif
#ifdef __NetBSD__
struct sigstack ss;
sigset_t sig_mask;
ss.ss_sp = (char *) (((unsigned int)(cstack + sizeof(cstack) - 4)) & ~3);
ss.ss_onstack = 0;
if (sigstack(&ss, NULL) < 0) {
perror("sigstack");
exit(1);
}
sigemptyset(&sig_mask);
segv_act.sa_handler = (__sighandler_t) win_fault;
segv_act.sa_flags = SA_ONSTACK;
segv_act.sa_flags = 0;
segv_act.sa_mask = sig_mask;
if (sigaction(SIGBUS, &segv_act, NULL) < 0) {
if (sigaction(SIGSEGV, &segv_act, NULL) < 0) {
perror("sigaction");
exit(1);
}
......
......@@ -1467,6 +1467,57 @@ OP_E (bytemode)
}
append_prefix ();
if (bytemode == w_mode || (bytemode == v_mode && !dflag))
{
if (mod == 0 && rm == 6)
{
sprintf(scratchbuf, "%04.4x", get16());
oappend(scratchbuf);
return 0;
}
disp = 0;
if (mod == 1)
disp = *(char *)codep++;
else if (mod == 2)
disp = get16();
if (disp != 0)
{
sprintf(scratchbuf, "0x%x", disp);
oappend(scratchbuf);
}
switch (rm)
{
case 0:
oappend("(%bx,%si)");
break;
case 1:
oappend("(%bx,%di)");
break;
case 2:
oappend("(%bp,%si)");
break;
case 3:
oappend("(%bp,%di)");
break;
case 4:
oappend("(%si)");
break;
case 5:
oappend("(%di)");
break;
case 6:
oappend("(%bp)");
break;
case 7:
oappend("(%bx)");
break;
}
return 0;
}
if (rm == 4)
{
havesib = 1;
......
......@@ -140,10 +140,10 @@ void examine_memory(int addr, int count, char format){
wdump = (unsigned short int *) addr;
for(i=0; i<count; i++)
{
fprintf(stderr," %d", *wdump++);
fprintf(stderr," %x", *wdump++);
if ((i % 10) == 7) {
fprintf(stderr,"\n");
print_address((unsigned int) dump, stderr);
print_address((unsigned int) wdump, stderr);
fprintf(stderr,": ");
};
}
......@@ -172,10 +172,10 @@ void examine_memory(int addr, int count, char format){
pnt = (char *) addr;
for(i=0; i<count; i++)
{
fprintf(stderr," %d", *pnt++);
fprintf(stderr," %w", *pnt++);
if ((i % 32) == 7) {
fprintf(stderr,"\n");
print_address((unsigned int) dump, stderr);
print_address((unsigned int) pnt, stderr);
fprintf(stderr,": ");
};
}
......
......@@ -49,7 +49,7 @@ shar: $(SHARFILES)
shar $(SHARFILES) >shar
clean:
rm -f *.[oa] testit foo core tags lint lint.all a.out shar
rm -f *.[oa] testit foo core tags lint lint.all a.out shar *# *~
lint: testit
lint -a -b -u -x $(DEFS) $(SOURCES) testit.c >lint.all
......
......@@ -25,9 +25,32 @@
#define RN_CR2 21
#endif
#ifdef __NetBSD__
/* Register numbers */
#define RN_ESP 2
#define RN_EBP 3
#define RN_ESP_AT_SIGNAL 4
#define RN_EIP 5
#define RN_EFLAGS 6
#define RN_ES 7
#define RN_DS 8
#define RN_CS 9
#define RN_SS 10
#define RN_EDI 11
#define RN_ESI 12
#define RN_EBX 13
#define RN_EDX 14
#define RN_ECX 15
#define RN_EAX 16
/* NetBSD doesn't context switch gs or fs */
#define SC_GS 0x27
#define SC_FS 0x27
#endif
#ifdef linux
#define SC_GS regval[RN_GS]
#define SC_FS regval[RN_FS]
#endif
#define SC_ES regval[RN_ES]
#define SC_DS regval[RN_DS]
#define SC_EDI(dbg_mask) (regval[RN_EDI] & dbg_mask)
......
......@@ -16,7 +16,7 @@ if1632.o: $(OBJS)
$(LD) -r -o if1632.o $(OBJS)
clean:
rm -f *.o *~ *.s dll_* *.a
rm -f *.o *~ *.s dll_* *.a *#
dll_kernel.S dll_kernel_tab.c: ../tools/build kernel.spec
../tools/build kernel.spec
......
......@@ -102,7 +102,7 @@ _CallToInit16:
movl %esp,%eax
movl %eax,%ebp
#if 1
movw $ UDATASEL,%ax
movw $UDATASEL,%ax
movw %ax,%fs
movw %ax,%gs
#endif
......@@ -124,7 +124,7 @@ _CallToInit16:
* GDT usage.
*/
pushl %eax
movw $ UDATASEL,%ax
movw $UDATASEL,%ax
movw %ax,%ds
movw %ax,%es
movw %ax,%fs
......@@ -204,7 +204,7 @@ _CallTo16:
* GDT usage.
*/
pushl %eax
movw $ UDATASEL,%ax
movw $UDATASEL,%ax
movw %ax,%ds
movw %ax,%es
movw %ax,%fs
......@@ -259,7 +259,7 @@ _CallTo32:
* Restore segment registers.
*/
pushl %eax
movw $ UDATASEL,%ax
movw $UDATASEL,%ax
movw %ax,%ds
movw %ax,%es
popl %eax
......@@ -359,21 +359,23 @@ _ReturnFromRegisterFunc:
* the return address, the saved registers, and the return
* address again.
*/
popw %ax /* Throw away the number of arguments */
popl %eax /* Throw away first copy of return address */
add $6,%esp /* argument count, return address */
popw %gs
add $2,%esp
popw %fs
add $2,%esp
popw %es
add $2,%esp
popw %ds
popw %di
popw %si
popw %bp
popw %ax /* Throw away pushed stack pointer */
popw %bx
popw %dx
popw %cx
popw %ax
add $2,%esp
popal
add $16,%esp /* trapno, err, eip, cs */
popfl
add $20,%esp /* esp, ss, i387, oldmask, cr2 */
/*
* Return to original caller.
*/
.byte 0x66
lret
......@@ -104,6 +104,7 @@ CALLBACK_MakeProcInstance(void *func, int instance)
tp->thunk[4] = 0xd8;
tp->thunk[5] = 0xea;
memcpy(&tp->thunk[6], &func, 4);
tp->used = 1;
return tp->thunk;
}
......@@ -141,9 +142,6 @@ LONG CallWindowProc( FARPROC func, HWND hwnd, WORD message,
PushOn16( CALLBACK_SIZE_WORD, message );
PushOn16( CALLBACK_SIZE_WORD, wParam );
PushOn16( CALLBACK_SIZE_LONG, lParam );
printf("%8.8x(%4.4x, %4.4x, %4.4x, %8.8x)\n", func, hwnd, message, wParam, lParam);
return CallTo16((unsigned int) func,
FindDataSegmentForCode((unsigned long) func));
}
......
......@@ -131,6 +131,7 @@ length 490
346 pascal SetTextAlign(word word) SetTextAlign(1 2)
348 pascal Chord(word s_word s_word s_word s_word s_word s_word s_word s_word)
Chord(1 2 3 4 5 6 7 8 9)
350 pascal GetCharWidth(word word word ptr) GetCharWidth(1 2 3 4)
360 pascal CreatePalette(ptr) CreatePalette(1)
363 pascal GetPaletteEntries(word word word ptr) GetPaletteEntries(1 2 3 4)
364 pascal SetPaletteEntries(word word word ptr) SetPaletteEntries(1 2 3 4)
......
......@@ -44,7 +44,7 @@ length 415
86 pascal _lwrite(word ptr word) KERNEL__lwrite(1 2 3)
88 pascal lstrcpy(ptr ptr) lstrcpy(1 2)
89 pascal lstrcat(ptr ptr) lstrcat(1 2)
90 pascal lstrlen(ptr) lstrcpy(1)
90 pascal lstrlen(ptr) lstrlen(1)
91 register InitTask(word word word word word
word word word word word)
KERNEL_InitTask()
......@@ -66,6 +66,7 @@ length 415
154 return GlobalNotify 4 0
163 pascal GlobalLRUOldest(word) ReturnArg(1)
164 pascal GlobalLRUNewest(word) ReturnArg(1)
166 pascal WinExec(ptr word) WinExec(1 2)
178 equate __WINFLAGS 0x413
184 return GlobalDOSAlloc 4 0
185 return GlobalDOSFree 2 0
......
......@@ -15,9 +15,13 @@ length 540
15 pascal GetCurrentTime() GetTickCount()
18 pascal SetCapture(word) SetCapture(1)
19 pascal ReleaseCapture() ReleaseCapture()
22 pascal SetFocus(word) SetFocus(1)
23 pascal GetFocus() GetFocus()
31 pascal IsIconic(word) IsIconic(1)
32 pascal GetWindowRect(word ptr) GetWindowRect(1 2)
33 pascal GetClientRect(word ptr) GetClientRect(1 2)
36 pascal GetWindowText(word ptr word) GetWindowText(1 2 3)
37 pascal SetWindowText(word ptr) SetWindowText(1 2)
38 pascal GetWindowTextLength(word) GetWindowTextLength(1)
39 pascal BeginPaint(word ptr) BeginPaint(1 2)
40 pascal EndPaint(word ptr) EndPaint(1 2)
......@@ -25,8 +29,13 @@ length 540
CreateWindow(1 2 3 4 5 6 7 8 9 10 11)
42 pascal ShowWindow(word word) ShowWindow(1 2)
46 pascal GetParent(word) GetParent(1)
48 pascal IsChild(word word) IsChild(1 2)
53 pascal DestroyWindow(word) DestroyWindow(1)
56 pascal MoveWindow(word word word word word word)
MoveWindow(1 2 3 4 5 6)
57 pascal RegisterClass(ptr) RegisterClass(1)
62 pascal SetScrollPos(word word word word) SetScrollPos(1 2 3 4)
64 pascal SetScrollRange(word word word word word) SetScrollRange(1 2 3 4 5)
66 pascal GetDC(word) GetDC(1)
68 pascal ReleaseDC(word word) ReleaseDC(1 2)
72 pascal SetRect(ptr s_word s_word s_word s_word) SetRect(1 2 3 4 5)
......@@ -42,7 +51,22 @@ length 540
82 pascal InvertRect(word ptr) InvertRect(1 2)
83 pascal FrameRect(word ptr word) FrameRect(1 2 3)
85 pascal DrawText(word ptr s_word ptr word) DrawText(1 2 3 4 5)
87 pascal DialogBox(word ptr word ptr) DialogBox(1 2 3 4)
88 pascal EndDialog(word s_word) EndDialog(1 2)
89 pascal CreateDialog(word ptr word ptr) CreateDialog(1 2 3 4)
90 pascal IsDialogMessage(word ptr) IsDialogMessage(1 2)
91 pascal GetDlgItem(word word) GetDlgItem(1 2)
92 pascal SetDlgItemText(word ptr) SetDlgItemText(1 2)
93 pascal GetDlgItemText(word word ptr word) GetDlgItemText(1 2 3 4)
94 pascal SetDlgItemInt(word word word word) SetDlgItemInt(1 2 3 4)
95 pascal GetDlgItemInt(word word ptr word) GetDlgItemInt(1 2 3 4)
96 pascal CheckRadioButton(word word word word) CheckRadioButton(1 2 3 4)
97 pascal CheckDlgButton(word word word) CheckDlgButton(1 2 3)
98 pascal IsDlgButtonChecked(word word) IsDlgButtonChecked(1 2)
101 pascal SendDlgItemMessage(word word word word long)
SendDlgItemMessage(1 2 3 4 5)
102 pascal AdjustWindowRect(ptr long word) AdjustWindowRect(1 2 3)
103 pascal MapDialogRect(word ptr) MapDialogRect(1 2)
104 pascal MessageBeep(word) MessageBeep(1)
106 pascal GetKeyState(word) GetKeyState(1)
107 pascal DefWindowProc(word word word long) DefWindowProc(1 2 3 4)
......@@ -55,6 +79,7 @@ length 540
118 pascal RegisterWindowMessage(ptr) RegisterWindowMessage(1)
119 pascal GetMessagePos() GetMessagePos()
120 pascal GetMessageTime() GetMessageTime()
122 pascal CallWindowProc(ptr word word word long) CallWindowProc(1 2 3 4 5)
124 pascal UpdateWindow(word) UpdateWindow(1)
125 pascal InvalidateRect(word ptr word) InvalidateRect(1 2 3)
126 pascal InvalidateRgn(word word word) InvalidateRgn(1 2 3)
......@@ -73,6 +98,7 @@ length 540
154 pascal CheckMenu(word word word) CheckMenu(1 2 3)
157 pascal GetMenu(word) GetMenu(1)
158 pascal SetMenu(word word) SetMenu(1 2)
171 pascal WinHelp(word word long) WinHelp(1 2 3)
173 pascal LoadCursor(word ptr) LoadCursor(1 2)
174 pascal LoadIcon(word ptr) LoadIcon(1 2)
175 pascal LoadBitmap(word ptr) LoadBitmap(1 2)
......@@ -81,27 +107,25 @@ length 540
179 pascal GetSystemMetrics(word) GetSystemMetrics(1)
180 pascal GetSysColor(word) GetSysColor(1)
181 pascal SetSysColors(word ptr ptr) SetSysColors(1 2 3)
430 pascal lstrcmp(ptr ptr) lstrcmp(1 2)
431 pascal AnsiUpper(ptr) AnsiUpper(1)
432 pascal AnsiLower(ptr) AnsiLower(1)
433 pascal IsCharAlpha(byte) IsCharAlpha(1)
434 pascal IsCharAlphanumeric(byte) IsCharAlphanumeric(1)
435 pascal IsCharUpper(byte) IsCharUpper(1)
436 pascal IsCharLower(byte) IsCharLower(1)
437 pascal AnsiUpperBuff(ptr word) AnsiUpperBuff(1 2)
438 pascal AnsiLowerBuff(ptr word) AnsiLowerBuff(1 2)
471 pascal lstrcmpi(ptr ptr) lstrcmpi(1 2)
472 pascal AnsiNext(ptr) AnsiNext(1 )
473 pascal AnsiPrev(ptr ptr) AnsiPrev(1 2)
182 pascal KillSystemTimer(word word) KillSystemTimer(1 2)
190 pascal GetUpdateRect(word ptr word) GetUpdateRect(1 2 3)
219 pascal CreateDialogIndirect(word ptr word ptr)
CreateDialogIndirect(1 2 3 4)
227 pascal GetNextDlgGroupItem(word word word) GetNextDlgGroupItem(1 2 3)
228 pascal GetNextDlgTabItem(word word word) GetNextDlgTabItem(1 2 3)
229 pascal GetTopWindow(word) GetTopWindow(1)
230 pascal GetNextWindow(word word) GetNextWindow(1 2)
232 pascal SetWindowPos(word word word word word word word)
SetWindowPos(1 2 3 4 5 6 7)
237 pascal GetUpdateRgn(word word word) GetUpdateRgn(1 2 3)
241 pascal CreateDialogParam(word ptr word ptr long)
CreateDialogParam(1 2 3 4 5)
242 pascal CreateDialogIndirectParam(word ptr word ptr long)
CreateDialogIndirectParam(1 2 3 4 5)
244 pascal EqualRect(ptr ptr) EqualRect(1 2)
262 pascal GetWindow(word word) GetWindow(1 2)
266 pascal SetMessageQueue(word) SetMessageQueue(1)
277 pascal GetDlgCtrlID(word) GetDlgCtrlID(1)
286 pascal GetDesktopWindow() GetDesktopWindow()
288 pascal GetMessageExtraInfo() GetMessageExtraInfo()
324 pascal FillWindow(word word word word) FillWindow(1 2 3 4)
......@@ -111,4 +135,20 @@ length 540
373 pascal SubtractRect(ptr ptr ptr) SubtractRect(1 2 3)
403 pascal UnregisterClass(ptr word) UnregisterClass(1 2)
411 pascal AppendMenu(word word word ptr) AppendMenu(1 2 3 4)
420 pascal wsprintf(ptr ptr) wsprintf(1 2)
421 pascal wvsprintf(ptr ptr ptr) wvsprintf(1 2 3)
430 pascal lstrcmp(ptr ptr) lstrcmp(1 2)
431 pascal AnsiUpper(ptr) AnsiUpper(1)
432 pascal AnsiLower(ptr) AnsiLower(1)
433 pascal IsCharAlpha(byte) IsCharAlpha(1)
434 pascal IsCharAlphanumeric(byte) IsCharAlphanumeric(1)
435 pascal IsCharUpper(byte) IsCharUpper(1)
436 pascal IsCharLower(byte) IsCharLower(1)
437 pascal AnsiUpperBuff(ptr word) AnsiUpperBuff(1 2)
438 pascal AnsiLowerBuff(ptr word) AnsiLowerBuff(1 2)
452 pascal CreateWindowEx(long ptr ptr long s_word s_word s_word s_word
word word word ptr)
CreateWindowEx(1 2 3 4 5 6 7 8 9 10 11 12)
471 pascal lstrcmpi(ptr ptr) lstrcmpi(1 2)
472 pascal AnsiNext(ptr) AnsiNext(1 )
473 pascal AnsiPrev(ptr ptr) AnsiPrev(1 2)
/*
* Combo box definitions
*/
typedef struct tagHEADCOMBO {
DWORD dwStyle;
DWORD dwState;
HWND hWndDrop;
HWND hWndEdit;
HWND hWndLBox;
} HEADCOMBO;
typedef HEADCOMBO FAR* LPHEADCOMBO;
/*
* Dialog definitions
*
* Copyright 1993 Alexandre Julliard
*/
#ifndef DIALOG_H
#define DIALOG_H
#include "windows.h"
#define DIALOG_CLASS_NAME "#32770" /* Integer atom */
/* Dialog info structure.
* This structure is stored into the window extra bytes (cbWndExtra).
* sizeof(DIALOGINFO) must be <= DLGWINDOWEXTRA (=30).
*/
typedef struct
{
LONG msgResult;
FARPROC dlgProc;
LONG userInfo;
HWND hwndFocus;
HFONT hUserFont;
HMENU hMenu;
WORD xBaseUnit;
WORD yBaseUnit;
WORD fEnd;
} DIALOGINFO;
/* Dialog template header */
typedef struct
{
DWORD style;
BYTE nbItems __attribute__ ((packed));
WORD x __attribute__ ((packed));
WORD y __attribute__ ((packed));
WORD cx __attribute__ ((packed));
WORD cy __attribute__ ((packed));
} DLGTEMPLATEHEADER;
/* Dialog control header */
typedef struct
{
WORD x;
WORD y;
WORD cx;
WORD cy;
WORD id;
DWORD style __attribute__ ((packed));
} DLGCONTROLHEADER;
/* Dialog control data */
typedef struct
{
DLGCONTROLHEADER * header;
LPSTR class;
LPSTR text;
} DLGCONTROL;
/* Dialog template */
typedef struct
{
DLGTEMPLATEHEADER * header;
unsigned char * menuName;
LPSTR className;
LPSTR caption;
WORD pointSize;
LPSTR faceName;
DLGCONTROL * controls;
} DLGTEMPLATE;
#endif /* DIALOG_H */
#ifndef _FILES_H
#define _FILES_H
#define OPEN_MAX 256
/***************************************************************************
This structure stores the infomation needed for a single DOS drive
***************************************************************************/
struct DosDriveStruct
{
char RootDirectory [256]; /* Unix base for this drive letter */
char CurrentDirectory [256]; /* Current directory for this drive */
char VolumeLabel [11];
unsigned long serialnumber;
};
#endif /*_FILES_H*/
#ifndef INT21_H
#define INT21_H
#define DosVersion 0x0303;
#define SectorSize 0x200;
#define SectorsPerCluster 0x04;
#define AX context->sc_eax
#define BX context->sc_ebx
#define CX context->sc_ecx
#define DX context->sc_edx
#define ES context->sc_es
#define DS context->sc_ds
#define DI context->sc_edi
#define SI context->sc_esi
#define pointer(a,b) (((unsigned int) a << 16) | b)
#define segment(a) (a >> 16)
#define offset(a) (a & 0xffff)
#define SetCflag (context->sc_efl |= 0x00000001L)
#define ResetCflag (context->sc_efl &= 0xfffffffeL)
struct diskinfo {
WORD infolevel;
DWORD serialnumber;
char label[11];
char fstype[8];
};
/* extended error codes */
#define NoError 0x00
#define InvalidFunction 0x01
#define FileNotFound 0x02
#define PathNotFound 0x03
#define AccessDenied 0x05
#define InvalidHandle 0x06
#define MCBDestroyed 0x07
#define OutOfMemory 0x08
#define MCBInvalid 0x09
#define DataInvalid 0x0d
#define InvalidDrive 0x0f
#define CanNotRemoveCwd 0x10
#define NotSameDevice 0x11
#define NoMoreFiles 0x12
#define WriteProtected 0x13
#define UnknownUnit 0x14
#define DriveNotReady 0x15
#define UnknownCommand 0x16
#define CRCError 0x17
#define BadRqLength 0x18
#define SeekError 0x19
#define UnknownMedia 0x1a
#define SectorNotFound 0x1b
#define OutOfPaper 0x1c
#define WriteFault 0x1d
#define ReadFault 0x1e
#define GeneralFailure 0x1f
#define ShareViolation 0x20
#define LockViolation 0x21
#define DiskFull 0x27
#define NoNetwork 0x49
#define FileExists 0x50
#define CanNotMakeDir 0x52
/* Error classes */
#define EC_Temporary 0x02
#define EC_AccessDenied 0x03
#define EC_AppError 0x04
#define EC_SystemFailure 0x06
#define EC_NotFound 0x08
#define EC_MediaError 0x0b
#define EC_Exists 0x0c
#define EC_Unknown 0x0d
/* Suggested actions */
#define SA_Retry 0x01
#define SA_Abort 0x04
#define SA_Ignore 0x06
#define SA_Ask4Retry 0x07
/* Error locus */
#define EL_Unknown 0x01
#define EL_Disk 0x02
#define EL_Network 0x03
#define EL_Memory 0x05
#endif /* INT21_H */
/*
* List Box definitions
*/
typedef struct tagLISTSTRUCT {
DRAWITEMSTRUCT dis;
HANDLE hMem;
HANDLE hData;
void *lpNext;
} LISTSTRUCT;
typedef LISTSTRUCT FAR* LPLISTSTRUCT;
typedef struct tagHEADLIST {
short FirstVisible;
short ItemSelect;
short ItemsCount;
short ItemsVisible;
short ItemSelected;
short PrevSelected;
short StdItemHeight;
short DrawCtlType;
void *lpFirst;
DWORD dwStyle;
HWND hWndScroll;
HWND hWndLogicParent;
} HEADLIST;
typedef HEADLIST FAR* LPHEADLIST;
......@@ -30,5 +30,8 @@ extern struct segment_descriptor_s *GetNextSegment(unsigned int flags,
extern struct mz_header_s *CurrentMZHeader;
extern struct ne_header_s *CurrentNEHeader;
extern int CurrentNEFile;
extern do_int1A(struct sigcontext_struct * context);
extern do_int21(struct sigcontext_struct * context);
#endif /* PROTOTYPES_H */
......@@ -6,16 +6,16 @@
extern unsigned short *Stack16Frame;
#define _AX Stack16Frame[21]
#define _BX Stack16Frame[18]
#define _CX Stack16Frame[20]
#define _DX Stack16Frame[19]
#define _SP Stack16Frame[17]
#define _BP Stack16Frame[16]
#define _SI Stack16Frame[15]
#define _DI Stack16Frame[14]
#define _DS Stack16Frame[13]
#define _ES Stack16Frame[12]
#define _AX Stack16Frame[34]
#define _BX Stack16Frame[28]
#define _CX Stack16Frame[32]
#define _DX Stack16Frame[30]
#define _SP Stack16Frame[26]
#define _BP Stack16Frame[24]
#define _SI Stack16Frame[22]
#define _DI Stack16Frame[20]
#define _DS Stack16Frame[18]
#define _ES Stack16Frame[16]
extern void ReturnFromRegisterFunc(void);
......
/*
* Scroll Bar definitions
*/
typedef struct tagHEADSSCROLL {
short CurVal;
short MinVal;
short MaxVal;
short MaxPix;
short CurPix;
BOOL ThumbActive;
WORD Direction;
DWORD dwStyle;
HWND hWndUp;
HWND hWndDown;
} HEADSCROLL;
typedef HEADSCROLL FAR* LPHEADSCROLL;
......@@ -22,5 +22,40 @@ extern struct w_files * wine_files;
extern char *GetFilenameFromInstance(unsigned short instance);
extern struct w_files *GetFileInfo(unsigned short instance);
extern char *FindFileInPath(char *buffer, int buflen, char *rootname,
char **extensions, char *path);
extern char *GetSystemIniFilename(void);
#ifdef linux
struct sigcontext_struct {
unsigned short sc_gs, __gsh;
unsigned short sc_fs, __fsh;
unsigned short sc_es, __esh;
unsigned short sc_ds, __dsh;
unsigned long sc_edi;
unsigned long sc_esi;
unsigned long sc_ebp;
unsigned long sc_esp;
unsigned long sc_ebx;
unsigned long sc_edx;
unsigned long sc_ecx;
unsigned long sc_eax;
unsigned long sc_trapno;
unsigned long sc_err;
unsigned long sc_eip;
unsigned short sc_cs, __csh;
unsigned long sc_efl;
unsigned long esp_at_signal;
unsigned short sc_ss, __ssh;
unsigned long i387;
unsigned long oldmask;
unsigned long cr2;
};
#endif
#ifdef __NetBSD__
#include <signal.h>
#define sigcontext_struct sigcontext
#define HZ 100
#endif
#endif /* WINE_H */
CFLAGS=$(COPTS) $(DEBUGOPTS) -I$(INCLUDE_DIR)
CFLAGS=$(COPTS) $(DEBUGOPTS) -I../include
OBJS=dump.o ldt.o ldtlib.o resource.o selector.o signal.o wine.o
OBJS=dump.o files.o ldt.o ldtlib.o resource.o selector.o signal.o int1a.o \
int21.o wine.o
default: loader.o
......@@ -8,7 +9,7 @@ loader.o: $(OBJS)
$(LD) -r -o loader.o $(OBJS)
clean:
rm -f *.o *~ *.s dll_* *.a
rm -f *.o *~ *.s dll_* *.a *#
depend:
$(CC) $(CFLAGS) -M *.c > .depend
......
static char RCSId[] = "$Id: wine.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <stdlib.h>
#include <dirent.h>
#include <string.h>
/**********************************************************************
* FindFileInPath
*/
char *
FindFileInPath(char *buffer, int buflen, char *rootname,
char **extensions, char *path)
{
char *workingpath;
char *dirname;
DIR *d;
struct dirent *f;
char **e;
int rootnamelen;
int found = 0;
if (strchr(rootname, '/') != NULL)
{
strncpy(buffer, rootname, buflen);
return buffer;
}
rootnamelen = strlen(rootname);
workingpath = malloc(strlen(path) + 1);
if (workingpath == NULL)
return NULL;
strcpy(workingpath, path);
for(dirname = strtok(workingpath, ":;");
dirname != NULL;
dirname = strtok(NULL, ":;"))
{
d = opendir(dirname);
if (d != NULL)
{
while ((f = readdir(d)) != NULL)
{
if (strncasecmp(rootname, f->d_name, rootnamelen) == 0)
{
if (extensions == NULL ||
strcasecmp(rootname, f->d_name) == 0)
{
found = 1;
}
else if (f->d_name[rootnamelen] == '.')
{
for (e = extensions; *e != NULL; e++)
{
if (strcasecmp(*e, f->d_name + rootnamelen + 1)
== 0)
{
found = 1;
break;
}
}
}
if (found)
{
strncpy(buffer, dirname, buflen);
strncat(buffer, "/", buflen - strlen(buffer));
strncat(buffer, f->d_name, buflen - strlen(buffer));
return buffer;
}
}
}
closedir(d);
}
}
return NULL;
}
/**********************************************************************
* GetSystemIniFilename
*/
char *
GetSystemIniFilename()
{
static char *IniName = NULL;
char inipath[256];
if (IniName)
return IniName;
getcwd(inipath, 256);
strcat(inipath, ":");
strcat(inipath, getenv("HOME"));
strcat(inipath, ":");
strcat(inipath, getenv("WINEPATH"));
IniName = malloc(1024);
if (FindFileInPath(IniName, 1024, "wine.ini", NULL, inipath) == NULL)
{
free(IniName);
IniName = NULL;
return NULL;
}
IniName = realloc(IniName, strlen(IniName) + 1);
return IniName;
}
#include <time.h>
#include <stdio.h>
#include "wine.h"
#ifdef linux
#include <linux/sched.h> /* needed for HZ */
#endif
#define BCD_TO_BIN(x) ((x&15) + (x>>4)*10)
#define BIN_TO_BCD(x) ((x%10) + ((x/10)<<4))
int do_int1A(struct sigcontext_struct * context){
time_t ltime;
struct tm *bdtime;
int ticks;
switch((context->sc_eax >> 8) & 0xff){
case 0:
ltime = time(NULL);
ticks = (int) (ltime * HZ);
context->sc_ecx = ticks >> 16;
context->sc_edx = ticks & 0x0000FFFF;
context->sc_eax = 0; /* No midnight rollover */
break;
case 2:
ltime = time(NULL);
bdtime = localtime(&ltime);
context->sc_ecx = (BIN_TO_BCD(bdtime->tm_hour)<<8) | BIN_TO_BCD(bdtime->tm_min);
context->sc_edx = (BIN_TO_BCD(bdtime->tm_sec)<<8);
case 4:
ltime = time(NULL);
bdtime = localtime(&ltime);
context->sc_ecx = (BIN_TO_BCD(bdtime->tm_year/100)<<8) | BIN_TO_BCD((bdtime->tm_year-1900)%100);
context->sc_edx = (BIN_TO_BCD(bdtime->tm_mon)<<8) | BIN_TO_BCD(bdtime->tm_mday);
break;
/* setting the time,date or RTC is not allow -EB */
case 1:
/* set system time */
case 3:
/* set RTC time */
case 5:
/* set RTC date */
case 6:
/* set ALARM */
case 7:
/* cancel ALARM */
break;
default:
fprintf(stderr,"Unable to handle int 0x1A AX %x\n", context->sc_eax);
return 1;
};
return 1;
}
This diff is collapsed. Click to expand it.
......@@ -20,7 +20,6 @@ extern int i386_set_ldt(int, union descriptor *, int);
struct segment_descriptor *
make_sd(unsigned base, unsigned limit, int contents, int read_exec_only, int seg32, int inpgs)
{
#if 1
static long d[2];
d[0] = ((base & 0x0000ffff) << 16) |
......@@ -34,24 +33,7 @@ make_sd(unsigned base, unsigned limit, int contents, int read_exec_only, int seg
(inpgs << 23) |
0xf000;
printf("%x %x\n", d[1], d[0]);
return ((struct segment_descriptor *)d);
#else
static struct segment_descriptor d;
d.sd_lolimit = limit & 0x0000ffff;
d.sd_lobase = base & 0x00ffffff;
d.sd_type = contents & 0x01f;
d.sd_dpl = SEL_UPL & 0x3;
d.sd_p = 1;
d.sd_hilimit = (limit & 0x00ff0000) >> 16;
d.sd_xx = 0;
d.sd_def32 = seg32?1:0;
d.sd_gran = inpgs?1:0;
d.sd_hibase = (base & 0xff000000) >> 24;
return ((struct segment_descriptor *)&d);
#endif
}
#endif
......@@ -88,7 +70,7 @@ set_ldt_entry(int entry, unsigned long base, unsigned int limit,
struct segment_descriptor *sd;
int ret;
#ifdef DEBUG
#ifdef DEBUG_LDT
printf("set_ldt_entry: entry=%x base=%x limit=%x%s %s-bit contents=%d %s\n",
entry, base, limit, limit_in_pages_flag?"-pages":"",
seg_32bit_flag?"32":"16",
......
......@@ -211,6 +211,7 @@ FindResourceByName(struct resource_nameinfo_s *result_p,
if (read(ResourceFd, &size_shift, sizeof(size_shift)) !=
sizeof(size_shift))
{
printf("FindResourceByName (%s) bad block size !\n", resource_name);
return -1;
}
......@@ -223,6 +224,7 @@ FindResourceByName(struct resource_nameinfo_s *result_p,
if (read(ResourceFd, &typeinfo, sizeof(typeinfo)) !=
sizeof(typeinfo))
{
printf("FindResourceByName (%s) bad typeinfo size !\n", resource_name);
return -1;
}
if (typeinfo.type_id == type_id || type_id == -1)
......@@ -232,6 +234,7 @@ FindResourceByName(struct resource_nameinfo_s *result_p,
if (read(ResourceFd, &nameinfo, sizeof(nameinfo)) !=
sizeof(nameinfo))
{
printf("FindResourceByName (%s) bad nameinfo size !\n", resource_name);
return -1;
}
......@@ -245,7 +248,6 @@ FindResourceByName(struct resource_nameinfo_s *result_p,
read(ResourceFd, name, nbytes);
lseek(ResourceFd, old_pos, SEEK_SET);
name[nbytes] = '\0';
if (strcasecmp(name, resource_name) == 0)
{
memcpy(result_p, &nameinfo, sizeof(nameinfo));
......@@ -254,6 +256,7 @@ FindResourceByName(struct resource_nameinfo_s *result_p,
}
}
}
printf("FindResourceByName (%s) typeinfo.type_id = 0 !\n", resource_name);
return -1;
}
......@@ -373,7 +376,6 @@ RSC_LoadResource(int instance, char *rsc_name, int type, int *image_size_ret)
image_size = nameinfo.length << size_shift;
if (image_size_ret != NULL)
*image_size_ret = image_size;
hmem = GlobalAlloc(GMEM_MOVEABLE, image_size);
image = GlobalLock(hmem);
if (image == NULL || read(ResourceFd, image, image_size) != image_size)
......@@ -443,6 +445,7 @@ LoadBitmap(HANDLE instance, LPSTR bmp_name)
{
HBITMAP hbitmap;
HANDLE rsc_mem;
GDIOBJHDR * ptr;
HDC hdc;
long *lp;
int image_size;
......@@ -462,7 +465,6 @@ LoadBitmap(HANDLE instance, LPSTR bmp_name)
GlobalFree(rsc_mem);
return 0;
}
if (*lp == sizeof(BITMAPCOREHEADER))
hbitmap = ConvertCoreBitmap( hdc, (BITMAPCOREHEADER *) lp );
else if (*lp == sizeof(BITMAPINFOHEADER))
......
......@@ -10,6 +10,7 @@
#include <linux/sched.h>
#include <asm/system.h>
#endif
#include <wine.h>
char * cstack[4096];
struct sigaction segv_act;
......@@ -17,6 +18,7 @@ struct sigaction segv_act;
#ifdef linux
extern void ___sig_restore();
extern void ___masksig_restore();
#endif
/* Similar to the sigaction function in libc, except it leaves alone the
restorer field */
......@@ -32,123 +34,6 @@ wine_sigaction(int sig,struct sigaction * new, struct sigaction * old)
return -1;
}
struct sigcontext_struct {
unsigned short sc_gs, __gsh;
unsigned short sc_fs, __fsh;
unsigned short sc_es, __esh;
unsigned short sc_ds, __dsh;
unsigned long sc_edi;
unsigned long sc_esi;
unsigned long sc_ebp;
unsigned long sc_esp;
unsigned long sc_ebx;
unsigned long sc_edx;
unsigned long sc_ecx;
unsigned long sc_eax;
unsigned long sc_trapno;
unsigned long sc_err;
unsigned long sc_eip;
unsigned short sc_cs, __csh;
unsigned long sc_eflags;
unsigned long esp_at_signal;
unsigned short sc_ss, __ssh;
unsigned long i387;
unsigned long oldmask;
unsigned long cr2;
};
#endif
#ifdef __NetBSD__
#define sigcontext_struct sigcontext
#define HZ 100
#endif
static void
GetTimeDate(int time_flag, struct sigcontext_struct * context)
{
struct tm *now;
time_t ltime;
ltime = time(NULL);
now = localtime(&ltime);
if (time_flag)
{
context->sc_ecx = (now->tm_hour << 8) | now->tm_min;
context->sc_edx = now->tm_sec << 8;
}
else
{
context->sc_ecx = now->tm_year + 1900;
context->sc_edx = ((now->tm_mon + 1) << 8) | now->tm_mday;
context->sc_eax &= 0xff00;
context->sc_eax |= now->tm_wday;
}
}
/* We handle all int21 calls here. There is some duplicate code from
misc/dos.c that I am unsure how to deal with, since the locations
that we store the registers are all different */
static int
do_int21(struct sigcontext_struct * context){
fprintf(stderr,"Doing int21 %x ", (context->sc_eax >> 8) & 0xff);
switch((context->sc_eax >> 8) & 0xff){
case 0x30:
context->sc_eax = 0x0303; /* Hey folks, this is DOS V3.3! */
context->sc_ebx = 0;
context->sc_ecx = 0;
break;
/* Ignore any attempt to set a segment vector */
case 0x25:
return 1;
case 0x35: /* Return a NULL segment selector - this will bomb
if anyone ever tries to use it */
context->sc_es = 0;
context->sc_ebx = 0;
break;
case 0x2a:
GetTimeDate(0, context);
/* Function does not return */
case 0x2c:
GetTimeDate(1, context);
/* Function does not return */
case 0x4c:
exit(context->sc_eax & 0xff);
default:
fprintf(stderr,"Unable to handle int 0x21 %x\n", context->sc_eax);
return 1;
};
return 1;
}
static int
do_int1A(struct sigcontext_struct * context){
time_t ltime;
int ticks;
switch((context->sc_eax >> 8) & 0xff){
case 0:
ltime = time(NULL);
ticks = (int) (ltime * HZ);
context->sc_ecx = ticks >> 16;
context->sc_edx = ticks & 0x0000FFFF;
context->sc_eax = 0; /* No midnight rollover */
break;
default:
fprintf(stderr,"Unable to handle int 0x1A %x\n", context->sc_eax);
return 1;
};
return 1;
}
#ifdef linux
static void win_fault(int signal, struct sigcontext_struct context){
struct sigcontext_struct *scp = &context;
......@@ -198,6 +83,12 @@ static void win_fault(int signal, int code, struct sigcontext *scp){
case 0x21:
if(!do_int21(scp)) goto oops;
break;
case 0x11:
scp->sc_eax = 0x00000000; /* get equipment list: we haven't */
break; /* got anything */
case 0x12:
scp->sc_eax = 640L; /* get base mem size */
break;
case 0x1A:
if(!do_int1A(scp)) goto oops;
break;
......@@ -210,7 +101,6 @@ static void win_fault(int signal, int code, struct sigcontext *scp){
scp->sc_eip += 2; /* Bypass the int instruction */
return;
oops:
fprintf(stderr,"In win_fault %x:%x\n", scp->sc_cs, scp->sc_eip);
#ifdef linux
......@@ -236,14 +126,14 @@ init_wine_signals(){
/* Point to the top of the stack, minus 4 just in case, and make
it aligned */
segv_act.sa_restorer =
(void (*)()) (((unsigned int)(cstack + sizeof(cstack) - 4)) & ~3);
(void (*)()) (((unsigned int)(cstack) + sizeof(cstack) - 4) & ~3);
wine_sigaction(SIGSEGV, &segv_act, NULL);
#endif
#ifdef __NetBSD__
struct sigstack ss;
sigset_t sig_mask;
ss.ss_sp = (char *) (((unsigned int)(cstack + sizeof(cstack) - 4)) & ~3);
ss.ss_sp = (char *) (((unsigned int)(cstack) + sizeof(cstack) - 4) & ~3);
ss.ss_onstack = 0;
if (sigstack(&ss, NULL) < 0) {
perror("sigstack");
......
......@@ -39,6 +39,10 @@ struct mz_header_s *CurrentMZHeader;
struct ne_header_s *CurrentNEHeader;
int CurrentNEFile;
static char *dllExtensions[] = { "dll", "exe", NULL };
static char *exeExtensions[] = { "exe", NULL };
static char *WinePath = NULL;
/**********************************************************************
* DebugPrintString
*/
......@@ -215,39 +219,23 @@ LoadImage(char * filename, char * modulename)
*/
for(i=0; i<wpnt->ne_header->n_mod_ref_tab; i++){
char buff[14];
char buff2[14];
char buff2[256];
int fd, j;
GetModuleName(wpnt, i + 1, buff);
if(FindDLLTable(buff)) continue; /* This module already loaded */
/* The next trick is to convert the case, and add the .dll
* extension if required to find the actual library. We may want
* to use a search path at some point as well. */
/* First try the straight name */
strcpy(buff2, buff);
if(fd = open(buff2, O_RDONLY) >= 0) {
close(fd);
LoadImage(buff2, buff);
continue;
};
/* OK, that did not work, try making it lower-case, and add the .dll
extension */
for(j=0; j<strlen(buff2); j++)
if(buff2[j] >= 'A' && buff2[j] <= 'Z') buff2[j] |= 0x20;
strcat(buff2, ".dll");
if(fd = open(buff2, O_RDONLY) >= 0) {
close(fd);
LoadImage(buff2, buff);
continue;
};
if (FindFileInPath(buff2, sizeof(buff2),
buff, dllExtensions, WinePath) != NULL &&
(fd = open(buff2, O_RDONLY)) >= 0)
{
close(fd);
LoadImage(buff2, buff);
continue;
}
fprintf(stderr,"Unable to load:%s\n", buff);
};
}
}
......@@ -257,6 +245,8 @@ LoadImage(char * filename, char * modulename)
_WinMain(int argc, char **argv)
{
int segment;
char *p;
char exe_path[256];
#ifdef WINESTAT
char * cp;
#endif
......@@ -273,8 +263,21 @@ _WinMain(int argc, char **argv)
fprintf(stderr, "usage: %s FILENAME\n", argv[0]);
exit(1);
}
p = getenv("WINEPATH");
WinePath = malloc(256 + strlen(p));
getcwd(WinePath, 256);
strcat(WinePath, ";");
strcat(WinePath, p);
if (FindFileInPath(exe_path, 256, argv[1], exeExtensions, WinePath)
== NULL)
{
fprintf(stderr, "Could not find file '%s'\n", argv[1]);
exit(1);
}
LoadImage(argv[1], NULL);
LoadImage(exe_path, NULL);
if(ran_out) exit(1);
#ifdef DEBUG
......
......@@ -8,7 +8,7 @@ memory.o: $(OBJS)
$(LD) -r -o memory.o $(OBJS)
clean:
rm -f *.o *~ *.s dll_* *.a
rm -f *.o *~ *.s dll_* *.a *#
depend:
$(CC) $(CFLAGS) -M *.c > .depend
......
CFLAGS=$(COPTS) $(DEBUGOPTS) -I$(INCLUDE_DIR)
OBJS=dos.o kernel.o user.o xt.o rect.o file.o sound.o emulate.o \
keyboard.o profile.o lstr.o
keyboard.o profile.o lstr.o exec.o
default: misc.o
......@@ -9,7 +9,7 @@ misc.o: $(OBJS)
$(LD) -r -o misc.o $(OBJS)
clean:
rm -f *.o *~ *.s dll_* *.a
rm -f *.o *~ *.s dll_* *.a *#
depend:
$(CC) $(CFLAGS) -M *.c > .depend
......
/*
* Windows Exec & Help
*
*/
#include "win.h"
#define HELP_CONTEXT 0x0001
#define HELP_QUIT 0x0002
#define HELP_INDEX 0x0003
#define HELP_CONTENTS 0x0003
#define HELP_HELPONHELP 0x0004
#define HELP_SETINDEX 0x0005
#define HELP_SETCONTENTS 0x0005
#define HELP_CONTEXTPOPUP 0x0008
#define HELP_FORCEFILE 0x0009
#define HELP_KEY 0x0101
#define HELP_COMMAND 0x0102
#define HELP_PARTIALKEY 0x0105
#define HELP_MULTIKEY 0x0201
#define HELP_SETWINPOS 0x0203
WORD WinExec(LPSTR lpCmdLine, WORD nCmdShow)
{
int X, X2, C;
char *ArgV[20];
printf("WinExec(%s, %u)\n", lpCmdLine, nCmdShow);
for (X = X2 = C = 0; X < strlen(lpCmdLine) + 1; X++) {
if ((lpCmdLine[X] == ' ') || (lpCmdLine[X] == '\0')) {
ArgV[C] = (char *)malloc(X - X2 + 1);
strncpy(ArgV[C], &lpCmdLine[X2], X - X2);
ArgV[C][X - X2] = '\0';
C++; X2 = X + 1;
}
}
ArgV[C] = NULL;
for (C = 0; ; C++) {
if (ArgV[C] == NULL) break;
printf("--> '%s' \n", ArgV[C]);
}
switch(fork()) {
case -1:
printf("Can'k 'fork' process !\n");
break;
case 0:
printf("New process started !\n");
execvp(ArgV[0], ArgV);
printf("Child process died !\n");
exit(1);
break;
default:
printf("Main process stay alive !\n");
break;
}
for (C = 0; ; C++) {
if (ArgV[C] == NULL) break;
free(ArgV[C]);
}
return(TRUE);
}
BOOL WinHelp(HWND hWnd, LPSTR lpHelpFile, WORD wCommand, DWORD dwData)
{
char *ArgV[6];
char str[32];
printf("WinHelp(%s, %u, %lu)\n", lpHelpFile, wCommand, dwData);
switch(fork()) {
case -1:
printf("Can'k 'fork' process !\n");
break;
case 0:
printf("New process started !\n");
ArgV[0] = "wine";
ArgV[1] = "/C:/windows/winhelp.exe";
ArgV[2] = lpHelpFile;
switch (wCommand) {
case HELP_CONTEXT:
case HELP_KEY:
case HELP_SETINDEX:
sprintf(str, "%lu", dwData);
ArgV[3] = str;
default:
ArgV[3] = NULL;
}
ArgV[4] = NULL;
if (wCommand == HELP_HELPONHELP) ArgV[2] = NULL;
/*
_WinMain(ArgV, 2);
*/
execvp(ArgV[0], ArgV);
printf("Child process died !\n");
exit(1);
break;
default:
printf("Main process stay alive !\n");
break;
}
return(TRUE);
}
......@@ -71,7 +71,7 @@ KERNEL_WaitEvent(int task)
int
KERNEL_GetModuleFileName(int module, char *filename, int bytes)
{
#ifdef RELAY_DEBUG
#ifdef DEBUG_RELAY
printf("GetModuleFileName: module %d, filename %x, bytes %d\n",
module, filename, bytes);
#endif
......
......@@ -12,9 +12,6 @@ static char Copyright[] = "Copyright Yngvi Sigurjonsson (yngvi@hafro.is), 1993"
#include "windows.h"
#define LPCSTR LPSTR /* I think this should be const char **/
typedef unsigned short UINT;
/* Funny to divide them between user and kernel. */
/* KERNEL.89 */
......@@ -113,7 +110,7 @@ UINT AnsiLowerBuff(LPSTR str,UINT len)
}
/* AnsiNext USER.472 */
LPSTR AnsiNext(LPCSTR current)
LPSTR AnsiNext(LPSTR current)
{
return (*current)?current+1:current;
}
......
......@@ -10,8 +10,9 @@ static char Copyright [] = "Copyright (C) 1993 Miguel de Icaza";
#include <stdio.h>
#include <string.h>
#include "windows.h"
#include "wine.h"
#define INIFILE "win.ini"
#define INIFILE GetSystemIniFilename()
#define STRSIZE 255
#define xmalloc(x) malloc(x)
#define overflow (next == &CharBuffer [STRSIZE-1])
......@@ -298,25 +299,3 @@ void sync_profiles ()
{
dump_profile (Base);
}
#ifdef DUMBTEST
main ()
{
char r [100], app [100], key [100], valor [100];
while (1){
printf ("Dame, Aplicacion, llave\n");
gets (app);
if (!app [0]){
sync_profiles ();
return;
}
gets (key);
gets (valor);
GetProfileString (app, key, "1No_Encontrado", r, sizeof (r));
printf ("(%d)\n", GetProfileInt (app, key, 5));
printf ("%s\n", r);
WriteProfileString (app, key, valor);
}
}
#endif
......@@ -50,7 +50,10 @@ USER_InitApp(int hInstance)
DCE_Init();
/* Initialize built-in window classes */
WIDGETS_Init();
if (!WIDGETS_Init()) return 0;
/* Initialize dialog manager */
if (!DIALOG_Init()) return 0;
/* Create task message queue */
if (!SetMessageQueue( DEFAULT_MSG_QUEUE_SIZE )) return 0;
......
......@@ -14,12 +14,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include <X11/Core.h>
#include <X11/Shell.h>
#include "message.h"
#include "callback.h"
#include "win.h"
#include "class.h"
#include "gdi.h"
#include "user.h"
#include "windows.h"
#ifdef __NetBSD__
#define HZ 100
......@@ -50,87 +45,6 @@ void main(int argc, char **argv)
}
/***********************************************************************
* DefWindowProc (USER.107)
*/
LONG DefWindowProc( HWND hwnd, WORD msg, WORD wParam, LONG lParam )
{
WND * wndPtr;
CLASS * classPtr;
LPSTR textPtr;
int len;
#ifdef DEBUG_MESSAGE
printf( "DefWindowProc: %d %d %d %08x\n", hwnd, msg, wParam, lParam );
#endif
switch(msg)
{
case WM_PAINT:
{
PAINTSTRUCT paintstruct;
BeginPaint( hwnd, &paintstruct );
EndPaint( hwnd, &paintstruct );
return 0;
}
case WM_CREATE:
return 0;
case WM_CLOSE:
DestroyWindow( hwnd );
return 0;
case WM_ERASEBKGND:
case WM_ICONERASEBKGND:
{
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 1;
if (!(classPtr = CLASS_FindClassPtr( wndPtr->hClass ))) return 1;
if (!classPtr->wc.hbrBackground) return 1;
FillWindow( wndPtr->hwndParent, hwnd, (HDC)wParam,
classPtr->wc.hbrBackground );
GlobalUnlock( hwnd );
return 0;
}
case WM_GETTEXT:
{
if (wParam)
{
wndPtr = WIN_FindWndPtr(hwnd);
if (wndPtr->hText)
{
textPtr = (LPSTR)USER_HEAP_ADDR(wndPtr->hText);
if ((int)wParam > (len = strlen(textPtr)))
{
strcpy((LPSTR)lParam, textPtr);
GlobalUnlock(hwnd);
return (DWORD)len;
}
}
((LPSTR)lParam)[0] = NULL;
}
GlobalUnlock(hwnd);
return (0L);
}
case WM_GETTEXTLENGTH:
{
wndPtr = WIN_FindWndPtr(hwnd);
if (wndPtr->hText)
{
textPtr = (LPSTR)USER_HEAP_ADDR(wndPtr->hText);
len = strlen(textPtr);
GlobalUnlock(hwnd);
return (DWORD)len;
}
GlobalUnlock(hwnd);
return (0L);
}
}
return 0;
}
/********************************************************************
*
......@@ -194,7 +108,8 @@ BOOL IsIconic( HWND hwnd )
return FALSE;
}
HMENU CreateMenu() { }
HMENU CreateMenu() { return 0; }
BOOL AppendMenu( HMENU hmenu, WORD flags, WORD id, LPSTR text ) { }
BOOL AppendMenu( HMENU hmenu, WORD flags, WORD id, LPSTR text ) { return TRUE;}
BOOL DestroyMenu( HMENU hmenu ) { return TRUE; }
......@@ -9,7 +9,7 @@ objects.o: $(OBJS)
$(LD) -r -o objects.o $(OBJS)
clean:
rm -f *.o *~ *.s dll_* *.a
rm -f *.o *~ *.s dll_* *.a *#
depend:
$(CC) $(CFLAGS) -M *.c > .depend
......
......@@ -19,6 +19,7 @@ extern Screen * XT_screen;
* We try to use a private color map if possible, because Windows programs
* assume that palette(0) == Black and palette(max-1) == White.
*/
#define USE_PRIVATE_MAP
Colormap COLOR_WinColormap = 0;
......@@ -71,11 +72,39 @@ static int COLOR_FillDefaultMap()
*
* Fill the private colormap.
*/
#ifdef USE_PRIVATE_MAP
static BOOL COLOR_BuildMap( Colormap map, int depth, int size )
{
XColor color;
int i;
/* Fill the whole map with a range of colors */
if ((1 << depth) > NB_SYS_COLORS)
{
int red_incr, green_incr, blue_incr;
int r, g, b;
blue_incr = 0x10000 >> (depth / 3);
red_incr = 0x10000 >> ((depth + 1) / 3);
green_incr = 0x10000 >> ((depth + 2) / 3);
for (i = 0, r = red_incr - 1; r < 0x10000; r += red_incr)
for (g = green_incr - 1; g < 0x10000; g += green_incr)
for (b = blue_incr - 1; b < 0x10000; b += blue_incr)
{
if (i >= size) break;
color.pixel = i++;
color.red = r;
color.green = g;
color.blue = b;
XStoreColor( XT_display, map, &color );
}
}
/* Store the system palette colors */
for (i = 0; i < NB_SYS_COLORS; i++)
{
if (!XParseColor( XT_display, map, SysColors[i], &color ))
......@@ -86,7 +115,7 @@ static BOOL COLOR_BuildMap( Colormap map, int depth, int size )
}
return TRUE;
}
#endif /* USE_PRIVATE_MAP */
/***********************************************************************
* COLOR_Init
......@@ -117,7 +146,7 @@ BOOL COLOR_Init()
case StaticColor:
case TrueColor:
COLOR_FillDefaultMap();
COLOR_WinColormap = CopyFromParent;
COLOR_WinColormap = DefaultColormapOfScreen( XT_screen );
break;
}
return TRUE;
......
......@@ -330,3 +330,38 @@ BOOL GetTextMetrics( HDC hdc, LPTEXTMETRIC metrics )
return TRUE;
}
/***********************************************************************
* GetCharWidth (GDI.350)
*/
BOOL GetCharWidth(HDC hdc, WORD wFirstChar, WORD wLastChar, LPINT lpBuffer)
{
int i, j;
XFontStruct *xfont;
XCharStruct *charPtr;
int default_width;
DC *dc = (DC *)GDI_GetObjPtr(hdc, DC_MAGIC);
if (!dc) return FALSE;
xfont = dc->u.x.font.fstruct;
/* fixed font? */
if (xfont->per_char == NULL)
{
for (i = wFirstChar, j = 0; i <= wLastChar; i++, j++)
*(lpBuffer + j) = xfont->max_bounds.width;
return TRUE;
}
charPtr = xfont->per_char;
default_width = (charPtr + xfont->default_char)->width;
for (i = wFirstChar, j = 0; i <= wLastChar; i++, j++)
{
if (i < xfont->min_char_or_byte2 || i > xfont->max_char_or_byte2)
*(lpBuffer + j) = default_width;
else
*(lpBuffer + j) = charPtr->width;
}
return TRUE;
}
......@@ -33,7 +33,6 @@ BOOL PALETTE_Init()
{
int i, size;
XColor color;
Colormap map;
HPALETTE hpalette;
LOGPALETTE * palPtr;
......@@ -44,13 +43,10 @@ BOOL PALETTE_Init()
palPtr->palNumEntries = size;
memset( palPtr->palPalEntry, 0xff, size*sizeof(PALETTEENTRY) );
if ((map = COLOR_WinColormap) == CopyFromParent)
map = DefaultColormapOfScreen( XT_screen );
for (i = 0; i < size; i++)
{
color.pixel = i;
XQueryColor( XT_display, map, &color );
XQueryColor( XT_display, COLOR_WinColormap, &color );
palPtr->palPalEntry[i].peRed = color.red >> 8;
palPtr->palPalEntry[i].peGreen = color.green >> 8;
palPtr->palPalEntry[i].peBlue = color.blue >> 8;
......@@ -136,7 +132,8 @@ WORD GetNearestPaletteIndex( HPALETTE hpalette, COLORREF color )
palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hpalette, PALETTE_MAGIC );
if (!palPtr) return 0;
if (COLOR_WinColormap && (hpalette == STOCK_DEFAULT_PALETTE))
if ((COLOR_WinColormap != DefaultColormapOfScreen(XT_screen)) &&
(hpalette == STOCK_DEFAULT_PALETTE))
{
if ((color & 0xffffff) == 0) return 0; /* Entry 0 is black */
if ((color & 0xffffff) == 0xffffff) /* Max entry is white */
......
......@@ -17,6 +17,159 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include "win.h"
#include "gdi.h"
#define TAB 9
#define LF 10
#define CR 13
#define SPACE 32
#define PREFIX 38
static int tabstop = 8;
static int tabwidth;
static int spacewidth;
static int prefix_offset;
static char *TEXT_NextLine(HDC hdc, char *str, int *count, char *dest,
int *len, int width, WORD format)
{
/* Return next line of text from a string.
*
* hdc - handle to DC.
* str - string to parse into lines.
* count - length of str.
* dest - destination in which to return line.
* len - length of resultant line in dest in chars.
* width - maximum width of line in pixels.
* format - format type passed to DrawText.
*
* Returns pointer to next char in str after end of the line
* or NULL if end of str reached.
*/
int i = 0, j = 0, k;
int plen = 0;
int numspaces;
SIZE size;
int lasttab = 0;
int wb_i = 0, wb_j = 0, wb_count;
while (*count)
{
switch (str[i])
{
case CR:
case LF:
if (!(format & DT_SINGLELINE))
{
i++;
if (str[i] == CR || str[i] == LF)
i++;
*len = j;
return (&str[i]);
}
dest[j++] = str[i++];
if (!(format & DT_NOCLIP) || !(format & DT_NOPREFIX))
{
if (!GetTextExtentPoint(hdc, &dest[j-1], 1, &size))
return NULL;
plen += size.cx;
}
break;
case PREFIX:
if (!(format & DT_NOPREFIX))
{
prefix_offset = j + 1;
i++;
}
else
{
dest[j++] = str[i++];
if (!(format & DT_NOCLIP))
{
if (!GetTextExtentPoint(hdc, &dest[j-1], 1, &size))
return NULL;
plen += size.cx;
}
}
break;
case TAB:
if (format & DT_EXPANDTABS)
{
wb_i = ++i;
wb_j = j;
wb_count = *count;
if (!GetTextExtentPoint(hdc, &dest[lasttab], j - lasttab,
&size))
return NULL;
numspaces = (tabwidth - size.cx) / spacewidth;
for (k = 0; k < numspaces; k++)
dest[j++] = SPACE;
plen += tabwidth - size.cx;
lasttab = wb_j + numspaces;
}
else
{
dest[j++] = str[i++];
if (!(format & DT_NOCLIP) || !(format & DT_NOPREFIX))
{
if (!GetTextExtentPoint(hdc, &dest[j-1], 1, &size))
return NULL;
plen += size.cx;
}
}
break;
case SPACE:
dest[j++] = str[i++];
if (!(format & DT_NOCLIP) || !(format & DT_NOPREFIX))
{
wb_i = i;
wb_j = j - 1;
wb_count = *count;
if (!GetTextExtentPoint(hdc, &dest[j-1], 1, &size))
return NULL;
plen += size.cx;
}
break;
default:
dest[j++] = str[i++];
if (!(format & DT_NOCLIP) || !(format & DT_NOPREFIX))
{
if (!GetTextExtentPoint(hdc, &dest[j-1], 1, &size))
return NULL;
plen += size.cx;
}
}
(*count)--;
if (!(format & DT_NOCLIP) || (format & DT_WORDBREAK))
{
if (plen > width)
{
if (format & DT_WORDBREAK)
{
*len = wb_j;
*count = wb_count;
return (&str[wb_i]);
}
else
{
*len = j;
return (&str[i]);
}
}
}
}
*len = j;
return NULL;
}
/***********************************************************************
* DrawText (USER.85)
......@@ -24,17 +177,77 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
int DrawText( HDC hdc, LPSTR str, int count, LPRECT rect, WORD flags )
{
SIZE size;
char *strPtr;
static char line[1024];
int len, lh, prefix_x, prefix_len;
TEXTMETRIC tm;
int x = rect->left, y = rect->top;
int width = rect->right - rect->left;
if (count == -1) count = strlen(str);
strPtr = str;
if (!GetTextExtentPoint( hdc, str, count, &size )) return 0;
if (flags & DT_CENTER) x = (rect->left + rect->right - size.cx) / 2;
else if (flags & DT_RIGHT) x = rect->right - size.cx;
if (flags & DT_VCENTER) y = (rect->top + rect->bottom - size.cy) / 2;
else if (flags & DT_BOTTOM) y = rect->bottom - size.cy;
GetTextMetrics(hdc, &tm);
if (flags & DT_EXTERNALLEADING)
lh = tm.tmHeight + tm.tmExternalLeading;
else
lh = tm.tmHeight;
if (flags & DT_TABSTOP)
tabstop = flags >> 8;
if (flags & DT_EXPANDTABS)
{
GetTextExtentPoint(hdc, " ", 1, &size);
spacewidth = size.cx;
GetTextExtentPoint(hdc, "o", 1, &size);
tabwidth = size.cx * tabstop;
}
do
{
prefix_offset = -1;
strPtr = TEXT_NextLine(hdc, strPtr, &count, line, &len, width, flags);
if (prefix_offset != -1)
{
GetTextExtentPoint(hdc, line, prefix_offset - 1, &size);
prefix_x = size.cx;
GetTextExtentPoint(hdc, line + prefix_offset, 1, &size);
prefix_len = size.cx;
}
if (!GetTextExtentPoint(hdc, line, len, &size)) return 0;
if (flags & DT_CENTER) x = (rect->left + rect->right -
size.cx) / 2;
else if (flags & DT_RIGHT) x = rect->right - size.cx;
if (flags & DT_SINGLELINE)
{
if (flags & DT_VCENTER) y = (rect->top + rect->bottom -
size.cy) / 2;
else if (flags & DT_BOTTOM) y = rect->bottom - size.cy;
}
if (!TextOut(hdc, x, y, line, len)) return 0;
if (prefix_offset != -1)
{
MoveTo(hdc, x + prefix_x, y + size.cy);
LineTo(hdc, x + prefix_x + prefix_len, y + size.cy);
}
if (strPtr)
{
y += lh;
if (!(flags & DT_NOCLIP))
{
if (y > rect->bottom - lh)
break;
}
}
}
while (strPtr);
if (!TextOut( hdc, x, y, str, count )) return 0;
return 1;
}
......
......@@ -7,23 +7,22 @@
struct
{
long style;
char *text;
long style;
char *text;
}
button[] =
{
BS_PUSHBUTTON, "PUSHBUTTON",
BS_DEFPUSHBUTTON, "DEFPUSHBUTTON",
/* BS_CHECKBOX, "CHECKBOX",
BS_AUTOCHECKBOX, "AUTOCHECKBOX",
BS_RADIOBUTTON, "RADIOBUTTON",
BS_3STATE, "3STATE",
BS_AUTO3STATE, "AUTO3STATE",
BS_GROUPBOX, "GROUPBOX",
BS_USERBUTTON, "USERBUTTON",
BS_AUTORADIOBUTTON, "AUTORADIOBUTTON",
BS_PUSHBOX, "PUSHBOX"
*/};
BS_PUSHBUTTON, "PUSHBUTTON",
BS_DEFPUSHBUTTON, "DEFPUSHBUTTON",
BS_CHECKBOX, "CHECKBOX",
BS_AUTOCHECKBOX, "AUTOCHECKBOX",
BS_RADIOBUTTON, "RADIOBUTTON",
BS_3STATE, "3STATE",
BS_AUTO3STATE, "AUTO3STATE",
BS_GROUPBOX, "GROUPBOX",
BS_USERBUTTON, "USERBUTTON",
BS_AUTORADIOBUTTON, "AUTORADIOBUTTON"
};
#define NUM (sizeof button / sizeof button[0])
......@@ -72,18 +71,18 @@ int PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance,
long FAR PASCAL _export WndProc(HWND hwnd, WORD message, WORD wParam, LONG lParam)
{
static char szPrm[] = "wParam LOWORD(lParam) HIWORD(lParam)",
szTop[] = "Control ID Window Handle Notification",
szUnd[] = "__________ _____________ ____________",
szFormat[] = " %5u %4X %5u",
szBuffer[50];
static HWND hwndButton[NUM];
static RECT rect;
static int cxChar, cyChar;
static char szPrm[] = "wParam LOWORD(lParam) HIWORD(lParam)",
szTop[] = "Control ID Window Handle Notification",
szUnd[] = "__________ _____________ ____________",
szFormat[] = " %5u %4X %5u",
szBuffer[50];
static HWND hwndButton[NUM];
static RECT rect;
static int cxChar, cyChar;
HDC hdc;
PAINTSTRUCT ps;
int i;
TEXTMETRIC tm;
int i;
TEXTMETRIC tm;
switch (message)
{
......
No preview for this file type
NAME Hyperoid
DESCRIPTION 'Hyperoid Copyright (C) 1990,91 Hutchins Software'
EXETYPE WINDOWS
STUB 'WINSTUB.EXE'
STACKSIZE 4096
HEAPSIZE 32768
DATA MOVEABLE MULTIPLE
CODE LOADONCALL MOVEABLE DISCARDABLE
SEGMENTS
HYPEROID LOADONCALL MOVEABLE DISCARDABLE
ROIDSUPP LOADONCALL MOVEABLE DISCARDABLE
EXPORTS
HyperoidWndProc @1
HyperoidAboutDlg @2
//
// HYPEROID.H - hyperoid internal header information
//
// Version: 1.1 Copyright (C) 1990,91 Hutchins Software
// This software is licenced under the GNU General Public Licence
// Please read the associated legal documentation
// Author: Edward Hutchins
// Revisions:
//
#ifndef RC_INVOKED
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <limits.h>
#define OEMRESOURCE
#include <winext.h>
//
// typedefs and defines
//
// color stuff
#define PALETTE_SIZE 16
typedef enum
{
BLACK, DKGREY, GREY, WHITE,
DKRED, RED, DKGREEN, GREEN, DKBLUE, BLUE,
DKYELLOW, YELLOW, DKCYAN, CYAN, DKMAGENTA, MAGENTA
} COLORS;
// degrees scaled to integer math
#define DEGREE_SIZE 256
#define DEGREE_MASK 255
#define DEGREE_MAX 0x4000
// object limits
#define MAX_PTS 8
#define MAX_OBJS 100
#define MAX_COORD 0x2000
#define CLIP_COORD (MAX_COORD+300)
// timer stuff
#define DRAW_TIMER 1
#define DRAW_DELAY 50
#define RESTART_TIMER 2
#define RESTART_DELAY 5000
// restart modes
typedef enum { RESTART_GAME, RESTART_LEVEL, RESTART_NEXTLEVEL } RESTART_MODE;
// letter scaling
#define LETTER_MAX 256
// extra life every
#define EXTRA_LIFE 100000
// list node
typedef struct tagNODE
{
struct tagNODE *npNext, *npPrev;
} NODE;
pointerdef( NODE );
// list header
typedef struct
{
NPNODE npHead, npTail;
} LIST;
pointerdef( LIST );
// object descriptor
typedef struct
{
NODE Link; // for object list
POINT Pos; // position of center of object
POINT Vel; // velocity in logical units/update
INT nMass; // mass of object
INT nDir; // direction in degrees
INT nSpin; // angular momentum degrees/update
INT nCount; // used by different objects
INT nDelay; // used by different objects
BYTE byColor; // palette color
BYTE byPts; // number of points in object
POINT Pts[MAX_PTS]; // points making up an object
POINT Old[MAX_PTS]; // last plotted location
} OBJ;
pointerdef( OBJ );
//
// inline macro functions
//
// function aliases
#define AddHeadObj(l,o) AddHead((l),((NPNODE)o))
#define RemHeadObj(l) ((NPOBJ)RemHead(l))
#define RemoveObj(l,o) Remove((l),((NPNODE)o))
#define HeadObj(l) ((NPOBJ)((l)->npHead))
#define NextObj(o) ((NPOBJ)((o)->Link.npNext))
// real-time check of the keyboard
#define IsKeyDown(x) (GetAsyncKeyState(x)<0)
// I HATE typing this allatime!
#define INTRES(x) MAKEINTRESOURCE(x)
// size of an array
#define DIM(x) (sizeof(x)/sizeof((x)[0]))
// faster than MulDiv!
#define MULDEG(x,y) ((INT)(((LONG)(x)*(y))/DEGREE_MAX))
// DEG - convert an integer into a degree lookup index
#define DEG(x) ((WORD)(x)&DEGREE_MASK)
// ACCEL - accelerate an object in a given direction
#define ACCEL(o,d,s) \
(((o)->Vel.x += MULDEG((s),nCos[DEG(d)])), \
((o)->Vel.y += MULDEG((s),nSin[DEG(d)])))
// PTINRECT - a faster PtInRect
#define PTINRECT(r,p) \
(((r)->left <= (p).x) && ((r)->right > (p).x) && \
((r)->top <= (p).y) && ((r)->bottom > (p).y))
// INTRECT - a faster IntersectRect that just returns the condition
#define INTRECT(r1,r2) \
(((r1)->right >= (r2)->left) && \
((r1)->left < (r2)->right) && \
((r1)->bottom >= (r2)->top) && \
((r1)->top < (r2)->bottom))
// MKRECT - make a rect around a point
#define MKRECT(r,p,s) \
(((r)->left = ((p).x-(s))), ((r)->right = ((p).x+(s))), \
((r)->top = ((p).y-(s))), ((r)->bottom = ((p).y+(s))))
//
// prototypes
//
// hyperoid.c
INT NEAR PASCAL arand( INT x );
VOID NEAR PASCAL AddHead( NPLIST npList, NPNODE npNode );
NPNODE NEAR PASCAL RemHead( NPLIST npList );
VOID NEAR PASCAL Remove( NPLIST npList, NPNODE npNode );
VOID NEAR PASCAL DrawObject( HDC hDC, NPOBJ npObj );
VOID NEAR PASCAL SetRestart( BOOL bGameOver );
VOID NEAR PASCAL AddExtraLife( VOID );
VOID NEAR PASCAL Hit( HDC hDC, NPOBJ npObj );
VOID NEAR PASCAL Explode( HDC hDC, NPOBJ npObj );
BOOL NEAR PASCAL HitPlayer( HDC hDC, NPOBJ npObj );
NPOBJ FAR PASCAL CreateLetter( CHAR cLetter, INT nSize );
VOID NEAR PASCAL DrawLetters( HDC hDC );
VOID NEAR PASCAL DrawHunterShots( HDC hDC );
VOID NEAR PASCAL FireHunterShot( NPOBJ npHunt );
VOID NEAR PASCAL CreateHunter( VOID );
VOID NEAR PASCAL DrawHunters( HDC hDC );
VOID NEAR PASCAL CreateSpinner( VOID );
VOID NEAR PASCAL DrawSpinners( HDC hDC );
VOID NEAR PASCAL CreateRoid( POINT Pos, POINT Vel, INT nSides, BYTE byColor, INT nDir, INT nSpeed, INT nSpin );
VOID NEAR PASCAL BreakRoid( HDC hDC, NPOBJ npRoid, NPOBJ npShot );
VOID NEAR PASCAL DrawRoids( HDC hDC );
VOID NEAR PASCAL DrawShots( HDC hDC );
VOID NEAR PASCAL DrawFlames( HDC hDC );
VOID NEAR PASCAL FireShot( VOID );
VOID NEAR PASCAL AccelPlayer( INT nDir, INT nAccel );
VOID NEAR PASCAL DrawPlayer( HDC hDC );
VOID NEAR PASCAL DrawObjects( HWND hWnd );
VOID NEAR PASCAL CheckScore( HWND hWnd );
VOID NEAR PASCAL HitList( HDC hDC, NPLIST npList );
VOID NEAR PASCAL ExplodeBadguys( HDC hDC, NPLIST npList );
VOID NEAR PASCAL NewGame( HWND hWnd );
VOID NEAR PASCAL RestartHyperoid( VOID );
VOID NEAR PASCAL Panic( BOOL bPanic );
VOID NEAR PASCAL PaintHyperoid( HWND hWnd );
VOID NEAR PASCAL DisableHyperoidInput( HWND hWnd, BOOL bCapture );
LONG FAR PASCAL EXPORT HyperoidWndProc( HWND hWnd, unsigned message, WORD wParam, LONG lParam );
BOOL NEAR PASCAL InitHyperoid( VOID );
VOID NEAR PASCAL ExitHyperoid( VOID );
INT FAR PASCAL WinMain( HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine, INT nCmdShow );
// roidsupp.c
VOID FAR PASCAL PrintLetters( NPSTR npszText, POINT Pos, POINT Vel, BYTE byColor, INT nSize );
VOID FAR PASCAL SpinLetters( NPSTR npszText, POINT Pos, POINT Vel, BYTE byColor, INT nSize );
HPALETTE FAR PASCAL CreateHyperoidPalette( VOID );
BOOL FAR PASCAL CreateHyperoidClass( VOID );
VOID NEAR PASCAL SetHyperoidMenu( HWND hWnd, INT nFirstID, INT nLastID );
HWND FAR PASCAL CreateHyperoidWindow( LPSTR lpszCmd, INT nCmdShow );
VOID FAR PASCAL SaveHyperoidWindowPos( HWND hWnd );
VOID FAR PASCAL GetHyperoidIni( VOID );
VOID FAR PASCAL HyperoidHelp( HWND hWnd );
BOOL FAR PASCAL EXPORT HyperoidAboutDlg( HWND hDlg, WORD mess, WORD wParam, LONG lParam );
VOID FAR PASCAL AboutHyperoid( HWND hWnd );
#endif // RC_INVOKED //
//
// resource IDs
//
// icons and bitmaps
#define IDI_HYPEROID 10
#define IDI_PANIC 20
// bitmaps
#define IDB_blank 50
#define IDB_bomb 51
#define IDB_level 52
#define IDB_life 53
#define IDB_num0 54
#define IDB_num1 55
#define IDB_num2 56
#define IDB_num3 57
#define IDB_num4 58
#define IDB_num5 59
#define IDB_num6 60
#define IDB_num7 61
#define IDB_num8 62
#define IDB_num9 63
#define IDB_plus 64
#define IDB_score 65
#define IDB_shield 66
// additional bitmap stuff
#define IDB_MAX 17
#define CX_BITMAP 16
#define CY_BITMAP 16
// strings
#define IDS_NAME 100
// menus
#define IDM_NEW 200
#define IDM_ABOUT 201
// about box
#define IDD_ABOUT 500
#define IDD_A_HELP 501
#define IDD_A_HISCORE 502
PROJ =HYPEROID
DEBUG =1
CC =qcl
CFLAGS_G = /AM /W3 /Ze
CFLAGS_D = /Zi /Od
CFLAGS_R = /O /Ol /Gs /DNDEBUG
CFLAGS =$(CFLAGS_G) $(CFLAGS_D)
LFLAGS_G = /CP:0xffff /NOI /SE:0x80 /ST:0x2000
LFLAGS_D = /CO /M
LFLAGS_R =
LFLAGS =$(LFLAGS_G) $(LFLAGS_D)
RUNFLAGS =
OBJS_EXT =
LIBS_EXT =
all: $(PROJ).exe
hyperoid.obj: hyperoid.c
roidsupp.obj: roidsupp.c
$(PROJ).exe: hyperoid.obj roidsupp.obj $(OBJS_EXT)
echo >NUL @<<$(PROJ).crf
hyperoid.obj +
roidsupp.obj +
$(OBJS_EXT)
$(PROJ).exe
$(LIBS_EXT);
<<
ilink -a -e "link $(LFLAGS) @$(PROJ).crf" $(PROJ)
run: $(PROJ).exe
$(PROJ) $(RUNFLAGS)
//
// HYPEROID.RC - orbiter resources
//
#include <windows.h>
#include "hyperoid.h"
IDI_HYPEROID ICON "hyperoid.ico"
IDI_PANIC ICON "panic.ico"
STRINGTABLE
{
IDS_NAME, "Hyperoid"
IDM_NEW, "New Game&!"
IDM_ABOUT, "&About..."
}
//
// About box
//
IDD_ABOUT DIALOG LOADONCALL MOVEABLE DISCARDABLE 30, 30, 150, 120
CAPTION "About"
STYLE WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_SYSMENU | WS_VISIBLE | DS_MODALFRAME | WS_POPUP
{
CTEXT "Hyperoid", -1, 0, 10, 150, 8
CTEXT "The classic game", -1, 0, 20, 150, 8
CTEXT "Version 1.1", -1, 0, 30, 150, 8
CTEXT "Copyright 1991 Hutchins Software", -1, 0, 45, 150, 8
CTEXT "This program is freeware", -1, 0, 55, 150, 8
CTEXT "Author: Edward Hutchins", -1, 0, 65, 150, 8
CTEXT "eah1@cec1.wustl.edu", -1, 0, 75, 150, 8
CTEXT "", IDD_A_HISCORE, 0, 85, 150, 8
ICON IDI_HYPEROID, -1, 10, 16, 0, 0
DEFPUSHBUTTON "Ok!", IDOK, 20, 100, 40, 12
CONTROL "&Help", IDD_A_HELP, "button", BS_PUSHBUTTON | WS_TABSTOP | WS_CHILD, 90, 100, 40, 12
}
//
// bitmaps
//
IDB_blank BITMAP DISCARDABLE "blank.bmp"
IDB_bomb BITMAP DISCARDABLE "bomb.bmp"
IDB_level BITMAP DISCARDABLE "level.bmp"
IDB_life BITMAP DISCARDABLE "life.bmp"
IDB_num0 BITMAP DISCARDABLE "num0.bmp"
IDB_num1 BITMAP DISCARDABLE "num1.bmp"
IDB_num2 BITMAP DISCARDABLE "num2.bmp"
IDB_num3 BITMAP DISCARDABLE "num3.bmp"
IDB_num4 BITMAP DISCARDABLE "num4.bmp"
IDB_num5 BITMAP DISCARDABLE "num5.bmp"
IDB_num6 BITMAP DISCARDABLE "num6.bmp"
IDB_num7 BITMAP DISCARDABLE "num7.bmp"
IDB_num8 BITMAP DISCARDABLE "num8.bmp"
IDB_num9 BITMAP DISCARDABLE "num9.bmp"
IDB_plus BITMAP DISCARDABLE "plus.bmp"
IDB_score BITMAP DISCARDABLE "score.bmp"
IDB_shield BITMAP DISCARDABLE "shield.bmp"
//
// LIST - list processing functions for orbiter
//
// Version: 1.0 Copyright (C) 1990, Hutchins Software
// Author: Edward Hutchins
// Revisions:
//
#include "orbiter.h"
//
// AddHead - add an object to the head of a list
//
VOID FAR PASCAL AddHead( NPLIST npList, NPNODE npNode )
{
if (npList->npHead)
{
npNode->npNext = npList->npHead;
npNode->npPrev = NULL;
npList->npHead = (npList->npHead->npPrev = npNode);
}
else // add to an empty list
{
npList->npHead = npList->npTail = npNode;
npNode->npNext = npNode->npPrev = NULL;
}
}
//
// RemHead - remove the first element in a list
//
NPNODE FAR PASCAL RemHead( NPLIST npList )
{
if (npList->npHead)
{
NPNODE npNode = npList->npHead;
if (npList->npTail != npNode)
{
npList->npHead = npNode->npNext;
npNode->npNext->npPrev = NULL;
}
else npList->npHead = npList->npTail = NULL;
return( npNode );
}
else return( NULL );
}
//
// Remove - remove an arbitrary element from a list
//
VOID FAR PASCAL Remove( NPLIST npList, NPNODE npNode )
{
if (npNode->npPrev) npNode->npPrev->npNext = npNode->npNext;
else npList->npHead = npNode->npNext;
if (npNode->npNext) npNode->npNext->npPrev = npNode->npPrev;
else npList->npTail = npNode->npPrev;
}
########################################################
#
# hyperoid makefile
#
# Copyright (C) 1988-1990 Lantern Corp.
#
########################################################
# This is just a teaser to show how little you have to do to make projects
# under Lantern Corp.'s software engineering system. To make Hyperoid on
# your system, make sure <winext.h> is in your include path and set up your
# makefile like you normally do for your own stuff.
# I'll (hopefully) post the 100k of stuff you need for this makefile to
# be usefull. I'll have to talk to my boss first...
# P.S. The system only works for the Mircosoft C6.0 compiler, but its easy
# enough to change.
# P.P.S. I hate every integrated environment I've run across so far, thus
# the system is run from a command prompt.
PROJ = hyperoid
OBJS = hyperoid.obj roidsupp.obj
RESS = hyperoid.res
LIBS =
!include <windows.mk>
****************************************************************************
LEGAL JUNK:
Hyperoid - a game for Mircosoft Windows (tm)
Copyright (C) 1991 Edward Hutchins
internet: eah1@cec1.wustl.edu
usnail: c/o Edward Hutchins, 63 Ridgemoor Dr., Clayton, MO 63105
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Note: Windows is a trademark of Microsoft Corp. (Duh)
With this aside,
****************************************************************************
Hello, and Welcome to Hyperoid version 1.1!
The object of the game is intuitive---shoot everything! (Well, almost
everything, heh heh!). If the keyboard buffer overflows in all the
excitement, ignore the beeps you hear and they'll go away.
Hyperoids uses the palette manager, so if you have a palette-capable display
(and you read the on-line help pages) you should be able to set up better
colors than the Windows defaults. I have tested hyperoids on a monochrome
'286, and it seems to work fine. If you want to re-map the keys, look at
Appendix A (or the Windows SDK) for some non-ASCII virtual key codes.
The source is available through the same channel that you got the executable
through, as per the GNU general public licence. Please read the licence if
you have any questions, or contact me at the above addresses (email
preferred).
If you make modifications/bug fixes to Hyperoid, please use me as a clearing
house to prevent versions flooding out into the universe. (You don't have to,
but I'd appreciate it :-). If you write the world's greatest game using some
of my source, please send me note telling what it is and where it's available.
Changes since 1.0:
Explosion processing a little faster
Swarmers (little green guys) no longer flood the system
Scoring is better
Extra lives every 100,000 points (not 50,000)
Firepower reduced a little (hey, the game was too darn easy)
Spinning Game Over (Oooooh...)
Look for:
ls - *nix ls command with MUCHO bells&whistles (couldn't live w/out it!)
blitfix - util that sets the CS_BYTEALIGNCLIENT bit on all top windows
(speeds up my 1024x768 display by a factor of 3)
eyecon - xeyes clone (may have to be renamed)
ilbm - Amiga IFF bitmap viewer (supports HAM mode and palettes!)
life - 7 blit life with a few bells&whistles
loadmon - nifty system performance monitor
mbrot - mandelbrot hack that runs in the background
yow - Zippy the Pinhead in his very own icon, telling it like it is
(more games... stuff... junk...)
Coming real soon now to a (net,BBS,Wherever this stuff ends up) near YOU!
Appendix A: Virtual Key Codes
-----------------------------
VK_TAB 9 = default shields
VK_RETURN 13
VK_SHIFT 16
VK_CONTROL 17
VK_CAPITAL 20 - useful for autofire!
VK_ESCAPE 27 = default boss key
VK_SPACE 32 = default fire key
VK_PRIOR 33
VK_NEXT 34
VK_END 35
VK_HOME 36
VK_LEFT 37 = default counter-clockwise key
VK_UP 38 = default reverse thrust key
VK_RIGHT 39 = default clockwise key
VK_DOWN 40 = default thrust key
VK_INSERT 45
VK_DELETE 46
VK_A-VK_Z 64-90, 83 = default smartbomb key (ASCII 'S')
VK_NUMPAD0 96
VK_NUMPAD1 97
VK_NUMPAD2 98
VK_NUMPAD3 99
VK_NUMPAD4 100
VK_NUMPAD5 101
VK_NUMPAD6 102
VK_NUMPAD7 103
VK_NUMPAD8 104
VK_NUMPAD9 105
VK_MULTIPLY 106
VK_ADD 107
VK_SEPARATOR 108
VK_SUBTRACT 109
VK_DECIMAL 110
VK_DIVIDE 111
VK_F1-VK_F16 112-127
#if !defined(WINEXT_H)
#define WINEXT_H
#if defined(__cplusplus)
extern "C" {
#endif // __cplusplus
//
// WINEXT.H - additional windows definitions
//
// Version 1.0 03/21/89 Copyright (C) 1989,90,91 Lantern Coroporation.
// Author: Edward Hutchins
// Status: Freeware
// Revisions:
// 06/06/90 modified HUGE to LARGE to preserve compatibility with math.h
// also nested windows.h include to prevent modifications on the
// actual source file - Ed.
// 10/01/90 added CONST and CONSTP,NP,LP,HP and a few comments - Ed.
// 08/28/91 added EXPORT and SEGMENT - Ed.
// 10/28/91 added DLLEXP - Ed.
// 11/02/91 posted on Compuserve - Ed.
//
//
// include WINDOWS.H, if needed
//
#if !defined(WINDOWS_H)
#if defined(NULL)
#undef NULL
#endif
#include <windows.h>
#if !defined(NULL)
#define NULL 0
#endif
#define WINDOWS_H
#endif // WINDOWS_H
//
// extra data types and defines
//
#define LARGE huge
#define CDECL cdecl
#define CONST const
#define HNULL (0)
#define LPNULL (0L)
typedef char CHAR;
typedef int INT;
typedef float FLOAT;
typedef double DOUBLE;
typedef long double LDOUBLE;
// extend the string type
typedef CHAR LARGE *HPSTR;
// useful macros for typedefing pointers to objects //
#define npointerdef(o) typedef o NEAR * NP ## o
#define lpointerdef(o) typedef o FAR * LP ## o
#define hpointerdef(o) typedef o LARGE * HP ## o
#define pointerdef(o) npointerdef(o); lpointerdef(o); hpointerdef(o)
// define the different kinds of pointers to things //
pointerdef( BOOL );
npointerdef( BYTE ); hptrdef( BYTE );
pointerdef( CHAR );
npointerdef( INT ); hpointerdef( INT );
npointerdef( WORD ); hpointerdef( WORD );
npointerdef( LONG ); hpointerdef( LONG );
npointerdef( DWORD ); hpointerdef( DWORD );
pointerdef( FLOAT );
pointerdef( DOUBLE );
pointerdef( LDOUBLE );
npointerdef( HANDLE ); hpointerdef( HANDLE );
npointerdef( VOID ); hpointerdef( VOID );
// these are here for compatibility - use NPVOID etc...
typedef VOID NEAR *NPMEM;
typedef VOID FAR *LPMEM;
// window proc function pointer
typedef LONG (FAR PASCAL *WNDPROC)( HWND, unsigned, WORD, LONG );
//
// scope protocol definitions
//
#define GLOBAL // GLOBAL
#define LOCAL static
#define IMPORT extern
#define FROM(where) // FROM where
#define PROTO // PROTOTYPE
#define EXPORT _export
#define SEGMENT _segment
#if defined(__cplusplus)
}
#endif // __cplusplus
// c++ class export type
#if defined(__DLL__)
#define DLLEXP EXPORT
#else
#define DLLEXP LARGE
#endif
#endif // WINEXT_H
;**********************************************************************
;* Copyright (c) 1991 by TRG ELECTRONIK *
;**********************************************************************
NAME WineTest
DESCRIPTION 'Drink Inventry Controler'
STUB 'WINSTUB.EXE'
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD MOVEABLE MULTIPLE
EXETYPE WINDOWS
SEGMENTS
DRINK_TEXT PRELOAD MOVEABLE DISCARDABLE
HEAPSIZE 20000
STACKSIZE 8192
EXPORTS WndProc @1
About_Proc @3

\ No newline at end of file
/**********************************************************************
* Copyright (c) 1991 by TRG ELECTRONIK *
**********************************************************************/
#define szAppName "widgetClass"
#define IDNULL -1
#define IDSCLOSE 20
#define IDSOKCLOSE 21
#define IDSSAVE 22
#define IDSOKSAVE 23
#define IDINFO 24
#define IDSAVE 25
#define IDDELETE 26
#define IDNEW 27
#define IDBUSER 30
#define IDBUSER1 31
#define IDBUSER2 32
#define IDBUSER3 33
#define IDBUSER4 34
#define IDBUSER5 35
#define IDBUSER6 36
#define IDBUSER7 37
#define IDBUSER8 38
#define IDBUSER9 39
#define IDDJOBNAME 50
#define IDDPRINTER 51
#define IDSETUP 60
#define IDI_MKSICON 99
/******************************************/
#define MID_NEW 100
#define MID_OPEN 101
#define MID_SAVE 102
#define MID_SAVEAS 103
#define MID_PRINT 104
#define MID_PRSETUP 105
#define MID_STATUS 106
#define MID_QUIT 107
#define MID_CUT 121
#define MID_COPY 122
#define MID_PASTE 123
#define MID_CLEAR 124
#define MID_COPYTO 125
#define MID_PASTEFROM 126
#define MID_NEWPROD 140
#define MID_NEWBEER 141
#define MID_USERCFG 142
#define MID_POREGIE 151
#define MID_POBIERE 152
#define MID_DAYSTOCK 153
#define MID_RESERVE 154
#define MID_COCKSALE 155
#define MID_DRYSALE 156
#define MID_COMPILE 157
#define MID_RECETTES 158
#define MID_HD 159
#define MID_TESTPRN 160
#define MID_INFODSK 161
#define MID_SHARP 162
#define MID_PASSWORD 163
/******************************************/
#define IDDTEXT 200
#define IDDTXT1 201
#define IDDTXT2 202
#define IDDTXT3 203
#define IDDTXT4 204
#define IDDTXT5 205
#define IDDTXT6 206
#define IDDTXT7 207
#define IDDTXT8 208
#define IDDTXT9 209
#define IDDTXT10 210
#define IDDTXT11 211
#define IDDTXT12 212
#define IDDTXT13 213
#define IDDTXT14 214
#define IDDTXT15 215
#define IDDTXT16 216
#define IDDTXT17 217
#define IDDTXT18 218
#define IDDTXT19 219
#define IDDBUTTON1 220
#define IDDBUTTON2 221
#define IDDBUTTON3 222
#define IDDBUTTON4 223
#define IDDBUTTON5 224
#define IDDBUTTON6 225
#define IDDBUTTON7 226
#define IDDBUTTON8 227
#define IDDBUTTON9 228
#define IDDBUTTON10 229
#define IDDCHKBOX1 240
#define IDDCHKBOX2 241
#define IDDCHKBOX3 242
#define IDDCHKBOX4 243
#define IDDCHKBOX5 244
#define IDDCHKBOX6 245
#define IDDCHKBOX7 246
#define IDDCHKBOX8 247
#define IDDCHKBOX9 248
#define IDDCHKBOX10 249
#define IDDSCROLL1 250
#define IDDSCROLL2 251
#define IDDSCROLL3 252
#define IDDSCROLL4 253
#define IDDSCROLL5 254
#define IDDSCROLL6 255
#define IDDSCROLL7 256
#define IDDSCROLL8 257
#define IDDSTR1 2000
#define IDDSTR2 2001
#define IDDSTR3 2002
#define IDDSTR4 2003
#define IDDSTR5 2004
#define IDDSTR6 2005
#define IDDSTR7 2006
#define IDDSTR8 2007
#define IDDSTR9 2008
#define IDDSTR10 2009
#define IDDSTR11 2010
#define IDDSTR12 2011
#define IDDSTR13 2012
#define IDDSTR14 2013
#define IDDSTR15 2014
#define IDDSTR16 2015
#define IDDSTR17 2016
#define IDDSTR18 2017
#define IDDSTR19 2018
#define IDDSTR20 2019
#define IDDSTR21 2020
#define IDDSTR22 2021
#define IDDSTR23 2022
#define IDDSTR24 2023
#define IDDSTR25 2024
#define IDDSTR26 2025
#define IDDSTR27 2026
#define IDDSTR28 2027
#define IDDSTR29 2028
#define IDDSTR30 2029
#define IDDSTR31 2030
#define IDDSTR32 2031
#define IDDSTR33 2032
#define IDDSTR34 2033
#define IDDSTR35 2034
#define IDDSTR36 2035
#define IDDSTR37 2036
#define IDDSTR38 2037
#define IDDSTR39 2038
#define IDDSTR40 2039
#define IDDSTR41 2040
#define IDDSTR42 2041
#define IDDSTR43 2042
#define IDDSTR44 2043
#define IDDSTR45 2044
#define IDDSTR46 2045
#define IDDSTR47 2046
#define IDDSTR48 2047
#define IDDSTR49 2048
#define IDDSTR50 2049
#define IDDSTR51 2050
#define IDDSTR52 2051
#define IDDSTR53 2052
#define IDDSTR54 2053
#define IDDSTR55 2054
#define IDDSTR56 2055
#define IDDSTR57 2056
#define IDDSTR58 2057
#define IDDSTR59 2058
#define IDDSTR60 2059
#define IDDSTR61 2060
#define IDDSTR62 2061
#define IDDSTR63 2062
#define IDDSTR64 2063
#define IDDSTR65 2064
#define IDDSTR66 2065
#define IDDSTR67 2066
#define IDDSTR68 2067
#define IDDSTR69 2068
#define IDDSTR70 2069
/******************************************/
#define IDDDEFAULTS 1001
#define IDDCHECKBOX 1002
#define IDDNULL 1003
#define IDDRBLEFT 1004
#define IDDRBRIGHT 1005
#define IDDRBCENTER 1006
#define IDDLISTBOX 1007
#define IDDSBH 1008
#define IDDSBV 1009
/******************************************/
#define ABOUT_Dlg 2001
#define NEW_Dlg 2002
#define OPEN_Dlg 2003
#define SAVE_Dlg 2004
#define SAVEAS_Dlg 2005
#define PRINT_Dlg 2006
#define ABORT_Dlg 2007
#define PRSETUP_Dlg 2008
#define QUIT_Dlg 2009
#define GETOBJ_Dlg 2020
#define NEWPROD_Dlg 2021
#define NEWBEER_Dlg 2022
#define USERCFG_Dlg 2023
#define POREGIE_Dlg 2024
#define POBIERE_Dlg 2025
#define PASSWORD_Dlg 2026
#define TVQ_Dlg 2027
#define LTEXTOK_Dlg 2070
/******************************************/
#define RED 0x000000FF
#define GREEN 0x0000FF00
#define BLUE 0x00FF0000
#define CYAN 0x00FFFF00
#define MAGENTA 0x00FF00FF
#define BLACK 0x00000000
#define WHITE 0x00FFFFFF
#define GRAY 0x00808080
#define LTGRAY 0x00C0C0C0
#define DKGRAY 0x00404040

\ No newline at end of file
/**********************************************************************
* Copyright (c) 1991 by TRG ELECTRONIK *
* *
* widget.RC *
* widget RESSOURCES *
* *
**********************************************************************/
#include <\BC\INCLUDE\WINDOWS.H>
#include "widget.H"
#define TABGRP WS_TABSTOP | WS_GROUP
#define LBSTYLES WS_VSCROLL | WS_BORDER | WS_VISIBLE | LBS_SORT | TABGRP
#define HSCROLL WS_VISIBLE | SBS_HORZ | SBS_TOPALIGN | TABGRP
#define VSCROLL WS_VISIBLE | SBS_VERT | SBS_LEFTALIGN | TABGRP
#define BLACKRECT SS_BLACKRECT | WS_VISIBLE | WS_GROUP
#define WHITEFRAME SS_WHITEFRAME | WS_VISIBLE | WS_GROUP
ICON_1 ICON widget.ICO
ICON_2 ICON widget.IC2
ICON_3 ICON widget.IC3
MENU_1 MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New", MID_NEW
MENUITEM "&Open", MID_OPEN
MENUITEM "&Save", MID_SAVE
MENUITEM "Save &As", MID_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Quit!", MID_QUIT
END
END
ABOUT_Dlg DIALOG 100, 100, 154, 75
STYLE WS_POPUP | WS_DLGFRAME
BEGIN
ICON "widget" -1, 9, 23, 0, 0
ICON "DKICON2" -1, 30, 23, 0, 0
ICON "DKICON3" -1, 50, 23, 0, 0
CTEXT "About widget Inventory Controler" -1, 0, 14,154, 8
CTEXT "Version 0.50" -1, 30, 34, 94, 8
CTEXT "Copyright 1991, TRG Electronik" -1, 0, 47,154, 9
DEFPUSHBUTTON "Ok" IDOK, 61, 59, 32, 14, WS_GROUP
END
LTEXTOK_Dlg DIALOG 100, 100, 300, 120
STYLE WS_POPUP | WS_DLGFRAME
BEGIN
LTEXT "", IDDTXT1, 20, 15,118, 12
LTEXT "", IDDTXT2, 20, 30,118, 25
LTEXT "", IDDTXT3, 20, 45,118, 35
LTEXT "", IDDTXT3, 20, 60,118, 35
DEFPUSHBUTTON "OK", IDOK, 150, 85, 40, 14, TABGRP
END
STRINGTABLE
BEGIN
IDDSTR1, "Wine Test Program"
IDDSTR2, ""
IDDSTR3, ""
IDDSTR4, ""
IDDSTR5, ""
IDDSTR6, ""
IDDSTR7, ""
IDDSTR8, ""
IDDSTR9, ""
IDDSTR10, ""
END

\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment