[Scummvm-cvs-logs] CVS: scummvm/backends/gp32 Makefile,NONE,1.1 README.GP32,NONE,1.1 cpuspeed.s,NONE,1.1 debug-gdbstub-usb.cpp,NONE,1.1 gfx_splash.h,NONE,1.1 graphics.h,NONE,1.1 setup.h,NONE,1.1 startup.c,NONE,1.1 startup.h,NONE,1.1 build.rules,1.5,1.6 gp-fs.cpp,1.4,1.5 gp32.cpp,1.23,1.24 gp32.h,1.23,1.24 portdefs.h,1.4,1.5 dirent.h,1.3,NONE readme.txt,1.3,NONE sdl.h,1.2,NONE stat.h,1.3,NONE

Eugene Sandulenko sev at users.sourceforge.net
Wed Mar 9 14:22:29 CET 2005


Update of /cvsroot/scummvm/scummvm/backends/gp32
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28682/backends/gp32

Modified Files:
	build.rules gp-fs.cpp gp32.cpp gp32.h portdefs.h 
Added Files:
	Makefile README.GP32 cpuspeed.s debug-gdbstub-usb.cpp 
	gfx_splash.h graphics.h setup.h startup.c startup.h 
Removed Files:
	dirent.h readme.txt sdl.h stat.h 
Log Message:
WIP of GP32 port. Now it is more correct port and compiles with current
CVS. Though it has some issues unresolved, one of them is that it crashes
right after splash screen without showing anything. Work in progress :)


--- NEW FILE: Makefile ---
CXX     := c++
AR      := arm-elf-ar cru
RANLIB  := arm-elf-ranlib
RM      := rm -f
MKDIR   := mkdir -p
ECHO    := echo -n
CAT     := cat
RM      := rm -f
# recursive version of RM
RM_REC  := $(RM) -r
ZIP     := zip -q
CP      := cp

#######################################################################
# Default compilation parameters. Normally don't edit these           #
#######################################################################

CXXFLAGS:= -g -O
DEFINES :=
LDFLAGS :=
INCLUDES:= -I. -Icommon
LIBS	:=
OBJS	:=

# Turn on useful warnings
CXXFLAGS+= -Wall -pedantic -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion
CXXFLAGS+= -Wshadow -Wuninitialized -Wimplicit -Wundef
CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder
CXXFLAGS+= -Wwrite-strings -fcheck-new -Wctor-dtor-privacy -Wnon-virtual-dtor

# Seems GCC 2.95 doesn't support the following, so we do not yet turn them
# on by default (but I'd strongly recommend to all GCC 2.95 users to update
# to a better compiler like GCC 3.x).
#CXXFLAGS+= -ansi -W -Wno-unused-parameter -Woverloaded-virtual -Wdisabled-optimization -Wfloat-equal

# The following causes problems on some systems where the system header
# contain duplicate declarations already. That's really a bug in the 
# system headers, but since it causes lots of warnings on those systems,
# we don't enable it by default
#CXXFLAGS+= -Wredundant-decls

# Load the build rules & settings for the chosen backend
-include build.rules

#######################################################################
# Compile options - you can modify these to tweak ScummVM compilation #
#######################################################################

# Uncomment this to activate the MAD lib for compressed sound files
# DEFINES += -DUSE_MAD
# LIBS    += -lmad

# Uncomment this to activate the Ogg Vorbis lib for compressed sound files
# You MUST use Tremor for Ogg Vorbis support on the GP32 port.
# DEFINES += -DUSE_VORBIS
# LIBS    += -lvorbisfile -lvorbis

# Uncomment this to activate the ALSA lib for midi
# DEFINES += -DUSE_ALSA
# LIBS    += -lasound

# Uncomment this to cause warnings to be treated as errors
# CXXFLAGS+= -Werror

# Uncomment this to use GCC 3.x specific dependency tracking (recommended)
HAVE_GCC3 = 1

#######################################################################
# Control which modules are built - uncomment any to disable module   #
#######################################################################

#DISABLE_SCUMM = 1
DISABLE_SIMON = 1
DISABLE_SKY = 1
DISABLE_QUEEN = 1

# The engines below are not supported on the GP32 port so there is
# no point compiling support into the binary.
DISABLE_SWORD1 = 1
DISABLE_SWORD2 = 1

# In-development engines below.
# Disable for ALL release builds.
DISABLE_SAGA = 1
DISABLE_KYRA = 1

#######################################################################
# Misc stuff - you should normally never have to edit this            #
#######################################################################

EXECUTABLE := scummvm$(EXEEXT)

include Makefile.common

dist:
	$(RM) $(ZIPFILE)
	$(ZIP) $(ZIPFILE) $(DISTFILES)

# Pull in the GP32 backend build.rules here.
build.rules: backends/gp32/build.rules
	$(CP) backends/gp32/build.rules build.rules

# Special target to create a application wrapper for Mac OS X
bundle_name = ScummVM.app
bundle: scummvm-static
	mkdir -p $(bundle_name)/Contents/MacOS
	mkdir -p $(bundle_name)/Contents/Resources
	echo "APPL????" > $(bundle_name)/Contents/PkgInfo
	cp Info.plist $(bundle_name)/Contents/
	cp scummvm.icns $(bundle_name)/Contents/Resources/
	cp scummvm-static $(bundle_name)/Contents/MacOS/scummvm
	strip $(bundle_name)/Contents/MacOS/scummvm

install: $(FXE)
		$(EXECUTE_TOOL) $(BIN)	

# Special target to create a static linked binary for Mac OS X
scummvm-static: $(OBJS)
	$(CXX) $(LDFLAGS) -o scummvm-static $(OBJS) \
		/sw/lib/libSDLmain.a /sw/lib/libSDL.a \
		/sw/lib/libmad.a \
		/sw/lib/libvorbisfile.a /sw/lib/libvorbis.a /sw/lib/libogg.a \
		-framework Cocoa -framework Carbon -framework IOKit \
		-framework OpenGL -framework AGL -framework QuickTime \
		-framework AudioUnit -framework AudioToolbox

.PHONY: deb bundle

--- NEW FILE: README.GP32 ---
ScummVM port for GamePark 32
============================

Compiling instructions:
 1. download and install Fenix's devkit advance (see Windows.txt)
 2. get chn's gp32 devkit and install it (see readme-gp32.txt)
 3. In Makefile change the line: build.rules: to
      $(CP) backends/gp32/build.rules build.rules 
 4. run make

 * In case you have installed devkitadv to a different directory
 than it's default, you'll have to modify build.rules in backend/gp32/

How to run:
 - upload scummvm.fxe in gp:\gpmm
 - upload all game data files in gp:\

Controls:
 A:	left click
 B:	right click
 L:	debug console
 R:	game screen
 Start: menu
 Select:skip
 L+R:	save 

For the latest source release visit the official ScummVM page:
  http://www.scummvm.org/

You can get the precompiled gp32 executable (fxe) from my site:
  http://people.inf.elte.hu/ph0x


Thanks to the following people for their help:
 Endy, khalek and the rest ScummVM team members,
 Jeff, DarkFader, Inopia, groepaz, chn, FireFly, #gp32dev

	ph0x (ph0x at freemail.hu)  
--- NEW FILE: cpuspeed.s ---

	.ALIGN
	.ARM

	.GLOBAL		cpu_speed
	.GLOBAL		mmu_change

cpu_speed:
	stmdb	r13!, {r0-r12,lr}
	stmdb	sp!, {r0, r1, r2}
	mov		r0, sp
	swi		#0x0d
	add		sp, sp, #12
	ldmia	r13!, {r0-r12,lr}
	bx		lr
	nop

mmu_change:
        stmdb   r13!, {r0-r12,lr}
        swi             #0x02
        ldmia   r13!, {r0-r12,lr}
        bx              lr
        nop

