Play CDDA track
This commit is contained in:
20
include/PSX/Audio/CDDA.hpp
Normal file
20
include/PSX/Audio/CDDA.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include "../jabyengine_defines.hpp"
|
||||
|
||||
namespace JabyEngine {
|
||||
namespace CDDA {
|
||||
struct TrackList {
|
||||
uint8_t first_track;
|
||||
uint8_t last_track;
|
||||
|
||||
static constexpr TrackList empty() {
|
||||
return TrackList{.first_track = 0, .last_track = 0};
|
||||
}
|
||||
};
|
||||
|
||||
TrackList get_tracks();
|
||||
|
||||
void play(uint8_t track);
|
||||
void stop();
|
||||
}
|
||||
}
|
@@ -153,10 +153,12 @@ namespace JabyEngine {
|
||||
|
||||
static constexpr Desc GetStat{0x01, Interrupt::Type::Acknowledge};
|
||||
static constexpr Desc SetLoc{0x02, Interrupt::Type::Acknowledge};
|
||||
static constexpr Desc Play{0x03, Interrupt::Type::Acknowledge};
|
||||
static constexpr Desc ReadN{0x06, Interrupt::Type::DataReady};
|
||||
static constexpr Desc Pause{0x09, Interrupt::Type::Complete};
|
||||
static constexpr Desc Init{0x0A, Interrupt::Type::Complete};
|
||||
static constexpr Desc SetMode{0x0E, Interrupt::Type::Acknowledge};
|
||||
static constexpr Desc GetTN{0x13, Interrupt::Type::Acknowledge};
|
||||
};
|
||||
|
||||
static constexpr auto IORegister1Adr = 0x1F801801;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "ioport.hpp"
|
||||
#include <limits.hpp>
|
||||
|
||||
namespace JabyEngine {
|
||||
namespace SPU_IO {
|
||||
@@ -156,6 +157,10 @@ namespace JabyEngine {
|
||||
__declare_io_port_w_type(inline, Adr, WorkAreaAdr, 0x1F801DA2);
|
||||
};
|
||||
|
||||
static constexpr SimpleVolume operator""_vol(long double fraction) {
|
||||
return {static_cast<int16_t>(static_cast<long double>(I16_MAX)*fraction)};
|
||||
}
|
||||
|
||||
__declare_io_port(, ControlRegister, 0x1F801DAA);
|
||||
__declare_io_port(, DataTransferControl, 0x1F801DAC);
|
||||
__declare_io_port(, PMON, 0x1F801D90);
|
||||
|
Reference in New Issue
Block a user