mirror of
https://github.com/holub/mame
synced 2025-05-03 13:06:47 +03:00
Preliminary emulation of the YMZ770 sound chip [R. Belmont, O. Galibert]
(not-for-whatsnew section) Note: extremely preliminary. No music, just sfx. No per-voice volume/panning. No attempts to optimize. Lots of hardcoding for how the CV1000 uses the chip. I will fix all of these later, but I gotta get to sleep now ;-)
This commit is contained in:
parent
31229c316f
commit
509f2c1be5
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1266,6 +1266,8 @@ src/emu/sound/ymf278b.c svneol=native#text/plain
|
||||
src/emu/sound/ymf278b.h svneol=native#text/plain
|
||||
src/emu/sound/ymz280b.c svneol=native#text/plain
|
||||
src/emu/sound/ymz280b.h svneol=native#text/plain
|
||||
src/emu/sound/ymz770.c svneol=native#text/plain
|
||||
src/emu/sound/ymz770.h svneol=native#text/plain
|
||||
src/emu/sound/zsg2.c svneol=native#text/plain
|
||||
src/emu/sound/zsg2.h svneol=native#text/plain
|
||||
src/emu/speaker.c svneol=native#text/plain
|
||||
|
@ -710,6 +710,14 @@ ifneq ($(filter YMZ280B,$(SOUNDS)),)
|
||||
SOUNDOBJS += $(SOUNDOBJ)/ymz280b.o
|
||||
endif
|
||||
|
||||
#-------------------------------------------------
|
||||
# Yamaha YMZ770 AMM
|
||||
#-------------------------------------------------
|
||||
|
||||
ifneq ($(filter YMZ770,$(SOUNDS)),)
|
||||
SOUNDOBJS += $(SOUNDOBJ)/ymz770.o
|
||||
endif
|
||||
|
||||
#-------------------------------------------------
|
||||
# ZOOM ZSG-2
|
||||
#-------------------------------------------------
|
||||
|
869
src/emu/sound/ymz770.c
Normal file
869
src/emu/sound/ymz770.c
Normal file
@ -0,0 +1,869 @@
|
||||
/***************************************************************************
|
||||
|
||||
ymz770.c
|
||||
|
||||
Emulation by R. Belmont
|
||||
AMM decode by Olivier Galibert
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "ymz770.h"
|
||||
|
||||
// device type definition
|
||||
const device_type YMZ770 = &device_creator<ymz770_device>;
|
||||
|
||||
//**************************************************************************
|
||||
// Yamaha "AMM" decoder
|
||||
//**************************************************************************
|
||||
|
||||
class amm {
|
||||
public:
|
||||
amm();
|
||||
|
||||
void init();
|
||||
bool run();
|
||||
|
||||
void set_pointers(UINT8 *ptr, UINT8 *outptr) { data = ptr; result = outptr; size = rsize = 0; }
|
||||
int get_rsize() { return rsize; }
|
||||
|
||||
private:
|
||||
struct band_parameter_size {
|
||||
int band_count;
|
||||
int s1, s2, s3, s4, s5;
|
||||
};
|
||||
|
||||
struct band_info {
|
||||
int modulo;
|
||||
double s1;
|
||||
int bits, cube_bits;
|
||||
int s4, s5;
|
||||
double range, s7, scale, offset;
|
||||
};
|
||||
|
||||
double amplitude_table[64];
|
||||
|
||||
static const int sample_rates[8];
|
||||
static const int band_parameter_indexed_values[5][32][17];
|
||||
static const int band_parameter_index_bits_count[5][32];
|
||||
static const band_parameter_size band_parameter_sizes[5];
|
||||
static const int init_band_counts[4];
|
||||
static const band_info band_infos[18];
|
||||
static const double synthesis_filter[512];
|
||||
|
||||
int sampling_rate, last_frame_number;
|
||||
int param_index, forced_param_index;
|
||||
|
||||
int channel_count, total_bands, init_bands;
|
||||
|
||||
int band_param[2][32];
|
||||
int scfsi[2][32];
|
||||
int scalefactors[2][3][32];
|
||||
double amp_values[2][3][32];
|
||||
double bdata[2][3][32];
|
||||
double subbuffer[2][32];
|
||||
double audio_buffer[2][32*32];
|
||||
int audio_buffer_pos[2];
|
||||
|
||||
int master_pos;
|
||||
|
||||
void read_header(int &pos);
|
||||
int get_band_param(int &pos, int band);
|
||||
void read_band_params(int &pos);
|
||||
void read_scfci(int &pos);
|
||||
void read_band_amplitude_params(int &pos);
|
||||
void read_band_value_triplet(int &pos, int chan, int band);
|
||||
void build_amplitudes();
|
||||
void build_next_segments(int &pos, int step);
|
||||
void retrieve_subbuffer(int step);
|
||||
void handle_block(int &pos);
|
||||
void idct32(const double *input, double *output);
|
||||
void resynthesis(const double *input, double *output);
|
||||
void scale_and_clamp(const double *input, int offset, int step);
|
||||
|
||||
UINT8 *data;
|
||||
int size;
|
||||
|
||||
UINT8 *result;
|
||||
int rsize;
|
||||
|
||||
int gb(int &pos, int count)
|
||||
{
|
||||
int v = 0;
|
||||
for(int i=0; i != count; i++) {
|
||||
v <<= 1;
|
||||
if(data[pos >> 3] & (0x80 >> (pos & 7)))
|
||||
v |= 1;
|
||||
pos++;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
void w16(int offset, unsigned short value)
|
||||
{
|
||||
if (offset > (0x8fe*2))
|
||||
{
|
||||
fatalerror("AMM block decoded to %x bytes, buffer overflow!\n", offset);
|
||||
}
|
||||
|
||||
*(unsigned short *)(result+offset) = value;
|
||||
}
|
||||
};
|
||||
|
||||
void amm::read_header(int &pos)
|
||||
{
|
||||
int full_rate = gb(pos, 1);
|
||||
gb(pos, 2); // must be 2
|
||||
gb(pos, 1); // unused
|
||||
int full_packets_count = gb(pos, 4); // max 12
|
||||
int srate_index = gb(pos, 2); // max 2
|
||||
sampling_rate = srate_index + 4 * (1 - full_rate);
|
||||
int last_packet_frame_id = gb(pos, 2); // max 2
|
||||
last_frame_number = 3*full_packets_count + last_packet_frame_id;
|
||||
int frame_type = gb(pos, 2);
|
||||
int init_band_count_index = gb(pos, 2);
|
||||
int normal_param_index = gb(pos, 3);
|
||||
gb(pos, 1); // must be zero
|
||||
param_index = forced_param_index >= 5 ? normal_param_index : forced_param_index; // max 4
|
||||
channel_count = frame_type != 3 ? 2 : 1;
|
||||
total_bands = band_parameter_sizes[param_index].band_count;
|
||||
init_bands = total_bands;
|
||||
if(frame_type == 1)
|
||||
init_bands = init_band_counts[init_band_count_index];
|
||||
if(init_bands > total_bands )
|
||||
init_bands = total_bands;
|
||||
}
|
||||
|
||||
const int amm::sample_rates[8] = { 44100, 48000, 32000, 0, 22050, 24000, 16000, 0 };
|
||||
|
||||
const int amm::band_parameter_indexed_values[5][32][17] = {
|
||||
{
|
||||
{ 0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, },
|
||||
{ 0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, },
|
||||
{ 0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
},
|
||||
{
|
||||
{ 0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, },
|
||||
{ 0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, },
|
||||
{ 0, 1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 17, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
},
|
||||
{
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
},
|
||||
{
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
},
|
||||
{
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, 1, 2, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, },
|
||||
}
|
||||
};
|
||||
|
||||
const int amm::band_parameter_index_bits_count[5][32] = {
|
||||
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 0, 0, 0, 0, 0, },
|
||||
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 0, 0, },
|
||||
{ 4, 4, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
||||
{ 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
||||
{ 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, },
|
||||
};
|
||||
|
||||
const amm::band_parameter_size amm::band_parameter_sizes[5] = {
|
||||
{ 27, 88, 104, 120, 135, 147 },
|
||||
{ 30, 94, 110, 126, 141, 153 },
|
||||
{ 8, 26, 40, 52, 52, 52 },
|
||||
{ 12, 38, 52, 64, 76, 76 },
|
||||
{ 30, 75, 91, 103, 114, 122 },
|
||||
};
|
||||
|
||||
const int amm::init_band_counts[4] = { 4, 8, 12, 16 };
|
||||
|
||||
const amm::band_info amm::band_infos[18] = {
|
||||
{ 0x0000, 0.00, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0x0003, 7.00, 2, 5, 3, 9, 1-1.0/ 4, -1.0/ 4, 1/(1-1.0/ 4), 1.0/ 2 },
|
||||
{ 0x0005, 11.00, 3, 7, 5, 25, 1-3.0/ 8, -3.0/ 8, 1/(1-3.0/ 8), 1.0/ 2 },
|
||||
{ 0x0007, 16.00, 3, 9, 0, 0, 1-1.0/ 8, -1.0/ 8, 1/(1-1.0/ 8), 1.0/ 4 },
|
||||
{ 0x0009, 20.84, 4, 10, 9, 81, 1-7.0/ 16, -7.0/ 16, 1/(1-7.0/ 16), 1.0/ 2 },
|
||||
{ 0x000f, 25.28, 4, 12, 0, 0, 1-1.0/ 16, -1.0/ 16, 1/(1-1.0/ 16), 1.0/ 8 },
|
||||
{ 0x001f, 31.59, 5, 15, 0, 0, 1-1.0/ 32, -1.0/ 32, 1/(1-1.0/ 32), 1.0/ 16 },
|
||||
{ 0x003f, 37.75, 6, 18, 0, 0, 1-1.0/ 64, -1.0/ 64, 1/(1-1.0/ 64), 1.0/ 32 },
|
||||
{ 0x007f, 43.84, 7, 21, 0, 0, 1-1.0/ 128, -1.0/ 128, 1/(1-1.0/ 128), 1.0/ 64 },
|
||||
{ 0x00ff, 49.89, 8, 24, 0, 0, 1-1.0/ 256, -1.0/ 256, 1/(1-1.0/ 256), 1.0/ 128 },
|
||||
{ 0x01ff, 55.93, 9, 27, 0, 0, 1-1.0/ 512, -1.0/ 512, 1/(1-1.0/ 512), 1.0/ 256 },
|
||||
{ 0x03ff, 61.96, 10, 30, 0, 0, 1-1.0/ 1024, -1.0/ 1024, 1/(1-1.0/ 1024), 1.0/ 512 },
|
||||
{ 0x07ff, 67.98, 11, 33, 0, 0, 1-1.0/ 2048, -1.0/ 2048, 1/(1-1.0/ 2048), 1.0/ 1024 },
|
||||
{ 0x0fff, 74.01, 12, 36, 0, 0, 1-1.0/ 4096, -1.0/ 4096, 1/(1-1.0/ 4096), 1.0/ 2048 },
|
||||
{ 0x1fff, 80.03, 13, 39, 0, 0, 1-1.0/ 8192, -1.0/ 8192, 1/(1-1.0/ 8192), 1.0/ 4096 },
|
||||
{ 0x3fff, 86.05, 14, 42, 0, 0, 1-1.0/16384, -1.0/16384, 1/(1-1.0/16384), 1.0/ 8192 },
|
||||
{ 0x7fff, 92.01, 15, 45, 0, 0, 1-1.0/32768, -1.0/32768, 1/(1-1.0/32768), 1.0/16384 },
|
||||
{ 0xffff, 98.01, 16, 48, 0, 0, 1-1.0/65536, -1.0/65536, 1/(1-1.0/65536), 1.0/32768 },
|
||||
};
|
||||
|
||||
const double amm::synthesis_filter[512] = {
|
||||
+0.000000000, -0.000015259, -0.000015259, -0.000015259, -0.000015259, -0.000015259, -0.000015259, -0.000030518,
|
||||
-0.000030518, -0.000030518, -0.000030518, -0.000045776, -0.000045776, -0.000061035, -0.000061035, -0.000076294,
|
||||
-0.000076294, -0.000091553, -0.000106812, -0.000106812, -0.000122070, -0.000137329, -0.000152588, -0.000167847,
|
||||
-0.000198364, -0.000213623, -0.000244141, -0.000259399, -0.000289917, -0.000320435, -0.000366211, -0.000396729,
|
||||
-0.000442505, -0.000473022, -0.000534058, -0.000579834, -0.000625610, -0.000686646, -0.000747681, -0.000808716,
|
||||
-0.000885010, -0.000961304, -0.001037598, -0.001113892, -0.001205444, -0.001296997, -0.001388550, -0.001480103,
|
||||
-0.001586914, -0.001693726, -0.001785278, -0.001907349, -0.002014160, -0.002120972, -0.002243042, -0.002349854,
|
||||
-0.002456665, -0.002578735, -0.002685547, -0.002792358, -0.002899170, -0.002990723, -0.003082275, -0.003173828,
|
||||
+0.003250122, +0.003326416, +0.003387451, +0.003433228, +0.003463745, +0.003479004, +0.003479004, +0.003463745,
|
||||
+0.003417969, +0.003372192, +0.003280640, +0.003173828, +0.003051758, +0.002883911, +0.002700806, +0.002487183,
|
||||
+0.002227783, +0.001937866, +0.001617432, +0.001266479, +0.000869751, +0.000442505, -0.000030518, -0.000549316,
|
||||
-0.001098633, -0.001693726, -0.002334595, -0.003005981, -0.003723145, -0.004486084, -0.005294800, -0.006118774,
|
||||
-0.007003784, -0.007919312, -0.008865356, -0.009841919, -0.010848999, -0.011886597, -0.012939453, -0.014022827,
|
||||
-0.015121460, -0.016235352, -0.017349243, -0.018463135, -0.019577026, -0.020690918, -0.021789550, -0.022857666,
|
||||
-0.023910522, -0.024932861, -0.025909424, -0.026840210, -0.027725220, -0.028533936, -0.029281616, -0.029937744,
|
||||
-0.030532837, -0.031005860, -0.031387330, -0.031661987, -0.031814575, -0.031845093, -0.031738280, -0.031478880,
|
||||
+0.031082153, +0.030517578, +0.029785156, +0.028884888, +0.027801514, +0.026535034, +0.025085450, +0.023422241,
|
||||
+0.021575928, +0.019531250, +0.017257690, +0.014801025, +0.012115479, +0.009231567, +0.006134033, +0.002822876,
|
||||
-0.000686646, -0.004394531, -0.008316040, -0.012420654, -0.016708374, -0.021179200, -0.025817871, -0.030609130,
|
||||
-0.035552980, -0.040634155, -0.045837402, -0.051132202, -0.056533813, -0.061996460, -0.067520140, -0.073059080,
|
||||
-0.078628540, -0.084182740, -0.089706420, -0.095169070, -0.100540160, -0.105819700, -0.110946655, -0.115921020,
|
||||
-0.120697020, -0.125259400, -0.129562380, -0.133590700, -0.137298580, -0.140670780, -0.143676760, -0.146255500,
|
||||
-0.148422240, -0.150115970, -0.151306150, -0.151962280, -0.152069090, -0.151596070, -0.150497440, -0.148773200,
|
||||
-0.146362300, -0.143264770, -0.139450070, -0.134887700, -0.129577640, -0.123474120, -0.116577150, -0.108856200,
|
||||
+0.100311280, +0.090927124, +0.080688480, +0.069595340, +0.057617188, +0.044784546, +0.031082153, +0.016510010,
|
||||
+0.001068115, -0.015228271, -0.032379150, -0.050354004, -0.069168090, -0.088775635, -0.109161380, -0.130310060,
|
||||
-0.152206420, -0.174789430, -0.198059080, -0.221984860, -0.246505740, -0.271591200, -0.297210700, -0.323318480,
|
||||
-0.349868770, -0.376800540, -0.404083250, -0.431655880, -0.459472660, -0.487472530, -0.515609740, -0.543823240,
|
||||
-0.572036740, -0.600219700, -0.628295900, -0.656219500, -0.683914200, -0.711318970, -0.738372800, -0.765029900,
|
||||
-0.791214000, -0.816864000, -0.841949460, -0.866363500, -0.890090940, -0.913055400, -0.935195900, -0.956481930,
|
||||
-0.976852400, -0.996246340, -1.014617900, -1.031936600, -1.048156700, -1.063217200, -1.077117900, -1.089782700,
|
||||
-1.101211500, -1.111373900, -1.120224000, -1.127746600, -1.133926400, -1.138763400, -1.142211900, -1.144287100,
|
||||
+1.144989000, +1.144287100, +1.142211900, +1.138763400, +1.133926400, +1.127746600, +1.120224000, +1.111373900,
|
||||
+1.101211500, +1.089782700, +1.077117900, +1.063217200, +1.048156700, +1.031936600, +1.014617900, +0.996246340,
|
||||
+0.976852400, +0.956481930, +0.935195900, +0.913055400, +0.890090940, +0.866363500, +0.841949460, +0.816864000,
|
||||
+0.791214000, +0.765029900, +0.738372800, +0.711318970, +0.683914200, +0.656219500, +0.628295900, +0.600219700,
|
||||
+0.572036740, +0.543823240, +0.515609740, +0.487472530, +0.459472660, +0.431655880, +0.404083250, +0.376800540,
|
||||
+0.349868770, +0.323318480, +0.297210700, +0.271591200, +0.246505740, +0.221984860, +0.198059080, +0.174789430,
|
||||
+0.152206420, +0.130310060, +0.109161380, +0.088775635, +0.069168090, +0.050354004, +0.032379150, +0.015228271,
|
||||
-0.001068115, -0.016510010, -0.031082153, -0.044784546, -0.057617188, -0.069595340, -0.080688480, -0.090927124,
|
||||
+0.100311280, +0.108856200, +0.116577150, +0.123474120, +0.129577640, +0.134887700, +0.139450070, +0.143264770,
|
||||
+0.146362300, +0.148773200, +0.150497440, +0.151596070, +0.152069090, +0.151962280, +0.151306150, +0.150115970,
|
||||
+0.148422240, +0.146255500, +0.143676760, +0.140670780, +0.137298580, +0.133590700, +0.129562380, +0.125259400,
|
||||
+0.120697020, +0.115921020, +0.110946655, +0.105819700, +0.100540160, +0.095169070, +0.089706420, +0.084182740,
|
||||
+0.078628540, +0.073059080, +0.067520140, +0.061996460, +0.056533813, +0.051132202, +0.045837402, +0.040634155,
|
||||
+0.035552980, +0.030609130, +0.025817871, +0.021179200, +0.016708374, +0.012420654, +0.008316040, +0.004394531,
|
||||
+0.000686646, -0.002822876, -0.006134033, -0.009231567, -0.012115479, -0.014801025, -0.017257690, -0.019531250,
|
||||
-0.021575928, -0.023422241, -0.025085450, -0.026535034, -0.027801514, -0.028884888, -0.029785156, -0.030517578,
|
||||
+0.031082153, +0.031478880, +0.031738280, +0.031845093, +0.031814575, +0.031661987, +0.031387330, +0.031005860,
|
||||
+0.030532837, +0.029937744, +0.029281616, +0.028533936, +0.027725220, +0.026840210, +0.025909424, +0.024932861,
|
||||
+0.023910522, +0.022857666, +0.021789550, +0.020690918, +0.019577026, +0.018463135, +0.017349243, +0.016235352,
|
||||
+0.015121460, +0.014022827, +0.012939453, +0.011886597, +0.010848999, +0.009841919, +0.008865356, +0.007919312,
|
||||
+0.007003784, +0.006118774, +0.005294800, +0.004486084, +0.003723145, +0.003005981, +0.002334595, +0.001693726,
|
||||
+0.001098633, +0.000549316, +0.000030518, -0.000442505, -0.000869751, -0.001266479, -0.001617432, -0.001937866,
|
||||
-0.002227783, -0.002487183, -0.002700806, -0.002883911, -0.003051758, -0.003173828, -0.003280640, -0.003372192,
|
||||
-0.003417969, -0.003463745, -0.003479004, -0.003479004, -0.003463745, -0.003433228, -0.003387451, -0.003326416,
|
||||
+0.003250122, +0.003173828, +0.003082275, +0.002990723, +0.002899170, +0.002792358, +0.002685547, +0.002578735,
|
||||
+0.002456665, +0.002349854, +0.002243042, +0.002120972, +0.002014160, +0.001907349, +0.001785278, +0.001693726,
|
||||
+0.001586914, +0.001480103, +0.001388550, +0.001296997, +0.001205444, +0.001113892, +0.001037598, +0.000961304,
|
||||
+0.000885010, +0.000808716, +0.000747681, +0.000686646, +0.000625610, +0.000579834, +0.000534058, +0.000473022,
|
||||
+0.000442505, +0.000396729, +0.000366211, +0.000320435, +0.000289917, +0.000259399, +0.000244141, +0.000213623,
|
||||
+0.000198364, +0.000167847, +0.000152588, +0.000137329, +0.000122070, +0.000106812, +0.000106812, +0.000091553,
|
||||
+0.000076294, +0.000076294, +0.000061035, +0.000061035, +0.000045776, +0.000045776, +0.000030518, +0.000030518,
|
||||
+0.000030518, +0.000030518, +0.000015259, +0.000015259, +0.000015259, +0.000015259, +0.000015259, +0.000015259,
|
||||
};
|
||||
|
||||
int amm::get_band_param(int &pos, int band)
|
||||
{
|
||||
int bit_count = band_parameter_index_bits_count[param_index][band];
|
||||
int index = gb(pos, bit_count);
|
||||
return band_parameter_indexed_values[param_index][band][index];
|
||||
}
|
||||
|
||||
void amm::read_band_params(int &pos)
|
||||
{
|
||||
int band = 0;
|
||||
|
||||
while(band < init_bands) {
|
||||
for(int chan=0; chan < channel_count; chan++)
|
||||
band_param[chan][band] = get_band_param(pos, band);
|
||||
band++;
|
||||
}
|
||||
|
||||
while(band < total_bands) {
|
||||
int val = get_band_param(pos, band);
|
||||
band_param[0][band] = val;
|
||||
band_param[1][band] = val;
|
||||
band++;
|
||||
}
|
||||
|
||||
while(band < 32) {
|
||||
band_param[0][band] = 0;
|
||||
band_param[1][band] = 0;
|
||||
band++;
|
||||
}
|
||||
}
|
||||
|
||||
void amm::read_scfci(int &pos)
|
||||
{
|
||||
memset(scfsi, 0, sizeof(scfsi));
|
||||
for(int band=0; band < total_bands; band++)
|
||||
for(int chan=0; chan < channel_count; chan++)
|
||||
if(band_param[chan][band])
|
||||
scfsi[chan][band] = gb(pos, 2);
|
||||
}
|
||||
|
||||
void amm::read_band_amplitude_params(int &pos)
|
||||
{
|
||||
memset(scalefactors, 0, sizeof(scalefactors));
|
||||
for(int band=0; band < total_bands; band++)
|
||||
for(int chan=0; chan<channel_count; chan++)
|
||||
if(band_param[chan][band]) {
|
||||
switch(scfsi[chan][band]) {
|
||||
case 0:
|
||||
scalefactors[chan][0][band] = gb(pos, 6);
|
||||
scalefactors[chan][1][band] = gb(pos, 6);
|
||||
scalefactors[chan][2][band] = gb(pos, 6);
|
||||
break;
|
||||
|
||||
case 1: {
|
||||
int val = gb(pos, 6);
|
||||
scalefactors[chan][0][band] = val;
|
||||
scalefactors[chan][1][band] = val;
|
||||
scalefactors[chan][2][band] = gb(pos, 6);
|
||||
break;
|
||||
}
|
||||
|
||||
case 2: {
|
||||
int val = gb(pos, 6);
|
||||
scalefactors[chan][0][band] = val;
|
||||
scalefactors[chan][1][band] = val;
|
||||
scalefactors[chan][2][band] = val;
|
||||
break;
|
||||
}
|
||||
|
||||
case 3: {
|
||||
scalefactors[chan][0][band] = gb(pos, 6);
|
||||
int val = gb(pos, 6);
|
||||
scalefactors[chan][1][band] = val;
|
||||
scalefactors[chan][2][band] = val;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void amm::build_amplitudes()
|
||||
{
|
||||
memset(amp_values, 0, sizeof(amp_values));
|
||||
|
||||
for(int band=0; band < total_bands; band++)
|
||||
for(int chan=0; chan<channel_count; chan++)
|
||||
if(band_param[chan][band])
|
||||
for(int step=0; step<3; step++)
|
||||
amp_values[chan][step][band] = amplitude_table[scalefactors[chan][step][band]];
|
||||
}
|
||||
|
||||
void amm::read_band_value_triplet(int &pos, int chan, int band)
|
||||
{
|
||||
double buffer[3];
|
||||
|
||||
int band_idx = band_param[chan][band];
|
||||
switch(band_idx) {
|
||||
case 0:
|
||||
bdata[chan][0][band] = 0;
|
||||
bdata[chan][1][band] = 0;
|
||||
bdata[chan][2][band] = 0;
|
||||
return;
|
||||
|
||||
case 1:
|
||||
case 2:
|
||||
case 4: {
|
||||
int modulo = band_infos[band_idx].modulo;
|
||||
int val = gb(pos, band_infos[band_idx].cube_bits);
|
||||
buffer[0] = val % modulo;
|
||||
val = val / modulo;
|
||||
buffer[1] = val % modulo;
|
||||
val = val / modulo;
|
||||
buffer[2] = val % modulo;
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
int bits = band_infos[band_idx].bits;
|
||||
buffer[0] = gb(pos, bits);
|
||||
buffer[1] = gb(pos, bits);
|
||||
buffer[2] = gb(pos, bits);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
double scale = 1 << (band_infos[band_idx].bits - 1);
|
||||
|
||||
bdata[chan][0][band] = ((buffer[0] - scale) / scale + band_infos[band_idx].offset) * band_infos[band_idx].scale;
|
||||
bdata[chan][1][band] = ((buffer[1] - scale) / scale + band_infos[band_idx].offset) * band_infos[band_idx].scale;
|
||||
bdata[chan][2][band] = ((buffer[2] - scale) / scale + band_infos[band_idx].offset) * band_infos[band_idx].scale;
|
||||
}
|
||||
|
||||
void amm::build_next_segments(int &pos, int step)
|
||||
{
|
||||
int band = 0;
|
||||
while(band < init_bands) {
|
||||
for(int chan=0; chan<channel_count; chan++) {
|
||||
read_band_value_triplet(pos, chan, band);
|
||||
double amp = amp_values[chan][step][band];
|
||||
bdata[chan][0][band] *= amp;
|
||||
bdata[chan][1][band] *= amp;
|
||||
bdata[chan][2][band] *= amp;
|
||||
}
|
||||
band++;
|
||||
}
|
||||
|
||||
while(band < init_bands) {
|
||||
read_band_value_triplet(pos, 0, band);
|
||||
bdata[1][0][band] = bdata[0][0][band];
|
||||
bdata[1][1][band] = bdata[0][1][band];
|
||||
bdata[1][2][band] = bdata[0][2][band];
|
||||
|
||||
for(int chan=0; chan<channel_count; chan++) {
|
||||
double amp = amp_values[chan][step][band];
|
||||
bdata[chan][0][band] *= amp;
|
||||
bdata[chan][1][band] *= amp;
|
||||
bdata[chan][2][band] *= amp;
|
||||
}
|
||||
band++;
|
||||
}
|
||||
|
||||
while(band < 32) {
|
||||
bdata[0][0][band] = 0;
|
||||
bdata[0][1][band] = 0;
|
||||
bdata[0][2][band] = 0;
|
||||
bdata[1][0][band] = 0;
|
||||
bdata[1][1][band] = 0;
|
||||
bdata[1][2][band] = 0;
|
||||
band++;
|
||||
}
|
||||
}
|
||||
|
||||
void amm::retrieve_subbuffer(int step)
|
||||
{
|
||||
for(int chan=0; chan<channel_count; chan++)
|
||||
memcpy(subbuffer[chan], bdata[chan][step], 32*sizeof(subbuffer[0][0]));
|
||||
}
|
||||
|
||||
void amm::idct32(const double *input, double *output)
|
||||
{
|
||||
// Simplest idct32 ever, non-fast at all
|
||||
for(int i=0; i<32; i++) {
|
||||
double s = 0;
|
||||
for(int j=0; j<32; j++)
|
||||
s += input[j] * cos(i*(2*j+1)*M_PI/64);
|
||||
output[i] = s;
|
||||
}
|
||||
}
|
||||
|
||||
void amm::resynthesis(const double *input, double *output)
|
||||
{
|
||||
memset(output, 0, 32*sizeof(output[0]));
|
||||
for(int j=0; j<64*8; j+=64) {
|
||||
for(int i=0; i<16; i++) {
|
||||
output[ i] += input[ i+j]*synthesis_filter[ i+j] - input[32-i+j]*synthesis_filter[32+i+j];
|
||||
output[17+i] -= input[15-i+j]*synthesis_filter[17+i+j] + input[17+i+j]*synthesis_filter[49+i+j];
|
||||
}
|
||||
output[16] -= input[16+j]*synthesis_filter[32+16+j];
|
||||
}
|
||||
}
|
||||
|
||||
void amm::scale_and_clamp(const double *input, int offset, int step)
|
||||
{
|
||||
for(int i=0; i<32; i++) {
|
||||
double val = input[i]*32768 + 0.5;
|
||||
short cval;
|
||||
if(val <= -32768)
|
||||
cval = -32768;
|
||||
else if(val >= 32767)
|
||||
cval = 32767;
|
||||
else
|
||||
cval = int(val);
|
||||
w16(offset, cval);
|
||||
offset += step;
|
||||
}
|
||||
}
|
||||
|
||||
amm::amm()
|
||||
{
|
||||
forced_param_index = 5;
|
||||
|
||||
for(int i=0; i<63; i++)
|
||||
amplitude_table[i] = pow(2, (3-i)/3.0);
|
||||
amplitude_table[63] = 1e-20;
|
||||
|
||||
memset(audio_buffer, 0, sizeof(audio_buffer));
|
||||
audio_buffer_pos[0] = 16*32;
|
||||
audio_buffer_pos[1] = 16*32;
|
||||
}
|
||||
|
||||
void amm::handle_block(int &pos)
|
||||
{
|
||||
gb(pos, 12); // Must be 0xfff
|
||||
// printf("sync: %03x\n", h);
|
||||
read_header(pos);
|
||||
// printf("sample rate: %d\n", sample_rates[sampling_rate]);
|
||||
read_band_params(pos);
|
||||
read_scfci(pos);
|
||||
read_band_amplitude_params(pos);
|
||||
build_amplitudes();
|
||||
|
||||
// Supposed to stop at last_frame_number when it's not 12*3+2 = 38
|
||||
for(int upper_step = 0; upper_step<3; upper_step++)
|
||||
for(int middle_step = 0; middle_step < 4; middle_step++) {
|
||||
build_next_segments(pos, upper_step);
|
||||
for(int lower_step = 0; lower_step < 3; lower_step++) {
|
||||
retrieve_subbuffer(lower_step);
|
||||
|
||||
int base_offset = rsize;
|
||||
for(int chan=0; chan<channel_count; chan++) {
|
||||
double resynthesis_buffer[32];
|
||||
idct32(subbuffer[chan], audio_buffer[chan] + audio_buffer_pos[chan]);
|
||||
resynthesis(audio_buffer[chan] + audio_buffer_pos[chan] + 16, resynthesis_buffer);
|
||||
scale_and_clamp(resynthesis_buffer, base_offset+2*chan, 2*channel_count);
|
||||
audio_buffer_pos[chan] -= 32;
|
||||
if(audio_buffer_pos[chan]<0) {
|
||||
memmove(audio_buffer[chan]+17*32, audio_buffer[chan], 15*32*sizeof(audio_buffer[chan][0]));
|
||||
audio_buffer_pos[chan] = 16*32;
|
||||
}
|
||||
}
|
||||
rsize += 32*2*channel_count;
|
||||
}
|
||||
}
|
||||
pos = (pos+7) & ~7;
|
||||
}
|
||||
|
||||
void amm::init()
|
||||
{
|
||||
master_pos = 0;
|
||||
}
|
||||
|
||||
// returns true if this is the last block
|
||||
bool amm::run()
|
||||
{
|
||||
rsize = 0;
|
||||
handle_block(master_pos);
|
||||
|
||||
// "last_frame_number" for the current chunk is 36 means there are more segments, otherwise not
|
||||
if (last_frame_number == 36)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// ymz770_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
ymz770_device::ymz770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, YMZ770, "Yamaha YMZ770", tag, owner, clock),
|
||||
device_sound_interface(mconfig, *this)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
void ymz770_device::device_start()
|
||||
{
|
||||
// create the stream
|
||||
m_stream = machine().sound().stream_alloc(*this, 0, 2, 16000, this);
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
channels[i].is_playing = false;
|
||||
channels[i].decoder = new amm;
|
||||
}
|
||||
|
||||
rom_base = device().machine().region(":ymz770")->base();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void ymz770_device::device_reset()
|
||||
{
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
channels[i].phrase = 0;
|
||||
channels[i].pan = 8;
|
||||
channels[i].volume = 0;
|
||||
channels[i].control = 0;
|
||||
channels[i].is_playing = false;
|
||||
channels[i].decoder = new amm;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// sound_stream_update - handle update requests for
|
||||
// our sound stream
|
||||
//-------------------------------------------------
|
||||
|
||||
void ymz770_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
|
||||
{
|
||||
stream_sample_t *outL, *outR;
|
||||
int i, ch;
|
||||
|
||||
outL = outputs[0];
|
||||
outR = outputs[1];
|
||||
|
||||
for (i = 0; i < samples; i++)
|
||||
{
|
||||
INT32 mix;
|
||||
|
||||
mix = 0;
|
||||
|
||||
for (ch = 0; ch < 8; ch++)
|
||||
{
|
||||
if (channels[ch].is_playing)
|
||||
{
|
||||
if (channels[ch].output_remaining > 0)
|
||||
{
|
||||
mix += (channels[ch].output_data[channels[ch].output_ptr++]*256);
|
||||
channels[ch].output_remaining--;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (channels[ch].last_block)
|
||||
{
|
||||
channels[ch].is_playing = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
channels[ch].last_block = channels[ch].decoder->run();
|
||||
channels[ch].output_remaining = (channels[ch].decoder->get_rsize()/2)-1;
|
||||
channels[ch].output_ptr = 1;
|
||||
|
||||
mix += (channels[ch].output_data[0]*256);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
outL[i] = outR[i] = mix>>8;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// read - read from the chip's registers and internal RAM
|
||||
//-------------------------------------------------
|
||||
|
||||
READ8_MEMBER( ymz770_device::read )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// write - write to the chip's registers and internal RAM
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER( ymz770_device::write )
|
||||
{
|
||||
if (!offset)
|
||||
{
|
||||
cur_reg = data;
|
||||
return;
|
||||
}
|
||||
|
||||
if (cur_reg >= 0x40 && cur_reg <= 0x5f)
|
||||
{
|
||||
cur_reg -= 0x40;
|
||||
|
||||
int voice = cur_reg / 4;
|
||||
int reg = cur_reg % 4;
|
||||
|
||||
switch (reg)
|
||||
{
|
||||
case 0:
|
||||
channels[voice].phrase = data;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
channels[voice].volume = data;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
channels[voice].pan = data;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if ((data & 6) && !(channels[voice].is_playing))
|
||||
{
|
||||
UINT8 phrase = channels[voice].phrase;
|
||||
UINT32 pptr = rom_base[(4*phrase)+1]<<16 | rom_base[(4*phrase)+2]<<8 | rom_base[(4*phrase)+3];
|
||||
|
||||
channels[voice].decoder->set_pointers(&rom_base[pptr], (UINT8 *)&channels[voice].output_data[0]);
|
||||
channels[voice].decoder->init();
|
||||
channels[voice].output_remaining = 0;
|
||||
channels[voice].output_ptr = 0;
|
||||
channels[voice].last_block = false;
|
||||
|
||||
channels[voice].is_playing = true;
|
||||
}
|
||||
else if (!(data & 6) && (channels[voice].is_playing))
|
||||
{
|
||||
channels[voice].is_playing = false;
|
||||
}
|
||||
|
||||
channels[voice].control = data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
84
src/emu/sound/ymz770.h
Normal file
84
src/emu/sound/ymz770.h
Normal file
@ -0,0 +1,84 @@
|
||||
/***************************************************************************
|
||||
|
||||
ymz770.h
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __YMZ770_H__
|
||||
#define __YMZ770_H__
|
||||
|
||||
//**************************************************************************
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
//**************************************************************************
|
||||
// INTERFACE CONFIGURATION MACROS
|
||||
//**************************************************************************
|
||||
|
||||
#define MCFG_YMZ770_ADD(_tag, _clock) \
|
||||
MCFG_DEVICE_ADD(_tag, YMZ770, _clock)
|
||||
|
||||
#define MCFG_YMZ770_REPLACE(_tag, _clock) \
|
||||
MCFG_DEVICE_REPLACE(_tag, YMZ770, _clock)
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// forward definition
|
||||
class amm;
|
||||
|
||||
// ======================> ymz770_device
|
||||
|
||||
class ymz770_device : public device_t, public device_sound_interface
|
||||
{
|
||||
typedef struct
|
||||
{
|
||||
UINT8 phrase;
|
||||
UINT8 pan;
|
||||
UINT8 volume;
|
||||
UINT8 control;
|
||||
|
||||
bool is_playing, last_block;
|
||||
|
||||
amm *decoder;
|
||||
|
||||
INT16 output_data[0x8fe];
|
||||
int output_remaining;
|
||||
int output_ptr;
|
||||
|
||||
} ymz_channel;
|
||||
|
||||
|
||||
public:
|
||||
// construction/destruction
|
||||
ymz770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
DECLARE_READ8_MEMBER(read);
|
||||
DECLARE_WRITE8_MEMBER(write);
|
||||
|
||||
sound_stream *m_stream;
|
||||
|
||||
protected:
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
|
||||
|
||||
// data
|
||||
UINT8 cur_reg;
|
||||
UINT8 *rom_base;
|
||||
|
||||
ymz_channel channels[8];
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type YMZ770;
|
||||
|
||||
#endif /* __ymz770_H__ */
|
||||
|
@ -76,7 +76,7 @@ Dipswitches & Push Buttons:
|
||||
S1 (DIL SWITCH) Half Pitch DIL Switch x 1, function unknown
|
||||
S2 (DIL SWITCH) Half Pitch DIL Switch x 4, SW1=Setup, other switches unknown
|
||||
S3 (MICRO PUSH BUTTON) Test switch, same as on the JAMMA connector
|
||||
|
||||
.
|
||||
Connectors:
|
||||
P2 (IDC CONNECTOR 20 PIN) function unknown, P2 is not always mounted
|
||||
P4 (IDC CONNECTOR 14 PIN) JTAG connector
|
||||
@ -136,6 +136,7 @@ Speedups
|
||||
#include "cpu/sh4/sh3comn.h"
|
||||
#include "profiler.h"
|
||||
#include "machine/rtc9701.h"
|
||||
#include "sound/ymz770.h"
|
||||
|
||||
static UINT64* cavesh3_ram;
|
||||
//static UINT64* cavesh3_ram_copy;
|
||||
@ -5522,22 +5523,6 @@ static WRITE32_HANDLER( cavesh3_blitter_w )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static READ64_HANDLER( ymz2770c_z_r )
|
||||
{
|
||||
UINT64 ret = space->machine().rand();
|
||||
|
||||
return ret ^ (ret<<32);
|
||||
}
|
||||
|
||||
static WRITE64_HANDLER( ymz2770c_z_w )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// FLASH
|
||||
|
||||
#define FLASH_PAGE_SIZE (2048+64)
|
||||
@ -5926,7 +5911,7 @@ static ADDRESS_MAP_START( cavesh3_map, AS_PROGRAM, 64 )
|
||||
// AM_RANGE(0x0c800000, 0x0cffffff) AM_RAM// AM_SHARE("mainram") // mirror of above on type B boards, extra ram on type D
|
||||
|
||||
AM_RANGE(0x10000000, 0x10000007) AM_READWRITE8(ibara_flash_io_r, ibara_flash_io_w, U64(0xffffffffffffffff))
|
||||
AM_RANGE(0x10400000, 0x10400007) AM_READWRITE(ymz2770c_z_r, ymz2770c_z_w)
|
||||
AM_RANGE(0x10400000, 0x10400007) AM_DEVREADWRITE8_MODERN("ymz770", ymz770_device, read, write, U64(0xffffffffffffffff))
|
||||
AM_RANGE(0x10C00000, 0x10C00007) AM_READWRITE8(serial_rtc_eeprom_r, serial_rtc_eeprom_w, U64(0xffffffffffffffff))
|
||||
AM_RANGE(0x18000000, 0x18000057) AM_READWRITE32(cavesh3_blitter_r, cavesh3_blitter_w, U64(0xffffffffffffffff))
|
||||
|
||||
@ -6148,6 +6133,11 @@ static MACHINE_CONFIG_START( cavesh3, cavesh3_state )
|
||||
MCFG_MACHINE_RESET(cavesh3)
|
||||
|
||||
MCFG_VIDEO_START(cavesh3)
|
||||
|
||||
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
|
||||
MCFG_YMZ770_ADD("ymz770", 16384000)
|
||||
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
|
||||
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/**************************************************
|
||||
@ -6169,7 +6159,7 @@ ROM_START( mushisam )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD("mushisam_u2", 0x000000, 0x8400000, CRC(b1f826dc) SHA1(c287bd9f571d0df03d7fcbcf3c57c74ce564ab05) ) /* (2004/10/12 MASTER VER.) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP("u23", 0x000000, 0x400000, CRC(138e2050) SHA1(9e86489a4e65af5efb5495adf6d4b3e01d5b2816) )
|
||||
ROM_LOAD16_WORD_SWAP("u24", 0x400000, 0x400000, CRC(e3d05c9f) SHA1(130c3d62317da1729c85bd178bd51500edd73ada) )
|
||||
ROM_END
|
||||
@ -6182,7 +6172,7 @@ ROM_START( mushisama )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD("mushisama_u2", 0x000000, 0x8400000, CRC(2cd13810) SHA1(40e45e201b60e63a060b68d4cc767eb64cfb99c2) ) /* (2004/10/12 MASTER VER) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP("u23", 0x000000, 0x400000, CRC(138e2050) SHA1(9e86489a4e65af5efb5495adf6d4b3e01d5b2816) )
|
||||
ROM_LOAD16_WORD_SWAP("u24", 0x400000, 0x400000, CRC(e3d05c9f) SHA1(130c3d62317da1729c85bd178bd51500edd73ada) )
|
||||
ROM_END
|
||||
@ -6195,7 +6185,7 @@ ROM_START( espgal2 )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD( "u2", 0x000000, 0x8400000, CRC(222f58c7) SHA1(d47a5085a1debd9cb8c61d88cd39e4f5036d1797) ) /* (2005/11/14 MASTER VER) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(b9a10c22) SHA1(4561f95c6018c9716077224bfe9660e61fb84681) )
|
||||
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(c76b1ec4) SHA1(b98a53d41a995d968e0432ed824b0b06d93dcea8) )
|
||||
ROM_END
|
||||
@ -6208,7 +6198,7 @@ ROM_START( mushitam )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD("u2", 0x000000, 0x8400000, CRC(3f93ff82) SHA1(6f6c250aa7134016ffb288d056bc937ea311f538) ) /* (2005/09/09 MASTER VER) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP("u23", 0x000000, 0x400000, CRC(701a912a) SHA1(85c198946fb693d99928ea2595c84ba4d9dc8157) )
|
||||
ROM_LOAD16_WORD_SWAP("u24", 0x400000, 0x400000, CRC(6feeb9a1) SHA1(992711c80e660c32f97b343c2ce8184fddd7364e) )
|
||||
ROM_END
|
||||
@ -6221,7 +6211,7 @@ ROM_START( futari15 )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD("futari15_u2", 0x000000, 0x8400000, CRC(b9eae1fc) SHA1(410f8e7cfcbfd271b41fb4f8d049a13a3191a1f9) ) /* (2006/12/8.MAST VER. 1.54.) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP("u23", 0x000000, 0x400000, CRC(39f1e1f4) SHA1(53d12f59a56df35c705408c76e6e02118da656f1) )
|
||||
ROM_LOAD16_WORD_SWAP("u24", 0x400000, 0x400000, CRC(c631a766) SHA1(8bb6934a2f5b8a9841c3dcf85192b1743773dd8b) )
|
||||
ROM_END
|
||||
@ -6234,7 +6224,7 @@ ROM_START( futari15a )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD("futari15a_u2", 0x000000, 0x8400000, CRC(b9d815f9) SHA1(6b6f668b0bbb087ffac65e4f0d8bd9d5b28eeb28) ) /* (2006/12/8 MAST VER 1.54) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP("u23", 0x000000, 0x400000, CRC(39f1e1f4) SHA1(53d12f59a56df35c705408c76e6e02118da656f1) )
|
||||
ROM_LOAD16_WORD_SWAP("u24", 0x400000, 0x400000, CRC(c631a766) SHA1(8bb6934a2f5b8a9841c3dcf85192b1743773dd8b) )
|
||||
ROM_END
|
||||
@ -6247,7 +6237,7 @@ ROM_START( futari10 )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD( "futari10_u2", 0x000000, 0x8400000, CRC(78ffcd0c) SHA1(0e2937edec15ce3f5741b72ebd3bbaaefffb556e) ) /* (2006/10/23 MASTER VER.) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(39f1e1f4) SHA1(53d12f59a56df35c705408c76e6e02118da656f1) )
|
||||
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(c631a766) SHA1(8bb6934a2f5b8a9841c3dcf85192b1743773dd8b) )
|
||||
ROM_END
|
||||
@ -6260,7 +6250,7 @@ ROM_START( futariblk )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD( "futariblk_u2", 0x000000, 0x8400000, CRC(08c6fd62) SHA1(e1fc386b2b0e41906c724287cbf82304297e0150) ) /* (2007/12/11 BLACK LABEL VER) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(39f1e1f4) SHA1(53d12f59a56df35c705408c76e6e02118da656f1) )
|
||||
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(c631a766) SHA1(8bb6934a2f5b8a9841c3dcf85192b1743773dd8b) )
|
||||
ROM_END
|
||||
@ -6273,7 +6263,7 @@ ROM_START( ibara )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD( "u2", 0x000000, 0x8400000, CRC(55840976) SHA1(4982bdce84f9603adfed7a618f18bc80359ab81e) ) /* (2005/03/22 MASTER VER..) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(ee5e585d) SHA1(7eeba4ee693060e927f8c46b16e39227c6a62392) )
|
||||
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(f0aa3cb6) SHA1(f9d137cd879e718811b2d21a0af2a9c6b7dca2f9) )
|
||||
ROM_END
|
||||
@ -6286,7 +6276,7 @@ ROM_START( ibarablk ) /* Title screen shows (c) 2005 despite the 2006/02/06 "mas
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD( "ibarablk_u2", 0x000000, 0x8400000, CRC(5e46be44) SHA1(bed5f1bf452f2cac58747ecabec3c4392566a3a7) ) /* (2006/02/06. MASTER VER.) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(a436bb22) SHA1(0556e771cc02638bf8814315ba671c2d442594f1) ) /* (2006/02/06 MASTER VER.) */
|
||||
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(d11ab6b6) SHA1(2132191cbe847e2560423e4545c969f21f8ff825) ) /* (2006/02/06 MASTER VER.) */
|
||||
ROM_END
|
||||
@ -6299,7 +6289,7 @@ ROM_START( ibarablka ) /* Title screen shows (c) 2005 despite the 2006/02/06 "ma
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD( "ibarablka_u2", 0x000000, 0x8400000, CRC(33400d96) SHA1(09c22b5431ac3726bf88c56efd970f56793f825a) ) /* (2006/02/06 MASTER VER.) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(a436bb22) SHA1(0556e771cc02638bf8814315ba671c2d442594f1) ) /* (2006/02/06 MASTER VER.) */
|
||||
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(d11ab6b6) SHA1(2132191cbe847e2560423e4545c969f21f8ff825) ) /* (2006/02/06 MASTER VER.) */
|
||||
ROM_END
|
||||
@ -6312,7 +6302,7 @@ ROM_START( deathsml )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD( "u2", 0x000000, 0x8400000, CRC(d45b0698) SHA1(7077b9445f5ed4749c7f683191ccd312180fac38) ) /* (2007/10/09 MASTER VER) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(aab718c8) SHA1(0e636c46d06151abd6f73232bc479dafcafe5327) )
|
||||
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(83881d84) SHA1(6e2294b247dfcbf0ced155dc45c706f29052775d) )
|
||||
ROM_END
|
||||
@ -6325,7 +6315,7 @@ ROM_START( mmpork )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD( "u2", 0x000000, 0x8400000, CRC(1ee961b8) SHA1(81a2eba704ac1cf7fc44fa7c6a3f50e3570c104f) ) /* (2007/ 4/17 MASTER VER.) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(4a4b36df) SHA1(5db5ce6fa47e5ca3263d4bd19315890c6d29df66) )
|
||||
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(ce83d07b) SHA1(a5947467c8f5b7c4b0ad8e32df2ee29b787e355f) )
|
||||
ROM_END
|
||||
@ -6338,7 +6328,7 @@ ROM_START( mmmbanc )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD( "u2", 0x0000, 0x8400000, CRC(f3b50c30) SHA1(962327798081b292b2d3fd3b7845c0197f9f2d8a) ) /* (2007/06/05 MASTER VER.) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(4caaa1bf) SHA1(9b92c13eac05601da4d9bb3eb727c156974e9f0c) )
|
||||
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(8e3a51ba) SHA1(e34cf9acb13c3d8ca6cd1306b060b1d429872abd) )
|
||||
ROM_END
|
||||
@ -6351,7 +6341,7 @@ ROM_START( pinkswts )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD( "pinkswts_u2", 0x0000, 0x8400000, CRC(92d3243a) SHA1(e9d20c62f642fb2f62ef83ed5caeee6b3f67fef9) ) /* (2006/04/06 MASTER VER....) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(4b82d250) SHA1(ee98dbc3f791efb6d58f3945bcb2044667ae7978) )
|
||||
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(e93f0627) SHA1(6f5ec0ade87f7fc42a58a8f125557a4d1f3f187d) )
|
||||
ROM_END
|
||||
@ -6364,7 +6354,7 @@ ROM_START( pinkswtsa )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD( "pnkswtsa_u2", 0x0000, 0x8400000, CRC(829a862e) SHA1(8c0ee2a0eb33b68869252fd68aed74820a904287) ) /* (2006/04/06 MASTER VER...) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(4b82d250) SHA1(ee98dbc3f791efb6d58f3945bcb2044667ae7978) )
|
||||
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(e93f0627) SHA1(6f5ec0ade87f7fc42a58a8f125557a4d1f3f187d) )
|
||||
ROM_END
|
||||
@ -6377,7 +6367,7 @@ ROM_START( pinkswtsb )
|
||||
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
|
||||
ROM_LOAD( "pnkswtsb_u2", 0x0000, 0x8400000, CRC(a5666ed9) SHA1(682e06c84990225bc6bb0c9f38b5f46c4e36b430) ) /* (2006/04/06 MASTER VER.) */
|
||||
|
||||
ROM_REGION( 0x800000, "samples", ROMREGION_ERASEFF)
|
||||
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
|
||||
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(4b82d250) SHA1(ee98dbc3f791efb6d58f3945bcb2044667ae7978) )
|
||||
ROM_LOAD16_WORD_SWAP( "u24", 0x400000, 0x400000, CRC(e93f0627) SHA1(6f5ec0ade87f7fc42a58a8f125557a4d1f3f187d) )
|
||||
ROM_END
|
||||
@ -6425,23 +6415,23 @@ DRIVER_INIT( espgal2 )
|
||||
}
|
||||
|
||||
|
||||
GAME( 2004, mushisam, 0, cavesh3, cavesh3, mushisam, ROT270, "Cave", "Mushihime Sama (2004/10/12 MASTER VER.)", GAME_NO_SOUND )
|
||||
GAME( 2004, mushisama, mushisam, cavesh3, cavesh3, mushisama, ROT270, "Cave", "Mushihime Sama (2004/10/12 MASTER VER)", GAME_NO_SOUND )
|
||||
GAME( 2005, espgal2, 0, cavesh3, cavesh3, espgal2, ROT270, "Cave", "EspGaluda II (2005/11/14 MASTER VER)", GAME_NO_SOUND )
|
||||
GAME( 2005, ibara, 0, cavesh3, cavesh3, mushisam, ROT270, "Cave", "Ibara (2005/03/22 MASTER VER..)", GAME_NO_SOUND )
|
||||
GAME( 2005, ibarablk, 0, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Ibara Kuro - Black Label (2006/02/06. MASTER VER.)", GAME_NO_SOUND )
|
||||
GAME( 2005, ibarablka, ibarablk, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Ibara Kuro - Black Label (2006/02/06 MASTER VER.)", GAME_NO_SOUND )
|
||||
GAME( 2005, mushitam, 0, cavesh3, cavesh3, mushisam, ROT0, "Cave", "Mushihime Tama (2005/09/09 MASTER VER)", GAME_NO_SOUND )
|
||||
GAME( 2006, futari15, 0, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Mushihime Sama Futari Ver 1.5 (2006/12/8.MASTER VER. 1.54.)", GAME_NO_SOUND )
|
||||
GAME( 2006, futari15a, futari15, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Mushihime Sama Futari Ver 1.5 (2006/12/8 MASTER VER 1.54)", GAME_NO_SOUND )
|
||||
GAME( 2006, futari10, futari15, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Mushihime Sama Futari Ver 1.0 (2006/10/23 MASTER VER.)", GAME_NO_SOUND )
|
||||
GAME( 2007, futariblk, futari15, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Mushihime Sama Futari Black Label (2007/12/11 BLACK LABEL VER)", GAME_NO_SOUND )
|
||||
GAME( 2006, pinkswts, 0, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Pink Sweets - Ibara Sorekara (2006/04/06 MASTER VER....)", GAME_NO_SOUND )
|
||||
GAME( 2006, pinkswtsa, pinkswts, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Pink Sweets - Ibara Sorekara (2006/04/06 MASTER VER...)", GAME_NO_SOUND )
|
||||
GAME( 2006, pinkswtsb, pinkswts, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Pink Sweets - Ibara Sorekara (2006/04/06 MASTER VER.)", GAME_NO_SOUND )
|
||||
GAME( 2007, deathsml, 0, cavesh3, cavesh3, espgal2, ROT0, "Cave", "Death Smiles (2007/10/09 MASTER VER)", GAME_NO_SOUND )
|
||||
GAME( 2007, mmpork, 0, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Muchi Muchi Pork (2007/ 4/17 MASTER VER.)", GAME_NO_SOUND )
|
||||
GAME( 2007, mmmbanc, 0, cavesh3, cavesh3, espgal2, ROT0, "Cave", "Medal Mahjong Moukari Bancho (2007/06/05 MASTER VER.)", GAME_NOT_WORKING | GAME_NO_SOUND )
|
||||
GAME( 2004, mushisam, 0, cavesh3, cavesh3, mushisam, ROT270, "Cave", "Mushihime Sama (2004/10/12 MASTER VER.)", 0 )
|
||||
GAME( 2004, mushisama, mushisam, cavesh3, cavesh3, mushisama, ROT270, "Cave", "Mushihime Sama (2004/10/12 MASTER VER)", 0 )
|
||||
GAME( 2005, espgal2, 0, cavesh3, cavesh3, espgal2, ROT270, "Cave", "EspGaluda II (2005/11/14 MASTER VER)", 0 )
|
||||
GAME( 2005, ibara, 0, cavesh3, cavesh3, mushisam, ROT270, "Cave", "Ibara (2005/03/22 MASTER VER..)", 0 )
|
||||
GAME( 2005, ibarablk, 0, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Ibara Kuro - Black Label (2006/02/06. MASTER VER.)", 0 )
|
||||
GAME( 2005, ibarablka, ibarablk, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Ibara Kuro - Black Label (2006/02/06 MASTER VER.)", 0 )
|
||||
GAME( 2005, mushitam, 0, cavesh3, cavesh3, mushisam, ROT0, "Cave", "Mushihime Tama (2005/09/09 MASTER VER)", 0 )
|
||||
GAME( 2006, futari15, 0, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Mushihime Sama Futari Ver 1.5 (2006/12/8.MASTER VER. 1.54.)", 0 )
|
||||
GAME( 2006, futari15a, futari15, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Mushihime Sama Futari Ver 1.5 (2006/12/8 MASTER VER 1.54)", 0 )
|
||||
GAME( 2006, futari10, futari15, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Mushihime Sama Futari Ver 1.0 (2006/10/23 MASTER VER.)", 0 )
|
||||
GAME( 2007, futariblk, futari15, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Mushihime Sama Futari Black Label (2007/12/11 BLACK LABEL VER)", 0 )
|
||||
GAME( 2006, pinkswts, 0, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Pink Sweets - Ibara Sorekara (2006/04/06 MASTER VER....)", 0 )
|
||||
GAME( 2006, pinkswtsa, pinkswts, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Pink Sweets - Ibara Sorekara (2006/04/06 MASTER VER...)", 0 )
|
||||
GAME( 2006, pinkswtsb, pinkswts, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Pink Sweets - Ibara Sorekara (2006/04/06 MASTER VER.)", 0 )
|
||||
GAME( 2007, deathsml, 0, cavesh3, cavesh3, espgal2, ROT0, "Cave", "Death Smiles (2007/10/09 MASTER VER)", 0 )
|
||||
GAME( 2007, mmpork, 0, cavesh3, cavesh3, espgal2, ROT270, "Cave", "Muchi Muchi Pork (2007/ 4/17 MASTER VER.)", 0 )
|
||||
GAME( 2007, mmmbanc, 0, cavesh3, cavesh3, espgal2, ROT0, "Cave", "Medal Mahjong Moukari Bancho (2007/06/05 MASTER VER.)", GAME_NOT_WORKING )
|
||||
|
||||
/*
|
||||
|
||||
|
@ -231,7 +231,7 @@ SOUNDS += ASC
|
||||
SOUNDS += MAS3507D
|
||||
SOUNDS += LMC1992
|
||||
SOUNDS += AWACS
|
||||
|
||||
SOUNDS += YMZ770
|
||||
|
||||
#-------------------------------------------------
|
||||
# this is the list of driver libraries that
|
||||
|
Loading…
Reference in New Issue
Block a user