metadata
+ PASDisplay
Position/angle/speed display
Position/Winkel/Geschw. Display
Affichage de position/angle/vitesse
@@ -3089,6 +3090,7 @@
metadata
+ SpeedDisplay
Speed display
Geschwindigkeits-Display
Affichage de vitesse
@@ -3277,6 +3279,163 @@
60000000 00000000
+
+ metadata
+ CustomizedDisplay
+ Customized display
+ カスタマイズ表示
+ sup39(サポミク)
+ 0.1
+ Oct 15, 2022
+ drawText
+
+ Shows metadata at any given time.
+
+ ::: warning
+ This code is not compatible with other Display codes.
+ :::
+
+ ::: warning
+ The preview is based on NTSC-J's font data, and may be inaccurate for NTSC-U and PAL.
+ In addition, some characters may not shown properly.
+ :::
+
+ #### Format
+ Use `< ID-of-the-data | format | value-shown-in-preview >` to display a metadata.
+
+ Supported data:
+ | ID |data|type|
+ |----|----|----|
+ |`x`|X coordinate of Mario|float|
+ |`y`|Y coordinate of Mario|float|
+ |`z`|Z coordinate of Mario|float|
+ |`angle`|Angle of Mario|uint16|
+ |`HSpd`|Horizontal speed of Mario|float|
+ |`VSpd`|Vertical speed of Mario|float|
+ |`QF`|QF offset|\{0,1,2,3}|
+
+ For float data, you can set the *format* to `.{digit}` to specify how many digits to show.
+
+ %details[
+ %summary[All printable characters (for NTSC-J)]
+ ![Printable charaters](/img/preview/font-jp.png){style="background:black"}
+ ]
+
+ #### Preview
+
+
+ 指定した情報を表示します。
+
+ #### フォーマット
+ ゲーム内の情報を表示するために、`< 情報のID | 表示のフォーマット | プレビューで表示する値 >`を使います。
+
+ 表示可能の情報一覧:
+ |情報のID|情報|型|
+ |----|----|----|
+ |`x`|マリオのX座標|float|
+ |`y`|マリオのY座標|float|
+ |`z`|マリオのZ座標|float|
+ |`angle`|マリオの角度|uint16|
+ |`HSpd`|マリオの水平速度|float|
+ |`VSpd`|マリオのY速度|float|
+ |`QF`|ずれたQFの数|\{0,1,2,3}|
+
+ float(小数)型に対して、「表示のフォーマット」を`.{桁数}`に設定して何桁まで表示するか指定できます。
+
+ また、全てのひらがなとカタカナ及び一部の漢字の表示も可能です。
+
+ %details[
+ %summary[表示可能な文字一覧:]
+ ![表示可能な文字一覧](/img/preview/font-jp.png){style="background:black"}
+ ]
+
+ #### プレビュー
+
+
+
+
+
+
qol
standard,recommended,il
@@ -3671,6 +3830,7 @@
qol
+ PatternSelector
Pattern Selector
パターン選択
sup39(サポミク)
@@ -3678,8 +3838,6 @@
Apr 25, 2022
drawText
- ![Preview](/img/PatternSelector/preview.jpg)
-
Ⓑ is the cursor to select the pattern,
and the three digits are the numbers representing the pattern.
See below for more information.
@@ -3718,8 +3876,6 @@
%object[]{data="/img/PatternSelector/PV1-3.svg"}
- ![プレビュー](/img/PatternSelector/preview.jpg)
-
Ⓑはパターンを選択するためのカーソルであり、三つの数字はパターンの番号を表します。
各パターンの番号は下記を参照してください。
@@ -4054,6 +4210,80 @@
7C0803A6 4E800020
00000000 59800004
+
+
InstantRestart
diff --git a/Readme.md b/Readme.md
index 8a278da..f6ec0b0 100644
--- a/Readme.md
+++ b/Readme.md
@@ -23,6 +23,19 @@ The codes are stored in the `Codes.xml` file. If you want to add or change codes
When adding new codes keep in mind that the English title/description are mandatory.
+#### Codes with configuration
+Codes with configuration are usually defined as vue components,
+which is defined in [site/.vuepress/components/codes/](site/.vuepress/components/codes/).
+When creating/updating those codes,
+in addition to editing the `Codes.xml` file,
+you may also need to check the following files:
+- [site/.vuepress/components/codes/codegen.js](site/.vuepress/components/codes/codegen.js):
+ Specify the Gecko code generator function of the code.
+ The version string will be passed as the first argument.
+- [site/.vuepress/components/codes/ui.js](site/.vuepress/components/codes/ui.js):
+ Specify the vue component for the configuration of the code.
+ The version string will be passed as a property.
+
#### Reserved Memory
Some codes store some states in the games memory starting from address 0x817F0000. To avoid collisions use a memory range in the unallocated ranges:
diff --git a/changelog.md b/changelog.md
index e3abbc1..4581ec9 100644
--- a/changelog.md
+++ b/changelog.md
@@ -2,6 +2,11 @@
## Oct 16, 2022
\[QFT v1.2] Fix QFT background when 112\*fontSize is not an integer
+## Oct 15, 2022
+- Add preview for selected codes (for NTSC-J)
+- Add CustomizedDisplay
+- Add instructions to create/update codes with configuration in Readme.md
+
## Jun 8, 2022
### Fixed 'Shine Get Timer' stopping on any cutscene started after touching a Shine
Shoutouts to plankton for touching the Pinna 1 Shine before its spawn cutscene started, in which case the timer would stop around 8 seconds early.
diff --git a/package-lock.json b/package-lock.json
index c3d20a5..33384f9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,6 +9,8 @@
"version": "3.0.1",
"license": "Apache-2.0",
"dependencies": {
+ "@types/encoding-japanese": "^2.0.1",
+ "encoding-japanese": "^2.0.0",
"vuedraggable": "2.24.3"
},
"devDependencies": {
@@ -1869,6 +1871,11 @@
"@types/node": "*"
}
},
+ "node_modules/@types/encoding-japanese": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@types/encoding-japanese/-/encoding-japanese-2.0.1.tgz",
+ "integrity": "sha512-JaCXs2HLniKY8xXeWlg8MAtd4iKhNh8LwutW3yDMWY4usEdTZ2va1x9kd8V3179OAIUTgGQVA63XJrHettpVFQ=="
+ },
"node_modules/@types/express": {
"version": "4.17.13",
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz",
@@ -3748,6 +3755,18 @@
"ms": "2.0.0"
}
},
+ "node_modules/body-parser/node_modules/iconv-lite": {
+ "version": "0.4.24",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "dev": true,
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/body-parser/node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -6572,6 +6591,14 @@
"node": ">= 0.8"
}
},
+ "node_modules/encoding-japanese": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encoding-japanese/-/encoding-japanese-2.0.0.tgz",
+ "integrity": "sha512-++P0RhebUC8MJAwJOsT93dT+5oc5oPImp1HubZpAuCZ5kTLnhuuBhKHj2jJeO/Gj93idPBWmIuQ9QWMe5rX3pQ==",
+ "engines": {
+ "node": ">=8.10.0"
+ }
+ },
"node_modules/end-of-stream": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
@@ -8899,12 +8926,12 @@
}
},
"node_modules/iconv-lite": {
- "version": "0.4.24",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
- "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
"dev": true,
"dependencies": {
- "safer-buffer": ">= 2.1.2 < 3"
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
},
"engines": {
"node": ">=0.10.0"
@@ -12582,6 +12609,18 @@
"node": ">= 0.8"
}
},
+ "node_modules/raw-body/node_modules/iconv-lite": {
+ "version": "0.4.24",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "dev": true,
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/rc": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
@@ -17198,18 +17237,6 @@
"node": ">=12"
}
},
- "node_modules/whatwg-encoding/node_modules/iconv-lite": {
- "version": "0.6.3",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
- "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
- "dev": true,
- "dependencies": {
- "safer-buffer": ">= 2.1.2 < 3.0.0"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/whatwg-mimetype": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz",
@@ -18850,6 +18877,11 @@
"@types/node": "*"
}
},
+ "@types/encoding-japanese": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@types/encoding-japanese/-/encoding-japanese-2.0.1.tgz",
+ "integrity": "sha512-JaCXs2HLniKY8xXeWlg8MAtd4iKhNh8LwutW3yDMWY4usEdTZ2va1x9kd8V3179OAIUTgGQVA63XJrHettpVFQ=="
+ },
"@types/express": {
"version": "4.17.13",
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz",
@@ -20451,6 +20483,15 @@
"ms": "2.0.0"
}
},
+ "iconv-lite": {
+ "version": "0.4.24",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "dev": true,
+ "requires": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ }
+ },
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -22759,6 +22800,11 @@
"integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
"dev": true
},
+ "encoding-japanese": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encoding-japanese/-/encoding-japanese-2.0.0.tgz",
+ "integrity": "sha512-++P0RhebUC8MJAwJOsT93dT+5oc5oPImp1HubZpAuCZ5kTLnhuuBhKHj2jJeO/Gj93idPBWmIuQ9QWMe5rX3pQ=="
+ },
"end-of-stream": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
@@ -24528,12 +24574,12 @@
"dev": true
},
"iconv-lite": {
- "version": "0.4.24",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
- "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
"dev": true,
"requires": {
- "safer-buffer": ">= 2.1.2 < 3"
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
}
},
"icss-replace-symbols": {
@@ -27491,6 +27537,15 @@
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
"dev": true
+ },
+ "iconv-lite": {
+ "version": "0.4.24",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "dev": true,
+ "requires": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ }
}
}
},
@@ -31223,17 +31278,6 @@
"dev": true,
"requires": {
"iconv-lite": "0.6.3"
- },
- "dependencies": {
- "iconv-lite": {
- "version": "0.6.3",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
- "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
- "dev": true,
- "requires": {
- "safer-buffer": ">= 2.1.2 < 3.0.0"
- }
- }
}
},
"whatwg-mimetype": {
diff --git a/package.json b/package.json
index 29633dc..e0114ca 100644
--- a/package.json
+++ b/package.json
@@ -22,8 +22,10 @@
"devDependencies": {
"@sup39/markdown-it-attr": "1.2.2",
"@sup39/markdown-it-inline-tag": "1.0.1",
+ "@types/encoding-japanese": "^2.0.1",
"@vuepress/plugin-back-to-top": "1.9.7",
"@vuepress/plugin-medium-zoom": "1.9.7",
+ "encoding-japanese": "^2.0.0",
"jsdom": "20.0.0",
"pre-commit": "1.2.2",
"prettier": "2.7.1",
diff --git a/site/.vuepress/components/CodeInfo.vue b/site/.vuepress/components/CodeInfo.vue
index ab51b7b..756d505 100644
--- a/site/.vuepress/components/CodeInfo.vue
+++ b/site/.vuepress/components/CodeInfo.vue
@@ -10,9 +10,10 @@
>
{{ getLabel('codeinfo.author') }} {{ translatedCode.author }}
+
+ :previewConfig="previewConfig" @config="$emit('config', {[code.id]: $event})" />
@@ -25,7 +26,7 @@ export default {
anchor: { type: Boolean },
code: { type: Object },
version: { type: String },
- codeConfigs: { type: Object },
+ previewConfig: { type: Object },
},
computed: {
translatedCode: function () {
@@ -34,6 +35,15 @@ export default {
configUI: function () {
return configUIs[this.code.id];
},
+ showPreview() {
+ return [
+ 'PatternSelector',
+ 'PASDisplay',
+ 'SpeedDisplay',
+ 'CustomizedDisplay',
+ 'qft',
+ ].includes(this.code.id); // TODO
+ },
},
data() {
return {};
diff --git a/site/.vuepress/components/DownloadButton.vue b/site/.vuepress/components/DownloadButton.vue
index c649946..36e1a08 100644
--- a/site/.vuepress/components/DownloadButton.vue
+++ b/site/.vuepress/components/DownloadButton.vue
@@ -72,7 +72,7 @@ export default {
// generate file
const codeSize = c.reduce((a, e) => a+e.source.length, 0)/2 + 16; // 8(00D0)+8(F000)
- console.log(codeSize, c);
+ // console.log(codeSize, c);
switch (this.format) {
case 'gct':
this.alertGCTCodeSize(codeSize);
diff --git a/site/.vuepress/components/Generator.vue b/site/.vuepress/components/Generator.vue
index af283c6..f192cc7 100644
--- a/site/.vuepress/components/Generator.vue
+++ b/site/.vuepress/components/Generator.vue
@@ -43,7 +43,7 @@
{{ getLabel('headers.help') }}
+ :previewConfig="previewConfig" @config="onCodeConfigChanged" />
{{ getLabel('headers.stageloader') }}
@@ -106,12 +106,14 @@
diff --git a/site/.vuepress/components/codes/CustomizedDisplay/labels.json b/site/.vuepress/components/codes/CustomizedDisplay/labels.json
new file mode 100644
index 0000000..35c2726
--- /dev/null
+++ b/site/.vuepress/components/codes/CustomizedDisplay/labels.json
@@ -0,0 +1,8 @@
+{
+ "ja-JP": {
+ "format": "フォーマット:"
+ },
+ "en-US": {
+ "format": "Format:"
+ }
+}
diff --git a/site/.vuepress/components/codes/TextConfig.vue b/site/.vuepress/components/codes/TextConfig.vue
new file mode 100644
index 0000000..c420645
--- /dev/null
+++ b/site/.vuepress/components/codes/TextConfig.vue
@@ -0,0 +1,90 @@
+
+
+
+ {{l.location}}(, )
+
+
+ {{l.fontSize}}
+
+
+ {{fgRGB2==null ? l.fgColor : l.fgColor1}}
+ {{l.alpha}}/255={{(fgA/2.55).toFixed(1)}}%
+ {{l.fgColorGrad}}
+
+
+ {{l.fgColor2}}
+ {{l.alpha}}/255={{(fgA2/2.55).toFixed(1)}}%
+
+
+
+
+
+
+
diff --git a/site/.vuepress/components/codes/codegen.js b/site/.vuepress/components/codes/codegen.js
index ca5c83e..9aec920 100644
--- a/site/.vuepress/components/codes/codegen.js
+++ b/site/.vuepress/components/codes/codegen.js
@@ -1,9 +1,11 @@
import InstantRestart from './InstantRestart/codegen.js';
import qft from './qft/codegen.js';
+import CustomizedDisplay from './CustomizedDisplay/codegen.js';
export default {
InstantRestart,
qft,
+ CustomizedDisplay,
};
/**
diff --git a/site/.vuepress/components/codes/labels.json b/site/.vuepress/components/codes/labels.json
new file mode 100644
index 0000000..7ea4e0b
--- /dev/null
+++ b/site/.vuepress/components/codes/labels.json
@@ -0,0 +1,20 @@
+{
+ "ja-JP": {
+ "location": "位置:",
+ "fontSize": "文字サイズ:",
+ "fgColor": "文字色:",
+ "fgColorGrad": "グラデーション",
+ "fgColor1": "文字色(上):",
+ "fgColor2": "文字色(下):",
+ "alpha": "不透明度="
+ },
+ "en-US": {
+ "location": "Location: ",
+ "fontSize": "Font size: ",
+ "fgColor": "Font color: ",
+ "fgColorGrad": "Gradient",
+ "fgColor1": "Font color(Top): ",
+ "fgColor2": "Font color(Bottom): ",
+ "alpha": "Alpha="
+ }
+}
diff --git a/site/.vuepress/components/codes/qft/config.vue b/site/.vuepress/components/codes/qft/config.vue
index 88577a0..958969e 100644
--- a/site/.vuepress/components/codes/qft/config.vue
+++ b/site/.vuepress/components/codes/qft/config.vue
@@ -3,27 +3,12 @@
{{l.h3}}
- {{l.location}}(, )
-
-
- {{l.fontSize}}
-
-
- {{fgRGB2==null ? l.fgColor : l.fgColor1}}
- {{l.alpha}}/255={{(fgA/2.55).toFixed(1)}}%
- {{l.fgColorGrad}}
-
-
- {{l.fgColor2}}
- {{l.alpha}}/255={{(fgA2/2.55).toFixed(1)}}%
+
{{l.bgColor}}
{{l.alpha}}/255={{(bgA/2.55).toFixed(1)}}%
- {{l.preview}}
-
- {{l.previewNote}}
{{l.freeze.h3}}
@@ -44,9 +29,10 @@