From b2e3faace62651a944ccf0e4c29873257af003e2 Mon Sep 17 00:00:00 2001 From: hap Date: Fri, 12 Jun 2020 14:42:20 +0200 Subject: [PATCH 1/2] tubep: no sprites on left edge (nw) --- src/mame/video/bosco.cpp | 9 +++++++-- src/mame/video/tubep.cpp | 11 +++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/mame/video/bosco.cpp b/src/mame/video/bosco.cpp index c86e76ed1a9..ce688fc48d9 100644 --- a/src/mame/video/bosco.cpp +++ b/src/mame/video/bosco.cpp @@ -2,10 +2,15 @@ // copyright-holders:Nicola Salmoria /*************************************************************************** - video.c - Functions to emulate the video hardware of the machine. + Bullet vs tilemap offsets are correct when compared with PCB videos + (both playfield area, and radar area). Bullet vs sprite offsets are also + correct. + + The radar area is offset by 3 pixels, also confirmed with PCB video when + it does the VRAM check. + ***************************************************************************/ #include "emu.h" diff --git a/src/mame/video/tubep.cpp b/src/mame/video/tubep.cpp index 643da54f777..1ff4b1e4506 100644 --- a/src/mame/video/tubep.cpp +++ b/src/mame/video/tubep.cpp @@ -433,14 +433,14 @@ void tubep_state::draw_sprite() for (YDOT=0; (YDOT^m_YSize) != 0x00; YDOT++) { - /* upper part of the schematic */ + /* upper part of the schematic */ uint32_t ls273_e12 = romD10[ m_romD_addr | YDOT ] & 0x7f; uint32_t romEF_addr_now = m_romEF_addr | ls273_e12; uint32_t E16_add_a = romEF13[ romEF_addr_now ] | ((romEF13[0x1000 + romEF_addr_now ]&0x0f)<<8); uint32_t F16_add_b = E16_add_a + m_E16_add_b; - /* lower part of the schematic */ + /* lower part of the schematic */ uint32_t romHI_addr = (YDOT) | (m_romHI_addr_mid) | (((m_romHI_addr_msb + 0x800) )&0x1800); uint32_t ls273_g4 = romHI2[ romHI_addr ]; uint32_t ls273_j4 = romHI2[0x2000+ romHI_addr ]; @@ -457,7 +457,7 @@ void tubep_state::draw_sprite() for (XDOT=0; (XDOT^m_XSize) != 0x00; XDOT++) { - /* upper part of the schematic */ + /* upper part of the schematic */ uint32_t romD10_out = romD10[ m_romD_addr | XDOT ]; uint32_t F16_add_a = (romD10_out & 0x7e) >>1; uint32_t romCxx_addr = (F16_add_a + F16_add_b ) & 0xffff; @@ -467,7 +467,7 @@ void tubep_state::draw_sprite() uint8_t sp_data = m_sprite_colorsharedram[ m_colorram_addr_hi | colorram_addr_lo ] & 0x0f; /* 2114 4-bit RAM */ - /* lower part of the schematic */ + /* lower part of the schematic */ romHI_addr = (XDOT) | (m_romHI_addr_mid) | (m_romHI_addr_msb); ls273_g4 = romHI2[ romHI_addr ]; ls273_j4 = romHI2[0x2000+ romHI_addr ]; @@ -494,7 +494,6 @@ WRITE8_MEMBER(tubep_state::tubep_sprite_control_w) { if (offset < 10) { - /*graph_ctrl[offset] = data;*/ switch(offset) { case 0: /*a*/ @@ -647,7 +646,7 @@ uint32_t tubep_state::screen_update_tubep(screen_device &screen, bitmap_ind16 &b else sp_data = sp_data1; - if (sp_data != 0x0f) + if (sp_data != 0x0f && h >= 4) { bg_data = m_prom2[sp_data | m_color_A4]; draw_text_or_sprite_pixel = true; From e0715320f7657ba7b3a9b90290848e39abf10b63 Mon Sep 17 00:00:00 2001 From: tim lindner Date: Fri, 12 Jun 2020 05:44:27 -0700 Subject: [PATCH 2/2] Setting analog inputs don't work in LUA (#6812) * fixed set_value for analog inputs. --- src/emu/ioport.cpp | 29 ++++++++++++++++++++++++++--- src/emu/ioport.h | 7 ++++++- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp index 09bea86931e..06766134370 100644 --- a/src/emu/ioport.cpp +++ b/src/emu/ioport.cpp @@ -652,7 +652,10 @@ ioport_field::ioport_field(ioport_port &port, ioport_type type, ioport_value def void ioport_field::set_value(ioport_value value) { - m_digital_value = value != 0; + if (is_analog()) + live().analog->set_value(s32(value)); + else + m_digital_value = value != 0; } @@ -3234,6 +3237,7 @@ analog_field::analog_field(ioport_field &field) m_accum(0), m_previous(0), m_previousanalog(0), + m_prog_analog_value(0), m_minimum(INPUT_ABSOLUTE_MIN), m_maximum(INPUT_ABSOLUTE_MAX), m_center(0), @@ -3248,7 +3252,8 @@ analog_field::analog_field(ioport_field &field) m_autocenter(false), m_single_scale(false), m_interpolate(false), - m_lastdigital(false) + m_lastdigital(false), + m_was_written(false) { // compute the shift amount and number of bits for (ioport_value mask = field.mask(); !(mask & 1); mask >>= 1) @@ -3487,6 +3492,17 @@ s32 analog_field::apply_settings(s32 value) const } +//------------------------------------------------- +// set_value - take a new value to be used +// at next frame update +//------------------------------------------------- + +void analog_field::set_value(s32 value) +{ + m_was_written = true; + m_prog_analog_value = value; +} + //------------------------------------------------- // frame_update - update the internals of a // single analog field periodically @@ -3504,7 +3520,14 @@ void analog_field::frame_update(running_machine &machine) // get the new raw analog value and its type input_item_class itemclass; s32 rawvalue = machine.input().seq_axis_value(m_field.seq(SEQ_TYPE_STANDARD), itemclass); - + + // use programmatically set value if avaiable + if (m_was_written) + { + m_was_written = false; + rawvalue = m_prog_analog_value; + } + // if we got an absolute input, it overrides everything else if (itemclass == ITEM_CLASS_ABSOLUTE) { diff --git a/src/emu/ioport.h b/src/emu/ioport.h index 82834584815..aa0a04bfca8 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -1266,7 +1266,10 @@ public: void read(ioport_value &value); float crosshair_read(); void frame_update(running_machine &machine); - + + // setters + void set_value(s32 value); + private: // helpers s32 apply_min_max(s32 value) const; @@ -1294,6 +1297,7 @@ private: s32 m_accum; // accumulated value (including relative adjustments) s32 m_previous; // previous adjusted value s32 m_previousanalog; // previous analog value + s32 m_prog_analog_value; // programmatically set analog value // parameters for modifying live values s32 m_minimum; // minimum adjusted value @@ -1315,6 +1319,7 @@ private: bool m_single_scale; // scale joystick differently if default is between min/max bool m_interpolate; // should we do linear interpolation for mid-frame reads? bool m_lastdigital; // was the last modification caused by a digital form? + bool m_was_written; // was the last modification caused programmatically? };