Now that having internal CDVD interfaces is easy, I added a NODISC interface, with a menu option to run the BIOS with no disc.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1513 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gigaherz 2009-07-15 01:17:28 +00:00
parent 89c239d443
commit e2c31ae72a
6 changed files with 140 additions and 6 deletions

View File

@ -846,8 +846,6 @@ struct CDVDplugin {
int* initCount;
};
extern CDVDplugin CDVD_plugin; // _plugin because of
extern CDVDplugin CDVD;
extern CDVDplugin ISO;
// DEV9
extern _DEV9init DEV9init;

View File

@ -107,5 +107,10 @@ extern void cdvdWrite(u8 key, u8 rt);
// Platform dependent system time assignment (see WinMisc / LnxMisc)
extern void cdvdSetSystemTime(cdvdStruct& setme);
extern CDVDplugin CDVD;
extern CDVDplugin ISO;
extern CDVDplugin NODISC;
#endif /* __CDVD_H__ */

View File

@ -389,3 +389,123 @@ void DoCDVDresetDiskTypeCache()
{
diskTypeCached = -1;
}
////////////////////////////////////////////////////////
//
// CDVD null interface for Run BIOS menu
s32 CALLBACK NODISCinit()
{
return 0;
}
s32 CALLBACK NODISCopen(const char* pTitle)
{
return 0;
}
void CALLBACK NODISCclose()
{
}
void CALLBACK NODISCshutdown()
{
}
s32 CALLBACK NODISCreadTrack(u32 lsn, int mode)
{
return -1;
}
// return can be NULL (for async modes)
u8* CALLBACK NODISCgetBuffer()
{
return NULL;
}
s32 CALLBACK NODISCreadSubQ(u32 lsn, cdvdSubQ* subq)
{
return -1;
}
s32 CALLBACK NODISCgetTN(cdvdTN *Buffer)
{
return -1;
}
s32 CALLBACK NODISCgetTD(u8 Track, cdvdTD *Buffer)
{
return -1;
}
s32 CALLBACK NODISCgetTOC(void* toc)
{
return -1;
}
s32 CALLBACK NODISCgetDiskType()
{
return CDVD_TYPE_NODISC;
}
s32 CALLBACK NODISCgetTrayStatus()
{
return CDVD_TRAY_CLOSE;
}
s32 CALLBACK NODISCdummyS32()
{
return 0;
}
void CALLBACK NODISCdummyVOID()
{
}
void CALLBACK NODISCnewDiskCB(void(CALLBACK*)())
{
}
s32 CALLBACK NODISCreadSector(u8* tempbuffer, u32 lsn, int mode)
{
return -1;
}
s32 CALLBACK NODISCgetBuffer2(u8* buffer)
{
return -1;
}
s32 CALLBACK NODISCgetDualInfo(s32* dualType, u32* _layer1start)
{
return -1;
}
CDVDplugin NODISC = {
NODISCinit,
NODISCopen,
NODISCclose,
NODISCshutdown,
NODISCreadTrack,
NODISCgetBuffer,
NODISCreadSubQ,
NODISCgetTN,
NODISCgetTD,
NODISCgetTOC,
NODISCgetDiskType,
NODISCgetTrayStatus,
NODISCdummyS32,
NODISCdummyS32,
NODISCdummyVOID,
NODISCdummyS32,
NODISCdummyVOID,
NODISCnewDiskCB,
NODISCreadSector,
NODISCgetBuffer2,
NODISCgetDualInfo,
NULL
};

View File

@ -29,6 +29,8 @@
#include "R5900Exceptions.h"
#include "CDVD/CDVD.h"
using namespace std;
using namespace Console;

View File

@ -39,6 +39,7 @@
#include "implement.h" // pthreads-win32 defines for startup/shutdown
#include "CDVD/CDVDisoReader.h"
#include "CDVD/CDVD.h"
unsigned int langsMax;
static bool m_RestartGui = false; // used to signal a GUI restart after DestroyWindow()
@ -686,6 +687,12 @@ LRESULT WINAPI MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
break;
case ID_FILE_RUNBIOS:
CDVD = NODISC;
SysReset();
SysPrepareExecution( NULL, true );
break;
case ID_RUN_EXECUTE:
// Execute without reset -- resumes existing states or runs the BIOS if
// the state is cleared/reset.
@ -990,8 +997,9 @@ void CreateMainMenu() {
ADDSEPARATOR(0);
ADDSUBMENUS(0, 1, _("&States"));
ADDSEPARATOR(0);
ADDMENUITEM(0, _("&Open ELF File"), ID_FILEOPEN);
ADDMENUITEM(0, _("Run from &ISO Image"), ID_FILE_RUNISO);
ADDMENUITEM(0, _("&Open ELF File..."), ID_FILEOPEN);
ADDMENUITEM(0, _("Run &ISO Image..."), ID_FILE_RUNISO);
ADDMENUITEM(0, _("Run &BIOS (No Disc)"), ID_FILE_RUNBIOS);
ADDMENUITEM(0, _("&Run CD/DVD"), ID_FILE_RUNCD);
ADDSUBMENUS(1, 3, _("&Save"));
ADDSUBMENUS(1, 2, _("&Load"));

View File

@ -412,6 +412,7 @@
#define ID_ADVANCED_OPTIONS 40104
#define ID_FILE_RUNISO 40105
#define ID_BLOCKDUMP 40106
#define ID_FILE_RUNBIOS 40107
#define ID_LANGS 50000
// Next default values for new objects
@ -419,7 +420,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 182
#define _APS_NEXT_COMMAND_VALUE 40107
#define _APS_NEXT_COMMAND_VALUE 40108
#define _APS_NEXT_CONTROL_VALUE 1331
#define _APS_NEXT_SYMED_VALUE 104
#endif