Jump to content



Photo

Bug Report


  • Please log in to reply
2 replies to this topic

#1 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 02 June 2012 - 10:46 PM

I am not sure if this happens with the real calc but with the emulator (running with WINE), I get the "Press f1 to continue..." screen but it does not respond to any keystrokes.

The only code that has made it do that so far is this:

local rect = graydraw.rect
local setColor = graydraw.setcolor
local wait = misc.wait
local line = graydraw.line
local graytext = graydraw.text

screenWidth = 128
screenHeight = 64

continue = 0
done = 0
gDoorPosition = {0,0,0}
gDoorText = {"Play", "Optn", "Help"}
gDoorActive = 1
Key = 0
key_left = 37
key_right = 40
key_exit = 36
key_shift = 41



function main()
	setColor(1)
	menu()
end

function menu()
	clear nil
	
	while done ~= 1 do
		if key(key_left) then gDoorActive = gDoorActive - 1 end
		if key(key_right) then gDoorActive = gDoorActive + 1 end
		if key(key_exit) then done = 1 end
		if key(key_shift) then selection = gDoorActive continue = 1 end
		if gDoorActive < 1 then gDoorActive = 1 end
		if gDoorActive > 3 then gDoorActive = 3 end
		
		if selection == 1 then play()
			elseif selection == 2 then optn()
			elseif selection == 3 then help()
		end
		
		selection = 0
		
		for i = 1, 3, 1 do
			if i == gDoorActive and gDoorPosition[i] < 30 then gDoorPosition[i] = gDoorPosition[i] + 1
			elseif gDoorPosition[i] > 0 then gDoorPosition[i] = gDoorPosition[i] - 1 end
		end
		
		for ix = 1, 3, 1 do
			garageDoor(ix * 35 - 20, 25, 30, 30, gDoorPosition[ix], 5, gDoorText[ix], 5)
		end 
		
		refresh
		wait(1)
	end
	
	continue = 0
end

function  garageDoor(x, y, width, height, position, panelHeight, text, margin)

	buffer = height/2
	graytext(x + margin, y + buffer, text)  --display text

	rect(x, y, x + width, y + height, 5, 5) --draw garage
	
	rect(x, y, x + width, y + height - position, 4, 0) --draw door
	
	--draw panels
	for iy = height - position, 0, -panelHeight do
		line(x, y + iy, x + width, y + iy, 4)
	end
end

function play()
	clear nil
	line(43, 0, 43, 64, 4)
	line(83, 0, 83, 64, 4)
	refresh
	
	waitKey(key_exit)
end

function optn()
	clear nil
	graytext(1, 1, "Options Menu")
	refresh
	waitKey(key_exit)
end

function help()
	clear nil
	graytext(1, 1, "How may I help you?")
	refresh
	waitKey(key_exit)
end

function bye()
	clear nil
	graytext(1, 1, "Bye!")
	refresh
	wait(100)
end

function waitKey(Key)
	while not key(Key) do wait(3) end
	wait(3)
end

main()

I think it has to do with the graydraw.line function, but am not sure.

#2 veb

veb

    Casio Fan

  • Members
  • PipPip
  • 43 posts

Posted 03 June 2012 - 10:05 AM

It is a known bug,

as a wrote in my readme, when this bug happens, there is still a key that works to leave the program (and since it is not f1, the program reset the calc and you have no problem)

I tested your code on emulator and "left" seems to work

The bug is due to the sdk of the fx9860 that doesn't compile perfectly and with some lua code you have this bug.

Edited by veb, 03 June 2012 - 10:05 AM.


#3 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 03 June 2012 - 04:40 PM

Ah, ok, understood.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users