mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-11 15:24:05 +09:00
dma testing codes ('fox.bytes' comes from the assets dir)
This commit is contained in:
20
assets/disk0/dmatest.js
Normal file
20
assets/disk0/dmatest.js
Normal file
@@ -0,0 +1,20 @@
|
||||
let len = 560*448
|
||||
let pcnt = (system.maxmem() / len)|0
|
||||
if (pcnt < 2) {
|
||||
printerrln("Not enought RAM on the system to test!")
|
||||
return
|
||||
}
|
||||
let c = 0
|
||||
print("Rendering plane ")
|
||||
for (c = 0; c < pcnt; c++) {
|
||||
print(`${c} `)
|
||||
for (let i = 0; i < len; i++) {
|
||||
sys.poke(c*len + i, c * ((256/pcnt)|0) + 1)
|
||||
}
|
||||
}
|
||||
println("Let's see how fast DMA really is!")
|
||||
c = 0
|
||||
while (1) {
|
||||
dma.ramToFrame(len * c, 0, len)
|
||||
c = (c + 1) % pcnt
|
||||
}
|
||||
Reference in New Issue
Block a user