Tightened up the code with better label and pointer handling.

This commit is contained in:
Mattias Hansson 2026-01-12 13:48:28 +01:00
parent 788c6ed60d
commit b27cadc740

View file

@ -151,7 +151,6 @@ FEND
// Validate entire deck across all piles // Validate entire deck across all piles
// Returns: 0=OK, 1=duplicate, 2=missing // Returns: 0=OK, 1=duplicate, 2=missing
FUNC validate_deck(out:{BYTE result}) FUNC validate_deck(out:{BYTE result})
WORD ptr @ $98
WORD seen_ptr @ $fc WORD seen_ptr @ $fc
BYTE pile_result BYTE pile_result
BYTE i BYTE i
@ -163,95 +162,82 @@ FUNC validate_deck(out:{BYTE result})
result = VALIDATE_OK result = VALIDATE_OK
// Check stock // Check stock
POINTER ptr -> pile_stock validate_pile(@pile_stock, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT
ENDIF ENDIF
// Check waste // Check waste
POINTER ptr -> pile_waste validate_pile(@pile_waste, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT
ENDIF ENDIF
// Check tableau piles // Check tableau piles
POINTER ptr -> pile_tab0 validate_pile(@pile_tab0, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT
ENDIF ENDIF
POINTER ptr -> pile_tab1 validate_pile(@pile_tab1, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT
ENDIF ENDIF
POINTER ptr -> pile_tab2 validate_pile(@pile_tab2, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT
ENDIF ENDIF
POINTER ptr -> pile_tab3 validate_pile(@pile_tab3, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT
ENDIF ENDIF
POINTER ptr -> pile_tab4 validate_pile(@pile_tab4, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT
ENDIF ENDIF
POINTER ptr -> pile_tab5 validate_pile(@pile_tab5, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT
ENDIF ENDIF
POINTER ptr -> pile_tab6 validate_pile(@pile_tab6, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT
ENDIF ENDIF
// Check foundation piles // Check foundation piles
POINTER ptr -> pile_found0 validate_pile(@pile_found0, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT
ENDIF ENDIF
POINTER ptr -> pile_found1 validate_pile(@pile_found1, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT
ENDIF ENDIF
POINTER ptr -> pile_found2 validate_pile(@pile_found2, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT
ENDIF ENDIF
POINTER ptr -> pile_found3 validate_pile(@pile_found3, pile_result)
validate_pile(ptr, pile_result)
IF pile_result IF pile_result
result = pile_result result = pile_result
EXIT EXIT