Full Version: Screen Size Detection
3298
I'm writing a game in MLC and this game shall automatically detect the screen dimensions of the calculator it is running on. But I don't know if my method gives errors or wrong results on other calculators (on AFX it is running fine). This is my routine for horizontal detection:

CODE
MLC:
%TMP=.0
#FRUN AUTOD
#FEND
#FNCT AUTOD
#PIXL .0 %TMP .2
#PIXT .0 %TMP %TMP2
%TMP=%TMP+.1
#IIFF TMP2=.2
#FGOB
%WIDTH=%TMP-.1
#FEND


For vertical detection I use a similar routine.

Do MLC interpreters on some calculators store the color of pixels outside the visible screen? On these calculators my game would probably hang up. sad.gif

kucalc
Hello 9298 and welcome to the UCF! biggrin.gif

There is currently no command for detecting screen sizes. However, I think it would be safe to assume that other calculators support 128x64, which is what resolution the AFX has.
3298
Can my detection routine be run on all MLC interpreters without any problems?

The game I'm writing is a bomberman game, so the automatical screen size detection is needed because the characters should be seen by the players who are controlling them (the game currently has many bugs, so I will need some time to find and correct them, but when I'm ready, I'll upload it to the filesharing).

kucalc
If I remember correctly, MLC has it's own scroll commands. I think it would be safer to use those.
3298
I don't want to scroll around in the field, because there shall be at least two characters which are controlled by human players (a character controlled by the calculator would probably slow down the game and it would be bigger than 11 KB). But these characters shall be visible everywhere, so if one of them is in the top left corner and the other one is in the bottom right corner, screen scrolling wouldn't help. I could divide the screen, but then I would have to write my own (space wasting) screen scrolling routines which only scroll parts of the screen, and the MLC online documentation says that MLC programs shouldn't be bigger than 11 KB. 

The only thing I want to know is if the detection routine works on all MLC interpreters. It shall help the user to find the best size of the field. I could test it on AFX (works well) and 9860 (my brother has one, but he didn't try the routine till now) only.

kucalc
I don't know if it works on the fx-9860G. I don't really use my fx-9860G that much anymore. See if you brother can get it to work. If it doesn't work on the fx-9860G, then I may need to fix something.

Also, the 11KB thing would be a problem.

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.