From 4d71083130c41c99e7384a3252975456125a1204 Mon Sep 17 00:00:00 2001 From: sup39 Date: Tue, 7 Feb 2023 16:29:10 +0900 Subject: [PATCH] Support int32 and int16 for fields in CustomizedDisplay --- Codes.xml | 6 ------ changelog.md | 4 ++++ site/.vuepress/components/codes/CustomizedDisplay/fields.js | 2 +- site/.vuepress/components/codes/CustomizedDisplay/format.js | 4 +++- site/.vuepress/components/codes/CustomizedDisplay/loader.js | 2 +- site/.vuepress/components/codes/asm.js | 5 +++++ 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Codes.xml b/Codes.xml index 0899928..ed9be22 100644 --- a/Codes.xml +++ b/Codes.xml @@ -4054,9 +4054,6 @@ ::: warning Shine Get Timer does not restart with this code. ::: - ::: warning - Z menu will be disabled - ::: #### Instant Restart - Press `B + D-Pad Up` to **restart the current area** @@ -4084,9 +4081,6 @@ ::: warning シャインゲットタイマーには未対応です。 ::: - ::: warning - Zメニューは無効化されます。 - ::: #### ポーズせずにやり直し - `B+十字キー上`で**現在のエリアをやり直す** diff --git a/changelog.md b/changelog.md index d9fd4be..363d5d7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,8 @@ # Changelog +## Feb 07, 2023 +### Updated 'Customized Display' +Support signed int32 and int16 for fields + ## Feb 06, 2023 ### Fixed 'Customized Display' Fixed the hex value of multi-byte char in format string diff --git a/site/.vuepress/components/codes/CustomizedDisplay/fields.js b/site/.vuepress/components/codes/CustomizedDisplay/fields.js index b0ae70a..cfceaf1 100644 --- a/site/.vuepress/components/codes/CustomizedDisplay/fields.js +++ b/site/.vuepress/components/codes/CustomizedDisplay/fields.js @@ -86,7 +86,7 @@ export const fields = [ id: 'goop', fmt: '%d', preview: 600, - ...makeFunctionLoader(32, (ver) => [ + ...makeFunctionLoader(-32, (ver) => [ { type: 'call', addr: addrs.getPollutionDegree[ver], diff --git a/site/.vuepress/components/codes/CustomizedDisplay/format.js b/site/.vuepress/components/codes/CustomizedDisplay/format.js index 1f9ad5d..e189723 100644 --- a/site/.vuepress/components/codes/CustomizedDisplay/format.js +++ b/site/.vuepress/components/codes/CustomizedDisplay/format.js @@ -8,6 +8,8 @@ const dtype2fmtinfo = { 8: { prefix: 'hh', mask: 0xff }, 16: { prefix: 'h', mask: 0xffff }, 32: { prefix: '', mask: 0xffffffff }, + [-16]: { prefix: 'h', mask: 0xffff }, + [-32]: { prefix: '', mask: 0xffffffff }, }; /** @@ -58,7 +60,7 @@ export function parseFormat(input, version) { ipvw &= mask; const m = fmt2.trim().match(/^%?(\d*)h{,2}([dioxXu])$/); padfmt = m?.[1] || ''; - const t = m?.[2] || 'u'; + const t = m?.[2] || (dtype > 0 ? 'u' : 'd'); fmt = `%${padfmt}${prefix}${t}`; if ('di'.includes(t)) { if (ipvw > mask >>> 1) ipvw -= mask; diff --git a/site/.vuepress/components/codes/CustomizedDisplay/loader.js b/site/.vuepress/components/codes/CustomizedDisplay/loader.js index 8e3eaaf..34869bb 100644 --- a/site/.vuepress/components/codes/CustomizedDisplay/loader.js +++ b/site/.vuepress/components/codes/CustomizedDisplay/loader.js @@ -12,7 +12,7 @@ export const fTmp = 12; * @typedef {LoadDstReg|LoadDstStack} LoadDst * @typedef {{ * asm(version: GameVersion, dst: LoadDst): ASMInst[] - * dtype: 8|16|32|'float' + * dtype: 8|16|-16|32|-32|'float' * calling: boolean * }} Loader */ diff --git a/site/.vuepress/components/codes/asm.js b/site/.vuepress/components/codes/asm.js index 3d0df90..b8991c2 100644 --- a/site/.vuepress/components/codes/asm.js +++ b/site/.vuepress/components/codes/asm.js @@ -123,6 +123,7 @@ export const ASM = { // load rS, rA, D lbz: makeInstD(34), lhz: makeInstD(40), + lha: makeInstD(42), lwz: makeInstD(32), lfs: makeInstD(48), lfd: makeInstD(50), @@ -161,12 +162,16 @@ export const $load = { 8: ASM.lbz, 16: ASM.lhz, 32: ASM.lwz, + [-16]: ASM.lha, + [-32]: ASM.lwz, float: ASM.lfs, }; export const $store = { 8: ASM.stb, 16: ASM.sth, 32: ASM.stw, + [-16]: ASM.sth, + [-32]: ASM.stw, float: ASM.stfs, double: ASM.stfd, };