|
| 1 | +// LEP |
| 2 | +// © 2019 Patrick Lafarguette |
| 3 | +// |
| 4 | +// LEP file structure |
| 5 | +// |
| 6 | +// See http://dcmoto.free.fr/bricolage/sdlep-reader/index.html |
| 7 | + |
| 8 | +#ifndef LEP_H |
| 9 | +#define LEP_H |
| 10 | + |
| 11 | +#include <stdint.h> |
| 12 | + |
| 13 | +#define LEP_DEFAULT 0 |
| 14 | + |
| 15 | +// Header |
| 16 | +typedef struct lep_header { |
| 17 | + uint32_t magic; |
| 18 | + uint32_t version; |
| 19 | + // Computer |
| 20 | + uint8_t brand; |
| 21 | + uint8_t family; |
| 22 | + uint32_t compatibily; |
| 23 | + // Loading |
| 24 | + uint8_t period; // µs |
| 25 | + uint8_t method; |
| 26 | + uint32_t duration; // ms |
| 27 | + // Block |
| 28 | + uint8_t blocks; |
| 29 | +} __attribute__((packed)) lep_header; |
| 30 | + |
| 31 | +// Block |
| 32 | +typedef struct lep_block { |
| 33 | + uint32_t size; // Up to 4 GB |
| 34 | + uint32_t duration; |
| 35 | +} __attribute__((packed)) lep_block; |
| 36 | + |
| 37 | +// Magic |
| 38 | +#define LEP_MAGIC 0x4650454C // LEPF |
| 39 | + |
| 40 | +// Version |
| 41 | +#define LEP_VERSION_MAJOR 1 |
| 42 | +#define LEP_VERSION_MINOR 0 |
| 43 | +#define LEP_VERSION_REVISION 0 |
| 44 | + |
| 45 | +#define LEP_VERSION ((LEP_VERSION_MAJOR << 16) | (LEP_VERSION_MINOR << 8) | LEP_VERSION_REVISION) |
| 46 | + |
| 47 | +// Period |
| 48 | +#define LEP_PERIOD 50 |
| 49 | + |
| 50 | +// Method |
| 51 | +#define LEP_RUN 0 // RUN " |
| 52 | +#define LEP_LOADM 1 // LOADM |
| 53 | +#define LEP_LOADMR 2 // LOADM"",,R |
| 54 | + |
| 55 | +// Brand |
| 56 | +#define LEP_ACORN 1 |
| 57 | +#define LEP_AMSTRAD 2 |
| 58 | +#define LEP_APOLLO_7 3 |
| 59 | +#define LEP_APPLE 4 |
| 60 | +#define LEP_APPLIED_TECHNOLOGIES 5 |
| 61 | +#define LEP_ATARI 6 |
| 62 | +#define LEP_CAMPUTERS 7 |
| 63 | +#define LEP_CANON 8 |
| 64 | +#define LEP_COMMODORE 9 |
| 65 | +#define LEP_DRAGON 10 |
| 66 | +#define LEP_ENTERPRISE 11 |
| 67 | +#define LEP_EPSON 12 |
| 68 | +#define LEP_EXELVISION 13 |
| 69 | +#define LEP_EXIDY 14 |
| 70 | +#define LEP_GRUNDY 15 |
| 71 | +#define LEP_HANIMEX 16 |
| 72 | +#define LEP_INDATA 17 |
| 73 | +#define LEP_JUPITER_CANTAB 18 |
| 74 | +#define LEP_KYOCERA 19 |
| 75 | +#define LEP_MATRA 20 |
| 76 | +#define LEP_MATSUSHITA 21 |
| 77 | +#define LEP_MATTEL_ELECTRONICS 22 |
| 78 | +#define LEP_MEMOTECH 23 |
| 79 | +#define LEP_MICRONIQUE 24 |
| 80 | +#define LEP_MSX 41 |
| 81 | +#define LEP_NEC 25 |
| 82 | +#define LEP_OLIVETTI 26 |
| 83 | +#define LEP_ORIC 27 |
| 84 | +#define LEP_PHILIPS 28 |
| 85 | +#define LEP_PROTEUS_INTERNATIONAL 29 |
| 86 | +#define LEP_SANYO 30 |
| 87 | +#define LEP_SEGA 31 |
| 88 | +#define LEP_SHARP 32 |
| 89 | +#define LEP_SINCLAIR 33 |
| 90 | +#define LEP_SMT 34 |
| 91 | +#define LEP_SORD 35 |
| 92 | +#define LEP_SPECTRAVIDEO 36 |
| 93 | +#define LEP_TANDY 37 |
| 94 | +#define LEP_TEXAS_INSTRUMENTS 38 |
| 95 | +#define LEP_THOMSON 39 |
| 96 | +#define LEP_VIDEO_TECHNOLOGY 40 |
| 97 | + |
| 98 | +// Family |
| 99 | +// 0 LEP_DEFAULT |
| 100 | +// 1..127 brand |
| 101 | +// 128..255 multi brands families |
| 102 | +#define LEP_MSX1 128 |
| 103 | +#define LEP_MSX2 129 |
| 104 | +#define LEP_MSX2PLUS 130 |
| 105 | + |
| 106 | +// Amstrad |
| 107 | +#define LEP_CPC464 (1 << 0) |
| 108 | +#define LEP_CPC664 (1 << 1) |
| 109 | +#define LEP_CPC6128 (1 << 2) |
| 110 | +#define LEP_464PLUS (1 << 3) |
| 111 | +#define LEP_6128PLUS (1 << 4) |
| 112 | + |
| 113 | +// Thomson |
| 114 | +#define LEP_MO 1 |
| 115 | +#define LEP_TO 2 |
| 116 | + |
| 117 | +// MO |
| 118 | +#define LEP_MO5 (1 << 0) |
| 119 | +#define LEP_MO6 (1 << 1) |
| 120 | + |
| 121 | +// TO |
| 122 | +#define LEP_TO7 (1 << 0) |
| 123 | +#define LEP_TO7_16K (1 << 1) |
| 124 | +#define LEP_TO770 (1 << 2) |
| 125 | +#define LEP_TO770_64K (1 << 3) |
| 126 | +#define LEP_TO8 (1 << 4) |
| 127 | +#define LEP_TO8_256K (1 << 5) |
| 128 | +#define LEP_TO8D (1 << 6) |
| 129 | +#define LEP_TO8D_256K (1 << 7) |
| 130 | +#define LEP_TO9 (1 << 8) |
| 131 | +#define LEP_TO9_64K (1 << 9) |
| 132 | +#define LEP_TO9PLUS (1 << 10) |
| 133 | + |
| 134 | +#endif /* LEP_H */ |
0 commit comments