Commits

Hirundo  committed 1c67de0

Fix: Sprite layout register code contained an unsorted iteration over dictionary keys, resulting in possible regression failures.

  • Participants
  • Parent commits dcbee63
  • Branches 0.2

Comments (0)

Files changed (3)

File nml/actions/action2layout.py

         return self.params[name]['register']
 
     def get_all_registers(self):
-        return [self.get_register(name) for name in self.params if self.get_register(name) is not None]
+        return [self.get_register(name) for name in sorted(self.params) if self.get_register(name) is not None]
 
     def create_register(self, name, value):
         if isinstance(value, expression.StorageOp) and value.name == "LOAD_TEMP" and isinstance(value.register, expression.ConstantNumeric):

File regression/expected/026_asl.grf

Binary file modified.

File regression/expected/026_asl.nfo

 // Name: layout2 - feature 0F
 7 * 37 02 0F FE \b66 \dx00000000 \wx0000 
 \dx80000000 \wx0002 \b0 \b0 \b0 \b16 \b16 \b16 80 
-\dx80000000 \wx0003 \b0 \b0 \b0 \b16 \b16 \b16 82 81 
+\dx80000000 \wx0003 \b0 \b0 \b0 \b16 \b16 \b16 81 82 
 
 // Name: layout2@registers - feature 0F
 8 * 66 02 0F FE 89 
 43 20 \dx000000FF 
 \2sto 1A 20 \dx00000080 
-\2r 1A 20 \dx00000001 
-\2sto 1A 20 \dx00000081 
 \2r 62 00 29 \dx00000001 
 \2^ 1A 20 \dx00000001 
+\2sto 1A 20 \dx00000081 
+\2r 1A 20 \dx00000001 
 \2sto 1A 00 \dx00000082 
 \b1 
 \wx00FE \dx00000000 \dx00000000 
 // Name: layout2 - feature 11
 13 * 37 02 11 FD \b66 \dx00000000 \wx0000 
 \dx80000000 \wx0002 \b0 \b0 \b0 \b16 \b16 \b16 80 
-\dx80000000 \wx0003 \b0 \b0 \b0 \b16 \b16 \b16 82 81 
+\dx80000000 \wx0003 \b0 \b0 \b0 \b16 \b16 \b16 81 82 
 
 // Name: layout2@registers - feature 11
 14 * 66 02 11 FD 89 
 44 20 \dx000000FF 
 \2sto 1A 20 \dx00000080 
-\2r 1A 20 \dx00000001 
-\2sto 1A 20 \dx00000081 
 \2r 60 00 29 \dx00000001 
 \2^ 1A 20 \dx00000001 
+\2sto 1A 20 \dx00000081 
+\2r 1A 20 \dx00000001 
 \2sto 1A 00 \dx00000082 
 \b1 
 \wx00FD \dx00000000 \dx00000000