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-pce-libretro
Commits
7095284e
Commit
7095284e
authored
Jun 15, 2022
by
libretroadmin
Browse files
* Remove unneeded MDFNGI/EmulatedPCE
parent
1c8d6589
Pipeline
#123211
passed with stages
in 15 minutes
Changes
6
Pipelines
35
Hide whitespace changes
Inline
Side-by-side
libretro.cpp
View file @
7095284e
...
...
@@ -42,9 +42,6 @@ static bool cdimagecache = false;
static
bool
show_advanced_input_settings
=
true
;
static
bool
use_palette
=
false
;
extern
MDFNGI
EmulatedPCE
;
MDFNGI
*
MDFNGameInfo
=
&
EmulatedPCE
;
static
int
hires_blend
=
0
;
static
int
blur_passes
=
1
;
static
int
aspect_ratio
=
0
;
...
...
@@ -695,8 +692,6 @@ static bool MDFNI_LoadCD(const char *path, const char *ext)
CDInterfaces
.
clear
();
MDFNGameInfo
=
NULL
;
return
false
;
}
...
...
@@ -712,7 +707,6 @@ static bool MDFNI_LoadGame(const char *path, const char *ext,
const
uint8_t
*
data
,
size_t
size
)
{
MDFNFILE
*
GameFile
=
NULL
;
MDFNGameInfo
=
&
EmulatedPCE
;
const
uint8_t
*
content_data
=
NULL
;
size_t
content_size
=
0
;
...
...
@@ -772,7 +766,6 @@ static bool MDFNI_LoadGame(const char *path, const char *ext,
error:
if
(
GameFile
)
file_close
(
GameFile
);
MDFNGameInfo
=
NULL
;
return
false
;
}
...
...
@@ -1450,17 +1443,12 @@ bool retro_load_game(const struct retro_game_info *info)
void
retro_unload_game
(
void
)
{
if
(
!
MDFNGameInfo
)
return
;
MDFN_FlushGameCheats
(
0
);
PCE_CloseGame
();
MDFNMP_Kill
();
MDFNGameInfo
=
NULL
;
for
(
unsigned
i
=
0
;
i
<
CDInterfaces
.
size
();
i
++
)
delete
CDInterfaces
[
i
];
...
...
@@ -1740,8 +1728,6 @@ void retro_run(void)
spec
.
CustomPalette
=
use_palette
?
composite_palette
:
NULL
;
spec
.
CustomPaletteNumEntries
=
use_palette
?
512
:
0
;
spec
.
IsFMV
=
NULL
;
spec
.
InterlaceOn
=
false
;
spec
.
InterlaceField
=
false
;
...
...
@@ -1754,10 +1740,6 @@ void retro_run(void)
spec
.
SoundBuf
=
sound_buf
;
spec
.
SoundBufMaxSize
=
sizeof
(
sound_buf
)
/
2
;
spec
.
SoundBufSize
=
0
;
spec
.
SoundBufSizeALMS
=
0
;
spec
.
MasterCycles
=
0
;
spec
.
MasterCyclesALMS
=
0
;
spec
.
SoundVolume
=
1.0
;
spec
.
soundmultiplier
=
1.0
;
...
...
@@ -1774,11 +1756,7 @@ void retro_run(void)
Emulate
(
&
spec
);
#define PCE_SOUNDCHANS 2
int16
*
const
SoundBuf
=
spec
.
SoundBuf
+
spec
.
SoundBufSizeALMS
*
PCE_SOUNDCHANS
;
int32
SoundBufSize
=
spec
.
SoundBufSize
-
spec
.
SoundBufSizeALMS
;
const
int32
SoundBufMaxSize
=
spec
.
SoundBufMaxSize
-
spec
.
SoundBufSizeALMS
;
spec
.
SoundBufSize
=
spec
.
SoundBufSizeALMS
+
SoundBufSize
;
const
int32
SoundBufMaxSize
=
spec
.
SoundBufMaxSize
;
if
(
video_width
!=
spec
.
DisplayRect
.
w
||
video_height
!=
spec
.
DisplayRect
.
h
)
resolution_changed
=
true
;
...
...
@@ -2135,13 +2113,5 @@ void MDFN_DispMessage(const char *format, ...)
void
MDFN_MidSync
(
EmulateSpecStruct
*
espec
)
{
//if(!MDFNnetplay)
{
//ProcessAudio(espec);
//espec->SoundBufSizeALMS = espec->SoundBufSize;
//espec->MasterCyclesALMS = espec->MasterCycles;
PCEINPUT_TransformInput
();
}
PCEINPUT_TransformInput
();
}
mednafen/git.h
View file @
7095284e
...
...
@@ -16,25 +16,6 @@ enum
MDFN_ROTATE270
};
typedef
enum
{
VIDSYS_NONE
,
// Can be used internally in system emulation code, but it is an error condition to let it continue to be
// after the Load() or LoadCD() function returns!
VIDSYS_PAL
,
VIDSYS_PAL_M
,
// Same timing as NTSC, but uses PAL-style colour encoding
VIDSYS_NTSC
,
VIDSYS_SECAM
}
VideoSystems
;
typedef
enum
{
GMT_CART
,
// Self-explanatory!
GMT_ARCADE
,
// VS Unisystem, PC-10...
GMT_DISK
,
// Famicom Disk System, mostly
GMT_CDROM
,
// PC Engine CD, PC-FX
GMT_PLAYER
// Music player(NSF, HES, GSF)
}
GameMediumTypes
;
typedef
enum
{
IDIT_BUTTON
,
// 1-bit
...
...
@@ -123,45 +104,6 @@ enum
MDFN_MSC_RESET
=
0x01
,
MDFN_MSC_POWER
=
0x02
,
MDFN_MSC_INSERT_COIN
=
0x07
,
// If we ever support arcade systems, we'll abstract DIP switches differently...maybe.
MDFN_MSC_TOGGLE_DIP0
=
0x10
,
MDFN_MSC_TOGGLE_DIP1
,
MDFN_MSC_TOGGLE_DIP2
,
MDFN_MSC_TOGGLE_DIP3
,
MDFN_MSC_TOGGLE_DIP4
,
MDFN_MSC_TOGGLE_DIP5
,
MDFN_MSC_TOGGLE_DIP6
,
MDFN_MSC_TOGGLE_DIP7
,
MDFN_MSC_TOGGLE_DIP8
,
MDFN_MSC_TOGGLE_DIP9
,
MDFN_MSC_TOGGLE_DIP10
,
MDFN_MSC_TOGGLE_DIP11
,
MDFN_MSC_TOGGLE_DIP12
,
MDFN_MSC_TOGGLE_DIP13
,
MDFN_MSC_TOGGLE_DIP14
,
MDFN_MSC_TOGGLE_DIP15
,
// n of DISKn translates to is emulation module specific.
MDFN_MSC_INSERT_DISK0
=
0x20
,
MDFN_MSC_INSERT_DISK1
,
MDFN_MSC_INSERT_DISK2
,
MDFN_MSC_INSERT_DISK3
,
MDFN_MSC_INSERT_DISK4
,
MDFN_MSC_INSERT_DISK5
,
MDFN_MSC_INSERT_DISK6
,
MDFN_MSC_INSERT_DISK7
,
MDFN_MSC_INSERT_DISK8
,
MDFN_MSC_INSERT_DISK9
,
MDFN_MSC_INSERT_DISK10
,
MDFN_MSC_INSERT_DISK11
,
MDFN_MSC_INSERT_DISK12
,
MDFN_MSC_INSERT_DISK13
,
MDFN_MSC_INSERT_DISK14
,
MDFN_MSC_INSERT_DISK15
,
MDFN_MSC_INSERT_DISK
=
0x30
,
MDFN_MSC_EJECT_DISK
=
0x31
,
...
...
@@ -204,9 +146,6 @@ typedef struct
uint8
*
CustomPalette
;
uint32
CustomPaletteNumEntries
;
// TODO
bool
*
IsFMV
;
// Set(optionally) by emulation code. If InterlaceOn is true, then assume field height is 1/2 DisplayRect.h, and
// only every other line in surface (with the start line defined by InterlacedField) has valid data
// (it's up to internal Mednafen code to deinterlace it).
...
...
@@ -237,14 +176,6 @@ typedef struct
// Number of frames currently in internal sound buffer. Set by the system emulation code, to be read by the driver code.
int32
SoundBufSize
;
int32
SoundBufSizeALMS
;
// SoundBufSize value at last MidSync(), 0
// if mid sync isn't implemented for the emulation module in use.
// Number of cycles that this frame consumed, using MDFNGI::MasterClock as a time base.
// Set by emulation code.
int64
MasterCycles
;
int64
MasterCyclesALMS
;
// MasterCycles value at last MidSync(), 0
// if mid sync isn't implemented for the emulation module in use.
// Current sound volume(0.000...<=volume<=1.000...). If, after calling Emulate(), it is still != 1, Mednafen will handle it internally.
// Emulation modules can handle volume themselves if they like, for speed reasons. If they do, afterwards, they should set its value to 1.
...
...
@@ -278,58 +209,6 @@ typedef enum
class
CDIF
;
#define MDFN_MASTERCLOCK_FIXED(n) ((int64)((double)(n) * (1LL << 32)))
typedef
struct
{
// Time base for EmulateSpecStruct::MasterCycles
int64
MasterClock
;
uint32
fps
;
// frames per second * 65536 * 256, truncated
// multires is a hint that, if set, indicates that the system has fairly programmable video modes(particularly, the ability
// to display multiple horizontal resolutions, such as the PCE, PC-FX, or Genesis). In practice, it will cause the driver
// code to set the linear interpolation on by default.
//
// lcm_width and lcm_height are the least common multiples of all possible
// resolutions in the frame buffer as specified by DisplayRect/LineWidths(Ex for PCE: widths of 256, 341.333333, 512,
// lcm = 1024)
//
// nominal_width and nominal_height specify the resolution that Mednafen should display
// the framebuffer image in at 1x scaling, scaled from the dimensions of DisplayRect, and optionally the LineWidths array
// passed through espec to the Emulate() function.
//
bool
multires
;
int
lcm_width
;
int
lcm_height
;
void
*
dummy_separator
;
//
int
nominal_width
;
int
nominal_height
;
int
fb_width
;
// Width of the framebuffer(not necessarily width of the image). MDFN_Surface width should be >= this.
int
fb_height
;
// Height of the framebuffer passed to the Emulate() function(not necessarily height of the image)
int
soundchan
;
// Number of output sound channels.
int
rotated
;
int
soundrate
;
/* For Ogg Vorbis expansion sound wacky support. 0 for default. */
VideoSystems
VideoSystem
;
GameMediumTypes
GameType
;
//int DiskLogicalCount; // A single double-sided disk would be 2 here.
//const char *DiskNames; // Null-terminated.
const
char
*
cspecial
;
/* Special cart expansion: DIP switches, barcode reader, etc. */
double
mouse_sensitivity
;
}
MDFNGI
;
// Source: http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
// Rounds up to the nearest power of 2.
static
INLINE
uint32
round_up_pow2
(
uint32
v
)
...
...
mednafen/mednafen.h
View file @
7095284e
...
...
@@ -35,8 +35,6 @@ static INLINE void swap_T(T& t1, T& t2)
t2
=
tmp
;
}
extern
MDFNGI
*
MDFNGameInfo
;
#include "settings.h"
void
MDFN_PrintError
(
const
char
*
format
,
...);
...
...
mednafen/pce/input.cpp
View file @
7095284e
...
...
@@ -283,7 +283,6 @@ int INPUT_StateAction(StateMem *sm, int load, int data_only)
static
void
SyncSettings
(
void
)
{
MDFNGameInfo
->
mouse_sensitivity
=
MDFN_GetSettingF
(
"pce.mouse_sensitivity"
);
MultiTapEnabled
=
MDFN_GetSettingB
(
"pce.input.multitap"
);
DisableSR
=
MDFN_GetSettingB
(
"pce.disable_softreset"
);
}
mednafen/pce/pce.cpp
View file @
7095284e
...
...
@@ -363,17 +363,9 @@ static MDFN_COLD int LoadCommon(void)
PCE_Power
();
MDFNGameInfo
->
fps
=
(
uint32
)((
double
)
7159090.90909090
/
455
/
263
*
65536
*
256
);
for
(
unsigned
int
i
=
0
;
i
<
0x100
;
i
++
)
NonCheatPCERead
[
i
]
=
HuCPU
.
GetReadHandler
(
i
);
MDFNGameInfo
->
nominal_height
=
MDFN_GetSettingUI
(
"pce.slend"
)
-
MDFN_GetSettingUI
(
"pce.slstart"
)
+
1
;
MDFNGameInfo
->
nominal_width
=
MDFN_GetSettingB
(
"pce.h_overscan"
)
?
320
:
288
;
MDFNGameInfo
->
lcm_width
=
MDFN_GetSettingB
(
"pce.h_overscan"
)
?
1120
:
1024
;
MDFNGameInfo
->
lcm_height
=
MDFNGameInfo
->
nominal_height
;
vce
->
SetShowHorizOS
(
MDFN_GetSettingB
(
"pce.h_overscan"
));
return
(
1
);
...
...
@@ -537,7 +529,6 @@ void Emulate(EmulateSpecStruct *espec)
{
es
=
espec
;
espec
->
MasterCycles
=
0
;
espec
->
SoundBufSize
=
0
;
MDFNMP_ApplyPeriodicCheats
();
...
...
@@ -629,7 +620,6 @@ void Emulate(EmulateSpecStruct *espec)
//
//
PCE_TimestampBase
+=
end_timestamp
-
end_timestamp_mod12
;
espec
->
MasterCycles
+=
end_timestamp
-
end_timestamp_mod12
;
if
(
!
rp_rv
)
MDFN_MidSync
(
espec
);
...
...
@@ -762,23 +752,3 @@ void SettingsChanged(void)
vce
->
SetVDCUnlimitedSprites
(
MDFN_GetSettingB
(
"pce.nospritelimit"
));
vce
->
SetShowHorizOS
(
MDFN_GetSettingB
(
"pce.h_overscan"
));
}
MDFNGI
EmulatedPCE
=
{
MDFN_MASTERCLOCK_FIXED
(
PCE_MASTER_CLOCK
),
0
,
true
,
// Multires possible?
0
,
// lcm_width
0
,
// lcm_height
NULL
,
// Dummy
512
,
// Nominal width
243
,
// Nominal height
1365
,
// Framebuffer width
270
,
// Framebuffer height
2
,
// Number of output sound channels
};
mednafen/pce/pce.h
View file @
7095284e
...
...
@@ -17,7 +17,6 @@
extern
HuC6280
HuCPU
;
extern
uint8
BaseRAM
[
32768
];
extern
MDFNGI
EmulatedPCE
;
extern
bool
PCE_ACEnabled
;
// Arcade Card emulation enabled?
extern
void
PCE_Power
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment