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 1
1
# Changelog
2
2
3
+ ## [1.3.1]
4
+ - Readd support for @label syntax
5
+ - Fix a bug with the even macro
6
+
3
7
## [1.3.0]
4
8
- Assembler now uses AS Macro Assembler for full macro support
5
9
- 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 = {
19
19
toolsmsg,
20
20
} ;
21
21
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
+
22
38
export async function assemble (
23
39
code ,
24
40
{ filename } = {
@@ -28,7 +44,7 @@ export async function assemble(
28
44
const aslWorker = new Worker ( 'bundles/asl-worker.js' ) ;
29
45
const asl = Comlink . wrap ( aslWorker ) ;
30
46
31
- const pFile = await asl . assemble ( code , {
47
+ const pFile = await asl . assemble ( atLabels ( code ) , {
32
48
messages : asMessages ,
33
49
filename,
34
50
} ) ;
Original file line number Diff line number Diff line change @@ -334,7 +334,6 @@ export default catchFunc((file) => {
334
334
prelude : `
335
335
even macro
336
336
if (*)&1
337
- paddingSoFar set paddingSoFar+1
338
337
dc.b 0 ;ds.b 1
339
338
endif
340
339
endm
Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " 1.3.0 " ,
2
+ "version" : " 1.3.1 " ,
3
3
"scripts" : {
4
4
"start" : " electron ./static --dev"
5
5
},
You can’t perform that action at this time.
0 commit comments