OSCR
Open Source Cartridge Reader
Loading...
Searching...
No Matches
extended.h
1/********************************************************************
2* Open Source Cartridge Reader *
3********************************************************************/
4#pragma once
5#ifndef CRDB_EXTENDED_H_
6# define CRDB_EXTENDED_H_
7
8#include "common/CRDB.h"
9
10namespace OSCR
11{
12 namespace Databases
13 {
14 namespace Extended
15 {
17 {
18 crc32_t crc32;
19 crc32_t id32;
20 uint32_t mapper;
21 uint32_t size;
22 char name[101];
23 };
24
26 {
27 public:
28 uint32_t getCRC32();
29 void debug();
30 };
31
32 class CRDatabase : public OSCR::CRDB::CRDB<ExtendedRecord, CRDB_RECORD_SIZE_EXTENDED>
33 {
34 using CRDB::CRDB;
35 public:
36 void nextRecord();
37
38 virtual ~CRDatabase() = default;
39 };
40
41 extern crdbRecord * romDetail;
42 extern ExtendedRecord * romRecord;
43 extern CRDatabase * crdb;
44 extern bool ready;
45
46 extern void setup(char const * databasePath);
47 extern void setup(__FlashStringHelper const * databasePath);
48
49 extern bool matchCRC(crc32_t * crc32ptr = nullptr, uint8_t offset = 0);
50 extern bool searchDatabase(crc32_t * crc32ptr = nullptr);
51
52 extern bool browseDatabase();
53
54 extern bool compareCRC(char const * databasePath, crc32_t * crc32ptr = nullptr, uint8_t offset = 0);
55 extern bool compareCRC(__FlashStringHelper const * databaseName, crc32_t * crc32ptr = nullptr, uint8_t offset = 0);
56
57 extern bool compareCRC(char const * databasePath, crc32_t & crc32, uint8_t offset = 0);
58 extern bool compareCRC(__FlashStringHelper const * databaseName, crc32_t & crc32, uint8_t offset = 0);
59 }
60 }
61}
62
63#endif /* CRDB_EXTENDED_ID_H_ */
Definition CRDB.h:313
Definition CRDB.h:63
Main program.
Definition Storage.h:13
Interface for handling CRC32 values.
Definition crc32_t.h:14