Check-in [0fb281b447]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Move constants to other file.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0fb281b4476d15fd7cde3969fbcaf0d5548ba6c8
User & Date: stephanie.gawroriski 2019-10-06 14:29:29
Context
2019-10-06
14:30
Move the static built-in font to another file. check-in: 5c1c5e72c6 user: stephanie.gawroriski tags: trunk
14:29
Move constants to other file. check-in: 0fb281b447 user: stephanie.gawroriski tags: trunk
14:15
If a display could not be obtained, make it untestable. check-in: 0b8bc0df22 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added ratufacoat/sjmecon.h.







































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
/* ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// --------------------------------------------------------------------------*/

/**
 * SquirrelJME constants.
 *
 * @since 2019/10/06
 */

/** Header guard. */
#ifndef SJME_hGRATUFACOATSJMONHSJMECONH
#define SJME_hGRATUFACOATSJMONHSJMECONH

/** Anti-C++. */
#ifdef _cplusplus
#ifndef SJME_CXX_IS_EXTERNED
#define SJME_CXX_IS_EXTERNED
#define SJME_cXRATUFACOATSJMONHSJMECONH
extern "C"
{
#endif /** #ifdef SJME_CXX_IS_EXTERNED */
#endif /** #ifdef __cplusplus */

/****************************************************************************/

/*****************************************************************************
***************************** DEFAULT CONSTANTS ******************************
*****************************************************************************/

/** Default RAM size. */
#define SJME_DEFAULT_RAM_SIZE SJME_JINT_C(16777216)

/** Minimum permitted RAM size. */
#define SJME_MINIMUM_RAM_SIZE SJME_JINT_C(65536)

/** Default size of configuration ROM. */
#define SJME_DEFAULT_CONF_SIZE SJME_JINT_C(65536)

/** Magic number for ROMs. */
#define SJME_ROM_MAGIC_NUMBER SJME_JINT_C(0x58455223)

/** Magic number for JARs. */
#define SJME_JAR_MAGIC_NUMBER SJME_JINT_C(0x00456570)

/** Check magic for BootRAM. */
#define SJME_BOOTRAM_CHECK_MAGIC SJME_JINT_C(0xFFFFFFFF)

/*****************************************************************************
**************************** CONFIGURATION ITEMS *****************************
*****************************************************************************/

/** End of configuration. */
#define SJME_CONFIG_END SJME_JINT_C(0)

/** Java VM Version. */
#define SJME_CONFIG_JAVA_VM_VERSION SJME_JINT_C(1)

/** Java VM Name. */
#define SJME_CONFIG_JAVA_VM_NAME SJME_JINT_C(2)

/** Java VM Vendor. */
#define SJME_CONFIG_JAVA_VM_VENDOR SJME_JINT_C(3)

/** Java VM E-Mail. */
#define SJME_CONFIG_JAVA_VM_EMAIL SJME_JINT_C(4)

/** Java VM URL. */
#define SJME_CONFIG_JAVA_VM_URL SJME_JINT_C(5)

/** The guest depth. */
#define SJME_CONFIG_GUEST_DEPTH SJME_JINT_C(6)

/** Main class. */
#define SJME_CONFIG_MAIN_CLASS SJME_JINT_C(7)

/** Main program arguments. */
#define SJME_CONFIG_MAIN_ARGUMENTS SJME_JINT_C(8)

/** Is this a MIDlet? */
#define SJME_CONFIG_IS_MIDLET SJME_JINT_C(9)

/** Define system propertly. */
#define SJME_CONFIG_DEFINE_PROPERTY SJME_JINT_C(10)

/** Classpath to use. */
#define SJME_CONFIG_CLASS_PATH SJME_JINT_C(11)

/** System call static field pointer. */
#define SJME_CONFIG_SYSCALL_STATIC_FIELD_POINTER SJME_JINT_C(12)

/** System call method pointer. */
#define SJME_CONFIG_SYSCALL_CODE_POINTER SJME_JINT_C(13)

/** System call pool pointer. */
#define SJME_CONFIG_SYSCALL_POOL_POINTER SJME_JINT_C(14)

/** Number of available options. */
#define SJME_CONFIG_NUM_OPTIONS SJME_JINT_C(15)

/*****************************************************************************
********************************* REGISTERS **********************************
*****************************************************************************/

/** Maximum CPU registers. */
#define SJME_MAX_REGISTERS SJME_JINT_C(64)

/** Maximum system call arguments. */
#define SJME_MAX_SYSCALLARGS SJME_JINT_C(8)

/** The zero register. */
#define SJME_ZERO_REGISTER SJME_JINT_C(0)

/** The return value register (two slots, 1 + 2). */
#define SJME_RETURN_REGISTER SJME_JINT_C(1)

/** Second return register. */
#define SJME_RETURN_TWO_REGISTER SJME_JINT_C(2)

/** The exception register. */
#define SJME_EXCEPTION_REGISTER SJME_JINT_C(3)

/** The pointer containing static field data. */
#define SJME_STATIC_FIELD_REGISTER SJME_JINT_C(4)

/** Register which represents the current thread of execution. */
#define SJME_THREAD_REGISTER SJME_JINT_C(5)

/** Base for local registers (locals start here). */
#define SJME_LOCAL_REGISTER_BASE SJME_JINT_C(6)

/** The register containing the constant pool. */
#define SJME_POOL_REGISTER SJME_JINT_C(6)

/** The register which contains the next pool pointer to use. */
#define SJME_NEXT_POOL_REGISTER SJME_JINT_C(7)

/** The register of the first argument. */
#define SJME_ARGBASE_REGISTER SJME_JINT_C(8)

/*****************************************************************************
*************************** INSTRUCTION ENCODINGS ****************************
*****************************************************************************/

/** Encoding mask. */
#define SJME_ENC_MASK UINT8_C(0xF0)

/** Math, R=RR, Integer. */
#define SJME_ENC_MATH_REG_INT UINT8_C(0x00)

/** Comparison mask. */
#define SJME_ENC_COMPARE_MASK UINT8_C(0x07)

/** Int comparison, then maybe jump. */
#define SJME_ENC_IF_ICMP UINT8_C(0x10)

/** Math type mask. */
#define SJME_ENC_MATH_MASK UINT8_C(0x0F)

/** Mask for Java order mode. */
#define SJME_ENC_MEMORY_JAVA_MASK UINT8_C(0x10)

/** Memory access, offset is in register. */
#define SJME_ENC_MEMORY_OFF_REG UINT8_C(0x20)

/** Memory access to big endian Java format, offset is in register. */
#define SJME_ENC_MEMORY_OFF_REG_JAVA UINT8_C(0x30)

/** Math, R=RC, Integer. */
#define SJME_ENC_MATH_CONST_INT UINT8_C(0x80)

/** Memory access, offset is a constant. */
#define SJME_ENC_MEMORY_OFF_ICONST UINT8_C(0xA0)

/** Memory access to big endian Java format, offset is a constant. */
#define SJME_ENC_MEMORY_OFF_ICONST_JAVA UINT8_C(0xB0)

/** Special. */
#define SJME_ENC_SPECIAL_A UINT8_C(0xE0)

/** Special.*/
#define SJME_ENC_SPECIAL_B UINT8_C(0xF0)

/*****************************************************************************
******************************* CPU OPERATIONS *******************************
*****************************************************************************/

/** If equal to constant. */
#define SJME_OP_IFEQ_CONST UINT8_C(0xE6)

/** Debug entry to method. */
#define SJME_OP_DEBUG_ENTRY UINT8_C(0xE8)

/** Debug exit from method. */
#define SJME_OP_DEBUG_EXIT UINT8_C(0xE9)

/** Debug single point in method. */
#define SJME_OP_DEBUG_POINT UINT8_C(0xEA)

/** Return. */
#define SJME_OP_RETURN UINT8_C(0xF3)

/** Invoke. */
#define SJME_OP_INVOKE UINT8_C(0xF7)

/** Copy value in register. */
#define SJME_OP_COPY UINT8_C(0xF8)

/** Atomically decrements a memory address and gets the value. */
#define SJME_OP_ATOMIC_INT_DECREMENT_AND_GET UINT8_C(0xF9)

/** Atomically increments a memory address. */
#define SJME_OP_ATOMIC_INT_INCREMENT UINT8_C(0xFA)

/** System call. */
#define SJME_OP_SYSTEM_CALL UINT8_C(0xFB)

/** Atomically checks, gets, and sets (if matched) the value. */
#define SJME_OP_ATOMIC_COMPARE_GET_AND_SET UINT8_C(0xFC)

/** Load from pool, note that at code gen time this is aliased. */
#define SJME_OP_LOAD_POOL UINT8_C(0xFD)

/** Load from integer array. */
#define SJME_OP_LOAD_FROM_INTARRAY UINT8_C(0xFE)

/** Compare and exchange. */
#define SJME_OP_BREAKPOINT UINT8_C(0xFF)

/*****************************************************************************
******************************** MATH TYPES **********************************
*****************************************************************************/

/** Add. */
#define SJME_MATH_ADD UINT8_C(0)

/** Subtract. */
#define SJME_MATH_SUB UINT8_C(1)

/** Multiply. */
#define SJME_MATH_MUL UINT8_C(2)

/** Divide. */
#define SJME_MATH_DIV UINT8_C(3)

/** Remainder. */
#define SJME_MATH_REM UINT8_C(4)

/** Negate. */
#define SJME_MATH_NEG UINT8_C(5)

/** Shift left. */
#define SJME_MATH_SHL UINT8_C(6)

/** Shift right. */
#define SJME_MATH_SHR UINT8_C(7)

/** Unsigned shift right. */
#define SJME_MATH_USHR UINT8_C(8)

/** And. */
#define SJME_MATH_AND UINT8_C(9)

/** Or. */
#define SJME_MATH_OR UINT8_C(10)

/** Xor. */
#define SJME_MATH_XOR UINT8_C(11)

/** Compare (Less). */
#define SJME_MATH_CMPL UINT8_C(12)

/** Compare (Greater). */
#define SJME_MATH_CMPG UINT8_C(13)

/** Sign 8-bit. */
#define SJME_MATH_SIGNX8 UINT8_C(14)

/** Sign 16-bit. */
#define SJME_MATH_SIGNX16 UINT8_C(15)

/*****************************************************************************
**************************** MEMORY OPERAND TYPES ****************************
*****************************************************************************/

/** Mask for read/write in memory. */
#define SJME_MEM_LOAD_MASK UINT8_C(0x08)

/** Mask for data types in memory. */
#define SJME_MEM_DATATYPE_MASK UINT8_C(0x07)

/*****************************************************************************
******************************** DATA TYPES **********************************
*****************************************************************************/

/** Object. */
#define SJME_DATATYPE_OBJECT UINT8_C(0)

/** Byte. */
#define SJME_DATATYPE_BYTE UINT8_C(1)

/** Short. */
#define SJME_DATATYPE_SHORT UINT8_C(2)

/** Character. */
#define SJME_DATATYPE_CHARACTER UINT8_C(3)

/** Integer. */
#define SJME_DATATYPE_INTEGER UINT8_C(4)

/** Float. */
#define SJME_DATATYPE_FLOAT UINT8_C(5)

/** Long. */
#define SJME_DATATYPE_LONG UINT8_C(6)

/** Double. */
#define SJME_DATATYPE_DOUBLE UINT8_C(7)

/*****************************************************************************
***************************** COMPARISON TYPES *******************************
*****************************************************************************/

/** Equals. */
#define SJME_COMPARETYPE_EQUALS SJME_JINT_C(0)

/** Not equals. */
#define SJME_COMPARETYPE_NOT_EQUALS SJME_JINT_C(1)

/** Less than. */
#define SJME_COMPARETYPE_LESS_THAN SJME_JINT_C(2)

/** Less or equals. */
#define SJME_COMPARETYPE_LESS_THAN_OR_EQUALS SJME_JINT_C(3)

/** Greater than. */
#define SJME_COMPARETYPE_GREATER_THAN SJME_JINT_C(4)

/** Greater or equals. */
#define SJME_COMPARETYPE_GREATER_THAN_OR_EQUALS SJME_JINT_C(5)

/** Always true. */
#define SJME_COMPARETYPE_TRUE SJME_JINT_C(6)

/** Always false. */
#define SJME_COMPARETYPE_FALSE SJME_JINT_C(7)

/*****************************************************************************
******************************* THREAD STATES ********************************
*****************************************************************************/

/** Maximum number of threads. */
#define SJME_THREAD_MAX SJME_JINT_C(32)

/** Mask for CPU threads. */
#define SJME_THREAD_MASK SJME_JINT_C(31)

/** Thread does not exist. */
#define SJME_THREAD_STATE_NONE 0

/** Thread is running. */
#define SJME_THREAD_STATE_RUNNING 1

/** Base size of arrays. */
#define SJME_ARRAY_BASE_SIZE SJME_JINT_C(20)

/*****************************************************************************
**************************** SYSTEM CALL INDEXES *****************************
*****************************************************************************/

/** Checks if the system call is supported. */
#define SJME_SYSCALL_QUERY_INDEX SJME_JINT_C(0)

/** Gets the last error state. */
#define SJME_SYSCALL_ERROR_GET SJME_JINT_C(1)

/** Sets the last error state. */
#define SJME_SYSCALL_ERROR_SET SJME_JINT_C(2)

/** Current wall clock milliseconds (low). */
#define SJME_SYSCALL_TIME_LO_MILLI_WALL SJME_JINT_C(3)

/** Current wall clock milliseconds (high). */
#define SJME_SYSCALL_TIME_HI_MILLI_WALL SJME_JINT_C(4)

/** Current monotonic clock nanoseconds (low). */
#define SJME_SYSCALL_TIME_LO_NANO_MONO SJME_JINT_C(5)

/** Current monotonic clock nanoseconds (high). */
#define SJME_SYSCALL_TIME_HI_NANO_MONO SJME_JINT_C(6)

/** VM Information: Free memory in bytes. */
#define SJME_SYSCALL_VMI_MEM_FREE SJME_JINT_C(7)

/** VM Information: Used memory in bytes. */
#define SJME_SYSCALL_VMI_MEM_USED SJME_JINT_C(8)

/** VM Information: Max memory in bytes. */
#define SJME_SYSCALL_VMI_MEM_MAX SJME_JINT_C(9)

/** Invoke the garbage collector. */
#define SJME_SYSCALL_GARBAGE_COLLECT SJME_JINT_C(10)

/** Exit the VM. */
#define SJME_SYSCALL_EXIT SJME_JINT_C(11)

/** The API Level of the VM. */
#define SJME_SYSCALL_API_LEVEL SJME_JINT_C(12)

/** The pipe descriptor for stdin. */
#define SJME_SYSCALL_PD_OF_STDIN SJME_JINT_C(13)

/** The pipe descriptor for stdout. */
#define SJME_SYSCALL_PD_OF_STDOUT SJME_JINT_C(14)

/** The pipe descriptor for stderr. */
#define SJME_SYSCALL_PD_OF_STDERR SJME_JINT_C(15)

/** Pipe descriptor: Write single byte. */
#define SJME_SYSCALL_PD_WRITE_BYTE SJME_JINT_C(16)

/** Set memory. */
#define SJME_SYSCALL_MEM_SET SJME_JINT_C(17)

/** Set memory but in 4-byte pattern. */
#define SJME_SYSCALL_MEM_SET_INT SJME_JINT_C(18)

/** Get the height of the call stack. */
#define SJME_SYSCALL_CALL_STACK_HEIGHT SJME_JINT_C(19)

/** Gets the specified call stack item. */
#define SJME_SYSCALL_CALL_STACK_ITEM SJME_JINT_C(20)

/** Returns the string of the given pointer. */
#define SJME_SYSCALL_LOAD_STRING SJME_JINT_C(21)

/** Fatal ToDo hit. */
#define SJME_SYSCALL_FATAL_TODO SJME_JINT_C(22)

/** The supervisor booted okay! */
#define SJME_SYSCALL_SUPERVISOR_BOOT_OKAY SJME_JINT_C(23)

/** Get property of the framebuffer. */
#define SJME_SYSCALL_FRAMEBUFFER_PROPERTY SJME_JINT_C(24)

/** Is the byte order little endian? */
#define SJME_SYSCALL_BYTE_ORDER_LITTLE SJME_JINT_C(25)

/** Returns the pointer to the option JAR data. */
#define SJME_SYSCALL_OPTION_JAR_DATA SJME_JINT_C(26)

/** Returns the size of the option JAR data. */
#define SJME_SYSCALL_OPTION_JAR_SIZE SJME_JINT_C(27)

/** Loads the specific class (Modified UTF Pointer). */
#define SJME_SYSCALL_LOAD_CLASS_UTF SJME_JINT_C(28)

/** Loads the specified class. */
#define SJME_SYSCALL_LOAD_CLASS_BYTES SJME_JINT_C(29)

/** Set supervisor register value. */
#define SJME_SYSCALL_SUPERVISOR_PROPERTY_SET SJME_JINT_C(30)

/** Get supervisor register value. */
#define SJME_SYSCALL_SUPERVISOR_PROPERTY_GET SJME_JINT_C(31)

/** Set task ID for current frame. */
#define SJME_SYSCALL_FRAME_TASK_ID_SET SJME_JINT_C(32)

/** Get task ID for current frame. */
#define SJME_SYSCALL_FRAME_TASK_ID_GET SJME_JINT_C(33)

/** Perform device feedback. */
#define SJME_SYSCALL_DEVICE_FEEDBACK SJME_JINT_C(34)

/** System call count. */
#define SJME_SYSCALL_NUM_SYSCALLS SJME_JINT_C(35)

/*****************************************************************************
************************** SYSTEM CALL ERROR CODES ***************************
*****************************************************************************/

/** No error, or success. */
#define SJME_SYSCALL_ERROR_NO_ERROR SJME_JINT_C(0)

/** The system call is not supported. */
#define SJME_SYSCALL_ERROR_UNSUPPORTED_SYSTEM_CALL SJME_JINT_C(-1)

/** The pipe descriptor is not valid. */
#define SJME_SYSCALL_ERROR_PIPE_DESCRIPTOR_INVALID SJME_JINT_C(-2)

/** Write error when writing to the pipe. */
#define SJME_SYSCALL_ERROR_PIPE_DESCRIPTOR_BAD_WRITE SJME_JINT_C(-3)

/** Value out of range. */
#define SJME_SYSCALL_ERROR_VALUE_OUT_OF_RANGE SJME_JINT_C(-4)

/** There is no framebuffer. */
#define SJME_SYSCALL_ERROR_NO_FRAMEBUFFER SJME_JINT_C(-5)

/** Permission denied. */
#define SJME_SYSCALL_ERROR_PERMISSION_DENIED SJME_JINT_C(-6)

/*****************************************************************************
***************************** PIPE DESCRIPTORS *******************************
*****************************************************************************/

/** Pipe descriptor for standard output. */
#define SJME_PIPE_FD_STDOUT SJME_JINT_C(1)

/** Pipe descriptor for standard error. */
#define SJME_PIPE_FD_STDERR SJME_JINT_C(2)

/*****************************************************************************
***************************** CALL STACK ITEMS* ******************************
*****************************************************************************/

/** The class name. */
#define SJME_CALLSTACKITEM_CLASS_NAME SJME_JINT_C(0)

/** The method name. */
#define SJME_CALLSTACKITEM_METHOD_NAME SJME_JINT_C(1)

/** The method type. */
#define SJME_CALLSTACKITEM_METHOD_TYPE SJME_JINT_C(2)

/** The current file. */
#define SJME_CALLSTACKITEM_SOURCE_FILE SJME_JINT_C(3)

/** Source line. */
#define SJME_CALLSTACKITEM_SOURCE_LINE SJME_JINT_C(4)

/** The PC address. */
#define SJME_CALLSTACKITEM_PC_ADDRESS SJME_JINT_C(5)

/** Java operation. */
#define SJME_CALLSTACKITEM_JAVA_OPERATION SJME_JINT_C(6)

/** Java PC address. */
#define SJME_CALLSTACKITEM_JAVA_PC_ADDRESS SJME_JINT_C(7)

/** Current Task ID. */
#define SJME_CALLSTACKITEM_TASK_ID SJME_JINT_C(8)

/** The number of supported items. */
#define SJME_CALLSTACKITEM_NUM_ITEMS SJME_JINT_C(9)

/*****************************************************************************
*************************** FRAMEBUFFER PROPERTIES ***************************
*****************************************************************************/

/** Returns the address of the framebuffer. */
#define SJME_FRAMEBUFFER_PROPERTY_ADDRESS SJME_JINT_C(1)

/** Returns the width of the framebuffer. */
#define SJME_FRAMEBUFFER_PROPERTY_WIDTH SJME_JINT_C(2)

/** Returns the height of the framebuffer. */
#define SJME_FRAMEBUFFER_PROPERTY_HEIGHT SJME_JINT_C(3)

/** Returns the scanline length in pixels. */
#define SJME_FRAMEBUFFER_PROPERTY_SCANLEN SJME_JINT_C(4)

/** Flushes the framebuffer. */
#define SJME_FRAMEBUFFER_PROPERTY_FLUSH SJME_JINT_C(5)

/** Pixel format of the screen. */
#define SJME_FRAMEBUFFER_PROPERTY_FORMAT SJME_JINT_C(6)

/** Returns the scanline length in bytes. */
#define SJME_FRAMEBUFFER_PROPERTY_SCANLEN_BYTES SJME_JINT_C(7)

/** Returns the number of bytes per pixel. */
#define SJME_FRAMEBUFFER_PROPERTY_BYTES_PER_PIXEL SJME_JINT_C(8)

/** Number of pixels in the display. */
#define SJME_FRAMEBUFFER_PROPERTY_NUM_PIXELS SJME_JINT_C(9)

/** Number of bits per pixel. */
#define SJME_FRAMEBUFFER_PROPERTY_BITS_PER_PIXEL SJME_JINT_C(10)

/** Get backlight level. */
#define SJME_FRAMEBUFFER_PROPERTY_BACKLIGHT_LEVEL_GET SJME_JINT_C(11)

/** Set backlight level. */
#define SJME_FRAMEBUFFER_PROPERTY_BACKLIGHT_LEVEL_SET SJME_JINT_C(12)

/** Maximum backlight level. */
#define SJME_FRAMEBUFFER_PROPERTY_BACKLIGHT_LEVEL_MAX SJME_JINT_C(13)

/** Maximum properties. */
#define SJME_FRAMEBUFFER_PROPERTY_NUM_PROPERTIES SJME_JINT_C(14)

/*****************************************************************************
*************************** SUPERVISOR PROPERTIES ****************************
*****************************************************************************/

/** The static field register of the task syscall handler. */
#define SJME_SUPERPROP_TASK_SYSCALL_STATIC_FIELD_POINTER SJME_JINT_C(1)

/** The method pointer of the task syscall method. */
#define SJME_SUPERPROP_TASK_SYSCALL_METHOD_HANDLER SJME_JINT_C(2)

/** The pool pointer of the task syscall method. */
#define SJME_SUPERPROP_TASK_SYSCALL_METHOD_POOL_POINTER SJME_JINT_C(3)

/** The number of available properties. */
#define SJME_SUPERPROP_NUM_PROPERTIES SJME_JINT_C(4)

/****************************************************************************/

/** Anti-C++. */
#ifdef __cplusplus
#ifdef SJME_cXRATUFACOATSJMONHSJMECONH
}
#undef SJME_cXRATUFACOATSJMONHSJMECONH
#undef SJME_CXX_IS_EXTERNED
#endif /** #ifdef SJME_cXRATUFACOATSJMONHSJMECONH */
#endif /** #ifdef __cplusplus */

