mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
konami/k057714.cpp: Removed unecessary clipping that caused medal games not to display properly and improve VBL IRQ handling. [R. Belmont, Windy Fairy]
This commit is contained in:
parent
12099b0e08
commit
77e0a47c21
24
src/mame/konami/firebeat.cpp
Normal file → Executable file
24
src/mame/konami/firebeat.cpp
Normal file → Executable file
@ -136,6 +136,13 @@
|
||||
at any point during the frame. It's mainly used to call display lists, which is where
|
||||
the display list addresses come from. Some games use it to send other commands, so
|
||||
it appears to be a 4-dword FIFO or something along those lines.
|
||||
|
||||
// IRQs
|
||||
// IRQ 0: VBlank
|
||||
// IRQ 1: Extend board IRQ
|
||||
// IRQ 2: Main board UART
|
||||
// IRQ 3: SPU mailbox interrupt
|
||||
// IRQ 4: ATA
|
||||
*/
|
||||
|
||||
#include "emu.h"
|
||||
@ -426,7 +433,6 @@ protected:
|
||||
void lamp_output2_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
|
||||
void lamp_output3_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
|
||||
|
||||
INTERRUPT_GEN_MEMBER(firebeat_interrupt);
|
||||
void ata_interrupt(int state);
|
||||
void gcu_interrupt(int state);
|
||||
void sound_irq_callback(int state);
|
||||
@ -732,7 +738,6 @@ void firebeat_state::firebeat(machine_config &config)
|
||||
/* basic machine hardware */
|
||||
PPC403GCX(config, m_maincpu, XTAL(66'000'000));
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &firebeat_state::firebeat_map);
|
||||
m_maincpu->set_vblank_int("screen", FUNC(firebeat_state::firebeat_interrupt));
|
||||
|
||||
RTC65271(config, "rtc", 0);
|
||||
|
||||
@ -751,6 +756,7 @@ void firebeat_state::firebeat(machine_config &config)
|
||||
screen.set_raw(25.175_MHz_XTAL, 800, 0, 640, 525, 0, 480);
|
||||
screen.set_screen_update(FUNC(firebeat_state::screen_update_firebeat_0));
|
||||
screen.set_palette("palette");
|
||||
screen.screen_vblank().set(m_gcu, FUNC(k057714_device::vblank_w));
|
||||
|
||||
K057714(config, m_gcu, 0).set_screen("screen");
|
||||
m_gcu->irq_callback().set(FUNC(firebeat_state::gcu_interrupt));
|
||||
@ -1152,18 +1158,6 @@ void firebeat_state::lamp_output3_w(offs_t offset, uint32_t data, uint32_t mem_m
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
INTERRUPT_GEN_MEMBER(firebeat_state::firebeat_interrupt)
|
||||
{
|
||||
// IRQs
|
||||
// IRQ 0: VBlank
|
||||
// IRQ 1: Extend board IRQ
|
||||
// IRQ 2: Main board UART
|
||||
// IRQ 3: SPU mailbox interrupt
|
||||
// IRQ 4: ATA
|
||||
|
||||
device.execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
|
||||
}
|
||||
|
||||
void firebeat_state::ata_interrupt(int state)
|
||||
{
|
||||
m_maincpu->set_input_line(INPUT_LINE_IRQ4, state);
|
||||
@ -1790,7 +1784,6 @@ void firebeat_kbm_state::firebeat_kbm(machine_config &config)
|
||||
/* basic machine hardware */
|
||||
PPC403GCX(config, m_maincpu, XTAL(66'000'000));
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &firebeat_kbm_state::firebeat_kbm_map);
|
||||
m_maincpu->set_vblank_int("lscreen", FUNC(firebeat_kbm_state::firebeat_interrupt));
|
||||
|
||||
RTC65271(config, "rtc", 0);
|
||||
|
||||
@ -1810,6 +1803,7 @@ void firebeat_kbm_state::firebeat_kbm(machine_config &config)
|
||||
lscreen.set_raw(25.175_MHz_XTAL, 800, 0, 640, 525, 0, 480);
|
||||
lscreen.set_screen_update(FUNC(firebeat_kbm_state::screen_update_firebeat_0));
|
||||
lscreen.set_palette("palette");
|
||||
lscreen.screen_vblank().set(m_gcu, FUNC(k057714_device::vblank_w));
|
||||
|
||||
K057714(config, m_gcu, 0).set_screen("lscreen");
|
||||
m_gcu->irq_callback().set(FUNC(firebeat_kbm_state::gcu_interrupt));
|
||||
|
28
src/mame/konami/k057714.cpp
Normal file → Executable file
28
src/mame/konami/k057714.cpp
Normal file → Executable file
@ -29,6 +29,7 @@ DEFINE_DEVICE_TYPE(K057714, k057714_device, "k057714", "k057714_device GCU")
|
||||
k057714_device::k057714_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, K057714, tag, owner, clock)
|
||||
, device_video_interface(mconfig, *this)
|
||||
, m_irqctrl(0)
|
||||
, m_irq(*this)
|
||||
{
|
||||
}
|
||||
@ -225,9 +226,16 @@ void k057714_device::write(offs_t offset, uint32_t data, uint32_t mem_mask)
|
||||
case 0x10:
|
||||
/* IRQ clear/enable; ppd writes bit off then on in response to interrupt */
|
||||
/* it enables bits 0x41, but 0x01 seems to be the one it cares about */
|
||||
if (ACCESSING_BITS_16_31 && (data & 0x00010000) == 0)
|
||||
if (ACCESSING_BITS_16_31)
|
||||
{
|
||||
m_irq(CLEAR_LINE);
|
||||
data >>= 16;
|
||||
|
||||
if (!BIT(data, 0))
|
||||
{
|
||||
m_irq(CLEAR_LINE);
|
||||
}
|
||||
|
||||
m_irqctrl = data;
|
||||
}
|
||||
if (ACCESSING_BITS_0_15)
|
||||
{
|
||||
@ -512,6 +520,14 @@ void k057714_device::draw_frame(int frame, bitmap_ind16 &bitmap, const rectangle
|
||||
}
|
||||
}
|
||||
|
||||
void k057714_device::vblank_w(int state)
|
||||
{
|
||||
if ((state) && (m_irqctrl & 1))
|
||||
{
|
||||
m_irq(ASSERT_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
int k057714_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
bitmap.fill(0, cliprect);
|
||||
@ -616,14 +632,6 @@ void k057714_device::draw_object(uint32_t *cmd)
|
||||
return;
|
||||
}
|
||||
|
||||
int fb_width = m_frame[0].width + 1;
|
||||
int fb_height = m_frame[0].height + 1;
|
||||
|
||||
if (width > fb_width)
|
||||
width = fb_width;
|
||||
if (height > fb_height)
|
||||
height = fb_height;
|
||||
|
||||
int fb_pitch = 1024;
|
||||
|
||||
int v = 0;
|
||||
|
@ -22,6 +22,8 @@ public:
|
||||
void write(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
|
||||
void fifo_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
|
||||
|
||||
void vblank_w(int state);
|
||||
|
||||
struct framebuffer
|
||||
{
|
||||
uint32_t base;
|
||||
@ -87,6 +89,8 @@ private:
|
||||
|
||||
uint32_t m_pixclock;
|
||||
|
||||
uint16_t m_irqctrl;
|
||||
|
||||
devcb_write_line m_irq;
|
||||
};
|
||||
|
||||
|
@ -122,7 +122,6 @@ private:
|
||||
void ifu_dpram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
|
||||
|
||||
void gcu_interrupt(int state);
|
||||
INTERRUPT_GEN_MEMBER(vbl_interrupt);
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
@ -382,19 +381,11 @@ void konendev_state::gcu_interrupt(int state)
|
||||
m_maincpu->set_input_line(INPUT_LINE_IRQ3, state);
|
||||
}
|
||||
|
||||
|
||||
INTERRUPT_GEN_MEMBER(konendev_state::vbl_interrupt)
|
||||
{
|
||||
device.execute().set_input_line(INPUT_LINE_IRQ1, ASSERT_LINE);
|
||||
device.execute().set_input_line(INPUT_LINE_IRQ3, ASSERT_LINE);
|
||||
}
|
||||
|
||||
void konendev_state::konendev(machine_config &config)
|
||||
{
|
||||
// basic machine hardware
|
||||
PPC403GCX(config, m_maincpu, 32'000'000); // Clock unknown
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &konendev_state::main_map);
|
||||
m_maincpu->set_vblank_int("screen", FUNC(konendev_state::vbl_interrupt));
|
||||
|
||||
H83007(config, m_ifu, 8'000'000); // Clock unknown
|
||||
m_ifu->set_addrmap(AS_PROGRAM, &konendev_state::ifu_map);
|
||||
@ -421,6 +412,7 @@ void konendev_state::konendev(machine_config &config)
|
||||
screen.set_raw(25.175_MHz_XTAL, 800, 0, 640, 525, 0, 480); // Based on Firebeat settings
|
||||
screen.set_screen_update(FUNC(konendev_state::screen_update));
|
||||
screen.set_palette("palette");
|
||||
screen.screen_vblank().set(m_gcu, FUNC(k057714_device::vblank_w));
|
||||
|
||||
K057714(config, m_gcu, 0).set_screen("screen");
|
||||
m_gcu->irq_callback().set(FUNC(konendev_state::gcu_interrupt));
|
||||
|
Loading…
Reference in New Issue
Block a user