|
13 | 13 | with NML; if not, write to the Free Software Foundation, Inc., |
14 | 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.""" |
15 | 15 |
|
16 | | -from nml import expression, generic, grfstrings, global_constants |
17 | | -from nml.actions import action8, action14 |
| 16 | +from nml import expression, free_number_list, generic, grfstrings, global_constants |
| 17 | +from nml.actions import action6, action8, action14 |
18 | 18 | from nml.ast import base_statement |
19 | 19 |
|
20 | 20 | palette_node = None |
|
23 | 23 | """ |
24 | 24 | Statistics about registers used for parameters. |
25 | 25 | The 1st field is the largest parameter register used. |
26 | | -The 2nd field is the maximum amount of parameter registers available. This is where L{action6.free_parameters} begins. |
| 26 | +The 2nd field is the maximum amount of parameter registers available. |
| 27 | +After preprocessing the GRF block, the limit for L{action6.free_parameters} is set to |
| 28 | +the number of reserved params. |
27 | 29 | """ |
28 | | -param_stats = [0, 0x40] |
| 30 | +param_stats = [0, 0x80] |
29 | 31 |
|
30 | 32 | def print_stats(): |
31 | 33 | """ |
@@ -132,6 +134,8 @@ def pre_process(self): |
132 | 134 | raise generic.ScriptError("No free parameters available. Consider assigning <num> manually and combine multiple bool parameters into a single bitmask parameter using <bit>.", self.pos) |
133 | 135 | if param_num > param_stats[0]: |
134 | 136 | param_stats[0] = param_num |
| 137 | + action6.free_parameters = free_number_list.FreeNumberList(list(range(param_stats[0], 0x80)), "No free parameters available to use for internal computations.", "No unique free parameters available for internal computations.") |
| 138 | + |
135 | 139 |
|
136 | 140 | def debug_print(self, indentation): |
137 | 141 | generic.print_dbg(indentation, 'GRF') |
|
0 commit comments