OSDN Git Service

====----==== this is a messed up build that contains a busted 0.exe pan page system
[proj16/16.git] / src / lib / 16_vrs.h
1 /* Project 16 Source Code~\r
2  * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
3  *\r
4  * This file is part of Project 16.\r
5  *\r
6  * Project 16 is free software; you can redistribute it and/or modify\r
7  * it under the terms of the GNU General Public License as published by\r
8  * the Free Software Foundation; either version 3 of the License, or\r
9  * (at your option) any later version.\r
10  *\r
11  * Project 16 is distributed in the hope that it will be useful,\r
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14  * GNU General Public License for more details.\r
15  *\r
16  * You should have received a copy of the GNU General Public License\r
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
18  * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
19  * Fifth Floor, Boston, MA 02110-1301 USA.\r
20  *\r
21  */\r
22 #ifndef __16_VRS__\r
23 #define __16_VRS__\r
24 \r
25 #include "src/lib/16_head.h"\r
26 #include "src/lib/16_vl.h"\r
27 //#include <hw/cpu/cpu.h>\r
28 //#include <hw/dos/dos.h>\r
29 #include <hw/vga/vrl.h>\r
30 #include "src/lib/16_ca.h"\r
31 \r
32 struct vrs_container{\r
33         // Size of a .vrs lob in memory\r
34         // minus header\r
35         dword data_size;\r
36         union{\r
37                 byte far *buffer;\r
38                 struct vrs_header far *vrs_hdr;\r
39         };\r
40         // Array of corresponding vrl line offsets\r
41         vrl1_vgax_offset_t **vrl_line_offsets;\r
42 };\r
43 \r
44 struct vrl_container{\r
45         // Size of a .vrl blob in memory\r
46         // minus header\r
47         dword data_size;\r
48         union{\r
49                 byte far *buffer;\r
50                 struct vrl1_vgax_header far *vrl_header;\r
51         };\r
52         // Pointer to a corresponding vrl line offsets struct\r
53         vrl1_vgax_offset_t *line_offsets;\r
54 };\r
55 \r
56 /* Read .vrs file into memory\r
57 * In:\r
58 * + char *filename - name of the file to load\r
59 * + struct vrs_container *vrs_cont - pointer to the vrs_container\r
60 * to load the file into\r
61 * Out:\r
62 * + int - 0 on succes, 1 on failure\r
63 */\r
64 void VRS_ReadVRS(char *filename, entity_t *enti, global_game_variables_t *gvar);\r
65 void VRS_LoadVRS(char *filename, entity_t *enti, global_game_variables_t *gvar);\r
66 void VRS_OpenVRS(char *filename, entity_t *enti, boolean rlsw, global_game_variables_t *gvar);\r
67 //int read_vrs(global_game_variables_t *gvar, char *filename, struct vrs_container *vrs_cont);\r
68 \r
69 /* Seek and return a specified .vrl blob from .vrs blob in memory\r
70 * In:\r
71 * + struct vrs_container *vrs_cont - pointer to the vrs_container\r
72 * with a loaded .vrs file\r
73 * + uint16_t id - id of the vrl to retrive\r
74 * + struct vrl_container * vrl_cont - pointer to vrl_container to load to\r
75 * Out:\r
76 * int - operation status\r
77 * to the requested .vrl blob\r
78 */\r
79 int get_vrl_by_id(struct vrs_container *vrs_cont, uint16_t id, struct vrl_container * vrl_cont);\r
80 \r
81 #endif\r