- the fourth.

This commit is contained in:
Christoph Oelckers 2017-03-08 18:47:52 +01:00
commit 8ab562ef13
107 changed files with 1041 additions and 1041 deletions

View file

@ -38,7 +38,7 @@ typedef DWORD Bit32u;
typedef int32_t Bit32s;
typedef WORD Bit16u;
typedef SWORD Bit16s;
typedef BYTE Bit8u;
typedef uint8_t Bit8u;
typedef SBYTE Bit8s;
#define OPLTYPE_IS_OPL3

View file

@ -474,7 +474,7 @@ int musicBlock::OPLloadBank (FileReader &data)
for (int i = 0; i < 175; ++i)
{
Printf ("%3d.%-33s%3d %3d %3d %d\n", i,
(BYTE *)data+6308+i*32,
(uint8_t *)data+6308+i*32,
OPLinstruments[i].instr[0].basenote,
OPLinstruments[i].instr[1].basenote,
OPLinstruments[i].note,

View file

@ -195,8 +195,8 @@ void OPLio::OPLwriteFreq(uint32_t channel, uint32_t note, uint32_t pitch, uint32
}
int i = frequencies[j] | (octave << 10);
OPLwriteValue (0xA0, channel, (BYTE)i);
OPLwriteValue (0xB0, channel, (BYTE)(i>>8)|(keyon<<5));
OPLwriteValue (0xA0, channel, (uint8_t)i);
OPLwriteValue (0xB0, channel, (uint8_t)(i>>8)|(keyon<<5));
}
/*

View file

@ -252,7 +252,7 @@ void OPLMIDIDevice::HandleEvent(int status, int parm1, int parm2)
//
//==========================================================================
void OPLMIDIDevice::HandleLongEvent(const BYTE *data, int len)
void OPLMIDIDevice::HandleLongEvent(const uint8_t *data, int len)
{
}

View file

@ -71,7 +71,7 @@ protected:
double CurTime;
int CurIntTime;
int TickMul;
BYTE CurChip;
uint8_t CurChip;
};
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
@ -110,16 +110,16 @@ public:
virtual void WriteReg(int reg, int v)
{
assert(File != NULL);
BYTE chipnum = reg >> 8;
uint8_t chipnum = reg >> 8;
if (chipnum != CurChip)
{
BYTE switcher[2] = { (BYTE)(chipnum + 1), 2 };
uint8_t switcher[2] = { (uint8_t)(chipnum + 1), 2 };
fwrite(switcher, 1, 2, File);
}
reg &= 255;
if (reg != 0 && reg != 2 && (reg != 255 || v != 255))
{
BYTE cmd[2] = { BYTE(v), BYTE(reg) };
uint8_t cmd[2] = { uint8_t(v), uint8_t(reg) };
fwrite(cmd, 1, 2, File);
}
}
@ -153,7 +153,7 @@ public:
}
else
{ // Change the clock rate in the middle of the song.
BYTE clock_change[4] = { 0, 2, BYTE(clock_word & 255), BYTE(clock_word >> 8) };
uint8_t clock_change[4] = { 0, 2, uint8_t(clock_word & 255), uint8_t(clock_word >> 8) };
fwrite(clock_change, 1, 4, File);
}
}
@ -162,7 +162,7 @@ public:
if (ticks > 0)
{ // RDos raw has very precise delays but isn't very efficient at
// storing long delays.
BYTE delay[2];
uint8_t delay[2];
ticks *= TickMul;
delay[1] = 0;
@ -172,7 +172,7 @@ public:
delay[0] = 255;
fwrite(delay, 1, 2, File);
}
delay[0] = BYTE(ticks);
delay[0] = uint8_t(ticks);
fwrite(delay, 1, 2, File);
}
}
@ -212,14 +212,14 @@ public:
virtual void WriteReg(int reg, int v)
{
assert(File != NULL);
BYTE chipnum = reg >> 8;
uint8_t chipnum = reg >> 8;
if (chipnum != CurChip)
{
CurChip = chipnum;
fputc(chipnum + 2, File);
}
reg &= 255;
BYTE cmd[3] = { 4, BYTE(reg), BYTE(v) };
uint8_t cmd[3] = { 4, uint8_t(reg), uint8_t(v) };
fwrite (cmd + (reg > 4), 1, 3 - (reg > 4), File);
}
virtual void WriteDelay(int ticks)
@ -233,20 +233,20 @@ public:
CurIntTime += delay;
while (delay > 65536)
{
BYTE cmd[3] = { 1, 255, 255 };
uint8_t cmd[3] = { 1, 255, 255 };
fwrite(cmd, 1, 2, File);
delay -= 65536;
}
delay--;
if (delay <= 255)
{
BYTE cmd[2] = { 0, BYTE(delay) };
uint8_t cmd[2] = { 0, uint8_t(delay) };
fwrite(cmd, 1, 2, File);
}
else
{
assert(delay <= 65535);
BYTE cmd[3] = { 1, BYTE(delay & 255), BYTE(delay >> 8) };
uint8_t cmd[3] = { 1, uint8_t(delay & 255), uint8_t(delay >> 8) };
fwrite(cmd, 1, 3, File);
}
}

View file

@ -88,28 +88,28 @@ class FileReader;
/* OPL2 instrument */
struct OPL2instrument {
/*00*/ BYTE trem_vibr_1; /* OP 1: tremolo/vibrato/sustain/KSR/multi */
/*01*/ BYTE att_dec_1; /* OP 1: attack rate/decay rate */
/*02*/ BYTE sust_rel_1; /* OP 1: sustain level/release rate */
/*03*/ BYTE wave_1; /* OP 1: waveform select */
/*04*/ BYTE scale_1; /* OP 1: key scale level */
/*05*/ BYTE level_1; /* OP 1: output level */
/*06*/ BYTE feedback; /* feedback/AM-FM (both operators) */
/*07*/ BYTE trem_vibr_2; /* OP 2: tremolo/vibrato/sustain/KSR/multi */
/*08*/ BYTE att_dec_2; /* OP 2: attack rate/decay rate */
/*09*/ BYTE sust_rel_2; /* OP 2: sustain level/release rate */
/*0A*/ BYTE wave_2; /* OP 2: waveform select */
/*0B*/ BYTE scale_2; /* OP 2: key scale level */
/*0C*/ BYTE level_2; /* OP 2: output level */
/*0D*/ BYTE unused;
/*00*/ uint8_t trem_vibr_1; /* OP 1: tremolo/vibrato/sustain/KSR/multi */
/*01*/ uint8_t att_dec_1; /* OP 1: attack rate/decay rate */
/*02*/ uint8_t sust_rel_1; /* OP 1: sustain level/release rate */
/*03*/ uint8_t wave_1; /* OP 1: waveform select */
/*04*/ uint8_t scale_1; /* OP 1: key scale level */
/*05*/ uint8_t level_1; /* OP 1: output level */
/*06*/ uint8_t feedback; /* feedback/AM-FM (both operators) */
/*07*/ uint8_t trem_vibr_2; /* OP 2: tremolo/vibrato/sustain/KSR/multi */
/*08*/ uint8_t att_dec_2; /* OP 2: attack rate/decay rate */
/*09*/ uint8_t sust_rel_2; /* OP 2: sustain level/release rate */
/*0A*/ uint8_t wave_2; /* OP 2: waveform select */
/*0B*/ uint8_t scale_2; /* OP 2: key scale level */
/*0C*/ uint8_t level_2; /* OP 2: output level */
/*0D*/ uint8_t unused;
/*0E*/ int16_t basenote; /* base note offset */
};
/* OP2 instrument file entry */
struct OP2instrEntry {
/*00*/ WORD flags; // see FL_xxx below
/*02*/ BYTE finetune; // finetune value for 2-voice sounds
/*03*/ BYTE note; // note # for fixed instruments
/*02*/ uint8_t finetune; // finetune value for 2-voice sounds
/*03*/ uint8_t note; // note # for fixed instruments
/*04*/ struct OPL2instrument instr[2]; // instruments
};
@ -188,8 +188,8 @@ struct musicBlock {
musicBlock();
~musicBlock();
BYTE *score;
BYTE *scoredata;
uint8_t *score;
uint8_t *scoredata;
int playingcount;
OPLdata driverdata;
OPLio *io;

View file

@ -38,7 +38,7 @@ typedef DWORD Bit32u;
typedef int32_t Bit32s;
typedef WORD Bit16u;
typedef SWORD Bit16s;
typedef BYTE Bit8u;
typedef uint8_t Bit8u;
typedef SBYTE Bit8s;
// Channel types

View file

@ -60,7 +60,7 @@ OPLmusicFile::OPLmusicFile (FileReader *reader)
return;
}
scoredata = new BYTE[ScoreLen];
scoredata = new uint8_t[ScoreLen];
if (reader->Read(scoredata, ScoreLen) != ScoreLen)
{
@ -126,7 +126,7 @@ fail: delete[] scoredata;
scoredata[4] == 'B' && scoredata[5] == 1)
{
int songlen;
BYTE *max = scoredata + ScoreLen;
uint8_t *max = scoredata + ScoreLen;
RawPlayer = IMF;
SamplesPerTick = OPL_SAMPLE_RATE / IMF_RATE;
@ -363,7 +363,7 @@ void OPLmusicBlock::OffsetSamples(float *buff, int count)
int OPLmusicFile::PlayTick ()
{
BYTE reg, data;
uint8_t reg, data;
WORD delay;
switch (RawPlayer)
@ -453,14 +453,14 @@ int OPLmusicFile::PlayTick ()
case DosBox2:
{
BYTE *to_reg = scoredata + 0x1A;
BYTE to_reg_size = scoredata[0x19];
BYTE short_delay_code = scoredata[0x17];
BYTE long_delay_code = scoredata[0x18];
uint8_t *to_reg = scoredata + 0x1A;
uint8_t to_reg_size = scoredata[0x19];
uint8_t short_delay_code = scoredata[0x17];
uint8_t long_delay_code = scoredata[0x18];
while (score < scoredata + ScoreLen)
{
BYTE code = *score++;
uint8_t code = *score++;
data = *score++;
// Which OPL chip to write to is encoded in the high bit of the code value.
@ -512,7 +512,7 @@ ADD_STAT (opl)
OPLmusicFile::OPLmusicFile(const OPLmusicFile *source, const char *filename)
{
ScoreLen = source->ScoreLen;
scoredata = new BYTE[ScoreLen];
scoredata = new uint8_t[ScoreLen];
memcpy(scoredata, source->scoredata, ScoreLen);
SamplesPerTick = source->SamplesPerTick;
RawPlayer = source->RawPlayer;