comparison cdimage.c @ 2142:d9151d0894c7

Fix some CD-ROM emulation issues
author Michael Pavone <pavone@retrodev.com>
date Thu, 24 Mar 2022 23:43:43 -0700
parents 6d0de02a068a
children 67f20f9188b0
comparison
equal deleted inserted replaced
2141:793715149f16 2142:d9151d0894c7
122 return track; 122 return track;
123 } 123 }
124 124
125 static uint8_t fake_read(uint32_t sector, uint32_t offset) 125 static uint8_t fake_read(uint32_t sector, uint32_t offset)
126 { 126 {
127 if (!offset || (offset >= 16)) { 127 if (!offset || offset == 11 || (offset >= 16)) {
128 return 0; 128 return 0;
129 //TODO: error detection and correction bytes 129 //TODO: error detection and correction bytes
130 } else if (offset < 12) { 130 } else if (offset < 11) {
131 return 0xFF; 131 return 0xFF;
132 } else if (offset == 12) { 132 } else if (offset == 12) {
133 uint32_t minute = (sector / 75) / 60; 133 uint32_t minute = (sector / 75) / 60;
134 return (minute % 10) | ((minute / 10 ) << 4); 134 return (minute % 10) | ((minute / 10 ) << 4);
135 } else if (offset == 13) { 135 } else if (offset == 13) {