Common Source Code Project for Qt (a.k.a for FM-7).
Revision | 8be76f299aa9dd4b28ee241c7f8eb6c349dc8e37 (tree) |
---|---|
Zeit | 2017-06-14 02:08:05 |
Autor | K.Ohta <whatisthis.sowhat@gmai...> |
Commiter | K.Ohta |
[VM][MB8877][DISK] Fix not apply workaround to Gambler Jiko Chusin-ha for FM-7 series.
@@ -84,7 +84,7 @@ public: | ||
84 | 84 | // destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]". |
85 | 85 | ~DEVICE(void) {} |
86 | 86 | |
87 | - virtual void initialize() { osd = emu->get_osd(); /* Initializing VM must be after initializing OSD. */ } | |
87 | + virtual void initialize() { /* osd = emu->get_osd(); */ /* Initializing VM must be after initializing OSD. */ } | |
88 | 88 | virtual void release() {} |
89 | 89 | |
90 | 90 | virtual void update_config() {} |
@@ -396,15 +396,38 @@ void DISK::open(const _TCHAR* file_path, int bank) | ||
396 | 396 | // check first track |
397 | 397 | pair_t offset, sector_num, data_size; |
398 | 398 | offset.read_4bytes_le_from(buffer + 0x20); |
399 | + | |
399 | 400 | if(IS_VALID_TRACK(offset.d)) { |
400 | 401 | // check the sector (c,h,r,n) = (0,0,7,1) or (0,0,f7,2) |
401 | 402 | uint8_t* t = buffer + offset.d; |
402 | 403 | sector_num.read_2bytes_le_from(t + 4); |
403 | - for(int i = 0; i < sector_num.sd; i++) { | |
404 | + for(int _i = 0; _i < sector_num.sd; _i++) { | |
404 | 405 | data_size.read_2bytes_le_from(t + 14); |
405 | 406 | if(data_size.sd == 0x100 && t[0] == 0 && t[1] == 0 && t[2] == 7 && t[3] == 1) { |
406 | - static const uint8_t gambler[] = {0xb7, 0xde, 0xad, 0xdc, 0xdd, 0xcc, 0xde, 0xd7, 0xb1, 0x20, 0xbc, 0xde, 0xba, 0xc1, 0xad, 0xb3, 0xbc, 0xdd, 0xca}; | |
407 | - if(memcmp((void *)(t + 0x30), gambler, sizeof(gambler)) == 0) { | |
407 | + /* Type 1: Sec07, +$50- "1989/09/12 ... "*/ | |
408 | + static const uint8_t gamblerfm_1[] = { | |
409 | + 0x31, 0x39, 0x38, 0x39, 0x2f, 0x30, 0x39, 0x2f, | |
410 | + 0x31, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
411 | + 0x28, 0x43, 0x29, 0x47, 0x41, 0x4d, 0x45, 0x41, | |
412 | + 0x52, 0x54, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, | |
413 | + 0x20, 0x20, 0x20, 0x59, 0x45, 0x4c, 0x4c, 0x4f, | |
414 | + 0x57, 0x48, 0x4f, 0x52, 0x4e, 0x00, 0x00, 0x00, | |
415 | + 0x20, 0x20, 0x20, 0x4b, 0x4f, 0x55, 0x44, 0x41, | |
416 | + 0x4e, 0x53, 0x59, 0x41, 0x20, 0x59, 0x4f, 0x55, | |
417 | + 0x4e, 0x47, 0x2d, 0x4d, 0x41, 0x47, 0x41, 0x5a, | |
418 | + 0x49, 0x4e, 0x45, 0x00 | |
419 | + }; | |
420 | + /* Type 2: Sec07, +$30- */ | |
421 | + static const uint8_t gamblerfm_2[] = { | |
422 | + 0xb7, 0xde, 0xad, 0xdc, 0xdd, 0xcc, 0xde, 0xd7, | |
423 | + 0xb1, 0x20, 0xbc, 0xde, 0xba, 0xc1, 0xad, 0xb3, | |
424 | + 0xbc, 0xdd, 0xca | |
425 | + }; | |
426 | + if(memcmp((void *)(t + 0x50), gamblerfm_1, sizeof(gamblerfm_1)) == 0) { | |
427 | + is_special_disk = SPECIAL_DISK_FM7_GAMBLER; | |
428 | + break; | |
429 | + } | |
430 | + if(memcmp((void *)(t + 0x30), gamblerfm_2, sizeof(gamblerfm_2)) == 0) { | |
408 | 431 | is_special_disk = SPECIAL_DISK_FM7_GAMBLER; |
409 | 432 | break; |
410 | 433 | } |
@@ -448,8 +471,8 @@ void DISK::open(const _TCHAR* file_path, int bank) | ||
448 | 471 | if(memcmp((void *)(t + 0x10 + 0x60), xanadu2fm_d_1, sizeof(xanadu2fm_d_1)) == 0) { |
449 | 472 | if(memcmp((void *)(t + 0x10 + 0x70), xanadu2fm_d_2, sizeof(xanadu2fm_d_2)) == 0) { |
450 | 473 | is_special_disk = SPECIAL_DISK_FM7_XANADU2_D; |
474 | + break; | |
451 | 475 | } |
452 | - break; | |
453 | 476 | } |
454 | 477 | } else if(data_size.sd == 0x100 && t[0] == 0 && t[1] == 0 && t[2] == 8 && t[3] == 1) { |
455 | 478 | // Xanadu 1 |
@@ -476,8 +499,8 @@ void DISK::open(const _TCHAR* file_path, int bank) | ||
476 | 499 | if(memcmp((void *)(t + 0x10 + 0), xanadu1fm_d_1, sizeof(xanadu1fm_d_1)) == 0) { |
477 | 500 | if(memcmp((void *)(t + 0x10 + 0xb0), xanadu1fm_d_2, sizeof(xanadu1fm_d_2)) == 0) { |
478 | 501 | is_special_disk = SPECIAL_DISK_FM7_XANADU2_D; // Same issue as Xanadu2. |
502 | + break; | |
479 | 503 | } |
480 | - break; | |
481 | 504 | } |
482 | 505 | } else if(data_size.sd == 0x100 && t[0] == 0 && t[1] == 0 && t[2] == 1 && t[3] == 1) { |
483 | 506 | //$03 + $2D + "PSY-O-BLADE Copyright 1988 by T&E SOFT Inc." + $B6 + $FD + $05 |
@@ -86,7 +86,8 @@ void MB8877::register_drq_event(int bytes) | ||
86 | 86 | //#if defined(_FM7) || defined(_FM8) || defined(_FM77_VARIANTS) || defined(_FM77AV_VARIANTS) |
87 | 87 | if(type_fm7) { |
88 | 88 | if((disk[drvreg]->is_special_disk == SPECIAL_DISK_FM7_GAMBLER) || |
89 | - (disk[drvreg]->is_special_disk == SPECIAL_DISK_FM77AV_PSYOBLADE)) { | |
89 | + (disk[drvreg]->is_special_disk == SPECIAL_DISK_FM77AV_PSYOBLADE) || | |
90 | + (config.correct_disk_timing[drvreg])) { | |
90 | 91 | usec = 4; |
91 | 92 | } |
92 | 93 | } |