Skip to content

Commit 4703e4a

Browse files
committed
ddayjlc: partial revert, it still missed sound irqs
1 parent d53aae3 commit 4703e4a

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/mame/jaleco/dday.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class dday_state : public driver_device
124124
void main_map(address_map &map) ATTR_COLD;
125125
void sound_map(address_map &map) ATTR_COLD;
126126

127-
/* devices */
127+
// devices
128128
required_device<z80_device> m_maincpu;
129129
required_device<z80_device> m_audiocpu;
130130
required_device<gfxdecode_device> m_gfxdecode;
@@ -134,22 +134,23 @@ class dday_state : public driver_device
134134
required_device<i8257_device> m_dma;
135135
required_memory_bank m_bank;
136136

137-
/* memory pointers */
137+
// memory pointers
138138
required_shared_ptr<u8> m_mainram;
139139
required_shared_ptr<u8> m_spriteram;
140140
required_shared_ptr<u8> m_videoram;
141141
required_shared_ptr<u8> m_bgvram;
142142
required_region_ptr<u8> m_proms;
143143

144-
/* video-related */
144+
// video-related
145145
tilemap_t *m_bg_tilemap = nullptr;
146146
tilemap_t *m_fg_tilemap = nullptr;
147147
u8 m_char_bank = 0;
148148
u8 m_bgadr = 0;
149149

150-
/* misc */
150+
// misc
151151
bool m_main_nmi_enable = false;
152152
bool m_sound_nmi_enable = false;
153+
bool m_sound_irq_clock = false;
153154
u8 m_prot_addr = 0;
154155

155156
u8 dma_mem_r(offs_t offset);
@@ -366,7 +367,10 @@ void dday_state::bg2_w(u8 data)
366367

367368
void dday_state::sound_irq_w(u8 data)
368369
{
369-
m_audiocpu->set_input_line(0, BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE);
370+
// 7474 to audiocpu irq? (pulse is too short for direct assert/clear)
371+
if (!BIT(data, 0) && m_sound_irq_clock)
372+
m_audiocpu->set_input_line(0, HOLD_LINE);
373+
m_sound_irq_clock = BIT(data, 0);
370374
}
371375

372376
void dday_state::flip_screen_w(u8 data)
@@ -380,7 +384,7 @@ void dday_state::main_map(address_map &map)
380384
map(0x8000, 0x8fff).ram().share("mainram");
381385
map(0x9000, 0x93ff).ram().share("spriteram");
382386
map(0x9400, 0x97ff).ram().w(FUNC(dday_state::vram_w)).share("videoram");
383-
map(0x9800, 0x9fff).ram().w(FUNC(dday_state::bgvram_w)).share("bgram"); /* 9800-981f - videoregs */
387+
map(0x9800, 0x9fff).ram().w(FUNC(dday_state::bgvram_w)).share("bgram"); // 9800-981f - videoregs
384388
map(0xa000, 0xdfff).bankr("bank").nopw();
385389
map(0xe000, 0xe008).rw(m_dma, FUNC(i8257_device::read), FUNC(i8257_device::write));
386390
map(0xf000, 0xf000).portr("P1").w(m_soundlatch, FUNC(generic_latch_8_device::write));
@@ -517,6 +521,7 @@ void dday_state::machine_start()
517521
save_item(NAME(m_bgadr));
518522
save_item(NAME(m_main_nmi_enable));
519523
save_item(NAME(m_sound_nmi_enable));
524+
save_item(NAME(m_sound_irq_clock));
520525
save_item(NAME(m_prot_addr));
521526
save_item(NAME(m_dma_latch));
522527
}
@@ -527,6 +532,7 @@ void dday_state::machine_reset()
527532
m_bgadr = 0;
528533
m_sound_nmi_enable = false;
529534
m_main_nmi_enable = false;
535+
m_sound_irq_clock = false;
530536
m_prot_addr = 0;
531537
m_dma_latch = 0;
532538
}
@@ -580,7 +586,7 @@ void dday_state::dma_w(u8 data)
580586

581587
void dday_state::dday(machine_config &config)
582588
{
583-
/* basic machine hardware */
589+
// basic machine hardware
584590
Z80(config, m_maincpu, 12_MHz_XTAL / 4);
585591
m_maincpu->set_addrmap(AS_PROGRAM, &dday_state::main_map);
586592
m_maincpu->busack_cb().set(m_dma, FUNC(i8257_device::hlda_w));
@@ -598,7 +604,7 @@ void dday_state::dday(machine_config &config)
598604
m_dma->out_iow_cb<0>().set(FUNC(dday_state::dma_w));
599605
m_dma->set_reverse_rw_mode(true);
600606

601-
/* video hardware */
607+
// video hardware
602608
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
603609
m_screen->set_refresh_hz(60);
604610
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
@@ -611,6 +617,7 @@ void dday_state::dday(machine_config &config)
611617
GFXDECODE(config, m_gfxdecode, m_palette, gfx_dday);
612618
PALETTE(config, m_palette, FUNC(dday_state::dday_palette), 0x200);
613619

620+
// sound hardware
614621
SPEAKER(config, "mono").front_center();
615622

616623
GENERIC_LATCH_8(config, m_soundlatch);

0 commit comments

Comments
 (0)