unit b_system

System Tools

author: bocianu bocianu@gmail.com


Set of useful constants, registers and methods to simplify common system related tasks in Atari 8-bit programming.
This library is a part of 'blibs' - set of custom Mad-Pascal libraries.
https://gitlab.com/bocianu/blibs

Constants:

name:value:description:
PORTB_SELFTEST_OFF%10000000portb bit value to turn Self-Test off
PORTB_BASIC_OFF%00000010portb bit value to turn Basic off
PORTB_SYSTEM_ON%00000001portb bit value to turn System on

Interface:

name:description:
SystemOff

procedure SystemOff(port_b: byte); assembler; overload;


Turns off OS with custom PORTB($D301) value.
    parameters:
  • port_b - value of PORTB register
SystemOff

procedure SystemOff; overload;


Turns off OS and BASIC.
Gives maximum available RAM.
    SystemReset

    procedure SystemReset; overload;


    Turns on OS back and resets machine.
      EnableVBLI

      procedure EnableVBLI(vblptr: pointer); assembler;


      Enable and set custom handler for Vertical Blank Interrupt.

      To set vertical blank interrupt vector from your inline assembly code, use label __vblvec to store new routine address.

      Example:
        lda <myVblRoutine
        sta __vblvec
        lda >myVblRoutine
        sta __vblvec+1
        parameters:
      • vblptr - pointer to interrupt handler routine
      DisableVBLI

      procedure DisableVBLI; assembler;


      Disables custom routine of Vertical Blank Interrupt.
        EnableDLI

        procedure EnableDLI(dliptr: pointer); assembler;


        Enable and set custom handler for Display List Interrupt.

        To set display list interrupt vector from your inline assembly code, use label __dlivec to store new routine address.

        Example:
          lda <myDliRoutine
          sta __dlivec
          lda >myDliRoutine
          sta __dlivec+1
          parameters:
        • dliptr - pointer to interrupt handler routine
        DisableDLI

        procedure DisableDLI; assembler;


        Disables Display List Interrupts.
          EnableIRQ

          procedure EnableIRQ; assembler;


          Enables IRQ Interrupts.
            DisableIRQ

            procedure DisableIRQ; assembler;


            Disables IRQ Interrupts.
              SetIRQ

              procedure SetIRQ(irqptr:pointer); assembler;


              Set IRQ Interrupt Vector.
                WaitFrame

                procedure WaitFrame; assembler;


                Waits till drawing of current frame ends.
                  WaitFrames

                  procedure WaitFrames(frames: byte);


                  Waits for a specified number of frames.
                  Each frame is 1/50 sec for PAL systems, or 1/60 sec for NTSC.
                    parameters:
                  • frames - number of frames to wait.
                  SetCharset

                  procedure SetCharset(msb: byte);


                  Sets font charset located at specified page of memory.
                    parameters:
                  • msb - most significant byte of charset address (memory page number).