void mcs96_device::recompute_bcount(UINT64 event_time) { if(!event_time || event_time >= total_cycles() + icount) { bcount = 0; return; } bcount = total_cycles() + icount - event_time; }
void mcs96_device::execute_run() { internal_update(total_cycles()); // if(inst_substate) // do_exec_partial(); while(icount > 0) { while(icount > bcount) { int picount = inst_state >= 0x200 ? -1 : icount; do_exec_full(); if(icount == picount) { fatalerror("Unhandled %x (%04x)\n", inst_state, PPC); } } while(bcount && icount <= bcount) internal_update(total_cycles() + icount - bcount); // if(inst_substate) // do_exec_partial(); } }
void sh2_device::sh2_timer_resync() { int divider = div_tab[(m_m[5] >> 8) & 3]; UINT64 cur_time = total_cycles(); UINT64 add = (cur_time - m_frc_base) >> divider; if (add > 0) { if(divider) m_frc += add; m_frc_base = cur_time; } }
void sh2_device::sh2_timer_activate() { int max_delta = 0xfffff; UINT16 frc; m_timer->adjust(attotime::never); frc = m_frc; if(!(m_m[4] & OCFA)) { UINT16 delta = m_ocra - frc; if(delta < max_delta) max_delta = delta; } if(!(m_m[4] & OCFB) && (m_ocra <= m_ocrb || !(m_m[4] & 0x010000))) { UINT16 delta = m_ocrb - frc; if(delta < max_delta) max_delta = delta; } if(!(m_m[4] & OVF) && !(m_m[4] & 0x010000)) { int delta = 0x10000 - frc; if(delta < max_delta) max_delta = delta; } if(max_delta != 0xfffff) { int divider = div_tab[(m_m[5] >> 8) & 3]; if(divider) { max_delta <<= divider; m_frc_base = total_cycles(); m_timer->adjust(cycles_to_attotime(max_delta)); } else { logerror("SH2.%s: Timer event in %d cycles of external clock", tag(), max_delta); } }
void info::parse(char *data) throw(xml::xml_file_not_found_exception, xml::bad_xml_format_exception, xml::empty_xml_format_exception, xml::missing_xml_element_exception, xml::xml_parse_exception) { rapidxml::xml_document<> doc; try { doc.parse<0>(data); } catch (const rapidxml::parse_error &ex) { INTEROP_THROW(xml_parse_exception, ex.what()); } xml_node_ptr p_root = doc.first_node(); if (p_root == 0) INTEROP_THROW(empty_xml_format_exception, "Root node not found"); if (p_root->name() != std::string("RunInfo")) INTEROP_THROW(bad_xml_format_exception, "Invalid run info xml file"); for (xml_attr_ptr attr = p_root->first_attribute(); attr; attr = attr->next_attribute()) { if(set_data(attr, "Version", m_version))break; } xml_node_ptr p_run_node = p_root->first_node(); for (; p_run_node; p_run_node = p_run_node->next_sibling()) { if(p_run_node->name() == std::string("Run"))break; } if (p_run_node == 0) INTEROP_THROW(bad_xml_format_exception, "Run node not found"); if (p_run_node->name() != std::string("Run")) INTEROP_THROW(bad_xml_format_exception, "Invalid run info xml file: expected Run, got: " << p_run_node->name()); // Parse run attributes for (xml_attr_ptr attr = p_run_node->first_attribute(); attr; attr = attr->next_attribute()) { if(set_data(attr, "Id", m_name)) break; } // Parse run data for (xml_node_ptr p_node = p_run_node->first_node(); p_node; p_node = p_node->next_sibling()) { if (set_data(p_node, "Date", m_date)) continue; if (set_data(p_node, "Flowcell", m_flowcell.m_barcode)) continue; if (p_node->name() == std::string("FlowcellLayout")) { for (xml_attr_ptr attr = p_node->first_attribute(); attr; attr = attr->next_attribute()) { if (set_data(attr, "LaneCount", m_flowcell.m_lane_count)) continue; if (set_data(attr, "SurfaceCount", m_flowcell.m_surface_count)) continue; if (set_data(attr, "SwathCount", m_flowcell.m_swath_count)) continue; if (set_data(attr, "TileCount", m_flowcell.m_tile_count)) continue; if (set_data(attr, "SectionPerLane", m_flowcell.m_sections_per_lane)) continue; if (set_data(attr, "LanePerSection", m_flowcell.m_lanes_per_section)) continue; } xml_node_ptr p_tile_set = p_node->first_node("TileSet"); if (p_tile_set == 0) { m_flowcell.m_naming_method = constants::UnknownTileNamingMethod; } else { std::string naming_convention; set_data(p_tile_set->first_attribute("TileNamingConvention"), naming_convention); m_flowcell.m_naming_method = constants::parse<constants::tile_naming_method>(naming_convention); set_data(p_tile_set->first_node("Tiles"), "Tiles", "Tile", m_flowcell.m_tiles); } } else if (set_data(p_node, "ImageChannels", "Name", m_channels)) { for (size_t i = 0; i < m_channels.size(); ++i) m_channels[i] = logic::utils::normalize(m_channels[i]);// TODO: remove this continue; } else if (p_node->name() == std::string("ImageDimensions")) { for (xml_attr_ptr attr = p_node->first_attribute(); attr; attr = attr->next_attribute()) { set_data(attr, "Width", m_image_dim.m_width); set_data(attr, "Height", m_image_dim.m_height); } } else if (p_node->name() == std::string("Reads")) { m_reads.clear(); size_t first_cycle = 0; for (xml_node_ptr p_read = p_node->first_node(); p_read; p_read = p_read->next_sibling()) { read_info rinfo; size_t cycle_count = 0; char is_indexed; for (xml_attr_ptr attr = p_read->first_attribute(); attr; attr = attr->next_attribute()) { set_data(attr, "Number", rinfo.m_number); if (set_data(attr, "NumCycles", cycle_count)) { rinfo.m_last_cycle = first_cycle + cycle_count; rinfo.m_first_cycle = first_cycle + 1; } if (set_data(attr, "IsIndexedRead", is_indexed)) rinfo.m_is_index = std::toupper(is_indexed) == 'Y'; } first_cycle += cycle_count; m_reads.push_back(rinfo); } } } m_total_cycle_count = total_cycles(); }