summaryrefslogtreecommitdiff
path: root/tools/libdol2asm/data/function
diff options
context:
space:
mode:
authorJulgodis <>2021-04-01 02:07:58 +0200
committerJulgodis <>2021-04-01 02:07:58 +0200
commitf6464a61cecc9b65cf010d2fb7876c23251761f5 (patch)
treef8dca6ee66125288bd3be0cc239cf07276469a02 /tools/libdol2asm/data/function
parentb999714187d934636004d3d93e1ed1da792d6f80 (diff)
__sinit and progress script update
Diffstat (limited to 'tools/libdol2asm/data/function')
-rw-r--r--tools/libdol2asm/data/function/base.py34
-rw-r--r--tools/libdol2asm/data/function/sinit.py3
2 files changed, 19 insertions, 18 deletions
diff --git a/tools/libdol2asm/data/function/base.py b/tools/libdol2asm/data/function/base.py
index 98b0d5b51f..e8afdbe09b 100644
--- a/tools/libdol2asm/data/function/base.py
+++ b/tools/libdol2asm/data/function/base.py
@@ -130,23 +130,25 @@ class Function(Symbol):
without_template: bool = False,
comment_arguments: bool = False,
template_args: List[str] = None):
- await builder.write(f"// {self.is_static} {self.uses_any_templates}")
-
- lines = []
- def callback(tp, depth):
- pad = '\t' * depth
- template = False
- if isinstance(tp, NamedType):
- template = tp.has_template
- lines.append(f"// {pad} {tp.type()} {template}")
-
- if self.return_type:
- self.return_type.traverse(callback, 0)
- for arg_type in self.argument_types:
- arg_type.traverse(callback, 0)
- for line in lines:
- await builder.write(line)
+ if False:
+ await builder.write(f"// {self.is_static} {self.uses_any_templates}")
+
+ lines = []
+ def callback(tp, depth):
+ pad = '\t' * depth
+ template = False
+ if isinstance(tp, NamedType):
+ template = tp.has_template
+ lines.append(f"// {pad} {tp.type()} {template}")
+
+ if self.return_type:
+ self.return_type.traverse(callback, 0)
+ for arg_type in self.argument_types:
+ arg_type.traverse(callback, 0)
+
+ for line in lines:
+ await builder.write(line)
declspec = "extern \"C\" "
if not original and self.is_demangled():
diff --git a/tools/libdol2asm/data/function/sinit.py b/tools/libdol2asm/data/function/sinit.py
index 8f6214dfea..02ebcd8f94 100644
--- a/tools/libdol2asm/data/function/sinit.py
+++ b/tools/libdol2asm/data/function/sinit.py
@@ -20,8 +20,7 @@ class SInitFunction(ASMFunction):
await builder.write("#pragma push")
await builder.write("#pragma force_active on")
- await builder.write(f"#pragma section \".ctors$15\"")
- await builder.write(f"__declspec(section \".ctors$15\") void* const _ctors_{self.addr:08X} = (void*){self.label};")
+ await builder.write(f"SECTION_CTORS void* const _ctors_{self.addr:08X} = (void*){self.label};")
await builder.write("#pragma pop")
await builder.write("")