Tidied up some recent changes.

This commit is contained in:
Vas Crabb 2024-05-16 05:48:07 +10:00
parent d7d37c03fe
commit ed77088c17
12 changed files with 248 additions and 222 deletions

View File

@ -119,7 +119,7 @@ protected:
optional_memory_bank m_mainbank; optional_memory_bank m_mainbank;
private: private:
static constexpr XTAL MIDZEUS_VIDEO_CLOCK = XTAL(66'666'700); static inline constexpr XTAL MIDZEUS_VIDEO_CLOCK = 66.6667_MHz_XTAL;
void exit_handler(); void exit_handler();
void zeus_pointer_w(uint32_t which, uint32_t data, bool logit); void zeus_pointer_w(uint32_t which, uint32_t data, bool logit);

View File

@ -346,26 +346,26 @@ uint32_t midzeus_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
uint32_t midzeus_state::zeus_r(offs_t offset) uint32_t midzeus_state::zeus_r(offs_t offset)
{ {
bool logit = ((!machine().side_effects_disabled()) && (offset < 0xb0 || offset > 0xb7)); bool logit = !machine().side_effects_disabled() && ((offset < 0xb0) || (offset > 0xb7));
uint32_t result = m_zeusbase[offset & ~1]; uint32_t result = m_zeusbase[offset & ~1];
switch (offset & ~1) switch (offset & ~1)
{ {
case 0xf0: case 0xf0:
result = m_screen->hpos(); result = m_screen->hpos();
logit = 0; logit = false;
break; break;
case 0xf2: case 0xf2:
result = m_screen->vpos(); result = m_screen->vpos();
logit = 0; logit = false;
break; break;
case 0xf4: case 0xf4:
result = 6; result = 6;
if (m_screen->vblank()) if (m_screen->vblank())
result |= 0x800; result |= 0x800;
logit = 0; logit = false;
break; break;
case 0xf6: // status -- they wait for this & 9 == 0 case 0xf6: // status -- they wait for this & 9 == 0
@ -373,13 +373,13 @@ uint32_t midzeus_state::zeus_r(offs_t offset)
result = 0x9600; result = 0x9600;
if (m_zeusbase[0xb6] == 0x80040000) if (m_zeusbase[0xb6] == 0x80040000)
result |= 1; result |= 1;
logit = 0; logit = false;
break; break;
} }
// 32-bit mode
if (m_zeusbase[0x80] & 0x00020000) if (m_zeusbase[0x80] & 0x00020000)
{ {
// 32-bit mode
if (offset & 1) if (offset & 1)
result >>= 16; result >>= 16;
if (logit) if (logit)
@ -392,10 +392,9 @@ uint32_t midzeus_state::zeus_r(offs_t offset)
LOGZEUS("%06X:zeus32_r(%02X) = %08X\n", m_maincpu->pc(), offset, result); LOGZEUS("%06X:zeus32_r(%02X) = %08X\n", m_maincpu->pc(), offset, result);
} }
} }
// 16-bit mode
else else
{ {
// 16-bit mode
if (offset & 1) if (offset & 1)
result >>= 16; result >>= 16;
else else
@ -421,13 +420,10 @@ void midzeus_state::zeus_w(offs_t offset, uint32_t data)
if (logit) if (logit)
LOGZEUS("%06X:zeus_w", m_maincpu->pc()); LOGZEUS("%06X:zeus_w", m_maincpu->pc());
// 32-bit mode
if (m_zeusbase[0x80] & 0x00020000) if (m_zeusbase[0x80] & 0x00020000)
zeus_register32_w(offset, data, logit); zeus_register32_w(offset, data, logit); // 32-bit mode
// 16-bit mode
else else
zeus_register16_w(offset, data, logit); zeus_register16_w(offset, data, logit); // 16-bit mode
} }

View File

