Skip to content

Commit 634d6ba

Browse files
committed
Merge branch 'asar_19'
2 parents b7a391c + 74fbf1f commit 634d6ba

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

docs/changelog/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ <h3>Deprecated features:</h3>
8989
<li><code>rep</code> to repeat commands: Use while loops or unrolled loops instead.</li>
9090
<li>Windows-specific paths (e.g. <code>incsrc dir\file.asm</code>): Use cross-platform paths instead (<code>incsrc dir/file.asm</code>).</li>
9191
<li><code>table</code> command: Assign characters directly instead, like <code>'a' = $00</code>.</li>
92-
<li>Labels in <code>padbyte</code> or <code>fillbyte</code> commands.</li>
92+
<li>Non-static labels in <code>padbyte</code> or <code>fillbyte</code> commands.</li>
9393
<li><code>spc700-raw</code> architecture: Use <code>spc700</code> with <code>norom</code> instead.</li>
9494
<li><code>fastrom</code>: Has never actually worked and can be removed.</li>
9595
<li><code>header</code>: Doesn't do anything and can be removed.</li>

src/asar/assembleblock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,7 +2416,7 @@ void assembleblock(const char * block, bool isspecialline)
24162416
if (is("padlong")) len=3;
24172417
if (is("paddword")) len=4;
24182418
unsigned int val=getnum(par);
2419-
if(foundlabel) asar_throw_warning(1, warning_id_feature_deprecated, "labels in padbyte", "just... don't.");
2419+
if(foundlabel && !foundlabel_static) asar_throw_warning(1, warning_id_feature_deprecated, "labels in padbyte", "just... don't.");
24202420
for (int i=0;i<12;i+=len)
24212421
{
24222422
unsigned int tmpval=val;
@@ -2448,7 +2448,7 @@ void assembleblock(const char * block, bool isspecialline)
24482448
if (is("filllong")) len=3;
24492449
if (is("filldword")) len=4;
24502450
unsigned int val= getnum(par);
2451-
if(foundlabel) asar_throw_warning(1, warning_id_feature_deprecated, "labels in fillbyte", "just... don't");
2451+
if(foundlabel && !foundlabel_static) asar_throw_warning(1, warning_id_feature_deprecated, "labels in fillbyte", "just... don't");
24522452
for (int i=0;i<12;i+=len)
24532453
{
24542454
unsigned int tmpval=val;

tests/labels_static_fail.asm

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
;`errEno_labels_here
88
;`errElabel_cross_assignment
99
;`errEno_labels_here
10+
;`warnWfeature_deprecated
11+
;`warnWfeature_deprecated
1012
;`errEdefine_label_math
1113
org $008000
1214
ANonStaticLabel:
@@ -47,9 +49,11 @@ incbin "data/64kb.bin":(8000)-(ANonStaticLabel+2)
4749

4850
ANewLabel = ANonStaticLabel
4951

50-
fillbyte $EE
52+
Here:
53+
fillbyte Here
5154
fill ANonStaticLabel
5255

53-
!adefine #= ANonStaticLabel
56+
padbyte Here
57+
pad ANonStaticLabel
5458

55-
; TODO: Test incbin and more.
59+
!adefine #= ANonStaticLabel

tests/labels_static_pass.asm

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
;`+
12
;`56 78
23
;`BA
34
;`BA
45
;`EE EE EE
56
;`03
7+
;`42
8+
;`007FFE EE EE
69
;P>Test passed. (1)
710
;P>Test passed. (2)
811
;P>Test passed. (3)
@@ -56,14 +59,27 @@ OtherFunStuff = FunStuff
5659
db 'a'
5760
db OtherFunStuff
5861

62+
FillByte = $EE
5963
FillCount = 3
6064

61-
fillbyte $EE
65+
fillbyte FillByte
6266
fill FillCount
6367

6468
!adefine #= FillCount
6569

6670
db !adefine
6771

68-
; TODO: Test incbin and more.
72+
ArgID = 2
73+
74+
macro in_macro(...)
75+
db <...[ArgID]>
76+
endmacro
77+
78+
%in_macro($40, $41, $42)
79+
80+
81+
org $00FFFE
82+
83+
padbyte FillByte
84+
pad $018000
6985

0 commit comments

Comments
 (0)