RetroArch
Classes | Macros | Typedefs | Functions | Variables
psp1_gfx.c File Reference
#include <pspkernel.h>
#include <pspdisplay.h>
#include <malloc.h>
#include <pspgu.h>
#include <pspgum.h>
#include <psprtc.h>
#include <retro_assert.h>
#include <retro_inline.h>
#include <retro_math.h>
#include "../font_driver.h"
#include "../../defines/psp_defines.h"
Include dependency graph for psp1_gfx.c:

Classes

struct  psp1_menu_frame
 
struct  psp1_video
 

Macros

#define SCEGU_SCR_WIDTH   480
 
#define SCEGU_SCR_HEIGHT   272
 
#define SCEGU_VRAM_WIDTH   512
 
#define SCEGU_VRAM_TOP   (0x44000000)
 
#define SCEGU_VRAM_BUFSIZE   (SCEGU_VRAM_WIDTH*SCEGU_SCR_HEIGHT*2)
 
#define SCEGU_VRAM_BP_0   ((void *)(SCEGU_VRAM_TOP))
 
#define SCEGU_VRAM_BP_1   ((void *)(SCEGU_VRAM_TOP+SCEGU_VRAM_BUFSIZE))
 
#define SCEGU_VRAM_BP_2   ((void *)(SCEGU_VRAM_TOP+(SCEGU_VRAM_BUFSIZE*2)))
 
#define SCEGU_VRAM_BUFSIZE32   (SCEGU_VRAM_WIDTH*SCEGU_SCR_HEIGHT*4)
 
#define SCEGU_VRAM_BP32_0   ((void *)(SCEGU_VRAM_TOP))
 
#define SCEGU_VRAM_BP32_1   ((void *)(SCEGU_VRAM_TOP+SCEGU_VRAM_BUFSIZE32))
 
#define SCEGU_VRAM_BP32_2   ((void *)(SCEGU_VRAM_TOP+(SCEGU_VRAM_BUFSIZE32*2)))
 
#define TO_UNCACHED_PTR(ptr)   ((void *)((uint32_t)(ptr)|0x40000000))
 
#define TO_CACHED_PTR(ptr)   ((void *)((uint32_t)(ptr)&~0x40000000))
 
#define FROM_GU_POINTER(ptr)   ((void *)((uint32_t)(ptr)|0x44000000))
 
#define TO_GU_POINTER(ptr)   ((void *)((uint32_t)(ptr)&~0x44000000))
 
#define PSP_FRAME_ROWS_COUNT   4
 
#define PSP_FRAME_COLUMNS_COUNT   16
 
#define PSP_FRAME_SLICE_COUNT   (PSP_FRAME_ROWS_COUNT * PSP_FRAME_COLUMNS_COUNT)
 
#define PSP_FRAME_VERTEX_COUNT   (PSP_FRAME_SLICE_COUNT * 2)
 

Typedefs

typedef struct psp1_menu_frame psp1_menu_frame_t
 
typedef struct psp1_video psp1_video_t
 

Functions

struct __attribute__ ((packed))
 
static INLINE void psp_set_screen_coords (psp1_sprite_t *framecoords, int x, int y, int width, int height, unsigned rotation)
 
static INLINE void psp_set_tex_coords (psp1_sprite_t *framecoords, int width, int height)
 
static void psp_update_viewport (psp1_video_t *psp, video_frame_info_t *video_info)
 
static void psp_on_vblank (u32 sub, psp1_video_t *psp)
 
static voidpsp_init (const video_info_t *video, const input_driver_t **input, void **input_data)
 
static bool psp_frame (void *data, const void *frame, unsigned width, unsigned height, uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t *video_info)
 
static void psp_set_nonblock_state (void *data, bool toggle)
 
static bool psp_alive (void *data)
 
static bool psp_focus (void *data)
 
static bool psp_suppress_screensaver (void *data, bool enable)
 
static void psp_free (void *data)
 
