aboutsummaryrefslogtreecommitdiff
path: root/games/yae/patches
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2014-01-30 17:02:44 +0700
committerRobby Workman <rworkman@slackbuilds.org>2014-02-01 00:40:30 -0600
commitcc3ee0bbc2a4d65982aed9d1614112bd11b0e383 (patch)
tree889b2d0fe2d772caf5e125937041d6581976410a /games/yae/patches
parent784b68cd9fd28c0f0e40c9c519ebffda222f8ad2 (diff)
games/yae: Added (Yet another Apple Emulator).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/yae/patches')
-rw-r--r--games/yae/patches/64.diff13
-rw-r--r--games/yae/patches/confile_apple2.diff11
-rw-r--r--games/yae/patches/defaultmasterdisk.diff11
-rw-r--r--games/yae/patches/defaultromlocation.diff35
-rw-r--r--games/yae/patches/disk_selection.diff74
-rw-r--r--games/yae/patches/fix2option.diff11
6 files changed, 155 insertions, 0 deletions
diff --git a/games/yae/patches/64.diff b/games/yae/patches/64.diff
new file mode 100644
index 0000000000000..ace2b9d8bf993
--- /dev/null
+++ b/games/yae/patches/64.diff
@@ -0,0 +1,13 @@
+diff -Naur yae-0.7/screen.c yae-0.7.patched/screen.c
+--- yae-0.7/screen.c 2007-04-03 17:51:44.000000000 -0400
++++ yae-0.7.patched/screen.c 2013-08-31 02:13:07.000000000 -0400
+@@ -40,6 +40,9 @@
+ XImage *ScreenXImage;
+ XShmSegmentInfo shminfo;
+
++XImage *createShmImage( DisplayContext *dc, int width, int height,
++ XShmSegmentInfo *info );
++
+ /*
+ * frame rate control
+ */
diff --git a/games/yae/patches/confile_apple2.diff b/games/yae/patches/confile_apple2.diff
new file mode 100644
index 0000000000000..597623be9cfbc
--- /dev/null
+++ b/games/yae/patches/confile_apple2.diff
@@ -0,0 +1,11 @@
+diff -Naur yae-0.7/confile.c yae-0.7.patched/confile.c
+--- yae-0.7/confile.c 2007-04-03 17:50:57.000000000 -0400
++++ yae-0.7.patched/confile.c 2013-08-29 14:17:06.000000000 -0400
+@@ -216,6 +216,7 @@
+ if (!strcmp(v, "MachineType")) {
+ if (!strcmp(h,"IIe")) { MachineType=APPLE_IIE; }
+ else if (!strcmp(h,"II+")) { MachineType=APPLE_II_PLUS; }
++ else if (!strcmp(h,"II")) { MachineType=APPLE_II; }
+ else fprintf(stderr,"Unknown MachineType %s in %s\n",h,cfile);
+ continue;
+ }
diff --git a/games/yae/patches/defaultmasterdisk.diff b/games/yae/patches/defaultmasterdisk.diff
new file mode 100644
index 0000000000000..f45b1118c3340
--- /dev/null
+++ b/games/yae/patches/defaultmasterdisk.diff
@@ -0,0 +1,11 @@
+diff -Naur yae-0.7/main.c yae-0.7.patched/main.c
+--- yae-0.7/main.c 2007-04-03 17:48:36.000000000 -0400
++++ yae-0.7.patched/main.c 2013-08-28 19:20:59.000000000 -0400
+@@ -95,6 +95,7 @@
+ processOptions(argc,argv);
+
+ /* mount disks */
++ if (optind == argc) disk_name[6][0]="/usr/share/yae/Master.dsk";
+ if (optind<argc) disk_name[6][0]=argv[optind++];
+ if (optind<argc) disk_name[6][1]=argv[optind++];
+ if (optind<argc) disk_name[5][0]=argv[optind++];
diff --git a/games/yae/patches/defaultromlocation.diff b/games/yae/patches/defaultromlocation.diff
new file mode 100644
index 0000000000000..ee97a9bbb9e01
--- /dev/null
+++ b/games/yae/patches/defaultromlocation.diff
@@ -0,0 +1,35 @@
+diff -Naur yae-0.7/disk2.c yae-0.7.patched/disk2.c
+--- yae-0.7/disk2.c 2007-04-03 17:49:22.000000000 -0400
++++ yae-0.7.patched/disk2.c 2013-08-28 19:16:54.000000000 -0400
+@@ -105,8 +105,9 @@
+ FILE *f;
+
+ f = fopen( DiskROM, "rb" );
++ if(!f) f = fopen("/usr/share/yae/DISK.ROM", "rb");
+ if ( !f ) {
+- fprintf( stderr, "Cannot read disk II boot rom %s\n", DiskROM );
++ fprintf( stderr, "Cannot read disk II boot rom %s or /usr/share/yae/DISK.ROM\n", DiskROM );
+ exit(1);
+ }
+ fread( boot_ROM, 1, 256, f );
+diff -Naur yae-0.7/memory.c yae-0.7.patched/memory.c
+--- yae-0.7/memory.c 2007-04-03 17:42:23.000000000 -0400
++++ yae-0.7.patched/memory.c 2013-08-28 19:18:13.000000000 -0400
+@@ -88,10 +88,13 @@
+ MainMemoryROM[i] = amp;
+ }
+
+- if (MachineType < APPLE_IIE)
+- loadROMFile( Apple2ROM );
+- else
+- loadROMFile( Apple2eROM );
++ if (MachineType < APPLE_IIE) {
++ if(loadROMFile( Apple2ROM ) != 0)
++ loadROMFile("/usr/share/yae/APPLE2.ROM");
++ } else {
++ if(loadROMFile( Apple2eROM ) != 0)
++ loadROMFile("/usr/share/yae/APPLE2E.ROM");
++ }
+
+ for( i = 0; i < 8; i++ ) {
+ expansion_slot_read[i] = NULL;
diff --git a/games/yae/patches/disk_selection.diff b/games/yae/patches/disk_selection.diff
new file mode 100644
index 0000000000000..ae55d6c3400d7
--- /dev/null
+++ b/games/yae/patches/disk_selection.diff
@@ -0,0 +1,74 @@
+diff -Naur yae-0.7/x_window.c yae-0.7.patched/x_window.c
+--- yae-0.7/x_window.c 2007-04-03 17:47:59.000000000 -0400
++++ yae-0.7.patched/x_window.c 2013-08-30 13:36:15.000000000 -0400
+@@ -29,6 +29,8 @@
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <string.h>
++#include <sys/types.h>
++#include <sys/wait.h>
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
+ #include <X11/keysym.h>
+@@ -238,13 +240,27 @@
+ XCloseDisplay( dc->display );
+ }
+
++static int kdialog_select_file(char *buffer) {
++ void *i;
++ int s;
++ FILE *kdialog = popen(
++ "kdialog --title 'YAE - Select Disk Image' --getopenfilename . '*.dsk'", "r");
++ if(!kdialog) return -1; /* can't fork() or malloc() probably */
++ i = fgets(buffer, 4096, kdialog);
++ s = WEXITSTATUS(pclose(kdialog));
++ if(s == 127) return -2; /* shell returns this if kdialog not found */
++ return i != NULL; /* returns 0 if user hit cancel, 1 if filename OK */
++}
++
+ void X_check_and_handle_event( void *arg )
+ {
+ DisplayContext *dc;
+ XEvent event;
+- int count;
++ int count, kdresult;
+ BYTE key, Apple_Key();
+- char buffer[256];
++ char buffer[4096] = "\0", *p;
++
++ static int diskname_freeable = 0;
+
+ dc = (DisplayContext*)arg;
+
+@@ -266,15 +282,24 @@
+ /* Should ask which drive, and should
+ * free the existing string if possible - wkt
+ */
+- puts( "Mount new disk\n" );
+- buffer[0] = '\0';
+- fgets( buffer, 256, stdin );
+- if (buffer[0])
+- buffer[strlen( buffer ) - 1 ] = '\0';
++ kdresult = kdialog_select_file(buffer);
++ if(kdresult == 0) {
++ break; /* don't do anything if cancelled */
++ } else if(kdresult < 0) {
++ /* only use stdin if kdialog not found */
++ puts( "Mount new disk\n" );
++ buffer[0] = '\0';
++ fgets( buffer, 256, stdin );
++ }
++ /* remove trailing \n */
++ for(p = buffer; *p; p++)
++ if(*p == '\n') *p = '\0';
++ if(buffer[0] == '\0') break; /* don't use empty filename */
+ /* ctkwan: free previosly allocated string */
+- if( disk_name[6][0]!=NULL)
++ if( diskname_freeable && disk_name[6][0]!=NULL)
+ free( disk_name[6][0] );
+- disk_name[6][0]= strdup(buffer);
++ disk_name[6][0]= strdup(buffer);
++ diskname_freeable = 1;
+ mount_disk(6,0);
+ }
+ break;
diff --git a/games/yae/patches/fix2option.diff b/games/yae/patches/fix2option.diff
new file mode 100644
index 0000000000000..d1038f0be6b8d
--- /dev/null
+++ b/games/yae/patches/fix2option.diff
@@ -0,0 +1,11 @@
+diff -Naur yae-0.7/main.c yae-0.7.patched/main.c
+--- yae-0.7/main.c 2007-04-03 17:48:36.000000000 -0400
++++ yae-0.7.patched/main.c 2013-08-28 14:35:12.000000000 -0400
+@@ -70,6 +70,7 @@
+ while((c=getopt(argc,argv,Options))!= EOF) {
+ switch(c) {
+ case '2':
++ MachineType=APPLE_II;
+ break;
+ case 'e':
+ MachineType=APPLE_IIE;