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:
|
takes a comma-separated list of options as its argument:
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
PUSHO
|
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
|
DW `..ooOOXX ; uses the graphics constant characters from OPT g
|
||||||
PRINTLN $80000000/-1 ; prints a warning about division
|
PRINTLN $80000000/-1 ; prints a warning about division
|
||||||
POPO
|
POPO
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ void opt_W(char const *flag) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void opt_Parse(char const *s) {
|
void opt_Parse(char const *s) {
|
||||||
|
if (s[0] == '-') {
|
||||||
|
++s;
|
||||||
|
}
|
||||||
switch (s[0]) {
|
switch (s[0]) {
|
||||||
case 'b':
|
case 'b':
|
||||||
if (strlen(&s[1]) == 2) {
|
if (strlen(&s[1]) == 2) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
SECTION "test", ROM0
|
SECTION "test", ROM0
|
||||||
|
|
||||||
pusho
|
pusho
|
||||||
opt p42, Q.4, Wno-div
|
opt p42, -Q.4, Wno-div
|
||||||
ds 1
|
ds 1
|
||||||
println $8000_0000 / -1
|
println $8000_0000 / -1
|
||||||
def n = 3.14
|
def n = 3.14
|
||||||
@@ -13,6 +13,6 @@ popo
|
|||||||
def n = 3.14
|
def n = 3.14
|
||||||
println "{x:n} = {f:n}"
|
println "{x:n} = {f:n}"
|
||||||
|
|
||||||
pusho p99
|
pusho -p99
|
||||||
ds 1
|
ds 1
|
||||||
popo
|
popo
|
||||||
|
|||||||
Reference in New Issue
Block a user