From 5a7d6600c92b7653523dc640d376da4cf90781ee Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 18 Aug 2021 01:06:22 +1000 Subject: Formatting consistency fixes for recent changes. --- src/devices/sound/ics2115.cpp | 73 ++++++++++++++++++++++--------------------- src/mame/drivers/viper.cpp | 25 +++++++++------ src/mame/video/avgdvg.cpp | 12 ++++--- 3 files changed, 60 insertions(+), 50 deletions(-) diff --git a/src/devices/sound/ics2115.cpp b/src/devices/sound/ics2115.cpp index 7f9ebd7cc0a..d432442aa1c 100644 --- a/src/devices/sound/ics2115.cpp +++ b/src/devices/sound/ics2115.cpp @@ -23,9 +23,11 @@ #include "emu.h" #include "ics2115.h" + #include #include + //#define ICS2115_DEBUG //#define ICS2115_ISOLATE 6 @@ -201,23 +203,25 @@ device_memory_interface::space_config_vector ics2115_device::memory_space_config } -// Using next-state logic from column 126 of patent 5809466. -// VOL(L) = vol.acc -// VINC = vol.inc -// DIR = invert -// BC = boundary cross (start or end ) -// BLEN = bi directional loop enable -// LEN loop enable -// UVOL LEN BLEN DIR BC Next VOL(L) -// 0 x x x x VOL(L) // no change no vol envelope -// 1 x x 0 0 VOL(L) + VINC // foward dir no bc -// 1 x x 1 0 VOL(L) - VINC // invert no bc -// 1 0 x x 1 VOL(L) // no env len no vel envelope -// ---------------------------------------------------------------------------- -// 1 1 0 0 1 start - ( end - (VOL(L) + VINC) ) -// 1 1 0 1 1 end + ( (VOL(L) - VINC) - start) -// 1 1 1 0 1 end + (end - (VOL(L) + VINC) ) // here -// 1 1 1 1 1 start - ( (VOL(L) - VINC)- start) +/* + Using next-state logic from column 126 of patent 5809466. + VOL(L) = vol.acc + VINC = vol.inc + DIR = invert + BC = boundary cross (start or end ) + BLEN = bi directional loop enable + LEN loop enable + UVOL LEN BLEN DIR BC Next VOL(L) + 0 x x x x VOL(L) // no change no vol envelope + 1 x x 0 0 VOL(L) + VINC // foward dir no bc + 1 x x 1 0 VOL(L) - VINC // invert no bc + 1 0 x x 1 VOL(L) // no env len no vel envelope + ---------------------------------------------------------------------------- + 1 1 0 0 1 start - ( end - (VOL(L) + VINC) ) + 1 1 0 1 1 end + ( (VOL(L) - VINC) - start) + 1 1 1 0 1 end + (end - (VOL(L) + VINC) ) // here + 1 1 1 1 1 start - ( (VOL(L) - VINC)- start) +*/ int ics2115_device::ics2115_voice::update_volume_envelope() { @@ -253,25 +257,24 @@ int ics2115_device::ics2115_voice::update_volume_envelope() if (osc_conf.bitflags.eightbit) return ret; - if (vol_ctrl.bitflags.loop) + if (vol_ctrl.bitflags.loop) { - if (bc) { - if (!vol_ctrl.bitflags.loop_bidir && !vol_ctrl.bitflags.invert) - // uvol = 1* len = 1* blen = 0 dir = 0 bc = 1* start - ( end - (VOL(L) + VINC) ) - vol.acc = vol.start - (vol.end - (vol.acc + vol.incr)); - - if (!vol_ctrl.bitflags.loop_bidir && vol_ctrl.bitflags.invert) - // 1 1 blen = 0 dir= 1 1 end + ( (VOL(L) - VINC) - start) - vol.acc = vol.end + ((vol.acc - vol.incr) - vol.start); - - if (vol_ctrl.bitflags.loop_bidir && !vol_ctrl.bitflags.invert) - // 1 1 blen = 1 dir = 0 1 end + (end - (VOL(L) + VINC) ) - vol.acc = vol.end + (vol.end - (vol.acc + vol.incr)); - - - if (vol_ctrl.bitflags.loop_bidir && vol_ctrl.bitflags.invert) - // 1 1 beln = 1 dir = 1 1 start - ( (VOL(L) - VINC)- start) - vol.acc = vol.start - ((vol.acc - vol.incr) - vol.start); + if (bc) + { + if (!vol_ctrl.bitflags.loop_bidir) + { + if (!vol_ctrl.bitflags.invert) + vol.acc = vol.start - (vol.end - (vol.acc + vol.incr)); // uvol = 1* len = 1* blen = 0 dir = 0 bc = 1* start - ( end - (VOL(L) + VINC) ) + else + vol.acc = vol.end + ((vol.acc - vol.incr) - vol.start); // 1 1 blen = 0 dir = 1 1 end + ( (VOL(L) - VINC) - start) + } + else + { + if (!vol_ctrl.bitflags.invert) + vol.acc = vol.end + (vol.end - (vol.acc + vol.incr)); // 1 1 blen = 1 dir = 0 1 end + (end - (VOL(L) + VINC) ) + else + vol.acc = vol.start - ((vol.acc - vol.incr) - vol.start); // 1 1 beln = 1 dir = 1 1 start - ( (VOL(L) - VINC)- start) + } } } else diff --git a/src/mame/drivers/viper.cpp b/src/mame/drivers/viper.cpp index 3a8e9e5448a..dcbc4dd5c97 100644 --- a/src/mame/drivers/viper.cpp +++ b/src/mame/drivers/viper.cpp @@ -107,17 +107,17 @@ xtrial Hangs at "Please set the time for the bookkeeping" message. p9112 RTC self check bad. - The game checks the checksum of 0x157d4d0-0x157d4ee against the checksum that should be at 0x157d4ee-0x157d4ef, - but this part of memory is never written to after its initial clearing on boot. - If 0xffff is placed at 0x157d4ee then the game will pass the RTC check. - The game will later complain about "Hardware Error: Security Key Error" if you try starting the game. + The game checks the checksum of 0x157d4d0-0x157d4ee against the checksum that should be at 0x157d4ee-0x157d4ef, + but this part of memory is never written to after its initial clearing on boot. + If 0xffff is placed at 0x157d4ee then the game will pass the RTC check. + The game will later complain about "Hardware Error: Security Key Error" if you try starting the game. code1d,b Can boot but crashes randomly and quickly so it's hard to do anything. mocapglf Security code error sscopex/sogeki Security code error wcombat Can boot into a test menu by using a combination of dipswitches, but it says "serial check bad". Can't boot normally. - wcombatu Bootable when dipsw 4 is set to on. Controls not implemented so it's not possible to pass nickname selection screen. Freezes when test button is pressed. + wcombatu Bootable when dipsw 4 is set to on. Controls not implemented so it's not possible to pass nickname selection screen. Freezes when test button is pressed. thrild2c,ac Inf loop on blue screen @@ -2505,7 +2505,8 @@ WRITE_LINE_MEMBER(viper_state::voodoo_vblank) WRITE_LINE_MEMBER(viper_state::voodoo_pciint) { - if (state) { + if (state) + { // This is a hack. // There's no obvious (to me) trigger for when it's safe to start the audio interrupts, but after testing all of the games that can boot, it's safe to start audio interrupts once pciint is triggering. m_sound_irq_enabled = true; @@ -2516,7 +2517,8 @@ WRITE_LINE_MEMBER(viper_state::voodoo_pciint) TIMER_DEVICE_CALLBACK_MEMBER(viper_state::sound_timer_callback) { - if (!m_sound_irq_enabled) { + if (!m_sound_irq_enabled) + { // If IRQ3 is triggered too soon into the boot process then it'll freeze on the blue boot screen. return; } @@ -2525,7 +2527,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(viper_state::sound_timer_callback) // Get samples from memory int32_t* samplePtr = (int32_t*)(m_workram + (m_sound_buffer_offset >> 3)); - for (int i = 0; i < 2; i++) { + for (int i = 0; i < 2; i++) + { m_dmadac[i]->transfer( i, 1, @@ -2614,7 +2617,8 @@ void viper_state::machine_reset() m_sound_buffer_offset = 0xfff800; // The games swap between 0xfff800 and 0xfff000 every IRQ3 call m_sound_irq_enabled = false; - for (int i = 0; i < 2; i++) { + for (int i = 0; i < 2; i++) + { m_dmadac[i]->initialize_state(); m_dmadac[i]->set_frequency(44100); m_dmadac[i]->enable(1); @@ -2705,7 +2709,8 @@ void viper_state::init_vipercf() uint16_t viper_state::ppp_sensor_r(offs_t offset) { - switch(offset) { + switch(offset) + { case 0x06: return m_io_ppp_sensors[0]->read(); case 0x0e: return m_io_ppp_sensors[1]->read(); case 0x16: return m_io_ppp_sensors[2]->read(); diff --git a/src/mame/video/avgdvg.cpp b/src/mame/video/avgdvg.cpp index b40d5fd67ac..4a1a1f4cd04 100644 --- a/src/mame/video/avgdvg.cpp +++ b/src/mame/video/avgdvg.cpp @@ -16,8 +16,10 @@ #include "emu.h" #include "avgdvg.h" + #include "screen.h" + /************************************* * * Macros and defines @@ -847,12 +849,12 @@ int avg_mhavoc_device::handler_7() // mhavoc_strobe3 const u8 b = bit0 * 0xcb; int x = m_xpos; - int y = m_ypos; - apply_flipping(x, y); + int y = m_ypos; + apply_flipping(x, y); - vg_add_point_buf( - x, - y, + vg_add_point_buf( + x, + y, rgb_t(r, g, b), (((m_int_latch >> 1) == 1) ? m_intensity : m_int_latch & 0xe) << 4); } -- cgit v1.2.3