Added CAngle for 'Customized Display' to show camera angle

This commit is contained in:
sup39 2022-11-19 15:39:30 +09:00
parent c6fad5f383
commit 375ba5eb73
5 changed files with 65 additions and 42 deletions

View file

@ -3313,6 +3313,7 @@
|`HSpd`|Horizontal speed of Mario|float| |`HSpd`|Horizontal speed of Mario|float|
|`VSpd`|Vertical speed of Mario|float| |`VSpd`|Vertical speed of Mario|float|
|`QF`|QF offset|\{0,1,2,3}| |`QF`|QF offset|\{0,1,2,3}|
|`CAngle`|Camera Angle|uint16|
For float data, you can set the *format* to `.{digit}` to specify how many digits to show. For float data, you can set the *format* to `.{digit}` to specify how many digits to show.
@ -3339,6 +3340,7 @@
|`HSpd`|マリオの水平速度|float| |`HSpd`|マリオの水平速度|float|
|`VSpd`|マリオのY速度|float| |`VSpd`|マリオのY速度|float|
|`QF`|ずれたQFの数|\{0,1,2,3}| |`QF`|ずれたQFの数|\{0,1,2,3}|
|`CAngle`|カメラの角度|uint16|
float(小数)型に対して、「表示のフォーマット」を`.{桁数}`に設定して何桁まで表示するか指定できます。 float(小数)型に対して、「表示のフォーマット」を`.{桁数}`に設定して何桁まで表示するか指定できます。

View file

@ -1,4 +1,7 @@
# Changelog # Changelog
## Nov 19, 2022
Added `CAngle` for 'Customized Display' to show camera angle
## Nov 9, 2022 ## Nov 9, 2022
### Added 'Fast Piantissimo' ### Added 'Fast Piantissimo'
To make Piantissimo go as fast as he will in a level, you need to beat him with an in-game time under 25 seconds and grab his Shine. Or you could just use this code. To make Piantissimo go as fast as he will in a level, you need to beat him with an in-game time under 25 seconds and grab his Shine. Or you could just use this code.

View file

