KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
pvr_rtt_sized.cc File Reference
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <dc/maple.h>
#include <dc/maple/controller.h>
#include <dc/pvr.h>
#include <dcplib/fnt.h>

Macros

#define SMALL_RTT_SIZE   128
 
#define SMALL_RTT_W   SMALL_RTT_SIZE
 
#define SMALL_RTT_H   SMALL_RTT_SIZE
 
#define SMALL_RTT_STRIDE_PX   SMALL_RTT_W
 
#define RGB565_BYTES   2
 
#define OLD_RTT_BYTES   (1024 * 512 * RGB565_BYTES)
 
#define RTT_MODE_COUNT   ((int)(sizeof(rtt_modes) / sizeof(rtt_modes[0])))
 

Functions

static float clampf (float value, float min, float max)
 
static const rtt_mode_t * current_rtt_mode (void)
 
static uint32_t current_rtt_bytes (void)
 
static uint32_t rtt_mode_bytes (const rtt_mode_t *mode)
 
static void clamp_marker_to_rtt (void)
 
static int alloc_rtt_texture (void)
 
static void change_rtt_mode (int direction)
 
static void submit_colored_rect (float x, float y, float w, float h, float z, uint32_t argb)
 
static void submit_textured_rect (float x, float y, float w, float h, float z, float u1, float v1)
 
static void update_motion (void)
 
static void render_rtt_scene (void)
 
static void draw_status_text (void)
 
static void render_screen_scene (void)
 
static void poll_controls (void)
 
int main (int argc, char **argv)
 

Variables

static const rtt_mode_t rtt_modes []
 
static pvr_ptr_t rtt_texture
 
static fntRenderer * text
 
static fntTexFont * font
 
static int rtt_mode_index = 1
 
static float marker_x = 8.0f
 
static float marker_y = 18.0f
 
static float marker_dx = 1.0f
 
static float marker_dy = 1.5f
 
static bool exit_requested
 
static uint32_t last_buttons
 
static pvr_init_params_t pvr_params
 

Macro Definition Documentation

◆ OLD_RTT_BYTES

#define OLD_RTT_BYTES   (1024 * 512 * RGB565_BYTES)

Referenced by main().

◆ RGB565_BYTES

#define RGB565_BYTES   2

◆ RTT_MODE_COUNT

#define RTT_MODE_COUNT   ((int)(sizeof(rtt_modes) / sizeof(rtt_modes[0])))

Referenced by change_rtt_mode(), and main().

◆ SMALL_RTT_H

#define SMALL_RTT_H   SMALL_RTT_SIZE

◆ SMALL_RTT_SIZE

#define SMALL_RTT_SIZE   128

◆ SMALL_RTT_STRIDE_PX

#define SMALL_RTT_STRIDE_PX   SMALL_RTT_W

◆ SMALL_RTT_W

#define SMALL_RTT_W   SMALL_RTT_SIZE

Function Documentation

◆ alloc_rtt_texture()

static int alloc_rtt_texture ( void )
static

◆ change_rtt_mode()

static void change_rtt_mode ( int direction)
static

◆ clamp_marker_to_rtt()

static void clamp_marker_to_rtt ( void )
static

◆ clampf()

static float clampf ( float value,
float min,
float max )
static

◆ current_rtt_bytes()

static uint32_t current_rtt_bytes ( void )
static

◆ current_rtt_mode()

static const rtt_mode_t * current_rtt_mode ( void )
static

◆ draw_status_text()

static void draw_status_text ( void )
static

◆ main()

◆ poll_controls()

◆ render_rtt_scene()

◆ render_screen_scene()

◆ rtt_mode_bytes()

static uint32_t rtt_mode_bytes ( const rtt_mode_t * mode)
static

References mode, and RGB565_BYTES.

Referenced by main().

◆ submit_colored_rect()

static void submit_colored_rect ( float x,
float y,
float w,
float h,
float z,
uint32_t argb )
static

◆ submit_textured_rect()

static void submit_textured_rect ( float x,
float y,
float w,
float h,
float z,
float u1,
float v1 )
static

◆ update_motion()

static void update_motion ( void )
static

Variable Documentation

◆ exit_requested

bool exit_requested
static

◆ font

fntTexFont* font
static

Referenced by draw_status_text(), and main().

◆ last_buttons

uint32_t last_buttons
static

Referenced by main(), and poll_controls().

◆ marker_dx

float marker_dx = 1.0f
static

Referenced by update_motion().

◆ marker_dy

float marker_dy = 1.5f
static

Referenced by update_motion().

◆ marker_x

float marker_x = 8.0f
static

◆ marker_y

float marker_y = 18.0f
static

◆ pvr_params

pvr_init_params_t pvr_params
static
Initial value:
= {
256 * 1024, 0, 0, 0, 0, 0
}
#define PVR_BINSIZE_16
16-word (64-byte) length
Definition pvr.h:648
#define PVR_BINSIZE_0
0-length (disables the list)
Definition pvr.h:646

Referenced by main().

◆ rtt_mode_index

int rtt_mode_index = 1
static

◆ rtt_modes

const rtt_mode_t rtt_modes[]
static
Initial value:
= {
{ 64, 64, 64 },
{ 128, 64, 128 }
}
#define SMALL_RTT_W
Definition pvr_rtt_sized.cc:43
#define SMALL_RTT_STRIDE_PX
Definition pvr_rtt_sized.cc:51
#define SMALL_RTT_H
Definition pvr_rtt_sized.cc:47

Referenced by current_rtt_mode(), and main().

◆ rtt_texture

◆ text

fntRenderer* text
static

Referenced by main().