Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
screen_write_routines [2016/05/23 14:47]
ex_writer [Standard Calling Sequence]
— (current)
Line 1: Line 1:
-====== Screen Write Routines ====== 
  
-Virtually every videogame involves the manipulation of animated figures. These figures are composed of patterns that are arbitrary pixel arrays. The Bally Arcade'​s write routines are used to transfer such patterns to the screen. 
- 
-Five hierarchical levels of write routine calls are supported. The levels differ in the amount of preprocessing required by the user before calling. The highest level assumes that most of the parameters reside in a standard data structure, while the lowest level presumes that all arguments are in registers with all attendant transformations (such as relative-to-absolute conversion) already accomplished. The five levels are: 
- 
-^ Level ^ System Routine ^ Function ^ 
-| 1 | [[screen handler#​vwritr|VWRITR]] | Write Relative from a Vector | 
-| 2 | [[screen handler#​writr|WRITR]] | Write Relative | 
-| 3 | [[screen handler#​writp|WRITP]] | Write with Variable Pattern Size | 
-| 4 | [[screen handler#​writ|WRIT]] | Write Pattern | 
-| 5 | [[screen handler#​writa|WRITA]] | Write Absolute | 
- 
-===== Pattern Transformations ===== 
- 
-Two pattern transformations may be performed prior to writing: FLOP and EXPAND. FLOP mirrors the pattern on the x-axis. EXPAND translates a 1-bit per pixel pattern into a 2-bit per pixel pattern. Since many patterns are only two-color, this allows for more efficient pattern storage. FLOP and EXPAND may be used simultaneously. 
- 
-===== Writing Modes ===== 
- 
-Three Writing Modes may be used: PLOP, OR, and XOR. PLOP is a conventional store into RAM. The OR option ORs the data bit-by-bit with the data that was already present. Similarly, if XOR is set, the pattern is XORed with the data '​beneath'​ it. Use of OR or XOR takes slightly longer, since a read before write is necessary. 
- 
-Note that ROTATE is not supported in software due to space considerations. 
- 
-===== Standard Calling Sequence ===== 
- 
-Every write routine uses a subset of the following register/​argument assignments:​ 
- 
-^ Register ^ Argument ^ Note ^ 
-| A | [[Magic Register]] | | 
-| B | Y Pattern Size | # Vertical Bytes (i.e., 8 vertical pixels = 8 bytes) | 
-| C | X Pattern Size | # Horizontal Bytes (i.e., 8 horizontal pixels = 1 byte) | 
-| D | Y-Coordinate | 0–101 | 
-| E | X-Coordinate | 0–159 | 
-| HL | Pattern Address | | 
-| IX | Vector Address | | 
- 
-===== Pattern Representation ===== 
- 
-The higher the level of the write routine, the more ancillary information is stored with the pattern. The following diagram shows what each level expects. Any bytes of a lower address than the pointer for a given level need not be specified. 
- 
-**Use Restrictions:​** None of the write routines are [[glossary#​r|reentrant]] due to [[Magic Register]]/​Expander clobber. 
- 
-{{pattern_representation.png}}