LoginLogin

How do you get the screen mode from XSCREEN?

Root / Programming Questions / [.]

PlancakeCreated:
I've been trying to get the value from XSCREEN to put into a variable, but nothing seems to work. This is what I'm getting (comments are the output):
XSCREEN OUT A
'Illegal function call(XSCREEN)
XSCREEN 4
A = XSCREEN
PRINT A
'0
As you can see, the variable A should be 4, but it stays as 0 for some reason. Is there another way to get the current screen mode, or is it not possible to do this?


Also, it's important to know that variables aren't related to functions with the same name.

Thanks for helping out, I'm trying to make an input recorder that can be used in any game, and I just wanted to support games that use XSCREEN, but it looks like it's not possible.

Thanks for helping out, I'm trying to make an input recorder that can be used in any game, and I just wanted to support games that use XSCREEN, but it looks like it's not possible.
I know you're thinking it's impossible, but you could do multiple things here:
  • Create a different version of your program for every XSCREEN mode
  • Parse through the program first and add an XSCREEN = M after every XSCREEN assignment where M is the mode
  • Ignore XSCREEN assignments and only support the good mode (3)

I don't think it's too much work to just require the user to insert a custom function after every XSCREEN change, especially since you're only going to use XSCREEN once anyway.
XSCREEN 4
SET_XSCREEN 4

in your library:
COMMON DEF SET_XSCREEN mode
 'do whatever
END