Compare commits
2 Commits
b9de64d113
...
9d3204daba
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d3204daba | |||
| 144c588012 |
8
APU.cpp
8
APU.cpp
@@ -1,6 +1,6 @@
|
||||
#include "APU.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include "audio_viewer.h"
|
||||
//#include "audio_viewer.h"
|
||||
|
||||
namespace APU
|
||||
{
|
||||
@@ -98,11 +98,11 @@ namespace APU
|
||||
|
||||
void init()
|
||||
{
|
||||
SDL_AudioSpec audioSpec{SAMPLING_FREQ, AUDIO_U8, 1, 0, AUDIO_BUFFER_SIZE>>2, 0, 0, &audioCallback, NULL};
|
||||
SDL_AudioSpec audioSpec{SAMPLING_FREQ, AUDIO_U8, 1, 0, AUDIO_BUFFER_SIZE>>1, 0, 0, &audioCallback, NULL};
|
||||
sdlAudioDevice = SDL_OpenAudioDevice(NULL, 0, &audioSpec, NULL, 0);
|
||||
resume();
|
||||
//samples_time=SDL_GetTicks();
|
||||
audio_viewer::init();
|
||||
//audio_viewer::init();
|
||||
}
|
||||
|
||||
void reset()
|
||||
@@ -437,7 +437,7 @@ namespace APU
|
||||
uint8_t sample = (sampleCH1+sampleCH2+sampleCH3+sampleCH4)&0xff;
|
||||
|
||||
sound_buffer[(sound_pos++)&(AUDIO_BUFFER_SIZE-1)] = sample;
|
||||
audio_viewer::addsample(sample);
|
||||
//audio_viewer::addsample(sample);
|
||||
//if (ear) last_1 = sound_pos;
|
||||
}
|
||||
}
|
||||
|
||||
3
Makefile
3
Makefile
@@ -9,3 +9,6 @@ debug: compile
|
||||
|
||||
debug1: compile
|
||||
gdb -ex run gb
|
||||
|
||||
release:
|
||||
g++ -O3 *.cpp -lSDL2 -o gb
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "debug.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include <cstring>
|
||||
#include "sm83.h"
|
||||
#include "sm83dis.h"
|
||||
#include "mem.h"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "gbscreen.h"
|
||||
#include <cstring>
|
||||
#include "sm83.h"
|
||||
#include "mem.h"
|
||||
#include "audio_viewer.h"
|
||||
|
||||
4
main.cpp
4
main.cpp
@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
|
||||
if (argc < 2) { printf("ABORTING: No rom specified.\n"); exit(1); }
|
||||
|
||||
const uint32_t clock = 4194304;
|
||||
const uint32_t update_freq = clock / 10;
|
||||
const uint32_t update_freq = clock >> 3;
|
||||
|
||||
SDL_Init(SDL_INIT_EVERYTHING);
|
||||
|
||||
@@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (t_states>=update_freq)
|
||||
{
|
||||
while (SDL_GetTicks()<time+100) {}
|
||||
while (SDL_GetTicks()<(time+125)) {}
|
||||
t_states -= update_freq;
|
||||
time = SDL_GetTicks();
|
||||
//z80analyze::refresh();
|
||||
|
||||
Reference in New Issue
Block a user