From 1b815d4148e084600513c7de2a359682e8285f79 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Wed, 25 Jun 2025 23:52:59 +0200 Subject: [PATCH] add joydemo to c65/mega65 samples, it works when driver is statically linked --- samples/Makefile | 10 ++++++++++ samples/joydemo.c | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/samples/Makefile b/samples/Makefile index 6c00c97a4..267e253ff 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -108,6 +108,8 @@ DISK_apple2enh = samples.dsk DISK_atari = samples.atr DISK_atarixl = samples.atr DISK_plus4 = samples.d64 +DISK_c65 = samples.d81 +DISK_mega65 = samples.d81 # -------------------------------------------------------------------------- # System-dependent settings @@ -253,6 +255,7 @@ EXELIST_c65 = \ checkversion \ enumdevdir \ hello \ + joydemo \ sieve \ tinyshell @@ -336,6 +339,7 @@ EXELIST_mega65 = \ checkversion \ enumdevdir \ hello \ + joydemo \ sieve \ tinyshell @@ -560,6 +564,12 @@ samples.d64: samples $(foreach file,$(OVERLAYLIST),$(D64_WRITE_PRG_recipe)) $(foreach file,$(EMD) $(MOU) $(JOY) $(TGI),$(D64_WRITE_SEQ_recipe)) +samples.d81: samples + @$(C1541) -format "samples,00" d81 $@ >$(NULLDEV) + $(foreach file,$(EXELIST_$(SYS)),$(D64_WRITE_PRG_recipe)) + $(foreach file,$(OVERLAYLIST),$(D64_WRITE_PRG_recipe)) + $(foreach file,$(EMD) $(MOU) $(JOY) $(TGI),$(D64_WRITE_SEQ_recipe)) + # -------------------------------------------------------------------------- # Rule to make an Apple II disk with all samples. Needs the AppleCommander # program, available at https://applecommander.github.io/, and a template disk diff --git a/samples/joydemo.c b/samples/joydemo.c index 807c16a08..56e825541 100644 --- a/samples/joydemo.c +++ b/samples/joydemo.c @@ -3,6 +3,9 @@ #include #include +/* define 0 to link the standard driver statically */ +/* #define DYN_DRV 0 */ + #ifndef DYN_DRV # define DYN_DRV 1 #endif @@ -31,7 +34,7 @@ int main (void) PRINTF("Driver init..." CR); #if DYN_DRV - /* Load and initialize the driver */ + /* Load and initialize the standard driver driver */ if ((err = joy_load_driver (joy_stddrv))) { PRINTF ("Driver load error (code %d)." CR "Warning: This program needs the JOY" CR @@ -40,7 +43,7 @@ int main (void) } PRINTF("Driver loaded OK" CR); #else - /* Install the driver */ + /* Install the standard driver */ joy_install (joy_static_stddrv); #endif