mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Allow OPT to accept optional dashes before flags
This commit is contained in:
@@ -2482,7 +2482,8 @@ can be used to change some of the options during assembling from within the sour
|
||||
takes a comma-separated list of options as its argument:
|
||||
.Bd -literal -offset indent
|
||||
PUSHO
|
||||
OPT g.oOX, Wdiv ; acts like command-line -g.oOX -Wdiv
|
||||
OPT g.oOX, Wdiv ; acts like command-line `-g.oOX -Wdiv`
|
||||
OPT -Wdiv ; dashes before the options are optional
|
||||
DW `..ooOOXX ; uses the graphics constant characters from OPT g
|
||||
PRINTLN $80000000/-1 ; prints a warning about division
|
||||
POPO
|
||||
|
||||
@@ -53,6 +53,9 @@ void opt_W(char const *flag) {
|
||||
}
|
||||
|
||||
void opt_Parse(char const *s) {
|
||||
if (s[0] == '-') {
|
||||
++s;
|
||||
}
|
||||
switch (s[0]) {
|
||||
case 'b':
|
||||
if (strlen(&s[1]) == 2) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
SECTION "test", ROM0
|
||||
|
||||
pusho
|
||||
opt p42, Q.4, Wno-div
|
||||
opt p42, -Q.4, Wno-div
|
||||
ds 1
|
||||
println $8000_0000 / -1
|
||||
def n = 3.14
|
||||
@@ -13,6 +13,6 @@ popo
|
||||
def n = 3.14
|
||||
println "{x:n} = {f:n}"
|
||||
|
||||
pusho p99
|
||||
pusho -p99
|
||||
ds 1
|
||||
popo
|
||||
|
||||
Reference in New Issue
Block a user