Strip trailing spaces/tabs.
svn-id: r47541
This commit is contained in:
parent
ec14cd6e6a
commit
aed02365ec
300 changed files with 2078 additions and 2078 deletions
|
@ -112,7 +112,7 @@ bool PSPFilesystemNode::exists() const {
|
|||
|
||||
ret = access(_path.c_str(), F_OK);
|
||||
PowerMan.endCriticalSection();
|
||||
|
||||
|
||||
return ret == 0;
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ bool PSPFilesystemNode::isReadable() const {
|
|||
|
||||
ret = access(_path.c_str(), R_OK);
|
||||
PowerMan.endCriticalSection();
|
||||
|
||||
|
||||
return ret == 0;
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ bool PSPFilesystemNode::isWritable() const {
|
|||
|
||||
ret = access(_path.c_str(), W_OK);
|
||||
PowerMan.endCriticalSection();
|
||||
|
||||
|
||||
return ret == 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,11 +39,11 @@ PSPIoStream::PSPIoStream(const Common::String &path, bool writeMode)
|
|||
assert(!path.empty());
|
||||
|
||||
_handle = (void *)0; // Need to do this since base class asserts not 0.
|
||||
_ferror = false;
|
||||
_ferror = false;
|
||||
_feof = false;
|
||||
_pos = 0;
|
||||
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
_errorSuspend = 0;
|
||||
_errorSource = 0;
|
||||
_errorPos = 0;
|
||||
|
@ -71,7 +71,7 @@ void *PSPIoStream::open() {
|
|||
if (PowerMan.beginCriticalSection() == PowerManager::Blocked) {
|
||||
// No need to open. Just return the _handle resume() already opened.
|
||||
PSPDebugSuspend("Suspended in PSPIoStream::open\n");
|
||||
}
|
||||
}
|
||||
|
||||
_handle = fopen(_path.c_str(), _writeMode ? "wb" : "rb"); // open
|
||||
|
||||
|
@ -84,15 +84,15 @@ void *PSPIoStream::open() {
|
|||
|
||||
bool PSPIoStream::err() const {
|
||||
if (_ferror)
|
||||
PSPDebugSuspend("In PSPIoStream::err - mem_ferror=%d, source=%d, suspend error=%d, pos=%d, _errorPos=%d, _errorHandle=%p, suspendCount=%d _handle\n",
|
||||
PSPDebugSuspend("In PSPIoStream::err - mem_ferror=%d, source=%d, suspend error=%d, pos=%d, _errorPos=%d, _errorHandle=%p, suspendCount=%d _handle\n",
|
||||
_ferror, _errorSource, _errorSuspend, _pos, _errorPos, _errorHandle, _suspendCount);
|
||||
|
||||
|
||||
return _ferror;
|
||||
}
|
||||
|
||||
void PSPIoStream::clearErr() {
|
||||
_ferror = false; // Remove regular error bit
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool PSPIoStream::eos() const {
|
||||
|
@ -111,14 +111,14 @@ int32 PSPIoStream::size() const {
|
|||
fseek((FILE *)_handle, 0, SEEK_END);
|
||||
int32 length = ftell((FILE *)_handle);
|
||||
fseek((FILE *)_handle, _pos, SEEK_SET);
|
||||
|
||||
|
||||
if (_pos < 0 || length < 0) { // Check for errors
|
||||
PSPDebugSuspend("In PSPIoStream::size(). encountered an error!\n");
|
||||
_ferror = true;
|
||||
length = -1; // If our oldPos is bad, we want length to be bad too to signal
|
||||
clearerr((FILE *)_handle);
|
||||
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
_errorSource = 2;
|
||||
#endif
|
||||
}
|
||||
|
@ -134,21 +134,21 @@ bool PSPIoStream::seek(int32 offs, int whence) {
|
|||
PSPDebugSuspend("Suspended in PSPIoStream::seek()\n");
|
||||
|
||||
int ret = fseek((FILE *)_handle, offs, whence);
|
||||
|
||||
|
||||
if (ret != 0) {
|
||||
_ferror = true;
|
||||
PSPDebugSuspend("In PSPIoStream::seek(). encountered an error!\n");
|
||||
clearerr((FILE *)_handle);
|
||||
_feof = feof((FILE *)_handle);
|
||||
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
_errorSource = 3;
|
||||
#endif
|
||||
}
|
||||
else { // everything ok
|
||||
_feof = false; // Reset eof flag since we know it was ok
|
||||
}
|
||||
|
||||
|
||||
_pos = ftell((FILE *)_handle); // update pos
|
||||
|
||||
PowerMan.endCriticalSection();
|
||||
|
@ -161,10 +161,10 @@ uint32 PSPIoStream::read(void *ptr, uint32 len) {
|
|||
if (PowerMan.beginCriticalSection() == PowerManager::Blocked)
|
||||
PSPDebugSuspend("Suspended in PSPIoStream::read()\n");
|
||||
|
||||
size_t ret = fread((byte *)ptr, 1, len, (FILE *)_handle);
|
||||
size_t ret = fread((byte *)ptr, 1, len, (FILE *)_handle);
|
||||
|
||||
_pos += ret; // Update pos
|
||||
|
||||
|
||||
if (ret != len) { // Check for eof
|
||||
_feof = feof((FILE *)_handle);
|
||||
if (!_feof) { // It wasn't an eof. Must be an error
|
||||
|
@ -173,14 +173,14 @@ uint32 PSPIoStream::read(void *ptr, uint32 len) {
|
|||
_pos = ftell((FILE *)_handle); // Update our position
|
||||
PSPDebugSuspend("In PSPIoStream::read(). encountered an error!\n");
|
||||
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
_errorSource = 4;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PowerMan.endCriticalSection();
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -199,7 +199,7 @@ uint32 PSPIoStream::write(const void *ptr, uint32 len) {
|
|||
_pos = ftell((FILE *)_handle); // Update pos
|
||||
PSPDebugTrace("In PSPIoStream::write(). encountered an error!\n");
|
||||
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
_errorSource = 5;
|
||||
#endif
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ bool PSPIoStream::flush() {
|
|||
clearerr((FILE *)_handle);
|
||||
PSPDebugSuspend("In PSPIoStream::flush(). encountered an error!\n");
|
||||
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
_errorSource = 6;
|
||||
#endif
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ int PSPIoStream::suspend() {
|
|||
_errorSuspend = SuspendError;
|
||||
_errorPos = _pos;
|
||||
_errorHandle = _handle;
|
||||
}
|
||||
}
|
||||
#endif /* __PSP_DEBUG_SUSPEND__ */
|
||||
|
||||
if (_handle > 0) {
|
||||
|
@ -275,7 +275,7 @@ int PSPIoStream::resume() {
|
|||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
_suspendCount--;
|
||||
#endif
|
||||
|
||||
|
||||
// We reopen our file descriptor
|
||||
_handle = fopen(_path.c_str(), _writeMode ? "wb" : "rb");
|
||||
if (_handle <= 0) {
|
||||
|
|
|
@ -48,12 +48,12 @@ protected:
|
|||
|
||||
int _errorSuspend;
|
||||
mutable int _errorSource;
|
||||
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
int _errorPos;
|
||||
void * _errorHandle;
|
||||
void * _errorHandle;
|
||||
int _suspendCount;
|
||||
#endif /* __PSP_DEBUG_SUSPEND__ */
|
||||
#endif /* __PSP_DEBUG_SUSPEND__ */
|
||||
|
||||
public:
|
||||
/**
|
||||
|
|
|
@ -85,7 +85,7 @@ class OSystem_Dreamcast : private DCHardware, public BaseBackend, public Filesys
|
|||
// Determine the pixel format currently in use for screen rendering.
|
||||
Graphics::PixelFormat getScreenFormat() const;
|
||||
|
||||
// Returns a list of all pixel formats supported by the backend.
|
||||
// Returns a list of all pixel formats supported by the backend.
|
||||
Common::List<Graphics::PixelFormat> getSupportedFormats();
|
||||
|
||||
// Set the size of the video bitmap.
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
.byte 0x0F @32KiB @ Log [base-2] of the size of this driver in bytes.
|
||||
.byte 0x00 @ Sections to fix
|
||||
.byte 0x0F @32KiB @ Log [base-2] of the allocated space in bytes.
|
||||
|
||||
|
||||
@---------------------------------------------------------------------------------
|
||||
@ Text identifier - can be anything up to 47 chars + terminating null -- 16 bytes
|
||||
.align 4
|
||||
|
@ -42,13 +42,13 @@ _dldi_driver_name:
|
|||
_io_dldi:
|
||||
.ascii "DLDI" @ ioType
|
||||
.word 0x00000000 @ Features
|
||||
.word _DLDI_startup @
|
||||
.word _DLDI_isInserted @
|
||||
.word _DLDI_startup @
|
||||
.word _DLDI_isInserted @
|
||||
.word _DLDI_readSectors @ Function pointers to standard device driver functions
|
||||
.word _DLDI_writeSectors @
|
||||
.word _DLDI_clearStatus @
|
||||
.word _DLDI_shutdown @
|
||||
|
||||
.word _DLDI_writeSectors @
|
||||
.word _DLDI_clearStatus @
|
||||
.word _DLDI_shutdown @
|
||||
|
||||
@---------------------------------------------------------------------------------
|
||||
|
||||
_DLDI_startup:
|
||||
|
|
|
@ -54,7 +54,7 @@ sd_write_loop2:
|
|||
|
||||
sd_write_busy:
|
||||
bl clkin
|
||||
ldrh r0,[r1]
|
||||
ldrh r0,[r1]
|
||||
tst r0,#0x100
|
||||
beq sd_write_busy
|
||||
ldmfd r13!,{r0-r1}
|
||||
|
@ -68,10 +68,10 @@ SD_crc16:
|
|||
stmfd r13!,{r4-r9}
|
||||
mov r9,r2
|
||||
|
||||
mov r3,#0
|
||||
mov r4,#0
|
||||
mov r5,#0
|
||||
mov r6,#0
|
||||
mov r3,#0
|
||||
mov r4,#0
|
||||
mov r5,#0
|
||||
mov r6,#0
|
||||
|
||||
ldr r7,=0x80808080
|
||||
ldr r8,=0x1021
|
||||
|
@ -86,19 +86,19 @@ sd_crc16_loop:
|
|||
eorne r3,r3,r8
|
||||
tst r2,r7,lsr #24
|
||||
eorne r3,r3,r8
|
||||
|
||||
|
||||
mov r4,r4,lsl #1
|
||||
tst r4,#0x10000
|
||||
eorne r4,r4,r8
|
||||
tst r2,r7,lsr #25
|
||||
eorne r4,r4,r8
|
||||
|
||||
|
||||
mov r5,r5,lsl #1
|
||||
tst r5,#0x10000
|
||||
eorne r5,r5,r8
|
||||
tst r2,r7,lsr #26
|
||||
eorne r5,r5,r8
|
||||
|
||||
|
||||
mov r6,r6,lsl #1
|
||||
tst r6,#0x10000
|
||||
eorne r6,r6,r8
|
||||
|
@ -107,7 +107,7 @@ sd_crc16_loop:
|
|||
|
||||
mov r7,r7,ror #4
|
||||
subs r1,r1,#4
|
||||
bne sd_crc16_loop
|
||||
bne sd_crc16_loop
|
||||
|
||||
mov r2,r9
|
||||
mov r8,#16
|
||||
|
@ -145,7 +145,7 @@ SD_data_write:
|
|||
mov r2,#SDODA
|
||||
sd_data_write_busy:
|
||||
bl clkin
|
||||
ldrh r3,[r2]
|
||||
ldrh r3,[r2]
|
||||
tst r3,#0x100
|
||||
beq sd_data_write_busy
|
||||
|
||||
|
@ -169,7 +169,7 @@ sd_data_write_loop:
|
|||
bl clkout
|
||||
|
||||
subs r5, r5, #2
|
||||
bne sd_data_write_loop
|
||||
bne sd_data_write_loop
|
||||
|
||||
cmp r1,#0
|
||||
movne r0,r1
|
||||
|
@ -184,10 +184,10 @@ sd_data_write_loop2:
|
|||
bl clkout
|
||||
subs r5, r5, #1
|
||||
bne sd_data_write_loop2
|
||||
|
||||
|
||||
sd_data_write_busy2:
|
||||
bl clkin
|
||||
ldrh r3,[r2]
|
||||
ldrh r3,[r2]
|
||||
tst r3,#0x100
|
||||
beq sd_data_write_busy2
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
.TEXT
|
||||
@--------------------------------sd data--------------------------------
|
||||
.equ sd_comadd,0x9800000
|
||||
.equ sd_dataadd,0x9000000
|
||||
.equ sd_dataadd,0x9000000
|
||||
.equ sd_dataradd,0x9100000
|
||||
@-----------------viod sd_data_write_s(u16 *buff,u16* crc16buff)-------------------
|
||||
.ALIGN
|
||||
.GLOBAL sd_data_write_s
|
||||
.GLOBAL sd_data_write_s
|
||||
.CODE 32
|
||||
sd_data_write_s:
|
||||
stmfd r13!,{r4-r5}
|
||||
mov r5,#512
|
||||
mov r2,#sd_dataadd
|
||||
sd_data_write_busy:
|
||||
ldrh r3,[r2]
|
||||
ldrh r3,[r2]
|
||||
tst r3,#0x100
|
||||
beq sd_data_write_busy
|
||||
|
||||
ldrh r3,[r2]
|
||||
ldrh r3,[r2]
|
||||
|
||||
mov r3,#0 @star bit
|
||||
strh r3,[r2]
|
||||
|
@ -24,10 +24,10 @@ sd_data_write_loop:
|
|||
ldrh r3,[r0],#2
|
||||
add r3,r3,r3,lsl #20
|
||||
mov r4,r3,lsl #8
|
||||
stmia r2,{r3-r4}
|
||||
|
||||
subs r5, r5, #2
|
||||
bne sd_data_write_loop
|
||||
stmia r2,{r3-r4}
|
||||
|
||||
subs r5, r5, #2
|
||||
bne sd_data_write_loop
|
||||
|
||||
cmp r1,#0
|
||||
movne r0,r1
|
||||
|
@ -38,11 +38,11 @@ sd_data_write_loop:
|
|||
mov r3,#0xff @end bit
|
||||
strh r3,[r2]
|
||||
sd_data_write_loop2:
|
||||
ldrh r3,[r2]
|
||||
ldrh r3,[r2]
|
||||
tst r3,#0x100
|
||||
bne sd_data_write_loop2
|
||||
|
||||
ldmia r2,{r3-r4}
|
||||
ldmia r2,{r3-r4}
|
||||
|
||||
ldmfd r13!,{r4-r5}
|
||||
bx r14
|
||||
|
@ -50,7 +50,7 @@ sd_data_write_loop2:
|
|||
|
||||
@----------void sd_data_read_s(u16 *buff)-------------
|
||||
.ALIGN
|
||||
.GLOBAL sd_data_read_s
|
||||
.GLOBAL sd_data_read_s
|
||||
.CODE 32
|
||||
sd_data_read_s:
|
||||
stmfd r13!,{r4}
|
||||
|
@ -61,62 +61,62 @@ sd_data_read_loop1:
|
|||
bne sd_data_read_loop1
|
||||
mov r2,#512
|
||||
sd_data_read_loop:
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
mov r3,r4,lsr #16
|
||||
strh r3 ,[r0],#2
|
||||
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
mov r3,r4,lsr #16
|
||||
strh r3 ,[r0],#2
|
||||
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
mov r3,r4,lsr #16
|
||||
strh r3 ,[r0],#2
|
||||
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
mov r3,r4,lsr #16
|
||||
strh r3 ,[r0],#2
|
||||
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
mov r3,r4,lsr #16
|
||||
strh r3 ,[r0],#2
|
||||
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
mov r3,r4,lsr #16
|
||||
strh r3 ,[r0],#2
|
||||
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
mov r3,r4,lsr #16
|
||||
strh r3 ,[r0],#2
|
||||
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
mov r3,r4,lsr #16
|
||||
strh r3 ,[r0],#2
|
||||
|
||||
subs r2, r2, #16
|
||||
bne sd_data_read_loop
|
||||
subs r2, r2, #16
|
||||
bne sd_data_read_loop
|
||||
|
||||
ldmia r1,{r3-r4} @crc 16
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
ldmia r1,{r3-r4}
|
||||
ldrh r3,[r1] @end bit
|
||||
ldmfd r13!,{r4}
|
||||
ldmfd r13!,{r4}
|
||||
bx r14
|
||||
@----------end sd_data_read_s-------------
|
||||
|
||||
@------void sd_com_crc16_s(u16* buff,u16 num,u16* crc16buff)
|
||||
.ALIGN
|
||||
.GLOBAL sd_crc16_s
|
||||
.GLOBAL sd_crc16_s
|
||||
.CODE 32
|
||||
sd_crc16_s:
|
||||
stmfd r13!,{r4-r9}
|
||||
mov r9,r2
|
||||
|
||||
mov r3,#0
|
||||
mov r4,#0
|
||||
mov r5,#0
|
||||
mov r6,#0
|
||||
mov r3,#0
|
||||
mov r4,#0
|
||||
mov r5,#0
|
||||
mov r6,#0
|
||||
|
||||
ldr r7,=0x80808080
|
||||
ldr r8,=0x1021
|
||||
|
@ -131,19 +131,19 @@ sd_crc16_loop:
|
|||
eorne r3,r3,r8
|
||||
tst r2,r7,lsr #24
|
||||
eorne r3,r3,r8
|
||||
|
||||
|
||||
mov r4,r4,lsl #1
|
||||
tst r4,#0x10000
|
||||
eorne r4,r4,r8
|
||||
tst r2,r7,lsr #25
|
||||
eorne r4,r4,r8
|
||||
|
||||
|
||||
mov r5,r5,lsl #1
|
||||
tst r5,#0x10000
|
||||
eorne r5,r5,r8
|
||||
tst r2,r7,lsr #26
|
||||
eorne r5,r5,r8
|
||||
|
||||
|
||||
mov r6,r6,lsl #1
|
||||
tst r6,#0x10000
|
||||
eorne r6,r6,r8
|
||||
|
@ -152,7 +152,7 @@ sd_crc16_loop:
|
|||
|
||||
mov r7,r7,ror #4
|
||||
subs r1,r1,#4
|
||||
bne sd_crc16_loop
|
||||
bne sd_crc16_loop
|
||||
|
||||
mov r2,r9
|
||||
mov r8,#16
|
||||
|
@ -184,7 +184,7 @@ sd_crc16_write_data:
|
|||
|
||||
@--------------u8 sd_crc7_s(u16* buff,u16 num)----------------------------
|
||||
.ALIGN
|
||||
.GLOBAL sd_crc7_s
|
||||
.GLOBAL sd_crc7_s
|
||||
.CODE 32
|
||||
sd_crc7_s:
|
||||
stmfd r13!,{r4}
|
||||
|
@ -206,7 +206,7 @@ sd_crc7_loop:
|
|||
|
||||
mov r4,r4,ror #1
|
||||
subs r1,r1,#1
|
||||
bne sd_crc7_loop
|
||||
bne sd_crc7_loop
|
||||
|
||||
mov r3,r3,lsl #1
|
||||
add r0,r3,#1
|
||||
|
@ -216,7 +216,7 @@ sd_crc7_loop:
|
|||
|
||||
@--------------sd_com_read_s(u16* buff,u32 num)------------------
|
||||
.ALIGN
|
||||
.GLOBAL sd_com_read_s
|
||||
.GLOBAL sd_com_read_s
|
||||
.CODE 32
|
||||
|
||||
sd_com_read_s:
|
||||
|
@ -229,8 +229,8 @@ sd_com_read_loop1:
|
|||
|
||||
sd_com_read_loop:
|
||||
ldmia r2,{r3-r6}
|
||||
subs r1, r1, #1
|
||||
bne sd_com_read_loop
|
||||
subs r1, r1, #1
|
||||
bne sd_com_read_loop
|
||||
ldmfd r13!,{r4-r6}
|
||||
bx r14
|
||||
@--------------end sd_com_read_s------------------
|
||||
|
@ -242,14 +242,14 @@ sd_com_read_loop:
|
|||
.CODE 32
|
||||
sd_com_write_s:
|
||||
stmfd r13!,{r4-r6}
|
||||
|
||||
|
||||
mov r2,#sd_comadd
|
||||
sd_com_write_busy:
|
||||
ldrh r3,[r2]
|
||||
ldrh r3,[r2]
|
||||
tst r3,#0x1
|
||||
beq sd_com_write_busy
|
||||
|
||||
ldrh r3,[r2]
|
||||
ldrh r3,[r2]
|
||||
|
||||
sd_com_write_loop:
|
||||
ldrb r3,[r0],#1
|
||||
|
@ -257,9 +257,9 @@ sd_com_write_loop:
|
|||
mov r4,r3,lsl #2
|
||||
mov r5,r4,lsl #2
|
||||
mov r6,r5,lsl #2
|
||||
stmia r2,{r3-r6}
|
||||
subs r1, r1, #1
|
||||
bne sd_com_write_loop
|
||||
stmia r2,{r3-r6}
|
||||
subs r1, r1, #1
|
||||
bne sd_com_write_loop
|
||||
ldmfd r13!,{r4-r6}
|
||||
|
||||
bx r14
|
||||
|
@ -267,7 +267,7 @@ sd_com_write_loop:
|
|||
|
||||
@-----------------void send_clk(u32 num)---------
|
||||
.ALIGN
|
||||
.GLOBAL send_clk
|
||||
.GLOBAL send_clk
|
||||
.CODE 32
|
||||
|
||||
send_clk:
|
||||
|
@ -281,7 +281,7 @@ send_clk_loop1:
|
|||
|
||||
@---------------------------void SDCommand(u8 command,u8 num,u32 sector)--------------------
|
||||
.ALIGN
|
||||
.GLOBAL SDCommand
|
||||
.GLOBAL SDCommand
|
||||
.CODE 32
|
||||
@void SDCommand(u8 command,u8 num,u32 sector )
|
||||
@{
|
||||
|
@ -338,12 +338,12 @@ SDCommand:
|
|||
@ register u16 i,j;
|
||||
@ i=readnum;
|
||||
@ sectno<<=9;
|
||||
@ SDCommand(18,0,sector);
|
||||
@ SDCommand(18,0,sector);
|
||||
@ for (j=0;j<i ; j++)
|
||||
@ {
|
||||
@ sd_data_read_s((u32)buff+j*512);
|
||||
@ }
|
||||
@ SDCommand(12,0,0);
|
||||
@ SDCommand(12,0,0);
|
||||
@ get_resp();
|
||||
@ send_clk(0x10);
|
||||
@
|
||||
|
@ -363,7 +363,7 @@ beginforj_ReadSector:
|
|||
cmp r6,r5
|
||||
bge endforj_ReadSector
|
||||
mov r0,r4
|
||||
add r0,r0,r6,lsl #9
|
||||
add r0,r0,r6,lsl #9
|
||||
bl sd_data_read_s
|
||||
add r6,r6,#1
|
||||
b beginforj_ReadSector
|
||||
|
@ -408,17 +408,17 @@ get_resp:
|
|||
@
|
||||
@ sectno<<=9;
|
||||
@
|
||||
@ SDCommand(25,0,sector);
|
||||
@ SDCommand(25,0,sector);
|
||||
@ get_resp();
|
||||
@ send_clk(0x10);
|
||||
@ send_clk(0x10);
|
||||
@
|
||||
@ for (j=0;j<i ; j++)
|
||||
@ {
|
||||
@ sd_crc16_s((u32)(u32)buff+j*512,512,(u32)crc16);
|
||||
@ sd_data_write_s((u32)buff+j*512,(u32)crc16);
|
||||
@ send_clk(0x10);
|
||||
@ send_clk(0x10);
|
||||
@ }
|
||||
@ SDCommand(12,0,0);
|
||||
@ SDCommand(12,0,0);
|
||||
@ get_resp();
|
||||
@ send_clk(0x10);
|
||||
@ while((*(u16*)sd_dataadd &0x0100)==0);
|
||||
|
@ -451,7 +451,7 @@ beginforj_WriteSector:
|
|||
add r2,r13,#4
|
||||
bl sd_crc16_s
|
||||
mov r0,r4
|
||||
add r0,r0,r6,lsl #9
|
||||
add r0,r0,r6,lsl #9
|
||||
add r1,r13,#4
|
||||
bl sd_data_write_s
|
||||
mov r0,#0x10
|
||||
|
@ -481,7 +481,7 @@ beginwhile_WriteSector:
|
|||
.GLOBAL InitSCMode
|
||||
.CODE 32
|
||||
InitSCMode:
|
||||
mvn r0,#0x0F6000000
|
||||
mvn r0,#0x0F6000000
|
||||
sub r0,r0,#0x01
|
||||
mov r1,#0x0A500
|
||||
add r1,r1,#0x5A
|
||||
|
|
|
@ -423,7 +423,7 @@ uint getSizeNextPOT(uint size) {
|
|||
CGPoint point = [touch locationInView:self];
|
||||
if (!getLocalMouseCoords(&point))
|
||||
return;
|
||||
|
||||
|
||||
[self addEvent:
|
||||
[[NSDictionary alloc] initWithObjectsAndKeys:
|
||||
[NSNumber numberWithInt:kInputMouseDragged], @"type",
|
||||
|
@ -432,13 +432,13 @@ uint getSizeNextPOT(uint size) {
|
|||
nil
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
} else if (touch == _secondTouch) {
|
||||
|
||||
CGPoint point = [touch locationInView:self];
|
||||
if (!getLocalMouseCoords(&point))
|
||||
return;
|
||||
|
||||
|
||||
[self addEvent:
|
||||
[[NSDictionary alloc] initWithObjectsAndKeys:
|
||||
[NSNumber numberWithInt:kInputMouseSecondDragged], @"type",
|
||||
|
@ -447,7 +447,7 @@ uint getSizeNextPOT(uint size) {
|
|||
nil
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -294,7 +294,7 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x,
|
|||
|
||||
int vecX = (x - _gestureStartX);
|
||||
int vecY = (y - _gestureStartY);
|
||||
|
||||
|
||||
int absX = abs(vecX);
|
||||
int absY = abs(vecY);
|
||||
|
||||
|
@ -315,7 +315,7 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x,
|
|||
_needEventRestPeriod = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (absX < kMaxDeviation && -vecY >= kNeededLength) {
|
||||
// Swipe up
|
||||
_mouseClickAndDragEnabled = !_mouseClickAndDragEnabled;
|
||||
|
@ -329,7 +329,7 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x,
|
|||
dialog.runModal();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (absY < kMaxDeviation && vecX >= kNeededLength) {
|
||||
// Swipe right
|
||||
_touchpadModeEnabled = !_touchpadModeEnabled;
|
||||
|
@ -343,7 +343,7 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x,
|
|||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (absY < kMaxDeviation && -vecX >= kNeededLength) {
|
||||
// Swipe left
|
||||
return false;
|
||||
|
|
|
@ -110,7 +110,7 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
|
|||
ev.key.keysym.sym = SDLK_RIGHTBRACKET;
|
||||
}
|
||||
// mod+vol'-' -> volume'-'
|
||||
else if (ev.key.keysym.sym == SDLK_d) {
|
||||
else if (ev.key.keysym.sym == SDLK_d) {
|
||||
ev.key.keysym.sym = SDLK_LEFTBRACKET;
|
||||
}
|
||||
#endif
|
||||
|
@ -175,33 +175,33 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
|
|||
fillMouseEvent(event, _km.x, _km.y);
|
||||
|
||||
return true;
|
||||
} else if (ev.key.keysym.sym == SDLK_RETURN) {
|
||||
// Joystick center to pressing Left Mouse
|
||||
} else if (ev.key.keysym.sym == SDLK_RETURN) {
|
||||
// Joystick center to pressing Left Mouse
|
||||
if (ev.key.type == SDL_KEYDOWN) {
|
||||
event.type = Common::EVENT_LBUTTONDOWN;
|
||||
} else {
|
||||
event.type = Common::EVENT_LBUTTONUP;
|
||||
event.type = Common::EVENT_LBUTTONUP;
|
||||
}
|
||||
|
||||
fillMouseEvent(event, _km.x, _km.y);
|
||||
|
||||
return true;
|
||||
} else if (ev.key.keysym.sym == SDLK_PLUS) {
|
||||
} else if (ev.key.keysym.sym == SDLK_PLUS) {
|
||||
// Volume Up to pressing Right Mouse
|
||||
if (ev.key.type == SDL_KEYDOWN ) {
|
||||
event.type = Common::EVENT_RBUTTONDOWN;
|
||||
} else {
|
||||
event.type = Common::EVENT_RBUTTONUP;
|
||||
event.type = Common::EVENT_RBUTTONUP;
|
||||
}
|
||||
fillMouseEvent(event, _km.x, _km.y);
|
||||
|
||||
return true;
|
||||
} else if (ev.key.keysym.sym == SDLK_MINUS) {
|
||||
// Volume Down to pressing Left Mouse
|
||||
} else if (ev.key.keysym.sym == SDLK_MINUS) {
|
||||
// Volume Down to pressing Left Mouse
|
||||
if (ev.key.type == SDL_KEYDOWN) {
|
||||
event.type = Common::EVENT_LBUTTONDOWN;
|
||||
} else {
|
||||
event.type = Common::EVENT_LBUTTONUP;
|
||||
event.type = Common::EVENT_LBUTTONUP;
|
||||
}
|
||||
|
||||
fillMouseEvent(event, _km.x, _km.y);
|
||||
|
@ -214,7 +214,7 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
|
|||
event.type = Common::EVENT_KEYDOWN;
|
||||
event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
|
||||
event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
void OSystem_LINUXMOTO::preprocessEvents(SDL_Event *event) {
|
||||
if (event->type == SDL_ACTIVEEVENT) {
|
||||
if (event->active.state == SDL_APPINPUTFOCUS && !event->active.gain) {
|
||||
suspendAudio();
|
||||
suspendAudio();
|
||||
for (;;) {
|
||||
if (!SDL_WaitEvent(event)) {
|
||||
SDL_Delay(10);
|
||||
|
@ -61,7 +61,7 @@ int OSystem_LINUXMOTO::resumeAudio() {
|
|||
SDL_PauseAudio(0);
|
||||
_audioSuspended = false;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void OSystem_LINUXMOTO::setupMixer() {
|
||||
OSystem_SDL::setupMixer();
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
|
||||
#
|
||||
#
|
||||
# This file is dual licensed, with permission by the original author
|
||||
# TyRaNiD, under both the Academic Free License version 2.0 and the GNU
|
||||
# General Public License version 2 or later.
|
||||
#
|
||||
#
|
||||
# This means you can choose whether to use this code under the terms of
|
||||
# the Academic Free License version 2.0, or under the terms of the GNU
|
||||
# General Public License version 2 or later. As long as you comply to the
|
||||
# terms of at least one of these, you are allowed to use the code as
|
||||
# permitted by the respective license.
|
||||
#
|
||||
#
|
||||
# $Id$
|
||||
# USB Keyboard Driver for PS2
|
||||
*/
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
# This file is dual licensed, with permission by the original author
|
||||
# TyRaNiD, under both the Academic Free License version 2.0 and the GNU
|
||||
# General Public License version 2 or later.
|
||||
#
|
||||
#
|
||||
# This means you can choose whether to use this code under the terms of
|
||||
# the Academic Free License version 2.0, or under the terms of the GNU
|
||||
# General Public License version 2 or later. As long as you comply to the
|
||||
# terms of at least one of these, you are allowed to use the code as
|
||||
# permitted by the respective license.
|
||||
#
|
||||
#
|
||||
# $Id$
|
||||
# USB Keyboard Driver for PS2
|
||||
*/
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# This file is dual licensed, with permission by the original author
|
||||
# TyRaNiD, under both the Academic Free License version 2.0 and the GNU
|
||||
# General Public License version 2 or later.
|
||||
#
|
||||
#
|
||||
# This means you can choose whether to use this code under the terms of
|
||||
# the Academic Free License version 2.0, or under the terms of the GNU
|
||||
# General Public License version 2 or later. As long as you comply to the
|
||||
|
|
|
@ -119,7 +119,7 @@ public:
|
|||
virtual Common::SeekableReadStream *createConfigReadStream();
|
||||
virtual Common::WriteStream *createConfigWriteStream();
|
||||
|
||||
virtual Graphics::PixelFormat getOverlayFormat() const;
|
||||
virtual Graphics::PixelFormat getOverlayFormat() const;
|
||||
virtual Common::SaveFileManager *getSavefileManager();
|
||||
virtual FilesystemFactory *getFilesystemFactory();
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#ifndef BACKENDS_ELF_H
|
||||
#define BACKENDS_ELF_H
|
||||
|
||||
|
||||
/* ELF stuff */
|
||||
|
||||
typedef unsigned short Elf32_Half, Elf32_Section;
|
||||
|
@ -209,6 +209,6 @@ typedef struct
|
|||
unsigned int __valgp; \
|
||||
__asm__ ("add %0, $gp, $0" : "=r"(__valgp) : ); \
|
||||
__valgp; \
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
#endif /* BACKENDS_ELF_H */
|
||||
|
|
|
@ -713,7 +713,7 @@ bool OSystem_PSP::processInput(Common::Event &event) {
|
|||
int newDpadX = 0, newDpadY = 0;
|
||||
event.kbd.ascii = 0;
|
||||
event.kbd.flags = 0;
|
||||
|
||||
|
||||
if (pad.Buttons & PSP_CTRL_UP) {
|
||||
newDpadY += 1;
|
||||
if (pad.Buttons & PSP_CTRL_RTRIGGER)
|
||||
|
@ -740,7 +740,7 @@ bool OSystem_PSP::processInput(Common::Event &event) {
|
|||
event.type = Common::EVENT_KEYDOWN;
|
||||
event.kbd.keycode = getDpadEvent(newDpadX, newDpadY);
|
||||
event.kbd.ascii = event.kbd.keycode - Common::KEYCODE_KP0 + '0';
|
||||
_dpadX = newDpadX;
|
||||
_dpadX = newDpadX;
|
||||
_dpadY = newDpadY;
|
||||
}
|
||||
else if (newDpadX == 0 && newDpadY == 0) {// We unpressed dpad
|
||||
|
@ -756,11 +756,11 @@ bool OSystem_PSP::processInput(Common::Event &event) {
|
|||
_dpadX = 0; // so that we'll pick up a new dpad movement
|
||||
_dpadY = 0;
|
||||
}
|
||||
|
||||
|
||||
_prevButtons = pad.Buttons;
|
||||
return true;
|
||||
|
||||
} else if (buttonsChanged & (PSP_CTRL_CROSS | PSP_CTRL_CIRCLE | PSP_CTRL_LTRIGGER | PSP_CTRL_RTRIGGER | PSP_CTRL_START |
|
||||
|
||||
} else if (buttonsChanged & (PSP_CTRL_CROSS | PSP_CTRL_CIRCLE | PSP_CTRL_LTRIGGER | PSP_CTRL_RTRIGGER | PSP_CTRL_START |
|
||||
PSP_CTRL_SELECT | PSP_CTRL_SQUARE | PSP_CTRL_TRIANGLE)) {
|
||||
if (buttonsChanged & PSP_CTRL_CROSS) {
|
||||
event.type = (pad.Buttons & PSP_CTRL_CROSS) ? Common::EVENT_LBUTTONDOWN : Common::EVENT_LBUTTONUP;
|
||||
|
@ -769,7 +769,7 @@ bool OSystem_PSP::processInput(Common::Event &event) {
|
|||
} else {
|
||||
//any of the other buttons.
|
||||
event.type = buttonsChanged & pad.Buttons ? Common::EVENT_KEYDOWN : Common::EVENT_KEYUP;
|
||||
|
||||
|
||||
if (buttonsChanged & PSP_CTRL_LTRIGGER) {
|
||||
event.kbd.keycode = Common::KEYCODE_ESCAPE;
|
||||
event.kbd.ascii = 27;
|
||||
|
@ -894,7 +894,7 @@ inline Common::KeyCode OSystem_PSP::getDpadEvent(int x, int y) {
|
|||
else /* y == 1 */
|
||||
key = Common::KEYCODE_KP9;
|
||||
}
|
||||
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ protected:
|
|||
Common::TimerManager *_timer;
|
||||
|
||||
Common::KeyCode getDpadEvent(int x, int y);
|
||||
|
||||
|
||||
public:
|
||||
OSystem_PSP();
|
||||
virtual ~OSystem_PSP();
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include <psppower.h>
|
||||
#include <pspthreadman.h>
|
||||
|
||||
|
||||
#include "./powerman.h"
|
||||
#include "./trace.h"
|
||||
#include "engine.h"
|
||||
|
@ -47,19 +47,19 @@ void PowerManager::debugPM() {
|
|||
*
|
||||
* Constructor
|
||||
*
|
||||
********************************************/
|
||||
********************************************/
|
||||
PowerManager::PowerManager() {
|
||||
|
||||
|
||||
_flagMutex = NULL; /* Init mutex handle */
|
||||
_listMutex = NULL; /* Init mutex handle */
|
||||
_condSuspendable = NULL; /* Init condition variable */
|
||||
_condPM = NULL;
|
||||
|
||||
|
||||
_condSuspendable = SDL_CreateCond();
|
||||
if (_condSuspendable <= 0) {
|
||||
PSPDebugSuspend("PowerManager::PowerManager(): Couldn't create condSuspendable\n");
|
||||
}
|
||||
|
||||
|
||||
_condPM = SDL_CreateCond();
|
||||
if (_condPM <= 0) {
|
||||
PSPDebugSuspend("PowerManager::PowerManager(): Couldn't create condPM\n");
|
||||
|
@ -79,18 +79,18 @@ PowerManager::PowerManager() {
|
|||
_criticalCounter = 0;
|
||||
_pauseFlag = 0; _pauseFlagOld = 0; _pauseClientState = 0;
|
||||
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
_listCounter = 0;
|
||||
PMStatusSet(kInitDone);
|
||||
_error = 0;
|
||||
_error = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*******************************************
|
||||
*
|
||||
* Function to register to be notified when suspend/resume time comes
|
||||
*
|
||||
********************************************/
|
||||
********************************************/
|
||||
int PowerManager::registerSuspend(Suspendable *item) {
|
||||
// Register in list
|
||||
PSPDebugSuspend("In registerSuspend\n");
|
||||
|
@ -111,7 +111,7 @@ int PowerManager::registerSuspend(Suspendable *item) {
|
|||
|
||||
PSPDebugSuspend("Out of registerSuspend\n");
|
||||
debugPM();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ int PowerManager::registerSuspend(Suspendable *item) {
|
|||
*
|
||||
* Function to unregister to be notified when suspend/resume time comes
|
||||
*
|
||||
********************************************/
|
||||
********************************************/
|
||||
int PowerManager::unregisterSuspend(Suspendable *item) {
|
||||
|
||||
PSPDebugSuspend("In unregisterSuspend\n");
|
||||
|
@ -133,32 +133,32 @@ int PowerManager::unregisterSuspend(Suspendable *item) {
|
|||
_suspendList.remove(item);
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
_listCounter--;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
if (SDL_mutexV(_listMutex) != 0) {
|
||||
PSPDebugTrace("PowerManager::unregisterSuspend(): Couldn't unlock _listMutex %d\n", _listMutex);
|
||||
}
|
||||
|
||||
PSPDebugSuspend("Out of unregisterSuspend\n");
|
||||
debugPM();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************
|
||||
*
|
||||
* Destructor
|
||||
*
|
||||
********************************************/
|
||||
********************************************/
|
||||
PowerManager::~PowerManager() {
|
||||
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
PMStatusSet(kDestroyPM);
|
||||
#endif
|
||||
|
||||
|
||||
SDL_DestroyCond(_condSuspendable);
|
||||
_condSuspendable = 0;
|
||||
|
||||
|
||||
SDL_DestroyCond(_condPM);
|
||||
_condPM = 0;
|
||||
|
||||
|
@ -173,11 +173,11 @@ int PowerManager::unregisterSuspend(Suspendable *item) {
|
|||
*
|
||||
* Unsafe function to poll for a pause event (first stage of suspending)
|
||||
* Only for pausing the engine, which doesn't need high synchronization ie. we don't care if it misreads
|
||||
* the flag a couple of times since there is NO mutex protection (for performance reasons).
|
||||
* the flag a couple of times since there is NO mutex protection (for performance reasons).
|
||||
* Polling the engine happens regularly.
|
||||
* On the other hand, we don't know if there will be ANY polling which prevents us from using proper events.
|
||||
*
|
||||
********************************************/
|
||||
********************************************/
|
||||
void PowerManager::pollPauseEngine() {
|
||||
|
||||
bool pause = _pauseFlag; // We copy so as not to have multiple values
|
||||
|
@ -194,17 +194,17 @@ void PowerManager::pollPauseEngine() {
|
|||
PSPDebugSuspend("Unpausing for resume in PowerManager::pollPauseEngine()\n");
|
||||
_pauseClientState = PowerManager::Unpaused; // Tell PM we're in the middle of pausing
|
||||
}
|
||||
|
||||
|
||||
_pauseFlagOld = pause;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*******************************************
|
||||
*
|
||||
* Function to be called by threads wanting to block on the PSP entering suspend
|
||||
* Use this for small critical sections where you can easily restore the previous state.
|
||||
*
|
||||
********************************************/
|
||||
********************************************/
|
||||
int PowerManager::blockOnSuspend() {
|
||||
return beginCriticalSection(true);
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ void PowerManager::pollPauseEngine() {
|
|||
* Function to block on a suspend, then start a non-suspendable critical section
|
||||
* Use this for large or REALLY critical critical-sections.
|
||||
* Make sure to call endCriticalSection or the PSP won't suspend.
|
||||
********************************************/
|
||||
********************************************/
|
||||
|
||||
int PowerManager::beginCriticalSection(bool justBlock) {
|
||||
int ret = NotBlocked;
|
||||
|
@ -238,7 +238,7 @@ void PowerManager::pollPauseEngine() {
|
|||
PSPDebugSuspend("We got blocked!!\n");
|
||||
debugPM();
|
||||
}
|
||||
|
||||
|
||||
// Now prevent the PM from suspending until we're done
|
||||
if (justBlock == false)
|
||||
_criticalCounter++;
|
||||
|
@ -261,14 +261,14 @@ int PowerManager::endCriticalSection() {
|
|||
|
||||
// We're done with our critical section
|
||||
_criticalCounter--;
|
||||
|
||||
|
||||
if (_criticalCounter <= 0) {
|
||||
if (_suspendFlag == true) { // If the PM is sleeping, this flag must be set
|
||||
PSPDebugSuspend("Unblocked thread waking up the PM.\n");
|
||||
debugPM();
|
||||
|
||||
SDL_CondBroadcast(_condPM);
|
||||
|
||||
|
||||
PSPDebugSuspend("Woke up the PM\n");
|
||||
debugPM();
|
||||
}
|
||||
|
@ -291,10 +291,10 @@ int PowerManager::endCriticalSection() {
|
|||
*
|
||||
* Callback function to be called to put every Suspendable to suspend
|
||||
*
|
||||
********************************************/
|
||||
********************************************/
|
||||
int PowerManager::suspend() {
|
||||
int ret = 0;
|
||||
|
||||
|
||||
if (_pauseFlag) return ret; // Very important - make sure we only suspend once
|
||||
|
||||
scePowerLock(0); // Critical to make sure PSP doesn't suspend before we're done
|
||||
|
@ -302,14 +302,14 @@ int PowerManager::suspend() {
|
|||
// The first stage of suspend is pausing the engine if possible. We don't want to cause files
|
||||
// to block, or we might not get the engine to pause. On the other hand, we might wait for polling
|
||||
// and it'll never happen. We also want to do this w/o mutexes (for speed) which is ok in this case.
|
||||
_pauseFlag = true;
|
||||
_pauseFlag = true;
|
||||
|
||||
PMStatusSet(kWaitForClientPause);
|
||||
|
||||
|
||||
// Now we wait, giving the engine thread some time to find our flag.
|
||||
for (int i = 0; i < 10 && _pauseClientState == Unpaused; i++)
|
||||
sceKernelDelayThread(50000); // We wait 50 msec x 10 times = 0.5 seconds
|
||||
|
||||
|
||||
if (_pauseClientState == Pausing) { // Our event has been acknowledged. Let's wait until the client is done.
|
||||
PMStatusSet(kWaitForClientToFinishPausing);
|
||||
|
||||
|
@ -317,13 +317,13 @@ int PowerManager::suspend() {
|
|||
sceKernelDelayThread(50000); // We wait 50 msec at a time
|
||||
}
|
||||
|
||||
// It's possible that the polling thread missed our pause event, but there's nothing we can do about that.
|
||||
// It's possible that the polling thread missed our pause event, but there's nothing we can do about that.
|
||||
// We can't know if there's polling going on or not. It's usually not a critical thing anyway.
|
||||
|
||||
|
||||
PMStatusSet(kGettingFlagMutexSuspend);
|
||||
|
||||
|
||||
// Now we set the suspend flag to true to cause reading threads to block
|
||||
|
||||
|
||||
if (SDL_mutexP(_flagMutex) != 0) {
|
||||
PSPDebugTrace("PowerManager::suspend(): Couldn't lock flagMutex %d\n", _flagMutex);
|
||||
_error = Error;
|
||||
|
@ -331,9 +331,9 @@ int PowerManager::suspend() {
|
|||
}
|
||||
|
||||
PMStatusSet(kGotFlagMutexSuspend);
|
||||
|
||||
|
||||
_suspendFlag = true;
|
||||
|
||||
|
||||
// Check if anyone is in a critical section. If so, we'll wait for them
|
||||
if (_criticalCounter > 0) {
|
||||
PMStatusSet(kWaitCritSectionSuspend);
|
||||
|
@ -348,7 +348,7 @@ int PowerManager::suspend() {
|
|||
}
|
||||
|
||||
PMStatusSet(kGettingListMutexSuspend);
|
||||
|
||||
|
||||
// Loop over list, calling suspend()
|
||||
if (SDL_mutexP(_listMutex) != 0) {
|
||||
PSPDebugTrace("PowerManager::suspend(): Couldn't lock listMutex %d\n", _listMutex);
|
||||
|
@ -362,7 +362,7 @@ int PowerManager::suspend() {
|
|||
for (; i != _suspendList.end(); ++i) {
|
||||
(*i)->suspend();
|
||||
}
|
||||
|
||||
|
||||
PMStatusSet(kDoneIteratingListSuspend);
|
||||
|
||||
if (SDL_mutexV(_listMutex) != 0) {
|
||||
|
@ -373,7 +373,7 @@ int PowerManager::suspend() {
|
|||
PMStatusSet(kDoneSuspend);
|
||||
|
||||
scePowerUnlock(0); // Allow the PSP to go to sleep now
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -381,17 +381,17 @@ int PowerManager::suspend() {
|
|||
*
|
||||
* Callback function to resume every Suspendable
|
||||
*
|
||||
********************************************/
|
||||
********************************************/
|
||||
int PowerManager::resume() {
|
||||
int ret = 0;
|
||||
|
||||
// Make sure we can't get another suspend
|
||||
scePowerLock(0);
|
||||
|
||||
|
||||
if (!_pauseFlag) return ret; // Make sure we can only resume once
|
||||
|
||||
|
||||
PMStatusSet(kGettingListMutexResume);
|
||||
|
||||
|
||||
// First we notify our Suspendables. Loop over list, calling resume()
|
||||
if (SDL_mutexP(_listMutex) != 0) {
|
||||
PSPDebugTrace("PowerManager::resume(): Couldn't lock listMutex %d\n", _listMutex);
|
||||
|
@ -405,7 +405,7 @@ int PowerManager::resume() {
|
|||
for (; i != _suspendList.end(); ++i) {
|
||||
(*i)->resume();
|
||||
}
|
||||
|
||||
|
||||
PMStatusSet(kDoneIteratingListResume);
|
||||
|
||||
if (SDL_mutexV(_listMutex) != 0) {
|
||||
|
@ -413,7 +413,7 @@ int PowerManager::resume() {
|
|||
_error = Error;
|
||||
ret = Error;
|
||||
}
|
||||
|
||||
|
||||
PMStatusSet(kGettingFlagMutexResume);
|
||||
|
||||
// Now we set the suspend flag to false
|
||||
|
@ -423,11 +423,11 @@ int PowerManager::resume() {
|
|||
ret = Error;
|
||||
}
|
||||
PMStatusSet(kGotFlagMutexResume);
|
||||
|
||||
|
||||
_suspendFlag = false;
|
||||
|
||||
PMStatusSet(kSignalSuspendedThreadsResume);
|
||||
|
||||
|
||||
// Signal the other threads to wake up
|
||||
if (SDL_CondBroadcast(_condSuspendable) != 0) {
|
||||
PSPDebugTrace("PowerManager::resume(): Couldn't broadcast condition %d\n", _condSuspendable);
|
||||
|
@ -442,10 +442,10 @@ int PowerManager::resume() {
|
|||
ret = Error;
|
||||
}
|
||||
PMStatusSet(kDoneResume);
|
||||
|
||||
|
||||
_pauseFlag = false; // Signal engine to unpause
|
||||
|
||||
scePowerUnlock(0); // Allow new suspends
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -25,12 +25,12 @@
|
|||
|
||||
#ifndef POWERMAN_H
|
||||
#define POWERMAN_H
|
||||
|
||||
|
||||
#include <SDL/SDL_thread.h>
|
||||
#include <SDL/SDL_mutex.h>
|
||||
#include "common/singleton.h"
|
||||
#include "common/list.h"
|
||||
|
||||
|
||||
/*
|
||||
* Implement this class (interface) if you want to use PowerManager's suspend callback functionality
|
||||
*
|
||||
|
@ -41,11 +41,11 @@
|
|||
virtual int suspend() = 0;
|
||||
virtual int resume() = 0;
|
||||
};
|
||||
|
||||
/******************************************************************************************************
|
||||
|
||||
/******************************************************************************************************
|
||||
*
|
||||
* This class will call a Suspendable when the PSP goes to suspend/resumes. It also provides the ability to block
|
||||
* a thread when the PSP is going to suspend/suspending, and to wake it up when the PSP is resumed.
|
||||
* a thread when the PSP is going to suspend/suspending, and to wake it up when the PSP is resumed.
|
||||
* This ability is very useful for managing the PSPIoStream class, but may be found useful by other classes as well.
|
||||
*
|
||||
*******************************************************************************************************/
|
||||
|
@ -61,13 +61,13 @@ public:
|
|||
int resume(); /* callback to have all items in list resume */
|
||||
// Functions for pausing the engine
|
||||
void pollPauseEngine(); /* Poll whether the engine should be paused */
|
||||
|
||||
|
||||
enum {
|
||||
Error = -1,
|
||||
NotBlocked = 0,
|
||||
Blocked = 1
|
||||
};
|
||||
|
||||
|
||||
enum PauseState {
|
||||
Unpaused = 0,
|
||||
PauseEvent,
|
||||
|
@ -75,7 +75,7 @@ public:
|
|||
Pausing,
|
||||
Paused
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
friend class Common::Singleton<PowerManager>;
|
||||
PowerManager();
|
||||
|
@ -94,10 +94,10 @@ public:
|
|||
SDL_cond *_condPM; /* signal to wake up the PM from a critical section */
|
||||
volatile int _criticalCounter; /* Counter of how many threads are in a critical section */
|
||||
int _error; /* error code - PM can't talk to us. For debugging */
|
||||
|
||||
|
||||
// States for PM to be in (used for debugging)
|
||||
enum PMState {
|
||||
kInitDone = 1 ,
|
||||
kInitDone = 1 ,
|
||||
kDestroyPM,
|
||||
kWaitForClientPause,
|
||||
kWaitForClientToFinishPausing,
|
||||
|
@ -117,22 +117,22 @@ public:
|
|||
kSignalSuspendedThreadsResume,
|
||||
kDoneSignallingSuspendedThreadsResume,
|
||||
kDoneResume
|
||||
};
|
||||
};
|
||||
#ifdef __PSP_DEBUG_SUSPEND__
|
||||
|
||||
volatile int _listCounter; /* How many people are in the list - just for debugging */
|
||||
|
||||
|
||||
void debugPM(); /* print info about the PM */
|
||||
void PMStatusSet(PMState s) { _PMStatus = s; }
|
||||
volatile int _PMStatus; /* What the PM is doing */
|
||||
|
||||
|
||||
public:
|
||||
int getPMStatus() { return _PMStatus; }
|
||||
|
||||
#endif /* __PSP_DEBUG_SUSPEND__ */
|
||||
|
||||
|
||||
#endif /* __PSP_DEBUG_SUSPEND__ */
|
||||
|
||||
};
|
||||
|
||||
|
||||
// For easy access
|
||||
#define PowerMan PowerManager::instance()
|
||||
|
||||
|
|
|
@ -381,7 +381,7 @@ void PSPKeyboard::moveTo(const int newX, const int newY) {
|
|||
/* move the position the keyboard is currently drawn at */
|
||||
void PSPKeyboard::increaseKeyboardLocationX(int amount) {
|
||||
int newX = _moved_x + amount;
|
||||
|
||||
|
||||
if (newX > PSP_SCREEN_WIDTH - 5 || newX < 0 - 140) // clamp
|
||||
return;
|
||||
_moved_x = newX;
|
||||
|
@ -390,7 +390,7 @@ void PSPKeyboard::increaseKeyboardLocationX(int amount) {
|
|||
/* move the position the keyboard is currently drawn at */
|
||||
void PSPKeyboard::increaseKeyboardLocationY(int amount) {
|
||||
int newY = _moved_y + amount;
|
||||
|
||||
|
||||
if (newY > PSP_SCREEN_HEIGHT - 5 || newY < 0 - 140) // clamp
|
||||
return;
|
||||
_moved_y = newY;
|
||||
|
|
|
@ -68,15 +68,15 @@ private:
|
|||
u32 paletteSize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// structures used for drawing the keyboard
|
||||
struct Vertex {
|
||||
float u, v;
|
||||
unsigned int color;
|
||||
float x,y,z;
|
||||
};
|
||||
|
||||
void surface_draw_offset(struct gu_surface* surface,
|
||||
|
||||
void surface_draw_offset(struct gu_surface* surface,
|
||||
int screenX, int screenY, int offsetX, int offsetY, int intWidth, int intHeight);
|
||||
void block_copy(gu_surface* surface, u8 *texture);
|
||||
int load_png_image(Common::SeekableReadStream *, unsigned char *ImageBuffer, uint32 *palette);
|
||||
|
@ -85,7 +85,7 @@ private:
|
|||
void flipNibbles(gu_surface* surface); // Convert to PSP 4-bit format
|
||||
void increaseKeyboardLocationX(int amount); // Move keyboard onscreen
|
||||
void increaseKeyboardLocationY(int amount);
|
||||
|
||||
|
||||
static short _modeChar[MODE_COUNT][5][6];
|
||||
static const char *_guiStrings[];
|
||||
bool _init;
|
||||
|
@ -96,10 +96,10 @@ private:
|
|||
int _moved_y;
|
||||
bool _moved; // whether the keyboard was moved
|
||||
gu_surface _keyTextures[guiStringsSize];
|
||||
|
||||
|
||||
State _state; // State of keyboard Keyboard state machine
|
||||
State _lastState;
|
||||
|
||||
|
||||
enum Cursor {
|
||||
kUp = 0,
|
||||
kRight,
|
||||
|
@ -107,7 +107,7 @@ private:
|
|||
kLeft,
|
||||
kCenter
|
||||
};
|
||||
|
||||
|
||||
Cursor _oldCursor; // Point to place of last cursor
|
||||
|
||||
};
|
||||
|
|
|
@ -138,7 +138,7 @@ bool DLObject::relocate(int fd, unsigned long offset, unsigned long size, void *
|
|||
firstHi16 = i; // Keep the first Hi16 we saw
|
||||
seenHi16 = true;
|
||||
ahl = (*target & 0xffff) << 16; // Take lower 16 bits shifted up
|
||||
|
||||
|
||||
lastHiSymVal = sym->st_value;
|
||||
hi16InShorts = (ShortsMan.inGeneralSegment((char *)sym->st_value)); // Fix for problem with switching btw segments
|
||||
if (debugRelocs[0]++ < DEBUG_NUM) // Print only a set number
|
||||
|
@ -154,7 +154,7 @@ bool DLObject::relocate(int fd, unsigned long offset, unsigned long size, void *
|
|||
free(rel);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Fix: bug in gcc makes LO16s connect to wrong HI16s sometimes (shorts and regular segment)
|
||||
// Note that we can check the entire shorts segment because the executable's shorts don't belong to this plugin section
|
||||
// and will be screened out above
|
||||
|
@ -165,12 +165,12 @@ bool DLObject::relocate(int fd, unsigned long offset, unsigned long size, void *
|
|||
ahl -= (lastHiSymVal & 0xffff0000); // We assume gcc meant the same offset
|
||||
ahl += (sym->st_value & 0xffff0000);
|
||||
}
|
||||
|
||||
|
||||
ahl &= 0xffff0000; // Clean lower 16 bits for repeated LO16s
|
||||
a = *target & 0xffff; // Take lower 16 bits of the target
|
||||
a = (a << 16) >> 16; // Sign extend them
|
||||
ahl += a; // Add lower 16 bits. AHL is now complete
|
||||
|
||||
|
||||
// Fix: we can have LO16 access to the short segment sometimes
|
||||
if (lo16InShorts) {
|
||||
relocation = ahl + _shortsSegment->getOffset(); // Add in the short segment offset
|
||||
|
@ -243,7 +243,7 @@ bool DLObject::relocate(int fd, unsigned long offset, unsigned long size, void *
|
|||
case R_MIPS_32: // Absolute addressing
|
||||
if (sym->st_shndx < SHN_LOPROC) { // Only shift for plugin section.
|
||||
a = *target; // Get full 32 bits of addend
|
||||
|
||||
|
||||
if (ShortsMan.inGeneralSegment((char *)sym->st_value)) // Check if we're in the shorts segment
|
||||
relocation = a + _shortsSegment->getOffset(); // Shift by shorts offset
|
||||
else // We're in the main section
|
||||
|
|
|
@ -219,7 +219,7 @@ bool OSystem_SDL::dispatchSDLEvent(SDL_Event &ev, Common::Event &event) {
|
|||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction() {
|
|||
} else if (_transactionDetails.needUpdatescreen) {
|
||||
setGraphicsModeIntern();
|
||||
internUpdateScreen();
|
||||
}
|
||||
}
|
||||
|
||||
_transactionMode = kTransactionNone;
|
||||
return (TransactionError)errors;
|
||||
|
@ -255,10 +255,10 @@ Common::List<Graphics::PixelFormat> OSystem_SDL::getSupportedFormats() {
|
|||
Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8();
|
||||
if (_hwscreen) {
|
||||
// Get our currently set hardware format
|
||||
format = Graphics::PixelFormat(_hwscreen->format->BytesPerPixel,
|
||||
8 - _hwscreen->format->Rloss, 8 - _hwscreen->format->Gloss,
|
||||
8 - _hwscreen->format->Bloss, 8 - _hwscreen->format->Aloss,
|
||||
_hwscreen->format->Rshift, _hwscreen->format->Gshift,
|
||||
format = Graphics::PixelFormat(_hwscreen->format->BytesPerPixel,
|
||||
8 - _hwscreen->format->Rloss, 8 - _hwscreen->format->Gloss,
|
||||
8 - _hwscreen->format->Bloss, 8 - _hwscreen->format->Aloss,
|
||||
_hwscreen->format->Rshift, _hwscreen->format->Gshift,
|
||||
_hwscreen->format->Bshift, _hwscreen->format->Ashift);
|
||||
|
||||
// Workaround to MacOSX SDL not providing an accurate Aloss value.
|
||||
|
@ -482,7 +482,7 @@ static void fixupResolutionForAspectRatio(AspectRatio desiredAspectRatio, int &w
|
|||
|
||||
if (desiredAspectRatio.isAuto())
|
||||
return;
|
||||
|
||||
|
||||
int kw = desiredAspectRatio.kw();
|
||||
int kh = desiredAspectRatio.kh();
|
||||
|
||||
|
@ -545,8 +545,8 @@ bool OSystem_SDL::loadGFXMode() {
|
|||
// Create the surface that contains the 8 bit game data
|
||||
//
|
||||
#ifdef USE_RGB_COLOR
|
||||
_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight,
|
||||
_screenFormat.bytesPerPixel << 3,
|
||||
_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight,
|
||||
_screenFormat.bytesPerPixel << 3,
|
||||
((1 << _screenFormat.rBits()) - 1) << _screenFormat.rShift ,
|
||||
((1 << _screenFormat.gBits()) - 1) << _screenFormat.gShift ,
|
||||
((1 << _screenFormat.bBits()) - 1) << _screenFormat.bShift ,
|
||||
|
|
|
@ -75,9 +75,9 @@ class AspectRatio {
|
|||
public:
|
||||
AspectRatio() { _kw = _kh = 0; }
|
||||
AspectRatio(int w, int h);
|
||||
|
||||
|
||||
bool isAuto() const { return (_kw | _kh) == 0; }
|
||||
|
||||
|
||||
int kw() const { return _kw; }
|
||||
int kh() const { return _kh; }
|
||||
};
|
||||
|
|
|
@ -103,13 +103,13 @@ SymbianActions::SymbianActions()
|
|||
|
||||
void SymbianActions::initInstanceMain(OSystem *mainSystem) {
|
||||
int i;
|
||||
|
||||
|
||||
// Need to do this since all old mappings are reset after engineDone
|
||||
_initialized = false;
|
||||
Actions::initInstanceMain(mainSystem);
|
||||
|
||||
// Disable all mappings before setting main mappings again
|
||||
for (i = 0; i < ACTION_LAST; i++) {
|
||||
for (i = 0; i < ACTION_LAST; i++) {
|
||||
_action_enabled[i] = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -127,9 +127,9 @@
|
|||
#define USE_ARM_COSTUME_ASM
|
||||
#define USE_ARM_SOUND_ASM
|
||||
#endif
|
||||
// This is not really functioning yet.
|
||||
// This is not really functioning yet.
|
||||
// Default SDL keys should map to standard keys I think!
|
||||
//#define ENABLE_KEYMAPPER
|
||||
//#define ENABLE_KEYMAPPER
|
||||
|
||||
// Symbian bsearch implementation is flawed
|
||||
void *scumm_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
|
||||
|
|
|
@ -256,7 +256,7 @@ void WiiOptionsDialog::revert() {
|
|||
|
||||
void WiiOptionsDialog::load() {
|
||||
int i;
|
||||
|
||||
|
||||
i = ConfMan.getInt(_strUnderscanX,
|
||||
Common::ConfigManager::kApplicationDomain);
|
||||
_sliderUnderscanX->setValue(i);
|
||||
|
|
|
@ -326,7 +326,7 @@ bool OSystem_Wii::pollEvent(Common::Event &event) {
|
|||
if (bh & PADS_UP) {
|
||||
PAD_EVENT(PADS_START, Common::KEYCODE_F5, Common::ASCII_F5,
|
||||
Common::KBD_CTRL);
|
||||
|
||||
|
||||
if (bd & PADS_R) {
|
||||
_consoleVisible = !_consoleVisible;
|
||||
return false;
|
||||
|
|
|
@ -364,7 +364,7 @@ void OSystem_Wii::setCursorPalette(const byte *colors, uint start, uint num) {
|
|||
printf("could not init the mouse texture\n");
|
||||
::abort();
|
||||
}
|
||||
|
||||
|
||||
gfx_tex_set_bilinear_filter(&_texMouse, _bilinearFilter);
|
||||
}
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ x_loop:
|
|||
SUBS r6,r6,#16 @ width -= 16
|
||||
STRH r12,[r9],#2 @ store dA
|
||||
BGT x_loop
|
||||
|
||||
|
||||
ADD r0, r0, r8 @ srcPtr += srcSpan
|
||||
ADD r2, r2, r3 @ dstPtr += dstSpan
|
||||
SUBS r7, r7, #1
|
||||
|
|
|
@ -51,7 +51,7 @@ void PSPSaveFileManager::checkPath(const Common::FSNode &dir) {
|
|||
clearError();
|
||||
|
||||
PowerMan.beginCriticalSection();
|
||||
|
||||
|
||||
//check if the save directory exists
|
||||
SceUID fd = sceIoDopen(savePath);
|
||||
if (fd < 0) {
|
||||
|
@ -61,7 +61,7 @@ void PSPSaveFileManager::checkPath(const Common::FSNode &dir) {
|
|||
//it exists, so close it again.
|
||||
sceIoDclose(fd);
|
||||
}
|
||||
|
||||
|
||||
PowerMan.endCriticalSection();
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -121,7 +121,7 @@ protected:
|
|||
OverlayColor displayFontColor;
|
||||
|
||||
Mode() : image(0) {}
|
||||
~Mode() {
|
||||
~Mode() {
|
||||
if (image) {
|
||||
image->free();
|
||||
delete image;
|
||||
|
|
|
@ -87,7 +87,7 @@ static const EnginePlugin *detectPlugin() {
|
|||
assert(!gameid.empty());
|
||||
if (ConfMan.hasKey("gameid")) {
|
||||
gameid = ConfMan.get("gameid");
|
||||
|
||||
|
||||
// Set last selected game, that the game will be highlighted
|
||||
// on RTL
|
||||
ConfMan.set("lastselectedgame", ConfMan.getActiveDomainName(), Common::ConfigManager::kApplicationDomain);
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
* FROM_??_??(a) - convert LE/BE value v to native
|
||||
* CONSTANT_??_??(a) - convert LE/BE value v to native, implemented as macro.
|
||||
* Use with compiletime-constants only, the result will be a compiletime-constant aswell.
|
||||
* Unlike most other functions these can be used for eg. switch-case labels
|
||||
* Unlike most other functions these can be used for eg. switch-case labels
|
||||
*/
|
||||
|
||||
// Sanity check
|
||||
|
@ -103,7 +103,7 @@
|
|||
}
|
||||
|
||||
// generic fallback
|
||||
#else
|
||||
#else
|
||||
|
||||
inline uint32 SWAP_BYTES_32(uint32 a) {
|
||||
const uint16 low = (uint16)a, high = (uint16)(a >> 16);
|
||||
|
@ -184,7 +184,7 @@
|
|||
*(uint32 *)(ptr) = value;
|
||||
}
|
||||
|
||||
// test for GCC >= 4.0. these implementations will automatically use CPU-specific
|
||||
// test for GCC >= 4.0. these implementations will automatically use CPU-specific
|
||||
// instructions for unaligned data when they are available (eg. MIPS)
|
||||
#elif defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
|
||||
|
@ -326,7 +326,7 @@
|
|||
inline void WRITE_BE_UINT32(void *ptr, uint32 value) {
|
||||
WRITE_UINT32(ptr, SWAP_BYTES_32(value));
|
||||
}
|
||||
|
||||
|
||||
# endif // if defined(SCUMM_NEED_ALIGNMENT)
|
||||
|
||||
#elif defined(SCUMM_BIG_ENDIAN)
|
||||
|
@ -394,7 +394,7 @@
|
|||
inline void WRITE_LE_UINT32(void *ptr, uint32 value) {
|
||||
WRITE_UINT32(ptr, SWAP_BYTES_32(value));
|
||||
}
|
||||
|
||||
|
||||
# endif // if defined(SCUMM_NEED_ALIGNMENT)
|
||||
|
||||
#endif // if defined(SCUMM_LITTLE_ENDIAN)
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
namespace Common {
|
||||
|
||||
// The sgi IRIX MIPSpro Compiler has difficulties with nested templates.
|
||||
// The sgi IRIX MIPSpro Compiler has difficulties with nested templates.
|
||||
// This and the other __sgi conditionals below work around these problems.
|
||||
#ifdef __sgi
|
||||
template<class T> class IteratorImpl;
|
||||
|
|
|
@ -132,7 +132,7 @@ MacResIDArray MacResManager::getResIDArray(const char *typeID) {
|
|||
|
||||
if (typeNum == -1)
|
||||
return res;
|
||||
|
||||
|
||||
res.resize(_resTypes[typeNum].items);
|
||||
|
||||
for (int i = 0; i < _resTypes[typeNum].items; i++)
|
||||
|
|
|
@ -374,11 +374,11 @@ public:
|
|||
virtual Graphics::PixelFormat getScreenFormat() const = 0;
|
||||
|
||||
/**
|
||||
* Returns a list of all pixel formats supported by the backend.
|
||||
* The first item in the list must be directly supported by hardware,
|
||||
* and provide the largest color space of those formats with direct
|
||||
* hardware support. It is also strongly recommended that remaining
|
||||
* formats should be placed in order of descending preference for the
|
||||
* Returns a list of all pixel formats supported by the backend.
|
||||
* The first item in the list must be directly supported by hardware,
|
||||
* and provide the largest color space of those formats with direct
|
||||
* hardware support. It is also strongly recommended that remaining
|
||||
* formats should be placed in order of descending preference for the
|
||||
* backend to use.
|
||||
*
|
||||
* EG: a backend that supports 32-bit ABGR and 16-bit 555 BGR in hardware
|
||||
|
@ -391,7 +391,7 @@ public:
|
|||
*
|
||||
* @see Graphics::PixelFormat
|
||||
*
|
||||
* @note Backends supporting RGB color should accept game data in RGB color
|
||||
* @note Backends supporting RGB color should accept game data in RGB color
|
||||
* order, even if hardware uses BGR or some other color order.
|
||||
*/
|
||||
virtual Common::List<Graphics::PixelFormat> getSupportedFormats() = 0;
|
||||
|
|
24
configure
vendored
24
configure
vendored
|
@ -294,10 +294,10 @@ get_system_exe_extension() {
|
|||
;;
|
||||
gp2xwiz-linux)
|
||||
_exeext=".wiz"
|
||||
;;
|
||||
;;
|
||||
gp2x-linux)
|
||||
_exeext=".gp2x"
|
||||
;;
|
||||
;;
|
||||
dreamcast | wii | gamecube | nds | psp | ps2)
|
||||
_exeext=".elf"
|
||||
;;
|
||||
|
@ -590,7 +590,7 @@ Special configuration feature:
|
|||
nds for Nintendo DS
|
||||
iphone for Apple iPhone
|
||||
wince for Windows CE
|
||||
psp for PlayStation Portable
|
||||
psp for PlayStation Portable
|
||||
ps2 for PlayStation 2
|
||||
|
||||
Game engines:
|
||||
|
@ -851,7 +851,7 @@ gp2xwiz)
|
|||
_host_os=gp2xwiz-linux
|
||||
_host_cpu=arm
|
||||
_host_alias=arm-open2x-linux
|
||||
;;
|
||||
;;
|
||||
gp2x)
|
||||
_host_os=gp2x-linux
|
||||
_host_cpu=arm
|
||||
|
@ -964,7 +964,7 @@ fi
|
|||
#
|
||||
# Determine extension used for executables
|
||||
#
|
||||
get_system_exe_extension $_host_os
|
||||
get_system_exe_extension $_host_os
|
||||
HOSTEXEEXT=$_exeext
|
||||
|
||||
#
|
||||
|
@ -1129,7 +1129,7 @@ else
|
|||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
*)
|
||||
cxx_version="$cxx_version, bad"
|
||||
cxx_verc_fail=yes
|
||||
;;
|
||||
|
@ -1428,7 +1428,7 @@ if test -n "$_host"; then
|
|||
_build_hq_scalers="no"
|
||||
_mt32emu="no"
|
||||
_vkeybd="yes"
|
||||
;;
|
||||
;;
|
||||
gp2x)
|
||||
DEFINES="$DEFINES -DUNIX -DGP2X -DNDEBUG"
|
||||
CXXFLAGS="$CXXFLAGS -march=armv4t"
|
||||
|
@ -1772,7 +1772,7 @@ _def_plugin='
|
|||
'
|
||||
_mak_plugins='
|
||||
DYNAMIC_MODULES := 1
|
||||
PLUGIN_PREFIX :=
|
||||
PLUGIN_PREFIX :=
|
||||
PLUGIN_SUFFIX := .plugin
|
||||
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
|
||||
CXXFLAGS += -DDYNAMIC_MODULES
|
||||
|
@ -1782,7 +1782,7 @@ PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive
|
|||
POST_OBJS_FLAGS := -Wl,-no-whole-archive
|
||||
LIBS += -ldl
|
||||
'
|
||||
;;
|
||||
;;
|
||||
dreamcast)
|
||||
_def_plugin='
|
||||
#define PLUGIN_PREFIX ""
|
||||
|
@ -2290,7 +2290,7 @@ case $_backend in
|
|||
LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`"
|
||||
LDFLAGS="$LDFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS -mcpu=arm926ej-s -mtune=arm926ej-s"
|
||||
;;
|
||||
;;
|
||||
iphone)
|
||||
OBJCFLAGS="$OBJCFLAGS --std=c99"
|
||||
LIBS="$LIBS -lobjc -framework UIKit -framework CoreGraphics -framework OpenGLES -framework QuartzCore -framework GraphicsServices -framework CoreFoundation -framework Foundation -framework AudioToolbox -framework CoreAudio"
|
||||
|
@ -2323,7 +2323,7 @@ case $_backend in
|
|||
INCLUDES="$INCLUDES -I$PSPDEV/psp/include/SDL"
|
||||
LIBS="$LIBS -lpng -lSDL -Wl,-Map,mapfile.txt"
|
||||
SDLLIBS=$($PSPDEV/psp/bin/sdl-config --libs)
|
||||
|
||||
|
||||
if `echo "$SDLLIBS" | grep ".*-lGL.*" 1>/dev/null 2>&1`
|
||||
then
|
||||
LIBS="$LIBS -lGL"
|
||||
|
@ -2350,7 +2350,7 @@ MODULES="$MODULES backends/platform/$_backend"
|
|||
if test "$have_gcc" = yes ; then
|
||||
if test "$_cxx_major" -ge "3" ; then
|
||||
case $_host_os in
|
||||
# newlib-based system include files suppress non-C89 function
|
||||
# newlib-based system include files suppress non-C89 function
|
||||
# declarations under __STRICT_ANSI__
|
||||
mingw* | dreamcast | wii | gamecube | psp | wince | amigaos*)
|
||||
CXXFLAGS="$CXXFLAGS -W -Wno-unused-parameter"
|
||||
|
|
|
@ -258,7 +258,7 @@ void AgiEngine::processEvents() {
|
|||
break;
|
||||
|
||||
case Common::EVENT_KEYUP:
|
||||
if (_egoHoldKey)
|
||||
if (_egoHoldKey)
|
||||
_game.viewTable[0].direction = 0;
|
||||
|
||||
default:
|
||||
|
|
|
@ -195,7 +195,7 @@ static uint8 testSaid(uint8 nwords, uint8 *cc) {
|
|||
case 9999: // rest of line (empty string counts to...)
|
||||
nwords = 1;
|
||||
break;
|
||||
case 1: // any word
|
||||
case 1: // any word
|
||||
break;
|
||||
default:
|
||||
if (game.egoWords[c].id != z)
|
||||
|
|
|
@ -342,7 +342,7 @@ int AgiEngine::loadGame(const char *fileName, bool checkId) {
|
|||
debug(0, "Your game is \"%s\" and save is \"%s\".", getGameMD5(), md5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < MAX_FLAGS; i++)
|
||||
_game.flags[i] = in->readByte();
|
||||
for (i = 0; i < MAX_VARS; i++)
|
||||
|
|
|
@ -266,7 +266,7 @@ bool MoviePlayerDXA::load() {
|
|||
|
||||
void MoviePlayerDXA::playVideo() {
|
||||
// Most of the videos included in the Amiga version, reduced the
|
||||
// resoluton to 384 x 280, so require the screen to be cleared,
|
||||
// resoluton to 384 x 280, so require the screen to be cleared,
|
||||
// before starting playing those videos.
|
||||
if (getWidth() == 384 && getHeight() == 280) {
|
||||
_vm->clearSurfaces();
|
||||
|
|
|
@ -962,7 +962,7 @@ void AGOSEngine::drawArrow(uint16 x, uint16 y, int8 dir) {
|
|||
|
||||
for (h = 0; h < 19; h++) {
|
||||
for (w = 0; w < 16; w++) {
|
||||
if (src[w])
|
||||
if (src[w])
|
||||
dst[w] = src[w] + 16;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
* French variant of the game which heared to be completable.
|
||||
* Later the work was renewed as part of GSoC'08, by Kari Salminen, but it has not
|
||||
* yet been finished. The game is not completable.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Supported games:
|
||||
*
|
||||
|
|
|
@ -714,7 +714,7 @@ void FWRenderer::savePalette(Common::OutSaveFile &fHandle) {
|
|||
byte buf[kLowPalNumBytes];
|
||||
|
||||
// Make sure the active palette has the correct format and color count
|
||||
assert(_activePal.colorFormat() == kLowPalFormat);
|
||||
assert(_activePal.colorFormat() == kLowPalFormat);
|
||||
assert(_activePal.colorCount() == kLowPalNumColors);
|
||||
|
||||
// Make sure the backup palette has the correct format and color count
|
||||
|
|
|
@ -352,7 +352,7 @@ byte *Palette::save(byte *buf, const uint size, const Graphics::PixelFormat form
|
|||
const uint r = (_colors[i].r * rNewMax) / rOrigMax;
|
||||
const uint g = (_colors[i].g * gNewMax) / gOrigMax;
|
||||
const uint b = (_colors[i].b * bNewMax) / bOrigMax;
|
||||
|
||||
|
||||
buf[i * format.bytesPerPixel + rBytePos] |= r << (format.rShift % 8);
|
||||
buf[i * format.bytesPerPixel + gBytePos] |= g << (format.gShift % 8);
|
||||
buf[i * format.bytesPerPixel + bBytePos] |= b << (format.bShift % 8);
|
||||
|
|
|
@ -1106,7 +1106,7 @@ uint16 executePlayerInput() {
|
|||
|
||||
bgVar0 = var_5E;
|
||||
}
|
||||
|
||||
|
||||
if (g_cine->getGameType() == Cine::GType_OS || !(egoMovedWithKeyboard && allowPlayerInput)) {
|
||||
getMouseData(mouseUpdateStatus, &mouseButton, &mouseX, &mouseY);
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ void MemoryFree(void *v) {
|
|||
|
||||
memList.remove(p);
|
||||
free(p - 8 - 64);
|
||||
} else
|
||||
} else
|
||||
free(v);
|
||||
}
|
||||
|
||||
|
@ -1163,7 +1163,7 @@ void callSubRelation(menuElementSubStruct *pMenuElement, int nOvl, int nObj) {
|
|||
} else if (pHeader->type == RT_MSG) {
|
||||
|
||||
if (pHeader->obj2Number >= 0) {
|
||||
if ((pHeader->trackX !=-1) && (pHeader->trackY !=-1) &&
|
||||
if ((pHeader->trackX !=-1) && (pHeader->trackY !=-1) &&
|
||||
(pHeader->trackX != 9999) && (pHeader->trackY != 9999)) {
|
||||
x = pHeader->trackX - 100;
|
||||
y = pHeader->trackY - 150;
|
||||
|
@ -1192,7 +1192,7 @@ void callSubRelation(menuElementSubStruct *pMenuElement, int nOvl, int nObj) {
|
|||
userWait = 1;
|
||||
autoOvl = ovlIdx;
|
||||
autoMsg = pHeader->id;
|
||||
|
||||
|
||||
if ((narratorOvl > 0) && (pHeader->trackX != -1) && (pHeader->trackY != -1)) {
|
||||
actorStruct *pTrack = findActor(&actorHead, narratorOvl, narratorIdx, 0);
|
||||
|
||||
|
@ -1888,7 +1888,7 @@ void CruiseEngine::mainLoop() {
|
|||
|
||||
// Disable any mouse click used to end the user wait
|
||||
currentMouseButton = 0;
|
||||
}
|
||||
}
|
||||
|
||||
manageScripts(&relHead);
|
||||
manageScripts(&procHead);
|
||||
|
|
|
@ -256,7 +256,7 @@ int16 Op_FreqFX() {
|
|||
|
||||
if ((sampleNum >= 0) && (sampleNum < NUM_FILE_ENTRIES) && (filesDatabase[sampleNum].subData.ptr)) {
|
||||
int freq = Period(freq2 * 1000);
|
||||
|
||||
|
||||
_vm->sound().startNote(channelNum, volume, freq);
|
||||
}
|
||||
|
||||
|
@ -1389,7 +1389,7 @@ int16 Op_SongSize() {
|
|||
|
||||
if (_vm->sound().songLoaded()) {
|
||||
oldSize = _vm->sound().numOrders();
|
||||
|
||||
|
||||
size = popVar();
|
||||
if ((size >= 1) && (size < 128))
|
||||
_vm->sound().setNumOrders(size);
|
||||
|
|
|
@ -238,7 +238,7 @@ void gfxModuleData_flipScreen() {
|
|||
}
|
||||
|
||||
void gfxModuleData_addDirtyRect(const Common::Rect &r) {
|
||||
_dirtyRects.push_back(Common::Rect( MAX(r.left, (int16)0), MAX(r.top, (int16)0),
|
||||
_dirtyRects.push_back(Common::Rect( MAX(r.left, (int16)0), MAX(r.top, (int16)0),
|
||||
MIN(r.right, (int16)320), MIN(r.bottom, (int16)200)));
|
||||
}
|
||||
|
||||
|
@ -319,7 +319,7 @@ void flip() {
|
|||
// Copy any modified areas
|
||||
for (dr = _dirtyRects.begin(); dr != _dirtyRects.end(); ++dr) {
|
||||
Common::Rect &r = *dr;
|
||||
g_system->copyRectToScreen(globalScreen + 320 * r.top + r.left, 320,
|
||||
g_system->copyRectToScreen(globalScreen + 320 * r.top + r.left, 320,
|
||||
r.left, r.top, r.width(), r.height());
|
||||
}
|
||||
|
||||
|
@ -355,7 +355,7 @@ void switchBackground(const byte *newBg) {
|
|||
}
|
||||
|
||||
/* For an optimisation, any changes are stored as a series of slices than have a height of a single
|
||||
* line each. It is left up to the screen redraw code to automatically merge these together
|
||||
* line each. It is left up to the screen redraw code to automatically merge these together
|
||||
*/
|
||||
|
||||
for (int yp = 0; yp < 200; ++yp) {
|
||||
|
|
|
@ -208,7 +208,7 @@ int m_first_Y;
|
|||
int m_scaleValue;
|
||||
int m_color;
|
||||
|
||||
/*
|
||||
/*
|
||||
FIXME: Whether intentional or not, the game often seems to use negative indexing
|
||||
of one or more of the arrays below and expects(?) to end up in the preceding one.
|
||||
This "worked" on many platforms so far, but on OSX apparently the buffers don't
|
||||
|
|
|
@ -115,7 +115,7 @@ int freeOverlay(int overlayIdx) {
|
|||
MemFree(ovlDataPtr->arrayNameObj);
|
||||
MemFree(ovlDataPtr->arrayRelocGlob);
|
||||
MemFree(ovlDataPtr->arrayNameRelocGlob);
|
||||
|
||||
|
||||
MemFree(ovlDataPtr);
|
||||
overlayTable[overlayIdx].ovlData = NULL;
|
||||
|
||||
|
|
|
@ -568,7 +568,7 @@ static void syncPerso(Common::Serializer &s, persoStruct &p) {
|
|||
s.syncAsSint16LE(p.solution[i][0]);
|
||||
s.syncAsSint16LE(p.solution[i][1]);
|
||||
}
|
||||
|
||||
|
||||
s.syncAsSint16LE(p.inc_jo1);
|
||||
s.syncAsSint16LE(p.inc_jo2);
|
||||
s.syncAsSint16LE(p.dir_perso);
|
||||
|
@ -902,7 +902,7 @@ Common::Error loadSavegameData(int saveGameIdx) {
|
|||
ASSERT(0);
|
||||
//loadFileMode1(filesDatabase[j].subData.name,filesDatabase[j].subData.var4);
|
||||
} else */
|
||||
if (strlen(filesDatabase[i].subData.name) > 0) {
|
||||
if (strlen(filesDatabase[i].subData.name) > 0) {
|
||||
loadFileRange(filesDatabase[i].subData.name, filesDatabase[i].subData.index, i, j - i);
|
||||
} else {
|
||||
filesDatabase[i].subData.ptr = NULL;
|
||||
|
|
|
@ -628,8 +628,8 @@ int executeScripts(scriptInstanceStruct *ptr) {
|
|||
opcodeType = getByteFromScript();
|
||||
|
||||
debugC(5, kCruiseDebugScript, "Script %s/%d ip=%d opcode=%d",
|
||||
overlayTable[currentScriptPtr->overlayNumber].overlayName,
|
||||
currentScriptPtr->scriptNumber,
|
||||
overlayTable[currentScriptPtr->overlayNumber].overlayName,
|
||||
currentScriptPtr->scriptNumber,
|
||||
currentScriptPtr->scriptOffset,
|
||||
(opcodeType & 0xFB) >> 3);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
void setUpdateCallback(UpdateCallback upCb, void *ref);
|
||||
void resetChannel(int channel);
|
||||
void findNote(int freq, int *note, int *oct) const;
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
UpdateCallback _upCb;
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
|
||||
virtual void playSound(const uint8 *data, int size, int volume);
|
||||
virtual void stopSound(int channel);
|
||||
|
||||
|
||||
void doSync(Common::Serializer &s);
|
||||
const char *musicName();
|
||||
void stopChannel(int channel);
|
||||
|
|
|
@ -197,7 +197,7 @@ void Game::init() {
|
|||
_vm->_mouse->setCursorType(kHighlightedCursor); // anything different from kNormalCursor
|
||||
|
||||
_objUnderCursor = NULL;
|
||||
|
||||
|
||||
// Set the inventory to empty initially
|
||||
memset(_inventory, 0, kInventorySlots * sizeof(GameItem *));
|
||||
|
||||
|
@ -571,7 +571,7 @@ void Game::handleStatusChangeByMouse() {
|
|||
if (!wantsChange) {
|
||||
// Turn off the timer, but enable switching.
|
||||
_mouseChangeTick = kMouseEnableSwitching;
|
||||
|
||||
|
||||
// Otherwise the mouse signalizes that the mode should be changed.
|
||||
} else if (_mouseChangeTick == kMouseEnableSwitching) {
|
||||
// If the timer is currently disabled, this is the first time
|
||||
|
@ -1181,7 +1181,7 @@ void Game::deleteObjectAnimations() {
|
|||
GameObject *obj = &_objects[i];
|
||||
obj->deleteAnims();
|
||||
}
|
||||
|
||||
|
||||
// WORKAROUND
|
||||
//
|
||||
// An absolutely horrible hack follows. The current memory management
|
||||
|
|
|
@ -197,7 +197,7 @@ void Sound::playSoundBuffer(Audio::SoundHandle *handle, const SoundSample &buffe
|
|||
|
||||
byte flags = Audio::FLAG_UNSIGNED;
|
||||
|
||||
const Audio::Mixer::SoundType soundType = (handleType == kVoiceHandle) ?
|
||||
const Audio::Mixer::SoundType soundType = (handleType == kVoiceHandle) ?
|
||||
Audio::Mixer::kSpeechSoundType : Audio::Mixer::kSFXSoundType;
|
||||
|
||||
// Don't use DisposeAfterUse::YES, because our caching system deletes samples by itself.
|
||||
|
|
|
@ -546,7 +546,7 @@ int DrasculaEngine::playFrameSSN() {
|
|||
mixVideo(screenBuffer, screenSurface);
|
||||
else
|
||||
memcpy(screenBuffer, screenSurface, 64000);
|
||||
|
||||
|
||||
_system->unlockScreen();
|
||||
_system->updateScreen();
|
||||
FrameSSN++;
|
||||
|
|
|
@ -164,7 +164,7 @@ void initGraphics(int width, int height, bool defaultTo1xScaler, const Graphics:
|
|||
#ifdef USE_RGB_COLOR
|
||||
if (format)
|
||||
g_system->initSize(width, height, format);
|
||||
else {
|
||||
else {
|
||||
Graphics::PixelFormat bestFormat = g_system->getSupportedFormats().front();
|
||||
g_system->initSize(width, height, &bestFormat);
|
||||
}
|
||||
|
@ -406,7 +406,7 @@ void Engine::flipMute() {
|
|||
if (ConfMan.hasKey("mute")) {
|
||||
mute = !ConfMan.getBool("mute");
|
||||
}
|
||||
|
||||
|
||||
ConfMan.setBool("mute", mute);
|
||||
|
||||
syncSoundSettings();
|
||||
|
|
|
@ -160,8 +160,8 @@ public:
|
|||
int16 _winVarArrayHeight;
|
||||
int16 _winVarArrayStatus;
|
||||
int16 _winVarArrayLimitsX;
|
||||
int16 _winVarArrayLimitsY;
|
||||
|
||||
int16 _winVarArrayLimitsY;
|
||||
|
||||
|
||||
void invalidateRect(int16 left, int16 top, int16 right, int16 bottom);
|
||||
void blitInvalidated();
|
||||
|
@ -273,7 +273,7 @@ public:
|
|||
virtual ~Draw_Playtoons() {}
|
||||
virtual void spriteOperation(int16 operation);
|
||||
};
|
||||
|
||||
|
||||
// Draw operations
|
||||
|
||||
#define DRAW_BLITSURF 0
|
||||
|
|
|
@ -72,7 +72,7 @@ void Draw_Fascination::spriteOperation(int16 operation) {
|
|||
if (_renderFlags & 0x20) {
|
||||
if (_destSurface == 21 || (operation == 0 && _sourceSurface == 21)) {
|
||||
winDraw(operation);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -170,13 +170,13 @@ void Draw_Playtoons::spriteOperation(int16 operation) {
|
|||
_destSpriteY - 1, _destSpriteX + 2,
|
||||
_destSpriteY + 2, _frontColor);
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
_vm->_video->putPixel(_destSpriteX, _destSpriteY, _frontColor, *_spritesArray[_destSurface]);
|
||||
break;
|
||||
}
|
||||
dirtiedRect(_destSurface, _destSpriteX - (_pattern / 2),
|
||||
_destSpriteY - (_pattern / 2),
|
||||
_destSpriteX + (_pattern + 1) / 2,
|
||||
_destSpriteY - (_pattern / 2),
|
||||
_destSpriteX + (_pattern + 1) / 2,
|
||||
_destSpriteY + (_pattern + 1) / 2);
|
||||
break;
|
||||
case DRAW_FILLRECT:
|
||||
|
@ -187,7 +187,7 @@ void Draw_Playtoons::spriteOperation(int16 operation) {
|
|||
case 4:
|
||||
warning("oPlaytoons_spriteOperation: operation DRAW_FILLRECT, pattern %d", _pattern & 0xFF);
|
||||
break;
|
||||
case 0:
|
||||
case 0:
|
||||
_vm->_video->fillRect(*_spritesArray[_destSurface], destSpriteX,
|
||||
_destSpriteY, _destSpriteX + _spriteRight - 1,
|
||||
_destSpriteY + _spriteBottom - 1, _backColor);
|
||||
|
@ -195,7 +195,7 @@ void Draw_Playtoons::spriteOperation(int16 operation) {
|
|||
dirtiedRect(_destSurface, _destSpriteX, _destSpriteY,
|
||||
_destSpriteX + _spriteRight - 1, _destSpriteY + _spriteBottom - 1);
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
warning("oPlaytoons_spriteOperation: operation DRAW_FILLRECT, unexpected pattern %d", _pattern & 0xFF);
|
||||
break;
|
||||
}
|
||||
|
@ -218,17 +218,17 @@ void Draw_Playtoons::spriteOperation(int16 operation) {
|
|||
_spriteRight + 1, _spriteBottom + 1, _frontColor);
|
||||
} else {
|
||||
switch (_pattern & 0xFF) {
|
||||
case 0:
|
||||
case 0:
|
||||
_vm->_video->drawLine(*_spritesArray[_destSurface],
|
||||
_destSpriteX, _destSpriteY,
|
||||
_spriteRight, _spriteBottom, _frontColor);
|
||||
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
warning("oPlaytoons_spriteOperation: operation DRAW_DRAWLINE, draw %d lines", (_pattern & 0xFF) * (_pattern & 0xFF));
|
||||
for (int16 i = 0; i <= _pattern ; i++)
|
||||
for (int16 j = 0; j <= _pattern ; j++)
|
||||
_vm->_video->drawLine(*_spritesArray[_destSurface],
|
||||
_vm->_video->drawLine(*_spritesArray[_destSurface],
|
||||
_destSpriteX - (_pattern / 2) + i,
|
||||
_destSpriteY - (_pattern / 2) + j,
|
||||
_spriteRight - (_pattern / 2) + i,
|
||||
|
@ -237,14 +237,14 @@ void Draw_Playtoons::spriteOperation(int16 operation) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
dirtiedRect(_destSurface, MIN(_destSpriteX, _spriteRight) - _pattern,
|
||||
MIN(_destSpriteY, _spriteBottom) - _pattern,
|
||||
MAX(_destSpriteX, _spriteRight) + _pattern + 1,
|
||||
dirtiedRect(_destSurface, MIN(_destSpriteX, _spriteRight) - _pattern,
|
||||
MIN(_destSpriteY, _spriteBottom) - _pattern,
|
||||
MAX(_destSpriteX, _spriteRight) + _pattern + 1,
|
||||
MAX(_destSpriteY, _spriteBottom) + _pattern + 1);
|
||||
break;
|
||||
|
||||
case DRAW_INVALIDATE:
|
||||
if ((_pattern & 0xFF) != 0)
|
||||
if ((_pattern & 0xFF) != 0)
|
||||
warning("oPlaytoons_spriteOperation: operation DRAW_INVALIDATE, pattern %d", _pattern & 0xFF);
|
||||
|
||||
_vm->_video->drawCircle(*_spritesArray[_destSurface], _destSpriteX,
|
||||
|
@ -388,7 +388,7 @@ void Draw_Playtoons::spriteOperation(int16 operation) {
|
|||
dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, _spriteRight, _spriteBottom);
|
||||
break;
|
||||
|
||||
default:
|
||||
default:
|
||||
warning ("oPlaytoons_spriteOperation: Unhandled operation %d", operation);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -155,8 +155,8 @@ bool Hotspots::Hotspot::isDisabled() const {
|
|||
}
|
||||
|
||||
bool Hotspots::Hotspot::isIn(uint16 x, uint16 y) const {
|
||||
// FIXME: the cast to int16 is a hack, to fix handling of Gob2 problems related to
|
||||
// hotspots with negative offset (to temporary disable them).
|
||||
// FIXME: the cast to int16 is a hack, to fix handling of Gob2 problems related to
|
||||
// hotspots with negative offset (to temporary disable them).
|
||||
if ((int16) x < (int16) left)
|
||||
return false;
|
||||
if ((int16) x > (int16) right)
|
||||
|
@ -523,23 +523,23 @@ void Hotspots::leave(uint16 index) {
|
|||
}
|
||||
|
||||
int16 Hotspots::curWindow(int16 &dx, int16 &dy) const {
|
||||
if ((_vm->_draw->_renderFlags & 0x80)==0)
|
||||
if ((_vm->_draw->_renderFlags & 0x80)==0)
|
||||
return(0);
|
||||
for (int i = 0; i < 10; i++)
|
||||
if (_vm->_draw->_fascinWin[i].id != -1)
|
||||
if (_vm->_global->_inter_mouseX >= _vm->_draw->_fascinWin[i].left &&
|
||||
_vm->_global->_inter_mouseX < _vm->_draw->_fascinWin[i].left + _vm->_draw->_fascinWin[i].width &&
|
||||
_vm->_global->_inter_mouseY >= _vm->_draw->_fascinWin[i].top &&
|
||||
if (_vm->_global->_inter_mouseX >= _vm->_draw->_fascinWin[i].left &&
|
||||
_vm->_global->_inter_mouseX < _vm->_draw->_fascinWin[i].left + _vm->_draw->_fascinWin[i].width &&
|
||||
_vm->_global->_inter_mouseY >= _vm->_draw->_fascinWin[i].top &&
|
||||
_vm->_global->_inter_mouseY < _vm->_draw->_fascinWin[i].top + _vm->_draw->_fascinWin[i].height)
|
||||
if (_vm->_draw->_fascinWin[i].id == _vm->_draw->_winCount-1) {
|
||||
dx = _vm->_draw->_fascinWin[i].left;
|
||||
dy = _vm->_draw->_fascinWin[i].top;
|
||||
if (_vm->_global->_inter_mouseX < _vm->_draw->_fascinWin[i].left + 12 &&
|
||||
_vm->_global->_inter_mouseY < _vm->_draw->_fascinWin[i].top + 12 &&
|
||||
if (_vm->_global->_inter_mouseX < _vm->_draw->_fascinWin[i].left + 12 &&
|
||||
_vm->_global->_inter_mouseY < _vm->_draw->_fascinWin[i].top + 12 &&
|
||||
(VAR((_vm->_draw->_winVarArrayStatus / 4) + i) & 2))
|
||||
return(5);
|
||||
if (_vm->_global->_inter_mouseX >= _vm->_draw->_fascinWin[i].left + _vm->_draw->_fascinWin[i].width - 12 &&
|
||||
_vm->_global->_inter_mouseY < _vm->_draw->_fascinWin[i].top + 12 &&
|
||||
if (_vm->_global->_inter_mouseX >= _vm->_draw->_fascinWin[i].left + _vm->_draw->_fascinWin[i].width - 12 &&
|
||||
_vm->_global->_inter_mouseY < _vm->_draw->_fascinWin[i].top + 12 &&
|
||||
(VAR((_vm->_draw->_winVarArrayStatus / 4) + i) & 4))
|
||||
return(6);
|
||||
return(-i);
|
||||
|
@ -785,9 +785,9 @@ uint16 Hotspots::check(uint8 handleMouse, int16 delay, uint16 &id, uint16 &index
|
|||
enter(_currentIndex);
|
||||
} else {
|
||||
WRITE_VAR(16, (int32) i);
|
||||
if (id)
|
||||
if (id)
|
||||
id=0;
|
||||
if (index)
|
||||
if (index)
|
||||
index=0;
|
||||
return(0);
|
||||
}
|
||||
|
@ -1608,7 +1608,7 @@ int16 Hotspots::findCursor(uint16 x, uint16 y) const {
|
|||
|
||||
int16 deltax = 0;
|
||||
int16 deltay = 0;
|
||||
|
||||
|
||||
if ( _vm->getGameType() == kGameTypeFascination ) {
|
||||
cursor = curWindow(deltax, deltay);
|
||||
}
|
||||
|
@ -1647,9 +1647,9 @@ int16 Hotspots::findCursor(uint16 x, uint16 y) const {
|
|||
if (spot.isIn(x - deltax, y - deltay)) {
|
||||
if (spot.getType() < kTypeInput1NoLeave)
|
||||
cursor = 1;
|
||||
else
|
||||
else
|
||||
cursor = 3;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1682,17 +1682,17 @@ void Hotspots::oPlaytoons_F_1B() {
|
|||
var4 = _vm->_game->_script->readValExpr();
|
||||
|
||||
// this variable is always set to 0 in Playtoons
|
||||
// var_4 += unk_var;
|
||||
// var_4 += unk_var;
|
||||
|
||||
for (int i = 0; i < kHotspotCount; i++) {
|
||||
if (_hotspots[i].isEnd()) {
|
||||
return;
|
||||
}
|
||||
if ((_hotspots[i].id == 0xD000 + shortId) || (_hotspots[i].id == 0xB000 + shortId) ||
|
||||
if ((_hotspots[i].id == 0xD000 + shortId) || (_hotspots[i].id == 0xB000 + shortId) ||
|
||||
(_hotspots[i].id == 0x4000 + shortId)) {
|
||||
longId = _hotspots[i].id;
|
||||
warning("oPlaytoons_F_1B: shortId %d, var2 %d fontIndex %d var4 %d - longId %d", shortId, var2, fontIndex, var4, longId);
|
||||
|
||||
|
||||
left = _hotspots[i].left;
|
||||
top = _hotspots[i].top;
|
||||
right = _hotspots[i].right;
|
||||
|
|
|
@ -212,7 +212,7 @@ void Inter_Fascination::oFascin_closeWin() {
|
|||
int16 id;
|
||||
_vm->_game->_script->evalExpr(&id);
|
||||
_vm->_draw->activeWin(id);
|
||||
_vm->_draw->closeWin(id);
|
||||
_vm->_draw->closeWin(id);
|
||||
}
|
||||
|
||||
void Inter_Fascination::oFascin_activeWin() {
|
||||
|
|
|
@ -116,10 +116,10 @@ bool Inter_Playtoons::oPlaytoons_printText(OpFuncParams ¶ms) {
|
|||
_vm->_draw->_transparency = 1;
|
||||
}
|
||||
|
||||
// colMod is read from conf file (_off_=xxx).
|
||||
// in Playtoons, it's not present in the conf file, thus always equal to the default value (0).
|
||||
// colMod is read from conf file (_off_=xxx).
|
||||
// in Playtoons, it's not present in the conf file, thus always equal to the default value (0).
|
||||
// Maybe used in ADIs...
|
||||
// if (!_vm->_draw->_transparency)
|
||||
// if (!_vm->_draw->_transparency)
|
||||
// _vm->_draw->_backColor += colMod;
|
||||
// _vm->_draw->_frontColor += colMod;
|
||||
|
||||
|
@ -173,7 +173,7 @@ bool Inter_Playtoons::oPlaytoons_printText(OpFuncParams ¶ms) {
|
|||
_vm->_draw->spriteOperation(DRAW_PRINTTEXT);
|
||||
_vm->_draw->_transparency = oldTransparency;
|
||||
i = 0;
|
||||
} else
|
||||
} else
|
||||
i = strlen(buf);
|
||||
} while (_vm->_game->_script->peekByte() != 200);
|
||||
|
||||
|
@ -231,9 +231,9 @@ bool Inter_Playtoons::oPlaytoons_checkData(OpFuncParams ¶ms) {
|
|||
|
||||
char *file = _vm->_game->_script->getResultStr();
|
||||
|
||||
// WORKAROUND: In Playtoons games, some files are read on CD (and only on CD).
|
||||
// WORKAROUND: In Playtoons games, some files are read on CD (and only on CD).
|
||||
// In this case, "@:\" is replaced by the CD drive letter.
|
||||
// As the files are copied on the HDD, those characters are skipped.
|
||||
// As the files are copied on the HDD, those characters are skipped.
|
||||
if (strncmp(file, "@:\\", 3) == 0) {
|
||||
debugC(2, kDebugFileIO, "oPlaytoons_checkData: \"%s\" instead of \"%s\"", file + 3, file);
|
||||
file += 3;
|
||||
|
@ -286,9 +286,9 @@ bool Inter_Playtoons::oPlaytoons_readData(OpFuncParams ¶ms) {
|
|||
|
||||
char *file = _vm->_game->_script->getResultStr();
|
||||
|
||||
// WORKAROUND: In Playtoons games, some files are read on CD (and only on CD).
|
||||
// WORKAROUND: In Playtoons games, some files are read on CD (and only on CD).
|
||||
// In this case, "@:\" is replaced by the CD drive letter.
|
||||
// As the files are copied on the HDD, those characters are skipped.
|
||||
// As the files are copied on the HDD, those characters are skipped.
|
||||
if (strncmp(file, "@:\\", 3) == 0) {
|
||||
debugC(2, kDebugFileIO, "oPlaytoons_readData: \"%s\" instead of \"%s\"", file + 3, file);
|
||||
file += 3;
|
||||
|
@ -442,7 +442,7 @@ void Inter_Playtoons::oPlaytoons_openItk() {
|
|||
} else
|
||||
_vm->_dataIO->openDataFile(fileName, true);
|
||||
// All the other checks are meant to verify (if not found at the first try)
|
||||
// if the file is present on the CD or not. As everything is supposed to
|
||||
// if the file is present on the CD or not. As everything is supposed to
|
||||
// be copied, those checks are skipped
|
||||
}
|
||||
|
||||
|
|
|
@ -410,7 +410,7 @@ bool Inter_v6::o6_fillRect(OpFuncParams ¶ms) {
|
|||
_vm->_game->_script->evalExpr(0);
|
||||
|
||||
_vm->_draw->_backColor = _vm->_game->_script->getResultInt() & 0xFFFF;
|
||||
|
||||
|
||||
_vm->_draw->_pattern = _vm->_game->_script->getResultInt() >> 16;
|
||||
|
||||
if (_vm->_draw->_pattern != 0)
|
||||
|
|
|
@ -71,7 +71,7 @@ void Map_v2::loadMapObjects(const char *avjFile) {
|
|||
_passMap[i] += READ_VARO_UINT8(var + i);
|
||||
break;
|
||||
case 65532:
|
||||
for (int i = 0; i < _mapWidth * _mapHeight; i++)
|
||||
for (int i = 0; i < _mapWidth * _mapHeight; i++)
|
||||
WRITE_VARO_UINT8(var + i, 0x00);
|
||||
break;
|
||||
case 65533:
|
||||
|
|
|
@ -533,7 +533,7 @@ public:
|
|||
static const uint32 kPropsSize = 3921;
|
||||
/** Index. kSlotCount * kSlotNameLength bytes. */
|
||||
static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
|
||||
|
||||
|
||||
SaveLoad_Playtoons(GobEngine *vm, const char *targetName);
|
||||
virtual ~SaveLoad_Playtoons();
|
||||
|
||||
|
|
|
@ -142,9 +142,9 @@ void Util::processInput(bool scroll) {
|
|||
|
||||
_vm->_util->setMousePos(x, y);
|
||||
_vm->_game->wantScroll(x, y);
|
||||
|
||||
|
||||
// WORKAROUND:
|
||||
// Force a check of the mouse in order to fix the sofa bug. This apply only for Gob3, and only
|
||||
// Force a check of the mouse in order to fix the sofa bug. This apply only for Gob3, and only
|
||||
// in the impacted TOT file so that the second screen animation is not broken.
|
||||
if ((_vm->getGameType() == kGameTypeGob3) && !strncmp(_vm->_game->_curTotFile, "EMAP1008.TOT", 12))
|
||||
_vm->_game->evaluateScroll();
|
||||
|
|
|
@ -264,7 +264,7 @@ void CellGame::resetMove() {
|
|||
|
||||
void CellGame::takeCells(uint16 whereTo, int8 color) {
|
||||
int cellN;
|
||||
const int8 *str;
|
||||
const int8 *str;
|
||||
|
||||
str = possibleMoves[whereTo];
|
||||
while (1) {
|
||||
|
@ -304,7 +304,7 @@ void CellGame::countAllCells() {
|
|||
}
|
||||
|
||||
int CellGame::countCellsOnTempBoard(int8 color) {
|
||||
const int8 *str;
|
||||
const int8 *str;
|
||||
int res = 0;
|
||||
int i;
|
||||
|
||||
|
@ -626,7 +626,7 @@ int8 CellGame::calcBestWeight(int8 color1, int8 color2, uint16 depth, int bestWe
|
|||
} else {
|
||||
canMove = canMoveFunc3(curColor);
|
||||
}
|
||||
|
||||
|
||||
if (!canMove)
|
||||
break;
|
||||
if (_flag1) {
|
||||
|
|
|
@ -374,9 +374,9 @@ void Cursor_v2::decodeFrame(byte *pal, byte *data, byte *dest) {
|
|||
ptr += 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Cursor_v2::enable() {
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
* This is the namespace of the Groovie engine.
|
||||
*
|
||||
* Status of this engine: This engine supports both versions of the Groovie
|
||||
* game engine. The 7th Guest uses the first revision of Groovie, and is
|
||||
* game engine. The 7th Guest uses the first revision of Groovie, and is
|
||||
* now fully completable. All remaining Groovie games use V2 of the engine,
|
||||
* which is under slow development.
|
||||
*
|
||||
|
|
|
@ -67,7 +67,7 @@ TimAnimator::~TimAnimator() {
|
|||
void TimAnimator::init(int animIndex, Movie *wsa, int x, int y, int wsaCopyParams, int frameDelay) {
|
||||
Animation *anim = &_animations[animIndex];
|
||||
anim->wsa = wsa;
|
||||
anim->x = x;
|
||||
anim->x = x;
|
||||
anim->y = y;
|
||||
anim->wsaCopyParams = wsaCopyParams;
|
||||
anim->frameDelay = frameDelay;
|
||||
|
@ -123,7 +123,7 @@ void TimAnimator::setupPart(int animIndex, int part, int firstFrame, int lastFra
|
|||
|
||||
void TimAnimator::start(int animIndex, int part) {
|
||||
if (!_vm || !_system || !_screen)
|
||||
return;
|
||||
return;
|
||||
|
||||
Animation *anim = &_animations[animIndex];
|
||||
anim->curPart = part;
|
||||
|
|
|
@ -688,7 +688,7 @@ int GUI_LoK::loadGameMenu(Button *button) {
|
|||
void GUI_LoK::redrawTextfield() {
|
||||
_screen->fillRect(38, 91, 287, 102, _vm->gameFlags().platform == Common::kPlatformAmiga ? 18 : 250);
|
||||
_text->printText(_savegameName, 38, 92, 253, 0, 0);
|
||||
|
||||
|
||||
_screen->_charWidth = -2;
|
||||
int width = _screen->getTextWidth(_savegameName);
|
||||
_screen->fillRect(39 + width, 93, 45 + width, 100, _vm->gameFlags().platform == Common::kPlatformAmiga ? 31 : 254);
|
||||
|
@ -742,7 +742,7 @@ int GUI_LoK::saveGame(Button *button) {
|
|||
_cancelSubMenu = false;
|
||||
|
||||
Screen::FontId cf = _screen->setFont(Screen::FID_8_FNT);
|
||||
|
||||
|
||||
if (_savegameOffset == 0 && _vm->_gameToLoad == 0) {
|
||||
_savegameName[0] = 0;
|
||||
} else {
|
||||
|
|
|
@ -212,7 +212,7 @@ void LoLEngine::gui_displayCharInventory(int charNum) {
|
|||
if (c && !b)
|
||||
b = 1;
|
||||
}
|
||||
|
||||
|
||||
if (_flags.use16ColorMode)
|
||||
gui_drawBarGraph(154, 66 + i * 8, 34, 5, b, e, 0x88, 0);
|
||||
else
|
||||
|
@ -251,7 +251,7 @@ void LoLEngine::gui_printCharacterStats(int index, int redraw, int value) {
|
|||
col = 158;
|
||||
if (redraw)
|
||||
_screen->fprintString("%s", offs + 108, y, col, 0, 4, getLangString(0x4014 + index));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//skills
|
||||
int s = index - 2;
|
||||
|
@ -650,7 +650,7 @@ int LoLEngine::gui_enableControls() {
|
|||
|
||||
int start = 74;
|
||||
int end = 83;
|
||||
|
||||
|
||||
if (_flags.isTalkie) {
|
||||
start = 76;
|
||||
end = 85;
|
||||
|
@ -676,7 +676,7 @@ int LoLEngine::gui_disableControls(int controlMode) {
|
|||
int start = 74;
|
||||
int end = 83;
|
||||
int swtch = 76;
|
||||
|
||||
|
||||
if (_flags.isTalkie) {
|
||||
start = 76;
|
||||
end = 85;
|
||||
|
@ -846,7 +846,7 @@ void LoLEngine::gui_triggerEvent(int eventType) {
|
|||
for (Common::HashMap<int, int16>::const_iterator c = _keyMap.begin(); c != _keyMap.end(); ++c) {
|
||||
if (c->_value == eventType)
|
||||
evt.kbd.keycode = (Common::KeyCode) c->_key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
removeInputTop();
|
||||
|
@ -2621,9 +2621,9 @@ void GUI_LoL::updateSavegameList() {
|
|||
|
||||
KyraEngine_v1::SaveHeader header;
|
||||
Common::InSaveFile *in;
|
||||
|
||||
|
||||
_savegameList = new char*[_savegameListSize];
|
||||
|
||||
|
||||
for (int i = 0; i < _savegameListSize; i++) {
|
||||
in = _vm->openSaveForReading(_vm->getSavegameFilename(i), header);
|
||||
if (in) {
|
||||
|
@ -2790,7 +2790,7 @@ int GUI_LoL::clickedOptionsMenu(Button *button) {
|
|||
case 0xfff9:
|
||||
_vm->_configMusic ^= 1;
|
||||
_vm->sound()->enableMusic(_vm->_configMusic);
|
||||
|
||||
|
||||
if (_vm->_configMusic)
|
||||
_vm->snd_playTrack(_vm->_curMusicTheme);
|
||||
else
|
||||
|
|
|
@ -748,7 +748,7 @@ const char *GUI_v2::nameInputProcess(char *buffer, int x, int y, uint8 c1, uint8
|
|||
int x2 = x, y2 = y;
|
||||
Screen::FontId of = _screen->setFont(Screen::FID_8_FNT);
|
||||
_text->printText(buffer, x, y, c1, c2, c2);
|
||||
|
||||
|
||||
for (int i = 0; i < curPos; ++i)
|
||||
x2 += getCharWidth(buffer[i]);
|
||||
|
||||
|
|
|
@ -339,7 +339,7 @@ Common::Error KyraEngine_LoK::go() {
|
|||
void KyraEngine_LoK::startup() {
|
||||
static const uint8 colorMap[] = { 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0 };
|
||||
_screen->setTextColorMap(colorMap);
|
||||
|
||||
|
||||
_sound->setSoundList(&_soundData[kMusicIngame]);
|
||||
if (_flags.platform == Common::kPlatformPC98)
|
||||
_sound->loadSoundFile("SE.DAT");
|
||||
|
|
|
@ -363,7 +363,7 @@ void KyraEngine_v1::setupKeyMap() {
|
|||
|
||||
static const int16 keyCodesDOS[] = { 61, 43, 96, 96, 102, 102, 98, 98, 97, 92, 92, 91, 91, 101, 101, 112, 113, 114, 25, 20, 55, 110};
|
||||
static const int16 keyCodesPC98[] = { 53, 29, 68, 68, 73, 73, 76, 76, 72, 71, 71, 67, 67, 69, 69, 99, 100, 101, 25, 20, 55, 1 };
|
||||
|
||||
|
||||
const int16 *keyCodes = _flags.platform == Common::kPlatformPC98 ? keyCodesPC98 : keyCodesDOS;
|
||||
_keyMap.clear();
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class KyraMetaEngine;
|
|||
* Kyrandia 1 Russian (no feature request)
|
||||
* Kyrandia 2 Russian (no feature request)
|
||||
* Kyrandia 3 Russian (feature request #2812792 "Kyrandia3 Russian")
|
||||
*
|
||||
*
|
||||
* The primary maintainer for the engine is LordHoto, although some parts are maintained by _athrxx.
|
||||
* If you have questions about parts of the code, the following rough description might help in
|
||||
* determining who you should ask:
|
||||
|
|
|
@ -1589,7 +1589,7 @@ void LoLEngine::initDialogueSequence(int controlMode, int pageNum) {
|
|||
} else {
|
||||
_screen->fillRect(0, 128, 319, 199, 1);
|
||||
gui_drawBox(0, 129, 320, 71, 136, 251, -1);
|
||||
gui_drawBox(1, 130, 318, 69, 136, 251, 252);
|
||||
gui_drawBox(1, 130, 318, 69, 136, 251, 252);
|
||||
}
|
||||
|
||||
_screen->modifyScreenDim(5, 8, 131, 306, 66);
|
||||
|
@ -1721,7 +1721,7 @@ void LoLEngine::generateBrightnessPalette(const Palette &src, Palette &dst, int
|
|||
modifier = 0;
|
||||
else if (modifier < 0 || modifier > 7 || !(_flagsTable[31] & 0x08))
|
||||
modifier = 8;
|
||||
|
||||
|
||||
modifier >>= 1;
|
||||
if (modifier)
|
||||
modifier--;
|
||||
|
@ -1780,7 +1780,7 @@ void LoLEngine::createTransparencyTables() {
|
|||
_res->loadFileToBuf("LOL.NOL", tpal, 48);
|
||||
|
||||
for (int i = 15; i > -1; i--) {
|
||||
int s = colTbl[i << 1] * 3;
|
||||
int s = colTbl[i << 1] * 3;
|
||||
tpal[s] = tpal[i * 3];
|
||||
tpal[s + 1] = tpal[i * 3 + 1];
|
||||
tpal[s + 2] = tpal[i * 3 + 2];
|
||||
|
@ -2173,7 +2173,7 @@ int LoLEngine::processMagicHeal(int charNum, int spellLevel) {
|
|||
SWAP(dst[s + 2], dst[i + 2]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_screen->generateGrayOverlay(tpal, _healOverlay, 52, 22, 20, 0, 256, true);
|
||||
}
|
||||
|
||||
|
@ -2311,7 +2311,7 @@ int LoLEngine::processMagicIce(int charNum, int spellLevel) {
|
|||
_screen->loadPalette("LOLICE.NOL", swampCol);
|
||||
for (int i = 1; i < 16; i++) {
|
||||
uint16 v = (s[i * 3] + s[i * 3 + 1] + s[i * 3 + 2]) / 3;
|
||||
tpal[i * 3] = 0;
|
||||
tpal[i * 3] = 0;
|
||||
tpal[i * 3 + 1] = v;
|
||||
tpal[i * 3 + 2] = v << 1;
|
||||
|
||||
|
@ -2319,11 +2319,11 @@ int LoLEngine::processMagicIce(int charNum, int spellLevel) {
|
|||
tpal[i * 3 + 2] = 29;
|
||||
}
|
||||
|
||||
} else {
|
||||
} else {
|
||||
_screen->loadPalette("SWAMPICE.COL", swampCol);
|
||||
tpal.copy(s, 128);
|
||||
swampCol.copy(s, 128);
|
||||
|
||||
|
||||
for (int i = 1; i < 128; i++) {
|
||||
tpal[i * 3] = 0;
|
||||
uint16 v = (s[i * 3] + s[i * 3 + 1] + s[i * 3 + 2]) / 3;
|
||||
|
@ -2544,7 +2544,7 @@ int LoLEngine::processMagicFireball(int charNum, int spellLevel) {
|
|||
} else {
|
||||
if (_flags.use16ColorMode)
|
||||
_screen->drawShape(_screen->_curPage, shp, fX, fY, 0, 4, sW, sH);
|
||||
else
|
||||
else
|
||||
_screen->drawShape(_screen->_curPage, shp, fX, fY, 0, 0x1004, _transparencyTable1, _transparencyTable2, sW, sH);
|
||||
}
|
||||
|
||||
|
@ -2883,7 +2883,7 @@ int LoLEngine::processMagicVaelansCube() {
|
|||
tmpPal2[i * 3 + 2] = (a > 60) ? 60 : a;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
snd_playSoundEffect(146, -1);
|
||||
|
||||
uint32 ctime = _system->getMillis();
|
||||
|
@ -4013,10 +4013,10 @@ void LoLEngine::displayAutomap() {
|
|||
static const uint8 ovlSrc[] = { 0x00, 0xEE, 0xCC, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0x22, 0x11, 0xDD, 0xEE, 0xCC };
|
||||
memset(_mapOverlay, 0, 256);
|
||||
for (int i = 0; i < 16; i++)
|
||||
_mapOverlay[(i << 4) | i] = ovlSrc[i];
|
||||
_mapOverlay[(i << 4) | i] = ovlSrc[i];
|
||||
} else
|
||||
_screen->generateGrayOverlay(_screen->getPalette(3), _mapOverlay, 52, 0, 0, 0, 256, false);
|
||||
|
||||
|
||||
_screen->loadFont(Screen::FID_9_FNT, "FONT9PN.FNT");
|
||||
_screen->loadFont(Screen::FID_6_FNT, "FONT6PN.FNT");
|
||||
|
||||
|
|
|
@ -877,7 +877,7 @@ public:
|
|||
~CmpVocDecoder();
|
||||
uint8 *process(uint8 *src, uint32 insize, uint32 *outsize, bool disposeInput = true);
|
||||
|
||||
private:
|
||||
private:
|
||||
void decodeHelper(int p);
|
||||
|
||||
int32 *_vtbl;
|
||||
|
@ -1028,7 +1028,7 @@ Common::Archive *InstallerLoader::load(Resource *owner, const Common::String &fi
|
|||
newEntry.size = outsize;
|
||||
newEntry.name = entryStr;
|
||||
}
|
||||
|
||||
|
||||
fileList.push_back(newEntry);
|
||||
}
|
||||
pos++;
|
||||
|
@ -1187,7 +1187,7 @@ CmpVocDecoder::~CmpVocDecoder() {
|
|||
uint8 *CmpVocDecoder::process(uint8 *src, uint32 insize, uint32 *outsize, bool disposeInput) {
|
||||
*outsize = 0;
|
||||
uint8 *outTemp = new uint8[insize];
|
||||
|
||||
|
||||
uint8 *inPosH = src;
|
||||
uint8 *outPosH = outTemp;
|
||||
uint8 *outPosD = outTemp + READ_LE_UINT32(src);
|
||||
|
@ -1221,7 +1221,7 @@ uint8 *CmpVocDecoder::process(uint8 *src, uint32 insize, uint32 *outsize, bool d
|
|||
|
||||
uint8 *vocPtr = src + offset;
|
||||
uint32 vocLen = (vocPtr[27] | (vocPtr[28] << 8) | (vocPtr[29] << 16)) - 2;
|
||||
|
||||
|
||||
uint8 *vocOutEnd = outPosD + vocLen + 32;
|
||||
uint8 *vocInEnd = src + offset + fileSize;
|
||||
memcpy(outPosD, vocPtr, 32);
|
||||
|
@ -1235,7 +1235,7 @@ uint8 *CmpVocDecoder::process(uint8 *src, uint32 insize, uint32 *outsize, bool d
|
|||
uint32 readSize = MIN<uint32>(8192, vocInEnd - vocPtr);
|
||||
memcpy(_sndArray, vocPtr, readSize);
|
||||
vocPtr += readSize;
|
||||
|
||||
|
||||
for (int i = -128; i < 128; i++)
|
||||
_stTbl[i + 128] = (int32)((float)i / t + 0.5f);
|
||||
|
||||
|
@ -1255,7 +1255,7 @@ uint8 *CmpVocDecoder::process(uint8 *src, uint32 insize, uint32 *outsize, bool d
|
|||
memcpy(dst, _sndArray, numBytesOut);
|
||||
dst += numBytesOut;
|
||||
}
|
||||
|
||||
|
||||
*dst++ = 0;
|
||||
memcpy(outPosH, spos, headerEntryLen);
|
||||
WRITE_LE_UINT32(outPosH, outPosD - outTemp);
|
||||
|
@ -1287,7 +1287,7 @@ void CmpVocDecoder::decodeHelper(int p1) {
|
|||
|
||||
int d = 3;
|
||||
int s = 1;
|
||||
|
||||
|
||||
while (s < p2) {
|
||||
fi2 = _floatArray[s];
|
||||
fi1 = _floatArray[s + 1];
|
||||
|
|
|
@ -99,7 +99,7 @@ void LoLEngine::loadLevel(int index) {
|
|||
setMouseCursorToItemInHand();
|
||||
|
||||
if (_flags.use16ColorMode)
|
||||
_screen->fadeToPalette1(10);
|
||||
_screen->fadeToPalette1(10);
|
||||
|
||||
snd_playTrack(_curMusicTheme);
|
||||
}
|
||||
|
@ -415,7 +415,7 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight
|
|||
}
|
||||
|
||||
v += 384;
|
||||
}
|
||||
}
|
||||
|
||||
if (_currentLevel == 11) {
|
||||
if (_flags.use16ColorMode) {
|
||||
|
|
|
@ -2146,7 +2146,7 @@ void Screen::decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch, bool
|
|||
}
|
||||
|
||||
void Screen::convertAmigaGfx(uint8 *data, int w, int h, int depth, bool wsa, int bytesPerPlane) {
|
||||
const int planeWidth = (bytesPerPlane == -1) ? (w + 7) / 8 : bytesPerPlane;
|
||||
const int planeWidth = (bytesPerPlane == -1) ? (w + 7) / 8 : bytesPerPlane;
|
||||
const int planeSize = planeWidth * h;
|
||||
const uint imageSize = planeSize * depth;
|
||||
|
||||
|
@ -3365,7 +3365,7 @@ void SJISFont::drawChar(uint16 c, byte *dst, int pitch) const {
|
|||
if (_is16Color) {
|
||||
// PC98 16 color games specify a color value which is for the
|
||||
// PC98 text mode palette, thus we need to remap it.
|
||||
color1 = ((_colorMap[1] >> 5) & 0x7) + 16;
|
||||
color1 = ((_colorMap[1] >> 5) & 0x7) + 16;
|
||||
color2 = ((_colorMap[0] >> 5) & 0x7) + 16;
|
||||
} else {
|
||||
color1 = _colorMap[1];
|
||||
|
|
|
@ -191,7 +191,7 @@ uint8 *Screen_LoL::generateLevelOverlay(const Palette &srcPal, uint8 *ovl, int o
|
|||
weight = 255;
|
||||
|
||||
const uint8 *srt = srcPal.getData();
|
||||
|
||||
|
||||
uint16 r = srt[opColor * 3];
|
||||
uint16 g = srt[opColor * 3 + 1];
|
||||
uint16 b = srt[opColor * 3 + 2];
|
||||
|
@ -848,7 +848,7 @@ void Screen_LoL::fadeToPalette1(int delay) {
|
|||
void Screen_LoL::loadSpecialColors(Palette &dst) {
|
||||
if (_use16ColorMode)
|
||||
return;
|
||||
|
||||
|
||||
dst.copy(*_screenPalette, 192, 4);
|
||||
}
|
||||
|
||||
|
@ -941,9 +941,9 @@ bool Screen_LoL::fadePaletteStep(uint8 *pal1, uint8 *pal2, uint32 elapsedTime, u
|
|||
|
||||
Palette **Screen_LoL::generateFadeTable(Palette **dst, Palette *src1, Palette *src2, int numTabs) {
|
||||
int len = _use16ColorMode ? 48 : 768;
|
||||
if (!src1)
|
||||
if (!src1)
|
||||
src1 = _screenPalette;
|
||||
|
||||
|
||||
uint8 *p1 = (*dst++)->getData();
|
||||
uint8 *p2 = src1->getData();
|
||||
uint8 *p3 = src2->getData();
|
||||
|
|
|
@ -2151,7 +2151,7 @@ int LoLEngine::olol_paletteFlash(EMCState *script) {
|
|||
uint8 *d = p2.getData();
|
||||
|
||||
for (int i = 0; i < 16; i++)
|
||||
d[i * 3] = 0x3f;
|
||||
d[i * 3] = 0x3f;
|
||||
|
||||
_screen->setScreenPalette(p2);
|
||||
_screen->updateScreen();
|
||||
|
@ -2164,7 +2164,7 @@ int LoLEngine::olol_paletteFlash(EMCState *script) {
|
|||
|
||||
_screen->updateScreen();
|
||||
|
||||
} else {
|
||||
} else {
|
||||
Palette &p2 = _screen->getPalette(3);
|
||||
|
||||
uint8 ovl[256];
|
||||
|
@ -2653,8 +2653,8 @@ int LoLEngine::tlol_fadeInPalette(const TIM *tim, const uint16 *param) {
|
|||
_screen->setScreenPalette(_screen->getPalette(0));
|
||||
_screen->copyPage(2, 0);
|
||||
}
|
||||
|
||||
_screen->fadePalette(pal, param[1]);
|
||||
|
||||
_screen->fadePalette(pal, param[1]);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -657,7 +657,7 @@ bool SeqPlayer::playSequence(const uint8 *seqData, bool skipSeq) {
|
|||
}
|
||||
delete[] _specialBuffer;
|
||||
_specialBuffer = 0;
|
||||
|
||||
|
||||
for (uint i = 0; i < ARRAYSIZE(_seqMovies); ++i) {
|
||||
delete _seqMovies[i].movie;
|
||||
_seqMovies[i].movie = 0;
|
||||
|
|
|
@ -2796,7 +2796,7 @@ void KyraEngine_HoF::seq_init() {
|
|||
{ 0xd8, 0xda, 0xd9, 0xd8 },
|
||||
(_flags.lang == Common::JA_JPN) ? Screen::FID_SJIS_FNT : Screen::FID_8_FNT, 240
|
||||
};
|
||||
|
||||
|
||||
_menu = new MainMenu(this);
|
||||
_menu->init(data, MainMenu::Animation());
|
||||
}
|
||||
|
|
|
@ -1160,7 +1160,7 @@ void LoLEngine::showCredits() {
|
|||
_outroShapeTable[i] = (i << 4) | i;
|
||||
else
|
||||
_outroShapeTable[255] = 0;
|
||||
|
||||
|
||||
_sound->haltTrack();
|
||||
_sound->loadSoundFile("LOREFINL");
|
||||
_sound->playTrack(4);
|
||||
|
@ -1474,7 +1474,7 @@ void LoLEngine::processCredits(char *t, int dimState, int page, int delayTime) {
|
|||
curShapeFile = curShapeFile % 28;
|
||||
|
||||
loadOutroShapes(curShapeFile, shapes);
|
||||
|
||||
|
||||
if (!_flags.use16ColorMode) {
|
||||
_screen->getPalette(0).copy(monsterPal, curShapeFile * 40, 40, 88);
|
||||
_screen->setScreenPalette(_screen->getPalette(0));
|
||||
|
|
|
@ -266,7 +266,7 @@ public:
|
|||
bool hasSoundFile(uint file) const { return _music->hasSoundFile(file) && _sfx->hasSoundFile(file); }
|
||||
void loadSoundFile(uint file) { _music->loadSoundFile(file); _sfx->loadSoundFile(file); }
|
||||
void loadSoundFile(Common::String file) { _music->loadSoundFile(file); _sfx->loadSoundFile(file); }
|
||||
|
||||
|
||||
void loadSfxFile(Common::String file) { _sfx->loadSoundFile(file); }
|
||||
|
||||
void playTrack(uint8 track) { _music->playTrack(track); }
|
||||
|
|
|
@ -3562,7 +3562,7 @@ void TownsPC98_OpnDriver::loadSoundEffectData(uint8 *data, uint8 trackNum) {
|
|||
|
||||
void TownsPC98_OpnDriver::reset() {
|
||||
Common::StackLock lock(_mutex);
|
||||
|
||||
|
||||
_musicPlaying = false;
|
||||
_sfxPlaying = false;
|
||||
_fading = false;
|
||||
|
|
|
@ -1026,7 +1026,7 @@ uint8 *LoLEngine::drawItemOrMonster(uint8 *shape, uint8 *monsterPalette, int x,
|
|||
if (_flags.use16ColorMode) {
|
||||
if (_currentLevel != 22)
|
||||
flg &= 0xdfff;
|
||||
|
||||
|
||||
} else {
|
||||
if (_currentLevel == 22) {
|
||||
if (brightnessOverlay)
|
||||
|
|
|
@ -128,8 +128,8 @@ void TextDisplayer_LoL::expandField() {
|
|||
h = 4;
|
||||
stepH = 1;
|
||||
}
|
||||
|
||||
_screen->copyRegion(83, y, 0, 0, 235, h, 0, 2, Screen::CR_NO_P_CHECK);
|
||||
|
||||
_screen->copyRegion(83, y, 0, 0, 235, h, 0, 2, Screen::CR_NO_P_CHECK);
|
||||
|
||||
for (int i = 140; i < 177; i++) {
|
||||
uint32 endTime = _vm->_system->getMillis() + _vm->_tickLength;
|
||||
|
@ -360,7 +360,7 @@ void TextDisplayer_LoL::preprocessString(char *str, EMCState *script, const uint
|
|||
|
||||
void TextDisplayer_LoL::displayText(char *str, ...) {
|
||||
const bool isPc98 = (_vm->gameFlags().platform == Common::kPlatformPC98);
|
||||
|
||||
|
||||
_printFlag = false;
|
||||
|
||||
_lineWidth = 0;
|
||||
|
@ -382,7 +382,7 @@ void TextDisplayer_LoL::displayText(char *str, ...) {
|
|||
const ScreenDim *sd = _screen->_curDim;
|
||||
int sdx = _screen->curDimIndex();
|
||||
|
||||
bool pc98PrintFlag = (isPc98 && (sdx == 3 || sdx == 4 || sdx == 5 || sdx == 15)) ? true : false;
|
||||
bool pc98PrintFlag = (isPc98 && (sdx == 3 || sdx == 4 || sdx == 5 || sdx == 15)) ? true : false;
|
||||
uint16 charsPerLine = (sd->w << 3) / (_screen->getFontWidth() + _screen->_charWidth);
|
||||
|
||||
while (c) {
|
||||
|
@ -587,7 +587,7 @@ void TextDisplayer_LoL::printLine(char *str) {
|
|||
w -= _textDimData[sdx].column;
|
||||
|
||||
int n2 = 0;
|
||||
int n1 = (w / 4) - 1;
|
||||
int n1 = (w / 4) - 1;
|
||||
|
||||
do {
|
||||
c = str[n2];
|
||||
|
@ -612,7 +612,7 @@ void TextDisplayer_LoL::printLine(char *str) {
|
|||
while (n1 > 0) {
|
||||
//cut off line after last space
|
||||
c = str[n1];
|
||||
|
||||
|
||||
lw -= _screen->getCharWidth((uint8)c);
|
||||
|
||||
if (!n2 && lw <= w)
|
||||
|
@ -623,7 +623,7 @@ void TextDisplayer_LoL::printLine(char *str) {
|
|||
_printFlag = false;
|
||||
break;
|
||||
}
|
||||
n1--;
|
||||
n1--;
|
||||
}
|
||||
|
||||
if (!n1) {
|
||||
|
@ -641,7 +641,7 @@ void TextDisplayer_LoL::printLine(char *str) {
|
|||
str[s] = 0;
|
||||
|
||||
uint8 col = _textDimData[sdx].color1;
|
||||
if (isPc98 && (sdx == 2 || sdx == 3 || sdx == 4 || sdx == 5 || sdx == 15)) {
|
||||
if (isPc98 && (sdx == 2 || sdx == 3 || sdx == 4 || sdx == 5 || sdx == 15)) {
|
||||
switch (_textDimData[sdx].color1) {
|
||||
case 0x88:
|
||||
col = 0x41;
|
||||
|
@ -739,12 +739,12 @@ void TextDisplayer_LoL::textPageBreak() {
|
|||
|
||||
char *txt = _vm->getLangString(0x4073);
|
||||
if (_vm->gameFlags().use16ColorMode) {
|
||||
_vm->gui_drawBox(x + 8, (y & ~7) - 1, 66, 10, 0xee, 0xcc, -1);
|
||||
_vm->gui_drawBox(x + 8, (y & ~7) - 1, 66, 10, 0xee, 0xcc, -1);
|
||||
_vm->_screen->printText(txt, (x + 37 - (strlen(txt) << 1) + 4) & ~3, (y + 2) & ~7, 0xc1, 0);
|
||||
} else {
|
||||
_vm->gui_drawBox(x, y, 74, 9, 136, 251, -1);
|
||||
_vm->gui_drawBox(x, y, 74, 9, 136, 251, -1);
|
||||
_vm->_screen->printText(txt, x + 37 - (_vm->_screen->getTextWidth(txt) >> 1), y + 2, 144, 0);
|
||||
}
|
||||
}
|
||||
|
||||
_vm->removeInputTop();
|
||||
|
||||
|
@ -784,7 +784,7 @@ void TextDisplayer_LoL::textPageBreak() {
|
|||
} while (loop);
|
||||
|
||||
|
||||
if (_vm->gameFlags().use16ColorMode)
|
||||
if (_vm->gameFlags().use16ColorMode)
|
||||
_screen->fillRect(x + 8, y, x + 57, y + 9, _textDimData[_screen->curDimIndex()].color2);
|
||||
else
|
||||
_screen->fillRect(x, y, x + 73, y + 8, _textDimData[_screen->curDimIndex()].color2);
|
||||
|
@ -815,7 +815,7 @@ void TextDisplayer_LoL::clearCurDim() {
|
|||
_screen->fillRect(tmp->sx << 3, tmp->sy, ((tmp->sx + tmp->w) << 3) - 2, (tmp->sy + tmp->h) - 2, _textDimData[d].color2);
|
||||
} else
|
||||
_screen->fillRect(tmp->sx << 3, tmp->sy, ((tmp->sx + tmp->w) << 3) - 1, (tmp->sy + tmp->h) - 1, _textDimData[d].color2);
|
||||
|
||||
|
||||
_lineCount = 0;
|
||||
_textDimData[d].column = _textDimData[d].line = 0;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ void Dialog::incLine() {
|
|||
_lineX = 0;
|
||||
_widthX = 0;
|
||||
|
||||
_lines.push_back(*new DialogLine());
|
||||
_lines.push_back(*new DialogLine());
|
||||
assert(_lines.size() <= 20);
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ bool Dialog::handleNounSuffix(char *destP, int nounNum, const char *srcP) {
|
|||
if (*srcP != '\0')
|
||||
++srcP;
|
||||
|
||||
//
|
||||
//
|
||||
char var_FC[40];
|
||||
char tempLine[40];
|
||||
strcpy(var_FC, srcP);
|
||||
|
@ -236,7 +236,7 @@ bool Dialog::handleNounSuffix(char *destP, int nounNum, const char *srcP) {
|
|||
|
||||
uint16 _vocabIds[2] = {1, 1}; // FIXME/TODO: Proper vocab ids
|
||||
getVocab(_vocabIds[nounNum], &tmpP);
|
||||
|
||||
|
||||
if ((*(tmpP - 1) != 'S') && (*(tmpP - 1) != 's')) {
|
||||
// Singular object
|
||||
tmpP = &var_FC[0];
|
||||
|
@ -452,7 +452,7 @@ void Dialog::draw() {
|
|||
// Ask position
|
||||
//int askY = (_vm->_font->getHeight() + 1) * _askPosition.y + 3;
|
||||
|
||||
// Set up the dialog
|
||||
// Set up the dialog
|
||||
fillRect(Common::Rect(0, 0, width(), height()), 3);
|
||||
setColour(2);
|
||||
hLine(1, width() - 1, height() - 2); // Bottom edge
|
||||
|
@ -471,7 +471,7 @@ void Dialog::draw() {
|
|||
seed += 0x181D;
|
||||
v = ROR16(v, 9);
|
||||
seed = (seed ^ v) + ROR16(v, 3);
|
||||
|
||||
|
||||
*destP++ = ((seed & 0x10) != 0) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ void Dialog::draw() {
|
|||
|
||||
if (_lines[lineCtr].underline)
|
||||
// Underline needed
|
||||
hLine(pt.x, pt.x + _vm->_font->getWidth(_lines[lineCtr].data, DIALOG_SPACING),
|
||||
hLine(pt.x, pt.x + _vm->_font->getWidth(_lines[lineCtr].data, DIALOG_SPACING),
|
||||
pt.y + _vm->_font->getHeight());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ M4EventType Events::handleEvents() {
|
|||
// if it's the first key pressed after the Ctrl key is held down
|
||||
if ((_event.kbd.keycode == Common::KEYCODE_LCTRL) || (_event.kbd.keycode == Common::KEYCODE_RCTRL))
|
||||
_ctrlFlag = true;
|
||||
|
||||
|
||||
else if (_event.kbd.flags == Common::KBD_CTRL) {
|
||||
if ((_event.kbd.keycode == Common::KEYCODE_d) && _ctrlFlag) {
|
||||
_console->attach();
|
||||
|
@ -77,7 +77,7 @@ M4EventType Events::handleEvents() {
|
|||
_ctrlFlag = false;
|
||||
}
|
||||
_keyCode = (int32)_event.kbd.keycode | (_event.kbd.flags << 24);
|
||||
|
||||
|
||||
|
||||
break;
|
||||
case Common::EVENT_LBUTTONDOWN:
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
void setColor(uint8 color);
|
||||
void setColors(uint8 alt1, uint8 alt2, uint8 foreground);
|
||||
void setColour(uint8 colour) { setColor(colour); }
|
||||
void setColours(uint8 alt1, uint8 alt2, uint8 foreground) { setColors(alt1, alt2, foreground); }
|
||||
void setColours(uint8 alt1, uint8 alt2, uint8 foreground) { setColors(alt1, alt2, foreground); }
|
||||
|
||||
int32 getWidth(const char *text, int spaceWidth = -1);
|
||||
int32 getHeight() const { return _maxHeight; }
|
||||
|
|
|
@ -212,10 +212,10 @@ public:
|
|||
|
||||
void loadMadsVocab();
|
||||
uint32 getVocabSize() { return _madsVocab.size(); }
|
||||
const char *getVocab(uint32 index) {
|
||||
const char *getVocab(uint32 index) {
|
||||
// Vocab list is 1-based, so always subtract one from index provided
|
||||
assert((index > 0) && (index <= _madsVocab.size()));
|
||||
return _madsVocab[index - 1];
|
||||
return _madsVocab[index - 1];
|
||||
}
|
||||
|
||||
void loadMadsQuotes();
|
||||
|
|
|
@ -61,7 +61,7 @@ RGBList::~RGBList() {
|
|||
|
||||
void RGBList::setRange(int start, int count, const RGB8 *src) {
|
||||
assert((start + count) <= _size);
|
||||
|
||||
|
||||
Common::copy(&src[0], &src[count], &_data[start]);
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue