diff --git a/setup.cfg b/setup.cfg index 20f4a2e..d347cfd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = supSMSASM -version = 0.0.5 +version = 0.0.7 author = sup39 author_email = sms@sup39.dev description = A tool to make Gecko code from ASM for SMS diff --git a/src/supSMSASM/cli.py b/src/supSMSASM/cli.py index 2289a6b..476d961 100644 --- a/src/supSMSASM/cli.py +++ b/src/supSMSASM/cli.py @@ -21,14 +21,14 @@ def pbcopy(content): logger = logging.getLogger('supSMSASM') def normalize_dolver(s): - if re.match(r'^(?:JP?|N(?:TSC)?[-_]?J)(?:1\.?0|\.0)?$|^1\.0$', s): - return 'NTSC-J_1.0' - if re.match(r'^(?:JP?A|N(?:TSC)?[-_]?J)(?:1\.?1|\.1|A)?$|^1\.1$', s): - return 'NTSC-J_1.1' - if re.match(r'^EU|P|PAL$', s): - return 'PAL' - if re.match(r'^US?|N(?:TSC)?[-_]?U$', s): - return 'NTSC-U' + if re.match(r'^(?:JP?|N(?:TSC)?[-_]?J)(?:1\.?0|\.0)?$|^1\.0$|^GMSJ01$', s): + return 'GMSJ01' + if re.match(r'^(?:JP?A|N(?:TSC)?[-_]?J)(?:1\.?1|\.1|A)?$|^1\.1$|^GMSJ0A$', s): + return 'GMSJ0A' + if re.match(r'^EU|P|PAL|^GMSP01$', s): + return 'GMSP01' + if re.match(r'^US?|N(?:TSC)?[-_]?U|^GMSE01$', s): + return 'GMSE01' return None def system(argv, *args, **kwargs): @@ -49,6 +49,7 @@ def asm2gecko(fnIn, dolver): try: # include macros.inc with open(distASM, 'w') as fw, open(fnIn, 'r') as fr: + print(f'.set __VERSION__, {dolver}', file=fw) print(f'.include "macros.inc"', file=fw) for line in fr: fw.write(line) @@ -203,7 +204,7 @@ def main(): sys.exit(1) fnIn = argv[1] - dolver = normalize_dolver(argv[2]) if argc > 2 else 'NTSC-J_1.0' + dolver = normalize_dolver(argv[2]) if argc > 2 else 'GMSJ01' if dolver is None: logger.error('Unknown dol version: %s'%argv[2]) sys.exit(1) diff --git a/src/supSMSASM/ldscript/NTSC-U.ld b/src/supSMSASM/ldscript/GMSE01.ld similarity index 99% rename from src/supSMSASM/ldscript/NTSC-U.ld rename to src/supSMSASM/ldscript/GMSE01.ld index 1799cea..a5dd15d 100644 --- a/src/supSMSASM/ldscript/NTSC-U.ld +++ b/src/supSMSASM/ldscript/GMSE01.ld @@ -1,4 +1,5 @@ "SMS__NTSC-U" = 1; +"SMS__GMSE01" = 1; "SMS__US" = 1; "$r13" = 0x804141c0; "TRK_MINNOW_DOLPHIN.TRK_memcpy" = 0x80003244; diff --git a/src/supSMSASM/ldscript/NTSC-J_1.0.ld b/src/supSMSASM/ldscript/GMSJ01.ld similarity index 99% rename from src/supSMSASM/ldscript/NTSC-J_1.0.ld rename to src/supSMSASM/ldscript/GMSJ01.ld index e9b4986..bbc7ef6 100644 --- a/src/supSMSASM/ldscript/NTSC-J_1.0.ld +++ b/src/supSMSASM/ldscript/GMSJ01.ld @@ -1,4 +1,5 @@ "SMS__NTSC-J_1.0" = 1; +"SMS__GMSJ01" = 1; "SMS__JP" = 1; "$r13" = 0x80410ac0; "$r2" = 0x80413460; diff --git a/src/supSMSASM/ldscript/NTSC-J_1.1.ld b/src/supSMSASM/ldscript/GMSJ0A.ld similarity index 99% rename from src/supSMSASM/ldscript/NTSC-J_1.1.ld rename to src/supSMSASM/ldscript/GMSJ0A.ld index e846828..110222d 100644 --- a/src/supSMSASM/ldscript/NTSC-J_1.1.ld +++ b/src/supSMSASM/ldscript/GMSJ0A.ld @@ -1,4 +1,5 @@ "SMS__NTSC-J_1.1" = 1; +"SMS__GMSJ0A" = 1; "SMS__JPA" = 1; "$r13" = 0x804051a0; "$r2" = 0x80407aa0; diff --git a/src/supSMSASM/ldscript/PAL.ld b/src/supSMSASM/ldscript/GMSP01.ld similarity index 99% rename from src/supSMSASM/ldscript/PAL.ld rename to src/supSMSASM/ldscript/GMSP01.ld index 74c7920..0cfcf7d 100644 --- a/src/supSMSASM/ldscript/PAL.ld +++ b/src/supSMSASM/ldscript/GMSP01.ld @@ -1,4 +1,5 @@ "SMS__PAL" = 1; +"SMS__GMSP01" = 1; "SMS__EU" = 1; "$r13" = 0x8040b960; "$r2" = 0x8040e280;