1
0

use name custom_return_code instead of no_return

This commit is contained in:
Intel A80486DX2-66 2024-09-23 01:21:13 +03:00
parent 301ad4292b
commit 376c7be221
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B
3 changed files with 9 additions and 7 deletions

View File

@ -141,7 +141,7 @@ ALLOWED_ARGUMENTS_FROM_FILE = (
"bit_depth",
"signed",
"channels",
"no_return",
"custom_return_code",
)
DEFAULT_ARGS = {
@ -150,7 +150,7 @@ DEFAULT_ARGS = {
"bit_depth": 8,
"signed": False,
"channels": 1,
"no_return": False
"custom_return_code": False
}
is_cmd_available = lambda cmd: which(cmd) is not None
@ -201,8 +201,9 @@ if __name__ == "__main__":
parser.add_argument("-k", "--repeat", default=0, type=int,
help="how many times to repeat the bytebeat : "
"default = 0")
parser.add_argument("-a", "--no-return", default=None, action="store_true",
help="do not insert return statement before the code")
parser.add_argument("-a", "--custom-return-code", default=None,
action="store_true",
help="do not insert return statement before the code")
parser.add_argument("-U", "--mode", default="sequential", type=str,
help="mode of writing: `sequential` or `instant` (the latter is not "
"recommended, since the whole result would be stored in RAM)")
@ -237,6 +238,7 @@ if __name__ == "__main__":
parsed_parameters = line[match.start(0):].split(",")
for parameter in parsed_parameters:
kv = [x.strip() for x in parameter.split("=")]
kv[0] = kv[0].split(" ")[-1]
key = None
value = None
@ -263,7 +265,7 @@ if __name__ == "__main__":
args.signed = False
# - Compilation
if not args.no_return: # Insert `return` statement
if not args.custom_return_code: # Insert `return` statement
# XXX: The bytebeat code is enclosed in parentheses to allow for the
# use of commas as a comma operator, enabling more formulas to function.
bytebeat_contents = f"return ({bytebeat_contents})"

View File

@ -1,4 +1,4 @@
// RENDER PARAMETERS: sample_rate = 44100, no_return
// RENDER PARAMETERS: sample_rate = 44100, custom_return_code
bb_counter_t u = t << 1;
SAMPLE_TYPE x = u & u >> 8;

View File

@ -1,4 +1,4 @@
// RENDER PARAMETERS: sample_rate = 44100, no_return
// RENDER PARAMETERS: sample_rate = 44100, custom_return_code
// FIXME: The sound disappears after a few cycles