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

- alldiplay.[ch]
uidisplay_hotswap_gfx_mode - implement

implement resizing

finish special keys assignments
 find constants for them

- error.c
v check verror implementation - done
v check opening bzip compressed files - done

--
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"

-----------------
ui/gtk/pokefinder.c
add in line 29:
#ifdef UI_GTK		/* Use this file iff we're using GTK+ */
add in last line:
#endif			/* #ifdef UI_GTK */

in libspectrum:
nothing to do - configure with --without-glib
glib replacement functions are filled in by perl script.

myglib.c misses only g_slist_prepend - done
http://sourceforge.net/tracker/index.php?func=detail&aid=859594&group_id=91293&atid=596650

--
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

--
in machine.c
remove libgen.h - unused? - done
--
in utils.c
remove libgen.h
--
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)

--
modified things are:
./fuse.dev
./fuse.layaout
./ui/win32
./exe
(./config.h)
when compiled --with-sdl also
./ui/gtk/keysyms.c
./ui/gtk/options.[hc]
--
strip fuse.exe and compress with http://upx.sf.net/
---
joystick
for full CURSOR/PROTEK joystick support add keysyms.c:
  { VK_TAB,          KEYBOARD_0,        KEYBOARD_Caps   },
--
sound and speed works fine when added:
spectrum.c:101
#if defined(UI_SDL) || defined(HAVE_DSOUND_H)
fuse.c:227
#if defined(UI_SDL) || defined(HAVE_DSOUND_H)
fuse.c:404
#if !defined(UI_SDL) && !defined(HAVE_DSOUND_H)
fuse.c:421
#if !defined(UI_SDL) && !defined(HAVE_DSOUND_H)
fuse.c:426
#if defined(UI_SDL) || defined(HAVE_DSOUND_H)
fuse.c:431
#if !defined(UI_SDL) && !defined(HAVE_DSOUND_H)
fuse.c:612
#if defined(UI_SDL) || defined(HAVE_DSOUND_H)

added patch:
http://sourceforge.net/tracker/index.php?func=detail&aid=859483&group_id=91293&atid=596650
next patch:
http://sourceforge.net/tracker/index.php?func=detail&aid=859997&group_id=91293&atid=596650

--
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
--
add dirname() implementation
--
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
