Skip to content

Commit

Permalink
Merge pull request #41 from kremi151/atomic_instructions
Browse files Browse the repository at this point in the history
Move and refactor operands sources
  • Loading branch information
kremi151 authored Nov 16, 2020
2 parents 696ce18 + 0ad951a commit 8b51bb3
Show file tree
Hide file tree
Showing 27 changed files with 88 additions and 88 deletions.
50 changes: 25 additions & 25 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ set(SOURCES
source/cartridge/mbc2.cpp
source/cartridge/mbc_none.cpp
source/memory/ppu_memory.cpp
source/instructions/instruction_context.cpp
source/instructions/alu.cpp
source/instructions/loads.cpp
source/instructions/misc.cpp
source/instructions/prefix.cpp
source/instructions/reads.cpp
source/instructions/writes.cpp
source/instructions/jumps.cpp
source/instructions/rot_shifts.cpp
source/instructions/conditions.cpp
source/instructions/debug.cpp
source/instructions/decoder.cpp
source/operands/instruction_context.cpp
source/operands/alu.cpp
source/operands/loads.cpp
source/operands/misc.cpp
source/operands/prefix.cpp
source/operands/reads.cpp
source/operands/writes.cpp
source/operands/jumps.cpp
source/operands/rot_shifts.cpp
source/operands/conditions.cpp
source/operands/debug.cpp
source/operands/decoder.cpp
source/util/registers.cpp
source/util/flags.cpp
source/exception/state_exception.cpp
Expand Down Expand Up @@ -70,19 +70,19 @@ set(HEADERS
source/cartridge/mbc2.h
source/cartridge/mbc_none.h
source/memory/ppu_memory.h
source/instructions/instruction_context.h
source/instructions/alu.h
source/instructions/loads.h
source/instructions/instructions.h
source/instructions/misc.h
source/instructions/prefix.h
source/instructions/reads.h
source/instructions/writes.h
source/instructions/jumps.h
source/instructions/rot_shifts.h
source/instructions/conditions.h
source/instructions/debug.h
source/instructions/decoder.h
source/operands/instruction_context.h
source/operands/alu.h
source/operands/loads.h
source/operands/instructions.h
source/operands/misc.h
source/operands/prefix.h
source/operands/reads.h
source/operands/writes.h
source/operands/jumps.h
source/operands/rot_shifts.h
source/operands/conditions.h
source/operands/debug.h
source/operands/decoder.h
source/util/endianness.h
source/util/registers.h
source/util/flags.h
Expand Down
4 changes: 2 additions & 2 deletions core/source/emulator/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <memory>
#include <util/testing.h>
#include <util/debug.h>
#include <instructions/decoder.h>
#include <instructions/debug.h>
#include <operands/decoder.h>
#include <operands/debug.h>
#include <emulator/gb_type.h>
#include <emulator/io_registers.h>

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions core/source/instructions/alu.h → core/source/operands/alu.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

#ifndef FB_CORE_INSTRUCTIONS_ALU_H
#define FB_CORE_INSTRUCTIONS_ALU_H
#ifndef FB_CORE_OPERANDS_ALU_H
#define FB_CORE_OPERANDS_ALU_H

#include <instructions/instruction_context.h>
#include <operands/instruction_context.h>

namespace FunkyBoy::Operands {

Expand Down Expand Up @@ -233,4 +233,4 @@ namespace FunkyBoy::Operands {

}

#endif //FB_CORE_INSTRUCTIONS_ALU_H
#endif //FB_CORE_OPERANDS_ALU_H
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

#ifndef FB_CORE_INSTRUCTIONS_CONDITIONS_H
#define FB_CORE_INSTRUCTIONS_CONDITIONS_H
#ifndef FB_CORE_OPERANDS_CONDITIONS_H
#define FB_CORE_OPERANDS_CONDITIONS_H

#include <instructions/instruction_context.h>
#include <operands/instruction_context.h>

namespace FunkyBoy::Operands {

Expand Down Expand Up @@ -51,4 +51,4 @@ namespace FunkyBoy::Operands {

}

#endif //FB_CORE_INSTRUCTIONS_CONDITIONS_H
#endif //FB_CORE_OPERANDS_CONDITIONS_H
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "debug.h"

#include <instructions/instruction_context.h>
#include <operands/instruction_context.h>

#ifdef FB_DEBUG_WRITE_EXECUTION_LOG

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#ifndef FB_CORE_INSTRUCTIONS_DEBUG_H
#define FB_CORE_INSTRUCTIONS_DEBUG_H
#ifndef FB_CORE_OPERANDS_DEBUG_H
#define FB_CORE_OPERANDS_DEBUG_H

// Uncomment to enable printing current opcode and register values to a file
// #define FB_DEBUG_WRITE_EXECUTION_LOG
Expand All @@ -37,4 +37,4 @@ namespace FunkyBoy::Debug {

#endif

#endif //FB_CORE_INSTRUCTIONS_DEBUG_H
#endif //FB_CORE_OPERANDS_DEBUG_H
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

#ifndef FB_CORE_INSTRUCTIONS_DECODER_H
#define FB_CORE_INSTRUCTIONS_DECODER_H
#ifndef FB_CORE_OPERANDS_DECODER_H
#define FB_CORE_OPERANDS_DECODER_H

#include <instructions/instructions.h>
#include <operands/instructions.h>

namespace FunkyBoy::Operands {

Expand All @@ -27,4 +27,4 @@ namespace FunkyBoy::Operands {

}

#endif //FB_CORE_INSTRUCTIONS_DECODER_H
#endif //FB_CORE_OPERANDS_DECODER_H
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*/

#ifndef FB_CORE_INSTRUCTION_CONTEXT_H
#define FB_CORE_INSTRUCTION_CONTEXT_H
#ifndef FB_CORE_OPERANDS_CONTEXT_H
#define FB_CORE_OPERANDS_CONTEXT_H

#include <util/typedefs.h>
#include <memory/memory.h>
#include <emulator/gb_type.h>
#include <instructions/debug.h>
#include <operands/debug.h>

namespace FunkyBoy {

Expand Down Expand Up @@ -92,4 +92,4 @@ namespace FunkyBoy {

}

#endif //FB_CORE_INSTRUCTION_CONTEXT_H
#endif //FB_CORE_OPERANDS_CONTEXT_H
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
* limitations under the License.
*/

#ifndef FB_CORE_INSTRUCTIONS_H
#define FB_CORE_INSTRUCTIONS_H
#ifndef FB_CORE_OPERANDS_H
#define FB_CORE_OPERANDS_H

#include <instructions/instruction_context.h>
#include <instructions/misc.h>
#include <instructions/prefix.h>
#include <instructions/alu.h>
#include <instructions/loads.h>
#include <instructions/reads.h>
#include <instructions/writes.h>
#include <instructions/jumps.h>
#include <instructions/rot_shifts.h>
#include <instructions/conditions.h>
#include <operands/instruction_context.h>
#include <operands/misc.h>
#include <operands/prefix.h>
#include <operands/alu.h>
#include <operands/loads.h>
#include <operands/reads.h>
#include <operands/writes.h>
#include <operands/jumps.h>
#include <operands/rot_shifts.h>
#include <operands/conditions.h>

#endif //FB_CORE_INSTRUCTIONS_H
#endif //FB_CORE_OPERANDS_H
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

#ifndef FB_CORE_INSTRUCTIONS_JUMPS_H
#define FB_CORE_INSTRUCTIONS_JUMPS_H
#ifndef FB_CORE_OPERANDS_JUMPS_H
#define FB_CORE_OPERANDS_JUMPS_H

#include <instructions/instruction_context.h>
#include <operands/instruction_context.h>

namespace FunkyBoy::Operands {

Expand All @@ -34,4 +34,4 @@ namespace FunkyBoy::Operands {

}

#endif //FB_CORE_INSTRUCTIONS_JUMPS_H
#endif //FB_CORE_OPERANDS_JUMPS_H
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#ifndef FB_CORE_INSTRUCTIONS_LOADS_H
#define FB_CORE_INSTRUCTIONS_LOADS_H
#ifndef FB_CORE_OPERANDS_LOADS_H
#define FB_CORE_OPERANDS_LOADS_H

#include "instruction_context.h"

Expand Down Expand Up @@ -136,4 +136,4 @@ namespace FunkyBoy::Operands {

}

#endif //FB_CORE_INSTRUCTIONS_LOADS_H
#endif //FB_CORE_OPERANDS_LOADS_H
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#ifndef FB_CORE_INSTRUCTIONS_MISC_H
#define FB_CORE_INSTRUCTIONS_MISC_H
#ifndef FB_CORE_OPERANDS_MISC_H
#define FB_CORE_OPERANDS_MISC_H

#include "instruction_context.h"

Expand Down Expand Up @@ -101,4 +101,4 @@ namespace FunkyBoy::Operands {

}

#endif //FB_CORE_INSTRUCTIONS_MISC_H
#endif //FB_CORE_OPERANDS_MISC_H
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#include <util/debug.h>
#include <util/flags.h>

#include <instructions/reads.h>
#include <instructions/writes.h>
#include <instructions/misc.h>
#include <instructions/debug.h>
#include <operands/reads.h>
#include <operands/writes.h>
#include <operands/misc.h>
#include <operands/debug.h>

using namespace FunkyBoy;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#ifndef FB_INSTRUCTIONS_PREFIX_PREFIX_H
#define FB_INSTRUCTIONS_PREFIX_PREFIX_H
#ifndef FB_CORE_OPERANDS_PREFIX_PREFIX_H
#define FB_CORE_OPERANDS_PREFIX_PREFIX_H

#include "instruction_context.h"

Expand All @@ -30,4 +30,4 @@ namespace FunkyBoy::Operands {

}

#endif //FB_INSTRUCTIONS_PREFIX_PREFIX_H
#endif //FB_CORE_OPERANDS_PREFIX_PREFIX_H
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#ifndef FB_CORE_INSTRUCTIONS__READS_H
#define FB_CORE_INSTRUCTIONS__READS_H
#ifndef FB_CORE_OPERANDS__READS_H
#define FB_CORE_OPERANDS__READS_H

#include "instruction_context.h"

Expand Down Expand Up @@ -108,4 +108,4 @@ namespace FunkyBoy::Operands {

}

#endif //FB_CORE_INSTRUCTIONS__READS_H
#endif //FB_CORE_OPERANDS__READS_H
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

#ifndef FB_CORE_INSTRUCTIONS_ROT_SHIFTS_H
#define FB_CORE_INSTRUCTIONS_ROT_SHIFTS_H
#ifndef FB_CORE_OPERANDS_ROT_SHIFTS_H
#define FB_CORE_OPERANDS_ROT_SHIFTS_H

#include <instructions/instruction_context.h>
#include <operands/instruction_context.h>

namespace FunkyBoy::Operands {

Expand Down Expand Up @@ -51,4 +51,4 @@ namespace FunkyBoy::Operands {

}

#endif //FB_CORE_INSTRUCTIONS_ROT_SHIFTS_H
#endif //FB_CORE_OPERANDS_ROT_SHIFTS_H
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

#ifndef FB_CORE_INSTRUCTIONS_WRITES_H
#define FB_CORE_INSTRUCTIONS_WRITES_H
#ifndef FB_CORE_OPERANDS_WRITES_H
#define FB_CORE_OPERANDS_WRITES_H

#include <instructions/instruction_context.h>
#include <operands/instruction_context.h>

namespace FunkyBoy::Operands {

Expand Down Expand Up @@ -45,4 +45,4 @@ namespace FunkyBoy::Operands {

}

#endif //FB_CORE_INSTRUCTIONS_WRITES_H
#endif //FB_CORE_OPERANDS_WRITES_H

0 comments on commit 8b51bb3

Please sign in to comment.