all repos — mgba @ 8ee4b3c0463ad402aa60e5c9f406da812952f9a0

mGBA Game Boy Advance Emulator

include/mgba/internal/arm/decoder-inlines.h (view raw)

 1/* Copyright (c) 2013-2014 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef ARM_DECODER_INLINES_H
 7#define ARM_DECODER_INLINES_H
 8
 9#include "decoder.h"
10
11#include "arm.h"
12
13#include <stdio.h>
14#include <string.h>
15
16#define LOAD_CYCLES    \
17	info->iCycles = 1; \
18	info->nDataCycles = 1;
19
20#define STORE_CYCLES              \
21	info->sInstructionCycles = 0; \
22	info->nInstructionCycles = 1; \
23	info->nDataCycles = 1;
24
25static inline bool ARMInstructionIsBranch(enum ARMMnemonic mnemonic) {
26	switch (mnemonic) {
27		case ARM_MN_B:
28		case ARM_MN_BL:
29		case ARM_MN_BX:
30			// TODO: case: ARM_MN_BLX:
31			return true;
32		default:
33			return false;
34	}
35}
36
37#endif