|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | 03-May-2022 | - |
| Documentation/ | H | 03-May-2022 | - | 80,146 | 52,968 |
| include/ | H | 10-Nov-2020 | - | 879 | 615 |
| intl/ | H | 10-Nov-2020 | - | 26,693 | 19,638 |
| m4/ | H | 10-Nov-2020 | - | 4,558 | 4,268 |
| mswin/ | H | 10-Nov-2020 | - | 472 | 313 |
| po/ | H | 03-May-2022 | - | 35,845 | 28,508 |
| src/ | H | 10-Nov-2020 | - | 647,717 | 526,713 |
| tests/ | H | 10-Nov-2020 | - | 754 | 575 |
| .gitignore | H A D | 10-Nov-2020 | 398 | 29 | 27 |
| ABOUT-NLS | H A D | 10-Nov-2020 | 91.6 KiB | 1,283 | 1,244 |
| COPYING | H A D | 10-Nov-2020 | 17.7 KiB | 340 | 281 |
| ChangeLog | H A D | 10-Nov-2020 | 418.2 KiB | 8,562 | 5,586 |
| INSTALL | H A D | 10-Nov-2020 | 15.4 KiB | 369 | 287 |
| Makefile.am | H A D | 10-Nov-2020 | 74 | 6 | 3 |
| Makefile.in | H A D | 10-Nov-2020 | 28 KiB | 892 | 797 |
| README | H A D | 10-Nov-2020 | 4 KiB | 78 | 49 |
| README.DOS | H A D | 10-Nov-2020 | 1.5 KiB | 52 | 35 |
| README.MSWIN | H A D | 10-Nov-2020 | 54 | 3 | 1 |
| README.PORTING | H A D | 10-Nov-2020 | 1.5 KiB | 40 | 24 |
| TODO | H A D | 10-Nov-2020 | 13.3 KiB | 322 | 202 |
| acinclude.m4 | H A D | 10-Nov-2020 | 5.4 KiB | 176 | 158 |
| aclocal.m4 | H A D | 10-Nov-2020 | 53.8 KiB | 1,497 | 1,358 |
| autogen.sh | H A D | 10-Nov-2020 | 155 | 11 | 6 |
| compile | H A D | 10-Nov-2020 | 7.2 KiB | 349 | 259 |
| config.guess | H A D | 10-Nov-2020 | 43.2 KiB | 1,481 | 1,288 |
| config.rpath | H A D | 10-Nov-2020 | 18 KiB | 673 | 569 |
| config.sub | H A D | 10-Nov-2020 | 35.3 KiB | 1,802 | 1,661 |
| configure | H A D | 10-Nov-2020 | 630.5 KiB | 21,745 | 18,260 |
| configure.ac | H A D | 10-Nov-2020 | 30.2 KiB | 900 | 760 |
| depcomp | H A D | 10-Nov-2020 | 23 KiB | 792 | 502 |
| install-sh | H A D | 10-Nov-2020 | 15 KiB | 519 | 337 |
| missing | H A D | 10-Nov-2020 | 6.7 KiB | 216 | 143 |
| mkinstalldirs | H A D | 10-Nov-2020 | 3.5 KiB | 163 | 112 |
| package.sh | H A D | 10-Nov-2020 | 277 | 10 | 7 |
| stamp-h1 | H A D | 10-Nov-2020 | 35 | 2 | 1 |
README
1------------------
2Compilation Notes:
3------------------
4 gcc or LLVM clang is required for compiling Mednafen. Intel's C compiler may work, but is untested.
5 Probably doesn't need to be said, but the compilers optionally specified via CC and CXX *must* be the same version.
6
7 clang: 3.5.0 or newer is required, though gcc 4.9.x is preferable for performance reasons.
8
9 gcc: 4.8(4.8.4+), or 4.9(4.9.2+) or newer is required. gcc 4.9 is recommended; gcc 5.x and gcc 6.x tend to produce
10 slower executables, at least with Mednafen on x86_64.
11
12 Reportedly, passing: --build=x86_64-apple-darwin`uname -r`
13 to the configure script is necessary for building on Mac OS X to work properly.
14
15 Compiling at -O3 or higher, or with other custom optimization flags, is discouraged.
16
17
18---------------------------------------------
19Some notes(and reminders) on the source code:
20---------------------------------------------
21 Check "mednafen/src/types.h" for standard C and C++ library header includes, and avoid #include'ing the same files redundantly elsewhere.
22
23 Avoid %= in save state load variable sanitizing code unless the variable is unsigned.
24
25 malloc(), realloc(), calloc()'ing 0 bytes of memory may return a NULL pointer.
26
27 memcpy()/memmove()/etc. with NULL pointers is undefined and bad even when length is 0.
28
29 Careful to not do something like: void somefunc(int something[16]); [...] sizeof(something)
30
31 Try to avoid writing new code that violates strict overflow(even though we compile with -fwrapv), especially be mindful
32 of stuff like what's described at http://kqueue.org/blog/2013/09/17/cltq/
33
34 Order of operations != Operator precedence. Remember sequence point rules, and don't do stuff like:
35 value = FuncWithSideEffects() | (FuncWithSideEffects() << 8); // BAD BAD
36 See: http://en.cppreference.com/w/cpp/language/eval_order
37
38 Avoid writing new code that shifts left signed integers or negative values to avoid technically undefined behavior; use
39 ugly typecasting, or multiply by powers of 2 instead(remotely modern compilers can optimize it to a shift internally).
40
41 Vanishing temporaries: https://gcc.gnu.org/onlinedocs/gcc/Temporaries.html#Temporaries
42
43 Do not place a period before the field width for "s" and "[" conversion specifiers in *scanf() format strings; perhaps a bad
44 habit picked up long ago from working with a buggy libc or trio?
45
46 Avoid compiling different C++ files with different compiler flags in regards to instruction set used(like -mmmx, -msse, -mfpmath, -march),
47 or else there may be (template-)function ODR violations that could cause compatibility problems.
48
49 GPLv3-incompatible code:
50 WonderSwan emulation code from Cygne.
51 QuickLZ(old version used)
52
53 Don't do greater-than and less-than comparisons between pointers unless they're pointers to members of the same array/struct/etc.
54
55 Avoid using a pointer into a nested array of a multidimensional array to access elements of the multidimensional array that lie outside of that specific
56 nested array, as such behavior is probably undefined.
57
58 Pointer provenance, DR260.
59
60 Don't create temporarily-invalid pointers via careless pointer arithmetic; restructure the expressions if possible, or utilize uintptr_t instead.
61
62 x86_64 inline assembly, stack red zone.
63
64 https://gcc.gnu.org/onlinedocs/gccint/Memory-model.html#Memory-model
65
66 Don't use memcmp() on class/struct objects unless they're initialized with memset() and copied around with only memcpy()(or equivalent).
67
68 Don't rely on malloc(), realloc(), and calloc() setting errno to ENOMEM on a memory allocation error.
69
70
71---------------------------------------------
72Code contributions:
73---------------------------------------------
74 To keep things simpler for commercial licensing, any patches or new code offered for emulation modules "apple2", "psx", "snes_faust", and "ss",
75 along with contributions to core Mednafen functionality with code that is not self-contained(e.g. support for a new CD image format), will be ignored.
76 Distributing a separate patch set or an outright fork(with branding that clearly conveys the forkiness) is recommended.
77
78
README.DOS
1Mednafen's DOS port is NOT FINISHED YET RAWR!
2
3Set "sound.volume" to "150" for moooostly better sound quality with 8-bit Sound Blaster cards.
4
5Set "cd.image_memcache" to "1" to play CD games(requires a lot of RAM, though).
6
7For EMU10K(SB Live, Audigy, Audigy 2):
8 http://easymamecab.mameworld.info/html/snddosdr.htm
9 http://sourceforge.net/projects/mpxplay/files/Audigy12/Audigy12%20v1.0/AUDIGY12.ZIP/download?use_mirror=tcpdiag&download=
10
11
12Miscellaneous DOS-related notes.
13---------------
14
15DJGPP build notes:
16 make am__cd="cd"
17
18ES1370 and ES1371/ES1373/CT5880/EV1938 cards:
19 Audio PCI 1000: ES1370
20
21 Audio PCI 3000: ES1370
22
23 Audio PCI 5000: ES1371
24 Notes: Good frequency response with 48KHz playback.
25
26 Audio PCI 5200: ES1373
27
28 CT4700(Sound Blaster PCI 128): Creative 5507(rebranded ES1370?) - AK4531
29
30 CT4730: EV1938
31 Notes: Has questionable frequency response(too strong of a lowpass effect) on my card, and doesn't work
32 completely correctly with Mednafen's ES1371 driver code.
33
34 CT4740(Sound Blaster 16 PCI): CT5880
35 CT4750(Sound Blaster Vibra128): CT5880
36 CT4810: CT5880 - STAC 9721T or Creative CT1297-TAT or ???
37
38 CT5800:
39 CT5801: - STAC972(or 3?)1T
40 CT5803: ES1373
41 CT5805: ES1373?
42 CT5806: ES1373 - CS4297A-JQ
43 CT5807: ES1373
44 CT5808: CT5880
45 CT5810:
46
47 DCS S727: ES1370
48
49eBay queries:
50 (es1370,es1371,es1373,ct4700,ct4730,ct4740,ct4750,ct4810,"dcs s727", "audio pci 1000", "audio pci 3000", "audio pci 5000", "audio pci 5200")
51 (ct5800,ct5801,ct5803,ct5805,ct5806,ct5807,ct5808,ct5810)
52
README.MSWIN
1Refer to notes and scripts in the "mswin" directory.
2
3
README.PORTING
1--------------------------------------------------------------------------
2Notes for building Mednafen's code outside of Mednafen's own build system:
3 (though you should get most of this if you read configure.ac)
4
5 Last updated November 28, 2014
6--------------------------------------------------------------------------
7
8gcc or LLVM(clang) is generally required, and ICC may work. Other compilers will
9require signficant changes to the codebase due to widespread usage of GNU extensions.
10
11Compile with -fwrapv
12
13Compile "ngp" module(Neo Geo Pop emulation) with -fno-strict-aliasing
14
15Compile with -fomit-frame-pointer(at least on x86/x86_64).
16
17Compile with -fsigned-char.
18
19Compile with -fno-aggressive-loop-optimizations on newer versions of gcc that support it.
20
21Compile in tests.cpp, and the call to the math test function, at least in your debug builds,
22as it contains important compiler sanity checks.
23
24Compile the PSX module with -mmmx -msse -msse2 on 32-bit x86 for better performance.
25
26Compile with -fno-pic -fno-pie on 32-bit x86.
27
28Define ARCH_X86(to 1) when compiling for 32-bit and 64-bit x86, and ARCH_X86_32 for 32-bit x86 and
29ARCH_X86_64 for 64-bit x86_64.
30
31Define ARCH_POWERPC and ARCH_POWERPC_ALTIVEC when compiling for POWER/PowerPC.
32
33Do NOT compile with LTO, unless you use -fno-strict-aliasing(and that may negate the performance
34benefits LTO provides).
35
36Do NOT compile with -ffast-math, some relatively recent versions of gcc are buggy
37and will produce completely wrong machine code for some common constructs
38when -ffast-math is used.
39
40