Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 June, 2013, 03:38:58 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2 3 ... 7   Go Down
  Print  
Author Topic: Compiling stuff for Prizm -  (Read 16016 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Kristaba
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 11 March, 2013, 00:36:15
Date Registered: 14 February, 2011, 21:00:56
Posts: 9

Topic starter
Total Post Ratings: +4

View Profile
« on: 15 February, 2011, 15:43:56 »
+3

Hey guys Smiley
I saw nobody here posted a real tutorial about how to build stuff for SH3 (and later for Prizm itself) Sad

Simon Lothar and Andreas Bertheussen, two casio hacker, made some years ago a good reverse engineering of fx9860 calculator, and they wrote some tools
for, and some informations about how to use GCC to make G1A Addin :
http://sourceforge.net/apps/trac/fxsdk/wiki/UsingGCC

I advise you to subscribe and download the Kpit GNU tools (most recent and up-to-date) at http://www.kpitgnutools.com/index.php
They have a strange policy : they allow to download freely the code (because GCC is under GNU GPL license of course Roll Eyes ) but you need to subscribe to download the binaries, so I think it could be a good thing to distribute ourselves the binaries from their source in the future...

The link I give is about fx9860, so they are some thing to do before use this for the Prizm :
* In addin.ld change "rom  : o = 0x00300200" by "rom  : o = 0x00300000"
* crt.s need to be modified (we need to to do a reverse-engineering on the Prizm initilization code)
* a g3a wrapper

Edit :
Okay, so I disassembled Converter addin this morning (downloaded on casio.edu) to try to isolate the init stuff.
The complete disassembled sources (all conv.g3a), with only some labels to understand more the code (because 200 lines of assembly without any label to indicate constant values, loops and functions is really hard to read) is here http://pastebin.com/xT8XNAhH

I rewrote the code that seems to be the init stuff, and as I expected it's very similar to the fx9860 crt0.s written by SimLo and/or Andreas, but it seems call only _GLibAddinAplExecutionCheck after the ram is initialized, and immediately jump to _main...
So it's either the Prizm OS does a part of the initialization that was did by the addin code in fx9860 OS, or a part of the Converter code I thought it's the "_main" code is in fact init code.
Maybe Simon Lothar already isolate the init stuff, so, if you see this, please say what you think about that...
crt0.s : http://pastebin.com/ccE3NPhZ
my addin.ld : http://pastebin.com/YMrdDHWS

(and really sorry for my poor english Grin)
« Last Edit: 16 February, 2011, 15:53:22 by Kristaba » Logged
JosJuice
LV9 Veteran (Next: 1337)
*********
Offline Offline

Last Login: Yesterday at 23:01:42
Date Registered: 24 September, 2010, 16:46:12
Location: Sweden
Posts: 1300


Total Post Ratings: +51

View Profile
« Reply #1 on: 15 February, 2011, 16:31:41 »
0

Great! I can't really check this out now, since I don't have a Prizm yet... But it certainly does look nice. Is this mostly for assembly, or is it for C?

* In addin.ld change "rom  : o = 0x00300200" by "rom  : o = 0x00300000"
Shouldn't this be 0x00307000 on the Prizm?
Logged

Kristaba
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 11 March, 2013, 00:36:15
Date Registered: 14 February, 2011, 21:00:56
Posts: 9

Topic starter
Total Post Ratings: +4

View Profile
« Reply #2 on: 16 February, 2011, 16:10:52 »
0

Great! I can't really check this out now, since I don't have a Prizm yet... But it certainly does look nice. Is this mostly for assembly, or is it for C?

* In addin.ld change "rom  : o = 0x00300200" by "rom  : o = 0x00300000"
Shouldn't this be 0x00307000 on the Prizm?

Yeah, I know the problem because I haven't my one yet too Undecided
It's a fully GCC so you can compile a lot of languages, mainly asm and C, but also C++ (with some change to remove the runtime), Ada, Fortan, etc...

And no, it seems Prizm set the MMU to 0x300000 as the first code address (Andreas wrote this in Casio Kingdom same days ago)

Edit 02/16/11 :
First post updated
« Last Edit: 16 February, 2011, 16:11:26 by Kristaba » Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Online Online

Gender: Male
Last Login: Today at 03:24:31
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50644


Total Post Ratings: +2640

View Profile WWW
« Reply #3 on: 16 February, 2011, 23:52:51 »
0

Hmm nice, hopefully this could be useful, since both calcs are similar processor-wise.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
SimonLothar
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 20 March, 2013, 17:01:25
Date Registered: 16 February, 2011, 08:25:46
Location: Krautland
Posts: 122


Total Post Ratings: +33

View Profile
« Reply #4 on: 04 March, 2011, 23:00:32 »
+2

I attached the current version of insight (see directory projects\insight\insight.g3a). The source and the tools to build the g3a are included, too. Only one exception: the BIN-directory of the legacy CASIO fx-9860 SDK, which is needed, is not included.

EDIT:
New version: http://www.omnimaga.org/index.php?topic=6608.msg128206#msg128206
version 1.01 removed.
« Last Edit: 07 March, 2011, 18:47:05 by SimonLothar » Logged

I'll be back.
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Online Online

Gender: Male
Last Login: Today at 03:24:31
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50644


Total Post Ratings: +2640

View Profile WWW
« Reply #5 on: 06 March, 2011, 21:04:08 »
0

Nice, I just checked and I like it so far. Cheesy
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
SimonLothar
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 20 March, 2013, 17:01:25
Date Registered: 16 February, 2011, 08:25:46
Location: Krautland
Posts: 122


Total Post Ratings: +33

View Profile
« Reply #6 on: 07 March, 2011, 18:45:59 »
+1

Insight version 1.02:
RTC read and set; battery voltage; new syscalls; a new library fxCG_TOOLS.LIB; 256 color bitmap to fxCG icon converter; memory search; memory backup.

Outdated: update here http://www.omnimaga.org/index.php?topic=6608.msg132980#msg132980
« Last Edit: 20 March, 2011, 15:50:19 by SimonLothar » Logged

I'll be back.
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Online Online

Gender: Male
Last Login: Today at 03:24:31
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50644


Total Post Ratings: +2640

View Profile WWW
« Reply #7 on: 07 March, 2011, 22:35:27 »
0

Cool, thanks for the update. Cheesy
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
JonimusPrime
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 29 May, 2013, 04:37:07
Date Registered: 09 February, 2010, 00:18:56
Location: TheWauwatosa
Posts: 418


Total Post Ratings: +20

View Profile WWW
« Reply #8 on: 11 March, 2011, 06:44:04 »
0

I actually have my own built toolchain I built based on GCC as I didn't want to register to dl the one from that KPIT site. It can be found at http://jonimoose.net/prizm/sh3-unknown-elf/ the two tars are identical one just used xz compression to be smaller.
Logged


"Always code as if the person who will maintain your code is a maniac serial killer that knows where you live" -Unknown

"If you've done something right no one will know that you've done anything at all" -Futurama

"Have a nice day, or not, the choice is yours." Tom Steiner
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Online Online

Gender: Male
Last Login: Today at 03:24:31
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50644


Total Post Ratings: +2640

View Profile WWW
« Reply #9 on: 11 March, 2011, 06:48:25 »
0

Cool to hear Jonimus. Cheesy
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
SimonLothar
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 20 March, 2013, 17:01:25
Date Registered: 16 February, 2011, 08:25:46
Location: Krautland
Posts: 122


Total Post Ratings: +33

View Profile
« Reply #10 on: 20 March, 2011, 15:45:40 »
+2

Insight version 1.03:
a little display demo: moving and bouncing objects; a HTMLHELP-file with some information concerning syscalls of fx-9860- and fx-CG-systems (to be continued).

EDIT: ah, yes. @cfxm: and a new pair of my cute icons, which everyone loves. Grin

EDIT(2011-04-03):
Updated: http://www.omnimaga.org/index.php?topic=6608.msg139453#msg139453
version 1.03 removed
« Last Edit: 03 April, 2011, 17:05:35 by SimonLothar » Logged

I'll be back.
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Total Post Ratings: +28

View Profile
« Reply #11 on: 20 March, 2011, 16:18:07 »
0

I totally like the display routine! w00t
Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Online Online

Gender: Male
Last Login: Today at 03:24:31
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50644


Total Post Ratings: +2640

View Profile WWW
« Reply #12 on: 21 March, 2011, 07:24:45 »
0

For a bit I thought the display thing was separate from Insight and I couldn't find the file, so I had to sign up on Casio site to download the 9860G SDK and stuff, but then I realized it was part of Insight. X.x

Anyway this looks nice. I'm glad to see more showcases of SH3 ASM programs.

EDIT: Here's a screenshot (well... sort-of). Don't use Internets Exploder to ruin it.


* MVI_0754.gif (2201.62 KB, 152x83 - viewed 1789 times.)
« Last Edit: 21 March, 2011, 07:43:28 by DJ_O » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
SimonLothar
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 20 March, 2013, 17:01:25
Date Registered: 16 February, 2011, 08:25:46
Location: Krautland
Posts: 122


Total Post Ratings: +33

View Profile
« Reply #13 on: 21 March, 2011, 16:58:50 »
+1

I totally like the display routine!
So? Then if you like it crowded, try this...

@DJ_O: it is C, not assembler!


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
static unsigned int lastrandom=0x12345678;
unsigned short random( int seed = 0 ){
    if (seed) lastrandom=seed;
    lastrandom = ( 0x41C64E6D*lastrandom ) + 0x3039;
    return ( lastrandom >> 16 );
}

#define NSHAPES 100

//
int MoveOne( TBdispFillArea a[], TShapeProps sp[], int idx ){
int vy1, vy2, j, k;
int xoverlap, yoverlap, overlap;
int xd, yd;
a[idx].x1 += sp[idx].dx;
if ( a[idx].x1 >= 384 - sp[idx].wx){
sp[idx].dx = -sp[idx].dx;
a[idx].x1 += sp[idx].dx;
sp[idx].dx = -1;  // cold wall
return 0;
}
if ( a[idx].x1 <= 1){
sp[idx].dx = -sp[idx].dx;
a[idx].x1 += sp[idx].dx;
sp[idx].dx = 3; // hot wall
return 0;
}
for (j=0;j<NSHAPES;j++){
overlap = 0;
if ( j != idx ){
xd = a[idx].x1 - a[j].x1;
yd = a[idx].y1 - a[j].y1;
if ( xd * xd + yd * yd < 100 ) overlap = 1;
if ( overlap ) break;
}
}
if ( overlap ){
sp[idx].dx = -sp[idx].dx;
a[idx].x1 += sp[idx].dx;
k = sp[idx].dx;
sp[idx].dx = sp[j].dx;
sp[j].dx = -k;
return 0;
}

a[idx].y1 += sp[idx].dy;
if ( a[idx].y1 >= 216 - sp[idx].wy){
sp[idx].dy = -sp[idx].dy;
a[idx].y1 += sp[idx].dy;
return 0;
}
if ( a[idx].y1 <= 1){
sp[idx].dy = -sp[idx].dy;
a[idx].y1 += sp[idx].dy;
return 0;
}
for (j=0;j<NSHAPES;j++){
overlap = 0;
if ( j != idx ){
xd = a[idx].x1 - a[j].x1;
yd = a[idx].y1 - a[j].y1;
if ( xd * xd + yd * yd < 100 ) overlap = 1;
if ( overlap ) break;
}
}
if ( overlap ){
sp[idx].dy = -sp[idx].dy;
a[idx].y1 += sp[idx].dy;
k = sp[idx].dy;
sp[idx].dy = sp[j].dy;
sp[j].dy = -k;
return 0;
}

k = 0;
if (sp[idx].dy<0) k -= sp[idx].dy; else k += sp[idx].dy;
if (sp[idx].dx<0) k -= sp[idx].dx; else k += sp[idx].dx;
switch (k){
case 2 : sp[idx].color = 0x001F ; break;
case 3 : sp[idx].color = 0x03FF ; break;
case 4 : sp[idx].color = 0x07E0 ; break;
case 5 : sp[idx].color = 0xFFC0 ; break;
case 6 : sp[idx].color = 0xF800 ; break;
}

a[idx].mode = 0;
Bdisp_AreaClr( &sp[idx].saved, 1, -1 );
a[idx].mode = 1;

a[idx].x2 = a[idx].x1 + sp[idx].wx;
a[idx].y2 = a[idx].y1 + sp[idx].wy;
Bdisp_AreaClr( &a[idx], 1, sp[idx].color );
memcpy( &sp[idx].saved, &a[idx], sizeof( TBdispFillArea ) );

/*
vy1 = a[idx].y1 - sp[idx].wy / 2;
vy2 = a[idx].y2 + sp[idx].wy / 2;
if ( vy1 < 0 ) vy1 = 0;
if ( vy2 > 215 ) vy2 = 215;
Bdisp_PutDisp_DD_stripe( vy1, vy2 );
*/
return 1;

}

#define V 1

void F7_Handler(){
TBdispFillArea ar[NSHAPES];
TShapeProps mp[NSHAPES];
int ticks, i, iwork;
ticks = RTC_GetTicks();
random( ticks );
while (!RTC_Elapsed_ms( ticks, 100 ));

for ( i=0;i<NSHAPES;i++){
ar[i]. mode = 1;
memset( &mp[i], 0, sizeof( TShapeProps ) );
mp[i].wx = 10;
mp[i].wy = 10;
ar[i].x1 = 11 * ((i >> 2)+1);
mp[i].color = random();
ar[i].y1 = 10 + 11 * ( i & 0x3 );

iwork = random();
iwork = ( 3 * iwork ) / 0x10000 + 1;
if ( random() & 0x8000 ) iwork = -iwork;
mp[i].dx = iwork;
iwork = random();
iwork = ( 3 * iwork ) / 0x10000 + 1;
if ( random() & 0x8000 ) iwork = -iwork;
mp[i].dy = iwork;

ar[i].x2 = ar[i].x1 + mp[i].wx;
ar[i].y2 = ar[i].y1 + mp[i].wy;
}
while ( !(*(unsigned short*)0xA44B0000) ){
for (i=0;i<NSHAPES;i++){
MoveOne( ar, mp, i );
}
   Bdisp_PutDisp_DD();
}
}

Attachment removed. Actual version included here:
http://www.omnimaga.org/index.php?topic=6608.msg164247#msg164247
« Last Edit: 11 June, 2011, 16:46:49 by SimonLothar » Logged

I'll be back.
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Online Online

Gender: Male
Last Login: Today at 03:24:31
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50644


Total Post Ratings: +2640

View Profile WWW
« Reply #14 on: 21 March, 2011, 20:12:26 »
0

Yeah sorry I meant SH3 C and ASM. I am aware that this is C. I tend to just say ASM sometimes when it comes to calculator hacking, having been used to a platform with no decent C capabilities for years (the TI-83 Plus series). ASM here would be in reference to Qwerty.55 and z80man, although they use hexadecimal rather than SH3 mnemonics.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Pages: [1] 2 3 ... 7   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.618 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.