liberis
Enumerations | Functions
tetsu.h File Reference

Controls the NEW Iron Guanyin (Tetsu kannon) chip (Video Controller) More...

#include <eris/types.h>

Go to the source code of this file.

Enumerations

enum  tetsu_lines { TETSU_LINES_263 = 0, TETSU_LINES_262 = 1, TETSU_LINES_INTERLACED = 2, TETSU_LINES_UNKNOWN = 3 }
 Number of vertical lines to display. More...
enum  tetsu_dotclock { TETSU_DOTCLOCK_5MHz = 0, TETUS_DOTCLOCK_7MHz = 1 }
 Dot clock. Determines screen width. More...
enum  tetsu_colordepth { TETSU_COLORS_16 = 0, TETSU_COLORS_256 = 1 }
 Amount of colors (to display?). More...
enum  tetsu_coeff { TETSU_NO_COEFF = 0, TETSU_COEFF_1 = 1, TETSU_COEFF_2 = 2, TETSU_COEFF_3 = 3 }
 Which coefficient to use for cellophane. More...

Functions

void eris_tetsu_init ()
 Initialize the NEW Iron Guanyin.
void eris_tetsu_set_video_mode (tetsu_lines lines, int ext_sync, tetsu_dotclock dotclock, tetsu_colordepth bg_depth, tetsu_colordepth spr_depth, int bg7up_show, int spr7up_show, int bg0_disp, int bg1_disp, int bg2_disp, int bg3_disp, int rainbow_disp)
 Setup the video mode.
void eris_tetsu_set_palette (u16 pal_entry, u16 color)
 Set a palette entry.
void eris_tetsu_set_7up_palette (u8 bg7up, u8 spr7up)
 Which palette to use for the 7up chips.
void eris_tetsu_set_king_palette (u8 bg0, u8 bg1, u8 bg2, u8 bg3)
 Which palette to use for the KING backgrounds.
void eris_tetsu_set_rainbow_palette (u8 rainbow)
 Which palette to use for RAIBOW.
void eris_tetsu_set_priorities (u8 bg7up, u8 spr7up, u8 bg0, u8 bg1, u8 bg2, u8 bg3, u8 rainbow)
 Set layer priorities.
void eris_tetsu_set_chroma_key (u8 maxy, u8 miny, u8 maxu, u8 minu, u8 maxv, u8 minv)
 Set chroma color key values.
int eris_tetsu_get_raster (void)
 Get the current raster.
int eris_tetsu_get_field (void)
 Check which field is being displayed for interlaced mode.
int eris_tetsu_is_displaying (void)
 Checks if we are currently displaying (not in H or V blank)
void eris_tetsu_set_cellophane_color (u16 color)
 Sets the constant color for the cellophane.
void eris_tetsu_set_cellophane_sprites (int *banks)
 Sets cellophane activity on sprites.
void eris_tetsu_set_cellophane_control (int enable, int in_front, tetsu_coeff bg7up, tetsu_coeff spr7up, tetsu_coeff bg0, tetsu_coeff bg1, tetsu_coeff bg2, tetsu_coeff bg3, tetsu_coeff rainbow)
 Set cellophane control.
void eris_tetsu_set_cellophane_coeffs (int coeff, u8 ay, u8 au, u8 av, u8 by, u8 bu, u8 bv)
 Set a cellophane coefficient.

Detailed Description

Controls the NEW Iron Guanyin (Tetsu kannon) chip (Video Controller)


Enumeration Type Documentation

Which coefficient to use for cellophane.

Enumerator:
TETSU_NO_COEFF 

No coefficient (no cellophane).

TETSU_COEFF_1 

Coefficient 1

TETSU_COEFF_2 

Coefficient 2

TETSU_COEFF_3 

Coefficient 3

Amount of colors (to display?).

Enumerator:
TETSU_COLORS_16 

16 colors

TETSU_COLORS_256 

256 colors

Dot clock. Determines screen width.

Enumerator:
TETSU_DOTCLOCK_5MHz 

~5MHz dot clock. 256px wide.

TETUS_DOTCLOCK_7MHz 

~7MHz dot clock. 320px wide.

Number of vertical lines to display.

Enumerator:
TETSU_LINES_263 

263 lines. A little flickery, but less cross-talk.

TETSU_LINES_262 

262 lines. No flicker, but lots of cross-talk.

TETSU_LINES_INTERLACED 

Interlaced. Very flickery.

TETSU_LINES_UNKNOWN 

Interlaced + 1/2dot shift?. Flickery^2


Function Documentation

int eris_tetsu_get_field ( void  )

Check which field is being displayed for interlaced mode.

Returns:
1 if displaying odd field, 0 for even field.
int eris_tetsu_get_raster ( void  )

Get the current raster.

Returns:
Current raster.
int eris_tetsu_is_displaying ( void  )

Checks if we are currently displaying (not in H or V blank)

Returns:
1 if we are displaying, 0 for in blank.
void eris_tetsu_set_7up_palette ( u8  bg7up,
u8  spr7up 
)

Which palette to use for the 7up chips.

Palettes are actually indexes into the palette which is the first color to the chip. For example, if bg7up was 4, then the 4th palette entry would be color 0, 5th would be 1, etc.

