added video files (shamlessly stolen from EmuTOS)
This commit is contained in:
122
include/screen.h
Normal file
122
include/screen.h
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* screen.h - low-level screen routines
|
||||
*
|
||||
* Copyright (c) 2001-2013 The EmuTOS development team
|
||||
*
|
||||
* Authors:
|
||||
* LVL Laurent Vogel
|
||||
* THH Thomas Huth
|
||||
*
|
||||
* This file is distributed under the GPL, version 2 or at your
|
||||
* option any later version. See doc/license.txt for details.
|
||||
*/
|
||||
|
||||
#ifndef SCREEN_H
|
||||
#define SCREEN_H
|
||||
|
||||
#define ST_VRAM_SIZE 32000UL
|
||||
#define TT_VRAM_SIZE 153600UL
|
||||
#define FALCON_VRAM_SIZE 307200UL
|
||||
|
||||
#define VIDEOBASE_ADDR_HI 0xffff8201L
|
||||
#define VIDEOBASE_ADDR_MID 0xffff8203L
|
||||
#define VIDEOBASE_ADDR_LOW 0xffff820dL
|
||||
|
||||
#define SYNCMODE 0xffff820aL
|
||||
|
||||
#define ST_SHIFTER 0xffff8260L
|
||||
#define TT_SHIFTER 0xffff8262L
|
||||
#define SPSHIFT 0xffff8266L
|
||||
|
||||
#define TT_SHIFTER_BITMASK 0x970f /* valid bits in TT_SHIFTER */
|
||||
|
||||
#define ST_PALETTE_REGS 0xffff8240L
|
||||
#define FALCON_PALETTE_REGS 0xffff9800L
|
||||
|
||||
#define TT_PALETTE_BITMASK 0x0fff /* valid bits in TT_PALETTE_REGS */
|
||||
|
||||
/* misc routines */
|
||||
int16_t check_moderez(int16_t moderez);
|
||||
void initialise_palette_registers(int16_t rez,int16_t mode);
|
||||
|
||||
/* hardware dependant xbios routines */
|
||||
|
||||
int16_t esetshift(int16_t mode);
|
||||
int16_t egetshift(void);
|
||||
int16_t esetbank(int16_t bank);
|
||||
int16_t esetcolor(int16_t index,int16_t color);
|
||||
void esetpalette(int16_t index,int16_t count,int16_t *rgb);
|
||||
void egetpalette(int16_t index,int16_t count,int16_t *rgb);
|
||||
int16_t esetgray(int16_t mode);
|
||||
int16_t esetsmear(int16_t mode);
|
||||
|
||||
/* pallette color definitions */
|
||||
|
||||
#define RGB_BLACK 0x0000 /* ST(e) palette */
|
||||
#define RGB_BLUE 0x000f
|
||||
#define RGB_GREEN 0x00f0
|
||||
#define RGB_CYAN 0x00ff
|
||||
#define RGB_RED 0x0f00
|
||||
#define RGB_MAGENTA 0x0f0f
|
||||
#define RGB_LTGRAY 0x0555
|
||||
#define RGB_GRAY 0x0333
|
||||
#define RGB_LTBLUE 0x033f
|
||||
#define RGB_LTGREEN 0x03f3
|
||||
#define RGB_LTCYAN 0x03ff
|
||||
#define RGB_LTRED 0x0f33
|
||||
#define RGB_LTMAGENTA 0x0f3f
|
||||
#define RGB_YELLOW 0x0ff0
|
||||
#define RGB_LTYELLOW 0x0ff3
|
||||
#define RGB_WHITE 0x0fff
|
||||
|
||||
#define TTRGB_BLACK 0x0000 /* TT Palette */
|
||||
#define TTRGB_BLUE 0x000f
|
||||
#define TTRGB_GREEN 0x00f0
|
||||
#define TTRGB_CYAN 0x00ff
|
||||
#define TTRGB_RED 0x0f00
|
||||
#define TTRGB_MAGENTA 0x0f0f
|
||||
#define TTRGB_LTGRAY 0x0aaa
|
||||
#define TTRGB_GRAY 0x0666
|
||||
#define TTRGB_LTBLUE 0x099f
|
||||
#define TTRGB_LTGREEN 0x09f9
|
||||
#define TTRGB_LTCYAN 0x09ff
|
||||
#define TTRGB_LTRED 0x0f99
|
||||
#define TTRGB_LTMAGENTA 0x0f9f
|
||||
#define TTRGB_YELLOW 0x0ff0
|
||||
#define TTRGB_LTYELLOW 0x0ff9
|
||||
#define TTRGB_WHITE 0x0fff
|
||||
|
||||
/* TT resolutions */
|
||||
#define TT_HIGH 6
|
||||
#define TT_MEDIUM 4
|
||||
#define TT_LOW 7
|
||||
|
||||
/* ST(e) resolutions */
|
||||
#define ST_HIGH 2
|
||||
#define ST_MEDIUM 1
|
||||
#define ST_LOW 0
|
||||
|
||||
/* monitor types (from VgetMonitor()) */
|
||||
#define MON_MONO 0 /* ST monochrome */
|
||||
#define MON_COLOR 1 /* ST colour */
|
||||
#define MON_VGA 2 /* VGA */
|
||||
#define MON_TV 3 /* TV via RF modulator */
|
||||
|
||||
/* determine monitor type, ... */
|
||||
void screen_init(void);
|
||||
void set_rez_hacked(void);
|
||||
int rez_changeable(void);
|
||||
int16_t get_monitor_type(void);
|
||||
void screen_get_current_mode_info(uint16_t *planes, uint16_t *hz_rez, uint16_t *vt_rez);
|
||||
|
||||
/* hardware independant xbios routines */
|
||||
|
||||
int32_t physbase(void);
|
||||
int32_t logbase(void);
|
||||
int16_t getrez(void);
|
||||
void setscreen(int32_t logLoc, int32_t physLoc, int16_t rez, int16_t videlmode);
|
||||
void setpalette(int32_t palettePtr);
|
||||
int16_t setcolor(int16_t colorNum, int16_t color);
|
||||
void vsync(void);
|
||||
|
||||
#endif /* SCREEN_H */
|
||||
98
include/videl.h
Normal file
98
include/videl.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* screen.h - low-level screen routines
|
||||
*
|
||||
* Copyright (c) 2013 The EmuTOS development team
|
||||
*
|
||||
* Authors:
|
||||
* PES Petr Stehlik
|
||||
* RFB Roger Burrows
|
||||
*
|
||||
* This file is distributed under the GPL, version 2 or at your
|
||||
* option any later version. See doc/license.txt for details.
|
||||
*/
|
||||
|
||||
#ifndef VIDEL_H
|
||||
#define VIDEL_H
|
||||
|
||||
#define SPSHIFT 0xffff8266L
|
||||
|
||||
#define FRGB_BLACK 0x00000000 /* Falcon palette */
|
||||
#define FRGB_BLUE 0x000000ff
|
||||
#define FRGB_GREEN 0x00ff0000
|
||||
#define FRGB_CYAN 0x00ff00ff
|
||||
#define FRGB_RED 0xff000000
|
||||
#define FRGB_MAGENTA 0xff0000ff
|
||||
#define FRGB_LTGRAY 0xbbbb00bb
|
||||
#define FRGB_GRAY 0x88880088
|
||||
#define FRGB_LTBLUE 0x000000aa
|
||||
#define FRGB_LTGREEN 0x00aa0000
|
||||
#define FRGB_LTCYAN 0x00aa00aa
|
||||
#define FRGB_LTRED 0xaa000000
|
||||
#define FRGB_LTMAGENTA 0xaa0000aa
|
||||
#define FRGB_YELLOW 0xffff0000
|
||||
#define FRGB_LTYELLOW 0xaaaa0000
|
||||
#define FRGB_WHITE 0xffff00ff
|
||||
|
||||
/* bit settings for Falcon videomodes */
|
||||
#define VIDEL_VALID 0x01ff /* the only bits allowed in a videomode */
|
||||
#define VIDEL_VERTICAL 0x0100 /* if set, use interlace (TV), double line (VGA) */
|
||||
#define VIDEL_COMPAT 0x0080 /* ST-compatible if set */
|
||||
#define VIDEL_OVERSCAN 0x0040 /* overscan if set (not used with VGA) */
|
||||
#define VIDEL_PAL 0x0020 /* PAL if set; otherwise NTSC */
|
||||
#define VIDEL_VGA 0x0010 /* VGA if set; otherwise TV */
|
||||
#define VIDEL_80COL 0x0008 /* 80-column mode if set; otherwise 40 */
|
||||
#define VIDEL_BPPMASK 0x0007 /* mask for bits/pixel encoding */
|
||||
#define VIDEL_1BPP 0 /* 2 colours */
|
||||
#define VIDEL_2BPP 1 /* 4 colours */
|
||||
#define VIDEL_4BPP 2 /* 16 colours */
|
||||
#define VIDEL_8BPP 3 /* 256 colours */
|
||||
#define VIDEL_TRUECOLOR 4 /* 65536 colours */
|
||||
|
||||
/* test for VDI support of videomode */
|
||||
#define VALID_VDI_BPP(mode) ((mode&VIDEL_BPPMASK)<=VIDEL_8BPP)
|
||||
|
||||
/* selected Falcon videomodes */
|
||||
#define FALCON_ST_HIGH (VIDEL_COMPAT|VIDEL_VGA|VIDEL_80COL|VIDEL_1BPP)
|
||||
|
||||
#define FALCON_DEFAULT_BOOT (VIDEL_VERTICAL|VIDEL_80COL|VIDEL_8BPP) /* 640x480x256 colours, TV, NTSC */
|
||||
|
||||
#define FALCON_REZ 3 /* used as a Falcon indicator */
|
||||
|
||||
typedef struct {
|
||||
int16_t vmode; /* video mode (-1 => end marker) */
|
||||
int16_t monitor; /* applicable monitors */
|
||||
uint16_t hht; /* H hold timer */
|
||||
uint16_t hbb; /* H border begin */
|
||||
uint16_t hbe; /* H border end */
|
||||
uint16_t hdb; /* H display begin */
|
||||
uint16_t hde; /* H display end */
|
||||
uint16_t hss; /* H SS */
|
||||
uint16_t vft; /* V freq timer */
|
||||
uint16_t vbb; /* V border begin */
|
||||
uint16_t vbe; /* V border end */
|
||||
uint16_t vdb; /* V display begin */
|
||||
uint16_t vde; /* V display end */
|
||||
uint16_t vss; /* V SS */
|
||||
} VMODE_ENTRY;
|
||||
|
||||
void initialise_falcon_palette(int16_t mode);
|
||||
const VMODE_ENTRY *lookup_videl_mode(int16_t mode,int16_t monitor);
|
||||
|
||||
/* Public XBIOS functions */
|
||||
int16_t vsetmode(int16_t mode);
|
||||
int16_t vmontype(void);
|
||||
int16_t vsetsync(int16_t external);
|
||||
int32_t vgetsize(int16_t mode);
|
||||
int16_t vsetrgb(int16_t index,int16_t count,int32_t *rgb);
|
||||
int16_t vgetrgb(int16_t index,int16_t count,int32_t *rgb);
|
||||
|
||||
/* misc routines */
|
||||
int16_t get_videl_mode(void);
|
||||
int16_t vfixmode(int16_t mode);
|
||||
int16_t videl_check_moderez(int16_t moderez);
|
||||
uint32_t videl_vram_size(void);
|
||||
void videl_get_current_mode_info(uint16_t *planes, uint16_t *hz_rez, uint16_t *vt_rez);
|
||||
|
||||
extern int16_t current_video_mode;
|
||||
|
||||
#endif /* VIDEL_H */
|
||||
9
include/video.h
Normal file
9
include/video.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef _VIDEO_H_
|
||||
#define _VIDEO_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "bas_printf.h"
|
||||
|
||||
#endif /* _VIDEO_H_ */
|
||||
Reference in New Issue
Block a user