@ -75,8 +75,8 @@ void micro3d_sound_device::lp_filter::init(double fsval)
static void prewarp(double &a0, double &a1, double &a2, double fc, double fs) static void prewarp(double &a0, double &a1, double &a2, double fc, double fs)
{ {
double pi = 4.0 * atan(1.0); double const pi = 4.0 * atan(1.0);
double wp = 2.0 * fs * tan(pi * fc / fs); double const wp = 2.0 * fs * tan(pi * fc / fs);
a2 = a2 / (wp * wp); a2 = a2 / (wp * wp);
a1 = a1 / wp; a1 = a1 / wp;
@ -86,8 +86,8 @@ static void bilinear(double a0, double a1, double a2,
double b0, double b1, double b2, double b0, double b1, double b2,
double &k, double fs, float *coef) double &k, double fs, float *coef)
{ {
double ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0; double const ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0;
double bd = 4. * b2 * fs * fs + 2. * b1* fs + b0; double const bd = 4. * b2 * fs * fs + 2. * b1* fs + b0;
k *= ad / bd; k *= ad / bd;
@ -137,8 +137,8 @@ void micro3d_sound_device::noise_sh_w(u8 data)
else else
m_gain = expf(-(float)(m_dac[VCA]) / 25.0f) * 10.0f; m_gain = expf(-(float)(m_dac[VCA]) / 25.0f) * 10.0f;
double q = 0.75/255 * (255 - m_dac[VCQ]) + 0.1; double const q = 0.75/255 * (255 - m_dac[VCQ]) + 0.1;
double fc = 4500.0/255 * (255 - m_dac[VCF]) + 100; double const fc = 4500.0/255 * (255 - m_dac[VCF]) + 100;
m_filter.recompute(m_gain, q, fc); m_filter.recompute(m_gain, q, fc);
} }
@ -195,15 +195,12 @@ void micro3d_sound_device::device_start()
save_item(NAME(m_filter.history)); save_item(NAME(m_filter.history));
save_item(NAME(m_filter.coef)); save_item(NAME(m_filter.coef));
save_item(NAME(m_filter.fs)); save_item(NAME(m_filter.fs));
for (int i = 0; i < 2; i++) save_item(STRUCT_MEMBER(m_filter.proto_coef, a0));
{ save_item(STRUCT_MEMBER(m_filter.proto_coef, a1));
save_item(NAME(m_filter.proto_coef[i].a0), i); save_item(STRUCT_MEMBER(m_filter.proto_coef, a2));
save_item(NAME(m_filter.proto_coef[i].a1), i); save_item(STRUCT_MEMBER(m_filter.proto_coef, b0));
save_item(NAME(m_filter.proto_coef[i].a2), i); save_item(STRUCT_MEMBER(m_filter.proto_coef, b1));
save_item(NAME(m_filter.proto_coef[i].b0), i); save_item(STRUCT_MEMBER(m_filter.proto_coef, b2));
save_item(NAME(m_filter.proto_coef[i].b1), i);
save_item(NAME(m_filter.proto_coef[i].b2), i);
}
save_item(STRUCT_MEMBER(m_noise_filters, capval)); save_item(STRUCT_MEMBER(m_noise_filters, capval));
save_item(STRUCT_MEMBER(m_noise_filters, exponent)); save_item(STRUCT_MEMBER(m_noise_filters, exponent));
} }
@ -239,8 +236,8 @@ void micro3d_sound_device::sound_stream_update(sound_stream &stream, std::vector
if (m_gain == 0) if (m_gain == 0)
return; return;
float pan_l = (float)(255 - m_dac[PAN]) / 255.0f; float const pan_l = float(255 - m_dac[PAN]) / 255.0f;
float pan_r = (float)(m_dac[PAN]) / 255.0f; float const pan_r = float(m_dac[PAN]) / 255.0f;
for (int sampindex = 0; sampindex < fl.samples(); sampindex++) for (int sampindex = 0; sampindex < fl.samples(); sampindex++)
{ {
@ -254,7 +251,7 @@ void micro3d_sound_device::sound_stream_update(sound_stream &stream, std::vector
m_noise_subcount = 2000000 / MM5837_CLOCK; m_noise_subcount = 2000000 / MM5837_CLOCK;
} }
m_noise_subcount -= step; m_noise_subcount -= step;
float input = (float)m_noise_value - 0.5f; float input = float(m_noise_value) - 0.5f;
float white = input; float white = input;
// Pink noise filtering // Pink noise filtering

View File

@ -27,7 +27,8 @@ protected:
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override; virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
private: private:
enum dac_registers { enum dac_registers
{
VCF, VCF,
VCQ, VCQ,
VCA, VCA,

View File

@ -297,8 +297,9 @@ void micro3d_state::draw_line(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2
if (x2 < x1) if (x2 < x1)
{ {
std::swap<uint32_t>(x1, x2); using std::swap;
std::swap<uint32_t>(y1, y2); swap(x1, x2);
swap(y1, y2);
} }
dx = x2 - x1; dx = x2 - x1;

View File

@ -1709,4 +1709,4 @@ GAME(1991, larana, 0, inder, larana, inder_state, init_0, ROT0, "Inder",
GAME(1992, ind250cc, 0, inder, ind250cc, inder_state, init_1, ROT0, "Inder", "250 CC", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE ) GAME(1992, ind250cc, 0, inder, ind250cc, inder_state, init_1, ROT0, "Inder", "250 CC", MACHINE_MECHANICAL | MACHINE_SUPPORTS_SAVE )
// Unknown sound hardware, unknown machine (using 'larana' inputs until proper ones are figured out). // Unknown sound hardware, unknown machine (using 'larana' inputs until proper ones are figured out).
GAME(1991, indunkgam, 0, inder, larana, inder_state, init_0, ROT0, "Inder", "Unknown gambling game on Inder pinball hardware", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE ) GAME(1991, indunkgam, 0, inder, larana, inder_state, init_0, ROT0, "Inder", "unknown gambling game on Inder pinball hardware", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )

View File

@ -82,17 +82,17 @@ private:
required_device<gfxdecode_device> m_gfxdecode; required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen; required_device<screen_device> m_screen;
// screen updates
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
// video-related // video-related
tilemap_t *m_tilemap[3] = {nullptr, nullptr, nullptr}; tilemap_t *m_tilemap[3] = {nullptr, nullptr, nullptr};
template<unsigned Which> TILE_GET_INFO_MEMBER(get_tile_info);
int m_oki_bank = 0; int m_oki_bank = 0;
uint16_t m_gfx_control = 0; uint16_t m_gfx_control = 0;
// screen updates
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
template <unsigned Which> TILE_GET_INFO_MEMBER(get_tile_info);
void gfx_ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void gfx_ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void tilemap1_scrollx_w(uint16_t data); void tilemap1_scrollx_w(uint16_t data);
void tilemap1_scrolly_w(uint16_t data); void tilemap1_scrolly_w(uint16_t data);
@ -294,10 +294,10 @@ static INPUT_PORTS_START( casanova )
PORT_MODIFY("DSW01") // Do NOT trust "DIP INFO" for correct settings! At least Coinage is WRONG! PORT_MODIFY("DSW01") // Do NOT trust "DIP INFO" for correct settings! At least Coinage is WRONG!
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x0002, DEF_STR( 1C_2C ) ) // Dip info shows 2 Coins / Credit PORT_DIPSETTING( 0x0002, DEF_STR( 1C_2C ) ) // DIP switch info shows 2 Coins / Credit
PORT_DIPSETTING( 0x0003, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0003, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) ) // Dip info shows 3 Coins / Credit PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) ) // DIP switch info shows 3 Coins / Credit
PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) ) // Dip info shows 5 Coins / Credit PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) ) // DIP switch info shows 5 Coins / Credit
PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4")
PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) )

