dingusppc/cpu/ppc/ppcdisasm.h

43 lines
1.3 KiB
C
Raw Normal View History

/*
DingusPPC - The Experimental PowerPC Macintosh emulator
Copyright (C) 2018-21 divingkatae and maximum
(theweirdo) spatium
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2020-01-22 11:28:42 +00:00
#ifndef PPCDISASM_H
#define PPCDISASM_H
#include <cinttypes>
#include <string>
typedef struct PPCDisasmContext {
2020-05-12 18:55:45 +00:00
uint32_t instr_addr;
uint32_t instr_code;
2020-01-22 11:28:42 +00:00
std::string instr_str;
2020-05-12 18:55:45 +00:00
bool simplified; /* true if we should output simplified mnemonics */
2020-01-22 11:28:42 +00:00
} PPCDisasmContext;
2020-05-12 18:55:45 +00:00
std::string disassemble_single(PPCDisasmContext* ctx);
2020-01-22 11:28:42 +00:00
2020-02-12 21:58:24 +00:00
int test_ppc_disasm(void);
2020-01-22 11:28:42 +00:00
/** sign-extend an integer. */
2020-05-12 18:55:45 +00:00
#define SIGNEXT(x, sb) ((x) | (((x) & (1 << (sb))) ? ~((1 << (sb)) - 1) : 0))
2020-01-22 11:28:42 +00:00
#endif /* PPCDISASM_H */