24 | | {{{ |
25 | | static const uint16 qg4CrestBookshelfSignature[] = { |
26 | | SIG_MAGICDWORD, |
27 | | 0x51, 0x22, // class Polygon |
28 | | 0x4a, SIG_UINT16(0x0004), // send 04 |
29 | | 0x4a, SIG_UINT16(0x003e), // send 3e |
30 | | 0x36, // push |
31 | | 0x81, 0x02, // lag global[2] (rm663) |
32 | | 0x4a, SIG_UINT16(0x0008), // send 08 |
33 | | 0x38, SIG_SELECTOR16(handsOn), // pushi handsOn (begin clobbering) |
34 | | 0x76, // push0 |
35 | | 0x81, 0x01, // lag global[1] (Glory) |
36 | | 0x4a, SIG_UINT16(0x0004), // send 04 |
37 | | 0x38, SIG_SELECTOR16(dispose), // pushi dispose |
38 | | 0x76, // push0 |
39 | | 0x54, SIG_UINT16(0x0004), // self 04 |
40 | | 0x3a, // toss |
41 | | 0x48, // ret |
42 | | SIG_END |
43 | | }; |
44 | | |
45 | | static const uint16 qg4CrestBookshelfPatch[] = { |
46 | | PATCH_ADDTOOFFSET(+14), |
47 | | 0x38, PATCH_SELECTOR16(setScript), // pushi setScript |
48 | | 0x78, // push1 |
49 | | 0x72, PATCH_UINT16(0x01a4), // lofsa sLeaveSecretly |
50 | | 0x36, // push |
51 | | 0x81, 0x02, // lag global[2] (rm663) |
52 | | 0x4a, SIG_UINT16(0x0006), // send 6 |
53 | | 0x34, PATCH_UINT16(0), // ldi 0 (waste 3 bytes) |
54 | | 0x3a, // toss (branches will land here) |
55 | | 0x48, // ret |
56 | | PATCH_END |
57 | | }; |
58 | | |
59 | | static const uint16 qg4CrestBookshelfFloppySignature[] = { |
60 | | SIG_MAGICDWORD, |
61 | | 0x51, 0x21, // class Polygon |
62 | | 0x4a, SIG_UINT16(0x0004), // send 04 |
63 | | 0x4a, SIG_UINT16(0x003e), // send 3e |
64 | | 0x36, // push |
65 | | 0x81, 0x02, // lag global[2] (rm663) |
66 | | 0x4a, SIG_UINT16(0x0008), // send 08 |
67 | | 0x38, SIG_SELECTOR16(handsOn), // pushi handsOn (begin clobbering) |
68 | | 0x76, // push0 |
69 | | 0x81, 0x01, // lag global[1] (Glory) |
70 | | 0x4a, SIG_UINT16(0x0004), // send 04 |
71 | | 0x38, SIG_SELECTOR16(dispose), // pushi dispose |
72 | | 0x76, // push0 |
73 | | 0x54, SIG_UINT16(0x0004), // self 04 |
74 | | 0x3a, // toss |
75 | | 0x48, // ret |
76 | | SIG_END |
77 | | }; |
78 | | |
79 | | static const uint16 qg4CrestBookshelfFloppyPatch[] = { |
80 | | PATCH_ADDTOOFFSET(+14), |
81 | | 0x38, PATCH_SELECTOR16(setScript), // pushi setScript |
82 | | 0x78, // push1 |
83 | | 0x72, PATCH_UINT16(0x018c), // lofsa sLeaveSecretly |
84 | | 0x36, // push |
85 | | 0x81, 0x02, // lag global[2] (rm663) |
86 | | 0x4a, SIG_UINT16(0x0006), // send 6 |
87 | | 0x34, PATCH_UINT16(0), // ldi 0 (waste 3 bytes) |
88 | | 0x3a, // toss (branches will land here) |
89 | | 0x48, // ret |
90 | | PATCH_END |
91 | | }; |
92 | | |
93 | | static const uint16 qg4CrestBookshelfMotionSignature[] = { |
94 | | SIG_MAGICDWORD, |
95 | | 0x38, SIG_SELECTOR16(setMotion), // pushi setMotion |
96 | | 0x38, SIG_UINT16(0x0004), // pushi 04 |
97 | | 0x51, 0x1d, // class MoveTo |
98 | | 0x36, // push |
99 | | 0x39, 0x1d, // pushi x = 29d |
100 | | 0x38, SIG_UINT16(0x0097), // pushi y = 151d |
101 | | 0x7c, // pushSelf |
102 | | 0x81, 0x00, // lag global[0] (hero) |
103 | | 0x4a, SIG_UINT16(0x000c), // send 0c |
104 | | SIG_END |
105 | | }; |
106 | | |
107 | | static const uint16 qg4CrestBookshelfMotionPatch[] = { |
108 | | PATCH_ADDTOOFFSET(+6), |
109 | | 0x51, 0x23, // class PolyPath |
110 | | PATCH_END |
111 | | }; |
112 | | |
113 | | static const uint16 qg4CrestBookshelfMotionFloppySignature[] = { |
114 | | SIG_MAGICDWORD, |
115 | | 0x38, SIG_SELECTOR16(setMotion), // pushi setMotion |
116 | | 0x38, SIG_UINT16(0x0004), // pushi 04 |
117 | | 0x51, 0x1c, // class MoveTo |
118 | | 0x36, // push |
119 | | 0x39, 0x1d, // pushi x = 29d |
120 | | 0x38, SIG_UINT16(0x0097), // pushi y = 151d |
121 | | 0x7c, // pushSelf |
122 | | 0x81, 0x00, // lag global[0] (hero) |
123 | | 0x4a, SIG_UINT16(0x000c), // send 0c |
124 | | SIG_END |
125 | | }; |
126 | | |
127 | | static const uint16 qg4CrestBookshelfMotionFloppyPatch[] = { |
128 | | PATCH_ADDTOOFFSET(+6), |
129 | | 0x51, 0x22, // class PolyPath |
130 | | PATCH_END |
131 | | }; |
132 | | |
133 | | [...] |
134 | | |
135 | | { true, 663, "fix crest bookshelf", 1, qg4CrestBookshelfSignature, qg4CrestBookshelfPatch }, |
136 | | { true, 663, "fix crest bookshelf (floppy)", 1, qg4CrestBookshelfFloppySignature, qg4CrestBookshelfFloppyPatch }, |
137 | | { true, 663, "fix crest bookshelf motion", 1, qg4CrestBookshelfMotionSignature, qg4CrestBookshelfMotionPatch }, |
138 | | { true, 663, "fix crest bookshelf motion (floppy)", 1, qg4CrestBookshelfMotionFloppySignature, qg4CrestBookshelfMotionFloppyPatch }, |
139 | | |
140 | | }}} |
| 22 | [https://github.com/scummvm/scummvm/pull/1382 Pull Request]: SCI32: Fix QFG4 crest bookshelf HAND interaction |