Search found 166 matches

by Newbie
Mon Jul 11, 2016 1:52 pm
Forum: Programming Discussion
Topic: How ObjDump retrieve labels from elf file
Replies: 4
Views: 444

How ObjDump retrieve labels from elf file

Hello everybody, Looking around GCC, ELF and OBJDump, I ask myself a question. When I insert a label in ASM code in a function (the main for example). In C : int main(int argc, char* argv[]) { ..... ..... ..... ..... ..... ..... ..... __asm__ __volatile__("START:"); ..... ..... ..... ..... ..... ......
by Newbie
Tue Jul 05, 2016 5:44 am
Forum: Programming Discussion
Topic: SH4 assembly function call in C
Replies: 15
Views: 1204

Re: SH4 assembly function call in C

Hi,

The "sh-elf-gcc -std=c99 -O1 -S test.c" command line is definitely awesome to understand the translation between C and ASM.

I will now use it massively.

Thanks
by Newbie
Sun Jul 03, 2016 6:23 pm
Forum: Programming Discussion
Topic: SH4 assembly function call in C
Replies: 15
Views: 1204

Re: SH4 assembly function call in C

Thanks all ! I have gathered very useful information that i will use in the future ! I will use assembly instead of hard inlining. From BlueCrab : PR is the "procedure return" register. It stores where the rts opcode returns to at the end of the function. The jsr and bsr opcodes change that register...
by Newbie
Fri Jul 01, 2016 8:43 am
Forum: Programming Discussion
Topic: SH4 assembly function call in C
Replies: 15
Views: 1204

Re: SH4 assembly function call in C

Hi, There's a number of problems with what you're trying to do in this code... Not trying to be mean, just pointing it out ahead of time. Your are always welcome ! :) I thank you to respond to my questions and you always make very useful notices. It is brilliant to provide the flush instruction like...
by Newbie
Thu Jun 30, 2016 7:58 pm
Forum: Programming Discussion
Topic: SH4 assembly function call in C
Replies: 15
Views: 1204

SH4 assembly function call in C

Hi everyone, I am playing around SH4 assembly function call in C today. My goal is simply to use assembly inlined code in a C program to call a function of KOS. Below you can see a sample of calling a function in pure C. The "_icache_flush_range" is used as a test function, calling it with 0 / 0 par...
by Newbie
Sat Apr 23, 2016 1:36 pm
Forum: Programming Discussion
Topic: Objdump SH4 / can't disassemble for architecture UNKNOWN
Replies: 8
Views: 1330

Re: Objdump SH4 / can't disassemble for architecture UNKNOWN

From what I understood creating a static library is just compiling all the functions independently to obtain object file (*.o). I recall the "how to" below to see if I have correctly understood the process .... A first function on a lib void FunctionA(int *i) { *i=5; } A second function in the lib v...
by Newbie
Fri Apr 22, 2016 5:27 pm
Forum: Programming Discussion
Topic: Objdump SH4 / can't disassemble for architecture UNKNOWN
Replies: 8
Views: 1330

Re: Objdump SH4 / can't disassemble for architecture UNKNOWN

