OSDN Git Service

[VM][MB8877][DISK] Fix not apply workaround to Gambler Jiko Chusin-ha for FM-7 series.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Tue, 13 Jun 2017 17:08:05 +0000 (02:08 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Tue, 13 Jun 2017 17:08:05 +0000 (02:08 +0900)
source/src/vm/device.h
source/src/vm/disk.cpp
source/src/vm/mb8877.cpp

index 0166c21..f84a837 100644 (file)
@@ -84,7 +84,7 @@ public:
        // destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]".
        ~DEVICE(void) {}
        
-       virtual void initialize() {     osd = emu->get_osd(); /* Initializing VM must be after initializing OSD. */ }
+       virtual void initialize() {     /* osd = emu->get_osd(); */ /* Initializing VM must be after initializing OSD. */ }
        virtual void release() {}
        
        virtual void update_config() {}
index 4b560cb..c7da377 100644 (file)
@@ -396,15 +396,38 @@ void DISK::open(const _TCHAR* file_path, int bank)
                                // 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;
                                                        }
@@ -448,8 +471,8 @@ void DISK::open(const _TCHAR* file_path, int bank)
                                                        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
@@ -476,8 +499,8 @@ void DISK::open(const _TCHAR* file_path, int bank)
                                                        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
index a21d553..ece5efe 100644 (file)
@@ -86,7 +86,8 @@ void MB8877::register_drq_event(int bytes)
 //#if defined(_FM7) || defined(_FM8) || defined(_FM77_VARIANTS) || defined(_FM77AV_VARIANTS)
        if(type_fm7) {
                if((disk[drvreg]->is_special_disk == SPECIAL_DISK_FM7_GAMBLER) ||
-                  (disk[drvreg]->is_special_disk == SPECIAL_DISK_FM77AV_PSYOBLADE)) {
+                  (disk[drvreg]->is_special_disk == SPECIAL_DISK_FM77AV_PSYOBLADE) ||
+                  (config.correct_disk_timing[drvreg])) {
                        usec = 4;
                }
        }