mirror of
https://github.com/pspdev/pspsdk.git
synced 2026-01-01 21:18:39 +00:00
first commit
This commit is contained in:
30
src/display/Makefile.am
Normal file
30
src/display/Makefile.am
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
libdir = @PSPSDK_LIBDIR@
|
||||
|
||||
CC = @PSP_CC@
|
||||
CCAS = $(CC)
|
||||
AR = @PSP_AR@
|
||||
RANLIB = @PSP_RANLIB@
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel
|
||||
CFLAGS = @PSPSDK_CFLAGS@
|
||||
CCASFLAGS = $(CFLAGS) -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel
|
||||
|
||||
DISPLAY_OBJS = sceDisplay_0000.o sceDisplay_0001.o sceDisplay_0002.o sceDisplay_0003.o sceDisplay_0004.o sceDisplay_0005.o sceDisplay_0006.o sceDisplay_0007.o sceDisplay_0008.o sceDisplay_0009.o sceDisplay_0010.o sceDisplay_0011.o sceDisplay_0012.o sceDisplay_0013.o sceDisplay_0014.o sceDisplay_0015.o sceDisplay_0016.o sceDisplay_0017.o
|
||||
|
||||
DISPLAYDRIVER_OBJS = sceDisplay_driver_0000.o sceDisplay_driver_0001.o sceDisplay_driver_0002.o sceDisplay_driver_0003.o sceDisplay_driver_0004.o sceDisplay_driver_0005.o sceDisplay_driver_0006.o sceDisplay_driver_0007.o sceDisplay_driver_0008.o sceDisplay_driver_0009.o sceDisplay_driver_0010.o sceDisplay_driver_0011.o sceDisplay_driver_0012.o sceDisplay_driver_0013.o sceDisplay_driver_0014.o sceDisplay_driver_0015.o sceDisplay_driver_0016.o sceDisplay_driver_0017.o sceDisplay_driver_0018.o sceDisplay_driver_0019.o sceDisplay_driver_0020.o sceDisplay_driver_0021.o sceDisplay_driver_0022.o sceDisplay_driver_0023.o sceDisplay_driver_0024.o sceDisplay_driver_0025.o sceDisplay_driver_0026.o
|
||||
|
||||
libpspdisplayincludedir = @PSPSDK_INCLUDEDIR@
|
||||
libpspdisplayinclude_HEADERS = pspdisplay.h pspdisplay_kernel.h
|
||||
|
||||
lib_LIBRARIES = libpspdisplay.a libpspdisplay_driver.a
|
||||
libpspdisplay_a_SOURCES = sceDisplay.S
|
||||
libpspdisplay_a_LIBADD = $(DISPLAY_OBJS)
|
||||
libpspdisplay_driver_a_SOURCES = sceDisplay_driver.S
|
||||
libpspdisplay_driver_a_LIBADD = $(DISPLAYDRIVER_OBJS)
|
||||
|
||||
$(DISPLAY_OBJS): sceDisplay.S
|
||||
$(COMPILE) -DF_$* $< -c -o $@
|
||||
|
||||
$(DISPLAYDRIVER_OBJS): sceDisplay_driver.S
|
||||
$(COMPILE) -DF_$* $< -c -o $@
|
||||
129
src/display/pspdisplay.h
Normal file
129
src/display/pspdisplay.h
Normal file
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* PSP Software Development Kit - http://www.pspdev.org
|
||||
* -----------------------------------------------------------------------
|
||||
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
|
||||
*
|
||||
* pspdisplay.h - Prototypes for the sceDisplay library.
|
||||
*
|
||||
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
|
||||
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
|
||||
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
|
||||
* Copyright (c) 2007 Alexander Berl <raphael@fx-world.org>
|
||||
*
|
||||
* $Id: pspdisplay.h 2433 2008-10-15 10:00:27Z iwn $
|
||||
*/
|
||||
#ifndef __DISPLAY_H__
|
||||
#define __DISPLAY_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Framebuffer pixel formats. */
|
||||
enum PspDisplayPixelFormats {
|
||||
/** 16-bit RGB 5:6:5. */
|
||||
PSP_DISPLAY_PIXEL_FORMAT_565 = 0,
|
||||
/** 16-bit RGBA 5:5:5:1. */
|
||||
PSP_DISPLAY_PIXEL_FORMAT_5551,
|
||||
/* 16-bit RGBA 4:4:4:4. */
|
||||
PSP_DISPLAY_PIXEL_FORMAT_4444,
|
||||
/* 32-bit RGBA 8:8:8:8. */
|
||||
PSP_DISPLAY_PIXEL_FORMAT_8888
|
||||
};
|
||||
|
||||
enum PspDisplaySetBufSync {
|
||||
/** Buffer change effective immediately */
|
||||
PSP_DISPLAY_SETBUF_IMMEDIATE = 0,
|
||||
/** Buffer change effective next frame */
|
||||
PSP_DISPLAY_SETBUF_NEXTFRAME = 1
|
||||
};
|
||||
|
||||
|
||||
enum PspDisplayErrorCodes
|
||||
{
|
||||
SCE_DISPLAY_ERROR_OK = 0,
|
||||
SCE_DISPLAY_ERROR_POINTER = 0x80000103,
|
||||
SCE_DISPLAY_ERROR_ARGUMENT = 0x80000107
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Set display mode
|
||||
*
|
||||
* @par Example1:
|
||||
* @code
|
||||
* @endcode
|
||||
*
|
||||
* @param mode - Display mode, normally 0.
|
||||
* @param width - Width of screen in pixels.
|
||||
* @param height - Height of screen in pixels.
|
||||
*
|
||||
* @return ???
|
||||
*/
|
||||
int sceDisplaySetMode(int mode, int width, int height);
|
||||
|
||||
/**
|
||||
* Get display mode
|
||||
*
|
||||
* @param pmode - Pointer to an integer to receive the current mode.
|
||||
* @param pwidth - Pointer to an integer to receive the current width.
|
||||
* @param pheight - Pointer to an integer to receive the current height,
|
||||
*
|
||||
* @return 0 on success
|
||||
*/
|
||||
int sceDisplayGetMode(int *pmode, int *pwidth, int *pheight);
|
||||
|
||||
/**
|
||||
* Display set framebuf
|
||||
*
|
||||
* @param topaddr - address of start of framebuffer
|
||||
* @param bufferwidth - buffer width (must be power of 2)
|
||||
* @param pixelformat - One of ::PspDisplayPixelFormats.
|
||||
* @param sync - One of ::PspDisplaySetBufSync
|
||||
*
|
||||
* @return 0 on success
|
||||
*/
|
||||
int sceDisplaySetFrameBuf(void *topaddr, int bufferwidth, int pixelformat, int sync);
|
||||
|
||||
/**
|
||||
* Get Display Framebuffer information
|
||||
*
|
||||
* @param topaddr - pointer to void* to receive address of start of framebuffer
|
||||
* @param bufferwidth - pointer to int to receive buffer width (must be power of 2)
|
||||
* @param pixelformat - pointer to int to receive one of ::PspDisplayPixelFormats.
|
||||
* @param sync - One of ::PspDisplaySetBufSync
|
||||
*
|
||||
* @return 0 on success
|
||||
*/
|
||||
int sceDisplayGetFrameBuf(void **topaddr, int *bufferwidth, int *pixelformat, int sync);
|
||||
|
||||
/**
|
||||
* Number of vertical blank pulses up to now
|
||||
*/
|
||||
unsigned int sceDisplayGetVcount(void);
|
||||
|
||||
/**
|
||||
* Wait for vertical blank start
|
||||
*/
|
||||
int sceDisplayWaitVblankStart(void);
|
||||
|
||||
/**
|
||||
* Wait for vertical blank start with callback
|
||||
*/
|
||||
int sceDisplayWaitVblankStartCB(void);
|
||||
|
||||
/**
|
||||
* Wait for vertical blank
|
||||
*/
|
||||
int sceDisplayWaitVblank(void);
|
||||
|
||||
/**
|
||||
* Wait for vertical blank with callback
|
||||
*/
|
||||
int sceDisplayWaitVblankCB(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
72
src/display/pspdisplay_kernel.h
Normal file
72
src/display/pspdisplay_kernel.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* PSP Software Development Kit - http://www.pspdev.org
|
||||
* -----------------------------------------------------------------------
|
||||
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
|
||||
*
|
||||
* pspdisplay_kernel.h - Prototypes for the sceDisplay_driver library.
|
||||
*
|
||||
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
|
||||
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
|
||||
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
|
||||
* Copyright (c) 2007 Alexander Berl <raphael@fx-world.org>
|
||||
*
|
||||
* $Id: pspdisplay_kernel.h 2271 2007-07-20 13:08:41Z oopo $
|
||||
*/
|
||||
#ifndef __DISPLAYKERNEL_H__
|
||||
#define __DISPLAYKERNEL_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Display set framebuf
|
||||
*
|
||||
* @param pri - Priority
|
||||
* @param topaddr - address of start of framebuffer
|
||||
* @param bufferwidth - buffer width (must be power of 2)
|
||||
* @param pixelformat - One of ::PspDisplayPixelFormats.
|
||||
* @param sync - One of ::PspDisplaySetBufSync
|
||||
*
|
||||
* @return 0 on success
|
||||
*/
|
||||
int sceDisplay_driver_63E22A26(int pri, void *topaddr, int bufferwidth, int pixelformat, int sync);
|
||||
|
||||
/**
|
||||
* Get Display Framebuffer information
|
||||
*
|
||||
* @param pri - Priority
|
||||
* @param topaddr - pointer to void* to receive address of start of framebuffer
|
||||
* @param bufferwidth - pointer to int to receive buffer width (must be power of 2)
|
||||
* @param pixelformat - pointer to int to receive one of ::PspDisplayPixelFormats.
|
||||
* @param sync - One of ::PspDisplaySetBufSync
|
||||
*
|
||||
* @return 0 on success
|
||||
*/
|
||||
int sceDisplay_driver_5B5AEFAD(int pri, void **topaddr, int *bufferwidth, int *pixelformat, int sync);
|
||||
|
||||
/* Define some names to make it nicer */
|
||||
#define sceDisplaySetFrameBufferInternal sceDisplay_driver_63E22A26
|
||||
#define sceDisplayGetFrameBufferInternal sceDisplay_driver_5B5AEFAD
|
||||
|
||||
/**
|
||||
* Set Display brightness to a particular level
|
||||
*
|
||||
* @param level - Level of the brightness. it goes from 0 (black screen) to 100 (max brightness)
|
||||
* @param unk1 - Unknown can be 0 or 1 (pass 0)
|
||||
*/
|
||||
void sceDisplaySetBrightness(int level,int unk1);
|
||||
|
||||
/**
|
||||
* Get current display brightness
|
||||
*
|
||||
* @param level - Pointer to int to receive the current brightness level (0-100)
|
||||
* @param unk1 - Pointer to int, receives unknown, it's 1 or 0
|
||||
*/
|
||||
void sceDisplayGetBrightness(int *level,int *unk1);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
58
src/display/sceDisplay.S
Normal file
58
src/display/sceDisplay.S
Normal file
@@ -0,0 +1,58 @@
|
||||
.set noreorder
|
||||
|
||||
#include "pspimport.s"
|
||||
|
||||
#ifdef F_sceDisplay_0000
|
||||
IMPORT_START "sceDisplay",0x40010000
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0001
|
||||
IMPORT_FUNC "sceDisplay",0x0E20F177,sceDisplaySetMode
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0002
|
||||
IMPORT_FUNC "sceDisplay",0xDEA197D4,sceDisplayGetMode
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0003
|
||||
IMPORT_FUNC "sceDisplay",0xDBA6C4C4,sceDisplayGetFramePerSec
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0004
|
||||
IMPORT_FUNC "sceDisplay",0x7ED59BC4,sceDisplaySetHoldMode
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0005
|
||||
IMPORT_FUNC "sceDisplay",0xA544C486,sceDisplaySetResumeMode
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0006
|
||||
IMPORT_FUNC "sceDisplay",0x289D82FE,sceDisplaySetFrameBuf
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0007
|
||||
IMPORT_FUNC "sceDisplay",0xEEDA2E54,sceDisplayGetFrameBuf
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0008
|
||||
IMPORT_FUNC "sceDisplay",0xB4F378FA,sceDisplayIsForeground
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0009
|
||||
IMPORT_FUNC "sceDisplay",0x31C4BAA8,sceDisplay_31C4BAA8
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0010
|
||||
IMPORT_FUNC "sceDisplay",0x9C6EAAD7,sceDisplayGetVcount
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0011
|
||||
IMPORT_FUNC "sceDisplay",0x4D4E10EC,sceDisplayIsVblank
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0012
|
||||
IMPORT_FUNC "sceDisplay",0x36CDFADE,sceDisplayWaitVblank
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0013
|
||||
IMPORT_FUNC "sceDisplay",0x8EB9EC49,sceDisplayWaitVblankCB
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0014
|
||||
IMPORT_FUNC "sceDisplay",0x984C27E7,sceDisplayWaitVblankStart
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0015
|
||||
IMPORT_FUNC "sceDisplay",0x46F186C3,sceDisplayWaitVblankStartCB
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0016
|
||||
IMPORT_FUNC "sceDisplay",0x773DD3A3,sceDisplayGetCurrentHcount
|
||||
#endif
|
||||
#ifdef F_sceDisplay_0017
|
||||
IMPORT_FUNC "sceDisplay",0x210EAB3A,sceDisplayGetAccumulatedHcount
|
||||
#endif
|
||||
85
src/display/sceDisplay_driver.S
Normal file
85
src/display/sceDisplay_driver.S
Normal file
@@ -0,0 +1,85 @@
|
||||
.set noreorder
|
||||
|
||||
#include "pspimport.s"
|
||||
|
||||
#ifdef F_sceDisplay_driver_0000
|
||||
IMPORT_START "sceDisplay_driver",0x00010000
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0001
|
||||
IMPORT_FUNC "sceDisplay_driver",0x206276C2,sceDisplayInit
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0002
|
||||
IMPORT_FUNC "sceDisplay_driver",0x7A10289D,sceDisplayEnd
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0003
|
||||
IMPORT_FUNC "sceDisplay_driver",0x0E20F177,sceDisplaySetMode
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0004
|
||||
IMPORT_FUNC "sceDisplay_driver",0xDEA197D4,sceDisplayGetMode
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0005
|
||||
IMPORT_FUNC "sceDisplay_driver",0xDBA6C4C4,sceDisplayGetFramePerSec
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0006
|
||||
IMPORT_FUNC "sceDisplay_driver",0x432D133F,sceDisplayEnable
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0007
|
||||
IMPORT_FUNC "sceDisplay_driver",0x681EE6A7,sceDisplayDisable
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0008
|
||||
IMPORT_FUNC "sceDisplay_driver",0x7ED59BC4,sceDisplaySetHoldMode
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0009
|
||||
IMPORT_FUNC "sceDisplay_driver",0xA544C486,sceDisplaySetResumeMode
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0010
|
||||
IMPORT_FUNC "sceDisplay_driver",0x63E22A26,sceDisplay_driver_63E22A26
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0011
|
||||
IMPORT_FUNC "sceDisplay_driver",0x5B5AEFAD,sceDisplay_driver_5B5AEFAD
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0012
|
||||
IMPORT_FUNC "sceDisplay_driver",0x289D82FE,sceDisplaySetFrameBuf
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0013
|
||||
IMPORT_FUNC "sceDisplay_driver",0xEEDA2E54,sceDisplayGetFrameBuf
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0014
|
||||
IMPORT_FUNC "sceDisplay_driver",0xB4F378FA,sceDisplayIsForeground
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0015
|
||||
IMPORT_FUNC "sceDisplay_driver",0xAC14F1FF,sceDisplayGetForegroundLevel
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0016
|
||||
IMPORT_FUNC "sceDisplay_driver",0x9E3C6DC6,sceDisplaySetBrightness
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0017
|
||||
IMPORT_FUNC "sceDisplay_driver",0x31C4BAA8,sceDisplayGetBrightness
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0018
|
||||
IMPORT_FUNC "sceDisplay_driver",0x9C6EAAD7,sceDisplayGetVcount
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0019
|
||||
IMPORT_FUNC "sceDisplay_driver",0x4D4E10EC,sceDisplayIsVblank
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0020
|
||||
IMPORT_FUNC "sceDisplay_driver",0x69B53541,sceDisplayGetVblankRest
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0021
|
||||
IMPORT_FUNC "sceDisplay_driver",0x36CDFADE,sceDisplayWaitVblank
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0022
|
||||
IMPORT_FUNC "sceDisplay_driver",0x8EB9EC49,sceDisplayWaitVblankCB
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0023
|
||||
IMPORT_FUNC "sceDisplay_driver",0x984C27E7,sceDisplayWaitVblankStart
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0024
|
||||
IMPORT_FUNC "sceDisplay_driver",0x46F186C3,sceDisplayWaitVblankStartCB
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0025
|
||||
IMPORT_FUNC "sceDisplay_driver",0x773DD3A3,sceDisplayGetCurrentHcount
|
||||
#endif
|
||||
#ifdef F_sceDisplay_driver_0026
|
||||
IMPORT_FUNC "sceDisplay_driver",0x210EAB3A,sceDisplayGetAccumulatedHcount
|
||||
#endif
|
||||
Reference in New Issue
Block a user