// Meteor - A Nintendo Gameboy Advance emulator1// Copyright (C) 2009-2011 Philippe Daouadi2//3// This program is free software: you can redistribute it and/or modify4// it under the terms of the GNU General Public License as published by5// the Free Software Foundation, either version 3 of the License, or6// (at your option) any later version.7//8// This program is distributed in the hope that it will be useful,9// but WITHOUT ANY WARRANTY; without even the implied warranty of10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11// GNU General Public License for more details.12//13// You should have received a copy of the GNU General Public License14// along with this program. If not, see <http://www.gnu.org/licenses/>.1516#ifndef __SWAP_H__17#define __SWAP_H__1819namespace AMeteor20{21inline uint16_t Swap16(uint16_t val)22{23return (val << 8) | (val >> 8);24}2526inline uint32_t Swap32(uint32_t val)27{28return (val << 24) |29((val & 0x0000FF00) << 8) |30((val & 0x00FF0000) >> 8) |31(val >> 24);32}33}3435#endif363738