JavaCubeMemory: slightly incorrect pipelined rendering
This commit is contained in:
parent
ca5024d14f
commit
0fb917f472
@ -53,7 +53,7 @@ public class JavaCubeMemory {
|
||||
| ISPTSP.tsp_instruction_word__texture_v_size__1024
|
||||
| ISPTSP.tsp_instruction_word__use_alpha;
|
||||
|
||||
static final int texture_address = TextureMemoryAllocation.texture_regions[1][0] + 512;
|
||||
static final int texture_address = TextureMemoryAllocation.texture_regions[0][0] + 512;
|
||||
static final int texture_control_word = ISPTSP.texture_control_word__pixel_format__4444
|
||||
| ISPTSP.texture_control_word__scan_order__non_twiddled
|
||||
| ISPTSP.texture_control_word__texture_address(texture_address / 8);
|
||||
@ -142,20 +142,13 @@ public class JavaCubeMemory {
|
||||
}
|
||||
|
||||
public static void transfer_textures() {
|
||||
int texture = MemoryMap.texture_memory64 + TextureMemoryAllocation.texture_regions[1][0] + 512;
|
||||
int texture = MemoryMap.texture_memory64 + TextureMemoryAllocation.texture_regions[0][0] + 512;
|
||||
|
||||
int length = 512 * 512 * 2 * 2 / 4;
|
||||
int address = 0xac400000;
|
||||
for (int i = 0; i < length; i++) {
|
||||
int value = Memory.getU4(address);
|
||||
Memory.putU4(texture, value);
|
||||
if ((i & 2047) == 0) {
|
||||
System.out.print(i);
|
||||
System.out.print(' ');
|
||||
System.out.print(address);
|
||||
System.out.print(' ');
|
||||
System.out.print(texture);
|
||||
}
|
||||
address += 4;
|
||||
texture += 4;
|
||||
}
|
||||
@ -163,6 +156,11 @@ public class JavaCubeMemory {
|
||||
|
||||
public static void main() {
|
||||
System.out.println("main1");
|
||||
|
||||
System.out.println("transfer_textures");
|
||||
transfer_textures();
|
||||
System.out.println("transfer_textures2");
|
||||
|
||||
int ta_alloc =
|
||||
TABits.ta_alloc_ctrl__opb_mode__increasing_addresses
|
||||
| TABits.ta_alloc_ctrl__pt_opb__no_list
|
||||
@ -205,10 +203,6 @@ public class JavaCubeMemory {
|
||||
|
||||
Core.init();
|
||||
|
||||
System.out.println("transfer_textures");
|
||||
transfer_textures();
|
||||
System.out.println("transfer_textures2");
|
||||
|
||||
VideoOutput.set_framebuffer_resolution(640, 480);
|
||||
VideoOutput.set_mode(VideoOutputMode.vga);
|
||||
|
||||
@ -217,8 +211,37 @@ public class JavaCubeMemory {
|
||||
System.out.println("main");
|
||||
int framebuffer_tiles_width = framebuffer_width / 32;
|
||||
int framebuffer_tiles_height = framebuffer_height / 32;
|
||||
|
||||
// prime
|
||||
for (int i = 0; i < 2; i++) {
|
||||
TAFIFOPolygonConverter.init(TextureMemoryAllocation.isp_tsp_parameters_start[i],
|
||||
TextureMemoryAllocation.isp_tsp_parameters_end[i],
|
||||
TextureMemoryAllocation.object_list_start[i],
|
||||
TextureMemoryAllocation.object_list_end[i],
|
||||
opb_size_total,
|
||||
ta_alloc,
|
||||
framebuffer_tiles_width,
|
||||
framebuffer_tiles_height);
|
||||
transfer_cube_scene();
|
||||
if (i == 0)
|
||||
TAFIFOPolygonConverter.wait_translucent_list();
|
||||
}
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
Core.start_render(TextureMemoryAllocation.region_array_start[core],
|
||||
TextureMemoryAllocation.isp_tsp_parameters_start[core],
|
||||
TextureMemoryAllocation.background_start[1],
|
||||
TextureMemoryAllocation.framebuffer_start[i],
|
||||
framebuffer_width);
|
||||
if (i == 0)
|
||||
Core.wait_end_of_render_tsp();
|
||||
}
|
||||
|
||||
while (true) {
|
||||
ta = (core + 1) & 1;
|
||||
|
||||
// unpipelined render loop
|
||||
TAFIFOPolygonConverter.wait_translucent_list();
|
||||
TAFIFOPolygonConverter.init(TextureMemoryAllocation.isp_tsp_parameters_start[ta],
|
||||
TextureMemoryAllocation.isp_tsp_parameters_end[ta],
|
||||
TextureMemoryAllocation.object_list_start[ta],
|
||||
@ -228,20 +251,19 @@ public class JavaCubeMemory {
|
||||
framebuffer_tiles_width,
|
||||
framebuffer_tiles_height);
|
||||
transfer_cube_scene();
|
||||
TAFIFOPolygonConverter.wait_translucent_list();
|
||||
|
||||
Core.start_render(TextureMemoryAllocation.region_array_start[ta],
|
||||
TextureMemoryAllocation.isp_tsp_parameters_start[ta],
|
||||
TextureMemoryAllocation.background_start[1],
|
||||
Core.wait_end_of_render_tsp();
|
||||
Core.start_render(TextureMemoryAllocation.region_array_start[core],
|
||||
TextureMemoryAllocation.isp_tsp_parameters_start[core],
|
||||
TextureMemoryAllocation.background_start[core],
|
||||
TextureMemoryAllocation.framebuffer_start[core],
|
||||
framebuffer_width);
|
||||
Core.wait_end_of_render_tsp();
|
||||
|
||||
while (!(CoreBits.spg_status__vsync(Memory.getU4(Holly.SPG_STATUS)) != 0));
|
||||
Memory.putU4(Holly.FB_R_SOF1, TextureMemoryAllocation.framebuffer_start[core]);
|
||||
while ((CoreBits.spg_status__vsync(Memory.getU4(Holly.SPG_STATUS)) != 0));
|
||||
Memory.putU4(Holly.FB_R_SOF1, TextureMemoryAllocation.framebuffer_start[ta]);
|
||||
|
||||
core = (core + 1) & 1;
|
||||
core = ta;
|
||||
|
||||
theta += Math.DEGREES_TO_RADIANS;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package sega.dreamcast.holly;
|
||||
|
||||
public class TextureMemoryAllocation {
|
||||
/* frame A frame B */
|
||||
/*
|
||||
public static final int[] isp_tsp_parameters_start = { 0x000000, 0x080000 };
|
||||
public static final int[] isp_tsp_parameters_end = { 0x07ffc0, 0x0fffc0 };
|
||||
public static final int[] background_start = { 0x07ffc0, 0x0fffc0 };
|
||||
@ -12,10 +13,21 @@ public class TextureMemoryAllocation {
|
||||
public static final int[] region_array_end = { 0x210000, 0x220000 };
|
||||
public static final int[] framebuffer_start = { 0x220000, 0x2c8c00 }; // 720 x 480 @ 16bpp
|
||||
public static final int[] framebuffer_end = { 0x2c8c00, 0x371800 }; // 720 x 480 @ 16bpp
|
||||
*/
|
||||
public static final int[] isp_tsp_parameters_start = { 0x000000, 0x400000 };
|
||||
public static final int[] isp_tsp_parameters_end = { 0x0fffc0, 0x4fffc0 };
|
||||
public static final int[] background_start = { 0x0fffc0, 0x4fffc0 };
|
||||
public static final int[] background_end = { 0x100000, 0x500000 };
|
||||
public static final int[] object_list_start = { 0x100000, 0x500000 };
|
||||
public static final int[] object_list_end = { 0x200000 - 0x20, 0x600000 - 0x20 };
|
||||
public static final int[] region_array_start = { 0x296000, 0x696000 };
|
||||
public static final int[] region_array_end = { 0x2a6000, 0x6a0000 };
|
||||
public static final int[] framebuffer_start = { 0x200000, 0x600000 }; // 640 x 480 @ 16bpp
|
||||
public static final int[] framebuffer_end = { 0x296000, 0x696000 }; // 640 x 480 @ 16bpp
|
||||
|
||||
public static final int[][] texture_regions = {
|
||||
/* start end */
|
||||
{ 0x200000, 0x400000 },
|
||||
{ 0x600000, 0x800000 },
|
||||
{ 0x54c000, 0x400000 },
|
||||
{ 0x54c000, 0x800000 },
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user