dsm<<".align 0\n;"<<argv[1]<<"\n;Automatically generated by obj2kh2v\n;DO NOT EDIT IF YOU DON'T KNOW WHAT YOU ARE DOING\n\nstcycl 01, 01; We write code to memory without skips/overwrite\n\nunpack 4, 128, V4_32, 0, *; Model Part Header\n.int 1, 0, 0, 0;type 1 Model\n";
longhp=dsm.tellp();
dsm<<".align 0\n;"<<argv[1]<<"\n;Automatically generated by obj2kh2v\n;DO NOT EDIT IF YOU DON'T KNOW WHAT YOU ARE DOING\n\nstcycl 01, 01; We write code to memory without skips/overwrite\n\nunpack[r] V4_32, 0, *; Model Part Header\n.int 1, 0, 0, 0;type 1 Model\n";
hp=dsm.tellp();
//Can't insert if not at eof using ofstream so I put 10 spaces to fill up, size of INT_MAX and no \n to avoid linefeed not beeing rewritten
//It's so hacky but I'm fed up with this shit already
dsm<<".int "<<" , , , ";
dsm<<"\n.EndUnpack\n\nstcycl 01, 01; We write code to memory without skips/overwrite\n\nunpack 4, 128, V2_16, 0, *; UV definition\n";
dsm<<"\n.EndUnpack\n\nstcycl 01, 01; We write code to memory without skips/overwrite\n\nunpack[r] V2_16, 4, *; UV definition\n";
intvi=0;
intti=0;
...
...
@@ -51,9 +52,9 @@ in.seekg(0, std::ios::beg);
}
dsm<<".EndUnpack\n\nstmask 0xf3f3f3f3; Sets mask register(3303, check EEUSER_E)\nstcycl 01, 01; We write code to memory without skips/overwrite\n\nunpack 4, 128, S_8, 0, *; Vertex indices\n";
dsm<<".EndUnpack\n\nstmask 0xf3f3f3f3; Sets mask register(3303, check EEUSER_E)\nstcycl 01, 01; We write code to memory without skips/overwrite\n\nunpack[r] S_8, 4, *; Vertex indices\n";
for(inti=0;i<vi+1;i++){dsm<<".byte "<<i<<"\n";}
dsm<<".EndUnpack\n\nstmask 0xf3f3f3f3; Sets mask register(3303, check EEUSER_E)\nstcycl 01, 01; We write code to memory without skips/overwrite\n\nunpack 4, 128, S_8, 0, *; Flags\n";
dsm<<".EndUnpack\n\nstmask 0xf3f3f3f3; Sets mask register(3303, check EEUSER_E)\nstcycl 01, 01; We write code to memory without skips/overwrite\n\nunpack[r] S_8, 4, *; Flags\n";
in.clear();
in.seekg(0,std::ios::beg);
intiff=1;
...
...
@@ -83,7 +84,10 @@ line_process:
}
}
dsm<<".EndUnpack\n\nstcol 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000; We set garbage data to 1(float) so even if nothing is referenced game doesn't go crazy\nstmask 0x02020202; Sets mask register(0002, check EEUSER_E)\nstcycl 01, 01; We write code to memory without skips/overwrite\n\nunpack 4, 128, V3_32, 0, *; Vertex definition\n";
dsm<<".EndUnpack\n\nstcol 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000; We set garbage data to 1(float) so even if nothing is referenced game doesn't go crazy\nstmask 0x02020202; Sets mask register(0002, check EEUSER_E)\nstcycl 01, 01; We write code to memory without skips/overwrite\n\nunpack[r] V3_32,";
dsm<<".int "<<ti<<", 4, "<<4+ti+vi<<", "<<4+ti+vi+1<<"; Number of u+v+flag+index, their offset, offset of vertex affiliation header, offset of mat definition(end)\n";
dsm<<".int 0, 0, 0, 0; Nobody care about vertices merging and colors\n";
dsm<<".int 0, 0, 0, 0; Nobody care about vertices merging and colors\n";
dsm<<".int "<<vi<<", "<<4+ti<<", 0, 1; Number of vertex, their offset, reserved and number of array attribution\n";