Skip to content

Commit eb981cb

Browse files
committed
Feature: Dynamically apply the limit for ActionD params
1 parent 6817087 commit eb981cb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

nml/actions/action6.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from nml import free_number_list, generic
1717
from nml.actions import base_action
1818

19-
free_parameters = free_number_list.FreeNumberList(list(range(0x40, 0x80)), "No free parameters available to use for internal computations.", "No unique free parameters available for internal computations.")
19+
free_parameters = free_number_list.FreeNumberList(list(range(0, 0x80)), "No free parameters available to use for internal computations.", "No unique free parameters available for internal computations.")
2020

2121
def print_stats():
2222
"""

nml/ast/grf.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
with NML; if not, write to the Free Software Foundation, Inc.,
1414
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA."""
1515

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
1818
from nml.ast import base_statement
1919

2020
palette_node = None
@@ -25,7 +25,7 @@
2525
The 1st field is the largest parameter register used.
2626
The 2nd field is the maximum amount of parameter registers available. This is where L{action6.free_parameters} begins.
2727
"""
28-
param_stats = [0, 0x40]
28+
param_stats = [0, 0x80]
2929

3030
def print_stats():
3131
"""
@@ -132,6 +132,8 @@ def pre_process(self):
132132
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)
133133
if param_num > param_stats[0]:
134134
param_stats[0] = param_num
135+
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.")
136+
135137

136138
def debug_print(self, indentation):
137139
generic.print_dbg(indentation, 'GRF')

0 commit comments

Comments
 (0)