Remove trailing whitespaces.

svn-id: r18604
This commit is contained in:
Eugene Sandulenko 2005-07-30 21:11:48 +00:00
parent 86ab70b149
commit 6b4484472b
560 changed files with 11703 additions and 11703 deletions

View file

@ -65,7 +65,7 @@ static Err AppStartCheckNotify() {
UInt32 romVersion;
Err err;
err = FtrGet(sysFtrCreator, sysFtrNumNotifyMgrVersion, &romVersion);
err = FtrGet(sysFtrCreator, sysFtrNumNotifyMgrVersion, &romVersion);
if (!err) {
UInt16 cardNo;
LocalID dbID;
@ -111,13 +111,13 @@ static Err AppStartLoadSkin() {
if (err)
FrmCustomAlert(FrmWarnAlert,"No skin found.\nScummVM will start in direct mode.",0,0);
//FrmCustomAlert(FrmErrorAlert,"No skin found.\nPlease install a skin and restart ScummVM.",0,0);
return err;
}
static Err AppStartCheckMathLib() {
Err e = MathlibInit();
switch (e) {
case errNone:
break;
@ -128,7 +128,7 @@ static Err AppStartCheckMathLib() {
FrmCustomAlert(FrmErrorAlert,"Can't open MathLib !",0,0);
break;
}
return e;
}
@ -143,7 +143,7 @@ void WinScreenGetPitch() {
WinScreenGetAttribute(winScreenRowBytes, &(gVars->screenPitch));
if (OPTIONS_TST(kOptMode16Bit))
gVars->screenPitch /= 2; // this value is used only in-game and in 8bit mode, so if we are in 16Bit 8bit = 16bit/2
// FIXME : hack for TT3 simulator (and real ?) return 28 on landscape mode
if (gVars->screenPitch < gVars->screenFullWidth)
gVars->screenPitch = gVars->screenFullWidth;
@ -175,12 +175,12 @@ void PINGetScreenDimensions() {
gVars->screenFullHeight = y << 1;
OPTIONS_SET(kOptModeWide);
if (curOrientation == sysOrientationLandscape ||
curOrientation == sysOrientationReverseLandscape
)
OPTIONS_SET(kOptModeLandscape);
StatShow();
PINSetInputAreaState(pinInputAreaOpen);
PINSetInputTriggerState(pinInputTriggerDisabled);
@ -208,7 +208,7 @@ static void AppStartCheckScreenSize() {
SilkLibResizeDispWin(slkRefNum, silkResizeMax);
HRWinGetWindowExtent(gVars->HRrefNum, &gVars->screenFullWidth, &gVars->screenFullHeight);
SilkLibResizeDispWin(slkRefNum, silkResizeNormal);
SilkLibDisableResize(slkRefNum);
SilkLibDisableResize(slkRefNum);
} else {
VskSetState(slkRefNum, vskStateEnable, (gVars->slkVersion == vskVersionNum2 ? vskResizeVertically : vskResizeHorizontally));
@ -218,7 +218,7 @@ static void AppStartCheckScreenSize() {
VskSetState(slkRefNum, vskStateEnable, vskResizeDisable);
OPTIONS_SET((version == vskVersionNum3 ? kOptModeLandscape : kOptNone));
}
OPTIONS_SET(kOptModeWide);
// Tapwave Zodiac and other DIA API compatible devices
@ -226,7 +226,7 @@ static void AppStartCheckScreenSize() {
} else {
PINGetScreenDimensions();
}
WinScreenGetPitch();
}
@ -261,7 +261,7 @@ static void AppStartSetMemory() {
min(kMemScummNewCostGames, 2500000);
min(kMemSimon1Games, 1000000);
min(kMemSimon2Games, 2000000);
}
#undef threshold
@ -352,7 +352,7 @@ Err AppStart(void) {
gPrefs->debug = false;
gPrefs->exitLauncher = true;
gPrefs->stdPalette = OPTIONS_TST(kOptDeviceOS5);
} else {
PrefGetAppPreferences(appFileCreator, appPrefID, gPrefs, &dataSize, true);
}
@ -362,7 +362,7 @@ Err AppStart(void) {
error = AppStartCheckHRmode();
if (error) return (error);
// error = AppStartLoadSkin();
// if (error) return (error);
bDirectMode = (AppStartLoadSkin() != errNone);
@ -410,8 +410,8 @@ static Err AppStopCheckNotify()
{
UInt32 romVersion;
Err err;
err = FtrGet(sysFtrCreator, sysFtrNumNotifyMgrVersion, &romVersion);
err = FtrGet(sysFtrCreator, sysFtrNumNotifyMgrVersion, &romVersion);
if (!err) {
UInt16 cardNo;
LocalID dbID;
@ -424,7 +424,7 @@ static Err AppStopCheckNotify()
SysNotifyUnregister(cardNo, dbID, sysNotifyDisplayResizedEvent, sysNotifyNormalPriority);
}
}
return err;
}
@ -437,7 +437,7 @@ void AppStop(void) {
// Close and move Game list database
GamCloseDatabase(false);
// Write the saved preferences / saved-state information. This data
// Write the saved preferences / saved-state information. This data
// will saved during a HotSync backup.
SavePrefs();

View file

@ -17,7 +17,7 @@ void ArgsAdd(Char **argvP, const Char *argP, const Char *parmP, UInt8 *countArgP
UInt16 len2 = 0;
UInt16 len1 = StrLen(argP);
if (len1 > 0) {
if (len1 > 0) {
if (parmP)
len2 = StrLen(parmP);
@ -25,7 +25,7 @@ void ArgsAdd(Char **argvP, const Char *argP, const Char *parmP, UInt8 *countArgP
newArg = MemHandleNew(len1 + len2 + 1); // +1 = NULL CHAR
*argvP = (Char *)MemHandleLock(newArg);
StrCopy(*argvP, argP);
if (parmP)
StrCat(*argvP, parmP);
}
@ -44,7 +44,7 @@ void ArgsFree(Char **argvP) {
MemHandleUnlock(oldH);
MemHandleFree(oldH);
}
oldH = MemPtrRecoverHandle(argvP);
MemHandleUnlock(oldH);
MemHandleFree(oldH);

View file

@ -10,8 +10,8 @@
extern "C"
unsigned long PNO_Main(
const void *emulStateP,
void *userData68KP,
const void *emulStateP,
void *userData68KP,
Call68KFuncType *call68KFuncP);
unsigned long PNO_Main(const void *emulStateP, void *userData68KP, Call68KFuncType *call68KFuncP) {
@ -41,7 +41,7 @@ unsigned long PNO_Main(const void *emulStateP, void *userData68KP, Call68KFuncTy
#endif
};
// needed before making any OS calls using the
// needed before making any OS calls using the
// PACEInterface library
InitPACEInterface(emulStateP, call68KFuncP);

View file

@ -47,6 +47,6 @@ UInt32 Display_blit(void *userData68KP) {
dstBuf += dstPitch;
}
}
return 0;
}

View file

@ -23,6 +23,6 @@ UInt32 OSystem_CopyRectToScreen(void *userData68KP) {
buf += pitch;
} while (--h);
}
return 0;
}

View file

@ -22,6 +22,6 @@ UInt32 Screen_decompressRLE0(void *userData68KP) {
dest += skip;
}
}
return 0;
}

View file

@ -22,6 +22,6 @@ UInt32 Screen_decompressRLE7(void *userData68KP) {
dest += code;
}
}
return 0;
}

View file

@ -21,6 +21,6 @@ UInt32 Screen_drawSprite(void *userData68KP) {
sprData += sprPitch;
dest += _scrnSizeX;
}
return 0;
}

View file

@ -21,7 +21,7 @@ UInt32 Gdi_drawStripToScreen(void *userData68KP) {
// Compose the text over the game graphics
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
if (text[w] == CHARSET_MASK_TRANSPARENCY)
if (text[w] == CHARSET_MASK_TRANSPARENCY)
dst[w] = src[w];
else
dst[w] = text[w];
@ -30,6 +30,6 @@ UInt32 Gdi_drawStripToScreen(void *userData68KP) {
dst += _vm_screenWidth;
text += _textSurface_pitch;
}
return 0;
}

View file

@ -49,6 +49,6 @@ UInt32 Screen_fastShrink(void *userData68KP) {
xCnt += 2;
}
}
return 0;
}

View file

@ -1,5 +1,5 @@
#ifndef __MACROS_H__
#define __MACROS_H__
#define __MACROS_H__
#ifndef DISABLE_ARM
// macros for ARM calls
@ -14,7 +14,7 @@
#define ARM_ADDM(member) dataARM.member = member;
#define ARM_ADDV(member, var) dataARM.member = var;
#define ARM_INIT(id) PnoType pno = { id, &dataARM };
#define ARM_GETM(member) member = dataARM.member;
#define ARM_GETV(member, var) var = dataARM.member;
@ -33,7 +33,7 @@
#define ARM_CALL_VALUE(rsc, data, var) ARM(rsc).alignedHeader->userDataP = (UInt32)data; \
var = PceNativeCall(ARM(rsc).pnoDesc.entry, ARM(rsc).alignedHeader);
#else
// no ARM = empty definition
#define ARM_START(TYPE)
@ -68,7 +68,7 @@
#define GET_XPTR(var, dst, src, TYPE) \
dst.var = (TYPE *)ReadUnaligned32(&src->var);
#define GET_X32(var, dst, src) \
dst.var = ReadUnaligned32(&src->var);

View file

@ -96,7 +96,7 @@ typedef struct {
typedef struct {
void *v1; // struct v1 *
const byte *_srcptr;
int _height;
@ -118,11 +118,11 @@ typedef struct {
typedef struct {
int width;
int height;
const byte *src;
byte *dst;
const byte *text;
int _vm_screenWidth;
uint16 vs_pitch;
uint16 _textSurface_pitch;

View file

@ -11,7 +11,7 @@
UInt32 CostumeRenderer_proc3(void *userData68KP) {
// import variables
V1Type v1;
SETPTRV (V1CodecType * , v1, v1comp )
SETPTR (const byte * ,_srcptr )
@ -27,7 +27,7 @@ UInt32 CostumeRenderer_proc3(void *userData68KP) {
SETPTR (byte * ,_shadow_table )
SETPTR (byte * ,_palette )
SET8 (byte ,_shadow_mode )
MSETPTR (const byte * ,scaletable )
MSET8 (byte ,mask )
MSET8 (byte ,shr )

View file

@ -71,6 +71,6 @@ UInt32 Screen_renderParallax(void *userData68KP) {
}
}
}
return 0;
}

View file

@ -19,6 +19,6 @@ UInt32 Screen_draw(void *userData68KP) {
dest++;
src++;
}
return 0;
}

View file

@ -24,7 +24,7 @@ UInt32 OSystem_updateScreen_wideLandscape(void *userData68KP) {
MemMove(dst, dst - 480, 480);
dst += 480;
}
return 0;
}

View file

@ -38,6 +38,6 @@ UInt32 OSystem_updateScreen_widePortrait(void *userData68KP) {
MemMove(dst, dst - WIDE_PITCH, 300); // 300 = 200 x 1.5
dst += WIDE_PITCH;
}
return 0;
}

View file

