diff --git a/C++ProjectTemplate b/C++ProjectTemplate index bc194fc..557cf5d 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/main.cpp b/main.cpp index 38a92f4..130303a 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,7 @@ #include "pixelGameEngine.h" #include "Polygon.h" #include +#include using namespace olc; @@ -52,11 +53,24 @@ public: uint16_t index; //One 16-bit index register called ā€œIā€ which is used to point at locations in memory std::arrayreg; + std::string Display8(int number){ + std::bitset<8>numb(number); + return numb.to_string(); + } + std::string Display16(int number){ + std::bitset<16>numb(number); + return numb.to_string(); + } + bool OnUserCreate() override { - //memory[0x200]=0x00; - //memory[0x201]=0xE0; + memory[0x200]=0x60; + memory[0x201]=0x0A; + memory[0x202]=0x70; + memory[0x203]=0x04; + memory[0x204]=0x12; + memory[0x205]=0x00; //0x200 program start return true; } @@ -81,24 +95,24 @@ public: //DECODE uint8_t nibble1 = opcode>>12; - uint8_t X = reg[opcode>>8&0xF]; - uint8_t Y = reg[opcode>>4&0xF]; + uint8_t X = opcode>>8&0xF; + uint8_t Y = opcode>>4&0xF; uint8_t N = opcode&0xF; uint8_t NN = opcode&0x00FF; uint16_t NNN = opcode&0x0FFF; + std::cout<<"Opcode 0x"<