📄 config
字号:
filtering to smooth out the blocky pixels, but it's not available onall systems. The other way is for gnuboy to scale the screen itself.Normally gnuboy will choose hardware scaling automatically if it'savailable, but if you want to force it on or off, you can set theoption "yuv" (for hardware YUV-colorspace scaling) to 1 or 0. Yes,this option is poorly named, and is likely to change in futureversions of gnuboy.On one display platform, Linux fbcon, it's possible to disable theinterpolation filter in the hardware scaling. To do this, set thevariable "yuvinterp" to 0. Some users who like a crisper display mayprefer this setting, especially on video cards that make the picturelook "muddy" when they scale it. Unfortunately SDL does not seem toprovide such an option, so interpolation is always enabled on the SDLbased ports.When hardware scaling is disabled or not available, gnuboy will do itsown scaling. However, the scale factor is limited to 1, 2, 3, or 4.Also, when performing its own scaling, gnuboy defaults to leaving somescanlines blank. This saves a lot of CPU time and allows gnuboy to runfull speed on slower systems. You can configure what portion getsfilled in with the "density" variable. For example. set scale 4 set density 4will give you 4x scaling with no blank scanlines. Keep in mind that afairly fast computer (at least 400 MHz or so on x86, or somethingcomparable on other types of CPUs) is required to run fullspeed withthis setting. In general, "density" is the number of lines that getfilled in, so set it the same as "scale" if you want everything filledin, or lower if you need more speed. VIDEO MODEThe variable for setting the desired video mode is called "vmode", andit's made up of three parts: width, height, and bits-per-pixel. Forexample, to set 640x480x16bpp mode, use set vmode 640 480 16By default gnuboy will enable hardware scaling and try to scale to theentire screen size if a video mode at least 320x288 is specified. Ifyou don't want this behavior, set the "yuv" option (see above) to 0.Also, if you're setting the "scale" variable to do scaling, youprobably don't need to use the "vmode" option, since gnuboy willtry to automatically pick a mode that fits the scale. It's there incase you need it, though.Note that the DOS port is not yet capable of auto-choosing a videomode, so if you want anything but the default 320x200x8bpp you'll haveto set "vmode" yourself. Also, not all ports are capable of all modes.Experiment to find what works for you. Video mode selection is alittle bit messy and confusing at this time, and we hope to improve ita good deal in the future. FULLSCREEN VIDEOSome versions of gnuboy provide both fullscreen and windowedoperation. The variable "fullscreen" can be set to 1 or 0 to enable ordisable fullscreen mode. Also, the variable "altenter" can be set toenable or disable switching between fullscreen and windowed mode atruntime with the Alt+Enter key combination. Unfortunately, this doesnot yet work on Windows; we hope to fix this limitation in thefuture. DMG PALETTE SELECTIONgnuboy allows you to set the palette used for grayscale when runningDMG (original mono Gameboy) roms. There are four variables for thispurpose, allowing the background, window, and both sprite palettes tobe colored differently. Each one is made up of four numbers, the colorto use for each shade of gray, from lightest to darkest. Colors arerepresented as 24bit numbers, with red in the low (rightmost) placesand blue in the upper (leftmost) places. Although you could specifycolors in decimal (base 10) if you really wanted, they'd be verydifficult to read, so it's preferable to use hex (base 16).For example, to set the background to shades of white, the window toshades of red, and the sprite palettes to shades of green and blue,you could use: set dmg_bgp 0xffffff 0xaaaaaa 0x555555 0x000000 set dmg_wndp 0x0000ff 0x0000aa 0x000055 0x000000 set dmg_obp0 0x00ff00 0x00aa00 0x005500 0x000000 set dmg_obp1 0xff0000 0xaa0000 0x550000 0x000000This will of course look rather ugly, but it does the job illustratinghow you set various colors.For more extensive examples, see the sample file palette.rc includedwith gnuboy, which provides a number of sample palettes to try. RGB MODE WITH ONLY 256 COLORSNormally when run in 256-color (8bpp) modes, gnuboy will dynamicallyallocate colors in the palette as they're needed. However, on theGameboy Color, it's possible to have well over 1000 colors on thescreen at a time, and in games that make use of these "hicolor"tricks, gnuboy will run out of colors and things will look bad.If you prefer, you can set the "rgb332" variable: set rgb332 1This tells gnuboy that instead of using 256-color mode as apalette-based mode, you want it to setup a static palette and pretend8bpp is just a really low quality "truecolor" mode, with only 3 bitsof precision in red and green, and only 2 bits of precision in blue.In general this will make most games look worse, since colors have tobe approximated fairly poorly and since smooth color gradients are notpossible, but it will make "hicolor" Gameboy Color games look a gooddeal better. Also, rgb332 mode should run slightly faster since itavoids the overhead in dynamic palette allocation.If you have to run at 8bpp mode, try it with and without this optionand see which way you like better. Of course, the better solution, ifat all possible, is to use 16bpp or higher mode, but that may run tooslowly on older computers. COLOR FILTERINGOptionally, gnuboy can filter screen colors to make them look morewashed out or faded like on a real GBC. To enable this feature, set colorfilter 1By default, gnuboy will not apply the filter when running DMG (mono)games, since many of the sample palettes are already designed toimmitate a Gameboy LCD. If you would like to have the filter also takeeffect when running in DMG mode, set filterdmg 1You can also customize the filter parameters to get different coloreffects from the default ones. See the sample file filters.rc forexamples. SPRITE SORTINGNormally sprites are sorted and prioritized according to their xcoordinate when in DMG mode. However, this takes a little bit of extracpu time, and it's not needed by most DMG games, so it can be disabledas follows: set sprsort 0Note that although sprite sorting was disabled in previous releasesbecause it was not working properly, it now works great, so unless youreally need to maximize performance, you should probably leave itenabled. SOUND OPTIONSFortunately sound is a lot simpler than video. At this time, there areno fancy interpolation or filtering options, only your basic audioparameters.To enable or disable sound, set the "sound" variable to 1 or 0. Bydefault, it's enabled.To enable or disable stereo sound, set the "stereo" variable to 1 or0. It defaults to 1 on most ports, but since stereo sometimes failsto work properly on DOS, it's disabled by default on the DOS port.Disabling stereo in no way improves performance, so it should only bedone if stereo mode causes a problem on your computer.To set the audio sampling rate, use the "samplerate" variable. Thedefault is 44100 Hz. Setting this lower can improve performance. Forexample, if you have a really slow computer, you might use: set samplerate 8000Keep in mind that this will sound really really bad. FILESYSTEM OPTIONSThere are a good deal of options that affect where and how files aresaved and loaded by gnuboy. First, there's "rcpath", which specifieswhere gnuboy searches for rc files. The default depends on youroperating system; see the beginning of this file for details.The search path for rc files can contain multiple directories.Normally, the list is separated by colons (:), but on DOS and Windowsthe colon is used for drive letters, so semicolon (;) must be usedinstead. Here are some examples, first for *nix: set rcpath "/home/laguna/.gnuboy:/usr/local/etc/gnuboy" set rcpath "."and for DOS/Windows: set rcpath "c:/gnuboy;." set rcpath "c:/Program Files/Gnuboy"If you really insist on using backslashes on DOS or Windows, you'llhave to double them up, since the backslash normally means "treat thenext character literally." For example, set rcpath "c:\\gnuboy"This is untested, and your milage may vary. I recommend just usingforward slashes and keeping things simple. SAVE RELATED OPTIONSThese are all fairly simple, so I'll just list them quickly, then givea couple examples. savedir - directory to store saved games (SRAM and savestates) in savename - base filename to use for saves saveslot - which savestate slot to use forcebatt - always save SRAM even on carts that don't have battery nobatt - never save SRAM syncrtc - resync the realtime clock for elapsed time when loadingThe "savename" variable is particularly useful if you wish to havemore than one save associated with a particular rom. Just do somethinglike: gnuboy --savename=mygame2 mygame.gband the save files will be called mygame2.sav, mygame2.000, etc ratherthan just mygame.sav, etc.The "saveslot" variable is normally just changed by keybindings, soyou can pick a savestate slot while you're playing a game. However, ifyou for example prefer that the default slot at startup be 1 ratherthan 0, you can use: set saveslot 1The "forcebatt" and "nobatt" options are fairly self-explanatory andnot very useful, except perhaps for debugging or use with corruptedroms.The "syncrtc" option needs a bit of explanation. Some roms, notablyPokemon ones and Harvest Moon, use a realtime clock to keep track ofthe time of day even when they're not running. Since gnuboy is just anemulator, it can't work like a real cartridge and make things likethis keep happening while the emulator is not running. However, it canresync the Gameboy realtime clock based on your computer's clock whenit starts. This is what the "syncrtc" option does. By default it'senabled. If you disable it, then no time will seem to have elapsedbetween when you exit the emulator once and when you start it againthe next time. JOYSTICK OPTIONSSo far there is just one joystick option, "joy", used to enable ordisable joystick support. DEBUGGING OPTIONSThese probably won't be useful to most people, but if you're trying todebug a homebrew game you're writing or fix a bug in gnuboy they mightbe of help:The "trace" variable, if enabled, dumps a full execution trace tostdout. Be prepared for at least 20 megs of logs to look through atminimum, and more like 150 megs if you want enough to find anythinguseful. Redirecting stdout to a file is a must!The "sprdebug" variable is used to see how many sprites are visibleper line. Try it and see! PLATFORM-SPECIFIC OPTIONSOn certain *nix systems, you may need to specify device nodes to useif the defaults don't work: oss_device - Open Sound System "DSP" device fb_device - Video framebuffer device joy_device - Joystick device The Linux fbcon version of gnuboy does not support the "vmode" optionyet, but it can set the mode for you by running the "fbset" program,if you have it. Just set the "fb_mode" variable to the exact name ofthe mode you want in /etc/fb.modes. For example, set fb_mode 640x480-90You can also override the default color depth with the "fb_depth"variable.The DOS port of gnuboy has support for real console system gamepadsvia the "Directpad Pro" (DPP) connector. To enable this feature, set"dpp" to 1, set "dpp_port" to the IO port number the pad is connectedto (e.g. 0x378 -- be sure to prefix it with 0x for hex!!), and set"dpp_pad" to the number of the pad you want to use. This code has notbeen heavily tested, so it may or may not work for you. Be sure to getthe port number right or bad things may happen! CONCLUSIONWell, that's about it for configuration. Hopefully this documentclears up a lot of the confusion about what you can and can'tconfigure in gnuboy yet, and how you go about doing it. Again, checkthe sample.rc, palette.rc, and classic.rc files for lots of examplesof how rc files work.As always, more info will come as time passes on. Keep on the lookoutfor new releases and more features. Thank you for flying gnuboy andhave a nice day. - Laguna
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -