Loading...
Searching...
No Matches
render.c File Reference
#include "render.h"
#include "piece.h"

Macros

#define BOARD_TO_MAP(r, c)   (((r) - 1) * 32 + (c) + 2)
 
#define BORDER_BL   (TILE_CORNER | PAL1 | VFLIP)
 
#define BORDER_BR   (TILE_CORNER | PAL1 | HFLIP | VFLIP)
 
#define BORDER_H_B   (TILE_BORDER_H | PAL1 | VFLIP)
 
#define BORDER_H_T   (TILE_BORDER_H | PAL1)
 
#define BORDER_TL   (TILE_CORNER | PAL1)
 
#define BORDER_TR   (TILE_CORNER | PAL1 | HFLIP)
 
#define BORDER_VL   (TILE_BORDER_V | PAL1)
 
#define BORDER_VR   (TILE_BORDER_V | PAL1 | HFLIP)
 
#define HFLIP   0x4000
 
#define MSG_ROW   13
 
#define NEXT_BOX_COL   16
 
#define NEXT_BOX_ROW   17
 
#define PAL1   0x0400 /* palette 1 (grey gradient) */
 
#define TILE_BORDER_H   9 /* horizontal bar */
 
#define TILE_BORDER_V   10 /* vertical bar */
 
#define TILE_CORNER   8 /* corner (base = TL) */
 
#define TILE_EMPTY   0
 
#define VFLIP   0x8000
 
#define VRAM_BG1_MAP   0x0000
 
#define VRAM_BG2_MAP   0x0800
 
#define VRAM_BG3_MAP   0x1000
 
#define VRAM_BG3_MSGROW   (VRAM_BG3_MAP + MSG_ROW * 32)
 
#define VRAM_TILES2   0x3000
 
#define VRAM_TILES4   0x2000
 

Functions

static void clearMsgRow (void)
 
static void clearTilemapBG1 (void)
 
static void clearTilemapBG2 (void)
 
static void drawPlayfieldBorder (void)
 
void renderBoard (void)
 
void renderClearNextPiece (void)
 
void renderEnableGradient (void)
 
void renderErasePiece (u8 type, u8 rot, s8 row, s8 col)
 
void renderFlush (void)
 
void renderInit (void)
 
void renderLineClearFlash (LineClearResult *result, u8 frame)
 
void renderNextPiece (u8 type)
 
void renderPiece (u8 type, u8 rot, s8 row, s8 col)
 
void renderSetMsgColor (u16 color)
 
void renderShake (s8 dx, s8 dy)
 

Variables

static u8 bg1_dirty_row [32]
 
u8 bg2_dirty
 
u8 bg3_dirty
 
u16 bg3_msgrow []
 
u8 border_pal []
 
u8 border_pal_end []
 
u8 font2bpp_gfx []
 
u8 font2bpp_gfx_end []
 
u8 green_pal []
 
u8 green_pal_end []
 
u8 hdma_grad_tbl []
 
static u16 msg_color
 
static u8 msg_color_dirty
 
u8 orange_pal []
 
u8 orange_pal_end []
 
u8 purple_pal []
 
u8 purple_pal_end []
 
u8 red_pal []
 
u8 red_pal_end []
 
u16 tilemap_bg1 []
 
u16 tilemap_bg2 []
 
u8 tiles_gfx []
 
u8 tiles_gfx_end []
 
u8 tiles_pal []
 
u8 tiles_pal_end []
 

Macro Definition Documentation

◆ BOARD_TO_MAP

#define BOARD_TO_MAP (   r,
  c 
)    (((r) - 1) * 32 + (c) + 2)

◆ BORDER_BL

#define BORDER_BL   (TILE_CORNER | PAL1 | VFLIP)

◆ BORDER_BR

#define BORDER_BR   (TILE_CORNER | PAL1 | HFLIP | VFLIP)

◆ BORDER_H_B

#define BORDER_H_B   (TILE_BORDER_H | PAL1 | VFLIP)

◆ BORDER_H_T

#define BORDER_H_T   (TILE_BORDER_H | PAL1)

◆ BORDER_TL

#define BORDER_TL   (TILE_CORNER | PAL1)

◆ BORDER_TR

#define BORDER_TR   (TILE_CORNER | PAL1 | HFLIP)

◆ BORDER_VL

#define BORDER_VL   (TILE_BORDER_V | PAL1)