static void psp_set_texture_frame (void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
 
static void psp_set_texture_enable (void *data, bool state, bool full_screen)
 
static void psp_set_rotation (void *data, unsigned rotation)
 
static void psp_set_filtering (void *data, unsigned index, bool smooth)
 
static void psp_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
 
static void psp_apply_state_changes (void *data)
 
static void psp_viewport_info (void *data, struct video_viewport *vp)
 
static void psp_get_poke_interface (void *data, const video_poke_interface_t **iface)
 
static bool psp_read_viewport (void *data, uint8_t *buffer, bool is_idle)
 
static bool psp_set_shader (void *data, enum rarch_shader_type type, const char *path)
 

Variables

 psp1_vertex_t
 
 psp1_sprite_t
 
static const video_poke_interface_t psp_poke_interface
 
video_driver_t video_psp1
 

Macro Definition Documentation

◆ FROM_GU_POINTER

#define FROM_GU_POINTER (   ptr)    ((void *)((uint32_t)(ptr)|0x44000000))

◆ PSP_FRAME_COLUMNS_COUNT

#define PSP_FRAME_COLUMNS_COUNT   16

◆ PSP_FRAME_ROWS_COUNT

#define PSP_FRAME_ROWS_COUNT   4

◆ PSP_FRAME_SLICE_COUNT

#define PSP_FRAME_SLICE_COUNT   (PSP_FRAME_ROWS_COUNT * PSP_FRAME_COLUMNS_COUNT)

◆ PSP_FRAME_VERTEX_COUNT

#define PSP_FRAME_VERTEX_COUNT   (PSP_FRAME_SLICE_COUNT * 2)

◆ SCEGU_SCR_HEIGHT

#define SCEGU_SCR_HEIGHT   272

◆ SCEGU_SCR_WIDTH

#define SCEGU_SCR_WIDTH   480

◆ SCEGU_VRAM_BP32_0

#define SCEGU_VRAM_BP32_0   ((void *)(SCEGU_VRAM_TOP))

◆ SCEGU_VRAM_BP32_1

#define SCEGU_VRAM_BP32_1   ((void *)(SCEGU_VRAM_TOP+SCEGU_VRAM_BUFSIZE32))

◆ SCEGU_VRAM_BP32_2

#define SCEGU_VRAM_BP32_2   ((void *)(SCEGU_VRAM_TOP+(SCEGU_VRAM_BUFSIZE32*2)))

◆ SCEGU_VRAM_BP_0

#define SCEGU_VRAM_BP_0   ((void *)(SCEGU_VRAM_TOP))

◆ SCEGU_VRAM_BP_1

#define SCEGU_VRAM_BP_1   ((void *)(SCEGU_VRAM_TOP+SCEGU_VRAM_BUFSIZE))

◆ SCEGU_VRAM_BP_2

#define SCEGU_VRAM_BP_2   ((void *)(SCEGU_VRAM_TOP+(SCEGU_VRAM_BUFSIZE*2)))

◆ SCEGU_VRAM_BUFSIZE

#define SCEGU_VRAM_BUFSIZE   (SCEGU_VRAM_WIDTH*SCEGU_SCR_HEIGHT*2)

◆ SCEGU_VRAM_BUFSIZE32

#define SCEGU_VRAM_BUFSIZE32   (SCEGU_VRAM_WIDTH*SCEGU_SCR_HEIGHT*4)

◆ SCEGU_VRAM_TOP

#define SCEGU_VRAM_TOP   (0x44000000)

◆ SCEGU_VRAM_WIDTH

#define SCEGU_VRAM_WIDTH   512

◆ TO_CACHED_PTR

#define TO_CACHED_PTR (   ptr)    ((void *)((uint32_t)(ptr)&~0x40000000))

◆ TO_GU_POINTER

#define TO_GU_POINTER (   ptr)    ((void *)((uint32_t)(ptr)&~0x44000000))

◆ TO_UNCACHED_PTR

#define TO_UNCACHED_PTR (   ptr)    ((void *)((uint32_t)(ptr)|0x40000000))

Typedef Documentation

◆ psp1_menu_frame_t

◆ psp1_video_t

typedef struct psp1_video psp1_video_t

Function Documentation

◆ __attribute__()

struct __attribute__ ( (packed )

◆ psp_alive()

static bool psp_alive ( void data)
static
Here is the call graph for this function:

◆ psp_apply_state_changes()

static void psp_apply_state_changes ( void data)
static

◆ psp_focus()

static bool psp_focus ( void data)
static
Here is the call graph for this function:

◆ psp_frame()

static bool psp_frame ( void data,
const void frame,
unsigned  width,
unsigned  height,
uint64_t  frame_count,
unsigned  pitch,
const char *  msg,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:

◆ psp_free()

static void psp_free ( void data)
static
Here is the call graph for this function:

◆ psp_get_poke_interface()

static void psp_get_poke_interface ( void data,
const video_poke_interface_t **  iface 
)
static
Here is the call graph for this function:

◆ psp_init()

static void* psp_init ( const video_info_t video,
const input_driver_t **  input,
void **  input_data 
)
static
Here is the call graph for this function:

◆ psp_on_vblank()

static void psp_on_vblank ( u32  sub,
psp1_video_t psp 
)
static
Here is the caller graph for this function:

◆ psp_read_viewport()

static bool psp_read_viewport ( void data,
uint8_t buffer,
bool  is_idle 
)
static
Here is the call graph for this function:

◆ psp_set_aspect_ratio()

static void psp_set_aspect_ratio ( void data,
unsigned  aspect_ratio_idx 
)
static
Here is the call graph for this function:

◆ psp_set_filtering()

static void psp_set_filtering ( void data,
unsigned  index,
bool  smooth 
)
static

◆ psp_set_nonblock_state()

static void psp_set_nonblock_state ( void data,
bool  toggle 
)
static

◆ psp_set_rotation()

static void psp_set_rotation ( void data,
unsigned  rotation 
)
static

◆ psp_set_screen_coords()

static INLINE void psp_set_screen_coords ( psp1_sprite_t framecoords,
int  x,
int  y,
int  width,
int  height,
unsigned  rotation 
)
static
Here is the caller graph for this function:

◆ psp_set_shader()

static bool psp_set_shader ( void data,
enum rarch_shader_type  type,
const char *  path 
)
static
Here is the call graph for this function:

◆ psp_set_tex_coords()

static INLINE void psp_set_tex_coords ( psp1_sprite_t framecoords,
int  width,
int  height 
)
static
Here is the caller graph for this function:

◆ psp_set_texture_enable()

static void psp_set_texture_enable ( void data,
bool  state,
bool  full_screen 
)
static
Here is the call graph for this function:

◆ psp_set_texture_frame()

static void psp_set_texture_frame ( void data,
const void frame,
bool  rgb32,
unsigned  width,
unsigned  height,
float  alpha 
)
static
Here is the call graph for this function:

◆ psp_suppress_screensaver()

static bool psp_suppress_screensaver ( void data,
bool  enable 
)
static
Here is the call graph for this function:

◆ psp_update_viewport()

static void psp_update_viewport ( psp1_video_t psp,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ psp_viewport_info()

static void psp_viewport_info ( void data,
struct video_viewport vp 
)
static

Variable Documentation

◆ psp1_sprite_t

psp1_sprite_t

◆ psp1_vertex_t

psp1_vertex_t

◆ psp_poke_interface

const video_poke_interface_t psp_poke_interface
static
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
static void psp_apply_state_changes(void *data)
Definition: psp1_gfx.c:817
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static void psp_set_texture_enable(void *data, bool state, bool full_screen)
Definition: psp1_gfx.c:682
static void psp_set_texture_frame(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
Definition: psp1_gfx.c:638
static void psp_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
Definition: psp1_gfx.c:789
static void psp_set_filtering(void *data, unsigned index, bool smooth)
Definition: psp1_gfx.c:781

◆ video_psp1

video_driver_t video_psp1
Initial value:
= {
NULL,
"psp1",
NULL,
NULL,
}
static bool psp_set_shader(void *data, enum rarch_shader_type type, const char *path)
Definition: psp1_gfx.c:950
static void psp_get_poke_interface(void *data, const video_poke_interface_t **iface)
Definition: psp1_gfx.c:859
static bool psp_suppress_screensaver(void *data, bool enable)
Definition: psp1_gfx.c:601
static bool psp_alive(void *data)
Definition: psp1_gfx.c:589
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static void * psp_init(const video_info_t *video, const input_driver_t **input, void **input_data)
Definition: psp1_gfx.c:261
static bool psp_frame(void *data, const void *frame, unsigned width, unsigned height, uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t *video_info)
Definition: psp1_gfx.c:478
static void psp_free(void *data)
Definition: psp1_gfx.c:608
static void psp_viewport_info(void *data, struct video_viewport *vp)
Definition: psp1_gfx.c:825
static void psp_set_rotation(void *data, unsigned rotation)
Definition: psp1_gfx.c:771
static void psp_set_nonblock_state(void *data, bool toggle)
Definition: psp1_gfx.c:581
static bool psp_read_viewport(void *data, uint8_t *buffer, bool is_idle)
Definition: psp1_gfx.c:866
static bool psp_focus(void *data)
Definition: psp1_gfx.c:595