fix basic compile errors (with vs)

This commit is contained in:
Ian Curtis 2016-03-22 11:34:32 +00:00
parent 09747bcd7c
commit 5b3eea25fb
2 changed files with 5 additions and 3 deletions

View file

@ -32,6 +32,7 @@
#include <cstdio> #include <cstdio>
#include <cmath> #include <cmath>
#include <algorithm>
#define RAM_SIZE 0x2000 // Z80 RAM #define RAM_SIZE 0x2000 // Z80 RAM
@ -456,13 +457,13 @@ void CDriveBoard::EmulateFrame(void)
{ {
// Assuming Z80 runs @ 4.0MHz and NMI triggers @ 60.0KHz // Assuming Z80 runs @ 4.0MHz and NMI triggers @ 60.0KHz
// TODO - find out if Z80 frequency is correct and exact frequency of NMI interrupts (just guesswork at the moment!) // TODO - find out if Z80 frequency is correct and exact frequency of NMI interrupts (just guesswork at the moment!)
int cycles = 4.0 * 1000000 / 60; int cycles = (int)(4.0 * 1000000 / 60);
int loopCycles = 10000; int loopCycles = 10000;
while (cycles > 0) while (cycles > 0)
{ {
if (m_allowInterrupts) if (m_allowInterrupts)
m_z80.TriggerNMI(); m_z80.TriggerNMI();
cycles -= m_z80.Run(min<int>(loopCycles, cycles)); cycles -= m_z80.Run(std::min<int>(loopCycles, cycles));
} }
} }

View file

@ -36,6 +36,7 @@
#endif #endif
#include <cmath> #include <cmath>
#include <algorithm>
// Model3 audio output is 44.1KHz 2-channel sound and frame rate is 60fps // Model3 audio output is 44.1KHz 2-channel sound and frame rate is 60fps
#define SAMPLE_RATE 44100 #define SAMPLE_RATE 44100
@ -256,7 +257,7 @@ bool OpenAudio()
// Create audio buffer // Create audio buffer
audioBufferSize = SAMPLE_RATE * BYTES_PER_SAMPLE * latency / MAX_LATENCY; audioBufferSize = SAMPLE_RATE * BYTES_PER_SAMPLE * latency / MAX_LATENCY;
int minBufferSize = 3 * BYTES_PER_FRAME; int minBufferSize = 3 * BYTES_PER_FRAME;
audioBufferSize = max<int>(minBufferSize, audioBufferSize); audioBufferSize = std::max<int>(minBufferSize, audioBufferSize);
audioBuffer = new(std::nothrow) INT8[audioBufferSize]; audioBuffer = new(std::nothrow) INT8[audioBufferSize];
if (audioBuffer == NULL) if (audioBuffer == NULL)
{ {