@ -117,7 +117,7 @@ function freecache()
end
end
function checkcache ( no )
function checkcache ( no )
for i = 1 , # cache do
for i = 1 , # cache do
if cache [ i ] . no == no then
if cache [ i ] . no == no and cache [ i ] . page ~= nil then
print ( " cache hit: slot= " .. i .. " page= " .. no )
print ( " cache hit: slot= " .. i .. " page= " .. no )
return i
return i
end
end
@ -216,13 +216,12 @@ function modify_gamma(offset)
if gamma == - 1 then
if gamma == - 1 then
gamma = 1
gamma = 1
end
end
print ( " modify_gamma slot= " .. slot .. " gamma= " .. gamma .. " offset= " .. offset )
local no = cache [ slot ] . no
print ( " modify_gamma " .. no .. " slot= " .. slot .. " gamma= " .. gamma .. " offset= " .. offset )
gamma = gamma + offset ;
gamma = gamma + offset ;
cache [ slot ] . dc : setGamma ( gamma ) ;
optarg [ " G " ] = gamma ; -- for next page
optarg [ " G " ] = gamma ; -- for next page
cache [ slot ] . page : draw ( cache [ slot ] . dc , cache [ slot ] . bb , 0 , 0 )
freecache ( )
fb : blitFullFrom ( cache [ slot ] . bb )
goto ( no )
fb : refresh ( 0 )
end
end
function mainloop ( )
function mainloop ( )