@ -5,7 +5,7 @@
enum {
GBVARS_GUIFONT_INDEX = 0,
GBVARS_FONTBITS_INDEX
};
};
// Scumm
enum {
@ -56,7 +56,7 @@ enum {
GBVARS_SPANISHVIDEOFONT_INDEX,
GBVARS_VIDEOFONT_INDEX,
GBVARS_SIMON1CURSOR_INDEX
// GBVARS_SIMON2CURSORS_INDEX
// GBVARS_SIMON2CURSORS_INDEX
};
// Queen
enum {

View file

@ -54,7 +54,7 @@ void DefaultCDPlayer::update() {
// not fully played
if (_sys->getMillis() < _defTrackEndFrame)
return;
if (_defLoops == 0)
return;
@ -77,14 +77,14 @@ void DefaultCDPlayer::stop() { /* Stop CD Audio in 1/10th of a second */
void DefaultCDPlayer::play(int track, int num_loops, int start_frame, int duration) {
if (!num_loops && !start_frame)
return;
UInt32 fullLength;
_defLoops = num_loops;
start_frame = TO_MSECS(start_frame);
duration = TO_MSECS(duration);
// frame in milli-seconds
// frame in milli-seconds
_defStopTime = 0;
fullLength = start_frame + gVars->CD.defaultTrackLength * 1000;
@ -96,7 +96,7 @@ void DefaultCDPlayer::play(int track, int num_loops, int start_frame, int durati
} else {
_defTrackLength = fullLength;
}
// try to play the track
_defTrackEndFrame = _sys->getMillis() + _defTrackLength;
}

View file

@ -19,30 +19,30 @@
* $Header$
*
*/
#ifndef CD_DEFAULT_H
#define CD_DEFAULT_H
#include "cdaudio.h"
class DefaultCDPlayer : public CDAudio {
public:
DefaultCDPlayer(OSystem *sys);
bool init();
void release();
bool poll();
void update();
void play(int track, int num_loops, int start_frame, int duration);
void stop();
private:
OSystem *_sys;
// cdrom
UInt16 _defLoops;
UInt32 _defStopTime, _defTrackEndFrame, _defTrackLength;
};
#endif

View file

@ -47,7 +47,7 @@ bool MsaCDPlayer::init() {
if (!(error = FtrGet(sonySysFtrCreator, sonySysFtrNumSysInfoP, (UInt32*)&sonySysFtrSysInfoP))) {
// not found with audio adapter ?!
//if (sonySysFtrSysInfoP->libr & sonySysFtrSysInfoLibrMsa) {
//if (sonySysFtrSysInfoP->libr & sonySysFtrSysInfoLibrMsa) {
if ((error = SysLibFind(sonySysLibNameMsa, &_msaRefNum)))
if (error == sysErrLibNotFound)
error = SysLibLoad(sonySysFileTMsaLib, sonySysFileCMsaLib, &_msaRefNum);
@ -57,11 +57,11 @@ bool MsaCDPlayer::init() {
// this doesn't work the same way on build-in MP3 device and external MP3 devices
if (!error) {
//MsaLibClose(_msaRefNum, msaLibOpenModeAlbum); // close the lib if we previously let it open (?) Need to add Notify for sonySysNotifyMsaEnforceOpenEvent just in case ...
error = MsaLibOpen(_msaRefNum, msaLibOpenModeAlbum);
error = MsaLibOpen(_msaRefNum, msaLibOpenModeAlbum);
//if (error == msaErrAlreadyOpen)
// error = MsaLibEnforceOpen(_msaRefNum, msaLibOpenModeAlbum, appFileCreator);
//error = (error != msaErrStillOpen) ? error : errNone;
}
//}
@ -147,7 +147,7 @@ void MsaCDPlayer::update() {
}
MsaStop(_msaRefNum, true);
if (_msaLoops == 0)
return;
@ -185,13 +185,13 @@ void MsaCDPlayer::play(int track, int num_loops, int start_frame, int duration)
if (!num_loops && !start_frame)
return;
_msaTrack = track + gVars->CD.firstTrack - 1; // first track >= 1 ?, not 0 (0=album)
_msaLoops = num_loops;
_msaStartFrame = TO_MSECS(start_frame);
_msaDuration = TO_MSECS(duration);
Err e;
Err e;
MemHandle trackH;
// stop current play if any
@ -206,19 +206,19 @@ void MsaCDPlayer::play(int track, int num_loops, int start_frame, int duration)
MsaTime msaTime;
MsaTrackInfo *trackP;
UInt32 SU, fullLength;
// FIXME (?) : this enable MsaSuToTime to return the right value in some cases
MsaPlay(_msaRefNum, _msaTrack, 0, msa_PBRATE_SP);
MsaStop(_msaRefNum, true);
// get the msa time
trackP = (MsaTrackInfo *)MemHandleLock(trackH);
// get the msa time
trackP = (MsaTrackInfo *)MemHandleLock(trackH);
MsaSuToTime(_msaRefNum, trackP->totalsu, &msaTime);
SU = trackP->totalsu;
MemPtrUnlock(trackP);
MemHandleFree(trackH);
// MSA frame in milli-seconds
// MSA frame in milli-seconds
fullLength = FROM_MIN(msaTime.minute);
fullLength += FROM_SEC(msaTime.second);
fullLength += msaTime.frame;
@ -231,7 +231,7 @@ void MsaCDPlayer::play(int track, int num_loops, int start_frame, int duration)
} else {
_msaTrackLength = fullLength;
}
// try to play the track
if (start_frame == 0 && duration == 0) {
MsaPlay(_msaRefNum, _msaTrack, 0, msa_PBRATE_SP);
@ -241,7 +241,7 @@ void MsaCDPlayer::play(int track, int num_loops, int start_frame, int duration)
_msaTrackStartSu = (UInt32) ((float)(_msaStartFrame) / ((float)fullLength / (float)SU));
_msaTrackEndSu = (UInt32) ((float)(_msaTrackLength) / ((float)fullLength / (float)SU));
_msaTrackEndSu += _msaTrackStartSu;
if (_msaTrackEndSu > SU)
_msaTrackEndSu = SU;

View file

@ -19,30 +19,30 @@
* $Header$
*
*/
#ifndef CD_MSA_H
#define CD_MSA_H
#include "cdaudio.h"
class MsaCDPlayer : public CDAudio {
public:
MsaCDPlayer(OSystem *sys);
bool init();
void release();
bool poll();
void update();
void play(int track, int num_loops, int start_frame, int duration);
void stop();
private:
void initInternal();
OSystem *_sys;
UInt16 _msaRefNum;
// cdrom
AlbumInfoType _msaAlbum;
UInt16 _msaLoops;
@ -57,5 +57,5 @@
UInt32 _msaTrackLength;
};
#endif

View file

@ -49,7 +49,7 @@ UInt32 PckTunesCDPlayer::getStatus() {
EventType e;
UInt32 status;
PocketTunesAction *pAction = (PocketTunesAction*)MemPtrNew (sizeof(PocketTunesAction));
if (!pAction)
return kPtunesStopped;
@ -60,9 +60,9 @@ UInt32 PckTunesCDPlayer::getStatus() {
status = pAction->data.getStatusAction.status;
else
status = kPtunesStopped;
MemPtrFree(pAction);
return status;
return status;
}
UInt32 PckTunesCDPlayer::getPosition(UInt32 deflt) {
@ -78,7 +78,7 @@ UInt32 PckTunesCDPlayer::getPosition(UInt32 deflt) {
pAction->action = kPocketTunesActionGetValue;
pAction->data.getValueAction.which = kPtunesValueSongPosition;
EvtGetEvent(&e, evtNoWait);
if (PocketTunesCallSynch(pAction) == errNone)
value = pAction->data.getValueAction.value;
@ -112,22 +112,22 @@ UInt32 PckTunesCDPlayer::getDuration() {
EventType e;
UInt32 value;
PocketTunesAction *pAction = (PocketTunesAction*)MemPtrNew (sizeof(PocketTunesAction));
if (!pAction)
return gVars->CD.defaultTrackLength;
pAction->action = kPocketTunesActionGetValue;
pAction->data.getValueAction.which = kPtunesValueSongDuration;
EvtGetEvent(&e, evtNoWait);
if (PocketTunesCallSynch(pAction) == errNone)
value = pAction->data.getValueAction.value;
else
value = gVars->CD.defaultTrackLength;
MemPtrFree(pAction);
return value;
return value;
}
bool PckTunesCDPlayer::poll() {
@ -186,7 +186,7 @@ void PckTunesCDPlayer::play(int track, int num_loops, int start_frame, int durat
EventType e;
Char nameP[256], fileP[100];
Char *ext[] = { "mp3", "ogg" };
// if (duration > 0)
// duration += 5;
@ -197,9 +197,9 @@ void PckTunesCDPlayer::play(int track, int num_loops, int start_frame, int durat
// stop current play if any
VFSVolumeGetLabel(gVars->volRefNum, nameP, 256);
StrPrintF(fileP, "/Palm/Programs/ScummVM/Audio/%s_%03ld.%s", gameP, (track + gVars->CD.firstTrack - 1), ext[gVars->CD.format]);
if (PocketTunesOpenFile(nameP, fileP, 0) == errNone) {
EvtGetEvent(&e, evtNoWait);
PocketTunesPauseIfPlaying();

View file

@ -19,39 +19,39 @@
* $Header$
*
*/
#ifndef CD_POCKETTUNES_H
#define CD_POCKETTUNES_H
#include "cdaudio.h"
#include "pockettunes.h"
class PckTunesCDPlayer : public CDAudio {
public:
PckTunesCDPlayer(OSystem *sys);
bool init();
void release();
bool poll();
void update();
void play(int track, int num_loops, int start_frame, int duration);
void stop();
private:
OSystem *_sys;
Char gameP[15];
UInt32 getStatus();
void setPosition(UInt32 value);
UInt32 getDuration();
UInt32 getPosition(UInt32 deft);
Boolean _isPlaying;
// cdrom
UInt16 _pckLoops, _pckTrack;
UInt32 _pckTrackStartFrame, _pckTrackEndFrame;
UInt32 _pckStopTime, _pckTrackDuration;
};
#endif

View file

@ -19,7 +19,7 @@
* $Header$
*
*/
#ifndef CDAUDIO_H
#define CDAUDIO_H
@ -34,7 +34,7 @@
#define FROM_SEC(secs) ((UInt32)((secs) * 1000))
class CDAudio {
public:
public:
CDAudio() {
_isInitialized = false;
_volumeLevel = 100;
@ -42,7 +42,7 @@ public:
virtual bool init() = 0;
virtual void release() = 0;
// OSystem functions
virtual bool poll() = 0;
virtual void play(int track, int num_loops, int start_frame, int duration) = 0;

View file

@ -19,7 +19,7 @@
* $Header$
*
*/
#include <PalmOS.h>
#include <string.h>
@ -36,7 +36,7 @@ void PalmFatalError(const Char *err) {
// unlock to show the alert box
if (gVars->screenLocked)
WinScreenUnlock();
if (OPTIONS_TST(kOptModeHiDensity))
WinSetCoordinateSystem(kCoordinatesStandard);
@ -78,10 +78,10 @@ UInt16 StrReplace(Char *ioStr, UInt16 inMaxLen, const Char *inParamStr, const Ch
UInt16 l2 = 0;
UInt16 l3 = StrLen(ioStr);
UInt16 next = 0;
if (inParamStr)
l2 = StrLen(inParamStr); // can be null to know how many occur.
while (((found = StrStr(ioStr+next, fndParamStr)) != NULL) && (!quit)) {
occurences++;
newLength = (StrLen(ioStr) - l1 + l2);
@ -98,7 +98,7 @@ UInt16 StrReplace(Char *ioStr, UInt16 inMaxLen, const Char *inParamStr, const Ch
} else
next = found - ioStr + l1;
}
if (inParamStr)
ioStr[l3 + l2*occurences - l1*occurences] = 0;

View file

@ -57,13 +57,13 @@ static UInt16 CardSlotFormInit(Boolean display, Boolean bDraw) {
if (err || StrLen(labelP) == 0) { // if no label try to retreive card type
VolumeInfoType volInfo;
err = VFSVolumeInfo(volRefNum, &volInfo);
if (!err) {
ExpCardInfoType info;
err = ExpCardInfo(volInfo.slotRefNum, &info);
StrCopy(labelP, info.deviceClassStr);
}
if (err) // if err default name
StrPrintF(labelP,"Other Card %ld", other++);
}
@ -72,7 +72,7 @@ static UInt16 CardSlotFormInit(Boolean display, Boolean bDraw) {
cards = MemHandleNew(sizeof(CardInfoType));
else
MemHandleResize(cards, MemHandleSize(cards) + sizeof(CardInfoType));
cardsInfo = (CardInfoType *)MemHandleLock(cards);
cardsInfo[counter].volRefNum = volRefNum;
StrCopy(cardsInfo[counter].nameP, labelP);
@ -87,7 +87,7 @@ static UInt16 CardSlotFormInit(Boolean display, Boolean bDraw) {
ControlType *cck1P, *cck2P, *cck3P;
UInt16 index;
Int16 selected = -1;
CardInfoType *cardsInfo;
MemHandle items = NULL;
@ -108,7 +108,7 @@ static UInt16 CardSlotFormInit(Boolean display, Boolean bDraw) {
itemsText = (Char **)MemHandleLock(items);
itemsText[index] = cardsInfo[index].nameP;
MemHandleUnlock(items);
if (cardsInfo[index].volRefNum == gPrefs->card.volRefNum)
selected = index;
}
@ -168,7 +168,7 @@ static void CardSlotFormExit(Boolean bSave) {
cardsInfo = (CardInfoType *)itemsList;
cards = MemPtrRecoverHandle(cardsInfo);
items = MemPtrRecoverHandle(itemsText);
itemsText = NULL;
itemsList = NULL;
} else {
@ -239,7 +239,7 @@ Boolean CardSlotFormHandleEvent(EventPtr eventP) {
Boolean handled = false;
switch (eventP->eType) {
case frmOpenEvent:
CardSlotFormInit(true, true);
handled = true;
@ -260,7 +260,7 @@ Boolean CardSlotFormHandleEvent(EventPtr eventP) {
case CardSlotCancelButton:
CardSlotFormExit(false);
break;
case CardSlotMoveCheckbox:
CardSlotFromShowHideOptions();
break;
@ -271,13 +271,13 @@ Boolean CardSlotFormHandleEvent(EventPtr eventP) {
default:
break;
}
return handled;
}
UInt16 parseCards() {
UInt16 volRefNum = CardSlotFormInit(false, false);
CardSlotFormExit(false);
return volRefNum;
}

View file

@ -33,7 +33,7 @@ static void GameTabInit(GameInfoType *gameInfoP) {
nameP = (Char *)MemHandleLock(nameH);
pathP = (Char *)MemHandleLock(pathH);
gameP = (Char *)MemHandleLock(gameH);
if (gameInfoP) {
LstSetSelection(list1P, gameInfoP->engine);
StrCopy(nameP, gameInfoP->nameP);
@ -102,7 +102,7 @@ static Err GameTabSave(GameInfoType *gameInfoP) {
StrCat(gameInfoP->pathP, "/");
}
return errNone;
}
@ -110,7 +110,7 @@ static void DisplayInit(GameInfoType *gameInfoP) {
ListType *list1P;
list1P = (ListType *)GetObjectPtr(TabGameDisplayGfxListList);
if (gameInfoP) {
LstSetSelection(list1P, gameInfoP->gfxMode);
CtlSetValue((ControlType *)GetObjectPtr(TabGameDisplayFilterCheckbox), gameInfoP->filter);
@ -129,7 +129,7 @@ static void DisplayInit(GameInfoType *gameInfoP) {
static Err DisplaySave(GameInfoType *gameInfoP) {
ListType *list1P;
ControlType *cck6P, *cck7P, *cck8P;
ControlType *cck6P, *cck7P, *cck8P;
FormType *frmP = FrmGetActiveForm();
@ -137,7 +137,7 @@ static Err DisplaySave(GameInfoType *gameInfoP) {
cck6P = (ControlType *)GetObjectPtr(TabGameDisplayFilterCheckbox);
cck7P = (ControlType *)GetObjectPtr(TabGameDisplayFullscreenCheckbox);
cck8P = (ControlType *)GetObjectPtr(TabGameDisplayAspectRatioCheckbox);
if (!gameInfoP) {
} else {
gameInfoP->gfxMode = LstGetSelection(list1P);
@ -145,7 +145,7 @@ static Err DisplaySave(GameInfoType *gameInfoP) {
gameInfoP->fullscreen = CtlGetValue(cck7P);
gameInfoP->aspectRatio = CtlGetValue(cck8P);
}
return errNone;
}
@ -213,7 +213,7 @@ static void OptionsInit(GameInfoType *gameInfoP) {
static Err OptionsSave(GameInfoType *gameInfoP) {
FieldType *fld4P, *fld5P, *fld6P;
ControlType *cck1P, *cck2P, *cck3P, *cck4P, *cck5P;
ControlType *cck1P, *cck2P, *cck3P, *cck4P, *cck5P;
ListType *list2P, *list3P;
FormType *frmP = FrmGetActiveForm();
@ -247,7 +247,7 @@ static Err OptionsSave(GameInfoType *gameInfoP) {
} else {
gameInfoP->language = LstGetSelection(list2P);
gameInfoP->platform = LstGetSelection(list3P);
gameInfoP->autoLoad = CtlGetValue(cck1P);
gameInfoP->bootParam = CtlGetValue(cck2P);
gameInfoP->setPlatform = CtlGetValue(cck3P);
@ -258,7 +258,7 @@ static Err OptionsSave(GameInfoType *gameInfoP) {
gameInfoP->bootValue = StrAToI(FldGetTextPtr(fld5P));
gameInfoP->talkValue = StrAToI(FldGetTextPtr(fld6P));
}
return errNone;
}
@ -323,19 +323,19 @@ static void GameManSave(UInt16 index) {
newGameInfo.version = curItemVersion;
newGameInfo.icnID = 0xFFFF;
newGameInfo.selected = true;
// default sound data
newGameInfo.musicInfo.volume.master = 192;
newGameInfo.musicInfo.volume.music = 192;
newGameInfo.musicInfo.volume.sfx = 192;
newGameInfo.musicInfo.volume.speech = 192;
newGameInfo.musicInfo.volume.audiocd = 50;
newGameInfo.musicInfo.sound.tempo = 100;
newGameInfo.musicInfo.sound.defaultTrackLength = 10;
newGameInfo.musicInfo.sound.firstTrack = 1;
}
GameTabSave(&newGameInfo);
DisplaySave(&newGameInfo);
OptionsSave(&newGameInfo);
@ -349,14 +349,14 @@ static void GameManSave(UInt16 index) {
{
RectangleType rArea;
UInt16 posIndex, maxView;
// get the sorted index
index = GamGetSelected();
// if new item is out of the list bounds, change current list pos
SknGetListBounds(&rArea, NULL);
maxView = rArea.extent.y / sknInfoListItemSize;
posIndex = gPrefs->listPosition;
// if out of the current list position
if (!(index >= posIndex && index < (posIndex + maxView)))
gPrefs->listPosition = index; // this value is corrected in SknUpdateList if needed
@ -373,7 +373,7 @@ static void GameManSave(UInt16 index) {
* FUNCTION: EditGameFormInit
* FUNCTION: EditGameFormHandleEvent
*
* DESCRIPTION:
* DESCRIPTION:
*
* REVISION HISTORY:
*
@ -451,7 +451,7 @@ Boolean EditGameFormHandleEvent(EventPtr eventP) {
TabDeleteTabs(myTabP);
FrmReturnToMain();
break;
case GameEditDeleteButton:
EditGameFormDelete(false);
break;
@ -482,6 +482,6 @@ Boolean EditGameFormHandleEvent(EventPtr eventP) {
default:
break;
}
return handled;
}

View file

@ -29,7 +29,7 @@ static Boolean ScummVMTabSave() {
FormPtr frmP;
fld1P = (FieldType *)GetObjectPtr(TabScummVMDebugLevelField);
cckP[3] = (ControlType *)GetObjectPtr(TabScummVMDebugCheckbox);
cckP[6] = (ControlType *)GetObjectPtr(TabScummVMDemoCheckbox);
cckP[9] = (ControlType *)GetObjectPtr(TabScummVMCopyProtectionCheckbox);
@ -49,7 +49,7 @@ static Boolean ScummVMTabSave() {
gPrefs->altIntro = CtlGetValue(cckP[10]);
gPrefs->debugLevel = StrAToI(FldGetTextPtr(fld1P));
return true;
}
@ -125,7 +125,7 @@ static void PalmOSTabInit() {
static void MiscFormSave() {
PalmOSTabSave();
if (!ScummVMTabSave()) return;
TabDeleteTabs(myTabP);
FrmReturnToMain();
}
@ -176,7 +176,7 @@ Boolean MiscFormHandleEvent(EventPtr eventP) {
case (MiscForm + 2) :
lastTab = (eventP->data.ctlSelect.controlID - MiscForm - 1);
TabSetActive(frmP, myTabP, lastTab);
#ifndef DISABLE_LIGHTSPEED
if (!LS_Installed())
#endif
@ -210,6 +210,6 @@ Boolean MiscFormHandleEvent(EventPtr eventP) {
default:
break;
}
return handled;
}

View file

@ -27,7 +27,7 @@ static void SkinsFormInit(Boolean bDraw) {
Char nameP[32];
itemsText = NULL;
// parse and save skins
Err err = DmGetNextDatabaseByTypeCreator(true, &stateInfo, 'skin', appFileCreator, false, &cardNo, &dbID);
while (!err && dbID) {
@ -38,14 +38,14 @@ static void SkinsFormInit(Boolean bDraw) {
skins = MemHandleNew(sizeof(SkinInfoType));
else
MemHandleResize(skins, MemHandleSize(skins) + sizeof(SkinInfoType));
skinsInfo = (SkinInfoType *)MemHandleLock(skins);
StrCopy(skinsInfo[numSkins].nameP, nameP);
skinsInfo[numSkins].cardNo = cardNo;
skinsInfo[numSkins].dbID = dbID;
MemHandleUnlock(skins);
numSkins++;
}
}
err = DmGetNextDatabaseByTypeCreator(false, &stateInfo, 'skin', appFileCreator, false, &cardNo, &dbID);
}
@ -69,7 +69,7 @@ static void SkinsFormInit(Boolean bDraw) {
itemsText = (Char **)MemHandleLock(items);
itemsText[index] = skinsInfo[index].nameP;
MemHandleUnlock(items);
if ( gPrefs->skin.cardNo == skinsInfo[index].cardNo &&
gPrefs->skin.dbID == skinsInfo[index].dbID &&
StrCompare(gPrefs->skin.nameP, skinsInfo[index].nameP) == 0)
@ -106,7 +106,7 @@ static void SkinsFormExit(Boolean bSave) {
listP = (ListType *)GetObjectPtr(SkinsSkinList);
selected = LstGetSelection(listP);
if (bSave && selected == -1) { // may never occured...
FrmCustomAlert(FrmWarnAlert, "You didn't select a skin.", 0, 0);
return;
@ -115,24 +115,24 @@ static void SkinsFormExit(Boolean bSave) {
skinsInfo = (SkinInfoType *)itemsList;
skins = MemPtrRecoverHandle(skinsInfo);
items = MemPtrRecoverHandle(itemsText);
itemsText = NULL;
itemsList = NULL;
itemsType = ITEM_TYPE_UNKNOWN;
if (bSave) {
ControlType *cck1P;
StrCopy(gPrefs->skin.nameP, skinsInfo[selected].nameP);
gPrefs->skin.cardNo = skinsInfo[selected].cardNo;
gPrefs->skin.dbID = skinsInfo[selected].dbID;
/* DmOpenRef skinDB = SknOpenSkin();
UInt32 depth = SknGetDepth(skinDB);
SknCloseSkin(skinDB);
if (depth != 8 && depth != 16) depth = 8;
if (depth == 16 && !OPTIONS_TST(kOptMode16Bit)) {
FrmCustomAlert(FrmInfoAlert, "You can only use 8bit skin on your device.", 0, 0);
gPrefs->skin.cardNo = cardNo;
@ -226,7 +226,7 @@ Boolean SkinsFormHandleEvent(EventPtr eventP) {
Boolean handled = false;
switch (eventP->eType) {
case frmOpenEvent:
SkinsFormInit(true);
handled = true;
@ -247,11 +247,11 @@ Boolean SkinsFormHandleEvent(EventPtr eventP) {
case SkinsCancelButton:
SkinsFormExit(false);
break;
case SkinsBeamButton:
SkinsFormBeam();
break;
case SkinsDeleteButton:
SkinsFormDelete();
break;
@ -262,6 +262,6 @@ Boolean SkinsFormHandleEvent(EventPtr eventP) {
default:
break;
}
return handled;
}

View file

@ -42,7 +42,7 @@ void GetMemory(UInt32* storageMemoryP, UInt32* dynamicMemoryP, UInt32 *storageFr
UInt32 dynamicFree = 0;
// Iterate through each card to support devices with multiple cards.
nCards = MemNumCards();
nCards = MemNumCards();
for (cardNo = 0; cardNo < nCards; cardNo++) {
// Iterate through the RAM heaps on a card (excludes ROM).
@ -51,7 +51,7 @@ void GetMemory(UInt32* storageMemoryP, UInt32* dynamicMemoryP, UInt32 *storageFr
heapID = MemHeapID(cardNo, i);
// Calculate the total memory and free memory of the heap.
MemHeapFreeBytes(heapID, &free, &max);
// If the heap is dynamic, increment the dynamic memory total.
if (MemHeapDynamic(heapID)) {
dynamicMemory += MemHeapSize(heapID);
@ -89,10 +89,10 @@ static void SystemTabDraw() {
GetMemory(&sm, &dm, &sf, &df);
stack = GetStackSize();
WinSetTextColor(UIColorGetTableEntryIndex(UIObjectForeground));
FntSetFont(stdFont);
StrIToA(num, dm);
x = 147 - FntCharsWidth(num, StrLen(num)) + 5;
WinDrawChars(num, StrLen(num), x, 12 + 30);
@ -182,6 +182,6 @@ Boolean InfoFormHandleEvent(EventPtr eventP) {
default:
break;
}
return handled;
}

View file

@ -25,7 +25,7 @@ static Err BeamMe() {
err = SendDatabase(0, dbID, "ScummVM.prc", "\nPlay your favorite LucasArts games");
else
err = DmGetLastErr();
return err;
}
@ -90,7 +90,7 @@ static Boolean MainFormDoCommand(UInt16 command)
FrmPopupForm(InfoForm);
handled = true;
break;
case MainGamesMusicSound:
FrmPopupForm(MusicForm);
handled = true;
@ -115,7 +115,7 @@ static Boolean MainFormDoCommand(UInt16 command)
*
* FUNCTION: MainFormHandleEvent
*
* DESCRIPTION: This routine is the event handler for the
* DESCRIPTION: This routine is the event handler for the
* "MainForm" of this application.
*
* PARAMETERS: eventP - a pointer to an EventType structure
@ -136,7 +136,7 @@ static Boolean PenDownRepeat() {
if (penDown && sknLastOn) {
RectangleType r;
DmOpenRef skinDBP;
skinDBP = SknOpenSkin();
SknGetObjectBounds(skinDBP, sknLastOn, &r);
@ -145,14 +145,14 @@ static Boolean PenDownRepeat() {
SknSetState(skinDBP, sknLastOn, sknStateSelected);
SknShowObject(skinDBP, sknLastOn);
}
switch (sknLastOn) {
case skinSliderUpArrow:
case skinSliderDownArrow:
handled = SknProcessArrowAction(sknLastOn);
break;
}
} else {
if (SknGetState(skinDBP, sknLastOn) != sknStateNormal) {
SknSetState(skinDBP, sknLastOn, sknStateNormal);
@ -162,7 +162,7 @@ static Boolean PenDownRepeat() {
SknCloseSkin(skinDBP);
}
return handled;
}
@ -173,7 +173,7 @@ Boolean MainFormHandleEvent(EventPtr eventP)
FormPtr frmP;
Coord x,y;
DmOpenRef skinDBP;
switch (eventP->eType) {
case frmUpdateEvent:
{
@ -216,11 +216,11 @@ Boolean MainFormHandleEvent(EventPtr eventP)
//gPrefs->card.volRefNum = parseCards(true);
FrmPopupForm(CardSlotForm);
break;
case MainAboutButton:
FrmPopupForm(InfoForm);
break;
// case MainListTypeSelTrigger:
// FrmList(eventP, MainListTypeList);
// break;
@ -232,7 +232,7 @@ Boolean MainFormHandleEvent(EventPtr eventP)
x = eventP->screenX;
y = eventP->screenY;
lastIndex = dmMaxRecordIndex; // enable select/unselect list item
if (sknLastOn != skinButtonNone) {
RectangleType r;
skinDBP = SknOpenSkin();
@ -240,7 +240,7 @@ Boolean MainFormHandleEvent(EventPtr eventP)
SknSetState(skinDBP, sknLastOn, sknStateNormal);
SknShowObject(skinDBP, sknLastOn);
SknCloseSkin(skinDBP);
if (RctPtInRectangle(x*2, y*2, &r)) {
switch (sknLastOn) {
case skinButtonGameAdd:
@ -297,7 +297,7 @@ Boolean MainFormHandleEvent(EventPtr eventP)
case skinButtonGameDelete:
case skinButtonGameAudio:
SknSetState(skinDBP, sknLastOn, sknStateSelected);
SknShowObject(skinDBP, sknLastOn);
SknShowObject(skinDBP, sknLastOn);
if (gPrefs->soundClick)
SndPlaySystemSound(sndClick);
handled = true;
@ -309,7 +309,7 @@ Boolean MainFormHandleEvent(EventPtr eventP)
SknSelect(x, y);
}
break;
case keyDownEvent:
if ( (eventP->data.keyDown.chr >= 'a' && eventP->data.keyDown.chr <= 'z') ||
(eventP->data.keyDown.chr >= 'A' && eventP->data.keyDown.chr <= 'Z')) {
@ -319,7 +319,7 @@ Boolean MainFormHandleEvent(EventPtr eventP)
}
}
break;
default:
handled = PenDownRepeat();
}

View file

@ -19,7 +19,7 @@ static Boolean MusicTabSave() {
FieldType *fld1P;
UInt16 tempo;
FormPtr frmP;
frmP = FrmGetActiveForm();
cck1P = (ControlType *)GetObjectPtr(TabMusicMusicCheckbox);
@ -40,7 +40,7 @@ static Boolean MusicTabSave() {
musicInfoP->sound.drvMusic = LstGetSelection(list1P);
musicInfoP->sound.tempo = tempo;
return true;
}
@ -87,7 +87,7 @@ static void SoundTabSave() {
static void SoundTabInit() {
ControlType *cck1P;
ListType *list1P;
cck1P = (ControlType *)GetObjectPtr(TabSoundSoundCheckbox);
list1P = (ListType *)GetObjectPtr(TabSoundRateList);
@ -103,7 +103,7 @@ static Boolean AudioCDTabSave() {
ListType *list1P, *list2P;
UInt16 firstTrack;
FormPtr frmP;
frmP = FrmGetActiveForm();
cck3P = (ControlType *)GetObjectPtr(TabAudioCDMP3Checkbox);
@ -111,7 +111,7 @@ static Boolean AudioCDTabSave() {
fld3P = (FieldType *)GetObjectPtr(TabAudioCDFirstTrackField);
list1P = (ListType *)GetObjectPtr(TabAudioCDDriverList);
list2P = (ListType *)GetObjectPtr(TabAudioCDFormatList);
firstTrack = StrAToI(FldGetTextPtr(fld3P));
if (firstTrack < 1 || firstTrack > 999) {
TabSetActive(frmP, myTabP, 2);
@ -127,7 +127,7 @@ static Boolean AudioCDTabSave() {
musicInfoP->sound.defaultTrackLength = StrAToI(FldGetTextPtr(fld2P));
musicInfoP->sound.firstTrack = firstTrack;
return true;
}
@ -168,13 +168,13 @@ static void AudioCDTabInit() {
// Volume
static void VolumeTabSave() {
SliderControlType *slid1P, *slid2P, *slid3P, *slid4P, *slid5P;
slid1P = (SliderControlType *)GetObjectPtr(TabVolumeMasterSliderControl);
slid2P = (SliderControlType *)GetObjectPtr(TabVolumeMusicSliderControl);
slid3P = (SliderControlType *)GetObjectPtr(TabVolumeSfxSliderControl);
slid4P = (SliderControlType *)GetObjectPtr(TabVolumeSpeechSliderControl);
slid5P = (SliderControlType *)GetObjectPtr(TabVolumeAudioCDSliderControl);
CtlGetSliderValues ((ControlType *)slid1P, 0, 0, 0, &musicInfoP->volume.master);
CtlGetSliderValues ((ControlType *)slid2P, 0, 0, 0, &musicInfoP->volume.music);
CtlGetSliderValues ((ControlType *)slid3P, 0, 0, 0, &musicInfoP->volume.sfx);
@ -185,7 +185,7 @@ static void VolumeTabSave() {
static void VolumeTabInit() {
SliderControlType *slid1P, *slid2P, *slid3P, *slid4P, *slid5P;
UInt16 value;
slid1P = (SliderControlType *)GetObjectPtr(TabVolumeMasterSliderControl);
slid2P = (SliderControlType *)GetObjectPtr(TabVolumeMusicSliderControl);
slid3P = (SliderControlType *)GetObjectPtr(TabVolumeSfxSliderControl);
@ -238,7 +238,7 @@ static void MusicFormInit(UInt16 index) {
recordH = DmQueryRecord(gameDB, index);
gameInfoP = (GameInfoType *)MemHandleLock(recordH);
if (!gameInfoP) {
FrmCustomAlert(FrmErrorAlert, "An error occured.",0,0);
return;
@ -280,7 +280,7 @@ Boolean MusicFormHandleEvent(EventPtr eventP) {
MusicFormInit(GamGetSelected());
handled = true;
break;
case ctlSelectEvent:
switch (eventP->data.ctlSelect.controlID)
{
@ -291,14 +291,14 @@ Boolean MusicFormHandleEvent(EventPtr eventP) {
lastTab = (eventP->data.ctlSelect.controlID - MusicForm - 1);
TabSetActive(frmP, myTabP, lastTab);
break;
case TabMusicDriverPopTrigger:
FrmList(eventP, TabMusicDriverList);
FrmHideObject(frmP, FrmGetObjectIndex(frmP, TabMusicDriverList));
if (!OPTIONS_TST(kOptDeviceZodiac) && !OPTIONS_TST(kOptSonyPa1LibAPI)) {
ListType *list1P = (ListType *)GetObjectPtr(TabMusicDriverList);
if (LstGetSelection(list1P) == 1) {
FrmCustomAlert(FrmInfoAlert, "There is no built-in MIDI support on your device.", 0, 0);
LstSetSelection(list1P, 0);
@ -310,7 +310,7 @@ Boolean MusicFormHandleEvent(EventPtr eventP) {
case TabSoundRatePopTrigger:
FrmList(eventP, TabSoundRateList);
FrmHideObject(frmP, FrmGetObjectIndex(frmP, TabSoundRateList));
if (!OPTIONS_TST(kOptPalmSoundAPI)) {
ListType *list1P = (ListType *)GetObjectPtr(TabSoundRateList);
@ -358,6 +358,6 @@ Boolean MusicFormHandleEvent(EventPtr eventP) {
default:
break;
}
return handled;
}

View file

@ -11,15 +11,15 @@ TabType *TabNewTabs(UInt16 cnt) {
newP->count = 0;
newP->width = 0;
newP->tabs = new TabDataType[cnt];
return newP;
}
void TabDeleteTabs(TabType *tabP) {
UInt16 cnt, num;
num = MemPtrSize(tabP->tabs) / sizeof(TabDataType);
for (cnt = 0; cnt < num; cnt++)
for (cnt = 0; cnt < num; cnt++)
FrmDeleteForm(tabP->tabs[cnt].srcP);
delete tabP->tabs;
@ -34,14 +34,14 @@ Err TabAddContent(FormType **frmP, TabType *tabP, const Char *nameP, UInt16 rscI
Coord x, y, w, h;
UInt16 id;
RectangleType r;
dstP = (void **)frmP;
srcP = FrmInitForm(rscID);
objNum = FrmGetNumberOfObjects(srcP);
// save tab data
// it's required to keep to source forms active
// while the tab form is not close for list data ptr (items text)
// TODO : fix this !
@ -61,7 +61,7 @@ Err TabAddContent(FormType **frmP, TabType *tabP, const Char *nameP, UInt16 rscI
ControlType *addP = CtlNewControl(dstP, (FrmGetFormId(*frmP) + tabP->count), buttonCtl, nameP, x, y, w, h, stdFont, 0, true);
CtlGlueSetFrameStyle(addP, noButtonFrame);
tabP->width += w + 1;
// create tab content
for (cnt = 0; cnt < objNum; cnt++) {
objP = FrmGetObjectPtr(srcP, cnt);
@ -86,7 +86,7 @@ Err TabAddContent(FormType **frmP, TabType *tabP, const Char *nameP, UInt16 rscI
UInt16 items = LstGetNumberOfItems((ListType *)objP);
UInt16 trigger = id - 1;
trigger = (FrmGetObjectIndex((FormType *)*dstP, trigger) != frmInvalidObjectId) ? trigger : 0;
LstNewList(dstP, id, x, y, w, h, font, visible, trigger);
newP = (ListType *)FrmGetObjectPtr((FormType *)*dstP, FrmGetObjectIndex((FormType *)*dstP, id));
LstSetListChoices(newP, itemsP, items);
@ -174,25 +174,25 @@ void TabSetActive(FormType *frmP, TabType *tabP, UInt16 num) {
// set tabs size
for (cnt = 0; cnt < tabP->count; cnt++) {
idx = FrmGetObjectIndex (frmP, (FrmGetFormId(frmP) + cnt + 1));
if (idx != frmInvalidObjectId) {
FrmGetObjectBounds(frmP, idx, &r);
r.topLeft.y = (num == cnt) ? 17 : 17;
r.extent.y = (num == cnt) ? 12 : 11;
FrmSetObjectBounds(frmP, idx, &r);
if (num == cnt) {
RGBColorType yellow = {0,255,192,0};
r.topLeft.y -= 1;
WinSetForeColor(UIColorGetTableEntryIndex(UIObjectFrame));
WinDrawRectangleFrame(simpleFrame, &r);
WinDrawRectangleFrame(simpleFrame, &r);
WinSetForeColor(WinRGBToIndex(&yellow));
WinDrawLine(r.topLeft.x, r.topLeft.y, r.topLeft.x + r.extent.x - 1, r.topLeft.y);
FrmShowObject(frmP, idx);
} else {
WinSetForeColor(UIColorGetTableEntryIndex(UIObjectFrame));
WinDrawRectangleFrame(simpleFrame, &r);
WinDrawRectangleFrame(simpleFrame, &r);
}
}
}

View file

@ -38,7 +38,7 @@ DmOpenRef gameDB = NULL;
static Err GamUpdateList() {
if (gameDB) {
UInt16 numRecs = DmNumRecords(gameDB);
if (numRecs > 0) {
MemHandle tmpH;
UInt32 version, size;
@ -57,7 +57,7 @@ static Err GamUpdateList() {
GameInfoType gitCur;
void *tmpP;
FormPtr ofmP, frmP;
// show dialog
ofmP = FrmGetActiveForm();
frmP = FrmInitForm(ConvertForm);
@ -73,25 +73,25 @@ static Err GamUpdateList() {
version == itemVersion_25) {
for (index = 0; index < numRecs; index++) {
// get old data
tmpH = DmQueryRecord(gameDB, index);
tmpP = MemHandleLock(tmpH);
MemMove(&gitCur, tmpP, MemHandleSize(tmpH));
MemHandleUnlock(tmpH);
if (version != itemVersion_30) {
gitCur.musicInfo.volume.master = 192;
gitCur.musicInfo.volume.music = 192;
gitCur.musicInfo.volume.sfx = 192;
gitCur.musicInfo.volume.speech = 192;
gitCur.musicInfo.volume.audiocd = 50;
gitCur.musicInfo.sound.tempo = 100;
gitCur.musicInfo.sound.defaultTrackLength = 10;
gitCur.musicInfo.sound.firstTrack = 1;
}
gitCur.engine = 0;
// simply resize the old record
@ -100,13 +100,13 @@ static Err GamUpdateList() {
DmWrite(tmpP, 0, &gitCur, sizeof(GameInfoType));
MemPtrUnlock(tmpP);
}
} else if (version == itemVersion_20) {
// need conversion from V2 -> V2.7
GameInfoTypeV2 git0;
for (index = 0; index < numRecs; index++) {
// get old data
tmpH = DmQueryRecord(gameDB, index);
tmpP = MemHandleLock(tmpH);
@ -121,7 +121,7 @@ static Err GamUpdateList() {
StrCopy(gitCur.pathP, git0.pathP);
StrCopy(gitCur.gameP, git0.gameP);
gitCur.gfxMode = git0.gfxMode;
gitCur.autoLoad = git0.autoLoad;
gitCur.bootParam = git0.bootParam;
gitCur.setPlatform = git0.setPlatform;
@ -139,11 +139,11 @@ static Err GamUpdateList() {
gitCur.musicInfo.volume.sfx = 192;
gitCur.musicInfo.volume.speech = 192;
gitCur.musicInfo.volume.audiocd = 50;
gitCur.musicInfo.sound.tempo = 100;
gitCur.musicInfo.sound.defaultTrackLength = 10;
gitCur.musicInfo.sound.firstTrack = 1;
gitCur.engine = 0;
tmpH = DmResizeRecord(gameDB, index, sizeof(GameInfoType)); // TODO : check error on resize tmpH==NULL
@ -156,7 +156,7 @@ static Err GamUpdateList() {
GameInfoTypeV0 git0;
for (index = 0; index < numRecs; index++) {
// get old data
tmpH = DmQueryRecord(gameDB, index);
tmpP = MemHandleLock(tmpH);
@ -171,7 +171,7 @@ static Err GamUpdateList() {
StrCopy(gitCur.pathP, git0.pathP);
StrCopy(gitCur.gameP, git0.gameP);
gitCur.gfxMode = git0.gfxMode;
gitCur.autoLoad = git0.autoLoad;
gitCur.bootParam = git0.bootParam;
gitCur.setPlatform = git0.amiga; // amiga become platform amiga/atari-st/machintosh
@ -189,11 +189,11 @@ static Err GamUpdateList() {
gitCur.musicInfo.volume.sfx = 192;
gitCur.musicInfo.volume.speech = 192;
gitCur.musicInfo.volume.audiocd = 50;
gitCur.musicInfo.sound.tempo = 100;
gitCur.musicInfo.sound.defaultTrackLength = 10;
gitCur.musicInfo.sound.firstTrack = 1;
gitCur.engine = 0;
tmpH = DmResizeRecord(gameDB, index, sizeof(GameInfoType)); // TODO : check error on resize tmpH==NULL
@ -207,10 +207,10 @@ static Err GamUpdateList() {
FrmDeleteForm(frmP);
if (ofmP)
FrmReturnToForm(MainForm);
}
}
}
}
return errNone;
}
@ -223,7 +223,7 @@ Err GamOpenDatabase() {
err = DmCreateDatabase(0, "ScummVM-Data", appFileCreator, 'DATA', false);
if (!err) {
gameDB = DmOpenDatabaseByTypeCreator( 'DATA', appFileCreator, dmModeReadWrite);
if (!gameDB)
err = DmGetLastErr();
}
@ -241,7 +241,7 @@ void GamImportDatabase() {
if (gPrefs->card.volRefNum != sysInvalidRefNum && gPrefs->card.moveDB) {
FileRef file;
Err e;
e = VFSFileOpen(gPrefs->card.volRefNum, "/Palm/Programs/ScummVM/listdata.pdb", vfsModeRead, &file);
if (!e) {
UInt16 oCardNo, nCardNo;
@ -254,7 +254,7 @@ void GamImportDatabase() {
gPrefs->card.moveDB = false;
return;
}
// get current db info and rename it
DmOpenDatabaseInfo(gameDB, &oDbID, 0, 0, &oCardNo, 0);
GamCloseDatabase(true);
@ -273,7 +273,7 @@ void GamCloseDatabase(Boolean ignoreCardParams) {
if (gameDB) {
LocalID dbID;
UInt16 cardNo;
DmOpenDatabaseInfo(gameDB, &dbID, 0, 0, &cardNo, 0);
DmCloseDatabase(gameDB);
@ -309,13 +309,13 @@ void GamUnselect() {
UInt16 index;
index = GamGetSelected();
if (index != dmMaxRecordIndex) {
Boolean newValue;
recordH = DmGetRecord(gameDB, index);
game = (GameInfoType *)MemHandleLock(recordH);
newValue = false;
DmWrite(game, OffsetOf(GameInfoType,selected), &newValue, sizeof(Boolean));
@ -329,7 +329,7 @@ UInt16 GamGetSelected() {
GameInfoType *game;
Boolean selected;
UInt16 index = DmNumRecords(gameDB)-1;
while (index != (UInt16)-1) {
record = DmQueryRecord(gameDB, index);
game = (GameInfoType *)MemHandleLock(record);
@ -356,7 +356,7 @@ Boolean GamJumpTo(Char letter) {
while (index < maxIndex) {
record = DmGetRecord(gameDB, index);
game = (GameInfoType *)MemHandleLock(record);
if (tolower(game->nameP[0]) == tolower(letter)) {
found = true;
@ -370,7 +370,7 @@ Boolean GamJumpTo(Char letter) {
GamUnselect();
DmWrite(game, OffsetOf(GameInfoType,selected), &newValue, sizeof(Boolean));
if (index < gPrefs->listPosition || index >= (gPrefs->listPosition + maxView))
gPrefs->listPosition = index;
}
@ -380,7 +380,7 @@ Boolean GamJumpTo(Char letter) {
DmReleaseRecord (gameDB, index, 0);
index++;
if (found)
return found;
}

View file

@ -88,7 +88,7 @@ typedef struct {
UInt16 speech;
UInt16 audiocd;
} volume;
struct {
// midi
Boolean multiMidi;
@ -127,13 +127,13 @@ typedef struct {
UInt16 talkValue;
UInt8 platform;
UInt8 language; // |- v2.5
Boolean filter; // v2.6
Boolean fullscreen; // |
Boolean aspectRatio; // |- v2.7
MusicInfoType musicInfo;// v3.0
UInt8 engine; // |- v3.1
} GameInfoType;

View file

@ -42,14 +42,14 @@ enum {
kOpt5WayNavigator = 1 << 0x0A,
kOptPalmSoundAPI = 1 << 0x0B,
kOptSonyPa1LibAPI = 1 << 0x0C,
kOptDeviceProcX86 = 1 << 0x1F // DEBUG only
};
enum {
kMemScummOldCostGames = 0,
kMemScummNewCostGames,
kMemSimon1Games,
kMemSimon1Games,
kMemSimon2Games,
kMemGamesCount
@ -101,15 +101,15 @@ typedef struct {
UInt8 *pageAddr1;
UInt8 *pageAddr2;
} flipping;
struct {
Boolean enable;
UInt8 driver, format;
UInt16 defaultTrackLength;
UInt16 firstTrack;
UInt16 volume;
UInt16 volume;
} CD;
} GlobalsDataType, *GlobalsDataPtr;
extern GlobalsDataPtr gVars;

View file

@ -9,7 +9,7 @@
// _twBmpV3 = offscreen bitmap, must be set before this call
Err ZodiacInit(void **ptrP, Int32 w, Int32 h) {
Err e;
TwGfxSurfaceInfoType surface = {
sizeof(TwGfxSurfaceInfoType),
w, h, w * 2,

View file

@ -5,15 +5,15 @@
static void PnoInit(DmResID resID,PNOInitType *pnoP) {
// Load and allocate PNO
MemHandle armH = DmGetResource('ARMC', resID);
if (armH) {
MemPtr armP = MemHandleLock(armH);
PnoLoad(&pnoP->pnoDesc, armP);
MemPtrUnlock(armP);
DmReleaseResource(armH);
// Init PNO
PnoEntryHeader *header = (PnoEntryHeader *)ALIGN_4BYTE(pnoP->headerBuffer);
PnoEntryHeader *header = (PnoEntryHeader *)ALIGN_4BYTE(pnoP->headerBuffer);
pnoP->alignedHeader = header;
header->r10Value = pnoP->pnoDesc.r10Value;

View file

@ -23,7 +23,7 @@ void MathlibRelease() {
if (MathLibRef != sysInvalidRefNum) {
MathLibClose(MathLibRef, &useCount);
if (!useCount)
SysLibRemove(MathLibRef);
}

View file

@ -7,7 +7,7 @@ static UInt16 autoOffDelay;
void PalmInit(UInt8 init) {
// set screen depth
UInt32 depth = 8;
UInt32 depth = 8;
WinScreenMode(winScreenModeSet, NULL, NULL, &depth, NULL);
if (init & INIT_AUTOOFF) {
@ -27,12 +27,12 @@ Err PalmHRInit(UInt32 depth) {
UInt32 width = 320;
UInt32 height = 320;
Boolean color = true;
e = WinScreenMode (winScreenModeSet, &width, &height, &depth, &color);
if (!e) {
UInt32 attr;
WinScreenGetAttribute(winScreenDensity, &attr);
WinScreenGetAttribute(winScreenDensity, &attr);
e = (attr != kDensityDouble);
}

View file

@ -13,7 +13,7 @@ UInt16 SilkInit(UInt32 *retVersion) {
if (sonySysFtrSysInfoP->libr & sonySysFtrSysInfoLibrSilk) {
if ((e = SysLibFind(sonySysLibNameSilk, &slkRefNum)))
if (e == sysErrLibNotFound)
if (e == sysErrLibNotFound)
e = SysLibLoad(sonySysFileTSilkLib, sonySysFileCSilkLib, &slkRefNum);
if (!e) {
@ -37,7 +37,7 @@ UInt16 SilkInit(UInt32 *retVersion) {
version = 0;
slkRefNum = sysInvalidRefNum;
}
*retVersion = version;
return slkRefNum;
}
@ -66,12 +66,12 @@ UInt16 SonyHRInit(UInt32 depth) {
}
if (e) HRrefNum = sysInvalidRefNum;
if (HRrefNum != sysInvalidRefNum) {
UInt32 width = hrWidth;
UInt32 height = hrHeight;
Boolean color = true;
e = HRWinScreenMode(HRrefNum, winScreenModeSet, &width, &height, &depth, &color);
// error ? release and return an invalid reference number
if (e) {

View file

@ -52,11 +52,11 @@ void ModDelete() {
static void ModSetStack(UInt32 newSize, UInt16 cardNo, LocalID dbID) {
DmOpenRef dbRef = DmOpenDatabase(cardNo, dbID, dmModeReadWrite);
if (dbRef) {
MemHandle pref = DmGetResource('pref',0);
UInt32 size = 0;
if (pref) {
SysAppPrefsType *data = (SysAppPrefsType *)MemHandleLock(pref);
size = data->stackSize;
@ -71,7 +71,7 @@ static void ModSetStack(UInt32 newSize, UInt16 cardNo, LocalID dbID) {
MemPtrUnlock(data);
DmReleaseResource(pref);
}
DmCloseDatabase(dbRef);
}
}
@ -84,7 +84,7 @@ static Err ModImport(UInt16 volRefNum, UInt8 engine) {
{ "sword1" },
{ "sky" }
};
char filename[256];
UInt16 dum1;
UInt32 dum2;
@ -147,10 +147,10 @@ Boolean StartScummVM() {
FormPtr frmP = FrmInitForm(EngineForm);
whichButton = FrmDoDialog(frmP);
FrmDeleteForm(frmP);
if (whichButton == EngineCancelButton)
return false;
engine = (whichButton - Engine0Button);
} else {
@ -168,7 +168,7 @@ Boolean StartScummVM() {
StrCopy(pathP,gameInfoP->pathP);
else
StrCat(pathP,gameInfoP->pathP);
/* // path exists ?
if (!checkPath(pathP)) {
MemHandleUnlock(recordH);
@ -252,7 +252,7 @@ Boolean StartScummVM() {
case 5:
ArgsAdd(&argvP[argc], "--platform=", "windows", &argc);
break;
}
}
}
// subtitles
@ -300,7 +300,7 @@ Boolean StartScummVM() {
ArgsAdd(&argvP[argc], "-e", "towns", &argc);
case 5: // AdLib
ArgsAdd(&argvP[argc], "-e", "adlib", &argc);
}
}
}
else // NULL as default
ArgsAdd(&argvP[argc], "-e", "null", &argc);
@ -347,13 +347,13 @@ Boolean StartScummVM() {
StrIToA(num, gPrefs->debugLevel);
ArgsAdd(&argvP[argc], "-d", num, &argc);
}
if (engine == ENGINE_QUEEN || engine == ENGINE_SKY) {
// alternative intro ?
if (gPrefs->altIntro)
ArgsAdd(&argvP[argc], "--alt-intro", NULL, &argc);
}
if (engine == ENGINE_SCUMM) {
// copy protection ?
if (gPrefs->copyProtection)
@ -370,7 +370,7 @@ Boolean StartScummVM() {
lightspeed= (gPrefs->lightspeed.enable ? gPrefs->lightspeed.mode : 255);
toLauncher= (gPrefs->exitLauncher);
// gVars values
// gVars values
// (gVars->HRrefNum defined in checkHRmode on Clié)
gVars->screenLocked = false;
gVars->volRefNum = gPrefs->card.volRefNum;
@ -379,7 +379,7 @@ Boolean StartScummVM() {
// user params
HWR_RSTALL();
if (!gPrefs->autoOff)
HWR_SET(INIT_AUTOOFF);

View file

@ -31,12 +31,12 @@ static void dummy(Boolean){};
void StdioInit(UInt16 volRefNum, const Char *output, LedProc ledProc) {
gStdioVolRefNum = volRefNum;
if (ledProc)
gStdioLedProc = ledProc;
else
gStdioLedProc = dummy;
VFSFileDelete(gStdioVolRefNum, output);
VFSFileCreate(gStdioVolRefNum, output);
VFSFileOpen (gStdioVolRefNum, output,vfsModeWrite, &gStdioOutput);
@ -48,7 +48,7 @@ void StdioRelease() {
UInt16 fclose(FileRef *stream) {
Err error = VFSFileClose(*stream);
if (error == errNone)
MemPtrFree(stream);
@ -89,7 +89,7 @@ Int16 fgetc(FileRef *stream) {
UInt32 numBytesRead;
Err e;
Char c;
e = VFSFileRead(*stream, 1, &c, &numBytesRead);
return (int)(!e ? c : EOF);
}
@ -102,14 +102,14 @@ Char *fgets(Char *s, UInt32 n, FileRef *stream) {
if (error == errNone || error == vfsErrFileEOF) {
UInt32 reset = 0;
Char *endLine = StrChr(s, '\n');
if (endLine >= s) {
reset = (endLine - s);
s[reset] = 0;
reset = numBytesRead - (reset + 1);
VFSFileSeek(*stream, vfsOriginCurrent, -reset);
}
return s;
}
#ifdef _DEBUG_STDIO
@ -143,7 +143,7 @@ FileRef *fopen(const Char *filename, const Char *type) {
Err err;
UInt16 openMode;
FileRef *fileRefP = (FileRef *)MemPtrNew(sizeof(FileRef *));
if (StrCompare(type,"r")==0)
openMode = vfsModeRead;
else if (StrCompare(type,"rb")==0)
@ -280,7 +280,7 @@ UInt32 ftell(FileRef *stream) {
e = VFSFileTell(*stream,&filePos);
if (e != errNone)
return e;
return filePos;
}
@ -323,7 +323,7 @@ Int32 sprintf(Char* s, const Char* formatStr, ...) {
va_start(va, formatStr);
count = vsprintf(s, formatStr, va);
va_end(va);
return count;
}
@ -335,7 +335,7 @@ Int32 snprintf(Char* s, UInt32 len, const Char* formatStr, ...) {
va_start(va, formatStr);
count = vsprintf(s, formatStr, va);
va_end(va);
return count;
}
@ -354,11 +354,11 @@ static Char *StrIToBase(Char *s, Int32 i, UInt8 b) {
Char o;
Int16 c, n = 0;
Int32 div, mod;
do {
div = i / b;
mod = i % b;
s[n++] = *(conv + mod);
i = div;
@ -384,7 +384,7 @@ static Char *StrIToBase(Char *s, Int32 i, UInt8 b) {
static void StrProcC_(Char *ioStr, UInt16 maxLen) {
Char *found;
Int16 length;
while (found = StrStr(ioStr, "`c`")) {
if (found[3] == 0) { // if next char is NULL
length = maxLen - (found - ioStr + 2);
@ -398,10 +398,10 @@ static void StrProcXO(Char *ioStr, UInt16 maxLen, Char *tmp) {
Char *found, *last, mod, fill;
Int16 len, count, next;
Int32 val;
while (found = StrChr(ioStr, '`')) {
last = StrChr(found + 1, '`');
if (!last)
return;
@ -417,7 +417,7 @@ static void StrProcXO(Char *ioStr, UInt16 maxLen, Char *tmp) {
// x and X always 8char on palmos ... o set to 8char (not supported on palmos)
while (found[next] == '0' || found[next] == ' ') // WARNING : reduce size only (TODO ?)
next++;
// convert to base 8
if (mod == 'o') {
StrNCopy(tmp, found + next, 8 - next);
@ -434,7 +434,7 @@ static void StrProcXO(Char *ioStr, UInt16 maxLen, Char *tmp) {
if ((8 - next) > count)
count = 8 - next;
if (count == 0)
count = 1;
@ -455,12 +455,12 @@ static void StrProcXO(Char *ioStr, UInt16 maxLen, Char *tmp) {
Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) {
Char format[256], result[256], tmp[32];
Char *found, *mod, *num;
UInt32 next;
Boolean zero;
Int16 count, len;
MemSet(format, sizeof(format), 'x');
MemSet(result, sizeof(result), 'y');
MemSet(tmp, sizeof(tmp), 'z');
@ -470,7 +470,7 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) {
while (found = StrChr(format + next, '%')) {
mod = found + 1;
if (*mod == '%') { // just a % ?
mod++;
@ -479,7 +479,7 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) {
*mod == '-' ||
*mod == ' ' ) // skip
mod++;
if (*mod == '0' ||
*mod == '.' ) {
*mod++ = '0';
@ -487,12 +487,12 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) {
} else {
zero = false;
}
num = mod;
while ( *mod >= '0' &&
*mod <= '9' ) // search format char
mod++;
// get the numeric value
if (num < mod) {
StrNCopy(tmp, num, mod - num);
@ -514,19 +514,19 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) {
} else {
len = 0;
switch (*mod) {
case 'x':
case 'X':
case 'o':
tmp[0] = '`';
tmp[1] = (zero) ? '0' : ' ';
tmp[2] = *mod;
tmp[2] = *mod;
StrIToA(tmp + 3, count);
len += StrLen(tmp);
tmp[len++] = '`';
tmp[len] = 0;
if (*mod == 'o') { // set as base 10 num and convert later
*mod = 'd';
count = 8; // force 8char
@ -534,7 +534,7 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) {
break;
}
StrNCopy(tmp + len, found, (num - found));
len += (num - found);
@ -542,12 +542,12 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) {
StrIToA(tmp + len, count);
len += StrLen(tmp + len);
}
if (*mod == 'd' ||
*mod == 'i' ||
*mod == 'x' ||
*mod == 'X' ||
*mod == 'u'
*mod == 'u'
) {
tmp[len++] = 'l';
}
@ -561,15 +561,15 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) {
StrNCopy(found, tmp, StrLen(tmp));
mod = found + StrLen(tmp);
}
next = (mod - format);
}
// Copy result in a temp buffer to process last formats
StrVPrintF(result, format, argParam);
StrProcC_(result, 256);
StrProcXO(result, 256, tmp);
StrCopy(s, result);
return StrLen(s);
}

View file

@ -24,21 +24,21 @@
void *bsearch(const void *key, const void *base, UInt32 nmemb, UInt32 size, int (*compar)(const void *, const void *)) {
Int32 position;
if (SysBinarySearch(base, nmemb, size, (SearchFuncPtr)compar, key, 0, &position, true))
return (void *)((UInt32)base + size * position);
return NULL;
}
long strtol(const char *s, char **endptr, int base) {
// WARNING : only base = 10 supported
long val = StrAToI(s);
if (endptr) {
Char str[maxStrIToALen];
StrIToA(str, val);
if (StrNCompare(s, str, StrLen(str)) == 0)
*endptr = (char *)s + StrLen(str);
}
@ -65,18 +65,18 @@ Err free(MemPtr memP) {
}
MemPtr realloc(MemPtr oldP, UInt32 size) {
if (oldP != NULL)
if (MemPtrResize(oldP,size) == 0)
return oldP;
MemPtr newP = MemPtrNew(size);
if (oldP!=NULL)
{
MemMove(newP,oldP,MemPtrSize(oldP));
MemPtrFree(oldP);
}
}
return newP;
}

View file

@ -27,14 +27,14 @@ void *memchr(const void *s, int c, UInt32 n) {
for(chr = 0; chr < n;chr++,((UInt8 *)s)++)
if ( *((UInt8 *)s) == c)
return (void *)s;
return NULL;
}
UInt32 strspn(const char *s1, const char *s2) {
UInt32 chr = 0;
while ( chr < strlen(s1) &&
while ( chr < strlen(s1) &&
strchr(s2, s1[chr]) )
chr++;
@ -88,13 +88,13 @@ Char *strtok(Char *str, const Char *sep) {
Char *strpbrk(const Char *s1, const Char *s2) {
Char *found;
UInt32 n;
for (n=0; n <= StrLen(s2); n++) {
found = StrChr(s1, s2[n]);
if (found)
return found;
}
return NULL;
}
@ -107,7 +107,7 @@ Char *strrchr(const Char *s, int c) {
return (Char *)(s+chr);
return NULL;
}
}
Char *strdup(const Char *s1) {
Char* buf = (Char *)MemPtrNew(StrLen(s1)+1);

View file

@ -29,10 +29,10 @@ time_t time(time_t *tloc) {
DateTimeType Epoch = {1, 0, 0, 1, 1, 1970, 0}; // form 1/1/1904 12AM to 1/1/1970 12AM
secs -= TimDateTimeToSeconds (&Epoch);
if (tloc)
*tloc = secs;
return (secs);
}
@ -47,7 +47,7 @@ struct tm *localtime(const time_t *timer) {
secs += TimDateTimeToSeconds(&Epoch);
TimSecondsToDateTime (secs, &dt);
tmDate.tm_sec = dt.second;
tmDate.tm_min = dt.minute;
tmDate.tm_hour = dt.hour;
@ -55,6 +55,6 @@ struct tm *localtime(const time_t *timer) {
tmDate.tm_mon = dt.month - 1;
tmDate.tm_year = dt.year - 1900;
tmDate.tm_wday = dt.weekDay;
return &tmDate;
}

View file

@ -27,7 +27,7 @@ const Char *gUnistdCWD = NULL;
// currently used only to retreive savepath
Char *getcwd(Char *buf, UInt32 size) {
Char *copy = buf;
if (gUnistdCWD) {
if (!copy)
copy = (Char *)MemPtrNew(StrLen(gUnistdCWD)); // this may never occured

View file

@ -19,5 +19,5 @@
* $Header$
*
*/
#include "string.h"

View file

@ -43,8 +43,8 @@ typedef UInt32 size_t;
#define vsnprintf(a,b,c,d) vsprintf(a,c,d)
#define getc(a) fgetc(a)
#define SEEK_SET vfsOriginBeginning
#define SEEK_CUR vfsOriginCurrent
#define SEEK_SET vfsOriginBeginning
#define SEEK_CUR vfsOriginCurrent
#define SEEK_END vfsOriginEnd
UInt16 fclose (FileRef *stream);

View file

@ -27,6 +27,6 @@
extern const Char *gUnistdCWD;
Char *getcwd(Char *buf, UInt32 size);
Char *getcwd(Char *buf, UInt32 size);
#endif

View file

@ -34,7 +34,7 @@ void run(int argc, char *argv[]) {
// create file for printf, warnings, etc...
StdioInit(gVars->volRefNum, "/PALM/Programs/ScummVM/scumm.log", DrawStatus);
gUnistdCWD = SCUMMVM_SAVEPATH;
// init hardware
if (HWR_INIT(INIT_PA1LIB)) Pa1libInit();
if (HWR_INIT(INIT_VIBRATOR)) gVars->vibrator = RumbleInit();
@ -59,7 +59,7 @@ void run(int argc, char *argv[]) {
if (HWR_INIT(INIT_ARM)) ARMRelease();
if (HWR_INIT(INIT_VIBRATOR)) RumbleRelease();
if (HWR_INIT(INIT_PA1LIB)) Pa1libRelease();
// close log file
StdioRelease();
@ -85,7 +85,7 @@ static UInt32 ModulesPalmMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
LocalID dbID;
LaunchParamType *lp = (LaunchParamType *)cmdPBP;
gVars = lp->gVars;
argvP = lp->args.argv;
@ -105,7 +105,7 @@ static UInt32 ModulesPalmMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
// MemPtrSetOwner(gVars, ownerID);
// ArgsSetOwner(argvP, ownerID); // will be freed by main(...)
// MemPtrFree(lp); // will be freed by the system on exit
run(lp->args.argc, argvP);
cardNo = 0;

View file

@ -15,7 +15,7 @@ typedef struct {
UInt8 argc;
Char **argv;
} args;
GlobalsDataPtr gVars;
} LaunchParamType;

View file

@ -119,7 +119,7 @@ void OSystem_PALMOS::setWindowCaption(const char *caption) {
// erase the screen
WinEraseWindow();
if (_useHRmode) {
y = 160 - (h >> 1) - 10;
HRFntSetFont(gVars->HRrefNum,hrTinyBoldFont);
@ -140,7 +140,7 @@ void OSystem_PALMOS::setWindowCaption(const char *caption) {
size = 2;
h = (h - 2) / 2 + 2;
}
BitmapTypeV3 *bmp2P;
BitmapType *bmp1P = BmpCreate(320, (h << 1), 8, NULL, &e);
WinHandle tmpH = WinCreateBitmapWindow(bmp1P, &e);
@ -206,7 +206,7 @@ void OSystem_PALMOS::quit() {
free(_currentPalette);
free(_mouseBackupP);
free(_mouseDataP);
if (_cdPlayer) {
_cdPlayer->release();
_cdPlayer = NULL;
@ -224,9 +224,9 @@ OSystem_PALMOS::OSystem_PALMOS() {
_paletteDirtyStart = 0;
_paletteDirtyEnd = 0;
memset(&_sound, 0, sizeof(SoundDataType));
_currentPalette = NULL;
_modeChanged = false;
_gfxLoaded = false;
@ -234,7 +234,7 @@ OSystem_PALMOS::OSystem_PALMOS() {
_lastKeyPressed = kLastKeyNone;
_lastKeyRepeat = 100;
_lastKeyModifier = MD_NONE;
_useNumPad = false;
_showBatLow = false;
@ -248,14 +248,14 @@ OSystem_PALMOS::OSystem_PALMOS() {
_currentPalette = (RGBColorType*)calloc(sizeof(RGBColorType), 256);
_mouseBackupP = (byte*)malloc(MAX_MOUSE_W * MAX_MOUSE_H);
// overlay
_tmpScreenP = NULL;
_tmpBackupP = NULL;
// HiRes
_useHRmode = (gVars->HRrefNum != sysInvalidRefNum);
// mouse emu
// TODO : add UX50 arrow keys
if (OPTIONS_TST(kOpt5WayNavigator)) {
@ -272,7 +272,7 @@ OSystem_PALMOS::OSystem_PALMOS() {
_keyMouse.bitButLeft= keyBitHard3|0x00100000; // keyBitRockerCenter on TwKeys.h but conflict with palmnavigator.h
}
_keyMask = (_keyMouse.bitUp | _keyMouse.bitDown | _keyMouse.bitLeft | _keyMouse.bitRight | _keyMouse.bitButLeft);
// enable cdrom ?
_cdPlayer = NULL;
if (gVars->CD.enable) {
@ -287,7 +287,7 @@ OSystem_PALMOS::OSystem_PALMOS() {
_cdPlayer = new PckTunesCDPlayer(this);
break;
}
if (_cdPlayer) {
if (!_cdPlayer->init()) {
_cdPlayer->release();
@ -295,7 +295,7 @@ OSystem_PALMOS::OSystem_PALMOS() {
}
}
}
// sound
memset(&_sound,0,sizeof(SoundDataType));
}

View file

@ -72,7 +72,7 @@ public:
bool setGraphicsMode(int mode);
int getGraphicsMode() const;
int getDefaultGraphicsMode() const;
int getOutputSampleRate() const;
bool openCD(int drive);
void setWindowCaption(const char *caption); // TODO : _inGame = true = don't set
@ -111,17 +111,17 @@ public:
// 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.
// Returns true if an event was retrieved.
bool pollEvent(Event &event);
void SimulateArrowKeys(Event &event, Int8 iHoriz, Int8 iVert);
/** @name Sound */
@ -133,14 +133,14 @@ public:
* @param param an arbitrary parameter which is stored and passed to proc.
*/
bool setSoundCallback(SoundProc proc, void *param);
/**
* Remove any audio callback previously set via setSoundCallback, thus effectively
* stopping all audio output immediately.
* @see setSoundCallback
*/
void clearSoundCallback();
//@}
//@}
// Poll cdrom status
// Returns true if cd audio is playing
@ -239,9 +239,9 @@ private:
int _current_shake_pos;
int _new_shake_pos;
byte _mouseKeyColor;
UInt32 _exit_delay;
struct {
uint32 duration, nextExpiry;
bool active;
@ -258,10 +258,10 @@ private:
void draw_mouse();
void undraw_mouse();
void sound_handler();
void timer_handler(UInt32 current_msecs);
void getCoordinates(EventPtr event, Coord *x, Coord *y);
void draw1BitGfx(UInt16 id, Int32 x, Int32 y, Boolean clear);
@ -283,12 +283,12 @@ private:
enum {
kLastKeyNone = 0,
kLastKeyMouse = 1 << 0,
kLastKeyCalc = 1 << 30,
kLastKeyAny = 1 << 31
};
UInt32 _keyMask;
struct {
UInt32 bitUp;
@ -301,7 +301,7 @@ private:
Int32 _lastKeyPressed;
UInt32 _lastKeyRepeat;
UInt8 _lastKeyModifier;
Boolean _useNumPad;
Boolean _useHRmode;
@ -311,7 +311,7 @@ private:
void init_intern();
};
Err HwrDisplayPalette(UInt8 operation, Int16 startIndex,
Err HwrDisplayPalette(UInt8 operation, Int16 startIndex,
UInt16 paletteEntries, RGBColorType *tableP)
SYS_TRAP(sysTrapHwrDisplayPalette);

View file

@ -75,7 +75,7 @@ void OSystem_PALMOS::getCoordinates(EventPtr event, Coord *x, Coord *y) {
// wide landscape
if (OPTIONS_TST(kOptModeLandscape)) {
// zodiac have mutliple ratio
// zodiac have mutliple ratio
if (OPTIONS_TST(kOptDeviceZodiac)) {
Int32 w,h;
@ -94,7 +94,7 @@ void OSystem_PALMOS::getCoordinates(EventPtr event, Coord *x, Coord *y) {
// wide portrait, only for 320x200
} else {
*y = ((event->screenX - _screenOffset.y) << 1) / 3;
*x = 320 - ((event->screenY - _screenOffset.x) << 1) / 3 - 1;
*x = 320 - ((event->screenY - _screenOffset.x) << 1) / 3 - 1;
}
// normal coord
@ -137,12 +137,12 @@ bool OSystem_PALMOS::pollEvent(Event &event) {
sy = -1;
else if (keyCurrentState & _keyMouse.bitDown)
sy = +1;
if (keyCurrentState & _keyMouse.bitLeft)
sx = -1;
else if (keyCurrentState & _keyMouse.bitRight)
sx = +1;
sx = +1;
SimulateArrowKeys(event, sx, sy);
updateScreen();
updateCD();
@ -161,7 +161,7 @@ bool OSystem_PALMOS::pollEvent(Event &event) {
if (ev.eType == keyDownEvent) {
switch (ev.data.keyDown.chr) {
// ESC key
case vchrLaunch:
_lastKeyPressed = kLastKeyNone;
@ -170,7 +170,7 @@ bool OSystem_PALMOS::pollEvent(Event &event) {
event.kbd.ascii = 27;
event.kbd.flags = 0;
return true;
// F5 = menu
case vchrJogPushRepeat:
case vchrMenu:
@ -204,7 +204,7 @@ bool OSystem_PALMOS::pollEvent(Event &event) {
return true;
case vchrJogPushedUp:
case vchrJogPushedDown: // hot swap gfx mode
case vchrJogPushedDown: // hot swap gfx mode
if (_initMode == GFX_WIDE)
hotswap_gfx_mode(_mode == GFX_WIDE ? GFX_NORMAL: GFX_WIDE);
else
@ -238,7 +238,7 @@ bool OSystem_PALMOS::pollEvent(Event &event) {
if (OPTIONS_TST(kOptPalmSoundAPI) && _sound.active)
SndStreamPause(*((SndStreamRef *)_sound.handle), true);
break;
case vchrLateWakeup:
// resume the sound thread if any
if (OPTIONS_TST(kOptPalmSoundAPI) && _sound.active)
@ -265,7 +265,7 @@ bool OSystem_PALMOS::pollEvent(Event &event) {
event.kbd.ascii = 27;
event.kbd.flags = 0;
return true;
// F5 = menu
case vchrHard3:
_lastKeyPressed = kLastKeyNone;
@ -279,10 +279,10 @@ bool OSystem_PALMOS::pollEvent(Event &event) {
}
// prevent crash when alarm is raised
handled = ((ev.eType == keyDownEvent) &&
(ev.data.keyDown.modifiers & commandKeyMask) &&
((ev.data.keyDown.chr == vchrAttnStateChanged) ||
(ev.data.keyDown.chr == vchrAttnUnsnooze)));
handled = ((ev.eType == keyDownEvent) &&
(ev.data.keyDown.modifiers & commandKeyMask) &&
((ev.data.keyDown.chr == vchrAttnStateChanged) ||
(ev.data.keyDown.chr == vchrAttnUnsnooze)));
// graffiti strokes, auto-off, etc...
if (!handled)
@ -299,7 +299,7 @@ bool OSystem_PALMOS::pollEvent(Event &event) {
if (ev.data.keyDown.chr == vchrCommand && (ev.data.keyDown.modifiers & commandKeyMask)) {
_lastKeyModifier++;
_lastKeyModifier %= 4;
if (_lastKeyModifier)
draw1BitGfx((kDrawKeyState + _lastKeyModifier - 1), 2, _screenHeight + 2, true);
else
@ -312,14 +312,14 @@ bool OSystem_PALMOS::pollEvent(Event &event) {
if (_lastKeyModifier == MD_CMD) b = KBD_CTRL|KBD_ALT;
if (_lastKeyModifier == MD_ALT) b = KBD_ALT;
if (_lastKeyModifier == MD_CTRL) b = KBD_CTRL;
keycode = ev.data.keyDown.chr;
// F1 -> F10 key
if (keycode >= '0' && keycode <= '9' && b == (KBD_CTRL|KBD_ALT)) {
keycode = keycode == '0' ? 324 : (315 + keycode - '1');
b = 0;
} else if ((keycode == 'z' && b == KBD_CTRL) || (b == KBD_ALT && keycode == 'x')) {
event.type = EVENT_QUIT;
return true;
@ -343,12 +343,12 @@ bool OSystem_PALMOS::pollEvent(Event &event) {
setFeatureState(kFeatureFullscreenMode, !_fullscreen);
#endif
}
event.type = EVENT_KEYDOWN;
event.kbd.keycode = keycode;
event.kbd.ascii = keycode; //(keycode>='a' && keycode<='z' && (event.kbd.flags & KBD_SHIFT) ? keycode &~ 0x20 : keycode);
event.kbd.flags = b;
if (_lastKeyModifier) {
_lastKeyModifier = MD_NONE;
draw1BitGfx(kDrawKeyState, 2, getHeight() + 2, false);
@ -383,10 +383,10 @@ bool OSystem_PALMOS::pollEvent(Event &event) {
if (y >= y2 && y < (y2 + 34) && x >= x2 && x < (x2 + 40)) { // numpad location
UInt8 key = '1';
key += 9 - ( (3 - ((x - x2) / 13)) + (3 * ((y - y2) / 11)) );
_lastEvent = keyDownEvent;
_lastKeyPressed = kLastKeyNone;
event.type = EVENT_KEYDOWN;
event.kbd.keycode = key;
event.kbd.ascii = key;

View file

@ -68,7 +68,7 @@ bool OSystem_PALMOS::setGraphicsMode(int mode) {
case GFX_WIDE:
_setMode = mode;
break;
default:
warning("unknown gfx mode %d", mode);
_setMode = GFX_NORMAL;
@ -103,10 +103,10 @@ void OSystem_PALMOS::initSize(uint w, uint h, int overlayScale) {
SysSetOrientationTriggerState(sysOrientationTriggerDisabled);
set_mouse_pos(200,150);
unload_gfx_mode();
// force WIDE mode for 640x480 games
// force WIDE mode for 640x480 games
if (h == 480)
_setMode = GFX_WIDE;
@ -145,14 +145,14 @@ void OSystem_PALMOS::load_gfx_mode() {
// get the actual palette
WinPalette(winPaletteGet, 0, 256, _currentPalette);
// set only if _mode not changed
const byte startupPalette[] = {
0 ,0 ,0 ,0,
0 ,0 ,171,0,
0 ,171, 0 ,0,
0 ,171,171,0,
171 ,0 ,0 ,0,
171 ,0 ,0 ,0,
171 ,0 ,171,0,
171 ,87 ,0 ,0,
171 ,171,171,0,
@ -267,7 +267,7 @@ void OSystem_PALMOS::load_gfx_mode() {
_offScreenP = WinScreenLock(winLockErase) + _screenOffset.addr;
_screenP = _offScreenP;
_offScreenH = WinGetDisplayWindow();
_screenH = _offScreenH;
_screenH = _offScreenH;
_renderer_proc = &OSystem_PALMOS::updateScreen_flipping;
break;
case GFX_WIDE:
@ -287,11 +287,11 @@ void OSystem_PALMOS::load_gfx_mode() {
_screenP = (byte *)(BmpGetBits(WinGetBitmap(_screenH)));
_renderer_proc = &OSystem_PALMOS::updateScreen_wideZodiac;
} else
#endif
#endif
{
gVars->screenLocked = true;
_screenP = WinScreenLock(winLockErase) + _screenOffset.addr;
_renderer_proc = (OPTIONS_TST(kOptModeLandscape)) ?
&OSystem_PALMOS::updateScreen_wideLandscape :
&OSystem_PALMOS::updateScreen_widePortrait;
@ -324,7 +324,7 @@ void OSystem_PALMOS::load_gfx_mode() {
_gfxLoaded = true;
}
}
void OSystem_PALMOS::unload_gfx_mode() {
@ -407,25 +407,25 @@ void OSystem_PALMOS::hotswap_gfx_mode(int mode) {
DmWrite(dst, offset, src, _screenWidth);
offset += _screenWidth;
src += _offScreenPitch;
} while (--h);
} while (--h);
_modeChanged = true;
// reset offscreen pitch
_offScreenPitch = gVars->screenPitch;
// free old mode memory
unload_gfx_mode();
// load new gfx mode
_mode = mode;
load_gfx_mode();
// restore offscreen
WinPalette(winPaletteSet, 0, 256, _currentPalette);
clearScreen();
copyRectToScreen(_tmpHotSwapP, _screenWidth, 0, 0, _screenWidth, _screenHeight);
_modeChanged = false;
// force palette update
_paletteDirtyStart = 0;
_paletteDirtyEnd = 256;
@ -483,7 +483,7 @@ byte OSystem_PALMOS::RGBToColor(uint8 r, uint8 g, uint8 b) {
}
}
}
return color;
}
@ -549,7 +549,7 @@ void OSystem_PALMOS::copyRectToScreen(const byte *buf, int pitch, int x, int y,
void OSystem_PALMOS::updateScreen() {
// Check whether the palette was changed in the meantime and update the
// screen surface accordingly.
// screen surface accordingly.
if (_paletteDirtyEnd != 0) {
UInt8 oldCol;
@ -563,11 +563,11 @@ void OSystem_PALMOS::updateScreen() {
oldCol = gVars->indicator.on;
gVars->indicator.on = RGBToColor(0,255,0);
if (oldCol != gVars->indicator.on) {
if (oldCol != gVars->indicator.on) {
// redraw if needed
if (_lastKeyModifier)
draw1BitGfx((kDrawKeyState + _lastKeyModifier - 1), 2, getHeight() + 2, true);
if(_useNumPad)
draw1BitGfx(kDrawNumPad, (getWidth() >> 1) - 32, getHeight() + 2, true);
@ -583,7 +583,7 @@ void OSystem_PALMOS::updateScreen() {
byte *src = _tmpScreenP;
byte *dst = _offScreenP;
UInt16 h = _screenHeight;
do {
memcpy(dst, src, _screenWidth);
dst += _offScreenPitch;
@ -600,7 +600,7 @@ void OSystem_PALMOS::draw1BitGfx(UInt16 id, Int32 x, Int32 y, Boolean show) {
return;
MemHandle hTemp = DmGetResource(bitmapRsc, id);
if (hTemp) {
BitmapType *bmTemp;
UInt32 *bmData;
@ -619,12 +619,12 @@ void OSystem_PALMOS::draw1BitGfx(UInt16 id, Int32 x, Int32 y, Boolean show) {
if (next)
blocks++;
for (ih = 0; ih < h; ih++) { // line
for (ib = 0; ib < blocks; ib++) { // 32pix block
next = w - (ib << 5);
next = MIN(next, (Coord)32);
for (iw = 0; iw < next; iw++) { // row
*scr++ = ((*bmData & (1 << (31 - iw))) && show) ?

View file

@ -26,7 +26,7 @@
bool OSystem_PALMOS::showMouse(bool visible) {
if (_mouseVisible == visible)
return visible;
bool last = _mouseVisible;
_mouseVisible = visible;
@ -133,7 +133,7 @@ void OSystem_PALMOS::draw_mouse() {
} else {
int offset = y * _screenWidth + x;
dst = _tmpScreenP;
while (h > 0) {
width = w;
while (width > 0) {

View file

@ -35,7 +35,7 @@ void OSystem_PALMOS::showOverlay() {
DmWrite(dst, offset, src, _screenWidth);
offset += _screenWidth;
src += _offScreenPitch;
} while (--h);
} while (--h);
_overlayVisible = true;
clearOverlay();
@ -109,9 +109,9 @@ void OSystem_PALMOS::copyRectToOverlay(const byte *buf, int pitch, int x, int y,
/* RectangleType mouse = {_mouseCurState.x, _mouseCurState.y, _mouseCurState.w, _mouseCurState.h};
RectangleType copy = {x, y, w, h};
RectangleType result;
RctGetIntersection(&mouse, &copy, &result);
if (result.extent.x !=0 && result.extent.y !=0)*/
undraw_mouse();
}

View file

@ -84,10 +84,10 @@ void OSystem_PALMOS::updateScreen_wideZodiac() {
// clear bottom
RctSetRectangle(&r, 0, _screenOffset.y + h, 480, _current_shake_pos);
WinFillRectangle(&r, 0);
destRect.y += _new_shake_pos;
_screenOffset.y += _new_shake_pos;
rumblePack(_new_shake_pos >= 3);
_current_shake_pos = _new_shake_pos;
}
@ -95,7 +95,7 @@ void OSystem_PALMOS::updateScreen_wideZodiac() {
// update screen
WinSetDrawWindow(WinGetDisplayWindow());
e = TwGfxDrawPalmBitmap((TwGfxSurfaceType *)_twSrc, &destPoint, (BitmapPtr)_twBmpV3);
e = TwGfxStretchBlt2((TwGfxSurfaceType *)_twDst, &destRect, (TwGfxSurfaceType *)_twSrc, &srcRect, twGfxStretchFast| (gVars->filter ? twGfxStretchSmooth : 0));
e = TwGfxStretchBlt2((TwGfxSurfaceType *)_twDst, &destRect, (TwGfxSurfaceType *)_twSrc, &srcRect, twGfxStretchFast| (gVars->filter ? twGfxStretchSmooth : 0));
}
#endif
@ -114,13 +114,13 @@ void OSystem_PALMOS::updateScreen_widePortrait() {
// clear bottom
RctSetRectangle(&r, _screenOffset.y + 300, 0, _current_shake_pos, 480);
WinFillRectangle(&r, 0);
dst += _new_shake_pos;
rumblePack(_new_shake_pos >= 3);
_current_shake_pos = _new_shake_pos;
}
// update screen
ARM_START(WideType)
ARM_INIT(COMMON_WPORTRAIT)
@ -177,13 +177,13 @@ void OSystem_PALMOS::updateScreen_wideLandscape() {
// clear bottom
RctSetRectangle(&r, 0, _screenOffset.y + 300, 480, _current_shake_pos);
WinFillRectangle(&r, 0);
dst += _new_shake_pos * 480;
rumblePack(_new_shake_pos >= 3);
_current_shake_pos = _new_shake_pos;
}
// update screen
ARM_START(WideType)
ARM_INIT(COMMON_WLANDSCAPE)

View file

@ -32,7 +32,7 @@ class PalmSaveFile : public Common::SaveFile {
public:
PalmSaveFile(const char *filename, bool saveOrLoad);
~PalmSaveFile();
bool isOpen() const { return file != NULL; }
uint32 read(void *buf, uint32 size);
@ -56,15 +56,15 @@ PalmSaveFile::PalmSaveFile(const char *filename, bool saveOrLoad) {
if (file) {
if (saveOrLoad) {
_readWriteData = (byte *)malloc(MAX_BLOCK);
} else {
// read : cache the whole file
::fseek(file, 0, SEEK_END);
length = ::ftell(file);
::fseek(file, 0, SEEK_SET);
_readWriteData = (byte *)malloc(length);
_readWritePos = 0;
_readWritePos = 0;
if (_readWriteData)
::fread(_readWriteData, 1, length, file);
@ -76,7 +76,7 @@ PalmSaveFile::~PalmSaveFile() {
if (file) {
if (_needDump)
::fwrite(_readWriteData, _readWritePos, 1, file);
if (_readWriteData)
free(_readWriteData);

View file

@ -51,18 +51,18 @@ bool OSystem_PALMOS::setSoundCallback(SoundProc proc, void *param) {
_sound.active = true; // always true when we call this function
_sound.dataP = NULL; // required by sound_handler
_sound.handle = NULL;
if (ConfMan.hasKey("output_rate"))
_samplesPerSec = ConfMan.getInt("output_rate");
else
_samplesPerSec = 8000; // default value
// try to create sound stream
if (OPTIONS_TST(kOptPalmSoundAPI)) {
void *sndFuncP;
_sound.handle = MemPtrNew(sizeof(SndStreamRef));
sndFuncP = sndCallback;
sndFuncP = sndCallback;
Err e = SndStreamCreateExtended(
(SndStreamRef *)_sound.handle,
@ -83,14 +83,14 @@ bool OSystem_PALMOS::setSoundCallback(SoundProc proc, void *param) {
_sound.set = false;
_sound.wait = true;
success = (e == errNone);
} else if (OPTIONS_TST(kOptSonyPa1LibAPI)) {
static CallbackInfoType cbData;
_sound.handle = MemPtrNew(sizeof(UInt8));
cbData.funcP = &ClieSoundCallback;
cbData.dwUserData = (UInt32)&_sound;
_sound.size = SND_BLOCK;
_sound.set = false;
_sound.wait = true;
@ -101,7 +101,7 @@ bool OSystem_PALMOS::setSoundCallback(SoundProc proc, void *param) {
Pa1Lib_adpcmOpen(ADPCM_8_KHZ, (UInt8 *)_sound.tmpP, MemPtrSize(_sound.tmpP), &cbData, (UInt8 *)_sound.handle);
}
// failed or not supported
// failed or not supported
if (!success) {
_sound.size = SND_BLOCK;
_sound.set = false;
@ -125,7 +125,7 @@ void OSystem_PALMOS::clearSoundCallback() {
free(_sound.tmpP);
free(_sound.handle);
}
_sound.active = false;
_sound.dataP = NULL;
@ -139,9 +139,9 @@ void OSystem_PALMOS::sound_handler() {
if (!_sound.dataP)
_sound.dataP = MemPtrNew(_sound.size);
((SoundProc)_sound.proc)(_sound.param, (byte *)_sound.dataP, _sound.size);
if (OPTIONS_TST(kOptSonyPa1LibAPI)) {
pcm2adpcm((Int16 *)_sound.dataP, (UInt8 *)_sound.tmpP, _sound.size);
_sound.set = Pa1Lib_adpcmStart(*((UInt8 *)_sound.handle), ADPCM_MODE_NONCONTINUOUS_PB|ADPCM_MODE_INTERRUPT_MODE);
@ -174,7 +174,7 @@ void OSystem_PALMOS::playCD(int track, int num_loops, int start_frame, int durat
bool OSystem_PALMOS::pollCD() {
if (!_cdPlayer)
return false;
return _cdPlayer->poll();
}

View file

@ -20,7 +20,7 @@ Boolean RumbleExists() {
exists = true;
TwDeviceClose(hRumble);
}
} else
#endif
{
@ -49,7 +49,7 @@ void RumbleRun(Boolean active) {
} else {
TwDeviceControl(hRumble, 'stop', 0, 0);
}
} else
#endif
{
@ -81,7 +81,7 @@ Boolean RumbleInit() {
HwrVibrateAttributes(1, kHwrVibratePattern, &pattern);
HwrVibrateAttributes(1, kHwrVibrateDelay, &delay);
HwrVibrateAttributes(1, kHwrVibrateRepeatCount, &repeat);
done = true;
}
}
@ -93,7 +93,7 @@ void RumbleRelease() {
#ifndef DISABLE_TAPWAVE
if (OPTIONS_TST(kOptDeviceZodiac)) {
TwDeviceClose(hRumble);
} else
#endif
{

View file

@ -105,7 +105,7 @@ static DmOpenRef GlbOpenInternal(const Char *nameP) {
if (dbID) {
UInt32 dbType, dbCreator;
Err e = DmDatabaseInfo(0, dbID, 0, 0, 0, 0, 0, 0, 0, 0, 0, &dbType, &dbCreator);
if (!e && dbType == 'GLBS' && dbCreator == appFileCreator)
return DmOpenDatabase(0, dbID, dmModeReadOnly);
}

View file

@ -37,7 +37,7 @@ MemPtr SknScreenLock(WinLockInitType initMode) {
if (!OPTIONS_TST(kOptDeviceZodiac)) {
WinSetDrawWindow(WinGetDisplayWindow());
// WARNING : this doesn't work on < OS5 with 16bit mode
return WinScreenLock(initMode);
return WinScreenLock(initMode);
}
Err e;
@ -81,13 +81,13 @@ static void SknGetListColors(DmOpenRef skinDBP, UInt8 *text, UInt8 *selected, UI
if (skinDBP) {
colIndex = DmFindResource (skinDBP, sknColorsRsc, skinColors, NULL);
if (colIndex != (UInt16)-1) {
colH = DmGetResourceIndex(skinDBP, colIndex);
if (colH) {
colTemp = (UInt8 *)MemHandleLock(colH);
*text = colTemp[0];
*selected = colTemp[1];
*background = colTemp[2];
@ -113,7 +113,7 @@ static void SknCopyBits(DmOpenRef skinDBP, DmResID bitmapID, const RectangleType
if (index != (UInt16)-1) {
hTemp = DmGetResourceIndex(skinDBP,index);
if (hTemp) {
bmpTemp = (BitmapType *)MemHandleLock(hTemp);
BmpGlueGetDimensions(bmpTemp, &bw, &bh, 0);
@ -129,7 +129,7 @@ static void SknCopyBits(DmOpenRef skinDBP, DmResID bitmapID, const RectangleType
cw = srcRect->extent.x;
ch = srcRect->extent.y;
}
if (ch) {
WinGetClip(&old);
if (gVars->HRrefNum != sysInvalidRefNum) {
@ -143,14 +143,14 @@ static void SknCopyBits(DmOpenRef skinDBP, DmResID bitmapID, const RectangleType
} else {
Err e;
BitmapTypeV3 *bmp2P;
// create an uncompressed version of the bitmap
WinHandle win = WinCreateOffscreenWindow(bw, bh, screenFormat, &e);
WinHandle old = WinGetDrawWindow();
WinSetDrawWindow(win);
WinDrawBitmap(bmpTemp, 0, 0);
WinSetDrawWindow(old);
bmp2P = BmpCreateBitmapV3(WinGetBitmap(win), kDensityDouble, BmpGetBits(WinGetBitmap(win)), NULL);
copy.topLeft.x = destX / 2;
@ -183,7 +183,7 @@ void SknApplySkin() {
SknScreenLock(winLockCopy);
skinDBP = SknOpenSkin();
if (gPrefs->card.volRefNum != sysInvalidRefNum)
FrmShowObject(frmP, FrmGetObjectIndex (frmP, MainMSBitMap));
else
@ -198,7 +198,7 @@ void SknApplySkin() {
SknCopyBits(skinDBP, skinBackgroundImageTop, 0, r.topLeft.x, r.topLeft.y);
SknGetObjectBounds(skinDBP, skinBackgroundImageBottom, &r);
SknCopyBits(skinDBP, skinBackgroundImageBottom, 0, r.topLeft.x, r.topLeft.y);
for (UInt16 resID = 1100; resID <= 7000; resID += 100) {
SknSetState(skinDBP, resID, sknStateNormal);
SknShowObject(skinDBP, resID);
@ -217,30 +217,30 @@ void SknGetObjectBounds(DmOpenRef skinDBP, DmResID resID, RectangleType *rP) {
UInt8 *strTemp;
RctSetRectangle(rP, 0, 0, 0, 0);
if (skinDBP) {
bmpIndex = DmFindResource (skinDBP, bitmapRsc, resID, NULL);
if (bmpIndex != (UInt16)-1) { // if bmp exists
strIndex = DmFindResource (skinDBP, sknPosRsc, resID, NULL);
if (strIndex != (UInt16)-1) { // if params exist
hBmp = DmGetResourceIndex(skinDBP,bmpIndex);
if (hBmp) {
hStr = DmGetResourceIndex(skinDBP,strIndex);
if (hStr) {
// buttons : state|x|y|w/h slider|draw mode|x1/y1 keep|x2/y2 keep slider
// list (160mode) : state|x|y|w|h|
bmpTemp = (BitmapType *)MemHandleLock(hBmp);
strTemp = (UInt8 *)MemHandleLock(hStr);
BmpGlueGetDimensions(bmpTemp, &(rP->extent.x), &(rP->extent.y), 0);
rP->topLeft.x = strTemp[sknInfoPosX] * 2;
rP->topLeft.y = strTemp[sknInfoPosY] * 2;
MemPtrUnlock(strTemp);
MemPtrUnlock(strTemp);
DmReleaseResource(hStr);
}
@ -270,20 +270,20 @@ UInt8 SknSetState(DmOpenRef skinDBP, DmResID resID, UInt8 newState) {
if (skinDBP) {
index = DmFindResource (skinDBP, sknPosRsc, resID, NULL);
if (index != (UInt16)-1) {
hStr = DmGetResourceIndex(skinDBP, index);
if (hStr) {
strTemp = (UInt8 *)MemHandleLock(hStr);
oldState = strTemp[sknInfoState];
if (oldState != newState) {
DmWrite(strTemp, 0, &newState, 1);
}
MemPtrUnlock(strTemp);
DmReleaseResource(hStr);
MemPtrUnlock(strTemp);
DmReleaseResource(hStr);
}
}
}
@ -299,19 +299,19 @@ UInt8 SknGetDepth(DmOpenRef skinDBP) {
if (skinDBP) {
index = DmFindResource (skinDBP, sknDepthRsc, skinDepth, NULL);
if (index != (UInt16)-1) {
hStr = DmGetResourceIndex(skinDBP, index);
if (hStr) {
strTemp = (UInt8 *)MemHandleLock(hStr);
depth = *strTemp;
MemPtrUnlock(strTemp);
DmReleaseResource(hStr);
MemPtrUnlock(strTemp);
DmReleaseResource(hStr);
}
}
}
return depth;
}
@ -324,15 +324,15 @@ UInt8 SknGetState(DmOpenRef skinDBP, DmResID resID) {
if (skinDBP) {
index = DmFindResource (skinDBP, sknPosRsc, resID, NULL);
if (index != (UInt16)-1) {
hStr = DmGetResourceIndex(skinDBP, index);
if (hStr) {
strTemp = (UInt8 *)MemHandleLock(hStr);
oldState = strTemp[sknInfoState];
MemPtrUnlock(strTemp);
DmReleaseResource(hStr);
oldState = strTemp[sknInfoState];
MemPtrUnlock(strTemp);
DmReleaseResource(hStr);
}
}
}
@ -358,7 +358,7 @@ void SknGetListBounds(RectangleType *rAreaP, RectangleType *rArea2xP) {
skinDBP = DmOpenDatabase(gPrefs->skin.cardNo, gPrefs->skin.dbID, dmModeReadOnly);
if (skinDBP) {
strIndex = DmFindResource (skinDBP, sknPosRsc, skinList, NULL);
if (strIndex != 0xFFFF) { // if params exist
hStr = DmGetResourceIndex(skinDBP,strIndex);
if (hStr) {
@ -368,7 +368,7 @@ void SknGetListBounds(RectangleType *rAreaP, RectangleType *rArea2xP) {
y = strTemp[sknInfoPosY];
w = strTemp[sknInfoListWidth];
h = strTemp[sknInfoListSize] * sknInfoListItemSize;
if (rAreaP)
RctSetRectangle(rAreaP ,x, y, w, h);
if (rArea2xP)
@ -376,7 +376,7 @@ void SknGetListBounds(RectangleType *rAreaP, RectangleType *rArea2xP) {
MemHandleUnlock(hStr);
DmReleaseResource(hStr);
}
}
@ -447,7 +447,7 @@ void SknUpdateList() {
UInt8 txtColor, norColor, selColor, bkgColor;
UInt16 x,y;
SknScreenLock(winLockCopy);
SknGetListBounds(&rArea, &rArea2x);
@ -461,7 +461,7 @@ void SknUpdateList() {
x = rCopy.topLeft.x;
y = rCopy.topLeft.y;
rCopy.topLeft.x -= rField.topLeft.x;
rCopy.topLeft.y -= rField.topLeft.y;
rCopy.topLeft.y -= rField.topLeft.y;
SknCopyBits(skinDBP, skinBackgroundImageTop, &rCopy, x, y);
// copy bottom bg
SknGetObjectBounds(skinDBP, skinBackgroundImageBottom, &rField);
@ -469,7 +469,7 @@ void SknUpdateList() {
x = rCopy.topLeft.x;
y = rCopy.topLeft.y;
rCopy.topLeft.x -= rField.topLeft.x;
rCopy.topLeft.y -= rField.topLeft.y;
rCopy.topLeft.y -= rField.topLeft.y;
SknCopyBits(skinDBP, skinBackgroundImageBottom, &rCopy, x, y);
FntSetFont(stdFont);
@ -549,9 +549,9 @@ UInt16 SknCheckClick(DmOpenRef skinDBP, Coord mx, Coord my) {
}
}
}
}
return 0;
}
@ -572,7 +572,7 @@ void SknSelect(Coord x, Coord y) {
if (index < DmNumRecords(gameDB)) {
Boolean newValue;
oldIndex = GamGetSelected();
if (oldIndex != index && oldIndex != dmMaxRecordIndex)
@ -586,7 +586,7 @@ void SknSelect(Coord x, Coord y) {
MemHandleUnlock(record);
DmReleaseRecord (gameDB, index, 0);
lastIndex = index;
SknUpdateList();
}

View file

@ -22,7 +22,7 @@
#ifndef __SKIN_H__
#define __SKIN_H__
// skin
// skin
#define sknInfoState 0
#define sknInfoPosX 1
#define sknInfoPosY 2

View file

@ -30,11 +30,11 @@ void pcm2adpcm(Int16 *src, UInt8 *dst, UInt32 length) {
if (OPTIONS_TST(kOptDeviceARM)) {
PnoDescriptor pno;
ARMPa1SndType userData = {src, dst, length};
MemPtr armP = _PnoInit(ARM_PA1SND, &pno);
_PnoCall(&pno, &userData);
_PnoFree(&pno, armP);
return;
}
*/
@ -49,7 +49,7 @@ void pcm2adpcm(Int16 *src, UInt8 *dst, UInt32 length) {
signal = 0;
step = 0x7F;
length >>= 3; // 16bit stereo -> 4bit mono
do {
// high nibble
@ -58,14 +58,14 @@ void pcm2adpcm(Int16 *src, UInt8 *dst, UInt32 length) {
src++;
chan2 = ByteSwap16(*src);
src++;
diff = ((chan1 + chan2) >> 1) - signal;
#else
diff = ((*src++ + *src++) >> 1) - signal;
#endif
diff <<= 3;
diff /= step;
val = abs(diff) >> 1;
if (val > 7) val = 7;
@ -85,7 +85,7 @@ void pcm2adpcm(Int16 *src, UInt8 *dst, UInt32 length) {
src++;
chan2 = ByteSwap16(*src);
src++;
diff = ((chan1 + chan2) >> 1) - signal;
#else
diff = ((*src++ + *src++) >> 1) - signal;

View file

@ -16,7 +16,7 @@ Err sndCallback(void* UserDataP, SndStreamRef stream, void* bufferP, UInt32 *buf
*dst++ = READ_LE_UINT32(src++);
*dst++ = READ_LE_UINT32(src++);
}
snd->set = false;
snd->set = false;
} else {
snd->size = size;

View file

@ -104,9 +104,9 @@ Err SendDatabase (UInt16 cardNo, LocalID dbID, Char *nameP, Char *descriptionP)
* minimum requirement.
*
* PARAMETERS: requiredVersion - minimum rom version required
* (see sysFtrNumROMVersion in SystemMgr.h
* (see sysFtrNumROMVersion in SystemMgr.h
* for format)
* launchFlags - flags that indicate if the application
* launchFlags - flags that indicate if the application
* UI is initialized.
*
* RETURNED: error code or zero if rom is compatible
@ -127,8 +127,8 @@ static Err RomVersionCompatible(UInt32 requiredVersion, UInt16 launchFlags)
(sysAppLaunchFlagNewGlobals | sysAppLaunchFlagUIApp))
{
FrmAlert (RomIncompatibleAlert);
// Palm OS 1.0 will continuously relaunch this app unless we switch to
// Palm OS 1.0 will continuously relaunch this app unless we switch to
// another safe one.
if (romVersion <= kPalmOS10Version)
{
@ -220,7 +220,7 @@ static Boolean AppHandleEvent(EventPtr eventP)
}
return true;
}
return false;
}
@ -228,7 +228,7 @@ static Boolean AppHandleEvent(EventPtr eventP)
*
* FUNCTION: AppEventLoop
*
* DESCRIPTION: This routine is the event loop for the application.
* DESCRIPTION: This routine is the event loop for the application.
*
* PARAMETERS: nothing
*
@ -263,8 +263,8 @@ static void AppEventLoop(void)
*
* DESCRIPTION: This is the main entry point for the application.
*
* PARAMETERS: cmd - word value specifying the launch code.
* cmdPB - pointer to a structure that is associated with the launch code.
* PARAMETERS: cmd - word value specifying the launch code.
* cmdPB - pointer to a structure that is associated with the launch code.
* launchFlags - word value providing extra information about the launch.
*
* RETURNED: Result of launch
@ -295,7 +295,7 @@ static void AppLaunchCmdNotify(UInt16 LaunchFlags, SysNotifyParamType * pData)
}
}
break;
case sysNotifyVolumeUnmountedEvent:
if (gPrefs) {
CardSlotFormUpdate();
@ -350,9 +350,9 @@ static UInt32 ScummVMPalmMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
#endif
break;
case sysAppLaunchCmdNormalLaunch:
case sysAppLaunchCmdNormalLaunch:
error = AppStart();
if (error)
if (error)
goto end;
if (!bDirectMode) {
@ -380,8 +380,8 @@ end:
*
* DESCRIPTION: This is the main entry point for the application.
*
* PARAMETERS: cmd - word value specifying the launch code.
* cmdPB - pointer to a structure that is associated with the launch code.
* PARAMETERS: cmd - word value specifying the launch code.
* cmdPB - pointer to a structure that is associated with the launch code.
* launchFlags - word value providing extra information about the launch.
* RETURNED: Result of launch
*

View file

@ -19,7 +19,7 @@
* $Header$
*
*/
#ifndef __START_H__
#define __START_H__
@ -33,7 +33,7 @@ typedef struct {
//skin params
SkinInfoType skin; // card where is located the skin
Boolean soundClick;
Boolean soundClick;
//
Boolean vibrator;
Boolean autoOff;
@ -56,7 +56,7 @@ typedef struct {
Boolean copyProtection;
Boolean arm;
Boolean altIntro;
struct {
Boolean enable;
UInt8 mode;

View file

@ -24,7 +24,7 @@ Err HwrVibrateAttributes(Boolean set, UInt32 setting, void *value)
SYS_TRAP(sysTrapHwrVibrateAttributes);
/* to determine whether the vibrator is supported on a specific device, you
** need to make sure that you are running on PalmOS 4.x (so that the
** need to make sure that you are running on PalmOS 4.x (so that the
** trap exists), that the attention manager exists and you need to check
** whether HwrVibrateAttributes(0, 1, &active) returns an error code of
** 0. ('active' is a Boolean).
@ -42,14 +42,14 @@ Err HwrVibrateAttributes(Boolean set, UInt32 setting, void *value)
** value is in ticks (1/100 seconds) */
#define kHwrVibrateRate 2
/* *value points to a UInt32, specifying the pattern of vibrating
/* *value points to a UInt32, specifying the pattern of vibrating
**
** example:
** 0xFFFFFFFF stay on, no vibrating
** 0x0F0F0F0F vibrate four times in equal intervals
** 0xAAAAAAAA vibrate really fast (not recommended)
** 0x0F0F0000 vibrate twice, then pause
*/
*/
#define kHwrVibratePattern 3
/* *value points to a UInt16, specifying the delay between two

View file

@ -87,28 +87,28 @@ class OSystem_Dreamcast : public OSystem {
// 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, int cursorTargetScale);
// 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.
// Returns true if an event was retrieved.
bool pollEvent(Event &event);
// Set function that generates samples
// Set function that generates samples
bool setSoundCallback(SoundProc proc, void *param);
void clearSoundCallback();
// Determine the output sample rate. Audio data provided by the sound
// callback will be played using this rate.
int getOutputSampleRate() const;
// Initialise the specified CD drive for audio playback.
bool openCD(int drive);
@ -118,7 +118,7 @@ class OSystem_Dreamcast : public OSystem {
// Play cdrom audio track
void playCD(int track, int num_loops, int start_frame, int duration);
// Stop cdrom audio track
void stopCD();

View file

@ -181,7 +181,7 @@ bool DLObject::relocate(int fd, unsigned long offset, unsigned long size)
}
free(rela);
return true;
return true;
}
@ -233,7 +233,7 @@ bool DLObject::load(int fd)
read(fd, segment, phdr.p_filesz) != phdr.p_filesz) {
seterror("Segment load failed.");
return false;
}
}
DBG("shoff = %d, shentsz = %d, shnum = %d\n",
ehdr.e_shoff, ehdr.e_shentsize, ehdr.e_shnum);
@ -309,7 +309,7 @@ bool DLObject::load(int fd)
free(shdr);
return false;
}
free(shdr);
return true;
@ -351,7 +351,7 @@ bool DLObject::open(const char *path)
seterror("Missing ctors/dtors.");
dtors_start = dtors_end = NULL;
unload();
return false;
return false;
}
DBG("Calling constructors.\n");
@ -390,7 +390,7 @@ void *DLObject::symbol(const char *name)
}
seterror("Symbol \"%s\" not found.", name);
return NULL;
return NULL;
}

View file

@ -136,7 +136,7 @@ OSystem::MutexRef OSystem_Dreamcast::createMutex()
void OSystem_Dreamcast::lockMutex(MutexRef mutex)
{
}
void OSystem_Dreamcast::unlockMutex(MutexRef mutex)
{
}
@ -226,7 +226,7 @@ int DCLauncherDialog::runModal()
// Set the game path.
if(dir != NULL)
ConfMan.set("path", dir, Common::ConfigManager::kTransientDomain);
// Set the target.
_detector.setTarget(base);

View file

@ -106,7 +106,7 @@ static void texture_memcpy64(void *dest, void *src, int cnt)
d[4] = *s++;
d[5] = *s++;
d[6] = *s++;
d[7] = *s++;
d[7] = *s++;
asm("pref @%0" : : "r" (d));
d += 8;
}
@ -224,7 +224,7 @@ void OSystem_Dreamcast::copyRectToScreen(const byte *buf, int pitch, int x, int
}
bool OSystem_Dreamcast::showMouse(bool visible)
{
{
bool last = _ms_visible;
_ms_visible = visible;
@ -243,12 +243,12 @@ void OSystem_Dreamcast::setMouseCursor(const byte *buf, uint w, uint h,
{
_ms_cur_w = w;
_ms_cur_h = h;
_ms_hotspot_x = hotspot_x;
_ms_hotspot_y = hotspot_y;
_ms_keycolor = keycolor;
if (_ms_buf)
free(_ms_buf);
@ -276,7 +276,7 @@ void OSystem_Dreamcast::updateScreen(void)
// while((*((volatile unsigned int *)(void*)0xa05f810c) & 0x3ff) != 200);
// *((volatile unsigned int *)(void*)0xa05f8040) = 0xff0000;
for( int y = 0; y<_screen_h; y++ )
{
texture_memcpy64_pal( dst, src, _screen_w>>5, palette );
@ -318,11 +318,11 @@ void OSystem_Dreamcast::updateScreen(void)
TA_TEXTUREMODE_STRIDE|TA_TEXTUREMODE_ADDRESS(screen_tx[_screen_buffer]);
mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0;
ta_begin_frame();
// *((volatile unsigned int *)(void*)0xa05f8040) = 0x0000ff;
ta_commit_list(&mypoly);
myvertex.cmd = TA_CMD_VERTEX;
myvertex.ocolour = 0;
myvertex.colour = 0;
@ -357,7 +357,7 @@ void OSystem_Dreamcast::updateScreen(void)
} else {
if(_overlay_fade > 0)
_overlay_fade -= 0.125;
}
}
if(_overlay_fade > 0.0) {
@ -372,11 +372,11 @@ void OSystem_Dreamcast::updateScreen(void)
TA_POLYMODE2_U_SIZE_512|TA_POLYMODE2_V_SIZE_512;
mypoly.texture = TA_TEXTUREMODE_ARGB4444|TA_TEXTUREMODE_NON_TWIDDLED|
TA_TEXTUREMODE_ADDRESS(ovl_tx[_overlay_buffer]);
mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0.0;
ta_commit_list(&mypoly);
myvertex.cmd = TA_CMD_VERTEX;
myvertex.ocolour = 0;
myvertex.colour = 0xffffff|(((int)(255*_overlay_fade))<<24);
@ -398,7 +398,7 @@ void OSystem_Dreamcast::updateScreen(void)
myvertex.u = 0.0;
myvertex.v = OVL_H*(1.0/512.0);
ta_commit_list(&myvertex);
myvertex.x += OVL_W*_xscale;
myvertex.u = OVL_W*(1.0/512.0);
myvertex.cmd |= TA_CMD_VERTEX_EOS;
@ -453,7 +453,7 @@ void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h,
commit_dummy_transpoly();
return;
}
mypoly.cmd =
TA_CMD_POLYGON|TA_CMD_POLYGON_TYPE_TRANSPARENT|TA_CMD_POLYGON_SUBLIST|
TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED;
@ -466,9 +466,9 @@ void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h,
TA_TEXTUREMODE_ADDRESS(mouse_tx[_mouse_buffer]);
mypoly.red = mypoly.green = mypoly.blue = mypoly.alpha = 0;
ta_commit_list(&mypoly);
myvertex.cmd = TA_CMD_VERTEX;
myvertex.ocolour = 0;
myvertex.colour = 0xffff00;
@ -489,7 +489,7 @@ void OSystem_Dreamcast::drawMouse(int xdraw, int ydraw, int w, int h,
myvertex.u = 0.0;
myvertex.v = h*(1.0/MOUSE_H);
ta_commit_list(&myvertex);
myvertex.x += w*_xscale;
myvertex.u = w*(1.0/MOUSE_W);
myvertex.cmd |= TA_CMD_VERTEX_EOS;

View file

@ -32,7 +32,7 @@ void Icon::create_vmicon(void *buffer)
for(int n = 0; n<16; n++) {
int p = palette[n];
pal[n] =
pal[n] =
((p>>16)&0xf000)|
((p>>12)&0x0f00)|
((p>> 8)&0x00f0)|
@ -114,7 +114,7 @@ void Icon::draw(float x1, float y1, float x2, float y2, int pal,
myvertex.x = x2;
myvertex.v = 0.0;
myvertex.cmd |= TA_CMD_VERTEX_EOS;
ta_commit_list(&myvertex);
ta_commit_list(&myvertex);
}
int Icon::find_unused_pixel()

View file

@ -66,7 +66,7 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
if(!(buttons & 2)) rmb++;
if(!(buttons & 8)) newkey = 319;
mouse_x += pad->cond.mouse.axis1;
mouse_y += pad->cond.mouse.axis2;
mouse_wheel += pad->cond.mouse.axis3;

View file

@ -132,6 +132,6 @@ void Label::draw(float x, float y, unsigned int argb, float scale)
myvertex.x = x+u*scale;
myvertex.u = 1.0;
myvertex.cmd |= TA_CMD_VERTEX_EOS;
ta_commit_list(&myvertex);
ta_commit_list(&myvertex);
}

View file

@ -79,7 +79,7 @@ void draw_solid_quad(float x1, float y1, float x2, float y2,
myvertex.colour = c3;
myvertex.x = x2;
myvertex.cmd |= TA_CMD_VERTEX_EOS;
ta_commit_list(&myvertex);
ta_commit_list(&myvertex);
}
void draw_trans_quad(float x1, float y1, float x2, float y2,
@ -125,7 +125,7 @@ void draw_trans_quad(float x1, float y1, float x2, float y2,
myvertex.colour = c3;
myvertex.x = x2;
myvertex.cmd |= TA_CMD_VERTEX_EOS;
ta_commit_list(&myvertex);
ta_commit_list(&myvertex);
}
@ -198,7 +198,7 @@ static bool loadIcon(Game &game, Dir *dirs, int num_dirs)
for(int i=0; i<num_dirs; i++)
if(!strcmp(dirs[i].name, game.dir) &&
dirs[i].deficon[0]) {
sprintf(icofn, "%s%s", game.dir, dirs[i].deficon);
sprintf(icofn, "%s%s", game.dir, dirs[i].deficon);
if(game.icon.load(icofn))
return true;
break;
@ -240,7 +240,7 @@ static int findGames(Game *games, int max)
dirs[num_dirs].node = *entry;
num_dirs++;
}
} else
} else
if(isIcon(*entry))
strcpy(dirs[curr_dir-1].deficon, entry->displayName().c_str());
else if(curr_game < max &&
@ -303,7 +303,7 @@ void waitForDisk()
ta_txrelease(mark);
return;
}
ta_begin_frame();
drawBackground();
@ -347,11 +347,11 @@ int gameMenu(Game *games, int num_games)
return -1;
ta_begin_frame();
drawBackground();
ta_commit_end();
float y = 40.0;
for(int i=top_game, cnt=0; cnt<10 && i<num_games; i++, cnt++) {
int pal = 48+(i&15);
@ -375,7 +375,7 @@ int gameMenu(Game *games, int num_games)
setimask(15);
event = handleInput(locked_get_pads(), mousex, mousey, shiftFlags);
setimask(mask);
if(event==-OSystem::EVENT_LBUTTONDOWN || event==13 || event==319) {
int selected_game = top_game + selector_pos;
@ -384,15 +384,15 @@ int gameMenu(Game *games, int num_games)
unsigned int fade_colour = 0x00ffffff | ((255-fade)<<24);
ta_begin_frame();
drawBackground();
ta_commit_end();
float y = 40.0;
if(fade < 256)
for(int i=top_game, cnt=0; cnt<10 && i<num_games;
for(int i=top_game, cnt=0; cnt<10 && i<num_games;
i++, cnt++, y += 40.0)
if(cnt != selector_pos)
drawGameLabel(games[i], 48+(i&15), 50.0, y, 0xffffff, fade);

View file

@ -84,7 +84,7 @@ void SoftKeyboard::draw(float x, float y, int transp)
unsigned int bg_alpha_mask = (128-transp)<<24;
draw_trans_quad(x, y, x+312.0, y+172.0,
bg_alpha_mask|0x8080ff, bg_alpha_mask|0x8080ff,
bg_alpha_mask|0x8080ff, bg_alpha_mask|0x8080ff,
bg_alpha_mask|0x8080ff, bg_alpha_mask|0x8080ff);
x0 = x += 4.0;
y += 4.0;

View file

@ -32,7 +32,7 @@ class OSystem_Dreamcast;
class SoftKeyboard : public Interactive
{
private:
const OSystem_Dreamcast *os;
Label labels[2][SK_NUM_KEYS];
byte shiftState;

View file

@ -40,7 +40,7 @@ enum vmsaveResult {
VMSAVE_OK,
VMSAVE_NOVM,
VMSAVE_NOSPACE,
VMSAVE_WRITEERROR,
VMSAVE_WRITEERROR,
};
@ -143,7 +143,7 @@ static bool tryLoad(char *&buffer, int &size, const char *filename, int vm)
return false;
if(!vmsfs_open_file(&super, filename, &file))
return false;
buffer = new char[size = file.size];
if(vmsfs_read_file(&file, (unsigned char *)buffer, size))
@ -225,7 +225,7 @@ private:
void skip(uint32 offset);
public:
InVMSave()
InVMSave()
: pos(0), buffer(NULL)
{ }
@ -264,19 +264,19 @@ private:
uint32 write(const void *buf, uint32 cnt);
public:
OutVMSave(const char *_filename)
OutVMSave(const char *_filename)
: pos(0)
{
strncpy(filename, _filename, 16);
buffer = new char[size = MAX_SAVE_SIZE];
}
~OutVMSave();
};
class VMSaveManager : public Common::SaveFileManager {
public:
virtual Common::OutSaveFile *openForSaving(const char *filename) {
return new OutVMSave(filename);
}
@ -291,7 +291,7 @@ public:
return NULL;
}
}
virtual void listSavefiles(const char *prefix, bool *marks, int num);
};
@ -353,7 +353,7 @@ uint32 OutVMSave::write(const void *buf, uint32 cnt)
void VMSaveManager::listSavefiles(const char *prefix, bool *marks, int num)
{
memset(marks, false, num*sizeof(bool));
for(int i=0; i<24; i++)
tryList(prefix, marks, num, i);
}

View file

@ -38,7 +38,7 @@ public:
TUid AppDllUid() const;
#ifdef EPOC_AS_APP
TECompXL iECompXL;
TECompXL iECompXL;
#endif
};
#endif

View file

@ -35,10 +35,10 @@ namespace GUI {
// SumthinWicked says: we either split our Actions like WinCE did with Pocket/Smartphone
// or we put them in this file separated by #ifdefs, this one is up to you, AnotherGuest :)
const Common::String actionNames[] = {
"Up",
"Down",
const Common::String actionNames[] = {
"Up",
"Down",
"Left",
"Right",
"Left Click",
@ -48,8 +48,8 @@ const Common::String actionNames[] = {
"Zone",
"FT Cheat",
"Swap character",
"Skip text",
"Pause",
"Skip text",
"Pause",
"Quit"
};
@ -96,7 +96,7 @@ SymbianActions::SymbianActions(GameDetector &detector) :
void SymbianActions::initInstanceMain(OSystem *mainSystem) {
Actions::initInstanceMain(mainSystem);
// Mouse Up
_action_enabled[ACTION_UP] = true;
@ -125,7 +125,7 @@ void SymbianActions::initInstanceGame() {
bool is_sky = (_detector->_targetName == "sky");
bool is_queen = (_detector->_targetName == "queen");
bool is_gob = (strncmp(_detector->_targetName.c_str(), "gob", 3) == 0);
Actions::initInstanceGame();
// See if a right click mapping could be needed
@ -134,7 +134,7 @@ void SymbianActions::initInstanceGame() {
// Initialize keys for different actions
// Save
if (is_simon || is_gob)
if (is_simon || is_gob)
_action_enabled[ACTION_SAVE] = false;
else
if (is_queen) {
@ -144,7 +144,7 @@ void SymbianActions::initInstanceGame() {
else
if (is_sky) {
_action_enabled[ACTION_SAVE] = true;
_key_action[ACTION_SAVE].setAscii(63);
_key_action[ACTION_SAVE].setAscii(63);
}
else {
_action_enabled[ACTION_SAVE] = true;

View file

@ -70,7 +70,7 @@ public:
private:
SymbianActions(GameDetector &detector);
bool _right_click_needed;
};
};
} // namespace GUI

View file

@ -53,7 +53,7 @@ OSystem_SDL_Symbian::OSystem_SDL_Symbian() :_channels(0),_stereo_mix_buffer(0)
ConfMan.flushToDisk();
// Initialize global key mapping for Smartphones
GUI::Actions* actions = GUI::Actions::Instance();
actions->initInstanceMain(this);
actions->initInstanceMain(this);
actions->loadMapping();
initZones();
}
@ -77,14 +77,14 @@ bool OSystem_SDL_Symbian::setGraphicsMode(const char *name) {
}
/*
* SumthinWicked says: the stuff below is copied from common/scaler.cpp,
* SumthinWicked says: the stuff below is copied from common/scaler.cpp,
* so we can skip compiling the scalers. ESDL still needs 1x and the scaler
* architecture because we inherit from OSystem_SDL.
*/
int gBitFormat = 565;
void InitScalers(uint32 BitFormat) {} // called by OSystem_SDL functions, not relevant for ESDL
/**
/**
* Trivial 'scaler' - in fact it doesn't do any scaling but just copies the
* source to the destination.
*/
@ -100,7 +100,7 @@ void Normal1x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit
bool OSystem_SDL_Symbian::setSoundCallback(SoundProc proc, void *param) {
// First save the proc and param
_sound_proc_param = param;
_sound_proc_param = param;
_sound_proc = proc;
SDL_AudioSpec desired;
SDL_AudioSpec obtained;
@ -200,12 +200,12 @@ bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev,Event &event)
{
if(!GUI::Actions::Instance()->mappingActive() && ev.key.keysym.sym>SDLK_UNKNOWN)
for(TInt loop=0;loop<GUI::ACTION_LAST;loop++){
if(GUI::Actions::Instance()->getMapping(loop) ==ev.key.keysym.sym &&
if(GUI::Actions::Instance()->getMapping(loop) ==ev.key.keysym.sym &&
GUI::Actions::Instance()->isEnabled(loop)){
// Create proper event instead
switch(loop)
{
case GUI::ACTION_UP:
case GUI::ACTION_UP:
if(ev.type == SDL_KEYDOWN)
{
_km.y_vel = -1;
@ -218,7 +218,7 @@ bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev,Event &event)
}
event.type = EVENT_MOUSEMOVE;
fillMouseEvent(event, _km.x, _km.y);
return true;
return true;
case GUI::ACTION_DOWN:
if(ev.type == SDL_KEYDOWN)
{
@ -232,7 +232,7 @@ bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev,Event &event)
}
event.type = EVENT_MOUSEMOVE;
fillMouseEvent(event, _km.x, _km.y);
return true;
return true;
case GUI::ACTION_LEFT:
if(ev.type == SDL_KEYDOWN)
{
@ -272,8 +272,8 @@ bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev,Event &event)
case GUI::ACTION_ZONE:
if(ev.type == SDL_KEYDOWN)
{
int i;
int i;
for (i=0; i<TOTAL_ZONES; i++)
if (_km.x >= _zones[i].x && _km.y >= _zones[i].y &&
_km.x <= _zones[i].x + _zones[i].width && _km.y <= _zones[i].y + _zones[i].height
@ -287,7 +287,7 @@ bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev,Event &event)
_currentZone = 0;
event.type = EVENT_MOUSEMOVE;
fillMouseEvent(event, _mouseXZone[_currentZone],_mouseYZone[_currentZone]);
SDL_WarpMouse(event.mouse.x,event.mouse.y);
SDL_WarpMouse(event.mouse.x,event.mouse.y);
}
return true;
case GUI::ACTION_SAVE:
@ -301,7 +301,7 @@ bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev,Event &event)
ev.key.keysym.scancode= key.keycode();
ev.key.keysym.mod =(SDLMod) key.flags();
return false;
}
}
case GUI::ACTION_QUIT:{
GUI::MessageDialog alert("Do you want to quit ?", "Yes", "No");
if (alert.runModal() == GUI::kMessageOK)

View file

@ -36,7 +36,7 @@ public:
const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
bool setGraphicsMode(const char *name);
// Set function that generates samples
// Set function that generates samples
/**
* This function is overridden by the symbian port in order to provide MONO audio
* downmix is done by supplying our own audiocallback

View file

@ -58,7 +58,7 @@ CEikAppUi* CScummVMDoc::CreateAppUiL() {
void CScummVMUi::HandleForegroundEventL(TBool aForeground) {
if(aForeground) {
BringUpEmulatorL();
BringUpEmulatorL();
}
}
@ -81,7 +81,7 @@ void CScummVMUi::ConstructL() {
startFile = iEikonEnv->EikAppUi()->Application()->AppFullName();
TParse parser;
parser.Set(startFile,NULL,NULL);
startFile = parser.DriveAndPath();
#ifndef __WINS__
startFile.Append( _L("EScummVM.exe"));
@ -109,7 +109,7 @@ void CScummVMUi::ConstructL() {
if(iThreadWatch.Open(iThreadId)==KErrNone) {
iWatcher = new (ELeave)CScummWatcher;
iWatcher->iAppUi=this;
iThreadWatch.Logon(iWatcher->iStatus);
iThreadWatch.Logon(iWatcher->iStatus);
}
}
@ -154,7 +154,7 @@ void CScummVMUi::HandleCommandL(TInt aCommand) {
thread.Close();
}
Exit();
}
}
break;
}
}

View file

@ -58,7 +58,7 @@ CEikAppUi* CScummVMDoc::CreateAppUiL() {
void CScummVMUi::HandleForegroundEventL(TBool aForeground) {
if(aForeground) {
BringUpEmulatorL();
BringUpEmulatorL();
}
}
@ -81,7 +81,7 @@ void CScummVMUi::ConstructL() {
startFile = iEikonEnv->EikAppUi()->Application()->AppFullName();
TParse parser;
parser.Set(startFile,NULL,NULL);
startFile = parser.DriveAndPath();
#ifndef __WINS__
startFile.Append( _L("EScummVM.exe"));
@ -108,7 +108,7 @@ void CScummVMUi::ConstructL() {
if(iThreadWatch.Open(iThreadId)==KErrNone) {
iWatcher = new (ELeave)CScummWatcher;
iWatcher->iAppUi=this;
iThreadWatch.Logon(iWatcher->iStatus);
iThreadWatch.Logon(iWatcher->iStatus);
}
}
@ -153,7 +153,7 @@ void CScummVMUi::HandleCommandL(TInt aCommand) {
thread.Close();
}
Exit();
}
}
break;
}
}

View file

@ -58,7 +58,7 @@ CEikAppUi* CScummVMDoc::CreateAppUiL() {
void CScummVMUi::HandleForegroundEventL(TBool aForeground) {
if(aForeground) {
BringUpEmulatorL();
BringUpEmulatorL();
}
}
@ -81,7 +81,7 @@ void CScummVMUi::ConstructL() {
startFile = iEikonEnv->EikAppUi()->Application()->AppFullName();
TParse parser;
parser.Set(startFile,NULL,NULL);
startFile = parser.DriveAndPath();
#ifndef __WINS__
startFile.Append( _L("EScummVM.exe"));
@ -108,7 +108,7 @@ void CScummVMUi::ConstructL() {
if(iThreadWatch.Open(iThreadId)==KErrNone) {
iWatcher = new (ELeave)CScummWatcher;
iWatcher->iAppUi=this;
iThreadWatch.Logon(iWatcher->iStatus);
iThreadWatch.Logon(iWatcher->iStatus);
}
}
@ -153,7 +153,7 @@ void CScummVMUi::HandleCommandL(TInt aCommand) {
thread.Close();
}
Exit();
}
}
break;
}
}

View file

@ -65,14 +65,14 @@
// somehow nobody has this function...
#define hypot(a, b) sqrt((a)*(a) + (b)*(b))
// Symbian bsearch implementation is flawed
// Symbian bsearch implementation is flawed
void inline *scumm_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
size_t i;
for (i=0; i<nmemb; i++)
for (i=0; i<nmemb; i++)
if (compar(key, (void*)((size_t)base + size * i)) == 0)
return (void*)((size_t)base + size * i);
return NULL;
}
#define bsearch scumm_bsearch

View file

@ -94,14 +94,14 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const String &p) {
ENTER();
int len = 0, offset = p.size();
assert(offset > 0);
_sPath = p;
// Extract last component from path
const char *str = p.c_str();
while (offset > 0 && (str[offset-1] == '/' || str[offset-1] == ':'))
offset--;
@ -109,7 +109,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const String &p) {
len++;
offset--;
}
_sDisplayName = String(str + offset, len);
// Check whether it is a directory, and whether the file actually exists
@ -132,7 +132,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const String &p) {
if (_bIsDirectory) {
if (fib->fib_EntryType != ST_ROOT)
_sPath += "/";
_pFileLock = IDOS->DupLock(pLock);
_bIsValid = (_pFileLock != 0);
}

View file

@ -44,8 +44,8 @@
* And if we ever want to support devices with no FS in the classical sense (Palm...),
* we can build upon this.
*/
/*
/*
* TODO - Instead of starting with getRoot(), we should rather add a getDefaultDir()
* call that on Unix might return the current dir or the users home dir...
* i.e. the root dir is usually not the best starting point for browsing.
@ -81,7 +81,7 @@ protected:
virtual AbstractFilesystemNode *parent() const = 0;
/**
* This method is a rather ugly hack which is used internally by the
* This method is a rather ugly hack which is used internally by the
* actual node implementions to wrap up raw nodes inside FilesystemNode
* objects. We probably want to get rid of this eventually and replace it
* with a cleaner / more elegant solution, but for now it works.

View file

@ -36,7 +36,7 @@ protected:
bool _isValid;
bool _isPseudoRoot;
String _path;
public:
PalmOSFilesystemNode();
PalmOSFilesystemNode(const Char *path);
@ -71,7 +71,7 @@ void PalmOSFilesystemNode::addFile(FSList &list, ListMode mode, const char *base
if (entry._isDirectory)
entry._path += "/";
entry._isValid = true;
entry._isValid = true;
entry._isPseudoRoot = false;
list.push_back(wrap(new PalmOSFilesystemNode(&entry)));
}
@ -111,7 +111,7 @@ FSList PalmOSFilesystemNode::listDir(ListMode mode) const {
if (e)
return myList;
while(dirIterator != expIteratorStop) {
e = VFSDirEntryEnumerate(handle, &dirIterator, &desc);
if (!e) {
@ -137,11 +137,11 @@ const char *lastPathComponent(const Common::String &str) {
AbstractFilesystemNode *PalmOSFilesystemNode::parent() const {
PalmOSFilesystemNode *p = 0;
if (!_isPseudoRoot) {
const char *start = _path.c_str();
const char *end = lastPathComponent(_path);
p = new PalmOSFilesystemNode();
p->_path = String(start, end - start);
p->_isValid = true;

View file

@ -45,7 +45,7 @@ protected:
bool _isDirectory;
bool _isValid;
String _path;
public:
POSIXFilesystemNode();
POSIXFilesystemNode(const String &path);
@ -64,11 +64,11 @@ public:
static const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str();
const char *cur = start + str.size() - 2;
while (cur > start && *cur != '/') {
--cur;
}
return cur+1;
}
@ -84,7 +84,7 @@ POSIXFilesystemNode::POSIXFilesystemNode() {
#ifndef __DC__
char buf[MAXPATHLEN];
getcwd(buf, MAXPATHLEN);
_path = buf;
_displayName = lastPathComponent(_path);
_path += '/';
@ -99,7 +99,7 @@ POSIXFilesystemNode::POSIXFilesystemNode() {
POSIXFilesystemNode::POSIXFilesystemNode(const String &p) {
int len = 0, offset = p.size();
struct stat st;
assert(offset > 0);
_path = p;
@ -147,7 +147,7 @@ FSList POSIXFilesystemNode::listDir(ListMode mode) const {
// Skip 'invisible' files
if (dp->d_name[0] == '.')
continue;
POSIXFilesystemNode entry;
entry._displayName = dp->d_name;
entry._path = _path;

View file

@ -32,7 +32,7 @@ protected:
bool _isDirectory;
bool _isRoot;
String _path;
public:
Ps2FilesystemNode(void);
Ps2FilesystemNode(const Ps2FilesystemNode *node);
@ -109,7 +109,7 @@ FSList Ps2FilesystemNode::listDir(ListMode mode) const {
if (tocEntries[fCnt].filename[0] != '.') { // skip .. directory
dirEntry._isDirectory = (bool)(tocEntries[fCnt].fileProperties & 2);
dirEntry._isRoot = false;
dirEntry._path = _path;
dirEntry._path += "/";
dirEntry._path += tocEntries[fCnt].filename;
@ -135,7 +135,7 @@ AbstractFilesystemNode *Ps2FilesystemNode::parent() const {
slash = cnt;
cnt++;
}
p->_path = String(_path.c_str(), slash - _path.c_str());
p->_isDirectory = true;
p->_displayName = slash + 1;

View file

@ -21,7 +21,7 @@
* $Header$
*/
#if defined (__SYMBIAN32__)
#if defined (__SYMBIAN32__)
#include "common/stdafx.h"
#include "../fs.h"
@ -62,11 +62,11 @@ public:
static const char *lastPathComponent(const Common::String &str) {
const char *start = str.c_str();
const char *cur = start + str.size() - 2;
while (cur > start && *cur != '\\') {
--cur;
}
return cur+1;
}
@ -88,7 +88,7 @@ SymbianFilesystemNode::SymbianFilesystemNode(bool aIsRoot) {
}
// SumthinWicked says: added next function myself, since it was not in 0.7.1.
// might still be a little buggy, or simply the reason ScummVM can't run any
// might still be a little buggy, or simply the reason ScummVM can't run any
// games on the phone yet :P
SymbianFilesystemNode::SymbianFilesystemNode(const String &path) {
if (path.size() == 0)
@ -121,7 +121,7 @@ FSList SymbianFilesystemNode::listDir(ListMode mode) const {
CEikonEnv::Static()->FsSession().DriveList(drivelist);
for (int loop=0;loop<KMaxDrives;loop++) {
if(drivelist[loop]>0) {
SymbianFilesystemNode entry(false);
SymbianFilesystemNode entry(false);
char drive_name[2];
drive_name[0] = loop+'A';
drive_name[1] = '\0';
@ -149,17 +149,17 @@ FSList SymbianFilesystemNode::listDir(ListMode mode) const {
nameBuf.Copy(fileentry.iName);
SymbianFilesystemNode entry(false);
entry._isPseudoRoot = false;
entry._displayName =(char*)nameBuf.PtrZ();
entry._path = _path;
entry._path +=(char*)nameBuf.PtrZ();
entry._isDirectory = fileentry.IsDir();
// Honor the chosen mode
if ((mode == kListFilesOnly && entry._isDirectory) ||
(mode == kListDirectoriesOnly && !entry._isDirectory))
continue;
if (entry._isDirectory)
entry._path += "\\";
myList.push_back(wrap(new SymbianFilesystemNode(&entry)));

View file

@ -38,7 +38,7 @@ protected:
bool _isValid;
bool _isPseudoRoot;
String _path;
public:
WindowsFilesystemNode();
WindowsFilesystemNode(const String &path);
@ -63,7 +63,7 @@ char* WindowsFilesystemNode::toAscii(TCHAR *x) {
#ifndef UNICODE
return (char*)x;
#else
#else
static char asciiString[MAX_PATH];
WideCharToMultiByte(CP_ACP, 0, x, _tcslen(x) + 1, asciiString, sizeof(asciiString), NULL, NULL);
return asciiString;
@ -128,7 +128,7 @@ WindowsFilesystemNode::WindowsFilesystemNode() {
_isValid = true;
_path = "\\";
_isPseudoRoot = false;
#endif
#endif
}
WindowsFilesystemNode::WindowsFilesystemNode(const String &p) {
@ -179,9 +179,9 @@ FSList WindowsFilesystemNode::listDir(ListMode mode) const {
TCHAR drive_buffer[100];
GetLogicalDriveStrings(sizeof(drive_buffer) / sizeof(TCHAR), drive_buffer);
for (TCHAR *current_drive = drive_buffer; *current_drive;
for (TCHAR *current_drive = drive_buffer; *current_drive;
current_drive += _tcslen(current_drive) + 1) {
WindowsFilesystemNode entry;
WindowsFilesystemNode entry;
char drive_name[2];
drive_name[0] = toAscii(current_drive)[0];

View file

@ -16,7 +16,7 @@
* 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.
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header$
*
@ -120,7 +120,7 @@ struct g_Namedregisters {
// Global stuff
// Register array.
int g_Registers[50] = {1, 2, 3, 4 ,5, 6, 7, 8, 9, 10,
int g_Registers[50] = {1, 2, 3, 4 ,5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19,
21, 22, 23, 24, 25, 26, 27, 28, 29,
31, 32, 33, 34, 35, 36, 37, 38, 39,
@ -173,13 +173,13 @@ unsigned int DecodeInstruction(unsigned int uiInstruction, unsigned int PC);
int OpenUSB()
{
int iResult;
g_CommDesc.port_kind = COMM_USB_D;
g_CommDesc.tr_mode = 1;
g_CommDesc.tr_buf_size = PACKET_SIZE;
g_CommDesc.sz_pkt = PACKET_SIZE;
g_CommDesc.isr_comm_ram = 0;
iResult = GpCommCreate(&g_CommDesc, &g_Comm);
return iResult;
@ -222,7 +222,7 @@ void WaitACK()
}
}
///////////////////////////////////////////////////////////////
// Formats and sends a command to the server,
// Formats and sends a command to the server,
// it also calculates checksum
void SendCommand(unsigned char *pCommand)
{
@ -329,7 +329,7 @@ void HexToStringBW(char *pString, int iNumber)
pString[3] = HexDigits[(iNumber >> 8) & 0x0f];
pString[0] = HexDigits[(iNumber >> 4) & 0x0f];
pString[1] = HexDigits[(iNumber) & 0x0f];
pString[8] = 0;
}
@ -402,7 +402,7 @@ unsigned char StringToByte(char *pString)
case 'f':
ucValue |= (0x0f);
break;
}
}
@ -418,7 +418,7 @@ void SendOffsets()
int a = 0;//(int)&__text_start;
int b = 0;//(int)&__data_start;
int c = 0;//(int)&__bss_start;
PrintToString(String, "Text=");
HexToString(&String[5], a);
PrintToString(&String[5+8], ";Data=");
@ -449,23 +449,23 @@ void DumpRegisters()
HexToStringBW(&Buffer[i * 8], g_Registers[21 + i]);
}
Buffer[21*8] = 0;
SendCommandSize((unsigned char *)Buffer, (21 * 8) + 4);
}
///////////////////////////////////////////////////////////////
// This function extracts an address from a string.
// This function extracts an address from a string.
void *GetAddr(char *pBuffer)
{
int iAddr;
int i = 0;
iAddr = 0;
while (pBuffer[i] != ',') {
iAddr = iAddr << 4;
switch(pBuffer[i]) {
case '0':
//iAddr |=
//iAddr |=
break;
case '1':
iAddr |= (0x01);
@ -531,7 +531,7 @@ int GetBytes(char *pBuffer)
iBytes = iBytes << 4;
switch(pBuffer[i]) {
case '0':
//iAddr |=
//iAddr |=
break;
case '1':
iBytes |= 0x01;
@ -580,7 +580,7 @@ int GetBytes(char *pBuffer)
break;
}
i++;
}
return iBytes;
@ -613,7 +613,7 @@ void SendMemory(void *pAddr, int iBytes)
iData = *pData++;
g_TempBuffer[iBufferPos++] = HexDigits[(iData & 0xf0) >> 4];
g_TempBuffer[iBufferPos++] = HexDigits[(iData & 0x0f)];
}
if (iBytes > 0) {
// This mean that we have not yet sent our last command.
@ -711,7 +711,7 @@ void ISR() __attribute__ ((naked));
void ISR()
{
// Lets snatch the registers!
asm volatile(" \n"
" str r4, [%0, #0x10] \n"
" str r5, [%0, #0x14] \n"
@ -724,7 +724,7 @@ void ISR()
" str r12, [%0, #0x30] \n"
" str r14, [%0, #0x3C] \n"
" @// skip 8 * 12byte(96bit) = 0x60 \n"
" mov r4, %0 \n"
@ -738,10 +738,10 @@ void ISR()
" str r1, [r4, #0x48] \n"
" str r1, [r4,#0xA0] \n"
" str r1, [r4,#0xA4] \n"
" mrs r1, CPSR \n"
" mov r2, r1 \n"
" @// Let us set the mode to supervisor so we can get r13 and r14 \n"
" bic r1, r1, #0x1f \n"
@ -755,15 +755,15 @@ void ISR()
" bic r2, r2, #0x80 \n"
" msr CPSR_fsxc, r2 \n"
" \n"
:
: "r" (g_Registers)
: "%0", "r1", "r2", "r4");
// Get Current CSPR and save LR
asm volatile(" \n"
" mrs r0, CPSR \n"
@ -806,7 +806,7 @@ void ISR()
default:
g_iTrap = -1;
}
#ifdef USE_PRINTF
Printf("Trap@0x%x:%d", g_Registers[15], g_iTrap);
@ -834,11 +834,11 @@ void ISR()
*/
SendBreakPoint();
BreakPoint();
//Printf("0x%x 0x%x", g_Registers[15], g_Registers[16]);
// Okay, it's time to continue.
switch (g_iTrap) {
case MODE_USER:
//Printf("Dunno!!\n");
@ -877,7 +877,7 @@ void ISR()
" ldr r0,[%0, #0x00] \n"
" ldr r3,[%0, #0x0C] \n"
" subs pc, lr, #0x04 \n"
" \n"
@ -918,7 +918,7 @@ void ISR()
:
:"r" (g_Registers)
:"r0");
break;
case MODE_SYSTEM:
@ -931,7 +931,7 @@ void ISR()
}
}
@ -992,7 +992,7 @@ void DEBUG_Print(char *pFormat, ...)
unsigned char MyChar;
if (!g_GDBConnected) return;
va_start(VaList , pFormat);
vsnprintf(Temp, 0x100, pFormat , VaList);
va_end(VaList);
@ -1026,7 +1026,7 @@ void BreakPoint()
void *pAddr;
int iOffset;
int iBytes;
// Find out if we got here through a STEP command
if (g_LastWasStep) {
@ -1050,7 +1050,7 @@ void BreakPoint()
while(!bBreakLoop) {
iResult = RecvUSB(g_ReadBuffer, 0x100);
//Printf("%d\n", iResult);
if (iResult > 0) {
// If we recieve a package we can assume that GDB is connected.. or smth..:D
g_GDBConnected = true;
@ -1064,7 +1064,7 @@ void BreakPoint()
g_SendBuffer[4] = '+';
SendUSB((const void *)g_SendBuffer, 0x100);
WaitACK();
// I can see that i get a bunch of '+' and '-' in the messages.. lets remove them.
iOffsetAdd = 4;
while((g_ReadBuffer[iOffsetAdd] == '+') || (g_ReadBuffer[iOffsetAdd] == '-')) iOffsetAdd++;
@ -1118,16 +1118,16 @@ void BreakPoint()
iOffset = FindChar(&g_ReadBuffer[iOffsetAdd + 2], ':');
WriteMemory(pAddr, iBytes, &g_ReadBuffer[iOffsetAdd + 2 + iOffset + 1]);
SendCommand((unsigned char *)"OK");
}
break;
case 'c': // continue
{
return;
}
break;
case 's': // Stepping.
{
// Get the address of the next instruction.
@ -1164,7 +1164,7 @@ void BreakPoint()
}
}
break;
default:
UnSupportedCommand();
break;
@ -1195,8 +1195,8 @@ unsigned int *GetNextInstruction(unsigned int *pAddr)
unsigned int uiNewPC = DecodeInstruction(uiInstruction, (unsigned int)pAddr);
return (unsigned int *)uiNewPC;
// Set new PC to pAddr + 4, because we really hope that is the case...:D
iNewPC = (unsigned int)pAddr;
iNewPC += 4; // Next instruction (atleast in ARM mode, we don't support thumb yet)
@ -1227,9 +1227,9 @@ unsigned int *GetNextInstruction(unsigned int *pAddr)
iNewAddr *= 4; // Instruction size.
iNewPC = ((int)pAddr + iNewAddr + 8);
}
// Well, it might be a ldm(ea)?
if ((uiInstruction & 0xE000000) == 0x8000000) {
#ifdef USE_PRINTF
Printf("LDM");
@ -1261,28 +1261,28 @@ unsigned int *GetNextInstruction(unsigned int *pAddr)
uiRegVal = ((unsigned int *)g_Registers)[uiBaseRegister];
// First, have a look at the U bit.
if ((uiInstruction & (1 << 23)) != 0) {
// Transfer is made descending
// Which also means that the PC is closest to the base register i just found out.
// Lets check the P bit (If i'm supposed to increment before or after.
iPCOffset = iRegsbeforePC * 4;
if (((uiInstruction) & (1 << 24)) != 0) iPCOffset += 4;
} else {
// Transfer is done ascending
// Lets check the P bit (If i'm supposed to decrement before or after.
if (((uiInstruction) & (1 << 24)) != 0) iPCOffset = -4;
}
iNewPC = *(unsigned int *)((((int)uiRegVal) + iPCOffset) & ~0x03);
}
}
}
// Check if it's a mov pc, Rn
}
return (unsigned int *)iNewPC;
@ -1298,7 +1298,7 @@ bool CondWillExecute(unsigned int uiCond, unsigned int CSPR)
// This is true if Z is set in CSPR
if ((CSPR & (1 << 30)) != 0) return true;
else return false;
break;
case 1: // NE
// This should be true if Z is not set.
@ -1370,7 +1370,7 @@ bool CondWillExecute(unsigned int uiCond, unsigned int CSPR)
default:
break;
}
}
// I got the idea for this layout from the singlestep.c (found in eCos)
@ -1395,7 +1395,7 @@ typedef struct
#define DPISR_R1 0
#define DPISR_R2 0
// Example <opcode> Rd, Rm, <shift> amount
typedef struct
typedef struct
{
unsigned Rm : 4; // Rm
unsigned resv3 : 1; // Reserved 3 (1)
@ -1475,7 +1475,7 @@ typedef struct
unsigned S : 1; // B-bit
unsigned U : 1; // U-bit
unsigned p : 1; // P-bit
unsigned resv1 : 3; // Reserved 1 (100)
unsigned cond : 4; // Condition
} lsm; // Load store multiple
@ -1563,7 +1563,7 @@ unsigned int DecodeBL(bl Instr, unsigned int PC);
///////////////////////////////////////////////////////////////
//
//
unsigned int DecodeInstruction(unsigned int uiInstruction, unsigned int PC)
{
Instruction myInstruction;
@ -1585,7 +1585,7 @@ unsigned int DecodeInstruction(unsigned int uiInstruction, unsigned int PC)
(myInstruction.DPRRS.resv3 == DPRRS_R3)) return DecodeDPRRS(myInstruction.DPRRS, PC);
else if ((myInstruction.DPI.resv1 == DPI_R1)) return DecodeDPI(myInstruction.DPI, PC);
else if ((myInstruction.LSIO.resv1 == LSIO_R1)) return DecodeLSIO(myInstruction.LSIO, PC);
else if ((myInstruction.LSRO.resv1 == LSRO_R1) &&
(myInstruction.LSRO.resv2 == LSRO_R2)) return DecodeLSRO(myInstruction.LSRO, PC);
else if (myInstruction.LSM.resv1 == LSM_R1) return DecodeLSM(myInstruction.LSM, PC);
@ -1595,21 +1595,21 @@ unsigned int DecodeInstruction(unsigned int uiInstruction, unsigned int PC)
}
///////////////////////////////////////////////////////////////
//
//
unsigned int LSL(unsigned int uiValue, unsigned int uiSteps)
{
return uiValue << uiSteps;
}
///////////////////////////////////////////////////////////////
//
//
unsigned int LSR(unsigned int uiValue, unsigned int uiSteps)
{
return uiValue >> uiSteps;
}
///////////////////////////////////////////////////////////////
//
//
// This one could be trickier since, i'm nor sure if a signed shift really is a signed shift.
unsigned int ASR(unsigned int uiValue, unsigned int uiSteps)
{
@ -1625,7 +1625,7 @@ unsigned int ASR(unsigned int uiValue, unsigned int uiSteps)
}
///////////////////////////////////////////////////////////////
//
//
unsigned int ROR(unsigned int uiValue, unsigned int uiSteps)
{
unsigned int uiRetval;
@ -1642,14 +1642,14 @@ unsigned int ROR(unsigned int uiValue, unsigned int uiSteps)
///////////////////////////////////////////////////////////////
//
//
unsigned int Shift_Operand(unsigned int Rm, unsigned int amount, unsigned int shift)
{
unsigned int uiRegisterValue;
uiRegisterValue = g_Registers[Rm];
if (Rm == 0x0f) {
// Rm is PC, and PC is offseted by 8.
@ -1671,7 +1671,7 @@ unsigned int Shift_Operand(unsigned int Rm, unsigned int amount, unsigned int sh
case 3: // ROR
return ROR(uiRegisterValue, amount);
break;
default:
break;
@ -1680,7 +1680,7 @@ unsigned int Shift_Operand(unsigned int Rm, unsigned int amount, unsigned int sh
}
///////////////////////////////////////////////////////////////
//
//
// Example <opcode> Rd, Rm, <shift> amount
unsigned int DecodeDPISR(dpisr Instr, unsigned int uiPC)
{
@ -1688,10 +1688,10 @@ unsigned int DecodeDPISR(dpisr Instr, unsigned int uiPC)
unsigned int uiRnVal = g_Registers[Instr.Rn];
// Only do this i Pc is Rd
if (Instr.Rd != 0x0f) return uiPC + 4;
// The actual value that PC contains when executing this instruction is the instruction address+8
if (Instr.Rn == 0x0f) uiRnVal += 8;
@ -1702,11 +1702,11 @@ unsigned int DecodeDPISR(dpisr Instr, unsigned int uiPC)
case OPCODE_MVN:
return ~uiOperand;
case OPCODE_ADD:
return uiRnVal + uiOperand;
return uiRnVal + uiOperand;
case OPCODE_ADC:
return uiRnVal + uiOperand + (((g_Registers[18] & (1 << 29))) == 0?0:1);
case OPCODE_SUB:
return uiRnVal - uiOperand;
return uiRnVal - uiOperand;
case OPCODE_SBC:
return uiRnVal - uiOperand - (((g_Registers[18] & (1 << 29))) == 0?1:0);
case OPCODE_RSB:
@ -1728,7 +1728,7 @@ unsigned int DecodeDPISR(dpisr Instr, unsigned int uiPC)
///////////////////////////////////////////////////////////////
//
//
//dprrs; // Data Processing Register Register Shift
// Example <opcode> Rd, Rn, Rm <shift> Rs
unsigned int DecodeDPRRS(dprrs Instr, unsigned int uiPC)
@ -1752,11 +1752,11 @@ unsigned int DecodeDPRRS(dprrs Instr, unsigned int uiPC)
case OPCODE_MVN:
return ~uiOperand;
case OPCODE_ADD:
return uiRnVal + uiOperand;
return uiRnVal + uiOperand;
case OPCODE_ADC:
return uiRnVal + uiOperand + (((g_Registers[18] & (1 << 29))) == 0?0:1);
case OPCODE_SUB:
return uiRnVal - uiOperand;
return uiRnVal - uiOperand;
case OPCODE_SBC:
return uiRnVal - uiOperand - (((g_Registers[18] & (1 << 29))) == 0?1:0);
case OPCODE_RSB:
@ -1778,7 +1778,7 @@ unsigned int DecodeDPRRS(dprrs Instr, unsigned int uiPC)
}
///////////////////////////////////////////////////////////////
//
//
// dpi; // Data processing immediate
// example add r0, r1, (ror <immed>, <rotate * 2>)
unsigned int DecodeDPI(dpi Instr, unsigned int uiPC)
@ -1797,11 +1797,11 @@ unsigned int DecodeDPI(dpi Instr, unsigned int uiPC)
case OPCODE_MVN:
return ~uiOperand;
case OPCODE_ADD:
return uiRnVal + uiOperand;
return uiRnVal + uiOperand;
case OPCODE_ADC:
return uiRnVal + uiOperand + (((g_Registers[18] & (1 << 29))) == 0?0:1);
case OPCODE_SUB:
return uiRnVal - uiOperand;
return uiRnVal - uiOperand;
case OPCODE_SBC:
return uiRnVal - uiOperand - (((g_Registers[18] & (1 << 29))) == 0?1:0);
case OPCODE_RSB:
@ -1823,7 +1823,7 @@ unsigned int DecodeDPI(dpi Instr, unsigned int uiPC)
}
///////////////////////////////////////////////////////////////
//
//
// lsio; // Load/store immediate offset
// Example ldr Rd, [Rn, #<immed>]
unsigned int DecodeLSIO(lsio Instr, unsigned int uiPC)
@ -1840,7 +1840,7 @@ unsigned int DecodeLSIO(lsio Instr, unsigned int uiPC)
// Check if it's pre-indexed
if (Instr.p == 1){
if (Instr.U == 1) {
// Add offset
uiRnValue += Instr.immed;
@ -1857,7 +1857,7 @@ unsigned int DecodeLSIO(lsio Instr, unsigned int uiPC)
}
///////////////////////////////////////////////////////////////
//
//
// lsro; // Load/Store register offset
// Example ldr Rd, [Rn + Rm lsl 5]
unsigned int DecodeLSRO(lsro Instr, unsigned int uiPC)
@ -1876,7 +1876,7 @@ unsigned int DecodeLSRO(lsro Instr, unsigned int uiPC)
uiIndex = Shift_Operand(Instr.Rm, Instr.amount, Instr.shift);
if (Instr.p == 1){
if (Instr.U == 1) {
// Add offset
uiRnValue += uiIndex;
@ -1893,7 +1893,7 @@ unsigned int DecodeLSRO(lsro Instr, unsigned int uiPC)
}
///////////////////////////////////////////////////////////////
//
//
// lsm; // Load store multiple
// Example: ldm r0, {r1, r2, r3}
unsigned int DecodeLSM(lsm Instr, unsigned int uiPC)
@ -1922,7 +1922,7 @@ unsigned int DecodeLSM(lsm Instr, unsigned int uiPC)
for (int i = 0; i < 15; i++) {
if ((Instr.regs & (1 << i)) != 0) uiOffsetToPC += 4;
}
// If the P bit is set, it uses pre increment
if (Instr.p == 1) uiOffsetToPC += 4;
}
@ -1935,7 +1935,7 @@ unsigned int DecodeLSM(lsm Instr, unsigned int uiPC)
}
///////////////////////////////////////////////////////////////
//
//
// bl; // Branch with link(optional)
unsigned int DecodeBL(bl Instr, unsigned int uiPC)
{

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more