~rabbits/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH uxn] Reload current rom instead of always loading boot.rom

Details
Message ID
<20211205202606.13938-1-delyaerricson@gmail.com>
DKIM signature
pass
Download raw message
Patch: +9 -4
- Store the initially loaded rom name to use for F4 reload
- If no romname is provided then default to loading boot.rom as before
---
 src/uxnemu.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/uxnemu.c b/src/uxnemu.c
index fa9b86e..33fe3a1 100644
--- a/src/uxnemu.c
+++ b/src/uxnemu.c
@@ -40,6 +40,7 @@ static Apu apu[POLYPHONY];
static Device *devsystem, *devscreen, *devmouse, *devctrl, *devaudio0, *devconsole;
static Uint8 zoom = 1;
static Uint32 *ppu_screen, stdin_event, audio0_event, palette[16];
char *romname;

static int
clamp(int val, int min, int max)
@@ -467,7 +468,7 @@ static void
restart(Uxn *u)
{
	set_size(WIDTH, HEIGHT, 1);
	start(u, "boot.rom");
	start(u, romname);
}

static void
@@ -591,7 +592,8 @@ main(int argc, char **argv)
			else
				return error("Opt", "-s No scale provided.");
		} else if(!loaded++) {
			if(!start(&u, argv[i]))
			romname = argv[i];
			if(!start(&u, romname))
				return error("Boot", "Failed to boot.");
		} else {
			char *p = argv[i];
@@ -599,8 +601,11 @@ main(int argc, char **argv)
			console_input(&u, '\n');
		}
	}
	if(!loaded && !start(&u, "boot.rom"))
		return error("usage", "uxnemu [-s scale] file.rom");
	if(!loaded) {
		romname = "boot.rom";
		if (!start(&u, romname))
			return error("usage", "uxnemu [-s scale] file.rom");
	}
	run(&u);
	quit();
	return 0;
-- 
2.34.0

[uxn/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CG7NHJAR8INT.13WWUCHBV2QX6@cirno>
In-Reply-To
<20211205202606.13938-1-delyaerricson@gmail.com> (view parent)
DKIM signature
missing
Download raw message
uxn/patches/.build.yml: SUCCESS in 53s

[Reload current rom instead of always loading boot.rom][0] from [DeltaF1][1]

[0]: https://lists.sr.ht/~rabbits/public-inbox/patches/27120
[1]: delyaerricson@gmail.com

✓ #642651 SUCCESS uxn/patches/.build.yml https://builds.sr.ht/~rabbits/job/642651
Reply to thread Export thread (mbox)