Search found 968 matches

by nymus
Sat Sep 17, 2016 1:00 pm
Forum: Programming Discussion
Topic: Wiki feedback
Replies: 102
Views: 74782

Re: Wiki feedback

Hey Bluecrab, How about a developer's badge for bogglez? I think he just joined recently so it might have been missed. A long, long time ago, I released a half-complete and buggy tetris clone using my beginner's programming skills. Surprisingly, I logged in one day and noticed that I had been awarde...
by nymus
Sun Sep 11, 2016 11:45 am
Forum: Programming Discussion
Topic: Problems installing cygwin on windows xp
Replies: 14
Views: 2077

Re: Problems installing cygwin on windows xp

While we're on the subject of bogglez' niceness, I've been meaning to comment on your funny avatar. That dog's smile is hard to ignore :D
by nymus
Tue Aug 23, 2016 1:47 pm
Forum: Programming Discussion
Topic: Inline assembly vector operands
Replies: 7
Views: 1164

Re: Inline assembly vector operands

Here is an example showing how to let gcc choose which registers to use. "r" is for general registers and "f" for floats. One references operands in the asm as "%n" where n is the order of appearance in the list of both output and input operands, starting from 0. I also...
by nymus
Sat Jul 16, 2016 7:11 am
Forum: Programming Discussion
Topic: KGL Clipping Issue
Replies: 23
Views: 3408

Re: KGL Clipping Issue

Indeed, tools that don't function as expected are definitely frustrating so it's nice that your issue was resolved. The great thing about asking/reporting is that now others will be able to troubleshoot and fix a similar problem. Thanks to all. Just a quick question, since opengl-es 1 was designed f...
by nymus
Tue Jul 12, 2016 6:51 pm
Forum: Programming Discussion
Topic: How ObjDump retrieve labels from elf file
Replies: 4
Views: 651

Re: How ObjDump retrieve labels from elf file

Try downloading dcload sources and see how t use libelf to decode elf files. It's maintained beside the KOS git repository.
by nymus
Mon Jul 11, 2016 5:39 pm
Forum: Programming Discussion
Topic: How ObjDump retrieve labels from elf file
Replies: 4
Views: 651

Re: How ObjDump retrieve labels from elf file

Yes, the .elf file has a specific structure that the gcc tools know about so they can find the debug symbols easily. The labels are still there in text form, but since a "hexdump" program doesn't know the structure, it just reads the data and formats it in its own way e.g as bytes / shorts...
by nymus
Thu Jul 07, 2016 11:17 am
Forum: Programming Discussion
Topic: Trying to get interrupts to work
Replies: 12
Views: 1382

Re: Trying to get interrupts to work

I've tried following the program flow and have a few observations: Handling procedure (INT is interrupt_handler in assembly): f() > INT > ak_interrupt() > RTS > INT > RTE > f() - INT calls ak_interrupt using JSR so we are inside a "new" exception-handling context (overwritten PR, saved R15...
by nymus
Thu Jul 07, 2016 7:09 am
Forum: Programming Discussion
Topic: Trying to get interrupts to work
Replies: 12
Views: 1382

Re: Trying to get interrupts to work

Hmm, I haven't done any interrupt handling myself, but at first glance, I see you are making considerations according to Section 5.8 (Restrictions) of the Programming manual... It looks like you should be okay but you don't "nop" in the delay slot after the first bra instruction. You put ....
by nymus
Tue Jul 05, 2016 11:30 am
Forum: Programming Discussion
Topic: Kos-Ports build error
Replies: 14
Views: 1630

Re: Kos-Ports build error

I must compliment you on a well-structured and modular build system. The only obstacle to using the make commands is that the build-all.sh is so much more convenient :) Unfortunately, it does make clean. I've modified mine to just pass the first parameter to the makefiles. (build-all.sh [ fetch, ins...
by nymus
Sun Jul 03, 2016 11:57 pm
Forum: Programming Discussion
Topic: SH4 assembly function call in C
Replies: 15
Views: 2321

Re: SH4 assembly function call in C

