Second entry.. adding to the commands

As I dig in, it appears that some more commands are in line. There are many functions that have to make decisions, such as "if( (one==1) && (two==2) && (three==3) ) then light(five) else light (seven).
Since the threads commands to not allow one to write direct code, the plan is to implement a very simple processor in each thread. Each thread will have features such as an accumulator and flags such as zero, carry, overflow, and such. Then, one would do something like this..
THCMD_LINE_TAG, TEST_X3
; Test this players' multiplier value and set light X3 if needed..
THCMD_LOAD_ACC, PLAYER_DATA_BONUS_MULTIPLIER
THCMD_SUBTRACT_#, 3
THCMD_GOTO_IFGE (greater or equal to), LIGHT_X3
THCMD_SET_LAMP_OFF, BONUS_X3
THCMD_GOTO_LINE, TEST_X4
THCMD_LINE_TAG, LIGHT_X3
THCMD_SET_LAMP_ON, BONUS_X3
THCMD_LINE_TAG, TEST_X4

As you can see, it does resemble assembly a lot. The good news is that when you start with an existing game rule set, you will be able to see how it works, and cut and paste some changes.
So there will be commands to load values, perform simple math or logic on them, and make jumps based on the results. In the same vein, there will also be commands to perform logic on individual bit states.
The rub to writing this is the effort of converting flags such as C, Z, and V, to decisions such as GE, GT, EQ, NE, LT, and LE. I believe I have the plan worked out, and half written. Next task is to test it in a thread. I will write a thread to decide if all 6 targets have been made, and clear them if so (relies on logic IF's), and a thread that lights the bonus lights based on the player's bonus earned (relies on arithmetic IF's).

I will let you know the results!
Chris~

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments
  • No comments exist for this post.
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.