Skip to content

Commit

Permalink
Feature: Dynamically apply the limit for ActionD params
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddi-z committed May 20, 2020
1 parent 6817087 commit eb981cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nml/actions/action6.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from nml import free_number_list, generic
from nml.actions import base_action

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.")
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.")

def print_stats():
"""
Expand Down
8 changes: 5 additions & 3 deletions nml/ast/grf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
with NML; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA."""

from nml import expression, generic, grfstrings, global_constants
from nml.actions import action8, action14
from nml import expression, free_number_list, generic, grfstrings, global_constants
from nml.actions import action6, action8, action14
from nml.ast import base_statement

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

def print_stats():
"""
Expand Down Expand Up @@ -132,6 +132,8 @@ def pre_process(self):
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)
if param_num > param_stats[0]:
param_stats[0] = param_num
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.")


def debug_print(self, indentation):
generic.print_dbg(indentation, 'GRF')
Expand Down

0 comments on commit eb981cb

Please sign in to comment.