2022-03-10 20:51:27 +00:00
|
|
|
// Commander X16 Emulator
|
|
|
|
// Copyright (c) 2020 Frank van den Hoef
|
|
|
|
// All rights reserved. License: 2-clause BSD
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
struct VERAChannel {
|
|
|
|
uint16_t freq;
|
|
|
|
uint8_t volume;
|
|
|
|
bool left, right;
|
|
|
|
uint8_t pw;
|
|
|
|
uint8_t waveform;
|
|
|
|
|
|
|
|
unsigned phase;
|
per-channel oscilloscope, part 5
SAA1099 (SAASound and MAME), Lynx, MMC5, N163, PC Engine, PC Speaker,
PET, QSound, WonderSwan, VERA, VIC-20, VRC6 and X1-010!
2022-05-01 07:40:03 +00:00
|
|
|
int lastOut;
|
2022-03-10 20:51:27 +00:00
|
|
|
uint8_t noiseval;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VERA_PSG {
|
2022-03-10 21:52:59 +00:00
|
|
|
unsigned int noiseState, noiseOut;
|
2022-03-10 20:51:27 +00:00
|
|
|
struct VERAChannel channels[16];
|
|
|
|
};
|
|
|
|
|
|
|
|
void psg_reset(struct VERA_PSG* psg);
|
|
|
|
void psg_writereg(struct VERA_PSG* psg, uint8_t reg, uint8_t val);
|
2022-03-10 21:52:59 +00:00
|
|
|
void psg_render(struct VERA_PSG* psg, int16_t *bufL, int16_t *bufR, unsigned num_samples);
|