Pursuing Tom Ram

Game available in Itch.io.

Soruce code in Github.

Programming adventures in VIC-20.


How to add a new verb

Add the first two characters (or one character and a $0), to verb vector. Remember that order matter.

  
SINGLE_VERB=11

; N,S,E,W,I (49), Look (4c), SLeep (53 4c), SEarch ($53, $45),   
verb_tokens     BYTE $4e, $0, $53, $0, $45, $0, $57, $0, $49, $0, $4C, $0, $53, $4c, $53, $45
                ; EHe (45 48), DIe (44 49)
                BYTE $45, $48, $44, $49 
                ; TAke, EXamine, REad (52 45), PUt (50 55), SHoot (53 48), OPen(4f 50)
                BYTE $54, $41, $45, $58, $52, $45, $50, $55, $53, $48, $4f, $50
                ; EAt (45, 41)
                BYTE $45, $41
                BYTE $0  

verb_pointers   WORD  Move_CMD, Move_CMD, Move_CMD, Move_CMD, Inventory_CMD, Look_CMD, Sleep_CMD, Search_CMD
                WORD  Ehe_CMD, SR_You_Die
                WORD  Take_CMD, Examine_CMD, Read_CMD, Put_CMD, Shoot_CMD, Open_CMD
                WORD  Eat_CMD

  

If verb does not need a name, you have to add it in the first middle of the vector. Then, you have to increase the constraint too. In other case, you can add it at the end of the vector and constant remains the same.

Then you have to write a subroutine for the verb. Start the subroutine with a label (something like New_Verb_CMD) and end it with a rts.

After that, add the label to the vector “verb_pointers”. Bear in mind that the order of this vector has to be the same order than verbs in “ver_tokens”

If you have problems adding a new verb, let me know.