View File

@ -61,7 +61,7 @@ gundamex:
- slowdowns, music tempo is incorrect - slowdowns, music tempo is incorrect
mj4simai: mj4simai:
- test mode doesn't work correctly, the grid is ok but when you press a key to go to the - test mode doesn't work correctly, the grid is OK but when you press a key to go to the
next screen (input test) it stays up a second and then drops back into the game next screen (input test) it stays up a second and then drops back into the game
myangel: myangel:
@ -188,10 +188,10 @@ void seta2_state::grdians_map(address_map &map)
map(0x70000c, 0x70000d).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); map(0x70000c, 0x70000d).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0x800001, 0x800001).w(FUNC(seta2_state::grdians_lockout_w)); map(0x800001, 0x800001).w(FUNC(seta2_state::grdians_lockout_w));
map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
map(0xc00000, 0xc3ffff).ram().w(FUNC(seta2_state::spriteram_w)).share("spriteram"); // Sprites map(0xc00000, 0xc3ffff).ram().w(FUNC(seta2_state::spriteram_w)).share(m_spriteram); // Sprites
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0xc50000, 0xc5ffff).ram(); // cleared map(0xc50000, 0xc5ffff).ram(); // cleared
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers
map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
} }
@ -226,10 +226,10 @@ void seta2_state::gundamex_map(address_map &map)
map(0x70000c, 0x70000d).w("watchdog", FUNC(watchdog_timer_device::reset16_w)); map(0x70000c, 0x70000d).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
map(0x800000, 0x800001).w(FUNC(seta2_state::grdians_lockout_w)); map(0x800000, 0x800001).w(FUNC(seta2_state::grdians_lockout_w));
map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites map(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0xc50000, 0xc5ffff).ram(); // cleared map(0xc50000, 0xc5ffff).ram(); // cleared
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers
map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
} }
@ -244,25 +244,15 @@ void mj4simai_state::machine_start()
save_item(NAME(m_keyboard_row)); save_item(NAME(m_keyboard_row));
} }
uint16_t mj4simai_state::mj4simai_p1_r() template <unsigned Which>
uint16_t mj4simai_state::mj4simai_key_r()
{ {
uint16_t result = 0xffff; uint16_t result = 0xffff;
if (BIT(m_keyboard_row, 0)) result &= m_p1_key[0]->read(); if (BIT(m_keyboard_row, 0)) result &= m_keys[Which][0]->read();
if (BIT(m_keyboard_row, 1)) result &= m_p1_key[1]->read(); if (BIT(m_keyboard_row, 1)) result &= m_keys[Which][1]->read();
if (BIT(m_keyboard_row, 2)) result &= m_p1_key[2]->read(); if (BIT(m_keyboard_row, 2)) result &= m_keys[Which][2]->read();
if (BIT(m_keyboard_row, 3)) result &= m_p1_key[3]->read(); if (BIT(m_keyboard_row, 3)) result &= m_keys[Which][3]->read();
if (BIT(m_keyboard_row, 4)) result &= m_p1_key[4]->read(); if (BIT(m_keyboard_row, 4)) result &= m_keys[Which][4]->read();
return result;
}
uint16_t mj4simai_state::mj4simai_p2_r()
{
uint16_t result = 0xffff;
if (BIT(m_keyboard_row, 0)) result &= m_p2_key[0]->read();
if (BIT(m_keyboard_row, 1)) result &= m_p2_key[1]->read();
if (BIT(m_keyboard_row, 2)) result &= m_p2_key[2]->read();
if (BIT(m_keyboard_row, 3)) result &= m_p2_key[3]->read();
if (BIT(m_keyboard_row, 4)) result &= m_p2_key[4]->read();
return result; return result;
} }
@ -270,19 +260,19 @@ void mj4simai_state::mj4simai_map(address_map &map)
{ {
map(0x000000, 0x1fffff).rom(); // ROM map(0x000000, 0x1fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM map(0x200000, 0x20ffff).ram(); // RAM
map(0x600000, 0x600001).r(FUNC(mj4simai_state::mj4simai_p1_r)); // P1 map(0x600000, 0x600001).r(FUNC(mj4simai_state::mj4simai_key_r<0>)); // P1
map(0x600002, 0x600003).r(FUNC(mj4simai_state::mj4simai_p2_r)); // P2 map(0x600002, 0x600003).r(FUNC(mj4simai_state::mj4simai_key_r<1>)); // P2
map(0x600005, 0x600005).lw8(NAME([this] (u8 data) { m_keyboard_row = data; })); // select keyboard row to read map(0x600005, 0x600005).lw8(NAME([this] (u8 data) { m_keyboard_row = data; })); // select keyboard row to read
map(0x600006, 0x600007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); map(0x600006, 0x600007).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0x600100, 0x600101).portr("SYSTEM"); // map(0x600100, 0x600101).portr("SYSTEM");
map(0x600200, 0x600201).nopw(); // Leds? Coins? map(0x600200, 0x600201).nopw(); // LEDs? Coins?
map(0x600300, 0x600301).portr("DSW1"); // DSW 1 map(0x600300, 0x600301).portr("DSW1"); // DSW 1
map(0x600302, 0x600303).portr("DSW2"); // DSW 2 map(0x600302, 0x600303).portr("DSW2"); // DSW 2
map(0x600300, 0x60030f).w(FUNC(mj4simai_state::sound_bank_w)).umask16(0x00ff); // Samples Banks map(0x600300, 0x60030f).w(FUNC(mj4simai_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites map(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0xc60000, 0xc6003f).ram().w(FUNC(mj4simai_state::vregs_w)).share("vregs"); // Video Registers map(0xc60000, 0xc6003f).ram().w(FUNC(mj4simai_state::vregs_w)).share(m_vregs); // Video Registers
} }
@ -298,14 +288,14 @@ void seta2_state::myangel_map(address_map &map)
map(0x700002, 0x700003).portr("P2"); // P2 map(0x700002, 0x700003).portr("P2"); // P2
map(0x700004, 0x700005).portr("SYSTEM"); // Coins map(0x700004, 0x700005).portr("SYSTEM"); // Coins
map(0x700006, 0x700007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); map(0x700006, 0x700007).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0x700200, 0x700201).nopw(); // Leds? Coins? map(0x700200, 0x700201).nopw(); // LEDs? Coins?
map(0x700300, 0x700301).portr("DSW1"); // DSW 1 map(0x700300, 0x700301).portr("DSW1"); // DSW 1
map(0x700302, 0x700303).portr("DSW2"); // DSW 2 map(0x700302, 0x700303).portr("DSW2"); // DSW 2
map(0x700310, 0x70031f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks map(0x700310, 0x70031f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites map(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers
} }
@ -321,14 +311,14 @@ void seta2_state::myangel2_map(address_map &map)
map(0x600002, 0x600003).portr("P2"); // P2 map(0x600002, 0x600003).portr("P2"); // P2
map(0x600004, 0x600005).portr("SYSTEM"); // Coins map(0x600004, 0x600005).portr("SYSTEM"); // Coins
map(0x600006, 0x600007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); map(0x600006, 0x600007).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0x600200, 0x600201).nopw(); // Leds? Coins? map(0x600200, 0x600201).nopw(); // LEDs? Coins?
map(0x600300, 0x600301).portr("DSW1"); // DSW 1 map(0x600300, 0x600301).portr("DSW1"); // DSW 1
map(0x600302, 0x600303).portr("DSW2"); // DSW 2 map(0x600302, 0x600303).portr("DSW2"); // DSW 2
map(0x600300, 0x60030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks map(0x600300, 0x60030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
map(0xd00000, 0xd3ffff).ram().share("spriteram"); // Sprites map(0xd00000, 0xd3ffff).ram().share(m_spriteram); // Sprites
map(0xd40000, 0xd4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0xd40000, 0xd4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0xd60000, 0xd6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers map(0xd60000, 0xd6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers
} }
@ -367,9 +357,9 @@ void seta2_state::pzlbowl_map(address_map &map)
map(0x500005, 0x500005).rw(FUNC(seta2_state::pzlbowl_coins_r), FUNC(seta2_state::pzlbowl_coin_counter_w)); // Coins + Protection? map(0x500005, 0x500005).rw(FUNC(seta2_state::pzlbowl_coins_r), FUNC(seta2_state::pzlbowl_coin_counter_w)); // Coins + Protection?
map(0x500006, 0x500007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); map(0x500006, 0x500007).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0x700000, 0x700001).r(FUNC(seta2_state::pzlbowl_protection_r)); // Protection map(0x700000, 0x700001).r(FUNC(seta2_state::pzlbowl_protection_r)); // Protection
map(0x800000, 0x83ffff).ram().share("spriteram"); // Sprites map(0x800000, 0x83ffff).ram().share(m_spriteram); // Sprites
map(0x840000, 0x84ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0x840000, 0x84ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0x860000, 0x86003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers map(0x860000, 0x86003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers
map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
} }
@ -402,7 +392,7 @@ void seta2_state::penbros_map(address_map &map)
map(0x500300, 0x500301).portr("DSW1"); map(0x500300, 0x500301).portr("DSW1");
map(0x500302, 0x500303).portr("DSW2"); map(0x500302, 0x500303).portr("DSW2");
map(0x500300, 0x50030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); map(0x500300, 0x50030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff);
map(0xb60000, 0xb6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); map(0xb60000, 0xb6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs);
} }
void seta2_state::ablastb_map(address_map &map) void seta2_state::ablastb_map(address_map &map)
@ -465,9 +455,9 @@ void seta2_state::reelquak_map(address_map &map)
map(0x400302, 0x400303).portr("DSW2"); // DSW 2 map(0x400302, 0x400303).portr("DSW2"); // DSW 2
map(0x400300, 0x40030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks map(0x400300, 0x40030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites map(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers
} }
@ -480,8 +470,8 @@ void seta2_state::namcostr_map(address_map &map)
{ {
map(0x000000, 0x07ffff).rom(); // ROM map(0x000000, 0x07ffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM map(0x200000, 0x20ffff).ram(); // RAM
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites map(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers
} }
@ -520,9 +510,9 @@ void seta2_state::samshoot_map(address_map &map)
map(0x700005, 0x700005).w(FUNC(seta2_state::samshoot_coin_w)); // Coins map(0x700005, 0x700005).w(FUNC(seta2_state::samshoot_coin_w)); // Coins
map(0x700006, 0x700007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); // Watchdog? map(0x700006, 0x700007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); // Watchdog?
map(0x800000, 0x83ffff).ram().share("spriteram"); // Sprites map(0x800000, 0x83ffff).ram().share(m_spriteram); // Sprites
map(0x840000, 0x84ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0x840000, 0x84ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0x860000, 0x86003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers map(0x860000, 0x86003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers
map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
} }
@ -617,7 +607,7 @@ void staraudi_state::staraudi_map(address_map &map)
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0xc50000, 0xc5ffff).ram(); // cleared map(0xc50000, 0xc5ffff).ram(); // cleared
map(0xc60000, 0xc6003f).ram().w(FUNC(staraudi_state::vregs_w)).share("vregs"); // Video Registers map(0xc60000, 0xc6003f).ram().w(FUNC(staraudi_state::vregs_w)).share(m_vregs); // Video Registers
} }
@ -670,9 +660,9 @@ void seta2_state::telpacfl_map(address_map &map)
map(0x70000d, 0x70000d).w(FUNC(seta2_state::telpacfl_lamp2_w)); // "" map(0x70000d, 0x70000d).w(FUNC(seta2_state::telpacfl_lamp2_w)); // ""
map(0x800001, 0x800001).w(FUNC(seta2_state::telpacfl_lockout_w)); // Coin Blockers map(0x800001, 0x800001).w(FUNC(seta2_state::telpacfl_lockout_w)); // Coin Blockers
map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
map(0xb00000, 0xb3ffff).ram().share("spriteram"); // Sprites map(0xb00000, 0xb3ffff).ram().share(m_spriteram); // Sprites
map(0xb40000, 0xb4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0xb40000, 0xb4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0xb60000, 0xb6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers map(0xb60000, 0xb6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers
map(0xd00006, 0xd00007).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); map(0xd00006, 0xd00007).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
// map(0xe00000, 0xe00001).w(FUNC(seta2_state::)); // map(0xe00000, 0xe00001).w(FUNC(seta2_state::));
map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks

View File

@ -133,8 +133,8 @@ protected:
std::unique_ptr<uint16_t[]> m_private_spriteram; std::unique_ptr<uint16_t[]> m_private_spriteram;
private: private:
void drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int gfx, const uint8_t* const addr, const uint32_t realcolor, bool flipx, bool flipy, int base_sx, uint32_t xzoom, bool shadow, int screenline, int line, bool opaque); void drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int gfx, uint8_t const *const addr, uint32_t realcolor, bool flipx, bool flipy, int base_sx, uint32_t xzoom, bool shadow, int screenline, int line, bool opaque);
inline void get_tile(uint16_t *spriteram, bool is_16x16, int x, int y, int page, int &code, int &attr, bool &flipx, bool &flipy, int &color); inline void get_tile(uint16_t const *spriteram, bool is_16x16, int x, int y, int page, int &code, int &attr, bool &flipx, bool &flipy, int &color);
TIMER_CALLBACK_MEMBER(raster_timer_done); TIMER_CALLBACK_MEMBER(raster_timer_done);
@ -152,8 +152,7 @@ class mj4simai_state : public seta2_state
public: public:
mj4simai_state(const machine_config &mconfig, device_type type, const char *tag) : mj4simai_state(const machine_config &mconfig, device_type type, const char *tag) :
seta2_state(mconfig, type, tag), seta2_state(mconfig, type, tag),
m_p1_key(*this, "P1_KEY%u", 0U), m_keys{ { *this, "P1_KEY%u", 0U }, { *this, "P2_KEY%u", 0U } }
m_p2_key(*this, "P2_KEY%u", 0U)
{ } { }
void mj4simai(machine_config &config); void mj4simai(machine_config &config);
@ -162,13 +161,11 @@ protected:
virtual void machine_start() override; virtual void machine_start() override;
private: private:
uint16_t mj4simai_p1_r(); template <unsigned Which> uint16_t mj4simai_key_r();
uint16_t mj4simai_p2_r();
void mj4simai_map(address_map &map); void mj4simai_map(address_map &map);
required_ioport_array<5> m_p1_key; required_ioport_array<5> m_keys[2];
required_ioport_array<5> m_p2_key;
uint8_t m_keyboard_row = 0; uint8_t m_keyboard_row = 0;
}; };

View File

@ -308,7 +308,20 @@ void seta2_state::spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
***************************************************************************/ ***************************************************************************/
inline void seta2_state::drawgfx_line(bitmap_ind16& bitmap, const rectangle& cliprect, int which_gfx, const uint8_t* const addr, const uint32_t realcolor, bool flipx, bool flipy, int base_sx, uint32_t xzoom, bool use_shadow, int screenline, int line, bool opaque) inline void seta2_state::drawgfx_line(
bitmap_ind16 &bitmap,
const rectangle &cliprect,
int which_gfx,
uint8_t const *const addr,
uint32_t realcolor,
bool flipx,
bool flipy,
int base_sx,
uint32_t xzoom,
bool use_shadow,
int screenline,
int line,
bool opaque)
{ {
struct drawmodes struct drawmodes
{ {
@ -426,10 +439,11 @@ inline void seta2_state::drawgfx_line(bitmap_ind16& bitmap, const rectangle& cli
// takes an x/y pixel position in the virtual tilemap and returns the code + attributes etc. for it // takes an x/y pixel position in the virtual tilemap and returns the code + attributes etc. for it
inline void seta2_state::get_tile( inline void seta2_state::get_tile(
uint16_t *spriteram, uint16_t const *const spriteram,
bool is_16x16, bool is_16x16,
int x, int x,
int y, int page, int y,
int page,
int &code, int &code,
int &attr, int &attr,
bool &flipx, bool &flipx,
@ -662,7 +676,9 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr
int code, attr, color; int code, attr, color;
bool flipx, flipy; bool flipx, flipy;
// tilemap data is NOT buffered? // tilemap data is NOT buffered?
get_tile(m_spriteram, is_16x16, x * 8, sourceline, page, code, attr, flipx, flipy, color); get_tile(
m_spriteram, is_16x16, x * 8, sourceline, page,
code, attr, flipx, flipy, color);
const int tileline = sourceline & 0x07; const int tileline = sourceline & 0x07;
const int dx = sx + (scrollx & 0x3ff) + xoffs + 0x10; const int dx = sx + (scrollx & 0x3ff) + xoffs + 0x10;
@ -675,7 +691,16 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr
uint32_t realsx = dst_x; uint32_t realsx = dst_x;
realsx -= usedxoffset >> 16; // need to refactor, this causes loss of lower 16 bits of offset which are important in zoomed cases for precision realsx -= usedxoffset >> 16; // need to refactor, this causes loss of lower 16 bits of offset which are important in zoomed cases for precision
realsx = realsx * usedxzoom; realsx = realsx * usedxzoom;
drawgfx_line(bitmap, cliprect, which_gfx, m_spritegfx->get_data(m_realtilenumber[code]), color << 4, flipx, flipy, realsx, usedxzoom, use_shadow, realscanline, tileline, opaque); drawgfx_line(
bitmap, cliprect,
which_gfx,
m_spritegfx->get_data(m_realtilenumber[code]),
color << 4,
flipx, flipy,
realsx,
usedxzoom, use_shadow,
realscanline, tileline,
opaque);
} }
} }
} }
@ -757,7 +782,16 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr
uint32_t realsx = (sx + x * 8); uint32_t realsx = (sx + x * 8);
realsx -= usedxoffset >> 16; // need to refactor, this causes loss of lower 16 bits of offset which are important in zoomed cases for precision realsx -= usedxoffset >> 16; // need to refactor, this causes loss of lower 16 bits of offset which are important in zoomed cases for precision
realsx = realsx * usedxzoom; realsx = realsx * usedxzoom;
drawgfx_line(bitmap, cliprect, which_gfx, m_spritegfx->get_data(m_realtilenumber[realcode]), color << 4, flipx, flipy, realsx, usedxzoom, use_shadow, realscanline, line, opaque); drawgfx_line(
bitmap, cliprect,
which_gfx,
m_spritegfx->get_data(m_realtilenumber[realcode]),
color << 4,
flipx, flipy,
realsx,
usedxzoom, use_shadow,
realscanline, line,
opaque);
} }
} }

