Skip to content

Commit fc435b9

Browse files
committed
Memory::config.saveRoms was not saved in snapshots
1 parent b890801 commit fc435b9

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

Emulator/Components/Memory/Memory.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,17 @@ Memory::operator << (SerChecker &worker)
318318
if (config.fastSize) {
319319
for (isize i = 0; i < config.fastSize; i++) worker << fast[i];
320320
}
321-
if (romAllocator.size) {
322-
for (isize i = 0; i < romAllocator.size; i++) worker << rom[i];
323-
}
324-
if (womAllocator.size) {
325-
for (isize i = 0; i < womAllocator.size; i++) worker << wom[i];
326-
}
327-
if (extAllocator.size) {
328-
for (isize i = 0; i < extAllocator.size; i++) worker << ext[i];
321+
if (config.saveRoms) {
322+
323+
if (romAllocator.size) {
324+
for (isize i = 0; i < romAllocator.size; i++) worker << rom[i];
325+
}
326+
if (womAllocator.size) {
327+
for (isize i = 0; i < womAllocator.size; i++) worker << wom[i];
328+
}
329+
if (extAllocator.size) {
330+
for (isize i = 0; i < extAllocator.size; i++) worker << ext[i];
331+
}
329332
}
330333
}
331334

Emulator/Components/Memory/Memory.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ class Memory final : public SubComponent, public Inspectable<MemInfo, MemStats>
280280
<< chipMask
281281

282282
<< config.extStart
283+
<< config.saveRoms
283284
<< config.slowRamDelay
284285
<< config.slowRamMirror
285286
<< config.bankMap

Emulator/Components/Ports/AudioPort.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,8 @@ AudioPort::handleBufferUnderflow()
435435
//
436436
// (1) The consumer runs slightly faster than the producer
437437
// (2) The producer is halted or not startet yet
438-
439-
// debug(AUDBUF_DEBUG, "UNDERFLOW (r: %ld w: %ld)\n", stream.r, stream.w);
440438

441-
// Reset the write pointer
439+
// Wipe out the buffer and reset the write pointer
442440
stream.clear(SamplePair{0,0});
443441
stream.alignWritePtr();
444442

@@ -466,8 +464,6 @@ AudioPort::handleBufferOverflow()
466464
// (1) The consumer runs slightly slower than the producer
467465
// (2) The consumer is halted or not startet yet
468466

469-
// debug(AUDBUF_DEBUG, "OVERFLOW (r: %ld w: %ld)\n", stream.r, stream.w);
470-
471467
// Reset the write pointer
472468
stream.alignWritePtr();
473469

@@ -507,13 +503,13 @@ AudioPort::copyMono(float *buffer, isize n)
507503
}
508504

509505
isize
510-
AudioPort::copyStereo(float *buffer1, float *buffer2, isize n)
506+
AudioPort::copyStereo(float *left, float *right, isize n)
511507
{
512508
// Inform the sample rate detector about the number of requested samples
513509
detector.feed(n);
514510

515511
// Copy sound samples
516-
auto cnt = stream.copyStereo(buffer1, buffer2, n);
512+
auto cnt = stream.copyStereo(left, right, n);
517513
stats.consumedSamples += cnt;
518514

519515
// Check for a buffer underflow

Emulator/Components/Ports/AudioPort.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class AudioPort final : public SubComponent {
123123
Sampler()
124124
};
125125

126-
// Output
126+
// Output buffer
127127
AudioStream stream;
128128

129129
// The audio filter pipeline

Emulator/Utilities/Animated.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ template <typename T> struct Animated {
2222
// Current value
2323
double current = 1.0;
2424

25-
// Maximum volume
25+
// Maximum value
2626
double maximum = 1.0;
2727

2828
// Fading direction and speed

0 commit comments

Comments
 (0)