Author Topic: PRIZM Disassembler  (Read 34130 times)

0 Members and 4 Guests are viewing this topic.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: PRIZM Disassembler
« Reply #45 on: January 21, 2011, 03:30:44 pm »
If you've used the picture plot app and maually flip through through one of the animation pictures, the screen updates quite quickly.

Even with many colours?

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: PRIZM Disassembler
« Reply #46 on: January 21, 2011, 03:32:17 pm »
Well, the picture files are limited in color. There appears to be a color palette in the file that determines what will be displayed. Judging by the contrast, I'd say it's limited to 256 colors.
« Last Edit: January 21, 2011, 03:32:56 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: PRIZM Disassembler
« Reply #47 on: January 21, 2011, 03:42:56 pm »
Even if the image format is limited to 8 bit color, it still has to be written in 16 bit in the LCD ram. So this probaly means that the screen image is located in ram and not rom. For the LCD drawing test I'm starting at $B4000000 because that was where the lcd ram for the fx-9860g was located.

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 Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: PRIZM Disassembler
« Reply #48 on: January 21, 2011, 08:02:31 pm »
Well, the picture files are limited in color. There appears to be a color palette in the file that determines what will be displayed. Judging by the contrast, I'd say it's limited to 256 colors.

Maybe I'm reading the wrong way, but no monochrome?

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: PRIZM Disassembler
« Reply #49 on: January 21, 2011, 08:12:48 pm »
It would be possible to write a program to display monochrome images, but it would have to convert 1 to $FFFF and 0 to $0000 due to the way the lcd ram is set up.

Edit: forgot colors are reversed on the Prizm. $0000 is black and $FFFF is white
« Last Edit: January 21, 2011, 08:22:21 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 Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: PRIZM Disassembler
« Reply #50 on: January 21, 2011, 08:15:52 pm »
It would be possible to write a program to display monochrome images, but it would have to convert 1 to $FFFF and 0 to $0000 due to the way the lcd ram is set up.

So, it's not pre-included. That sucks, I love monochrome!

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: PRIZM Disassembler
« Reply #51 on: January 21, 2011, 08:23:05 pm »
Well a monochrome to 16 bit converter would be really easy to make even on SH3 asm. Also I believe that bmp file formats are supported but I need to double check that.

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: PRIZM Disassembler
« Reply #52 on: January 23, 2011, 12:06:49 am »
Here is version 003 of the CLI SH3 disassembler.
Added more of the necessary code references, for the purposes here.
Added command line options(-s (start),-e (end),-p (sets pc at the start)):
Default values:
-p=300000 program counter setting
-s=7000    file start disassembly  at 7000
-e=eof      end dissassembly at end of file

So the default :
C:\>sh3_disass_003.py -s 7000 -p 300000 Geometry.g3a  > Geometry.S
is the same as
C:\>sh3_disass_003.py  Geometry.g3a  > Geometry.S

If you dont want the crc check(4 bytes) at the end of the file you use:
:\>Prizm>sh3_disass_003.py -e -4 Geometry.g3a > Geometry.S

Also added some register bookkeeping.
I am speculating here: if you know the fx9860g ROM syscalls you already know the Prizm syscalls:
Prizm     80020070
fx9860g 80010070

I added comments to syscalls in the disassembler:
Code: [Select]
0038D110: MOV.L @($01*4+PC),R2 = #80020070
0038D112: MOV.L @($02*4+PC),R0 = #00001E56
0038D114: JMP @R2 = #80020070 ; syscall(1E56)
0038D116: NOP
0038D118: .data 80020070 dword ref:38D110
0038D11C: .data 00001e56 dword ref:38D112
0038D120:                ;code ref:370C38
0038D120: MOV.L @($01*4+PC),R2 = #80020070
0038D122: MOV.L @($02*4+PC),R0 = #0000015E
0038D124: JMP @R2 = #80020070 ; syscall(15E)
0038D126: NOP
0038D128: .data 80020070 dword ref:38D120
0038D12C: .data 0000015e dword ref:38D122
0038D130:                ;code ref:355C10
0038D130: MOV.L @($01*4+PC),R2 = #80020070
0038D132: MOV.L @($02*4+PC),R0 = #00000168
0038D134: JMP @R2 = #80020070 ; syscall(168)
0038D136: NOP

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: PRIZM Disassembler
« Reply #53 on: January 23, 2011, 12:33:57 am »
I was disassembling some code a little while ago and I noticed the fundamental problem of all disassemblers: Differentiating data and code. When you write to the WDT register, there's a very specific method of access which must be used. I managed to find a section of code that was clearly writing to the register, but it was listed as code and not data. Not a bug, just a difficulty.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: PRIZM Disassembler
« Reply #54 on: January 23, 2011, 12:38:12 am »
WDT, is that the countdown timer for after you change the clock multiplier. Becuase I think I remember seeing that in some hardware documentation for the SH3
« Last Edit: January 23, 2011, 12:38:35 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 AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: PRIZM Disassembler
« Reply #55 on: January 23, 2011, 01:03:17 am »
It's a general timer counter (Watchdog Timer Counter Register, WDTCR). One of its uses is to count the time during clock stabilization. You can use it whenever you're doing something that absolutely needs to have a way to quit.
« Last Edit: January 23, 2011, 01:03:51 am by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: PRIZM Disassembler
« Reply #56 on: February 05, 2011, 02:09:24 am »
bsl, your disassembler doesn't support output files larger than 128 MB. I found it out the hard way :P

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: PRIZM Disassembler
« Reply #57 on: February 05, 2011, 03:54:43 am »
What kind of ASM file is 128 MB large, though? O.O

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: PRIZM Disassembler
« Reply #58 on: February 05, 2011, 03:57:11 am »
The Prizm OS binary is about 12 MB. The disassembled version becomes much larger - two bytes in the binary is equal to one row of text in the disassembly.

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: PRIZM Disassembler
« Reply #59 on: February 05, 2011, 04:22:09 am »
I see. I guess I didn't realize ASM source could get this large. Plus I am used to 500-1000 KB OSes. :P