Tightened up the code with better label and pointer handling.
This commit is contained in:
parent
788c6ed60d
commit
b27cadc740
1 changed files with 13 additions and 27 deletions
40
carddeck.c65
40
carddeck.c65
|
|
@ -151,7 +151,6 @@ FEND
|
|||
// Validate entire deck across all piles
|
||||
// Returns: 0=OK, 1=duplicate, 2=missing
|
||||
FUNC validate_deck(out:{BYTE result})
|
||||
WORD ptr @ $98
|
||||
WORD seen_ptr @ $fc
|
||||
BYTE pile_result
|
||||
BYTE i
|
||||
|
|
@ -163,95 +162,82 @@ FUNC validate_deck(out:{BYTE result})
|
|||
result = VALIDATE_OK
|
||||
|
||||
// Check stock
|
||||
POINTER ptr -> pile_stock
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_stock, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
// Check waste
|
||||
POINTER ptr -> pile_waste
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_waste, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
// Check tableau piles
|
||||
POINTER ptr -> pile_tab0
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_tab0, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
POINTER ptr -> pile_tab1
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_tab1, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
POINTER ptr -> pile_tab2
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_tab2, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
POINTER ptr -> pile_tab3
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_tab3, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
POINTER ptr -> pile_tab4
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_tab4, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
POINTER ptr -> pile_tab5
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_tab5, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
POINTER ptr -> pile_tab6
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_tab6, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
// Check foundation piles
|
||||
POINTER ptr -> pile_found0
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_found0, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
POINTER ptr -> pile_found1
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_found1, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
POINTER ptr -> pile_found2
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_found2, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
POINTER ptr -> pile_found3
|
||||
validate_pile(ptr, pile_result)
|
||||
validate_pile(@pile_found3, pile_result)
|
||||
IF pile_result
|
||||
result = pile_result
|
||||
EXIT
|
||||
|
|
|
|||
Loading…
Reference in a new issue