Unofficial documentation for the Videl Inside 2 screen enhancer on Atari Falcon 030 v 0.1 - 2003/01/31 0. Disclaimer This document describes the Videl Inside cookie. This is an unofficial document. The originals authors have nothing in common with this document, except the involved product. This document describes the Videl Inside cookie as the author understands it. While every effort has been made to ensure that the contents of this document are accurate, the author does not guarantee that any portion of this document is actually correct. In addition, the author cannot be held responsible the consequences of the any use or misuse of the information contained in this document. 1. Introduction Videl Inside is a screen enhancer for Atari Falcon 030 computers. It can use standard Videl (Atari Falcon video chip) clocks of 25 MHz, 32 MHz and external clock to generate video modes. When run from the AUTO folder, the vi2.prg installs a new cookie, plus some new vectors to setup enhanced video modes. 2. The cookie Its name is 'VI-2', and is a pointer in memory to the following structure. typedef struct { unsigned short version; unsigned short length; unsigned short dummy; vi_mode_t vi2infmode; void (*setmode)(vi_mode_t *newmode); } vi_cookie_t; 'version' is the version of Videl Inside (0x0204 for 2.04). 'vi2infmode' is the mode loaded from vi2.inf file, for the current monitor. 'setmode' is a pointer to a function to setup a video mode. 3. The video modes file, \vi2.dat, the header This file contains all defined video modes. It has an header, followed by video modes definitions. typedef struct { unsigned char name[8]; /* "DATFILE\0" */ unsigned short version; /* 0x0103 */ unsigned short freqh_mini; /* Freq limits for a multisync monitor */ unsigned short freqh_maxi; /* The freqh stored are divided by 100 */ unsigned short freqv_mini; /* The freqv stored are multiplied by 10 */ unsigned short freqv_maxi; unsigned short multisync; /* Multisync monitor ? */ unsigned short num_modes; unsigned short intfreq1; /* 25 MHz as default */ unsigned short intfreq2; /* 32 MHz as default */ unsigned short extfreq; } vi_header_t; So you have an ident value (field 'name', followed by its version (0x0103) for version 1.03. Then you find frequencies limits for a multisync monitor, and the associated flag (0=no, 1=yes) telling if these values are defined or not. Note: here and in the video mode structure, the horizontal frequency is divided by 100, and the vertical frequency is multiplied by 10. You then have the number of video modes defined in the file, and the videl clock frequencies for the video modes (these are divided by 100000: i.e. you have 250 for 25MHz). 4. The video modes file, \vi2.dat, the video modes Following the header, you will find vi_header_t->num_modes structures of this type: typedef struct { unsigned short modecode; /* Video mode definition */ unsigned short freqh_div; /* Horizontal frequency divisor */ unsigned short width; /* Horizontal resolution */ unsigned short dummy2; unsigned short freqv_div; /* Vertical frequency divisor */ unsigned short height; /* Vertical resolution */ unsigned short dummy3[19]; } vi_mode_t; 'modecode' is defined as follows: bit 1: interlaced mode 0=no, 1=yes bits 3,2: videl clock predivisor 0=divide by 4 1=divide by 2 2=divide by 1 bits 6,5,4: bits per pixel 0=1 bpp 1=2 bpp 2=3 bpp 3=4 bpp 4=16 bpp bits 8,7: videl clock 0=internal 1 1=internal 2 2=external bits 11,10,9: index value for 0xffff8266 register 'width' and 'height' are the resolution of the video modes. 'freq[v|h]_div' are used to calculate the horizontal and vertical frequency of the video mode, given the videl clock used. - Example for a standard VGA mode: hfreq_div=512, vfreq_div=520 bits 3-2 (predivisor)=01 and bits 8-7 (clock)=01 videlclock = internal2*100000 = 32 MHz hfreq=videlclock/(hfreq_div<<(2-prediv))= 31250 Hz vfreq=hfreq/vfreq_div = 60 Hz 4. The info file, \vi2.inf This file just has the video mode to select when entering GEM mode. It holds place for 3 modes: monochrome, tv/rgb and vga. typedef struct { unsigned char name[8]; /* "VI2.INF\0" */ unsigned short dummy; viinfo_mode_t videomode[3]; } viinfo_t; The 3 video modes are stored with this structure: typedef struct { unsigned short dummy; unsigned short mask; unsigned short videomode; unsigned short width; unsigned short height; unsigned short values[8]; unsigned char name[36]; } viinfo_mode_t; 'num_mode' is the number of the video mode in the vi2.dat file. 'mask' is 0x019f, a mask for the current Vsetmode(-1). 'videomode' is the nearest Falcon videomode code, to ease setup the video mode. 'values' are fields needed to setup the video mode. 'name' is the name of the video mode. 000a: 0008 000c: 019f ; video mode mask 000e: 010a ; Nearest Falcon video mode 0010: 0280 ; 640 = width 0012: 01f0 ; 496 = height 0014: 0032 ; 50 0016: 0032 ; 50 0018: 0026 ; 38 001a: 0320 ; 800 001c: 0280 ; 640 001e: 00a4 ; 164 0020: 0111 ; 273 0022: 01f0 ; 496 0024: 0015 ; 21 0026: name of video mode 5. Get current video mode - TODO - 6. Setting a video mode - TODO - -- Patrice Mandin http://membres.lycos.fr/pmandin/