Port GMSJ01 only code to GMSJ0A

- Pattern Selector, Instant Restart, drawText
- QFT, PAS/Speed display with drawText
This commit is contained in:
sup39 2022-04-25 21:28:43 +09:00
parent e77ce9152c
commit a2bd1c036c
7 changed files with 313 additions and 235 deletions

401
Codes.xml
View file

@ -1244,6 +1244,7 @@
<version>1.1</version>
<date>Apr 22, 2022</date>
<dependencies version="GMSJ01">drawText</dependencies>
<dependencies version="GMSJ0A">drawText</dependencies>
<description lang="en-US">
Adds an in-game timer to every level, starting on the last black frame after the
loading screen and ending as soon as the 'Shine Get' animation starts
@ -2872,6 +2873,7 @@
<version>1.4</version>
<date>Mar 24, 2022</date>
<dependencies version="GMSJ01">drawText</dependencies>
<dependencies version="GMSJ0A">drawText</dependencies>
<description lang="en-US">
Shows Mario's position, angle and speed at any given time.
@ -2989,57 +2991,23 @@
252E3266 00000000
</source>
<source version="GMSJ0A">
06285FBC 00000010
495740BD 60000000
60000000 60000000
04279568 49580A99
041252A0 496D4E7D
077FA000 000001E8
9421FFE0 7C0802A6
90010024 93E1001C
4AA9CEF5 38E00200
38C00320 38A0FFD8
3880000A 38610008
4AAAF9C9 814D9E88
3FE08180 3BFFA1EC
39200000 39000002
3CE08180 38E7A164
80CA0048 38A10008
38800000 7FE3FB78
4AAB6001 39200001
913F01B0 80010024
7C0803A6 83E1001C
38210020 4E800020
9421FFE8 7C0802A6
9001001C 93A1000C
93C10010 93E10014
7C7F1B78 81230000
83A90064 3D208180
8129A39C 2F890000
409E002C 7FE3FB78
7FA903A6 4E800421
8001001C 7C0803A6
83A1000C 83C10010
83E10014 38210018
4E800020 3D20803F
6129EF88 83C90000
3C608180 3863A1EC
4AAB6389 C0BE00A8
C09E00B0 A0DE0096
C07E0018 C05E0014
C03E0010 3CA08180
38A5A164 38800080
4CC63242 4AB1EF91
4BFFFF94 9421FFF0
7C0802A6 90010014
93E1000C 7C7F1B78
4AAD0D9D 38E00081
7FE6FB78 38A00000
38800000 3C608180
3863A1EC 4AAB546D
80010014 7C0803A6
83E1000C 38210010
4E800020 5820506F
041252A0 496D4D61
077FA000 000000B5
9421FFF0 7C0802A6
90010014 93E1000C
7C7F1B78 4AAD0EB9
3D208040 8149EF88
3D008180 38600010
3908A074 C0AA00A8
38E0FFFF C08A00B0
38C0FFFF A12A0096
38A00014 C06A0018
388000C8 C04A0014
C02A0010 4CC63242
4BFF61E1 80010014
7FE3FB78 83E1000C
7C0803A6 38210010
4AAD0E5C 5820506F
7320252E 30660A59
20506F73 20252E30
660A5A20 506F7320
@ -3047,19 +3015,7 @@
6C652025 68750A48
20537064 20252E32
660A5620 53706420
252E3266 20202020
20202020 20202020
20202020 20202020
20202020 20202020
20202020 20202020
20202020 20202020
20202020 20202020
20202020 20202020
20202000 00000000
C2286550 00000003
38600000 3D808180
906CA39C 807F0040
60000000 00000000
252E326600000000
</source>
<source version="GMSP01">
0629E070 00000010
@ -3145,6 +3101,7 @@
<version>1.5</version>
<date>Mar 24, 2022</date>
<dependencies version="GMSJ01">drawText</dependencies>
<dependencies version="GMSJ0A">drawText</dependencies>
<description lang="en-US">
Shows Mario's speed at any given time.
@ -3224,7 +3181,7 @@
</source>
<source version="GMSJ01">
04206734 495F38CD
077FA000 0000007C
077FA000 0000007A
9421FFF0 7C0802A6
90010014 93E1000C
7C7F1B78 4A83B215
@ -3243,65 +3200,24 @@
66000000 00000000
</source>
<source version="GMSJ0A">
06285FBC 00000010
495740BD 60000000
60000000 60000000
04279568 49580A99
041252A0 496D4E6D
077FA000 00000188
9421FFE0 7C0802A6
90010024 93E1001C
4AA9CEF5 38E00200
38C00320 38A0FFD8
3880000A 38610008
4AAAF9C9 814D9E88
3FE08180 3BFFA214
39200000 39000002
3CE08180 38E7A154
80CA0048 38A10008
38800000 7FE3FB78
4AAB6001 39200001
913F01B0 80010024
7C0803A6 83E1001C
38210020 4E800020
9421FFE8 7C0802A6
9001001C 93C10010
93E10014 7C7F1B78
81230000 83C90064
3D208180 8129A3C4
2C090000 40820028
7FE3FB78 7FC903A6
4E800421 8001001C
7C0803A6 83C10010
83E10014 38210018
4E800020 93A1000C
3D20803F 6129EF88
83A90000 3C608180
3863A214 4AAB638D
C05D00A8 C03D00B0
3CA08180 38A5A154
38800030 4CC63242
4AB1EFA5 83A1000C
4BFFFFA0 9421FFF0
7C0802A6 90010014
93E1000C 7C7F1B78
4AAE0DAD 38E00081
7FE6FB78 38A00000
38800000 3C608180
3863A214 4AAB547D
80010014 7C0803A6
83E1000C 38210010
4E800020 48205370
041252A0 496D4D61
077FA000 0000007A
9421FFF0 7C0802A6
90010014 93E1000C
7C7F1B78 4AAD0EB9
3D208040 8129EF88
3D008180 38600010
3908A064 C04900A8
38E0FFFF C02900B0
38C0FFFF 38A00014
388000F0 4CC63242
4BFF61F1 80010014
7FE3FB78 83E1000C
7C0803A6 38210010
4AAD0E6C 48205370
6420252E 32660A56
20537064 20252E32
66202020 20202020
20202020 20202020
20202020 20202020
20202000 00000000
C2286550 00000003
38600000 3D808180
906CA3C4 807F0040
60000000 00000000
66000000 00000000
</source>
<source version="GMSP01">
0629E070 00000010
@ -3762,8 +3678,8 @@
<title lang="en-US">Pattern Selector</title>
<title lang="ja-JP">パターン選択</title>
<author>sup39(サポミク)</author>
<version>0.2.1</version>
<date>Apr 21, 2022</date>
<version>0.2.2</version>
<date>Apr 25, 2022</date>
<dependencies>drawText</dependencies>
<description lang="en-US">
![Preview](/img/PatternSelector/preview.jpg)
@ -3844,20 +3760,21 @@
%object[]{data="/img/PatternSelector/PV1-3.svg"}
</description>
<source version="GMSJ01">
0424F324 7FE6FB78
0420675C 495F2A59
0424F32C 495A9D6D
077F9000 000002CA
077F9000 000002C5
3D208040 A1290D50
7C091800 4CA20020
3D008180 394892CC
A10892CC 7D294079
3D008180 394892C8
A10892C8 7D294079
4D820020 892A0002
7C892214 548407BE
988A0002 4E800020
3D208040 A1490D50
7C0A1800 4CA20020
3D008180 392892CC
A10892CC 7D4A4079
3D008180 392892C8
A10892C8 7D4A4079
4D820020 89490002
2C0A0003 40A2000C
39400000 99490002
@ -3873,26 +3790,26 @@
4182005C 28090032
41820034 28090030
40A20044 2C040021
3D208180 890992D1
3D208180 890992CD
418200C4 2C040026
418200C4 2C04001D
40A20024 39200004
48000068 2C04001D
3D208180 890992D0
3D208180 890992CC
4182008C 2C040021
4182008C 38C0FFFF
4AA67114 2C040002
3D208180 890992D2
3D208180 890992CE
4182008C 2C040008
40A2FFE4 39200005
48000028 3D20803E
3929A9C0 7C0A4800
4082FFCC 2C05FFFF
4082FFC4 3D208180
890992D0 39200007
890992CC 39200007
2C080000 41A2FFB0
3D408180 5529103A
394A92A9 7D2A4A14
394A92A5 7D2A4A14
7D294214 8929FFFF
7D290774 2C09FFFF
41A2FF8C 7D234B78
@ -3911,33 +3828,126 @@
38800001 38600048
4BFFFE49 38800004
38600044 4BFFFE3D
395E92CC 892A0002
3D008180 88CA0006
3908928C 21290003
38600010 90C10014
7CE84A14 38A00014
38800140 88C70002
90C10010 88CA0005
90C1000C 38C0FFFF
88E70001 90E10008
38E0FFFF 7D2848AE
3D008180 894A0004
39089294 4CC63182
4BFF6FD9 3D208040
A1290D50 7FE3FB78
80010024 B13E92CC
83E1001C 7C0803A6
83C10018 38210020
4A83BFA0 20202023
20200000 50617474
65726E20 25632558
391E92C8 89480002
3D202320 61292020
38600010 214A0003
38E0FFFF 554A1838
38C0FFFF 5D29503E
89480006 38A00014
38800140 91410014
552A063E 91410010
89480005 9141000C
552AC63E 91410008
5529863E 89480004
3D008180 39089290
4CC63182 4BFF6FD5
3D208040 A1290D50
7FE3FB78 80010024
B13E92C8 83E1001C
7C0803A6 83C10018
38210020 4A83BF9C
50617474 65726E20
25632558 25632558
00452020 FFFF621C
FF502525 25FF4520
20FFFF62 1C510707
FFFF3601 FF1E6E20
FF000000 00000000
0424f324 7FE6FB78
25632558 00452020
FFFF621C FF502525
25FF4520 20FFFF62
1C510707 FFFF3601
FF1E6E20 FF000000
</source>
<source version="GMSJ0A">
040278F8 7FE6FB78
041252C8 496D3EED
04027900 497D1799
077F9000 000002C5
3D20803F A1295428
7C091800 4CA20020
3D008180 394892C8
A10892C8 7D294079
4D820020 892A0002
7C892214 548407BE
988A0002 4E800020
3D20803F A1495428
7C0A1800 4CA20020
3D008180 392892C8
A10892C8 7D4A4079
4D820020 89490002
2C0A0003 40A2000C
39400000 99490002
89490002 7D295214
89490004 7D4A2214
38800005 7C8A23D6
1C840005 7C845050
98890004 4E800020
81460000 3D20803A
39294B80 7C0A4800
40A2008C 81260004
89290013 28090031
4182005C 28090032
41820034 28090030
40A20044 2C040021
3D208180 890992CD
418200C4 2C040026
418200C4 2C04001D
40A20024 39200004
48000068 2C04001D
3D208180 890992CC
4182008C 2C040021
4182008C 38C0FFFF
4A83F574 2C040002
3D208180 890992CE
4182008C 2C040008
40A2FFE4 39200005
48000028 3D20803A
39296D70 7C0A4800
4082FFCC 2C05FFFF
4082FFC4 3D208180
890992CC 39200007
2C080000 41A2FFB0
3D408180 5529103A
394A92A5 7D2A4A14
7D294214 8929FFFF
7D290774 2C09FFFF
41A2FF8C 7D234B78
4E800020 39200001
4BFFFFC8 39200000
4BFFFFC0 39200003
4BFFFFB8 39200002
4BFFFFB0 39200006
4BFFFFA8 9421FFE0
7C0802A6 90010024
BFC10018 7C7F1B78
4AAD1D05 38800001
38600042 3FC08180
4BFFFE29 38800003
38600041 4BFFFE1D
38800001 38600048
4BFFFE49 38800004
38600044 4BFFFE3D
391E92C8 89480002
3D202320 61292020
38600010 214A0003
38E0FFFF 554A1838
38C0FFFF 5D29503E
89480006 38A00014
38800140 91410014
552A063E 91410010
89480005 9141000C
552AC63E 91410008
5529863E 89480004
3D008180 39089290
4CC63182 4BFF6FD5
3D20803F A1295428
7FE3FB78 80010024
B13E92C8 83E1001C
7C0803A6 83C10018
38210020 4AAD1C40
50617474 65726E20
25632558 25632558
25632558 00452020
FFFF621C FF502525
25FF4520 20FFFF62
1C510707 FFFF3601
FF1E6E20 FF000000
</source>
</code>
<code>
@ -4011,6 +4021,43 @@
7C0803A6 4E800020
00000000 59800004
</source>
<source version="GMSJ0A">
077F0238 00000110
9421FED8 7C0802A6
BF810118 7C7F1B78
9001012C 7C9E2378
90C100B8 7CBD2B78
90E100BC 7D1C4378
912100C0 914100C4
40860024 D82100C8
D84100D0 D86100D8
D88100E0 D8A100E8
D8C100F0 D8E100F8
D9010100 39200600
390100BC B12100A0
39210130 912100A4
392100A8 912100A8
808D9E88 38E100B8
7FA6EB78 38A00000
38610008 6FDE8000
4AABD249 3D204330
91210108 3D40817F
93C1010C 6FFF8000
C00A0344 38610070
C9810108 91210110
3D20817F 93E10114
FC4C0028 C0690340
C9810110 93A10064
FC2C0028 93A10060
4AB393C9 38800000
38610070 4AB523F9
38C100A0 7F85E378
388000FF 38610008
4AABD0A5 BB810118
38210128 80010004
7C0803A6 4E800020
00000000 59800004
</source>
</code>
<code>
<id>InstantRestart</id>
@ -4018,8 +4065,8 @@
<title lang="en-US">Instant Restart</title>
<title lang="ja-JP">ポーズせずにやり直し</title>
<author>sup39(サポミク)</author>
<version>0.1.3</version>
<date>Jan 07, 2022</date>
<version>0.1.4</version>
<date>Apr 25, 2022</date>
<description lang="en-US">
When you pressed the buttons configured in [#Button Config](#config) simultaneously,
you can restart the current area without selecting "Exit Area" in pause menu.
@ -4040,15 +4087,27 @@
:::
</description>
<source version="GMSJ01">
c20eafa0 00000009
3c608040 a0a30d50
28050801 40a20030
3c60817f 38a00001
98a300b3 98a30100
3c60803e 80a3600e
90a36012 3c60800e
6063b3f8 7c6803a6
4e800020 2c000002
C20EAFA0 00000009
3C608040 A0A30D50
28050808 40A20030
3C60817F 38A00001
98A300B3 98A30100
3C60803E 84A3600E
90A30004 3C60800E
6063B3F8 7C6803A6
4E800020 2C000002
60000000 00000000
</source>
<source version="GMSJ0A">
C227768C 00000009
3C60803F A0A35428
28050808 40A20030
3C60817F 38A00001
98A300B3 98A30100
3C60803E 84A3A8EE
90A30004 3C608027
60637AE4 7C6803A6
4E800020 2C000002
60000000 00000000
</source>
</code>

View file

@ -1,4 +1,9 @@
# Changelog
## Apr 25, 2022
### Port the following code from GMSJ01 to GMSJ0A
- Pattern Selector, Instant Restart, drawText
- QFT, PAS/Speed display with drawText
## Apr 23, 2022
### Add code size warning
- Alert message `generatorconfig.alert.gct` when code size > 5000 bytes and download format is `GCT`

View file

@ -15,8 +15,39 @@ export const buttonValues = {
DL: 0x0001,
};
const baseCodes = {
GMSJ01: (b) => `
C20EAFA0 00000009
3C608040 A0A30D50
2805${b} 40A20030
3C60817F 38A00001
98A300B3 98A30100
3C60803E 84A3600E
90A30004 3C60800E
6063B3F8 7C6803A6
4E800020 2C000002
60000000 00000000
`,
GMSJ0A: (b) => `
C227768C 00000009
3C60803F A0A35428
2805${b} 40A20030
3C60817F 38A00001
98A300B3 98A30100
3C60803E 84A3A8EE
90A30004 3C608027
60637AE4 7C6803A6
4E800020 2C000002
60000000 00000000
`,
};
const zCodes = {
GMSJ01: '040eb024 60000000',
GMSJ0A: '04277710 60000000',
};
export const defaultConfig = {
button: buttonValues.Y | buttonValues.DL,
button: buttonValues.Y | buttonValues.DU,
};
export function getConfig() {
return {
@ -26,27 +57,11 @@ export function getConfig() {
}
export default function codegen(version) {
const { button } = getConfig();
let code;
switch (version) {
case 'GMSJ01':
code = `
c20eafa0 00000009
3c608040 a0a30d50
2805${button.toString(16).padStart(4, '0')} 40a20030
3c60817f 38a00001
98a300b3 98a30100
3c60803e 80a3600e
90a36012 3c60800e
6063b3f8 7c6803a6
4e800020 2c000002
60000000 00000000
`;
const g = baseCodes[version];
if (g == null) return '';
let code = g(button.toString(16).padStart(4, '0'));
if (button & buttonValues.Z) {
code += '\n040eb024 60000000';
}
break;
default:
return '';
code += zCodes[version];
}
return code.replace(/\s/g, '');
}

View file

@ -9,7 +9,7 @@ export const freezeCodeInfo = {
blueCoin: { addr: 0x80196128, orig: 0x7c030378 },
item: { addr: 0x801971f8, orig: 0x8001001c },
talk: { addr: 0x800eb6e4, orig: 0x807f00b0 },
demo: { addr: 0x800eb74c, orig: 0x806da8b0 },
demo: { addr: 0x800eb760, orig: 0x88e7013c },
cleaned: { addr: 0x8017a3c0, orig: 0x80010044 },
bowser: { addr: 0x801d3c78, orig: 0x2c1d0003 },
};

View file

@ -4,49 +4,53 @@ export const r13off = -0x6188;
* @type {{[key: string]: {addr: number, orig: number}}}
*/
export const freezeCodeInfo = {
yellowCoin: { addr: 0x8019ea3c, orig: 0x8805000e },
redCoin: { addr: 0x8019e1fc, orig: 0x38a00000 },
blueCoin: { addr: 0x8019e010, orig: 0x7c030378 },
item: { addr: 0x8019f13c, orig: 0x8001001c },
talk: { addr: 0x80277dd0, orig: 0x807f00b0 },
demo: { addr: 0x80277e4c, orig: 0x88e7013c },
cleaned: { addr: 0x801f5af8, orig: 0x80010044 },
bowser: { addr: 0x801dbe48, orig: 0x2c1d0003 },
};
export const baseCode = `
C2279570 0000000B
C2279570 00000005
981A0260 3CE0817F
880700B3 2C000000
38000000 900700BC
4182000C B00700B2
900700B4 60E30110
38800000 60E50094
80CD9E88 80C60048
60E700A4 39000002
39200000 3D80802B
618C0058 7D8803A6
4E800021 00000000
C21252A4 0000001B
3C60817F 888300B2
810300B4 2C040000
40A20030 808300BC
2C040000 40A20010
810D9E78 8108005C
48000010 3884FFFF
908300BC 810300B8
800300B4 7D080214
3CE0000A 60E7F9B0
7C074000 40A00010
7CE83B78 98E300B2
90E300B4 1D0803E9
900700B4 00000000
C21252A4 0000001F
3C60817F 6064011C
38630094 3D808012
398C1660 7D8803A6
4E800021 3C60817F
888300B2 810300B4
2C040000 40820030
808300BC 2C040000
40820010 810D9E78
8108005C 48000010
3884FFFF 908300BC
810300B8 800300B4
7D080214 3CE0000A
60E7F9B0 7C074000
40800010 7CE83B78
98E300B2 90E300B4
3C60817F 1D0803E9
38000078 7D080396
380003E8 7CE80396
7C0701D6 7D004050
3800003C 7CC70396
7C0601D6 7CE03850
38A300A4 3880000F
80630210 4CC63182
3D808031 618C90A4
7D8803A6 4E800021
3C60817F 60630110
38800000 38A00000
38C10BEC 38E00081
3D80802A 618CF5B8
9421FFF0 380003E8
7CE80396 7C0701D6
7D004050 91010008
3800003C 7D270396
7C0901D6 7D403850
80E30118 390300A4
80C30114 3D80817F
80A30110 618C0238
808300A0 7D8803A6
80630094 4E800021
38210010 38610E90
3D80802D 398CAECC
7D8803A6 4E800021
881F0046 00000000
C227C214 00000005
@ -85,9 +89,4 @@ C227A01C 00000005
5400003A 900500B8
3800FFFF 900500BC
60000000 00000000
077F0094 0000001D
00000010 000001A0
00000280 000001E0
25753A25 3032752E
25303375 00000000
`;

View file

@ -163,8 +163,8 @@ export default function codegen(version) {
code += [...code04, ...code07].map(int32).join('');
}
// ui (GMSJ01 only)
if (['GMSJ01'].includes(version)) {
// ui (GMSJ01/GMSJ0A only)
if (['GMSJ01', 'GMSJ0A'].includes(version)) {
/* bounds */
const { x, y, fontSize, width } = config;
const scale = fontSize / 20;

View file

@ -1,6 +1,6 @@
<template>
<div id="config">
<section v-if="version=='GMSJ01'" class="appearance">
<section v-if="['GMSJ01', 'GMSJ0A'].includes(version)" class="appearance">
<h3>{{l.h3}}</h3>
<div>
<span>{{l.location}}(</span><input type="number" min="0" max="600" v-model.number="x"><span>, </span><input type="number" min="16" max="464" v-model.number="y"><span>)</span>