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;
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 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)
{
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];
switch (offset & ~1)
{
case 0xf0:
result = m_screen->hpos();
logit = 0;
logit = false;
break;
case 0xf2:
result = m_screen->vpos();
logit = 0;
logit = false;
break;
case 0xf4:
result = 6;
if (m_screen->vblank())
result |= 0x800;
logit = 0;
logit = false;
break;
case 0xf6: // status -- they wait for this & 9 == 0
@ -373,13 +373,13 @@ uint32_t midzeus_state::zeus_r(offs_t offset)
result = 0x9600;
if (m_zeusbase[0xb6] == 0x80040000)
result |= 1;
logit = 0;
logit = false;
break;
}
// 32-bit mode
if (m_zeusbase[0x80] & 0x00020000)
{
// 32-bit mode
if (offset & 1)
result >>= 16;
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);
}
}
// 16-bit mode
else
{
// 16-bit mode
if (offset & 1)
result >>= 16;
else
@ -421,13 +420,10 @@ void midzeus_state::zeus_w(offs_t offset, uint32_t data)
if (logit)
LOGZEUS("%06X:zeus_w", m_maincpu->pc());
// 32-bit mode
if (m_zeusbase[0x80] & 0x00020000)
zeus_register32_w(offset, data, logit);
// 16-bit mode
zeus_register32_w(offset, data, logit); // 32-bit mode
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)
{
double pi = 4.0 * atan(1.0);
double wp = 2.0 * fs * tan(pi * fc / fs);
double const pi = 4.0 * atan(1.0);
double const wp = 2.0 * fs * tan(pi * fc / fs);
a2 = a2 / (wp * wp);
a1 = a1 / wp;
@ -86,8 +86,8 @@ static void bilinear(double a0, double a1, double a2,
double b0, double b1, double b2,
double &k, double fs, float *coef)
{
double ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0;
double bd = 4. * b2 * fs * fs + 2. * b1* fs + b0;
double const ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0;
double const bd = 4. * b2 * fs * fs + 2. * b1* fs + b0;
k *= ad / bd;
@ -137,8 +137,8 @@ void micro3d_sound_device::noise_sh_w(u8 data)
else
m_gain = expf(-(float)(m_dac[VCA]) / 25.0f) * 10.0f;
double q = 0.75/255 * (255 - m_dac[VCQ]) + 0.1;
double fc = 4500.0/255 * (255 - m_dac[VCF]) + 100;
double const q = 0.75/255 * (255 - m_dac[VCQ]) + 0.1;
double const fc = 4500.0/255 * (255 - m_dac[VCF]) + 100;
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.coef));
save_item(NAME(m_filter.fs));
for (int i = 0; i < 2; i++)
{
save_item(NAME(m_filter.proto_coef[i].a0), i);
save_item(NAME(m_filter.proto_coef[i].a1), i);
save_item(NAME(m_filter.proto_coef[i].a2), i);
save_item(NAME(m_filter.proto_coef[i].b0), i);
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_filter.proto_coef, a0));
save_item(STRUCT_MEMBER(m_filter.proto_coef, a1));
save_item(STRUCT_MEMBER(m_filter.proto_coef, a2));
save_item(STRUCT_MEMBER(m_filter.proto_coef, b0));
save_item(STRUCT_MEMBER(m_filter.proto_coef, b1));
save_item(STRUCT_MEMBER(m_filter.proto_coef, b2));
save_item(STRUCT_MEMBER(m_noise_filters, capval));
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)
return;
float pan_l = (float)(255 - m_dac[PAN]) / 255.0f;
float pan_r = (float)(m_dac[PAN]) / 255.0f;
float const pan_l = float(255 - m_dac[PAN]) / 255.0f;
float const pan_r = float(m_dac[PAN]) / 255.0f;
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 -= step;
float input = (float)m_noise_value - 0.5f;
float input = float(m_noise_value) - 0.5f;
float white = input;
// 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;
private:
enum dac_registers {
enum dac_registers
{
VCF,
VCQ,
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)
{
std::swap<uint32_t>(x1, x2);
std::swap<uint32_t>(y1, y2);
using std::swap;
swap(x1, x2);
swap(y1, y2);
}
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 )
// 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<screen_device> m_screen;
// screen updates
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
// video-related
tilemap_t *m_tilemap[3] = {nullptr, nullptr, nullptr};
template<unsigned Which> TILE_GET_INFO_MEMBER(get_tile_info);
int m_oki_bank = 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 tilemap1_scrollx_w(uint16_t data);
void tilemap1_scrolly_w(uint16_t data);
@ -101,7 +101,7 @@ private:
};
template<unsigned Which>
template <unsigned Which>
TILE_GET_INFO_MEMBER(_3x3puzzle_state::get_tile_info)
{
tileinfo.set(Which,
@ -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_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( 0x0001, DEF_STR( 2C_1C ) ) // Dip info shows 3 Coins / Credit
PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) ) // Dip info shows 5 Coins / Credit
PORT_DIPSETTING( 0x0001, DEF_STR( 2C_1C ) ) // DIP switch info shows 3 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_DIPSETTING( 0x0008, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) )

