Skip to content

Commit

Permalink
Fix compiler errors
Browse files Browse the repository at this point in the history
  • Loading branch information
morio committed Mar 2, 2024
1 parent 22a31f3 commit ebdc2cf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
1 change: 0 additions & 1 deletion lib/ZuluSCSI_platform_RP2040/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ static uint32_t fleft;
// historical playback status information
static audio_status_code audio_last_status[8] = {ASC_NO_STATUS, ASC_NO_STATUS, ASC_NO_STATUS, ASC_NO_STATUS,
ASC_NO_STATUS, ASC_NO_STATUS, ASC_NO_STATUS, ASC_NO_STATUS};
.
// volume information for targets
static volatile uint16_t volumes[8] = {
DEFAULT_VOLUME_LEVEL_2CH, DEFAULT_VOLUME_LEVEL_2CH, DEFAULT_VOLUME_LEVEL_2CH, DEFAULT_VOLUME_LEVEL_2CH,
Expand Down
21 changes: 16 additions & 5 deletions src/ZuluSCSI_cdrom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1287,9 +1287,9 @@ static void doGetEventStatusNotification(bool immed)

void cdromGetAudioPlaybackStatus(uint8_t *status, uint32_t *current_lba, bool current_only)
{
image_config_t &img = *(image_config_t*)scsiDev.target->cfg;


#ifdef ENABLE_AUDIO_OUTPUT
image_config_t &img = *(image_config_t*)scsiDev.target->cfg;
if (status) {
uint8_t target = img.scsiId & 7;
if (current_only) {
Expand All @@ -1298,10 +1298,11 @@ void cdromGetAudioPlaybackStatus(uint8_t *status, uint32_t *current_lba, bool cu
*status = (uint8_t) audio_get_status_code(target);
}
}
*current_lba = audio_get_file_position() / 2352;
#else
if (status) *status = 0; // audio status code for 'unsupported/invalid' and not-playing indicator
#endif
*current_lba = audio_get_file_position() / 2352;

}

static void doPlayAudio(uint32_t lba, uint32_t length)
Expand Down Expand Up @@ -1436,7 +1437,7 @@ static void doMechanismStatus(uint16_t allocation_length)
uint8_t *buf = scsiDev.data;

uint8_t status;
uint32_t lba;
uint32_t lba = 0;
cdromGetAudioPlaybackStatus(&status, &lba, true);

*buf++ = 0x00; // No fault state
Expand Down Expand Up @@ -2029,8 +2030,9 @@ extern "C" int scsiCDRomCommand()
&& scsiDev.cdb[5] == 0xFF)
{
// request to start playback from 'current position'
image_config_t &img = *(image_config_t*)scsiDev.target->cfg;
#ifdef ENABLE_AUDIO_OUTPUT
lba = audio_get_file_position() / 2352;
#endif
}

uint32_t length = end - lba;
Expand Down Expand Up @@ -2175,6 +2177,15 @@ extern "C" int scsiCDRomCommand()
// Byte 5: 'F' in hex
commandHandled = 0;
}
else if (scsiDev.target->cfg->quirks == S2S_CFG_QUIRKS_APPLE
&& command == 0xD8)
{
}
else if (scsiDev.target->cfg->quirks == S2S_CFG_QUIRKS_APPLE
&& command == 0xD9)
{
}

else
{
commandHandled = 0;
Expand Down

0 comments on commit ebdc2cf

Please sign in to comment.