2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2006-07-09 11:47:17 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
*/
|
2008-05-15 22:12:51 +00:00
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
#ifndef _DSMAIN_H
|
|
|
|
#define _DSMAIN_H
|
|
|
|
|
|
|
|
#include <nds.h>
|
2006-10-25 19:18:38 +00:00
|
|
|
#include "osystem_ds.h"
|
2006-07-09 11:47:17 +00:00
|
|
|
#include "scummconsole.h"
|
2006-07-09 13:10:45 +00:00
|
|
|
#include "NDS/scummvm_ipc.h"
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
namespace DS {
|
|
|
|
|
2007-06-30 23:03:03 +00:00
|
|
|
|
|
|
|
enum controlType {
|
|
|
|
CONT_SCUMM_ORIGINAL,
|
|
|
|
CONT_SCUMM_SAMNMAX,
|
|
|
|
CONT_SKY,
|
|
|
|
CONT_SIMON,
|
|
|
|
CONT_FUTURE_WARS,
|
|
|
|
CONT_AGI,
|
|
|
|
CONT_GOBLINS
|
|
|
|
};
|
|
|
|
|
|
|
|
struct gameListType {
|
2008-05-15 22:12:51 +00:00
|
|
|
char gameId[16];
|
|
|
|
controlType control;
|
2007-06-30 23:03:03 +00:00
|
|
|
};
|
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
// Pen reading functions
|
2008-05-15 22:12:51 +00:00
|
|
|
void penInit();
|
|
|
|
void penUpdate();
|
|
|
|
bool getPenDown();
|
|
|
|
bool getPenHeld();
|
|
|
|
bool getPenReleased();
|
|
|
|
int getPenX();
|
|
|
|
int getPenY();
|
2006-07-09 11:47:17 +00:00
|
|
|
GLvector getPenPos();
|
2008-05-15 22:12:51 +00:00
|
|
|
void consumePenEvents();
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Pad reading
|
2008-05-15 22:12:51 +00:00
|
|
|
int getKeysHeld();
|
|
|
|
void keysUpdate();
|
|
|
|
int getKeysDown();
|
|
|
|
int getKeysReleased();
|
|
|
|
void consumeKeys();
|
|
|
|
int leftHandedSwap(int keys);
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Video
|
2008-05-15 22:12:51 +00:00
|
|
|
void displayMode8Bit(); // Switch to 8-bit mode5
|
|
|
|
void displayMode16Bit(); // Switch to 16-bit mode5
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Flip double buffer
|
2008-05-15 22:12:51 +00:00
|
|
|
void displayMode16BitFlipBuffer();
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Get address of current back buffer
|
2008-05-15 22:12:51 +00:00
|
|
|
u16* get16BitBackBuffer();
|
|
|
|
u16* get8BitBackBuffer();
|
|
|
|
s32 get8BitBackBufferStride();
|
|
|
|
u16* getScalerBuffer();
|
2006-07-09 11:47:17 +00:00
|
|
|
|
2008-05-15 22:12:51 +00:00
|
|
|
void setTalkPos(int x, int y);
|
|
|
|
void setTopScreenTarget(int x, int y);
|
2006-11-03 23:16:29 +00:00
|
|
|
void set200PercentFixedScale(bool on);
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Timers
|
2008-05-15 22:12:51 +00:00
|
|
|
void setTimerCallback(OSystem_DS::TimerProc proc, int interval); // Setup a callback function at a regular interval
|
|
|
|
int getMillis(); // Return the current runtime in milliseconds
|
|
|
|
void doTimerCallback(); // Call callback function if required
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Sound
|
2008-05-15 22:12:51 +00:00
|
|
|
void doSoundCallback(); // Call function if sound buffers need more data
|
|
|
|
void playSound(const void* data, u32 length, bool loop, bool adpcm = false, int rate = 22050); // Start a sound
|
|
|
|
void stopSound(int channel);
|
2006-11-03 23:16:29 +00:00
|
|
|
int getSoundFrequency();
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Event queue
|
2008-05-15 22:12:51 +00:00
|
|
|
void addEventsToQueue();
|
|
|
|
void VBlankHandler();
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Sam and Max Stuff
|
2008-05-15 22:12:51 +00:00
|
|
|
void setGameID(int id);
|
|
|
|
void setCursorIcon(const u8* icon, uint w, uint h, byte keycolor, int hotspotX, int hotspotY);
|
2007-06-30 23:03:03 +00:00
|
|
|
void setShowCursor(bool enable);
|
|
|
|
void setMouseCursorVisible(bool visible);
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Shake
|
2008-05-15 22:12:51 +00:00
|
|
|
void setShakePos(int shakePos);
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Reports
|
2008-05-15 22:12:51 +00:00
|
|
|
void memoryReport();
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// GBAMP
|
2008-05-15 22:12:51 +00:00
|
|
|
bool isGBAMPAvailable();
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Sleep (I'd like some of that right now)
|
2008-05-15 22:12:51 +00:00
|
|
|
void checkSleepMode();
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Virtual keyboard
|
2008-05-15 22:12:51 +00:00
|
|
|
void setKeyboardIcon(bool enable);
|
|
|
|
bool getKeyboardIcon();
|
|
|
|
void setKeyboardEnable(bool en);
|
|
|
|
bool getKeyboardEnable();
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
// Options
|
2008-05-15 22:12:51 +00:00
|
|
|
void setLeftHanded(bool enable);
|
|
|
|
void setTouchXOffset(int x);
|
|
|
|
void setTouchYOffset(int y);
|
|
|
|
void setUnscaledMode(bool enable);
|
2007-10-13 15:40:11 +00:00
|
|
|
void setSnapToBorder(bool enable);
|
2008-05-15 22:12:51 +00:00
|
|
|
void setIndyFightState(bool st);
|
|
|
|
bool getIndyFightState();
|
2006-10-05 22:44:11 +00:00
|
|
|
bool isCpuScalerEnabled();
|
2007-12-21 18:36:40 +00:00
|
|
|
void setCpuScalerEnable(bool enable);
|
2006-10-05 22:44:11 +00:00
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
// Display
|
2008-05-15 22:12:51 +00:00
|
|
|
bool getIsDisplayMode8Bit();
|
|
|
|
void setGameSize(int width, int height);
|
2006-07-09 11:47:17 +00:00
|
|
|
int getGameWidth();
|
|
|
|
int getGameHeight();
|
|
|
|
|
2007-04-06 18:34:53 +00:00
|
|
|
// Fast RAM allocation (ITCM)
|
|
|
|
void fastRamReset();
|
|
|
|
void* fastRamAlloc(int size);
|
|
|
|
|
|
|
|
|
2007-06-30 23:03:03 +00:00
|
|
|
gameListType* getCurrentGame();
|
|
|
|
|
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-06-30 23:03:03 +00:00
|
|
|
int cygprofile_getHBlanks();
|
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
#endif
|