--- NEW FILE: debug-gdbstub-usb.cpp ---
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2001  Ludvig Strigeus
 * Copyright (C) 2001/2004 The ScummVM project
 * Copyright (C) 2002 Ph0x - GP32 Backend
 * Copyright (C) 2003/2004 DJWillis - GP32 Backend
 *
 * 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 2
 * of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
[...1916 lines suppressed...]

///////////////////////////////////////////////////////////////
// 
// bl; // Branch with link(optional)
unsigned int DecodeBL(bl Instr, unsigned int uiPC)
{
	//Printf("Decode BL");
	unsigned int uiAddress;

	uiAddress = Instr.offset;
	if (uiAddress & 0x00800000) {
		uiAddress |= 0xff000000;
	}

	uiAddress <<= 2;
	uiAddress += 8;

	return uiPC + uiAddress;

}

--- NEW FILE: gfx_splash.h ---
/////////////////////////////////////////
//
// Header file for GP32
//
// convertion of gfx_splash.bmp file :
// Width     = 320
// Heigth    = 240
// GP32 Mode = 8 Bits per Pixel
//
// with GP32Converter coded by Edorul :
//    http://www.ifrance.com/edorul/
//    edorul at free.fr
//
/////////////////////////////////////////

#define gfx_splash_width      320
#define gfx_splash_height     240

#define gfx_splash_palnb      256
[...4806 lines suppressed...]
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 
      0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD
      
};

--- NEW FILE: graphics.h ---
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2001  Ludvig Strigeus
 * Copyright (C) 2001/2004 The ScummVM project
 * Copyright (C) 2002 Ph0x - GP32 Backend
 * Copyright (C) 2003/2004 DJWillis - GP32 Backend
 *
 * 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 2
 * of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
 *
 * $Header: /cvsroot/scummvm/scummvm/backends/gp32/graphics.h,v 1.1 2005/03/09 22:21:56 sev Exp $
 *
 */

//////////////////////////////////////////////////////////////////////////////
//
// GP32 Graphics structure header
//
//////////////////////////////////////////////////////////////////////////////

#ifndef GRAPHICS_H
#define GRAPHICS_H

#define Sint16 s16
#define Uint16 u16
#define Uint32 u32
#define Uint8 u8

typedef struct {
	Sint16 x, y;
	Uint16 w, h;
} gpRect;

typedef struct {
	Uint8 r;
	Uint8 g;
	Uint8 b;
	Uint8 unused;
} gpColor;

typedef struct {
	int       ncolors;
	gpColor *colors;
} gpPalette;

/* Everything in the pixel format structure is read-only */
typedef struct gpPixelFormat {
	gpPalette *palette;
	Uint8  BitsPerPixel;
	Uint8  BytesPerPixel;
	Uint8  Rloss;
	Uint8  Gloss;
	Uint8  Bloss;
	Uint8  Aloss;
	Uint8  Rshift;
	Uint8  Gshift;
	Uint8  Bshift;
	Uint8  Ashift;
	Uint32 Rmask;
	Uint32 Gmask;
	Uint32 Bmask;
	Uint32 Amask;

	/* RGB color key information */
	Uint32 colorkey;
	/* Alpha value information (per-surface alpha) */
	Uint8  alpha;
} gpPixelFormat;

typedef struct gpSurface {
	Uint32 flags;				/* Read-only */
	gpPixelFormat *format;		/* Read-only */
	int w, h;				/* Read-only */
	Uint16 pitch;				/* Read-only */
	void *pixels;				/* Read-write */
	int offset;				/* Private */

	/* Hardware-specific surface info */
	struct private_hwdata *hwdata;

	/* clipping information */
	gpRect clip_rect;			/* Read-only */
	Uint32 unused1;				/* for binary compatibility */

	/* Allow recursive locks */
	Uint32 locked;				/* Private */

	/* info for fast blit mapping to other surfaces */
	//	struct gpBlitMap *map;		/* Private */

	/* format version, bumped at every change to invalidate blit maps */
	unsigned int format_version;		/* Private */

	/* Reference count -- used when freeing surface */
	int refcount;				/* Read-mostly */
} gpSurface;

#define gpSWSurface		0x00000000
#define gpHWSurface		0x00000001
#define gpFullScreen	0x80000000

#endif /* GRAPHICS_H */

--- NEW FILE: setup.h ---
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2001  Ludvig Strigeus
 * Copyright (C) 2001/2004 The ScummVM project
 * Copyright (C) 2002 Ph0x - GP32 Backend
 * Copyright (C) 2003/2004 DJWillis - GP32 Backend
 *
 * 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 2
 * of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
 *
 * $Header: /cvsroot/scummvm/scummvm/backends/gp32/setup.h,v 1.1 2005/03/09 22:21:57 sev Exp $
 *
 */

#ifndef SETUP_H
#define SETUP_H

#ifndef NULL 
	#define NULL 0 
#endif

/////////////////////////////////////////////////////////////////////////////
//
// ScummVM/GP32 - Configuration front-end launcher and splash-screen stuff.
//				  Also contains GP32 start-up code.
//                Not part of ScummVM backend as such.
//
/////////////////////////////////////////////////////////////////////////////

#define MENU_MUSICDRV	0
#define MENU_SCREENPOS	1
#define MENU_CPUSPEED	2

// OLD CONFIG
// NULL marks end (FIXME)
typedef struct {
	const char *option;
	const char **submenu;
	int index;
} tmenu;

const char *sautorun[] = {
"NOT IMPLEMENTED",
/*
"Off",
"On",
*/
//NULL
};

const char *ssounddrv[] = {
"-eadlib",
"-enull",
NULL
};

const char *sscreenpos[] = {
"Top",
"Center",
NULL
};

const char *scpuspeed[] = {
"66",
"100",
"120",
"132",
"156",
"166",
"180",
"200",
NULL
};

const char *sbrightness[] = {
"Normal",
"Lighter",
"Lightest",
"Darker",
"Darkest",
NULL
};

tmenu menu[] = {
{"Music Driver", ssounddrv, 0},
{"Screen Position", sscreenpos, 1},
{"CPU Speed (MHz)", scpuspeed, 3},
};

#else
	#warning GP32 LAUNCHER.H Called more then once.
#endif /* SETUP_H */

--- NEW FILE: startup.c ---
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2001  Ludvig Strigeus
 * Copyright (C) 2001/2004 The ScummVM project
 * Copyright (C) 2002 Ph0x - GP32 Backend
 * Copyright (C) 2003/2004 DJWillis - GP32 Backend
 *
 * 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 2
 * of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
 *
 * $Header: /cvsroot/scummvm/scummvm/backends/gp32/startup.c,v 1.1 2005/03/09 22:21:57 sev Exp $
 *
 */

#include <gpdef.h>
#include <gpstdlib.h>
#include <gpfont.h>
#include <gpfont_port.h>
#include <gpfontres.dat>

#include <initval_port.h>

#ifdef USE_GP_MEM
	#include <gpmem.h>
#endif

//#ifdef GP32_GDB
//	#include <gdb-stub.h>
//#endif /*GP32_GDB*/

unsigned int HEAPSTART;
unsigned int HEAPEND;

void InitializeFont (void);
extern void GpKeyPollingTimeSet (int loop_cnt);
extern void GpMain(void *arg);

//extern int OpenUSB ();
//extern void InstallISR ();



