mirror of
https://github.com/holub/mame
synced 2025-04-20 23:42:22 +03:00
kyugo: add screen raw params,
shaolins: fix nmi freq regression
This commit is contained in:
parent
b69e389299
commit
f149606c07
@ -181,6 +181,7 @@ private:
|
||||
bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
void shaolins_state::palette(palette_device &palette) const
|
||||
{
|
||||
const uint8_t *color_prom = memregion("proms")->base();
|
||||
@ -312,10 +313,10 @@ void shaolins_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
|
||||
sy--;
|
||||
|
||||
m_gfxdecode->gfx(1)->transmask(bitmap, cliprect,
|
||||
code, color,
|
||||
flipx, flipy,
|
||||
sx, sy,
|
||||
m_palette->transpen_mask(*m_gfxdecode->gfx(1), color, m_palettebank << 5));
|
||||
code, color,
|
||||
flipx, flipy,
|
||||
sx, sy,
|
||||
m_palette->transpen_mask(*m_gfxdecode->gfx(1), color, m_palettebank << 5));
|
||||
}
|
||||
}
|
||||
|
||||
@ -331,11 +332,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(shaolins_state::interrupt)
|
||||
{
|
||||
int const scanline = param;
|
||||
|
||||
// vblank interrupt
|
||||
if (scanline == 240)
|
||||
m_maincpu->set_input_line(0, HOLD_LINE);
|
||||
else if ((scanline % 32) == 0)
|
||||
if (m_nmi_enable & 0x02)
|
||||
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
|
||||
m_maincpu->set_input_line(0, HOLD_LINE);
|
||||
|
||||
// NMI from 16V
|
||||
if ((scanline & 0x1f) == 0x10 && m_nmi_enable & 0x02)
|
||||
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
|
||||
}
|
||||
|
||||
|
||||
@ -505,23 +508,17 @@ GFXDECODE_END
|
||||
|
||||
void shaolins_state::shaolins(machine_config &config)
|
||||
{
|
||||
static constexpr XTAL MASTER_CLOCK = XTAL(18'432'000);
|
||||
|
||||
// basic machine hardware
|
||||
MC6809E(config, m_maincpu, MASTER_CLOCK / 12); // verified on PCB
|
||||
MC6809E(config, m_maincpu, 18.432_MHz_XTAL / 12); // verified on PCB
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &shaolins_state::prg_map);
|
||||
TIMER(config, "scantimer").configure_scanline(FUNC(shaolins_state::interrupt), "screen", 0, 1);
|
||||
WATCHDOG_TIMER(config, "watchdog");
|
||||
|
||||
// video hardware
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||
// m_screen->set_refresh_hz(60);
|
||||
// m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
|
||||
// m_screen->set_size(32*8, 32*8);
|
||||
// m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
|
||||
// Pixel clock is / 3 the master clock (6'144'000)
|
||||
// Refresh rate is 60.606060 Hz, with 40 vblank lines
|
||||
m_screen->set_raw(MASTER_CLOCK / 3, 384, 0, 256, 264, 16, 240);
|
||||
m_screen->set_raw(18.432_MHz_XTAL / 3, 384, 0, 256, 264, 16, 240);
|
||||
m_screen->set_screen_update(FUNC(shaolins_state::screen_update));
|
||||
m_screen->set_palette(m_palette);
|
||||
|
||||
@ -531,21 +528,11 @@ void shaolins_state::shaolins(machine_config &config)
|
||||
// sound hardware
|
||||
SPEAKER(config, "mono").front_center();
|
||||
|
||||
SN76489A(config, "sn1", MASTER_CLOCK / 12).add_route(ALL_OUTPUTS, "mono", 1.0); // verified on PCB
|
||||
|
||||
SN76489A(config, "sn2", MASTER_CLOCK / 6).add_route(ALL_OUTPUTS, "mono", 1.0); // verified on PCB
|
||||
// also seen with SN76489 instead of SN76489A on a bootleg board
|
||||
SN76489A(config, "sn1", 18.432_MHz_XTAL / 12).add_route(ALL_OUTPUTS, "mono", 1.0); // verified on PCB
|
||||
SN76489A(config, "sn2", 18.432_MHz_XTAL / 6).add_route(ALL_OUTPUTS, "mono", 1.0); // verified on PCB
|
||||
}
|
||||
|
||||
#if 0 // a bootleg board was found with downgraded sound hardware, but is otherwise the same
|
||||
void shaolins_state::shaolinb(machine_config &config)
|
||||
{
|
||||
shaolins(config);
|
||||
|
||||
SN76489(config.replace(), "sn1", MASTER_CLOCK / 12).add_route(ALL_OUTPUTS, "mono", 1.0); // only type verified on PCB
|
||||
|
||||
SN76489(config.replace(), "sn2", MASTER_CLOCK / 6).add_route(ALL_OUTPUTS, "mono", 1.0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
|
@ -128,6 +128,7 @@ Notes:
|
||||
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "machine/74259.h"
|
||||
#include "machine/timer.h"
|
||||
#include "machine/watchdog.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
@ -178,7 +179,7 @@ private:
|
||||
void scroll_y_w(uint8_t data);
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(vblank_irq);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
|
||||
|
||||
void flashgala_sub_map(address_map &map) ATTR_COLD;
|
||||
void flashgala_sub_portmap(address_map &map) ATTR_COLD;
|
||||
@ -907,10 +908,17 @@ void kyugo_state::machine_reset()
|
||||
m_fgcolor = 0;
|
||||
}
|
||||
|
||||
INTERRUPT_GEN_MEMBER(kyugo_state::vblank_irq)
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(kyugo_state::interrupt)
|
||||
{
|
||||
if (m_nmi_mask)
|
||||
device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero);
|
||||
int scanline = param;
|
||||
|
||||
// vblank interrupt
|
||||
if (scanline == 240 && m_nmi_mask)
|
||||
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
|
||||
|
||||
// 4 sound interrupts per frame
|
||||
if ((scanline & 0x3f) == 0x20)
|
||||
m_subcpu->set_input_line(0, HOLD_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -920,12 +928,11 @@ void kyugo_state::kyugo_base(machine_config &config)
|
||||
Z80(config, m_maincpu, 18.432_MHz_XTAL / 6); // verified on pcb
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &kyugo_state::kyugo_main_map);
|
||||
m_maincpu->set_addrmap(AS_IO, &kyugo_state::kyugo_main_portmap);
|
||||
m_maincpu->set_vblank_int("screen", FUNC(kyugo_state::vblank_irq));
|
||||
TIMER(config, "scantimer").configure_scanline(FUNC(kyugo_state::interrupt), "screen", 0, 1);
|
||||
|
||||
Z80(config, m_subcpu, 18.432_MHz_XTAL / 6); // verified on pcb
|
||||
m_subcpu->set_addrmap(AS_PROGRAM, &kyugo_state::gyrodine_sub_map);
|
||||
m_subcpu->set_addrmap(AS_IO, &kyugo_state::gyrodine_sub_portmap);
|
||||
m_subcpu->set_periodic_int(FUNC(kyugo_state::irq0_line_hold), attotime::from_hz(4*60));
|
||||
|
||||
config.set_maximum_quantum(attotime::from_hz(6000));
|
||||
|
||||
@ -936,10 +943,7 @@ void kyugo_state::kyugo_base(machine_config &config)
|
||||
|
||||
// video hardware
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.set_refresh_hz(60);
|
||||
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate
|
||||
screen.set_size(64*8, 32*8);
|
||||
screen.set_visarea(0*8, 36*8-1, 2*8, 30*8-1);
|
||||
screen.set_raw(18.432_MHz_XTAL / 3, 396, 0, 288, 260, 16, 240);
|
||||
screen.set_screen_update(FUNC(kyugo_state::screen_update));
|
||||
screen.set_palette(m_palette);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user