Fixed integer overflow bug in the tape device
This commit is contained in:
parent
b9729d0dc2
commit
ec7445669c
|
@ -280,7 +280,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
public bool GetEarBit(long cpuCycle)
|
||||
{
|
||||
// decide how many cycles worth of data we are capturing
|
||||
int cycles = Convert.ToInt32(cpuCycle - _lastCycle);
|
||||
long cycles = cpuCycle - _lastCycle;
|
||||
|
||||
// check whether tape is actually playing
|
||||
if (_tapeIsPlaying == false)
|
||||
|
@ -314,6 +314,31 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|||
{
|
||||
// we have reached the end of the current block
|
||||
|
||||
// check for any commands
|
||||
var command = _dataBlocks[_currentDataBlockIndex].Command;
|
||||
var block = _dataBlocks[_currentDataBlockIndex];
|
||||
switch (command)
|
||||
{
|
||||
// Stop the tape command found - if this is the end of the tape RTZ
|
||||
// otherwise just STOP and move to the next block
|
||||
case TapeCommand.STOP_THE_TAPE:
|
||||
if (_currentDataBlockIndex >= _dataBlocks.Count())
|
||||
RTZ();
|
||||
else
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
break;
|
||||
case TapeCommand.STOP_THE_TAPE_48K:
|
||||
if (_currentDataBlockIndex >= _dataBlocks.Count())
|
||||
RTZ();
|
||||
else
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// skip any empty blocks
|
||||
while (_position >= _dataBlocks[_currentDataBlockIndex].DataPeriods.Count())
|
||||
{
|
||||
|
|
|
@ -13,20 +13,19 @@ At this moment this is still *very* experimental and needs a lot more work.
|
|||
* Keyboard input (implementing IInputPollable)
|
||||
* Kempston joystick (mapped to J1 currently)
|
||||
* Tape device that will load spectrum games in realtime (*.tzx and *.tap)
|
||||
* IStatable (although this is not currently working/implemented properly during tape load operations)
|
||||
* IStatable
|
||||
* ISettable core settings
|
||||
* IMemoryDomains (I think)
|
||||
|
||||
### Work in progress
|
||||
* Exact emulator timings
|
||||
* Floating memory bus emulation
|
||||
* Tape auto-loading routines (currently you have to manually start and stop the virtual tape device)
|
||||
|
||||
### Not working
|
||||
* IDebuggable
|
||||
* ZX Spectrum Plus3 emulation
|
||||
* Default keyboard keymappings (you have to configure yourself in the core controller settings)
|
||||
* Manual tape device control (at the moment the tape device detects when the spectrum goes into 'loadbytes' mode and auto-plays the tape. This is not ideal and manual control should be implemented so the user can start/stop manually, return to zero etc..)
|
||||
* Only standard spectrum tape blocks currently work. Any fancy SpeedLock encoded (and similar) blocks do not
|
||||
|
||||
### Known bugs
|
||||
* Audible 'popping' from the emulated buzzer after a load state operation
|
||||
|
|
Loading…
Reference in New Issue