/** Header guard. */
#endif /* #ifndef SJME_hGRATUFACOATSJMONHSJMECONH */

Changes to ratufacoat/sjmerc.c.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534

535
536
537
538
539
540
541
/**
 * SquirrelJME RatufaCoat Source.
 *
 * @since 2019/06/02
 */

#include "sjmerc.h"

/** Default RAM size. */
#define SJME_DEFAULT_RAM_SIZE SJME_JINT_C(16777216)

/** Minimum permitted RAM size. */
#define SJME_MINIMUM_RAM_SIZE SJME_JINT_C(65536)

/** Default size of configuration ROM. */
#define SJME_DEFAULT_CONF_SIZE SJME_JINT_C(65536)

/** Magic number for ROMs. */
#define SJME_ROM_MAGIC_NUMBER SJME_JINT_C(0x58455223)

/** Magic number for JARs. */
#define SJME_JAR_MAGIC_NUMBER SJME_JINT_C(0x00456570)

/** Check magic for BootRAM. */
#define SJME_BOOTRAM_CHECK_MAGIC SJME_JINT_C(0xFFFFFFFF)

/** End of configuration. */
#define SJME_CONFIG_END SJME_JINT_C(0)

/** Java VM Version. */
#define SJME_CONFIG_JAVA_VM_VERSION SJME_JINT_C(1)

