summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2020-03-10 18:21:10 +1100
committer Vas Crabb <vas@vastheman.com>2020-03-10 18:21:10 +1100
commit9c600695f0ed4456270bf5f1676b8fadaed34127 (patch)
tree1e52fb8b786e9bece80b05e2f583bba207f5af7c /src/mame
parentcc70fe02bacdf8dc17fe75065e387276c8056e5e (diff)
(nw) Cleanup on the way:
* Add doxygen comments for bit manipulation functions * Add an overload of BIT that works like the AArch64 UBFX instruction * Kill off some of the silly concatenating overloads for emu_file::open * Make searchpath acually useful for devices This is a checkpoint - I'm planning to improve ROM loading behaviour at least a little.
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/chihiro.cpp2
-rw-r--r--src/mame/drivers/esq1.cpp2
-rw-r--r--src/mame/video/dooyong.cpp22
3 files changed, 13 insertions, 13 deletions
diff --git a/src/mame/drivers/chihiro.cpp b/src/mame/drivers/chihiro.cpp
index a55d8bb0a18..8bbdd7f4ed0 100644
--- a/src/mame/drivers/chihiro.cpp
+++ b/src/mame/drivers/chihiro.cpp
@@ -1842,7 +1842,7 @@ void chihiro_state::machine_start()
}
m_hack_index = -1;
for (int a = 1; a < HACK_ITEMS; a++)
- if (strcmp(machine().basename(), hacks[a].game_name) == 0) {
+ if (machine().basename() == hacks[a].game_name) {
m_hack_index = a;
break;
}
diff --git a/src/mame/drivers/esq1.cpp b/src/mame/drivers/esq1.cpp
index b212bff0c3d..87b2fda19dd 100644
--- a/src/mame/drivers/esq1.cpp
+++ b/src/mame/drivers/esq1.cpp
@@ -580,7 +580,7 @@ void esq1_state::send_through_panel(uint8_t data)
INPUT_CHANGED_MEMBER(esq1_state::key_stroke)
{
u8 offset = 0;
- if (strncmp(machine().basename(), "sq80", 4) == 0)
+ if (strncmp(machine().basename().c_str(), "sq80", 4) == 0)
{
if (!kpc_calibrated)
{ // ack SQ80 keyboard calibration
diff --git a/src/mame/video/dooyong.cpp b/src/mame/video/dooyong.cpp
index daeb0068293..634b974bed6 100644
--- a/src/mame/video/dooyong.cpp
+++ b/src/mame/video/dooyong.cpp
@@ -9,11 +9,11 @@
/* These games all have ROM-based tilemaps for the backgrounds, title
screens and sometimes "bosses" and special attacks. There are three
schemes for tilemap encoding. The scheme is chosen based on the
- contents of the tilemap control variables declared above.
+ contents of the tilemap control variables.
Note that although the tilemaps are arbitrarily wide (hundreds of
thousands of pixels, depending on the size of the ROM), we only
decode a 1024 pixel wide block at a time, and invalidate the tilemap
- when the x scroll moves out of range (trying to decode the whole lot
+ when the X scroll moves out of range (trying to decode the whole lot
at once uses hundreds of megabytes of RAM). */
DEFINE_DEVICE_TYPE(DOOYONG_ROM_TILEMAP, dooyong_rom_tilemap_device, "dooyong_rom_tilemap", "Dooyong ROM Tilemap")
@@ -80,14 +80,14 @@ void dooyong_rom_tilemap_device::ctrl_w(offs_t offset, u8 data)
m_registers[offset] = data;
switch (offset)
{
- case 0: // Low byte of x scroll - scroll tilemap
+ case 0: // Low byte of X scroll - scroll tilemap
m_tilemap->set_scrollx(0, data);
break;
- case 1: // High byte of x scroll - mark tilemap dirty so new tile gfx will be loaded
+ case 1: // High byte of X scroll - mark tilemap dirty so new tile gfx will be loaded
m_tilemap->mark_all_dirty();
break;
- case 3: // Low byte of y scroll
- case 4: // High byte of y scroll
+ case 3: // Low byte of Y scroll
+ case 4: // High byte of Y scroll
m_tilemap->set_scrolly(0, m_registers[3] | (unsigned(m_registers[4]) << 8));
break;
case 6: // Tilemap enable and mode control
@@ -150,8 +150,8 @@ TILE_GET_INFO_MEMBER(dooyong_rom_tilemap_device::tile_info)
// X = x flip
// Y = y flip
code = (BIT(attr, 15) << 9) | (attr & 0x01ff);
- color = (attr >> 11) & 0x0fU;
- flags = TILE_FLIPYX((attr >> 9) & 0x03U);
+ color = BIT(attr, 11, 4);
+ flags = TILE_FLIPYX(BIT(attr, 9, 2));
}
else
{ // bluehawk/primella/popbingo
@@ -171,10 +171,10 @@ TILE_GET_INFO_MEMBER(dooyong_rom_tilemap_device::tile_info)
else // just mimic old driver behavior (default configuration)
{
code = attr & 0x3ff;
- color = (attr & 0x3c00) >> 10;
+ color = BIT(attr, 10, 4);
}
- flags = TILE_FLIPYX((attr >> 14) & 0x03U);
+ flags = TILE_FLIPYX(BIT(attr, 14, 2));
}
color |= m_palette_bank;
@@ -261,5 +261,5 @@ TILE_GET_INFO_MEMBER(dooyong_ram_tilemap_device::tile_info)
// c = gfx code
// C = color code
const u16 attr(m_tileram[tile_index]);
- tileinfo.set(m_gfxnum, attr & 0x0fffU, m_palette_bank | ((attr >> 12) & 0x0fU), 0);
+ tileinfo.set(m_gfxnum, attr & 0x0fffU, m_palette_bank | BIT(attr, 12, 4), 0);
}