Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
software:vectors [2016/06/05 12:53]
ex_writer created
software:vectors [2016/06/12 09:55] (current)
ex_writer [X/Y Check Mask (VBXCHK, VBYCHK)]
Line 3: Line 3:
 Most game involve moving patterns. Most patterns move along a line. The Astrocade [[system ROM]] provides the vectoring routines to facilitate programming such pattern motion. Most game involve moving patterns. Most patterns move along a line. The Astrocade [[system ROM]] provides the vectoring routines to facilitate programming such pattern motion.
  
-The vectoring routines work with a memory array called a [[glossary#​v|vector]]. Represented within this vector are the coordinates of the object, the velocities of the object, and the status information necessary to control the object. By periodically invoking the vectoring routine, this data is updated and can be used to direct the motion of a pattern.+The vectoring routines work with a memory array called a [[:glossary#​v|vector]]. Represented within this vector are the coordinates of the object, the velocities of the object, and the status information necessary to control the object. By periodically invoking the vectoring routine, this data is updated and can be used to direct the motion of a pattern.
  
 ===== Vector Attributes ===== ===== Vector Attributes =====
Line 13: Line 13:
 Utilizing the vectoring routines involves a number of user responsibilities. The user must properly initialize certain fields in the vector block. They must increment the time base byte and periodically call the vectoring routine. Status bits must be checked and writing must be done. Utilizing the vectoring routines involves a number of user responsibilities. The user must properly initialize certain fields in the vector block. They must increment the time base byte and periodically call the vectoring routine. Status bits must be checked and writing must be done.
  
-To ensure high accuracy, coordinates and deltas are double-precision. The assumed binary "​decimal point" is between the [[glossary#​h|high-]] and [[glossary#​l|low-order]] byte.+To ensure high accuracy, coordinates and deltas are double-precision. The assumed binary "​decimal point" is between the [[:glossary#​h|high-]] and [[:glossary#​l|low-order]] byte.
  
 Vector blocks must be stored in RAM. Vector blocks must be stored in RAM.
Line 21: Line 21:
 The following diagrams illustrate the vector block'​s layout and the attendant user responsibilities:​ The following diagrams illustrate the vector block'​s layout and the attendant user responsibilities:​
  
-{{vector_block.png}}+{{:vector_block.png}}
 ==== Magic Register (VBMR) ==== ==== Magic Register (VBMR) ====
  
Line 44: Line 44:
 ==== Vector Status (VBSTAT) ==== ==== Vector Status (VBSTAT) ====
  
-{{vector_status.png}}+{{:vector_status.png}}
  
 ^ Bit ^ Name ^ Label ^ Description ^ ^ Bit ^ Name ^ Label ^ Description ^
Line 59: Line 59:
 ==== Delta X/Y (VBDXL, VBDXH, VBDYL, VBDYH) ==== ==== Delta X/Y (VBDXL, VBDXH, VBDYL, VBDYH) ====
  
-A delta is a value indicating a direction, or [[glossary#​v|vector]]. For example, placing 1 in the x-delta and 3 in the y-delta would make the pattern move down 3 pixels and right 1 pixel. Calling [[system routines:​screen handler#​vect|VECT]] will update the coordinates appropriately.+A delta is a value indicating a direction, or [[:glossary#​v|vector]]. For example, placing 1 in the x-delta and 3 in the y-delta would make the pattern move down 3 pixels and right 1 pixel. Calling [[system routines:​screen handler#​vect|VECT]] will update the coordinates appropriately.
  
 The Arcade allows for fractional deltas, i.e., finer movements, by using a second byte. VBDXH and VBDYH store the whole number values of the deltas, while VBDXL and VBDYL store the fractional halves. For example, to have your pattern move 1 pixel down every //four// calls, you would enter a y-delta of 0.25, or VBDYH = 0 and VBDYL = 25. The Arcade allows for fractional deltas, i.e., finer movements, by using a second byte. VBDXH and VBDYH store the whole number values of the deltas, while VBDXL and VBDYL store the fractional halves. For example, to have your pattern move 1 pixel down every //four// calls, you would enter a y-delta of 0.25, or VBDYH = 0 and VBDYL = 25.
Line 67: Line 67:
 ==== X/Y Check Mask (VBXCHK, VBYCHK) ==== ==== X/Y Check Mask (VBXCHK, VBYCHK) ====
  
-The check mask byte determines whether a limit (i.e., boundary) is attained and how to respond. ​The limit value is set in vector write routine ​(e.g., [[system routines:​screen handler#vect|VECT]]).+The check mask byte determines whether a limit (i.e., boundary) is attained and how to respond. ​Limit values are defined ​in the object'​s [[#limit table]] and passed to the object vectoring routines ​(i.e., [[system routines:​screen handler#​VECT]] or [[system routines:​screen handler#​VECTC]]).
  
-{{checks_mask.png}}+{{:checks_mask.png}}
  
-LIMIT CHECK | Set to one (1) to enable limit checking. | +^ Bit ^ Name ^ Label ^ Description ^ 
-REVERSE DELTA | Changes the sign of the delta when the limit is reached. This can be used to cause objects to '​bounce'​ off barriers. | +| 0 | Limit Check VBCLMT ​| Set to one (1) to enable limit checking. | 
-LIMIT ATTAINED ​| In contrast to the bounce effect, the system will set the limit attained flag and hold the pattern at the limit position until the user changes the delta. |+1 | Reverse Delta | VBCREV ​| Changes the sign of the delta when the limit is reached. This can be used to cause objects to '​bounce'​ off barriers. | 
 +3 | Limit Attained | VBCLAT ​| In contrast to the bounce effect, the system will set the limit attained flag and hold the pattern at the limit position until the user changes the delta. |
  
  
Line 79: Line 80:
 ==== Old Screen Address (VBOAL, VBOAH) ==== ==== Old Screen Address (VBOAL, VBOAH) ====
  
-VBOAL and VBOAH are maintained by the user, and are only necessary ​if [[system routines:​screen handler#vblank|VBLANK]] is used to erase your graphics. +VBOAL and VBOAH are maintained by the user if [[system routines:​screen handler#​VBLANK]] is being used to erase graphics. If so, you must take the absolute screen address calculated by [[system routines:​screen handler#​VWRITR]] and place it here.
- +
-If VBLANK is being used to erase graphics, you must take the absolute screen address calculated by [[system routines:​screen handler#vwritr|VWRITR]] and place it here.+
  
 +===== Limit Table =====
  
 +The Limit Table is a four-byte list indicating the boundaries of a vectored pattern:
  
 +^ Byte ^ Name ^ Description ^
 +| 1 | X lower limit | The leftmost boundary the pattern may reach |
 +| 2 | X upper limit | The rightmost boundary the pattern may reach |
 +| 3 | Y lower limit | The topmost boundary the pattern may reach |
 +| 4 | Y upper limit | The bottommost edge the pattern may reach |
  
 ---- ----
 **Reference:​** Lance F. Squire, ​ [[http://​www.ballyalley.com/​ml/​ml_docs/​vector%20tutorial/​BallyVectorTutorial_(Ver_1.03)(Lance_Squire).pdf|Bally/​Astrocade Vector Animation Tutorial]] [PDF]. **Reference:​** Lance F. Squire, ​ [[http://​www.ballyalley.com/​ml/​ml_docs/​vector%20tutorial/​BallyVectorTutorial_(Ver_1.03)(Lance_Squire).pdf|Bally/​Astrocade Vector Animation Tutorial]] [PDF].