• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

Common Source Code Project for Qt (a.k.a for FM-7).


Commit MetaInfo

Revision8be76f299aa9dd4b28ee241c7f8eb6c349dc8e37 (tree)
Zeit2017-06-14 02:08:05
AutorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[VM][MB8877][DISK] Fix not apply workaround to Gambler Jiko Chusin-ha for FM-7 series.

Ändern Zusammenfassung

Diff

--- a/source/src/vm/device.h
+++ b/source/src/vm/device.h
@@ -84,7 +84,7 @@ public:
8484 // destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]".
8585 ~DEVICE(void) {}
8686
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. */ }
8888 virtual void release() {}
8989
9090 virtual void update_config() {}
--- a/source/src/vm/disk.cpp
+++ b/source/src/vm/disk.cpp
@@ -396,15 +396,38 @@ void DISK::open(const _TCHAR* file_path, int bank)
396396 // check first track
397397 pair_t offset, sector_num, data_size;
398398 offset.read_4bytes_le_from(buffer + 0x20);
399+
399400 if(IS_VALID_TRACK(offset.d)) {
400401 // check the sector (c,h,r,n) = (0,0,7,1) or (0,0,f7,2)
401402 uint8_t* t = buffer + offset.d;
402403 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++) {
404405 data_size.read_2bytes_le_from(t + 14);
405406 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) {
408431 is_special_disk = SPECIAL_DISK_FM7_GAMBLER;
409432 break;
410433 }
@@ -448,8 +471,8 @@ void DISK::open(const _TCHAR* file_path, int bank)
448471 if(memcmp((void *)(t + 0x10 + 0x60), xanadu2fm_d_1, sizeof(xanadu2fm_d_1)) == 0) {
449472 if(memcmp((void *)(t + 0x10 + 0x70), xanadu2fm_d_2, sizeof(xanadu2fm_d_2)) == 0) {
450473 is_special_disk = SPECIAL_DISK_FM7_XANADU2_D;
474+ break;
451475 }
452- break;
453476 }
454477 } else if(data_size.sd == 0x100 && t[0] == 0 && t[1] == 0 && t[2] == 8 && t[3] == 1) {
455478 // Xanadu 1
@@ -476,8 +499,8 @@ void DISK::open(const _TCHAR* file_path, int bank)
476499 if(memcmp((void *)(t + 0x10 + 0), xanadu1fm_d_1, sizeof(xanadu1fm_d_1)) == 0) {
477500 if(memcmp((void *)(t + 0x10 + 0xb0), xanadu1fm_d_2, sizeof(xanadu1fm_d_2)) == 0) {
478501 is_special_disk = SPECIAL_DISK_FM7_XANADU2_D; // Same issue as Xanadu2.
502+ break;
479503 }
480- break;
481504 }
482505 } else if(data_size.sd == 0x100 && t[0] == 0 && t[1] == 0 && t[2] == 1 && t[3] == 1) {
483506 //$03 + $2D + "PSY-O-BLADE Copyright 1988 by T&E SOFT Inc." + $B6 + $FD + $05
--- a/source/src/vm/mb8877.cpp
+++ b/source/src/vm/mb8877.cpp
@@ -86,7 +86,8 @@ void MB8877::register_drq_event(int bytes)
8686 //#if defined(_FM7) || defined(_FM8) || defined(_FM77_VARIANTS) || defined(_FM77AV_VARIANTS)
8787 if(type_fm7) {
8888 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])) {
9091 usec = 4;
9192 }
9293 }
Show on old repository browser