k001604: added callback for vblank irq

This commit is contained in:
Ville Linde 2021-07-23 05:08:54 +03:00
parent 70667e3fdf
commit baf71cb650
2 changed files with 26 additions and 1 deletions

View File

@ -17,6 +17,7 @@
* Foreground tiles 2x or 4x 1Mbit SRAM in a 16-bit bus.
- GTI Club: 37C 34C 32C 29C filled
- NWK-TR: 34A 31A filled, no empty solder pads
- Cobra: 6F 6H
* Background tiles 2x or 4x 1Mbit SRAM in a 16-bit bus.
- GTI Club: 37A 34A filled, 32A 29A empty
- NWK-TR: 34C 31C 28C 25C empty
@ -28,6 +29,7 @@
CLUT RAM:
* 2x 256KBit SRAMs on NWK-TR in a 16-bit bus (32768 colors)
* 2x 64Kbit SRAMs on "GTI Club" in a 16-bit bus (8192 colors)
* 3x 256KBit SRAMs on Cobra in a 24-bit bus (32768 colors). Cobra uses 24-bit colors instead of 15-bit.
Background and foreground layer with ROZ capabilities
Both tilemaps are 128x128 tiles, with ability to use smaller sub-tilemaps
@ -159,7 +161,8 @@ k001604_device::k001604_device(const machine_config &mconfig, const char *tag, d
m_tile_ram(nullptr),
m_fg_char_ram(nullptr),
m_bg_char_ram(nullptr),
m_reg(nullptr)
m_reg(nullptr),
m_irq(*this)
{
}
@ -169,6 +172,8 @@ k001604_device::k001604_device(const machine_config &mconfig, const char *tag, d
void k001604_device::device_start()
{
m_irq.resolve_safe();
if (!palette().device().started())
throw device_missing_dependencies();
@ -542,4 +547,20 @@ void k001604_device::char_w(offs_t offset, uint32_t data, uint32_t mem_mask)
void k001604_device::reg_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
COMBINE_DATA(m_reg.get() + offset);
if (offset == 0x5c / 4)
{
if (ACCESSING_BITS_24_31)
{
// Cobra clears and enables 0x1 in the IRQ handler
// (1 = enable VBLANK IRQ, 0 = clear IRQ?)
if ((data & 0x1) == 0)
{
if (!m_irq.isnull())
{
m_irq(CLEAR_LINE);
}
}
}
}
}

View File

@ -13,6 +13,8 @@ class k001604_device : public device_t, public device_gfx_interface
public:
k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
auto irq_callback() { return m_irq.bind(); }
void draw_tilemap(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool front, tilemap_t* tilemap);
void draw_back_layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@ -42,6 +44,8 @@ private:
TILE_GET_INFO_MEMBER(tile_info_fg);
TILE_GET_INFO_MEMBER(tile_info_bg8);
TILE_GET_INFO_MEMBER(tile_info_bg16);
devcb_write_line m_irq;
};
DECLARE_DEVICE_TYPE(K001604, k001604_device)