Author Topic: Casio Prizm documentation  (Read 236340 times)

0 Members and 1 Guest are viewing this topic.

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Casio Prizm documentation
« Reply #450 on: February 24, 2011, 05:00:57 pm »
This is no bug: http://ourl.ca/9028/177703
Please be a bit more careful before declaring everything as a bug or glitch.
I don't think m1ca4 even declared a bug. He was referring to an issue we have been having with OS versions. As far as we know, there are actually two versions of  OS 01.02.0200.  Make sure you fully read over posts first.

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 m1ac4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 106
  • Rating: +8/-0
    • View Profile
Re: Casio Prizm documentation
« Reply #451 on: February 24, 2011, 07:49:50 pm »
This whole multiple OSes problem is very confusing.  I figured since Casio wanted some concrete proof of these issues then I would provide some information that I had just discovered that may or may not help out.

While I'm at it, I found some more interesting information while browsing my calculator's memory.
Starting at 0x801091E0 there are what look like most, if not all, of the messages that you will see when using the calculator.  There are a lot of different things here but notice all of the references to SD cards.  It looks like the OS has built in SD card support based on what I see in this area.  (See also 0x8000F210.  This section deals with some OS error and has the user insert a SD card to update the OS, among other things)

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 #452 on: February 24, 2011, 07:51:38 pm »
If you'll notice, there's also NOR ROM flashing. That's a part of test mode, so I suspect that the SD card can be accessed in diagnostics mode. There are a few other things in the OS I'll let you find  ;)

However, the OS update is not a part of the SD card support. That section deals with the text that is displayed under certain circumstances. Nearby phrases don't necessarily have much relation.
« Last Edit: February 24, 2011, 07:52:55 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline m1ac4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 106
  • Rating: +8/-0
    • View Profile
Re: Casio Prizm documentation
« Reply #453 on: February 24, 2011, 08:11:18 pm »
If you'll notice, there's also NOR ROM flashing. That's a part of test mode, so I suspect that the SD card can be accessed in diagnostics mode. There are a few other things in the OS I'll let you find  ;)
Things like SD card formatting, key logging/playback and some tutorial that you can enable or disable at your pleasure?
Nearby phrases don't necessarily have much relation.
Yeah, I figured that out real quick.  Trying to follow that is a bit hard at first.

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 #454 on: February 24, 2011, 08:12:22 pm »
Quote from: Casio
Thank you so much sending e-mail for your precious opinion and suggestion.

We have already transferred your message to our R&D section and asked them to consider seriously in this regard.
However, we regret to say that we have no schedule and no plan to release SDK for Prizm as we said previous reply as of now.

Regarding slow speed of the BASIC language and glitches in the OS, it seems there are some differences of recognition each other.
Therefore, we would highly appreciate it if you kindly point it out concretely with some examples and the we would like to look into it based your information.

Sincerely yours,

Well well. It looks like Casio really does care.  :angel: They will even let us talk to the dev team. I'm hoping with further email between us and Casio the bugs can get ironed out and maybe even some future dev tools could be added later.
Actually on my side I got a response saying they spotted the glitches and will tell the japan dev team to fix them, but they have no schedule on when the new OS will come out.

This is no bug: http://ourl.ca/9028/177703
Please be a bit more careful before declaring everything as a bug or glitch.
Try to not be rude to other people when calling them out, though. Everyone can do mistakes.
There are a few other things in the OS I'll let you find  ;)
pr0n? O.O

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 #455 on: February 24, 2011, 08:13:40 pm »
Maybe...

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

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Casio Prizm documentation
« Reply #456 on: February 24, 2011, 09:27:01 pm »
Maybe...

>_>
<_<
Man, I knew CASIO was better than TI, but this is awesome! j/k

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 #457 on: February 24, 2011, 09:29:32 pm »
</censored joke about the dev team enjoying bug fixes>
« Last Edit: February 24, 2011, 09:29:45 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #458 on: February 25, 2011, 01:08:38 am »
Ok, so it look like the 7720/7721 architecture...
A very important and valuable hint, THX. Perhaps they changed to the 7720, because it contains a LCD-controller...