/** Java VM Name. */
#define SJME_CONFIG_JAVA_VM_NAME SJME_JINT_C(2)

/** Java VM Vendor. */
#define SJME_CONFIG_JAVA_VM_VENDOR SJME_JINT_C(3)

/** Java VM E-Mail. */
#define SJME_CONFIG_JAVA_VM_EMAIL SJME_JINT_C(4)

/** Java VM URL. */
#define SJME_CONFIG_JAVA_VM_URL SJME_JINT_C(5)

/** The guest depth. */
#define SJME_CONFIG_GUEST_DEPTH SJME_JINT_C(6)

/** Main class. */
#define SJME_CONFIG_MAIN_CLASS SJME_JINT_C(7)

/** Main program arguments. */
#define SJME_CONFIG_MAIN_ARGUMENTS SJME_JINT_C(8)

/** Is this a MIDlet? */
#define SJME_CONFIG_IS_MIDLET SJME_JINT_C(9)

/** Define system propertly. */
#define SJME_CONFIG_DEFINE_PROPERTY SJME_JINT_C(10)

/** Classpath to use. */
#define SJME_CONFIG_CLASS_PATH SJME_JINT_C(11)

/** System call static field pointer. */
#define SJME_CONFIG_SYSCALL_STATIC_FIELD_POINTER SJME_JINT_C(12)

