Mercurial > repos > blastem
annotate zip.h @ 2195:40290a923886
Implement Game Gear start button and region register
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 21 Aug 2022 22:56:32 -0700 |
parents | 7121daaa48c2 |
children |
rev | line source |
---|---|
1531
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #ifndef ZIP_H_ |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #define ZIP_H_ |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 #include <stdint.h> |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 #include <stdio.h> |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 typedef struct { |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 uint64_t compressed_size; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 uint64_t size; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 uint64_t local_header_off; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 char *name; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 uint16_t compression_method; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 } zip_entry; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 typedef struct { |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 zip_entry *entries; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 FILE *file; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 uint32_t num_entries; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 } zip_file; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 |
1581
7121daaa48c2
Fix drag and drop when using Nuklear UI
Michael Pavone <pavone@retrodev.com>
parents:
1531
diff
changeset
|
21 zip_file *zip_open(const char *filename); |
1531
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 uint8_t *zip_read(zip_file *f, uint32_t index, size_t *out_size); |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 void zip_close(zip_file *f); |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 #endif //ZIP_H_ |