- Deixe el Abu Simbel ací per a anar fent proves de càrrega
- [NEW] Mòdul zx_tape, encara no carrega correctament les cintes. - [CHG] Gestió completa del só pasada a la ULA, i de la pantalla a zxscreen
This commit is contained in:
12
zx_ula.cpp
12
zx_ula.cpp
@@ -11,7 +11,7 @@ namespace zx_ula
|
||||
{
|
||||
const uint8_t *keys = SDL_GetKeyboardState(NULL);
|
||||
const uint8_t h_addr = (port>>8);
|
||||
uint8_t result = 0xff;
|
||||
uint8_t result = ear ? 0xbf : 0xff;
|
||||
if (!(h_addr & ~0xfe))
|
||||
{
|
||||
result &= ~(
|
||||
@@ -97,6 +97,7 @@ namespace zx_ula
|
||||
|
||||
uint8_t get_border_color() { return border_color; }
|
||||
uint8_t get_ear() { return ear; }
|
||||
void set_ear(const uint8_t val) { ear = val; }
|
||||
|
||||
|
||||
|
||||
@@ -104,6 +105,7 @@ namespace zx_ula
|
||||
SDL_AudioDeviceID sdlAudioDevice;
|
||||
uint8_t sound_buffer[1024];
|
||||
uint16_t sound_pos;
|
||||
uint16_t t_sound=0;
|
||||
|
||||
void audioCallback(void * userdata, uint8_t * stream, int len)
|
||||
{
|
||||
@@ -128,8 +130,12 @@ namespace zx_ula
|
||||
SDL_PauseAudioDevice(sdlAudioDevice, 1);
|
||||
}
|
||||
|
||||
void sound_update()
|
||||
void sound_update(const uint8_t dt)
|
||||
{
|
||||
sound_buffer[sound_pos++] = ear*128;
|
||||
t_sound += dt;
|
||||
if (t_sound>=400) {
|
||||
t_sound-=400;
|
||||
sound_buffer[sound_pos++] = ear*128;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user