/** System call method pointer. */
#define SJME_CONFIG_SYSCALL_CODE_POINTER SJME_JINT_C(13)

/** System call pool pointer. */
#define SJME_CONFIG_SYSCALL_POOL_POINTER SJME_JINT_C(14)

/** Number of available options. */
#define SJME_CONFIG_NUM_OPTIONS SJME_JINT_C(15)

/** Maximum CPU registers. */
#define SJME_MAX_REGISTERS SJME_JINT_C(64)

/** Maximum system call arguments. */
#define SJME_MAX_SYSCALLARGS SJME_JINT_C(8)

/** The zero register. */
#define SJME_ZERO_REGISTER SJME_JINT_C(0)

/** The return value register (two slots, 1 + 2). */
#define SJME_RETURN_REGISTER SJME_JINT_C(1)

/** Second return register. */
#define SJME_RETURN_TWO_REGISTER SJME_JINT_C(2)

/** The exception register. */
#define SJME_EXCEPTION_REGISTER SJME_JINT_C(3)

/** The pointer containing static field data. */
#define SJME_STATIC_FIELD_REGISTER SJME_JINT_C(4)

/** Register which represents the current thread of execution. */
#define SJME_THREAD_REGISTER SJME_JINT_C(5)

/** Base for local registers (locals start here). */
#define SJME_LOCAL_REGISTER_BASE SJME_JINT_C(6)

