From 6a8f5e97411f31f9054006427d3176a1c1d3c722 Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Wed, 1 Jan 2025 07:08:58 -0600 Subject: [PATCH] regenerate classpath --- c/classpath.h | 10 + c/classpath.inc.c | 10 + c/native.c | 4 +- classpath.mk | 10 + example/Vec2.class.h | 15 + java/lang/Boolean.class.h | 15 + java/lang/Byte.class.h | 15 + java/lang/Character.class.h | 15 + java/lang/Short.class.h | 15 + java/nio/Buffer.class.h | 15 + java/nio/ByteBuffer.class.h | 15 + java/nio/ByteOrder.class.h | 15 + sega/dreamcast/gdrom/Gdrom.class.h | 15 + sega/dreamcast/gdrom/GdromBits.class.h | 15 + .../gdrom/GdromCommandPacketFormat.java | 554 ------------------ 15 files changed, 181 insertions(+), 557 deletions(-) create mode 100644 example/Vec2.class.h create mode 100644 java/lang/Boolean.class.h create mode 100644 java/lang/Byte.class.h create mode 100644 java/lang/Character.class.h create mode 100644 java/lang/Short.class.h create mode 100644 java/nio/Buffer.class.h create mode 100644 java/nio/ByteBuffer.class.h create mode 100644 java/nio/ByteOrder.class.h create mode 100644 sega/dreamcast/gdrom/Gdrom.class.h create mode 100644 sega/dreamcast/gdrom/GdromBits.class.h delete mode 100644 sega/dreamcast/gdrom/GdromCommandPacketFormat.java diff --git a/c/classpath.h b/c/classpath.h index 0db1aa0..850ee9d 100644 --- a/c/classpath.h +++ b/c/classpath.h @@ -1,6 +1,10 @@ #include "example/DreamcastVideo2.class.h" #include "example/DreamcastVideo.class.h" +#include "example/Vec2.class.h" #include "java/io/PrintStream.class.h" +#include "java/lang/Boolean.class.h" +#include "java/lang/Byte.class.h" +#include "java/lang/Character.class.h" #include "java/lang/DecimalDigits.class.h" #include "java/lang/Double.class.h" #include "java/lang/Float.class.h" @@ -8,15 +12,21 @@ #include "java/lang/Long.class.h" #include "java/lang/Math.class.h" #include "java/lang/Object.class.h" +#include "java/lang/Short.class.h" #include "java/lang/String.class.h" #include "java/lang/System.class.h" #include "java/misc/Memory.class.h" #include "java/misc/Resource.class.h" +#include "java/nio/Buffer.class.h" +#include "java/nio/ByteBuffer.class.h" +#include "java/nio/ByteOrder.class.h" #include "model/FacePTN.class.h" #include "model/ModelObject.class.h" #include "model/UntitledModel.class.h" #include "model/Vec2.class.h" #include "model/Vec3.class.h" +#include "sega/dreamcast/gdrom/GdromBits.class.h" +#include "sega/dreamcast/gdrom/Gdrom.class.h" #include "sega/dreamcast/holly/Background.class.h" #include "sega/dreamcast/holly/CoreBits.class.h" #include "sega/dreamcast/holly/Core.class.h" diff --git a/c/classpath.inc.c b/c/classpath.inc.c index d473912..e9958a1 100644 --- a/c/classpath.inc.c +++ b/c/classpath.inc.c @@ -1,6 +1,10 @@ (const uint8_t *)&_binary_example_DreamcastVideo2_class_start, (const uint8_t *)&_binary_example_DreamcastVideo_class_start, +(const uint8_t *)&_binary_example_Vec2_class_start, (const uint8_t *)&_binary_java_io_PrintStream_class_start, +(const uint8_t *)&_binary_java_lang_Boolean_class_start, +(const uint8_t *)&_binary_java_lang_Byte_class_start, +(const uint8_t *)&_binary_java_lang_Character_class_start, (const uint8_t *)&_binary_java_lang_DecimalDigits_class_start, (const uint8_t *)&_binary_java_lang_Double_class_start, (const uint8_t *)&_binary_java_lang_Float_class_start, @@ -8,15 +12,21 @@ (const uint8_t *)&_binary_java_lang_Long_class_start, (const uint8_t *)&_binary_java_lang_Math_class_start, (const uint8_t *)&_binary_java_lang_Object_class_start, +(const uint8_t *)&_binary_java_lang_Short_class_start, (const uint8_t *)&_binary_java_lang_String_class_start, (const uint8_t *)&_binary_java_lang_System_class_start, (const uint8_t *)&_binary_java_misc_Memory_class_start, (const uint8_t *)&_binary_java_misc_Resource_class_start, +(const uint8_t *)&_binary_java_nio_Buffer_class_start, +(const uint8_t *)&_binary_java_nio_ByteBuffer_class_start, +(const uint8_t *)&_binary_java_nio_ByteOrder_class_start, (const uint8_t *)&_binary_model_FacePTN_class_start, (const uint8_t *)&_binary_model_ModelObject_class_start, (const uint8_t *)&_binary_model_UntitledModel_class_start, (const uint8_t *)&_binary_model_Vec2_class_start, (const uint8_t *)&_binary_model_Vec3_class_start, +(const uint8_t *)&_binary_sega_dreamcast_gdrom_GdromBits_class_start, +(const uint8_t *)&_binary_sega_dreamcast_gdrom_Gdrom_class_start, (const uint8_t *)&_binary_sega_dreamcast_holly_Background_class_start, (const uint8_t *)&_binary_sega_dreamcast_holly_CoreBits_class_start, (const uint8_t *)&_binary_sega_dreamcast_holly_Core_class_start, diff --git a/c/native.c b/c/native.c index 071c4df..399c97b 100644 --- a/c/native.c +++ b/c/native.c @@ -1,5 +1,3 @@ -#include - #include "native.h" #include "printf.h" @@ -128,5 +126,5 @@ uint32_t java_misc_resource_getresource_1(uint32_t * args) uint32_t native_java_misc_memory_isbigendian() { - return (__STDC_ENDIAN_BIG__ == __STDC_ENDIAN_NATIVE__); + return (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__); } diff --git a/classpath.mk b/classpath.mk index 8e98d79..2d1ed8c 100644 --- a/classpath.mk +++ b/classpath.mk @@ -1,7 +1,11 @@ CLASS_PATH = \ example/DreamcastVideo2.class.o \ example/DreamcastVideo.class.o \ + example/Vec2.class.o \ java/io/PrintStream.class.o \ + java/lang/Boolean.class.o \ + java/lang/Byte.class.o \ + java/lang/Character.class.o \ java/lang/DecimalDigits.class.o \ java/lang/Double.class.o \ java/lang/Float.class.o \ @@ -9,15 +13,21 @@ CLASS_PATH = \ java/lang/Long.class.o \ java/lang/Math.class.o \ java/lang/Object.class.o \ + java/lang/Short.class.o \ java/lang/String.class.o \ java/lang/System.class.o \ java/misc/Memory.class.o \ java/misc/Resource.class.o \ + java/nio/Buffer.class.o \ + java/nio/ByteBuffer.class.o \ + java/nio/ByteOrder.class.o \ model/FacePTN.class.o \ model/ModelObject.class.o \ model/UntitledModel.class.o \ model/Vec2.class.o \ model/Vec3.class.o \ + sega/dreamcast/gdrom/GdromBits.class.o \ + sega/dreamcast/gdrom/Gdrom.class.o \ sega/dreamcast/holly/Background.class.o \ sega/dreamcast/holly/CoreBits.class.o \ sega/dreamcast/holly/Core.class.o \ diff --git a/example/Vec2.class.h b/example/Vec2.class.h new file mode 100644 index 0000000..fa2112e --- /dev/null +++ b/example/Vec2.class.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern C { +#endif + +extern uint32_t _binary_example_Vec2_class_start __asm("_binary_example_Vec2_class_start"); +extern uint32_t _binary_example_Vec2_class_end __asm("_binary_example_Vec2_class_end"); +extern uint32_t _binary_example_Vec2_class_size __asm("_binary_example_Vec2_class_size"); + +#ifdef __cplusplus +} +#endif diff --git a/java/lang/Boolean.class.h b/java/lang/Boolean.class.h new file mode 100644 index 0000000..c4c6e84 --- /dev/null +++ b/java/lang/Boolean.class.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern C { +#endif + +extern uint32_t _binary_java_lang_Boolean_class_start __asm("_binary_java_lang_Boolean_class_start"); +extern uint32_t _binary_java_lang_Boolean_class_end __asm("_binary_java_lang_Boolean_class_end"); +extern uint32_t _binary_java_lang_Boolean_class_size __asm("_binary_java_lang_Boolean_class_size"); + +#ifdef __cplusplus +} +#endif diff --git a/java/lang/Byte.class.h b/java/lang/Byte.class.h new file mode 100644 index 0000000..66e4ba9 --- /dev/null +++ b/java/lang/Byte.class.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern C { +#endif + +extern uint32_t _binary_java_lang_Byte_class_start __asm("_binary_java_lang_Byte_class_start"); +extern uint32_t _binary_java_lang_Byte_class_end __asm("_binary_java_lang_Byte_class_end"); +extern uint32_t _binary_java_lang_Byte_class_size __asm("_binary_java_lang_Byte_class_size"); + +#ifdef __cplusplus +} +#endif diff --git a/java/lang/Character.class.h b/java/lang/Character.class.h new file mode 100644 index 0000000..37ec4dd --- /dev/null +++ b/java/lang/Character.class.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern C { +#endif + +extern uint32_t _binary_java_lang_Character_class_start __asm("_binary_java_lang_Character_class_start"); +extern uint32_t _binary_java_lang_Character_class_end __asm("_binary_java_lang_Character_class_end"); +extern uint32_t _binary_java_lang_Character_class_size __asm("_binary_java_lang_Character_class_size"); + +#ifdef __cplusplus +} +#endif diff --git a/java/lang/Short.class.h b/java/lang/Short.class.h new file mode 100644 index 0000000..3b0ca98 --- /dev/null +++ b/java/lang/Short.class.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern C { +#endif + +extern uint32_t _binary_java_lang_Short_class_start __asm("_binary_java_lang_Short_class_start"); +extern uint32_t _binary_java_lang_Short_class_end __asm("_binary_java_lang_Short_class_end"); +extern uint32_t _binary_java_lang_Short_class_size __asm("_binary_java_lang_Short_class_size"); + +#ifdef __cplusplus +} +#endif diff --git a/java/nio/Buffer.class.h b/java/nio/Buffer.class.h new file mode 100644 index 0000000..8b057c5 --- /dev/null +++ b/java/nio/Buffer.class.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern C { +#endif + +extern uint32_t _binary_java_nio_Buffer_class_start __asm("_binary_java_nio_Buffer_class_start"); +extern uint32_t _binary_java_nio_Buffer_class_end __asm("_binary_java_nio_Buffer_class_end"); +extern uint32_t _binary_java_nio_Buffer_class_size __asm("_binary_java_nio_Buffer_class_size"); + +#ifdef __cplusplus +} +#endif diff --git a/java/nio/ByteBuffer.class.h b/java/nio/ByteBuffer.class.h new file mode 100644 index 0000000..490ba9b --- /dev/null +++ b/java/nio/ByteBuffer.class.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern C { +#endif + +extern uint32_t _binary_java_nio_ByteBuffer_class_start __asm("_binary_java_nio_ByteBuffer_class_start"); +extern uint32_t _binary_java_nio_ByteBuffer_class_end __asm("_binary_java_nio_ByteBuffer_class_end"); +extern uint32_t _binary_java_nio_ByteBuffer_class_size __asm("_binary_java_nio_ByteBuffer_class_size"); + +#ifdef __cplusplus +} +#endif diff --git a/java/nio/ByteOrder.class.h b/java/nio/ByteOrder.class.h new file mode 100644 index 0000000..9d3ff71 --- /dev/null +++ b/java/nio/ByteOrder.class.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern C { +#endif + +extern uint32_t _binary_java_nio_ByteOrder_class_start __asm("_binary_java_nio_ByteOrder_class_start"); +extern uint32_t _binary_java_nio_ByteOrder_class_end __asm("_binary_java_nio_ByteOrder_class_end"); +extern uint32_t _binary_java_nio_ByteOrder_class_size __asm("_binary_java_nio_ByteOrder_class_size"); + +#ifdef __cplusplus +} +#endif diff --git a/sega/dreamcast/gdrom/Gdrom.class.h b/sega/dreamcast/gdrom/Gdrom.class.h new file mode 100644 index 0000000..bf9b10f --- /dev/null +++ b/sega/dreamcast/gdrom/Gdrom.class.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern C { +#endif + +extern uint32_t _binary_sega_dreamcast_gdrom_Gdrom_class_start __asm("_binary_sega_dreamcast_gdrom_Gdrom_class_start"); +extern uint32_t _binary_sega_dreamcast_gdrom_Gdrom_class_end __asm("_binary_sega_dreamcast_gdrom_Gdrom_class_end"); +extern uint32_t _binary_sega_dreamcast_gdrom_Gdrom_class_size __asm("_binary_sega_dreamcast_gdrom_Gdrom_class_size"); + +#ifdef __cplusplus +} +#endif diff --git a/sega/dreamcast/gdrom/GdromBits.class.h b/sega/dreamcast/gdrom/GdromBits.class.h new file mode 100644 index 0000000..c1cbad5 --- /dev/null +++ b/sega/dreamcast/gdrom/GdromBits.class.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern C { +#endif + +extern uint32_t _binary_sega_dreamcast_gdrom_GdromBits_class_start __asm("_binary_sega_dreamcast_gdrom_GdromBits_class_start"); +extern uint32_t _binary_sega_dreamcast_gdrom_GdromBits_class_end __asm("_binary_sega_dreamcast_gdrom_GdromBits_class_end"); +extern uint32_t _binary_sega_dreamcast_gdrom_GdromBits_class_size __asm("_binary_sega_dreamcast_gdrom_GdromBits_class_size"); + +#ifdef __cplusplus +} +#endif diff --git a/sega/dreamcast/gdrom/GdromCommandPacketFormat.java b/sega/dreamcast/gdrom/GdromCommandPacketFormat.java deleted file mode 100644 index b14be00..0000000 --- a/sega/dreamcast/gdrom/GdromCommandPacketFormat.java +++ /dev/null @@ -1,554 +0,0 @@ -package sega.dreamcast.gdrom; - - -public class GdromCommandPacketFormat { - public static class test_unit { - public byte command_code; - public byte _res0; - public byte _res1; - public byte _res2; - public byte _res3; - public byte _res4; - public byte _res5; - public byte _res6; - public byte _res7; - public byte _res8; - public byte _res9; - public byte _res10; - public test_unit() { - this.command_code = 0x0; - this._res0 = 0; - this._res1 = 0; - this._res2 = 0; - this._res3 = 0; - this._res4 = 0; - this._res5 = 0; - this._res6 = 0; - this._res7 = 0; - this._res8 = 0; - this._res9 = 0; - this._res10 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - default: return 0; - } - } - } - public static class req_stat { - public byte command_code; - public byte _res0; - public byte starting_address; - public byte _res1; - public byte allocation_length; - public byte _res2; - public byte _res3; - public byte _res4; - public byte _res5; - public byte _res6; - public byte _res7; - public byte _res8; - public req_stat(byte starting_address, - byte allocation_length - ) { - this.command_code = 0x10; - this._res0 = 0; - this.starting_address = starting_address; - this._res1 = 0; - this.allocation_length = allocation_length; - this._res2 = 0; - this._res3 = 0; - this._res4 = 0; - this._res5 = 0; - this._res6 = 0; - this._res7 = 0; - this._res8 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - case 2: return starting_address; - case 4: return allocation_length; - default: return 0; - } - } - } - public static class req_mode { - public byte command_code; - public byte _res0; - public byte starting_address; - public byte _res1; - public byte allocation_length; - public byte _res2; - public byte _res3; - public byte _res4; - public byte _res5; - public byte _res6; - public byte _res7; - public byte _res8; - public req_mode(byte starting_address, - byte allocation_length - ) { - this.command_code = 0x11; - this._res0 = 0; - this.starting_address = starting_address; - this._res1 = 0; - this.allocation_length = allocation_length; - this._res2 = 0; - this._res3 = 0; - this._res4 = 0; - this._res5 = 0; - this._res6 = 0; - this._res7 = 0; - this._res8 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - case 2: return starting_address; - case 4: return allocation_length; - default: return 0; - } - } - } - public static class set_mode { - public byte command_code; - public byte _res0; - public byte starting_address; - public byte _res1; - public byte allocation_length; - public byte _res2; - public byte _res3; - public byte _res4; - public byte _res5; - public byte _res6; - public byte _res7; - public byte _res8; - public set_mode(byte starting_address, - byte allocation_length - ) { - this.command_code = 0x12; - this._res0 = 0; - this.starting_address = starting_address; - this._res1 = 0; - this.allocation_length = allocation_length; - this._res2 = 0; - this._res3 = 0; - this._res4 = 0; - this._res5 = 0; - this._res6 = 0; - this._res7 = 0; - this._res8 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - case 2: return starting_address; - case 4: return allocation_length; - default: return 0; - } - } - } - public static class req_error { - public byte command_code; - public byte _res0; - public byte _res1; - public byte _res2; - public byte allocation_length; - public byte _res3; - public byte _res4; - public byte _res5; - public byte _res6; - public byte _res7; - public byte _res8; - public byte _res9; - public req_error(byte allocation_length - ) { - this.command_code = 0x13; - this._res0 = 0; - this._res1 = 0; - this._res2 = 0; - this.allocation_length = allocation_length; - this._res3 = 0; - this._res4 = 0; - this._res5 = 0; - this._res6 = 0; - this._res7 = 0; - this._res8 = 0; - this._res9 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - case 4: return allocation_length; - default: return 0; - } - } - } - public static class get_toc { - public byte command_code; - public byte select; - public byte _res0; - public byte allocation_length0; - public byte allocation_length1; - public byte _res1; - public byte _res2; - public byte _res3; - public byte _res4; - public byte _res5; - public byte _res6; - public byte _res7; - public get_toc(byte select, - int allocation_length - ) { - this.command_code = 0x14; - this.select = select; - this._res0 = 0; - this.allocation_length0 = (allocation_length >> 8) & 0xff; - this.allocation_length1 = (allocation_length >> 0) & 0xff; - this._res1 = 0; - this._res2 = 0; - this._res3 = 0; - this._res4 = 0; - this._res5 = 0; - this._res6 = 0; - this._res7 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - case 1: return select; - case 3: return allocation_length0; - case 4: return allocation_length1; - default: return 0; - } - } - } - public static class req_ses { - public byte command_code; - public byte _res0; - public byte session_number; - public byte _res1; - public byte allocation_length; - public byte _res2; - public byte _res3; - public byte _res4; - public byte _res5; - public byte _res6; - public byte _res7; - public byte _res8; - public req_ses(byte session_number, - byte allocation_length - ) { - this.command_code = 0x15; - this._res0 = 0; - this.session_number = session_number; - this._res1 = 0; - this.allocation_length = allocation_length; - this._res2 = 0; - this._res3 = 0; - this._res4 = 0; - this._res5 = 0; - this._res6 = 0; - this._res7 = 0; - this._res8 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - case 2: return session_number; - case 4: return allocation_length; - default: return 0; - } - } - } - public static class cd_open { - public byte command_code; - public byte _res0; - public byte _res1; - public byte _res2; - public byte _res3; - public byte _res4; - public byte _res5; - public byte _res6; - public byte _res7; - public byte _res8; - public byte _res9; - public byte _res10; - public cd_open() { - this.command_code = 0x16; - this._res0 = 0; - this._res1 = 0; - this._res2 = 0; - this._res3 = 0; - this._res4 = 0; - this._res5 = 0; - this._res6 = 0; - this._res7 = 0; - this._res8 = 0; - this._res9 = 0; - this._res10 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - default: return 0; - } - } - } - public static class cd_play { - public byte command_code; - public byte parameter_type; - public byte starting_point0; - public byte starting_point1; - public byte starting_point2; - public byte _res0; - public byte repeat_times; - public byte _res1; - public byte end_point0; - public byte end_point1; - public byte end_point2; - public byte _res2; - public cd_play(byte parameter_type, - int starting_point, - byte repeat_times, - int end_point - ) { - this.command_code = 0x20; - this.parameter_type = parameter_type; - this.starting_point0 = (starting_point >> 16) & 0xff; - this.starting_point1 = (starting_point >> 8) & 0xff; - this.starting_point2 = (starting_point >> 0) & 0xff; - this._res0 = 0; - this.repeat_times = repeat_times; - this._res1 = 0; - this.end_point0 = (end_point >> 16) & 0xff; - this.end_point1 = (end_point >> 8) & 0xff; - this.end_point2 = (end_point >> 0) & 0xff; - this._res2 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - case 1: return parameter_type; - case 2: return starting_point0; - case 3: return starting_point1; - case 4: return starting_point2; - case 6: return repeat_times; - case 8: return end_point0; - case 9: return end_point1; - case 10: return end_point2; - default: return 0; - } - } - } - public static class cd_seek { - public byte command_code; - public byte parameter_type; - public byte seek_point0; - public byte seek_point1; - public byte seek_point2; - public byte _res0; - public byte _res1; - public byte _res2; - public byte _res3; - public byte _res4; - public byte _res5; - public byte _res6; - public cd_seek(byte parameter_type, - int seek_point - ) { - this.command_code = 0x21; - this.parameter_type = parameter_type; - this.seek_point0 = (seek_point >> 16) & 0xff; - this.seek_point1 = (seek_point >> 8) & 0xff; - this.seek_point2 = (seek_point >> 0) & 0xff; - this._res0 = 0; - this._res1 = 0; - this._res2 = 0; - this._res3 = 0; - this._res4 = 0; - this._res5 = 0; - this._res6 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - case 1: return parameter_type; - case 2: return seek_point0; - case 3: return seek_point1; - case 4: return seek_point2; - default: return 0; - } - } - } - public static class cd_scan { - public byte command_code; - public byte _res0; - public byte direction; - public byte speed; - public byte _res1; - public byte _res2; - public byte _res3; - public byte _res4; - public byte _res5; - public byte _res6; - public byte _res7; - public byte _res8; - public cd_scan(byte direction, - byte speed - ) { - this.command_code = 0x22; - this._res0 = 0; - this.direction = direction; - this.speed = speed; - this._res1 = 0; - this._res2 = 0; - this._res3 = 0; - this._res4 = 0; - this._res5 = 0; - this._res6 = 0; - this._res7 = 0; - this._res8 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - case 2: return direction; - case 3: return speed; - default: return 0; - } - } - } - public static class cd_read { - public byte command_code; - public byte data; - public byte starting_address0; - public byte starting_address1; - public byte starting_address2; - public byte _res0; - public byte _res1; - public byte _res2; - public byte transfer_length0; - public byte transfer_length1; - public byte transfer_length2; - public byte _res3; - public cd_read(byte data, - int starting_address, - int transfer_length - ) { - this.command_code = 0x30; - this.data = data; - this.starting_address0 = (starting_address >> 16) & 0xff; - this.starting_address1 = (starting_address >> 8) & 0xff; - this.starting_address2 = (starting_address >> 0) & 0xff; - this._res0 = 0; - this._res1 = 0; - this._res2 = 0; - this.transfer_length0 = (transfer_length >> 16) & 0xff; - this.transfer_length1 = (transfer_length >> 8) & 0xff; - this.transfer_length2 = (transfer_length >> 0) & 0xff; - this._res3 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - case 1: return data; - case 2: return starting_address0; - case 3: return starting_address1; - case 4: return starting_address2; - case 8: return transfer_length0; - case 9: return transfer_length1; - case 10: return transfer_length2; - default: return 0; - } - } - } - public static class cd_read2 { - public byte command_code; - public byte data; - public byte starting_address0; - public byte starting_address1; - public byte starting_address2; - public byte _res0; - public byte transfer_length0; - public byte transfer_length1; - public byte next_address0; - public byte next_address1; - public byte next_address2; - public byte _res1; - public cd_read2(byte data, - int starting_address, - int transfer_length, - int next_address - ) { - this.command_code = 0x31; - this.data = data; - this.starting_address0 = (starting_address >> 16) & 0xff; - this.starting_address1 = (starting_address >> 8) & 0xff; - this.starting_address2 = (starting_address >> 0) & 0xff; - this._res0 = 0; - this.transfer_length0 = (transfer_length >> 8) & 0xff; - this.transfer_length1 = (transfer_length >> 0) & 0xff; - this.next_address0 = (next_address >> 16) & 0xff; - this.next_address1 = (next_address >> 8) & 0xff; - this.next_address2 = (next_address >> 0) & 0xff; - this._res1 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - case 1: return data; - case 2: return starting_address0; - case 3: return starting_address1; - case 4: return starting_address2; - case 6: return transfer_length0; - case 7: return transfer_length1; - case 8: return next_address0; - case 9: return next_address1; - case 10: return next_address2; - default: return 0; - } - } - } - public static class cd_scd { - public byte command_code; - public byte data_format; - public byte _res0; - public byte allocation_length0; - public byte allocation_length1; - public byte _res1; - public byte _res2; - public byte _res3; - public byte _res4; - public byte _res5; - public byte _res6; - public byte _res7; - public cd_scd(byte data_format, - int allocation_length - ) { - this.command_code = 0x40; - this.data_format = data_format; - this._res0 = 0; - this.allocation_length0 = (allocation_length >> 8) & 0xff; - this.allocation_length1 = (allocation_length >> 0) & 0xff; - this._res1 = 0; - this._res2 = 0; - this._res3 = 0; - this._res4 = 0; - this._res5 = 0; - this._res6 = 0; - this._res7 = 0; - } - public get_byte(int ix) { - switch (ix) { - case 0: return command_code; - case 1: return data_format; - case 3: return allocation_length0; - case 4: return allocation_length1; - default: return 0; - } - } - } -}