Merge branch 'feature/lodefmode-moviecart' of https://github.com/stella-emu/stella into feature/lodefmode-moviecart

This commit is contained in:
thrust26 2021-04-23 22:22:03 +02:00
commit 7404981105
2 changed files with 36 additions and 35 deletions

View File

@ -105,9 +105,7 @@ class StreamReader
return myGraphOverride ? *myGraphOverride++ : *myGraph++;
}
void overrideGraph(const uInt8* p) {
myGraphOverride = p;
}
void overrideGraph(const uInt8* p) { myGraphOverride = p; }
uInt8 readAudio() { return *myAudio++; }
@ -635,7 +633,6 @@ class MovieCart
{
public:
MovieCart() = default;
~MovieCart() = default;
bool init(const string& path);
bool process(uInt16 address);
@ -664,12 +661,21 @@ class MovieCart
Stream
};
void stopTitleScreen();
void stopTitleScreen() {
// clear carry, one bit difference from 0x38 sec
writeROM(addr_title_loop + 0, 0x18);
}
void writeColor(uInt16 address, uInt8 val);
void writeAudioData(uInt16 address, uInt8 val);
void writeAudio(uInt16 address);
void writeGraph(uInt16 address);
void writeAudioData(uInt16 address, uInt8 val) {
writeROM(address, myVolumeScale[val]);
}
void writeAudio(uInt16 address) {
writeAudioData(address, myStream.readAudio());
}
void writeGraph(uInt16 address) {
writeROM(address, myStream.readGraph());
}
void runStateMachine();
@ -727,6 +733,7 @@ class MovieCart
uInt8 myFirstAudioVal{0};
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool MovieCart::init(const string& path)
{
memcpy(myROM, kernelROM, 1024);
@ -770,39 +777,20 @@ bool MovieCart::init(const string& path)
return true;
}
void MovieCart::stopTitleScreen()
{
// clear carry, one bit difference from 0x38 sec
writeROM(addr_title_loop + 0, 0x18);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void MovieCart::writeColor(uInt16 address, uInt8 v)
{
v = (v & 0xf0) | shiftBright[(v & 0x0f) + myBright];
if (myForceColor)
if(myForceColor)
v = myForceColor;
if (myInputs.bw)
if(myInputs.bw)
v &= 0x0f;
writeROM(address, v);
}
void MovieCart::writeAudioData(uInt16 address, uInt8 val)
{
writeROM(address, myVolumeScale[val]);
}
void MovieCart::writeAudio(uInt16 address)
{
writeAudioData(address, myStream.readAudio());
}
void MovieCart::writeGraph(uInt16 address)
{
writeROM(address, myStream.readGraph());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void MovieCart::updateTransport()
{
myStream.overrideGraph(nullptr);
@ -997,6 +985,7 @@ void MovieCart::updateTransport()
myLastInputs = myInputs;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void MovieCart::fill_addr_right_line()
{
writeAudio(addr_set_aud_right + 1);
@ -1015,6 +1004,7 @@ void MovieCart::fill_addr_right_line()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void MovieCart::fill_addr_left_line(bool again)
{
writeAudio(addr_set_aud_left + 1);
@ -1049,6 +1039,7 @@ void MovieCart::fill_addr_left_line(bool again)
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void MovieCart::fill_addr_end_lines()
{
writeAudio(addr_set_aud_endlines + 1);
@ -1079,9 +1070,9 @@ void MovieCart::fill_addr_end_lines()
writeROM(addr_pick_transport + 1, LO_JUMP_BYTE(addr_transport_buttons));
writeROM(addr_pick_transport + 2, HI_JUMP_BYTE(addr_transport_buttons));
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void MovieCart::fill_addr_blank_lines()
{
// version number
@ -1115,6 +1106,7 @@ void MovieCart::fill_addr_blank_lines()
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void MovieCart::runStateMachine()
{
switch(myState)
@ -1248,6 +1240,7 @@ void MovieCart::runStateMachine()
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool MovieCart::process(uInt16 address)
{
bool a12 = (address & (1 << 12)) ? 1:0;
@ -1293,9 +1286,9 @@ CartridgeMVC::CartridgeMVC(const string& path, size_t size,
const string& md5, const Settings& settings,
size_t bsSize)
: Cartridge(settings, md5),
mySize{bsSize}
mySize{bsSize},
myPath{path}
{
myPath = path;
myMovie = make_unique<MovieCart>();
// not used
@ -1328,7 +1321,7 @@ void CartridgeMVC::reset()
const ByteBuffer& CartridgeMVC::getImage(size_t& size) const
{
// not used
size = mySize;
size = 0;
return myImage;
}

View File

@ -451,6 +451,8 @@
DC8C1BB114B25DE7006440EE /* MindLink.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DC8C1BAB14B25DE7006440EE /* MindLink.cxx */; };
DC8C1BB214B25DE7006440EE /* MindLink.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC8C1BAC14B25DE7006440EE /* MindLink.hxx */; };
DC8CF9BD17C15A27004B533D /* ConsoleMediumFont.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC8CF9BC17C15A27004B533D /* ConsoleMediumFont.hxx */; };
DC911C7526333B9200666AC0 /* CartMVC.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DC911C7326333B9100666AC0 /* CartMVC.cxx */; };
DC911C7626333B9200666AC0 /* CartMVC.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC911C7426333B9100666AC0 /* CartMVC.hxx */; };
DC932D440F278A5200FEFEFC /* DefProps.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC932D3F0F278A5200FEFEFC /* DefProps.hxx */; };
DC932D450F278A5200FEFEFC /* Serializable.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC932D400F278A5200FEFEFC /* Serializable.hxx */; };
DC932D460F278A5200FEFEFC /* SerialPort.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DC932D410F278A5200FEFEFC /* SerialPort.hxx */; };
@ -1258,6 +1260,8 @@
DC8C1BAB14B25DE7006440EE /* MindLink.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MindLink.cxx; sourceTree = "<group>"; };
DC8C1BAC14B25DE7006440EE /* MindLink.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = MindLink.hxx; sourceTree = "<group>"; };
DC8CF9BC17C15A27004B533D /* ConsoleMediumFont.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ConsoleMediumFont.hxx; sourceTree = "<group>"; };
DC911C7326333B9100666AC0 /* CartMVC.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CartMVC.cxx; sourceTree = "<group>"; };
DC911C7426333B9100666AC0 /* CartMVC.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CartMVC.hxx; sourceTree = "<group>"; };
DC932D3F0F278A5200FEFEFC /* DefProps.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DefProps.hxx; sourceTree = "<group>"; };
DC932D400F278A5200FEFEFC /* Serializable.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Serializable.hxx; sourceTree = "<group>"; };
DC932D410F278A5200FEFEFC /* SerialPort.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = SerialPort.hxx; sourceTree = "<group>"; };
@ -2044,6 +2048,8 @@
DC6A18FB19B3E67A00DEB242 /* CartMDM.hxx */,
DC71EA9B1FDA06D2008827CB /* CartMNetwork.cxx */,
DC71EA9C1FDA06D2008827CB /* CartMNetwork.hxx */,
DC911C7326333B9100666AC0 /* CartMVC.cxx */,
DC911C7426333B9100666AC0 /* CartMVC.hxx */,
DC0984830D3985160073C852 /* CartSB.cxx */,
DC0984840D3985160073C852 /* CartSB.hxx */,
DC84397A247B294D00C6A4FC /* CartTVBoy.cxx */,
@ -2922,6 +2928,7 @@
DC3EE8631E2C0E6D00905161 /* inffast.h in Headers */,
DC676A501729A0B000E4E73D /* CartE0Widget.hxx in Headers */,
DC676A521729A0B000E4E73D /* CartE7Widget.hxx in Headers */,
DC911C7626333B9200666AC0 /* CartMVC.hxx in Headers */,
DC676A541729A0B000E4E73D /* CartFA2Widget.hxx in Headers */,
DC676A561729A0B000E4E73D /* CartFEWidget.hxx in Headers */,
DC676A5A1729A0B000E4E73D /* CartSBWidget.hxx in Headers */,
@ -3394,6 +3401,7 @@
DCAACAFE188D631500A4D282 /* CartDFSC.cxx in Sources */,
DCAACB0E188D636F00A4D282 /* Cart4KSCWidget.cxx in Sources */,
DCB60AD02543100900A5C1D2 /* FBBackendSDL2.cxx in Sources */,
DC911C7526333B9200666AC0 /* CartMVC.cxx in Sources */,
DCAACB10188D636F00A4D282 /* CartBFSCWidget.cxx in Sources */,
DCC2FDF6255EB82500FA5E81 /* ToolTip.cxx in Sources */,
DCAACB12188D636F00A4D282 /* CartBFWidget.cxx in Sources */,