@ -1,41 +1,41 @@
{ {
"name": "gctgenerator", "name": "gctgenerator",
"version": "3.0.1", "version": "3.0.1",
"description": "Super Mario Sunshine Practice File Generator", "description": "Super Mario Sunshine Practice File Generator",
"main": "index.js", "main": "index.js",
"authors": { "authors": {
"name": "Matteias Collet", "name": "Matteias Collet",
"email": "matteias.collet@bluewin.ch" "email": "matteias.collet@bluewin.ch"
}, },
"repository": "https://github.com/BitPatty/gctGenerator/gctGenerator", "repository": "https://github.com/BitPatty/gctGenerator/gctGenerator",
"scripts": { "scripts": {
"dev": "npm run codes:inject && npm run translations:compare && vuepress dev site", "dev": "npm run codes:inject && npm run translations:compare && vuepress dev site",
"build": "node ./scripts/inject_codes.js && npm run translations:compare && vuepress build site", "build": "node ./scripts/inject_codes.js && npm run translations:compare && vuepress build site",
"format": "prettier --write ./site/**/*{.md,.js,.json}", "format": "prettier --write ./site/**/*{.md,.js,.json}",
"translations:compare": "node ./scripts/compare_translations.js", "translations:compare": "node ./scripts/compare_translations.js",
"codes:inject": "node ./scripts/inject_codes.js && npm run format", "codes:inject": "node ./scripts/inject_codes.js && npm run format",
"codes:clean": "node ./scripts/clean_codes.js && npm run format", "codes:clean": "node ./scripts/clean_codes.js && npm run format",
"precommit": "npm run codes:clean && git add .", "precommit": "npm run codes:clean && git add .",
"serve": "serve ./site/.vuepress/dist" "serve": "serve ./site/.vuepress/dist"
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"devDependencies": { "devDependencies": {
"@sup39/markdown-it-attr": "1.2.2", "@sup39/markdown-it-attr": "1.2.2",
"@sup39/markdown-it-inline-tag": "1.0.1", "@sup39/markdown-it-inline-tag": "1.0.1",
"@types/encoding-japanese": "^2.0.1", "@types/encoding-japanese": "^2.0.1",
"@vuepress/plugin-back-to-top": "1.9.7", "@vuepress/plugin-back-to-top": "1.9.7",
"@vuepress/plugin-medium-zoom": "1.9.7", "@vuepress/plugin-medium-zoom": "1.9.7",
"encoding-japanese": "^2.0.0", "encoding-japanese": "^2.0.0",
"jsdom": "20.0.2", "jsdom": "20.0.2",
"pre-commit": "1.2.2", "pre-commit": "1.2.2",
"prettier": "2.7.1", "prettier": "2.7.1",
"serve": "14.1.1", "serve": "14.1.1",
"vuepress": "1.9.7" "vuepress": "1.9.7"
}, },
"dependencies": { "dependencies": {
"vuedraggable": "2.24.3" "vuedraggable": "2.24.3"
}, },
"pre-commit": [ "pre-commit": [
"precommit" "precommit"
] ]
} }

View file

@ -70,6 +70,12 @@ const bases = {
GMSP01: (rT) => ASM.lwz(rT, 13, -0x6120), GMSP01: (rT) => ASM.lwz(rT, 13, -0x6120),
GMSJ0A: (rT) => ASM.lwz(rT, 13, -0x6188), GMSJ0A: (rT) => ASM.lwz(rT, 13, -0x6188),
}), }),
gpCamera: /**@type{VBase}*/ ({
GMSJ01: (rT) => ASM.lwz(rT, 13, -0x5750),
GMSE01: (rT) => ASM.lwz(rT, 13, -0x7118),
GMSP01: (rT) => ASM.lwz(rT, 13, -0x7158),
GMSJ0A: (rT) => ASM.lwz(rT, 13, -0x5768),
}),
}; };
/** @typedef {keyof typeof bases} BaseId */ /** @typedef {keyof typeof bases} BaseId */
@ -104,6 +110,15 @@ const fields = [
preview: 0, preview: 0,
post: (rT) => ASM.rlwinm(rT, rT, 0, 30, 31, false), post: (rT) => ASM.rlwinm(rT, rT, 0, 30, 31, false),
}, },
{
id: 'CAngle',
base: 'gpCamera',
dtype: 16,
offset: 0xa6,
fmt: '%hu',
preview: 9,
post: (rT) => ASM.addi(rT, rT, -0x8000), // offset by 0x8000
},
]; ];
const fieldDB = Object.fromEntries( const fieldDB = Object.fromEntries(
fields.map(({ id, base, fmt, preview, ...info }) => [ fields.map(({ id, base, fmt, preview, ...info }) => [

View file

@ -114,7 +114,10 @@ const makeInstXS = (op, op2) => (rA, rS, rB, Rc) => InstX(op, rA, rS, rB, op2, +
/** @type {(op: number) => InstM} */ /** @type {(op: number) => InstM} */
const makeInstM = (op) => (rA, rS, SH, MB, ME, Rc) => InstM(op, rA, rS, SH, MB, ME, +Rc); const makeInstM = (op) => (rA, rS, SH, MB, ME, Rc) => InstM(op, rA, rS, SH, MB, ME, +Rc);
/** @type {(op: number) => InstI} */ /** @type {(op: number) => InstI} */
const makeInstI = (op) => (LL, LK, AA = 0) => InstI(op, LL >> 2, +AA, +LK); const makeInstI =
(op) =>
(LL, LK, AA = 0) =>
InstI(op, LL >> 2, +AA, +LK);
export const ASM = { export const ASM = {
// store rT, rA, D // store rT, rA, D