From 448da5f72a33bba032c29354f69593c77aca8c51 Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Fri, 13 Sep 2024 05:43:50 -0500 Subject: [PATCH] holly: add ISTERR checking I'd like to improve this at some point. --- .gitignore | 1 + holly/core.cpp | 11 ++++++++++- holly/ta_fifo_polygon_converter.cpp | 8 +++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2c0bb40..9a8c88e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ __pycache__ scramble cdi4dc tools/ttf_outline +k_means/k_means_vq *.blend1 *.scramble *.FCStd1 \ No newline at end of file diff --git a/holly/core.cpp b/holly/core.cpp index 47281f8..fe754e8 100644 --- a/holly/core.cpp +++ b/holly/core.cpp @@ -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(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; diff --git a/holly/ta_fifo_polygon_converter.cpp b/holly/ta_fifo_polygon_converter.cpp index 3057d4b..f70e349 100644 --- a/holly/ta_fifo_polygon_converter.cpp +++ b/holly/ta_fifo_polygon_converter.cpp @@ -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(system.ISTERR); + } + }; system.ISTNRM = istnrm::end_of_transferring_opaque_list; }