/** The register containing the constant pool. */
#define SJME_POOL_REGISTER SJME_JINT_C(6)

/** The register which contains the next pool pointer to use. */
#define SJME_NEXT_POOL_REGISTER SJME_JINT_C(7)

/** The register of the first argument. */
#define SJME_ARGBASE_REGISTER SJME_JINT_C(8)

/** Encoding mask. */
#define SJME_ENC_MASK UINT8_C(0xF0)

/** Math, R=RR, Integer. */
#define SJME_ENC_MATH_REG_INT UINT8_C(0x00)

/** Comparison mask. */
#define SJME_ENC_COMPARE_MASK UINT8_C(0x07)

/** Int comparison, then maybe jump. */
#define SJME_ENC_IF_ICMP UINT8_C(0x10)

/** Math type mask. */
#define SJME_ENC_MATH_MASK UINT8_C(0x0F)

/** Mask for Java order mode. */
#define SJME_ENC_MEMORY_JAVA_MASK UINT8_C(0x10)

/** Memory access, offset is in register. */
#define SJME_ENC_MEMORY_OFF_REG UINT8_C(0x20)

/** Memory access to big endian Java format, offset is in register. */
#define SJME_ENC_MEMORY_OFF_REG_JAVA UINT8_C(0x30)

/** Math, R=RC, Integer. */
#define SJME_ENC_MATH_CONST_INT UINT8_C(0x80)

