mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-14 06:56:05 +09:00
TAV: video with TAD audio playback
This commit is contained in:
@@ -107,10 +107,11 @@ class AudioJSR223Delegate(private val vm: VM) {
|
||||
|
||||
fun tadIsBusy() = getFirstSnd()?.mmio_read(44L)?.toInt() == 1
|
||||
|
||||
fun tadUploadDecoded(playhead: Int) {
|
||||
fun tadUploadDecoded(playhead: Int, sampleLength: Int) {
|
||||
if (sampleLength > 32768) throw Error("Sample size too long: expected <= 32768, got $sampleLength")
|
||||
getFirstSnd()?.let { snd ->
|
||||
val ba = ByteArray(65536) // 32768 samples * 2 channels
|
||||
UnsafeHelper.memcpyRaw(null, snd.tadDecodedBin.ptr, ba, UnsafeHelper.getArrayOffset(ba), 65536)
|
||||
val ba = ByteArray(sampleLength * 2) // 32768 samples * 2 channels
|
||||
UnsafeHelper.memcpyRaw(null, snd.tadDecodedBin.ptr, ba, UnsafeHelper.getArrayOffset(ba), sampleLength * 2L)
|
||||
snd.playheads[playhead].pcmQueue.addLast(ba)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6691,7 +6691,7 @@ class GraphicsJSR223Delegate(private val vm: VM) {
|
||||
dbgOut["qY"] = qYGlobal
|
||||
dbgOut["qCo"] = qCoGlobal
|
||||
dbgOut["qCg"] = qCgGlobal
|
||||
dbgOut["frameMode"] = "G"
|
||||
dbgOut["frameMode"] = " "
|
||||
|
||||
val gpu = (vm.peripheralTable[1].peripheral as GraphicsAdapter)
|
||||
|
||||
|
||||
@@ -89,8 +89,8 @@ internal class UnsafePtr(pointer: Long, allocSize: Long, private val caller: Any
|
||||
//// You may break the glass and use this tool when some fucking incomprehensible bugs ("vittujen vitun bugit")
|
||||
//// appear (e.g. getting garbage values when it fucking shouldn't)
|
||||
|
||||
if (destroyed) { throw DanglingPointerException("The pointer is already destroyed ($this)") }
|
||||
if (index !in 0 until size) throw AddressOverflowException("Index: $index; alloc size: $size; pointer: ${this}\n${Thread.currentThread().stackTrace.joinToString("\n", limit=10) { " $it" }}")
|
||||
// if (destroyed) { throw DanglingPointerException("The pointer is already destroyed ($this)") }
|
||||
// if (index !in 0 until size) throw AddressOverflowException("Index: $index; alloc size: $size; pointer: ${this}\n${Thread.currentThread().stackTrace.joinToString("\n", limit=10) { " $it" }}")
|
||||
}
|
||||
|
||||
operator fun get(index: Long): Byte {
|
||||
|
||||
Reference in New Issue
Block a user