From 19461e315e522853b35527a17f6a493ba0b06e9c Mon Sep 17 00:00:00 2001 From: Rebmiami <59275598+Rebmiami@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:55:13 -0500 Subject: [PATCH] Adjustments to ARAY read/write feature --- src/simulation/elements/ARAY.cpp | 4 ++++ src/simulation/elements/PAPR.cpp | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/simulation/elements/ARAY.cpp b/src/simulation/elements/ARAY.cpp index 0968cc804..38393d91a 100644 --- a/src/simulation/elements/ARAY.cpp +++ b/src/simulation/elements/ARAY.cpp @@ -173,6 +173,8 @@ static int update(UPDATE_FUNC_ARGS) if (parts[r].tmp & 0x10) { // Read + // End reading state early + parts[r].tmp = 0; if ((parts[r].life >> 24) & 0x1) { break; @@ -232,6 +234,8 @@ static int update(UPDATE_FUNC_ARGS) if (parts[r].tmp & 0x10) { // Read + // End reading state early + parts[r].tmp = 0; if ((parts[r].life >> 24) & 0x1) { break; diff --git a/src/simulation/elements/PAPR.cpp b/src/simulation/elements/PAPR.cpp index e216b6876..78fd53d01 100644 --- a/src/simulation/elements/PAPR.cpp +++ b/src/simulation/elements/PAPR.cpp @@ -134,5 +134,23 @@ static int graphics(GRAPHICS_FUNC_ARGS) *colg -= (int)restrict_flt((maxtemp-450)*1.4f,0,230); *colb -= (int)restrict_flt((maxtemp-450)*1.7f,0,197); } + if (cpart->tmp) + { + *pixel_mode |= PMODE_GLOW; + float flash = (cpart->tmp & 0xF) / 15.f; + *cola = flash * 200; + *colr = int(*colr * (1 - flash)); + *colg = int(*colg * (1 - flash)); + *colb = int(*colb * (1 - flash)); + if (cpart->tmp & 0x10) + { + *colr += int(255 * flash); + } + else + { + *colg += int(255 * flash); + *colb += int(255 * flash); + } + } return 0; }