int main (int arg_len, char * arg_v)
   {
	GM_HEAP_DEF gm_heap_def;

	_gp_sdk_init();

	// keyboard polling count setting
	GpKeyPollingTimeSet (KEYPOLLING_NUM);

	#ifdef USE_GP_MEM
		gm_heap_def.heapstart = (void*)(HEAPSTART);
		gm_heap_def.heapend = (void *)(HEAPEND & ~3);
		gm_heap_init (&gm_heap_def);

		gp_mem_func.malloc = gm_malloc;
		gp_mem_func.zimalloc = gm_zi_malloc;
		gp_mem_func.calloc = gm_calloc;
		gp_mem_func.free = gm_free;
		gp_mem_func.availablemem = gm_availablesize;
		gp_mem_func.malloc_ex = gm_malloc_ex;
		gp_mem_func.free_ex = gm_free_ex;
		gp_mem_func.make_mem_partition = gm_make_mem_part;

		gp_str_func.memset = gm_memset;
		gp_str_func.memcpy = gm_memcpy;
		gp_str_func.strcpy = gm_strcpy;
		gp_str_func.strncpy = gm_strncpy;
		gp_str_func.strcat = gm_strcat;
		gp_str_func.strncat = gm_strncat;
		gp_str_func.gpstrlen = gm_lstrlen;
		gp_str_func.sprintf = gm_sprintf;
		gp_str_func.uppercase = gm_uppercase;
		gp_str_func.lowercase = gm_lowercase;
		gp_str_func.compare = gm_compare;
		gp_str_func.trim_right = gm_trim_right;
	#endif /*USE_GP_MEM*/

	//Font initialize
	InitializeFont ();

	GpKernelInitialize ();

	GpKernelStart ();

   GpAppExit ();
   while (1) {};
   }

void InitializeFont (void)
   {
   BGFONTINFO mInfo;
   mInfo.kor_w = KORFONT_W;
   mInfo.kor_h = KORFONT_H;
   mInfo.eng_w = ENGFONT_W;
   mInfo.eng_h = ENGFONT_H;
   mInfo.chargap = FONT_CHARGAP;
   mInfo.linegap = FONT_LINEGAP;
   GpFontInit (&mInfo);
   GpFontResSet ((unsigned char*)fontresKor, (unsigned char*)fontresEng);
   }

int GpPredefinedStackGet (H_THREAD th)
   {
   switch (th)
      {
      case H_THREAD_GPMAIN:
         return GPMAIN_STACK_SIZE;
      case H_THREAD_NET:
         return NET_STACK_SIZE;
      case H_THREAD_TMR0:
      case H_THREAD_TMR1:
      case H_THREAD_TMR2:
      case H_THREAD_TMR3:
         return USER_STACK_SIZE;
      default:
         return 0;
      }
   }

--- NEW FILE: startup.h ---
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2001  Ludvig Strigeus
 * Copyright (C) 2001/2004 The ScummVM project
 * Copyright (C) 2002 Ph0x - GP32 Backend
 * Copyright (C) 2003/2004 DJWillis - GP32 Backend
 *
 * 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 2
 * of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
 *
 * $Header: /cvsroot/scummvm/scummvm/backends/gp32/startup.h,v 1.1 2005/03/09 22:21:57 sev Exp $
 *
 */

#ifndef STARTUP_H
#define STARTUP_H

/////////////////////////////////////////////////////////////////////////////
//
// ScummVM/GP32 - GP32 start-up header.
//                Not part of ScummVM backend as such.
//
/////////////////////////////////////////////////////////////////////////////

//	GP32 SDK Includes.
#include <gpdef.h>
#include <gpstdlib.h>
#include <gpfont.h>
#include <gpfont_port.h>
#include <gpfontres.dat>
#include <initval_port.h>

//	GP32 System startup.

unsigned int HEAPSTART;
unsigned int HEAPEND;
void InitializeFont (void);

#endif /* STARTUP_H */

Index: build.rules
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/gp32/build.rules,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- build.rules	10 Apr 2003 13:39:37 -0000	1.5
+++ build.rules	9 Mar 2005 22:21:54 -0000	1.6
@@ -1,35 +1,131 @@
-# Makefile for GP32 development using devkitadv under Win32

-# Written 2002 by Christian Nowak <chnowak at web.de>

-# Modified by ph0x (ph0x at freemail.hu)

-

-# devkitadv base dir

-CCBASE=c:/devkitadv

-

-CXX     =	$(CCBASE)/bin/g++

-CXXFLAGS=	-mcpu=arm9tdmi \

-		-mtune=arm9tdmi \

-		-mapcs \

-		-O2 \

-		-fomit-frame-pointer \

-		-finline-functions \

-		-fno-exceptions \

-		-fno-common \

-		-fno-builtin \

-		-fshort-enums \

-		-ffast-math \

-		-fshort-double \

-		-fallow-single-precision \

-		-ffreestanding \

-		-fexpensive-optimizations \

-		-mstructure-size-boundary=32 \

-		-mno-thumb-interwork \

-		-I$(CCBASE)/arm-agb-elf/include/gp32 \

-		-Wno-multichar

-

-DEFINES = -D__GP32__ -DNONSTANDARD_PORT

-LNKSCRIPT =$(CCBASE)/arm-agb-elf/lib/lnkscript

-LDFLAGS = -Wl,-T $(LNKSCRIPT)

-LIBS	+= -lgpgraphic -lgpmem -lgpos -lgpstdlib -lgpstdio -lgpsound -lgpfont

-INCLUDES += -Ibackends/gp32

-MODULES	+= backends/gp32

-OBJS	+= $(CCBASE)/arm-agb-elf/lib/gpstart/gpstart.o backends/gp32/gp32.o backends/gp32/gp-fs.o

+# ScummVM - Scumm Interpreter
+# Copyright (C) 2001  Ludvig Strigeus
+# Copyright (C) 2001/2004 The ScummVM project
+# Copyright (C) 2002 ph0x - GP32 port
+# Copyright (C) 2003-4 DJWillis - GP32 port
+#
+# 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 2
+# of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# Module Details	-	ScummVM for the GP32
+#						Build.Rules for GP32 Backend.
+#
+# Port Maintainer	-	DJWillis <gp32 at distant-earth.co.uk>
+
+# GPSDK (SDK, Includes and Startup Files) base dir
+GPSDK			=	/usr/compat/gp32/share/sdk
+
+# Outputs
+EXEEXT			=	.elf
+MAPFILE			=	scummvm.map
+BIN			=	scummvm.gxb
+FXE			=	scummvm.fxe
+
+# Stripped Build? (Smaller ELF, Minimal debug symbol information).
+# You MUST comment this out with a # if you wish to debug your code.
+# STRIP_DEBUG		=	-Wl,--strip-debug
+
+# Plugins hack
+srcdir			=	./
+
+# GP32 Direct Execute Tool (i.e. pclink -e on Windows, gplink run on Linux)
+EXECUTE_TOOL	=	pclink -e
+
+# GCC Tool-chain
+CC			=	arm-elf-gcc
+CXX			=	arm-elf-g++
+LD			=	arm-elf-g++
+AS			=	arm-elf-as
+OBJCOPY			=	arm-elf-objcopy
+FXETOOL			=	b2fxec
+
+CFLAGS  		=	-marm \
+				-march=armv4t \
+	       			-mapcs \
+	       			-finline-functions \
+	       			-fshort-enums \
+	       			-ffast-math \
+	       			-fshort-double \
+	       			-mstructure-size-boundary=32 \
+	       			-mno-thumb-interwork \
+				-I$(GPSDK)/include \
+				-g \
+				#-Wno-multichar \
+	       			#-O3 \
+	       			#-fomit-frame-pointer			
+					
+				# Remove the below from the above flags for Debug.
+	       			#-O3 \
+	       			#-fomit-frame-pointer
+
+CPPFLAGS		=	$(CFLAGS)
+
+DEFINES 		= 	-D__GP32__
+DEFINES			+=	-DNONSTANDARD_PORT
+
+# Support Vorbis Tremor Patches.
+#DEFINES		+=	-DVORBIS_TREMOR
+
+# Support LIBMAD Patches.
+#DEFINES		+=	-DGP32_MADMP3
+
+# Support for 8:3 save files names (The GP32 uses FAT12/16 (no vFAT) for the file system).
+DEFINES			+=	-DSHORT_SAVENAMES
+
+# Support for the unsigned sound mixer.
+DEFINES			+=	-DOUTPUT_UNSIGNED_AUDIO
+
+# Support for the GP32 (fmOPL derived) MIDI engine.
+#	-	NOT fully implemented yet.
+DEFINES			+=	-DUSE_GP32_FMOPL
+
+LDSPECS			=	-specs=gp32_gpsdk.specs
+
+LDFLAGS 		= 	$(STRIP_DEBUG) \
+					-Wl,-Map,$(MAPFILE) \
+					$(LDSPECS) -Wl,--no-warn-mismatch
+				
+LIBS			+=	-L$(GPSDK)/lib \
+					-lgpmem -lgpos -lgpstdio -lgpstdlib -lgpsound -lgpgraphic  -lgpgraphic16 -lgpfont -lgpfont16 \
+					-lm -lc -lgcc
+
+INCLUDES 		+=	-Ibackends/gp32 -I$(GPSDK)/include
+
+MODULES			+=	backends/gp32
+
+#GP32 Debug - Remove from Release builds
+#	This builds in the GP32 GDB USB Stub. Don't use it unless you know what your doing.
+#	You also need to remove ANY optemisation from the compiler flags.
+DEFINES			+=	-DGP32_GDB
+OBJS			+=	backends/gp32/debug-gdbstub-usb.o
+
+#GamePark SDK startup.
+OBJS			+=	backends/gp32/startup.o
+
+#Main ScummVM for the GP32 Backend
+OBJS			+=	backends/gp32/gp32.o \
+				backends/gp32/gp-fs.o \
+				backends/gp32/cpuspeed.o \
+					
+				#backends/gp32/dmaaudio_asm.o \
+				#backends/gp32/dmaaudio.o \
+
+#install: all
+					#$(EXECUTE_TOOL) $(BIN)
+
+$(FXE): $(BIN)
+					$(FXETOOL) -f -a "DJWillis/ScummVM Team" -t "ScummVM for the GP32" -b scummvm.bmp $< $@
+	
+$(BIN): scummvm$(EXEEXT)
+					$(OBJCOPY) -O binary $< $@

Index: gp-fs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/gp32/gp-fs.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gp-fs.cpp	1 Jan 2005 16:08:47 -0000	1.4
+++ gp-fs.cpp	9 Mar 2005 22:21:55 -0000	1.5
@@ -1,152 +1,184 @@
-/* ScummVM - Scumm Interpreter

- * Copyright (C) 2001-2005 The ScummVM project

- *

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

- * of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

- *

- * $Header$

- */

-

-#if defined (__GP32__)

-

-#include "../fs/fs.h"

-#include "stdio.h"

-

-extern "C" {

-	#include "gpstdio.h"

-}

-

-/*

- * Implementation of the ScummVM file system API based on GP32.

- */

-

-class GP32FilesystemNode : public FilesystemNode {

-protected:

-	String _displayName;

-	bool _isDirectory;

-	bool _isValid;

-	String _path;

-	

-public:

-	GP32FilesystemNode();

-	GP32FilesystemNode(const String &path);

-	GP32FilesystemNode(const GP32FilesystemNode *node);

-

-	virtual String displayName() const { return _displayName; }

-	virtual bool isValid() const { return _isValid; }

-	virtual bool isDirectory() const { return _isDirectory; }

-	virtual String path() const { return _path; }

-

-	virtual FSList *listDir(ListMode mode = kListDirectoriesOnly) const;

-	virtual FilesystemNode *parent() const;

-	virtual FilesystemNode *clone() const { return new GP32FilesystemNode(this); }

-};

-

-

-FilesystemNode *FilesystemNode::getRoot() {

-	return new GP32FilesystemNode();

-}

-

-GP32FilesystemNode::GP32FilesystemNode() {

-	_displayName = "gp:\\";

-	_isValid = true;

-	_isDirectory = true;

-	_path = "gp:\\";

-}

-

-/*

-GP32FilesystemNode::GP32FilesystemNode(const String &p) {

-	// TODO - extract last component from path

-	_displayName = p;

-	// TODO - check whether it is a directory, and whether the file actually exists

-	_isValid = true;

-	_isDirectory = true;

-	_path = p;

-}

-*/

-

-GP32FilesystemNode::GP32FilesystemNode(const GP32FilesystemNode *node) {

-	_displayName = node->_displayName;

-	_isValid = node->_isValid;

-	_isDirectory = node->_isDirectory;

-	_path = node->_path;

-}

-

-FSList *GP32FilesystemNode::listDir(ListMode mode) const {

-	assert(_isDirectory);

-

-	GPDIRENTRY dp;

-	ulong read;

-

-	FSList *myList = new FSList();

-	

-	int start=0; // current file

-

-	// ... loop over dir entries using readdir

-	while (GpDirEnumList(_path.c_str(), start++, 1, &dp, &read)  == SM_OK) { 

-		if (strcmp(dp.name,".")==0|| strcmp(dp.name,"..")==0) continue;

-		GP32FilesystemNode entry;

-		entry._displayName = dp.name;

-		entry._path = _path;

-		entry._path += dp.name;

-		

-		GPFILEATTR attr;

-		char s[256];

-		sprintf(s, "%s%s", _path.c_str(), dp.name);

-		GpFileAttr(s, &attr);

-		entry._isDirectory = attr.attr & (1<<4);

-

-		// Honor the chosen mode

-		if ((mode == kListFilesOnly && entry._isDirectory) ||

-			(mode == kListDirectoriesOnly && !entry._isDirectory))

-			continue;

-

-		if (entry._isDirectory)

-			entry._path += "\\"; //ph0x

-		myList->push_back(entry);

-	}	

-	return myList;

-}

-

-const char *lastPathComponent(const Common::String &str) {

-	const char *start = str.c_str();

-	const char *cur = start + str.size() - 2;

-	

-	while (cur > start && *cur != '\\') { //ph0x

-		--cur;

-	}

-	

-	return cur+1;

-}

-

-FilesystemNode *GP32FilesystemNode::parent() const {

-	

-	GP32FilesystemNode *p = new GP32FilesystemNode();

-

-	// Root node is its own parent. Still we can't just return this

-	// as the GUI code will call delete on the old node.

-	if (_path != "gp:\\") {  //ph0x

-		const char *start = _path.c_str();

-		const char *end = lastPathComponent(_path);

-

-		p->_path = String(start, end - start);

-		p->_isValid = true;

-		p->_isDirectory = true;

-		p->_displayName = lastPathComponent(p->_path);

-	}

-	return p;

-}

-

-#endif // defined(__GP32__)

-

