63 Commits

Author SHA1 Message Date
Paweł Kołodziejski ebbfd826d5 ALL: Upgrade tools licence to GPLv3+ 2022-06-26 19:14:49 +02:00
Thierry Crozat d5c8077933 JANITORIAL: Move copyright notice to a separate file 2014-01-19 18:13:09 +00:00
Thierry Crozat fe2d3c2d71 JANITORIAL: Remove now useless SVN tags 2014-01-06 22:54:34 +00:00
Michael Madsen 4e9914f57e DECOMPILER: Objectify Instruction
*Major* restructuring in this revision.
All other disassemblers will require updates.
Documentation for all of this is coming soon.

svn-id: r54904
2010-12-14 03:14:11 +00:00
Michael Madsen d1378266fb DECOMPILER: Create Value hierarchy
Change code generation to use Values instead of StackEntries
Next step: Use Value instead of Parameter

svn-id: r54891
2010-12-12 22:50:15 +00:00
Michael Madsen b3a79b748c DECOMPILER: Use pointers to Instructions
svn-id: r54873
2010-12-12 00:15:52 +00:00
Johannes Schickel 8dcfd0527b DECOMPILER: Remove a few empty lines.
svn-id: r52315
2010-08-23 23:43:32 +00:00
Johannes Schickel db10c253c8 DECOMP: Cleanup.
svn-id: r52312
2010-08-23 21:30:51 +00:00
Michael Madsen fedb730dd6 DECOMPILER: Remove accidental blank lines
svn-id: r52095
2010-08-15 07:55:32 +00:00
Michael Madsen 7b4e649ad7 DECOMPILER: Mass enum member renaming
svn-id: r52094
2010-08-14 22:11:24 +00:00
Michael Madsen 0e571b3e5c DECOMPILER: Refactor instruction processing
svn-id: r52093
2010-08-14 21:29:45 +00:00
Johannes Schickel b15c04a326 Decompiler: Fix formatting.
svn-id: r52090
2010-08-14 12:35:07 +00:00
Michael Madsen 62ab946718 DECOMPILER: Split kUnaryOp into pre- and postfix
svn-id: r52049
2010-08-12 23:31:59 +00:00
Max Horn f44477a0d8 DECOMPILER: Assert out when indent level underflows
This easily happens when working on a new decompiler engine,
e.g. if Engine::getDestAddress has not been implemented correctly.
Maybe an exception would be even better than an assert, but at
least it does not crash in weird places now.

svn-id: r52037
2010-08-12 12:49:36 +00:00
Max Horn cfe883f0b6 DECOMPILER: Add 'pos' parameter to processSpecialMetadata
svn-id: r52036
2010-08-12 12:46:57 +00:00
Michael Madsen db48f271be DECOMPILER: Add explanatory comments
svn-id: r52023
2010-08-12 00:54:04 +00:00
Michael Madsen e64480948c DECOMPILER: Merge kBinaryOp and kComparison
svn-id: r52017
2010-08-12 00:01:37 +00:00
Michael Madsen 3a771ebe78 DECOMPILER: Code generation for KYRA
svn-id: r51824
2010-08-07 02:39:11 +00:00
Michael Madsen cc703b9b1b Add 0x prefix to jumps
svn-id: r51632
2010-08-02 17:09:51 +00:00
Michael Madsen 5b91781f0f Tighten up else coalescing criteria
svn-id: r51630
2010-08-02 17:04:46 +00:00
Michael Madsen c66bd1ccfa Major overhaul of else detection
The else detection was horribly, horribly broken, leading to incorrect
and unbalanced output. This has now been revamped entirely, and all
SCUMMv6 scripts are at least balanced now. Additionally, various output
enhancements have been added.

Note: Short-circuit detection has been temporarily disabled, pending
proper handling. Consequently, one test, testShortCircuitDetection, is
currently *expected* to fail.

svn-id: r51621
2010-08-02 14:38:45 +00:00
Michael Madsen 518d29ca04 Codegen improvements
Improve extra output detection
Don't output pop() comments in SCUMMv6 codegen

