⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.old

📁 gameboy 模拟器的源代码
💻 OLD
字号:
GNUBOY README  INTROWelcome to gnuboy, one of the few pieces of Free Software to emulatethe Game Boy handheld game console. Written in ANSI C with a fewoptional assembler optimizations for particular cpus, gnuboy supportsa wide range of host systems, and has been tested successfully on:  GNU/Linux  FreeBSD  OpenBSD  BeOS  Linux/390 (IBM S/390 Mainframe)  SunOS/Sun Ultra60  IRIX/SGI O2  IRIX/SGI Indy  AIX/Unknown  DR-DOS  MS-DOS  Windows DOS box  Windows 9x/NT/2kAdditionally, gnuboy should run on any other *nix variants that haveANSI C compilers and that are remotely POSIX compliant. As gnuboy isFree Software, you're welcome to fix any problems you encounterbuilding it for a particular system, or to port it to entirely newsystems.For build instructions, see the file INSTALL. For information on thestructure of the source tree, program flow, design decisions andguidelines, porting, and so on, read HACKING.  GENERAL USAGEJust pass the name of the rom to load on the command line. Defaultkeybindings are as follows:  esc         - exit  arrow keys  - d-pad  alt         - a  ctrl        - b  space       - select  enter       - start  0-9         - select savestate slot  ins         - save current state  del         - return to saved state  joypad      - d-pad  joy0        - b  joy1        - a  joy2        - select  joy3        - start(Note: joystick is not available on all platforms at this time.)If you want to change these or other options, you should create agnuboy.rc file. See the system-specific info below for where to putit.The rc subsystem is very similar to Quake's console in manyrespects. You have commands and variables. First, the commands:  quit        - exit gnuboy (saving sram)  reset       - reset to powerup state  source      - process another rc file  set         - set a variable's value  bind        - bind keys  unbind      - remove a keybinding  unbindall   - remove all keybindings  savestate   - save current state  loadstate   - return to saved stateAdditionally, each gameboy pad button has two commands, one to pressit, and another to release it -- for example, +start and -start. Whena key is bound to one of these commands that starts with a +, it willperform the corresponding - command when it's released, as expected.Here's a list of the + commands, though they should be obvious:  +start  +select  +a  +b  +up  +down  +left  +rightNow for the variables. To set any of the rc variables, just put thecommand of the form "set variable value" in your gnuboy.rc or other rcfile. Some of the more interesting variables are:  rcpath      - search path for loading extra rc files  savedir     - the directory where save files will be stored  savename    - base of filename to use for sram and savestates  forcedmg    - set to 1/true/yes to force color roms to play mono  framelen    - delay in microseconds between frames  framecount  - run only the given number of frames, then exit  dmg_bgp     - specify 4 custom colors to be used for mono background  dmg_wndp    - same thing, but for the window layer  dmg_obp0    - and for sprite palette 0  dmg_obp1    - and sprite palette 1  scale       - factor for screen scaling; currently only 1 and 2 work  density     - density level for screen scaling; see description below  sprsort     - x-sort sprites for correctness on dmg roms  syncrtc     - fake elapsed time on rtc since last session at startup  trace       - output a complete cpu trace to stdout  sprdebug    - display bars indicating sprite count per lineThere are a few others which may or not be useful. Also, certainsystem and display targets have their own variables, which will bedescribed in the relevant sections below. For more info on how thevariables work, read the source.For sample rc files, look in the etc/ directory.Finally, to display help, version, or copying information, use the--help, --version, or --copying options respectively on the gnuboycommand line.  USAGE - *NIX SYSTEMSThe file gnuboy.rc should be placed in ~/.gnuboy/. If it is not foundin this location, the current working directory will besearched. The following defaults will be used:  rcpath      - ~/.gnuboy:.  savedir     - ~/.gnuboy/savesIf you don't like these, override them with gnuboy.rc.There are presently four *nix targets supported: X11, SDL, and Linuxfbcon and svgalib. In the future other fb devices (such as the Sunconsole) should be supported as well.If you have problems with gnuboy running too slowly on svgalib, turnoff the vsync option, i.e. set vsync 0. Putting --no-vsync on thecommand line works as well. At this point svgalib is the only one thatsupports vsync, so it's a non-issue on the others.  USAGE - DOS and WindowsPlace your gnuboy.rc in the same directory as gnuboy.exe. You need tospecify a save directory in it; otherwise the working directory willbe used, which is probably not what you want. For example, if you'veinstalled gnuboy.exe in c:/gnuboy, and you want your saves to bestored in c:/gnuboy/saves, place the following in a plain text filecalled gnuboy.rc in c:/gnuboy.  set savedir c:/gnuboy/savesBy default stereo sound is disabled on DOS since it doesn't work righton some of the systems we've tested; to enable it, add the followingline to your gnuboy.rc:  set stereo 1  VIDEO MODESNow all the display targets except Linux fbcon support the uniform"vmode" rcvar to set the video mode. From the rc file, you can specifya video mode like this (for 640x480, 16bpp):  set vmode 640 480 16Or you can specify the mode on the command line, as  --vmode=640,480,16If the requested video mode is not available, gnuboy may either givean error message or use a similar available mode.  SCREEN SCALINGScaling by integral factors 1-4 is now supported. Just set the rcvar"scale" to the desired scaling factor. Most of the display targetswill automatically choose a video mode appropriate to the chosenscale, but DOS and Linux fbcon users should be aware they they need toset the mode manually, as described above. Of course, if you prefer,you can always set it manually.By default, for performance reasons, vertical scaling will not befully dense but will leave some blank scanlines. This behavior can beadjusted by means of the "density" rcvar. Density 0, the default,skips every other line. Nonzero values N fill in the first N copies ofthe scanline, and leave the remaining scale-N scanlines blank. So, ifyou want a fully filled in display (and the worst performance), youshould set density to the same value as scale.Please be aware that this code is still slightly experimental, and theways of configuring scaling may change considerably in the next fewreleases.  HARDWARE ACCELERATED YUV-SPACE SCREEN SCALINGIf you're using the SDL display target and your video card/driversupports it, hardware screen scaling is available. This featureprovides scaling to any size with almost no cpu usage! It's enabled bydefault if the screen resolution is set to 320x288 or higher; manuallyset the "yuv" rcvar to 0 or 1 to force it off or on, respectively.Scaling will be performed to fill the entire requested video mode.For example, to scale to 640x480, either add the following line toyour gnuboy.rc:  set vmode 640 480or put --vmode=640,480 on the command line. A better alternative is tojust request a particular scale, for example with:  set scale 4or --scale=4 on the command line; this way the gameboy's near 1:1aspect ratio won't become distorted.  SOUND SUPPORTAt this point all features are implemented and everything should beright, so any incorrect sound output should be treated as a bug, whichwe'll try to fix as soon as possible.  JOYSTICK AND GAMEPAD SUPPORTAt this time, the Linux and SDL joystick devices are the only onessupported. We hope to have DOS joystick support soon.Binding joystick controls works the same way as for the keyboard. Justuse the key names joyup, joydown, joyright, joyleft, joy0, joy1, joy2,etc. Default bindings should probably be ok for most users, exceptthat A/B might be backwards on some gamepads.  PERFORMANCEHere are some performance estimates i've gathered (given in percentcpu utilization, running at full 60 fps)...                                 Optimized C        Assembly  AMD K6-2/450                       12%               8%  Pentium/75                     (too slow)           70%  SGI O2                             25%            (no asm)  SGI Indy                           70%            (no asm)  Sun Ultra60                       3-20%           (no asm)  IBM S/390                      about 0.3%         (no asm)Note that these figures were computed before sound was implemented.Until the sound code is further optimized, gnuboy may run somewhatslower than these numbers suggest.  SUPPORTED MEMORY BANK CONTROLLERS (MBCS)At this time, gnuboy supports MBC1, MBC2, MBC3 (including realtimeclock), and MBC5 (including the version with rumble support, althoughthat functionality is omitted).  GRAPHICS SUPPORTColor Gameboy roms are supported completely, including so-called"highcolor" tricks. Yes, even in 256-color mode, although in gamesthat use too many colors on one screen, the later ones will only beapproximated. Use a 16 bpp (or higher) display mode if this is aproblem.Alternatively, for games that look bad in 256 color mode, you canrun in simulated 3/3/2 bits per channel truecolor. Just set thevariable rgb332 to something nonzero (or just putting --rgb332 on thecommand line will work). Color precision is lost somewhat, especiallyin smooth gradients, but for the most part it looks very good.Much care has been put into ensuring that the lcd timings andinterrupts behave as closely to the real hardware as possible. A fewfeatures remain unimplemented, such as reduced length HBLANK dependingon the number of sprites visible on the scanline, but the vastmajority of display tricks used in current roms work fine.We do, however, lack information on proper GDMA timings, which couldtheoretically cause problems for some roms. If you can provide us withaccurate information, please do!  COMPATIBILITYEventually I'll put detailed information here. For now, just see knownbugs for the few cases where roms fails.  KNOWN BUGSThe portal between the temple and the Talon in FFL3 is glitched andthe game freezes for a second or two building the incorrect animationwhen entering those screens.GDMA finishes instantly, whereas it should take time. Making it taketime breaks Wacky Races, last I checked, so apparently the documents Ihave on GDMA timing are incorrect. Same goes for HDMA. Goodinformation would be much appreciated.The main loop in emu_run is very sloppy and not quite right, but itworks.Sound mixing is taking way too much cpu time. I have some ideas forfixing this, and I plan to write optimized assembly code for soundeventually. If it's a problem try turning down the sample rate.YUV-space hardware scaling only supports the common "YUY2" mode sofar. More modes will be added in the future.  REPORTING OR FIXING BUGSFound a bug not mentioned above, or better yet, fixed one? Send bugreports or patches to gnuboy@starfox.org. Please be aware thatdistribution of any code based on gnuboy must follow the provisions ofthe GPL, so if you don't agree to this, don't send code to us oranyone else. Let us know if you wish to be included in the credits.For guidelines regarding code contributions, see the file HACKING.Please be aware that evaluating contributed code and figuring out ifor how to work it in can take time. If we haven't done anything withyour code yet, please be patient.  THANKSThanks goes out to everyone who's expressed interest in gnuboy bywriting -- users, porters, authors of other emulators, and so forth.Apologies if we don't get a personal response out to everyone, buteither way, consider your feedback well appreciated.  EPILOGUEOK, that looks like about it. More to come, stick around...  -Laguna

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -