-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpsms.h
83 lines (57 loc) · 1.86 KB
/
psms.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef _PSMS_H_
#define _PSMS_H_
//#define DEVEL
//#define CD_BUILD
#define WIDTH 256
#define HEIGHT 240
/* VRAM layout:
0x000000 - FB 1
0x040000 - FB 2 (FB 1 + 256*256*4)
0x080000 - ZBuf (FB 2 * 2)
0x0A0000 - End of ZBuf. Star of TEX and CLUT area.
0x0B0000 - SMS Display Texture (0xC000 bytes long)
0x0BC000 - SMS Display Clut (0x200 bytes long)
0x0C0000 - PSMS logo image (0x8000 bytes long)
0x0C8000 - PSMS logo clut (0x200 bytes long)
0x0D0000 - PSMS font image (0x10000 bytes long)
0x0E0000 - PSMS font clut (0x200 bytes long)
*/
#define SMS_TEX 0x0B0000
#define SMS_CLUT 0x0BC000
#define LOGO_TEX 0x0C0000
#define LOGO_CLUT 0x0C8000
#define FONT_TEX 0x0D0000
#define FONT_CLUT 0x0E0000
#define VRAM_MAX 0x3E8000
//#define WAIT_PAD_READY(p, s) {while(padGetState((p),(s)) != PAD_STATE_STABLE) WaitForNextVRstart(1); }
#define WAIT_PAD_READY(p, s) {while(padGetState((p),(s)) != PAD_STATE_STABLE); }
// PSMS Logo
extern unsigned char __attribute__((aligned(16))) psms_image[];
extern unsigned char __attribute__((aligned(16))) psms_clut[];
#define psms_width 256
#define psms_height 128
#define psms_mode 1
// Menu font
extern unsigned char __attribute__((aligned(16))) vixar_image[];
extern unsigned char __attribute__((aligned(16))) vixar_clut[];
extern unsigned char vixarmet[];
#define vixar_width 256
#define vixar_height 256
#define vixar_mode 1
int load_rom(char* filename);
void update_video();
void update_input();
int init_machine();
void LoadModules();
void setupSMSGS(void);
void setupSMSTexture(void);
int InitPad(int port, int slot, char* buffer);
void test();
void TextOut(int x, int y, char *string, int z);
void TextOutC(int x_start, int x_end, int y, char *string, int z);
void IngameMenu();
void psms_save_state();
void psms_load_state();
void psms_manage_sram(u8 *sram, int mode);
void display_error(char* errmsg, int fatal);
#endif /* _PSMS_H_ */