[Decomp] Decompile more files. (#290)

* decompile ocean trans tables

* more

* exclude tables from decomp progress

* format'
This commit is contained in:
water111
2021-02-27 14:40:18 -05:00
committed by GitHub
parent 049489c85b
commit 57eca1dee9
31 changed files with 19469 additions and 381 deletions
+125
View File
@@ -216,4 +216,129 @@ TEST_F(DataDecompTest, VifDisasmArray) {
" (new 'static 'vif-disasm-element :mask #x7f :tag #x1 :print #x2 :string1 \"stcycl\")\n"
" (new 'static 'vif-disasm-element :mask #x7f :tag #x2 :print #x1 :string1 \"offset\" "
" :string2 \"offset\"))");
}
TEST_F(DataDecompTest, ContinuePoint) {
std::string input =
" .type continue-point\n"
"L63:\n"
" .word L69\n"
" .symbol finalboss\n"
" .word 0x0\n"
" .word 0x4b303728\n"
" .word 0x4a073f00\n"
" .word 0xcb94152d\n"
" .word 0x3f800000\n"
" .word 0x0\n"
" .word 0x3f3b851f\n"
" .word 0x0\n"
" .word 0x3f2e425b\n"
" .word 0x4b2faddf\n"
" .word 0x4a0869de\n"
" .word 0xcb94485e\n"
" .word 0x3f800000\n"
" .word 0x3f169ad4\n"
" .word 0x0\n"
" .word 0xbf4ef9db\n"
" .word 0x3ddbf488\n"
" .word 0x3f7db8bb\n"
" .word 0x3d9ff2e5\n"
" .word 0x3f4d288d\n"
" .word 0xbe07fcb9\n"
" .word 0x3f15460b\n"
" .word L64\n"
" .symbol fin\n"
" .symbol finalboss\n"
" .symbol display\n"
" .symbol citadel\n"
" .symbol special\n"
" .word 0x0\n"
"L64: (offset 2)\n"
" .word L65\n"
" .empty-list\n"
"L65: (offset 2)\n"
" .symbol special\n"
" .word L66\n"
"L66: (offset 2)\n"
" .word L68\n"
" .word L67\n"
"L67: (offset 2)\n"
" .symbol #t\n"
" .empty-list\n"
" .type string\n"
"L68:\n"
" .word 0x10\n"
" .word 0x62746963\n"
" .word 0x6978652d\n"
" .word 0x6c702d74\n"
" .word 0x342d7461\n"
" .word 0x0\n"
" .word 0x0\n"
" .type string\n"
"L69:\n"
" .word 0xf\n"
" .word 0x616e6966\n"
" .word 0x736f626c\n"
" .word 0x74732d73\n"
" .word 0x747261";
auto parsed = parse_data(input);
auto decomp =
decompile_at_label_guess_type(parsed.label("L63"), parsed.labels, {parsed.words}, dts->ts);
check_forms_equal(decomp.print(),
"(new 'static 'continue-point\n"
" :name \"finalboss-start\"\n"
" :level 'finalboss\n"
" :trans (new 'static 'vector\n"
" :x 11548456.000000\n"
" :y 2215872.000000\n"
" :z -19409498.000000\n"
" :w 1.000000\n"
" )\n"
" :quat (new 'static 'vector\n"
" :y (the-as float #x3f3b851f)\n"
" :w (the-as float #x3f2e425b)\n"
" )\n"
" :camera-trans (new 'static 'vector\n"
" :x 11513311.000000\n"
" :y (the-as float #x4a0869de)\n"
" :z -19435708.000000\n"
" :w 1.000000\n"
" )\n"
" :camera-rot (new 'static 'array 'float 9\n"
" (the-as float #x3f169ad4)\n"
" 0.000000\n"
" (the-as float #xbf4ef9db)\n"
" (the-as float #x3ddbf488)\n"
" (the-as float #x3f7db8bb)\n"
" (the-as float #x3d9ff2e5)\n"
" (the-as float #x3f4d288d)\n"
" (the-as float #xbe07fcb9)\n"
" (the-as float #x3f15460b)\n"
" )\n"
" :load-commands (('special \"citb-exit-plat-4\" #t))\n"
" :vis-nick 'fin\n"
" :lev0 'finalboss\n"
" :disp0 'display\n"
" :lev1 'citadel\n"
" :disp1 'special\n"
" )");
}
TEST_F(DataDecompTest, FloatArray) {
std::string input =
" .type continue-point\n"
"L63:\n"
" .word 0x3f800000\n"
" .word 0x0\n"
" .word 0x3f800000\n"
" .word 0x0\n"
" .word 0x3f800000\n"
" .word 0x0\n"
" .word 0x3f800000\n\n";
auto parsed = parse_data(input);
auto decomp = decompile_at_label_with_hint({"(pointer float)", true, 7}, parsed.label("L63"),
parsed.labels, {parsed.words}, *dts);
check_forms_equal(decomp.print(),
"(new 'static 'array 'float 7\n"
"1.0 0.0 1.0 0.0 1.0 0.0 1.0)");
}