• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

Documentation/H03-May-2022-80,14652,968

include/H10-Nov-2020-879615

intl/H10-Nov-2020-26,69319,638

m4/H10-Nov-2020-4,5584,268

mswin/H10-Nov-2020-472313

po/H03-May-2022-35,84528,508

src/H10-Nov-2020-647,717526,713

tests/H10-Nov-2020-754575

.gitignoreH A D10-Nov-2020398 2927

ABOUT-NLSH A D10-Nov-202091.6 KiB1,2831,244

COPYINGH A D10-Nov-202017.7 KiB340281

ChangeLogH A D10-Nov-2020418.2 KiB8,5625,586

INSTALLH A D10-Nov-202015.4 KiB369287

Makefile.amH A D10-Nov-202074 63

Makefile.inH A D10-Nov-202028 KiB892797

READMEH A D10-Nov-20204 KiB7849

README.DOSH A D10-Nov-20201.5 KiB5235

README.MSWINH A D10-Nov-202054 31

README.PORTINGH A D10-Nov-20201.5 KiB4024

TODOH A D10-Nov-202013.3 KiB322202

acinclude.m4H A D10-Nov-20205.4 KiB176158

aclocal.m4H A D10-Nov-202053.8 KiB1,4971,358

autogen.shH A D10-Nov-2020155 116

compileH A D10-Nov-20207.2 KiB349259

config.guessH A D10-Nov-202043.2 KiB1,4811,288

config.rpathH A D10-Nov-202018 KiB673569

config.subH A D10-Nov-202035.3 KiB1,8021,661

configureH A D10-Nov-2020630.5 KiB21,74518,260

configure.acH A D10-Nov-202030.2 KiB900760

depcompH A D10-Nov-202023 KiB792502

install-shH A D10-Nov-202015 KiB519337

missingH A D10-Nov-20206.7 KiB216143

mkinstalldirsH A D10-Nov-20203.5 KiB163112

package.shH A D10-Nov-2020277 107

stamp-h1H A D10-Nov-202035 21

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