+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001  Ludvig Strigeus
+ * Copyright (C) 2001/2004 The ScummVM project
+ * Copyright (C) 2002 Ph0x - GP32 Backend
+ * Copyright (C) 2003/2004 DJWillis - GP32 Backend
+ *
+ * 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 2
+ * of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
+ *
+ * $Header$
+ *
+ */
+
+#if defined (__GP32__)
+
+#include "stdafx.h"
+
+#include "backends/gp32/gp32.h"
+#include "backends/fs/fs.h"
+#include <stdio.h>
+#include <gpstdio.h>
+
+/*
+ * Implementation of the ScummVM file system API based on GP32 SMC File Access.
+ */
+
+class GP32FilesystemNode : public FilesystemNode {
+protected:
+	Common::String _displayName;
+	bool _isDirectory;
+	bool _isValid;
+	Common::String _path;
+	
+public:
+	GP32FilesystemNode();
+	GP32FilesystemNode(const Common::String &path);
+	GP32FilesystemNode(const GP32FilesystemNode *node);
+
+	virtual Common::String displayName() const { return _displayName; }
+	virtual bool isValid() const { return _isValid; }
+	virtual bool isDirectory() const { return _isDirectory; }
+	virtual Common::String path() const { return _path; }
+
+	virtual FSList listDir(ListMode mode = kListDirectoriesOnly) const;
+	virtual FilesystemNode *parent() const;
+	virtual FilesystemNode *clone() const { return new GP32FilesystemNode(this); }
+};
+
+
+AbstractFilesystemNode *FilesystemNode::getRoot() {
+	return new GP32FilesystemNode();
+}
+
+GP32FilesystemNode::GP32FilesystemNode() {
+	_displayName = "gp:\\SCUMMVM\\GAMES\\";
+	_isValid = true;
+	_isDirectory = true;
+	_path = "gp:\\scummvm\\games\\";
+}
+
+/*
+GP32FilesystemNode::GP32FilesystemNode() {
+	_displayName = "gp:\\";
+	_isValid = true;
+	_isDirectory = true;
+	_path = "gp:\\";
+}
+*/
+
+GP32FilesystemNode::GP32FilesystemNode(const Common::String &p) {
+	// TODO - extract last component from path
+	_displayName = p;
+	// TODO - check whether it is a directory, and whether the file actually exists
+	_isValid = true;
+	_isDirectory = true;
+	_path = p;
+}
+
+GP32FilesystemNode::GP32FilesystemNode(const GP32FilesystemNode *node) {
+	_displayName = node->_displayName;
+	_isValid = node->_isValid;
+	_isDirectory = node->_isDirectory;
+	_path = node->_path;
+}
+
+AbstractFilesystemNode *FilesystemNode::getNodeForPath(const String &path) {
+	return new GP32FilesystemNode(path);
+}
+
+FSList GP32FilesystemNode::listDir(ListMode mode) const {
+	assert(_isDirectory);
+
+	GPDIRENTRY dp;
+	ulong read;
+
+	FSList myList;
+	
+	int start=0; // current file
+
+	// ... loop over dir entries using readdir
+	while (GpDirEnumList(_path.c_str(), start++, 1, &dp, &read)  == SM_OK) { 
+		if (strcmp(dp.name,".")==0|| strcmp(dp.name,"..")==0) continue;
+		GP32FilesystemNode entry;
+		entry._displayName = dp.name;
+		entry._path = _path;
+		entry._path += dp.name;
+		
+		GPFILEATTR attr;
+		char s[256];
+		sprintf(s, "%s%s", _path.c_str(), dp.name);
+		GpFileAttr(s, &attr);
+		entry._isDirectory = attr.attr & (1<<4);
+
+		// Honor the chosen mode
+		if ((mode == kListFilesOnly && entry._isDirectory) ||
+			(mode == kListDirectoriesOnly && !entry._isDirectory))
+			continue;
+
+		if (entry._isDirectory)
+			entry._path += "\\"; //ph0x
+		myList.push_back(entry);
+	}	
+	return myList;
+}
+
+const char *lastPathComponent(const Common::String &str) {
+	const char *start = str.c_str();
+	const char *cur = start + str.size() - 2;
+	
+	while (cur > start && *cur != '\\') { //ph0x
+		--cur;
+	}
+	
+	return cur+1;
+}
+
+FilesystemNode *GP32FilesystemNode::parent() const {
+	
+	GP32FilesystemNode *p = new GP32FilesystemNode();
+
+// OLD - REMOVE ON CLEAN COMPILE
+//	// Root node is its own parent. Still we can't just return this
+//	// as the GUI code will call delete on the old node.
+//	if (_path != "gp:\\") {  //ph0x
+//		const char *start = _path.c_str();
+//		const char *end = lastPathComponent(_path);
+//
+//		p->_path = String(start, end - start);
+//		p->_isValid = true;
+//		p->_isDirectory = true;
+//		p->_displayName = lastPathComponent(p->_path);
+//	}
+//	return p;
+//}
+
+	// Root node is its own parent. Still we can't just return this
+	// as the GUI code will call delete on the old node.
+	if (_path != "gp:\\") {
+		const char *start = _path.c_str();
+		const char *end = lastPathComponent(_path);
+
+		p->_path = Common::String(start, end - start);
+		p->_displayName = lastPathComponent(p->_path);
+	} else {
+		p->_path = _path;
+		p->_displayName = _displayName;
+	}
+	p->_isValid = true;
+	p->_isDirectory = true;
+	return p;
+}
+
+#endif /* defined(__GP32__) */

Index: gp32.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/gp32/gp32.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- gp32.cpp	5 Dec 2004 17:42:15 -0000	1.23
+++ gp32.cpp	9 Mar 2005 22:21:55 -0000	1.24
@@ -1,1534 +1,3221 @@
-/* ScummVM - Scumm Interpreter

- * Copyright (C) 2001  Ludvig Strigeus

- * Copyright (C) 2001/2002 The ScummVM project

- * Copyright (C) 2002 ph0x (GP32 port)

- *

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

- * of the License, or (at your option) any later version.

-

- * This program is distributed in the hope that it will be useful,

[...4724 lines suppressed...]
+	//int argc = 4; char *argv[] = { "scummvm", "-enull", "-pgp:\\gpmm\\scummvm\\sky\\", "sky" };
+	int argc = 4;
+	char *argv[] = { "scummvm", "-enull", "", "" };
+
+	while (1) {
+		// Only set the CPU speed if the GDB Stub is NOT needed.
+		// No point calling ClearScreen(); as we want to see any odd stuff.
+#ifndef GP32_GDB
+		gpCPUSpeed(CPUSpeed);
+		ClearScreen();
+#endif				/*GP32_GDB */
+
+		//FadeToWhite(200);
+		//exit(scummvm_main(argc, argv));
+		////////////////cast_argv = f(const_cast<double&>(d));
+		//////////////char* argv_;
+		//////////////  argv_ = const_cast<*char*>(argv);
+		scummvm_main(argc, argv);
+	}
+}

Index: gp32.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/gp32/gp32.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- gp32.h	28 Sep 2004 20:19:22 -0000	1.23
+++ gp32.h	9 Mar 2005 22:21:56 -0000	1.24
@@ -1,218 +1,316 @@
-/* ScummVM - Scumm Interpreter

- * Copyright (C) 2001  Ludvig Strigeus

- * Copyright (C) 2001/2002 The ScummVM project

- * Copyright (C) 2002 ph0x (GP32 port)

- *

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

- * of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 

- */

-

-

-#include "backends/intern.h"

-#include "common/stdafx.h"

-#include "common/scummsys.h"

-#include "common/system.h"

-#include "common/scummsys.h"

-#include "common/stdafx.h"

-#include "base/engine.h"

-#include "scumm/saveload.h"

-#include "common/scaler.h"

-

-#include "portdefs.h"

-#include "sdl.h"

-

-class OSystem_GP32 : public OSystem {

-public:

-	// Set colors of the palette

-	void setPalette(const byte *colors, uint start, uint num);

-

-	// Set the size of the video bitmap.

-	// Typically, 320x200

-	void initSize(uint w, uint h);

-	int16 getHeight() { return _screenHeight; }

-	int16 getWidth() { return _screenWidth; }

-	

-	// Draw a bitmap to screen.

-	// The screen will not be updated to reflect the new bitmap

-	void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);

-

-	// Update the dirty areas of the screen

-	void updateScreen();

-

-	// Either show or hide the mouse cursor

-	bool showMouse(bool visible);

-	void warpMouse(int x, int y);

-	

-	// Set the position of the mouse cursor

-	void set_mouse_pos(int x, int y);

-	

-	// Set the bitmap that's used when drawing the cursor.

-	void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor);

-	

-	// Shaking is used in SCUMM. Set current shake position.

-	void setShakePos(int shake_pos);

-		

-	// Get the number of milliseconds since the program was started.

