diff options
| author | 2022-08-29 11:27:13 +1000 | |
|---|---|---|
| committer | 2022-08-29 11:27:13 +1000 | |
| commit | dacf1cb225c0cace53d460db5c67450fc26edede (patch) | |
| tree | e894f8e9e37fe94f8cca39a81b451b35953b0112 | |
| parent | 15b98b8a189b44e6326471b3fae98ea59edb6f2c (diff) | |
| parent | 42391bbb6be913c407933ad064eb31fe63afbcb8 (diff) | |
Merge branch 'release0247' into mainline-master
| -rw-r--r-- | hash/myvision.xml | 8 | ||||
| -rw-r--r-- | src/devices/cpu/mn1610/mn1610d.cpp | 9 | ||||
| -rw-r--r-- | src/devices/sound/pokey.cpp | 16 | ||||
| -rw-r--r-- | src/mame/apple/mactoolbox.h | 10 | ||||
| -rw-r--r-- | src/mame/misc/monon_color.cpp | 62 | ||||
| -rw-r--r-- | src/mame/sega/deniam.cpp | 6 | ||||
| -rw-r--r-- | src/mame/taito/chaknpop.cpp | 2 |
7 files changed, 69 insertions, 44 deletions
diff --git a/hash/myvision.xml b/hash/myvision.xml index ff0e0ca61ea..0274a1b83ce 100644 --- a/hash/myvision.xml +++ b/hash/myvision.xml @@ -2,6 +2,10 @@ <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> <!-- license:CC0 + + Undumped games: + - Mastermind (マスターマインド) 1983, Logitec Corp. + - Reversi (リバーシ) 1983, Logitec Corp. --> <softwarelist name="myvision" description="Nichibutsu My Vision cartridges"> @@ -9,6 +13,7 @@ license:CC0 <description>Gomoku Narabe Renju</description> <year>1983</year> <publisher>Nihonbussan</publisher> + <info name="alt_title" value="五目並べ" /> <info name="label" value="CORTRIDGE LT-0319953" /> <info name="pcb" value="KH-1001-A" /> <part name="cart" interface="myvision_cart"> @@ -23,6 +28,7 @@ license:CC0 <description>Hanafuda</description> <year>1983</year> <publisher>Logitec Corp.</publisher> + <info name="alt_title" value="花札" /> <info name="label" value="CORTRIDGE LT-0730853" /> <info name="pcb" value="KH-1001-A" /> <part name="cart" interface="myvision_cart"> @@ -38,6 +44,7 @@ license:CC0 <description>Mahjong Nichibutsu</description> <year>1983</year> <publisher>Nihonbussan</publisher> + <info name="alt_title" value="マージャン" /> <info name="label" value="CORTRIDGE LT-0334653" /> <info name="pcb" value="KH-1001-A" /> <part name="cart" interface="myvision_cart"> @@ -53,6 +60,7 @@ license:CC0 <description>Tsumeshougi</description> <year>1983</year> <publisher>Logitec Corp.</publisher> + <info name="alt_title" value="詰将棋" /> <info name="label" value="CORTRIDGE LT-0594253" /> <info name="pcb" value="KH-1001-A" /> <part name="cart" interface="myvision_cart"> diff --git a/src/devices/cpu/mn1610/mn1610d.cpp b/src/devices/cpu/mn1610/mn1610d.cpp index f04b40f1378..83e87669c84 100644 --- a/src/devices/cpu/mn1610/mn1610d.cpp +++ b/src/devices/cpu/mn1610/mn1610d.cpp @@ -14,6 +14,8 @@ #include "mn1610d.h" +namespace { + char const *const reg[] = { "r0", "r1", "r2", "r3", "r4", "sp", "str", "ic" }; enum operand_type : unsigned @@ -54,7 +56,7 @@ struct instruction u32 flags; }; -static const struct instruction mn1610_table[] = +const struct instruction mn1610_table[] = { // memory { 0xc700, 0xc700, "b", { EA } }, // 11mm m111 nnnn nnnn @@ -109,7 +111,7 @@ static const struct instruction mn1610_table[] = }; // opcodes are sorted in descending order of number of bits in mask to ensure correct decoding -static const struct instruction mn1613_table[] = +const struct instruction mn1613_table[] = { { 0x1707, 0xffff, "popm", { } }, // 0001 0111 0000 0111 { 0x170f, 0xffff, "pshm", { } }, // 0001 0111 0000 1111 @@ -195,6 +197,9 @@ static const struct instruction mn1613_table[] = { 0x1f00, 0xff00, "neg", { Rs, C, SK } }, // 0001 1111 kkkk cddd }; +} // anonymous namespace + + std::optional<std::string> mn1610_disassembler::operand(unsigned t, u16 pc, u16 data) { char const *const ee[] = { nullptr, "re", "se", "ce" }; diff --git a/src/devices/sound/pokey.cpp b/src/devices/sound/pokey.cpp index 11bf0bc3158..fbe88a924cc 100644 --- a/src/devices/sound/pokey.cpp +++ b/src/devices/sound/pokey.cpp @@ -1196,16 +1196,16 @@ void pokey_device::poly_init_9_17(uint32_t *poly, int size) { LOG_RAND(("rand %d\n", size)); - int mask = (1 << size) - 1; + const uint32_t mask = util::make_bitmask<uint32_t>(size); uint32_t lfsr = mask; if (size == 17) { - for (int i = 0; i < mask; i++) + for (uint32_t i = 0; i < mask; i++) { - /* calculate next bit @ 7 */ - int in8 = ((lfsr >> 8) & 1) ^ ((lfsr >> 13) & 1); - int in = (lfsr & 1); + // calculate next bit @ 7 + const uint32_t in8 = BIT(lfsr, 8) ^ BIT(lfsr, 13); + const uint32_t in = BIT(lfsr, 0); lfsr = lfsr >> 1; lfsr = (lfsr & 0xff7f) | (in8 << 7); lfsr = (in << 16) | lfsr; @@ -1216,10 +1216,10 @@ void pokey_device::poly_init_9_17(uint32_t *poly, int size) } else // size == 9 { - for (int i = 0; i < mask; i++) + for (uint32_t i = 0; i < mask; i++) { - /* calculate next bit */ - int in = ((lfsr >> 0) & 1) ^ ((lfsr >> 5) & 1); + // calculate next bit + const uint32_t in = BIT(lfsr, 0) ^ BIT(lfsr, 5); lfsr = lfsr >> 1; lfsr = (in << 8) | lfsr; *poly = lfsr; diff --git a/src/mame/apple/mactoolbox.h b/src/mame/apple/mactoolbox.h index 51a7f4955cc..6f16ac60ce7 100644 --- a/src/mame/apple/mactoolbox.h +++ b/src/mame/apple/mactoolbox.h @@ -6,6 +6,16 @@ #pragma once + +// older versions of libc++ are missing deduction guides that the things using this require +// FIXME: find a better place to put this +#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION < 10000) +namespace std { inline namespace __1 { +template<class R, class... ArgTypes > function( R(*)(ArgTypes...) ) -> function<R(ArgTypes...)>; +} } +#endif + + extern offs_t mac68k_dasm_override(std::ostream &stream, offs_t pc, const util::disasm_interface::data_buffer &opcodes, const util::disasm_interface::data_buffer ¶ms); #endif // MAME_APPLE_MACTOOLBOX_H diff --git a/src/mame/misc/monon_color.cpp b/src/mame/misc/monon_color.cpp index 177654a34b6..0aaa364022d 100644 --- a/src/mame/misc/monon_color.cpp +++ b/src/mame/misc/monon_color.cpp @@ -96,8 +96,10 @@ protected: // screen updates uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); -private: +private: + static constexpr unsigned VIDEO_WIDTH = 320; + static constexpr unsigned VIDEO_HEIGHT = 240; required_device<mononcol_cartslot_device> m_cart; required_device<ax208_cpu_device> m_maincpu; @@ -109,6 +111,21 @@ private: required_ioport_array<4> m_debugin; required_ioport_array<4> m_controls; + rgb_t m_linebuf[VIDEO_HEIGHT]; + std::unique_ptr<rgb_t[]> m_vidbuffer; + int16_t m_bufpos_y; + uint32_t m_bufpos_x; + uint8_t m_storeregs[0x20]; + uint8_t m_dacbyte; + + uint8_t m_out4data; + uint8_t m_out3data; + uint8_t m_out2data; + uint8_t m_out1data; + uint8_t m_out0data; + + uint8_t m_curpal[0x800 * 3]; + void music_mem(address_map &map); uint8_t music_rts_r(); @@ -156,26 +173,11 @@ private: void do_draw_inner(int pal_to_use, int start, int step, int pixmask, int amount); void do_draw(int amount, int pal_to_use); void do_palette(int amount, int pal_to_use); - - rgb_t m_linebuf[240]; - std::unique_ptr<rgb_t[]> m_vidbuffer; - int16_t m_bufpos_y; - uint32_t m_bufpos_x; - uint8_t m_storeregs[0x20]; - uint8_t m_dacbyte; - - uint8_t m_out4data; - uint8_t m_out3data; - uint8_t m_out2data; - uint8_t m_out1data; - uint8_t m_out0data; - - uint8_t m_curpal[0x800 * 3]; }; void monon_color_state::machine_start() { - m_vidbuffer = std::make_unique<rgb_t[]>(320 * 240); + m_vidbuffer = std::make_unique<rgb_t[]>(VIDEO_WIDTH * VIDEO_HEIGHT); save_item(NAME(m_dacbyte)); save_item(NAME(m_out4data)); @@ -184,7 +186,7 @@ void monon_color_state::machine_start() save_item(NAME(m_out1data)); save_item(NAME(m_out0data)); save_item(NAME(m_linebuf)); - save_pointer(NAME(m_vidbuffer), 320 * 240); + save_pointer(NAME(m_vidbuffer), VIDEO_WIDTH * VIDEO_HEIGHT); save_item(NAME(m_bufpos_x)); save_item(NAME(m_bufpos_y)); save_item(NAME(m_curpal)); @@ -225,8 +227,10 @@ void monon_color_state::machine_reset() m_bufpos_x = 0; m_bufpos_y = 239; - std::fill(std::begin(m_storeregs), std::end(m_storeregs), 0); std::fill(std::begin(m_linebuf), std::end(m_linebuf), 0); + std::fill_n(m_vidbuffer.get(), VIDEO_WIDTH * VIDEO_HEIGHT, 0); + std::fill(std::begin(m_storeregs), std::end(m_storeregs), 0); + std::fill(std::begin(m_curpal), std::end(m_curpal), 0); m_music_direction_iswrite = true; m_music_latch = 0; @@ -242,12 +246,12 @@ void monon_color_state::machine_reset() uint32_t monon_color_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - rgb_t* videoram = m_vidbuffer.get(); + rgb_t const *videoram = m_vidbuffer.get(); - for (int y = 0; y < 240; y++) + for (int y = 0; y < VIDEO_HEIGHT; y++) { - int count = (y * 320); - for(int x = 0; x < 320; x++) + int count = y * VIDEO_WIDTH; + for(int x = 0; x < VIDEO_WIDTH; x++) { rgb_t pixel = videoram[count++]; bitmap.pix(y, x) = pixel; @@ -678,7 +682,7 @@ void monon_color_state::do_draw_inner(int pal_to_use, int start, int step, int p { int real_ypos = m_bufpos_y; real_ypos -= yadjust; - if ((real_ypos >= 0) && (real_ypos < 240)) + if ((real_ypos >= 0) && (real_ypos < VIDEO_HEIGHT)) { uint8_t pixx = (pix >> i) & pixmask; uint8_t newr = m_curpal[((pixx + pal_to_use) * 3) + 2]; @@ -833,7 +837,7 @@ void monon_color_state::write_to_video_device(uint8_t data) LOGMASKED(LOG_VDP, "Finished Column %d\n", m_bufpos_x); m_bufpos_x++; - if (m_bufpos_x == 320) + if (m_bufpos_x == VIDEO_WIDTH) { LOGMASKED(LOG_VDP, "------------------------------------------------------------------------------------------------\n"); m_bufpos_x = 0; @@ -880,8 +884,8 @@ void monon_color_state::write_to_video_device(uint8_t data) else if ((data == 0xd0) || (data == 0xd4)) { // assume there's some kind of line column buffer, the exact swap trigger is unknown - for (int i = 0; i < 240; i++) - m_vidbuffer[(i * 320) + m_bufpos_x] = m_linebuf[i]; + for (int i = 0; i < VIDEO_HEIGHT; i++) + m_vidbuffer[(i * VIDEO_WIDTH) + m_bufpos_x] = m_linebuf[i]; } } } @@ -952,8 +956,8 @@ void monon_color_state::monon_color(machine_config &config) m_screen->set_refresh_hz(120); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); m_screen->set_screen_update(FUNC(monon_color_state::screen_update)); - m_screen->set_size(320, 240); - m_screen->set_visarea(0*8, 320-1, 0*8, 240-1); + m_screen->set_size(VIDEO_WIDTH, VIDEO_HEIGHT); + m_screen->set_visarea(0*8, VIDEO_WIDTH-1, 0*8, VIDEO_HEIGHT-1); PALETTE(config, m_palette).set_entries(0x800); diff --git a/src/mame/sega/deniam.cpp b/src/mame/sega/deniam.cpp index 73527138f34..81b596e929c 100644 --- a/src/mame/sega/deniam.cpp +++ b/src/mame/sega/deniam.cpp @@ -113,7 +113,7 @@ private: required_shared_ptr<u16> m_textram; required_shared_ptr<u16> m_spriteram; - required_memory_region m_spritegfx; + required_region_ptr<u8> m_spritegfx; // video-related tilemap_t *m_fg_tilemap = nullptr; @@ -353,8 +353,6 @@ void deniamc_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co { for (int offs = m_spriteram.bytes() / 2 - 8; offs >= 0; offs -= 8) { - u8 *rom = m_spritegfx->base(); - int sx = (m_spriteram[offs + 1] & 0x01ff) + 16 * 8 - 1; if (sx >= 512) sx -= 512; const int starty = m_spriteram[offs + 0] & 0xff; @@ -376,7 +374,7 @@ void deniamc_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co } const int start = m_spriteram[offs + 3] + ((m_spriteram[offs + 4] & 0x1f00) << 8); - rom += 2 * start; + const u8 *rom = &m_spritegfx[2 * start]; for (int y = starty + 1; y <= endy; y++) { diff --git a/src/mame/taito/chaknpop.cpp b/src/mame/taito/chaknpop.cpp index eac17698208..add343b225e 100644 --- a/src/mame/taito/chaknpop.cpp +++ b/src/mame/taito/chaknpop.cpp @@ -390,7 +390,7 @@ void chaknpop_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } - m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, + m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, tile, color, flipx, flipy, |
