shithub: rgbds

Download patch

ref: f88968ec20e59daefa4c8fc1e4a61f7c958ffe90
parent: 5ad8a8c95837aa39c151b1f6f98bc60f79ceccf1
author: Rangi <35663410+Rangi42@users.noreply.github.com>
date: Sun Sep 25 00:22:55 EDT 2022

Fix `rgbasm -b` and `rgbasm -g` (#1052)

Fixes #1051

--- a/src/asm/main.c
+++ b/src/asm/main.c
@@ -182,7 +182,7 @@
 		switch (ch) {
 		case 'b':
 			if (strlen(musl_optarg) == 2)
-				opt_B(&musl_optarg[1]);
+				opt_B(musl_optarg);
 			else
 				errx("Must specify exactly 2 characters for option 'b'");
 			break;
@@ -204,7 +204,7 @@
 
 		case 'g':
 			if (strlen(musl_optarg) == 4)
-				opt_G(&musl_optarg[1]);
+				opt_G(musl_optarg);
 			else
 				errx("Must specify exactly 4 characters for option 'g'");
 			break;
--- a/test/asm/opt-b.asm
+++ b/test/asm/opt-b.asm
@@ -1,2 +1,4 @@
+PRINTLN %Oo_Oo_Oo
+
 OPT b.X
-PRINTLN %..X.X.X.
+PRINTLN %..X._X.X.
--- /dev/null
+++ b/test/asm/opt-b.flags
@@ -1,0 +1,1 @@
+-Weverything -b oO
--- a/test/asm/opt-b.out
+++ b/test/asm/opt-b.out
@@ -1,1 +1,2 @@
 $2A
+$2A
--- a/test/asm/opt-g.asm
+++ b/test/asm/opt-g.asm
@@ -1,2 +1,4 @@
+PRINTLN `pqpq_rsrs
+
 OPT g.x0X
-PRINTLN `.x.x0X0X
+PRINTLN `.x.x_0X0X
--- /dev/null
+++ b/test/asm/opt-g.flags
@@ -1,0 +1,1 @@
+-Weverything -g pqrs
--- a/test/asm/opt-g.out
+++ b/test/asm/opt-g.out
@@ -1,1 +1,2 @@
 $F55
+$F55