BTW a correction: of course, the RTC base-address is h'A413FEC0. I missed a little add #-h'1C....
I'll be back.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #459 on: February 25, 2011, 04:02:26 pm »
However, I know the keyboard is connected to :
"input" (column selection I guess) from PTP0 to PTP6 (7 column, similar to the fx9860 keyboard)
"output" (row?) from PTM0 to PTM5 and from PTN0 to PTN5 (12 row, similar to the fx9860 keyboard too)
I could not verify this, sry.
What I found is the following:
the keyboard matrix is represented by the word-registers
h'A44B0000, h'A44B0002, h'A44B0004, h'A44B0006, h'A44B0008, h'A44B000A.
Every single bit seems to be directly connected to a key.
So there is no matrix-scanning any more.
Every byte represents a row (exception as always: AC/ON).
Another great benefit compared to the legacy systems: you can detect any key-combination at a time!
I will add a keyboard-port-view-option in the next version of insight.g3a to visualize the key-to-bit relation.

EDIT:
On th fx-9860 there are the contacts (P103) and (P104) (on the PCB), which are integrated in the keyboard matrix. They are used to invoke some diagnostic mode and the os update.

On the fxCG's PCB we have the contacts (1), (2) and (3). These are integrated in the keyboard as well.
F. i. (3) invokes the os update.

(1) = h'0800 (port h'A44B000A)
(2) = h'0400 (port h'A44B000A)
(3) = h'0200 (port h'A44B000A)

BTW: (P301) does not seem to be integrated in the keyboard.
« Last Edit: February 25, 2011, 05:30:02 pm by SimonLothar »
I'll be back.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #460 on: February 26, 2011, 03:34:29 am »
Someone PMed and asked me to provide for a syscall tutorial.
I don't know, how detailed it has to be. So, the short form for a start.

F. i. GetKey, the blocking keyboard read function:

interface: int GetKey( int*keycode );
For details of GetKey refer to fx-9860G Libraries.pdf, which is included in the fx-9860G SDK.

On the fx-CG the underlying syscall is 0x0EAB.
Implementation as inline code for the use in assembler:
Code: [Select]
   add    #-4, r15    ; create local workspace
    mov.l #h'0EAB, r0    ; 0x0EAB waits, until a key is pressed (blocking)
    mov.l #h'80020070, r2
    jsr @r2
    mov    r15, r4    ; pass the parameter *keycode
    mov    @r15, r4     ; copy keycode* to r4 for further processing
    add    #4, r15    ; free local workspace
Implementation as assembler-function for the use in C/C++:
Code: [Select]
   .export _GetKey
_GetKey:
    mov.l #h'0EAB, r0
    mov.l #h'80020070, r2
    jmp @r2    ; mind the difference between jsr (see above) and jmp!
    nop          ; edited
Mind to precede the function name with an underscore. When calling from out of C/C++ the underscore must be omitted.
If you use a syscall inside of an assembler program, you have to setup the parameter-frame yourself.
The C/C++-compilers provide for that automatically.
The parameter passing in SuperH systems is documented in f. i. SHC Manual.PDF, which is included in the fx-9860G SDK.
If you want to build a syscall library, the following MACRO could be of help:
Code: [Select]
.MACRO BIOS_JUMP FUNO, SYSCALLNAME, TAIL=nop
    .export \SYSCALLNAME'
\SYSCALLNAME'
    mov.l #h'\FUNO, r0
    mov.l #H'80020070, r2
    jmp @r2
    \TAIL'
.ENDM

; so your minimum syscall library source needs one line per syscall only
BIOS_JUMP 0EAB, _GetKey
BIOS_JUMP 18F9, _PrintXY
BIOS_JUMP 0272, _Bdisp_AllCr_VRAM
BIOS_JUMP 025F, _Bdisp_PutDisp_DD
BIOS_JUMP 1348, _WordToHex
the interfaces:
void PrintXY( int x, int y, char*string, int mode, int color );
    x and y in text-cursor coordinates;
    the first two chars of *string are ignored (the reason of which will be unravelled later, hopefully)
    mode (bit-field) = 1: writes the string in reverse
    mode (bit-field) = 0x20: does not overwrite the background
    color=0: black; color=1: blue; color=2: green; color=3: cyan; color=4: red; color=5: magenta; color=6: yellow; color=7: none
void Bdisp_AllCr_VRAM( void );
void Bdisp_PutDisp_DD( void );
void WordToHex( unsigned short value, unsigned char*buffer );
    value: value to convert into a displayable 4-char hex-string
    buffer: buffer to receive the string (size 5)
The use of PrintXY inside of an assembler source is a bit complicated:
Code: [Select]
   mov.w #h'00, r5
    mov.l r5, @-r15 ; the 5th parameter has to be passed on the stack
    mov #4, r5 ; y
    mov.l #XTEST, r6    ; this would be the pointer to a string
    mov #5, r4 ; x
    mov.l #h'18F9, r0
    mov.l #h'80020070, r2
    jsr @r2
    mov #h'00, r7 ; deletes the background
    add #4, r15    ; readjust the stack due to the 5th parameter


