You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#371
Re: Insect Combat
Posted on: 3/20 2:29
Nintendoid!
Joined 2006/3/15
Ecuador
224 Posts
PVBCC 3rdCoderLong Time User (11 Years)
Quote:

VirtualChris schrieb:
'v810-as' is not recognized as an internal or external command, operable program or batch file.

I put a batch file in a whole bunch of different folders and they all came up with this message. I'm afraid you're going to have to dumb it down for me. A lot.


What compiler and version of it are you using?
Top

#372
Re: Insect Combat
Posted on: 3/21 0:28
PVB Elite
Joined 2008/4/26
USA
872 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (9 Years) PVBCC 2010 EntryPVBCC 2013 Entry
I think I might have found a folder for the one I'm using, but it doesn't have that crt0.s file, but it does have a crt0.o file in it. Apparently I'm using gccVB version 2.95.
Top

#373
Re: Insect Combat
Posted on: 3/21 4:03
Nintendoid!
Joined 2006/3/15
Ecuador
224 Posts
PVBCC 3rdCoderLong Time User (11 Years)
Quote:

VirtualChris schrieb:
I think I might have found a folder for the one I'm using, but it doesn't have that crt0.s file, but it does have a crt0.o file in it. Apparently I'm using gccVB version 2.95.


I guess that you have the version published in

http://www.planetvb.com/modules/tech/?sec=tools&pid=gccvb

If so, then you already have a ctr0.o file that is cleaning up the bss section and the stack's space provided that it was compiled from crt0.s and not from crt0_old.s (didn't bother checking its contents).

You can get crt0.s from GCCVB 2.95's source:

http://www.planetvb.com/content/downl ... ols/vb_v810_gcc_03.tar.gz

You already have the "as" command, so you can use it instead of "v810-as" to compile crt0.s, just to make sure that the cleaning of WRAM is in the crt0.o file that you're using (don't forget to make a backup of the one that is currently working for you before replacing it!).

Just for completion, this is the code that does the cleaning:

/* clear .bss section and unintialized RAM */
movhi 0x0501,r0,r4
jr loop_start1
loop_top1:
st.h r0,0[r5]
add 2,r5
loop_start1:
cmp r4,r5
blt loop_top1

If the problem persists, then it means that you already had the cleaning up in place. So, the issue could be related to how soon you're accessing the work RAM in your program. I will refer you to the official documentation, page 4-5-1. I'm completely ignorant regarding the relation between assembly operations and the amount of time the CPU takes to execute them, but the doc says that you need to wait 200usec before accessing work RAM, and the crt0.s file that you have access it almost immediately to clean it. So, it could be the case that the weird behavior is caused by not waiting for the work RAM to stabilize before trying to write the 0s of the cleaning. You can try the following and check if it solves the problem: add the following code to crt0.s just below "_start:" and recompile it:


/* wait for WRAM */
movea 0x2000, r0, r6
wait_for_wram_loop:
add -1, r6
bnz wait_for_wram_loop

The 0x2000 value is just arbitrary and a vague guess on my part so, if it doesn't work, try to increase it and repeat the test.

jorgeche
Top

#374
Re: Insect Combat
Posted on: 3/22 1:53
PVB Elite
Joined 2008/4/26
USA
872 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (9 Years) PVBCC 2010 EntryPVBCC 2013 Entry
I meant I don't have the crt0.o file. Sorry about the confusion.
Top

#375
Re: Insect Combat
Posted on: 3/22 3:14
Nintendoid!
Joined 2006/3/15
Ecuador
224 Posts
PVBCC 3rdCoderLong Time User (11 Years)
Quote:

VirtualChris schrieb:
I meant I don't have the crt0.o file. Sorry about the confusion.


If you're using this version of GCCVB
(http://www.planetvb.com/content/downloads/tools/gccVB%202.95%20(Precompiled%20NVC%20Version).zip)
then you have crt0.o. It is located in v810/lib/. There are even two versions of it: crt0.o and crt0.o.bak.
Top

#376
Re: Insect Combat
Posted on: 3/22 4:11
PVB Elite
Joined 2008/4/26
USA
872 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (9 Years) PVBCC 2010 EntryPVBCC 2013 Entry
I don't know what v810 is. There doesn't seem to be a v810.exe file anywhere. Perhaps that's why I got that message, because I don't have it?
Top

#377
Re: Insect Combat
Posted on: 3/22 4:23
PVB Elite
Joined 2008/4/26
USA
872 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (9 Years) PVBCC 2010 EntryPVBCC 2013 Entry
OK, I figured out how to put your code into the file. I get the following message when compiling my code with gccvb:

crt0(.text+0x2): undefined reference to '_bss_start'
crt0(.text+0x6): undefined reference to '_bss_start'
crt0(.text+0xa): undefined reference to '_bss_end'
crt0(.text+0xe): undefined reference to '_bss_end'
Top

#378
Re: Insect Combat
Posted on: 3/22 4:50
PVB Elite
Joined 2008/4/26
USA
872 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (9 Years) PVBCC 2010 EntryPVBCC 2013 Entry
I figured everything out, I got everything to compile, but it didn't help. Perhaps I should just cancel the game.
Top

#379
Re: Insect Combat
Posted on: 3/22 4:50
Nintendoid!
Joined 2006/3/15
Ecuador
224 Posts
PVBCC 3rdCoderLong Time User (11 Years)
Quote:

VirtualChris schrieb:
OK, I figured out how to put your code into the file. I get the following message when compiling my code with gccvb:

crt0(.text+0x2): undefined reference to '_bss_start'
crt0(.text+0x6): undefined reference to '_bss_start'
crt0(.text+0xa): undefined reference to '_bss_end'
crt0(.text+0xe): undefined reference to '_bss_end'


You already have the code to clean the bss section. Roll back your crt0.s to its original form.

I suspect that the problem is caused by not waiting for the work RAM to stabilize before cleaning it, so, after rolling back to the original crt0.s, add this to it just after "_start":

/* wait for WRAM */
movea 0x2000, r0, r6
wait_for_wram_loop:
add -1, r6
bnz wait_for_wram_loop

Recompile it with "as" and try again. If the problem persist, try increasing the 0x2000 value an give it a couple more tries.
Top

#380
Re: Insect Combat
Posted on: 3/22 5:18
PVB Elite
Joined 2008/4/26
USA
872 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (9 Years) PVBCC 2010 EntryPVBCC 2013 Entry
I increased the 2000 number to 3000. At first I thought it was broken because it didn't start, but it eventually started up and works great! I want to thank you tremendously for your help.
Top

 Top   Previous Topic   Next Topic


Register To Post