//============================================================ // lock_buffer //============================================================ static int lock_buffer(running_machine &machine, long offset, long size, void **buffer1, long *length1, void **buffer2, long *length2) { volatile long pstart, pend, lstart, lend; if (!buf_locked) { if (machine.video().throttled()) { pstart = stream_playpos; pend = (pstart + sdl_xfer_samples); lstart = offset; lend = lstart+size; while (((pstart >= lstart) && (pstart <= lend)) || ((pend >= lstart) && (pend <= lend))) { pstart = stream_playpos; pend = pstart + sdl_xfer_samples; } } SDL_LockAudio(); buf_locked++; } // init lengths *length1 = *length2 = 0; if ((offset + size) > stream_buffer_size) { // 2-piece case *length1 = stream_buffer_size - offset; *buffer1 = &stream_buffer[offset]; *length2 = size - *length1; *buffer2 = stream_buffer; } else { // normal 1-piece case *length1 = size; *buffer1 = &stream_buffer[offset]; } if (LOG_SOUND) fprintf(sound_log, "locking %ld bytes at offset %ld (total %d, playpos %d): len1 %ld len2 %ld\n", size, offset, stream_buffer_size, stream_playpos, *length1, *length2); return 0; }
int TMS9928A_interrupt(running_machine &machine) { int b; /* when skipping frames, calculate sprite collision */ if (machine.video().skip_this_frame()) { if (TMS_SPRITES_ENABLED) { draw_sprites (machine.primary_screen, NULL, NULL); } } tms.StatusReg |= 0x80; b = (tms.Regs[1] & 0x20) != 0; if (b != tms.INT) { tms.INT = b; if (tms.INTCallback) tms.INTCallback (machine, tms.INT); } return b; }
void debugger_refresh_display(running_machine &machine) { machine.video().frame_update(true); }