Mercurial > repos > blastem
comparison lc8951.c @ 2080:bafb757e1cd2
Implement CD audio
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 02 Feb 2022 01:10:07 -0800 |
parents | c69e42444f96 |
children | bb478feccca2 |
comparison
equal
deleted
inserted
replaced
2079:5a2b759f6b2d | 2080:bafb757e1cd2 |
---|---|
147 //context->decode_end = context->cycle + 2352 * context->clock_step * 4; | 147 //context->decode_end = context->cycle + 2352 * context->clock_step * 4; |
148 break; | 148 break; |
149 case RESET: | 149 case RESET: |
150 context->comin_count = 0; | 150 context->comin_count = 0; |
151 context->regs[IFSTAT] = 0xFF; | 151 context->regs[IFSTAT] = 0xFF; |
152 context->ifctrl = 0; | |
153 context->ctrl0 = 0; | |
154 context->ctrl1 = 0; | |
152 break; | 155 break; |
153 default: | 156 default: |
154 break; | 157 break; |
155 } | 158 } |
156 if (context->ar != SBOUT) { | 159 if (context->ar != SBOUT) { |
275 if (context->ctrl0 & BIT_WRRQ) { | 278 if (context->ctrl0 & BIT_WRRQ) { |
276 uint16_t block_start = current_write_addr - 2352; | 279 uint16_t block_start = current_write_addr - 2352; |
277 context->regs[PTL] = block_start; | 280 context->regs[PTL] = block_start; |
278 context->regs[PTH] = block_start >> 8; | 281 context->regs[PTH] = block_start >> 8; |
279 } | 282 } |
280 printf("Decoding block starting at %X\n", context->regs[PTL] | (context->regs[PTH] << 8)); | 283 printf("Decoding block starting at %X (WRRQ: %d)\n", context->regs[PTL] | (context->regs[PTH] << 8), !!(context->ctrl0 & BIT_WRRQ)); |
281 //TODO: Datasheet has some hints about how long decoding takes in the form of how long DECI is asserted | 284 //TODO: Datasheet has some hints about how long decoding takes in the form of how long DECI is asserted |
282 context->decode_end = context->cycle + 2352 * context->clock_step * 4; | 285 context->decode_end = context->cycle + 2352 * context->clock_step * 4; |
283 } | 286 } |
284 } | 287 } |
285 if (sector_offset >= 12 && sector_offset < 16) { | 288 if (sector_offset >= 12 && sector_offset < 16) { |