Compare commits

...

2 Commits

Author SHA1 Message Date
9d3204daba - Coses 2025-01-30 10:04:23 +01:00
144c588012 - [FIX] Inclos <cstring> on fa falta, ja que sdl2-compat ja no l'inclou 2025-01-30 08:48:46 +01:00
6 changed files with 12 additions and 6 deletions

View File

@@ -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;
}
}

View File

@@ -9,3 +9,6 @@ debug: compile
debug1: compile
gdb -ex run gb
release:
g++ -O3 *.cpp -lSDL2 -o gb

View File

@@ -1,5 +1,6 @@
#include "debug.h"
#include <SDL2/SDL.h>
#include <cstring>
#include "sm83.h"
#include "sm83dis.h"
#include "mem.h"

View File

@@ -1,4 +1,5 @@
#include "gbscreen.h"
#include <cstring>
#include "sm83.h"
#include "mem.h"
#include "audio_viewer.h"

View File

@@ -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();

1
ui.cpp
View File

@@ -1,5 +1,6 @@
#include "ui.h"
#include <SDL2/SDL.h>
#include <cstring>
namespace ui
{