/** Memory access, offset is a constant. */
#define SJME_ENC_MEMORY_OFF_ICONST UINT8_C(0xA0)

/** Memory access to big endian Java format, offset is a constant. */
#define SJME_ENC_MEMORY_OFF_ICONST_JAVA UINT8_C(0xB0)

/** Special. */
#define SJME_ENC_SPECIAL_A UINT8_C(0xE0)

/** Special.*/
#define SJME_ENC_SPECIAL_B UINT8_C(0xF0)

/** If equal to constant. */
#define SJME_OP_IFEQ_CONST UINT8_C(0xE6)

/** Debug entry to method. */
#define SJME_OP_DEBUG_ENTRY UINT8_C(0xE8)

/** Debug exit from method. */
#define SJME_OP_DEBUG_EXIT UINT8_C(0xE9)

/** Debug single point in method. */
#define SJME_OP_DEBUG_POINT UINT8_C(0xEA)

/** Return. */
#define SJME_OP_RETURN UINT8_C(0xF3)

/** Invoke. */
#define SJME_OP_INVOKE UINT8_C(0xF7)

/** Copy value in register. */
#define SJME_OP_COPY UINT8_C(0xF8)

/** Atomically decrements a memory address and gets the value. */
#define SJME_OP_ATOMIC_INT_DECREMENT_AND_GET UINT8_C(0xF9)

/** Atomically increments a memory address. */
#define SJME_OP_ATOMIC_INT_INCREMENT UINT8_C(0xFA)

/** System call. */
#define SJME_OP_SYSTEM_CALL UINT8_C(0xFB)

/** Atomically checks, gets, and sets (if matched) the value. */
#define SJME_OP_ATOMIC_COMPARE_GET_AND_SET UINT8_C(0xFC)

/** Load from pool, note that at code gen time this is aliased. */
#define SJME_OP_LOAD_POOL UINT8_C(0xFD)

/** Load from integer array. */
#define SJME_OP_LOAD_FROM_INTARRAY UINT8_C(0xFE)

/** Compare and exchange. */
#define SJME_OP_BREAKPOINT UINT8_C(0xFF)

/** Add. */
#define SJME_MATH_ADD UINT8_C(0)

/** Subtract. */
#define SJME_MATH_SUB UINT8_C(1)

/** Multiply. */
#define SJME_MATH_MUL UINT8_C(2)

/** Divide. */
#define SJME_MATH_DIV UINT8_C(3)

/** Remainder. */
#define SJME_MATH_REM UINT8_C(4)

/** Negate. */
#define SJME_MATH_NEG UINT8_C(5)

/** Shift left. */
#define SJME_MATH_SHL UINT8_C(6)

/** Shift right. */
#define SJME_MATH_SHR UINT8_C(7)

/** Unsigned shift right. */
#define SJME_MATH_USHR UINT8_C(8)

/** And. */
#define SJME_MATH_AND UINT8_C(9)

/** Or. */
#define SJME_MATH_OR UINT8_C(10)

/** Xor. */
#define SJME_MATH_XOR UINT8_C(11)

/** Compare (Less). */
#define SJME_MATH_CMPL UINT8_C(12)

/** Compare (Greater). */
#define SJME_MATH_CMPG UINT8_C(13)

/** Sign 8-bit. */
#define SJME_MATH_SIGNX8 UINT8_C(14)

/** Sign 16-bit. */
#define SJME_MATH_SIGNX16 UINT8_C(15)

/** Mask for read/write in memory. */
#define SJME_MEM_LOAD_MASK UINT8_C(0x08)

/** Mask for data types in memory. */
#define SJME_MEM_DATATYPE_MASK UINT8_C(0x07)

/** Object. */
#define SJME_DATATYPE_OBJECT UINT8_C(0)

/** Byte. */
#define SJME_DATATYPE_BYTE UINT8_C(1)

/** Short. */
#define SJME_DATATYPE_SHORT UINT8_C(2)

/** Character. */
#define SJME_DATATYPE_CHARACTER UINT8_C(3)

/** Integer. */
#define SJME_DATATYPE_INTEGER UINT8_C(4)

/** Float. */
#define SJME_DATATYPE_FLOAT UINT8_C(5)

/** Long. */
#define SJME_DATATYPE_LONG UINT8_C(6)

/** Double. */
#define SJME_DATATYPE_DOUBLE UINT8_C(7)

/** Equals. */
#define SJME_COMPARETYPE_EQUALS SJME_JINT_C(0)

/** Not equals. */
#define SJME_COMPARETYPE_NOT_EQUALS SJME_JINT_C(1)

/** Less than. */
#define SJME_COMPARETYPE_LESS_THAN SJME_JINT_C(2)

/** Less or equals. */
#define SJME_COMPARETYPE_LESS_THAN_OR_EQUALS SJME_JINT_C(3)

/** Greater than. */
#define SJME_COMPARETYPE_GREATER_THAN SJME_JINT_C(4)

/** Greater or equals. */
#define SJME_COMPARETYPE_GREATER_THAN_OR_EQUALS SJME_JINT_C(5)

/** Always true. */
#define SJME_COMPARETYPE_TRUE SJME_JINT_C(6)

