http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnardirdraw/html/msdn_directd5.asp
http://francis.dupont.free.fr/coindev/english/directdraw/clipping.htm
http://www.fourcc.org/fccovrly.php
--
change include "memory.h" to:

34 11 C:\Dev-Cpp-projects\fuse-cvs\z80\z80_ops.c
#include "../memory.h"
31 11 C:\Dev-Cpp-projects\fuse-cvs\debugger\debugger.c
#include "../memory.h"
37 11 C:\Dev-Cpp-projects\fuse-cvs\debugger\disassemble.c
#include "../memory.h"
-----------------
in libspectrum:
nothing to do - configure with --without-glib
--
implement those 2 things I posted on mingw-devel

in filesel.c
add
#include <windows.h>

1. http://thread.gmane.org/gmane.comp.gnu.mingw.user/9203

widget/filesel.c:
replace
      if( errno == 0 ) {	/* End of directory */
with      
#ifndef WIN32
      if( errno == 0 ) {	/* End of directory */
#else
      if( 1 ) {	/* End of directory */
#endif

this was fixed in mingw-runtime 3.2

2. http://thread.gmane.org/gmane.comp.gnu.mingw.user/9197

widget/filesel.c:
replace
      if(errno==ENOTDIR) {
with
#ifndef WIN32
      if(errno==ENOTDIR) {
#else
      if( GetFileAttributes( fn ) != FILE_ATTRIBUTE_DIRECTORY	) {
#endif

submitted:
http://sourceforge.net/tracker/index.php?func=detail&aid=859674&group_id=91293&atid=596650

--
ssize_t replacement:
compat.h
#ifndef HAVE_SSIZE_T
  typedef	int ssize_t;
  #define HAVE_SSIZE_T 1
#endif

this was fixed in mingw-runtime 3.2
--
fuse.c:
change "main()" to "main1()"
because program must start from WinMain
(start with main() if found)

is there a -D option?
--
strip fuse.exe and compress with http://upx.sf.net/
---
write .def file for libspectrum.dll
--
used libraries to add in win32:
v bzip2 for libspectrum
jsw
libgcrypt
lib765
libdsk
--
add some help to win32 - maybe there's man2help or man2pdf or sth like that
 man2html
--
fix dirname() implementation for win32
--
gtkkeyboard.c
line 98:
/*
  return XKeycodeToKeysym(gdk_display,
			  XKeysymToKeycode(gdk_display,keysym),
			  0);
*/
  return keysym;

gtkui.c
line 35:
//#include <gdk/gdkx.h>
--
to compile with gtk 2.0
-mno-cygwin -mms-bitfields -I. -I"C:\Dev-Cpp\include\gtk-2.0" -I"C:\Dev-Cpp\include\gtkdeps-2.0" -I"C:\Dev-Cpp\include\gtk-2.0\include" -I"C:\Dev-Cpp\include\atk-1.0" -I"C:\Dev-Cpp\include\pango-1.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include\glib-2.0" -I"C:\Dev-Cpp\include\glib-2.0\include" -I"C:\Dev-Cpp\lib\glib-2.0\include" -I"C:\Dev-Cpp\lib\gtk-2.0\include"
-lgtk-win32-2.0 -lgdk-win32-2.0 -lgthread-2.0 -lgdi32 -lole32 -luuid -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv
--
machine.c, utils.c:
dirname port
link 418:
/*
  strncpy( fuse_path, fuse_progname, PATHNAME_MAX_LENGTH );
  fuse_dir = dirname( fuse_path );

  snprintf( path, PATHNAME_MAX_LENGTH, "%s/roms/%s", fuse_dir, filename );
  fd = open( path, O_RDONLY | O_BINARY );
  if( fd != -1 ) return fd;
*/
----
fuse

in ui/scaler/scalers.c:
include in compilation
override build command:
$(CC) -DSCALER_DATA_SIZE=2 -c scalers.c -o scalers16.o $(CFLAGS)
$(CC) -DSCALER_DATA_SIZE=4 -c scalers.c -o scalers32.o $(CFLAGS)

"
$(CC) -DSCALER_DATA_SIZE=2 -c ui\scaler\scalers.c -o ui\scaler\scalers16.o $(CFLAGS)
$(CC) -DSCALER_DATA_SIZE=4 -c ui\scaler\scalers.c -o ui\scaler\scalers32.o $(CFLAGS)
"
--
in project options, parameters
first line should be:
ui/scaler/scalers16.o ui/scaler/scalers32.o 
--
full config.h for win32:
#define HAVE_ENOUGH_MEMORY 1
#define HAVE_LIB_XML2 1
#define UI_WIN32 1
#define USE_LIBPNG 1
#define USE_WIDGET 1
#define HAVE_DSOUND_H 1
#define HAVE_GETPAGESIZE 1
#define HAVE_INTTYPES_H 1
#define HAVE_LIBSPECTRUM_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_SOUNDCARD_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define PACKAGE "fuse"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define STDC_HEADERS 1
#define VERSION "0.6.1.1"
#define YYTEXT_POINTER 1
--
directx redefinitions (?):
1.
230 C:\Dev-Cpp\include\dsound.h
[Warning] redefinition of `LPCWAVEFORMATEX'
typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
1018 C:\Dev-Cpp\include\mmsystem.h
[Warning] `LPCWAVEFORMATEX' previously declared here
typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
2.
1899 C:\Dev-Cpp\include\dsound.h
redefinition of `LPDIRECTSOUNDFULLDUPLEX'
typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX;
175 C:\Dev-Cpp\include\dsound.h
`LPDIRECTSOUNDFULLDUPLEX' previously declared here
typedef struct IDirectSoundFullDuplex       *LPDIRECTSOUNDFULLDUPLEX;
3.
211 C:\Dev-Cpp\include\ddraw.h
[Warning] redefinition of `HRESULT'
typedef long HRESULT;
252 C:\Dev-Cpp\include\windef.h
[Warning] `HRESULT' previously declared here
typedef LONG HRESULT;
--
in utils.c
define fuse-wide constant "slash" or "fsdelim" - representing filesystems' filename 
delimiter depending on system
and change in many places in utils.c
also in fuse.c
  strncat( fuse_directory, "/", 1024 );
--
full path is determined by
':' as second character
namely in util.c:225:
  if( fuse_progname[0] == '/' ) {
(and in other places) it should be
#ifndef WIN32
  if( fuse_progname[0] == '/' ) {
#else
  if ( strlen(fuse_progname) >= 1 )
    if( fuse_progname[1] == ':' ) {
#endif
    strncpy( fuse_path, fuse_progname, PATHNAME_MAX_LENGTH );
  } else {
    strncpy( fuse_path, fuse_directory, PATHNAME_MAX_LENGTH );
    strncat( fuse_path, fuse_progname, PATHNAME_MAX_LENGTH );
  }

argc[0] in windows for me always contains full path
indepentently on how it was run
--
make appropriate copyright notes
--
Marek (spec(at)webtech(dot).pl
