• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

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


Commit MetaInfo

Révisionad8027459894b28f3d20f0a15e4e987977a7cf26 (tree)
l'heure2021-01-14 14:01:27
AuteurK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Message de Log

[VM][FMTOWNS][CDROM] Falldown intr even stat_reply_intr (04C2:bit6) == 0 on MCU interrupt.

[VM][FMTOWNS][CDROM] Reply error when reading beyond track on READ_SECTOR.

Change Summary

Modification

--- a/source/src/vm/fmtowns/cdrom.cpp
+++ b/source/src/vm/fmtowns/cdrom.cpp
@@ -211,6 +211,9 @@ void TOWNS_CDROM::set_mcu_intr(bool val)
211211 write_mcuint_signals((val) ? 0xffffffff : 0);
212212 } else {
213213 mcu_intr = val;
214+ if(!(val)) {
215+ write_mcuint_signals(0);
216+ }
214217 }
215218 }
216219
@@ -700,6 +703,7 @@ void TOWNS_CDROM::write_dma_io8(uint32_t addr, uint32_t data)
700703 void TOWNS_CDROM::read_cdrom()
701704 {
702705 // read_pos = 0;
706+ databuffer->clear();
703707 if((cdda_status != CDDA_OFF) && (cdda_status != CDDA_ENDED)) {
704708 // @note In SUPER REAL MAHJONG PIV, use PAUSE (A5h) command before reading.
705709 // @note 20201110 K.O
@@ -747,7 +751,7 @@ void TOWNS_CDROM::read_cdrom()
747751 status_parameter_error(false);
748752 return;
749753 }
750- databuffer->clear();
754+// databuffer->clear();
751755 cdrom_debug_log(_T("READ_CDROM TRACK=%d LBA1=%d LBA2=%d M1/S1/F1=%02X/%02X/%02X M2/S2/F2=%02X/%02X/%02X PAD=%02X DCMD=%02X"), track, lba1, lba2,
752756 param_queue[0], param_queue[1], param_queue[2],
753757 param_queue[3], param_queue[4], param_queue[5],
@@ -766,6 +770,7 @@ void TOWNS_CDROM::read_cdrom()
766770 // Kick a first
767771 double usec = get_seek_time(lba1);
768772 status_seek = true;
773+ if(usec < 1100.0) usec = 1100.0;
769774 register_event(this, EVENT_CDROM_SEEK_COMPLETED, usec, false, &event_seek_completed);
770775 if(req_status) {
771776 // May not need extra status, integrated after reading. 20200906 K.O
@@ -1985,11 +1990,8 @@ double TOWNS_CDROM::get_seek_time(uint32_t lba)
19851990 } else {
19861991 distance = abs((int)lba - (int)(cur_position / ((is_iso) ? 2048 : physical_block_size())));
19871992 }
1988-// if(distance < 100) {
1989-// distance = 100; // Seek penalty.
1990-// }
1991- if(distance < 4) {
1992- distance = 4; // Seek penalty.
1993+ if(distance < 0) {
1994+ distance = 0; // Seek penalty.
19931995 }
19941996 double _seek = (double)distance / 333000.0 ; // 333000: sectors in media
19951997 _seek = 400.0e3 * _seek;
@@ -2088,9 +2090,10 @@ bool TOWNS_CDROM::seek_relative_frame_in_image(uint32_t frame_no)
20882090 FILEIO_SEEK_SET) != 0) {
20892091 return false;
20902092 }
2093+ return true;
20912094 }
20922095 }
2093- return true;
2096+ return false;
20942097 }
20952098
20962099
@@ -3161,8 +3164,12 @@ void TOWNS_CDROM::write_io8(uint32_t addr, uint32_t data)
31613164 }
31623165 break;
31633166 case 0x04: // Param
3164- param_queue[param_ptr] = data;
3165- param_ptr = (param_ptr + 1) & 0x07;
3167+// param_queue[param_ptr] = data;
3168+// param_ptr = (param_ptr + 1) & 0x07;
3169+ for(int xx = 1; xx < 8; xx++) {
3170+ param_queue[xx - 1] = param_queue[xx];
3171+ }
3172+ param_queue[7] = data;
31663173 break;
31673174 case 0x06:
31683175 if((data & 0x08) != 0) {
Afficher sur ancien navigateur de dépôt.