cpct_setVideoMode

Sets the video mode of the CPC Screen, changing resolution and palette size.

C Definition

void cpct_setVideoMode (u8 videoMode)

Assembly call (Input parameters on registers)

call cpct_setVideoMode_asm

Input Parameters (1 Byte)

(1B C) videoMode[0-3] Video mode to set

Parameter Restrictions

  • videomode must be < 3, otherwise unexpected results may happen.  Namely, ROM/RAM pagination and Interrupt Status may get altered, typically yielding erratic behaviour and/or crashes.

Requirements

This function requires the CPC firmware to be DISABLED.  Otherwise, it may not work, as firmware tends to restore video mode to its own selection.

Details

This function changes the video mode for the Amstrad CPC into one of the 4 standard modes available.  This 4 standard video modes are:

Mode | Resolution | # of colours
-----|------------|-------------------
 0   |  160x200   |   16
 1   |  320x200   |    4
 2   |  640x200   |    2
 3   |  160x200   |    4 (undocumented)

The way this function works is by sending a SET_VIDEO_MODE command directly to the Gate Array (GA), through the 0x7F port.  The 2 least significant bits from the byte sent to the GA contain the desired videomode.

Destroyed Register values

AF, BC, HL

Required memory

C-bindings14 bytes
ASM-bindings13 bytes

Time Measures

Case       | microSecs | CPU Cycles |
-------------------------------------
Any        |    80     |     20     |
-------------------------------------
Asm saving |    -4     |     -1     |
-------------------------------------

Credits

This function was coded copying and modifying cpc_setMode from cpcrslib by Raul Simarro.

Sets the video mode of the CPC Screen, changing resolution and palette size.
unsigned char (u8 = unsigned 8-bits, 1 byte )
Close