implementing 'hdk' to main system wip

This commit is contained in:
minjaesong
2025-04-21 21:16:02 +09:00
parent dd6fd24790
commit 66756b4a51
2 changed files with 73 additions and 2 deletions

View File

@@ -102,4 +102,10 @@ class DMADelegate(private val vm: VM) {
fun ramToRam(from: Int, to: Int, length: Int) {
UnsafeHelper.memcpy(vm.usermem.ptr + from, vm.usermem.ptr + to, length.toLong())
}
fun strToRam(str: String, to: Int, srcOff: Int, length: Int) {
for (i in srcOff until srcOff + length) {
vm.poke(to.toLong() + i, str[i - srcOff].code.toByte())
}
}
}