1 /* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // -------------------------------------------------------------------------*/
12 #include "frontend/emulator/jniHelper.h"
13 #include "sjme/nvm/boot.h"
14 #include "sjme/alloc.h"
16 void SJME_JNI_METHOD(SJME_CLASS_NVM_BOOT_PARAM
, _1_1setMainArgs
)
17 (JNIEnv
* env
, jclass classy
, jlong thisPtr
, jlong listPtr
)
19 sjme_nvm_bootParam
* param
;
23 sjme_jni_throwVMException(env
, SJME_ERROR_NULL_ARGUMENTS
);
27 /* Get parameter data. */
28 param
= SJME_JLONG_TO_POINTER(sjme_nvm_bootParam
*, thisPtr
);
30 /* Set main arguments. */
31 param
->mainArgs
= SJME_JLONG_TO_POINTER(const sjme_list_sjme_lpcstr
*,
35 void SJME_JNI_METHOD(SJME_CLASS_NVM_BOOT_PARAM
, _1_1setMainClass
)
36 (JNIEnv
* env
, jclass classy
, jlong thisPtr
, jlong stringPtr
)
38 sjme_nvm_bootParam
* param
;
42 sjme_jni_throwVMException(env
, SJME_ERROR_NULL_ARGUMENTS
);
46 /* Get parameter data. */
47 param
= SJME_JLONG_TO_POINTER(sjme_nvm_bootParam
*, thisPtr
);
50 param
->mainClass
= SJME_JLONG_TO_POINTER(sjme_lpcstr
, stringPtr
);
53 void SJME_JNI_METHOD(SJME_CLASS_NVM_BOOT_PARAM
, _1_1setMainClassPathIds
)
54 (JNIEnv
* env
, jclass classy
, jlong thisPtr
, jlong idsPtr
)
56 sjme_nvm_bootParam
* param
;
60 sjme_jni_throwVMException(env
, SJME_ERROR_NULL_ARGUMENTS
);
64 /* Get parameter data. */
65 param
= SJME_JLONG_TO_POINTER(sjme_nvm_bootParam
*, thisPtr
);
67 /* Set suite information. */
68 param
->mainClassPathById
=
69 SJME_JLONG_TO_POINTER(const sjme_list_sjme_jint
*, idsPtr
);
72 void SJME_JNI_METHOD(SJME_CLASS_NVM_BOOT_PARAM
, _1_1setSuite
)
73 (JNIEnv
* env
, jclass classy
, jlong thisPtr
, jlong funcsPtr
)
75 sjme_nvm_bootParam
* param
;
79 sjme_jni_throwVMException(env
, SJME_ERROR_NULL_ARGUMENTS
);
83 /* Get parameter data. */
84 param
= SJME_JLONG_TO_POINTER(sjme_nvm_bootParam
*, thisPtr
);
86 /* Set suite information. */
87 param
->bootSuite
= SJME_JLONG_TO_POINTER(sjme_rom_suite
, funcsPtr
);
90 void SJME_JNI_METHOD(SJME_CLASS_NVM_BOOT_PARAM
, _1_1setSysProps
)
91 (JNIEnv
* env
, jclass classy
, jlong thisPtr
, jlong listPtr
)
93 sjme_nvm_bootParam
* param
;
97 sjme_jni_throwVMException(env
, SJME_ERROR_NULL_ARGUMENTS
);
101 /* Get parameter data. */
102 param
= SJME_JLONG_TO_POINTER(sjme_nvm_bootParam
*, thisPtr
);
104 /* Set system property chain. */
105 param
->sysProps
= SJME_JLONG_TO_POINTER(sjme_list_sjme_lpcstr
*, listPtr
);