Moved some macros from armcpu.h in a separate file.

Moved Disassembler.cpp/.hpp to Disassembler.c/.h
This commit is contained in:
yabause 2006-06-10 16:18:26 +00:00
parent a68d444913
commit 77ed68f8f2
7 changed files with 3777 additions and 43 deletions

3692
desmume/src/Disassembler.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,40 @@
/* Copyright (C) 2006 yopyop
yopyop156@ifrance.com
yopyop156.ifrance.com
This file is part of DeSmuME
DeSmuME 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 2 of the License, or
(at your option) any later version.
DeSmuME 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 DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DISASSEMBLER_H
#define DISASSEMBLER_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
extern char * (* des_arm_instructions_set[4096])(u32 adr, u32 i, char * txt);
extern char * (* des_thumb_instructions_set[1024])(u32 adr, u32 i, char * txt);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -4,7 +4,7 @@ libdesmume_a_SOURCES = \
armcpu.cpp armcpu.hpp \
arm_instructions.cpp arm_instructions.hpp \
bios.cpp bios.hpp cp15.cpp cp15.hpp \
Disassembler.cpp Disassembler.hpp \
Disassembler.c Disassembler.h \
FIFO.c FIFO.h \
GPU.cpp GPU.hpp debug.c debug.h \
MMU.cpp MMU.hpp NDSSystem.cpp NDSSystem.hpp \

View File

@ -22,52 +22,16 @@
#ifndef ARM_CPU
#define ARM_CPU
#include "types.h"
#include "MMU.hpp"
#define BIT_N(i,n) (((i)>>(n))&1)
#define CONDITION(i) (i)>>28
#include "bits.h"
#define CODE(i) (((i)>>25)&0X7)
#define OPCODE(i) (((i)>>21)&0xF)
#define SIGNEBIT(i) BIT_N(i,20)
#define BIT0(i) ((i)&1)
#define BIT1(i) BIT_N(i,1)
#define BIT2(i) BIT_N(i,2)
#define BIT3(i) BIT_N(i,3)
#define BIT4(i) BIT_N(i,4)
#define BIT5(i) BIT_N(i,5)
#define BIT6(i) BIT_N(i,6)
#define BIT7(i) BIT_N(i,7)
#define BIT8(i) BIT_N(i,8)
#define BIT9(i) BIT_N(i,9)
#define BIT10(i) BIT_N(i,10)
#define BIT11(i) BIT_N(i,11)
#define BIT12(i) BIT_N(i,12)
#define BIT13(i) BIT_N(i,13)
#define BIT14(i) BIT_N(i,14)
#define BIT15(i) BIT_N(i,15)
#define BIT16(i) BIT_N(i,16)
#define BIT17(i) BIT_N(i,17)
#define BIT18(i) BIT_N(i,18)
#define BIT19(i) BIT_N(i,19)
#define BIT20(i) BIT_N(i,20)
#define BIT21(i) BIT_N(i,21)
#define BIT22(i) BIT_N(i,22)
#define BIT23(i) BIT_N(i,23)
#define BIT24(i) BIT_N(i,24)
#define BIT25(i) BIT_N(i,25)
#define BIT26(i) BIT_N(i,26)
#define BIT27(i) BIT_N(i,27)
#define BIT28(i) BIT_N(i,28)
#define BIT29(i) BIT_N(i,29)
#define BIT30(i) BIT_N(i,30)
#define BIT31(i) ((i)>>31)
#define INSTRUCTION_INDEX(i) ((((i)>>16)&0xFF0)|(((i)>>4)&0xF))
#define REG_POS(i,n) (((i)>>n)&0xF)
#define ROR(i, j) ((((u32)(i))>>(j)) | (((u32)(i))<<(32-(j))))
#define UNSIGNED_OVERFLOW(a,b,c) ((BIT31(a)&BIT31(b)) | \

42
desmume/src/bits.h Normal file
View File

@ -0,0 +1,42 @@
#ifndef BITS_H
#define BITS_H
#define BIT_N(i,n) (((i)>>(n))&1)
#define BIT0(i) ((i)&1)
#define BIT1(i) BIT_N(i,1)
#define BIT2(i) BIT_N(i,2)
#define BIT3(i) BIT_N(i,3)
#define BIT4(i) BIT_N(i,4)
#define BIT5(i) BIT_N(i,5)
#define BIT6(i) BIT_N(i,6)
#define BIT7(i) BIT_N(i,7)
#define BIT8(i) BIT_N(i,8)
#define BIT9(i) BIT_N(i,9)
#define BIT10(i) BIT_N(i,10)
#define BIT11(i) BIT_N(i,11)
#define BIT12(i) BIT_N(i,12)
#define BIT13(i) BIT_N(i,13)
#define BIT14(i) BIT_N(i,14)
#define BIT15(i) BIT_N(i,15)
#define BIT16(i) BIT_N(i,16)
#define BIT17(i) BIT_N(i,17)
#define BIT18(i) BIT_N(i,18)
#define BIT19(i) BIT_N(i,19)
#define BIT20(i) BIT_N(i,20)
#define BIT21(i) BIT_N(i,21)
#define BIT22(i) BIT_N(i,22)
#define BIT23(i) BIT_N(i,23)
#define BIT24(i) BIT_N(i,24)
#define BIT25(i) BIT_N(i,25)
#define BIT26(i) BIT_N(i,26)
#define BIT27(i) BIT_N(i,27)
#define BIT28(i) BIT_N(i,28)
#define BIT29(i) BIT_N(i,29)
#define BIT30(i) BIT_N(i,30)
#define BIT31(i) ((i)>>31)
#define CONDITION(i) (i)>>28
#define REG_POS(i,n) (((i)>>n)&0xF)
#endif

View File

@ -22,8 +22,6 @@
#ifndef __CP15_H__
#define __CP15_H__
#include "types.h"
#include "armcpu.h"
typedef struct

View File

@ -22,8 +22,6 @@
#ifndef THUMB_INSTRUCTIONS_H
#define THUMB_INSTRUCTIONS_H
#include "types.h"
#include "armcpu.h"
extern u32 (* FASTCALL thumb_instructions_set[1024])(armcpu_t * cpu);