Author Topic: Casio Prizm documentation  (Read 237695 times)

0 Members and 2 Guests are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Casio Prizm documentation
« Reply #405 on: February 17, 2011, 11:30:09 pm »
Is it easy to accidentally write to Flash on Casios and mess up the calc OS certificate/boot code or stuff like that? On TI calcs if you messed up your certificate you could no longer send any OS to your calc.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #406 on: February 18, 2011, 01:16:37 am »
Is it easy to accidentally write to Flash on Casios and mess up the calc OS certificate/boot code or stuff like that?
No, writing to the flash is not easy, esp. accidentally. But the main memory resides in RAM and is automatically backed up to flash by the OS, when switching off. Perhaps on the fx-CG10/20 they check for integrity before performing the automatic backup.
I'll be back.

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Casio Prizm documentation
« Reply #407 on: February 18, 2011, 02:03:16 am »
I just sent 3 massive emails to Casio (1000 char limit per email) describing all of the development current plans, (only the ones they wouldn't really oppose) requests, and glitches. One thing I did not request was an SDK because every time you send an email they always say they have no plans to release one. I did though talk about expanding development and increasing BASIC speed. I also proposed cooperating with the developers to advance the Prizm and how Western markets are dominated by TI and what needs to be done to compete against them. I'm hoping that they will end up helping us even if it is in the smallest way such as some Glitch fixes.

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Casio Prizm documentation
« Reply #408 on: February 18, 2011, 03:06:29 am »
Ok thanks for the info. On TI calcs I remember you needed to do some weird stuff to write to Flash.

Also z80man try to be careful what you ask them and what you reveal, because if you reveal that the calc is being hacked, they might just release an OS patch preventing our hacks from working.

Suggestions would be nice. One concern I have is that their calcs are so hard to find in stores. Over here until 2009 the only Casio calc available in stores was the FX-9750G, which costed $24.97 at Staples, then they disappeared from shelves. I remember back in 2002 they also had CFX calcs, a $49 calc and a few others.

Offline m1ac4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 106
  • Rating: +8/-0
    • View Profile
Re: Casio Prizm documentation
« Reply #409 on: February 18, 2011, 07:44:00 am »
It might be hard to find the calculators in stores but everyone that has seen mine has liked it (at least one person I know is going to buy one now and several others really wan't to).
If Casio wants to work to improve their product to gain customers then I will definitely work harder to help get them customers to buy it. :)

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #410 on: February 18, 2011, 09:17:26 am »
This table has several thousand entries...
I am a bit short of time, so I post my current progress with the syscalls as overview in shortform:
(MB means "multibyte" and MCS refers to the main memory)
Code: [Select]
else if ( iSyscall == 0x0031 ) name = "GetSystemSetting";
else if ( iSyscall == 0x0032 ) name = "SetSystemSetting";
else if ( iSyscall == 0x0033 ) name = "SetSystemSettingPtr";
else if ( iSyscall == 0x01E5 ) name = "GetVRAMBackgroundAddress";
else if ( iSyscall == 0x01E6 ) name = "GetVRAMAddress";
else if ( iSyscall == 0x025F ) name = "VRAMtoDD";
else if ( iSyscall == 0x0262 ) name = "PutNextYPixel";
else if ( iSyscall == 0x0263 ) name = "PutPixel";
else if ( iSyscall == 0x0266 ) name = "GetNextYPixel";
else if ( iSyscall == 0x0267 ) name = "GetPixel";
else if ( iSyscall == 0x0272 ) name = "ClearVRAM";
else if ( iSyscall == 0x02BB ) name = "DrawHeaderLine";
else if ( iSyscall == 0x0BD0 ) name = "Ly555_Table";
else if ( iSyscall == 0x0E96 ) name = "KeyMapper";
else if ( iSyscall == 0x0E97 ) name = "KeyMapper";
else if ( iSyscall == 0x0EA9 ) name = "Keyboard_PutKeycode";
else if ( iSyscall == 0x0EAA ) name = "GetKey_4";
else if ( iSyscall == 0x0EAB ) name = "GetKey";
else if ( iSyscall == 0x1161 ) name = "MB_IsLead";
else if ( iSyscall == 0x1163 ) name = "MB_ElementCount";
else if ( iSyscall == 0x1164 ) name = "MB_ByteCount";
else if ( iSyscall == 0x1166 ) name = "MB_strcat";
else if ( iSyscall == 0x1167 ) name = "MB_strncat";
else if ( iSyscall == 0x1168 ) name = "MB_strcpy";
else if ( iSyscall == 0x116C ) name = "MB_GetSecondElemPtr";
else if ( iSyscall == 0x116D ) name = "MB_GetElement";
else if ( iSyscall == 0x116E ) name = "memcmp";
else if ( iSyscall == 0x116F ) name = "Disp_strcpy";
else if ( iSyscall == 0x1171 ) name = "char_to_upper";
else if ( iSyscall == 0x1172 ) name = "char_to_lower";
else if ( iSyscall == 0x12bf ) name = "GetKeyWait";
else if ( iSyscall == 0x12c0 ) name = "GetKeyWait";
else if ( iSyscall == 0x12c6 ) name = "Keyboard_PutKeyCode";
else if ( iSyscall == 0x1514 ) name = "MCS_SearchDirectory";
else if ( iSyscall == 0x1519 ) name = "MCS_SearchDirectoryItem";
else if ( iSyscall == 0x1535 ) name = "str8cpy_with_upper_lower_mode";
else if ( iSyscall == 0x1536 ) name = "MCS_SearchItem";
else if ( iSyscall == 0x1545 ) name = "MCS_DirtypeToName";
else if ( iSyscall == 0x1561 ) name = "MCS_OpenInternalDirectoryItem";
else if ( iSyscall == 0x1633 ) name = "ItoA_10digit";
else if ( iSyscall == 0x1638 ) name = "Ly555_Table";
else if ( iSyscall == 0x18F9 ) name = "PrintXY";
else if ( iSyscall == 0x18FF ) name = "PrintPixXY";
else if ( iSyscall == 0x1a37 ) name = "GetShiftStatus";
else if ( iSyscall == 0x1a38 ) name = "ClrShiftStatus";
else if ( iSyscall == 0x1A2C ) name = "GetStackPtr";
else if ( iSyscall == 0x1A2E ) name = "SetSystemSetting";
else if ( iSyscall == 0x1A2F ) name = "GetSystemSetting";
else if ( iSyscall == 0x1d81 ) name = "DisplayStatusLine";
else if ( iSyscall == 0x1dd0 ) name = "memcpy";
else if ( iSyscall == 0x1dd1 ) name = "memcmp";
else if ( iSyscall == 0x1dd2 ) name = "Bfile_GetFilenameLength";
else if ( iSyscall == 0x1dd3 ) name = "Bfile_Name_cmp";
else if ( iSyscall == 0x1dd4 ) name = "Bfile_Name_cpy";
else if ( iSyscall == 0x1E62 ) name = "SaveVRAM_1";
else if ( iSyscall == 0x1E63 ) name = "LoadVRAM_1";
else if ( iSyscall == 0x1E82 ) name = "Ly555ptr";
else if ( iSyscall == 0x1E83 ) name = "Ly555ptr";
else if ( iSyscall == 0x1EF8 ) name = "SetBackGround";
« Last Edit: February 18, 2011, 09:20:49 am by SimonLothar »
I'll be back.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Casio Prizm documentation
« Reply #411 on: February 18, 2011, 09:30:08 am »
Quote
GetStackPtr

Um, MOV.L R15,Rn was too difficult?
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Casio Prizm documentation
« Reply #412 on: February 18, 2011, 03:04:45 pm »
Quote
GetStackPtr

Um, MOV.L R15,Rn was too difficult?
I guess its just like bcall_HLplus5 and bcall_HLplus9 in terms of pointlessness
« Last Edit: February 18, 2011, 03:05:06 pm by z80man »

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Casio Prizm documentation
« Reply #413 on: February 18, 2011, 03:25:07 pm »
Well, I can see a potential use for it if you destroy R15 (IE as in returning from add-ins, where you don't know the state of of the stack). That said, if it does what I think it does, it'd be easier just to leave R15 alone.

∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Goplat

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 289
  • Rating: +82/-0
    • View Profile
Re: Casio Prizm documentation
« Reply #414 on: February 18, 2011, 07:13:37 pm »
   else if ( iSyscall == 0x1161 ) name = "MB_IsLead";
   else if ( iSyscall == 0x1163 ) name = "MB_ElementCount";
   else if ( iSyscall == 0x1164 ) name = "MB_ByteCount";
   else if ( iSyscall == 0x1166 ) name = "MB_strcat";
   else if ( iSyscall == 0x1167 ) name = "MB_strncat";
   else if ( iSyscall == 0x1168 ) name = "MB_strcpy";
   else if ( iSyscall == 0x116C ) name = "MB_GetSecondElemPtr";
   else if ( iSyscall == 0x116D ) name = "MB_GetElement";
   else if ( iSyscall == 0x116E ) name = "memcmp";
   else if ( iSyscall == 0x116F ) name = "Disp_strcpy";
   else if ( iSyscall == 0x1171 ) name = "char_to_upper";
   else if ( iSyscall == 0x1172 ) name = "char_to_lower";
   ...
   else if ( iSyscall == 0x1dd0 ) name = "memcpy";
   else if ( iSyscall == 0x1dd1 ) name = "memcmp";
Are you sure the first one isn't some kind of strcmp? :p
Numquam te deseram; numquam te deficiam; numquam circa curram et te desolabo
Numquam te plorare faciam; numquam valedicam; numquam mendacium dicam et te vulnerabo

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #415 on: February 19, 2011, 03:45:58 am »
   else if ( iSyscall == 0x116E ) name = "memcmp";
   ...
   else if ( iSyscall == 0x1dd1 ) name = "memcmp";
Are you sure the first one isn't some kind of strcmp? :p
Yes, you are right. 0x116E is strncmp.
I'll be back.

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Casio Prizm documentation
« Reply #416 on: February 19, 2011, 03:51:36 am »
   else if ( iSyscall == 0x116E ) name = "memcmp";
   ...
   else if ( iSyscall == 0x1dd1 ) name = "memcmp";
Are you sure the first one isn't some kind of strcmp? :p
Yes, you are right. 0x116E is strncmp.
Isn't there a string compare instruction for the SH3. I think how it worked was if there were any equivalent bytes between Rm and Rn the T bit was set.

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #417 on: February 19, 2011, 06:38:57 am »
   else if ( iSyscall == 0x116E ) name = "memcmp";
   ...
   else if ( iSyscall == 0x1dd1 ) name = "memcmp";
Are you sure the first one isn't some kind of strcmp? :p
Yes, you are right. 0x116E is strncmp.
I had a closer look. 0x116E is not some str...-function, because it does not quit, when it encounters the terminating zero of the first argument (strncmp does). It always compares the required count of bytes. It is not memcmp either. The result differs from that of memcmp(0/1) and is like the result of strncmp (-1/0/1).

Code: [Select]
teststr1
.SDATA "123"
.DATA.B 0
.SDATA "1"
.DATA.B 0
teststr2
.SDATA "123"
.DATA.B 0
.SDATA "2"
.DATA.B 0

strncmp( teststr1, teststr2, 6) yields "equal".
0x116E( teststr1, teststr2, 6) yields -1 ("lower").
I'll be back.

Offline Kristaba

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 16
  • Rating: +5/-0
    • View Profile
Re: Casio Prizm documentation
« Reply #418 on: February 19, 2011, 08:06:49 am »
Impresive, you're a pretty good hacker Simon :)
I still have some questions, if you have time to answer them.
Firstly, what do you know about the G3A header checksum at the offset 0x16? Some guys say it's a CRC, but I tried a lot of CRC polynomials algorithms with different state of the file (only binaries data, only the header, with and without the other checksum, etc...) and I have no matches. So, if as I guess you know anything about it, please explain how it's computed (it's the last information I need for my G3A wrapper, I think).

Then, do you progressed about the keyboard mapping comprehension?
I wrote a FastGetKey for fx9860 (beacause the Casio's IsKeyDown was shitty and the Kucalc one was bugged), and I think it's something needed to do any good add-in (even if the GetKeyWait work well now :D).

And finally, I don't understand what the syscall you call "GetVRAMBackgroundAddress" is. There are two VRAM? So what is copied to DD when "VRAMtoDD" is called?

Thank you in advance for taking time to answer my questions, and, once more, good job!

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #419 on: February 19, 2011, 09:08:28 am »
Firstly, what do you know about the G3A header checksum...it's the last information I need for my G3A wrapper
It's the last information I do not know either. But I experienced, that it is not essential. I assembled a little memory-viewer-G3A and did not care about this field. The G3A works without any problems. But anyhow, I like to know how this value is computed, too.

Then, do you progressed about the keyboard mapping comprehension?
I wrote a FastGetKey for fx9860...
What I know is, that the keyboard-scanning is very similar to the legacy-systems, the matrix-codes are very similar, maybe identical. But I suspect, they do not use port A, B, M any more, but one of the customized (hence undocumented) ports. At present I'd rather rely on GetKeyWait as non-blocking keyboard reader. The KeyMapper syscalls 0x0E96 and 0x0E97 transfer matrixcodes to keycodes.

And finally, I don't understand what the syscall you call "GetVRAMBackgroundAddress" is. There are two VRAM? So what is copied to DD when "VRAMtoDD" is called?
The VRAMBackgroundAddress is an address inside of the VRAM. It is the address, where the background-image is copied to (immediately below the header-status-line). F. i. if you open the main menu item "Program" you see the green image of a laptop in the background. This image starts at VRAMBackgroundAddress.
VRAMtoDD transfers the whole 0x28800 VRAM to the display driver. I'll rename it to "Bdisp_PutDisp_DD".
I'll be back.