SecondBASIC Documentation v3

Home / Command Reference / Enable

Enable

Description: Enables <Device>.

Syntax:

Enable <Device> [, <DeviceId>

Part Description
<Device> Required. The target device to enable.
<DeviceId> Required if <Device> is the External Interrupt.
<Device> Description
ExtInt Disables the external interrupt from the controller/expansion ports. The HV counter is no longer being latched, so you can read it at this point.

Other aliases for ExtInt are InterruptExternal and Interrupt External. These are for BEX compatibility.

You will need to specify the <DeviceId> in order for it to function properly. Valid <DeviceId> values are:

  • 0, Joypad Port 0 (Player 1)
  • 1, Joypad Port 1 (Player 2)
  • 2, Expansion Port on the first generation Genesis/Mega Drive consoles.
HBlank Disables the Horizontal Interrupt.

Other aliases for HBlank are InterruptHBlank and Interrupt HBlank. These are for BEX compatibility.

VBlank Disables the Vertical Interrupt.

Other aliases for VBlank are InterruptVBlank and Interrupt VBlank. These are for BEX compatibility.

Screen Disables the screen. Blanking signals are still sent to the TV and the only component drawn is the backdrop color. Horizontal and vertical interrupts are disabled, as are the status signals, so any status dependent routines will freeze, such as Sleep.
SRAM Disables SRAM Access. This is required if your ROM is over 2MB, otherwise the program may crash or cause undesirable effects.
Window Resets the Window plane.

Example:

    On VBlank Gosub MyVblank
    Enable VBlank
    End
 
MyVblank:
    Locate 1,1: Print a
    a++
    Return