View File

@ -61,7 +61,7 @@ gundamex:
- slowdowns, music tempo is incorrect
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
myangel:
@ -177,22 +177,22 @@ void seta2_state::grdians_lockout_w(uint8_t data)
void seta2_state::grdians_map(address_map &map)
{
map(0x000000, 0x1fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x304000, 0x30ffff).ram(); // ? seems tile data
map(0x600000, 0x600001).portr("DSW1"); // DSW 1
map(0x600002, 0x600003).portr("DSW2"); // DSW 2
map(0x700000, 0x700001).portr("P1"); // P1
map(0x700002, 0x700003).portr("P2"); // P2
map(0x700004, 0x700005).portr("SYSTEM"); // Coins
map(0x000000, 0x1fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x304000, 0x30ffff).ram(); // ? seems tile data
map(0x600000, 0x600001).portr("DSW1"); // DSW 1
map(0x600002, 0x600003).portr("DSW2"); // DSW 2
map(0x700000, 0x700001).portr("P1"); // P1
map(0x700002, 0x700003).portr("P2"); // P2
map(0x700004, 0x700005).portr("SYSTEM"); // Coins
map(0x70000c, 0x70000d).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
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(0xc00000, 0xc3ffff).ram().w(FUNC(seta2_state::spriteram_w)).share("spriteram"); // Sprites
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(m_spriteram); // Sprites
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0xc50000, 0xc5ffff).ram(); // cleared
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
map(0xc50000, 0xc5ffff).ram(); // cleared
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
}
/***************************************************************************
@ -213,24 +213,24 @@ void seta2_state::gundamex_eeprom_w(uint16_t data)
void seta2_state::gundamex_map(address_map &map)
{
map(0x000000, 0x1fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x500000, 0x57ffff).rom(); // ROM
map(0x600000, 0x600001).portr("DSW1"); // DSW 1
map(0x600002, 0x600003).portr("DSW2"); // DSW 2
map(0x700000, 0x700001).portr("P1"); // P1
map(0x700002, 0x700003).portr("P2"); // P2
map(0x700004, 0x700005).portr("SYSTEM"); // Coins
map(0x700008, 0x700009).portr("IN0"); // P1
map(0x70000a, 0x70000b).portr("IN1"); // P2
map(0x000000, 0x1fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x500000, 0x57ffff).rom(); // ROM
map(0x600000, 0x600001).portr("DSW1"); // DSW 1
map(0x600002, 0x600003).portr("DSW2"); // DSW 2
map(0x700000, 0x700001).portr("P1"); // P1
map(0x700002, 0x700003).portr("P2"); // P2
map(0x700004, 0x700005).portr("SYSTEM"); // Coins
map(0x700008, 0x700009).portr("IN0"); // P1
map(0x70000a, 0x70000b).portr("IN1"); // P2
map(0x70000c, 0x70000d).w("watchdog", FUNC(watchdog_timer_device::reset16_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(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites
map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
map(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0xc50000, 0xc5ffff).ram(); // cleared
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
map(0xc50000, 0xc5ffff).ram(); // cleared
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
}
@ -244,45 +244,35 @@ void mj4simai_state::machine_start()
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;
if (BIT(m_keyboard_row, 0)) result &= m_p1_key[0]->read();
if (BIT(m_keyboard_row, 1)) result &= m_p1_key[1]->read();
if (BIT(m_keyboard_row, 2)) result &= m_p1_key[2]->read();
if (BIT(m_keyboard_row, 3)) result &= m_p1_key[3]->read();
if (BIT(m_keyboard_row, 4)) result &= m_p1_key[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();
if (BIT(m_keyboard_row, 0)) result &= m_keys[Which][0]->read();
if (BIT(m_keyboard_row, 1)) result &= m_keys[Which][1]->read();
if (BIT(m_keyboard_row, 2)) result &= m_keys[Which][2]->read();
if (BIT(m_keyboard_row, 3)) result &= m_keys[Which][3]->read();
if (BIT(m_keyboard_row, 4)) result &= m_keys[Which][4]->read();
return result;
}
void mj4simai_state::mj4simai_map(address_map &map)
{
map(0x000000, 0x1fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x600000, 0x600001).r(FUNC(mj4simai_state::mj4simai_p1_r)); // P1
map(0x600002, 0x600003).r(FUNC(mj4simai_state::mj4simai_p2_r)); // P2
map(0x600005, 0x600005).lw8(NAME([this] (u8 data){ m_keyboard_row = data; })); // select keyboard row to read
map(0x000000, 0x1fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x600000, 0x600001).r(FUNC(mj4simai_state::mj4simai_key_r<0>)); // P1
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(0x600006, 0x600007).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0x600100, 0x600101).portr("SYSTEM"); //
map(0x600200, 0x600201).nopw(); // Leds? Coins?
map(0x600300, 0x600301).portr("DSW1"); // DSW 1
map(0x600302, 0x600303).portr("DSW2"); // DSW 2
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(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites
map(0x600100, 0x600101).portr("SYSTEM");
map(0x600200, 0x600201).nopw(); // LEDs? Coins?
map(0x600300, 0x600301).portr("DSW1"); // DSW 1
map(0x600302, 0x600303).portr("DSW2"); // DSW 2
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(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites
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
}
@ -292,20 +282,20 @@ void mj4simai_state::mj4simai_map(address_map &map)
void seta2_state::myangel_map(address_map &map)
{
map(0x000000, 0x1fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x700000, 0x700001).portr("P1"); // P1
map(0x700002, 0x700003).portr("P2"); // P2
map(0x700004, 0x700005).portr("SYSTEM"); // Coins
map(0x000000, 0x1fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x700000, 0x700001).portr("P1"); // P1
map(0x700002, 0x700003).portr("P2"); // P2
map(0x700004, 0x700005).portr("SYSTEM"); // Coins
map(0x700006, 0x700007).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0x700200, 0x700201).nopw(); // Leds? Coins?
map(0x700300, 0x700301).portr("DSW1"); // DSW 1
map(0x700302, 0x700303).portr("DSW2"); // DSW 2
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(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites
map(0x700200, 0x700201).nopw(); // LEDs? Coins?
map(0x700300, 0x700301).portr("DSW1"); // DSW 1
map(0x700302, 0x700303).portr("DSW2"); // DSW 2
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(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites
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
}
@ -315,20 +305,20 @@ void seta2_state::myangel_map(address_map &map)
void seta2_state::myangel2_map(address_map &map)
{
map(0x000000, 0x1fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x600000, 0x600001).portr("P1"); // P1
map(0x600002, 0x600003).portr("P2"); // P2
map(0x600004, 0x600005).portr("SYSTEM"); // Coins
map(0x000000, 0x1fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x600000, 0x600001).portr("P1"); // P1
map(0x600002, 0x600003).portr("P2"); // P2
map(0x600004, 0x600005).portr("SYSTEM"); // Coins
map(0x600006, 0x600007).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0x600200, 0x600201).nopw(); // Leds? Coins?
map(0x600300, 0x600301).portr("DSW1"); // DSW 1
map(0x600302, 0x600303).portr("DSW2"); // DSW 2
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(0xd00000, 0xd3ffff).ram().share("spriteram"); // Sprites
map(0x600200, 0x600201).nopw(); // LEDs? Coins?
map(0x600300, 0x600301).portr("DSW1"); // DSW 1
map(0x600302, 0x600303).portr("DSW2"); // DSW 2
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(0xd00000, 0xd3ffff).ram().share(m_spriteram); // Sprites
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
}
@ -357,20 +347,20 @@ void seta2_state::pzlbowl_coin_counter_w(uint8_t data)
void seta2_state::pzlbowl_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x400300, 0x400301).portr("DSW1"); // DSW 1
map(0x400302, 0x400303).portr("DSW2"); // DSW 2
map(0x400300, 0x40030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
map(0x500000, 0x500001).portr("P1"); // P1
map(0x500002, 0x500003).portr("P2"); // P2
map(0x000000, 0x0fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x400300, 0x400301).portr("DSW1"); // DSW 1
map(0x400302, 0x400303).portr("DSW2"); // DSW 2
map(0x400300, 0x40030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
map(0x500000, 0x500001).portr("P1"); // P1
map(0x500002, 0x500003).portr("P2"); // P2
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(0x700000, 0x700001).r(FUNC(seta2_state::pzlbowl_protection_r)); // Protection
map(0x800000, 0x83ffff).ram().share("spriteram"); // Sprites
map(0x700000, 0x700001).r(FUNC(seta2_state::pzlbowl_protection_r)); // Protection
map(0x800000, 0x83ffff).ram().share(m_spriteram); // Sprites
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(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
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
}
@ -402,7 +392,7 @@ void seta2_state::penbros_map(address_map &map)
map(0x500300, 0x500301).portr("DSW1");
map(0x500302, 0x500303).portr("DSW2");
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)
@ -453,21 +443,21 @@ void seta2_state::reelquak_coin_w(uint8_t data)
void seta2_state::reelquak_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x300000, 0x303fff).ram().share("nvram"); // NVRAM (Battery Backed)
map(0x400000, 0x400001).portr("P1"); // P1
map(0x400002, 0x400003).portr("TICKET"); // Tickets
map(0x400004, 0x400005).portr("SYSTEM"); // Coins
map(0x000000, 0x0fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x300000, 0x303fff).ram().share("nvram"); // NVRAM (Battery Backed)
map(0x400000, 0x400001).portr("P1"); // P1
map(0x400002, 0x400003).portr("TICKET"); // Tickets
map(0x400004, 0x400005).portr("SYSTEM"); // Coins
map(0x400006, 0x400007).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0x400201, 0x400201).w(FUNC(seta2_state::reelquak_coin_w)); // Coin Counters / IRQ Ack
map(0x400300, 0x400301).portr("DSW1"); // DSW 1
map(0x400302, 0x400303).portr("DSW2"); // DSW 2
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(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites
map(0x400201, 0x400201).w(FUNC(seta2_state::reelquak_coin_w)); // Coin Counters / IRQ Ack
map(0x400300, 0x400301).portr("DSW1"); // DSW 1
map(0x400302, 0x400303).portr("DSW2"); // DSW 2
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(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites
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
}
@ -478,10 +468,10 @@ void seta2_state::reelquak_map(address_map &map)
// To be done:
void seta2_state::namcostr_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
map(0x000000, 0x07ffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0xc00000, 0xc3ffff).ram().share(m_spriteram); // Sprites
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share(m_vregs); // Video Registers
}
@ -506,25 +496,25 @@ void seta2_state::samshoot_map(address_map &map)
map(0x200000, 0x20ffff).ram();
map(0x300000, 0x30ffff).ram().share("nvram");
map(0x400000, 0x400001).portr("DSW1"); // DSW 1
map(0x400002, 0x400003).portr("BUTTONS"); // Buttons
map(0x400000, 0x400001).portr("DSW1"); // DSW 1
map(0x400002, 0x400003).portr("BUTTONS"); // Buttons
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(0x500000, 0x500001).portr("GUN1"); // P1
map(0x580000, 0x580001).portr("GUN2"); // P2
map(0x500000, 0x500001).portr("GUN1"); // P1
map(0x580000, 0x580001).portr("GUN2"); // P2
map(0x700000, 0x700001).portr("TRIGGER"); // Trigger
map(0x700002, 0x700003).portr("PUMP"); // Pump
map(0x700004, 0x700005).portr("COIN"); // 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(0x700000, 0x700001).portr("TRIGGER"); // Trigger
map(0x700002, 0x700003).portr("PUMP"); // Pump
map(0x700004, 0x700005).portr("COIN"); // 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(0x800000, 0x83ffff).ram().share("spriteram"); // Sprites
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(0x800000, 0x83ffff).ram().share(m_spriteram); // Sprites
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(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(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
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
}
@ -657,25 +647,25 @@ void seta2_state::telpacfl_lockout_w(uint8_t data)
void seta2_state::telpacfl_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x300000, 0x303fff).ram().share("nvram"); // NVRAM (Battery Backed)
map(0x600000, 0x600001).portr("DSW1"); // DSW 1
map(0x600002, 0x600003).portr("DSW2"); // DSW 2
map(0x700000, 0x700001).portr("COIN"); // Coin
map(0x700002, 0x700003).portr("P1"); // P1 + Dispenser
map(0x700004, 0x700005).portr("SERVICE"); // Service
map(0x700006, 0x700007).portr("UNKNOWN"); // (unused?)
map(0x700009, 0x700009).w(FUNC(seta2_state::telpacfl_lamp1_w)); // Lamps
map(0x70000d, 0x70000d).w(FUNC(seta2_state::telpacfl_lamp2_w)); // ""
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(0xb00000, 0xb3ffff).ram().share("spriteram"); // Sprites
map(0x000000, 0x0fffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // RAM
map(0x300000, 0x303fff).ram().share("nvram"); // NVRAM (Battery Backed)
map(0x600000, 0x600001).portr("DSW1"); // DSW 1
map(0x600002, 0x600003).portr("DSW2"); // DSW 2
map(0x700000, 0x700001).portr("COIN"); // Coin
map(0x700002, 0x700003).portr("P1"); // P1 + Dispenser
map(0x700004, 0x700005).portr("SERVICE"); // Service
map(0x700006, 0x700007).portr("UNKNOWN"); // (unused?)
map(0x700009, 0x700009).w(FUNC(seta2_state::telpacfl_lamp1_w)); // Lamps
map(0x70000d, 0x70000d).w(FUNC(seta2_state::telpacfl_lamp2_w)); // ""
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(0xb00000, 0xb3ffff).ram().share(m_spriteram); // Sprites
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(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;
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);
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);
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 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);
@ -152,8 +152,7 @@ class mj4simai_state : public seta2_state
public:
mj4simai_state(const machine_config &mconfig, device_type type, const char *tag) :
seta2_state(mconfig, type, tag),
m_p1_key(*this, "P1_KEY%u", 0U),
m_p2_key(*this, "P2_KEY%u", 0U)
m_keys{ { *this, "P1_KEY%u", 0U }, { *this, "P2_KEY%u", 0U } }
{ }
void mj4simai(machine_config &config);
@ -162,13 +161,11 @@ protected:
virtual void machine_start() override;
private:
uint16_t mj4simai_p1_r();
uint16_t mj4simai_p2_r();
template <unsigned Which> uint16_t mj4simai_key_r();
void mj4simai_map(address_map &map);
required_ioport_array<5> m_p1_key;
required_ioport_array<5> m_p2_key;
required_ioport_array<5> m_keys[2];
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
{
@ -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
inline void seta2_state::get_tile(
uint16_t *spriteram,
uint16_t const *const spriteram,
bool is_16x16,
int x,
int y, int page,
int y,
int page,
int &code,
int &attr,
bool &flipx,
@ -662,7 +676,9 @@ void seta2_state::draw_sprites_line(bitmap_ind16 &bitmap, const rectangle &clipr
int code, attr, color;
bool flipx, flipy;
// 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 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;
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;
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);
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;
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,10 +26,10 @@ namespace {
class clie_db_state : public driver_device
{
public:
clie_db_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
clie_db_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu")
{ }
{ }
void t650c(machine_config &config);

View File

@ -12,35 +12,44 @@
#include "screen.h"
#include "speaker.h"
#include "utf8.h"
namespace {
class qs300_state : public driver_device {
public:
qs300_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_subcpu(*this, "subcpu"),
m_swp00(*this, "swp00"),
m_lcdc(*this, "vs254300"),
m_nvram(*this, "ram"),
m_inputs(*this, "DR%u", 0U),
m_is_eos(false)
{ }
qs300_state(const machine_config &mconfig, device_type type, const char *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_subcpu(*this, "subcpu"),
m_swp00(*this, "swp00"),
m_lcdc(*this, "vs254300"),
m_nvram(*this, "ram"),
m_inputs(*this, "DR%u", 0U),
m_is_eos(is_eos)
{
}
required_device<h83002_device> m_maincpu;
required_device<h83002_device> m_subcpu;
required_device<swp00_device> m_swp00;
required_device<t6963c_device> m_lcdc;
required_device<nvram_device> m_nvram;
required_ioport_array<7> m_inputs;
// required_ioport m_sustain;
// required_ioport m_pitch_bend;
//required_ioport m_sustain;
//required_ioport m_pitch_bend;
bool const m_is_eos;
bool m_is_eos;
u8 m_mlatch, m_slatch;
bool m_mlatch_full, m_slatch_full;
@ -73,10 +82,9 @@ protected:
class eos_b900_state : public qs300_state
{
public:
eos_b900_state(const machine_config &mconfig, device_type type, const char *tag)
: qs300_state(mconfig, type, tag)
eos_b900_state(const machine_config &mconfig, device_type type, const char *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
ROM_END
} // anonymous namespace
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 )