-	uint32 getMillis();

-	

-	// Delay for a specified amount of milliseconds

-	void delayMillis(uint msecs);

-	

-	// Get the next event.

-	// Returns true if an event was retrieved.	

-	bool pollEvent(Event &event);

-

-	// Set the function to be invoked whenever samples need to be generated

-	// Format is the sample type format.

-	// Only 16-bit signed mode is needed for simon & scumm

-	bool setSoundCallback(SoundProc proc, void *param);

-	void clearSoundCallback();

-	

-	// Get or set a property

-	uint32 property(int param, Property *value);

-		

-	// Poll cdrom status

-	// Returns true if cd audio is playing

-	bool pollCD();

-

-	// Play cdrom audio track

-	void playCD(int track, int num_loops, int start_frame, int duration);

-

-	// Stop cdrom audio track

-	void stopCD();

-

-	// Update cdrom audio status

-	void updateCD();

-

-	// Add a new callback timer

-	void setTimerCallback(TimerProc callback, int timer);

-

-	// Mutex handling

-	OSystem::MutexRef createMutex();

-	void lockMutex(MutexRef mutex);

-	void unlockMutex(MutexRef mutex);

-	void deleteMutex(MutexRef mutex);

-

-	// Quit

-	void quit();

-	

-	// Overlay

-	void showOverlay();

-	void hideOverlay();

-	void clearOverlay();

-	void grabOverlay(int16 *buf, int pitch);

-	void copyRectToOverlay(const int16 *buf, int pitch, int x, int y, int w, int h);

-

-	static OSystem *create(int gfx_mode, bool full_screen);

-

-private:

-	SDL_Surface *sdl_tmpscreen;   // temporary screen (for scalers/overlay)

-	SDL_Surface *sdl_hwscreen;    // hardware screen

-	bool _overlay_visible;

-

-	ScalerProc *_scaler_proc;

-

-	int TMP_SCREEN_WIDTH;

-

-	//uint msec_start;

-	//uint32 get_ticks();

-

-	///OSystem_GP32(); // eh?

-	/// ~OSystem_GP32();

-

-	// unseen game screen

-	SDL_Surface *_screen;

-	int _screenWidth, _screenHeight;

-

-	// CD Audio

-	///SDL_CD *_cdrom;

-	int cd_track, cd_num_loops, cd_start_frame, cd_end_frame;

-	uint32 cd_end_time, cd_stop_time, cd_next_second;

-

-	enum {

-		DF_WANT_RECT_OPTIM			= 1 << 0,

-		DF_UPDATE_EXPAND_1_PIXEL	= 1 << 3

-	};

-

-	bool _forceFull; // Force full redraw on next updateScreen

-	int _scaleFactor;

-	int _mode;

-	bool _full_screen;

-	uint32 _mode_flags;

-

-	enum {

-		NUM_DIRTY_RECT = 100,

-

-		MAX_MOUSE_W = 40,

-		MAX_MOUSE_H = 40,

-		MAX_SCALING = 3

-	};

-

-	// Dirty rect managment

-	SDL_Rect _dirty_rect_list[100];

-	int _num_dirty_rects;

-	uint32 *_dirty_checksums;

-	bool cksum_valid;

-	int CKSUM_NUM;

-

-	// Keyboard mouse emulation

-	struct KbdMouse {	

-		int16 x, y, x_vel, y_vel, x_max, y_max, x_down_count, y_down_count;

-		uint32 last_time, delay_time, x_down_time, y_down_time;

-	} km;

-

-	struct MousePos {

-		int16 x, y, w, h;

-	};

-

-	bool _mouseVisible;

-	bool _mouseDrawn;

-	byte *_mouseData;

-	byte *_mouseBackup;

-	MousePos _mouse_cur_state;

-	MousePos _mouse_old_state;

-	int16 _mouseHotspotX;

-	int16 _mouseHotspotY;

