//~handler_entry_write_memory() = default; //template<int Width, int AddrShift> public override void write(offs_t offset, uX data, uX mem_mask) //void handler_entry_write_memory<Width, AddrShift>::write(offs_t offset, uX data, uX mem_mask) const { if (Width == 0 && AddrShift == 0 && data.width == 0 && mem_mask == 0) { //template<> void handler_entry_write_memory<0, 0>::write(offs_t offset, u8 data, u8 mem_mask) const m_base.m_pointer[(offset - this.m_address_base) & this.m_address_mask] = data.u8; //m_base[(offset - this->m_address_base) & this->m_address_mask] = data; } else { offs_t off = ((offset - this.m_address_base) & this.m_address_mask) >> (Width + AddrShift); //m_base[off] = (m_base[off] & ~mem_mask) | (data & mem_mask); switch (Width) { case 0: m_base.m_pointer[off] = (u8)((m_base.m_pointer[off] & ~mem_mask.u8) | (data.u8 & mem_mask.u8)); break; case 1: var pointerU16 = new PointerU16(m_base.m_pointer); pointerU16[off] = (u16)((pointerU16[off] & ~mem_mask.u16) | (data.u16 & mem_mask.u16)); break; case 2: throw new emu_unimplemented(); case 3: throw new emu_unimplemented(); default: throw new emu_unimplemented(); } } }
/************************************* * * Main refresh * *************************************/ uint32_t screen_update_atarisy2(screen_device screen, bitmap_ind16 bitmap, rectangle cliprect) { // start drawing m_mob.op0.draw_async(cliprect); // reset priorities bitmap_ind8 priority_bitmap = screen.priority(); priority_bitmap.fill(0, cliprect); // draw the playfield m_playfield_tilemap.op0.tilemap.draw(screen, bitmap, cliprect, 0, 0); m_playfield_tilemap.op0.tilemap.draw(screen, bitmap, cliprect, 1, 1); m_playfield_tilemap.op0.tilemap.draw(screen, bitmap, cliprect, 2, 2); m_playfield_tilemap.op0.tilemap.draw(screen, bitmap, cliprect, 3, 3); // draw and merge the MO bitmap_ind16 mobitmap = m_mob.op0.bitmap(); for (sparse_dirty_rect rect = m_mob.op0.first_dirty_rect(cliprect); rect != null; rect = rect.next()) { for (int y = rect.m_rect.top(); y <= rect.m_rect.bottom(); y++) { PointerU16 mo = mobitmap.pix(y); //uint16_t const *const mo = &mobitmap.pix(y); PointerU16 pf = bitmap.pix(y); //uint16_t *const pf = &bitmap.pix(y); PointerU8 pri = priority_bitmap.pix(y); //uint8_t const *const pri = &priority_bitmap.pix(y); for (int x = rect.m_rect.left(); x <= rect.m_rect.right(); x++) { if (mo[x] != 0xffff) { int mopriority = mo[x] >> atari_motion_objects_device.PRIORITY_SHIFT; // high priority PF? if (((mopriority + pri[x]) & 2) != 0) { // only gets priority if PF pen is less than 8 if ((pf[x] & 0x08) == 0) { pf[x] = (uint16_t)(mo[x] & atari_motion_objects_device.DATA_MASK); } } // low priority else { pf[x] = (uint16_t)(mo[x] & atari_motion_objects_device.DATA_MASK); } } } } } // add the alpha on top m_alpha_tilemap.op0.tilemap.draw(screen, bitmap, cliprect, 0, 0); return(0); }
//------------------------------------------------- // build_active_list: Build a list of active // objects. //------------------------------------------------- void build_active_list(int link) { PointerU16 bankbase = new PointerU16(spriteram(), (int)m_bank << (m_entrybits + 2)); //uint16_t *bankbase = &spriteram()[m_bank << (m_entrybits + 2)]; Pointer <uint16_t> current = new Pointer <uint16_t>(m_activelist, 0); //uint16_t *current = &m_activelist[0]; // visit all the motion objects and copy their data into the display list uint8_t [] visited = new uint8_t [MAX_PER_BANK]; for (int i = 0; i < m_atari_motion_objects_config.m_maxperline && (visited[link] == 0); i++) { // copy the current entry into the list Pointer <uint16_t> modata = new Pointer <uint16_t>(current); //uint16_t *modata = current; if (!m_atari_motion_objects_config.m_split) { PointerU16 srcdata = new PointerU16(bankbase, link * 4); //uint16_t *srcdata = &bankbase[link * 4]; current[0] = srcdata[0]; current++; //*current++ = srcdata[0]; current[0] = srcdata[1]; current++; //*current++ = srcdata[1]; current[0] = srcdata[2]; current++; //*current++ = srcdata[2]; current[0] = srcdata[3]; current++; //*current++ = srcdata[3]; } else { PointerU16 srcdata = new PointerU16(bankbase, link); //uint16_t *srcdata = &bankbase[link]; current[0] = srcdata[(uint32_t)(0 << m_entrybits)]; current++; //*current++ = srcdata[uint32_t(0 << m_entrybits)]; current[0] = srcdata[(uint32_t)(1 << m_entrybits)]; current++; //*current++ = srcdata[uint32_t(1 << m_entrybits)]; current[0] = srcdata[(uint32_t)(2 << m_entrybits)]; current++; //*current++ = srcdata[uint32_t(2 << m_entrybits)]; current[0] = srcdata[(uint32_t)(3 << m_entrybits)]; current++; //*current++ = srcdata[uint32_t(3 << m_entrybits)]; } // link to the next object visited[link] = 1; if (m_atari_motion_objects_config.m_linked) { link = m_linkmask.extract(modata); } else { link = (link + 1) & m_linkmask.mask(); } } // note the last entry m_activelast = current; }
public bitmap_ind16(PointerU16 base_, int width, int height, int rowpixels) : base(k_bitmap_format, base_, width, height, rowpixels) { } //bitmap_ind16(uint16_t *base, int width, int height, int rowpixels) : bitmap16_t(k_bitmap_format, base, width, height, rowpixels) { }