Skip to content

Commit

Permalink
Cap quantity at inventory limit.
Browse files Browse the repository at this point in the history
TODO: make sure item is entered before quantity.
  • Loading branch information
rahulg committed Apr 15, 2012
1 parent 5ec177f commit d47359a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions timer.asm
Expand Up @@ -127,6 +127,7 @@ UPDATE_CASH_DISPLAY PROC FAR
UPDATE_CASH_DISPLAY_LOOP:

MOV AX, DS:DISPLAY_PASS

XOR DX, DX
DIV CX

Expand Down Expand Up @@ -854,6 +855,12 @@ M_TXN_IDLE:
TEST AH, AH
JNZ M_TXN_QTYBOOM

; Hard cap at inventory limit
XOR BH, BH
MOV BL, DS:TXN_ITEM
CMP AL, DS:ITEM_INVENTORY[BX]
JA M_TXN_QTYBOOM

ADD AL, BL

MOV DS:TXN_QTY, AL
Expand Down

0 comments on commit d47359a

Please sign in to comment.