mirror of
https://github.com/open-goal/jak-project
synced 2026-07-09 23:01:56 -04:00
[decompiler] nicer static giftags (#1970)
```
:gif0 (new 'static 'gif-tag64
:nloop #x4
:eop #x1
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
:gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
```
instead of
```
:gif (new 'static 'array uint64 2 #x303e400000008004 #x412)
```
This commit is contained in:
@@ -996,7 +996,20 @@ goos::Object decompile_structure(const TypeSpec& type,
|
||||
for (int byte_idx = field_start; byte_idx < field_end; byte_idx++) {
|
||||
bytes_out.push_back(obj_words.at(byte_idx / 4).get_byte(byte_idx % 4));
|
||||
}
|
||||
field_defs_out.emplace_back(field.name(), decompile_value(field.type(), bytes_out, ts));
|
||||
|
||||
// use more specific types for gif tags.
|
||||
bool is_gif_type =
|
||||
type.base_type() == "dma-gif-packet" || type.base_type() == "dma-gif";
|
||||
if (is_gif_type && field.name() == "gif0") {
|
||||
field_defs_out.emplace_back(field.name(),
|
||||
decompile_value(TypeSpec("gif-tag64"), bytes_out, ts));
|
||||
} else if (is_gif_type && field.name() == "gif1") {
|
||||
field_defs_out.emplace_back(field.name(),
|
||||
decompile_value(TypeSpec("gif-tag-regs"), bytes_out, ts));
|
||||
} else {
|
||||
field_defs_out.emplace_back(field.name(),
|
||||
decompile_value(field.type(), bytes_out, ts));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user