Well, I suspected this response but it costs nothing to try :) To complete this topic around ELF and Bin, I found in KOS two functions to execute a binary after loading it on on RAM : /** \brief Replace the currently running binary. This function will replace the currently running binary with whatev...
by Newbie
Mon Apr 18, 2016 11:36 am
Forum: Programming Discussion
Topic: Objdump SH4 / can't disassemble for architecture UNKNOWN
Replies: 8
Views: 1330

Re: Objdump SH4 / can't disassemble for architecture UNKNOWN

Ok.

But i have a strange idea on mind (perhaps it's stupid idea).
Imagine we have an unscrambled bin, then using the bin2o script in KOS obtaining a .o file.
Is it possible to compile (or link it) it to retrieve the original ELF file ?
If yes, how ?

Thanks
by Newbie
Sun Apr 17, 2016 6:24 pm
Forum: Programming Discussion
Topic: dcload stuck on receiving data after send an *.elf [Solved]
Replies: 11
Views: 1289

Re: dcload stuck on receiving data after send an *.elf [Solv

I should have said this earlier, but it only does the blue screen on the first *.elf that I send. Every executable I send after that, the screen doesn't appear.
I have the same behavior too :)
by Newbie
Sun Apr 17, 2016 6:21 pm
Forum: Programming Discussion
Topic: Objdump SH4 / can't disassemble for architecture UNKNOWN
Replies: 8
Views: 1330

Re: Objdump SH4 / can't disassemble for architecture UNKNOWN

Sorry for the late answer, thanks i found out the sh-elf-objdump and it works nicely. I have take some time to understand more ELF file structure : sections, header, attributes and so ... By the way, i am searching a mean of making the exact opposite of the Elf2Bin conversion. I mean taking an unscr...
by Newbie
Thu Apr 14, 2016 7:59 pm
Forum: Programming Discussion
Topic: Objdump SH4 / can't disassemble for architecture UNKNOWN
Replies: 8
Views: 1330

Objdump SH4 / can't disassemble for architecture UNKNOWN

Hi everybody, I am just starting try to work with objdump with ELF file compiled by my SH4 tool chain. But when i try to simply disassemble a ELF file with the command below : objdump -d a.elf It outputs this : a.elf: file format elf32-little objdump: can't disassemble for architecture UNKNOWN My GC...
by Newbie
Thu Apr 14, 2016 7:56 pm
Forum: Programming Discussion
Topic: dcload stuck on receiving data after send an *.elf [Solved]
Replies: 11
Views: 1289

Re: dcload stuck on receiving data after send an *.elf [Solv

In the source code of DC load, i think i have seen a sort of "first run" command that force an exception to occur and a dump or register like blue screen of death.
by Newbie
Fri Mar 18, 2016 12:37 pm
Forum: Programming Discussion
Topic: Bios and Flash Ram
Replies: 4
Views: 715

Re: Bios and Flash Ram

The Dreamcast does not use a different BIOS for different regions. The BIOS itself is universal, but the console reads the region information from a read-only section of the flash RAM and acts accordingly. There are 3 known releases of the BIOS for the retail version of the console-- 1.004, 1.01, a...
by Newbie
Thu Mar 17, 2016 5:33 pm
Forum: Programming Discussion
Topic: Bios and Flash Ram
Replies: 4
Views: 715

Re: Bios and Flash Ram

Something like that could be correct ?

Code: Select all


uint8 * biosData = 0xa0000000; 

int index;

for(index = 0; index < 2097152; index++)
{
	printf("%c",biosData[index]); 
}

by Newbie
Wed Mar 16, 2016 2:58 pm
Forum: Programming Discussion
Topic: Bios and Flash Ram
Replies: 4
Views: 715

Bios and Flash Ram

Hi all, I have a question about BIOS and Flash Ram of Dreamcast. I want to try to read a part of the bios of my machine and Flash Ram. I do not want to make something wrong, so carefully, i ask how it could it be done secure :) First where can i start reading and how (some example source code would ...
by Newbie
Wed Mar 02, 2016 9:54 am
Forum: Programming Discussion
Topic: pvr_mem_malloc / pvr_txr_load / sq_cpy and time ...
Replies: 26
Views: 2237

Re: pvr_mem_malloc / pvr_txr_load / sq_cpy and time ...

If you can't tell in advance that a texture is needed, you're pretty much stuck waiting. Bulk memory transfers across separate busses take time and there's nothing that can really be done to improve the time spent all that much, unfortunately.
Ok, i'll try to improve my code.

Thanks everybody.
by Newbie
Tue Mar 01, 2016 7:08 am
Forum: Programming Discussion
Topic: pvr_mem_malloc / pvr_txr_load / sq_cpy and time ...
Replies: 26
Views: 2237

Re: pvr_mem_malloc / pvr_txr_load / sq_cpy and time ...

Hi,

I never said i "upload textures each frame". It is only at a place of my code and once but it takes a little bit time and i want to reduce this time.
by Newbie
Fri Feb 26, 2016 5:13 pm
Forum: Programming Discussion
Topic: pvr_mem_malloc / pvr_txr_load / sq_cpy and time ...
Replies: 26
Views: 2237

Re: pvr_mem_malloc / pvr_txr_load / sq_cpy and time ...

Well, i have just in a place of my code a request for a bunch of textures stored in RAM to be moved in VRAM then to be drawn immediately. The move takes "a little bit time" (just a very little too much). This is why i ask myself (and you) if it could be speed up. As i use KOS wich use "pvr_mem_mallo...
by Newbie
Wed Feb 24, 2016 5:23 pm
Forum: Programming Discussion
Topic: pvr_mem_malloc / pvr_txr_load / sq_cpy and time ...
Replies: 26
Views: 2237

Re: pvr_mem_malloc / pvr_txr_load / sq_cpy and time ...

Well, i try to load a bunch of squared VQ 16 bit 4444 textures files. Those datas are stored firrst in main ram and moved to vram when i need them (by allocating and moving). The DMA thing could not solve my problem because it's only a time consumming process problem. The alternative sq_cpy in the l...
by Newbie
Tue Feb 23, 2016 4:16 pm
Forum: Programming Discussion
Topic: pvr_mem_malloc / pvr_txr_load / sq_cpy and time ...
Replies: 26
Views: 2237

pvr_mem_malloc / pvr_txr_load / sq_cpy and time ...

Hi everybody, I am using some texture loading inside my code making move of graphic datas from main memory (SH4) to video memory (PVR). So i am using the "pvr_mem_malloc" and "pvr_txr_load". But as i move quite large amount of datas, it takes times and i want to try to reduce it. So i dig in KOS and...