platform ps2, handle audio similar to psp
[picodrive.git] / platform / psp / psp.h
CommitLineData
cff531af 1/*
2 * PicoDrive
3 * (C) notaz, 2007,2008
4 *
5 * This work is licensed under the terms of MAME license.
6 * See COPYING file in the top-level directory.
7 */
8b99ab90 8
1820b5a7 9#include <pspctrl.h>
10
11void psp_init(void);
12void psp_finish(void);
13
14void psp_msleep(int ms);
15
9112b6ce 16// vram usage map:
1cc77481 17// 000000-044000 fb0: 512*272*2
9112b6ce 18// 044000-088000 fb1
1cc77481 19// 088000-0cc000 depth (Z)
20// 0cc000-110000 emu/menu draw buffer 0: 512*272*2
21// 110000-154000 emu/menu draw buffer 1
9112b6ce 22
8ab3e3c1 23#define VRAMOFFS_FB0 0x00000000
24#define VRAMOFFS_FB1 0x00044000
25#define VRAMOFFS_DEPTH 0x00088000
26#define VRAMOFFS_STUFF 0x000cc000
9112b6ce 27
d12dd1b4 28#define VRAM_ADDR 0x44000000
29#define VRAM_FB0 ((void *) (VRAM_ADDR+VRAMOFFS_FB0))
30#define VRAM_FB1 ((void *) (VRAM_ADDR+VRAMOFFS_FB1))
31#define VRAM_STUFF ((void *) (VRAM_ADDR+VRAMOFFS_STUFF))
9112b6ce 32
d12dd1b4 33#define VRAM_CACHEDADDR 0x04000000
34#define VRAM_CACHED_STUFF ((void *) (VRAM_CACHEDADDR+VRAMOFFS_STUFF))
9112b6ce 35
8ab3e3c1 36#define GU_CMDLIST_SIZE (16*1024)
9112b6ce 37
38extern unsigned int guCmdList[GU_CMDLIST_SIZE];
ea08c296 39extern int psp_unhandled_suspend;
1820b5a7 40
7d4906bf 41void *psp_video_get_active_fb(void);
42void psp_video_switch_to_single(void);
d12dd1b4 43void psp_video_flip(int wait_vsync);
1820b5a7 44extern void *psp_screen;
45
7d4906bf 46unsigned int psp_pad_read(int blocking);
1820b5a7 47
70357ce5 48int psp_get_cpu_clock(void);
49int psp_set_cpu_clock(int clock);
1820b5a7 50
9caf44b5 51char *psp_get_status_line(void);
52
7d0143a2 53void psp_wait_suspend(void);
ea08c296 54void psp_resume_suspend(void);
7d0143a2 55
cdc6aac4 56/* fake 'nub' btns, mapped to the 4 unused upper bits of ctrl buttons */
6370b1d4 57#define PSP_NUB_UP (1 << 26)
58#define PSP_NUB_RIGHT (1 << 27)
59#define PSP_NUB_DOWN (1 << 28)
60#define PSP_NUB_LEFT (1 << 29)
9caf44b5 61
1cc77481 62/* from menu.c */
63void psp_menu_init(void);