Archived
1
0
Fork 0

[v0.0.7] rename version to GMSx, provide version info to ASM

This commit is contained in:
sup39 2023-01-29 01:39:54 +09:00
parent 558c2863d5
commit 3da33e9d7e
6 changed files with 15 additions and 10 deletions

View file

@ -1,6 +1,6 @@
[metadata] [metadata]
name = supSMSASM name = supSMSASM
version = 0.0.5 version = 0.0.7
author = sup39 author = sup39
author_email = sms@sup39.dev author_email = sms@sup39.dev
description = A tool to make Gecko code from ASM for SMS description = A tool to make Gecko code from ASM for SMS

View file

@ -21,14 +21,14 @@ def pbcopy(content):
logger = logging.getLogger('supSMSASM') logger = logging.getLogger('supSMSASM')
def normalize_dolver(s): def normalize_dolver(s):
if re.match(r'^(?:JP?|N(?:TSC)?[-_]?J)(?:1\.?0|\.0)?$|^1\.0$', s): if re.match(r'^(?:JP?|N(?:TSC)?[-_]?J)(?:1\.?0|\.0)?$|^1\.0$|^GMSJ01$', s):
return 'NTSC-J_1.0' return 'GMSJ01'
if re.match(r'^(?:JP?A|N(?:TSC)?[-_]?J)(?:1\.?1|\.1|A)?$|^1\.1$', s): if re.match(r'^(?:JP?A|N(?:TSC)?[-_]?J)(?:1\.?1|\.1|A)?$|^1\.1$|^GMSJ0A$', s):
return 'NTSC-J_1.1' return 'GMSJ0A'
if re.match(r'^EU|P|PAL$', s): if re.match(r'^EU|P|PAL|^GMSP01$', s):
return 'PAL' return 'GMSP01'
if re.match(r'^US?|N(?:TSC)?[-_]?U$', s): if re.match(r'^US?|N(?:TSC)?[-_]?U|^GMSE01$', s):
return 'NTSC-U' return 'GMSE01'
return None return None
def system(argv, *args, **kwargs): def system(argv, *args, **kwargs):
@ -49,6 +49,7 @@ def asm2gecko(fnIn, dolver):
try: try:
# include macros.inc # include macros.inc
with open(distASM, 'w') as fw, open(fnIn, 'r') as fr: 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) print(f'.include "macros.inc"', file=fw)
for line in fr: fw.write(line) for line in fr: fw.write(line)
@ -203,7 +204,7 @@ def main():
sys.exit(1) sys.exit(1)
fnIn = argv[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: if dolver is None:
logger.error('Unknown dol version: %s'%argv[2]) logger.error('Unknown dol version: %s'%argv[2])
sys.exit(1) sys.exit(1)

View file

@ -1,4 +1,5 @@
"SMS__NTSC-U" = 1; "SMS__NTSC-U" = 1;
"SMS__GMSE01" = 1;
"SMS__US" = 1; "SMS__US" = 1;
"$r13" = 0x804141c0; "$r13" = 0x804141c0;
"TRK_MINNOW_DOLPHIN.TRK_memcpy" = 0x80003244; "TRK_MINNOW_DOLPHIN.TRK_memcpy" = 0x80003244;

View file

@ -1,4 +1,5 @@
"SMS__NTSC-J_1.0" = 1; "SMS__NTSC-J_1.0" = 1;
"SMS__GMSJ01" = 1;
"SMS__JP" = 1; "SMS__JP" = 1;
"$r13" = 0x80410ac0; "$r13" = 0x80410ac0;
"$r2" = 0x80413460; "$r2" = 0x80413460;

View file

@ -1,4 +1,5 @@
"SMS__NTSC-J_1.1" = 1; "SMS__NTSC-J_1.1" = 1;
"SMS__GMSJ0A" = 1;
"SMS__JPA" = 1; "SMS__JPA" = 1;
"$r13" = 0x804051a0; "$r13" = 0x804051a0;
"$r2" = 0x80407aa0; "$r2" = 0x80407aa0;

View file

@ -1,4 +1,5 @@
"SMS__PAL" = 1; "SMS__PAL" = 1;
"SMS__GMSP01" = 1;
"SMS__EU" = 1; "SMS__EU" = 1;
"$r13" = 0x8040b960; "$r13" = 0x8040b960;
"$r2" = 0x8040e280; "$r2" = 0x8040e280;