papermario/tools/splat/util/compiler.py

41 lines
918 B
Python
Raw Normal View History

from dataclasses import dataclass
@dataclass
class Compiler:
name: str
asm_function_macro: str = "glabel"
asm_jtbl_label_macro: str = "glabel"
asm_data_macro: str = "glabel"
asm_end_label: str = ""
c_newline: str = "\n"
asm_inc_header: str = ""
include_macro_inc: bool = True
GCC = Compiler(
"GCC",
asm_inc_header=".set noat /* allow manual use of $at */\n.set noreorder /* don't insert nops after branches */\n\n",
)
SN64 = Compiler(
"SN64",
asm_function_macro=".globl",
asm_jtbl_label_macro=".globl",
asm_data_macro=".globl",
asm_end_label=".end",
c_newline="\r\n",
include_macro_inc=False,
)
Upgrade to splat 0.9.0 (#730) * changes for splat 0.9.0 * wip * git subrepo pull --branch=develop --force tools/splat subrepo: subdir: "tools/splat" merged: "2ff7357501" upstream: origin: "https://github.com/ethteck/splat.git" branch: "develop" commit: "2ff7357501" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * OK * big_snowflakes gfx data * Jenkins? * cleanup * debuff effect gfx data * fix * more effect gfx data * dlabel * git subrepo pull --branch=experiment --force tools/splat subrepo: subdir: "tools/splat" merged: "1365775e09" upstream: origin: "https://github.com/ethteck/splat.git" branch: "experiment" commit: "1365775e09" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * . * git subrepo pull --branch=experiment --force tools/splat subrepo: subdir: "tools/splat" merged: "6bd9fe1c4e" upstream: origin: "https://github.com/ethteck/splat.git" branch: "experiment" commit: "6bd9fe1c4e" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * flower splash/trail gfx * throw_spiny gfx * disable_x and butterflies gfx data * draw_coin_sparkles * Warnings, cleanup * cleanin * attempt at test_item_player_collision * more gfx + cleanup * more effect gfx * func_8002D160 * update update_symbol_addrs and symbol_addrs * git subrepo pull --branch=develop --force tools/splat subrepo: subdir: "tools/splat" merged: "4914dc9029" upstream: origin: "https://github.com/ethteck/splat.git" branch: "develop" commit: "4914dc9029" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * git subrepo pull --branch=master --force tools/splat subrepo: subdir: "tools/splat" merged: "aa71299594" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "aa71299594" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * fix * fix regression * Add rabbitizer to requirements * warnings * symbol_addrs fixes
2022-06-12 17:33:32 +02:00
IDO = Compiler("IDO")
compiler_for_name = {"GCC": GCC, "SN64": SN64, "IDO": IDO}
def for_name(name: str) -> Compiler:
name = name.upper()
if name in compiler_for_name:
return compiler_for_name[name]
return Compiler(name)