HACKING ON THE GNUBOY SOURCE TREE BASIC INFO In preparation for the first release, I'm putting together a simple document to aid anyone interested in playing around with or improving the gnuboy source. First of all, before working on anything, you should know my policies as maintainer. I'm happy to accept contributed code, but there are a few guidelines: * Obviously, all code must be able to be distributed under the GNU GPL. This means that your terms of use for the code must be equivalent to or weaker than those of the GPL. Public domain and MIT-style licenses are perfectly fine for new code that doesn't incorporate existing parts of gnuboy, e.g. libraries, but anything derived from or built upon the GPL'd code can only be distributed under GPL. When in doubt, read COPYING. * Please stick to a coding and naming convention similar to the existing code. I can reformat contributions if I need to when integrating them, but it makes it much easier if that's already done by the coder. In particular, indentions are a single tab (char 9), and all symbols are all lowercase, except for macros which are all uppercase. * All code must be completely deterministic and consistent across all platforms. this results in the two following rules... * No floating point code whatsoever. Use fixed point or better yet exact analytical integer methods as opposed to any approximation. * No threads. Emulation with threads is a poor approximation if done sloppily, and it's slow anyway even if done right since things must be kept synchronous. Also, threads are not portable. Just say no to threads. * All non-portable code belongs in the sys/ or asm/ trees. #ifdef should be avoided except for general conditionally-compiled code, as opposed to little special cases for one particular cpu or operating system. (i.e. #ifdef USE_ASM is ok, #ifdef __i386__ is NOT!) * That goes for *nix code too. gnuboy is written in ANSI C, and I'm not going to go adding K&R function declarations or #ifdef's to make sure the standard library is functional. If your system is THAT broken, fix the system, don't "fix" the emulator. * Please no feature-creep. If something can be done through an external utility or front-end, or through clever use of the rc subsystem, don't add extra code to the main program. * On that note, the modules in the sys/ tree serve the singular purpose of implementing calls necessary to get input and display graphics (and eventually sound). Unlike in poorly-designed emulators, they are not there to give every different target platform its own gui and different set of key bindings. * Furthermore, the main loop is not in the platform-specific code, and it will never be. Windows people, put your code that would normally go in a message loop in ev_refresh and/or sys_sleep! * Commented code is welcome but not required. * I prefer asm in AT&T syntax (the style used by *nix assemblers and likewise DJGPP) as opposed to Intel/NASM/etc style. If you really must use a different style, I can convert it, but I don't want to add extra dependencies on nonstandard assemblers to the build process. Also, portable C versions of all code should be available. * Have fun with it. If my demands stifle your creativity, feel free to fork your own projects. I can always adapt and merge code later if your rogue ideas are good enough. :) OK, enough of that. Now for the fun part... THE SOURCE TREE STRUCTURE [documentation] README - general information related to using gnuboy INSTALL - compiling and installation instructions HACKING - this file, obviously COPYING - the gnu gpl, grants freedom under condition of preseving it [build files] Version - doubles as a C and makefile include, identifies version number Rules - generic build rules to be included by makefiles Makefile.* - system-specific makefiles configure* - script for generating *nix makefiles [non-portable code] sys/*/* - hardware and software platform-specific code asm/*/* - optimized asm versions of some code, not used yet asm/*/asm.h - header specifying whLibrary: libFLAC-1.1.2 (Released 2005-02-05) Imported: 2005-02-16 by Dave Chapman This directory contains a local version of libFLAC for use by Rockbox for software decoding and encoding of FLAC files. LICENSING INFORMATION libFLAC (which is only one part of the FLAC distribution) is distributed under Xiph.Org's BSD-like license - see the files AUTHORS and COPYING.Xiph in this directory for details. IMPORT DETAILS The base version first imported into Rockbox was the libFLAC included in the flac-1.1.2.tar.gz distribution, downloaded on 2005-02-06 from Sourceforge. The contents of the flac-1.1.2/src/libFLAC directory (minus the autoconf/automake files and ia32/ppc specific subdirectories) was imported, along with the contents of the flac-1.2.2/include/FLAC directory, which was moved into existing libFLAC/include directory.