unit b_dl

Display List manipulation library.

author: bocianu bocianu@gmail.com


Set of useful constants and methods, to customize display lists for the Atari 8-bit.
This library is a part of 'blibs' - set of custom Mad-Pascal libraries.
https://gitlab.com/bocianu/blibs

Constants:

name:value:description:
DL_BLANK101 blank line
DL_BLANK2%000100002 blank lines
DL_BLANK3%001000003 blank lines
DL_BLANK4%001100004 blank lines
DL_BLANK5%010000005 blank lines
DL_BLANK6%010100006 blank lines
DL_BLANK7%011000007 blank lines
DL_BLANK8%011100008 blank lines
DL_DLI%10000000Order to run DLI
DL_LMS%01000000Order to set new memory address
DL_VSCROLL%00100000Turn on vertical scroll on this line
DL_HSCROLL%00010000Turn on horizontal scroll on this line
DL_MODE_40x24T22Antic Modes
DL_MODE_40x24T54
DL_MODE_40x12T55
DL_MODE_20x24T56
DL_MODE_20x12T57
DL_MODE_40x24G48
DL_MODE_80x48G29
DL_MODE_80x48G4$A
DL_MODE_160x96G2$B
DL_MODE_160x192G2$C
DL_MODE_160x96G4$D
DL_MODE_160x192G4$E
DL_MODE_320x192G2$F
DL_JMP%00000001Order to jump
DL_JVB%01000001Jump to begining

Global Variables:

name:type:description:
DL_addresswordcontains memory of Display List
DL_cursorbytecontains position of modification cursor

Interface:

name:description:
DL_Init

procedure DL_Init(address:word);


Initializes new empty Display List at desired address. Sets DL_cursor at 0.
    parameters:
  • address - Display List memory address
DL_Push

procedure DL_Push(value:byte);overload;


Pushes single byte value into Display List at DL_cursor position. Moves cursor one byte forward.
Use it to set with mode lines and blanks.
    parameters:
  • value - Display List element to push
DL_Push

procedure DL_Push(value, count:byte);overload;


Pushes multple bytes with single value into Display List at DL_cursor position. Moves cursor to position of first byte after added values.
Use it to set multiple mode lines and blanks.
    parameters:
  • value - value of byte to push
  • count - number of bytes to push
DL_Push

procedure DL_Push(address: word);overload;


Pushes address value into Display List at DL_cursor position. Moves cursor two bytes forward.
    parameters:
  • address - (word) address to push
DL_Push

procedure DL_Push(value: byte; address: word);overload;


Pushes byte value and address value into Display List at DL_cursor position. Moves cursor three bytes forward.
Use with DL_LMS and jump orders.
    parameters:
  • value - Display List order to push
  • address - address to push
DL_Start

procedure DL_Start;


Order ANTIC to use currently defined Display List.
    DL_Attach

    function DL_Attach:word;


    Attaches to current (system) Display List. Sets modification pointer at 0, so next DL_Push overwrites first byte of Display List.
      returns:
    • (word) - memory address of current Display List
    DL_Seek

    function DL_Seek(offset:byte):byte;


    Moves DL_cursor to desired position, and returns byte value stored at this offset.
      parameters:
    • offset - new DL_cursor position
    • returns:
    • (byte) - byte at cursor
    DL_SeekW

    function DL_SeekW(offset:byte):word;


    Moves DL_cursor to desired position, and returns word value stored at this offset.
      parameters:
    • offset - new DL_cursor position
    • returns:
    • (word) - word at cursor
    DL_Find

    function DL_Find(val: byte):byte;


    Tries to find desired value in Display List starting from DL_cursor. It checks only first 255 bytes of DL. Returns offset of first found element, or $ff (255) if not found.
      parameters:
    • val - value to find
    • returns:
    • (byte) - offset of found element (or 255 if not found)
    DL_Poke

    procedure DL_Poke(offset: byte; val: byte);


    Moves DL_cursor to desired position, and puts a byte value at this offset.
      parameters:
    • offset - new DL_cursor position
    • val - value to poke
    DL_PokeW

    procedure DL_PokeW(offset: byte; val: word);


    Moves DL_cursor to desired position, and puts a word value at this offset.
      parameters:
    • offset - new DL_cursor position
    • val - value to poke