From 461bc4c3c4a89852bcd70c793f55cda3eba2ff4c Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Sat, 2 Jun 2018 01:25:49 +0300 Subject: Remove duplicated "Poke" function call It's no sense to have uint32-argument poke function as all emulators are using uint16 and uint8 data only --- src/adlmidi_midiplay.cpp | 2 +- src/adlmidi_opl3.cpp | 30 ++---------------------------- src/adlmidi_private.hpp | 3 +-- 3 files changed, 4 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp index 610c64e..16d125e 100644 --- a/src/adlmidi_midiplay.cpp +++ b/src/adlmidi_midiplay.cpp @@ -2066,7 +2066,7 @@ void MIDIplay::HandleEvent(size_t tk, const MIDIplay::MidiEvent &evt, int &statu v |= 0x30; //std::printf("OPL poke %02X, %02X\n", i, v); //std::fflush(stdout); - opl.PokeN(0, i, v); + opl.Poke(0, i, v); return; } diff --git a/src/adlmidi_opl3.cpp b/src/adlmidi_opl3.cpp index 26883a1..b4db049 100644 --- a/src/adlmidi_opl3.cpp +++ b/src/adlmidi_opl3.cpp @@ -178,33 +178,7 @@ OPL3::OPL3() : #endif } -void OPL3::Poke(size_t card, uint32_t index, uint32_t value) -{ - #ifdef ADLMIDI_HW_OPL - (void)card; - unsigned o = index >> 8; - unsigned port = OPLBase + o * 2; - - #ifdef __DJGPP__ - outportb(port, index); - for(unsigned c = 0; c < 6; ++c) inportb(port); - outportb(port + 1, value); - for(unsigned c = 0; c < 35; ++c) inportb(port); - #endif//__DJGPP__ - - #ifdef __WATCOMC__ - outp(port, index); - for(uint16_t c = 0; c < 6; ++c) inp(port); - outp(port + 1, value); - for(uint16_t c = 0; c < 35; ++c) inp(port); - #endif//__WATCOMC__ - - #else//ADLMIDI_HW_OPL - cardsOP2[card]->writeReg(static_cast(index), static_cast(value)); - #endif//ADLMIDI_HW_OPL -} - -void OPL3::PokeN(size_t card, uint16_t index, uint8_t value) +void OPL3::Poke(size_t card, uint16_t index, uint8_t value) { #ifdef ADLMIDI_HW_OPL (void)card; @@ -569,7 +543,7 @@ void OPL3::Reset(int emulator, unsigned long PCM_RATE) for(unsigned a = 0; a < 18; ++a) Poke(i, 0xB0 + Channels[a], 0x00); for(unsigned a = 0; a < sizeof(data) / sizeof(*data); a += 2) - PokeN(i, data[a], static_cast(data[a + 1])); + Poke(i, data[a], static_cast(data[a + 1])); Poke(i, 0x0BD, regBD[i] = (HighTremoloMode * 0x80 + HighVibratoMode * 0x40 + AdlPercussionMode * 0x20)); diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index 2010b4e..8e3b158 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -281,8 +281,7 @@ public: // 7 = percussion Hihat // 8 = percussion slave - void Poke(size_t card, uint32_t index, uint32_t value); - void PokeN(size_t card, uint16_t index, uint8_t value); + void Poke(size_t card, uint16_t index, uint8_t value); void NoteOff(size_t c); void NoteOn(unsigned c, double hertz); -- cgit v1.2.3