head 1.4; access; symbols pkgsrc-2019Q2:1.3.0.120 pkgsrc-2019Q2-base:1.3 pkgsrc-2019Q1:1.3.0.118 pkgsrc-2019Q1-base:1.3 pkgsrc-2018Q4:1.3.0.116 pkgsrc-2018Q4-base:1.3 pkgsrc-2018Q3:1.3.0.114 pkgsrc-2018Q3-base:1.3 pkgsrc-2018Q2:1.3.0.112 pkgsrc-2018Q2-base:1.3 pkgsrc-2018Q1:1.3.0.110 pkgsrc-2018Q1-base:1.3 pkgsrc-2017Q4:1.3.0.108 pkgsrc-2017Q4-base:1.3 pkgsrc-2017Q3:1.3.0.106 pkgsrc-2017Q3-base:1.3 pkgsrc-2017Q2:1.3.0.102 pkgsrc-2017Q2-base:1.3 pkgsrc-2017Q1:1.3.0.100 pkgsrc-2017Q1-base:1.3 pkgsrc-2016Q4:1.3.0.98 pkgsrc-2016Q4-base:1.3 pkgsrc-2016Q3:1.3.0.96 pkgsrc-2016Q3-base:1.3 pkgsrc-2016Q2:1.3.0.94 pkgsrc-2016Q2-base:1.3 pkgsrc-2016Q1:1.3.0.92 pkgsrc-2016Q1-base:1.3 pkgsrc-2015Q4:1.3.0.90 pkgsrc-2015Q4-base:1.3 pkgsrc-2015Q3:1.3.0.88 pkgsrc-2015Q3-base:1.3 pkgsrc-2015Q2:1.3.0.86 pkgsrc-2015Q2-base:1.3 pkgsrc-2015Q1:1.3.0.84 pkgsrc-2015Q1-base:1.3 pkgsrc-2014Q4:1.3.0.82 pkgsrc-2014Q4-base:1.3 pkgsrc-2014Q3:1.3.0.80 pkgsrc-2014Q3-base:1.3 pkgsrc-2014Q2:1.3.0.78 pkgsrc-2014Q2-base:1.3 pkgsrc-2014Q1:1.3.0.76 pkgsrc-2014Q1-base:1.3 pkgsrc-2013Q4:1.3.0.74 pkgsrc-2013Q4-base:1.3 pkgsrc-2013Q3:1.3.0.72 pkgsrc-2013Q3-base:1.3 pkgsrc-2013Q2:1.3.0.70 pkgsrc-2013Q2-base:1.3 pkgsrc-2013Q1:1.3.0.68 pkgsrc-2013Q1-base:1.3 pkgsrc-2012Q4:1.3.0.66 pkgsrc-2012Q4-base:1.3 pkgsrc-2012Q3:1.3.0.64 pkgsrc-2012Q3-base:1.3 pkgsrc-2012Q2:1.3.0.62 pkgsrc-2012Q2-base:1.3 pkgsrc-2012Q1:1.3.0.60 pkgsrc-2012Q1-base:1.3 pkgsrc-2011Q4:1.3.0.58 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q3:1.3.0.56 pkgsrc-2011Q3-base:1.3 pkgsrc-2011Q2:1.3.0.54 pkgsrc-2011Q2-base:1.3 pkgsrc-2011Q1:1.3.0.52 pkgsrc-2011Q1-base:1.3 pkgsrc-2010Q4:1.3.0.50 pkgsrc-2010Q4-base:1.3 pkgsrc-2010Q3:1.3.0.48 pkgsrc-2010Q3-base:1.3 pkgsrc-2010Q2:1.3.0.46 pkgsrc-2010Q2-base:1.3 pkgsrc-2010Q1:1.3.0.44 pkgsrc-2010Q1-base:1.3 pkgsrc-2009Q4:1.3.0.42 pkgsrc-2009Q4-base:1.3 pkgsrc-2009Q3:1.3.0.40 pkgsrc-2009Q3-base:1.3 pkgsrc-2009Q2:1.3.0.38 pkgsrc-2009Q2-base:1.3 pkgsrc-2009Q1:1.3.0.36 pkgsrc-2009Q1-base:1.3 pkgsrc-2008Q4:1.3.0.34 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.32 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.30 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.28 pkgsrc-2008Q2-base:1.3 cwrapper:1.3.0.26 pkgsrc-2008Q1:1.3.0.24 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.22 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.20 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.18 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.16 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.3.0.14 pkgsrc-2006Q4-base:1.3 pkgsrc-2006Q3:1.3.0.12 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.10 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.8 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.6 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.3.0.4 pkgsrc-2005Q3-base:1.3 pkgsrc-2005Q2:1.3.0.2 pkgsrc-2005Q2-base:1.3 pkgsrc-2005Q1:1.2.0.12 pkgsrc-2005Q1-base:1.2 pkgsrc-2004Q4:1.2.0.10 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.8 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.2.0.6 pkgsrc-2004Q2-base:1.2 pkgsrc-2004Q1:1.2.0.4 pkgsrc-2004Q1-base:1.2 pkgsrc-2003Q4:1.2.0.2 pkgsrc-2003Q4-base:1.2 netbsd-1-6:1.1.0.8 netbsd-1-6-RELEASE-base:1.1 pkgviews:1.1.0.4 pkgviews-base:1.1 buildlink2-base:1.1 buildlink2:1.1.0.2; locks; strict; comment @# @; 1.4 date 2019.09.08.11.04.05; author nia; state dead; branches; next 1.3; commitid 6V0NqBf6QvrTlcCB; 1.3 date 2005.04.02.22.23.53; author kristerw; state Exp; branches; next 1.2; 1.2 date 2002.11.19.20.54.21; author agc; state dead; branches; next 1.1; 1.1 date 2002.05.09.22.16.53; author agc; state Exp; branches 1.1.2.1; next ; 1.1.2.1 date 2002.05.09.22.16.53; author jlam; state dead; branches; next 1.1.2.2; 1.1.2.2 date 2002.06.23.18.45.33; author jlam; state Exp; branches; next ; desc @@ 1.4 log @Remove emulators/generator. Ancient, unmaintained, dead upstream, and not wanting to build, for some time. This version is from 2003 and only supports GTK1. Lots of alternatives in this category - blastem, mednafen, even the generator-cbiere fork, if you must. @ text @$NetBSD: patch-ab,v 1.3 2005/04/02 22:23:53 kristerw Exp $ --- main/reg68k.c.orig Sun Apr 3 00:02:45 2005 +++ main/reg68k.c Sun Apr 3 00:04:24 2005 @@@@ -21,7 +21,8 @@@@ /*** global variables ***/ #if (!(defined(PROCESSOR_ARM) || defined(PROCESSOR_SPARC) \ - || defined(PROCESSOR_INTEL))) + || defined(PROCESSOR_INTEL))) \ + || (defined(PROCESSOR_INTEL) && (__GNUC__ <= 2)) uint32 reg68k_pc; uint32 *reg68k_regs; t_sr reg68k_sr; @ 1.3 log @Make this build on NetBSD/1.6.x-i386. The source code use some global register variables, and gcc 2.95 reports errors because the header files contains "static inline" function definitions before the global register variables are defined. Reordering the includes is too much work, so just fall back to normal (non-register) globals when using gcc2. @ text @d1 1 a1 1 $NetBSD$ @ 1.2 log @Fix from Christian Biere in PR 18811 to remove the -malign-double configuration parameter which was causing problems with the stat(2) structure. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.1 2002/05/09 22:16:53 agc Exp $ d3 4 a6 24 --- main/generator.c 2002/05/09 21:34:29 1.1 +++ main/generator.c 2002/05/09 21:34:34 @@@@ -3,9 +3,9 @@@@ #include #include #include -#include #include #include +#include #include #include #include @@@@ -147,7 +147,7 @@@@ char *gen_loadimage(const char *filename) { int file, imagetype, bytes, bytesleft; - struct stat statbuf; + off_t filesize; const char *extension; uint8 *buffer; unsigned int blocks, x, i; @@@@ -162,20 +162,6 @@@@ } d8 7 a14 47 /* Load file */ - if (stat(filename, &statbuf) != 0) - return ("Unable to stat file."); - cpu68k_romlen = statbuf.st_size; - if (cpu68k_romlen < 0x200) - return ("File is too small"); - - /* allocate enough memory plus 16 bytes for disassembler to cope - with the last instruction */ - if ((cpu68k_rom = malloc(cpu68k_romlen + 16)) == NULL) { - cpu68k_romlen = 0; - return ("Out of memory!"); - } - gen_freerom = 1; - memset(cpu68k_rom, 0, cpu68k_romlen + 16); #ifdef ALLEGRO if ((file = open(filename, O_RDONLY | O_BINARY, 0)) == -1) { #else @@@@ -186,6 +172,28 @@@@ cpu68k_romlen = 0; return ("Unable to open file."); } + if ( (filesize = lseek(file, 0, SEEK_END)) == -1 || // get size + lseek(file, 0, SEEK_SET) == -1) // then seek to start + { + perror ("lseek failed"); + close (file); + return ("Error accessing file"); + } + + cpu68k_romlen = filesize; + if (cpu68k_romlen < 0x200) { + (void) close(file); + return ("File is too small"); + } + + /* allocate enough memory plus 16 bytes for disassembler to cope + with the last instruction */ + if ((cpu68k_rom = malloc(cpu68k_romlen + 16)) == NULL) { + cpu68k_romlen = 0; + return ("Out of memory!"); + } + gen_freerom = 1; + memset(cpu68k_rom, 0, cpu68k_romlen + 16); buffer = cpu68k_rom; bytesleft = cpu68k_romlen; do { @ 1.1 log @Add patch from Michael Core's original mail to get the correct size of the ROM. @ text @d1 1 a1 1 $NetBSD$ @ 1.1.2.1 log @file patch-ab was added on branch buildlink2 on 2002-06-23 18:45:33 +0000 @ text @d1 74 @ 1.1.2.2 log @Merge from pkgsrc-current to buildlink2 branch. @ text @a0 74 $NetBSD: patch-ab,v 1.1.2.1 2002/06/23 18:45:33 jlam Exp $ --- main/generator.c 2002/05/09 21:34:29 1.1 +++ main/generator.c 2002/05/09 21:34:34 @@@@ -3,9 +3,9 @@@@ #include #include #include -#include #include #include +#include #include #include #include @@@@ -147,7 +147,7 @@@@ char *gen_loadimage(const char *filename) { int file, imagetype, bytes, bytesleft; - struct stat statbuf; + off_t filesize; const char *extension; uint8 *buffer; unsigned int blocks, x, i; @@@@ -162,20 +162,6 @@@@ } /* Load file */ - if (stat(filename, &statbuf) != 0) - return ("Unable to stat file."); - cpu68k_romlen = statbuf.st_size; - if (cpu68k_romlen < 0x200) - return ("File is too small"); - - /* allocate enough memory plus 16 bytes for disassembler to cope - with the last instruction */ - if ((cpu68k_rom = malloc(cpu68k_romlen + 16)) == NULL) { - cpu68k_romlen = 0; - return ("Out of memory!"); - } - gen_freerom = 1; - memset(cpu68k_rom, 0, cpu68k_romlen + 16); #ifdef ALLEGRO if ((file = open(filename, O_RDONLY | O_BINARY, 0)) == -1) { #else @@@@ -186,6 +172,28 @@@@ cpu68k_romlen = 0; return ("Unable to open file."); } + if ( (filesize = lseek(file, 0, SEEK_END)) == -1 || // get size + lseek(file, 0, SEEK_SET) == -1) // then seek to start + { + perror ("lseek failed"); + close (file); + return ("Error accessing file"); + } + + cpu68k_romlen = filesize; + if (cpu68k_romlen < 0x200) { + (void) close(file); + return ("File is too small"); + } + + /* allocate enough memory plus 16 bytes for disassembler to cope + with the last instruction */ + if ((cpu68k_rom = malloc(cpu68k_romlen + 16)) == NULL) { + cpu68k_romlen = 0; + return ("Out of memory!"); + } + gen_freerom = 1; + memset(cpu68k_rom, 0, cpu68k_romlen + 16); buffer = cpu68k_rom; bytesleft = cpu68k_romlen; do { @