Parameters:
bg7upWhich palette to use for 7up backgrounds.
spr7upWhich palette to use for 7up sprites.
void eris_tetsu_set_cellophane_coeffs ( int  coeff,
u8  ay,
u8  au,
u8  av,
u8  by,
u8  bu,
u8  bv 
)

Set a cellophane coefficient.

For coefficient information, see hardware documentation.

Parameters:
coeffWhich coefficient to set the information for. (1 ~ 3)
ayY component of the A coefficient.
auU component of the A coefficient.
avV component of the A coefficient.
byY component of the B coefficient.
buU component of the B coefficient.
bvV component of the B coefficient.
void eris_tetsu_set_cellophane_color ( u16  color)

Sets the constant color for the cellophane.

This color is either the color of the cellophane (in the case of it being in front) or the color of the background (in the case of it being in back).

Parameters:
colorColor in Y8U4V4 format.
void eris_tetsu_set_cellophane_control ( int  enable,
int  in_front,
tetsu_coeff  bg7up,
tetsu_coeff  spr7up,
tetsu_coeff  bg0,
tetsu_coeff  bg1,
tetsu_coeff  bg2,
tetsu_coeff  bg3,
tetsu_coeff  rainbow 
)

Set cellophane control.

Parameters:
enableWhether the cellophane is being used or not.
in_frontWhether the cellophane is the constant color, or the active surfaces. If 1, it is the constant color.
bg7upWhich coefficient to use for 7up backgrounds.
spr7upWhich coefficient to use for 7up sprites.
bg0Which coefficient to use for KING BG0.
bg1Which coefficient to use for KING BG1.
bg2Which coefficient to use for KING BG2.
bg3Which coefficient to use for KING BG3.
rainbowWhich coefficient to use for RAINBOW output.
void eris_tetsu_set_cellophane_sprites ( int *  banks)

Sets cellophane activity on sprites.

Parameters:
banksA 16-element array of 1s or 0s that contains whether that color palette bank receives cellophane treatment.
void eris_tetsu_set_chroma_key ( u8  maxy,
u8  miny,
u8  maxu,
u8  minu,
u8  maxv,
u8  minv 
)

Set chroma color key values.

Disable each colorkey by setting the minimum higher than the maximum.

Parameters:
maxyMaximum Y.
minyMinimum Y.
maxuMaximum U.
minuMinimum U.
maxvMaximum V.
minvMinimum V.
void eris_tetsu_set_king_palette ( u8  bg0,
u8  bg1,
u8  bg2,
u8  bg3 
)

Which palette to use for the KING backgrounds.

Palettes are actually indexes into the palette which is the first color to the chip. For example, if bg0 was 4, then the 4th palette entry would be color 0, 5th would be 1, etc.

Parameters:
bg0Which palette to use for KING background 0.
bg1Which palette to use for KING background 1.
bg2Which palette to use for KING background 2.
bg3Which palette to use for KING background 3.
void eris_tetsu_set_palette ( u16  pal_entry,
u16  color 
)

Set a palette entry.

Parameters:
pal_entryWhich palette entry to set the color of.
colorThe color to set. In Y8U4V4 format.
void eris_tetsu_set_priorities ( u8  bg7up,
u8  spr7up,
u8  bg0,
u8  bg1,
u8  bg2,
u8  bg3,
u8  rainbow 
)

Set layer priorities.

Parameters:
bg7upPriority for the 7up backgrounds. (0 ~ 7)
spr7upPriority for the 7up sprites. (0 ~ 7)
bg0Priority for KING BG0. (0 ~ 7)
bg1Priority for KING BG1. (0 ~ 7)
bg2Priority for KING BG2. (0 ~ 7)
bg3Priority for KING BG3. (0 ~ 7)
rainbowPriority for RAINBOW. (0 ~ 7)
void eris_tetsu_set_rainbow_palette ( u8  rainbow)

Which palette to use for RAIBOW.

Palettes are actually indexes into the palette which is the first color to the chip. For example, if raibow was 4, then the 4th palette entry would be color 0, 5th would be 1, etc.

Parameters:
rainbowWhich palette to use for RAIBOW.
void eris_tetsu_set_video_mode ( tetsu_lines  lines,
int  ext_sync,
tetsu_dotclock  dotclock,
tetsu_colordepth  bg_depth,
tetsu_colordepth  spr_depth,
int  bg7up_show,
int  spr7up_show,
int  bg0_disp,
int  bg1_disp,
int  bg2_disp,
int  bg3_disp,
int  rainbow_disp 
)

Setup the video mode.

Parameters:
linesVertical line mode.
ext_syncWhether to use external sync.
dotclockThe dotclock to run at.
bg_depthColor depth of 7up backgrounds.
spr_depthColor depth of 7up sprites.
bg7up_showWhether 7up backgrounds are displayed.
spr7up_showWhether 7up sprites are displayed.
bg0_dispWhether KING BG0 is displayed.
bg1_dispWhether KING BG1 is displayed.
bg2_dispWhether KING BG2 is displayed.
bg3_dispWhether KING BG3 is displayed.
rainbow_dispWhether the RAINBOW output is displayed.
 All Files Functions Typedefs Enumerations Enumerator Defines