+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001  Ludvig Strigeus
+ * Copyright (C) 2001/2004 The ScummVM project
+ * Copyright (C) 2002 Ph0x - GP32 Backend
+ * Copyright (C) 2003/2004 DJWillis - GP32 Backend
+ *
+ * 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 2
+ * of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
+ *
+ * $Header$
+ *
+ */
+
+#ifndef GP32_H
+#define GP32_H
+
+/////////////////////////////////////////////////////////////////////////////
+// Header for GP32 ScummVM Backend
+/////////////////////////////////////////////////////////////////////////////
+
+//Standard ScummVM includes.
+#include "common/stdafx.h"
+#include "common/scummsys.h"
+#include "common/scaler.h"
+#include "common/system.h"
+#include "backends/intern.h"
+
+#include "base/engine.h"
+//#include "scumm/saveload.h"
+
+//Graphics wrapper - SDL Derived.
+#include "backends/gp32/graphics.h"
+
+//Pre-ScummVM Config stuff
+//#include "backends/gp32/config.h"
+
+#define LCD_WIDTH 				320
+#define LCD_HEIGHT 				240 
+#define LCD_WIDTH_CENTER 		LCD_WIDTH / 2
+#define LCD_HEIGHT_CENTER 		LCD_HEIGHT / 2
+#define LCD_SIZE				(LCD_WIDTH * LCD_HEIGHT)
+
+// Graphics Bits
+#define GAME_SURFACE		0
+#define GAME_SURFACE2		1
+#define DEBUG_SURFACE		2
+
+extern int nflip, keydata;	// Flip Index
+extern GP_HPALETTE PAL; //palette
+
+//void Delay(int ms);
+//void FadeToBlack(int delay_time);
+
+
+#define BUFFERCOUNT 2
+extern GPDRAWSURFACE LCDbuffer[BUFFERCOUNT + 1];  //buffers
+
+#define BACKGROUND_COLOR		0	//Black color
+#define COLOUR_8BIT_MODE		8
+#define COLOUR_16BIT_MODE		16
+
+/* Assembly routines from cpuspeed.s */
+extern "C" {void cpu_speed(int,int,int);}	// CPU Speed control (3 int's, clock, bus, dividor)
+
+/* Fake main() entry point */
+//int main_scummvm(int argc, char *argv[]);
+
+//Prototypes
+class OSystem_GP32 : public OSystem 
+{
+public:
+	OSystem_GP32();
+	virtual ~OSystem_GP32();
+	
+	// Set colors of the palette
+	void setPalette(const byte *colors, uint start, uint num);
+
+	// Set the size of the video bitmap.
+	// Typically, 320x200
+	void initSize(uint w, uint h);
+	int16 getHeight() { return _screenHeight; } 
+	int16 getWidth() { return _screenWidth; } 
+
+	// Draw a bitmap to screen.
+	// The screen will not be updated to reflect the new bitmap
+	void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
+
+	// Update the dirty areas of the screen
+	void updateScreen();
+
+	// Either show or hide the mouse cursor
+	bool showMouse(bool visible);
+	
+	void warpMouse(int x, int y);
+
+	// Set the bitmap that's used when drawing the cursor.
+	void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor = 255, int cursorTargetScale = 1);
+	
+	// Shaking is used in SCUMM. Set current shake position.
+	void setShakePos(int shake_pos);
+		
+	// Get the number of milliseconds since the program was started.
+	uint32 getMillis();
+	
+	// Delay for a specified amount of milliseconds
+	void delayMillis(uint msecs);
+
+	// Get the next event.
+	// Returns true if an event was retrieved.	
+	bool pollEvent(Event &event);
+
+	// Set the function to be invoked whenever samples need to be generated
+	// Format is the sample type format.
+	// Only 16-bit signed mode is needed for simon & scumm
+	bool setSoundCallback(SoundProc proc, void *param);
+
+	// Clear Sound Sample
+	void clearSoundCallback(); 
+	
+	// OLD - Delete when sure not needed.
+	// Get or set a property
+	//uint32 property(int param, Property *value);
+	//virtual uint32 property(int param, Property *value);
+		
+	// Poll cdrom status
+	// Returns true if cd audio is playing
+	bool pollCD();
+
+	// Play cdrom audio track
+	void playCD(int track, int num_loops, int start_frame, int duration);
+
+	// Stop cdrom audio track
+	void stopCD();
+
+	// Update cdrom audio status
+	void updateCD();
+
+	// Add a new callback timer
+	void setTimerCallback(TimerProc callback, int timer);
+
+	// Mutex handling	
+	OSystem::MutexRef createMutex();
+	void lockMutex(MutexRef mutex);
+	void unlockMutex(MutexRef mutex);
+	void deleteMutex(MutexRef mutex);
+	// DJWillis
+	
+	//helper
+	int16 get_height();
+	int16 get_width();
+	
+	// Quit
+	void quit();
+	
+	// Overlay
+	void showOverlay();
+	void hideOverlay();
+	void clearOverlay();
+	void grabOverlay(int16 *buf, int pitch);
+	void copyRectToOverlay(const int16 *buf, int pitch, int x, int y, int w, int h);
+
+	//static OSystem *create(int gfx_mode, bool full_screen);
+	
+	int16 RBGToColor(uint8 r, uint8 g, uint8 b);
+	void colorToRBG(int16 color, uint8 &r, uint8 &g, uint8 &b);
+
+	//void *gm_yocalloc(size_t num_elem, size_t size_elem);
+	//void *gm_realloc(void *ptr, size_t size);
+
+	// New 0.6.0 +
+	const GraphicsMode *getSupportedGraphicsModes() const;
+	int getDefaultGraphicsMode() const;
+	bool setGraphicsMode(int mode);
+	int getGraphicsMode() const;
+	
+	void setWindowCaption(const char *caption);
+	bool openCD(int drive);
+
+	// Determine the output sample rate. Audio data provided by the sound
+	// Callback sound be played using this rate.
+	// FIXME: GP32 Hardcodes rate currently.
+	int getOutputSampleRate() const;
+
+	bool hasFeature(Feature f);
+	void setFeatureState(Feature f, bool enable);
+	bool getFeatureState(Feature f);
+
+	//static OSystem *create();
+
+private:
+
+	// Set the position of the mouse cursor - Not part of OSystem anymore.
+	void set_mouse_pos(int x, int y);
+
+	gpSurface *_tmpscreen;   // temporary screen (for scalers/overlay)
+	gpSurface *_hwscreen;    // hardware screen
+	bool _overlayVisible;
+
+	ScalerProc *_scaler_proc;
+
+	int TMP_SCREEN_WIDTH;
+
+	//uint msec_start;
+	//uint32 get_ticks();
+
+	// unseen game screen
+	gpSurface *_screen;
+	int _screenWidth, _screenHeight;
+
+	// CD Audio, Not used in GP32 backend
+	int cd_track, cd_num_loops, cd_start_frame, cd_end_frame;
+	uint32 cd_end_time, cd_stop_time, cd_next_second;
+
+	enum {
+		DF_WANT_RECT_OPTIM			= 1 << 0,
+		DF_UPDATE_EXPAND_1_PIXEL	= 1 << 3
+	};
+
+	bool _forceFull; // Force full redraw on next updateScreen
+	int _scaleFactor;
+	int _mode;
+	bool _full_screen;
+	uint32 _mode_flags;
+	bool _modeChanged;
+
+	/** True if aspect ratio correction is enabled. */
+	bool _adjustAspectRatio;
+
+	enum {
+		NUM_DIRTY_RECT = 100,
+		MAX_MOUSE_W = 40,
+		MAX_MOUSE_H = 40,
+		MAX_SCALING = 3
+	};
+
+	// Dirty rect managment
+	gpRect _dirty_rect_list[100];
+	int _num_dirty_rects;
+	uint32 *_dirty_checksums;
+	bool cksum_valid;
+	int CKSUM_NUM;
+
+	// Keyboard mouse emulation
+	struct KbdMouse {	
+		int16 x, y, x_vel, y_vel, x_max, y_max, x_down_count, y_down_count;
+		uint32 last_time, delay_time, x_down_time, y_down_time;
+	} km;
+
+	struct MousePos {
+		int16 x, y, w, h;
+	};
+
+	bool _mouseVisible;
+	bool _mouseDrawn;
+	byte *_mouseData;
+	byte *_mouseBackup;
+	MousePos _mouseCurState;
+	MousePos _mouseOldState;
+	int16 _mouseHotspotX;
+	int16 _mouseHotspotY;
 	byte _mouseKeycolor;
-

-	// Shake mode

-	int _currentShakePos;

-	int _newShakePos;

-

-	// Palette data

-	SDL_Color *_currentPalette;

-	uint _paletteDirtyStart, _paletteDirtyEnd;

-

-

-	void add_dirty_rgn_auto(const byte *buf);

-	void mk_checksums(const byte *buf);

-

-	static void fill_sound(void *userdata, Uint8 * stream, int len);

-	

-	void add_dirty_rect(int x, int y, int w, int h);

-

-	void draw_mouse();

-	void undraw_mouse();

-

-	void load_gfx_mode();

-	void unload_gfx_mode();

-	void hotswap_gfx_mode();

-

-	void get_screen_image(byte *buf);	

-

-	void setup_icon();

-	void kbd_mouse();

-

-	static OSystem_GP32 *create();

-};

+
+	// Shake mode
+	int _currentShakePos;
+	int _newShakePos;
+
+	// Palette data
+	gpColor *_currentPalette;
+	uint _paletteDirtyStart, _paletteDirtyEnd;
+
+	/**
+	 * Mutex which prevents multiple threads from interfering with each other
+	 * when accessing the screen.
+	 */
+	MutexRef _graphicsMutex;
+	
+	void add_dirty_rgn_auto(const byte *buf);
+	void mk_checksums(const byte *buf);
+
+	static void fill_sound(void *userdata, Uint8 * stream, int len);
+	
+	void add_dirty_rect(int x, int y, int w, int h);
+
+	void draw_mouse();
+	void undraw_mouse();
+
+	void internUpdateScreen();
+
+	void load_gfx_mode();
+	void unload_gfx_mode();
+	void hotswap_gfx_mode();
+
+	void setFullscreenMode(bool enable);
+
+	void get_screen_image(byte *buf);	
+
+	void setup_icon();
+	void kbd_mouse();
+	//static OSystem_GP32 *create();
+};
+
+#else
+	#warning GP32.H Called more then once.
+#endif /* GP32_H */
+

Index: portdefs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/gp32/portdefs.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- portdefs.h	10 Apr 2003 13:39:38 -0000	1.4
+++ portdefs.h	9 Mar 2005 22:21:56 -0000	1.5
@@ -1,124 +1,173 @@
-/* ScummVM - Scumm Interpreter

- * Copyright (C) 2001  Ludvig Strigeus

- * Copyright (C) 2001/2002 The ScummVM project

- * Copyright (C) 2002 ph0x (GP32 port)

- *

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

- * of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 

- */

-

-

-//#define __size_t  // SDK hack?

-	#include <stdio.h>

-	#include <stdlib.h>

-	#include <string.h>

-	#include <stdarg.h>

-	#include <ctype.h>

-

-

-extern "C" {

-	#include "gpfont.h"

-	#include "gpfont_port.h"

-	#include "gpgraphic.h"

-	#include "gpmm.h"	

-	#include "gpmem.h"	

-	#include "gpos_def.h"

-	#include "gpstdio.h"

-	#include "gpstdlib.h"	

-	#include "gpdef.h"

-	//#include "defines.h"

-}

-

-#undef byte // SDK hack?

-

-typedef unsigned char u8;

-typedef signed char s8;

-typedef unsigned short u16;

-typedef short s16;

