void blstroid_scanline_update(screen_device &screen, int scanline) { blstroid_state *state = screen.machine->driver_data<blstroid_state>(); int offset = (scanline / 8) * 64 + 40; /* check for interrupts */ if (offset < 0x1000) if (state->playfield[offset] & 0x8000) { int width, vpos; attotime period_on; attotime period_off; /* FIXME: - the only thing this IRQ does it tweak the starting MO link */ /* unfortunately, it does it too early for the given MOs! */ /* perhaps it is not actually hooked up on the real PCB... */ return; /* set a timer to turn the interrupt on at HBLANK of the 7th scanline */ /* and another to turn it off one scanline later */ width = screen.width(); vpos = screen.vpos(); period_on = screen.time_until_pos(vpos + 7, width * 0.9); period_off = screen.time_until_pos(vpos + 8, width * 0.9); timer_set(screen.machine, period_on, NULL, 0, irq_on); timer_set(screen.machine, period_off, NULL, 0, irq_off); } }
bool comx35_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { if (screen.width() == CDP1869_SCREEN_WIDTH) { m_vis->update_screen(&bitmap, &cliprect); } else { m_expansion->screen_update(screen, bitmap, cliprect); } return false; }
void skullxbo_state::scanline_update(screen_device &screen, int scanline) { /* check for interrupts in the alpha ram */ /* the interrupt occurs on the HBLANK of the 6th scanline following */ int offset = (scanline / 8) * 64 + 42; if (offset < 0x7c0 && (m_alpha_tilemap->basemem_read(offset) & 0x8000)) { int width = screen.width(); attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9); m_scanline_timer->adjust(period); } /* update the playfield and motion objects */ skullxbo_scanline_update(scanline); }
static void alpha_row_update(screen_device &screen, int scanline) { skullxbo_state *state = screen.machine().driver_data<skullxbo_state>(); UINT16 *check = &state->m_alpha[(scanline / 8) * 64 + 42]; /* check for interrupts in the alpha ram */ /* the interrupt occurs on the HBLANK of the 6th scanline following */ if (check < &state->m_alpha[0x7c0] && (*check & 0x8000)) { int width = screen.width(); attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9); screen.machine().scheduler().timer_set(period, FUNC(irq_gen)); } /* update the playfield and motion objects */ skullxbo_scanline_update(screen.machine(), scanline); }
tc0780fpa_renderer::tc0780fpa_renderer(device_t &parent, screen_device &screen, const uint8_t *texture_ram) : poly_manager<float, tc0780fpa_polydata, 6, 10000>(screen) { int width = screen.width(); int height = screen.height(); m_fb[0] = std::make_unique<bitmap_ind16>(width, height); m_fb[1] = std::make_unique<bitmap_ind16>(width, height); m_zb = std::make_unique<bitmap_ind16>(width, height); m_texture = texture_ram; m_cliprect = screen.cliprect(); m_current_fb = 0; // save state parent.save_item(NAME(*m_fb[0])); parent.save_item(NAME(*m_fb[1])); parent.save_item(NAME(*m_zb)); }
// renders to 2 bitmaps, and mixes output UINT32 toaplan2_state::screen_update_batsugun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // bitmap.fill(0, cliprect); // gp9001_custom_priority_bitmap->fill(0, cliprect); if (m_vdp0) { bitmap.fill(0, cliprect); m_custom_priority_bitmap.fill(0, cliprect); m_vdp0->gp9001_render_vdp(bitmap, cliprect); } if (m_vdp1) { m_secondary_render_bitmap.fill(0, cliprect); m_custom_priority_bitmap.fill(0, cliprect); m_vdp1->gp9001_render_vdp(m_secondary_render_bitmap, cliprect); } // key test places in batsugun // level 2 - the two layers of clouds (will appear under background, or over ships if wrong) // level 3 - the special effect 'layer' which should be under everything (will appear over background if wrong) // level 4(?) - the large clouds (will obscure player if wrong) // high score entry - letters will be missing if wrong // end credits - various issues if wrong, clouds like level 2 // // when implemented based directly on the PAL equation it doesn't work, however, my own equations roughly based // on that do. // if (m_vdp0 && m_vdp1) { int width = screen.width(); int height = screen.height(); int y,x; UINT16* src_vdp0; // output buffer of vdp0 UINT16* src_vdp1; // output buffer of vdp1 for (y=0;y<height;y++) { src_vdp0 = &bitmap.pix16(y); src_vdp1 = &m_secondary_render_bitmap.pix16(y); for (x=0;x<width;x++) { UINT16 GPU0_LUTaddr = src_vdp0[x]; UINT16 GPU1_LUTaddr = src_vdp1[x]; // these equations is derived from the PAL, but doesn't seem to work? int COMPARISON = ((GPU0_LUTaddr & 0x0780) > (GPU1_LUTaddr & 0x0780)); // note: GPU1_LUTaddr & 0x000f - transparency check for vdp1? (gfx are 4bpp, the low 4 bits of the lookup would be the pixel data value) #if 0 int result = ((GPU0_LUTaddr & 0x0008) & !COMPARISON) | ((GPU0_LUTaddr & 0x0008) & !(GPU1_LUTaddr & 0x000f)) | ((GPU0_LUTaddr & 0x0004) & !COMPARISON) | ((GPU0_LUTaddr & 0x0004) & !(GPU1_LUTaddr & 0x000f)) | ((GPU0_LUTaddr & 0x0002) & !COMPARISON) | ((GPU0_LUTaddr & 0x0002) & !(GPU1_LUTaddr & 0x000f)) | ((GPU0_LUTaddr & 0x0001) & !COMPARISON) | ((GPU0_LUTaddr & 0x0001) & !(GPU1_LUTaddr & 0x000f)); if (result) src_vdp0[x] = GPU0_LUTaddr; else src_vdp0[x] = GPU1_LUTaddr; #endif // this seems to work tho? if (!(GPU1_LUTaddr & 0x000f)) { src_vdp0[x] = GPU0_LUTaddr; } else { if (!(GPU0_LUTaddr & 0x000f)) { src_vdp0[x] = GPU1_LUTaddr; // bg pen } else { if (COMPARISON) { src_vdp0[x] = GPU1_LUTaddr; } else { src_vdp0[x] = GPU0_LUTaddr; } } } } } } return 0; }
void segaic16_draw_virtual_tilemap(screen_device &screen, struct tilemap_info *info, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 pages, UINT16 xscroll, UINT16 yscroll, UINT32 flags, UINT32 priority) { int leftmin = -1, leftmax = -1, rightmin = -1, rightmax = -1; int topmin = -1, topmax = -1, bottommin = -1, bottommax = -1; rectangle pageclip; int page; int width = screen.width(); int height = screen.height(); /* which half/halves of the virtual tilemap do we intersect in the X direction? */ if (xscroll < 64*8 - width) { leftmin = 0; leftmax = width - 1; rightmin = -1; } else if (xscroll < 64*8) { leftmin = 0; leftmax = 64*8 - xscroll - 1; rightmin = leftmax + 1; rightmax = width - 1; } else if (xscroll < 128*8 - width) { rightmin = 0; rightmax = width - 1; leftmin = -1; } else { rightmin = 0; rightmax = 128*8 - xscroll - 1; leftmin = rightmax + 1; leftmax = width - 1; } /* which half/halves of the virtual tilemap do we intersect in the Y direction? */ if (yscroll < 32*8 - height) { topmin = 0; topmax = height - 1; bottommin = -1; } else if (yscroll < 32*8) { topmin = 0; topmax = 32*8 - yscroll - 1; bottommin = topmax + 1; bottommax = height - 1; } else if (yscroll < 64*8 - height) { bottommin = 0; bottommax = height - 1; topmin = -1; } else { bottommin = 0; bottommax = 64*8 - yscroll - 1; topmin = bottommax + 1; topmax = height - 1; } /* if the tilemap is flipped, we need to flip our sense within each quadrant */ if (info->flip) { if (leftmin != -1) { int temp = leftmin; leftmin = width - 1 - leftmax; leftmax = width - 1 - temp; } if (rightmin != -1) { int temp = rightmin; rightmin = width - 1 - rightmax; rightmax = width - 1 - temp; } if (topmin != -1) { int temp = topmin; topmin = height - 1 - topmax; topmax = height - 1 - temp; } if (bottommin != -1) { int temp = bottommin; bottommin = height - 1 - bottommax; bottommax = height - 1 - temp; } } /* draw the upper-left chunk */ if (leftmin != -1 && topmin != -1) { pageclip.min_x = (leftmin < cliprect.min_x) ? cliprect.min_x : leftmin; pageclip.max_x = (leftmax > cliprect.max_x) ? cliprect.max_x : leftmax; pageclip.min_y = (topmin < cliprect.min_y) ? cliprect.min_y : topmin; pageclip.max_y = (topmax > cliprect.max_y) ? cliprect.max_y : topmax; if (pageclip.min_x <= pageclip.max_x && pageclip.min_y <= pageclip.max_y) { page = (pages >> 0) & 0xf; info->tilemaps[page]->set_scrollx(0, xscroll); info->tilemaps[page]->set_scrolly(0, yscroll); info->tilemaps[page]->draw(screen, bitmap, pageclip, flags, priority); }