add all systembus registers
This commit is contained in:
parent
a8f3b5e921
commit
61cd2de8fa
@ -1,7 +1,6 @@
|
|||||||
#include "example/DreamcastVideo2.class.h"
|
#include "example/DreamcastVideo2.class.h"
|
||||||
#include "example/DreamcastVideo.class.h"
|
#include "example/DreamcastVideo.class.h"
|
||||||
#include "example/GdromTest.class.h"
|
#include "example/GdromTest.class.h"
|
||||||
#include "example/Vec2.class.h"
|
|
||||||
#include "java/io/PrintStream.class.h"
|
#include "java/io/PrintStream.class.h"
|
||||||
#include "java/lang/Boolean.class.h"
|
#include "java/lang/Boolean.class.h"
|
||||||
#include "java/lang/Byte.class.h"
|
#include "java/lang/Byte.class.h"
|
||||||
@ -26,6 +25,8 @@
|
|||||||
#include "model/UntitledModel.class.h"
|
#include "model/UntitledModel.class.h"
|
||||||
#include "model/Vec2.class.h"
|
#include "model/Vec2.class.h"
|
||||||
#include "model/Vec3.class.h"
|
#include "model/Vec3.class.h"
|
||||||
|
#include "sega/dreamcast/g2_if/G2IF.class.h"
|
||||||
|
#include "sega/dreamcast/gdrom/G1IF.class.h"
|
||||||
#include "sega/dreamcast/gdrom/GdromBits.class.h"
|
#include "sega/dreamcast/gdrom/GdromBits.class.h"
|
||||||
#include "sega/dreamcast/gdrom/Gdrom.class.h"
|
#include "sega/dreamcast/gdrom/Gdrom.class.h"
|
||||||
#include "sega/dreamcast/gdrom/GdromCommandPacketFormat_cd_open.class.h"
|
#include "sega/dreamcast/gdrom/GdromCommandPacketFormat_cd_open.class.h"
|
||||||
@ -86,6 +87,8 @@
|
|||||||
#include "sega/dreamcast/holly/TAVertexParameter_sprite_type_0.class.h"
|
#include "sega/dreamcast/holly/TAVertexParameter_sprite_type_0.class.h"
|
||||||
#include "sega/dreamcast/holly/TAVertexParameter_sprite_type_1.class.h"
|
#include "sega/dreamcast/holly/TAVertexParameter_sprite_type_1.class.h"
|
||||||
#include "sega/dreamcast/holly/TextureMemoryAllocation.class.h"
|
#include "sega/dreamcast/holly/TextureMemoryAllocation.class.h"
|
||||||
|
#include "sega/dreamcast/maple/MapleIF.class.h"
|
||||||
#include "sega/dreamcast/MemoryMap.class.h"
|
#include "sega/dreamcast/MemoryMap.class.h"
|
||||||
|
#include "sega/dreamcast/pvr_if/PVRIF.class.h"
|
||||||
#include "sega/dreamcast/systembus/SystembusBits.class.h"
|
#include "sega/dreamcast/systembus/SystembusBits.class.h"
|
||||||
#include "sega/dreamcast/systembus/Systembus.class.h"
|
#include "sega/dreamcast/systembus/Systembus.class.h"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
(const uint8_t *)&_binary_example_DreamcastVideo2_class_start,
|
(const uint8_t *)&_binary_example_DreamcastVideo2_class_start,
|
||||||
(const uint8_t *)&_binary_example_DreamcastVideo_class_start,
|
(const uint8_t *)&_binary_example_DreamcastVideo_class_start,
|
||||||
(const uint8_t *)&_binary_example_GdromTest_class_start,
|
(const uint8_t *)&_binary_example_GdromTest_class_start,
|
||||||
(const uint8_t *)&_binary_example_Vec2_class_start,
|
|
||||||
(const uint8_t *)&_binary_java_io_PrintStream_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_Boolean_class_start,
|
||||||
(const uint8_t *)&_binary_java_lang_Byte_class_start,
|
(const uint8_t *)&_binary_java_lang_Byte_class_start,
|
||||||
@ -26,6 +25,8 @@
|
|||||||
(const uint8_t *)&_binary_model_UntitledModel_class_start,
|
(const uint8_t *)&_binary_model_UntitledModel_class_start,
|
||||||
(const uint8_t *)&_binary_model_Vec2_class_start,
|
(const uint8_t *)&_binary_model_Vec2_class_start,
|
||||||
(const uint8_t *)&_binary_model_Vec3_class_start,
|
(const uint8_t *)&_binary_model_Vec3_class_start,
|
||||||
|
(const uint8_t *)&_binary_sega_dreamcast_g2_if_G2IF_class_start,
|
||||||
|
(const uint8_t *)&_binary_sega_dreamcast_gdrom_G1IF_class_start,
|
||||||
(const uint8_t *)&_binary_sega_dreamcast_gdrom_GdromBits_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_gdrom_Gdrom_class_start,
|
||||||
(const uint8_t *)&_binary_sega_dreamcast_gdrom_GdromCommandPacketFormat_cd_open_class_start,
|
(const uint8_t *)&_binary_sega_dreamcast_gdrom_GdromCommandPacketFormat_cd_open_class_start,
|
||||||
@ -86,6 +87,8 @@
|
|||||||
(const uint8_t *)&_binary_sega_dreamcast_holly_TAVertexParameter_sprite_type_0_class_start,
|
(const uint8_t *)&_binary_sega_dreamcast_holly_TAVertexParameter_sprite_type_0_class_start,
|
||||||
(const uint8_t *)&_binary_sega_dreamcast_holly_TAVertexParameter_sprite_type_1_class_start,
|
(const uint8_t *)&_binary_sega_dreamcast_holly_TAVertexParameter_sprite_type_1_class_start,
|
||||||
(const uint8_t *)&_binary_sega_dreamcast_holly_TextureMemoryAllocation_class_start,
|
(const uint8_t *)&_binary_sega_dreamcast_holly_TextureMemoryAllocation_class_start,
|
||||||
|
(const uint8_t *)&_binary_sega_dreamcast_maple_MapleIF_class_start,
|
||||||
(const uint8_t *)&_binary_sega_dreamcast_MemoryMap_class_start,
|
(const uint8_t *)&_binary_sega_dreamcast_MemoryMap_class_start,
|
||||||
|
(const uint8_t *)&_binary_sega_dreamcast_pvr_if_PVRIF_class_start,
|
||||||
(const uint8_t *)&_binary_sega_dreamcast_systembus_SystembusBits_class_start,
|
(const uint8_t *)&_binary_sega_dreamcast_systembus_SystembusBits_class_start,
|
||||||
(const uint8_t *)&_binary_sega_dreamcast_systembus_Systembus_class_start,
|
(const uint8_t *)&_binary_sega_dreamcast_systembus_Systembus_class_start,
|
||||||
|
@ -2,7 +2,6 @@ CLASS_PATH = \
|
|||||||
example/DreamcastVideo2.class.o \
|
example/DreamcastVideo2.class.o \
|
||||||
example/DreamcastVideo.class.o \
|
example/DreamcastVideo.class.o \
|
||||||
example/GdromTest.class.o \
|
example/GdromTest.class.o \
|
||||||
example/Vec2.class.o \
|
|
||||||
java/io/PrintStream.class.o \
|
java/io/PrintStream.class.o \
|
||||||
java/lang/Boolean.class.o \
|
java/lang/Boolean.class.o \
|
||||||
java/lang/Byte.class.o \
|
java/lang/Byte.class.o \
|
||||||
@ -27,6 +26,8 @@ CLASS_PATH = \
|
|||||||
model/UntitledModel.class.o \
|
model/UntitledModel.class.o \
|
||||||
model/Vec2.class.o \
|
model/Vec2.class.o \
|
||||||
model/Vec3.class.o \
|
model/Vec3.class.o \
|
||||||
|
sega/dreamcast/g2_if/G2IF.class.o \
|
||||||
|
sega/dreamcast/gdrom/G1IF.class.o \
|
||||||
sega/dreamcast/gdrom/GdromBits.class.o \
|
sega/dreamcast/gdrom/GdromBits.class.o \
|
||||||
sega/dreamcast/gdrom/Gdrom.class.o \
|
sega/dreamcast/gdrom/Gdrom.class.o \
|
||||||
sega/dreamcast/gdrom/GdromCommandPacketFormat_cd_open.class.o \
|
sega/dreamcast/gdrom/GdromCommandPacketFormat_cd_open.class.o \
|
||||||
@ -87,6 +88,8 @@ CLASS_PATH = \
|
|||||||
sega/dreamcast/holly/TAVertexParameter_sprite_type_0.class.o \
|
sega/dreamcast/holly/TAVertexParameter_sprite_type_0.class.o \
|
||||||
sega/dreamcast/holly/TAVertexParameter_sprite_type_1.class.o \
|
sega/dreamcast/holly/TAVertexParameter_sprite_type_1.class.o \
|
||||||
sega/dreamcast/holly/TextureMemoryAllocation.class.o \
|
sega/dreamcast/holly/TextureMemoryAllocation.class.o \
|
||||||
|
sega/dreamcast/maple/MapleIF.class.o \
|
||||||
sega/dreamcast/MemoryMap.class.o \
|
sega/dreamcast/MemoryMap.class.o \
|
||||||
|
sega/dreamcast/pvr_if/PVRIF.class.o \
|
||||||
sega/dreamcast/systembus/SystembusBits.class.o \
|
sega/dreamcast/systembus/SystembusBits.class.o \
|
||||||
sega/dreamcast/systembus/Systembus.class.o
|
sega/dreamcast/systembus/Systembus.class.o
|
||||||
|
12
generate.sh
12
generate.sh
@ -1,8 +1,14 @@
|
|||||||
python gen_decoder.py > c/decode.inc.c
|
python gen_decoder.py > c/decode.inc.c
|
||||||
|
|
||||||
python regs/register_gen.py ../dreamcast/regs/holly.csv holly 0xa05f8000 > sega/dreamcast/holly/Holly.java
|
# [block name] [package name] [class_name] [base_address]
|
||||||
python regs/register_gen.py ../dreamcast/regs/systembus.csv systembus 0xa05f6800 > sega/dreamcast/systembus/Systembus.java
|
python regs/register_gen.py ../dreamcast/regs/holly.csv holly holly Holly 0xa05f8000 > sega/dreamcast/holly/Holly.java
|
||||||
python regs/register_gen.py ~/dreamcast/regs/gdrom.csv gdrom 0xa05f7000 > sega/dreamcast/gdrom/Gdrom.java
|
python regs/register_gen.py ../dreamcast/regs/systembus.csv systembus systembus Systembus 0xa05f6800 > sega/dreamcast/systembus/Systembus.java
|
||||||
|
python regs/register_gen.py ../dreamcast/regs/systembus.csv maple_if maple MapleIF 0xa05f6c00 > sega/dreamcast/maple/MapleIF.java
|
||||||
|
python regs/register_gen.py ../dreamcast/regs/systembus.csv gdrom_if gdrom GdromIF 0xa05f7000 > sega/dreamcast/gdrom/GdromIF.java
|
||||||
|
python regs/register_gen.py ../dreamcast/regs/systembus.csv g1_if gdrom G1IF 0xa05f7400 > sega/dreamcast/gdrom/G1IF.java
|
||||||
|
python regs/register_gen.py ../dreamcast/regs/systembus.csv g2_if g2_if G2IF 0xa05f7800 > sega/dreamcast/g2_if/G2IF.java
|
||||||
|
python regs/register_gen.py ../dreamcast/regs/systembus.csv pvr_if pvr_if PVRIF 0xa05f7c00 > sega/dreamcast/pvr_if/PVRIF.java
|
||||||
|
python regs/register_gen.py ../dreamcast/regs/gdrom.csv gdrom gdrom Gdrom 0xa05f7000 > sega/dreamcast/gdrom/Gdrom.java
|
||||||
|
|
||||||
python regs/bits_gen.py ../dreamcast/regs/core_bits.csv holly CoreBits > sega/dreamcast/holly/CoreBits.java
|
python regs/bits_gen.py ../dreamcast/regs/core_bits.csv holly CoreBits > sega/dreamcast/holly/CoreBits.java
|
||||||
python regs/bits_gen.py ../dreamcast/regs/ta_bits.csv holly TABits > sega/dreamcast/holly/TABits.java
|
python regs/bits_gen.py ../dreamcast/regs/ta_bits.csv holly TABits > sega/dreamcast/holly/TABits.java
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
function make_class () {
|
function make_class () {
|
||||||
while read line; do
|
while read line; do
|
||||||
make -f Makefile.dreamcast.mk "${line%.java}.class"
|
echo "${line%.java}.class"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ function classpath_h () {
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
find sega/ java/ -name '*.class' -exec rm -f {} \;
|
find sega/ java/ -name '*.class' -exec rm -f {} \;
|
||||||
find model/ example/ sega/ java/ -name '*.java' | sort | make_class
|
make -j$(nproc) -f Makefile.dreamcast.mk $(find model/ example/ sega/ java/ -name '*.java' | make_class)
|
||||||
find model/ example/ sega/ java/ -name '*.class' | sort | rename_class_files
|
find model/ example/ sega/ java/ -name '*.class' | sort | rename_class_files
|
||||||
find model/ example/ sega/ java/ -name '*.class' | sort | classpath_mk
|
find model/ example/ sega/ java/ -name '*.class' | sort | classpath_mk
|
||||||
find model/ example/ sega/ java/ -name '*.class' | sort | classpath_inc_c
|
find model/ example/ sega/ java/ -name '*.class' | sort | classpath_inc_c
|
||||||
|
2
java.mk
2
java.mk
@ -2,7 +2,7 @@
|
|||||||
# javac $<
|
# javac $<
|
||||||
|
|
||||||
%.class: %.java
|
%.class: %.java
|
||||||
javac --source 8 --target 8 --boot-class-path . $<
|
javac -Xlint:-options --source 8 --target 8 --boot-class-path . $<
|
||||||
|
|
||||||
OBJ = \
|
OBJ = \
|
||||||
c/decode.o \
|
c/decode.o \
|
||||||
|
@ -6,9 +6,15 @@ import sys
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
rows = read_input(sys.argv[1])
|
rows = read_input(sys.argv[1])
|
||||||
package_name = sys.argv[2]
|
block_name = sys.argv[2]
|
||||||
base_address = int(sys.argv[3], 16)
|
package_name = sys.argv[3]
|
||||||
|
class_name = sys.argv[4]
|
||||||
|
base_address = int(sys.argv[5], 16)
|
||||||
blocks = group_by_block(map(parse_row, rows))
|
blocks = group_by_block(map(parse_row, rows))
|
||||||
render, out = renderer(indent_length=4)
|
render, out = renderer(indent_length=4)
|
||||||
render(generate_classes(package_name, base_address, blocks))
|
render(generate_classes(block_name,
|
||||||
|
package_name,
|
||||||
|
class_name,
|
||||||
|
base_address,
|
||||||
|
blocks))
|
||||||
sys.stdout.write(out.getvalue())
|
sys.stdout.write(out.getvalue())
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
def generate_register(base_address, register):
|
def generate_register(base_address, register):
|
||||||
yield f"public static final int {register.name} = {hex(base_address + register.address)};"
|
yield f"public static final int {register.name} = {hex(base_address + register.address)};"
|
||||||
|
|
||||||
def generate_classes(package_name, base_address, blocks):
|
def generate_classes(block_name, package_name, class_name, base_address, blocks):
|
||||||
yield f"package sega.dreamcast.{package_name};"
|
yield f"package sega.dreamcast.{package_name};"
|
||||||
for block, registers in blocks:
|
for block, registers in blocks:
|
||||||
if block.lower() != package_name.lower():
|
if block.lower() != block_name.lower():
|
||||||
continue
|
continue
|
||||||
yield f"public class {block.capitalize()} {{"
|
yield f"public class {class_name} {{"
|
||||||
for register in registers:
|
for register in registers:
|
||||||
yield from generate_register(base_address, register)
|
yield from generate_register(base_address, register)
|
||||||
yield "}"
|
yield "}"
|
||||||
|
15
sega/dreamcast/g2_if/G2IF.class.h
Normal file
15
sega/dreamcast/g2_if/G2IF.class.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern C {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern uint32_t _binary_sega_dreamcast_g2_if_G2IF_class_start __asm("_binary_sega_dreamcast_g2_if_G2IF_class_start");
|
||||||
|
extern uint32_t _binary_sega_dreamcast_g2_if_G2IF_class_end __asm("_binary_sega_dreamcast_g2_if_G2IF_class_end");
|
||||||
|
extern uint32_t _binary_sega_dreamcast_g2_if_G2IF_class_size __asm("_binary_sega_dreamcast_g2_if_G2IF_class_size");
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
54
sega/dreamcast/g2_if/G2IF.java
Normal file
54
sega/dreamcast/g2_if/G2IF.java
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
package sega.dreamcast.g2_if;
|
||||||
|
|
||||||
|
public class G2IF {
|
||||||
|
public static final int ADSTAG = 0xa05f7800;
|
||||||
|
public static final int ADSTAR = 0xa05f7804;
|
||||||
|
public static final int ADLEN = 0xa05f7808;
|
||||||
|
public static final int ADDIR = 0xa05f780c;
|
||||||
|
public static final int ADTSEL = 0xa05f7810;
|
||||||
|
public static final int ADEN = 0xa05f7814;
|
||||||
|
public static final int ADST = 0xa05f7818;
|
||||||
|
public static final int ADSUSP = 0xa05f781c;
|
||||||
|
public static final int E1STAG = 0xa05f7820;
|
||||||
|
public static final int E1STAR = 0xa05f7824;
|
||||||
|
public static final int E1LEN = 0xa05f7828;
|
||||||
|
public static final int E1DIR = 0xa05f782c;
|
||||||
|
public static final int E1TSEL = 0xa05f7830;
|
||||||
|
public static final int E1EN = 0xa05f7834;
|
||||||
|
public static final int E1ST = 0xa05f7838;
|
||||||
|
public static final int E1SUSP = 0xa05f783c;
|
||||||
|
public static final int E2STAG = 0xa05f7840;
|
||||||
|
public static final int E2STAR = 0xa05f7844;
|
||||||
|
public static final int E2LEN = 0xa05f7848;
|
||||||
|
public static final int E2DIR = 0xa05f784c;
|
||||||
|
public static final int E2TSEL = 0xa05f7850;
|
||||||
|
public static final int E2EN = 0xa05f7854;
|
||||||
|
public static final int E2ST = 0xa05f7858;
|
||||||
|
public static final int E2SUSP = 0xa05f785c;
|
||||||
|
public static final int DDSTAG = 0xa05f7860;
|
||||||
|
public static final int DDSTAR = 0xa05f7864;
|
||||||
|
public static final int DDLEN = 0xa05f7868;
|
||||||
|
public static final int DDDIR = 0xa05f786c;
|
||||||
|
public static final int DDTSEL = 0xa05f7870;
|
||||||
|
public static final int DDEN = 0xa05f7874;
|
||||||
|
public static final int DDST = 0xa05f7878;
|
||||||
|
public static final int DDSUSP = 0xa05f787c;
|
||||||
|
public static final int G2ID = 0xa05f7880;
|
||||||
|
public static final int G2DSTO = 0xa05f7890;
|
||||||
|
public static final int G2TRTO = 0xa05f7894;
|
||||||
|
public static final int G2MDMTO = 0xa05f7898;
|
||||||
|
public static final int G2MDMW = 0xa05f789c;
|
||||||
|
public static final int G2APRO = 0xa05f78bc;
|
||||||
|
public static final int ADSTAGD = 0xa05f78c0;
|
||||||
|
public static final int ADSTARD = 0xa05f78c4;
|
||||||
|
public static final int ADLEND = 0xa05f78c8;
|
||||||
|
public static final int E1STAGD = 0xa05f78d0;
|
||||||
|
public static final int E1STARD = 0xa05f78d4;
|
||||||
|
public static final int E1LEND = 0xa05f78d8;
|
||||||
|
public static final int E2STAGD = 0xa05f78e0;
|
||||||
|
public static final int E2STARD = 0xa05f78e4;
|
||||||
|
public static final int E2LEND = 0xa05f78e8;
|
||||||
|
public static final int DDSTAGD = 0xa05f78f0;
|
||||||
|
public static final int DDSTARD = 0xa05f78f4;
|
||||||
|
public static final int DDLEND = 0xa05f78f8;
|
||||||
|
}
|
15
sega/dreamcast/gdrom/G1IF.class.h
Normal file
15
sega/dreamcast/gdrom/G1IF.class.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern C {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern uint32_t _binary_sega_dreamcast_gdrom_G1IF_class_start __asm("_binary_sega_dreamcast_gdrom_G1IF_class_start");
|
||||||
|
extern uint32_t _binary_sega_dreamcast_gdrom_G1IF_class_end __asm("_binary_sega_dreamcast_gdrom_G1IF_class_end");
|
||||||
|
extern uint32_t _binary_sega_dreamcast_gdrom_G1IF_class_size __asm("_binary_sega_dreamcast_gdrom_G1IF_class_size");
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
23
sega/dreamcast/gdrom/G1IF.java
Normal file
23
sega/dreamcast/gdrom/G1IF.java
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package sega.dreamcast.gdrom;
|
||||||
|
|
||||||
|
public class G1IF {
|
||||||
|
public static final int GDSTAR = 0xa05f7404;
|
||||||
|
public static final int GDLEN = 0xa05f7408;
|
||||||
|
public static final int GDDIR = 0xa05f740c;
|
||||||
|
public static final int GDEN = 0xa05f7414;
|
||||||
|
public static final int GDST = 0xa05f7418;
|
||||||
|
public static final int G1RRC = 0xa05f7480;
|
||||||
|
public static final int G1RWC = 0xa05f7484;
|
||||||
|
public static final int G1FRC = 0xa05f7488;
|
||||||
|
public static final int G1FWC = 0xa05f748c;
|
||||||
|
public static final int G1CRC = 0xa05f7490;
|
||||||
|
public static final int G1CWC = 0xa05f7494;
|
||||||
|
public static final int G1GDRC = 0xa05f74a0;
|
||||||
|
public static final int G1GDWC = 0xa05f74a4;
|
||||||
|
public static final int G1SYSM = 0xa05f74b0;
|
||||||
|
public static final int G1CRDYC = 0xa05f74b4;
|
||||||
|
public static final int GDAPRO = 0xa05f74b8;
|
||||||
|
public static final int GDUNLOCK = 0xa05f74e4;
|
||||||
|
public static final int GDSTARD = 0xa05f74f4;
|
||||||
|
public static final int GDLEND = 0xa05f74f8;
|
||||||
|
}
|
2
sega/dreamcast/gdrom/GdromIF.java
Normal file
2
sega/dreamcast/gdrom/GdromIF.java
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
package sega.dreamcast.gdrom;
|
||||||
|
|
@ -7,6 +7,8 @@ public class GdromProtocol {
|
|||||||
static GdromCommandPacketFormat.get_toc get_toc_command;
|
static GdromCommandPacketFormat.get_toc get_toc_command;
|
||||||
static short[] toc_buf;
|
static short[] toc_buf;
|
||||||
|
|
||||||
|
static GdromCommandPacketFormat.cd_read cd_read_command;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
int single_density_area = 0;
|
int single_density_area = 0;
|
||||||
int maximum_toc_length = 0x0198;
|
int maximum_toc_length = 0x0198;
|
||||||
@ -14,6 +16,8 @@ public class GdromProtocol {
|
|||||||
maximum_toc_length);
|
maximum_toc_length);
|
||||||
|
|
||||||
toc_buf = new short[maximum_toc_length >> 1];
|
toc_buf = new short[maximum_toc_length >> 1];
|
||||||
|
|
||||||
|
cd_read_command = new GdromCommandPacketFormat.cd_read(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void packetCommand(GdromCommandPacketInterface command, boolean enable_dma) {
|
public static void packetCommand(GdromCommandPacketInterface command, boolean enable_dma) {
|
||||||
@ -95,4 +99,24 @@ public class GdromProtocol {
|
|||||||
// assume track 1 is the correct track
|
// assume track 1 is the correct track
|
||||||
return getFad(toc_buf, 1);
|
return getFad(toc_buf, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void cdReadSet(int data, int starting_address, int transfer_length) {
|
||||||
|
cd_read_command.data = data;
|
||||||
|
cd_read_command.starting_address0 = (starting_address >> 16) & 0xff;
|
||||||
|
cd_read_command.starting_address1 = (starting_address >> 8) & 0xff;
|
||||||
|
cd_read_command.starting_address2 = (starting_address >> 0) & 0xff;
|
||||||
|
cd_read_command.transfer_length0 = (transfer_length >> 16) & 0xff;
|
||||||
|
cd_read_command.transfer_length1 = (transfer_length >> 8) & 0xff;
|
||||||
|
cd_read_command.transfer_length2 = (transfer_length >> 0) & 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void cdReadDMA(int starting_address, int transfer_length) {
|
||||||
|
int data_select = 0b0010; // data
|
||||||
|
int expected_data_type = 0b100; // XA mode 2 form 1
|
||||||
|
int parameter_type = 0b0; // FAD specified
|
||||||
|
int data = (data_select << 4) | (expected_data_type << 1) | (parameter_type);
|
||||||
|
|
||||||
|
cdReadSet(data, starting_address, transfer_length);
|
||||||
|
packetCommand(cd_read_command, true); // DMA mode
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
15
sega/dreamcast/maple/MapleIF.class.h
Normal file
15
sega/dreamcast/maple/MapleIF.class.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern C {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern uint32_t _binary_sega_dreamcast_maple_MapleIF_class_start __asm("_binary_sega_dreamcast_maple_MapleIF_class_start");
|
||||||
|
extern uint32_t _binary_sega_dreamcast_maple_MapleIF_class_end __asm("_binary_sega_dreamcast_maple_MapleIF_class_end");
|
||||||
|
extern uint32_t _binary_sega_dreamcast_maple_MapleIF_class_size __asm("_binary_sega_dreamcast_maple_MapleIF_class_size");
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
16
sega/dreamcast/maple/MapleIF.java
Normal file
16
sega/dreamcast/maple/MapleIF.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package sega.dreamcast.maple;
|
||||||
|
|
||||||
|
public class MapleIF {
|
||||||
|
public static final int MDSTAR = 0xa05f6c04;
|
||||||
|
public static final int MDTSEL = 0xa05f6c10;
|
||||||
|
public static final int MDEN = 0xa05f6c14;
|
||||||
|
public static final int MDST = 0xa05f6c18;
|
||||||
|
public static final int MSYS = 0xa05f6c80;
|
||||||
|
public static final int MST = 0xa05f6c84;
|
||||||
|
public static final int MSHTCL = 0xa05f6c88;
|
||||||
|
public static final int MDAPRO = 0xa05f6c8c;
|
||||||
|
public static final int MMSEL = 0xa05f6ce8;
|
||||||
|
public static final int MTXDAD = 0xa05f6cf4;
|
||||||
|
public static final int MRXDAD = 0xa05f6cf8;
|
||||||
|
public static final int MRXDBD = 0xa05f6cfc;
|
||||||
|
}
|
15
sega/dreamcast/pvr_if/PVRIF.class.h
Normal file
15
sega/dreamcast/pvr_if/PVRIF.class.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern C {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern uint32_t _binary_sega_dreamcast_pvr_if_PVRIF_class_start __asm("_binary_sega_dreamcast_pvr_if_PVRIF_class_start");
|
||||||
|
extern uint32_t _binary_sega_dreamcast_pvr_if_PVRIF_class_end __asm("_binary_sega_dreamcast_pvr_if_PVRIF_class_end");
|
||||||
|
extern uint32_t _binary_sega_dreamcast_pvr_if_PVRIF_class_size __asm("_binary_sega_dreamcast_pvr_if_PVRIF_class_size");
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
15
sega/dreamcast/pvr_if/PVRIF.java
Normal file
15
sega/dreamcast/pvr_if/PVRIF.java
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package sega.dreamcast.pvr_if;
|
||||||
|
|
||||||
|
public class PVRIF {
|
||||||
|
public static final int PDSTAP = 0xa05f7c00;
|
||||||
|
public static final int PDSTAR = 0xa05f7c04;
|
||||||
|
public static final int PDLEN = 0xa05f7c08;
|
||||||
|
public static final int PDDIR = 0xa05f7c0c;
|
||||||
|
public static final int PDTSEL = 0xa05f7c10;
|
||||||
|
public static final int PDEN = 0xa05f7c14;
|
||||||
|
public static final int PDST = 0xa05f7c18;
|
||||||
|
public static final int PDAPRO = 0xa05f7c80;
|
||||||
|
public static final int PDSTAPD = 0xa05f7cf0;
|
||||||
|
public static final int PDSTARD = 0xa05f7cf4;
|
||||||
|
public static final int PDLEND = 0xa05f7cf8;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user