fix nyma cd switching
also changing the make all cores script so it uses the install target
This commit is contained in:
parent
43ffb63ede
commit
1c27c73c86
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -104,10 +104,10 @@ enum BizhawkFlags
|
||||||
SkipSoundening = 2,
|
SkipSoundening = 2,
|
||||||
// render at LCM * LCM instead of raw
|
// render at LCM * LCM instead of raw
|
||||||
RenderConstantSize = 4,
|
RenderConstantSize = 4,
|
||||||
// switch to the previous disk, if possible
|
// open disk tray, if possible
|
||||||
PreviousDisk = 8,
|
OpenTray = 8,
|
||||||
// switch to the next disk, if possible
|
// close disk tray, if possible
|
||||||
NextDisk = 16
|
CloseTray = 16
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MyFrameInfo: public FrameInfo
|
struct MyFrameInfo: public FrameInfo
|
||||||
|
@ -118,6 +118,7 @@ struct MyFrameInfo: public FrameInfo
|
||||||
// raw data for each input port, assumed to be MAX_PORTS * MAX_PORT_DATA long
|
// raw data for each input port, assumed to be MAX_PORTS * MAX_PORT_DATA long
|
||||||
uint8_t* InputPortData;
|
uint8_t* InputPortData;
|
||||||
int64_t FrontendTime;
|
int64_t FrontendTime;
|
||||||
|
uint8_t DiscIndex; // used on close tray
|
||||||
};
|
};
|
||||||
|
|
||||||
ECL_EXPORT void FrameAdvance(MyFrameInfo& frame)
|
ECL_EXPORT void FrameAdvance(MyFrameInfo& frame)
|
||||||
|
@ -127,10 +128,10 @@ ECL_EXPORT void FrameAdvance(MyFrameInfo& frame)
|
||||||
EES->skip = !!(frame.BizhawkFlags & BizhawkFlags::SkipRendering);
|
EES->skip = !!(frame.BizhawkFlags & BizhawkFlags::SkipRendering);
|
||||||
|
|
||||||
{
|
{
|
||||||
auto prev = !!(frame.BizhawkFlags & BizhawkFlags::PreviousDisk);
|
auto open = !!(frame.BizhawkFlags & BizhawkFlags::OpenTray);
|
||||||
auto next = !!(frame.BizhawkFlags & BizhawkFlags::NextDisk);
|
auto close = !!(frame.BizhawkFlags & BizhawkFlags::CloseTray);
|
||||||
if (prev || next)
|
if (open || close)
|
||||||
SwitchCds(prev, next);
|
SwitchCds(open, close, frame.DiscIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame.Command)
|
if (frame.Command)
|
||||||
|
|
|
@ -117,38 +117,34 @@ void StartGameWithCds(int numdisks)
|
||||||
0 // orientation: flip sides on NES FDS. not used elsewhere?
|
0 // orientation: flip sides on NES FDS. not used elsewhere?
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
static bool wasPrev;
|
static bool trayOpen = false;
|
||||||
static bool wasNext;
|
static int curCd = 0; // -1 means no media present
|
||||||
static int cd;
|
void SwitchCds(bool open, bool close, int cd)
|
||||||
void SwitchCds(bool prev, bool next)
|
|
||||||
{
|
{
|
||||||
auto newCd = cd;
|
if (open && !trayOpen)
|
||||||
if (prev && !wasPrev)
|
|
||||||
{
|
|
||||||
newCd = std::max(newCd - 1, -1);
|
|
||||||
}
|
|
||||||
if (next && !wasNext)
|
|
||||||
{
|
|
||||||
newCd = std::min(newCd + 1, (int)(CDInterfaces->size() - 1));
|
|
||||||
}
|
|
||||||
if (newCd != cd)
|
|
||||||
{
|
{
|
||||||
Mednafen::MDFNGameInfo->SetMedia(
|
Mednafen::MDFNGameInfo->SetMedia(
|
||||||
0, // drive: 0 unless there's more than one drive
|
0, // drive: 0 unless there's more than one drive
|
||||||
0, // state: 0 = open, 1 = closed (media absent), 2 = closed (media present)
|
0, // state: 0 = open, 1 = closed (media absent), 2 = closed (media present)
|
||||||
|
std::max(curCd, 0), // media: index into the disk list
|
||||||
|
0 // orientation: flip sides on NES FDS. not used elsewhere?
|
||||||
|
);
|
||||||
|
|
||||||
|
trayOpen = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (close && trayOpen)
|
||||||
|
{
|
||||||
|
Mednafen::MDFNGameInfo->SetMedia(
|
||||||
|
0, // drive: 0 unless there's more than one drive
|
||||||
|
cd == -1 ? 1 : 2, // state: 0 = open, 1 = closed (media absent), 2 = closed (media present)
|
||||||
std::max(cd, 0), // media: index into the disk list
|
std::max(cd, 0), // media: index into the disk list
|
||||||
0 // orientation: flip sides on NES FDS. not used elsewhere?
|
0 // orientation: flip sides on NES FDS. not used elsewhere?
|
||||||
);
|
);
|
||||||
Mednafen::MDFNGameInfo->SetMedia(
|
|
||||||
0, // drive: 0 unless there's more than one drive
|
trayOpen = false;
|
||||||
newCd == -1 ? 0 : 2, // state: 0 = open, 1 = closed (media absent), 2 = closed (media present)
|
curCd = cd;
|
||||||
std::max(newCd, 0), // media: index into the disk list
|
|
||||||
0 // orientation: flip sides on NES FDS. not used elsewhere?
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
cd = newCd;
|
|
||||||
wasPrev = prev;
|
|
||||||
wasNext = next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CDInterface::Load pulls in a bunch of things that we do not want, stub them out here
|
// CDInterface::Load pulls in a bunch of things that we do not want, stub them out here
|
||||||
|
|
|
@ -11,7 +11,7 @@ ECL_EXPORT void SetCDCallbacks()
|
||||||
{
|
{
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
void SwitchCds(bool prev, bool next)
|
void SwitchCds(bool open, bool close, int cd)
|
||||||
{
|
{
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,4 +27,4 @@ typedef void (*FrameCallback)();
|
||||||
void RegisterFrameThreadProc(FrameCallback threadproc);
|
void RegisterFrameThreadProc(FrameCallback threadproc);
|
||||||
|
|
||||||
void StartGameWithCds(int numdisks);
|
void StartGameWithCds(int numdisks);
|
||||||
void SwitchCds(bool prev, bool next);
|
void SwitchCds(bool open, bool close, int cd);
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
make -f turbo.mak $1 -j
|
make -f turbo.mak $1 -j install
|
||||||
make -f hyper.mak $1 -j
|
make -f hyper.mak $1 -j install
|
||||||
make -f ngp.mak $1 -j
|
make -f ngp.mak $1 -j install
|
||||||
make -f faust.mak $1 -j
|
make -f faust.mak $1 -j install
|
||||||
make -f pcfx.mak $1 -j
|
make -f pcfx.mak $1 -j install
|
||||||
make -f ss.mak $1 -j
|
make -f ss.mak $1 -j install
|
||||||
make -f shock.mak $1 -j
|
make -f shock.mak $1 -j install
|
||||||
# make -f lynx.mak $1 -j
|
# make -f lynx.mak $1 -j install
|
||||||
make -f vb.mak $1 -j
|
make -f vb.mak $1 -j install
|
||||||
# make -f wswan.mak $1 -j
|
# make -f wswan.mak $1 -j install
|
||||||
|
|
Loading…
Reference in New Issue