Rev 5239 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5239 | Rev 5260 | ||
---|---|---|---|
Line 102... | Line 102... | ||
102 | 102 | ||
103 | void rskos_exit() { |
103 | void rskos_exit() { |
104 | rsAppExit(); |
104 | rsAppExit(); |
Line -... | Line 105... | ||
- | 105 | }; |
|
- | 106 | ||
- | 107 | ||
- | 108 | ||
- | 109 | ||
- | 110 | int rskos_file_save(char *filename, unsigned char *data, int length) { |
|
- | 111 | FILE *fp; |
|
- | 112 | ||
- | 113 | fp = fopen(filename, "w"); |
|
- | 114 | if (!fp) { |
|
- | 115 | return 0; |
|
- | 116 | }; |
|
- | 117 | ||
- | 118 | fwrite(data, 1, length, fp); |
|
- | 119 | fclose(fp); |
|
- | 120 | ||
- | 121 | return 1; |
|
- | 122 | ||
- | 123 | }; |
|
- | 124 | ||
- | 125 | int rskos_file_load(char *filename, unsigned char *data, int length) { |
|
- | 126 | FILE *fp; |
|
- | 127 | ||
- | 128 | fp = fopen(filename, "r"); |
|
- | 129 | if (!fp) { |
|
- | 130 | return 0; |
|
- | 131 | }; |
|
- | 132 | ||
- | 133 | fread(data, 1, length, fp); |
|
- | 134 | fclose(fp); |
|
- | 135 | ||
- | 136 | return 1; |
|
- | 137 | }; |
|
- | 138 | ||
- | 139 | ||
- | 140 | ||
- | 141 | ||
- | 142 | ||
- | 143 | ||
- | 144 | ||
105 | }; |
145 | |
106 | 146 | ||
107 | //void rskos_snd_init() { |
147 | //void rskos_snd_init() { |
108 | // // |
148 | // // |
109 | // |
149 | // |
Line 142... | Line 182... | ||
142 | #else |
182 | #else |
Line 143... | Line 183... | ||
143 | 183 | ||
Line -... | Line 184... | ||
- | 184 | #include "rs/rsplatform.h" |
|
- | 185 | ||
- | 186 | ||
- | 187 | #pragma pack(push,1) |
|
- | 188 | ||
- | 189 | typedef struct rskos_file_struct_t { |
|
- | 190 | ||
- | 191 | unsigned int func_num; |
|
- | 192 | unsigned int offset; |
|
- | 193 | unsigned int flags; |
|
- | 194 | unsigned int length; |
|
- | 195 | unsigned char *data; |
|
- | 196 | unsigned char zero; |
|
- | 197 | char *filename; |
|
- | 198 | ||
- | 199 | } rskos_file_struct_t; |
|
- | 200 | ||
- | 201 | #pragma pack(pop) |
|
144 | #include "rs/rsplatform.h" |
202 | |
145 | 203 | ||
146 | 204 | ||
Line -... | Line 205... | ||
- | 205 | unsigned int rskos_get_time() { |
|
- | 206 | return 1; |
|
- | 207 | }; |
|
- | 208 | ||
- | 209 | ||
- | 210 | ||
- | 211 | ||
- | 212 | ||
- | 213 | ||
- | 214 | ||
- | 215 | ||
- | 216 | ||
- | 217 | int rskos_file_load(char *filename, unsigned char *data, int length) { |
|
- | 218 | ||
- | 219 | // char filename_abs[] = "/sys/games/************************"; |
|
- | 220 | // memcpy( filename_abs[ strchr(filename_abs, "*") ], filename, strlen(filename)+1 ); |
|
- | 221 | ||
- | 222 | rskos_file_struct_t file_struct; |
|
- | 223 | file_struct.func_num = 0; |
|
- | 224 | file_struct.offset = 0; |
|
- | 225 | file_struct.flags = 0; |
|
- | 226 | file_struct.length = length; |
|
- | 227 | file_struct.data = data; |
|
- | 228 | file_struct.zero = 0; |
|
- | 229 | file_struct.filename = filename; |
|
- | 230 | ||
- | 231 | asm volatile ("int $0x40"::"a"(70), "b"(&file_struct) : "memory"); |
|
- | 232 | ||
- | 233 | return 1; |
|
- | 234 | } |
|
- | 235 | ||
- | 236 | ||
- | 237 | ||
- | 238 | int rskos_file_save(char *filename, unsigned char *data, int length) { |
|
- | 239 | ||
- | 240 | // char filename_abs[] = "/sys/games/************************"; |
|
- | 241 | // memcpy( filename_abs[ strchr(filename_abs, "*") ], filename, strlen(filename)+1 ); |
|
- | 242 | ||
- | 243 | rskos_file_struct_t file_struct; |
|
- | 244 | file_struct.func_num = 2; |
|
- | 245 | file_struct.offset = 0; |
|
- | 246 | file_struct.flags = 0; |
|
- | 247 | file_struct.length = length; |
|
- | 248 | file_struct.data = data; |
|
- | 249 | file_struct.zero = 0; |
|
- | 250 | file_struct.filename = filename; |
|
- | 251 | ||
- | 252 | asm volatile ("int $0x40"::"a"(70), "b"(&file_struct) : "memory" ); |
|
- | 253 | ||
- | 254 | return 1; |
|
- | 255 | } |
|
- | 256 | ||
- | 257 | ||
- | 258 | ||
- | 259 | ||
- | 260 | ||
- | 261 | ||
147 | unsigned int rskos_get_time() { |
262 | |
Line 148... | Line 263... | ||
148 | return 1; |
263 |