private static string ParseG_LOADTLUT(BinaryReader memory, Microcode microcode, bool simpleParse) { int tile = Shift.AsUInt16(microcode.EncodingLow, 0x07000000); int colors = Shift.AsUInt16(microcode.EncodingLow, 0xFFC000) + 1; return($"{G_TX_.Tile(tile)} COLORS {colors}"); }
private static string ParseG_LOADTILE(BinaryReader memory, Microcode microcode, bool simpleParse) { float uls = Shift.AsUInt16(microcode.EncodingHigh, 0xFFF000) / 4f; float ult = Shift.AsUInt16(microcode.EncodingHigh, 0x000FFF) / 4f; int tile = Shift.AsUInt16(microcode.EncodingLow, 0x07000000); float lrs = Shift.AsUInt16(microcode.EncodingLow, 0xFFF000) / 4f; float lrt = Shift.AsUInt16(microcode.EncodingLow, 0x000FFF) / 4f; return($"{G_TX_.Tile(tile)} ST ({uls:F2},{ult:F2}), ({lrs:F2},{lrt:F2})"); }
private static string ParseG_LOADBLOCK(BinaryReader memory, Microcode microcode, bool simpleParse) { float uls = ((float)Shift.AsUInt16(microcode.EncodingHigh, 0xFFF000)) / 4; float ult = ((float)Shift.AsUInt16(microcode.EncodingHigh, 0x000FFF)) / 4; int tile = Shift.AsUInt16(microcode.EncodingLow, 0x0F000000); int texels = Shift.AsUInt16(microcode.EncodingLow, 0x00FFF000) + 1; float dxt = microcode.EncodingLow & 0xFFF; dxt /= 2048; float rdxt = 1 / dxt; return($"{G_TX_.Tile(tile)} ST ({uls:F2},{ult:F2}) TEXELS {texels:X4} DXT {dxt} 1/DXT {rdxt}"); }
private static string ParseG_SETTILE(BinaryReader memory, Microcode microcode, bool simpleParse) { int fmt = Shift.AsUInt16(microcode.EncodingHigh, 0xE00000); int siz = Shift.AsUInt16(microcode.EncodingHigh, 0x180000); int line = Shift.AsUInt16(microcode.EncodingHigh, 0x03FE00); int tmem = Shift.AsUInt16(microcode.EncodingHigh, 0x0001FF); int tile = Shift.AsUInt16(microcode.EncodingLow, 0x07000000); int palette = Shift.AsUInt16(microcode.EncodingLow, 0x00F00000); uint T_dat = Shift.AsUInt16(microcode.EncodingLow, 0x000FFC00); uint S_dat = Shift.AsUInt16(microcode.EncodingLow, 0x000003FF); (string cmA, string cmB, int mask, int shift)T, S; T = SetAxis(T_dat); S = SetAxis(S_dat); string result = $"{G_TX_.Tile(tile)} {(G_IM_FMT_)fmt} {(G_IM_SIZ_)siz} line {line} PAL {palette}"; if (!simpleParse) { result += $"{Environment.NewLine} S ({PrintAxis(S)}) {Environment.NewLine} T ({PrintAxis(T)})"; } return(result); (string cmA, string cmB, int mask, int shift) SetAxis(uint t_dat) { string cmA = (Shift.AsBool(t_dat, 0x100)) ? nameof(G_TX_.G_TX_MIRROR) : nameof(G_TX_.G_TX_NOMIRROR); string cmB = (Shift.AsBool(t_dat, 0x200)) ? nameof(G_TX_.G_TX_CLAMP) : nameof(G_TX_.G_TX_WRAP); int mask = Shift.AsUInt16(t_dat, 0xF0); int shift = Shift.AsUInt16(t_dat, 0x0F); return(cmA, cmB, mask, shift); } string PrintAxis((string cmA, string cmB, int mask, int shift) t) { return($"{t.cmA} {t.cmB} MASK {t.mask} SHIFT {t.shift}"); } }