File tree Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## [1.3.1]
4+ - Readd support for @label syntax
5+ - Fix a bug with the even macro
6+
37## [1.3.0]
48- Assembler now uses AS Macro Assembler for full macro support
59- MapMacros.asm definitions added for Sonic 1 and 2
Original file line number Diff line number Diff line change @@ -19,6 +19,22 @@ const p2binMessages = {
1919 toolsmsg,
2020} ;
2121
22+ function atLabels ( code ) {
23+ const labels = / ^ @ [ a - z A - Z 0 - 9 _ $ ] + \s * : / gm;
24+
25+ while ( true ) {
26+ const result = labels . exec ( code ) ;
27+ if ( ! result ) break ;
28+ const label = result [ 0 ] . slice ( 0 , - 1 ) ;
29+
30+ if ( label . startsWith ( '@' ) ) {
31+ code = code . replace ( new RegExp ( label , 'g' ) , `._at_${ label . slice ( 1 ) } ` ) ;
32+ }
33+ }
34+
35+ return code ;
36+ }
37+
2238export async function assemble (
2339 code ,
2440 { filename } = {
@@ -28,7 +44,7 @@ export async function assemble(
2844 const aslWorker = new Worker ( 'bundles/asl-worker.js' ) ;
2945 const asl = Comlink . wrap ( aslWorker ) ;
3046
31- const pFile = await asl . assemble ( code , {
47+ const pFile = await asl . assemble ( atLabels ( code ) , {
3248 messages : asMessages ,
3349 filename,
3450 } ) ;
Original file line number Diff line number Diff line change @@ -334,7 +334,6 @@ export default catchFunc((file) => {
334334 prelude : `
335335even macro
336336 if (*)&1
337- paddingSoFar set paddingSoFar+1
338337 dc.b 0 ;ds.b 1
339338 endif
340339 endm
Original file line number Diff line number Diff line change 11{
2- "version" : " 1.3.0 " ,
2+ "version" : " 1.3.1 " ,
33 "scripts" : {
44 "start" : " electron ./static --dev"
55 },
You can’t perform that action at this time.
0 commit comments