◆ BORDER_VR

#define BORDER_VR   (TILE_BORDER_V | PAL1 | HFLIP)

◆ HFLIP

#define HFLIP   0x4000

◆ MSG_ROW

#define MSG_ROW   13

◆ NEXT_BOX_COL

#define NEXT_BOX_COL   16

◆ NEXT_BOX_ROW

#define NEXT_BOX_ROW   17

◆ PAL1

#define PAL1   0x0400 /* palette 1 (grey gradient) */

◆ TILE_BORDER_H

#define TILE_BORDER_H   9 /* horizontal bar */

◆ TILE_BORDER_V

#define TILE_BORDER_V   10 /* vertical bar */

◆ TILE_CORNER

#define TILE_CORNER   8 /* corner (base = TL) */

◆ TILE_EMPTY

#define TILE_EMPTY   0

◆ VFLIP

#define VFLIP   0x8000

◆ VRAM_BG1_MAP

#define VRAM_BG1_MAP   0x0000

◆ VRAM_BG2_MAP

#define VRAM_BG2_MAP   0x0800

◆ VRAM_BG3_MAP

#define VRAM_BG3_MAP   0x1000

◆ VRAM_BG3_MSGROW

#define VRAM_BG3_MSGROW   (VRAM_BG3_MAP + MSG_ROW * 32)

◆ VRAM_TILES2

#define VRAM_TILES2   0x3000

◆ VRAM_TILES4

#define VRAM_TILES4   0x2000

Function Documentation

◆ clearMsgRow()

static void clearMsgRow ( void  )
static

◆ clearTilemapBG1()

static void clearTilemapBG1 ( void  )
static

◆ clearTilemapBG2()

static void clearTilemapBG2 ( void  )
static

◆ drawPlayfieldBorder()

static void drawPlayfieldBorder ( void  )
static

◆ renderBoard()

void renderBoard ( void  )

◆ renderClearNextPiece()

void renderClearNextPiece ( void  )

◆ renderEnableGradient()

void renderEnableGradient ( void  )

◆ renderErasePiece()

void renderErasePiece ( u8  type,
u8  rot,
s8  row,
s8  col 
)

◆ renderFlush()

void renderFlush ( void  )

◆ renderInit()

void renderInit ( void  )

◆ renderLineClearFlash()

void renderLineClearFlash ( LineClearResult result,
u8  frame 
)

◆ renderNextPiece()

void renderNextPiece ( u8  type)

◆ renderPiece()

void renderPiece ( u8  type,
u8  rot,
s8  row,
s8  col 
)

◆ renderSetMsgColor()

void renderSetMsgColor ( u16  color)

◆ renderShake()

void renderShake ( s8  dx,
s8  dy 
)

Variable Documentation

◆ bg1_dirty_row

u8 bg1_dirty_row[32]
static

◆ bg2_dirty

u8 bg2_dirty

◆ bg3_dirty

u8 bg3_dirty

◆ bg3_msgrow

u16 bg3_msgrow[]
extern

◆ border_pal

u8 border_pal[]
extern

◆ border_pal_end

u8 border_pal_end[]

◆ font2bpp_gfx

u8 font2bpp_gfx[]
extern

◆ font2bpp_gfx_end

u8 font2bpp_gfx_end[]

◆ green_pal

u8 green_pal[]
extern

◆ green_pal_end

u8 green_pal_end[]

◆ hdma_grad_tbl

u8 hdma_grad_tbl[]
extern

◆ msg_color

u16 msg_color
static

◆ msg_color_dirty

u8 msg_color_dirty
static

◆ orange_pal

u8 orange_pal[]
extern

◆ orange_pal_end

u8 orange_pal_end[]

◆ purple_pal

u8 purple_pal[]
extern

◆ purple_pal_end

u8 purple_pal_end[]

◆ red_pal

u8 red_pal[]
extern

◆ red_pal_end

u8 red_pal_end[]

◆ tilemap_bg1

u16 tilemap_bg1[]
extern

◆ tilemap_bg2

u16 tilemap_bg2[]
extern

◆ tiles_gfx

u8 tiles_gfx[]
extern

◆ tiles_gfx_end

u8 tiles_gfx_end[]

◆ tiles_pal

u8 tiles_pal[]
extern

◆ tiles_pal_end

u8 tiles_pal_end[]