/** Always false. */
#define SJME_COMPARETYPE_FALSE SJME_JINT_C(7)

/** Maximum number of threads. */
#define SJME_THREAD_MAX SJME_JINT_C(32)

/** Mask for CPU threads. */
#define SJME_THREAD_MASK SJME_JINT_C(31)

/** Thread does not exist. */
#define SJME_THREAD_STATE_NONE 0

/** Thread is running. */
#define SJME_THREAD_STATE_RUNNING 1

/** Base size of arrays. */
#define SJME_ARRAY_BASE_SIZE SJME_JINT_C(20)

/** Checks if the system call is supported. */
#define SJME_SYSCALL_QUERY_INDEX SJME_JINT_C(0)

/** Gets the last error state. */
#define SJME_SYSCALL_ERROR_GET SJME_JINT_C(1)

/** Sets the last error state. */
#define SJME_SYSCALL_ERROR_SET SJME_JINT_C(2)

/** Current wall clock milliseconds (low). */
#define SJME_SYSCALL_TIME_LO_MILLI_WALL SJME_JINT_C(3)

/** Current wall clock milliseconds (high). */
#define SJME_SYSCALL_TIME_HI_MILLI_WALL SJME_JINT_C(4)

/** Current monotonic clock nanoseconds (low). */
#define SJME_SYSCALL_TIME_LO_NANO_MONO SJME_JINT_C(5)

/** Current monotonic clock nanoseconds (high). */
#define SJME_SYSCALL_TIME_HI_NANO_MONO SJME_JINT_C(6)

/** VM Information: Free memory in bytes. */
#define SJME_SYSCALL_VMI_MEM_FREE SJME_JINT_C(7)

/** VM Information: Used memory in bytes. */
#define SJME_SYSCALL_VMI_MEM_USED SJME_JINT_C(8)

/** VM Information: Max memory in bytes. */
#define SJME_SYSCALL_VMI_MEM_MAX SJME_JINT_C(9)

/** Invoke the garbage collector. */
#define SJME_SYSCALL_GARBAGE_COLLECT SJME_JINT_C(10)

/** Exit the VM. */
#define SJME_SYSCALL_EXIT SJME_JINT_C(11)

/** The API Level of the VM. */
#define SJME_SYSCALL_API_LEVEL SJME_JINT_C(12)

/** The pipe descriptor for stdin. */
#define SJME_SYSCALL_PD_OF_STDIN SJME_JINT_C(13)

/** The pipe descriptor for stdout. */
#define SJME_SYSCALL_PD_OF_STDOUT SJME_JINT_C(14)

/** The pipe descriptor for stderr. */
#define SJME_SYSCALL_PD_OF_STDERR SJME_JINT_C(15)

/** Pipe descriptor: Write single byte. */
#define SJME_SYSCALL_PD_WRITE_BYTE SJME_JINT_C(16)

/** Set memory. */
#define SJME_SYSCALL_MEM_SET SJME_JINT_C(17)

/** Set memory but in 4-byte pattern. */
#define SJME_SYSCALL_MEM_SET_INT SJME_JINT_C(18)

/** Get the height of the call stack. */
#define SJME_SYSCALL_CALL_STACK_HEIGHT SJME_JINT_C(19)

/** Gets the specified call stack item. */
#define SJME_SYSCALL_CALL_STACK_ITEM SJME_JINT_C(20)

/** Returns the string of the given pointer. */
#define SJME_SYSCALL_LOAD_STRING SJME_JINT_C(21)

/** Fatal ToDo hit. */
#define SJME_SYSCALL_FATAL_TODO SJME_JINT_C(22)

/** The supervisor booted okay! */
#define SJME_SYSCALL_SUPERVISOR_BOOT_OKAY SJME_JINT_C(23)

/** Get property of the framebuffer. */
#define SJME_SYSCALL_FRAMEBUFFER_PROPERTY SJME_JINT_C(24)

/** Is the byte order little endian? */
#define SJME_SYSCALL_BYTE_ORDER_LITTLE SJME_JINT_C(25)

/** Returns the pointer to the option JAR data. */
#define SJME_SYSCALL_OPTION_JAR_DATA SJME_JINT_C(26)

/** Returns the size of the option JAR data. */
#define SJME_SYSCALL_OPTION_JAR_SIZE SJME_JINT_C(27)

/** Loads the specific class (Modified UTF Pointer). */
#define SJME_SYSCALL_LOAD_CLASS_UTF SJME_JINT_C(28)

/** Loads the specified class. */
#define SJME_SYSCALL_LOAD_CLASS_BYTES SJME_JINT_C(29)

/** Set supervisor register value. */
#define SJME_SYSCALL_SUPERVISOR_PROPERTY_SET SJME_JINT_C(30)

/** Get supervisor register value. */
#define SJME_SYSCALL_SUPERVISOR_PROPERTY_GET SJME_JINT_C(31)

/** Set task ID for current frame. */
#define SJME_SYSCALL_FRAME_TASK_ID_SET SJME_JINT_C(32)

/** Get task ID for current frame. */
#define SJME_SYSCALL_FRAME_TASK_ID_GET SJME_JINT_C(33)

/** Perform device feedback. */
#define SJME_SYSCALL_DEVICE_FEEDBACK SJME_JINT_C(34)

/** System call count. */
#define SJME_SYSCALL_NUM_SYSCALLS SJME_JINT_C(35)

/** No error, or success. */
#define SJME_SYSCALL_ERROR_NO_ERROR SJME_JINT_C(0)

/** The system call is not supported. */
#define SJME_SYSCALL_ERROR_UNSUPPORTED_SYSTEM_CALL SJME_JINT_C(-1)

/** The pipe descriptor is not valid. */
#define SJME_SYSCALL_ERROR_PIPE_DESCRIPTOR_INVALID SJME_JINT_C(-2)

