void sandscrp_state::screen_eof(screen_device &screen, bool state) { // rising edge if (state) { m_sprite_irq = 1; update_irq_state(); m_pandora->eof(); } }
void sandscrp_state::screen_eof_sandscrp(screen_device &screen, bool state) { // rising edge if (state) { device_t *pandora = machine().device("pandora"); m_sprite_irq = 1; update_irq_state(machine()); pandora_eof(pandora); } }
static IRQ_CALLBACK( irq_callback ) { dcheese_state *state = device->machine().driver_data<dcheese_state>(); /* auto-ack the IRQ */ state->m_irq_state[irqline] = 0; update_irq_state(device); /* vector is 0x40 + index */ return 0x40 + irqline; }
static SCREEN_VBLANK( sandscrp ) { // rising edge if (vblank_on) { sandscrp_state *state = screen.machine().driver_data<sandscrp_state>(); device_t *pandora = screen.machine().device("pandora"); state->m_sprite_irq = 1; update_irq_state(screen.machine()); pandora_eof(pandora); } }
static WRITE16_HANDLER( hyprduel_irq_cause_w ) { if (ACCESSING_LSB) { if (data == int_num) requested_int &= ~(int_num & ~*hypr_irq_enable); else requested_int &= ~(data & *hypr_irq_enable); update_irq_state(); } }
static void StuffSubchannel(uint8 meow, int subindex) { if(subindex == -2) SubChannelData = 0x00; else if(subindex == -1) SubChannelData = 0x80; else SubChannelData = meow & 0x7F; _Port[0x3] |= 0x10; update_irq_state(); }
static void update_irq_state_timer_common(void *param, int voicenum) { struct YMZ280BChip *chip = param; struct YMZ280BVoice *voice = &chip->voice[voicenum]; if(!voice->irq_schedule) return; voice->playing = 0; chip->status_register |= 1 << voicenum; update_irq_state(chip); voice->irq_schedule = 0; }
/* Clear the cause of the interrupt */ static WRITE16_HANDLER( sandscrp_irq_cause_w ) { if (ACCESSING_BITS_0_7) { kaneko16_sprite_flipx = data & 1; kaneko16_sprite_flipy = data & 1; if (data & 0x08) sprite_irq = 0; if (data & 0x10) unknown_irq = 0; if (data & 0x20) vblank_irq = 0; } update_irq_state(space->machine); }
static void StuffSubchannel(uint8 meow, int subindex) { uint8 tmp_data = meow & 0x7F; if(subindex == -2) tmp_data = 0x00; else if(subindex == -1) tmp_data = 0x80; if(SubChannelFIFO.CanWrite()) SubChannelFIFO.Write(&tmp_data, 1); _Port[0x3] |= 0x10; update_irq_state(); }
/* Clear the cause of the interrupt */ static WRITE16_HANDLER( sandscrp_irq_cause_w ) { sandscrp_state *state = space->machine->driver_data<sandscrp_state>(); if (ACCESSING_BITS_0_7) { kaneko16_sprite_flipx = data & 1; kaneko16_sprite_flipy = data & 1; if (data & 0x08) state->sprite_irq = 0; if (data & 0x10) state->unknown_irq = 0; if (data & 0x20) state->vblank_irq = 0; } update_irq_state(space->machine); }
static TIMER_DEVICE_CALLBACK( hyprduel_interrupt ) { hyprduel_state *state = timer.machine().driver_data<hyprduel_state>(); int line = param; if (line == 0) /* TODO: fix this! */ { state->m_requested_int |= 0x01; /* vblank */ state->m_requested_int |= 0x20; device_set_input_line(state->m_maincpu, 2, HOLD_LINE); /* the duration is a guess */ timer.machine().scheduler().timer_set(attotime::from_usec(2500), FUNC(vblank_end_callback), 0x20); } else state->m_requested_int |= 0x12; /* hsync */ update_irq_state(timer.machine()); }
void z80pio_d_w(int which, int ch, UINT8 data) { z80pio *pio = pios + which; pio->out[ch] = data; /* latch out data */ switch (pio->mode[ch]) { case PIO_MODE0: /* mode 0 output */ case PIO_MODE2: /* mode 2 i/o */ set_rdy(pio, ch, 1); /* ready = H */ update_irq_state(pio, ch); return; case PIO_MODE1: /* mode 1 input */ case PIO_MODE3: /* mode 0 bit */ return; default: logerror("PIO-%c data write,bad mode\n",'A'+ch ); } }
int z80pio_p_r(int which, UINT8 ch) { z80pio *pio = pios + which; switch (pio->mode[ch]) { case PIO_MODE2: /* port A only */ case PIO_MODE0: set_rdy(pio, ch, 0); update_irq_state(pio, ch); break; case PIO_MODE1: logerror("PIO-%c INPUT mode and data read\n",'A'+ch ); break; case PIO_MODE3: return (pio->in[ch] & pio->dir[ch]) | (pio->out[ch] & ~pio->dir[ch]); } return pio->out[ch]; }
static void riot_interrupt(int parm) { /* if we're doing the initial interval counting... */ if (riot_state == RIOT_COUNT) { /* generate the IRQ */ riot_irq_flag |= 0x80; riot_irq_state = riot_timer_irq_enable; update_irq_state(); /* now start counting clock cycles down */ riot_state = RIOT_POST_COUNT; timer_adjust(riot_timer, SH6532_PERIOD * 0xff, 0, 0); } /* if not, we are done counting down */ else { riot_state = RIOT_IDLE; timer_adjust(riot_timer, TIME_NEVER, 0, 0); } }
static TIMER_CALLBACK( riot_interrupt ) { /* if we're doing the initial interval counting... */ if (riot_state == RIOT_COUNT) { /* generate the IRQ */ riot_irq_flag |= 0x80; riot_irq_state = riot_timer_irq_enable; update_irq_state(0); /* now start counting clock cycles down */ riot_state = RIOT_POST_COUNT; timer_adjust_oneshot(riot_timer, attotime_mul(ATTOTIME_IN_HZ(SH6532_CLOCK), 0xff), 0); } /* if not, we are done counting down */ else { riot_state = RIOT_IDLE; timer_adjust_oneshot(riot_timer, attotime_never, 0); } }
static void CDIRQ(int type) { #ifdef PCECD_DEBUG if(type != 0x8000 || _Port[0x3] & 0x60) printf("CDIRQ: %d\n", type); #endif if(type & 0x8000) { type &= 0x7FFF; if(type == PCECD_Drive_IRQ_DATA_TRANSFER_DONE) _Port[0x3] &= ~0x20; else if(type == PCECD_Drive_IRQ_DATA_TRANSFER_READY) _Port[0x3] &= ~0x40; } else if(type == PCECD_Drive_IRQ_DATA_TRANSFER_DONE) { _Port[0x3] |= 0x20; } else if(type == PCECD_Drive_IRQ_DATA_TRANSFER_READY) { _Port[0x3] |= 0x40; } update_irq_state(); }
void dcheese_state::dcheese_signal_irq(int which ) { m_irq_state[which] = 1; update_irq_state(); }
uint8 PCECD_Read(uint32 A) { uint8 ret = 0; if((A & 0x18c0) == 0x18c0) { switch (A & 0x18cf) { case 0x18c1: ret = 0xaa; break; case 0x18c2: ret = 0x55; break; case 0x18c3: ret = 0x00; break; case 0x18c5: ret = 0xaa; break; case 0x18c6: ret = 0x55; break; case 0x18c7: ret = 0x03; break; } } else switch(A & 0xf) { case 0x0: ret = 0; ret |= SCSICD_GetBSY() ? 0x80 : 0x00; ret |= SCSICD_GetREQ() ? 0x40 : 0x00; ret |= SCSICD_GetMSG() ? 0x20 : 0x00; ret |= SCSICD_GetCD() ? 0x10 : 0x00; ret |= SCSICD_GetIO() ? 0x08 : 0x00; break; case 0x1: ret = SCSICD_GetDB(); break; case 0x2: ret = _Port[2]; break; //ret = _Port[2] & 0x7f; ret |= SCSICD_GetACK() ? 0x80 : 0x00; break; case 0x3: bBRAMEnabled = FALSE; /* switch left/right of digitized cd playback */ ret = _Port[0x3]; if(!PCE_InDebug) _Port[0x3] ^= 2; break; case 0x4: ret = _Port[4]; break; case 0x5: if(_Port[0x3] & 0x2) ret = RawPCMVolumeCache[1]&0xff; // Right else ret = RawPCMVolumeCache[0]&0xff; // Left break; case 0x6: if(_Port[0x3] & 0x2) ret = ((uint16)RawPCMVolumeCache[1]) >> 8; // Right else ret = ((uint16)RawPCMVolumeCache[0]) >> 8; // Left break; case 0x7: if(!PCE_InDebug) { _Port[0x3] &= ~0x10; update_irq_state(); } ret = SubChannelData; break; case 0x8: ret = read_1808(); break; case 0xa: ret = ADPCM_ReadBuffer(); break; case 0xb: ret = _Port[0xb]; break; case 0xc: ret = 0x00; ret |= ADPCM_IsPlaying() ? 0x8 : 0x1; ret |= ADPCM_IsWritePending() ? 0x04 : 0x00; ret |= ADPCM_IsBusyReading() ? 0x80 : 0x00; break; case 0xd: ret = ADPCM_Read180D(); break; }
static TIMER_CALLBACK( hyprduel_blit_done ) { hyprduel_state *state = machine.driver_data<hyprduel_state>(); state->m_requested_int |= 1 << state->m_blitter_bit; update_irq_state(machine); }
static void m68k_gen_int(device_t *device, int state) { artmagic_state *drvstate = device->machine().driver_data<artmagic_state>(); drvstate->m_tms_irq = state; update_irq_state(device->machine()); }
void artmagic_state::machine_reset() { m_tms_irq = m_hack_irq = 0; update_irq_state(machine()); }
/* Called once/frame to generate the VBLANK interrupt */ static INTERRUPT_GEN( sandscrp_interrupt ) { sandscrp_state *state = device->machine().driver_data<sandscrp_state>(); state->m_vblank_irq = 1; update_irq_state(device->machine()); }
void tmp68301_external_interrupt_2() { tmp68301_IE[2] = 1; update_irq_state(); }
MDFN_FASTCALL uint8 PCECD_Read(uint32 timestamp, uint32 A) { uint8 ret = 0; if((A & 0x18c0) == 0x18c0) { switch (A & 0x18cf) { case 0x18c1: ret = 0xaa; break; case 0x18c2: ret = 0x55; break; case 0x18c3: ret = 0x00; break; case 0x18c5: ret = 0xaa; break; case 0x18c6: ret = 0x55; break; case 0x18c7: ret = 0x03; break; } } else { PCECD_Run(timestamp); switch(A & 0xf) { case 0x0: ret = 0; ret |= PCECD_Drive_GetBSY() ? 0x80 : 0x00; ret |= PCECD_Drive_GetREQ() ? 0x40 : 0x00; ret |= PCECD_Drive_GetMSG() ? 0x20 : 0x00; ret |= PCECD_Drive_GetCD() ? 0x10 : 0x00; ret |= PCECD_Drive_GetIO() ? 0x08 : 0x00; break; case 0x1: ret = PCECD_Drive_GetDB(); break; case 0x2: ret = _Port[2]; break; case 0x3: bBRAMEnabled = false; /* switch left/right of digitized cd playback */ ret = _Port[0x3]; _Port[0x3] ^= 2; break; case 0x4: ret = _Port[4]; break; case 0x5: if(_Port[0x3] & 0x2) ret = RawPCMVolumeCache[1] & 0xff; // Right else ret = RawPCMVolumeCache[0] & 0xff; // Left break; case 0x6: if(_Port[0x3] & 0x2) ret = ((uint16)RawPCMVolumeCache[1]) >> 8; // Right else ret = ((uint16)RawPCMVolumeCache[0]) >> 8; // Left break; case 0x7: if(SubChannelFIFO.CanRead() > 0) ret = SubChannelFIFO.ReadByte(); else ret = 0x00; // Not sure if it's 0, 0xFF, the last byte read, or something else. if(SubChannelFIFO.CanRead() == 0) { _Port[0x3] &= ~0x10; update_irq_state(); } break; case 0x8: ret = read_1808(timestamp); break; case 0xa: ADPCM_DEBUG("ReadBuffer\n"); ADPCM.ReadPending = 19 * 3; //24 * 3; ret = ADPCM.ReadBuffer; break; case 0xb: ret = _Port[0xb]; break; case 0xc: //printf("ADPCM Status Read: %d\n", timestamp); ret = 0x00; ret |= (ADPCM.EndReached) ? 0x01 : 0x00; ret |= (ADPCM.Playing) ? 0x08 : 0x00; ret |= (ADPCM.WritePending > 0) ? 0x04 : 0x00; ret |= (ADPCM.ReadPending > 0) ? 0x80 : 0x00; break; case 0xd: ret = ADPCM.LastCmd; break; } }
/* Called once/frame to generate the VBLANK interrupt */ static INTERRUPT_GEN( sandscrp_interrupt ) { vblank_irq = 1; update_irq_state(device->machine); }
void exidy_sound_device::r6532_irq(int state) { m_riot_irq_state = (state == ASSERT_LINE) ? 1 : 0; update_irq_state(0); }
void tmp68301_device::external_interrupt_2() { m_IE[2] = 1; update_irq_state(); }
static void exidy_irq(int state) { pia_irq_state = state; update_irq_state(); }
void tmp68301_device::external_interrupt_2() { update_irq_state(EXT_IRQ2); }
static void r6532_irq(running_device *device, int state) { riot_irq_state = (state == ASSERT_LINE) ? 1 : 0; update_irq_state(device, 0); }