diff --git a/src/spider/runtime/Runtime.cpp b/src/spider/runtime/Runtime.cpp index e46bfc4..ddb008e 100644 --- a/src/spider/runtime/Runtime.cpp +++ b/src/spider/runtime/Runtime.cpp @@ -34,7 +34,7 @@ namespace spider { void Runtime::run() {} - void Runtime::run(u64 n) {} + //void Runtime::run(u64 n) {} // Misc // @@ -45,9 +45,10 @@ namespace spider { /** * Non-owning reel setup. */ - void Runtime::hookReel(InstrReel* reel, bool own) { - cpu.hookInstrReel(reel); - if(own) this->reel = reel; + void Runtime::hookReel(InstrReel* newReel, bool own) { + delete this->reel; + cpu.hookInstrReel(newReel); + if(own) this->reel = newReel; } } diff --git a/src/spider/runtime/Runtime.hpp b/src/spider/runtime/Runtime.hpp index dba8bbc..905041b 100644 --- a/src/spider/runtime/Runtime.hpp +++ b/src/spider/runtime/Runtime.hpp @@ -75,7 +75,7 @@ namespace spider { /** * Non-owning reel setup. */ - void hookReel(InstrReel* reel, bool own = false); + void hookReel(InstrReel* newReel, bool own = false); }; diff --git a/src/spider/runtime/instr/Instr_000-01F.cpp b/src/spider/runtime/instr/Instr_000-01F.cpp index 088b8d9..c6c613b 100644 --- a/src/spider/runtime/instr/Instr_000-01F.cpp +++ b/src/spider/runtime/instr/Instr_000-01F.cpp @@ -68,17 +68,20 @@ namespace spider { } void CPU::COM() { - // TODO: Implement COM fetchOperDst(); switch(_size){ case 0b00: //byte _dst->_u8 = ~_dst->_u8; + break; case 0b01: //short _dst->_u16 = ~_dst->_u16; + break; case 0b10: //int _dst->_u32 = ~_dst->_u32; + break; case 0b11: //long _dst->_u64 = ~_dst->_u64; + break; } (this->*_post)(); } @@ -89,28 +92,36 @@ namespace spider { switch(_size){ case 0b00: //byte _dst->_u8 = 1 + ~_dst->_u8; + break; case 0b01: //short _dst->_u16 = 1+ ~_dst->_u16; + break; case 0b10: //int _dst->_u32 = 1 + ~_dst->_u32; + break; case 0b11: //long _dst->_u64 = 1 + ~_dst->_u64; + break; } (this->*_post)(); } - void CPU::EXS() { + void CPU::EXS() { // THIS IS INCORRECT!!! // TODO: Implement EXS fetchOperDst(); switch(_size){ case 0b00: //byte _dst->_u32 = _dst->_u8 & 1; + break; case 0b01: //short _dst->_u32 = _dst->_u16 & 1; + break; case 0b10: //int _dst->_u32 = _dst->_u32 & 1; + break; case 0b11: //long _dst->_u32 = _dst->_u64 & 1; + break; } _dst->_u32 = _dst->_u8; (this->*_post)(); diff --git a/src/spider/runtime/math/Matrix.cpp b/src/spider/runtime/math/Matrix.cpp index 599001e..e0e81e0 100644 --- a/src/spider/runtime/math/Matrix.cpp +++ b/src/spider/runtime/math/Matrix.cpp @@ -5,6 +5,7 @@ #include #include +/* namespace spider { template @@ -101,3 +102,4 @@ namespace spider { } } +*/ diff --git a/src/spider/runtime/math/Matrix.hpp b/src/spider/runtime/math/Matrix.hpp index 4b62046..31760cf 100644 --- a/src/spider/runtime/math/Matrix.hpp +++ b/src/spider/runtime/math/Matrix.hpp @@ -2,6 +2,7 @@ #include +/* namespace spider { template @@ -27,3 +28,4 @@ namespace spider { f64 matrix_det(Matrix mat); } +*/ \ No newline at end of file diff --git a/src/spider/runtime/math/Matrix_Multiply.cpp b/src/spider/runtime/math/Matrix_Multiply.cpp index df708aa..7d06acf 100644 --- a/src/spider/runtime/math/Matrix_Multiply.cpp +++ b/src/spider/runtime/math/Matrix_Multiply.cpp @@ -1,6 +1,6 @@ #include - +/* template struct Matrix { T data[Rows][Cols]; @@ -106,3 +106,4 @@ Matrix mat_multiply(Matrix A, Matrix B) { return result; } +*/ \ No newline at end of file diff --git a/src/spider/runtime/math/Quat.cpp b/src/spider/runtime/math/Quat.cpp index 433bd00..890a6c3 100644 --- a/src/spider/runtime/math/Quat.cpp +++ b/src/spider/runtime/math/Quat.cpp @@ -30,17 +30,17 @@ namespace spider { return quat_mul_gnrl(q1, q2); } - void quat_mat(Quat quat, f32* mat) { - // TODO - } + //void quat_mat(Quat quat, f32* mat) { + // // TODO + //} Quat quat_mul(Quat q1, Quat q2) { return quat_mul_gnrl(q1, q2); } - void quat_mat(Quat q1, f64* mat) { - // TODO - } + //void quat_mat(Quat q1, f64* mat) { + // // TODO + //} /* int quatMain() { diff --git a/src/spider/runtime/reel/InstrReelDyn.cpp b/src/spider/runtime/reel/InstrReelDyn.cpp index 701572f..003df88 100644 --- a/src/spider/runtime/reel/InstrReelDyn.cpp +++ b/src/spider/runtime/reel/InstrReelDyn.cpp @@ -9,7 +9,7 @@ namespace spider { growTo((length >> 8) + ((length & 255) != 0)); } - InstrReelDyn::InstrReelDyn(const u8* data, u64 length) {} + //InstrReelDyn::InstrReelDyn(const u8* data, u64 length) {} InstrReelDyn::InstrReelDyn(const InstrReelDyn& copy) : _blocks(copy._blocks), _size(copy._size) { @@ -89,7 +89,7 @@ namespace spider { dat = 0; for (isize i = 0; i < sizeof(dat); i++) { auto& b = _blocks[(b_index + s_index) >> 8]; - dat |= u16(b.data[s_index++ & 0xFF]) << (i * 8); + dat |= u16(b.data[s_index++ & 0xFF] << (i * 8)); } return dat; } @@ -196,17 +196,14 @@ namespace spider { // TODO! - void InstrReelDyn::writeU8(u64 ip, u8 dat) {} - - void InstrReelDyn::writeU16(u64 ip, u16 dat) {} - - void InstrReelDyn::writeU32(u64 ip, u32 dat) {} - - void InstrReelDyn::writeU64(u64 ip, u64 dat) {} + //void InstrReelDyn::writeU8(u64 ip, u8 dat) {} + //void InstrReelDyn::writeU16(u64 ip, u16 dat) {} + //void InstrReelDyn::writeU32(u64 ip, u32 dat) {} + //void InstrReelDyn::writeU64(u64 ip, u64 dat) {} /** * Appends instruction at the end. */ - void InstrReelDyn::append(u16 bc) {} + //void InstrReelDyn::append(u16 bc) {} } diff --git a/src/spider/runtime/util/Terminal.cpp b/src/spider/runtime/util/Terminal.cpp index 52eb4c8..55a589d 100644 --- a/src/spider/runtime/util/Terminal.cpp +++ b/src/spider/runtime/util/Terminal.cpp @@ -148,7 +148,7 @@ namespace spider { // 4. Overlay the title if provided if (!title.empty()) { - move(startRow, startCol + (width - title.size() - 2) / 2); + move(startRow, startCol + (width - i32(title.size()) - 2) / 2); std::cout << " " << title << " "; }