0,]']±>Sļ}W’Ķu§šp8·d%qy)6o;]ÉA¦ösļ÷ōōō”°ĀVl†3=#data[1] then addr = 0 line(0,134,239,134,0) end for ch = 0, 3 do if #data[ch+1]==0 then break end -- Currend audio chunk local chunk = data[ch+1]:sub(addr*36+1,addr*36+36) -- Sound registers local freq = tonumber(chunk:sub(2,4),16) local volume = tonumber(chunk:sub(1,1),16) poke(0x0FF9C + ch*18,freq%256) poke(0x0FF9D + ch*18,(volume<<4)+((freq>>8)&15)) -- Stereo volume poke4(0x28000 + ch*2,ch_volume[ch+1][1]) poke4(0x28001 + ch*2,ch_volume[ch+1][2]) -- Sound wave for i2 = 0,31 do local val = tonumber(chunk:sub(i2+5,i2+5),16) poke4(0x1FF3C +ch*36 + i2,val) end freq = math.floor((freq - 60)/1.8333) if volume > 1 then for i2 = -pal_size-1,pal_size+1 do local ind = freq+i2 local val = pal_size - math.abs(i2) if vals[ind] and vals[ind]<=val then vals[freq+i2]=val end end end end for x = 0, 239 do pix(x,135,pal[vals[x]]) end memcpy(0x0000,0x0000+120,16200) -- GUI vbank(1) cls(0) -- song name local str_size = print(song_name,240,0) print(song_name,120-str_size//2,127,12) -- time print(time_to_str(addr//60),1,127,12,true,1,true) str_size = print(time_to_str(song_len//60),240,0,12,true,1,true) print(time_to_str(song_len//60),240-str_size,127,12,true,1,true) --timeline rect(1,134,238,1,15) rect(1,134,(addr / song_len) * 238,1,12) if my > 132 and my < 136 and mx > 0 and mx < 239 then cid = 1 if clp then addr = math.floor((mx-1)/238*song_len) vbank(0)cls(15) end end vbank(0) poke4(0x07FF6,cid) end function SCN(scn_y) if scn_y == 0 then respal() end if scn_y == 125 then darkpal(0.5) end end