Commit Graph

  • 2252390706 Implement one more opcode needed for some Bishi levels. Jennifer Taylor 2021-05-06 19:37:55 +00:00
  • 459803d244 Only check IFS file size if we extracted it out of our own IFS. Jennifer Taylor 2021-05-06 19:37:32 +00:00
  • 9ce8b79b10 Implement define text tag, fill in some better understanding of the font tag from define text understanding. Jennifer Taylor 2021-05-06 19:37:05 +00:00
  • 5d26149298 Check in fix for non-compressed files. Jennifer Taylor 2021-05-06 19:36:43 +00:00
  • 74e3160588 Implement super support for IFS extraction. Jennifer Taylor 2021-05-06 19:36:24 +00:00
  • b81d2aeaae Fix one last case where we can get surprise gotos. Jennifer Taylor 2021-05-05 19:32:08 +00:00
  • 203fdd3a10 Fix tricky case where we have nowhere to jump to after a While loop inside an if. Jennifer Taylor 2021-05-05 19:31:45 +00:00
  • 481c5a50ce Implement one more opcode that I've seen in Bishi levels. Jennifer Taylor 2021-05-05 00:57:31 +00:00
  • 9544287b13 Deal with empty if statements (usually compiled-out debug switches). Jennifer Taylor 2021-05-05 00:56:59 +00:00
  • 25278d76c5 Fix stack walking bug with respect to pre-converted if statements. Jennifer Taylor 2021-05-05 00:56:33 +00:00
  • eba79ed3bc Add heuristic for parsing a troublesome flag in SWF object create tags. Jennifer Taylor 2021-05-05 00:55:34 +00:00
  • f75b9f038e Implement a few more opcodes to get a few more Bishi files decompiling. Jennifer Taylor 2021-05-05 00:55:02 +00:00
  • 636e1876bc Add while loop detection and conversion. Jennifer Taylor 2021-05-05 00:54:34 +00:00
  • 2f79a6401d Fix massive bug which dropped function calls without returns from the finished output. Jennifer Taylor 2021-05-05 00:53:58 +00:00
  • f09fd79a45 Add for loop detection and conversion. Jennifer Taylor 2021-05-05 00:53:38 +00:00
  • e17f7c2bdb Add some tests for for/while loops in anticipation of optimizing output. Jennifer Taylor 2021-05-05 00:53:02 +00:00
  • 83f4f43e9e Implement a few more opcodes, fix stack ordering with multiple entries after reconciliation. Jennifer Taylor 2021-05-04 02:32:32 +00:00
  • eddb8dc208 Several more code output optimizations done. Jennifer Taylor 2021-05-04 02:32:04 +00:00
  • 44b3628a85 Fix logic error in merging stacks when if statements didn't have a true and false body. Jennifer Taylor 2021-05-04 02:31:07 +00:00
  • 4790385022 Fix a logic error in if statement unwrapping, remove duplicated code in favor of a better true/false detection algorithm. Jennifer Taylor 2021-05-04 02:30:37 +00:00
  • 108d7c228d Handle having bytecode with no actual entries. Jennifer Taylor 2021-05-04 02:29:53 +00:00
  • 54b4c88d65 It seems that some bytecode leaves extra stuff on the stack sometimes, I think this is fine? Jennifer Taylor 2021-05-04 02:29:27 +00:00
  • 70c7448aa0 Fix nasty bug where sometimes we would have gotos without corresponding labels. Jennifer Taylor 2021-05-02 03:50:48 +00:00
  • 336ef6fc3d Check in some beta code for a new style of if detection that does not work yet. Jennifer Taylor 2021-05-02 03:50:19 +00:00
  • 7493db034f Add in basic throw, test code generation of mostly the same code as we tested the code graph with. Jennifer Taylor 2021-05-02 03:49:35 +00:00
  • 829597a871 Address the fact that I never handled END actions (they end processing as they are encountered). Jennifer Taylor 2021-05-02 03:48:38 +00:00
  • 261c3d7fbd Start a unit test framework for decompilation, in the hopes of eventually tracking down a logic bug in if extraction. Jennifer Taylor 2021-05-02 03:48:07 +00:00
  • 820a86845d Fix shallowest successor find when multiple nodes lead to the same location, fix if swap optimization and add BITAND and NOT_BITAND if support. Jennifer Taylor 2021-04-26 03:24:47 +00:00
  • 8cf219cb25 Avoid duplicating labels outside of and inside of do-while statements. Avoid going to or generating negative labels (artificially inserted nodes). Jennifer Taylor 2021-04-26 03:24:24 +00:00
  • b7523b5521 Fix if processing by getting rid of negation early optimization. There was a path that was negating but not being checked when doing the final render, leaving some if statements inverted. Moved the optimization to a final pass for more generalized correctness. Jennifer Taylor 2021-04-26 02:50:19 +00:00
  • 2d4f6cadfb Much more complicated stack walking algorithm that chains the stack through chunks and also calculates when temporary variables are needed. Jennifer Taylor 2021-04-26 01:28:48 +00:00
  • 4d0bfe5637 Fix an edge case in if detection where we reused IDs incorrectly by stopping the reuse of IDs. Also, convert returns much earlier in the stack. Jennifer Taylor 2021-04-26 01:27:51 +00:00
  • 28ce17b996 Apparently some BishiBashi levels use an even older AP2 version. Jennifer Taylor 2021-04-26 01:27:10 +00:00
  • 06bd9d1245 Fix logic error where we lost if statement jump points because __gather_chunks was too-aggressively dropping end pointers. Jennifer Taylor 2021-04-26 01:26:50 +00:00
  • 6f78668e9a Fix up exceptions and add more invariant checks to loop generation code. Jennifer Taylor 2021-04-26 01:25:32 +00:00
  • 5761474bec Enforce another invariant for dominator calculation that would have caught another hard-to-find bug. Jennifer Taylor 2021-04-26 01:24:25 +00:00
  • a09ad70de5 Improve a lot of exception message, enforce several more invariants in graph generation that would have caught previous bugs, fix possible issue with loop/dominator code if the entry code chunk was the beginning of a loop. Jennifer Taylor 2021-04-26 01:23:54 +00:00
  • 44f5e5cdcc Fix control flow graph splitting function to handle functions that jump to the end offset as a way of exiting early. Jennifer Taylor 2021-04-26 01:23:08 +00:00
  • 6323ef9adf Implment several more opcodes in actual decompilation step. Jennifer Taylor 2021-04-26 01:22:39 +00:00
  • 6052deed3c Refactor code generation step to allow for nested function definitions, actually hook those up. Jennifer Taylor 2021-04-26 01:22:14 +00:00
  • 3a9b3a7b3c Pass indentation context into expression rendering for upcoming function definition support. Jennifer Taylor 2021-04-26 01:21:42 +00:00
  • 351e7060b8 Allow subclasses of verbose manager to check verbose state directly. Jennifer Taylor 2021-04-26 01:21:03 +00:00
  • 51e27c0cff Enhance goto eliminiation to remove all unneeded gotos. Jennifer Taylor 2021-04-24 19:37:14 +00:00
  • 964d6f082c Clean up types on If statement, stop using strings to pass information. Jennifer Taylor 2021-04-24 19:36:58 +00:00
  • 534ab20f98 Add dead code eliminiation so dominators doesn't fail. Fix a tricky jump case with if statements. Jennifer Taylor 2021-04-24 18:13:07 +00:00
  • de84379ad0 Implement a lot more opcodes for expressions, fix an if conditional, improve while display. Jennifer Taylor 2021-04-24 18:11:20 +00:00
  • cc27d2418e Fix register display on assignment, add a few optimizing passes to clean up code. Jennifer Taylor 2021-04-24 18:10:27 +00:00
  • f1aea996c4 Handle if-goto pattern that I previously neglected. Jennifer Taylor 2021-04-24 18:09:44 +00:00
  • 6221d0273b Overhauled statement eval system so we always get back a list of statements. Jennifer Taylor 2021-04-24 18:08:04 +00:00
  • b0778e1110 Convert expression rendering to an explicit function so we can retain __repr__ for debugging. Jennifer Taylor 2021-04-24 18:07:01 +00:00
  • f2761b90b0 Restructure a lot of types to fit an expression/statement model and making a lot of stuff make more sense. Jennifer Taylor 2021-04-24 18:05:58 +00:00
  • 19c6de1fcc Actually decompile basic bytecode. There's much left to do, but some basics work! Jennifer Taylor 2021-04-24 18:05:03 +00:00
  • aebc277b62 Add a graph walker at the very end to verify that we've handled all control paths correctly, fix an edge case in If detection. Jennifer Taylor 2021-04-24 18:03:24 +00:00
  • 6aa04b0c1b Implement recursive if detection. Jennifer Taylor 2021-04-24 18:02:26 +00:00
  • 6e34d2647e Implement loop break/continue/goto processing. Jennifer Taylor 2021-04-24 18:01:25 +00:00
  • 738fce36c9 Lots more implementation done on decompiler, including better control flow and loop detection. Jennifer Taylor 2021-04-24 18:00:13 +00:00
  • b77ccdd5b9 Beginning of an AFP ByteCode decompiler, starting with a massive code reorg and a control flow graph analyzer. Jennifer Taylor 2021-04-24 17:59:36 +00:00
  • 011b84aceb Actually parse bytecode into an intermediate representation. Jennifer Taylor 2021-04-21 03:58:53 +00:00
  • f209bcbe54 Exit early if we're done rendering the main animation, allow background color override. Jennifer Taylor 2021-04-21 01:06:48 +00:00
  • 47525837cd Allow partial renders by hitting ctrl-c. Jennifer Taylor 2021-04-21 00:01:35 +00:00
  • cc25c3c8dc Don't draw shapes/sprites with zero scaling factor. Jennifer Taylor 2021-04-20 23:33:43 +00:00
  • 05a85abce8 Convert some more exceptions to warnings for best-effort renderings. Jennifer Taylor 2021-04-20 23:19:14 +00:00
  • 4c7ac0f744 Rework engine so multiple of the same sprite can be placed down by place item tags. Jennifer Taylor 2021-04-20 21:41:28 +00:00
  • 81c4496269 Implement what I think are the correct blending modes. Fixes some older Pop'n animations. Jennifer Taylor 2021-04-20 21:41:09 +00:00
  • 5a499a0f2c Fix rotation origin so some bishi bashi levels will render. Jennifer Taylor 2021-04-17 23:33:04 +00:00
  • d1cf978e12 Change rendering output style, allow series of png files to be rendered. Jennifer Taylor 2021-04-17 23:32:47 +00:00
  • 8cd85f26e9 Separate blend and color arguments for ease of experimenting. Jennifer Taylor 2021-04-17 23:32:30 +00:00
  • ebc86019ae Implement color blending, add fast path back to rendering shapes. Jennifer Taylor 2021-04-17 23:32:10 +00:00
  • e1c6ad429c Implement proper affine transformations instead of just translation. Jennifer Taylor 2021-04-17 23:31:36 +00:00
  • c6e19d0dfa Overhaul clip playback engine to allow clips to start when they're placed, not when they're created. Jennifer Taylor 2021-04-17 23:31:08 +00:00
  • 830f32814e Clean up the code some in preparation for trying to get affine transformations working. Jennifer Taylor 2021-04-17 23:30:46 +00:00
  • 700e63a001 Convert some more exceptions to warnings to allow attempts to render some BishiBashi content. Jennifer Taylor 2021-04-16 21:28:53 +00:00
  • de5dfd2421 Hook up TXP2 container to renderer, provide a "list" option to list out possible rendering paths in a container. Jennifer Taylor 2021-04-16 21:08:41 +00:00
  • d4faa9f7d8 Fix path issues for a few miscelaneous tools on Windows. Jennifer Taylor 2021-04-16 03:51:16 +00:00
  • 42f57e10d7 Include origin point in updated tags. Jennifer Taylor 2021-04-15 23:24:46 +00:00
  • 3ad60064f9 Convert some exceptions to warnings so files can be partially rendered. Jennifer Taylor 2021-04-15 23:20:27 +00:00
  • d835c46320 Support nested animations as well as update object requests. Jennifer Taylor 2021-04-15 23:19:56 +00:00
  • 3f5760343a Always filter out unnecessary exported tags, even when rendering the default animation. Jennifer Taylor 2021-04-15 23:18:54 +00:00
  • 1683c8ecdd Initial stab at an AFP animation renderer. It can render some basic animations from Pop'n Music! Jennifer Taylor 2021-04-15 23:18:33 +00:00
  • 3941b7e602 Fix a few more typos in object placement, values make a lot more sense now. Jennifer Taylor 2021-04-15 23:17:45 +00:00
  • 61603b0e63 Codify my guess as to what's going on with the mysterious point. Jennifer Taylor 2021-04-15 23:17:15 +00:00
  • 544baae387 Fix a few small bugs with place object handling. Jennifer Taylor 2021-04-15 23:16:45 +00:00
  • db36298f22 Slightly better IFS extraction and shape documentation, given my understanding of the relationship between the two. Jennifer Taylor 2021-04-15 23:16:03 +00:00
  • 520181785d Vastly improved IFS extraction which names afp/bsi/geo files correctly. Jennifer Taylor 2021-04-14 01:08:13 +00:00
  • d486cfa54e Finish handling push types and a few miscelaneous constants. Jennifer Taylor 2021-04-14 01:07:33 +00:00
  • 142ee31d56 Finish initial RE on bytecode, every opcode is now accounted for. Jennifer Taylor 2021-04-14 01:07:01 +00:00
  • 79b31c7fa2 Hook up parsed objects to all of SWF except for the bytecode mess. Jennifer Taylor 2021-04-12 03:10:31 +00:00
  • 8d686dcdb7 Assert on unknown data inside GE2D structures, so we don't miss something important. Jennifer Taylor 2021-04-12 03:10:14 +00:00
  • 9f6b9eb7d6 Begin parsing AFP data into useful structures. Jennifer Taylor 2021-04-12 03:09:57 +00:00
  • 9925b2f6b0 Add an extract option to write afp/bsi/geo files out of TXP2 containers similar to IFS containers. Jennifer Taylor 2021-04-11 20:45:40 +00:00
  • 522f8eaa29 Refactor verbose debugging to its own class, clean up classes that used it. Jennifer Taylor 2021-04-11 20:45:17 +00:00
  • 897e779b20 Refactor coverage stuff out to its own utility class, clean up code that used it. Jennifer Taylor 2021-04-11 20:44:55 +00:00
  • 30a51f48e6 Massive juggling of core AFP/AP2 implementation into its own files. Jennifer Taylor 2021-04-11 20:44:31 +00:00
  • f1294df839 Split types up to generic types and AP2-specific types. Jennifer Taylor 2021-04-11 20:44:11 +00:00
  • cef8bbfa83 Separate types out into their own module. Jennifer Taylor 2021-04-11 20:43:51 +00:00
  • 749f2bab0d Move AFP library in preparation of refactoring. Jennifer Taylor 2021-04-11 20:43:27 +00:00
  • fce04a2493 Implement a few more bytecode parsers, implement a few more push types, fix advancing past tags which are not 4-byte aligned in size. Jennifer Taylor 2021-04-10 03:47:15 +00:00
  • 61bd70f803 Implement some of edit text tags. Jennifer Taylor 2021-04-10 03:46:52 +00:00
  • 72f81e4f58 Fix typing mistake not caught on previous AP2 check-in. Jennifer Taylor 2021-04-08 01:05:48 +00:00
  • a3f247f422 Clean up node a little bit: Jennifer Taylor 2021-04-08 01:05:20 +00:00