holly/core: use End of TSP interrupt
Core bug #20 is real: The "End_Of_Video" interrupt is sometimes not output. Replace with "End_Of_TSP
This commit is contained in:
parent
59f8c1b3ff
commit
aa805468d9
@ -174,23 +174,17 @@ void main()
|
||||
|
||||
while (1) {
|
||||
ta_polygon_converter_init(opb_size.total() * tiles, ta_alloc);
|
||||
|
||||
auto parameter = ta_parameter_writer(ta_parameter_buf);
|
||||
for (uint32_t i = 0; i < num_faces; i++) {
|
||||
transform(parameter, cube_faces[i], 4);
|
||||
}
|
||||
parameter.append<global_end_of_list>() = global_end_of_list();
|
||||
|
||||
ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset);
|
||||
|
||||
ta_wait_opaque_list();
|
||||
|
||||
core_start_render(frame_ix, num_frames);
|
||||
|
||||
v_sync_out();
|
||||
v_sync_in();
|
||||
core_wait_end_of_render_video(frame_ix, num_frames);
|
||||
|
||||
theta += half_degree;
|
||||
frame_ix += 1;
|
||||
}
|
||||
|
@ -69,17 +69,18 @@ void core_start_render(uint32_t frame_ix, uint32_t num_frames)
|
||||
holly.STARTRENDER = 1;
|
||||
}
|
||||
|
||||
static bool flycast_is_dumb = 0;
|
||||
static bool flycast_is_dumb = false;
|
||||
|
||||
#include "serial.hpp"
|
||||
|
||||
void core_wait_end_of_render_video(uint32_t frame_ix, uint32_t num_frames)
|
||||
{
|
||||
if (!flycast_is_dumb) {
|
||||
flycast_is_dumb = true;
|
||||
} else {
|
||||
while ((system.ISTNRM & ISTNRM__END_OF_RENDER_TSP) == 0);
|
||||
system.ISTNRM = ISTNRM__END_OF_RENDER_TSP;
|
||||
}
|
||||
uint32_t r_fb = ((frame_ix + 1) & num_frames) * 0x00096000;
|
||||
holly.FB_R_SOF1 = (offsetof (struct texture_memory_alloc, framebuffer)) + r_fb;
|
||||
|
||||
if (!flycast_is_dumb) {
|
||||
flycast_is_dumb = 1;
|
||||
} else {
|
||||
while ((system.ISTNRM & ISTNRM__END_OF_RENDER_VIDEO) == 0);
|
||||
system.ISTNRM = ISTNRM__END_OF_RENDER_VIDEO;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user