; example source: this code has been assembled, linked and successfully run on a fxCG 20!

Code: [Select]
   .MACRO BIOS_JSR FUNO, TAIL=nop
    mov.w #h'\FUNO', r0
    mov.l #h'80020070, r2
    jsr @r2
    \TAIL'
    .ENDM

LOCAL_WORKSPACE .EQU h'1000

program_entry:
; start of a minimum syscall tutorial example
    mov.l r14, @-r15 ; the amount of registers to push onto the stack depends on the requirements of the function
; always be sure to push any of R8..R14, which the function uses.
    mov.l r13, @-r15
    mov.l r12, @-r15
    sts.l pr, @-r15
; pr should be pushed in every subroutine, even, if it does not bsr or jsr.
; the day will come, when you implement some bsr and jsr inside of the function and you forget to push pr
    mov.l #-LOCAL_WORKSPACE, r3
    add r3, r15

; at first clear the VRAM
    BIOS_JSR 0272
; transfer the VRAM to the display driver (though it is not necessary in this case, 0EAB provides for that, too)
    BIOS_JSR 025F

main_loop:
; now wait for key-input (blocking)
    add #-4, r15 ; create a local workspace
    mov r15, r4 ; setup the function's parameter: pointer to keycode
    BIOS_JSR 0EAB
    mov @r15, r13 ; save the keycode for later use
    add #4, r15 ; free the local workspace

; now you have to decide, what do do
; first we need a bit of workspace
    add #-h'10, r15
    mov r15, r12 ; save the pointer to that workspace for a rainy day
; initialize the workspace (don't care, skip it while reading)
    mov r12, r5
    mov.l #h'01010101, r0
    mov.l r0, @r5
    add #4, r5
    mov #0, r0
    mov.l r0, @r5
    add #4, r5
    mov.l r0, @r5
    add #4, r5
    mov.l r0, @r5
; now let's convert keycode to something displayable
    mov r12, r5
    add #2, r5 ; we have to skip two bytes because of a special feature of syscall 18F9
    mov r13, r4 ; fetch the previously saved keycode
    BIOS_JSR 1348 ; syscall WordToHex

; let's display the keycode
    mov.w #h'01, r5
    mov.l r5, @-r15 ; color
    mov #1, r5 ; y
    mov.l r12, r6
    mov #h'00, r7 ; deletes the background
    mov #1, r4 ; x
    BIOS_JSR 18F9
    add #4, r15 ; adjust the stack for the 5th parameter

    add #h'10, r15 ; free the workspace

    bra main_loop
    nop

; though this program won't ever quit, the proper finalization code is appended anyhow, as reference.
; BTW: h'0EAB is aware of the MENU-key, so it is not necessary to quit the program with the RESTART button
    mov.l #LOCAL_WORKSPACE, r3
    add r3, r15
    lds.l @r15+, pr
    mov.l @r15+, r12
    mov.l @r15+, r13
    rts
    mov.l @r15+, r14
; end of a minimum syscall tutorial example

« Last Edit: February 26, 2011, 06:47:10 am by SimonLothar »
I'll be back.

Offline fxdev

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 177
  • Rating: +34/-6
    • View Profile
Re: Casio Prizm documentation
« Reply #461 on: March 03, 2011, 12:38:58 pm »
The user RAM resides at:
0x882D4000..0x882E3000 (fx-CG 10/20)
0x88030A30..0x8803FC00 (fx-9860G/GII)
« Last Edit: March 03, 2011, 12:39:49 pm by cfxm »

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 #462 on: March 03, 2011, 11:53:48 pm »
Btw I didn't read the topic in a while, but are add-ins made by the community still always appearing at the same place all the time in the menu? I think I remember something about add-ins being overwritten by third-party ones. Also I think when I installed the add-in for memory viewing it erased the one by Kristaba (I think) where the screen showed the FPS and faded in/out from black to red.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #463 on: March 04, 2011, 10:48:40 am »
...but are add-ins made by the community still always appearing at the same place all the time in the menu?
No. I just loaded a second copy of insight.g3a to my Prizm, using the filename insigh2.g3a and it appeared as additional item in the menu. Different filenames give different menu items, as it is with the legacy systems.
I'll be back.

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: Casio Prizm documentation
« Reply #464 on: March 04, 2011, 10:54:40 am »
Hmm... I don't know a lot about it, but I think that would likely happen when the programmer doesn't replace 0x0EBC in the header.