mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
f0ceea8b2e
* wip, taking a break to work on asm stuff first * the goal code for sparticle * mips2c the first sparticle asm function * temp * particle processing no longer crashing * temp * working texture cache for vi1 and hud textures * sprites * cleanup 1 * temp * temp * add zstd library * temp * working * tests * include fix * uncomment * better decomp of sparticle stuff, part 1 * update references
92 lines
1.9 KiB
C++
92 lines
1.9 KiB
C++
#include "dma.h"
|
|
|
|
#include "third-party/fmt/core.h"
|
|
#include "common/util/assert.h"
|
|
|
|
std::string DmaTag::print() {
|
|
std::string result;
|
|
const char* mode_names[8] = {"refe", "cnt", "next", "ref", "refs", "call", "ret", "end"};
|
|
result += fmt::format("TAG: 0x{:08x} {:4s} qwc 0x{:04x}", addr, mode_names[(int)kind], qwc);
|
|
if (spr) {
|
|
result += " SPR";
|
|
}
|
|
result += "\n";
|
|
return result;
|
|
}
|
|
|
|
std::string VifCode::print() {
|
|
std::string result;
|
|
|
|
switch (kind) {
|
|
case Kind::NOP:
|
|
result = "NOP";
|
|
break;
|
|
case Kind::STCYCL: {
|
|
VifCodeStcycl stcycl(immediate);
|
|
result = fmt::format("STCYCL cl: {} wl: {}", stcycl.cl, stcycl.wl);
|
|
} break;
|
|
case Kind::OFFSET:
|
|
result = "OFFSET";
|
|
break;
|
|
case Kind::BASE:
|
|
result = "BASE";
|
|
break;
|
|
case Kind::ITOP:
|
|
result = "ITOP";
|
|
break;
|
|
case Kind::STMOD:
|
|
result = "STMOD";
|
|
break;
|
|
case Kind::MSK3PATH:
|
|
result = "MSK3PATH";
|
|
break;
|
|
case Kind::MARK:
|
|
result = "MARK";
|
|
break;
|
|
case Kind::FLUSHE:
|
|
result = "FLUSHE";
|
|
break;
|
|
case Kind::FLUSH:
|
|
result = "FLUSH";
|
|
break;
|
|
case Kind::FLUSHA:
|
|
result = "FLUSHA";
|
|
break;
|
|
case Kind::MSCAL:
|
|
result = "MSCAL";
|
|
break;
|
|
case Kind::MSCNT:
|
|
result = "MSCNT";
|
|
break;
|
|
case Kind::MSCALF:
|
|
result = "MSCALF";
|
|
break;
|
|
case Kind::STMASK:
|
|
result = "STMASK";
|
|
break;
|
|
case Kind::STROW:
|
|
result = "STROW";
|
|
break;
|
|
case Kind::STCOL:
|
|
result = "STCOL";
|
|
break;
|
|
case Kind::MPG:
|
|
result = "MPG";
|
|
break;
|
|
case Kind::DIRECT:
|
|
result = "DIRECT";
|
|
break;
|
|
case Kind::DIRECTHL:
|
|
result = "DIRECTHL";
|
|
break;
|
|
default:
|
|
fmt::print("Unhandled vif code {}", (int)kind);
|
|
result = "???";
|
|
// assert(false);
|
|
break;
|
|
}
|
|
// TODO: the rest of the VIF code.
|
|
|
|
return result;
|
|
}
|