Video Functions

List of functions that affect or control video.

cls( void );
cls( unsigned int tile );

Clear the entire screen.

Without parameters the screen is filled with a space character otherwise it's filled with the bat-value given as the argument.


disp_on( void );

Enable display output.


disp_off( void );

Blank/Turn off the display output.


vsync( void );
vsync( unsigned char count );

Synchronize the program to the video Vertical Blanking Signal (VBL), which is around 1/60th of a second.

Without parameters this function returns as soon as a VBL signal has been received, else your program will be synchronized to the number of frames you requested. So for example to run your game at 20fps, just use vsync(3) at the end of your game loop.


set_256x224( void );

Sets the screen to 32 characters wide and 28 characters tall.


set_screen_size( unsigned char value );

Change the virtual screen size. By default the startup code initializes a virtual screen of 64 characters wide and 32 character tall, but other values are possible, namely : 32x32, 128x32, 32x64, 64x64, or 128x64. The larger the virtual screen is the less video memory you will have for your graphics (font, tiles, sprites).


set_xres( unsigned int x_pixels, unsigned char blur_flag );

Change the horizontal resolution to 'x_pixels' (in pixels). This changes the video controller's registers to display more pixels on the screen; it does not affect any virtual calculations.

'blur_flag' indicates what kind of smoothing will be used: XRES_SHARP or XRES_SOFT (default).

Note: The 5MHz dot clock will be used up to a horizontal resolutions of 268 pixels. The 7MHz dot clock will be used up to 356 pixels and the 10MHz dot clock will be used beyond this. The maximum visible resolution seems to be around 512 pixels.


vram_addr( unsigned char bat_x, unsigned char bat_y ); 

get_vram( unsigned int address ); 

put_vram( unsigned int address, unsigned int data ); 

peek( unsigned int addr );
peekw( unsigned int addr );

Read the contents of memory location 'addr'. peek() is char-sized access, whereas peekw() is word-sized.


peek( unsigned int addr );
peekw( unsigned int addr );

Read the contents of memory location 'addr'. peek() is char-sized access, whereas peekw() is word-sized.

Last updated