dma testing codes ('fox.bytes' comes from the assets dir)

This commit is contained in:
minjaesong
2021-10-16 15:53:16 +09:00
parent 96730145e7
commit 47736212d3
2 changed files with 40 additions and 0 deletions

20
assets/disk0/dmatest.js Normal file
View 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
}