Compare commits
2 Commits
58def35f44
...
7cd65dbfd2
Author | SHA1 | Date | |
---|---|---|---|
7cd65dbfd2 | |||
c10a1206e3 |
@ -153,8 +153,8 @@ bool dr_is_self_or_parent(const iso9660::directory_record * dr)
|
|||||||
|
|
||||||
bool is_jvm_bin(const uint8_t * file_identifier, int length_of_file_identifier)
|
bool is_jvm_bin(const uint8_t * file_identifier, int length_of_file_identifier)
|
||||||
{
|
{
|
||||||
static const uint8_t * jvm_bin = (const uint8_t *)"JVM.BIN;1";
|
static const uint8_t * jvm_bin = (const uint8_t *)"0JVM.BIN;1";
|
||||||
int jvm_bin_length = 9;
|
int jvm_bin_length = 10;
|
||||||
if (length_of_file_identifier != jvm_bin_length)
|
if (length_of_file_identifier != jvm_bin_length)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -230,10 +230,10 @@ void load_jvm_bin(const iso9660::directory_record * dr)
|
|||||||
__data_length = dr->data_length.get();
|
__data_length = dr->data_length.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
void walk_directory_record(const iso9660::directory_record * dr)
|
bool walk_directory_record(const iso9660::directory_record * dr)
|
||||||
{
|
{
|
||||||
if (dr_is_self_or_parent(dr))
|
if (dr_is_self_or_parent(dr))
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
if ((dr->file_flags & FILE_FLAGS__DIRECTORY) == 0) {
|
if ((dr->file_flags & FILE_FLAGS__DIRECTORY) == 0) {
|
||||||
serial::string(" [regular file] ");
|
serial::string(" [regular file] ");
|
||||||
@ -248,8 +248,10 @@ void walk_directory_record(const iso9660::directory_record * dr)
|
|||||||
if ((dr->file_flags & FILE_FLAGS__DIRECTORY) == 0) {
|
if ((dr->file_flags & FILE_FLAGS__DIRECTORY) == 0) {
|
||||||
if (is_jvm_bin(dr->file_identifier, dr->length_of_file_identifier)) {
|
if (is_jvm_bin(dr->file_identifier, dr->length_of_file_identifier)) {
|
||||||
load_jvm_bin(dr);
|
load_jvm_bin(dr);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void walk_directory(uint16_t * buf, int extent, int num_extents)
|
void walk_directory(uint16_t * buf, int extent, int num_extents)
|
||||||
@ -269,7 +271,9 @@ void walk_directory(uint16_t * buf, int extent, int num_extents)
|
|||||||
if (dr->length_of_directory_record == 0)
|
if (dr->length_of_directory_record == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
walk_directory_record(dr);
|
bool jvm_loaded = walk_directory_record(dr);
|
||||||
|
if (jvm_loaded)
|
||||||
|
break;
|
||||||
|
|
||||||
offset += dr->length_of_directory_record;
|
offset += dr->length_of_directory_record;
|
||||||
}
|
}
|
||||||
@ -305,6 +309,10 @@ void main()
|
|||||||
auto pvd = reinterpret_cast<const iso9660::primary_volume_descriptor *>(&buf[0]);
|
auto pvd = reinterpret_cast<const iso9660::primary_volume_descriptor *>(&buf[0]);
|
||||||
auto root_dr = reinterpret_cast<const iso9660::directory_record *>(&pvd->directory_record_for_root_directory[0]);
|
auto root_dr = reinterpret_cast<const iso9660::directory_record *>(&pvd->directory_record_for_root_directory[0]);
|
||||||
|
|
||||||
|
for (int i = 0; i < 16; i++) {
|
||||||
|
serial::integer<uint8_t, string::dec_type>(((uint8_t *)buf)[i], ' ');
|
||||||
|
}
|
||||||
|
|
||||||
serial::string("primary volume descriptor:\n");
|
serial::string("primary volume descriptor:\n");
|
||||||
serial::string(" standard_identifier: ");
|
serial::string(" standard_identifier: ");
|
||||||
serial::string(pvd->standard_identifier, 5);
|
serial::string(pvd->standard_identifier, 5);
|
||||||
|
36
ip.mk
36
ip.mk
@ -1,16 +1,15 @@
|
|||||||
IP_OBJ = \
|
IP_OBJ = \
|
||||||
systemid.o \
|
$(LIB)/systemid.o \
|
||||||
toc.o \
|
$(LIB)/toc.o \
|
||||||
sg/sg_sec.o \
|
$(LIB)/sg/sg_sec.o \
|
||||||
sg_arejp.o \
|
$(LIB)/sg_arejp.o \
|
||||||
sg_areus.o \
|
$(LIB)/sg_areus.o \
|
||||||
sg_areec.o \
|
$(LIB)/sg_areec.o \
|
||||||
sg_are00.o \
|
$(LIB)/sg_are00.o \
|
||||||
sg_are01.o \
|
$(LIB)/sg_are01.o \
|
||||||
sg_are02.o \
|
$(LIB)/sg_are02.o \
|
||||||
sg_are03.o \
|
$(LIB)/sg_are03.o \
|
||||||
sg_are04.o \
|
$(LIB)/sg_are04.o
|
||||||
$(START_OBJ)
|
|
||||||
|
|
||||||
SERIAL_LOAD_OBJ = \
|
SERIAL_LOAD_OBJ = \
|
||||||
example/serial_transfer.o \
|
example/serial_transfer.o \
|
||||||
@ -20,21 +19,10 @@ SERIAL_LOAD_OBJ = \
|
|||||||
font/portfolio_6x8/portfolio_6x8.data.o \
|
font/portfolio_6x8/portfolio_6x8.data.o \
|
||||||
crc32.o
|
crc32.o
|
||||||
|
|
||||||
GDROM_JVM_BOOT_OBJ = \
|
|
||||||
example/gdrom_jvm_boot.o \
|
|
||||||
sh7091/serial.o \
|
|
||||||
crc32.o
|
|
||||||
|
|
||||||
%.o: %.obj
|
%.o: %.obj
|
||||||
$(OBJCOPY) -g \
|
$(OBJCOPY) -g \
|
||||||
--rename-section IP=.text.$* \
|
--rename-section IP=.text.$* \
|
||||||
$< $@
|
$< $@
|
||||||
|
|
||||||
serial_load_ip.elf: $(IP_OBJ) $(SERIAL_LOAD_OBJ)
|
serial_load_ip.elf: $(IP_OBJ) $(START_OBJ) $(SERIAL_LOAD_OBJ)
|
||||||
$(LD) --orphan-handling=error --print-memory-usage -T $(LIB)/ip.lds $^ -o $@
|
$(LD) --orphan-handling=error --print-memory-usage -T $(LIB)/ip.lds $^ -o $@
|
||||||
|
|
||||||
gdrom_jvm_boot_ip.elf: $(IP_OBJ) $(GDROM_JVM_BOOT_OBJ)
|
|
||||||
$(LD) --orphan-handling=error --print-memory-usage -T $(LIB)/ip.lds $^ -o $@
|
|
||||||
|
|
||||||
gdrom-jvm-boot-ip-bin: gdrom_jvm_boot_ip.bin
|
|
||||||
cp $< ip.bin
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user