Previously I though it was that I was accessing the vram-wrong but it turns out that even the sample code crashes. I have made no changes to the sample code in the folder examples. Also I have followed the step by step instructions on how to setup gcc that is on the wiki. The program just displays a black screen then crashes (the calculator restarts). I have downloaded libfxcg from github. Does anyone know what would have caused this. When I use the Prizm sdk 0.3 I can get programs to run but I read here http://prizm.cemetech.net/index.php/Prizm_Programming_Portal that it is out of date and that using the one from github is better. I am using Gentoo Gnu/Linux not windoze if that makes anything different.
The only thing I can thing of, based on a careful examination of your code above, is that you don't have correct LCD_HEIGHT_PX (216) and LCD_WIDTH_PX (384) defined.

Edit: Ah, I see that you edited your question. I think Tari would probably be the best one to answer that.
Sorry for changing my post without warning. It is just strange that similar code would work with the older sdk but not the newer one. I get no errors while compiling. I guess I will just have to stick with the older sdk libraries. Could it be that I am using gcc 4.8 and something changed that worked on an older version.
I structured the various build systems in the example folder. Which build system are you using? cmake, autotools, make-*?

Please note that the examples are from the old SDK and just had the headers changed. They really should be changed.
I tried both make-PrizmSDK and make-libfxcg
A few things I'd like to know.

1) Has anybody else successfully built addins with recent git builds of libfxcg? Could be a more generic regression.

2) Can you build the code with both the newest release (0.3) and git libfxcg and diff the generated assembly for me? Something like objdump -D should do the job.
Ok Tari here is the disassembly

Code:

yoda@Mordor ~/Downloads/PrizmSDK-0.3/projects/example/build $ sh3eb-elf-objdump -D example.o

example.o:     file format elf32-sh


Disassembly of section .text.startup:

00000000 <_main>:
   0:   2f 86          mov.l   r8,@-r15
   2:   2f 96          mov.l   r9,@-r15
   4:   4f 22          sts.l   pr,@-r15
   6:   d9 04          mov.l   18 <_main+0x18>,r9   ! 0 <_main>
   8:   7f fc          add   #-4,r15
   a:   d8 04          mov.l   1c <_main+0x1c>,r8   ! 0 <_main>
   c:   49 0b          jsr   @r9
   e:   00 09          nop   
  10:   48 0b          jsr   @r8
  12:   64 f3          mov   r15,r4
  14:   af fa          bra   c <_main+0xc>
  16:   00 09          nop   
   ...

Disassembly of section .comment:

00000000 <.comment>:
   0:   00 47          .word 0x0047
   2:   43 43          .word 0x4343
   4:   3a 20          cmp/eq   r2,r10
   6:   28 47          div0s   r4,r8
   8:   4e 55          .word 0x4e55
   a:   29 20          mov.b   r2,@r9
   c:   34 2e          addc   r2,r4
   e:   38 2e          addc   r2,r8
  10:   30 00          cmp/eq   r0,r0


Code:

yoda@Mordor ~/Downloads/libfxcg-master/examples/make-PrizmSDK/build $ sh3eb-elf-objdump -D example.o

example.o:     file format elf32-sh


Disassembly of section .text.startup.main:

00000000 <_main>:
   0:   2f 86          mov.l   r8,@-r15
   2:   2f 96          mov.l   r9,@-r15
   4:   4f 22          sts.l   pr,@-r15
   6:   d9 04          mov.l   18 <_main+0x18>,r9   ! 0 <_main>
   8:   7f fc          add   #-4,r15
   a:   d8 04          mov.l   1c <_main+0x1c>,r8   ! 0 <_main>
   c:   49 0b          jsr   @r9
   e:   00 09          nop   
  10:   48 0b          jsr   @r8
  12:   64 f3          mov   r15,r4
  14:   af fa          bra   c <_main+0xc>
  16:   00 09          nop   
   ...

Disassembly of section .comment:

00000000 <.comment>:
   0:   00 47          .word 0x0047
   2:   43 43          .word 0x4343
   4:   3a 20          cmp/eq   r2,r10
   6:   28 47          div0s   r4,r8
   8:   4e 55          .word 0x4e55
   a:   29 20          mov.b   r2,@r9
   c:   34 2e          addc   r2,r4
   e:   38 2e          addc   r2,r8
  10:   30 00          cmp/eq   r0,r0


Code:

yoda@Mordor ~/Downloads/libfxcg-master/examples/make-libfxcg/src $ sh3eb-elf-objdump -D example.o

example.o:     file format elf32-sh


Disassembly of section .text.startup:

00000000 <_main>:
   0:   2f 86          mov.l   r8,@-r15
   2:   2f 96          mov.l   r9,@-r15
   4:   4f 22          sts.l   pr,@-r15
   6:   d9 04          mov.l   18 <_main+0x18>,r9   ! 0 <_main>
   8:   7f fc          add   #-4,r15
   a:   d8 04          mov.l   1c <_main+0x1c>,r8   ! 0 <_main>
   c:   49 0b          jsr   @r9
   e:   00 09          nop   
  10:   48 0b          jsr   @r8
  12:   64 f3          mov   r15,r4
  14:   af fa          bra   c <_main+0xc>
  16:   00 09          nop   
   ...

Disassembly of section .comment:

00000000 <.comment>:
   0:   00 47          .word 0x0047
   2:   43 43          .word 0x4343
   4:   3a 20          cmp/eq   r2,r10
   6:   28 47          div0s   r4,r8
   8:   4e 55          .word 0x4e55
   a:   29 20          mov.b   r2,@r9
   c:   34 2e          addc   r2,r4
   e:   38 2e          addc   r2,r8
  10:   30 00          cmp/eq   r0,r0
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement