Author Topic: FX-cg Manager add-ins speed issues  (Read 6732 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
FX-cg Manager add-ins speed issues
« on: April 27, 2012, 03:38:56 am »
Does anyone know if it's possible to increase the speed of add-ins that we run inside the Casio PRIZM emulator? I tried running Rainbow Dash for example and the logo (Dalan Polytechnic) took about 1 minute to go through instead of like 3 seconds O.O

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: FX-cg Manager add-ins speed issues
« Reply #1 on: April 27, 2012, 04:48:14 am »
FOr emulators, you must turn off the OC...

Anyone can find a syscall who detects the model?

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: FX-cg Manager add-ins speed issues
« Reply #2 on: April 27, 2012, 11:47:22 am »
Anyone can find a syscall who detects the model?
I think it is 0x1196. int (void). This call checks, if the byte at A0000305 is 5A.

You could query the byte at A0000305 as well.
5A: cg10
AA: cg20
55: cg??
A5: cg??
« Last Edit: April 27, 2012, 12:13:22 pm by SimonLothar »
I'll be back.

Offline PierrotLL

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +2/-0
    • View Profile
Re: FX-cg Manager add-ins speed issues
« Reply #3 on: April 28, 2012, 05:36:01 am »
On the emulator, if you overclock or underclock, the result is the same, it becomes very slow.
Example with Gravity Duck :
without overclock : emulator=50FPS, calc=15FPS
with overclock : emulator=6FPS, calc=25FPS

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: FX-cg Manager add-ins speed issues
« Reply #4 on: April 28, 2012, 02:02:58 pm »
FOr emulators, you must turn off the OC...

Anyone can find a syscall who detects the model?
I never actually used overclocking, even on emulator.

Could it be that Ashbad's game automatically overclocks the calc by default?

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: FX-cg Manager add-ins speed issues
« Reply #5 on: April 29, 2012, 05:17:15 am »
Could it be that Ashbad's game automatically overclocks the calc by default?
Yes. It runs a bit slow on the default speed, so it overclocks the calc automatically and then sets the original speed when the game finishes executing (unless it's already overclocked).

Offline PierrotLL

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +2/-0
    • View Profile
Re: FX-cg Manager add-ins speed issues
« Reply #6 on: April 29, 2012, 08:25:34 am »
Yes, some games (like Rainbow Dash, Gravity Duck and Sonic) automatically overclock on start.
It would be better to detect if the program is running on emulator (maybe with Simon's proposal) and overclock only if not.

@Simon : on the emulator, syscall 0x1196 returns 0x00, but if I read directly the byte at 0xA0000305 I get 0xAA.
BTW, it's off-topic but do you know a Sleep syscall ? I think we need it, until now all games use 100% of CPU so they drain batteries. I know this function use TMU2 on fx-9860, maybe we can write an equivalent routine for Prizm.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: FX-cg Manager add-ins speed issues
« Reply #7 on: April 29, 2012, 10:26:40 am »
@Simon : on the emulator, syscall 0x1196 returns 0x00, but if I read directly the byte at 0xA0000305 I get 0xAA.
I do not own an emulator for the Prizm. On the legacy systems the emulator could be detected by query of the calculator id (at 0xA000FFD0) which has been eight zeros with the emulator. Maybe it is similar on the Prizm (with 0xA001FFD0 of course).

BTW, it's off-topic but do you know a Sleep syscall ? I think we need it, until now all games use 100% of CPU so they drain batteries. I know this function use TMU2 on fx-9860, maybe we can write an equivalent routine for Prizm.
What do you mean? A sleep function  (like the one of the legacy SDK) based on a timer does not save power. The MPU's sleep instruction does, but this is a different concept. The MPU's power saving sleep mode is entered when calling PowerOff (0x1839).
« Last Edit: April 29, 2012, 12:19:54 pm by SimonLothar »
I'll be back.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: FX-cg Manager add-ins speed issues
« Reply #8 on: April 29, 2012, 01:53:31 pm »
I see then. I guess maybe I could ask the authors if they could setup some sort of detection for if the game runs on emulator or not.

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: FX-cg Manager add-ins speed issues
« Reply #9 on: April 29, 2012, 02:01:02 pm »
Yes, some games (like Rainbow Dash, Gravity Duck and Sonic) automatically overclock on start.
It would be better to detect if the program is running on emulator (maybe with Simon's proposal) and overclock only if not.

@Simon : on the emulator, syscall 0x1196 returns 0x00, but if I read directly the byte at 0xA0000305 I get 0xAA.
BTW, it's off-topic but do you know a Sleep syscall ? I think we need it, until now all games use 100% of CPU so they drain batteries. I know this function use TMU2 on fx-9860, maybe we can write an equivalent routine for Prizm.

Like the FXes Model detection syscall, the emulator yields 0x00...
Could be this a good start?
If someone could get me a confirmation, I'll expad my model detection routine

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: FX-cg Manager add-ins speed issues
« Reply #10 on: April 30, 2012, 11:18:25 am »
Like the FXes Model detection syscall, the emulator yields 0x00...
Could be this a good start?
If someone could get me a confirmation, I'll expad my model detection routine
Detecting the model and detecting the emulator are two totally different approaches.
It is the job of the emulator to pretend being a certain model, t. i. obviously a fxCG20, hence you cannot detect the emulator by querying the model (provided the emulator is designed by a pro).
On a fxCG20 0x1196 returns 0 (A0000305 not being 5A) and on a fxCG10 it returns 1 (A0000305 being 5A).
There seem to exist (or will exist someday) two other CG-models (A5 and 55; according to A0000305). At least the OS and rumors point to this.
I recommend to try the eight bytes at A001FFD0 to detect the Prizm emulator. Please report, which calculator ID the Prizm emulator happens to has.
I'll be back.