Haio
0.2.X
Homebrew Asset IO/CDN
Toggle main menu visibility
Loading...
Searching...
No Matches
detect.cpp
Go to the documentation of this file.
1
#include <
haio_codec.hpp
>
2
3
namespace
Haio::Codecs
{
4
5
/** a rom holds pattern data, and pattern data is what haio can draw */
6
template
<>
struct
DefaultColor
<
Format
::
ROM
> {
static
constexpr
Color
value
=
Color::CHR_NES
; };
7
8
/**
9
* @addtogroup detect
10
* @{
11
*/
12
13
/** the ines header, which every nes rom on the internet starts with */
14
template
<>
15
bool
Detect<Format::ROM, Color::CHR_NES>
(
Bytes
data) {
16
return
data.size() >= 16 && data[0] ==
'N'
&& data[1] ==
'E'
&& data[2] ==
'S'
&& data[3] == 0x1A;
17
}
18
19
/** @} */
20
21
}
Haio::Codecs::Detect< Format::ROM, Color::CHR_NES >
bool Detect< Format::ROM, Color::CHR_NES >(Bytes data)
Definition
detect.cpp:15
haio_codec.hpp
Haio::Codecs
Definition
haio_codec.hpp:136
Haio::Codecs::DefaultColor
Definition
haio_codec.hpp:143
Haio::Color
Color
Definition
haio_formats.hpp:106
Haio::Color::CHR_NES
@ CHR_NES
Definition
haio_formats.hpp:155
Haio::Format
Format
Definition
haio_formats.hpp:17
Haio::Format::ROM
@ ROM
Definition
haio_formats.hpp:82
Haio::Bytes
std::span< const uint8_t > Bytes
Definition
haio_codec.hpp:14
Haio::Codecs::DefaultColor< Format::ROM >::value
static constexpr Color value
Definition
detect.cpp:6
library
backend
codecs
container
rom
detect.cpp
Generated by
1.18.0