Author Topic: Compiling stuff for Prizm  (Read 75098 times)

0 Members and 1 Guest are viewing this topic.

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: Compiling stuff for Prizm
« Reply #60 on: July 08, 2011, 05:25:01 am »
When did this change? Was it when the update to 1.02.0200 happened?

EDIT: Or was this change something that was caused by the mini-SDK? I'm not sure if I understand what's going on...
« Last Edit: July 08, 2011, 05:26:08 am by JosJuice »

Offline fxdev

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 177
  • Rating: +34/-6
    • View Profile
Re: Compiling stuff for Prizm
« Reply #61 on: July 08, 2011, 06:27:15 am »
No no, it's all about Simon's mini-SDK. There are a few dependencies I have to check with each release.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Compiling stuff for Prizm
« Reply #62 on: July 08, 2011, 07:33:54 am »
...0x88160000 ... has now changed to 0xE5200000 (purpose unknown).
The mini-SDK builds two different binaries. The first one is the standard G3A (f. i. INSIGHT.G3A),
which can be copied to the calc's storage memory using USB. The static RAM of a standard G3A is a part of the external RAM virtualized to address 0x08100000 by the system, when invoking a G3A.

The second binary is a special one (f. i. INSIGHT_RAM.SH3), which can be run from RAM. I load it via 3pin, using the protocol 7.00 "Upload'n'Run"-option. This accelerates development cycles.
But this requires to find fitting RAM-gaps, which are not used by the system (at least not during program testing).
For the RAM.SH3 program I use 0x880E3000 (the end of the main memory).
As static RAM for the RAM.SH3 I used some unused part of the external RAM at first.
Then, just out of curiosity, I tried 0xE5200000, which is a 4k IL-memory of the 7305.
I like to check out available options. Probing into the unknown is one of the ways to gain knowledge.
But beware: messing around with the 7305's IL-memories can cause funny calculator behaviour.
I'll be back.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Compiling stuff for Prizm
« Reply #63 on: July 09, 2011, 03:44:47 am »
According to Simon, 0x88160000 was the bottom of the add-in stack...
I haven't been sufficiently exact with the naming. The 512 kB RAM area 0x88160000 to 0x881DFFFF should be called "add-in RAM" (I updated the documentation), because it is shared by add-in static RAM and add-in stack. The add-in static RAM starts at 0x88160000 (virtualized to 0x08100000). The add-in stack starts at 0x881E0000 and grows downwards (towards the static RAM).
When an add-in is loaded, the complete add-in RAM is virtualized in 8x64kB-chunks (0x88160000->0x08100000..0x881D0000->0x08170000), possibly allowing much more static RAM as with the legacy systems. Of course, you have to take care for the limits. Otherwise the system will do, crashing.
« Last Edit: July 09, 2011, 03:59:11 am by SimonLothar »
I'll be back.

Offline bsl

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 157
  • Rating: +14/-0
    • View Profile
Re: Compiling stuff for Prizm
« Reply #64 on: July 09, 2011, 03:53:18 pm »
Here are more unconfirmed calls.
The sprintf routine is not a syscall, so its OS dependent.
I will try this myself in a couple weeks, it looks too useful even if its not sprintf.(vsprintf ?)
Code: [Select]
MMU_FlushCache?               0011
Disp_Manage?                  0276
Disp_Save?                    0278
Disp_GetPtr?                  027A
Num_UintToBCD                 0577
Num_BCDToUint                 0578
strlen?                       060D
strcpy?                       060E
strcat?                       060F
is_comma                      07BD
Bkey_GetkeyTableInfoJumpFunc  0EAE
Expressions_OpcodeToStr?      1291
LocalizeStringID              12FD or 12FC
MCS_DirtypeToItemtype?        1549
MCS_ItemtypeToDirtype?        154A
MCS_OpenAlphaMemItem??        1553
NextOPcodePRGM                1749
MCS_Flush                     1845
Send38k                       198A
Receive38k                    198B
OpenCloseComPort38k           198C
Battery_IsLow?                1e72
GetIntPtrContent?             1E7D
GetdatatablePtr?              1E80
SetAppName?                   1E9E

sprintf??? -- non-syscall  --> (OS1.01:0x80309604, OS1.02:0x803093A0), use function pointer   
« Last Edit: July 10, 2011, 09:38:12 am by bsl »

Offline flarn2006

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +0/-0
    • View Profile
Re: Compiling stuff for Prizm
« Reply #65 on: July 10, 2011, 03:44:31 am »
How would I go about compiling for the Prizm on a Mac?
(Also, IDK if this was posted before, but can you please remove that annoying loading animation from Insight? I doubt anything is actually being loaded.)

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: Compiling stuff for Prizm
« Reply #66 on: July 10, 2011, 03:46:13 am »
Well, you'd have to use GCC and the -m3 flag to compile C programs for the Prizm with a Mac.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline flarn2006

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +0/-0
    • View Profile
Re: Compiling stuff for Prizm
« Reply #67 on: July 10, 2011, 03:51:18 am »
Well, you'd have to use GCC and the -m3 flag to compile C programs for the Prizm with a Mac.

Is there any tutorial available? I don't know much about GCC or compiling on the command line; I can compile a simple C program using GCC but that's about it.

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: Compiling stuff for Prizm
« Reply #68 on: July 10, 2011, 03:55:34 am »
Well, you'd have to use GCC and the -m3 flag to compile C programs for the Prizm with a Mac.

Is there any tutorial available? I don't know much about GCC or compiling on the command line; I can compile a simple C program using GCC but that's about it.
I think the binaries of the GCC-based SDK only are compiled for Windows... I'm not sure how to make it work on a Mac. You could try asking on Cemetech - some of the ones who made GCC work with the Prizm usually visit that site more than Omnimaga.

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: Compiling stuff for Prizm
« Reply #69 on: July 10, 2011, 03:58:49 am »
Mac OS is *nix, so the native linux GCC should work without much effort (no need for a port). The only question is whether the GCC he presumably already has allows the -m3 flag.

EDIT: The GCC binaries from here support SuperH, so they might work.
« Last Edit: July 10, 2011, 04:00:45 am by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Compiling stuff for Prizm
« Reply #70 on: July 10, 2011, 04:41:57 am »
...can you please remove that annoying loading animation from Insight? I doubt anything is actually being loaded.)
cfxm asked me once how to draw outside of the regular display bounds. This animation is only a demo, how to achieve this (as most of INSIGHT is how-to-do source). I can implement it as separate menu item. Until the next release of INSIGHT you can cancel the loading animation with EXIT.
I'll be back.

Offline flarn2006

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +0/-0
    • View Profile
Re: Compiling stuff for Prizm
« Reply #71 on: July 10, 2011, 05:02:46 am »
...can you please remove that annoying loading animation from Insight? I doubt anything is actually being loaded.)
cfxm asked me once how to draw outside of the regular display bounds. This animation is only a demo, how to achieve this (as most of INSIGHT is how-to-do source). I can implement it as separate menu item. Until the next release of INSIGHT you can cancel the loading animation with EXIT.

Thanks; I don't know why I didn't try that.
BTW, you should add editing capabilities to the memory viewer. Maybe also add a feature to hex-edit files/variables without using a computer.

Also, somebody mentioned using the -m3 flag in gcc, but not only doesn't the man page mention that flag, but if I google "gcc m3" (no dash in the search, as that would be interpreted as without m3) all I find is stuff about using GCC to compile for some processor called the Cortex M3.
« Last Edit: July 10, 2011, 09:28:06 pm by flarn2006 »

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Compiling stuff for Prizm
« Reply #72 on: July 24, 2011, 02:10:50 pm »
I attached a little note-viewer.
With the next release of the mini-SDK, its source will be included.
The file-selection dialog shows files with the extension *.txt and subdirectories, only.
The noteviewer is designed to support CRLF, CR and LF as line delimiters.
A search function is under construction.

Version 1.00 removed
Version 1.02 can be found here
http://www.casio-scene.com/downloads.php?do=file&id=103
« Last Edit: April 25, 2012, 11:30:53 am by SimonLothar »
I'll be back.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Compiling stuff for Prizm
« Reply #73 on: July 29, 2011, 07:32:20 am »
Here are more unconfirmed calls.
The sprintf routine is not a syscall, so its OS dependent.
I will try this myself in a couple weeks, it looks too useful even if its not sprintf.(vsprintf ?)
Code: [Select]
MMU_FlushCache?               0011
Disp_Manage?                  0276
Disp_Save?                    0278
Disp_GetPtr?                  027A
Num_UintToBCD                 0577
Num_BCDToUint                 0578
strlen?                       060D
strcpy?                       060E
strcat?                       060F
is_comma                      07BD
Bkey_GetkeyTableInfoJumpFunc  0EAE
Expressions_OpcodeToStr?      1291
LocalizeStringID              12FD or 12FC
MCS_DirtypeToItemtype?        1549
MCS_ItemtypeToDirtype?        154A
MCS_OpenAlphaMemItem??        1553
NextOPcodePRGM                1749
MCS_Flush                     1845
Send38k                       198A
Receive38k                    198B
OpenCloseComPort38k           198C
Battery_IsLow?                1e72
GetIntPtrContent?             1E7D
GetdatatablePtr?              1E80
SetAppName?                   1E9E

sprintf??? -- non-syscall  --> (OS1.01:0x80309604, OS1.02:0x803093A0), use function pointer   

I could verify most of your assumptions.
Exceptions:
Disp_Manage?                  0276 (Bdisp_Fill_DD(color,mode), directly draws one of three predefined color-filled rectangles)
Disp_Save?                    0278 (Bdisp_Fill_DD_1(color) calls Bdisp_Fill_DD(color,1))
Disp_GetPtr?                  027A (Bdisp_Fill_VRAM_2(color) calls Bdisp_Fill_VRAM(color,2))
Bkey_GetkeyTableInfoJumpFunc  0EAE (verified, returns the pointer to some keycode table)
MCS_Flush                     1845 (checks the six MCS backup areas in the flash for some yet unknown purpose)
Send38k                       198A (verified, serves both commands Send and Send38k)
Receive38k                    198B (verified, serves both commands Receive and Receive38k)
GetdatatablePtr?              1E80 (returns the number of installed languages)

I'll be back.

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: Compiling stuff for Prizm
« Reply #74 on: July 31, 2011, 01:32:53 am »
Nice Simonlothar. Sometimes people come to ask for noteviewers and stuff like that, so hopefully if we gain Casio users who needs such program we will try to link them here.