// check first track
pair_t offset, sector_num, data_size;
offset.read_4bytes_le_from(buffer + 0x20);
+
if(IS_VALID_TRACK(offset.d)) {
// check the sector (c,h,r,n) = (0,0,7,1) or (0,0,f7,2)
uint8_t* t = buffer + offset.d;
sector_num.read_2bytes_le_from(t + 4);
- for(int i = 0; i < sector_num.sd; i++) {
+ for(int _i = 0; _i < sector_num.sd; _i++) {
data_size.read_2bytes_le_from(t + 14);
if(data_size.sd == 0x100 && t[0] == 0 && t[1] == 0 && t[2] == 7 && t[3] == 1) {
- static const uint8_t gambler[] = {0xb7, 0xde, 0xad, 0xdc, 0xdd, 0xcc, 0xde, 0xd7, 0xb1, 0x20, 0xbc, 0xde, 0xba, 0xc1, 0xad, 0xb3, 0xbc, 0xdd, 0xca};
- if(memcmp((void *)(t + 0x30), gambler, sizeof(gambler)) == 0) {
+ /* Type 1: Sec07, +$50- "1989/09/12 ... "*/
+ static const uint8_t gamblerfm_1[] = {
+ 0x31, 0x39, 0x38, 0x39, 0x2f, 0x30, 0x39, 0x2f,
+ 0x31, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x28, 0x43, 0x29, 0x47, 0x41, 0x4d, 0x45, 0x41,
+ 0x52, 0x54, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x20, 0x20, 0x20, 0x59, 0x45, 0x4c, 0x4c, 0x4f,
+ 0x57, 0x48, 0x4f, 0x52, 0x4e, 0x00, 0x00, 0x00,
+ 0x20, 0x20, 0x20, 0x4b, 0x4f, 0x55, 0x44, 0x41,
+ 0x4e, 0x53, 0x59, 0x41, 0x20, 0x59, 0x4f, 0x55,
+ 0x4e, 0x47, 0x2d, 0x4d, 0x41, 0x47, 0x41, 0x5a,
+ 0x49, 0x4e, 0x45, 0x00
+ };
+ /* Type 2: Sec07, +$30- */
+ static const uint8_t gamblerfm_2[] = {
+ 0xb7, 0xde, 0xad, 0xdc, 0xdd, 0xcc, 0xde, 0xd7,
+ 0xb1, 0x20, 0xbc, 0xde, 0xba, 0xc1, 0xad, 0xb3,
+ 0xbc, 0xdd, 0xca
+ };
+ if(memcmp((void *)(t + 0x50), gamblerfm_1, sizeof(gamblerfm_1)) == 0) {
+ is_special_disk = SPECIAL_DISK_FM7_GAMBLER;
+ break;
+ }
+ if(memcmp((void *)(t + 0x30), gamblerfm_2, sizeof(gamblerfm_2)) == 0) {
is_special_disk = SPECIAL_DISK_FM7_GAMBLER;
break;
}
if(memcmp((void *)(t + 0x10 + 0x60), xanadu2fm_d_1, sizeof(xanadu2fm_d_1)) == 0) {
if(memcmp((void *)(t + 0x10 + 0x70), xanadu2fm_d_2, sizeof(xanadu2fm_d_2)) == 0) {
is_special_disk = SPECIAL_DISK_FM7_XANADU2_D;
+ break;
}
- break;
}
} else if(data_size.sd == 0x100 && t[0] == 0 && t[1] == 0 && t[2] == 8 && t[3] == 1) {
// Xanadu 1
if(memcmp((void *)(t + 0x10 + 0), xanadu1fm_d_1, sizeof(xanadu1fm_d_1)) == 0) {
if(memcmp((void *)(t + 0x10 + 0xb0), xanadu1fm_d_2, sizeof(xanadu1fm_d_2)) == 0) {
is_special_disk = SPECIAL_DISK_FM7_XANADU2_D; // Same issue as Xanadu2.
+ break;
}
- break;
}
} else if(data_size.sd == 0x100 && t[0] == 0 && t[1] == 0 && t[2] == 1 && t[3] == 1) {
//$03 + $2D + "PSY-O-BLADE Copyright 1988 by T&E SOFT Inc." + $B6 + $FD + $05