From 45d07d41de5c7013241494908a5f7d1cfc24a438 Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 16 Aug 2016 05:04:47 -0500 Subject: [PATCH] move bits.h to utils/bits.h. quite a lot of noise, but i tidied up some header dependencies while i was at it --- desmume/src/Disassembler.cpp | 5 +++-- desmume/src/MMU.cpp | 3 ++- desmume/src/NDSSystem.cpp | 1 + desmume/src/SPU.cpp | 1 + desmume/src/arm_instructions.cpp | 3 ++- desmume/src/arm_jit.cpp | 5 +++-- desmume/src/armcpu.cpp | 3 ++- desmume/src/armcpu.h | 19 ++++++++++++------- desmume/src/bios.cpp | 3 ++- desmume/src/cheatSystem.cpp | 2 +- desmume/src/cp15.cpp | 3 ++- desmume/src/gfx3d.cpp | 4 ++-- desmume/src/rasterize.cpp | 1 - desmume/src/render3D.cpp | 2 +- desmume/src/texcache.cpp | 1 - desmume/src/thumb_instructions.cpp | 3 ++- desmume/src/{ => utils}/bits.h | 3 --- desmume/src/wifi.cpp | 4 ++-- desmume/src/windows/DeSmuME.vcxproj | 4 ++-- desmume/src/windows/DeSmuME.vcxproj.filters | 12 ++++++------ desmume/src/windows/{mic.cpp => mic-win.cpp} | 0 21 files changed, 46 insertions(+), 36 deletions(-) rename desmume/src/{ => utils}/bits.h (90%) rename desmume/src/windows/{mic.cpp => mic-win.cpp} (100%) diff --git a/desmume/src/Disassembler.cpp b/desmume/src/Disassembler.cpp index 49f18c460..dcedc3e6d 100644 --- a/desmume/src/Disassembler.cpp +++ b/desmume/src/Disassembler.cpp @@ -1,6 +1,6 @@ /* Copyright (C) 2006 yopyop - Copyright (C) 2006-2012 DeSmuME team + Copyright (C) 2006-2016 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,7 +19,8 @@ #include #include #include "Disassembler.h" -#include "bits.h" +#include "utils/bits.h" +#include "armcpu.h" #define ROR(i, j) ((((u32)(i))>>(j)) | (((u32)(i))<<(32-(j)))) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index a9554413c..bd743caf9 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2006 yopyop Copyright (C) 2007 shash - Copyright (C) 2007-2015 DeSmuME team + Copyright (C) 2007-2016 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,7 @@ #include #include +#include "utils/bits.h" #include "armcpu.h" #include "common.h" #include "debug.h" diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index 72013d84c..c9a2c5b60 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -30,6 +30,7 @@ #include "utils/decrypt/header.h" #include "utils/advanscene.h" #include "utils/task.h" +#include "utils/bits.h" #include "common.h" #include "armcpu.h" diff --git a/desmume/src/SPU.cpp b/desmume/src/SPU.cpp index 34a90f066..a938df977 100644 --- a/desmume/src/SPU.cpp +++ b/desmume/src/SPU.cpp @@ -40,6 +40,7 @@ #include "armcpu.h" #include "NDSSystem.h" #include "matrix.h" +#include "utils/bits.h" static inline s16 read16(u32 addr) { return (s16)_MMU_read16(addr); } diff --git a/desmume/src/arm_instructions.cpp b/desmume/src/arm_instructions.cpp index e788fcaef..8f14002ae 100644 --- a/desmume/src/arm_instructions.cpp +++ b/desmume/src/arm_instructions.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2006 yopyop Copyright (C) 2006-2007 shash - Copyright (C) 2008-2015 DeSmuME team + Copyright (C) 2008-2016 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ // of current ones) //#define UNTESTEDOPCODEDEBUG +#include "utils/bits.h" #include "instructions.h" #include "cp15.h" #include "debug.h" diff --git a/desmume/src/arm_jit.cpp b/desmume/src/arm_jit.cpp index 0f369ad4b..da43d57c1 100644 --- a/desmume/src/arm_jit.cpp +++ b/desmume/src/arm_jit.cpp @@ -1,6 +1,6 @@ /* Copyright (C) 2006 yopyop Copyright (C) 2011 Loren Merritt - Copyright (C) 2012-2015 DeSmuME team + Copyright (C) 2012-2016 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,13 +33,14 @@ #define HAVE_STATIC_CODE_BUFFER #endif +#include "utils/bits.h" +#include "utils/AsmJit/AsmJit.h" #include "armcpu.h" #include "instructions.h" #include "instruction_attributes.h" #include "Disassembler.h" #include "MMU.h" #include "MMU_timing.h" -#include "utils/AsmJit/AsmJit.h" #include "arm_jit.h" #include "bios.h" diff --git a/desmume/src/armcpu.cpp b/desmume/src/armcpu.cpp index 8bad58e8b..817c281a9 100644 --- a/desmume/src/armcpu.cpp +++ b/desmume/src/armcpu.cpp @@ -1,6 +1,6 @@ /* Copyright (C) 2006 yopyop - Copyright (C) 2009-2015 DeSmuME team + Copyright (C) 2009-2016 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ #include "Disassembler.h" #include "NDSSystem.h" #include "MMU_timing.h" +#include "utils/bits.h" #ifdef HAVE_LUA #include "lua-engine.h" #endif diff --git a/desmume/src/armcpu.h b/desmume/src/armcpu.h index 087b240e5..8c9ee0989 100644 --- a/desmume/src/armcpu.h +++ b/desmume/src/armcpu.h @@ -1,6 +1,6 @@ /* Copyright (C) 2006 yopyop - Copyright (C) 2006-2015 DeSmuME team + Copyright (C) 2006-2016 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,16 +16,21 @@ along with the this software. If not, see . */ -#ifndef ARM_CPU -#define ARM_CPU +#ifndef DESMUME_ARMCPU_H +#define DESMUME_ARMCPU_H + +//half of this stuff is arm cpu internals +//half is public API +//really a mess #include "types.h" -#include "bits.h" #include "MMU.h" -#define CODE(i) (((i)>>25)&0x7) -#define OPCODE(i) (((i)>>21)&0xF) -#define SIGNEBIT(i) BIT_N(i,20) +#define CONDITION(i) ((i)>>28) +#define REG_POS(i,n) (((i)>>n)&0xF) +#define CODE(i) (((i)>>25)&0x7) +#define OPCODE(i) (((i)>>21)&0xF) +#define SIGNEBIT(i) (((i)>>20)&1) #define EXCEPTION_RESET 0x00 #define EXCEPTION_UNDEFINED_INSTRUCTION 0x04 diff --git a/desmume/src/bios.cpp b/desmume/src/bios.cpp index 070a376f4..e52186e28 100644 --- a/desmume/src/bios.cpp +++ b/desmume/src/bios.cpp @@ -1,6 +1,6 @@ /* Copyright (C) 2006 yopyop - Copyright (C) 2008-2015 DeSmuME team + Copyright (C) 2008-2016 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ #include "debug.h" #include "registers.h" #include "NDSSystem.h" +#include "utils/bits.h" #define cpu (&ARMPROC) #define TEMPLATE template diff --git a/desmume/src/cheatSystem.cpp b/desmume/src/cheatSystem.cpp index 266488de1..4f5e88936 100644 --- a/desmume/src/cheatSystem.cpp +++ b/desmume/src/cheatSystem.cpp @@ -16,7 +16,7 @@ */ #include "cheatSystem.h" -#include "bits.h" +#include "utils/bits.h" #include "NDSSystem.h" #include "common.h" diff --git a/desmume/src/cp15.cpp b/desmume/src/cp15.cpp index e64630cb2..d77de27ad 100644 --- a/desmume/src/cp15.cpp +++ b/desmume/src/cp15.cpp @@ -1,6 +1,6 @@ /* Copyright (C) 2006 yopyop - Copyright (C) 2006-2015 DeSmuME team + Copyright (C) 2006-2016 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,6 +24,7 @@ #include "MMU.h" #include "emufile.h" #include "readwrite.h" +#include "utils/bits.h" armcp15_t cp15; diff --git a/desmume/src/gfx3d.cpp b/desmume/src/gfx3d.cpp index c15bc6154..4281143cd 100644 --- a/desmume/src/gfx3d.cpp +++ b/desmume/src/gfx3d.cpp @@ -1,6 +1,6 @@ /* Copyright (C) 2006 yopyop - Copyright (C) 2008-2015 DeSmuME team + Copyright (C) 2008-2016 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,7 +43,6 @@ #include "emufile.h" #include "matrix.h" #include "GPU.h" -#include "bits.h" #include "MMU.h" #include "render3D.h" #include "mem.h" @@ -52,6 +51,7 @@ #include "NDSSystem.h" #include "readwrite.h" #include "FIFO.h" +#include "utils/bits.h" #include "movie.h" //only for currframecounter which really ought to be moved into the core emu.... //#define _SHOW_VTX_COUNTERS // show polygon/vertex counters on screen diff --git a/desmume/src/rasterize.cpp b/desmume/src/rasterize.cpp index 76cab1e8e..de34fde29 100644 --- a/desmume/src/rasterize.cpp +++ b/desmume/src/rasterize.cpp @@ -49,7 +49,6 @@ #include #endif -#include "bits.h" #include "common.h" #include "matrix.h" #include "render3D.h" diff --git a/desmume/src/render3D.cpp b/desmume/src/render3D.cpp index 3f1f5128d..894b61701 100644 --- a/desmume/src/render3D.cpp +++ b/desmume/src/render3D.cpp @@ -24,7 +24,7 @@ #include #endif -#include "bits.h" +#include "utils/bits.h" #include "common.h" #include "gfx3d.h" #include "MMU.h" diff --git a/desmume/src/texcache.cpp b/desmume/src/texcache.cpp index f5ec7dcde..712ec7dae 100644 --- a/desmume/src/texcache.cpp +++ b/desmume/src/texcache.cpp @@ -24,7 +24,6 @@ #include "texcache.h" -#include "bits.h" #include "common.h" #include "debug.h" #include "gfx3d.h" diff --git a/desmume/src/thumb_instructions.cpp b/desmume/src/thumb_instructions.cpp index 57ae5dacd..2a6ed6869 100644 --- a/desmume/src/thumb_instructions.cpp +++ b/desmume/src/thumb_instructions.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2006 yopyop Copyright (C) 2008 shash - Copyright (C) 2008-2015 DeSmuME team + Copyright (C) 2008-2016 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ #include "MMU.h" #include "NDSSystem.h" #include "MMU_timing.h" +#include "utils/bits.h" #define cpu (&ARMPROC) #define TEMPLATE template diff --git a/desmume/src/bits.h b/desmume/src/utils/bits.h similarity index 90% rename from desmume/src/bits.h rename to desmume/src/utils/bits.h index 9259573a0..81d245863 100644 --- a/desmume/src/bits.h +++ b/desmume/src/utils/bits.h @@ -37,8 +37,5 @@ #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 diff --git a/desmume/src/wifi.cpp b/desmume/src/wifi.cpp index cd4b3a356..72adf1e71 100644 --- a/desmume/src/wifi.cpp +++ b/desmume/src/wifi.cpp @@ -1,6 +1,6 @@ /* Copyright (C) 2007 Tim Seidel - Copyright (C) 2008-2015 DeSmuME team + Copyright (C) 2008-2016 DeSmuME team This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,10 +41,10 @@ #include +#include "utils/bits.h" #include "armcpu.h" #include "NDSSystem.h" #include "debug.h" -#include "bits.h" #include "registers.h" #ifndef INVALID_SOCKET diff --git a/desmume/src/windows/DeSmuME.vcxproj b/desmume/src/windows/DeSmuME.vcxproj index a26b63179..aa17d4ed8 100644 --- a/desmume/src/windows/DeSmuME.vcxproj +++ b/desmume/src/windows/DeSmuME.vcxproj @@ -315,7 +315,7 @@ - + @@ -347,7 +347,6 @@ - @@ -444,6 +443,7 @@ + diff --git a/desmume/src/windows/DeSmuME.vcxproj.filters b/desmume/src/windows/DeSmuME.vcxproj.filters index 27eb62b95..84e45ad65 100644 --- a/desmume/src/windows/DeSmuME.vcxproj.filters +++ b/desmume/src/windows/DeSmuME.vcxproj.filters @@ -360,9 +360,6 @@ Windows - - Windows - Windows @@ -975,6 +972,9 @@ Core + + Windows + @@ -983,9 +983,6 @@ Core - - Core - Core @@ -1748,6 +1745,9 @@ Core + + Core\utils + diff --git a/desmume/src/windows/mic.cpp b/desmume/src/windows/mic-win.cpp similarity index 100% rename from desmume/src/windows/mic.cpp rename to desmume/src/windows/mic-win.cpp