2020-12-05 13:08:24 +01:00
|
|
|
#pragma once
|
2018-10-26 12:08:45 +02:00
|
|
|
|
2020-12-12 13:01:29 +01:00
|
|
|
#include "util/types.hpp"
|
2020-10-30 21:26:22 +01:00
|
|
|
#include "Emu/Memory/vm_ptr.h"
|
2018-10-26 12:08:45 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
struct shle_pattern
|
|
|
|
|
{
|
|
|
|
|
u16 start_pattern[32];
|
|
|
|
|
u8 crc16_length;
|
|
|
|
|
u16 crc16;
|
|
|
|
|
u16 total_length;
|
2020-05-06 17:18:30 +02:00
|
|
|
std::string _module;
|
2018-10-26 12:08:45 +02:00
|
|
|
std::string name;
|
|
|
|
|
|
|
|
|
|
u32 fnid;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class statichle_handler
|
|
|
|
|
{
|
|
|
|
|
public:
|
2019-09-19 14:58:02 +02:00
|
|
|
statichle_handler(int);
|
2018-10-26 12:08:45 +02:00
|
|
|
~statichle_handler();
|
|
|
|
|
|
2021-03-02 17:22:39 +01:00
|
|
|
statichle_handler(const statichle_handler&) = delete;
|
|
|
|
|
statichle_handler& operator=(const statichle_handler&) = delete;
|
|
|
|
|
|
2018-10-26 12:08:45 +02:00
|
|
|
bool load_patterns();
|
|
|
|
|
bool check_against_patterns(vm::cptr<u8>& data, u32 size, u32 addr);
|
|
|
|
|
|
|
|
|
|
protected:
|
2020-12-18 09:24:19 +01:00
|
|
|
u16 gen_CRC16(const u8* data_p, usz length);
|
2018-10-26 12:08:45 +02:00
|
|
|
|
|
|
|
|
std::vector<shle_pattern> hle_patterns;
|
|
|
|
|
};
|