diff --git a/programs/emulator/DosBox/dosbox b/programs/emulator/DosBox/dosbox new file mode 100644 index 0000000000..ae76fb9a7b Binary files /dev/null and b/programs/emulator/DosBox/dosbox differ diff --git a/programs/emulator/DosBox/dosbox.conf b/programs/emulator/DosBox/dosbox.conf new file mode 100644 index 0000000000..c2abecb38a --- /dev/null +++ b/programs/emulator/DosBox/dosbox.conf @@ -0,0 +1,233 @@ +# This is the configurationfile for DOSBox 0.73. +# Lines starting with a # are commentlines. +# They are used to (briefly) document the effect of each option. + +[sdl] +# fullscreen: Start dosbox directly in fullscreen. +# fulldouble: Use double buffering in fullscreen. +# fullresolution: What resolution to use for fullscreen: original or fixed size (e.g. 1024x768). +# windowresolution: Scale the window to this size IF the output device supports hardware scaling. +# output: What video system to use for output. +# Possible values: surface, overlay, opengl, openglnb, ddraw. +# autolock: Mouse will automatically lock, if you click on the screen. +# sensitivity: Mouse sensitivity. +# waitonerror: Wait before closing the console if dosbox has an error. +# priority: Priority levels for dosbox. Second entry behind the comma is for when dosbox is not focused/minimized. (pause is only valid for the second entry) +# Possible values: lowest, lower, normal, higher, highest, pause. +# mapperfile: File used to load/save the key/event mappings from. +# usescancodes: Avoid usage of symkeys, might not work on all operating systems. + +fullscreen=false +fulldouble=false +fullresolution=original +windowresolution=original +output=surface +autolock=true +sensitivity=100 +waitonerror=true +priority=higher,normal +mapperfile=mapper.txt +usescancodes=true + +[dosbox] +# language: Select another language file. +# machine: The type of machine tries to emulate. +# Possible values: hercules, cga, tandy, pcjr, ega, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, vesa_nolfb, vesa_oldvbe. +# captures: Directory where things like wave, midi, screenshot get captured. +# memsize: Amount of memory DOSBox has in megabytes. +# This value is best left at its default to avoid problems with some games, +# though few games might require a higher value. +# There is generally no speed advantage when raising this value. + +language= +machine=svga_s3 +captures=capture +memsize=16 + +[render] +# frameskip: How many frames DOSBox skips before drawing one. +# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!. +# scaler: Scaler used to enlarge/enhance low resolution modes. If 'forced' is appended,the scaler will be used even if the result might not be desired. +# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x. + +frameskip=0 +aspect=false +scaler=normal2x + +[cpu] +# core: CPU Core used in emulation. auto will switch to dynamic if available and appropriate. +# Possible values: auto, dynamic, normal, simple. +# cputype: CPU Type used in emulation. auto is the fastest choice. +# Possible values: auto, 386, 386_slow, 486_slow, pentium_slow, 386_prefetch. +# cycles: Amount of instructions DOSBox tries to emulate each millisecond. Setting this value too high results in sound dropouts and lags. Cycles can be set in 3 ways: +# 'auto' tries to guess what a game needs. +# It usually works, but can fail for certain games. +# 'fixed #number' will set a fixed amount of cycles. This is what you usually need if 'auto' fails. +# (Example: fixed 4000) +# 'max' will allocate as much cycles as your computer is able to handle +# +# Possible values: auto, fixed, max. +# cycleup: Amount of cycles to increase/decrease with keycombo. +# cycledown: Setting it lower than 100 will be a percentage. + +core=auto +cputype=auto +cycles=auto +cycleup=500 +cycledown=20 + +[mixer] +# nosound: Enable silent mode, sound is still emulated though. +# rate: Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality. +# Possible values: 22050, 44100, 48000, 32000, 16000, 11025, 8000, 49716. +# blocksize: Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged. +# Possible values: 2048, 4096, 8192, 1024, 512, 256. +# prebuffer: How many milliseconds of data to keep on top of the blocksize. + +nosound=false +rate=22050 +blocksize=2048 +prebuffer=10 + +[midi] +# mpu401: Type of MPU-401 to emulate. +# Possible values: intelligent, uart, none. +# mididevice: Device that will receive the MIDI data from MPU-401. +# Possible values: default, win32, alsa, oss, coreaudio, coremidi, none. +# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use. See README for details. + +mpu401=intelligent +mididevice=default +midiconfig= + +[sblaster] +# sbtype: Type of sblaster to emulate. +# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, none. +# sbbase: The IO address of the soundblaster. +# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300. +# irq: The IRQ number of the soundblaster. +# Possible values: 7, 5, 3, 9, 10, 11, 12. +# dma: The DMA number of the soundblaster. +# Possible values: 1, 5, 0, 3, 6, 7. +# hdma: The High DMA number of the soundblaster. +# Possible values: 1, 5, 0, 3, 6, 7. +# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer. +# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'. +# Possible values: auto, cms, opl2, dualopl2, opl3, none. +# oplemu: Provider for the OPL emulation. compat or old might provide better quality (see oplrate as well). +# Possible values: default, compat, fast, old. +# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly). +# Possible values: 22050, 49716, 44100, 48000, 32000, 16000, 11025, 8000. + +sbtype=sb16 +sbbase=220 +irq=7 +dma=1 +hdma=5 +sbmixer=true +oplmode=auto +oplemu=default +oplrate=22050 + +[gus] +# gus: Enable the Gravis Ultrasound emulation. +# gusrate: Sample rate of Ultrasound emulation. +# Possible values: 22050, 44100, 48000, 32000, 16000, 11025, 8000, 49716. +# gusbase: The IO base address of the Gravis Ultrasound. +# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300. +# gusirq: The IRQ number of the Gravis Ultrasound. +# Possible values: 5, 3, 7, 9, 10, 11, 12. +# gusdma: The DMA channel of the Gravis Ultrasound. +# Possible values: 3, 0, 1, 5, 6, 7. +# ultradir: Path to Ultrasound directory. In this directory +# there should be a MIDI directory that contains +# the patch files for GUS playback. Patch sets used +# with Timidity should work fine. + +gus=false +gusrate=22050 +gusbase=240 +gusirq=5 +gusdma=3 +ultradir=C:\ULTRASND + +[speaker] +# pcspeaker: Enable PC-Speaker emulation. +# pcrate: Sample rate of the PC-Speaker sound generation. +# Possible values: 22050, 44100, 48000, 32000, 16000, 11025, 8000, 49716. +# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'. +# Possible values: auto, on, off. +# tandyrate: Sample rate of the Tandy 3-Voice generation. +# Possible values: 22050, 44100, 48000, 32000, 16000, 11025, 8000, 49716. +# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible). + +pcspeaker=true +pcrate=22050 +tandy=auto +tandyrate=22050 +disney=true + +[joystick] +# joysticktype: Type of joystick to emulate: auto (default), none, +# 2axis (supports two joysticks), +# 4axis (supports one joystick, first joystick used), +# 4axis_2 (supports one joystick, second joystick used), +# fcs (Thrustmaster), ch (CH Flightstick). +# none disables joystick emulation. +# auto chooses emulation depending on real joystick(s). +# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none. +# timed: enable timed intervals for axis. (false is old style behaviour). +# autofire: continuously fires as long as you keep the button pressed. +# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks. +# buttonwrap: enable button wrapping at the number of emulated buttons. + +joysticktype=auto +timed=true +autofire=false +swap34=false +buttonwrap=true + +[serial] +# serial1: set type of device connected to com port. +# Can be disabled, dummy, modem, nullmodem, directserial. +# Additional parameters must be in the same line in the form of +# parameter:value. Parameter for all types is irq. +# for directserial: realport (required), rxdelay (optional). +# (realport:COM1 realport:ttyS0). +# for modem: listenport (optional). +# for nullmodem: server, rxdelay, txdelay, telnet, usedtr, +# transparent, port, inhsocket (all optional). +# Example: serial1=modem listenport:5000 +# Possible values: dummy, disabled, modem, nullmodem, directserial. +# serial2: see serial1 +# Possible values: dummy, disabled, modem, nullmodem, directserial. +# serial3: see serial1 +# Possible values: dummy, disabled, modem, nullmodem, directserial. +# serial4: see serial1 +# Possible values: dummy, disabled, modem, nullmodem, directserial. + +serial1=dummy +serial2=dummy +serial3=disabled +serial4=disabled + +[dos] +# xms: Enable XMS support. +# ems: Enable EMS support. +# umb: Enable UMB support. +# keyboardlayout: Language code of the keyboard layout (or none). + +xms=true +ems=true +umb=true +keyboardlayout=auto + +[ipx] +# ipx: Enable ipx over UDP/IP emulation. + +ipx=false + +[autoexec] +# Lines in this section will be run at startup. +keyb ru 866 + diff --git a/programs/emulator/DosBox/readme.txt b/programs/emulator/DosBox/readme.txt new file mode 100644 index 0000000000..3c202aa562 --- /dev/null +++ b/programs/emulator/DosBox/readme.txt @@ -0,0 +1,1469 @@ +DOSBox v0.74 Manual (always use the latest version from www.dosbox.com) + + + +===== +NOTE: +===== + +While we are hoping that one day DOSBox will run all programs ever made for +the PC, we are not there yet. +At present, DOSBox running on a high-end machine will roughly be the equivalent +of a Pentium I PC. DOSBox can be configured to run a wide range of DOS games, +from CGA/Tandy/PCjr classics up to games from the Quake era. + + + +====== +INDEX: +====== + +1. Quickstart +2. Start (FAQ) +3. Command Line Parameters +4. Internal Programs +5. Special Keys +6. Joystick/Gamepad +7. KeyMapper +8. Keyboard Layout +9. Serial Multiplayer feature +10. How to speed up/slow down DOSBox +11. Troubleshooting +12. DOSBox Status Window +13. The configuration (options) file +14. The language file +15. Building your own version of DOSBox +16. Special thanks +17. Contact + + + +============== +1. Quickstart: +============== + +Type INTRO in DOSBox for a quick tour. +It is essential that you get familiar with the idea of mounting, DOSBox does not +automatically make any drive (or a part of it) accessible to the emulation. See +the FAQ entry "How to start?" as well as the description of the MOUNT command +(section 4: "Internal Programs"). If you have your game on a cdrom you may try +this guide: http://vogons.zetafleet.com/viewtopic.php?t=8933 + + + +=============== +2. Start (FAQ): +=============== + +START: How to start? +AUTOMATION: Do I always have to type these "mount" commands? +FULLSCREEN: How do I change to fullscreen? +CD-ROM: My CD-ROM doesn't work. +CD-ROM: The game/application can't find its CD-ROM. +MOUSE: The mouse doesn't work. +SOUND: There is no sound. +SOUND: What sound hardware does DOSBox presently emulate? +SOUND: The sound stutters or sounds stretched/weird. +KEYBOARD: I can't type \ or : in DOSBox. +KEYBOARD: Right Shift and "\" doesn't work in DOSBox. (Windows only) +KEYBOARD: The keyboard lags. +CONTROL: The character/cursor/mouse pointer always moves into one direction! +SPEED: The game/application runs much too slow/too fast! +CRASH: The game/application does not run at all/crashes! +CRASH: DOSBox crashes on startup! +GAME: My Build game(Duke3D/Blood/Shadow Warrior) has problems. +SAFETY: Can DOSBox harm my computer? +OPTIONS: I would like to change DOSBox's options. +HELP: Great Manual, but I still don't get it. + + + +START: How to start? + At the beginning you've got a Z:\> instead of a C:\> at the prompt. + You have to make your directories available as drives in DOSBox by using + the "mount" command. For example, in Windows "mount C D:\GAMES" will give + you a C drive in DOSBox which points to your Windows D:\GAMES directory + (that was created before). In Linux, "mount c /home/username" will give you + a C drive in DOSBox which points to /home/username in Linux. + To change to the drive mounted like above, type "C:". If everything went + fine, DOSBox will display the prompt "C:\>". + + +AUTOMATION: Do I always have to type these commands? + In the DOSBox configuration file is an [autoexec] section. The commands + present there are run when DOSBox starts, so you can use this section + for the mounting. Look at Section 13: The configuration (options) file + + +FULLSCREEN: How do I change to fullscreen? + Press alt-enter. Alternatively: Edit the configuration file of DOSBox and + change the option fullscreen=false to fullscreen=true. If fullscreen looks + wrong in your opinion: Play with the options: fullresolution, output and + aspect in the configuration file of DOSBox. To get back from fullscreen + mode: Press alt-enter again. + + +CD-ROM: My CD-ROM doesn't work. + To mount your CD-ROM in DOSBox you have to specify some additional options + when mounting the CD-ROM. + To enable CD-ROM support (includes MSCDEX) in Windows: + - mount d f:\ -t cdrom + in Linux: + - mount d /media/cdrom -t cdrom + + In some cases you might want to use a different CD-ROM interface, + for example if CD audio does not work: + To enable SDL-support (does not include low-level CD access!): + - mount d f:\ -t cdrom -usecd 0 -noioctl + To enable ioctl access using digital audio extraction for CD audio + (windows-only, useful for Vista): + - mount d f:\ -t cdrom -ioctl_dx + To enable ioctl access using MCI for CD audio (windows-only): + - mount d f:\ -t cdrom -ioctl_mci + To force ioctl-only access (windows-only): + - mount d f:\ -t cdrom -ioctl_dio + To enable low-level aspi-support (win98 with aspi-layer installed): + - mount d f:\ -t cdrom -aspi + + explanation: - d driveletter you will get in DOSBox (d is the best, + don't change it!) + - f:\ location of CD-ROM on your PC. In most cases it will + be d:\ or e:\ + - 0 The number of the CD-ROM drive, reported by "mount -cd" + (note that this value is only needed when using SDL + for CD audio, otherwise it is ignored) + See also the next question: The game/application can't find its CD-ROM. + + +CD-ROM: The game/application can't find its CD-ROM. + Be sure to mount the CD-ROM with -t cdrom switch, this will enable the + MSCDEX interface required by DOS games to interface with CD-ROMs. + Also try adding the correct label (-label LABEL) to the mount command, + where LABEL is the CD-label (volume ID) of the CD-ROM. + Under Windows you can specify -ioctl, -aspi or -noioctl. Look at the + description of the mount command in Section 4: "Internal programs" + for their meaning and the + additional audio-CD related options -ioctl_dx, ioctl_mci, ioctl_dio. + + Try creating a CD-ROM image (preferably CUE/BIN pair) and use the + DOSBox's internal IMGMOUNT tool to mount the image (the CUE sheet). + This enables very good low-level CD-ROM support on any operating system. + + +MOUSE: The mouse doesn't work. + Usually, DOSBox detects when a game uses mouse control. When you click on + the screen it should get locked (confined to the DOSBox window) and work. + With certain games, the DOSBox mouse detection doesn't work. In that case + you will have to lock the mouse manually by pressing CTRL-F10. + + +SOUND: There is no sound. + Be sure that the sound is correctly configured in the game. This might be + done during the installation or with a setup/setsound utility that + accompanies the game. First see if an autodetection option is provided. If + there is none try selecting Soundblaster or Soundblaster 16 with the default + settings being "address=220 irq=7 dma=1" (sometimes highdma=5). You might + also want to select Sound Canvas/SCC/MPU-401/General MIDI/Wave Blaster + at "address=330 IRQ=2" as music device. + The parameters of the emulated sound cards can be changed in the DOSBox + configuration file. + If you still don't get any sound set the core to normal in DOSBox + configuration and use some lower fixed cycles value (like cycles=2000). Also + assure that your host operating sound does provide sound. + In certain cases it might be useful to use a different emulated sound device + like a soundblaster pro (sbtype=sbpro1 in the DOSBox configuration file) or + the gravis ultrasound (gus=true). + + +SOUND: What sound hardware does DOSBox presently emulate? + DOSBox emulates several legacy sound devices: + - Internal PC speaker/Buzzer + This emulation includes both the tone generator and several forms of + digital sound output through the internal speaker. + - Creative CMS/Gameblaster + The is the first card released by Creative Labs(R). The default + configuration places it on address 220. It is disabled as default. + - Tandy 3 voice + The emulation of this sound hardware is complete with the exception of + the noise channel. The noise channel is not very well documented and as + such is only a best guess as to the sound's accuracy. It is disabled as + default. + - Tandy DAC + Some games may require turning off sound blaster emulation (sbtype=none) + for better tandy DAC sound support. Don't forget to set the sbtype back to + sb16 if you don't use tandy sound. + - Adlib + This emulation is almost perfect and includes the Adlib's ability to + almost play digitized sound. Placed at address 220 (also on 388). + - SoundBlaster 16 / SoundBlaster Pro I & II / SoundBlaster I & II + By default DOSBox provides Soundblaster 16 level 16-bit stereo sound. + You can select a different SoundBlaster version in the configuration of + DOSBox. AWE32 music is not emulated as you can use MPU-401 instead + (see below). + - Disney Sound Source and Covox Speech Thing + Using the printer port, this sound device outputs digital sound only. + Placed at LPT1 + - Gravis Ultrasound + The emulation of this hardware is nearly complete, though the MIDI + capabilities have been left out, since an MPU-401 has been emulated + in other code. For Gravis music you also have to install Gravis drivers + inside DOSBox. It is disabled as default. + - MPU-401 + A MIDI passthrough interface is also emulated. This method of sound + output will only work when used with external device/emulator. + Every Windows XP/Vista/7 and MAC OS has got a default emulator compatible + with: Sound Canvas/SCC/General Standard/General MIDI/Wave Blaster. + A different device/emulator is needed for Roland LAPC/CM-32L/MT-32 + compatibility. + + +SOUND: The sound stutters or sounds stretched/weird. + You may be using too much CPU power to keep DOSBox running at the current + speed. You can lower the cycles, skip frames, reduce the sampling rate of + the respective sound device, increase the prebuffer. See section 13: "The + configuration (options) file" + If you are using cycles=max or =auto, then make sure that there is no + background processes interfering! (especially if they access the harddisk) + Also look at Section 10. "How to speed up/slow down DOSBox" + + +KEYBOARD: I can't type \ or : in DOSBox. + This can happen in various cases, like your host keyboard layout does not + have a matching DOS layout representation (or it was not correctly + detected), or the key mapping is wrong. + Some possible fixes: + 1. Use / instead, or ALT-58 for : and ALT-92 for \. + 2. Change the DOS keyboard layout (see Section 8: Keyboard Layout). + 3. Add the commands you want to execute to the [autoexec] section + of the DOSBox configuration file. + 4. Open the DOSBox configuration file and change the usescancodes entry. + 5. Switch the keyboard layout of your operating system. + + Note that if the host layout can not be identified, or keyboardlayout is + set to none in the DOSBox configuration file, the standard US layout is + used. In this configuration try the keys around "enter" for the key \ + (backslash), and for the key : (colon) use shift and the keys between + "enter" and "L". + + +KEYBOARD: Right Shift and "\" doesn't work in DOSBox. (Windows only) + This may happen if Windows thinks that you have more than one keyboard + connected to your PC when you use some remote control devices. + To verity this problem run cmd.exe, navigate to DOSBox program folder + and type: + set sdl_videodriver=windib + dosbox.exe + check whether keyboard started to work properly. As windib is slower it is + best to use one of the two solutions provided here: + http://vogons.zetafleet.com/viewtopic.php?t=24072 + + +KEYBOARD: The keyboard lags. + Lower the priority setting in the DOSBox configuration file, for example + set "priority=normal,normal". You might also want to try lowering the + cycles (use a fixed cycle amount to start with, like cycles=10000). + + +CONTROL: The character/cursor/mouse pointer always moves into one direction! + See if it still happens if you disable the joystick emulation, + set joysticktype=none in the [joystick] section of your DOSBox + configuration file. Maybe also try unplugging any joystick/gamepad. + If you want to use the joystick in the game, try setting timed=false + and be sure to calibrate the joystick (both in your OS as well as + in the game or the game's setup program). + + +SPEED: The game/application runs much too slow/too fast! + Look at the section 10: "How to speed up/slow down DOSBox" for more + information. + + +CRASH: The game/application does not run at all/crashes! + Look at Section 11: Troubleshooting + + +CRASH: DOSBox crashes on startup!. + Look at Section 11: Troubleshooting + + +GAME: My Build game(Duke3D/Blood/Shadow Warrior) has problems. + First of all, try to find a port of the game. Those will offer a better + experience. To fix the graphics problem that occurs in DOSBox on higher + resolutions: Open the configuration file of DOSBox and search for + machine=svga_s3. Change svga_s3 to vesa_nolfb + Change memsize=16 to memsize=63 + + +SAFETY: Can DOSBox harm my computer? + DOSBox can not harm your computer more than any other resource demanding + program. Increasing the cycles does not overclock your real CPU. + Setting the cycles too high has a negative performance effect on the + software running inside DOSBox. + + +OPTIONS: I would like to change DOSBox's options. + Look at Section 13. "The configuration (options) file" + + +HELP: Great Manual, but I still don't get it. + For more questions read the rest of this Manual. You may also look at: + guides located at http://vogons.zetafleet.com/viewforum.php?f=39 + the wiki of DOSBox http://www.dosbox.com/wiki/ + the site/forum: http://www.dosbox.com + + + +=========================== +3. Command Line Parameters: +=========================== + +An overview of the command line options you can give to DOSBox. Although +in most cases it is easier to use DOSBox's configuration file instead. +See: Section 13. "The configuration (options) file" + +To be able to use Command Line Parameters: +(Windows) open cmd.exe or command.com or edit the shortcut to dosbox.exe +(Linux) use console +(MAC OS X) start terminal.app and navigate to: + /applications/dosbox.app/contents/macos/dosbox + +The options are valid for all operating systems unless noted in the option +description: + +dosbox [name] [-exit] [-c command] [-fullscreen] [-userconf] + [-conf congfigfilelocation] [-lang languagefilelocation] + [-machine machine type] [-noconsole] [-startmapper] [-noautoexec] + [-securemode] [-scaler scaler | -forcescaler scaler] [-version] + [-socket socket] + +dosbox -version +dosbox -editconf program +dosbox -opencaptures program +dosbox -printconf +dosbox -eraseconf +dosbox -erasemapper + + name + If "name" is a directory it will mount that as the C: drive. + If "name" is an executable it will mount the directory of "name" + as the C: drive and execute "name". + + -exit + DOSBox will close itself when the DOS application "name" ends. + + -c command + Runs the specified command before running "name". Multiple commands + can be specified. Each command should start with "-c" though. + A command can be: an Internal Program, a DOS command or an executable + on a mounted drive. + + -fullscreen + Starts DOSBox in fullscreen mode. + + -userconf + Start DOSBox with the users specific configuration file. Can be used + together with multiple -conf parameters, but -userconf will always be + loaded before them. + + -conf configfilelocation + Start DOSBox with the options specified in "configfilelocation". + Multiple -conf options may be present. + See Section 13 for more details. + + -lang languagefilelocation + Start DOSBox using the language specified in "languagefilelocation". + See Section 14 for more details. + + -machine machinetype + Setup DOSBox to emulate a specific type of machine. Valid choices are: + hercules, cga, ega, pcjr, tandy, svga_s3 (default) as well as + the additional svga chipsets listed in the DOSBox configuration file. + svga_s3 enables vesa emulation as well. + For some special vga effects the machinetype vgaonly can be used, + note that this disables svga capabilities and might be slower due to the + higher emulation precision. + The machinetype affects the video card and the available sound cards. + + -noconsole (Windows Only) + Start DOSBox without showing DOSBox Status Window (console). + Output will be redirected to stdout.txt and stderr.txt + + -startmapper + Enter the keymapper directly on startup. Useful for people with + keyboard problems. + + -noautoexec + Skips the [autoexec] section of the loaded configuration file. + + -securemode + Same as -noautoexec, but adds config.com -securemode at the + bottom of AUTOEXEC.BAT (which in turn disables any changes to how + the drives are mounted inside DOSBox). + + -scaler scaler + Uses the scaler specified by "scaler". See the DOSBox configuration file + for the available scalers. + + -forcescaler scaler + Similar to the -scaler parameter, but tries to force usage of + the specified scaler even if it might not fit. + + -version + output version information and exit. Useful for frontends. + + -editconf program + calls program with as first parameter the configuration file. + You can specify this command more than once. In this case it will + move to second program if the first one fails to start. + + -opencaptures program + calls program with as first parameter the location of the captures + folder. + + -printconf + prints the location of the default configuration file. + + -resetconf + removes the default configuration file. + + -resetmapper + removes the mapperfile used by the default clean configuration file. + + -socket + passes the socket number to the nullmodem emulation. See Section 9: + "Serial Multiplayer feature." + +Note: If a name/command/configfilelocation/languagefilelocation contains + a space, put the whole name/command/configfilelocation/languagefilelocation + between quotes ("command or file name"). If you need to use quotes within + quotes (most likely with -c and mount): + Windows and OS/2 users can use single quotes inside the double quotes. + Other people should be able to use escaped double quotes inside the + double quotes. + Windows: -c "mount c 'c:\My folder with DOS games\'" + Linux: -c "mount c \"/tmp/name with space\"" + +A rather unusual example, just to demonstrate what you can do (Windows): +dosbox D:\folder\file.exe -c "MOUNT Y H:\MyFolder" + This mounts D:\folder as C:\ and runs file.exe. + Before it does that, it will first mount H:\MyFolder as the Y drive. + +In Windows, you can also drag directories/files onto the DOSBox executable. + + + +===================== +4. Internal Programs: +===================== + +DOSBox supports most of the DOS commands found in command.com. +To get a list of the internal commands type "HELP" at the prompt. + +In addition, the following commands are available: + +MOUNT "Emulated Drive letter" "Real Drive or Directory" + [-t type] [-aspi] [-ioctl] [-noioctl] [-usecd number] [-size drivesize] + [-label drivelabel] [-freesize size_in_mb] + [-freesize size_in_kb (floppies)] +MOUNT -cd +MOUNT -u "Emulated Drive letter" + + Program to mount local directories as drives inside DOSBox. + + "Emulated Drive letter" + The driveletter inside DOSBox (for example C). + + "Real Drive letter (usually for CD-ROMs in Windows) or Directory" + The local directory you want accessible inside DOSBox. + + -t type + Type of the mounted directory. + Supported are: dir (default), floppy, cdrom. + + -size drivesize + (experts only) + Sets the size of the drive, where drivesize is of the form + "bps,spc,tcl,fcl": + bps: bytes per sector, by default 512 for regular drives and + 2048 for CD-ROM drives + spc: sectors per cluster, usually between 1 and 127 + tcl: total clusters, between 1 and 65534 + fcl: total free clusters, between 1 and tcl + + -freesize size_in_mb | size_in_kb + Sets the amount of free space available on a drive + in megabytes (regular drives) or kilobytes (floppy drives). + This is a simpler version of -size. + + -label drivelabel + Sets the name of the drive to "drivelabel". Needed on some systems + if the CD-ROM label isn't read correctly (useful when a program + can't find its CD-ROM). If you don't specify a label + and no lowlevel support is selected (that is omitting the -usecd # + and/or -aspi parameters, or specifying -noioctl): + For Windows: label is extracted from "Real Drive". + For Linux: label is set to NO_LABEL. + + If you do specify a label, this label will be kept as long as the drive + is mounted. It will not be updated !! + + -aspi + Forces use of the aspi layer. Only valid if mounting a CD-ROM under + Windows systems with an ASPI-Layer. + + -ioctl (automatic selection of the CD audio interface) + -ioctl_dx (digital audio extraction used for CD audio) + -ioctl_dio (ioctl calls used for CD audio) + -ioctl_mci (MCI used for CD audio) + Forces use of ioctl commands. Only valid if mounting a CD-ROM under + a Windows OS which support them (Win2000/XP/NT). + The various choices only differ in the way CD audio is handled, + preferably -ioctl_dio is used (lowest workload), but this might not + work on all systems, so -ioctl_dx (or -ioctl_mci) can be used. + + -noioctl + Forces use of the SDL CD-ROM layer. Valid on all systems. + + -usecd number + Valid on all systems, under windows the -noioctl switch has to be + present to make use of the -usecd switch. + Enables to select the drive that should be used by SDL. Use this if + the wrong or no CD-ROM drive is mounted while using the SDL CD-ROM + interface. "number" can be found by "MOUNT -cd". + + -cd + Displays all CD-ROM drives detected by SDL, and their numbers. + See the information at the -usecd entry above. + + -u + Removes the mount. Doesn't work for Z:\. + + Note: It's possible to mount a local directory as CD-ROM drive, + but hardware support is then missing. + + Basically MOUNT allows you to connect real hardware to DOSBox's emulated PC. + So MOUNT C C:\GAMES tells DOSBox to use your C:\GAMES directory as drive C: + in DOSBox. MOUNT C E:\SomeFolder tells DOSBox to use your E:\SomeFolder + directory as drive C: in DOSBox. + + Mounting your entire C drive with MOUNT C C:\ is NOT recommended! The same + is true for mounting the root of any other drive, except for CD-ROMs (due to + their read-only nature). + Otherwise if you or DOSBox make a mistake you may lose all your files. + Also never mount a "Windows" or "Program Files" folders or their subfolders + in Windows Vista/7 as DOSBox may not work correctly, or will stop working + correctly later. It is recommended to keep all your dos applications/games + in a simple folder (for example c:\dosgames) and mount that. + + You should always install your game inside DOSBox. + So if you have the game on CD you always (even after installation!) + have to mount both: folder as a harddisk drive and a CD-ROM. + HardDisk should always be mounted as c + CD-ROM should always be mounted as d + Floppy should always be mounted as a (or b) + + Basic MOUNT Examples for normal usage (Windows): + + 1. To mount a folder as a harddisk drive: + mount c d:\dosgames + + 3. To mount your CD-ROM drive E as CD-ROM drive D in DOSBox: + mount d e:\ -t cdrom + + 2. To mount your drive a: as a floppy: + mount a a:\ -t floppy + + Advanced MOUNT examples (Windows): + + 4. To mount a hard disk drive with ~870 mb free diskspace (simple version): + mount c d:\dosgames -freesize 870 + + 5. To mount a drive with ~870 mb free diskspace (experts only, full control): + mount c d:\dosgames -size 512,127,16513,13500 + + 1. To mount c:\dosgames\floppy as a floppy: + mount a c:\dosgames\floppy -t floppy + + + Other MOUNT examples: + + 3. To mount system CD-ROM drive at mountpoint /media/cdrom as CD-ROM drive D + in DOSBox: + mount d /media/cdrom -t cdrom -usecd 0 + + 6. To mount /home/user/dosgames as drive C in DOSBox: + mount c /home/user/dosgames + + 7. To mount the directory where DOSBox was started as C in DOSBox: + mount c . + (note the . which represents the directory where DOSBox was started, + on Windows Vista/7 don't use this if you installed DOSBox + to your "Program Files" folder) + + If you want to mount a CD image or floppy image, check IMGMOUNT. + MOUNT also works with images but only if you use external program, + for example (both are free): + - Daemon Tools Lite (for CD images), + - Virtual Floppy Drive (for floppy images). + Although IMGMOUNT can give better compatibility. + + +MEM + Program to display the amount and type of free memory. + + +VER +VER set major_version [minor_version] + Display the current DOSBox version and reported DOS version + (parameterless usage). + Change the reported DOS version with the "set" parameter, + for example: "VER set 6 22" to have DOSBox report DOS 6.22 as version number. + + +CONFIG -writeconf filelocation +CONFIG -writelang filelocation +CONFIG -securemode +CONFIG -set "section property=value" +CONFIG -get "section property" + + CONFIG can be used to change or query various settings of DOSBox + during runtime. It can save the current settings and language strings to + disk. Information about all possible sections and properties can + be found in Section 13: "The configuration (options) file". + + -writeconf filelocation + Write the current configuration settings to a file in a specified location. + "filelocation" is located on the local drive, not a mounted drive in DOSBox. + The configuration file controls various settings of DOSBox: + the amount of emulated memory, the emulated sound cards and many more + things. It allows access to AUTOEXEC.BAT as well. + See Section 13: "The configuration (options) file" for more information. + + -writelang filelocation + Write the current language settings to a file in a specified location. + "filelocation" is located on the local drive, not a mounted drive + in DOSBox. The language file controls all visible output of the internal + commands and the internal DOS. + See Section 14: "The Language File" for more information. + + -securemode + Switches DOSBox to a more secure mode. In this mode the internal + commands MOUNT, IMGMOUNT and BOOT won't work. It's not possible either + to create a new configfile or languagefile in this mode. + (Warning: you can only undo this mode by restarting DOSBox.) + + -set "section property=value" + CONFIG will attempt to set the property to new value. + Currently CONFIG can not report whether the command succeeded or not. + + -get "section property" + The current value of the property is reported and stored in the + environment variable %CONFIG%. This can be used to store the value + when using batch files. + + Both "-set" and "-get" work from batch files and can be used to set up your + own preferences for each game. Although it may be easier to use separate + DOSBox's configuration files for each game instead. + + Examples: + 1. To create a configuration file in your c:\dosgames directory: + config -writeconf c:\dosgames\dosbox.conf + 2. To set the cpu cycles to 10000: + config -set "cpu cycles=10000" + 3. To turn ems memory emulation off: + config -set "dos ems=off" + 4. To check which cpu core is being used. + config -get "cpu core" + + +LOADFIX [-size] [program] [program-parameters] +LOADFIX -f + Program to reduce the amount of available conventional memory. + Useful for old programs which don't expect much memory to be free. + + -size + number of kilobytes to "eat up", default = 64kb + + -f + frees all previously allocated memory + + Examples: + 1. To start mm2.exe and allocate 64kb memory + (mm2 will have 64 kb less available): + loadfix mm2 + 2. To start mm2.exe and allocate 32kb memory: + loadfix -32 mm2 + 3. To free previous allocated memory: + loadfix -f + + +RESCAN + Make DOSBox reread the directory structure. Useful if you changed something + on a mounted drive outside of DOSBox. (CTRL - F4 does this as well!) + + +MIXER + Makes DOSBox display its current volume settings. + Here's how you can change them: + + mixer channel left:right [/NOSHOW] [/LISTMIDI] + + channel + Can be one of the following: MASTER, DISNEY, SPKR, GUS, SB, FM [, CDAUDIO]. + CDAUDIO is only available if a CD-ROM interface with volume control is + enabled (CD image, ioctl_dx). + + left:right + The volume levels in percentages. If you put a D in front it will be + in decibel (Example: mixer gus d-10). + + /NOSHOW + Prevents DOSBox from showing the result if you set one + of the volume levels. + + /LISTMIDI + In Windows lists the available midi devices on your PC. To select a device + other than the Windows default midi-mapper, change the line 'midiconfig=' + in the [midi] section of the configuration file to 'midiconfig=id', where + 'id' is the number for the device as listed by LISTMIDI. eg. midiconfig=2 + + In Linux this option doesn't work, but you get similar results by using + 'pmidi -l' in console. Then change the line 'midiconfig=' to + 'midiconfig=port', where 'port' is the port for the device as listed by + 'pmidi -l'. eg. midiconfig=128:0 + + +IMGMOUNT + A utility to mount disk images and CD-ROM images in DOSBox. + + IMGMOUNT DRIVE [imagefile] -t [image_type] -fs [image_format] + -size [sectorsbytesize, sectorsperhead, heads, cylinders] + IMGMOUNT DRIVE [imagefile1 imagefile2 .. imagefileN] -t cdrom -fs iso + + imagefile + Location of the image file to mount in DOSBox. The location can be + on a mounted drive inside DOSBox, or on your real disk. It is possible + to mount CD-ROM images (ISOs or CUE/BIN or CUE/IMG) too. + If you need CD swapping capabilities, specify all images in succession + (see the next entry). + CUE/BIN pairs and cue/img are the preferred CD-ROM image types as they can + store audio tracks compared to ISOs (which are data-only). For + the CUE/BIN mounting always specify the CUE sheet. + + imagefile1 imagefile2 .. imagefileN + Location of the image files to mount in DOSBox. Specifying a number + of image files is only allowed for CD-ROM images. + The CD's can be swapped with CTRL-F4 at any time. + This is required for games which use multiple CD-ROMs and require the CD + to be switched during the gameplay at some point. + + -t + The following are valid image types: + floppy: Specifies a floppy image. DOSBox will automatically identify + the disk geometry (360K, 1.2MB, 720K, 1.44MB, etc). + cdrom: Specifies a CD-ROM image. The geometry is automatic and + set for this size. This can be an iso or a cue/bin pair or + a cue/img pair. + hdd: Specifies a harddrive image. The proper CHS geometry must be set + for this to work. + + -fs + The following are valid file system formats: + iso: Specifies the ISO 9660 CD-ROM format. + fat: Specifies that the image uses the FAT file system. DOSBox will + attempt to mount this image as a drive in DOSBox and make + the files available from inside DOSBox. + none: DOSBox will make no attempt to read the file system on the disk. + This is useful if you need to format it or if you want to boot + the disk using the BOOT command. When using the "none" + filesystem, you must specify the drive number (2 or 3, + where 2 = master, 3 = slave) rather than a drive letter. + For example, to mount a 70MB image as the slave drive device, + you would type (without the quotes): + "imgmount 3 d:\test.img -size 512,63,16,142 -fs none" + Compare this with a mount to be able to access the drive + within DOSBox, which would read as: + "imgmount e: d:\test.img -size 512,63,16,142" + + -size + The Cylinders, Heads and Sectors of the drive. + Required to mount hard drive images. + + An example how to mount CD-ROM images (in Linux): + 1. imgmount d /tmp/cdimage1.cue /tmp/cdimage2.cue -t cdrom + or (which also works): + 2a. mount c /tmp + 2b. imgmount d c:\cdimage1.cue c:\cdimage2.cue -t cdrom + (in Windows): + imgmount d f:\img\CD1.cue f:\img\CD2.cue f:\img\CD3.cue -t cdrom + imgmount d "g:\img\7th Guest CD1.cue" "g:\img\7th Guest CD2.cue" -t cdrom + Don't forget that you can also use MOUNT with images, but only if you use + external program, for example (both are free): + - Daemon Tools Lite (for CD images), + - Virtual Floppy Drive (for floppy images). + Although IMGMOUNT can give better compatibility. + + +BOOT + Boot will start floppy images or hard disk images independent of + the operating system emulation offered by DOSBox. This will allow you to + play booter floppies or boot other operating systems inside DOSBox. + If the target emulated system is PCjr (machine=pcjr) the boot command + can be used to load PCjr cartridges (.jrc). + + BOOT [diskimg1.img diskimg2.img .. diskimgN.img] [-l driveletter] + BOOT [cart.jrc] (PCjr only) + + diskimg1.img diskimg2.img .. diskimgN.img + This can be any number of floppy disk images one wants mounted after + DOSBox boots the specified drive letter. + To swap between images, hit CTRL-F4 to change from the current disk + to the next disk in the list. The list will loop back from the last + disk image to the beginning. + + [-l driveletter] + This parameter allows you to specify the drive to boot from. + The default is the A drive, the floppy drive. You can also boot + a hard drive image mounted as master by specifying "-l C" + without the quotes, or the drive as slave by specifying "-l D" + + cart.jrc (PCjr only) + When emulation of a PCjr is enabled, cartridges can be loaded with + the BOOT command. Support is still limited. + + +IPX + + You need to enable IPX networking in the configuration file of DOSBox. + + All of the IPX networking is managed through the internal DOSBox program + IPXNET. For help on the IPX networking from inside DOSBox, type + "IPXNET HELP" (without quotes) and the program will list the commands + and relevant documentation. + + With regard to actually setting up a network, one system needs to be + the server. To set this up, type "IPXNET STARTSERVER" (without the quotes) + in a DOSBox session. The server DOSBox session will automatically add + itself to the virtual IPX network. For every additional computer that + should be part of the virtual IPX network, you'll need to type + "IPXNET CONNECT ". + For example, if your server is at bob.dosbox.com, you would type + "IPXNET CONNECT bob.dosbox.com" on every non-server system. + + To play games that need Netbios a file named NETBIOS.EXE from Novell is + needed. Establish the IPX connection as explained above, then run + "netbios.exe". + + The following is an IPXNET command reference: + + IPXNET CONNECT + + IPXNET CONNECT opens a connection to an IPX tunneling server + running on another DOSBox session. The "address" parameter specifies + the IP address or host name of the server computer. You can also + specify the UDP port to use. By default IPXNET uses port 213 - the + assigned IANA port for IPX tunneling - for its connection. + + The syntax for IPXNET CONNECT is: + IPXNET CONNECT address + + IPXNET DISCONNECT + + IPXNET DISCONNECT closes the connection to the IPX tunneling server. + + The syntax for IPXNET DISCONNECT is: + IPXNET DISCONNECT + + IPXNET STARTSERVER + + IPXNET STARTSERVER starts an IPX tunneling server on this DOSBox + session. By default, the server will accept connections on UDP port + 213, though this can be changed. Once the server is started, DOSBox + will automatically start a client connection to the IPX tunneling server. + + The syntax for IPXNET STARTSERVER is: + IPXNET STARTSERVER + + If the server is behind a router, UDP port needs to be forwarded + to that computer. + + On Linux/Unix-based systems port numbers smaller than 1023 can only be + used with root privileges. Use ports greater than 1023 on those systems. + + IPXNET STOPSERVER + + IPXNET STOPSERVER stops the IPX tunneling server running on this DOSBox + session. Care should be taken to ensure that all other connections have + terminated as well, since stopping the server may cause lockups on other + machines that are still using the IPX tunneling server. + + The syntax for IPXNET STOPSERVER is: + IPXNET STOPSERVER + + IPXNET PING + + IPXNET PING broadcasts a ping request through the IPX tunneled network. + In response, all other connected computers will respond to the ping + and report the time it took to receive and send the ping message. + + The syntax for IPXNET PING is: + IPXNET PING + + IPXNET STATUS + + IPXNET STATUS reports the current state of this DOSBox session's + IPX tunneling network. For a list of all computers connected to the + network use the IPXNET PING command. + + The syntax for IPXNET STATUS is: + IPXNET STATUS + + +KEYB [keyboardlayoutcode [codepage [codepagefile]]] + + Change the keyboard layout. For detailed information about keyboard layouts + please see Section 8: "Keyboard Layout" + + [keyboardlayoutcode] is a string consisting of five or less characters, + examples are PL214 (Polish typists) or PL457 (Polish programmers). + It specifies the keyboard layout to be used. + The list of all layouts built into DOSBox is here: + http://vogons.zetafleet.com/viewtopic.php?t=21824 + + [codepage] is the number of the codepage to be used. The keyboard layout + has to provide support for the specified codepage, otherwise the layout + loading will fail. + If no codepage is specified, an appropriate codepage for the requested + layout is chosen automatically. + + [codepagefile] can be used to load codepages that are yet not compiled + into DOSBox. This is only needed when DOSBox does not find the codepage. + If no codepagefile is specified, but you place all ten ega.cpx files + (from FreeDOS) in the DOSBox program folder, an appropriate codepagefile + for the requested layout/codepage is chosen automatically. + + Examples: + 1. To load the polish typist keys layout (automatically uses codepage 852): + keyb pl214 + 2. To load one of russian keyboard layouts with codepage 866: + keyb ru441 866 + In order to type russian characters press ALT+RIGHT-SHIFT. + 3. To load one of french keyboard layouts with codepage 850 (where the + codepage is defined in EGACPI.DAT): + keyb fr189 850 EGACPI.DAT + 4. To load codepage 858 (without a keyboard layout): + keyb none 858 + This can be used to change the codepage for the FreeDOS keyb2 utility. + 5. To display the current codepage and, if loaded, the keyboard layout: + keyb + + + +For more information use the /? command line switch with the programs. + + + +================ +5. Special Keys: +================ + +ALT-ENTER Switch to full screen and back. +ALT-PAUSE Pause emulation (hit ALT-PAUSE again to continue). +CTRL-F1 Start the keymapper. +CTRL-F4 Change between mounted floppy/CD images. Update directory cache + for all drives. +CTRL-ALT-F5 Start/Stop creating a movie of the screen. (avi video capturing) +CTRL-F5 Save a screenshot. (PNG format) +CTRL-F6 Start/Stop recording sound output to a wave file. +CTRL-ALT-F7 Start/Stop recording of OPL commands. (DRO format) +CTRL-ALT-F8 Start/Stop the recording of raw MIDI commands. +CTRL-F7 Decrease frameskip. +CTRL-F8 Increase frameskip. +CTRL-F9 Kill DOSBox. +CTRL-F10 Capture/Release the mouse. +CTRL-F11 Slow down emulation (Decrease DOSBox Cycles). +CTRL-F12 Speed up emulation (Increase DOSBox Cycles)*. +ALT-F12 Unlock speed (turbo button/fast forward)**. +F11, ALT-F11 (machine=cga) change tint in NTSC output modes*** +F11 (machine=hercules) cycle through amber, green, white colouring*** + +*NOTE: Once you increase your DOSBox cycles beyond your computer CPU resources, + it will produce the same effect as slowing down the emulation. + This maximum will vary from computer to computer. + +**NOTE: You need free CPU resources for this (the more you have, the faster + it goes), so it won't work at all with cycles=max or a too high amount + of fixed cycles. You have to keep the keys pressed for it to work! + +***NOTE: These keys won't work if you saved a mapper file earlier with + a different machine type. So either reassign them or reset the mapper. + +These are the default keybindings. They can be changed in the keymapper +(see Section 7: KeyMapper). + +In MAC OS you can try using cmd(applekey) together with Ctrl if the key doesn't +work eg. cmd-ctrl-F1, but some keys may still need remapping (in Linux too). + +Saved/recorded files can be found in: + (Windows) "Start/WinLogo Menu"->"All Programs"->DOSBox-0.74->Extras + (Linux) ~/.dosbox/capture + (MAC OS X) "~/Library/Preferences/capture" +This can be changed in the DOSBox configuration file. + + + +==================== +6. Joystick/Gamepad: +==================== + +The standard joystick port in DOS supports a maximum of 4 axes and 4 buttons. +For more, different modifications of that configuration were used. + +To force DOSBox to use a different type of emulated joystick/gamepad, the entry +"joysticktype" in the [joystick] section of the DOSBox configuration file can +be used. + +none - disables controller support. +auto - (default) autodetects whether you have one or two controllers connected: + if you have one - '4axis' setting is used, + if you have two - '2axis' setting is used. +2axis - If you have two controllers connected, each will emulate a joystick + with 2 axes and 2 buttons. If you have only one controller connected, + it will emulate a joystick with only 2 axis and 2 buttons. +4axis - supports only first controller, emulates a joystick + with 4 axis and 4 buttons or a gamepad with 2axis and 6 buttons. +4axis_2 - supports only second controller. +fcs - supports only first controller, emulates ThrustMaster + Flight Control System, with 3-axes, 4 buttons and 1 hat. +ch - supports only first controller, emulates CH Flightstick, + with 4-axes, 6 buttons and 1 hat, but you cannot press more + than one button at the same time. + +You also have to configure controller properly inside the game. + +It is important to remember that if you saved the mapperfile without joystick + +connected, or with a different joystick setting, your new setting will +not work +properly, +or not work at all, until you reset DOSBox's mapperfile. + + +If controller is working properly outside DOSBox, but doesn't calibrate properly +inside DOSBox, try different 'timed' setting in DOSBox's configuration file. + + + +============= +7. KeyMapper: +============= + +You start the DOSBox mapper either with CTRL-F1 (see section 5. Special Keys) +or -startmapper (see Section 3. Command Line Parameters). +You are presented with a virtual keyboard and a virtual joystick. + +These virtual devices correspond to the keys and events DOSBox will +report to the DOS applications. If you click on a button with your mouse, +you can see in the lower left corner with which event it is associated +(EVENT) and to what events it is currently bound. + +Event: EVENT +BIND: BIND (the real key/button/axis you push with your finger/hand) + + Add Del +mod1 hold Next +mod2 +mod3 + + +EVENT + The key or joystick axis/button/hat DOSBox will report to DOS applications. + (the event that will happen during the game, (eg. shooting/jumping/walking) +BIND + The key on your real keyboard or the axis/button/hat on your real + joystick(s) (as reported by SDL), which is connected to the EVENT. +mod1,2,3 + Modifiers. These are keys you need to have to be pressed while pressing + BIND. mod1 = CTRL and mod2 = ALT. These are generally only used when you + want to change the special keys of DOSBox. +Add + Add a new BIND to this EVENT. Basically add a key from your keyboard or an + event from the joystick (button press, axis/hat movement) which will + produce the EVENT in DOSBox. +Del + Delete the BIND to this EVENT. If an EVENT has no BINDS, then it is not + possible to trigger this event in DOSBox (that is there's no way to type + the key or use the respective action of the joystick). +Next + Go through the list of bindings which map to this EVENT. + + +Example: +Q1. You want to have the X on your keyboard to type a Z in DOSBox. + A. Click on the Z on the keyboard mapper. Click "Add". + Now press the X key on your keyboard. + +Q2. If you click "Next" a couple of times, you will notice that the Z on your + keyboard also produces an Z in DOSBox. + A. Therefore select the Z again, and click "Next" until you have the Z on + your keyboard. Now click "Del". + +Q3. If you try it out in DOSBox, you will notice that pressing X makes ZX + appear. + A. The X on your keyboard is still mapped to the X as well! Click on + the X in the keyboard mapper and search with "Next" until you find the + mapped key X. Click "Del". + + +Examples about remapping the joystick: + You have a joystick attached, it is working fine under DOSBox and you + want to play some keyboard-only game with the joystick (it is assumed + that the game is controlled by the arrows on the keyboard): + 1. Start the mapper, then click on one of the left keyboard arrow. + EVENT should be key_left. Now click on Add and move your joystick + in the respective direction, this should add an event to the BIND. + 2. Repeat the above for the missing three directions, additionally + the buttons of the joystick can be remapped as well (fire/jump). + 3. Click on Save, then on Exit and test it with some game. + + You want to swap the y-axis of the joystick because some flightsim uses + the up/down joystick movement in a way you don't like, and it is not + configurable in the game itself: + 1. Start the mapper and click on Y- in the first joystick field. + EVENT should be jaxis_0_1-. + 2. Click on Del to remove the current binding, then click Add and move + your joystick downwards. A new bind should be created. + 3. Repeat this for Y+, save the layout and finally test it with some game. + + If you want to remap anything to your d-pad/hat you will have to change + 'joysticktype=auto' to 'joysticktype=fcs' in configuration file. Maybe this + will be improved in the next dosbox version. + + +If you change the default mapping, you can save your changes by clicking on +"Save". DOSBox will save the mapping to a location specified in +the configuration file (the mapperfile= entry). At startup, DOSBox will load +your mapperfile, if it is present in the DOSBox configuration file. + + + +=================== +8. Keyboard Layout: +=================== + +To switch to a different keyboard layout, either the entry "keyboardlayout" +in the [dos] section of the DOSBox configuration file can be used, or the +internal DOSBox program keyb.com (Section 4: Internal Programs) +Both accept DOS conforming language codes (see below), +but only by using keyb.com a custom codepage can be specified. + +The default keyboardlayout=auto currently works under windows only. The language +is chosen according to the OS language, but the keyboard layout is not detected. + +Layout switching + DOSBox supports a number of keyboard layouts and codepages by default, + in this case just the layout identifier needs to be specified (like + keyboardlayout=PL214 in the DOSBox configuration file, or using "keyb PL214" + at the DOSBox command prompt). The list of all layouts built into DOSBox is + here: http://vogons.zetafleet.com/viewtopic.php?t=21824 + + Some keyboard layouts (for example layout GK319 codepage 869 and layout RU441 + codepage 808) have support for dual layouts that can be accessed by pressing + LeftALT+RrightSHIFT for one layout and LeftALT+LeftSHIFT for the other. + Some keyboard layouts (for example layout LT456 codepage 771) have support + for three layouts, third can be accessed by pressing LeftALT+LeftCTRL + +Supported external files + The FreeDOS .kl files are supported (FreeDOS keyb2 keyboard layoutfiles) as + well as the FreeDOS keyboard.sys/keybrd2.sys/keybrd3.sys libraries which + consist of all available .kl files. + See http://www.freedos.org/ for precompiled keyboard layouts if + the DOSBox-integrated layouts don't work for some reason, or if updated or + new layouts become available. + + Both .CPI (MS-DOS and compatible codepage files) and .CPX (FreeDOS + UPX-compressed codepage files) can be used. Some codepages are compiled + into DOSBox, so it is mostly not needed to care about external codepage + files. If you need a different (or custom) codepage file, copy it into + the directory of the DOSBox so it is accessible for DOSBox. + If you place all ten ega.cpx files (from FreeDOS) in DOSBox folder, + an appropriate codepagefile for the requested layout/codepage is + chosen automatically. + + Additional layouts can be added by copying the corresponding .kl file into + the directory of the DOSBox configuration file and using the first part of + the filename as language code. + Example: For the file UZ.KL (keyboard layout for Uzbekistan) specify + "keyboardlayout=uz" in the DOSBox configuration file. + The integration of keyboard layout packages (like keybrd2.sys) works similar. + +Note that the keyboard layout allows foreign characters to be entered, but +there is NO support for them in filenames. Try to avoid them both inside +DOSBox as well as in files on your host operating system that are accessible +by DOSBox. + + + +============================== +9. Serial Multiplayer feature: +============================== + +DOSBox can emulate a serial nullmodem cable over network and internet. +It can be configured through the [serialports] section in the DOSBox +configuration file. + +To create a nullmodem connection, one side needs to act as the server and +one as the client. + +The server needs to be set up in the DOSBox configuration file like this: + serial1=nullmodem + +The client: + serial1=nullmodem server: + +Now start your game and choose nullmodem / serial cable / already connected +as multiplayer method on COM1. Set the same baudrate on both computers. + +Furthermore, additional parameters can be specified to control the behavior +of the nullmodem connection. These are all parameters: + + * port: - TCP port number. Default: 23 + * rxdelay: - how long (milliseconds) to delay received data if the + interface is not ready. Increase this value if you encounter + overrun errors in the DOSBox Status Window. Default: 100 + * txdelay: - how long to gather data before sending a packet. Default: 12 + (reduces Network overhead) + * server: - This nullmodem will be a client connecting to the specified + server. (No server argument: be a server.) + * transparent:1 - Only send the serial data, no RTS/DTR handshake. Use this + when connecting to anything other than a nullmodem. + * telnet:1 - Interpret Telnet data from the remote site. Automatically + sets transparent. + * usedtr:1 - The connection will not be established until DTR is switched + on by the DOS program. Useful for modem terminals. + Automatically sets transparent. + * inhsocket:1 - Use a socket passed to DOSBox by command line. Automatically + sets transparent. (Socket Inheritance: It is used for + playing old DOS door games on new BBS software.) + +Example: Be a server listening on TCP port 5000. + serial1=nullmodem server: port:5000 rxdelay:1000 + + + +===================================== +10. How to speed up/slow down DOSBox: +===================================== + +DOSBox emulates the CPU, the sound and graphic cards, and other peripherals +of a PC, all at the same time. The speed of an emulated DOS application +depends on how many instructions can be emulated, which is adjustable +(number of cycles). + +CPU Cycles (speed up/slow down) + By default (cycles=auto) DOSBox tries to detect whether a game needs to + be run with as many instructions emulated per time interval as possible + (cycles=max, sometimes this results in game working too fast or unstable), + or whether to use fixed amount of cycles (cycles=3000, sometimes this results + in game working too slow or too fast). But you can always manually force + a different setting in the DOSBox's configuration file. + + You can force the slow or fast behavior by setting a fixed amount of cycles + in the DOSBox's configuration file. If you for example set cycles=10000, then + DOSBox window will display a line "Cpu Speed: fixed 10000 cycles" at the top. + In this mode you can reduce the amount of cycles even more by hitting CTRL-F11 + (you can go as low as you want) or raise it by hitting CTRL-F12 as much as you + want, but you will be limited by the power of one core of your computer's CPU. + You can see how much free time your real CPU's cores have by looking at + the Task Manager in Windows 2000/XP/Vista/7 and the System Monitor + in Windows 95/98/ME. Once 100% of the power of your computer's real CPU's one + core is used, there is no further way to speed up DOSBox (it will actually + start to slow down), unless you reduce the load generated by the non-CPU parts + of DOSBox. DOSBox can use only one core of your CPU, so If you have + for example a CPU with 4 cores, DOSBox will not be able to use the power + of three other cores. + + You can also force the fast behavior by setting cycles=max in the DOSBox + configuration file. The DOSBox window will display a line + "Cpu Speed: max 100% cycles" at the top then. This time you won't have to care + how much free time your real CPU's cores have, because DOSBox will always use + 100% of your real CPU's one core. In this mode you can reduce the amount + of your real CPU's core usage by CTRL-F11 or raise it with CTRL-F12. + +CPU Core (speed up) + On x86 architectures you can try to force the usage of a dynamically + recompiling core (set core=dynamic in the DOSBox configuration file). + This usually gives better results if the auto detection (core=auto) fails. + It is best accompanied by cycles=max. But you may also try using it with + high amounts of cycles (for example 20000 or more). Note that there might be + games that work worse/crash with the dynamic core (so save your game often), + or do not work at all! + +Graphics emulation (speed up) + VGA emulation is a demanding part of DOSBox in terms of actual CPU usage. + Increase the number of frames skipped (in increments of one) by pressing + CTRL-F8. Your CPU usage should decrease when using a fixed cycle setting, + and you will be able to increase cycles with CTRL-F12. + You can repeat this until the game runs fast enough for you. + Please note that this is a trade-off: you lose in fluidity of video what + you gain in speed. + +Sound emulation (speed up) + You can also try to disable the sound through the setup utility of the game + to reduce load on your CPU further. Setting nosound=true in DOSBox's + configuration does NOT disable the emulation of sound devices, just + the output of sound will be disabled. + +Also try to close every program but DOSBox to reserve as much resources +as possible for DOSBox. + + +Advanced cycles configuration: +The cycles=auto and cycles=max settings can be parameterized to have +different startup defaults. The syntax is + cycles=auto ["realmode default"] ["protected mode default"%] + [limit "cycle limit"] + cycles=max ["protected mode default"%] [limit "cycle limit"] +Example: + cycles=auto 5000 80% limit 20000 + will use cycles=5000 for real mode games, 80% CPU throttling for + protected mode games along with a hard cycle limit of 20000 + + + +==================== +11. Troubleshooting: +==================== + +General tip: + Check messages in DOSBox Status Window. See section 12. "DOSBox Status Window" + +DOSBox crashes right after starting it: + - use different values for the output= entry in your DOSBox + configuration file + - try to update your graphics card driver and DirectX + - (Linux) set the environment variable SDL_AUDIODRIVER to alsa or oss. + +Running a certain game closes DOSBox, crashes with some message or hangs: + - see if it works with a default DOSBox installation + (unmodified configuration file) + - try it with sound disabled (use the sound configuration + program that comes with the game, additionally you can + set sbtype=none and gus=false in the DOSBox configuration file) + - change some entries of the DOSBox configuration file, especially try: + core=normal + fixed cycles (for example cycles=10000) + ems=false + xms=false + or combinations of the above settings, + similar the machine settings that control the emulated chipset and + functionality: + machine=vesa_nolfb + or + machine=vgaonly + - use loadfix before starting the game + +The game exits to the DOSBox prompt with some error message: + - read the error message closely and try to locate the error + - try the hints at the above sections + - mount differently as some games are picky about the locations, + for example if you used "mount d d:\oldgames\game" try + "mount c d:\oldgames\game" and "mount c d:\oldgames" + - if the game requires a CD-ROM be sure you used "-t cdrom" when + mounting and try different additional parameters (the ioctl, + usecd and label switches, see the appropriate section) + - check the file permissions of the game files (remove read-only + attributes, add write permissions etc.) + - try reinstalling the game within DOSBox + + + +========================= +12. DOSBox Status Window: +========================= + +DOSBox's Staus window contains many useful information about your currant +configuration, your actions in DOSBox, errors that happened and more. +Whenever you have any problem with DOSBox check these messages. + +To start DOSBox Status Window: + (Windows) Status Window is being started together with main DOSBox window. + (Linux) You may have to start DOSBox from a console to see Status Window. + (MAC OS X) Right click on DOSBox.app, choose "Show Package Contents"-> + ->enter "Contents"->enter "MacOS"->run "DOSBox" + + + +===================================== +13. The configuration (options) file: +===================================== + +The configuration file is automatically created the first time you run DOSBox. +The file can be found in: + (Windows) "Start/WinLogo Menu"->"All Programs"->DOSBox-0.74->Options + (Linux) ~/.dosbox/dosbox-0.74.conf + (MAC OS X) "~/Library/Preferences/DOSBox 0.74 Preferences" +The file is divided into several sections. Each section starts with a +[section name] line. The settings are the property=value lines where value can +be altered to customize DOSBox. +# and % indicate comment-lines. + + +An extra configuration file can be generated by CONFIG.COM, which can be found +on the internal DOSBox Z: drive when you start up DOSBox. Look in the Section 4: +"Internal programs" for usage of CONFIG.COM. You can start DOSBox with +the -conf switch to load the generated file and use its settings. + +DOSBox will load configuration files that are specified with -conf. If none were +specified, it will try to load "dosbox.conf" from the local directory. +If there is none, DOSBox will load the user configuration file. +This file will be created if it doesn't exist. + +Important!: In Windows Vista/7 the configuration file won't work correctly +if it is located in "Windows" or "Program Files" folder or their subfolders, +or directly on c:\, so the best place for storing extra configuration files is +for example: C:\oldgames + + + +====================== +14. The Language File: +====================== + +A language file can be generated by CONFIG.COM, which can be found on the +internal DOSBox Z: drive when you start up DOSBox. Look in the Section 4: +"Internal programs" for usage of CONFIG.COM. +Read the language file, and you will hopefully understand how to change it. +Start DOSBox with the -lang switch to use your new language file. +Alternatively, you can setup the filename in the configuration file +in the [dosbox] section. There's a language= entry that can be changed with +the filelocation. + + + +======================================== +15. Building your own version of DOSBox: +======================================== + +Download the source. +Check the INSTALL in the source distribution. + + + +=================== +16. Special thanks: +=================== + +See the THANKS file. + + + +============ +17. Contact: +============ + +See the site: +http://www.dosbox.com +for an email address (The Crew-page). + + diff --git a/programs/emulator/e80/trunk/48.h b/programs/emulator/e80/trunk/48.h new file mode 100644 index 0000000000..2ac63b59eb --- /dev/null +++ b/programs/emulator/e80/trunk/48.h @@ -0,0 +1,1027 @@ +char BIOS48[]= { +0xf3,0xaf,0x11,0xff,0xff,0xc3,0xcb,0x11,0x2a,0x5d,0x5c,0x22,0x5f,0x5c,0x18,0x43, +0xc3,0xf2,0x15,0xff,0xff,0xff,0xff,0xff,0x2a,0x5d,0x5c,0x7e,0xcd,0x7d,0x00,0xd0, +0xcd,0x74,0x00,0x18,0xf7,0xff,0xff,0xff,0xc3,0x5b,0x33,0xff,0xff,0xff,0xff,0xff, +0xc5,0x2a,0x61,0x5c,0xe5,0xc3,0x9e,0x16,0xf5,0xe5,0x2a,0x78,0x5c,0x23,0x22,0x78, +0x5c,0x7c,0xb5,0x20,0x03,0xfd,0x34,0x40,0xc5,0xd5,0xcd,0xbf,0x02,0xd1,0xc1,0xe1, +0xf1,0xfb,0xc9,0xe1,0x6e,0xfd,0x75,0x00,0xed,0x7b,0x3d,0x5c,0xc3,0xc5,0x16,0xff, +0xff,0xff,0xff,0xff,0xff,0xff,0xf5,0xe5,0x2a,0xb0,0x5c,0x7c,0xb5,0x20,0x01,0xe9, +0xe1,0xf1,0xed,0x45,0x2a,0x5d,0x5c,0x23,0x22,0x5d,0x5c,0x7e,0xc9,0xfe,0x21,0xd0, +0xfe,0x0d,0xc8,0xfe,0x10,0xd8,0xfe,0x18,0x3f,0xd8,0x23,0xfe,0x16,0x38,0x01,0x23, +0x37,0x22,0x5d,0x5c,0xc9,0xbf,0x52,0x4e,0xc4,0x49,0x4e,0x4b,0x45,0x59,0xa4,0x50, +0xc9,0x46,0xce,0x50,0x4f,0x49,0x4e,0xd4,0x53,0x43,0x52,0x45,0x45,0x4e,0xa4,0x41, +0x54,0x54,0xd2,0x41,0xd4,0x54,0x41,0xc2,0x56,0x41,0x4c,0xa4,0x43,0x4f,0x44,0xc5, +0x56,0x41,0xcc,0x4c,0x45,0xce,0x53,0x49,0xce,0x43,0x4f,0xd3,0x54,0x41,0xce,0x41, +0x53,0xce,0x41,0x43,0xd3,0x41,0x54,0xce,0x4c,0xce,0x45,0x58,0xd0,0x49,0x4e,0xd4, +0x53,0x51,0xd2,0x53,0x47,0xce,0x41,0x42,0xd3,0x50,0x45,0x45,0xcb,0x49,0xce,0x55, +0x53,0xd2,0x53,0x54,0x52,0xa4,0x43,0x48,0x52,0xa4,0x4e,0x4f,0xd4,0x42,0x49,0xce, +0x4f,0xd2,0x41,0x4e,0xc4,0x3c,0xbd,0x3e,0xbd,0x3c,0xbe,0x4c,0x49,0x4e,0xc5,0x54, +0x48,0x45,0xce,0x54,0xcf,0x53,0x54,0x45,0xd0,0x44,0x45,0x46,0x20,0x46,0xce,0x43, +0x41,0xd4,0x46,0x4f,0x52,0x4d,0x41,0xd4,0x4d,0x4f,0x56,0xc5,0x45,0x52,0x41,0x53, +0xc5,0x4f,0x50,0x45,0x4e,0x20,0xa3,0x43,0x4c,0x4f,0x53,0x45,0x20,0xa3,0x4d,0x45, +0x52,0x47,0xc5,0x56,0x45,0x52,0x49,0x46,0xd9,0x42,0x45,0x45,0xd0,0x43,0x49,0x52, +0x43,0x4c,0xc5,0x49,0x4e,0xcb,0x50,0x41,0x50,0x45,0xd2,0x46,0x4c,0x41,0x53,0xc8, +0x42,0x52,0x49,0x47,0x48,0xd4,0x49,0x4e,0x56,0x45,0x52,0x53,0xc5,0x4f,0x56,0x45, +0xd2,0x4f,0x55,0xd4,0x4c,0x50,0x52,0x49,0x4e,0xd4,0x4c,0x4c,0x49,0x53,0xd4,0x53, +0x54,0x4f,0xd0,0x52,0x45,0x41,0xc4,0x44,0x41,0x54,0xc1,0x52,0x45,0x53,0x54,0x4f, +0x52,0xc5,0x4e,0x45,0xd7,0x42,0x4f,0x52,0x44,0x45,0xd2,0x43,0x4f,0x4e,0x54,0x49, +0x4e,0x55,0xc5,0x44,0x49,0xcd,0x52,0x45,0xcd,0x46,0x4f,0xd2,0x47,0x4f,0x20,0x54, +0xcf,0x47,0x4f,0x20,0x53,0x55,0xc2,0x49,0x4e,0x50,0x55,0xd4,0x4c,0x4f,0x41,0xc4, +0x4c,0x49,0x53,0xd4,0x4c,0x45,0xd4,0x50,0x41,0x55,0x53,0xc5,0x4e,0x45,0x58,0xd4, +0x50,0x4f,0x4b,0xc5,0x50,0x52,0x49,0x4e,0xd4,0x50,0x4c,0x4f,0xd4,0x52,0x55,0xce, +0x53,0x41,0x56,0xc5,0x52,0x41,0x4e,0x44,0x4f,0x4d,0x49,0x5a,0xc5,0x49,0xc6,0x43, +0x4c,0xd3,0x44,0x52,0x41,0xd7,0x43,0x4c,0x45,0x41,0xd2,0x52,0x45,0x54,0x55,0x52, +0xce,0x43,0x4f,0x50,0xd9,0x42,0x48,0x59,0x36,0x35,0x54,0x47,0x56,0x4e,0x4a,0x55, +0x37,0x34,0x52,0x46,0x43,0x4d,0x4b,0x49,0x38,0x33,0x45,0x44,0x58,0x0e,0x4c,0x4f, +0x39,0x32,0x57,0x53,0x5a,0x20,0x0d,0x50,0x30,0x31,0x51,0x41,0xe3,0xc4,0xe0,0xe4, +0xb4,0xbc,0xbd,0xbb,0xaf,0xb0,0xb1,0xc0,0xa7,0xa6,0xbe,0xad,0xb2,0xba,0xe5,0xa5, +0xc2,0xe1,0xb3,0xb9,0xc1,0xb8,0x7e,0xdc,0xda,0x5c,0xb7,0x7b,0x7d,0xd8,0xbf,0xae, +0xaa,0xab,0xdd,0xde,0xdf,0x7f,0xb5,0xd6,0x7c,0xd5,0x5d,0xdb,0xb6,0xd9,0x5b,0xd7, +0x0c,0x07,0x06,0x04,0x05,0x08,0x0a,0x0b,0x09,0x0f,0xe2,0x2a,0x3f,0xcd,0xc8,0xcc, +0xcb,0x5e,0xac,0x2d,0x2b,0x3d,0x2e,0x2c,0x3b,0x22,0xc7,0x3c,0xc3,0x3e,0xc5,0x2f, +0xc9,0x60,0xc6,0x3a,0xd0,0xce,0xa8,0xca,0xd3,0xd4,0xd1,0xd2,0xa9,0xcf,0x2e,0x2f, +0x11,0xff,0xff,0x01,0xfe,0xfe,0xed,0x78,0x2f,0xe6,0x1f,0x28,0x0e,0x67,0x7d,0x14, +0xc0,0xd6,0x08,0xcb,0x3c,0x30,0xfa,0x53,0x5f,0x20,0xf4,0x2d,0xcb,0x00,0x38,0xe6, +0x7a,0x3c,0xc8,0xfe,0x28,0xc8,0xfe,0x19,0xc8,0x7b,0x5a,0x57,0xfe,0x18,0xc9,0xcd, +0x8e,0x02,0xc0,0x21,0x00,0x5c,0xcb,0x7e,0x20,0x07,0x23,0x35,0x2b,0x20,0x02,0x36, +0xff,0x7d,0x21,0x04,0x5c,0xbd,0x20,0xee,0xcd,0x1e,0x03,0xd0,0x21,0x00,0x5c,0xbe, +0x28,0x2e,0xeb,0x21,0x04,0x5c,0xbe,0x28,0x27,0xcb,0x7e,0x20,0x04,0xeb,0xcb,0x7e, +0xc8,0x5f,0x77,0x23,0x36,0x05,0x23,0x3a,0x09,0x5c,0x77,0x23,0xfd,0x4e,0x07,0xfd, +0x56,0x01,0xe5,0xcd,0x33,0x03,0xe1,0x77,0x32,0x08,0x5c,0xfd,0xcb,0x01,0xee,0xc9, +0x23,0x36,0x05,0x23,0x35,0xc0,0x3a,0x0a,0x5c,0x77,0x23,0x7e,0x18,0xea,0x42,0x16, +0x00,0x7b,0xfe,0x27,0xd0,0xfe,0x18,0x20,0x03,0xcb,0x78,0xc0,0x21,0x05,0x02,0x19, +0x7e,0x37,0xc9,0x7b,0xfe,0x3a,0x38,0x2f,0x0d,0xfa,0x4f,0x03,0x28,0x03,0xc6,0x4f, +0xc9,0x21,0xeb,0x01,0x04,0x28,0x03,0x21,0x05,0x02,0x16,0x00,0x19,0x7e,0xc9,0x21, +0x29,0x02,0xcb,0x40,0x28,0xf4,0xcb,0x5a,0x28,0x0a,0xfd,0xcb,0x30,0x5e,0xc0,0x04, +0xc0,0xc6,0x20,0xc9,0xc6,0xa5,0xc9,0xfe,0x30,0xd8,0x0d,0xfa,0x9d,0x03,0x20,0x19, +0x21,0x54,0x02,0xcb,0x68,0x28,0xd3,0xfe,0x38,0x30,0x07,0xd6,0x20,0x04,0xc8,0xc6, +0x08,0xc9,0xd6,0x36,0x04,0xc8,0xc6,0xfe,0xc9,0x21,0x30,0x02,0xfe,0x39,0x28,0xba, +0xfe,0x30,0x28,0xb6,0xe6,0x07,0xc6,0x80,0x04,0xc8,0xee,0x0f,0xc9,0x04,0xc8,0xcb, +0x68,0x21,0x30,0x02,0x20,0xa4,0xd6,0x10,0xfe,0x22,0x28,0x06,0xfe,0x20,0xc0,0x3e, +0x5f,0xc9,0x3e,0x40,0xc9,0xf3,0x7d,0xcb,0x3d,0xcb,0x3d,0x2f,0xe6,0x03,0x4f,0x06, +0x00,0xdd,0x21,0xd1,0x03,0xdd,0x09,0x3a,0x48,0x5c,0xe6,0x38,0x0f,0x0f,0x0f,0xf6, +0x08,0x00,0x00,0x00,0x04,0x0c,0x0d,0x20,0xfd,0x0e,0x3f,0x05,0xc2,0xd6,0x03,0xee, +0x10,0xd3,0xfe,0x44,0x4f,0xcb,0x67,0x20,0x09,0x7a,0xb3,0x28,0x09,0x79,0x4d,0x1b, +0xdd,0xe9,0x4d,0x0c,0xdd,0xe9,0xfb,0xc9,0xef,0x31,0x27,0xc0,0x03,0x34,0xec,0x6c, +0x98,0x1f,0xf5,0x04,0xa1,0x0f,0x38,0x21,0x92,0x5c,0x7e,0xa7,0x20,0x5e,0x23,0x4e, +0x23,0x46,0x78,0x17,0x9f,0xb9,0x20,0x54,0x23,0xbe,0x20,0x50,0x78,0xc6,0x3c,0xf2, +0x25,0x04,0xe2,0x6c,0x04,0x06,0xfa,0x04,0xd6,0x0c,0x30,0xfb,0xc6,0x0c,0xc5,0x21, +0x6e,0x04,0xcd,0x06,0x34,0xcd,0xb4,0x33,0xef,0x04,0x38,0xf1,0x86,0x77,0xef,0xc0, +0x02,0x31,0x38,0xcd,0x94,0x1e,0xfe,0x0b,0x30,0x22,0xef,0xe0,0x04,0xe0,0x34,0x80, +0x43,0x55,0x9f,0x80,0x01,0x05,0x34,0x35,0x71,0x03,0x38,0xcd,0x99,0x1e,0xc5,0xcd, +0x99,0x1e,0xe1,0x50,0x59,0x7a,0xb3,0xc8,0x1b,0xc3,0xb5,0x03,0xcf,0x0a,0x89,0x02, +0xd0,0x12,0x86,0x89,0x0a,0x97,0x60,0x75,0x89,0x12,0xd5,0x17,0x1f,0x89,0x1b,0x90, +0x41,0x02,0x89,0x24,0xd0,0x53,0xca,0x89,0x2e,0x9d,0x36,0xb1,0x89,0x38,0xff,0x49, +0x3e,0x89,0x43,0xff,0x6a,0x73,0x89,0x4f,0xa7,0x00,0x54,0x89,0x5c,0x00,0x00,0x00, +0x89,0x69,0x14,0xf6,0x24,0x89,0x76,0xf1,0x10,0x05,0x1e,0x8c,0xc8,0x2b,0xc7,0x8e, +0xc0,0x8e,0xd8,0x6a,0x27,0x06,0x57,0xbe,0x6e,0x48,0xb5,0x03,0xf3,0xa5,0xcb,0x06, +0xeb,0xe8,0x21,0x3f,0x05,0xe5,0x21,0x80,0x1f,0xcb,0x7f,0x28,0x03,0x21,0x98,0x0c, +0x08,0x13,0xdd,0x2b,0xf3,0x3e,0x02,0x47,0x10,0xfe,0xd3,0xfe,0xee,0x0f,0x06,0xa4, +0x2d,0x20,0xf5,0x05,0x25,0xf2,0xd8,0x04,0x06,0x2f,0x10,0xfe,0xd3,0xfe,0x3e,0x0d, +0x06,0x37,0x10,0xfe,0xd3,0xfe,0x01,0x0e,0x3b,0x08,0x6f,0xc3,0x07,0x05,0x7a,0xb3, +0x28,0x0c,0xdd,0x6e,0x00,0x7c,0xad,0x67,0x3e,0x01,0x37,0xc3,0x25,0x05,0x6c,0x18, +0xf4,0x79,0xcb,0x78,0x10,0xfe,0x30,0x04,0x06,0x42,0x10,0xfe,0xd3,0xfe,0x06,0x3e, +0x20,0xef,0x05,0xaf,0x3c,0xcb,0x15,0xc2,0x14,0x05,0x1b,0xdd,0x23,0x06,0x31,0x3e, +0x7f,0xdb,0xfe,0x1f,0xd0,0x7a,0x3c,0xc2,0xfe,0x04,0x06,0x3b,0x10,0xfe,0xc9,0xf5, +0x3a,0x48,0x5c,0xe6,0x38,0x0f,0x0f,0x0f,0xd3,0xfe,0x3e,0x7f,0xdb,0xfe,0x1f,0xfb, +0x38,0x02,0xcf,0x0c,0xf1,0xc9,0x14,0x08,0x15,0xf3,0x3e,0x0f,0xd3,0xfe,0x21,0x3f, +0x05,0xe5,0xdb,0xfe,0x1f,0xe6,0x20,0xf6,0x02,0x4f,0xbf,0xc0,0xcd,0xe7,0x05,0x30, +0xfa,0x21,0x15,0x04,0x10,0xfe,0x2b,0x7c,0xb5,0x20,0xf9,0xcd,0xe3,0x05,0x30,0xeb, +0x06,0x9c,0xcd,0xe3,0x05,0x30,0xe4,0x3e,0xc6,0xb8,0x30,0xe0,0x24,0x20,0xf1,0x06, +0xc9,0xcd,0xe7,0x05,0x30,0xd5,0x78,0xfe,0xd4,0x30,0xf4,0xcd,0xe7,0x05,0xd0,0x79, +0xee,0x03,0x4f,0x26,0x00,0x06,0xb0,0x18,0x1f,0x08,0x20,0x07,0x30,0x0f,0xdd,0x75, +0x00,0x18,0x0f,0xcb,0x11,0xad,0xc0,0x79,0x1f,0x4f,0x13,0x18,0x07,0xdd,0x7e,0x00, +0xad,0xc0,0xdd,0x23,0x1b,0x08,0x06,0xb2,0x2e,0x01,0xcd,0xe3,0x05,0xd0,0x3e,0xcb, +0xb8,0xcb,0x15,0x06,0xb0,0xd2,0xca,0x05,0x7c,0xad,0x67,0x7a,0xb3,0x20,0xca,0x7c, +0xfe,0x01,0xc9,0xcd,0xe7,0x05,0xd0,0x3e,0x16,0x3d,0x20,0xfd,0xa7,0x04,0xc8,0x3e, +0x7f,0xdb,0xfe,0x1f,0xd0,0xa9,0xe6,0x20,0x28,0xf3,0x79,0x2f,0x4f,0xe6,0x07,0xf6, +0x08,0xd3,0xfe,0x37,0xc9,0xf1,0x3a,0x74,0x5c,0xd6,0xe0,0x32,0x74,0x5c,0xcd,0x8c, +0x1c,0xcd,0x30,0x25,0x28,0x3c,0x01,0x11,0x00,0x3a,0x74,0x5c,0xa7,0x28,0x02,0x0e, +0x22,0xf7,0xd5,0xdd,0xe1,0x06,0x0b,0x3e,0x20,0x12,0x13,0x10,0xfc,0xdd,0x36,0x01, +0xff,0xcd,0xf1,0x2b,0x21,0xf6,0xff,0x0b,0x09,0x03,0x30,0x0f,0x3a,0x74,0x5c,0xa7, +0x20,0x02,0xcf,0x0e,0x78,0xb1,0x28,0x0a,0x01,0x0a,0x00,0xdd,0xe5,0xe1,0x23,0xeb, +0xed,0xb0,0xdf,0xfe,0xe4,0x20,0x49,0x3a,0x74,0x5c,0xfe,0x03,0xca,0x8a,0x1c,0xe7, +0xcd,0xb2,0x28,0xcb,0xf9,0x30,0x0b,0x21,0x00,0x00,0x3a,0x74,0x5c,0x3d,0x28,0x15, +0xcf,0x01,0xc2,0x8a,0x1c,0xcd,0x30,0x25,0x28,0x18,0x23,0x7e,0xdd,0x77,0x0b,0x23, +0x7e,0xdd,0x77,0x0c,0x23,0xdd,0x71,0x0e,0x3e,0x01,0xcb,0x71,0x28,0x01,0x3c,0xdd, +0x77,0x00,0xeb,0xe7,0xfe,0x29,0x20,0xda,0xe7,0xcd,0xee,0x1b,0xeb,0xc3,0x5a,0x07, +0xfe,0xaa,0x20,0x1f,0x3a,0x74,0x5c,0xfe,0x03,0xca,0x8a,0x1c,0xe7,0xcd,0xee,0x1b, +0xdd,0x36,0x0b,0x00,0xdd,0x36,0x0c,0x1b,0x21,0x00,0x40,0xdd,0x75,0x0d,0xdd,0x74, +0x0e,0x18,0x4d,0xfe,0xaf,0x20,0x4f,0x3a,0x74,0x5c,0xfe,0x03,0xca,0x8a,0x1c,0xe7, +0xcd,0x48,0x20,0x20,0x0c,0x3a,0x74,0x5c,0xa7,0xca,0x8a,0x1c,0xcd,0xe6,0x1c,0x18, +0x0f,0xcd,0x82,0x1c,0xdf,0xfe,0x2c,0x28,0x0c,0x3a,0x74,0x5c,0xa7,0xca,0x8a,0x1c, +0xcd,0xe6,0x1c,0x18,0x04,0xe7,0xcd,0x82,0x1c,0xcd,0xee,0x1b,0xcd,0x99,0x1e,0xdd, +0x71,0x0b,0xdd,0x70,0x0c,0xcd,0x99,0x1e,0xdd,0x71,0x0d,0xdd,0x70,0x0e,0x60,0x69, +0xdd,0x36,0x00,0x03,0x18,0x44,0xfe,0xca,0x28,0x09,0xcd,0xee,0x1b,0xdd,0x36,0x0e, +0x80,0x18,0x17,0x3a,0x74,0x5c,0xa7,0xc2,0x8a,0x1c,0xe7,0xcd,0x82,0x1c,0xcd,0xee, +0x1b,0xcd,0x99,0x1e,0xdd,0x71,0x0d,0xdd,0x70,0x0e,0xdd,0x36,0x00,0x00,0x2a,0x59, +0x5c,0xed,0x5b,0x53,0x5c,0x37,0xed,0x52,0xdd,0x75,0x0b,0xdd,0x74,0x0c,0x2a,0x4b, +0x5c,0xed,0x52,0xdd,0x75,0x0f,0xdd,0x74,0x10,0xeb,0x3a,0x74,0x5c,0xa7,0xca,0x70, +0x09,0xe5,0x01,0x11,0x00,0xdd,0x09,0xdd,0xe5,0x11,0x11,0x00,0xaf,0x37,0xcd,0x56, +0x05,0xdd,0xe1,0x30,0xf2,0x3e,0xfe,0xcd,0x01,0x16,0xfd,0x36,0x52,0x03,0x0e,0x80, +0xdd,0x7e,0x00,0xdd,0xbe,0xef,0x20,0x02,0x0e,0xf6,0xfe,0x04,0x30,0xd9,0x11,0xc0, +0x09,0xc5,0xcd,0x0a,0x0c,0xc1,0xdd,0xe5,0xd1,0x21,0xf0,0xff,0x19,0x06,0x0a,0x7e, +0x3c,0x20,0x03,0x79,0x80,0x4f,0x13,0x1a,0xbe,0x23,0x20,0x01,0x0c,0xd7,0x10,0xf6, +0xcb,0x79,0x20,0xb3,0x3e,0x0d,0xd7,0xe1,0xdd,0x7e,0x00,0xfe,0x03,0x28,0x0c,0x3a, +0x74,0x5c,0x3d,0xca,0x08,0x08,0xfe,0x02,0xca,0xb6,0x08,0xe5,0xdd,0x6e,0xfa,0xdd, +0x66,0xfb,0xdd,0x5e,0x0b,0xdd,0x56,0x0c,0x7c,0xb5,0x28,0x0d,0xed,0x52,0x38,0x26, +0x28,0x07,0xdd,0x7e,0x00,0xfe,0x03,0x20,0x1d,0xe1,0x7c,0xb5,0x20,0x06,0xdd,0x6e, +0x0d,0xdd,0x66,0x0e,0xe5,0xdd,0xe1,0x3a,0x74,0x5c,0xfe,0x02,0x37,0x20,0x01,0xa7, +0x3e,0xff,0xcd,0x56,0x05,0xd8,0xcf,0x1a,0xdd,0x5e,0x0b,0xdd,0x56,0x0c,0xe5,0x7c, +0xb5,0x20,0x06,0x13,0x13,0x13,0xeb,0x18,0x0c,0xdd,0x6e,0xfa,0xdd,0x66,0xfb,0xeb, +0x37,0xed,0x52,0x38,0x09,0x11,0x05,0x00,0x19,0x44,0x4d,0xcd,0x05,0x1f,0xe1,0xdd, +0x7e,0x00,0xa7,0x28,0x3e,0x7c,0xb5,0x28,0x13,0x2b,0x46,0x2b,0x4e,0x2b,0x03,0x03, +0x03,0xdd,0x22,0x5f,0x5c,0xcd,0xe8,0x19,0xdd,0x2a,0x5f,0x5c,0x2a,0x59,0x5c,0x2b, +0xdd,0x4e,0x0b,0xdd,0x46,0x0c,0xc5,0x03,0x03,0x03,0xdd,0x7e,0xfd,0xf5,0xcd,0x55, +0x16,0x23,0xf1,0x77,0xd1,0x23,0x73,0x23,0x72,0x23,0xe5,0xdd,0xe1,0x37,0x3e,0xff, +0xc3,0x02,0x08,0xeb,0x2a,0x59,0x5c,0x2b,0xdd,0x22,0x5f,0x5c,0xdd,0x4e,0x0b,0xdd, +0x46,0x0c,0xc5,0xcd,0xe5,0x19,0xc1,0xe5,0xc5,0xcd,0x55,0x16,0xdd,0x2a,0x5f,0x5c, +0x23,0xdd,0x4e,0x0f,0xdd,0x46,0x10,0x09,0x22,0x4b,0x5c,0xdd,0x66,0x0e,0x7c,0xe6, +0xc0,0x20,0x0a,0xdd,0x6e,0x0d,0x22,0x42,0x5c,0xfd,0x36,0x0a,0x00,0xd1,0xdd,0xe1, +0x37,0x3e,0xff,0xc3,0x02,0x08,0xdd,0x4e,0x0b,0xdd,0x46,0x0c,0xc5,0x03,0xf7,0x36, +0x80,0xeb,0xd1,0xe5,0xe5,0xdd,0xe1,0x37,0x3e,0xff,0xcd,0x02,0x08,0xe1,0xed,0x5b, +0x53,0x5c,0x7e,0xe6,0xc0,0x20,0x19,0x1a,0x13,0xbe,0x23,0x20,0x02,0x1a,0xbe,0x1b, +0x2b,0x30,0x08,0xe5,0xeb,0xcd,0xb8,0x19,0xe1,0x18,0xec,0xcd,0x2c,0x09,0x18,0xe2, +0x7e,0x4f,0xfe,0x80,0xc8,0xe5,0x2a,0x4b,0x5c,0x7e,0xfe,0x80,0x28,0x25,0xb9,0x28, +0x08,0xc5,0xcd,0xb8,0x19,0xc1,0xeb,0x18,0xf0,0xe6,0xe0,0xfe,0xa0,0x20,0x12,0xd1, +0xd5,0xe5,0x23,0x13,0x1a,0xbe,0x20,0x06,0x17,0x30,0xf7,0xe1,0x18,0x03,0xe1,0x18, +0xe0,0x3e,0xff,0xd1,0xeb,0x3c,0x37,0xcd,0x2c,0x09,0x18,0xc4,0x20,0x10,0x08,0x22, +0x5f,0x5c,0xeb,0xcd,0xb8,0x19,0xcd,0xe8,0x19,0xeb,0x2a,0x5f,0x5c,0x08,0x08,0xd5, +0xcd,0xb8,0x19,0x22,0x5f,0x5c,0x2a,0x53,0x5c,0xe3,0xc5,0x08,0x38,0x07,0x2b,0xcd, +0x55,0x16,0x23,0x18,0x03,0xcd,0x55,0x16,0x23,0xc1,0xd1,0xed,0x53,0x53,0x5c,0xed, +0x5b,0x5f,0x5c,0xc5,0xd5,0xeb,0xed,0xb0,0xe1,0xc1,0xd5,0xcd,0xe8,0x19,0xd1,0xc9, +0xe5,0x3e,0xfd,0xcd,0x01,0x16,0xaf,0x11,0xa1,0x09,0xcd,0x0a,0x0c,0xfd,0xcb,0x02, +0xee,0xcd,0xd4,0x15,0xdd,0xe5,0x11,0x11,0x00,0xaf,0xcd,0xc2,0x04,0xdd,0xe1,0x06, +0x32,0x76,0x10,0xfd,0xdd,0x5e,0x0b,0xdd,0x56,0x0c,0x3e,0xff,0xdd,0xe1,0xc3,0xc2, +0x04,0x80,0x53,0x74,0x61,0x72,0x74,0x20,0x74,0x61,0x70,0x65,0x2c,0x20,0x74,0x68, +0x65,0x6e,0x20,0x70,0x72,0x65,0x73,0x73,0x20,0x61,0x6e,0x79,0x20,0x6b,0x65,0x79, +0xae,0x0d,0x50,0x72,0x6f,0x67,0x72,0x61,0x6d,0x3a,0xa0,0x0d,0x4e,0x75,0x6d,0x62, +0x65,0x72,0x20,0x61,0x72,0x72,0x61,0x79,0x3a,0xa0,0x0d,0x43,0x68,0x61,0x72,0x61, +0x63,0x74,0x65,0x72,0x20,0x61,0x72,0x72,0x61,0x79,0x3a,0xa0,0x0d,0x42,0x79,0x74, +0x65,0x73,0x3a,0xa0,0xcd,0x03,0x0b,0xfe,0x20,0xd2,0xd9,0x0a,0xfe,0x06,0x38,0x69, +0xfe,0x18,0x30,0x65,0x21,0x0b,0x0a,0x5f,0x16,0x00,0x19,0x5e,0x19,0xe5,0xc3,0x03, +0x0b,0x4e,0x57,0x10,0x29,0x54,0x53,0x52,0x37,0x50,0x4f,0x5f,0x5e,0x5d,0x5c,0x5b, +0x5a,0x54,0x53,0x0c,0x3e,0x22,0xb9,0x20,0x11,0xfd,0xcb,0x01,0x4e,0x20,0x09,0x04, +0x0e,0x02,0x3e,0x18,0xb8,0x20,0x03,0x05,0x0e,0x21,0xc3,0xd9,0x0d,0x3a,0x91,0x5c, +0xf5,0xfd,0x36,0x57,0x01,0x3e,0x20,0xcd,0x65,0x0b,0xf1,0x32,0x91,0x5c,0xc9,0xfd, +0xcb,0x01,0x4e,0xc2,0xcd,0x0e,0x0e,0x21,0xcd,0x55,0x0c,0x05,0xc3,0xd9,0x0d,0xcd, +0x03,0x0b,0x79,0x3d,0x3d,0xe6,0x10,0x18,0x5a,0x3e,0x3f,0x18,0x6c,0x11,0x87,0x0a, +0x32,0x0f,0x5c,0x18,0x0b,0x11,0x6d,0x0a,0x18,0x03,0x11,0x87,0x0a,0x32,0x0e,0x5c, +0x2a,0x51,0x5c,0x73,0x23,0x72,0xc9,0x11,0xf4,0x09,0xcd,0x80,0x0a,0x2a,0x0e,0x5c, +0x57,0x7d,0xfe,0x16,0xda,0x11,0x22,0x20,0x29,0x44,0x4a,0x3e,0x1f,0x91,0x38,0x0c, +0xc6,0x02,0x4f,0xfd,0xcb,0x01,0x4e,0x20,0x16,0x3e,0x16,0x90,0xda,0x9f,0x1e,0x3c, +0x47,0x04,0xfd,0xcb,0x02,0x46,0xc2,0x55,0x0c,0xfd,0xbe,0x31,0xda,0x86,0x0c,0xc3, +0xd9,0x0d,0x7c,0xcd,0x03,0x0b,0x81,0x3d,0xe6,0x1f,0xc8,0x57,0xfd,0xcb,0x01,0xc6, +0x3e,0x20,0xcd,0x3b,0x0c,0x15,0x20,0xf8,0xc9,0xcd,0x24,0x0b,0xfd,0xcb,0x01,0x4e, +0x20,0x1a,0xfd,0xcb,0x02,0x46,0x20,0x08,0xed,0x43,0x88,0x5c,0x22,0x84,0x5c,0xc9, +0xed,0x43,0x8a,0x5c,0xed,0x43,0x82,0x5c,0x22,0x86,0x5c,0xc9,0xfd,0x71,0x45,0x22, +0x80,0x5c,0xc9,0xfd,0xcb,0x01,0x4e,0x20,0x14,0xed,0x4b,0x88,0x5c,0x2a,0x84,0x5c, +0xfd,0xcb,0x02,0x46,0xc8,0xed,0x4b,0x8a,0x5c,0x2a,0x86,0x5c,0xc9,0xfd,0x4e,0x45, +0x2a,0x80,0x5c,0xc9,0xfe,0x80,0x38,0x3d,0xfe,0x90,0x30,0x26,0x47,0xcd,0x38,0x0b, +0xcd,0x03,0x0b,0x11,0x92,0x5c,0x18,0x47,0x21,0x92,0x5c,0xcd,0x3e,0x0b,0xcb,0x18, +0x9f,0xe6,0x0f,0x4f,0xcb,0x18,0x9f,0xe6,0xf0,0xb1,0x0e,0x04,0x77,0x23,0x0d,0x20, +0xfb,0xc9,0xd6,0xa5,0x30,0x09,0xc6,0x15,0xc5,0xed,0x4b,0x7b,0x5c,0x18,0x0b,0xcd, +0x10,0x0c,0xc3,0x03,0x0b,0xc5,0xed,0x4b,0x36,0x5c,0xeb,0x21,0x3b,0x5c,0xcb,0x86, +0xfe,0x20,0x20,0x02,0xcb,0xc6,0x26,0x00,0x6f,0x29,0x29,0x29,0x09,0xc1,0xeb,0x79, +0x3d,0x3e,0x21,0x20,0x0e,0x05,0x4f,0xfd,0xcb,0x01,0x4e,0x28,0x06,0xd5,0xcd,0xcd, +0x0e,0xd1,0x79,0xb9,0xd5,0xcc,0x55,0x0c,0xd1,0xc5,0xe5,0x3a,0x91,0x5c,0x06,0xff, +0x1f,0x38,0x01,0x04,0x1f,0x1f,0x9f,0x4f,0x3e,0x08,0xa7,0xfd,0xcb,0x01,0x4e,0x28, +0x05,0xfd,0xcb,0x30,0xce,0x37,0xeb,0x08,0x1a,0xa0,0xae,0xa9,0x12,0x08,0x38,0x13, +0x14,0x23,0x3d,0x20,0xf2,0xeb,0x25,0xfd,0xcb,0x01,0x4e,0xcc,0xdb,0x0b,0xe1,0xc1, +0x0d,0x23,0xc9,0x08,0x3e,0x20,0x83,0x5f,0x08,0x18,0xe6,0x7c,0x0f,0x0f,0x0f,0xe6, +0x03,0xf6,0x58,0x67,0xed,0x5b,0x8f,0x5c,0x7e,0xab,0xa2,0xab,0xfd,0xcb,0x57,0x76, +0x28,0x08,0xe6,0xc7,0xcb,0x57,0x20,0x02,0xee,0x38,0xfd,0xcb,0x57,0x66,0x28,0x08, +0xe6,0xf8,0xcb,0x6f,0x20,0x02,0xee,0x07,0x77,0xc9,0xe5,0x26,0x00,0xe3,0x18,0x04, +0x11,0x95,0x00,0xf5,0xcd,0x41,0x0c,0x38,0x09,0x3e,0x20,0xfd,0xcb,0x01,0x46,0xcc, +0x3b,0x0c,0x1a,0xe6,0x7f,0xcd,0x3b,0x0c,0x1a,0x13,0x87,0x30,0xf5,0xd1,0xfe,0x48, +0x28,0x03,0xfe,0x82,0xd8,0x7a,0xfe,0x03,0xd8,0x3e,0x20,0xd5,0xd9,0xd7,0xd9,0xd1, +0xc9,0xf5,0xeb,0x3c,0xcb,0x7e,0x23,0x28,0xfb,0x3d,0x20,0xf8,0xeb,0xf1,0xfe,0x20, +0xd8,0x1a,0xd6,0x41,0xc9,0xfd,0xcb,0x01,0x4e,0xc0,0x11,0xd9,0x0d,0xd5,0x78,0xfd, +0xcb,0x02,0x46,0xc2,0x02,0x0d,0xfd,0xbe,0x31,0x38,0x1b,0xc0,0xfd,0xcb,0x02,0x66, +0x28,0x16,0xfd,0x5e,0x2d,0x1d,0x28,0x5a,0x3e,0x00,0xcd,0x01,0x16,0xed,0x7b,0x3f, +0x5c,0xfd,0xcb,0x02,0xa6,0xc9,0xcf,0x04,0xfd,0x35,0x52,0x20,0x45,0x3e,0x18,0x90, +0x32,0x8c,0x5c,0x2a,0x8f,0x5c,0xe5,0x3a,0x91,0x5c,0xf5,0x3e,0xfd,0xcd,0x01,0x16, +0xaf,0x11,0xf8,0x0c,0xcd,0x0a,0x0c,0xfd,0xcb,0x02,0xee,0x21,0x3b,0x5c,0xcb,0xde, +0xcb,0xae,0xd9,0xcd,0xd4,0x15,0xd9,0xfe,0x20,0x28,0x45,0xfe,0xe2,0x28,0x41,0xf6, +0x20,0xfe,0x6e,0x28,0x3b,0x3e,0xfe,0xcd,0x01,0x16,0xf1,0x32,0x91,0x5c,0xe1,0x22, +0x8f,0x5c,0xcd,0xfe,0x0d,0xfd,0x46,0x31,0x04,0x0e,0x21,0xc5,0xcd,0x9b,0x0e,0x7c, +0x0f,0x0f,0x0f,0xe6,0x03,0xf6,0x58,0x67,0x11,0xe0,0x5a,0x1a,0x4e,0x06,0x20,0xeb, +0x12,0x71,0x13,0x23,0x10,0xfa,0xc1,0xc9,0x80,0x73,0x63,0x72,0x6f,0x6c,0x6c,0xbf, +0xcf,0x0c,0xfe,0x02,0x38,0x80,0xfd,0x86,0x31,0xd6,0x19,0xd0,0xed,0x44,0xc5,0x47, +0x2a,0x8f,0x5c,0xe5,0x2a,0x91,0x5c,0xe5,0xcd,0x4d,0x0d,0x78,0xf5,0x21,0x6b,0x5c, +0x46,0x78,0x3c,0x77,0x21,0x89,0x5c,0xbe,0x38,0x03,0x34,0x06,0x18,0xcd,0x00,0x0e, +0xf1,0x3d,0x20,0xe8,0xe1,0xfd,0x75,0x57,0xe1,0x22,0x8f,0x5c,0xed,0x4b,0x88,0x5c, +0xfd,0xcb,0x02,0x86,0xcd,0xd9,0x0d,0xfd,0xcb,0x02,0xc6,0xc1,0xc9,0xaf,0x2a,0x8d, +0x5c,0xfd,0xcb,0x02,0x46,0x28,0x04,0x67,0xfd,0x6e,0x0e,0x22,0x8f,0x5c,0x21,0x91, +0x5c,0x20,0x02,0x7e,0x0f,0xae,0xe6,0x55,0xae,0x77,0xc9,0xcd,0xaf,0x0d,0x21,0x3c, +0x5c,0xcb,0xae,0xcb,0xc6,0xcd,0x4d,0x0d,0xfd,0x46,0x31,0xcd,0x44,0x0e,0x21,0xc0, +0x5a,0x3a,0x8d,0x5c,0x05,0x18,0x07,0x0e,0x20,0x2b,0x77,0x0d,0x20,0xfb,0x10,0xf7, +0xfd,0x36,0x31,0x02,0x3e,0xfd,0xcd,0x01,0x16,0x2a,0x51,0x5c,0x11,0xf4,0x09,0xa7, +0x73,0x23,0x72,0x23,0x11,0xa8,0x10,0x3f,0x38,0xf6,0x01,0x21,0x17,0x18,0x2a,0x21, +0x00,0x00,0x22,0x7d,0x5c,0xfd,0xcb,0x30,0x86,0xcd,0x94,0x0d,0x3e,0xfe,0xcd,0x01, +0x16,0xcd,0x4d,0x0d,0x06,0x18,0xcd,0x44,0x0e,0x2a,0x51,0x5c,0x11,0xf4,0x09,0x73, +0x23,0x72,0xfd,0x36,0x52,0x01,0x01,0x21,0x18,0x21,0x00,0x5b,0xfd,0xcb,0x01,0x4e, +0x20,0x12,0x78,0xfd,0xcb,0x02,0x46,0x28,0x05,0xfd,0x86,0x31,0xd6,0x18,0xc5,0x47, +0xcd,0x9b,0x0e,0xc1,0x3e,0x21,0x91,0x5f,0x16,0x00,0x19,0xc3,0xdc,0x0a,0x06,0x17, +0xcd,0x9b,0x0e,0x0e,0x08,0xc5,0xe5,0x78,0xe6,0x07,0x78,0x20,0x0c,0xeb,0x21,0xe0, +0xf8,0x19,0xeb,0x01,0x20,0x00,0x3d,0xed,0xb0,0xeb,0x21,0xe0,0xff,0x19,0xeb,0x47, +0xe6,0x07,0x0f,0x0f,0x0f,0x4f,0x78,0x06,0x00,0xed,0xb0,0x06,0x07,0x09,0xe6,0xf8, +0x20,0xdb,0xe1,0x24,0xc1,0x0d,0x20,0xcd,0xcd,0x88,0x0e,0x21,0xe0,0xff,0x19,0xeb, +0xed,0xb0,0x06,0x01,0xc5,0xcd,0x9b,0x0e,0x0e,0x08,0xc5,0xe5,0x78,0xe6,0x07,0x0f, +0x0f,0x0f,0x4f,0x78,0x06,0x00,0x0d,0x54,0x5d,0x36,0x00,0x13,0xed,0xb0,0x11,0x01, +0x07,0x19,0x3d,0xe6,0xf8,0x47,0x20,0xe5,0xe1,0x24,0xc1,0x0d,0x20,0xdc,0xcd,0x88, +0x0e,0x62,0x6b,0x13,0x3a,0x8d,0x5c,0xfd,0xcb,0x02,0x46,0x28,0x03,0x3a,0x48,0x5c, +0x77,0x0b,0xed,0xb0,0xc1,0x0e,0x21,0xc9,0x7c,0x0f,0x0f,0x0f,0x3d,0xf6,0x50,0x67, +0xeb,0x61,0x68,0x29,0x29,0x29,0x29,0x29,0x44,0x4d,0xc9,0x3e,0x18,0x90,0x57,0x0f, +0x0f,0x0f,0xe6,0xe0,0x6f,0x7a,0xe6,0x18,0xf6,0x40,0x67,0xc9,0xf3,0x06,0xb0,0x21, +0x00,0x40,0xe5,0xc5,0xcd,0xf4,0x0e,0xc1,0xe1,0x24,0x7c,0xe6,0x07,0x20,0x0a,0x7d, +0xc6,0x20,0x6f,0x3f,0x9f,0xe6,0xf8,0x84,0x67,0x10,0xe7,0x18,0x0d,0xf3,0x21,0x00, +0x5b,0x06,0x08,0xc5,0xcd,0xf4,0x0e,0xc1,0x10,0xf9,0x3e,0x04,0xd3,0xfb,0xfb,0x21, +0x00,0x5b,0xfd,0x75,0x46,0xaf,0x47,0x77,0x23,0x10,0xfc,0xfd,0xcb,0x30,0x8e,0x0e, +0x21,0xc3,0xd9,0x0d,0x78,0xfe,0x03,0x9f,0xe6,0x02,0xd3,0xfb,0x57,0xcd,0x54,0x1f, +0x38,0x0a,0x3e,0x04,0xd3,0xfb,0xfb,0xcd,0xdf,0x0e,0xcf,0x0c,0xdb,0xfb,0x87,0xf8, +0x30,0xeb,0x0e,0x20,0x5e,0x23,0x06,0x08,0xcb,0x12,0xcb,0x13,0xcb,0x1a,0xdb,0xfb, +0x1f,0x30,0xfb,0x7a,0xd3,0xfb,0x10,0xf0,0x0d,0x20,0xe9,0xc9,0x2a,0x3d,0x5c,0xe5, +0x21,0x7f,0x10,0xe5,0xed,0x73,0x3d,0x5c,0xcd,0xd4,0x15,0xf5,0x16,0x00,0xfd,0x5e, +0xff,0x21,0xc8,0x00,0xcd,0xb5,0x03,0xf1,0x21,0x38,0x0f,0xe5,0xfe,0x18,0x30,0x31, +0xfe,0x07,0x38,0x2d,0xfe,0x10,0x38,0x3a,0x01,0x02,0x00,0x57,0xfe,0x16,0x38,0x0c, +0x03,0xfd,0xcb,0x37,0x7e,0xca,0x1e,0x10,0xcd,0xd4,0x15,0x5f,0xcd,0xd4,0x15,0xd5, +0x2a,0x5b,0x5c,0xfd,0xcb,0x07,0x86,0xcd,0x55,0x16,0xc1,0x23,0x70,0x23,0x71,0x18, +0x0a,0xfd,0xcb,0x07,0x86,0x2a,0x5b,0x5c,0xcd,0x52,0x16,0x12,0x13,0xed,0x53,0x5b, +0x5c,0xc9,0x5f,0x16,0x00,0x21,0x99,0x0f,0x19,0x5e,0x19,0xe5,0x2a,0x5b,0x5c,0xc9, +0x09,0x66,0x6a,0x50,0xb5,0x70,0x7e,0xcf,0xd4,0x2a,0x49,0x5c,0xfd,0xcb,0x37,0x6e, +0xc2,0x97,0x10,0xcd,0x6e,0x19,0xcd,0x95,0x16,0x7a,0xb3,0xca,0x97,0x10,0xe5,0x23, +0x4e,0x23,0x46,0x21,0x0a,0x00,0x09,0x44,0x4d,0xcd,0x05,0x1f,0xcd,0x97,0x10,0x2a, +0x51,0x5c,0xe3,0xe5,0x3e,0xff,0xcd,0x01,0x16,0xe1,0x2b,0xfd,0x35,0x0f,0xcd,0x55, +0x18,0xfd,0x34,0x0f,0x2a,0x59,0x5c,0x23,0x23,0x23,0x23,0x22,0x5b,0x5c,0xe1,0xcd, +0x15,0x16,0xc9,0xfd,0xcb,0x37,0x6e,0x20,0x08,0x21,0x49,0x5c,0xcd,0x0f,0x19,0x18, +0x6d,0xfd,0x36,0x00,0x10,0x18,0x1d,0xcd,0x31,0x10,0x18,0x05,0x7e,0xfe,0x0d,0xc8, +0x23,0x22,0x5b,0x5c,0xc9,0xcd,0x31,0x10,0x01,0x01,0x00,0xc3,0xe8,0x19,0xcd,0xd4, +0x15,0xcd,0xd4,0x15,0xe1,0xe1,0xe1,0x22,0x3d,0x5c,0xfd,0xcb,0x00,0x7e,0xc0,0xf9, +0xc9,0x37,0xcd,0x95,0x11,0xed,0x52,0x19,0x23,0xc1,0xd8,0xc5,0x44,0x4d,0x62,0x6b, +0x23,0x1a,0xe6,0xf0,0xfe,0x10,0x20,0x09,0x23,0x1a,0xd6,0x17,0xce,0x00,0x20,0x01, +0x23,0xa7,0xed,0x42,0x09,0xeb,0x38,0xe6,0xc9,0xfd,0xcb,0x37,0x6e,0xc0,0x2a,0x49, +0x5c,0xcd,0x6e,0x19,0xeb,0xcd,0x95,0x16,0x21,0x4a,0x5c,0xcd,0x1c,0x19,0xcd,0x95, +0x17,0x3e,0x00,0xc3,0x01,0x16,0xfd,0xcb,0x37,0x7e,0x28,0xa8,0xc3,0x81,0x0f,0xfd, +0xcb,0x30,0x66,0x28,0xa1,0xfd,0x36,0x00,0xff,0x16,0x00,0xfd,0x5e,0xfe,0x21,0x90, +0x1a,0xcd,0xb5,0x03,0xc3,0x30,0x0f,0xe5,0xcd,0x90,0x11,0x2b,0xcd,0xe5,0x19,0x22, +0x5b,0x5c,0xfd,0x36,0x07,0x00,0xe1,0xc9,0xfd,0xcb,0x02,0x5e,0xc4,0x1d,0x11,0xa7, +0xfd,0xcb,0x01,0x6e,0xc8,0x3a,0x08,0x5c,0xfd,0xcb,0x01,0xae,0xf5,0xfd,0xcb,0x02, +0x6e,0xc4,0x6e,0x0d,0xf1,0xfe,0x20,0x30,0x52,0xfe,0x10,0x30,0x2d,0xfe,0x06,0x30, +0x0a,0x47,0xe6,0x01,0x4f,0x78,0x1f,0xc6,0x12,0x18,0x2a,0x20,0x09,0x21,0x6a,0x5c, +0x3e,0x08,0xae,0x77,0x18,0x0e,0xfe,0x0e,0xd8,0xd6,0x0d,0x21,0x41,0x5c,0xbe,0x77, +0x20,0x02,0x36,0x00,0xfd,0xcb,0x02,0xde,0xbf,0xc9,0x47,0xe6,0x07,0x4f,0x3e,0x10, +0xcb,0x58,0x20,0x01,0x3c,0xfd,0x71,0xd3,0x11,0x0d,0x11,0x18,0x06,0x3a,0x0d,0x5c, +0x11,0xa8,0x10,0x2a,0x4f,0x5c,0x23,0x23,0x73,0x23,0x72,0x37,0xc9,0xcd,0x4d,0x0d, +0xfd,0xcb,0x02,0x9e,0xfd,0xcb,0x02,0xae,0x2a,0x8a,0x5c,0xe5,0x2a,0x3d,0x5c,0xe5, +0x21,0x67,0x11,0xe5,0xed,0x73,0x3d,0x5c,0x2a,0x82,0x5c,0xe5,0x37,0xcd,0x95,0x11, +0xeb,0xcd,0x7d,0x18,0xeb,0xcd,0xe1,0x18,0x2a,0x8a,0x5c,0xe3,0xeb,0xcd,0x4d,0x0d, +0x3a,0x8b,0x5c,0x92,0x38,0x26,0x20,0x06,0x7b,0xfd,0x96,0x50,0x30,0x1e,0x3e,0x20, +0xd5,0xcd,0xf4,0x09,0xd1,0x18,0xe9,0x16,0x00,0xfd,0x5e,0xfe,0x21,0x90,0x1a,0xcd, +0xb5,0x03,0xfd,0x36,0x00,0xff,0xed,0x5b,0x8a,0x5c,0x18,0x02,0xd1,0xe1,0xe1,0x22, +0x3d,0x5c,0xc1,0xd5,0xcd,0xd9,0x0d,0xe1,0x22,0x82,0x5c,0xfd,0x36,0x26,0x00,0xc9, +0x2a,0x61,0x5c,0x2b,0xa7,0xed,0x5b,0x59,0x5c,0xfd,0xcb,0x37,0x6e,0xc8,0xed,0x5b, +0x61,0x5c,0xd8,0x2a,0x63,0x5c,0xc9,0x7e,0xfe,0x0e,0x01,0x06,0x00,0xcc,0xe8,0x19, +0x7e,0x23,0xfe,0x0d,0x20,0xf1,0xc9,0xf3,0x3e,0xff,0xed,0x5b,0xb2,0x5c,0xd9,0xed, +0x4b,0xb4,0x5c,0xed,0x5b,0x38,0x5c,0x2a,0x7b,0x5c,0xd9,0x47,0x3e,0x07,0xd3,0xfe, +0x3e,0x3f,0xed,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x62,0x6b,0x36,0x02,0x2b,0xbc, +0x20,0xfa,0xa7,0xed,0x52,0x19,0x23,0x30,0x06,0x35,0x28,0x03,0x35,0x28,0xf3,0x2b, +0xd9,0xed,0x43,0xb4,0x5c,0xed,0x53,0x38,0x5c,0x22,0x7b,0x5c,0xd9,0x04,0x28,0x19, +0x22,0xb4,0x5c,0x11,0xaf,0x3e,0x01,0xa8,0x00,0xeb,0xed,0xb8,0xeb,0x23,0x22,0x7b, +0x5c,0x2b,0x01,0x40,0x00,0xed,0x43,0x38,0x5c,0x22,0xb2,0x5c,0x21,0x00,0x3c,0x22, +0x36,0x5c,0x2a,0xb2,0x5c,0x36,0x3e,0x2b,0xf9,0x2b,0x2b,0x22,0x3d,0x5c,0xed,0x56, +0xfd,0x21,0x3a,0x5c,0xfb,0x21,0xb6,0x5c,0x22,0x4f,0x5c,0x11,0xaf,0x15,0x01,0x15, +0x00,0xeb,0xed,0xb0,0xeb,0x2b,0x22,0x57,0x5c,0x23,0x22,0x53,0x5c,0x22,0x4b,0x5c, +0x36,0x80,0x23,0x22,0x59,0x5c,0x36,0x0d,0x23,0x36,0x80,0x23,0x22,0x61,0x5c,0x22, +0x63,0x5c,0x22,0x65,0x5c,0x3e,0x38,0x32,0x8d,0x5c,0x32,0x8f,0x5c,0x32,0x48,0x5c, +0x21,0x23,0x05,0x22,0x09,0x5c,0xfd,0x35,0xc6,0xfd,0x35,0xca,0x21,0xc6,0x15,0x11, +0x10,0x5c,0x01,0x0e,0x00,0xed,0xb0,0xfd,0xcb,0x01,0xce,0xcd,0xdf,0x0e,0xfd,0x36, +0x31,0x02,0xcd,0x6b,0x0d,0xaf,0x11,0x38,0x15,0xcd,0x0a,0x0c,0xfd,0xcb,0x02,0xee, +0x18,0x07,0xfd,0x36,0x31,0x02,0xcd,0x95,0x17,0xcd,0xb0,0x16,0x3e,0x00,0xcd,0x01, +0x16,0xcd,0x2c,0x0f,0xcd,0x17,0x1b,0xfd,0xcb,0x00,0x7e,0x20,0x12,0xfd,0xcb,0x30, +0x66,0x28,0x40,0x2a,0x59,0x5c,0xcd,0xa7,0x11,0xfd,0x36,0x00,0xff,0x18,0xdd,0x2a, +0x59,0x5c,0x22,0x5d,0x5c,0xcd,0xfb,0x19,0x78,0xb1,0xc2,0x5d,0x15,0xdf,0xfe,0x0d, +0x28,0xc0,0xfd,0xcb,0x30,0x46,0xc4,0xaf,0x0d,0xcd,0x6e,0x0d,0x3e,0x19,0xfd,0x96, +0x4f,0x32,0x8c,0x5c,0xfd,0xcb,0x01,0xfe,0xfd,0x36,0x00,0xff,0xfd,0x36,0x0a,0x01, +0xcd,0x8a,0x1b,0x76,0xfd,0xcb,0x01,0xae,0xfd,0xcb,0x30,0x4e,0xc4,0xcd,0x0e,0x3a, +0x3a,0x5c,0x3c,0xf5,0x21,0x00,0x00,0xfd,0x74,0x37,0xfd,0x74,0x26,0x22,0x0b,0x5c, +0x21,0x01,0x00,0x22,0x16,0x5c,0xcd,0xb0,0x16,0xfd,0xcb,0x37,0xae,0xcd,0x6e,0x0d, +0xfd,0xcb,0x02,0xee,0xf1,0x47,0xfe,0x0a,0x38,0x02,0xc6,0x07,0xcd,0xef,0x15,0x3e, +0x20,0xd7,0x78,0x11,0x91,0x13,0xcd,0x0a,0x0c,0xaf,0x11,0x36,0x15,0xcd,0x0a,0x0c, +0xed,0x4b,0x45,0x5c,0xcd,0x1b,0x1a,0x3e,0x3a,0xd7,0xfd,0x4e,0x0d,0x06,0x00,0xcd, +0x1b,0x1a,0xcd,0x97,0x10,0x3a,0x3a,0x5c,0x3c,0x28,0x1b,0xfe,0x09,0x28,0x04,0xfe, +0x15,0x20,0x03,0xfd,0x34,0x0d,0x01,0x03,0x00,0x11,0x70,0x5c,0x21,0x44,0x5c,0xcb, +0x7e,0x28,0x01,0x09,0xed,0xb8,0xfd,0x36,0x0a,0xff,0xfd,0xcb,0x01,0x9e,0xc3,0xac, +0x12,0x80,0x4f,0xcb,0x4e,0x45,0x58,0x54,0x20,0x77,0x69,0x74,0x68,0x6f,0x75,0x74, +0x20,0x46,0x4f,0xd2,0x56,0x61,0x72,0x69,0x61,0x62,0x6c,0x65,0x20,0x6e,0x6f,0x74, +0x20,0x66,0x6f,0x75,0x6e,0xe4,0x53,0x75,0x62,0x73,0x63,0x72,0x69,0x70,0x74,0x20, +0x77,0x72,0x6f,0x6e,0xe7,0x4f,0x75,0x74,0x20,0x6f,0x66,0x20,0x6d,0x65,0x6d,0x6f, +0x72,0xf9,0x4f,0x75,0x74,0x20,0x6f,0x66,0x20,0x73,0x63,0x72,0x65,0x65,0xee,0x4e, +0x75,0x6d,0x62,0x65,0x72,0x20,0x74,0x6f,0x6f,0x20,0x62,0x69,0xe7,0x52,0x45,0x54, +0x55,0x52,0x4e,0x20,0x77,0x69,0x74,0x68,0x6f,0x75,0x74,0x20,0x47,0x4f,0x53,0x55, +0xc2,0x45,0x6e,0x64,0x20,0x6f,0x66,0x20,0x66,0x69,0x6c,0xe5,0x53,0x54,0x4f,0x50, +0x20,0x73,0x74,0x61,0x74,0x65,0x6d,0x65,0x6e,0xf4,0x49,0x6e,0x76,0x61,0x6c,0x69, +0x64,0x20,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e,0xf4,0x49,0x6e,0x74,0x65,0x67,0x65, +0x72,0x20,0x6f,0x75,0x74,0x20,0x6f,0x66,0x20,0x72,0x61,0x6e,0x67,0xe5,0x4e,0x6f, +0x6e,0x73,0x65,0x6e,0x73,0x65,0x20,0x69,0x6e,0x20,0x42,0x41,0x53,0x49,0xc3,0x42, +0x52,0x45,0x41,0x4b,0x20,0x2d,0x20,0x43,0x4f,0x4e,0x54,0x20,0x72,0x65,0x70,0x65, +0x61,0x74,0xf3,0x4f,0x75,0x74,0x20,0x6f,0x66,0x20,0x44,0x41,0x54,0xc1,0x49,0x6e, +0x76,0x61,0x6c,0x69,0x64,0x20,0x66,0x69,0x6c,0x65,0x20,0x6e,0x61,0x6d,0xe5,0x4e, +0x6f,0x20,0x72,0x6f,0x6f,0x6d,0x20,0x66,0x6f,0x72,0x20,0x6c,0x69,0x6e,0xe5,0x53, +0x54,0x4f,0x50,0x20,0x69,0x6e,0x20,0x49,0x4e,0x50,0x55,0xd4,0x46,0x4f,0x52,0x20, +0x77,0x69,0x74,0x68,0x6f,0x75,0x74,0x20,0x4e,0x45,0x58,0xd4,0x49,0x6e,0x76,0x61, +0x6c,0x69,0x64,0x20,0x49,0x2f,0x4f,0x20,0x64,0x65,0x76,0x69,0x63,0xe5,0x49,0x6e, +0x76,0x61,0x6c,0x69,0x64,0x20,0x63,0x6f,0x6c,0x6f,0x75,0xf2,0x42,0x52,0x45,0x41, +0x4b,0x20,0x69,0x6e,0x74,0x6f,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0xed,0x52,0x41, +0x4d,0x54,0x4f,0x50,0x20,0x6e,0x6f,0x20,0x67,0x6f,0x6f,0xe4,0x53,0x74,0x61,0x74, +0x65,0x6d,0x65,0x6e,0x74,0x20,0x6c,0x6f,0x73,0xf4,0x49,0x6e,0x76,0x61,0x6c,0x69, +0x64,0x20,0x73,0x74,0x72,0x65,0x61,0xed,0x46,0x4e,0x20,0x77,0x69,0x74,0x68,0x6f, +0x75,0x74,0x20,0x44,0x45,0xc6,0x50,0x61,0x72,0x61,0x6d,0x65,0x74,0x65,0x72,0x20, +0x65,0x72,0x72,0x6f,0xf2,0x54,0x61,0x70,0x65,0x20,0x6c,0x6f,0x61,0x64,0x69,0x6e, +0x67,0x20,0x65,0x72,0x72,0x6f,0xf2,0x2c,0xa0,0x7f,0x20,0x31,0x39,0x38,0x32,0x20, +0x53,0x69,0x6e,0x63,0x6c,0x61,0x69,0x72,0x20,0x52,0x65,0x73,0x65,0x61,0x72,0x63, +0x68,0x20,0x4c,0x74,0xe4,0x3e,0x10,0x01,0x00,0x00,0xc3,0x13,0x13,0xed,0x43,0x49, +0x5c,0x2a,0x5d,0x5c,0xeb,0x21,0x55,0x15,0xe5,0x2a,0x61,0x5c,0x37,0xed,0x52,0xe5, +0x60,0x69,0xcd,0x6e,0x19,0x20,0x06,0xcd,0xb8,0x19,0xcd,0xe8,0x19,0xc1,0x79,0x3d, +0xb0,0x28,0x28,0xc5,0x03,0x03,0x03,0x03,0x2b,0xed,0x5b,0x53,0x5c,0xd5,0xcd,0x55, +0x16,0xe1,0x22,0x53,0x5c,0xc1,0xc5,0x13,0x2a,0x61,0x5c,0x2b,0x2b,0xed,0xb8,0x2a, +0x49,0x5c,0xeb,0xc1,0x70,0x2b,0x71,0x2b,0x73,0x2b,0x72,0xf1,0xc3,0xa2,0x12,0xf4, +0x09,0xa8,0x10,0x4b,0xf4,0x09,0xc4,0x15,0x53,0x81,0x0f,0xc4,0x15,0x52,0xf4,0x09, +0xc4,0x15,0x50,0x80,0xcf,0x12,0x01,0x00,0x06,0x00,0x0b,0x00,0x01,0x00,0x01,0x00, +0x06,0x00,0x10,0x00,0xfd,0xcb,0x02,0x6e,0x20,0x04,0xfd,0xcb,0x02,0xde,0xcd,0xe6, +0x15,0xd8,0x28,0xfa,0xcf,0x07,0xd9,0xe5,0x2a,0x51,0x5c,0x23,0x23,0x18,0x08,0x1e, +0x30,0x83,0xd9,0xe5,0x2a,0x51,0x5c,0x5e,0x23,0x56,0xeb,0xcd,0x2c,0x16,0xe1,0xd9, +0xc9,0x87,0xc6,0x16,0x6f,0x26,0x5c,0x5e,0x23,0x56,0x7a,0xb3,0x20,0x02,0xcf,0x17, +0x1b,0x2a,0x4f,0x5c,0x19,0x22,0x51,0x5c,0xfd,0xcb,0x30,0xa6,0x23,0x23,0x23,0x23, +0x4e,0x21,0x2d,0x16,0xcd,0xdc,0x16,0xd0,0x16,0x00,0x5e,0x19,0xe9,0x4b,0x06,0x53, +0x12,0x50,0x1b,0x00,0xfd,0xcb,0x02,0xc6,0xfd,0xcb,0x01,0xae,0xfd,0xcb,0x30,0xe6, +0x18,0x04,0xfd,0xcb,0x02,0x86,0xfd,0xcb,0x01,0x8e,0xc3,0x4d,0x0d,0xfd,0xcb,0x01, +0xce,0xc9,0x01,0x01,0x00,0xe5,0xcd,0x05,0x1f,0xe1,0xcd,0x64,0x16,0x2a,0x65,0x5c, +0xeb,0xed,0xb8,0xc9,0xf5,0xe5,0x21,0x4b,0x5c,0x3e,0x0e,0x5e,0x23,0x56,0xe3,0xa7, +0xed,0x52,0x19,0xe3,0x30,0x09,0xd5,0xeb,0x09,0xeb,0x72,0x2b,0x73,0x23,0xd1,0x23, +0x3d,0x20,0xe8,0xeb,0xd1,0xf1,0xa7,0xed,0x52,0x44,0x4d,0x03,0x19,0xeb,0xc9,0x00, +0x00,0xeb,0x11,0x8f,0x16,0x7e,0xe6,0xc0,0x20,0xf7,0x56,0x23,0x5e,0xc9,0x2a,0x63, +0x5c,0x2b,0xcd,0x55,0x16,0x23,0x23,0xc1,0xed,0x43,0x61,0x5c,0xc1,0xeb,0x23,0xc9, +0x2a,0x59,0x5c,0x36,0x0d,0x22,0x5b,0x5c,0x23,0x36,0x80,0x23,0x22,0x61,0x5c,0x2a, +0x61,0x5c,0x22,0x63,0x5c,0x2a,0x63,0x5c,0x22,0x65,0x5c,0xe5,0x21,0x92,0x5c,0x22, +0x68,0x5c,0xe1,0xc9,0x5d,0x5b,0x59,0x5c,0xc3,0xe5,0x19,0x23,0x7e,0xa7,0xc8,0xb9, +0x23,0x20,0xf8,0x37,0xc9,0xcd,0x1e,0x17,0xcd,0x01,0x17,0x01,0x00,0x00,0x11,0xe2, +0xa3,0xeb,0x19,0x38,0x07,0x01,0xd4,0x15,0x09,0x4e,0x23,0x46,0xeb,0x71,0x23,0x70, +0xc9,0xe5,0x2a,0x4f,0x5c,0x09,0x23,0x23,0x23,0x4e,0xeb,0x21,0x16,0x17,0xcd,0xdc, +0x16,0x4e,0x06,0x00,0x09,0xe9,0x4b,0x05,0x53,0x03,0x50,0x01,0xe1,0xc9,0xcd,0x94, +0x1e,0xfe,0x10,0x38,0x02,0xcf,0x17,0xc6,0x03,0x07,0x21,0x10,0x5c,0x4f,0x06,0x00, +0x09,0x4e,0x23,0x46,0x2b,0xc9,0xef,0x01,0x38,0xcd,0x1e,0x17,0x78,0xb1,0x28,0x16, +0xeb,0x2a,0x4f,0x5c,0x09,0x23,0x23,0x23,0x7e,0xeb,0xfe,0x4b,0x28,0x08,0xfe,0x53, +0x28,0x04,0xfe,0x50,0x20,0xcf,0xcd,0x5d,0x17,0x73,0x23,0x72,0xc9,0xe5,0xcd,0xf1, +0x2b,0x78,0xb1,0x20,0x02,0xcf,0x0e,0xc5,0x1a,0xe6,0xdf,0x4f,0x21,0x7a,0x17,0xcd, +0xdc,0x16,0x30,0xf1,0x4e,0x06,0x00,0x09,0xc1,0xe9,0x4b,0x06,0x53,0x08,0x50,0x0a, +0x00,0x1e,0x01,0x18,0x06,0x1e,0x06,0x18,0x02,0x1e,0x10,0x0b,0x78,0xb1,0x20,0xd5, +0x57,0xe1,0xc9,0x18,0x90,0xed,0x73,0x3f,0x5c,0xfd,0x36,0x02,0x10,0xcd,0xaf,0x0d, +0xfd,0xcb,0x02,0xc6,0xfd,0x46,0x31,0xcd,0x44,0x0e,0xfd,0xcb,0x02,0x86,0xfd,0xcb, +0x30,0xc6,0x2a,0x49,0x5c,0xed,0x5b,0x6c,0x5c,0xa7,0xed,0x52,0x19,0x38,0x22,0xd5, +0xcd,0x6e,0x19,0x11,0xc0,0x02,0xeb,0xed,0x52,0xe3,0xcd,0x6e,0x19,0xc1,0xc5,0xcd, +0xb8,0x19,0xc1,0x09,0x38,0x0e,0xeb,0x56,0x23,0x5e,0x2b,0xed,0x53,0x6c,0x5c,0x18, +0xed,0x22,0x6c,0x5c,0x2a,0x6c,0x5c,0xcd,0x6e,0x19,0x28,0x01,0xeb,0xcd,0x33,0x18, +0xfd,0xcb,0x02,0xa6,0xc9,0x3e,0x03,0x18,0x02,0x3e,0x02,0xfd,0x36,0x02,0x00,0xcd, +0x30,0x25,0xc4,0x01,0x16,0xdf,0xcd,0x70,0x20,0x38,0x14,0xdf,0xfe,0x3b,0x28,0x04, +0xfe,0x2c,0x20,0x06,0xe7,0xcd,0x82,0x1c,0x18,0x08,0xcd,0xe6,0x1c,0x18,0x03,0xcd, +0xde,0x1c,0xcd,0xee,0x1b,0xcd,0x99,0x1e,0x78,0xe6,0x3f,0x67,0x69,0x22,0x49,0x5c, +0xcd,0x6e,0x19,0x1e,0x01,0xcd,0x55,0x18,0xd7,0xfd,0xcb,0x02,0x66,0x28,0xf6,0x3a, +0x6b,0x5c,0xfd,0x96,0x4f,0x20,0xee,0xab,0xc8,0xe5,0xd5,0x21,0x6c,0x5c,0xcd,0x0f, +0x19,0xd1,0xe1,0x18,0xe0,0xed,0x4b,0x49,0x5c,0xcd,0x80,0x19,0x16,0x3e,0x28,0x05, +0x11,0x00,0x00,0xcb,0x13,0xfd,0x73,0x2d,0x7e,0xfe,0x40,0xc1,0xd0,0xc5,0xcd,0x28, +0x1a,0x23,0x23,0x23,0xfd,0xcb,0x01,0x86,0x7a,0xa7,0x28,0x05,0xd7,0xfd,0xcb,0x01, +0xc6,0xd5,0xeb,0xfd,0xcb,0x30,0x96,0x21,0x3b,0x5c,0xcb,0x96,0xfd,0xcb,0x37,0x6e, +0x28,0x02,0xcb,0xd6,0x2a,0x5f,0x5c,0xa7,0xed,0x52,0x20,0x05,0x3e,0x3f,0xcd,0xc1, +0x18,0xcd,0xe1,0x18,0xeb,0x7e,0xcd,0xb6,0x18,0x23,0xfe,0x0d,0x28,0x06,0xeb,0xcd, +0x37,0x19,0x18,0xe0,0xd1,0xc9,0xfe,0x0e,0xc0,0x23,0x23,0x23,0x23,0x23,0x23,0x7e, +0xc9,0xd9,0x2a,0x8f,0x5c,0xe5,0xcb,0xbc,0xcb,0xfd,0x22,0x8f,0x5c,0x21,0x91,0x5c, +0x56,0xd5,0x36,0x00,0xcd,0xf4,0x09,0xe1,0xfd,0x74,0x57,0xe1,0x22,0x8f,0x5c,0xd9, +0xc9,0x2a,0x5b,0x5c,0xa7,0xed,0x52,0xc0,0x3a,0x41,0x5c,0xcb,0x07,0x28,0x04,0xc6, +0x43,0x18,0x16,0x21,0x3b,0x5c,0xcb,0x9e,0x3e,0x4b,0xcb,0x56,0x28,0x0b,0xcb,0xde, +0x3c,0xfd,0xcb,0x30,0x5e,0x28,0x02,0x3e,0x43,0xd5,0xcd,0xc1,0x18,0xd1,0xc9,0x5e, +0x23,0x56,0xe5,0xeb,0x23,0xcd,0x6e,0x19,0xcd,0x95,0x16,0xe1,0xfd,0xcb,0x37,0x6e, +0xc0,0x72,0x2b,0x73,0xc9,0x7b,0xa7,0xf8,0x18,0x0d,0xaf,0x09,0x3c,0x38,0xfc,0xed, +0x42,0x3d,0x28,0xf1,0xc3,0xef,0x15,0xcd,0x1b,0x2d,0x30,0x30,0xfe,0x21,0x38,0x2c, +0xfd,0xcb,0x01,0x96,0xfe,0xcb,0x28,0x24,0xfe,0x3a,0x20,0x0e,0xfd,0xcb,0x37,0x6e, +0x20,0x16,0xfd,0xcb,0x30,0x56,0x28,0x14,0x18,0x0e,0xfe,0x22,0x20,0x0a,0xf5,0x3a, +0x6a,0x5c,0xee,0x04,0x32,0x6a,0x5c,0xf1,0xfd,0xcb,0x01,0xd6,0xd7,0xc9,0xe5,0x2a, +0x53,0x5c,0x54,0x5d,0xc1,0xcd,0x80,0x19,0xd0,0xc5,0xcd,0xb8,0x19,0xeb,0x18,0xf4, +0x7e,0xb8,0xc0,0x23,0x7e,0x2b,0xb9,0xc9,0x23,0x23,0x23,0x22,0x5d,0x5c,0x0e,0x00, +0x15,0xc8,0xe7,0xbb,0x20,0x04,0xa7,0xc9,0x23,0x7e,0xcd,0xb6,0x18,0x22,0x5d,0x5c, +0xfe,0x22,0x20,0x01,0x0d,0xfe,0x3a,0x28,0x04,0xfe,0xcb,0x20,0x04,0xcb,0x41,0x28, +0xdf,0xfe,0x0d,0x20,0xe3,0x15,0x37,0xc9,0xe5,0x7e,0xfe,0x40,0x38,0x17,0xcb,0x6f, +0x28,0x14,0x87,0xfa,0xc7,0x19,0x3f,0x01,0x05,0x00,0x30,0x02,0x0e,0x12,0x17,0x23, +0x7e,0x30,0xfb,0x18,0x06,0x23,0x23,0x4e,0x23,0x46,0x23,0x09,0xd1,0xa7,0xed,0x52, +0x44,0x4d,0x19,0xeb,0xc9,0xcd,0xdd,0x19,0xc5,0x78,0x2f,0x47,0x79,0x2f,0x4f,0x03, +0xcd,0x64,0x16,0xeb,0xe1,0x19,0xd5,0xed,0xb0,0xe1,0xc9,0x2a,0x59,0x5c,0x2b,0x22, +0x5d,0x5c,0xe7,0x21,0x92,0x5c,0x22,0x65,0x5c,0xcd,0x3b,0x2d,0xcd,0xa2,0x2d,0x38, +0x04,0x21,0xf0,0xd8,0x09,0xda,0x8a,0x1c,0xc3,0xc5,0x16,0xd5,0xe5,0xaf,0xcb,0x78, +0x20,0x20,0x60,0x69,0x1e,0xff,0x18,0x08,0xd5,0x56,0x23,0x5e,0xe5,0xeb,0x1e,0x20, +0x01,0x18,0xfc,0xcd,0x2a,0x19,0x01,0x9c,0xff,0xcd,0x2a,0x19,0x0e,0xf6,0xcd,0x2a, +0x19,0x7d,0xcd,0xef,0x15,0xe1,0xd1,0xc9,0xb1,0xcb,0xbc,0xbf,0xc4,0xaf,0xb4,0x93, +0x91,0x92,0x95,0x98,0x98,0x98,0x98,0x98,0x98,0x98,0x7f,0x81,0x2e,0x6c,0x6e,0x70, +0x48,0x94,0x56,0x3f,0x41,0x2b,0x17,0x1f,0x37,0x77,0x44,0x0f,0x59,0x2b,0x43,0x2d, +0x51,0x3a,0x6d,0x42,0x0d,0x49,0x5c,0x44,0x15,0x5d,0x01,0x3d,0x02,0x06,0x00,0x67, +0x1e,0x06,0xcb,0x05,0xf0,0x1c,0x06,0x00,0xed,0x1e,0x00,0xee,0x1c,0x00,0x23,0x1f, +0x04,0x3d,0x06,0xcc,0x06,0x05,0x03,0x1d,0x04,0x00,0xab,0x1d,0x05,0xcd,0x1f,0x05, +0x89,0x20,0x05,0x02,0x2c,0x05,0xb2,0x1b,0x00,0xb7,0x11,0x03,0xa1,0x1e,0x05,0xf9, +0x17,0x08,0x00,0x80,0x1e,0x03,0x4f,0x1e,0x00,0x5f,0x1e,0x03,0xac,0x1e,0x00,0x6b, +0x0d,0x09,0x00,0xdc,0x22,0x06,0x00,0x3a,0x1f,0x05,0xed,0x1d,0x05,0x27,0x1e,0x03, +0x42,0x1e,0x09,0x05,0x82,0x23,0x00,0xac,0x0e,0x05,0xc9,0x1f,0x05,0xf5,0x17,0x0b, +0x0b,0x0b,0x0b,0x08,0x00,0xf8,0x03,0x09,0x05,0x20,0x23,0x07,0x07,0x07,0x07,0x07, +0x07,0x08,0x00,0x7a,0x1e,0x06,0x00,0x94,0x22,0x05,0x60,0x1f,0x06,0x2c,0x0a,0x00, +0x36,0x17,0x06,0x00,0xe5,0x16,0x0a,0x00,0x93,0x17,0x0a,0x2c,0x0a,0x00,0x93,0x17, +0x0a,0x00,0x93,0x17,0x00,0x93,0x17,0xfd,0xcb,0x01,0xbe,0xcd,0xfb,0x19,0xaf,0x32, +0x47,0x5c,0x3d,0x32,0x3a,0x5c,0x18,0x01,0xe7,0xcd,0xbf,0x16,0xfd,0x34,0x0d,0xfa, +0x8a,0x1c,0xdf,0x06,0x00,0xfe,0x0d,0x28,0x7a,0xfe,0x3a,0x28,0xeb,0x21,0x76,0x1b, +0xe5,0x4f,0xe7,0x79,0xd6,0xce,0xda,0x8a,0x1c,0x4f,0x21,0x48,0x1a,0x09,0x4e,0x09, +0x18,0x03,0x2a,0x74,0x5c,0x7e,0x23,0x22,0x74,0x5c,0x01,0x52,0x1b,0xc5,0x4f,0xfe, +0x20,0x30,0x0c,0x21,0x01,0x1c,0x06,0x00,0x09,0x4e,0x09,0xe5,0xdf,0x05,0xc9,0xdf, +0xb9,0xc2,0x8a,0x1c,0xe7,0xc9,0xcd,0x54,0x1f,0x38,0x02,0xcf,0x14,0xfd,0xcb,0x0a, +0x7e,0x20,0x71,0x2a,0x42,0x5c,0xcb,0x7c,0x28,0x14,0x21,0xfe,0xff,0x22,0x45,0x5c, +0x2a,0x61,0x5c,0x2b,0xed,0x5b,0x59,0x5c,0x1b,0x3a,0x44,0x5c,0x18,0x33,0xcd,0x6e, +0x19,0x3a,0x44,0x5c,0x28,0x19,0xa7,0x20,0x43,0x47,0x7e,0xe6,0xc0,0x78,0x28,0x0f, +0xcf,0xff,0xc1,0xcd,0x30,0x25,0xc8,0x2a,0x55,0x5c,0x3e,0xc0,0xa6,0xc0,0xaf,0xfe, +0x01,0xce,0x00,0x56,0x23,0x5e,0xed,0x53,0x45,0x5c,0x23,0x5e,0x23,0x56,0xeb,0x19, +0x23,0x22,0x55,0x5c,0xeb,0x22,0x5d,0x5c,0x57,0x1e,0x00,0xfd,0x36,0x0a,0xff,0x15, +0xfd,0x72,0x0d,0xca,0x28,0x1b,0x14,0xcd,0x8b,0x19,0x28,0x08,0xcf,0x16,0xcd,0x30, +0x25,0xc0,0xc1,0xc1,0xdf,0xfe,0x0d,0x28,0xba,0xfe,0x3a,0xca,0x28,0x1b,0xc3,0x8a, +0x1c,0x0f,0x1d,0x4b,0x09,0x67,0x0b,0x7b,0x8e,0x71,0xb4,0x81,0xcf,0xcd,0xde,0x1c, +0xbf,0xc1,0xcc,0xee,0x1b,0xeb,0x2a,0x74,0x5c,0x4e,0x23,0x46,0xeb,0xc5,0xc9,0xcd, +0xb2,0x28,0xfd,0x36,0x37,0x00,0x30,0x08,0xfd,0xcb,0x37,0xce,0x20,0x18,0xcf,0x01, +0xcc,0x96,0x29,0xfd,0xcb,0x01,0x76,0x20,0x0d,0xaf,0xcd,0x30,0x25,0xc4,0xf1,0x2b, +0x21,0x71,0x5c,0xb6,0x77,0xeb,0xed,0x43,0x72,0x5c,0x22,0x4d,0x5c,0xc9,0xc1,0xcd, +0x56,0x1c,0xcd,0xee,0x1b,0xc9,0x3a,0x3b,0x5c,0xf5,0xcd,0xfb,0x24,0xf1,0xfd,0x56, +0x01,0xaa,0xe6,0x40,0x20,0x24,0xcb,0x7a,0xc2,0xff,0x2a,0xc9,0xcd,0xb2,0x28,0xf5, +0x79,0xf6,0x9f,0x3c,0x20,0x14,0xf1,0x18,0xa9,0xe7,0xcd,0x82,0x1c,0xfe,0x2c,0x20, +0x09,0xe7,0xcd,0xfb,0x24,0xfd,0xcb,0x01,0x76,0xc0,0xcf,0x0b,0xcd,0xfb,0x24,0xfd, +0xcb,0x01,0x76,0xc8,0x18,0xf4,0xfd,0xcb,0x01,0x7e,0xfd,0xcb,0x02,0x86,0xc4,0x4d, +0x0d,0xf1,0x3a,0x74,0x5c,0xd6,0x13,0xcd,0xfc,0x21,0xcd,0xee,0x1b,0x2a,0x8f,0x5c, +0x22,0x8d,0x5c,0x21,0x91,0x5c,0x7e,0x07,0xae,0xe6,0xaa,0xae,0x77,0xc9,0xcd,0x30, +0x25,0x28,0x13,0xfd,0xcb,0x02,0x86,0xcd,0x4d,0x0d,0x21,0x90,0x5c,0x7e,0xf6,0xf8, +0x77,0xfd,0xcb,0x57,0xb6,0xdf,0xcd,0xe2,0x21,0x18,0x9f,0xc3,0x05,0x06,0xfe,0x0d, +0x28,0x04,0xfe,0x3a,0x20,0x9c,0xcd,0x30,0x25,0xc8,0xef,0xa0,0x38,0xc9,0xcf,0x08, +0xc1,0xcd,0x30,0x25,0x28,0x0a,0xef,0x02,0x38,0xeb,0xcd,0xe9,0x34,0xda,0xb3,0x1b, +0xc3,0x29,0x1b,0xfe,0xcd,0x20,0x09,0xe7,0xcd,0x82,0x1c,0xcd,0xee,0x1b,0x18,0x06, +0xcd,0xee,0x1b,0xef,0xa1,0x38,0xef,0xc0,0x02,0x01,0xe0,0x01,0x38,0xcd,0xff,0x2a, +0x22,0x68,0x5c,0x2b,0x7e,0xcb,0xfe,0x01,0x06,0x00,0x09,0x07,0x38,0x06,0x0e,0x0d, +0xcd,0x55,0x16,0x23,0xe5,0xef,0x02,0x02,0x38,0xe1,0xeb,0x0e,0x0a,0xed,0xb0,0x2a, +0x45,0x5c,0xeb,0x73,0x23,0x72,0xfd,0x56,0x0d,0x14,0x23,0x72,0xcd,0xda,0x1d,0xd0, +0xfd,0x46,0x38,0x2a,0x45,0x5c,0x22,0x42,0x5c,0x3a,0x47,0x5c,0xed,0x44,0x57,0x2a, +0x5d,0x5c,0x1e,0xf3,0xc5,0xed,0x4b,0x55,0x5c,0xcd,0x86,0x1d,0xed,0x43,0x55,0x5c, +0xc1,0x38,0x11,0xe7,0xf6,0x20,0xb8,0x28,0x03,0xe7,0x18,0xe8,0xe7,0x3e,0x01,0x92, +0x32,0x44,0x5c,0xc9,0xcf,0x11,0x7e,0xfe,0x3a,0x28,0x18,0x23,0x7e,0xe6,0xc0,0x37, +0xc0,0x46,0x23,0x4e,0xed,0x43,0x42,0x5c,0x23,0x4e,0x23,0x46,0xe5,0x09,0x44,0x4d, +0xe1,0x16,0x00,0xc5,0xcd,0x8b,0x19,0xc1,0xd0,0x18,0xe0,0xfd,0xcb,0x37,0x4e,0xc2, +0x2e,0x1c,0x2a,0x4d,0x5c,0xcb,0x7e,0x28,0x1f,0x23,0x22,0x68,0x5c,0xef,0xe0,0xe2, +0x0f,0xc0,0x02,0x38,0xcd,0xda,0x1d,0xd8,0x2a,0x68,0x5c,0x11,0x0f,0x00,0x19,0x5e, +0x23,0x56,0x23,0x66,0xeb,0xc3,0x73,0x1e,0xcf,0x00,0xef,0xe1,0xe0,0xe2,0x36,0x00, +0x02,0x01,0x03,0x37,0x00,0x04,0x38,0xa7,0xc9,0x38,0x37,0xc9,0xe7,0xcd,0x1f,0x1c, +0xcd,0x30,0x25,0x28,0x29,0xdf,0x22,0x5f,0x5c,0x2a,0x57,0x5c,0x7e,0xfe,0x2c,0x28, +0x09,0x1e,0xe4,0xcd,0x86,0x1d,0x30,0x02,0xcf,0x0d,0xcd,0x77,0x00,0xcd,0x56,0x1c, +0xdf,0x22,0x57,0x5c,0x2a,0x5f,0x5c,0xfd,0x36,0x26,0x00,0xcd,0x78,0x00,0xdf,0xfe, +0x2c,0x28,0xc9,0xcd,0xee,0x1b,0xc9,0xcd,0x30,0x25,0x20,0x0b,0xcd,0xfb,0x24,0xfe, +0x2c,0xc4,0xee,0x1b,0xe7,0x18,0xf5,0x3e,0xe4,0x47,0xed,0xb9,0x11,0x00,0x02,0xc3, +0x8b,0x19,0xcd,0x99,0x1e,0x60,0x69,0xcd,0x6e,0x19,0x2b,0x22,0x57,0x5c,0xc9,0xcd, +0x99,0x1e,0x78,0xb1,0x20,0x04,0xed,0x4b,0x78,0x5c,0xed,0x43,0x76,0x5c,0xc9,0x2a, +0x6e,0x5c,0xfd,0x56,0x36,0x18,0x0c,0xcd,0x99,0x1e,0x60,0x69,0x16,0x00,0x7c,0xfe, +0xf0,0x30,0x2c,0x22,0x42,0x5c,0xfd,0x72,0x0a,0xc9,0xcd,0x85,0x1e,0xed,0x79,0xc9, +0xcd,0x85,0x1e,0x02,0xc9,0xcd,0xd5,0x2d,0x38,0x15,0x28,0x02,0xed,0x44,0xf5,0xcd, +0x99,0x1e,0xf1,0xc9,0xcd,0xd5,0x2d,0x18,0x03,0xcd,0xa2,0x2d,0x38,0x01,0xc8,0xcf, +0x0a,0xcd,0x67,0x1e,0x01,0x00,0x00,0xcd,0x45,0x1e,0x18,0x03,0xcd,0x99,0x1e,0x78, +0xb1,0x20,0x04,0xed,0x4b,0xb2,0x5c,0xc5,0xed,0x5b,0x4b,0x5c,0x2a,0x59,0x5c,0x2b, +0xcd,0xe5,0x19,0xcd,0x6b,0x0d,0x2a,0x65,0x5c,0x11,0x32,0x00,0x19,0xd1,0xed,0x52, +0x30,0x08,0x2a,0xb4,0x5c,0xa7,0xed,0x52,0x30,0x02,0xcf,0x15,0xeb,0x22,0xb2,0x5c, +0xd1,0xc1,0x36,0x3e,0x2b,0xf9,0xc5,0xed,0x73,0x3d,0x5c,0xeb,0xe9,0xd1,0xfd,0x66, +0x0d,0x24,0xe3,0x33,0xed,0x4b,0x45,0x5c,0xc5,0xe5,0xed,0x73,0x3d,0x5c,0xd5,0xcd, +0x67,0x1e,0x01,0x14,0x00,0x2a,0x65,0x5c,0x09,0x38,0x0a,0xeb,0x21,0x50,0x00,0x19, +0x38,0x03,0xed,0x72,0xd8,0x2e,0x03,0xc3,0x55,0x00,0x01,0x00,0x00,0xcd,0x05,0x1f, +0x44,0x4d,0xc9,0xc1,0xe1,0xd1,0x7a,0xfe,0x3e,0x28,0x0b,0x3b,0xe3,0xeb,0xed,0x73, +0x3d,0x5c,0xc5,0xc3,0x73,0x1e,0xd5,0xe5,0xcf,0x06,0xcd,0x99,0x1e,0x76,0x0b,0x78, +0xb1,0x28,0x0c,0x78,0xa1,0x3c,0x20,0x01,0x03,0xfd,0xcb,0x01,0x6e,0x28,0xee,0xfd, +0xcb,0x01,0xae,0xc9,0x3e,0x7f,0xdb,0xfe,0x1f,0xd8,0x3e,0xfe,0xdb,0xfe,0x1f,0xc9, +0xcd,0x30,0x25,0x28,0x05,0x3e,0xce,0xc3,0x39,0x1e,0xfd,0xcb,0x01,0xf6,0xcd,0x8d, +0x2c,0x30,0x16,0xe7,0xfe,0x24,0x20,0x05,0xfd,0xcb,0x01,0xb6,0xe7,0xfe,0x28,0x20, +0x3c,0xe7,0xfe,0x29,0x28,0x20,0xcd,0x8d,0x2c,0xd2,0x8a,0x1c,0xeb,0xe7,0xfe,0x24, +0x20,0x02,0xeb,0xe7,0xeb,0x01,0x06,0x00,0xcd,0x55,0x16,0x23,0x23,0x36,0x0e,0xfe, +0x2c,0x20,0x03,0xe7,0x18,0xe0,0xfe,0x29,0x20,0x13,0xe7,0xfe,0x3d,0x20,0x0e,0xe7, +0x3a,0x3b,0x5c,0xf5,0xcd,0xfb,0x24,0xf1,0xfd,0xae,0x01,0xe6,0x40,0xc2,0x8a,0x1c, +0xcd,0xee,0x1b,0xcd,0x30,0x25,0xe1,0xc8,0xe9,0x3e,0x03,0x18,0x02,0x3e,0x02,0xcd, +0x30,0x25,0xc4,0x01,0x16,0xcd,0x4d,0x0d,0xcd,0xdf,0x1f,0xcd,0xee,0x1b,0xc9,0xdf, +0xcd,0x45,0x20,0x28,0x0d,0xcd,0x4e,0x20,0x28,0xfb,0xcd,0xfc,0x1f,0xcd,0x4e,0x20, +0x28,0xf3,0xfe,0x29,0xc8,0xcd,0xc3,0x1f,0x3e,0x0d,0xd7,0xc9,0xdf,0xfe,0xac,0x20, +0x0d,0xcd,0x79,0x1c,0xcd,0xc3,0x1f,0xcd,0x07,0x23,0x3e,0x16,0x18,0x10,0xfe,0xad, +0x20,0x12,0xe7,0xcd,0x82,0x1c,0xcd,0xc3,0x1f,0xcd,0x99,0x1e,0x3e,0x17,0xd7,0x79, +0xd7,0x78,0xd7,0xc9,0xcd,0xf2,0x21,0xd0,0xcd,0x70,0x20,0xd0,0xcd,0xfb,0x24,0xcd, +0xc3,0x1f,0xfd,0xcb,0x01,0x76,0xcc,0xf1,0x2b,0xc2,0xe3,0x2d,0x78,0xb1,0x0b,0xc8, +0x1a,0x13,0xd7,0x18,0xf7,0xfe,0x29,0xc8,0xfe,0x0d,0xc8,0xfe,0x3a,0xc9,0xdf,0xfe, +0x3b,0x28,0x14,0xfe,0x2c,0x20,0x0a,0xcd,0x30,0x25,0x28,0x0b,0x3e,0x06,0xd7,0x18, +0x06,0xfe,0x27,0xc0,0xcd,0xf5,0x1f,0xe7,0xcd,0x45,0x20,0x20,0x01,0xc1,0xbf,0xc9, +0xfe,0x23,0x37,0xc0,0xe7,0xcd,0x82,0x1c,0xa7,0xcd,0xc3,0x1f,0xcd,0x94,0x1e,0xfe, +0x10,0xd2,0x0e,0x16,0xcd,0x01,0x16,0xa7,0xc9,0xcd,0x30,0x25,0x28,0x08,0x3e,0x01, +0xcd,0x01,0x16,0xcd,0x6e,0x0d,0xfd,0x36,0x02,0x01,0xcd,0xc1,0x20,0xcd,0xee,0x1b, +0xed,0x4b,0x88,0x5c,0x3a,0x6b,0x5c,0xb8,0x38,0x03,0x0e,0x21,0x47,0xed,0x43,0x88, +0x5c,0x3e,0x19,0x90,0x32,0x8c,0x5c,0xfd,0xcb,0x02,0x86,0xcd,0xd9,0x0d,0xc3,0x6e, +0x0d,0xcd,0x4e,0x20,0x28,0xfb,0xfe,0x28,0x20,0x0e,0xe7,0xcd,0xdf,0x1f,0xdf,0xfe, +0x29,0xc2,0x8a,0x1c,0xe7,0xc3,0xb2,0x21,0xfe,0xca,0x20,0x11,0xe7,0xcd,0x1f,0x1c, +0xfd,0xcb,0x37,0xfe,0xfd,0xcb,0x01,0x76,0xc2,0x8a,0x1c,0x18,0x0d,0xcd,0x8d,0x2c, +0xd2,0xaf,0x21,0xcd,0x1f,0x1c,0xfd,0xcb,0x37,0xbe,0xcd,0x30,0x25,0xca,0xb2,0x21, +0xcd,0xbf,0x16,0x21,0x71,0x5c,0xcb,0xb6,0xcb,0xee,0x01,0x01,0x00,0xcb,0x7e,0x20, +0x0b,0x3a,0x3b,0x5c,0xe6,0x40,0x20,0x02,0x0e,0x03,0xb6,0x77,0xf7,0x36,0x0d,0x79, +0x0f,0x0f,0x30,0x05,0x3e,0x22,0x12,0x2b,0x77,0x22,0x5b,0x5c,0xfd,0xcb,0x37,0x7e, +0x20,0x2c,0x2a,0x5d,0x5c,0xe5,0x2a,0x3d,0x5c,0xe5,0x21,0x3a,0x21,0xe5,0xfd,0xcb, +0x30,0x66,0x28,0x04,0xed,0x73,0x3d,0x5c,0x2a,0x61,0x5c,0xcd,0xa7,0x11,0xfd,0x36, +0x00,0xff,0xcd,0x2c,0x0f,0xfd,0xcb,0x01,0xbe,0xcd,0xb9,0x21,0x18,0x03,0xcd,0x2c, +0x0f,0xfd,0x36,0x22,0x00,0xcd,0xd6,0x21,0x20,0x0a,0xcd,0x1d,0x11,0xed,0x4b,0x82, +0x5c,0xcd,0xd9,0x0d,0x21,0x71,0x5c,0xcb,0xae,0xcb,0x7e,0xcb,0xbe,0x20,0x1c,0xe1, +0xe1,0x22,0x3d,0x5c,0xe1,0x22,0x5f,0x5c,0xfd,0xcb,0x01,0xfe,0xcd,0xb9,0x21,0x2a, +0x5f,0x5c,0xfd,0x36,0x26,0x00,0x22,0x5d,0x5c,0x18,0x17,0x2a,0x63,0x5c,0xed,0x5b, +0x61,0x5c,0x37,0xed,0x52,0x44,0x4d,0xcd,0xb2,0x2a,0xcd,0xff,0x2a,0x18,0x03,0xcd, +0xfc,0x1f,0xcd,0x4e,0x20,0xca,0xc1,0x20,0xc9,0x2a,0x61,0x5c,0x22,0x5d,0x5c,0xdf, +0xfe,0xe2,0x28,0x0c,0x3a,0x71,0x5c,0xcd,0x59,0x1c,0xdf,0xfe,0x0d,0xc8,0xcf,0x0b, +0xcd,0x30,0x25,0xc8,0xcf,0x10,0x2a,0x51,0x5c,0x23,0x23,0x23,0x23,0x7e,0xfe,0x4b, +0xc9,0xe7,0xcd,0xf2,0x21,0xd8,0xdf,0xfe,0x2c,0x28,0xf6,0xfe,0x3b,0x28,0xf2,0xc3, +0x8a,0x1c,0xfe,0xd9,0xd8,0xfe,0xdf,0x3f,0xd8,0xf5,0xe7,0xf1,0xd6,0xc9,0xf5,0xcd, +0x82,0x1c,0xf1,0xa7,0xcd,0xc3,0x1f,0xf5,0xcd,0x94,0x1e,0x57,0xf1,0xd7,0x7a,0xd7, +0xc9,0xd6,0x11,0xce,0x00,0x28,0x1d,0xd6,0x02,0xce,0x00,0x28,0x56,0xfe,0x01,0x7a, +0x06,0x01,0x20,0x04,0x07,0x07,0x06,0x04,0x4f,0x7a,0xfe,0x02,0x30,0x16,0x79,0x21, +0x91,0x5c,0x18,0x38,0x7a,0x06,0x07,0x38,0x05,0x07,0x07,0x07,0x06,0x38,0x4f,0x7a, +0xfe,0x0a,0x38,0x02,0xcf,0x13,0x21,0x8f,0x5c,0xfe,0x08,0x38,0x0b,0x7e,0x28,0x07, +0xb0,0x2f,0xe6,0x24,0x28,0x01,0x78,0x4f,0x79,0xcd,0x6c,0x22,0x3e,0x07,0xba,0x9f, +0xcd,0x6c,0x22,0x07,0x07,0xe6,0x50,0x47,0x3e,0x08,0xba,0x9f,0xae,0xa0,0xae,0x77, +0x23,0x78,0xc9,0x9f,0x7a,0x0f,0x06,0x80,0x20,0x03,0x0f,0x06,0x40,0x4f,0x7a,0xfe, +0x08,0x28,0x04,0xfe,0x02,0x30,0xbd,0x79,0x21,0x8f,0x5c,0xcd,0x6c,0x22,0x79,0x0f, +0x0f,0x0f,0x18,0xd8,0xcd,0x94,0x1e,0xfe,0x08,0x30,0xa9,0xd3,0xfe,0x07,0x07,0x07, +0xcb,0x6f,0x20,0x02,0xee,0x07,0x32,0x48,0x5c,0xc9,0x3e,0xaf,0x90,0xda,0xf9,0x24, +0x47,0xa7,0x1f,0x37,0x1f,0xa7,0x1f,0xa8,0xe6,0xf8,0xa8,0x67,0x79,0x07,0x07,0x07, +0xa8,0xe6,0xc7,0xa8,0x07,0x07,0x6f,0x79,0xe6,0x07,0xc9,0xcd,0x07,0x23,0xcd,0xaa, +0x22,0x47,0x04,0x7e,0x07,0x10,0xfd,0xe6,0x01,0xc3,0x28,0x2d,0xcd,0x07,0x23,0xcd, +0xe5,0x22,0xc3,0x4d,0x0d,0xed,0x43,0x7d,0x5c,0xcd,0xaa,0x22,0x47,0x04,0x3e,0xfe, +0x0f,0x10,0xfd,0x47,0x7e,0xfd,0x4e,0x57,0xcb,0x41,0x20,0x01,0xa0,0xcb,0x51,0x20, +0x02,0xa8,0x2f,0x77,0xc3,0xdb,0x0b,0xcd,0x14,0x23,0x47,0xc5,0xcd,0x14,0x23,0x59, +0xc1,0x51,0x4f,0xc9,0xcd,0xd5,0x2d,0xda,0xf9,0x24,0x0e,0x01,0xc8,0x0e,0xff,0xc9, +0xdf,0xfe,0x2c,0xc2,0x8a,0x1c,0xe7,0xcd,0x82,0x1c,0xcd,0xee,0x1b,0xef,0x2a,0x3d, +0x38,0x7e,0xfe,0x81,0x30,0x05,0xef,0x02,0x38,0x18,0xa1,0xef,0xa3,0x38,0x36,0x83, +0xef,0xc5,0x02,0x38,0xcd,0x7d,0x24,0xc5,0xef,0x31,0xe1,0x04,0x38,0x7e,0xfe,0x80, +0x30,0x08,0xef,0x02,0x02,0x38,0xc1,0xc3,0xdc,0x22,0xef,0xc2,0x01,0xc0,0x02,0x03, +0x01,0xe0,0x0f,0xc0,0x01,0x31,0xe0,0x01,0x31,0xe0,0xa0,0xc1,0x02,0x38,0xfd,0x34, +0x62,0xcd,0x94,0x1e,0x6f,0xe5,0xcd,0x94,0x1e,0xe1,0x67,0x22,0x7d,0x5c,0xc1,0xc3, +0x20,0x24,0xdf,0xfe,0x2c,0x28,0x06,0xcd,0xee,0x1b,0xc3,0x77,0x24,0xe7,0xcd,0x82, +0x1c,0xcd,0xee,0x1b,0xef,0xc5,0xa2,0x04,0x1f,0x31,0x30,0x30,0x00,0x06,0x02,0x38, +0xc3,0x77,0x24,0xc0,0x02,0xc1,0x02,0x31,0x2a,0xe1,0x01,0xe1,0x2a,0x0f,0xe0,0x05, +0x2a,0xe0,0x01,0x3d,0x38,0x7e,0xfe,0x81,0x30,0x07,0xef,0x02,0x02,0x38,0xc3,0x77, +0x24,0xcd,0x7d,0x24,0xc5,0xef,0x02,0xe1,0x01,0x05,0xc1,0x02,0x01,0x31,0xe1,0x04, +0xc2,0x02,0x01,0x31,0xe1,0x04,0xe2,0xe5,0xe0,0x03,0xa2,0x04,0x31,0x1f,0xc5,0x02, +0x20,0xc0,0x02,0xc2,0x02,0xc1,0xe5,0x04,0xe0,0xe2,0x04,0x0f,0xe1,0x01,0xc1,0x02, +0xe0,0x04,0xe2,0xe5,0x04,0x03,0xc2,0x2a,0xe1,0x2a,0x0f,0x02,0x38,0x1a,0xfe,0x81, +0xc1,0xda,0x77,0x24,0xc5,0xef,0x01,0x38,0x3a,0x7d,0x5c,0xcd,0x28,0x2d,0xef,0xc0, +0x0f,0x01,0x38,0x3a,0x7e,0x5c,0xcd,0x28,0x2d,0xef,0xc5,0x0f,0xe0,0xe5,0x38,0xc1, +0x05,0x28,0x3c,0x18,0x14,0xef,0xe1,0x31,0xe3,0x04,0xe2,0xe4,0x04,0x03,0xc1,0x02, +0xe4,0x04,0xe2,0xe3,0x04,0x0f,0xc2,0x02,0x38,0xc5,0xef,0xc0,0x02,0xe1,0x0f,0x31, +0x38,0x3a,0x7d,0x5c,0xcd,0x28,0x2d,0xef,0x03,0xe0,0xe2,0x0f,0xc0,0x01,0xe0,0x38, +0x3a,0x7e,0x5c,0xcd,0x28,0x2d,0xef,0x03,0x38,0xcd,0xb7,0x24,0xc1,0x10,0xc6,0xef, +0x02,0x02,0x01,0x38,0x3a,0x7d,0x5c,0xcd,0x28,0x2d,0xef,0x03,0x01,0x38,0x3a,0x7e, +0x5c,0xcd,0x28,0x2d,0xef,0x03,0x38,0xcd,0xb7,0x24,0xc3,0x4d,0x0d,0xef,0x31,0x28, +0x34,0x32,0x00,0x01,0x05,0xe5,0x01,0x05,0x2a,0x38,0xcd,0xd5,0x2d,0x38,0x06,0xe6, +0xfc,0xc6,0x04,0x30,0x02,0x3e,0xfc,0xf5,0xcd,0x28,0x2d,0xef,0xe5,0x01,0x05,0x31, +0x1f,0xc4,0x02,0x31,0xa2,0x04,0x1f,0xc1,0x01,0xc0,0x02,0x31,0x04,0x31,0x0f,0xa1, +0x03,0x1b,0xc3,0x02,0x38,0xc1,0xc9,0xcd,0x07,0x23,0x79,0xb8,0x30,0x06,0x69,0xd5, +0xaf,0x5f,0x18,0x07,0xb1,0xc8,0x68,0x41,0xd5,0x16,0x00,0x60,0x78,0x1f,0x85,0x38, +0x03,0xbc,0x38,0x07,0x94,0x4f,0xd9,0xc1,0xc5,0x18,0x04,0x4f,0xd5,0xd9,0xc1,0x2a, +0x7d,0x5c,0x78,0x84,0x47,0x79,0x3c,0x85,0x38,0x0d,0x28,0x0d,0x3d,0x4f,0xcd,0xe5, +0x22,0xd9,0x79,0x10,0xd9,0xd1,0xc9,0x28,0xf3,0xcf,0x0a,0xdf,0x06,0x00,0xc5,0x4f, +0x21,0x96,0x25,0xcd,0xdc,0x16,0x79,0xd2,0x84,0x26,0x06,0x00,0x4e,0x09,0xe9,0xcd, +0x74,0x00,0x03,0xfe,0x0d,0xca,0x8a,0x1c,0xfe,0x22,0x20,0xf3,0xcd,0x74,0x00,0xfe, +0x22,0xc9,0xe7,0xfe,0x28,0x20,0x06,0xcd,0x79,0x1c,0xdf,0xfe,0x29,0xc2,0x8a,0x1c, +0xfd,0xcb,0x01,0x7e,0xc9,0xcd,0x07,0x23,0x2a,0x36,0x5c,0x11,0x00,0x01,0x19,0x79, +0x0f,0x0f,0x0f,0xe6,0xe0,0xa8,0x5f,0x79,0xe6,0x18,0xee,0x40,0x57,0x06,0x60,0xc5, +0xd5,0xe5,0x1a,0xae,0x28,0x04,0x3c,0x20,0x1a,0x3d,0x4f,0x06,0x07,0x14,0x23,0x1a, +0xae,0xa9,0x20,0x0f,0x10,0xf7,0xc1,0xc1,0xc1,0x3e,0x80,0x90,0x01,0x01,0x00,0xf7, +0x12,0x18,0x0a,0xe1,0x11,0x08,0x00,0x19,0xd1,0xc1,0x10,0xd3,0x48,0xc3,0xb2,0x2a, +0xcd,0x07,0x23,0x79,0x0f,0x0f,0x0f,0x4f,0xe6,0xe0,0xa8,0x6f,0x79,0xe6,0x03,0xee, +0x58,0x67,0x7e,0xc3,0x28,0x2d,0x22,0x1c,0x28,0x4f,0x2e,0xf2,0x2b,0x12,0xa8,0x56, +0xa5,0x57,0xa7,0x84,0xa6,0x8f,0xc4,0xe6,0xaa,0xbf,0xab,0xc7,0xa9,0xce,0x00,0xe7, +0xc3,0xff,0x24,0xdf,0x23,0xe5,0x01,0x00,0x00,0xcd,0x0f,0x25,0x20,0x1b,0xcd,0x0f, +0x25,0x28,0xfb,0xcd,0x30,0x25,0x28,0x11,0xf7,0xe1,0xd5,0x7e,0x23,0x12,0x13,0xfe, +0x22,0x20,0xf8,0x7e,0x23,0xfe,0x22,0x28,0xf2,0x0b,0xd1,0x21,0x3b,0x5c,0xcb,0xb6, +0xcb,0x7e,0xc4,0xb2,0x2a,0xc3,0x12,0x27,0xe7,0xcd,0xfb,0x24,0xfe,0x29,0xc2,0x8a, +0x1c,0xe7,0xc3,0x12,0x27,0xc3,0xbd,0x27,0xcd,0x30,0x25,0x28,0x28,0xed,0x4b,0x76, +0x5c,0xcd,0x2b,0x2d,0xef,0xa1,0x0f,0x34,0x37,0x16,0x04,0x34,0x80,0x41,0x00,0x00, +0x80,0x32,0x02,0xa1,0x03,0x31,0x38,0xcd,0xa2,0x2d,0xed,0x43,0x76,0x5c,0x7e,0xa7, +0x28,0x03,0xd6,0x10,0x77,0x18,0x09,0xcd,0x30,0x25,0x28,0x04,0xef,0xa3,0x38,0x34, +0xe7,0xc3,0xc3,0x26,0x01,0x5a,0x10,0xe7,0xfe,0x23,0xca,0x0d,0x27,0x21,0x3b,0x5c, +0xcb,0xb6,0xcb,0x7e,0x28,0x1f,0xcd,0x8e,0x02,0x0e,0x00,0x20,0x13,0xcd,0x1e,0x03, +0x30,0x0e,0x15,0x5f,0xcd,0x33,0x03,0xf5,0x01,0x01,0x00,0xf7,0xf1,0x12,0x0e,0x01, +0x06,0x00,0xcd,0xb2,0x2a,0xc3,0x12,0x27,0xcd,0x22,0x25,0xc4,0x35,0x25,0xe7,0xc3, +0xdb,0x25,0xcd,0x22,0x25,0xc4,0x80,0x25,0xe7,0x18,0x48,0xcd,0x22,0x25,0xc4,0xcb, +0x22,0xe7,0x18,0x3f,0xcd,0x88,0x2c,0x30,0x56,0xfe,0x41,0x30,0x3c,0xcd,0x30,0x25, +0x20,0x23,0xcd,0x9b,0x2c,0xdf,0x01,0x06,0x00,0xcd,0x55,0x16,0x23,0x36,0x0e,0x23, +0xeb,0x2a,0x65,0x5c,0x0e,0x05,0xa7,0xed,0x42,0x22,0x65,0x5c,0xed,0xb0,0xeb,0x2b, +0xcd,0x77,0x00,0x18,0x0e,0xdf,0x23,0x7e,0xfe,0x0e,0x20,0xfa,0x23,0xcd,0xb4,0x33, +0x22,0x5d,0x5c,0xfd,0xcb,0x01,0xf6,0x18,0x14,0xcd,0xb2,0x28,0xda,0x2e,0x1c,0xcc, +0x96,0x29,0x3a,0x3b,0x5c,0xfe,0xc0,0x38,0x04,0x23,0xcd,0xb4,0x33,0x18,0x33,0x01, +0xdb,0x09,0xfe,0x2d,0x28,0x27,0x01,0x18,0x10,0xfe,0xae,0x28,0x20,0xd6,0xaf,0xda, +0x8a,0x1c,0x01,0xf0,0x04,0xfe,0x14,0x28,0x14,0xd2,0x8a,0x1c,0x06,0x10,0xc6,0xdc, +0x4f,0xfe,0xdf,0x30,0x02,0xcb,0xb1,0xfe,0xee,0x38,0x02,0xcb,0xb9,0xc5,0xe7,0xc3, +0xff,0x24,0xdf,0xfe,0x28,0x20,0x0c,0xfd,0xcb,0x01,0x76,0x20,0x17,0xcd,0x52,0x2a, +0xe7,0x18,0xf0,0x06,0x00,0x4f,0x21,0x95,0x27,0xcd,0xdc,0x16,0x30,0x06,0x4e,0x21, +0xed,0x26,0x09,0x46,0xd1,0x7a,0xb8,0x38,0x3a,0xa7,0xca,0x18,0x00,0xc5,0x21,0x3b, +0x5c,0x7b,0xfe,0xed,0x20,0x06,0xcb,0x76,0x20,0x02,0x1e,0x99,0xd5,0xcd,0x30,0x25, +0x28,0x09,0x7b,0xe6,0x3f,0x47,0xef,0x3b,0x38,0x18,0x09,0x7b,0xfd,0xae,0x01,0xe6, +0x40,0xc2,0x8a,0x1c,0xd1,0x21,0x3b,0x5c,0xcb,0xf6,0xcb,0x7b,0x20,0x02,0xcb,0xb6, +0xc1,0x18,0xc1,0xd5,0x79,0xfd,0xcb,0x01,0x76,0x20,0x15,0xe6,0x3f,0xc6,0x08,0x4f, +0xfe,0x10,0x20,0x04,0xcb,0xf1,0x18,0x08,0x38,0xd7,0xfe,0x17,0x28,0x02,0xcb,0xf9, +0xc5,0xe7,0xc3,0xff,0x24,0x2b,0xcf,0x2d,0xc3,0x2a,0xc4,0x2f,0xc5,0x5e,0xc6,0x3d, +0xce,0x3e,0xcc,0x3c,0xcd,0xc7,0xc9,0xc8,0xca,0xc9,0xcb,0xc5,0xc7,0xc6,0xc8,0x00, +0x06,0x08,0x08,0x0a,0x02,0x03,0x05,0x05,0x05,0x05,0x05,0x05,0x06,0xcd,0x30,0x25, +0x20,0x35,0xe7,0xcd,0x8d,0x2c,0xd2,0x8a,0x1c,0xe7,0xfe,0x24,0xf5,0x20,0x01,0xe7, +0xfe,0x28,0x20,0x12,0xe7,0xfe,0x29,0x28,0x10,0xcd,0xfb,0x24,0xdf,0xfe,0x2c,0x20, +0x03,0xe7,0x18,0xf5,0xfe,0x29,0xc2,0x8a,0x1c,0xe7,0x21,0x3b,0x5c,0xcb,0xb6,0xf1, +0x28,0x02,0xcb,0xf6,0xc3,0x12,0x27,0xe7,0xe6,0xdf,0x47,0xe7,0xd6,0x24,0x4f,0x20, +0x01,0xe7,0xe7,0xe5,0x2a,0x53,0x5c,0x2b,0x11,0xce,0x00,0xc5,0xcd,0x86,0x1d,0xc1, +0x30,0x02,0xcf,0x18,0xe5,0xcd,0xab,0x28,0xe6,0xdf,0xb8,0x20,0x08,0xcd,0xab,0x28, +0xd6,0x24,0xb9,0x28,0x0c,0xe1,0x2b,0x11,0x00,0x02,0xc5,0xcd,0x8b,0x19,0xc1,0x18, +0xd7,0xa7,0xcc,0xab,0x28,0xd1,0xd1,0xed,0x53,0x5d,0x5c,0xcd,0xab,0x28,0xe5,0xfe, +0x29,0x28,0x42,0x23,0x7e,0xfe,0x0e,0x16,0x40,0x28,0x07,0x2b,0xcd,0xab,0x28,0x23, +0x16,0x00,0x23,0xe5,0xd5,0xcd,0xfb,0x24,0xf1,0xfd,0xae,0x01,0xe6,0x40,0x20,0x2b, +0xe1,0xeb,0x2a,0x65,0x5c,0x01,0x05,0x00,0xed,0x42,0x22,0x65,0x5c,0xed,0xb0,0xeb, +0x2b,0xcd,0xab,0x28,0xfe,0x29,0x28,0x0d,0xe5,0xdf,0xfe,0x2c,0x20,0x0d,0xe7,0xe1, +0xcd,0xab,0x28,0x18,0xbe,0xe5,0xdf,0xfe,0x29,0x28,0x02,0xcf,0x19,0xd1,0xeb,0x22, +0x5d,0x5c,0x2a,0x0b,0x5c,0xe3,0x22,0x0b,0x5c,0xd5,0xe7,0xe7,0xcd,0xfb,0x24,0xe1, +0x22,0x5d,0x5c,0xe1,0x22,0x0b,0x5c,0xe7,0xc3,0x12,0x27,0x23,0x7e,0xfe,0x21,0x38, +0xfa,0xc9,0xfd,0xcb,0x01,0xf6,0xdf,0xcd,0x8d,0x2c,0xd2,0x8a,0x1c,0xe5,0xe6,0x1f, +0x4f,0xe7,0xe5,0xfe,0x28,0x28,0x28,0xcb,0xf1,0xfe,0x24,0x28,0x11,0xcb,0xe9,0xcd, +0x88,0x2c,0x30,0x0f,0xcd,0x88,0x2c,0x30,0x16,0xcb,0xb1,0xe7,0x18,0xf6,0xe7,0xfd, +0xcb,0x01,0xb6,0x3a,0x0c,0x5c,0xa7,0x28,0x06,0xcd,0x30,0x25,0xc2,0x51,0x29,0x41, +0xcd,0x30,0x25,0x20,0x08,0x79,0xe6,0xe0,0xcb,0xff,0x4f,0x18,0x37,0x2a,0x4b,0x5c, +0x7e,0xe6,0x7f,0x28,0x2d,0xb9,0x20,0x22,0x17,0x87,0xf2,0x3f,0x29,0x38,0x30,0xd1, +0xd5,0xe5,0x23,0x1a,0x13,0xfe,0x20,0x28,0xfa,0xf6,0x20,0xbe,0x28,0xf4,0xf6,0x80, +0xbe,0x20,0x06,0x1a,0xcd,0x88,0x2c,0x30,0x15,0xe1,0xc5,0xcd,0xb8,0x19,0xeb,0xc1, +0x18,0xce,0xcb,0xf8,0xd1,0xdf,0xfe,0x28,0x28,0x09,0xcb,0xe8,0x18,0x0d,0xd1,0xd1, +0xd1,0xe5,0xdf,0xcd,0x88,0x2c,0x30,0x03,0xe7,0x18,0xf8,0xe1,0xcb,0x10,0xcb,0x70, +0xc9,0x2a,0x0b,0x5c,0x7e,0xfe,0x29,0xca,0xef,0x28,0x7e,0xf6,0x60,0x47,0x23,0x7e, +0xfe,0x0e,0x28,0x07,0x2b,0xcd,0xab,0x28,0x23,0xcb,0xa8,0x78,0xb9,0x28,0x12,0x23, +0x23,0x23,0x23,0x23,0xcd,0xab,0x28,0xfe,0x29,0xca,0xef,0x28,0xcd,0xab,0x28,0x18, +0xd9,0xcb,0x69,0x20,0x0c,0x23,0xed,0x5b,0x65,0x5c,0xcd,0xc0,0x33,0xeb,0x22,0x65, +0x5c,0xd1,0xd1,0xaf,0x3c,0xc9,0xaf,0x47,0xcb,0x79,0x20,0x4b,0xcb,0x7e,0x20,0x0e, +0x3c,0x23,0x4e,0x23,0x46,0x23,0xeb,0xcd,0xb2,0x2a,0xdf,0xc3,0x49,0x2a,0x23,0x23, +0x23,0x46,0xcb,0x71,0x28,0x0a,0x05,0x28,0xe8,0xeb,0xdf,0xfe,0x28,0x20,0x61,0xeb, +0xeb,0x18,0x24,0xe5,0xdf,0xe1,0xfe,0x2c,0x28,0x20,0xcb,0x79,0x28,0x52,0xcb,0x71, +0x20,0x06,0xfe,0x29,0x20,0x3c,0xe7,0xc9,0xfe,0x29,0x28,0x6c,0xfe,0xcc,0x20,0x32, +0xdf,0x2b,0x22,0x5d,0x5c,0x18,0x5e,0x21,0x00,0x00,0xe5,0xe7,0xe1,0x79,0xfe,0xc0, +0x20,0x09,0xdf,0xfe,0x29,0x28,0x51,0xfe,0xcc,0x28,0xe5,0xc5,0xe5,0xcd,0xee,0x2a, +0xe3,0xeb,0xcd,0xcc,0x2a,0x38,0x19,0x0b,0xcd,0xf4,0x2a,0x09,0xd1,0xc1,0x10,0xb3, +0xcb,0x79,0x20,0x66,0xe5,0xcb,0x71,0x20,0x13,0x42,0x4b,0xdf,0xfe,0x29,0x28,0x02, +0xcf,0x02,0xe7,0xe1,0x11,0x05,0x00,0xcd,0xf4,0x2a,0x09,0xc9,0xcd,0xee,0x2a,0xe3, +0xcd,0xf4,0x2a,0xc1,0x09,0x23,0x42,0x4b,0xeb,0xcd,0xb1,0x2a,0xdf,0xfe,0x29,0x28, +0x07,0xfe,0x2c,0x20,0xdb,0xcd,0x52,0x2a,0xe7,0xfe,0x28,0x28,0xf8,0xfd,0xcb,0x01, +0xb6,0xc9,0xcd,0x30,0x25,0xc4,0xf1,0x2b,0xe7,0xfe,0x29,0x28,0x50,0xd5,0xaf,0xf5, +0xc5,0x11,0x01,0x00,0xdf,0xe1,0xfe,0xcc,0x28,0x17,0xf1,0xcd,0xcd,0x2a,0xf5,0x50, +0x59,0xe5,0xdf,0xe1,0xfe,0xcc,0x28,0x09,0xfe,0x29,0xc2,0x8a,0x1c,0x62,0x6b,0x18, +0x13,0xe5,0xe7,0xe1,0xfe,0x29,0x28,0x0c,0xf1,0xcd,0xcd,0x2a,0xf5,0xdf,0x60,0x69, +0xfe,0x29,0x20,0xe6,0xf1,0xe3,0x19,0x2b,0xe3,0xa7,0xed,0x52,0x01,0x00,0x00,0x38, +0x07,0x23,0xa7,0xfa,0x20,0x2a,0x44,0x4d,0xd1,0xfd,0xcb,0x01,0xb6,0xcd,0x30,0x25, +0xc8,0xaf,0xfd,0xcb,0x01,0xb6,0xc5,0xcd,0xa9,0x33,0xc1,0x2a,0x65,0x5c,0x77,0x23, +0x73,0x23,0x72,0x23,0x71,0x23,0x70,0x23,0x22,0x65,0x5c,0xc9,0xaf,0xd5,0xe5,0xf5, +0xcd,0x82,0x1c,0xf1,0xcd,0x30,0x25,0x28,0x12,0xf5,0xcd,0x99,0x1e,0xd1,0x78,0xb1, +0x37,0x28,0x05,0xe1,0xe5,0xa7,0xed,0x42,0x7a,0xde,0x00,0xe1,0xd1,0xc9,0xeb,0x23, +0x5e,0x23,0x56,0xc9,0xcd,0x30,0x25,0xc8,0xcd,0xa9,0x30,0xda,0x15,0x1f,0xc9,0x2a, +0x4d,0x5c,0xfd,0xcb,0x37,0x4e,0x28,0x5e,0x01,0x05,0x00,0x03,0x23,0x7e,0xfe,0x20, +0x28,0xfa,0x30,0x0b,0xfe,0x10,0x38,0x11,0xfe,0x16,0x30,0x0d,0x23,0x18,0xed,0xcd, +0x88,0x2c,0x38,0xe7,0xfe,0x24,0xca,0xc0,0x2b,0x79,0x2a,0x59,0x5c,0x2b,0xcd,0x55, +0x16,0x23,0x23,0xeb,0xd5,0x2a,0x4d,0x5c,0x1b,0xd6,0x06,0x47,0x28,0x11,0x23,0x7e, +0xfe,0x21,0x38,0xfa,0xf6,0x20,0x13,0x12,0x10,0xf4,0xf6,0x80,0x12,0x3e,0xc0,0x2a, +0x4d,0x5c,0xae,0xf6,0x20,0xe1,0xcd,0xea,0x2b,0xe5,0xef,0x02,0x38,0xe1,0x01,0x05, +0x00,0xa7,0xed,0x42,0x18,0x40,0xfd,0xcb,0x01,0x76,0x28,0x06,0x11,0x06,0x00,0x19, +0x18,0xe7,0x2a,0x4d,0x5c,0xed,0x4b,0x72,0x5c,0xfd,0xcb,0x37,0x46,0x20,0x30,0x78, +0xb1,0xc8,0xe5,0xf7,0xd5,0xc5,0x54,0x5d,0x23,0x36,0x20,0xed,0xb8,0xe5,0xcd,0xf1, +0x2b,0xe1,0xe3,0xa7,0xed,0x42,0x09,0x30,0x02,0x44,0x4d,0xe3,0xeb,0x78,0xb1,0x28, +0x02,0xed,0xb0,0xc1,0xd1,0xe1,0xeb,0x78,0xb1,0xc8,0xd5,0xed,0xb0,0xe1,0xc9,0x2b, +0x2b,0x2b,0x7e,0xe5,0xc5,0xcd,0xc6,0x2b,0xc1,0xe1,0x03,0x03,0x03,0xc3,0xe8,0x19, +0x3e,0xdf,0x2a,0x4d,0x5c,0xa6,0xf5,0xcd,0xf1,0x2b,0xeb,0x09,0xc5,0x2b,0x22,0x4d, +0x5c,0x03,0x03,0x03,0x2a,0x59,0x5c,0x2b,0xcd,0x55,0x16,0x2a,0x4d,0x5c,0xc1,0xc5, +0x03,0xed,0xb8,0xeb,0x23,0xc1,0x70,0x2b,0x71,0xf1,0x2b,0x77,0x2a,0x59,0x5c,0x2b, +0xc9,0x2a,0x65,0x5c,0x2b,0x46,0x2b,0x4e,0x2b,0x56,0x2b,0x5e,0x2b,0x7e,0x22,0x65, +0x5c,0xc9,0xcd,0xb2,0x28,0xc2,0x8a,0x1c,0xcd,0x30,0x25,0x20,0x08,0xcb,0xb1,0xcd, +0x96,0x29,0xcd,0xee,0x1b,0x38,0x08,0xc5,0xcd,0xb8,0x19,0xcd,0xe8,0x19,0xc1,0xcb, +0xf9,0x06,0x00,0xc5,0x21,0x01,0x00,0xcb,0x71,0x20,0x02,0x2e,0x05,0xeb,0xe7,0x26, +0xff,0xcd,0xcc,0x2a,0xda,0x20,0x2a,0xe1,0xc5,0x24,0xe5,0x60,0x69,0xcd,0xf4,0x2a, +0xeb,0xdf,0xfe,0x2c,0x28,0xe8,0xfe,0x29,0x20,0xbb,0xe7,0xc1,0x79,0x68,0x26,0x00, +0x23,0x23,0x29,0x19,0xda,0x15,0x1f,0xd5,0xc5,0xe5,0x44,0x4d,0x2a,0x59,0x5c,0x2b, +0xcd,0x55,0x16,0x23,0x77,0xc1,0x0b,0x0b,0x0b,0x23,0x71,0x23,0x70,0xc1,0x78,0x23, +0x77,0x62,0x6b,0x1b,0x36,0x00,0xcb,0x71,0x28,0x02,0x36,0x20,0xc1,0xed,0xb8,0xc1, +0x70,0x2b,0x71,0x2b,0x3d,0x20,0xf8,0xc9,0xcd,0x1b,0x2d,0x3f,0xd8,0xfe,0x41,0x3f, +0xd0,0xfe,0x5b,0xd8,0xfe,0x61,0x3f,0xd0,0xfe,0x7b,0xc9,0xfe,0xc4,0x20,0x19,0x11, +0x00,0x00,0xe7,0xd6,0x31,0xce,0x00,0x20,0x0a,0xeb,0x3f,0xed,0x6a,0xda,0xad,0x31, +0xeb,0x18,0xef,0x42,0x4b,0xc3,0x2b,0x2d,0xfe,0x2e,0x28,0x0f,0xcd,0x3b,0x2d,0xfe, +0x2e,0x20,0x28,0xe7,0xcd,0x1b,0x2d,0x38,0x22,0x18,0x0a,0xe7,0xcd,0x1b,0x2d,0xda, +0x8a,0x1c,0xef,0xa0,0x38,0xef,0xa1,0xc0,0x02,0x38,0xdf,0xcd,0x22,0x2d,0x38,0x0b, +0xef,0xe0,0xa4,0x05,0xc0,0x04,0x0f,0x38,0xe7,0x18,0xef,0xfe,0x45,0x28,0x03,0xfe, +0x65,0xc0,0x06,0xff,0xe7,0xfe,0x2b,0x28,0x05,0xfe,0x2d,0x20,0x02,0x04,0xe7,0xcd, +0x1b,0x2d,0x38,0xcb,0xc5,0xcd,0x3b,0x2d,0xcd,0xd5,0x2d,0xc1,0xda,0xad,0x31,0xa7, +0xfa,0xad,0x31,0x04,0x28,0x02,0xed,0x44,0xc3,0x4f,0x2d,0xfe,0x30,0xd8,0xfe,0x3a, +0x3f,0xc9,0xcd,0x1b,0x2d,0xd8,0xd6,0x30,0x4f,0x06,0x00,0xfd,0x21,0x3a,0x5c,0xaf, +0x5f,0x51,0x48,0x47,0xcd,0xb6,0x2a,0xef,0x38,0xa7,0xc9,0xf5,0xef,0xa0,0x38,0xf1, +0xcd,0x22,0x2d,0xd8,0xef,0x01,0xa4,0x04,0x0f,0x38,0xcd,0x74,0x00,0x18,0xf1,0x07, +0x0f,0x30,0x02,0x2f,0x3c,0xf5,0x21,0x92,0x5c,0xcd,0x0b,0x35,0xef,0xa4,0x38,0xf1, +0xcb,0x3f,0x30,0x0d,0xf5,0xef,0xc1,0xe0,0x00,0x04,0x04,0x33,0x02,0x05,0xe1,0x38, +0xf1,0x28,0x08,0xf5,0xef,0x31,0x04,0x38,0xf1,0x18,0xe5,0xef,0x02,0x38,0xc9,0x23, +0x4e,0x23,0x7e,0xa9,0x91,0x5f,0x23,0x7e,0x89,0xa9,0x57,0xc9,0x0e,0x00,0xe5,0x36, +0x00,0x23,0x71,0x23,0x7b,0xa9,0x91,0x77,0x23,0x7a,0x89,0xa9,0x77,0x23,0x36,0x00, +0xe1,0xc9,0xef,0x38,0x7e,0xa7,0x28,0x05,0xef,0xa2,0x0f,0x27,0x38,0xef,0x02,0x38, +0xe5,0xd5,0xeb,0x46,0xcd,0x7f,0x2d,0xaf,0x90,0xcb,0x79,0x42,0x4b,0x7b,0xd1,0xe1, +0xc9,0x57,0x17,0x9f,0x5f,0x4f,0xaf,0x47,0xcd,0xb6,0x2a,0xef,0x34,0xef,0x1a,0x20, +0x9a,0x85,0x04,0x27,0x38,0xcd,0xa2,0x2d,0xd8,0xf5,0x05,0x04,0x28,0x03,0xf1,0x37, +0xc9,0xf1,0xc9,0xef,0x31,0x36,0x00,0x0b,0x31,0x37,0x00,0x0d,0x02,0x38,0x3e,0x30, +0xd7,0xc9,0x2a,0x38,0x3e,0x2d,0xd7,0xef,0xa0,0xc3,0xc4,0xc5,0x02,0x38,0xd9,0xe5, +0xd9,0xef,0x31,0x27,0xc2,0x03,0xe2,0x01,0xc2,0x02,0x38,0x7e,0xa7,0x20,0x47,0xcd, +0x7f,0x2d,0x06,0x10,0x7a,0xa7,0x20,0x06,0xb3,0x28,0x09,0x53,0x06,0x08,0xd5,0xd9, +0xd1,0xd9,0x18,0x57,0xef,0xe2,0x38,0x7e,0xd6,0x7e,0xcd,0xc1,0x2d,0x57,0x3a,0xac, +0x5c,0x92,0x32,0xac,0x5c,0x7a,0xcd,0x4f,0x2d,0xef,0x31,0x27,0xc1,0x03,0xe1,0x38, +0xcd,0xd5,0x2d,0xe5,0x32,0xa1,0x5c,0x3d,0x17,0x9f,0x3c,0x21,0xab,0x5c,0x77,0x23, +0x86,0x77,0xe1,0xc3,0xcf,0x2e,0xd6,0x80,0xfe,0x1c,0x38,0x13,0xcd,0xc1,0x2d,0xd6, +0x07,0x47,0x21,0xac,0x5c,0x86,0x77,0x78,0xed,0x44,0xcd,0x4f,0x2d,0x18,0x92,0xeb, +0xcd,0xba,0x2f,0xd9,0xcb,0xfa,0x7d,0xd9,0xd6,0x80,0x47,0xcb,0x23,0xcb,0x12,0xd9, +0xcb,0x13,0xcb,0x12,0xd9,0x21,0xaa,0x5c,0x0e,0x05,0x7e,0x8f,0x27,0x77,0x2b,0x0d, +0x20,0xf8,0x10,0xe7,0xaf,0x21,0xa6,0x5c,0x11,0xa1,0x5c,0x06,0x09,0xed,0x6f,0x0e, +0xff,0xed,0x6f,0x20,0x04,0x0d,0x0c,0x20,0x0a,0x12,0x13,0xfd,0x34,0x71,0xfd,0x34, +0x72,0x0e,0x00,0xcb,0x40,0x28,0x01,0x23,0x10,0xe7,0x3a,0xab,0x5c,0xd6,0x09,0x38, +0x0a,0xfd,0x35,0x71,0x3e,0x04,0xfd,0xbe,0x6f,0x18,0x41,0xef,0x02,0xe2,0x38,0xeb, +0xcd,0xba,0x2f,0xd9,0x3e,0x80,0x95,0x2e,0x00,0xcb,0xfa,0xd9,0xcd,0xdd,0x2f,0xfd, +0x7e,0x71,0xfe,0x08,0x38,0x06,0xd9,0xcb,0x12,0xd9,0x18,0x20,0x01,0x00,0x02,0x7b, +0xcd,0x8b,0x2f,0x5f,0x7a,0xcd,0x8b,0x2f,0x57,0xc5,0xd9,0xc1,0x10,0xf1,0x21,0xa1, +0x5c,0x79,0xfd,0x4e,0x71,0x09,0x77,0xfd,0x34,0x71,0x18,0xd3,0xf5,0x21,0xa1,0x5c, +0xfd,0x4e,0x71,0x06,0x00,0x09,0x41,0xf1,0x2b,0x7e,0xce,0x00,0x77,0xa7,0x28,0x05, +0xfe,0x0a,0x3f,0x30,0x08,0x10,0xf1,0x36,0x01,0x04,0xfd,0x34,0x72,0xfd,0x70,0x71, +0xef,0x02,0x38,0xd9,0xe1,0xd9,0xed,0x4b,0xab,0x5c,0x21,0xa1,0x5c,0x78,0xfe,0x09, +0x38,0x04,0xfe,0xfc,0x38,0x26,0xa7,0xcc,0xef,0x15,0xaf,0x90,0xfa,0x52,0x2f,0x47, +0x18,0x0c,0x79,0xa7,0x28,0x03,0x7e,0x23,0x0d,0xcd,0xef,0x15,0x10,0xf4,0x79,0xa7, +0xc8,0x04,0x3e,0x2e,0xd7,0x3e,0x30,0x10,0xfb,0x41,0x18,0xe6,0x50,0x15,0x06,0x01, +0xcd,0x4a,0x2f,0x3e,0x45,0xd7,0x4a,0x79,0xa7,0xf2,0x83,0x2f,0xed,0x44,0x4f,0x3e, +0x2d,0x18,0x02,0x3e,0x2b,0xd7,0x06,0x00,0xc3,0x1b,0x1a,0xd5,0x6f,0x26,0x00,0x5d, +0x54,0x29,0x29,0x19,0x29,0x59,0x19,0x4c,0x7d,0xd1,0xc9,0x7e,0x36,0x00,0xa7,0xc8, +0x23,0xcb,0x7e,0xcb,0xfe,0x2b,0xc8,0xc5,0x01,0x05,0x00,0x09,0x41,0x4f,0x37,0x2b, +0x7e,0x2f,0xce,0x00,0x77,0x10,0xf8,0x79,0xc1,0xc9,0xe5,0xf5,0x4e,0x23,0x46,0x77, +0x23,0x79,0x4e,0xc5,0x23,0x4e,0x23,0x46,0xeb,0x57,0x5e,0xd5,0x23,0x56,0x23,0x5e, +0xd5,0xd9,0xd1,0xe1,0xc1,0xd9,0x23,0x56,0x23,0x5e,0xf1,0xe1,0xc9,0xa7,0xc8,0xfe, +0x21,0x30,0x16,0xc5,0x47,0xd9,0xcb,0x2d,0xcb,0x1a,0xcb,0x1b,0xd9,0xcb,0x1a,0xcb, +0x1b,0x10,0xf2,0xc1,0xd0,0xcd,0x04,0x30,0xc0,0xd9,0xaf,0x2e,0x00,0x57,0x5d,0xd9, +0x11,0x00,0x00,0xc9,0x1c,0xc0,0x14,0xc0,0xd9,0x1c,0x20,0x01,0x14,0xd9,0xc9,0xeb, +0xcd,0x6e,0x34,0xeb,0x1a,0xb6,0x20,0x26,0xd5,0x23,0xe5,0x23,0x5e,0x23,0x56,0x23, +0x23,0x23,0x7e,0x23,0x4e,0x23,0x46,0xe1,0xeb,0x09,0xeb,0x8e,0x0f,0xce,0x00,0x20, +0x0b,0x9f,0x77,0x23,0x73,0x23,0x72,0x2b,0x2b,0x2b,0xd1,0xc9,0x2b,0xd1,0xcd,0x93, +0x32,0xd9,0xe5,0xd9,0xd5,0xe5,0xcd,0x9b,0x2f,0x47,0xeb,0xcd,0x9b,0x2f,0x4f,0xb8, +0x30,0x03,0x78,0x41,0xeb,0xf5,0x90,0xcd,0xba,0x2f,0xcd,0xdd,0x2f,0xf1,0xe1,0x77, +0xe5,0x68,0x61,0x19,0xd9,0xeb,0xed,0x4a,0xeb,0x7c,0x8d,0x6f,0x1f,0xad,0xd9,0xeb, +0xe1,0x1f,0x30,0x08,0x3e,0x01,0xcd,0xdd,0x2f,0x34,0x28,0x23,0xd9,0x7d,0xe6,0x80, +0xd9,0x23,0x77,0x2b,0x28,0x1f,0x7b,0xed,0x44,0x3f,0x5f,0x7a,0x2f,0xce,0x00,0x57, +0xd9,0x7b,0x2f,0xce,0x00,0x5f,0x7a,0x2f,0xce,0x00,0x30,0x07,0x1f,0xd9,0x34,0xca, +0xad,0x31,0xd9,0x57,0xd9,0xaf,0xc3,0x55,0x31,0xc5,0x06,0x10,0x7c,0x4d,0x21,0x00, +0x00,0x29,0x38,0x0a,0xcb,0x11,0x17,0x30,0x03,0x19,0x38,0x02,0x10,0xf3,0xc1,0xc9, +0xcd,0xe9,0x34,0xd8,0x23,0xae,0xcb,0xfe,0x2b,0xc9,0x1a,0xb6,0x20,0x22,0xd5,0xe5, +0xd5,0xcd,0x7f,0x2d,0xeb,0xe3,0x41,0xcd,0x7f,0x2d,0x78,0xa9,0x4f,0xe1,0xcd,0xa9, +0x30,0xeb,0xe1,0x38,0x0a,0x7a,0xb3,0x20,0x01,0x4f,0xcd,0x8e,0x2d,0xd1,0xc9,0xd1, +0xcd,0x93,0x32,0xaf,0xcd,0xc0,0x30,0xd8,0xd9,0xe5,0xd9,0xd5,0xeb,0xcd,0xc0,0x30, +0xeb,0x38,0x5a,0xe5,0xcd,0xba,0x2f,0x78,0xa7,0xed,0x62,0xd9,0xe5,0xed,0x62,0xd9, +0x06,0x21,0x18,0x11,0x30,0x05,0x19,0xd9,0xed,0x5a,0xd9,0xd9,0xcb,0x1c,0xcb,0x1d, +0xd9,0xcb,0x1c,0xcb,0x1d,0xd9,0xcb,0x18,0xcb,0x19,0xd9,0xcb,0x19,0x1f,0x10,0xe4, +0xeb,0xd9,0xeb,0xd9,0xc1,0xe1,0x78,0x81,0x20,0x01,0xa7,0x3d,0x3f,0x17,0x3f,0x1f, +0xf2,0x46,0x31,0x30,0x68,0xa7,0x3c,0x20,0x08,0x38,0x06,0xd9,0xcb,0x7a,0xd9,0x20, +0x5c,0x77,0xd9,0x78,0xd9,0x30,0x15,0x7e,0xa7,0x3e,0x80,0x28,0x01,0xaf,0xd9,0xa2, +0xcd,0xfb,0x2f,0x07,0x77,0x38,0x2e,0x23,0x77,0x2b,0x18,0x29,0x06,0x20,0xd9,0xcb, +0x7a,0xd9,0x20,0x12,0x07,0xcb,0x13,0xcb,0x12,0xd9,0xcb,0x13,0xcb,0x12,0xd9,0x35, +0x28,0xd7,0x10,0xea,0x18,0xd7,0x17,0x30,0x0c,0xcd,0x04,0x30,0x20,0x07,0xd9,0x16, +0x80,0xd9,0x34,0x28,0x18,0xe5,0x23,0xd9,0xd5,0xd9,0xc1,0x78,0x17,0xcb,0x16,0x1f, +0x77,0x23,0x71,0x23,0x72,0x23,0x73,0xe1,0xd1,0xd9,0xe1,0xd9,0xc9,0xcf,0x05,0xcd, +0x93,0x32,0xeb,0xaf,0xcd,0xc0,0x30,0x38,0xf4,0xeb,0xcd,0xc0,0x30,0xd8,0xd9,0xe5, +0xd9,0xd5,0xe5,0xcd,0xba,0x2f,0xd9,0xe5,0x60,0x69,0xd9,0x61,0x68,0xaf,0x06,0xdf, +0x18,0x10,0x17,0xcb,0x11,0xd9,0xcb,0x11,0xcb,0x10,0xd9,0x29,0xd9,0xed,0x6a,0xd9, +0x38,0x10,0xed,0x52,0xd9,0xed,0x52,0xd9,0x30,0x0f,0x19,0xd9,0xed,0x5a,0xd9,0xa7, +0x18,0x08,0xa7,0xed,0x52,0xd9,0xed,0x52,0xd9,0x37,0x04,0xfa,0xd2,0x31,0xf5,0x28, +0xe1,0x5f,0x51,0xd9,0x59,0x50,0xf1,0xcb,0x18,0xf1,0xcb,0x18,0xd9,0xc1,0xe1,0x78, +0x91,0xc3,0x3d,0x31,0x7e,0xa7,0xc8,0xfe,0x81,0x30,0x06,0x36,0x00,0x3e,0x20,0x18, +0x51,0xfe,0x91,0x20,0x1a,0x23,0x23,0x23,0x3e,0x80,0xa6,0x2b,0xb6,0x2b,0x20,0x03, +0x3e,0x80,0xae,0x2b,0x20,0x36,0x77,0x23,0x36,0xff,0x2b,0x3e,0x18,0x18,0x33,0x30, +0x2c,0xd5,0x2f,0xc6,0x91,0x23,0x56,0x23,0x5e,0x2b,0x2b,0x0e,0x00,0xcb,0x7a,0x28, +0x01,0x0d,0xcb,0xfa,0x06,0x08,0x90,0x80,0x38,0x04,0x5a,0x16,0x00,0x90,0x28,0x07, +0x47,0xcb,0x3a,0xcb,0x1b,0x10,0xfa,0xcd,0x8e,0x2d,0xd1,0xc9,0x7e,0xd6,0xa0,0xf0, +0xed,0x44,0xd5,0xeb,0x2b,0x47,0xcb,0x38,0xcb,0x38,0xcb,0x38,0x28,0x05,0x36,0x00, +0x2b,0x10,0xfb,0xe6,0x07,0x28,0x09,0x47,0x3e,0xff,0xcb,0x27,0x10,0xfc,0xa6,0x77, +0xeb,0xd1,0xc9,0xcd,0x96,0x32,0xeb,0x7e,0xa7,0xc0,0xd5,0xcd,0x7f,0x2d,0xaf,0x23, +0x77,0x2b,0x77,0x06,0x91,0x7a,0xa7,0x20,0x08,0xb3,0x42,0x28,0x10,0x53,0x58,0x06, +0x89,0xeb,0x05,0x29,0x30,0xfc,0xcb,0x09,0xcb,0x1c,0xcb,0x1d,0xeb,0x2b,0x73,0x2b, +0x72,0x2b,0x70,0xd1,0xc9,0x00,0xb0,0x00,0x40,0xb0,0x00,0x01,0x30,0x00,0xf1,0x49, +0x0f,0xda,0xa2,0x40,0xb0,0x00,0x0a,0x8f,0x36,0x3c,0x34,0xa1,0x33,0x0f,0x30,0xca, +0x30,0xaf,0x31,0x51,0x38,0x1b,0x35,0x24,0x35,0x3b,0x35,0x3b,0x35,0x3b,0x35,0x3b, +0x35,0x3b,0x35,0x3b,0x35,0x14,0x30,0x2d,0x35,0x3b,0x35,0x3b,0x35,0x3b,0x35,0x3b, +0x35,0x3b,0x35,0x3b,0x35,0x9c,0x35,0xde,0x35,0xbc,0x34,0x45,0x36,0x6e,0x34,0x69, +0x36,0xde,0x35,0x74,0x36,0xb5,0x37,0xaa,0x37,0xda,0x37,0x33,0x38,0x43,0x38,0xe2, +0x37,0x13,0x37,0xc4,0x36,0xaf,0x36,0x4a,0x38,0x92,0x34,0x6a,0x34,0xac,0x34,0xa5, +0x34,0xb3,0x34,0x1f,0x36,0xc9,0x35,0x01,0x35,0xc0,0x33,0xa0,0x36,0x86,0x36,0xc6, +0x33,0x7a,0x36,0x06,0x35,0xf9,0x34,0x9b,0x36,0x83,0x37,0x14,0x32,0xa2,0x33,0x4f, +0x2d,0x97,0x32,0x49,0x34,0x1b,0x34,0x2d,0x34,0x0f,0x34,0xcd,0xbf,0x35,0x78,0x32, +0x67,0x5c,0xd9,0xe3,0xd9,0xed,0x53,0x65,0x5c,0xd9,0x7e,0x23,0xe5,0xa7,0xf2,0x80, +0x33,0x57,0xe6,0x60,0x0f,0x0f,0x0f,0x0f,0xc6,0x7c,0x6f,0x7a,0xe6,0x1f,0x18,0x0e, +0xfe,0x18,0x30,0x08,0xd9,0x01,0xfb,0xff,0x54,0x5d,0x09,0xd9,0x07,0x6f,0x11,0xd7, +0x32,0x26,0x00,0x19,0x5e,0x23,0x56,0x21,0x65,0x33,0xe3,0xd5,0xd9,0xed,0x4b,0x66, +0x5c,0xc9,0xf1,0x3a,0x67,0x5c,0xd9,0x18,0xc3,0xd5,0xe5,0x01,0x05,0x00,0xcd,0x05, +0x1f,0xe1,0xd1,0xc9,0xed,0x5b,0x65,0x5c,0xcd,0xc0,0x33,0xed,0x53,0x65,0x5c,0xc9, +0xcd,0xa9,0x33,0xed,0xb0,0xc9,0x62,0x6b,0xcd,0xa9,0x33,0xd9,0xe5,0xd9,0xe3,0xc5, +0x7e,0xe6,0xc0,0x07,0x07,0x4f,0x0c,0x7e,0xe6,0x3f,0x20,0x02,0x23,0x7e,0xc6,0x50, +0x12,0x3e,0x05,0x91,0x23,0x13,0x06,0x00,0xed,0xb0,0xc1,0xe3,0xd9,0xe1,0xd9,0x47, +0xaf,0x05,0xc8,0x12,0x13,0x18,0xfa,0xa7,0xc8,0xf5,0xd5,0x11,0x00,0x00,0xcd,0xc8, +0x33,0xd1,0xf1,0x3d,0x18,0xf2,0x4f,0x07,0x07,0x81,0x4f,0x06,0x00,0x09,0xc9,0xd5, +0x2a,0x68,0x5c,0xcd,0x06,0x34,0xcd,0xc0,0x33,0xe1,0xc9,0x62,0x6b,0xd9,0xe5,0x21, +0xc5,0x32,0xd9,0xcd,0xf7,0x33,0xcd,0xc8,0x33,0xd9,0xe1,0xd9,0xc9,0xe5,0xeb,0x2a, +0x68,0x5c,0xcd,0x06,0x34,0xeb,0xcd,0xc0,0x33,0xeb,0xe1,0xc9,0x06,0x05,0x1a,0x4e, +0xeb,0x12,0x71,0x23,0x13,0x10,0xf7,0xeb,0xc9,0x47,0xcd,0x5e,0x33,0x31,0x0f,0xc0, +0x02,0xa0,0xc2,0x31,0xe0,0x04,0xe2,0xc1,0x03,0x38,0xcd,0xc6,0x33,0xcd,0x62,0x33, +0x0f,0x01,0xc2,0x02,0x35,0xee,0xe1,0x03,0x38,0xc9,0x06,0xff,0x18,0x06,0xcd,0xe9, +0x34,0xd8,0x06,0x00,0x7e,0xa7,0x28,0x0b,0x23,0x78,0xe6,0x80,0xb6,0x17,0x3f,0x1f, +0x77,0x2b,0xc9,0xd5,0xe5,0xcd,0x7f,0x2d,0xe1,0x78,0xb1,0x2f,0x4f,0xcd,0x8e,0x2d, +0xd1,0xc9,0xcd,0xe9,0x34,0xd8,0xd5,0x11,0x01,0x00,0x23,0xcb,0x16,0x2b,0x9f,0x4f, +0xcd,0x8e,0x2d,0xd1,0xc9,0xcd,0x99,0x1e,0xed,0x78,0x18,0x04,0xcd,0x99,0x1e,0x0a, +0xc3,0x28,0x2d,0xcd,0x99,0x1e,0x21,0x2b,0x2d,0xe5,0xc5,0xc9,0xcd,0xf1,0x2b,0x0b, +0x78,0xb1,0x20,0x23,0x1a,0xcd,0x8d,0x2c,0x38,0x09,0xd6,0x90,0x38,0x19,0xfe,0x15, +0x30,0x15,0x3c,0x3d,0x87,0x87,0x87,0xfe,0xa8,0x30,0x0c,0xed,0x4b,0x7b,0x5c,0x81, +0x4f,0x30,0x01,0x04,0xc3,0x2b,0x2d,0xcf,0x09,0xe5,0xc5,0x47,0x7e,0x23,0xb6,0x23, +0xb6,0x23,0xb6,0x78,0xc1,0xe1,0xc0,0x37,0xc9,0xcd,0xe9,0x34,0xd8,0x3e,0xff,0x18, +0x06,0xcd,0xe9,0x34,0x18,0x05,0xaf,0x23,0xae,0x2b,0x07,0xe5,0x3e,0x00,0x77,0x23, +0x77,0x23,0x17,0x77,0x1f,0x23,0x77,0x23,0x77,0xe1,0xc9,0xeb,0xcd,0xe9,0x34,0xeb, +0xd8,0x37,0x18,0xe7,0xeb,0xcd,0xe9,0x34,0xeb,0xd0,0xa7,0x18,0xde,0xeb,0xcd,0xe9, +0x34,0xeb,0xd0,0xd5,0x1b,0xaf,0x12,0x1b,0x12,0xd1,0xc9,0x78,0xd6,0x08,0xcb,0x57, +0x20,0x01,0x3d,0x0f,0x30,0x08,0xf5,0xe5,0xcd,0x3c,0x34,0xd1,0xeb,0xf1,0xcb,0x57, +0x20,0x07,0x0f,0xf5,0xcd,0x0f,0x30,0x18,0x33,0x0f,0xf5,0xcd,0xf1,0x2b,0xd5,0xc5, +0xcd,0xf1,0x2b,0xe1,0x7c,0xb5,0xe3,0x78,0x20,0x0b,0xb1,0xc1,0x28,0x04,0xf1,0x3f, +0x18,0x16,0xf1,0x18,0x13,0xb1,0x28,0x0d,0x1a,0x96,0x38,0x09,0x20,0xed,0x0b,0x13, +0x23,0xe3,0x2b,0x18,0xdf,0xc1,0xf1,0xa7,0xf5,0xef,0xa0,0x38,0xf1,0xf5,0xdc,0x01, +0x35,0xf1,0xf5,0xd4,0xf9,0x34,0xf1,0x0f,0xd4,0x01,0x35,0xc9,0xcd,0xf1,0x2b,0xd5, +0xc5,0xcd,0xf1,0x2b,0xe1,0xe5,0xd5,0xc5,0x09,0x44,0x4d,0xf7,0xcd,0xb2,0x2a,0xc1, +0xe1,0x78,0xb1,0x28,0x02,0xed,0xb0,0xc1,0xe1,0x78,0xb1,0x28,0x02,0xed,0xb0,0x2a, +0x65,0x5c,0x11,0xfb,0xff,0xe5,0x19,0xd1,0xc9,0xcd,0xd5,0x2d,0x38,0x0e,0x20,0x0c, +0xf5,0x01,0x01,0x00,0xf7,0xf1,0x12,0xcd,0xb2,0x2a,0xeb,0xc9,0xcf,0x0a,0x2a,0x5d, +0x5c,0xe5,0x78,0xc6,0xe3,0x9f,0xf5,0xcd,0xf1,0x2b,0xd5,0x03,0xf7,0xe1,0xed,0x53, +0x5d,0x5c,0xd5,0xed,0xb0,0xeb,0x2b,0x36,0x0d,0xfd,0xcb,0x01,0xbe,0xcd,0xfb,0x24, +0xdf,0xfe,0x0d,0x20,0x07,0xe1,0xf1,0xfd,0xae,0x01,0xe6,0x40,0xc2,0x8a,0x1c,0x22, +0x5d,0x5c,0xfd,0xcb,0x01,0xfe,0xcd,0xfb,0x24,0xe1,0x22,0x5d,0x5c,0x18,0xa0,0x01, +0x01,0x00,0xf7,0x22,0x5b,0x5c,0xe5,0x2a,0x51,0x5c,0xe5,0x3e,0xff,0xcd,0x01,0x16, +0xcd,0xe3,0x2d,0xe1,0xcd,0x15,0x16,0xd1,0x2a,0x5b,0x5c,0xa7,0xed,0x52,0x44,0x4d, +0xcd,0xb2,0x2a,0xeb,0xc9,0xcd,0x94,0x1e,0xfe,0x10,0xd2,0x9f,0x1e,0x2a,0x51,0x5c, +0xe5,0xcd,0x01,0x16,0xcd,0xe6,0x15,0x01,0x00,0x00,0x30,0x03,0x0c,0xf7,0x12,0xcd, +0xb2,0x2a,0xe1,0xcd,0x15,0x16,0xc3,0xbf,0x35,0xcd,0xf1,0x2b,0x78,0xb1,0x28,0x01, +0x1a,0xc3,0x28,0x2d,0xcd,0xf1,0x2b,0xc3,0x2b,0x2d,0xd9,0xe5,0x21,0x67,0x5c,0x35, +0xe1,0x20,0x04,0x23,0xd9,0xc9,0xd9,0x5e,0x7b,0x17,0x9f,0x57,0x19,0xd9,0xc9,0x13, +0x13,0x1a,0x1b,0x1b,0xa7,0x20,0xef,0xd9,0x23,0xd9,0xc9,0xf1,0xd9,0xe3,0xd9,0xc9, +0xef,0xc0,0x02,0x31,0xe0,0x05,0x27,0xe0,0x01,0xc0,0x04,0x03,0xe0,0x38,0xc9,0xef, +0x31,0x36,0x00,0x04,0x3a,0x38,0xc9,0x31,0x3a,0xc0,0x03,0xe0,0x01,0x30,0x00,0x03, +0xa1,0x03,0x38,0xc9,0xef,0x3d,0x34,0xf1,0x38,0xaa,0x3b,0x29,0x04,0x31,0x27,0xc3, +0x03,0x31,0x0f,0xa1,0x03,0x88,0x13,0x36,0x58,0x65,0x66,0x9d,0x78,0x65,0x40,0xa2, +0x60,0x32,0xc9,0xe7,0x21,0xf7,0xaf,0x24,0xeb,0x2f,0xb0,0xb0,0x14,0xee,0x7e,0xbb, +0x94,0x58,0xf1,0x3a,0x7e,0xf8,0xcf,0xe3,0x38,0xcd,0xd5,0x2d,0x20,0x07,0x38,0x03, +0x86,0x30,0x09,0xcf,0x05,0x38,0x07,0x96,0x30,0x04,0xed,0x44,0x77,0xc9,0xef,0x02, +0xa0,0x38,0xc9,0xef,0x3d,0x31,0x37,0x00,0x04,0x38,0xcf,0x09,0xa0,0x02,0x38,0x7e, +0x36,0x80,0xcd,0x28,0x2d,0xef,0x34,0x38,0x00,0x03,0x01,0x31,0x34,0xf0,0x4c,0xcc, +0xcc,0xcd,0x03,0x37,0x00,0x08,0x01,0xa1,0x03,0x01,0x38,0x34,0xef,0x01,0x34,0xf0, +0x31,0x72,0x17,0xf8,0x04,0x01,0xa2,0x03,0xa2,0x03,0x31,0x34,0x32,0x20,0x04,0xa2, +0x03,0x8c,0x11,0xac,0x14,0x09,0x56,0xda,0xa5,0x59,0x30,0xc5,0x5c,0x90,0xaa,0x9e, +0x70,0x6f,0x61,0xa1,0xcb,0xda,0x96,0xa4,0x31,0x9f,0xb4,0xe7,0xa0,0xfe,0x5c,0xfc, +0xea,0x1b,0x43,0xca,0x36,0xed,0xa7,0x9c,0x7e,0x5e,0xf0,0x6e,0x23,0x80,0x93,0x04, +0x0f,0x38,0xc9,0xef,0x3d,0x34,0xee,0x22,0xf9,0x83,0x6e,0x04,0x31,0xa2,0x0f,0x27, +0x03,0x31,0x0f,0x31,0x0f,0x31,0x2a,0xa1,0x03,0x31,0x37,0xc0,0x00,0x04,0x02,0x38, +0xc9,0xa1,0x03,0x01,0x36,0x00,0x02,0x1b,0x38,0xc9,0xef,0x39,0x2a,0xa1,0x03,0xe0, +0x00,0x06,0x1b,0x33,0x03,0xef,0x39,0x31,0x31,0x04,0x31,0x0f,0xa1,0x03,0x86,0x14, +0xe6,0x5c,0x1f,0x0b,0xa3,0x8f,0x38,0xee,0xe9,0x15,0x63,0xbb,0x23,0xee,0x92,0x0d, +0xcd,0xed,0xf1,0x23,0x5d,0x1b,0xea,0x04,0x38,0xc9,0xef,0x31,0x1f,0x01,0x20,0x05, +0x38,0xc9,0xcd,0x97,0x32,0x7e,0xfe,0x81,0x38,0x0e,0xef,0xa1,0x1b,0x01,0x05,0x31, +0x36,0xa3,0x01,0x00,0x06,0x1b,0x33,0x03,0xef,0xa0,0x01,0x31,0x31,0x04,0x31,0x0f, +0xa1,0x03,0x8c,0x10,0xb2,0x13,0x0e,0x55,0xe4,0x8d,0x58,0x39,0xbc,0x5b,0x98,0xfd, +0x9e,0x00,0x36,0x75,0xa0,0xdb,0xe8,0xb4,0x63,0x42,0xc4,0xe6,0xb5,0x09,0x36,0xbe, +0xe9,0x36,0x73,0x1b,0x5d,0xec,0xd8,0xde,0x63,0xbe,0xf0,0x61,0xa1,0xb3,0x0c,0x04, +0x0f,0x38,0xc9,0xef,0x31,0x31,0x04,0xa1,0x03,0x1b,0x28,0xa1,0x0f,0x05,0x24,0x31, +0x0f,0x38,0xc9,0xef,0x22,0xa3,0x03,0x1b,0x38,0xc9,0xef,0x31,0x30,0x00,0x1e,0xa2, +0x38,0xef,0x01,0x31,0x30,0x00,0x07,0x25,0x04,0x38,0xc3,0xc4,0x36,0x02,0x31,0x30, +0x00,0x09,0xa0,0x01,0x37,0x00,0x06,0xa1,0x01,0x05,0x02,0xa1,0x38,0xc9,0xbd,0x7b, +0x00,0xb0,0xbb,0xe6,0x60,0xbe,0x60,0x03,0xb2,0xd5,0xff,0xd5,0xbb,0xbf,0xff,0x72, +0x03,0xbb,0xff,0xfb,0xff,0xd5,0x13,0xdb,0x72,0xfa,0xe8,0x18,0xff,0x8a,0x01,0xaa, +0xe2,0xfb,0xff,0xd5,0x72,0xe4,0xb3,0x08,0xe8,0x1e,0xff,0x93,0x74,0x02,0x04,0x1f, +0x41,0x3c,0x3b,0x75,0xea,0x42,0x03,0xc2,0x3c,0x1b,0x75,0xe3,0x5e,0xb1,0xef,0xba, +0xc9,0x03,0x8a,0xc1,0xd0,0xe8,0xee,0xb0,0x11,0xee,0xee,0xe2,0xf5,0x4a,0xee,0x68, +0x00,0xa0,0x07,0xbd,0x6f,0x02,0x8b,0xc6,0xc1,0xc8,0x03,0x02,0xe4,0x72,0x02,0xf7, +0xd0,0xf6,0xd0,0xc0,0xec,0x06,0x04,0x05,0x8a,0xec,0x98,0xc1,0xe0,0x05,0x97,0xb0, +0x23,0xf7,0xe1,0x03,0xf8,0xaf,0xe8,0x9e,0x01,0x81,0xef,0x7e,0x0c,0x8a,0x9c,0x05, +0x12,0x32,0xff,0x60,0xb2,0x20,0x2a,0xda,0xe8,0x4a,0x01,0x61,0x81,0xff,0x00,0x20, +0x73,0x1f,0x60,0x81,0xef,0x37,0x01,0xb2,0x0d,0x93,0x2c,0x30,0x75,0x02,0xb0,0x3f, +0x3c,0x02,0x75,0x02,0xb0,0x20,0x93,0xe8,0x2b,0x01,0x61,0x8a,0x9f,0x54,0x12,0xeb, +0x2d,0x60,0x81,0xef,0x80,0x11,0x8a,0x9f,0xeb,0x11,0xb2,0x0e,0xff,0xd5,0x61,0x60, +0x81,0xef,0xf7,0x09,0x8a,0x9f,0x29,0x12,0xb2,0x0d,0xff,0xd5,0x61,0x60,0x80,0xc3, +0xa5,0x81,0xef,0x77,0x02,0xb2,0x0b,0xff,0xd5,0x61,0x8a,0x9f,0x05,0x12,0x81,0xc7, +0x00,0x05,0xb2,0x04,0xff,0xd5,0x4e,0x0f,0x89,0x6b,0xff,0xbb,0xff,0x02,0x8b,0xf3, +0xad,0x97,0xe8,0x22,0x01,0x81,0xef,0x7c,0x16,0x8b,0xde,0xe8,0x81,0x00,0xfe,0xca, +0x75,0xec,0xc6,0x44,0xdb,0xaa,0xbd,0x08,0x00,0xbb,0x01,0x00,0xbf,0x40,0xfa,0xcd, +0x1a,0x8b,0xf2,0x46,0xcd,0x1a,0x3b,0xf2,0x73,0xfa,0x8d,0xb5,0x40,0x01,0xb1,0xc1, +0x26,0xf3,0xa4,0x83,0xc7,0x7f,0x4b,0x75,0xf1,0x80,0x3e,0x0c,0x02,0x54,0x74,0x0a, +0xfe,0x06,0x0c,0x02,0x81,0x2e,0x0f,0x02,0x40,0x01,0xe4,0x60,0x3c,0xbb,0x74,0x02, +0x78,0x28,0x4d,0x75,0xc4,0x80,0xc2,0x07,0x73,0xfb,0x42,0x60,0xbe,0x02,0x07,0xb6, +0x18,0xac,0x93,0xe8,0x7f,0x00,0xfe,0xce,0x75,0xf7,0x81,0xfe,0x20,0x0d,0x72,0x03, +0xbe,0x02,0x07,0x89,0x36,0x4f,0x02,0x61,0xeb,0x9c,0x1f,0x07,0xcb,0x80,0xeb,0xa4, +0x72,0x5c,0x8b,0xcb,0xbb,0x95,0x10,0x80,0x3f,0x80,0x43,0x72,0xfa,0xe2,0xf8,0x56, +0x8a,0x07,0x25,0x5f,0x00,0x74,0x27,0x2c,0x41,0x3c,0x19,0x73,0x29,0x03,0xc0,0x05, +0x2e,0x03,0x96,0xad,0xb1,0x05,0x51,0xb1,0x03,0xd1,0xe0,0x73,0x03,0x26,0x88,0x15, +0x47,0xe2,0xf6,0x81,0xc7,0x3d,0x01,0x59,0xe2,0xec,0x81,0xef,0x3c,0x06,0x80,0x3f, +0x80,0x43,0x72,0xcc,0x5e,0xc3,0x5e,0x81,0xc7,0x3e,0x06,0x8a,0x07,0x24,0x7f,0x2c, +0x20,0x53,0x93,0xe8,0x0f,0x00,0x5b,0x80,0x3f,0x80,0x43,0x72,0xee,0xc3,0x80,0xc3, +0x84,0x81,0xc7,0x40,0x06,0xb1,0x07,0xc1,0xe3,0x03,0x80,0xc7,0x4d,0xb4,0x08,0x8a, +0xc1,0xd7,0x8a,0xe8,0x8a,0xc2,0xd0,0xe5,0x73,0x02,0xaa,0x3d,0xd6,0x47,0xfe,0xcc, +0x75,0xf2,0x81,0xef,0x48,0x01,0xe2,0xe5,0x81,0xc7,0xc8,0x08,0xc3,0x22,0x47,0x45, +0x4e,0x54,0x45,0xd2,0x02,0x69,0x43,0x41,0x50,0xd3,0x02,0x6a,0x53,0x59,0x4d,0xc2, +0x22,0x6a,0x53,0x50,0x41,0x43,0xc5,0xb9,0x19,0x00,0x51,0xd6,0x2a,0xc1,0xb1,0x1a, +0xd2,0xc0,0xf3,0xaa,0x81,0xc7,0x26,0x01,0x59,0xe2,0xef,0xc3,0xda,0x57,0x5c,0xd7, +0x46,0x72,0xdc,0xd6,0x4e,0xf3,0x48,0xf3,0x5e,0xf2,0xda,0xb7,0x2e,0xe9,0xd6,0x64, +0x5a,0xb7,0x4e,0x92,0xda,0x5f,0xda,0xd6,0xd4,0x56,0x48,0xd7,0xa2,0x56,0x5a,0xd7, +0x1c,0x71,0x24,0xe9,0xde,0xb6,0xd4,0xb6,0xf4,0xb7,0x5a,0xb5,0x24,0xb5,0x01,0x03, +0x08,0x45,0x46,0x4c,0xa0,0x80,0x00,0xa5,0x00,0x08,0xf0,0x06,0x39,0x63,0x42,0x55, +0x04,0xc0,0x54,0x9b,0x90,0x04,0x04,0x59,0x12,0x86,0x52,0xce,0x18,0x05,0x02,0x3a, +0xec,0xbf,0x45,0x0a,0x6e,0xdc,0x34,0xa3,0x2e,0xc8,0xa1,0x72,0x93,0x5a,0x84,0xbf, +0xf6,0x0d,0x65,0x40,0x2a,0xf4,0x24,0x2f,0xb9,0xfa,0x9c,0xae,0x0a,0x10,0x01,0xd6, +0x3c,0x45,0x4a,0x40,0xfa,0x21,0x01,0xea,0x91,0x09,0xb9,0x39,0xa1,0x11,0x84,0x11, +0xaf,0x72,0x72,0xff,0x79,0xa4,0x16,0x00,0x4f,0x46,0x8d,0x40,0x21,0x40,0x54,0x24, +0x7c,0xea,0x17,0xd6,0x58,0xf0,0x80,0x1c,0xa3,0x7d,0x09,0x1a,0x44,0xa3,0xc8,0xf7, +0xbb,0xd5,0x98,0xff,0x7f,0x4b,0x03,0xdc,0xd8,0x24,0xc8,0x5a,0xc8,0x3d,0x5f,0x3f, +0xf6,0x60,0x99,0xe3,0xe6,0x9a,0x48,0x87,0x45,0x50,0xaa,0x68,0x1b,0xd8,0x5c,0xa2, +0x46,0x0a,0x34,0xda,0x90,0x52,0x94,0x45,0x05,0x06,0xa1,0x63,0xc6,0x67,0xaf,0x64, +0x7c,0x8b,0x2f,0xf5,0x07,0x70,0x0a,0x10,0x05,0x04,0x4c,0x6f,0x9a,0xa2,0xc3,0x51, +0xa8,0x51,0xcf,0xb4,0x40,0x83,0x34,0x6e,0xf3,0x40,0x8c,0x19,0x3a,0x8e,0x73,0xaf, +0x65,0xf9,0xb1,0x45,0x42,0x54,0x6a,0x8e,0x70,0x04,0xea,0x8f,0x73,0xa9,0x7e,0x1d, +0xc0,0x04,0x40,0xe4,0x4a,0x37,0x94,0x50,0x8f,0x04,0xeb,0xfc,0xe1,0x14,0x64,0x61, +0x16,0x57,0xe6,0x9b,0xb5,0x29,0x06,0x72,0x41,0x6f,0xb9,0xa3,0xb3,0xab,0xba,0x4d, +0xe4,0x4d,0x09,0xa0,0x37,0x12,0x33,0xbd,0x7a,0xbd,0x86,0x16,0x47,0x3d,0xc3,0x1c, +0xf7,0x09,0x82,0xa1,0xaa,0x14,0xe6,0x8a,0xa1,0x47,0x2f,0x44,0x13,0x60,0x24,0xe9, +0xfe,0x1d,0xcf,0x40,0x41,0x95,0xe0,0xcf,0xab,0x41,0x3e,0x22,0x2a,0xa7,0xeb,0xff, +0x4f,0xaa,0xbc,0xa5,0x7b,0x4d,0x56,0xde,0xf9,0x4d,0x3d,0xcd,0x1e,0x6a,0x81,0x32, +0x88,0x28,0xf0,0x8d,0xdd,0x4e,0x0e,0x1c,0x09,0x65,0x23,0xac,0xe7,0x5a,0xca,0x8a, +0x82,0x51,0x5b,0x92,0x46,0xee,0x36,0x4f,0xef,0x22,0x90,0xdb,0xda,0x4c,0x24,0xf2, +0x84,0xcf,0xff,0x62,0x38,0x9e,0x57,0x60,0x65,0x1c,0xa8,0xf0,0x12,0x97,0xe8,0x09, +0x35,0x8a,0x6c,0x0a,0x01,0x90,0x83,0x1a,0xa1,0x62,0x0f,0x08,0x42,0x90,0xcc,0x8b, +0x58,0xe1,0x8f,0x42,0xa1,0x45,0x24,0x45,0x4a,0x08,0x84,0x23,0x04,0x0e,0x19,0x3a, +0x9e,0xa8,0x8e,0x81,0x02,0x34,0x34,0xc2,0x28,0xff,0xa0,0xf1,0x11,0x85,0x9a,0x88, +0x28,0xef,0xbc,0xaa,0x34,0x19,0x25,0x8a,0xae,0x19,0xb5,0xa4,0x3c,0x2c,0x23,0xbc, +0x5e,0x38,0x43,0x02,0x6a,0xa3,0xc4,0x06,0x4c,0x8d,0x64,0x8a,0x0d,0x4b,0xaa,0xa1, +0xc4,0xd0,0x15,0x03,0x47,0x40,0x01,0xb5,0x66,0x40,0xfa,0x87,0x05,0xeb,0x08,0x66, +0x51,0xe9,0xc8,0x66,0x00,0xf7,0xb4,0x1b,0x57,0x71,0x59,0xb1,0xa0,0x1a,0xb9,0xa2, +0x45,0x00,0x14,0x63,0x61,0xc1,0x14,0x52,0x42,0x10,0xd2,0x87,0x1f,0xa7,0xe6,0x3e, +0xeb,0x4a,0x8c,0x5c,0x6f,0xba,0x8f,0x12,0x90,0x2b,0x82,0x55,0xc0,0x78,0xc6,0x3c, +0xcc,0x76,0x61,0xf7,0x6a,0x5a,0x1e,0x23,0x7c,0x38,0xa5,0x00,0x45,0x34,0x08,0x4c, +0x23,0x80,0x70,0x42,0x10,0xd2,0x87,0x1f,0x6f,0x26,0x3e,0xeb,0x4a,0x8c,0x5c,0x6f, +0xba,0x8f,0x12,0x90,0xe0,0x15,0x78,0x16,0xb3,0xa1,0x04,0x2b,0x20,0x2c,0x0d,0x8a, +0xcb,0x16,0xc4,0x1c,0x50,0x24,0xf3,0xb9,0x06,0x03,0x53,0x69,0xd8,0xe0,0x80,0x70, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x00, +0x00,0x24,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x7e,0x24,0x24,0x7e,0x24,0x00, +0x00,0x08,0x3e,0x28,0x3e,0x0a,0x3e,0x08,0x00,0x62,0x64,0x08,0x10,0x26,0x46,0x00, +0x00,0x10,0x28,0x10,0x2a,0x44,0x3a,0x00,0x00,0x08,0x10,0x00,0x00,0x00,0x00,0x00, +0x00,0x04,0x08,0x08,0x08,0x08,0x04,0x00,0x00,0x20,0x10,0x10,0x10,0x10,0x20,0x00, +0x00,0x00,0x14,0x08,0x3e,0x08,0x14,0x00,0x00,0x00,0x08,0x08,0x3e,0x08,0x08,0x00, +0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x10,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x00, +0x00,0x3c,0x46,0x4a,0x52,0x62,0x3c,0x00,0x00,0x18,0x28,0x08,0x08,0x08,0x3e,0x00, +0x00,0x3c,0x42,0x02,0x3c,0x40,0x7e,0x00,0x00,0x3c,0x42,0x0c,0x02,0x42,0x3c,0x00, +0x00,0x08,0x18,0x28,0x48,0x7e,0x08,0x00,0x00,0x7e,0x40,0x7c,0x02,0x42,0x3c,0x00, +0x00,0x3c,0x40,0x7c,0x42,0x42,0x3c,0x00,0x00,0x7e,0x02,0x04,0x08,0x10,0x10,0x00, +0x00,0x3c,0x42,0x3c,0x42,0x42,0x3c,0x00,0x00,0x3c,0x42,0x42,0x3e,0x02,0x3c,0x00, +0x00,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x10,0x10,0x20, +0x00,0x00,0x04,0x08,0x10,0x08,0x04,0x00,0x00,0x00,0x00,0x3e,0x00,0x3e,0x00,0x00, +0x00,0x00,0x10,0x08,0x04,0x08,0x10,0x00,0x00,0x3c,0x42,0x04,0x08,0x00,0x08,0x00, +0x00,0x3c,0x4a,0x56,0x5e,0x40,0x3c,0x00,0x00,0x3c,0x42,0x42,0x7e,0x42,0x42,0x00, +0x00,0x7c,0x42,0x7c,0x42,0x42,0x7c,0x00,0x00,0x3c,0x42,0x40,0x40,0x42,0x3c,0x00, +0x00,0x78,0x44,0x42,0x42,0x44,0x78,0x00,0x00,0x7e,0x40,0x7c,0x40,0x40,0x7e,0x00, +0x00,0x7e,0x40,0x7c,0x40,0x40,0x40,0x00,0x00,0x3c,0x42,0x40,0x4e,0x42,0x3c,0x00, +0x00,0x42,0x42,0x7e,0x42,0x42,0x42,0x00,0x00,0x3e,0x08,0x08,0x08,0x08,0x3e,0x00, +0x00,0x02,0x02,0x02,0x42,0x42,0x3c,0x00,0x00,0x44,0x48,0x70,0x48,0x44,0x42,0x00, +0x00,0x40,0x40,0x40,0x40,0x40,0x7e,0x00,0x00,0x42,0x66,0x5a,0x42,0x42,0x42,0x00, +0x00,0x42,0x62,0x52,0x4a,0x46,0x42,0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x3c,0x00, +0x00,0x7c,0x42,0x42,0x7c,0x40,0x40,0x00,0x00,0x3c,0x42,0x42,0x52,0x4a,0x3c,0x00, +0x00,0x7c,0x42,0x42,0x7c,0x44,0x42,0x00,0x00,0x3c,0x40,0x3c,0x02,0x42,0x3c,0x00, +0x00,0xfe,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x3c,0x00, +0x00,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00,0x42,0x42,0x42,0x42,0x5a,0x24,0x00, +0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,0x00,0x82,0x44,0x28,0x10,0x10,0x10,0x00, +0x00,0x7e,0x04,0x08,0x10,0x20,0x7e,0x00,0x00,0x0e,0x08,0x08,0x08,0x08,0x0e,0x00, +0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x70,0x00, +0x00,0x10,0x38,0x54,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff, +0x00,0x1c,0x22,0x78,0x20,0x20,0x7e,0x00,0x00,0x00,0x38,0x04,0x3c,0x44,0x3c,0x00, +0x00,0x20,0x20,0x3c,0x22,0x22,0x3c,0x00,0x00,0x00,0x1c,0x20,0x20,0x20,0x1c,0x00, +0x00,0x04,0x04,0x3c,0x44,0x44,0x3c,0x00,0x00,0x00,0x38,0x44,0x78,0x40,0x3c,0x00, +0x00,0x0c,0x10,0x18,0x10,0x10,0x10,0x00,0x00,0x00,0x3c,0x44,0x44,0x3c,0x04,0x38, +0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x00,0x00,0x10,0x00,0x30,0x10,0x10,0x38,0x00, +0x00,0x04,0x00,0x04,0x04,0x04,0x24,0x18,0x00,0x20,0x28,0x30,0x30,0x28,0x24,0x00, +0x00,0x10,0x10,0x10,0x10,0x10,0x0c,0x00,0x00,0x00,0x68,0x54,0x54,0x54,0x54,0x00, +0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x38,0x00, +0x00,0x00,0x78,0x44,0x44,0x78,0x40,0x40,0x00,0x00,0x3c,0x44,0x44,0x3c,0x04,0x06, +0x00,0x00,0x1c,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x38,0x40,0x38,0x04,0x78,0x00, +0x00,0x10,0x38,0x10,0x10,0x10,0x0c,0x00,0x00,0x00,0x44,0x44,0x44,0x44,0x38,0x00, +0x00,0x00,0x44,0x44,0x28,0x28,0x10,0x00,0x00,0x00,0x44,0x54,0x54,0x54,0x28,0x00, +0x00,0x00,0x44,0x28,0x10,0x28,0x44,0x00,0x00,0x00,0x44,0x44,0x44,0x3c,0x04,0x38, +0x00,0x00,0x7c,0x08,0x10,0x20,0x7c,0x00,0x00,0x0e,0x08,0x30,0x08,0x08,0x0e,0x00, +0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x70,0x10,0x0c,0x10,0x10,0x70,0x00, +0x00,0x14,0x28,0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x99,0xa1,0xa1,0x99,0x42,0x3c, + + }; diff --git a/programs/emulator/e80/trunk/asm_code.asm b/programs/emulator/e80/trunk/asm_code.asm new file mode 100644 index 0000000000..3947d4aeea --- /dev/null +++ b/programs/emulator/e80/trunk/asm_code.asm @@ -0,0 +1,39 @@ + +format MS COFF + +public Start +public _hStack +public _KOL_PATH +public _KOL_PARAM + +extrn Memory +extrn hEnd + +extrn _kol_main + +section ".text" code + db "MENUET01" + dd 1, Start, hEnd, Memory, _hStack, _KOL_PARAM, _KOL_PATH + +Start: + +; инициализация кучи +mov eax, 68 +mov ebx, 11 +int 0x40 + +; вызов главной процедуры +mov eax, _kol_main +call eax + +; завершение работы программы +mov eax, -1 +int 0x40 + +section ".bss" + +_KOL_PARAM rb 256 +_KOL_PATH rb 256 + +rb 16*1024 +_hStack: diff --git a/programs/emulator/e80/trunk/clean.bat b/programs/emulator/e80/trunk/clean.bat new file mode 100644 index 0000000000..01b03318a1 --- /dev/null +++ b/programs/emulator/e80/trunk/clean.bat @@ -0,0 +1,3 @@ +del e80.kex +del backup.sna +del *.o \ No newline at end of file diff --git a/programs/emulator/e80/trunk/compile.bat b/programs/emulator/e80/trunk/compile.bat new file mode 100644 index 0000000000..ccca77aa6f --- /dev/null +++ b/programs/emulator/e80/trunk/compile.bat @@ -0,0 +1,11 @@ +del *.o +fasm asm_code.asm start.o +gcc -c z80/z80.c +gcc -c system/kolibri.c +gcc -c system/stdlib.c +gcc -c system/string.c +gcc -c e80.c +ld -nostdlib -T kolibri.ld -o e80.kex start.o kolibri.o stdlib.o string.o z80.o e80.o +objcopy e80.kex -O binary +kpack e80.kex +pause \ No newline at end of file diff --git a/programs/emulator/e80/trunk/e80.c b/programs/emulator/e80/trunk/e80.c new file mode 100644 index 0000000000..0470e1bc16 --- /dev/null +++ b/programs/emulator/e80/trunk/e80.c @@ -0,0 +1,534 @@ + +#include "system/kolibri.h" +#include "system/stdlib.h" +#include "system/string.h" +#include "z80/z80.h" +#include "48.h" + +#include "system/msgbox.c" + +///============================= + +#define TYPE_NO 0 +#define TYPE_SNA 1 +#define TYPE_Z80 2 + +#define SCREEN_LEN 3*3*256*192*3 + +char WND_CAPTION[] = {"e80 v0.5.1"}; + +extern char KOL_PARAM[256]; +extern char KOL_PATH[256]; + +char szBackup[256]; +char szScreen[256]; + +int fila[5][5]; +int main_tecla, hay_tecla; +int SSCS = 0; + +int debug=0, scanl=0; +int frame_counter; +int target_cycle; +Z80Regs spectrumZ80; + +char *screen; +unsigned screen_w, screen_h; +#define screen_a_w 512 +#define screen_a_h 384 +int flash = 0; +unsigned time = 0; + +///============================= + +#include "keyboard.c" + +///============================= + +int get_ext(char *filename) +{ + +return TYPE_SNA; +} + +///============================= + +void memory_print(Z80Regs *regs, char *filename) +{ +kol_struct70 file; + +file.p00 = 2; +file.p04 = 0; +file.p08 = 0; +file.p12 = 64*1024; +file.p16 = (unsigned)(regs->RAM); +file.p20 = 0; +file.p21 = filename; + +kol_file_70(&file); +} + + +///============================= + +void all_print(Z80Regs *regs, char *filename) +{ +kol_struct70 file; + +file.p00 = 2; +file.p04 = 0; +file.p08 = 0; +file.p12 = sizeof (Z80Regs); +file.p16 = (unsigned)regs; +file.p20 = 0; +file.p21 = filename; + +kol_file_70(&file); +} + +///============================= + +void screen_print(Z80Regs *regs) +{ + +kol_struct70 file; + +char palette[]= + { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xB0, 0x00, 0x00, 0xB0, 0x00, 0x00, + 0x00, 0x00, 0xB0, 0x00, 0x00, 0xB0, + 0xB0, 0x00, 0xB0, 0xB0, 0x00, 0xB0, + 0x00, 0xB0, 0x00, 0x00, 0xB0, 0x00, + 0xB0, 0xB0, 0x00, 0xB0, 0xB0, 0x00, + 0x00, 0xB0, 0xB0, 0x00, 0xB0, 0xB0, + 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0xFF, + 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, + 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0x00, + 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + }; + +char *scr; +char *atr; + +char a, c, s; +int i, j, k, l, m; +unsigned bri; +char *color; +char *addr; +int n = 0; +int z = 0; +int x, y; + +scr = malloc(6144); +atr = malloc(768); + +memcpy(scr, regs->RAM + 0x4000 , 6144); +memcpy(atr, regs->RAM + 0x5800 , 768); + +for (j = 0; j < 3 ; j++) +for (i = 0; i < 8; i++) +for (k = 0; k < 8; k++) +for (l = 0; l < 32; l++) + { + c = scr[j*2048 + k*256 + i*32 + l]; + for (m = 0; m < 8; m++) + { + s = (c & 128) >> 7; + a = atr[j*256 + i*32 + l]; + + if ( (a & 64) == 64 ) + bri = 8; + else + bri = 0; + + if ( 0 == s ) + { + if (!(flash && (128 == (a&128)))) + color = &palette[6*(bri+((a>>3)&7))]; + else + color = &palette[6*(bri+(a&7))]; + + addr = screen + 2*screen_a_w*3*z + 2*3*n; + + for (y = 0; y < 2; y++) + memcpy( addr + y*screen_a_w*3, + color, 6); + } + else + { + if (!(flash && (128 == (a&128)))) + color = &palette[6*(bri+(a&7))]; + else + color = &palette[6*(bri+((a>>3)&7))]; + + addr = screen + 2*screen_a_w*3*z + 2*3*n; + + for (y = 0; y < 2; y++) + memcpy( addr + y*screen_a_w*3, + color, 6); + } + + n++; + if (256 == n) + { + n = 0; + z++; + } + + c <<= 1; + } + } + +if ( 33 < (kol_time_tick() - time)) +{ +if (0 == flash) + flash = 1; +else + flash = 0; +time = kol_time_tick(); +} + +free(scr); +free(atr); + +} + +///============================= + +void memory_load_z80(Z80Regs *regs, char *filename) +{ +char header[30]; +kol_struct70 file; + +file.p00 = 0; +file.p04 = 0; +file.p08 = 0; +file.p12 = 30; +file.p16 = (unsigned) header; +file.p20 = 0; +file.p21 = filename; +} + +///============================= + +void memory_load_sna(Z80Regs *regs, char *filename) +{ +char buffer[27]; +kol_struct70 file; + +file.p00 = 0; +file.p04 = 0; +file.p08 = 0; +file.p12 = 27; +file.p16 = (unsigned) buffer; +file.p20 = 0; +file.p21 = filename; + +kol_file_70(&file); + +regs->I = buffer[ 0]; +regs->HLs.B.l = buffer[ 1]; +regs->HLs.B.h = buffer[ 2]; +regs->DEs.B.l = buffer[ 3]; +regs->DEs.B.h = buffer[ 4]; +regs->BCs.B.l = buffer[ 5]; +regs->BCs.B.h = buffer[ 6]; +regs->AFs.B.l = buffer[ 7]; +regs->AFs.B.h = buffer[ 8]; +regs->HL.B.l = buffer[ 9]; +regs->HL.B.h = buffer[10]; +regs->DE.B.l = buffer[11]; +regs->DE.B.h = buffer[12]; +regs->BC.B.l = buffer[13]; +regs->BC.B.h = buffer[14]; +regs->IY.B.l = buffer[15]; +regs->IY.B.h = buffer[16]; +regs->IX.B.l = buffer[17]; +regs->IX.B.h = buffer[18]; +regs->IFF1 = regs->IFF2 = (buffer[19]&0x04) >>2; +regs->R.W = buffer[20]; +regs->AF.B.l = buffer[21]; +regs->AF.B.h = buffer[22]; +regs->SP.B.l =buffer[23]; +regs->SP.B.h =buffer[24]; +regs->IM = buffer[25]; +regs->BorderColor = buffer[26]; + +file.p00 = 0; +file.p04 = 27; +file.p08 = 0; +file.p12 = 0x4000*3; +file.p16 = (unsigned) regs->RAM+16384; +file.p20 = 0; +file.p21 = filename; + +kol_file_70(&file); + +regs->PC.B.l = Z80MemRead(regs->SP.W, regs); +regs->SP.W++; +regs->PC.B.h = Z80MemRead(regs->SP.W, regs); +regs->SP.W++; + +} + + +///============================= + +void memory_save_sna(Z80Regs *regs, char *filename) +{ +char buffer[27]; +unsigned char sptmpl, sptmph; +kol_struct70 file; + +buffer[ 0] = regs->I; +buffer[ 1] = regs->HLs.B.l; +buffer[ 2] = regs->HLs.B.h; +buffer[ 3] = regs->DEs.B.l; +buffer[ 4] = regs->DEs.B.h; +buffer[ 5] = regs->BCs.B.l; +buffer[ 6] = regs->BCs.B.h; +buffer[ 7] = regs->AFs.B.l; +buffer[ 8] = regs->AFs.B.h; +buffer[ 9] = regs->HL.B.l; +buffer[10] = regs->HL.B.h; +buffer[11] = regs->DE.B.l; +buffer[12] = regs->DE.B.h; +buffer[13] = regs->BC.B.l; +buffer[14] = regs->BC.B.h; +buffer[15] = regs->IY.B.l; +buffer[16] = regs->IY.B.h; +buffer[17] = regs->IX.B.l; +buffer[18] = regs->IX.B.h; +buffer[19] = regs->IFF1 << 2; +buffer[20] = regs->R.W & 0xFF; +buffer[21] = regs->AF.B.l; +buffer[22] = regs->AF.B.h; + +sptmpl = Z80MemRead( regs->SP.W-1, regs ); +sptmph = Z80MemRead( regs->SP.W-2, regs ); + +Z80MemWrite( --(regs->SP.W), regs->PC.B.h, regs); +Z80MemWrite( --(regs->SP.W), regs->PC.B.l, regs); + +buffer[23] = regs->SP.B.l; +buffer[24] = regs->SP.B.h; +buffer[25] = regs->IM; +buffer[26] = regs->BorderColor; + +file.p00 = 2; +file.p04 = 0; +file.p08 = 0; +file.p12 = 27; +file.p16 = (unsigned) buffer; +file.p20 = 0; +file.p21 = filename; + +kol_file_70(&file); + +file.p00 = 3; +file.p04 = 27; +file.p08 = 0; +file.p12 = 0x4000*3; +file.p16 = (unsigned) regs->RAM+16384; +file.p20 = 0; +file.p21 = filename; + +kol_file_70(&file); + +regs->SP.W += 2; +Z80MemWrite( regs->SP.W-1, sptmpl, regs ); +Z80MemWrite( regs->SP.W-2, sptmph, regs ); + +} + + +///============================= + +void memory_save_scr(Z80Regs *regs, char *filename) +{ +kol_struct70 file; + + +file.p00 = 2; +file.p04 = 0x4000; +file.p08 = 0; +file.p12 = 6912; +file.p16 = (unsigned) regs->RAM+16384; +file.p20 = 0; +file.p21 = filename; + +kol_file_70(&file); + +} + + +///============================= + +void wnd_draw() +{ +kol_paint_start(); +kol_wnd_define( (screen_w-540)/2, (screen_h-440)/2, 540, 440, 0x34b0b0b0); +kol_wnd_caption(WND_CAPTION); +screen_print(&spectrumZ80); +kol_paint_image((540 - screen_a_w)/2-5, + (440 - screen_a_h-kol_skin_height())/2, + screen_a_w, screen_a_h, screen); +kol_paint_end(); +} + +///============================= + +void kol_main() +{ + +unsigned event; +unsigned key; + +for (event = strlen(KOL_PATH); event > 0; --event) + if ( '/' == KOL_PATH[event] ) + { + KOL_PATH[event+1]=0; + break; + } + +strcpy(szBackup, KOL_PATH); +strcpy(szScreen, KOL_PATH); +strcat(szBackup, "backup.sna"); +strcat(szScreen, "screen.scr"); + +kol_screen_get_size(&screen_w, &screen_h); + +screen = malloc(SCREEN_LEN); +spectrumZ80.RAM = (char*) malloc(64*1024); +memcpy(spectrumZ80.RAM, BIOS48, 16*1024); + +Z80Reset( &spectrumZ80, 69888 ); +Z80FlagTables(); + +fila[1][1] = fila[1][2] = fila[2][2] = fila[3][2] = fila[4][2] = + fila[4][1] = fila[3][1] = fila[2][1] = 0xFF; + +debug = 0; + +if (KOL_PARAM != NULL) + { + int type = get_ext(KOL_PARAM); + + if (TYPE_SNA == type) + memory_load_sna(&spectrumZ80, KOL_PARAM); + } + +hay_tecla = main_tecla = 0; +//keyboard_process(0); + +kol_key_mode_set(1); + +for (;;) + { + +// event = kol_event_check(); + event = kol_event_wait_time(1); + + switch (event) + { + + case 1: + wnd_draw(); + break; + + case 2: + key = (kol_key_get()>>8)&0xff; + + switch (key) + { + case 60: // F2 + if ( IDOK == MessageBox("Save snapshot?", + WND_CAPTION, MB_OKCANCEL) ) + memory_save_sna(&spectrumZ80, + szBackup); + break; + + case 61: // F3 + if ( IDOK == MessageBox("Load snapshot?", + WND_CAPTION, MB_OKCANCEL) ) + memory_load_sna(&spectrumZ80, + szBackup); + break; + + case 62: // F4 + if ( IDOK == MessageBox("Save screenshot?", + WND_CAPTION, MB_OKCANCEL) ) + memory_save_scr(&spectrumZ80, + szScreen); + break; + + case 88: // F12 Reset + if ( IDOK == MessageBox("Reset?", + WND_CAPTION, MB_OKCANCEL) ) + { + Z80Reset( &spectrumZ80, 69888 ); + Z80FlagTables(); + fila[1][1] = fila[1][2] = + fila[2][2] = fila[3][2] = + fila[4][2] = fila[4][1] = + fila[3][1] = fila[2][1] = 0xFF; + } + break; + + default: + keyboard_process(key); + }; + + break; + + case 3: + if ( 1 == (kol_btn_get() & 0xff00)>>8 ) + { + free(screen); + free(spectrumZ80.RAM); + kol_exit(); + } + break; + + default: + if (0 == debug) + { + + Z80Run( &spectrumZ80, 224*64 ); + for( scanl=0; scanl<192; scanl++ ) + Z80Run( &spectrumZ80, 224 ); + + Z80Run( &spectrumZ80, 224*56 ); + + if( target_cycle < 2 || frame_counter == 0 ) + { + screen_print(&spectrumZ80); + kol_screen_wait_rr(); + kol_paint_image((540 - screen_a_w)/2-5, + (440 - screen_a_h-kol_skin_height())/2, + screen_a_w, screen_a_h, screen); + } + + while( target_cycle == 0 ) + { + target_cycle--; + frame_counter++; + } + } + break; + + }; + + } + +} + +///============================= + diff --git a/programs/emulator/e80/trunk/games/othello.sna b/programs/emulator/e80/trunk/games/othello.sna new file mode 100644 index 0000000000..1e79e4f1ae Binary files /dev/null and b/programs/emulator/e80/trunk/games/othello.sna differ diff --git a/programs/emulator/e80/trunk/keyboard.c b/programs/emulator/e80/trunk/keyboard.c new file mode 100644 index 0000000000..5bfe750952 --- /dev/null +++ b/programs/emulator/e80/trunk/keyboard.c @@ -0,0 +1,408 @@ + +///============================= + +void keyboard_process(unsigned key) +{ + +switch (key) + { + + case 42: // L-Shift Down + case 54: // R-Shift Down + fila[4][1] &= 0xFE; + break; + + case 42+128: // L-Shift Up + case 54+128: // R-Shift Up + fila[4][1] |= 1; + break; + + case 29: // Ctrl Down + fila[4][2] &= 0xFD; + break; + + case 29+128: // Ctrl Up + fila[4][2] |= 2; + break; + + case 56: // Alt Down + fila[4][1] &= 0xFE; + fila[4][2] &= 0xFD; + break; + + case 56+128: // Alt Up + fila[4][1] |= 1; + fila[4][2] |= 2; + break; + + case 28: // Enter Down + fila[3][2] &= 0xFE; + break; + + case 28+128: // Enter Up + fila[3][2] |= 1; + break; + + + case 2: // 1 Down + fila[1][1] &= 0xFE; + break; + + case 2+128: // 1 Up + fila[1][1] |= 1; + break; + + case 3: // 2 Down + fila[1][1] &= 0xFD; + break; + + case 3+128: // 2 Up + fila[1][1] |= 2; + break; + + case 4: // 3 Down + fila[1][1] &= 0xFB; + break; + + case 4+128: // 3 Up + fila[1][1] |= 4; + break; + + case 5: // 4 Down + fila[1][1] &= 0xF7; + break; + + case 5+128: // 4 Up + fila[1][1] |= 8; + break; + + case 6: // 5 Down + fila[1][1] &= 0xEF; + break; + + case 6+128: // 5 Up + fila[1][1] |= 16; + break; + + case 7: // 6 Down + fila[1][2] &= 0xEF; + break; + + case 7+128: // 6 Up + fila[1][2] |= 16; + break; + + case 8: // 7 Down + fila[1][2] &= 0xF7; + break; + + case 8+128: // 7 Up + fila[1][2] |= 8; + break; + + case 9: // 8 Down + fila[1][2] &= 0xFB; + break; + + case 9+128: // 8 Up + fila[1][2] |= 4; + break; + + case 10: // 9 Down + fila[1][2] &= 0xFD; + break; + + case 10+128: // 9 Up + fila[1][2] |= 2; + break; + + case 11: // 0 Down + fila[1][2] &= 0xFE; + break; + + case 11+128: // 0 Up + fila[1][2] |= 1; + break; + + case 16: // Q Down + fila[2][1] &= 0xFE; + break; + + case 16+128: // Q Up + fila[2][1] |= 1; + break; + + case 17: // W Down + fila[2][1] &= 0xFD; + break; + + case 17+128: // W Up + fila[2][1] |= 2; + break; + + case 18: // E Down + fila[2][1] &= 0xFB; + break; + + case 18+128: // E Up + fila[2][1] |= 4; + break; + + case 19: // R Down + fila[2][1] &= 0xF7; + break; + + case 19+128: // R Up + fila[2][1] |= 8; + break; + + case 20: // T Down + fila[2][1] &= 0xEF; + break; + + case 20+128: // T Up + fila[2][1] |= 16; + break; + + case 21: // Y Down + fila[2][2] &= 0xEF; + break; + + case 21+128: // Y Up + fila[2][2] |= 16; + break; + + case 22: // U Down + fila[2][2] &= 0xF7; + break; + + case 22+128: // U Up + fila[2][2] |= 8; + break; + + case 23: // I Down + fila[2][2] &= 0xFB; + break; + + case 23+128: // I Up + fila[2][2] |= 4; + break; + + case 24: // O Down + fila[2][2] &= 0xFD; + break; + + case 24+128: // O Up + fila[2][2] |= 2; + break; + + case 25: // P Down + fila[2][2] &= 0xFE; + break; + + case 25+128: // P Up + fila[2][2] |= 1; + break; + + case 30: // A Down + fila[3][1] &= 0xFE; + break; + + case 30+128: // A Up + fila[3][1] |= 1; + break; + + case 31: // S Down + fila[3][1] &= 0xFD; + break; + + case 31+128: // S Up + fila[3][1] |= 2; + break; + + case 32: // D Down + fila[3][1] &= 0xFB; + break; + + case 32+128: // D Up + fila[3][1] |= 4; + break; + + case 33: // F Down + fila[3][1] &= 0xF7; + break; + + case 33+128: // F Up + fila[3][1] |= 8; + break; + + case 34: // G Down + fila[3][1] &= 0xEF; + break; + + case 34+128: // G Up + fila[3][1] |= 16; + break; + + case 35: // H Down + fila[3][2] &= 0xEF; + break; + + case 35+128: // H Up + fila[3][2] |= 16; + break; + + case 36: // J Down + fila[3][2] &= 0xF7; + break; + + case 36+128: // J Up + fila[3][2] |= 8; + break; + + case 37: // K Down + fila[3][2] &= 0xFB; + break; + + case 37+128: // K Up + fila[3][2] |= 4; + break; + + case 38: // L Down + fila[3][2] &= 0xFD; + break; + + case 38+128: // L Up + fila[3][2] |= 2; + break; + + case 44: // Z Down + fila[4][1] &= 0xFD; + break; + + case 44+128: // Z Up + fila[4][1] |= 2; + break; + + case 45: // X Down + fila[4][1] &= 0xFB; + break; + + case 45+128: // X Up + fila[4][1] |= 4; + break; + + case 46: // C Down + fila[4][1] &= 0xF7; + break; + + case 46+128: // C Up + fila[4][1] |= 8; + break; + + case 47: // V Down + fila[4][1] &= 0xEF; + break; + + case 47+128: // V Up + fila[4][1] |= 16; + break; + + case 48: // B Down + fila[4][2] &= 0xEF; + break; + + case 48+128: // B Up + fila[4][2] |= 16; + break; + + case 49: // N Down + fila[4][2] &= 0xF7; + break; + + case 49+128: // N Up + fila[4][2] |= 8; + break; + + case 50: // M Down + fila[4][2] &= 0xFB; + break; + + case 50+128: // M Up + fila[4][2] |= 4; + break; + + case 57: // Space Down + fila[4][2] &= 0xFE; + break; + + case 57+128: // Space Up + fila[4][2] |= 1; + break; + + case 14: // Backspace Down + fila[1][2] &= 0xFE; + fila[4][1] &= 0xFE; + break; + + case 14+128: // Backspace Up + fila[1][2] |= 1; + fila[4][1] |= 1; + break; + + case 12: // - Down + fila[3][2] &= 0xF7; + fila[4][2] &= 0xFD; + break; + + case 12+128: // - Up + fila[3][2] |= 8; + fila[4][2] |= 2; + break; + + case 53: // / Down + fila[4][1] &= 0xEF; + fila[4][2] &= 0xFD; + break; + + case 53+128: // / Up + fila[4][1] |= 16; + fila[4][2] |= 2; + break; + + case 52: // . Down + fila[4][2] &= 0xFB; + fila[4][2] &= 0xFD; + break; + + case 52+128: // . Up + fila[4][2] |= 4; + fila[4][2] |= 2; + break; + + case 51: // , Down + fila[4][2] &= 0xF7; + fila[4][2] &= 0xFD; + break; + + case 51+128: // , Up + fila[4][2] |= 8; + fila[4][2] |= 2; + break; + + case 13: // = Down + fila[3][2] &= 0xFD; + fila[4][2] &= 0xFD; + break; + + case 13+128: // = Up + fila[3][2] |= 2; + fila[4][2] |= 2; + break; + + }; + +} + +///============================= + diff --git a/programs/emulator/e80/trunk/keyboard.png b/programs/emulator/e80/trunk/keyboard.png new file mode 100644 index 0000000000..36f6ef91c1 Binary files /dev/null and b/programs/emulator/e80/trunk/keyboard.png differ diff --git a/programs/emulator/e80/trunk/kolibri.ld b/programs/emulator/e80/trunk/kolibri.ld new file mode 100644 index 0000000000..23841f98db --- /dev/null +++ b/programs/emulator/e80/trunk/kolibri.ld @@ -0,0 +1,20 @@ +/*OUTPUT_FORMAT("binary")*/ +ENTRY(Start) +SECTIONS +{ + .text 0x000000: + { + *(.text) + } + + .data : { + *(.data) + hEnd = . ; + } + + .bss : + { + *(.bss) + } + Memory = . ; +} diff --git a/programs/emulator/e80/trunk/readme.txt b/programs/emulator/e80/trunk/readme.txt new file mode 100644 index 0000000000..97190901fe --- /dev/null +++ b/programs/emulator/e80/trunk/readme.txt @@ -0,0 +1,45 @@ + + ============================================ + e80. Версия 0.5.1 15 февраля 2010 года + ============================================ + + Эмулятор ZX-Spectrum для ОС Колибри. + + Для запуска программ нужно в KFAR + сделать ассоциацию с файлами SNA. + + Автор ядра эмулятора Z80: + Santiago Romero Iglesias, + sromero@escomposlinux.org + + ============================================ + + Внимание! + + Эмулятор повторяет клавиатуру + реального Спектрума. + + Поэтому см. файл keyboard.png + + Клавиша Shift соответствует CS (CAPS SHIFT) + Клавиша Ctrl соответствует SS (SYMBOL SHIFT) + Клавиша Alt соответствует переключению CS+SS + + ============================================ + + Другие клавиши: + + F12 - перезагрузка эмулятора + + F2 - сохранение в текущую папку + файла backup.sna + + F3 - загрузка из текущей папки + файла backup.sna + + F4 - сохранение в текущую папку + файла screen.scr + + ============================================ + Александр Богомаз, albom85@yandex.ru + http://albom06.boom.ru diff --git a/programs/emulator/e80/trunk/system/kolibri.c b/programs/emulator/e80/trunk/system/kolibri.c new file mode 100644 index 0000000000..c5a8deb4ca --- /dev/null +++ b/programs/emulator/e80/trunk/system/kolibri.c @@ -0,0 +1,412 @@ + +#include "kolibri.h" +#include "string.h" + + +extern char KOL_PATH[256]; +extern char KOL_PARAM[256]; +extern char KOL_DIR[256]; + + +void kol_exit() +{ +asm ("int $0x40"::"a"(-1)); +} + + +void kol_sleep(unsigned d) +{ +asm ("int $0x40"::"a"(5), "b"(d)); +} + + +void kol_wnd_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c) +{ +asm ("nop"::"a"(0), "b"(x*65536+w), "c"(y*65536+h), "d"(c)); +asm ("movl $0xffffff, %esi \n int $0x40"); +} + + +void kol_wnd_move(unsigned x, unsigned y) +{ +asm ("nop"::"a"(67), "b"(x), "c"(y)); +asm ("movl $-1, %edx \n movl $-1, %esi \n int $0x40"); +} + + +void kol_event_mask(unsigned e) +{ +asm ("int $0x40"::"a"(40), "b"(e)); +} + + +unsigned kol_event_wait() +{ +asm ("int $0x40"::"a"(10)); +} + + +unsigned kol_event_wait_time(unsigned time) +{ +asm ("int $0x40"::"a"(23), "b"(time)); +} + + +unsigned kol_event_check() +{ +asm ("int $0x40"::"a"(11)); +} + + +void kol_paint_start() +{ +asm ("int $0x40"::"a"(12), "b"(1)); +} + + +void kol_paint_end() +{ +asm ("int $0x40"::"a"(12), "b"(2)); +} + + +void kol_paint_pixel(unsigned x, unsigned y, unsigned c) +{ +asm ("int $0x40"::"a"(1), "b"(x), "c"(y), "d"(c)); +} + + +void kol_paint_bar(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c) +{ +asm ("int $0x40"::"a"(13), "b"(x*65536+w), "c"(y*65536+h), "d"(c)); +} + + +void kol_paint_line(unsigned x1, unsigned y1, unsigned x2, unsigned y2, unsigned c) +{ +asm ("int $0x40"::"a"(38), "b"(x1*65536+x2), "c"(y1*65536+y2), "d"(c)); +} + + +void kol_paint_string(unsigned x, unsigned y, char *s, unsigned c) +{ +asm ("int $0x40"::"a"(4), "b"(x*65536+y), "c"(c), "d"(s)); +} + + +void kol_paint_image(unsigned x, unsigned y, unsigned w, unsigned h, char *d) +{ +asm ("int $0x40"::"a"(7), "c"(w*65536+h), "d"(x*65536+y), "b"(d)); +} + + +void kol_paint_image_pal(unsigned x, unsigned y, unsigned w, unsigned h, char *d, unsigned *palette) +{ +asm ("nop"::"c"(w*65536+h), "d"(x*65536+y), "b"(d)); +asm ("nop"::"a"(palette)); +asm ("movl %eax, %edi"); +asm ("xor %eax, %eax"); +asm ("movl %eax, %ebp"); +asm ("pushl $8"); +asm ("popl %esi"); +asm ("int $0x40"::"a"(65)); +} + + +unsigned kol_key_get() +{ +asm ("int $0x40"::"a"(2)); +} + + +unsigned kol_key_control() +{ +asm ("int $0x40"::"a"(66), "b"(3)); +} + + +void kol_key_lang_set(unsigned lang) +{ +asm ("int $0x40"::"a"(21), "b"(2), "c"(9), "d"(lang)); +} + + +unsigned kol_key_lang_get() +{ +asm ("int $0x40"::"a"(26), "b"(2), "c"(9)); +} + + +void kol_key_mode_set(unsigned mode) +{ +asm ("int $0x40"::"a"(66), "b"(1), "c"(mode)); +} + + +unsigned kol_key_mode_get() +{ +asm ("int $0x40"::"a"(66), "b"(2)); +} + + +unsigned kol_btn_get() +{ +asm ("int $0x40"::"a"(17)); +} + + +void kol_btn_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned d, unsigned c) +{ +asm ("nop"::"b"(x*65536+w), "c"(y*65536+h), "d"(d)); +asm ("nop"::"a"(c)); +asm ("movl %eax, %esi"); +asm ("int $0x40"::"a"(8)); +} + + +void kol_btn_type(unsigned t) +{ +asm ("int $0x40"::"a"(48), "b"(1), "c"(t)); +} + + +void kol_wnd_caption(char *s) +{ +asm ("int $0x40"::"a"(71), "b"(1), "c"(s)); +} + + +unsigned kol_mouse_pos() +{ +asm ("int $0x40"::"a"(37), "b"(0)); +} + + +unsigned kol_mouse_posw() +{ +asm ("int $0x40"::"a"(37), "b"(1)); +} + + +unsigned kol_mouse_btn() +{ +asm ("int $0x40"::"a"(37), "b"(2)); +} + + +void kol_board_putc(char c) +{ +asm ("int $0x40"::"a"(63), "b"(1), "c"(c)); +} + + +void kol_board_puts(char *s) +{ +unsigned i; +i = 0; +while (*(s+i)) + { + asm ("int $0x40"::"a"(63), "b"(1), "c"(*(s+i))); + i++; + } +} + + +void kol_board_puti(int n) +{ +char c; +int i = 0; +do + { + c = n % 10 + '0'; + asm ("int $0x40"::"a"(63), "b"(1), "c"(c)); + i++; + } + while ((n /= 10) > 0); +} + + +int kol_file_70(kol_struct70 *k) +{ +asm ("int $0x40"::"a"(70), "b"(k)); +} + + +kol_struct_import* kol_cofflib_load(char *name) +{ +asm ("int $0x40"::"a"(68), "b"(19), "c"(name)); +} + + +void* kol_cofflib_procload (kol_struct_import *imp, char *name) +{ +int i; +for (i=0;;i++) + if ( NULL == ((imp+i) -> name)) + break; + else + if ( 0 == strcmp(name, (imp+i)->name) ) + return (imp+i)->data; +return NULL; +} + + +unsigned kol_cofflib_procnum (kol_struct_import *imp) +{ +unsigned i, n; + +for (i=n=0;;i++) + if ( NULL == ((imp+i) -> name)) + break; + else + n++; + +return n; +} + + +void kol_cofflib_procname (kol_struct_import *imp, char *name, unsigned n) +{ +unsigned i; +*name = 0; + +for (i=0;;i++) + if ( NULL == ((imp+i) -> name)) + break; + else + if ( i == n ) + { + strcpy(name, ((imp+i)->name)); + break; + } + +} + + +unsigned kol_system_cpufreq() +{ +asm ("int $0x40"::"a"(18), "b"(5)); +} + + +unsigned kol_system_mem() +{ +asm ("int $0x40"::"a"(18), "b"(17)); +} + + +unsigned kol_system_memfree() +{ +asm ("int $0x40"::"a"(18), "b"(16)); +} + + +unsigned kol_system_time_get() +{ +asm ("int $0x40"::"a"(3)); +} + + +unsigned kol_system_date_get() +{ +asm ("int $0x40"::"a"(29)); +} + + +unsigned kol_system_end(unsigned param) +{ +asm ("int $0x40"::"a"(18), "b"(9), "c"(param)); +} + + +void kol_path_file2dir(char *dir, char *fname) +{ +unsigned i; +strcpy (dir, fname); +for ( i = strlen(dir);; --i) + if ( '/' == dir[i]) + { + dir[i] = '\0'; + return; + } +} + + +void kol_path_full(char *full, char *fname) +{ +char temp[256]; + +switch (*fname) +{ + +case '/': + strncpy(temp, fname+1, 2); + temp[2]=0; + if ( (!strcmp("rd", temp)) || (!strcmp("hd", temp)) || (!strcmp("cd", temp)) ) + strcpy (full, fname); + break; + +case '.': + break; + +default: + break; + +}; + +} + + + +void kol_screen_wait_rr() +{ +asm ("int $0x40"::"a"(18), "b"(14)); +} + + + +void kol_screen_get_size(unsigned *w, unsigned *h) +{ +unsigned size; +asm ("int $0x40":"=a"(size):"a"(14)); +*w = size / 65536; +*h = size % 65536; +} + + + +unsigned kol_skin_height() +{ +asm ("int $0x40"::"a"(48), "b"(4)); +} + + +unsigned kol_thread_start(unsigned start, unsigned stack) +{ +asm ("int $0x40"::"a"(51), "b"(1), "c"(start), "d"(stack)); +} + + +unsigned kol_time_tick() +{ +asm ("int $0x40"::"a"(26), "b"(9)); +} + + +unsigned kol_sound_speaker(char data[]) +{ +asm ("movl %0, %%esi"::"a"(data)); +asm ("int $0x40"::"a"(55), "b"(55)); +} + + +unsigned kol_process_info(unsigned slot, char buf1k[]) +{ +asm ("int $0x40"::"a"(9), "b"(buf1k), "c"(slot)); +} + + +int kol_process_kill_pid(unsigned process) +{ +asm ("int $0x40"::"a"(18), "b"(18), "c"(process)); +} diff --git a/programs/emulator/e80/trunk/system/kolibri.h b/programs/emulator/e80/trunk/system/kolibri.h new file mode 100644 index 0000000000..53575d1a72 --- /dev/null +++ b/programs/emulator/e80/trunk/system/kolibri.h @@ -0,0 +1,90 @@ + +#define NULL ((void*)0) + +typedef struct +{ +unsigned p00 __attribute__((packed)); +unsigned p04 __attribute__((packed)); +unsigned p08 __attribute__((packed)); +unsigned p12 __attribute__((packed)); +unsigned p16 __attribute__((packed)); +char p20 __attribute__((packed)); +char *p21 __attribute__((packed)); +} kol_struct70 __attribute__((packed)); + + +typedef struct +{ +unsigned p00 __attribute__((packed)); +char p04 __attribute__((packed)); +char p05[3] __attribute__((packed)); +unsigned p08 __attribute__((packed)); +unsigned p12 __attribute__((packed)); +unsigned p16 __attribute__((packed)); +unsigned p20 __attribute__((packed)); +unsigned p24 __attribute__((packed)); +unsigned p28 __attribute__((packed)); +unsigned p32[2] __attribute__((packed)); +unsigned p40 __attribute__((packed)); +} kol_struct_BDVK __attribute__((packed)); + +typedef struct +{ +char *name __attribute__((packed)); +void *data __attribute__((packed)); +} kol_struct_import __attribute__((packed)); + + +void kol_exit(); +void kol_sleep(unsigned d); +void kol_wnd_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c); +void kol_wnd_move(unsigned x, unsigned y); +void kol_wnd_caption(char *s); +void kol_event_mask(unsigned e); +unsigned kol_event_wait(); +unsigned kol_event_wait_time(unsigned time); +unsigned kol_event_check(); +void kol_paint_start(); +void kol_paint_end(); +void kol_paint_pixel(unsigned x, unsigned y, unsigned c); +void kol_paint_bar(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c); +void kol_paint_line(unsigned x1, unsigned y1, unsigned x2, unsigned y2, unsigned c); +void kol_paint_string(unsigned x, unsigned y, char *s, unsigned c); +void kol_paint_image(unsigned x, unsigned y, unsigned w, unsigned h, char *d); +void kol_paint_image_pal(unsigned x, unsigned y, unsigned w, unsigned h, char *d, unsigned *palette); +unsigned kol_key_get(); +unsigned kol_key_control(); +void kol_key_lang_set(unsigned lang); +unsigned kol_key_lang_get(); +void kol_key_mode_set(unsigned mode); +unsigned kol_key_mode_get(); +void kol_btn_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned d, unsigned c); +unsigned kol_btn_get(); +void kol_btn_type(unsigned t); +unsigned kol_mouse_pos(); +unsigned kol_mouse_posw(); +unsigned kol_mouse_btn(); +void kol_board_putc(char c); +void kol_board_puts(char *s); +void kol_board_puti(int n); +int kol_file_70(kol_struct70 *k); +kol_struct_import* kol_cofflib_load(char *name); +void* kol_cofflib_procload (kol_struct_import *imp, char *name); +unsigned kol_cofflib_procnum (kol_struct_import *imp); +void kol_cofflib_procname (kol_struct_import *imp, char *name, unsigned n); +unsigned kol_system_end(unsigned param); +unsigned kol_system_cpufreq(); +unsigned kol_system_mem(); +unsigned kol_system_memfree(); +unsigned kol_system_time_get(); +unsigned kol_system_date_get(); +void kol_path_file2dir(char *dir, char *fname); +void kol_path_full(char *full, char *fname); +void kol_screen_wait_rr(); +void kol_screen_get_size(unsigned *w, unsigned *h); +unsigned kol_skin_height(); +unsigned kol_thread_start(unsigned start, unsigned stack); +unsigned kol_time_tick(); +unsigned kol_sound_speaker(char data[]); +unsigned kol_process_info(unsigned slot, char buf1k[]); +int kol_process_kill_pid(unsigned process); diff --git a/programs/emulator/e80/trunk/system/msgbox.c b/programs/emulator/e80/trunk/system/msgbox.c new file mode 100644 index 0000000000..fda06dee3d --- /dev/null +++ b/programs/emulator/e80/trunk/system/msgbox.c @@ -0,0 +1,167 @@ + +///============================= + +#define MB_OK 0 +#define MB_OKCANCEL 1 +#define MB_ABORTRETRYIGNORE 2 +#define MB_YESNOCANCEL 3 +#define MB_YESNO 4 +#define MB_RETRYCANCEL 5 + +#define IDOK 1 +#define IDCANCEL 2 +#define IDABORT 3 +#define IDRETRY 4 +#define IDIGNORE 5 +#define IDYES 6 +#define IDNO 7 + +///============================= + +#define LANG_EN + +#ifdef LANG_RU +char BTN_OK[]={"OK"}; +char BTN_CANCEL[]={"Ћв¬Ґ­ "}; +char BTN_ABORT[]={"ЏаҐЄа вЁвм"}; +char BTN_RETRY[]={"Џ®ўв®аЁвм"}; +char BTN_INGNORE[]={"€Ј­®аЁа®ў вм"}; +char BTN_NO[]={"ЌҐв"}; +#endif + +#ifdef LANG_EN +char BTN_OK[]={"OK"}; +char BTN_CANCEL[]={"Cancel"}; +char BTN_ABORT[]={"Abort"}; +char BTN_RETRY[]={"Retry"}; +char BTN_INGNORE[]={"Ignore"}; +char BTN_NO[]={"No"}; +#endif + +///============================= + +kol_struct_import *MSG_BOX_IMPORT = NULL; +int (* _stdcall mb_create)(char *m, char* t); + +char msg[1024]; +char thread[1024]; + + +///============================= + +char MessageBox(char *text, char *caption, int type) +{ + +int i, j; + +if (MSG_BOX_IMPORT == NULL) + { + MSG_BOX_IMPORT = kol_cofflib_load("/sys/lib/Msgbox.obj"); + if (MSG_BOX_IMPORT == NULL) + kol_exit(); + + mb_create = kol_cofflib_procload (MSG_BOX_IMPORT, "mb_create"); + if (mb_create == NULL) + kol_exit(); + + } + +msg[0] = 255; +msg[1] = 0; + +for (i = 2, j = 0; ;i++, j++) + { + msg[i] = caption[j]; + if (0 == msg[i]) + break; + } + +i++; +msg[i] = 0; + +for (j = 0; ;i++, j++) + { + msg[i] = text[j]; + if (0 == msg[i]) + break; + } + +i++; +msg[i] = 0; + +switch (type) + { + case MB_OK: + for (j = 0; ;i++, j++) + { + msg[i] = BTN_OK[j]; + if (0 == msg[i]) + break; + } + break; + + case MB_OKCANCEL: + for (j = 0; ;i++, j++) + { + msg[i] = BTN_OK[j]; + if (0 == msg[i]) + break; + } + + i++; + msg[i] = 0; + + for (j = 0; ;i++, j++) + { + msg[i] = BTN_CANCEL[j]; + if (0 == msg[i]) + break; + } + break; + + default: + break; + + } +i++; +msg[i] = 0; + +mb_create(msg, thread+1024); + +for (;;) + { + if ( (unsigned char) msg[0] != 255 ) + switch (type) + { + case MB_OK: + if (msg[0] == 1) + return IDOK; + else + return 0; + break; + + case MB_OKCANCEL: + switch(msg[0]) + { + case 1: + return IDOK; + case 2: + return IDCANCEL; + default: + return 0; + }; + break; + + default: + return 0; + + }; + + kol_sleep(10); + } + + +} + +///============================= + diff --git a/programs/emulator/e80/trunk/system/stdlib.c b/programs/emulator/e80/trunk/system/stdlib.c new file mode 100644 index 0000000000..f52c263273 --- /dev/null +++ b/programs/emulator/e80/trunk/system/stdlib.c @@ -0,0 +1,33 @@ + +unsigned int seed_o = 0x45168297; + + +void srand (unsigned seed) +{ +seed_o = seed; +} + + +int rand (void) +{ +seed_o = seed_o * 0x15a4e35 + 1; +return(seed_o >> 16); +} + + +void* malloc(unsigned s) +{ +asm ("int $0x40"::"a"(68), "b"(12), "c"(s) ); +} + + +void free(void *p) +{ +asm ("int $0x40"::"a"(68), "b"(13), "c"(p) ); +} + + +void* realloc(void *p, unsigned s) +{ +asm ("int $0x40"::"a"(68), "b"(12), "c"(p), "d"(s) ); +} diff --git a/programs/emulator/e80/trunk/system/stdlib.h b/programs/emulator/e80/trunk/system/stdlib.h new file mode 100644 index 0000000000..e984555604 --- /dev/null +++ b/programs/emulator/e80/trunk/system/stdlib.h @@ -0,0 +1,14 @@ + +#define RAND_MAX 0x7FFFU + +#define isspace(c) ((c)==' ') +#define abs(i) (((i)<0)?(-(i)):(i)) + +#define random(num) ((rand()*(num))/((RAND_MAX+1))) + +void* malloc(unsigned size); +void free(void *pointer); +void* realloc(void* pointer, unsigned size); + +void srand (unsigned seed); +int rand (void); diff --git a/programs/emulator/e80/trunk/system/string.c b/programs/emulator/e80/trunk/system/string.c new file mode 100644 index 0000000000..145b47686c --- /dev/null +++ b/programs/emulator/e80/trunk/system/string.c @@ -0,0 +1,124 @@ + +#include "string.h" + +void* memset(void *mem, int c, unsigned size) +{ +unsigned i; + +for ( i = 0; i < size; i++ ) + *((char *)mem+i) = (char) c; + +return NULL; +} + + +void* memcpy(void *dst, const void *src, unsigned size) +{ + +unsigned i; + +for ( i = 0; i < size; i++) + *(char *)(dst+i) = *(char *)(src+i); + +return NULL; +} + + +int memcmp(const void* buf1, const void* buf2, int count) +{ +int i; +for (i=0;i*(unsigned char*)buf2) + return 1; + } +return 0; +} + +void strcat(char strDest[], char strSource[]) +{ + +int i, j; + +i = j = 0; +while (strDest[i] != '\0') + i++; + +while ((strDest[i++] = strSource[j++]) != '\0') + ; +} + + +int strcmp(const char* string1, const char* string2) +{ + +while (1) +{ +if (*string1<*string2) + return -1; +if (*string1>*string2) + return 1; + +if (*string1=='\0') + return 0; + +string1++; +string2++; +} + +} + + +void strcpy(char strDest[], const char strSource[]) +{ +unsigned i; + +i = 0; +while ((strDest[i] = strSource[i]) != '\0') + i++; + +} + + +char* strncpy(char *strDest, const char *strSource, unsigned n) +{ +unsigned i; + +if (! n ) + return strDest; + +i = 0; +while ((strDest[i] = strSource[i]) != '\0') + if ( (n-1) == i ) + break; + else + i++; + +return strDest; +} + + +int strlen(const char* string) +{ +int i; + +i=0; +while (*string++) i++; +return i; +} + + + +char* strchr(const char* string, int c) +{ + while (*string) + { + if (*string==c) + return (char*)string; + string++; + } + return (char*)0; +} + diff --git a/programs/emulator/e80/trunk/system/string.h b/programs/emulator/e80/trunk/system/string.h new file mode 100644 index 0000000000..1ce28e29e9 --- /dev/null +++ b/programs/emulator/e80/trunk/system/string.h @@ -0,0 +1,15 @@ + +#ifndef NULL +#define NULL ((void*)0) +#endif + +void* memset(void *mem, int c, unsigned size); +void* memcpy(void *dst, const void *src, unsigned size); +int memcmp(const void* buf1, const void* buf2, int count); + +void strcat(char strDest[], char strSource[]); +int strcmp(const char* string1, const char* string2); +void strcpy(char strDest[], const char strSource[]); +char* strncpy(char *strDest, const char *strSource, unsigned n); +int strlen(const char* string); +char *strchr(const char* string, int c); diff --git a/programs/emulator/e80/trunk/z80/macros.c b/programs/emulator/e80/trunk/z80/macros.c new file mode 100644 index 0000000000..cf97aabfde --- /dev/null +++ b/programs/emulator/e80/trunk/z80/macros.c @@ -0,0 +1,447 @@ +/*===================================================================== + Macros.c -> Macros used on the opcode execution. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Copyright (c) 2000 Santiago Romero Iglesias. + Email: sromero@escomposlinux.org + ======================================================================*/ + +/* defines for the registers: faster access to them when coding... */ + +#define r_PC regs->PC.W +#define r_PCl regs->PC.B.l +#define r_PCh regs->PC.B.h +#define r_SP regs->SP.W +#define r_IFF1 regs->IFF1 +#define r_IFF2 regs->IFF2 +#define r_R regs->R.W + +#define r_AF regs->AF.W +#define r_A regs->AF.B.h +#define r_F regs->AF.B.l +#define r_BC regs->BC.W +#define r_B regs->BC.B.h +#define r_C regs->BC.B.l +#define r_DE regs->DE.W +#define r_D regs->DE.B.h +#define r_E regs->DE.B.l +#define r_HL regs->HL.W +#define r_H regs->HL.B.h +#define r_L regs->HL.B.l +#define r_IX regs->IX.W +#define r_IXh regs->IX.B.h +#define r_IXl regs->IX.B.l +#define r_IY regs->IY.W +#define r_IYh regs->IY.B.h +#define r_IYl regs->IY.B.l + +#define r_AFs regs->AFs.W +#define r_As regs->AFs.B.h +#define r_Fs regs->AFs.B.l +#define r_BCs regs->BCs.W +#define r_Bs regs->BCs.B.h +#define r_Cs regs->BCs.B.l +#define r_DEs regs->DEs.W +#define r_Ds regs->DEs.B.h +#define r_Es regs->DEs.B.l +#define r_HLs regs->HLs.W +#define r_Hs regs->HLs.B.h +#define r_Ls regs->HLs.B.l +#define r_IXs regs->IX.W +#define r_IXhs regs->IX.B.h +#define r_IXls regs->IX.B.l +#define r_IYs regs->IY.W +#define r_IYhs regs->IY.B.h +#define r_IYls regs->IY.B.l + +#define r_op ops.W +#define r_oph ops.B.h +#define r_opl ops.B.l +#define r_tmp tmpreg2.W +#define r_tmph tmpreg2.B.h +#define r_tmpl tmpreg2.B.l +#define r_mem mread.W +#define r_memh mread.B.h +#define r_meml mread.B.l + +#ifndef _DISASM_ +/*--- Flag tables by Philip Kendall, taken from it's fuse emulator -*/ +/*--- I was having headache trying to emulate correctly the FLAGS, + so I finished using the FLAG tables used by P. Kendall. ------*/ +#define FLAG_C 0x01 +#define FLAG_N 0x02 +#define FLAG_P 0x04 +#define FLAG_V FLAG_P +#define FLAG_3 0x08 +#define FLAG_H 0x10 +#define FLAG_5 0x20 +#define FLAG_Z 0x40 +#define FLAG_S 0x80 + +/* Whether a half carry occured or not can be determined by looking at + the 3rd bit of the two arguments and the result; these are hashed + into this table in the form r12, where r is the 3rd bit of the + result, 1 is the 3rd bit of the 1st argument and 2 is the + third bit of the 2nd argument; the tables differ for add and subtract + operations */ + +/* Whether a half carry occured or not can be determined by looking at + the 3rd bit of the two arguments and the result; these are hashed + into this table in the form r12, where r is the 3rd bit of the + result, 1 is the 3rd bit of the 1st argument and 2 is the + third bit of the 2nd argument; the tables differ for add and subtract + operations */ +byte halfcarry_add_table[] = { 0, FLAG_H, FLAG_H, FLAG_H, 0, 0, 0, FLAG_H }; +byte halfcarry_sub_table[] = { 0, 0, FLAG_H, 0, FLAG_H, 0, FLAG_H, FLAG_H }; + +/* Similarly, overflow can be determined by looking at the 7th bits; again + the hash into this table is r12 */ +byte overflow_add_table[] = { 0, 0, 0, FLAG_V, FLAG_V, 0, 0, 0 }; +byte overflow_sub_table[] = { 0, FLAG_V, 0, 0, 0, 0, FLAG_V, 0 }; + +/* Some more tables; initialised in z80_init_tables() */ +byte sz53_table[0x100]; /* The S, Z, 5 and 3 bits of the temp value */ +byte parity_table[0x100]; /* The parity of the temp value */ +byte sz53p_table[0x100]; /* OR the above two tables together */ +/*------------------------------------------------------------------*/ + +// Contributed by Metalbrain to implement OUTI, etc. +byte ioblock_inc1_table[64]; +byte ioblock_dec1_table[64]; +byte ioblock_2_table[0x100]; + +/*--- Memory Write on the A address on no bank machines -------------*/ +void Z80WriteMem( word where, word A, Z80Regs *regs) +{ + if( where >= 16384 ) + regs->RAM[where] = A; +} + +#endif + + +/*--- Memory Read from the A address on no bank machines -------------*/ +#define Z80ReadMem(A) ((regs->RAM[(A)])) + +// return( regs->RAM[A] ); + + +/* macros to change the ICount register */ +#define AddCycles(n) regs->ICount-=(n) + +#define SubCycles(n) regs->ICount+=(n) + +//#define AddR(n) r_R = (r_R+(n)) +#define AddR(n) r_R = ((r_R & 0x80) | ((r_R+(n)) & 0x7f )) +#define SubR(n) r_R = ((r_R & 0x80) | ((r_R-(n)) & 0x7f )) + + +/* setting and resetting the flag bits: */ +#define SET_FLAG(flag) (r_F |= (flag)) + +#define RESET_FLAG(flag) (r_F &= ~(flag)) + +#define TEST_FLAG(flag) (r_F & (flag)) + + +/* store a given register in the stack (hi and lo bytes) */ +#define PUSH(rreg) \ + Z80WriteMem( --(r_SP), regs->rreg.B.h, regs); \ + Z80WriteMem( --(r_SP), regs->rreg.B.l, regs) + +#define POP(rreg)\ + regs->rreg.B.l = Z80ReadMem(r_SP); r_SP++;\ + regs->rreg.B.h = Z80ReadMem(r_SP); r_SP++ + +#define PUSH_IXYr() \ + Z80WriteMem( --(r_SP), REGH, regs); \ + Z80WriteMem( --(r_SP), REGL, regs) + +#define POP_IXYr()\ + REGL = Z80ReadMem(r_SP); r_SP++; \ + REGH = Z80ReadMem(r_SP); r_SP++ + +#define RST(rstval) PUSH(PC); r_PC=(rstval) + + +/*--- Move data to mem or regs --------------------------------------*/ +#define LD_r_r(dreg, sreg) (dreg) = (sreg) + +#define STORE_r(daddreg, sreg) Z80WriteMem((daddreg), (sreg), regs) + +#define STORE_nn_rr(dreg) \ + r_opl = Z80ReadMem(r_PC); r_PC++;\ + r_oph = Z80ReadMem(r_PC); r_PC++; \ + r_tmp = dreg; \ + Z80WriteMem((r_op),r_tmpl, regs); \ + Z80WriteMem((r_op+1),r_tmph, regs) + +#define STORE_nn_r(sreg) \ + r_opl = Z80ReadMem(r_PC); r_PC++; \ + r_oph = Z80ReadMem(r_PC); r_PC++; \ + Z80WriteMem((r_op),(sreg), regs) + +#define LOAD_r(dreg, saddreg) (dreg)=Z80ReadMem((saddreg)) + +#define LOAD_rr_nn(dreg) r_opl = Z80ReadMem(r_PC); r_PC++; \ + r_oph = Z80ReadMem(r_PC); r_PC++; \ + r_tmpl = Z80ReadMem(r_op); \ + r_tmph = Z80ReadMem((r_op)+1); \ + dreg=r_tmp + + +#define LOAD_r_nn(dreg) r_opl = Z80ReadMem(r_PC); r_PC++; \ + r_oph = Z80ReadMem(r_PC); r_PC++; \ + dreg = Z80ReadMem(r_op) + +#define LD_r_n(reg) (reg) = Z80ReadMem(r_PC++) + +#define LD_rr_nn(reg) r_opl = Z80ReadMem(r_PC); r_PC++; \ + r_oph = Z80ReadMem(r_PC); r_PC++; \ + reg = r_op + +#define EX(reg1,reg2) r_opl=(reg1); (reg1)=(reg2); (reg2)=r_opl + +#define EX_WORD(reg1,reg2) r_op=(reg1); (reg1)=(reg2); (reg2)=r_op + +/*--- Increments/Decrements -----------------------------------------*/ +#define INC(reg) (reg)++; \ + r_F = ( r_F & FLAG_C ) | ( (reg)==0x80 ? FLAG_V : 0 ) | \ + ( (reg)&0x0f ? 0 : FLAG_H ) | ( (reg) ? 0 : FLAG_Z ) | \ + sz53_table[(reg)] + +#define DEC(reg) \ + r_F = ( r_F & FLAG_C ) | ( (reg)&0x0f ? 0 : FLAG_H ) | FLAG_N; \ + (reg)--; \ + r_F |= ( (reg)==0x7f ? FLAG_V : 0 ) | sz53_table[(reg)] + +// it was: +// r_F |= ( (reg)==0x79 ? FLAG_V : 0 ) | sz53_table[(reg)] +// But Kak pointed my was not 0x79 -> 0x7F, changed 7-3-2001 + + +/*--- Bit operations ------------------------------------------------*/ +#define BIT_RES(b,reg) reg &= ~(0x1<>7 ); \ + r_F = ( (reg) & FLAG_C ) | sz53p_table[(reg)] + +#define RRC(reg) r_F = (reg) & FLAG_C; \ + (reg) = ( (reg)>>1 ) | ( (reg)<<7 );\ + r_F |= sz53p_table[(reg)] + +#define RL(reg) r_opl = (reg); \ + (reg) = ( (reg)<<1 ) | ( r_F & FLAG_C ); \ + r_F = ( r_opl >> 7 ) | sz53p_table[(reg)] + +#define RR(reg) r_opl = (reg); \ + (reg) = ( (reg)>>1 ) | ( r_F << 7 );\ + r_F = ( r_opl & FLAG_C ) | sz53p_table[(reg)] + +#define SLA(reg) r_F = (reg) >> 7;\ + (reg) <<= 1;\ + r_F |= sz53p_table[(reg)] + +#define SRA(reg) r_F = (reg) & FLAG_C; \ + (reg) = ( (reg) & 0x80 ) | ( (reg) >> 1 );\ + r_F |= sz53p_table[(reg)] + +#define SLL(reg) r_F = (reg) >> 7;\ + (reg) = ( (reg) << 1 ) | 0x01;\ + r_F |= sz53p_table[(reg)] + +#define SRL(reg) r_F = (reg) & FLAG_C;\ + (reg) >>= 1;\ + r_F |= sz53p_table[(reg)] + + + +/*--- JP operations -------------------------------------------------*/ +#define JP_nn() r_opl = Z80ReadMem(r_PC); \ + r_PC++; \ + r_oph = Z80ReadMem(r_PC); \ + r_PC = r_op + +#define JR_n() r_PC += (offset) (Z80ReadMem(r_PC)); r_PC++ + +#define RET_nn() r_PCl = Z80ReadMem (r_SP); r_SP++; \ + r_PCh = Z80ReadMem (r_SP); r_SP++; + +#define CALL_nn() r_opl = Z80ReadMem (r_PC); r_PC++; \ + r_oph = Z80ReadMem (r_PC); r_PC++; \ + Z80WriteMem( --(r_SP), r_PCh, regs ); \ + Z80WriteMem( --(r_SP), r_PCl, regs ); \ + r_PC = r_op + + +/*--- ALU operations ------------------------------------------------*/ +#define AND(reg) r_A &= (reg); \ + r_F = FLAG_H | sz53p_table[r_A] + +#define OR(reg) r_A |= (reg); \ + r_F = sz53p_table[r_A] + +#define XOR(reg) r_A ^= (reg); \ + r_F = sz53p_table[r_A] + +#define AND_mem(raddress) r_opl = Z80ReadMem(raddress); \ + r_A &= (r_opl); \ + r_F = FLAG_H | sz53p_table[r_A] + +#define OR_mem(raddress) r_opl = Z80ReadMem(raddress); \ + r_A |= (r_opl); \ + r_F = sz53p_table[r_A] + +#define XOR_mem(raddress) r_opl = Z80ReadMem(raddress); \ + r_A ^= (r_opl); \ + r_F = sz53p_table[r_A] + +#define ADD(val) tempword = r_A + (val); \ + r_oph = ((r_A&0x88)>>3)|(((val)&0x88)>>2) | \ + ( (tempword & 0x88) >> 1 ); \ + r_A = tempword; \ + r_F = ( tempword & 0x100 ? FLAG_C : 0 ) | \ + halfcarry_add_table[ r_oph & 0x07] | \ + overflow_add_table[ r_oph >> 4] | \ + sz53_table[r_A] + +#define ADD_WORD(value1,value2) \ + tempdword = (value1) + (value2); \ + r_oph = ( ( (value1) & 0x0800 ) >> 11 ) | \ + ( ( (value2) & 0x0800 ) >> 10 ) | \ + ( ( tempdword & 0x0800 ) >> 9 ); \ + (value1) = tempdword; \ + r_F = ( r_F & ( FLAG_V | FLAG_Z | FLAG_S ) ) | \ + ( tempdword & 0x10000 ? FLAG_C : 0 ) | \ + (( tempdword >> 8 ) & ( FLAG_3 | FLAG_5 ) ) | \ + halfcarry_add_table[r_oph] + +#define ADC(value) \ + tempword = r_A + (value) + ( r_F & FLAG_C ); \ + r_oph = ( (r_A & 0x88) >> 3 ) | ( ( (value) & 0x88 ) >> 2 ) |\ + ( (tempword & 0x88) >> 1 ); \ + r_A = tempword; \ + r_F = ( tempword & 0x100 ? FLAG_C : 0 ) | \ + halfcarry_add_table[r_oph & 0x07] | \ + overflow_add_table[r_oph >> 4] | \ + sz53_table[r_A] + +#define ADC_WORD(value) \ + tempdword= r_HL + (value) + ( r_F & FLAG_C ); \ + r_oph = ( ( r_HL & 0x8800 ) >> 11 ) | \ + ( ( (value) & 0x8800 ) >> 10 ) | \ + ( ( tempdword & 0x8800 ) >> 9 ); \ + r_HL = tempdword; \ + r_F = ( tempdword & 0x10000 ? FLAG_C : 0 )| \ + overflow_add_table[r_oph >> 4] | \ + ( r_H & ( FLAG_3 | FLAG_5 | FLAG_S ) ) | \ + halfcarry_add_table[ r_oph & 0x0f ]| \ + ( r_HL ? 0 : FLAG_Z ) + +#define SUB(value) \ + tempword = r_A - (value);\ + r_opl = ( (r_A & 0x88) >> 3 ) | \ + ( ( (value) & 0x88 ) >> 2 ) | \ + ( (tempword & 0x88) >> 1 ); \ + r_A = tempword; \ + r_F = ( tempword & 0x100 ? FLAG_C : 0 ) | FLAG_N | \ + halfcarry_sub_table[r_opl & 0x07] | \ + overflow_sub_table[r_opl >> 4] | \ + sz53_table[r_A] + +#define SBC(value) \ + tempword = r_A - (value) - ( r_F & FLAG_C ); \ + r_opl = ( (r_A & 0x88) >> 3 ) | \ + ( ( (value) & 0x88 ) >> 2 ) | \ + ( (tempword & 0x88) >> 1 ); \ + r_A = tempword; \ + r_F = ( tempword & 0x100 ? FLAG_C : 0 ) | FLAG_N | \ + halfcarry_sub_table[r_opl & 0x07] | \ + overflow_sub_table[r_opl >> 4] | \ + sz53_table[r_A] + + +#define SBC_WORD(Rg) \ + tempword=r_F & C_FLAG; r_op=(r_HL-Rg-tempword)&0xFFFF; \ + r_F= \ + N_FLAG| \ + (((long)r_HL-(long)Rg-(long)tempword)&0x10000? C_FLAG:0)| \ + ((r_HL^Rg)&(r_HL^r_op)&0x8000? O_FLAG:0)| \ + ((r_HL^Rg^r_op)&0x1000? H_FLAG:0)| \ + (r_op? 0:Z_FLAG)|(r_oph&S_FLAG); \ + r_HL=r_op + +#define CP(value) \ + tempword = r_A - (value);\ + r_opl = ( (r_A & 0x88) >> 3 ) | ( ( (value) & 0x88 ) >> 2 ) | \ + ( (tempword & 0x88) >> 1 ); \ + r_F = ( tempword & 0x100 ? FLAG_C : ( tempword ? 0 : FLAG_Z ) ) | FLAG_N |\ + halfcarry_sub_table[r_opl & 0x07] | \ + overflow_sub_table[r_opl >> 4] | \ + ( value & ( FLAG_3 | FLAG_5 ) ) | \ + ( tempword & FLAG_S ) + +#define NEG_A() r_opl = r_A; r_A=0; SUB(r_opl) + +/*--- MISC operations -----------------------------------------------*/ +#define IN(reg,port) (reg)=Z80InPort((port)); \ + r_F = ( r_F & FLAG_C) | sz53p_table[(reg)] + + + + + + + diff --git a/programs/emulator/e80/trunk/z80/op_cb.c b/programs/emulator/e80/trunk/z80/op_cb.c new file mode 100644 index 0000000000..7bdc5e2607 --- /dev/null +++ b/programs/emulator/e80/trunk/z80/op_cb.c @@ -0,0 +1,356 @@ +/*====================================================================/* + opcodes_cb.c -> This file executes the CB PREFIX opcodes. + + When you find the CB opcode, it means that you must fetch another + byte from memory and treat it as a new opcode with different + meaning than the single-byte opcodes. This is a common way to extend + the number of opcodes (8 bits of instruction word = just 256 opcodes) + and it's called an OPCODE PREFIX (now we have another 256 new opcodes + by using this trick). + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Copyright (c) 2000 Santiago Romero Iglesias. + Email: sromero@escomposlinux.org + =====================================================================*/ + +/* 8 clock cycles minimum = CB opcode = 4+4 */ + +opcode = Z80ReadMem( r_PC ); +r_PC++; + +switch(opcode) +{ + + case RLC_B : RLC(r_B); AddCycles( 4+4 ); break; + case RLC_C : RLC(r_C); AddCycles( 4+4 ); break; + case RLC_D : RLC(r_D); AddCycles( 4+4 ); break; + case RLC_E : RLC(r_E); AddCycles( 4+4 ); break; + case RLC_H : RLC(r_H); AddCycles( 4+4 ); break; + case RLC_L : RLC(r_L); AddCycles( 4+4 ); break; + case RLC_xHL : r_meml = Z80ReadMem( r_HL ); + RLC(r_meml); + Z80WriteMem( r_HL, r_meml, regs ); + AddCycles( 4+4+3+3+1 ); break; + case RLC_A : RLC(r_A); AddCycles( 4+4 ); break; + + case RRC_B : RRC(r_B); AddCycles( 4+4 ); break; + case RRC_C : RRC(r_C); AddCycles( 4+4 ); break; + case RRC_D : RRC(r_D); AddCycles( 4+4 ); break; + case RRC_E : RRC(r_E); AddCycles( 4+4 ); break; + case RRC_H : RRC(r_H); AddCycles( 4+4 ); break; + case RRC_L : RRC(r_L); AddCycles( 4+4 ); break; + case RRC_xHL : r_meml = Z80ReadMem( r_HL ); + RRC(r_meml); + Z80WriteMem( r_HL, r_meml, regs ); + AddCycles( 4+4+3+3+1 ); break; + case RRC_A : RRC(r_A); AddCycles( 4+4 ); break; + + case RL_B : RL(r_B); AddCycles( 4+4 ); break; + case RL_C : RL(r_C); AddCycles( 4+4 ); break; + case RL_D : RL(r_D); AddCycles( 4+4 ); break; + case RL_E : RL(r_E); AddCycles( 4+4 ); break; + case RL_H : RL(r_H); AddCycles( 4+4 ); break; + case RL_L : RL(r_L); AddCycles( 4+4 ); break; + case RL_xHL : r_meml = Z80ReadMem( r_HL ); + RL(r_meml); + Z80WriteMem( r_HL, r_meml, regs ); + AddCycles( 4+4+3+3+1 ); break; + case RL_A : RL(r_A); AddCycles( 4+4 ); break; + + case RR_B : RR(r_B); AddCycles( 4+4 ); break; + case RR_C : RR(r_C); AddCycles( 4+4 ); break; + case RR_D : RR(r_D); AddCycles( 4+4 ); break; + case RR_E : RR(r_E); AddCycles( 4+4 ); break; + case RR_H : RR(r_H); AddCycles( 4+4 ); break; + case RR_L : RR(r_L); AddCycles( 4+4 ); break; + case RR_xHL : r_meml = Z80ReadMem( r_HL ); + RR(r_meml); + Z80WriteMem( r_HL, r_meml, regs ); + AddCycles( 4+4+3+3+1 ); break; + case RR_A : RR(r_A); AddCycles( 4+4 ); break; + + case SLA_B : SLA(r_B); AddCycles( 4+4 ); break; + case SLA_C : SLA(r_C); AddCycles( 4+4 ); break; + case SLA_D : SLA(r_D); AddCycles( 4+4 ); break; + case SLA_E : SLA(r_E); AddCycles( 4+4 ); break; + case SLA_H : SLA(r_H); AddCycles( 4+4 ); break; + case SLA_L : SLA(r_L); AddCycles( 4+4 ); break; + case SLA_xHL : r_meml = Z80ReadMem( r_HL ); + SLA(r_meml); + Z80WriteMem( r_HL, r_meml, regs ); + AddCycles( 4+4+3+3+1 ); break; + case SLA_A : SLA(r_A); AddCycles( 4+4 ); break; + + case SRA_B : SRA(r_B); AddCycles( 4+4 ); break; + case SRA_C : SRA(r_C); AddCycles( 4+4 ); break; + case SRA_D : SRA(r_D); AddCycles( 4+4 ); break; + case SRA_E : SRA(r_E); AddCycles( 4+4 ); break; + case SRA_H : SRA(r_H); AddCycles( 4+4 ); break; + case SRA_L : SRA(r_L); AddCycles( 4+4 ); break; + case SRA_xHL : r_meml = Z80ReadMem( r_HL ); + SRA(r_meml); + Z80WriteMem( r_HL, r_meml, regs ); + AddCycles( 4+4+3+3+1 ); break; + case SRA_A : SRA(r_A); AddCycles( 4+4 ); break; + + case SLL_B : SLL(r_B); AddCycles( 4+4 ); break; + case SLL_C : SLL(r_C); AddCycles( 4+4 ); break; + case SLL_D : SLL(r_D); AddCycles( 4+4 ); break; + case SLL_E : SLL(r_E); AddCycles( 4+4 ); break; + case SLL_H : SLL(r_H); AddCycles( 4+4 ); break; + case SLL_L : SLL(r_L); AddCycles( 4+4 ); break; + case SLL_xHL : r_meml = Z80ReadMem( r_HL ); + SLL(r_meml); + Z80WriteMem( r_HL, r_meml, regs ); + AddCycles( 4+4+3+3+1 ); break; + case SLL_A : SLL(r_A); AddCycles( 4+4 ); break; + + case SRL_B : SRL(r_B); AddCycles( 4+4 ); break; + case SRL_C : SRL(r_C); AddCycles( 4+4 ); break; + case SRL_D : SRL(r_D); AddCycles( 4+4 ); break; + case SRL_E : SRL(r_E); AddCycles( 4+4 ); break; + case SRL_H : SRL(r_H); AddCycles( 4+4 ); break; + case SRL_L : SRL(r_L); AddCycles( 4+4 ); break; + case SRL_xHL : r_meml = Z80ReadMem( r_HL ); + SRL(r_meml); + Z80WriteMem( r_HL, r_meml, regs ); + AddCycles( 4+4+3+3+1 ); break; + case SRL_A : SRL(r_A); AddCycles( 4+4 ); break; + + case BIT_0_B : BIT_BIT(0, r_B); AddCycles( 4+4 ); break; + case BIT_0_C : BIT_BIT(0, r_C); AddCycles( 4+4 ); break; + case BIT_0_D : BIT_BIT(0, r_D); AddCycles( 4+4 ); break; + case BIT_0_E : BIT_BIT(0, r_E); AddCycles( 4+4 ); break; + case BIT_0_H : BIT_BIT(0, r_H); AddCycles( 4+4 ); break; + case BIT_0_L : BIT_BIT(0, r_L); AddCycles( 4+4 ); break; + case BIT_0_xHL : BIT_mem_BIT(0, r_HL); AddCycles( 12 ); break; + case BIT_0_A : BIT_BIT(0, r_A); AddCycles( 4+4 ); break; + + case BIT_1_B : BIT_BIT(1, r_B); AddCycles( 4+4 ); break; + case BIT_1_C : BIT_BIT(1, r_C); AddCycles( 4+4 ); break; + case BIT_1_D : BIT_BIT(1, r_D); AddCycles( 4+4 ); break; + case BIT_1_E : BIT_BIT(1, r_E); AddCycles( 4+4 ); break; + case BIT_1_H : BIT_BIT(1, r_H); AddCycles( 4+4 ); break; + case BIT_1_L : BIT_BIT(1, r_L); AddCycles( 4+4 ); break; + case BIT_1_xHL : BIT_mem_BIT(1, r_HL); AddCycles( 12 ); break; + case BIT_1_A : BIT_BIT(1, r_A); AddCycles( 4+4 ); break; + + case BIT_2_B : BIT_BIT(2, r_B); AddCycles( 4+4 ); break; + case BIT_2_C : BIT_BIT(2, r_C); AddCycles( 4+4 ); break; + case BIT_2_D : BIT_BIT(2, r_D); AddCycles( 4+4 ); break; + case BIT_2_E : BIT_BIT(2, r_E); AddCycles( 4+4 ); break; + case BIT_2_H : BIT_BIT(2, r_H); AddCycles( 4+4 ); break; + case BIT_2_L : BIT_BIT(2, r_L); AddCycles( 4+4 ); break; + case BIT_2_xHL : BIT_mem_BIT(2, r_HL); AddCycles( 12 ); break; + case BIT_2_A : BIT_BIT(2, r_A); AddCycles( 4+4 ); break; + + case BIT_3_B : BIT_BIT(3, r_B); AddCycles( 4+4 ); break; + case BIT_3_C : BIT_BIT(3, r_C); AddCycles( 4+4 ); break; + case BIT_3_D : BIT_BIT(3, r_D); AddCycles( 4+4 ); break; + case BIT_3_E : BIT_BIT(3, r_E); AddCycles( 4+4 ); break; + case BIT_3_H : BIT_BIT(3, r_H); AddCycles( 4+4 ); break; + case BIT_3_L : BIT_BIT(3, r_L); AddCycles( 4+4 ); break; + case BIT_3_xHL : BIT_mem_BIT(3, r_HL); AddCycles( 12 ); break; + case BIT_3_A : BIT_BIT(3, r_A); AddCycles( 4+4 ); break; + + case BIT_4_B : BIT_BIT(4, r_B); AddCycles( 4+4 ); break; + case BIT_4_C : BIT_BIT(4, r_C); AddCycles( 4+4 ); break; + case BIT_4_D : BIT_BIT(4, r_D); AddCycles( 4+4 ); break; + case BIT_4_E : BIT_BIT(4, r_E); AddCycles( 4+4 ); break; + case BIT_4_H : BIT_BIT(4, r_H); AddCycles( 4+4 ); break; + case BIT_4_L : BIT_BIT(4, r_L); AddCycles( 4+4 ); break; + case BIT_4_xHL : BIT_mem_BIT(4, r_HL); AddCycles( 12 ); break; + case BIT_4_A : BIT_BIT(4, r_A); AddCycles( 4+4 ); break; + + case BIT_5_B : BIT_BIT(5, r_B); AddCycles( 4+4 ); break; + case BIT_5_C : BIT_BIT(5, r_C); AddCycles( 4+4 ); break; + case BIT_5_D : BIT_BIT(5, r_D); AddCycles( 4+4 ); break; + case BIT_5_E : BIT_BIT(5, r_E); AddCycles( 4+4 ); break; + case BIT_5_H : BIT_BIT(5, r_H); AddCycles( 4+4 ); break; + case BIT_5_L : BIT_BIT(5, r_L); AddCycles( 4+4 ); break; + case BIT_5_xHL : BIT_mem_BIT(5, r_HL); AddCycles( 12 ); break; + case BIT_5_A : BIT_BIT(5, r_A); AddCycles( 4+4 ); break; + + case BIT_6_B : BIT_BIT(6, r_B); AddCycles( 4+4 ); break; + case BIT_6_C : BIT_BIT(6, r_C); AddCycles( 4+4 ); break; + case BIT_6_D : BIT_BIT(6, r_D); AddCycles( 4+4 ); break; + case BIT_6_E : BIT_BIT(6, r_E); AddCycles( 4+4 ); break; + case BIT_6_H : BIT_BIT(6, r_H); AddCycles( 4+4 ); break; + case BIT_6_L : BIT_BIT(6, r_L); AddCycles( 4+4 ); break; + case BIT_6_xHL : BIT_mem_BIT(6, r_HL); AddCycles( 12 ); break; + case BIT_6_A : BIT_BIT(6, r_A); AddCycles( 4+4 ); break; + + case BIT_7_B : BIT_BIT7(r_B); AddCycles( 4+4 ); break; + case BIT_7_C : BIT_BIT7(r_C); AddCycles( 4+4 ); break; + case BIT_7_D : BIT_BIT7(r_D); AddCycles( 4+4 ); break; + case BIT_7_E : BIT_BIT7(r_E); AddCycles( 4+4 ); break; + case BIT_7_H : BIT_BIT7(r_H); AddCycles( 4+4 ); break; + case BIT_7_L : BIT_BIT7(r_L); AddCycles( 4+4 ); break; + case BIT_7_xHL : BIT_mem_BIT7(r_HL); AddCycles( 12 ); break; + case BIT_7_A : BIT_BIT7(r_A); AddCycles( 4+4 ); break; + + case RES_0_B : BIT_RES(0, r_B); AddCycles( 4+4 ); break; + case RES_0_C : BIT_RES(0, r_C); AddCycles( 4+4 ); break; + case RES_0_D : BIT_RES(0, r_D); AddCycles( 4+4 ); break; + case RES_0_E : BIT_RES(0, r_E); AddCycles( 4+4 ); break; + case RES_0_H : BIT_RES(0, r_H); AddCycles( 4+4 ); break; + case RES_0_L : BIT_RES(0, r_L); AddCycles( 4+4 ); break; + case RES_0_xHL : BIT_mem_RES(0, r_HL); AddCycles( 4+4+7 ); break; + case RES_0_A : BIT_RES(0, r_A); AddCycles( 4+4 ); break; + + case RES_1_B : BIT_RES(1, r_B); AddCycles( 4+4 ); break; + case RES_1_C : BIT_RES(1, r_C); AddCycles( 4+4 ); break; + case RES_1_D : BIT_RES(1, r_D); AddCycles( 4+4 ); break; + case RES_1_E : BIT_RES(1, r_E); AddCycles( 4+4 ); break; + case RES_1_H : BIT_RES(1, r_H); AddCycles( 4+4 ); break; + case RES_1_L : BIT_RES(1, r_L); AddCycles( 4+4 ); break; + case RES_1_xHL : BIT_mem_RES(1, r_HL); AddCycles( 4+4+7 ); break; + case RES_1_A : BIT_RES(1, r_A); AddCycles( 4+4 ); break; + + case RES_2_B : BIT_RES(2, r_B); AddCycles( 4+4 ); break; + case RES_2_C : BIT_RES(2, r_C); AddCycles( 4+4 ); break; + case RES_2_D : BIT_RES(2, r_D); AddCycles( 4+4 ); break; + case RES_2_E : BIT_RES(2, r_E); AddCycles( 4+4 ); break; + case RES_2_H : BIT_RES(2, r_H); AddCycles( 4+4 ); break; + case RES_2_L : BIT_RES(2, r_L); AddCycles( 4+4 ); break; + case RES_2_xHL : BIT_mem_RES(2, r_HL); AddCycles( 4+4+7 ); break; + case RES_2_A : BIT_RES(2, r_A); AddCycles( 4+4 ); break; + + case RES_3_B : BIT_RES(3, r_B); AddCycles( 4+4 ); break; + case RES_3_C : BIT_RES(3, r_C); AddCycles( 4+4 ); break; + case RES_3_D : BIT_RES(3, r_D); AddCycles( 4+4 ); break; + case RES_3_E : BIT_RES(3, r_E); AddCycles( 4+4 ); break; + case RES_3_H : BIT_RES(3, r_H); AddCycles( 4+4 ); break; + case RES_3_L : BIT_RES(3, r_L); AddCycles( 4+4 ); break; + case RES_3_xHL : BIT_mem_RES(3, r_HL); AddCycles( 4+4+7 ); break; + case RES_3_A : BIT_RES(3, r_A); AddCycles( 4+4 ); break; + + case RES_4_B : BIT_RES(4, r_B); AddCycles( 4+4 ); break; + case RES_4_C : BIT_RES(4, r_C); AddCycles( 4+4 ); break; + case RES_4_D : BIT_RES(4, r_D); AddCycles( 4+4 ); break; + case RES_4_E : BIT_RES(4, r_E); AddCycles( 4+4 ); break; + case RES_4_H : BIT_RES(4, r_H); AddCycles( 4+4 ); break; + case RES_4_L : BIT_RES(4, r_L); AddCycles( 4+4 ); break; + case RES_4_xHL : BIT_mem_RES(4, r_HL); AddCycles( 4+4+7 ); break; + case RES_4_A : BIT_RES(4, r_A); AddCycles( 4+4 ); break; + + case RES_5_B : BIT_RES(5, r_B); AddCycles( 4+4 ); break; + case RES_5_C : BIT_RES(5, r_C); AddCycles( 4+4 ); break; + case RES_5_D : BIT_RES(5, r_D); AddCycles( 4+4 ); break; + case RES_5_E : BIT_RES(5, r_E); AddCycles( 4+4 ); break; + case RES_5_H : BIT_RES(5, r_H); AddCycles( 4+4 ); break; + case RES_5_L : BIT_RES(5, r_L); AddCycles( 4+4 ); break; + case RES_5_xHL : BIT_mem_RES(5, r_HL); AddCycles( 4+4+7 ); break; + case RES_5_A : BIT_RES(5, r_A); AddCycles( 4+4 ); break; + + case RES_6_B : BIT_RES(6, r_B); AddCycles( 4+4 ); break; + case RES_6_C : BIT_RES(6, r_C); AddCycles( 4+4 ); break; + case RES_6_D : BIT_RES(6, r_D); AddCycles( 4+4 ); break; + case RES_6_E : BIT_RES(6, r_E); AddCycles( 4+4 ); break; + case RES_6_H : BIT_RES(6, r_H); AddCycles( 4+4 ); break; + case RES_6_L : BIT_RES(6, r_L); AddCycles( 4+4 ); break; + case RES_6_xHL : BIT_mem_RES(6, r_HL); AddCycles( 4+4+7 ); break; + case RES_6_A : BIT_RES(6, r_A); AddCycles( 4+4 ); break; + + case RES_7_B : BIT_RES(7, r_B); AddCycles( 4+4 ); break; + case RES_7_C : BIT_RES(7, r_C); AddCycles( 4+4 ); break; + case RES_7_D : BIT_RES(7, r_D); AddCycles( 4+4 ); break; + case RES_7_E : BIT_RES(7, r_E); AddCycles( 4+4 ); break; + case RES_7_H : BIT_RES(7, r_H); AddCycles( 4+4 ); break; + case RES_7_L : BIT_RES(7, r_L); AddCycles( 4+4 ); break; + case RES_7_xHL : BIT_mem_RES(7, r_HL); AddCycles( 4+4+7 ); break; + case RES_7_A : BIT_RES(7, r_A); AddCycles( 4+4 ); break; + + case SET_0_B : BIT_SET(0, r_B); AddCycles( 4+4 ); break; + case SET_0_C : BIT_SET(0, r_C); AddCycles( 4+4 ); break; + case SET_0_D : BIT_SET(0, r_D); AddCycles( 4+4 ); break; + case SET_0_E : BIT_SET(0, r_E); AddCycles( 4+4 ); break; + case SET_0_H : BIT_SET(0, r_H); AddCycles( 4+4 ); break; + case SET_0_L : BIT_SET(0, r_L); AddCycles( 4+4 ); break; + case SET_0_xHL : BIT_mem_SET(0, r_HL); AddCycles( 4+4+7 ); break; + case SET_0_A : BIT_SET(0, r_A); AddCycles( 4+4 ); break; + + case SET_1_B : BIT_SET(1, r_B); AddCycles( 4+4 ); break; + case SET_1_C : BIT_SET(1, r_C); AddCycles( 4+4 ); break; + case SET_1_D : BIT_SET(1, r_D); AddCycles( 4+4 ); break; + case SET_1_E : BIT_SET(1, r_E); AddCycles( 4+4 ); break; + case SET_1_H : BIT_SET(1, r_H); AddCycles( 4+4 ); break; + case SET_1_L : BIT_SET(1, r_L); AddCycles( 4+4 ); break; + case SET_1_xHL : BIT_mem_SET(1, r_HL); AddCycles( 4+4+7 ); break; + case SET_1_A : BIT_SET(1, r_A); AddCycles( 4+4 ); break; + + case SET_2_B : BIT_SET(2, r_B); AddCycles( 4+4 ); break; + case SET_2_C : BIT_SET(2, r_C); AddCycles( 4+4 ); break; + case SET_2_D : BIT_SET(2, r_D); AddCycles( 4+4 ); break; + case SET_2_E : BIT_SET(2, r_E); AddCycles( 4+4 ); break; + case SET_2_H : BIT_SET(2, r_H); AddCycles( 4+4 ); break; + case SET_2_L : BIT_SET(2, r_L); AddCycles( 4+4 ); break; + case SET_2_xHL : BIT_mem_SET(2, r_HL); AddCycles( 4+4+7 ); break; + case SET_2_A : BIT_SET(2, r_A); AddCycles( 4+4 ); break; + + case SET_3_B : BIT_SET(3, r_B); AddCycles( 4+4 ); break; + case SET_3_C : BIT_SET(3, r_C); AddCycles( 4+4 ); break; + case SET_3_D : BIT_SET(3, r_D); AddCycles( 4+4 ); break; + case SET_3_E : BIT_SET(3, r_E); AddCycles( 4+4 ); break; + case SET_3_H : BIT_SET(3, r_H); AddCycles( 4+4 ); break; + case SET_3_L : BIT_SET(3, r_L); AddCycles( 4+4 ); break; + case SET_3_xHL : BIT_mem_SET(3, r_HL); AddCycles( 4+4+7 ); break; + case SET_3_A : BIT_SET(3, r_A); AddCycles( 4+4 ); break; + + case SET_4_B : BIT_SET(4, r_B); AddCycles( 4+4 ); break; + case SET_4_C : BIT_SET(4, r_C); AddCycles( 4+4 ); break; + case SET_4_D : BIT_SET(4, r_D); AddCycles( 4+4 ); break; + case SET_4_E : BIT_SET(4, r_E); AddCycles( 4+4 ); break; + case SET_4_H : BIT_SET(4, r_H); AddCycles( 4+4 ); break; + case SET_4_L : BIT_SET(4, r_L); AddCycles( 4+4 ); break; + case SET_4_xHL : BIT_mem_SET(4, r_HL); AddCycles( 4+4+7 ); break; + case SET_4_A : BIT_SET(4, r_A); AddCycles( 4+4 ); break; + + case SET_5_B : BIT_SET(5, r_B); AddCycles( 4+4 ); break; + case SET_5_C : BIT_SET(5, r_C); AddCycles( 4+4 ); break; + case SET_5_D : BIT_SET(5, r_D); AddCycles( 4+4 ); break; + case SET_5_E : BIT_SET(5, r_E); AddCycles( 4+4 ); break; + case SET_5_H : BIT_SET(5, r_H); AddCycles( 4+4 ); break; + case SET_5_L : BIT_SET(5, r_L); AddCycles( 4+4 ); break; + case SET_5_xHL : BIT_mem_SET(5, r_HL); AddCycles( 4+4+7 ); break; + case SET_5_A : BIT_SET(5, r_A); AddCycles( 4+4 ); break; + + case SET_6_B : BIT_SET(6, r_B); AddCycles( 4+4 ); break; + case SET_6_C : BIT_SET(6, r_C); AddCycles( 4+4 ); break; + case SET_6_D : BIT_SET(6, r_D); AddCycles( 4+4 ); break; + case SET_6_E : BIT_SET(6, r_E); AddCycles( 4+4 ); break; + case SET_6_H : BIT_SET(6, r_H); AddCycles( 4+4 ); break; + case SET_6_L : BIT_SET(6, r_L); AddCycles( 4+4 ); break; + case SET_6_xHL : BIT_mem_SET(6, r_HL); AddCycles( 4+4+7 ); break; + case SET_6_A : BIT_SET(6, r_A); AddCycles( 4+4 ); break; + + case SET_7_B : BIT_SET(7, r_B); AddCycles( 4+4 ); break; + case SET_7_C : BIT_SET(7, r_C); AddCycles( 4+4 ); break; + case SET_7_D : BIT_SET(7, r_D); AddCycles( 4+4 ); break; + case SET_7_E : BIT_SET(7, r_E); AddCycles( 4+4 ); break; + case SET_7_H : BIT_SET(7, r_H); AddCycles( 4+4 ); break; + case SET_7_L : BIT_SET(7, r_L); AddCycles( 4+4 ); break; + case SET_7_xHL : BIT_mem_SET(7, r_HL); AddCycles( 4+4+7 ); break; + case SET_7_A : BIT_SET(7, r_A); AddCycles( 4+4 ); break; + + default: +// exit(1); +///!!! if( regs->DecodingErrors ) +///!!! printf("z80 core: Unknown instruction: CB %02Xh at PC=%04Xh.\n", +///!!! Z80ReadMem(r_PC-1), r_PC-2 ); + break; +} + diff --git a/programs/emulator/e80/trunk/z80/op_dd_fd.c b/programs/emulator/e80/trunk/z80/op_dd_fd.c new file mode 100644 index 0000000000..cf740d3810 --- /dev/null +++ b/programs/emulator/e80/trunk/z80/op_dd_fd.c @@ -0,0 +1,239 @@ +/*====================================================================/* + opcodes_dd_fd.c -> This file executes the DD/FD PREFIX opcodes. + + The DD prefix "creates" some new instructions by changing HL to IX + on the opcode defined by the next byte on memory. + + The FD prefix "creates" some new instructions by changing HL to IY + on the opcode defined by the next byte on memory. + + Change the REGISTER variable to IX or HY before including this file. + Something like: + + #define REGISTER regs->IX + #include "op_dd_fd.c" + #undef REGISTER + + On this code, this REGISTER variable is used as REGISTER.W or + REGISTER.B.h and REGISTER.B.l ... + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Copyright (c) 2000 Santiago Romero Iglesias. + Email: sromero@escomposlinux.org + =====================================================================*/ + +/* 8 clock cycles minimum = DD opcode = FD opcode = 4 + 4 */ + +#define REG REGISTER.W +#define REGL REGISTER.B.l +#define REGH REGISTER.B.h + +opcode = Z80ReadMem( r_PC ); +r_PC++; + +switch(opcode) +{ +case ADD_IXY_BC : ADD_WORD(REG, r_BC); AddCycles( 4+4+7 ); break; +case ADD_IXY_DE : ADD_WORD(REG, r_DE); AddCycles( 4+4+7 ); break; +case ADD_IXY_SP : ADD_WORD(REG, r_SP); AddCycles( 4+4+7 ); break; +case ADD_IXY_IXY : ADD_WORD(REG, REG); AddCycles( 4+4+7 ); break; +case DEC_IXY : REG--; AddCycles( 4+4+2 ); break; +case INC_IXY : REG++; AddCycles( 4+4 ); break; + +case JP_IXY : r_PC = REG; AddCycles( 4+4 );break; +case LD_SP_IXY : r_SP = REG; AddCycles( 4+4+2 ); break; + +case PUSH_IXY : PUSH_IXYr(); AddCycles( 4+4+3+3+1 ); break; +case POP_IXY : POP_IXYr(); AddCycles( 4+4+3+3 ); break; + +case EX_IXY_xSP : r_meml = Z80ReadMem(r_SP); + r_memh = Z80ReadMem(r_SP+1); + Z80WriteMem( r_SP, REGL, regs ); + Z80WriteMem( r_SP+1, REGH, regs ); + REGL=r_meml; REGH=r_memh; + AddCycles( 4+4+3+3+3+3+3 ); break; + +case LD_A_xIXY : r_A = Z80ReadMem( REG+ ((offset) Z80ReadMem(r_PC)) ); + r_PC++; AddCycles( 4+3+3+3+3+3 ); break; +case LD_B_xIXY : r_B = Z80ReadMem( REG+ ((offset) Z80ReadMem(r_PC)) ); + r_PC++; AddCycles( 4+3+3+3+3+3 ); break; +case LD_C_xIXY : r_C = Z80ReadMem( REG+ ((offset) Z80ReadMem(r_PC)) ); + r_PC++; AddCycles( 4+3+3+3+3+3 ); break; +case LD_D_xIXY : r_D = Z80ReadMem( REG+ ((offset) Z80ReadMem(r_PC)) ); + r_PC++; AddCycles( 4+3+3+3+3+3 ); break; +case LD_E_xIXY : r_E = Z80ReadMem( REG+ ((offset) Z80ReadMem(r_PC)) ); + r_PC++; AddCycles( 4+3+3+3+3+3 ); break; + +case LD_xIXY_A : Z80WriteMem( REG+(offset)Z80ReadMem(r_PC), r_A, regs ); + r_PC++; AddCycles( 4+3+3+3+3+3 ); break; +case LD_xIXY_B : Z80WriteMem( REG+(offset)Z80ReadMem(r_PC), r_B, regs ); + r_PC++; AddCycles( 4+3+3+3+3+3 ); break; +case LD_xIXY_C : Z80WriteMem( REG+(offset)Z80ReadMem(r_PC), r_C, regs ); + r_PC++; AddCycles( 4+3+3+3+3+3 ); break; +case LD_xIXY_D : Z80WriteMem( REG+(offset)Z80ReadMem(r_PC), r_D, regs ); + r_PC++; AddCycles( 4+3+3+3+3+3 ); break; +case LD_xIXY_E : Z80WriteMem( REG+(offset)Z80ReadMem(r_PC), r_E, regs ); + r_PC++; AddCycles( 4+3+3+3+3+3 ); break; + +case INC_xIXY : r_mem = REG+(offset)Z80ReadMem(r_PC); + r_PC++; + tmpreg.B.l = Z80ReadMem(r_mem); + INC(tmpreg.B.l); + Z80WriteMem(r_mem, tmpreg.B.l, regs ); + AddCycles( 4+3+3 + 3+3+3+ 3+1); break; +case DEC_xIXY : r_mem = REG+(offset)Z80ReadMem(r_PC); + r_PC++; + tmpreg.B.l = Z80ReadMem(r_mem); + DEC(tmpreg.B.l); + Z80WriteMem(r_mem, tmpreg.B.l, regs ); + AddCycles( 4+3+3 + 3+3+3+ 3+1); break; + +case ADC_xIXY : r_meml = Z80ReadMem(REG+(offset)Z80ReadMem(r_PC)); r_PC++; + ADC(r_meml); AddCycles( 4+3+3+3+3+3 ); break; +case SBC_xIXY : r_meml = Z80ReadMem(REG+(offset)Z80ReadMem(r_PC)); + r_PC++; + SBC(r_meml); AddCycles( 4+3+3+3+3+3 ); break; +case ADD_xIXY : r_meml = Z80ReadMem(REG+(offset)Z80ReadMem(r_PC)); + r_PC++; + ADD(r_meml); AddCycles( 4+3+3+3+3+3 ); break; +case SUB_xIXY : r_meml = Z80ReadMem(REG+(offset)Z80ReadMem(r_PC)); + r_PC++; + SUB(r_meml); AddCycles( 4+3+3+3+3+3 ); break; +case AND_xIXY : r_meml = Z80ReadMem(REG+(offset)Z80ReadMem(r_PC)); + r_PC++; + AND(r_meml); AddCycles( 4+3+3+3+3+3 ); break; +case OR_xIXY : r_meml = Z80ReadMem(REG+(offset)Z80ReadMem(r_PC)); + r_PC++; + OR(r_meml); AddCycles( 4+3+3+3+3+3 ); break; +case XOR_xIXY : r_meml = Z80ReadMem(REG+(offset)Z80ReadMem(r_PC)); + r_PC++; + XOR(r_meml); AddCycles( 4+3+3+3+3+3 ); break; + +case CP_xIXY : r_meml = Z80ReadMem(REG+(offset)Z80ReadMem(r_PC)); + r_PC++; + CP(r_meml); AddCycles( 4+3+3+3+3+3 ); break; + +case LD_IXY_NN : REGL = Z80ReadMem(r_PC); r_PC++; + REGH = Z80ReadMem(r_PC); r_PC++; + AddCycles( 4+1+3+3+3 ); break; + +case LD_xIXY_N : r_mem = REG + (offset) Z80ReadMem(r_PC); r_PC++; + Z80WriteMem( r_mem, Z80ReadMem(r_PC), regs ); r_PC++; + AddCycles( 4+3+3+3+3+3 ); break; + +case LD_IXY_xNN : LOAD_rr_nn(REG); + AddCycles( 4+3+3+3+3+3+1 ); break; + +case LD_xNN_IXY : STORE_nn_rr(REG); + AddCycles( 4+3+3+ 3+3+3+1 ); break; + + +/* some undocumented opcodes: may be wrong: */ +case LD_A_IXYh : r_A = REGH; AddCycles(4+4); break; +case LD_A_IXYl : r_A = REGL; AddCycles(4+4); break; +case LD_B_IXYh : r_B = REGH; AddCycles(4+4); break; +case LD_B_IXYl : r_B = REGL; AddCycles(4+4); break; +case LD_C_IXYh : r_C = REGH; AddCycles(4+4); break; +case LD_C_IXYl : r_C = REGL; AddCycles(4+4); break; +case LD_D_IXYh : r_D = REGH; AddCycles(4+4); break; +case LD_D_IXYl : r_D = REGL; AddCycles(4+4); break; +case LD_E_IXYh : r_E = REGH; AddCycles(4+4); break; +case LD_E_IXYl : r_E = REGL; AddCycles(4+4); break; +case LD_IXYh_A : REGH = r_A; AddCycles(4+4); break; +case LD_IXYh_B : REGH = r_B; AddCycles(4+4); break; +case LD_IXYh_C : REGH = r_C; AddCycles(4+4); break; +case LD_IXYh_D : REGH = r_D; AddCycles(4+4); break; +case LD_IXYh_E : REGH = r_E; AddCycles(4+4); break; +case LD_IXYh_IXYh : AddCycles(4+4); break; +case LD_IXYh_IXYl : REGH = REGL; AddCycles(4+4); break; +case LD_IXYl_A : REGL = r_A; AddCycles(4+4); break; +case LD_IXYl_B : REGL = r_B; AddCycles(4+4); break; +case LD_IXYl_C : REGL = r_C; AddCycles(4+4); break; +case LD_IXYl_D : REGL = r_D; AddCycles(4+4); break; +case LD_IXYl_E : REGL = r_E; AddCycles(4+4); break; +case LD_IXYl_IXYh : REGL = REGH; AddCycles(4+4); break; +case LD_IXYl_IXYl : AddCycles(4+4); break; +case LD_IXYh_N : REGH = Z80ReadMem(r_PC); r_PC++; + AddCycles(4+4+3); break; +case LD_IXYl_N : REGL = Z80ReadMem(r_PC); r_PC++; + AddCycles(4+4+3); break; + + +case ADD_IXYh : ADD(REGH); AddCycles(4+4); break; +case ADD_IXYl : ADD(REGL); AddCycles(4+4); break; +case ADC_IXYh : ADC(REGH); AddCycles(4+4); break; +case ADC_IXYl : ADC(REGL); AddCycles(4+4); break; +case SUB_IXYh : SUB(REGH); AddCycles(4+4); break; +case SUB_IXYl : SUB(REGL); AddCycles(4+4); break; +case SBC_IXYh : SBC(REGH); AddCycles(4+4); break; +case SBC_IXYl : SBC(REGL); AddCycles(4+4); break; +case AND_IXYh : AND(REGH); AddCycles(4+4); break; +case AND_IXYl : AND(REGL); AddCycles(4+4); break; +case XOR_IXYh : XOR(REGH); AddCycles(4+4); break; +case XOR_IXYl : XOR(REGL); AddCycles(4+4); break; +case OR_IXYh : OR(REGH); AddCycles(4+4); break; +case OR_IXYl : OR(REGL); AddCycles(4+4); break; +case CP_IXYh : CP(REGH); AddCycles(4+4); break; +case CP_IXYl : CP(REGL); AddCycles(4+4); break; +case INC_IXYh : INC(REGH); AddCycles(4+4); break; +case INC_IXYl : INC(REGL); AddCycles(4+4); break; +case DEC_IXYh : DEC(REGH); AddCycles(4+4); break; +case DEC_IXYl : DEC(REGL); AddCycles(4+4); break; + +case LD_xIXY_H : r_meml =Z80ReadMem(r_PC); r_PC++; + Z80WriteMem( REG+(offset)(r_meml), r_H, regs ); + AddCycles( 4+3+3+3+3+3 ); break; +case LD_xIXY_L : r_meml =Z80ReadMem(r_PC); r_PC++; + Z80WriteMem( REG+(offset)(r_meml), r_L, regs ); + AddCycles( 4+3+3+3+3+3 ); break; +case LD_H_xIXY : r_meml =Z80ReadMem(r_PC); r_PC++; + r_H = Z80ReadMem( REG+(offset)(r_meml)); + AddCycles( 4+3+3+3+3+3 ); break; +case LD_L_xIXY : r_meml =Z80ReadMem(r_PC); r_PC++; + r_L = Z80ReadMem( REG+(offset)(r_meml)); + AddCycles( 4+3+3+3+3+3 ); break; + +case PREFIX_CB: + #include "opddfdcb.c" + break; + +/* +case PREFIX_DD: +case PREFIX_FD: AddCycles( 4 ); + r_PC--; // decode it the next time :) + break; +*/ + +default: AddCycles( 4 ); + r_PC--; /* decode it the next time :) */ + SubR(1); + +// exit(1); +// if( regs->DecodingErrors ) +// { +// printf("z80 core: Unknown instruction: "); +// if ( regs->we_are_on_ddfd == WE_ARE_ON_DD ) +// printf("DD "); +// else +// printf("FD "); +// printf("%02Xh at PC=%04Xh.\n", Z80ReadMem(r_PC-1), r_PC-2 ); +// } + break; +} + +#undef REG +#undef REGL +#undef REGH diff --git a/programs/emulator/e80/trunk/z80/op_ed.c b/programs/emulator/e80/trunk/z80/op_ed.c new file mode 100644 index 0000000000..5c6ae60f99 --- /dev/null +++ b/programs/emulator/e80/trunk/z80/op_ed.c @@ -0,0 +1,417 @@ +/*====================================================================/* + opcodes_ed.c -> This file executes the ED opcodes. + + Another prefix that "creates" new instructions. This prefix also + introduces some undocumented opcodes that we've tried to include + here. Maybe their implementation it's wrong: if you can find any + mistake about how we have implemented/interpreted them, please + let us know. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Copyright (c) 2000 Santiago Romero Iglesias. + Email: sromero@escomposlinux.org + =====================================================================*/ + +/* 8 clock cycles minimum = ED opcode = 4 + 4 */ + +opcode = Z80ReadMem( r_PC ); +r_PC++; + +switch(opcode) +{ + case LD_BC_xNNe : LOAD_rr_nn(r_BC); AddCycles( 4+4+12 ); break; + case LD_DE_xNNe : LOAD_rr_nn(r_DE); AddCycles( 4+4+12 ); break; + case LD_HL_xNNe : LOAD_rr_nn(r_HL); AddCycles( 4+4+12 ); break; + case LD_SP_xNNe : LOAD_rr_nn(r_SP); AddCycles( 4+4+12 ); break; + + case LD_xNNe_BC : STORE_nn_rr(r_BC); AddCycles( 4+4+12 ); break; + case LD_xNNe_DE : STORE_nn_rr(r_DE); AddCycles( 4+4+12 ); break; + case LD_xNNe_HL : STORE_nn_rr(r_HL); AddCycles( 4+4+12 ); break; + case LD_xNNe_SP : STORE_nn_rr(r_SP); AddCycles( 4+4+12 ); break; + + case NEG : + case ED_5C : + case ED_74 : + case ED_7C : + case ED_6C : + case ED_54 : + case ED_4C : + case ED_64 : NEG_A(); AddCycles( 4+4 ); break; + + case RETI : + case RETN : + case ED_65 : + case ED_6D : + case ED_75 : + case ED_7D : + case ED_5D : + case ED_55 : + r_IFF1 = r_IFF2; + RET_nn(); + AddCycles( 4+4+6 ); break; + + case IM_0 : + case ED_4E : /* * IM 0/1 */ + case ED_6E : + case ED_66 : regs->IM = 0; + AddCycles( 4+4 ); break; /* * IM 0 */ + + + case IM_1 : + case ED_76 : regs->IM = 1; + AddCycles( 4+4 ); break; + + case IM_2 : + case ED_7E : regs->IM = 2; + AddCycles( 4+4 ); break; + + case ED_77 : + case ED_7F : AddCycles( 4+4 ); break; /* * NOP */ + + case OUT_xC_B : Z80OutPort(regs,r_BC, r_B); AddCycles( 4+4+4 ); break; + case OUT_xC_C : Z80OutPort(regs,r_BC, r_C); AddCycles( 4+4+4 ); break; + case OUT_xC_D : Z80OutPort(regs,r_BC, r_D); AddCycles( 4+4+4 ); break; + case OUT_xC_E : Z80OutPort(regs,r_BC, r_E); AddCycles( 4+4+4 ); break; + case OUT_xC_H : Z80OutPort(regs,r_BC, r_H); AddCycles( 4+4+4 ); break; + case OUT_xC_L : Z80OutPort(regs,r_BC, r_L); AddCycles( 4+4+4 ); break; + case OUT_xC_A : Z80OutPort(regs,r_BC, r_A); AddCycles( 4+4+4 ); break; + /* * OUT (C), 0 */ + case ED_71 : Z80OutPort(regs,r_BC, 0); AddCycles( 4+4+4 ); break; + + case IN_B_xC : IN(r_B, r_BC); AddCycles( 4+4+4 ); break; + case IN_C_xC : IN(r_C, r_BC); AddCycles( 4+4+4 ); break; + case IN_D_xC : IN(r_D, r_BC); AddCycles( 4+4+4 ); break; + case IN_E_xC : IN(r_E, r_BC); AddCycles( 4+4+4 ); break; + case IN_L_xC : IN(r_L, r_BC); AddCycles( 4+4+4 ); break; + case IN_H_xC : IN(r_H, r_BC); AddCycles( 4+4+4 ); break; + case IN_A_xC : IN(r_A, r_BC); AddCycles( 4+4+4 ); break; + case IN_F_xC : IN(r_meml, r_BC); AddCycles( 4+4+4 ); break; + + case LD_A_I : r_A = regs->I; + r_F = ( r_F & FLAG_C )|sz53_table[r_A]| + ( regs->IFF2 ? FLAG_V:0 ); + AddCycles( 4+4+1 ); break; + + case LD_I_A : regs->I = r_A; AddCycles( 4+4+1 ); break; + + + case LD_A_R : r_A = ( regs->R.W & 0x7f ) | (regs->R.W & 0x80); + r_F = (r_F&FLAG_C)|sz53_table[r_A] | (regs->IFF2?FLAG_V:0); + AddCycles( 4+4+1 ); break; + + case LD_R_A : regs->R.W = r_A; + AddCycles( 4+4+1 ); break; + + + case ADC_HL_BC : ADC_WORD(r_BC); AddCycles( 4+4+4+1+2 ); break; + case ADC_HL_DE : ADC_WORD(r_DE); AddCycles( 4+4+4+1+2 ); break; + case ADC_HL_HL : ADC_WORD(r_HL); AddCycles( 4+4+4+1+2 ); break; + case ADC_HL_SP : ADC_WORD(r_SP); AddCycles( 4+4+4+1+2 ); break; + + case SBC_HL_BC : SBC_WORD(r_BC); AddCycles( 4+4+4+1+2 ); break; + case SBC_HL_DE : SBC_WORD(r_DE); AddCycles( 4+4+4+1+2 ); break; + case SBC_HL_HL : SBC_WORD(r_HL); AddCycles( 4+4+4+1+2 ); break; + case SBC_HL_SP : SBC_WORD(r_SP); AddCycles( 4+4+4+1+2 ); break; + + case RRD : r_meml = Z80ReadMem(r_HL); + Z80WriteMem(r_HL, ( r_A << 4 ) | ( r_meml >> 4 ), regs ); + r_A = ( r_A & 0xf0 ) | ( r_meml & 0x0f ); + r_F = ( r_F & FLAG_C ) | sz53p_table[r_A]; + AddCycles( 4+4+10 ); break; + + case RLD : r_meml = Z80ReadMem(r_HL); + Z80WriteMem(r_HL, (r_meml << 4 ) | ( r_A & 0x0f ), regs ); + r_A = ( r_A & 0xf0 ) | ( r_meml >> 4 ); + r_F = ( r_F & FLAG_C ) | sz53p_table[r_A]; + AddCycles( 4+4+10 ); break; + + case LDI : r_meml = Z80ReadMem(r_HL); r_HL++; + Z80WriteMem( r_DE, r_meml, regs ); r_DE++; + r_BC--; r_meml += r_A; + r_F = ( r_F & ( FLAG_C|FLAG_Z|FLAG_S ) ) | + ( r_BC ? FLAG_V:0 ) | ( r_meml & FLAG_3 ) | + ((r_meml & 0x02) ? FLAG_5 : 0 ); + AddCycles( 4+4+4+4 ); break; + + case LDIR : r_meml = Z80ReadMem(r_HL); r_HL++; + Z80WriteMem( r_DE, r_meml, regs ); r_DE++; + r_BC--; r_meml += r_A; + r_F = ( r_F & ( FLAG_C|FLAG_Z|FLAG_S ) ) | + ( r_BC ? FLAG_V:0 ) | ( r_meml & FLAG_3 ) | + ((r_meml & 0x02) ? FLAG_5 : 0 ); + AddCycles( 4+4+4+4 ); + if( r_BC ) { r_PC-=2; AddCycles(5); } + break; + + case LDD : r_meml = Z80ReadMem(r_HL); r_HL--; + Z80WriteMem( r_DE, r_meml, regs ); r_DE--; + r_BC--; r_meml += r_A; + r_F = ( r_F & ( FLAG_C | FLAG_Z | FLAG_S ) ) | + (r_BC ? FLAG_V : 0 ) | ( r_meml & FLAG_3 ) | + ((r_meml & 0x02) ? FLAG_5 : 0 ); + AddCycles( 4+4+4+4 ); break; + + + case LDDR : r_meml = Z80ReadMem(r_HL); + Z80WriteMem( r_DE, r_meml, regs ); + r_HL--; r_DE--; r_BC--; r_meml += r_A; + r_F = ( r_F & ( FLAG_C | FLAG_Z | FLAG_S ) ) | + (r_BC ? FLAG_V : 0 ) | ( r_meml & FLAG_3 ) | + ((r_meml & 0x02) ? FLAG_5 : 0 ); + AddCycles( 4+4+4+4+1 ); + if( r_BC ) { r_PC-=2; AddCycles(4); } + break; + + // I had lots of problems with CPI, INI, CPD, IND, OUTI, OUTD and so... + // Thanks a lot to Philip Kendall for letting me to take a look to his + // fuse emulator and allowing me to use their flag routines :-) + case CPI : r_meml = Z80ReadMem(r_HL); + r_memh = r_A - r_meml; + r_opl = ( (r_A & 0x08) >> 3 ) | + ( ( (r_meml) & 0x08 ) >> 2 ) | + ( (r_meml & 0x08) >> 1 ); + r_HL++; r_BC--; + r_F = ( r_F & FLAG_C ) | + ( r_BC ? ( FLAG_V | FLAG_N ) : FLAG_N ) | + halfcarry_sub_table[r_opl] | + ( r_memh ? 0 : FLAG_Z ) | + ( r_memh & FLAG_S ); + if( r_F & FLAG_H) r_memh--; + r_F |= ( r_memh & FLAG_3 ) | + ( (r_memh&0x02) ? FLAG_5 : 0 ); + AddCycles( 4+4+4+4); break; + + case CPIR : r_meml = Z80ReadMem(r_HL); + r_memh = r_A - r_meml; + r_opl = ( (r_A & 0x08) >> 3 ) | + ( ( (r_meml) & 0x08 ) >> 2 ) | + ( (r_meml & 0x08) >> 1 ); + r_HL++; r_BC--; + r_F = ( r_F & FLAG_C ) | + ( r_BC ? ( FLAG_V | FLAG_N ) : FLAG_N ) | + halfcarry_sub_table[r_opl] | + ( r_memh ? 0 : FLAG_Z ) | + ( r_memh & FLAG_S ); + if( r_F & FLAG_H) r_memh--; + r_F |= ( r_memh & FLAG_3 ) | + ( (r_memh&0x02) ? FLAG_5 : 0 ); + if( ( r_F & ( FLAG_V | FLAG_Z ) ) == FLAG_V ) + { AddCycles(5); r_PC-=2; } + AddCycles( 4+4+4+4); break; + + case CPD : r_meml = Z80ReadMem(r_HL); + r_memh = r_A-r_meml; + r_opl = ( (r_A & 0x08) >> 3 ) | + ( ( (r_meml) & 0x08 ) >> 2 ) | + ( (r_memh & 0x08) >> 1 ); + r_HL--; r_BC--; + r_F = ( r_F & FLAG_C ) | + ( r_BC ? ( FLAG_V | FLAG_N ) : FLAG_N ) | + halfcarry_sub_table[r_opl] | + ( r_memh ? 0 : FLAG_Z ) | + ( r_memh & FLAG_S ); + if(r_F & FLAG_H) r_memh--; + r_F |= ( r_memh & FLAG_3 ) | + ( (r_memh&0x02) ? FLAG_5 : 0 ); + AddCycles( 4+4+4+4); break; + + case CPDR : r_meml = Z80ReadMem(r_HL); + r_memh = r_A-r_meml; + r_opl = ( (r_A & 0x08) >> 3 ) | + ( ( (r_meml) & 0x08 ) >> 2 ) | + ( (r_memh & 0x08) >> 1 ); + r_HL--; r_BC--; + r_F = ( r_F & FLAG_C ) | + ( r_BC ? ( FLAG_V | FLAG_N ) : FLAG_N ) | + halfcarry_sub_table[r_opl] | + ( r_memh ? 0 : FLAG_Z ) | + ( r_memh & FLAG_S ); + if(r_F & FLAG_H) r_memh--; + r_F |= ( r_memh & FLAG_3 ) | + ( (r_memh&0x02) ? FLAG_5 : 0 ); + if( ( r_F & ( FLAG_V | FLAG_Z ) ) == FLAG_V ) + { AddCycles(5); r_PC-=2; } + AddCycles( 4+4+4+4 ); break; + +/* + // OUTI contributed by Alvaro Alea + case OUTI : Z80OutPort( regs, r_BC, Z80ReadMem( r_HL )) ; + r_HL++ ; r_B-- ; + if (r_B==0) + r_F |= FLAG_Z; + else + r_F &= !FLAG_Z; + r_F |= FLAG_N; + AddCycles( 4+4+4+4 ); break; +*/ + + // I/O block instructions by Metalbrain - 14-5-2001 + case IND : r_meml = Z80InPort((r_BC)); r_memh=0; + r_F = ( r_F & FLAG_C ) | ( (r_B)&0x0f ? 0 : FLAG_H ) | FLAG_N; \ + (r_B)--; + r_F |= ( (r_B)==0x7f ? FLAG_V : 0 ) | sz53_table[(r_B)]; + r_F &= 0xE8; + Z80WriteMem( r_HL, r_meml, regs ); + r_F |= ( (r_meml & 0x80 ) >> 6); + r_opl = r_C; r_oph = 0; + r_opl--; + r_op += r_mem; + r_oph += (r_oph << 4); + r_F |= r_oph; + r_opl = (r_meml & 7) + ( (r_C & 7) << 3 ); + r_F |= ( ioblock_2_table[(r_B)] ^ ioblock_dec1_table[(r_opl)] ); + r_HL--; + AddCycles( 4+4+4+4); break; + + case INDR : r_meml = Z80InPort((r_BC)); r_memh=0; + r_F = ( r_F & FLAG_C ) | ( (r_B)&0x0f ? 0 : FLAG_H ) | FLAG_N; \ + (r_B)--; + r_F |= ( (r_B)==0x7f ? FLAG_V : 0 ) | sz53_table[(r_B)]; + r_F &= 0xE8; + Z80WriteMem( r_HL, r_meml, regs ); + r_F |= ( (r_meml & 0x80 ) >> 6); + r_opl = r_C; r_oph = 0; + r_opl--; + r_op += r_mem; + r_oph += (r_oph << 4); + r_F |= r_oph; + r_opl = (r_meml & 7) + ( (r_C & 7) << 3 ); + r_F |= ( ioblock_2_table[(r_B)] ^ ioblock_dec1_table[(r_opl)] ); + r_HL--; + if( r_B ) { r_PC-=2; AddCycles(5); } + AddCycles( 4+4+4+4); break; + + case INI : r_meml = Z80InPort((r_BC)); r_memh=0; + r_F = ( r_F & FLAG_C ) | ( (r_B)&0x0f ? 0 : FLAG_H ) | FLAG_N; \ + (r_B)--; + r_F |= ( (r_B)==0x7f ? FLAG_V : 0 ) | sz53_table[(r_B)]; + r_F &= 0xE8; + Z80WriteMem( r_HL, r_meml, regs ); + r_F |= ( (r_meml & 0x80 ) >> 6); + r_opl = r_C; r_oph = 0; + r_opl++; + r_op += r_mem; + r_oph += (r_oph << 4); + r_F |= r_oph; + r_opl = (r_meml & 7) + ( (r_C & 7) << 3 ); + r_F |= ( ioblock_2_table[(r_B)] ^ ioblock_inc1_table[(r_opl)] ); + r_HL++; + AddCycles( 4+4+4+4); break; + + + case INIR : r_meml = Z80InPort((r_BC)); r_memh=0; + r_F = ( r_F & FLAG_C ) | ( (r_B)&0x0f ? 0 : FLAG_H ) | FLAG_N; \ + (r_B)--; + r_F |= ( (r_B)==0x7f ? FLAG_V : 0 ) | sz53_table[(r_B)]; + r_F &= 0xE8; + Z80WriteMem( r_HL, r_meml, regs ); + r_F |= ( (r_meml & 0x80 ) >> 6); + r_opl = r_C; r_oph = 0; + r_opl++; + r_op += r_mem; + r_oph += (r_oph << 4); + r_F |= r_oph; + r_opl = (r_meml & 7) + ( (r_C & 7) << 3 ); + r_F |= ( ioblock_2_table[(r_B)] ^ ioblock_inc1_table[(r_opl)] ); + r_HL++; + if( r_B ) { r_PC-=2; AddCycles(5); } + AddCycles( 4+4+4+4); break; + + case OUTI : r_meml = Z80ReadMem(r_HL); r_memh = 0; + r_F = ( r_F & FLAG_C ) | ( (r_B)&0x0f ? 0 : FLAG_H ) | FLAG_N; \ + (r_B)--; + r_F |= ( (r_B)==0x7f ? FLAG_V : 0 ) | sz53_table[(r_B)]; + r_F &= 0xE8; + Z80OutPort( regs, r_BC, r_meml); + r_F |= ((r_meml & 0x80 ) >> 6); + r_opl = r_C; r_oph=0; + r_opl++; + r_op += r_mem; + r_oph += (r_oph<<4); + r_F |= r_oph; + r_opl = (r_meml & 7) + ( (r_C & 7) << 3 ); + r_F |= ( ioblock_2_table[(r_B)] ^ ioblock_inc1_table[(r_opl)] ); + r_HL++; + AddCycles( 4+4+4+4); break; + + case OTIR : r_meml = Z80ReadMem(r_HL); r_memh = 0; + r_F = ( r_F & FLAG_C ) | ( (r_B)&0x0f ? 0 : FLAG_H ) | FLAG_N; \ + (r_B)--; + r_F |= ( (r_B)==0x7f ? FLAG_V : 0 ) | sz53_table[(r_B)]; + r_F &= 0xE8; + Z80OutPort( regs, r_BC, r_meml); + r_F |= ((r_meml & 0x80 ) >> 6); + r_opl = r_C; r_oph=0; + r_opl++; + r_op += r_mem; + r_oph += (r_oph<<4); + r_F |= r_oph; + r_opl = (r_meml & 7) + ( (r_C & 7) << 3 ); + r_F |= ( ioblock_2_table[(r_B)] ^ ioblock_inc1_table[(r_opl)] ); + r_HL++; + if( r_B ) { r_PC-=2; AddCycles(5); } + AddCycles( 4+4+4+4); break; + + + case OUTD : r_meml = Z80ReadMem(r_HL); r_memh = 0; + r_F = ( r_F & FLAG_C ) | ( (r_B)&0x0f ? 0 : FLAG_H ) | FLAG_N; \ + (r_B)--; + r_F |= ( (r_B)==0x7f ? FLAG_V : 0 ) | sz53_table[(r_B)]; + r_F &= 0xE8; + Z80OutPort( regs, r_BC, r_meml); + r_F |= ((r_meml & 0x80 ) >> 6); + r_opl = r_C; r_oph=0; + r_opl--; + r_op += r_mem; + r_oph += (r_oph<<4); + r_F |= r_oph; + r_opl = (r_meml & 7) + ( (r_C & 7) << 3 ); + r_F |= ( ioblock_2_table[(r_B)] ^ ioblock_dec1_table[(r_opl)] ); + r_HL--; + AddCycles( 4+4+4+4); break; + + case OTDR : r_meml = Z80ReadMem(r_HL); r_memh = 0; + r_F = ( r_F & FLAG_C ) | ( (r_B)&0x0f ? 0 : FLAG_H ) | FLAG_N; \ + (r_B)--; + r_F |= ( (r_B)==0x7f ? FLAG_V : 0 ) | sz53_table[(r_B)]; + r_F &= 0xE8; + Z80OutPort( regs, r_BC, r_meml); + r_F |= ((r_meml & 0x80 ) >> 6); + r_opl = r_C; r_oph=0; + r_opl--; + r_op += r_mem; + r_oph += (r_oph<<4); + r_F |= r_oph; + r_opl = (r_meml & 7) + ( (r_C & 7) << 3 ); + r_F |= ( ioblock_2_table[(r_B)] ^ ioblock_dec1_table[(r_opl)] ); + r_HL--; + if( r_B ) { r_PC-=2; AddCycles(5); } + AddCycles( 4+4+4+4); break; + +// End of Metalbrain's contribution + + case PREFIX_ED: AddCycles( 4 ); /* ED ED xx = 12 cycles min = 4+8 */ + r_PC-- ; + break; + + default: +// exit(1); + AddCycles( 4+4 ); /* Just a NOP */ +///!!! if(regs->DecodingErrors) +///!!! printf( "z80 core: Unknown instruction: ED %02Xh at PC=%04Xh.\n", +///!!! Z80ReadMem(r_PC-1),r_PC-2 ); + break; +} diff --git a/programs/emulator/e80/trunk/z80/opcodes.c b/programs/emulator/e80/trunk/z80/opcodes.c new file mode 100644 index 0000000000..35b2558c97 --- /dev/null +++ b/programs/emulator/e80/trunk/z80/opcodes.c @@ -0,0 +1,901 @@ +/*====================================================================/* + opcodes.c -> This file executes the single-byte Z80 opcodes. + + The CPU fetchs the byte pointed by the PC register (Program Counter) + into de IR (Instruction Register) and decodes it. The value of this + fetched byte (opcode) determines what operation the CPU must do. + On Z80 (which uses 8 bit for the IW register) this means that we + can have 256 (2^8) different opcodes. The z80 uses a simple trick + called PREFIXES to obtain more opcodes by using more than one byte + in the decoding (see opcodes_cb.c to know how it does it). + + This file executes the whole list of single-byte opcodes. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Copyright (c) 2000 Santiago Romero Iglesias. + Email: sromero@escomposlinux.org + =====================================================================*/ + +/* About the AddCycles(4) -> Remember that reading from memory + takes 3 cycles plus 1 of the decoding. + Add 3 cycles for each operand fetch, and + 3 more for each memory write/read. */ + + +case NOP : AddCycles( 4 ); break; +case LD_BC_NN : LD_rr_nn(r_BC); AddCycles( 4+3+3 ); break; +case LD_xBC_A : STORE_r(r_BC, r_A); AddCycles( 4+3 ); break; +case INC_BC : r_BC++; AddCycles( 4+2 ); break; + +case INC_B : INC(r_B); AddCycles( 4 ); break; +case DEC_B : DEC(r_B); AddCycles( 4 ); break; + +case LD_B_N : LD_r_n(r_B); + AddCycles( 4+3 ); + break; + +case EX_AF_AF : EX_WORD(r_AF, r_AFs); + AddCycles( 4 ); + break; + +case LD_A_xBC : LOAD_r(r_A, r_BC); + AddCycles( 4+3 ); + break; + +case DEC_BC : r_BC--; + AddCycles( 4+2 ); + break; + +case INC_C : INC(r_C); + AddCycles( 4 ); + break; + +case DEC_C : DEC(r_C); + AddCycles( 4 ); + break; + +case LD_C_N : LD_r_n(r_C); + AddCycles( 4+3 ); + break; + +case LD_DE_NN : LD_rr_nn(r_DE); + AddCycles( 4+3+3 ); + break; + +case LD_xDE_A : STORE_r(r_DE, r_A); + AddCycles( 4+3 ); + break; + +case INC_DE : r_DE++; + AddCycles( 4+2 ); + break; + +case INC_D : INC(r_D); + AddCycles( 4 ); + break; + +case DEC_D : DEC(r_D); + AddCycles( 4 ); + break; + +case LD_D_N : LD_r_n(r_D); + AddCycles( 4+3 ); + break; + +case ADD_HL_BC : ADD_WORD(r_HL, r_BC); AddCycles( 4+3+3+1 ); break; +case ADD_HL_DE : ADD_WORD(r_HL, r_DE); AddCycles( 4+3+3+1 ); break; +case ADD_HL_HL : ADD_WORD(r_HL, r_HL); AddCycles( 4+3+3+1 ); break; +case ADD_HL_SP : ADD_WORD(r_HL, r_SP); AddCycles( 4+3+3+1 ); break; + +case LD_A_xDE : LOAD_r(r_A, r_DE); + AddCycles( 4+3 ); + break; + +case DEC_DE : r_DE--; + AddCycles( 4+2 ); + break; + +case INC_E : INC(r_E); + AddCycles( 4 ); + break; + +case DEC_E : DEC(r_E); + AddCycles( 4 ); + break; + +case LD_E_N : LD_r_n(r_E); + AddCycles( 4+3 ); + break; + +case LD_HL_NN : LD_rr_nn(r_HL); + AddCycles( 4+3+3 ); + break; + +case LD_xNN_HL : STORE_nn_rr(r_HL); + AddCycles( 4+3+3+3+3 ); + break; + +case INC_HL : r_HL++; + AddCycles( 4+2 ); + break; + +case INC_H : INC(r_H); + AddCycles( 4 ); + break; + +case DEC_H : DEC(r_H); + AddCycles( 4 ); + break; + +case LD_H_N : LD_r_n(r_H); + AddCycles( 4+3 ); + break; + +case LD_HL_xNN : LOAD_rr_nn(r_HL); + AddCycles( 4+3+3+3+3 ); + break; + +case DEC_HL : r_HL--; + AddCycles( 4+2 ); + break; + +case INC_L : INC(r_L); + AddCycles( 4 ); + break; + +case DEC_L : DEC(r_L); + AddCycles( 4 ); + break; + +case LD_L_N : LD_r_n(r_L); + AddCycles( 4+3 ); + break; + +case LD_SP_NN : LD_rr_nn(r_SP); + AddCycles( 10 ); + break; + +case LD_xNN_A : STORE_nn_r(r_A); + AddCycles( 13 ); + break; + +case INC_SP : r_SP++; + AddCycles( 6 ); + break; + +case LD_xHL_N : r_meml = Z80ReadMem(r_PC); r_PC++; + STORE_r( r_HL, r_meml ); + AddCycles( 10 ); + break; + +case LD_A_xNN : LOAD_r_nn( r_A ); + AddCycles( 13 ); + break; + +case DEC_SP : r_SP--; + AddCycles( 6 ); + break; + +case INC_A : INC(r_A); + AddCycles( 4 ); + break; + +case DEC_A : DEC(r_A); + AddCycles( 4 ); + break; + +case LD_A_N : LD_r_n(r_A); + AddCycles( 4+3 ); + break; + +case LD_B_B : LD_r_r( r_B, r_B ); + AddCycles( 4 ); + break; + +case LD_B_C : LD_r_r( r_B, r_C ); + AddCycles( 4 ); + break; + +case LD_B_D : LD_r_r( r_B, r_D ); + AddCycles( 4 ); + break; + +case LD_B_E : LD_r_r( r_B, r_E ); + AddCycles( 4 ); + break; + +case LD_B_H : LD_r_r( r_B, r_H ); + AddCycles( 4 ); + break; + +case LD_B_L : LD_r_r( r_B, r_L ); + AddCycles( 4 ); + break; + +case LD_B_xHL : LOAD_r(r_B, r_HL); + AddCycles( 4+3 ); + break; + +case LD_B_A : LD_r_r( r_B, r_A ); + AddCycles( 4 ); + break; + +case LD_C_B : LD_r_r( r_C, r_B ); + AddCycles( 4 ); + break; + +case LD_C_C : LD_r_r( r_C, r_C ); + AddCycles( 4 ); + break; + +case LD_C_D : LD_r_r( r_C, r_D ); + AddCycles( 4 ); + break; + +case LD_C_E : LD_r_r( r_C, r_E ); + AddCycles( 4 ); + break; +case LD_C_H : LD_r_r( r_C, r_H ); + AddCycles( 4 ); + break; + +case LD_C_L : LD_r_r( r_C, r_L ); + AddCycles( 4 ); + break; + +case LD_C_xHL : LOAD_r(r_C, r_HL); + AddCycles( 4+3 ); + break; + +case LD_C_A : LD_r_r( r_C, r_A ); + AddCycles( 4 ); + break; + +case LD_D_B : LD_r_r( r_D, r_B ); + AddCycles( 4 ); + break; + +case LD_D_C : LD_r_r( r_D, r_C ); + AddCycles( 4 ); + break; + +case LD_D_D : LD_r_r( r_D, r_D ); + AddCycles( 4 ); + break; + +case LD_D_E : LD_r_r( r_D, r_E ); + AddCycles( 4 ); + break; + +case LD_D_H : LD_r_r( r_D, r_H ); + AddCycles( 4 ); + break; + +case LD_D_L : LD_r_r( r_D, r_L ); + AddCycles( 4 ); + break; + +case LD_D_xHL : LOAD_r(r_D, r_HL); + AddCycles( 4+3 ); + break; + +case LD_D_A : LD_r_r( r_D, r_A ); + AddCycles( 4 ); + break; + +case LD_E_B : LD_r_r( r_E, r_B ); + AddCycles( 4 ); + break; + +case LD_E_C : LD_r_r( r_E, r_C ); + AddCycles( 4 ); + break; + +case LD_E_D : LD_r_r( r_E, r_D ); + AddCycles( 4 ); + break; + +case LD_E_E : LD_r_r( r_E, r_E ); + AddCycles( 4 ); + break; + +case LD_E_H : LD_r_r( r_E, r_H ); + AddCycles( 4 ); + break; + +case LD_E_L : LD_r_r( r_E, r_L ); + AddCycles( 4 ); + break; + +case LD_E_xHL : LOAD_r(r_E, r_HL); + AddCycles( 4+3 ); + break; + +case LD_E_A : LD_r_r( r_E, r_A ); + AddCycles( 4 ); + break; + +case LD_H_B : LD_r_r( r_H, r_B ); + AddCycles( 4 ); + break; + +case LD_H_C : LD_r_r( r_H, r_C ); + AddCycles( 4 ); + break; + +case LD_H_D : LD_r_r( r_H, r_D ); + AddCycles( 4 ); + break; + +case LD_H_E : LD_r_r( r_H, r_E ); + AddCycles( 4 ); + break; + +case LD_H_H : LD_r_r( r_H, r_H ); + AddCycles( 4 ); + break; + +case LD_H_L : LD_r_r( r_H, r_L ); + AddCycles( 4 ); + break; + +case LD_H_xHL : LOAD_r(r_H, r_HL); + AddCycles( 4+3 ); + break; + +case LD_H_A : LD_r_r( r_H, r_A ); + AddCycles( 4 ); + break; + +case LD_L_B : LD_r_r( r_L, r_B ); + AddCycles( 4 ); + break; + +case LD_L_C : LD_r_r( r_L, r_C ); + AddCycles( 4 ); + break; + +case LD_L_D : LD_r_r( r_L, r_D ); + AddCycles( 4 ); + break; + +case LD_L_E : LD_r_r( r_L, r_E ); + AddCycles( 4 ); + break; + +case LD_L_H : LD_r_r( r_L, r_H ); + AddCycles( 4 ); + break; + +case LD_L_L : LD_r_r( r_L, r_L ); + AddCycles( 4 ); + break; + +case LD_L_xHL : LOAD_r(r_L, r_HL); + AddCycles( 7 ); + break; + +case LD_L_A : LD_r_r( r_L, r_A ); + AddCycles( 4 ); + break; + +case LD_xHL_B : STORE_r( r_HL, r_B ); + AddCycles( 4+3 ); + break; + +case LD_xHL_C : STORE_r( r_HL, r_C ); + AddCycles( 4+3 ); + break; + +case LD_xHL_D : STORE_r( r_HL, r_D ); + AddCycles( 4+3 ); + break; + +case LD_xHL_E : STORE_r( r_HL, r_E ); + AddCycles( 4+3 ); + break; + +case LD_xHL_H : STORE_r( r_HL, r_H ); + AddCycles( 4+3 ); + break; + +case LD_xHL_L : STORE_r( r_HL, r_L ); + AddCycles( 4+3 ); + break; + +case LD_xHL_A : STORE_r(r_HL, r_A ); + AddCycles( 4+3 ); + break; + +case LD_A_B : LD_r_r( r_A, r_B ); + AddCycles( 4 ); + break; + +case LD_A_C : LD_r_r( r_A, r_C ); + AddCycles( 4 ); + break; + +case LD_A_D : LD_r_r( r_A, r_D ); + AddCycles( 4 ); + break; + +case LD_A_E : LD_r_r( r_A, r_E ); + AddCycles( 4 ); + break; + +case LD_A_H : LD_r_r( r_A, r_H ); + AddCycles( 4 ); + break; + +case LD_A_L : LD_r_r( r_A, r_L ); + AddCycles( 4 ); + break; + +case LD_A_xHL : LOAD_r( r_A, r_HL); + AddCycles( 4+3 ); + break; + +case LD_A_A : LD_r_r( r_A, r_A ); + AddCycles( 4 ); + break; + +case LD_SP_HL : LD_r_r( r_SP, r_HL ); + AddCycles( 6 ); break; + +case ADD_B : ADD(r_B); AddCycles( 4 ); break; +case ADD_C : ADD(r_C); AddCycles( 4 ); break; +case ADD_D : ADD(r_D); AddCycles( 4 ); break; +case ADD_E : ADD(r_E); AddCycles( 4 ); break; +case ADD_H : ADD(r_H); AddCycles( 4 ); break; +case ADD_L : ADD(r_L); AddCycles( 4 ); break; +case ADD_xHL : r_meml = Z80ReadMem(r_HL); + ADD(r_meml); + AddCycles( 4+3 ); + break; +case ADD_A : ADD(r_A); AddCycles( 4 ); break; +case ADC_B : ADC(r_B); AddCycles( 4 ); break; +case ADC_C : ADC(r_C); AddCycles( 4 ); break; +case ADC_D : ADC(r_D); AddCycles( 4 ); break; +case ADC_E : ADC(r_E); AddCycles( 4 ); break; +case ADC_H : ADC(r_H); AddCycles( 4 ); break; +case ADC_L : ADC(r_L); AddCycles( 4 ); break; +case ADC_xHL : r_meml = Z80ReadMem(r_HL); + ADC(r_meml); + AddCycles( 4+3 ); + break; +case ADC_A : ADC(r_A); AddCycles( 4 ); break; +case ADC_N : r_meml = Z80ReadMem(r_PC); r_PC++; + ADC(r_meml); + AddCycles( 4+3 ); + break; + +case SUB_A : SUB(r_A); AddCycles( 4 ); break; +case SUB_B : SUB(r_B); AddCycles( 4 ); break; +case SUB_C : SUB(r_C); AddCycles( 4 ); break; +case SUB_D : SUB(r_D); AddCycles( 4 ); break; +case SUB_E : SUB(r_E); AddCycles( 4 ); break; +case SUB_H : SUB(r_H); AddCycles( 4 ); break; +case SUB_L : SUB(r_L); AddCycles( 4 ); break; +case SUB_xHL : r_meml = Z80ReadMem(r_HL); + SUB(r_meml); + AddCycles( 4+3 ); + break; +case SUB_N : r_meml = Z80ReadMem(r_PC); r_PC++; + SUB(r_meml); + AddCycles( 4+3 ); + break; + +case SBC_A : SBC(r_A); AddCycles( 4 ); break; +case SBC_B : SBC(r_B); AddCycles( 4 ); break; +case SBC_C : SBC(r_C); AddCycles( 4 ); break; +case SBC_D : SBC(r_D); AddCycles( 4 ); break; +case SBC_E : SBC(r_E); AddCycles( 4 ); break; +case SBC_H : SBC(r_H); AddCycles( 4 ); break; +case SBC_L : SBC(r_L); AddCycles( 4 ); break; +case SBC_xHL : r_meml = Z80ReadMem(r_HL); + SBC(r_meml); + AddCycles( 4+3 ); + break; +case SBC_N : r_meml = Z80ReadMem(r_PC); r_PC++; + SBC(r_meml); + AddCycles( 4 ); + break; + +case AND_B : AND( r_B ); AddCycles( 4 ); break; +case AND_C : AND( r_C ); AddCycles( 4 ); break; +case AND_D : AND( r_D ); AddCycles( 4 ); break; +case AND_E : AND( r_E ); AddCycles( 4 ); break; +case AND_H : AND( r_H ); AddCycles( 4 ); break; +case AND_L : AND( r_L ); AddCycles( 4 ); break; +case AND_xHL : AND_mem( r_HL ); AddCycles( 4+3 ); break; +case AND_A : AND( r_A ); AddCycles( 4 ); break; +case XOR_B : XOR( r_B ); AddCycles( 4 ); break; +case XOR_C : XOR( r_C ); AddCycles( 4 ); break; +case XOR_D : XOR( r_D ); AddCycles( 4 ); break; +case XOR_E : XOR( r_E ); AddCycles( 4 ); break; +case XOR_H : XOR( r_H ); AddCycles( 4 ); break; +case XOR_L : XOR( r_L ); AddCycles( 4 ); break; +case XOR_xHL : XOR_mem( r_HL ); AddCycles( 4+3 ); break; +case XOR_A : XOR( r_A ); AddCycles( 4 ); break; +case OR_B : OR( r_B ); AddCycles( 4 ); break; +case OR_C : OR( r_C ); AddCycles( 4 ); break; +case OR_D : OR( r_D ); AddCycles( 4 ); break; +case OR_E : OR( r_E ); AddCycles( 4 ); break; +case OR_H : OR( r_H ); AddCycles( 4 ); break; +case OR_L : OR( r_L ); AddCycles( 4 ); break; +case OR_xHL : OR_mem( r_HL ); AddCycles( 4+3 ); break; +case OR_A : OR( r_A ); AddCycles( 4 ); break; +case CP_A : CP(r_A); AddCycles( 4 ); break; +case CP_B : CP(r_B); AddCycles( 4 ); break; +case CP_C : CP(r_C); AddCycles( 4 ); break; +case CP_D : CP(r_D); AddCycles( 4 ); break; +case CP_E : CP(r_E); AddCycles( 4 ); break; +case CP_H : CP(r_H); AddCycles( 4 ); break; +case CP_L : CP(r_L); AddCycles( 4 ); break; +case CP_xHL : r_meml = Z80ReadMem( r_HL ); + CP(r_meml); AddCycles( 4+3 ); break; +case CP_N : r_meml = Z80ReadMem(r_PC); r_PC++; + CP(r_meml); + AddCycles( 4+3); + break; + +case RET_Z : if( TEST_FLAG(Z_FLAG) ) + { RET_nn(); AddCycles( 4+1+3+3 ); } + else { AddCycles( 4+1 ); } + break; + +case RET_C : if( TEST_FLAG(C_FLAG) ) + { RET_nn(); AddCycles( 4+1+3+3 ); } + else { AddCycles( 4+1 ); } + break; + +case RET_M : if( TEST_FLAG(S_FLAG) ) + { RET_nn(); AddCycles( 4+1+3+3 ); } + else { AddCycles( 4+1 ); } + break; + +case RET_PE : if( TEST_FLAG(P_FLAG) ) + { RET_nn(); AddCycles( 4+1+3+3 ); } + else { AddCycles( 4+1 ); } + break; + +case RET_PO : if( TEST_FLAG(P_FLAG) ) + { AddCycles( 4+1 ); } + else { RET_nn(); AddCycles( 4+1+3+3 ); } + break; + +case RET_P : if( TEST_FLAG(S_FLAG) ) + { AddCycles( 4+1 ); } + else { RET_nn(); AddCycles( 4+1+3+3 ); } + break; + +case RET : RET_nn(); + AddCycles( 4+3+3 ); + break; + +case RET_NZ : if( TEST_FLAG(Z_FLAG) ) + { AddCycles( 4+1 ); } + else { RET_nn(); AddCycles( 4+1+3+3 ); } + break; + +case RET_NC : if( TEST_FLAG(C_FLAG) ) + { AddCycles( 4+1 ); } + else { RET_nn(); AddCycles( 4+1+3+3 ); } + break; + +case ADD_N : r_meml = Z80ReadMem(r_PC); r_PC++; + ADD(r_meml); + AddCycles( 4+3 ); + break; + +case JR : JR_n(); + AddCycles( 4+3+3+2 ); + break; + +case JR_NZ : if( TEST_FLAG(Z_FLAG) ) + { r_PC++; AddCycles( 4+3 ); } + else + { JR_n(); AddCycles( 4+8 ); } + break; + +case JR_Z : if( TEST_FLAG(Z_FLAG) ) + { JR_n(); AddCycles( 4+8 ); } + else + { r_PC++; AddCycles( 4+3 ); } + break; + +case JR_NC : if( TEST_FLAG(C_FLAG) ) + { r_PC++; AddCycles( 4+3 ); } + else + { JR_n(); AddCycles( 4+8 ); } + break; + +case JR_C : if( TEST_FLAG(C_FLAG) ) + { JR_n(); AddCycles( 4+8 ); } + else + { r_PC++; AddCycles( 4+3 ); } + break; + +case JP_NZ : if( TEST_FLAG(Z_FLAG) ) { r_PC += 2; } + else { JP_nn(); } + AddCycles( 4+3+3 ); + break; + +case JP : JP_nn(); + AddCycles( 4+3+3 ); + break; + +case JP_Z : if( TEST_FLAG(Z_FLAG) ) { JP_nn(); } + else { r_PC += 2; } + AddCycles( 4+3+3 ); + break; + +case JP_NC : if( TEST_FLAG(C_FLAG) ) { r_PC += 2; } + else { JP_nn(); } + AddCycles( 4+3+3 ); + break; + +case JP_C : if( TEST_FLAG(C_FLAG) ) { JP_nn(); } + else { r_PC += 2; } + AddCycles( 4+3+3 ); + break; + +case JP_PO : if( TEST_FLAG(P_FLAG) ) { r_PC += 2; } + else { JP_nn(); } + AddCycles( 4+3+3 ); + break; + +case JP_PE : if( TEST_FLAG(P_FLAG) ) { JP_nn(); } + else { r_PC += 2; } + AddCycles( 4+3+3 ); + break; + +case JP_P : if( TEST_FLAG(S_FLAG) ) { r_PC += 2; } + else { JP_nn(); } + AddCycles( 4+3+3 ); + break; + + +case JP_M : if( TEST_FLAG(S_FLAG) ) { JP_nn(); } + else { r_PC += 2; } + AddCycles( 4+3+3 ); + break; + +case JP_xHL : r_PC = r_HL; AddCycles( 4 ); break; + +case CPL : r_A ^= 0xFF; + r_F = ( r_F & (FLAG_C|FLAG_P|FLAG_Z|FLAG_S)) | + ( r_A & (FLAG_3|FLAG_5))|(FLAG_N|FLAG_H); + AddCycles( 4 ); break; + +case INC_xHL : r_meml = Z80ReadMem( r_HL ); + INC(r_meml); + Z80WriteMem( r_HL, r_meml, regs ); + AddCycles( 4+3+3+1 ); break; + +case DEC_xHL : r_meml = Z80ReadMem( r_HL ); + DEC(r_meml); + Z80WriteMem( r_HL, r_meml, regs ); + AddCycles( 4+3+3+1 ); break; + +case SCF : r_F = r_F | FLAG_C; + r_F &= FLAG_Z | FLAG_S | FLAG_P; + if(r_F & FLAG_H) r_F ^= FLAG_H; + r_F |= FLAG_C; + AddCycles( 4 ); break; + +case CCF : r_F = (r_F & (FLAG_P|FLAG_Z|FLAG_S) ) | + ((r_F & FLAG_C) ? FLAG_H : FLAG_C) | + ( r_A & (FLAG_3 | FLAG_5) ); + AddCycles( 4 ); break; + +case HALT : regs->halted = 1; + AddCycles(4); + break; + +case POP_BC : POP(BC); AddCycles( 10 ); break; +case PUSH_BC : PUSH(BC); AddCycles( 11 ); break; +case POP_HL : POP(HL); AddCycles( 10 ); break; +case PUSH_HL : PUSH(HL); AddCycles( 11 ); break; +case POP_AF : POP(AF); AddCycles( 10 ); break; +case PUSH_AF : PUSH(AF); AddCycles( 11 ); break; +case POP_DE : POP(DE); AddCycles( 10 ); break; +case PUSH_DE : PUSH(DE); AddCycles( 11 ); break; + +case RLCA : r_A = (r_A << 1) | (r_A >> 7); + r_F = ( r_F & (FLAG_P|FLAG_Z|FLAG_S)) | + ( r_A & (FLAG_C|FLAG_3|FLAG_5) ); + AddCycles( 4 ); break; + +case RRCA : r_F = ( r_F & (FLAG_P|FLAG_Z|FLAG_S)) | + ( r_A & FLAG_C ); + r_A = ( r_A >> 1) | ( r_A << 7 ); + r_F |= ( r_A & ( FLAG_3 | FLAG_5 ) ); + AddCycles( 4 ); break; + +case DJNZ : r_B--; + if( r_B ) { JR_n(); AddCycles(13); } + else { r_PC++ ; AddCycles(8); } + break; + +case RLA : r_meml = r_A; + r_A = ( r_A << 1 ) | ( r_F & FLAG_C ); + r_F = ( r_F & ( FLAG_P | FLAG_Z | FLAG_S ) ) | + (r_A & ( FLAG_3 | FLAG_5 ) ) | ( r_meml >> 7); + AddCycles( 4 ); break; + +case RRA : r_meml = r_A; + r_A = ( r_A >> 1 ) | ( r_F << 7 ); + r_F = ( r_F & ( FLAG_P | FLAG_Z | FLAG_S ) ) | + ( r_A & ( FLAG_3 | FLAG_5 ) ) | ( r_meml & FLAG_C ); + AddCycles( 4 ); break; + +case DAA : r_meml = 0; + r_memh = ( r_F & FLAG_C ); + if( ( r_F & FLAG_H ) || ( (r_A & 0x0f)>9 ) ) r_meml=6; + if( r_memh || (r_A > 0x9f ) ) r_meml |= 0x60; + if( r_A > 0x99 ) r_memh=1; + if ( r_F & FLAG_N ) { SUB(r_meml); } + else + { + if( (r_A>0x90) && ( (r_A & 0x0f)>9) ) r_meml|=0x60; + ADD(r_meml); + } + r_F = ( r_F & ~( FLAG_C | FLAG_P) ) | r_memh | + parity_table[r_A]; + AddCycles( 4 ); break; + +case OUT_N_A : Z80OutPort( regs, Z80ReadMem( r_PC ), r_A ); r_PC++; + AddCycles( 11 ); break; + +case IN_A_N : r_A = Z80InPort( Z80ReadMem( r_PC ) + (r_A << 8)); + r_PC++; AddCycles( 11 ); break; + +case EX_HL_xSP : r_meml = Z80ReadMem(r_SP); + r_memh = Z80ReadMem(r_SP+1); + Z80WriteMem(r_SP, r_L, regs); + Z80WriteMem(r_SP+1, r_H, regs); + r_L = r_meml; + r_H = r_memh; + AddCycles( 19 ); break; + +case EXX : EX_WORD(r_BC, r_BCs); EX_WORD(r_DE, r_DEs); + EX_WORD(r_HL, r_HLs); + AddCycles( 4 ); break; + +case EX_DE_HL : EX_WORD( r_DE, r_HL ); + AddCycles( 4 ); + break; + +case AND_N : AND_mem( r_PC ); + r_PC++; + AddCycles( 4+3 ); + break; + +case XOR_N : XOR_mem( r_PC ); + r_PC++; + AddCycles( 4+3 ); + break; + +case OR_N : OR_mem( r_PC ); + r_PC++; + AddCycles( 4+3 ); + break; + +case DI : r_IFF1 = r_IFF2 = 0; + AddCycles( 4 ); + break; + +case CALL : + CALL_nn(); + AddCycles( 4+3+3+3+3+1 ); + break; + +case CALL_NZ : if( TEST_FLAG(Z_FLAG) ) + { r_PC += 2; AddCycles( 4+3+3 ); } + else + { + CALL_nn(); + AddCycles( 4+3+3+3+3+1 ); + } + break; + +case CALL_NC : if( TEST_FLAG(C_FLAG) ) + { r_PC += 2; AddCycles( 4+3+3 ); } + else + { CALL_nn(); + AddCycles( 4+3+3+3+3+1 ); + } + break; + +case CALL_PO : if( TEST_FLAG(P_FLAG) ) + { r_PC += 2; AddCycles( 4+3+3 ); } + else + { CALL_nn(); + AddCycles( 4+3+3+ 3+3+1 ); + } + break; + +case CALL_P : if( TEST_FLAG(S_FLAG) ) + { r_PC += 2; AddCycles( 4+3+3 ); } + else + { CALL_nn(); + AddCycles( 4+3+3+3+3+1 ); + } + break; + + +case CALL_Z : if( TEST_FLAG(Z_FLAG) ) + { CALL_nn(); + AddCycles( 4+3+3+3+3+1 ); + } + else + { r_PC += 2; AddCycles( 4+3+3 ); } + break; + +case CALL_C : if( TEST_FLAG(C_FLAG) ) + { CALL_nn(); + AddCycles( 4+3+3+ 3+3+4 ); + } + else + { r_PC += 2; AddCycles( 4+3+3 ); } + break; + +case CALL_PE : if( TEST_FLAG(P_FLAG) ) + { CALL_nn(); + AddCycles( 4+3+3+3+3+1 ); + } + else + { r_PC += 2; AddCycles( 4+3+3 ); } + break; + +case CALL_M : if( TEST_FLAG(S_FLAG) ) + { CALL_nn(); + AddCycles( 4+3+3+3+3+1 ); + } + else + { r_PC += 2; AddCycles( 4+3+3 ); } + break; + +case EI : r_IFF1 = r_IFF2 = 1; + /* + Why Marat Fayzullin does this? -> + + regs->IFF2 |= 0x01; + if( regs->IRequest != INT_NOINT ) + { + regs->IBackup = regs->ICount; + regs->ICount = 0x1; + r_IFF |= 0x20; + }*/ + AddCycles( 4 ); + break; + +case RST_00 : RST(0x00); AddCycles( 11 ); break; +case RST_08 : RST(0x08); AddCycles( 11 ); break; +case RST_10 : RST(0x10); AddCycles( 11 ); break; +case RST_18 : RST(0x18); AddCycles( 11 ); break; +case RST_20 : RST(0x20); AddCycles( 11 ); break; +case RST_28 : RST(0x28); AddCycles( 11 ); break; +case RST_30 : RST(0x30); AddCycles( 11 ); break; +case RST_38 : RST(0x38); AddCycles( 11 ); break; + +default: +// exit(1); +///!!! if( regs->DecodingErrors ) +///!!! printf("z80 core: Unknown instruction: %02Xh at PC=%04Xh.\n", +///!!! Z80ReadMem(r_PC-1), r_PC-1 ); + break; diff --git a/programs/emulator/e80/trunk/z80/opddfdcb.c b/programs/emulator/e80/trunk/z80/opddfdcb.c new file mode 100644 index 0000000000..ebee5fb876 --- /dev/null +++ b/programs/emulator/e80/trunk/z80/opddfdcb.c @@ -0,0 +1,196 @@ +/*====================================================================/* + opcodes_ddfdcb.c -> This file executes the DD/FD CB PREFIX opcodes. + + Those are the double prefix opcodes. We found the DD prefix, which + means that we must treat HL as IX, and then we found the CB prefix, + so we must apply this rule to the CB PREFIX list of opcodes. A + signed byte displacement is also added, and it's located BEFORE + the DD CB opcode: + + ie: CB 2E = SRA (HL) + DD CB xx 2E = SRA (IX+xx) + + (or...) + + Those are the double prefix opcodes. We found the FD prefix, which + means that we must treat HL as IY, and then we found the CB prefix, + so we must apply this rule to the CB PREFIX list of opcodes. A + signed byte displacement is also added, and it's located BEFORE + the FD CB opcode: + + ie: CB 2E = SRA (HL) + FD CB xx 2E = SRA (IY+xx) + + Call here using something like #define REGISTER regs->IX + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Copyright (c) 2000 Santiago Romero Iglesias. + Email: sromero@escomposlinux.org + =====================================================================*/ + +/* 15 clock cycles minimum = FD/DD CB xx opcode = 4 + 4 + 3 + 4 */ + +tmpreg.W = REGISTER.W + (offset) Z80ReadMem( r_PC ); +r_PC++; +r_meml = Z80ReadMem( tmpreg.W ); +opcode = Z80ReadMem( r_PC ); +r_PC++; + +switch(opcode) +{ + + case RLC_xIXY : RLC(r_meml); Z80WriteMem(tmpreg.W, r_meml, regs); + AddCycles( 23 ); break; + case RRC_xIXY : RRC(r_meml); Z80WriteMem(tmpreg.W, r_meml, regs); + AddCycles( 23 ); break; + case RL_xIXY : RL(r_meml); Z80WriteMem(tmpreg.W, r_meml, regs); + AddCycles( 23 ); break; + case RR_xIXY : RR(r_meml); Z80WriteMem(tmpreg.W, r_meml, regs); + AddCycles( 23 ); break; + case SLA_xIXY : SLA(r_meml); Z80WriteMem(tmpreg.W, r_meml, regs); + AddCycles( 23 ); break; + case SRA_xIXY : SRA(r_meml); Z80WriteMem(tmpreg.W, r_meml, regs); + AddCycles( 23 ); break; + case SLL_xIXY : SLL(r_meml); Z80WriteMem(tmpreg.W, r_meml, regs); + AddCycles( 23 ); break; + case SRL_xIXY : SRL(r_meml); Z80WriteMem(tmpreg.W, r_meml, regs); + AddCycles( 23 ); break; + case 0x40: + case 0x41: + case 0x42: + case 0x43: + case 0x44: + case 0x45: + case 0x47: + case BIT_0_xIXY : BIT_BIT(0, r_meml); AddCycles( 15+5 ); break; + + case 0x48: + case 0x49: + case 0x4a: + case 0x4b: + case 0x4c: + case 0x4d: + case 0x4f: + case BIT_1_xIXY : + BIT_BIT(1, r_meml); AddCycles( 15+5 ); break; + + case 0x50: + case 0x51: + case 0x52: + case 0x53: + case 0x54: + case 0x55: + case 0x57: + case BIT_2_xIXY : BIT_BIT(2, r_meml); AddCycles( 15+5 ); break; + + case 0x58: + case 0x59: + case 0x5a: + case 0x5b: + case 0x5c: + case 0x5d: + case 0x5f: + case BIT_3_xIXY : BIT_BIT(3, r_meml); AddCycles( 15+5 ); break; + + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x67: + case BIT_4_xIXY : BIT_BIT(4, r_meml); AddCycles( 15+5 ); break; + + case 0x68: + case 0x69: + case 0x6a: + case 0x6b: + case 0x6c: + case 0x6d: + case 0x6f: + case BIT_5_xIXY : BIT_BIT(5, r_meml); AddCycles( 15+5 ); break; + + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x77: + case BIT_6_xIXY : BIT_BIT(6, r_meml); AddCycles( 15+5 ); break; + case 0x78: + case 0x79: + case 0x7a: + case 0x7b: + case 0x7c: + case 0x7d: + case 0x7f: + case BIT_7_xIXY : BIT_BIT7(r_meml); AddCycles( 15+5 ); break; + + case RES_0_xIXY : BIT_RES_mem(0, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case RES_1_xIXY : BIT_RES_mem(1, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case RES_2_xIXY : BIT_RES_mem(2, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case RES_3_xIXY : BIT_RES_mem(3, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case RES_4_xIXY : BIT_RES_mem(4, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case RES_5_xIXY : BIT_RES_mem(5, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case RES_6_xIXY : BIT_RES_mem(6, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case RES_7_xIXY : BIT_RES_mem(7, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case SET_0_xIXY : BIT_SET_mem(0, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case SET_1_xIXY : BIT_SET_mem(1, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case SET_2_xIXY : BIT_SET_mem(2, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case SET_3_xIXY : BIT_SET_mem(3, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case SET_4_xIXY : BIT_SET_mem(4, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case SET_5_xIXY : BIT_SET_mem(5, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case SET_6_xIXY : BIT_SET_mem(6, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + case SET_7_xIXY : BIT_SET_mem(7, tmpreg.W, r_meml ); + AddCycles( 15+5+3 ); break; + + +/* + I must still include the undocumented opcodes such as: + LD B, RLC(REGISTER+dd) and so on ... + +*/ + default: + AddCycles( 15 ); +// exit(1); +///!!! if(regs->DecodingErrors) +///!!! { +///!!! printf("z80 core: Unknown instruction: "); +///!!! if( regs->we_are_on_ddfd == WE_ARE_ON_DD ) +///!!! printf("DD"); +///!!! else +///!!! printf("FD"); +///!!! printf("CB %02Xh %02Xh at PC=%04Xh.\n", +///!!! Z80ReadMem(r_PC-2), Z80ReadMem(r_PC-1), r_PC-4 ); +///!!! } + break; +} diff --git a/programs/emulator/e80/trunk/z80/tables.h b/programs/emulator/e80/trunk/z80/tables.h new file mode 100644 index 0000000000..6974e70f32 --- /dev/null +++ b/programs/emulator/e80/trunk/z80/tables.h @@ -0,0 +1,829 @@ +/*===================================================================== + tables.h -> Header file containing the defines for Z80 opcodes. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Copyright (c) 2000 Santiago Romero Iglesias. + Email: sromero@escomposlinux.org + ======================================================================*/ + +#ifndef TABLES_H +#define TABLES_H + +/*--- One byte opcodes: ----------------------------------------------*/ +#define NOP 0 +#define LD_BC_NN 1 +#define LD_xBC_A 2 +#define INC_BC 3 +#define INC_B 4 +#define DEC_B 5 +#define LD_B_N 6 +#define RLCA 7 +#define EX_AF_AF 8 +#define ADD_HL_BC 9 +#define LD_A_xBC 10 +#define DEC_BC 11 +#define INC_C 12 +#define DEC_C 13 +#define LD_C_N 14 +#define RRCA 15 +#define DJNZ 16 +#define LD_DE_NN 17 +#define LD_xDE_A 18 +#define INC_DE 19 +#define INC_D 20 +#define DEC_D 21 +#define LD_D_N 22 +#define RLA 23 +#define JR 24 +#define ADD_HL_DE 25 +#define LD_A_xDE 26 +#define DEC_DE 27 +#define INC_E 28 +#define DEC_E 29 +#define LD_E_N 30 +#define RRA 31 +#define JR_NZ 32 +#define LD_HL_NN 33 +#define LD_xNN_HL 34 +#define INC_HL 35 +#define INC_H 36 +#define DEC_H 37 +#define LD_H_N 38 +#define DAA 39 +#define JR_Z 40 +#define ADD_HL_HL 41 +#define LD_HL_xNN 42 +#define DEC_HL 43 +#define INC_L 44 +#define DEC_L 45 +#define LD_L_N 46 +#define CPL 47 +#define JR_NC 48 +#define LD_SP_NN 49 +#define LD_xNN_A 50 +#define INC_SP 51 +#define INC_xHL 52 +#define DEC_xHL 53 +#define LD_xHL_N 54 +#define SCF 55 +#define JR_C 56 +#define ADD_HL_SP 57 +#define LD_A_xNN 58 +#define DEC_SP 59 +#define INC_A 60 +#define DEC_A 61 +#define LD_A_N 62 +#define CCF 63 +#define LD_B_B 64 +#define LD_B_C 65 +#define LD_B_D 66 +#define LD_B_E 67 +#define LD_B_H 68 +#define LD_B_L 69 +#define LD_B_xHL 70 +#define LD_B_A 71 +#define LD_C_B 72 +#define LD_C_C 73 +#define LD_C_D 74 +#define LD_C_E 75 +#define LD_C_H 76 +#define LD_C_L 77 +#define LD_C_xHL 78 +#define LD_C_A 79 +#define LD_D_B 80 +#define LD_D_C 81 +#define LD_D_D 82 +#define LD_D_E 83 +#define LD_D_H 84 +#define LD_D_L 85 +#define LD_D_xHL 86 +#define LD_D_A 87 +#define LD_E_B 88 +#define LD_E_C 89 +#define LD_E_D 90 +#define LD_E_E 91 +#define LD_E_H 92 +#define LD_E_L 93 +#define LD_E_xHL 94 +#define LD_E_A 95 +#define LD_H_B 96 +#define LD_H_C 97 +#define LD_H_D 98 +#define LD_H_E 99 +#define LD_H_H 100 +#define LD_H_L 101 +#define LD_H_xHL 102 +#define LD_H_A 103 +#define LD_L_B 104 +#define LD_L_C 105 +#define LD_L_D 106 +#define LD_L_E 107 +#define LD_L_H 108 +#define LD_L_L 109 +#define LD_L_xHL 110 +#define LD_L_A 111 +#define LD_xHL_B 112 +#define LD_xHL_C 113 +#define LD_xHL_D 114 +#define LD_xHL_E 115 +#define LD_xHL_H 116 +#define LD_xHL_L 117 +#define HALT 118 +#define LD_xHL_A 119 +#define LD_A_B 120 +#define LD_A_C 121 +#define LD_A_D 122 +#define LD_A_E 123 +#define LD_A_H 124 +#define LD_A_L 125 +#define LD_A_xHL 126 +#define LD_A_A 127 +#define ADD_B 128 +#define ADD_C 129 +#define ADD_D 130 +#define ADD_E 131 +#define ADD_H 132 +#define ADD_L 133 +#define ADD_xHL 134 +#define ADD_A 135 +#define ADC_B 136 +#define ADC_C 137 +#define ADC_D 138 +#define ADC_E 139 +#define ADC_H 140 +#define ADC_L 141 +#define ADC_xHL 142 +#define ADC_A 143 +#define SUB_B 144 +#define SUB_C 145 +#define SUB_D 146 +#define SUB_E 147 +#define SUB_H 148 +#define SUB_L 149 +#define SUB_xHL 150 +#define SUB_A 151 +#define SBC_B 152 +#define SBC_C 153 +#define SBC_D 154 +#define SBC_E 155 +#define SBC_H 156 +#define SBC_L 157 +#define SBC_xHL 158 +#define SBC_A 159 +#define AND_B 160 +#define AND_C 161 +#define AND_D 162 +#define AND_E 163 +#define AND_H 164 +#define AND_L 165 +#define AND_xHL 166 +#define AND_A 167 +#define XOR_B 168 +#define XOR_C 169 +#define XOR_D 170 +#define XOR_E 171 +#define XOR_H 172 +#define XOR_L 173 +#define XOR_xHL 174 +#define XOR_A 175 +#define OR_B 176 +#define OR_C 177 +#define OR_D 178 +#define OR_E 179 +#define OR_H 180 +#define OR_L 181 +#define OR_xHL 182 +#define OR_A 183 +#define CP_B 184 +#define CP_C 185 +#define CP_D 186 +#define CP_E 187 +#define CP_H 188 +#define CP_L 189 +#define CP_xHL 190 +#define CP_A 191 +#define RET_NZ 192 +#define POP_BC 193 +#define JP_NZ 194 +#define JP 195 +#define CALL_NZ 196 +#define PUSH_BC 197 +#define ADD_N 198 +#define RST_00 199 +#define RET_Z 200 +#define RET 201 +#define JP_Z 202 +#define PREFIX_CB 203 +#define CALL_Z 204 +#define CALL 205 +#define ADC_N 206 +#define RST_08 207 +#define RET_NC 208 +#define POP_DE 209 +#define JP_NC 210 +#define OUT_N_A 211 +#define CALL_NC 212 +#define PUSH_DE 213 +#define SUB_N 214 +#define RST_10 215 +#define RET_C 216 +#define EXX 217 +#define JP_C 218 +#define IN_A_N 219 +#define CALL_C 220 +#define PREFIX_DD 221 +#define SBC_N 222 +#define RST_18 223 +#define RET_PO 224 +#define POP_HL 225 +#define JP_PO 226 +#define EX_HL_xSP 227 +#define CALL_PO 228 +#define PUSH_HL 229 +#define AND_N 230 +#define RST_20 231 +#define RET_PE 232 +#define JP_xHL 233 +#define JP_PE 234 +#define EX_DE_HL 235 +#define CALL_PE 236 +#define PREFIX_ED 237 +#define XOR_N 238 +#define RST_28 239 +#define RET_P 240 +#define POP_AF 241 +#define JP_P 242 +#define DI 243 +#define CALL_P 244 +#define PUSH_AF 245 +#define OR_N 246 +#define RST_30 247 +#define RET_M 248 +#define LD_SP_HL 249 +#define JP_M 250 +#define EI 251 +#define CALL_M 252 +#define PREFIX_FD 253 +#define CP_N 254 +#define RST_38 255 + + + +/*--- CB Prefix opcodes: ---------------------------------------------*/ +#define RLC_B 0 +#define RLC_C 1 +#define RLC_D 2 +#define RLC_E 3 +#define RLC_H 4 +#define RLC_L 5 +#define RLC_xHL 6 +#define RLC_A 7 +#define RRC_B 8 +#define RRC_C 9 +#define RRC_D 10 +#define RRC_E 11 +#define RRC_H 12 +#define RRC_L 13 +#define RRC_xHL 14 +#define RRC_A 15 +#define RL_B 16 +#define RL_C 17 +#define RL_D 18 +#define RL_E 19 +#define RL_H 20 +#define RL_L 21 +#define RL_xHL 22 +#define RL_A 23 +#define RR_B 24 +#define RR_C 25 +#define RR_D 26 +#define RR_E 27 +#define RR_H 28 +#define RR_L 29 +#define RR_xHL 30 +#define RR_A 31 +#define SLA_B 32 +#define SLA_C 33 +#define SLA_D 34 +#define SLA_E 35 +#define SLA_H 36 +#define SLA_L 37 +#define SLA_xHL 38 +#define SLA_A 39 +#define SRA_B 40 +#define SRA_C 41 +#define SRA_D 42 +#define SRA_E 43 +#define SRA_H 44 +#define SRA_L 45 +#define SRA_xHL 46 +#define SRA_A 47 +#define SLL_B 48 +#define SLL_C 49 +#define SLL_D 50 +#define SLL_E 51 +#define SLL_H 52 +#define SLL_L 53 +#define SLL_xHL 54 +#define SLL_A 55 +#define SRL_B 56 +#define SRL_C 57 +#define SRL_D 58 +#define SRL_E 59 +#define SRL_H 60 +#define SRL_L 61 +#define SRL_xHL 62 +#define SRL_A 63 +#define BIT_0_B 64 +#define BIT_0_C 65 +#define BIT_0_D 66 +#define BIT_0_E 67 +#define BIT_0_H 68 +#define BIT_0_L 69 +#define BIT_0_xHL 70 +#define BIT_0_A 71 +#define BIT_1_B 72 +#define BIT_1_C 73 +#define BIT_1_D 74 +#define BIT_1_E 75 +#define BIT_1_H 76 +#define BIT_1_L 77 +#define BIT_1_xHL 78 +#define BIT_1_A 79 +#define BIT_2_B 80 +#define BIT_2_C 81 +#define BIT_2_D 82 +#define BIT_2_E 83 +#define BIT_2_H 84 +#define BIT_2_L 85 +#define BIT_2_xHL 86 +#define BIT_2_A 87 +#define BIT_3_B 88 +#define BIT_3_C 89 +#define BIT_3_D 90 +#define BIT_3_E 91 +#define BIT_3_H 92 +#define BIT_3_L 93 +#define BIT_3_xHL 94 +#define BIT_3_A 95 +#define BIT_4_B 96 +#define BIT_4_C 97 +#define BIT_4_D 98 +#define BIT_4_E 99 +#define BIT_4_H 100 +#define BIT_4_L 101 +#define BIT_4_xHL 102 +#define BIT_4_A 103 +#define BIT_5_B 104 +#define BIT_5_C 105 +#define BIT_5_D 106 +#define BIT_5_E 107 +#define BIT_5_H 108 +#define BIT_5_L 109 +#define BIT_5_xHL 110 +#define BIT_5_A 111 +#define BIT_6_B 112 +#define BIT_6_C 113 +#define BIT_6_D 114 +#define BIT_6_E 115 +#define BIT_6_H 116 +#define BIT_6_L 117 +#define BIT_6_xHL 118 +#define BIT_6_A 119 +#define BIT_7_B 120 +#define BIT_7_C 121 +#define BIT_7_D 122 +#define BIT_7_E 123 +#define BIT_7_H 124 +#define BIT_7_L 125 +#define BIT_7_xHL 126 +#define BIT_7_A 127 +#define RES_0_B 128 +#define RES_0_C 129 +#define RES_0_D 130 +#define RES_0_E 131 +#define RES_0_H 132 +#define RES_0_L 133 +#define RES_0_xHL 134 +#define RES_0_A 135 +#define RES_1_B 136 +#define RES_1_C 137 +#define RES_1_D 138 +#define RES_1_E 139 +#define RES_1_H 140 +#define RES_1_L 141 +#define RES_1_xHL 142 +#define RES_1_A 143 +#define RES_2_B 144 +#define RES_2_C 145 +#define RES_2_D 146 +#define RES_2_E 147 +#define RES_2_H 148 +#define RES_2_L 149 +#define RES_2_xHL 150 +#define RES_2_A 151 +#define RES_3_B 152 +#define RES_3_C 153 +#define RES_3_D 154 +#define RES_3_E 155 +#define RES_3_H 156 +#define RES_3_L 157 +#define RES_3_xHL 158 +#define RES_3_A 159 +#define RES_4_B 160 +#define RES_4_C 161 +#define RES_4_D 162 +#define RES_4_E 163 +#define RES_4_H 164 +#define RES_4_L 165 +#define RES_4_xHL 166 +#define RES_4_A 167 +#define RES_5_B 168 +#define RES_5_C 169 +#define RES_5_D 170 +#define RES_5_E 171 +#define RES_5_H 172 +#define RES_5_L 173 +#define RES_5_xHL 174 +#define RES_5_A 175 +#define RES_6_B 176 +#define RES_6_C 177 +#define RES_6_D 178 +#define RES_6_E 179 +#define RES_6_H 180 +#define RES_6_L 181 +#define RES_6_xHL 182 +#define RES_6_A 183 +#define RES_7_B 184 +#define RES_7_C 185 +#define RES_7_D 186 +#define RES_7_E 187 +#define RES_7_H 188 +#define RES_7_L 189 +#define RES_7_xHL 190 +#define RES_7_A 191 +#define SET_0_B 192 +#define SET_0_C 193 +#define SET_0_D 194 +#define SET_0_E 195 +#define SET_0_H 196 +#define SET_0_L 197 +#define SET_0_xHL 198 +#define SET_0_A 199 +#define SET_1_B 200 +#define SET_1_C 201 +#define SET_1_D 202 +#define SET_1_E 203 +#define SET_1_H 204 +#define SET_1_L 205 +#define SET_1_xHL 206 +#define SET_1_A 207 +#define SET_2_B 208 +#define SET_2_C 209 +#define SET_2_D 210 +#define SET_2_E 211 +#define SET_2_H 212 +#define SET_2_L 213 +#define SET_2_xHL 214 +#define SET_2_A 215 +#define SET_3_B 216 +#define SET_3_C 217 +#define SET_3_D 218 +#define SET_3_E 219 +#define SET_3_H 220 +#define SET_3_L 221 +#define SET_3_xHL 222 +#define SET_3_A 223 +#define SET_4_B 224 +#define SET_4_C 225 +#define SET_4_D 226 +#define SET_4_E 227 +#define SET_4_H 228 +#define SET_4_L 229 +#define SET_4_xHL 230 +#define SET_4_A 231 +#define SET_5_B 232 +#define SET_5_C 233 +#define SET_5_D 234 +#define SET_5_E 235 +#define SET_5_H 236 +#define SET_5_L 237 +#define SET_5_xHL 238 +#define SET_5_A 239 +#define SET_6_B 240 +#define SET_6_C 241 +#define SET_6_D 242 +#define SET_6_E 243 +#define SET_6_H 244 +#define SET_6_L 245 +#define SET_6_xHL 246 +#define SET_6_A 247 +#define SET_7_B 248 +#define SET_7_C 249 +#define SET_7_D 250 +#define SET_7_E 251 +#define SET_7_H 252 +#define SET_7_L 253 +#define SET_7_xHL 254 +#define SET_7_A 255 + + +/*--- ED opcodes: ----------------------------------------------------*/ +#define IN_B_xC 64 +#define OUT_xC_B 65 +#define SBC_HL_BC 66 +#define LD_xNNe_BC 67 +#define NEG 68 +#define RETN 69 +#define IM_0 70 +#define LD_I_A 71 +#define IN_C_xC 72 +#define OUT_xC_C 73 +#define ADC_HL_BC 74 +#define LD_BC_xNNe 75 +#define ED_4C 76 /* * NEG */ +#define RETI 77 +#define ED_4E 78 /* * IM 0/1 */ +#define LD_R_A 79 +#define IN_D_xC 80 +#define OUT_xC_D 81 +#define SBC_HL_DE 82 +#define LD_xNNe_DE 83 +#define ED_54 84 /* * NEG */ +#define ED_55 85 /* * RET */ +#define IM_1 86 +#define LD_A_I 87 +#define IN_E_xC 88 +#define OUT_xC_E 89 +#define ADC_HL_DE 90 +#define LD_DE_xNNe 91 +#define ED_5C 92 /* * NEG */ +#define ED_5D 93 /* * RET */ +#define IM_2 94 +#define LD_A_R 95 +#define IN_H_xC 96 +#define OUT_xC_H 97 +#define SBC_HL_HL 98 +#define LD_xNNe_HL 99 +#define ED_64 100 /* * NEG */ +#define ED_65 101 /* * RET */ +#define ED_66 102 /* * IM 0 */ +#define RRD 103 +#define IN_L_xC 104 +#define OUT_xC_L 105 +#define ADC_HL_HL 106 +#define LD_HL_xNNe 107 +#define ED_6C 108 /* * NEG */ +#define ED_6D 109 /* * RET */ +#define ED_6E 110 /* * IM 0 */ +#define RLD 111 +#define IN_F_xC 112 +#define ED_71 113 /* * OUT (C), 0 */ +#define SBC_HL_SP 114 +#define LD_xNNe_SP 115 +#define ED_74 116 /* * NEG */ +#define ED_75 117 /* * RET */ +#define ED_76 118 /* * IM 1 */ +#define ED_77 119 /* * NOP */ +#define IN_A_xC 120 +#define OUT_xC_A 121 +#define ADC_HL_SP 122 +#define LD_SP_xNNe 123 +#define ED_7C 124 /* * NEG */ +#define ED_7D 125 /* * RET */ +#define ED_7E 126 /* * IM 2 */ +#define ED_7F 127 /* * NOP */ +#define LDI 160 +#define CPI 161 +#define INI 162 +#define OUTI 163 +#define LDD 168 +#define CPD 169 +#define IND 170 +#define OUTD 171 +#define LDIR 176 +#define CPIR 177 +#define INIR 178 +#define OTIR 179 +#define LDDR 184 +#define CPDR 185 +#define INDR 186 +#define OTDR 187 +#define ED_FE 254 + + +/*--- DD xx opcodes: -------------------------------------------------*/ +/* Those are the DD xx opcodes where HL is treated as IX + a + signed byte displacement n when required: DD opcode n: */ + +/*--- FD xx opcodes: -------------------------------------------------*/ +/* Those are the FD xx opcodes where HL is treated as IY + a + signed byte displacement n when required: FD opcode n: */ + +#define ADD_IXY_BC 9 +#define ADD_IXY_DE 25 +#define LD_IXY_NN 33 +#define LD_xNN_IXY 34 +#define INC_IXY 35 +#define INC_IXYh 36 +#define DEC_IXYh 37 +#define LD_IXYh_N 38 +#define ADD_IXY_IXY 41 +#define LD_IXY_xNN 42 +#define DEC_IXY 43 +#define INC_IXYl 44 +#define DEC_IXYl 45 +#define LD_IXYl_N 46 +#define INC_xIXY 52 +#define DEC_xIXY 53 +#define LD_xIXY_N 54 +#define ADD_IXY_SP 57 +#define LD_B_IXYh 68 +#define LD_B_IXYl 69 +#define LD_B_xIXY 70 +#define LD_C_IXYh 76 +#define LD_C_IXYl 77 +#define LD_C_xIXY 78 +#define LD_D_IXYh 84 +#define LD_D_IXYl 85 +#define LD_D_xIXY 86 +#define LD_E_IXYh 92 +#define LD_E_IXYl 93 +#define LD_E_xIXY 94 +#define LD_IXYh_B 96 +#define LD_IXYh_C 97 +#define LD_IXYh_D 98 +#define LD_IXYh_E 99 +#define LD_IXYh_IXYh 100 +#define LD_IXYh_IXYl 101 +#define LD_H_xIXY 102 +#define LD_IXYh_A 103 +#define LD_IXYl_B 104 +#define LD_IXYl_C 105 +#define LD_IXYl_D 106 +#define LD_IXYl_E 107 +#define LD_IXYl_IXYh 108 +#define LD_IXYl_IXYl 109 +#define LD_L_xIXY 110 +#define LD_IXYl_A 111 +#define LD_xIXY_B 112 +#define LD_xIXY_C 113 +#define LD_xIXY_D 114 +#define LD_xIXY_E 115 +#define LD_xIXY_H 116 +#define LD_xIXY_L 117 +#define LD_xIXY_A 119 +#define LD_A_IXYh 124 +#define LD_A_IXYl 125 +#define LD_A_xIXY 126 +#define ADD_IXYh 132 +#define ADD_IXYl 133 +#define ADD_xIXY 134 +#define ADC_IXYh 140 +#define ADC_IXYl 141 +#define ADC_xIXY 142 +#define SUB_IXYh 148 +#define SUB_IXYl 149 +#define SUB_xIXY 150 +#define SBC_IXYh 156 +#define SBC_IXYl 157 +#define SBC_xIXY 158 +#define AND_IXYh 164 +#define AND_IXYl 165 +#define AND_xIXY 166 +#define XOR_IXYh 172 +#define XOR_IXYl 173 +#define XOR_xIXY 174 +#define OR_IXYh 180 +#define OR_IXYl 181 +#define OR_xIXY 182 +#define CP_IXYh 188 +#define CP_IXYl 189 +#define CP_xIXY 190 +#define POP_IXY 225 +#define EX_IXY_xSP 227 +#define PUSH_IXY 229 +#define JP_IXY 233 +#define LD_SP_IXY 249 + + + + +/*--- DD CB Prefix opcodes: ------------------------------------------*/ +/* Those are the CB xx opcodes where HL is treated as IX + a + signed byte displacement n: DD CB n opcode: */ +/*--- FD CB Prefix opcodes: ------------------------------------------*/ +/* Those are the CB xx opcodes where HL is treated as IY + a + signed byte displacement n: FD CB n opcode: */ + +#define RLC_IXYh 4 +#define RLC_IXYl 5 +#define RLC_xIXY 6 +#define RRC_IXYh 12 +#define RRC_IXYl 13 +#define RRC_xIXY 14 +#define RL_IXYh 20 +#define RL_IXYl 21 +#define RL_xIXY 22 +#define RR_IXYh 28 +#define RR_IXYl 29 +#define RR_xIXY 30 +#define SLA_IXYh 36 +#define SLA_IXYl 37 +#define SLA_xIXY 38 +#define SRA_IXYh 44 +#define SRA_IXYl 45 +#define SRA_xIXY 46 +#define SLL_IXYh 52 +#define SLL_IXYl 53 +#define SLL_xIXY 54 +#define SRL_IXYh 60 +#define SRL_IXYl 61 +#define SRL_xIXY 62 +#define BIT_0_IXYh 68 +#define BIT_0_IXYl 69 +#define BIT_0_xIXY 70 +#define BIT_1_IXYh 76 +#define BIT_1_IXYl 77 +#define BIT_1_xIXY 78 +#define BIT_2_IXYh 84 +#define BIT_2_IXYl 85 +#define BIT_2_xIXY 86 +#define BIT_3_IXYh 92 +#define BIT_3_IXYl 93 +#define BIT_3_xIXY 94 +#define BIT_4_IXYh 100 +#define BIT_4_IXYl 101 +#define BIT_4_xIXY 102 +#define BIT_5_IXYh 108 +#define BIT_5_IXYl 109 +#define BIT_5_xIXY 110 +#define BIT_6_IXYh 116 +#define BIT_6_IXYl 117 +#define BIT_6_xIXY 118 +#define BIT_7_IXYh 124 +#define BIT_7_IXYl 125 +#define BIT_7_xIXY 126 +#define RES_0_IXYh 132 +#define RES_0_IXYl 133 +#define RES_0_xIXY 134 +#define RES_1_IXYh 140 +#define RES_1_IXYl 141 +#define RES_1_xIXY 142 +#define RES_2_IXYh 148 +#define RES_2_IXYl 149 +#define RES_2_xIXY 150 +#define RES_3_IXYh 156 +#define RES_3_IXYl 157 +#define RES_3_xIXY 158 +#define RES_4_IXYh 164 +#define RES_4_IXYl 165 +#define RES_4_xIXY 166 +#define RES_5_IXYh 172 +#define RES_5_IXYl 173 +#define RES_5_xIXY 174 +#define RES_6_IXYh 180 +#define RES_6_IXYl 181 +#define RES_6_xIXY 182 +#define RES_7_IXYh 188 +#define RES_7_IXYl 189 +#define RES_7_xIXY 190 +#define SET_0_IXYh 196 +#define SET_0_IXYl 197 +#define SET_0_xIXY 198 +#define SET_1_IXYh 204 +#define SET_1_IXYl 205 +#define SET_1_xIXY 206 +#define SET_2_IXYh 212 +#define SET_2_IXYl 213 +#define SET_2_xIXY 214 +#define SET_3_IXYh 220 +#define SET_3_IXYl 221 +#define SET_3_xIXY 222 +#define SET_4_IXYh 228 +#define SET_4_IXYl 229 +#define SET_4_xIXY 230 +#define SET_5_IXYh 236 +#define SET_5_IXYl 237 +#define SET_5_xIXY 238 +#define SET_6_IXYh 244 +#define SET_6_IXYl 245 +#define SET_6_xIXY 246 +#define SET_7_IXYh 252 +#define SET_7_IXYl 253 +#define SET_7_xIXY 254 + +#endif diff --git a/programs/emulator/e80/trunk/z80/z80.c b/programs/emulator/e80/trunk/z80/z80.c new file mode 100644 index 0000000000..33cfdaa284 --- /dev/null +++ b/programs/emulator/e80/trunk/z80/z80.c @@ -0,0 +1,407 @@ +/*===================================================================== + z80.c -> Main File related to the Z80 emulation code. + + Please read documentation files to know how this works :) + + Thanks go to Marat Fayzullin (read z80.h for more info), Raъl Gomez + (check his great R80 Spectrum emulator!), Philip Kendall (some code + of this emulator, such as the flags lookup tabled are from his fuse + Spectrum emulator) and more people I forget to name here ... + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Copyright (c) 2000 Santiago Romero Iglesias. + Email: sromero@escomposlinux.org + ======================================================================*/ + +#include "z80.h" +#include "tables.h" + + +/* RAM variable, debug toggle variable, pressed key and + row variables for keyboard emulation */ +extern byte *RAM; +extern int debug, main_tecla, scanl; + +extern int fila[5][5]; + +//extern char *tapfile; +//extern FILE *tapfile; +extern char *tfont; + +#include "macros.c" + + +/*==================================================================== + void Z80Reset( Z80Regs *regs, int cycles ) + + This function simulates a z80 reset by setting the registers + to the values they are supposed to take on a real z80 reset. + You must pass it the Z80 register structure and the number + of cycles required to check for interrupts and do special + hardware checking/updating. + ===================================================================*/ +void Z80Reset( Z80Regs *regs, int int_cycles ) +{ + /* reset PC and the rest of main registers: */ + regs->PC.W = regs->R.W = 0x0000; + + regs->AF.W = regs->BC.W = regs->DE.W = regs->HL.W = + regs->AFs.W = regs->BCs.W = regs->DEs.W = regs->HLs.W = + regs->IX.W = regs->IY.W = 0x0000; + + /* Make the stack point to $F000 */ + regs->SP.W = 0xF000; + + /* reset variables to their default values */ + regs->I = 0x00; + regs->IFF1 = regs->IFF2 = regs->IM = regs->halted = 0x00; + regs->ICount = regs->IPeriod = int_cycles; + + regs->IRequest = INT_NOINT; + regs->we_are_on_ddfd = regs->dobreak = regs->BorderColor = 0; + +//#ifdef _DEBUG_ + regs->DecodingErrors = 1; +//#endif + +} + + +/*==================================================================== + word Z80Run( Z80Regs *regs, int numopcodes ) + + This function does the whole Z80 simulation. It consists on a + for(;;) loop (as stated on Marat's Fayzullin HOWTO -How to + Write a Computer Emulator-) which fetchs the next opcode, + interprets it (using a switch statement) and then it's + executed in the right CASE: of that switch. I've put the different + case statements into C files included here with #include to + make this more readable (and programming easier! :). + + This function will change regs->ICount register and will execute + an interrupt when it reaches 0 (or <0). You can then do anything + related to your machine emulation here, using the Z80Hardware() + function. This function must be filled by yourself: put there + the code related to the emulated machine hardware, such as + screen redrawing, sound playing and so on. This functions can + return an special value to make Z80Run stop the emulation (and + return to the caller): that's INT_QUIT. If there is time to + execute an interrupt, please return INT_IRQ or INT_NMI. Return + INT_NOINT if there is no time for an interrupt :) . + + Z80Execute() will change PC and all the z80 registers acording + to the executed opcode, and those values will be returned when + a INT_QUIT is received. + + Pass as numcycles the number of clock cycle you want to execute + z80 opcodes for or < 0 (negative) to execute "infinite" opcodes. + ===================================================================*/ +word Z80Run( Z80Regs *regs, int numcycles ) +{ + /* opcode and temp variables */ + register byte opcode; + eword tmpreg, ops, mread, tmpreg2; + unsigned long tempdword; + register int loop; + unsigned short tempword; + + /* emulate cycles */ + loop = (regs->ICount - numcycles); + + /* this is the emulation main loop */ + while( regs->ICount > loop ) + { + #ifdef DEBUG + /* test if we have reached the trap address */ + if( regs->PC.W == regs->TrapAddress && regs->dobreak != 0 ) + return(regs->PC.W); + #endif + + if( regs->halted == 1 ) + { r_PC--; AddCycles(4); } + + /* read the opcode from memory (pointed by PC) */ + opcode = Z80ReadMem(regs->PC.W); + regs->PC.W++; + + /* increment the R register and decode the instruction */ + AddR(1); + switch(opcode) + { + #include "opcodes.c" + case PREFIX_CB: + AddR(1); + #include "op_cb.c" + break; + case PREFIX_ED: + AddR(1); + #include "op_ed.c" + break; + case PREFIX_DD: + case PREFIX_FD: + AddR(1); + if( opcode == PREFIX_DD ) + { + #define REGISTER regs->IX + regs->we_are_on_ddfd = WE_ARE_ON_DD; + #include "op_dd_fd.c" + #undef REGISTER + } + else + { + #define REGISTER regs->IY + regs->we_are_on_ddfd = WE_ARE_ON_FD; + #include "op_dd_fd.c" + #undef REGISTER + } + regs->we_are_on_ddfd = 0; + break; + } + + /* patch ROM loading routine */ + // address contributed by Ignacio Burgueсo :) +// if( r_PC == 0x0569 ) + if( r_PC >= 0x0556 && r_PC <= 0x056c ) + Z80Patch( regs ); + + /* check if it's time to do other hardware emulation */ + if( regs->ICount <= 0 ) + { + tmpreg.W = Z80Hardware(regs); + regs->ICount += regs->IPeriod; + loop = regs->ICount + loop; + + /* check if we must exit the emulation or there is an INT */ + if( tmpreg.W == INT_QUIT ) + return( regs->PC.W ); + if( tmpreg.W != INT_NOINT ) + Z80Interrupt( regs, tmpreg.W ); + } + } + + return(regs->PC.W); +} + + + +/*==================================================================== + void Z80Interrupt( Z80Regs *regs, word ivec ) + ===================================================================*/ +void Z80Interrupt( Z80Regs *regs, word ivec ) +{ + word intaddress; + + /* unhalt the computer */ + if( regs->halted == 1 ) + regs->halted = 0; + + if( regs->IFF1 ) + { + PUSH(PC); + regs->IFF1 = 0; + switch(regs->IM) + { + case 0: r_PC = 0x0038; AddCycles(12); break; + case 1: r_PC = 0x0038; AddCycles(13); break; + case 2: intaddress = (((regs->I & 0xFF)<<8) | 0xFF); + regs->PC.B.l = Z80ReadMem(intaddress); + regs->PC.B.h = Z80ReadMem(intaddress+1); + AddCycles(19); + break; + } + + } + +} + + +/*==================================================================== + word Z80Hardware(register Z80Regs *regs) + + Do here your emulated machine hardware emulation. Read Z80Execute() + to know about how to quit emulation and generate interrupts. + ===================================================================*/ +word Z80Hardware( register Z80Regs *regs ) +{ + if( + debug != 1 // && scanl >= 224 + ) + { + ; + } + return( INT_IRQ ); +} + + +/*==================================================================== + void Z80Patch( register Z80Regs *regs ) + + Write here your patches to some z80 opcodes that are quite related + to the emulated machines (i.e. maybe accessing to the I/O ports + and so on), such as ED_FE opcode: + + case ED_FE: Z80Patch(regs); + break; + + This allows "BIOS" patching (cassette loading, keyboard ...). + ===================================================================*/ +void Z80Patch( register Z80Regs *regs ) +{ + +///!!! if( tapfile != NULL ) +///!!! { +///!!! LoadTAP( regs, tapfile ); +///!!! POP(PC); +///!!! } + + /* + if( strlen(tapfile) != 0 ) + { + if( LoadTapFile( regs, tapfile ) ) + { POP(PC); } + } + else + { + FileMenu( tfont, 3, tapfile ); + if( strlen(tapfile) != 0 ) + if( LoadTapFile( regs, tapfile ) ) + { POP(PC); } + } + */ +} + + +/*==================================================================== + byte Z80Debug( register Z80Regs *regs ) + + This function is written for debugging purposes (it's supposed to + be a debugger by itself!). It will debug a single opcode, given + by the current PC address. + + Return DEBUG_OK to state success and DEBUG_QUIT to quit emulation. + ===================================================================*/ +byte Z80Debug( register Z80Regs *regs ) +{ + return( DEBUG_QUIT ); +} + + + +/*==================================================================== + byte Z80MemRead( register word address ) + + This function reads from the given memory address. It is not inlined, + and it's written for debugging purposes. + ===================================================================*/ +byte Z80MemRead( register word address, Z80Regs *regs ) +{ + return(Z80ReadMem(address)); +} + + +/*==================================================================== + void Z80MemWrite( register word address, register byte value ) + + This function writes on memory the given value. It is not inlined, + ands it's written for debugging purposes. + ===================================================================*/ +void Z80MemWrite( register word address, register byte value, Z80Regs *regs ) +{ + Z80WriteMem( address, value, regs ); +} + + +/*==================================================================== + byte Z80InPort( register word port ) + + This function reads from the given I/O port. It is not inlined, + and it's written for debugging purposes. + ===================================================================*/ +byte Z80InPort( register word port ) +{ + int porth; + int code = 0xFF; + + porth = port >> 8; + + if (!(porth & 0x01)) code &= fila[4][1]; + if (!(porth & 0x02)) code &= fila[3][1]; + if (!(porth & 0x04)) code &= fila[2][1]; + if (!(porth & 0x08)) code &= fila[1][1]; + if (!(porth & 0x10)) code &= fila[1][2]; + if (!(porth & 0x20)) code &= fila[2][2]; + if (!(porth & 0x40)) code &= fila[3][2]; + if (!(porth & 0x80)) code &= fila[4][2]; + + /* + issue 2 emulation, thx to Raul Gomez!!!!! + I should implement this also: + if( !ear_on && mic_on ) + code &= 0xbf; + where earon = bit 4 of the last OUT to the 0xFE port + and micon = bit 3 of the last OUT to the 0xFE port + */ + code &= 0xbf; + + if( (port & 0xFF) == 0xFF ) + { + if( (rand() % 10) > 7 ) return(0xff); + else return( rand()%0xFF ); + } + + return( code ); +} + + +/*==================================================================== + void Z80OutPort( register word port, register byte value ) + + This function outs a value to a given I/O port. It is not inlined, + and it's written for debugging purposes. + ===================================================================*/ +void Z80OutPort( register Z80Regs *regs, + register word port, register byte value ) +{ + /* change border colour */ + if( ! (port & 0x01) ) + regs->BorderColor = (value & 0x07); +} + + + +/*==================================================================== + static void Z80FlagTables ( void ); + + Creates a look-up table for future flag setting... + Taken from fuse's sources. Thanks to Philip Kendall. + ===================================================================*/ +void Z80FlagTables(void) +{ + int i,j,k; + byte parity; + + for(i=0;i<0x100;i++) { + sz53_table[i]= i & ( FLAG_3 | FLAG_5 | FLAG_S ); + j=i; parity=0; + for(k=0;k<8;k++) { parity ^= j & 1; j >>=1; } + parity_table[i]= ( parity ? 0 : FLAG_P ); + sz53p_table[i] = sz53_table[i] | parity_table[i]; + } + + sz53_table[0] |= FLAG_Z; + sz53p_table[0] |= FLAG_Z; +} + diff --git a/programs/emulator/e80/trunk/z80/z80.h b/programs/emulator/e80/trunk/z80/z80.h new file mode 100644 index 0000000000..4ee01bef5d --- /dev/null +++ b/programs/emulator/e80/trunk/z80/z80.h @@ -0,0 +1,188 @@ +/*===================================================================== + z80.c -> Header file related to the Z80 emulation code. + + Please read documentation files to know how this works :) + + Thanks to Marat Fayzullin for writing the "How to write a Computer + Eemulator" HOWTO. This emulator is based on his tutorials and the + code organization (very readable!) of his "Z80 Portable Emulator". + I've learnt a lot from it, and I've taken some ideas of his code + to write this emulator.I think that almost all of the undocumented + Z80 opcodes are covered on this emulator. I also asked Marat + Fayzullin (by email) about ideas and so on (his Z80 emulator is + quite good, so go check it :-). + + Of course, I can't forget Raъl Gomez (he answered me thousands + of email questions) and Philip Kendall. Whitout his ___kind___ + people surely you won't be reading this file now... + + "Programming the Z80" (from Rodnay Zaks) and the comp.sys.sinclair + FAQ were another excelent sources of info! + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Copyright (c) 2000 Santiago Romero Iglesias. + Email: sromero@escomposlinux.org + ======================================================================*/ + + +#ifndef Z80_H +#define Z80_H + +#define USING_ALLEGRO + +#define DEBUG +#define _DEV_DEBUG_ /* development debugging */ +#define LOW_ENDIAN +/*#define HI_ENDIAN */ + +/* Used by the Z80Debug() function */ +#define DEBUG_OK 1 +#define DEBUG_QUIT 0 + + +#define video vscreen + + +/*=== Some common standard data types: ==============================*/ +typedef unsigned char byte; +typedef unsigned short word; +typedef unsigned long dword; +typedef signed char offset; + + +/*--- Thanks to Philip Kendall for it's help using the flags --------*/ +extern byte halfcarry_add_table[]; +extern byte halfcarry_sub_table[]; +extern byte overflow_add_table[]; +extern byte overflow_sub_table[]; +extern byte sz53_table[]; +extern byte sz53p_table[]; +extern byte parity_table[]; + +extern byte ioblock_inc1_table[]; +extern byte ioblock_dec1_table[]; +extern byte ioblock_2_table[]; + + +/*===================================================================== + Z80 Flag Register: --------------------------------- + | 7 6 5 4 3 2 1 0 | + --------------------------------- + | S Z x H x O/P N C | + --------------------------------- + If (1) means that: S = Negative result. + Z = Zero result. + x = special cases (by opcode) + H = Halfcarry/borrow. + O/P = Overflow/Parity Flag. + N = Substraction. + C = Carry/borrow. + ====================================================================*/ +#define S_FLAG 0x80 +#define Z_FLAG 0x40 +#define H_FLAG 0x10 +#define P_FLAG 0x04 +#define O_FLAG 0x04 +#define N_FLAG 0x02 +#define C_FLAG 0x01 + + +/* + Defines for interrupts and special Z80Hardware() codes: +======================================================================= + INT_QUIT = Exit the emulation (for Z80Run()) + INT_NOINT = No interrupt required + INT_IRQ = Standard RST 38h interrupt + INT_NMI = Non-maskerable interrupt +*/ +#define INT_QUIT 0xFFFE +#define INT_NOINT 0xFFFF +#define INT_IRQ 0x0038 +#define INT_NMI 0x0066 + + + +/*=== A register is defined as follows: =============================*/ +typedef union +{ +#ifdef LOW_ENDIAN + struct + { + byte l,h; + } B; +#else + struct + { + byte h,l; + } B; +#endif + word W; +} eword; + + +#define WE_ARE_ON_DD 1 +#define WE_ARE_ON_FD 2 + +/*=== Now we define the Z80 registers using the previous definition =*/ +typedef struct +{ + char machine_type; + byte *RAM; + int we_are_on_ddfd; + + /* general and shadow z80 registers */ + eword AF, BC, DE, HL, IX, IY, PC, SP, R, + AFs, BCs, DEs, HLs; + + /* IFF and I registers, used on interrupts. */ + byte IFF1, IFF2, I, halted; + char IM; + word IRequest; + + /* the following is to take care of cycle counting */ + int IPeriod, ICount, IBackup; + + /* DecodingErrors = set this to 1 for debugging purposes in order + to trap undocumented or non implemented opcodes. + Trace = set this to 1 to start tracing. It's also set + when PC reaches TrapAddress value. */ + byte DecodingErrors; + word TrapAddress; + byte Trace, dobreak; + byte BorderColor; + +} Z80Regs; + + +/*==================================================================== + Function declarations, read the .c file to know what they do. + ===================================================================*/ +void Z80Reset( register Z80Regs *regs, int ); +void Z80Interrupt( register Z80Regs *, register word ); +word Z80Run( register Z80Regs *, int ); +byte Z80MemRead( register word, Z80Regs * ); +void Z80MemWrite( register word, register byte, Z80Regs * ); +byte Z80InPort( register word ); +void Z80OutPort( register Z80Regs *regs, register word, register byte ); +void Z80Patch( register Z80Regs * ); +byte Z80Debug( register Z80Regs * ); +word Z80Hardware( register Z80Regs * ); + +void Z80FlagTables(void); +word ParseOpcode( char *, char *, char *, word, Z80Regs * ); +word Z80Dissasembler ( Z80Regs *, char *, char * ); + +#endif diff --git a/programs/emulator/fceu/ChangeLog.txt b/programs/emulator/fceu/ChangeLog.txt new file mode 100644 index 0000000000..37febc734d --- /dev/null +++ b/programs/emulator/fceu/ChangeLog.txt @@ -0,0 +1,2183 @@ +0.98.12: + + Win32: Fixed the behavior of the sound logging function. + + Fixed a bug that was causing 2xscale/3xscale to be broken + when clipping the leftmost and rightmost 8 columns. + + Added an iNES header correction entry for JustBreed. + + Modified the MMC5 "ELROM" board emulation to not emulate WRAM. + + Corrected various pieces of code that were causing compiler warnings. + + Win32: Scaling settings(x, y, stretch to fill screen) are now respected while + using a special scaler in full screen mode, though if x or y scale is + less than what is needed for a particular scaler, it will be + adjusted. + + Win32: The window will be reblitted when it becomes invalidated while + a game is loaded(such as when you're resizing the window). + + When the PPU is in a "dead" state after starting up, the graphics + buffer is now cleared. Previously, particularly in the Windows port, when + a game was closed, and a new game was loaded, the last image from + the previous game would be displayed for a short time. + + Win32: Blit skipping will now occur when sound is disabled and FCE Ultra is + running behind the desired frame rate. + + Win32: Blit-skipping behavior can now be configured to some extent in the "Timing" configuration + window. + + Win32: Added a "Recent Directories" submenu to the "File" menu. + + Removed some debugging code that shouldn't have been enabled in 0.98.11. + +0.98.11: + + Win32: Special scalers are now also supported in windowed mode. For Scale2x/Scale3x, + the fastest "desktop" bit depth is 16bpp. For hq2x/hq3x, it is 32bpp. + + The shared video blitting code(drivers/common/vidblit.c) can now blit using Scale2x + and Scale3x to any target bit depth(8bpp, 16bpp, 24bpp, and 32bpp) instead of just + 8bpp, as it was before. + HQ2x and HQ3x can now blit to 16bpp, 24bpp(untested), and 32bpp. The 16bpp and + 24bpp targets are done doing post-processing conversion, after HQ2x/HQ3x, which + really does hurt speed. + + Changed a few names in the credits section of the documentation to their + aliases. Names you didn't get to pick to have are so troublesome. :b + I also made various fixes/updates to the documentation. + + Updated the FAQ with some information regard video mode bit depths and speed. + + SDL: Disabled the fast-forward-key speed-limiting code. I thought I had + done this before... + + Fixed a major bug in the movie recording code, and added some code to automatically detect + and fix playback of broken movies from earlier versions. + + Did a little swapping thing with mapper 90 and 209. I moved back Mortal Kombat 3 + to mapper 90, and moved Shin Samurai Spirits 2 to mapper 209. Sorry for any confusion. + Mapper 90 should be considered as having the fancy nametable select mode disabled, with + mapper 209 having it enabled. + + Added support for mapper 160, which turns out to be the same hardware as mapper + 90. Joy. + + Improved mapper 90 emulation. This mapper really needs low-level + emulation for IRQs to work right, though. :/ + + Win32: Fixed the "hide left/right 8 video columns" feature. + + Since FCE Ultra is ending(or has already exceeded? :b) its actively-updated life, + I've gone ahead and added per-game hacks for "Kick Master" and the PAL version + of "Star Wars". See the documentation for more details. + + Minor optimizations to the high-quality sound emulation code. The FIR filter + code is the bottleneck, though, so these changes won't have much of an effect + on overall speed. + + Altered MMC3 IRQ emulation(and the hooks in ppu.c for it). + + Fixed a rather major typo in the VRC7-emulation code. + +0.98.10: + + Reimplemented network play. It now requires a standalone network play server, which + will be released as a later time. For fun, "starmen.net" is running this server, + which is publicly accessible. + I also made various code fixes/improvements to allow for network play, particularly + with the command handling code. + + Reworked much of the VS Unisystem emulation code, partially based on information from + MAME. The following games are now supported: + + Battle City + Castlevania + Clu Clu Land + Dr. Mario + Duck Hunt + Excitebike + Excitebike (Japanese) + Freedom Force + Goonies, The + Gradius + Gumshoe + Hogan's Alley + Ice Climber + Ladies Golf + Mach Rider + Mach Rider (Japanese) + Mighty Bomb Jack (Japanese) + Ninja Jajamaru Kun (Japanese) + Pinball + Pinball (Japanese) + Platoon + RBI Baseball + Slalom + Soccer + Star Luster + Stroke and Match Golf + Stroke and Match Golf - Ladies + Stroke and Match Golf (Japanese) + Super Mario Bros. + Super Sky Kid + Super Xevious + Tetris + TKO Boxing + Top Gun + + Win32-native: Fixed a bug in the debugger's breakpoint list that appeared when + one tried to delete a breakpoint(the control accidentally had auto-sort enabled, + causing a discrepancy between what was displayed and what was contained in internal + data structures). + + The current disk image XOR original disk image is now stored in save states. This + should greatly increase compressability(important for network play), and make + it a little more legal to distribute such save states now. + + Modified the save state format to allow for more precise and larger version numbers. + + Various minor code changes. + + Fixed initialization of the FCEUGameInfo structure, which previously led + to problems with sound output on the SexyAL-using ports(Linux). + + Apparently I added support for mapper 255 a while back. Documentation updated. + + Added iNES header correction information for Armored Scrum Object and Alpha Mission. + + Merged banksw.h into ines.c, fixed some of its prototypes in ines.h. + +0.98.9: + + Win32-native: Fixed the speed throttling used when sound is disabled. In previous + 0.98.x Win32-native releases, emulation was running at 1/2 the speed it should + have been when sound was disabled. + + Win32-native: Moved settings in the "Miscellaneous" configuration window + to where they should have been in the first place, and added "GUI" and "Timing" + configuration windows to accommodate some. + + Win32-native: Fixed the handling of the "Scroll Lock" key used to disable and + enable Family BASIC Keyboard input. + + Updated documentation to handle some slight differences in the Win32-native + port("Win32-native" is what the Win32 port using native APIs, as opposed to something + like GTK+ and SDL, will be referred to in documentation now). I also made + some other minor wording adjustments to the documentation. + + Added an iNES header correction for Dragonball. + +0.98.8: + + Fixed a typo in sound.c that caused only part of the sound registers + to be saved in save states. + + Win32: Switched over to the DirectDraw7 interface, from DirectDraw4's. + The surface Flip() method will now block, which results in somewhat + smoother animation/scrolling, especially when combined with the + auto blit-skip implemented in 0.98.6 when sound is enabled. + + Win32: Undid a change made in the last release that limited the + speed of fast-forwarding when using the tilde key. I really do + need to implement some sort of unified timing/blit skip system... + + Win32: Added an option, disabled by default, to ask for confirmation + before exiting FCE Ultra. + + Win32: Added an option, enabled by default, to disable the system + screen saver while a game is loaded. + + Win32: Added a new video synchronization mode, a "lazy" wait for + vblank/vertical retrace. It calls Sleep(0) in its wait loop. This + still uses all available cpu cycles, but it is much more friendly + to other processes than the old-style wait for vblank. + + Win32: Added support for joystick POV hats. + +0.98.7: + + Fixed a bug in the debugger's disassembler when disassembling + opcode 0xBC. + + Fixed the behavior of the right mouse button with zapper emulation, to + correspond with what it is documented as doing. + + Win32: Added proper support for maximizing the window. + + Win32: Rewrote most of the input and input configuration code. + + Win32: Changed the configurable aspect ratio to something sensical, the current + display's pixel aspect ratio, default of 1:1(square pixels). + + Win32: Made the default full-screen video mode the custom video mode. I should have + done this a long time ago to make custom video mode configuration more straighforward + for users... + + Added some JACK audio code to be used by the SDL build. I'll test it and complete + it later. + +0.98.6: Made several code modifications to work with older versions of gcc. + + Fixed more header file network play #ifdef-age. + + Fixed a typo in cart.h. + + Fixed some funky code in FCEU_memmove(). + + Fixed some source code causing compiler warnings. + + Fixed SexyAL's format conversion code to not rely on deprecated casting semantics. + + Readded the native Win32 code, and made many improvements. The major thing + that needs to be done now with it is to rewrite the input handling code and input + configuration code. + +0.98.5: + Added LL to the 64-bit integer constants in ines.c + + Fixed OpenGL support under Mac OS X. + + Added the ability to hide background and/or sprites with the F4 key. + +0.98.4: + Moved NETWORK #ifdef's to netplay.c to simplify things. + + Fixed gzip file loading code(I think). I'm still a bit unsure about the semantics + of dup() and close(), though. + + Corrected FDS code to try loading the FDS image before loading the BIOS. + + Readded "native" SDL sound code, used for Mac OS X(and maybe BeOS). + +0.98.3: + Removed the wxWindows GUI code. GTK+ 2 code will take its place, + once it is ready. + + Added reset and power commands to the movie format. More commands(such as insert + disk, eject disk, flip dip switch, etc.) will be added simultaneously as work + on network play continues. + + Modified SexyAL OSS code to not adjust the number of fragments to a power of 2. + It works fine on my card, allowing finer-grained buffer size control, + but I'm not sure it will work with all chips. + + Fixed parsing of the "-specialfs" command-line argument. + + Added the hq3x scaler. + + Updated to the latest Scale2x code. I also added the Scale3x scaler. + + Changed the keyboard assignments for toggling full screen to "Alt" + "Enter". + + FCEUI_SaveState() and FCEUI_LoadState() changed. Porters should read + driver.h. + + Miscellaneous changes to accommodate new network play plan. It's not close + to being finished. + + Altered RTI emulation. In Paris Dakar Rally's NMI handler, it does "CLI ; RTI". + Previously, FCE Ultra would generate an interrupt right after RTI occured, due to the + presumed latency that RTI had with the I flag. I changed it so there is no latency, so + no interrupt will occur in this case(interrupts kill this game). The interrupt source + is the "frame IRQ", which it never disables, if anyone cares. + This change does break the "Stars SE" demo, though. Hmm. + + "FCEUGameInfo" is now a pointer, rather than just a statically-allocated structure. + This may cause some null-dereferencing-related crashes, but it should help keep + code a little cleaner(maybe?). + + Played around with the FDS FM code some more. It's still not right. Bah. + + Hacked in support for entering Datach/Barcode World barcodes without a GUI, using the + F8 key and the numeric keys. + + Added code to save/load movies. Movie support will only record/play back the + states of the four emulated gamepads. + + Modified the sound code to use timestamp/timestampbase differently. In addition, + timestampbase is now saved in save states("timestamp" doesn't need to be saved, since + it's reset to 0 at the end of each emulated frame). + +0.98.2: + Fixed a few problems with the SDL command-line build code + for Win32. Also, SDL 1.2.7 seems to have a bug that breaks FCE Ultra's + full-screen/windowed switching capabilities(at least under Win32). + Stupid everything. + + Minor SexyAL changes. + + Updated documentation. + +0.98.1: + + Increased the volume of the FME07 sound channels. + + Fixed a bug in the SexyAL endian conversion code. + + Made the SexyAL chunk conversion loop work. + + Replaced the old OPL2 emulator with a modified version of + Mitsutaka Okazaki's YM2413 emulator for the VRC7 sound emulation. + + Decreased the pitch of the FME 07 expansion sound channels by one octave. + + Decreased volume of output of $5011 in MMC5 emulation code. + + +0.98.0: Some changes I made aren't listed below. Ah well. The magnitude + of the changes was too great... + + + Default sound volume is 100(%), which makes a lot more sense than 75%, but not much. + It's multiplied by 3/4 internally now. + + Added support for the Datach barcode reader(GUI interface only). The emulation code + was adapted from the VirtuaNES source code. + + Reassigned the Datach games to mapper 157, from 16, with CRC32 checks. + + Increased the maximum number of screen snapshots in the snapshots directory + to 99999(from 999). + + Reassigned the following games to mapper 210, using CRC32 checks: + Chibi Maruko Chan + Dream Master + Family Circuit '91 + Famista '92 + Famista '93 + Famista '94 + Heisei Tensai Bakabon + Top Striker + Wagyan Land 2 + Wagyan Land 3 + If you use a hack/translation of one or more of these games, you will of course + need to manually change the mapper number in the header for it to work properly in + FCE Ultra. Family Circuit '91 still may not fit in with the rest of these games, + but it's definitely not a "stock" mapper 19 setup. + + Fixed an OpenGL palette bug when using scanlines(previously, I think it was + setting the palette of the scanlines overlay texture instead of the actual image + texture in some instances). The bug showed up on games that make use of the color + deemphasis bits. + + Rewrote a lot of the PPU background rendering code to be more accurate(and + obfuscated!). This eliminates the X-offset hack I made earlier. + + Removed some of the NSF visualization code, and altered the look of the NSF + display slightly. The NSF waveform visualization code will now take into + account the current volume setting. + + Changed the default key bindings for the standard emulated gamepad + to something more compatible with window managers. I may change it back, but probably + not, since it is easily configurable now. + + Updated the MMC5, VRC6, and FME07 low-quality sound emulation code + with the compatible parts of the high-quality sound emulation code for those chips. + + Adjusted timing of horizontal scroll update(near the beginning of hblank. I made + it occur sooner). I also added a hack to allow X-offset(fine X scroll) changes mid + scanline, however, it is extremely ugly, and may not work correctly for everything + (doing it correctly would probably kill speed). + I mainly did it to fix games like F-1 Race and Mach Rider, and other racing + games that are extremely sensitive to horizontal scrolling timing. + + Some FDS IRQ emulation changes to fix some screen corruption problems + in "Kaettekita Mario Bros". + + Removed zlib(the code, not support). + I also removed support for compiling without zlib(it's small, simple, provides + very useful functions, and may provide critical features for fceu in the future). + + *undone, breaks debugger, FIXME.* Replaced some inline functions with macros in x6502.c. + + Increased the speed of Namco 106 sound emulation in HQ sound mode. + + Many many sound emulation changes and adjustments based on blargg's tests. + The default sound volume is about 150% what it was before, because the sound range + has changed(now -soundvol 100 is like -soundvol 200 on older builds), and the + default "soundvol" setting is 75. 100 clips on some Namco games, and 200 clips + on many games, so I'll probably have the configurable volume range as [0:125]. + What exactly is "%" supposed to mean in this case.... 100% of what?! + + When using low-quality sound emulation mode, total emulation speed is about 10% + less than previous builds. The change in speed for high-quality sound emulation + mode is significantly less. + + Added beginnings of SexyAL to source code tree, removed SDL sound support, and + old OSS code. + + Copied over some autoconf/automake stuff from phamicom. It stills needs a bit + of work... + + Fixed DMC IRQ emulation. Fixes many CodeMasters games. Finally. ^_^ + + Restructured a lot of files, changed the interface between driver and + emulator code slightly. + + * Insert stuff here * + +November 28, 2003 - Snapshot + + Removed the DOS, Linux SVGAlib, and Win32 targets. *GASP* + Win32 support will return(eventually), using SDL + wxWindows. + SDL can use svgalib or GGI anyway, so it shouldn't be a huge loss. + DOS support will only return if someone ports SDL to DOS. ^_^ + It would be nice if SDL could accept modelines. Maybe in SDL 2.0... + + Merged fce.c and svga.c into fceu.c, and fce.h and svga.h into fceu.h. + + Reassigned "Mortal Kombat 3 - Special 56 Peoples" to mapper 209. + + Added emulation of the "Oeka Kids" tablet. + + Added emulation of the Family Trainer. + + Added emulation of the "Ultimate Quiz King" buzzers. + + Added emulation of the Mahjong controller. + + Added emulation of HyperShot controllers. + + Fixed loading of NSFs with load addresses below $8000. + + Cleaned and simplified some of the NES APU code. + + Altered mapper 65 emulation. Fixes Kaiketsu Yanchamaru 3. Does it break anything? + + Wrote a small FAQ file. + + Fixed displaying of garbage and other unpleasantness on the first scanline. I need + to clean up that code, though. + + Fixed color deemphasis emulation when all bits are set. For some + reason, I had commented out the code. Bleh. + + NSF player now writes $C0 to $4017 if the FDS is being used(the FDS + BIOS writes $C0 to $4017). $40 for all other NSFs. + + Added support for iNES mapper 58(nnnesterj). + + Added support for iNES mapper 208. + + Reassigned "Fudou Myouou Den" to mapper 207(CRC32 checks). + + Reassigned "Karnov" to mapper 206(CRC32 checks). + + Fixed the mapper 95 code, which was horribly broken. + + Differentiated between mappers 33 and 48. Added CRC checks to assign + some games to mapper 48. "Flintstones 2" and "Don Doko Don 2" are + the games that need to be assigned to 48. Are there others? + + Replaced usage of TriggerIRQ to X6502_IRQBegin/X6502_IRQEnd combos in + various mapper emulation files. 67, 33/48, 40, 73, 42, 65, 6, 182 + Removed function TriggerIRQ() from x6502.c + + Fixed the sound volume of the VRC7 emulation in high-quality sound mode. + Decreased(slightly) the volume of VRC7 emulation in both high-quality sound modes. + + Decreased the volume of the MMC5 expansion sound channels. + + Decreased the volume of the FME-7/mapper 69 expansion sound channels. + + Added FCEU_gmalloc(), which will call exit() if memory allocation fails, + otherwise it is guaranteed to return a memory block. + This will be used in the mapper code mainly. It should only + be used for small memory chunks. The reasoning is that if 64 some like KB of + RAM or less can't be allocated, for example, it'd probably be best to + exit the emulator ASAP. It also helps to simplify code logic, and + help (me) with modularization. + The behavior of this may change in the future. I still need to think about it. + I should probably save the configuration file regularly(or much better, + use the registry) on the Windows port, though. + + Cleaned up the save-state saving/loading code a bit, and added + support for linked save state structures for better modularity and + less code duplication. + + Merged the iNES and UNIF MMC1, MMC3, and MMC5 code more completely. + I may need to sanify CHR RAM and WRAM allocation for pedanticness, + though. Also worked on Tengen RAMBO-1 emulation, and mapper 90 emulation. + ***THIS MAKES SAVE STATES FOR GAMES THAT USE THESE EXPANSION CHIPS INCOMPATIBLE + WITH PREVIOUS VERSIONS*** + I plan on doing the same thing with other mappers/boards in the future, though. + Always on the quest for 1.0... + +November 12, 2003 - 0.97.5 Release + + Windows: Added limited support for arguments that change configuration + to be passed to FCE Ultra. Example: fceu -pal 1 c:\streetgangs.nes + It may be useful in frontends. + + Fixed filename generation for automatic IPS patching when a file + with no extension is loaded. Before this change, FCEU would + look for "game..ips" with a file named "game". + + Converted and updated the cheat guide in(to) HTML. + + Added support for iNES mappers 202,203,231 from info from cah4e3. + Fixed support for mappers 60, 200. + + Fixed various major bugs in the breakpoint deletion code. + + UN*X: Added support for OSS(/dev/dsp) devices that don't support mono + sound. + + Increased PPU startup idle time to 2 frames. Fixes that + unlicensed "Earthworm Jim 3" game. Does it break anything? + +November 9, 2003 - 0.97.4 Release + + Fixed another obscure PPU emulation screen corruption bug. + + Added support for Game Genie cheats in the cheat interface. + + Windows: Reworked the cheat interface, merging the cheat search + and cheat list windows into one. + + Windows: Greatly improved the CPU debugger. + The code still needs a lot of cleaning, though. + + Readjusted VRC6 IRQ emulation timing. + + Added support for the UNIF MMC3 board TEROM. The maximum PRG/CHR sizes + may not be correct in this implementation, though. + +November 8, 2003 - 0.97.3 Release + + Added a control to set the highest quality sound mode in Windows. + This change requires that any users who previously set + "high quality sound" to set it again. + + Fixed the volume of high-quality sound mode again. The changes + I made earlier didn't affect all the filter coefficients. + +November 8, 2003 - 0.97.2 Release + + Made a minor optimization to writes to palette memory. + + Altered VRC6 IRQ emulation timing slightly. + + Fixed a weirdo PPU emulation bug that could cause garbage on the right + side of the screen in certain situations. Thanks to FrenziedPanda for + bugging me enough to make me look into the problem and fix it. + I should be on the lookout to see if the fix breaks anything, though. + + Fixed the volume of high-quality sound mode(-soundq 1). It was + at 1/4 the volume it should have been. I compensated by increasing + the precision of the filter coefficients, which increased the sound + quality of that mode slightly without hurting performance. + +November 7, 2003 - 0.97.1 Release + + Fixed mapper 105 emulation. I had begun merging it into the + rest of the MMC1 code for 0.97, but I hadn't finished it. + + Changed things like RdMem(_PC++); to RdMem(_PC); _PC++; + Darn evil global variables. I need to fix them. Screw speed. + + Expanded checks for the global variable "fceuindbg"(used in debug + mode to prevent reads in the debugger from altering any registers). + +November 6, 2003 - 0.97 Release + * Note: I still had much more I had wanted to get done for 0.97, + but I lost even more interest. The Windows port still doesn't + have a way to enable the "highest" sound emulation mode, nor the + low pass filter code, not to mention that the lowpass filter code + isn't complete(I would need to design a high-order FIR filter from an IIR + filter to work properly-have the correct rolloff, among other + things-at finite playback rates). + + Fixed a bug in the IPS patcher. The recorded size wasn't being updated + after a successful realloc() was made, which could lead to corrupted patch + data from some patches. + + Added support for mappers 200, 201 from submitted code. + + Rewrote mapper 15 support to make more sense(well, depending + on your point of view...). + + Fixed 256KB CHR select support for mapper 115. + + Added support for mapper 12 from code from cah4e3. + +October 16, 2003 - Snapshot + + Fixed support for mapper 245(for nonencrypted/non-smynes-screwed up + ROM images only. Fixes "Yong Zhe Dou E Long [...] Dragon Quest 7". + + Added support for mappers 60, 62, 230, 244 from submitted code. + + Modified mapper 90 emulation to allow game-select on reset + for "Final Fight 3". + + Modified mapper 45 emulation to allow "Super 8-in-1" to work. + + Added a low-pass filter, and an option to enable it(CLI ports). + + 0x00 is now written to $4011 in the NSF player code instead of 0x40. + Fixed some other similar sound register init problems that I had fixed + in Festalon but forgot to fix in FCEU. Grrr. + + Removed some unnecessary 64-bit integer usage from FIR sound filtering + code. + + Added a new sound quality mode. Higher than high, it's highest(in + FCE Ultra, for now). Still need to fix the interface to allow + enabling it in the Windows port. + + Added some code for lower-level MMC3 IRQ emulation. It isn't completed + , and will not work properly as-is. I'm still playing around with + it occasionally. + + Fixed the sprite overflow flag(I think I fixed it), that was broken in an earlier + pre-0.97 release. + + Fixed support for iNES mapper 193. + + Command line arguments "-pal" and "-gg" now take extra arguments(1/0) + and are remembered in the configuration file. + +September 27, 2003 - Snapshot + + Added support for iNES mapper 50. + + Modified the UNIF board initialization code. Hopefully, this + new interface will eventually be used with the iNES code. + + Miscellaneous code cleanups. + + /dev/dsp is now set to 8(previously 9) buffers of 128 samples in length + in the SDL code. + + Tried to make the save state code more expandable and modular. + + Moved a lot of the PPU code into ppu.c. + + Added more extensive debugging code to the 6502 emulator, to allow + for memory read/write hooks(including zero page addressing modes). + + Readadjusted DMC timings when PAL emulation is enabled. It looks + like it was correct before I had made the August 2 change. Thanks + to Bananmos for the information. I think. :/ + + Added support for iNES mapper 193 from information from virtuanes. + I think my dump of it is "bad", though. PRG and CHR pages look + like they are in the wrong order(logical vs physical? Who's to say + what's physical?). + +September 1, 2003 - Snapshot + + Fixed some minor initialization issues with iNES mappers 7 and 34. + + Added support for UNIF board NES-GNROM. + + Removed support for save states created with versions of FCE Ultra + less than 0.56. + + Replaced SDL sound buffering code with a lock-free FIFO implementation + written by David Olofson, with a few modifications by myself. + + Fixed a VRC7 NSF bug(it showed up under the reworked driver/file + loading order in the cli code). + + The board in "Rolling Thunder" has "RAMBO 1" on it, not "RAMBO-1". + +August 9, 2003 - Snapshot + + Removed the old plain text documentation and replaced it with + a new document in HTML. It is not completed yet, though. + + Rewrote the SDL-native audio code to be less wacky and more + thread-safe(hopefully). I'm still waiting for a new SDL audio + API... + + Altered the MMC5 IRQ timing. Fixes minor graphical glitches + in Castlevania 3. Does it break anything? + + Removed some debugging code that got into the last snapshot. + +August 5, 2003 - Snapshot + + Added some code in the IPS patcher to allow for expanding the size of files. + + Fixed a double free() bug with a mapper 51 game(in ines.c). + + Added support for "Alien Syndrome" (US release) as iNES mapper 158. + It looks like a derivative of the normal RAMBO-1 board(or is that + the name of the chip?), similar to TKSROM/TLSROM(mapper 118). + + Improved the "native" SDL sound code. It will now call SDL_Delay(), + among other nice things. The code could probably be improved more, + though. + + Added support for decimal components in xscale/yscale in the SDL + port. Set the default xscale for windowed mode to 2.40(to get a + more correct aspect ratio, assuming the display is currently at + a 4:3 aspect ratio). + + Modified args.c to handle floating-point numbers. + +August 2, 2003 - Snapshot. + + Disabled texture wrapping with OpenGL(there were problems at the edges + of the screen with linear interpolation). Bah. Now the edges + are too bright... + + Improved the accuracy of the DMC timing when PAL emulation is enabled. + I still don't think it's totally correct, though. + + Changed the default settings for the SDL code. Full screen + is now 640x480x8bpp by default, xscale and yscale are 2 for both full + screen and windowed, opengl support is enabled, linear interpolation + for OpenGL is enabled, and X-axis stretching is + enabled(in full screen). + + "Scanlines" were enabled in 8bpp to 8bpp blits in + drivers/common/vidblit.c when they shouldn't have been. Fixed. + + Fixed OpenGL code under big-endian platforms. + +August 1, 2003 - Snapshot. + + Various code clean-ups. + + Played around with adding a GTK+ GUI to the SDL code. + + Rewrote part of the hq sound rectangle wave code. + + Replaced the high-quality sound inline assembly filter code with + slightly faster C code. + + Hacked around with GP32 support. I don't know if the GP32 would + be fast enough, though. + + Skipped frames will now have D5 of $2002 set at the beginning + of the frame. Fixes "Bee 52". I must see if it breaks anything. + + Added OpenGL support to the SDL code. + + Removed the PPU drawing inline assembly code, replacing it with a faster + algorithm written in C. + + "Disabling" the 8-sprite limitation will no longer cause + "Bee 52" to break. However, the "Solstice" wizard will still + have the weird thing growing out of his face in the introduction, + since it depends on no more sprites to be rendered. + + Added entry for that Black Bass game for header corrections in + ines.c + + Strip color burst bit(D0 of $2001) is only "emulated" if bg or + sprite rendering are turned on, at the end of the scanline. + Doing it with pixel/tile granularity would require modifying + the sprite graphics data copying routine, which I don't + feel like doing. Fixes that crazy Sayoonara demo by Chris Covell. + I also modified the NES RAM initialization code. + + Adjusted VRC7 IRQ emulation for better Lagrange Point goodness. + + Added support for iNES mapper 91. (VirtuaNES) + +0.96: + Improved RAMBO-1(mapper 64) emulation. "Skull and Crossbones" is + now playable. + +0.95: + + timestamp and timestampbase are no longer saved/loaded to/from + save states. They were causing too many problems I didn't + want to fix, and I never intended them to be saved in save states + when I wrote the code that uses them. + I think the reason they were being saved was that I wanted to make it + possible to add movie support and network play save state loading + (distributing the save state over the network). So if someone in + the future wants to add these features, the issues(primarily with + zapper emulation and sound emulation) with saving the time stamp will + need to be resolved. + + Fixed some crashing bugs when save states are loaded when + high-quality sound emulation is enabled. It is like patching + holes in a swiss-cheese boat. All the holes may be patched, but + it looks ugly. At least it tastes good... + TODO: Look into saving more data in the save states, especially + data that is based off of "timestamp" and "timestampbase". Also + look into validating this data. Right now, corrupt save state data + might cause memory corruption in FCE Ultra. + + Fixed some bugs in the NSF player. + + Cleaned up more code. + + Reduced the usage of TriggerIRQ(). + + Split the palette code into a new file, palette.c, from svga.c + + Low-G-Man(NTSC and PAL versions) are now recognized by CRC32 value, + and WRAM will be disabled if they are loaded. A warning/status message + will also be printed regarding this issue. + + Decreased the volume of the DMC/PCM channel in low-quality sound + emulation. + + Low-quality sound emulation now uses 32-bit integers for much + better speed. + + FCEUI_CRC32() wasn't returning anything. D'oh. Fixed. + + Added somewhat crude support for games that switch background CHR data + mid-scanline (this is needed in games such as Mother, Pirates!, + Business Wars, and Marble Madness). + + Altered NMI, IRQ, and BRK emulation again. Fixes some games, + like Bases Loaded 2 and Dynamite Bowling, and maybe some others. + I had to increase the size of the IRQlow variable for delayed + NMI execution... I also had to add a delay between PPU reset + and the PPU actually doing anything, to fix "Knight Rider". + + Fixed a mapper 90 save state bug. + + /dev/dsp code now searches for /dev/dsp before /dev/dspX (where X is + a non-negative integer). + + SDL joystick axes configuration is now done from the joystick. + + Tweaked various Konami mappers' IRQ counter emulation. + + Added custom SDL throttle code that gives up time slices instead of + using 100% cpu. + + Fixed an issue with sprite priorities on MSB-first platforms. + + Modified powerpad.c to avoid a symbol conflict when compiling on the + Power PC architecture. + +0.94r3: + sound.c: + Fixed a divide-by-zero bug that occurred when a virtual + reset(like by pressing F10) occurred when sound emulation was + disabled. + +0.94r2: + drivers/common/vidblit.c: + Fixed code for 32bpp blur effect. + + drivers/cli/sdl-video.c: + Added error message for unsupported bit depths. + + mappers/simple.c, ines.c: + Used this bug fix pseudo-release as an excuse to add + support for mapper 107. Information taken from virtuanes. + +0.94(fixed release) +--- + Fixed call to InitUNIXDSPSound in svgalib.c + + Added man pages. + +0.94 +--- + Added support for rapid fire A/B buttons on physical joysticks + in SDL/svgalib/DOS code. + + Implemented "high-quality" Namco 106 emulation(used for hq sound mode). + In this case, "high-quality" means sounding more like it should, + not necessarily cleaner. I'm not certain that it's totally correct, + but it's in the right direction. + + RAM cheats should no longer affect Game Genie emulation. I still + need to completely verify this. There may be some sort of race + condition. + + Removed various minor speed hacks in the name of style and + correctness(and to make maintaining FCE Ultra easier for those + people who are not me). :) + + Removed NSF cpu hacks, as I changed code to make them unnecessary. + + Fixed another FDS IRQ emulation bug. "Famicom Grand Prix II" works + now. + + Fixed a memory leak and a heap corruption bug in "file.c". + + Added support for on-the-fly IPS patching. + Place the IPS file in the same directory as the file to load, + and name it filename.ips. + + Examples: Boat.nes - Boat.nes.ips + Boat.zip - Boat.zip.ips + Boat.nes.gz - Boat.nes.gz.ips + Boat - Boat.ips + + Some operating systems and environments will hide file extensions. + Keep this in mind if you are having trouble. + + Patching is supported for all supported formats(iNES, FDS, UNIF, and + NSF), but it will probably only be useful for the iNES format. It + can be used with the FDS format, but be warned that it will permanently + patch your disk image, as the disk image is written back to disk + when the game is unloaded(unless the disk image is in a zip file, in + which case it isn't written back to disk). UNIF files can't be + patched well with the IPS format because they are chunk-based with no + fixed offsets. Support for a UNIF patching format may be added + in the future(probably by someone else.). + + Added more games to the list in ines.c for having battery-backed + WRAM, for header corrections. + + Copied over the 96KHz filter coefficients from Festalon that I forgot + to do in 0.92. Oops. + + +0.93 +--- + + Reduced the volume of the FDS sound channel. + + Fixed a bug in the FDS IRQ emulation code that caused "Lutter" to not work. + + Fixed a bug in unif.c that would cause a crash if a unif file were + loaded without a board name being specified(as could happen + with a corrupted nsf). + + Fixed a bug in general.c relating to relative filenames(running + fce ultra like "./fceu ../big.nes" would work, but "./fceu ../big" + would not work- it crashed). + + + +0.92r2 +--- + Fixed dpcm irq bug that broke Cobra Triangle. + +.92 +--- + + Removed NSF player background, and added some special effects goodies. + + Changed the NSF player to use the emulated gamepad as input instead + of having special NSF-player-only keys. + + Added support for mapper 249(using nonencrypted games), thanks to SARO + for info. SMYNES sucks. + + Updated video blitting library-thing(vidblit.c) with more special + effects, and removed 24bpp support. + + SDL cleanupification. + + Added support for mapper 61. + + nnnesterj: Added support for mapper 57. + + Fixed mapper number for "Golden Game 150 in 1". Changed it to 235 + from 43. + + DDraw back buffer surfaces are now created in system memory if the + hardware blitter can't do stretching. + + Restructured file wrapping code. + + Added new cheat search methods. + + Fixed a major cheat unloading memory bug(and memory leak). + + Emulated that funky nonlinear DAC effect for hi-quality sound. + + More fixes/cleanups to FDS emulation code. + + Tweaked PPU timing a bit. + + Improved network play. + + Holding the enter key down will no longer do fun stuff to the nsf + player. + + Improved NSF player. It should support streaming pcm nsfs now... + + Changed FDS keyboard keys around a bit. F6 is the disk select key, + and F8 is the disk insert/eject key. + F8 to insert VS Unisystem coin, F6 to view/toggle dip switches. + Hopefully people won't complain after blindly hitting the save state + buttons. :) + + Many fixes and improvements to the Windows port. No more cpu-consuming + wait loops(specifically, sound). Added a message window. + + FDS sound emulation improvements. + + FDS disks are now auto-inserted on power on(or was it loading a new + game...). + + Changed the default last rendered scanline to 231. + + ines header corrections are now printed as status messages, not errors. + + Rearranged input updating code. + + Fixed a sprite transfer bug. Fixes PAL version of Rainbow Islands. + + Debugger hooks added. + + Small optimizations in Refreshline and FetchSpriteData to hopefully + offset the slight slowdown in the cpu core. + + MapperHBIRQHook is now called differently(depending on hi/low bg/spr + addresses). + + Added support for unif board UNL-8237. + + Added support for mapper 144(death race). + + Added partial support for mapper 74. + + Fixed a cpu emulation bug in GETIYWR. It would sometimes set "target" + to 0x10000, which was a BAD THING(overflow; now it wraps). + + Tried to add support for mapper 241. Needs special keyboard emulation. + I think. + + Internal RAM is now initialized to something other than 0. Fixes + Minna no Taabou no Nakayoshi Dai Sakusen. + + Reassigned "The Money Game" to mapper 155. It doesn't seem to + respect the WRAM enable/disable bits. Silly game. And + Tatakae!! Rahmen Man. + + Added support for mapper 115(still needs 256KB CHR select), 241, 114,88. + + Attempted to add support for mappers 91, 187. + + Modified frame IRQ to not break so many damn games. + + Fixed sprite hit detection loop. + + Improved support for mappers 80, 90,117,154, 189. + nnnester and virtuanes. + + Reassigned "Devil Man" to mapper 154. + + Removed bogus Trojan header fix in ines.c. + + + +.81-post: +---- + Fixed/Worked around(?) compilation problems on gcc 3.2.x. + +.81: +---- + + More SDL goodies. + + Renamed "Makefile.olinuxsdl" to "Makefile.unixsdl" + + More SDL fixes and cleanups. + + BeOS port is now compiled with the "-no-fpic" flag, which allows + me to use my inline assembly. The executable work fine as far as + I can tell. + + Added "Makefile.beos". gcc doesn't like my inline assembly + used in RefreshLine(),so this port will likely be slightly slower than + other x86 ports. + + Added a check to make sure SIGBUS is not equal to SIGSEGV in + drivers/cli/main.c. Needed for compiling under BeOS. + + Renamed the "PI" member of the X6502 structure due to conflicts with + a defined symbol with some math header files. + + Merged fcelineasm.h into fceline.h + + Fixed(possibly) a possible problem in fcelineasm.h with input register + clobbering. + + More SDL changes. + + Added speed throttling code to the CLI code, and added a command + line switch "-nothrottle". + + Lots of restructuring/rewriting/merging of the MMC3 code. + + Updated DOS code to use the generic CLI wrapper. + + Reads from $4090 and $4092 now return the current envelope setting + in FDS sound emulation. I'm not sure if this is correct... Affects + "Ai Senshi Nicole" and "Bio Miracle Bokutte Upa". + + Added native SDL sound support to the SDL code. the "olinuxsdl" + now uses this code by default instead of the unixdsp sound code. + + Modified MMC3 IRQ counter emulation. I'll need to watch out to see + if it breaks any games. Fixes: MegaMan 3, Gun Nac, Klax(Japanese). + + Changed a few memory reads in x6502.c to use RdRAM instead of RdMem, + resulting in a slight speed increase. + + Cleaned up mapper 250 emulation code. + + Added support for iNES mapper 51(thanks to Kevin Horton for the + information). + + Merged some iNES mappers corresponding to bootleg multicarts + based on MMC3s with mbshare/mmc3.c. + + Added support for iNES mapper 52(thanks to Kevin Horton for the + information). + + Made some hacks to the MMC3 emulation code so that I can add support + for pirate MMC3 multicarts more easily. I should clean it up later. + Moved mapper 44 emulation code to mbshare/mmc3.c. + + Saving screen snapshots will no longer corrupt the frame buffer + for one frame(unless memory couldn't be allocated). + + Fixed screen snapshot saving(it was sort of broken due to the + changes made to the driver<->emulator interface code; status + messages were being saved to the image). FCEUI_SaveSnapshot() + no longer returns a value(the request to save a screen snapshot is + serviced before status information would be written in the next frame). + + nosprites is now set to 0 before RefreshSprite() returns, to prevent + problems if a game turns off the bg and sprites when FetchSpriteData() + for the next scanline is called but then turns on sprites when + the actual scanline is drawn. + + PPU_hook() is now called more often if PPU_hook is non-null. + Made changes to mappers 118, 95, 9, and 10 to compensate. + No games seem to be broken, and I added support for mapper 96 + (though the games aren't very playable because the special controller + isn't emulated). + + Romance of the 3 Kingdoms is now recognized to use 16KB ex-WRAM. + + Added support for mapper 185...sort of. I think this is another + instance of incompatible hardware being lumped onto one mapper number. + Sigh. + + Added support for "Famicom Jump 2" as iNES mapper 153. + If a good(as far as I can tell) dump is loaded, FCE Ultra will + automatically fix the mapper number. + I also made some changes to the mapper 16 IRQ emulation code. + + BRK now sets the I flag. + + Reads from $4015 no longer reset DPCM IRQ. + + Changed emulation of RTI instruction slightly. + + X.IRQlow is now set to 0 in PowerNES(). + + The VS Unisystem bit in the iNES header is no longer looked at( + I was having too many problems with this bit being set when it + shouldn't have been). Now, VS Unisystem emulation is enabled + when a known VS Unisystem game is loaded. I also rewrote the VS + Unisystem detection function. + + iNES mapper 1 now supports pageable CHR RAM if no CHR ROM is present. + Fixes "Family School". + + Mapper 70 no longer has a mirroring control emulated, and I extended + the number of 8KB CHR pages supported to 16. + + Cleaned up iNES MMC5 save RAM loading/saving code and added + support for MMC1 games with 16KB of RAM(the second 8KB are saved), + via CRC32s(currently only Genghis Khan(USA) and Nobunaga's Ambition( + USA and Japan) are recognized). + + Added support for the MMC5 Koei game "Ishin no Arashi", in the iNES + format(I added an entry with its CRC32 value and the number of 8KB + WRAM banks it needs). + + Better iNES mapper 33/48 IRQ counter emulation. + + Added the game "Uchuusen - Cosmo Carrier" to this list. I'm + beginning to hate the iNES format more and more...or maybe + just Fanwen. :) + + Added the mapper 32 game "Major League" to the list of games + that usually need iNES header correction...but in this case, the + iNES header cannot specify that this game needs to have one-screen + mirroring. + + iNES header information is now printed before any header corrections + are made based on a database. + + Fixed a bug in mapper 32 emulation. "Ai Sensei no Oshiete" + works now. + + Tried to add support for iNES mappers 245 and 249. + + Fixed the MMC5 read handler to return the data last on the data + bus instead of 0xFF when a read was made to an unmapped address. + This seems to fix the lockup problems in "Bandit Kings of Ancient + China". + + Reversed "Modified the time at which the "y scroll" register is updated + during hblank." The changes broke Klax. + + Added an unsigned 64-bit base timestamp variable "timestampbase". + Adding this to the 32-bit variable "timestamp" will return + the number of cycles executed since emulation started(in the future + I'll probably change it to since reset or power toggle). + This allowed me to replace "lastn" hack in the MMC1 code with + something better. + + Changed my mind and undid the removal of support for old save states. + + Removed support for old save states and in general I won't + try to support save states made with previous versions. + + MMC1: Writes to $8000-$FFFF with D7 set will now cause + the first MMC1 register to be OR'ed with 0x0C. I'm not sure + if this is correct, but it doesn't seem to break anything + and it fixes Robocop 3. I'll see if anyone reports games + not working in .81 that worked in .80. + + Worked on a generic driver interface wrapper very similar + to the driver interface FCE Ultra used to use(I'm getting + tired of all of the duplicated driver code). Eventually, + the DOS, SVGAlib, and SDL ports will use this wrapper. + + Similar change to the argument parsing code. + + Changed configuration file saving-loading routines and the + configuration structure to allow for linking config structures + to each other). + + Small fix to the emulation of the MMC5 split screen mode. + + Made Linux SDL code compilable again. + + Changes to MMC5 EXRAM emulation(read/write). + + Fixes to the emulation of the MMC5's split screen mode, based on + observations while using CastleVania 3 and a Game Genie(on a real + NES). + + Fixed a bug in ines.c that caused any calls to AddExState() from + a mapper initialization function to be effectively "erased"(ResetExState() + was called after the mapper was initialized). Fixes the VRC7 sound + state saving/loading stuff. + + Finished adding support for the MMC5's split screen mode(this does + not mean that the support is complete, but at least the intro in + "Uchuu Keibitai SDF" works correctly now). + + Worked on adding support for the MMC5's split screen mode. Not + completed. + + Reverted to .80's FDS sound code. + + Modified the time at which the "y scroll" register is updated + during hblank. + + NSF playing code will now disable FDS sound output on song init + (fixes some problems with the Zelda no Densetsu NSF rip). + + Increased the emulated clock speed of the FDS sound emulation code + to give better quality output. + + Modified NMI to occur a few cycles later. Fixes BattleToads...but + it may have broken other games. Also modified the way NMI's are + handled in x6502.c. + + Modified ines.c to memset() GameMemBlock to 0 on virtual power toggle. + Also, trainers are now loaded into their own buffer instead of + directly into emulated WRAM and copied into emulated WRAM on + power toggle; I've been meaning to do this for quite some time. + + Changes to the way the zapper cursor is drawn on the screen. + + FCEUD_WriteSoundData(), FCEUD_BlitScreen(), and FCEUD_UpdateInput() + have been combined into one function: FCEUD_Update(). + + More fixes to the network play code, and a fix to the Windows network + play driver code that fixes(hopefully) a rather evil bug that caused + lockups when the remote stopped network play. + + Added code to set the battery-backed bit in RAM if a game needs it, + based on CRC32. + + Added more games to the list of games that commonly have bad iNES + headers, in ines.c + + Updated docs and usage.h for DOS and Linux regarding the new video + mode and the new refresh rates. + + Linux: Fixed a bug with video mode 6(a few upper scanlines were being + cut off). Increased the refresh rate of video mode 3 to 120hz. + + Increased the refresh rate of video mode 2 to 65 hz in the Linux port. + + Screen snapshots can now be taken while playing an NSF. + + Added a new sexy tweaked vga mode that I created to the Linux svgalib + port. It's 256x224 at a refresh rate of 103hz. Hopefully it won't + blow up anyone's monitor. ;) + DOS port will follow eventually. + + Modified Makefile.base to produce an executable named "fceu" instead + of "fce". + + The plans(cycle-accurate ppu emulation) for .90 were a bit ambitious, + and I still need to make other fixes before then. + + Fixed some minor(usually) bugs with setting 256x240 tweaked VGA mode + in DOS and Linux ports. + +.80: +---- + + Cleaned/fixed a few things in the mapper 19 emulation code. + Family Circuit '91 still doesn't work quite right... I wonder if + it's a bad dump. + + Added input override code to Windows port. + + Added code to fix iNES header information in RAM and suggest + changes to the user. + + Added support for iNES mapper 152(to be used with games set to + mapper 70, that use one-screen mirroring instead of h/v mirroring). + + Blits using the DirectX blitting function(method?) to the primary + surface are now done with the asynchronous flag set(if that + fails, a "normal" blit is tried). + + The DirectX blit buffer(secondary surface that FCE Ultra writes to + directly and then uses the DirectDraw blit function on to blit + to the primary buffer) is now created without specifying it + should be in system memory or video memory, except in the case + when no hardware blitting is available, and then DDraw is explicitly + told to create the surface in system memory. + + Added Family Keyboard support to the DOS port. + + Cleaned up the VRC7 sound emulation code. I need to find a way + to save the current sound state in a save state. + + Found out the real name of the "Space Shadow" gun; it's + called the "Hyper Shot". I'm still not sure who made it, though. + Possibly Bandai did. The interesting thing is that Konami + also made a Famicom accessory(dual square boxy things with two buttons + on each) with the same name(though there might not be a space in the + name). + + Only the upper two bits read from $4016/$4017 are undefined. + Bit5 is always 0, though. Fixed the bug in "input.c". + Silly kevtris' old documents. New kevtris' brain is always good. + + Family Keyboard support for the Windows port. + + Added support for the Family Basic Keyboard to the Linux port, other + ports todo. + Might want to add support for the tape recorder at some time. + Also mapped the "Scroll Lock" key to disable/enable command keys + so that the FBK is more useable. It doesn't disable CTRL C, + though... + + Changed a lot of inlined functions in x6502.c to macros so that + I could test out some optimization ideas. + + DOS code updates for game input override support. + + Small optimzation to opcode $4c, and relative jumps. + + Added some code to ines.c to set controller information in + FCEUGameInfo(returned by FCEUI_LoadGame()) based on crc32 values. + + Updated user documentation and usage.h for DOS and SVGAlib input + command-line changes. + + Added an option to disable the four-score(to Windows and Linux ports + so far). + + Updated Windows interface to support the new Famicom expansion + devices. + + (Re)Added support for the Famicom 4-player device. + + Improved Zapper emulation...sort of. It still needs a lot of work. :/ + + Added *partial* support for the "Space Shadow" gun. + + Added support for the Arkanoid controller(both NES and Famicom style). + + Added code to support the extension Famicom input devices. + + Added PAL scanline start/end drawing settings to Windows port. + + Added pause emulation key(F2) to Windows port. + + In the process of rewriting/fixing up input code stuff. + + Minor bug fix to Power Pad emulation code. + + VS Hogan's Alley and VS Duck Hunt automatically select the zapper + now(though it only works on the SVGAlib port). + + Undid some FDS sound code changes introduced in 0.76 that totally + screwed up sound. Oops. + + Added code to allow different settings for first/last scanline + drawn while in PAL emulation mode, to the Linux and DOS ports. + + Added convenience(it's not necessary, but it reduces redundant and + confusing code in the driver code) function + FCEUI_GetCurrentVidSystem(int *slstart, int *slend). + + Updated file "TODO". + + Changed #include to #include "zlib/unzip.h" + in file.c. + + NSF 6502 player now initialized the stack pointer on reset. + + Worked on de-emphasis emulation code quite a bit. + The deemphasized palette calculated at the end of the frame is now + based on what deemphasis bits were set for the longest during + the screen(sampling interval is a scanline) update loop. + Added a "static" deemphasized palette at $40-$7F in the palette table. + This corresponds to the colors when all of the deemphasis bits are set. + I did this to fix the PAL game "Noah's Ark", without breaking + anything else. The only downside is a slight speed loss(~2% on + my system when sound is disabled), but this is acceptable to me, + at least. + Maybe it's time to write hi/true-color ppu drawing code... + + + Fixed an out of bounds array access in svga.c in SetNESDeemph(). + The variable "lastd" in svga.c was being initialized to the wrong value. + Thanks to "Jarod CANAL" for pointing this out. + + Removed FCEUI_SetFirstRenderedLine or whatever it was called and + the function to set the last line. Replaced with: + void FCEUI_SetRenderedLines(int ntscf, int ntscl, int palf, int pall); + + Changed SetVidSys(int w) to ResetVidSys() in fce.c. Reenabled + PAL/NTSC emulation overrides based on game loaded(really only useful + for NSFs and UNIFs now). + + UNIF loading code now recognizes the chunk "CTRL" and tries + to use it. Only the svgalib code supports overriding of input + settings based on game loaded, now, though... + The user is still going to have to configure powerpad settings + on his/her own. + + Fixed return values of FCEU_fseek() and fixed a problem in unif.c + related to it. + + Changed mechanism for how FCE Ultra tells the driver + code what type of system is being emulated. A structure of + type "FCEUGI" is returned from FCEUI_LoadGame(). + + Fixed a major mapper 64 emulation bug introduced in 0.76. + + Modified BlitVidHi() in drivers/win/video.c to speed it up. + + Added support for loading the iNES-format Game Genie ROM image. + + Removed ggrom.h and added code to load the Game Genie ROM + image from a file. + + Added Windows netplay.c. (new: the user exiting the emulator + while stuck in a blocking recv() or send() loop now works.) + + Fixed a vram address register bug in fce.c that I created when I got + rid of the pair/dpair data types. + + Added new mappers/92.c + + Removed mappers/92.c until I can contact LULU or rewrite it. + + drivers/win changes. Removed netplay.c until I can rewrite it. + + Got rid of pair/dpair data types. + + Got rid of silly "TempArray" thing. + + Began adding GPL headers to files. FCE Ultra is going to be in + a state of legal limbo for the next few days... + + Replaced crc32.c and crc32.h, and added some #ifdef's and #defines + to use the crc32 code in zlib instead if zlib is linked with + FCE Ultra. + + More fixes to sb.c. + + Cleaned up drawing.h and ggrom.h(even though ggrom.h will *probably* + be removed before the next release). + + Redid frameskip code. + + Rewrote necessary pieces of sb.c and sb.h and fixed quite a few + bugs. I still need to test it on various other sound cards, though. + + Rewrote(more like "recreated in my own image") DOS keyboard driver. + Removed unused "keyscan.h" from drivers/svgalib + + Rewrote part of(the parts that Marat wrote - the connection and + closing parts) the Linux TCP/IP network play code. I guess it works, + but I haven't tested it very much. In any case, it's still dangerous + to use network play in FCE Ultra with SVGAlib, since recv() or send() + might block and since the keyboard is in raw mode, you have a problem. + Maybe a future SVGAlib will fix the general problem of lockups if + keyboard_update() isn't called, though it is only partly SVGAlib's + problem... + + Fixed FCEU_fseek() when used with a compressed file in the PKZIP + format that has been loaded. Fixes a UNIF loading problem. + Also added a check to the return value of FCEU_fseek() in unif.c. + + Replaced Marat's 6502 emulation core with my own. + It should be fully functional, but as always, I don't know if + I implemented the undocumented instructions correctly. + Several things are correct in this new core that were not in + Marat's(D flag is no longer cleared by interrupts, for example). + + Altered mapper 16 irq counter emulation slightly. + + Fixed the behavior of the SXA, SYA, and XAS opcodes based on the + documentation I have. I'm not sure what happens when page crossing + occurs with those instructions on a real NES, though. + Also CHANGED(not fixed) emulation of opcode $8B("XAA"). + + Changed some of the M* functions(absolute indexed and maybe some others) + to perform dummy reads. + + Changed some of the macros in m6502.c to inlined functions so + that I can modify and examine them more easily. + +.77: +---- + + Fixed a silly network play bug(in the global network play code) + that caused excessive lag. + + Added a "niceness" setting to the sound configuration dialog. + Removed obsolete information from the dialog. + + Fixed speed throttling code in Windows port when PAL emulation is + disabled/enabled and a new game hasn't been loaded yet. + + Commented out a printf() to debug stuff in fds.c(oops). + + Applied PK's joystick patch to the osdl code. It allows the user + to map axes and it fixes a joystick button mapping configuration saving + bug. + + Added two command line options new to Linux port to DOS port. + Just need to test them... + + Added some stuff to unif.c to allow for boards that can support + CHR RAM instead of CHR ROM(darn Sachen boards...). Fixes UNIF + version of "Q-Boy". + + Added command line option "-snapname" to Linux port. I'll add it + to the Windows port as well, but probably not to the DOS port. + + Added clip option to Linux port. + + Fixed sound logging(in Windows port) so that multiple recording + sessions now work. + + Added an option to clip the leftmost and rightmost 8 columns + of graphics in the Windows port. + + Added a submenu that lists recently opened files, in the Windows + port. + +.76: +---- + + Updated porting.txt. + + Added speed throttling code to Windows port that's used when sound is + disabled(and an option in the "Miscellaneous" + configuration window to disable it). + + Added cheat interface to DOS build. + + A few tweaks to the text cheat interface code in the cheat listing code. + Added a command to quickly toggle the status of the cheat(though a + cheat can still be disabled/enabled by (M)odifying the cheat). + + Support for UNIF UNL-TC-U01-1.5M board added. Same credits as below. + + Rewrote mapper 228 code just for the heck of it(actually, I couldn't + figure out why some(about two) of the games in the Action 52 cart + weren't working in .75(and .76). I traced it back to .71, where an apparent bug in + the undocumented 6502 opcode emulation allowed it to work, which + was later fixed for the .72 release(opcode 0x7C)). I'm thinking + that the dump is bad... + + Added a few crc32 checks to ines.c to check for and report when + a known(by me) bad(hacked or bad dump) game is loaded. + + Added support for the following UNIF boards. Thanks to Quietust + and Kevin Horton for the information. Some problems still exist + with a few games that use these boards, though... + + UNL-Sachen-8259B + UNL-Sachen-8259A + UNL-Sachen-74LS374N + UNL-SA-016-1M + UNL-SA-72007 + UNL-SA-72008 + UNL-SA-0036 + UNL-SA-0037 + + Fixes to some stuff in cart.c(for example, calling setprg32() when + only 16kb of prg data is present now works). + + Added support for iNES mapper 189. + + Tried to add support for the UNIF board "UNL-H2288". Failed. + + Updated "cheat.txt" to fix a few typos and added an example of finding + and adding a cheat using the Linux port's text interface. The actual + section on the Linux cheat interface still needs to be written, however. + + Changed network play code in the Windows port and fixed a bug. + Fixed a similar bug in the Linux netplay code....sort of. + + A few cosmetic changes to the dialogs in the Windows port. + + Fixed sound initialization on the Windows port(it was being initialized + when FCE Ultra started even if it was disabled by the user. Oops.). + + Joystick button configuration code in Windows port changed slightly + to be more useable. + + Changed reference to video mode 5 in the linux port to "1 per 4". + It may not be very meaningful, but it is certainly better + than "TV Emulation". I'll change the Windows port reference later. + + Documented video mode 7(320x240) for the Linux port. Also added + a check for the FBDev driver in order to use this mode instead + of a tweaked vga mode if that driver is being used. + + Added/Fixed cheat interface for Linux port. It's still not perfect, + though. The code is ugly... + + Callback function for FCEUI_ListCheats() now receives + status information(enabled/disabled). + + Callback functions for cheat functions now must return 0 to + stop listing cheats or 1 to continue. + + Fixed a problem(the cheat code was reading in cheats + for address $0000 from cheat files if any blank lines were present). + + SDL port zlib changes(linked dynamically to zlib now). + + More changes to envelope decay + looping on code. No longer + depends on value @ $4017. It now sounds correct based on some + tests I did with SMB3 and a GG, but Goonies 2 doesn't sound right( + based on a sound file sent to me by another person). + + Added support for iNES mapper 140. Thanks to Quietust for the + information. + + I need to figure out how to deal with the problem of so many + bad NSFs that most people consider good... + + Changed envelope decays a bit. Their behavior now depends on bit + 7 of $4017. I don't know if this is right... + + Addition of debug.c for some debugging stuff. + + Updated zlib to 1.1.4. + + Modified code in various files to allow UNIF games to override + current selected video system emulation(NTSC or PAL). Need to + make sure this really works. + + Changed sound.c to prevent desynchronization during network play. + This might slow down sound emulation slightly, especially when + sound emulation is disabled. I really don't care... + + Updating network play code. More info later... + + Moved the sound/video/etc output code in EmLoop() to the top of the + for(;;) loop so that initialization prior to calling EmLoop() will + be the same as initialization done during a call to a FCEUD_* function. + + A few very small changes to sound emulation in fds.c. + + Changed unlink() to remove() in cheat.c and removed the including + of the header file unistd.h. + + Split up the cc=... statement in RefreshLine() to make it easier + to read and not ambiguous(to Borland's C compiler). + + Changed a lot of the function declarations in cheat.c. I'll need + to verify that cheat searching still works ok and that cheats still work + ok. I'll also need to update the Windows(and Linux console) cheat code + to prevent compiler warnings. + + Fixed various minor code problems(not minor if you want to use a + compiler besides gcc). This is an ongoing process... + + Removed bit fields after reading about and thinking about possible + portability problems, though I kept some optimizations in fceline.h + + Minor code simplification in drivers/win/joystick.c(replaced + "case 200 ... 207" and "case 208 ... 215". + + Modified some code to use bit-fields in the graphics rendering code + in fce.c and fceline.h. gcc seems to be able to optimize the new + code to run faster. + + Fixed m6502.c and fce.c to initialize variables on virtual power + toggle. This should fix network play on the Windows port. + I'm also in the process of cleaning up fce.c. + +.75: +---- + Fixed directories configuration stuff in Windows port(corresponds + to .75r2). + + More changes to square wave channel envelope/volume emulation... + Changes described in the large paragraph some lines down have been + abandoned. + + Added a command line switch to set the volume in the dos port. + + Changed Windows sound configuration dialog. Now buffer length is + specified in time, not samples. I also added a volume control. + + Reduced the volume on 8-bit sound output on all ports by 1/2. + + Added a function FCEUI_SetSoundVolume(). Added support for setting + the volume via the command line in the Linux port, other ports coming + soon. + + Changed FCEUD_WriteSoundData() again. No longer has a "Check" + argument. All clipping(ugh) is done internally now. + + Added a directories configuration dialog to the Windows port. I worked + on it too long and I became a zombie, so it might have a few bugs. + That's what guine...err...users are for. ;) Don't expect me to do + anything like this for any other port, though. I don't feel like + doing it on the DOS port, and the Linux and other UNIXy ports shouldn't + really need it. + + Made some changes to the rectangle/square wave channel emulation to + fix the pops in SMB. I have no idea if what I did is correct. To + be honest, I'm not sure I know EXACTLY what I did, but it's something + like this: Writes to $4003/$4007 now reset the duty cycle count + and reload the cycle counter with the current wavelength. Writes to + $4003/$4007 now do not update the amplitude output of the channels; they + will be updated after the cycle counter hits 0(or below). + + More information in iNES informational output. + + Minor changes to mappers/16.c. + + Increased the volume of the VRC6's sawtooth wave channel. + + Added more information to the RAM cheat guide. + + Changed the triangle wave generation code slightly. I decided + to remove support for the higher-frequency triangle waves, as they + are too cpu-costly to create and are probably not very audible on a + real NES anyway. + + Major changes to how sound is mixed. This necessitated a high pass + DC-offset removing filter, and a low-pass filter just to make things + sound better. ^_^ + Note: FCEUD_WriteSoundData() no longer needs to clear the waveform + data referenced by the passed pointer; it's done internally now. + + Fixed JMP ($xxxx) - now handles wrapping like it occurs on a real 6502 + (hopefully; I'm assuming that the same holds true for the NES' cpu). + + Added the ability to load a custom global palette in the DOS port. + + Fixed bug in drivers/common/unixdsp.c(wrong return value if sample + rate was out of range). + + Many sound fixes... - Frequency sweeps, length counter stuff,... + + Changed Windows port to use IDirectInput7 and IDirectInputDevice7 + interfaces. + + Fixed a Game Genie bug in the core emulation code. It only appeared + in the Windows port, though. (Enabling gg emulation, loading a game, + and then disabling gg emulation and loading a new game while in the + gg code entry screen would cause the new loaded game to not work + correctly). + + Modified windows port to use the config saving/loading stuff in + drivers/common/config.c + + Mapper 45 cleanups/fixes. + + Added the ability to load a custom global palette in the Linux port. + Yay. + + Fixed a large number of overcomplicated code and silly bugs in + drivers/common/config.c. This changes the format of the configuration + structure, too. Also added support for saving/loading strings with + automatic memory allocation when strings are loaded. + + Minor change in InitNetplay(). + + Fixed bad type conversions for pointers to functions and fixed + some bad declarations of functions. + + Reenabled zlib support for the sdl build. I need to pay attention + to patches that modify lines than don't fit on my screen. + + Fixed vidblit.c to not emit so many warnings when compiling. + +.74: +---- + + Stop sound in Windows port when user clicks l/m/r mouse buttons + in the non-client area of the window. + + Added "Drag and drop" file open support to Windows port. + + Various code cleanups. + + mappers/33.c optimization. + + Rewrote the function "FCEU_MakeFName()". + + Removed crc32.h from mappers directory. + + Modified some of the window resizing code in the Windows port. + + Added support for waiting for vblank/double buffering to the Windows + port. + + Added/Fixed support for iNES mapper 248. + + After an NSF file is loaded, information about its header is now + displayed. + + Fixed a typo in the Namco 106 extra ram handling code. + + Improved the quality of the Namco 106's extra sound channels. + - Thank Mamiya and Applepie(real name?) for info. + + When an NSF file is being played, FCE Ultra will no longer go through + its scanline rendering loop. This speeds up NSF playback considerably. + + Updated "porting.txt". + + Moved some stuff from DriverInterface() to their own functions. + + Fixed some iNES mapper 18 IRQ counter emulation bugs. "Ninja Jajamaru - + Ginga Dai Sakusen" now works. + + Rewrote large pieces of the mapper 64 code. "Skull and Crossbones" + still doesn't work, though. + + Changed format of iNES header information output, added "ROM CRC32" info. + + Modified the way cycle timing is done slightly. No change + for NTSC emulation, but PAL emulation is a little more accurate. + + Changed the behavior of indirect indexed(I hope I got that right ;)) + instructions to behave more like a real 6502(junk reads are now + performed). + + A few optimizations/cleanups in m6502.c. + +0.73 +---- + + * Fixed several bugs with sprite emulation. Several games(such + as "Trojan" and "VS Duck Hunt") that were broken in .71 and .72 now + work ok. + * Added support for iNES mapper 82. Thanks to those who work on + "unofficial nester". + * Added support for iNES mapper 250(used by "Time Diver Avenger"). + * Fixed the documentation to show that iNES mappers 48, 83, and 232 + are supported. + * Removed various pieces of stale code and fixed a few minor bugs. + * Fixed a triangle wave channel bug(the channel was sometimes enabled + when it shouldn't have been). + * Writing to $4010 with the upper bit clear now acknowledges the DPCM + IRQ. This appears to fix "Stunt Buggies". + * Rewrote pieces of the Zapper emulation code to be cleaner and more + accurate. + * Rewrote the VS Unisystem dip switch drawing code. + * Simplified the setting of VS Unisystem dip switches. The "V" key + now toggles viewing AND editing of dip switches. + +0.72 +---- + + * Various minor bug fixes. + * Various code cleanups and size and speed optimizations. + * Removed some (apparently) unused MMC5 sound emulation code. + * Changed the behavior of $2003 and $4014 to better simulate what occurs + in a real NES. + * Fixed a few bugs in the undocumented 6502 opcode emulation code. + The Game Genie code "NUTANT" for SMB 3 works correctly now, at + least(previously it caused the game to lock up at the end of levels). + * Rewrote large pieces of the 6502 memory fetching code, resulting + in a slight slowdown in the speed of emulation. Benefits include: + Game Genie emulation now works(again) and 6502 emulation is more + accurate. + * Added support for iNES mapper 72. Thanks to rinao for the information. + * Fixed support for iNES mapper 77(used by Napoleon Senki). + * Fixed/Added support for iNES mapper 226. Apparently I made a mistake + in the documentation. Thanks to Mark K. for the information. + * Added support for iNES mapper 227. Thanks to Mark K. for the + information. + * Added support for iNES mapper 234(used by the Maxi-15). Thanks + to Mark K. for the information. Note that many of the Maxi-15 + ROM images on the Internet have corrupt CHR data(graphics), or the + mapper number is set incorrectly(usually to 11). Use a utility to + fix the mapper number. + * Added support for the following UNIF boards(prefixes omitted): + - EKROM (and fixed the reference to "Gemfire" in the documentation). + - HKROM + * Added the ability to enable and disable individual RAM cheats. + * Fixed some problems with the cheat search code(the NES' internal + RAM was being searched differently than any external RAM, which + was being search incorrectly). + +0.71 +---- + + * Fixed a 6502 emulation bug that was causing some Koei games + (ex: Nobunaga's Ambition, Genghis Khan) to not work. + * Extensive PPU/CPU timing adjustments. + * Fixed support for iNES mapper 40. + * Added support for the following UNIF boards(prefixes omitted): + - ETROM + - ELROM + - EWROM + * Fixed a few bugs in the UNIF code. + * Added support for loading and saving cheat files and an interface + to search for/add/delete/list cheats(no interface yet on Linux/DOS). + * Fixed a few minor bugs in the Windows DX code. + * Command line options to control the number of sound fragments + and the fragment size have been added(Linux). + +0.70 +---- + + * Adjusted PPU/CPU timing. + * Removed(until I understand the problem) a hack to get one of the + games in the Caltron 6-in-1 to work. + * Fixed an MMC3 IRQ emulation bug("Project Q" works better now). + * Fixed a problem/misunderstanding regarding the upper scanline. + It can now be displayed again. + * More accurate sprite hit emulation(fixes the title screen of + "Ultimate Stuntman"). + * VRAM bank switching for iNES mapper 4 is now possible(and enabled + for all mapper 4 games without CHR ROM). Fixes "Tenchi o Kurau 2". + * Added support for the Famicom's four-player adapter and the ability + to enable it(it is disabled by default to prevent compatibility + problems). + * Added an option(under miscellaneous configuration) to automatically + open the "File Open" dialog box when FCE Ultra is started. + * Sound sampling rate is now configurable. + * Fixed some bugs in the DirectSound code. + * Joystick button configuration is a little more user friendly(and + stable, hopefully) (Linux). + +0.62 +---- + + * Added support for the Famicom Disk System's extra sound channel. + * Updated the version of Tatsuyuki Satoh's OPL2 emulator used in + FCE Ultra from .36f to .37a. The sound quality in "Lagrange Point" + seems to have improved. + * Added support for iNES mapper 242(used by "Wai Xing Zhan Shi"). + * Fixed a network play bug that could cause desynchronizations + if more than one network play session occured since FCE Ultra + was started. This bug only showed up on the Windows port, though. + * Increased the volume of the noise and triangle sound channels. + * Fixed a save state loading bug. + * Fixed a small memory leak that was being caused by the VRC7 + state loading code. + * Fixed a bug that could cause FCE Ultra to crash if a virtual disk + was being read and the user ejected the virtual disk. + * Various minor bug fixes/code cleanups. + * NTSC color "emulation" can now be enabled again(the code to + enable it was broken in the last version). (Linux) + +0.61 +---- + + * Speed optimizations in sprite rendering code. + * Screen snapshots are now saved in the PNG format instead of the PCX + format. + * Fixed Game Genie emulation(it wasn't working in the last release). + Also added support for Game Genie emulation to the UNIF code. + * Rewrote command line option parsing code. + * Fixed a problem(if FCE Ultra was configured to connect to a remote + host and the remote host was given as an IP address, and the IP + address couldn't be reverse resolved, which is commonly the case + on home LANs, the connection attempt would fail) in the network + play code. I had misinterpreted the Winsock API documentation + when I wrote the code. (Windows) + +0.60 +---- + + * Various speed optimizations. + * Sound is no longer messed up when a JAM/KIL opcode is emulated. + * Fixed an overflow bug that occured when $4014 was written to + during certain(rare) conditions. + * Fixed a few save state bugs. + * Fixed a MMC1 CHR bank switching bug. + * Added emulation of the MMC5's WRAM write-enable/disable registers. + * Fixed a sound frame IRQ emulation bug. "Qix" works now. + * Added UNIF support. Some of the board emulation is still a bit + buggy, though. Look at the documentation for a list of supported + boards. + * Updated the "Palette Notes" section of the documentation. Also + fixed a few other problems with the documentation. + * Added support for loading files in the PKZIP and gzip + compressed file formats via zlib. + * Added the ability to configure the first scanline and the last + scanline to draw to the screen. Enabling PAL emulation no longer + will cause all 239 scanlines to be displayed, though an option + to override these settings for when PAL emulation is enabled may + be in the next version. + * Fixed a bug that would cause the emulated D-pad of virtual gamepads + emulated through the keyboard to be duplicated through "higher" + virtual gamepads(gamepad 1 would affect 2,3,4; gamepad 2 would + affect 3,4; etc.). (Windows) + +0.55 +---- + * Rewrote window resizing code. The window will now resize itself + to a multiple of the NES' screen dimensions nearest to the user + selected dimensions. (Windows) + * Added an option to use buttons instead of axes on physical joysticks + for the emulated D-Pad. This is useful for some digital joysticks. (Windows) + * Fixed a bug that would cause FCE Ultra to crash if sound were + disabled during emulation. (Windows) + * Added the ability to "fast forward" emulation. + * Added an option to allow more than 8 sprites per scanline to be + displayed. + * Added an option to save all extra non-volatile game data + (such as battery-backed RAM) in a directory under FCE Ultra's + base directory(as opposed to the directory the game is located in). + * Added an option to allow the emulator to change to a full screen + video mode once a new game is loaded. (Windows) + * Rewrote pieces of DirectInput joystick handling code. Hopefully + it should increase compatibility. (Windows) + * Added the ability to automatically obtain button numbers when + configuring joysticks, by pressing buttons on the joystick. + * Added the ability to close the current game(decreases CPU usage). (windows) + * Increased the speed of various function calls by passing + arguments to functions through registers instead of through the + stack. + * Added emulation of the MMC5's raw PCM register. + * Added the ability to save/load save states while network play + is occuring. + * Having PAL emulation enabled will no longer override the + NTSC/PAL settings in NSF headers. + * Fixed a bug that got into the .54 release. Extraneous data was + being returned on reads from $2002, which caused problems + with some games(such as "Choujin Sentai Jetman"). + +0.54 +---- + * Fixed a bug that would cause a wrong battery-backed WRAM file + name to be produced if FCE Ultra was passed a file name without + any directory component(such as "fceu SuperBlah.nes"). + * Fixed an iNES mapper 118 emulation bug that got into the code + in a recent code cleanup. "Armadillo" is playable again. + * Fixed a typo(and bug) in the MMC5 emulation code. + * Data returned from emulated reads to "unmapped" areas or + memory locations where bits are undefined should now be correct. + * Fixed emulation of the sprite memory transfer register $4014. + It now takes into account the last value written to $2003 and + starts the transfer to that location in sprite memory(like on + a real NES). + * Added a video configuration dialog box. (Windows) + * Added the ability to configure a custom video mode. Aspects + that are configurable include width, height, bits per pixel, + and size transforming(stretching and scaling). (Windows) + +0.53 +---- + + * Fixed a bug with joysticks that occured on systems with multiple + joysticks. (Windows) + * Added support for iNES mappers 77 and 92(thanks to LULU for the code for both). + * Added partial(timer is non-configurable) support for iNES mapper 105. + * Changed save state format again. Save states made with previous + versions should still be compatible, though this may change in + future versions. + * Small optimization to sprite emulation code. + * Rewrote color-deemphasis code to use integer math instead of + floating-point math. + * Rewrote and restructured input code. (Linux) + * Added command line option "-f8bit" to force 8-bit sound. (Linux) + * Rewrote and restructured input code. Among other new features, + keyboard keys are now somewhat configurable. (Windows) + * Writes to $4003/$4007 will now reset the emulated square wave + duty cycle generator. + * Added emulation of the Power Pad. + * Rewrote joystick device reading code to use the event-driven + interface. This should fix various problems regarding support + for joysticks with many buttons. (linux) + +0.52 +---- + + * Fixed a PCM emulation bug(digitized voices in "Ikari Warriors 2" + and "The Immortal", among others, work now). + * Fixed noise channel's LSFR update frequencies(hopefully). + * Various minor bug fixes. + +0.51 +---- + + * Added support for iNES mappers 86 and 89. + * Reduced byte size of the NSF player's background. + * Adjusted CPU/PPU timing. + * Fixed sound channel frequency calculations for when PAL emulation is enabled. + * Rewrote large pieces of the sound code and got rid of the sound queue. Sound quality should be slightly better now. + * Various minor bug fixes. + + Windows: + + * Fixed an FDS side reset bug when a new game is loaded. + * Screen width/depth/height changes while FCE Ultra is in windowed mode are handled now. + * Changed the configuration file format. + * Added a palette configuration dialog. + * Added the ability to load a custom NES palette. + * Added an option to double 16-bit sound volume. + * Added an option to force 8-bit sound. + * Added an option to use a secondary sound buffer(versus the primary). + * Added an option to wait for vertical blank if sound is disabled. + * Added an option to run while focus is lost. + +0.50 +---- + + * Many bug fixes. + * Sound code partially rewritten to improve quality(near-perfect + raw PCM now) and eliminate the need for a separate thread. + This created a small problem with network play, though, so read + the network play notes section. Also, synchronizing to + vertical blank has been removed. + * Rewrote other pieces of sound code. No more "buzzing" in MegaMan 2, + Codemasters games' intros, etc. + * Added support for the NES Zapper and the VS Unisystem's light + gun. Be sure to read "Light Gun Notes". + * Changed save state format. Save states should now be much + smaller for most games. Most(not all) save states created with + an older version should work. + * Added support for VS Duck Hunt and VS Hogan's Alley. + diff --git a/programs/emulator/fceu/FCEU ReadMe.txt b/programs/emulator/fceu/FCEU ReadMe.txt new file mode 100644 index 0000000000..f8c0518ebd --- /dev/null +++ b/programs/emulator/fceu/FCEU ReadMe.txt @@ -0,0 +1,152 @@ + +*******************************RUSSIAN**************************************** + +==О программе FCEU== + FCE Ultra - один из лучших эмуляторов NES на Linux, DOS, Windows, +BeOS, Mac OS X, а теперь и на Kolibri и Menuet! + +Сайт: http://fceultra.sourceforge.net + +Поддерживаемые мапперы: 0-11, 13, 15-19, 21-26, 32-34, 40-49, 51, 52, 57, 61, 64-80, + 82, 83, 85-90, 92-97, 99, 105, 107, 112-119, 140, 144, + 151-156, 180, 182, 184, 189, 225-229, 232, 234, 235, 240, + 242, 246, 248-250 + +После запуска программы нужно прописать полный путь к нужному файлу NES +и нажать Enter (путь отображается в верхней части окна). + +Версия эмулятора: 0.96 +Версия порта: 0.3 + +==Портер== +Asper +Писать сюда: asper.85@mail.ru + +Основные клавиши: + + Для эмулируемого устройства Family BASIC Keyboard: + Включить/Выключить Ввод Клавиатуры Scroll Lock + (включение ввода с эмулируемой клавиатуры отключает + коммандные клавиши) + Все эмулируемые клавиши отображаются на ближайшую доступную клавишу + на клавиатуре ПК за небольшими исключениями. Эмулируемая клавиша "@" + отображается на клавишу "`"(grave), и эмулируемая клавиша "kana" + отображается на клавишу "Insert" (в блоке клавиш размера 3x2 над + курсорными клавишами). + + Для эмулируемых устройств game pads: + A Turbo B + S Turbo A + Left Control or Z or Space B + Left Alt or X A + Enter/Return Старт + Tab or BackSpace Селект + Cursor Down Вниз + Cursor Up Вверх + Cursor Left Влево + Cursor Right Вправо + + Для эмулируемых устройств power pads(клавиши соответствуют расположению + кнопок на стороне "B"): + O P [ ] + K L ; ' + M , . / + + Для FDS игр: + F6 Выбрать диск/сторону диска. + F8 Извлечь/Вставить диск. + + Для VS Unisystem игр: + F8 Вставить монету. + F6 Отобразить/Скрыть dip переключатели. + 1-8 Переключить dip переключатели (когда dip + переключатели отобажаются). + + 0-9 Выбрать слот сохранения. + Caps Lock Выбрать виртуальный джойстик. + + F2 Массштабировать окно. + F3 Открыть файл. + F5/F7 Сохранить/Загрузить сохранение. + F9 Сохранить снимок экрана. + F10 Перезагрузка. + F11 Выключить/Включить. + ESC/F12 Выход. + + +*******************************ENGLISH**************************************** + + +==About program FCEU== + FCE Ultra - is is one of the best emulators of NES on Linux, DOS, Windows, +BeOS, Mac OS X, and now on Kolibri and Menuet! + +Website: http://fceultra.sourceforge.net + +Supported mappers: 0-11, 13, 15-19, 21-26, 32-34, 40-49, 51, 52, 57, 61, 64-80, + 82, 83, 85-90, 92-97, 99, 105, 107, 112-119, 140, 144, + 151-156, 180, 182, 184, 189, 225-229, 232, 234, 235, 240, + 242, 246, 248-250 + +After program executing you have to input full path to the NES file that you want +to be executed and press Enter (the path echo on the upper part of the window). + +Emulator version number: 0.96 +Port version 0.3 + +==Porter== +Asper +mailto: asper.85@mail.ru + + +Main keys: + + For emulated Family BASIC Keyboard: + Enable/Disable Keyboard Input Scroll Lock + (enabling emulated keyboard input will disable + commands keys) + All emulated keys are mapped to the closest open key on the PC + keyboard, with a few exceptions. The emulated "@" key is + mapped to the "`"(grave) key, and the emulated "kana" key + is mapped to the "Insert" key(in the 3x2 key block above the + cursor keys). + + For emulated game pads: + A Turbo B + S Turbo A + Left Control or Z or Space B + Left Alt or X A + Enter/Return Start + Tab or BackSpace Select + Cursor Down Down + Cursor Up Up + Cursor Left Left + Cursor Right Right + + For emulated power pads(keys correspond to button locations on + side "B"): + O P [ ] + K L ; ' + M , . / + + For FDS games: + F6 Select disk/disk side. + F8 Eject/Insert disk. + + For VS Unisystem games: + F8 Insert coin. + F6 Show/Hide dip switches. + 1-8 Toggle dip switches(when dip switches + are shown). + + 0-9 Select save state. + Caps Lock Select virtual joystick. + + F2 Scale window. + F3 Open file. + F5/F7 Save/Load state. + F9 Save screen snapshot. + F10 Reset. + F11 Power off/on. + ESC/F12 Exit. + diff --git a/programs/emulator/fceu/History.txt b/programs/emulator/fceu/History.txt new file mode 100644 index 0000000000..3a9c6b46be --- /dev/null +++ b/programs/emulator/fceu/History.txt @@ -0,0 +1,33 @@ +01.09.08 == Port v0.1 == Emulator v0.42 +- загрузка NES файлов | - load NES files +- исполнение NES файлов | - execute NES files +- массштабирование размера окна | - scale window size +- работает в ОС Kolibri и Menuet | - work in OS Kolibri and Menuet + + +24.10.08 == Port v0.2 == Emulator v0.42 +- работа с сис. функцией 70 | - working with sys. function 70 +- создание сохранений | - make saves +- загрузка сохранений | - load saves +- создание скриншотов | - make screenshots +- добавлены клавиши Турбо A и Турбо B | - Turbo A and Turbo B keys were added +- работает только в ОС Kolibri из-за | - work in OS Kolibri only because of + использования сис. функции 70 | using sys. function 70 + +09.07.09 == Port v0.3 == Emulator v0.96 +- добавлено 33 новых маппера | - 33 new mappers were add + ( 48, 51, 52, 57, 61, 72, 74, 77, 82, 83, 88, 92, 96, 114, 115-117, 140, + 144, 152-156, 189, 227, 232, 234, 235, 242, 248-250 ) + +- добавлены новые эмулируемые | - new emulated devices were add + устройства | + ( power pads, game pads, zapper, arkanoid, shadow, Family BASIC Keyboard ) + +- выбор виртуального джойстика | - select virtual joysticks +- ускоренный вывод графики | - faster graphics output +- вывод fps | - fps output +- сообщения теперь выводятся на доску | - messages now output to the debug board + отладки | +- см. файл "ChangeLog.txt" чтобы | - see file "ChangeLog.txt" for full list of changes + просмотреть весь список изменений | + diff --git a/programs/emulator/fceu/fce b/programs/emulator/fceu/fce new file mode 100644 index 0000000000..5f19302803 Binary files /dev/null and b/programs/emulator/fceu/fce differ