From 7dcf0c013f499946cbf050d3560b8b8270744dd4 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 8 Nov 2020 05:43:57 +1100 Subject: emu/devfind.h: Added missing memory_share_array_creator. Also some miscellaneous tidying up. --- docs/source/techspecs/object_finders.rst | 22 ++++++++ src/emu/devfind.h | 2 + src/lib/formats/h8_cas.cpp | 14 ++--- src/mame/drivers/cischeat.cpp | 92 ++++++++++++++++---------------- src/mame/drivers/dreamwld.cpp | 6 +-- src/mame/drivers/gaelco3d.cpp | 4 +- src/mame/drivers/galaxold.cpp | 4 +- src/mame/video/btoads.cpp | 72 +++++++++++++------------ 8 files changed, 121 insertions(+), 95 deletions(-) diff --git a/docs/source/techspecs/object_finders.rst b/docs/source/techspecs/object_finders.rst index 0a47ff7835d..3fd8be922fd 100644 --- a/docs/source/techspecs/object_finders.rst +++ b/docs/source/techspecs/object_finders.rst @@ -343,6 +343,8 @@ finder array types are provided. The object finder array type names have +------------------------+------------------------------+ | optional_shared_ptr | optional_shared_ptr_array | +------------------------+------------------------------+ +| memory_share_creator | memory_share_array_creator | ++------------------------+------------------------------+ A common case for an object array finder is a key matrix:: @@ -435,3 +437,23 @@ brace-enclosed initialiser list of tags:: private: required_device_array m_digits; }; + +If the underlying object finders require additional constructor arguments, +supply them after the tag format and index offset (the same values will be used +for all elements of the array):: + + class dreamwld_state : public driver_device + { + public: + dreamwld_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_vram(*this, "vram_%u", 0U, 0x2000U, ENDIANNESS_BIG) + { + } + + private: + memory_share_array_creator m_vram; + }; + +This finds or creates memory shares with tags ``vram_0`` and ``vram_1``, each of +of which is 8 KiB organised as 4,096 big-Endian 16-bit words. diff --git a/src/emu/devfind.h b/src/emu/devfind.h index 88d47f25aed..885ba479aae 100644 --- a/src/emu/devfind.h +++ b/src/emu/devfind.h @@ -1334,6 +1334,8 @@ protected: endianness_t const m_endianness; }; +template using memory_share_array_creator = object_array_finder, Count>; + //************************************************************************** diff --git a/src/lib/formats/h8_cas.cpp b/src/lib/formats/h8_cas.cpp index 80ad3e07f5a..9cef5b6ef81 100644 --- a/src/lib/formats/h8_cas.cpp +++ b/src/lib/formats/h8_cas.cpp @@ -117,13 +117,13 @@ static int h8_cassette_calculate_size_in_samples(const uint8_t *bytes, int lengt static const cassette_image::LegacyWaveFiller h8_legacy_fill_wave = { - h8_cassette_fill_wave, /* fill_wave */ - -1, /* chunk_size */ - 0, /* chunk_samples */ - h8_cassette_calculate_size_in_samples, /* chunk_sample_calc */ - H8_WAV_FREQUENCY, /* sample_frequency */ - 0, /* header_samples */ - 0 /* trailer_samples */ + h8_cassette_fill_wave, // fill_wave + -1, // chunk_size + 0, // chunk_samples + h8_cassette_calculate_size_in_samples, // chunk_sample_calc + H8_WAV_FREQUENCY, // sample_frequency + 0, // header_samples + 0 // trailer_samples }; static cassette_image::error h8_cassette_identify(cassette_image *cassette, cassette_image::Options *opts) diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp index 493973b97c0..950868c160b 100644 --- a/src/mame/drivers/cischeat.cpp +++ b/src/mame/drivers/cischeat.cpp @@ -223,12 +223,12 @@ void cischeat_state::leds_out_w(offs_t offset, uint16_t data, uint16_t mem_mask) void cischeat_state::bigrun_map(address_map &map) { - map(0x000000, 0x07ffff).rom(); // ROM + map(0x000000, 0x07ffff).rom(); // ROM map(0x080000, 0x080001).portr("IN1").w(FUNC(cischeat_state::leds_out_w)); // Coins map(0x080002, 0x080003).portr("IN2").w(FUNC(cischeat_state::unknown_out_w)); // Buttons map(0x080004, 0x080005).portr("IN3").w(FUNC(cischeat_state::motor_out_w)); // Motor Limit Switches map(0x080006, 0x080007).portr("IN4").w(FUNC(cischeat_state::wheel_out_w)); // DSW 1 & 2 - map(0x080008, 0x080009).r(m_soundlatch2, FUNC(generic_latch_16_device::read)); // From sound cpu + map(0x080008, 0x080009).r(m_soundlatch2, FUNC(generic_latch_16_device::read)); // From sound cpu map(0x08000a, 0x08000b).w(m_soundlatch, FUNC(generic_latch_16_device::write)); // To sound cpu map(0x08000c, 0x08000d).nopw(); // ?? map(0x080010, 0x080011).rw(FUNC(cischeat_state::bigrun_ip_select_r), FUNC(cischeat_state::ip_select_w)); @@ -236,9 +236,9 @@ void cischeat_state::bigrun_map(address_map &map) map(0x082000, 0x082005).rw("scroll0", FUNC(megasys1_tilemap_device::scroll_r), FUNC(megasys1_tilemap_device::scroll_w)); map(0x082008, 0x08200d).rw("scroll1", FUNC(megasys1_tilemap_device::scroll_r), FUNC(megasys1_tilemap_device::scroll_w)); map(0x082100, 0x082105).rw("scroll2", FUNC(megasys1_tilemap_device::scroll_r), FUNC(megasys1_tilemap_device::scroll_w)); - map(0x082108, 0x082109).noprw(); // ? written with 0 only - map(0x082200, 0x082201).portr("IN5"); // DSW 3 (4 bits) - map(0x082208, 0x082209).noprw(); // watchdog reset + map(0x082108, 0x082109).noprw(); // ? written with 0 only + map(0x082200, 0x082201).portr("IN5"); // DSW 3 (4 bits) + map(0x082208, 0x082209).noprw(); // watchdog reset map(0x082308, 0x082309).w(FUNC(cischeat_state::cischeat_comms_w)); map(0x082400, 0x082401).w(FUNC(cischeat_state::active_layers_w)); @@ -252,13 +252,13 @@ void cischeat_state::bigrun_map(address_map &map) /* Only writes to the first 0x40000 bytes affect the tilemaps: */ /* either these games support larger tilemaps or have more ram than needed */ - map(0x090000, 0x093fff).ram().w("scroll0", FUNC(megasys1_tilemap_device::write)).share("scroll0"); // Scroll ram 0 - map(0x094000, 0x097fff).ram().w("scroll1", FUNC(megasys1_tilemap_device::write)).share("scroll1"); // Scroll ram 1 - map(0x098000, 0x09bfff).ram().w("scroll2", FUNC(megasys1_tilemap_device::write)).share("scroll2"); // Scroll ram 2 + map(0x090000, 0x093fff).ram().w("scroll0", FUNC(megasys1_tilemap_device::write)).share("scroll0"); // Scroll ram 0 + map(0x094000, 0x097fff).ram().w("scroll1", FUNC(megasys1_tilemap_device::write)).share("scroll1"); // Scroll ram 1 + map(0x098000, 0x09bfff).ram().w("scroll2", FUNC(megasys1_tilemap_device::write)).share("scroll2"); // Scroll ram 2 - map(0x09c000, 0x09ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palettes - map(0x0f0000, 0x0fffff).ram().share("ram"); // RAM - map(0x100000, 0x13ffff).rom().region("user1", 0); // ROM + map(0x09c000, 0x09ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palettes + map(0x0f0000, 0x0fffff).ram().share("ram"); // RAM + map(0x100000, 0x13ffff).rom().region("user1", 0); // ROM } @@ -310,13 +310,13 @@ void cischeat_state::cischeat_map(address_map &map) /* Only writes to the first 0x40000 bytes affect the tilemaps: */ /* either these games support larger tilemaps or have more ram than needed */ - map(0x0a0000, 0x0a7fff).ram().w("scroll0", FUNC(megasys1_tilemap_device::write)).share("scroll0"); // Scroll ram 0 - map(0x0a8000, 0x0affff).ram().w("scroll1", FUNC(megasys1_tilemap_device::write)).share("scroll1"); // Scroll ram 1 - map(0x0b0000, 0x0b7fff).ram().w("scroll2", FUNC(megasys1_tilemap_device::write)).share("scroll2"); // Scroll ram 2 - map(0x0b8000, 0x0bffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palettes + map(0x0a0000, 0x0a7fff).ram().w("scroll0", FUNC(megasys1_tilemap_device::write)).share("scroll0"); // Scroll ram 0 + map(0x0a8000, 0x0affff).ram().w("scroll1", FUNC(megasys1_tilemap_device::write)).share("scroll1"); // Scroll ram 1 + map(0x0b0000, 0x0b7fff).ram().w("scroll2", FUNC(megasys1_tilemap_device::write)).share("scroll2"); // Scroll ram 2 + map(0x0b8000, 0x0bffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palettes - map(0x0f0000, 0x0fffff).ram().share("ram"); // RAM - map(0x100000, 0x17ffff).rom().region("user1", 0); // ROM + map(0x0f0000, 0x0fffff).ram().share("ram"); // RAM + map(0x100000, 0x17ffff).rom().region("user1", 0); // ROM } @@ -892,18 +892,18 @@ void captflag_state::oki2_map(address_map &map) void cischeat_state::bigrun_map2(address_map &map) { - map(0x000000, 0x03ffff).rom(); // ROM - map(0x040000, 0x043fff).ram().share("share1"); // Shared RAM (with Main CPU) - map(0x080000, 0x0807ff).ram().share("roadram.0"); // Road RAM - map(0x0c0000, 0x0c3fff).ram(); // RAM + map(0x000000, 0x03ffff).rom(); // ROM + map(0x040000, 0x043fff).ram().share("share1"); // Shared RAM (with Main CPU) + map(0x080000, 0x0807ff).ram().share("roadram.0"); // Road RAM + map(0x0c0000, 0x0c3fff).ram(); // RAM } void cischeat_state::bigrun_map3(address_map &map) { - map(0x000000, 0x03ffff).rom(); // ROM - map(0x040000, 0x043fff).ram().share("share2"); // Shared RAM (with Main CPU) - map(0x080000, 0x0807ff).ram().share("roadram.1"); // Road RAM - map(0x0c0000, 0x0c3fff).ram(); // RAM + map(0x000000, 0x03ffff).rom(); // ROM + map(0x040000, 0x043fff).ram().share("share2"); // Shared RAM (with Main CPU) + map(0x080000, 0x0807ff).ram().share("roadram.1"); // Road RAM + map(0x0c0000, 0x0c3fff).ram(); // RAM } @@ -913,22 +913,22 @@ void cischeat_state::bigrun_map3(address_map &map) void cischeat_state::cischeat_map2(address_map &map) { - map(0x000000, 0x03ffff).rom(); // ROM - map(0x040000, 0x047fff).ram().share("share1"); // Shared RAM (with Main CPU) - map(0x080000, 0x0807ff).ram().share("roadram.0"); // Road RAM - map(0x0c0000, 0x0c3fff).ram(); // RAM - map(0x100000, 0x100001).nopw(); // watchdog - map(0x200000, 0x23ffff).rom().region("cpu2", 0x40000); // ROM + map(0x000000, 0x03ffff).rom(); // ROM + map(0x040000, 0x047fff).ram().share("share1"); // Shared RAM (with Main CPU) + map(0x080000, 0x0807ff).ram().share("roadram.0"); // Road RAM + map(0x0c0000, 0x0c3fff).ram(); // RAM + map(0x100000, 0x100001).nopw(); // watchdog + map(0x200000, 0x23ffff).rom().region("cpu2", 0x40000); // ROM } void cischeat_state::cischeat_map3(address_map &map) { - map(0x000000, 0x03ffff).rom(); // ROM - map(0x040000, 0x047fff).ram().share("share2"); // Shared RAM (with Main CPU) - map(0x080000, 0x0807ff).ram().share("roadram.1"); // Road RAM - map(0x0c0000, 0x0c3fff).ram(); // RAM - map(0x100000, 0x100001).nopw(); // watchdog - map(0x200000, 0x23ffff).rom().region("cpu3", 0x40000); // ROM + map(0x000000, 0x03ffff).rom(); // ROM + map(0x040000, 0x047fff).ram().share("share2"); // Shared RAM (with Main CPU) + map(0x080000, 0x0807ff).ram().share("roadram.1"); // Road RAM + map(0x0c0000, 0x0c3fff).ram(); // RAM + map(0x100000, 0x100001).nopw(); // watchdog + map(0x200000, 0x23ffff).rom().region("cpu3", 0x40000); // ROM } @@ -939,20 +939,20 @@ void cischeat_state::cischeat_map3(address_map &map) void cischeat_state::f1gpstar_map2(address_map &map) { - map(0x000000, 0x03ffff).rom(); // ROM - map(0x080000, 0x087fff).ram().share("share1"); // Shared RAM (with Main CPU) + map(0x000000, 0x03ffff).rom(); // ROM + map(0x080000, 0x087fff).ram().share("share1"); // Shared RAM (with Main CPU) map(0x100000, 0x1007ff).ram().share("roadram.0"); // Road RAM - map(0x180000, 0x183fff).ram(); // RAM - map(0x200000, 0x200001).nopw(); // watchdog + map(0x180000, 0x183fff).ram(); // RAM + map(0x200000, 0x200001).nopw(); // watchdog } void cischeat_state::f1gpstar_map3(address_map &map) { - map(0x000000, 0x03ffff).rom(); // ROM - map(0x080000, 0x087fff).ram().share("share2"); // Shared RAM (with Main CPU) - map(0x100000, 0x1007ff).ram().share("roadram.1"); // Road RAM - map(0x180000, 0x183fff).ram(); // RAM - map(0x200000, 0x200001).nopw(); // watchdog + map(0x000000, 0x03ffff).rom(); // ROM + map(0x080000, 0x087fff).ram().share("share2"); // Shared RAM (with Main CPU) + map(0x100000, 0x1007ff).ram().share("roadram.1"); // Road RAM + map(0x180000, 0x183fff).ram(); // RAM + map(0x200000, 0x200001).nopw(); // watchdog } diff --git a/src/mame/drivers/dreamwld.cpp b/src/mame/drivers/dreamwld.cpp index c7b0257521b..a50a0344830 100644 --- a/src/mame/drivers/dreamwld.cpp +++ b/src/mame/drivers/dreamwld.cpp @@ -120,10 +120,10 @@ public: dreamwld_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_spriteram(*this, "spriteram") - , m_vram{{*this, "vram_0", 0x2000, ENDIANNESS_BIG}, {*this, "vram_1", 0x2000, ENDIANNESS_BIG}} + , m_vram(*this, "vram_%u", 0U, 0x2000U, ENDIANNESS_BIG) , m_vregs(*this, "vregs") , m_workram(*this, "workram") - , m_lineram(*this, "lineram", 0x400, ENDIANNESS_BIG) + , m_lineram(*this, "lineram", 0x400U, ENDIANNESS_BIG) , m_spritelut(*this, "spritelut") , m_okibank(*this, "oki%ubank", 1) , m_dsw(*this, "DSW") @@ -146,7 +146,7 @@ protected: private: /* memory pointers */ required_shared_ptr m_spriteram; - memory_share_creator m_vram[2]; + memory_share_array_creator m_vram; required_shared_ptr m_vregs; required_shared_ptr m_workram; memory_share_creator m_lineram; diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp index f3a62214a7a..5c5b9b60135 100644 --- a/src/mame/drivers/gaelco3d.cpp +++ b/src/mame/drivers/gaelco3d.cpp @@ -378,7 +378,7 @@ WRITE_LINE_MEMBER(gaelco3d_state::fp_analog_clock_w) uint32_t gaelco3d_state::tms_m68k_ram_r(offs_t offset) { // logerror("%s:tms_m68k_ram_r(%04X) = %08X\n", machine().describe_context(), offset, !(offset & 1) ? ((int32_t)m_m68k_ram_base[offset/2] >> 16) : (int)(int16_t)m_m68k_ram_base[offset/2]); - if(offset & 1) + if (offset & 1) return (int32_t)(int16_t)m_m68k_ram_base[offset >> 1]; else return (int32_t)(int16_t)(m_m68k_ram_base[offset >> 1] >> 16); @@ -387,7 +387,7 @@ uint32_t gaelco3d_state::tms_m68k_ram_r(offs_t offset) void gaelco3d_state::tms_m68k_ram_w(offs_t offset, uint32_t data) { - if(offset & 1) + if (offset & 1) m_m68k_ram_base[offset >> 1] = (m_m68k_ram_base[offset >> 1] & 0xffff0000) | (data & 0xffff); else m_m68k_ram_base[offset >> 1] = (m_m68k_ram_base[offset >> 1] & 0xffff) | (data << 16); diff --git a/src/mame/drivers/galaxold.cpp b/src/mame/drivers/galaxold.cpp index bcb4be88dc7..9e0d6b622f4 100644 --- a/src/mame/drivers/galaxold.cpp +++ b/src/mame/drivers/galaxold.cpp @@ -446,7 +446,7 @@ void galaxold_state::guttang_rombank_w(uint8_t data) { address_space &space = m_maincpu->space(AS_PROGRAM); // printf("rombank %02x\n",data); - space.install_rom( 0x2000, 0x27ff, memregion("maincpu")->base() + (data & 1 ? 0x4000 : 0x2000)); + space.install_rom(0x2000, 0x27ff, memregion("maincpu")->base() + (data & 1 ? 0x4000 : 0x2000)); } @@ -3779,7 +3779,7 @@ ROM_END void galaxold_state::init_guttangt() { - m_maincpu->space(AS_PROGRAM).install_rom( 0x2000, 0x27ff, memregion("maincpu")->base() + 0x2000); + m_maincpu->space(AS_PROGRAM).install_rom(0x2000, 0x27ff, memregion("maincpu")->base() + 0x2000); } diff --git a/src/mame/video/btoads.cpp b/src/mame/video/btoads.cpp index 5c765e3719d..01e63b5969a 100644 --- a/src/mame/video/btoads.cpp +++ b/src/mame/video/btoads.cpp @@ -24,7 +24,7 @@ void btoads_state::video_start() { - /* initialize the swapped pointers */ + // initialize the swapped pointers m_vram_fg_draw = m_vram_fg0; m_vram_fg_display = m_vram_fg1; @@ -51,7 +51,7 @@ void btoads_state::misc_control_w(offs_t offset, uint16_t data, uint16_t mem_mas { COMBINE_DATA(&m_misc_control); - /* bit 3 controls sound reset line */ + // bit 3 controls sound reset line m_audiocpu->set_input_line(INPUT_LINE_RESET, (m_misc_control & 8) ? CLEAR_LINE : ASSERT_LINE); } @@ -60,12 +60,12 @@ void btoads_state::display_control_w(offs_t offset, uint16_t data, uint16_t mem_ { if (ACCESSING_BITS_8_15) { - /* allow multiple changes during display */ + // allow multiple changes during display int scanline = m_screen->vpos(); if (scanline > 0) m_screen->update_partial(scanline - 1); - /* bit 15 controls which page is rendered and which page is displayed */ + // bit 15 controls which page is rendered and which page is displayed if (data & 0x8000) { m_vram_fg_draw = m_vram_fg1; @@ -77,7 +77,7 @@ void btoads_state::display_control_w(offs_t offset, uint16_t data, uint16_t mem_ m_vram_fg_display = m_vram_fg1; } - /* stash the remaining data for later */ + // stash the remaining data for later m_screen_control = data >> 8; } } @@ -92,11 +92,11 @@ void btoads_state::display_control_w(offs_t offset, uint16_t data, uint16_t mem_ void btoads_state::scroll0_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - /* allow multiple changes during display */ + // allow multiple changes during display // m_screen->update_now(); m_screen->update_partial(m_screen->vpos()); - /* upper bits are Y scroll, lower bits are X scroll */ + // upper bits are Y scroll, lower bits are X scroll if (ACCESSING_BITS_8_15) m_yscroll0 = data >> 8; if (ACCESSING_BITS_0_7) @@ -106,11 +106,11 @@ void btoads_state::scroll0_w(offs_t offset, uint16_t data, uint16_t mem_mask) void btoads_state::scroll1_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - /* allow multiple changes during display */ + // allow multiple changes during display // m_screen->update_now(); m_screen->update_partial(m_screen->vpos()); - /* upper bits are Y scroll, lower bits are X scroll */ + // upper bits are Y scroll, lower bits are X scroll if (ACCESSING_BITS_8_15) m_yscroll1 = data >> 8; if (ACCESSING_BITS_0_7) @@ -200,9 +200,9 @@ void btoads_state::render_sprite_row(uint16_t *sprite_source, uint32_t address) int dststep = 0x100 - (m_sprite_scale[4] & 0xffff); int dstoffs = m_sprite_dest_offs << 8; - /* non-shadow case */ if (!(m_misc_control & 0x10)) { + // non-shadow case for ( ; srcoffs < srcend; srcoffs += srcstep, dstoffs += dststep) { uint16_t src = sprite_source[(srcoffs >> 10) & 0x1ff]; @@ -214,10 +214,9 @@ void btoads_state::render_sprite_row(uint16_t *sprite_source, uint32_t address) } } } - - /* shadow case */ else { + // shadow case for ( ; srcoffs < srcend; srcoffs += srcstep, dstoffs += dststep) { uint16_t src = sprite_source[(srcoffs >> 10) & 0x1ff]; @@ -246,30 +245,30 @@ TMS340X0_TO_SHIFTREG_CB_MEMBER(btoads_state::to_shiftreg) { address &= ~0x40000000; - /* reads from this first region are usual shift register reads */ if (address >= 0xa0000000 && address <= 0xa3ffffff) + { + // reads from this first region are usual shift register reads memcpy(shiftreg, &m_vram_fg_display[(address & 0x3fffff) >> 4], 0x200); - - /* reads from this region set the sprite destination address */ + } else if (address >= 0xa4000000 && address <= 0xa7ffffff) { + // reads from this region set the sprite destination address m_sprite_dest_base = &m_vram_fg_draw[(address & 0x3fc000) >> 4]; m_sprite_dest_offs = (address & 0x003fff) >> 5; } - - /* reads from this region set the sprite source address */ else if (address >= 0xa8000000 && address <= 0xabffffff) { + // reads from this region set the sprite source address const u32 *src = &m_vram_fg_data[(address & 0x7fc000) >> 5]; u16 *dest = shiftreg; - for(unsigned int i=0; i != 0x100; i++) { + for (unsigned int i = 0; i != 0x100; i++) + { *dest++ = *src; *dest++ = *src >> 16; src++; } m_sprite_source_offs = (address & 0x003fff) >> 3; } - else logerror("%s:btoads_to_shiftreg(%08X)\n", machine().describe_context(), address); } @@ -279,28 +278,32 @@ TMS340X0_FROM_SHIFTREG_CB_MEMBER(btoads_state::from_shiftreg) { address &= ~0x40000000; - /* writes to this first region are usual shift register writes */ if (address >= 0xa0000000 && address <= 0xa3ffffff) + { + // writes to this first region are usual shift register writes memcpy(&m_vram_fg_display[(address & 0x3fc000) >> 4], shiftreg, 0x200); - - /* writes to this region are ignored for our purposes */ + } else if (address >= 0xa4000000 && address <= 0xa7ffffff) - ; - - /* writes to this region copy standard data */ - else if (address >= 0xa8000000 && address <= 0xabffffff) { + { + // writes to this region are ignored for our purposes + } + else if (address >= 0xa8000000 && address <= 0xabffffff) + { + // writes to this region copy standard data const u16 *src = shiftreg; u32 *dest = &m_vram_fg_data[(address & 0x7fc000) >> 5]; - for(unsigned int i=0; i != 0x100; i++) { + for (unsigned int i = 0; i != 0x100; i++) + { *dest++ = src[0] | (src[1] << 16); src += 2; } memcpy(&m_vram_fg_data[(address & 0x7fc000) >> 4], shiftreg, 0x400); - - /* writes to this region render the current sprite data */ - } else if (address >= 0xac000000 && address <= 0xafffffff) + } + else if (address >= 0xac000000 && address <= 0xafffffff) + { + // writes to this region render the current sprite data render_sprite_row(shiftreg, address); - + } else logerror("%s:btoads_from_shiftreg(%08X)\n", machine().describe_context(), address); } @@ -498,7 +501,7 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(btoads_state::scanline_update) char name[10]; FILE *f; - while (machine().input().code_pressed(KEYCODE_X)) ; + while (machine().input().code_pressed(KEYCODE_X)) { } sprintf(name, "disp%d.log", m_xcount++); f = fopen(name, "w"); @@ -509,12 +512,11 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(btoads_state::scanline_update) uint16_t *base = (i == 0) ? (uint16_t *)m_vram_fg_display : (i == 1) ? m_vram_bg0 : m_vram_bg1; int xscr = (i == 0) ? 0 : (i == 1) ? m_xscroll0 : m_xscroll1; int yscr = (i == 0) ? 0 : (i == 1) ? m_yscroll0 : m_yscroll1; - int y; - for (y = 0; y < 224; y++) + for (int y = 0; y < 224; y++) { uint32_t offs = ((y + yscr) & 0xff) * TOWORD(0x4000); - for (x = 0; x < 256; x++) + for (int x = 0; x < 256; x++) { uint16_t pix = base[offs + ((x + xscr) & 0xff)]; fprintf(f, "%02X%02X", pix & 0xff, pix >> 8); -- cgit v1.2.3