mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-23 08:38:52 -05:00
d24c8453db
subrepo: subdir: "libultraship" merged: "a484cda98" upstream: origin: "https://github.com/HarbourMasters/libultraship.git" branch: "main" commit: "a484cda98" git-subrepo: version: "0.4.1" origin: "???" commit: "???"
31 lines
751 B
C++
31 lines
751 B
C++
#include "DisplayList.h"
|
|
#include "PR/ultra64/gbi.h"
|
|
|
|
namespace Ship
|
|
{
|
|
void DisplayListV0::ParseFileBinary(BinaryReader* reader, Resource* res)
|
|
{
|
|
DisplayList* dl = (DisplayList*)res;
|
|
|
|
ResourceFile::ParseFileBinary(reader, res);
|
|
|
|
while (reader->GetBaseAddress() % 8 != 0)
|
|
reader->ReadByte();
|
|
|
|
while (true)
|
|
{
|
|
uint64_t data = reader->ReadUInt64();
|
|
|
|
dl->instructions.push_back(data);
|
|
|
|
uint8_t opcode = data >> 24;
|
|
|
|
// These are 128-bit commands, so read an extra 64 bits...
|
|
if (opcode == G_SETTIMG_OTR || opcode == G_DL_OTR || opcode == G_VTX_OTR || opcode == G_BRANCH_Z_OTR || opcode == G_MARKER || opcode == G_MTX_OTR)
|
|
dl->instructions.push_back(reader->ReadUInt64());
|
|
|
|
if (opcode == G_ENDDL)
|
|
break;
|
|
}
|
|
}
|
|
} |