|
| 1 | +/** \file naomi/cart.h |
| 2 | + \brief NAOMI cartridge information. |
| 3 | + \ingroup naomi |
| 4 | +
|
| 5 | + This file is part of DreamShell. |
| 6 | +
|
| 7 | + Copyright (C) 2025 SWAT |
| 8 | +*/ |
| 9 | + |
| 10 | +#ifndef __NAOMI_CART_H |
| 11 | +#define __NAOMI_CART_H |
| 12 | + |
| 13 | +#include <sys/types.h> |
| 14 | + |
| 15 | +/** \brief NAOMI ROM load entry. */ |
| 16 | +typedef struct naomi_load_entry { |
| 17 | + uint32_t offset; |
| 18 | + void *dst_buf; |
| 19 | + uint32_t size; |
| 20 | +} naomi_load_entry_t; |
| 21 | + |
| 22 | +/** \brief NAOMI cartridge header. */ |
| 23 | +typedef struct naomi_cart_header { |
| 24 | + char system_name[16]; /**< \brief "NAOMI" space padded */ |
| 25 | + char publisher[32]; /**< \brief "SEGA ENTERPRISES,LTD." space padded */ |
| 26 | + char regional_name[8][32]; /**< \brief Space padded */ |
| 27 | + |
| 28 | + uint16_t year; /**< \brief Manufacture date: year */ |
| 29 | + uint8_t month; /**< \brief Manufacture date: month */ |
| 30 | + uint8_t day; /**< \brief Manufacture date: day */ |
| 31 | + char serial[4]; /**< \brief Serial number */ |
| 32 | + |
| 33 | + /** \brief 8MB ROM mode flag. |
| 34 | +
|
| 35 | + Non-zero value specifies that ROM board offsets should be OR'd with |
| 36 | + 0x20000000. |
| 37 | + */ |
| 38 | + uint16_t rom_mode_flag; |
| 39 | + |
| 40 | + /** \brief G1 BUS initialization flag. |
| 41 | +
|
| 42 | + Non-zero value specifies that the below G1 BUS register values should |
| 43 | + be used. |
| 44 | + */ |
| 45 | + uint16_t g1bus_init_flag; |
| 46 | + |
| 47 | + uint32_t SB_G1RRC_val; /**< \brief G1 BUS register value */ |
| 48 | + uint32_t SB_G1RWC_val; /**< \brief G1 BUS register value */ |
| 49 | + uint32_t SB_G1FRC_val; /**< \brief G1 BUS register value */ |
| 50 | + uint32_t SB_G1FWC_val; /**< \brief G1 BUS register value */ |
| 51 | + uint32_t SB_G1CRC_val; /**< \brief G1 BUS register value */ |
| 52 | + uint32_t SB_G1CWC_val; /**< \brief G1 BUS register value */ |
| 53 | + uint32_t SB_G1GDRC_val; /**< \brief G1 BUS register value */ |
| 54 | + uint32_t SB_G1GDWC_val; /**< \brief G1 BUS register value */ |
| 55 | + |
| 56 | + uint8_t ROM_checksums[132]; /**< \brief 132 bytes of M2/M4-type ROM checksums */ |
| 57 | + uint8_t EEPROM_init_val[128]; /**< \brief EEPROM initial values */ |
| 58 | + |
| 59 | + char credits_str[8][32]; /**< \brief Credits strings */ |
| 60 | + |
| 61 | + naomi_load_entry_t game_exe[8]; /**< \brief Game executable entries */ |
| 62 | + naomi_load_entry_t test_exe[8]; /**< \brief Test mode executable entries */ |
| 63 | + |
| 64 | + uint32_t game_execute_adr; /**< \brief Jump to this address to run game */ |
| 65 | + uint32_t test_execute_adr; /**< \brief Jump to this address to run test mode */ |
| 66 | + |
| 67 | + /** \brief Region mask. |
| 68 | +
|
| 69 | + Mask of supported regions: bit 0 - Japan, bit 1 - USA, bit 2 - Export, |
| 70 | + bit 3 - Korea, bit 4 - Australia. |
| 71 | + */ |
| 72 | + uint8_t region; |
| 73 | + |
| 74 | + /** \brief Player count mask. |
| 75 | +
|
| 76 | + Mask of supported player numbers: 0 - any; bit 0 - 1 player, |
| 77 | + bit 1 - 2 players, bit 2 - 3 players, bit 3 - 4 players. |
| 78 | + */ |
| 79 | + uint8_t players; |
| 80 | + |
| 81 | + /** \brief Video mode mask. |
| 82 | +
|
| 83 | + Mask of supported video modes: 0 - any; bit 0 - 31khz, bit 1 - 15khz. |
| 84 | + */ |
| 85 | + uint8_t vid_mode; |
| 86 | + |
| 87 | + /** \brief Display orientation mask. |
| 88 | +
|
| 89 | + 0 - any; bit 0 - horizontal, bit 1 - vertical. |
| 90 | + */ |
| 91 | + uint8_t disp_orientation; |
| 92 | + |
| 93 | + /** \brief Serial number check flag. |
| 94 | +
|
| 95 | + Flag to check ROM/DIMM board serial number EEPROM. The BIOS checks the |
| 96 | + EEPROM if this set to 1. |
| 97 | + */ |
| 98 | + uint8_t check_serial; |
| 99 | + |
| 100 | + /** \brief Service type. |
| 101 | +
|
| 102 | + A value of 0 means common and a value of 1 means individual. |
| 103 | + */ |
| 104 | + uint8_t service_type; |
| 105 | + |
| 106 | + uint8_t ROM_checksums2[144]; /**< \brief 144 bytes of M1-type ROM checksums */ |
| 107 | + uint8_t padding[71]; /**< \brief Padding */ |
| 108 | + |
| 109 | + /** \brief Encryption flag. |
| 110 | +
|
| 111 | + If this is 0xFF then the header is unencrypted. If it is not 0xFF then |
| 112 | + the header is encrypted starting at offset 0x010. |
| 113 | + */ |
| 114 | + uint8_t encryption; |
| 115 | +} naomi_cart_header_t; |
| 116 | + |
| 117 | +#endif /* __NAOMI_CART_H */ |
0 commit comments