/** Write error when writing to the pipe. */
#define SJME_SYSCALL_ERROR_PIPE_DESCRIPTOR_BAD_WRITE SJME_JINT_C(-3)

/** Value out of range. */
#define SJME_SYSCALL_ERROR_VALUE_OUT_OF_RANGE SJME_JINT_C(-4)

/** There is no framebuffer. */
#define SJME_SYSCALL_ERROR_NO_FRAMEBUFFER SJME_JINT_C(-5)

/** Permission denied. */
#define SJME_SYSCALL_ERROR_PERMISSION_DENIED SJME_JINT_C(-6)

/** Pipe descriptor for standard output. */
#define SJME_PIPE_FD_STDOUT SJME_JINT_C(1)

/** Pipe descriptor for standard error. */
#define SJME_PIPE_FD_STDERR SJME_JINT_C(2)

/** The class name. */
#define SJME_CALLSTACKITEM_CLASS_NAME SJME_JINT_C(0)

/** The method name. */
#define SJME_CALLSTACKITEM_METHOD_NAME SJME_JINT_C(1)

/** The method type. */
#define SJME_CALLSTACKITEM_METHOD_TYPE SJME_JINT_C(2)

/** The current file. */
#define SJME_CALLSTACKITEM_SOURCE_FILE SJME_JINT_C(3)

/** Source line. */
#define SJME_CALLSTACKITEM_SOURCE_LINE SJME_JINT_C(4)

/** The PC address. */
#define SJME_CALLSTACKITEM_PC_ADDRESS SJME_JINT_C(5)

/** Java operation. */
#define SJME_CALLSTACKITEM_JAVA_OPERATION SJME_JINT_C(6)

/** Java PC address. */
#define SJME_CALLSTACKITEM_JAVA_PC_ADDRESS SJME_JINT_C(7)

/** Current Task ID. */
#define SJME_CALLSTACKITEM_TASK_ID SJME_JINT_C(8)

/** The number of supported items. */
#define SJME_CALLSTACKITEM_NUM_ITEMS SJME_JINT_C(9)

/** Returns the address of the framebuffer. */
#define SJME_FRAMEBUFFER_PROPERTY_ADDRESS SJME_JINT_C(1)

/** Returns the width of the framebuffer. */
#define SJME_FRAMEBUFFER_PROPERTY_WIDTH SJME_JINT_C(2)

/** Returns the height of the framebuffer. */
#define SJME_FRAMEBUFFER_PROPERTY_HEIGHT SJME_JINT_C(3)

/** Returns the scanline length in pixels. */
#define SJME_FRAMEBUFFER_PROPERTY_SCANLEN SJME_JINT_C(4)

/** Flushes the framebuffer. */
#define SJME_FRAMEBUFFER_PROPERTY_FLUSH SJME_JINT_C(5)

/** Pixel format of the screen. */
#define SJME_FRAMEBUFFER_PROPERTY_FORMAT SJME_JINT_C(6)

/** Returns the scanline length in bytes. */
#define SJME_FRAMEBUFFER_PROPERTY_SCANLEN_BYTES SJME_JINT_C(7)

/** Returns the number of bytes per pixel. */
#define SJME_FRAMEBUFFER_PROPERTY_BYTES_PER_PIXEL SJME_JINT_C(8)

/** Number of pixels in the display. */
#define SJME_FRAMEBUFFER_PROPERTY_NUM_PIXELS SJME_JINT_C(9)

/** Number of bits per pixel. */
#define SJME_FRAMEBUFFER_PROPERTY_BITS_PER_PIXEL SJME_JINT_C(10)

/** Get backlight level. */
#define SJME_FRAMEBUFFER_PROPERTY_BACKLIGHT_LEVEL_GET SJME_JINT_C(11)

/** Set backlight level. */
#define SJME_FRAMEBUFFER_PROPERTY_BACKLIGHT_LEVEL_SET SJME_JINT_C(12)

/** Maximum backlight level. */
#define SJME_FRAMEBUFFER_PROPERTY_BACKLIGHT_LEVEL_MAX SJME_JINT_C(13)

/** Maximum properties. */
#define SJME_FRAMEBUFFER_PROPERTY_NUM_PROPERTIES SJME_JINT_C(14)

/** The static field register of the task syscall handler. */
#define SJME_SUPERPROP_TASK_SYSCALL_STATIC_FIELD_POINTER SJME_JINT_C(1)

/** The method pointer of the task syscall method. */
#define SJME_SUPERPROP_TASK_SYSCALL_METHOD_HANDLER SJME_JINT_C(2)

/** The pool pointer of the task syscall method. */
#define SJME_SUPERPROP_TASK_SYSCALL_METHOD_POOL_POINTER SJME_JINT_C(3)

/** The number of available properties. */
#define SJME_SUPERPROP_NUM_PROPERTIES SJME_JINT_C(4)


/** Upper shift value mask, since shifting off the type is undefined. */
static sjme_jint sjme_sh_umask[33] =
{
	SJME_JINT_C(0xFFFFFFFF),
	SJME_JINT_C(0xFFFFFFFE),
	SJME_JINT_C(0xFFFFFFFC),







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
>







9
10
11
12
13
14
15







































































































































































































































































































































































































































































































































16
17
18
19
20
21
22
23
/**
 * SquirrelJME RatufaCoat Source.
 *
 * @since 2019/06/02
 */

#include "sjmerc.h"







































































































































































































































































































































































































































































































































#include "sjmecon.h"

/** Upper shift value mask, since shifting off the type is undefined. */
static sjme_jint sjme_sh_umask[33] =
{
	SJME_JINT_C(0xFFFFFFFF),
	SJME_JINT_C(0xFFFFFFFE),
	SJME_JINT_C(0xFFFFFFFC),