Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
beetle-psx-libretro
Commits
e74142b9
Commit
e74142b9
authored
Nov 18, 2021
by
Libretro-Admin
Browse files
Cleanups - get rid of stdio.h in many places
parent
ccca8193
Pipeline
#67229
failed with stage
in 4 minutes and 4 seconds
Changes
19
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
e74142b9
...
@@ -52,7 +52,6 @@ endif
...
@@ -52,7 +52,6 @@ endif
NEED_CD
=
1
NEED_CD
=
1
NEED_TREMOR
=
1
NEED_TREMOR
=
1
NEED_BPP
=
32
NEED_BPP
=
32
WANT_NEW_API
=
1
NEED_DEINTERLACER
=
1
NEED_DEINTERLACER
=
1
NEED_THREADING
=
1
NEED_THREADING
=
1
SET_HAVE_HW
=
0
SET_HAVE_HW
=
0
...
...
Makefile.common
View file @
e74142b9
...
@@ -127,10 +127,6 @@ ifeq ($(NEED_BPP), 32)
...
@@ -127,10 +127,6 @@ ifeq ($(NEED_BPP), 32)
FLAGS
+=
-DWANT_32BPP
FLAGS
+=
-DWANT_32BPP
endif
endif
ifeq
($(WANT_NEW_API), 1)
FLAGS
+=
-DWANT_NEW_API
endif
ifeq
($(NO_COMPUTED_GOTO), 1)
ifeq
($(NO_COMPUTED_GOTO), 1)
FLAGS
+=
-DNO_COMPUTED_GOTO
FLAGS
+=
-DNO_COMPUTED_GOTO
endif
endif
...
...
input.cpp
View file @
e74142b9
#include "libretro.h"
#include "libretro.h"
#include "mednafen/mednafen-types.h"
#include "mednafen/mednafen-types.h"
#include <math.h>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <algorithm>
#include "mednafen/git.h"
#include "mednafen/git.h"
#include "mednafen/psx/frontio.h"
#include "mednafen/psx/frontio.h"
...
...
jni/Android.mk
View file @
e74142b9
...
@@ -6,7 +6,6 @@ DEBUG := 0
...
@@ -6,7 +6,6 @@ DEBUG := 0
FRONTEND_SUPPORTS_RGB565
:=
1
FRONTEND_SUPPORTS_RGB565
:=
1
NEED_CD
:=
1
NEED_CD
:=
1
NEED_BPP
:=
32
NEED_BPP
:=
32
WANT_NEW_API
:=
1
NEED_DEINTERLACER
:=
1
NEED_DEINTERLACER
:=
1
NEED_THREADING
:=
1
NEED_THREADING
:=
1
NEED_TREMOR
:=
1
NEED_TREMOR
:=
1
...
...
libretro.cpp
View file @
e74142b9
...
@@ -1559,7 +1559,7 @@ Breakout:
...
@@ -1559,7 +1559,7 @@ Breakout:
static
unsigned
CalcDiscSCEx
(
void
)
static
unsigned
CalcDiscSCEx
(
void
)
{
{
const
char
*
prev_valid_id
=
NULL
;
const
char
*
prev_valid_id
=
NULL
;
unsigned
ret_region
=
MDFN_GetSettingI
(
"psx.region_default"
);
unsigned
ret_region
=
MDFN_GetSettingI
(
"psx.region_default"
);
cdifs_scex_ids
.
clear
();
cdifs_scex_ids
.
clear
();
...
...
mednafen/cdrom/CDAccess.h
View file @
e74142b9
#ifndef __MDFN_CDROMFILE_H
#ifndef __MDFN_CDROMFILE_H
#define __MDFN_CDROMFILE_H
#define __MDFN_CDROMFILE_H
#include <stdio.h>
#include <stdint.h>
#include <stdint.h>
#include <boolean.h>
#include <boolean.h>
...
...
mednafen/cdrom/CDAccess_Image.cpp
View file @
e74142b9
...
@@ -279,7 +279,6 @@ bool CDAccess_Image::ParseTOCFileLineInfo(CDRFILE_TRACK_INFO *track, const int t
...
@@ -279,7 +279,6 @@ bool CDAccess_Image::ParseTOCFileLineInfo(CDRFILE_TRACK_INFO *track, const int t
track
->
FileOffset
=
offset
;
// Make sure this is set before calling GetSectorCount()!
track
->
FileOffset
=
offset
;
// Make sure this is set before calling GetSectorCount()!
sectors
=
GetSectorCount
(
track
);
sectors
=
GetSectorCount
(
track
);
//printf("Track: %d, offset: %ld, %ld\n", tracknum, offset, sectors);
if
(
length
)
if
(
length
)
{
{
...
@@ -354,7 +353,6 @@ int CDAccess_Image::LoadSBI(const char* sbi_path)
...
@@ -354,7 +353,6 @@ int CDAccess_Image::LoadSBI(const char* sbi_path)
memcpy
(
SubQReplaceMap
[
aba
].
data
,
tmpq
,
12
);
memcpy
(
SubQReplaceMap
[
aba
].
data
,
tmpq
,
12
);
}
}
//MDFN_printf("Loaded Q subchannel replacements for %zu sectors.\n", SubQReplaceMap.size());
log_cb
(
RETRO_LOG_INFO
,
"[Image] Loaded SBI file %s
\n
"
,
sbi_path
);
log_cb
(
RETRO_LOG_INFO
,
"[Image] Loaded SBI file %s
\n
"
,
sbi_path
);
filestream_close
(
sbis
);
filestream_close
(
sbis
);
return
0
;
return
0
;
...
@@ -442,8 +440,6 @@ bool CDAccess_Image::ImageOpen(const char *path, bool image_memcache)
...
@@ -442,8 +440,6 @@ bool CDAccess_Image::ImageOpen(const char *path, bool image_memcache)
MDFN_strtoupper
(
cmdbuf
);
MDFN_strtoupper
(
cmdbuf
);
}
}
//printf("%s\n", cmdbuf.c_str()); //: %s %s %s %s\n", cmdbuf.c_str(), args[0].c_str(), args[1].c_str(), args[2].c_str(), args[3].c_str());
if
(
IsTOC
)
if
(
IsTOC
)
{
{
if
(
cmdbuf
==
"TRACK"
)
if
(
cmdbuf
==
"TRACK"
)
...
@@ -526,7 +522,6 @@ bool CDAccess_Image::ImageOpen(const char *path, bool image_memcache)
...
@@ -526,7 +522,6 @@ bool CDAccess_Image::ImageOpen(const char *path, bool image_memcache)
msfoffset
=
args
[
1
].
c_str
();
msfoffset
=
args
[
1
].
c_str
();
length
=
args
[
2
].
c_str
();
length
=
args
[
2
].
c_str
();
}
}
//printf("%s, %s, %s, %s\n", args[0].c_str(), binoffset, msfoffset, length);
ParseTOCFileLineInfo
(
&
TmpTrack
,
active_track
,
args
[
0
],
binoffset
,
msfoffset
,
length
,
image_memcache
,
toc_streamcache
);
ParseTOCFileLineInfo
(
&
TmpTrack
,
active_track
,
args
[
0
],
binoffset
,
msfoffset
,
length
,
image_memcache
,
toc_streamcache
);
}
}
else
if
(
cmdbuf
==
"DATAFILE"
)
else
if
(
cmdbuf
==
"DATAFILE"
)
...
@@ -893,12 +888,9 @@ bool CDAccess_Image::ImageOpen(const char *path, bool image_memcache)
...
@@ -893,12 +888,9 @@ bool CDAccess_Image::ImageOpen(const char *path, bool image_memcache)
Tracks
[
x
].
sectors
=
Tracks
[
x
+
1
].
index
[
0
]
-
Tracks
[
x
].
index
[
1
];
//Tracks[x + 1].index - Tracks[x].index;
Tracks
[
x
].
sectors
=
Tracks
[
x
+
1
].
index
[
0
]
-
Tracks
[
x
].
index
[
1
];
//Tracks[x + 1].index - Tracks[x].index;
}
}
//printf("Poo: %d %d\n", x, Tracks[x].sectors);
RunningLBA
+=
Tracks
[
x
].
sectors
;
RunningLBA
+=
Tracks
[
x
].
sectors
;
RunningLBA
+=
Tracks
[
x
].
postgap
;
RunningLBA
+=
Tracks
[
x
].
postgap
;
//printf("%d, %ld %d %d %d %d\n", x, FileOffset, Tracks[x].index, Tracks[x].pregap, Tracks[x].sectors, Tracks[x].LBA);
FileOffset
+=
Tracks
[
x
].
sectors
*
DI_Size_Table
[
Tracks
[
x
].
DIFormat
];
FileOffset
+=
Tracks
[
x
].
sectors
*
DI_Size_Table
[
Tracks
[
x
].
DIFormat
];
}
// end to cue sheet handling
}
// end to cue sheet handling
}
// end to track loop
}
// end to track loop
...
@@ -994,7 +986,6 @@ bool CDAccess_Image::Read_Raw_Sector(uint8 *buf, int32 lba)
...
@@ -994,7 +986,6 @@ bool CDAccess_Image::Read_Raw_Sector(uint8 *buf, int32 lba)
// Handle pregap and postgap reading
// Handle pregap and postgap reading
if
(
lba
<
(
ct
->
LBA
-
ct
->
pregap_dv
)
||
lba
>=
(
ct
->
LBA
+
ct
->
sectors
))
if
(
lba
<
(
ct
->
LBA
-
ct
->
pregap_dv
)
||
lba
>=
(
ct
->
LBA
+
ct
->
sectors
))
{
{
//printf("Pre/post-gap read, LBA=%d(LBA-track_start_LBA=%d)\n", lba, lba - ct->LBA);
memset
(
buf
,
0
,
2352
);
// Null sector data, per spec
memset
(
buf
,
0
,
2352
);
// Null sector data, per spec
}
}
else
else
...
@@ -1007,10 +998,7 @@ bool CDAccess_Image::Read_Raw_Sector(uint8 *buf, int32 lba)
...
@@ -1007,10 +998,7 @@ bool CDAccess_Image::Read_Raw_Sector(uint8 *buf, int32 lba)
ct
->
LastSamplePos
+=
frames_read
;
ct
->
LastSamplePos
+=
frames_read
;
if
(
frames_read
<
0
||
frames_read
>
588
)
// This shouldn't happen.
if
(
frames_read
<
0
||
frames_read
>
588
)
// This shouldn't happen.
{
printf
(
"Error: frames_read out of range: %d
\n
"
,
frames_read
);
frames_read
=
0
;
frames_read
=
0
;
}
if
(
frames_read
<
588
)
if
(
frames_read
<
588
)
memset
((
uint8
*
)
AudioBuf
+
frames_read
*
2
*
sizeof
(
int16
),
0
,
(
588
-
frames_read
)
*
2
*
sizeof
(
int16
));
memset
((
uint8
*
)
AudioBuf
+
frames_read
*
2
*
sizeof
(
int16
),
0
,
(
588
-
frames_read
)
*
2
*
sizeof
(
int16
));
...
@@ -1083,34 +1071,6 @@ bool CDAccess_Image::Read_Raw_Sector(uint8 *buf, int32 lba)
...
@@ -1083,34 +1071,6 @@ bool CDAccess_Image::Read_Raw_Sector(uint8 *buf, int32 lba)
return
false
;
return
false
;
}
}
#if 0
if(qbuf[0] & 0x40)
{
uint8 dummy_buf[2352 + 96];
bool any_mismatch = false;
memcpy(dummy_buf + 16, buf + 16, 2048);
memset(dummy_buf + 2352, 0, 96);
MakeSubPQ(lba, dummy_buf + 2352);
encode_mode1_sector(lba + 150, dummy_buf);
for(int i = 0; i < 2352 + 96; i++)
{
if(dummy_buf[i] != buf[i])
{
printf("Mismatch at %d, %d: %02x:%02x; ", lba, i, dummy_buf[i], buf[i]);
any_mismatch = true;
}
}
if(any_mismatch)
puts("\n");
}
#endif
//subq_deinterleave(buf + 2352, qbuf);
//printf("%02x\n", qbuf[0]);
//printf("%02x\n", buf[12 + 3]);
return
true
;
return
true
;
}
}
...
@@ -1136,13 +1096,8 @@ void CDAccess_Image::MakeSubPQ(int32 lba, uint8 *SubPWBuf)
...
@@ -1136,13 +1096,8 @@ void CDAccess_Image::MakeSubPQ(int32 lba, uint8 *SubPWBuf)
}
}
}
}
//printf("%d %d\n", Tracks[1].LBA, Tracks[1].sectors);
if
(
!
track_found
)
if
(
!
track_found
)
{
printf
(
"MakeSubPQ error for sector %u!"
,
lba
);
track
=
FirstTrack
;
track
=
FirstTrack
;
}
lba_relative
=
abs
((
int32
)
lba
-
Tracks
[
track
].
LBA
);
lba_relative
=
abs
((
int32
)
lba
-
Tracks
[
track
].
LBA
);
...
@@ -1159,10 +1114,7 @@ void CDAccess_Image::MakeSubPQ(int32 lba, uint8 *SubPWBuf)
...
@@ -1159,10 +1114,7 @@ void CDAccess_Image::MakeSubPQ(int32 lba, uint8 *SubPWBuf)
// Handle pause(D7 of interleaved subchannel byte) bit, should be set to 1 when in pregap or postgap.
// Handle pause(D7 of interleaved subchannel byte) bit, should be set to 1 when in pregap or postgap.
if
((
lba
<
Tracks
[
track
].
LBA
)
||
(
lba
>=
Tracks
[
track
].
LBA
+
Tracks
[
track
].
sectors
))
if
((
lba
<
Tracks
[
track
].
LBA
)
||
(
lba
>=
Tracks
[
track
].
LBA
+
Tracks
[
track
].
sectors
))
{
//printf("pause_or = 0x80 --- %d\n", lba);
pause_or
=
0x80
;
pause_or
=
0x80
;
}
// Handle pregap between audio->data track
// Handle pregap between audio->data track
{
{
...
@@ -1176,10 +1128,7 @@ void CDAccess_Image::MakeSubPQ(int32 lba, uint8 *SubPWBuf)
...
@@ -1176,10 +1128,7 @@ void CDAccess_Image::MakeSubPQ(int32 lba, uint8 *SubPWBuf)
if
(
pg_offset
<
-
150
)
if
(
pg_offset
<
-
150
)
{
{
if
((
Tracks
[
track
].
subq_control
&
SUBQ_CTRLF_DATA
)
&&
(
FirstTrack
<
track
)
&&
!
(
Tracks
[
track
-
1
].
subq_control
&
SUBQ_CTRLF_DATA
))
if
((
Tracks
[
track
].
subq_control
&
SUBQ_CTRLF_DATA
)
&&
(
FirstTrack
<
track
)
&&
!
(
Tracks
[
track
-
1
].
subq_control
&
SUBQ_CTRLF_DATA
))
{
//printf("Pregap part 1 audio->data: lba=%d track_lba=%d\n", lba, Tracks[track].LBA);
control
=
Tracks
[
track
-
1
].
subq_control
;
control
=
Tracks
[
track
-
1
].
subq_control
;
}
}
}
}
}
...
@@ -1206,14 +1155,10 @@ void CDAccess_Image::MakeSubPQ(int32 lba, uint8 *SubPWBuf)
...
@@ -1206,14 +1155,10 @@ void CDAccess_Image::MakeSubPQ(int32 lba, uint8 *SubPWBuf)
if
(
!
SubQReplaceMap
.
empty
())
if
(
!
SubQReplaceMap
.
empty
())
{
{
//printf("%d\n", lba);
std
::
map
<
uint32
,
cpp11_array_doodad
>::
const_iterator
it
=
SubQReplaceMap
.
find
(
LBA_to_ABA
(
lba
));
std
::
map
<
uint32
,
cpp11_array_doodad
>::
const_iterator
it
=
SubQReplaceMap
.
find
(
LBA_to_ABA
(
lba
));
if
(
it
!=
SubQReplaceMap
.
end
())
if
(
it
!=
SubQReplaceMap
.
end
())
{
//printf("Replace: %d\n", lba);
memcpy
(
buf
,
it
->
second
.
data
,
12
);
memcpy
(
buf
,
it
->
second
.
data
,
12
);
}
}
}
for
(
i
=
0
;
i
<
96
;
i
++
)
for
(
i
=
0
;
i
<
96
;
i
++
)
...
...
mednafen/cdrom/cdromif.cpp
View file @
e74142b9
...
@@ -568,10 +568,7 @@ int CDIF::ReadSector(uint8* pBuf, uint32 lba, uint32 nSectors)
...
@@ -568,10 +568,7 @@ int CDIF::ReadSector(uint8* pBuf, uint32 lba, uint32 nSectors)
uint8_t
tmpbuf
[
2352
+
96
];
uint8_t
tmpbuf
[
2352
+
96
];
if
(
!
ReadRawSector
(
tmpbuf
,
lba
))
if
(
!
ReadRawSector
(
tmpbuf
,
lba
))
{
puts
(
"CDIF Raw Read error"
);
return
(
false
);
return
(
false
);
}
if
(
!
ValidateRawSector
(
tmpbuf
))
if
(
!
ValidateRawSector
(
tmpbuf
))
return
(
false
);
return
(
false
);
...
@@ -605,8 +602,6 @@ int CDIF::ReadSector(uint8* pBuf, uint32 lba, uint32 nSectors)
...
@@ -605,8 +602,6 @@ int CDIF::ReadSector(uint8* pBuf, uint32 lba, uint32 nSectors)
CDIF_ST
::
CDIF_ST
(
CDAccess
*
cda
)
:
disc_cdaccess
(
cda
)
CDIF_ST
::
CDIF_ST
(
CDAccess
*
cda
)
:
disc_cdaccess
(
cda
)
{
{
//puts("***WARNING USING SINGLE-THREADED CD READER***");
UnrecoverableError
=
false
;
UnrecoverableError
=
false
;
DiscEjected
=
false
;
DiscEjected
=
false
;
...
...
mednafen/cdrom/galois.c
View file @
e74142b9
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
* or direct your browser at http://www.gnu.org.
* or direct your browser at http://www.gnu.org.
*/
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include "galois.h"
#include "galois.h"
...
...
mednafen/psx/cdc.cpp
View file @
e74142b9
...
@@ -1323,11 +1323,6 @@ int32_t PS_CDC::Update(const int32_t timestamp)
...
@@ -1323,11 +1323,6 @@ int32_t PS_CDC::Update(const int32_t timestamp)
else
if
(
ArgsReceiveIn
<
Commands
[
PendingCommand
].
args_min
||
else
if
(
ArgsReceiveIn
<
Commands
[
PendingCommand
].
args_min
||
ArgsReceiveIn
>
Commands
[
PendingCommand
].
args_max
)
ArgsReceiveIn
>
Commands
[
PendingCommand
].
args_max
)
{
{
PSX_DBG
(
PSX_DBG_WARNING
,
"[CDC] Bad number(%d) of args(first check) for command 0x%02x"
,
ArgsReceiveIn
,
PendingCommand
);
for
(
unsigned
int
i
=
0
;
i
<
ArgsReceiveIn
;
i
++
)
PSX_DBG
(
PSX_DBG_WARNING
,
" 0x%02x"
,
ArgsReceiveBuf
[
i
]);
PSX_DBG
(
PSX_DBG_WARNING
,
"
\n
"
);
WriteResult
(
MakeStatus
(
true
));
WriteResult
(
MakeStatus
(
true
));
WriteResult
(
ERRCODE_BAD_NUMARGS
);
WriteResult
(
ERRCODE_BAD_NUMARGS
);
WriteIRQ
(
CDCIRQ_DISC_ERROR
);
WriteIRQ
(
CDCIRQ_DISC_ERROR
);
...
@@ -1335,12 +1330,6 @@ int32_t PS_CDC::Update(const int32_t timestamp)
...
@@ -1335,12 +1330,6 @@ int32_t PS_CDC::Update(const int32_t timestamp)
else
else
{
{
const
CDC_CTEntry
*
command
=
&
Commands
[
PendingCommand
];
const
CDC_CTEntry
*
command
=
&
Commands
[
PendingCommand
];
PSX_DBG
(
PSX_DBG_SPARSE
,
"[CDC] Command: %s --- "
,
command
->
name
);
for
(
unsigned
int
i
=
0
;
i
<
ArgsReceiveIn
;
i
++
)
PSX_DBG
(
PSX_DBG_SPARSE
,
" 0x%02x"
,
ArgsReceiveBuf
[
i
]);
PSX_DBG
(
PSX_DBG_SPARSE
,
"
\n
"
);
next_time
=
(
this
->*
(
command
->
func
))(
ArgsReceiveIn
,
ArgsReceiveBuf
);
next_time
=
(
this
->*
(
command
->
func
))(
ArgsReceiveIn
,
ArgsReceiveBuf
);
PendingCommandPhase
=
2
;
PendingCommandPhase
=
2
;
}
}
...
@@ -1680,9 +1669,6 @@ int32 PS_CDC::CalcSeekTime(int32 initial, int32 target, bool motor_on, bool paus
...
@@ -1680,9 +1669,6 @@ int32 PS_CDC::CalcSeekTime(int32 initial, int32 target, bool motor_on, bool paus
// ret += 1000000;
// ret += 1000000;
ret
+=
PSX_GetRandU32
(
0
,
25000
);
ret
+=
PSX_GetRandU32
(
0
,
25000
);
PSX_DBG
(
PSX_DBG_SPARSE
,
"[CDC] CalcSeekTime() %d->%d = %d
\n
"
,
initial
,
target
,
ret
);
return
(
ret
);
return
(
ret
);
}
}
...
...
mednafen/psx/cpu.cpp
View file @
e74142b9
...
@@ -56,12 +56,6 @@ bool PS_CPU::Halted;
...
@@ -56,12 +56,6 @@ bool PS_CPU::Halted;
struct
PS_CPU
::
CP0
PS_CPU
::
CP0
;
struct
PS_CPU
::
CP0
PS_CPU
::
CP0
;
char
PS_CPU
::
cache_buf
[
64
*
1024
];
char
PS_CPU
::
cache_buf
[
64
*
1024
];
#if 0
#define EXP_ILL_CHECK(n) {n;}
#else
#define EXP_ILL_CHECK(n) {}
#endif
#define BIU_ENABLE_ICACHE_S1 0x00000800 // Enable I-cache, set 1
#define BIU_ENABLE_ICACHE_S1 0x00000800 // Enable I-cache, set 1
#define BIU_ICACHE_FSIZE_MASK 0x00000300 // I-cache fill size mask; 0x000 = 2 words, 0x100 = 4 words, 0x200 = 8 words, 0x300 = 16 words
#define BIU_ICACHE_FSIZE_MASK 0x00000300 // I-cache fill size mask; 0x000 = 2 words, 0x100 = 4 words, 0x200 = 8 words, 0x300 = 16 words
#define BIU_ENABLE_DCACHE 0x00000080 // Enable D-cache
#define BIU_ENABLE_DCACHE 0x00000080 // Enable D-cache
...
@@ -332,8 +326,6 @@ void PS_CPU::SetBIU(uint32 val)
...
@@ -332,8 +326,6 @@ void PS_CPU::SetBIU(uint32 val)
ICache
[
i
].
TV
|=
0x1
;
ICache
[
i
].
TV
|=
0x1
;
}
}
}
}
PSX_DBG
(
PSX_DBG_SPARSE
,
"[CPU] Set BIU=0x%08x
\n
"
,
BIU
);
}
}
uint32
PS_CPU
::
GetBIU
(
void
)
uint32
PS_CPU
::
GetBIU
(
void
)
...
@@ -623,19 +615,6 @@ uint32 NO_INLINE PS_CPU::Exception(uint32 code, uint32 PC, const uint32 NP, cons
...
@@ -623,19 +615,6 @@ uint32 NO_INLINE PS_CPU::Exception(uint32 code, uint32 PC, const uint32 NP, cons
assert
(
code
<
16
);
assert
(
code
<
16
);
#ifdef DEBUG
if
(
code
!=
EXCEPTION_INT
&&
code
!=
EXCEPTION_BP
&&
code
!=
EXCEPTION_SYSCALL
)
{
static
const
char
*
exmne
[
16
]
=
{
"INT"
,
"MOD"
,
"TLBL"
,
"TLBS"
,
"ADEL"
,
"ADES"
,
"IBE"
,
"DBE"
,
"SYSCALL"
,
"BP"
,
"RI"
,
"COPU"
,
"OV"
,
NULL
,
NULL
,
NULL
};
PSX_DBG
(
PSX_DBG_WARNING
,
"[CPU] Exception %s(0x%02x) @ PC=0x%08x(NP=0x%08x, BDBT=0x%02x), Instr=0x%08x, IPCache=0x%02x, CAUSE=0x%08x, SR=0x%08x, IRQC_Status=0x%04x, IRQC_Mask=0x%04x
\n
"
,
exmne
[
code
],
code
,
PC
,
NP
,
BDBT
,
instr
,
IPCache
,
CP0
.
CAUSE
,
CP0
.
SR
,
IRQ_GetRegister
(
IRQ_GSREG_STATUS
,
NULL
,
0
),
IRQ_GetRegister
(
IRQ_GSREG_MASK
,
NULL
,
0
));
}
#endif
if
(
CP0
.
SR
&
(
1
<<
22
))
// BEV
if
(
CP0
.
SR
&
(
1
<<
22
))
// BEV
handler
=
0xBFC00180
;
handler
=
0xBFC00180
;
...
@@ -682,10 +661,9 @@ uint32 NO_INLINE PS_CPU::Exception(uint32 code, uint32 PC, const uint32 NP, cons
...
@@ -682,10 +661,9 @@ uint32 NO_INLINE PS_CPU::Exception(uint32 code, uint32 PC, const uint32 NP, cons
BACKED_LDValue = LDValue;
BACKED_LDValue = LDValue;
//
//
// Should come before DO_LDS() so the EXP_ILL_CHECK() emulator debugging macro in GPR_DEP() will work properly.
//
//
#define GPR_DEPRES_BEGIN { uint8 back = ReadAbsorb[0];
#define GPR_DEPRES_BEGIN { uint8 back = ReadAbsorb[0];
#define GPR_DEP(n) { unsigned tn = (n); ReadAbsorb[tn] = 0;
EXP_ILL_CHECK(if(LDWhich > 0 && LDWhich < 0x20 && LDWhich == tn) { PSX_DBG(PSX_DBG_WARNING, "[CPU] Instruction at PC=0x%08x in load delay slot has dependency on load target register(0x%02x): SR=0x%08x\n", PC, LDWhich, CP0.SR); })
}
#define GPR_DEP(n) { unsigned tn = (n); ReadAbsorb[tn] = 0; }
#define GPR_RES(n) { unsigned tn = (n); ReadAbsorb[tn] = 0; }
#define GPR_RES(n) { unsigned tn = (n); ReadAbsorb[tn] = 0; }
#define GPR_DEPRES_END ReadAbsorb[0] = back; }
#define GPR_DEPRES_END ReadAbsorb[0] = back; }
...
@@ -814,9 +792,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
...
@@ -814,9 +792,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
const uint32 offset = (arg_offset); \
const uint32 offset = (arg_offset); \
const uint32 mask = (arg_mask); \
const uint32 mask = (arg_mask); \
const uint32 old_PC = PC; \
const uint32 old_PC = PC; \
\
EXP_ILL_CHECK(if(BDBT) { PSX_DBG(PSX_DBG_WARNING, "[CPU] Branch instruction at PC=0x%08x in branch delay slot: SR=0x%08x\n", PC, CP0.SR);}) \
\
PC = new_PC; \
PC = new_PC; \
new_PC += 4; \
new_PC += 4; \
BDBT = 2; \
BDBT = 2; \
...
@@ -1212,7 +1187,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
...
@@ -1212,7 +1187,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
default:
default:
// Tested to be rather NOPish
// Tested to be rather NOPish
DO_LDS
();
DO_LDS
();
PSX_DBG
(
PSX_DBG_WARNING
,
"[CPU] MFC0 from unmapped CP0 register %u.
\n
"
,
rd
);
break
;
break
;
}
}
break
;
break
;
...
@@ -1238,12 +1212,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
...
@@ -1238,12 +1212,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
break
;
break
;
case
CP0REG_DCIC
:
case
CP0REG_DCIC
:
#ifdef DEBUG
if
(
val
)
{
PSX_DBG
(
PSX_DBG_WARNING
,
"[CPU] Non-zero write to DCIC: 0x%08x
\n
"
,
val
);
}
#endif
CP0
.
DCIC
=
val
&
0xFF80003F
;
CP0
.
DCIC
=
val
&
0xFF80003F
;
break
;
break
;
...
@@ -1274,11 +1242,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
...
@@ -1274,11 +1242,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
{
{
const
uint32
immediate
=
(
int32
)(
int16
)(
instr
&
0xFFFF
);
const
uint32
immediate
=
(
int32
)(
int16
)(
instr
&
0xFFFF
);
const
bool
result
=
(
false
==
(
bool
)(
instr
&
(
1U
<<
16
)));
const
bool
result
=
(
false
==
(
bool
)(
instr
&
(
1U
<<
16
)));
#ifdef DEBUG
PSX_DBG
(
PSX_DBG_WARNING
,
"[CPU] BC0x instruction(0x%08x) @ PC=0x%08x
\n
"
,
instr
,
PC
);
#endif
DO_BRANCH
(
result
,
(
immediate
<<
2
),
~
0U
,
false
,
0
);
DO_BRANCH
(
result
,
(
immediate
<<
2
),
~
0U
,
false
,
0
);
}
}
break
;
break
;
...
@@ -1400,11 +1363,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
...
@@ -1400,11 +1363,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
{
{
const
uint32
immediate
=
(
int32
)(
int16
)(
instr
&
0xFFFF
);
const
uint32
immediate
=
(
int32
)(
int16
)(
instr
&
0xFFFF
);
const
bool
result
=
(
false
==
(
bool
)(
instr
&
(
1U
<<
16
)));
const
bool
result
=
(
false
==
(
bool
)(
instr
&
(
1U
<<
16
)));
#ifdef DEBUG
PSX_DBG
(
PSX_DBG_WARNING
,
"[CPU] BC2x instruction(0x%08x) @ PC=0x%08x
\n
"
,
instr
,
PC
);
#endif
DO_BRANCH
(
result
,
(
immediate
<<
2
),
~
0U
,
false
,
0
);
DO_BRANCH
(
result
,
(
immediate
<<
2
),
~
0U
,
false
,
0
);
}
}
break
;
break
;
...
@@ -1433,11 +1391,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
...
@@ -1433,11 +1391,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
else
else
{
{
const
uint32
sub_op
=
(
instr
>>
21
)
&
0x1F
;
const
uint32
sub_op
=
(
instr
>>
21
)
&
0x1F
;
#ifdef DEBUG
PSX_DBG
(
PSX_DBG_WARNING
,
"[CPU] COP%u instruction(0x%08x) @ PC=0x%08x
\n
"
,
(
instr
>>
26
)
&
0x3
,
instr
,
PC
);
#endif
if
(
sub_op
==
0x08
||
sub_op
==
0x0C
)
if
(
sub_op
==
0x08
||
sub_op
==
0x0C
)
{
{
const
uint32
immediate
=
(
int32
)(
int16
)(
instr
&
0xFFFF
);
const
uint32
immediate
=
(
int32
)(
int16
)(
instr
&
0xFFFF
);
...
@@ -1469,13 +1422,7 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
...
@@ -1469,13 +1422,7 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
new_PC
=
Exception
(
EXCEPTION_ADEL
,
PC
,
new_PC
,
instr
);
new_PC
=
Exception
(
EXCEPTION_ADEL
,
PC
,
new_PC
,
instr
);
}
}
else
else
{
#ifdef DEBUG
PSX_DBG
(
PSX_DBG_WARNING
,
"[CPU] LWC%u instruction(0x%08x) @ PC=0x%08x
\n
"
,
(
instr
>>
26
)
&
0x3
,
instr
,
PC
);
#endif
ReadMemory
<
uint32
>
(
timestamp
,
address
,
false
,
true
);
ReadMemory
<
uint32
>
(
timestamp
,
address
,
false
,
true
);
}
}
}
END_OPF
;
END_OPF
;
...
@@ -1528,13 +1475,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
...
@@ -1528,13 +1475,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
CP0
.
BADA
=
address
;
CP0
.
BADA
=
address
;
new_PC
=
Exception
(
EXCEPTION_ADES
,
PC
,
new_PC
,
instr
);
new_PC
=
Exception
(
EXCEPTION_ADES
,
PC
,
new_PC
,
instr
);
}
}
#ifdef DEBUG
else
{
PSX_DBG
(
PSX_DBG_WARNING
,
"[CPU] SWC%u instruction(0x%08x) @ PC=0x%08x
\n
"
,
(
instr
>>
26
)
&
0x3
,
instr
,
PC
);
//WriteMemory<uint32>(timestamp, address, SOMETHING);
}
#endif
}
}
END_OPF
;
END_OPF
;
...
...
mednafen/psx/frontio.cpp
View file @
e74142b9
...
@@ -36,11 +36,6 @@
...
@@ -36,11 +36,6 @@
#include "input/multitap.h"
#include "input/multitap.h"
//#define PSX_FIODBGINFO(format, ...) { /* printf(format " -- timestamp=%d -- PAD temp\n", ## __VA_ARGS__, timestamp); */ }
static
void
PSX_FIODBGINFO
(
const
char
*
format
,
...)
{
}
InputDevice
::
InputDevice
()
:
InputDevice
::
InputDevice
()
:
chair_r
(
0
),
chair_r
(
0
),
chair_g
(
0
),
chair_g
(
0
),
...
@@ -543,7 +538,6 @@ INLINE void FrontIO::DoDSRIRQ(void)
...
@@ -543,7 +538,6 @@ INLINE void FrontIO::DoDSRIRQ(void)
{
{
if
(
Control
&
0x1000
)
if
(
Control
&
0x1000
)
{
{
PSX_FIODBGINFO
(
"[DSR] IRQ"
);