Here is a nice example you could use to see that looks can be deceiving... C function: int test(int values[5]) { int total = 0; for(int i = 0; i < 5; ++i) { total += values[i]; } return total; } When you compile using just "sh-elf-gcc -std=c99 -fomit-frame-pointer -S test.c" (no optimizati...
by nymus
Sun Jul 03, 2016 9:36 pm
Forum: Programming Discussion
Topic: SH4 assembly function call in C
Replies: 15
Views: 2321

Re: SH4 assembly function call in C

Compiling without optimization is a nice way to learn basic steps and understand what optimization -O2 does. Assembly is more nuanced than just reducing the number of instructions. Manual inlining as you wanted to do might be faster because gcc would unroll the loop smartly for you. A lot of the cod...
by nymus
Sat Jul 02, 2016 3:21 pm
Forum: Programming Discussion
Topic: Kos-Ports build error
Replies: 14
Views: 1630

Re: Kos-Ports build error

Yes. It was on my end. I was trying out MacPostFactor to run Mountain Lion on an older Mac but I switched back to Lion because of some minor performance issues and did not encounter the error. The OS version mismatch is probably the culprit. It would be nice to keep the downloaded sources though... ...
by nymus
Fri Jul 01, 2016 10:30 pm
Forum: Programming Discussion
Topic: Kos-Ports build error
Replies: 14
Views: 1630

Re: Kos-Ports build error

Thanks! That explains and solves a lot! :D
by nymus
Fri Jul 01, 2016 8:46 pm
Forum: Programming Discussion
Topic: Kos-Ports build error
Replies: 14
Views: 1630

Re: Kos-Ports build error

Yes, the URL is correct and it "should" work. Maybe it's something with OS X, but It returns a HTTP header stating error 403 forbidden, do not have permission to access zlib from this server. Preliminary research suggests it has to do with how browsers send user-agent strings or headers bu...
by nymus
Fri Jul 01, 2016 4:36 pm
Forum: Programming Discussion
Topic: Kos-Ports build error
Replies: 14
Views: 1630

Re: Kos-Ports build error

I suppose this is a good place to mention kos and kos-ports bild errors... In following the instruction on the home page, encountered the following: - kos-ports/zlib does not download correctly. I downloaded the archive manually and it worked. I don't know what the issue is. - examples/dreamcsat/tsu...
by nymus
Fri Jul 01, 2016 2:01 pm
Forum: Programming Discussion
Topic: SH4 assembly function call in C
Replies: 15
Views: 2321

Re: SH4 assembly function call in C

A quick note: You should experiement using library code, not kernel code. The icache flushing code likely requires privileged mode so calling it from your user code is not advisable. Try using the examples by modifying them to use assembly calls instead of c. Try looking at the assembly output of gc...
by nymus
Fri Jul 01, 2016 12:50 pm
Forum: Programming Discussion
Topic: SH4 assembly function call in C
Replies: 15
Views: 2321

Re: SH4 assembly function call in C

*Oops! beaten by Bluecrab :) Hi. I don't have much experience with assembly but I don't mind offering some input. The best way to learn how assembly and C interact is to code it in the "standard" way, i.e. using separate .c and .s files as follows: Please note that this code "could&qu...
by nymus
Sat Jun 18, 2016 9:31 pm
Forum: Games and Software Hacking, Prototypes, and Devkits Discussion
Topic: Finally bought back a Dreamcast
Replies: 4
Views: 1996

Re: Finally bought back a Dreamcast

$40 is a good price for a working Dreamcast these days. It's nice to see our favourite system still going strong. I, too, just got an incredible deal. The disc drive was alleged to be non-functional, but it worked when I tried it. I just greased the moving parts. The bundle came with a working syste...
by nymus
Wed Jun 01, 2016 8:57 pm
Forum: Programming Discussion
Topic: KOS - KOS-PORTS mismatch?
Replies: 14
Views: 1429

Re: KOS - KOS-PORTS mismatch?

Hah! Interesting... I developed the habit of deleting that trailing slash whenever I tab-completed a directory but I don't know where it came from. Also the "-r" option is deprecated everywhere! We should be using "-R!" I've been doing it WRONG! all this time! LOL The POSIX speci...