Skip to content

Commit b2de085

Browse files
committed
Disable BIOS when detecting SG-1000. Fix #132
1 parent a2f7b9d commit b2de085

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/GearsystemCore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ void GearsystemCore::Init(GS_Color_Format pixelFormat)
126126

127127
m_pixelFormat = pixelFormat;
128128

129-
m_pMemory = new Memory();
130129
m_pCartridge = new Cartridge();
130+
m_pMemory = new Memory(m_pCartridge);
131131
m_pProcessor = new Processor(m_pMemory);
132132
m_pVideo = new Video(m_pMemory, m_pProcessor, m_pCartridge);
133133
m_pInput = new Input(m_pProcessor, m_pVideo);

src/Memory.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
#include <fstream>
2323
#include "Memory.h"
2424
#include "Processor.h"
25+
#include "Cartridge.h"
2526

26-
Memory::Memory()
27+
Memory::Memory(Cartridge* pCartridge)
2728
{
29+
m_pCartridge = pCartridge;
2830
InitPointer(m_pProcessor);
2931
InitPointer(m_pMap);
3032
InitPointer(m_pCurrentMemoryRule);
@@ -303,6 +305,9 @@ void Memory::LoadBootroom(const char* szFilePath, bool gg)
303305

304306
bool Memory::IsBootromEnabled()
305307
{
308+
if (m_pCartridge->IsSG1000())
309+
return false;
310+
306311
return (m_bBootromSMSEnabled && m_bBootromSMSLoaded && !m_bGameGear) || (m_bBootromGGEnabled && m_bBootromGGLoaded && m_bGameGear);
307312
}
308313

src/Memory.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <vector>
2727

2828
class Processor;
29+
class Cartridge;
2930

3031
class Memory
3132
{
@@ -61,7 +62,7 @@ class Memory
6162
};
6263

6364
public:
64-
Memory();
65+
Memory(Cartridge* pCartridge);
6566
~Memory();
6667
void SetProcessor(Processor* pProcessor);
6768
void Init();
@@ -104,6 +105,7 @@ class Memory
104105

105106
private:
106107
Processor* m_pProcessor;
108+
Cartridge* m_pCartridge;
107109
MemoryRule* m_pCurrentMemoryRule;
108110
MemoryRule* m_pBootromMemoryRule;
109111
u8* m_pMap;

0 commit comments

Comments
 (0)