From 2f0be0bf687de2a503f195bf655e454839ba357c Mon Sep 17 00:00:00 2001 From: sup39 Date: Wed, 1 Feb 2023 02:49:55 +0900 Subject: [PATCH] Created 'Quarterframe Section Timer' --- Codes.xml | 152 ++++++++++++++++++ changelog.md | 3 + site/.vuepress/components/CodeInfo.vue | 3 +- site/.vuepress/components/Generator.vue | 2 + site/.vuepress/components/Preview.vue | 3 +- site/.vuepress/components/codes/codegen.js | 2 + site/.vuepress/components/codes/labels.json | 6 + .../components/codes/qfst/codegen.js | 66 ++++++++ .../components/codes/qfst/config.vue | 69 ++++++++ .../.vuepress/components/codes/qft/config.vue | 15 +- site/.vuepress/components/codes/ui.js | 2 + 11 files changed, 306 insertions(+), 17 deletions(-) create mode 100644 site/.vuepress/components/codes/qfst/codegen.js create mode 100644 site/.vuepress/components/codes/qfst/config.vue diff --git a/Codes.xml b/Codes.xml index 3a48e50..2d9644a 100644 --- a/Codes.xml +++ b/Codes.xml @@ -4221,4 +4221,156 @@ 040eb024 60000000 + + qfst + misc + Quarterframe Section Timer + QFセクションタイマー + sup39(サポミク) + 0.1 + Jan 31, 2023 + drawText + + Calculate and display section times whenever Quarterframe Timer freezes. + + + QFタイマーが一時停止する度にセクションタイムを計算して表示します。 + + + C20F9DD0 00000003 + 3C60817F 3BA00004 + 93A303CC 3BA00000 + B3A303CA 00000000 + C22069E4 0000001B + 3821FFD0 BF210008 + 3F20817F AB9903B2 + 3BF903D0 A3D903CA + 7F9DE378 835903B4 + 80D900BC 28060000 + 41A2002C 809900B8 + 80B903CC 7C042800 + 40A1001C 7C052050 + 57CC16BA 7C1F612E + 909903CC 3BDE0001 + B3D903CA 3879039C + 389903AC 3D808020 + 398C1EA8 7D8803A6 + 4E800021 57DBE13F + 41820008 3B7EFFF0 + 7C1BF040 4080004C + 576316BA 7C1F182E + 1D6003E9 38000078 + 7D6B0396 380003E8 + 7CAB0396 1C0503E8 + 7CC05850 387903B0 + 389903C0 39990238 + 7D8803A6 4E800021 + 7FBDD214 3B7B0001 + B3B903B2 4BFFFFB4 + B39903B2 BB210008 + 38210030 00000000 + + + C2286228 00000003 + 3C60817F 3BA00004 + 93A303CC 3BA00000 + B3A303CA 00000000 + C2125550 0000001B + 3821FFD0 BF210008 + 3F20817F AB9903B2 + 3BF903D0 A3D903CA + 7F9DE378 835903B4 + 80D900BC 28060000 + 41A2002C 809900B8 + 80B903CC 7C042800 + 40A1001C 7C052050 + 57CC16BA 7C1F612E + 909903CC 3BDE0001 + B3D903CA 3879039C + 389903AC 3D808012 + 398C1660 7D8803A6 + 4E800021 57DBE13F + 41820008 3B7EFFF0 + 7C1BF040 4080004C + 576316BA 7C1F182E + 1D6003E9 38000078 + 7D6B0396 380003E8 + 7CAB0396 1C0503E8 + 7CC05850 387903B0 + 389903C0 39990238 + 7D8803A6 4E800021 + 7FBDD214 3B7B0001 + B3B903B2 4BFFFFB4 + B39903B2 BB210008 + 38210030 00000000 + + + C229E2DC 00000003 + 3C60817F 3BA00004 + 93A303CC 3BA00000 + B3A303CA 00000000 + C2138E00 0000001B + 3821FFD0 BF210008 + 3F20817F AB9903B2 + 3BF903D0 A3D903CA + 7F9DE378 835903B4 + 80D900BC 28060000 + 41A2002C 809900B8 + 80B903CC 7C042800 + 40A1001C 7C052050 + 57CC16BA 7C1F612E + 909903CC 3BDE0001 + B3D903CA 3879039C + 389903AC 3D808013 + 398C4F0C 7D8803A6 + 4E800021 57DBE13F + 41820008 3B7EFFF0 + 7C1BF040 4080004C + 576316BA 7C1F182E + 1D6003E9 38000078 + 7D6B0396 380003E8 + 7CAB0396 1C0503E8 + 7CC05850 387903B0 + 389903C0 39990238 + 7D8803A6 4E800021 + 7FBDD214 3B7B0001 + B3B903B2 4BFFFFB4 + B39903B2 BB210008 + 38210030 00000000 + + + C22A63CC 00000003 + 3C60817F 3BA00004 + 93A303CC 3BA00000 + B3A303CA 00000000 + C21441C4 0000001B + 3821FFD0 BF210008 + 3F20817F AB9903B2 + 3BF903D0 A3D903CA + 7F9DE378 835903B4 + 80D900BC 28060000 + 41A2002C 809900B8 + 80B903CC 7C042800 + 40A1001C 7C052050 + 57CC16BA 7C1F612E + 909903CC 3BDE0001 + B3D903CA 3879039C + 389903AC 3D808014 + 398C0390 7D8803A6 + 4E800021 57DBE13F + 41820008 3B7EFFF0 + 7C1BF040 4080004C + 576316BA 7C1F182E + 1D6003E9 38000078 + 7D6B0396 380003E8 + 7CAB0396 1C0503E8 + 7CC05850 387903B0 + 389903C0 39990238 + 7D8803A6 4E800021 + 7FBDD214 3B7B0001 + B3B903B2 4BFFFFB4 + B39903B2 BB210008 + 38210030 00000000 + + diff --git a/changelog.md b/changelog.md index c535885..efc9433 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # Changelog ## Jan 31, 2023 +### Created 'Quarterframe Section Timer' +Calculate and display section times whenever Quarterframe Timer freezes + ### Updated 'Pattern Selector' - Rewrote with C2 + separated config 06 - Remove label option diff --git a/site/.vuepress/components/CodeInfo.vue b/site/.vuepress/components/CodeInfo.vue index 756d505..00c5124 100644 --- a/site/.vuepress/components/CodeInfo.vue +++ b/site/.vuepress/components/CodeInfo.vue @@ -38,10 +38,9 @@ export default { showPreview() { return [ 'PatternSelector', - 'PASDisplay', - 'SpeedDisplay', 'CustomizedDisplay', 'qft', + 'qfst', ].includes(this.code.id); // TODO }, }, diff --git a/site/.vuepress/components/Generator.vue b/site/.vuepress/components/Generator.vue index 29d5553..b695bea 100644 --- a/site/.vuepress/components/Generator.vue +++ b/site/.vuepress/components/Generator.vue @@ -113,6 +113,7 @@ import { translate } from '../i18n/localeHelper'; // Code Configs import {getConfig as getConfigQFT} from './codes/qft/codegen'; +import {getConfig as getConfigQFST} from './codes/qfst/codegen'; import {getConfig as getConfigCD} from './codes/CustomizedDisplay/codegen'; import {getConfig as getConfigPS} from './codes/PatternSelector/codegen'; @@ -163,6 +164,7 @@ export default { // update config for preview this.codeConfigs = { qft: getConfigQFT(), + qfst: getConfigQFST(), PatternSelector: getConfigPS(), CustomizedDisplay: getConfigCD(e), }; diff --git a/site/.vuepress/components/Preview.vue b/site/.vuepress/components/Preview.vue index 282f5e5..ecb800f 100644 --- a/site/.vuepress/components/Preview.vue +++ b/site/.vuepress/components/Preview.vue @@ -1,10 +1,11 @@ diff --git a/site/.vuepress/components/codes/codegen.js b/site/.vuepress/components/codes/codegen.js index f98a2e0..6f7fef6 100644 --- a/site/.vuepress/components/codes/codegen.js +++ b/site/.vuepress/components/codes/codegen.js @@ -1,11 +1,13 @@ import InstantRestart from './InstantRestart/codegen.js'; import qft from './qft/codegen.js'; +import qfst from './qfst/codegen.js'; import CustomizedDisplay from './CustomizedDisplay/codegen.js'; import PatternSelector from './PatternSelector/codegen.js'; export default { InstantRestart, qft, + qfst, CustomizedDisplay, PatternSelector, }; diff --git a/site/.vuepress/components/codes/labels.json b/site/.vuepress/components/codes/labels.json index 458b625..d76356d 100644 --- a/site/.vuepress/components/codes/labels.json +++ b/site/.vuepress/components/codes/labels.json @@ -1,5 +1,8 @@ { "ja-JP": { + "h3": { + "appearance": "見た目" + }, "location": "位置:", "fontSize": "文字サイズ:", "fgColor": "文字色:", @@ -15,6 +18,9 @@ "bottom": "下" }, "en-US": { + "h3": { + "appearance": "Appearance" + }, "location": "Location: ", "fontSize": "Font size: ", "fgColor": "Font color: ", diff --git a/site/.vuepress/components/codes/qfst/codegen.js b/site/.vuepress/components/codes/qfst/codegen.js new file mode 100644 index 0000000..4526a83 --- /dev/null +++ b/site/.vuepress/components/codes/qfst/codegen.js @@ -0,0 +1,66 @@ +import { parseJSON } from '../codegen.js'; +import { insts2hex, getDrawTextOpt, getFillRectParams } from '../asm'; +import { measureText } from '../text.js'; +export const lskey = 'config/qfst'; + +export const defaultConfig = { + x: 533, + y: 150, + fontSize: 13, + fgRGB: 0xffffff, + fgA: 0xff, + fgRGB2: null, + fgA2: null, + bgRGB: 0x000000, + bgA: 0x40, + bgLeft: 4, + bgRight: 3, + bgTop: 4, + bgBot: 2, +}; + +export const getPreviewText = () => ` 0.426 + 0.427 + 0.428 + 1.515 + 3.117 +39.000 + 9.999 +11.111 +22.222 +33.333 +44.444 +55.555 +66.666 +77.777 +88.888 +99.999`; + +/** @returns {typeof defaultConfig} */ +export function getConfig() { + const config = + (typeof localStorage !== 'undefined' && parseJSON(localStorage.getItem(lskey))) || {}; + return { + ...defaultConfig, + ...config, + text: getPreviewText(), + }; +} + +/** + * @param {keyof typeof import('../addrs.js').ctxSpOff} version + * @param {string=} baseCode + */ +export default function codegen(version, baseCode) { + if (!baseCode) return ''; + + const config = getConfig(); + + let code = baseCode; + code += '077F039C 0000002C'; + code += insts2hex(getFillRectParams(config, measureText(getPreviewText(), version))); + code += insts2hex(getDrawTextOpt(config)); + code += '2532642E 25303364 00000000'; // fmt = "%2d.%03d" + + return code.replace(/\s/g, ''); +} diff --git a/site/.vuepress/components/codes/qfst/config.vue b/site/.vuepress/components/codes/qfst/config.vue new file mode 100644 index 0000000..56d3d65 --- /dev/null +++ b/site/.vuepress/components/codes/qfst/config.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/site/.vuepress/components/codes/qft/config.vue b/site/.vuepress/components/codes/qft/config.vue index b1017c0..1c224bf 100644 --- a/site/.vuepress/components/codes/qft/config.vue +++ b/site/.vuepress/components/codes/qft/config.vue @@ -26,7 +26,7 @@