chore: version Zelda 1 port and engineering records
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Generate guest validation sources outside src; use disposable cards only."""
|
||||
import argparse
|
||||
from extract_graphics import ROOT
|
||||
|
||||
def generate(action):
|
||||
out=ROOT/'.tmp/save-fixture-generated';out.mkdir(exist_ok=True,parents=True);source=ROOT/'tools/fixtures/save'
|
||||
for name in ('store','inventory','menu','game'):
|
||||
text=(source/f'{name}.pbs').read_text()
|
||||
if name=='game':text=text.replace('SAVE_TEST_ACTION: int=0',f'SAVE_TEST_ACTION: int={action}')
|
||||
(out/f'{name}.pbs').write_text(text)
|
||||
(out/'main.pbs').write_text('''import { Game, SaveGameChecks } from @zelda1:game;
|
||||
import { SaveStore } from @zelda1:save;
|
||||
[Init] fn init() -> void { Game.boot(); }
|
||||
[MemcardBoot] fn memcard_boot(context: long) -> int { return SaveStore.boot(context); }
|
||||
[Frame] fn frame() -> void { SaveGameChecks.frame(); }
|
||||
''')
|
||||
print('Generated disposable-card fixture, action',action,'in',out)
|
||||
if __name__=='__main__':
|
||||
parser=argparse.ArgumentParser();parser.add_argument('--action',type=int,choices=range(5),default=0);generate(parser.parse_args().action)
|
||||
Reference in New Issue
Block a user