svn-id: r51562
2010-08-01 01:59:22 +00:00
Michael Madsen 027e927ffe Improve coalescing of else and if blocks
svn-id: r51545
2010-07-31 18:10:18 +00:00
Michael Madsen 314ae6bd46 Use different names for duplicated entries
svn-id: r51314
2010-07-26 14:43:58 +00:00
Michael Madsen 004f726058 Don't decrement _indentLevel if 0
svn-id: r51264
2010-07-24 22:18:55 +00:00
Michael Madsen 9de402370c Remove incorrect decrement of _indentLevel
svn-id: r51261
2010-07-24 21:42:24 +00:00
Michael Madsen 84a4e36e57 Move some code from header files to .cpp files
svn-id: r51260
2010-07-24 21:31:33 +00:00
Michael Madsen 4df4b7902a Remove obsolete TODO, add parenthesis to UnaryOp
svn-id: r51232
2010-07-24 01:34:56 +00:00
Michael Madsen 88849f056c Add indenting to code generator
Slightly hackish, but works as a simple, temporary solution

svn-id: r51228
2010-07-23 23:03:40 +00:00
Michael Madsen c954f21b66 Don't end else block if merged with an if block
Currently, "else { if () {" is merged into a single "else if () {"
block. In those cases, we don't want to output the ending } for one of
those blocks, so we'll skip ending the else.

svn-id: r51227
2010-07-23 21:27:28 +00:00
Michael Madsen 4b5f4f3689 Filter out unnecessary jumps from output
svn-id: r51191
2010-07-23 03:12:18 +00:00
Michael Madsen 6e519f7b98 Add argument ordering for lBinaryOp and kSpecial
svn-id: r51190
2010-07-23 02:42:09 +00:00
Michael Madsen d336df7a7b Add handling of kSpecial metadata for SCUMMv6
svn-id: r51189
2010-07-23 01:38:34 +00:00
Max Horn 16e6daf675 code formatting
svn-id: r51141
2010-07-22 12:42:35 +00:00
Michael Madsen 6b22ac060a Add missing break
svn-id: r51136
2010-07-22 10:58:14 +00:00
Michael Madsen b2693efd1c Cleanup codegen output
svn-id: r51135
2010-07-22 10:55:51 +00:00
Michael Madsen 6764f4700b Fix incorrectly printed stuff
svn-id: r51128
2010-07-22 00:22:14 +00:00
Michael Madsen 196bcdffa7 Codegen improvements
Add new entry types for strings and lists
Add final missing opcodes that require special handling
Add function to create SCUMM list from stack

svn-id: r51127
2010-07-22 00:14:51 +00:00
Michael Madsen da65ba265f Add UnaryOp handling in generic class
svn-id: r51126
2010-07-21 23:34:08 +00:00
Michael Madsen 67814d2b63 Add break/continue/goto support
svn-id: r51125
2010-07-21 23:30:53 +00:00
Michael Madsen 6244128d8f Prepare for handling of kSpecial opcodes
svn-id: r51124
2010-07-21 23:24:29 +00:00
Michael Madsen 912601e41c Move binary operator handling to generic class
svn-id: r51123
2010-07-21 23:22:54 +00:00
Michael Madsen 45e15ec7c1 Handle pop in SCUMMv6, remove warnings
svn-id: r51120
2010-07-21 22:30:23 +00:00
Michael Madsen c1a520047d Style fix.
svn-id: r51119
2010-07-21 22:26:37 +00:00
Michael Madsen 267de0ebcd Allow disabling default handling of opcodes
svn-id: r51118
2010-07-21 22:21:18 +00:00
Michael Madsen 745972b482 Fix missing } in do-while output
svn-id: r51115
2010-07-21 22:00:52 +00:00
Michael Madsen 20cfb700b0 Fix compilation error
svn-id: r51114
2010-07-21 21:59:40 +00:00
Michael Madsen 46a8491389 Minor cleanup
svn-id: r51113
2010-07-21 21:52:22 +00:00
Michael Madsen 480e639f2b Add else, implied block markers (}, do {)
Remove auto-indenting in addOutputLine

svn-id: r51111
2010-07-21 21:48:05 +00:00
Michael Madsen 097bcb1303 Fix output of assignments in dups
svn-id: r51080
2010-07-21 01:01:22 +00:00