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

📄 config

📁 gameboy 模拟器的源代码
💻
📖 第 1 页 / 共 2 页
字号:
GUIDE TO CONFIGURING GNUBOY[ P A R T   I ]  OVERVIEWThere are two major ways of configuring the way gnuboy behaves atruntime: setting the values of variables, and binding commands to keysand joystick buttons. Each can be done either on the command line, orfrom a config (rc) file.If you don't want to read all this detailed info, look at the samplerc files provided, then browse back through this file to clarifyanything that seems confusing. You might also skip down to Part II ifyou're already familiar with the syntax of gnuboy rc files and such;the second part explains the configurable variables which you can playwith.  WHAT HAPPENS AT STARTUPWhen gnuboy is started, it first processes gnuboy.rc, the primaryconfiguration file. On *nix systems, gnuboy will initially look forits rc files in ~/.gnuboy, or if that fails, the present workingdirectory. On DOS and Windows, the current directory will be searchedfirst, followed by the directory containing the gnuboy executable.After finishing with gnuboy.rc, gnuboy next looks for an rc file withthe same base name as the rom to be loaded. For example, if the nameof the rom is mygame.gb, gnuboy will process mygame.rc, if it exists.This allows you to configure different preferences on a per-rombasis. The locations searched for the rom-specific rc file are thesame as those searched for gnuboy.rc, unless gnuboy.rc has changed thesearch path (see below for more info).Finally, options on the command line are processed. The command linewill override any settings in the auto-loaded rc files. This is a goodplace for options that you just want to use occasionally, but not on aregular basis.After all of the above is finished, gnuboy loads the rom and startsemulation.  RC FILESThe rc files gnuboy uses are plain text files, with one command oneach line. Lines that start with # are treated as comments, that is tosay they are ignored, and blank lines are ignored as well.There are three major types of commands.  RC FILES -- SETTING VARIABLESFirst of all, there is the "set" command, which is used for settingthe values of variables. For example,  set scale 2will set the screen scaling factor to 2. If you need to include aspace in the value of a variable, you can do something like this:  set savename "I like spaces in my filenames"and then your save files will be named something like:  I like spaces in my filenames.sav  I like spaces in my filenames.000  I like spaces in my filenames.001  I like spaces in my filenames.002  etc.Finally, some variables allow multiple numbers to be given. Forexample, to set the video mode to 640x480, 16bpp, you might dosomething like this:  set vmode 640 480 16Observe that each number is separate, and there are no quotation marksused.  RC FILES -- KEYBINDINGSNext, we have commands that deal with key and joystick bindings. Theseare fairly simple.The "unbindall" command removes all existing keybindings -- becareful! -- and its main use is for people who want to redefine theirkeyboard controls entirely and throw away the defaults. Be warned thatif you unbind the quit key and don't bind a new key for quitting, youmay be unable to exit gnuboy cleanly!The "unbind" command is similar, but it only unbinds one key at atime. For example, to unbind the "space" key, use this command:  unbind spaceSee below for a list of key names to use with unbind.Now we get to the main useful keybinding command: "bind". For example,if you want the "tab" key to perform the Gameboy "select" buttonfunction, use the following bind command:  bind tab +selectThe significance of the + sign will be explained below. As with the"set" command, quotation marks can be used with bind if the commandneeds to contain spaces.  KEY NAMES FOR BINDINGSWhen using the bind and unbind commands, you need to tell gnuboy whichkey you wish to affect. Most of the keys that correspond to acharacter you can type can just be referenced by that character. Forexample, the alphabetical keys are bound by the lowercase letter theyrepresent, and the numeral keys (on the main keyboard, not the numerickeypad) can be bound by their numeral. Other keys require a name. Someare really obvious:  shift, ctrl, alt, up, down, right, left  enter, tab, space, home, end, esc, pause  f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12Others are a bit less obvious but still should make sense. Some ofthese can also be referenced by other names; read the source filekeytable.c for a full list:  bs            Backspace  ins           Insert  del           Delete  prior         Page Up  next          Page Down  caps          Caps Lock  numlock       Num Lock  scroll        Scroll Lock  minus         - or _  equals        = or +  tilde         ` or ~  slash         / or ?  bslash        \ or |  semi          ; or :  quote         ' or "The numeric keypad is referenced as follows  num0-num9     Numeral keys 0-9 (on keypad)  numplus       Numeric keypad +  numminus      Numeric keypad -  nummul        Numeric keypad *  numdiv        Numeric keypad /  numdot        Numeric keypad .  numenter      Numeric keypad Enter keyJoystick buttons and directions also have names for binding, and theyare bound just like ordinary keys. Their names are as follows:  joyup         Joystick up  joydown       Joystick down  joyleft       Joystick left  joyright      Joystick right  joy0-joy15    Joystick buttonsThe way joystick buttons are numbered varies from one joystick toanother. Experiment to find the names that are right for the buttonsyou want to use.  RC FILES -- THE SOURCE COMMANDThe "source" command simply causes gnuboy to process another rc filebefore resuming processing of the current one. It is useful forsplitting up your config into multiple parts, perhaps one fileauto-generated by a front-end and another hand-customized. Use of thiscommand is very simple:  source myfile.rcwill perform all the commands in myfile.rc. Note that the sourcecommand also provides a method for binding multiple commands to asingle key. For example, simply  bind f1 "source f1stuff.rc"and then f1stuff.rc will be run whenever you press F1.  RC FILES -- ACTION COMMANDSFinally, we have rc commands that perform actions. These commands areprobably only useful when bound to a key, and might cause unexpectedbehavior or even crashes if used by themselves in an rc file loaded atstartup.First of all, the "quit" command should be obvious. It simply exitsthe emulator. If the rom that's loaded uses battery backed save ram orrealtime clock, these files will automatically be saved at exit.The "reset" command should also be fairly obvious. It acts as a resetbutton, restarting execution of the loaded rom at the beginning, as ifyou turned the Gameboy power off and back on.Slightly more interesting are the "savestate" and "loadstate"commands. These are used for saving and resuming "saved state" files,which allow you to save the exact status of the emulation environmentand restore it later, effectively letting you "save game" at any pointin any game. If a number is specified after either of those commands,the indicated save slot number is used. Otherwise, the slot set in the"saveslot" variable will be used. See the information on variablesbelow for more info.Most importantly, we have the action commands that control theemulated Gameboy input pad. They are described below:  COMMANDS THAT BEGIN WITH A PLUS SIGNNormally, gnuboy only performs the command bound to a key when the keyis pressed; nothing happens when it is released. But for some things,particularly the Gameboy pad buttons, it's important for something tohappen when the bound key is released. This is the purpose of commandsthat begin with a + sign. When a key is released, gnuboy checks to seeif the bound command begins with +, and if so, it changes the + to -and performs the resulting command. This causes the Gameboy padbuttons to go back to their normal state when the keys bound to themare released.The Gameboy pad commands, which should be self-explanatory, are asfollows:  +a, +b, +start, +select, +up, +down, +left, +rightIf you're at all familiar with Quake's config system, this should allbe clear.  THE GNUBOY COMMAND LINEAdditional rc files to process, variable settings, and keybindings canbe specified on the command line when gnuboy is run.Processing an extra config file is simple:  gnuboy --source myfile.rc game.gbSpecifying an extra rc file on the command line like this isespecially useful for frontends, which may want to put all the optionsthey set in one rc file so they don't have to pass a super-longcommand line to gnuboy.Binding keys is also pretty simple. Just use something like:  gnuboy --bind tab +select game.gbSetting variables is where things get a bit more complicated. Foron/off (boolean) settings, you can just do something like  gnuboy --no-sound game.gbto turn a variable (sound) off, i.e. set it to 0. Likewise, booleanvariables can be turned on via something like  gnuboy --rgb332 game.gbwhich turns the "rgb332" variable on (see below for information onwhat it does).For other variables where you actually want to set a number or astring, use this form:  gnuboy --savename=mygame2 game.gbFinally, for variables with multiple numbers to be set, you canseparate them by commas as follows:  gnuboy --vmode=512,384,32to avoid having to quote the spaces.[ P A R T   I I ]  GUIDE TO CONFIGURABLE VARIABLESWhat follows is a detailed explanation of most of the configurationvariables available for your tweaking. They are organized by what partof gnuboy's behavior they affect -- graphics, sound, emulation, and soon.Some variables may or may not be available depending on how gnuboy wasbuilt. For example, if you built gnuboy on a system without soundsupport, some variables related to sound may not exist for you, andattempts to set them will be silently ignored. In most cases, it'snoted in the documentation when variables might not be available.Also, there are a few highly system-specific variables, such as namesof devices to use for video and sound on *nix systems. These arelisted separately at the end, and it should go without saying thatthey will not be available on all builds of gnuboy.  VIDEO AND GRAPHICS SETTINGSSince this is everyone's favorite thing to customize, video seems agood place to start.  SCREEN SCALINGThere are a number of variables that control how gnuboy scales thedisplay. The most basic is the "scale" option, which is just thefactor to scale by. For example  set scale 2will double the size of the display. Set the scale factor to 1 for noscaling.There are two ways gnuboy can go about doing scaling. The preferableway is to use your computer's graphics hardware to do all the work.This cuts down on the amount of CPU time consumed and provides

⌨️ 快捷键说明

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