-typedef unsigned int u32;

-typedef int s32; 

-

-	extern int gpprintf(const char *fmt, ...);

-	#define printf gpprintf

-

-	extern void *gpmalloc(size_t size);

-	extern void *gpcalloc(size_t nitems, size_t size);

-	extern void gpfree(void *block);

-	extern char *gpstrdup(const char *s);

-

-	#define malloc gpmalloc 

-	#define calloc gpcalloc //gm_calloc

-	#define free gpfree	

-	/*#define memset gm_memset

-	#define memcopy gm_memcopy

-

-	#define strcpy gm_strcpy	// uncomment?

-	#define strncpy gm_strncpy

-	#define strcat gm_strcat

-	#define sprintf gm_sprintf*/

-	#define strdup gpstrdup

-

-	#define assert(e) ((e) ? 0 : (printf("!AS: " #e " (%s, %d)\n", __FILE__, __LINE__)))

-	#define ASSERT assert

-

-	#define ENDLESSLOOP while (1)

-

-	

-	#define FILE F_HANDLE

-	extern FILE *fstderr;

-	extern FILE *fstdout;

-	extern FILE *fstdin;

-

-	#define stderr fstderr

-	#define stdout fstdout

-	#define stdin fstdin

-

-	extern FILE *gpfopen(const char *filename, const char *mode);

-	extern int gpfclose(FILE *stream);

-	extern int gpfseek(FILE *stream, long offset, int whence);

-	extern  size_t gpfread(void *ptr, size_t size, size_t n, FILE *stream);

-	extern size_t gpfwrite(const void *ptr, size_t size, size_t n, FILE*stream);

-	extern long gpftell(FILE *stream);

-	extern void gpclearerr(FILE *stream);

-	extern int gpfeof(FILE *stream);

-	extern char *gpfgets(char *s, int n, FILE *stream);

-	extern int gpfflush(FILE *stream);

-

-	#define fopen gpfopen

-	#define fclose gpfclose

-	#define fseek gpfseek

-	#define fread gpfread

-	#define fwrite gpfwrite

-	#define ftell gpftell

-	#define clearerr gpclearerr

-	#define feof gpfeof

-	#define fgets gpfgets	

-	

-	extern int gpfprintf(FILE *stream, const char *fmt, ...);

-	#define fprintf gpfprintf

-	#define fflush gpfflush

-

-	extern void gpexit(int code);

-	#define exit gpexit

-	//#define error printf

-

-	extern time_t gptime(time_t *timer);

-	#define time gptime

-	#define MARK printf("MARK: %s, %s, %d", __FILE__, __FUNCTION__, __LINE__);

-	

-	extern void *gpmemset (void *s, int c, size_t n);

-	extern void *gpmemcpy (void *dest, const void *src, size_t n);

-	//#define memset gpmemset

-	//#define memcpy gpmemcpy

-

+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001  Ludvig Strigeus
+ * Copyright (C) 2001/2004 The ScummVM project
+ * Copyright (C) 2002 Ph0x - GP32 Backend
+ * Copyright (C) 2003/2004 DJWillis - GP32 Backend
+ *
+ * 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 2
+ * of the License, 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
+ *
+ * $Header$
+ *
+ */
+
+#ifndef PORTDEFS_H
+#define PORTDEFS_H
+
+// Prevents error trying to call main() twice from within the program ;-).
+#ifndef REAL_MAIN
+	#define main scummvm_main
+#endif /* REAL_MAIN */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <math.h>
+#include <time.h>
+#include <cctype>
+
+//??
+//#include <math.h>
+//#include <time.h>
+
+// GP32 SDK Includes
+#include <gpfont.h>
+#include <gpfont16.h>
+#include <gpfont_port.h>
+#include <gpgraphic.h>
+#include <gpgraphic16.h>
+#include <gpmm.h>	
+#include <gpmem.h>
+#include <gpos_def.h>
+#include <gpstdio.h>
+#include <gpstdlib.h>
+#include <gpdef.h>
+
+#define size_t long unsigned int // SDK hack
+
+// Undefine SDK defs.
+
+#undef byte
+#undef malloc
+#undef calloc
+#undef free
+
+#undef stderr
+#undef stdout
+#undef stdin
+
+// Redefine SDK defs.
+typedef unsigned char u8;
+typedef signed char s8;
+typedef unsigned short u16;
+typedef short s16;
+typedef unsigned int u32;
+typedef int s32;
+typedef int time_t;
+
+extern int gpprintf(const char *fmt, ...);
+#define printf gpprintf
+
+extern void *gpmalloc(size_t size);
+extern void *gpcalloc(size_t nitems, size_t size);
+extern void gpfree(void *block);
+extern char *gpstrdup(const char *s);
+
+#define malloc gpmalloc 
+#define calloc gpcalloc //gm_calloc
+//#define calloc gm_calloc
+#define free gpfree	
+
+//	#define memset gm_memset
+//	#define memcopy gm_memcopy
+//
+//	#define strcpy gm_strcpy	// uncomment?
+//	#define strncpy gm_strncpy
+//	#define strcat gm_strcat
+//	#define sprintf gm_sprintf
+
+#define strdup gpstrdup
+
+#define assert(e) ((e) ? 0 : (printf("!AS: " #e " (%s, %d)\n", __FILE__, __LINE__)))
+#define ASSERT assert
+
+#define ENDLESSLOOP while (1)
+
+#define FILE F_HANDLE		
+extern FILE *fstderr;
+extern FILE *fstdout;
+extern FILE *fstdin;
+
+#define stderr fstderr
+#define stdout fstdout
+#define stdin fstdin
+
+extern FILE *gpfopen(const char *filename, const char *mode);
+extern int gpfclose(FILE *stream);
+extern int gpfseek(FILE *stream, long offset, int whence);
+extern size_t gpfread(void *ptr, size_t size, size_t n, FILE *stream);
+extern size_t gpfwrite(const void *ptr, size_t size, size_t n, FILE*stream);
+extern long gpftell(FILE *stream);
+extern void gpclearerr(FILE *stream);
+extern int gpfeof(FILE *stream);
+extern char *gpfgets(char *s, int n, FILE *stream);
+extern int gpfflush(FILE *stream);
+extern char gpfgetc(FILE *stream);
+
+#define fopen gpfopen
+#define fclose gpfclose
+#define fseek gpfseek
+#define fread gpfread
+#define fwrite gpfwrite
+#define ftell gpftell
+
+#undef clearerr 
+#define clearerr gpclearerr
+
+#undef feof	
+#define feof gpfeof
+#define fgets gpfgets
+#define fgetc gpfgetc
+#define getc gpfgetc
+
+extern int gpfprintf(FILE *stream, const char *fmt, ...);
+#define fprintf gpfprintf
+#define fflush gpfflush
+
+extern void gpexit(int code);
+#define exit gpexit
+//#define error printf
+
+//extern time_t gptime(time_t *timer);
+//#define time gptime
+
+// MARK Debug Point.
+#define MARK printf("MARK: %s, %s, %d", __FILE__, __FUNCTION__, __LINE__);
+
+extern void *gpmemset (void *s, int c, size_t n);
+extern void *gpmemcpy (void *dest, const void *src, size_t n);
+//#define memset gpmemset
+//#define memcpy gpmemcpy
+
+// Missing stuff
+int stricmp(const char *string1, const char *string2);
+int strnicmp(const char *string1, const char *string2, int len);
+inline float sin(float) { return 0; }
+inline float cos(float) { return 0; }
+inline float sqrt(float) { return 0; }
+inline float atan2(float, float) { return 0; }
+
+// EOF
+#endif /* PORTDEFS_H */

--- dirent.h DELETED ---

--- readme.txt DELETED ---

--- sdl.h DELETED ---

--- stat.h DELETED ---





More information about the Scummvm-git-logs mailing list