Jump to content



Photo
- - - - -

Screen Size Detection


  • Please log in to reply
5 replies to this topic

#1 3298

3298

    Casio Addict

  • Members
  • PipPipPip
  • 79 posts
  • Gender:Male
  • Location:Germany

  • Calculators:
    fx-9750G Plus
    Algebra FX 2.0 (ROM 1.03,broken)
    HP 50G

Posted 22 March 2009 - 10:50 AM

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:

[codebox]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[/codebox]

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. :(

#2 kucalc

kucalc

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1422 posts
  • Gender:Male
  • Location:USA
  • Interests:Programming: C/C++, Fortran, LISP, COBOL 85 Standard, PHP, x86 and SH3 Assembly

    Computer graphics

  • Calculators:
    fx-9860G / fx-7400G Plus / Algebra FX 2.0+ / fx-9770G / CFX-9850G / CFX-9850GB+ / TI-89 / TI-nSpire

Posted 22 March 2009 - 03:56 PM

Hello 9298 and welcome to the UCF! :D

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.

#3 3298

3298

    Casio Addict

  • Members
  • PipPipPip
  • 79 posts
  • Gender:Male
  • Location:Germany

  • Calculators:
    fx-9750G Plus
    Algebra FX 2.0 (ROM 1.03,broken)
    HP 50G

Posted 23 March 2009 - 12:23 PM

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).

#4 kucalc

kucalc

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1422 posts
  • Gender:Male
  • Location:USA
  • Interests:Programming: C/C++, Fortran, LISP, COBOL 85 Standard, PHP, x86 and SH3 Assembly

    Computer graphics

  • Calculators:
    fx-9860G / fx-7400G Plus / Algebra FX 2.0+ / fx-9770G / CFX-9850G / CFX-9850GB+ / TI-89 / TI-nSpire

Posted 01 April 2009 - 05:59 AM

If I remember correctly, MLC has it's own scroll commands. I think it would be safer to use those.

#5 3298

3298

    Casio Addict

  • Members
  • PipPipPip
  • 79 posts
  • Gender:Male
  • Location:Germany

  • Calculators:
    fx-9750G Plus
    Algebra FX 2.0 (ROM 1.03,broken)
    HP 50G

Posted 04 April 2009 - 05:19 PM

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.

#6 kucalc

kucalc

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1422 posts
  • Gender:Male
  • Location:USA
  • Interests:Programming: C/C++, Fortran, LISP, COBOL 85 Standard, PHP, x86 and SH3 Assembly

    Computer graphics

  • Calculators:
    fx-9860G / fx-7400G Plus / Algebra FX 2.0+ / fx-9770G / CFX-9850G / CFX-9850GB+ / TI-89 / TI-nSpire

Posted 04 April 2009 - 11:43 PM

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.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users