Author Topic: Casio Prizm documentation  (Read 236248 times)

0 Members and 1 Guest are viewing this topic.

Offline Kristaba

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 16
  • Rating: +5/-0
    • View Profile
Re: Casio Prizm documentation
« Reply #390 on: February 16, 2011, 12:56:22 pm »
I have the notion, that they expanded the customized part of the MPU. T. i. some ports they use, are not longer documented in Renesas documentations. This delays the meals. The first thing I want to know is how the keyboard is read. PORT A of the good old 7705 is not detectable any more.
Seriously?
What happened if you try to access to 0xA4000120? MMU error or you simply always read 0?
It would be annoying the Prizm processor isn't like a 7705, and I don't understand why Casio would do that :(
About the USB, I guess you speak about the USB protocol, but you probably can use the 7705 built-in USB features to send a ROM dump for instance, isn't it?

This is one of the projects I'd like to finish quick. At present I use the CASIO SDK assembler to program testcode. But C/C++ objects should work as well. I'd prefer C++. The result should be a G3A, of course.
Why did you use the old, buggy, and proprietary Renesas toolchain instead of GCC?
I think this is the moment to start an open SDK for the Prizm, as you wanted to do few years ago with fxsdk for fx9860...

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 #391 on: February 16, 2011, 01:04:14 pm »
By the way, does anyone have a quick bit of code to disable virtual memory for add-ins?
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Kristaba

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 16
  • Rating: +5/-0
    • View Profile
Re: Casio Prizm documentation
« Reply #392 on: February 16, 2011, 01:29:42 pm »
By the way, does anyone have a quick bit of code to disable virtual memory for add-ins?

I never played with the MMU yet, but I guess you have just to disable the MMU (through MMURC.AT bit, the last bit of the 32bit register at 0xFFFFFFE0). Set it to 0 and the MMU is disabled.
However, the Renesas documentation specify "Any program that modifies MMUCR should reside in the P1 or P2
area." (P1 is 0x80000000 to 0x9FFFFFFF address range and P2 is 0xA0000000 to 0xBFFFFFFF), so I don't know if we can easily do that...

Also, I don't understand why you want to disable the MMU. Without it, you can't know where the OS mapped your program or which range of the RAM you can safely use. And I don't see a lot of disadvantages in it

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 #393 on: February 16, 2011, 02:04:43 pm »
I've already tried resetting the last bit at FFFF FFE0, but the virtual memory is mapped in such a way that it doesn't appear to do anything.

As for why, virtual memory makes programming absolutely horrible. It screws up the hardware addresses (FRQCR anyone?) and prevents direct system access. My memory footprint is extremely small, though, so I doubt I'll run out of usable space. I'm not particularly afraid of damaging the system either, so even if I do, it's not much of a problem.

Basically, I can see little reason why you *would* want VRAM over the physical hardware. A reasonably fast program should never be executing more than a few thousand commands at a time, so having a lot of contiguous free RAM is just excessive for anything more than data.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #394 on: February 16, 2011, 02:05:49 pm »
Quote
What happened if you try to access to 0xA4000120? MMU error or you simply always read 0?
It would be annoying the Prizm processor isn't like a 7705, and I don't understand why Casio would do that.
No MMU error. I think the 7705 standard registers are still present, but 0xA4000120 is not used by the OS (at least couldn't find 0xA4000100 or 0xA4000120 in any pool of 7MB OS). The MPUs used in the fx-9860 have been customized, too (f. i. the BCD-ALU, an extra timer).  I will follow the GetKeyWait syscall to find the registers used for keyboard reading in the fx-CG20 OS.
Another hint for expanded customization is the presence of at least two new processor instructions 0x00AB and 0x0nE3 (n=register-no.), which are not documented.
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 #395 on: February 16, 2011, 02:17:37 pm »
Simon, if you'll look, many of the normal registers aren't directly addressed in the OS.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

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 #396 on: February 16, 2011, 05:00:24 pm »
be sure to introduce yourself in the introduce yourself sub-forum.
Although doing so can cause bad side effects to the person, such as his IQ either decreasing by 50 or being divided by 0, thanks to some of the content located in that forum section. In fact, for 99.9% of the forum members, their last post ever was in the intro section O.O

Anyway welcome on the forums. I unfortunately cannot help on the hacking scene but I own several Casio calculators including a Prizm (fx-CG10), so I could test softwares and the like when my time allows me to do so.
« Last Edit: February 16, 2011, 05:01:20 pm by DJ_O »

Offline bsl

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 157
  • Rating: +14/-0
    • View Profile
Re: Casio Prizm documentation
« Reply #397 on: February 17, 2011, 12:43:54 am »
The syscall table of pointers starts at 0x805edca8:
Code: [Select]
C:\casio>sh3_disass.py -s 20070 -e 20080 -p 80020070 prizm3064
Dissassembly size: 0x10
80020070: d202 ..  MOV.L @($02*4+PC),R2 = #805EDCA8
80020072: 4008 @.  SHLL2 R0           ; R0 = syscall number
80020074: 002e ..  MOV.L @(R0+R2),R0  ; load from table of pointers
80020076: 402b @+  JMP @R0 
80020078: 0009 ..  NOP
8002007A: 0000 ..  0000 ?
8002007C: 805e .^  .data 805edca8 dword ref:80020070
The actual routines are in the range : 0x8002c3dc - 0x80309030
By dumping the fx9860g ROM and binary matching the entries with the prizm ROM, many prizm syscalls can be found.
Simon might already be ahead of me on this.
This table has several thousand entries of which only a few are needed for the time being.
I think I found the BASIC parsing table - more on that later ....

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 #398 on: February 17, 2011, 12:59:42 am »
Perhaps a ROM dumping tutorial might be in order...?  ;)
∂²Ψ    -(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 #399 on: February 17, 2011, 02:15:21 am »
So if I get this right Prizm.inc can start being created. And I agree with Qwerty, how can we dump our own ram?
« Last Edit: February 17, 2011, 02:15:52 am 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 bsl

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 157
  • Rating: +14/-0
    • View Profile
Re: Casio Prizm documentation
« Reply #400 on: February 17, 2011, 02:23:48 am »
Actually , the way I am using the term here - its already dumped in prizm3064,  offset 0x2c3dc
Now get an fx9860g  OS upgrade file and decompress that - find the routines in that file and start binary
search and match between the files.

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 #401 on: February 17, 2011, 02:25:17 am »
So the physical address of location 0000 0000 in the file is 0002 C3DC?
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline bsl

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 157
  • Rating: +14/-0
    • View Profile
Re: Casio Prizm documentation
« Reply #402 on: February 17, 2011, 10:11:19 am »
Thats right , The routines are at offsets:
0x0002c3dc - 0x00309030
from the beginning of the file, if the beginning is 0x00000000
In prizm memory its:
0x8002c3dc - 0x80309030

Which means if you are disassembling prizm3064 from the beginning
of the file set the pc=0x80000000

I havent tried decompressing a fx9860g  OS upgrade file yet.



Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #403 on: February 17, 2011, 10:54:02 am »
This table has several thousand entries of which only a few are needed for the time being.
Yes, at least you need GetKey (0x0EAB; blocking keyboard read) and PrintXY(0x18F9). With ClearVRAM(0x0272), GetKeyWait(0x12bf; non-blocking keyboard read) and VRAMtoDD (0x025F) you can build quite reasonable applications.

http://casiokingdom.org/modules.php?name=Forums&file=viewtopic&p=14964#14964
I'll be back.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #404 on: February 17, 2011, 02:18:43 pm »
The main memory starts at 0x880D35D0.
Better not write into this range without knowing exactly what you do. On the fx-9860s a corrupted main memory (once saved by a normal shutdown) could block the OS to start! If you accidently should write into this range, push the reset-button. Never switch the calc off in such a case.
« Last Edit: February 17, 2011, 02:20:56 pm by SimonLothar »
I'll be back.