fix issue with HBC stub + 64B L2 cache (tueidj)
[libogc.git] / libogc / argv.c
blob6dea3882515961c7f85afef8fce0386687c443e0
1 /*-------------------------------------------------------------
3 Copyright (C) 2008
4 Michael Wiedenbauer (shagkur)
5 Dave Murphy (WinterMute)
7 This software is provided 'as-is', without any express or implied
8 warranty. In no event will the authors be held liable for any
9 damages arising from the use of this software.
11 Permission is granted to anyone to use this software for any
12 purpose, including commercial applications, and to alter it and
13 redistribute it freely, subject to the following restrictions:
15 1. The origin of this software must not be misrepresented; you
16 must not claim that you wrote the original software. If you use
17 this software in a product, an acknowledgment in the product
18 documentation would be appreciated but is not required.
20 2. Altered source versions must be plainly marked as such, and
21 must not be misrepresented as being the original software.
23 3. This notice may not be removed or altered from any source
24 distribution.
26 -------------------------------------------------------------*/
27 #include "gctypes.h"
28 #include <string.h>
30 extern u8 __Arena1Lo[];
31 extern char *__argvArena1Lo;
32 void build_argv (struct __argv* argstruct );
34 void __CheckARGV() {
36 if ( __system_argv->argvMagic != ARGV_MAGIC ) {
37 __system_argv->argc = 0;
38 __system_argv->argv = NULL;
39 return;
42 u8 *dest = (u8 *)( ((int)__Arena1Lo + 3) & ~3);
44 memmove(dest, __system_argv->commandLine, __system_argv->length);
45 __system_argv->commandLine = (char *)dest;
46 build_argv(__system_argv);
48 __argvArena1Lo = (char *)__system_argv->endARGV;