OSCR
Open Source Cartridge Reader
Loading...
Searching...
No Matches
basic.h
1/********************************************************************
2* Open Source Cartridge Reader *
3********************************************************************/
4#pragma once
5#ifndef CRDB_BASIC_H_
6#define CRDB_BASIC_H_
7
8#include "common/CRDB.h"
9
10namespace OSCR
11{
12 namespace Databases
13 {
14 namespace Basic
15 {
17 {
18 crc32_t crc32;
19 char name[101];
20 };
21
22 class BasicRecord : public OSCR::CRDB::GenericCartRecord<crdbRecord>
23 {
24 public:
25 uint32_t getCRC32();
26 void debug();
27 };
28
29 class CRDatabase : public OSCR::CRDB::CRDB<BasicRecord, CRDB_RECORD_SIZE_BASIC>
30 {
31 using CRDB::CRDB;
32 public:
33 void nextRecord();
34
35 virtual ~CRDatabase() = default;
36 };
37
38 extern crdbRecord * romDetail;
39 extern BasicRecord * romRecord;
40 extern CRDatabase * crdb;
41 extern bool ready;
42
43 extern void setup(char const * databasePath);
44 extern void setup(__FlashStringHelper const * databasePath);
45
46 extern bool matchCRC(crc32_t * crc32ptr = nullptr, uint8_t offset = 0);
47 extern bool searchDatabase(crc32_t * crc32ptr = nullptr);
48
49 extern bool compareCRC(char const * databasePath, crc32_t * crc32ptr = nullptr, uint8_t offset = 0);
50 extern bool compareCRC(__FlashStringHelper const * databaseName, crc32_t * crc32ptr = nullptr, uint8_t offset = 0);
51
52 extern bool compareCRC(char const * databasePath, crc32_t & crc32, uint8_t offset = 0);
53 extern bool compareCRC(__FlashStringHelper const * databaseName, crc32_t & crc32, uint8_t offset = 0);
54
55 }
56 }
57}
58
59#endif /* CRDB_BASIC_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