Arduino gameboy cart reader software, using https://github.com/insidegadgets/GBCartRead
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.3 KiB
56 lines
1.3 KiB
4 years ago
|
#pragma once
|
||
|
|
||
|
enum proto_reader {
|
||
|
// Sent when the operation was successful
|
||
|
PROTO_READER_OK,
|
||
|
|
||
|
// Sent after a failed operation
|
||
|
PROTO_READER_FAIL
|
||
|
};
|
||
|
|
||
|
enum proto_client {
|
||
|
// Packet:
|
||
|
// u8 - command
|
||
|
// Response:
|
||
|
// u8 - status
|
||
|
PROTO_CLIENT_INIT,
|
||
|
|
||
|
// Packet:
|
||
|
// u8 - command
|
||
|
// u32 - start address
|
||
|
// u32 - size
|
||
|
// Response:
|
||
|
// u8 - status
|
||
|
// u8[] - data (if status == PROTO_READER_OK)
|
||
|
|
||
|
// Read a raw address with whatever current state
|
||
|
// (useful for RTC and other cart addons)
|
||
|
PROTO_CLIENT_READ_RAW,
|
||
|
// Read an absolute ROM address, switching banks as needed
|
||
|
PROTO_CLIENT_READ_ROM,
|
||
|
// Read an absolute SRAM address, switching banks as needed
|
||
|
PROTO_CLIENT_READ_RAM,
|
||
|
|
||
|
// Packet:
|
||
|
// u8 - command
|
||
|
// u32 - start address
|
||
|
// u32 - size
|
||
|
// u8[] - data
|
||
|
// Response:
|
||
|
// u8 - status
|
||
|
|
||
|
// Write a raw address with whatever current state
|
||
|
// (useful for RTC and other cart addons)
|
||
|
PROTO_CLIENT_WRITE_RAW,
|
||
|
// Write an absolute ROM address, switching banks as needed
|
||
|
PROTO_CLIENT_WRITE_ROM,
|
||
|
// Write an absolute SRAM address, switching banks as needed
|
||
|
PROTO_CLIENT_WRITE_RAM
|
||
|
};
|
||
|
|
||
|
struct proto_client_packet {
|
||
|
uint8_t command;
|
||
|
uint32_t address;
|
||
|
uint32_t size;
|
||
|
} __attribute__((packed));
|