View File

@ -26,8 +26,8 @@ namespace {
class clie_db_state : public driver_device class clie_db_state : public driver_device
{ {
public: public:
clie_db_state(const machine_config &mconfig, device_type type, const char *tag) clie_db_state(const machine_config &mconfig, device_type type, const char *tag) :
: driver_device(mconfig, type, tag), driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu") m_maincpu(*this, "maincpu")
{ } { }

View File

@ -12,25 +12,33 @@
#include "screen.h" #include "screen.h"
#include "speaker.h" #include "speaker.h"
#include "utf8.h" #include "utf8.h"
namespace {
class qs300_state : public driver_device { class qs300_state : public driver_device {
public: public:
qs300_state(const machine_config &mconfig, device_type type, const char *tag) qs300_state(const machine_config &mconfig, device_type type, const char *tag) :
: driver_device(mconfig, type, tag), qs300_state(mconfig, type, tag, false)
{
}
void qs300(machine_config &config);
protected:
qs300_state(const machine_config &mconfig, device_type type, const char *tag, bool is_eos) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_subcpu(*this, "subcpu"), m_subcpu(*this, "subcpu"),
m_swp00(*this, "swp00"), m_swp00(*this, "swp00"),
m_lcdc(*this, "vs254300"), m_lcdc(*this, "vs254300"),
m_nvram(*this, "ram"), m_nvram(*this, "ram"),
m_inputs(*this, "DR%u", 0U), m_inputs(*this, "DR%u", 0U),
m_is_eos(false) m_is_eos(is_eos)
{
}
{ }
void qs300(machine_config &config);
protected:
required_device<h83002_device> m_maincpu; required_device<h83002_device> m_maincpu;
required_device<h83002_device> m_subcpu; required_device<h83002_device> m_subcpu;
required_device<swp00_device> m_swp00; required_device<swp00_device> m_swp00;
@ -40,7 +48,8 @@ protected:
//required_ioport m_sustain; //required_ioport m_sustain;
//required_ioport m_pitch_bend; //required_ioport m_pitch_bend;
bool m_is_eos; bool const m_is_eos;
u8 m_mlatch, m_slatch; u8 m_mlatch, m_slatch;
bool m_mlatch_full, m_slatch_full; bool m_mlatch_full, m_slatch_full;
@ -73,10 +82,9 @@ protected:
class eos_b900_state : public qs300_state class eos_b900_state : public qs300_state
{ {
public: public:
eos_b900_state(const machine_config &mconfig, device_type type, const char *tag) eos_b900_state(const machine_config &mconfig, device_type type, const char *tag) :
: qs300_state(mconfig, type, tag) qs300_state(mconfig, type, tag, true)
{ {
m_is_eos = true;
} }
}; };
@ -370,5 +378,7 @@ ROM_START( eosb900 )
// This t6963c_0101 internal CG ROM is similar to lm24014w_0101.bin which may be used as a replacement // This t6963c_0101 internal CG ROM is similar to lm24014w_0101.bin which may be used as a replacement
ROM_END ROM_END
} // anonymous namespace
SYST( 1999, qs300, 0, 0, qs300, qs300, qs300_state, empty_init, "Yamaha", "QS300", MACHINE_NOT_WORKING ) SYST( 1999, qs300, 0, 0, qs300, qs300, qs300_state, empty_init, "Yamaha", "QS300", MACHINE_NOT_WORKING )
SYST( 1999, eosb900, qs300, 0, qs300, qs300, eos_b900_state, empty_init, "Yamaha", "EOS B900", MACHINE_NOT_WORKING ) SYST( 1999, eosb900, qs300, 0, qs300, qs300, eos_b900_state, empty_init, "Yamaha", "EOS B900", MACHINE_NOT_WORKING )