holly: add ISTERR checking

I'd like to improve this at some point.
This commit is contained in:
Zack Buhman 2024-09-13 05:43:50 -05:00
parent 04785a23a3
commit 448da5f72a
3 changed files with 18 additions and 2 deletions

1
.gitignore vendored
View File

@ -13,6 +13,7 @@ __pycache__
scramble
cdi4dc
tools/ttf_outline
k_means/k_means_vq
*.blend1
*.scramble
*.FCStd1

View File

@ -2,6 +2,7 @@
#include "memorymap.hpp"
#include "systembus.hpp"
#include "systembus_bits.hpp"
#include "sh7091/serial.hpp"
#include "texture_memory_alloc.hpp"
#include "holly.hpp"
@ -112,7 +113,15 @@ void core_wait_end_of_render_video()
"Furthermore, it is strongly recommended that the End of ISP and End of Video interrupts
be cleared at the same time in order to make debugging easier when an error occurs."
*/
while ((system.ISTNRM & istnrm::end_of_render_tsp) == 0);
while ((system.ISTNRM & istnrm::end_of_render_tsp) == 0) {
if (system.ISTERR) {
serial::string("core ");
serial::integer<uint32_t>(system.ISTERR);
holly.SOFTRESET = softreset::pipeline_soft_reset;
holly.SOFTRESET = 0;
break;
}
};
system.ISTNRM = istnrm::end_of_render_tsp
| istnrm::end_of_render_isp
| istnrm::end_of_render_video;

View File

@ -4,6 +4,7 @@
#include "systembus_bits.hpp"
#include "sh7091/sh7091.hpp"
#include "sh7091/sh7091_bits.hpp"
#include "sh7091/serial.hpp"
#include "core_bits.hpp"
#include "ta_bits.hpp"
@ -139,7 +140,12 @@ void ta_polygon_converter_transfer(volatile uint32_t const * const buf, uint32_t
void ta_wait_opaque_list()
{
while ((system.ISTNRM & istnrm::end_of_transferring_opaque_list) == 0);
while ((system.ISTNRM & istnrm::end_of_transferring_opaque_list) == 0) {
if (system.ISTERR) {
serial::string("ta ");
serial::integer<uint32_t>(system.ISTERR);
}
};
system.ISTNRM = istnrm::end_of_transferring_opaque_list;
}