Get_Run_Idx ($F5DB)

These routines are responsible for generating the two index pairs which are required by the rest of the rotation routines. Each index pair is two bytes long, and has the following format:

The high byte is obtained by masking the anglewith 0x1F (this forces the angle to be between 0 and 180 degrees), and then using this value to index into the multiplier table.

The lower byte contains information about whether the angle lies along either the x or y axis, and whether the rise/run will be positive or negative.

0 => positive rise, not on an axis, or negative run, not on an axis.
0x80 => negative rise, not on an axis, or positive run, not on an axis.
1 => positive rise, on an axis, or negative run, on an axis.
0x81 => negative rise, on an axis, or positive run, on an axis.

 

ENTRY:

A-reg = the angle value

 

EXIT:

A-reg = slope?

B-reg = slope direction?

X-reg trashed

 

Source