load DreamcastVideo2 from gdrom
This commit is contained in:
parent
9090f266cd
commit
f8833cdcbe
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,3 +12,4 @@
|
||||
main
|
||||
print_class
|
||||
__pycache__
|
||||
classes.txt
|
7
Main.java
Normal file
7
Main.java
Normal file
@ -0,0 +1,7 @@
|
||||
import example.DreamcastVideo2;
|
||||
|
||||
class Main {
|
||||
public static void main() {
|
||||
DreamcastVideo2.main();
|
||||
}
|
||||
}
|
@ -62,7 +62,7 @@ boot.elf: $(IP_OBJ) $(START_OBJ) $(GDROM_JVM_BOOT_OBJ)
|
||||
zero.bin:
|
||||
dd if=/dev/zero of=$@ bs=2048 count=1
|
||||
|
||||
jvm.iso: boot.bin main.bin
|
||||
jvm.iso: boot.bin main.bin zero.bin
|
||||
mkisofs \
|
||||
-C 0,11702 \
|
||||
-sysid "SEGA SEGAKATANA" \
|
||||
@ -80,8 +80,53 @@ jvm.iso: boot.bin main.bin
|
||||
/1ST_READ.BIN=zero.bin \
|
||||
/=$(LIB)/COPYRIGH.TXT \
|
||||
/=$(LIB)/ABSTRACT.TXT \
|
||||
/=$(LIB)/BIBLIOGR.TXT
|
||||
|
||||
/=$(LIB)/BIBLIOGR.TXT \
|
||||
/=example/GdromDirectoryRecordHandler.class \
|
||||
/=example/GdromExtentReader.class \
|
||||
/=example/GdromTest.class \
|
||||
/=filesystem/iso9660/ByteParser.class \
|
||||
/=filesystem/iso9660/DirectoryRecord.class \
|
||||
/=filesystem/iso9660/ExtentReader.class \
|
||||
/=filesystem/iso9660/PrimaryVolumeDescriptor.class \
|
||||
/=filesystem/iso9660/VolumeParser.class \
|
||||
/=java/io/PrintStream.class \
|
||||
/=java/lang/DecimalDigits.class \
|
||||
/=java/lang/Integer.class \
|
||||
/=java/lang/Object.class \
|
||||
/=java/lang/String.class \
|
||||
/=java/lang/System.class \
|
||||
/=java/misc/Memory.class \
|
||||
/=jvm/internal/Loader.class \
|
||||
/=sega/dreamcast/gdrom/G1IF.class \
|
||||
/=sega/dreamcast/gdrom/GdromBits.class \
|
||||
/=sega/dreamcast/gdrom/Gdrom.class \
|
||||
/=sega/dreamcast/gdrom/GdromCommandPacketFormat_cd_read.class \
|
||||
/=sega/dreamcast/gdrom/GdromCommandPacketFormat.class \
|
||||
/=sega/dreamcast/gdrom/GdromCommandPacketFormat_get_toc.class \
|
||||
/=sega/dreamcast/gdrom/GdromCommandPacketInterface.class \
|
||||
/=sega/dreamcast/gdrom/GdromProtocol.class \
|
||||
/=Main.class \
|
||||
/=example/DreamcastVideo2.class \
|
||||
/=model/FacePTN.class \
|
||||
/=model/ModelObject.class \
|
||||
/=model/UntitledModel.class \
|
||||
/=model/Vec2.class \
|
||||
/=model/Vec3.class \
|
||||
/=sega/dreamcast/holly/Background.class \
|
||||
/=sega/dreamcast/holly/CoreBits.class \
|
||||
/=sega/dreamcast/holly/Core.class \
|
||||
/=sega/dreamcast/holly/ISPTSP.class \
|
||||
/=sega/dreamcast/holly/RegionArray.class \
|
||||
/=sega/dreamcast/holly/RegionArray_OPBSize.class \
|
||||
/=sega/dreamcast/holly/TABits.class \
|
||||
/=sega/dreamcast/holly/TAFIFOPolygonConverter.class \
|
||||
/=sega/dreamcast/holly/TAGlobalParameter.class \
|
||||
/=sega/dreamcast/holly/TAGlobalParameter_end_of_list.class \
|
||||
/=sega/dreamcast/holly/TAGlobalParameter_polygon_type_0.class \
|
||||
/=sega/dreamcast/holly/TAVertexParameter.class \
|
||||
/=sega/dreamcast/holly/TAVertexParameter_polygon_type_3.class \
|
||||
/=sega/dreamcast/holly/TextureMemoryAllocation.class \
|
||||
/=java/lang/Math.class
|
||||
|
||||
main.elf: LDSCRIPT = $(LIB)/main.lds
|
||||
main.elf: $(START_OBJ) $(OBJ) $(MAIN_OBJ) $(MAIN_DREAMCAST_OBJ) $(LIBGCC_OBJ) $(CLASS_PATH)
|
||||
|
@ -1,18 +1,15 @@
|
||||
#include "example/GdromExtentReader.class.h"
|
||||
#include "example/GdromTest.class.h"
|
||||
#include "example/GdromDirectoryRecordHandler.class.h"
|
||||
#include "filesystem/iso9660/ByteParser.class.h"
|
||||
#include "filesystem/iso9660/DirectoryRecord.class.h"
|
||||
#include "filesystem/iso9660/ExtentReader.class.h"
|
||||
#include "filesystem/iso9660/PrimaryVolumeDescriptor.class.h"
|
||||
#include "filesystem/iso9660/VolumeParser.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/Integer.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"
|
||||
@ -24,3 +21,4 @@
|
||||
#include "sega/dreamcast/gdrom/GdromCommandPacketFormat_get_toc.class.h"
|
||||
#include "sega/dreamcast/gdrom/GdromCommandPacketInterface.class.h"
|
||||
#include "sega/dreamcast/gdrom/GdromProtocol.class.h"
|
||||
#include "jvm/internal/Loader.class.h"
|
||||
|
@ -1,18 +1,15 @@
|
||||
(const uint8_t *)&_binary_example_GdromExtentReader_class_start,
|
||||
(const uint8_t *)&_binary_example_GdromTest_class_start,
|
||||
(const uint8_t *)&_binary_example_GdromDirectoryRecordHandler_class_start,
|
||||
(const uint8_t *)&_binary_filesystem_iso9660_ByteParser_class_start,
|
||||
(const uint8_t *)&_binary_filesystem_iso9660_DirectoryRecord_class_start,
|
||||
(const uint8_t *)&_binary_filesystem_iso9660_ExtentReader_class_start,
|
||||
(const uint8_t *)&_binary_filesystem_iso9660_PrimaryVolumeDescriptor_class_start,
|
||||
(const uint8_t *)&_binary_filesystem_iso9660_VolumeParser_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_Integer_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,
|
||||
@ -24,3 +21,4 @@
|
||||
(const uint8_t *)&_binary_sega_dreamcast_gdrom_GdromCommandPacketFormat_get_toc_class_start,
|
||||
(const uint8_t *)&_binary_sega_dreamcast_gdrom_GdromCommandPacketInterface_class_start,
|
||||
(const uint8_t *)&_binary_sega_dreamcast_gdrom_GdromProtocol_class_start,
|
||||
(const uint8_t *)&_binary_jvm_internal_Loader_class_start,
|
||||
|
@ -340,7 +340,7 @@ void vm_native_method_call(struct vm * vm, struct class_entry * class_entry, str
|
||||
if (jvm_internal_loader) {
|
||||
if (method_name_constant->utf8.length == 4) {
|
||||
if (hash_table_key_equal(method_name_constant->utf8.bytes, (const uint8_t *)"load", 4)) {
|
||||
assert(nargs == 1);
|
||||
assert(nargs == 2);
|
||||
assert(return_type == 'V');
|
||||
native_jvm_internal_loader_load(args);
|
||||
return;
|
||||
|
11
c/native.c
11
c/native.c
@ -134,7 +134,7 @@ uint32_t native_java_misc_memory_isbigendian()
|
||||
return (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__);
|
||||
}
|
||||
|
||||
static uint8_t loader_buffer[0x100000];
|
||||
static uint8_t loader_buffer[0x100000] __attribute__ ((aligned (32)));
|
||||
|
||||
uint32_t native_jvm_internal_loader_getbuffer()
|
||||
{
|
||||
@ -146,8 +146,11 @@ extern struct vm vm;
|
||||
void native_jvm_internal_loader_load(uint32_t * args)
|
||||
{
|
||||
uint32_t * arrayref = (uint32_t *)args[0];
|
||||
int32_t buffers_length = (int32_t)arrayref[0];
|
||||
//int32_t buffers_length = (int32_t)arrayref[0];
|
||||
const uint8_t ** buffers = (const uint8_t **)&arrayref[1];
|
||||
int32_t num_buffers = (int32_t)args[1];
|
||||
printf("num_buffers: %d\n", num_buffers);
|
||||
printf("loader_buffer[0]: %p ; buffers[0]: %p\n", &loader_buffer[0], (uint32_t)buffers[0]);
|
||||
|
||||
const uint8_t * main_class = (const uint8_t *)"Main";
|
||||
int main_class_length = string_length((const char *)main_class);
|
||||
@ -157,10 +160,10 @@ void native_jvm_internal_loader_load(uint32_t * args)
|
||||
|
||||
int class_hash_table_length;
|
||||
struct hash_table_entry * class_hash_table = class_resolver_load_from_buffers(buffers,
|
||||
buffers_length,
|
||||
num_buffers,
|
||||
&class_hash_table_length);
|
||||
|
||||
struct vm * vm = vm_start(class_hash_table_length,
|
||||
vm_start(class_hash_table_length,
|
||||
class_hash_table,
|
||||
main_class,
|
||||
main_class_length);
|
||||
|
@ -1,19 +1,16 @@
|
||||
CLASS_PATH = \
|
||||
example/GdromExtentReader.class.o \
|
||||
example/GdromTest.class.o \
|
||||
example/GdromDirectoryRecordHandler.class.o \
|
||||
filesystem/iso9660/ByteParser.class.o \
|
||||
filesystem/iso9660/DirectoryRecord.class.o \
|
||||
filesystem/iso9660/ExtentReader.class.o \
|
||||
filesystem/iso9660/PrimaryVolumeDescriptor.class.o \
|
||||
filesystem/iso9660/VolumeParser.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/Integer.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 \
|
||||
@ -24,4 +21,5 @@ CLASS_PATH = \
|
||||
sega/dreamcast/gdrom/GdromCommandPacketFormat.class.o \
|
||||
sega/dreamcast/gdrom/GdromCommandPacketFormat_get_toc.class.o \
|
||||
sega/dreamcast/gdrom/GdromCommandPacketInterface.class.o \
|
||||
sega/dreamcast/gdrom/GdromProtocol.class.o
|
||||
sega/dreamcast/gdrom/GdromProtocol.class.o \
|
||||
jvm/internal/Loader.class.o
|
||||
|
@ -21,7 +21,7 @@ import model.ModelObject;
|
||||
import java.misc.Memory;
|
||||
import java.misc.Resource;
|
||||
|
||||
class DreamcastVideo2 {
|
||||
public class DreamcastVideo2 {
|
||||
static final int framebuffer_width = 640;
|
||||
static final int framebuffer_height = 480;
|
||||
|
||||
@ -235,6 +235,7 @@ class DreamcastVideo2 {
|
||||
public static void transfer_textures() {
|
||||
int texture = TextureMemoryAllocation.texture_regions[1][0] + 512;
|
||||
|
||||
/*
|
||||
// java_cup
|
||||
int[] java_cup = Resource.getResource("images/java_cup");
|
||||
int java_cup_length = (java_cup == null) ? 0 : java_cup.length;
|
||||
@ -256,11 +257,13 @@ class DreamcastVideo2 {
|
||||
Memory.putU4(MemoryMap.texture_memory64 + texture, java_text[i]);
|
||||
texture += 4;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public static void transfer_java_powered() {
|
||||
int texture = TextureMemoryAllocation.texture_regions[1][0] + 512 + (512 * 512 * 2 * 2);
|
||||
|
||||
/*
|
||||
// java_powered
|
||||
int[] java_powered = Resource.getResource("images/java_powered");
|
||||
int java_powered_length = (java_powered == null) ? 0 : java_powered.length;
|
||||
@ -271,6 +274,7 @@ class DreamcastVideo2 {
|
||||
Memory.putU4(MemoryMap.texture_memory64 + texture, java_powered[i]);
|
||||
texture += 4;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public static void boot_splash(int ta_alloc, int opb_size_total) {
|
||||
|
15
example/GdromDirectoryRecordHandler.class.h
Normal file
15
example/GdromDirectoryRecordHandler.class.h
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern C {
|
||||
#endif
|
||||
|
||||
extern uint32_t _binary_example_GdromDirectoryRecordHandler_class_start __asm("_binary_example_GdromDirectoryRecordHandler_class_start");
|
||||
extern uint32_t _binary_example_GdromDirectoryRecordHandler_class_end __asm("_binary_example_GdromDirectoryRecordHandler_class_end");
|
||||
extern uint32_t _binary_example_GdromDirectoryRecordHandler_class_size __asm("_binary_example_GdromDirectoryRecordHandler_class_size");
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -5,6 +5,9 @@ import sega.dreamcast.gdrom.G1IF;
|
||||
import java.misc.Memory;
|
||||
import filesystem.iso9660.VolumeParser;
|
||||
import filesystem.iso9660.ExtentReader;
|
||||
import filesystem.iso9660.DirectoryRecordHandler;
|
||||
import filesystem.iso9660.DirectoryRecord;
|
||||
import jvm.internal.Loader;
|
||||
|
||||
class GdromExtentReader implements ExtentReader {
|
||||
public void readInto(byte[] buf, int extent) {
|
||||
@ -15,45 +18,112 @@ class GdromExtentReader implements ExtentReader {
|
||||
}
|
||||
}
|
||||
|
||||
class GdromTest {
|
||||
static byte[] buf;
|
||||
class GdromDirectoryRecordHandler implements DirectoryRecordHandler {
|
||||
int address;
|
||||
int[] addresses;
|
||||
public int addresses_ix;
|
||||
static byte[] class_ext;
|
||||
|
||||
static {
|
||||
buf = new byte[2048];
|
||||
class_ext = new byte[] { 'C', 'L', 'A', ';', '1' }; // CLA;1
|
||||
}
|
||||
|
||||
public static void g1_dma_start(int start_address, int transfer_length) {
|
||||
public GdromDirectoryRecordHandler(int address, int[] addresses) {
|
||||
this.address = address;
|
||||
this.addresses = addresses;
|
||||
this.addresses_ix = 0;
|
||||
}
|
||||
|
||||
// transfer_length is in bytes
|
||||
public static void startG1DMA(int start_address, int transfer_length) {
|
||||
int gdstar = start_address & ~(0b111 << 29);
|
||||
int gdlen = (transfer_length + 31) & ~(31);
|
||||
|
||||
Memory.putU4(G1IF.GDAPRO, 0x8843407F);
|
||||
Memory.putU4(G1IF.G1GDRC, 0x00001001);
|
||||
Memory.putU4(G1IF.GDSTAR, gdstar);
|
||||
Memory.putU4(G1IF.GDLEN, gdlen);
|
||||
Memory.putU4(G1IF.GDLEN, transfer_length);
|
||||
Memory.putU4(G1IF.GDDIR, 1);
|
||||
Memory.putU4(G1IF.GDEN, 1);
|
||||
Memory.putU4(G1IF.GDST, 1);
|
||||
}
|
||||
|
||||
public boolean drIsClass(DirectoryRecord dr) {
|
||||
int length = dr.lengthOfFileIdentifier();
|
||||
|
||||
if (length < 6)
|
||||
return false;
|
||||
|
||||
byte[] buf = dr.array;
|
||||
int offset = dr.offset + DirectoryRecord.FILE_IDENTIFIER_START;
|
||||
|
||||
int ix = 0;
|
||||
for (int i = length - 5; i < length; i++) {
|
||||
System.out.print(ix);
|
||||
System.out.print(" ");
|
||||
if (buf[offset + i] != class_ext[ix]) {
|
||||
return false;
|
||||
}
|
||||
ix += 1;
|
||||
}
|
||||
System.out.println();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void handle(DirectoryRecord dr) {
|
||||
int extent = dr.locationOfExtent(); // sector number
|
||||
int length = dr.dataLength(); // bytes
|
||||
|
||||
if (drIsClass(dr)) {
|
||||
System.out.println("class found");
|
||||
} else {
|
||||
System.out.println("is not class");
|
||||
return;
|
||||
}
|
||||
|
||||
// round up to nearest multiple of 2048
|
||||
length = (length + 2047) & ~(2047);
|
||||
|
||||
System.out.print("start G1 DMA: address:");
|
||||
System.out.print(address);
|
||||
System.out.print(" length: ");
|
||||
System.out.println(length);
|
||||
|
||||
System.out.println("read dma");
|
||||
|
||||
Memory.putU4(G1IF.GDEN, 0);
|
||||
|
||||
int sectors = length >> 11; // division by 2048
|
||||
GdromProtocol.cdReadDMA(extent + 150, sectors);
|
||||
|
||||
System.out.println("start dma");
|
||||
startG1DMA(address, length);
|
||||
|
||||
System.out.println("wait gdst");
|
||||
while ((Memory.getU4(G1IF.GDST) & 1) != 0);
|
||||
System.out.println("transfer complete");
|
||||
|
||||
addresses[addresses_ix] = 0xa0000000 | address;
|
||||
addresses_ix += 1;
|
||||
address += length;
|
||||
}
|
||||
}
|
||||
|
||||
class GdromTest {
|
||||
public static void main() {
|
||||
// assume gdrom is already unlocked
|
||||
|
||||
int data_track_fad = GdromProtocol.tocGetDataTrackFad();
|
||||
|
||||
//GdromProtocol.cdReadPIO(buf, primary_volume_descriptor, 1);
|
||||
int[] buffer_addresses = new int[0x3000]; // maximum 12,288 class files
|
||||
|
||||
int loader_buffer_address = Loader.getBuffer();
|
||||
GdromDirectoryRecordHandler handler = new GdromDirectoryRecordHandler(loader_buffer_address, buffer_addresses);
|
||||
GdromExtentReader reader = new GdromExtentReader();
|
||||
VolumeParser parser = new VolumeParser(data_track_fad - 150, reader);
|
||||
|
||||
VolumeParser parser = new VolumeParser(data_track_fad - 150, reader, handler);
|
||||
System.out.println("::parser parse::");
|
||||
parser.parse();
|
||||
/*
|
||||
System.out.println("data:");
|
||||
for (int i = 0; i < 16; i++) {
|
||||
System.out.print(((int)buf[i]) & 0xff);
|
||||
System.out.print(" ");
|
||||
}
|
||||
System.out.println();
|
||||
*/
|
||||
|
||||
Loader.load(buffer_addresses, handler.addresses_ix);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package filesystem.iso9660;
|
||||
|
||||
public class ByteParser {
|
||||
byte[] array;
|
||||
public byte[] array;
|
||||
public int offset;
|
||||
|
||||
public ByteParser(byte[] array, int offset) {
|
||||
|
5
filesystem/iso9660/DirectoryRecordHandler.java
Normal file
5
filesystem/iso9660/DirectoryRecordHandler.java
Normal file
@ -0,0 +1,5 @@
|
||||
package filesystem.iso9660;
|
||||
|
||||
public interface DirectoryRecordHandler {
|
||||
public abstract void handle(DirectoryRecord dr);
|
||||
}
|
@ -8,6 +8,7 @@ public class VolumeParser {
|
||||
byte[] buf;
|
||||
DirectoryRecord dr;
|
||||
ExtentReader reader;
|
||||
DirectoryRecordHandler handler;
|
||||
|
||||
static final int FILE_FLAGS__DIRECTORY = 2;
|
||||
|
||||
@ -49,10 +50,9 @@ public class VolumeParser {
|
||||
//System.out.print("; file_flags: ");
|
||||
//System.out.print((int)dr.fileFlags());
|
||||
|
||||
if ((dr.fileFlags() & FILE_FLAGS__DIRECTORY) == 0) {
|
||||
int file_flags = dr.fileFlags();
|
||||
if ((file_flags & FILE_FLAGS__DIRECTORY) == 0) {
|
||||
System.out.print(" [regular file] ");
|
||||
//dr.locationOfExtent();
|
||||
//dr.dataLength();
|
||||
} else {
|
||||
System.out.print(" [directory] ");
|
||||
child_extents[child_ix] = dr.locationOfExtent();
|
||||
@ -64,6 +64,10 @@ public class VolumeParser {
|
||||
printIdentifier(buf, dr.offset, DirectoryRecord.FILE_IDENTIFIER_START, dr.lengthOfFileIdentifier());
|
||||
System.out.println();
|
||||
|
||||
if ((file_flags & FILE_FLAGS__DIRECTORY) == 0) {
|
||||
handler.handle(dr);
|
||||
}
|
||||
|
||||
return child_ix;
|
||||
}
|
||||
|
||||
@ -121,9 +125,10 @@ public class VolumeParser {
|
||||
walkDirectory(extent, num_extents, 0);
|
||||
}
|
||||
|
||||
public VolumeParser(int fad, ExtentReader reader) {
|
||||
public VolumeParser(int fad, ExtentReader reader, DirectoryRecordHandler handler) {
|
||||
this.fad = fad;
|
||||
this.reader = reader;
|
||||
this.handler = handler;
|
||||
this.buf = new byte[2048];
|
||||
this.dr = new DirectoryRecord(this.buf, 0);
|
||||
}
|
||||
|
@ -73,19 +73,16 @@ function classpath_h () {
|
||||
declare -a boot_classes=(
|
||||
example/GdromExtentReader.class
|
||||
example/GdromTest.class
|
||||
example/GdromDirectoryRecordHandler.class
|
||||
filesystem/iso9660/ByteParser.class
|
||||
filesystem/iso9660/DirectoryRecord.class
|
||||
filesystem/iso9660/ExtentReader.class
|
||||
filesystem/iso9660/PrimaryVolumeDescriptor.class
|
||||
filesystem/iso9660/VolumeParser.class
|
||||
java/io/PrintStream.class
|
||||
java/lang/Boolean.class
|
||||
java/lang/Byte.class
|
||||
java/lang/Character.class
|
||||
java/lang/DecimalDigits.class
|
||||
java/lang/Integer.class
|
||||
java/lang/Object.class
|
||||
java/lang/Short.class
|
||||
java/lang/String.class
|
||||
java/lang/System.class
|
||||
java/misc/Memory.class
|
||||
@ -97,6 +94,7 @@ declare -a boot_classes=(
|
||||
sega/dreamcast/gdrom/GdromCommandPacketFormat_get_toc.class
|
||||
sega/dreamcast/gdrom/GdromCommandPacketInterface.class
|
||||
sega/dreamcast/gdrom/GdromProtocol.class
|
||||
jvm/internal/Loader.class
|
||||
)
|
||||
|
||||
function boot_classes () {
|
||||
@ -120,6 +118,52 @@ function boot_sources () {
|
||||
done
|
||||
}
|
||||
|
||||
declare -a application_classes=(
|
||||
Main.class
|
||||
example/DreamcastVideo2.class
|
||||
model/FacePTN.class
|
||||
model/ModelObject.class
|
||||
model/UntitledModel.class
|
||||
model/Vec2.class
|
||||
model/Vec3.class
|
||||
sega/dreamcast/holly/Background.class
|
||||
sega/dreamcast/holly/Core.class
|
||||
sega/dreamcast/holly/CoreBits.class
|
||||
sega/dreamcast/holly/ISPTSP.class
|
||||
sega/dreamcast/holly/RegionArray.class
|
||||
sega/dreamcast/holly/RegionArray_OPBSize.class
|
||||
sega/dreamcast/holly/TABits.class
|
||||
sega/dreamcast/holly/TAFIFOPolygonConverter.class
|
||||
sega/dreamcast/holly/TAGlobalParameter.class
|
||||
sega/dreamcast/holly/TAGlobalParameter_end_of_list.class
|
||||
sega/dreamcast/holly/TAGlobalParameter_polygon_type_0.class
|
||||
sega/dreamcast/holly/TAVertexParameter.class
|
||||
sega/dreamcast/holly/TAVertexParameter_polygon_type_3.class
|
||||
sega/dreamcast/holly/TextureMemoryAllocation.class
|
||||
java/lang/Math.class
|
||||
)
|
||||
|
||||
function application_classes () {
|
||||
local length=${#application_classes[@]}
|
||||
|
||||
for ((i=0;i<length;i++)); do
|
||||
local class="${application_classes[i]}"
|
||||
echo "$class"
|
||||
done
|
||||
}
|
||||
|
||||
function application_sources () {
|
||||
local length=${#application_classes[@]}
|
||||
|
||||
for ((i=0;i<length;i++)); do
|
||||
local class="${application_classes[i]}"
|
||||
local source="${class%.class}.java"
|
||||
if [ -f "$source" ]; then
|
||||
echo "$source"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function find_classes () {
|
||||
find model/ example/ sega/ java/ filesystem/ -name '*.class' -not -name 'Test*' | sort
|
||||
}
|
||||
@ -129,17 +173,17 @@ function find_sources () {
|
||||
}
|
||||
|
||||
|
||||
find sega/ java/ filesystem/ -name '*.class' -exec rm -f {} \;
|
||||
make -j$(nproc) -f Makefile.dreamcast.mk $(boot_sources | java_to_class)
|
||||
boot_classes | rename_class_files
|
||||
find . -name '*.class' -exec rm -f {} \;
|
||||
|
||||
make -f Makefile.dreamcast.mk $(boot_sources | java_to_class)
|
||||
find . -name '*.class' | rename_class_files
|
||||
boot_classes | classpath_mk
|
||||
boot_classes | classpath_inc_c
|
||||
boot_classes | make_header
|
||||
boot_classes | classpath_h
|
||||
|
||||
#make -j$(nproc) -f Makefile.dreamcast.mk $(find_sources | java_to_class)
|
||||
#find_classes | rename_class_files
|
||||
#find_classes | classpath_mk
|
||||
#find_classes | classpath_inc_c
|
||||
#find_classes | make_header
|
||||
#find_classes | classpath_h
|
||||
make -f Makefile.dreamcast.mk $(application_sources | java_to_class)
|
||||
find . -name '*.class' | rename_class_files
|
||||
|
||||
boot_classes | sort > classes.txt
|
||||
application_classes | sort >> classes.txt
|
||||
|
@ -1,11 +1,6 @@
|
||||
set -eux
|
||||
|
||||
#(cd ../jvm; sh generate_classpath.sh)
|
||||
#(cd ../jvm; make -f Makefile.dreamcast.mk main.bin)
|
||||
#cp ../jvm/main.bin jvm.bin
|
||||
#make gdrom-jvm-boot-ip-bin
|
||||
#make ip.iso
|
||||
|
||||
sh generate_classpath.sh
|
||||
rm -f main.bin main.elf jvm.iso
|
||||
make -f Makefile.dreamcast.mk jvm.iso
|
||||
../cdi4dc jvm.iso jvm.cdi > /dev/null
|
||||
|
15
jvm/internal/Loader.class.h
Normal file
15
jvm/internal/Loader.class.h
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern C {
|
||||
#endif
|
||||
|
||||
extern uint32_t _binary_jvm_internal_Loader_class_start __asm("_binary_jvm_internal_Loader_class_start");
|
||||
extern uint32_t _binary_jvm_internal_Loader_class_end __asm("_binary_jvm_internal_Loader_class_end");
|
||||
extern uint32_t _binary_jvm_internal_Loader_class_size __asm("_binary_jvm_internal_Loader_class_size");
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -6,5 +6,5 @@ public class Loader {
|
||||
|
||||
public static native int getBuffer();
|
||||
|
||||
public static native void load(int[] buffers);
|
||||
public static native void load(int[] buffers, int num_buffers);
|
||||
}
|
||||
|
@ -46,11 +46,13 @@ public class GdromProtocol {
|
||||
Memory.putU2(Gdrom.data, word);
|
||||
}
|
||||
|
||||
/*
|
||||
while (true) {
|
||||
int status = Memory.getU1(Gdrom.status);
|
||||
if (GdromBits.status__bsy(status) == 0)
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public static void readData(byte[] buf, int length) {
|
||||
@ -152,9 +154,18 @@ public class GdromProtocol {
|
||||
int parameter_type = 0b0; // FAD specified
|
||||
int data = (data_select << 4) | (expected_data_type << 1) | (parameter_type);
|
||||
|
||||
System.out.println("cdReadDMA");
|
||||
System.out.print("cdReadDMA: extent: ");
|
||||
System.out.print(starting_address);
|
||||
System.out.print(" transfer length (sectors): ");
|
||||
System.out.println(transfer_length);
|
||||
|
||||
System.out.println("cdReadSet");
|
||||
cdReadSet(data, starting_address, transfer_length);
|
||||
System.out.println("packetCommand");
|
||||
packetCommand(cd_read_command, true); // DMA mode
|
||||
|
||||
int status = Memory.getU1(Gdrom.status);
|
||||
System.out.print("status: ");
|
||||
System.out.println(status);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user