From 217ca8de3f46e0315f3a28de0b50e66b4cc95a9c Mon Sep 17 00:00:00 2001 From: ekeeke31 Date: Fri, 10 Aug 2007 20:34:06 +0000 Subject: [PATCH] --- Makefile | 174 + changelog.txt | 131 + genplus.txt | 356 + pcutil/Makefile | 3 + pcutil/inject.c | 154 + pcutil/injectlnx | Bin 0 -> 4660 bytes source/cpu/cpuintrf.h | 30 + source/cpu/m68k.h | 342 + source/cpu/m68kconf.h | 183 + source/cpu/osd_cpu.h | 77 + source/cpu/z80.c | 4511 ++++++ source/cpu/z80.h | 62 + source/cpu/z80daa.h | 2051 +++ source/docs/Genesis_ROM_Format.txt | 0 .../REALTEC Cart Mapper - description v1.txt | 0 source/docs/changelog | 22 + source/docs/gamegenie.htm | 235 + source/docs/gen-hw.txt | 0 source/docs/genvdp.txt | 0 source/docs/io.htm | 933 ++ source/docs/license | 340 + source/docs/m5hvc.txt | 0 source/docs/porting.txt | 0 source/docs/readme.txt | 0 source/docs/ssf2tnc.txt | 0 source/docs/todo.txt | 0 source/eeprom.c | 445 + source/eeprom.h | 64 + source/genesis.c | 184 + source/genesis.h | 32 + source/hvc.h | 440 + source/input.c | 508 + source/input.h | 63 + source/io.c | 215 + source/io.h | 20 + source/m68k/m68kcpu.c | 894 ++ source/m68k/m68kcpu.h | 1837 +++ source/m68k/m68kopac.c | 11948 ++++++++++++++ source/m68k/m68kopdm.c | 13286 ++++++++++++++++ source/m68k/m68kopnz.c | 8746 ++++++++++ source/m68k/m68kops.c | 2093 +++ source/m68k/m68kops.h | 1984 +++ source/macros.h | 34 + source/mem68k.c | 776 + source/mem68k.h | 14 + source/membnk.c | 296 + source/membnk.h | 15 + source/memvdp.c | 48 + source/memvdp.h | 8 + source/memz80.c | 246 + source/memz80.h | 17 + source/ngc/gcaram.c | 85 + source/ngc/gcaram.h | 25 + source/ngc/gui/confjoy.c | 208 + source/ngc/gui/dkpro.h | 877 + source/ngc/gui/dvd.c | 148 + source/ngc/gui/dvd.h | 24 + source/ngc/gui/filesel.c | 540 + source/ngc/gui/font.c | 388 + source/ngc/gui/font.h | 42 + source/ngc/gui/ggentry.c | 351 + source/ngc/gui/gpback.h | 8991 +++++++++++ source/ngc/gui/iso9660.c | 239 + source/ngc/gui/iso9660.h | 44 + source/ngc/gui/legal.c | 100 + source/ngc/gui/mcard.c | 587 + source/ngc/gui/menu.c | 623 + source/ngc/gui/rominfo.c | 403 + source/ngc/gui/rominfo.h | 49 + source/ngc/gui/saveicon.h | 136 + source/ngc/loadrom.c | 201 + source/ngc/ngc.c | 640 + source/ngc/osd.h | 16 + source/ngc/unzip.c | 190 + source/ngc/unzip.h | 26 + source/render.c | 1536 ++ source/render.h | 53 + source/shared.h | 43 + source/sound/fm.c | 4745 ++++++ source/sound/fm.h | 205 + source/sound/sn76489.c | 290 + source/sound/sn76489.h | 91 + source/sound/sn76496.c | 311 + source/sound/sn76496.h | 38 + source/sound/sound.c | 224 + source/sound/sound.h | 29 + source/sound/ym2612.c | 2365 +++ source/sound/ym2612.h | 171 + source/sram.c | 77 + source/sram.h | 40 + source/ssf2tnc.c | 98 + source/ssf2tnc.h | 17 + source/state.c | 356 + source/state.h | 29 + source/system.c | 432 + source/system.h | 74 + source/types.h | 13 + source/unused/dos/SEALINTF.C | 288 + source/unused/dos/SEALINTF.H | 17 + source/unused/dos/config.c | 256 + source/unused/dos/config.h | 65 + source/unused/dos/dos.c | 466 + source/unused/dos/dos.h | 19 + source/unused/dos/error.c | 29 + source/unused/dos/error.h | 13 + source/unused/dos/osd.h | 18 + source/unused/fileio.c | 153 + source/unused/fileio.h | 15 + source/unused/loadrom.c | 52 + source/unused/loadrom.h | 10 + source/unused/unzip.c | 1301 ++ source/unused/unzip.h | 274 + source/unused/win/error.c | 39 + source/unused/win/error.h | 13 + source/unused/win/main.c | 203 + source/unused/win/main.h | 7 + source/unused/win/osd.h | 18 + source/vdp.c | 600 + source/vdp.h | 62 + 119 files changed, 83905 insertions(+) create mode 100644 Makefile create mode 100644 changelog.txt create mode 100644 genplus.txt create mode 100644 pcutil/Makefile create mode 100644 pcutil/inject.c create mode 100644 pcutil/injectlnx create mode 100644 source/cpu/cpuintrf.h create mode 100644 source/cpu/m68k.h create mode 100644 source/cpu/m68kconf.h create mode 100644 source/cpu/osd_cpu.h create mode 100644 source/cpu/z80.c create mode 100644 source/cpu/z80.h create mode 100644 source/cpu/z80daa.h create mode 100644 source/docs/Genesis_ROM_Format.txt create mode 100644 source/docs/REALTEC Cart Mapper - description v1.txt create mode 100644 source/docs/changelog create mode 100644 source/docs/gamegenie.htm create mode 100644 source/docs/gen-hw.txt create mode 100644 source/docs/genvdp.txt create mode 100644 source/docs/io.htm create mode 100644 source/docs/license create mode 100644 source/docs/m5hvc.txt create mode 100644 source/docs/porting.txt create mode 100644 source/docs/readme.txt create mode 100644 source/docs/ssf2tnc.txt create mode 100644 source/docs/todo.txt create mode 100644 source/eeprom.c create mode 100644 source/eeprom.h create mode 100644 source/genesis.c create mode 100644 source/genesis.h create mode 100644 source/hvc.h create mode 100644 source/input.c create mode 100644 source/input.h create mode 100644 source/io.c create mode 100644 source/io.h create mode 100644 source/m68k/m68kcpu.c create mode 100644 source/m68k/m68kcpu.h create mode 100644 source/m68k/m68kopac.c create mode 100644 source/m68k/m68kopdm.c create mode 100644 source/m68k/m68kopnz.c create mode 100644 source/m68k/m68kops.c create mode 100644 source/m68k/m68kops.h create mode 100644 source/macros.h create mode 100644 source/mem68k.c create mode 100644 source/mem68k.h create mode 100644 source/membnk.c create mode 100644 source/membnk.h create mode 100644 source/memvdp.c create mode 100644 source/memvdp.h create mode 100644 source/memz80.c create mode 100644 source/memz80.h create mode 100644 source/ngc/gcaram.c create mode 100644 source/ngc/gcaram.h create mode 100644 source/ngc/gui/confjoy.c create mode 100644 source/ngc/gui/dkpro.h create mode 100644 source/ngc/gui/dvd.c create mode 100644 source/ngc/gui/dvd.h create mode 100644 source/ngc/gui/filesel.c create mode 100644 source/ngc/gui/font.c create mode 100644 source/ngc/gui/font.h create mode 100644 source/ngc/gui/ggentry.c create mode 100644 source/ngc/gui/gpback.h create mode 100644 source/ngc/gui/iso9660.c create mode 100644 source/ngc/gui/iso9660.h create mode 100644 source/ngc/gui/legal.c create mode 100644 source/ngc/gui/mcard.c create mode 100644 source/ngc/gui/menu.c create mode 100644 source/ngc/gui/rominfo.c create mode 100644 source/ngc/gui/rominfo.h create mode 100644 source/ngc/gui/saveicon.h create mode 100644 source/ngc/loadrom.c create mode 100644 source/ngc/ngc.c create mode 100644 source/ngc/osd.h create mode 100644 source/ngc/unzip.c create mode 100644 source/ngc/unzip.h create mode 100644 source/render.c create mode 100644 source/render.h create mode 100644 source/shared.h create mode 100644 source/sound/fm.c create mode 100644 source/sound/fm.h create mode 100644 source/sound/sn76489.c create mode 100644 source/sound/sn76489.h create mode 100644 source/sound/sn76496.c create mode 100644 source/sound/sn76496.h create mode 100644 source/sound/sound.c create mode 100644 source/sound/sound.h create mode 100644 source/sound/ym2612.c create mode 100644 source/sound/ym2612.h create mode 100644 source/sram.c create mode 100644 source/sram.h create mode 100644 source/ssf2tnc.c create mode 100644 source/ssf2tnc.h create mode 100644 source/state.c create mode 100644 source/state.h create mode 100644 source/system.c create mode 100644 source/system.h create mode 100644 source/types.h create mode 100644 source/unused/dos/SEALINTF.C create mode 100644 source/unused/dos/SEALINTF.H create mode 100644 source/unused/dos/config.c create mode 100644 source/unused/dos/config.h create mode 100644 source/unused/dos/dos.c create mode 100644 source/unused/dos/dos.h create mode 100644 source/unused/dos/error.c create mode 100644 source/unused/dos/error.h create mode 100644 source/unused/dos/osd.h create mode 100644 source/unused/fileio.c create mode 100644 source/unused/fileio.h create mode 100644 source/unused/loadrom.c create mode 100644 source/unused/loadrom.h create mode 100644 source/unused/unzip.c create mode 100644 source/unused/unzip.h create mode 100644 source/unused/win/error.c create mode 100644 source/unused/win/error.h create mode 100644 source/unused/win/main.c create mode 100644 source/unused/win/main.h create mode 100644 source/unused/win/osd.h create mode 100644 source/vdp.c create mode 100644 source/vdp.h diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e012c91 --- /dev/null +++ b/Makefile @@ -0,0 +1,174 @@ +#--------------------------------------------------------------------------------- +# Generic makefile for Gamecube projects +# +# Tab stops set to 4 +# | | | | +# 0 1 2 3 +#--------------------------------------------------------------------------------- +# Clear the implicit built in rules +#--------------------------------------------------------------------------------- +.SUFFIXES: +#--------------------------------------------------------------------------------- +# TARGET is the name of the output +# BUILD is the directory where object files & intermediate files will be placed +# SOURCES is a list of directories containing source code +# INCLUDES is a list of directories containing extra header files +#--------------------------------------------------------------------------------- +TARGET := genplus +BUILD := build +SOURCES := source source/m68k source/cpu source/sound \ + source/ngc source/ngc/gui +INCLUDES := source source/m68k source/cpu source/sound \ + source/ngc source/ngc/gui + +#--------------------------------------------------------------------------------- +# options for code generation +#--------------------------------------------------------------------------------- +MACHDEP = -DGEKKO -mcpu=750 -meabi -mhard-float +CFLAGS = -g -O2 -Wall $(MACHDEP) $(INCLUDE) \ + -DGENESIS_HACKS="1" \ + +LDFLAGS = $(MACHDEP) -mogc -Wl,-Map,$(notdir $@).map -Wl,--cref + +PREFIX := powerpc-gekko- + +#export PATH:=/c/devkitPPC_r11/bin:/bin + +#--------------------------------------------------------------------------------- +# list of directories containing libraries, this must be the top level containing +# include and lib +#--------------------------------------------------------------------------------- +LIBDIRS := /c/devkitPro/devkitPPC + +#--------------------------------------------------------------------------------- +# any extra libraries we wish to link with +#--------------------------------------------------------------------------------- +LIBS := -logc -lm -lz -logcsys -lsdcard + +#--------------------------------------------------------------------------------- +# no real need to edit anything past this point unless you need to add additional +# rules for different file extensions +#--------------------------------------------------------------------------------- +ifneq ($(BUILD),$(notdir $(CURDIR))) +#--------------------------------------------------------------------------------- +export OUTPUT := $(CURDIR)/$(TARGET) +export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) + +export CC := $(PREFIX)gcc +export CXX := $(PREFIX)g++ +export AR := $(PREFIX)ar +export OBJCOPY := $(PREFIX)objcopy +#--------------------------------------------------------------------------------- +# automatically build a list of object files for our project +#--------------------------------------------------------------------------------- +CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) +CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) +SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S))) +#--------------------------------------------------------------------------------- +# use CXX for linking C++ projects, CC for standard C +#--------------------------------------------------------------------------------- +ifeq ($(strip $(CPPFILES)),) + export LD := $(CC) +else + export LD := $(CXX) +endif + +export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(sFILES:.s=.o) $(SFILES:.S=.o) + +#--------------------------------------------------------------------------------- +# build a list of include paths +#--------------------------------------------------------------------------------- +export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ + $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ + -I$(CURDIR)/$(BUILD) + +#--------------------------------------------------------------------------------- +# build a list of library paths +#--------------------------------------------------------------------------------- +export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) + +export OUTPUT := $(CURDIR)/$(TARGET) +.PHONY: $(BUILD) clean + +#--------------------------------------------------------------------------------- +$(BUILD): + @[ -d $@ ] || mkdir $@ + @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile + +#--------------------------------------------------------------------------------- +clean: + @echo clean ... + @rm -fr $(BUILD) *.elf + +#--------------------------------------------------------------------------------- +run: + psoload $(TARGET).dol + +#--------------------------------------------------------------------------------- +reload: + psoload -r $(TARGET).dol + + +#--------------------------------------------------------------------------------- +else + +DEPENDS := $(OFILES:.o=.d) + +#--------------------------------------------------------------------------------- +# main targets +#--------------------------------------------------------------------------------- +$(OUTPUT).dol: $(OUTPUT).elf + @echo output ... $(notdir $@) + @$(OBJCOPY) -O binary $< $@ + +#--------------------------------------------------------------------------------- +$(OUTPUT).elf: $(OFILES) + @echo linking ... $(notdir $@) + @$(LD) $^ $(LDFLAGS) $(LIBPATHS) $(LIBS) -o $@ + +#--------------------------------------------------------------------------------- +# Compile Targets for C/C++ +#--------------------------------------------------------------------------------- + +#--------------------------------------------------------------------------------- +%.o : %.cpp + @echo Compiling ... $(notdir $<) + @$(CXX) -MMD $(CFLAGS) -o $@ -c $< + +#--------------------------------------------------------------------------------- +%.o : %.c + @echo Compiling ... $(notdir $<) + @$(CC) -MMD $(CFLAGS) -o $@ -c $< + +#--------------------------------------------------------------------------------- +%.o : %.S + @echo Compiling ... $(notdir $<) + @$(CC) -MMD $(CFLAGS) -D_LANGUAGE_ASSEMBLY -c $< -o $@ + +#--------------------------------------------------------------------------------- +%.o : %.s + @echo Compiling ... $(notdir $<) + @$(CC) -MMD $(CFLAGS) -D_LANGUAGE_ASSEMBLY -c $< -o $@ + +#--------------------------------------------------------------------------------- +# canned command sequence for binary data +#--------------------------------------------------------------------------------- +define bin2o + cp $(<) $(*).tmp + $(OBJCOPY) -I binary -O elf32-powerpc -B powerpc \ + --rename-section .data=.rodata,readonly,data,contents,alloc \ + --redefine-sym _binary_$*_tmp_start=$*\ + --redefine-sym _binary_$*_tmp_end=$*_end\ + --redefine-sym _binary_$*_tmp_size=$*_size\ + $(*).tmp $(@) + echo "extern const u8" $(*)"[];" > $(*).h + echo "extern const u32" $(*)_size[]";" >> $(*).h + rm $(*).tmp +endef + +-include $(DEPENDS) + +#--------------------------------------------------------------------------------- +endif +#--------------------------------------------------------------------------------- diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..06ab595 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,131 @@ +The Genesis Plus Project +------------------------------ + +CHANGELOG: + +- completely rewrote EEPROM emulation: support for all known serial EEPROM types (24C01-24C65) and mappers (Sega, Acclaim, EA, COdemasters) +used in few games (now use game database) as backup RAM. This should fix SRAM load/save support in the following games: + + + +20/07/2007: +[Genesis] +- corrected TeamPlayer support: fix multiplayer in Gauntlet 4 (Sept. version), Pengo and a lot of others +- added J-Cart support: enable multiplayer in Codemasters games (Pete Sampras, Micromachines games, Super Skidmarks) +- added serial EEPROM autodetection: fix games with bad SRAM informations in header (NBA Jam TE) +- added SVP faking: display 2D graphics in Virtua Racing (the game is however still unplayable) +- added support for more internal IO registers: fixe some unlicensed games (Wisdom Tree games...) +- added preliminary support for unmapped protection device: fix some unlicensed games with special built-in hardware (Squirell King, Lion King 2...) +- added "Soft Reset" combo (in game, use L+Z triggers): this should be like pressing the RESET button on a real Genesis and this is required + in some games to enable special features or even complete the game (ex: X-Men). + +[NGC] +- added separate configuration for PortA/PortB inputs (GAMEPAD, MULTITAP or NONE, see Joypad Config): this let you setting + PORTB as unplugged, which is needed in some games to access special modes or enable cheat codes (Alien Storm, X-Men...) +- Freezestate & SRAM files are now compressed (using zlib) +- FreezeState & SRAM files can now be saved/loaded to/from SDCARD: located in /genplus/saves/ from the root of your SDCARD +- changed initial ROMS directory for SDCARD user: now looking for /genplus/roms/ from the root of your SDCARD +- added user-transparent SRAM autoload (detection order is MCARD then SDCARD, SLOTA then SLOTB) +- "System reboot" is now used for console reboot and SD/PSO reload (if detected) +- added new font: now use original IPL font, extracted from Bootrom +- modified controls when going into the rom selection menu (DVD or SDCARD): + . use B button to go up one directory + . use Z button to quit the file selection menu + . use L/R triggers to go down/up one full page + . use Left/Right buttons or Analog stick to scroll the selected entry's filename when it can't be full displayed +- various menu rearrangment, minor bugfixes & sourcecode cleanup + +21/06/2007: +- added 4.7GB DVD support for WII drives (the maximal allowed size for Gamecube DVD is still 1.35GB) +- removed MPAL video timings, always use 60Hz NTSC: fix display problems for PAL wii users (no more PAL50 version needed) +- added Console Reboot option in main menu (IPL Reboot) +- added Multitap support (EA 4-Way Play and Sega Teamplayer): allowed up to four players in games supporting those peripherals +- added partial Sega Menacer lightgun support (use Analog Stick): automatically set when detecting the 6-in-1 Menacer game + +18/05/2007: +- you can now switch between FM cores without reseting the game. FM registers value are automatically restored when switching. +- modified PAL framesync a little bit: the 20ms period is now applied between the start of 2 consecutive frames, +no more between the end of the previous and the start of the next one, which seems more correct to me +- removed the previous VINT timings modification because it brokes some games (Rocket Knight, Thunderforce III,...) +- added automatic Timing configuration (VDP latency, VINT timing & alternate Line Timing) at game loading, based upon specific romname detection. +This means you can still modify some of these options afterwards but they are now automatically set/unset when loading a game which need +special timing fixes. These fixes are also automatically desactivated when the current game doesn't need them. + +For your information, games that are actually detected and need special timings to run properly are: + .Legend of Galahad & Road Rash series (single line not rendered properly) + .Sesame Street Counting Cafe (don't boot) + .Chaos Engine/Soldiers of Fortune (graphic glitches on scrolling) + + +08/05/2007: +- corrected L & R buttons assignment: fixes Genesis X & Z buttons being inverted +- VINT timings are now a little more accurate: fixes Sesame's Street Counting Cafe +- SN76496 MAX_OUTPUT back to normal +- modified FB_WNOISE value in SN76496 core according to John Kortink's last informations +- added support for Maxim's PSG core, same as used in SMSPLUS (it becomes the default PSG core) +- updated FM core to the latest MAME version +- corrected DAC output level (fixes voices and some special FX being too low) +- added support for Gens YM2612 (FM) core (MAME's one still remains default FM core) +- added configurable preamplification for each sound cores (see Emulator Options) +- added some other configurable sound options (boost overall volume, FM improvment for Gens YM2612) + +11/04/2007: +- corrected MAX_OUTPUT value in SN76496 core: fix PSG sound (SFX) volume +- removed unused sound buffer allocation + +26/03/2007: +- added DVD automount: automatically call libogc DVD_Mount function if ISO PVD reading failed (idea taken from softdev's last neocdredux release). This may be useful for loading roms from a DVD after booting from SDLOAD or after stopping DVD motor. +- added "DVD motor off" feature, like in others emulators +- corrected Memory Card mounting function: EXI_ProbeReset() function was never called if the first mounting attempt failed. Should fix some of the "Unable to mount memory card" errors. + +22/03/2007: + - added SDCARD subdirectory browsing and LFN (255 char. max) support + +17/03/2007: + - remove some rendering unused code (only used by DOS version of genesis plus) for little speedup + - added an option to enable alternate line rendering timing (fix single line error in Road Rash series and Legend of Galahad's Intro) + - Color RAM update now always reset color 0 to border color (fix color glitches in Mortal Kombat,...) (thanks to Noop's for the idea) + - added last Softdev's modifications (normalised memory access and ASM GU functions used intead of 'C' ones) for some speedup + - updated gcaram.c to be compatible with last libogc version + +09/03/2007: +- little rendering code speedups +- modified HV counter tables (fix graphic glitches in Skitchin's sky, Lotus 2 Recs, Panorama Cotton, Dashin Desperados & maybe more) +- completely rewrote DMA timings emulation so that it works for all games (no more cpu freezing) +- added all DMA tranfer rates handling for each three DMA modes and added dma busy flag emulation +- modified interrupts handling on VDP register #0 and #1 writes (fix Lemmings status bar) +- added VDP RAM write latency (fix Chaos Engine/Soldier of Fortune gfx glitches) +- modified FM timers handling a bit (fix Vectorman2 music) +- corrected Sprite Limit rendering (fix Sonic 1 & Micromachines 2 title screens) +- corrected IO Registers writes (fix Decap' Attack controls, no more need for alternate input) +- corrected 6 Buttons Pad emulation (fix 6buttons detection in Mortal Kombat 3, Comix Zone and other 6-buttons compatible games) +- modified sound mixing a bit according to Generator sourcecode (FM and PSG ratios seems more correct) +- added separate CPU Region (USA, Europe, Japan,...) & Speed (PAL or NTSC) choice in menu options +- modified main frame synchro in PAL mode (fix sound glitch in this mode), thanks to Softdev for the solution +- added savestates support (go to SRAM menu, memory card supports only) + +07/02/2007: (Eke-Eke) +- fm timers fixed (fix missing music in Castle of Illusion, Quackshot, Undead Line, Wonderboy in Monster Lair, Cal 50, Turbo Outrun, Thundeforce 4 and maybe more) +- added complete EEPROM emulation (save support now works fine in Wonderboy5, Megaman Willy Wars, NBA Jam...) (credits to Notaz, adapted from Picodrive code) +- added preliminar dma timing emulation (fix bottom screen in Legend of Galahad) (credits to Notaz, adapted from Picodrive code) +- hack: clear Vint pending after Hint (INT level 4) acknowledge (fix Fatal Rewind) +- hack: modify read_bus16 to return a random value (fake fetch) (fix Time Killers) +- modified cpu execution timings, with more correct hblank and interrupts timing (fix ISS Deluxe, Double Dragon 2 and certainly more) (Based on Gens code) +- modified busreq mechanism: better synchro between z80 & 68k (no need to dejitter anymore) (Based on Gens code) +- added sprite collision detection (fix Strider 2) +- modified dma fill operation according to correct endianness (fix Contra Hardcorps gfx garbage) + + +??? + + +WIP1.2 unzip.c + Added partial zip support + +WIP1.1 sio.c added + Added six button pad support from x86 Gens + Additional changes based on Charles MacDonald's gen-hw.txt + +WIP1 07 March 2006 + Updated SN76496 driver + Added GX Hardware Scaling \ No newline at end of file diff --git a/genplus.txt b/genplus.txt new file mode 100644 index 0000000..4c89ed3 --- /dev/null +++ b/genplus.txt @@ -0,0 +1,356 @@ +×××-–—————————————————————————————————-———————————————————————————————————-××× + + ·gGGgø + —————— ·gg• gGee• gGGg ×× ——————————— + þg þ¨ þ¨ g × + ——— þg øg þEeeø þgggg gge·e• ggg•· þ ggg•· ——— + þgG gg þe þ¨ Ng þ· g¨ þi gg¨ + — ·gG ggg þg· þ gg þg g××Sg þg gSggg — + —————— ¨þggg¨ ¨gggg• þ g ¨g×××× ¨g þ× ¨gg ——— + ·•ggg ·•gg + ————————P —— L — U S ——————— + softdev.tehskeen.com + ø°º–––————————————————————————————————————————————————————————————————————×·. +°Ø¨–; -×× description ××- +·/ –––––———— –––––––––– ––—————––––––—— ——–––––– –––––————— + + Genesis Plus emulates the Sega's Genesis/Mega Drive system. It was + originally created by Charles MacDonald and ported to the Nintendo GameCube + by The "Genesis Plus" Team. It is an open source emulator and a community + project which aims to bring you blast processing into the past. + + Using this "emulator" you will be able to enjoy all of your classic 16bit + games in all of their glory. GenesisPlus has been converted from a PC + based platform to run on the GameCube's proprietary PPC Gekko processor + and features customized code to give you the best gaming experience + possible. + + This port is based on Genesis Plus 1.2 sourcecode but it's also featuring a lot of + modifications & additions to improve games compatibility, emulation accuracy + and various peripheral supports. See changelog.txt for the whole history. + + ... Features ... + + . accurate & full speed Sega Genesis emulation + . Stereo Sound (@48 kHz) + . PAL Megadrive (50Hz) timings support + . 1~4 Players support + . 6-Buttons gamepad support + . Sega TeamPlayer & EA 4-Way Play support + . J-Cart support (autodetected) + . partial Sega Menacer support (autodetected for Menacer 6-in-1 game) + . Freeze State support + . SRAM support + . serial EEPROM support (used by a few games as backup RAM) + . ROM banking support (Super Street Fighter 2) + . External RAM banking support (Phantasy Star 4, Legend of Thor,…) + . Game Genie codes support + . ROM Information Screen + . Zipped roms support + . Interleaved roms support (.smd) + . Load roms from SDCARD or DVD (4.7GB DVD support for Wii users) + . Load/Save SRAM and FreezeState files (compressed) from/to Memory Card & SDCARD + . SRAM autoload feature + . SDLOAD or IPL reboot feature + + + ø°º–––————————————————————————————————————————————————————————————————————×·. +°Ø¨–; ×-× installation ×-× +·/ –––––———— –––––––––– ––—————––––––—— ——–––––– –––––————— + +The emulator is provided as a .dol which is a Gamecube Executable. You only need to load and run +the DOL on your GC or WII (Gamecube controller is needed) using various methods (Bootable DVD, SDLOAD,...) +If you have no idea on how to load&run a DOL, please go here on follow the available guides: +http://modyawii.tehskeen.com/ (Booting Homebrew Section) + +SDCARD users should create a directory named "genplus" at the root of the SDCARD. +Inside this directory, you have to create then a subdirectory named "roms" to put all your roms. +You should also create a subdirectory named "saves" where SRAM and FreezeState files will be saved. + +If using a DVD to load the roms, the format of the image you burned must be ISO9960 +or you won't be able to read from it. The maximal readable size is 1.35GB for Gamecube users +and 4.7GB for Wii users. + +IMPORTANT: When putting roms either on DVD or SDCARD, it is recommended to use subdirectories as there is + a limit of 1000 files per directory. + + + + ø°º–––————————————————————————————————————————————————————————————————————×·. +°Ø¨–; -×× usage -×× +·/ –––––———— –––––––––– ––—————––––––—— ——–––––– –––––————— + + You'll start off with the main introduction screen and after pressing "A" + you will be at the main menu. Note that at anytime during gameplay you can + return to the main menu by tapping on that little Z button (you know, the + one on your controller). + + Pressing 'L + Z' Triggers during Gameplay will execute a "Soft Reset". + This should be like pressing the RESET button on a real Genesis. + This is needed by some games to unlock special features and by the X-Men + game to complete the "Mojo's Crunch" level. + + Pressing 'B' in any menu will get you back to the previous screen. + + Of course it's a menu so you have yourself a few things to choose from. + So here's a list and what they do. + + + PLAY GAME: Takes you into or back to the game. + ----------------------------------------------------------------------------------- + + + GAME INFOS: Shows basic ROM information + ----------------------------------------------------------------------------------- + + This screen shows some basic information for the loaded ROM. + Of note is the supports area at the bottom of the list. + Use Up/Down buttons or Analog Stick to scrolldown the screen. + If the ROM supports 6-button gamepads, they are automatically selected for you. + Otherwise, the standard 3-button pad is used. (This can also be forced in Joypad Config menu) + + + RESET GAME: Performs a soft-reset on the genesis virtual console + ----------------------------------------------------------------------------------- + + + LOAD NEW GAME: Let you load a new game from DVD or SDCARD + ----------------------------------------------------------------------------------- + + When entering the rom selection menu (DVD or SDCARD), following controls are used: + + . A button : load the selected file + . B button : go up one directory + . Z button : quit the file selection menu + . L/R triggers : go down/up one full page + . Left/Right buttons or Analog stick : scroll the selected entry's filename when it can't be full displayed + . Up/Down buttons or Analog stick : select previous/next file + + * Load from DVD: + **************** + + A DVD browser is displayed. Navigate and select your ROM from here. + IMPORTANT: Your DVD must be in ISO9660 format + + * Load from SDCARD: + ******************* + + A SDCARD browser is displayed. Navigate and select your ROM from here. + IMPORTANT: To load roms from SDCARD, you have to use a SDCARD adapter in MC SlotA + On the SDCARD, roms must be initially placed in /genplus/roms subdirectory + + In both cases, the maximum number of files per directory (DVD or SDCARD) is 1000. + It is *recommended* to use subdirectories. + + + EMULATOR OPTIONS: Let you configure various options + ----------------------------------------------------------------------------------- + + Misc Options: + ************* + + X and Y are to try to compensate for TVs with high overscan, or if + you just want to play on a smaller area. + + VDP Latency is used to be more accurate in term of VRAM write timing, + it is required by some games (Chaos Engine...) to be displayed properly + (OFF by default, automatically set when specific roms are detected) + + DMA Timing is used to be more accurate in term of DMA copy to V-RAM timing, + it is required by some games (Legend of Galahad...) to be displayed properly + (ON by default) + + ALT. timing let you modify the line rendering timing. This is used in some games + (Road Rash series, Legend of Galahad) which have single line display glitch + (OFF by default, automatically set when specific roms are detected) + + NOTE: These options are now automatically set when loading a game which need special timing fixes. + These fixes are also now automatically desactivated when the current game doesn't need them. + For your information, games that actually need special timings to run properly are: + .Legend of Galahad & Road Rash series (single line not rendered properly) + .Sesame Street Counting Cafe (don't boot) + .Chaos Engine/Soldiers of Fortune (graphic glitches when scrolling) + + CPU Mode let you force the CPU speed for the game: + * AUTO: orignal CPU speed is automatically detected + * NTSC: 60hz Genesis display + * PAL: 50Hz Genesis display + The game will automatically be be reloaded after you change this setting. + + REGION let you force the region setting for the game: + when changing region setting, some games may display different things but also may not load + if they have some internal region detection code. + * AUTO: orignal game region is automatically detected + * EUR (europe 50Hz), USA (usa 60Hz), JAPAN (japan 60Hz) or JAPAN_PAL (japan 50Hz) + The game will automatically be be reloaded after you change this setting. + + SRAM AUTOLOAD let you enable/disable automatic SRAM loading when starting a new game. + The detection order is: MCARD (SLOTA) > MCARD (SLOTB) > SDCARD (SLOTA) > SDCARD (SLOTB) + + + Sound Options: + ************** + + PSG VOLUME let you adjust the global volume level for the PSG output (0~200%) + FM Volume let you adjust the global volume level for the FM output (0~200%) + Default values depends on the current FM & PSG core and are automatically set when switching between cores. + + BOOST VOLUME let you modify the overall sound level (0~4x). + This could be useful when adjusting FM and PSG relative levels. + Setting those values too high may produce some bad effects. + + HQ YM2612 is only useful when selecting Gens FM core, in order to have the most accurate YM2612 emulation. + + FM CORE let you choose which YM2612 emulation core to use, both have specific issues with some games: + * GENS is the core used in Gens, a famous Genesis emulator for PC platforms + * MAME is the one used in MAME (DEFAULT) + + PSG CORE let you choose which PSG emulation core to use: + * MAME is the one used in MAME + * SMSP is the one developped by Maxim from smspower.org (DEFAULT) + + + + Configure Joypads: + ****************** + + Allows you to configure the joypads. + Here you can remap all 6 buttons, and adjust the Analog stick + sensitivity. A lower value is more sensitive. + + IMPORTANT: the Analog Stick is also used when emulating the Sega Menacer lightgun, + so you may want to reduce the sensibility when playing the Menacer 6-in-1 game + + + TYPE let you choose the type of the emulated Genesis gamepads (3-Buttons or 6-Buttons) + Genesis Plus automatically detects and set this option if the current game supports 6-Buttons but + you can also force use of 3-Buttons gamepads if you prefer. + + * 3BUTTONS: use classic Genesis controllers + * 6BUTTONS: use 6-Buttons Genesis controllers + + + PORTA and PORTB let you choose which type of device to be plugged in each two Genesis input ports: + + * GAMEPAD: single gamepad (3 or 6-buttons, see above) + * MULTITAP: multiplayer adapter (Sega Teamplayer or EA 4-Way Play) + * NONE: unplugged + + IMPORTANT: + + 1/ MULTITAP should only be plugged if the game is supporting one of the multiplayer adapter. + Actually, both Sega Teamplayer and EA 4-Way Play adapters are supported. + Games are usually supporting only one of the above adapters but Genesis Plus automatically detect + which one should be used. + + 3/ Most multiplayer games will work with MULTITAP plugged in PORTA but some of them require + a GAMEPAD to be plugged in PORTA and the MULTITAP to be plugged in PORTB. + + 4/ MULTITAP shouldn't be plugged in both ports since only games supporting more than 4 players + can take advantage of this configuration. As we only have 4 controllers max. on the Gamecube, + only the 4 first gamepads will effectively been seen as plugged. + + 5/ J-Cart games (Micromachines games, Pete Sampras games, Super Skidmarks) use a built-in adapter + to enable 2 additional gamepads to be plugged and are not compatible with any of the above adapters. + So, do not activate MULTITAP with those games, they are automatically detected by the system which + configure itself to enable up to 4 players support. + + 6/ Be sure that all controllers are correctly plugged when you switch on the console, otherwise, + they won't be detected. Also don't unplug any controllers or you will need to reboot the system. + + 7/ Changing Controller Type or Port settings will reset the current game. + + 8/ When the 6-in-1 Menacer game is detected, PORTA is forced to NONE and PORTB forced to MENACER, you + can not change those settings as long as you don't load another rom (previous settings will be restored) + + + + Game Genie Cheats: + ****************** + + Code entry for those of you into cheating :) + This screen lets you enter up to eight Game Genie codes. + Use the A key to select/release an entry + Use the B key to exit. + + + + MEMORY MANAGER: Let you managed SRAM and FreezeState files + ----------------------------------------------------------------------------------- + + . SRAM Manager: Let you load/save SRAM data from/to the selected device + . STATE Manager: Let you load/save FreezeState data from/to the selected device + + For each submenu, you can now choose the device type and location. + Be sure to set this according to your system configuration before saving/loading files. + + . Device: Let you choose the device to use: SDCARD or MCARD + . SLOT: Let you choose which MC slot to use for the device + + IMPORTANT: + + 1/ when using NGC Memory Card in SLOTA, some mounting errors may occur. In this case, + remove and insert the Memory Card again before trying to save/load anything. + + 2/ when using SDCARD, the directory /genplus/saves must exist + + 3/ for Wii users, please note that the SD slot can *NOT* be acceeded so use a SD-Adapter in a MC SLot + + + + STOP DVD MOTOR: Stop the DVD motor and the disc from spinning during playtime + ----------------------------------------------------------------------------------- + + + SYSTEM REBOOT: + ----------------------------------------------------------------------------------- + + For users of SDLoad or PSOLoad, you can call this to go back. + For others, this will reboot the system + + + + ø°º–––————————————————————————————————————————————————————————————————————×·. +°Ø¨–; ××- develloper notes ××- +·/ –––––———— –––––––––– ––—————––––––—— ——–––––– –––––————— + +According to the GNU status of this project, the sourcecode MUST be included in any binary releases you made. +To recompile the sourcecode, you will need to have installed: + . DevkitPPC environment + . libOGC last sources + +You also need to replace the gu_psasm.S file which is located in the /LIBBOGC directory (from the root of libogc source directory) +with the one included in this release and then recompile/reinstall libogc. + +If you have no idea on how to compile DOLs , please refer to this thread: +http://www.tehskeen.com/forums/showthread.php?t=2968. + + + ø°º–––————————————————————————————————————————————————————————————————————×·. +°Ø¨–; ××- credits ××- +·/ –––––———— –––––––––– ––—————––––––—— ——–––––– –––––————— + + coding - the "genesis plus team" + softdev + honkeykong + markcube + + additionnal code and support - eke-eke + + graphics - brakken + + documentation - softdev (chm) + brakken (user d0x) + eke-eke (rewrite and changelog updates) + + additional credits: + + • Stephane Dallongeville for the YM2612 core from his GENS project (http://gens.consolemul.com/) and + for making Gens opensource, which has been an unvaluable help while upgrading this emulator + • Maxim for his SN76489 core (http://www.smspower.org), already use ins SMSPlus + • People at SMSPower's and SpritesMind's forums (http://www.spritesmind.net) for their technical help + + (see /doc for original credits) + + +×××-–—————————————————————————————————-———————————————————————————————————-××× diff --git a/pcutil/Makefile b/pcutil/Makefile new file mode 100644 index 0000000..18d05ce --- /dev/null +++ b/pcutil/Makefile @@ -0,0 +1,3 @@ +inject: inject.c + @gcc -O2 -Wall inject.c -o inject + @strip inject diff --git a/pcutil/inject.c b/pcutil/inject.c new file mode 100644 index 0000000..73098cb --- /dev/null +++ b/pcutil/inject.c @@ -0,0 +1,154 @@ +/**************************************************************************** + * Genesis Plus 1.04 + * + * Developer ROM injector. + * + * You should set ROMOFFSET to match ngc.c, as this will change as the + * binary expands and/or contracts. + ****************************************************************************/ +#include +#include +#include + +#define DOLHEADERLENGTH 256 // GC DOL Header Length +#define MAXTEXT 7 // Maximum 7 Text Sections +#define MAXDATA 11 // Maximum 11 Data Sections + +struct DOLHEADER{ + unsigned int textOffsets[MAXTEXT]; + unsigned int dataOffsets[MAXDATA]; + + unsigned int textAddress[MAXTEXT]; + unsigned int dataAddress[MAXDATA]; + + unsigned int textLength[MAXTEXT]; + unsigned int dataLength[MAXDATA]; + + unsigned int bssAddress; + unsigned int bssLength; + + unsigned int entryPoint; + unsigned int unused[MAXTEXT]; +} dolheader; + +unsigned int FLIP32(unsigned int b) +{ + unsigned int c; + + c = ( b & 0xff000000 ) >> 24; + c |= ( b & 0xff0000 ) >> 8; + c |= ( b & 0xff00 ) << 8; + c |= ( b & 0xff ) << 24; + + return c; +} + +#define ROMOFFSET 0x80600000 + +int main( int argc, char *argv[] ) +{ + FILE *infile, *outfile; + char *dol; + char *rom; + int dollen, romlen, outlen; + char *sig = "GENPLUSR"; + + if ( argc != 4 ) + { + printf("Usage : %s genplus.dol genesisrom.smd output.dol\n", argv[0]); + return 1; + } + + /*** Try to open all three handles ***/ + infile = fopen(argv[1], "rb"); + if ( infile == NULL ) + { + printf("Unable to open %s for reading\n", argv[1]); + return 1; + } + + /*** Allocate and load ***/ + fseek(infile, 0, SEEK_END); + dollen=ftell(infile); + fseek(infile, 0, SEEK_SET); + + dol = calloc(sizeof(char), dollen + 32); + + if ( fread(dol, 1, dollen, infile ) != dollen ) + { + free(dol); + printf("Error reading %s\n", argv[1]); + fclose(infile); + return 1; + } + + fclose(infile); + + infile = fopen(argv[2], "rb"); + if ( infile == NULL ) + { + printf("Unable to open %s for reading\n", argv[2]); + free(dol); + return 1; + } + + /*** Allocate and load ***/ + fseek( infile, 0, SEEK_END); + romlen = ftell(infile); + fseek( infile, 0, SEEK_SET); + rom = calloc( sizeof(char), romlen + 48 ); + + if ( fread(rom, 1, romlen, infile) != romlen ) + { + printf("Error reading %s\n", argv[2]); + fclose(infile); + free(rom); + free(dol); + return 1; + } + + fclose(infile); + + /*** Ok, now have both in memory - so update the dol header and get this file done -;) ***/ + memcpy(&dolheader, dol, DOLHEADERLENGTH); + + /*** Align to 32 bytes - no real reason, I just like it -;) ***/ + if ( dollen & 0x1f ) + dollen = ( dollen & ~0x1f ) + 0x20; + + dolheader.dataOffsets[1] = FLIP32(dollen); + dolheader.dataAddress[1] = FLIP32(ROMOFFSET); + dolheader.dataLength[1] = FLIP32(romlen + 32); + + /*** Move the updated header back ***/ + memcpy(dol, &dolheader, DOLHEADERLENGTH); + + outfile = fopen(argv[3], "wb"); + if ( outfile == NULL ) + { + printf("Unable to open %s for writing!\n", argv[3]); + free(rom); + free(dol); + } + + /*** Now simply update the files ***/ + fwrite(dol, 1, dollen, outfile); + fwrite(sig, 1, 8, outfile); + + outlen = FLIP32(romlen); + fwrite(&outlen, 1, 4, outfile); + + char align[32]; + memset(align, 0, 32); + fwrite(align, 1, 20, outfile); + fwrite(rom, 1, romlen, outfile); + fclose(outfile); + + free(dol); + free(rom); + + printf("Output file %s created successfully\n", argv[3]); + + return 0; +} + diff --git a/pcutil/injectlnx b/pcutil/injectlnx new file mode 100644 index 0000000000000000000000000000000000000000..fb6d7cc71966e4eeae0502d1bf1521842192032f GIT binary patch literal 4660 zcmb_gZ)_CD6(5@m9Q0BQaT_;v+f8+}rV5Kq3@t8|0AmcP8yuV?6~Ua(cYD4|?vH!B z7odX1bV12-vTBJBNz+scqWzM#YSct35vV%r5)A!PEBz3)ic*N0c3s@cRov7fhU@P) zyJHTLNVMu$@7{a!e)Hzdn>Vw&ezL1)dtF_fP_14p64YKf76`V3hd=3A+Jz>Th!$~= z_>5SLF522hfB{{COu7RU04)MF!b#)NK#+77bP{d!O_B{`1*qW@LXbFKG`^OB^w(skwsa;JTNAmViQ_J3+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Ss62GPNNi zH=HS&dLo~pY?x`Ykk9I7HlgK<)^O3Hh3`C(Tx>97XjWe1)0sn)`GUr0cse%(z(?Ep zK!^R_Wn!1~rX|yGg28c&w2Xvi7UOZlG?T?l<`Ab5g+b9(DBN%j@G@~=P;_@a*xM87 z+f57`@`oGx2B*yH4hK%Yo4sWRf_y&u>gX`^ejm^Z({kH&donuwsKk$J?q=7#4aiZyEZQ ztvlCPu_2+SVrEL{i9ype+@(D8gWYve4o z@3+HQ@2pSOxBT{l!WveMHa7P0TZcILjRu1TSv8(3wtGQ5Tg364?EsE1fyz!!`Z9=f z6UX!SEO0ZBIToVC@EooM@eC5j^ZGOdo>SF`W&0|KXN@?Xv->dU^N`iN>?dsl@oZA& z`RoC%6>{yoP(>dIujg_M&-Y>Ac%YO&a_anMQaIiR$AIHKK|9x{a0XaAgGor$5r;Acf<1|10Pm<|6z?4BK}=3dj2|jEnAb(&GK7c@OwF znIqt~0rz?hPWgMX1{cB`L|)R1{N-)8r)b7t_irNkHI}tgX3Gf z_A&E54;*vMdFB5afV%)$rH1h_j-P_KcH;O=H~kU*h<&jJ$LGKdaQp~TjTq9)Amy(G zuWl{)mgD~gR3nD%RS@Ury!<|C2S`(!fIbbx_8U-5w;=9IH62PMr!Up^;z7snebp51 EKcha0)Bpeg literal 0 HcmV?d00001 diff --git a/source/cpu/cpuintrf.h b/source/cpu/cpuintrf.h new file mode 100644 index 0000000..148cad4 --- /dev/null +++ b/source/cpu/cpuintrf.h @@ -0,0 +1,30 @@ + +#ifndef CPUINTRF_H +#define CPUINTRF_H + +#include "osd_cpu.h" + +#define CPU_16BIT_PORT 0x4000 +#define CPU_FLAGS_MASK 0xff00 +#define CLEAR_LINE 0 +#define ASSERT_LINE 1 +#define REG_PREVIOUSPC -1 +#define REG_SP_CONTENTS -2 + +/* daisy-chain link */ +typedef struct { + void (*reset)(int); /* reset callback */ + int (*interrupt_entry)(int); /* entry callback */ + void (*interrupt_reti)(int); /* reti callback */ + int irq_param; /* callback paramater */ +} Z80_DaisyChain; + +#define Z80_MAXDAISY 4 /* maximum of daisy chan device */ + +#define Z80_INT_REQ 0x01 /* interrupt request mask */ +#define Z80_INT_IEO 0x02 /* interrupt disable mask(IEO) */ + +#define Z80_VECTOR(device,state) (((device)<<8)|(state)) + + +#endif /* CPUINTRF_H */ diff --git a/source/cpu/m68k.h b/source/cpu/m68k.h new file mode 100644 index 0000000..6fc93b3 --- /dev/null +++ b/source/cpu/m68k.h @@ -0,0 +1,342 @@ +#ifndef M68K__HEADER +#define M68K__HEADER + +/* ======================================================================== */ +/* ========================= LICENSING & COPYRIGHT ======================== */ +/* ======================================================================== */ +/* + * MUSASHI + * Version 3.3 + * + * A portable Motorola M680x0 processor emulation engine. + * Copyright 1998-2001 Karl Stenerud. All rights reserved. + * + * This code may be freely used for non-commercial purposes as long as this + * copyright notice remains unaltered in the source code and any binary files + * containing this code in compiled form. + * + * All other lisencing terms must be negotiated with the author + * (Karl Stenerud). + * + * The latest version of this code can be obtained at: + * http://kstenerud.cjb.net + */ + + + +/* ======================================================================== */ +/* ============================ GENERAL DEFINES =========================== */ + +/* ======================================================================== */ + +/* There are 7 levels of interrupt to the 68K. + * A transition from < 7 to 7 will cause a non-maskable interrupt (NMI). + */ +#define M68K_IRQ_NONE 0 +#define M68K_IRQ_1 1 +#define M68K_IRQ_2 2 +#define M68K_IRQ_3 3 +#define M68K_IRQ_4 4 +#define M68K_IRQ_5 5 +#define M68K_IRQ_6 6 +#define M68K_IRQ_7 7 + + +/* Special interrupt acknowledge values. + * Use these as special returns from the interrupt acknowledge callback + * (specified later in this header). + */ + +/* Causes an interrupt autovector (0x18 + interrupt level) to be taken. + * This happens in a real 68K if VPA or AVEC is asserted during an interrupt + * acknowledge cycle instead of DTACK. + */ +#define M68K_INT_ACK_AUTOVECTOR 0xffffffff + +/* Causes the spurious interrupt vector (0x18) to be taken + * This happens in a real 68K if BERR is asserted during the interrupt + * acknowledge cycle (i.e. no devices responded to the acknowledge). + */ +#define M68K_INT_ACK_SPURIOUS 0xfffffffe + + +/* CPU types for use in m68k_set_cpu_type() */ +enum +{ + M68K_CPU_TYPE_INVALID, + M68K_CPU_TYPE_68000, + M68K_CPU_TYPE_68010, + M68K_CPU_TYPE_68EC020, + M68K_CPU_TYPE_68020, + M68K_CPU_TYPE_68030, /* Supported by disassembler ONLY */ + M68K_CPU_TYPE_68040 /* Supported by disassembler ONLY */ +}; + +/* Registers used by m68k_get_reg() and m68k_set_reg() */ +typedef enum +{ + /* Real registers */ + M68K_REG_D0, /* Data registers */ + M68K_REG_D1, + M68K_REG_D2, + M68K_REG_D3, + M68K_REG_D4, + M68K_REG_D5, + M68K_REG_D6, + M68K_REG_D7, + M68K_REG_A0, /* Address registers */ + M68K_REG_A1, + M68K_REG_A2, + M68K_REG_A3, + M68K_REG_A4, + M68K_REG_A5, + M68K_REG_A6, + M68K_REG_A7, + M68K_REG_PC, /* Program Counter */ + M68K_REG_SR, /* Status Register */ + M68K_REG_SP, /* The current Stack Pointer (located in A7) */ + M68K_REG_USP, /* User Stack Pointer */ + M68K_REG_ISP, /* Interrupt Stack Pointer */ + M68K_REG_MSP, /* Master Stack Pointer */ + M68K_REG_SFC, /* Source Function Code */ + M68K_REG_DFC, /* Destination Function Code */ + M68K_REG_VBR, /* Vector Base Register */ + M68K_REG_CACR, /* Cache Control Register */ + M68K_REG_CAAR, /* Cache Address Register */ + + /* Assumed registers */ + /* These are cheat registers which emulate the 1-longword prefetch + * present in the 68000 and 68010. + */ + M68K_REG_PREF_ADDR, /* Last prefetch address */ + M68K_REG_PREF_DATA, /* Last prefetch data */ + + /* Convenience registers */ + M68K_REG_PPC, /* Previous value in the program counter */ + M68K_REG_IR, /* Instruction register */ + M68K_REG_CPU_TYPE /* Type of CPU being run */ +} m68k_register_t; + +/* ======================================================================== */ +/* ====================== FUNCTIONS CALLED BY THE CPU ===================== */ +/* ======================================================================== */ + +/* You will have to implement these functions */ + +/* read/write functions called by the CPU to access memory. + * while values used are 32 bits, only the appropriate number + * of bits are relevant (i.e. in write_memory_8, only the lower 8 bits + * of value should be written to memory). + * + * NOTE: I have separated the immediate and PC-relative memory fetches + * from the other memory fetches because some systems require + * differentiation between PROGRAM and DATA fetches (usually + * for security setups such as encryption). + * This separation can either be achieved by setting + * M68K_SEPARATE_READS in m68kconf.h and defining + * the read functions, or by setting M68K_EMULATE_FC and + * making a function code callback function. + * Using the callback offers better emulation coverage + * because you can also monitor whether the CPU is in SYSTEM or + * USER mode, but it is also slower. + */ + +/* Read from anywhere */ +unsigned int m68k_read_memory_8(unsigned int address); +unsigned int m68k_read_memory_16(unsigned int address); +unsigned int m68k_read_memory_32(unsigned int address); + +/* Read data immediately following the PC */ +unsigned int m68k_read_immediate_16(unsigned int address); +unsigned int m68k_read_immediate_32(unsigned int address); + +/* Read data relative to the PC */ +unsigned int m68k_read_pcrelative_8(unsigned int address); +unsigned int m68k_read_pcrelative_16(unsigned int address); +unsigned int m68k_read_pcrelative_32(unsigned int address); + +/* Memory access for the disassembler */ +unsigned int m68k_read_disassembler_8 (unsigned int address); +unsigned int m68k_read_disassembler_16 (unsigned int address); +unsigned int m68k_read_disassembler_32 (unsigned int address); + +/* Write to anywhere */ +void m68k_write_memory_8(unsigned int address, unsigned int value); +void m68k_write_memory_16(unsigned int address, unsigned int value); +void m68k_write_memory_32(unsigned int address, unsigned int value); + + + +/* ======================================================================== */ +/* ============================== CALLBACKS =============================== */ +/* ======================================================================== */ + +/* These functions allow you to set callbacks to the host when specific events + * occur. Note that you must enable the corresponding value in m68kconf.h + * in order for these to do anything useful. + * Note: I have defined default callbacks which are used if you have enabled + * the corresponding #define in m68kconf.h but either haven't assigned a + * callback or have assigned a callback of NULL. + */ + +/* Set the callback for an interrupt acknowledge. + * You must enable M68K_EMULATE_INT_ACK in m68kconf.h. + * The CPU will call the callback with the interrupt level being acknowledged. + * The host program must return either a vector from 0x02-0xff, or one of the + * special interrupt acknowledge values specified earlier in this header. + * If this is not implemented, the CPU will always assume an autovectored + * interrupt, and will automatically clear the interrupt request when it + * services the interrupt. + * Default behavior: return M68K_INT_ACK_AUTOVECTOR. + */ +void m68k_set_int_ack_callback(int (*callback)(int int_level)); + + +/* Set the callback for a breakpoint acknowledge (68010+). + * You must enable M68K_EMULATE_BKPT_ACK in m68kconf.h. + * The CPU will call the callback with whatever was in the data field of the + * BKPT instruction for 68020+, or 0 for 68010. + * Default behavior: do nothing. + */ +void m68k_set_bkpt_ack_callback(void (*callback)(unsigned int data)); + + +/* Set the callback for the RESET instruction. + * You must enable M68K_EMULATE_RESET in m68kconf.h. + * The CPU calls this callback every time it encounters a RESET instruction. + * Default behavior: do nothing. + */ +void m68k_set_reset_instr_callback(void (*callback)(void)); + + +/* Set the callback for informing of a large PC change. + * You must enable M68K_MONITOR_PC in m68kconf.h. + * The CPU calls this callback with the new PC value every time the PC changes + * by a large value (currently set for changes by longwords). + * Default behavior: do nothing. + */ +void m68k_set_pc_changed_callback(void (*callback)(unsigned int new_pc)); + + +/* Set the callback for CPU function code changes. + * You must enable M68K_EMULATE_FC in m68kconf.h. + * The CPU calls this callback with the function code before every memory + * access to set the CPU's function code according to what kind of memory + * access it is (supervisor/user, program/data and such). + * Default behavior: do nothing. + */ +void m68k_set_fc_callback(void (*callback)(unsigned int new_fc)); + + +/* Set a callback for the instruction cycle of the CPU. + * You must enable M68K_INSTRUCTION_HOOK in m68kconf.h. + * The CPU calls this callback just before fetching the opcode in the + * instruction cycle. + * Default behavior: do nothing. + */ +void m68k_set_instr_hook_callback(void (*callback)(void)); + + + +/* ======================================================================== */ +/* ====================== FUNCTIONS TO ACCESS THE CPU ===================== */ +/* ======================================================================== */ + +/* Use this function to set the CPU type you want to emulate. + * Currently supported types are: M68K_CPU_TYPE_68000, M68K_CPU_TYPE_68010, + * M68K_CPU_TYPE_EC020, and M68K_CPU_TYPE_68020. + */ +void m68k_set_cpu_type(unsigned int cpu_type); + +/* Pulse the RESET pin on the CPU. + * You *MUST* reset the CPU at least once to initialize the emulation + * Note: If you didn't call m68k_set_cpu_type() before resetting + * the CPU for the first time, the CPU will be set to + * M68K_CPU_TYPE_68000. + */ +void m68k_pulse_reset(void); + +/* execute num_cycles worth of instructions. returns number of cycles used */ +int m68k_execute(int num_cycles); + +/* These functions let you read/write/modify the number of cycles left to run + * while m68k_execute() is running. + * These are useful if the 68k accesses a memory-mapped port on another device + * that requires immediate processing by another CPU. + */ +int m68k_cycles_run(void); /* Number of cycles run so far */ +int m68k_cycles_remaining(void); /* Number of cycles left */ +void m68k_modify_timeslice(int cycles); /* Modify cycles left */ +void m68k_end_timeslice(void); /* End timeslice now */ + +/* Set the IPL0-IPL2 pins on the CPU (IRQ). + * A transition from < 7 to 7 will cause a non-maskable interrupt (NMI). + * Setting IRQ to 0 will clear an interrupt request. + */ +void m68k_set_irq(unsigned int int_level); + + +/* Halt the CPU as if you pulsed the HALT pin. */ +void m68k_pulse_halt(void); + + +/* Context switching to allow multiple CPUs */ + +/* Get the size of the cpu context in bytes */ +unsigned int m68k_context_size(void); + +/* Get a cpu context */ +unsigned int m68k_get_context(void* dst); + +/* set the current cpu context */ +void m68k_set_context(void* dst); + +/* Save the current cpu context to disk. + * You must provide a function pointer of the form: + * void save_value(char* identifier, unsigned int value) + */ +void m68k_save_context( void (*save_value)(char* identifier, unsigned int value)); + +/* Load a cpu context from disk. + * You must provide a function pointer of the form: + * unsigned int load_value(char* identifier) + */ +void m68k_load_context(unsigned int (*load_value)(char* identifier)); + + + +/* Peek at the internals of a CPU context. This can either be a context + * retrieved using m68k_get_context() or the currently running context. + * If context is NULL, the currently running CPU context will be used. + */ +unsigned int m68k_get_reg(void* context, m68k_register_t reg); + +/* Poke values into the internals of the currently running CPU context */ +void m68k_set_reg(m68k_register_t reg, unsigned int value); + +/* Check if an instruction is valid for the specified CPU type */ +unsigned int m68k_is_valid_instruction(unsigned int instruction, unsigned int cpu_type); + +/* Disassemble 1 instruction using the epecified CPU type at pc. Stores + * disassembly in str_buff and returns the size of the instruction in bytes. + */ +unsigned int m68k_disassemble(char* str_buff, unsigned int pc, unsigned int cpu_type); + + +/* ======================================================================== */ +/* ============================= CONFIGURATION ============================ */ +/* ======================================================================== */ + +/* Import the configuration for this build */ +#include "m68kconf.h" + + + +/* ======================================================================== */ +/* ============================== END OF FILE ============================= */ +/* ======================================================================== */ + +#endif /* M68K__HEADER */ + +/*** Not really required, but makes for clean compile under DevkitPPC ***/ +extern int vdp_int_ack_callback(int int_level); diff --git a/source/cpu/m68kconf.h b/source/cpu/m68kconf.h new file mode 100644 index 0000000..801a646 --- /dev/null +++ b/source/cpu/m68kconf.h @@ -0,0 +1,183 @@ +/* ======================================================================== */ +/* ========================= LICENSING & COPYRIGHT ======================== */ +/* ======================================================================== */ +/* + * MUSASHI + * Version 3.3 + * + * A portable Motorola M680x0 processor emulation engine. + * Copyright 1998-2001 Karl Stenerud. All rights reserved. + * + * This code may be freely used for non-commercial purposes as long as this + * copyright notice remains unaltered in the source code and any binary files + * containing this code in compiled form. + * + * All other lisencing terms must be negotiated with the author + * (Karl Stenerud). + * + * The latest version of this code can be obtained at: + * http://kstenerud.cjb.net + */ + + + +#ifndef M68KCONF__HEADER +#define M68KCONF__HEADER + + +/* Configuration switches. + * Use OPT_SPECIFY_HANDLER for configuration options that allow callbacks. + * OPT_SPECIFY_HANDLER causes the core to link directly to the function + * or macro you specify, rather than using callback functions whose pointer + * must be passed in using m68k_set_xxx_callback(). + */ +#define OPT_OFF 0 +#define OPT_ON 1 +#define OPT_SPECIFY_HANDLER 2 + + +/* ======================================================================== */ +/* ============================== MAME STUFF ============================== */ +/* ======================================================================== */ + +/* If you're compiling this for MAME, only change M68K_COMPILE_FOR_MAME + * to OPT_ON and use m68kmame.h to configure the 68k core. + */ +#ifndef M68K_COMPILE_FOR_MAME +#define M68K_COMPILE_FOR_MAME OPT_OFF +#endif /* M68K_COMPILE_FOR_MAME */ + +#if M68K_COMPILE_FOR_MAME == OPT_ON +#include "m68kmame.h" +#else + + + +/* ======================================================================== */ +/* ============================= CONFIGURATION ============================ */ +/* ======================================================================== */ + +/* Turn on if you want to use the following M68K variants */ +#define M68K_EMULATE_010 OPT_ON +#define M68K_EMULATE_EC020 OPT_ON +#define M68K_EMULATE_020 OPT_ON + + +/* If on, the CPU will call m68k_read_immediate_xx() for immediate addressing + * and m68k_read_pcrelative_xx() for PC-relative addressing. + * If off, all read requests from the CPU will be redirected to m68k_read_xx() + */ +#define M68K_SEPARATE_READS OPT_OFF + + +/* If on, CPU will call the interrupt acknowledge callback when it services an + * interrupt. + * If off, all interrupts will be autovectored and all interrupt requests will + * auto-clear when the interrupt is serviced. + */ +#define M68K_EMULATE_INT_ACK OPT_SPECIFY_HANDLER +#define M68K_INT_ACK_CALLBACK(A) vdp_int_ack_callback(A) + + +/* If on, CPU will call the breakpoint acknowledge callback when it encounters + * a breakpoint instruction and it is running a 68010+. + */ +#define M68K_EMULATE_BKPT_ACK OPT_OFF +#define M68K_BKPT_ACK_CALLBACK() your_bkpt_ack_handler_function() + + +/* If on, the CPU will monitor the trace flags and take trace exceptions + */ +#define M68K_EMULATE_TRACE OPT_OFF + + +/* If on, CPU will call the output reset callback when it encounters a reset + * instruction. + */ +#define M68K_EMULATE_RESET OPT_OFF +#define M68K_RESET_CALLBACK() your_reset_handler_function() + + +/* If on, CPU will call the set fc callback on every memory access to + * differentiate between user/supervisor, program/data access like a real + * 68000 would. This should be enabled and the callback should be set if you + * want to properly emulate the m68010 or higher. (moves uses function codes + * to read/write data from different address spaces) + */ +#define M68K_EMULATE_FC OPT_OFF +#define M68K_SET_FC_CALLBACK(A) your_set_fc_handler_function(A) + + +/* If on, CPU will call the pc changed callback when it changes the PC by a + * large value. This allows host programs to be nicer when it comes to + * fetching immediate data and instructions on a banked memory system. + */ +#define M68K_MONITOR_PC OPT_OFF +#define M68K_SET_PC_CALLBACK(A) your_pc_changed_handler_function(A) + + +/* If on, CPU will call the instruction hook callback before every + * instruction. + */ +#define M68K_INSTRUCTION_HOOK OPT_OFF +#define M68K_INSTRUCTION_CALLBACK() your_instruction_hook_function() + + +/* If on, the CPU will emulate the 4-byte prefetch queue of a real 68000 */ +#define M68K_EMULATE_PREFETCH OPT_OFF + + +/* If on, the CPU will generate address error exceptions if it tries to + * access a word or longword at an odd address. + * NOTE: Do not enable this! It is not working! + */ +#define M68K_EMULATE_ADDRESS_ERROR OPT_OFF + + +/* Turn on to enable logging of illegal instruction calls. + * M68K_LOG_FILEHANDLE must be #defined to a stdio file stream. + * Turn on M68K_LOG_1010_1111 to log all 1010 and 1111 calls. + */ +#define M68K_LOG_ENABLE OPT_OFF +#define M68K_LOG_1010_1111 OPT_OFF +#define M68K_LOG_FILEHANDLE some_file_handle + + +/* ----------------------------- COMPATIBILITY ---------------------------- */ + +/* The following options set optimizations that violate the current ANSI + * standard, but will be compliant under the forthcoming C9X standard. + */ + + +/* If on, the enulation core will use 64-bit integers to speed up some + * operations. +*/ +#define M68K_USE_64_BIT OPT_OFF + + +/* Set to your compiler's static inline keyword to enable it, or + * set it to blank to disable it. + * If you define INLINE in the makefile, it will override this value. + * NOTE: not enabling inline functions will SEVERELY slow down emulation. + */ +#ifndef INLINE +#define INLINE static __inline__ +#endif /* INLINE */ + + +/* If your environment requires special prefixes for system callback functions + * such as the argument to qsort(), then set them here or in the makefile. + */ +#ifndef DECL_SPEC +#define DECL_SPEC +#endif + +#endif /* M68K_COMPILE_FOR_MAME */ + + +/* ======================================================================== */ +/* ============================== END OF FILE ============================= */ +/* ======================================================================== */ + +#endif /* M68KCONF__HEADER */ diff --git a/source/cpu/osd_cpu.h b/source/cpu/osd_cpu.h new file mode 100644 index 0000000..2c5edc2 --- /dev/null +++ b/source/cpu/osd_cpu.h @@ -0,0 +1,77 @@ +/******************************************************************************* +* * +* Define size independent data types and operations. * +* * +* The following types must be supported by all platforms: * +* * +* UINT8 - Unsigned 8-bit Integer INT8 - Signed 8-bit integer * +* UINT16 - Unsigned 16-bit Integer INT16 - Signed 16-bit integer * +* UINT32 - Unsigned 32-bit Integer INT32 - Signed 32-bit integer * +* UINT64 - Unsigned 64-bit Integer INT64 - Signed 64-bit integer * +* * +* * +* The macro names for the artithmatic operations are composed as follows: * +* * +* XXX_R_A_B, where XXX - 3 letter operation code (ADD, SUB, etc.) * +* R - The type of the result * +* A - The type of operand 1 * +* B - The type of operand 2 (if binary operation) * +* * +* Each type is one of: U8,8,U16,16,U32,32,U64,64 * +* * +*******************************************************************************/ + + +#ifndef OSD_CPU_H +#define OSD_CPU_H + +typedef unsigned char UINT8; +typedef unsigned short UINT16; +typedef unsigned int UINT32; +__extension__ typedef unsigned long long UINT64; +typedef signed char INT8; +typedef signed short INT16; +typedef signed int INT32; +__extension__ typedef signed long long INT64; + +/* Combine two 32-bit integers into a 64-bit integer */ +#define COMBINE_64_32_32(A,B) ((((UINT64)(A))<<32) | (UINT32)(B)) +#define COMBINE_U64_U32_U32(A,B) COMBINE_64_32_32(A,B) + +/* Return upper 32 bits of a 64-bit integer */ +#define HI32_32_64(A) (((UINT64)(A)) >> 32) +#define HI32_U32_U64(A) HI32_32_64(A) + +/* Return lower 32 bits of a 64-bit integer */ +#define LO32_32_64(A) ((A) & 0xffffffff) +#define LO32_U32_U64(A) LO32_32_64(A) + +#define DIV_64_64_32(A,B) ((A)/(B)) +#define DIV_U64_U64_U32(A,B) ((A)/(UINT32)(B)) + +#define MOD_32_64_32(A,B) ((A)%(B)) +#define MOD_U32_U64_U32(A,B) ((A)%(UINT32)(B)) + +#define MUL_64_32_32(A,B) ((A)*(INT64)(B)) +#define MUL_U64_U32_U32(A,B) ((A)*(UINT64)(UINT32)(B)) + + +/****************************************************************************** + * Union of UINT8, UINT16 and UINT32 in native endianess of the target + * This is used to access bytes and words in a machine independent manner. + * The upper bytes h2 and h3 normally contain zero (16 bit CPU cores) + * thus PAIR.d can be used to pass arguments to the memory system + * which expects 'int' really. + ******************************************************************************/ +typedef union { +#ifdef LSB_FIRST + struct { UINT8 l,h,h2,h3; } b; + struct { UINT16 l,h; } w; +#else + struct { UINT8 h3,h2,h,l; } b; + struct { UINT16 h,l; } w; +#endif + UINT32 d; +} PAIR; + +#endif /* defined OSD_CPU_H */ diff --git a/source/cpu/z80.c b/source/cpu/z80.c new file mode 100644 index 0000000..c657bf0 --- /dev/null +++ b/source/cpu/z80.c @@ -0,0 +1,4511 @@ +/***************************************************************************** + * + * z80.c + * Portable Z80 emulator V2.8 + * + * Copyright (C) 1998,1999,2000 Juergen Buchmueller, all rights reserved. + * + * - This source code is released as freeware for non-commercial purposes. + * - You are free to use and redistribute this code in modified or + * unmodified form, provided you list me in the credits. + * - If you modify this source code, you must add a notice to each modified + * source file that it has been changed. If you're a nice person, you + * will clearly mark each change too. :) + * - If you wish to use this for commercial purposes, please contact me at + * pullmoll@t-online.de + * - The author of this copywritten work reserves the right to change the + * terms of its usage and license at any time, including retroactively + * - This entire notice must remain in the source code. + * + * Changes in 3.2 + * - Fixed undocumented flags XF & YF of RRCA, and CF and HF of + * INI/IND/OUTI/OUTD/INIR/INDR/OTIR/OTDR [Sean Young] + * Changes in 3.1 + * - removed the REPEAT_AT_ONCE execution of LDIR/CPIR etc. opcodes + * for readabilities sake and because the implementation was buggy + * (and I was not able to find the difference) + * Changes in 3.0 + * - 'finished' switch to dynamically overrideable cycle count tables + * Changes in 2.9: + * - added methods to access and override the cycle count tables + * - fixed handling and timing of multiple DD/FD prefixed opcodes + * Changes in 2.8: + * - OUTI/OUTD/OTIR/OTDR also pre-decrement the B register now. + * This was wrong because of a bug fix on the wrong side + * (astrocade sound driver). + * Changes in 2.7: + * - removed z80_vm specific code, it's not needed (and never was). + * Changes in 2.6: + * - BUSY_LOOP_HACKS needed to call change_pc16() earlier, before + * checking the opcodes at the new address, because otherwise they + * might access the old (wrong or even NULL) banked memory region. + * Thanks to Sean Young for finding this nasty bug. + * Changes in 2.5: + * - Burning cycles always adjusts the ICount by a multiple of 4. + * - In REPEAT_AT_ONCE cases the R register wasn't incremented twice + * per repetition as it should have been. Those repeated opcodes + * could also underflow the ICount. + * - Simplified TIME_LOOP_HACKS for BC and added two more for DE + HL + * timing loops. I think those hacks weren't endian safe before too. + * Changes in 2.4: + * - z80_reset zaps the entire context, sets IX and IY to 0xffff(!) and + * sets the Z flag. With these changes the Tehkan World Cup driver + * _seems_ to work again. + * Changes in 2.3: + * - External termination of the execution loop calls z80_burn() and + * z80_vm_burn() to burn an amount of cycles (R adjustment) + * - Shortcuts which burn CPU cycles (BUSY_LOOP_HACKS and TIME_LOOP_HACKS) + * now also adjust the R register depending on the skipped opcodes. + * Changes in 2.2: + * - Fixed bugs in CPL, SCF and CCF instructions flag handling. + * - Changed variable EA and ARG16() function to UINT32; this + * produces slightly more efficient code. + * - The DD/FD XY CB opcodes where XY is 40-7F and Y is not 6/E + * are changed to calls to the X6/XE opcodes to reduce object size. + * They're hardly ever used so this should not yield a speed penalty. + * New in 2.0: + * - Optional more exact Z80 emulation (#define Z80_EXACT 1) according + * to a detailed description by Sean Young which can be found at: + * http://www.msxnet.org/tech/Z80/z80undoc.txt + *****************************************************************************/ + + +#include "shared.h" +#include "cpuintrf.h" +#include "z80.h" + +#define cpu_readop cpu_readmem16 +#define cpu_readop_arg cpu_readmem16 + +#define VERBOSE 0 + +#if VERBOSE +#define LOG(x) logerror x +#else +#define LOG(x) +#endif + +/* execute main opcodes inside a big switch statement */ +#ifndef BIG_SWITCH +#define BIG_SWITCH 1 +#endif + +/* big flags array for ADD/ADC/SUB/SBC/CP results */ +#define BIG_FLAGS_ARRAY 1 + +/* Set to 1 for a more exact (but somewhat slower) Z80 emulation */ +#define Z80_EXACT 1 + +/* on JP and JR opcodes check for tight loops */ +#define BUSY_LOOP_HACKS 1 + +/* check for delay loops counting down BC */ +#define TIME_LOOP_HACKS 1 + +#ifdef X86_ASM +#undef BIG_FLAGS_ARRAY +#define BIG_FLAGS_ARRAY 0 +#endif + +#if 0 +static UINT8 z80_reg_layout[] = { + Z80_PC, Z80_SP, Z80_AF, Z80_BC, Z80_DE, Z80_HL, -1, + Z80_IX, Z80_IY, Z80_AF2,Z80_BC2,Z80_DE2,Z80_HL2,-1, + Z80_R, Z80_I, Z80_IM, Z80_IFF1,Z80_IFF2, -1, + Z80_NMI_STATE,Z80_IRQ_STATE,Z80_DC0,Z80_DC1,Z80_DC2,Z80_DC3, 0 +}; + +static UINT8 z80_win_layout[] = { + 27, 0,53, 4, /* register window (top rows) */ + 0, 0,26,22, /* disassembler window (left colums) */ + 27, 5,53, 8, /* memory #1 window (right, upper middle) */ + 27,14,53, 8, /* memory #2 window (right, lower middle) */ + 0,23,80, 1, /* command line window (bottom rows) */ +}; +#endif + +/****************************************************************************/ +/* The Z80 registers. HALT is set to 1 when the CPU is halted, the refresh */ +/* register is calculated as follows: refresh=(Regs.R&127)|(Regs.R2&128) */ +/****************************************************************************/ +typedef struct { +/* 00 */ PAIR PREPC,PC,SP,AF,BC,DE,HL,IX,IY; +/* 24 */ PAIR AF2,BC2,DE2,HL2; +/* 34 */ UINT8 R,R2,IFF1,IFF2,HALT,IM,I; +/* 3B */ UINT8 irq_max; /* number of daisy chain devices */ +/* 3C */ INT8 request_irq; /* daisy chain next request device */ +/* 3D */ INT8 service_irq; /* daisy chain next reti handling device */ +/* 3E */ UINT8 nmi_state; /* nmi line state */ +/* 3F */ UINT8 irq_state; /* irq line state */ +/* 40 */ UINT8 int_state[Z80_MAXDAISY]; +/* 44 */ Z80_DaisyChain irq[Z80_MAXDAISY]; +/* 84 */ int (*irq_callback)(int irqline); +/* 88 */ int extra_cycles; /* extra cycles for interrupts */ +} Z80_Regs; + +#define CF 0x01 +#define NF 0x02 +#define PF 0x04 +#define VF PF +#define XF 0x08 +#define HF 0x10 +#define YF 0x20 +#define ZF 0x40 +#define SF 0x80 + +#define INT_IRQ 0x01 +#define NMI_IRQ 0x02 + +#define _PPC Z80.PREPC.d /* previous program counter */ + +#define _PCD Z80.PC.d +#define _PC Z80.PC.w.l + +#define _SPD Z80.SP.d +#define _SP Z80.SP.w.l + +#define _AFD Z80.AF.d +#define _AF Z80.AF.w.l +#define _A Z80.AF.b.h +#define _F Z80.AF.b.l + +#define _BCD Z80.BC.d +#define _BC Z80.BC.w.l +#define _B Z80.BC.b.h +#define _C Z80.BC.b.l + +#define _DED Z80.DE.d +#define _DE Z80.DE.w.l +#define _D Z80.DE.b.h +#define _E Z80.DE.b.l + +#define _HLD Z80.HL.d +#define _HL Z80.HL.w.l +#define _H Z80.HL.b.h +#define _L Z80.HL.b.l + +#define _IXD Z80.IX.d +#define _IX Z80.IX.w.l +#define _HX Z80.IX.b.h +#define _LX Z80.IX.b.l + +#define _IYD Z80.IY.d +#define _IY Z80.IY.w.l +#define _HY Z80.IY.b.h +#define _LY Z80.IY.b.l + +#define _I Z80.I +#define _R Z80.R +#define _R2 Z80.R2 +#define _IM Z80.IM +#define _IFF1 Z80.IFF1 +#define _IFF2 Z80.IFF2 +#define _HALT Z80.HALT + +int z80_ICount; +static Z80_Regs Z80; +static UINT32 EA; +static int after_EI = 0; + +static UINT8 SZ[256]; /* zero and sign flags */ +static UINT8 SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ +static UINT8 SZP[256]; /* zero, sign and parity flags */ +static UINT8 SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */ +static UINT8 SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */ + +#include "z80daa.h" + +#if BIG_FLAGS_ARRAY +#include +static UINT8 *SZHVC_add = 0; +static UINT8 *SZHVC_sub = 0; +#endif + +#if Z80_EXACT +/* tmp1 value for ini/inir/outi/otir for [C.1-0][io.1-0] */ +static UINT8 irep_tmp1[4][4] = { + {0,0,1,0},{0,1,0,1},{1,0,1,1},{0,1,1,0} +}; + +/* tmp1 value for ind/indr/outd/otdr for [C.1-0][io.1-0] */ +static UINT8 drep_tmp1[4][4] = { + {0,1,0,0},{1,0,0,1},{0,0,1,0},{0,1,0,1} +}; + +/* tmp2 value for all in/out repeated opcodes for B.7-0 */ +static UINT8 breg_tmp2[256] = { + 0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1, + 0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4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, + 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, + 5,10,10,10,10,11, 7,11, 5,10,10, 0,10,17, 7,11, + 5,10,10,11,10,11, 7,11, 5, 4,10,11,10, 0, 7,11, + 5,10,10,19,10,11, 7,11, 5, 4,10, 4,10, 0, 7,11, + 5,10,10, 4,10,11, 7,11, 5, 6,10, 4,10, 0, 7,11}; + +static UINT8 cc_cb[0x100] = { + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, + 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, + 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, + 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, + 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8}; + +static UINT8 cc_ed[0x100] = { + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, +12,12,15,20, 8, 8, 8, 9,12,12,15,20, 8, 8, 8, 9, +12,12,15,20, 8, 8, 8, 9,12,12,15,20, 8, 8, 8, 9, +12,12,15,20, 8, 8, 8,18,12,12,15,20, 8, 8, 8,18, +12,12,15,20, 8, 8, 8, 8,12,12,15,20, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, +16,16,16,16, 8, 8, 8, 8,16,16,16,16, 8, 8, 8, 8, +16,16,16,16, 8, 8, 8, 8,16,16,16,16, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8}; + +static UINT8 cc_xy[0x100] = { + 4, 4, 4, 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, + 4,14,20,10, 9, 9, 9, 4, 4,15,20,10, 9, 9, 9, 4, + 4, 4, 4, 4,23,23,19, 4, 4,15, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, + 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, + 9, 9, 9, 9, 9, 9,19, 9, 9, 9, 9, 9, 9, 9,19, 9, +19,19,19,19,19,19, 4,19, 4, 4, 4, 4, 9, 9,19, 4, + 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, + 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, + 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, + 4, 4, 4, 4, 9, 9,19, 4, 4, 4, 4, 4, 9, 9,19, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4,14, 4,23, 4,15, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4,10, 4, 4, 4, 4, 4, 4}; + +static UINT8 cc_xycb[0x100] = { +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, +20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, +20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, +20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, +20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, +23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23}; + +/* extra cycles if jr/jp/call taken and 'interrupt latency' on rst 0-7 */ +static UINT8 cc_ex[0x100] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* DJNZ */ + 5, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, /* JR NZ/JR Z */ + 5, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, /* JR NC/JR C */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 0, 0, 0, 0, /* LDIR/CPIR/INIR/OTIR LDDR/CPDR/INDR/OTDR */ + 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, + 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, + 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2, + 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2}; + +static UINT8 *cc[6] = { cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex }; +#define Z80_TABLE_dd Z80_TABLE_xy +#define Z80_TABLE_fd Z80_TABLE_xy + +static void take_interrupt(void); + +#define PROTOTYPES(tablename,prefix) \ + static __inline__ void prefix##_00(void); static __inline__ void prefix##_01(void); static __inline__ void prefix##_02(void); static __inline__ void prefix##_03(void); \ + static __inline__ void prefix##_04(void); static __inline__ void prefix##_05(void); static __inline__ void prefix##_06(void); static __inline__ void prefix##_07(void); \ + static __inline__ void prefix##_08(void); static __inline__ void prefix##_09(void); static __inline__ void prefix##_0a(void); static __inline__ void prefix##_0b(void); \ + static __inline__ void prefix##_0c(void); static __inline__ void prefix##_0d(void); static __inline__ void prefix##_0e(void); static __inline__ void prefix##_0f(void); \ + static __inline__ void prefix##_10(void); static __inline__ void prefix##_11(void); static __inline__ void prefix##_12(void); static __inline__ void prefix##_13(void); \ + static __inline__ void prefix##_14(void); static __inline__ void prefix##_15(void); static __inline__ void prefix##_16(void); static __inline__ void prefix##_17(void); \ + static __inline__ void prefix##_18(void); static __inline__ void prefix##_19(void); static __inline__ void prefix##_1a(void); static __inline__ void prefix##_1b(void); \ + static __inline__ void prefix##_1c(void); static __inline__ void prefix##_1d(void); static __inline__ void prefix##_1e(void); static __inline__ void prefix##_1f(void); \ + static __inline__ void prefix##_20(void); static __inline__ void prefix##_21(void); static __inline__ void prefix##_22(void); static __inline__ void prefix##_23(void); \ + static __inline__ void prefix##_24(void); static __inline__ void prefix##_25(void); static __inline__ void prefix##_26(void); static __inline__ void prefix##_27(void); \ + static __inline__ void prefix##_28(void); static __inline__ void prefix##_29(void); static __inline__ void prefix##_2a(void); static __inline__ void prefix##_2b(void); \ + static __inline__ void prefix##_2c(void); static __inline__ void prefix##_2d(void); static __inline__ void prefix##_2e(void); static __inline__ void prefix##_2f(void); \ + static __inline__ void prefix##_30(void); static __inline__ void prefix##_31(void); static __inline__ void prefix##_32(void); static __inline__ void prefix##_33(void); \ + static __inline__ void prefix##_34(void); static __inline__ void prefix##_35(void); static __inline__ void prefix##_36(void); static __inline__ void prefix##_37(void); \ + static __inline__ void prefix##_38(void); static __inline__ void prefix##_39(void); static __inline__ void prefix##_3a(void); static __inline__ void prefix##_3b(void); \ + static __inline__ void prefix##_3c(void); static __inline__ void prefix##_3d(void); static __inline__ void prefix##_3e(void); static __inline__ void prefix##_3f(void); \ + static __inline__ void prefix##_40(void); static __inline__ void prefix##_41(void); static __inline__ void prefix##_42(void); static __inline__ void prefix##_43(void); \ + static __inline__ void prefix##_44(void); static __inline__ void prefix##_45(void); static __inline__ void prefix##_46(void); static __inline__ void prefix##_47(void); \ + static __inline__ void prefix##_48(void); static __inline__ void prefix##_49(void); static __inline__ void prefix##_4a(void); static __inline__ void prefix##_4b(void); \ + static __inline__ void prefix##_4c(void); static __inline__ void prefix##_4d(void); static __inline__ void prefix##_4e(void); static __inline__ void prefix##_4f(void); \ + static __inline__ void prefix##_50(void); static __inline__ void prefix##_51(void); static __inline__ void prefix##_52(void); static __inline__ void prefix##_53(void); \ + static __inline__ void prefix##_54(void); static __inline__ void prefix##_55(void); static __inline__ void prefix##_56(void); static __inline__ void prefix##_57(void); \ + static __inline__ void prefix##_58(void); static __inline__ void prefix##_59(void); static __inline__ void prefix##_5a(void); static __inline__ void prefix##_5b(void); \ + static __inline__ void prefix##_5c(void); static __inline__ void prefix##_5d(void); static __inline__ void prefix##_5e(void); static __inline__ void prefix##_5f(void); \ + static __inline__ void prefix##_60(void); static __inline__ void prefix##_61(void); static __inline__ void prefix##_62(void); static __inline__ void prefix##_63(void); \ + static __inline__ void prefix##_64(void); static __inline__ void prefix##_65(void); static __inline__ void prefix##_66(void); static __inline__ void prefix##_67(void); \ + static __inline__ void prefix##_68(void); static __inline__ void prefix##_69(void); static __inline__ void prefix##_6a(void); static __inline__ void prefix##_6b(void); \ + static __inline__ void prefix##_6c(void); static __inline__ void prefix##_6d(void); static __inline__ void prefix##_6e(void); static __inline__ void prefix##_6f(void); \ + static __inline__ void prefix##_70(void); static __inline__ void prefix##_71(void); static __inline__ void prefix##_72(void); static __inline__ void prefix##_73(void); \ + static __inline__ void prefix##_74(void); static __inline__ void prefix##_75(void); static __inline__ void prefix##_76(void); static __inline__ void prefix##_77(void); \ + static __inline__ void prefix##_78(void); static __inline__ void prefix##_79(void); static __inline__ void prefix##_7a(void); static __inline__ void prefix##_7b(void); \ + static __inline__ void prefix##_7c(void); static __inline__ void prefix##_7d(void); static __inline__ void prefix##_7e(void); static __inline__ void prefix##_7f(void); \ + static __inline__ void prefix##_80(void); static __inline__ void prefix##_81(void); static __inline__ void prefix##_82(void); static __inline__ void prefix##_83(void); \ + static __inline__ void prefix##_84(void); static __inline__ void prefix##_85(void); static __inline__ void prefix##_86(void); static __inline__ void prefix##_87(void); \ + static __inline__ void prefix##_88(void); static __inline__ void prefix##_89(void); static __inline__ void prefix##_8a(void); static __inline__ void prefix##_8b(void); \ + static __inline__ void prefix##_8c(void); static __inline__ void prefix##_8d(void); static __inline__ void prefix##_8e(void); static __inline__ void prefix##_8f(void); \ + static __inline__ void prefix##_90(void); static __inline__ void prefix##_91(void); static __inline__ void prefix##_92(void); static __inline__ void prefix##_93(void); \ + static __inline__ void prefix##_94(void); static __inline__ void prefix##_95(void); static __inline__ void prefix##_96(void); static __inline__ void prefix##_97(void); \ + static __inline__ void prefix##_98(void); static __inline__ void prefix##_99(void); static __inline__ void prefix##_9a(void); static __inline__ void prefix##_9b(void); \ + static __inline__ void prefix##_9c(void); static __inline__ void prefix##_9d(void); static __inline__ void prefix##_9e(void); static __inline__ void prefix##_9f(void); \ + static __inline__ void prefix##_a0(void); static __inline__ void prefix##_a1(void); static __inline__ void prefix##_a2(void); static __inline__ void prefix##_a3(void); \ + static __inline__ void prefix##_a4(void); static __inline__ void prefix##_a5(void); static __inline__ void prefix##_a6(void); static __inline__ void prefix##_a7(void); \ + static __inline__ void prefix##_a8(void); static __inline__ void prefix##_a9(void); static __inline__ void prefix##_aa(void); static __inline__ void prefix##_ab(void); \ + static __inline__ void prefix##_ac(void); static __inline__ void prefix##_ad(void); static __inline__ void prefix##_ae(void); static __inline__ void prefix##_af(void); \ + static __inline__ void prefix##_b0(void); static __inline__ void prefix##_b1(void); static __inline__ void prefix##_b2(void); static __inline__ void prefix##_b3(void); \ + static __inline__ void prefix##_b4(void); static __inline__ void prefix##_b5(void); static __inline__ void prefix##_b6(void); static __inline__ void prefix##_b7(void); \ + static __inline__ void prefix##_b8(void); static __inline__ void prefix##_b9(void); static __inline__ void prefix##_ba(void); static __inline__ void prefix##_bb(void); \ + static __inline__ void prefix##_bc(void); static __inline__ void prefix##_bd(void); static __inline__ void prefix##_be(void); static __inline__ void prefix##_bf(void); \ + static __inline__ void prefix##_c0(void); static __inline__ void prefix##_c1(void); static __inline__ void prefix##_c2(void); static __inline__ void prefix##_c3(void); \ + static __inline__ void prefix##_c4(void); static __inline__ void prefix##_c5(void); static __inline__ void prefix##_c6(void); static __inline__ void prefix##_c7(void); \ + static __inline__ void prefix##_c8(void); static __inline__ void prefix##_c9(void); static __inline__ void prefix##_ca(void); static __inline__ void prefix##_cb(void); \ + static __inline__ void prefix##_cc(void); static __inline__ void prefix##_cd(void); static __inline__ void prefix##_ce(void); static __inline__ void prefix##_cf(void); \ + static __inline__ void prefix##_d0(void); static __inline__ void prefix##_d1(void); static __inline__ void prefix##_d2(void); static __inline__ void prefix##_d3(void); \ + static __inline__ void prefix##_d4(void); static __inline__ void prefix##_d5(void); static __inline__ void prefix##_d6(void); static __inline__ void prefix##_d7(void); \ + static __inline__ void prefix##_d8(void); static __inline__ void prefix##_d9(void); static __inline__ void prefix##_da(void); static __inline__ void prefix##_db(void); \ + static __inline__ void prefix##_dc(void); static __inline__ void prefix##_dd(void); static __inline__ void prefix##_de(void); static __inline__ void prefix##_df(void); \ + static __inline__ void prefix##_e0(void); static __inline__ void prefix##_e1(void); static __inline__ void prefix##_e2(void); static __inline__ void prefix##_e3(void); \ + static __inline__ void prefix##_e4(void); static __inline__ void prefix##_e5(void); static __inline__ void prefix##_e6(void); static __inline__ void prefix##_e7(void); \ + static __inline__ void prefix##_e8(void); static __inline__ void prefix##_e9(void); static __inline__ void prefix##_ea(void); static __inline__ void prefix##_eb(void); \ + static __inline__ void prefix##_ec(void); static __inline__ void prefix##_ed(void); static __inline__ void prefix##_ee(void); static __inline__ void prefix##_ef(void); \ + static __inline__ void prefix##_f0(void); static __inline__ void prefix##_f1(void); static __inline__ void prefix##_f2(void); static __inline__ void prefix##_f3(void); \ + static __inline__ void prefix##_f4(void); static __inline__ void prefix##_f5(void); static __inline__ void prefix##_f6(void); static __inline__ void prefix##_f7(void); \ + static __inline__ void prefix##_f8(void); static __inline__ void prefix##_f9(void); static __inline__ void prefix##_fa(void); static __inline__ void prefix##_fb(void); \ + static __inline__ void prefix##_fc(void); static __inline__ void prefix##_fd(void); static __inline__ void prefix##_fe(void); static __inline__ void prefix##_ff(void); \ +static void (*tablename[0x100])(void) = { \ + prefix##_00,prefix##_01,prefix##_02,prefix##_03,prefix##_04,prefix##_05,prefix##_06,prefix##_07, \ + prefix##_08,prefix##_09,prefix##_0a,prefix##_0b,prefix##_0c,prefix##_0d,prefix##_0e,prefix##_0f, \ + prefix##_10,prefix##_11,prefix##_12,prefix##_13,prefix##_14,prefix##_15,prefix##_16,prefix##_17, \ + prefix##_18,prefix##_19,prefix##_1a,prefix##_1b,prefix##_1c,prefix##_1d,prefix##_1e,prefix##_1f, \ + prefix##_20,prefix##_21,prefix##_22,prefix##_23,prefix##_24,prefix##_25,prefix##_26,prefix##_27, \ + prefix##_28,prefix##_29,prefix##_2a,prefix##_2b,prefix##_2c,prefix##_2d,prefix##_2e,prefix##_2f, \ + prefix##_30,prefix##_31,prefix##_32,prefix##_33,prefix##_34,prefix##_35,prefix##_36,prefix##_37, \ + prefix##_38,prefix##_39,prefix##_3a,prefix##_3b,prefix##_3c,prefix##_3d,prefix##_3e,prefix##_3f, \ + prefix##_40,prefix##_41,prefix##_42,prefix##_43,prefix##_44,prefix##_45,prefix##_46,prefix##_47, \ + prefix##_48,prefix##_49,prefix##_4a,prefix##_4b,prefix##_4c,prefix##_4d,prefix##_4e,prefix##_4f, \ + prefix##_50,prefix##_51,prefix##_52,prefix##_53,prefix##_54,prefix##_55,prefix##_56,prefix##_57, \ + prefix##_58,prefix##_59,prefix##_5a,prefix##_5b,prefix##_5c,prefix##_5d,prefix##_5e,prefix##_5f, \ + prefix##_60,prefix##_61,prefix##_62,prefix##_63,prefix##_64,prefix##_65,prefix##_66,prefix##_67, \ + prefix##_68,prefix##_69,prefix##_6a,prefix##_6b,prefix##_6c,prefix##_6d,prefix##_6e,prefix##_6f, \ + prefix##_70,prefix##_71,prefix##_72,prefix##_73,prefix##_74,prefix##_75,prefix##_76,prefix##_77, \ + prefix##_78,prefix##_79,prefix##_7a,prefix##_7b,prefix##_7c,prefix##_7d,prefix##_7e,prefix##_7f, \ + prefix##_80,prefix##_81,prefix##_82,prefix##_83,prefix##_84,prefix##_85,prefix##_86,prefix##_87, \ + prefix##_88,prefix##_89,prefix##_8a,prefix##_8b,prefix##_8c,prefix##_8d,prefix##_8e,prefix##_8f, \ + prefix##_90,prefix##_91,prefix##_92,prefix##_93,prefix##_94,prefix##_95,prefix##_96,prefix##_97, \ + prefix##_98,prefix##_99,prefix##_9a,prefix##_9b,prefix##_9c,prefix##_9d,prefix##_9e,prefix##_9f, \ + prefix##_a0,prefix##_a1,prefix##_a2,prefix##_a3,prefix##_a4,prefix##_a5,prefix##_a6,prefix##_a7, \ + prefix##_a8,prefix##_a9,prefix##_aa,prefix##_ab,prefix##_ac,prefix##_ad,prefix##_ae,prefix##_af, \ + prefix##_b0,prefix##_b1,prefix##_b2,prefix##_b3,prefix##_b4,prefix##_b5,prefix##_b6,prefix##_b7, \ + prefix##_b8,prefix##_b9,prefix##_ba,prefix##_bb,prefix##_bc,prefix##_bd,prefix##_be,prefix##_bf, \ + prefix##_c0,prefix##_c1,prefix##_c2,prefix##_c3,prefix##_c4,prefix##_c5,prefix##_c6,prefix##_c7, \ + prefix##_c8,prefix##_c9,prefix##_ca,prefix##_cb,prefix##_cc,prefix##_cd,prefix##_ce,prefix##_cf, \ + prefix##_d0,prefix##_d1,prefix##_d2,prefix##_d3,prefix##_d4,prefix##_d5,prefix##_d6,prefix##_d7, \ + prefix##_d8,prefix##_d9,prefix##_da,prefix##_db,prefix##_dc,prefix##_dd,prefix##_de,prefix##_df, \ + prefix##_e0,prefix##_e1,prefix##_e2,prefix##_e3,prefix##_e4,prefix##_e5,prefix##_e6,prefix##_e7, \ + prefix##_e8,prefix##_e9,prefix##_ea,prefix##_eb,prefix##_ec,prefix##_ed,prefix##_ee,prefix##_ef, \ + prefix##_f0,prefix##_f1,prefix##_f2,prefix##_f3,prefix##_f4,prefix##_f5,prefix##_f6,prefix##_f7, \ + prefix##_f8,prefix##_f9,prefix##_fa,prefix##_fb,prefix##_fc,prefix##_fd,prefix##_fe,prefix##_ff \ +} + +PROTOTYPES(Z80op,op); +PROTOTYPES(Z80cb,cb); +PROTOTYPES(Z80dd,dd); +PROTOTYPES(Z80ed,ed); +PROTOTYPES(Z80fd,fd); +PROTOTYPES(Z80xycb,xycb); + +/****************************************************************************/ +/* Burn an odd amount of cycles, that is instructions taking something */ +/* different from 4 T-states per opcode (and R increment) */ +/****************************************************************************/ +static __inline__ void BURNODD(int cycles, int opcodes, int cyclesum) +{ + if( cycles > 0 ) + { + _R += (cycles / cyclesum) * opcodes; + z80_ICount -= (cycles / cyclesum) * cyclesum; + } +} + +/*************************************************************** + * define an opcode function + ***************************************************************/ +#define OP(prefix,opcode) static __inline__ void prefix##_##opcode(void) + +/*************************************************************** + * adjust cycle count by n T-states + ***************************************************************/ +#define CC(prefix,opcode) z80_ICount -= cc[Z80_TABLE_##prefix][opcode] + +/*************************************************************** + * execute an opcode + ***************************************************************/ +#define EXEC(prefix,opcode) \ +{ \ + unsigned op = opcode; \ + CC(prefix,op); \ + (*Z80##prefix[op])(); \ +} + +#if BIG_SWITCH +#define EXEC_INLINE(prefix,opcode) \ +{ \ + unsigned op = opcode; \ + CC(prefix,op); \ + switch(op) \ + { \ + case 0x00:prefix##_##00();break; case 0x01:prefix##_##01();break; case 0x02:prefix##_##02();break; case 0x03:prefix##_##03();break; \ + case 0x04:prefix##_##04();break; case 0x05:prefix##_##05();break; case 0x06:prefix##_##06();break; case 0x07:prefix##_##07();break; \ + case 0x08:prefix##_##08();break; case 0x09:prefix##_##09();break; case 0x0a:prefix##_##0a();break; case 0x0b:prefix##_##0b();break; \ + case 0x0c:prefix##_##0c();break; case 0x0d:prefix##_##0d();break; case 0x0e:prefix##_##0e();break; case 0x0f:prefix##_##0f();break; \ + case 0x10:prefix##_##10();break; case 0x11:prefix##_##11();break; case 0x12:prefix##_##12();break; case 0x13:prefix##_##13();break; \ + case 0x14:prefix##_##14();break; case 0x15:prefix##_##15();break; case 0x16:prefix##_##16();break; case 0x17:prefix##_##17();break; \ + case 0x18:prefix##_##18();break; case 0x19:prefix##_##19();break; case 0x1a:prefix##_##1a();break; case 0x1b:prefix##_##1b();break; \ + case 0x1c:prefix##_##1c();break; case 0x1d:prefix##_##1d();break; case 0x1e:prefix##_##1e();break; case 0x1f:prefix##_##1f();break; \ + case 0x20:prefix##_##20();break; case 0x21:prefix##_##21();break; case 0x22:prefix##_##22();break; case 0x23:prefix##_##23();break; \ + case 0x24:prefix##_##24();break; case 0x25:prefix##_##25();break; case 0x26:prefix##_##26();break; case 0x27:prefix##_##27();break; \ + case 0x28:prefix##_##28();break; case 0x29:prefix##_##29();break; case 0x2a:prefix##_##2a();break; case 0x2b:prefix##_##2b();break; \ + case 0x2c:prefix##_##2c();break; case 0x2d:prefix##_##2d();break; case 0x2e:prefix##_##2e();break; case 0x2f:prefix##_##2f();break; \ + case 0x30:prefix##_##30();break; case 0x31:prefix##_##31();break; case 0x32:prefix##_##32();break; case 0x33:prefix##_##33();break; \ + case 0x34:prefix##_##34();break; case 0x35:prefix##_##35();break; case 0x36:prefix##_##36();break; case 0x37:prefix##_##37();break; \ + case 0x38:prefix##_##38();break; case 0x39:prefix##_##39();break; case 0x3a:prefix##_##3a();break; case 0x3b:prefix##_##3b();break; \ + case 0x3c:prefix##_##3c();break; case 0x3d:prefix##_##3d();break; case 0x3e:prefix##_##3e();break; case 0x3f:prefix##_##3f();break; \ + case 0x40:prefix##_##40();break; case 0x41:prefix##_##41();break; case 0x42:prefix##_##42();break; case 0x43:prefix##_##43();break; \ + case 0x44:prefix##_##44();break; case 0x45:prefix##_##45();break; case 0x46:prefix##_##46();break; case 0x47:prefix##_##47();break; \ + case 0x48:prefix##_##48();break; case 0x49:prefix##_##49();break; case 0x4a:prefix##_##4a();break; case 0x4b:prefix##_##4b();break; \ + case 0x4c:prefix##_##4c();break; case 0x4d:prefix##_##4d();break; case 0x4e:prefix##_##4e();break; case 0x4f:prefix##_##4f();break; \ + case 0x50:prefix##_##50();break; case 0x51:prefix##_##51();break; case 0x52:prefix##_##52();break; case 0x53:prefix##_##53();break; \ + case 0x54:prefix##_##54();break; case 0x55:prefix##_##55();break; case 0x56:prefix##_##56();break; case 0x57:prefix##_##57();break; \ + case 0x58:prefix##_##58();break; case 0x59:prefix##_##59();break; case 0x5a:prefix##_##5a();break; case 0x5b:prefix##_##5b();break; \ + case 0x5c:prefix##_##5c();break; case 0x5d:prefix##_##5d();break; case 0x5e:prefix##_##5e();break; case 0x5f:prefix##_##5f();break; \ + case 0x60:prefix##_##60();break; case 0x61:prefix##_##61();break; case 0x62:prefix##_##62();break; case 0x63:prefix##_##63();break; \ + case 0x64:prefix##_##64();break; case 0x65:prefix##_##65();break; case 0x66:prefix##_##66();break; case 0x67:prefix##_##67();break; \ + case 0x68:prefix##_##68();break; case 0x69:prefix##_##69();break; case 0x6a:prefix##_##6a();break; case 0x6b:prefix##_##6b();break; \ + case 0x6c:prefix##_##6c();break; case 0x6d:prefix##_##6d();break; case 0x6e:prefix##_##6e();break; case 0x6f:prefix##_##6f();break; \ + case 0x70:prefix##_##70();break; case 0x71:prefix##_##71();break; case 0x72:prefix##_##72();break; case 0x73:prefix##_##73();break; \ + case 0x74:prefix##_##74();break; case 0x75:prefix##_##75();break; case 0x76:prefix##_##76();break; case 0x77:prefix##_##77();break; \ + case 0x78:prefix##_##78();break; case 0x79:prefix##_##79();break; case 0x7a:prefix##_##7a();break; case 0x7b:prefix##_##7b();break; \ + case 0x7c:prefix##_##7c();break; case 0x7d:prefix##_##7d();break; case 0x7e:prefix##_##7e();break; case 0x7f:prefix##_##7f();break; \ + case 0x80:prefix##_##80();break; case 0x81:prefix##_##81();break; case 0x82:prefix##_##82();break; case 0x83:prefix##_##83();break; \ + case 0x84:prefix##_##84();break; case 0x85:prefix##_##85();break; case 0x86:prefix##_##86();break; case 0x87:prefix##_##87();break; \ + case 0x88:prefix##_##88();break; case 0x89:prefix##_##89();break; case 0x8a:prefix##_##8a();break; case 0x8b:prefix##_##8b();break; \ + case 0x8c:prefix##_##8c();break; case 0x8d:prefix##_##8d();break; case 0x8e:prefix##_##8e();break; case 0x8f:prefix##_##8f();break; \ + case 0x90:prefix##_##90();break; case 0x91:prefix##_##91();break; case 0x92:prefix##_##92();break; case 0x93:prefix##_##93();break; \ + case 0x94:prefix##_##94();break; case 0x95:prefix##_##95();break; case 0x96:prefix##_##96();break; case 0x97:prefix##_##97();break; \ + case 0x98:prefix##_##98();break; case 0x99:prefix##_##99();break; case 0x9a:prefix##_##9a();break; case 0x9b:prefix##_##9b();break; \ + case 0x9c:prefix##_##9c();break; case 0x9d:prefix##_##9d();break; case 0x9e:prefix##_##9e();break; case 0x9f:prefix##_##9f();break; \ + case 0xa0:prefix##_##a0();break; case 0xa1:prefix##_##a1();break; case 0xa2:prefix##_##a2();break; case 0xa3:prefix##_##a3();break; \ + case 0xa4:prefix##_##a4();break; case 0xa5:prefix##_##a5();break; case 0xa6:prefix##_##a6();break; case 0xa7:prefix##_##a7();break; \ + case 0xa8:prefix##_##a8();break; case 0xa9:prefix##_##a9();break; case 0xaa:prefix##_##aa();break; case 0xab:prefix##_##ab();break; \ + case 0xac:prefix##_##ac();break; case 0xad:prefix##_##ad();break; case 0xae:prefix##_##ae();break; case 0xaf:prefix##_##af();break; \ + case 0xb0:prefix##_##b0();break; case 0xb1:prefix##_##b1();break; case 0xb2:prefix##_##b2();break; case 0xb3:prefix##_##b3();break; \ + case 0xb4:prefix##_##b4();break; case 0xb5:prefix##_##b5();break; case 0xb6:prefix##_##b6();break; case 0xb7:prefix##_##b7();break; \ + case 0xb8:prefix##_##b8();break; case 0xb9:prefix##_##b9();break; case 0xba:prefix##_##ba();break; case 0xbb:prefix##_##bb();break; \ + case 0xbc:prefix##_##bc();break; case 0xbd:prefix##_##bd();break; case 0xbe:prefix##_##be();break; case 0xbf:prefix##_##bf();break; \ + case 0xc0:prefix##_##c0();break; case 0xc1:prefix##_##c1();break; case 0xc2:prefix##_##c2();break; case 0xc3:prefix##_##c3();break; \ + case 0xc4:prefix##_##c4();break; case 0xc5:prefix##_##c5();break; case 0xc6:prefix##_##c6();break; case 0xc7:prefix##_##c7();break; \ + case 0xc8:prefix##_##c8();break; case 0xc9:prefix##_##c9();break; case 0xca:prefix##_##ca();break; case 0xcb:prefix##_##cb();break; \ + case 0xcc:prefix##_##cc();break; case 0xcd:prefix##_##cd();break; case 0xce:prefix##_##ce();break; case 0xcf:prefix##_##cf();break; \ + case 0xd0:prefix##_##d0();break; case 0xd1:prefix##_##d1();break; case 0xd2:prefix##_##d2();break; case 0xd3:prefix##_##d3();break; \ + case 0xd4:prefix##_##d4();break; case 0xd5:prefix##_##d5();break; case 0xd6:prefix##_##d6();break; case 0xd7:prefix##_##d7();break; \ + case 0xd8:prefix##_##d8();break; case 0xd9:prefix##_##d9();break; case 0xda:prefix##_##da();break; case 0xdb:prefix##_##db();break; \ + case 0xdc:prefix##_##dc();break; case 0xdd:prefix##_##dd();break; case 0xde:prefix##_##de();break; case 0xdf:prefix##_##df();break; \ + case 0xe0:prefix##_##e0();break; case 0xe1:prefix##_##e1();break; case 0xe2:prefix##_##e2();break; case 0xe3:prefix##_##e3();break; \ + case 0xe4:prefix##_##e4();break; case 0xe5:prefix##_##e5();break; case 0xe6:prefix##_##e6();break; case 0xe7:prefix##_##e7();break; \ + case 0xe8:prefix##_##e8();break; case 0xe9:prefix##_##e9();break; case 0xea:prefix##_##ea();break; case 0xeb:prefix##_##eb();break; \ + case 0xec:prefix##_##ec();break; case 0xed:prefix##_##ed();break; case 0xee:prefix##_##ee();break; case 0xef:prefix##_##ef();break; \ + case 0xf0:prefix##_##f0();break; case 0xf1:prefix##_##f1();break; case 0xf2:prefix##_##f2();break; case 0xf3:prefix##_##f3();break; \ + case 0xf4:prefix##_##f4();break; case 0xf5:prefix##_##f5();break; case 0xf6:prefix##_##f6();break; case 0xf7:prefix##_##f7();break; \ + case 0xf8:prefix##_##f8();break; case 0xf9:prefix##_##f9();break; case 0xfa:prefix##_##fa();break; case 0xfb:prefix##_##fb();break; \ + case 0xfc:prefix##_##fc();break; case 0xfd:prefix##_##fd();break; case 0xfe:prefix##_##fe();break; case 0xff:prefix##_##ff();break; \ + } \ +} +#else +#define EXEC_INLINE EXEC +#endif + + +/*************************************************************** + * Enter HALT state; write 1 to fake port on first execution + ***************************************************************/ +#define ENTER_HALT { \ + _PC--; \ + _HALT = 1; \ + if( !after_EI ) \ + z80_burn( z80_ICount ); \ +} + +/*************************************************************** + * Leave HALT state; write 0 to fake port + ***************************************************************/ +#define LEAVE_HALT { \ + if( _HALT ) \ + { \ + _HALT = 0; \ + _PC++; \ + } \ +} + +/*************************************************************** + * Input a byte from given I/O port + ***************************************************************/ +#define IN(port) ((UINT8)cpu_readport16(port)) + +/*************************************************************** + * Output a byte to given I/O port + ***************************************************************/ +#define OUT(port,value) cpu_writeport16(port,value) + +/*************************************************************** + * Read a byte from given memory location + ***************************************************************/ +#define RM(addr) (UINT8)cpu_readmem16(addr) + +/*************************************************************** + * Read a word from given memory location + ***************************************************************/ +static __inline__ void RM16( UINT32 addr, PAIR *r ) +{ + r->b.l = RM(addr); + r->b.h = RM((addr+1)&0xffff); +} + +/*************************************************************** + * Write a byte to given memory location + ***************************************************************/ +#define WM(addr,value) cpu_writemem16(addr,value) + +/*************************************************************** + * Write a word to given memory location + ***************************************************************/ +static __inline__ void WM16( UINT32 addr, PAIR *r ) +{ + WM(addr,r->b.l); + WM((addr+1)&0xffff,r->b.h); +} + +/*************************************************************** + * ROP() is identical to RM() except it is used for + * reading opcodes. In case of system with memory mapped I/O, + * this function can be used to greatly speed up emulation + ***************************************************************/ +static __inline__ UINT8 ROP(void) +{ + unsigned pc = _PCD; + _PC++; + return cpu_readop(pc); +} + +/**************************************************************** + * ARG() is identical to ROP() except it is used + * for reading opcode arguments. This difference can be used to + * support systems that use different encoding mechanisms for + * opcodes and opcode arguments + ***************************************************************/ +static __inline__ UINT8 ARG(void) +{ + unsigned pc = _PCD; + _PC++; + return cpu_readop_arg(pc); +} + +static __inline__ UINT32 ARG16(void) +{ + unsigned pc = _PCD; + _PC += 2; + return cpu_readop_arg(pc) | (cpu_readop_arg((pc+1)&0xffff) << 8); +} + +/*************************************************************** + * Calculate the effective address EA of an opcode using + * IX+offset resp. IY+offset addressing. + ***************************************************************/ +#define EAX EA = (UINT32)(UINT16)(_IX+(INT8)ARG()) +#define EAY EA = (UINT32)(UINT16)(_IY+(INT8)ARG()) + +/*************************************************************** + * POP + ***************************************************************/ +#define POP(DR) { RM16( _SPD, &Z80.DR ); _SP += 2; } + +/*************************************************************** + * PUSH + ***************************************************************/ +#define PUSH(SR) { _SP -= 2; WM16( _SPD, &Z80.SR ); } + +/*************************************************************** + * JP + ***************************************************************/ +#if BUSY_LOOP_HACKS +#define JP { \ + unsigned oldpc = _PCD-1; \ + _PCD = ARG16(); \ + /* speed up busy loop */ \ + if( _PCD == oldpc ) \ + { \ + if( !after_EI ) \ + BURNODD( z80_ICount, 1, cc[Z80_TABLE_op][0xc3] ); \ + } \ + else \ + { \ + UINT8 op = cpu_readop(_PCD); \ + if( _PCD == oldpc-1 ) \ + { \ + /* NOP - JP $-1 or EI - JP $-1 */ \ + if ( op == 0x00 || op == 0xfb ) \ + { \ + if( !after_EI ) \ + BURNODD( z80_ICount-cc[Z80_TABLE_op][0x00], \ + 2, cc[Z80_TABLE_op][0x00]+cc[Z80_TABLE_op][0xc3]); \ + } \ + } \ + else \ + /* LD SP,#xxxx - JP $-3 (Galaga) */ \ + if( _PCD == oldpc-3 && op == 0x31 ) \ + { \ + if( !after_EI ) \ + BURNODD( z80_ICount-cc[Z80_TABLE_op][0x31], \ + 2, cc[Z80_TABLE_op][0x31]+cc[Z80_TABLE_op][0xc3]); \ + } \ + } \ +} +#else +#define JP { \ + _PCD = ARG16(); \ +} +#endif + +/*************************************************************** + * JP_COND + ***************************************************************/ + +#define JP_COND(cond) \ + if( cond ) \ + { \ + _PCD = ARG16(); \ + } \ + else \ + { \ + _PC += 2; \ + } + +/*************************************************************** + * JR + ***************************************************************/ +#define JR() \ +{ \ + unsigned oldpc = _PCD-1; \ + INT8 arg = (INT8)ARG(); /* ARG() also increments _PC */ \ + _PC += arg; /* so don't do _PC += ARG() */ \ + /* speed up busy loop */ \ + if( _PCD == oldpc ) \ + { \ + if( !after_EI ) \ + BURNODD( z80_ICount, 1, cc[Z80_TABLE_op][0x18] ); \ + } \ + else \ + { \ + UINT8 op = cpu_readop(_PCD); \ + if( _PCD == oldpc-1 ) \ + { \ + /* NOP - JR $-1 or EI - JR $-1 */ \ + if ( op == 0x00 || op == 0xfb ) \ + { \ + if( !after_EI ) \ + BURNODD( z80_ICount-cc[Z80_TABLE_op][0x00], \ + 2, cc[Z80_TABLE_op][0x00]+cc[Z80_TABLE_op][0x18]); \ + } \ + } \ + else \ + /* LD SP,#xxxx - JR $-3 */ \ + if( _PCD == oldpc-3 && op == 0x31 ) \ + { \ + if( !after_EI ) \ + BURNODD( z80_ICount-cc[Z80_TABLE_op][0x31], \ + 2, cc[Z80_TABLE_op][0x31]+cc[Z80_TABLE_op][0x18]); \ + } \ + } \ +} + +/*************************************************************** + * JR_COND + ***************************************************************/ +#define JR_COND(cond,opcode) \ + if( cond ) \ + { \ + INT8 arg = (INT8)ARG(); /* ARG() also increments _PC */ \ + _PC += arg; /* so don't do _PC += ARG() */ \ + CC(ex,opcode); \ + } \ + else _PC++; \ + +/*************************************************************** + * CALL + ***************************************************************/ +#define CALL() \ + EA = ARG16(); \ + PUSH( PC ); \ + _PCD = EA; + +/*************************************************************** + * CALL_COND + ***************************************************************/ +#define CALL_COND(cond,opcode) \ + if( cond ) \ + { \ + EA = ARG16(); \ + PUSH( PC ); \ + _PCD = EA; \ + CC(ex,opcode); \ + } \ + else \ + { \ + _PC+=2; \ + } + +/*************************************************************** + * RET_COND + ***************************************************************/ +#define RET_COND(cond,opcode) \ + if( cond ) \ + { \ + POP(PC); \ + CC(ex,opcode); \ + } + +/*************************************************************** + * RETN + ***************************************************************/ +#define RETN { \ + POP(PC); \ + if( _IFF1 == 0 && _IFF2 == 1 ) \ + { \ + _IFF1 = 1; \ + if( Z80.irq_state != CLEAR_LINE || \ + Z80.request_irq >= 0 ) \ + { \ + take_interrupt(); \ + } \ + } \ + else _IFF1 = _IFF2; \ +} + +/*************************************************************** + * RETI + ***************************************************************/ +#define RETI { \ + int device = Z80.service_irq; \ + POP(PC); \ +/* according to http://www.msxnet.org/tech/Z80/z80undoc.txt */ \ +/* _IFF1 = _IFF2; */ \ + if( device >= 0 ) \ + { \ + Z80.irq[device].interrupt_reti(Z80.irq[device].irq_param); \ + } \ +} + +/*************************************************************** + * LD R,A + ***************************************************************/ +#define LD_R_A { \ + _R = _A; \ + _R2 = _A & 0x80; /* keep bit 7 of R */ \ +} + +/*************************************************************** + * LD A,R + ***************************************************************/ +#define LD_A_R { \ + _A = (_R & 0x7f) | _R2; \ + _F = (_F & CF) | SZ[_A] | ( _IFF2 << 2 ); \ +} + +/*************************************************************** + * LD I,A + ***************************************************************/ +#define LD_I_A { \ + _I = _A; \ +} + +/*************************************************************** + * LD A,I + ***************************************************************/ +#define LD_A_I { \ + _A = _I; \ + _F = (_F & CF) | SZ[_A] | ( _IFF2 << 2 ); \ +} + +/*************************************************************** + * RST + ***************************************************************/ +#define RST(addr) \ + PUSH( PC ); \ + _PCD = addr; + +/*************************************************************** + * INC r8 + ***************************************************************/ +static __inline__ UINT8 INC(UINT8 value) +{ + UINT8 res = value + 1; + _F = (_F & CF) | SZHV_inc[res]; + return (UINT8)res; +} + +/*************************************************************** + * DEC r8 + ***************************************************************/ +static __inline__ UINT8 DEC(UINT8 value) +{ + UINT8 res = value - 1; + _F = (_F & CF) | SZHV_dec[res]; + return res; +} + +/*************************************************************** + * RLCA + ***************************************************************/ +#if Z80_EXACT +#define RLCA \ + _A = (_A << 1) | (_A >> 7); \ + _F = (_F & (SF | ZF | PF)) | (_A & (YF | XF | CF)) +#else +#define RLCA \ + _A = (_A << 1) | (_A >> 7); \ + _F = (_F & (SF | ZF | YF | XF | PF)) | (_A & CF) +#endif + +/*************************************************************** + * RRCA + ***************************************************************/ +#if Z80_EXACT +#define RRCA \ + _F = (_F & (SF | ZF | PF)) | (_A & CF); \ + _A = (_A >> 1) | (_A << 7); \ + _F |= (_A & (YF | XF) ) +#else +#define RRCA \ + _F = (_F & (SF | ZF | YF | XF | PF)) | (_A & CF); \ + _A = (_A >> 1) | (_A << 7) +#endif + +/*************************************************************** + * RLA + ***************************************************************/ +#if Z80_EXACT +#define RLA { \ + UINT8 res = (_A << 1) | (_F & CF); \ + UINT8 c = (_A & 0x80) ? CF : 0; \ + _F = (_F & (SF | ZF | PF)) | c | (res & (YF | XF)); \ + _A = res; \ +} +#else +#define RLA { \ + UINT8 res = (_A << 1) | (_F & CF); \ + UINT8 c = (_A & 0x80) ? CF : 0; \ + _F = (_F & (SF | ZF | YF | XF | PF)) | c; \ + _A = res; \ +} +#endif + +/*************************************************************** + * RRA + ***************************************************************/ +#if Z80_EXACT +#define RRA { \ + UINT8 res = (_A >> 1) | (_F << 7); \ + UINT8 c = (_A & 0x01) ? CF : 0; \ + _F = (_F & (SF | ZF | PF)) | c | (res & (YF | XF)); \ + _A = res; \ +} +#else +#define RRA { \ + UINT8 res = (_A >> 1) | (_F << 7); \ + UINT8 c = (_A & 0x01) ? CF : 0; \ + _F = (_F & (SF | ZF | YF | XF | PF)) | c; \ + _A = res; \ +} +#endif + +/*************************************************************** + * RRD + ***************************************************************/ +#define RRD { \ + UINT8 n = RM(_HL); \ + WM( _HL, (n >> 4) | (_A << 4) ); \ + _A = (_A & 0xf0) | (n & 0x0f); \ + _F = (_F & CF) | SZP[_A]; \ +} + +/*************************************************************** + * RLD + ***************************************************************/ +#define RLD { \ + UINT8 n = RM(_HL); \ + WM( _HL, (n << 4) | (_A & 0x0f) ); \ + _A = (_A & 0xf0) | (n >> 4); \ + _F = (_F & CF) | SZP[_A]; \ +} + +/*************************************************************** + * ADD A,n + ***************************************************************/ +#ifdef X86_ASM +#if Z80_EXACT +#define ADD(value) \ + asm ( \ + " addb %2,%0 \n" \ + " lahf \n" \ + " setob %1 \n" /* al = 1 if overflow */ \ + " addb %1,%1 \n" \ + " addb %1,%1 \n" /* shift to P/V bit position */ \ + " andb $0xd1,%%ah \n" /* sign, zero, half carry, carry */ \ + " orb %%ah,%1 \n" \ + " movb %0,%%ah \n" /* get result */ \ + " andb $0x28,%%ah \n" /* maks flags 5+3 */ \ + " orb %%ah,%1 \n" /* put them into flags */ \ + :"=r" (_A), "=r" (_F) \ + :"r" (value), "1" (_F), "0" (_A) \ + ) +#else +#define ADD(value) \ + asm ( \ + " addb %2,%0 \n" \ + " lahf \n" \ + " setob %1 \n" /* al = 1 if overflow */ \ + " addb %1,%1 \n" \ + " addb %1,%1 \n" /* shift to P/V bit position */ \ + " andb $0xd1,%%ah \n" /* sign, zero, half carry, carry */ \ + " orb %%ah,%1 \n" \ + :"=r" (_A), "=r" (_F) \ + :"r" (value), "1" (_F), "0" (_A) \ + ) +#endif +#else +#if BIG_FLAGS_ARRAY +#define ADD(value) \ +{ \ + UINT32 ah = _AFD & 0xff00; \ + UINT32 res = (UINT8)((ah >> 8) + value); \ + _F = SZHVC_add[ah | res]; \ + _A = res; \ +} +#else +#define ADD(value) \ +{ \ + unsigned val = value; \ + unsigned res = _A + val; \ + _F = SZ[(UINT8)res] | ((res >> 8) & CF) | \ + ((_A ^ res ^ val) & HF) | \ + (((val ^ _A ^ 0x80) & (val ^ res) & 0x80) >> 5); \ + _A = (UINT8)res; \ +} +#endif +#endif + +/*************************************************************** + * ADC A,n + ***************************************************************/ +#ifdef X86_ASM +#if Z80_EXACT +#define ADC(value) \ + asm ( \ + " shrb $1,%1 \n" \ + " adcb %2,%0 \n" \ + " lahf \n" \ + " setob %1 \n" /* al = 1 if overflow */ \ + " addb %1,%1 \n" /* shift to P/V bit position */ \ + " addb %1,%1 \n" \ + " andb $0xd1,%%ah \n" /* sign, zero, half carry, carry */ \ + " orb %%ah,%1 \n" /* combine with P/V */ \ + " movb %0,%%ah \n" /* get result */ \ + " andb $0x28,%%ah \n" /* maks flags 5+3 */ \ + " orb %%ah,%1 \n" /* put them into flags */ \ + :"=r" (_A), "=r" (_F) \ + :"r" (value), "1" (_F), "0" (_A) \ + ) +#else +#define ADC(value) \ + asm ( \ + " shrb $1,%1 \n" \ + " adcb %2,%0 \n" \ + " lahf \n" \ + " setob %1 \n" /* al = 1 if overflow */ \ + " addb %1,%1 \n" /* shift to P/V bit position */ \ + " addb %1,%1 \n" \ + " andb $0xd1,%%ah \n" /* sign, zero, half carry, carry */ \ + " orb %%ah,%1 \n" /* combine with P/V */ \ + :"=r" (_A), "=r" (_F) \ + :"r" (value), "1" (_F), "0" (_A) \ + ) +#endif +#else +#if BIG_FLAGS_ARRAY +#define ADC(value) \ +{ \ + UINT32 ah = _AFD & 0xff00, c = _AFD & 1; \ + UINT32 res = (UINT8)((ah >> 8) + value + c); \ + _F = SZHVC_add[(c << 16) | ah | res]; \ + _A = res; \ +} +#else +#define ADC(value) \ +{ \ + unsigned val = value; \ + unsigned res = _A + val + (_F & CF); \ + _F = SZ[res & 0xff] | ((res >> 8) & CF) | \ + ((_A ^ res ^ val) & HF) | \ + (((val ^ _A ^ 0x80) & (val ^ res) & 0x80) >> 5); \ + _A = res; \ +} +#endif +#endif + +/*************************************************************** + * SUB n + ***************************************************************/ +#ifdef X86_ASM +#if Z80_EXACT +#define SUB(value) \ + asm ( \ + " subb %2,%0 \n" \ + " lahf \n" \ + " setob %1 \n" /* al = 1 if overflow */ \ + " stc \n" /* prepare to set N flag */ \ + " adcb %1,%1 \n" /* shift to P/V bit position */ \ + " addb %1,%1 \n" \ + " andb $0xd1,%%ah \n" /* sign, zero, half carry, carry */ \ + " orb %%ah,%1 \n" /* combine with P/V */ \ + " movb %0,%%ah \n" /* get result */ \ + " andb $0x28,%%ah \n" /* maks flags 5+3 */ \ + " orb %%ah,%1 \n" /* put them into flags */ \ + :"=r" (_A), "=r" (_F) \ + :"r" (value), "1" (_F), "0" (_A) \ + ) +#else +#define SUB(value) \ + asm ( \ + " subb %2,%0 \n" \ + " lahf \n" \ + " setob %1 \n" /* al = 1 if overflow */ \ + " stc \n" /* prepare to set N flag */ \ + " adcb %1,%1 \n" /* shift to P/V bit position */ \ + " addb %1,%1 \n" \ + " andb $0xd1,%%ah \n" /* sign, zero, half carry, carry */ \ + " orb %%ah,%1 \n" /* combine with P/V */ \ + :"=r" (_A), "=r" (_F) \ + :"r" (value), "1" (_F), "0" (_A) \ + ) +#endif +#else +#if BIG_FLAGS_ARRAY +#define SUB(value) \ +{ \ + UINT32 ah = _AFD & 0xff00; \ + UINT32 res = (UINT8)((ah >> 8) - value); \ + _F = SZHVC_sub[ah | res]; \ + _A = res; \ +} +#else +#define SUB(value) \ +{ \ + unsigned val = value; \ + unsigned res = _A - val; \ + _F = SZ[res & 0xff] | ((res >> 8) & CF) | NF | \ + ((_A ^ res ^ val) & HF) | \ + (((val ^ _A) & (_A ^ res) & 0x80) >> 5); \ + _A = res; \ +} +#endif +#endif + +/*************************************************************** + * SBC A,n + ***************************************************************/ +#ifdef X86_ASM +#if Z80_EXACT +#define SBC(value) \ + asm ( \ + " shrb $1,%1 \n" \ + " sbbb %2,%0 \n" \ + " lahf \n" \ + " setob %1 \n" /* al = 1 if overflow */ \ + " stc \n" /* prepare to set N flag */ \ + " adcb %1,%1 \n" /* shift to P/V bit position */ \ + " addb %1,%1 \n" \ + " andb $0xd1,%%ah \n" /* sign, zero, half carry, carry */ \ + " orb %%ah,%1 \n" /* combine with P/V */ \ + " movb %0,%%ah \n" /* get result */ \ + " andb $0x28,%%ah \n" /* maks flags 5+3 */ \ + " orb %%ah,%1 \n" /* put them into flags */ \ + :"=r" (_A), "=r" (_F) \ + :"r" (value), "1" (_F), "0" (_A) \ + ) +#else +#define SBC(value) \ + asm ( \ + " shrb $1,%1 \n" \ + " sbbb %2,%0 \n" \ + " lahf \n" \ + " setob %1 \n" /* al = 1 if overflow */ \ + " stc \n" /* prepare to set N flag */ \ + " adcb %1,%1 \n" /* shift to P/V bit position */ \ + " addb %1,%1 \n" \ + " andb $0xd1,%%ah \n" /* sign, zero, half carry, carry */ \ + " orb %%ah,%1 \n" /* combine with P/V */ \ + :"=r" (_A), "=r" (_F) \ + :"r" (value), "1" (_F), "0" (_A) \ + ) +#endif +#else +#if BIG_FLAGS_ARRAY +#define SBC(value) \ +{ \ + UINT32 ah = _AFD & 0xff00, c = _AFD & 1; \ + UINT32 res = (UINT8)((ah >> 8) - value - c); \ + _F = SZHVC_sub[(c<<16) | ah | res]; \ + _A = res; \ +} +#else +#define SBC(value) \ +{ \ + unsigned val = value; \ + unsigned res = _A - val - (_F & CF); \ + _F = SZ[res & 0xff] | ((res >> 8) & CF) | NF | \ + ((_A ^ res ^ val) & HF) | \ + (((val ^ _A) & (_A ^ res) & 0x80) >> 5); \ + _A = res; \ +} +#endif +#endif + +/*************************************************************** + * NEG + ***************************************************************/ +#define NEG { \ + UINT8 value = _A; \ + _A = 0; \ + SUB(value); \ +} + +/*************************************************************** + * DAA + ***************************************************************/ +#define DAA { \ + int idx = _A; \ + if( _F & CF ) idx |= 0x100; \ + if( _F & HF ) idx |= 0x200; \ + if( _F & NF ) idx |= 0x400; \ + _AF = DAATable[idx]; \ +} + +/*************************************************************** + * AND n + ***************************************************************/ +#define AND(value) \ + _A &= value; \ + _F = SZP[_A] | HF + +/*************************************************************** + * OR n + ***************************************************************/ +#define OR(value) \ + _A |= value; \ + _F = SZP[_A] + +/*************************************************************** + * XOR n + ***************************************************************/ +#define XOR(value) \ + _A ^= value; \ + _F = SZP[_A] + +/*************************************************************** + * CP n + ***************************************************************/ +#ifdef X86_ASM +#if Z80_EXACT +#define CP(value) \ + asm ( \ + " cmpb %2,%0 \n" \ + " lahf \n" \ + " setob %1 \n" /* al = 1 if overflow */ \ + " stc \n" /* prepare to set N flag */ \ + " adcb %1,%1 \n" /* shift to P/V bit position */ \ + " addb %1,%1 \n" \ + " andb $0xd1,%%ah \n" /* sign, zero, half carry, carry */ \ + " orb %%ah,%1 \n" /* combine with P/V */ \ + " movb %2,%%ah \n" /* get result */ \ + " andb $0x28,%%ah \n" /* maks flags 5+3 */ \ + " orb %%ah,%1 \n" /* put them into flags */ \ + :"=r" (_A), "=r" (_F) \ + :"r" (value), "1" (_F), "0" (_A) \ + ) +#else +#define CP(value) \ + asm ( \ + " cmpb %2,%0 \n" \ + " lahf \n" \ + " setob %1 \n" /* al = 1 if overflow */ \ + " stc \n" /* prepare to set N flag */ \ + " adcb %1,%1 \n" /* shift to P/V bit position */ \ + " addb %1,%1 \n" \ + " andb $0xd1,%%ah \n" /* sign, zero, half carry, carry */ \ + " orb %%ah,%1 \n" /* combine with P/V */ \ + :"=r" (_A), "=r" (_F) \ + :"r" (value), "1" (_F), "0" (_A) \ + ) +#endif +#else +#if BIG_FLAGS_ARRAY +#define CP(value) \ +{ \ + UINT32 ah = _AFD & 0xff00; \ + UINT32 res = (UINT8)((ah >> 8) - value); \ + _F = SZHVC_sub[ah | res]; \ +} +#else +#define CP(value) \ +{ \ + unsigned val = value; \ + unsigned res = _A - val; \ + _F = SZ[res & 0xff] | ((res >> 8) & CF) | NF | \ + ((_A ^ res ^ val) & HF) | \ + ((((val ^ _A) & (_A ^ res)) >> 5) & VF); \ +} +#endif +#endif + +/*************************************************************** + * EX AF,AF' + ***************************************************************/ +#define EX_AF { \ + PAIR tmp; \ + tmp = Z80.AF; Z80.AF = Z80.AF2; Z80.AF2 = tmp; \ +} + +/*************************************************************** + * EX DE,HL + ***************************************************************/ +#define EX_DE_HL { \ + PAIR tmp; \ + tmp = Z80.DE; Z80.DE = Z80.HL; Z80.HL = tmp; \ +} + +/*************************************************************** + * EXX + ***************************************************************/ +#define EXX { \ + PAIR tmp; \ + tmp = Z80.BC; Z80.BC = Z80.BC2; Z80.BC2 = tmp; \ + tmp = Z80.DE; Z80.DE = Z80.DE2; Z80.DE2 = tmp; \ + tmp = Z80.HL; Z80.HL = Z80.HL2; Z80.HL2 = tmp; \ +} + +/*************************************************************** + * EX (SP),r16 + ***************************************************************/ +#define EXSP(DR) \ +{ \ + PAIR tmp = { { 0, 0, 0, 0 } }; \ + RM16( _SPD, &tmp ); \ + WM16( _SPD, &Z80.DR ); \ + Z80.DR = tmp; \ +} + + +/*************************************************************** + * ADD16 + ***************************************************************/ +#ifdef X86_ASM +#if Z80_EXACT +#define ADD16(DR,SR) \ + asm ( \ + " andb $0xc4,%1 \n" \ + " addb %%dl,%%cl \n" \ + " adcb %%dh,%%ch \n" \ + " lahf \n" \ + " andb $0x11,%%ah \n" \ + " orb %%ah,%1 \n" \ + " movb %%ch,%%ah \n" /* get result MSB */ \ + " andb $0x28,%%ah \n" /* maks flags 5+3 */ \ + " orb %%ah,%1 \n" /* put them into flags */ \ + :"=c" (Z80.DR.d), "=r" (_F) \ + :"0" (Z80.DR.d), "1" (_F), "d" (Z80.SR.d) \ + ) +#else +#define ADD16(DR,SR) \ + asm ( \ + " andb $0xc4,%1 \n" \ + " addb %%dl,%%cl \n" \ + " adcb %%dh,%%ch \n" \ + " lahf \n" \ + " andb $0x11,%%ah \n" \ + " orb %%ah,%1 \n" \ + :"=c" (Z80.DR.d), "=r" (_F) \ + :"0" (Z80.DR.d), "1" (_F), "d" (Z80.SR.d) \ + ) +#endif +#else +#define ADD16(DR,SR) \ +{ \ + UINT32 res = Z80.DR.d + Z80.SR.d; \ + _F = (_F & (SF | ZF | VF)) | \ + (((Z80.DR.d ^ res ^ Z80.SR.d) >> 8) & HF) | \ + ((res >> 16) & CF); \ + Z80.DR.w.l = (UINT16)res; \ +} +#endif + +/*************************************************************** + * ADC r16,r16 + ***************************************************************/ +#ifdef X86_ASM +#if Z80_EXACT +#define ADC16(Reg) \ + asm ( \ + " shrb $1,%1 \n" \ + " adcb %%dl,%%cl \n" \ + " lahf \n" \ + " movb %%ah,%%dl \n" \ + " adcb %%dh,%%ch \n" \ + " lahf \n" \ + " setob %1 \n" \ + " orb $0xbf,%%dl \n" /* set all but zero */ \ + " addb %1,%1 \n" \ + " andb $0xd1,%%ah \n" /* sign,zero,half carry and carry */\ + " addb %1,%1 \n" \ + " orb %%ah,%1 \n" /* overflow into P/V */ \ + " andb %%dl,%1 \n" /* mask zero */ \ + " movb %%ch,%%ah \n" /* get result MSB */ \ + " andb $0x28,%%ah \n" /* maks flags 5+3 */ \ + " orb %%ah,%1 \n" /* put them into flags */ \ + :"=c" (_HLD), "=r" (_F) \ + :"0" (_HLD), "1" (_F), "d" (Z80.Reg.d) \ + ) +#else +#define ADC16(Reg) \ + asm ( \ + " shrb $1,%1 \n" \ + " adcb %%dl,%%cl \n" \ + " lahf \n" \ + " movb %%ah,%%dl \n" \ + " adcb %%dh,%%ch \n" \ + " lahf \n" \ + " setob %1 \n" \ + " orb $0xbf,%%dl \n" /* set all but zero */ \ + " addb %1,%1 \n" \ + " andb $0xd1,%%ah \n" /* sign,zero,half carry and carry */\ + " addb %1,%1 \n" \ + " orb %%ah,%1 \n" /* overflow into P/V */ \ + " andb %%dl,%1 \n" /* mask zero */ \ + :"=c" (_HLD), "=r" (_F) \ + :"0" (_HLD), "1" (_F), "d" (Z80.Reg.d) \ + ) +#endif +#else +#define ADC16(Reg) \ +{ \ + UINT32 res = _HLD + Z80.Reg.d + (_F & CF); \ + _F = (((_HLD ^ res ^ Z80.Reg.d) >> 8) & HF) | \ + ((res >> 16) & CF) | \ + ((res >> 8) & SF) | \ + ((res & 0xffff) ? 0 : ZF) | \ + (((Z80.Reg.d ^ _HLD ^ 0x8000) & (Z80.Reg.d ^ res) & 0x8000) >> 13); \ + _HL = (UINT16)res; \ +} +#endif + +/*************************************************************** + * SBC r16,r16 + ***************************************************************/ +#ifdef X86_ASM +#if Z80_EXACT +#define SBC16(Reg) \ +asm ( \ + " shrb $1,%1 \n" \ + " sbbb %%dl,%%cl \n" \ + " lahf \n" \ + " movb %%ah,%%dl \n" \ + " sbbb %%dh,%%ch \n" \ + " lahf \n" \ + " setob %1 \n" \ + " orb $0xbf,%%dl \n" /* set all but zero */ \ + " stc \n" \ + " adcb %1,%1 \n" \ + " andb $0xd1,%%ah \n" /* sign,zero,half carry and carry */\ + " addb %1,%1 \n" \ + " orb %%ah,%1 \n" /* overflow into P/V */ \ + " andb %%dl,%1 \n" /* mask zero */ \ + " movb %%ch,%%ah \n" /* get result MSB */ \ + " andb $0x28,%%ah \n" /* maks flags 5+3 */ \ + " orb %%ah,%1 \n" /* put them into flags */ \ + :"=c" (_HLD), "=r" (_F) \ + :"0" (_HLD), "1" (_F), "d" (Z80.Reg.d) \ + ) +#else +#define SBC16(Reg) \ +asm ( \ + " shrb $1,%1 \n" \ + " sbbb %%dl,%%cl \n" \ + " lahf \n" \ + " movb %%ah,%%dl \n" \ + " sbbb %%dh,%%ch \n" \ + " lahf \n" \ + " setob %1 \n" \ + " orb $0xbf,%%dl \n" /* set all but zero */ \ + " stc \n" \ + " adcb %1,%1 \n" \ + " andb $0xd1,%%ah \n" /* sign,zero,half carry and carry */\ + " addb %1,%1 \n" \ + " orb %%ah,%1 \n" /* overflow into P/V */ \ + " andb %%dl,%1 \n" /* mask zero */ \ + :"=c" (_HLD), "=r" (_F) \ + :"0" (_HLD), "1" (_F), "d" (Z80.Reg.d) \ + ) +#endif +#else +#define SBC16(Reg) \ +{ \ + UINT32 res = _HLD - Z80.Reg.d - (_F & CF); \ + _F = (((_HLD ^ res ^ Z80.Reg.d) >> 8) & HF) | NF | \ + ((res >> 16) & CF) | \ + ((res >> 8) & SF) | \ + ((res & 0xffff) ? 0 : ZF) | \ + (((Z80.Reg.d ^ _HLD) & (_HLD ^ res) &0x8000) >> 13); \ + _HL = (UINT16)res; \ +} +#endif + +/*************************************************************** + * RLC r8 + ***************************************************************/ +static __inline__ UINT8 RLC(UINT8 value) +{ + unsigned res = value; + unsigned c = (res & 0x80) ? CF : 0; + res = ((res << 1) | (res >> 7)) & 0xff; + _F = SZP[res] | c; + return res; +} + +/*************************************************************** + * RRC r8 + ***************************************************************/ +static __inline__ UINT8 RRC(UINT8 value) +{ + unsigned res = value; + unsigned c = (res & 0x01) ? CF : 0; + res = ((res >> 1) | (res << 7)) & 0xff; + _F = SZP[res] | c; + return res; +} + +/*************************************************************** + * RL r8 + ***************************************************************/ +static __inline__ UINT8 RL(UINT8 value) +{ + unsigned res = value; + unsigned c = (res & 0x80) ? CF : 0; + res = ((res << 1) | (_F & CF)) & 0xff; + _F = SZP[res] | c; + return res; +} + +/*************************************************************** + * RR r8 + ***************************************************************/ +static __inline__ UINT8 RR(UINT8 value) +{ + unsigned res = value; + unsigned c = (res & 0x01) ? CF : 0; + res = ((res >> 1) | (_F << 7)) & 0xff; + _F = SZP[res] | c; + return res; +} + +/*************************************************************** + * SLA r8 + ***************************************************************/ +static __inline__ UINT8 SLA(UINT8 value) +{ + unsigned res = value; + unsigned c = (res & 0x80) ? CF : 0; + res = (res << 1) & 0xff; + _F = SZP[res] | c; + return res; +} + +/*************************************************************** + * SRA r8 + ***************************************************************/ +static __inline__ UINT8 SRA(UINT8 value) +{ + unsigned res = value; + unsigned c = (res & 0x01) ? CF : 0; + res = ((res >> 1) | (res & 0x80)) & 0xff; + _F = SZP[res] | c; + return res; +} + +/*************************************************************** + * SLL r8 + ***************************************************************/ +static __inline__ UINT8 SLL(UINT8 value) +{ + unsigned res = value; + unsigned c = (res & 0x80) ? CF : 0; + res = ((res << 1) | 0x01) & 0xff; + _F = SZP[res] | c; + return res; +} + +/*************************************************************** + * SRL r8 + ***************************************************************/ +static __inline__ UINT8 SRL(UINT8 value) +{ + unsigned res = value; + unsigned c = (res & 0x01) ? CF : 0; + res = (res >> 1) & 0xff; + _F = SZP[res] | c; + return res; +} + +/*************************************************************** + * BIT bit,r8 + ***************************************************************/ +#define BIT(bit,reg) \ + _F = (_F & CF) | HF | SZ_BIT[reg & (1<>8) & (YF|XF)) +#else +#define BIT_XY BIT +#endif + +/*************************************************************** + * RES bit,r8 + ***************************************************************/ +static __inline__ UINT8 RES(UINT8 bit, UINT8 value) +{ + return value & ~(1< flag 5 */ \ + if( (_A + io) & 0x08 ) _F |= XF; /* bit 3 -> flag 3 */ \ + _HL++; _DE++; _BC--; \ + if( _BC ) _F |= VF; \ +} +#else +#define LDI { \ + WM( _DE, RM(_HL) ); \ + _F &= SF | ZF | YF | XF | CF; \ + _HL++; _DE++; _BC--; \ + if( _BC ) _F |= VF; \ +} +#endif + +/*************************************************************** + * CPI + ***************************************************************/ +#if Z80_EXACT +#define CPI { \ + UINT8 val = RM(_HL); \ + UINT8 res = _A - val; \ + _HL++; _BC--; \ + _F = (_F & CF) | (SZ[res] & ~(YF|XF)) | ((_A ^ val ^ res) & HF) | NF; \ + if( _F & HF ) res -= 1; \ + if( res & 0x02 ) _F |= YF; /* bit 1 -> flag 5 */ \ + if( res & 0x08 ) _F |= XF; /* bit 3 -> flag 3 */ \ + if( _BC ) _F |= VF; \ +} +#else +#define CPI { \ + UINT8 val = RM(_HL); \ + UINT8 res = _A - val; \ + _HL++; _BC--; \ + _F = (_F & CF) | SZ[res] | ((_A ^ val ^ res) & HF) | NF; \ + if( _BC ) _F |= VF; \ +} +#endif + +/*************************************************************** + * INI + ***************************************************************/ +#if Z80_EXACT +#define INI { \ + UINT8 io = IN(_BC); \ + _B--; \ + WM( _HL, io ); \ + _HL++; \ + _F = SZ[_B]; \ + if( io & SF ) _F |= NF; \ + if( ( ( (_C + 1) & 0xff) + io) & 0x100 ) _F |= HF | CF; \ + if( (irep_tmp1[_C & 3][io & 3] ^ \ + breg_tmp2[_B] ^ \ + (_C >> 2) ^ \ + (io >> 2)) & 1 ) \ + _F |= PF; \ +} +#else +#define INI { \ + _B--; \ + WM( _HL, IN(_BC) ); \ + _HL++; \ + _F = (_B) ? NF : NF | ZF; \ +} +#endif + +/*************************************************************** + * OUTI + ***************************************************************/ +#if Z80_EXACT +#define OUTI { \ + UINT8 io = RM(_HL); \ + _B--; \ + OUT( _BC, io ); \ + _HL++; \ + _F = SZ[_B]; \ + if( io & SF ) _F |= NF; \ + if( ( ( (_C + 1) & 0xff) + io) & 0x100 ) _F |= HF | CF; \ + if( (irep_tmp1[_C & 3][io & 3] ^ \ + breg_tmp2[_B] ^ \ + (_C >> 2) ^ \ + (io >> 2)) & 1 ) \ + _F |= PF; \ +} +#else +#define OUTI { \ + _B--; \ + OUT( _BC, RM(_HL) ); \ + _HL++; \ + _F = (_B) ? NF : NF | ZF; \ +} +#endif + +/*************************************************************** + * LDD + ***************************************************************/ +#if Z80_EXACT +#define LDD { \ + UINT8 io = RM(_HL); \ + WM( _DE, io ); \ + _F &= SF | ZF | CF; \ + if( (_A + io) & 0x02 ) _F |= YF; /* bit 1 -> flag 5 */ \ + if( (_A + io) & 0x08 ) _F |= XF; /* bit 3 -> flag 3 */ \ + _HL--; _DE--; _BC--; \ + if( _BC ) _F |= VF; \ +} +#else +#define LDD { \ + WM( _DE, RM(_HL) ); \ + _F &= SF | ZF | YF | XF | CF; \ + _HL--; _DE--; _BC--; \ + if( _BC ) _F |= VF; \ +} +#endif + +/*************************************************************** + * CPD + ***************************************************************/ +#if Z80_EXACT +#define CPD { \ + UINT8 val = RM(_HL); \ + UINT8 res = _A - val; \ + _HL--; _BC--; \ + _F = (_F & CF) | (SZ[res] & ~(YF|XF)) | ((_A ^ val ^ res) & HF) | NF; \ + if( _F & HF ) res -= 1; \ + if( res & 0x02 ) _F |= YF; /* bit 1 -> flag 5 */ \ + if( res & 0x08 ) _F |= XF; /* bit 3 -> flag 3 */ \ + if( _BC ) _F |= VF; \ +} +#else +#define CPD { \ + UINT8 val = RM(_HL); \ + UINT8 res = _A - val; \ + _HL--; _BC--; \ + _F = (_F & CF) | SZ[res] | ((_A ^ val ^ res) & HF) | NF; \ + if( _BC ) _F |= VF; \ +} +#endif + +/*************************************************************** + * IND + ***************************************************************/ +#if Z80_EXACT +#define IND { \ + UINT8 io = IN(_BC); \ + _B--; \ + WM( _HL, io ); \ + _HL--; \ + _F = SZ[_B]; \ + if( io & SF ) _F |= NF; \ + if( ( ( (_C - 1) & 0xff) + io) & 0x100 ) _F |= HF | CF; \ + if( (drep_tmp1[_C & 3][io & 3] ^ \ + breg_tmp2[_B] ^ \ + (_C >> 2) ^ \ + (io >> 2)) & 1 ) \ + _F |= PF; \ +} +#else +#define IND { \ + _B--; \ + WM( _HL, IN(_BC) ); \ + _HL--; \ + _F = (_B) ? NF : NF | ZF; \ +} +#endif + +/*************************************************************** + * OUTD + ***************************************************************/ +#if Z80_EXACT +#define OUTD { \ + UINT8 io = RM(_HL); \ + _B--; \ + OUT( _BC, io ); \ + _HL--; \ + _F = SZ[_B]; \ + if( io & SF ) _F |= NF; \ + if( ( ( (_C - 1) & 0xff) + io) & 0x100 ) _F |= HF | CF; \ + if( (drep_tmp1[_C & 3][io & 3] ^ \ + breg_tmp2[_B] ^ \ + (_C >> 2) ^ \ + (io >> 2)) & 1 ) \ + _F |= PF; \ +} +#else +#define OUTD { \ + _B--; \ + OUT( _BC, RM(_HL) ); \ + _HL--; \ + _F = (_B) ? NF : NF | ZF; \ +} +#endif + +/*************************************************************** + * LDIR + ***************************************************************/ +#define LDIR \ + LDI; \ + if( _BC ) \ + { \ + _PC -= 2; \ + CC(ex,0xb0); \ + } + +/*************************************************************** + * CPIR + ***************************************************************/ +#define CPIR \ + CPI; \ + if( _BC && !(_F & ZF) ) \ + { \ + _PC -= 2; \ + CC(ex,0xb1); \ + } + +/*************************************************************** + * INIR + ***************************************************************/ +#define INIR \ + INI; \ + if( _B ) \ + { \ + _PC -= 2; \ + CC(ex,0xb2); \ + } + +/*************************************************************** + * OTIR + ***************************************************************/ +#define OTIR \ + OUTI; \ + if( _B ) \ + { \ + _PC -= 2; \ + CC(ex,0xb3); \ + } + +/*************************************************************** + * LDDR + ***************************************************************/ +#define LDDR \ + LDD; \ + if( _BC ) \ + { \ + _PC -= 2; \ + CC(ex,0xb8); \ + } + +/*************************************************************** + * CPDR + ***************************************************************/ +#define CPDR \ + CPD; \ + if( _BC && !(_F & ZF) ) \ + { \ + _PC -= 2; \ + CC(ex,0xb9); \ + } + +/*************************************************************** + * INDR + ***************************************************************/ +#define INDR \ + IND; \ + if( _B ) \ + { \ + _PC -= 2; \ + CC(ex,0xba); \ + } + +/*************************************************************** + * OTDR + ***************************************************************/ +#define OTDR \ + OUTD; \ + if( _B ) \ + { \ + _PC -= 2; \ + CC(ex,0xbb); \ + } + +/*************************************************************** + * EI + ***************************************************************/ +#define EI { \ + /* If interrupts were disabled, execute one more \ + * instruction and check the IRQ line. \ + * If not, simply set interrupt flip-flop 2 \ + */ \ + if( _IFF1 == 0 ) \ + { \ + _IFF1 = _IFF2 = 1; \ + _PPC = _PCD; \ + _R++; \ + while( cpu_readop(_PCD) == 0xfb ) /* more EIs? */ \ + { \ + CC(op,0xfb); \ + _PPC =_PCD; \ + _PC++; \ + _R++; \ + } \ + if( Z80.irq_state != CLEAR_LINE || \ + Z80.request_irq >= 0 ) \ + { \ + after_EI = 1; /* avoid cycle skip hacks */ \ + EXEC(op,ROP()); \ + after_EI = 0; \ + take_interrupt(); \ + } else EXEC(op,ROP()); \ + } else _IFF2 = 1; \ +} + +/********************************************************** + * opcodes with CB prefix + * rotate, shift and bit operations + **********************************************************/ +OP(cb,00) { _B = RLC(_B); } /* RLC B */ +OP(cb,01) { _C = RLC(_C); } /* RLC C */ +OP(cb,02) { _D = RLC(_D); } /* RLC D */ +OP(cb,03) { _E = RLC(_E); } /* RLC E */ +OP(cb,04) { _H = RLC(_H); } /* RLC H */ +OP(cb,05) { _L = RLC(_L); } /* RLC L */ +OP(cb,06) { WM( _HL, RLC(RM(_HL)) ); } /* RLC (HL) */ +OP(cb,07) { _A = RLC(_A); } /* RLC A */ + +OP(cb,08) { _B = RRC(_B); } /* RRC B */ +OP(cb,09) { _C = RRC(_C); } /* RRC C */ +OP(cb,0a) { _D = RRC(_D); } /* RRC D */ +OP(cb,0b) { _E = RRC(_E); } /* RRC E */ +OP(cb,0c) { _H = RRC(_H); } /* RRC H */ +OP(cb,0d) { _L = RRC(_L); } /* RRC L */ +OP(cb,0e) { WM( _HL, RRC(RM(_HL)) ); } /* RRC (HL) */ +OP(cb,0f) { _A = RRC(_A); } /* RRC A */ + +OP(cb,10) { _B = RL(_B); } /* RL B */ +OP(cb,11) { _C = RL(_C); } /* RL C */ +OP(cb,12) { _D = RL(_D); } /* RL D */ +OP(cb,13) { _E = RL(_E); } /* RL E */ +OP(cb,14) { _H = RL(_H); } /* RL H */ +OP(cb,15) { _L = RL(_L); } /* RL L */ +OP(cb,16) { WM( _HL, RL(RM(_HL)) ); } /* RL (HL) */ +OP(cb,17) { _A = RL(_A); } /* RL A */ + +OP(cb,18) { _B = RR(_B); } /* RR B */ +OP(cb,19) { _C = RR(_C); } /* RR C */ +OP(cb,1a) { _D = RR(_D); } /* RR D */ +OP(cb,1b) { _E = RR(_E); } /* RR E */ +OP(cb,1c) { _H = RR(_H); } /* RR H */ +OP(cb,1d) { _L = RR(_L); } /* RR L */ +OP(cb,1e) { WM( _HL, RR(RM(_HL)) ); } /* RR (HL) */ +OP(cb,1f) { _A = RR(_A); } /* RR A */ + +OP(cb,20) { _B = SLA(_B); } /* SLA B */ +OP(cb,21) { _C = SLA(_C); } /* SLA C */ +OP(cb,22) { _D = SLA(_D); } /* SLA D */ +OP(cb,23) { _E = SLA(_E); } /* SLA E */ +OP(cb,24) { _H = SLA(_H); } /* SLA H */ +OP(cb,25) { _L = SLA(_L); } /* SLA L */ +OP(cb,26) { WM( _HL, SLA(RM(_HL)) ); } /* SLA (HL) */ +OP(cb,27) { _A = SLA(_A); } /* SLA A */ + +OP(cb,28) { _B = SRA(_B); } /* SRA B */ +OP(cb,29) { _C = SRA(_C); } /* SRA C */ +OP(cb,2a) { _D = SRA(_D); } /* SRA D */ +OP(cb,2b) { _E = SRA(_E); } /* SRA E */ +OP(cb,2c) { _H = SRA(_H); } /* SRA H */ +OP(cb,2d) { _L = SRA(_L); } /* SRA L */ +OP(cb,2e) { WM( _HL, SRA(RM(_HL)) ); } /* SRA (HL) */ +OP(cb,2f) { _A = SRA(_A); } /* SRA A */ + +OP(cb,30) { _B = SLL(_B); } /* SLL B */ +OP(cb,31) { _C = SLL(_C); } /* SLL C */ +OP(cb,32) { _D = SLL(_D); } /* SLL D */ +OP(cb,33) { _E = SLL(_E); } /* SLL E */ +OP(cb,34) { _H = SLL(_H); } /* SLL H */ +OP(cb,35) { _L = SLL(_L); } /* SLL L */ +OP(cb,36) { WM( _HL, SLL(RM(_HL)) ); } /* SLL (HL) */ +OP(cb,37) { _A = SLL(_A); } /* SLL A */ + +OP(cb,38) { _B = SRL(_B); } /* SRL B */ +OP(cb,39) { _C = SRL(_C); } /* SRL C */ +OP(cb,3a) { _D = SRL(_D); } /* SRL D */ +OP(cb,3b) { _E = SRL(_E); } /* SRL E */ +OP(cb,3c) { _H = SRL(_H); } /* SRL H */ +OP(cb,3d) { _L = SRL(_L); } /* SRL L */ +OP(cb,3e) { WM( _HL, SRL(RM(_HL)) ); } /* SRL (HL) */ +OP(cb,3f) { _A = SRL(_A); } /* SRL A */ + +OP(cb,40) { BIT(0,_B); } /* BIT 0,B */ +OP(cb,41) { BIT(0,_C); } /* BIT 0,C */ +OP(cb,42) { BIT(0,_D); } /* BIT 0,D */ +OP(cb,43) { BIT(0,_E); } /* BIT 0,E */ +OP(cb,44) { BIT(0,_H); } /* BIT 0,H */ +OP(cb,45) { BIT(0,_L); } /* BIT 0,L */ +OP(cb,46) { BIT(0,RM(_HL)); } /* BIT 0,(HL) */ +OP(cb,47) { BIT(0,_A); } /* BIT 0,A */ + +OP(cb,48) { BIT(1,_B); } /* BIT 1,B */ +OP(cb,49) { BIT(1,_C); } /* BIT 1,C */ +OP(cb,4a) { BIT(1,_D); } /* BIT 1,D */ +OP(cb,4b) { BIT(1,_E); } /* BIT 1,E */ +OP(cb,4c) { BIT(1,_H); } /* BIT 1,H */ +OP(cb,4d) { BIT(1,_L); } /* BIT 1,L */ +OP(cb,4e) { BIT(1,RM(_HL)); } /* BIT 1,(HL) */ +OP(cb,4f) { BIT(1,_A); } /* BIT 1,A */ + +OP(cb,50) { BIT(2,_B); } /* BIT 2,B */ +OP(cb,51) { BIT(2,_C); } /* BIT 2,C */ +OP(cb,52) { BIT(2,_D); } /* BIT 2,D */ +OP(cb,53) { BIT(2,_E); } /* BIT 2,E */ +OP(cb,54) { BIT(2,_H); } /* BIT 2,H */ +OP(cb,55) { BIT(2,_L); } /* BIT 2,L */ +OP(cb,56) { BIT(2,RM(_HL)); } /* BIT 2,(HL) */ +OP(cb,57) { BIT(2,_A); } /* BIT 2,A */ + +OP(cb,58) { BIT(3,_B); } /* BIT 3,B */ +OP(cb,59) { BIT(3,_C); } /* BIT 3,C */ +OP(cb,5a) { BIT(3,_D); } /* BIT 3,D */ +OP(cb,5b) { BIT(3,_E); } /* BIT 3,E */ +OP(cb,5c) { BIT(3,_H); } /* BIT 3,H */ +OP(cb,5d) { BIT(3,_L); } /* BIT 3,L */ +OP(cb,5e) { BIT(3,RM(_HL)); } /* BIT 3,(HL) */ +OP(cb,5f) { BIT(3,_A); } /* BIT 3,A */ + +OP(cb,60) { BIT(4,_B); } /* BIT 4,B */ +OP(cb,61) { BIT(4,_C); } /* BIT 4,C */ +OP(cb,62) { BIT(4,_D); } /* BIT 4,D */ +OP(cb,63) { BIT(4,_E); } /* BIT 4,E */ +OP(cb,64) { BIT(4,_H); } /* BIT 4,H */ +OP(cb,65) { BIT(4,_L); } /* BIT 4,L */ +OP(cb,66) { BIT(4,RM(_HL)); } /* BIT 4,(HL) */ +OP(cb,67) { BIT(4,_A); } /* BIT 4,A */ + +OP(cb,68) { BIT(5,_B); } /* BIT 5,B */ +OP(cb,69) { BIT(5,_C); } /* BIT 5,C */ +OP(cb,6a) { BIT(5,_D); } /* BIT 5,D */ +OP(cb,6b) { BIT(5,_E); } /* BIT 5,E */ +OP(cb,6c) { BIT(5,_H); } /* BIT 5,H */ +OP(cb,6d) { BIT(5,_L); } /* BIT 5,L */ +OP(cb,6e) { BIT(5,RM(_HL)); } /* BIT 5,(HL) */ +OP(cb,6f) { BIT(5,_A); } /* BIT 5,A */ + +OP(cb,70) { BIT(6,_B); } /* BIT 6,B */ +OP(cb,71) { BIT(6,_C); } /* BIT 6,C */ +OP(cb,72) { BIT(6,_D); } /* BIT 6,D */ +OP(cb,73) { BIT(6,_E); } /* BIT 6,E */ +OP(cb,74) { BIT(6,_H); } /* BIT 6,H */ +OP(cb,75) { BIT(6,_L); } /* BIT 6,L */ +OP(cb,76) { BIT(6,RM(_HL)); } /* BIT 6,(HL) */ +OP(cb,77) { BIT(6,_A); } /* BIT 6,A */ + +OP(cb,78) { BIT(7,_B); } /* BIT 7,B */ +OP(cb,79) { BIT(7,_C); } /* BIT 7,C */ +OP(cb,7a) { BIT(7,_D); } /* BIT 7,D */ +OP(cb,7b) { BIT(7,_E); } /* BIT 7,E */ +OP(cb,7c) { BIT(7,_H); } /* BIT 7,H */ +OP(cb,7d) { BIT(7,_L); } /* BIT 7,L */ +OP(cb,7e) { BIT(7,RM(_HL)); } /* BIT 7,(HL) */ +OP(cb,7f) { BIT(7,_A); } /* BIT 7,A */ + +OP(cb,80) { _B = RES(0,_B); } /* RES 0,B */ +OP(cb,81) { _C = RES(0,_C); } /* RES 0,C */ +OP(cb,82) { _D = RES(0,_D); } /* RES 0,D */ +OP(cb,83) { _E = RES(0,_E); } /* RES 0,E */ +OP(cb,84) { _H = RES(0,_H); } /* RES 0,H */ +OP(cb,85) { _L = RES(0,_L); } /* RES 0,L */ +OP(cb,86) { WM( _HL, RES(0,RM(_HL)) ); } /* RES 0,(HL) */ +OP(cb,87) { _A = RES(0,_A); } /* RES 0,A */ + +OP(cb,88) { _B = RES(1,_B); } /* RES 1,B */ +OP(cb,89) { _C = RES(1,_C); } /* RES 1,C */ +OP(cb,8a) { _D = RES(1,_D); } /* RES 1,D */ +OP(cb,8b) { _E = RES(1,_E); } /* RES 1,E */ +OP(cb,8c) { _H = RES(1,_H); } /* RES 1,H */ +OP(cb,8d) { _L = RES(1,_L); } /* RES 1,L */ +OP(cb,8e) { WM( _HL, RES(1,RM(_HL)) ); } /* RES 1,(HL) */ +OP(cb,8f) { _A = RES(1,_A); } /* RES 1,A */ + +OP(cb,90) { _B = RES(2,_B); } /* RES 2,B */ +OP(cb,91) { _C = RES(2,_C); } /* RES 2,C */ +OP(cb,92) { _D = RES(2,_D); } /* RES 2,D */ +OP(cb,93) { _E = RES(2,_E); } /* RES 2,E */ +OP(cb,94) { _H = RES(2,_H); } /* RES 2,H */ +OP(cb,95) { _L = RES(2,_L); } /* RES 2,L */ +OP(cb,96) { WM( _HL, RES(2,RM(_HL)) ); } /* RES 2,(HL) */ +OP(cb,97) { _A = RES(2,_A); } /* RES 2,A */ + +OP(cb,98) { _B = RES(3,_B); } /* RES 3,B */ +OP(cb,99) { _C = RES(3,_C); } /* RES 3,C */ +OP(cb,9a) { _D = RES(3,_D); } /* RES 3,D */ +OP(cb,9b) { _E = RES(3,_E); } /* RES 3,E */ +OP(cb,9c) { _H = RES(3,_H); } /* RES 3,H */ +OP(cb,9d) { _L = RES(3,_L); } /* RES 3,L */ +OP(cb,9e) { WM( _HL, RES(3,RM(_HL)) ); } /* RES 3,(HL) */ +OP(cb,9f) { _A = RES(3,_A); } /* RES 3,A */ + +OP(cb,a0) { _B = RES(4,_B); } /* RES 4,B */ +OP(cb,a1) { _C = RES(4,_C); } /* RES 4,C */ +OP(cb,a2) { _D = RES(4,_D); } /* RES 4,D */ +OP(cb,a3) { _E = RES(4,_E); } /* RES 4,E */ +OP(cb,a4) { _H = RES(4,_H); } /* RES 4,H */ +OP(cb,a5) { _L = RES(4,_L); } /* RES 4,L */ +OP(cb,a6) { WM( _HL, RES(4,RM(_HL)) ); } /* RES 4,(HL) */ +OP(cb,a7) { _A = RES(4,_A); } /* RES 4,A */ + +OP(cb,a8) { _B = RES(5,_B); } /* RES 5,B */ +OP(cb,a9) { _C = RES(5,_C); } /* RES 5,C */ +OP(cb,aa) { _D = RES(5,_D); } /* RES 5,D */ +OP(cb,ab) { _E = RES(5,_E); } /* RES 5,E */ +OP(cb,ac) { _H = RES(5,_H); } /* RES 5,H */ +OP(cb,ad) { _L = RES(5,_L); } /* RES 5,L */ +OP(cb,ae) { WM( _HL, RES(5,RM(_HL)) ); } /* RES 5,(HL) */ +OP(cb,af) { _A = RES(5,_A); } /* RES 5,A */ + +OP(cb,b0) { _B = RES(6,_B); } /* RES 6,B */ +OP(cb,b1) { _C = RES(6,_C); } /* RES 6,C */ +OP(cb,b2) { _D = RES(6,_D); } /* RES 6,D */ +OP(cb,b3) { _E = RES(6,_E); } /* RES 6,E */ +OP(cb,b4) { _H = RES(6,_H); } /* RES 6,H */ +OP(cb,b5) { _L = RES(6,_L); } /* RES 6,L */ +OP(cb,b6) { WM( _HL, RES(6,RM(_HL)) ); } /* RES 6,(HL) */ +OP(cb,b7) { _A = RES(6,_A); } /* RES 6,A */ + +OP(cb,b8) { _B = RES(7,_B); } /* RES 7,B */ +OP(cb,b9) { _C = RES(7,_C); } /* RES 7,C */ +OP(cb,ba) { _D = RES(7,_D); } /* RES 7,D */ +OP(cb,bb) { _E = RES(7,_E); } /* RES 7,E */ +OP(cb,bc) { _H = RES(7,_H); } /* RES 7,H */ +OP(cb,bd) { _L = RES(7,_L); } /* RES 7,L */ +OP(cb,be) { WM( _HL, RES(7,RM(_HL)) ); } /* RES 7,(HL) */ +OP(cb,bf) { _A = RES(7,_A); } /* RES 7,A */ + +OP(cb,c0) { _B = SET(0,_B); } /* SET 0,B */ +OP(cb,c1) { _C = SET(0,_C); } /* SET 0,C */ +OP(cb,c2) { _D = SET(0,_D); } /* SET 0,D */ +OP(cb,c3) { _E = SET(0,_E); } /* SET 0,E */ +OP(cb,c4) { _H = SET(0,_H); } /* SET 0,H */ +OP(cb,c5) { _L = SET(0,_L); } /* SET 0,L */ +OP(cb,c6) { WM( _HL, SET(0,RM(_HL)) ); } /* SET 0,(HL) */ +OP(cb,c7) { _A = SET(0,_A); } /* SET 0,A */ + +OP(cb,c8) { _B = SET(1,_B); } /* SET 1,B */ +OP(cb,c9) { _C = SET(1,_C); } /* SET 1,C */ +OP(cb,ca) { _D = SET(1,_D); } /* SET 1,D */ +OP(cb,cb) { _E = SET(1,_E); } /* SET 1,E */ +OP(cb,cc) { _H = SET(1,_H); } /* SET 1,H */ +OP(cb,cd) { _L = SET(1,_L); } /* SET 1,L */ +OP(cb,ce) { WM( _HL, SET(1,RM(_HL)) ); } /* SET 1,(HL) */ +OP(cb,cf) { _A = SET(1,_A); } /* SET 1,A */ + +OP(cb,d0) { _B = SET(2,_B); } /* SET 2,B */ +OP(cb,d1) { _C = SET(2,_C); } /* SET 2,C */ +OP(cb,d2) { _D = SET(2,_D); } /* SET 2,D */ +OP(cb,d3) { _E = SET(2,_E); } /* SET 2,E */ +OP(cb,d4) { _H = SET(2,_H); } /* SET 2,H */ +OP(cb,d5) { _L = SET(2,_L); } /* SET 2,L */ +OP(cb,d6) { WM( _HL, SET(2,RM(_HL)) ); }/* SET 2,(HL) */ +OP(cb,d7) { _A = SET(2,_A); } /* SET 2,A */ + +OP(cb,d8) { _B = SET(3,_B); } /* SET 3,B */ +OP(cb,d9) { _C = SET(3,_C); } /* SET 3,C */ +OP(cb,da) { _D = SET(3,_D); } /* SET 3,D */ +OP(cb,db) { _E = SET(3,_E); } /* SET 3,E */ +OP(cb,dc) { _H = SET(3,_H); } /* SET 3,H */ +OP(cb,dd) { _L = SET(3,_L); } /* SET 3,L */ +OP(cb,de) { WM( _HL, SET(3,RM(_HL)) ); } /* SET 3,(HL) */ +OP(cb,df) { _A = SET(3,_A); } /* SET 3,A */ + +OP(cb,e0) { _B = SET(4,_B); } /* SET 4,B */ +OP(cb,e1) { _C = SET(4,_C); } /* SET 4,C */ +OP(cb,e2) { _D = SET(4,_D); } /* SET 4,D */ +OP(cb,e3) { _E = SET(4,_E); } /* SET 4,E */ +OP(cb,e4) { _H = SET(4,_H); } /* SET 4,H */ +OP(cb,e5) { _L = SET(4,_L); } /* SET 4,L */ +OP(cb,e6) { WM( _HL, SET(4,RM(_HL)) ); } /* SET 4,(HL) */ +OP(cb,e7) { _A = SET(4,_A); } /* SET 4,A */ + +OP(cb,e8) { _B = SET(5,_B); } /* SET 5,B */ +OP(cb,e9) { _C = SET(5,_C); } /* SET 5,C */ +OP(cb,ea) { _D = SET(5,_D); } /* SET 5,D */ +OP(cb,eb) { _E = SET(5,_E); } /* SET 5,E */ +OP(cb,ec) { _H = SET(5,_H); } /* SET 5,H */ +OP(cb,ed) { _L = SET(5,_L); } /* SET 5,L */ +OP(cb,ee) { WM( _HL, SET(5,RM(_HL)) ); } /* SET 5,(HL) */ +OP(cb,ef) { _A = SET(5,_A); } /* SET 5,A */ + +OP(cb,f0) { _B = SET(6,_B); } /* SET 6,B */ +OP(cb,f1) { _C = SET(6,_C); } /* SET 6,C */ +OP(cb,f2) { _D = SET(6,_D); } /* SET 6,D */ +OP(cb,f3) { _E = SET(6,_E); } /* SET 6,E */ +OP(cb,f4) { _H = SET(6,_H); } /* SET 6,H */ +OP(cb,f5) { _L = SET(6,_L); } /* SET 6,L */ +OP(cb,f6) { WM( _HL, SET(6,RM(_HL)) ); } /* SET 6,(HL) */ +OP(cb,f7) { _A = SET(6,_A); } /* SET 6,A */ + +OP(cb,f8) { _B = SET(7,_B); } /* SET 7,B */ +OP(cb,f9) { _C = SET(7,_C); } /* SET 7,C */ +OP(cb,fa) { _D = SET(7,_D); } /* SET 7,D */ +OP(cb,fb) { _E = SET(7,_E); } /* SET 7,E */ +OP(cb,fc) { _H = SET(7,_H); } /* SET 7,H */ +OP(cb,fd) { _L = SET(7,_L); } /* SET 7,L */ +OP(cb,fe) { WM( _HL, SET(7,RM(_HL)) ); } /* SET 7,(HL) */ +OP(cb,ff) { _A = SET(7,_A); } /* SET 7,A */ + + +/********************************************************** +* opcodes with DD/FD CB prefix +* rotate, shift and bit operations with (IX+o) +**********************************************************/ +OP(xycb,00) { _B = RLC( RM(EA) ); WM( EA,_B ); } /* RLC B=(XY+o) */ +OP(xycb,01) { _C = RLC( RM(EA) ); WM( EA,_C ); } /* RLC C=(XY+o) */ +OP(xycb,02) { _D = RLC( RM(EA) ); WM( EA,_D ); } /* RLC D=(XY+o) */ +OP(xycb,03) { _E = RLC( RM(EA) ); WM( EA,_E ); } /* RLC E=(XY+o) */ +OP(xycb,04) { _H = RLC( RM(EA) ); WM( EA,_H ); } /* RLC H=(XY+o) */ +OP(xycb,05) { _L = RLC( RM(EA) ); WM( EA,_L ); } /* RLC L=(XY+o) */ +OP(xycb,06) { WM( EA, RLC( RM(EA) ) ); } /* RLC (XY+o) */ +OP(xycb,07) { _A = RLC( RM(EA) ); WM( EA,_A ); } /* RLC A=(XY+o) */ + +OP(xycb,08) { _B = RRC( RM(EA) ); WM( EA,_B ); } /* RRC B=(XY+o) */ +OP(xycb,09) { _C = RRC( RM(EA) ); WM( EA,_C ); } /* RRC C=(XY+o) */ +OP(xycb,0a) { _D = RRC( RM(EA) ); WM( EA,_D ); } /* RRC D=(XY+o) */ +OP(xycb,0b) { _E = RRC( RM(EA) ); WM( EA,_E ); } /* RRC E=(XY+o) */ +OP(xycb,0c) { _H = RRC( RM(EA) ); WM( EA,_H ); } /* RRC H=(XY+o) */ +OP(xycb,0d) { _L = RRC( RM(EA) ); WM( EA,_L ); } /* RRC L=(XY+o) */ +OP(xycb,0e) { WM( EA,RRC( RM(EA) ) ); } /* RRC (XY+o) */ +OP(xycb,0f) { _A = RRC( RM(EA) ); WM( EA,_A ); } /* RRC A=(XY+o) */ + +OP(xycb,10) { _B = RL( RM(EA) ); WM( EA,_B ); } /* RL B=(XY+o) */ +OP(xycb,11) { _C = RL( RM(EA) ); WM( EA,_C ); } /* RL C=(XY+o) */ +OP(xycb,12) { _D = RL( RM(EA) ); WM( EA,_D ); } /* RL D=(XY+o) */ +OP(xycb,13) { _E = RL( RM(EA) ); WM( EA,_E ); } /* RL E=(XY+o) */ +OP(xycb,14) { _H = RL( RM(EA) ); WM( EA,_H ); } /* RL H=(XY+o) */ +OP(xycb,15) { _L = RL( RM(EA) ); WM( EA,_L ); } /* RL L=(XY+o) */ +OP(xycb,16) { WM( EA,RL( RM(EA) ) ); } /* RL (XY+o) */ +OP(xycb,17) { _A = RL( RM(EA) ); WM( EA,_A ); } /* RL A=(XY+o) */ + +OP(xycb,18) { _B = RR( RM(EA) ); WM( EA,_B ); } /* RR B=(XY+o) */ +OP(xycb,19) { _C = RR( RM(EA) ); WM( EA,_C ); } /* RR C=(XY+o) */ +OP(xycb,1a) { _D = RR( RM(EA) ); WM( EA,_D ); } /* RR D=(XY+o) */ +OP(xycb,1b) { _E = RR( RM(EA) ); WM( EA,_E ); } /* RR E=(XY+o) */ +OP(xycb,1c) { _H = RR( RM(EA) ); WM( EA,_H ); } /* RR H=(XY+o) */ +OP(xycb,1d) { _L = RR( RM(EA) ); WM( EA,_L ); } /* RR L=(XY+o) */ +OP(xycb,1e) { WM( EA,RR( RM(EA) ) ); } /* RR (XY+o) */ +OP(xycb,1f) { _A = RR( RM(EA) ); WM( EA,_A ); } /* RR A=(XY+o) */ + +OP(xycb,20) { _B = SLA( RM(EA) ); WM( EA,_B ); } /* SLA B=(XY+o) */ +OP(xycb,21) { _C = SLA( RM(EA) ); WM( EA,_C ); } /* SLA C=(XY+o) */ +OP(xycb,22) { _D = SLA( RM(EA) ); WM( EA,_D ); } /* SLA D=(XY+o) */ +OP(xycb,23) { _E = SLA( RM(EA) ); WM( EA,_E ); } /* SLA E=(XY+o) */ +OP(xycb,24) { _H = SLA( RM(EA) ); WM( EA,_H ); } /* SLA H=(XY+o) */ +OP(xycb,25) { _L = SLA( RM(EA) ); WM( EA,_L ); } /* SLA L=(XY+o) */ +OP(xycb,26) { WM( EA,SLA( RM(EA) ) ); } /* SLA (XY+o) */ +OP(xycb,27) { _A = SLA( RM(EA) ); WM( EA,_A ); } /* SLA A=(XY+o) */ + +OP(xycb,28) { _B = SRA( RM(EA) ); WM( EA,_B ); } /* SRA B=(XY+o) */ +OP(xycb,29) { _C = SRA( RM(EA) ); WM( EA,_C ); } /* SRA C=(XY+o) */ +OP(xycb,2a) { _D = SRA( RM(EA) ); WM( EA,_D ); } /* SRA D=(XY+o) */ +OP(xycb,2b) { _E = SRA( RM(EA) ); WM( EA,_E ); } /* SRA E=(XY+o) */ +OP(xycb,2c) { _H = SRA( RM(EA) ); WM( EA,_H ); } /* SRA H=(XY+o) */ +OP(xycb,2d) { _L = SRA( RM(EA) ); WM( EA,_L ); } /* SRA L=(XY+o) */ +OP(xycb,2e) { WM( EA,SRA( RM(EA) ) ); } /* SRA (XY+o) */ +OP(xycb,2f) { _A = SRA( RM(EA) ); WM( EA,_A ); } /* SRA A=(XY+o) */ + +OP(xycb,30) { _B = SLL( RM(EA) ); WM( EA,_B ); } /* SLL B=(XY+o) */ +OP(xycb,31) { _C = SLL( RM(EA) ); WM( EA,_C ); } /* SLL C=(XY+o) */ +OP(xycb,32) { _D = SLL( RM(EA) ); WM( EA,_D ); } /* SLL D=(XY+o) */ +OP(xycb,33) { _E = SLL( RM(EA) ); WM( EA,_E ); } /* SLL E=(XY+o) */ +OP(xycb,34) { _H = SLL( RM(EA) ); WM( EA,_H ); } /* SLL H=(XY+o) */ +OP(xycb,35) { _L = SLL( RM(EA) ); WM( EA,_L ); } /* SLL L=(XY+o) */ +OP(xycb,36) { WM( EA,SLL( RM(EA) ) ); } /* SLL (XY+o) */ +OP(xycb,37) { _A = SLL( RM(EA) ); WM( EA,_A ); } /* SLL A=(XY+o) */ + +OP(xycb,38) { _B = SRL( RM(EA) ); WM( EA,_B ); } /* SRL B=(XY+o) */ +OP(xycb,39) { _C = SRL( RM(EA) ); WM( EA,_C ); } /* SRL C=(XY+o) */ +OP(xycb,3a) { _D = SRL( RM(EA) ); WM( EA,_D ); } /* SRL D=(XY+o) */ +OP(xycb,3b) { _E = SRL( RM(EA) ); WM( EA,_E ); } /* SRL E=(XY+o) */ +OP(xycb,3c) { _H = SRL( RM(EA) ); WM( EA,_H ); } /* SRL H=(XY+o) */ +OP(xycb,3d) { _L = SRL( RM(EA) ); WM( EA,_L ); } /* SRL L=(XY+o) */ +OP(xycb,3e) { WM( EA,SRL( RM(EA) ) ); } /* SRL (XY+o) */ +OP(xycb,3f) { _A = SRL( RM(EA) ); WM( EA,_A ); } /* SRL A=(XY+o) */ + +OP(xycb,40) { xycb_46(); } /* BIT 0,B=(XY+o) */ +OP(xycb,41) { xycb_46(); } /* BIT 0,C=(XY+o) */ +OP(xycb,42) { xycb_46(); } /* BIT 0,D=(XY+o) */ +OP(xycb,43) { xycb_46(); } /* BIT 0,E=(XY+o) */ +OP(xycb,44) { xycb_46(); } /* BIT 0,H=(XY+o) */ +OP(xycb,45) { xycb_46(); } /* BIT 0,L=(XY+o) */ +OP(xycb,46) { BIT_XY(0,RM(EA)); } /* BIT 0,(XY+o) */ +OP(xycb,47) { xycb_46(); } /* BIT 0,A=(XY+o) */ + +OP(xycb,48) { xycb_4e(); } /* BIT 1,B=(XY+o) */ +OP(xycb,49) { xycb_4e(); } /* BIT 1,C=(XY+o) */ +OP(xycb,4a) { xycb_4e(); } /* BIT 1,D=(XY+o) */ +OP(xycb,4b) { xycb_4e(); } /* BIT 1,E=(XY+o) */ +OP(xycb,4c) { xycb_4e(); } /* BIT 1,H=(XY+o) */ +OP(xycb,4d) { xycb_4e(); } /* BIT 1,L=(XY+o) */ +OP(xycb,4e) { BIT_XY(1,RM(EA)); } /* BIT 1,(XY+o) */ +OP(xycb,4f) { xycb_4e(); } /* BIT 1,A=(XY+o) */ + +OP(xycb,50) { xycb_56(); } /* BIT 2,B=(XY+o) */ +OP(xycb,51) { xycb_56(); } /* BIT 2,C=(XY+o) */ +OP(xycb,52) { xycb_56(); } /* BIT 2,D=(XY+o) */ +OP(xycb,53) { xycb_56(); } /* BIT 2,E=(XY+o) */ +OP(xycb,54) { xycb_56(); } /* BIT 2,H=(XY+o) */ +OP(xycb,55) { xycb_56(); } /* BIT 2,L=(XY+o) */ +OP(xycb,56) { BIT_XY(2,RM(EA)); } /* BIT 2,(XY+o) */ +OP(xycb,57) { xycb_56(); } /* BIT 2,A=(XY+o) */ + +OP(xycb,58) { xycb_5e(); } /* BIT 3,B=(XY+o) */ +OP(xycb,59) { xycb_5e(); } /* BIT 3,C=(XY+o) */ +OP(xycb,5a) { xycb_5e(); } /* BIT 3,D=(XY+o) */ +OP(xycb,5b) { xycb_5e(); } /* BIT 3,E=(XY+o) */ +OP(xycb,5c) { xycb_5e(); } /* BIT 3,H=(XY+o) */ +OP(xycb,5d) { xycb_5e(); } /* BIT 3,L=(XY+o) */ +OP(xycb,5e) { BIT_XY(3,RM(EA)); } /* BIT 3,(XY+o) */ +OP(xycb,5f) { xycb_5e(); } /* BIT 3,A=(XY+o) */ + +OP(xycb,60) { xycb_66(); } /* BIT 4,B=(XY+o) */ +OP(xycb,61) { xycb_66(); } /* BIT 4,C=(XY+o) */ +OP(xycb,62) { xycb_66(); } /* BIT 4,D=(XY+o) */ +OP(xycb,63) { xycb_66(); } /* BIT 4,E=(XY+o) */ +OP(xycb,64) { xycb_66(); } /* BIT 4,H=(XY+o) */ +OP(xycb,65) { xycb_66(); } /* BIT 4,L=(XY+o) */ +OP(xycb,66) { BIT_XY(4,RM(EA)); } /* BIT 4,(XY+o) */ +OP(xycb,67) { xycb_66(); } /* BIT 4,A=(XY+o) */ + +OP(xycb,68) { xycb_6e(); } /* BIT 5,B=(XY+o) */ +OP(xycb,69) { xycb_6e(); } /* BIT 5,C=(XY+o) */ +OP(xycb,6a) { xycb_6e(); } /* BIT 5,D=(XY+o) */ +OP(xycb,6b) { xycb_6e(); } /* BIT 5,E=(XY+o) */ +OP(xycb,6c) { xycb_6e(); } /* BIT 5,H=(XY+o) */ +OP(xycb,6d) { xycb_6e(); } /* BIT 5,L=(XY+o) */ +OP(xycb,6e) { BIT_XY(5,RM(EA)); } /* BIT 5,(XY+o) */ +OP(xycb,6f) { xycb_6e(); } /* BIT 5,A=(XY+o) */ + +OP(xycb,70) { xycb_76(); } /* BIT 6,B=(XY+o) */ +OP(xycb,71) { xycb_76(); } /* BIT 6,C=(XY+o) */ +OP(xycb,72) { xycb_76(); } /* BIT 6,D=(XY+o) */ +OP(xycb,73) { xycb_76(); } /* BIT 6,E=(XY+o) */ +OP(xycb,74) { xycb_76(); } /* BIT 6,H=(XY+o) */ +OP(xycb,75) { xycb_76(); } /* BIT 6,L=(XY+o) */ +OP(xycb,76) { BIT_XY(6,RM(EA)); } /* BIT 6,(XY+o) */ +OP(xycb,77) { xycb_76(); } /* BIT 6,A=(XY+o) */ + +OP(xycb,78) { xycb_7e(); } /* BIT 7,B=(XY+o) */ +OP(xycb,79) { xycb_7e(); } /* BIT 7,C=(XY+o) */ +OP(xycb,7a) { xycb_7e(); } /* BIT 7,D=(XY+o) */ +OP(xycb,7b) { xycb_7e(); } /* BIT 7,E=(XY+o) */ +OP(xycb,7c) { xycb_7e(); } /* BIT 7,H=(XY+o) */ +OP(xycb,7d) { xycb_7e(); } /* BIT 7,L=(XY+o) */ +OP(xycb,7e) { BIT_XY(7,RM(EA)); } /* BIT 7,(XY+o) */ +OP(xycb,7f) { xycb_7e(); } /* BIT 7,A=(XY+o) */ + +OP(xycb,80) { _B = RES(0, RM(EA) ); WM( EA,_B ); } /* RES 0,B=(XY+o) */ +OP(xycb,81) { _C = RES(0, RM(EA) ); WM( EA,_C ); } /* RES 0,C=(XY+o) */ +OP(xycb,82) { _D = RES(0, RM(EA) ); WM( EA,_D ); } /* RES 0,D=(XY+o) */ +OP(xycb,83) { _E = RES(0, RM(EA) ); WM( EA,_E ); } /* RES 0,E=(XY+o) */ +OP(xycb,84) { _H = RES(0, RM(EA) ); WM( EA,_H ); } /* RES 0,H=(XY+o) */ +OP(xycb,85) { _L = RES(0, RM(EA) ); WM( EA,_L ); } /* RES 0,L=(XY+o) */ +OP(xycb,86) { WM( EA, RES(0,RM(EA)) ); } /* RES 0,(XY+o) */ +OP(xycb,87) { _A = RES(0, RM(EA) ); WM( EA,_A ); } /* RES 0,A=(XY+o) */ + +OP(xycb,88) { _B = RES(1, RM(EA) ); WM( EA,_B ); } /* RES 1,B=(XY+o) */ +OP(xycb,89) { _C = RES(1, RM(EA) ); WM( EA,_C ); } /* RES 1,C=(XY+o) */ +OP(xycb,8a) { _D = RES(1, RM(EA) ); WM( EA,_D ); } /* RES 1,D=(XY+o) */ +OP(xycb,8b) { _E = RES(1, RM(EA) ); WM( EA,_E ); } /* RES 1,E=(XY+o) */ +OP(xycb,8c) { _H = RES(1, RM(EA) ); WM( EA,_H ); } /* RES 1,H=(XY+o) */ +OP(xycb,8d) { _L = RES(1, RM(EA) ); WM( EA,_L ); } /* RES 1,L=(XY+o) */ +OP(xycb,8e) { WM( EA, RES(1,RM(EA)) ); } /* RES 1,(XY+o) */ +OP(xycb,8f) { _A = RES(1, RM(EA) ); WM( EA,_A ); } /* RES 1,A=(XY+o) */ + +OP(xycb,90) { _B = RES(2, RM(EA) ); WM( EA,_B ); } /* RES 2,B=(XY+o) */ +OP(xycb,91) { _C = RES(2, RM(EA) ); WM( EA,_C ); } /* RES 2,C=(XY+o) */ +OP(xycb,92) { _D = RES(2, RM(EA) ); WM( EA,_D ); } /* RES 2,D=(XY+o) */ +OP(xycb,93) { _E = RES(2, RM(EA) ); WM( EA,_E ); } /* RES 2,E=(XY+o) */ +OP(xycb,94) { _H = RES(2, RM(EA) ); WM( EA,_H ); } /* RES 2,H=(XY+o) */ +OP(xycb,95) { _L = RES(2, RM(EA) ); WM( EA,_L ); } /* RES 2,L=(XY+o) */ +OP(xycb,96) { WM( EA, RES(2,RM(EA)) ); } /* RES 2,(XY+o) */ +OP(xycb,97) { _A = RES(2, RM(EA) ); WM( EA,_A ); } /* RES 2,A=(XY+o) */ + +OP(xycb,98) { _B = RES(3, RM(EA) ); WM( EA,_B ); } /* RES 3,B=(XY+o) */ +OP(xycb,99) { _C = RES(3, RM(EA) ); WM( EA,_C ); } /* RES 3,C=(XY+o) */ +OP(xycb,9a) { _D = RES(3, RM(EA) ); WM( EA,_D ); } /* RES 3,D=(XY+o) */ +OP(xycb,9b) { _E = RES(3, RM(EA) ); WM( EA,_E ); } /* RES 3,E=(XY+o) */ +OP(xycb,9c) { _H = RES(3, RM(EA) ); WM( EA,_H ); } /* RES 3,H=(XY+o) */ +OP(xycb,9d) { _L = RES(3, RM(EA) ); WM( EA,_L ); } /* RES 3,L=(XY+o) */ +OP(xycb,9e) { WM( EA, RES(3,RM(EA)) ); } /* RES 3,(XY+o) */ +OP(xycb,9f) { _A = RES(3, RM(EA) ); WM( EA,_A ); } /* RES 3,A=(XY+o) */ + +OP(xycb,a0) { _B = RES(4, RM(EA) ); WM( EA,_B ); } /* RES 4,B=(XY+o) */ +OP(xycb,a1) { _C = RES(4, RM(EA) ); WM( EA,_C ); } /* RES 4,C=(XY+o) */ +OP(xycb,a2) { _D = RES(4, RM(EA) ); WM( EA,_D ); } /* RES 4,D=(XY+o) */ +OP(xycb,a3) { _E = RES(4, RM(EA) ); WM( EA,_E ); } /* RES 4,E=(XY+o) */ +OP(xycb,a4) { _H = RES(4, RM(EA) ); WM( EA,_H ); } /* RES 4,H=(XY+o) */ +OP(xycb,a5) { _L = RES(4, RM(EA) ); WM( EA,_L ); } /* RES 4,L=(XY+o) */ +OP(xycb,a6) { WM( EA, RES(4,RM(EA)) ); } /* RES 4,(XY+o) */ +OP(xycb,a7) { _A = RES(4, RM(EA) ); WM( EA,_A ); } /* RES 4,A=(XY+o) */ + +OP(xycb,a8) { _B = RES(5, RM(EA) ); WM( EA,_B ); } /* RES 5,B=(XY+o) */ +OP(xycb,a9) { _C = RES(5, RM(EA) ); WM( EA,_C ); } /* RES 5,C=(XY+o) */ +OP(xycb,aa) { _D = RES(5, RM(EA) ); WM( EA,_D ); } /* RES 5,D=(XY+o) */ +OP(xycb,ab) { _E = RES(5, RM(EA) ); WM( EA,_E ); } /* RES 5,E=(XY+o) */ +OP(xycb,ac) { _H = RES(5, RM(EA) ); WM( EA,_H ); } /* RES 5,H=(XY+o) */ +OP(xycb,ad) { _L = RES(5, RM(EA) ); WM( EA,_L ); } /* RES 5,L=(XY+o) */ +OP(xycb,ae) { WM( EA, RES(5,RM(EA)) ); } /* RES 5,(XY+o) */ +OP(xycb,af) { _A = RES(5, RM(EA) ); WM( EA,_A ); } /* RES 5,A=(XY+o) */ + +OP(xycb,b0) { _B = RES(6, RM(EA) ); WM( EA,_B ); } /* RES 6,B=(XY+o) */ +OP(xycb,b1) { _C = RES(6, RM(EA) ); WM( EA,_C ); } /* RES 6,C=(XY+o) */ +OP(xycb,b2) { _D = RES(6, RM(EA) ); WM( EA,_D ); } /* RES 6,D=(XY+o) */ +OP(xycb,b3) { _E = RES(6, RM(EA) ); WM( EA,_E ); } /* RES 6,E=(XY+o) */ +OP(xycb,b4) { _H = RES(6, RM(EA) ); WM( EA,_H ); } /* RES 6,H=(XY+o) */ +OP(xycb,b5) { _L = RES(6, RM(EA) ); WM( EA,_L ); } /* RES 6,L=(XY+o) */ +OP(xycb,b6) { WM( EA, RES(6,RM(EA)) ); } /* RES 6,(XY+o) */ +OP(xycb,b7) { _A = RES(6, RM(EA) ); WM( EA,_A ); } /* RES 6,A=(XY+o) */ + +OP(xycb,b8) { _B = RES(7, RM(EA) ); WM( EA,_B ); } /* RES 7,B=(XY+o) */ +OP(xycb,b9) { _C = RES(7, RM(EA) ); WM( EA,_C ); } /* RES 7,C=(XY+o) */ +OP(xycb,ba) { _D = RES(7, RM(EA) ); WM( EA,_D ); } /* RES 7,D=(XY+o) */ +OP(xycb,bb) { _E = RES(7, RM(EA) ); WM( EA,_E ); } /* RES 7,E=(XY+o) */ +OP(xycb,bc) { _H = RES(7, RM(EA) ); WM( EA,_H ); } /* RES 7,H=(XY+o) */ +OP(xycb,bd) { _L = RES(7, RM(EA) ); WM( EA,_L ); } /* RES 7,L=(XY+o) */ +OP(xycb,be) { WM( EA, RES(7,RM(EA)) ); } /* RES 7,(XY+o) */ +OP(xycb,bf) { _A = RES(7, RM(EA) ); WM( EA,_A ); } /* RES 7,A=(XY+o) */ + +OP(xycb,c0) { _B = SET(0, RM(EA) ); WM( EA,_B ); } /* SET 0,B=(XY+o) */ +OP(xycb,c1) { _C = SET(0, RM(EA) ); WM( EA,_C ); } /* SET 0,C=(XY+o) */ +OP(xycb,c2) { _D = SET(0, RM(EA) ); WM( EA,_D ); } /* SET 0,D=(XY+o) */ +OP(xycb,c3) { _E = SET(0, RM(EA) ); WM( EA,_E ); } /* SET 0,E=(XY+o) */ +OP(xycb,c4) { _H = SET(0, RM(EA) ); WM( EA,_H ); } /* SET 0,H=(XY+o) */ +OP(xycb,c5) { _L = SET(0, RM(EA) ); WM( EA,_L ); } /* SET 0,L=(XY+o) */ +OP(xycb,c6) { WM( EA, SET(0,RM(EA)) ); } /* SET 0,(XY+o) */ +OP(xycb,c7) { _A = SET(0, RM(EA) ); WM( EA,_A ); } /* SET 0,A=(XY+o) */ + +OP(xycb,c8) { _B = SET(1, RM(EA) ); WM( EA,_B ); } /* SET 1,B=(XY+o) */ +OP(xycb,c9) { _C = SET(1, RM(EA) ); WM( EA,_C ); } /* SET 1,C=(XY+o) */ +OP(xycb,ca) { _D = SET(1, RM(EA) ); WM( EA,_D ); } /* SET 1,D=(XY+o) */ +OP(xycb,cb) { _E = SET(1, RM(EA) ); WM( EA,_E ); } /* SET 1,E=(XY+o) */ +OP(xycb,cc) { _H = SET(1, RM(EA) ); WM( EA,_H ); } /* SET 1,H=(XY+o) */ +OP(xycb,cd) { _L = SET(1, RM(EA) ); WM( EA,_L ); } /* SET 1,L=(XY+o) */ +OP(xycb,ce) { WM( EA, SET(1,RM(EA)) ); } /* SET 1,(XY+o) */ +OP(xycb,cf) { _A = SET(1, RM(EA) ); WM( EA,_A ); } /* SET 1,A=(XY+o) */ + +OP(xycb,d0) { _B = SET(2, RM(EA) ); WM( EA,_B ); } /* SET 2,B=(XY+o) */ +OP(xycb,d1) { _C = SET(2, RM(EA) ); WM( EA,_C ); } /* SET 2,C=(XY+o) */ +OP(xycb,d2) { _D = SET(2, RM(EA) ); WM( EA,_D ); } /* SET 2,D=(XY+o) */ +OP(xycb,d3) { _E = SET(2, RM(EA) ); WM( EA,_E ); } /* SET 2,E=(XY+o) */ +OP(xycb,d4) { _H = SET(2, RM(EA) ); WM( EA,_H ); } /* SET 2,H=(XY+o) */ +OP(xycb,d5) { _L = SET(2, RM(EA) ); WM( EA,_L ); } /* SET 2,L=(XY+o) */ +OP(xycb,d6) { WM( EA, SET(2,RM(EA)) ); } /* SET 2,(XY+o) */ +OP(xycb,d7) { _A = SET(2, RM(EA) ); WM( EA,_A ); } /* SET 2,A=(XY+o) */ + +OP(xycb,d8) { _B = SET(3, RM(EA) ); WM( EA,_B ); } /* SET 3,B=(XY+o) */ +OP(xycb,d9) { _C = SET(3, RM(EA) ); WM( EA,_C ); } /* SET 3,C=(XY+o) */ +OP(xycb,da) { _D = SET(3, RM(EA) ); WM( EA,_D ); } /* SET 3,D=(XY+o) */ +OP(xycb,db) { _E = SET(3, RM(EA) ); WM( EA,_E ); } /* SET 3,E=(XY+o) */ +OP(xycb,dc) { _H = SET(3, RM(EA) ); WM( EA,_H ); } /* SET 3,H=(XY+o) */ +OP(xycb,dd) { _L = SET(3, RM(EA) ); WM( EA,_L ); } /* SET 3,L=(XY+o) */ +OP(xycb,de) { WM( EA, SET(3,RM(EA)) ); } /* SET 3,(XY+o) */ +OP(xycb,df) { _A = SET(3, RM(EA) ); WM( EA,_A ); } /* SET 3,A=(XY+o) */ + +OP(xycb,e0) { _B = SET(4, RM(EA) ); WM( EA,_B ); } /* SET 4,B=(XY+o) */ +OP(xycb,e1) { _C = SET(4, RM(EA) ); WM( EA,_C ); } /* SET 4,C=(XY+o) */ +OP(xycb,e2) { _D = SET(4, RM(EA) ); WM( EA,_D ); } /* SET 4,D=(XY+o) */ +OP(xycb,e3) { _E = SET(4, RM(EA) ); WM( EA,_E ); } /* SET 4,E=(XY+o) */ +OP(xycb,e4) { _H = SET(4, RM(EA) ); WM( EA,_H ); } /* SET 4,H=(XY+o) */ +OP(xycb,e5) { _L = SET(4, RM(EA) ); WM( EA,_L ); } /* SET 4,L=(XY+o) */ +OP(xycb,e6) { WM( EA, SET(4,RM(EA)) ); } /* SET 4,(XY+o) */ +OP(xycb,e7) { _A = SET(4, RM(EA) ); WM( EA,_A ); } /* SET 4,A=(XY+o) */ + +OP(xycb,e8) { _B = SET(5, RM(EA) ); WM( EA,_B ); } /* SET 5,B=(XY+o) */ +OP(xycb,e9) { _C = SET(5, RM(EA) ); WM( EA,_C ); } /* SET 5,C=(XY+o) */ +OP(xycb,ea) { _D = SET(5, RM(EA) ); WM( EA,_D ); } /* SET 5,D=(XY+o) */ +OP(xycb,eb) { _E = SET(5, RM(EA) ); WM( EA,_E ); } /* SET 5,E=(XY+o) */ +OP(xycb,ec) { _H = SET(5, RM(EA) ); WM( EA,_H ); } /* SET 5,H=(XY+o) */ +OP(xycb,ed) { _L = SET(5, RM(EA) ); WM( EA,_L ); } /* SET 5,L=(XY+o) */ +OP(xycb,ee) { WM( EA, SET(5,RM(EA)) ); } /* SET 5,(XY+o) */ +OP(xycb,ef) { _A = SET(5, RM(EA) ); WM( EA,_A ); } /* SET 5,A=(XY+o) */ + +OP(xycb,f0) { _B = SET(6, RM(EA) ); WM( EA,_B ); } /* SET 6,B=(XY+o) */ +OP(xycb,f1) { _C = SET(6, RM(EA) ); WM( EA,_C ); } /* SET 6,C=(XY+o) */ +OP(xycb,f2) { _D = SET(6, RM(EA) ); WM( EA,_D ); } /* SET 6,D=(XY+o) */ +OP(xycb,f3) { _E = SET(6, RM(EA) ); WM( EA,_E ); } /* SET 6,E=(XY+o) */ +OP(xycb,f4) { _H = SET(6, RM(EA) ); WM( EA,_H ); } /* SET 6,H=(XY+o) */ +OP(xycb,f5) { _L = SET(6, RM(EA) ); WM( EA,_L ); } /* SET 6,L=(XY+o) */ +OP(xycb,f6) { WM( EA, SET(6,RM(EA)) ); } /* SET 6,(XY+o) */ +OP(xycb,f7) { _A = SET(6, RM(EA) ); WM( EA,_A ); } /* SET 6,A=(XY+o) */ + +OP(xycb,f8) { _B = SET(7, RM(EA) ); WM( EA,_B ); } /* SET 7,B=(XY+o) */ +OP(xycb,f9) { _C = SET(7, RM(EA) ); WM( EA,_C ); } /* SET 7,C=(XY+o) */ +OP(xycb,fa) { _D = SET(7, RM(EA) ); WM( EA,_D ); } /* SET 7,D=(XY+o) */ +OP(xycb,fb) { _E = SET(7, RM(EA) ); WM( EA,_E ); } /* SET 7,E=(XY+o) */ +OP(xycb,fc) { _H = SET(7, RM(EA) ); WM( EA,_H ); } /* SET 7,H=(XY+o) */ +OP(xycb,fd) { _L = SET(7, RM(EA) ); WM( EA,_L ); } /* SET 7,L=(XY+o) */ +OP(xycb,fe) { WM( EA, SET(7,RM(EA)) ); } /* SET 7,(XY+o) */ +OP(xycb,ff) { _A = SET(7, RM(EA) ); WM( EA,_A ); } /* SET 7,A=(XY+o) */ + +OP(illegal,1) { +} + +/********************************************************** + * IX register related opcodes (DD prefix) + **********************************************************/ +OP(dd,00) { illegal_1(); op_00(); } /* DB DD */ +OP(dd,01) { illegal_1(); op_01(); } /* DB DD */ +OP(dd,02) { illegal_1(); op_02(); } /* DB DD */ +OP(dd,03) { illegal_1(); op_03(); } /* DB DD */ +OP(dd,04) { illegal_1(); op_04(); } /* DB DD */ +OP(dd,05) { illegal_1(); op_05(); } /* DB DD */ +OP(dd,06) { illegal_1(); op_06(); } /* DB DD */ +OP(dd,07) { illegal_1(); op_07(); } /* DB DD */ + +OP(dd,08) { illegal_1(); op_08(); } /* DB DD */ +OP(dd,09) { _R++; ADD16(IX,BC); } /* ADD IX,BC */ +OP(dd,0a) { illegal_1(); op_0a(); } /* DB DD */ +OP(dd,0b) { illegal_1(); op_0b(); } /* DB DD */ +OP(dd,0c) { illegal_1(); op_0c(); } /* DB DD */ +OP(dd,0d) { illegal_1(); op_0d(); } /* DB DD */ +OP(dd,0e) { illegal_1(); op_0e(); } /* DB DD */ +OP(dd,0f) { illegal_1(); op_0f(); } /* DB DD */ + +OP(dd,10) { illegal_1(); op_10(); } /* DB DD */ +OP(dd,11) { illegal_1(); op_11(); } /* DB DD */ +OP(dd,12) { illegal_1(); op_12(); } /* DB DD */ +OP(dd,13) { illegal_1(); op_13(); } /* DB DD */ +OP(dd,14) { illegal_1(); op_14(); } /* DB DD */ +OP(dd,15) { illegal_1(); op_15(); } /* DB DD */ +OP(dd,16) { illegal_1(); op_16(); } /* DB DD */ +OP(dd,17) { illegal_1(); op_17(); } /* DB DD */ + +OP(dd,18) { illegal_1(); op_18(); } /* DB DD */ +OP(dd,19) { _R++; ADD16(IX,DE); } /* ADD IX,DE */ +OP(dd,1a) { illegal_1(); op_1a(); } /* DB DD */ +OP(dd,1b) { illegal_1(); op_1b(); } /* DB DD */ +OP(dd,1c) { illegal_1(); op_1c(); } /* DB DD */ +OP(dd,1d) { illegal_1(); op_1d(); } /* DB DD */ +OP(dd,1e) { illegal_1(); op_1e(); } /* DB DD */ +OP(dd,1f) { illegal_1(); op_1f(); } /* DB DD */ + +OP(dd,20) { illegal_1(); op_20(); } /* DB DD */ +OP(dd,21) { _R++; _IX = ARG16(); } /* LD IX,w */ +OP(dd,22) { _R++; EA = ARG16(); WM16( EA, &Z80.IX ); } /* LD (w),IX */ +OP(dd,23) { _R++; _IX++; } /* INC IX */ +OP(dd,24) { _R++; _HX = INC(_HX); } /* INC HX */ +OP(dd,25) { _R++; _HX = DEC(_HX); } /* DEC HX */ +OP(dd,26) { _R++; _HX = ARG(); } /* LD HX,n */ +OP(dd,27) { illegal_1(); op_27(); } /* DB DD */ + +OP(dd,28) { illegal_1(); op_28(); } /* DB DD */ +OP(dd,29) { _R++; ADD16(IX,IX); } /* ADD IX,IX */ +OP(dd,2a) { _R++; EA = ARG16(); RM16( EA, &Z80.IX ); } /* LD IX,(w) */ +OP(dd,2b) { _R++; _IX--; } /* DEC IX */ +OP(dd,2c) { _R++; _LX = INC(_LX); } /* INC LX */ +OP(dd,2d) { _R++; _LX = DEC(_LX); } /* DEC LX */ +OP(dd,2e) { _R++; _LX = ARG(); } /* LD LX,n */ +OP(dd,2f) { illegal_1(); op_2f(); } /* DB DD */ + +OP(dd,30) { illegal_1(); op_30(); } /* DB DD */ +OP(dd,31) { illegal_1(); op_31(); } /* DB DD */ +OP(dd,32) { illegal_1(); op_32(); } /* DB DD */ +OP(dd,33) { illegal_1(); op_33(); } /* DB DD */ +OP(dd,34) { _R++; EAX; WM( EA, INC(RM(EA)) ); } /* INC (IX+o) */ +OP(dd,35) { _R++; EAX; WM( EA, DEC(RM(EA)) ); } /* DEC (IX+o) */ +OP(dd,36) { _R++; EAX; WM( EA, ARG() ); } /* LD (IX+o),n */ +OP(dd,37) { illegal_1(); op_37(); } /* DB DD */ + +OP(dd,38) { illegal_1(); op_38(); } /* DB DD */ +OP(dd,39) { _R++; ADD16(IX,SP); } /* ADD IX,SP */ +OP(dd,3a) { illegal_1(); op_3a(); } /* DB DD */ +OP(dd,3b) { illegal_1(); op_3b(); } /* DB DD */ +OP(dd,3c) { illegal_1(); op_3c(); } /* DB DD */ +OP(dd,3d) { illegal_1(); op_3d(); } /* DB DD */ +OP(dd,3e) { illegal_1(); op_3e(); } /* DB DD */ +OP(dd,3f) { illegal_1(); op_3f(); } /* DB DD */ + +OP(dd,40) { illegal_1(); op_40(); } /* DB DD */ +OP(dd,41) { illegal_1(); op_41(); } /* DB DD */ +OP(dd,42) { illegal_1(); op_42(); } /* DB DD */ +OP(dd,43) { illegal_1(); op_43(); } /* DB DD */ +OP(dd,44) { _R++; _B = _HX; } /* LD B,HX */ +OP(dd,45) { _R++; _B = _LX; } /* LD B,LX */ +OP(dd,46) { _R++; EAX; _B = RM(EA); } /* LD B,(IX+o) */ +OP(dd,47) { illegal_1(); op_47(); } /* DB DD */ + +OP(dd,48) { illegal_1(); op_48(); } /* DB DD */ +OP(dd,49) { illegal_1(); op_49(); } /* DB DD */ +OP(dd,4a) { illegal_1(); op_4a(); } /* DB DD */ +OP(dd,4b) { illegal_1(); op_4b(); } /* DB DD */ +OP(dd,4c) { _R++; _C = _HX; } /* LD C,HX */ +OP(dd,4d) { _R++; _C = _LX; } /* LD C,LX */ +OP(dd,4e) { _R++; EAX; _C = RM(EA); } /* LD C,(IX+o) */ +OP(dd,4f) { illegal_1(); op_4f(); } /* DB DD */ + +OP(dd,50) { illegal_1(); op_50(); } /* DB DD */ +OP(dd,51) { illegal_1(); op_51(); } /* DB DD */ +OP(dd,52) { illegal_1(); op_52(); } /* DB DD */ +OP(dd,53) { illegal_1(); op_53(); } /* DB DD */ +OP(dd,54) { _R++; _D = _HX; } /* LD D,HX */ +OP(dd,55) { _R++; _D = _LX; } /* LD D,LX */ +OP(dd,56) { _R++; EAX; _D = RM(EA); } /* LD D,(IX+o) */ +OP(dd,57) { illegal_1(); op_57(); } /* DB DD */ + +OP(dd,58) { illegal_1(); op_58(); } /* DB DD */ +OP(dd,59) { illegal_1(); op_59(); } /* DB DD */ +OP(dd,5a) { illegal_1(); op_5a(); } /* DB DD */ +OP(dd,5b) { illegal_1(); op_5b(); } /* DB DD */ +OP(dd,5c) { _R++; _E = _HX; } /* LD E,HX */ +OP(dd,5d) { _R++; _E = _LX; } /* LD E,LX */ +OP(dd,5e) { _R++; EAX; _E = RM(EA); } /* LD E,(IX+o) */ +OP(dd,5f) { illegal_1(); op_5f(); } /* DB DD */ + +OP(dd,60) { _R++; _HX = _B; } /* LD HX,B */ +OP(dd,61) { _R++; _HX = _C; } /* LD HX,C */ +OP(dd,62) { _R++; _HX = _D; } /* LD HX,D */ +OP(dd,63) { _R++; _HX = _E; } /* LD HX,E */ +OP(dd,64) { } /* LD HX,HX */ +OP(dd,65) { _R++; _HX = _LX; } /* LD HX,LX */ +OP(dd,66) { _R++; EAX; _H = RM(EA); } /* LD H,(IX+o) */ +OP(dd,67) { _R++; _HX = _A; } /* LD HX,A */ + +OP(dd,68) { _R++; _LX = _B; } /* LD LX,B */ +OP(dd,69) { _R++; _LX = _C; } /* LD LX,C */ +OP(dd,6a) { _R++; _LX = _D; } /* LD LX,D */ +OP(dd,6b) { _R++; _LX = _E; } /* LD LX,E */ +OP(dd,6c) { _R++; _LX = _HX; } /* LD LX,HX */ +OP(dd,6d) { } /* LD LX,LX */ +OP(dd,6e) { _R++; EAX; _L = RM(EA); } /* LD L,(IX+o) */ +OP(dd,6f) { _R++; _LX = _A; } /* LD LX,A */ + +OP(dd,70) { _R++; EAX; WM( EA, _B ); } /* LD (IX+o),B */ +OP(dd,71) { _R++; EAX; WM( EA, _C ); } /* LD (IX+o),C */ +OP(dd,72) { _R++; EAX; WM( EA, _D ); } /* LD (IX+o),D */ +OP(dd,73) { _R++; EAX; WM( EA, _E ); } /* LD (IX+o),E */ +OP(dd,74) { _R++; EAX; WM( EA, _H ); } /* LD (IX+o),H */ +OP(dd,75) { _R++; EAX; WM( EA, _L ); } /* LD (IX+o),L */ +OP(dd,76) { illegal_1(); op_76(); } /* DB DD */ +OP(dd,77) { _R++; EAX; WM( EA, _A ); } /* LD (IX+o),A */ + +OP(dd,78) { illegal_1(); op_78(); } /* DB DD */ +OP(dd,79) { illegal_1(); op_79(); } /* DB DD */ +OP(dd,7a) { illegal_1(); op_7a(); } /* DB DD */ +OP(dd,7b) { illegal_1(); op_7b(); } /* DB DD */ +OP(dd,7c) { _R++; _A = _HX; } /* LD A,HX */ +OP(dd,7d) { _R++; _A = _LX; } /* LD A,LX */ +OP(dd,7e) { _R++; EAX; _A = RM(EA); } /* LD A,(IX+o) */ +OP(dd,7f) { illegal_1(); op_7f(); } /* DB DD */ + +OP(dd,80) { illegal_1(); op_80(); } /* DB DD */ +OP(dd,81) { illegal_1(); op_81(); } /* DB DD */ +OP(dd,82) { illegal_1(); op_82(); } /* DB DD */ +OP(dd,83) { illegal_1(); op_83(); } /* DB DD */ +OP(dd,84) { _R++; ADD(_HX); } /* ADD A,HX */ +OP(dd,85) { _R++; ADD(_LX); } /* ADD A,LX */ +OP(dd,86) { _R++; EAX; ADD(RM(EA)); } /* ADD A,(IX+o) */ +OP(dd,87) { illegal_1(); op_87(); } /* DB DD */ + +OP(dd,88) { illegal_1(); op_88(); } /* DB DD */ +OP(dd,89) { illegal_1(); op_89(); } /* DB DD */ +OP(dd,8a) { illegal_1(); op_8a(); } /* DB DD */ +OP(dd,8b) { illegal_1(); op_8b(); } /* DB DD */ +OP(dd,8c) { _R++; ADC(_HX); } /* ADC A,HX */ +OP(dd,8d) { _R++; ADC(_LX); } /* ADC A,LX */ +OP(dd,8e) { _R++; EAX; ADC(RM(EA)); } /* ADC A,(IX+o) */ +OP(dd,8f) { illegal_1(); op_8f(); } /* DB DD */ + +OP(dd,90) { illegal_1(); op_90(); } /* DB DD */ +OP(dd,91) { illegal_1(); op_91(); } /* DB DD */ +OP(dd,92) { illegal_1(); op_92(); } /* DB DD */ +OP(dd,93) { illegal_1(); op_93(); } /* DB DD */ +OP(dd,94) { _R++; SUB(_HX); } /* SUB HX */ +OP(dd,95) { _R++; SUB(_LX); } /* SUB LX */ +OP(dd,96) { _R++; EAX; SUB(RM(EA)); } /* SUB (IX+o) */ +OP(dd,97) { illegal_1(); op_97(); } /* DB DD */ + +OP(dd,98) { illegal_1(); op_98(); } /* DB DD */ +OP(dd,99) { illegal_1(); op_99(); } /* DB DD */ +OP(dd,9a) { illegal_1(); op_9a(); } /* DB DD */ +OP(dd,9b) { illegal_1(); op_9b(); } /* DB DD */ +OP(dd,9c) { _R++; SBC(_HX); } /* SBC A,HX */ +OP(dd,9d) { _R++; SBC(_LX); } /* SBC A,LX */ +OP(dd,9e) { _R++; EAX; SBC(RM(EA)); } /* SBC A,(IX+o) */ +OP(dd,9f) { illegal_1(); op_9f(); } /* DB DD */ + +OP(dd,a0) { illegal_1(); op_a0(); } /* DB DD */ +OP(dd,a1) { illegal_1(); op_a1(); } /* DB DD */ +OP(dd,a2) { illegal_1(); op_a2(); } /* DB DD */ +OP(dd,a3) { illegal_1(); op_a3(); } /* DB DD */ +OP(dd,a4) { _R++; AND(_HX); } /* AND HX */ +OP(dd,a5) { _R++; AND(_LX); } /* AND LX */ +OP(dd,a6) { _R++; EAX; AND(RM(EA)); } /* AND (IX+o) */ +OP(dd,a7) { illegal_1(); op_a7(); } /* DB DD */ + +OP(dd,a8) { illegal_1(); op_a8(); } /* DB DD */ +OP(dd,a9) { illegal_1(); op_a9(); } /* DB DD */ +OP(dd,aa) { illegal_1(); op_aa(); } /* DB DD */ +OP(dd,ab) { illegal_1(); op_ab(); } /* DB DD */ +OP(dd,ac) { _R++; XOR(_HX); } /* XOR HX */ +OP(dd,ad) { _R++; XOR(_LX); } /* XOR LX */ +OP(dd,ae) { _R++; EAX; XOR(RM(EA)); } /* XOR (IX+o) */ +OP(dd,af) { illegal_1(); op_af(); } /* DB DD */ + +OP(dd,b0) { illegal_1(); op_b0(); } /* DB DD */ +OP(dd,b1) { illegal_1(); op_b1(); } /* DB DD */ +OP(dd,b2) { illegal_1(); op_b2(); } /* DB DD */ +OP(dd,b3) { illegal_1(); op_b3(); } /* DB DD */ +OP(dd,b4) { _R++; OR(_HX); } /* OR HX */ +OP(dd,b5) { _R++; OR(_LX); } /* OR LX */ +OP(dd,b6) { _R++; EAX; OR(RM(EA)); } /* OR (IX+o) */ +OP(dd,b7) { illegal_1(); op_b7(); } /* DB DD */ + +OP(dd,b8) { illegal_1(); op_b8(); } /* DB DD */ +OP(dd,b9) { illegal_1(); op_b9(); } /* DB DD */ +OP(dd,ba) { illegal_1(); op_ba(); } /* DB DD */ +OP(dd,bb) { illegal_1(); op_bb(); } /* DB DD */ +OP(dd,bc) { _R++; CP(_HX); } /* CP HX */ +OP(dd,bd) { _R++; CP(_LX); } /* CP LX */ +OP(dd,be) { _R++; EAX; CP(RM(EA)); } /* CP (IX+o) */ +OP(dd,bf) { illegal_1(); op_bf(); } /* DB DD */ + +OP(dd,c0) { illegal_1(); op_c0(); } /* DB DD */ +OP(dd,c1) { illegal_1(); op_c1(); } /* DB DD */ +OP(dd,c2) { illegal_1(); op_c2(); } /* DB DD */ +OP(dd,c3) { illegal_1(); op_c3(); } /* DB DD */ +OP(dd,c4) { illegal_1(); op_c4(); } /* DB DD */ +OP(dd,c5) { illegal_1(); op_c5(); } /* DB DD */ +OP(dd,c6) { illegal_1(); op_c6(); } /* DB DD */ +OP(dd,c7) { illegal_1(); op_c7(); } /* DB DD */ + +OP(dd,c8) { illegal_1(); op_c8(); } /* DB DD */ +OP(dd,c9) { illegal_1(); op_c9(); } /* DB DD */ +OP(dd,ca) { illegal_1(); op_ca(); } /* DB DD */ +OP(dd,cb) { _R++; EAX; EXEC(xycb,ARG()); } /* ** DD CB xx */ +OP(dd,cc) { illegal_1(); op_cc(); } /* DB DD */ +OP(dd,cd) { illegal_1(); op_cd(); } /* DB DD */ +OP(dd,ce) { illegal_1(); op_ce(); } /* DB DD */ +OP(dd,cf) { illegal_1(); op_cf(); } /* DB DD */ + +OP(dd,d0) { illegal_1(); op_d0(); } /* DB DD */ +OP(dd,d1) { illegal_1(); op_d1(); } /* DB DD */ +OP(dd,d2) { illegal_1(); op_d2(); } /* DB DD */ +OP(dd,d3) { illegal_1(); op_d3(); } /* DB DD */ +OP(dd,d4) { illegal_1(); op_d4(); } /* DB DD */ +OP(dd,d5) { illegal_1(); op_d5(); } /* DB DD */ +OP(dd,d6) { illegal_1(); op_d6(); } /* DB DD */ +OP(dd,d7) { illegal_1(); op_d7(); } /* DB DD */ + +OP(dd,d8) { illegal_1(); op_d8(); } /* DB DD */ +OP(dd,d9) { illegal_1(); op_d9(); } /* DB DD */ +OP(dd,da) { illegal_1(); op_da(); } /* DB DD */ +OP(dd,db) { illegal_1(); op_db(); } /* DB DD */ +OP(dd,dc) { illegal_1(); op_dc(); } /* DB DD */ +OP(dd,dd) { illegal_1(); op_dd(); } /* DB DD */ +OP(dd,de) { illegal_1(); op_de(); } /* DB DD */ +OP(dd,df) { illegal_1(); op_df(); } /* DB DD */ + +OP(dd,e0) { illegal_1(); op_e0(); } /* DB DD */ +OP(dd,e1) { _R++; POP(IX); } /* POP IX */ +OP(dd,e2) { illegal_1(); op_e2(); } /* DB DD */ +OP(dd,e3) { _R++; EXSP(IX); } /* EX (SP),IX */ +OP(dd,e4) { illegal_1(); op_e4(); } /* DB DD */ +OP(dd,e5) { _R++; PUSH( IX ); } /* PUSH IX */ +OP(dd,e6) { illegal_1(); op_e6(); } /* DB DD */ +OP(dd,e7) { illegal_1(); op_e7(); } /* DB DD */ + +OP(dd,e8) { illegal_1(); op_e8(); } /* DB DD */ +OP(dd,e9) { _R++; _PC = _IX; } /* JP (IX) */ +OP(dd,ea) { illegal_1(); op_ea(); } /* DB DD */ +OP(dd,eb) { illegal_1(); op_eb(); } /* DB DD */ +OP(dd,ec) { illegal_1(); op_ec(); } /* DB DD */ +OP(dd,ed) { illegal_1(); op_ed(); } /* DB DD */ +OP(dd,ee) { illegal_1(); op_ee(); } /* DB DD */ +OP(dd,ef) { illegal_1(); op_ef(); } /* DB DD */ + +OP(dd,f0) { illegal_1(); op_f0(); } /* DB DD */ +OP(dd,f1) { illegal_1(); op_f1(); } /* DB DD */ +OP(dd,f2) { illegal_1(); op_f2(); } /* DB DD */ +OP(dd,f3) { illegal_1(); op_f3(); } /* DB DD */ +OP(dd,f4) { illegal_1(); op_f4(); } /* DB DD */ +OP(dd,f5) { illegal_1(); op_f5(); } /* DB DD */ +OP(dd,f6) { illegal_1(); op_f6(); } /* DB DD */ +OP(dd,f7) { illegal_1(); op_f7(); } /* DB DD */ + +OP(dd,f8) { illegal_1(); op_f8(); } /* DB DD */ +OP(dd,f9) { _R++; _SP = _IX; } /* LD SP,IX */ +OP(dd,fa) { illegal_1(); op_fa(); } /* DB DD */ +OP(dd,fb) { illegal_1(); op_fb(); } /* DB DD */ +OP(dd,fc) { illegal_1(); op_fc(); } /* DB DD */ +OP(dd,fd) { illegal_1(); op_fd(); } /* DB DD */ +OP(dd,fe) { illegal_1(); op_fe(); } /* DB DD */ +OP(dd,ff) { illegal_1(); op_ff(); } /* DB DD */ + +/********************************************************** + * IY register related opcodes (FD prefix) + **********************************************************/ +OP(fd,00) { illegal_1(); op_00(); } /* DB FD */ +OP(fd,01) { illegal_1(); op_01(); } /* DB FD */ +OP(fd,02) { illegal_1(); op_02(); } /* DB FD */ +OP(fd,03) { illegal_1(); op_03(); } /* DB FD */ +OP(fd,04) { illegal_1(); op_04(); } /* DB FD */ +OP(fd,05) { illegal_1(); op_05(); } /* DB FD */ +OP(fd,06) { illegal_1(); op_06(); } /* DB FD */ +OP(fd,07) { illegal_1(); op_07(); } /* DB FD */ + +OP(fd,08) { illegal_1(); op_08(); } /* DB FD */ +OP(fd,09) { _R++; ADD16(IY,BC); } /* ADD IY,BC */ +OP(fd,0a) { illegal_1(); op_0a(); } /* DB FD */ +OP(fd,0b) { illegal_1(); op_0b(); } /* DB FD */ +OP(fd,0c) { illegal_1(); op_0c(); } /* DB FD */ +OP(fd,0d) { illegal_1(); op_0d(); } /* DB FD */ +OP(fd,0e) { illegal_1(); op_0e(); } /* DB FD */ +OP(fd,0f) { illegal_1(); op_0f(); } /* DB FD */ + +OP(fd,10) { illegal_1(); op_10(); } /* DB FD */ +OP(fd,11) { illegal_1(); op_11(); } /* DB FD */ +OP(fd,12) { illegal_1(); op_12(); } /* DB FD */ +OP(fd,13) { illegal_1(); op_13(); } /* DB FD */ +OP(fd,14) { illegal_1(); op_14(); } /* DB FD */ +OP(fd,15) { illegal_1(); op_15(); } /* DB FD */ +OP(fd,16) { illegal_1(); op_16(); } /* DB FD */ +OP(fd,17) { illegal_1(); op_17(); } /* DB FD */ + +OP(fd,18) { illegal_1(); op_18(); } /* DB FD */ +OP(fd,19) { _R++; ADD16(IY,DE); } /* ADD IY,DE */ +OP(fd,1a) { illegal_1(); op_1a(); } /* DB FD */ +OP(fd,1b) { illegal_1(); op_1b(); } /* DB FD */ +OP(fd,1c) { illegal_1(); op_1c(); } /* DB FD */ +OP(fd,1d) { illegal_1(); op_1d(); } /* DB FD */ +OP(fd,1e) { illegal_1(); op_1e(); } /* DB FD */ +OP(fd,1f) { illegal_1(); op_1f(); } /* DB FD */ + +OP(fd,20) { illegal_1(); op_20(); } /* DB FD */ +OP(fd,21) { _R++; _IY = ARG16(); } /* LD IY,w */ +OP(fd,22) { _R++; EA = ARG16(); WM16( EA, &Z80.IY ); } /* LD (w),IY */ +OP(fd,23) { _R++; _IY++; } /* INC IY */ +OP(fd,24) { _R++; _HY = INC(_HY); } /* INC HY */ +OP(fd,25) { _R++; _HY = DEC(_HY); } /* DEC HY */ +OP(fd,26) { _R++; _HY = ARG(); } /* LD HY,n */ +OP(fd,27) { illegal_1(); op_27(); } /* DB FD */ + +OP(fd,28) { illegal_1(); op_28(); } /* DB FD */ +OP(fd,29) { _R++; ADD16(IY,IY); } /* ADD IY,IY */ +OP(fd,2a) { _R++; EA = ARG16(); RM16( EA, &Z80.IY ); } /* LD IY,(w) */ +OP(fd,2b) { _R++; _IY--; } /* DEC IY */ +OP(fd,2c) { _R++; _LY = INC(_LY); } /* INC LY */ +OP(fd,2d) { _R++; _LY = DEC(_LY); } /* DEC LY */ +OP(fd,2e) { _R++; _LY = ARG(); } /* LD LY,n */ +OP(fd,2f) { illegal_1(); op_2f(); } /* DB FD */ + +OP(fd,30) { illegal_1(); op_30(); } /* DB FD */ +OP(fd,31) { illegal_1(); op_31(); } /* DB FD */ +OP(fd,32) { illegal_1(); op_32(); } /* DB FD */ +OP(fd,33) { illegal_1(); op_33(); } /* DB FD */ +OP(fd,34) { _R++; EAY; WM( EA, INC(RM(EA)) ); } /* INC (IY+o) */ +OP(fd,35) { _R++; EAY; WM( EA, DEC(RM(EA)) ); } /* DEC (IY+o) */ +OP(fd,36) { _R++; EAY; WM( EA, ARG() ); } /* LD (IY+o),n */ +OP(fd,37) { illegal_1(); op_37(); } /* DB FD */ + +OP(fd,38) { illegal_1(); op_38(); } /* DB FD */ +OP(fd,39) { _R++; ADD16(IY,SP); } /* ADD IY,SP */ +OP(fd,3a) { illegal_1(); op_3a(); } /* DB FD */ +OP(fd,3b) { illegal_1(); op_3b(); } /* DB FD */ +OP(fd,3c) { illegal_1(); op_3c(); } /* DB FD */ +OP(fd,3d) { illegal_1(); op_3d(); } /* DB FD */ +OP(fd,3e) { illegal_1(); op_3e(); } /* DB FD */ +OP(fd,3f) { illegal_1(); op_3f(); } /* DB FD */ + +OP(fd,40) { illegal_1(); op_40(); } /* DB FD */ +OP(fd,41) { illegal_1(); op_41(); } /* DB FD */ +OP(fd,42) { illegal_1(); op_42(); } /* DB FD */ +OP(fd,43) { illegal_1(); op_43(); } /* DB FD */ +OP(fd,44) { _R++; _B = _HY; } /* LD B,HY */ +OP(fd,45) { _R++; _B = _LY; } /* LD B,LY */ +OP(fd,46) { _R++; EAY; _B = RM(EA); } /* LD B,(IY+o) */ +OP(fd,47) { illegal_1(); op_47(); } /* DB FD */ + +OP(fd,48) { illegal_1(); op_48(); } /* DB FD */ +OP(fd,49) { illegal_1(); op_49(); } /* DB FD */ +OP(fd,4a) { illegal_1(); op_4a(); } /* DB FD */ +OP(fd,4b) { illegal_1(); op_4b(); } /* DB FD */ +OP(fd,4c) { _R++; _C = _HY; } /* LD C,HY */ +OP(fd,4d) { _R++; _C = _LY; } /* LD C,LY */ +OP(fd,4e) { _R++; EAY; _C = RM(EA); } /* LD C,(IY+o) */ +OP(fd,4f) { illegal_1(); op_4f(); } /* DB FD */ + +OP(fd,50) { illegal_1(); op_50(); } /* DB FD */ +OP(fd,51) { illegal_1(); op_51(); } /* DB FD */ +OP(fd,52) { illegal_1(); op_52(); } /* DB FD */ +OP(fd,53) { illegal_1(); op_53(); } /* DB FD */ +OP(fd,54) { _R++; _D = _HY; } /* LD D,HY */ +OP(fd,55) { _R++; _D = _LY; } /* LD D,LY */ +OP(fd,56) { _R++; EAY; _D = RM(EA); } /* LD D,(IY+o) */ +OP(fd,57) { illegal_1(); op_57(); } /* DB FD */ + +OP(fd,58) { illegal_1(); op_58(); } /* DB FD */ +OP(fd,59) { illegal_1(); op_59(); } /* DB FD */ +OP(fd,5a) { illegal_1(); op_5a(); } /* DB FD */ +OP(fd,5b) { illegal_1(); op_5b(); } /* DB FD */ +OP(fd,5c) { _R++; _E = _HY; } /* LD E,HY */ +OP(fd,5d) { _R++; _E = _LY; } /* LD E,LY */ +OP(fd,5e) { _R++; EAY; _E = RM(EA); } /* LD E,(IY+o) */ +OP(fd,5f) { illegal_1(); op_5f(); } /* DB FD */ + +OP(fd,60) { _R++; _HY = _B; } /* LD HY,B */ +OP(fd,61) { _R++; _HY = _C; } /* LD HY,C */ +OP(fd,62) { _R++; _HY = _D; } /* LD HY,D */ +OP(fd,63) { _R++; _HY = _E; } /* LD HY,E */ +OP(fd,64) { _R++; } /* LD HY,HY */ +OP(fd,65) { _R++; _HY = _LY; } /* LD HY,LY */ +OP(fd,66) { _R++; EAY; _H = RM(EA); } /* LD H,(IY+o) */ +OP(fd,67) { _R++; _HY = _A; } /* LD HY,A */ + +OP(fd,68) { _R++; _LY = _B; } /* LD LY,B */ +OP(fd,69) { _R++; _LY = _C; } /* LD LY,C */ +OP(fd,6a) { _R++; _LY = _D; } /* LD LY,D */ +OP(fd,6b) { _R++; _LY = _E; } /* LD LY,E */ +OP(fd,6c) { _R++; _LY = _HY; } /* LD LY,HY */ +OP(fd,6d) { _R++; } /* LD LY,LY */ +OP(fd,6e) { _R++; EAY; _L = RM(EA); } /* LD L,(IY+o) */ +OP(fd,6f) { _R++; _LY = _A; } /* LD LY,A */ + +OP(fd,70) { _R++; EAY; WM( EA, _B ); } /* LD (IY+o),B */ +OP(fd,71) { _R++; EAY; WM( EA, _C ); } /* LD (IY+o),C */ +OP(fd,72) { _R++; EAY; WM( EA, _D ); } /* LD (IY+o),D */ +OP(fd,73) { _R++; EAY; WM( EA, _E ); } /* LD (IY+o),E */ +OP(fd,74) { _R++; EAY; WM( EA, _H ); } /* LD (IY+o),H */ +OP(fd,75) { _R++; EAY; WM( EA, _L ); } /* LD (IY+o),L */ +OP(fd,76) { illegal_1(); op_76(); } /* DB FD */ +OP(fd,77) { _R++; EAY; WM( EA, _A ); } /* LD (IY+o),A */ + +OP(fd,78) { illegal_1(); op_78(); } /* DB FD */ +OP(fd,79) { illegal_1(); op_79(); } /* DB FD */ +OP(fd,7a) { illegal_1(); op_7a(); } /* DB FD */ +OP(fd,7b) { illegal_1(); op_7b(); } /* DB FD */ +OP(fd,7c) { _R++; _A = _HY; } /* LD A,HY */ +OP(fd,7d) { _R++; _A = _LY; } /* LD A,LY */ +OP(fd,7e) { _R++; EAY; _A = RM(EA); } /* LD A,(IY+o) */ +OP(fd,7f) { illegal_1(); op_7f(); } /* DB FD */ + +OP(fd,80) { illegal_1(); op_80(); } /* DB FD */ +OP(fd,81) { illegal_1(); op_81(); } /* DB FD */ +OP(fd,82) { illegal_1(); op_82(); } /* DB FD */ +OP(fd,83) { illegal_1(); op_83(); } /* DB FD */ +OP(fd,84) { _R++; ADD(_HY); } /* ADD A,HY */ +OP(fd,85) { _R++; ADD(_LY); } /* ADD A,LY */ +OP(fd,86) { _R++; EAY; ADD(RM(EA)); } /* ADD A,(IY+o) */ +OP(fd,87) { illegal_1(); op_87(); } /* DB FD */ + +OP(fd,88) { illegal_1(); op_88(); } /* DB FD */ +OP(fd,89) { illegal_1(); op_89(); } /* DB FD */ +OP(fd,8a) { illegal_1(); op_8a(); } /* DB FD */ +OP(fd,8b) { illegal_1(); op_8b(); } /* DB FD */ +OP(fd,8c) { _R++; ADC(_HY); } /* ADC A,HY */ +OP(fd,8d) { _R++; ADC(_LY); } /* ADC A,LY */ +OP(fd,8e) { _R++; EAY; ADC(RM(EA)); } /* ADC A,(IY+o) */ +OP(fd,8f) { illegal_1(); op_8f(); } /* DB FD */ + +OP(fd,90) { illegal_1(); op_90(); } /* DB FD */ +OP(fd,91) { illegal_1(); op_91(); } /* DB FD */ +OP(fd,92) { illegal_1(); op_92(); } /* DB FD */ +OP(fd,93) { illegal_1(); op_93(); } /* DB FD */ +OP(fd,94) { _R++; SUB(_HY); } /* SUB HY */ +OP(fd,95) { _R++; SUB(_LY); } /* SUB LY */ +OP(fd,96) { _R++; EAY; SUB(RM(EA)); } /* SUB (IY+o) */ +OP(fd,97) { illegal_1(); op_97(); } /* DB FD */ + +OP(fd,98) { illegal_1(); op_98(); } /* DB FD */ +OP(fd,99) { illegal_1(); op_99(); } /* DB FD */ +OP(fd,9a) { illegal_1(); op_9a(); } /* DB FD */ +OP(fd,9b) { illegal_1(); op_9b(); } /* DB FD */ +OP(fd,9c) { _R++; SBC(_HY); } /* SBC A,HY */ +OP(fd,9d) { _R++; SBC(_LY); } /* SBC A,LY */ +OP(fd,9e) { _R++; EAY; SBC(RM(EA)); } /* SBC A,(IY+o) */ +OP(fd,9f) { illegal_1(); op_9f(); } /* DB FD */ + +OP(fd,a0) { illegal_1(); op_a0(); } /* DB FD */ +OP(fd,a1) { illegal_1(); op_a1(); } /* DB FD */ +OP(fd,a2) { illegal_1(); op_a2(); } /* DB FD */ +OP(fd,a3) { illegal_1(); op_a3(); } /* DB FD */ +OP(fd,a4) { _R++; AND(_HY); } /* AND HY */ +OP(fd,a5) { _R++; AND(_LY); } /* AND LY */ +OP(fd,a6) { _R++; EAY; AND(RM(EA)); } /* AND (IY+o) */ +OP(fd,a7) { illegal_1(); op_a7(); } /* DB FD */ + +OP(fd,a8) { illegal_1(); op_a8(); } /* DB FD */ +OP(fd,a9) { illegal_1(); op_a9(); } /* DB FD */ +OP(fd,aa) { illegal_1(); op_aa(); } /* DB FD */ +OP(fd,ab) { illegal_1(); op_ab(); } /* DB FD */ +OP(fd,ac) { _R++; XOR(_HY); } /* XOR HY */ +OP(fd,ad) { _R++; XOR(_LY); } /* XOR LY */ +OP(fd,ae) { _R++; EAY; XOR(RM(EA)); } /* XOR (IY+o) */ +OP(fd,af) { illegal_1(); op_af(); } /* DB FD */ + +OP(fd,b0) { illegal_1(); op_b0(); } /* DB FD */ +OP(fd,b1) { illegal_1(); op_b1(); } /* DB FD */ +OP(fd,b2) { illegal_1(); op_b2(); } /* DB FD */ +OP(fd,b3) { illegal_1(); op_b3(); } /* DB FD */ +OP(fd,b4) { _R++; OR(_HY); } /* OR HY */ +OP(fd,b5) { _R++; OR(_LY); } /* OR LY */ +OP(fd,b6) { _R++; EAY; OR(RM(EA)); } /* OR (IY+o) */ +OP(fd,b7) { illegal_1(); op_b7(); } /* DB FD */ + +OP(fd,b8) { illegal_1(); op_b8(); } /* DB FD */ +OP(fd,b9) { illegal_1(); op_b9(); } /* DB FD */ +OP(fd,ba) { illegal_1(); op_ba(); } /* DB FD */ +OP(fd,bb) { illegal_1(); op_bb(); } /* DB FD */ +OP(fd,bc) { _R++; CP(_HY); } /* CP HY */ +OP(fd,bd) { _R++; CP(_LY); } /* CP LY */ +OP(fd,be) { _R++; EAY; CP(RM(EA)); } /* CP (IY+o) */ +OP(fd,bf) { illegal_1(); op_bf(); } /* DB FD */ + +OP(fd,c0) { illegal_1(); op_c0(); } /* DB FD */ +OP(fd,c1) { illegal_1(); op_c1(); } /* DB FD */ +OP(fd,c2) { illegal_1(); op_c2(); } /* DB FD */ +OP(fd,c3) { illegal_1(); op_c3(); } /* DB FD */ +OP(fd,c4) { illegal_1(); op_c4(); } /* DB FD */ +OP(fd,c5) { illegal_1(); op_c5(); } /* DB FD */ +OP(fd,c6) { illegal_1(); op_c6(); } /* DB FD */ +OP(fd,c7) { illegal_1(); op_c7(); } /* DB FD */ + +OP(fd,c8) { illegal_1(); op_c8(); } /* DB FD */ +OP(fd,c9) { illegal_1(); op_c9(); } /* DB FD */ +OP(fd,ca) { illegal_1(); op_ca(); } /* DB FD */ +OP(fd,cb) { _R++; EAY; EXEC(xycb,ARG()); } /* ** FD CB xx */ +OP(fd,cc) { illegal_1(); op_cc(); } /* DB FD */ +OP(fd,cd) { illegal_1(); op_cd(); } /* DB FD */ +OP(fd,ce) { illegal_1(); op_ce(); } /* DB FD */ +OP(fd,cf) { illegal_1(); op_cf(); } /* DB FD */ + +OP(fd,d0) { illegal_1(); op_d0(); } /* DB FD */ +OP(fd,d1) { illegal_1(); op_d1(); } /* DB FD */ +OP(fd,d2) { illegal_1(); op_d2(); } /* DB FD */ +OP(fd,d3) { illegal_1(); op_d3(); } /* DB FD */ +OP(fd,d4) { illegal_1(); op_d4(); } /* DB FD */ +OP(fd,d5) { illegal_1(); op_d5(); } /* DB FD */ +OP(fd,d6) { illegal_1(); op_d6(); } /* DB FD */ +OP(fd,d7) { illegal_1(); op_d7(); } /* DB FD */ + +OP(fd,d8) { illegal_1(); op_d8(); } /* DB FD */ +OP(fd,d9) { illegal_1(); op_d9(); } /* DB FD */ +OP(fd,da) { illegal_1(); op_da(); } /* DB FD */ +OP(fd,db) { illegal_1(); op_db(); } /* DB FD */ +OP(fd,dc) { illegal_1(); op_dc(); } /* DB FD */ +OP(fd,dd) { illegal_1(); op_dd(); } /* DB FD */ +OP(fd,de) { illegal_1(); op_de(); } /* DB FD */ +OP(fd,df) { illegal_1(); op_df(); } /* DB FD */ + +OP(fd,e0) { illegal_1(); op_e0(); } /* DB FD */ +OP(fd,e1) { _R++; POP(IY); } /* POP IY */ +OP(fd,e2) { illegal_1(); op_e2(); } /* DB FD */ +OP(fd,e3) { _R++; EXSP(IY); } /* EX (SP),IY */ +OP(fd,e4) { illegal_1(); op_e4(); } /* DB FD */ +OP(fd,e5) { _R++; PUSH( IY ); } /* PUSH IY */ +OP(fd,e6) { illegal_1(); op_e6(); } /* DB FD */ +OP(fd,e7) { illegal_1(); op_e7(); } /* DB FD */ + +OP(fd,e8) { illegal_1(); op_e8(); } /* DB FD */ +OP(fd,e9) { _R++; _PC = _IY; } /* JP (IY) */ +OP(fd,ea) { illegal_1(); op_ea(); } /* DB FD */ +OP(fd,eb) { illegal_1(); op_eb(); } /* DB FD */ +OP(fd,ec) { illegal_1(); op_ec(); } /* DB FD */ +OP(fd,ed) { illegal_1(); op_ed(); } /* DB FD */ +OP(fd,ee) { illegal_1(); op_ee(); } /* DB FD */ +OP(fd,ef) { illegal_1(); op_ef(); } /* DB FD */ + +OP(fd,f0) { illegal_1(); op_f0(); } /* DB FD */ +OP(fd,f1) { illegal_1(); op_f1(); } /* DB FD */ +OP(fd,f2) { illegal_1(); op_f2(); } /* DB FD */ +OP(fd,f3) { illegal_1(); op_f3(); } /* DB FD */ +OP(fd,f4) { illegal_1(); op_f4(); } /* DB FD */ +OP(fd,f5) { illegal_1(); op_f5(); } /* DB FD */ +OP(fd,f6) { illegal_1(); op_f6(); } /* DB FD */ +OP(fd,f7) { illegal_1(); op_f7(); } /* DB FD */ + +OP(fd,f8) { illegal_1(); op_f8(); } /* DB FD */ +OP(fd,f9) { _R++; _SP = _IY; } /* LD SP,IY */ +OP(fd,fa) { illegal_1(); op_fa(); } /* DB FD */ +OP(fd,fb) { illegal_1(); op_fb(); } /* DB FD */ +OP(fd,fc) { illegal_1(); op_fc(); } /* DB FD */ +OP(fd,fd) { illegal_1(); op_fd(); } /* DB FD */ +OP(fd,fe) { illegal_1(); op_fe(); } /* DB FD */ +OP(fd,ff) { illegal_1(); op_ff(); } /* DB FD */ + +OP(illegal,2) +{ +} + +/********************************************************** + * special opcodes (ED prefix) + **********************************************************/ +OP(ed,00) { illegal_2(); } /* DB ED */ +OP(ed,01) { illegal_2(); } /* DB ED */ +OP(ed,02) { illegal_2(); } /* DB ED */ +OP(ed,03) { illegal_2(); } /* DB ED */ +OP(ed,04) { illegal_2(); } /* DB ED */ +OP(ed,05) { illegal_2(); } /* DB ED */ +OP(ed,06) { illegal_2(); } /* DB ED */ +OP(ed,07) { illegal_2(); } /* DB ED */ + +OP(ed,08) { illegal_2(); } /* DB ED */ +OP(ed,09) { illegal_2(); } /* DB ED */ +OP(ed,0a) { illegal_2(); } /* DB ED */ +OP(ed,0b) { illegal_2(); } /* DB ED */ +OP(ed,0c) { illegal_2(); } /* DB ED */ +OP(ed,0d) { illegal_2(); } /* DB ED */ +OP(ed,0e) { illegal_2(); } /* DB ED */ +OP(ed,0f) { illegal_2(); } /* DB ED */ + +OP(ed,10) { illegal_2(); } /* DB ED */ +OP(ed,11) { illegal_2(); } /* DB ED */ +OP(ed,12) { illegal_2(); } /* DB ED */ +OP(ed,13) { illegal_2(); } /* DB ED */ +OP(ed,14) { illegal_2(); } /* DB ED */ +OP(ed,15) { illegal_2(); } /* DB ED */ +OP(ed,16) { illegal_2(); } /* DB ED */ +OP(ed,17) { illegal_2(); } /* DB ED */ + +OP(ed,18) { illegal_2(); } /* DB ED */ +OP(ed,19) { illegal_2(); } /* DB ED */ +OP(ed,1a) { illegal_2(); } /* DB ED */ +OP(ed,1b) { illegal_2(); } /* DB ED */ +OP(ed,1c) { illegal_2(); } /* DB ED */ +OP(ed,1d) { illegal_2(); } /* DB ED */ +OP(ed,1e) { illegal_2(); } /* DB ED */ +OP(ed,1f) { illegal_2(); } /* DB ED */ + +OP(ed,20) { illegal_2(); } /* DB ED */ +OP(ed,21) { illegal_2(); } /* DB ED */ +OP(ed,22) { illegal_2(); } /* DB ED */ +OP(ed,23) { illegal_2(); } /* DB ED */ +OP(ed,24) { illegal_2(); } /* DB ED */ +OP(ed,25) { illegal_2(); } /* DB ED */ +OP(ed,26) { illegal_2(); } /* DB ED */ +OP(ed,27) { illegal_2(); } /* DB ED */ + +OP(ed,28) { illegal_2(); } /* DB ED */ +OP(ed,29) { illegal_2(); } /* DB ED */ +OP(ed,2a) { illegal_2(); } /* DB ED */ +OP(ed,2b) { illegal_2(); } /* DB ED */ +OP(ed,2c) { illegal_2(); } /* DB ED */ +OP(ed,2d) { illegal_2(); } /* DB ED */ +OP(ed,2e) { illegal_2(); } /* DB ED */ +OP(ed,2f) { illegal_2(); } /* DB ED */ + +OP(ed,30) { illegal_2(); } /* DB ED */ +OP(ed,31) { illegal_2(); } /* DB ED */ +OP(ed,32) { illegal_2(); } /* DB ED */ +OP(ed,33) { illegal_2(); } /* DB ED */ +OP(ed,34) { illegal_2(); } /* DB ED */ +OP(ed,35) { illegal_2(); } /* DB ED */ +OP(ed,36) { illegal_2(); } /* DB ED */ +OP(ed,37) { illegal_2(); } /* DB ED */ + +OP(ed,38) { illegal_2(); } /* DB ED */ +OP(ed,39) { illegal_2(); } /* DB ED */ +OP(ed,3a) { illegal_2(); } /* DB ED */ +OP(ed,3b) { illegal_2(); } /* DB ED */ +OP(ed,3c) { illegal_2(); } /* DB ED */ +OP(ed,3d) { illegal_2(); } /* DB ED */ +OP(ed,3e) { illegal_2(); } /* DB ED */ +OP(ed,3f) { illegal_2(); } /* DB ED */ + +OP(ed,40) { _B = IN(_BC); _F = (_F & CF) | SZP[_B]; } /* IN B,(C) */ +OP(ed,41) { OUT(_BC,_B); } /* OUT (C),B */ +OP(ed,42) { SBC16( BC ); } /* SBC HL,BC */ +OP(ed,43) { EA = ARG16(); WM16( EA, &Z80.BC ); } /* LD (w),BC */ +OP(ed,44) { NEG; } /* NEG */ +OP(ed,45) { RETN; } /* RETN; */ +OP(ed,46) { _IM = 0; } /* IM 0 */ +OP(ed,47) { LD_I_A; } /* LD I,A */ + +OP(ed,48) { _C = IN(_BC); _F = (_F & CF) | SZP[_C]; } /* IN C,(C) */ +OP(ed,49) { OUT(_BC,_C); } /* OUT (C),C */ +OP(ed,4a) { ADC16( BC ); } /* ADC HL,BC */ +OP(ed,4b) { EA = ARG16(); RM16( EA, &Z80.BC ); } /* LD BC,(w) */ +OP(ed,4c) { NEG; } /* NEG */ +OP(ed,4d) { RETI; } /* RETI */ +OP(ed,4e) { _IM = 0; } /* IM 0 */ +OP(ed,4f) { LD_R_A; } /* LD R,A */ + +OP(ed,50) { _D = IN(_BC); _F = (_F & CF) | SZP[_D]; } /* IN D,(C) */ +OP(ed,51) { OUT(_BC,_D); } /* OUT (C),D */ +OP(ed,52) { SBC16( DE ); } /* SBC HL,DE */ +OP(ed,53) { EA = ARG16(); WM16( EA, &Z80.DE ); } /* LD (w),DE */ +OP(ed,54) { NEG; } /* NEG */ +OP(ed,55) { RETN; } /* RETN; */ +OP(ed,56) { _IM = 1; } /* IM 1 */ +OP(ed,57) { LD_A_I; } /* LD A,I */ + +OP(ed,58) { _E = IN(_BC); _F = (_F & CF) | SZP[_E]; } /* IN E,(C) */ +OP(ed,59) { OUT(_BC,_E); } /* OUT (C),E */ +OP(ed,5a) { ADC16( DE ); } /* ADC HL,DE */ +OP(ed,5b) { EA = ARG16(); RM16( EA, &Z80.DE ); } /* LD DE,(w) */ +OP(ed,5c) { NEG; } /* NEG */ +OP(ed,5d) { RETI; } /* RETI */ +OP(ed,5e) { _IM = 2; } /* IM 2 */ +OP(ed,5f) { LD_A_R; } /* LD A,R */ + +OP(ed,60) { _H = IN(_BC); _F = (_F & CF) | SZP[_H]; } /* IN H,(C) */ +OP(ed,61) { OUT(_BC,_H); } /* OUT (C),H */ +OP(ed,62) { SBC16( HL ); } /* SBC HL,HL */ +OP(ed,63) { EA = ARG16(); WM16( EA, &Z80.HL ); } /* LD (w),HL */ +OP(ed,64) { NEG; } /* NEG */ +OP(ed,65) { RETN; } /* RETN; */ +OP(ed,66) { _IM = 0; } /* IM 0 */ +OP(ed,67) { RRD; } /* RRD (HL) */ + +OP(ed,68) { _L = IN(_BC); _F = (_F & CF) | SZP[_L]; } /* IN L,(C) */ +OP(ed,69) { OUT(_BC,_L); } /* OUT (C),L */ +OP(ed,6a) { ADC16( HL ); } /* ADC HL,HL */ +OP(ed,6b) { EA = ARG16(); RM16( EA, &Z80.HL ); } /* LD HL,(w) */ +OP(ed,6c) { NEG; } /* NEG */ +OP(ed,6d) { RETI; } /* RETI */ +OP(ed,6e) { _IM = 0; } /* IM 0 */ +OP(ed,6f) { RLD; } /* RLD (HL) */ + +OP(ed,70) { UINT8 res = IN(_BC); _F = (_F & CF) | SZP[res]; } /* IN 0,(C) */ +OP(ed,71) { OUT(_BC,0); } /* OUT (C),0 */ +OP(ed,72) { SBC16( SP ); } /* SBC HL,SP */ +OP(ed,73) { EA = ARG16(); WM16( EA, &Z80.SP ); } /* LD (w),SP */ +OP(ed,74) { NEG; } /* NEG */ +OP(ed,75) { RETN; } /* RETN; */ +OP(ed,76) { _IM = 1; } /* IM 1 */ +OP(ed,77) { illegal_2(); } /* DB ED,77 */ + +OP(ed,78) { _A = IN(_BC); _F = (_F & CF) | SZP[_A]; } /* IN E,(C) */ +OP(ed,79) { OUT(_BC,_A); } /* OUT (C),E */ +OP(ed,7a) { ADC16( SP ); } /* ADC HL,SP */ +OP(ed,7b) { EA = ARG16(); RM16( EA, &Z80.SP ); } /* LD SP,(w) */ +OP(ed,7c) { NEG; } /* NEG */ +OP(ed,7d) { RETI; } /* RETI */ +OP(ed,7e) { _IM = 2; } /* IM 2 */ +OP(ed,7f) { illegal_2(); } /* DB ED,7F */ + +OP(ed,80) { illegal_2(); } /* DB ED */ +OP(ed,81) { illegal_2(); } /* DB ED */ +OP(ed,82) { illegal_2(); } /* DB ED */ +OP(ed,83) { illegal_2(); } /* DB ED */ +OP(ed,84) { illegal_2(); } /* DB ED */ +OP(ed,85) { illegal_2(); } /* DB ED */ +OP(ed,86) { illegal_2(); } /* DB ED */ +OP(ed,87) { illegal_2(); } /* DB ED */ + +OP(ed,88) { illegal_2(); } /* DB ED */ +OP(ed,89) { illegal_2(); } /* DB ED */ +OP(ed,8a) { illegal_2(); } /* DB ED */ +OP(ed,8b) { illegal_2(); } /* DB ED */ +OP(ed,8c) { illegal_2(); } /* DB ED */ +OP(ed,8d) { illegal_2(); } /* DB ED */ +OP(ed,8e) { illegal_2(); } /* DB ED */ +OP(ed,8f) { illegal_2(); } /* DB ED */ + +OP(ed,90) { illegal_2(); } /* DB ED */ +OP(ed,91) { illegal_2(); } /* DB ED */ +OP(ed,92) { illegal_2(); } /* DB ED */ +OP(ed,93) { illegal_2(); } /* DB ED */ +OP(ed,94) { illegal_2(); } /* DB ED */ +OP(ed,95) { illegal_2(); } /* DB ED */ +OP(ed,96) { illegal_2(); } /* DB ED */ +OP(ed,97) { illegal_2(); } /* DB ED */ + +OP(ed,98) { illegal_2(); } /* DB ED */ +OP(ed,99) { illegal_2(); } /* DB ED */ +OP(ed,9a) { illegal_2(); } /* DB ED */ +OP(ed,9b) { illegal_2(); } /* DB ED */ +OP(ed,9c) { illegal_2(); } /* DB ED */ +OP(ed,9d) { illegal_2(); } /* DB ED */ +OP(ed,9e) { illegal_2(); } /* DB ED */ +OP(ed,9f) { illegal_2(); } /* DB ED */ + +OP(ed,a0) { LDI; } /* LDI */ +OP(ed,a1) { CPI; } /* CPI */ +OP(ed,a2) { INI; } /* INI */ +OP(ed,a3) { OUTI; } /* OUTI */ +OP(ed,a4) { illegal_2(); } /* DB ED */ +OP(ed,a5) { illegal_2(); } /* DB ED */ +OP(ed,a6) { illegal_2(); } /* DB ED */ +OP(ed,a7) { illegal_2(); } /* DB ED */ + +OP(ed,a8) { LDD; } /* LDD */ +OP(ed,a9) { CPD; } /* CPD */ +OP(ed,aa) { IND; } /* IND */ +OP(ed,ab) { OUTD; } /* OUTD */ +OP(ed,ac) { illegal_2(); } /* DB ED */ +OP(ed,ad) { illegal_2(); } /* DB ED */ +OP(ed,ae) { illegal_2(); } /* DB ED */ +OP(ed,af) { illegal_2(); } /* DB ED */ + +OP(ed,b0) { LDIR; } /* LDIR */ +OP(ed,b1) { CPIR; } /* CPIR */ +OP(ed,b2) { INIR; } /* INIR */ +OP(ed,b3) { OTIR; } /* OTIR */ +OP(ed,b4) { illegal_2(); } /* DB ED */ +OP(ed,b5) { illegal_2(); } /* DB ED */ +OP(ed,b6) { illegal_2(); } /* DB ED */ +OP(ed,b7) { illegal_2(); } /* DB ED */ + +OP(ed,b8) { LDDR; } /* LDDR */ +OP(ed,b9) { CPDR; } /* CPDR */ +OP(ed,ba) { INDR; } /* INDR */ +OP(ed,bb) { OTDR; } /* OTDR */ +OP(ed,bc) { illegal_2(); } /* DB ED */ +OP(ed,bd) { illegal_2(); } /* DB ED */ +OP(ed,be) { illegal_2(); } /* DB ED */ +OP(ed,bf) { illegal_2(); } /* DB ED */ + +OP(ed,c0) { illegal_2(); } /* DB ED */ +OP(ed,c1) { illegal_2(); } /* DB ED */ +OP(ed,c2) { illegal_2(); } /* DB ED */ +OP(ed,c3) { illegal_2(); } /* DB ED */ +OP(ed,c4) { illegal_2(); } /* DB ED */ +OP(ed,c5) { illegal_2(); } /* DB ED */ +OP(ed,c6) { illegal_2(); } /* DB ED */ +OP(ed,c7) { illegal_2(); } /* DB ED */ + +OP(ed,c8) { illegal_2(); } /* DB ED */ +OP(ed,c9) { illegal_2(); } /* DB ED */ +OP(ed,ca) { illegal_2(); } /* DB ED */ +OP(ed,cb) { illegal_2(); } /* DB ED */ +OP(ed,cc) { illegal_2(); } /* DB ED */ +OP(ed,cd) { illegal_2(); } /* DB ED */ +OP(ed,ce) { illegal_2(); } /* DB ED */ +OP(ed,cf) { illegal_2(); } /* DB ED */ + +OP(ed,d0) { illegal_2(); } /* DB ED */ +OP(ed,d1) { illegal_2(); } /* DB ED */ +OP(ed,d2) { illegal_2(); } /* DB ED */ +OP(ed,d3) { illegal_2(); } /* DB ED */ +OP(ed,d4) { illegal_2(); } /* DB ED */ +OP(ed,d5) { illegal_2(); } /* DB ED */ +OP(ed,d6) { illegal_2(); } /* DB ED */ +OP(ed,d7) { illegal_2(); } /* DB ED */ + +OP(ed,d8) { illegal_2(); } /* DB ED */ +OP(ed,d9) { illegal_2(); } /* DB ED */ +OP(ed,da) { illegal_2(); } /* DB ED */ +OP(ed,db) { illegal_2(); } /* DB ED */ +OP(ed,dc) { illegal_2(); } /* DB ED */ +OP(ed,dd) { illegal_2(); } /* DB ED */ +OP(ed,de) { illegal_2(); } /* DB ED */ +OP(ed,df) { illegal_2(); } /* DB ED */ + +OP(ed,e0) { illegal_2(); } /* DB ED */ +OP(ed,e1) { illegal_2(); } /* DB ED */ +OP(ed,e2) { illegal_2(); } /* DB ED */ +OP(ed,e3) { illegal_2(); } /* DB ED */ +OP(ed,e4) { illegal_2(); } /* DB ED */ +OP(ed,e5) { illegal_2(); } /* DB ED */ +OP(ed,e6) { illegal_2(); } /* DB ED */ +OP(ed,e7) { illegal_2(); } /* DB ED */ + +OP(ed,e8) { illegal_2(); } /* DB ED */ +OP(ed,e9) { illegal_2(); } /* DB ED */ +OP(ed,ea) { illegal_2(); } /* DB ED */ +OP(ed,eb) { illegal_2(); } /* DB ED */ +OP(ed,ec) { illegal_2(); } /* DB ED */ +OP(ed,ed) { illegal_2(); } /* DB ED */ +OP(ed,ee) { illegal_2(); } /* DB ED */ +OP(ed,ef) { illegal_2(); } /* DB ED */ + +OP(ed,f0) { illegal_2(); } /* DB ED */ +OP(ed,f1) { illegal_2(); } /* DB ED */ +OP(ed,f2) { illegal_2(); } /* DB ED */ +OP(ed,f3) { illegal_2(); } /* DB ED */ +OP(ed,f4) { illegal_2(); } /* DB ED */ +OP(ed,f5) { illegal_2(); } /* DB ED */ +OP(ed,f6) { illegal_2(); } /* DB ED */ +OP(ed,f7) { illegal_2(); } /* DB ED */ + +OP(ed,f8) { illegal_2(); } /* DB ED */ +OP(ed,f9) { illegal_2(); } /* DB ED */ +OP(ed,fa) { illegal_2(); } /* DB ED */ +OP(ed,fb) { illegal_2(); } /* DB ED */ +OP(ed,fc) { illegal_2(); } /* DB ED */ +OP(ed,fd) { illegal_2(); } /* DB ED */ +OP(ed,fe) { illegal_2(); } /* DB ED */ +OP(ed,ff) { illegal_2(); } /* DB ED */ + +#if TIME_LOOP_HACKS + +#define CHECK_BC_LOOP \ +if( _BC > 1 && _PCD < 0xfffc ) { \ + UINT8 op1 = cpu_readop(_PCD); \ + UINT8 op2 = cpu_readop(_PCD+1); \ + if( (op1==0x78 && op2==0xb1) || (op1==0x79 && op2==0xb0) ) \ + { \ + UINT8 op3 = cpu_readop(_PCD+2); \ + UINT8 op4 = cpu_readop(_PCD+3); \ + if( op3==0x20 && op4==0xfb ) \ + { \ + int cnt = \ + cc[Z80_TABLE_op][0x78] + \ + cc[Z80_TABLE_op][0xb1] + \ + cc[Z80_TABLE_op][0x20] + \ + cc[Z80_TABLE_ex][0x20]; \ + while( _BC > 0 && z80_ICount > cnt ) \ + { \ + BURNODD( cnt, 4, cnt ); \ + _BC--; \ + } \ + } \ + else \ + if( op3 == 0xc2 ) \ + { \ + UINT8 ad1 = cpu_readop_arg(_PCD+3); \ + UINT8 ad2 = cpu_readop_arg(_PCD+4); \ + if( (ad1 + 256 * ad2) == (_PCD - 1) ) \ + { \ + int cnt = \ + cc[Z80_TABLE_op][0x78] + \ + cc[Z80_TABLE_op][0xb1] + \ + cc[Z80_TABLE_op][0xc2] + \ + cc[Z80_TABLE_ex][0xc2]; \ + while( _BC > 0 && z80_ICount > cnt ) \ + { \ + BURNODD( cnt, 4, cnt ); \ + _BC--; \ + } \ + } \ + } \ + } \ +} + +#define CHECK_DE_LOOP \ +if( _DE > 1 && _PCD < 0xfffc ) { \ + UINT8 op1 = cpu_readop(_PCD); \ + UINT8 op2 = cpu_readop(_PCD+1); \ + if( (op1==0x7a && op2==0xb3) || (op1==0x7b && op2==0xb2) ) \ + { \ + UINT8 op3 = cpu_readop(_PCD+2); \ + UINT8 op4 = cpu_readop(_PCD+3); \ + if( op3==0x20 && op4==0xfb ) \ + { \ + int cnt = \ + cc[Z80_TABLE_op][0x7a] + \ + cc[Z80_TABLE_op][0xb3] + \ + cc[Z80_TABLE_op][0x20] + \ + cc[Z80_TABLE_ex][0x20]; \ + while( _DE > 0 && z80_ICount > cnt ) \ + { \ + BURNODD( cnt, 4, cnt ); \ + _DE--; \ + } \ + } \ + else \ + if( op3==0xc2 ) \ + { \ + UINT8 ad1 = cpu_readop_arg(_PCD+3); \ + UINT8 ad2 = cpu_readop_arg(_PCD+4); \ + if( (ad1 + 256 * ad2) == (_PCD - 1) ) \ + { \ + int cnt = \ + cc[Z80_TABLE_op][0x7a] + \ + cc[Z80_TABLE_op][0xb3] + \ + cc[Z80_TABLE_op][0xc2] + \ + cc[Z80_TABLE_ex][0xc2]; \ + while( _DE > 0 && z80_ICount > cnt ) \ + { \ + BURNODD( cnt, 4, cnt ); \ + _DE--; \ + } \ + } \ + } \ + } \ +} + +#define CHECK_HL_LOOP \ +if( _HL > 1 && _PCD < 0xfffc ) { \ + UINT8 op1 = cpu_readop(_PCD); \ + UINT8 op2 = cpu_readop(_PCD+1); \ + if( (op1==0x7c && op2==0xb5) || (op1==0x7d && op2==0xb4) ) \ + { \ + UINT8 op3 = cpu_readop(_PCD+2); \ + UINT8 op4 = cpu_readop(_PCD+3); \ + if( op3==0x20 && op4==0xfb ) \ + { \ + int cnt = \ + cc[Z80_TABLE_op][0x7c] + \ + cc[Z80_TABLE_op][0xb5] + \ + cc[Z80_TABLE_op][0x20] + \ + cc[Z80_TABLE_ex][0x20]; \ + while( _HL > 0 && z80_ICount > cnt ) \ + { \ + BURNODD( cnt, 4, cnt ); \ + _HL--; \ + } \ + } \ + else \ + if( op3==0xc2 ) \ + { \ + UINT8 ad1 = cpu_readop_arg(_PCD+3); \ + UINT8 ad2 = cpu_readop_arg(_PCD+4); \ + if( (ad1 + 256 * ad2) == (_PCD - 1) ) \ + { \ + int cnt = \ + cc[Z80_TABLE_op][0x7c] + \ + cc[Z80_TABLE_op][0xb5] + \ + cc[Z80_TABLE_op][0xc2] + \ + cc[Z80_TABLE_ex][0xc2]; \ + while( _HL > 0 && z80_ICount > cnt ) \ + { \ + BURNODD( cnt, 4, cnt ); \ + _HL--; \ + } \ + } \ + } \ + } \ +} + +#else + +#define CHECK_BC_LOOP +#define CHECK_DE_LOOP +#define CHECK_HL_LOOP + +#endif + +/********************************************************** + * main opcodes + **********************************************************/ +OP(op,00) { } /* NOP */ +OP(op,01) { _BC = ARG16(); } /* LD BC,w */ +OP(op,02) { WM( _BC, _A ); } /* LD (BC),A */ +OP(op,03) { _BC++; } /* INC BC */ +OP(op,04) { _B = INC(_B); } /* INC B */ +OP(op,05) { _B = DEC(_B); } /* DEC B */ +OP(op,06) { _B = ARG(); } /* LD B,n */ +OP(op,07) { RLCA; } /* RLCA */ + +OP(op,08) { EX_AF; } /* EX AF,AF' */ +OP(op,09) { ADD16(HL,BC); } /* ADD HL,BC */ +OP(op,0a) { _A = RM(_BC); } /* LD A,(BC) */ +OP(op,0b) { _BC--; CHECK_BC_LOOP; } /* DEC BC */ +OP(op,0c) { _C = INC(_C); } /* INC C */ +OP(op,0d) { _C = DEC(_C); } /* DEC C */ +OP(op,0e) { _C = ARG(); } /* LD C,n */ +OP(op,0f) { RRCA; } /* RRCA */ + +OP(op,10) { _B--; JR_COND( _B, 0x10 ); } /* DJNZ o */ +OP(op,11) { _DE = ARG16(); } /* LD DE,w */ +OP(op,12) { WM( _DE, _A ); } /* LD (DE),A */ +OP(op,13) { _DE++; } /* INC DE */ +OP(op,14) { _D = INC(_D); } /* INC D */ +OP(op,15) { _D = DEC(_D); } /* DEC D */ +OP(op,16) { _D = ARG(); } /* LD D,n */ +OP(op,17) { RLA; } /* RLA */ + +OP(op,18) { JR(); } /* JR o */ +OP(op,19) { ADD16(HL,DE); } /* ADD HL,DE */ +OP(op,1a) { _A = RM(_DE); } /* LD A,(DE) */ +OP(op,1b) { _DE--; CHECK_DE_LOOP; } /* DEC DE */ +OP(op,1c) { _E = INC(_E); } /* INC E */ +OP(op,1d) { _E = DEC(_E); } /* DEC E */ +OP(op,1e) { _E = ARG(); } /* LD E,n */ +OP(op,1f) { RRA; } /* RRA */ + +OP(op,20) { JR_COND( !(_F & ZF), 0x20 ); } /* JR NZ,o */ +OP(op,21) { _HL = ARG16(); } /* LD HL,w */ +OP(op,22) { EA = ARG16(); WM16( EA, &Z80.HL ); } /* LD (w),HL */ +OP(op,23) { _HL++; } /* INC HL */ +OP(op,24) { _H = INC(_H); } /* INC H */ +OP(op,25) { _H = DEC(_H); } /* DEC H */ +OP(op,26) { _H = ARG(); } /* LD H,n */ +OP(op,27) { DAA; } /* DAA */ + +OP(op,28) { JR_COND( _F & ZF, 0x28 ); } /* JR Z,o */ +OP(op,29) { ADD16(HL,HL); } /* ADD HL,HL */ +OP(op,2a) { EA = ARG16(); RM16( EA, &Z80.HL ); } /* LD HL,(w) */ +OP(op,2b) { _HL--; CHECK_HL_LOOP; } /* DEC HL */ +OP(op,2c) { _L = INC(_L); } /* INC L */ +OP(op,2d) { _L = DEC(_L); } /* DEC L */ +OP(op,2e) { _L = ARG(); } /* LD L,n */ +OP(op,2f) { _A ^= 0xff; _F = (_F&(SF|ZF|PF|CF))|HF|NF|(_A&(YF|XF)); } /* CPL */ + +OP(op,30) { JR_COND( !(_F & CF), 0x30 ); } /* JR NC,o */ +OP(op,31) { _SP = ARG16(); } /* LD SP,w */ +OP(op,32) { EA = ARG16(); WM( EA, _A ); } /* LD (w),A */ +OP(op,33) { _SP++; } /* INC SP */ +OP(op,34) { WM( _HL, INC(RM(_HL)) ); } /* INC (HL) */ +OP(op,35) { WM( _HL, DEC(RM(_HL)) ); } /* DEC (HL) */ +OP(op,36) { WM( _HL, ARG() ); } /* LD (HL),n */ +OP(op,37) { _F = (_F & (SF|ZF|PF)) | CF | (_A & (YF|XF)); } /* SCF */ + +OP(op,38) { JR_COND( _F & CF, 0x38 ); } /* JR C,o */ +OP(op,39) { ADD16(HL,SP); } /* ADD HL,SP */ +OP(op,3a) { EA = ARG16(); _A = RM( EA ); } /* LD A,(w) */ +OP(op,3b) { _SP--; } /* DEC SP */ +OP(op,3c) { _A = INC(_A); } /* INC A */ +OP(op,3d) { _A = DEC(_A); } /* DEC A */ +OP(op,3e) { _A = ARG(); } /* LD A,n */ +OP(op,3f) { _F = ((_F&(SF|ZF|PF|CF))|((_F&CF)<<4)|(_A&(YF|XF)))^CF; } /* CCF */ +//OP(op,3f) { _F = ((_F & ~(HF|NF)) | ((_F & CF)<<4)) ^ CF; } /* CCF */ + +OP(op,40) { } /* LD B,B */ +OP(op,41) { _B = _C; } /* LD B,C */ +OP(op,42) { _B = _D; } /* LD B,D */ +OP(op,43) { _B = _E; } /* LD B,E */ +OP(op,44) { _B = _H; } /* LD B,H */ +OP(op,45) { _B = _L; } /* LD B,L */ +OP(op,46) { _B = RM(_HL); } /* LD B,(HL) */ +OP(op,47) { _B = _A; } /* LD B,A */ + +OP(op,48) { _C = _B; } /* LD C,B */ +OP(op,49) { } /* LD C,C */ +OP(op,4a) { _C = _D; } /* LD C,D */ +OP(op,4b) { _C = _E; } /* LD C,E */ +OP(op,4c) { _C = _H; } /* LD C,H */ +OP(op,4d) { _C = _L; } /* LD C,L */ +OP(op,4e) { _C = RM(_HL); } /* LD C,(HL) */ +OP(op,4f) { _C = _A; } /* LD C,A */ + +OP(op,50) { _D = _B; } /* LD D,B */ +OP(op,51) { _D = _C; } /* LD D,C */ +OP(op,52) { } /* LD D,D */ +OP(op,53) { _D = _E; } /* LD D,E */ +OP(op,54) { _D = _H; } /* LD D,H */ +OP(op,55) { _D = _L; } /* LD D,L */ +OP(op,56) { _D = RM(_HL); } /* LD D,(HL) */ +OP(op,57) { _D = _A; } /* LD D,A */ + +OP(op,58) { _E = _B; } /* LD E,B */ +OP(op,59) { _E = _C; } /* LD E,C */ +OP(op,5a) { _E = _D; } /* LD E,D */ +OP(op,5b) { } /* LD E,E */ +OP(op,5c) { _E = _H; } /* LD E,H */ +OP(op,5d) { _E = _L; } /* LD E,L */ +OP(op,5e) { _E = RM(_HL); } /* LD E,(HL) */ +OP(op,5f) { _E = _A; } /* LD E,A */ + +OP(op,60) { _H = _B; } /* LD H,B */ +OP(op,61) { _H = _C; } /* LD H,C */ +OP(op,62) { _H = _D; } /* LD H,D */ +OP(op,63) { _H = _E; } /* LD H,E */ +OP(op,64) { } /* LD H,H */ +OP(op,65) { _H = _L; } /* LD H,L */ +OP(op,66) { _H = RM(_HL); } /* LD H,(HL) */ +OP(op,67) { _H = _A; } /* LD H,A */ + +OP(op,68) { _L = _B; } /* LD L,B */ +OP(op,69) { _L = _C; } /* LD L,C */ +OP(op,6a) { _L = _D; } /* LD L,D */ +OP(op,6b) { _L = _E; } /* LD L,E */ +OP(op,6c) { _L = _H; } /* LD L,H */ +OP(op,6d) { } /* LD L,L */ +OP(op,6e) { _L = RM(_HL); } /* LD L,(HL) */ +OP(op,6f) { _L = _A; } /* LD L,A */ + +OP(op,70) { WM( _HL, _B ); } /* LD (HL),B */ +OP(op,71) { WM( _HL, _C ); } /* LD (HL),C */ +OP(op,72) { WM( _HL, _D ); } /* LD (HL),D */ +OP(op,73) { WM( _HL, _E ); } /* LD (HL),E */ +OP(op,74) { WM( _HL, _H ); } /* LD (HL),H */ +OP(op,75) { WM( _HL, _L ); } /* LD (HL),L */ +OP(op,76) { ENTER_HALT; } /* HALT */ +OP(op,77) { WM( _HL, _A ); } /* LD (HL),A */ + +OP(op,78) { _A = _B; } /* LD A,B */ +OP(op,79) { _A = _C; } /* LD A,C */ +OP(op,7a) { _A = _D; } /* LD A,D */ +OP(op,7b) { _A = _E; } /* LD A,E */ +OP(op,7c) { _A = _H; } /* LD A,H */ +OP(op,7d) { _A = _L; } /* LD A,L */ +OP(op,7e) { _A = RM(_HL); } /* LD A,(HL) */ +OP(op,7f) { } /* LD A,A */ + +OP(op,80) { ADD(_B); } /* ADD A,B */ +OP(op,81) { ADD(_C); } /* ADD A,C */ +OP(op,82) { ADD(_D); } /* ADD A,D */ +OP(op,83) { ADD(_E); } /* ADD A,E */ +OP(op,84) { ADD(_H); } /* ADD A,H */ +OP(op,85) { ADD(_L); } /* ADD A,L */ +OP(op,86) { ADD(RM(_HL)); } /* ADD A,(HL) */ +OP(op,87) { ADD(_A); } /* ADD A,A */ + +OP(op,88) { ADC(_B); } /* ADC A,B */ +OP(op,89) { ADC(_C); } /* ADC A,C */ +OP(op,8a) { ADC(_D); } /* ADC A,D */ +OP(op,8b) { ADC(_E); } /* ADC A,E */ +OP(op,8c) { ADC(_H); } /* ADC A,H */ +OP(op,8d) { ADC(_L); } /* ADC A,L */ +OP(op,8e) { ADC(RM(_HL)); } /* ADC A,(HL) */ +OP(op,8f) { ADC(_A); } /* ADC A,A */ + +OP(op,90) { SUB(_B); } /* SUB B */ +OP(op,91) { SUB(_C); } /* SUB C */ +OP(op,92) { SUB(_D); } /* SUB D */ +OP(op,93) { SUB(_E); } /* SUB E */ +OP(op,94) { SUB(_H); } /* SUB H */ +OP(op,95) { SUB(_L); } /* SUB L */ +OP(op,96) { SUB(RM(_HL)); } /* SUB (HL) */ +OP(op,97) { SUB(_A); } /* SUB A */ + +OP(op,98) { SBC(_B); } /* SBC A,B */ +OP(op,99) { SBC(_C); } /* SBC A,C */ +OP(op,9a) { SBC(_D); } /* SBC A,D */ +OP(op,9b) { SBC(_E); } /* SBC A,E */ +OP(op,9c) { SBC(_H); } /* SBC A,H */ +OP(op,9d) { SBC(_L); } /* SBC A,L */ +OP(op,9e) { SBC(RM(_HL)); } /* SBC A,(HL) */ +OP(op,9f) { SBC(_A); } /* SBC A,A */ + +OP(op,a0) { AND(_B); } /* AND B */ +OP(op,a1) { AND(_C); } /* AND C */ +OP(op,a2) { AND(_D); } /* AND D */ +OP(op,a3) { AND(_E); } /* AND E */ +OP(op,a4) { AND(_H); } /* AND H */ +OP(op,a5) { AND(_L); } /* AND L */ +OP(op,a6) { AND(RM(_HL)); } /* AND (HL) */ +OP(op,a7) { AND(_A); } /* AND A */ + +OP(op,a8) { XOR(_B); } /* XOR B */ +OP(op,a9) { XOR(_C); } /* XOR C */ +OP(op,aa) { XOR(_D); } /* XOR D */ +OP(op,ab) { XOR(_E); } /* XOR E */ +OP(op,ac) { XOR(_H); } /* XOR H */ +OP(op,ad) { XOR(_L); } /* XOR L */ +OP(op,ae) { XOR(RM(_HL)); } /* XOR (HL) */ +OP(op,af) { XOR(_A); } /* XOR A */ + +OP(op,b0) { OR(_B); } /* OR B */ +OP(op,b1) { OR(_C); } /* OR C */ +OP(op,b2) { OR(_D); } /* OR D */ +OP(op,b3) { OR(_E); } /* OR E */ +OP(op,b4) { OR(_H); } /* OR H */ +OP(op,b5) { OR(_L); } /* OR L */ +OP(op,b6) { OR(RM(_HL)); } /* OR (HL) */ +OP(op,b7) { OR(_A); } /* OR A */ + +OP(op,b8) { CP(_B); } /* CP B */ +OP(op,b9) { CP(_C); } /* CP C */ +OP(op,ba) { CP(_D); } /* CP D */ +OP(op,bb) { CP(_E); } /* CP E */ +OP(op,bc) { CP(_H); } /* CP H */ +OP(op,bd) { CP(_L); } /* CP L */ +OP(op,be) { CP(RM(_HL)); } /* CP (HL) */ +OP(op,bf) { CP(_A); } /* CP A */ + +OP(op,c0) { RET_COND( !(_F & ZF), 0xc0 ); } /* RET NZ */ +OP(op,c1) { POP(BC); } /* POP BC */ +OP(op,c2) { JP_COND( !(_F & ZF) ); } /* JP NZ,a */ +OP(op,c3) { JP; } /* JP a */ +OP(op,c4) { CALL_COND( !(_F & ZF), 0xc4 ); } /* CALL NZ,a */ +OP(op,c5) { PUSH( BC ); } /* PUSH BC */ +OP(op,c6) { ADD(ARG()); } /* ADD A,n */ +OP(op,c7) { RST(0x00); } /* RST 0 */ + +OP(op,c8) { RET_COND( _F & ZF, 0xc8 ); } /* RET Z */ +OP(op,c9) { POP(PC); } /* RET */ +OP(op,ca) { JP_COND( _F & ZF ); } /* JP Z,a */ +OP(op,cb) { _R++; EXEC(cb,ROP()); } /* **** CB xx */ +OP(op,cc) { CALL_COND( _F & ZF, 0xcc ); } /* CALL Z,a */ +OP(op,cd) { CALL(); } /* CALL a */ +OP(op,ce) { ADC(ARG()); } /* ADC A,n */ +OP(op,cf) { RST(0x08); } /* RST 1 */ + +OP(op,d0) { RET_COND( !(_F & CF), 0xd0 ); } /* RET NC */ +OP(op,d1) { POP(DE); } /* POP DE */ +OP(op,d2) { JP_COND( !(_F & CF) ); } /* JP NC,a */ +OP(op,d3) { unsigned n = ARG() | (_A << 8); OUT( n, _A ); } /* OUT (n),A */ +OP(op,d4) { CALL_COND( !(_F & CF), 0xd4 ); } /* CALL NC,a */ +OP(op,d5) { PUSH( DE ); } /* PUSH DE */ +OP(op,d6) { SUB(ARG()); } /* SUB n */ +OP(op,d7) { RST(0x10); } /* RST 2 */ + +OP(op,d8) { RET_COND( _F & CF, 0xd8 ); } /* RET C */ +OP(op,d9) { EXX; } /* EXX */ +OP(op,da) { JP_COND( _F & CF ); } /* JP C,a */ +OP(op,db) { unsigned n = ARG() | (_A << 8); _A = IN( n ); } /* IN A,(n) */ +OP(op,dc) { CALL_COND( _F & CF, 0xdc ); } /* CALL C,a */ +OP(op,dd) { _R++; EXEC(dd,ROP()); } /* **** DD xx */ +OP(op,de) { SBC(ARG()); } /* SBC A,n */ +OP(op,df) { RST(0x18); } /* RST 3 */ + +OP(op,e0) { RET_COND( !(_F & PF), 0xe0 ); } /* RET PO */ +OP(op,e1) { POP(HL); } /* POP HL */ +OP(op,e2) { JP_COND( !(_F & PF) ); } /* JP PO,a */ +OP(op,e3) { EXSP(HL); } /* EX HL,(SP) */ +OP(op,e4) { CALL_COND( !(_F & PF), 0xe4 ); } /* CALL PO,a */ +OP(op,e5) { PUSH( HL ); } /* PUSH HL */ +OP(op,e6) { AND(ARG()); } /* AND n */ +OP(op,e7) { RST(0x20); } /* RST 4 */ + +OP(op,e8) { RET_COND( _F & PF, 0xe8 ); } /* RET PE */ +OP(op,e9) { _PC = _HL; } /* JP (HL) */ +OP(op,ea) { JP_COND( _F & PF ); } /* JP PE,a */ +OP(op,eb) { EX_DE_HL; } /* EX DE,HL */ +OP(op,ec) { CALL_COND( _F & PF, 0xec ); } /* CALL PE,a */ +OP(op,ed) { _R++; EXEC(ed,ROP()); } /* **** ED xx */ +OP(op,ee) { XOR(ARG()); } /* XOR n */ +OP(op,ef) { RST(0x28); } /* RST 5 */ + +OP(op,f0) { RET_COND( !(_F & SF), 0xf0 ); } /* RET P */ +OP(op,f1) { POP(AF); } /* POP AF */ +OP(op,f2) { JP_COND( !(_F & SF) ); } /* JP P,a */ +OP(op,f3) { _IFF1 = _IFF2 = 0; } /* DI */ +OP(op,f4) { CALL_COND( !(_F & SF), 0xf4 ); } /* CALL P,a */ +OP(op,f5) { PUSH( AF ); } /* PUSH AF */ +OP(op,f6) { OR(ARG()); } /* OR n */ +OP(op,f7) { RST(0x30); } /* RST 6 */ + +OP(op,f8) { RET_COND( _F & SF, 0xf8 ); } /* RET M */ +OP(op,f9) { _SP = _HL; } /* LD SP,HL */ +OP(op,fa) { JP_COND(_F & SF); } /* JP M,a */ +OP(op,fb) { EI; } /* EI */ +OP(op,fc) { CALL_COND( _F & SF, 0xfc ); } /* CALL M,a */ +OP(op,fd) { _R++; EXEC(fd,ROP()); } /* **** FD xx */ +OP(op,fe) { CP(ARG()); } /* CP n */ +OP(op,ff) { RST(0x38); } /* RST 7 */ + + +static void take_interrupt(void) +{ + if( _IFF1 ) + { + int irq_vector; + + /* there isn't a valid previous program counter */ + _PPC = -1; + + /* Check if processor was halted */ + LEAVE_HALT; + + if( Z80.irq_max ) /* daisy chain mode */ + { + if( Z80.request_irq >= 0 ) + { + /* Clear both interrupt flip flops */ + _IFF1 = _IFF2 = 0; + irq_vector = Z80.irq[Z80.request_irq].interrupt_entry(Z80.irq[Z80.request_irq].irq_param); + Z80.request_irq = -1; + } else return; + } + else + { + /* Clear both interrupt flip flops */ + _IFF1 = _IFF2 = 0; + /* call back the cpu interface to retrieve the vector */ + irq_vector = (*Z80.irq_callback)(0); + } + + /* Interrupt mode 2. Call [Z80.I:databyte] */ + if( _IM == 2 ) + { + irq_vector = (irq_vector & 0xff) | (_I << 8); + PUSH( PC ); + RM16( irq_vector, &Z80.PC ); + /* CALL opcode timing */ + Z80.extra_cycles += cc[Z80_TABLE_op][0xcd]; + } + else + /* Interrupt mode 1. RST 38h */ + if( _IM == 1 ) + { + PUSH( PC ); + _PCD = 0x0038; + /* RST $38 + 'interrupt latency' cycles */ + Z80.extra_cycles += cc[Z80_TABLE_op][0xff] + cc[Z80_TABLE_ex][0xff]; + } + else + { + /* Interrupt mode 0. We check for CALL and JP instructions, */ + /* if neither of these were found we assume a 1 byte opcode */ + /* was placed on the databus */ + switch (irq_vector & 0xff0000) + { + case 0xcd0000: /* call */ + PUSH( PC ); + _PCD = irq_vector & 0xffff; + /* CALL $xxxx + 'interrupt latency' cycles */ + Z80.extra_cycles += cc[Z80_TABLE_op][0xcd] + cc[Z80_TABLE_ex][0xff]; + break; + case 0xc30000: /* jump */ + _PCD = irq_vector & 0xffff; + /* JP $xxxx + 2 cycles */ + Z80.extra_cycles += cc[Z80_TABLE_op][0xc3] + cc[Z80_TABLE_ex][0xff]; + break; + default: /* rst (or other opcodes?) */ + PUSH( PC ); + _PCD = irq_vector & 0x0038; + /* RST $xx + 2 cycles */ + Z80.extra_cycles += cc[Z80_TABLE_op][_PCD] + cc[Z80_TABLE_ex][_PCD]; + break; + } + } + } +} + +/**************************************************************************** + * Reset registers to their initial values + ****************************************************************************/ +void z80_reset(void *param) +{ + Z80_DaisyChain *daisy_chain = (Z80_DaisyChain *)param; + int i, p; +#if BIG_FLAGS_ARRAY + if( !SZHVC_add || !SZHVC_sub ) + { + int oldval, newval, val; + UINT8 *padd, *padc, *psub, *psbc; + /* allocate big flag arrays once */ + SZHVC_add = (UINT8 *)malloc(2*256*256); + SZHVC_sub = (UINT8 *)malloc(2*256*256); + if( !SZHVC_add || !SZHVC_sub ) + { + LOG(("Z80: failed to allocate 2 * 128K flags arrays!!!\n")); + raise(SIGABRT); + } + padd = &SZHVC_add[ 0*256]; + padc = &SZHVC_add[256*256]; + psub = &SZHVC_sub[ 0*256]; + psbc = &SZHVC_sub[256*256]; + for (oldval = 0; oldval < 256; oldval++) + { + for (newval = 0; newval < 256; newval++) + { + /* add or adc w/o carry set */ + val = newval - oldval; + *padd = (newval) ? ((newval & 0x80) ? SF : 0) : ZF; +#if Z80_EXACT + *padd |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ +#endif + if( (newval & 0x0f) < (oldval & 0x0f) ) *padd |= HF; + if( newval < oldval ) *padd |= CF; + if( (val^oldval^0x80) & (val^newval) & 0x80 ) *padd |= VF; + padd++; + + /* adc with carry set */ + val = newval - oldval - 1; + *padc = (newval) ? ((newval & 0x80) ? SF : 0) : ZF; +#if Z80_EXACT + *padc |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ +#endif + if( (newval & 0x0f) <= (oldval & 0x0f) ) *padc |= HF; + if( newval <= oldval ) *padc |= CF; + if( (val^oldval^0x80) & (val^newval) & 0x80 ) *padc |= VF; + padc++; + + /* cp, sub or sbc w/o carry set */ + val = oldval - newval; + *psub = NF | ((newval) ? ((newval & 0x80) ? SF : 0) : ZF); +#if Z80_EXACT + *psub |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ +#endif + if( (newval & 0x0f) > (oldval & 0x0f) ) *psub |= HF; + if( newval > oldval ) *psub |= CF; + if( (val^oldval) & (oldval^newval) & 0x80 ) *psub |= VF; + psub++; + + /* sbc with carry set */ + val = oldval - newval - 1; + *psbc = NF | ((newval) ? ((newval & 0x80) ? SF : 0) : ZF); +#if Z80_EXACT + *psbc |= (newval & (YF | XF)); /* undocumented flag bits 5+3 */ +#endif + if( (newval & 0x0f) >= (oldval & 0x0f) ) *psbc |= HF; + if( newval >= oldval ) *psbc |= CF; + if( (val^oldval) & (oldval^newval) & 0x80 ) *psbc |= VF; + psbc++; + } + } + } +#endif + for (i = 0; i < 256; i++) + { + p = 0; + if( i&0x01 ) ++p; + if( i&0x02 ) ++p; + if( i&0x04 ) ++p; + if( i&0x08 ) ++p; + if( i&0x10 ) ++p; + if( i&0x20 ) ++p; + if( i&0x40 ) ++p; + if( i&0x80 ) ++p; + SZ[i] = i ? i & SF : ZF; +#if Z80_EXACT + SZ[i] |= (i & (YF | XF)); /* undocumented flag bits 5+3 */ +#endif + SZ_BIT[i] = i ? i & SF : ZF | PF; +#if Z80_EXACT + SZ_BIT[i] |= (i & (YF | XF)); /* undocumented flag bits 5+3 */ +#endif + SZP[i] = SZ[i] | ((p & 1) ? 0 : PF); + SZHV_inc[i] = SZ[i]; + if( i == 0x80 ) SZHV_inc[i] |= VF; + if( (i & 0x0f) == 0x00 ) SZHV_inc[i] |= HF; + SZHV_dec[i] = SZ[i] | NF; + if( i == 0x7f ) SZHV_dec[i] |= VF; + if( (i & 0x0f) == 0x0f ) SZHV_dec[i] |= HF; + } + + memset(&Z80, 0, sizeof(Z80)); + _IX = _IY = 0xffff; /* IX and IY are FFFF after a reset! */ + _F = ZF; /* Zero flag is set */ + Z80.request_irq = -1; + Z80.service_irq = -1; + Z80.nmi_state = CLEAR_LINE; + Z80.irq_state = CLEAR_LINE; + + if( daisy_chain ) + { + while( daisy_chain->irq_param != -1 && Z80.irq_max < Z80_MAXDAISY ) + { + /* set callbackhandler after reti */ + Z80.irq[Z80.irq_max] = *daisy_chain; + /* device reset */ + if( Z80.irq[Z80.irq_max].reset ) + Z80.irq[Z80.irq_max].reset(Z80.irq[Z80.irq_max].irq_param); + Z80.irq_max++; + daisy_chain++; + } + } + +} + +void z80_exit(void) +{ +#if BIG_FLAGS_ARRAY + if (SZHVC_add) free(SZHVC_add); + SZHVC_add = NULL; + if (SZHVC_sub) free(SZHVC_sub); + SZHVC_sub = NULL; +#endif +} + +void z80_end_timeslice(void) +{ + z80_ICount = 0; +} + +/**************************************************************************** + * Execute 'cycles' T-states. Return number of T-states really executed + ****************************************************************************/ +int z80_execute(int cycles) +{ + z80_ICount = cycles - Z80.extra_cycles; + Z80.extra_cycles = 0; + + do + { + _PPC = _PCD; + _R++; + EXEC_INLINE(op,ROP()); + } while( z80_ICount > 0 ); + + z80_ICount -= Z80.extra_cycles; + Z80.extra_cycles = 0; + + return cycles - z80_ICount; +} + +/**************************************************************************** + * Burn 'cycles' T-states. Adjust R register for the lost time + ****************************************************************************/ +void z80_burn(int cycles) +{ + if( cycles > 0 ) + { + /* NOP takes 4 cycles per instruction */ + int n = (cycles + 3) / 4; + _R += n; + z80_ICount -= 4 * n; + } +} + +/**************************************************************************** + * Get all registers in given buffer + ****************************************************************************/ +unsigned z80_get_context (void *dst) +{ + if( dst ) + *(Z80_Regs*)dst = Z80; + return sizeof(Z80_Regs); +} + +/**************************************************************************** + * Set all registers to given values + ****************************************************************************/ +void z80_set_context (void *src) +{ + if( src ) + Z80 = *(Z80_Regs*)src; +} + +/**************************************************************************** + * Get a pointer to a cycle count table + ****************************************************************************/ +void *z80_get_cycle_table (int which) +{ + if (which >= 0 && which <= Z80_TABLE_xycb) + return cc[which]; + return NULL; +} + +/**************************************************************************** + * Set a new cycle count table + ****************************************************************************/ +void z80_set_cycle_table (int which, void *new_table) +{ + if (which >= 0 && which <= Z80_TABLE_ex) + cc[which] = new_table; +} + +/**************************************************************************** + * Return program counter + ****************************************************************************/ +unsigned z80_get_pc (void) +{ + return _PCD; +} + +/**************************************************************************** + * Set program counter + ****************************************************************************/ +void z80_set_pc (unsigned val) +{ + _PC = val; +} + +/**************************************************************************** + * Return stack pointer + ****************************************************************************/ +unsigned z80_get_sp (void) +{ + return _SPD; +} + +/**************************************************************************** + * Set stack pointer + ****************************************************************************/ +void z80_set_sp (unsigned val) +{ + _SP = val; +} + +/**************************************************************************** + * Return a specific register + ****************************************************************************/ +unsigned z80_get_reg (int regnum) +{ + switch( regnum ) + { + case Z80_PC: return Z80.PC.w.l; + case Z80_SP: return Z80.SP.w.l; + case Z80_AF: return Z80.AF.w.l; + case Z80_BC: return Z80.BC.w.l; + case Z80_DE: return Z80.DE.w.l; + case Z80_HL: return Z80.HL.w.l; + case Z80_IX: return Z80.IX.w.l; + case Z80_IY: return Z80.IY.w.l; + case Z80_R: return (Z80.R & 0x7f) | (Z80.R2 & 0x80); + case Z80_I: return Z80.I; + case Z80_AF2: return Z80.AF2.w.l; + case Z80_BC2: return Z80.BC2.w.l; + case Z80_DE2: return Z80.DE2.w.l; + case Z80_HL2: return Z80.HL2.w.l; + case Z80_IM: return Z80.IM; + case Z80_IFF1: return Z80.IFF1; + case Z80_IFF2: return Z80.IFF2; + case Z80_HALT: return Z80.HALT; + case Z80_NMI_STATE: return Z80.nmi_state; + case Z80_IRQ_STATE: return Z80.irq_state; + case Z80_DC0: return Z80.int_state[0]; + case Z80_DC1: return Z80.int_state[1]; + case Z80_DC2: return Z80.int_state[2]; + case Z80_DC3: return Z80.int_state[3]; + case REG_PREVIOUSPC: return Z80.PREPC.w.l; + default: + if( regnum <= REG_SP_CONTENTS ) + { + unsigned offset = _SPD + 2 * (REG_SP_CONTENTS - regnum); + if( offset < 0xffff ) + return RM( offset ) | ( RM( offset + 1) << 8 ); + } + } + return 0; +} + +/**************************************************************************** + * Set a specific register + ****************************************************************************/ +void z80_set_reg (int regnum, unsigned val) +{ + switch( regnum ) + { + case Z80_PC: Z80.PC.w.l = val; break; + case Z80_SP: Z80.SP.w.l = val; break; + case Z80_AF: Z80.AF.w.l = val; break; + case Z80_BC: Z80.BC.w.l = val; break; + case Z80_DE: Z80.DE.w.l = val; break; + case Z80_HL: Z80.HL.w.l = val; break; + case Z80_IX: Z80.IX.w.l = val; break; + case Z80_IY: Z80.IY.w.l = val; break; + case Z80_R: Z80.R = val; Z80.R2 = val & 0x80; break; + case Z80_I: Z80.I = val; break; + case Z80_AF2: Z80.AF2.w.l = val; break; + case Z80_BC2: Z80.BC2.w.l = val; break; + case Z80_DE2: Z80.DE2.w.l = val; break; + case Z80_HL2: Z80.HL2.w.l = val; break; + case Z80_IM: Z80.IM = val; break; + case Z80_IFF1: Z80.IFF1 = val; break; + case Z80_IFF2: Z80.IFF2 = val; break; + case Z80_HALT: Z80.HALT = val; break; + case Z80_NMI_STATE: z80_set_nmi_line(val); break; + case Z80_IRQ_STATE: z80_set_irq_line(0,val); break; + case Z80_DC0: Z80.int_state[0] = val; break; + case Z80_DC1: Z80.int_state[1] = val; break; + case Z80_DC2: Z80.int_state[2] = val; break; + case Z80_DC3: Z80.int_state[3] = val; break; + default: + if( regnum <= REG_SP_CONTENTS ) + { + unsigned offset = _SPD + 2 * (REG_SP_CONTENTS - regnum); + if( offset < 0xffff ) + { + WM( offset, val & 0xff ); + WM( offset+1, (val >> 8) & 0xff ); + } + } + } +} + +/**************************************************************************** + * Set NMI line state + ****************************************************************************/ +void z80_set_nmi_line(int state) +{ + if( Z80.nmi_state == state ) return; + + Z80.nmi_state = state; + if( state == CLEAR_LINE ) return; + + _PPC = -1; /* there isn't a valid previous program counter */ + LEAVE_HALT; /* Check if processor was halted */ + + _IFF1 = 0; + PUSH( PC ); + _PCD = 0x0066; + Z80.extra_cycles += 11; +} + +/**************************************************************************** + * Set IRQ line state + ****************************************************************************/ +void z80_set_irq_line(int irqline, int state) +{ + Z80.irq_state = state; + if( state == CLEAR_LINE ) return; + + if( Z80.irq_max ) + { + int daisychain, device, int_state; + daisychain = (*Z80.irq_callback)(irqline); + daisychain = 0xFF; + device = daisychain >> 8; + int_state = daisychain & 0xff; + + if( Z80.int_state[device] != int_state ) + { + LOG((" change\n")); + /* set new interrupt status */ + Z80.int_state[device] = int_state; + /* check interrupt status */ + Z80.request_irq = Z80.service_irq = -1; + + /* search higher IRQ or IEO */ + for( device = 0 ; device < Z80.irq_max ; device ++ ) + { + /* IEO = disable ? */ + if( Z80.int_state[device] & Z80_INT_IEO ) + { + Z80.request_irq = -1; /* if IEO is disable , masking lower IRQ */ + Z80.service_irq = device; /* set highest interrupt service device */ + } + /* IRQ = request ? */ + if( Z80.int_state[device] & Z80_INT_REQ ) + Z80.request_irq = device; + } + if( Z80.request_irq < 0 ) return; + } + else + { + LOG((" no change\n")); + return; + } + } + take_interrupt(); +} + +/**************************************************************************** + * Set IRQ vector callback + ****************************************************************************/ +void z80_set_irq_callback(int (*callback)(int)) +{ + Z80.irq_callback = callback; +} + +#if 0 +/**************************************************************************** + * Save CPU state + ****************************************************************************/ +void z80_state_save(void *file) +{ + int cpu = cpu_getactivecpu(); + state_save_UINT16(file, "z80", cpu, "AF", &Z80.AF.w.l, 1); + state_save_UINT16(file, "z80", cpu, "BC", &Z80.BC.w.l, 1); + state_save_UINT16(file, "z80", cpu, "DE", &Z80.DE.w.l, 1); + state_save_UINT16(file, "z80", cpu, "HL", &Z80.HL.w.l, 1); + state_save_UINT16(file, "z80", cpu, "IX", &Z80.IX.w.l, 1); + state_save_UINT16(file, "z80", cpu, "IY", &Z80.IY.w.l, 1); + state_save_UINT16(file, "z80", cpu, "PC", &Z80.PC.w.l, 1); + state_save_UINT16(file, "z80", cpu, "SP", &Z80.SP.w.l, 1); + state_save_UINT16(file, "z80", cpu, "AF2", &Z80.AF2.w.l, 1); + state_save_UINT16(file, "z80", cpu, "BC2", &Z80.BC2.w.l, 1); + state_save_UINT16(file, "z80", cpu, "DE2", &Z80.DE2.w.l, 1); + state_save_UINT16(file, "z80", cpu, "HL2", &Z80.HL2.w.l, 1); + state_save_UINT8(file, "z80", cpu, "R", &Z80.R, 1); + state_save_UINT8(file, "z80", cpu, "R2", &Z80.R2, 1); + state_save_UINT8(file, "z80", cpu, "IFF1", &Z80.IFF1, 1); + state_save_UINT8(file, "z80", cpu, "IFF2", &Z80.IFF2, 1); + state_save_UINT8(file, "z80", cpu, "HALT", &Z80.HALT, 1); + state_save_UINT8(file, "z80", cpu, "IM", &Z80.IM, 1); + state_save_UINT8(file, "z80", cpu, "I", &Z80.I, 1); + state_save_UINT8(file, "z80", cpu, "irq_max", &Z80.irq_max, 1); + state_save_INT8(file, "z80", cpu, "request_irq", &Z80.request_irq, 1); + state_save_INT8(file, "z80", cpu, "service_irq", &Z80.service_irq, 1); + state_save_UINT8(file, "z80", cpu, "int_state", Z80.int_state, 4); + state_save_UINT8(file, "z80", cpu, "nmi_state", &Z80.nmi_state, 1); + state_save_UINT8(file, "z80", cpu, "irq_state", &Z80.irq_state, 1); + /* daisy chain needs to be saved by z80ctc.c somehow */ +} + +/**************************************************************************** + * Load CPU state + ****************************************************************************/ +void z80_state_load(void *file) +{ + int cpu = cpu_getactivecpu(); + state_load_UINT16(file, "z80", cpu, "AF", &Z80.AF.w.l, 1); + state_load_UINT16(file, "z80", cpu, "BC", &Z80.BC.w.l, 1); + state_load_UINT16(file, "z80", cpu, "DE", &Z80.DE.w.l, 1); + state_load_UINT16(file, "z80", cpu, "HL", &Z80.HL.w.l, 1); + state_load_UINT16(file, "z80", cpu, "IX", &Z80.IX.w.l, 1); + state_load_UINT16(file, "z80", cpu, "IY", &Z80.IY.w.l, 1); + state_load_UINT16(file, "z80", cpu, "PC", &Z80.PC.w.l, 1); + state_load_UINT16(file, "z80", cpu, "SP", &Z80.SP.w.l, 1); + state_load_UINT16(file, "z80", cpu, "AF2", &Z80.AF2.w.l, 1); + state_load_UINT16(file, "z80", cpu, "BC2", &Z80.BC2.w.l, 1); + state_load_UINT16(file, "z80", cpu, "DE2", &Z80.DE2.w.l, 1); + state_load_UINT16(file, "z80", cpu, "HL2", &Z80.HL2.w.l, 1); + state_load_UINT8(file, "z80", cpu, "R", &Z80.R, 1); + state_load_UINT8(file, "z80", cpu, "R2", &Z80.R2, 1); + state_load_UINT8(file, "z80", cpu, "IFF1", &Z80.IFF1, 1); + state_load_UINT8(file, "z80", cpu, "IFF2", &Z80.IFF2, 1); + state_load_UINT8(file, "z80", cpu, "HALT", &Z80.HALT, 1); + state_load_UINT8(file, "z80", cpu, "IM", &Z80.IM, 1); + state_load_UINT8(file, "z80", cpu, "I", &Z80.I, 1); + state_load_UINT8(file, "z80", cpu, "irq_max", &Z80.irq_max, 1); + state_load_INT8(file, "z80", cpu, "request_irq", &Z80.request_irq, 1); + state_load_INT8(file, "z80", cpu, "service_irq", &Z80.service_irq, 1); + state_load_UINT8(file, "z80", cpu, "int_state", Z80.int_state, 4); + state_load_UINT8(file, "z80", cpu, "nmi_state", &Z80.nmi_state, 1); + state_load_UINT8(file, "z80", cpu, "irq_state", &Z80.irq_state, 1); + /* daisy chain needs to be restored by z80ctc.c somehow */ +} + +/**************************************************************************** + * Return a formatted string for a register + ****************************************************************************/ +const char *z80_info(void *context, int regnum) +{ + static char buffer[32][47+1]; + static int which = 0; + Z80_Regs *r = context; + + which = ++which % 32; + buffer[which][0] = '\0'; + if( !context ) + r = &Z80; + + switch( regnum ) + { + case CPU_INFO_REG+Z80_PC: sprintf(buffer[which], "PC:%04X", r->PC.w.l); break; + case CPU_INFO_REG+Z80_SP: sprintf(buffer[which], "SP:%04X", r->SP.w.l); break; + case CPU_INFO_REG+Z80_AF: sprintf(buffer[which], "AF:%04X", r->AF.w.l); break; + case CPU_INFO_REG+Z80_BC: sprintf(buffer[which], "BC:%04X", r->BC.w.l); break; + case CPU_INFO_REG+Z80_DE: sprintf(buffer[which], "DE:%04X", r->DE.w.l); break; + case CPU_INFO_REG+Z80_HL: sprintf(buffer[which], "HL:%04X", r->HL.w.l); break; + case CPU_INFO_REG+Z80_IX: sprintf(buffer[which], "IX:%04X", r->IX.w.l); break; + case CPU_INFO_REG+Z80_IY: sprintf(buffer[which], "IY:%04X", r->IY.w.l); break; + case CPU_INFO_REG+Z80_R: sprintf(buffer[which], "R:%02X", (r->R & 0x7f) | (r->R2 & 0x80)); break; + case CPU_INFO_REG+Z80_I: sprintf(buffer[which], "I:%02X", r->I); break; + case CPU_INFO_REG+Z80_AF2: sprintf(buffer[which], "AF'%04X", r->AF2.w.l); break; + case CPU_INFO_REG+Z80_BC2: sprintf(buffer[which], "BC'%04X", r->BC2.w.l); break; + case CPU_INFO_REG+Z80_DE2: sprintf(buffer[which], "DE'%04X", r->DE2.w.l); break; + case CPU_INFO_REG+Z80_HL2: sprintf(buffer[which], "HL'%04X", r->HL2.w.l); break; + case CPU_INFO_REG+Z80_IM: sprintf(buffer[which], "IM:%X", r->IM); break; + case CPU_INFO_REG+Z80_IFF1: sprintf(buffer[which], "IFF1:%X", r->IFF1); break; + case CPU_INFO_REG+Z80_IFF2: sprintf(buffer[which], "IFF2:%X", r->IFF2); break; + case CPU_INFO_REG+Z80_HALT: sprintf(buffer[which], "HALT:%X", r->HALT); break; + case CPU_INFO_REG+Z80_NMI_STATE: sprintf(buffer[which], "NMI:%X", r->nmi_state); break; + case CPU_INFO_REG+Z80_IRQ_STATE: sprintf(buffer[which], "IRQ:%X", r->irq_state); break; + case CPU_INFO_REG+Z80_DC0: if(Z80.irq_max >= 1) sprintf(buffer[which], "DC0:%X", r->int_state[0]); break; + case CPU_INFO_REG+Z80_DC1: if(Z80.irq_max >= 2) sprintf(buffer[which], "DC1:%X", r->int_state[1]); break; + case CPU_INFO_REG+Z80_DC2: if(Z80.irq_max >= 3) sprintf(buffer[which], "DC2:%X", r->int_state[2]); break; + case CPU_INFO_REG+Z80_DC3: if(Z80.irq_max >= 4) sprintf(buffer[which], "DC3:%X", r->int_state[3]); break; + case CPU_INFO_FLAGS: + sprintf(buffer[which], "%c%c%c%c%c%c%c%c", + r->AF.b.l & 0x80 ? 'S':'.', + r->AF.b.l & 0x40 ? 'Z':'.', + r->AF.b.l & 0x20 ? '5':'.', + r->AF.b.l & 0x10 ? 'H':'.', + r->AF.b.l & 0x08 ? '3':'.', + r->AF.b.l & 0x04 ? 'P':'.', + r->AF.b.l & 0x02 ? 'N':'.', + r->AF.b.l & 0x01 ? 'C':'.'); + break; + case CPU_INFO_NAME: return "Z80"; + case CPU_INFO_FAMILY: return "Zilog Z80"; + case CPU_INFO_VERSION: return "3.2"; + case CPU_INFO_FILE: return __FILE__; + case CPU_INFO_CREDITS: return "Copyright (C) 1998,1999 Juergen Buchmueller, all rights reserved."; + case CPU_INFO_REG_LAYOUT: return (const char *)z80_reg_layout; + case CPU_INFO_WIN_LAYOUT: return (const char *)z80_win_layout; + } + return buffer[which]; +} + +unsigned z80_dasm( char *buffer, unsigned pc ) +{ +#ifdef MAME_DEBUG + return DasmZ80( buffer, pc ); +#else + sprintf( buffer, "$%02X", cpu_readop(pc) ); + return 1; +#endif +} +#endif diff --git a/source/cpu/z80.h b/source/cpu/z80.h new file mode 100644 index 0000000..c921dcf --- /dev/null +++ b/source/cpu/z80.h @@ -0,0 +1,62 @@ +#ifndef Z80_H +#define Z80_H + +#include "cpuintrf.h" +#include "osd_cpu.h" + +enum { + Z80_PC=1, Z80_SP, Z80_AF, Z80_BC, Z80_DE, Z80_HL, + Z80_IX, Z80_IY, Z80_AF2, Z80_BC2, Z80_DE2, Z80_HL2, + Z80_R, Z80_I, Z80_IM, Z80_IFF1, Z80_IFF2, Z80_HALT, + Z80_NMI_STATE, Z80_IRQ_STATE, Z80_DC0, Z80_DC1, Z80_DC2, Z80_DC3 +}; + +enum { + Z80_TABLE_op, + Z80_TABLE_cb, + Z80_TABLE_ed, + Z80_TABLE_xy, + Z80_TABLE_xycb, + Z80_TABLE_ex /* cycles counts for taken jr/jp/call and interrupt latency (rst opcodes) */ +}; + +extern int z80_ICount; /* T-state count */ + +#define Z80_IGNORE_INT -1 /* Ignore interrupt */ +#define Z80_NMI_INT -2 /* Execute NMI */ +#define Z80_IRQ_INT -1000 /* Execute IRQ */ + +extern void z80_reset (void *param); +extern void z80_exit (void); +extern void z80_end_timeslice(void); +extern int z80_execute(int cycles); +extern void z80_burn(int cycles); +extern unsigned z80_get_context (void *dst); +extern void z80_set_context (void *src); +extern void *z80_get_cycle_table (int which); +extern void z80_set_cycle_table (int which, void *new_tbl); +extern unsigned z80_get_pc (void); +extern void z80_set_pc (unsigned val); +extern unsigned z80_get_sp (void); +extern void z80_set_sp (unsigned val); +extern unsigned z80_get_reg (int regnum); +extern void z80_set_reg (int regnum, unsigned val); +extern void z80_set_nmi_line(int state); +extern void z80_set_irq_line(int irqline, int state); +extern void z80_set_irq_callback(int (*irq_callback)(int)); +extern void z80_state_save(void *file); +extern void z80_state_load(void *file); +extern const char *z80_info(void *context, int regnum); +extern unsigned z80_dasm(char *buffer, unsigned pc); + +#ifdef MAME_DEBUG +extern unsigned DasmZ80(char *buffer, unsigned pc); +#endif + +unsigned int cpu_readport16(unsigned int port); +void cpu_writeport16(unsigned int port, unsigned int data); +unsigned int cpu_readmem16(unsigned int address); +void cpu_writemem16(unsigned int address, unsigned int data); + +#endif + diff --git a/source/cpu/z80daa.h b/source/cpu/z80daa.h new file mode 100644 index 0000000..44dbbd3 --- /dev/null +++ b/source/cpu/z80daa.h @@ -0,0 +1,2051 @@ +static UINT16 DAATable[0x800] = { + (0x00<<8) +ZF +VF , + (0x01<<8) , + (0x02<<8) , + (0x03<<8) +VF , + (0x04<<8) , + (0x05<<8) +VF , + (0x06<<8) +VF , + (0x07<<8) , + (0x08<<8) +XF , + (0x09<<8) +XF+VF , + (0x10<<8) +HF , + (0x11<<8) +HF +VF , + (0x12<<8) +HF +VF , + (0x13<<8) +HF , + (0x14<<8) +HF +VF , + (0x15<<8) +HF , + (0x10<<8) , + (0x11<<8) +VF , + (0x12<<8) +VF , + (0x13<<8) , + (0x14<<8) +VF , + (0x15<<8) , + (0x16<<8) , + (0x17<<8) +VF , + (0x18<<8) +XF+VF , + (0x19<<8) +XF , + (0x20<<8) +YF+HF , + (0x21<<8) +YF+HF +VF , + (0x22<<8) +YF+HF +VF , + (0x23<<8) +YF+HF , + (0x24<<8) +YF+HF +VF , + (0x25<<8) +YF+HF , + (0x20<<8) +YF , + (0x21<<8) +YF +VF , + (0x22<<8) +YF +VF , + (0x23<<8) +YF , + (0x24<<8) +YF +VF , + (0x25<<8) +YF , + (0x26<<8) +YF , + (0x27<<8) +YF +VF , + (0x28<<8) +YF +XF+VF , + (0x29<<8) +YF +XF , + (0x30<<8) +YF+HF +VF , + (0x31<<8) +YF+HF , + (0x32<<8) +YF+HF , + (0x33<<8) +YF+HF +VF , + (0x34<<8) +YF+HF , + (0x35<<8) +YF+HF +VF , + (0x30<<8) +YF +VF , + (0x31<<8) +YF , + (0x32<<8) +YF , + (0x33<<8) +YF +VF , + (0x34<<8) +YF , + (0x35<<8) +YF +VF , + (0x36<<8) +YF +VF , + (0x37<<8) +YF , + (0x38<<8) +YF +XF , + (0x39<<8) +YF +XF+VF , + (0x40<<8) +HF , + (0x41<<8) +HF +VF , + (0x42<<8) +HF +VF , + (0x43<<8) +HF , + (0x44<<8) +HF +VF , + (0x45<<8) +HF , + (0x40<<8) , + (0x41<<8) +VF , + (0x42<<8) +VF , + (0x43<<8) , + (0x44<<8) +VF , + (0x45<<8) , + (0x46<<8) , + (0x47<<8) +VF , + (0x48<<8) +XF+VF , + (0x49<<8) +XF , + (0x50<<8) +HF +VF , + (0x51<<8) +HF , + (0x52<<8) +HF , + (0x53<<8) +HF +VF , + (0x54<<8) +HF , + (0x55<<8) +HF +VF , + (0x50<<8) +VF , + (0x51<<8) , + (0x52<<8) , + (0x53<<8) +VF , + (0x54<<8) , + (0x55<<8) +VF , + (0x56<<8) +VF , + (0x57<<8) , + (0x58<<8) +XF , + (0x59<<8) +XF+VF , + (0x60<<8) +YF+HF +VF , + (0x61<<8) +YF+HF , + (0x62<<8) +YF+HF , + (0x63<<8) +YF+HF +VF , + (0x64<<8) +YF+HF , + (0x65<<8) +YF+HF +VF , + (0x60<<8) +YF +VF , + (0x61<<8) +YF , + (0x62<<8) +YF , + (0x63<<8) +YF +VF , + (0x64<<8) +YF , + (0x65<<8) +YF +VF , + (0x66<<8) +YF +VF , + (0x67<<8) +YF , + (0x68<<8) +YF +XF , + (0x69<<8) +YF +XF+VF , + (0x70<<8) +YF+HF , + (0x71<<8) +YF+HF +VF , + (0x72<<8) +YF+HF +VF , + (0x73<<8) +YF+HF , + (0x74<<8) +YF+HF +VF , + (0x75<<8) +YF+HF , + (0x70<<8) +YF , + (0x71<<8) +YF +VF , + (0x72<<8) +YF +VF , + (0x73<<8) +YF , + (0x74<<8) +YF +VF , + (0x75<<8) +YF , + (0x76<<8) +YF , + (0x77<<8) +YF +VF , + (0x78<<8) +YF +XF+VF , + (0x79<<8) +YF +XF , + (0x80<<8)+SF +HF , + (0x81<<8)+SF +HF +VF , + (0x82<<8)+SF +HF +VF , + (0x83<<8)+SF +HF , + (0x84<<8)+SF +HF +VF , + (0x85<<8)+SF +HF , + (0x80<<8)+SF , + (0x81<<8)+SF +VF , + (0x82<<8)+SF +VF , + (0x83<<8)+SF , + (0x84<<8)+SF +VF , + (0x85<<8)+SF , + (0x86<<8)+SF , + (0x87<<8)+SF +VF , + (0x88<<8)+SF +XF+VF , + (0x89<<8)+SF +XF , + (0x90<<8)+SF +HF +VF , + (0x91<<8)+SF +HF , + (0x92<<8)+SF +HF , + (0x93<<8)+SF +HF +VF , + (0x94<<8)+SF +HF , + (0x95<<8)+SF +HF +VF , + (0x90<<8)+SF +VF , + (0x91<<8)+SF , + (0x92<<8)+SF , + (0x93<<8)+SF +VF , + (0x94<<8)+SF , + (0x95<<8)+SF +VF , + (0x96<<8)+SF +VF , + (0x97<<8)+SF , + (0x98<<8)+SF +XF , + (0x99<<8)+SF +XF+VF , + (0x00<<8) +ZF +HF +VF +CF, + (0x01<<8) +HF +CF, + (0x02<<8) +HF +CF, + (0x03<<8) +HF +VF +CF, + (0x04<<8) +HF +CF, + (0x05<<8) +HF +VF +CF, + (0x00<<8) +ZF +VF +CF, + (0x01<<8) +CF, + (0x02<<8) +CF, + (0x03<<8) +VF +CF, + (0x04<<8) +CF, + (0x05<<8) +VF +CF, + (0x06<<8) +VF +CF, + (0x07<<8) +CF, + (0x08<<8) +XF +CF, + (0x09<<8) +XF+VF +CF, + (0x10<<8) +HF +CF, + (0x11<<8) +HF +VF +CF, + (0x12<<8) +HF +VF +CF, + (0x13<<8) +HF +CF, + (0x14<<8) +HF +VF +CF, + (0x15<<8) +HF +CF, + (0x10<<8) +CF, + (0x11<<8) +VF +CF, + (0x12<<8) +VF +CF, + (0x13<<8) +CF, + (0x14<<8) +VF +CF, + (0x15<<8) +CF, + (0x16<<8) +CF, + (0x17<<8) +VF +CF, + (0x18<<8) +XF+VF +CF, + (0x19<<8) +XF +CF, + (0x20<<8) +YF+HF +CF, + (0x21<<8) +YF+HF +VF +CF, + (0x22<<8) +YF+HF +VF +CF, + (0x23<<8) +YF+HF +CF, + (0x24<<8) +YF+HF +VF +CF, + (0x25<<8) +YF+HF +CF, + (0x20<<8) +YF +CF, + (0x21<<8) +YF +VF +CF, + (0x22<<8) +YF +VF +CF, + (0x23<<8) +YF +CF, + (0x24<<8) +YF +VF +CF, + (0x25<<8) +YF +CF, + (0x26<<8) +YF +CF, + (0x27<<8) +YF +VF +CF, + (0x28<<8) +YF +XF+VF +CF, + (0x29<<8) +YF +XF +CF, + (0x30<<8) +YF+HF +VF +CF, + (0x31<<8) +YF+HF +CF, + (0x32<<8) +YF+HF +CF, + (0x33<<8) +YF+HF +VF +CF, + (0x34<<8) +YF+HF +CF, + (0x35<<8) +YF+HF +VF +CF, + (0x30<<8) +YF +VF +CF, + (0x31<<8) +YF +CF, + (0x32<<8) +YF +CF, + (0x33<<8) +YF +VF +CF, + (0x34<<8) +YF +CF, + (0x35<<8) +YF +VF +CF, + (0x36<<8) +YF +VF +CF, + (0x37<<8) +YF +CF, + (0x38<<8) +YF +XF +CF, + (0x39<<8) +YF +XF+VF +CF, + (0x40<<8) +HF +CF, + (0x41<<8) +HF +VF +CF, + (0x42<<8) +HF +VF +CF, + (0x43<<8) +HF +CF, + (0x44<<8) +HF +VF +CF, + (0x45<<8) +HF +CF, + (0x40<<8) +CF, + (0x41<<8) +VF +CF, + (0x42<<8) +VF +CF, + (0x43<<8) +CF, + (0x44<<8) +VF +CF, + (0x45<<8) +CF, + (0x46<<8) +CF, + (0x47<<8) +VF +CF, + (0x48<<8) +XF+VF +CF, + (0x49<<8) +XF +CF, + (0x50<<8) +HF +VF +CF, + (0x51<<8) +HF +CF, + (0x52<<8) +HF +CF, + (0x53<<8) +HF +VF +CF, + (0x54<<8) +HF +CF, + (0x55<<8) +HF +VF +CF, + (0x50<<8) +VF +CF, + (0x51<<8) +CF, + (0x52<<8) +CF, + (0x53<<8) +VF +CF, + (0x54<<8) +CF, + (0x55<<8) +VF +CF, + (0x56<<8) +VF +CF, + (0x57<<8) +CF, + (0x58<<8) +XF +CF, + (0x59<<8) +XF+VF +CF, + (0x60<<8) +YF+HF +VF +CF, + (0x61<<8) +YF+HF +CF, + (0x62<<8) +YF+HF +CF, + (0x63<<8) +YF+HF +VF +CF, + (0x64<<8) +YF+HF +CF, + (0x65<<8) +YF+HF +VF +CF, + (0x60<<8) +YF +VF +CF, + (0x61<<8) +YF +CF, + (0x62<<8) +YF +CF, + (0x63<<8) +YF +VF +CF, + (0x64<<8) +YF +CF, + (0x65<<8) +YF +VF +CF, + (0x66<<8) +YF +VF +CF, + (0x67<<8) +YF +CF, + (0x68<<8) +YF +XF +CF, + (0x69<<8) +YF +XF+VF +CF, + (0x70<<8) +YF+HF +CF, + (0x71<<8) +YF+HF +VF +CF, + (0x72<<8) +YF+HF +VF +CF, + (0x73<<8) +YF+HF +CF, + (0x74<<8) +YF+HF +VF +CF, + (0x75<<8) +YF+HF +CF, + (0x70<<8) +YF +CF, + (0x71<<8) +YF +VF +CF, + (0x72<<8) +YF +VF +CF, + (0x73<<8) +YF +CF, + (0x74<<8) +YF +VF +CF, + (0x75<<8) +YF +CF, + (0x76<<8) +YF +CF, + (0x77<<8) +YF +VF +CF, + (0x78<<8) +YF +XF+VF +CF, + (0x79<<8) +YF +XF +CF, + (0x80<<8)+SF +HF +CF, + (0x81<<8)+SF +HF +VF +CF, + (0x82<<8)+SF +HF +VF +CF, + (0x83<<8)+SF +HF +CF, + (0x84<<8)+SF +HF +VF +CF, + (0x85<<8)+SF +HF +CF, + (0x80<<8)+SF +CF, + (0x81<<8)+SF +VF +CF, + (0x82<<8)+SF +VF +CF, + (0x83<<8)+SF +CF, + (0x84<<8)+SF +VF +CF, + (0x85<<8)+SF +CF, + (0x86<<8)+SF +CF, + (0x87<<8)+SF +VF +CF, + (0x88<<8)+SF +XF+VF +CF, + (0x89<<8)+SF +XF +CF, + (0x90<<8)+SF +HF +VF +CF, + (0x91<<8)+SF +HF +CF, + (0x92<<8)+SF +HF +CF, + (0x93<<8)+SF +HF +VF +CF, + (0x94<<8)+SF +HF +CF, + (0x95<<8)+SF +HF +VF +CF, + (0x90<<8)+SF +VF +CF, + (0x91<<8)+SF +CF, + (0x92<<8)+SF +CF, + (0x93<<8)+SF +VF +CF, + (0x94<<8)+SF +CF, + (0x95<<8)+SF +VF +CF, + (0x96<<8)+SF +VF +CF, + (0x97<<8)+SF +CF, + (0x98<<8)+SF +XF +CF, + (0x99<<8)+SF +XF+VF +CF, + (0xA0<<8)+SF +YF+HF +VF +CF, + (0xA1<<8)+SF +YF+HF +CF, + (0xA2<<8)+SF +YF+HF +CF, + (0xA3<<8)+SF +YF+HF +VF +CF, + (0xA4<<8)+SF +YF+HF +CF, + (0xA5<<8)+SF +YF+HF +VF +CF, + (0xA0<<8)+SF +YF +VF +CF, + (0xA1<<8)+SF +YF +CF, + (0xA2<<8)+SF +YF +CF, + (0xA3<<8)+SF +YF +VF +CF, + (0xA4<<8)+SF +YF +CF, + (0xA5<<8)+SF +YF +VF +CF, + (0xA6<<8)+SF +YF +VF +CF, + (0xA7<<8)+SF +YF +CF, + (0xA8<<8)+SF +YF +XF +CF, + (0xA9<<8)+SF +YF +XF+VF +CF, + (0xB0<<8)+SF +YF+HF +CF, + (0xB1<<8)+SF +YF+HF +VF +CF, + (0xB2<<8)+SF +YF+HF +VF +CF, + (0xB3<<8)+SF +YF+HF +CF, + (0xB4<<8)+SF +YF+HF +VF +CF, + (0xB5<<8)+SF +YF+HF +CF, + (0xB0<<8)+SF +YF +CF, + (0xB1<<8)+SF +YF +VF +CF, + (0xB2<<8)+SF +YF +VF +CF, + (0xB3<<8)+SF +YF +CF, + (0xB4<<8)+SF +YF +VF +CF, + (0xB5<<8)+SF +YF +CF, + (0xB6<<8)+SF +YF +CF, + (0xB7<<8)+SF +YF +VF +CF, + (0xB8<<8)+SF +YF +XF+VF +CF, + (0xB9<<8)+SF +YF +XF +CF, + (0xC0<<8)+SF +HF +VF +CF, + (0xC1<<8)+SF +HF +CF, + (0xC2<<8)+SF +HF +CF, + (0xC3<<8)+SF +HF +VF +CF, + (0xC4<<8)+SF +HF +CF, + (0xC5<<8)+SF +HF +VF +CF, + (0xC0<<8)+SF +VF +CF, + (0xC1<<8)+SF +CF, + (0xC2<<8)+SF +CF, + (0xC3<<8)+SF +VF +CF, + (0xC4<<8)+SF +CF, + (0xC5<<8)+SF +VF +CF, + (0xC6<<8)+SF +VF +CF, + (0xC7<<8)+SF +CF, + (0xC8<<8)+SF +XF +CF, + (0xC9<<8)+SF +XF+VF +CF, + (0xD0<<8)+SF +HF +CF, + (0xD1<<8)+SF +HF +VF +CF, + (0xD2<<8)+SF +HF +VF +CF, + (0xD3<<8)+SF +HF +CF, + (0xD4<<8)+SF +HF +VF +CF, + (0xD5<<8)+SF +HF +CF, + (0xD0<<8)+SF +CF, + (0xD1<<8)+SF +VF +CF, + (0xD2<<8)+SF +VF +CF, + (0xD3<<8)+SF +CF, + (0xD4<<8)+SF +VF +CF, + (0xD5<<8)+SF +CF, + (0xD6<<8)+SF +CF, + (0xD7<<8)+SF +VF +CF, + (0xD8<<8)+SF +XF+VF +CF, + (0xD9<<8)+SF +XF +CF, + (0xE0<<8)+SF +YF+HF +CF, + (0xE1<<8)+SF +YF+HF +VF +CF, + (0xE2<<8)+SF +YF+HF +VF +CF, + (0xE3<<8)+SF +YF+HF +CF, + (0xE4<<8)+SF +YF+HF +VF +CF, + (0xE5<<8)+SF +YF+HF +CF, + (0xE0<<8)+SF +YF +CF, + (0xE1<<8)+SF +YF +VF +CF, + (0xE2<<8)+SF +YF +VF +CF, + (0xE3<<8)+SF +YF +CF, + (0xE4<<8)+SF +YF +VF +CF, + (0xE5<<8)+SF +YF +CF, + (0xE6<<8)+SF +YF +CF, + (0xE7<<8)+SF +YF +VF +CF, + (0xE8<<8)+SF +YF +XF+VF +CF, + (0xE9<<8)+SF +YF +XF +CF, + (0xF0<<8)+SF +YF+HF +VF +CF, + (0xF1<<8)+SF +YF+HF +CF, + (0xF2<<8)+SF +YF+HF +CF, + (0xF3<<8)+SF +YF+HF +VF +CF, + (0xF4<<8)+SF +YF+HF +CF, + (0xF5<<8)+SF +YF+HF +VF +CF, + (0xF0<<8)+SF +YF +VF +CF, + (0xF1<<8)+SF +YF +CF, + (0xF2<<8)+SF +YF +CF, + (0xF3<<8)+SF +YF +VF +CF, + (0xF4<<8)+SF +YF +CF, + (0xF5<<8)+SF +YF +VF +CF, + (0xF6<<8)+SF +YF +VF +CF, + (0xF7<<8)+SF +YF +CF, + (0xF8<<8)+SF +YF +XF +CF, + (0xF9<<8)+SF +YF +XF+VF +CF, + (0x00<<8) +ZF +HF +VF +CF, + (0x01<<8) +HF +CF, + (0x02<<8) +HF +CF, + (0x03<<8) +HF +VF +CF, + (0x04<<8) +HF +CF, + (0x05<<8) +HF +VF +CF, + (0x00<<8) +ZF +VF +CF, + (0x01<<8) +CF, + (0x02<<8) +CF, + (0x03<<8) +VF +CF, + (0x04<<8) +CF, + (0x05<<8) +VF +CF, + (0x06<<8) +VF +CF, + (0x07<<8) +CF, + (0x08<<8) +XF +CF, + (0x09<<8) +XF+VF +CF, + (0x10<<8) +HF +CF, + (0x11<<8) +HF +VF +CF, + (0x12<<8) +HF +VF +CF, + (0x13<<8) +HF +CF, + (0x14<<8) +HF +VF +CF, + (0x15<<8) +HF +CF, + (0x10<<8) +CF, + (0x11<<8) +VF +CF, + (0x12<<8) +VF +CF, + (0x13<<8) +CF, + (0x14<<8) +VF +CF, + (0x15<<8) +CF, + (0x16<<8) +CF, + (0x17<<8) +VF +CF, + (0x18<<8) +XF+VF +CF, + (0x19<<8) +XF +CF, + (0x20<<8) +YF+HF +CF, + (0x21<<8) +YF+HF +VF +CF, + (0x22<<8) +YF+HF +VF +CF, + (0x23<<8) +YF+HF +CF, + (0x24<<8) +YF+HF +VF +CF, + (0x25<<8) +YF+HF +CF, + (0x20<<8) +YF +CF, + (0x21<<8) +YF +VF +CF, + (0x22<<8) +YF +VF +CF, + (0x23<<8) +YF +CF, + (0x24<<8) +YF +VF +CF, + (0x25<<8) +YF +CF, + (0x26<<8) +YF +CF, + (0x27<<8) +YF +VF +CF, + (0x28<<8) +YF +XF+VF +CF, + (0x29<<8) +YF +XF +CF, + (0x30<<8) +YF+HF +VF +CF, + (0x31<<8) +YF+HF +CF, + (0x32<<8) +YF+HF +CF, + (0x33<<8) +YF+HF +VF +CF, + (0x34<<8) +YF+HF +CF, + (0x35<<8) +YF+HF +VF +CF, + (0x30<<8) +YF +VF +CF, + (0x31<<8) +YF +CF, + (0x32<<8) +YF +CF, + (0x33<<8) +YF +VF +CF, + (0x34<<8) +YF +CF, + (0x35<<8) +YF +VF +CF, + (0x36<<8) +YF +VF +CF, + (0x37<<8) +YF +CF, + (0x38<<8) +YF +XF +CF, + (0x39<<8) +YF +XF+VF +CF, + (0x40<<8) +HF +CF, + (0x41<<8) +HF +VF +CF, + (0x42<<8) +HF +VF +CF, + (0x43<<8) +HF +CF, + (0x44<<8) +HF +VF +CF, + (0x45<<8) +HF +CF, + (0x40<<8) +CF, + (0x41<<8) +VF +CF, + (0x42<<8) +VF +CF, + (0x43<<8) +CF, + (0x44<<8) +VF +CF, + (0x45<<8) +CF, + (0x46<<8) +CF, + (0x47<<8) +VF +CF, + (0x48<<8) +XF+VF +CF, + (0x49<<8) +XF +CF, + (0x50<<8) +HF +VF +CF, + (0x51<<8) +HF +CF, + (0x52<<8) +HF +CF, + (0x53<<8) +HF +VF +CF, + (0x54<<8) +HF +CF, + (0x55<<8) +HF +VF +CF, + (0x50<<8) +VF +CF, + (0x51<<8) +CF, + (0x52<<8) +CF, + (0x53<<8) +VF +CF, + (0x54<<8) +CF, + (0x55<<8) +VF +CF, + (0x56<<8) +VF +CF, + (0x57<<8) +CF, + (0x58<<8) +XF +CF, + (0x59<<8) +XF+VF +CF, + (0x60<<8) +YF+HF +VF +CF, + (0x61<<8) +YF+HF +CF, + (0x62<<8) +YF+HF +CF, + (0x63<<8) +YF+HF +VF +CF, + (0x64<<8) +YF+HF +CF, + (0x65<<8) +YF+HF +VF +CF, + (0x06<<8) +VF , + (0x07<<8) , + (0x08<<8) +XF , + (0x09<<8) +XF+VF , + (0x0A<<8) +XF+VF , + (0x0B<<8) +XF , + (0x0C<<8) +XF+VF , + (0x0D<<8) +XF , + (0x0E<<8) +XF , + (0x0F<<8) +XF+VF , + (0x10<<8) +HF , + (0x11<<8) +HF +VF , + (0x12<<8) +HF +VF , + (0x13<<8) +HF , + (0x14<<8) +HF +VF , + (0x15<<8) +HF , + (0x16<<8) , + (0x17<<8) +VF , + (0x18<<8) +XF+VF , + (0x19<<8) +XF , + (0x1A<<8) +XF , + (0x1B<<8) +XF+VF , + (0x1C<<8) +XF , + (0x1D<<8) +XF+VF , + (0x1E<<8) +XF+VF , + (0x1F<<8) +XF , + (0x20<<8) +YF+HF , + (0x21<<8) +YF+HF +VF , + (0x22<<8) +YF+HF +VF , + (0x23<<8) +YF+HF , + (0x24<<8) +YF+HF +VF , + (0x25<<8) +YF+HF , + (0x26<<8) +YF , + (0x27<<8) +YF +VF , + (0x28<<8) +YF +XF+VF , + (0x29<<8) +YF +XF , + (0x2A<<8) +YF +XF , + (0x2B<<8) +YF +XF+VF , + (0x2C<<8) +YF +XF , + (0x2D<<8) +YF +XF+VF , + (0x2E<<8) +YF +XF+VF , + (0x2F<<8) +YF +XF , + (0x30<<8) +YF+HF +VF , + (0x31<<8) +YF+HF , + (0x32<<8) +YF+HF , + (0x33<<8) +YF+HF +VF , + (0x34<<8) +YF+HF , + (0x35<<8) +YF+HF +VF , + (0x36<<8) +YF +VF , + (0x37<<8) +YF , + (0x38<<8) +YF +XF , + (0x39<<8) +YF +XF+VF , + (0x3A<<8) +YF +XF+VF , + (0x3B<<8) +YF +XF , + (0x3C<<8) +YF +XF+VF , + (0x3D<<8) +YF +XF , + (0x3E<<8) +YF +XF , + (0x3F<<8) +YF +XF+VF , + (0x40<<8) +HF , + (0x41<<8) +HF +VF , + (0x42<<8) +HF +VF , + (0x43<<8) +HF , + (0x44<<8) +HF +VF , + (0x45<<8) +HF , + (0x46<<8) , + (0x47<<8) +VF , + (0x48<<8) +XF+VF , + (0x49<<8) +XF , + (0x4A<<8) +XF , + (0x4B<<8) +XF+VF , + (0x4C<<8) +XF , + (0x4D<<8) +XF+VF , + (0x4E<<8) +XF+VF , + (0x4F<<8) +XF , + (0x50<<8) +HF +VF , + (0x51<<8) +HF , + (0x52<<8) +HF , + (0x53<<8) +HF +VF , + (0x54<<8) +HF , + (0x55<<8) +HF +VF , + (0x56<<8) +VF , + (0x57<<8) , + (0x58<<8) +XF , + (0x59<<8) +XF+VF , + (0x5A<<8) +XF+VF , + (0x5B<<8) +XF , + (0x5C<<8) +XF+VF , + (0x5D<<8) +XF , + (0x5E<<8) +XF , + (0x5F<<8) +XF+VF , + (0x60<<8) +YF+HF +VF , + (0x61<<8) +YF+HF , + (0x62<<8) +YF+HF , + (0x63<<8) +YF+HF +VF , + (0x64<<8) +YF+HF , + (0x65<<8) +YF+HF +VF , + (0x66<<8) +YF +VF , + (0x67<<8) +YF , + (0x68<<8) +YF +XF , + (0x69<<8) +YF +XF+VF , + (0x6A<<8) +YF +XF+VF , + (0x6B<<8) +YF +XF , + (0x6C<<8) +YF +XF+VF , + (0x6D<<8) +YF +XF , + (0x6E<<8) +YF +XF , + (0x6F<<8) +YF +XF+VF , + (0x70<<8) +YF+HF , + (0x71<<8) +YF+HF +VF , + (0x72<<8) +YF+HF +VF , + (0x73<<8) +YF+HF , + (0x74<<8) +YF+HF +VF , + (0x75<<8) +YF+HF , + (0x76<<8) +YF , + (0x77<<8) +YF +VF , + (0x78<<8) +YF +XF+VF , + (0x79<<8) +YF +XF , + (0x7A<<8) +YF +XF , + (0x7B<<8) +YF +XF+VF , + (0x7C<<8) +YF +XF , + (0x7D<<8) +YF +XF+VF , + (0x7E<<8) +YF +XF+VF , + (0x7F<<8) +YF +XF , + (0x80<<8)+SF +HF , + (0x81<<8)+SF +HF +VF , + (0x82<<8)+SF +HF +VF , + (0x83<<8)+SF +HF , + (0x84<<8)+SF +HF +VF , + (0x85<<8)+SF +HF , + (0x86<<8)+SF , + (0x87<<8)+SF +VF , + (0x88<<8)+SF +XF+VF , + (0x89<<8)+SF +XF , + (0x8A<<8)+SF +XF , + (0x8B<<8)+SF +XF+VF , + (0x8C<<8)+SF +XF , + (0x8D<<8)+SF +XF+VF , + (0x8E<<8)+SF +XF+VF , + (0x8F<<8)+SF +XF , + (0x90<<8)+SF +HF +VF , + (0x91<<8)+SF +HF , + (0x92<<8)+SF +HF , + (0x93<<8)+SF +HF +VF , + (0x94<<8)+SF +HF , + (0x95<<8)+SF +HF +VF , + (0x96<<8)+SF +VF , + (0x97<<8)+SF , + (0x98<<8)+SF +XF , + (0x99<<8)+SF +XF+VF , + (0x9A<<8)+SF +XF+VF , + (0x9B<<8)+SF +XF , + (0x9C<<8)+SF +XF+VF , + (0x9D<<8)+SF +XF , + (0x9E<<8)+SF +XF , + (0x9F<<8)+SF +XF+VF , + (0x00<<8) +ZF +HF +VF +CF, + (0x01<<8) +HF +CF, + (0x02<<8) +HF +CF, + (0x03<<8) +HF +VF +CF, + (0x04<<8) +HF +CF, + (0x05<<8) +HF +VF +CF, + (0x06<<8) +VF +CF, + (0x07<<8) +CF, + (0x08<<8) +XF +CF, + (0x09<<8) +XF+VF +CF, + (0x0A<<8) +XF+VF +CF, + (0x0B<<8) +XF +CF, + (0x0C<<8) +XF+VF +CF, + (0x0D<<8) +XF +CF, + (0x0E<<8) +XF +CF, + (0x0F<<8) +XF+VF +CF, + (0x10<<8) +HF +CF, + (0x11<<8) +HF +VF +CF, + (0x12<<8) +HF +VF +CF, + (0x13<<8) +HF +CF, + (0x14<<8) +HF +VF +CF, + (0x15<<8) +HF +CF, + (0x16<<8) +CF, + (0x17<<8) +VF +CF, + (0x18<<8) +XF+VF +CF, + (0x19<<8) +XF +CF, + (0x1A<<8) +XF +CF, + (0x1B<<8) +XF+VF +CF, + (0x1C<<8) +XF +CF, + (0x1D<<8) +XF+VF +CF, + (0x1E<<8) +XF+VF +CF, + (0x1F<<8) +XF +CF, + (0x20<<8) +YF+HF +CF, + (0x21<<8) +YF+HF +VF +CF, + (0x22<<8) +YF+HF +VF +CF, + (0x23<<8) +YF+HF +CF, + (0x24<<8) +YF+HF +VF +CF, + (0x25<<8) +YF+HF +CF, + (0x26<<8) +YF +CF, + (0x27<<8) +YF +VF +CF, + (0x28<<8) +YF +XF+VF +CF, + (0x29<<8) +YF +XF +CF, + (0x2A<<8) +YF +XF +CF, + (0x2B<<8) +YF +XF+VF +CF, + (0x2C<<8) +YF +XF +CF, + (0x2D<<8) +YF +XF+VF +CF, + (0x2E<<8) +YF +XF+VF +CF, + (0x2F<<8) +YF +XF +CF, + (0x30<<8) +YF+HF +VF +CF, + (0x31<<8) +YF+HF +CF, + (0x32<<8) +YF+HF +CF, + (0x33<<8) +YF+HF +VF +CF, + (0x34<<8) +YF+HF +CF, + (0x35<<8) +YF+HF +VF +CF, + (0x36<<8) +YF +VF +CF, + (0x37<<8) +YF +CF, + (0x38<<8) +YF +XF +CF, + (0x39<<8) +YF +XF+VF +CF, + (0x3A<<8) +YF +XF+VF +CF, + (0x3B<<8) +YF +XF +CF, + (0x3C<<8) +YF +XF+VF +CF, + (0x3D<<8) +YF +XF +CF, + (0x3E<<8) +YF +XF +CF, + (0x3F<<8) +YF +XF+VF +CF, + (0x40<<8) +HF +CF, + (0x41<<8) +HF +VF +CF, + (0x42<<8) +HF +VF +CF, + (0x43<<8) +HF +CF, + (0x44<<8) +HF +VF +CF, + (0x45<<8) +HF +CF, + (0x46<<8) +CF, + (0x47<<8) +VF +CF, + (0x48<<8) +XF+VF +CF, + (0x49<<8) +XF +CF, + (0x4A<<8) +XF +CF, + (0x4B<<8) +XF+VF +CF, + (0x4C<<8) +XF +CF, + (0x4D<<8) +XF+VF +CF, + (0x4E<<8) +XF+VF +CF, + (0x4F<<8) +XF +CF, + (0x50<<8) +HF +VF +CF, + (0x51<<8) +HF +CF, + (0x52<<8) +HF +CF, + (0x53<<8) +HF +VF +CF, + (0x54<<8) +HF +CF, + (0x55<<8) +HF +VF +CF, + (0x56<<8) +VF +CF, + (0x57<<8) +CF, + (0x58<<8) +XF +CF, + (0x59<<8) +XF+VF +CF, + (0x5A<<8) +XF+VF +CF, + (0x5B<<8) +XF +CF, + (0x5C<<8) +XF+VF +CF, + (0x5D<<8) +XF +CF, + (0x5E<<8) +XF +CF, + (0x5F<<8) +XF+VF +CF, + (0x60<<8) +YF+HF +VF +CF, + (0x61<<8) +YF+HF +CF, + (0x62<<8) +YF+HF +CF, + (0x63<<8) +YF+HF +VF +CF, + (0x64<<8) +YF+HF +CF, + (0x65<<8) +YF+HF +VF +CF, + (0x66<<8) +YF +VF +CF, + (0x67<<8) +YF +CF, + (0x68<<8) +YF +XF +CF, + (0x69<<8) +YF +XF+VF +CF, + (0x6A<<8) +YF +XF+VF +CF, + (0x6B<<8) +YF +XF +CF, + (0x6C<<8) +YF +XF+VF +CF, + (0x6D<<8) +YF +XF +CF, + (0x6E<<8) +YF +XF +CF, + (0x6F<<8) +YF +XF+VF +CF, + (0x70<<8) +YF+HF +CF, + (0x71<<8) +YF+HF +VF +CF, + (0x72<<8) +YF+HF +VF +CF, + (0x73<<8) +YF+HF +CF, + (0x74<<8) +YF+HF +VF +CF, + (0x75<<8) +YF+HF +CF, + (0x76<<8) +YF +CF, + (0x77<<8) +YF +VF +CF, + (0x78<<8) +YF +XF+VF +CF, + (0x79<<8) +YF +XF +CF, + (0x7A<<8) +YF +XF +CF, + (0x7B<<8) +YF +XF+VF +CF, + (0x7C<<8) +YF +XF +CF, + (0x7D<<8) +YF +XF+VF +CF, + (0x7E<<8) +YF +XF+VF +CF, + (0x7F<<8) +YF +XF +CF, + (0x80<<8)+SF +HF +CF, + (0x81<<8)+SF +HF +VF +CF, + (0x82<<8)+SF +HF +VF +CF, + (0x83<<8)+SF +HF +CF, + (0x84<<8)+SF +HF +VF +CF, + (0x85<<8)+SF +HF +CF, + (0x86<<8)+SF +CF, + (0x87<<8)+SF +VF +CF, + (0x88<<8)+SF +XF+VF +CF, + (0x89<<8)+SF +XF +CF, + (0x8A<<8)+SF +XF +CF, + (0x8B<<8)+SF +XF+VF +CF, + (0x8C<<8)+SF +XF +CF, + (0x8D<<8)+SF +XF+VF +CF, + (0x8E<<8)+SF +XF+VF +CF, + (0x8F<<8)+SF +XF +CF, + (0x90<<8)+SF +HF +VF +CF, + (0x91<<8)+SF +HF +CF, + (0x92<<8)+SF +HF +CF, + (0x93<<8)+SF +HF +VF +CF, + (0x94<<8)+SF +HF +CF, + (0x95<<8)+SF +HF +VF +CF, + (0x96<<8)+SF +VF +CF, + (0x97<<8)+SF +CF, + (0x98<<8)+SF +XF +CF, + (0x99<<8)+SF +XF+VF +CF, + (0x9A<<8)+SF +XF+VF +CF, + (0x9B<<8)+SF +XF +CF, + (0x9C<<8)+SF +XF+VF +CF, + (0x9D<<8)+SF +XF +CF, + (0x9E<<8)+SF +XF +CF, + (0x9F<<8)+SF +XF+VF +CF, + (0xA0<<8)+SF +YF+HF +VF +CF, + (0xA1<<8)+SF +YF+HF +CF, + (0xA2<<8)+SF +YF+HF +CF, + (0xA3<<8)+SF +YF+HF +VF +CF, + (0xA4<<8)+SF +YF+HF +CF, + (0xA5<<8)+SF +YF+HF +VF +CF, + (0xA6<<8)+SF +YF +VF +CF, + (0xA7<<8)+SF +YF +CF, + (0xA8<<8)+SF +YF +XF +CF, + (0xA9<<8)+SF +YF +XF+VF +CF, + (0xAA<<8)+SF +YF +XF+VF +CF, + (0xAB<<8)+SF +YF +XF +CF, + (0xAC<<8)+SF +YF +XF+VF +CF, + (0xAD<<8)+SF +YF +XF +CF, + (0xAE<<8)+SF +YF +XF +CF, + (0xAF<<8)+SF +YF +XF+VF +CF, + (0xB0<<8)+SF +YF+HF +CF, + (0xB1<<8)+SF +YF+HF +VF +CF, + (0xB2<<8)+SF +YF+HF +VF +CF, + (0xB3<<8)+SF +YF+HF +CF, + (0xB4<<8)+SF +YF+HF +VF +CF, + (0xB5<<8)+SF +YF+HF +CF, + (0xB6<<8)+SF +YF +CF, + (0xB7<<8)+SF +YF +VF +CF, + (0xB8<<8)+SF +YF +XF+VF +CF, + (0xB9<<8)+SF +YF +XF +CF, + (0xBA<<8)+SF +YF +XF +CF, + (0xBB<<8)+SF +YF +XF+VF +CF, + (0xBC<<8)+SF +YF +XF +CF, + (0xBD<<8)+SF +YF +XF+VF +CF, + (0xBE<<8)+SF +YF +XF+VF +CF, + (0xBF<<8)+SF +YF +XF +CF, + (0xC0<<8)+SF +HF +VF +CF, + (0xC1<<8)+SF +HF +CF, + (0xC2<<8)+SF +HF +CF, + (0xC3<<8)+SF +HF +VF +CF, + (0xC4<<8)+SF +HF +CF, + (0xC5<<8)+SF +HF +VF +CF, + (0xC6<<8)+SF +VF +CF, + (0xC7<<8)+SF +CF, + (0xC8<<8)+SF +XF +CF, + (0xC9<<8)+SF +XF+VF +CF, + (0xCA<<8)+SF +XF+VF +CF, + (0xCB<<8)+SF +XF +CF, + (0xCC<<8)+SF +XF+VF +CF, + (0xCD<<8)+SF +XF +CF, + (0xCE<<8)+SF +XF +CF, + (0xCF<<8)+SF +XF+VF +CF, + (0xD0<<8)+SF +HF +CF, + (0xD1<<8)+SF +HF +VF +CF, + (0xD2<<8)+SF +HF +VF +CF, + (0xD3<<8)+SF +HF +CF, + (0xD4<<8)+SF +HF +VF +CF, + (0xD5<<8)+SF +HF +CF, + (0xD6<<8)+SF +CF, + (0xD7<<8)+SF +VF +CF, + (0xD8<<8)+SF +XF+VF +CF, + (0xD9<<8)+SF +XF +CF, + (0xDA<<8)+SF +XF +CF, + (0xDB<<8)+SF +XF+VF +CF, + (0xDC<<8)+SF +XF +CF, + (0xDD<<8)+SF +XF+VF +CF, + (0xDE<<8)+SF +XF+VF +CF, + (0xDF<<8)+SF +XF +CF, + (0xE0<<8)+SF +YF+HF +CF, + (0xE1<<8)+SF +YF+HF +VF +CF, + (0xE2<<8)+SF +YF+HF +VF +CF, + (0xE3<<8)+SF +YF+HF +CF, + (0xE4<<8)+SF +YF+HF +VF +CF, + (0xE5<<8)+SF +YF+HF +CF, + (0xE6<<8)+SF +YF +CF, + (0xE7<<8)+SF +YF +VF +CF, + (0xE8<<8)+SF +YF +XF+VF +CF, + (0xE9<<8)+SF +YF +XF +CF, + (0xEA<<8)+SF +YF +XF +CF, + (0xEB<<8)+SF +YF +XF+VF +CF, + (0xEC<<8)+SF +YF +XF +CF, + (0xED<<8)+SF +YF +XF+VF +CF, + (0xEE<<8)+SF +YF +XF+VF +CF, + (0xEF<<8)+SF +YF +XF +CF, + (0xF0<<8)+SF +YF+HF +VF +CF, + (0xF1<<8)+SF +YF+HF +CF, + (0xF2<<8)+SF +YF+HF +CF, + (0xF3<<8)+SF +YF+HF +VF +CF, + (0xF4<<8)+SF +YF+HF +CF, + (0xF5<<8)+SF +YF+HF +VF +CF, + (0xF6<<8)+SF +YF +VF +CF, + (0xF7<<8)+SF +YF +CF, + (0xF8<<8)+SF +YF +XF +CF, + (0xF9<<8)+SF +YF +XF+VF +CF, + (0xFA<<8)+SF +YF +XF+VF +CF, + (0xFB<<8)+SF +YF +XF +CF, + (0xFC<<8)+SF +YF +XF+VF +CF, + (0xFD<<8)+SF +YF +XF +CF, + (0xFE<<8)+SF +YF +XF +CF, + (0xFF<<8)+SF +YF +XF+VF +CF, + (0x00<<8) +ZF +HF +VF +CF, + (0x01<<8) +HF +CF, + (0x02<<8) +HF +CF, + (0x03<<8) +HF +VF +CF, + (0x04<<8) +HF +CF, + (0x05<<8) +HF +VF +CF, + (0x06<<8) +VF +CF, + (0x07<<8) +CF, + (0x08<<8) +XF +CF, + (0x09<<8) +XF+VF +CF, + (0x0A<<8) +XF+VF +CF, + (0x0B<<8) +XF +CF, + (0x0C<<8) +XF+VF +CF, + (0x0D<<8) +XF +CF, + (0x0E<<8) +XF +CF, + (0x0F<<8) +XF+VF +CF, + (0x10<<8) +HF +CF, + (0x11<<8) +HF +VF +CF, + (0x12<<8) +HF +VF +CF, + (0x13<<8) +HF +CF, + (0x14<<8) +HF +VF +CF, + (0x15<<8) +HF +CF, + (0x16<<8) +CF, + (0x17<<8) +VF +CF, + (0x18<<8) +XF+VF +CF, + (0x19<<8) +XF +CF, + (0x1A<<8) +XF +CF, + (0x1B<<8) +XF+VF +CF, + (0x1C<<8) +XF +CF, + (0x1D<<8) +XF+VF +CF, + (0x1E<<8) +XF+VF +CF, + (0x1F<<8) +XF +CF, + (0x20<<8) +YF+HF +CF, + (0x21<<8) +YF+HF +VF +CF, + (0x22<<8) +YF+HF +VF +CF, + (0x23<<8) +YF+HF +CF, + (0x24<<8) +YF+HF +VF +CF, + (0x25<<8) +YF+HF +CF, + (0x26<<8) +YF +CF, + (0x27<<8) +YF +VF +CF, + (0x28<<8) +YF +XF+VF +CF, + (0x29<<8) +YF +XF +CF, + (0x2A<<8) +YF +XF +CF, + (0x2B<<8) +YF +XF+VF +CF, + (0x2C<<8) +YF +XF +CF, + (0x2D<<8) +YF +XF+VF +CF, + (0x2E<<8) +YF +XF+VF +CF, + (0x2F<<8) +YF +XF +CF, + (0x30<<8) +YF+HF +VF +CF, + (0x31<<8) +YF+HF +CF, + (0x32<<8) +YF+HF +CF, + (0x33<<8) +YF+HF +VF +CF, + (0x34<<8) +YF+HF +CF, + (0x35<<8) +YF+HF +VF +CF, + (0x36<<8) +YF +VF +CF, + (0x37<<8) +YF +CF, + (0x38<<8) +YF +XF +CF, + (0x39<<8) +YF +XF+VF +CF, + (0x3A<<8) +YF +XF+VF +CF, + (0x3B<<8) +YF +XF +CF, + (0x3C<<8) +YF +XF+VF +CF, + (0x3D<<8) +YF +XF +CF, + (0x3E<<8) +YF +XF +CF, + (0x3F<<8) +YF +XF+VF +CF, + (0x40<<8) +HF +CF, + (0x41<<8) +HF +VF +CF, + (0x42<<8) +HF +VF +CF, + (0x43<<8) +HF +CF, + (0x44<<8) +HF +VF +CF, + (0x45<<8) +HF +CF, + (0x46<<8) +CF, + (0x47<<8) +VF +CF, + (0x48<<8) +XF+VF +CF, + (0x49<<8) +XF +CF, + (0x4A<<8) +XF +CF, + (0x4B<<8) +XF+VF +CF, + (0x4C<<8) +XF +CF, + (0x4D<<8) +XF+VF +CF, + (0x4E<<8) +XF+VF +CF, + (0x4F<<8) +XF +CF, + (0x50<<8) +HF +VF +CF, + (0x51<<8) +HF +CF, + (0x52<<8) +HF +CF, + (0x53<<8) +HF +VF +CF, + (0x54<<8) +HF +CF, + (0x55<<8) +HF +VF +CF, + (0x56<<8) +VF +CF, + (0x57<<8) +CF, + (0x58<<8) +XF +CF, + (0x59<<8) +XF+VF +CF, + (0x5A<<8) +XF+VF +CF, + (0x5B<<8) +XF +CF, + (0x5C<<8) +XF+VF +CF, + (0x5D<<8) +XF +CF, + (0x5E<<8) +XF +CF, + (0x5F<<8) +XF+VF +CF, + (0x60<<8) +YF+HF +VF +CF, + (0x61<<8) +YF+HF +CF, + (0x62<<8) +YF+HF +CF, + (0x63<<8) +YF+HF +VF +CF, + (0x64<<8) +YF+HF +CF, + (0x65<<8) +YF+HF +VF +CF, + (0x00<<8) +ZF +VF+NF , + (0x01<<8) +NF , + (0x02<<8) +NF , + (0x03<<8) +VF+NF , + (0x04<<8) +NF , + (0x05<<8) +VF+NF , + (0x06<<8) +VF+NF , + (0x07<<8) +NF , + (0x08<<8) +XF +NF , + (0x09<<8) +XF+VF+NF , + (0x04<<8) +NF , + (0x05<<8) +VF+NF , + (0x06<<8) +VF+NF , + (0x07<<8) +NF , + (0x08<<8) +XF +NF , + (0x09<<8) +XF+VF+NF , + (0x10<<8) +NF , + (0x11<<8) +VF+NF , + (0x12<<8) +VF+NF , + (0x13<<8) +NF , + (0x14<<8) +VF+NF , + (0x15<<8) +NF , + (0x16<<8) +NF , + (0x17<<8) +VF+NF , + (0x18<<8) +XF+VF+NF , + (0x19<<8) +XF +NF , + (0x14<<8) +VF+NF , + (0x15<<8) +NF , + (0x16<<8) +NF , + (0x17<<8) +VF+NF , + (0x18<<8) +XF+VF+NF , + (0x19<<8) +XF +NF , + (0x20<<8) +YF +NF , + (0x21<<8) +YF +VF+NF , + (0x22<<8) +YF +VF+NF , + (0x23<<8) +YF +NF , + (0x24<<8) +YF +VF+NF , + (0x25<<8) +YF +NF , + (0x26<<8) +YF +NF , + (0x27<<8) +YF +VF+NF , + (0x28<<8) +YF +XF+VF+NF , + (0x29<<8) +YF +XF +NF , + (0x24<<8) +YF +VF+NF , + (0x25<<8) +YF +NF , + (0x26<<8) +YF +NF , + (0x27<<8) +YF +VF+NF , + (0x28<<8) +YF +XF+VF+NF , + (0x29<<8) +YF +XF +NF , + (0x30<<8) +YF +VF+NF , + (0x31<<8) +YF +NF , + (0x32<<8) +YF +NF , + (0x33<<8) +YF +VF+NF , + (0x34<<8) +YF +NF , + (0x35<<8) +YF +VF+NF , + (0x36<<8) +YF +VF+NF , + (0x37<<8) +YF +NF , + (0x38<<8) +YF +XF +NF , + (0x39<<8) +YF +XF+VF+NF , + (0x34<<8) +YF +NF , + (0x35<<8) +YF +VF+NF , + (0x36<<8) +YF +VF+NF , + (0x37<<8) +YF +NF , + (0x38<<8) +YF +XF +NF , + (0x39<<8) +YF +XF+VF+NF , + (0x40<<8) +NF , + (0x41<<8) +VF+NF , + (0x42<<8) +VF+NF , + (0x43<<8) +NF , + (0x44<<8) +VF+NF , + (0x45<<8) +NF , + (0x46<<8) +NF , + (0x47<<8) +VF+NF , + (0x48<<8) +XF+VF+NF , + (0x49<<8) +XF +NF , + (0x44<<8) +VF+NF , + (0x45<<8) +NF , + (0x46<<8) +NF , + (0x47<<8) +VF+NF , + (0x48<<8) +XF+VF+NF , + (0x49<<8) +XF +NF , + (0x50<<8) +VF+NF , + (0x51<<8) +NF , + (0x52<<8) +NF , + (0x53<<8) +VF+NF , + (0x54<<8) +NF , + (0x55<<8) +VF+NF , + (0x56<<8) +VF+NF , + (0x57<<8) +NF , + (0x58<<8) +XF +NF , + (0x59<<8) +XF+VF+NF , + (0x54<<8) +NF , + (0x55<<8) +VF+NF , + (0x56<<8) +VF+NF , + (0x57<<8) +NF , + (0x58<<8) +XF +NF , + (0x59<<8) +XF+VF+NF , + (0x60<<8) +YF +VF+NF , + (0x61<<8) +YF +NF , + (0x62<<8) +YF +NF , + (0x63<<8) +YF +VF+NF , + (0x64<<8) +YF +NF , + (0x65<<8) +YF +VF+NF , + (0x66<<8) +YF +VF+NF , + (0x67<<8) +YF +NF , + (0x68<<8) +YF +XF +NF , + (0x69<<8) +YF +XF+VF+NF , + (0x64<<8) +YF +NF , + (0x65<<8) +YF +VF+NF , + (0x66<<8) +YF +VF+NF , + (0x67<<8) +YF +NF , + (0x68<<8) +YF +XF +NF , + (0x69<<8) +YF +XF+VF+NF , + (0x70<<8) +YF +NF , + (0x71<<8) +YF +VF+NF , + (0x72<<8) +YF +VF+NF , + (0x73<<8) +YF +NF , + (0x74<<8) +YF +VF+NF , + (0x75<<8) +YF +NF , + (0x76<<8) +YF +NF , + (0x77<<8) +YF +VF+NF , + (0x78<<8) +YF +XF+VF+NF , + (0x79<<8) +YF +XF +NF , + (0x74<<8) +YF +VF+NF , + (0x75<<8) +YF +NF , + (0x76<<8) +YF +NF , + (0x77<<8) +YF +VF+NF , + (0x78<<8) +YF +XF+VF+NF , + (0x79<<8) +YF +XF +NF , + (0x80<<8)+SF +NF , + (0x81<<8)+SF +VF+NF , + (0x82<<8)+SF +VF+NF , + (0x83<<8)+SF +NF , + (0x84<<8)+SF +VF+NF , + (0x85<<8)+SF +NF , + (0x86<<8)+SF +NF , + (0x87<<8)+SF +VF+NF , + (0x88<<8)+SF +XF+VF+NF , + (0x89<<8)+SF +XF +NF , + (0x84<<8)+SF +VF+NF , + (0x85<<8)+SF +NF , + (0x86<<8)+SF +NF , + (0x87<<8)+SF +VF+NF , + (0x88<<8)+SF +XF+VF+NF , + (0x89<<8)+SF +XF +NF , + (0x90<<8)+SF +VF+NF , + (0x91<<8)+SF +NF , + (0x92<<8)+SF +NF , + (0x93<<8)+SF +VF+NF , + (0x94<<8)+SF +NF , + (0x95<<8)+SF +VF+NF , + (0x96<<8)+SF +VF+NF , + (0x97<<8)+SF +NF , + (0x98<<8)+SF +XF +NF , + (0x99<<8)+SF +XF+VF+NF , + (0x34<<8) +YF +NF+CF, + (0x35<<8) +YF +VF+NF+CF, + (0x36<<8) +YF +VF+NF+CF, + (0x37<<8) +YF +NF+CF, + (0x38<<8) +YF +XF +NF+CF, + (0x39<<8) +YF +XF+VF+NF+CF, + (0x40<<8) +NF+CF, + (0x41<<8) +VF+NF+CF, + (0x42<<8) +VF+NF+CF, + (0x43<<8) +NF+CF, + (0x44<<8) +VF+NF+CF, + (0x45<<8) +NF+CF, + (0x46<<8) +NF+CF, + (0x47<<8) +VF+NF+CF, + (0x48<<8) +XF+VF+NF+CF, + (0x49<<8) +XF +NF+CF, + (0x44<<8) +VF+NF+CF, + (0x45<<8) +NF+CF, + (0x46<<8) +NF+CF, + (0x47<<8) +VF+NF+CF, + (0x48<<8) +XF+VF+NF+CF, + (0x49<<8) +XF +NF+CF, + (0x50<<8) +VF+NF+CF, + (0x51<<8) +NF+CF, + (0x52<<8) +NF+CF, + (0x53<<8) +VF+NF+CF, + (0x54<<8) +NF+CF, + (0x55<<8) +VF+NF+CF, + (0x56<<8) +VF+NF+CF, + (0x57<<8) +NF+CF, + (0x58<<8) +XF +NF+CF, + (0x59<<8) +XF+VF+NF+CF, + (0x54<<8) +NF+CF, + (0x55<<8) +VF+NF+CF, + (0x56<<8) +VF+NF+CF, + (0x57<<8) +NF+CF, + (0x58<<8) +XF +NF+CF, + (0x59<<8) +XF+VF+NF+CF, + (0x60<<8) +YF +VF+NF+CF, + (0x61<<8) +YF +NF+CF, + (0x62<<8) +YF +NF+CF, + (0x63<<8) +YF +VF+NF+CF, + (0x64<<8) +YF +NF+CF, + (0x65<<8) +YF +VF+NF+CF, + (0x66<<8) +YF +VF+NF+CF, + (0x67<<8) +YF +NF+CF, + (0x68<<8) +YF +XF +NF+CF, + (0x69<<8) +YF +XF+VF+NF+CF, + (0x64<<8) +YF +NF+CF, + (0x65<<8) +YF +VF+NF+CF, + (0x66<<8) +YF +VF+NF+CF, + (0x67<<8) +YF +NF+CF, + (0x68<<8) +YF +XF +NF+CF, + (0x69<<8) +YF +XF+VF+NF+CF, + (0x70<<8) +YF +NF+CF, + (0x71<<8) +YF +VF+NF+CF, + (0x72<<8) +YF +VF+NF+CF, + (0x73<<8) +YF +NF+CF, + (0x74<<8) +YF +VF+NF+CF, + (0x75<<8) +YF +NF+CF, + (0x76<<8) +YF +NF+CF, + (0x77<<8) +YF +VF+NF+CF, + (0x78<<8) +YF +XF+VF+NF+CF, + (0x79<<8) +YF +XF +NF+CF, + (0x74<<8) +YF +VF+NF+CF, + (0x75<<8) +YF +NF+CF, + (0x76<<8) +YF +NF+CF, + (0x77<<8) +YF +VF+NF+CF, + (0x78<<8) +YF +XF+VF+NF+CF, + (0x79<<8) +YF +XF +NF+CF, + (0x80<<8)+SF +NF+CF, + (0x81<<8)+SF +VF+NF+CF, + (0x82<<8)+SF +VF+NF+CF, + (0x83<<8)+SF +NF+CF, + (0x84<<8)+SF +VF+NF+CF, + (0x85<<8)+SF +NF+CF, + (0x86<<8)+SF +NF+CF, + (0x87<<8)+SF +VF+NF+CF, + (0x88<<8)+SF +XF+VF+NF+CF, + (0x89<<8)+SF +XF +NF+CF, + (0x84<<8)+SF +VF+NF+CF, + (0x85<<8)+SF +NF+CF, + (0x86<<8)+SF +NF+CF, + (0x87<<8)+SF +VF+NF+CF, + (0x88<<8)+SF +XF+VF+NF+CF, + (0x89<<8)+SF +XF +NF+CF, + (0x90<<8)+SF +VF+NF+CF, + (0x91<<8)+SF +NF+CF, + (0x92<<8)+SF +NF+CF, + (0x93<<8)+SF +VF+NF+CF, + (0x94<<8)+SF +NF+CF, + (0x95<<8)+SF +VF+NF+CF, + (0x96<<8)+SF +VF+NF+CF, + (0x97<<8)+SF +NF+CF, + (0x98<<8)+SF +XF +NF+CF, + (0x99<<8)+SF +XF+VF+NF+CF, + (0x94<<8)+SF +NF+CF, + (0x95<<8)+SF +VF+NF+CF, + (0x96<<8)+SF +VF+NF+CF, + (0x97<<8)+SF +NF+CF, + (0x98<<8)+SF +XF +NF+CF, + (0x99<<8)+SF +XF+VF+NF+CF, + (0xA0<<8)+SF +YF +VF+NF+CF, + (0xA1<<8)+SF +YF +NF+CF, + (0xA2<<8)+SF +YF +NF+CF, + (0xA3<<8)+SF +YF +VF+NF+CF, + (0xA4<<8)+SF +YF +NF+CF, + (0xA5<<8)+SF +YF +VF+NF+CF, + (0xA6<<8)+SF +YF +VF+NF+CF, + (0xA7<<8)+SF +YF +NF+CF, + (0xA8<<8)+SF +YF +XF +NF+CF, + (0xA9<<8)+SF +YF +XF+VF+NF+CF, + (0xA4<<8)+SF +YF +NF+CF, + (0xA5<<8)+SF +YF +VF+NF+CF, + (0xA6<<8)+SF +YF +VF+NF+CF, + (0xA7<<8)+SF +YF +NF+CF, + (0xA8<<8)+SF +YF +XF +NF+CF, + (0xA9<<8)+SF +YF +XF+VF+NF+CF, + (0xB0<<8)+SF +YF +NF+CF, + (0xB1<<8)+SF +YF +VF+NF+CF, + (0xB2<<8)+SF +YF +VF+NF+CF, + (0xB3<<8)+SF +YF +NF+CF, + (0xB4<<8)+SF +YF +VF+NF+CF, + (0xB5<<8)+SF +YF +NF+CF, + (0xB6<<8)+SF +YF +NF+CF, + (0xB7<<8)+SF +YF +VF+NF+CF, + (0xB8<<8)+SF +YF +XF+VF+NF+CF, + (0xB9<<8)+SF +YF +XF +NF+CF, + (0xB4<<8)+SF +YF +VF+NF+CF, + (0xB5<<8)+SF +YF +NF+CF, + (0xB6<<8)+SF +YF +NF+CF, + (0xB7<<8)+SF +YF +VF+NF+CF, + (0xB8<<8)+SF +YF +XF+VF+NF+CF, + (0xB9<<8)+SF +YF +XF +NF+CF, + (0xC0<<8)+SF +VF+NF+CF, + (0xC1<<8)+SF +NF+CF, + (0xC2<<8)+SF +NF+CF, + (0xC3<<8)+SF +VF+NF+CF, + (0xC4<<8)+SF +NF+CF, + (0xC5<<8)+SF +VF+NF+CF, + (0xC6<<8)+SF +VF+NF+CF, + (0xC7<<8)+SF +NF+CF, + (0xC8<<8)+SF +XF +NF+CF, + (0xC9<<8)+SF +XF+VF+NF+CF, + (0xC4<<8)+SF +NF+CF, + (0xC5<<8)+SF +VF+NF+CF, + (0xC6<<8)+SF +VF+NF+CF, + (0xC7<<8)+SF +NF+CF, + (0xC8<<8)+SF +XF +NF+CF, + (0xC9<<8)+SF +XF+VF+NF+CF, + (0xD0<<8)+SF +NF+CF, + (0xD1<<8)+SF +VF+NF+CF, + (0xD2<<8)+SF +VF+NF+CF, + (0xD3<<8)+SF +NF+CF, + (0xD4<<8)+SF +VF+NF+CF, + (0xD5<<8)+SF +NF+CF, + (0xD6<<8)+SF +NF+CF, + (0xD7<<8)+SF +VF+NF+CF, + (0xD8<<8)+SF +XF+VF+NF+CF, + (0xD9<<8)+SF +XF +NF+CF, + (0xD4<<8)+SF +VF+NF+CF, + (0xD5<<8)+SF +NF+CF, + (0xD6<<8)+SF +NF+CF, + (0xD7<<8)+SF +VF+NF+CF, + (0xD8<<8)+SF +XF+VF+NF+CF, + (0xD9<<8)+SF +XF +NF+CF, + (0xE0<<8)+SF +YF +NF+CF, + (0xE1<<8)+SF +YF +VF+NF+CF, + (0xE2<<8)+SF +YF +VF+NF+CF, + (0xE3<<8)+SF +YF +NF+CF, + (0xE4<<8)+SF +YF +VF+NF+CF, + (0xE5<<8)+SF +YF +NF+CF, + (0xE6<<8)+SF +YF +NF+CF, + (0xE7<<8)+SF +YF +VF+NF+CF, + (0xE8<<8)+SF +YF +XF+VF+NF+CF, + (0xE9<<8)+SF +YF +XF +NF+CF, + (0xE4<<8)+SF +YF +VF+NF+CF, + (0xE5<<8)+SF +YF +NF+CF, + (0xE6<<8)+SF +YF +NF+CF, + (0xE7<<8)+SF +YF +VF+NF+CF, + (0xE8<<8)+SF +YF +XF+VF+NF+CF, + (0xE9<<8)+SF +YF +XF +NF+CF, + (0xF0<<8)+SF +YF +VF+NF+CF, + (0xF1<<8)+SF +YF +NF+CF, + (0xF2<<8)+SF +YF +NF+CF, + (0xF3<<8)+SF +YF +VF+NF+CF, + (0xF4<<8)+SF +YF +NF+CF, + (0xF5<<8)+SF +YF +VF+NF+CF, + (0xF6<<8)+SF +YF +VF+NF+CF, + (0xF7<<8)+SF +YF +NF+CF, + (0xF8<<8)+SF +YF +XF +NF+CF, + (0xF9<<8)+SF +YF +XF+VF+NF+CF, + (0xF4<<8)+SF +YF +NF+CF, + (0xF5<<8)+SF +YF +VF+NF+CF, + (0xF6<<8)+SF +YF +VF+NF+CF, + (0xF7<<8)+SF +YF +NF+CF, + (0xF8<<8)+SF +YF +XF +NF+CF, + (0xF9<<8)+SF +YF +XF+VF+NF+CF, + (0x00<<8) +ZF +VF+NF+CF, + (0x01<<8) +NF+CF, + (0x02<<8) +NF+CF, + (0x03<<8) +VF+NF+CF, + (0x04<<8) +NF+CF, + (0x05<<8) +VF+NF+CF, + (0x06<<8) +VF+NF+CF, + (0x07<<8) +NF+CF, + (0x08<<8) +XF +NF+CF, + (0x09<<8) +XF+VF+NF+CF, + (0x04<<8) +NF+CF, + (0x05<<8) +VF+NF+CF, + (0x06<<8) +VF+NF+CF, + (0x07<<8) +NF+CF, + (0x08<<8) +XF +NF+CF, + (0x09<<8) +XF+VF+NF+CF, + (0x10<<8) +NF+CF, + (0x11<<8) +VF+NF+CF, + (0x12<<8) +VF+NF+CF, + (0x13<<8) +NF+CF, + (0x14<<8) +VF+NF+CF, + (0x15<<8) +NF+CF, + (0x16<<8) +NF+CF, + (0x17<<8) +VF+NF+CF, + (0x18<<8) +XF+VF+NF+CF, + (0x19<<8) +XF +NF+CF, + (0x14<<8) +VF+NF+CF, + (0x15<<8) +NF+CF, + (0x16<<8) +NF+CF, + (0x17<<8) +VF+NF+CF, + (0x18<<8) +XF+VF+NF+CF, + (0x19<<8) +XF +NF+CF, + (0x20<<8) +YF +NF+CF, + (0x21<<8) +YF +VF+NF+CF, + (0x22<<8) +YF +VF+NF+CF, + (0x23<<8) +YF +NF+CF, + (0x24<<8) +YF +VF+NF+CF, + (0x25<<8) +YF +NF+CF, + (0x26<<8) +YF +NF+CF, + (0x27<<8) +YF +VF+NF+CF, + (0x28<<8) +YF +XF+VF+NF+CF, + (0x29<<8) +YF +XF +NF+CF, + (0x24<<8) +YF +VF+NF+CF, + (0x25<<8) +YF +NF+CF, + (0x26<<8) +YF +NF+CF, + (0x27<<8) +YF +VF+NF+CF, + (0x28<<8) +YF +XF+VF+NF+CF, + (0x29<<8) +YF +XF +NF+CF, + (0x30<<8) +YF +VF+NF+CF, + (0x31<<8) +YF +NF+CF, + (0x32<<8) +YF +NF+CF, + (0x33<<8) +YF +VF+NF+CF, + (0x34<<8) +YF +NF+CF, + (0x35<<8) +YF +VF+NF+CF, + (0x36<<8) +YF +VF+NF+CF, + (0x37<<8) +YF +NF+CF, + (0x38<<8) +YF +XF +NF+CF, + (0x39<<8) +YF +XF+VF+NF+CF, + (0x34<<8) +YF +NF+CF, + (0x35<<8) +YF +VF+NF+CF, + (0x36<<8) +YF +VF+NF+CF, + (0x37<<8) +YF +NF+CF, + (0x38<<8) +YF +XF +NF+CF, + (0x39<<8) +YF +XF+VF+NF+CF, + (0x40<<8) +NF+CF, + (0x41<<8) +VF+NF+CF, + (0x42<<8) +VF+NF+CF, + (0x43<<8) +NF+CF, + (0x44<<8) +VF+NF+CF, + (0x45<<8) +NF+CF, + (0x46<<8) +NF+CF, + (0x47<<8) +VF+NF+CF, + (0x48<<8) +XF+VF+NF+CF, + (0x49<<8) +XF +NF+CF, + (0x44<<8) +VF+NF+CF, + (0x45<<8) +NF+CF, + (0x46<<8) +NF+CF, + (0x47<<8) +VF+NF+CF, + (0x48<<8) +XF+VF+NF+CF, + (0x49<<8) +XF +NF+CF, + (0x50<<8) +VF+NF+CF, + (0x51<<8) +NF+CF, + (0x52<<8) +NF+CF, + (0x53<<8) +VF+NF+CF, + (0x54<<8) +NF+CF, + (0x55<<8) +VF+NF+CF, + (0x56<<8) +VF+NF+CF, + (0x57<<8) +NF+CF, + (0x58<<8) +XF +NF+CF, + (0x59<<8) +XF+VF+NF+CF, + (0x54<<8) +NF+CF, + (0x55<<8) +VF+NF+CF, + (0x56<<8) +VF+NF+CF, + (0x57<<8) +NF+CF, + (0x58<<8) +XF +NF+CF, + (0x59<<8) +XF+VF+NF+CF, + (0x60<<8) +YF +VF+NF+CF, + (0x61<<8) +YF +NF+CF, + (0x62<<8) +YF +NF+CF, + (0x63<<8) +YF +VF+NF+CF, + (0x64<<8) +YF +NF+CF, + (0x65<<8) +YF +VF+NF+CF, + (0x66<<8) +YF +VF+NF+CF, + (0x67<<8) +YF +NF+CF, + (0x68<<8) +YF +XF +NF+CF, + (0x69<<8) +YF +XF+VF+NF+CF, + (0x64<<8) +YF +NF+CF, + (0x65<<8) +YF +VF+NF+CF, + (0x66<<8) +YF +VF+NF+CF, + (0x67<<8) +YF +NF+CF, + (0x68<<8) +YF +XF +NF+CF, + (0x69<<8) +YF +XF+VF+NF+CF, + (0x70<<8) +YF +NF+CF, + (0x71<<8) +YF +VF+NF+CF, + (0x72<<8) +YF +VF+NF+CF, + (0x73<<8) +YF +NF+CF, + (0x74<<8) +YF +VF+NF+CF, + (0x75<<8) +YF +NF+CF, + (0x76<<8) +YF +NF+CF, + (0x77<<8) +YF +VF+NF+CF, + (0x78<<8) +YF +XF+VF+NF+CF, + (0x79<<8) +YF +XF +NF+CF, + (0x74<<8) +YF +VF+NF+CF, + (0x75<<8) +YF +NF+CF, + (0x76<<8) +YF +NF+CF, + (0x77<<8) +YF +VF+NF+CF, + (0x78<<8) +YF +XF+VF+NF+CF, + (0x79<<8) +YF +XF +NF+CF, + (0x80<<8)+SF +NF+CF, + (0x81<<8)+SF +VF+NF+CF, + (0x82<<8)+SF +VF+NF+CF, + (0x83<<8)+SF +NF+CF, + (0x84<<8)+SF +VF+NF+CF, + (0x85<<8)+SF +NF+CF, + (0x86<<8)+SF +NF+CF, + (0x87<<8)+SF +VF+NF+CF, + (0x88<<8)+SF +XF+VF+NF+CF, + (0x89<<8)+SF +XF +NF+CF, + (0x84<<8)+SF +VF+NF+CF, + (0x85<<8)+SF +NF+CF, + (0x86<<8)+SF +NF+CF, + (0x87<<8)+SF +VF+NF+CF, + (0x88<<8)+SF +XF+VF+NF+CF, + (0x89<<8)+SF +XF +NF+CF, + (0x90<<8)+SF +VF+NF+CF, + (0x91<<8)+SF +NF+CF, + (0x92<<8)+SF +NF+CF, + (0x93<<8)+SF +VF+NF+CF, + (0x94<<8)+SF +NF+CF, + (0x95<<8)+SF +VF+NF+CF, + (0x96<<8)+SF +VF+NF+CF, + (0x97<<8)+SF +NF+CF, + (0x98<<8)+SF +XF +NF+CF, + (0x99<<8)+SF +XF+VF+NF+CF, + (0x94<<8)+SF +NF+CF, + (0x95<<8)+SF +VF+NF+CF, + (0x96<<8)+SF +VF+NF+CF, + (0x97<<8)+SF +NF+CF, + (0x98<<8)+SF +XF +NF+CF, + (0x99<<8)+SF +XF+VF+NF+CF, + (0xFA<<8)+SF +YF+HF+XF+VF+NF , + (0xFB<<8)+SF +YF+HF+XF +NF , + (0xFC<<8)+SF +YF+HF+XF+VF+NF , + (0xFD<<8)+SF +YF+HF+XF +NF , + (0xFE<<8)+SF +YF+HF+XF +NF , + (0xFF<<8)+SF +YF+HF+XF+VF+NF , + (0x00<<8) +ZF +VF+NF , + (0x01<<8) +NF , + (0x02<<8) +NF , + (0x03<<8) +VF+NF , + (0x04<<8) +NF , + (0x05<<8) +VF+NF , + (0x06<<8) +VF+NF , + (0x07<<8) +NF , + (0x08<<8) +XF +NF , + (0x09<<8) +XF+VF+NF , + (0x0A<<8) +HF+XF+VF+NF , + (0x0B<<8) +HF+XF +NF , + (0x0C<<8) +HF+XF+VF+NF , + (0x0D<<8) +HF+XF +NF , + (0x0E<<8) +HF+XF +NF , + (0x0F<<8) +HF+XF+VF+NF , + (0x10<<8) +NF , + (0x11<<8) +VF+NF , + (0x12<<8) +VF+NF , + (0x13<<8) +NF , + (0x14<<8) +VF+NF , + (0x15<<8) +NF , + (0x16<<8) +NF , + (0x17<<8) +VF+NF , + (0x18<<8) +XF+VF+NF , + (0x19<<8) +XF +NF , + (0x1A<<8) +HF+XF +NF , + (0x1B<<8) +HF+XF+VF+NF , + (0x1C<<8) +HF+XF +NF , + (0x1D<<8) +HF+XF+VF+NF , + (0x1E<<8) +HF+XF+VF+NF , + (0x1F<<8) +HF+XF +NF , + (0x20<<8) +YF +NF , + (0x21<<8) +YF +VF+NF , + (0x22<<8) +YF +VF+NF , + (0x23<<8) +YF +NF , + (0x24<<8) +YF +VF+NF , + (0x25<<8) +YF +NF , + (0x26<<8) +YF +NF , + (0x27<<8) +YF +VF+NF , + (0x28<<8) +YF +XF+VF+NF , + (0x29<<8) +YF +XF +NF , + (0x2A<<8) +YF+HF+XF +NF , + (0x2B<<8) +YF+HF+XF+VF+NF , + (0x2C<<8) +YF+HF+XF +NF , + (0x2D<<8) +YF+HF+XF+VF+NF , + (0x2E<<8) +YF+HF+XF+VF+NF , + (0x2F<<8) +YF+HF+XF +NF , + (0x30<<8) +YF +VF+NF , + (0x31<<8) +YF +NF , + (0x32<<8) +YF +NF , + (0x33<<8) +YF +VF+NF , + (0x34<<8) +YF +NF , + (0x35<<8) +YF +VF+NF , + (0x36<<8) +YF +VF+NF , + (0x37<<8) +YF +NF , + (0x38<<8) +YF +XF +NF , + (0x39<<8) +YF +XF+VF+NF , + (0x3A<<8) +YF+HF+XF+VF+NF , + (0x3B<<8) +YF+HF+XF +NF , + (0x3C<<8) +YF+HF+XF+VF+NF , + (0x3D<<8) +YF+HF+XF +NF , + (0x3E<<8) +YF+HF+XF +NF , + (0x3F<<8) +YF+HF+XF+VF+NF , + (0x40<<8) +NF , + (0x41<<8) +VF+NF , + (0x42<<8) +VF+NF , + (0x43<<8) +NF , + (0x44<<8) +VF+NF , + (0x45<<8) +NF , + (0x46<<8) +NF , + (0x47<<8) +VF+NF , + (0x48<<8) +XF+VF+NF , + (0x49<<8) +XF +NF , + (0x4A<<8) +HF+XF +NF , + (0x4B<<8) +HF+XF+VF+NF , + (0x4C<<8) +HF+XF +NF , + (0x4D<<8) +HF+XF+VF+NF , + (0x4E<<8) +HF+XF+VF+NF , + (0x4F<<8) +HF+XF +NF , + (0x50<<8) +VF+NF , + (0x51<<8) +NF , + (0x52<<8) +NF , + (0x53<<8) +VF+NF , + (0x54<<8) +NF , + (0x55<<8) +VF+NF , + (0x56<<8) +VF+NF , + (0x57<<8) +NF , + (0x58<<8) +XF +NF , + (0x59<<8) +XF+VF+NF , + (0x5A<<8) +HF+XF+VF+NF , + (0x5B<<8) +HF+XF +NF , + (0x5C<<8) +HF+XF+VF+NF , + (0x5D<<8) +HF+XF +NF , + (0x5E<<8) +HF+XF +NF , + (0x5F<<8) +HF+XF+VF+NF , + (0x60<<8) +YF +VF+NF , + (0x61<<8) +YF +NF , + (0x62<<8) +YF +NF , + (0x63<<8) +YF +VF+NF , + (0x64<<8) +YF +NF , + (0x65<<8) +YF +VF+NF , + (0x66<<8) +YF +VF+NF , + (0x67<<8) +YF +NF , + (0x68<<8) +YF +XF +NF , + (0x69<<8) +YF +XF+VF+NF , + (0x6A<<8) +YF+HF+XF+VF+NF , + (0x6B<<8) +YF+HF+XF +NF , + (0x6C<<8) +YF+HF+XF+VF+NF , + (0x6D<<8) +YF+HF+XF +NF , + (0x6E<<8) +YF+HF+XF +NF , + (0x6F<<8) +YF+HF+XF+VF+NF , + (0x70<<8) +YF +NF , + (0x71<<8) +YF +VF+NF , + (0x72<<8) +YF +VF+NF , + (0x73<<8) +YF +NF , + (0x74<<8) +YF +VF+NF , + (0x75<<8) +YF +NF , + (0x76<<8) +YF +NF , + (0x77<<8) +YF +VF+NF , + (0x78<<8) +YF +XF+VF+NF , + (0x79<<8) +YF +XF +NF , + (0x7A<<8) +YF+HF+XF +NF , + (0x7B<<8) +YF+HF+XF+VF+NF , + (0x7C<<8) +YF+HF+XF +NF , + (0x7D<<8) +YF+HF+XF+VF+NF , + (0x7E<<8) +YF+HF+XF+VF+NF , + (0x7F<<8) +YF+HF+XF +NF , + (0x80<<8)+SF +NF , + (0x81<<8)+SF +VF+NF , + (0x82<<8)+SF +VF+NF , + (0x83<<8)+SF +NF , + (0x84<<8)+SF +VF+NF , + (0x85<<8)+SF +NF , + (0x86<<8)+SF +NF , + (0x87<<8)+SF +VF+NF , + (0x88<<8)+SF +XF+VF+NF , + (0x89<<8)+SF +XF +NF , + (0x8A<<8)+SF +HF+XF +NF , + (0x8B<<8)+SF +HF+XF+VF+NF , + (0x8C<<8)+SF +HF+XF +NF , + (0x8D<<8)+SF +HF+XF+VF+NF , + (0x8E<<8)+SF +HF+XF+VF+NF , + (0x8F<<8)+SF +HF+XF +NF , + (0x90<<8)+SF +VF+NF , + (0x91<<8)+SF +NF , + (0x92<<8)+SF +NF , + (0x93<<8)+SF +VF+NF , + (0x34<<8) +YF +NF+CF, + (0x35<<8) +YF +VF+NF+CF, + (0x36<<8) +YF +VF+NF+CF, + (0x37<<8) +YF +NF+CF, + (0x38<<8) +YF +XF +NF+CF, + (0x39<<8) +YF +XF+VF+NF+CF, + (0x3A<<8) +YF+HF+XF+VF+NF+CF, + (0x3B<<8) +YF+HF+XF +NF+CF, + (0x3C<<8) +YF+HF+XF+VF+NF+CF, + (0x3D<<8) +YF+HF+XF +NF+CF, + (0x3E<<8) +YF+HF+XF +NF+CF, + (0x3F<<8) +YF+HF+XF+VF+NF+CF, + (0x40<<8) +NF+CF, + (0x41<<8) +VF+NF+CF, + (0x42<<8) +VF+NF+CF, + (0x43<<8) +NF+CF, + (0x44<<8) +VF+NF+CF, + (0x45<<8) +NF+CF, + (0x46<<8) +NF+CF, + (0x47<<8) +VF+NF+CF, + (0x48<<8) +XF+VF+NF+CF, + (0x49<<8) +XF +NF+CF, + (0x4A<<8) +HF+XF +NF+CF, + (0x4B<<8) +HF+XF+VF+NF+CF, + (0x4C<<8) +HF+XF +NF+CF, + (0x4D<<8) +HF+XF+VF+NF+CF, + (0x4E<<8) +HF+XF+VF+NF+CF, + (0x4F<<8) +HF+XF +NF+CF, + (0x50<<8) +VF+NF+CF, + (0x51<<8) +NF+CF, + (0x52<<8) +NF+CF, + (0x53<<8) +VF+NF+CF, + (0x54<<8) +NF+CF, + (0x55<<8) +VF+NF+CF, + (0x56<<8) +VF+NF+CF, + (0x57<<8) +NF+CF, + (0x58<<8) +XF +NF+CF, + (0x59<<8) +XF+VF+NF+CF, + (0x5A<<8) +HF+XF+VF+NF+CF, + (0x5B<<8) +HF+XF +NF+CF, + (0x5C<<8) +HF+XF+VF+NF+CF, + (0x5D<<8) +HF+XF +NF+CF, + (0x5E<<8) +HF+XF +NF+CF, + (0x5F<<8) +HF+XF+VF+NF+CF, + (0x60<<8) +YF +VF+NF+CF, + (0x61<<8) +YF +NF+CF, + (0x62<<8) +YF +NF+CF, + (0x63<<8) +YF +VF+NF+CF, + (0x64<<8) +YF +NF+CF, + (0x65<<8) +YF +VF+NF+CF, + (0x66<<8) +YF +VF+NF+CF, + (0x67<<8) +YF +NF+CF, + (0x68<<8) +YF +XF +NF+CF, + (0x69<<8) +YF +XF+VF+NF+CF, + (0x6A<<8) +YF+HF+XF+VF+NF+CF, + (0x6B<<8) +YF+HF+XF +NF+CF, + (0x6C<<8) +YF+HF+XF+VF+NF+CF, + (0x6D<<8) +YF+HF+XF +NF+CF, + (0x6E<<8) +YF+HF+XF +NF+CF, + (0x6F<<8) +YF+HF+XF+VF+NF+CF, + (0x70<<8) +YF +NF+CF, + (0x71<<8) +YF +VF+NF+CF, + (0x72<<8) +YF +VF+NF+CF, + (0x73<<8) +YF +NF+CF, + (0x74<<8) +YF +VF+NF+CF, + (0x75<<8) +YF +NF+CF, + (0x76<<8) +YF +NF+CF, + (0x77<<8) +YF +VF+NF+CF, + (0x78<<8) +YF +XF+VF+NF+CF, + (0x79<<8) +YF +XF +NF+CF, + (0x7A<<8) +YF+HF+XF +NF+CF, + (0x7B<<8) +YF+HF+XF+VF+NF+CF, + (0x7C<<8) +YF+HF+XF +NF+CF, + (0x7D<<8) +YF+HF+XF+VF+NF+CF, + (0x7E<<8) +YF+HF+XF+VF+NF+CF, + (0x7F<<8) +YF+HF+XF +NF+CF, + (0x80<<8)+SF +NF+CF, + (0x81<<8)+SF +VF+NF+CF, + (0x82<<8)+SF +VF+NF+CF, + (0x83<<8)+SF +NF+CF, + (0x84<<8)+SF +VF+NF+CF, + (0x85<<8)+SF +NF+CF, + (0x86<<8)+SF +NF+CF, + (0x87<<8)+SF +VF+NF+CF, + (0x88<<8)+SF +XF+VF+NF+CF, + (0x89<<8)+SF +XF +NF+CF, + (0x8A<<8)+SF +HF+XF +NF+CF, + (0x8B<<8)+SF +HF+XF+VF+NF+CF, + (0x8C<<8)+SF +HF+XF +NF+CF, + (0x8D<<8)+SF +HF+XF+VF+NF+CF, + (0x8E<<8)+SF +HF+XF+VF+NF+CF, + (0x8F<<8)+SF +HF+XF +NF+CF, + (0x90<<8)+SF +VF+NF+CF, + (0x91<<8)+SF +NF+CF, + (0x92<<8)+SF +NF+CF, + (0x93<<8)+SF +VF+NF+CF, + (0x94<<8)+SF +NF+CF, + (0x95<<8)+SF +VF+NF+CF, + (0x96<<8)+SF +VF+NF+CF, + (0x97<<8)+SF +NF+CF, + (0x98<<8)+SF +XF +NF+CF, + (0x99<<8)+SF +XF+VF+NF+CF, + (0x9A<<8)+SF +HF+XF+VF+NF+CF, + (0x9B<<8)+SF +HF+XF +NF+CF, + (0x9C<<8)+SF +HF+XF+VF+NF+CF, + (0x9D<<8)+SF +HF+XF +NF+CF, + (0x9E<<8)+SF +HF+XF +NF+CF, + (0x9F<<8)+SF +HF+XF+VF+NF+CF, + (0xA0<<8)+SF +YF +VF+NF+CF, + (0xA1<<8)+SF +YF +NF+CF, + (0xA2<<8)+SF +YF +NF+CF, + (0xA3<<8)+SF +YF +VF+NF+CF, + (0xA4<<8)+SF +YF +NF+CF, + (0xA5<<8)+SF +YF +VF+NF+CF, + (0xA6<<8)+SF +YF +VF+NF+CF, + (0xA7<<8)+SF +YF +NF+CF, + (0xA8<<8)+SF +YF +XF +NF+CF, + (0xA9<<8)+SF +YF +XF+VF+NF+CF, + (0xAA<<8)+SF +YF+HF+XF+VF+NF+CF, + (0xAB<<8)+SF +YF+HF+XF +NF+CF, + (0xAC<<8)+SF +YF+HF+XF+VF+NF+CF, + (0xAD<<8)+SF +YF+HF+XF +NF+CF, + (0xAE<<8)+SF +YF+HF+XF +NF+CF, + (0xAF<<8)+SF +YF+HF+XF+VF+NF+CF, + (0xB0<<8)+SF +YF +NF+CF, + (0xB1<<8)+SF +YF +VF+NF+CF, + (0xB2<<8)+SF +YF +VF+NF+CF, + (0xB3<<8)+SF +YF +NF+CF, + (0xB4<<8)+SF +YF +VF+NF+CF, + (0xB5<<8)+SF +YF +NF+CF, + (0xB6<<8)+SF +YF +NF+CF, + (0xB7<<8)+SF +YF +VF+NF+CF, + (0xB8<<8)+SF +YF +XF+VF+NF+CF, + (0xB9<<8)+SF +YF +XF +NF+CF, + (0xBA<<8)+SF +YF+HF+XF +NF+CF, + (0xBB<<8)+SF +YF+HF+XF+VF+NF+CF, + (0xBC<<8)+SF +YF+HF+XF +NF+CF, + (0xBD<<8)+SF +YF+HF+XF+VF+NF+CF, + (0xBE<<8)+SF +YF+HF+XF+VF+NF+CF, + (0xBF<<8)+SF +YF+HF+XF +NF+CF, + (0xC0<<8)+SF +VF+NF+CF, + (0xC1<<8)+SF +NF+CF, + (0xC2<<8)+SF +NF+CF, + (0xC3<<8)+SF +VF+NF+CF, + (0xC4<<8)+SF +NF+CF, + (0xC5<<8)+SF +VF+NF+CF, + (0xC6<<8)+SF +VF+NF+CF, + (0xC7<<8)+SF +NF+CF, + (0xC8<<8)+SF +XF +NF+CF, + (0xC9<<8)+SF +XF+VF+NF+CF, + (0xCA<<8)+SF +HF+XF+VF+NF+CF, + (0xCB<<8)+SF +HF+XF +NF+CF, + (0xCC<<8)+SF +HF+XF+VF+NF+CF, + (0xCD<<8)+SF +HF+XF +NF+CF, + (0xCE<<8)+SF +HF+XF +NF+CF, + (0xCF<<8)+SF +HF+XF+VF+NF+CF, + (0xD0<<8)+SF +NF+CF, + (0xD1<<8)+SF +VF+NF+CF, + (0xD2<<8)+SF +VF+NF+CF, + (0xD3<<8)+SF +NF+CF, + (0xD4<<8)+SF +VF+NF+CF, + (0xD5<<8)+SF +NF+CF, + (0xD6<<8)+SF +NF+CF, + (0xD7<<8)+SF +VF+NF+CF, + (0xD8<<8)+SF +XF+VF+NF+CF, + (0xD9<<8)+SF +XF +NF+CF, + (0xDA<<8)+SF +HF+XF +NF+CF, + (0xDB<<8)+SF +HF+XF+VF+NF+CF, + (0xDC<<8)+SF +HF+XF +NF+CF, + (0xDD<<8)+SF +HF+XF+VF+NF+CF, + (0xDE<<8)+SF +HF+XF+VF+NF+CF, + (0xDF<<8)+SF +HF+XF +NF+CF, + (0xE0<<8)+SF +YF +NF+CF, + (0xE1<<8)+SF +YF +VF+NF+CF, + (0xE2<<8)+SF +YF +VF+NF+CF, + (0xE3<<8)+SF +YF +NF+CF, + (0xE4<<8)+SF +YF +VF+NF+CF, + (0xE5<<8)+SF +YF +NF+CF, + (0xE6<<8)+SF +YF +NF+CF, + (0xE7<<8)+SF +YF +VF+NF+CF, + (0xE8<<8)+SF +YF +XF+VF+NF+CF, + (0xE9<<8)+SF +YF +XF +NF+CF, + (0xEA<<8)+SF +YF+HF+XF +NF+CF, + (0xEB<<8)+SF +YF+HF+XF+VF+NF+CF, + (0xEC<<8)+SF +YF+HF+XF +NF+CF, + (0xED<<8)+SF +YF+HF+XF+VF+NF+CF, + (0xEE<<8)+SF +YF+HF+XF+VF+NF+CF, + (0xEF<<8)+SF +YF+HF+XF +NF+CF, + (0xF0<<8)+SF +YF +VF+NF+CF, + (0xF1<<8)+SF +YF +NF+CF, + (0xF2<<8)+SF +YF +NF+CF, + (0xF3<<8)+SF +YF +VF+NF+CF, + (0xF4<<8)+SF +YF +NF+CF, + (0xF5<<8)+SF +YF +VF+NF+CF, + (0xF6<<8)+SF +YF +VF+NF+CF, + (0xF7<<8)+SF +YF +NF+CF, + (0xF8<<8)+SF +YF +XF +NF+CF, + (0xF9<<8)+SF +YF +XF+VF+NF+CF, + (0xFA<<8)+SF +YF+HF+XF+VF+NF+CF, + (0xFB<<8)+SF +YF+HF+XF +NF+CF, + (0xFC<<8)+SF +YF+HF+XF+VF+NF+CF, + (0xFD<<8)+SF +YF+HF+XF +NF+CF, + (0xFE<<8)+SF +YF+HF+XF +NF+CF, + (0xFF<<8)+SF +YF+HF+XF+VF+NF+CF, + (0x00<<8) +ZF +VF+NF+CF, + (0x01<<8) +NF+CF, + (0x02<<8) +NF+CF, + (0x03<<8) +VF+NF+CF, + (0x04<<8) +NF+CF, + (0x05<<8) +VF+NF+CF, + (0x06<<8) +VF+NF+CF, + (0x07<<8) +NF+CF, + (0x08<<8) +XF +NF+CF, + (0x09<<8) +XF+VF+NF+CF, + (0x0A<<8) +HF+XF+VF+NF+CF, + (0x0B<<8) +HF+XF +NF+CF, + (0x0C<<8) +HF+XF+VF+NF+CF, + (0x0D<<8) +HF+XF +NF+CF, + (0x0E<<8) +HF+XF +NF+CF, + (0x0F<<8) +HF+XF+VF+NF+CF, + (0x10<<8) +NF+CF, + (0x11<<8) +VF+NF+CF, + (0x12<<8) +VF+NF+CF, + (0x13<<8) +NF+CF, + (0x14<<8) +VF+NF+CF, + (0x15<<8) +NF+CF, + (0x16<<8) +NF+CF, + (0x17<<8) +VF+NF+CF, + (0x18<<8) +XF+VF+NF+CF, + (0x19<<8) +XF +NF+CF, + (0x1A<<8) +HF+XF +NF+CF, + (0x1B<<8) +HF+XF+VF+NF+CF, + (0x1C<<8) +HF+XF +NF+CF, + (0x1D<<8) +HF+XF+VF+NF+CF, + (0x1E<<8) +HF+XF+VF+NF+CF, + (0x1F<<8) +HF+XF +NF+CF, + (0x20<<8) +YF +NF+CF, + (0x21<<8) +YF +VF+NF+CF, + (0x22<<8) +YF +VF+NF+CF, + (0x23<<8) +YF +NF+CF, + (0x24<<8) +YF +VF+NF+CF, + (0x25<<8) +YF +NF+CF, + (0x26<<8) +YF +NF+CF, + (0x27<<8) +YF +VF+NF+CF, + (0x28<<8) +YF +XF+VF+NF+CF, + (0x29<<8) +YF +XF +NF+CF, + (0x2A<<8) +YF+HF+XF +NF+CF, + (0x2B<<8) +YF+HF+XF+VF+NF+CF, + (0x2C<<8) +YF+HF+XF +NF+CF, + (0x2D<<8) +YF+HF+XF+VF+NF+CF, + (0x2E<<8) +YF+HF+XF+VF+NF+CF, + (0x2F<<8) +YF+HF+XF +NF+CF, + (0x30<<8) +YF +VF+NF+CF, + (0x31<<8) +YF +NF+CF, + (0x32<<8) +YF +NF+CF, + (0x33<<8) +YF +VF+NF+CF, + (0x34<<8) +YF +NF+CF, + (0x35<<8) +YF +VF+NF+CF, + (0x36<<8) +YF +VF+NF+CF, + (0x37<<8) +YF +NF+CF, + (0x38<<8) +YF +XF +NF+CF, + (0x39<<8) +YF +XF+VF+NF+CF, + (0x3A<<8) +YF+HF+XF+VF+NF+CF, + (0x3B<<8) +YF+HF+XF +NF+CF, + (0x3C<<8) +YF+HF+XF+VF+NF+CF, + (0x3D<<8) +YF+HF+XF +NF+CF, + (0x3E<<8) +YF+HF+XF +NF+CF, + (0x3F<<8) +YF+HF+XF+VF+NF+CF, + (0x40<<8) +NF+CF, + (0x41<<8) +VF+NF+CF, + (0x42<<8) +VF+NF+CF, + (0x43<<8) +NF+CF, + (0x44<<8) +VF+NF+CF, + (0x45<<8) +NF+CF, + (0x46<<8) +NF+CF, + (0x47<<8) +VF+NF+CF, + (0x48<<8) +XF+VF+NF+CF, + (0x49<<8) +XF +NF+CF, + (0x4A<<8) +HF+XF +NF+CF, + (0x4B<<8) +HF+XF+VF+NF+CF, + (0x4C<<8) +HF+XF +NF+CF, + (0x4D<<8) +HF+XF+VF+NF+CF, + (0x4E<<8) +HF+XF+VF+NF+CF, + (0x4F<<8) +HF+XF +NF+CF, + (0x50<<8) +VF+NF+CF, + (0x51<<8) +NF+CF, + (0x52<<8) +NF+CF, + (0x53<<8) +VF+NF+CF, + (0x54<<8) +NF+CF, + (0x55<<8) +VF+NF+CF, + (0x56<<8) +VF+NF+CF, + (0x57<<8) +NF+CF, + (0x58<<8) +XF +NF+CF, + (0x59<<8) +XF+VF+NF+CF, + (0x5A<<8) +HF+XF+VF+NF+CF, + (0x5B<<8) +HF+XF +NF+CF, + (0x5C<<8) +HF+XF+VF+NF+CF, + (0x5D<<8) +HF+XF +NF+CF, + (0x5E<<8) +HF+XF +NF+CF, + (0x5F<<8) +HF+XF+VF+NF+CF, + (0x60<<8) +YF +VF+NF+CF, + (0x61<<8) +YF +NF+CF, + (0x62<<8) +YF +NF+CF, + (0x63<<8) +YF +VF+NF+CF, + (0x64<<8) +YF +NF+CF, + (0x65<<8) +YF +VF+NF+CF, + (0x66<<8) +YF +VF+NF+CF, + (0x67<<8) +YF +NF+CF, + (0x68<<8) +YF +XF +NF+CF, + (0x69<<8) +YF +XF+VF+NF+CF, + (0x6A<<8) +YF+HF+XF+VF+NF+CF, + (0x6B<<8) +YF+HF+XF +NF+CF, + (0x6C<<8) +YF+HF+XF+VF+NF+CF, + (0x6D<<8) +YF+HF+XF +NF+CF, + (0x6E<<8) +YF+HF+XF +NF+CF, + (0x6F<<8) +YF+HF+XF+VF+NF+CF, + (0x70<<8) +YF +NF+CF, + (0x71<<8) +YF +VF+NF+CF, + (0x72<<8) +YF +VF+NF+CF, + (0x73<<8) +YF +NF+CF, + (0x74<<8) +YF +VF+NF+CF, + (0x75<<8) +YF +NF+CF, + (0x76<<8) +YF +NF+CF, + (0x77<<8) +YF +VF+NF+CF, + (0x78<<8) +YF +XF+VF+NF+CF, + (0x79<<8) +YF +XF +NF+CF, + (0x7A<<8) +YF+HF+XF +NF+CF, + (0x7B<<8) +YF+HF+XF+VF+NF+CF, + (0x7C<<8) +YF+HF+XF +NF+CF, + (0x7D<<8) +YF+HF+XF+VF+NF+CF, + (0x7E<<8) +YF+HF+XF+VF+NF+CF, + (0x7F<<8) +YF+HF+XF +NF+CF, + (0x80<<8)+SF +NF+CF, + (0x81<<8)+SF +VF+NF+CF, + (0x82<<8)+SF +VF+NF+CF, + (0x83<<8)+SF +NF+CF, + (0x84<<8)+SF +VF+NF+CF, + (0x85<<8)+SF +NF+CF, + (0x86<<8)+SF +NF+CF, + (0x87<<8)+SF +VF+NF+CF, + (0x88<<8)+SF +XF+VF+NF+CF, + (0x89<<8)+SF +XF +NF+CF, + (0x8A<<8)+SF +HF+XF +NF+CF, + (0x8B<<8)+SF +HF+XF+VF+NF+CF, + (0x8C<<8)+SF +HF+XF +NF+CF, + (0x8D<<8)+SF +HF+XF+VF+NF+CF, + (0x8E<<8)+SF +HF+XF+VF+NF+CF, + (0x8F<<8)+SF +HF+XF +NF+CF, + (0x90<<8)+SF +VF+NF+CF, + (0x91<<8)+SF +NF+CF, + (0x92<<8)+SF +NF+CF, + (0x93<<8)+SF +VF+NF+CF, + (0x94<<8)+SF +NF+CF, + (0x95<<8)+SF +VF+NF+CF, + (0x96<<8)+SF +VF+NF+CF, + (0x97<<8)+SF +NF+CF, + (0x98<<8)+SF +XF +NF+CF, + (0x99<<8)+SF +XF+VF+NF+CF +}; + diff --git a/source/docs/Genesis_ROM_Format.txt b/source/docs/Genesis_ROM_Format.txt new file mode 100644 index 0000000..e69de29 diff --git a/source/docs/REALTEC Cart Mapper - description v1.txt b/source/docs/REALTEC Cart Mapper - description v1.txt new file mode 100644 index 0000000..e69de29 diff --git a/source/docs/changelog b/source/docs/changelog new file mode 100644 index 0000000..548139f --- /dev/null +++ b/source/docs/changelog @@ -0,0 +1,22 @@ + + [04/20/03] + - Modified 68000 emulator to prevent 'tas.b $mem' from writing data back + after a read (fixes Gargoyles). + - Fixed bug in 68000 emulator to swap order of words written for address + register indirect pre-decremented writes (fixes Jim Power graphics). + - Added support for 240-line displays (for Super Skidmarks). + - Rewrote part of the interrupt handling (fixes some raster effects). + - Removed sprite collision detection code (never really worked). + - Optimized sprite rendering inner loop. + + [04/13/03] + - Finished up memory map for VDP DMA V-bus reads. + - Fixed handling of 68000 writes to I/O chip at even addresses. + - Fixed bit 7 handling of control register in I/O chip. + - Finished up Z80 memory map. + - Added code to handle Genesis hardware lock-ups. + - Removed some faulty code from the 68000 memory map handlers. + + [03/22/03] + - Completed implementation of Z80 banked memory handlers. + diff --git a/source/docs/gamegenie.htm b/source/docs/gamegenie.htm new file mode 100644 index 0000000..a18121d --- /dev/null +++ b/source/docs/gamegenie.htm @@ -0,0 +1,235 @@ + + + GameGenie patches + + + + +
+

GameGenie Patching

+
+

  GameGenie was a device created by codemasters and galoob that +let you make cheats for games. It was plugged in the console like a normal +cartridge, and in its top the desired cartridge was plugged. These cheats are +possible because what GameGenie do is edit the RAM that stores values used by +the ROMs, setting these values to a constant that can be, for example, the +number of lifes you have!

+

  Genecyst was the first Genesis emulator to have support +for GameGenie then, with Kgen98, Steve Snake started to use this neat feature +in his great emulator. No ROM image of a GameGenie is necessary, as some may +imagine, to use them with console emulators, these programs themselves have a +built-in feature that acts like a GameGenie, writing the codes in the emulated +RAM.

+

  The GameGenie code consists of a eight-bytes long string, and +the valid characters are A, B, C, D, E, F, G, H, J, K, L, M, N, P, R, S, T, V, +W, X, Y, Z, 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9, all in uppercase. Each character +have a binary repressentation, which is 5-bits long.

+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CharValue
A00000
B00001
C00010
D00011
E00100
F00101
G00110
H00111
J01000
K01001
L01010
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CharValue
M01011
N01100
P01101
R01110
S01111
T10000
V10001
W10010
X10011
Y10100
Z10101
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CharValue
010110
110111
211000
311001
411010
511011
611100
711101
811110
911111
+
+
+

  The cheat code should be firstly converted directly using the +table above, and then the bits should be reordered. For example, the GameGenie +code SCRA-BJX0 is translated to:

+ + + + + + + + +
+ + + + +
Code:
Bits:
Id:
+
+ + + + + + + + + + +
SCRA
01111000100111000000
ijklmnopIJKLMNOPABCD
+
+ + + + +
-
-
-
+
+ + + + +
BJX0
00001010001001110110
EFGHdefghabcQRSTUVWX
+
+
+

  Then rearrange (using the id) as...

+ + + + + + + + +
+ + + +
Bits:
Id:
+
+ + + + + + + +
000000001001110001110110
ABCDEFGHIJKLMNOPQRSTUVWX
+
+ + + +
:
:
+
+ + + +
01010100 01111000
abcdefghijklmnop
+
+
+
+

  Which give us, in hexa, 009C76:5478. This means that +H5478 will be written at H009C76 memory offset.

+ + diff --git a/source/docs/gen-hw.txt b/source/docs/gen-hw.txt new file mode 100644 index 0000000..e69de29 diff --git a/source/docs/genvdp.txt b/source/docs/genvdp.txt new file mode 100644 index 0000000..e69de29 diff --git a/source/docs/io.htm b/source/docs/io.htm new file mode 100644 index 0000000..6b62f3d --- /dev/null +++ b/source/docs/io.htm @@ -0,0 +1,933 @@ +Sega Genesis I/O Chip and Peripherals + +

Sega Genesis I/O Chip and Peripherals

+By Charles MacDonald
+http://cgfm2.emuviews.com +
+ +

Contents

+ + + +

Overview

+

+ The I/O chip manages three 7-bit I/O ports. It also +provides an way for the CPU to read the state of several jumpers in the +system. Later versions of the Genesis hardware have the I/O chip +integrated into some of the other custom hardware, but they all +function identically. +

+ + +

Connector details

+

+ Ports A and B are male DB-9 connectors, while port C is +female. In the Genesis 2 and 3, there is no physical connector for port +C, but it can still be programmed and will respond like any other port. +(as if no gamepad was connected) Here are the pin assignments: +

+ +
    Pin 1 : D0
+    Pin 2 : D1
+    Pin 3 : D2
+    Pin 4 : D3
+    Pin 5 : +5V
+    Pin 6 : TL
+    Pin 7 : TH
+    Pin 8 : Ground
+    Pin 9 : TR
+
+ + +

CPU interface

+ +

+ The I/O chip is connected to the 68000 and Z80. When in +Mark-III compatibility mode, the I/O chip has a different set of +registers which mimic those of the SMS, which will not be discussed +here. +

+ The I/O chip is mapped to $A10000-$A1001F in the 68000/VDP/Z80 banked address space. + It is normally read and written in byte units at odd addresses. + The chip gets /LWR only, so writing to even addresses has no effect. + + Reading even addresses returns the same data you'd get from an odd address. + If a word-sized write is done, the LSB is sent to the I/O chip and the MSB is ignored. + Here are some examples to illustrate these points: +

    ; Does nothing, byte writes to even addresses are ignored
+    move.b  #$40, $A10002
+
+    ; Returns contents of version register, reading even addresses is the same as reading odd ones
+    move.b $A10000, d0
+
+    ; Same as writing #$40 to $A10007, the MSB is ignored
+    move.w #$C040, $A10006
+
+

+ + +

Register list

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AddressDescription
$A10001Version
$A10003Port A data
$A10005Port B data
$A10007Port C data
$A10009Port A control
$A1000BPort B control
$A1000DPort C control
$A1000FPort A TxData
$A10011Port A RxData
$A10013Port A serial control
$A10015Port B TxData
$A10017Port B RxData
$A10019Port B serial control
$A1001BPort C TxData
$A1001DPort C RxData
$A1001FPort C serial control
+ + +

Version register

+

+ The version register returns several types of +information, such as a hard-coded version number, settings of the +domestic/export and PAL/NTSC jumpers, and the state of a sense pin +which the Sega CD uses.

    D7 : Console is 1= Export (USA, Europe, etc.) 0= Domestic (Japan)
+    D6 : Video type is 1= PAL, 0= NTSC
+    D5 : Sega CD unit is 1= not present, 0= connected.
+    D4 : Unused (always returns zero)
+    D3 : Bit 3 of version number
+    D2 : Bit 2 of version number
+    D1 : Bit 1 of version number
+    D0 : Bit 0 of version number
+
+ + Bit 5 is used by the Sega CD, returning '0' when it is attached and '1' when it is not. + +

+ The version number is zero for the original model Genesis and MegaDrive. + All later versions of the hardware are version 1, and have additional security hardware. + +

+ Bits 7,6 are used in country protection checks. Some early games used + them to display English or Japanese text, so the same game program could + be used in both regions. Here's a list of settings: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bit 7Bit 6TV typeRegionComments
00NTSCJapan, Korea, Taiwan262 lines, 60 FPS
01PALJapanNo hardware actually uses this setting
10NTSCUSA, Canada262 lines, 60 FPS
10PAL-MBrazil262 lines, 60 FPS
11PALEurope, Hong Kong313 lines, 50 FPS
+ +

+ Early games stored a region compatibility code in their +header at offset $0001F1. This value could be the ASCII text J, U, or E +for Japan, USA or Europe. During game initialization, bits 7,6 could be +sampled and compared to the region type stored in the header. If there +is a mismatch, many games will fill the screen with a single color lock +up intentionally, or sometimes display an error message.

+ Later games have a slightly more complex code. + Here's the table Sega uses to determine valid codes to use: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
$A10001 Main Sales TerritoriesHardware Enable Code (numbers from 0 to F below)
Bit 7Bit 6Hardware Type0123456789ABCDEF
00Japan, NTSCJapan, S. Korea, TaiwanXOXOXOXOXOXOXOXO
01Japan, PAL XXOOXXOOXXOOXXOO
10Overseas, NTSCN. America, BrazilXXXXOOOOXXXXOOOO
11Overseas, PALEurope, Hong KongXXXXXXXXOOOOOOOO
+ +

+ Common uses of the new code type are ASCII values '4' for N.America, 'A' for UK, and 'B' for UK and Japan. +

+ + + +

Data register

+

+ Writing to the data register sets the logic level of +pins configured as outputs (0= 0V, 1= +5V), and does nothing to pins +configured as inputs. Reading from the data register returns the state +of each pin. Here's a list of which bits in the data register +correspond to pins on the I/O port. +

    D7 : Unused. This bit will return any value written to it
+    D6 : TH pin
+    D5 : TR pin
+    D4 : TL pin
+    D3 : D3 pin
+    D2 : D2 pin
+    D1 : D1 pin
+    D0 : D0 pin
+
+ + If a pin is configured as an input, reading it returns +the true logic state of whatever the pin is connected to (e.g. 0 for +ground, 1 for +5V). If nothing is connected to it, the pin returns '1', +maybe due to internal pull-up resistors. +

+ If a pin is configured as an output, reading it returns the last value written to this register. +

+ + +

Control register

+

+ The control register determines which pins are inputs and outputs. + +

    D7 : /HL output control (see description)
+    D6 : TH pin is 1=output, 0=input
+    D5 : TR pin is 1=output, 0=input
+    D4 : TL pin is 1=output, 0=input
+    D3 : D3 pin is 1=output, 0=input
+    D2 : D2 pin is 1=output, 0=input
+    D1 : D1 pin is 1=output, 0=input
+    D0 : D0 pin is 1=output, 0=input
+
+ + If bit 7 of this register is set, and TH is configured as an input, + then whenever external hardware makes high to low transition on TH + the I/O chip will strobe it's /HL output pin low. This pin connects to + the VDP, which can be set up to latch the HV counter and/or cause a level 2 + interrupt upon /HL going low. +

+ + +

Serial control register

+

+ The serial control register defines how a port is used for serial + communications and provides status flags to indicate the current state + of sending or receiving data. + +

    D7 : Serial baud rate bit 1
+    D6 : Serial baud rate bit 0
+    D5 : TR pin functions as 1= serial input pin, 0= normal
+    D4 : TL pin functions as 1= serial output pin, 0= normal
+    D3 : 1= Make I/O chip strobe /HL low when a byte has been received, 0= Do nothing
+    D2 : 1= Error receiving current byte, 0= No error
+    D1 : 1= Rxd buffer is ready to read, 0= Rxd buffer isn't ready
+    D0 : 1= Txd buffer is full, 0= Can write to Txd buffer
+
+ + The available baud rates are: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
D7D6Baud rate
004800 bps
012400 bps
101200 bps
11300 bps
+ +

+ When doing serial communication, TL and/or TR can be used for sending + and receiving data. During this time the data and control registers + have no effect for whichever pin(s) are in serial mode. The rest of the + pins in the same port function normally. + +

The intended use of bit 3 is to also have the VDP set up to +enable level 2 interrupts when /HL goes low. This way, when the I/O +chip receives a byte through the TR pin, if this bit is set then it +will strobe /HL low and cause an interrupt. So receiving data serially +can either be accomplished through manual polling or be interrupt +driven. +

+ Bits 2-0 are read-only status flags, the rest of the bits in this register can be read and written. +

+ + + +

TxData register

+

+ Writing a byte to this register will make the I/O chip +output the data serially through the TL pin, providing it was +configured for serial mode. You should poll bit 0 of the serial control +register until the bit returns 0 to ensure the previously written byte +has been sent and the TxData buffer is empty. +

+ + +

RxData register

+

+ Reading from this register returns the last byte +received serially through the TR pin. You should check bits 3,2 of the +serial control register to ensure that the RxData input buffer is full +and that there were no errors in receiving the byte (which would then +be invalid). +

+ + +

Using serial communication

+

+ When in serial mode, the I/O ports output TTL-level +signals. You need something like a MAX232 line driver to convert these +to RS-232 compatible signals for interfacing with (for example) a PC. +

If you just want to do experiments on the serial ports +themselves, you can use a null modem cable with the TL/TR wires +switched around to connect port A to B. I used this for testing the +serial capabilities while writing this document. Be sure to disconnect +the +5V line as well. +

+ + +

Peripheral devices

+ + + + +

2-button Mark-III gamepad

+

+ This controller has a 4-way direction pad, and two buttons (2 and 1). + Here's a description of how the controller interfaces with an I/O port: + +

    D6 : (TH) Not used
+    D5 : (TR) Button 2
+    D4 : (TL) Button 1
+    D3 : (D3) D-pad Right
+    D2 : (D2) D-pad Left
+    D1 : (D1) D-pad Down
+    D0 : (D0) D-pad Up
+
+ + All buttons are active-low logic, so they return '0' when pressed and '1' when released. +

+ + +

3-button standard gamepad

+

+ This controller has a 4-way direction pad, and four buttons (Start, A, B, C). + It uses a multiplexer that selects 1 of 2 inputs using TH, and routes buttons Start or C to TR, and B or A to TL. + +

+ Here's a description of how the controller interfaces with an I/O port: + +

                When TH=0          When TH=1
+    D6 : (TH)   0                  1
+    D5 : (TR)   Start button       Button C
+    D4 : (TL)   Button A           Button B
+    D3 : (D3)   0                  D-pad Right
+    D2 : (D2)   0                  D-pad Left
+    D1 : (D1)   D-pad Down         D-pad Down
+    D0 : (D0)   D-pad Up           D-pad Up
+
+ + All buttons are active-low logic, so they return '0' when pressed and '1' when released. + +

You need a small delay between changing TH and reading the +button state back, as the multiplexer takes some time in switching +inputs. I've found about four NOPs provides a reasonable delay. +

+ Here's some example code to read a 3-button gamepad: +

+ +
; Returns D0 with the button states: 'SACBRLDU'
+_read_joypad:
+                        move.l  d1, -(a7)
+                        move.b  #$40, $A10003
+                        nop
+                        nop
+                        move.b  $A10003, d0
+                        andi.b  #$3F, d0
+                        move.b  #$00, $A10003
+                        nop
+                        nop
+                        move.b  $A10003, d1
+                        lsl.b   #2, d1
+                        andi.b  #$C0, d1
+                        or.b    d1, d0
+                        eori.b  #$FF, d0
+                        move.l  (a7)+, d1
+                        rts
+
+ + +

Fighting Pad 6B

+

+ Information coming soon. +

+ + +

Lightguns (Sega Menacer, Konami Justifier)

+

+ Information coming soon. +

+ + +

EA 4-Way Play

+

+ The EA 4-Way Play plugs into ports A and B, and allows up to four standard Genesis controllers to be connected at once. + +

I've determined how the multitap works by examining the +joystick reading code from NHL '95 and trying the same routine on a +new-style Sega Team Player in 'EXTRA' mode. That said, the actual EA +4-Way Play could have some differences that Sega's compatibility mode +doesn't take care of. +

To detect the multitap, set CTRL1 to 0x40, CTRL2 to 0x7F and +DATA2 to $7C. Reading the lower 2 bits of DATA1 will return zero if the +multitap is present. Usually these bits return 0x03 if there is no tap, +no controller, or the Sega Team Player isn't in EXTRA mode, but this +could be a behavior specific to the Team Player. +

+ To read the pads, write 0x0C, 0x1C, 0x2C, or 0x3C to DATA2 to select the controller in port A, B, C, or D. + You can then use DATA1/CTRL1 to read the pad state just like polling a regular 3-button pad in port A. + +

+ Here's some example code to use the EA 4-Way Play: +

+ +
; Returns D0 == 0 if the multitap is present, or D0 != 0 if it isn't
+_detect_4wayplay:
+                        move.b  #$40, $A10009
+                        nop
+                        move.b  #$7F, $A1000B
+                        nop
+                        move.b  #$7C, $A10005
+                        nop
+                        moveq   #0, d0
+                        move.b  $A10003, d0
+                        andi.b  #$03, d0
+                        rts
+
+; Returns the state of all four 3-button gamepads in D0
+_read_4wayplay:
+                        move.l  d1-d3/a0, -(a7)
+                        lea     $A10000, a0
+                        move.l  #$0C1C2C3C, d2
+                        moveq   #$03, d3
+        poll:           move.b  d2, $05(a0)
+                        nop
+                        nop
+                        move.b  #$40, $03(a0)
+                        nop
+                        nop
+                        move.b  $A10003, d0
+                        andi.b  #$3F, d0
+                        move.b  #$00, $03(a0)
+                        nop
+                        nop
+                        move.b  $03(a0), d1
+                        lsl.b   #2, d1
+                        andi.b  #$C0, d1
+                        or.b    d1, d0
+                        lsl.l   #8, d0
+                        lsr.l   #8, d2
+                        dbra    d3, poll
+                        eori.l  #-1, d0
+                        move.l  (a7)+, d2-d3/a0
+                        rts
+
+ + + +

Sega Team Player

+

+ The Team Player is a multitap device that allows four peripherals to be connected to the Genesis at one time. + It has a mode select switch with several settings: +

    EXTRA - All four ports are enabled. This is the setting used by
+            EA 4-Way Play compatible games.
+        A - Routes the peripheral in port A to port A of the Genesis.
+        B - Routes the peripheral in port B to port A of the Genesis.
+        C - Routes the peripheral in port C to port A of the Genesis.
+        D - Routes the peripheral in port D to port A of the Genesis.
+    MULTI - All four ports are enabled. This is the setting used by
+            Team Player compatible games.
+
+ Sega made two versions of the Team Player. The first one +was not compatible with the EA 4-Way Play and only had one cable to +connect it to port A. The second one added the "EXTRA" setting for EA +4-Way Play compatibility and provides a second cable to connect it to +port B as well. Both seem to function identically with the exception of +EXTRA mode. +

+ I don't have any programming information for this device. +

+ + +

Sega Mega Mouse

+

+ This is a three button mouse (left, middle, right) with an extra button + (Start) located near the thumb position. It uses a PIC16C54 microcontroller + which manages the buttons and position tracking. + +

+ The Sega Mega Mouse that is distributed in North America is incompatible with the European version of Populous 2. + The mouse functions normally but has Y axis inverted so up is down and vice-versa. + It may have been designed for the Japanese Mega Drive mouse, which is a different product with 2 buttons and unique physical appearance. + +

+ The protocol works as follows: + TH and TR are outputs which tell the microcontroller to stop or start a data transfer, and to acknowledge received data. + TL is an input which returns a busy flag for the microcontroller. + D3-D0 are inputs that return the data. + Here's a table showing the communication process: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
WriteTHTRTLD3D2D1D0Description
$601110000Request data
$200110000ID #0 ($0)
$000011011ID #1 ($B)
$200101111ID #2 ($F)
$000011111ID #3 ($F)
$20010Y OverX OverY SignX SignAxis sign and overflow
$00001StartMiddleRightLeftButton state
$20010X7X6X5X4X axis MSN
$00001X3X2X1X0X axis LSN
$20010Y7Y6Y5Y4Y axis MSN
$00001Y3Y2Y1Y0Y axis LSN
+ +

+ Write #$60 when you are done polling to stop the data +transfer. If you continue to poll the mouse after collecting all the +data by writing $20 / $00, the Y axis LSN will always be returned. Sega +advises polling beyond this point will make the mouse behave +abnormally. It's possible that the PIC code in some versions of the +Mega Mouse may have problems if the poll sequence is too long. +

+ The X/Y overflow flags are supposed to be set if the mouse is moved over a distance greater than can be measured. + I can't get them to become set, maybe the mouse supports a fairly wide range of movement. + + +

You need a considerable delay between writing new values to +TH/TR. I think the intention is to poll TL until the microcontroller +returns 'not busy', but I can't get this to work reliably. Sega's mouse +reading code also has a timeout when checking TL which would indicate +it may get stuck in a certain state. +

+ All buttons (start, left, middle, right) are active-high logic, so they return '1' when pressed and '0' when released. +

+ + +

Miscellaneous

+

+ After power-up, the default state of the I/O chip are as follows: +

    $A10001 = $80 (Bits 7,6,5 depend on the domestic/export, PAL/NTSC jumpers and having a Sega CD or not)
+    $A10003 = $7F
+    $A10005 = $7F
+    $A10007 = $7F
+    $A10009 = $00
+    $A1000B = $00
+    $A1000D = $00
+    $A1000F = $FF
+    $A10011 = $00
+    $A10013 = $00
+    $A10015 = $FF
+    $A10017 = $00
+    $A10019 = $00
+    $A1001B = $FB
+    $A1001D = $00
+    $A1001F = $00
+
+

+ + +

Disclaimer

+
 If you use any information from this document, please credit me
+ (Charles MacDonald) and optionally provide a link to my webpage
+ (http://cgfm2.emuviews.com/) so interested parties can access it.
+
+ The credit text should be present in the accompanying documentation of
+ whatever project which used the information, or even in the program
+ itself (e.g. an about box)
+
+ Regarding distribution, you cannot put this document on another
+ website, nor link directly to it.
+
+ +
+ + \ No newline at end of file diff --git a/source/docs/license b/source/docs/license new file mode 100644 index 0000000..60549be --- /dev/null +++ b/source/docs/license @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/source/docs/m5hvc.txt b/source/docs/m5hvc.txt new file mode 100644 index 0000000..e69de29 diff --git a/source/docs/porting.txt b/source/docs/porting.txt new file mode 100644 index 0000000..e69de29 diff --git a/source/docs/readme.txt b/source/docs/readme.txt new file mode 100644 index 0000000..e69de29 diff --git a/source/docs/ssf2tnc.txt b/source/docs/ssf2tnc.txt new file mode 100644 index 0000000..e69de29 diff --git a/source/docs/todo.txt b/source/docs/todo.txt new file mode 100644 index 0000000..e69de29 diff --git a/source/eeprom.c b/source/eeprom.c new file mode 100644 index 0000000..7038605 --- /dev/null +++ b/source/eeprom.c @@ -0,0 +1,445 @@ +#include "shared.h" +#include "rominfo.h" + +#define GAME_COUNT 21 + +typedef struct +{ + char game_id[14]; + uint16 chk; + T_EEPROM_TYPE type; +} T_GAME_ENTRY; + +T_GAME_ENTRY database[GAME_COUNT] = +{ + /* ACCLAIM mappers */ + /* 24C02 (old mapper) */ + {{"T-081326" }, 0, {8, 0xFF, 0xFF, 0x200000, 0x200000, 0x200000, 0, 1, 1}}, /* NBA Jam (UE) */ + {{"T-81033" }, 0, {8, 0xFF, 0xFF, 0x200000, 0x200000, 0x200000, 0, 1, 1}}, /* NBA Jam (J) */ + /* 24C02 */ + {{"T-81406" }, 0, {8, 0xFF, 0xFF, 0x200001, 0x200001, 0x200000, 0, 0, 0}}, /* NBA Jam TE */ + {{"T-081276" }, 0, {8, 0xFF, 0xFF, 0x200001, 0x200001, 0x200000, 0, 0, 0}}, /* NFL Quarterback Club */ + /* 24C16 */ + {{"T-081586" }, 0, {8, 0x7FF, 0x7FF, 0x200001, 0x200001, 0x200000, 0, 0, 0}}, /* NFL Quarterback Club '96 */ + /* 24C65 */ + {{"T-81576" }, 0, {16, 0x1FFF, 0x1FFF, 0x200001, 0x200001, 0x200000, 0, 0, 0}}, /* College Slam */ + {{"T-81476" }, 0, {16, 0x1FFF, 0x1FFF, 0x200001, 0x200001, 0x200000, 0, 0, 0}}, /* Frank Thomas Big Hurt Baseball */ + + /* EA mapper (24C01 only) */ + {{"T-50396" }, 0, {7, 0x7F, 0x7F, 0x200000, 0x200000, 0x200000, 7, 7, 6}}, /* NHLPA Hockey 93 (UE) */ + {{"T-50176" }, 0, {7, 0x7F, 0x7F, 0x200000, 0x200000, 0x200000, 7, 7, 6}}, /* Rings of Power */ + + /* SEGA mapper (24C01 only) */ + {{"T-12046" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 0, 0, 1}}, /* Megaman - The Wily Wars */ + {{"T-12053" }, 0xEA80, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 0, 0, 1}}, /* Rockman Mega World (J) [A] */ + {{"MK-1215" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 0, 0, 1}}, /* Evander 'Real Deal' Holyfield's Boxing */ + {{"MK-1228" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 0, 0, 1}}, /* Greatest Heavyweights of the Ring (U) */ + {{"G-5538" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 0, 0, 1}}, /* Greatest Heavyweights of the Ring (J) */ + {{"PR-1993" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 0, 0, 1}}, /* Greatest Heavyweights of the Ring (E) */ + {{"G-4060" }, 0, {7, 0x7F, 0x7F, 0x200001, 0x200001, 0x200001, 0, 0, 1}}, /* Wonderboy in Monster World */ + + /* CODEMASTERS mapper */ + /* 24C08 */ + {{"T-120096" }, 0, {8, 0x3FF, 0x3FF, 0x300000, 0x380001, 0x300000, 0, 7, 1}}, /* Micro Machines 2 - Turbo Tournament (E) */ + {{"00000000-00"}, 0x168B, {8, 0x3FF, 0x3FF, 0x300000, 0x380001, 0x300000, 0, 7, 1}}, /* Micro Machines Military */ + {{"00000000-00"}, 0xCEE0, {8, 0x3FF, 0x3FF, 0x300000, 0x380001, 0x300000, 0, 7, 1}}, /* Micro Machines Military (Bad)*/ + /* 24C16 */ + {{"00000000-00"}, 0x165E, {8, 0x7FF, 0x7FF, 0x300000, 0x380001, 0x300000, 0, 7, 1}}, /* Micro Machines Turbo Tournament 96 */ + {{"00000000-00"}, 0x2C41, {8, 0x7FF, 0x7FF, 0x300000, 0x380001, 0x300000, 0, 7, 1}} /* Micro Machines Turbo Tournament 96 (Bad)*/ +}; + + +T_EEPROM eeprom; + +void EEPROM_Init() +{ + uint8 i = 0; + + /* initialize eeprom */ + memset(&eeprom, 0, sizeof(T_EEPROM)); + eeprom.sda = eeprom.old_sda = 1; + eeprom.scl = eeprom.old_scl = 1; + eeprom.state = STAND_BY; + + sram.custom = 0; + + /* look into game database */ + while ((i eeprom.type.sda_out_adr) sram.start = eeprom.type.sda_out_adr; + if (sram.start > eeprom.type.scl_adr) sram.start = eeprom.type.scl_adr; + } + else if ((sram.end - sram.start) < 2) + { + /* Game not found in database but header indicates it uses EEPROM */ + sram.custom = 1; + sram.on = 1; + sram.write = 1; + + /* set SEGA mapper as default */ + memcpy(&eeprom.type, &database[9].type, sizeof(T_EEPROM_TYPE)); + } +} + +static void Detect_START() +{ + if (eeprom.old_scl && eeprom.scl) + { + if (eeprom.old_sda && !eeprom.sda) + { + eeprom.cycles = 0; + eeprom.slave_mask = 0; + if (eeprom.type.address_bits == 7) + { + eeprom.word_address = 0; + eeprom.state = GET_WORD_ADR_7BITS; + } + else eeprom.state = GET_SLAVE_ADR; + } + } +} + +static void Detect_STOP() +{ + if (eeprom.old_scl && eeprom.scl) + { + if (!eeprom.old_sda && eeprom.sda) + { + eeprom.state = STAND_BY; + } + } +} + +void EEPROM_Write(unsigned int address, unsigned int value) +{ + uint16 sram_address = 0; + + /* decode SCL and SDA value */ + if (eeprom.type.sda_in_adr == address) eeprom.sda = (value >> eeprom.type.sda_in_bit) & 1; + else eeprom.sda = eeprom.old_sda; + if (eeprom.type.scl_adr == address) eeprom.scl = (value >> eeprom.type.scl_bit) & 1; + else eeprom.scl = eeprom.old_scl; + + /* EEPROM current state */ + switch (eeprom.state) + { + /* Standby Mode */ + case STAND_BY: + Detect_START(); + Detect_STOP(); + break; + + + /* Suspended Mode */ + case WAIT_STOP: + Detect_STOP(); + break; + + + /* Get Word Address 7 bits: MODE-1 only (24C01) + * and R/W bit + */ + case GET_WORD_ADR_7BITS: + Detect_START(); + Detect_STOP(); + + /* look for SCL LOW to HIGH transition */ + if (!eeprom.old_scl && eeprom.scl) + { + if (eeprom.cycles == 0) eeprom.cycles ++; + } + + + /* look for SCL HIGH to LOW transition */ + if (eeprom.old_scl && !eeprom.scl && (eeprom.cycles > 0)) + { + if (eeprom.cycles < 8) eeprom.word_address |= (eeprom.old_sda << (7 - eeprom.cycles)); + else if (eeprom.cycles == 8) eeprom.rw = eeprom.old_sda; + else + { /* ACK CYCLE */ + eeprom.cycles = 0; + eeprom.word_address &= eeprom.type.size_mask; + eeprom.state = eeprom.rw ? READ_DATA : WRITE_DATA; + } + + eeprom.cycles ++; + } + break; + + + /* Get Slave Address (3bits) : MODE-2 & MODE-3 only (24C01 - 24C512) (0-3bits, depending on the array size) + * or/and Word Address MSB: MODE-2 only (24C04 - 24C16) (0-3bits, depending on the array size) + * and R/W bit + */ + case GET_SLAVE_ADR: + + Detect_START(); + Detect_STOP(); + + /* look for SCL LOW to HIGH transition */ + if (!eeprom.old_scl && eeprom.scl) + { + if (eeprom.cycles == 0) eeprom.cycles ++; + } + + /* look for SCL HIGH to LOW transition */ + if (eeprom.old_scl && !eeprom.scl && (eeprom.cycles > 0)) + { + if ((eeprom.cycles > 4) && (eeprom.cycles <8)) + { + if ((eeprom.type.address_bits == 16) || + (eeprom.type.size_mask < (1 << (15 - eeprom.cycles)))) + { + /* this is a SLAVE ADDRESS bit */ + eeprom.slave_mask |= (eeprom.old_sda << (7 - eeprom.cycles)); + } + else + { + /* this is a WORD ADDRESS high bit */ + if (eeprom.old_sda) eeprom.word_address |= (1 << (15 - eeprom.cycles)); + else eeprom.word_address &= ~(1 << (15 - eeprom.cycles)); + } + } + else if (eeprom.cycles == 8) eeprom.rw = eeprom.old_sda; + else if (eeprom.cycles > 8) + { + /* ACK CYCLE */ + eeprom.cycles = 0; + if (eeprom.type.address_bits == 16) + { + /* two ADDRESS bytes */ + eeprom.state = eeprom.rw ? READ_DATA : GET_WORD_ADR_HIGH; + eeprom.slave_mask <<= 16; + } + else + { + /* one ADDRESS byte */ + eeprom.state = eeprom.rw ? READ_DATA : GET_WORD_ADR_LOW; + eeprom.slave_mask <<= 8; + } + } + + eeprom.cycles ++; + } + break; + + /* Get Word Address MSB (4-8bits depending on the array size) + * MODE-3 only (24C32 - 24C512) + */ + case GET_WORD_ADR_HIGH: + + Detect_START(); + Detect_STOP(); + + /* look for SCL HIGH to LOW transition */ + if (eeprom.old_scl && !eeprom.scl) + { + if (eeprom.cycles < 9) + { + if ((eeprom.type.size_mask + 1) < (1 << (17 - eeprom.cycles))) + { + /* ignored bit: slave mask should be right-shifted by one */ + eeprom.slave_mask >>= 1; + } + else + { + /* this is a WORD ADDRESS high bit */ + if (eeprom.old_sda) eeprom.word_address |= (1 << (16 - eeprom.cycles)); + else eeprom.word_address &= ~(1 << (16 - eeprom.cycles)); + } + + eeprom.cycles ++; + } + else + { + /* ACK CYCLE */ + eeprom.cycles = 1; + eeprom.state = GET_WORD_ADR_LOW; + } + } + break; + + + /* Get Word Address LSB: 7bits (24C01) or 8bits (24C02-24C512) + * MODE-2 and MODE-3 only (24C01 - 24C512) + */ + case GET_WORD_ADR_LOW: + + Detect_START(); + Detect_STOP(); + + /* look for SCL HIGH to LOW transition */ + if (eeprom.old_scl && !eeprom.scl) + { + if (eeprom.cycles < 9) + { + if ((eeprom.type.size_mask + 1) < (1 << (9 - eeprom.cycles))) + { + /* ignored bit (X24C01): slave mask should be right-shifted by one */ + eeprom.slave_mask >>= 1; + } + else + { + /* this is a WORD ADDRESS high bit */ + if (eeprom.old_sda) eeprom.word_address |= (1 << (8 - eeprom.cycles)); + else eeprom.word_address &= ~(1 << (8 - eeprom.cycles)); + } + + eeprom.cycles ++; + } + else + { + /* ACK CYCLE */ + eeprom.cycles = 1; + eeprom.word_address &= eeprom.type.size_mask; + eeprom.state = WRITE_DATA; + } + } + break; + + + /* + * Read Cycle + */ + case READ_DATA: + + Detect_START(); + Detect_STOP(); + + /* look for SCL HIGH to LOW transition */ + if (eeprom.old_scl && !eeprom.scl) + { + if (eeprom.cycles < 9) eeprom.cycles ++; + else + { + eeprom.cycles = 1; + + /* ACK not received */ + if (eeprom.old_sda) eeprom.state = WAIT_STOP; + } + } + break; + + + /* + * Write Cycle + */ + case WRITE_DATA: + + Detect_START(); + Detect_STOP(); + + /* look for SCL HIGH to LOW transition */ + if (eeprom.old_scl && !eeprom.scl) + { + if (eeprom.cycles < 9) + { + /* Write DATA bits (max 64kBytes) */ + sram_address = (eeprom.slave_mask | eeprom.word_address) & 0xFFFF; + if (eeprom.old_sda) sram.sram[sram_address] |= (1 << (8 - eeprom.cycles)); + else sram.sram[sram_address] &= ~(1 << (8 - eeprom.cycles)); + + if (eeprom.cycles == 8) + { + /* WORD ADDRESS is incremented (roll up at maximum pagesize) */ + eeprom.word_address = (eeprom.word_address & (0xFFFF - eeprom.type.pagewrite_mask)) | + ((eeprom.word_address + 1) & eeprom.type.pagewrite_mask); + } + + eeprom.cycles ++; + } + else eeprom.cycles = 1; /* ACK cycle */ + } + break; + } + + eeprom.old_scl = eeprom.scl; + eeprom.old_sda = eeprom.sda; +} + + +unsigned int EEPROM_Read(unsigned int address) +{ + uint16 sram_address; + uint8 sda_out = eeprom.sda; + + /* EEPROM state */ + switch (eeprom.state) + { + case READ_DATA: + if (eeprom.cycles < 9) + { + /* Return DATA bits (max 64kBytes) */ + sram_address = (eeprom.slave_mask | eeprom.word_address) & 0xFFFF; + sda_out = (sram.sram[sram_address] >> (8 - eeprom.cycles)) & 1; + + if (eeprom.cycles == 8) + { + /* WORD ADDRESS is incremented (roll up at maximum array size) */ + eeprom.word_address ++; + eeprom.word_address &= eeprom.type.size_mask; + } + } + break; + + case GET_WORD_ADR_7BITS: + case GET_SLAVE_ADR: + case GET_WORD_ADR_HIGH: + case GET_WORD_ADR_LOW: + case WRITE_DATA: + if (eeprom.cycles == 9) sda_out = 0; + break; + + default: + break; + } + + if (address == eeprom.type.sda_out_adr) return (sda_out << eeprom.type.sda_out_bit); + else return 0; +} diff --git a/source/eeprom.h b/source/eeprom.h new file mode 100644 index 0000000..0c0abd6 --- /dev/null +++ b/source/eeprom.h @@ -0,0 +1,64 @@ +/* this defines the type of EEPROM inside the game cartridge as Backup RAM + * Here are some notes from 8BitWizard (http://www.spritesmind.net/_GenDev/forum): + * + * Mode 1 (7-bit) - the chip takes a single byte with a 7-bit memory address and a R/W bit (24C01) + * Mode 2 (8-bit) - the chip takes a 7-bit device address and R/W bit followed by an 8-bit memory address; + * the device address may contain up to three more memory address bits (24C01 - 24C16). + * You can also string eight 24C01, four 24C02, two 24C08, or various combinations, set their address config lines correctly, + * and the result appears exactly the same as a 24C16 + * Mode 3 (16-bit) - the chip takes a 7-bit device address and R/W bit followed by a 16-bit memory address (24C32 and larger) + * + * Also, while most 24Cxx are addressed at 200000-2FFFFF, I have found two different ways of mapping the control lines. + * EA uses SDA on D7 (read/write) and SCL on D6 (write only), and I have found boards using different mapping (I think Accolade) + * which uses D1-read=SDA, D0-write=SDA, D1-write=SCL. Accolade also has a custom-chip mapper which may even use a third method. + */ + +typedef struct +{ + uint8 address_bits; /* number of bits needed to address the array: 7, 8 or 16 */ + uint16 size_mask; /* size of the array (in bytes) - 1 */ + uint16 pagewrite_mask; /* maximal number of bytes that can be written in a single write cycle - 1*/ + uint32 sda_in_adr; /* 68k address used by SDA_IN signal */ + uint32 sda_out_adr; /* 68k address used by SDA_OUT signal */ + uint32 scl_adr; /* address used by SCL signal */ + uint8 sda_in_bit; /* position of the SDA_IN bit */ + uint8 sda_out_bit; /* position of the SDA_OUT bit */ + uint8 scl_bit; /* position of the SCL bit */ + +} T_EEPROM_TYPE; + +typedef enum +{ + STAND_BY = 0, + WAIT_STOP, + GET_SLAVE_ADR, + GET_WORD_ADR_7BITS, + GET_WORD_ADR_HIGH, + GET_WORD_ADR_LOW, + WRITE_DATA, + READ_DATA, + +} T_EEPROM_STATE; + +typedef struct +{ + uint8 sda; + uint8 scl; + uint8 old_sda; + uint8 old_scl; + uint8 cycles; + uint8 rw; + uint16 slave_mask; + uint16 word_address; + T_EEPROM_STATE state; + T_EEPROM_TYPE type; +} T_EEPROM; + +/* global variables */ +extern T_EEPROM eeprom; + +/* Function prototypes */ +extern void EEPROM_Init(); +extern void EEPROM_Write(unsigned int address, unsigned int value); +extern unsigned int EEPROM_Read(unsigned int address); + diff --git a/source/genesis.c b/source/genesis.c new file mode 100644 index 0000000..178313b --- /dev/null +++ b/source/genesis.c @@ -0,0 +1,184 @@ +/* + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "shared.h" + +uint8 *cart_rom; /* cart_rom NEED to be previously dynamically allocated */ +uint8 work_ram[0x10000]; /* 68K work RAM */ +uint8 zram[0x2000]; /* Z80 work RAM */ +uint8 zbusreq; /* /BUSREQ from Z80 */ +uint8 zreset; /* /RESET to Z80 */ +uint8 zbusack; /* /BUSACK to Z80 */ +uint8 zirq; /* /IRQ to Z80 */ +uint32 zbank; /* Address of Z80 bank window */ +uint8 gen_running; +uint32 lastbusreqcnt; +uint8 lastbusack; +uint32 genromsize; + +static int cpu_sync[512]; /* Z80-68K cycles synchronization table */ + +#ifdef LSB_FIRST +void bswap(uint8 *mem, int length) +{ + int i; + for(i = 0; i < length; i += 2) + { + uint8 temp = mem[i+0]; + mem[i+0] = mem[i+1]; + mem[i+1] = temp; + } +} +#endif + +/*--------------------------------------------------------------------------*/ +/* Init, reset, shutdown functions */ +/*--------------------------------------------------------------------------*/ + +void gen_init (void) +{ + int i; +#ifdef LSB_FIRST + bswap(cart_rom, genromsize); +#endif +#ifdef NGC + ShadowROM (); +#else + memcpy(shadow_rom,cart_rom,genromsize); +#endif + m68k_set_cpu_type (M68K_CPU_TYPE_68000); + m68k_pulse_reset (); + gen_running = 1; + for (i=0; i<512; i++) cpu_sync[i] = (int)(((double)i * 7.0) / 15.0); +} + +void gen_reset (void) +{ + /* Clear RAM */ + memset (work_ram, 0, sizeof (work_ram)); + memset (zram, 0, sizeof (zram)); + gen_running = 1; + zreset = 0; /* Z80 is reset */ + zbusreq = 0; /* Z80 has control of the Z bus */ + zbusack = 1; /* Z80 is busy using the Z bus */ + zbank = 0; /* Assume default bank is 000000-007FFF */ + zirq = 0; /* No interrupts occuring */ + lastbusreqcnt = 0; + lastbusack = 1; + + /* Reset the 68000 emulator */ + m68k_pulse_reset (); + z80_reset (0); + z80_set_irq_callback (z80_irq_callback); +} + +void gen_shutdown (void) +{ +} + +/*----------------------------------------------------------------------- + Bus controller chip functions + -----------------------------------------------------------------------*/ +int gen_busack_r (void) +{ + if (zbusack == 0) + { + if ((count_m68k + m68k_cycles_run() - lastbusreqcnt) > 16) + return 0; /* bus taken */ + else return (lastbusack&1); + } + else return 1; +} + +void gen_busreq_w (int state) +{ + int z80_cycles_to_run; + + input_raz (); + + if (state == 1) + { + /* Bus Request */ + lastbusreqcnt = count_m68k + m68k_cycles_run(); + lastbusack = zbusack; + if (zbusreq == 0) + { + /* Z80 stopped */ + /* z80 was ON during the last 68k cycles */ + /* we execute the appropriate number of z80 cycles */ + z80_cycles_to_run = aim_z80 - cpu_sync[aim_m68k - count_m68k -m68k_cycles_run()]; + if (z80_cycles_to_run > 0) z80_run(z80_cycles_to_run); + } + } + else + { + /* Bus released */ + if (zbusreq == 1) + { + /* Z80 started */ + /* z80 was OFF during the last 68k cycles */ + /* we burn the appropriate number of z80 cycles */ + z80_cycles_to_run = aim_z80 - cpu_sync[aim_m68k - count_m68k - m68k_cycles_run()]; + if (z80_cycles_to_run > 0) count_z80 = z80_cycles_to_run; + } + } + zbusreq = (state & 1); + zbusack = 1 ^ (zbusreq & zreset); +} + +void gen_reset_w (int state) +{ + zreset = (state & 1); + zbusack = 1 ^ (zbusreq & zreset); + + if (zreset == 0) + { + lastbusreqcnt = 0; + lastbusack = 1; + fm_reset(); + z80_reset (0); + z80_set_irq_callback (z80_irq_callback); + } +} + +void gen_bank_w (int state) +{ + zbank = ((zbank >> 1) | ((state & 1) << 23)) & 0xFF8000; +} + +int z80_irq_callback (int param) +{ + zirq = 0; + z80_set_irq_line (0, CLEAR_LINE); + return 0xFF; +} + +int vdp_int_ack_callback (int int_level) +{ + switch (int_level) + { + case 4: + hint_pending = 0; + vint_pending = 0; + break; + case 6: + vint_pending = 0; + break; + } + return M68K_INT_ACK_AUTOVECTOR; +} diff --git a/source/genesis.h b/source/genesis.h new file mode 100644 index 0000000..f425dc4 --- /dev/null +++ b/source/genesis.h @@ -0,0 +1,32 @@ + +#ifndef _GENESIS_H_ +#define _GENESIS_H_ + +/* Global variables */ +extern uint8 *cart_rom; +extern uint8 work_ram[0x10000]; +extern uint8 zram[0x2000]; +extern uint8 zbusreq; +extern uint8 zbusack; +extern uint8 zreset; +extern uint8 zirq; +extern uint32 zbank; +extern uint8 gen_running; +extern uint32 lastbusreqcnt; +extern uint8 lastbusack; +extern uint32 genromsize; + +/* Function prototypes */ +void gen_init(void); +void gen_reset(void); +void gen_shutdown(void); +int gen_busack_r(void); +void gen_busreq_w(int state); +void gen_reset_w(int state); +void gen_bank_w(int state); +void bswap(uint8 *mem, int length); +int z80_irq_callback(int param); +void m68k_irq_ack_callback(int int_level); + +#endif /* _GEN_H_ */ + diff --git a/source/hvc.h b/source/hvc.h new file mode 100644 index 0000000..8d41304 --- /dev/null +++ b/source/hvc.h @@ -0,0 +1,440 @@ + +#ifndef _HVC_H_ +#define _HVC_H_ + +/* V counter values for NTSC 192-line display */ +uint8 vc_ntsc_192[262] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5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 vc_ntsc_224[262] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, + 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, + 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, + 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, + 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF +}; + +/* V counter values for NTSC 240-line display */ +uint8 vc_ntsc_240[262] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C,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0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, + 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, + 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0x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D, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, + 0x100, 0x101, 0x102, + 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF +}; + +/* V counter values for PAL 240-line display */ +uint16 vc_pal_240[313] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, +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101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109, 0x10A, + 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, +}; + +/* + VDP timing for an NTSC Genesis in display mode 5. + Version 0.4 (11/29/00) + + by Charles MacDonald + WWW: http://cgfm2.emuviews.com + + Unpublished work Copyright 2000 Charles MacDonald + + Description 32-cell 40-cell + ---------------------------------------------------------------------------- + Range 00-93, E9-FF 00-B6, E4-FF + Display area 00-7F 00-9F + V counter increment 84, 85 A4, A5 + V-blanking in 86, 87 A7, A8 + V-blanking out 86, 87 A7, A8 + H-blanking in 93, E9 B2, E4 + H-blanking out 06, 07 06, 07 + + Comma seperated values show the H counter value before an event occurs, + and then the H counter value immediately after. + + These values shouldn't be considered 100% accurate, they are probably + off by one or two. + + Each H counter unit is equivalent to two pixels. + + The gaps at 93-E9 and B6-E4 are where the H counter 'jumps' ahead. + The H counter will never actually be set to the values 94-E8 or B7-E3. + Perhaps this is the horizontal retrace period. + + Interestingly enough, the timing values for the 32-cell display mode + are identical to that of the SMS. + + It would appear that in 40-cell mode, the horizontal blanking period + is shorter as the active display period takes more time. + + The V-blanking flag can also be forcibly set by disabling the display + through bit 6 of register #1. + +*/ + +/* +uint8 cycle2hc32[488] = { + 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, + 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x0A, 0x0A, 0x0A, + 0x0B, 0x0B, 0x0B, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x10, 0x10, + 0x10, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x14, 0x14, 0x15, 0x15, 0x15, 0x16, + 0x16, 0x16, 0x17, 0x17, 0x17, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, + 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x20, 0x20, 0x20, 0x21, + 0x21, 0x22, 0x22, 0x22, 0x23, 0x23, 0x23, 0x24, 0x24, 0x24, 0x25, 0x25, 0x25, 0x26, 0x26, 0x26, + 0x27, 0x27, 0x27, 0x28, 0x28, 0x29, 0x29, 0x29, 0x2A, 0x2A, 0x2A, 0x2B, 0x2B, 0x2B, 0x2C, 0x2C, + 0x2C, 0x2D, 0x2D, 0x2D, 0x2E, 0x2E, 0x2F, 0x2F, 0x2F, 0x30, 0x30, 0x30, 0x31, 0x31, 0x31, 0x32, + 0x32, 0x32, 0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35, 0x36, 0x36, 0x36, 0x37, 0x37, 0x37, + 0x38, 0x38, 0x38, 0x39, 0x39, 0x39, 0x3A, 0x3A, 0x3A, 0x3B, 0x3B, 0x3B, 0x3C, 0x3C, 0x3D, 0x3D, + 0x3D, 0x3E, 0x3E, 0x3E, 0x3F, 0x3F, 0x3F, 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, + 0x43, 0x43, 0x44, 0x44, 0x44, 0x45, 0x45, 0x45, 0x46, 0x46, 0x46, 0x47, 0x47, 0x47, 0x48, 0x48, + 0x48, 0x49, 0x49, 0x4A, 0x4A, 0x4A, 0x4B, 0x4B, 0x4B, 0x4C, 0x4C, 0x4C, 0x4D, 0x4D, 0x4D, 0x4E, + 0x4E, 0x4E, 0x4F, 0x4F, 0x4F, 0x50, 0x50, 0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53, 0x53, + 0x54, 0x54, 0x54, 0x55, 0x55, 0x55, 0x56, 0x56, 0x56, 0x57, 0x57, 0x58, 0x58, 0x58, 0x59, 0x59, + 0x59, 0x5A, 0x5A, 0x5A, 0x5B, 0x5B, 0x5B, 0x5C, 0x5C, 0x5C, 0x5D, 0x5D, 0x5E, 0x5E, 0x5E, 0x5F, + 0x5F, 0x5F, 0x60, 0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62, 0x63, 0x63, 0x63, 0x64, 0x64, + 0x65, 0x65, 0x65, 0x66, 0x66, 0x66, 0x67, 0x67, 0x67, 0x68, 0x68, 0x68, 0x69, 0x69, 0x69, 0x6A, + 0x6A, 0x6A, 0x6B, 0x6B, 0x6C, 0x6C, 0x6C, 0x6D, 0x6D, 0x6D, 0x6E, 0x6E, 0x6E, 0x6F, 0x6F, 0x6F, + 0x70, 0x70, 0x70, 0x71, 0x71, 0x72, 0x72, 0x72, 0x73, 0x73, 0x73, 0x74, 0x74, 0x74, 0x75, 0x75, + 0x75, 0x76, 0x76, 0x76, 0x77, 0x77, 0x77, 0x78, 0x78, 0x79, 0x79, 0x79, 0x7A, 0x7A, 0x7A, 0x7B, + 0x7B, 0x7B, 0x7C, 0x7C, 0x7C, 0x7D, 0x7D, 0x7D, 0x7E, 0x7E, 0x7E, 0x7F, 0x7F, 0x80, 0x80, 0x80, + 0x81, 0x81, 0x81, 0x82, 0x82, 0x82, 0x83, 0x83, 0x83, 0x84, 0x84, 0x84, 0x85, 0x85, 0x85, 0x86, + 0x86, 0x87, 0x87, 0x87, 0x88, 0x88, 0x88, 0x89, 0x89, 0x89, 0x8A, 0x8A, 0x8A, 0x8B, 0x8B, 0x8B, + 0x8C, 0x8C, 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, 0x06, 0x06, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x09, + 0x09, 0x09, 0x0a, 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e, + 0x0f, 0x0f, 0x0f, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x14, + 0x14, 0x14, 0x15, 0x15, 0x15, 0x16, 0x16, 0x17, 0x17, 0x17, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, + 0x1a, 0x1a, 0x1a, 0x1b, 0x1b, 0x1b, 0x1c, 0x1c, 0x1c, 0x1d, 0x1d, 0x1d, 0x1e, 0x1e, 0x1f, 0x1f, + 0x1f, 0x20, 0x20, 0x20, 0x21, 0x21, 0x21, 0x22, 0x22, 0x22, 0x23, 0x23, 0x23, 0x24, 0x24, 0x24, + 0x25, 0x25, 0x26, 0x26, 0x26, 0x27, 0x27, 0x27, 0x28, 0x28, 0x28, 0x29, 0x29, 0x29, 0x2a, 0x2a, + 0x2a, 0x2b, 0x2b, 0x2b, 0x2c, 0x2c, 0x2c, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f, 0x2f, 0x30, + 0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x32, 0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35, + 0x36, 0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x38, 0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, + 0x3b, 0x3b, 0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e, 0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x40, + 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x43, 0x43, 0x43, 0x44, 0x44, 0x45, 0x45, 0x45, 0x46, 0x46, + 0x46, 0x47, 0x47, 0x47, 0x48, 0x48, 0x48, 0x49, 0x49, 0x49, 0x4a, 0x4a, 0x4a, 0x4b, 0x4b, 0x4b, + 0x4c, 0x4c, 0x4d, 0x4d, 0x4d, 0x4e, 0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x50, 0x50, 0x50, 0x51, 0x51, + 0x51, 0x52, 0x52, 0x52, 0x53, 0x53, 0x53, 0x54, 0x54, 0x55, 0x55, 0x55, 0x56, 0x56, 0x56, 0x57, + 0x57, 0x57, 0x58, 0x58, 0x58, 0x59, 0x59, 0x59, 0x5a, 0x5a, 0x5a, 0x5b, 0x5b, 0x5c, 0x5c, 0x5c, + 0x5d, 0x5d, 0x5d, 0x5e, 0x5e, 0x5e, 0x5f, 0x5f, 0x5f, 0x60, 0x60, 0x60, 0x61, 0x61, 0x61, 0x62, + 0x62, 0x62, 0x63, 0x63, 0x64, 0x64, 0x64, 0x65, 0x65, 0x65, 0x66, 0x66, 0x66, 0x67, 0x67, 0x67, + 0x68, 0x68, 0x68, 0x69, 0x69, 0x69, 0x6a, 0x6a, 0x6a, 0x6b, 0x6b, 0x6c, 0x6c, 0x6c, 0x6d, 0x6d, + 0x6d, 0x6e, 0x6e, 0x6e, 0x6f, 0x6f, 0x6f, 0x70, 0x70, 0x70, 0x71, 0x71, 0x71, 0x72, 0x72, 0x72, + 0x73, 0x73, 0x74, 0x74, 0x74, 0x75, 0x75, 0x75, 0x76, 0x76, 0x76, 0x77, 0x77, 0x77, 0x78, 0x78, + 0x78, 0x79, 0x79, 0x79, 0x7a, 0x7a, 0x7b, 0x7b, 0x7b, 0x7c, 0x7c, 0x7c, 0x7d, 0x7d, 0x7d, 0x7e, + 0x7e, 0x7e, 0x7f, 0x7f, 0x7f, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x82, 0x82, 0x83, 0x83, 0x83, + 0x84, 0x84, 0x84, 0x85, 0x85, 0x85, 0x86, 0x86, 0x86, 0x87, 0x87, 0x87, 0x88, 0x88, 0x88, 0x89, + 0x89, 0x89, 0x8a, 0x8a, 0x8b, 0x8b, 0x8b, 0x8c, 0x8c, 0x8c, 0x8d, 0x8d, 0x8d, 0x8e, 0x8e, 0x8e, + 0x8f, 0x8f, 0x8f, 0x90, 0x90, 0x90, 0x91, 0x91, 0x92 +}; + + +/* +uint8 cycle2hc32[489] = { + 0xe9, 0xe9, 0xe9, 0xea, 0xea, 0xea, 0xeb, 0xeb, 0xeb, 0xec, 0xec, 0xec, 0xed, 0xed, 0xed, 0xee, + 0xee, 0xee, 0xef, 0xef, 0xef, 0xf0, 0xf0, 0xf1, 0xf1, 0xf1, 0xf2, 0xf2, 0xf2, 0xf3, 0xf3, 0xf3, + 0xf4, 0xf4, 0xf4, 0xf5, 0xf5, 0xf5, 0xf6, 0xf6, 0xf6, 0xf7, 0xf7, 0xf7, 0xf8, 0xf8, 0xf9, 0xf9, + 0xf9, 0xfa, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfd, 0xfe, 0xfe, 0xfe, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, + 0x04, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x07, 0x07, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x0a, + 0x0a, 0x0a, 0x0b, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0d, 0x0d, 0x0d, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, + 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14, 0x15, + 0x15, 0x15, 0x16, 0x16, 0x16, 0x17, 0x17, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x1a, 0x1a, 0x1a, + 0x1b, 0x1b, 0x1b, 0x1c, 0x1c, 0x1c, 0x1d, 0x1d, 0x1d, 0x1e, 0x1e, 0x1e, 0x1f, 0x1f, 0x20, 0x20, + 0x20, 0x21, 0x21, 0x21, 0x22, 0x22, 0x22, 0x23, 0x23, 0x23, 0x24, 0x24, 0x24, 0x25, 0x25, 0x25, + 0x26, 0x26, 0x27, 0x27, 0x27, 0x28, 0x28, 0x28, 0x29, 0x29, 0x29, 0x2a, 0x2a, 0x2a, 0x2b, 0x2b, + 0x2b, 0x2c, 0x2c, 0x2c, 0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2f, 0x2f, 0x2f, 0x30, 0x30, 0x30, 0x31, + 0x31, 0x31, 0x32, 0x32, 0x32, 0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35, 0x35, 0x36, 0x36, + 0x37, 0x37, 0x37, 0x38, 0x38, 0x38, 0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b, 0x3b, 0x3c, + 0x3c, 0x3c, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e, 0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, + 0x42, 0x42, 0x42, 0x43, 0x43, 0x43, 0x44, 0x44, 0x44, 0x45, 0x45, 0x46, 0x46, 0x46, 0x47, 0x47, + 0x47, 0x48, 0x48, 0x48, 0x49, 0x49, 0x49, 0x4a, 0x4a, 0x4a, 0x4b, 0x4b, 0x4b, 0x4c, 0x4c, 0x4c, + 0x4d, 0x4d, 0x4e, 0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x50, 0x50, 0x50, 0x51, 0x51, 0x51, 0x52, 0x52, + 0x52, 0x53, 0x53, 0x53, 0x54, 0x54, 0x54, 0x55, 0x55, 0x56, 0x56, 0x56, 0x57, 0x57, 0x57, 0x58, + 0x58, 0x58, 0x59, 0x59, 0x59, 0x5a, 0x5a, 0x5a, 0x5b, 0x5b, 0x5b, 0x5c, 0x5c, 0x5d, 0x5d, 0x5d, + 0x5e, 0x5e, 0x5e, 0x5f, 0x5f, 0x5f, 0x60, 0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62, 0x63, + 0x63, 0x63, 0x64, 0x64, 0x65, 0x65, 0x65, 0x66, 0x66, 0x66, 0x67, 0x67, 0x67, 0x68, 0x68, 0x68, + 0x69, 0x69, 0x69, 0x6a, 0x6a, 0x6a, 0x6b, 0x6b, 0x6b, 0x6c, 0x6c, 0x6d, 0x6d, 0x6d, 0x6e, 0x6e, + 0x6e, 0x6f, 0x6f, 0x6f, 0x70, 0x70, 0x70, 0x71, 0x71, 0x71, 0x72, 0x72, 0x72, 0x73, 0x73, 0x73, + 0x74, 0x74, 0x75, 0x75, 0x75, 0x76, 0x76, 0x76, 0x77, 0x77, 0x77, 0x78, 0x78, 0x78, 0x79, 0x79, + 0x79, 0x7a, 0x7a, 0x7a, 0x7b, 0x7b, 0x7c, 0x7c, 0x7c, 0x7d, 0x7d, 0x7d, 0x7e, 0x7e, 0x7e, 0x7f, + 0x7f, 0x7f, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x82, 0x82, 0x82, 0x83, 0x83, 0x84, 0x84, 0x84, + 0x85, 0x85, 0x85, 0x86, 0x86, 0x86, 0x87, 0x87, 0x87, 0x88, 0x88, 0x88, 0x89, 0x89, 0x89, 0x8a, + 0x8a, 0x8a, 0x8b, 0x8b, 0x8c, 0x8c, 0x8c, 0x8d, 0x8d, 0x8d, 0x8e, 0x8e, 0x8e, 0x8f, 0x8f, 0x8f, + 0x90, 0x90, 0x90, 0x91, 0x91, 0x91, 0x92, 0x92, 0x93 +};*/ + + +/* +uint8 cycle2hc40[488] = { + 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, + 0x06, 0x07, 0x07, 0x08, 0x08, 0x09, 0x09, 0x09, 0x0A, 0x0A, 0x0B, 0x0B, 0x0C, 0x0C, 0x0C, 0x0D, + 0x0D, 0x0E, 0x0E, 0x0F, 0x0F, 0x10, 0x10, 0x10, 0x11, 0x11, 0x12, 0x12, 0x13, 0x13, 0x13, 0x14, + 0x14, 0x15, 0x15, 0x16, 0x16, 0x16, 0x17, 0x17, 0x18, 0x18, 0x19, 0x19, 0x19, 0x1A, 0x1A, 0x1B, + 0x1B, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1E, 0x1E, 0x1F, 0x1F, 0x20, 0x20, 0x20, 0x21, 0x21, 0x22, + 0x22, 0x23, 0x23, 0x23, 0x24, 0x24, 0x25, 0x25, 0x26, 0x26, 0x26, 0x27, 0x27, 0x28, 0x28, 0x29, + 0x29, 0x29, 0x2A, 0x2A, 0x2B, 0x2B, 0x2C, 0x2C, 0x2D, 0x2D, 0x2D, 0x2E, 0x2E, 0x2F, 0x2F, 0x30, + 0x30, 0x30, 0x31, 0x31, 0x32, 0x32, 0x33, 0x33, 0x33, 0x34, 0x34, 0x35, 0x35, 0x36, 0x36, 0x36, + 0x37, 0x37, 0x38, 0x38, 0x39, 0x39, 0x39, 0x3A, 0x3A, 0x3B, 0x3B, 0x3C, 0x3C, 0x3D, 0x3D, 0x3D, + 0x3E, 0x3E, 0x3F, 0x3F, 0x40, 0x40, 0x40, 0x41, 0x41, 0x42, 0x42, 0x43, 0x43, 0x43, 0x44, 0x44, + 0x45, 0x45, 0x46, 0x46, 0x46, 0x47, 0x47, 0x48, 0x48, 0x49, 0x49, 0x4A, 0x4A, 0x4A, 0x4B, 0x4B, + 0x4C, 0x4C, 0x4D, 0x4D, 0x4D, 0x4E, 0x4E, 0x4F, 0x4F, 0x50, 0x50, 0x50, 0x51, 0x51, 0x52, 0x52, + 0x53, 0x53, 0x53, 0x54, 0x54, 0x55, 0x55, 0x56, 0x56, 0x56, 0x57, 0x57, 0x58, 0x58, 0x59, 0x59, + 0x5A, 0x5A, 0x5A, 0x5B, 0x5B, 0x5C, 0x5C, 0x5D, 0x5D, 0x5D, 0x5E, 0x5E, 0x5F, 0x5F, 0x60, 0x60, + 0x60, 0x61,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0x0c, 0x0c, 0x0c, + 0x0d, 0x0d, 0x0e, 0x0e, 0x0f, 0x0f, 0x0f, 0x10, 0x10, 0x11, 0x11, 0x12, 0x12, 0x12, 0x13, 0x13, + 0x14, 0x14, 0x15, 0x15, 0x15, 0x16, 0x16, 0x17, 0x17, 0x18, 0x18, 0x18, 0x19, 0x19, 0x1a, 0x1a, + 0x1b, 0x1b, 0x1b, 0x1c, 0x1c, 0x1d, 0x1d, 0x1e, 0x1e, 0x1e, 0x1f, 0x1f, 0x20, 0x20, 0x21, 0x21, + 0x21, 0x22, 0x22, 0x23, 0x23, 0x24, 0x24, 0x24, 0x25, 0x25, 0x26, 0x26, 0x27, 0x27, 0x27, 0x28, + 0x28, 0x29, 0x29, 0x2a, 0x2a, 0x2b, 0x2b, 0x2b, 0x2c, 0x2c, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, + 0x2f, 0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x33, 0x33, 0x34, 0x34, 0x34, 0x35, 0x35, 0x36, + 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b, 0x3c, 0x3c, 0x3d, + 0x3d, 0x3d, 0x3e, 0x3e, 0x3f, 0x3f, 0x40, 0x40, 0x40, 0x41, 0x41, 0x42, 0x42, 0x43, 0x43, 0x43, + 0x44, 0x44, 0x45, 0x45, 0x46, 0x46, 0x46, 0x47, 0x47, 0x48, 0x48, 0x49, 0x49, 0x49, 0x4a, 0x4a, + 0x4b, 0x4b, 0x4c, 0x4c, 0x4d, 0x4d, 0x4d, 0x4e, 0x4e, 0x4f, 0x4f, 0x50, 0x50, 0x50, 0x51, 0x51, + 0x52, 0x52, 0x53, 0x53, 0x53, 0x54, 0x54, 0x55, 0x55, 0x56, 0x56, 0x56, 0x57, 0x57, 0x58, 0x58, + 0x59, 0x59, 0x59, 0x5a, 0x5a, 0x5b, 0x5b, 0x5c, 0x5c, 0x5c, 0x5d, 0x5d, 0x5e, 0x5e, 0x5f, 0x5f, + 0x5f, 0x60, 0x60, 0x61, 0x61, 0x62, 0x62, 0x62, 0x63, 0x63, 0x64, 0x64, 0x65, 0x65, 0x65, 0x66, + 0x66, 0x67, 0x67, 0x68, 0x68, 0x68, 0x69, 0x69, 0x6a, 0x6a, 0x6b, 0x6b, 0x6b, 0x6c, 0x6c, 0x6d, + 0x6d, 0x6e, 0x6e, 0x6e, 0x6f, 0x6f, 0x70, 0x70, 0x71, 0x71, 0x72, 0x72, 0x72, 0x73, 0x73, 0x74, + 0x74, 0x75, 0x75, 0x75, 0x76, 0x76, 0x77, 0x77, 0x78, 0x78, 0x78, 0x79, 0x79, 0x7a, 0x7a, 0x7b, + 0x7b, 0x7b, 0x7c, 0x7c, 0x7d, 0x7d, 0x7e, 0x7e, 0x7e, 0x7f, 0x7f, 0x80, 0x80, 0x81, 0x81, 0x81, + 0x82, 0x82, 0x83, 0x83, 0x84, 0x84, 0x84, 0x85, 0x85, 0x86, 0x86, 0x87, 0x87, 0x87, 0x88, 0x88, + 0x89, 0x89, 0x8a, 0x8a, 0x8a, 0x8b, 0x8b, 0x8c, 0x8c, 0x8d, 0x8d, 0x8d, 0x8e, 0x8e, 0x8f, 0x8f, + 0x90, 0x90, 0x90, 0x91, 0x91, 0x92, 0x92, 0x93, 0x93, 0x94, 0x94, 0x94, 0x95, 0x95, 0x96, 0x96, + 0x97, 0x97, 0x97, 0x98, 0x98, 0x99, 0x99, 0x9a, 0x9a, 0x9a, 0x9b, 0x9b, 0x9c, 0x9c, 0x9d, 0x9d, + 0x9d, 0x9e, 0x9e, 0x9f, 0x9f, 0xa0, 0xa0, 0xa0, 0xa1, 0xa1, 0xa2, 0xa2, 0xa3, 0xa3, 0xa3, 0xa4, + 0xa4, 0xa5, 0xa5, 0xa6, 0xa6, 0xa6, 0xa7, 0xa7, 0xa8, 0xa8, 0xa9, 0xa9, 0xa9, 0xaa, 0xaa, 0xab, + 0xab, 0xac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, 0x25, 0x25, 0x25, 0x26, 0x26, + 0x27, 0x27, 0x28, 0x28, 0x28, 0x29, 0x29, 0x2a, 0x2a, 0x2a, 0x2b, 0x2b, 0x2c, 0x2c, 0x2d, 0x2d, + 0x2d, 0x2e, 0x2e, 0x2f, 0x2f, 0x30, 0x30, 0x30, 0x31, 0x31, 0x32, 0x32, 0x32, 0x33, 0x33, 0x34, + 0x34, 0x35, 0x35, 0x35, 0x36, 0x36, 0x37, 0x37, 0x38, 0x38, 0x38, 0x39, 0x39, 0x3a, 0x3a, 0x3a, + 0x3b, 0x3b, 0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x41, 0x41, + 0x42, 0x42, 0x42, 0x43, 0x43, 0x44, 0x44, 0x45, 0x45, 0x45, 0x46, 0x46, 0x47, 0x47, 0x47, 0x48, + 0x48, 0x49, 0x49, 0x4a, 0x4a, 0x4a, 0x4b, 0x4b, 0x4c, 0x4c, 0x4d, 0x4d, 0x4d, 0x4e, 0x4e, 0x4f, + 0x4f, 0x4f, 0x50, 0x50, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53, 0x54, 0x54, 0x55, 0x55, 0x55, + 0x56, 0x56, 0x57, 0x57, 0x57, 0x58, 0x58, 0x59, 0x59, 0x5a, 0x5a, 0x5a, 0x5b, 0x5b, 0x5c, 0x5c, + 0x5c, 0x5d, 0x5d, 0x5e, 0x5e, 0x5f, 0x5f, 0x5f, 0x60, 0x60, 0x61, 0x61, 0x62, 0x62, 0x62, 0x63, + 0x63, 0x64, 0x64, 0x64, 0x65, 0x65, 0x66, 0x66, 0x67, 0x67, 0x67, 0x68, 0x68, 0x69, 0x69, 0x6a, + 0x6a, 0x6a, 0x6b, 0x6b, 0x6c, 0x6c, 0x6c, 0x6d, 0x6d, 0x6e, 0x6e, 0x6f, 0x6f, 0x6f, 0x70, 0x70, + 0x71, 0x71, 0x71, 0x72, 0x72, 0x73, 0x73, 0x74, 0x74, 0x74, 0x75, 0x75, 0x76, 0x76, 0x77, 0x77, + 0x77, 0x78, 0x78, 0x79, 0x79, 0x79, 0x7a, 0x7a, 0x7b, 0x7b, 0x7c, 0x7c, 0x7c, 0x7d, 0x7d, 0x7e, + 0x7e, 0x7f, 0x7f, 0x7f, 0x80, 0x80, 0x81, 0x81, 0x81, 0x82, 0x82, 0x83, 0x83, 0x84, 0x84, 0x84, + 0x85, 0x85, 0x86, 0x86, 0x86, 0x87, 0x87, 0x88, 0x88, 0x89, 0x89, 0x89, 0x8a, 0x8a, 0x8b, 0x8b, + 0x8c, 0x8c, 0x8c, 0x8d, 0x8d, 0x8e, 0x8e, 0x8e, 0x8f, 0x8f, 0x90, 0x90, 0x91, 0x91, 0x91, 0x92, + 0x92, 0x93, 0x93, 0x94, 0x94, 0x94, 0x95, 0x95, 0x96, 0x96, 0x96, 0x97, 0x97, 0x98, 0x98, 0x99, + 0x99, 0x99, 0x9a, 0x9a, 0x9b, 0x9b, 0x9b, 0x9c, 0x9c, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f, + 0xa0, 0xa0, 0xa1, 0xa1, 0xa1, 0xa2, 0xa2, 0xa3, 0xa3, 0xa3, 0xa4, 0xa4, 0xa5, 0xa5, 0xa6, 0xa6, + 0xa6, 0xa7, 0xa7, 0xa8, 0xa8, 0xa9, 0xa9, 0xa9, 0xaa, 0xaa, 0xab, 0xab, 0xab, 0xac, 0xac, 0xad, + 0xad, 0xae, 0xae, 0xae, 0xaf, 0xaf, 0xb0, 0xb0, 0xb1 +}; +*/ + + + +/* H counter values for a 256-pixel wide display (342 pixel max.) */ +/*uint8 hc_256[171] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, + 0x90, 0x91, 0x92, 0x93, + 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF +};*/ + +/* H counter values for a 320-pixel wide display (422 pixels max.) */ +/*uint8 hc_320[211] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, + 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, + 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, + 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF +};*/ + +/*uint8 *hc_table[2] = { + hc_256, + hc_320, +};*/ + +#endif /* _HVC_H_ */ + diff --git a/source/input.c b/source/input.c new file mode 100644 index 0000000..0b2b5c3 --- /dev/null +++ b/source/input.c @@ -0,0 +1,508 @@ +/* + Copyright (C) 1999, 2000, 2001, 2002, 2003 Charles MacDonald + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +/* + NGC port (June 2007): Added various Peripherals emulation (Eke-Eke) +*/ + +#include "shared.h" + +t_input input; +uint8 current_pad = 0; +uint8 j_cart = 0; + +void gamepad_reset(uint8 num); +void gamepad_update(uint8 num); +void gamepad_raz(uint8 num); +void lightgun_update(void); +void lightgun_reset(void); +void teamplayer_reset(uint8 port); + +/***************************************************************************** + * Generic INPUTS Control + * + *****************************************************************************/ +void input_reset (int padtype) +{ + uint8 i; + + input.max = 0; + for (i=0; i MAX_INPUTS) input.max = MAX_INPUTS; + + /* J-CART: add two gamepad inputs */ + if (j_cart) + { + input.dev[5] = padtype; + input.dev[6] = padtype; + gamepad_reset(5); + gamepad_reset(6); + input.max+=2; + } +} + +void input_update() +{ + uint8 i; + switch (input.system[0]) + { + case SYSTEM_GAMEPAD: + if (input.dev[0] == DEVICE_6BUTTON) gamepad_update(0); + break; + + case SYSTEM_WAYPLAY: + for (i=0; i<4; i++) + { + if (input.dev[i] == DEVICE_6BUTTON) gamepad_update(i); + } + break; + } + + switch (input.system[1]) + { + case SYSTEM_GAMEPAD: + if (input.dev[4] == DEVICE_6BUTTON) gamepad_update(4); + break; + + case SYSTEM_MENACER: + lightgun_update(); + break; + } +} + +void input_raz() +{ + uint8 i; + switch (input.system[0]) + { + case SYSTEM_GAMEPAD: + if (input.dev[0] == DEVICE_6BUTTON) gamepad_raz(0); + break; + + case SYSTEM_WAYPLAY: + for (i=0; i<4; i++) + { + if (input.dev[i] == DEVICE_6BUTTON) gamepad_raz(i); + } + break; + } + + switch (input.system[1]) + { + case SYSTEM_GAMEPAD: + if (input.dev[4] == DEVICE_6BUTTON) gamepad_raz(4); + break; + } +} + +/***************************************************************************** + * LIGHTGUN specific functions + * + *****************************************************************************/ +struct gun +{ + int16 x; + int16 y; +} lightgun; + +void lightgun_reset(void) +{ + lightgun.x = bitmap.viewport.w >> 1; + lightgun.y = bitmap.viewport.h >> 1; +} + +void lightgun_update(void) +{ + if ((v_counter == lightgun.y)) + { + if (reg[0x0B] & 8) m68k_set_irq(2); + if (reg[0x00] & 2) + { + hc_latch = lightgun.x + 166; + if (hc_latch >= bitmap.viewport.w + 52) hc_latch -= (bitmap.viewport.w + 52 + 48); + hc_latch >>= 1; + } + } +} + +void lightgun_set () +{ + if ((input.pad[4] & INPUT_RIGHT)) lightgun.x ++; + if ((input.pad[4] & INPUT_LEFT)) lightgun.x --; + if ((input.pad[4] & INPUT_UP)) lightgun.y --; + if ((input.pad[4] & INPUT_DOWN)) lightgun.y ++; + + if (lightgun.x < 0) lightgun.x = 0; + else if (lightgun.x > bitmap.viewport.w-34) lightgun.x = bitmap.viewport.w-34; + + if (lightgun.y < 0) lightgun.y = 0; + else if (lightgun.y > bitmap.viewport.h-8) lightgun.y = bitmap.viewport.h-8; +} + +uint8 lightgun_read (void) +{ + uint8 retval = 0x00; + if ((input.pad[4] & INPUT_B)) retval |= 0x01; + if ((input.pad[4] & INPUT_A)) retval |= 0x02; + if ((input.pad[4] & INPUT_C)) retval |= 0x04; + if ((input.pad[4] & INPUT_START)) retval |= 0x08; + return (retval & 0x7F); +} + + +/***************************************************************************** + * GAMEPAD specific functions (2PLAYERS/4WAYPLAY) + * + *****************************************************************************/ +struct pad +{ + uint8 State; + uint8 Counter; + uint8 Delay; +} gamepad[MAX_DEVICES]; + +void gamepad_reset(uint8 i) +{ + gamepad[i].State = 0x40; + if (input.dev[i] == DEVICE_6BUTTON) gamepad_raz(i); +} + +void gamepad_raz(uint8 i) +{ + gamepad[i].Counter = 0; + gamepad[i].Delay = 0; +} + +void gamepad_update(uint8 i) +{ + if (gamepad[i].Delay++ > 25) gamepad_raz(i); +} + +uint8 gamepad_read (uint8 i) +{ + int control; + unsigned char retval = 0xFF; + + if (input.dev[i] == NO_DEVICE) return 0x7F; + + control = (gamepad[i].State & 0x40) >> 6; /* current TH state */ + + if (input.dev[i] == DEVICE_6BUTTON) + { + control += (gamepad[i].Counter & 3) << 1; /* TH transitions counter */ + } + + switch (control) + { + case 1: /*** First High ***/ + case 3: /*** Second High ***/ + case 5: /*** Third High ***/ + + /* TH = 1 : ?1CBRLDU */ + if (input.pad[i] & INPUT_C) retval &= ~0x20; + if (input.pad[i] & INPUT_B) retval &= ~0x10; + if (input.pad[i] & INPUT_UP) retval &= ~0x01; + if (input.pad[i] & INPUT_DOWN) retval &= ~0x02; + if (input.pad[i] & INPUT_LEFT) retval &= ~0x04; + if (input.pad[i] & INPUT_RIGHT) retval &= ~0x08; + break; + + case 0: /*** First low ***/ + case 2: /*** Second low ***/ + + /* TH = 0 : ?0SA00DU */ + if (input.pad[i] & INPUT_A) retval &= ~0x10; + if (input.pad[i] & INPUT_START) retval &= ~0x20; + if (input.pad[i] & INPUT_UP) retval &= ~0x01; + if (input.pad[i] & INPUT_DOWN) retval &= ~0x02; + retval &= 0xB3; + break; + + /* 6buttons specific (taken from gen-hw.txt) */ + /* A 6-button gamepad allows the extra buttons to be read based on how */ + /* many times TH is switched from 1 to 0 (and not 0 to 1). Observe the */ + /* following sequence */ + /* + TH = 1 : ?1CBRLDU 3-button pad return value + TH = 0 : ?0SA00DU 3-button pad return value + TH = 1 : ?1CBRLDU 3-button pad return value + TH = 0 : ?0SA0000 D3-0 are forced to '0' + TH = 1 : ?1CBMXYZ Extra buttons returned in D3-0 + TH = 0 : ?0SA1111 D3-0 are forced to '1' + */ + case 4: /*** Third Low ***/ + + /* TH = 0 : ?0SA0000 D3-0 are forced to '0'*/ + if (input.pad[i] & INPUT_A) retval &= ~0x10; + if (input.pad[i] & INPUT_START) retval &= ~0x20; + retval &= 0xB0; + break; + + case 6: /*** Fourth Low ***/ + + /* TH = 0 : ?0SA1111 D3-0 are forced to '1'*/ + if (input.pad[i] & INPUT_A) retval &= ~0x10; + if (input.pad[i] & INPUT_START) retval &= ~0x20; + retval &= 0xBF; + break; + + case 7: /*** Fourth High ***/ + + /* TH = 1 : ?1CBMXYZ Extra buttons returned in D3-0*/ + if (input.pad[i] & INPUT_X) retval &= ~0x04; + if (input.pad[i] & INPUT_Y) retval &= ~0x02; + if (input.pad[i] & INPUT_Z) retval &= ~0x01; + if (input.pad[i] & INPUT_B) retval &= ~0x10; + if (input.pad[i] & INPUT_C) retval &= ~0x20; + if (input.pad[i] & INPUT_MODE) retval &= ~0x08; + break; + + default: + break; + } + + /* bit7 is latched*/ + return (retval&0x7f); +} + +void gamepad_write (uint8 i, uint8 data) +{ + if (input.dev[i] == DEVICE_6BUTTON) + { + /* TH=0 to TH=1 transition */ + if (!(gamepad[i].State & 0x40) && (data & 0x40)) + { + gamepad[i].Counter++; + gamepad[i].Delay = 0; + } + } + + gamepad[i].State = data; +} + + +/***************************************************************************** + * TEAMPLAYER specific functions + * + *****************************************************************************/ +struct teamplayer +{ + uint8 State; + uint8 Counter; + uint8 Table[12]; +} teamplayer[2]; + +void teamplayer_reset(uint8 port) +{ + uint8 i; + uint8 index = 0; + uint8 pad_input = 0; + + teamplayer[port].State = 0x60; /* TH = 1, TR = 1 */ + teamplayer[port].Counter = 0; + + /* this table determines which gamepad input should be returned during acquisition sequence + index = teamplayer read table index: 0=1st read, 1=2nd read, ... + pad_input = gamepad input 0-14: 0=P1_DIR, 1=P1_SABC, 2=P1_MXYZ, 4=P2_DIR, 5=P2_SABC, ... + */ + for (i=0; i<4; i++) + { + if (input.dev[(4*port) + i] == DEVICE_3BUTTON) + { + teamplayer[port].Table[index++] = pad_input; + teamplayer[port].Table[index++] = pad_input + 1; + } + else if (input.dev[(4*port) + i] == DEVICE_6BUTTON) + { + teamplayer[port].Table[index++] = pad_input; + teamplayer[port].Table[index++] = pad_input + 1; + teamplayer[port].Table[index++] = pad_input + 2; + } + pad_input += 4; + } +} + + +/* SEGA teamplayer returns successively: + - PAD1 inputs + - PAD2 inputs + - PAD3 inputs + - PAD4 inputs + + Each PAD inputs is obtained through 2 or 3 sequential reads: + 1/ DIR buttons + 2/ START,A,C,B buttons + 3/ MODE, X,Y,Z buttons (6Button only !) +*/ +uint8 teamplayer_read(uint8 port, uint8 index) +{ + uint8 retval = 0x7F; + uint8 pad_input = teamplayer[port].Table[index] & 0x03; + uint8 pad_num = (4 * port) + ((teamplayer[port].Table[index] >> 2) & 0x03); + + switch (pad_input) + { + case 0: + /* Directions Buttons */ + if (input.pad[pad_num] & INPUT_UP) retval &= ~0x01; + if (input.pad[pad_num] & INPUT_DOWN) retval &= ~0x02; + if (input.pad[pad_num] & INPUT_LEFT) retval &= ~0x04; + if (input.pad[pad_num] & INPUT_RIGHT) retval &= ~0x08; + break; + + case 1: + /* S,A,C,B Buttons */ + if (input.pad[pad_num] & INPUT_B) retval &= ~0x01; + if (input.pad[pad_num] & INPUT_C) retval &= ~0x02; + if (input.pad[pad_num] & INPUT_A) retval &= ~0x04; + if (input.pad[pad_num] & INPUT_START) retval &= ~0x08; + break; + + case 2: + /* M,X,Y,Z Buttons (6-Buttons only)*/ + if (input.pad[pad_num] & INPUT_Z) retval &= ~0x01; + if (input.pad[pad_num] & INPUT_Y) retval &= ~0x02; + if (input.pad[pad_num] & INPUT_X) retval &= ~0x04; + if (input.pad[pad_num] & INPUT_MODE) retval &= ~0x08; + break; + } + + return retval; +} + +/***************************************************************************** + * MULTITAP generic functions (TEAMPLAYER/4WAYPLAY) + * + *****************************************************************************/ +void multitap_write (uint8 port, uint8 data) +{ + uint8 old_state; + switch (input.system[port]) + { + case SYSTEM_WAYPLAY: + if (!port) gamepad_write(current_pad, data); + else current_pad = (data >> 4) & 0x07; + break; + + case SYSTEM_TEAMPLAYER: + old_state = teamplayer[port].State; + teamplayer[port].State = (data & io_reg[port+4]) | (teamplayer[port].State & ~io_reg[port+4]); + if (old_state != teamplayer[port].State) teamplayer[port].Counter ++; + if ((data&0x60) == 0x60) teamplayer[port].Counter = 0; + break; + } +} + +uint8 multitap_read (uint8 port) +{ + uint8 retval = 0x7F; + uint8 padnum; + + switch (input.system[port]) + { + case SYSTEM_WAYPLAY: + if (port == 1) return 0x7F; + if (current_pad >= 4) return 0x70; /* multitap detection (TH2 = 1) */ + return gamepad_read(current_pad); /* 0x0C = Pad1, 0x1C = Pad2, ... */ + + case SYSTEM_TEAMPLAYER: + switch (teamplayer[port].Counter) /* acquisition sequence steps */ + { + case 0: /* initial state: TH = 1, TR = 1 */ + retval = 0x73; + break; + + case 1: /* start request: TH = 0, TR = 1 */ + retval = 0x3F; + break; + + case 2: + case 3: /* ack request: TH=0, TR handshake */ + retval = 0x00; + break; + + case 4: + case 5: + case 6: + case 7: /* gamepads type */ + padnum = (4 * port) + teamplayer[port].Counter - 4; + retval = input.dev[padnum]; + break; + + default: /* gamepads inputs acquisition */ + retval = teamplayer_read(port, teamplayer[port].Counter - 8); + break; + } + + /* TL must match TR state */ + retval &= ~0x10; + if (teamplayer[port].State & 0x20) retval |= 0x10; + return retval; + } + return retval; +} diff --git a/source/input.h b/source/input.h new file mode 100644 index 0000000..29b8be0 --- /dev/null +++ b/source/input.h @@ -0,0 +1,63 @@ +#ifndef _INPUT_H_ +#define _INPUT_H_ +#include "types.h" + +/* Input devices */ +#ifdef NGC +#define MAX_INPUTS (4) +#else +#define MAX_INPUTS (8) +#endif +#define MAX_DEVICES (8) +#define DEVICE_3BUTTON (0x00) /* 3-button gamepad */ +#define DEVICE_6BUTTON (0x01) /* 6-button gamepad */ +#define DEVICE_MOUSE (0x02) /* Sega Mouse (not supported) */ +#define DEVICE_LIGHTGUN (0x03) /* Sega Menacer */ +#define DEVICE_2BUTTON (0x04) /* 2-button gamepad (not supported) */ +#define NO_DEVICE (0x0F) /* unconnected */ + +/* Input bitmasks */ +#define INPUT_MODE (0x00000800) +#define INPUT_Z (0x00000400) +#define INPUT_Y (0x00000200) +#define INPUT_X (0x00000100) +#define INPUT_START (0x00000080) +#define INPUT_C (0x00000040) +#define INPUT_B (0x00000020) +#define INPUT_A (0x00000010) +#define INPUT_LEFT (0x00000008) +#define INPUT_RIGHT (0x00000004) +#define INPUT_DOWN (0x00000002) +#define INPUT_UP (0x00000001) + +/* System bitmasks */ +#define SYSTEM_GAMEPAD (0) /* Single Gamepad */ +#define SYSTEM_TEAMPLAYER (1) /* Sega TeamPlayer (1~8 players) */ +#define SYSTEM_WAYPLAY (2) /* EA 4-Way Play (1~4 players) */ +#define SYSTEM_MENACER (3) /* SEGA Menacer Lightgun */ +#define NO_SYSTEM (4) /* Unconnected Port*/ + +typedef struct +{ + uint8 dev[MAX_DEVICES]; /* Can be any of the DEVICE_* values */ + uint32 pad[MAX_DEVICES]; /* Can be any of the INPUT_* bitmasks */ + uint8 system[2]; /* Can be any of the SYSTEM_* bitmasks (PORTA & PORTB) */ + uint8 max; /* maximum number of connected devices */ +} t_input; + +/* global variables */ +extern t_input input; +extern uint8 j_cart; + +/* Function prototypes */ +extern void input_reset (int padtype); +extern void input_update(void); +extern void input_raz(void); +extern void lightgun_set (void); +extern uint8 lightgun_read (void); +extern uint8 gamepad_read (uint8 i); +extern void gamepad_write (uint8 i, uint8 data); +extern uint8 multitap_read (uint8 port); +extern void multitap_write (uint8 port, uint8 data); + +#endif diff --git a/source/io.c b/source/io.c new file mode 100644 index 0000000..df570f6 --- /dev/null +++ b/source/io.c @@ -0,0 +1,215 @@ +/* + Copyright (C) 1999, 2000, 2001, 2002, 2003 Charles MacDonald + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + I/O controller chip emulation +*/ + +#include "shared.h" + +uint8 io_reg[0x10]; +uint8 region_code = REGION_USA; +uint8 pad_type = DEVICE_3BUTTON; + +/***************************************************************************** + * IO Read/Write wrappers + * + *****************************************************************************/ + +unsigned char Player1_Read (void) +{ + return gamepad_read(0); +} + +unsigned char Player2_Read (void) +{ + return gamepad_read(4); +} + +void Player1_Write (unsigned char data) +{ + gamepad_write(0, data); +} + +void Player2_Write (unsigned char data) +{ + gamepad_write(4, data); +} + +unsigned char MultiTap1_Read (void) +{ + return multitap_read(0); +} + +unsigned char MultiTap2_Read (void) +{ + return multitap_read(1); +} + +void MultiTap1_Write (unsigned char data) +{ + multitap_write(0, data); +} + +void MultiTap2_Write (unsigned char data) +{ + multitap_write(1, data); +} + +/***************************************************************************** + * I/O chip functions * + * * + ***************************************************************************** +*/ +struct port_t +{ + void (*data_w)(uint8 data); + uint8 (*data_r)(void); +} port[3]; + +void io_reset(void) +{ + /* I/O register default settings */ + uint8 io_def[0x10] = + { + 0xA0, + 0x7F, 0x7F, 0x7F, + 0x00, 0x00, 0x00, + 0xFF, 0x00, 0x00, + 0xFF, 0x00, 0x00, + 0xFB, 0x00, 0x00, + }; + + /* Initialize I/O registers */ + memcpy (io_reg, io_def, 0x10); + + switch (input.system[0]) + { + case SYSTEM_GAMEPAD: + port[0].data_w = Player1_Write; + port[0].data_r = Player1_Read; + break; + + case SYSTEM_WAYPLAY: + case SYSTEM_TEAMPLAYER: + port[0].data_w = MultiTap1_Write; + port[0].data_r = MultiTap1_Read; + break; + + default: + port[0].data_w = NULL; + port[0].data_r = NULL; + break; + } + + switch (input.system[1]) + { + case SYSTEM_GAMEPAD: + port[1].data_w = Player2_Write; + port[1].data_r = Player2_Read; + break; + + case SYSTEM_WAYPLAY: + case SYSTEM_TEAMPLAYER: + port[1].data_w = MultiTap2_Write; + port[1].data_r = MultiTap2_Read; + break; + + case SYSTEM_MENACER: + port[1].data_w = NULL; + port[1].data_r = lightgun_read; + break; + + default: + port[1].data_w = NULL; + port[1].data_r = NULL; + break; + } + + port[2].data_w = NULL; + port[2].data_r = NULL; + + j_cart = 0; + input_reset(pad_type); +} + +void io_write(int offset, int value) +{ + switch (offset) + { + case 0x01: /* Port A Data */ + case 0x02: /* Port B Data */ + case 0x03: /* Port C Data */ + io_reg[offset] = ((value & 0x80) | (value & io_reg[offset+3])); + if(port[offset-1].data_w) port[offset-1].data_w(value); + return; + + case 0x05: /* Port B Ctrl */ + if (((value & 0x7F) == 0x7F) && + ((input.system[0] == SYSTEM_TEAMPLAYER) || + (input.system[1] == SYSTEM_TEAMPLAYER))) + { + /* autodetect 4-Way play ! */ + input.system[0] = SYSTEM_WAYPLAY; + input.system[1] = SYSTEM_WAYPLAY; + port[0].data_w = MultiTap1_Write; + port[0].data_r = MultiTap1_Read; + port[1].data_w = MultiTap2_Write; + port[1].data_r = MultiTap2_Read; + input_reset(pad_type); + } + + case 0x04: /* Port A Ctrl */ + case 0x06: /* Port C Ctrl */ + io_reg[offset] = value & 0xFF; + io_reg[offset-3] = ((io_reg[offset-3] & 0x80) | (io_reg[offset-3] & io_reg[offset])); + break; + + case 0x07: /* Port A TxData */ + case 0x0A: /* Port B TxData */ + case 0x0D: /* Port C TxData */ + io_reg[offset] = value; + break; + + case 0x09: /* Port A S-Ctrl */ + case 0x0C: /* Port B S-Ctrl */ + case 0x0F: /* Port C S-Ctrl */ + io_reg[offset] = (value & 0xF8); + break; + } +} + +int io_read(int offset) +{ + uint8 has_scd = 0x20; /* No Sega CD unit attached */ + uint8 gen_ver = 0x00; /* Version 0 hardware */ + uint8 input = 0x7F; /* default input state */ + + switch(offset) + { + case 0x00: /* Version */ + return (region_code | has_scd | gen_ver); + + case 0x01: /* Port A Data */ + case 0x02: /* Port B Data */ + case 0x03: /* Port C Data */ + if(port[offset-1].data_r) input = port[offset-1].data_r(); + return (io_reg[offset] | ((~io_reg[offset+3]) & input)); + } + + return (io_reg[offset]); +} diff --git a/source/io.h b/source/io.h new file mode 100644 index 0000000..6a0d0ff --- /dev/null +++ b/source/io.h @@ -0,0 +1,20 @@ +#ifndef _IO_H_ +#define _IO_H_ + +#define REGION_USA 0x80 +#define REGION_JAPAN_NTSC 0x00 +#define REGION_EUROPE 0xC0 +#define REGION_JAPAN_PAL 0x40 + +/* Global variables */ +extern uint8 io_reg[0x10]; +extern uint8 region_code; +extern uint8 pad_type; + +/* Function prototypes */ +extern void io_reset(void); +extern void io_write(int offset, int value); +extern int io_read(int offset); + +#endif /* _IO_H_ */ + diff --git a/source/m68k/m68kcpu.c b/source/m68k/m68kcpu.c new file mode 100644 index 0000000..1daadfe --- /dev/null +++ b/source/m68k/m68kcpu.c @@ -0,0 +1,894 @@ +/* ======================================================================== */ +/* ========================= LICENSING & COPYRIGHT ======================== */ +/* ======================================================================== */ + +#if 0 +static const char* copyright_notice = +"MUSASHI\n" +"Version 3.3 (2001-01-29)\n" +"A portable Motorola M680x0 processor emulation engine.\n" +"Copyright 1998-2001 Karl Stenerud. All rights reserved.\n" +"\n" +"This code may be freely used for non-commercial purpooses as long as this\n" +"copyright notice remains unaltered in the source code and any binary files\n" +"containing this code in compiled form.\n" +"\n" +"All other lisencing terms must be negotiated with the author\n" +"(Karl Stenerud).\n" +"\n" +"The latest version of this code can be obtained at:\n" +"http://kstenerud.cjb.net\n" +; +#endif + + +/* ======================================================================== */ +/* ================================= NOTES ================================ */ +/* ======================================================================== */ + + + +/* ======================================================================== */ +/* ================================ INCLUDES ============================== */ +/* ======================================================================== */ + +#include "m68kops.h" +#include "m68kcpu.h" + +/* ======================================================================== */ +/* ================================= DATA ================================= */ +/* ======================================================================== */ + +int m68ki_initial_cycles; +int m68ki_remaining_cycles = 0; /* Number of clocks remaining */ +uint m68ki_tracing = 0; +uint m68ki_address_space; + +#ifdef M68K_LOG_ENABLE +char* m68ki_cpu_names[9] = +{ + "Invalid CPU", + "M68000", + "M68010", + "Invalid CPU", + "M68EC020" + "Invalid CPU", + "Invalid CPU", + "Invalid CPU", + "M68020" +}; +#endif /* M68K_LOG_ENABLE */ + +/* The CPU core */ +m68ki_cpu_core m68ki_cpu = {0}; + +#if M68K_EMULATE_ADDRESS_ERROR +jmp_buf m68ki_address_error_trap; +#endif /* M68K_EMULATE_ADDRESS_ERROR */ + +/* Used by shift & rotate instructions */ +uint8 m68ki_shift_8_table[65] = +{ + 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff +}; +uint16 m68ki_shift_16_table[65] = +{ + 0x0000, 0x8000, 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, + 0xff80, 0xffc0, 0xffe0, 0xfff0, 0xfff8, 0xfffc, 0xfffe, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff +}; +uint m68ki_shift_32_table[65] = +{ + 0x00000000, 0x80000000, 0xc0000000, 0xe0000000, 0xf0000000, 0xf8000000, + 0xfc000000, 0xfe000000, 0xff000000, 0xff800000, 0xffc00000, 0xffe00000, + 0xfff00000, 0xfff80000, 0xfffc0000, 0xfffe0000, 0xffff0000, 0xffff8000, + 0xffffc000, 0xffffe000, 0xfffff000, 0xfffff800, 0xfffffc00, 0xfffffe00, + 0xffffff00, 0xffffff80, 0xffffffc0, 0xffffffe0, 0xfffffff0, 0xfffffff8, + 0xfffffffc, 0xfffffffe, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff +}; + + +/* Number of clock cycles to use for exception processing. + * I used 4 for any vectors that are undocumented for processing times. + */ +uint8 m68ki_exception_cycle_table[3][256] = +{ + { /* 000 */ + 4, /* 0: Reset - Initial Stack Pointer */ + 4, /* 1: Reset - Initial Program Counter */ + 50, /* 2: Bus Error (unemulated) */ + 50, /* 3: Address Error (unemulated) */ + 34, /* 4: Illegal Instruction */ + 38, /* 5: Divide by Zero -- ASG: changed from 42 */ + 40, /* 6: CHK -- ASG: chanaged from 44 */ + 34, /* 7: TRAPV */ + 34, /* 8: Privilege Violation */ + 34, /* 9: Trace */ + 4, /* 10: 1010 */ + 4, /* 11: 1111 */ + 4, /* 12: RESERVED */ + 4, /* 13: Coprocessor Protocol Violation (unemulated) */ + 4, /* 14: Format Error */ + 44, /* 15: Uninitialized Interrupt */ + 4, /* 16: RESERVED */ + 4, /* 17: RESERVED */ + 4, /* 18: RESERVED */ + 4, /* 19: RESERVED */ + 4, /* 20: RESERVED */ + 4, /* 21: RESERVED */ + 4, /* 22: RESERVED */ + 4, /* 23: RESERVED */ + 44, /* 24: Spurious Interrupt */ + 44, /* 25: Level 1 Interrupt Autovector */ + 44, /* 26: Level 2 Interrupt Autovector */ + 44, /* 27: Level 3 Interrupt Autovector */ + 44, /* 28: Level 4 Interrupt Autovector */ + 44, /* 29: Level 5 Interrupt Autovector */ + 44, /* 30: Level 6 Interrupt Autovector */ + 44, /* 31: Level 7 Interrupt Autovector */ + 34, /* 32: TRAP #0 -- ASG: chanaged from 38 */ + 34, /* 33: TRAP #1 */ + 34, /* 34: TRAP #2 */ + 34, /* 35: TRAP #3 */ + 34, /* 36: TRAP #4 */ + 34, /* 37: TRAP #5 */ + 34, /* 38: TRAP #6 */ + 34, /* 39: TRAP #7 */ + 34, /* 40: TRAP #8 */ + 34, /* 41: TRAP #9 */ + 34, /* 42: TRAP #10 */ + 34, /* 43: TRAP #11 */ + 34, /* 44: TRAP #12 */ + 34, /* 45: TRAP #13 */ + 34, /* 46: TRAP #14 */ + 34, /* 47: TRAP #15 */ + 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */ + 4, /* 49: FP Inexact Result (unemulated) */ + 4, /* 50: FP Divide by Zero (unemulated) */ + 4, /* 51: FP Underflow (unemulated) */ + 4, /* 52: FP Operand Error (unemulated) */ + 4, /* 53: FP Overflow (unemulated) */ + 4, /* 54: FP Signaling NAN (unemulated) */ + 4, /* 55: FP Unimplemented Data Type (unemulated) */ + 4, /* 56: MMU Configuration Error (unemulated) */ + 4, /* 57: MMU Illegal Operation Error (unemulated) */ + 4, /* 58: MMU Access Level Violation Error (unemulated) */ + 4, /* 59: RESERVED */ + 4, /* 60: RESERVED */ + 4, /* 61: RESERVED */ + 4, /* 62: RESERVED */ + 4, /* 63: RESERVED */ + /* 64-255: User Defined */ + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 + }, + { /* 010 */ + 4, /* 0: Reset - Initial Stack Pointer */ + 4, /* 1: Reset - Initial Program Counter */ + 126, /* 2: Bus Error (unemulated) */ + 126, /* 3: Address Error (unemulated) */ + 38, /* 4: Illegal Instruction */ + 44, /* 5: Divide by Zero */ + 44, /* 6: CHK */ + 34, /* 7: TRAPV */ + 38, /* 8: Privilege Violation */ + 38, /* 9: Trace */ + 4, /* 10: 1010 */ + 4, /* 11: 1111 */ + 4, /* 12: RESERVED */ + 4, /* 13: Coprocessor Protocol Violation (unemulated) */ + 4, /* 14: Format Error */ + 44, /* 15: Uninitialized Interrupt */ + 4, /* 16: RESERVED */ + 4, /* 17: RESERVED */ + 4, /* 18: RESERVED */ + 4, /* 19: RESERVED */ + 4, /* 20: RESERVED */ + 4, /* 21: RESERVED */ + 4, /* 22: RESERVED */ + 4, /* 23: RESERVED */ + 46, /* 24: Spurious Interrupt */ + 46, /* 25: Level 1 Interrupt Autovector */ + 46, /* 26: Level 2 Interrupt Autovector */ + 46, /* 27: Level 3 Interrupt Autovector */ + 46, /* 28: Level 4 Interrupt Autovector */ + 46, /* 29: Level 5 Interrupt Autovector */ + 46, /* 30: Level 6 Interrupt Autovector */ + 46, /* 31: Level 7 Interrupt Autovector */ + 38, /* 32: TRAP #0 */ + 38, /* 33: TRAP #1 */ + 38, /* 34: TRAP #2 */ + 38, /* 35: TRAP #3 */ + 38, /* 36: TRAP #4 */ + 38, /* 37: TRAP #5 */ + 38, /* 38: TRAP #6 */ + 38, /* 39: TRAP #7 */ + 38, /* 40: TRAP #8 */ + 38, /* 41: TRAP #9 */ + 38, /* 42: TRAP #10 */ + 38, /* 43: TRAP #11 */ + 38, /* 44: TRAP #12 */ + 38, /* 45: TRAP #13 */ + 38, /* 46: TRAP #14 */ + 38, /* 47: TRAP #15 */ + 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */ + 4, /* 49: FP Inexact Result (unemulated) */ + 4, /* 50: FP Divide by Zero (unemulated) */ + 4, /* 51: FP Underflow (unemulated) */ + 4, /* 52: FP Operand Error (unemulated) */ + 4, /* 53: FP Overflow (unemulated) */ + 4, /* 54: FP Signaling NAN (unemulated) */ + 4, /* 55: FP Unimplemented Data Type (unemulated) */ + 4, /* 56: MMU Configuration Error (unemulated) */ + 4, /* 57: MMU Illegal Operation Error (unemulated) */ + 4, /* 58: MMU Access Level Violation Error (unemulated) */ + 4, /* 59: RESERVED */ + 4, /* 60: RESERVED */ + 4, /* 61: RESERVED */ + 4, /* 62: RESERVED */ + 4, /* 63: RESERVED */ + /* 64-255: User Defined */ + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 + }, + { /* 020 */ + 4, /* 0: Reset - Initial Stack Pointer */ + 4, /* 1: Reset - Initial Program Counter */ + 50, /* 2: Bus Error (unemulated) */ + 50, /* 3: Address Error (unemulated) */ + 20, /* 4: Illegal Instruction */ + 38, /* 5: Divide by Zero */ + 40, /* 6: CHK */ + 20, /* 7: TRAPV */ + 34, /* 8: Privilege Violation */ + 25, /* 9: Trace */ + 20, /* 10: 1010 */ + 20, /* 11: 1111 */ + 4, /* 12: RESERVED */ + 4, /* 13: Coprocessor Protocol Violation (unemulated) */ + 4, /* 14: Format Error */ + 30, /* 15: Uninitialized Interrupt */ + 4, /* 16: RESERVED */ + 4, /* 17: RESERVED */ + 4, /* 18: RESERVED */ + 4, /* 19: RESERVED */ + 4, /* 20: RESERVED */ + 4, /* 21: RESERVED */ + 4, /* 22: RESERVED */ + 4, /* 23: RESERVED */ + 30, /* 24: Spurious Interrupt */ + 30, /* 25: Level 1 Interrupt Autovector */ + 30, /* 26: Level 2 Interrupt Autovector */ + 30, /* 27: Level 3 Interrupt Autovector */ + 30, /* 28: Level 4 Interrupt Autovector */ + 30, /* 29: Level 5 Interrupt Autovector */ + 30, /* 30: Level 6 Interrupt Autovector */ + 30, /* 31: Level 7 Interrupt Autovector */ + 20, /* 32: TRAP #0 */ + 20, /* 33: TRAP #1 */ + 20, /* 34: TRAP #2 */ + 20, /* 35: TRAP #3 */ + 20, /* 36: TRAP #4 */ + 20, /* 37: TRAP #5 */ + 20, /* 38: TRAP #6 */ + 20, /* 39: TRAP #7 */ + 20, /* 40: TRAP #8 */ + 20, /* 41: TRAP #9 */ + 20, /* 42: TRAP #10 */ + 20, /* 43: TRAP #11 */ + 20, /* 44: TRAP #12 */ + 20, /* 45: TRAP #13 */ + 20, /* 46: TRAP #14 */ + 20, /* 47: TRAP #15 */ + 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */ + 4, /* 49: FP Inexact Result (unemulated) */ + 4, /* 50: FP Divide by Zero (unemulated) */ + 4, /* 51: FP Underflow (unemulated) */ + 4, /* 52: FP Operand Error (unemulated) */ + 4, /* 53: FP Overflow (unemulated) */ + 4, /* 54: FP Signaling NAN (unemulated) */ + 4, /* 55: FP Unimplemented Data Type (unemulated) */ + 4, /* 56: MMU Configuration Error (unemulated) */ + 4, /* 57: MMU Illegal Operation Error (unemulated) */ + 4, /* 58: MMU Access Level Violation Error (unemulated) */ + 4, /* 59: RESERVED */ + 4, /* 60: RESERVED */ + 4, /* 61: RESERVED */ + 4, /* 62: RESERVED */ + 4, /* 63: RESERVED */ + /* 64-255: User Defined */ + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 + } +}; + +uint8 m68ki_ea_idx_cycle_table[64] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, /* ..01.000 no memory indirect, base NULL */ + 5, /* ..01..01 memory indirect, base NULL, outer NULL */ + 7, /* ..01..10 memory indirect, base NULL, outer 16 */ + 7, /* ..01..11 memory indirect, base NULL, outer 32 */ + 0, 5, 7, 7, 0, 5, 7, 7, 0, 5, 7, 7, + 2, /* ..10.000 no memory indirect, base 16 */ + 7, /* ..10..01 memory indirect, base 16, outer NULL */ + 9, /* ..10..10 memory indirect, base 16, outer 16 */ + 9, /* ..10..11 memory indirect, base 16, outer 32 */ + 0, 7, 9, 9, 0, 7, 9, 9, 0, 7, 9, 9, + 6, /* ..11.000 no memory indirect, base 32 */ + 11, /* ..11..01 memory indirect, base 32, outer NULL */ + 13, /* ..11..10 memory indirect, base 32, outer 16 */ + 13, /* ..11..11 memory indirect, base 32, outer 32 */ + 0, 11, 13, 13, 0, 11, 13, 13, 0, 11, 13, 13 +}; + + + +/* ======================================================================== */ +/* =============================== CALLBACKS ============================== */ +/* ======================================================================== */ + +/* Default callbacks used if the callback hasn't been set yet, or if the + * callback is set to NULL + */ + +/* Interrupt acknowledge */ +static int default_int_ack_callback_data; +static int default_int_ack_callback(int int_level) +{ + default_int_ack_callback_data = int_level; + CPU_INT_LEVEL = 0; + return M68K_INT_ACK_AUTOVECTOR; +} + +/* Breakpoint acknowledge */ +static unsigned int default_bkpt_ack_callback_data; +static void default_bkpt_ack_callback(unsigned int data) +{ + default_bkpt_ack_callback_data = data; +} + +/* Called when a reset instruction is executed */ +static void default_reset_instr_callback(void) +{ +} + +/* Called when the program counter changed by a large value */ +static unsigned int default_pc_changed_callback_data; +static void default_pc_changed_callback(unsigned int new_pc) +{ + default_pc_changed_callback_data = new_pc; +} + +/* Called every time there's bus activity (read/write to/from memory */ +static unsigned int default_set_fc_callback_data; +static void default_set_fc_callback(unsigned int new_fc) +{ + default_set_fc_callback_data = new_fc; +} + +/* Called every instruction cycle prior to execution */ +static void default_instr_hook_callback(void) +{ +} + + + +/* ======================================================================== */ +/* ================================= API ================================== */ +/* ======================================================================== */ + +/* Access the internals of the CPU */ +unsigned int m68k_get_reg(void* context, m68k_register_t regnum) +{ + m68ki_cpu_core* cpu = context != NULL ?(m68ki_cpu_core*)context : &m68ki_cpu; + + switch(regnum) + { + case M68K_REG_D0: return cpu->dar[0]; + case M68K_REG_D1: return cpu->dar[1]; + case M68K_REG_D2: return cpu->dar[2]; + case M68K_REG_D3: return cpu->dar[3]; + case M68K_REG_D4: return cpu->dar[4]; + case M68K_REG_D5: return cpu->dar[5]; + case M68K_REG_D6: return cpu->dar[6]; + case M68K_REG_D7: return cpu->dar[7]; + case M68K_REG_A0: return cpu->dar[8]; + case M68K_REG_A1: return cpu->dar[9]; + case M68K_REG_A2: return cpu->dar[10]; + case M68K_REG_A3: return cpu->dar[11]; + case M68K_REG_A4: return cpu->dar[12]; + case M68K_REG_A5: return cpu->dar[13]; + case M68K_REG_A6: return cpu->dar[14]; + case M68K_REG_A7: return cpu->dar[15]; + case M68K_REG_PC: return MASK_OUT_ABOVE_32(cpu->pc); + case M68K_REG_SR: return cpu->t1_flag | + cpu->t0_flag | + (cpu->s_flag << 11) | + (cpu->m_flag << 11) | + cpu->int_mask | + ((cpu->x_flag & XFLAG_SET) >> 4) | + ((cpu->n_flag & NFLAG_SET) >> 4) | + ((!cpu->not_z_flag) << 2) | + ((cpu->v_flag & VFLAG_SET) >> 6) | + ((cpu->c_flag & CFLAG_SET) >> 8); + case M68K_REG_SP: return cpu->dar[15]; + case M68K_REG_USP: return cpu->s_flag ? cpu->sp[0] : cpu->dar[15]; + case M68K_REG_ISP: return cpu->s_flag && !cpu->m_flag ? cpu->dar[15] : cpu->sp[4]; + case M68K_REG_MSP: return cpu->s_flag && cpu->m_flag ? cpu->dar[15] : cpu->sp[6]; + case M68K_REG_SFC: return cpu->sfc; + case M68K_REG_DFC: return cpu->dfc; + case M68K_REG_VBR: return cpu->vbr; + case M68K_REG_CACR: return cpu->cacr; + case M68K_REG_CAAR: return cpu->caar; + case M68K_REG_PREF_ADDR: return cpu->pref_addr; + case M68K_REG_PREF_DATA: return cpu->pref_data; + case M68K_REG_PPC: return MASK_OUT_ABOVE_32(cpu->ppc); + case M68K_REG_IR: return cpu->ir; + case M68K_REG_CPU_TYPE: + switch(cpu->cpu_type) + { + case CPU_TYPE_000: return (unsigned int)M68K_CPU_TYPE_68000; + case CPU_TYPE_010: return (unsigned int)M68K_CPU_TYPE_68010; + case CPU_TYPE_EC020: return (unsigned int)M68K_CPU_TYPE_68EC020; + case CPU_TYPE_020: return (unsigned int)M68K_CPU_TYPE_68020; + } + return M68K_CPU_TYPE_INVALID; + default: return 0; + } + return 0; +} + +void m68k_set_reg(m68k_register_t regnum, unsigned int value) +{ + switch(regnum) + { + case M68K_REG_D0: REG_D[0] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_D1: REG_D[1] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_D2: REG_D[2] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_D3: REG_D[3] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_D4: REG_D[4] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_D5: REG_D[5] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_D6: REG_D[6] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_D7: REG_D[7] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_A0: REG_A[0] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_A1: REG_A[1] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_A2: REG_A[2] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_A3: REG_A[3] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_A4: REG_A[4] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_A5: REG_A[5] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_A6: REG_A[6] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_A7: REG_A[7] = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_PC: m68ki_jump(MASK_OUT_ABOVE_32(value)); return; + case M68K_REG_SR: m68ki_set_sr(value); return; + case M68K_REG_SP: REG_SP = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_USP: if(FLAG_S) + REG_USP = MASK_OUT_ABOVE_32(value); + else + REG_SP = MASK_OUT_ABOVE_32(value); + return; + case M68K_REG_ISP: if(FLAG_S && !FLAG_M) + REG_SP = MASK_OUT_ABOVE_32(value); + else + REG_ISP = MASK_OUT_ABOVE_32(value); + return; + case M68K_REG_MSP: if(FLAG_S && FLAG_M) + REG_SP = MASK_OUT_ABOVE_32(value); + else + REG_MSP = MASK_OUT_ABOVE_32(value); + return; + case M68K_REG_VBR: REG_VBR = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_SFC: REG_SFC = value & 7; return; + case M68K_REG_DFC: REG_DFC = value & 7; return; + case M68K_REG_CACR: REG_CACR = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_CAAR: REG_CAAR = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_PPC: REG_PPC = MASK_OUT_ABOVE_32(value); return; + case M68K_REG_IR: REG_IR = MASK_OUT_ABOVE_16(value); return; + case M68K_REG_CPU_TYPE: m68k_set_cpu_type(value); return; + default: return; + } +} + +/* Set the callbacks */ +void m68k_set_int_ack_callback(int (*callback)(int int_level)) +{ + CALLBACK_INT_ACK = callback ? callback : default_int_ack_callback; +} + +void m68k_set_bkpt_ack_callback(void (*callback)(unsigned int data)) +{ + CALLBACK_BKPT_ACK = callback ? callback : default_bkpt_ack_callback; +} + +void m68k_set_reset_instr_callback(void (*callback)(void)) +{ + CALLBACK_RESET_INSTR = callback ? callback : default_reset_instr_callback; +} + +void m68k_set_pc_changed_callback(void (*callback)(unsigned int new_pc)) +{ + CALLBACK_PC_CHANGED = callback ? callback : default_pc_changed_callback; +} + +void m68k_set_fc_callback(void (*callback)(unsigned int new_fc)) +{ + CALLBACK_SET_FC = callback ? callback : default_set_fc_callback; +} + +void m68k_set_instr_hook_callback(void (*callback)(void)) +{ + CALLBACK_INSTR_HOOK = callback ? callback : default_instr_hook_callback; +} + +#include +/* Set the CPU type. */ +void m68k_set_cpu_type(unsigned int cpu_type) +{ + switch(cpu_type) + { + case M68K_CPU_TYPE_68000: + CPU_TYPE = CPU_TYPE_000; + CPU_ADDRESS_MASK = 0x00ffffff; + CPU_SR_MASK = 0xa71f; /* T1 -- S -- -- I2 I1 I0 -- -- -- X N Z V C */ + CYC_INSTRUCTION = m68ki_cycles[0]; + CYC_EXCEPTION = m68ki_exception_cycle_table[0]; + CYC_BCC_NOTAKE_B = -2; + CYC_BCC_NOTAKE_W = 2; + CYC_DBCC_F_NOEXP = -2; + CYC_DBCC_F_EXP = 2; + CYC_SCC_R_FALSE = 2; + CYC_MOVEM_W = 2; + CYC_MOVEM_L = 3; + CYC_SHIFT = 1; + CYC_RESET = 132; + return; + case M68K_CPU_TYPE_68010: + CPU_TYPE = CPU_TYPE_010; + CPU_ADDRESS_MASK = 0x00ffffff; + CPU_SR_MASK = 0xa71f; /* T1 -- S -- -- I2 I1 I0 -- -- -- X N Z V C */ + CYC_INSTRUCTION = m68ki_cycles[1]; + CYC_EXCEPTION = m68ki_exception_cycle_table[1]; + CYC_BCC_NOTAKE_B = -4; + CYC_BCC_NOTAKE_W = 0; + CYC_DBCC_F_NOEXP = 0; + CYC_DBCC_F_EXP = 6; + CYC_SCC_R_FALSE = 0; + CYC_MOVEM_W = 2; + CYC_MOVEM_L = 3; + CYC_SHIFT = 1; + CYC_RESET = 130; + return; + case M68K_CPU_TYPE_68EC020: + CPU_TYPE = CPU_TYPE_EC020; + CPU_ADDRESS_MASK = 0x00ffffff; + CPU_SR_MASK = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */ + CYC_INSTRUCTION = m68ki_cycles[2]; + CYC_EXCEPTION = m68ki_exception_cycle_table[2]; + CYC_BCC_NOTAKE_B = -2; + CYC_BCC_NOTAKE_W = 0; + CYC_DBCC_F_NOEXP = 0; + CYC_DBCC_F_EXP = 4; + CYC_SCC_R_FALSE = 0; + CYC_MOVEM_W = 2; + CYC_MOVEM_L = 2; + CYC_SHIFT = 0; + CYC_RESET = 518; + return; + case M68K_CPU_TYPE_68020: + CPU_TYPE = CPU_TYPE_020; + CPU_ADDRESS_MASK = 0xffffffff; + CPU_SR_MASK = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */ + CYC_INSTRUCTION = m68ki_cycles[2]; + CYC_EXCEPTION = m68ki_exception_cycle_table[2]; + CYC_BCC_NOTAKE_B = -2; + CYC_BCC_NOTAKE_W = 0; + CYC_DBCC_F_NOEXP = 0; + CYC_DBCC_F_EXP = 4; + CYC_SCC_R_FALSE = 0; + CYC_MOVEM_W = 2; + CYC_MOVEM_L = 2; + CYC_SHIFT = 0; + CYC_RESET = 518; + return; + } +} + +/* Execute some instructions until we use up num_cycles clock cycles */ +/* ASG: removed per-instruction interrupt checks */ +int m68k_execute(int num_cycles) +{ + /* Make sure we're not stopped */ + if(!CPU_STOPPED) + { + /* Set our pool of clock cycles available */ + SET_CYCLES(num_cycles); + m68ki_initial_cycles = num_cycles; + + /* ASG: update cycles */ + USE_CYCLES(CPU_INT_CYCLES); + CPU_INT_CYCLES = 0; + + /* Return point if we had an address error */ + m68ki_set_address_error_trap(); /* auto-disable (see m68kcpu.h) */ + + /* Main loop. Keep going until we run out of clock cycles */ + do + { + /* Set tracing accodring to T1. (T0 is done inside instruction) */ + m68ki_trace_t1(); /* auto-disable (see m68kcpu.h) */ + + /* Set the address space for reads */ + m68ki_use_data_space(); /* auto-disable (see m68kcpu.h) */ + + /* Call external hook to peek at CPU */ + m68ki_instr_hook(); /* auto-disable (see m68kcpu.h) */ + + /* Record previous program counter */ + REG_PPC = REG_PC; + + /* Read an instruction and call its handler */ + REG_IR = m68ki_read_imm_16(); + m68ki_instruction_jump_table[REG_IR](); + USE_CYCLES(CYC_INSTRUCTION[REG_IR]); + + /* Trace m68k_exception, if necessary */ + m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */ + } while(GET_CYCLES() > 0); + + /* set previous PC to current PC for the next entry into the loop */ + REG_PPC = REG_PC; + + /* ASG: update cycles */ + USE_CYCLES(CPU_INT_CYCLES); + CPU_INT_CYCLES = 0; + + /* return how many clocks we used */ + return m68ki_initial_cycles - GET_CYCLES(); + } + + /* We get here if the CPU is stopped or halted */ + SET_CYCLES(0); + CPU_INT_CYCLES = 0; + + return num_cycles; +} + + +int m68k_cycles_run(void) +{ + return m68ki_initial_cycles - GET_CYCLES(); +} + +int m68k_cycles_remaining(void) +{ + return GET_CYCLES(); +} + +/* Change the timeslice */ +void m68k_modify_timeslice(int cycles) +{ + m68ki_initial_cycles += cycles; + ADD_CYCLES(cycles); +} + + +void m68k_end_timeslice(void) +{ + m68ki_initial_cycles = GET_CYCLES(); + SET_CYCLES(0); +} + + +/* ASG: rewrote so that the int_level is a mask of the IPL0/IPL1/IPL2 bits */ +/* KS: Modified so that IPL* bits match with mask positions in the SR + * and cleaned out remenants of the interrupt controller. + */ +void m68k_set_irq(unsigned int int_level) +{ + uint old_level = CPU_INT_LEVEL; + CPU_INT_LEVEL = int_level << 8; + + /* A transition from < 7 to 7 always interrupts (NMI) */ + /* Note: Level 7 can also level trigger like a normal IRQ */ + if(old_level != 0x0700 && CPU_INT_LEVEL == 0x0700) + m68ki_exception_interrupt(7); /* Edge triggered level 7 (NMI) */ + else + m68ki_check_interrupts(); /* Level triggered (IRQ) */ +} + + +/* Pulse the RESET line on the CPU */ +void m68k_pulse_reset(void) +{ + static uint emulation_initialized = 0; + + /* The first call to this function initializes the opcode handler jump table */ + if(!emulation_initialized) + { + m68ki_build_opcode_table(); + m68k_set_int_ack_callback(NULL); + m68k_set_bkpt_ack_callback(NULL); + m68k_set_reset_instr_callback(NULL); + m68k_set_pc_changed_callback(NULL); + m68k_set_fc_callback(NULL); + m68k_set_instr_hook_callback(NULL); + + emulation_initialized = 1; + } + + + if(CPU_TYPE == 0) /* KW 990319 */ + m68k_set_cpu_type(M68K_CPU_TYPE_68000); + + /* Clear all stop levels and eat up all remaining cycles */ + CPU_STOPPED = 0; + SET_CYCLES(0); + + /* Turn off tracing */ + FLAG_T1 = FLAG_T0 = 0; + m68ki_clear_trace(); + /* Interrupt mask to level 7 */ + FLAG_INT_MASK = 0x0700; + /* Reset VBR */ + REG_VBR = 0; + /* Go to supervisor mode */ + m68ki_set_sm_flag(SFLAG_SET | MFLAG_CLEAR); + + /* Invalidate the prefetch queue */ +#if M68K_EMULATE_PREFETCH + /* Set to arbitrary number since our first fetch is from 0 */ + CPU_PREF_ADDR = 0x1000; +#endif /* M68K_EMULATE_PREFETCH */ + + /* Read the initial stack pointer and program counter */ + m68ki_jump(0); + REG_SP = m68ki_read_imm_32(); + REG_PC = m68ki_read_imm_32(); + m68ki_jump(REG_PC); +} + +/* Pulse the HALT line on the CPU */ +void m68k_pulse_halt(void) +{ + CPU_STOPPED |= STOP_LEVEL_HALT; +} + + +/* Get and set the current CPU context */ +/* This is to allow for multiple CPUs */ +unsigned int m68k_context_size() +{ + return sizeof(m68ki_cpu_core); +} + +unsigned int m68k_get_context(void* dst) +{ + if(dst) *(m68ki_cpu_core*)dst = m68ki_cpu; + return sizeof(m68ki_cpu_core); +} + +void m68k_set_context(void* src) +{ + if(src) m68ki_cpu = *(m68ki_cpu_core*)src; +} + +void m68k_save_context( void (*save_value)(char*, unsigned int)) +{ + if(!save_value) + return; + + save_value("CPU_TYPE" , m68k_get_reg(NULL, M68K_REG_CPU_TYPE)); + save_value("D0" , REG_D[0]); + save_value("D1" , REG_D[1]); + save_value("D2" , REG_D[2]); + save_value("D3" , REG_D[3]); + save_value("D4" , REG_D[4]); + save_value("D5" , REG_D[5]); + save_value("D6" , REG_D[6]); + save_value("D7" , REG_D[7]); + save_value("A0" , REG_A[0]); + save_value("A1" , REG_A[1]); + save_value("A2" , REG_A[2]); + save_value("A3" , REG_A[3]); + save_value("A4" , REG_A[4]); + save_value("A5" , REG_A[5]); + save_value("A6" , REG_A[6]); + save_value("A7" , REG_A[7]); + save_value("PPC" , REG_PPC); + save_value("PC" , REG_PC); + save_value("USP" , REG_USP); + save_value("ISP" , REG_ISP); + save_value("MSP" , REG_MSP); + save_value("VBR" , REG_VBR); + save_value("SFC" , REG_SFC); + save_value("DFC" , REG_DFC); + save_value("CACR" , REG_CACR); + save_value("CAAR" , REG_CAAR); + save_value("SR" , m68ki_get_sr()); + save_value("INT_LEVEL" , CPU_INT_LEVEL); + save_value("INT_CYCLES", CPU_INT_CYCLES); + save_value("STOPPED" , (CPU_STOPPED & STOP_LEVEL_STOP) != 0); + save_value("HALTED" , (CPU_STOPPED & STOP_LEVEL_HALT) != 0); + save_value("PREF_ADDR" , CPU_PREF_ADDR); + save_value("PREF_DATA" , CPU_PREF_DATA); +} + +void m68k_load_context(unsigned int (*load_value)(char*)) +{ + unsigned int temp; + + m68k_set_cpu_type(load_value("CPU_TYPE")); + REG_PPC = load_value("PPC"); + REG_PC = load_value("PC"); + m68ki_jump(REG_PC); + CPU_INT_LEVEL = 0; + m68ki_set_sr_noint(load_value("SR")); + REG_D[0] = load_value("D0"); + REG_D[1] = load_value("D1"); + REG_D[2] = load_value("D2"); + REG_D[3] = load_value("D3"); + REG_D[4] = load_value("D4"); + REG_D[5] = load_value("D5"); + REG_D[6] = load_value("D6"); + REG_D[7] = load_value("D7"); + REG_A[0] = load_value("A0"); + REG_A[1] = load_value("A1"); + REG_A[2] = load_value("A2"); + REG_A[3] = load_value("A3"); + REG_A[4] = load_value("A4"); + REG_A[5] = load_value("A5"); + REG_A[6] = load_value("A6"); + REG_A[7] = load_value("A7"); + REG_USP = load_value("USP"); + REG_ISP = load_value("ISP"); + REG_MSP = load_value("MSP"); + REG_VBR = load_value("VBR"); + REG_SFC = load_value("SFC"); + REG_DFC = load_value("DFC"); + REG_CACR = load_value("CACR"); + REG_CAAR = load_value("CAAR"); + CPU_INT_LEVEL = load_value("INT_LEVEL"); + CPU_INT_CYCLES = load_value("INT_CYCLES"); + + CPU_STOPPED = 0; + temp = load_value("STOPPED"); + if(temp) CPU_STOPPED |= STOP_LEVEL_STOP; + temp = load_value("HALTED"); + if(temp) CPU_STOPPED |= STOP_LEVEL_HALT; + + CPU_PREF_ADDR = load_value("PREF_ADDR"); + CPU_PREF_DATA = load_value("PREF_DATA"); +} + + + +/* ======================================================================== */ +/* ============================== END OF FILE ============================= */ +/* ======================================================================== */ diff --git a/source/m68k/m68kcpu.h b/source/m68k/m68kcpu.h new file mode 100644 index 0000000..8bdb44c --- /dev/null +++ b/source/m68k/m68kcpu.h @@ -0,0 +1,1837 @@ +#include +/* ======================================================================== */ +/* ========================= LICENSING & COPYRIGHT ======================== */ +/* ======================================================================== */ +/* + * MUSASHI + * Version 3.3 + * + * A portable Motorola M680x0 processor emulation engine. + * Copyright 1998-2001 Karl Stenerud. All rights reserved. + * + * This code may be freely used for non-commercial purposes as long as this + * copyright notice remains unaltered in the source code and any binary files + * containing this code in compiled form. + * + * All other lisencing terms must be negotiated with the author + * (Karl Stenerud). + * + * The latest version of this code can be obtained at: + * http://kstenerud.cjb.net + */ + + + + +#ifndef M68KCPU__HEADER +#define M68KCPU__HEADER + +#include "m68k.h" +#include + +#if M68K_EMULATE_ADDRESS_ERROR +#include +#endif /* M68K_EMULATE_ADDRESS_ERROR */ + +/* ======================================================================== */ +/* ==================== ARCHITECTURE-DEPENDANT DEFINES ==================== */ +/* ======================================================================== */ + +/* Check for > 32bit sizes */ +#if UINT_MAX > 0xffffffff + #define M68K_INT_GT_32_BIT 1 +#endif + +/* Data types used in this emulation core */ +#undef sint8 +#undef sint16 +#undef sint32 +#undef sint64 +#undef uint8 +#undef uint16 +#undef uint32 +#undef uint64 +#undef sint +#undef uint + +#define sint8 signed char /* ASG: changed from char to signed char */ +#define sint16 signed short +#define sint32 signed long +#define uint8 unsigned char +#define uint16 unsigned short +#define uint32 unsigned long + +/* signed and unsigned int must be at least 32 bits wide */ +#define sint signed int +#define uint unsigned int + + +#if M68K_USE_64_BIT +#define sint64 signed long long +#define uint64 unsigned long long +#else +#define sint64 sint32 +#define uint64 uint32 +#endif /* M68K_USE_64_BIT */ + + + +/* Allow for architectures that don't have 8-bit sizes */ +#if UCHAR_MAX == 0xff + #define MAKE_INT_8(A) (sint8)(A) +#else + #undef sint8 + #define sint8 signed int + #undef uint8 + #define uint8 unsigned int + INLINE sint MAKE_INT_8(uint value) + { + return (value & 0x80) ? value | ~0xff : value & 0xff; + } +#endif /* UCHAR_MAX == 0xff */ + + +/* Allow for architectures that don't have 16-bit sizes */ +#if USHRT_MAX == 0xffff + #define MAKE_INT_16(A) (sint16)(A) +#else + #undef sint16 + #define sint16 signed int + #undef uint16 + #define uint16 unsigned int + INLINE sint MAKE_INT_16(uint value) + { + return (value & 0x8000) ? value | ~0xffff : value & 0xffff; + } +#endif /* USHRT_MAX == 0xffff */ + + +/* Allow for architectures that don't have 32-bit sizes */ +#if ULONG_MAX == 0xffffffff + #define MAKE_INT_32(A) (sint32)(A) +#else + #undef sint32 + #define sint32 signed int + #undef uint32 + #define uint32 unsigned int + INLINE sint MAKE_INT_32(uint value) + { + return (value & 0x80000000) ? value | ~0xffffffff : value & 0xffffffff; + } +#endif /* ULONG_MAX == 0xffffffff */ + + + + +/* ======================================================================== */ +/* ============================ GENERAL DEFINES =========================== */ +/* ======================================================================== */ + +/* Exception Vectors handled by emulation */ +#define EXCEPTION_BUS_ERROR 2 /* This one is not emulated! */ +#define EXCEPTION_ADDRESS_ERROR 3 /* This one is partially emulated (doesn't stack a proper frame yet) */ +#define EXCEPTION_ILLEGAL_INSTRUCTION 4 +#define EXCEPTION_ZERO_DIVIDE 5 +#define EXCEPTION_CHK 6 +#define EXCEPTION_TRAPV 7 +#define EXCEPTION_PRIVILEGE_VIOLATION 8 +#define EXCEPTION_TRACE 9 +#define EXCEPTION_1010 10 +#define EXCEPTION_1111 11 +#define EXCEPTION_FORMAT_ERROR 14 +#define EXCEPTION_UNINITIALIZED_INTERRUPT 15 +#define EXCEPTION_SPURIOUS_INTERRUPT 24 +#define EXCEPTION_INTERRUPT_AUTOVECTOR 24 +#define EXCEPTION_TRAP_BASE 32 + +/* Function codes set by CPU during data/address bus activity */ +#define FUNCTION_CODE_USER_DATA 1 +#define FUNCTION_CODE_USER_PROGRAM 2 +#define FUNCTION_CODE_SUPERVISOR_DATA 5 +#define FUNCTION_CODE_SUPERVISOR_PROGRAM 6 +#define FUNCTION_CODE_CPU_SPACE 7 + +/* CPU types for deciding what to emulate */ +#define CPU_TYPE_000 1 +#define CPU_TYPE_010 2 +#define CPU_TYPE_EC020 4 +#define CPU_TYPE_020 8 + +/* Different ways to stop the CPU */ +#define STOP_LEVEL_STOP 1 +#define STOP_LEVEL_HALT 2 + +#ifndef NULL +#define NULL ((void*)0) +#endif + +/* ======================================================================== */ +/* ================================ MACROS ================================ */ +/* ======================================================================== */ + + +/* ---------------------------- General Macros ---------------------------- */ + +/* Bit Isolation Macros */ +#define BIT_0(A) ((A) & 0x00000001) +#define BIT_1(A) ((A) & 0x00000002) +#define BIT_2(A) ((A) & 0x00000004) +#define BIT_3(A) ((A) & 0x00000008) +#define BIT_4(A) ((A) & 0x00000010) +#define BIT_5(A) ((A) & 0x00000020) +#define BIT_6(A) ((A) & 0x00000040) +#define BIT_7(A) ((A) & 0x00000080) +#define BIT_8(A) ((A) & 0x00000100) +#define BIT_9(A) ((A) & 0x00000200) +#define BIT_A(A) ((A) & 0x00000400) +#define BIT_B(A) ((A) & 0x00000800) +#define BIT_C(A) ((A) & 0x00001000) +#define BIT_D(A) ((A) & 0x00002000) +#define BIT_E(A) ((A) & 0x00004000) +#define BIT_F(A) ((A) & 0x00008000) +#define BIT_10(A) ((A) & 0x00010000) +#define BIT_11(A) ((A) & 0x00020000) +#define BIT_12(A) ((A) & 0x00040000) +#define BIT_13(A) ((A) & 0x00080000) +#define BIT_14(A) ((A) & 0x00100000) +#define BIT_15(A) ((A) & 0x00200000) +#define BIT_16(A) ((A) & 0x00400000) +#define BIT_17(A) ((A) & 0x00800000) +#define BIT_18(A) ((A) & 0x01000000) +#define BIT_19(A) ((A) & 0x02000000) +#define BIT_1A(A) ((A) & 0x04000000) +#define BIT_1B(A) ((A) & 0x08000000) +#define BIT_1C(A) ((A) & 0x10000000) +#define BIT_1D(A) ((A) & 0x20000000) +#define BIT_1E(A) ((A) & 0x40000000) +#define BIT_1F(A) ((A) & 0x80000000) + +/* Get the most significant bit for specific sizes */ +#define GET_MSB_8(A) ((A) & 0x80) +#define GET_MSB_9(A) ((A) & 0x100) +#define GET_MSB_16(A) ((A) & 0x8000) +#define GET_MSB_17(A) ((A) & 0x10000) +#define GET_MSB_32(A) ((A) & 0x80000000) +#if M68K_USE_64_BIT +#define GET_MSB_33(A) ((A) & 0x100000000) +#endif /* M68K_USE_64_BIT */ + +/* Isolate nibbles */ +#define LOW_NIBBLE(A) ((A) & 0x0f) +#define HIGH_NIBBLE(A) ((A) & 0xf0) + +/* These are used to isolate 8, 16, and 32 bit sizes */ +#define MASK_OUT_ABOVE_2(A) ((A) & 3) +#define MASK_OUT_ABOVE_8(A) ((A) & 0xff) +#define MASK_OUT_ABOVE_16(A) ((A) & 0xffff) +#define MASK_OUT_BELOW_2(A) ((A) & ~3) +#define MASK_OUT_BELOW_8(A) ((A) & ~0xff) +#define MASK_OUT_BELOW_16(A) ((A) & ~0xffff) + +/* No need to mask if we are 32 bit */ +#if M68K_INT_GT_32BIT || M68K_USE_64_BIT + #define MASK_OUT_ABOVE_32(A) ((A) & 0xffffffff) + #define MASK_OUT_BELOW_32(A) ((A) & ~0xffffffff) +#else + #define MASK_OUT_ABOVE_32(A) (A) + #define MASK_OUT_BELOW_32(A) 0 +#endif /* M68K_INT_GT_32BIT || M68K_USE_64_BIT */ + +/* Simulate address lines of 68k family */ +#define ADDRESS_68K(A) ((A)&CPU_ADDRESS_MASK) + + +/* Shift & Rotate Macros. */ +#define LSL(A, C) ((A) << (C)) +#define LSR(A, C) ((A) >> (C)) + +/* Some > 32-bit optimizations */ +#if M68K_INT_GT_32BIT + /* Shift left and right */ + #define LSR_32(A, C) ((A) >> (C)) + #define LSL_32(A, C) ((A) << (C)) +#else + /* We have to do this because the morons at ANSI decided that shifts + * by >= data size are undefined. + */ + #define LSR_32(A, C) ((C) < 32 ? (A) >> (C) : 0) + #define LSL_32(A, C) ((C) < 32 ? (A) << (C) : 0) +#endif /* M68K_INT_GT_32BIT */ + +#if M68K_USE_64_BIT + #define LSL_32_64(A, C) ((A) << (C)) + #define LSR_32_64(A, C) ((A) >> (C)) + #define ROL_33_64(A, C) (LSL_32_64(A, C) | LSR_32_64(A, 33-(C))) + #define ROR_33_64(A, C) (LSR_32_64(A, C) | LSL_32_64(A, 33-(C))) +#endif /* M68K_USE_64_BIT */ + +#define ROL_8(A, C) MASK_OUT_ABOVE_8(LSL(A, C) | LSR(A, 8-(C))) +#define ROL_9(A, C) (LSL(A, C) | LSR(A, 9-(C))) +#define ROL_16(A, C) MASK_OUT_ABOVE_16(LSL(A, C) | LSR(A, 16-(C))) +#define ROL_17(A, C) (LSL(A, C) | LSR(A, 17-(C))) +#define ROL_32(A, C) MASK_OUT_ABOVE_32(LSL_32(A, C) | LSR_32(A, 32-(C))) +#define ROL_33(A, C) (LSL_32(A, C) | LSR_32(A, 33-(C))) + +#define ROR_8(A, C) MASK_OUT_ABOVE_8(LSR(A, C) | LSL(A, 8-(C))) +#define ROR_9(A, C) (LSR(A, C) | LSL(A, 9-(C))) +#define ROR_16(A, C) MASK_OUT_ABOVE_16(LSR(A, C) | LSL(A, 16-(C))) +#define ROR_17(A, C) (LSR(A, C) | LSL(A, 17-(C))) +#define ROR_32(A, C) MASK_OUT_ABOVE_32(LSR_32(A, C) | LSL_32(A, 32-(C))) +#define ROR_33(A, C) (LSR_32(A, C) | LSL_32(A, 33-(C))) + + + +/* ------------------------------ CPU Access ------------------------------ */ + +/* Access the CPU registers */ +#define CPU_TYPE m68ki_cpu.cpu_type + +#define REG_DA m68ki_cpu.dar /* easy access to data and address regs */ +#define REG_D m68ki_cpu.dar +#define REG_A (m68ki_cpu.dar+8) +#define REG_PPC m68ki_cpu.ppc +#define REG_PC m68ki_cpu.pc +#define REG_SP_BASE m68ki_cpu.sp +#define REG_USP m68ki_cpu.sp[0] +#define REG_ISP m68ki_cpu.sp[4] +#define REG_MSP m68ki_cpu.sp[6] +#define REG_SP m68ki_cpu.dar[15] +#define REG_VBR m68ki_cpu.vbr +#define REG_SFC m68ki_cpu.sfc +#define REG_DFC m68ki_cpu.dfc +#define REG_CACR m68ki_cpu.cacr +#define REG_CAAR m68ki_cpu.caar +#define REG_IR m68ki_cpu.ir + +#define FLAG_T1 m68ki_cpu.t1_flag +#define FLAG_T0 m68ki_cpu.t0_flag +#define FLAG_S m68ki_cpu.s_flag +#define FLAG_M m68ki_cpu.m_flag +#define FLAG_X m68ki_cpu.x_flag +#define FLAG_N m68ki_cpu.n_flag +#define FLAG_Z m68ki_cpu.not_z_flag +#define FLAG_V m68ki_cpu.v_flag +#define FLAG_C m68ki_cpu.c_flag +#define FLAG_INT_MASK m68ki_cpu.int_mask + +#define CPU_INT_LEVEL m68ki_cpu.int_level /* ASG: changed from CPU_INTS_PENDING */ +#define CPU_INT_CYCLES m68ki_cpu.int_cycles /* ASG */ +#define CPU_STOPPED m68ki_cpu.stopped +#define CPU_PREF_ADDR m68ki_cpu.pref_addr +#define CPU_PREF_DATA m68ki_cpu.pref_data +#define CPU_ADDRESS_MASK m68ki_cpu.address_mask +#define CPU_SR_MASK m68ki_cpu.sr_mask + +#define CYC_INSTRUCTION m68ki_cpu.cyc_instruction +#define CYC_EXCEPTION m68ki_cpu.cyc_exception +#define CYC_BCC_NOTAKE_B m68ki_cpu.cyc_bcc_notake_b +#define CYC_BCC_NOTAKE_W m68ki_cpu.cyc_bcc_notake_w +#define CYC_DBCC_F_NOEXP m68ki_cpu.cyc_dbcc_f_noexp +#define CYC_DBCC_F_EXP m68ki_cpu.cyc_dbcc_f_exp +#define CYC_SCC_R_FALSE m68ki_cpu.cyc_scc_r_false +#define CYC_MOVEM_W m68ki_cpu.cyc_movem_w +#define CYC_MOVEM_L m68ki_cpu.cyc_movem_l +#define CYC_SHIFT m68ki_cpu.cyc_shift +#define CYC_RESET m68ki_cpu.cyc_reset + + +#define CALLBACK_INT_ACK m68ki_cpu.int_ack_callback +#define CALLBACK_BKPT_ACK m68ki_cpu.bkpt_ack_callback +#define CALLBACK_RESET_INSTR m68ki_cpu.reset_instr_callback +#define CALLBACK_PC_CHANGED m68ki_cpu.pc_changed_callback +#define CALLBACK_SET_FC m68ki_cpu.set_fc_callback +#define CALLBACK_INSTR_HOOK m68ki_cpu.instr_hook_callback + + + +/* ----------------------------- Configuration ---------------------------- */ + +/* These defines are dependant on the configuration defines in m68kconf.h */ + +/* Disable certain comparisons if we're not using all CPU types */ +#if M68K_EMULATE_020 + #define CPU_TYPE_IS_020_PLUS(A) ((A) & CPU_TYPE_020) + #define CPU_TYPE_IS_020_LESS(A) 1 +#else + #define CPU_TYPE_IS_020_PLUS(A) 0 + #define CPU_TYPE_IS_020_LESS(A) 1 +#endif + +#if M68K_EMULATE_EC020 + #define CPU_TYPE_IS_EC020_PLUS(A) ((A) & (CPU_TYPE_EC020 | CPU_TYPE_020)) + #define CPU_TYPE_IS_EC020_LESS(A) ((A) & (CPU_TYPE_000 | CPU_TYPE_010 | CPU_TYPE_EC020)) +#else + #define CPU_TYPE_IS_EC020_PLUS(A) CPU_TYPE_IS_020_PLUS(A) + #define CPU_TYPE_IS_EC020_LESS(A) CPU_TYPE_IS_020_LESS(A) +#endif + +#if M68K_EMULATE_010 + #define CPU_TYPE_IS_010(A) ((A) == CPU_TYPE_010) + #define CPU_TYPE_IS_010_PLUS(A) ((A) & (CPU_TYPE_010 | CPU_TYPE_EC020 | CPU_TYPE_020)) + #define CPU_TYPE_IS_010_LESS(A) ((A) & (CPU_TYPE_000 | CPU_TYPE_010)) +#else + #define CPU_TYPE_IS_010(A) 0 + #define CPU_TYPE_IS_010_PLUS(A) CPU_TYPE_IS_EC020_PLUS(A) + #define CPU_TYPE_IS_010_LESS(A) CPU_TYPE_IS_EC020_LESS(A) +#endif + +#if M68K_EMULATE_020 || M68K_EMULATE_EC020 + #define CPU_TYPE_IS_020_VARIANT(A) ((A) & (CPU_TYPE_EC020 | CPU_TYPE_020)) +#else + #define CPU_TYPE_IS_020_VARIANT(A) 0 +#endif + +#if M68K_EMULATE_020 || M68K_EMULATE_EC020 || M68K_EMULATE_010 + #define CPU_TYPE_IS_000(A) ((A) == CPU_TYPE_000) +#else + #define CPU_TYPE_IS_000(A) 1 +#endif + + +#if !M68K_SEPARATE_READS +#define m68k_read_immediate_16(A) m68ki_read_program_16(A) +#define m68k_read_immediate_32(A) m68ki_read_program_32(A) + +#define m68k_read_pcrelative_8(A) m68ki_read_program_8(A) +#define m68k_read_pcrelative_16(A) m68ki_read_program_16(A) +#define m68k_read_pcrelative_32(A) m68ki_read_program_32(A) +#endif /* M68K_SEPARATE_READS */ + + +/* Enable or disable callback functions */ +#if M68K_EMULATE_INT_ACK + #if M68K_EMULATE_INT_ACK == OPT_SPECIFY_HANDLER + #define m68ki_int_ack(A) M68K_INT_ACK_CALLBACK(A) + #else + #define m68ki_int_ack(A) CALLBACK_INT_ACK(A) + #endif +#else + /* Default action is to used autovector mode, which is most common */ + #define m68ki_int_ack(A) M68K_INT_ACK_AUTOVECTOR +#endif /* M68K_EMULATE_INT_ACK */ + +#if M68K_EMULATE_BKPT_ACK + #if M68K_EMULATE_BKPT_ACK == OPT_SPECIFY_HANDLER + #define m68ki_bkpt_ack(A) M68K_BKPT_ACK_CALLBACK(A) + #else + #define m68ki_bkpt_ack(A) CALLBACK_BKPT_ACK(A) + #endif +#else + #define m68ki_bkpt_ack(A) +#endif /* M68K_EMULATE_BKPT_ACK */ + +#if M68K_EMULATE_RESET + #if M68K_EMULATE_RESET == OPT_SPECIFY_HANDLER + #define m68ki_output_reset() M68K_RESET_CALLBACK() + #else + #define m68ki_output_reset() CALLBACK_RESET_INSTR() + #endif +#else + #define m68ki_output_reset() +#endif /* M68K_EMULATE_RESET */ + +#if M68K_INSTRUCTION_HOOK + #if M68K_INSTRUCTION_HOOK == OPT_SPECIFY_HANDLER + #define m68ki_instr_hook() M68K_INSTRUCTION_CALLBACK() + #else + #define m68ki_instr_hook() CALLBACK_INSTR_HOOK() + #endif +#else + #define m68ki_instr_hook() +#endif /* M68K_INSTRUCTION_HOOK */ + +#if M68K_MONITOR_PC + #if M68K_MONITOR_PC == OPT_SPECIFY_HANDLER + #define m68ki_pc_changed(A) M68K_SET_PC_CALLBACK(ADDRESS_68K(A)) + #else + #define m68ki_pc_changed(A) CALLBACK_PC_CHANGED(ADDRESS_68K(A)) + #endif +#else + #define m68ki_pc_changed(A) +#endif /* M68K_MONITOR_PC */ + + +/* Enable or disable function code emulation */ +#if M68K_EMULATE_FC + #if M68K_EMULATE_FC == OPT_SPECIFY_HANDLER + #define m68ki_set_fc(A) M68K_SET_FC_CALLBACK(A) + #else + #define m68ki_set_fc(A) CALLBACK_SET_FC(A) + #endif + #define m68ki_use_data_space() m68ki_address_space = FUNCTION_CODE_USER_DATA + #define m68ki_use_program_space() m68ki_address_space = FUNCTION_CODE_USER_PROGRAM + #define m68ki_get_address_space() m68ki_address_space +#else + #define m68ki_set_fc(A) + #define m68ki_use_data_space() + #define m68ki_use_program_space() + #define m68ki_get_address_space() FUNCTION_CODE_USER_DATA +#endif /* M68K_EMULATE_FC */ + + +/* Enable or disable trace emulation */ +#if M68K_EMULATE_TRACE + /* Initiates trace checking before each instruction (t1) */ + #define m68ki_trace_t1() m68ki_tracing = FLAG_T1 + /* adds t0 to trace checking if we encounter change of flow */ + #define m68ki_trace_t0() m68ki_tracing |= FLAG_T0 + /* Clear all tracing */ + #define m68ki_clear_trace() m68ki_tracing = 0 + /* Cause a trace exception if we are tracing */ + #define m68ki_exception_if_trace() if(m68ki_tracing) m68ki_exception_trace() +#else + #define m68ki_trace_t1() + #define m68ki_trace_t0() + #define m68ki_clear_trace() + #define m68ki_exception_if_trace() +#endif /* M68K_EMULATE_TRACE */ + + + +/* Address error */ +#if M68K_EMULATE_ADDRESS_ERROR + extern jmp_buf m68ki_address_error_trap; + #define m68ki_set_address_error_trap() if(setjmp(m68ki_address_error_trap)) m68ki_exception_address_error(); + #define m68ki_check_address_error(A) if((A)&1) longjmp(m68ki_address_error_jump, 1); +#else + #define m68ki_set_address_error_trap() + #define m68ki_check_address_error(A) +#endif /* M68K_ADDRESS_ERROR */ + +/* Logging */ +#if M68K_LOG_ENABLE + #include + extern FILE* M68K_LOG_FILEHANDLE + extern char* m68ki_cpu_names[]; + + #define M68K_DO_LOG(A) if(M68K_LOG_FILEHANDLE) fprintf A + #if M68K_LOG_1010_1111 + #define M68K_DO_LOG_EMU(A) if(M68K_LOG_FILEHANDLE) fprintf A + #else + #define M68K_DO_LOG_EMU(A) + #endif +#else + #define M68K_DO_LOG(A) + #define M68K_DO_LOG_EMU(A) +#endif + + + +/* -------------------------- EA / Operand Access ------------------------- */ + +/* + * The general instruction format follows this pattern: + * .... XXX. .... .YYY + * where XXX is register X and YYY is register Y + */ +/* Data Register Isolation */ +#define DX (REG_D[(REG_IR >> 9) & 7]) +#define DY (REG_D[REG_IR & 7]) +/* Address Register Isolation */ +#define AX (REG_A[(REG_IR >> 9) & 7]) +#define AY (REG_A[REG_IR & 7]) + + +/* Effective Address Calculations */ +#define EA_AY_AI_8() AY /* address register indirect */ +#define EA_AY_AI_16() EA_AY_AI_8() +#define EA_AY_AI_32() EA_AY_AI_8() +#define EA_AY_PI_8() (AY++) /* postincrement (size = byte) */ +#define EA_AY_PI_16() ((AY+=2)-2) /* postincrement (size = word) */ +#define EA_AY_PI_32() ((AY+=4)-4) /* postincrement (size = long) */ +#define EA_AY_PD_8() (--AY) /* predecrement (size = byte) */ +#define EA_AY_PD_16() (AY-=2) /* predecrement (size = word) */ +#define EA_AY_PD_32() (AY-=4) /* predecrement (size = long) */ +#define EA_AY_DI_8() (AY+MAKE_INT_16(m68ki_read_imm_16())) /* displacement */ +#define EA_AY_DI_16() EA_AY_DI_8() +#define EA_AY_DI_32() EA_AY_DI_8() +#define EA_AY_IX_8() m68ki_get_ea_ix(AY) /* indirect + index */ +#define EA_AY_IX_16() EA_AY_IX_8() +#define EA_AY_IX_32() EA_AY_IX_8() + +#define EA_AX_AI_8() AX +#define EA_AX_AI_16() EA_AX_AI_8() +#define EA_AX_AI_32() EA_AX_AI_8() +#define EA_AX_PI_8() (AX++) +#define EA_AX_PI_16() ((AX+=2)-2) +#define EA_AX_PI_32() ((AX+=4)-4) +#define EA_AX_PD_8() (--AX) +#define EA_AX_PD_16() (AX-=2) +#define EA_AX_PD_32() (AX-=4) +#define EA_AX_DI_8() (AX+MAKE_INT_16(m68ki_read_imm_16())) +#define EA_AX_DI_16() EA_AX_DI_8() +#define EA_AX_DI_32() EA_AX_DI_8() +#define EA_AX_IX_8() m68ki_get_ea_ix(AX) +#define EA_AX_IX_16() EA_AX_IX_8() +#define EA_AX_IX_32() EA_AX_IX_8() + +#define EA_A7_PI_8() ((REG_A[7]+=2)-2) +#define EA_A7_PD_8() (REG_A[7]-=2) + +#define EA_AW_8() MAKE_INT_16(m68ki_read_imm_16()) /* absolute word */ +#define EA_AW_16() EA_AW_8() +#define EA_AW_32() EA_AW_8() +#define EA_AL_8() m68ki_read_imm_32() /* absolute long */ +#define EA_AL_16() EA_AL_8() +#define EA_AL_32() EA_AL_8() +#define EA_PCDI_8() m68ki_get_ea_pcdi() /* pc indirect + displacement */ +#define EA_PCDI_16() EA_PCDI_8() +#define EA_PCDI_32() EA_PCDI_8() +#define EA_PCIX_8() m68ki_get_ea_pcix() /* pc indirect + index */ +#define EA_PCIX_16() EA_PCIX_8() +#define EA_PCIX_32() EA_PCIX_8() + + +#define OPER_I_8() m68ki_read_imm_8() +#define OPER_I_16() m68ki_read_imm_16() +#define OPER_I_32() m68ki_read_imm_32() + + + +/* --------------------------- Status Register ---------------------------- */ + +/* Flag Calculation Macros */ +#define CFLAG_8(A) (A) +#define CFLAG_16(A) ((A)>>8) + +#if M68K_INT_GT_32_BIT + #define CFLAG_ADD_32(S, D, R) ((R)>>24) + #define CFLAG_SUB_32(S, D, R) ((R)>>24) +#else + #define CFLAG_ADD_32(S, D, R) (((S & D) | (~R & (S | D)))>>23) + #define CFLAG_SUB_32(S, D, R) (((S & R) | (~D & (S | R)))>>23) +#endif /* M68K_INT_GT_32_BIT */ + +#define VFLAG_ADD_8(S, D, R) ((S^R) & (D^R)) +#define VFLAG_ADD_16(S, D, R) (((S^R) & (D^R))>>8) +#define VFLAG_ADD_32(S, D, R) (((S^R) & (D^R))>>24) + +#define VFLAG_SUB_8(S, D, R) ((S^D) & (R^D)) +#define VFLAG_SUB_16(S, D, R) (((S^D) & (R^D))>>8) +#define VFLAG_SUB_32(S, D, R) (((S^D) & (R^D))>>24) + +#define NFLAG_8(A) (A) +#define NFLAG_16(A) ((A)>>8) +#define NFLAG_32(A) ((A)>>24) +#define NFLAG_64(A) ((A)>>56) + +#define ZFLAG_8(A) MASK_OUT_ABOVE_8(A) +#define ZFLAG_16(A) MASK_OUT_ABOVE_16(A) +#define ZFLAG_32(A) MASK_OUT_ABOVE_32(A) + + +/* Flag values */ +#define NFLAG_SET 0x80 +#define NFLAG_CLEAR 0 +#define CFLAG_SET 0x100 +#define CFLAG_CLEAR 0 +#define XFLAG_SET 0x100 +#define XFLAG_CLEAR 0 +#define VFLAG_SET 0x80 +#define VFLAG_CLEAR 0 +#define ZFLAG_SET 0 +#define ZFLAG_CLEAR 0xffffffff + +#define SFLAG_SET 4 +#define SFLAG_CLEAR 0 +#define MFLAG_SET 2 +#define MFLAG_CLEAR 0 + +/* Turn flag values into 1 or 0 */ +#define XFLAG_AS_1() ((FLAG_X>>8)&1) +#define NFLAG_AS_1() ((FLAG_N>>7)&1) +#define VFLAG_AS_1() ((FLAG_V>>7)&1) +#define ZFLAG_AS_1() (!FLAG_Z) +#define CFLAG_AS_1() ((FLAG_C>>8)&1) + + +/* Conditions */ +#define COND_CS() (FLAG_C&0x100) +#define COND_CC() (!COND_CS()) +#define COND_VS() (FLAG_V&0x80) +#define COND_VC() (!COND_VS()) +#define COND_NE() FLAG_Z +#define COND_EQ() (!COND_NE()) +#define COND_MI() (FLAG_N&0x80) +#define COND_PL() (!COND_MI()) +#define COND_LT() ((FLAG_N^FLAG_V)&0x80) +#define COND_GE() (!COND_LT()) +#define COND_HI() (COND_CC() && COND_NE()) +#define COND_LS() (COND_CS() || COND_EQ()) +#define COND_GT() (COND_GE() && COND_NE()) +#define COND_LE() (COND_LT() || COND_EQ()) + +/* Reversed conditions */ +#define COND_NOT_CS() COND_CC() +#define COND_NOT_CC() COND_CS() +#define COND_NOT_VS() COND_VC() +#define COND_NOT_VC() COND_VS() +#define COND_NOT_NE() COND_EQ() +#define COND_NOT_EQ() COND_NE() +#define COND_NOT_MI() COND_PL() +#define COND_NOT_PL() COND_MI() +#define COND_NOT_LT() COND_GE() +#define COND_NOT_GE() COND_LT() +#define COND_NOT_HI() COND_LS() +#define COND_NOT_LS() COND_HI() +#define COND_NOT_GT() COND_LE() +#define COND_NOT_LE() COND_GT() + +/* Not real conditions, but here for convenience */ +#define COND_XS() (FLAG_X&0x100) +#define COND_XC() (!COND_XS) + + +/* Get the condition code register */ +#define m68ki_get_ccr() ((COND_XS() >> 4) | \ + (COND_MI() >> 4) | \ + (COND_EQ() << 2) | \ + (COND_VS() >> 6) | \ + (COND_CS() >> 8)) + +/* Get the status register */ +#define m68ki_get_sr() ( FLAG_T1 | \ + FLAG_T0 | \ + (FLAG_S << 11) | \ + (FLAG_M << 11) | \ + FLAG_INT_MASK | \ + m68ki_get_ccr()) + + + +/* ---------------------------- Cycle Counting ---------------------------- */ + +#define ADD_CYCLES(A) m68ki_remaining_cycles += (A) +#define USE_CYCLES(A) m68ki_remaining_cycles -= (A) +#define SET_CYCLES(A) m68ki_remaining_cycles = A +#define GET_CYCLES() m68ki_remaining_cycles +#define USE_ALL_CYCLES() m68ki_remaining_cycles = 0 + + + +/* ----------------------------- Read / Write ----------------------------- */ + +/* Read from the current address space */ +#define m68ki_read_8(A) m68ki_read_8_fc (A, FLAG_S | m68ki_get_address_space()) +#define m68ki_read_16(A) m68ki_read_16_fc(A, FLAG_S | m68ki_get_address_space()) +#define m68ki_read_32(A) m68ki_read_32_fc(A, FLAG_S | m68ki_get_address_space()) + +/* Write to the current data space */ +#define m68ki_write_8(A, V) m68ki_write_8_fc (A, FLAG_S | FUNCTION_CODE_USER_DATA, V) +#define m68ki_write_16(A, V) m68ki_write_16_fc(A, FLAG_S | FUNCTION_CODE_USER_DATA, V) +#define m68ki_write_32(A, V) m68ki_write_32_fc(A, FLAG_S | FUNCTION_CODE_USER_DATA, V) + +/* map read immediate 8 to read immediate 16 */ +#define m68ki_read_imm_8() MASK_OUT_ABOVE_8(m68ki_read_imm_16()) + +/* Map PC-relative reads */ +#define m68ki_read_pcrel_8(A) m68k_read_pcrelative_8(A) +#define m68ki_read_pcrel_16(A) m68k_read_pcrelative_16(A) +#define m68ki_read_pcrel_32(A) m68k_read_pcrelative_32(A) + +/* Read from the program space */ +#define m68ki_read_program_8(A) m68ki_read_8_fc(A, FLAG_S | FUNCTION_CODE_USER_PROGRAM) +#define m68ki_read_program_16(A) m68ki_read_16_fc(A, FLAG_S | FUNCTION_CODE_USER_PROGRAM) +#define m68ki_read_program_32(A) m68ki_read_32_fc(A, FLAG_S | FUNCTION_CODE_USER_PROGRAM) + +/* Read from the data space */ +#define m68ki_read_data_8(A) m68ki_read_8_fc(A, FLAG_S | FUNCTION_CODE_USER_DATA) +#define m68ki_read_data_16(A) m68ki_read_16_fc(A, FLAG_S | FUNCTION_CODE_USER_DATA) +#define m68ki_read_data_32(A) m68ki_read_32_fc(A, FLAG_S | FUNCTION_CODE_USER_DATA) + + + +/* ======================================================================== */ +/* =============================== PROTOTYPES ============================= */ +/* ======================================================================== */ + +typedef struct +{ + uint cpu_type; /* CPU Type: 68000, 68010, 68EC020, or 68020 */ + uint dar[16]; /* Data and Address Registers */ + uint ppc; /* Previous program counter */ + uint pc; /* Program Counter */ + uint sp[7]; /* User, Interrupt, and Master Stack Pointers */ + uint vbr; /* Vector Base Register (m68010+) */ + uint sfc; /* Source Function Code Register (m68010+) */ + uint dfc; /* Destination Function Code Register (m68010+) */ + uint cacr; /* Cache Control Register (m68020, unemulated) */ + uint caar; /* Cache Address Register (m68020, unemulated) */ + uint ir; /* Instruction Register */ + uint t1_flag; /* Trace 1 */ + uint t0_flag; /* Trace 0 */ + uint s_flag; /* Supervisor */ + uint m_flag; /* Master/Interrupt state */ + uint x_flag; /* Extend */ + uint n_flag; /* Negative */ + uint not_z_flag; /* Zero, inverted for speedups */ + uint v_flag; /* Overflow */ + uint c_flag; /* Carry */ + uint int_mask; /* I0-I2 */ + uint int_level; /* State of interrupt pins IPL0-IPL2 -- ASG: changed from ints_pending */ + uint int_cycles; /* ASG: extra cycles from generated interrupts */ + uint stopped; /* Stopped state */ + uint pref_addr; /* Last prefetch address */ + uint pref_data; /* Data in the prefetch queue */ + uint address_mask; /* Available address pins */ + uint sr_mask; /* Implemented status register bits */ + + /* Clocks required for instructions / exceptions */ + uint cyc_bcc_notake_b; + uint cyc_bcc_notake_w; + uint cyc_dbcc_f_noexp; + uint cyc_dbcc_f_exp; + uint cyc_scc_r_false; + uint cyc_movem_w; + uint cyc_movem_l; + uint cyc_shift; + uint cyc_reset; + uint8* cyc_instruction; + uint8* cyc_exception; + + /* Callbacks to host */ + int (*int_ack_callback)(int int_line); /* Interrupt Acknowledge */ + void (*bkpt_ack_callback)(unsigned int data); /* Breakpoint Acknowledge */ + void (*reset_instr_callback)(void); /* Called when a RESET instruction is encountered */ + void (*pc_changed_callback)(unsigned int new_pc); /* Called when the PC changes by a large amount */ + void (*set_fc_callback)(unsigned int new_fc); /* Called when the CPU function code changes */ + void (*instr_hook_callback)(void); /* Called every instruction cycle prior to execution */ + +} m68ki_cpu_core; + + +extern m68ki_cpu_core m68ki_cpu; +extern sint m68ki_remaining_cycles; +extern uint m68ki_tracing; +extern uint8 m68ki_shift_8_table[]; +extern uint16 m68ki_shift_16_table[]; +extern uint m68ki_shift_32_table[]; +extern uint8 m68ki_exception_cycle_table[][256]; +extern uint m68ki_address_space; +extern uint8 m68ki_ea_idx_cycle_table[]; + + +/* Read data immediately after the program counter */ +INLINE uint m68ki_read_imm_16(void); +INLINE uint m68ki_read_imm_32(void); + +/* Read data with specific function code */ +INLINE uint m68ki_read_8_fc (uint address, uint fc); +INLINE uint m68ki_read_16_fc (uint address, uint fc); +INLINE uint m68ki_read_32_fc (uint address, uint fc); + +/* Write data with specific function code */ +INLINE void m68ki_write_8_fc (uint address, uint fc, uint value); +INLINE void m68ki_write_16_fc(uint address, uint fc, uint value); +INLINE void m68ki_write_32_fc(uint address, uint fc, uint value); + +/* Indexed and PC-relative ea fetching */ +INLINE uint m68ki_get_ea_pcdi(void); +INLINE uint m68ki_get_ea_pcix(void); +INLINE uint m68ki_get_ea_ix(uint An); + +/* Operand fetching */ +INLINE uint OPER_AY_AI_8(void); +INLINE uint OPER_AY_AI_16(void); +INLINE uint OPER_AY_AI_32(void); +INLINE uint OPER_AY_PI_8(void); +INLINE uint OPER_AY_PI_16(void); +INLINE uint OPER_AY_PI_32(void); +INLINE uint OPER_AY_PD_8(void); +INLINE uint OPER_AY_PD_16(void); +INLINE uint OPER_AY_PD_32(void); +INLINE uint OPER_AY_DI_8(void); +INLINE uint OPER_AY_DI_16(void); +INLINE uint OPER_AY_DI_32(void); +INLINE uint OPER_AY_IX_8(void); +INLINE uint OPER_AY_IX_16(void); +INLINE uint OPER_AY_IX_32(void); + +INLINE uint OPER_AX_AI_8(void); +INLINE uint OPER_AX_AI_16(void); +INLINE uint OPER_AX_AI_32(void); +INLINE uint OPER_AX_PI_8(void); +INLINE uint OPER_AX_PI_16(void); +INLINE uint OPER_AX_PI_32(void); +INLINE uint OPER_AX_PD_8(void); +INLINE uint OPER_AX_PD_16(void); +INLINE uint OPER_AX_PD_32(void); +INLINE uint OPER_AX_DI_8(void); +INLINE uint OPER_AX_DI_16(void); +INLINE uint OPER_AX_DI_32(void); +INLINE uint OPER_AX_IX_8(void); +INLINE uint OPER_AX_IX_16(void); +INLINE uint OPER_AX_IX_32(void); + +INLINE uint OPER_A7_PI_8(void); +INLINE uint OPER_A7_PD_8(void); + +INLINE uint OPER_AW_8(void); +INLINE uint OPER_AW_16(void); +INLINE uint OPER_AW_32(void); +INLINE uint OPER_AL_8(void); +INLINE uint OPER_AL_16(void); +INLINE uint OPER_AL_32(void); +INLINE uint OPER_PCDI_8(void); +INLINE uint OPER_PCDI_16(void); +INLINE uint OPER_PCDI_32(void); +INLINE uint OPER_PCIX_8(void); +INLINE uint OPER_PCIX_16(void); +INLINE uint OPER_PCIX_32(void); + +/* Stack operations */ +INLINE void m68ki_push_16(uint value); +INLINE void m68ki_push_32(uint value); +INLINE uint m68ki_pull_16(void); +INLINE uint m68ki_pull_32(void); + +/* Program flow operations */ +INLINE void m68ki_jump(uint new_pc); +INLINE void m68ki_jump_vector(uint vector); +INLINE void m68ki_branch_8(uint offset); +INLINE void m68ki_branch_16(uint offset); +INLINE void m68ki_branch_32(uint offset); + +/* Status register operations. */ +INLINE void m68ki_set_s_flag(uint value); /* Only bit 2 of value should be set (i.e. 4 or 0) */ +INLINE void m68ki_set_sm_flag(uint value); /* only bits 1 and 2 of value should be set */ +INLINE void m68ki_set_ccr(uint value); /* set the condition code register */ +INLINE void m68ki_set_sr(uint value); /* set the status register */ +INLINE void m68ki_set_sr_noint(uint value); /* set the status register */ + +/* Exception processing */ +INLINE uint m68ki_init_exception(void); /* Initial exception processing */ + +INLINE void m68ki_stack_frame_3word(uint pc, uint sr); /* Stack various frame types */ +INLINE void m68ki_stack_frame_buserr(uint pc, uint sr, uint address, uint write, uint instruction, uint fc); + +INLINE void m68ki_stack_frame_0000(uint pc, uint sr, uint vector); +INLINE void m68ki_stack_frame_0001(uint pc, uint sr, uint vector); +INLINE void m68ki_stack_frame_0010(uint sr, uint vector); +INLINE void m68ki_stack_frame_1000(uint pc, uint sr, uint vector); +INLINE void m68ki_stack_frame_1010(uint sr, uint vector, uint pc); +INLINE void m68ki_stack_frame_1011(uint sr, uint vector, uint pc); + +INLINE void m68ki_exception_trap(uint vector); +INLINE void m68ki_exception_trapN(uint vector); +INLINE void m68ki_exception_trace(void); +INLINE void m68ki_exception_privilege_violation(void); +INLINE void m68ki_exception_1010(void); +INLINE void m68ki_exception_1111(void); +INLINE void m68ki_exception_illegal(void); +INLINE void m68ki_exception_format_error(void); +INLINE void m68ki_exception_address_error(void); +INLINE void m68ki_exception_interrupt(uint int_level); +INLINE void m68ki_check_interrupts(void); /* ASG: check for interrupts */ + +/* quick disassembly (used for logging) */ +char* m68ki_disassemble_quick(unsigned int pc, unsigned int cpu_type); + + +/* ======================================================================== */ +/* =========================== UTILITY FUNCTIONS ========================== */ +/* ======================================================================== */ + + +/* ---------------------------- Read Immediate ---------------------------- */ + +/* Handles all immediate reads, does address error check, function code setting, + * and prefetching if they are enabled in m68kconf.h + */ +INLINE uint m68ki_read_imm_16(void) +{ + m68ki_set_fc(FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */ + m68ki_check_address_error(REG_PC); /* auto-disable (see m68kcpu.h) */ +#if M68K_EMULATE_PREFETCH + if(MASK_OUT_BELOW_2(REG_PC) != CPU_PREF_ADDR) + { + CPU_PREF_ADDR = MASK_OUT_BELOW_2(REG_PC); + CPU_PREF_DATA = m68k_read_immediate_32(ADDRESS_68K(CPU_PREF_ADDR)); + } + REG_PC += 2; + return MASK_OUT_ABOVE_16(CPU_PREF_DATA >> ((2-((REG_PC-2)&2))<<3)); +#else + REG_PC += 2; + return m68k_read_immediate_16(ADDRESS_68K(REG_PC-2)); +#endif /* M68K_EMULATE_PREFETCH */ +} +INLINE uint m68ki_read_imm_32(void) +{ +#if M68K_EMULATE_PREFETCH + uint temp_val; + + m68ki_set_fc(FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */ + m68ki_check_address_error(REG_PC); /* auto-disable (see m68kcpu.h) */ + if(MASK_OUT_BELOW_2(REG_PC) != CPU_PREF_ADDR) + { + CPU_PREF_ADDR = MASK_OUT_BELOW_2(REG_PC); + CPU_PREF_DATA = m68k_read_immediate_32(ADDRESS_68K(CPU_PREF_ADDR)); + } + temp_val = CPU_PREF_DATA; + REG_PC += 2; + if(MASK_OUT_BELOW_2(REG_PC) != CPU_PREF_ADDR) + { + CPU_PREF_ADDR = MASK_OUT_BELOW_2(REG_PC); + CPU_PREF_DATA = m68k_read_immediate_32(ADDRESS_68K(CPU_PREF_ADDR)); + temp_val = MASK_OUT_ABOVE_32((temp_val << 16) | (CPU_PREF_DATA >> 16)); + } + REG_PC += 2; + + return temp_val; +#else + m68ki_set_fc(FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */ + m68ki_check_address_error(REG_PC); /* auto-disable (see m68kcpu.h) */ + REG_PC += 4; + return m68k_read_immediate_32(ADDRESS_68K(REG_PC-4)); +#endif /* M68K_EMULATE_PREFETCH */ +} + + + +/* ------------------------- Top level read/write ------------------------- */ + +/* Handles all memory accesses (except for immediate reads if they are + * configured to use separate functions in m68kconf.h). + * All memory accesses must go through these top level functions. + * These functions will also check for address error and set the function + * code if they are enabled in m68kconf.h. + */ +INLINE uint m68ki_read_8_fc(uint address, uint fc) +{ + m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ + return m68k_read_memory_8(ADDRESS_68K(address)); +} +INLINE uint m68ki_read_16_fc(uint address, uint fc) +{ + m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ + m68ki_check_address_error(address); /* auto-disable (see m68kcpu.h) */ + return m68k_read_memory_16(ADDRESS_68K(address)); +} +INLINE uint m68ki_read_32_fc(uint address, uint fc) +{ + m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ + m68ki_check_address_error(address); /* auto-disable (see m68kcpu.h) */ + return m68k_read_memory_32(ADDRESS_68K(address)); +} + +INLINE void m68ki_write_8_fc(uint address, uint fc, uint value) +{ + m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ + m68k_write_memory_8(ADDRESS_68K(address), value); +} +INLINE void m68ki_write_16_fc(uint address, uint fc, uint value) +{ + m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ + m68ki_check_address_error(address); /* auto-disable (see m68kcpu.h) */ + m68k_write_memory_16(ADDRESS_68K(address), value); +} +INLINE void m68ki_write_32_fc(uint address, uint fc, uint value) +{ + m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */ + m68ki_check_address_error(address); /* auto-disable (see m68kcpu.h) */ + m68k_write_memory_32(ADDRESS_68K(address), value); +} + + + +/* --------------------- Effective Address Calculation -------------------- */ + +/* The program counter relative addressing modes cause operands to be + * retrieved from program space, not data space. + */ +INLINE uint m68ki_get_ea_pcdi(void) +{ + uint old_pc = REG_PC; + m68ki_use_program_space(); /* auto-disable */ + return old_pc + MAKE_INT_16(m68ki_read_imm_16()); +} + + +INLINE uint m68ki_get_ea_pcix(void) +{ + m68ki_use_program_space(); /* auto-disable */ + return m68ki_get_ea_ix(REG_PC); +} + +/* Indexed addressing modes are encoded as follows: + * + * Base instruction format: + * F E D C B A 9 8 7 6 | 5 4 3 | 2 1 0 + * x x x x x x x x x x | 1 1 0 | BASE REGISTER (An) + * + * Base instruction format for destination EA in move instructions: + * F E D C | B A 9 | 8 7 6 | 5 4 3 2 1 0 + * x x x x | BASE REG | 1 1 0 | X X X X X X (An) + * + * Brief extension format: + * F | E D C | B | A 9 | 8 | 7 6 5 4 3 2 1 0 + * D/A | REGISTER | W/L | SCALE | 0 | DISPLACEMENT + * + * Full extension format: + * F E D C B A 9 8 7 6 5 4 3 2 1 0 + * D/A | REGISTER | W/L | SCALE | 1 | BS | IS | BD SIZE | 0 | I/IS + * BASE DISPLACEMENT (0, 16, 32 bit) (bd) + * OUTER DISPLACEMENT (0, 16, 32 bit) (od) + * + * D/A: 0 = Dn, 1 = An (Xn) + * W/L: 0 = W (sign extend), 1 = L (.SIZE) + * SCALE: 00=1, 01=2, 10=4, 11=8 (*SCALE) + * BS: 0=add base reg, 1=suppress base reg (An suppressed) + * IS: 0=add index, 1=suppress index (Xn suppressed) + * BD SIZE: 00=reserved, 01=NULL, 10=Word, 11=Long (size of bd) + * + * IS I/IS Operation + * 0 000 No Memory Indirect + * 0 001 indir prex with null outer + * 0 010 indir prex with word outer + * 0 011 indir prex with long outer + * 0 100 reserved + * 0 101 indir postx with null outer + * 0 110 indir postx with word outer + * 0 111 indir postx with long outer + * 1 000 no memory indirect + * 1 001 mem indir with null outer + * 1 010 mem indir with word outer + * 1 011 mem indir with long outer + * 1 100-111 reserved + */ +INLINE uint m68ki_get_ea_ix(uint An) +{ + /* An = base register */ + uint extension = m68ki_read_imm_16(); + uint Xn = 0; /* Index register */ + uint bd = 0; /* Base Displacement */ + uint od = 0; /* Outer Displacement */ + + if(CPU_TYPE_IS_010_LESS(CPU_TYPE)) + { + /* Calculate index */ + Xn = REG_DA[extension>>12]; /* Xn */ + if(!BIT_B(extension)) /* W/L */ + Xn = MAKE_INT_16(Xn); + + /* Add base register and displacement and return */ + return An + Xn + MAKE_INT_8(extension); + } + + /* Brief extension format */ + if(!BIT_8(extension)) + { + /* Calculate index */ + Xn = REG_DA[extension>>12]; /* Xn */ + if(!BIT_B(extension)) /* W/L */ + Xn = MAKE_INT_16(Xn); + /* Add scale if proper CPU type */ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + Xn <<= (extension>>9) & 3; /* SCALE */ + + /* Add base register and displacement and return */ + return An + Xn + MAKE_INT_8(extension); + } + + /* Full extension format */ + + USE_CYCLES(m68ki_ea_idx_cycle_table[extension&0x3f]); + + /* Check if base register is present */ + if(BIT_7(extension)) /* BS */ + An = 0; /* An */ + + /* Check if index is present */ + if(!BIT_6(extension)) /* IS */ + { + Xn = REG_DA[extension>>12]; /* Xn */ + if(!BIT_B(extension)) /* W/L */ + Xn = MAKE_INT_16(Xn); + Xn <<= (extension>>9) & 3; /* SCALE */ + } + + /* Check if base displacement is present */ + if(BIT_5(extension)) /* BD SIZE */ + bd = BIT_4(extension) ? m68ki_read_imm_32() : MAKE_INT_16(m68ki_read_imm_16()); + + /* If no indirect action, we are done */ + if(!(extension&7)) /* No Memory Indirect */ + return An + bd + Xn; + + /* Check if outer displacement is present */ + if(BIT_1(extension)) /* I/IS: od */ + od = BIT_0(extension) ? m68ki_read_imm_32() : MAKE_INT_16(m68ki_read_imm_16()); + + /* Postindex */ + if(BIT_2(extension)) /* I/IS: 0 = preindex, 1 = postindex */ + return m68ki_read_32(An + bd) + Xn + od; + + /* Preindex */ + return m68ki_read_32(An + bd + Xn) + od; +} + + +/* Fetch operands */ +INLINE uint OPER_AY_AI_8(void) {uint ea = EA_AY_AI_8(); return m68ki_read_8(ea); } +INLINE uint OPER_AY_AI_16(void) {uint ea = EA_AY_AI_16(); return m68ki_read_16(ea);} +INLINE uint OPER_AY_AI_32(void) {uint ea = EA_AY_AI_32(); return m68ki_read_32(ea);} +INLINE uint OPER_AY_PI_8(void) {uint ea = EA_AY_PI_8(); return m68ki_read_8(ea); } +INLINE uint OPER_AY_PI_16(void) {uint ea = EA_AY_PI_16(); return m68ki_read_16(ea);} +INLINE uint OPER_AY_PI_32(void) {uint ea = EA_AY_PI_32(); return m68ki_read_32(ea);} +INLINE uint OPER_AY_PD_8(void) {uint ea = EA_AY_PD_8(); return m68ki_read_8(ea); } +INLINE uint OPER_AY_PD_16(void) {uint ea = EA_AY_PD_16(); return m68ki_read_16(ea);} +INLINE uint OPER_AY_PD_32(void) {uint ea = EA_AY_PD_32(); return m68ki_read_32(ea);} +INLINE uint OPER_AY_DI_8(void) {uint ea = EA_AY_DI_8(); return m68ki_read_8(ea); } +INLINE uint OPER_AY_DI_16(void) {uint ea = EA_AY_DI_16(); return m68ki_read_16(ea);} +INLINE uint OPER_AY_DI_32(void) {uint ea = EA_AY_DI_32(); return m68ki_read_32(ea);} +INLINE uint OPER_AY_IX_8(void) {uint ea = EA_AY_IX_8(); return m68ki_read_8(ea); } +INLINE uint OPER_AY_IX_16(void) {uint ea = EA_AY_IX_16(); return m68ki_read_16(ea);} +INLINE uint OPER_AY_IX_32(void) {uint ea = EA_AY_IX_32(); return m68ki_read_32(ea);} + +INLINE uint OPER_AX_AI_8(void) {uint ea = EA_AX_AI_8(); return m68ki_read_8(ea); } +INLINE uint OPER_AX_AI_16(void) {uint ea = EA_AX_AI_16(); return m68ki_read_16(ea);} +INLINE uint OPER_AX_AI_32(void) {uint ea = EA_AX_AI_32(); return m68ki_read_32(ea);} +INLINE uint OPER_AX_PI_8(void) {uint ea = EA_AX_PI_8(); return m68ki_read_8(ea); } +INLINE uint OPER_AX_PI_16(void) {uint ea = EA_AX_PI_16(); return m68ki_read_16(ea);} +INLINE uint OPER_AX_PI_32(void) {uint ea = EA_AX_PI_32(); return m68ki_read_32(ea);} +INLINE uint OPER_AX_PD_8(void) {uint ea = EA_AX_PD_8(); return m68ki_read_8(ea); } +INLINE uint OPER_AX_PD_16(void) {uint ea = EA_AX_PD_16(); return m68ki_read_16(ea);} +INLINE uint OPER_AX_PD_32(void) {uint ea = EA_AX_PD_32(); return m68ki_read_32(ea);} +INLINE uint OPER_AX_DI_8(void) {uint ea = EA_AX_DI_8(); return m68ki_read_8(ea); } +INLINE uint OPER_AX_DI_16(void) {uint ea = EA_AX_DI_16(); return m68ki_read_16(ea);} +INLINE uint OPER_AX_DI_32(void) {uint ea = EA_AX_DI_32(); return m68ki_read_32(ea);} +INLINE uint OPER_AX_IX_8(void) {uint ea = EA_AX_IX_8(); return m68ki_read_8(ea); } +INLINE uint OPER_AX_IX_16(void) {uint ea = EA_AX_IX_16(); return m68ki_read_16(ea);} +INLINE uint OPER_AX_IX_32(void) {uint ea = EA_AX_IX_32(); return m68ki_read_32(ea);} + +INLINE uint OPER_A7_PI_8(void) {uint ea = EA_A7_PI_8(); return m68ki_read_8(ea); } +INLINE uint OPER_A7_PD_8(void) {uint ea = EA_A7_PD_8(); return m68ki_read_8(ea); } + +INLINE uint OPER_AW_8(void) {uint ea = EA_AW_8(); return m68ki_read_8(ea); } +INLINE uint OPER_AW_16(void) {uint ea = EA_AW_16(); return m68ki_read_16(ea);} +INLINE uint OPER_AW_32(void) {uint ea = EA_AW_32(); return m68ki_read_32(ea);} +INLINE uint OPER_AL_8(void) {uint ea = EA_AL_8(); return m68ki_read_8(ea); } +INLINE uint OPER_AL_16(void) {uint ea = EA_AL_16(); return m68ki_read_16(ea);} +INLINE uint OPER_AL_32(void) {uint ea = EA_AL_32(); return m68ki_read_32(ea);} +INLINE uint OPER_PCDI_8(void) {uint ea = EA_PCDI_8(); return m68ki_read_pcrel_8(ea); } +INLINE uint OPER_PCDI_16(void) {uint ea = EA_PCDI_16(); return m68ki_read_pcrel_16(ea);} +INLINE uint OPER_PCDI_32(void) {uint ea = EA_PCDI_32(); return m68ki_read_pcrel_32(ea);} +INLINE uint OPER_PCIX_8(void) {uint ea = EA_PCIX_8(); return m68ki_read_pcrel_8(ea); } +INLINE uint OPER_PCIX_16(void) {uint ea = EA_PCIX_16(); return m68ki_read_pcrel_16(ea);} +INLINE uint OPER_PCIX_32(void) {uint ea = EA_PCIX_32(); return m68ki_read_pcrel_32(ea);} + + + +/* ---------------------------- Stack Functions --------------------------- */ + +/* Push/pull data from the stack */ +INLINE void m68ki_push_16(uint value) +{ + REG_SP = MASK_OUT_ABOVE_32(REG_SP - 2); + m68ki_write_16(REG_SP, value); +} + +INLINE void m68ki_push_32(uint value) +{ + REG_SP = MASK_OUT_ABOVE_32(REG_SP - 4); + m68ki_write_32(REG_SP, value); +} + +INLINE uint m68ki_pull_16(void) +{ + REG_SP = MASK_OUT_ABOVE_32(REG_SP + 2); + return m68ki_read_16(REG_SP-2); +} + +INLINE uint m68ki_pull_32(void) +{ + REG_SP = MASK_OUT_ABOVE_32(REG_SP + 4); + return m68ki_read_32(REG_SP-4); +} + + +/* Increment/decrement the stack as if doing a push/pull but + * don't do any memory access. + */ +INLINE void m68ki_fake_push_16(void) +{ + REG_SP = MASK_OUT_ABOVE_32(REG_SP - 2); +} + +INLINE void m68ki_fake_push_32(void) +{ + REG_SP = MASK_OUT_ABOVE_32(REG_SP - 4); +} + +INLINE void m68ki_fake_pull_16(void) +{ + REG_SP = MASK_OUT_ABOVE_32(REG_SP + 2); +} + +INLINE void m68ki_fake_pull_32(void) +{ + REG_SP = MASK_OUT_ABOVE_32(REG_SP + 4); +} + + +/* ----------------------------- Program Flow ----------------------------- */ + +/* Jump to a new program location or vector. + * These functions will also call the pc_changed callback if it was enabled + * in m68kconf.h. + */ +INLINE void m68ki_jump(uint new_pc) +{ + REG_PC = new_pc; + m68ki_pc_changed(REG_PC); +} + +INLINE void m68ki_jump_vector(uint vector) +{ + REG_PC = (vector<<2) + REG_VBR; + REG_PC = m68ki_read_data_32(REG_PC); + m68ki_pc_changed(REG_PC); +} + + +/* Branch to a new memory location. + * The 32-bit branch will call pc_changed if it was enabled in m68kconf.h. + * So far I've found no problems with not calling pc_changed for 8 or 16 + * bit branches. + */ +INLINE void m68ki_branch_8(uint offset) +{ + REG_PC += MAKE_INT_8(offset); +} + +INLINE void m68ki_branch_16(uint offset) +{ + REG_PC += MAKE_INT_16(offset); +} + +INLINE void m68ki_branch_32(uint offset) +{ + REG_PC += offset; + m68ki_pc_changed(REG_PC); +} + + + +/* ---------------------------- Status Register --------------------------- */ + +/* Set the S flag and change the active stack pointer. + * Note that value MUST be 4 or 0. + */ +INLINE void m68ki_set_s_flag(uint value) +{ + /* Backup the old stack pointer */ + REG_SP_BASE[FLAG_S | ((FLAG_S>>1) & FLAG_M)] = REG_SP; + /* Set the S flag */ + FLAG_S = value; + /* Set the new stack pointer */ + REG_SP = REG_SP_BASE[FLAG_S | ((FLAG_S>>1) & FLAG_M)]; +} + +/* Set the S and M flags and change the active stack pointer. + * Note that value MUST be 0, 2, 4, or 6 (bit2 = S, bit1 = M). + */ +INLINE void m68ki_set_sm_flag(uint value) +{ + /* Backup the old stack pointer */ + REG_SP_BASE[FLAG_S | ((FLAG_S>>1) & FLAG_M)] = REG_SP; + /* Set the S and M flags */ + FLAG_S = value & SFLAG_SET; + FLAG_M = value & MFLAG_SET; + /* Set the new stack pointer */ + REG_SP = REG_SP_BASE[FLAG_S | ((FLAG_S>>1) & FLAG_M)]; +} + + +/* Set the condition code register */ +INLINE void m68ki_set_ccr(uint value) +{ + FLAG_X = BIT_4(value) << 4; + FLAG_N = BIT_3(value) << 4; + FLAG_Z = !BIT_2(value); + FLAG_V = BIT_1(value) << 6; + FLAG_C = BIT_0(value) << 8; +} + +/* Set the status register but don't check for interrupts */ +INLINE void m68ki_set_sr_noint(uint value) +{ + /* Mask out the "unimplemented" bits */ + value &= CPU_SR_MASK; + + /* Now set the status register */ + FLAG_T1 = BIT_F(value); + FLAG_T0 = BIT_E(value); + FLAG_INT_MASK = value & 0x0700; + m68ki_set_ccr(value); + m68ki_set_sm_flag((value >> 11) & 6); +} + +/* Set the status register and check for interrupts */ +INLINE void m68ki_set_sr(uint value) +{ + m68ki_set_sr_noint(value); + m68ki_check_interrupts(); +} + + +/* ------------------------- Exception Processing ------------------------- */ + +/* Initiate exception processing */ +INLINE uint m68ki_init_exception(void) +{ + /* Save the old status register */ + uint sr = m68ki_get_sr(); + + /* Turn off trace flag, clear pending traces */ + FLAG_T1 = FLAG_T0 = 0; + m68ki_clear_trace(); + /* Enter supervisor mode */ + m68ki_set_s_flag(SFLAG_SET); + + return sr; +} + +/* 3 word stack frame (68000 only) */ +INLINE void m68ki_stack_frame_3word(uint pc, uint sr) +{ + m68ki_push_32(pc); + m68ki_push_16(sr); +} + +/* Format 0 stack frame. + * This is the standard stack frame for 68010+. + */ +INLINE void m68ki_stack_frame_0000(uint pc, uint sr, uint vector) +{ + /* Stack a 3-word frame if we are 68000 */ + if(CPU_TYPE == CPU_TYPE_000) + { + m68ki_stack_frame_3word(pc, sr); + return; + } + m68ki_push_16(vector<<2); + m68ki_push_32(pc); + m68ki_push_16(sr); +} + +/* Format 1 stack frame (68020). + * For 68020, this is the 4 word throwaway frame. + */ +INLINE void m68ki_stack_frame_0001(uint pc, uint sr, uint vector) +{ + m68ki_push_16(0x1000 | (vector<<2)); + m68ki_push_32(pc); + m68ki_push_16(sr); +} + +/* Format 2 stack frame. + * This is used only by 68020 for trap exceptions. + */ +INLINE void m68ki_stack_frame_0010(uint sr, uint vector) +{ + m68ki_push_32(REG_PPC); + m68ki_push_16(0x2000 | (vector<<2)); + m68ki_push_32(REG_PC); + m68ki_push_16(sr); +} + + +/* Bus error stack frame (68000 only). + */ +INLINE void m68ki_stack_frame_buserr(uint pc, uint sr, uint address, uint write, uint instruction, uint fc) +{ + m68ki_push_32(pc); + m68ki_push_16(sr); + m68ki_push_16(REG_IR); + m68ki_push_32(address); /* access address */ + /* 0 0 0 0 0 0 0 0 0 0 0 R/W I/N FC + * R/W 0 = write, 1 = read + * I/N 0 = instruction, 1 = not + * FC 3-bit function code + */ + m68ki_push_16(((!write)<<4) | ((!instruction)<<3) | fc); +} + +/* Format 8 stack frame (68010). + * 68010 only. This is the 29 word bus/address error frame. + */ +void m68ki_stack_frame_1000(uint pc, uint sr, uint vector) +{ + /* VERSION + * NUMBER + * INTERNAL INFORMATION, 16 WORDS + */ + m68ki_fake_push_32(); + m68ki_fake_push_32(); + m68ki_fake_push_32(); + m68ki_fake_push_32(); + m68ki_fake_push_32(); + m68ki_fake_push_32(); + m68ki_fake_push_32(); + m68ki_fake_push_32(); + + /* INSTRUCTION INPUT BUFFER */ + m68ki_push_16(0); + + /* UNUSED, RESERVED (not written) */ + m68ki_fake_push_16(); + + /* DATA INPUT BUFFER */ + m68ki_push_16(0); + + /* UNUSED, RESERVED (not written) */ + m68ki_fake_push_16(); + + /* DATA OUTPUT BUFFER */ + m68ki_push_16(0); + + /* UNUSED, RESERVED (not written) */ + m68ki_fake_push_16(); + + /* FAULT ADDRESS */ + m68ki_push_32(0); + + /* SPECIAL STATUS WORD */ + m68ki_push_16(0); + + /* 1000, VECTOR OFFSET */ + m68ki_push_16(0x8000 | (vector<<2)); + + /* PROGRAM COUNTER */ + m68ki_push_32(pc); + + /* STATUS REGISTER */ + m68ki_push_16(sr); +} + +/* Format A stack frame (short bus fault). + * This is used only by 68020 for bus fault and address error + * if the error happens at an instruction boundary. + * PC stacked is address of next instruction. + */ +void m68ki_stack_frame_1010(uint sr, uint vector, uint pc) +{ + /* INTERNAL REGISTER */ + m68ki_push_16(0); + + /* INTERNAL REGISTER */ + m68ki_push_16(0); + + /* DATA OUTPUT BUFFER (2 words) */ + m68ki_push_32(0); + + /* INTERNAL REGISTER */ + m68ki_push_16(0); + + /* INTERNAL REGISTER */ + m68ki_push_16(0); + + /* DATA CYCLE FAULT ADDRESS (2 words) */ + m68ki_push_32(0); + + /* INSTRUCTION PIPE STAGE B */ + m68ki_push_16(0); + + /* INSTRUCTION PIPE STAGE C */ + m68ki_push_16(0); + + /* SPECIAL STATUS REGISTER */ + m68ki_push_16(0); + + /* INTERNAL REGISTER */ + m68ki_push_16(0); + + /* 1010, VECTOR OFFSET */ + m68ki_push_16(0xa000 | (vector<<2)); + + /* PROGRAM COUNTER */ + m68ki_push_32(pc); + + /* STATUS REGISTER */ + m68ki_push_16(sr); +} + +/* Format B stack frame (long bus fault). + * This is used only by 68020 for bus fault and address error + * if the error happens during instruction execution. + * PC stacked is address of instruction in progress. + */ +void m68ki_stack_frame_1011(uint sr, uint vector, uint pc) +{ + /* INTERNAL REGISTERS (18 words) */ + m68ki_push_32(0); + m68ki_push_32(0); + m68ki_push_32(0); + m68ki_push_32(0); + m68ki_push_32(0); + m68ki_push_32(0); + m68ki_push_32(0); + m68ki_push_32(0); + m68ki_push_32(0); + + /* VERSION# (4 bits), INTERNAL INFORMATION */ + m68ki_push_16(0); + + /* INTERNAL REGISTERS (3 words) */ + m68ki_push_32(0); + m68ki_push_16(0); + + /* DATA INTPUT BUFFER (2 words) */ + m68ki_push_32(0); + + /* INTERNAL REGISTERS (2 words) */ + m68ki_push_32(0); + + /* STAGE B ADDRESS (2 words) */ + m68ki_push_32(0); + + /* INTERNAL REGISTER (4 words) */ + m68ki_push_32(0); + m68ki_push_32(0); + + /* DATA OUTPUT BUFFER (2 words) */ + m68ki_push_32(0); + + /* INTERNAL REGISTER */ + m68ki_push_16(0); + + /* INTERNAL REGISTER */ + m68ki_push_16(0); + + /* DATA CYCLE FAULT ADDRESS (2 words) */ + m68ki_push_32(0); + + /* INSTRUCTION PIPE STAGE B */ + m68ki_push_16(0); + + /* INSTRUCTION PIPE STAGE C */ + m68ki_push_16(0); + + /* SPECIAL STATUS REGISTER */ + m68ki_push_16(0); + + /* INTERNAL REGISTER */ + m68ki_push_16(0); + + /* 1011, VECTOR OFFSET */ + m68ki_push_16(0xb000 | (vector<<2)); + + /* PROGRAM COUNTER */ + m68ki_push_32(pc); + + /* STATUS REGISTER */ + m68ki_push_16(sr); +} + + +/* Used for Group 2 exceptions. + * These stack a type 2 frame on the 020. + */ +INLINE void m68ki_exception_trap(uint vector) +{ + uint sr = m68ki_init_exception(); + + if(CPU_TYPE_IS_010_LESS(CPU_TYPE)) + m68ki_stack_frame_0000(REG_PC, sr, vector); + else + m68ki_stack_frame_0010(sr, vector); + + m68ki_jump_vector(vector); + + /* Use up some clock cycles */ + USE_CYCLES(CYC_EXCEPTION[vector]); +} + +/* Trap#n stacks a 0 frame but behaves like group2 otherwise */ +INLINE void m68ki_exception_trapN(uint vector) +{ + uint sr = m68ki_init_exception(); + m68ki_stack_frame_0000(REG_PC, sr, vector); + m68ki_jump_vector(vector); + + /* Use up some clock cycles */ + USE_CYCLES(CYC_EXCEPTION[vector]); +} + +/* Exception for trace mode */ +INLINE void m68ki_exception_trace(void) +{ + uint sr = m68ki_init_exception(); + + if(CPU_TYPE_IS_010_LESS(CPU_TYPE)) + m68ki_stack_frame_0000(REG_PC, sr, EXCEPTION_TRACE); + else + m68ki_stack_frame_0010(sr, EXCEPTION_TRACE); + + m68ki_jump_vector(EXCEPTION_TRACE); + + /* Trace nullifies a STOP instruction */ + CPU_STOPPED &= ~STOP_LEVEL_STOP; + + /* Use up some clock cycles */ + USE_CYCLES(CYC_EXCEPTION[EXCEPTION_TRACE]); +} + +/* Exception for privilege violation */ +INLINE void m68ki_exception_privilege_violation(void) +{ + uint sr = m68ki_init_exception(); + m68ki_stack_frame_0000(REG_PC, sr, EXCEPTION_PRIVILEGE_VIOLATION); + m68ki_jump_vector(EXCEPTION_PRIVILEGE_VIOLATION); + + /* Use up some clock cycles and undo the instruction's cycles */ + USE_CYCLES(CYC_EXCEPTION[EXCEPTION_PRIVILEGE_VIOLATION] - CYC_INSTRUCTION[REG_IR]); +} + +/* Exception for A-Line instructions */ +INLINE void m68ki_exception_1010(void) +{ + uint sr; +#if M68K_LOG_1010_1111 == OPT_ON + M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08x: called 1010 instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PPC), REG_IR, + m68ki_disassemble_quick(ADDRESS_68K(REG_PPC)))); +#endif + + sr = m68ki_init_exception(); + m68ki_stack_frame_0000(REG_PC-2, sr, EXCEPTION_1010); + m68ki_jump_vector(EXCEPTION_1010); + + /* Use up some clock cycles and undo the instruction's cycles */ + USE_CYCLES(CYC_EXCEPTION[EXCEPTION_1010] - CYC_INSTRUCTION[REG_IR]); +} + +/* Exception for F-Line instructions */ +INLINE void m68ki_exception_1111(void) +{ + uint sr; + +#if M68K_LOG_1010_1111 == OPT_ON + M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08x: called 1111 instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PPC), REG_IR, + m68ki_disassemble_quick(ADDRESS_68K(REG_PPC)))); +#endif + + sr = m68ki_init_exception(); + m68ki_stack_frame_0000(REG_PC-2, sr, EXCEPTION_1111); + m68ki_jump_vector(EXCEPTION_1111); + + /* Use up some clock cycles and undo the instruction's cycles */ + USE_CYCLES(CYC_EXCEPTION[EXCEPTION_1111] - CYC_INSTRUCTION[REG_IR]); +} + +/* Exception for illegal instructions */ +INLINE void m68ki_exception_illegal(void) +{ + uint sr; + + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: illegal instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PPC), REG_IR, + m68ki_disassemble_quick(ADDRESS_68K(REG_PPC)))); + + sr = m68ki_init_exception(); + m68ki_stack_frame_0000(REG_PC, sr, EXCEPTION_ILLEGAL_INSTRUCTION); + m68ki_jump_vector(EXCEPTION_ILLEGAL_INSTRUCTION); + + /* Use up some clock cycles and undo the instruction's cycles */ + USE_CYCLES(CYC_EXCEPTION[EXCEPTION_ILLEGAL_INSTRUCTION] - CYC_INSTRUCTION[REG_IR]); +} + +/* Exception for format errror in RTE */ +INLINE void m68ki_exception_format_error(void) +{ + uint sr = m68ki_init_exception(); + m68ki_stack_frame_0000(REG_PC, sr, EXCEPTION_FORMAT_ERROR); + m68ki_jump_vector(EXCEPTION_FORMAT_ERROR); + + /* Use up some clock cycles and undo the instruction's cycles */ + USE_CYCLES(CYC_EXCEPTION[EXCEPTION_FORMAT_ERROR] - CYC_INSTRUCTION[REG_IR]); +} + +/* Exception for address error */ +INLINE void m68ki_exception_address_error(void) +{ + /* Not emulated yet */ +} + + +/* Service an interrupt request and start exception processing */ +void m68ki_exception_interrupt(uint int_level) +{ + uint vector; + uint sr; + uint new_pc; + + /* Turn off the stopped state */ + CPU_STOPPED &= ~STOP_LEVEL_STOP; + + /* If we are halted, don't do anything */ + if(CPU_STOPPED) return; + + /* Acknowledge the interrupt */ + vector = m68ki_int_ack(int_level); + + /* Get the interrupt vector */ + if(vector == M68K_INT_ACK_AUTOVECTOR) + /* Use the autovectors. This is the most commonly used implementation */ + vector = EXCEPTION_INTERRUPT_AUTOVECTOR+int_level; + else if(vector == M68K_INT_ACK_SPURIOUS) + /* Called if no devices respond to the interrupt acknowledge */ + vector = EXCEPTION_SPURIOUS_INTERRUPT; + else if(vector > 255) + { + M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08x: Interrupt acknowledge returned invalid vector $%x\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC), vector)); + return; + } + + /* Start exception processing */ + sr = m68ki_init_exception(); + + /* Set the interrupt mask to the level of the one being serviced */ + FLAG_INT_MASK = int_level<<8; + + /* Get the new PC */ + new_pc = m68ki_read_data_32((vector<<2) + REG_VBR); + + /* If vector is uninitialized, call the uninitialized interrupt vector */ + if(new_pc == 0) + new_pc = m68ki_read_data_32((EXCEPTION_UNINITIALIZED_INTERRUPT<<2) + REG_VBR); + + /* Generate a stack frame */ + m68ki_stack_frame_0000(REG_PC, sr, vector); + if(FLAG_M && CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + /* Create throwaway frame */ + m68ki_set_sm_flag(FLAG_S); /* clear M */ + sr |= 0x2000; /* Same as SR in master stack frame except S is forced high */ + m68ki_stack_frame_0001(REG_PC, sr, vector); + } + + m68ki_jump(new_pc); + + /* Defer cycle counting until later */ + CPU_INT_CYCLES += CYC_EXCEPTION[vector]; + +//#if !M68K_EMULATE_INT_ACK + /* Automatically clear IRQ if we are not using an acknowledge scheme */ + CPU_INT_LEVEL = 0; +//#endif /* M68K_EMULATE_INT_ACK */ +} + + +/* ASG: Check for interrupts */ +INLINE void m68ki_check_interrupts(void) +{ + if(CPU_INT_LEVEL > FLAG_INT_MASK) + m68ki_exception_interrupt(CPU_INT_LEVEL>>8); +} + + + +/* ======================================================================== */ +/* ============================== END OF FILE ============================= */ +/* ======================================================================== */ + +#endif /* M68KCPU__HEADER */ diff --git a/source/m68k/m68kopac.c b/source/m68k/m68kopac.c new file mode 100644 index 0000000..d1ed933 --- /dev/null +++ b/source/m68k/m68kopac.c @@ -0,0 +1,11948 @@ +#include "m68kcpu.h" + +/* ======================================================================== */ +/* ========================= INSTRUCTION HANDLERS ========================= */ +/* ======================================================================== */ + + +void m68k_op_1010(void) +{ + m68ki_exception_1010(); +} + + +void m68k_op_1111(void) +{ + m68ki_exception_1111(); +} + + +void m68k_op_abcd_8_rr(void) +{ + uint* r_dst = &DX; + uint src = DY; + uint dst = *r_dst; + uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(); + + if(res > 9) + res += 6; + res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst); + FLAG_X = FLAG_C = (res > 0x99) << 8; + if(FLAG_C) + res -= 0xa0; + + FLAG_N = NFLAG_8(res); /* officially undefined */ + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; +} + + +void m68k_op_abcd_8_mm_ax7(void) +{ + uint src = OPER_AY_PD_8(); + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(); + + if(res > 9) + res += 6; + res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst); + FLAG_X = FLAG_C = (res > 0x99) << 8; + if(FLAG_C) + res -= 0xa0; + + FLAG_N = NFLAG_8(res); /* officially undefined */ + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_abcd_8_mm_ay7(void) +{ + uint src = OPER_A7_PD_8(); + uint ea = EA_AX_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(); + + if(res > 9) + res += 6; + res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst); + FLAG_X = FLAG_C = (res > 0x99) << 8; + if(FLAG_C) + res -= 0xa0; + + FLAG_N = NFLAG_8(res); /* officially undefined */ + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_abcd_8_mm_axy7(void) +{ + uint src = OPER_A7_PD_8(); + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(); + + if(res > 9) + res += 6; + res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst); + FLAG_X = FLAG_C = (res > 0x99) << 8; + if(FLAG_C) + res -= 0xa0; + + FLAG_N = NFLAG_8(res); /* officially undefined */ + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_abcd_8_mm(void) +{ + uint src = OPER_AY_PD_8(); + uint ea = EA_AX_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(); + + if(res > 9) + res += 6; + res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst); + FLAG_X = FLAG_C = (res > 0x99) << 8; + if(FLAG_C) + res -= 0xa0; + + FLAG_N = NFLAG_8(res); /* officially undefined */ + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_add_8_er_d(void) +{ + uint* r_dst = &DX; + uint src = MASK_OUT_ABOVE_8(DY); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_8_er_ai(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_AI_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_8_er_pi(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PI_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_8_er_pi7(void) +{ + uint* r_dst = &DX; + uint src = OPER_A7_PI_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_8_er_pd(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PD_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_8_er_pd7(void) +{ + uint* r_dst = &DX; + uint src = OPER_A7_PD_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_8_er_di(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_DI_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_8_er_ix(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_IX_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_8_er_aw(void) +{ + uint* r_dst = &DX; + uint src = OPER_AW_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_8_er_al(void) +{ + uint* r_dst = &DX; + uint src = OPER_AL_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_8_er_pcdi(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCDI_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_8_er_pcix(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCIX_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_8_er_i(void) +{ + uint* r_dst = &DX; + uint src = OPER_I_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_16_er_d(void) +{ + uint* r_dst = &DX; + uint src = MASK_OUT_ABOVE_16(DY); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_16_er_a(void) +{ + uint* r_dst = &DX; + uint src = MASK_OUT_ABOVE_16(AY); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_16_er_ai(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_AI_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_16_er_pi(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PI_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_16_er_pd(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PD_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_16_er_di(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_DI_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_16_er_ix(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_IX_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_16_er_aw(void) +{ + uint* r_dst = &DX; + uint src = OPER_AW_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_16_er_al(void) +{ + uint* r_dst = &DX; + uint src = OPER_AL_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_16_er_pcdi(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCDI_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_16_er_pcix(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCIX_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_16_er_i(void) +{ + uint* r_dst = &DX; + uint src = OPER_I_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_add_32_er_d(void) +{ + uint* r_dst = &DX; + uint src = DY; + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_add_32_er_a(void) +{ + uint* r_dst = &DX; + uint src = AY; + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_add_32_er_ai(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_AI_32(); + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_add_32_er_pi(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PI_32(); + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_add_32_er_pd(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PD_32(); + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_add_32_er_di(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_DI_32(); + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_add_32_er_ix(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_IX_32(); + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_add_32_er_aw(void) +{ + uint* r_dst = &DX; + uint src = OPER_AW_32(); + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_add_32_er_al(void) +{ + uint* r_dst = &DX; + uint src = OPER_AL_32(); + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_add_32_er_pcdi(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCDI_32(); + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_add_32_er_pcix(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCIX_32(); + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_add_32_er_i(void) +{ + uint* r_dst = &DX; + uint src = OPER_I_32(); + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_add_8_re_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_add_8_re_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_add_8_re_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_add_8_re_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_add_8_re_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_add_8_re_di(void) +{ + uint ea = EA_AY_DI_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_add_8_re_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_add_8_re_aw(void) +{ + uint ea = EA_AW_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_add_8_re_al(void) +{ + uint ea = EA_AL_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_add_16_re_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_add_16_re_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_add_16_re_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_add_16_re_di(void) +{ + uint ea = EA_AY_DI_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_add_16_re_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_add_16_re_aw(void) +{ + uint ea = EA_AW_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_add_16_re_al(void) +{ + uint ea = EA_AL_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_add_32_re_ai(void) +{ + uint ea = EA_AY_AI_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_add_32_re_pi(void) +{ + uint ea = EA_AY_PI_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_add_32_re_pd(void) +{ + uint ea = EA_AY_PD_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_add_32_re_di(void) +{ + uint ea = EA_AY_DI_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_add_32_re_ix(void) +{ + uint ea = EA_AY_IX_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_add_32_re_aw(void) +{ + uint ea = EA_AW_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_add_32_re_al(void) +{ + uint ea = EA_AL_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_adda_16_d(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(DY)); +} + + +void m68k_op_adda_16_a(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(AY)); +} + + +void m68k_op_adda_16_ai(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AY_AI_16())); +} + + +void m68k_op_adda_16_pi(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AY_PI_16())); +} + + +void m68k_op_adda_16_pd(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AY_PD_16())); +} + + +void m68k_op_adda_16_di(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AY_DI_16())); +} + + +void m68k_op_adda_16_ix(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AY_IX_16())); +} + + +void m68k_op_adda_16_aw(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AW_16())); +} + + +void m68k_op_adda_16_al(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AL_16())); +} + + +void m68k_op_adda_16_pcdi(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_PCDI_16())); +} + + +void m68k_op_adda_16_pcix(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_PCIX_16())); +} + + +void m68k_op_adda_16_i(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_I_16())); +} + + +void m68k_op_adda_32_d(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + DY); +} + + +void m68k_op_adda_32_a(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + AY); +} + + +void m68k_op_adda_32_ai(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AY_AI_32()); +} + + +void m68k_op_adda_32_pi(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AY_PI_32()); +} + + +void m68k_op_adda_32_pd(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AY_PD_32()); +} + + +void m68k_op_adda_32_di(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AY_DI_32()); +} + + +void m68k_op_adda_32_ix(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AY_IX_32()); +} + + +void m68k_op_adda_32_aw(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AW_32()); +} + + +void m68k_op_adda_32_al(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AL_32()); +} + + +void m68k_op_adda_32_pcdi(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_PCDI_32()); +} + + +void m68k_op_adda_32_pcix(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_PCIX_32()); +} + + +void m68k_op_adda_32_i(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_I_32()); +} + + +void m68k_op_addi_8_d(void) +{ + uint* r_dst = &DY; + uint src = OPER_I_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_addi_8_ai(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_AI_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addi_8_pi(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_PI_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addi_8_pi7(void) +{ + uint src = OPER_I_8(); + uint ea = EA_A7_PI_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addi_8_pd(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addi_8_pd7(void) +{ + uint src = OPER_I_8(); + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addi_8_di(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_DI_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addi_8_ix(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_IX_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addi_8_aw(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AW_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addi_8_al(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AL_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addi_16_d(void) +{ + uint* r_dst = &DY; + uint src = OPER_I_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_addi_16_ai(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_AI_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addi_16_pi(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_PI_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addi_16_pd(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_PD_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addi_16_di(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_DI_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addi_16_ix(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_IX_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addi_16_aw(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AW_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addi_16_al(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AL_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addi_32_d(void) +{ + uint* r_dst = &DY; + uint src = OPER_I_32(); + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_addi_32_ai(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_AI_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addi_32_pi(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_PI_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addi_32_pd(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_PD_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addi_32_di(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_DI_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addi_32_ix(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_IX_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addi_32_aw(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AW_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addi_32_al(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AL_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addq_8_d(void) +{ + uint* r_dst = &DY; + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_addq_8_ai(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_AI_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addq_8_pi(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_PI_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addq_8_pi7(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_A7_PI_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addq_8_pd(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addq_8_pd7(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addq_8_di(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_DI_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addq_8_ix(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_IX_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addq_8_aw(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AW_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addq_8_al(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AL_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst; + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_addq_16_d(void) +{ + uint* r_dst = &DY; + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_addq_16_a(void) +{ + uint* r_dst = &AY; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + (((REG_IR >> 9) - 1) & 7) + 1); +} + + +void m68k_op_addq_16_ai(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_AI_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addq_16_pi(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_PI_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addq_16_pd(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_PD_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addq_16_di(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_DI_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addq_16_ix(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_IX_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addq_16_aw(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AW_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addq_16_al(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AL_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst; + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_addq_32_d(void) +{ + uint* r_dst = &DY; + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint dst = *r_dst; + uint res = src + dst; + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_addq_32_a(void) +{ + uint* r_dst = &AY; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst + (((REG_IR >> 9) - 1) & 7) + 1); +} + + +void m68k_op_addq_32_ai(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_AI_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addq_32_pi(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_PI_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addq_32_pd(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_PD_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addq_32_di(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_DI_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addq_32_ix(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_IX_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addq_32_aw(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AW_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addq_32_al(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AL_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst; + + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_addx_8_rr(void) +{ + uint* r_dst = &DX; + uint src = MASK_OUT_ABOVE_8(DY); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = src + dst + XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; +} + + +void m68k_op_addx_16_rr(void) +{ + uint* r_dst = &DX; + uint src = MASK_OUT_ABOVE_16(DY); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = src + dst + XFLAG_AS_1(); + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + + res = MASK_OUT_ABOVE_16(res); + FLAG_Z |= res; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; +} + + +void m68k_op_addx_32_rr(void) +{ + uint* r_dst = &DX; + uint src = DY; + uint dst = *r_dst; + uint res = src + dst + XFLAG_AS_1(); + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + + res = MASK_OUT_ABOVE_32(res); + FLAG_Z |= res; + + *r_dst = res; +} + + +void m68k_op_addx_8_mm_ax7(void) +{ + uint src = OPER_AY_PD_8(); + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst + XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_addx_8_mm_ay7(void) +{ + uint src = OPER_A7_PD_8(); + uint ea = EA_AX_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst + XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_addx_8_mm_axy7(void) +{ + uint src = OPER_A7_PD_8(); + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst + XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_addx_8_mm(void) +{ + uint src = OPER_AY_PD_8(); + uint ea = EA_AX_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = src + dst + XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_V = VFLAG_ADD_8(src, dst, res); + FLAG_X = FLAG_C = CFLAG_8(res); + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_addx_16_mm(void) +{ + uint src = OPER_AY_PD_16(); + uint ea = EA_AX_PD_16(); + uint dst = m68ki_read_16(ea); + uint res = src + dst + XFLAG_AS_1(); + + FLAG_N = NFLAG_16(res); + FLAG_V = VFLAG_ADD_16(src, dst, res); + FLAG_X = FLAG_C = CFLAG_16(res); + + res = MASK_OUT_ABOVE_16(res); + FLAG_Z |= res; + + m68ki_write_16(ea, res); +} + + +void m68k_op_addx_32_mm(void) +{ + uint src = OPER_AY_PD_32(); + uint ea = EA_AX_PD_32(); + uint dst = m68ki_read_32(ea); + uint res = src + dst + XFLAG_AS_1(); + + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_ADD_32(src, dst, res); + FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res); + + res = MASK_OUT_ABOVE_32(res); + FLAG_Z |= res; + + m68ki_write_32(ea, res); +} + + +void m68k_op_and_8_er_d(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (DY | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_er_ai(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AY_AI_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_er_pi(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AY_PI_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_er_pi7(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_A7_PI_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_er_pd(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AY_PD_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_er_pd7(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_A7_PD_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_er_di(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AY_DI_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_er_ix(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AY_IX_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_er_aw(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AW_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_er_al(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AL_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_er_pcdi(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_PCDI_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_er_pcix(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_PCIX_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_er_i(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_I_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_16_er_d(void) +{ + FLAG_Z = MASK_OUT_ABOVE_16(DX &= (DY | 0xffff0000)); + + FLAG_N = NFLAG_16(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_16_er_ai(void) +{ + FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AY_AI_16() | 0xffff0000)); + + FLAG_N = NFLAG_16(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_16_er_pi(void) +{ + FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AY_PI_16() | 0xffff0000)); + + FLAG_N = NFLAG_16(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_16_er_pd(void) +{ + FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AY_PD_16() | 0xffff0000)); + + FLAG_N = NFLAG_16(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_16_er_di(void) +{ + FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AY_DI_16() | 0xffff0000)); + + FLAG_N = NFLAG_16(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_16_er_ix(void) +{ + FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AY_IX_16() | 0xffff0000)); + + FLAG_N = NFLAG_16(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_16_er_aw(void) +{ + FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AW_16() | 0xffff0000)); + + FLAG_N = NFLAG_16(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_16_er_al(void) +{ + FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AL_16() | 0xffff0000)); + + FLAG_N = NFLAG_16(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_16_er_pcdi(void) +{ + FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_PCDI_16() | 0xffff0000)); + + FLAG_N = NFLAG_16(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_16_er_pcix(void) +{ + FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_PCIX_16() | 0xffff0000)); + + FLAG_N = NFLAG_16(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_16_er_i(void) +{ + FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_I_16() | 0xffff0000)); + + FLAG_N = NFLAG_16(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_32_er_d(void) +{ + FLAG_Z = DX &= DY; + + FLAG_N = NFLAG_32(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_32_er_ai(void) +{ + FLAG_Z = DX &= OPER_AY_AI_32(); + + FLAG_N = NFLAG_32(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_32_er_pi(void) +{ + FLAG_Z = DX &= OPER_AY_PI_32(); + + FLAG_N = NFLAG_32(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_32_er_pd(void) +{ + FLAG_Z = DX &= OPER_AY_PD_32(); + + FLAG_N = NFLAG_32(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_32_er_di(void) +{ + FLAG_Z = DX &= OPER_AY_DI_32(); + + FLAG_N = NFLAG_32(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_32_er_ix(void) +{ + FLAG_Z = DX &= OPER_AY_IX_32(); + + FLAG_N = NFLAG_32(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_32_er_aw(void) +{ + FLAG_Z = DX &= OPER_AW_32(); + + FLAG_N = NFLAG_32(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_32_er_al(void) +{ + FLAG_Z = DX &= OPER_AL_32(); + + FLAG_N = NFLAG_32(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_32_er_pcdi(void) +{ + FLAG_Z = DX &= OPER_PCDI_32(); + + FLAG_N = NFLAG_32(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_32_er_pcix(void) +{ + FLAG_Z = DX &= OPER_PCIX_32(); + + FLAG_N = NFLAG_32(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_32_er_i(void) +{ + FLAG_Z = DX &= OPER_I_32(); + + FLAG_N = NFLAG_32(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_and_8_re_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint res = DX & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_and_8_re_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint res = DX & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_and_8_re_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint res = DX & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_and_8_re_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint res = DX & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_and_8_re_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint res = DX & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_and_8_re_di(void) +{ + uint ea = EA_AY_DI_8(); + uint res = DX & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_and_8_re_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint res = DX & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_and_8_re_aw(void) +{ + uint ea = EA_AW_8(); + uint res = DX & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_and_8_re_al(void) +{ + uint ea = EA_AL_8(); + uint res = DX & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_and_16_re_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint res = DX & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_and_16_re_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint res = DX & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_and_16_re_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint res = DX & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_and_16_re_di(void) +{ + uint ea = EA_AY_DI_16(); + uint res = DX & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_and_16_re_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint res = DX & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_and_16_re_aw(void) +{ + uint ea = EA_AW_16(); + uint res = DX & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_and_16_re_al(void) +{ + uint ea = EA_AL_16(); + uint res = DX & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_and_32_re_ai(void) +{ + uint ea = EA_AY_AI_32(); + uint res = DX & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_and_32_re_pi(void) +{ + uint ea = EA_AY_PI_32(); + uint res = DX & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_and_32_re_pd(void) +{ + uint ea = EA_AY_PD_32(); + uint res = DX & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_and_32_re_di(void) +{ + uint ea = EA_AY_DI_32(); + uint res = DX & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_and_32_re_ix(void) +{ + uint ea = EA_AY_IX_32(); + uint res = DX & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_and_32_re_aw(void) +{ + uint ea = EA_AW_32(); + uint res = DX & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_and_32_re_al(void) +{ + uint ea = EA_AL_32(); + uint res = DX & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_andi_8_d(void) +{ + FLAG_Z = MASK_OUT_ABOVE_8(DY &= (OPER_I_8() | 0xffffff00)); + + FLAG_N = NFLAG_8(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_andi_8_ai(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_AI_8(); + uint res = src & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_8(ea, res); +} + + +void m68k_op_andi_8_pi(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_PI_8(); + uint res = src & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_8(ea, res); +} + + +void m68k_op_andi_8_pi7(void) +{ + uint src = OPER_I_8(); + uint ea = EA_A7_PI_8(); + uint res = src & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_8(ea, res); +} + + +void m68k_op_andi_8_pd(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_PD_8(); + uint res = src & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_8(ea, res); +} + + +void m68k_op_andi_8_pd7(void) +{ + uint src = OPER_I_8(); + uint ea = EA_A7_PD_8(); + uint res = src & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_8(ea, res); +} + + +void m68k_op_andi_8_di(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_DI_8(); + uint res = src & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_8(ea, res); +} + + +void m68k_op_andi_8_ix(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_IX_8(); + uint res = src & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_8(ea, res); +} + + +void m68k_op_andi_8_aw(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AW_8(); + uint res = src & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_8(ea, res); +} + + +void m68k_op_andi_8_al(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AL_8(); + uint res = src & m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_8(ea, res); +} + + +void m68k_op_andi_16_d(void) +{ + FLAG_Z = MASK_OUT_ABOVE_16(DY &= (OPER_I_16() | 0xffff0000)); + + FLAG_N = NFLAG_16(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_andi_16_ai(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_AI_16(); + uint res = src & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_16(ea, res); +} + + +void m68k_op_andi_16_pi(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_PI_16(); + uint res = src & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_16(ea, res); +} + + +void m68k_op_andi_16_pd(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_PD_16(); + uint res = src & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_16(ea, res); +} + + +void m68k_op_andi_16_di(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_DI_16(); + uint res = src & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_16(ea, res); +} + + +void m68k_op_andi_16_ix(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_IX_16(); + uint res = src & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_16(ea, res); +} + + +void m68k_op_andi_16_aw(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AW_16(); + uint res = src & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_16(ea, res); +} + + +void m68k_op_andi_16_al(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AL_16(); + uint res = src & m68ki_read_16(ea); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_16(ea, res); +} + + +void m68k_op_andi_32_d(void) +{ + FLAG_Z = DY &= (OPER_I_32()); + + FLAG_N = NFLAG_32(FLAG_Z); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_andi_32_ai(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_AI_32(); + uint res = src & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_andi_32_pi(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_PI_32(); + uint res = src & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_andi_32_pd(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_PD_32(); + uint res = src & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_andi_32_di(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_DI_32(); + uint res = src & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_andi_32_ix(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_IX_32(); + uint res = src & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_andi_32_aw(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AW_32(); + uint res = src & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_andi_32_al(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AL_32(); + uint res = src & m68ki_read_32(ea); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + + m68ki_write_32(ea, res); +} + + +void m68k_op_andi_16_toc(void) +{ + m68ki_set_ccr(m68ki_get_ccr() & OPER_I_16()); +} + + +void m68k_op_andi_16_tos(void) +{ + if(FLAG_S) + { + uint src = OPER_I_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(m68ki_get_sr() & src); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_asr_8_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = src >> shift; + + if(GET_MSB_8(src)) + res |= m68ki_shift_8_table[shift]; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_X = FLAG_C = src << (9-shift); +} + + +void m68k_op_asr_16_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_16(*r_dst); + uint res = src >> shift; + + if(GET_MSB_16(src)) + res |= m68ki_shift_16_table[shift]; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_X = FLAG_C = src << (9-shift); +} + + +void m68k_op_asr_32_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = *r_dst; + uint res = src >> shift; + + if(GET_MSB_32(src)) + res |= m68ki_shift_32_table[shift]; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_X = FLAG_C = src << (9-shift); +} + + +void m68k_op_asr_8_r(void) +{ + uint* r_dst = &DY; + uint shift = DX & 0x3f; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = src >> shift; + + if(shift != 0) + { + USE_CYCLES(shift<> shift; + + if(shift != 0) + { + USE_CYCLES(shift<> (shift - 1))<<8; + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + if(GET_MSB_16(src)) + { + *r_dst |= 0xffff; + FLAG_C = CFLAG_SET; + FLAG_X = XFLAG_SET; + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + return; + } + + *r_dst &= 0xffff0000; + FLAG_C = CFLAG_CLEAR; + FLAG_X = XFLAG_CLEAR; + FLAG_N = NFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_16(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_asr_32_r(void) +{ + uint* r_dst = &DY; + uint shift = DX & 0x3f; + uint src = *r_dst; + uint res = src >> shift; + + if(shift != 0) + { + USE_CYCLES(shift<> (shift - 1))<<8; + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + if(GET_MSB_32(src)) + { + *r_dst = 0xffffffff; + FLAG_C = CFLAG_SET; + FLAG_X = XFLAG_SET; + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + return; + } + + *r_dst = 0; + FLAG_C = CFLAG_CLEAR; + FLAG_X = XFLAG_CLEAR; + FLAG_N = NFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_32(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_asr_16_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + if(GET_MSB_16(src)) + res |= 0x8000; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = FLAG_X = src << 8; +} + + +void m68k_op_asr_16_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + if(GET_MSB_16(src)) + res |= 0x8000; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = FLAG_X = src << 8; +} + + +void m68k_op_asr_16_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + if(GET_MSB_16(src)) + res |= 0x8000; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = FLAG_X = src << 8; +} + + +void m68k_op_asr_16_di(void) +{ + uint ea = EA_AY_DI_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + if(GET_MSB_16(src)) + res |= 0x8000; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = FLAG_X = src << 8; +} + + +void m68k_op_asr_16_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + if(GET_MSB_16(src)) + res |= 0x8000; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = FLAG_X = src << 8; +} + + +void m68k_op_asr_16_aw(void) +{ + uint ea = EA_AW_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + if(GET_MSB_16(src)) + res |= 0x8000; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = FLAG_X = src << 8; +} + + +void m68k_op_asr_16_al(void) +{ + uint ea = EA_AL_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + if(GET_MSB_16(src)) + res |= 0x8000; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = FLAG_X = src << 8; +} + + +void m68k_op_asl_8_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = MASK_OUT_ABOVE_8(src << shift); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_X = FLAG_C = src << shift; + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + src &= m68ki_shift_8_table[shift + 1]; + FLAG_V = (!(src == 0 || (src == m68ki_shift_8_table[shift + 1] && shift < 8)))<<7; +} + + +void m68k_op_asl_16_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_16(*r_dst); + uint res = MASK_OUT_ABOVE_16(src << shift); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> (8-shift); + src &= m68ki_shift_16_table[shift + 1]; + FLAG_V = (!(src == 0 || src == m68ki_shift_16_table[shift + 1]))<<7; +} + + +void m68k_op_asl_32_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = *r_dst; + uint res = MASK_OUT_ABOVE_32(src << shift); + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> (24-shift); + src &= m68ki_shift_32_table[shift + 1]; + FLAG_V = (!(src == 0 || src == m68ki_shift_32_table[shift + 1]))<<7; +} + + +void m68k_op_asl_8_r(void) +{ + uint* r_dst = &DY; + uint shift = DX & 0x3f; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = MASK_OUT_ABOVE_8(src << shift); + + if(shift != 0) + { + USE_CYCLES(shift<> 8; + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + src &= m68ki_shift_16_table[shift + 1]; + FLAG_V = (!(src == 0 || src == m68ki_shift_16_table[shift + 1]))<<7; + return; + } + + *r_dst &= 0xffff0000; + FLAG_X = FLAG_C = ((shift == 16 ? src & 1 : 0))<<8; + FLAG_N = NFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; + FLAG_V = (!(src == 0))<<7; + return; + } + + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_16(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_asl_32_r(void) +{ + uint* r_dst = &DY; + uint shift = DX & 0x3f; + uint src = *r_dst; + uint res = MASK_OUT_ABOVE_32(src << shift); + + if(shift != 0) + { + USE_CYCLES(shift<> (32 - shift)) << 8; + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + src &= m68ki_shift_32_table[shift + 1]; + FLAG_V = (!(src == 0 || src == m68ki_shift_32_table[shift + 1]))<<7; + return; + } + + *r_dst = 0; + FLAG_X = FLAG_C = ((shift == 32 ? src & 1 : 0))<<8; + FLAG_N = NFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; + FLAG_V = (!(src == 0))<<7; + return; + } + + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_32(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_asl_16_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + src &= 0xc000; + FLAG_V = (!(src == 0 || src == 0xc000))<<7; +} + + +void m68k_op_asl_16_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + src &= 0xc000; + FLAG_V = (!(src == 0 || src == 0xc000))<<7; +} + + +void m68k_op_asl_16_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + src &= 0xc000; + FLAG_V = (!(src == 0 || src == 0xc000))<<7; +} + + +void m68k_op_asl_16_di(void) +{ + uint ea = EA_AY_DI_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + src &= 0xc000; + FLAG_V = (!(src == 0 || src == 0xc000))<<7; +} + + +void m68k_op_asl_16_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + src &= 0xc000; + FLAG_V = (!(src == 0 || src == 0xc000))<<7; +} + + +void m68k_op_asl_16_aw(void) +{ + uint ea = EA_AW_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + src &= 0xc000; + FLAG_V = (!(src == 0 || src == 0xc000))<<7; +} + + +void m68k_op_asl_16_al(void) +{ + uint ea = EA_AL_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + src &= 0xc000; + FLAG_V = (!(src == 0 || src == 0xc000))<<7; +} + + +void m68k_op_bhi_8(void) +{ + if(COND_HI()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_bls_8(void) +{ + if(COND_LS()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_bcc_8(void) +{ + if(COND_CC()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_bcs_8(void) +{ + if(COND_CS()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_bne_8(void) +{ + if(COND_NE()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_beq_8(void) +{ + if(COND_EQ()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_bvc_8(void) +{ + if(COND_VC()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_bvs_8(void) +{ + if(COND_VS()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_bpl_8(void) +{ + if(COND_PL()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_bmi_8(void) +{ + if(COND_MI()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_bge_8(void) +{ + if(COND_GE()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_blt_8(void) +{ + if(COND_LT()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_bgt_8(void) +{ + if(COND_GT()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_ble_8(void) +{ + if(COND_LE()) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + return; + } + USE_CYCLES(CYC_BCC_NOTAKE_B); +} + + +void m68k_op_bhi_16(void) +{ + if(COND_HI()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_bls_16(void) +{ + if(COND_LS()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_bcc_16(void) +{ + if(COND_CC()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_bcs_16(void) +{ + if(COND_CS()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_bne_16(void) +{ + if(COND_NE()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_beq_16(void) +{ + if(COND_EQ()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_bvc_16(void) +{ + if(COND_VC()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_bvs_16(void) +{ + if(COND_VS()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_bpl_16(void) +{ + if(COND_PL()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_bmi_16(void) +{ + if(COND_MI()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_bge_16(void) +{ + if(COND_GE()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_blt_16(void) +{ + if(COND_LT()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_bgt_16(void) +{ + if(COND_GT()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_ble_16(void) +{ + if(COND_LE()) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_BCC_NOTAKE_W); +} + + +void m68k_op_bhi_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_HI()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bls_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_LS()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bcc_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_CC()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bcs_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_CS()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bne_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_NE()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_beq_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_EQ()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bvc_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_VC()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bvs_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_VS()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bpl_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_PL()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bmi_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_MI()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bge_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_GE()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_blt_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_LT()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bgt_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_GT()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_ble_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_LE()) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bchg_32_r_d(void) +{ + uint* r_dst = &DY; + uint mask = 1 << (DX & 0x1f); + + FLAG_Z = *r_dst & mask; + *r_dst ^= mask; +} + + +void m68k_op_bchg_8_r_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_r_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_r_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_r_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_r_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_r_di(void) +{ + uint ea = EA_AY_DI_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_r_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_r_aw(void) +{ + uint ea = EA_AW_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_r_al(void) +{ + uint ea = EA_AL_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_32_s_d(void) +{ + uint* r_dst = &DY; + uint mask = 1 << (OPER_I_8() & 0x1f); + + FLAG_Z = *r_dst & mask; + *r_dst ^= mask; +} + + +void m68k_op_bchg_8_s_ai(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_AI_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_s_pi(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_PI_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_s_pi7(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_A7_PI_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_s_pd(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_PD_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_s_pd7(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_A7_PD_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_s_di(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_DI_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_s_ix(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_IX_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_s_aw(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AW_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bchg_8_s_al(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AL_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src ^ mask); +} + + +void m68k_op_bclr_32_r_d(void) +{ + uint* r_dst = &DY; + uint mask = 1 << (DX & 0x1f); + + FLAG_Z = *r_dst & mask; + *r_dst &= ~mask; +} + + +void m68k_op_bclr_8_r_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_r_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_r_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_r_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_r_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_r_di(void) +{ + uint ea = EA_AY_DI_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_r_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_r_aw(void) +{ + uint ea = EA_AW_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_r_al(void) +{ + uint ea = EA_AL_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_32_s_d(void) +{ + uint* r_dst = &DY; + uint mask = 1 << (OPER_I_8() & 0x1f); + + FLAG_Z = *r_dst & mask; + *r_dst &= ~mask; +} + + +void m68k_op_bclr_8_s_ai(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_AI_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_s_pi(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_PI_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_s_pi7(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_A7_PI_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_s_pd(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_PD_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_s_pd7(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_A7_PD_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_s_di(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_DI_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_s_ix(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_IX_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_s_aw(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AW_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bclr_8_s_al(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AL_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src & ~mask); +} + + +void m68k_op_bfchg_32_d(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint offset = (word2>>6)&31; + uint width = word2; + uint* data = &DY; + uint64 mask; + + + if(BIT_B(word2)) + offset = REG_D[offset&7]; + if(BIT_5(word2)) + width = REG_D[width&7]; + + offset &= 31; + width = ((width-1) & 31) + 1; + + mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask = ROR_32(mask, offset); + + FLAG_N = NFLAG_32(*data<>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_AI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long ^ mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte ^ mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfchg_32_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_DI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long ^ mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte ^ mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfchg_32_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_IX_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long ^ mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte ^ mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfchg_32_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AW_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long ^ mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte ^ mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfchg_32_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AL_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long ^ mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte ^ mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfclr_32_d(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint offset = (word2>>6)&31; + uint width = word2; + uint* data = &DY; + uint64 mask; + + + if(BIT_B(word2)) + offset = REG_D[offset&7]; + if(BIT_5(word2)) + width = REG_D[width&7]; + + + offset &= 31; + width = ((width-1) & 31) + 1; + + + mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask = ROR_32(mask, offset); + + FLAG_N = NFLAG_32(*data<>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_AI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long & ~mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte & ~mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfclr_32_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_DI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long & ~mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte & ~mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfclr_32_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_IX_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long & ~mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte & ~mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfclr_32_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AW_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long & ~mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte & ~mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfclr_32_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AL_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long & ~mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte & ~mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfexts_32_d(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint offset = (word2>>6)&31; + uint width = word2; + uint64 data = DY; + + + if(BIT_B(word2)) + offset = REG_D[offset&7]; + if(BIT_5(word2)) + width = REG_D[width&7]; + + offset &= 31; + width = ((width-1) & 31) + 1; + + data = ROL_32(data, offset); + FLAG_N = NFLAG_32(data); + data = MAKE_INT_32(data) >> (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2>>12)&7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfexts_32_ai(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_AY_AI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data = MAKE_INT_32(data) >> (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfexts_32_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_AY_DI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data = MAKE_INT_32(data) >> (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfexts_32_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_AY_IX_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data = MAKE_INT_32(data) >> (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfexts_32_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_AW_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data = MAKE_INT_32(data) >> (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfexts_32_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_AL_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data = MAKE_INT_32(data) >> (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfexts_32_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_PCDI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data = MAKE_INT_32(data) >> (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfexts_32_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_PCIX_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data = MAKE_INT_32(data) >> (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfextu_32_d(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint offset = (word2>>6)&31; + uint width = word2; + uint64 data = DY; + + + if(BIT_B(word2)) + offset = REG_D[offset&7]; + if(BIT_5(word2)) + width = REG_D[width&7]; + + offset &= 31; + width = ((width-1) & 31) + 1; + + data = ROL_32(data, offset); + FLAG_N = NFLAG_32(data); + data >>= 32 - width; + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2>>12)&7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfextu_32_ai(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_AY_AI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfextu_32_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_AY_DI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfextu_32_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_AY_IX_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfextu_32_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_AW_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfextu_32_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_AL_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfextu_32_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_PCDI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfextu_32_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint data; + uint ea = EA_PCIX_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + REG_D[(word2 >> 12) & 7] = data; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfffo_32_d(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint offset = (word2>>6)&31; + uint width = word2; + uint64 data = DY; + uint bit; + + + if(BIT_B(word2)) + offset = REG_D[offset&7]; + if(BIT_5(word2)) + width = REG_D[width&7]; + + offset &= 31; + width = ((width-1) & 31) + 1; + + data = ROL_32(data, offset); + FLAG_N = NFLAG_32(data); + data >>= 32 - width; + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1) + offset++; + + REG_D[(word2>>12)&7] = offset; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfffo_32_ai(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + sint local_offset; + uint width = word2; + uint data; + uint bit; + uint ea = EA_AY_AI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + local_offset = offset % 8; + if(local_offset < 0) + { + local_offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << local_offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1) + offset++; + + REG_D[(word2>>12)&7] = offset; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfffo_32_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + sint local_offset; + uint width = word2; + uint data; + uint bit; + uint ea = EA_AY_DI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + local_offset = offset % 8; + if(local_offset < 0) + { + local_offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << local_offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1) + offset++; + + REG_D[(word2>>12)&7] = offset; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfffo_32_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + sint local_offset; + uint width = word2; + uint data; + uint bit; + uint ea = EA_AY_IX_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + local_offset = offset % 8; + if(local_offset < 0) + { + local_offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << local_offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1) + offset++; + + REG_D[(word2>>12)&7] = offset; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfffo_32_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + sint local_offset; + uint width = word2; + uint data; + uint bit; + uint ea = EA_AW_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + local_offset = offset % 8; + if(local_offset < 0) + { + local_offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << local_offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1) + offset++; + + REG_D[(word2>>12)&7] = offset; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfffo_32_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + sint local_offset; + uint width = word2; + uint data; + uint bit; + uint ea = EA_AL_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + local_offset = offset % 8; + if(local_offset < 0) + { + local_offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << local_offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1) + offset++; + + REG_D[(word2>>12)&7] = offset; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfffo_32_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + sint local_offset; + uint width = word2; + uint data; + uint bit; + uint ea = EA_PCDI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + local_offset = offset % 8; + if(local_offset < 0) + { + local_offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << local_offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1) + offset++; + + REG_D[(word2>>12)&7] = offset; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfffo_32_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + sint local_offset; + uint width = word2; + uint data; + uint bit; + uint ea = EA_PCIX_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + local_offset = offset % 8; + if(local_offset < 0) + { + local_offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + data = m68ki_read_32(ea); + data = MASK_OUT_ABOVE_32(data< 32) + data |= (m68ki_read_8(ea+4) << local_offset) >> 8; + + FLAG_N = NFLAG_32(data); + data >>= (32 - width); + + FLAG_Z = data; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1) + offset++; + + REG_D[(word2>>12)&7] = offset; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfins_32_d(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint offset = (word2>>6)&31; + uint width = word2; + uint* data = &DY; + uint64 mask; + uint64 insert = REG_D[(word2>>12)&7]; + + + if(BIT_B(word2)) + offset = REG_D[offset&7]; + if(BIT_5(word2)) + width = REG_D[width&7]; + + + offset &= 31; + width = ((width-1) & 31) + 1; + + + mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask = ROR_32(mask, offset); + + insert = MASK_OUT_ABOVE_32(insert << (32 - width)); + FLAG_N = NFLAG_32(insert); + FLAG_Z = insert; + insert = ROR_32(insert, offset); + + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + *data &= ~mask; + *data |= insert; + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfins_32_ai(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint insert_base = REG_D[(word2>>12)&7]; + uint insert_long; + uint insert_byte; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_AI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + insert_base = MASK_OUT_ABOVE_32(insert_base << (32 - width)); + FLAG_N = NFLAG_32(insert_base); + FLAG_Z = insert_base; + insert_long = insert_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, (data_long & ~mask_long) | insert_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + insert_byte = MASK_OUT_ABOVE_8(insert_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, (data_byte & ~mask_byte) | insert_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfins_32_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint insert_base = REG_D[(word2>>12)&7]; + uint insert_long; + uint insert_byte; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_DI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + insert_base = MASK_OUT_ABOVE_32(insert_base << (32 - width)); + FLAG_N = NFLAG_32(insert_base); + FLAG_Z = insert_base; + insert_long = insert_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, (data_long & ~mask_long) | insert_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + insert_byte = MASK_OUT_ABOVE_8(insert_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, (data_byte & ~mask_byte) | insert_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfins_32_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint insert_base = REG_D[(word2>>12)&7]; + uint insert_long; + uint insert_byte; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_IX_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + insert_base = MASK_OUT_ABOVE_32(insert_base << (32 - width)); + FLAG_N = NFLAG_32(insert_base); + FLAG_Z = insert_base; + insert_long = insert_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, (data_long & ~mask_long) | insert_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + insert_byte = MASK_OUT_ABOVE_8(insert_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, (data_byte & ~mask_byte) | insert_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfins_32_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint insert_base = REG_D[(word2>>12)&7]; + uint insert_long; + uint insert_byte; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AW_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + insert_base = MASK_OUT_ABOVE_32(insert_base << (32 - width)); + FLAG_N = NFLAG_32(insert_base); + FLAG_Z = insert_base; + insert_long = insert_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, (data_long & ~mask_long) | insert_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + insert_byte = MASK_OUT_ABOVE_8(insert_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, (data_byte & ~mask_byte) | insert_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfins_32_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint insert_base = REG_D[(word2>>12)&7]; + uint insert_long; + uint insert_byte; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AL_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + insert_base = MASK_OUT_ABOVE_32(insert_base << (32 - width)); + FLAG_N = NFLAG_32(insert_base); + FLAG_Z = insert_base; + insert_long = insert_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, (data_long & ~mask_long) | insert_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + insert_byte = MASK_OUT_ABOVE_8(insert_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, (data_byte & ~mask_byte) | insert_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfset_32_d(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint offset = (word2>>6)&31; + uint width = word2; + uint* data = &DY; + uint64 mask; + + + if(BIT_B(word2)) + offset = REG_D[offset&7]; + if(BIT_5(word2)) + width = REG_D[width&7]; + + + offset &= 31; + width = ((width-1) & 31) + 1; + + + mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask = ROR_32(mask, offset); + + FLAG_N = NFLAG_32(*data<>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_AI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long | mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte | mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfset_32_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_DI_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long | mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte | mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfset_32_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_IX_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long | mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte | mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfset_32_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AW_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long | mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte | mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bfset_32_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AL_8(); + + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = NFLAG_32(data_long << offset); + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + m68ki_write_32(ea, data_long | mask_long); + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + m68ki_write_8(ea+4, data_byte | mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bftst_32_d(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint offset = (word2>>6)&31; + uint width = word2; + uint* data = &DY; + uint64 mask; + + + if(BIT_B(word2)) + offset = REG_D[offset&7]; + if(BIT_5(word2)) + width = REG_D[width&7]; + + + offset &= 31; + width = ((width-1) & 31) + 1; + + + mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask = ROR_32(mask, offset); + + FLAG_N = NFLAG_32(*data<>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_AI_8(); + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = ((data_long & (0x80000000 >> offset))<>24; + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bftst_32_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_DI_8(); + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = ((data_long & (0x80000000 >> offset))<>24; + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bftst_32_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AY_IX_8(); + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = ((data_long & (0x80000000 >> offset))<>24; + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bftst_32_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AW_8(); + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = ((data_long & (0x80000000 >> offset))<>24; + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bftst_32_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_AL_8(); + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = ((data_long & (0x80000000 >> offset))<>24; + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bftst_32_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_PCDI_8(); + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = ((data_long & (0x80000000 >> offset))<>24; + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bftst_32_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + sint offset = (word2>>6)&31; + uint width = word2; + uint mask_base; + uint data_long; + uint mask_long; + uint data_byte = 0; + uint mask_byte = 0; + uint ea = EA_PCIX_8(); + + if(BIT_B(word2)) + offset = MAKE_INT_32(REG_D[offset&7]); + if(BIT_5(word2)) + width = REG_D[width&7]; + + /* Offset is signed so we have to use ugly math =( */ + ea += offset / 8; + offset %= 8; + if(offset < 0) + { + offset += 8; + ea--; + } + width = ((width-1) & 31) + 1; + + + mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width)); + mask_long = mask_base >> offset; + + data_long = m68ki_read_32(ea); + FLAG_N = ((data_long & (0x80000000 >> offset))<>24; + FLAG_Z = data_long & mask_long; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + + if((width + offset) > 32) + { + mask_byte = MASK_OUT_ABOVE_8(mask_base); + data_byte = m68ki_read_8(ea+4); + FLAG_Z |= (data_byte & mask_byte); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bkpt(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + m68ki_bkpt_ack(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE) ? REG_IR & 7 : 0); /* auto-disable (see m68kcpu.h) */ + } + m68ki_exception_illegal(); +} + + +void m68k_op_bra_8(void) +{ + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); + if(REG_PC == REG_PPC) + USE_ALL_CYCLES(); +} + + +void m68k_op_bra_16(void) +{ + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + if(REG_PC == REG_PPC) + USE_ALL_CYCLES(); +} + + +void m68k_op_bra_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint offset = OPER_I_32(); + REG_PC -= 4; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_32(offset); + if(REG_PC == REG_PPC) + USE_ALL_CYCLES(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_bset_32_r_d(void) +{ + uint* r_dst = &DY; + uint mask = 1 << (DX & 0x1f); + + FLAG_Z = *r_dst & mask; + *r_dst |= mask; +} + + +void m68k_op_bset_8_r_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_r_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_r_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_r_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_r_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_r_di(void) +{ + uint ea = EA_AY_DI_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_r_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_r_aw(void) +{ + uint ea = EA_AW_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_r_al(void) +{ + uint ea = EA_AL_8(); + uint src = m68ki_read_8(ea); + uint mask = 1 << (DX & 7); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_32_s_d(void) +{ + uint* r_dst = &DY; + uint mask = 1 << (OPER_I_8() & 0x1f); + + FLAG_Z = *r_dst & mask; + *r_dst |= mask; +} + + +void m68k_op_bset_8_s_ai(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_AI_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_s_pi(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_PI_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_s_pi7(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_A7_PI_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_s_pd(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_PD_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_s_pd7(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_A7_PD_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_s_di(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_DI_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_s_ix(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AY_IX_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_s_aw(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AW_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bset_8_s_al(void) +{ + uint mask = 1 << (OPER_I_8() & 7); + uint ea = EA_AL_8(); + uint src = m68ki_read_8(ea); + + FLAG_Z = src & mask; + m68ki_write_8(ea, src | mask); +} + + +void m68k_op_bsr_8(void) +{ + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_push_32(REG_PC); + m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR)); +} + + +void m68k_op_bsr_16(void) +{ + uint offset = OPER_I_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_push_32(REG_PC); + REG_PC -= 2; + m68ki_branch_16(offset); +} + + +void m68k_op_bsr_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint offset = OPER_I_32(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_push_32(REG_PC); + REG_PC -= 4; + m68ki_branch_32(offset); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_btst_32_r_d(void) +{ + FLAG_Z = DY & (1 << (DX & 0x1f)); +} + + +void m68k_op_btst_8_r_ai(void) +{ + FLAG_Z = OPER_AY_AI_8() & (1 << (DX & 7)); +} + + +void m68k_op_btst_8_r_pi(void) +{ + FLAG_Z = OPER_AY_PI_8() & (1 << (DX & 7)); +} + + +void m68k_op_btst_8_r_pi7(void) +{ + FLAG_Z = OPER_A7_PI_8() & (1 << (DX & 7)); +} + + +void m68k_op_btst_8_r_pd(void) +{ + FLAG_Z = OPER_AY_PD_8() & (1 << (DX & 7)); +} + + +void m68k_op_btst_8_r_pd7(void) +{ + FLAG_Z = OPER_A7_PD_8() & (1 << (DX & 7)); +} + + +void m68k_op_btst_8_r_di(void) +{ + FLAG_Z = OPER_AY_DI_8() & (1 << (DX & 7)); +} + + +void m68k_op_btst_8_r_ix(void) +{ + FLAG_Z = OPER_AY_IX_8() & (1 << (DX & 7)); +} + + +void m68k_op_btst_8_r_aw(void) +{ + FLAG_Z = OPER_AW_8() & (1 << (DX & 7)); +} + + +void m68k_op_btst_8_r_al(void) +{ + FLAG_Z = OPER_AL_8() & (1 << (DX & 7)); +} + + +void m68k_op_btst_8_r_pcdi(void) +{ + FLAG_Z = OPER_PCDI_8() & (1 << (DX & 7)); +} + + +void m68k_op_btst_8_r_pcix(void) +{ + FLAG_Z = OPER_PCIX_8() & (1 << (DX & 7)); +} + + +void m68k_op_btst_8_r_i(void) +{ + FLAG_Z = OPER_I_8() & (1 << (DX & 7)); +} + + +void m68k_op_btst_32_s_d(void) +{ + FLAG_Z = DY & (1 << (OPER_I_8() & 0x1f)); +} + + +void m68k_op_btst_8_s_ai(void) +{ + uint bit = OPER_I_8() & 7; + + FLAG_Z = OPER_AY_AI_8() & (1 << bit); +} + + +void m68k_op_btst_8_s_pi(void) +{ + uint bit = OPER_I_8() & 7; + + FLAG_Z = OPER_AY_PI_8() & (1 << bit); +} + + +void m68k_op_btst_8_s_pi7(void) +{ + uint bit = OPER_I_8() & 7; + + FLAG_Z = OPER_A7_PI_8() & (1 << bit); +} + + +void m68k_op_btst_8_s_pd(void) +{ + uint bit = OPER_I_8() & 7; + + FLAG_Z = OPER_AY_PD_8() & (1 << bit); +} + + +void m68k_op_btst_8_s_pd7(void) +{ + uint bit = OPER_I_8() & 7; + + FLAG_Z = OPER_A7_PD_8() & (1 << bit); +} + + +void m68k_op_btst_8_s_di(void) +{ + uint bit = OPER_I_8() & 7; + + FLAG_Z = OPER_AY_DI_8() & (1 << bit); +} + + +void m68k_op_btst_8_s_ix(void) +{ + uint bit = OPER_I_8() & 7; + + FLAG_Z = OPER_AY_IX_8() & (1 << bit); +} + + +void m68k_op_btst_8_s_aw(void) +{ + uint bit = OPER_I_8() & 7; + + FLAG_Z = OPER_AW_8() & (1 << bit); +} + + +void m68k_op_btst_8_s_al(void) +{ + uint bit = OPER_I_8() & 7; + + FLAG_Z = OPER_AL_8() & (1 << bit); +} + + +void m68k_op_btst_8_s_pcdi(void) +{ + uint bit = OPER_I_8() & 7; + + FLAG_Z = OPER_PCDI_8() & (1 << bit); +} + + +void m68k_op_btst_8_s_pcix(void) +{ + uint bit = OPER_I_8() & 7; + + FLAG_Z = OPER_PCIX_8() & (1 << bit); +} + + +void m68k_op_callm_32_ai(void) +{ + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + { + uint ea = EA_AY_AI_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + REG_PC += 2; +(void)ea; /* just to avoid an 'unused variable' warning */ + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_callm_32_di(void) +{ + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + { + uint ea = EA_AY_DI_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + REG_PC += 2; +(void)ea; /* just to avoid an 'unused variable' warning */ + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_callm_32_ix(void) +{ + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + { + uint ea = EA_AY_IX_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + REG_PC += 2; +(void)ea; /* just to avoid an 'unused variable' warning */ + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_callm_32_aw(void) +{ + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + { + uint ea = EA_AW_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + REG_PC += 2; +(void)ea; /* just to avoid an 'unused variable' warning */ + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_callm_32_al(void) +{ + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + { + uint ea = EA_AL_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + REG_PC += 2; +(void)ea; /* just to avoid an 'unused variable' warning */ + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_callm_32_pcdi(void) +{ + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + { + uint ea = EA_PCDI_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + REG_PC += 2; +(void)ea; /* just to avoid an 'unused variable' warning */ + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_callm_32_pcix(void) +{ + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + { + uint ea = EA_PCIX_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + REG_PC += 2; +(void)ea; /* just to avoid an 'unused variable' warning */ + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_8_ai(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_AI_8(); + uint dest = m68ki_read_8(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_8(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(*compare, dest, res); + FLAG_C = CFLAG_8(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_8(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_8_pi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_PI_8(); + uint dest = m68ki_read_8(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_8(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(*compare, dest, res); + FLAG_C = CFLAG_8(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_8(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_8_pi7(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_A7_PI_8(); + uint dest = m68ki_read_8(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_8(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(*compare, dest, res); + FLAG_C = CFLAG_8(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_8(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_8_pd(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_PD_8(); + uint dest = m68ki_read_8(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_8(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(*compare, dest, res); + FLAG_C = CFLAG_8(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_8(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_8_pd7(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_A7_PD_8(); + uint dest = m68ki_read_8(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_8(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(*compare, dest, res); + FLAG_C = CFLAG_8(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_8(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_8_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_DI_8(); + uint dest = m68ki_read_8(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_8(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(*compare, dest, res); + FLAG_C = CFLAG_8(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_8(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_8_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_IX_8(); + uint dest = m68ki_read_8(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_8(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(*compare, dest, res); + FLAG_C = CFLAG_8(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_8(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_8_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AW_8(); + uint dest = m68ki_read_8(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_8(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(*compare, dest, res); + FLAG_C = CFLAG_8(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_8(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_8_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AL_8(); + uint dest = m68ki_read_8(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_8(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(*compare, dest, res); + FLAG_C = CFLAG_8(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_8(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_16_ai(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_AI_16(); + uint dest = m68ki_read_16(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_16(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(*compare, dest, res); + FLAG_C = CFLAG_16(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_16(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_16_pi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_PI_16(); + uint dest = m68ki_read_16(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_16(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(*compare, dest, res); + FLAG_C = CFLAG_16(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_16(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_16_pd(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_PD_16(); + uint dest = m68ki_read_16(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_16(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(*compare, dest, res); + FLAG_C = CFLAG_16(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_16(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_16_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_DI_16(); + uint dest = m68ki_read_16(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_16(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(*compare, dest, res); + FLAG_C = CFLAG_16(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_16(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_16_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_IX_16(); + uint dest = m68ki_read_16(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_16(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(*compare, dest, res); + FLAG_C = CFLAG_16(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_16(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_16_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AW_16(); + uint dest = m68ki_read_16(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_16(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(*compare, dest, res); + FLAG_C = CFLAG_16(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_16(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_16_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AL_16(); + uint dest = m68ki_read_16(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - MASK_OUT_ABOVE_16(*compare); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(*compare, dest, res); + FLAG_C = CFLAG_16(res); + + if(COND_NE()) + *compare = MASK_OUT_BELOW_16(*compare) | dest; + else + { + USE_CYCLES(3); + m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7])); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_32_ai(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_AI_32(); + uint dest = m68ki_read_32(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - *compare; + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(*compare, dest, res); + FLAG_C = CFLAG_SUB_32(*compare, dest, res); + + if(COND_NE()) + *compare = dest; + else + { + USE_CYCLES(3); + m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_32_pi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_PI_32(); + uint dest = m68ki_read_32(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - *compare; + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(*compare, dest, res); + FLAG_C = CFLAG_SUB_32(*compare, dest, res); + + if(COND_NE()) + *compare = dest; + else + { + USE_CYCLES(3); + m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_32_pd(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_PD_32(); + uint dest = m68ki_read_32(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - *compare; + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(*compare, dest, res); + FLAG_C = CFLAG_SUB_32(*compare, dest, res); + + if(COND_NE()) + *compare = dest; + else + { + USE_CYCLES(3); + m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_32_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_DI_32(); + uint dest = m68ki_read_32(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - *compare; + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(*compare, dest, res); + FLAG_C = CFLAG_SUB_32(*compare, dest, res); + + if(COND_NE()) + *compare = dest; + else + { + USE_CYCLES(3); + m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_32_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_IX_32(); + uint dest = m68ki_read_32(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - *compare; + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(*compare, dest, res); + FLAG_C = CFLAG_SUB_32(*compare, dest, res); + + if(COND_NE()) + *compare = dest; + else + { + USE_CYCLES(3); + m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_32_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AW_32(); + uint dest = m68ki_read_32(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - *compare; + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(*compare, dest, res); + FLAG_C = CFLAG_SUB_32(*compare, dest, res); + + if(COND_NE()) + *compare = dest; + else + { + USE_CYCLES(3); + m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas_32_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint ea = EA_AL_32(); + uint dest = m68ki_read_32(ea); + uint* compare = ®_D[word2 & 7]; + uint res = dest - *compare; + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(*compare, dest, res); + FLAG_C = CFLAG_SUB_32(*compare, dest, res); + + if(COND_NE()) + *compare = dest; + else + { + USE_CYCLES(3); + m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]); + } + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas2_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_32(); + uint* compare1 = ®_D[(word2 >> 16) & 7]; + uint ea1 = REG_DA[(word2 >> 28) & 15]; + uint dest1 = m68ki_read_16(ea1); + uint res1 = dest1 - MASK_OUT_ABOVE_16(*compare1); + uint* compare2 = ®_D[word2 & 7]; + uint ea2 = REG_DA[(word2 >> 12) & 15]; + uint dest2 = m68ki_read_16(ea2); + uint res2; + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_16(res1); + FLAG_Z = MASK_OUT_ABOVE_16(res1); + FLAG_V = VFLAG_SUB_16(*compare1, dest1, res1); + FLAG_C = CFLAG_16(res1); + + if(COND_EQ()) + { + res2 = dest2 - MASK_OUT_ABOVE_16(*compare2); + + FLAG_N = NFLAG_16(res2); + FLAG_Z = MASK_OUT_ABOVE_16(res2); + FLAG_V = VFLAG_SUB_16(*compare2, dest2, res2); + FLAG_C = CFLAG_16(res2); + + if(COND_EQ()) + { + USE_CYCLES(3); + m68ki_write_16(ea1, REG_D[(word2 >> 22) & 7]); + m68ki_write_16(ea2, REG_D[(word2 >> 6) & 7]); + return; + } + } + *compare1 = BIT_1F(word2) ? MAKE_INT_16(dest1) : MASK_OUT_BELOW_16(*compare1) | dest1; + *compare2 = BIT_F(word2) ? MAKE_INT_16(dest2) : MASK_OUT_BELOW_16(*compare2) | dest2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cas2_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_32(); + uint* compare1 = ®_D[(word2 >> 16) & 7]; + uint ea1 = REG_DA[(word2 >> 28) & 15]; + uint dest1 = m68ki_read_32(ea1); + uint res1 = dest1 - *compare1; + uint* compare2 = ®_D[word2 & 7]; + uint ea2 = REG_DA[(word2 >> 12) & 15]; + uint dest2 = m68ki_read_32(ea2); + uint res2; + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + FLAG_N = NFLAG_32(res1); + FLAG_Z = MASK_OUT_ABOVE_32(res1); + FLAG_V = VFLAG_SUB_32(*compare1, dest1, res1); + FLAG_C = CFLAG_SUB_32(*compare1, dest1, res1); + + if(COND_EQ()) + { + res2 = dest2 - *compare2; + + FLAG_N = NFLAG_32(res2); + FLAG_Z = MASK_OUT_ABOVE_32(res2); + FLAG_V = VFLAG_SUB_32(*compare2, dest2, res2); + FLAG_C = CFLAG_SUB_32(*compare2, dest2, res2); + + if(COND_EQ()) + { + USE_CYCLES(3); + m68ki_write_32(ea1, REG_D[(word2 >> 22) & 7]); + m68ki_write_32(ea2, REG_D[(word2 >> 6) & 7]); + return; + } + } + *compare1 = dest1; + *compare2 = dest2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk_16_d(void) +{ + sint src = MAKE_INT_16(DX); + sint bound = MAKE_INT_16(DY); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); +} + + +void m68k_op_chk_16_ai(void) +{ + sint src = MAKE_INT_16(DX); + sint bound = MAKE_INT_16(OPER_AY_AI_16()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); +} + + +void m68k_op_chk_16_pi(void) +{ + sint src = MAKE_INT_16(DX); + sint bound = MAKE_INT_16(OPER_AY_PI_16()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); +} + + +void m68k_op_chk_16_pd(void) +{ + sint src = MAKE_INT_16(DX); + sint bound = MAKE_INT_16(OPER_AY_PD_16()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); +} + + +void m68k_op_chk_16_di(void) +{ + sint src = MAKE_INT_16(DX); + sint bound = MAKE_INT_16(OPER_AY_DI_16()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); +} + + +void m68k_op_chk_16_ix(void) +{ + sint src = MAKE_INT_16(DX); + sint bound = MAKE_INT_16(OPER_AY_IX_16()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); +} + + +void m68k_op_chk_16_aw(void) +{ + sint src = MAKE_INT_16(DX); + sint bound = MAKE_INT_16(OPER_AW_16()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); +} + + +void m68k_op_chk_16_al(void) +{ + sint src = MAKE_INT_16(DX); + sint bound = MAKE_INT_16(OPER_AL_16()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); +} + + +void m68k_op_chk_16_pcdi(void) +{ + sint src = MAKE_INT_16(DX); + sint bound = MAKE_INT_16(OPER_PCDI_16()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); +} + + +void m68k_op_chk_16_pcix(void) +{ + sint src = MAKE_INT_16(DX); + sint bound = MAKE_INT_16(OPER_PCIX_16()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); +} + + +void m68k_op_chk_16_i(void) +{ + sint src = MAKE_INT_16(DX); + sint bound = MAKE_INT_16(OPER_I_16()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); +} + + +void m68k_op_chk_32_d(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + sint src = MAKE_INT_32(DX); + sint bound = MAKE_INT_32(DY); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk_32_ai(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + sint src = MAKE_INT_32(DX); + sint bound = MAKE_INT_32(OPER_AY_AI_32()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk_32_pi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + sint src = MAKE_INT_32(DX); + sint bound = MAKE_INT_32(OPER_AY_PI_32()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk_32_pd(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + sint src = MAKE_INT_32(DX); + sint bound = MAKE_INT_32(OPER_AY_PD_32()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk_32_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + sint src = MAKE_INT_32(DX); + sint bound = MAKE_INT_32(OPER_AY_DI_32()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk_32_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + sint src = MAKE_INT_32(DX); + sint bound = MAKE_INT_32(OPER_AY_IX_32()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk_32_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + sint src = MAKE_INT_32(DX); + sint bound = MAKE_INT_32(OPER_AW_32()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk_32_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + sint src = MAKE_INT_32(DX); + sint bound = MAKE_INT_32(OPER_AL_32()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk_32_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + sint src = MAKE_INT_32(DX); + sint bound = MAKE_INT_32(OPER_PCDI_32()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk_32_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + sint src = MAKE_INT_32(DX); + sint bound = MAKE_INT_32(OPER_PCIX_32()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk_32_i(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + sint src = MAKE_INT_32(DX); + sint bound = MAKE_INT_32(OPER_I_32()); + + if(src >= 0 && src <= bound) + { + return; + } + FLAG_N = (src < 0)<<7; + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_8_ai(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AY_AI_8(); + uint lower_bound = m68ki_read_8(ea); + uint upper_bound = m68ki_read_8(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_8(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_8_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AY_DI_8(); + uint lower_bound = m68ki_read_8(ea); + uint upper_bound = m68ki_read_8(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_8(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_8_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AY_IX_8(); + uint lower_bound = m68ki_read_8(ea); + uint upper_bound = m68ki_read_8(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_8(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_8_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AW_8(); + uint lower_bound = m68ki_read_8(ea); + uint upper_bound = m68ki_read_8(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_8(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_8_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AL_8(); + uint lower_bound = m68ki_read_8(ea); + uint upper_bound = m68ki_read_8(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_8(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_8_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_PCDI_8(); + uint lower_bound = m68ki_read_8(ea); + uint upper_bound = m68ki_read_8(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_8(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_8_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_PCIX_8(); + uint lower_bound = m68ki_read_8(ea); + uint upper_bound = m68ki_read_8(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_8(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_8(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_16_ai(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AY_AI_16(); + uint lower_bound = m68ki_read_16(ea); + uint upper_bound = m68ki_read_16(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_16(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_16_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AY_DI_16(); + uint lower_bound = m68ki_read_16(ea); + uint upper_bound = m68ki_read_16(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_16(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_16_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AY_IX_16(); + uint lower_bound = m68ki_read_16(ea); + uint upper_bound = m68ki_read_16(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_16(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_16_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AW_16(); + uint lower_bound = m68ki_read_16(ea); + uint upper_bound = m68ki_read_16(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_16(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_16_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AL_16(); + uint lower_bound = m68ki_read_16(ea); + uint upper_bound = m68ki_read_16(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_16(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_16_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_PCDI_16(); + uint lower_bound = m68ki_read_16(ea); + uint upper_bound = m68ki_read_16(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_16(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_16_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_PCIX_16(); + uint lower_bound = m68ki_read_16(ea); + uint upper_bound = m68ki_read_16(ea + 1); + + if(!BIT_F(word2)) + compare = MAKE_INT_16(compare); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_16(FLAG_C); + FLAG_C = CFLAG_16(FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_32_ai(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AY_AI_32(); + uint lower_bound = m68ki_read_32(ea); + uint upper_bound = m68ki_read_32(ea + 1); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_32_di(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AY_DI_32(); + uint lower_bound = m68ki_read_32(ea); + uint upper_bound = m68ki_read_32(ea + 1); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_32_ix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AY_IX_32(); + uint lower_bound = m68ki_read_32(ea); + uint upper_bound = m68ki_read_32(ea + 1); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_32_aw(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AW_32(); + uint lower_bound = m68ki_read_32(ea); + uint upper_bound = m68ki_read_32(ea + 1); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_32_al(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_AL_32(); + uint lower_bound = m68ki_read_32(ea); + uint upper_bound = m68ki_read_32(ea + 1); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_32_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_PCDI_32(); + uint lower_bound = m68ki_read_32(ea); + uint upper_bound = m68ki_read_32(ea + 1); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_chk2cmp2_32_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint compare = REG_DA[(word2 >> 12) & 15]; + uint ea = EA_PCIX_32(); + uint lower_bound = m68ki_read_32(ea); + uint upper_bound = m68ki_read_32(ea + 1); + + FLAG_C = compare - lower_bound; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C); + if(COND_CS()) + { + if(BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + return; + } + + FLAG_C = upper_bound - compare; + FLAG_Z = MASK_OUT_ABOVE_32(FLAG_C); + FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C); + if(COND_CS() && BIT_B(word2)) + m68ki_exception_trap(EXCEPTION_CHK); + + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_clr_8_d(void) +{ + DY &= 0xffffff00; + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_8_al(void) +{ + m68ki_write_8(EA_AL_8(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_16_d(void) +{ + DY &= 0xffff0000; + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_16_ai(void) +{ + m68ki_write_16(EA_AY_AI_16(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_16_pi(void) +{ + m68ki_write_16(EA_AY_PI_16(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_16_pd(void) +{ + m68ki_write_16(EA_AY_PD_16(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_16_di(void) +{ + m68ki_write_16(EA_AY_DI_16(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_16_ix(void) +{ + m68ki_write_16(EA_AY_IX_16(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_16_aw(void) +{ + m68ki_write_16(EA_AW_16(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_16_al(void) +{ + m68ki_write_16(EA_AL_16(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_32_d(void) +{ + DY = 0; + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_32_ai(void) +{ + m68ki_write_32(EA_AY_AI_32(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_32_pi(void) +{ + m68ki_write_32(EA_AY_PI_32(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_32_pd(void) +{ + m68ki_write_32(EA_AY_PD_32(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_32_di(void) +{ + m68ki_write_32(EA_AY_DI_32(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_32_ix(void) +{ + m68ki_write_32(EA_AY_IX_32(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_32_aw(void) +{ + m68ki_write_32(EA_AW_32(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_clr_32_al(void) +{ + m68ki_write_32(EA_AL_32(), 0); + + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; +} + + +void m68k_op_cmp_8_d(void) +{ + uint src = MASK_OUT_ABOVE_8(DY); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_8_ai(void) +{ + uint src = OPER_AY_AI_8(); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_8_pi(void) +{ + uint src = OPER_AY_PI_8(); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_8_pi7(void) +{ + uint src = OPER_A7_PI_8(); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_8_pd(void) +{ + uint src = OPER_AY_PD_8(); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_8_pd7(void) +{ + uint src = OPER_A7_PD_8(); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_8_di(void) +{ + uint src = OPER_AY_DI_8(); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_8_ix(void) +{ + uint src = OPER_AY_IX_8(); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_8_aw(void) +{ + uint src = OPER_AW_8(); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_8_al(void) +{ + uint src = OPER_AL_8(); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_8_pcdi(void) +{ + uint src = OPER_PCDI_8(); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_8_pcix(void) +{ + uint src = OPER_PCIX_8(); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_8_i(void) +{ + uint src = OPER_I_8(); + uint dst = MASK_OUT_ABOVE_8(DX); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmp_16_d(void) +{ + uint src = MASK_OUT_ABOVE_16(DY); + uint dst = MASK_OUT_ABOVE_16(DX); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmp_16_a(void) +{ + uint src = MASK_OUT_ABOVE_16(AY); + uint dst = MASK_OUT_ABOVE_16(DX); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmp_16_ai(void) +{ + uint src = OPER_AY_AI_16(); + uint dst = MASK_OUT_ABOVE_16(DX); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmp_16_pi(void) +{ + uint src = OPER_AY_PI_16(); + uint dst = MASK_OUT_ABOVE_16(DX); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmp_16_pd(void) +{ + uint src = OPER_AY_PD_16(); + uint dst = MASK_OUT_ABOVE_16(DX); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmp_16_di(void) +{ + uint src = OPER_AY_DI_16(); + uint dst = MASK_OUT_ABOVE_16(DX); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmp_16_ix(void) +{ + uint src = OPER_AY_IX_16(); + uint dst = MASK_OUT_ABOVE_16(DX); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmp_16_aw(void) +{ + uint src = OPER_AW_16(); + uint dst = MASK_OUT_ABOVE_16(DX); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmp_16_al(void) +{ + uint src = OPER_AL_16(); + uint dst = MASK_OUT_ABOVE_16(DX); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmp_16_pcdi(void) +{ + uint src = OPER_PCDI_16(); + uint dst = MASK_OUT_ABOVE_16(DX); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmp_16_pcix(void) +{ + uint src = OPER_PCIX_16(); + uint dst = MASK_OUT_ABOVE_16(DX); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmp_16_i(void) +{ + uint src = OPER_I_16(); + uint dst = MASK_OUT_ABOVE_16(DX); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmp_32_d(void) +{ + uint src = DY; + uint dst = DX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmp_32_a(void) +{ + uint src = AY; + uint dst = DX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmp_32_ai(void) +{ + uint src = OPER_AY_AI_32(); + uint dst = DX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmp_32_pi(void) +{ + uint src = OPER_AY_PI_32(); + uint dst = DX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmp_32_pd(void) +{ + uint src = OPER_AY_PD_32(); + uint dst = DX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmp_32_di(void) +{ + uint src = OPER_AY_DI_32(); + uint dst = DX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmp_32_ix(void) +{ + uint src = OPER_AY_IX_32(); + uint dst = DX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmp_32_aw(void) +{ + uint src = OPER_AW_32(); + uint dst = DX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmp_32_al(void) +{ + uint src = OPER_AL_32(); + uint dst = DX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmp_32_pcdi(void) +{ + uint src = OPER_PCDI_32(); + uint dst = DX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmp_32_pcix(void) +{ + uint src = OPER_PCIX_32(); + uint dst = DX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmp_32_i(void) +{ + uint src = OPER_I_32(); + uint dst = DX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_16_d(void) +{ + uint src = MAKE_INT_16(DY); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_16_a(void) +{ + uint src = MAKE_INT_16(AY); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_16_ai(void) +{ + uint src = MAKE_INT_16(OPER_AY_AI_16()); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_16_pi(void) +{ + uint src = MAKE_INT_16(OPER_AY_PI_16()); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_16_pd(void) +{ + uint src = MAKE_INT_16(OPER_AY_PD_16()); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_16_di(void) +{ + uint src = MAKE_INT_16(OPER_AY_DI_16()); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_16_ix(void) +{ + uint src = MAKE_INT_16(OPER_AY_IX_16()); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_16_aw(void) +{ + uint src = MAKE_INT_16(OPER_AW_16()); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_16_al(void) +{ + uint src = MAKE_INT_16(OPER_AL_16()); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_16_pcdi(void) +{ + uint src = MAKE_INT_16(OPER_PCDI_16()); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_16_pcix(void) +{ + uint src = MAKE_INT_16(OPER_PCIX_16()); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_16_i(void) +{ + uint src = MAKE_INT_16(OPER_I_16()); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_32_d(void) +{ + uint src = DY; + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_32_a(void) +{ + uint src = AY; + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_32_ai(void) +{ + uint src = OPER_AY_AI_32(); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_32_pi(void) +{ + uint src = OPER_AY_PI_32(); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_32_pd(void) +{ + uint src = OPER_AY_PD_32(); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_32_di(void) +{ + uint src = OPER_AY_DI_32(); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_32_ix(void) +{ + uint src = OPER_AY_IX_32(); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_32_aw(void) +{ + uint src = OPER_AW_32(); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_32_al(void) +{ + uint src = OPER_AL_32(); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_32_pcdi(void) +{ + uint src = OPER_PCDI_32(); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_32_pcix(void) +{ + uint src = OPER_PCIX_32(); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpa_32_i(void) +{ + uint src = OPER_I_32(); + uint dst = AX; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpi_8_d(void) +{ + uint src = OPER_I_8(); + uint dst = MASK_OUT_ABOVE_8(DY); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpi_8_ai(void) +{ + uint src = OPER_I_8(); + uint dst = OPER_AY_AI_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpi_8_pi(void) +{ + uint src = OPER_I_8(); + uint dst = OPER_AY_PI_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpi_8_pi7(void) +{ + uint src = OPER_I_8(); + uint dst = OPER_A7_PI_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpi_8_pd(void) +{ + uint src = OPER_I_8(); + uint dst = OPER_AY_PD_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpi_8_pd7(void) +{ + uint src = OPER_I_8(); + uint dst = OPER_A7_PD_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpi_8_di(void) +{ + uint src = OPER_I_8(); + uint dst = OPER_AY_DI_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpi_8_ix(void) +{ + uint src = OPER_I_8(); + uint dst = OPER_AY_IX_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpi_8_aw(void) +{ + uint src = OPER_I_8(); + uint dst = OPER_AW_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpi_8_al(void) +{ + uint src = OPER_I_8(); + uint dst = OPER_AL_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpi_8_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint src = OPER_I_8(); + uint dst = OPER_PCDI_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cmpi_8_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint src = OPER_I_8(); + uint dst = OPER_PCIX_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cmpi_16_d(void) +{ + uint src = OPER_I_16(); + uint dst = MASK_OUT_ABOVE_16(DY); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmpi_16_ai(void) +{ + uint src = OPER_I_16(); + uint dst = OPER_AY_AI_16(); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmpi_16_pi(void) +{ + uint src = OPER_I_16(); + uint dst = OPER_AY_PI_16(); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmpi_16_pd(void) +{ + uint src = OPER_I_16(); + uint dst = OPER_AY_PD_16(); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmpi_16_di(void) +{ + uint src = OPER_I_16(); + uint dst = OPER_AY_DI_16(); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmpi_16_ix(void) +{ + uint src = OPER_I_16(); + uint dst = OPER_AY_IX_16(); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmpi_16_aw(void) +{ + uint src = OPER_I_16(); + uint dst = OPER_AW_16(); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmpi_16_al(void) +{ + uint src = OPER_I_16(); + uint dst = OPER_AL_16(); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmpi_16_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint src = OPER_I_16(); + uint dst = OPER_PCDI_16(); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cmpi_16_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint src = OPER_I_16(); + uint dst = OPER_PCIX_16(); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cmpi_32_d(void) +{ + uint src = OPER_I_32(); + uint dst = DY; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpi_32_ai(void) +{ + uint src = OPER_I_32(); + uint dst = OPER_AY_AI_32(); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpi_32_pi(void) +{ + uint src = OPER_I_32(); + uint dst = OPER_AY_PI_32(); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpi_32_pd(void) +{ + uint src = OPER_I_32(); + uint dst = OPER_AY_PD_32(); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpi_32_di(void) +{ + uint src = OPER_I_32(); + uint dst = OPER_AY_DI_32(); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpi_32_ix(void) +{ + uint src = OPER_I_32(); + uint dst = OPER_AY_IX_32(); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpi_32_aw(void) +{ + uint src = OPER_I_32(); + uint dst = OPER_AW_32(); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpi_32_al(void) +{ + uint src = OPER_I_32(); + uint dst = OPER_AL_32(); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cmpi_32_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint src = OPER_I_32(); + uint dst = OPER_PCDI_32(); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cmpi_32_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint src = OPER_I_32(); + uint dst = OPER_PCIX_32(); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_cmpm_8_ax7(void) +{ + uint src = OPER_AY_PI_8(); + uint dst = OPER_A7_PI_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpm_8_ay7(void) +{ + uint src = OPER_A7_PI_8(); + uint dst = OPER_AX_PI_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpm_8_axy7(void) +{ + uint src = OPER_A7_PI_8(); + uint dst = OPER_A7_PI_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpm_8(void) +{ + uint src = OPER_AY_PI_8(); + uint dst = OPER_AX_PI_8(); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_C = CFLAG_8(res); +} + + +void m68k_op_cmpm_16(void) +{ + uint src = OPER_AY_PI_16(); + uint dst = OPER_AX_PI_16(); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_C = CFLAG_16(res); +} + + +void m68k_op_cmpm_32(void) +{ + uint src = OPER_AY_PI_32(); + uint dst = OPER_AX_PI_32(); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_C = CFLAG_SUB_32(src, dst, res); +} + + +void m68k_op_cpbcc_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_1111(); +} + + +void m68k_op_cpdbcc_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_1111(); +} + + +void m68k_op_cpgen_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_1111(); +} + + +void m68k_op_cpscc_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_1111(); +} + + +void m68k_op_cptrapcc_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_1111(); +} + + +/* ======================================================================== */ +/* ============================== END OF FILE ============================= */ +/* ======================================================================== */ + + diff --git a/source/m68k/m68kopdm.c b/source/m68k/m68kopdm.c new file mode 100644 index 0000000..7a47d63 --- /dev/null +++ b/source/m68k/m68kopdm.c @@ -0,0 +1,13286 @@ +#include "m68kcpu.h" + +/* ======================================================================== */ +/* ========================= INSTRUCTION HANDLERS ========================= */ +/* ======================================================================== */ + + +void m68k_op_dbt_16(void) +{ + REG_PC += 2; +} + + +void m68k_op_dbf_16(void) +{ + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + return; + } + REG_PC += 2; +} + + +void m68k_op_dbhi_16(void) +{ + if(COND_NOT_HI()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dbls_16(void) +{ + if(COND_NOT_LS()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dbcc_16(void) +{ + if(COND_NOT_CC()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dbcs_16(void) +{ + if(COND_NOT_CS()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dbne_16(void) +{ + if(COND_NOT_NE()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dbeq_16(void) +{ + if(COND_NOT_EQ()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dbvc_16(void) +{ + if(COND_NOT_VC()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dbvs_16(void) +{ + if(COND_NOT_VS()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dbpl_16(void) +{ + if(COND_NOT_PL()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dbmi_16(void) +{ + if(COND_NOT_MI()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dbge_16(void) +{ + if(COND_NOT_GE()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dblt_16(void) +{ + if(COND_NOT_LT()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dbgt_16(void) +{ + if(COND_NOT_GT()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_dble_16(void) +{ + if(COND_NOT_LE()) + { + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(*r_dst - 1); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + if(res != 0xffff) + { + uint offset = OPER_I_16(); + REG_PC -= 2; + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_branch_16(offset); + USE_CYCLES(CYC_DBCC_F_NOEXP); + return; + } + REG_PC += 2; + USE_CYCLES(CYC_DBCC_F_EXP); + return; + } + REG_PC += 2; +} + + +void m68k_op_divs_16_d(void) +{ + uint* r_dst = &DX; + sint src = MAKE_INT_16(DY); + sint quotient; + sint remainder; + + if(src != 0) + { + if((uint32)*r_dst == 0x80000000 && src == -1) + { + FLAG_Z = 0; + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = 0; + return; + } + + quotient = MAKE_INT_32(*r_dst) / src; + remainder = MAKE_INT_32(*r_dst) % src; + + if(quotient == MAKE_INT_16(quotient)) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divs_16_ai(void) +{ + uint* r_dst = &DX; + sint src = MAKE_INT_16(OPER_AY_AI_16()); + sint quotient; + sint remainder; + + if(src != 0) + { + if((uint32)*r_dst == 0x80000000 && src == -1) + { + FLAG_Z = 0; + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = 0; + return; + } + + quotient = MAKE_INT_32(*r_dst) / src; + remainder = MAKE_INT_32(*r_dst) % src; + + if(quotient == MAKE_INT_16(quotient)) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divs_16_pi(void) +{ + uint* r_dst = &DX; + sint src = MAKE_INT_16(OPER_AY_PI_16()); + sint quotient; + sint remainder; + + if(src != 0) + { + if((uint32)*r_dst == 0x80000000 && src == -1) + { + FLAG_Z = 0; + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = 0; + return; + } + + quotient = MAKE_INT_32(*r_dst) / src; + remainder = MAKE_INT_32(*r_dst) % src; + + if(quotient == MAKE_INT_16(quotient)) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divs_16_pd(void) +{ + uint* r_dst = &DX; + sint src = MAKE_INT_16(OPER_AY_PD_16()); + sint quotient; + sint remainder; + + if(src != 0) + { + if((uint32)*r_dst == 0x80000000 && src == -1) + { + FLAG_Z = 0; + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = 0; + return; + } + + quotient = MAKE_INT_32(*r_dst) / src; + remainder = MAKE_INT_32(*r_dst) % src; + + if(quotient == MAKE_INT_16(quotient)) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divs_16_di(void) +{ + uint* r_dst = &DX; + sint src = MAKE_INT_16(OPER_AY_DI_16()); + sint quotient; + sint remainder; + + if(src != 0) + { + if((uint32)*r_dst == 0x80000000 && src == -1) + { + FLAG_Z = 0; + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = 0; + return; + } + + quotient = MAKE_INT_32(*r_dst) / src; + remainder = MAKE_INT_32(*r_dst) % src; + + if(quotient == MAKE_INT_16(quotient)) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divs_16_ix(void) +{ + uint* r_dst = &DX; + sint src = MAKE_INT_16(OPER_AY_IX_16()); + sint quotient; + sint remainder; + + if(src != 0) + { + if((uint32)*r_dst == 0x80000000 && src == -1) + { + FLAG_Z = 0; + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = 0; + return; + } + + quotient = MAKE_INT_32(*r_dst) / src; + remainder = MAKE_INT_32(*r_dst) % src; + + if(quotient == MAKE_INT_16(quotient)) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divs_16_aw(void) +{ + uint* r_dst = &DX; + sint src = MAKE_INT_16(OPER_AW_16()); + sint quotient; + sint remainder; + + if(src != 0) + { + if((uint32)*r_dst == 0x80000000 && src == -1) + { + FLAG_Z = 0; + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = 0; + return; + } + + quotient = MAKE_INT_32(*r_dst) / src; + remainder = MAKE_INT_32(*r_dst) % src; + + if(quotient == MAKE_INT_16(quotient)) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divs_16_al(void) +{ + uint* r_dst = &DX; + sint src = MAKE_INT_16(OPER_AL_16()); + sint quotient; + sint remainder; + + if(src != 0) + { + if((uint32)*r_dst == 0x80000000 && src == -1) + { + FLAG_Z = 0; + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = 0; + return; + } + + quotient = MAKE_INT_32(*r_dst) / src; + remainder = MAKE_INT_32(*r_dst) % src; + + if(quotient == MAKE_INT_16(quotient)) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divs_16_pcdi(void) +{ + uint* r_dst = &DX; + sint src = MAKE_INT_16(OPER_PCDI_16()); + sint quotient; + sint remainder; + + if(src != 0) + { + if((uint32)*r_dst == 0x80000000 && src == -1) + { + FLAG_Z = 0; + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = 0; + return; + } + + quotient = MAKE_INT_32(*r_dst) / src; + remainder = MAKE_INT_32(*r_dst) % src; + + if(quotient == MAKE_INT_16(quotient)) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divs_16_pcix(void) +{ + uint* r_dst = &DX; + sint src = MAKE_INT_16(OPER_PCIX_16()); + sint quotient; + sint remainder; + + if(src != 0) + { + if((uint32)*r_dst == 0x80000000 && src == -1) + { + FLAG_Z = 0; + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = 0; + return; + } + + quotient = MAKE_INT_32(*r_dst) / src; + remainder = MAKE_INT_32(*r_dst) % src; + + if(quotient == MAKE_INT_16(quotient)) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divs_16_i(void) +{ + uint* r_dst = &DX; + sint src = MAKE_INT_16(OPER_I_16()); + sint quotient; + sint remainder; + + if(src != 0) + { + if((uint32)*r_dst == 0x80000000 && src == -1) + { + FLAG_Z = 0; + FLAG_N = NFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = 0; + return; + } + + quotient = MAKE_INT_32(*r_dst) / src; + remainder = MAKE_INT_32(*r_dst) % src; + + if(quotient == MAKE_INT_16(quotient)) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divu_16_d(void) +{ + uint* r_dst = &DX; + uint src = MASK_OUT_ABOVE_16(DY); + + if(src != 0) + { + uint quotient = *r_dst / src; + uint remainder = *r_dst % src; + + if(quotient < 0x10000) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divu_16_ai(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_AI_16(); + + if(src != 0) + { + uint quotient = *r_dst / src; + uint remainder = *r_dst % src; + + if(quotient < 0x10000) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divu_16_pi(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PI_16(); + + if(src != 0) + { + uint quotient = *r_dst / src; + uint remainder = *r_dst % src; + + if(quotient < 0x10000) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divu_16_pd(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PD_16(); + + if(src != 0) + { + uint quotient = *r_dst / src; + uint remainder = *r_dst % src; + + if(quotient < 0x10000) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divu_16_di(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_DI_16(); + + if(src != 0) + { + uint quotient = *r_dst / src; + uint remainder = *r_dst % src; + + if(quotient < 0x10000) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divu_16_ix(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_IX_16(); + + if(src != 0) + { + uint quotient = *r_dst / src; + uint remainder = *r_dst % src; + + if(quotient < 0x10000) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divu_16_aw(void) +{ + uint* r_dst = &DX; + uint src = OPER_AW_16(); + + if(src != 0) + { + uint quotient = *r_dst / src; + uint remainder = *r_dst % src; + + if(quotient < 0x10000) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divu_16_al(void) +{ + uint* r_dst = &DX; + uint src = OPER_AL_16(); + + if(src != 0) + { + uint quotient = *r_dst / src; + uint remainder = *r_dst % src; + + if(quotient < 0x10000) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divu_16_pcdi(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCDI_16(); + + if(src != 0) + { + uint quotient = *r_dst / src; + uint remainder = *r_dst % src; + + if(quotient < 0x10000) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divu_16_pcix(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCIX_16(); + + if(src != 0) + { + uint quotient = *r_dst / src; + uint remainder = *r_dst % src; + + if(quotient < 0x10000) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divu_16_i(void) +{ + uint* r_dst = &DX; + uint src = OPER_I_16(); + + if(src != 0) + { + uint quotient = *r_dst / src; + uint remainder = *r_dst % src; + + if(quotient < 0x10000) + { + FLAG_Z = quotient; + FLAG_N = NFLAG_16(quotient); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst = MASK_OUT_ABOVE_32(MASK_OUT_ABOVE_16(quotient) | (remainder << 16)); + return; + } + FLAG_V = VFLAG_SET; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); +} + + +void m68k_op_divl_32_d(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 divisor = DY; + uint64 dividend = 0; + uint64 quotient = 0; + uint64 remainder = 0; + + if(divisor != 0) + { + if(BIT_A(word2)) /* 64 bit */ + { + dividend = REG_D[word2 & 7]; + dividend <<= 32; + dividend |= REG_D[(word2 >> 12) & 7]; + + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); + if((sint64)quotient != (sint64)((sint32)quotient)) + { + FLAG_V = VFLAG_SET; + return; + } + } + else /* unsigned */ + { + quotient = dividend / divisor; + if(quotient > 0xffffffff) + { + FLAG_V = VFLAG_SET; + return; + } + remainder = dividend % divisor; + } + } + else /* 32 bit */ + { + dividend = REG_D[(word2 >> 12) & 7]; + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); + } + else /* unsigned */ + { + quotient = dividend / divisor; + remainder = dividend % divisor; + } + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint divisor = DY; + uint dividend_hi = REG_D[word2 & 7]; + uint dividend_lo = REG_D[(word2 >> 12) & 7]; + uint quotient = 0; + uint remainder = 0; + uint dividend_neg = 0; + uint divisor_neg = 0; + sint i; + uint overflow; + + if(divisor != 0) + { + /* quad / long : long quotient, long remainder */ + if(BIT_A(word2)) + { + if(BIT_B(word2)) /* signed */ + { + /* special case in signed divide */ + if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + REG_D[word2 & 7] = 0; + REG_D[(word2 >> 12) & 7] = 0x80000000; + + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + if(GET_MSB_32(dividend_hi)) + { + dividend_neg = 1; + dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); + dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); + } + if(GET_MSB_32(divisor)) + { + divisor_neg = 1; + divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); + + } + } + + /* if the upper long is greater than the divisor, we're overflowing. */ + if(dividend_hi >= divisor) + { + FLAG_V = VFLAG_SET; + return; + } + + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + remainder = (remainder << 1) + ((dividend_hi >> i) & 1); + if(remainder >= divisor) + { + remainder -= divisor; + quotient++; + } + } + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + overflow = GET_MSB_32(remainder); + remainder = (remainder << 1) + ((dividend_lo >> i) & 1); + if(remainder >= divisor || overflow) + { + remainder -= divisor; + quotient++; + } + } + + if(BIT_B(word2)) /* signed */ + { + if(quotient > 0x7fffffff) + { + FLAG_V = VFLAG_SET; + return; + } + if(dividend_neg) + { + remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + if(divisor_neg) + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + + /* long / long: long quotient, maybe long remainder */ + if(BIT_B(word2)) /* signed */ + { + /* Special case in divide */ + if(dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + REG_D[(word2 >> 12) & 7] = 0x80000000; + REG_D[word2 & 7] = 0; + return; + } + REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); + } + else + { + REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); + } + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_divl_32_ai(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 divisor = OPER_AY_AI_32(); + uint64 dividend = 0; + uint64 quotient = 0; + uint64 remainder = 0; + + if(divisor != 0) + { + if(BIT_A(word2)) /* 64 bit */ + { + dividend = REG_D[word2 & 7]; + dividend <<= 32; + dividend |= REG_D[(word2 >> 12) & 7]; + + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); + if((sint64)quotient != (sint64)((sint32)quotient)) + { + FLAG_V = VFLAG_SET; + return; + } + } + else /* unsigned */ + { + quotient = dividend / divisor; + if(quotient > 0xffffffff) + { + FLAG_V = VFLAG_SET; + return; + } + remainder = dividend % divisor; + } + } + else /* 32 bit */ + { + dividend = REG_D[(word2 >> 12) & 7]; + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); + } + else /* unsigned */ + { + quotient = dividend / divisor; + remainder = dividend % divisor; + } + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint divisor = OPER_AY_AI_32(); + uint dividend_hi = REG_D[word2 & 7]; + uint dividend_lo = REG_D[(word2 >> 12) & 7]; + uint quotient = 0; + uint remainder = 0; + uint dividend_neg = 0; + uint divisor_neg = 0; + sint i; + uint overflow; + + if(divisor != 0) + { + /* quad / long : long quotient, long remainder */ + if(BIT_A(word2)) + { + if(BIT_B(word2)) /* signed */ + { + /* special case in signed divide */ + if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + REG_D[word2 & 7] = 0; + REG_D[(word2 >> 12) & 7] = 0x80000000; + + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + if(GET_MSB_32(dividend_hi)) + { + dividend_neg = 1; + dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); + dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); + } + if(GET_MSB_32(divisor)) + { + divisor_neg = 1; + divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); + + } + } + + /* if the upper long is greater than the divisor, we're overflowing. */ + if(dividend_hi >= divisor) + { + FLAG_V = VFLAG_SET; + return; + } + + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + remainder = (remainder << 1) + ((dividend_hi >> i) & 1); + if(remainder >= divisor) + { + remainder -= divisor; + quotient++; + } + } + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + overflow = GET_MSB_32(remainder); + remainder = (remainder << 1) + ((dividend_lo >> i) & 1); + if(remainder >= divisor || overflow) + { + remainder -= divisor; + quotient++; + } + } + + if(BIT_B(word2)) /* signed */ + { + if(quotient > 0x7fffffff) + { + FLAG_V = VFLAG_SET; + return; + } + if(dividend_neg) + { + remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + if(divisor_neg) + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + + /* long / long: long quotient, maybe long remainder */ + if(BIT_B(word2)) /* signed */ + { + /* Special case in divide */ + if(dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + REG_D[(word2 >> 12) & 7] = 0x80000000; + REG_D[word2 & 7] = 0; + return; + } + REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); + } + else + { + REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); + } + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_divl_32_pi(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 divisor = OPER_AY_PI_32(); + uint64 dividend = 0; + uint64 quotient = 0; + uint64 remainder = 0; + + if(divisor != 0) + { + if(BIT_A(word2)) /* 64 bit */ + { + dividend = REG_D[word2 & 7]; + dividend <<= 32; + dividend |= REG_D[(word2 >> 12) & 7]; + + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); + if((sint64)quotient != (sint64)((sint32)quotient)) + { + FLAG_V = VFLAG_SET; + return; + } + } + else /* unsigned */ + { + quotient = dividend / divisor; + if(quotient > 0xffffffff) + { + FLAG_V = VFLAG_SET; + return; + } + remainder = dividend % divisor; + } + } + else /* 32 bit */ + { + dividend = REG_D[(word2 >> 12) & 7]; + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); + } + else /* unsigned */ + { + quotient = dividend / divisor; + remainder = dividend % divisor; + } + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint divisor = OPER_AY_PI_32(); + uint dividend_hi = REG_D[word2 & 7]; + uint dividend_lo = REG_D[(word2 >> 12) & 7]; + uint quotient = 0; + uint remainder = 0; + uint dividend_neg = 0; + uint divisor_neg = 0; + sint i; + uint overflow; + + if(divisor != 0) + { + /* quad / long : long quotient, long remainder */ + if(BIT_A(word2)) + { + if(BIT_B(word2)) /* signed */ + { + /* special case in signed divide */ + if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + REG_D[word2 & 7] = 0; + REG_D[(word2 >> 12) & 7] = 0x80000000; + + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + if(GET_MSB_32(dividend_hi)) + { + dividend_neg = 1; + dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); + dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); + } + if(GET_MSB_32(divisor)) + { + divisor_neg = 1; + divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); + + } + } + + /* if the upper long is greater than the divisor, we're overflowing. */ + if(dividend_hi >= divisor) + { + FLAG_V = VFLAG_SET; + return; + } + + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + remainder = (remainder << 1) + ((dividend_hi >> i) & 1); + if(remainder >= divisor) + { + remainder -= divisor; + quotient++; + } + } + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + overflow = GET_MSB_32(remainder); + remainder = (remainder << 1) + ((dividend_lo >> i) & 1); + if(remainder >= divisor || overflow) + { + remainder -= divisor; + quotient++; + } + } + + if(BIT_B(word2)) /* signed */ + { + if(quotient > 0x7fffffff) + { + FLAG_V = VFLAG_SET; + return; + } + if(dividend_neg) + { + remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + if(divisor_neg) + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + + /* long / long: long quotient, maybe long remainder */ + if(BIT_B(word2)) /* signed */ + { + /* Special case in divide */ + if(dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + REG_D[(word2 >> 12) & 7] = 0x80000000; + REG_D[word2 & 7] = 0; + return; + } + REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); + } + else + { + REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); + } + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_divl_32_pd(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 divisor = OPER_AY_PD_32(); + uint64 dividend = 0; + uint64 quotient = 0; + uint64 remainder = 0; + + if(divisor != 0) + { + if(BIT_A(word2)) /* 64 bit */ + { + dividend = REG_D[word2 & 7]; + dividend <<= 32; + dividend |= REG_D[(word2 >> 12) & 7]; + + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); + if((sint64)quotient != (sint64)((sint32)quotient)) + { + FLAG_V = VFLAG_SET; + return; + } + } + else /* unsigned */ + { + quotient = dividend / divisor; + if(quotient > 0xffffffff) + { + FLAG_V = VFLAG_SET; + return; + } + remainder = dividend % divisor; + } + } + else /* 32 bit */ + { + dividend = REG_D[(word2 >> 12) & 7]; + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); + } + else /* unsigned */ + { + quotient = dividend / divisor; + remainder = dividend % divisor; + } + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint divisor = OPER_AY_PD_32(); + uint dividend_hi = REG_D[word2 & 7]; + uint dividend_lo = REG_D[(word2 >> 12) & 7]; + uint quotient = 0; + uint remainder = 0; + uint dividend_neg = 0; + uint divisor_neg = 0; + sint i; + uint overflow; + + if(divisor != 0) + { + /* quad / long : long quotient, long remainder */ + if(BIT_A(word2)) + { + if(BIT_B(word2)) /* signed */ + { + /* special case in signed divide */ + if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + REG_D[word2 & 7] = 0; + REG_D[(word2 >> 12) & 7] = 0x80000000; + + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + if(GET_MSB_32(dividend_hi)) + { + dividend_neg = 1; + dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); + dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); + } + if(GET_MSB_32(divisor)) + { + divisor_neg = 1; + divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); + + } + } + + /* if the upper long is greater than the divisor, we're overflowing. */ + if(dividend_hi >= divisor) + { + FLAG_V = VFLAG_SET; + return; + } + + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + remainder = (remainder << 1) + ((dividend_hi >> i) & 1); + if(remainder >= divisor) + { + remainder -= divisor; + quotient++; + } + } + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + overflow = GET_MSB_32(remainder); + remainder = (remainder << 1) + ((dividend_lo >> i) & 1); + if(remainder >= divisor || overflow) + { + remainder -= divisor; + quotient++; + } + } + + if(BIT_B(word2)) /* signed */ + { + if(quotient > 0x7fffffff) + { + FLAG_V = VFLAG_SET; + return; + } + if(dividend_neg) + { + remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + if(divisor_neg) + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + + /* long / long: long quotient, maybe long remainder */ + if(BIT_B(word2)) /* signed */ + { + /* Special case in divide */ + if(dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + REG_D[(word2 >> 12) & 7] = 0x80000000; + REG_D[word2 & 7] = 0; + return; + } + REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); + } + else + { + REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); + } + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_divl_32_di(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 divisor = OPER_AY_DI_32(); + uint64 dividend = 0; + uint64 quotient = 0; + uint64 remainder = 0; + + if(divisor != 0) + { + if(BIT_A(word2)) /* 64 bit */ + { + dividend = REG_D[word2 & 7]; + dividend <<= 32; + dividend |= REG_D[(word2 >> 12) & 7]; + + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); + if((sint64)quotient != (sint64)((sint32)quotient)) + { + FLAG_V = VFLAG_SET; + return; + } + } + else /* unsigned */ + { + quotient = dividend / divisor; + if(quotient > 0xffffffff) + { + FLAG_V = VFLAG_SET; + return; + } + remainder = dividend % divisor; + } + } + else /* 32 bit */ + { + dividend = REG_D[(word2 >> 12) & 7]; + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); + } + else /* unsigned */ + { + quotient = dividend / divisor; + remainder = dividend % divisor; + } + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint divisor = OPER_AY_DI_32(); + uint dividend_hi = REG_D[word2 & 7]; + uint dividend_lo = REG_D[(word2 >> 12) & 7]; + uint quotient = 0; + uint remainder = 0; + uint dividend_neg = 0; + uint divisor_neg = 0; + sint i; + uint overflow; + + if(divisor != 0) + { + /* quad / long : long quotient, long remainder */ + if(BIT_A(word2)) + { + if(BIT_B(word2)) /* signed */ + { + /* special case in signed divide */ + if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + REG_D[word2 & 7] = 0; + REG_D[(word2 >> 12) & 7] = 0x80000000; + + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + if(GET_MSB_32(dividend_hi)) + { + dividend_neg = 1; + dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); + dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); + } + if(GET_MSB_32(divisor)) + { + divisor_neg = 1; + divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); + + } + } + + /* if the upper long is greater than the divisor, we're overflowing. */ + if(dividend_hi >= divisor) + { + FLAG_V = VFLAG_SET; + return; + } + + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + remainder = (remainder << 1) + ((dividend_hi >> i) & 1); + if(remainder >= divisor) + { + remainder -= divisor; + quotient++; + } + } + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + overflow = GET_MSB_32(remainder); + remainder = (remainder << 1) + ((dividend_lo >> i) & 1); + if(remainder >= divisor || overflow) + { + remainder -= divisor; + quotient++; + } + } + + if(BIT_B(word2)) /* signed */ + { + if(quotient > 0x7fffffff) + { + FLAG_V = VFLAG_SET; + return; + } + if(dividend_neg) + { + remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + if(divisor_neg) + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + + /* long / long: long quotient, maybe long remainder */ + if(BIT_B(word2)) /* signed */ + { + /* Special case in divide */ + if(dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + REG_D[(word2 >> 12) & 7] = 0x80000000; + REG_D[word2 & 7] = 0; + return; + } + REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); + } + else + { + REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); + } + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_divl_32_ix(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 divisor = OPER_AY_IX_32(); + uint64 dividend = 0; + uint64 quotient = 0; + uint64 remainder = 0; + + if(divisor != 0) + { + if(BIT_A(word2)) /* 64 bit */ + { + dividend = REG_D[word2 & 7]; + dividend <<= 32; + dividend |= REG_D[(word2 >> 12) & 7]; + + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); + if((sint64)quotient != (sint64)((sint32)quotient)) + { + FLAG_V = VFLAG_SET; + return; + } + } + else /* unsigned */ + { + quotient = dividend / divisor; + if(quotient > 0xffffffff) + { + FLAG_V = VFLAG_SET; + return; + } + remainder = dividend % divisor; + } + } + else /* 32 bit */ + { + dividend = REG_D[(word2 >> 12) & 7]; + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); + } + else /* unsigned */ + { + quotient = dividend / divisor; + remainder = dividend % divisor; + } + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint divisor = OPER_AY_IX_32(); + uint dividend_hi = REG_D[word2 & 7]; + uint dividend_lo = REG_D[(word2 >> 12) & 7]; + uint quotient = 0; + uint remainder = 0; + uint dividend_neg = 0; + uint divisor_neg = 0; + sint i; + uint overflow; + + if(divisor != 0) + { + /* quad / long : long quotient, long remainder */ + if(BIT_A(word2)) + { + if(BIT_B(word2)) /* signed */ + { + /* special case in signed divide */ + if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + REG_D[word2 & 7] = 0; + REG_D[(word2 >> 12) & 7] = 0x80000000; + + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + if(GET_MSB_32(dividend_hi)) + { + dividend_neg = 1; + dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); + dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); + } + if(GET_MSB_32(divisor)) + { + divisor_neg = 1; + divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); + + } + } + + /* if the upper long is greater than the divisor, we're overflowing. */ + if(dividend_hi >= divisor) + { + FLAG_V = VFLAG_SET; + return; + } + + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + remainder = (remainder << 1) + ((dividend_hi >> i) & 1); + if(remainder >= divisor) + { + remainder -= divisor; + quotient++; + } + } + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + overflow = GET_MSB_32(remainder); + remainder = (remainder << 1) + ((dividend_lo >> i) & 1); + if(remainder >= divisor || overflow) + { + remainder -= divisor; + quotient++; + } + } + + if(BIT_B(word2)) /* signed */ + { + if(quotient > 0x7fffffff) + { + FLAG_V = VFLAG_SET; + return; + } + if(dividend_neg) + { + remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + if(divisor_neg) + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + + /* long / long: long quotient, maybe long remainder */ + if(BIT_B(word2)) /* signed */ + { + /* Special case in divide */ + if(dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + REG_D[(word2 >> 12) & 7] = 0x80000000; + REG_D[word2 & 7] = 0; + return; + } + REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); + } + else + { + REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); + } + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_divl_32_aw(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 divisor = OPER_AW_32(); + uint64 dividend = 0; + uint64 quotient = 0; + uint64 remainder = 0; + + if(divisor != 0) + { + if(BIT_A(word2)) /* 64 bit */ + { + dividend = REG_D[word2 & 7]; + dividend <<= 32; + dividend |= REG_D[(word2 >> 12) & 7]; + + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); + if((sint64)quotient != (sint64)((sint32)quotient)) + { + FLAG_V = VFLAG_SET; + return; + } + } + else /* unsigned */ + { + quotient = dividend / divisor; + if(quotient > 0xffffffff) + { + FLAG_V = VFLAG_SET; + return; + } + remainder = dividend % divisor; + } + } + else /* 32 bit */ + { + dividend = REG_D[(word2 >> 12) & 7]; + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); + } + else /* unsigned */ + { + quotient = dividend / divisor; + remainder = dividend % divisor; + } + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint divisor = OPER_AW_32(); + uint dividend_hi = REG_D[word2 & 7]; + uint dividend_lo = REG_D[(word2 >> 12) & 7]; + uint quotient = 0; + uint remainder = 0; + uint dividend_neg = 0; + uint divisor_neg = 0; + sint i; + uint overflow; + + if(divisor != 0) + { + /* quad / long : long quotient, long remainder */ + if(BIT_A(word2)) + { + if(BIT_B(word2)) /* signed */ + { + /* special case in signed divide */ + if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + REG_D[word2 & 7] = 0; + REG_D[(word2 >> 12) & 7] = 0x80000000; + + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + if(GET_MSB_32(dividend_hi)) + { + dividend_neg = 1; + dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); + dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); + } + if(GET_MSB_32(divisor)) + { + divisor_neg = 1; + divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); + + } + } + + /* if the upper long is greater than the divisor, we're overflowing. */ + if(dividend_hi >= divisor) + { + FLAG_V = VFLAG_SET; + return; + } + + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + remainder = (remainder << 1) + ((dividend_hi >> i) & 1); + if(remainder >= divisor) + { + remainder -= divisor; + quotient++; + } + } + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + overflow = GET_MSB_32(remainder); + remainder = (remainder << 1) + ((dividend_lo >> i) & 1); + if(remainder >= divisor || overflow) + { + remainder -= divisor; + quotient++; + } + } + + if(BIT_B(word2)) /* signed */ + { + if(quotient > 0x7fffffff) + { + FLAG_V = VFLAG_SET; + return; + } + if(dividend_neg) + { + remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + if(divisor_neg) + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + + /* long / long: long quotient, maybe long remainder */ + if(BIT_B(word2)) /* signed */ + { + /* Special case in divide */ + if(dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + REG_D[(word2 >> 12) & 7] = 0x80000000; + REG_D[word2 & 7] = 0; + return; + } + REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); + } + else + { + REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); + } + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_divl_32_al(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 divisor = OPER_AL_32(); + uint64 dividend = 0; + uint64 quotient = 0; + uint64 remainder = 0; + + if(divisor != 0) + { + if(BIT_A(word2)) /* 64 bit */ + { + dividend = REG_D[word2 & 7]; + dividend <<= 32; + dividend |= REG_D[(word2 >> 12) & 7]; + + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); + if((sint64)quotient != (sint64)((sint32)quotient)) + { + FLAG_V = VFLAG_SET; + return; + } + } + else /* unsigned */ + { + quotient = dividend / divisor; + if(quotient > 0xffffffff) + { + FLAG_V = VFLAG_SET; + return; + } + remainder = dividend % divisor; + } + } + else /* 32 bit */ + { + dividend = REG_D[(word2 >> 12) & 7]; + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); + } + else /* unsigned */ + { + quotient = dividend / divisor; + remainder = dividend % divisor; + } + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint divisor = OPER_AL_32(); + uint dividend_hi = REG_D[word2 & 7]; + uint dividend_lo = REG_D[(word2 >> 12) & 7]; + uint quotient = 0; + uint remainder = 0; + uint dividend_neg = 0; + uint divisor_neg = 0; + sint i; + uint overflow; + + if(divisor != 0) + { + /* quad / long : long quotient, long remainder */ + if(BIT_A(word2)) + { + if(BIT_B(word2)) /* signed */ + { + /* special case in signed divide */ + if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + REG_D[word2 & 7] = 0; + REG_D[(word2 >> 12) & 7] = 0x80000000; + + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + if(GET_MSB_32(dividend_hi)) + { + dividend_neg = 1; + dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); + dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); + } + if(GET_MSB_32(divisor)) + { + divisor_neg = 1; + divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); + + } + } + + /* if the upper long is greater than the divisor, we're overflowing. */ + if(dividend_hi >= divisor) + { + FLAG_V = VFLAG_SET; + return; + } + + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + remainder = (remainder << 1) + ((dividend_hi >> i) & 1); + if(remainder >= divisor) + { + remainder -= divisor; + quotient++; + } + } + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + overflow = GET_MSB_32(remainder); + remainder = (remainder << 1) + ((dividend_lo >> i) & 1); + if(remainder >= divisor || overflow) + { + remainder -= divisor; + quotient++; + } + } + + if(BIT_B(word2)) /* signed */ + { + if(quotient > 0x7fffffff) + { + FLAG_V = VFLAG_SET; + return; + } + if(dividend_neg) + { + remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + if(divisor_neg) + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + + /* long / long: long quotient, maybe long remainder */ + if(BIT_B(word2)) /* signed */ + { + /* Special case in divide */ + if(dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + REG_D[(word2 >> 12) & 7] = 0x80000000; + REG_D[word2 & 7] = 0; + return; + } + REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); + } + else + { + REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); + } + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_divl_32_pcdi(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 divisor = OPER_PCDI_32(); + uint64 dividend = 0; + uint64 quotient = 0; + uint64 remainder = 0; + + if(divisor != 0) + { + if(BIT_A(word2)) /* 64 bit */ + { + dividend = REG_D[word2 & 7]; + dividend <<= 32; + dividend |= REG_D[(word2 >> 12) & 7]; + + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); + if((sint64)quotient != (sint64)((sint32)quotient)) + { + FLAG_V = VFLAG_SET; + return; + } + } + else /* unsigned */ + { + quotient = dividend / divisor; + if(quotient > 0xffffffff) + { + FLAG_V = VFLAG_SET; + return; + } + remainder = dividend % divisor; + } + } + else /* 32 bit */ + { + dividend = REG_D[(word2 >> 12) & 7]; + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); + } + else /* unsigned */ + { + quotient = dividend / divisor; + remainder = dividend % divisor; + } + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint divisor = OPER_PCDI_32(); + uint dividend_hi = REG_D[word2 & 7]; + uint dividend_lo = REG_D[(word2 >> 12) & 7]; + uint quotient = 0; + uint remainder = 0; + uint dividend_neg = 0; + uint divisor_neg = 0; + sint i; + uint overflow; + + if(divisor != 0) + { + /* quad / long : long quotient, long remainder */ + if(BIT_A(word2)) + { + if(BIT_B(word2)) /* signed */ + { + /* special case in signed divide */ + if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + REG_D[word2 & 7] = 0; + REG_D[(word2 >> 12) & 7] = 0x80000000; + + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + if(GET_MSB_32(dividend_hi)) + { + dividend_neg = 1; + dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); + dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); + } + if(GET_MSB_32(divisor)) + { + divisor_neg = 1; + divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); + + } + } + + /* if the upper long is greater than the divisor, we're overflowing. */ + if(dividend_hi >= divisor) + { + FLAG_V = VFLAG_SET; + return; + } + + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + remainder = (remainder << 1) + ((dividend_hi >> i) & 1); + if(remainder >= divisor) + { + remainder -= divisor; + quotient++; + } + } + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + overflow = GET_MSB_32(remainder); + remainder = (remainder << 1) + ((dividend_lo >> i) & 1); + if(remainder >= divisor || overflow) + { + remainder -= divisor; + quotient++; + } + } + + if(BIT_B(word2)) /* signed */ + { + if(quotient > 0x7fffffff) + { + FLAG_V = VFLAG_SET; + return; + } + if(dividend_neg) + { + remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + if(divisor_neg) + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + + /* long / long: long quotient, maybe long remainder */ + if(BIT_B(word2)) /* signed */ + { + /* Special case in divide */ + if(dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + REG_D[(word2 >> 12) & 7] = 0x80000000; + REG_D[word2 & 7] = 0; + return; + } + REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); + } + else + { + REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); + } + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_divl_32_pcix(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 divisor = OPER_PCIX_32(); + uint64 dividend = 0; + uint64 quotient = 0; + uint64 remainder = 0; + + if(divisor != 0) + { + if(BIT_A(word2)) /* 64 bit */ + { + dividend = REG_D[word2 & 7]; + dividend <<= 32; + dividend |= REG_D[(word2 >> 12) & 7]; + + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); + if((sint64)quotient != (sint64)((sint32)quotient)) + { + FLAG_V = VFLAG_SET; + return; + } + } + else /* unsigned */ + { + quotient = dividend / divisor; + if(quotient > 0xffffffff) + { + FLAG_V = VFLAG_SET; + return; + } + remainder = dividend % divisor; + } + } + else /* 32 bit */ + { + dividend = REG_D[(word2 >> 12) & 7]; + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); + } + else /* unsigned */ + { + quotient = dividend / divisor; + remainder = dividend % divisor; + } + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint divisor = OPER_PCIX_32(); + uint dividend_hi = REG_D[word2 & 7]; + uint dividend_lo = REG_D[(word2 >> 12) & 7]; + uint quotient = 0; + uint remainder = 0; + uint dividend_neg = 0; + uint divisor_neg = 0; + sint i; + uint overflow; + + if(divisor != 0) + { + /* quad / long : long quotient, long remainder */ + if(BIT_A(word2)) + { + if(BIT_B(word2)) /* signed */ + { + /* special case in signed divide */ + if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + REG_D[word2 & 7] = 0; + REG_D[(word2 >> 12) & 7] = 0x80000000; + + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + if(GET_MSB_32(dividend_hi)) + { + dividend_neg = 1; + dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); + dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); + } + if(GET_MSB_32(divisor)) + { + divisor_neg = 1; + divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); + + } + } + + /* if the upper long is greater than the divisor, we're overflowing. */ + if(dividend_hi >= divisor) + { + FLAG_V = VFLAG_SET; + return; + } + + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + remainder = (remainder << 1) + ((dividend_hi >> i) & 1); + if(remainder >= divisor) + { + remainder -= divisor; + quotient++; + } + } + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + overflow = GET_MSB_32(remainder); + remainder = (remainder << 1) + ((dividend_lo >> i) & 1); + if(remainder >= divisor || overflow) + { + remainder -= divisor; + quotient++; + } + } + + if(BIT_B(word2)) /* signed */ + { + if(quotient > 0x7fffffff) + { + FLAG_V = VFLAG_SET; + return; + } + if(dividend_neg) + { + remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + if(divisor_neg) + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + + /* long / long: long quotient, maybe long remainder */ + if(BIT_B(word2)) /* signed */ + { + /* Special case in divide */ + if(dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + REG_D[(word2 >> 12) & 7] = 0x80000000; + REG_D[word2 & 7] = 0; + return; + } + REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); + } + else + { + REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); + } + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_divl_32_i(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 divisor = OPER_I_32(); + uint64 dividend = 0; + uint64 quotient = 0; + uint64 remainder = 0; + + if(divisor != 0) + { + if(BIT_A(word2)) /* 64 bit */ + { + dividend = REG_D[word2 & 7]; + dividend <<= 32; + dividend |= REG_D[(word2 >> 12) & 7]; + + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)dividend / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)dividend % (sint64)((sint32)divisor)); + if((sint64)quotient != (sint64)((sint32)quotient)) + { + FLAG_V = VFLAG_SET; + return; + } + } + else /* unsigned */ + { + quotient = dividend / divisor; + if(quotient > 0xffffffff) + { + FLAG_V = VFLAG_SET; + return; + } + remainder = dividend % divisor; + } + } + else /* 32 bit */ + { + dividend = REG_D[(word2 >> 12) & 7]; + if(BIT_B(word2)) /* signed */ + { + quotient = (uint64)((sint64)((sint32)dividend) / (sint64)((sint32)divisor)); + remainder = (uint64)((sint64)((sint32)dividend) % (sint64)((sint32)divisor)); + } + else /* unsigned */ + { + quotient = dividend / divisor; + remainder = dividend % divisor; + } + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint divisor = OPER_I_32(); + uint dividend_hi = REG_D[word2 & 7]; + uint dividend_lo = REG_D[(word2 >> 12) & 7]; + uint quotient = 0; + uint remainder = 0; + uint dividend_neg = 0; + uint divisor_neg = 0; + sint i; + uint overflow; + + if(divisor != 0) + { + /* quad / long : long quotient, long remainder */ + if(BIT_A(word2)) + { + if(BIT_B(word2)) /* signed */ + { + /* special case in signed divide */ + if(dividend_hi == 0 && dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + REG_D[word2 & 7] = 0; + REG_D[(word2 >> 12) & 7] = 0x80000000; + + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + if(GET_MSB_32(dividend_hi)) + { + dividend_neg = 1; + dividend_hi = (uint)MASK_OUT_ABOVE_32((-(sint)dividend_hi) - (dividend_lo != 0)); + dividend_lo = (uint)MASK_OUT_ABOVE_32(-(sint)dividend_lo); + } + if(GET_MSB_32(divisor)) + { + divisor_neg = 1; + divisor = (uint)MASK_OUT_ABOVE_32(-(sint)divisor); + + } + } + + /* if the upper long is greater than the divisor, we're overflowing. */ + if(dividend_hi >= divisor) + { + FLAG_V = VFLAG_SET; + return; + } + + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + remainder = (remainder << 1) + ((dividend_hi >> i) & 1); + if(remainder >= divisor) + { + remainder -= divisor; + quotient++; + } + } + for(i = 31; i >= 0; i--) + { + quotient <<= 1; + overflow = GET_MSB_32(remainder); + remainder = (remainder << 1) + ((dividend_lo >> i) & 1); + if(remainder >= divisor || overflow) + { + remainder -= divisor; + quotient++; + } + } + + if(BIT_B(word2)) /* signed */ + { + if(quotient > 0x7fffffff) + { + FLAG_V = VFLAG_SET; + return; + } + if(dividend_neg) + { + remainder = (uint)MASK_OUT_ABOVE_32(-(sint)remainder); + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + if(divisor_neg) + quotient = (uint)MASK_OUT_ABOVE_32(-(sint)quotient); + } + + REG_D[word2 & 7] = remainder; + REG_D[(word2 >> 12) & 7] = quotient; + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + + /* long / long: long quotient, maybe long remainder */ + if(BIT_B(word2)) /* signed */ + { + /* Special case in divide */ + if(dividend_lo == 0x80000000 && divisor == 0xffffffff) + { + FLAG_N = NFLAG_SET; + FLAG_Z = ZFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + REG_D[(word2 >> 12) & 7] = 0x80000000; + REG_D[word2 & 7] = 0; + return; + } + REG_D[word2 & 7] = MAKE_INT_32(dividend_lo) % MAKE_INT_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MAKE_INT_32(dividend_lo) / MAKE_INT_32(divisor); + } + else + { + REG_D[word2 & 7] = MASK_OUT_ABOVE_32(dividend_lo) % MASK_OUT_ABOVE_32(divisor); + quotient = REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(dividend_lo) / MASK_OUT_ABOVE_32(divisor); + } + + FLAG_N = NFLAG_32(quotient); + FLAG_Z = quotient; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_trap(EXCEPTION_ZERO_DIVIDE); + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_eor_8_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY ^= MASK_OUT_ABOVE_8(DX)); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_8_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint res = MASK_OUT_ABOVE_8(DX ^ m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_8_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint res = MASK_OUT_ABOVE_8(DX ^ m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_8_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint res = MASK_OUT_ABOVE_8(DX ^ m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_8_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint res = MASK_OUT_ABOVE_8(DX ^ m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_8_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint res = MASK_OUT_ABOVE_8(DX ^ m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_8_di(void) +{ + uint ea = EA_AY_DI_8(); + uint res = MASK_OUT_ABOVE_8(DX ^ m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_8_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint res = MASK_OUT_ABOVE_8(DX ^ m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_8_aw(void) +{ + uint ea = EA_AW_8(); + uint res = MASK_OUT_ABOVE_8(DX ^ m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_8_al(void) +{ + uint ea = EA_AL_8(); + uint res = MASK_OUT_ABOVE_8(DX ^ m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_16_d(void) +{ + uint res = MASK_OUT_ABOVE_16(DY ^= MASK_OUT_ABOVE_16(DX)); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_16_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint res = MASK_OUT_ABOVE_16(DX ^ m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_16_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint res = MASK_OUT_ABOVE_16(DX ^ m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_16_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint res = MASK_OUT_ABOVE_16(DX ^ m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_16_di(void) +{ + uint ea = EA_AY_DI_16(); + uint res = MASK_OUT_ABOVE_16(DX ^ m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_16_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint res = MASK_OUT_ABOVE_16(DX ^ m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_16_aw(void) +{ + uint ea = EA_AW_16(); + uint res = MASK_OUT_ABOVE_16(DX ^ m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_16_al(void) +{ + uint ea = EA_AL_16(); + uint res = MASK_OUT_ABOVE_16(DX ^ m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_32_d(void) +{ + uint res = DY ^= DX; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_32_ai(void) +{ + uint ea = EA_AY_AI_32(); + uint res = DX ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_32_pi(void) +{ + uint ea = EA_AY_PI_32(); + uint res = DX ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_32_pd(void) +{ + uint ea = EA_AY_PD_32(); + uint res = DX ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_32_di(void) +{ + uint ea = EA_AY_DI_32(); + uint res = DX ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_32_ix(void) +{ + uint ea = EA_AY_IX_32(); + uint res = DX ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_32_aw(void) +{ + uint ea = EA_AW_32(); + uint res = DX ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eor_32_al(void) +{ + uint ea = EA_AL_32(); + uint res = DX ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_8_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY ^= OPER_I_8()); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_8_ai(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_AI_8(); + uint res = src ^ m68ki_read_8(ea); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_8_pi(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_PI_8(); + uint res = src ^ m68ki_read_8(ea); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_8_pi7(void) +{ + uint src = OPER_I_8(); + uint ea = EA_A7_PI_8(); + uint res = src ^ m68ki_read_8(ea); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_8_pd(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_PD_8(); + uint res = src ^ m68ki_read_8(ea); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_8_pd7(void) +{ + uint src = OPER_I_8(); + uint ea = EA_A7_PD_8(); + uint res = src ^ m68ki_read_8(ea); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_8_di(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_DI_8(); + uint res = src ^ m68ki_read_8(ea); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_8_ix(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_IX_8(); + uint res = src ^ m68ki_read_8(ea); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_8_aw(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AW_8(); + uint res = src ^ m68ki_read_8(ea); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_8_al(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AL_8(); + uint res = src ^ m68ki_read_8(ea); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_16_d(void) +{ + uint res = MASK_OUT_ABOVE_16(DY ^= OPER_I_16()); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_16_ai(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_AI_16(); + uint res = src ^ m68ki_read_16(ea); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_16_pi(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_PI_16(); + uint res = src ^ m68ki_read_16(ea); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_16_pd(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_PD_16(); + uint res = src ^ m68ki_read_16(ea); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_16_di(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_DI_16(); + uint res = src ^ m68ki_read_16(ea); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_16_ix(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_IX_16(); + uint res = src ^ m68ki_read_16(ea); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_16_aw(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AW_16(); + uint res = src ^ m68ki_read_16(ea); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_16_al(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AL_16(); + uint res = src ^ m68ki_read_16(ea); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_32_d(void) +{ + uint res = DY ^= OPER_I_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_32_ai(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_AI_32(); + uint res = src ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_32_pi(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_PI_32(); + uint res = src ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_32_pd(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_PD_32(); + uint res = src ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_32_di(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_DI_32(); + uint res = src ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_32_ix(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_IX_32(); + uint res = src ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_32_aw(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AW_32(); + uint res = src ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_32_al(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AL_32(); + uint res = src ^ m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_eori_16_toc(void) +{ + m68ki_set_ccr(m68ki_get_ccr() ^ OPER_I_16()); +} + + +void m68k_op_eori_16_tos(void) +{ + if(FLAG_S) + { + uint src = OPER_I_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(m68ki_get_sr() ^ src); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_exg_32_dd(void) +{ + uint* reg_a = &DX; + uint* reg_b = &DY; + uint tmp = *reg_a; + *reg_a = *reg_b; + *reg_b = tmp; +} + + +void m68k_op_exg_32_aa(void) +{ + uint* reg_a = &AX; + uint* reg_b = &AY; + uint tmp = *reg_a; + *reg_a = *reg_b; + *reg_b = tmp; +} + + +void m68k_op_exg_32_da(void) +{ + uint* reg_a = &DX; + uint* reg_b = &AY; + uint tmp = *reg_a; + *reg_a = *reg_b; + *reg_b = tmp; +} + + +void m68k_op_ext_16(void) +{ + uint* r_dst = &DY; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | MASK_OUT_ABOVE_8(*r_dst) | (GET_MSB_8(*r_dst) ? 0xff00 : 0); + + FLAG_N = NFLAG_16(*r_dst); + FLAG_Z = MASK_OUT_ABOVE_16(*r_dst); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_ext_32(void) +{ + uint* r_dst = &DY; + + *r_dst = MASK_OUT_ABOVE_16(*r_dst) | (GET_MSB_16(*r_dst) ? 0xffff0000 : 0); + + FLAG_N = NFLAG_32(*r_dst); + FLAG_Z = *r_dst; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_extb_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint* r_dst = &DY; + + *r_dst = MASK_OUT_ABOVE_8(*r_dst) | (GET_MSB_8(*r_dst) ? 0xffffff00 : 0); + + FLAG_N = NFLAG_32(*r_dst); + FLAG_Z = *r_dst; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_illegal(void) +{ + m68ki_exception_illegal(); +} + + +void m68k_op_jmp_32_ai(void) +{ + m68ki_jump(EA_AY_AI_32()); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(REG_PC == REG_PPC) + USE_ALL_CYCLES(); +} + + +void m68k_op_jmp_32_di(void) +{ + m68ki_jump(EA_AY_DI_32()); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(REG_PC == REG_PPC) + USE_ALL_CYCLES(); +} + + +void m68k_op_jmp_32_ix(void) +{ + m68ki_jump(EA_AY_IX_32()); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(REG_PC == REG_PPC) + USE_ALL_CYCLES(); +} + + +void m68k_op_jmp_32_aw(void) +{ + m68ki_jump(EA_AW_32()); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(REG_PC == REG_PPC) + USE_ALL_CYCLES(); +} + + +void m68k_op_jmp_32_al(void) +{ + m68ki_jump(EA_AL_32()); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(REG_PC == REG_PPC) + USE_ALL_CYCLES(); +} + + +void m68k_op_jmp_32_pcdi(void) +{ + m68ki_jump(EA_PCDI_32()); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(REG_PC == REG_PPC) + USE_ALL_CYCLES(); +} + + +void m68k_op_jmp_32_pcix(void) +{ + m68ki_jump(EA_PCIX_32()); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(REG_PC == REG_PPC) + USE_ALL_CYCLES(); +} + + +void m68k_op_jsr_32_ai(void) +{ + uint ea = EA_AY_AI_32(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_push_32(REG_PC); + m68ki_jump(ea); +} + + +void m68k_op_jsr_32_di(void) +{ + uint ea = EA_AY_DI_32(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_push_32(REG_PC); + m68ki_jump(ea); +} + + +void m68k_op_jsr_32_ix(void) +{ + uint ea = EA_AY_IX_32(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_push_32(REG_PC); + m68ki_jump(ea); +} + + +void m68k_op_jsr_32_aw(void) +{ + uint ea = EA_AW_32(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_push_32(REG_PC); + m68ki_jump(ea); +} + + +void m68k_op_jsr_32_al(void) +{ + uint ea = EA_AL_32(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_push_32(REG_PC); + m68ki_jump(ea); +} + + +void m68k_op_jsr_32_pcdi(void) +{ + uint ea = EA_PCDI_32(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_push_32(REG_PC); + m68ki_jump(ea); +} + + +void m68k_op_jsr_32_pcix(void) +{ + uint ea = EA_PCIX_32(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_push_32(REG_PC); + m68ki_jump(ea); +} + + +void m68k_op_lea_32_ai(void) +{ + AX = EA_AY_AI_32(); +} + + +void m68k_op_lea_32_di(void) +{ + AX = EA_AY_DI_32(); +} + + +void m68k_op_lea_32_ix(void) +{ + AX = EA_AY_IX_32(); +} + + +void m68k_op_lea_32_aw(void) +{ + AX = EA_AW_32(); +} + + +void m68k_op_lea_32_al(void) +{ + AX = EA_AL_32(); +} + + +void m68k_op_lea_32_pcdi(void) +{ + AX = EA_PCDI_32(); +} + + +void m68k_op_lea_32_pcix(void) +{ + AX = EA_PCIX_32(); +} + + +void m68k_op_link_16_a7(void) +{ + REG_A[7] -= 4; + m68ki_write_32(REG_A[7], REG_A[7]); + REG_A[7] = MASK_OUT_ABOVE_32(REG_A[7] + MAKE_INT_16(OPER_I_16())); +} + + +void m68k_op_link_16(void) +{ + uint* r_dst = &AY; + + m68ki_push_32(*r_dst); + *r_dst = REG_A[7]; + REG_A[7] = MASK_OUT_ABOVE_32(REG_A[7] + MAKE_INT_16(OPER_I_16())); +} + + +void m68k_op_link_32_a7(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + REG_A[7] -= 4; + m68ki_write_32(REG_A[7], REG_A[7]); + REG_A[7] = MASK_OUT_ABOVE_32(REG_A[7] + OPER_I_32()); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_link_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint* r_dst = &AY; + + m68ki_push_32(*r_dst); + *r_dst = REG_A[7]; + REG_A[7] = MASK_OUT_ABOVE_32(REG_A[7] + OPER_I_32()); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_lsr_8_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = src >> shift; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_CLEAR; + FLAG_Z = res; + FLAG_X = FLAG_C = src << (9-shift); + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsr_16_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_16(*r_dst); + uint res = src >> shift; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_CLEAR; + FLAG_Z = res; + FLAG_X = FLAG_C = src << (9-shift); + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsr_32_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = *r_dst; + uint res = src >> shift; + + *r_dst = res; + + FLAG_N = NFLAG_CLEAR; + FLAG_Z = res; + FLAG_X = FLAG_C = src << (9-shift); + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsr_8_r(void) +{ + uint* r_dst = &DY; + uint shift = DX & 0x3f; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = src >> shift; + + if(shift != 0) + { + USE_CYCLES(shift<> shift; + + if(shift != 0) + { + USE_CYCLES(shift<> (shift - 1))<<8; + FLAG_N = NFLAG_CLEAR; + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + *r_dst &= 0xffff0000; + FLAG_X = XFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_16(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsr_32_r(void) +{ + uint* r_dst = &DY; + uint shift = DX & 0x3f; + uint src = *r_dst; + uint res = src >> shift; + + if(shift != 0) + { + USE_CYCLES(shift<> (shift - 1))<<8; + FLAG_N = NFLAG_CLEAR; + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + *r_dst = 0; + FLAG_X = FLAG_C = (shift == 32 ? GET_MSB_32(src)>>23 : 0); + FLAG_N = NFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_32(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsr_16_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_CLEAR; + FLAG_Z = res; + FLAG_C = FLAG_X = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsr_16_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_CLEAR; + FLAG_Z = res; + FLAG_C = FLAG_X = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsr_16_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_CLEAR; + FLAG_Z = res; + FLAG_C = FLAG_X = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsr_16_di(void) +{ + uint ea = EA_AY_DI_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_CLEAR; + FLAG_Z = res; + FLAG_C = FLAG_X = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsr_16_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_CLEAR; + FLAG_Z = res; + FLAG_C = FLAG_X = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsr_16_aw(void) +{ + uint ea = EA_AW_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_CLEAR; + FLAG_Z = res; + FLAG_C = FLAG_X = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsr_16_al(void) +{ + uint ea = EA_AL_16(); + uint src = m68ki_read_16(ea); + uint res = src >> 1; + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_CLEAR; + FLAG_Z = res; + FLAG_C = FLAG_X = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsl_8_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = MASK_OUT_ABOVE_8(src << shift); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src << shift; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsl_16_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_16(*r_dst); + uint res = MASK_OUT_ABOVE_16(src << shift); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> (8-shift); + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsl_32_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = *r_dst; + uint res = MASK_OUT_ABOVE_32(src << shift); + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> (24-shift); + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsl_8_r(void) +{ + uint* r_dst = &DY; + uint shift = DX & 0x3f; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = MASK_OUT_ABOVE_8(src << shift); + + if(shift != 0) + { + USE_CYCLES(shift<> 8; + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + *r_dst &= 0xffff0000; + FLAG_X = XFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_16(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsl_32_r(void) +{ + uint* r_dst = &DY; + uint shift = DX & 0x3f; + uint src = *r_dst; + uint res = MASK_OUT_ABOVE_32(src << shift); + + if(shift != 0) + { + USE_CYCLES(shift<> (32 - shift)) << 8; + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + *r_dst = 0; + FLAG_X = FLAG_C = ((shift == 32 ? src & 1 : 0))<<8; + FLAG_N = NFLAG_CLEAR; + FLAG_Z = ZFLAG_SET; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_32(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsl_16_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsl_16_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsl_16_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsl_16_di(void) +{ + uint ea = EA_AY_DI_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsl_16_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsl_16_aw(void) +{ + uint ea = EA_AW_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_lsl_16_al(void) +{ + uint ea = EA_AL_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(src << 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_X = FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_move_8_d_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_d_ai(void) +{ + uint res = OPER_AY_AI_8(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_d_pi(void) +{ + uint res = OPER_AY_PI_8(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_d_pi7(void) +{ + uint res = OPER_A7_PI_8(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_d_pd(void) +{ + uint res = OPER_AY_PD_8(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_d_pd7(void) +{ + uint res = OPER_A7_PD_8(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_d_di(void) +{ + uint res = OPER_AY_DI_8(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_d_ix(void) +{ + uint res = OPER_AY_IX_8(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_d_aw(void) +{ + uint res = OPER_AW_8(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_d_al(void) +{ + uint res = OPER_AL_8(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_d_pcdi(void) +{ + uint res = OPER_PCDI_8(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_d_pcix(void) +{ + uint res = OPER_PCIX_8(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_d_i(void) +{ + uint res = OPER_I_8(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_ai(void) +{ + uint res = OPER_AY_AI_8(); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_pi(void) +{ + uint res = OPER_AY_PI_8(); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_pi7(void) +{ + uint res = OPER_A7_PI_8(); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_pd(void) +{ + uint res = OPER_AY_PD_8(); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_pd7(void) +{ + uint res = OPER_A7_PD_8(); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_di(void) +{ + uint res = OPER_AY_DI_8(); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_ix(void) +{ + uint res = OPER_AY_IX_8(); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_aw(void) +{ + uint res = OPER_AW_8(); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_al(void) +{ + uint res = OPER_AL_8(); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_pcdi(void) +{ + uint res = OPER_PCDI_8(); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_pcix(void) +{ + uint res = OPER_PCIX_8(); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ai_i(void) +{ + uint res = OPER_I_8(); + uint ea = EA_AX_AI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_ai(void) +{ + uint res = OPER_AY_AI_8(); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_pi(void) +{ + uint res = OPER_AY_PI_8(); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_pi7(void) +{ + uint res = OPER_A7_PI_8(); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_pd(void) +{ + uint res = OPER_AY_PD_8(); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_pd7(void) +{ + uint res = OPER_A7_PD_8(); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_di(void) +{ + uint res = OPER_AY_DI_8(); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_ix(void) +{ + uint res = OPER_AY_IX_8(); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_aw(void) +{ + uint res = OPER_AW_8(); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_al(void) +{ + uint res = OPER_AL_8(); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_pcdi(void) +{ + uint res = OPER_PCDI_8(); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_pcix(void) +{ + uint res = OPER_PCIX_8(); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi7_i(void) +{ + uint res = OPER_I_8(); + uint ea = EA_A7_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_ai(void) +{ + uint res = OPER_AY_AI_8(); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_pi(void) +{ + uint res = OPER_AY_PI_8(); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_pi7(void) +{ + uint res = OPER_A7_PI_8(); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_pd(void) +{ + uint res = OPER_AY_PD_8(); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_pd7(void) +{ + uint res = OPER_A7_PD_8(); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_di(void) +{ + uint res = OPER_AY_DI_8(); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_ix(void) +{ + uint res = OPER_AY_IX_8(); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_aw(void) +{ + uint res = OPER_AW_8(); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_al(void) +{ + uint res = OPER_AL_8(); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_pcdi(void) +{ + uint res = OPER_PCDI_8(); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_pcix(void) +{ + uint res = OPER_PCIX_8(); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pi_i(void) +{ + uint res = OPER_I_8(); + uint ea = EA_AX_PI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_ai(void) +{ + uint res = OPER_AY_AI_8(); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_pi(void) +{ + uint res = OPER_AY_PI_8(); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_pi7(void) +{ + uint res = OPER_A7_PI_8(); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_pd(void) +{ + uint res = OPER_AY_PD_8(); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_pd7(void) +{ + uint res = OPER_A7_PD_8(); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_di(void) +{ + uint res = OPER_AY_DI_8(); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_ix(void) +{ + uint res = OPER_AY_IX_8(); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_aw(void) +{ + uint res = OPER_AW_8(); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_al(void) +{ + uint res = OPER_AL_8(); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_pcdi(void) +{ + uint res = OPER_PCDI_8(); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_pcix(void) +{ + uint res = OPER_PCIX_8(); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd7_i(void) +{ + uint res = OPER_I_8(); + uint ea = EA_A7_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_ai(void) +{ + uint res = OPER_AY_AI_8(); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_pi(void) +{ + uint res = OPER_AY_PI_8(); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_pi7(void) +{ + uint res = OPER_A7_PI_8(); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_pd(void) +{ + uint res = OPER_AY_PD_8(); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_pd7(void) +{ + uint res = OPER_A7_PD_8(); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_di(void) +{ + uint res = OPER_AY_DI_8(); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_ix(void) +{ + uint res = OPER_AY_IX_8(); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_aw(void) +{ + uint res = OPER_AW_8(); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_al(void) +{ + uint res = OPER_AL_8(); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_pcdi(void) +{ + uint res = OPER_PCDI_8(); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_pcix(void) +{ + uint res = OPER_PCIX_8(); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_pd_i(void) +{ + uint res = OPER_I_8(); + uint ea = EA_AX_PD_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_ai(void) +{ + uint res = OPER_AY_AI_8(); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_pi(void) +{ + uint res = OPER_AY_PI_8(); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_pi7(void) +{ + uint res = OPER_A7_PI_8(); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_pd(void) +{ + uint res = OPER_AY_PD_8(); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_pd7(void) +{ + uint res = OPER_A7_PD_8(); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_di(void) +{ + uint res = OPER_AY_DI_8(); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_ix(void) +{ + uint res = OPER_AY_IX_8(); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_aw(void) +{ + uint res = OPER_AW_8(); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_al(void) +{ + uint res = OPER_AL_8(); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_pcdi(void) +{ + uint res = OPER_PCDI_8(); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_pcix(void) +{ + uint res = OPER_PCIX_8(); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_di_i(void) +{ + uint res = OPER_I_8(); + uint ea = EA_AX_DI_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_ai(void) +{ + uint res = OPER_AY_AI_8(); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_pi(void) +{ + uint res = OPER_AY_PI_8(); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_pi7(void) +{ + uint res = OPER_A7_PI_8(); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_pd(void) +{ + uint res = OPER_AY_PD_8(); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_pd7(void) +{ + uint res = OPER_A7_PD_8(); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_di(void) +{ + uint res = OPER_AY_DI_8(); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_ix(void) +{ + uint res = OPER_AY_IX_8(); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_aw(void) +{ + uint res = OPER_AW_8(); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_al(void) +{ + uint res = OPER_AL_8(); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_pcdi(void) +{ + uint res = OPER_PCDI_8(); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_pcix(void) +{ + uint res = OPER_PCIX_8(); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_ix_i(void) +{ + uint res = OPER_I_8(); + uint ea = EA_AX_IX_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_ai(void) +{ + uint res = OPER_AY_AI_8(); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_pi(void) +{ + uint res = OPER_AY_PI_8(); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_pi7(void) +{ + uint res = OPER_A7_PI_8(); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_pd(void) +{ + uint res = OPER_AY_PD_8(); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_pd7(void) +{ + uint res = OPER_A7_PD_8(); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_di(void) +{ + uint res = OPER_AY_DI_8(); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_ix(void) +{ + uint res = OPER_AY_IX_8(); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_aw(void) +{ + uint res = OPER_AW_8(); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_al(void) +{ + uint res = OPER_AL_8(); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_pcdi(void) +{ + uint res = OPER_PCDI_8(); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_pcix(void) +{ + uint res = OPER_PCIX_8(); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_aw_i(void) +{ + uint res = OPER_I_8(); + uint ea = EA_AW_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_ai(void) +{ + uint res = OPER_AY_AI_8(); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_pi(void) +{ + uint res = OPER_AY_PI_8(); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_pi7(void) +{ + uint res = OPER_A7_PI_8(); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_pd(void) +{ + uint res = OPER_AY_PD_8(); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_pd7(void) +{ + uint res = OPER_A7_PD_8(); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_di(void) +{ + uint res = OPER_AY_DI_8(); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_ix(void) +{ + uint res = OPER_AY_IX_8(); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_aw(void) +{ + uint res = OPER_AW_8(); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_al(void) +{ + uint res = OPER_AL_8(); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_pcdi(void) +{ + uint res = OPER_PCDI_8(); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_pcix(void) +{ + uint res = OPER_PCIX_8(); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_8_al_i(void) +{ + uint res = OPER_I_8(); + uint ea = EA_AL_8(); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_d_d(void) +{ + uint res = MASK_OUT_ABOVE_16(DY); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_d_a(void) +{ + uint res = MASK_OUT_ABOVE_16(AY); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_d_ai(void) +{ + uint res = OPER_AY_AI_16(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_d_pi(void) +{ + uint res = OPER_AY_PI_16(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_d_pd(void) +{ + uint res = OPER_AY_PD_16(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_d_di(void) +{ + uint res = OPER_AY_DI_16(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_d_ix(void) +{ + uint res = OPER_AY_IX_16(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_d_aw(void) +{ + uint res = OPER_AW_16(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_d_al(void) +{ + uint res = OPER_AL_16(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_d_pcdi(void) +{ + uint res = OPER_PCDI_16(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_d_pcix(void) +{ + uint res = OPER_PCIX_16(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_d_i(void) +{ + uint res = OPER_I_16(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ai_d(void) +{ + uint res = MASK_OUT_ABOVE_16(DY); + uint ea = EA_AX_AI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ai_a(void) +{ + uint res = MASK_OUT_ABOVE_16(AY); + uint ea = EA_AX_AI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ai_ai(void) +{ + uint res = OPER_AY_AI_16(); + uint ea = EA_AX_AI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ai_pi(void) +{ + uint res = OPER_AY_PI_16(); + uint ea = EA_AX_AI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ai_pd(void) +{ + uint res = OPER_AY_PD_16(); + uint ea = EA_AX_AI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ai_di(void) +{ + uint res = OPER_AY_DI_16(); + uint ea = EA_AX_AI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ai_ix(void) +{ + uint res = OPER_AY_IX_16(); + uint ea = EA_AX_AI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ai_aw(void) +{ + uint res = OPER_AW_16(); + uint ea = EA_AX_AI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ai_al(void) +{ + uint res = OPER_AL_16(); + uint ea = EA_AX_AI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ai_pcdi(void) +{ + uint res = OPER_PCDI_16(); + uint ea = EA_AX_AI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ai_pcix(void) +{ + uint res = OPER_PCIX_16(); + uint ea = EA_AX_AI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ai_i(void) +{ + uint res = OPER_I_16(); + uint ea = EA_AX_AI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pi_d(void) +{ + uint res = MASK_OUT_ABOVE_16(DY); + uint ea = EA_AX_PI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pi_a(void) +{ + uint res = MASK_OUT_ABOVE_16(AY); + uint ea = EA_AX_PI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pi_ai(void) +{ + uint res = OPER_AY_AI_16(); + uint ea = EA_AX_PI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pi_pi(void) +{ + uint res = OPER_AY_PI_16(); + uint ea = EA_AX_PI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pi_pd(void) +{ + uint res = OPER_AY_PD_16(); + uint ea = EA_AX_PI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pi_di(void) +{ + uint res = OPER_AY_DI_16(); + uint ea = EA_AX_PI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pi_ix(void) +{ + uint res = OPER_AY_IX_16(); + uint ea = EA_AX_PI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pi_aw(void) +{ + uint res = OPER_AW_16(); + uint ea = EA_AX_PI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pi_al(void) +{ + uint res = OPER_AL_16(); + uint ea = EA_AX_PI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pi_pcdi(void) +{ + uint res = OPER_PCDI_16(); + uint ea = EA_AX_PI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pi_pcix(void) +{ + uint res = OPER_PCIX_16(); + uint ea = EA_AX_PI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pi_i(void) +{ + uint res = OPER_I_16(); + uint ea = EA_AX_PI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pd_d(void) +{ + uint res = MASK_OUT_ABOVE_16(DY); + uint ea = EA_AX_PD_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pd_a(void) +{ + uint res = MASK_OUT_ABOVE_16(AY); + uint ea = EA_AX_PD_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pd_ai(void) +{ + uint res = OPER_AY_AI_16(); + uint ea = EA_AX_PD_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pd_pi(void) +{ + uint res = OPER_AY_PI_16(); + uint ea = EA_AX_PD_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pd_pd(void) +{ + uint res = OPER_AY_PD_16(); + uint ea = EA_AX_PD_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pd_di(void) +{ + uint res = OPER_AY_DI_16(); + uint ea = EA_AX_PD_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pd_ix(void) +{ + uint res = OPER_AY_IX_16(); + uint ea = EA_AX_PD_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pd_aw(void) +{ + uint res = OPER_AW_16(); + uint ea = EA_AX_PD_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pd_al(void) +{ + uint res = OPER_AL_16(); + uint ea = EA_AX_PD_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pd_pcdi(void) +{ + uint res = OPER_PCDI_16(); + uint ea = EA_AX_PD_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pd_pcix(void) +{ + uint res = OPER_PCIX_16(); + uint ea = EA_AX_PD_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_pd_i(void) +{ + uint res = OPER_I_16(); + uint ea = EA_AX_PD_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_di_d(void) +{ + uint res = MASK_OUT_ABOVE_16(DY); + uint ea = EA_AX_DI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_di_a(void) +{ + uint res = MASK_OUT_ABOVE_16(AY); + uint ea = EA_AX_DI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_di_ai(void) +{ + uint res = OPER_AY_AI_16(); + uint ea = EA_AX_DI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_di_pi(void) +{ + uint res = OPER_AY_PI_16(); + uint ea = EA_AX_DI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_di_pd(void) +{ + uint res = OPER_AY_PD_16(); + uint ea = EA_AX_DI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_di_di(void) +{ + uint res = OPER_AY_DI_16(); + uint ea = EA_AX_DI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_di_ix(void) +{ + uint res = OPER_AY_IX_16(); + uint ea = EA_AX_DI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_di_aw(void) +{ + uint res = OPER_AW_16(); + uint ea = EA_AX_DI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_di_al(void) +{ + uint res = OPER_AL_16(); + uint ea = EA_AX_DI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_di_pcdi(void) +{ + uint res = OPER_PCDI_16(); + uint ea = EA_AX_DI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_di_pcix(void) +{ + uint res = OPER_PCIX_16(); + uint ea = EA_AX_DI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_di_i(void) +{ + uint res = OPER_I_16(); + uint ea = EA_AX_DI_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ix_d(void) +{ + uint res = MASK_OUT_ABOVE_16(DY); + uint ea = EA_AX_IX_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ix_a(void) +{ + uint res = MASK_OUT_ABOVE_16(AY); + uint ea = EA_AX_IX_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ix_ai(void) +{ + uint res = OPER_AY_AI_16(); + uint ea = EA_AX_IX_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ix_pi(void) +{ + uint res = OPER_AY_PI_16(); + uint ea = EA_AX_IX_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ix_pd(void) +{ + uint res = OPER_AY_PD_16(); + uint ea = EA_AX_IX_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ix_di(void) +{ + uint res = OPER_AY_DI_16(); + uint ea = EA_AX_IX_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ix_ix(void) +{ + uint res = OPER_AY_IX_16(); + uint ea = EA_AX_IX_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ix_aw(void) +{ + uint res = OPER_AW_16(); + uint ea = EA_AX_IX_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ix_al(void) +{ + uint res = OPER_AL_16(); + uint ea = EA_AX_IX_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ix_pcdi(void) +{ + uint res = OPER_PCDI_16(); + uint ea = EA_AX_IX_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ix_pcix(void) +{ + uint res = OPER_PCIX_16(); + uint ea = EA_AX_IX_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_ix_i(void) +{ + uint res = OPER_I_16(); + uint ea = EA_AX_IX_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_aw_d(void) +{ + uint res = MASK_OUT_ABOVE_16(DY); + uint ea = EA_AW_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_aw_a(void) +{ + uint res = MASK_OUT_ABOVE_16(AY); + uint ea = EA_AW_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_aw_ai(void) +{ + uint res = OPER_AY_AI_16(); + uint ea = EA_AW_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_aw_pi(void) +{ + uint res = OPER_AY_PI_16(); + uint ea = EA_AW_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_aw_pd(void) +{ + uint res = OPER_AY_PD_16(); + uint ea = EA_AW_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_aw_di(void) +{ + uint res = OPER_AY_DI_16(); + uint ea = EA_AW_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_aw_ix(void) +{ + uint res = OPER_AY_IX_16(); + uint ea = EA_AW_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_aw_aw(void) +{ + uint res = OPER_AW_16(); + uint ea = EA_AW_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_aw_al(void) +{ + uint res = OPER_AL_16(); + uint ea = EA_AW_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_aw_pcdi(void) +{ + uint res = OPER_PCDI_16(); + uint ea = EA_AW_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_aw_pcix(void) +{ + uint res = OPER_PCIX_16(); + uint ea = EA_AW_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_aw_i(void) +{ + uint res = OPER_I_16(); + uint ea = EA_AW_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_al_d(void) +{ + uint res = MASK_OUT_ABOVE_16(DY); + uint ea = EA_AL_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_al_a(void) +{ + uint res = MASK_OUT_ABOVE_16(AY); + uint ea = EA_AL_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_al_ai(void) +{ + uint res = OPER_AY_AI_16(); + uint ea = EA_AL_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_al_pi(void) +{ + uint res = OPER_AY_PI_16(); + uint ea = EA_AL_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_al_pd(void) +{ + uint res = OPER_AY_PD_16(); + uint ea = EA_AL_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_al_di(void) +{ + uint res = OPER_AY_DI_16(); + uint ea = EA_AL_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_al_ix(void) +{ + uint res = OPER_AY_IX_16(); + uint ea = EA_AL_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_al_aw(void) +{ + uint res = OPER_AW_16(); + uint ea = EA_AL_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_al_al(void) +{ + uint res = OPER_AL_16(); + uint ea = EA_AL_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_al_pcdi(void) +{ + uint res = OPER_PCDI_16(); + uint ea = EA_AL_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_al_pcix(void) +{ + uint res = OPER_PCIX_16(); + uint ea = EA_AL_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_16_al_i(void) +{ + uint res = OPER_I_16(); + uint ea = EA_AL_16(); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_d_d(void) +{ + uint res = DY; + uint* r_dst = &DX; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_d_a(void) +{ + uint res = AY; + uint* r_dst = &DX; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_d_ai(void) +{ + uint res = OPER_AY_AI_32(); + uint* r_dst = &DX; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_d_pi(void) +{ + uint res = OPER_AY_PI_32(); + uint* r_dst = &DX; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_d_pd(void) +{ + uint res = OPER_AY_PD_32(); + uint* r_dst = &DX; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_d_di(void) +{ + uint res = OPER_AY_DI_32(); + uint* r_dst = &DX; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_d_ix(void) +{ + uint res = OPER_AY_IX_32(); + uint* r_dst = &DX; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_d_aw(void) +{ + uint res = OPER_AW_32(); + uint* r_dst = &DX; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_d_al(void) +{ + uint res = OPER_AL_32(); + uint* r_dst = &DX; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_d_pcdi(void) +{ + uint res = OPER_PCDI_32(); + uint* r_dst = &DX; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_d_pcix(void) +{ + uint res = OPER_PCIX_32(); + uint* r_dst = &DX; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_d_i(void) +{ + uint res = OPER_I_32(); + uint* r_dst = &DX; + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ai_d(void) +{ + uint res = DY; + uint ea = EA_AX_AI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ai_a(void) +{ + uint res = AY; + uint ea = EA_AX_AI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ai_ai(void) +{ + uint res = OPER_AY_AI_32(); + uint ea = EA_AX_AI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ai_pi(void) +{ + uint res = OPER_AY_PI_32(); + uint ea = EA_AX_AI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ai_pd(void) +{ + uint res = OPER_AY_PD_32(); + uint ea = EA_AX_AI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ai_di(void) +{ + uint res = OPER_AY_DI_32(); + uint ea = EA_AX_AI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ai_ix(void) +{ + uint res = OPER_AY_IX_32(); + uint ea = EA_AX_AI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ai_aw(void) +{ + uint res = OPER_AW_32(); + uint ea = EA_AX_AI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ai_al(void) +{ + uint res = OPER_AL_32(); + uint ea = EA_AX_AI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ai_pcdi(void) +{ + uint res = OPER_PCDI_32(); + uint ea = EA_AX_AI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ai_pcix(void) +{ + uint res = OPER_PCIX_32(); + uint ea = EA_AX_AI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ai_i(void) +{ + uint res = OPER_I_32(); + uint ea = EA_AX_AI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pi_d(void) +{ + uint res = DY; + uint ea = EA_AX_PI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pi_a(void) +{ + uint res = AY; + uint ea = EA_AX_PI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pi_ai(void) +{ + uint res = OPER_AY_AI_32(); + uint ea = EA_AX_PI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pi_pi(void) +{ + uint res = OPER_AY_PI_32(); + uint ea = EA_AX_PI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pi_pd(void) +{ + uint res = OPER_AY_PD_32(); + uint ea = EA_AX_PI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pi_di(void) +{ + uint res = OPER_AY_DI_32(); + uint ea = EA_AX_PI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pi_ix(void) +{ + uint res = OPER_AY_IX_32(); + uint ea = EA_AX_PI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pi_aw(void) +{ + uint res = OPER_AW_32(); + uint ea = EA_AX_PI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pi_al(void) +{ + uint res = OPER_AL_32(); + uint ea = EA_AX_PI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pi_pcdi(void) +{ + uint res = OPER_PCDI_32(); + uint ea = EA_AX_PI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pi_pcix(void) +{ + uint res = OPER_PCIX_32(); + uint ea = EA_AX_PI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pi_i(void) +{ + uint res = OPER_I_32(); + uint ea = EA_AX_PI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pd_d(void) +{ + uint res = DY; + uint ea = EA_AX_PD_32(); + +#if GENESIS_HACKS + m68ki_write_16(ea+2, res & 0xFFFF ); + m68ki_write_16(ea, (res >> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, res); +#endif + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pd_a(void) +{ + uint res = AY; + uint ea = EA_AX_PD_32(); + +#if GENESIS_HACKS + m68ki_write_16(ea+2, res & 0xFFFF ); + m68ki_write_16(ea, (res >> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, res); +#endif + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pd_ai(void) +{ + uint res = OPER_AY_AI_32(); + uint ea = EA_AX_PD_32(); + +#if GENESIS_HACKS + m68ki_write_16(ea+2, res & 0xFFFF ); + m68ki_write_16(ea, (res >> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, res); +#endif + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pd_pi(void) +{ + uint res = OPER_AY_PI_32(); + uint ea = EA_AX_PD_32(); + +#if GENESIS_HACKS + m68ki_write_16(ea+2, res & 0xFFFF ); + m68ki_write_16(ea, (res >> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, res); +#endif + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pd_pd(void) +{ + uint res = OPER_AY_PD_32(); + uint ea = EA_AX_PD_32(); + +#if GENESIS_HACKS + m68ki_write_16(ea+2, res & 0xFFFF ); + m68ki_write_16(ea, (res >> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, res); +#endif + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pd_di(void) +{ + uint res = OPER_AY_DI_32(); + uint ea = EA_AX_PD_32(); + +#if GENESIS_HACKS + m68ki_write_16(ea+2, res & 0xFFFF ); + m68ki_write_16(ea, (res >> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, res); +#endif + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pd_ix(void) +{ + uint res = OPER_AY_IX_32(); + uint ea = EA_AX_PD_32(); + +#if GENESIS_HACKS + m68ki_write_16(ea+2, res & 0xFFFF ); + m68ki_write_16(ea, (res >> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, res); +#endif + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pd_aw(void) +{ + uint res = OPER_AW_32(); + uint ea = EA_AX_PD_32(); + +#if GENESIS_HACKS + m68ki_write_16(ea+2, res & 0xFFFF ); + m68ki_write_16(ea, (res >> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, res); +#endif + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pd_al(void) +{ + uint res = OPER_AL_32(); + uint ea = EA_AX_PD_32(); + +#if GENESIS_HACKS + m68ki_write_16(ea+2, res & 0xFFFF ); + m68ki_write_16(ea, (res >> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, res); +#endif + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pd_pcdi(void) +{ + uint res = OPER_PCDI_32(); + uint ea = EA_AX_PD_32(); + +#if GENESIS_HACKS + m68ki_write_16(ea+2, res & 0xFFFF ); + m68ki_write_16(ea, (res >> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, res); +#endif + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pd_pcix(void) +{ + uint res = OPER_PCIX_32(); + uint ea = EA_AX_PD_32(); + +#if GENESIS_HACKS + m68ki_write_16(ea+2, res & 0xFFFF ); + m68ki_write_16(ea, (res >> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, res); +#endif + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_pd_i(void) +{ + uint res = OPER_I_32(); + uint ea = EA_AX_PD_32(); + +#if GENESIS_HACKS + m68ki_write_16(ea+2, res & 0xFFFF ); + m68ki_write_16(ea, (res >> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, res); +#endif + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_di_d(void) +{ + uint res = DY; + uint ea = EA_AX_DI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_di_a(void) +{ + uint res = AY; + uint ea = EA_AX_DI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_di_ai(void) +{ + uint res = OPER_AY_AI_32(); + uint ea = EA_AX_DI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_di_pi(void) +{ + uint res = OPER_AY_PI_32(); + uint ea = EA_AX_DI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_di_pd(void) +{ + uint res = OPER_AY_PD_32(); + uint ea = EA_AX_DI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_di_di(void) +{ + uint res = OPER_AY_DI_32(); + uint ea = EA_AX_DI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_di_ix(void) +{ + uint res = OPER_AY_IX_32(); + uint ea = EA_AX_DI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_di_aw(void) +{ + uint res = OPER_AW_32(); + uint ea = EA_AX_DI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_di_al(void) +{ + uint res = OPER_AL_32(); + uint ea = EA_AX_DI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_di_pcdi(void) +{ + uint res = OPER_PCDI_32(); + uint ea = EA_AX_DI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_di_pcix(void) +{ + uint res = OPER_PCIX_32(); + uint ea = EA_AX_DI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_di_i(void) +{ + uint res = OPER_I_32(); + uint ea = EA_AX_DI_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ix_d(void) +{ + uint res = DY; + uint ea = EA_AX_IX_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ix_a(void) +{ + uint res = AY; + uint ea = EA_AX_IX_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ix_ai(void) +{ + uint res = OPER_AY_AI_32(); + uint ea = EA_AX_IX_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ix_pi(void) +{ + uint res = OPER_AY_PI_32(); + uint ea = EA_AX_IX_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ix_pd(void) +{ + uint res = OPER_AY_PD_32(); + uint ea = EA_AX_IX_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ix_di(void) +{ + uint res = OPER_AY_DI_32(); + uint ea = EA_AX_IX_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ix_ix(void) +{ + uint res = OPER_AY_IX_32(); + uint ea = EA_AX_IX_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ix_aw(void) +{ + uint res = OPER_AW_32(); + uint ea = EA_AX_IX_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ix_al(void) +{ + uint res = OPER_AL_32(); + uint ea = EA_AX_IX_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ix_pcdi(void) +{ + uint res = OPER_PCDI_32(); + uint ea = EA_AX_IX_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ix_pcix(void) +{ + uint res = OPER_PCIX_32(); + uint ea = EA_AX_IX_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_ix_i(void) +{ + uint res = OPER_I_32(); + uint ea = EA_AX_IX_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_aw_d(void) +{ + uint res = DY; + uint ea = EA_AW_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_aw_a(void) +{ + uint res = AY; + uint ea = EA_AW_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_aw_ai(void) +{ + uint res = OPER_AY_AI_32(); + uint ea = EA_AW_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_aw_pi(void) +{ + uint res = OPER_AY_PI_32(); + uint ea = EA_AW_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_aw_pd(void) +{ + uint res = OPER_AY_PD_32(); + uint ea = EA_AW_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_aw_di(void) +{ + uint res = OPER_AY_DI_32(); + uint ea = EA_AW_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_aw_ix(void) +{ + uint res = OPER_AY_IX_32(); + uint ea = EA_AW_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_aw_aw(void) +{ + uint res = OPER_AW_32(); + uint ea = EA_AW_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_aw_al(void) +{ + uint res = OPER_AL_32(); + uint ea = EA_AW_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_aw_pcdi(void) +{ + uint res = OPER_PCDI_32(); + uint ea = EA_AW_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_aw_pcix(void) +{ + uint res = OPER_PCIX_32(); + uint ea = EA_AW_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_aw_i(void) +{ + uint res = OPER_I_32(); + uint ea = EA_AW_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_al_d(void) +{ + uint res = DY; + uint ea = EA_AL_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_al_a(void) +{ + uint res = AY; + uint ea = EA_AL_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_al_ai(void) +{ + uint res = OPER_AY_AI_32(); + uint ea = EA_AL_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_al_pi(void) +{ + uint res = OPER_AY_PI_32(); + uint ea = EA_AL_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_al_pd(void) +{ + uint res = OPER_AY_PD_32(); + uint ea = EA_AL_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_al_di(void) +{ + uint res = OPER_AY_DI_32(); + uint ea = EA_AL_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_al_ix(void) +{ + uint res = OPER_AY_IX_32(); + uint ea = EA_AL_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_al_aw(void) +{ + uint res = OPER_AW_32(); + uint ea = EA_AL_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_al_al(void) +{ + uint res = OPER_AL_32(); + uint ea = EA_AL_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_al_pcdi(void) +{ + uint res = OPER_PCDI_32(); + uint ea = EA_AL_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_al_pcix(void) +{ + uint res = OPER_PCIX_32(); + uint ea = EA_AL_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_move_32_al_i(void) +{ + uint res = OPER_I_32(); + uint ea = EA_AL_32(); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_movea_16_d(void) +{ + AX = MAKE_INT_16(DY); +} + + +void m68k_op_movea_16_a(void) +{ + AX = MAKE_INT_16(AY); +} + + +void m68k_op_movea_16_ai(void) +{ + AX = MAKE_INT_16(OPER_AY_AI_16()); +} + + +void m68k_op_movea_16_pi(void) +{ + AX = MAKE_INT_16(OPER_AY_PI_16()); +} + + +void m68k_op_movea_16_pd(void) +{ + AX = MAKE_INT_16(OPER_AY_PD_16()); +} + + +void m68k_op_movea_16_di(void) +{ + AX = MAKE_INT_16(OPER_AY_DI_16()); +} + + +void m68k_op_movea_16_ix(void) +{ + AX = MAKE_INT_16(OPER_AY_IX_16()); +} + + +void m68k_op_movea_16_aw(void) +{ + AX = MAKE_INT_16(OPER_AW_16()); +} + + +void m68k_op_movea_16_al(void) +{ + AX = MAKE_INT_16(OPER_AL_16()); +} + + +void m68k_op_movea_16_pcdi(void) +{ + AX = MAKE_INT_16(OPER_PCDI_16()); +} + + +void m68k_op_movea_16_pcix(void) +{ + AX = MAKE_INT_16(OPER_PCIX_16()); +} + + +void m68k_op_movea_16_i(void) +{ + AX = MAKE_INT_16(OPER_I_16()); +} + + +void m68k_op_movea_32_d(void) +{ + AX = DY; +} + + +void m68k_op_movea_32_a(void) +{ + AX = AY; +} + + +void m68k_op_movea_32_ai(void) +{ + AX = OPER_AY_AI_32(); +} + + +void m68k_op_movea_32_pi(void) +{ + AX = OPER_AY_PI_32(); +} + + +void m68k_op_movea_32_pd(void) +{ + AX = OPER_AY_PD_32(); +} + + +void m68k_op_movea_32_di(void) +{ + AX = OPER_AY_DI_32(); +} + + +void m68k_op_movea_32_ix(void) +{ + AX = OPER_AY_IX_32(); +} + + +void m68k_op_movea_32_aw(void) +{ + AX = OPER_AW_32(); +} + + +void m68k_op_movea_32_al(void) +{ + AX = OPER_AL_32(); +} + + +void m68k_op_movea_32_pcdi(void) +{ + AX = OPER_PCDI_32(); +} + + +void m68k_op_movea_32_pcix(void) +{ + AX = OPER_PCIX_32(); +} + + +void m68k_op_movea_32_i(void) +{ + AX = OPER_I_32(); +} + + +void m68k_op_move_16_frc_d(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + DY = MASK_OUT_BELOW_16(DY) | m68ki_get_ccr(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_move_16_frc_ai(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + m68ki_write_16(EA_AY_AI_16(), m68ki_get_ccr()); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_move_16_frc_pi(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + m68ki_write_16(EA_AY_PI_16(), m68ki_get_ccr()); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_move_16_frc_pd(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + m68ki_write_16(EA_AY_PD_16(), m68ki_get_ccr()); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_move_16_frc_di(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + m68ki_write_16(EA_AY_DI_16(), m68ki_get_ccr()); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_move_16_frc_ix(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + m68ki_write_16(EA_AY_IX_16(), m68ki_get_ccr()); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_move_16_frc_aw(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + m68ki_write_16(EA_AW_16(), m68ki_get_ccr()); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_move_16_frc_al(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + m68ki_write_16(EA_AL_16(), m68ki_get_ccr()); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_move_16_toc_d(void) +{ + m68ki_set_ccr(DY); +} + + +void m68k_op_move_16_toc_ai(void) +{ + m68ki_set_ccr(OPER_AY_AI_16()); +} + + +void m68k_op_move_16_toc_pi(void) +{ + m68ki_set_ccr(OPER_AY_PI_16()); +} + + +void m68k_op_move_16_toc_pd(void) +{ + m68ki_set_ccr(OPER_AY_PD_16()); +} + + +void m68k_op_move_16_toc_di(void) +{ + m68ki_set_ccr(OPER_AY_DI_16()); +} + + +void m68k_op_move_16_toc_ix(void) +{ + m68ki_set_ccr(OPER_AY_IX_16()); +} + + +void m68k_op_move_16_toc_aw(void) +{ + m68ki_set_ccr(OPER_AW_16()); +} + + +void m68k_op_move_16_toc_al(void) +{ + m68ki_set_ccr(OPER_AL_16()); +} + + +void m68k_op_move_16_toc_pcdi(void) +{ + m68ki_set_ccr(OPER_PCDI_16()); +} + + +void m68k_op_move_16_toc_pcix(void) +{ + m68ki_set_ccr(OPER_PCIX_16()); +} + + +void m68k_op_move_16_toc_i(void) +{ + m68ki_set_ccr(OPER_I_16()); +} + + +void m68k_op_move_16_frs_d(void) +{ + if(CPU_TYPE_IS_000(CPU_TYPE) || FLAG_S) /* NS990408 */ + { + DY = MASK_OUT_BELOW_16(DY) | m68ki_get_sr(); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_frs_ai(void) +{ + if(CPU_TYPE_IS_000(CPU_TYPE) || FLAG_S) /* NS990408 */ + { + uint ea = EA_AY_AI_16(); + m68ki_write_16(ea, m68ki_get_sr()); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_frs_pi(void) +{ + if(CPU_TYPE_IS_000(CPU_TYPE) || FLAG_S) /* NS990408 */ + { + uint ea = EA_AY_PI_16(); + m68ki_write_16(ea, m68ki_get_sr()); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_frs_pd(void) +{ + if(CPU_TYPE_IS_000(CPU_TYPE) || FLAG_S) /* NS990408 */ + { + uint ea = EA_AY_PD_16(); + m68ki_write_16(ea, m68ki_get_sr()); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_frs_di(void) +{ + if(CPU_TYPE_IS_000(CPU_TYPE) || FLAG_S) /* NS990408 */ + { + uint ea = EA_AY_DI_16(); + m68ki_write_16(ea, m68ki_get_sr()); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_frs_ix(void) +{ + if(CPU_TYPE_IS_000(CPU_TYPE) || FLAG_S) /* NS990408 */ + { + uint ea = EA_AY_IX_16(); + m68ki_write_16(ea, m68ki_get_sr()); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_frs_aw(void) +{ + if(CPU_TYPE_IS_000(CPU_TYPE) || FLAG_S) /* NS990408 */ + { + uint ea = EA_AW_16(); + m68ki_write_16(ea, m68ki_get_sr()); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_frs_al(void) +{ + if(CPU_TYPE_IS_000(CPU_TYPE) || FLAG_S) /* NS990408 */ + { + uint ea = EA_AL_16(); + m68ki_write_16(ea, m68ki_get_sr()); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_tos_d(void) +{ + if(FLAG_S) + { + m68ki_set_sr(DY); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_tos_ai(void) +{ + if(FLAG_S) + { + uint new_sr = OPER_AY_AI_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(new_sr); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_tos_pi(void) +{ + if(FLAG_S) + { + uint new_sr = OPER_AY_PI_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(new_sr); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_tos_pd(void) +{ + if(FLAG_S) + { + uint new_sr = OPER_AY_PD_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(new_sr); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_tos_di(void) +{ + if(FLAG_S) + { + uint new_sr = OPER_AY_DI_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(new_sr); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_tos_ix(void) +{ + if(FLAG_S) + { + uint new_sr = OPER_AY_IX_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(new_sr); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_tos_aw(void) +{ + if(FLAG_S) + { + uint new_sr = OPER_AW_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(new_sr); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_tos_al(void) +{ + if(FLAG_S) + { + uint new_sr = OPER_AL_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(new_sr); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_tos_pcdi(void) +{ + if(FLAG_S) + { + uint new_sr = OPER_PCDI_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(new_sr); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_tos_pcix(void) +{ + if(FLAG_S) + { + uint new_sr = OPER_PCIX_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(new_sr); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_16_tos_i(void) +{ + if(FLAG_S) + { + uint new_sr = OPER_I_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(new_sr); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_32_fru(void) +{ + if(FLAG_S) + { + AY = REG_USP; + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_move_32_tou(void) +{ + if(FLAG_S) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + REG_USP = AY; + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_movec_32_cr(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + switch (word2 & 0xfff) + { + case 0x000: /* SFC */ + REG_DA[(word2 >> 12) & 15] = REG_SFC; + return; + case 0x001: /* DFC */ + REG_DA[(word2 >> 12) & 15] = REG_DFC; + return; + case 0x002: /* CACR */ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + REG_DA[(word2 >> 12) & 15] = REG_CACR; + return; + } + return; + case 0x800: /* USP */ + REG_DA[(word2 >> 12) & 15] = REG_USP; + return; + case 0x801: /* VBR */ + REG_DA[(word2 >> 12) & 15] = REG_VBR; + return; + case 0x802: /* CAAR */ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + REG_DA[(word2 >> 12) & 15] = REG_CAAR; + return; + } + m68ki_exception_illegal(); + break; + case 0x803: /* MSP */ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + REG_DA[(word2 >> 12) & 15] = FLAG_M ? REG_SP : REG_MSP; + return; + } + m68ki_exception_illegal(); + return; + case 0x804: /* ISP */ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + REG_DA[(word2 >> 12) & 15] = FLAG_M ? REG_ISP : REG_SP; + return; + } + m68ki_exception_illegal(); + return; + default: + m68ki_exception_illegal(); + return; + } + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_movec_32_rc(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + switch (word2 & 0xfff) + { + case 0x000: /* SFC */ + REG_SFC = REG_DA[(word2 >> 12) & 15] & 7; + return; + case 0x001: /* DFC */ + REG_DFC = REG_DA[(word2 >> 12) & 15] & 7; + return; + case 0x002: /* CACR */ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + REG_CACR = REG_DA[(word2 >> 12) & 15]; + return; + } + m68ki_exception_illegal(); + return; + case 0x800: /* USP */ + REG_USP = REG_DA[(word2 >> 12) & 15]; + return; + case 0x801: /* VBR */ + REG_VBR = REG_DA[(word2 >> 12) & 15]; + return; + case 0x802: /* CAAR */ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + REG_CAAR = REG_DA[(word2 >> 12) & 15]; + return; + } + m68ki_exception_illegal(); + return; + case 0x803: /* MSP */ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + /* we are in supervisor mode so just check for M flag */ + if(!FLAG_M) + { + REG_MSP = REG_DA[(word2 >> 12) & 15]; + return; + } + REG_SP = REG_DA[(word2 >> 12) & 15]; + return; + } + m68ki_exception_illegal(); + return; + case 0x804: /* ISP */ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(!FLAG_M) + { + REG_SP = REG_DA[(word2 >> 12) & 15]; + return; + } + REG_ISP = REG_DA[(word2 >> 12) & 15]; + return; + } + m68ki_exception_illegal(); + return; + default: + m68ki_exception_illegal(); + return; + } + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_movem_16_re_pd(void) +{ + uint i = 0; + uint register_list = OPER_I_16(); + uint ea = AY; + uint count = 0; + + for(; i < 16; i++) + if(register_list & (1 << i)) + { + ea -= 2; + m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_DA[15-i])); + count++; + } + AY = ea; + + USE_CYCLES(count<> 16) & 0xFFFF ); +#else + m68ki_write_32(ea, REG_DA[15-i]); +#endif + count++; + } + AY = ea; + + USE_CYCLES(count<> 8)); + m68ki_write_8(ea += 2, MASK_OUT_ABOVE_8(src)); +} + + +void m68k_op_movep_32_re(void) +{ + uint ea = EA_AY_DI_32(); + uint src = DX; + + m68ki_write_8(ea, MASK_OUT_ABOVE_8(src >> 24)); + m68ki_write_8(ea += 2, MASK_OUT_ABOVE_8(src >> 16)); + m68ki_write_8(ea += 2, MASK_OUT_ABOVE_8(src >> 8)); + m68ki_write_8(ea += 2, MASK_OUT_ABOVE_8(src)); +} + + +void m68k_op_movep_16_er(void) +{ + uint ea = EA_AY_DI_16(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | ((m68ki_read_8(ea) << 8) + m68ki_read_8(ea + 2)); +} + + +void m68k_op_movep_32_er(void) +{ + uint ea = EA_AY_DI_32(); + + DX = (m68ki_read_8(ea) << 24) + (m68ki_read_8(ea + 2) << 16) + + (m68ki_read_8(ea + 4) << 8) + m68ki_read_8(ea + 6); +} + + +void m68k_op_moves_8_ai(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_AI_8(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_8_fc(ea, REG_DFC, MASK_OUT_ABOVE_8(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_8(m68ki_read_8_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_8(REG_D[(word2 >> 12) & 7]) | m68ki_read_8_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_8_pi(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_PI_8(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_8_fc(ea, REG_DFC, MASK_OUT_ABOVE_8(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_8(m68ki_read_8_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_8(REG_D[(word2 >> 12) & 7]) | m68ki_read_8_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_8_pi7(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_A7_PI_8(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_8_fc(ea, REG_DFC, MASK_OUT_ABOVE_8(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_8(m68ki_read_8_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_8(REG_D[(word2 >> 12) & 7]) | m68ki_read_8_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_8_pd(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_PD_8(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_8_fc(ea, REG_DFC, MASK_OUT_ABOVE_8(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_8(m68ki_read_8_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_8(REG_D[(word2 >> 12) & 7]) | m68ki_read_8_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_8_pd7(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_A7_PD_8(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_8_fc(ea, REG_DFC, MASK_OUT_ABOVE_8(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_8(m68ki_read_8_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_8(REG_D[(word2 >> 12) & 7]) | m68ki_read_8_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_8_di(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_DI_8(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_8_fc(ea, REG_DFC, MASK_OUT_ABOVE_8(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_8(m68ki_read_8_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_8(REG_D[(word2 >> 12) & 7]) | m68ki_read_8_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_8_ix(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_IX_8(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_8_fc(ea, REG_DFC, MASK_OUT_ABOVE_8(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_8(m68ki_read_8_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_8(REG_D[(word2 >> 12) & 7]) | m68ki_read_8_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_8_aw(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AW_8(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_8_fc(ea, REG_DFC, MASK_OUT_ABOVE_8(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_8(m68ki_read_8_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_8(REG_D[(word2 >> 12) & 7]) | m68ki_read_8_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_8_al(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AL_8(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_8_fc(ea, REG_DFC, MASK_OUT_ABOVE_8(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_8(m68ki_read_8_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_8(REG_D[(word2 >> 12) & 7]) | m68ki_read_8_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_16_ai(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_AI_16(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_16_fc(ea, REG_DFC, MASK_OUT_ABOVE_16(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_16(m68ki_read_16_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_16(REG_D[(word2 >> 12) & 7]) | m68ki_read_16_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_16_pi(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_PI_16(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_16_fc(ea, REG_DFC, MASK_OUT_ABOVE_16(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_16(m68ki_read_16_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_16(REG_D[(word2 >> 12) & 7]) | m68ki_read_16_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_16_pd(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_PD_16(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_16_fc(ea, REG_DFC, MASK_OUT_ABOVE_16(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_16(m68ki_read_16_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_16(REG_D[(word2 >> 12) & 7]) | m68ki_read_16_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_16_di(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_DI_16(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_16_fc(ea, REG_DFC, MASK_OUT_ABOVE_16(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_16(m68ki_read_16_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_16(REG_D[(word2 >> 12) & 7]) | m68ki_read_16_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_16_ix(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_IX_16(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_16_fc(ea, REG_DFC, MASK_OUT_ABOVE_16(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_16(m68ki_read_16_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_16(REG_D[(word2 >> 12) & 7]) | m68ki_read_16_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_16_aw(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AW_16(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_16_fc(ea, REG_DFC, MASK_OUT_ABOVE_16(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_16(m68ki_read_16_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_16(REG_D[(word2 >> 12) & 7]) | m68ki_read_16_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_16_al(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AL_16(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_16_fc(ea, REG_DFC, MASK_OUT_ABOVE_16(REG_DA[(word2 >> 12) & 15])); + return; + } + if(BIT_F(word2)) /* Memory to address register */ + { + REG_A[(word2 >> 12) & 7] = MAKE_INT_16(m68ki_read_16_fc(ea, REG_SFC)); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to data register */ + REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_16(REG_D[(word2 >> 12) & 7]) | m68ki_read_16_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_32_ai(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_AI_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_32_fc(ea, REG_DFC, REG_DA[(word2 >> 12) & 15]); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to register */ + REG_DA[(word2 >> 12) & 15] = m68ki_read_32_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_32_pi(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_PI_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_32_fc(ea, REG_DFC, REG_DA[(word2 >> 12) & 15]); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to register */ + REG_DA[(word2 >> 12) & 15] = m68ki_read_32_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_32_pd(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_PD_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_32_fc(ea, REG_DFC, REG_DA[(word2 >> 12) & 15]); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to register */ + REG_DA[(word2 >> 12) & 15] = m68ki_read_32_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_32_di(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_DI_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_32_fc(ea, REG_DFC, REG_DA[(word2 >> 12) & 15]); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to register */ + REG_DA[(word2 >> 12) & 15] = m68ki_read_32_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_32_ix(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AY_IX_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_32_fc(ea, REG_DFC, REG_DA[(word2 >> 12) & 15]); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to register */ + REG_DA[(word2 >> 12) & 15] = m68ki_read_32_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_32_aw(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AW_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_32_fc(ea, REG_DFC, REG_DA[(word2 >> 12) & 15]); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to register */ + REG_DA[(word2 >> 12) & 15] = m68ki_read_32_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moves_32_al(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + if(FLAG_S) + { + uint word2 = OPER_I_16(); + uint ea = EA_AL_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + if(BIT_B(word2)) /* Register to memory */ + { + m68ki_write_32_fc(ea, REG_DFC, REG_DA[(word2 >> 12) & 15]); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + /* Memory to register */ + REG_DA[(word2 >> 12) & 15] = m68ki_read_32_fc(ea, REG_SFC); + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + USE_CYCLES(2); + return; + } + m68ki_exception_privilege_violation(); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_moveq_32(void) +{ + uint res = DX = MAKE_INT_8(MASK_OUT_ABOVE_8(REG_IR)); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_muls_16_d(void) +{ + uint* r_dst = &DX; + uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(DY) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_muls_16_ai(void) +{ + uint* r_dst = &DX; + uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(OPER_AY_AI_16()) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_muls_16_pi(void) +{ + uint* r_dst = &DX; + uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(OPER_AY_PI_16()) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_muls_16_pd(void) +{ + uint* r_dst = &DX; + uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(OPER_AY_PD_16()) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_muls_16_di(void) +{ + uint* r_dst = &DX; + uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(OPER_AY_DI_16()) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_muls_16_ix(void) +{ + uint* r_dst = &DX; + uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(OPER_AY_IX_16()) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_muls_16_aw(void) +{ + uint* r_dst = &DX; + uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(OPER_AW_16()) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_muls_16_al(void) +{ + uint* r_dst = &DX; + uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(OPER_AL_16()) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_muls_16_pcdi(void) +{ + uint* r_dst = &DX; + uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(OPER_PCDI_16()) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_muls_16_pcix(void) +{ + uint* r_dst = &DX; + uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(OPER_PCIX_16()) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_muls_16_i(void) +{ + uint* r_dst = &DX; + uint res = MASK_OUT_ABOVE_32(MAKE_INT_16(OPER_I_16()) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_mulu_16_d(void) +{ + uint* r_dst = &DX; + uint res = MASK_OUT_ABOVE_16(DY) * MASK_OUT_ABOVE_16(*r_dst); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_mulu_16_ai(void) +{ + uint* r_dst = &DX; + uint res = OPER_AY_AI_16() * MASK_OUT_ABOVE_16(*r_dst); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_mulu_16_pi(void) +{ + uint* r_dst = &DX; + uint res = OPER_AY_PI_16() * MASK_OUT_ABOVE_16(*r_dst); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_mulu_16_pd(void) +{ + uint* r_dst = &DX; + uint res = OPER_AY_PD_16() * MASK_OUT_ABOVE_16(*r_dst); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_mulu_16_di(void) +{ + uint* r_dst = &DX; + uint res = OPER_AY_DI_16() * MASK_OUT_ABOVE_16(*r_dst); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_mulu_16_ix(void) +{ + uint* r_dst = &DX; + uint res = OPER_AY_IX_16() * MASK_OUT_ABOVE_16(*r_dst); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_mulu_16_aw(void) +{ + uint* r_dst = &DX; + uint res = OPER_AW_16() * MASK_OUT_ABOVE_16(*r_dst); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_mulu_16_al(void) +{ + uint* r_dst = &DX; + uint res = OPER_AL_16() * MASK_OUT_ABOVE_16(*r_dst); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_mulu_16_pcdi(void) +{ + uint* r_dst = &DX; + uint res = OPER_PCDI_16() * MASK_OUT_ABOVE_16(*r_dst); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_mulu_16_pcix(void) +{ + uint* r_dst = &DX; + uint res = OPER_PCIX_16() * MASK_OUT_ABOVE_16(*r_dst); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_mulu_16_i(void) +{ + uint* r_dst = &DX; + uint res = OPER_I_16() * MASK_OUT_ABOVE_16(*r_dst); + + *r_dst = res; + + FLAG_Z = res; + FLAG_N = NFLAG_32(res); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_mull_32_d(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 src = DY; + uint64 dst = REG_D[(word2 >> 12) & 7]; + uint64 res; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + res = (sint64)((sint32)src) * (sint64)((sint32)dst); + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = ((sint64)res != (sint32)res)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + + res = src * dst; + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = (res > 0xffffffff)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint src = DY; + uint dst = REG_D[(word2 >> 12) & 7]; + uint neg = GET_MSB_32(src ^ dst); + uint src1; + uint src2; + uint dst1; + uint dst2; + uint r1; + uint r2; + uint r3; + uint r4; + uint lo; + uint hi; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + if(GET_MSB_32(src)) + src = (uint)MASK_OUT_ABOVE_32(-(sint)src); + if(GET_MSB_32(dst)) + dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); + } + + src1 = MASK_OUT_ABOVE_16(src); + src2 = src>>16; + dst1 = MASK_OUT_ABOVE_16(dst); + dst2 = dst>>16; + + + r1 = src1 * dst1; + r2 = src1 * dst2; + r3 = src2 * dst1; + r4 = src2 * dst2; + + lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); + hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); + + if(BIT_B(word2) && neg) + { + hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); + lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); + } + + if(BIT_A(word2)) + { + REG_D[word2 & 7] = hi; + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(hi); + FLAG_Z = hi | lo; + FLAG_V = VFLAG_CLEAR; + return; + } + + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(lo); + FLAG_Z = lo; + if(BIT_B(word2)) + FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; + else + FLAG_V = (hi != 0) << 7; + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_mull_32_ai(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 src = OPER_AY_AI_32(); + uint64 dst = REG_D[(word2 >> 12) & 7]; + uint64 res; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + res = (sint64)((sint32)src) * (sint64)((sint32)dst); + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = ((sint64)res != (sint32)res)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + + res = src * dst; + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = (res > 0xffffffff)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint src = OPER_AY_AI_32(); + uint dst = REG_D[(word2 >> 12) & 7]; + uint neg = GET_MSB_32(src ^ dst); + uint src1; + uint src2; + uint dst1; + uint dst2; + uint r1; + uint r2; + uint r3; + uint r4; + uint lo; + uint hi; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + if(GET_MSB_32(src)) + src = (uint)MASK_OUT_ABOVE_32(-(sint)src); + if(GET_MSB_32(dst)) + dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); + } + + src1 = MASK_OUT_ABOVE_16(src); + src2 = src>>16; + dst1 = MASK_OUT_ABOVE_16(dst); + dst2 = dst>>16; + + + r1 = src1 * dst1; + r2 = src1 * dst2; + r3 = src2 * dst1; + r4 = src2 * dst2; + + lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); + hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); + + if(BIT_B(word2) && neg) + { + hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); + lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); + } + + if(BIT_A(word2)) + { + REG_D[word2 & 7] = hi; + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(hi); + FLAG_Z = hi | lo; + FLAG_V = VFLAG_CLEAR; + return; + } + + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(lo); + FLAG_Z = lo; + if(BIT_B(word2)) + FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; + else + FLAG_V = (hi != 0) << 7; + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_mull_32_pi(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 src = OPER_AY_PI_32(); + uint64 dst = REG_D[(word2 >> 12) & 7]; + uint64 res; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + res = (sint64)((sint32)src) * (sint64)((sint32)dst); + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = ((sint64)res != (sint32)res)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + + res = src * dst; + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = (res > 0xffffffff)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint src = OPER_AY_PI_32(); + uint dst = REG_D[(word2 >> 12) & 7]; + uint neg = GET_MSB_32(src ^ dst); + uint src1; + uint src2; + uint dst1; + uint dst2; + uint r1; + uint r2; + uint r3; + uint r4; + uint lo; + uint hi; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + if(GET_MSB_32(src)) + src = (uint)MASK_OUT_ABOVE_32(-(sint)src); + if(GET_MSB_32(dst)) + dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); + } + + src1 = MASK_OUT_ABOVE_16(src); + src2 = src>>16; + dst1 = MASK_OUT_ABOVE_16(dst); + dst2 = dst>>16; + + + r1 = src1 * dst1; + r2 = src1 * dst2; + r3 = src2 * dst1; + r4 = src2 * dst2; + + lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); + hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); + + if(BIT_B(word2) && neg) + { + hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); + lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); + } + + if(BIT_A(word2)) + { + REG_D[word2 & 7] = hi; + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(hi); + FLAG_Z = hi | lo; + FLAG_V = VFLAG_CLEAR; + return; + } + + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(lo); + FLAG_Z = lo; + if(BIT_B(word2)) + FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; + else + FLAG_V = (hi != 0) << 7; + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_mull_32_pd(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 src = OPER_AY_PD_32(); + uint64 dst = REG_D[(word2 >> 12) & 7]; + uint64 res; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + res = (sint64)((sint32)src) * (sint64)((sint32)dst); + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = ((sint64)res != (sint32)res)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + + res = src * dst; + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = (res > 0xffffffff)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint src = OPER_AY_PD_32(); + uint dst = REG_D[(word2 >> 12) & 7]; + uint neg = GET_MSB_32(src ^ dst); + uint src1; + uint src2; + uint dst1; + uint dst2; + uint r1; + uint r2; + uint r3; + uint r4; + uint lo; + uint hi; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + if(GET_MSB_32(src)) + src = (uint)MASK_OUT_ABOVE_32(-(sint)src); + if(GET_MSB_32(dst)) + dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); + } + + src1 = MASK_OUT_ABOVE_16(src); + src2 = src>>16; + dst1 = MASK_OUT_ABOVE_16(dst); + dst2 = dst>>16; + + + r1 = src1 * dst1; + r2 = src1 * dst2; + r3 = src2 * dst1; + r4 = src2 * dst2; + + lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); + hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); + + if(BIT_B(word2) && neg) + { + hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); + lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); + } + + if(BIT_A(word2)) + { + REG_D[word2 & 7] = hi; + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(hi); + FLAG_Z = hi | lo; + FLAG_V = VFLAG_CLEAR; + return; + } + + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(lo); + FLAG_Z = lo; + if(BIT_B(word2)) + FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; + else + FLAG_V = (hi != 0) << 7; + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_mull_32_di(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 src = OPER_AY_DI_32(); + uint64 dst = REG_D[(word2 >> 12) & 7]; + uint64 res; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + res = (sint64)((sint32)src) * (sint64)((sint32)dst); + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = ((sint64)res != (sint32)res)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + + res = src * dst; + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = (res > 0xffffffff)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint src = OPER_AY_DI_32(); + uint dst = REG_D[(word2 >> 12) & 7]; + uint neg = GET_MSB_32(src ^ dst); + uint src1; + uint src2; + uint dst1; + uint dst2; + uint r1; + uint r2; + uint r3; + uint r4; + uint lo; + uint hi; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + if(GET_MSB_32(src)) + src = (uint)MASK_OUT_ABOVE_32(-(sint)src); + if(GET_MSB_32(dst)) + dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); + } + + src1 = MASK_OUT_ABOVE_16(src); + src2 = src>>16; + dst1 = MASK_OUT_ABOVE_16(dst); + dst2 = dst>>16; + + + r1 = src1 * dst1; + r2 = src1 * dst2; + r3 = src2 * dst1; + r4 = src2 * dst2; + + lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); + hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); + + if(BIT_B(word2) && neg) + { + hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); + lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); + } + + if(BIT_A(word2)) + { + REG_D[word2 & 7] = hi; + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(hi); + FLAG_Z = hi | lo; + FLAG_V = VFLAG_CLEAR; + return; + } + + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(lo); + FLAG_Z = lo; + if(BIT_B(word2)) + FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; + else + FLAG_V = (hi != 0) << 7; + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_mull_32_ix(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 src = OPER_AY_IX_32(); + uint64 dst = REG_D[(word2 >> 12) & 7]; + uint64 res; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + res = (sint64)((sint32)src) * (sint64)((sint32)dst); + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = ((sint64)res != (sint32)res)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + + res = src * dst; + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = (res > 0xffffffff)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint src = OPER_AY_IX_32(); + uint dst = REG_D[(word2 >> 12) & 7]; + uint neg = GET_MSB_32(src ^ dst); + uint src1; + uint src2; + uint dst1; + uint dst2; + uint r1; + uint r2; + uint r3; + uint r4; + uint lo; + uint hi; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + if(GET_MSB_32(src)) + src = (uint)MASK_OUT_ABOVE_32(-(sint)src); + if(GET_MSB_32(dst)) + dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); + } + + src1 = MASK_OUT_ABOVE_16(src); + src2 = src>>16; + dst1 = MASK_OUT_ABOVE_16(dst); + dst2 = dst>>16; + + + r1 = src1 * dst1; + r2 = src1 * dst2; + r3 = src2 * dst1; + r4 = src2 * dst2; + + lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); + hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); + + if(BIT_B(word2) && neg) + { + hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); + lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); + } + + if(BIT_A(word2)) + { + REG_D[word2 & 7] = hi; + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(hi); + FLAG_Z = hi | lo; + FLAG_V = VFLAG_CLEAR; + return; + } + + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(lo); + FLAG_Z = lo; + if(BIT_B(word2)) + FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; + else + FLAG_V = (hi != 0) << 7; + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_mull_32_aw(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 src = OPER_AW_32(); + uint64 dst = REG_D[(word2 >> 12) & 7]; + uint64 res; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + res = (sint64)((sint32)src) * (sint64)((sint32)dst); + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = ((sint64)res != (sint32)res)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + + res = src * dst; + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = (res > 0xffffffff)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint src = OPER_AW_32(); + uint dst = REG_D[(word2 >> 12) & 7]; + uint neg = GET_MSB_32(src ^ dst); + uint src1; + uint src2; + uint dst1; + uint dst2; + uint r1; + uint r2; + uint r3; + uint r4; + uint lo; + uint hi; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + if(GET_MSB_32(src)) + src = (uint)MASK_OUT_ABOVE_32(-(sint)src); + if(GET_MSB_32(dst)) + dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); + } + + src1 = MASK_OUT_ABOVE_16(src); + src2 = src>>16; + dst1 = MASK_OUT_ABOVE_16(dst); + dst2 = dst>>16; + + + r1 = src1 * dst1; + r2 = src1 * dst2; + r3 = src2 * dst1; + r4 = src2 * dst2; + + lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); + hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); + + if(BIT_B(word2) && neg) + { + hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); + lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); + } + + if(BIT_A(word2)) + { + REG_D[word2 & 7] = hi; + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(hi); + FLAG_Z = hi | lo; + FLAG_V = VFLAG_CLEAR; + return; + } + + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(lo); + FLAG_Z = lo; + if(BIT_B(word2)) + FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; + else + FLAG_V = (hi != 0) << 7; + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_mull_32_al(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 src = OPER_AL_32(); + uint64 dst = REG_D[(word2 >> 12) & 7]; + uint64 res; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + res = (sint64)((sint32)src) * (sint64)((sint32)dst); + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = ((sint64)res != (sint32)res)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + + res = src * dst; + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = (res > 0xffffffff)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint src = OPER_AL_32(); + uint dst = REG_D[(word2 >> 12) & 7]; + uint neg = GET_MSB_32(src ^ dst); + uint src1; + uint src2; + uint dst1; + uint dst2; + uint r1; + uint r2; + uint r3; + uint r4; + uint lo; + uint hi; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + if(GET_MSB_32(src)) + src = (uint)MASK_OUT_ABOVE_32(-(sint)src); + if(GET_MSB_32(dst)) + dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); + } + + src1 = MASK_OUT_ABOVE_16(src); + src2 = src>>16; + dst1 = MASK_OUT_ABOVE_16(dst); + dst2 = dst>>16; + + + r1 = src1 * dst1; + r2 = src1 * dst2; + r3 = src2 * dst1; + r4 = src2 * dst2; + + lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); + hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); + + if(BIT_B(word2) && neg) + { + hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); + lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); + } + + if(BIT_A(word2)) + { + REG_D[word2 & 7] = hi; + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(hi); + FLAG_Z = hi | lo; + FLAG_V = VFLAG_CLEAR; + return; + } + + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(lo); + FLAG_Z = lo; + if(BIT_B(word2)) + FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; + else + FLAG_V = (hi != 0) << 7; + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_mull_32_pcdi(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 src = OPER_PCDI_32(); + uint64 dst = REG_D[(word2 >> 12) & 7]; + uint64 res; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + res = (sint64)((sint32)src) * (sint64)((sint32)dst); + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = ((sint64)res != (sint32)res)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + + res = src * dst; + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = (res > 0xffffffff)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint src = OPER_PCDI_32(); + uint dst = REG_D[(word2 >> 12) & 7]; + uint neg = GET_MSB_32(src ^ dst); + uint src1; + uint src2; + uint dst1; + uint dst2; + uint r1; + uint r2; + uint r3; + uint r4; + uint lo; + uint hi; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + if(GET_MSB_32(src)) + src = (uint)MASK_OUT_ABOVE_32(-(sint)src); + if(GET_MSB_32(dst)) + dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); + } + + src1 = MASK_OUT_ABOVE_16(src); + src2 = src>>16; + dst1 = MASK_OUT_ABOVE_16(dst); + dst2 = dst>>16; + + + r1 = src1 * dst1; + r2 = src1 * dst2; + r3 = src2 * dst1; + r4 = src2 * dst2; + + lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); + hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); + + if(BIT_B(word2) && neg) + { + hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); + lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); + } + + if(BIT_A(word2)) + { + REG_D[word2 & 7] = hi; + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(hi); + FLAG_Z = hi | lo; + FLAG_V = VFLAG_CLEAR; + return; + } + + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(lo); + FLAG_Z = lo; + if(BIT_B(word2)) + FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; + else + FLAG_V = (hi != 0) << 7; + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_mull_32_pcix(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 src = OPER_PCIX_32(); + uint64 dst = REG_D[(word2 >> 12) & 7]; + uint64 res; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + res = (sint64)((sint32)src) * (sint64)((sint32)dst); + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = ((sint64)res != (sint32)res)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + + res = src * dst; + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = (res > 0xffffffff)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint src = OPER_PCIX_32(); + uint dst = REG_D[(word2 >> 12) & 7]; + uint neg = GET_MSB_32(src ^ dst); + uint src1; + uint src2; + uint dst1; + uint dst2; + uint r1; + uint r2; + uint r3; + uint r4; + uint lo; + uint hi; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + if(GET_MSB_32(src)) + src = (uint)MASK_OUT_ABOVE_32(-(sint)src); + if(GET_MSB_32(dst)) + dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); + } + + src1 = MASK_OUT_ABOVE_16(src); + src2 = src>>16; + dst1 = MASK_OUT_ABOVE_16(dst); + dst2 = dst>>16; + + + r1 = src1 * dst1; + r2 = src1 * dst2; + r3 = src2 * dst1; + r4 = src2 * dst2; + + lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); + hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); + + if(BIT_B(word2) && neg) + { + hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); + lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); + } + + if(BIT_A(word2)) + { + REG_D[word2 & 7] = hi; + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(hi); + FLAG_Z = hi | lo; + FLAG_V = VFLAG_CLEAR; + return; + } + + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(lo); + FLAG_Z = lo; + if(BIT_B(word2)) + FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; + else + FLAG_V = (hi != 0) << 7; + return; + } + m68ki_exception_illegal(); + +#endif +} + + +void m68k_op_mull_32_i(void) +{ +#if M68K_USE_64_BIT + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint64 src = OPER_I_32(); + uint64 dst = REG_D[(word2 >> 12) & 7]; + uint64 res; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + res = (sint64)((sint32)src) * (sint64)((sint32)dst); + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = ((sint64)res != (sint32)res)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + + res = src * dst; + if(!BIT_A(word2)) + { + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_N = NFLAG_32(res); + FLAG_V = (res > 0xffffffff)<<7; + REG_D[(word2 >> 12) & 7] = FLAG_Z; + return; + } + FLAG_Z = MASK_OUT_ABOVE_32(res) | (res>>32); + FLAG_N = NFLAG_64(res); + FLAG_V = VFLAG_CLEAR; + REG_D[word2 & 7] = (res >> 32); + REG_D[(word2 >> 12) & 7] = MASK_OUT_ABOVE_32(res); + return; + } + m68ki_exception_illegal(); + +#else + + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint word2 = OPER_I_16(); + uint src = OPER_I_32(); + uint dst = REG_D[(word2 >> 12) & 7]; + uint neg = GET_MSB_32(src ^ dst); + uint src1; + uint src2; + uint dst1; + uint dst2; + uint r1; + uint r2; + uint r3; + uint r4; + uint lo; + uint hi; + + FLAG_C = CFLAG_CLEAR; + + if(BIT_B(word2)) /* signed */ + { + if(GET_MSB_32(src)) + src = (uint)MASK_OUT_ABOVE_32(-(sint)src); + if(GET_MSB_32(dst)) + dst = (uint)MASK_OUT_ABOVE_32(-(sint)dst); + } + + src1 = MASK_OUT_ABOVE_16(src); + src2 = src>>16; + dst1 = MASK_OUT_ABOVE_16(dst); + dst2 = dst>>16; + + + r1 = src1 * dst1; + r2 = src1 * dst2; + r3 = src2 * dst1; + r4 = src2 * dst2; + + lo = r1 + (MASK_OUT_ABOVE_16(r2)<<16) + (MASK_OUT_ABOVE_16(r3)<<16); + hi = r4 + (r2>>16) + (r3>>16) + (((r1>>16) + MASK_OUT_ABOVE_16(r2) + MASK_OUT_ABOVE_16(r3)) >> 16); + + if(BIT_B(word2) && neg) + { + hi = (uint)MASK_OUT_ABOVE_32((-(sint)hi) - (lo != 0)); + lo = (uint)MASK_OUT_ABOVE_32(-(sint)lo); + } + + if(BIT_A(word2)) + { + REG_D[word2 & 7] = hi; + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(hi); + FLAG_Z = hi | lo; + FLAG_V = VFLAG_CLEAR; + return; + } + + REG_D[(word2 >> 12) & 7] = lo; + FLAG_N = NFLAG_32(lo); + FLAG_Z = lo; + if(BIT_B(word2)) + FLAG_V = (!((GET_MSB_32(lo) && hi == 0xffffffff) || (!GET_MSB_32(lo) && !hi)))<<7; + else + FLAG_V = (hi != 0) << 7; + return; + } + m68ki_exception_illegal(); + +#endif +} + + +/* ======================================================================== */ +/* ============================== END OF FILE ============================= */ +/* ======================================================================== */ + + diff --git a/source/m68k/m68kopnz.c b/source/m68k/m68kopnz.c new file mode 100644 index 0000000..60c57eb --- /dev/null +++ b/source/m68k/m68kopnz.c @@ -0,0 +1,8746 @@ +#include "m68kcpu.h" + +/* ======================================================================== */ +/* ========================= INSTRUCTION HANDLERS ========================= */ +/* ======================================================================== */ + + +void m68k_op_nbcd_8_d(void) +{ + uint* r_dst = &DY; + uint dst = *r_dst; + uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1()); + + if(res != 0x9a) + { + if((res & 0x0f) == 0xa) + res = (res & 0xf0) + 0x10; + + res = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_Z |= res; + FLAG_C = CFLAG_SET; + FLAG_X = XFLAG_SET; + } + else + { + FLAG_C = CFLAG_CLEAR; + FLAG_X = XFLAG_CLEAR; + } + FLAG_N = NFLAG_8(res); /* officially undefined */ +} + + +void m68k_op_nbcd_8_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint dst = m68ki_read_8(ea); + uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1()); + + if(res != 0x9a) + { + if((res & 0x0f) == 0xa) + res = (res & 0xf0) + 0x10; + + res = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, MASK_OUT_ABOVE_8(res)); + + FLAG_Z |= res; + FLAG_C = CFLAG_SET; + FLAG_X = XFLAG_SET; + } + else + { + FLAG_C = CFLAG_CLEAR; + FLAG_X = XFLAG_CLEAR; + } + FLAG_N = NFLAG_8(res); /* officially undefined */ +} + + +void m68k_op_nbcd_8_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint dst = m68ki_read_8(ea); + uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1()); + + if(res != 0x9a) + { + if((res & 0x0f) == 0xa) + res = (res & 0xf0) + 0x10; + + res = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, MASK_OUT_ABOVE_8(res)); + + FLAG_Z |= res; + FLAG_C = CFLAG_SET; + FLAG_X = XFLAG_SET; + } + else + { + FLAG_C = CFLAG_CLEAR; + FLAG_X = XFLAG_CLEAR; + } + FLAG_N = NFLAG_8(res); /* officially undefined */ +} + + +void m68k_op_nbcd_8_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint dst = m68ki_read_8(ea); + uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1()); + + if(res != 0x9a) + { + if((res & 0x0f) == 0xa) + res = (res & 0xf0) + 0x10; + + res = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, MASK_OUT_ABOVE_8(res)); + + FLAG_Z |= res; + FLAG_C = CFLAG_SET; + FLAG_X = XFLAG_SET; + } + else + { + FLAG_C = CFLAG_CLEAR; + FLAG_X = XFLAG_CLEAR; + } + FLAG_N = NFLAG_8(res); /* officially undefined */ +} + + +void m68k_op_nbcd_8_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1()); + + if(res != 0x9a) + { + if((res & 0x0f) == 0xa) + res = (res & 0xf0) + 0x10; + + res = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, MASK_OUT_ABOVE_8(res)); + + FLAG_Z |= res; + FLAG_C = CFLAG_SET; + FLAG_X = XFLAG_SET; + } + else + { + FLAG_C = CFLAG_CLEAR; + FLAG_X = XFLAG_CLEAR; + } + FLAG_N = NFLAG_8(res); /* officially undefined */ +} + + +void m68k_op_nbcd_8_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1()); + + if(res != 0x9a) + { + if((res & 0x0f) == 0xa) + res = (res & 0xf0) + 0x10; + + res = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, MASK_OUT_ABOVE_8(res)); + + FLAG_Z |= res; + FLAG_C = CFLAG_SET; + FLAG_X = XFLAG_SET; + } + else + { + FLAG_C = CFLAG_CLEAR; + FLAG_X = XFLAG_CLEAR; + } + FLAG_N = NFLAG_8(res); /* officially undefined */ +} + + +void m68k_op_nbcd_8_di(void) +{ + uint ea = EA_AY_DI_8(); + uint dst = m68ki_read_8(ea); + uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1()); + + if(res != 0x9a) + { + if((res & 0x0f) == 0xa) + res = (res & 0xf0) + 0x10; + + res = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, MASK_OUT_ABOVE_8(res)); + + FLAG_Z |= res; + FLAG_C = CFLAG_SET; + FLAG_X = XFLAG_SET; + } + else + { + FLAG_C = CFLAG_CLEAR; + FLAG_X = XFLAG_CLEAR; + } + FLAG_N = NFLAG_8(res); /* officially undefined */ +} + + +void m68k_op_nbcd_8_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint dst = m68ki_read_8(ea); + uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1()); + + if(res != 0x9a) + { + if((res & 0x0f) == 0xa) + res = (res & 0xf0) + 0x10; + + res = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, MASK_OUT_ABOVE_8(res)); + + FLAG_Z |= res; + FLAG_C = CFLAG_SET; + FLAG_X = XFLAG_SET; + } + else + { + FLAG_C = CFLAG_CLEAR; + FLAG_X = XFLAG_CLEAR; + } + FLAG_N = NFLAG_8(res); /* officially undefined */ +} + + +void m68k_op_nbcd_8_aw(void) +{ + uint ea = EA_AW_8(); + uint dst = m68ki_read_8(ea); + uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1()); + + if(res != 0x9a) + { + if((res & 0x0f) == 0xa) + res = (res & 0xf0) + 0x10; + + res = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, MASK_OUT_ABOVE_8(res)); + + FLAG_Z |= res; + FLAG_C = CFLAG_SET; + FLAG_X = XFLAG_SET; + } + else + { + FLAG_C = CFLAG_CLEAR; + FLAG_X = XFLAG_CLEAR; + } + FLAG_N = NFLAG_8(res); /* officially undefined */ +} + + +void m68k_op_nbcd_8_al(void) +{ + uint ea = EA_AL_8(); + uint dst = m68ki_read_8(ea); + uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1()); + + if(res != 0x9a) + { + if((res & 0x0f) == 0xa) + res = (res & 0xf0) + 0x10; + + res = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, MASK_OUT_ABOVE_8(res)); + + FLAG_Z |= res; + FLAG_C = CFLAG_SET; + FLAG_X = XFLAG_SET; + } + else + { + FLAG_C = CFLAG_CLEAR; + FLAG_X = XFLAG_CLEAR; + } + FLAG_N = NFLAG_8(res); /* officially undefined */ +} + + +void m68k_op_neg_8_d(void) +{ + uint* r_dst = &DY; + uint res = 0 - MASK_OUT_ABOVE_8(*r_dst); + + FLAG_N = NFLAG_8(res); + FLAG_C = FLAG_X = CFLAG_8(res); + FLAG_V = *r_dst & res; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_neg_8_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_8(res); + FLAG_C = FLAG_X = CFLAG_8(res); + FLAG_V = src & res; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_neg_8_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_8(res); + FLAG_C = FLAG_X = CFLAG_8(res); + FLAG_V = src & res; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_neg_8_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_8(res); + FLAG_C = FLAG_X = CFLAG_8(res); + FLAG_V = src & res; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_neg_8_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_8(res); + FLAG_C = FLAG_X = CFLAG_8(res); + FLAG_V = src & res; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_neg_8_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_8(res); + FLAG_C = FLAG_X = CFLAG_8(res); + FLAG_V = src & res; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_neg_8_di(void) +{ + uint ea = EA_AY_DI_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_8(res); + FLAG_C = FLAG_X = CFLAG_8(res); + FLAG_V = src & res; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_neg_8_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_8(res); + FLAG_C = FLAG_X = CFLAG_8(res); + FLAG_V = src & res; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_neg_8_aw(void) +{ + uint ea = EA_AW_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_8(res); + FLAG_C = FLAG_X = CFLAG_8(res); + FLAG_V = src & res; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_neg_8_al(void) +{ + uint ea = EA_AL_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_8(res); + FLAG_C = FLAG_X = CFLAG_8(res); + FLAG_V = src & res; + FLAG_Z = MASK_OUT_ABOVE_8(res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_neg_16_d(void) +{ + uint* r_dst = &DY; + uint res = 0 - MASK_OUT_ABOVE_16(*r_dst); + + FLAG_N = NFLAG_16(res); + FLAG_C = FLAG_X = CFLAG_16(res); + FLAG_V = (*r_dst & res)>>8; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_neg_16_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_16(res); + FLAG_C = FLAG_X = CFLAG_16(res); + FLAG_V = (src & res)>>8; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_neg_16_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_16(res); + FLAG_C = FLAG_X = CFLAG_16(res); + FLAG_V = (src & res)>>8; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_neg_16_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_16(res); + FLAG_C = FLAG_X = CFLAG_16(res); + FLAG_V = (src & res)>>8; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_neg_16_di(void) +{ + uint ea = EA_AY_DI_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_16(res); + FLAG_C = FLAG_X = CFLAG_16(res); + FLAG_V = (src & res)>>8; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_neg_16_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_16(res); + FLAG_C = FLAG_X = CFLAG_16(res); + FLAG_V = (src & res)>>8; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_neg_16_aw(void) +{ + uint ea = EA_AW_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_16(res); + FLAG_C = FLAG_X = CFLAG_16(res); + FLAG_V = (src & res)>>8; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_neg_16_al(void) +{ + uint ea = EA_AL_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_16(res); + FLAG_C = FLAG_X = CFLAG_16(res); + FLAG_V = (src & res)>>8; + FLAG_Z = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_neg_32_d(void) +{ + uint* r_dst = &DY; + uint res = 0 - *r_dst; + + FLAG_N = NFLAG_32(res); + FLAG_C = FLAG_X = CFLAG_SUB_32(*r_dst, 0, res); + FLAG_V = (*r_dst & res)>>24; + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_neg_32_ai(void) +{ + uint ea = EA_AY_AI_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_32(res); + FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_neg_32_pi(void) +{ + uint ea = EA_AY_PI_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_32(res); + FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_neg_32_pd(void) +{ + uint ea = EA_AY_PD_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_32(res); + FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_neg_32_di(void) +{ + uint ea = EA_AY_DI_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_32(res); + FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_neg_32_ix(void) +{ + uint ea = EA_AY_IX_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_32(res); + FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_neg_32_aw(void) +{ + uint ea = EA_AW_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_32(res); + FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_neg_32_al(void) +{ + uint ea = EA_AL_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - src; + + FLAG_N = NFLAG_32(res); + FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + FLAG_Z = MASK_OUT_ABOVE_32(res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_negx_8_d(void) +{ + uint* r_dst = &DY; + uint res = 0 - MASK_OUT_ABOVE_8(*r_dst) - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = *r_dst & res; + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; +} + + +void m68k_op_negx_8_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = src & res; + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_negx_8_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = src & res; + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_negx_8_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = src & res; + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_negx_8_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = src & res; + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_negx_8_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = src & res; + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_negx_8_di(void) +{ + uint ea = EA_AY_DI_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = src & res; + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_negx_8_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = src & res; + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_negx_8_aw(void) +{ + uint ea = EA_AW_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = src & res; + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_negx_8_al(void) +{ + uint ea = EA_AL_8(); + uint src = m68ki_read_8(ea); + uint res = 0 - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = src & res; + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_negx_16_d(void) +{ + uint* r_dst = &DY; + uint res = 0 - MASK_OUT_ABOVE_16(*r_dst) - XFLAG_AS_1(); + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = (*r_dst & res)>>8; + + res = MASK_OUT_ABOVE_16(res); + FLAG_Z |= res; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; +} + + +void m68k_op_negx_16_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = (src & res)>>8; + + res = MASK_OUT_ABOVE_16(res); + FLAG_Z |= res; + + m68ki_write_16(ea, res); +} + + +void m68k_op_negx_16_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = (src & res)>>8; + + res = MASK_OUT_ABOVE_16(res); + FLAG_Z |= res; + + m68ki_write_16(ea, res); +} + + +void m68k_op_negx_16_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = (src & res)>>8; + + res = MASK_OUT_ABOVE_16(res); + FLAG_Z |= res; + + m68ki_write_16(ea, res); +} + + +void m68k_op_negx_16_di(void) +{ + uint ea = EA_AY_DI_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = (src & res)>>8; + + res = MASK_OUT_ABOVE_16(res); + FLAG_Z |= res; + + m68ki_write_16(ea, res); +} + + +void m68k_op_negx_16_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = (src & res)>>8; + + res = MASK_OUT_ABOVE_16(res); + FLAG_Z |= res; + + m68ki_write_16(ea, res); +} + + +void m68k_op_negx_16_aw(void) +{ + uint ea = EA_AW_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = (src & res)>>8; + + res = MASK_OUT_ABOVE_16(res); + FLAG_Z |= res; + + m68ki_write_16(ea, res); +} + + +void m68k_op_negx_16_al(void) +{ + uint ea = EA_AL_16(); + uint src = m68ki_read_16(ea); + uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = (src & res)>>8; + + res = MASK_OUT_ABOVE_16(res); + FLAG_Z |= res; + + m68ki_write_16(ea, res); +} + + +void m68k_op_negx_32_d(void) +{ + uint* r_dst = &DY; + uint res = 0 - MASK_OUT_ABOVE_32(*r_dst) - XFLAG_AS_1(); + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(*r_dst, 0, res); + FLAG_V = (*r_dst & res)>>24; + + res = MASK_OUT_ABOVE_32(res); + FLAG_Z |= res; + + *r_dst = res; +} + + +void m68k_op_negx_32_ai(void) +{ + uint ea = EA_AY_AI_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + + res = MASK_OUT_ABOVE_32(res); + FLAG_Z |= res; + + m68ki_write_32(ea, res); +} + + +void m68k_op_negx_32_pi(void) +{ + uint ea = EA_AY_PI_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + + res = MASK_OUT_ABOVE_32(res); + FLAG_Z |= res; + + m68ki_write_32(ea, res); +} + + +void m68k_op_negx_32_pd(void) +{ + uint ea = EA_AY_PD_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + + res = MASK_OUT_ABOVE_32(res); + FLAG_Z |= res; + + m68ki_write_32(ea, res); +} + + +void m68k_op_negx_32_di(void) +{ + uint ea = EA_AY_DI_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + + res = MASK_OUT_ABOVE_32(res); + FLAG_Z |= res; + + m68ki_write_32(ea, res); +} + + +void m68k_op_negx_32_ix(void) +{ + uint ea = EA_AY_IX_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + + res = MASK_OUT_ABOVE_32(res); + FLAG_Z |= res; + + m68ki_write_32(ea, res); +} + + +void m68k_op_negx_32_aw(void) +{ + uint ea = EA_AW_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + + res = MASK_OUT_ABOVE_32(res); + FLAG_Z |= res; + + m68ki_write_32(ea, res); +} + + +void m68k_op_negx_32_al(void) +{ + uint ea = EA_AL_32(); + uint src = m68ki_read_32(ea); + uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1(); + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res); + FLAG_V = (src & res)>>24; + + res = MASK_OUT_ABOVE_32(res); + FLAG_Z |= res; + + m68ki_write_32(ea, res); +} + + +void m68k_op_nop(void) +{ + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ +} + + +void m68k_op_not_8_d(void) +{ + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_8(~*r_dst); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_8_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_8_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_8_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_8_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_8_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_8_di(void) +{ + uint ea = EA_AY_DI_8(); + uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_8_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_8_aw(void) +{ + uint ea = EA_AW_8(); + uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_8_al(void) +{ + uint ea = EA_AL_8(); + uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_16_d(void) +{ + uint* r_dst = &DY; + uint res = MASK_OUT_ABOVE_16(~*r_dst); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_16_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_16_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_16_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_16_di(void) +{ + uint ea = EA_AY_DI_16(); + uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_16_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_16_aw(void) +{ + uint ea = EA_AW_16(); + uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_16_al(void) +{ + uint ea = EA_AL_16(); + uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_32_d(void) +{ + uint* r_dst = &DY; + uint res = *r_dst = MASK_OUT_ABOVE_32(~*r_dst); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_32_ai(void) +{ + uint ea = EA_AY_AI_32(); + uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea)); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_32_pi(void) +{ + uint ea = EA_AY_PI_32(); + uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea)); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_32_pd(void) +{ + uint ea = EA_AY_PD_32(); + uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea)); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_32_di(void) +{ + uint ea = EA_AY_DI_32(); + uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea)); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_32_ix(void) +{ + uint ea = EA_AY_IX_32(); + uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea)); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_32_aw(void) +{ + uint ea = EA_AW_32(); + uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea)); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_not_32_al(void) +{ + uint ea = EA_AL_32(); + uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea)); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_d(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= MASK_OUT_ABOVE_8(DY))); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_ai(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= OPER_AY_AI_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_pi(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= OPER_AY_PI_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_pi7(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= OPER_A7_PI_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_pd(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= OPER_AY_PD_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_pd7(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= OPER_A7_PD_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_di(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= OPER_AY_DI_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_ix(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= OPER_AY_IX_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_aw(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= OPER_AW_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_al(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= OPER_AL_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_pcdi(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= OPER_PCDI_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_pcix(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= OPER_PCIX_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_er_i(void) +{ + uint res = MASK_OUT_ABOVE_8((DX |= OPER_I_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_er_d(void) +{ + uint res = MASK_OUT_ABOVE_16((DX |= MASK_OUT_ABOVE_16(DY))); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_er_ai(void) +{ + uint res = MASK_OUT_ABOVE_16((DX |= OPER_AY_AI_16())); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_er_pi(void) +{ + uint res = MASK_OUT_ABOVE_16((DX |= OPER_AY_PI_16())); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_er_pd(void) +{ + uint res = MASK_OUT_ABOVE_16((DX |= OPER_AY_PD_16())); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_er_di(void) +{ + uint res = MASK_OUT_ABOVE_16((DX |= OPER_AY_DI_16())); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_er_ix(void) +{ + uint res = MASK_OUT_ABOVE_16((DX |= OPER_AY_IX_16())); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_er_aw(void) +{ + uint res = MASK_OUT_ABOVE_16((DX |= OPER_AW_16())); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_er_al(void) +{ + uint res = MASK_OUT_ABOVE_16((DX |= OPER_AL_16())); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_er_pcdi(void) +{ + uint res = MASK_OUT_ABOVE_16((DX |= OPER_PCDI_16())); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_er_pcix(void) +{ + uint res = MASK_OUT_ABOVE_16((DX |= OPER_PCIX_16())); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_er_i(void) +{ + uint res = MASK_OUT_ABOVE_16((DX |= OPER_I_16())); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_er_d(void) +{ + uint res = DX |= DY; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_er_ai(void) +{ + uint res = DX |= OPER_AY_AI_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_er_pi(void) +{ + uint res = DX |= OPER_AY_PI_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_er_pd(void) +{ + uint res = DX |= OPER_AY_PD_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_er_di(void) +{ + uint res = DX |= OPER_AY_DI_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_er_ix(void) +{ + uint res = DX |= OPER_AY_IX_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_er_aw(void) +{ + uint res = DX |= OPER_AW_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_er_al(void) +{ + uint res = DX |= OPER_AL_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_er_pcdi(void) +{ + uint res = DX |= OPER_PCDI_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_er_pcix(void) +{ + uint res = DX |= OPER_PCIX_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_er_i(void) +{ + uint res = DX |= OPER_I_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_re_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_re_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_re_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_re_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_re_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_re_di(void) +{ + uint ea = EA_AY_DI_8(); + uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_re_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_re_aw(void) +{ + uint ea = EA_AW_8(); + uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_8_re_al(void) +{ + uint ea = EA_AL_8(); + uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_re_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_re_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_re_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_re_di(void) +{ + uint ea = EA_AY_DI_16(); + uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_re_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_re_aw(void) +{ + uint ea = EA_AW_16(); + uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_16_re_al(void) +{ + uint ea = EA_AL_16(); + uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_re_ai(void) +{ + uint ea = EA_AY_AI_32(); + uint res = DX | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_re_pi(void) +{ + uint ea = EA_AY_PI_32(); + uint res = DX | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_re_pd(void) +{ + uint ea = EA_AY_PD_32(); + uint res = DX | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_re_di(void) +{ + uint ea = EA_AY_DI_32(); + uint res = DX | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_re_ix(void) +{ + uint ea = EA_AY_IX_32(); + uint res = DX | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_re_aw(void) +{ + uint ea = EA_AW_32(); + uint res = DX | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_or_32_re_al(void) +{ + uint ea = EA_AL_32(); + uint res = DX | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_8_d(void) +{ + uint res = MASK_OUT_ABOVE_8((DY |= OPER_I_8())); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_8_ai(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_AI_8(); + uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_8_pi(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_PI_8(); + uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_8_pi7(void) +{ + uint src = OPER_I_8(); + uint ea = EA_A7_PI_8(); + uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_8_pd(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_PD_8(); + uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_8_pd7(void) +{ + uint src = OPER_I_8(); + uint ea = EA_A7_PD_8(); + uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_8_di(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_DI_8(); + uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_8_ix(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_IX_8(); + uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_8_aw(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AW_8(); + uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_8_al(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AL_8(); + uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea)); + + m68ki_write_8(ea, res); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_16_d(void) +{ + uint res = MASK_OUT_ABOVE_16(DY |= OPER_I_16()); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_16_ai(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_AI_16(); + uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_16_pi(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_PI_16(); + uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_16_pd(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_PD_16(); + uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_16_di(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_DI_16(); + uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_16_ix(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_IX_16(); + uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_16_aw(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AW_16(); + uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_16_al(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AL_16(); + uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_32_d(void) +{ + uint res = DY |= OPER_I_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_32_ai(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_AI_32(); + uint res = src | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_32_pi(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_PI_32(); + uint res = src | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_32_pd(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_PD_32(); + uint res = src | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_32_di(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_DI_32(); + uint res = src | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_32_ix(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_IX_32(); + uint res = src | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_32_aw(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AW_32(); + uint res = src | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_32_al(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AL_32(); + uint res = src | m68ki_read_32(ea); + + m68ki_write_32(ea, res); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ori_16_toc(void) +{ + m68ki_set_ccr(m68ki_get_ccr() | OPER_I_16()); +} + + +void m68k_op_ori_16_tos(void) +{ + if(FLAG_S) + { + uint src = OPER_I_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_sr(m68ki_get_sr() | src); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_pack_16_rr(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + /* Note: DX and DY are reversed in Motorola's docs */ + uint src = DY + OPER_I_16(); + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | ((src >> 4) & 0x00f0) | (src & 0x000f); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_pack_16_mm_ax7(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + /* Note: AX and AY are reversed in Motorola's docs */ + uint ea_src = EA_AY_PD_8(); + uint src = m68ki_read_8(ea_src); + ea_src = EA_AY_PD_8(); + src = ((src << 8) | m68ki_read_8(ea_src)) + OPER_I_16(); + + m68ki_write_8(EA_A7_PD_8(), ((src >> 4) & 0x00f0) | (src & 0x000f)); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_pack_16_mm_ay7(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + /* Note: AX and AY are reversed in Motorola's docs */ + uint ea_src = EA_A7_PD_8(); + uint src = m68ki_read_8(ea_src); + ea_src = EA_A7_PD_8(); + src = ((src << 8) | m68ki_read_8(ea_src)) + OPER_I_16(); + + m68ki_write_8(EA_AX_PD_8(), ((src >> 4) & 0x00f0) | (src & 0x000f)); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_pack_16_mm_axy7(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint ea_src = EA_A7_PD_8(); + uint src = m68ki_read_8(ea_src); + ea_src = EA_A7_PD_8(); + src = ((src << 8) | m68ki_read_8(ea_src)) + OPER_I_16(); + + m68ki_write_8(EA_A7_PD_8(), ((src >> 4) & 0x00f0) | (src & 0x000f)); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_pack_16_mm(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + /* Note: AX and AY are reversed in Motorola's docs */ + uint ea_src = EA_AY_PD_8(); + uint src = m68ki_read_8(ea_src); + ea_src = EA_AY_PD_8(); + src = ((src << 8) | m68ki_read_8(ea_src)) + OPER_I_16(); + + m68ki_write_8(EA_AX_PD_8(), ((src >> 4) & 0x00f0) | (src & 0x000f)); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_pea_32_ai(void) +{ + uint ea = EA_AY_AI_32(); + + m68ki_push_32(ea); +} + + +void m68k_op_pea_32_di(void) +{ + uint ea = EA_AY_DI_32(); + + m68ki_push_32(ea); +} + + +void m68k_op_pea_32_ix(void) +{ + uint ea = EA_AY_IX_32(); + + m68ki_push_32(ea); +} + + +void m68k_op_pea_32_aw(void) +{ + uint ea = EA_AW_32(); + + m68ki_push_32(ea); +} + + +void m68k_op_pea_32_al(void) +{ + uint ea = EA_AL_32(); + + m68ki_push_32(ea); +} + + +void m68k_op_pea_32_pcdi(void) +{ + uint ea = EA_PCDI_32(); + + m68ki_push_32(ea); +} + + +void m68k_op_pea_32_pcix(void) +{ + uint ea = EA_PCIX_32(); + + m68ki_push_32(ea); +} + + +void m68k_op_reset(void) +{ + if(FLAG_S) + { + m68ki_output_reset(); /* auto-disable (see m68kcpu.h) */ + USE_CYCLES(CYC_RESET); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_ror_8_s(void) +{ + uint* r_dst = &DY; + uint orig_shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint shift = orig_shift & 7; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = ROR_8(src, shift); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = src << (9-orig_shift); + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ror_16_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_16(*r_dst); + uint res = ROR_16(src, shift); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src << (9-shift); + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ror_32_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint64 src = *r_dst; + uint res = ROR_32(src, shift); + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = src << (9-shift); + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ror_8_r(void) +{ + uint* r_dst = &DY; + uint orig_shift = DX & 0x3f; + uint shift = orig_shift & 7; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = ROR_8(src, shift); + + if(orig_shift != 0) + { + USE_CYCLES(orig_shift<> ((shift - 1) & 15)) << 8; + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_16(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ror_32_r(void) +{ + uint* r_dst = &DY; + uint orig_shift = DX & 0x3f; + uint shift = orig_shift & 31; + uint64 src = *r_dst; + uint res = ROR_32(src, shift); + + if(orig_shift != 0) + { + USE_CYCLES(orig_shift<> ((shift - 1) & 31)) << 8; + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_32(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ror_16_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_16(src, 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ror_16_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_16(src, 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ror_16_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_16(src, 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ror_16_di(void) +{ + uint ea = EA_AY_DI_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_16(src, 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ror_16_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_16(src, 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ror_16_aw(void) +{ + uint ea = EA_AW_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_16(src, 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_ror_16_al(void) +{ + uint ea = EA_AL_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_16(src, 1); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src << 8; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rol_8_s(void) +{ + uint* r_dst = &DY; + uint orig_shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint shift = orig_shift & 7; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = ROL_8(src, shift); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_C = src << orig_shift; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rol_16_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_16(*r_dst); + uint res = ROL_16(src, shift); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src >> (8-shift); + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rol_32_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint64 src = *r_dst; + uint res = ROL_32(src, shift); + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_C = src >> (24-shift); + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rol_8_r(void) +{ + uint* r_dst = &DY; + uint orig_shift = DX & 0x3f; + uint shift = orig_shift & 7; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = ROL_8(src, shift); + + if(orig_shift != 0) + { + USE_CYCLES(orig_shift<> 8; + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + FLAG_C = (src & 1)<<8; + FLAG_N = NFLAG_16(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_16(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rol_32_r(void) +{ + uint* r_dst = &DY; + uint orig_shift = DX & 0x3f; + uint shift = orig_shift & 31; + uint64 src = *r_dst; + uint res = ROL_32(src, shift); + + if(orig_shift != 0) + { + USE_CYCLES(orig_shift<> (32 - shift)) << 8; + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = CFLAG_CLEAR; + FLAG_N = NFLAG_32(src); + FLAG_Z = src; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rol_16_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rol_16_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rol_16_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rol_16_di(void) +{ + uint ea = EA_AY_DI_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rol_16_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rol_16_aw(void) +{ + uint ea = EA_AW_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rol_16_al(void) +{ + uint ea = EA_AL_16(); + uint src = m68ki_read_16(ea); + uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1)); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_C = src >> 7; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxr_8_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = ROR_9(src | (XFLAG_AS_1() << 8), shift); + + FLAG_C = FLAG_X = res; + res = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxr_16_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_16(*r_dst); + uint res = ROR_17(src | (XFLAG_AS_1() << 16), shift); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxr_32_s(void) +{ +#if M68K_USE_64_BIT + + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint64 src = *r_dst; + uint64 res = src | (((uint64)XFLAG_AS_1()) << 32); + + res = ROR_33_64(res, shift); + + FLAG_C = FLAG_X = res >> 24; + res = MASK_OUT_ABOVE_32(res); + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + +#else + + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = *r_dst; + uint res = MASK_OUT_ABOVE_32((ROR_33(src, shift) & ~(1 << (32 - shift))) | (XFLAG_AS_1() << (32 - shift))); + uint new_x_flag = src & (1 << (shift - 1)); + + *r_dst = res; + + FLAG_C = FLAG_X = (new_x_flag != 0)<<8; + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + +#endif +} + + +void m68k_op_roxr_8_r(void) +{ + uint* r_dst = &DY; + uint orig_shift = DX & 0x3f; + + if(orig_shift != 0) + { + uint shift = orig_shift % 9; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = ROR_9(src | (XFLAG_AS_1() << 8), shift); + + USE_CYCLES(orig_shift<> 8; + res = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = FLAG_X; + FLAG_N = NFLAG_16(*r_dst); + FLAG_Z = MASK_OUT_ABOVE_16(*r_dst); + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxr_32_r(void) +{ +#if M68K_USE_64_BIT + + uint* r_dst = &DY; + uint orig_shift = DX & 0x3f; + + if(orig_shift != 0) + { + uint shift = orig_shift % 33; + uint64 src = *r_dst; + uint64 res = src | (((uint64)XFLAG_AS_1()) << 32); + + res = ROR_33_64(res, shift); + + USE_CYCLES(orig_shift<> 24; + res = MASK_OUT_ABOVE_32(res); + + *r_dst = res; + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = FLAG_X; + FLAG_N = NFLAG_32(*r_dst); + FLAG_Z = *r_dst; + FLAG_V = VFLAG_CLEAR; + +#else + + uint* r_dst = &DY; + uint orig_shift = DX & 0x3f; + uint shift = orig_shift % 33; + uint src = *r_dst; + uint res = MASK_OUT_ABOVE_32((ROR_33(src, shift) & ~(1 << (32 - shift))) | (XFLAG_AS_1() << (32 - shift))); + uint new_x_flag = src & (1 << (shift - 1)); + + if(orig_shift != 0) + USE_CYCLES(orig_shift<> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxr_16_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxr_16_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxr_16_di(void) +{ + uint ea = EA_AY_DI_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxr_16_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxr_16_aw(void) +{ + uint ea = EA_AW_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxr_16_al(void) +{ + uint ea = EA_AL_16(); + uint src = m68ki_read_16(ea); + uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxl_8_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = ROL_9(src | (XFLAG_AS_1() << 8), shift); + + FLAG_C = FLAG_X = res; + res = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxl_16_s(void) +{ + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = MASK_OUT_ABOVE_16(*r_dst); + uint res = ROL_17(src | (XFLAG_AS_1() << 16), shift); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxl_32_s(void) +{ +#if M68K_USE_64_BIT + + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint64 src = *r_dst; + uint64 res = src | (((uint64)XFLAG_AS_1()) << 32); + + res = ROL_33_64(res, shift); + + FLAG_C = FLAG_X = res >> 24; + res = MASK_OUT_ABOVE_32(res); + + *r_dst = res; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + +#else + + uint* r_dst = &DY; + uint shift = (((REG_IR >> 9) - 1) & 7) + 1; + uint src = *r_dst; + uint res = MASK_OUT_ABOVE_32((ROL_33(src, shift) & ~(1 << (shift - 1))) | (XFLAG_AS_1() << (shift - 1))); + uint new_x_flag = src & (1 << (32 - shift)); + + *r_dst = res; + + FLAG_C = FLAG_X = (new_x_flag != 0)<<8; + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + +#endif +} + + +void m68k_op_roxl_8_r(void) +{ + uint* r_dst = &DY; + uint orig_shift = DX & 0x3f; + + + if(orig_shift != 0) + { + uint shift = orig_shift % 9; + uint src = MASK_OUT_ABOVE_8(*r_dst); + uint res = ROL_9(src | (XFLAG_AS_1() << 8), shift); + + USE_CYCLES(orig_shift<> 8; + res = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = FLAG_X; + FLAG_N = NFLAG_16(*r_dst); + FLAG_Z = MASK_OUT_ABOVE_16(*r_dst); + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxl_32_r(void) +{ +#if M68K_USE_64_BIT + + uint* r_dst = &DY; + uint orig_shift = DX & 0x3f; + + if(orig_shift != 0) + { + uint shift = orig_shift % 33; + uint64 src = *r_dst; + uint64 res = src | (((uint64)XFLAG_AS_1()) << 32); + + res = ROL_33_64(res, shift); + + USE_CYCLES(orig_shift<> 24; + res = MASK_OUT_ABOVE_32(res); + + *r_dst = res; + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + return; + } + + FLAG_C = FLAG_X; + FLAG_N = NFLAG_32(*r_dst); + FLAG_Z = *r_dst; + FLAG_V = VFLAG_CLEAR; + +#else + + uint* r_dst = &DY; + uint orig_shift = DX & 0x3f; + uint shift = orig_shift % 33; + uint src = *r_dst; + uint res = MASK_OUT_ABOVE_32((ROL_33(src, shift) & ~(1 << (shift - 1))) | (XFLAG_AS_1() << (shift - 1))); + uint new_x_flag = src & (1 << (32 - shift)); + + if(orig_shift != 0) + USE_CYCLES(orig_shift<> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxl_16_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint src = m68ki_read_16(ea); + uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxl_16_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint src = m68ki_read_16(ea); + uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxl_16_di(void) +{ + uint ea = EA_AY_DI_16(); + uint src = m68ki_read_16(ea); + uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxl_16_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint src = m68ki_read_16(ea); + uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxl_16_aw(void) +{ + uint ea = EA_AW_16(); + uint src = m68ki_read_16(ea); + uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_roxl_16_al(void) +{ + uint ea = EA_AL_16(); + uint src = m68ki_read_16(ea); + uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1); + + FLAG_C = FLAG_X = res >> 8; + res = MASK_OUT_ABOVE_16(res); + + m68ki_write_16(ea, res); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_rtd_32(void) +{ + if(CPU_TYPE_IS_010_PLUS(CPU_TYPE)) + { + uint new_pc = m68ki_pull_32(); + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + REG_A[7] = MASK_OUT_ABOVE_32(REG_A[7] + MAKE_INT_16(OPER_I_16())); + m68ki_jump(new_pc); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_rte_32(void) +{ + if(FLAG_S) + { + uint new_sr; + uint new_pc; + uint format_word; + + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + + if(CPU_TYPE_IS_000(CPU_TYPE)) + { + new_sr = m68ki_pull_16(); + new_pc = m68ki_pull_32(); + m68ki_jump(new_pc); + m68ki_set_sr(new_sr); + return; + } + + if(CPU_TYPE_IS_010(CPU_TYPE)) + { + format_word = m68ki_read_16(REG_A[7]+6) >> 12; + if(format_word == 0) + { + new_sr = m68ki_pull_16(); + new_pc = m68ki_pull_32(); + m68ki_fake_pull_16(); /* format word */ + m68ki_jump(new_pc); + m68ki_set_sr(new_sr); + return; + } + /* Not handling bus fault (9) */ + m68ki_exception_format_error(); + return; + } + + /* Otherwise it's 020 */ +rte_loop: + format_word = m68ki_read_16(REG_A[7]+6) >> 12; + switch(format_word) + { + case 0: /* Normal */ + new_sr = m68ki_pull_16(); + new_pc = m68ki_pull_32(); + m68ki_fake_pull_16(); /* format word */ + m68ki_jump(new_pc); + m68ki_set_sr(new_sr); + return; + case 1: /* Throwaway */ + new_sr = m68ki_pull_16(); + m68ki_fake_pull_32(); /* program counter */ + m68ki_fake_pull_16(); /* format word */ + m68ki_set_sr_noint(new_sr); + goto rte_loop; + case 2: /* Trap */ + new_sr = m68ki_pull_16(); + new_pc = m68ki_pull_32(); + m68ki_fake_pull_16(); /* format word */ + m68ki_fake_pull_32(); /* address */ + m68ki_jump(new_pc); + m68ki_set_sr(new_sr); + return; + } + /* Not handling long or short bus fault */ + m68ki_exception_format_error(); + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_rtm_32(void) +{ + if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE)) + { + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", + m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR, + m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2)))); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_rtr_32(void) +{ + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_set_ccr(m68ki_pull_16()); + m68ki_jump(m68ki_pull_32()); +} + + +void m68k_op_rts_32(void) +{ + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + m68ki_jump(m68ki_pull_32()); +} + + +void m68k_op_sbcd_8_rr(void) +{ + uint* r_dst = &DX; + uint src = DY; + uint dst = *r_dst; + uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(); + + if(res > 9) + res -= 6; + res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src); + FLAG_X = FLAG_C = (res > 0x99) << 8; + if(FLAG_C) + res += 0xa0; + + res = MASK_OUT_ABOVE_8(res); + + FLAG_N = NFLAG_8(res); /* officially undefined */ + FLAG_Z |= res; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; +} + + +void m68k_op_sbcd_8_mm_ax7(void) +{ + uint src = OPER_AY_PD_8(); + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(); + + if(res > 9) + res -= 6; + res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src); + FLAG_X = FLAG_C = (res > 0x99) << 8; + if(FLAG_C) + res += 0xa0; + + res = MASK_OUT_ABOVE_8(res); + + FLAG_N = NFLAG_8(res); /* officially undefined */ + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_sbcd_8_mm_ay7(void) +{ + uint src = OPER_A7_PD_8(); + uint ea = EA_AX_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(); + + if(res > 9) + res -= 6; + res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src); + FLAG_X = FLAG_C = (res > 0x99) << 8; + if(FLAG_C) + res += 0xa0; + + res = MASK_OUT_ABOVE_8(res); + + FLAG_N = NFLAG_8(res); /* officially undefined */ + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_sbcd_8_mm_axy7(void) +{ + uint src = OPER_A7_PD_8(); + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(); + + if(res > 9) + res -= 6; + res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src); + FLAG_X = FLAG_C = (res > 0x99) << 8; + if(FLAG_C) + res += 0xa0; + + res = MASK_OUT_ABOVE_8(res); + + FLAG_N = NFLAG_8(res); /* officially undefined */ + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_sbcd_8_mm(void) +{ + uint src = OPER_AY_PD_8(); + uint ea = EA_AX_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(); + + if(res > 9) + res -= 6; + res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src); + FLAG_X = FLAG_C = (res > 0x99) << 8; + if(FLAG_C) + res += 0xa0; + + res = MASK_OUT_ABOVE_8(res); + + FLAG_N = NFLAG_8(res); /* officially undefined */ + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_st_8_d(void) +{ + DY |= 0xff; +} + + +void m68k_op_st_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), 0xff); +} + + +void m68k_op_st_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), 0xff); +} + + +void m68k_op_st_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), 0xff); +} + + +void m68k_op_st_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), 0xff); +} + + +void m68k_op_st_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), 0xff); +} + + +void m68k_op_st_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), 0xff); +} + + +void m68k_op_st_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), 0xff); +} + + +void m68k_op_st_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), 0xff); +} + + +void m68k_op_st_8_al(void) +{ + m68ki_write_8(EA_AL_8(), 0xff); +} + + +void m68k_op_sf_8_d(void) +{ + DY &= 0xffffff00; +} + + +void m68k_op_sf_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), 0); +} + + +void m68k_op_sf_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), 0); +} + + +void m68k_op_sf_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), 0); +} + + +void m68k_op_sf_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), 0); +} + + +void m68k_op_sf_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), 0); +} + + +void m68k_op_sf_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), 0); +} + + +void m68k_op_sf_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), 0); +} + + +void m68k_op_sf_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), 0); +} + + +void m68k_op_sf_8_al(void) +{ + m68ki_write_8(EA_AL_8(), 0); +} + + +void m68k_op_shi_8_d(void) +{ + if(COND_HI()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_sls_8_d(void) +{ + if(COND_LS()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_scc_8_d(void) +{ + if(COND_CC()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_scs_8_d(void) +{ + if(COND_CS()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_sne_8_d(void) +{ + if(COND_NE()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_seq_8_d(void) +{ + if(COND_EQ()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_svc_8_d(void) +{ + if(COND_VC()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_svs_8_d(void) +{ + if(COND_VS()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_spl_8_d(void) +{ + if(COND_PL()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_smi_8_d(void) +{ + if(COND_MI()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_sge_8_d(void) +{ + if(COND_GE()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_slt_8_d(void) +{ + if(COND_LT()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_sgt_8_d(void) +{ + if(COND_GT()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_sle_8_d(void) +{ + if(COND_LE()) + { + DY |= 0xff; + return; + } + DY &= 0xffffff00; +} + + +void m68k_op_shi_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_HI() ? 0xff : 0); +} + + +void m68k_op_shi_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_HI() ? 0xff : 0); +} + + +void m68k_op_shi_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_HI() ? 0xff : 0); +} + + +void m68k_op_shi_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_HI() ? 0xff : 0); +} + + +void m68k_op_shi_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_HI() ? 0xff : 0); +} + + +void m68k_op_shi_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_HI() ? 0xff : 0); +} + + +void m68k_op_shi_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_HI() ? 0xff : 0); +} + + +void m68k_op_shi_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_HI() ? 0xff : 0); +} + + +void m68k_op_shi_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_HI() ? 0xff : 0); +} + + +void m68k_op_sls_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_LS() ? 0xff : 0); +} + + +void m68k_op_sls_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_LS() ? 0xff : 0); +} + + +void m68k_op_sls_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_LS() ? 0xff : 0); +} + + +void m68k_op_sls_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_LS() ? 0xff : 0); +} + + +void m68k_op_sls_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_LS() ? 0xff : 0); +} + + +void m68k_op_sls_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_LS() ? 0xff : 0); +} + + +void m68k_op_sls_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_LS() ? 0xff : 0); +} + + +void m68k_op_sls_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_LS() ? 0xff : 0); +} + + +void m68k_op_sls_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_LS() ? 0xff : 0); +} + + +void m68k_op_scc_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_CC() ? 0xff : 0); +} + + +void m68k_op_scc_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_CC() ? 0xff : 0); +} + + +void m68k_op_scc_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_CC() ? 0xff : 0); +} + + +void m68k_op_scc_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_CC() ? 0xff : 0); +} + + +void m68k_op_scc_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_CC() ? 0xff : 0); +} + + +void m68k_op_scc_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_CC() ? 0xff : 0); +} + + +void m68k_op_scc_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_CC() ? 0xff : 0); +} + + +void m68k_op_scc_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_CC() ? 0xff : 0); +} + + +void m68k_op_scc_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_CC() ? 0xff : 0); +} + + +void m68k_op_scs_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_CS() ? 0xff : 0); +} + + +void m68k_op_scs_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_CS() ? 0xff : 0); +} + + +void m68k_op_scs_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_CS() ? 0xff : 0); +} + + +void m68k_op_scs_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_CS() ? 0xff : 0); +} + + +void m68k_op_scs_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_CS() ? 0xff : 0); +} + + +void m68k_op_scs_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_CS() ? 0xff : 0); +} + + +void m68k_op_scs_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_CS() ? 0xff : 0); +} + + +void m68k_op_scs_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_CS() ? 0xff : 0); +} + + +void m68k_op_scs_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_CS() ? 0xff : 0); +} + + +void m68k_op_sne_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_NE() ? 0xff : 0); +} + + +void m68k_op_sne_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_NE() ? 0xff : 0); +} + + +void m68k_op_sne_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_NE() ? 0xff : 0); +} + + +void m68k_op_sne_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_NE() ? 0xff : 0); +} + + +void m68k_op_sne_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_NE() ? 0xff : 0); +} + + +void m68k_op_sne_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_NE() ? 0xff : 0); +} + + +void m68k_op_sne_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_NE() ? 0xff : 0); +} + + +void m68k_op_sne_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_NE() ? 0xff : 0); +} + + +void m68k_op_sne_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_NE() ? 0xff : 0); +} + + +void m68k_op_seq_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_EQ() ? 0xff : 0); +} + + +void m68k_op_seq_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_EQ() ? 0xff : 0); +} + + +void m68k_op_seq_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_EQ() ? 0xff : 0); +} + + +void m68k_op_seq_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_EQ() ? 0xff : 0); +} + + +void m68k_op_seq_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_EQ() ? 0xff : 0); +} + + +void m68k_op_seq_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_EQ() ? 0xff : 0); +} + + +void m68k_op_seq_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_EQ() ? 0xff : 0); +} + + +void m68k_op_seq_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_EQ() ? 0xff : 0); +} + + +void m68k_op_seq_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_EQ() ? 0xff : 0); +} + + +void m68k_op_svc_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_VC() ? 0xff : 0); +} + + +void m68k_op_svc_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_VC() ? 0xff : 0); +} + + +void m68k_op_svc_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_VC() ? 0xff : 0); +} + + +void m68k_op_svc_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_VC() ? 0xff : 0); +} + + +void m68k_op_svc_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_VC() ? 0xff : 0); +} + + +void m68k_op_svc_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_VC() ? 0xff : 0); +} + + +void m68k_op_svc_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_VC() ? 0xff : 0); +} + + +void m68k_op_svc_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_VC() ? 0xff : 0); +} + + +void m68k_op_svc_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_VC() ? 0xff : 0); +} + + +void m68k_op_svs_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_VS() ? 0xff : 0); +} + + +void m68k_op_svs_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_VS() ? 0xff : 0); +} + + +void m68k_op_svs_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_VS() ? 0xff : 0); +} + + +void m68k_op_svs_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_VS() ? 0xff : 0); +} + + +void m68k_op_svs_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_VS() ? 0xff : 0); +} + + +void m68k_op_svs_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_VS() ? 0xff : 0); +} + + +void m68k_op_svs_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_VS() ? 0xff : 0); +} + + +void m68k_op_svs_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_VS() ? 0xff : 0); +} + + +void m68k_op_svs_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_VS() ? 0xff : 0); +} + + +void m68k_op_spl_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_PL() ? 0xff : 0); +} + + +void m68k_op_spl_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_PL() ? 0xff : 0); +} + + +void m68k_op_spl_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_PL() ? 0xff : 0); +} + + +void m68k_op_spl_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_PL() ? 0xff : 0); +} + + +void m68k_op_spl_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_PL() ? 0xff : 0); +} + + +void m68k_op_spl_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_PL() ? 0xff : 0); +} + + +void m68k_op_spl_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_PL() ? 0xff : 0); +} + + +void m68k_op_spl_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_PL() ? 0xff : 0); +} + + +void m68k_op_spl_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_PL() ? 0xff : 0); +} + + +void m68k_op_smi_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_MI() ? 0xff : 0); +} + + +void m68k_op_smi_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_MI() ? 0xff : 0); +} + + +void m68k_op_smi_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_MI() ? 0xff : 0); +} + + +void m68k_op_smi_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_MI() ? 0xff : 0); +} + + +void m68k_op_smi_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_MI() ? 0xff : 0); +} + + +void m68k_op_smi_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_MI() ? 0xff : 0); +} + + +void m68k_op_smi_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_MI() ? 0xff : 0); +} + + +void m68k_op_smi_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_MI() ? 0xff : 0); +} + + +void m68k_op_smi_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_MI() ? 0xff : 0); +} + + +void m68k_op_sge_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_GE() ? 0xff : 0); +} + + +void m68k_op_sge_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_GE() ? 0xff : 0); +} + + +void m68k_op_sge_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_GE() ? 0xff : 0); +} + + +void m68k_op_sge_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_GE() ? 0xff : 0); +} + + +void m68k_op_sge_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_GE() ? 0xff : 0); +} + + +void m68k_op_sge_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_GE() ? 0xff : 0); +} + + +void m68k_op_sge_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_GE() ? 0xff : 0); +} + + +void m68k_op_sge_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_GE() ? 0xff : 0); +} + + +void m68k_op_sge_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_GE() ? 0xff : 0); +} + + +void m68k_op_slt_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_LT() ? 0xff : 0); +} + + +void m68k_op_slt_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_LT() ? 0xff : 0); +} + + +void m68k_op_slt_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_LT() ? 0xff : 0); +} + + +void m68k_op_slt_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_LT() ? 0xff : 0); +} + + +void m68k_op_slt_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_LT() ? 0xff : 0); +} + + +void m68k_op_slt_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_LT() ? 0xff : 0); +} + + +void m68k_op_slt_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_LT() ? 0xff : 0); +} + + +void m68k_op_slt_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_LT() ? 0xff : 0); +} + + +void m68k_op_slt_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_LT() ? 0xff : 0); +} + + +void m68k_op_sgt_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_GT() ? 0xff : 0); +} + + +void m68k_op_sgt_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_GT() ? 0xff : 0); +} + + +void m68k_op_sgt_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_GT() ? 0xff : 0); +} + + +void m68k_op_sgt_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_GT() ? 0xff : 0); +} + + +void m68k_op_sgt_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_GT() ? 0xff : 0); +} + + +void m68k_op_sgt_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_GT() ? 0xff : 0); +} + + +void m68k_op_sgt_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_GT() ? 0xff : 0); +} + + +void m68k_op_sgt_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_GT() ? 0xff : 0); +} + + +void m68k_op_sgt_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_GT() ? 0xff : 0); +} + + +void m68k_op_sle_8_ai(void) +{ + m68ki_write_8(EA_AY_AI_8(), COND_LE() ? 0xff : 0); +} + + +void m68k_op_sle_8_pi(void) +{ + m68ki_write_8(EA_AY_PI_8(), COND_LE() ? 0xff : 0); +} + + +void m68k_op_sle_8_pi7(void) +{ + m68ki_write_8(EA_A7_PI_8(), COND_LE() ? 0xff : 0); +} + + +void m68k_op_sle_8_pd(void) +{ + m68ki_write_8(EA_AY_PD_8(), COND_LE() ? 0xff : 0); +} + + +void m68k_op_sle_8_pd7(void) +{ + m68ki_write_8(EA_A7_PD_8(), COND_LE() ? 0xff : 0); +} + + +void m68k_op_sle_8_di(void) +{ + m68ki_write_8(EA_AY_DI_8(), COND_LE() ? 0xff : 0); +} + + +void m68k_op_sle_8_ix(void) +{ + m68ki_write_8(EA_AY_IX_8(), COND_LE() ? 0xff : 0); +} + + +void m68k_op_sle_8_aw(void) +{ + m68ki_write_8(EA_AW_8(), COND_LE() ? 0xff : 0); +} + + +void m68k_op_sle_8_al(void) +{ + m68ki_write_8(EA_AL_8(), COND_LE() ? 0xff : 0); +} + + +void m68k_op_stop(void) +{ + if(FLAG_S) + { + uint new_sr = OPER_I_16(); + m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ + CPU_STOPPED |= STOP_LEVEL_STOP; + m68ki_set_sr(new_sr); + m68ki_remaining_cycles = 0; + return; + } + m68ki_exception_privilege_violation(); +} + + +void m68k_op_sub_8_er_d(void) +{ + uint* r_dst = &DX; + uint src = MASK_OUT_ABOVE_8(DY); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_8_er_ai(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_AI_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_8_er_pi(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PI_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_8_er_pi7(void) +{ + uint* r_dst = &DX; + uint src = OPER_A7_PI_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_8_er_pd(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PD_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_8_er_pd7(void) +{ + uint* r_dst = &DX; + uint src = OPER_A7_PD_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_8_er_di(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_DI_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_8_er_ix(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_IX_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_8_er_aw(void) +{ + uint* r_dst = &DX; + uint src = OPER_AW_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_8_er_al(void) +{ + uint* r_dst = &DX; + uint src = OPER_AL_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_8_er_pcdi(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCDI_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_8_er_pcix(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCIX_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_8_er_i(void) +{ + uint* r_dst = &DX; + uint src = OPER_I_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_16_er_d(void) +{ + uint* r_dst = &DX; + uint src = MASK_OUT_ABOVE_16(DY); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_16_er_a(void) +{ + uint* r_dst = &DX; + uint src = MASK_OUT_ABOVE_16(AY); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_16_er_ai(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_AI_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_16_er_pi(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PI_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_16_er_pd(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PD_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_16_er_di(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_DI_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_16_er_ix(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_IX_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_16_er_aw(void) +{ + uint* r_dst = &DX; + uint src = OPER_AW_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_16_er_al(void) +{ + uint* r_dst = &DX; + uint src = OPER_AL_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_16_er_pcdi(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCDI_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_16_er_pcix(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCIX_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_16_er_i(void) +{ + uint* r_dst = &DX; + uint src = OPER_I_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_sub_32_er_d(void) +{ + uint* r_dst = &DX; + uint src = DY; + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_sub_32_er_a(void) +{ + uint* r_dst = &DX; + uint src = AY; + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_sub_32_er_ai(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_AI_32(); + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_sub_32_er_pi(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PI_32(); + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_sub_32_er_pd(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_PD_32(); + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_sub_32_er_di(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_DI_32(); + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_sub_32_er_ix(void) +{ + uint* r_dst = &DX; + uint src = OPER_AY_IX_32(); + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_sub_32_er_aw(void) +{ + uint* r_dst = &DX; + uint src = OPER_AW_32(); + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_sub_32_er_al(void) +{ + uint* r_dst = &DX; + uint src = OPER_AL_32(); + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_sub_32_er_pcdi(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCDI_32(); + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_sub_32_er_pcix(void) +{ + uint* r_dst = &DX; + uint src = OPER_PCIX_32(); + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_sub_32_er_i(void) +{ + uint* r_dst = &DX; + uint src = OPER_I_32(); + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_sub_8_re_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_sub_8_re_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_sub_8_re_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_sub_8_re_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_sub_8_re_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_sub_8_re_di(void) +{ + uint ea = EA_AY_DI_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_sub_8_re_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_sub_8_re_aw(void) +{ + uint ea = EA_AW_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_sub_8_re_al(void) +{ + uint ea = EA_AL_8(); + uint src = MASK_OUT_ABOVE_8(DX); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_sub_16_re_ai(void) +{ + uint ea = EA_AY_AI_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_sub_16_re_pi(void) +{ + uint ea = EA_AY_PI_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_sub_16_re_pd(void) +{ + uint ea = EA_AY_PD_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_sub_16_re_di(void) +{ + uint ea = EA_AY_DI_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_sub_16_re_ix(void) +{ + uint ea = EA_AY_IX_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_sub_16_re_aw(void) +{ + uint ea = EA_AW_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_sub_16_re_al(void) +{ + uint ea = EA_AL_16(); + uint src = MASK_OUT_ABOVE_16(DX); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_sub_32_re_ai(void) +{ + uint ea = EA_AY_AI_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_sub_32_re_pi(void) +{ + uint ea = EA_AY_PI_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_sub_32_re_pd(void) +{ + uint ea = EA_AY_PD_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_sub_32_re_di(void) +{ + uint ea = EA_AY_DI_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_sub_32_re_ix(void) +{ + uint ea = EA_AY_IX_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_sub_32_re_aw(void) +{ + uint ea = EA_AW_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_sub_32_re_al(void) +{ + uint ea = EA_AL_32(); + uint src = DX; + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_suba_16_d(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(DY)); +} + + +void m68k_op_suba_16_a(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(AY)); +} + + +void m68k_op_suba_16_ai(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AY_AI_16())); +} + + +void m68k_op_suba_16_pi(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AY_PI_16())); +} + + +void m68k_op_suba_16_pd(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AY_PD_16())); +} + + +void m68k_op_suba_16_di(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AY_DI_16())); +} + + +void m68k_op_suba_16_ix(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AY_IX_16())); +} + + +void m68k_op_suba_16_aw(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AW_16())); +} + + +void m68k_op_suba_16_al(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AL_16())); +} + + +void m68k_op_suba_16_pcdi(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_PCDI_16())); +} + + +void m68k_op_suba_16_pcix(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_PCIX_16())); +} + + +void m68k_op_suba_16_i(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_I_16())); +} + + +void m68k_op_suba_32_d(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - DY); +} + + +void m68k_op_suba_32_a(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - AY); +} + + +void m68k_op_suba_32_ai(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AY_AI_32()); +} + + +void m68k_op_suba_32_pi(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AY_PI_32()); +} + + +void m68k_op_suba_32_pd(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AY_PD_32()); +} + + +void m68k_op_suba_32_di(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AY_DI_32()); +} + + +void m68k_op_suba_32_ix(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AY_IX_32()); +} + + +void m68k_op_suba_32_aw(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AW_32()); +} + + +void m68k_op_suba_32_al(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AL_32()); +} + + +void m68k_op_suba_32_pcdi(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_PCDI_32()); +} + + +void m68k_op_suba_32_pcix(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_PCIX_32()); +} + + +void m68k_op_suba_32_i(void) +{ + uint* r_dst = &AX; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_I_32()); +} + + +void m68k_op_subi_8_d(void) +{ + uint* r_dst = &DY; + uint src = OPER_I_8(); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_subi_8_ai(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_AI_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subi_8_pi(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_PI_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subi_8_pi7(void) +{ + uint src = OPER_I_8(); + uint ea = EA_A7_PI_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subi_8_pd(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subi_8_pd7(void) +{ + uint src = OPER_I_8(); + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subi_8_di(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_DI_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subi_8_ix(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AY_IX_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subi_8_aw(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AW_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subi_8_al(void) +{ + uint src = OPER_I_8(); + uint ea = EA_AL_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subi_16_d(void) +{ + uint* r_dst = &DY; + uint src = OPER_I_16(); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_subi_16_ai(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_AI_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subi_16_pi(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_PI_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subi_16_pd(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_PD_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subi_16_di(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_DI_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subi_16_ix(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AY_IX_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subi_16_aw(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AW_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subi_16_al(void) +{ + uint src = OPER_I_16(); + uint ea = EA_AL_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subi_32_d(void) +{ + uint* r_dst = &DY; + uint src = OPER_I_32(); + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_subi_32_ai(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_AI_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subi_32_pi(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_PI_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subi_32_pd(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_PD_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subi_32_di(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_DI_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subi_32_ix(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AY_IX_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subi_32_aw(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AW_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subi_32_al(void) +{ + uint src = OPER_I_32(); + uint ea = EA_AL_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subq_8_d(void) +{ + uint* r_dst = &DY; + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z; +} + + +void m68k_op_subq_8_ai(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_AI_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subq_8_pi(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_PI_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subq_8_pi7(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_A7_PI_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subq_8_pd(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subq_8_pd7(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subq_8_di(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_DI_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subq_8_ix(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_IX_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subq_8_aw(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AW_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subq_8_al(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AL_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src; + + FLAG_N = NFLAG_8(res); + FLAG_Z = MASK_OUT_ABOVE_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + m68ki_write_8(ea, FLAG_Z); +} + + +void m68k_op_subq_16_d(void) +{ + uint* r_dst = &DY; + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z; +} + + +void m68k_op_subq_16_a(void) +{ + uint* r_dst = &AY; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - ((((REG_IR >> 9) - 1) & 7) + 1)); +} + + +void m68k_op_subq_16_ai(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_AI_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subq_16_pi(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_PI_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subq_16_pd(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_PD_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subq_16_di(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_DI_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subq_16_ix(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_IX_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subq_16_aw(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AW_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subq_16_al(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AL_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src; + + FLAG_N = NFLAG_16(res); + FLAG_Z = MASK_OUT_ABOVE_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + m68ki_write_16(ea, FLAG_Z); +} + + +void m68k_op_subq_32_d(void) +{ + uint* r_dst = &DY; + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint dst = *r_dst; + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + *r_dst = FLAG_Z; +} + + +void m68k_op_subq_32_a(void) +{ + uint* r_dst = &AY; + + *r_dst = MASK_OUT_ABOVE_32(*r_dst - ((((REG_IR >> 9) - 1) & 7) + 1)); +} + + +void m68k_op_subq_32_ai(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_AI_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subq_32_pi(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_PI_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subq_32_pd(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_PD_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subq_32_di(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_DI_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subq_32_ix(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AY_IX_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subq_32_aw(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AW_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subq_32_al(void) +{ + uint src = (((REG_IR >> 9) - 1) & 7) + 1; + uint ea = EA_AL_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src; + + FLAG_N = NFLAG_32(res); + FLAG_Z = MASK_OUT_ABOVE_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + m68ki_write_32(ea, FLAG_Z); +} + + +void m68k_op_subx_8_rr(void) +{ + uint* r_dst = &DX; + uint src = MASK_OUT_ABOVE_8(DY); + uint dst = MASK_OUT_ABOVE_8(*r_dst); + uint res = dst - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; +} + + +void m68k_op_subx_16_rr(void) +{ + uint* r_dst = &DX; + uint src = MASK_OUT_ABOVE_16(DY); + uint dst = MASK_OUT_ABOVE_16(*r_dst); + uint res = dst - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + res = MASK_OUT_ABOVE_16(res); + FLAG_Z |= res; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; +} + + +void m68k_op_subx_32_rr(void) +{ + uint* r_dst = &DX; + uint src = DY; + uint dst = *r_dst; + uint res = dst - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + res = MASK_OUT_ABOVE_32(res); + FLAG_Z |= res; + + *r_dst = res; +} + + +void m68k_op_subx_8_mm_ax7(void) +{ + uint src = OPER_AY_PD_8(); + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_subx_8_mm_ay7(void) +{ + uint src = OPER_A7_PD_8(); + uint ea = EA_AX_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_subx_8_mm_axy7(void) +{ + uint src = OPER_A7_PD_8(); + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_subx_8_mm(void) +{ + uint src = OPER_AY_PD_8(); + uint ea = EA_AX_PD_8(); + uint dst = m68ki_read_8(ea); + uint res = dst - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_8(res); + FLAG_X = FLAG_C = CFLAG_8(res); + FLAG_V = VFLAG_SUB_8(src, dst, res); + + res = MASK_OUT_ABOVE_8(res); + FLAG_Z |= res; + + m68ki_write_8(ea, res); +} + + +void m68k_op_subx_16_mm(void) +{ + uint src = OPER_AY_PD_16(); + uint ea = EA_AX_PD_16(); + uint dst = m68ki_read_16(ea); + uint res = dst - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_16(res); + FLAG_X = FLAG_C = CFLAG_16(res); + FLAG_V = VFLAG_SUB_16(src, dst, res); + + res = MASK_OUT_ABOVE_16(res); + FLAG_Z |= res; + + m68ki_write_16(ea, res); +} + + +void m68k_op_subx_32_mm(void) +{ + uint src = OPER_AY_PD_32(); + uint ea = EA_AX_PD_32(); + uint dst = m68ki_read_32(ea); + uint res = dst - src - XFLAG_AS_1(); + + FLAG_N = NFLAG_32(res); + FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res); + FLAG_V = VFLAG_SUB_32(src, dst, res); + + res = MASK_OUT_ABOVE_32(res); + FLAG_Z |= res; + + m68ki_write_32(ea, res); +} + + +void m68k_op_swap_32(void) +{ + uint* r_dst = &DY; + + FLAG_Z = MASK_OUT_ABOVE_32(*r_dst<<16); + *r_dst = (*r_dst>>16) | FLAG_Z; + + FLAG_Z = *r_dst; + FLAG_N = NFLAG_32(*r_dst); + FLAG_C = CFLAG_CLEAR; + FLAG_V = VFLAG_CLEAR; +} + + +void m68k_op_tas_8_d(void) +{ + uint* r_dst = &DY; + + FLAG_Z = MASK_OUT_ABOVE_8(*r_dst); + FLAG_N = NFLAG_8(*r_dst); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + *r_dst |= 0x80; +} + + +void m68k_op_tas_8_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint dst = m68ki_read_8(ea); + + FLAG_Z = dst; + FLAG_N = NFLAG_8(dst); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +#if GENESIS_HACKS + /* Write-back prevented in this system */ +#else + m68ki_write_8(ea, dst | 0x80); +#endif +} + + +void m68k_op_tas_8_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint dst = m68ki_read_8(ea); + + FLAG_Z = dst; + FLAG_N = NFLAG_8(dst); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +#if GENESIS_HACKS + /* Write-back prevented in this system */ +#else + m68ki_write_8(ea, dst | 0x80); +#endif +} + + +void m68k_op_tas_8_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint dst = m68ki_read_8(ea); + + FLAG_Z = dst; + FLAG_N = NFLAG_8(dst); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +#if GENESIS_HACKS + /* Write-back prevented in this system */ +#else + m68ki_write_8(ea, dst | 0x80); +#endif +} + + +void m68k_op_tas_8_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint dst = m68ki_read_8(ea); + + FLAG_Z = dst; + FLAG_N = NFLAG_8(dst); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +#if GENESIS_HACKS + /* Write-back prevented in this system */ +#else + m68ki_write_8(ea, dst | 0x80); +#endif +} + + +void m68k_op_tas_8_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint dst = m68ki_read_8(ea); + + FLAG_Z = dst; + FLAG_N = NFLAG_8(dst); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +#if GENESIS_HACKS + /* Write-back prevented in this system */ +#else + m68ki_write_8(ea, dst | 0x80); +#endif +} + + +void m68k_op_tas_8_di(void) +{ + uint ea = EA_AY_DI_8(); + uint dst = m68ki_read_8(ea); + + FLAG_Z = dst; + FLAG_N = NFLAG_8(dst); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +#if GENESIS_HACKS + /* Write-back prevented in this system */ +#else + m68ki_write_8(ea, dst | 0x80); +#endif +} + + +void m68k_op_tas_8_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint dst = m68ki_read_8(ea); + + FLAG_Z = dst; + FLAG_N = NFLAG_8(dst); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +#if GENESIS_HACKS + /* Write-back prevented in this system */ +#else + m68ki_write_8(ea, dst | 0x80); +#endif +} + + +void m68k_op_tas_8_aw(void) +{ + uint ea = EA_AW_8(); + uint dst = m68ki_read_8(ea); + + FLAG_Z = dst; + FLAG_N = NFLAG_8(dst); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +#if GENESIS_HACKS + /* Write-back prevented in this system */ +#else + m68ki_write_8(ea, dst | 0x80); +#endif +} + + +void m68k_op_tas_8_al(void) +{ + uint ea = EA_AL_8(); + uint dst = m68ki_read_8(ea); + + FLAG_Z = dst; + FLAG_N = NFLAG_8(dst); + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +#if GENESIS_HACKS + /* Write-back prevented in this system */ +#else + m68ki_write_8(ea, dst | 0x80); +#endif +} + + +void m68k_op_trap(void) +{ + /* Trap#n stacks exception frame type 0 */ + m68ki_exception_trapN(EXCEPTION_TRAP_BASE + (REG_IR & 0xf)); /* HJB 990403 */ +} + + +void m68k_op_trapt(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapt_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapt_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapf(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapf_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapf_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_traphi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_HI()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapls(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_LS()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapcc(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_CC()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapcs(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_CS()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapne(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_NE()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapeq(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_EQ()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapvc(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_VC()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapvs(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_VS()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trappl(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_PL()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapmi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_MI()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapge(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_GE()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_traplt(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_LT()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapgt(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_GT()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_traple(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_LE()) + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_traphi_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_HI()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapls_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_LS()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapcc_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_CC()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapcs_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_CS()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapne_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_NE()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapeq_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_EQ()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapvc_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_VC()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapvs_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_VS()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trappl_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_PL()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapmi_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_MI()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapge_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_GE()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_traplt_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_LT()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapgt_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_GT()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_traple_16(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_LE()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 2; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_traphi_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_HI()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapls_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_LS()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapcc_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_CC()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapcs_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_CS()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapne_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_NE()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapeq_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_EQ()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapvc_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_VC()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapvs_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_VS()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trappl_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_PL()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapmi_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_MI()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapge_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_GE()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_traplt_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_LT()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapgt_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_GT()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_traple_32(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + if(COND_LE()) + { + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ + return; + } + REG_PC += 4; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_trapv(void) +{ + if(COND_VC()) + { + return; + } + m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */ +} + + +void m68k_op_tst_8_d(void) +{ + uint res = MASK_OUT_ABOVE_8(DY); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_8_ai(void) +{ + uint ea = EA_AY_AI_8(); + uint res = m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_8_pi(void) +{ + uint ea = EA_AY_PI_8(); + uint res = m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_8_pi7(void) +{ + uint ea = EA_A7_PI_8(); + uint res = m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_8_pd(void) +{ + uint ea = EA_AY_PD_8(); + uint res = m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_8_pd7(void) +{ + uint ea = EA_A7_PD_8(); + uint res = m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_8_di(void) +{ + uint ea = EA_AY_DI_8(); + uint res = m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_8_ix(void) +{ + uint ea = EA_AY_IX_8(); + uint res = m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_8_aw(void) +{ + uint ea = EA_AW_8(); + uint res = m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_8_al(void) +{ + uint ea = EA_AL_8(); + uint res = m68ki_read_8(ea); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_8_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint res = OPER_PCDI_8(); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_tst_8_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint res = OPER_PCIX_8(); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_tst_8_i(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint res = OPER_I_8(); + + FLAG_N = NFLAG_8(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_tst_16_d(void) +{ + uint res = MASK_OUT_ABOVE_16(DY); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_16_a(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint res = MAKE_INT_16(AY); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_tst_16_ai(void) +{ + uint res = OPER_AY_AI_16(); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_16_pi(void) +{ + uint res = OPER_AY_PI_16(); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_16_pd(void) +{ + uint res = OPER_AY_PD_16(); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_16_di(void) +{ + uint res = OPER_AY_DI_16(); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_16_ix(void) +{ + uint res = OPER_AY_IX_16(); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_16_aw(void) +{ + uint res = OPER_AW_16(); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_16_al(void) +{ + uint res = OPER_AL_16(); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_16_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint res = OPER_PCDI_16(); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_tst_16_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint res = OPER_PCIX_16(); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_tst_16_i(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint res = OPER_I_16(); + + FLAG_N = NFLAG_16(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_tst_32_d(void) +{ + uint res = DY; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_32_a(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint res = AY; + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_tst_32_ai(void) +{ + uint res = OPER_AY_AI_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_32_pi(void) +{ + uint res = OPER_AY_PI_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_32_pd(void) +{ + uint res = OPER_AY_PD_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_32_di(void) +{ + uint res = OPER_AY_DI_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_32_ix(void) +{ + uint res = OPER_AY_IX_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_32_aw(void) +{ + uint res = OPER_AW_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_32_al(void) +{ + uint res = OPER_AL_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; +} + + +void m68k_op_tst_32_pcdi(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint res = OPER_PCDI_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_tst_32_pcix(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint res = OPER_PCIX_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_tst_32_i(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint res = OPER_I_32(); + + FLAG_N = NFLAG_32(res); + FLAG_Z = res; + FLAG_V = VFLAG_CLEAR; + FLAG_C = CFLAG_CLEAR; + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_unlk_32_a7(void) +{ + REG_A[7] = m68ki_read_32(REG_A[7]); +} + + +void m68k_op_unlk_32(void) +{ + uint* r_dst = &AY; + + REG_A[7] = *r_dst; + *r_dst = m68ki_pull_32(); +} + + +void m68k_op_unpk_16_rr(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + /* Note: DX and DY are reversed in Motorola's docs */ + uint src = DY; + uint* r_dst = &DX; + + *r_dst = MASK_OUT_BELOW_16(*r_dst) | (((((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16()) & 0xffff); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_unpk_16_mm_ax7(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + /* Note: AX and AY are reversed in Motorola's docs */ + uint src = OPER_AY_PD_8(); + uint ea_dst; + + src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(); + ea_dst = EA_A7_PD_8(); + m68ki_write_8(ea_dst, (src >> 8) & 0xff); + ea_dst = EA_A7_PD_8(); + m68ki_write_8(ea_dst, src & 0xff); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_unpk_16_mm_ay7(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + /* Note: AX and AY are reversed in Motorola's docs */ + uint src = OPER_A7_PD_8(); + uint ea_dst; + + src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(); + ea_dst = EA_AX_PD_8(); + m68ki_write_8(ea_dst, (src >> 8) & 0xff); + ea_dst = EA_AX_PD_8(); + m68ki_write_8(ea_dst, src & 0xff); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_unpk_16_mm_axy7(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + uint src = OPER_A7_PD_8(); + uint ea_dst; + + src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(); + ea_dst = EA_A7_PD_8(); + m68ki_write_8(ea_dst, (src >> 8) & 0xff); + ea_dst = EA_A7_PD_8(); + m68ki_write_8(ea_dst, src & 0xff); + return; + } + m68ki_exception_illegal(); +} + + +void m68k_op_unpk_16_mm(void) +{ + if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE)) + { + /* Note: AX and AY are reversed in Motorola's docs */ + uint src = OPER_AY_PD_8(); + uint ea_dst; + + src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(); + ea_dst = EA_AX_PD_8(); + m68ki_write_8(ea_dst, (src >> 8) & 0xff); + ea_dst = EA_AX_PD_8(); + m68ki_write_8(ea_dst, src & 0xff); + return; + } + m68ki_exception_illegal(); +} + + +/* ======================================================================== */ +/* ============================== END OF FILE ============================= */ +/* ======================================================================== */ + + diff --git a/source/m68k/m68kops.c b/source/m68k/m68kops.c new file mode 100644 index 0000000..ac79916 --- /dev/null +++ b/source/m68k/m68kops.c @@ -0,0 +1,2093 @@ +/* ======================================================================== */ +/* ========================= OPCODE TABLE BUILDER ========================= */ +/* ======================================================================== */ + +#include "m68kops.h" + +#define NUM_CPU_TYPES 3 + +void (*m68ki_instruction_jump_table[0x10000])(void); /* opcode handler jump table */ +unsigned char m68ki_cycles[NUM_CPU_TYPES][0x10000]; /* Cycles used by CPU type */ + +/* This is used to generate the opcode handler jump table */ +typedef struct +{ + void (*opcode_handler)(void); /* handler function */ + unsigned int mask; /* mask on opcode */ + unsigned int match; /* what to match after masking */ + unsigned char cycles[NUM_CPU_TYPES]; /* cycles each cpu type takes */ +} opcode_handler_struct; + + +/* Opcode handler table */ +static opcode_handler_struct m68k_opcode_handler_table[] = +{ +/* function mask match 000 010 020 */ + {m68k_op_1010 , 0xf000, 0xa000, { 4, 4, 4}}, + {m68k_op_1111 , 0xf000, 0xf000, { 4, 4, 4}}, + {m68k_op_moveq_32 , 0xf100, 0x7000, { 4, 4, 2}}, + {m68k_op_cpbcc_32 , 0xf180, 0xf080, { 0, 0, 4}}, + {m68k_op_cpgen_32 , 0xf1c0, 0xf000, { 0, 0, 4}}, + {m68k_op_cpscc_32 , 0xf1c0, 0xf040, { 0, 0, 4}}, + {m68k_op_bra_8 , 0xff00, 0x6000, { 10, 10, 10}}, + {m68k_op_bsr_8 , 0xff00, 0x6100, { 18, 18, 7}}, + {m68k_op_bhi_8 , 0xff00, 0x6200, { 8, 8, 6}}, + {m68k_op_bls_8 , 0xff00, 0x6300, { 8, 8, 6}}, + {m68k_op_bcc_8 , 0xff00, 0x6400, { 8, 8, 6}}, + {m68k_op_bcs_8 , 0xff00, 0x6500, { 8, 8, 6}}, + {m68k_op_bne_8 , 0xff00, 0x6600, { 8, 8, 6}}, + {m68k_op_beq_8 , 0xff00, 0x6700, { 8, 8, 6}}, + {m68k_op_bvc_8 , 0xff00, 0x6800, { 8, 8, 6}}, + {m68k_op_bvs_8 , 0xff00, 0x6900, { 8, 8, 6}}, + {m68k_op_bpl_8 , 0xff00, 0x6a00, { 8, 8, 6}}, + {m68k_op_bmi_8 , 0xff00, 0x6b00, { 8, 8, 6}}, + {m68k_op_bge_8 , 0xff00, 0x6c00, { 8, 8, 6}}, + {m68k_op_blt_8 , 0xff00, 0x6d00, { 8, 8, 6}}, + {m68k_op_bgt_8 , 0xff00, 0x6e00, { 8, 8, 6}}, + {m68k_op_ble_8 , 0xff00, 0x6f00, { 8, 8, 6}}, + {m68k_op_btst_32_r_d , 0xf1f8, 0x0100, { 6, 6, 4}}, + {m68k_op_movep_16_er , 0xf1f8, 0x0108, { 16, 16, 12}}, + {m68k_op_btst_8_r_ai , 0xf1f8, 0x0110, { 8, 8, 8}}, + {m68k_op_btst_8_r_pi , 0xf1f8, 0x0118, { 8, 8, 8}}, + {m68k_op_btst_8_r_pd , 0xf1f8, 0x0120, { 10, 10, 9}}, + {m68k_op_btst_8_r_di , 0xf1f8, 0x0128, { 12, 12, 9}}, + {m68k_op_btst_8_r_ix , 0xf1f8, 0x0130, { 14, 14, 11}}, + {m68k_op_bchg_32_r_d , 0xf1f8, 0x0140, { 8, 8, 4}}, + {m68k_op_movep_32_er , 0xf1f8, 0x0148, { 24, 24, 18}}, + {m68k_op_bchg_8_r_ai , 0xf1f8, 0x0150, { 12, 12, 8}}, + {m68k_op_bchg_8_r_pi , 0xf1f8, 0x0158, { 12, 12, 8}}, + {m68k_op_bchg_8_r_pd , 0xf1f8, 0x0160, { 14, 14, 9}}, + {m68k_op_bchg_8_r_di , 0xf1f8, 0x0168, { 16, 16, 9}}, + {m68k_op_bchg_8_r_ix , 0xf1f8, 0x0170, { 18, 18, 11}}, + {m68k_op_bclr_32_r_d , 0xf1f8, 0x0180, { 10, 10, 4}}, + {m68k_op_movep_16_re , 0xf1f8, 0x0188, { 16, 16, 11}}, + {m68k_op_bclr_8_r_ai , 0xf1f8, 0x0190, { 12, 14, 8}}, + {m68k_op_bclr_8_r_pi , 0xf1f8, 0x0198, { 12, 14, 8}}, + {m68k_op_bclr_8_r_pd , 0xf1f8, 0x01a0, { 14, 16, 9}}, + {m68k_op_bclr_8_r_di , 0xf1f8, 0x01a8, { 16, 18, 9}}, + {m68k_op_bclr_8_r_ix , 0xf1f8, 0x01b0, { 18, 20, 11}}, + {m68k_op_bset_32_r_d , 0xf1f8, 0x01c0, { 8, 8, 4}}, + {m68k_op_movep_32_re , 0xf1f8, 0x01c8, { 24, 24, 17}}, + {m68k_op_bset_8_r_ai , 0xf1f8, 0x01d0, { 12, 12, 8}}, + {m68k_op_bset_8_r_pi , 0xf1f8, 0x01d8, { 12, 12, 8}}, + {m68k_op_bset_8_r_pd , 0xf1f8, 0x01e0, { 14, 14, 9}}, + {m68k_op_bset_8_r_di , 0xf1f8, 0x01e8, { 16, 16, 9}}, + {m68k_op_bset_8_r_ix , 0xf1f8, 0x01f0, { 18, 18, 11}}, + {m68k_op_move_8_d_d , 0xf1f8, 0x1000, { 4, 4, 2}}, + {m68k_op_move_8_d_ai , 0xf1f8, 0x1010, { 8, 8, 6}}, + {m68k_op_move_8_d_pi , 0xf1f8, 0x1018, { 8, 8, 6}}, + {m68k_op_move_8_d_pd , 0xf1f8, 0x1020, { 10, 10, 7}}, + {m68k_op_move_8_d_di , 0xf1f8, 0x1028, { 12, 12, 7}}, + {m68k_op_move_8_d_ix , 0xf1f8, 0x1030, { 14, 14, 9}}, + {m68k_op_move_8_ai_d , 0xf1f8, 0x1080, { 8, 8, 4}}, + {m68k_op_move_8_ai_ai , 0xf1f8, 0x1090, { 12, 12, 8}}, + {m68k_op_move_8_ai_pi , 0xf1f8, 0x1098, { 12, 12, 8}}, + {m68k_op_move_8_ai_pd , 0xf1f8, 0x10a0, { 14, 14, 9}}, + {m68k_op_move_8_ai_di , 0xf1f8, 0x10a8, { 16, 16, 9}}, + {m68k_op_move_8_ai_ix , 0xf1f8, 0x10b0, { 18, 18, 11}}, + {m68k_op_move_8_pi_d , 0xf1f8, 0x10c0, { 8, 8, 4}}, + {m68k_op_move_8_pi_ai , 0xf1f8, 0x10d0, { 12, 12, 8}}, + {m68k_op_move_8_pi_pi , 0xf1f8, 0x10d8, { 12, 12, 8}}, + {m68k_op_move_8_pi_pd , 0xf1f8, 0x10e0, { 14, 14, 9}}, + {m68k_op_move_8_pi_di , 0xf1f8, 0x10e8, { 16, 16, 9}}, + {m68k_op_move_8_pi_ix , 0xf1f8, 0x10f0, { 18, 18, 11}}, + {m68k_op_move_8_pd_d , 0xf1f8, 0x1100, { 8, 8, 5}}, + {m68k_op_move_8_pd_ai , 0xf1f8, 0x1110, { 12, 12, 9}}, + {m68k_op_move_8_pd_pi , 0xf1f8, 0x1118, { 12, 12, 9}}, + {m68k_op_move_8_pd_pd , 0xf1f8, 0x1120, { 14, 14, 10}}, + {m68k_op_move_8_pd_di , 0xf1f8, 0x1128, { 16, 16, 10}}, + {m68k_op_move_8_pd_ix , 0xf1f8, 0x1130, { 18, 18, 12}}, + {m68k_op_move_8_di_d , 0xf1f8, 0x1140, { 12, 12, 5}}, + {m68k_op_move_8_di_ai , 0xf1f8, 0x1150, { 16, 16, 9}}, + {m68k_op_move_8_di_pi , 0xf1f8, 0x1158, { 16, 16, 9}}, + {m68k_op_move_8_di_pd , 0xf1f8, 0x1160, { 18, 18, 10}}, + {m68k_op_move_8_di_di , 0xf1f8, 0x1168, { 20, 20, 10}}, + {m68k_op_move_8_di_ix , 0xf1f8, 0x1170, { 22, 22, 12}}, + {m68k_op_move_8_ix_d , 0xf1f8, 0x1180, { 14, 14, 7}}, + {m68k_op_move_8_ix_ai , 0xf1f8, 0x1190, { 18, 18, 11}}, + {m68k_op_move_8_ix_pi , 0xf1f8, 0x1198, { 18, 18, 11}}, + {m68k_op_move_8_ix_pd , 0xf1f8, 0x11a0, { 20, 20, 12}}, + {m68k_op_move_8_ix_di , 0xf1f8, 0x11a8, { 22, 22, 12}}, + {m68k_op_move_8_ix_ix , 0xf1f8, 0x11b0, { 24, 24, 14}}, + {m68k_op_move_32_d_d , 0xf1f8, 0x2000, { 4, 4, 2}}, + {m68k_op_move_32_d_a , 0xf1f8, 0x2008, { 4, 4, 2}}, + {m68k_op_move_32_d_ai , 0xf1f8, 0x2010, { 12, 12, 6}}, + {m68k_op_move_32_d_pi , 0xf1f8, 0x2018, { 12, 12, 6}}, + {m68k_op_move_32_d_pd , 0xf1f8, 0x2020, { 14, 14, 7}}, + {m68k_op_move_32_d_di , 0xf1f8, 0x2028, { 16, 16, 7}}, + {m68k_op_move_32_d_ix , 0xf1f8, 0x2030, { 18, 18, 9}}, + {m68k_op_movea_32_d , 0xf1f8, 0x2040, { 4, 4, 2}}, + {m68k_op_movea_32_a , 0xf1f8, 0x2048, { 4, 4, 2}}, + {m68k_op_movea_32_ai , 0xf1f8, 0x2050, { 12, 12, 6}}, + {m68k_op_movea_32_pi , 0xf1f8, 0x2058, { 12, 12, 6}}, + {m68k_op_movea_32_pd , 0xf1f8, 0x2060, { 14, 14, 7}}, + {m68k_op_movea_32_di , 0xf1f8, 0x2068, { 16, 16, 7}}, + {m68k_op_movea_32_ix , 0xf1f8, 0x2070, { 18, 18, 9}}, + {m68k_op_move_32_ai_d , 0xf1f8, 0x2080, { 12, 12, 4}}, + {m68k_op_move_32_ai_a , 0xf1f8, 0x2088, { 12, 12, 4}}, + {m68k_op_move_32_ai_ai , 0xf1f8, 0x2090, { 20, 20, 8}}, + {m68k_op_move_32_ai_pi , 0xf1f8, 0x2098, { 20, 20, 8}}, + {m68k_op_move_32_ai_pd , 0xf1f8, 0x20a0, { 22, 22, 9}}, + {m68k_op_move_32_ai_di , 0xf1f8, 0x20a8, { 24, 24, 9}}, + {m68k_op_move_32_ai_ix , 0xf1f8, 0x20b0, { 26, 26, 11}}, + {m68k_op_move_32_pi_d , 0xf1f8, 0x20c0, { 12, 12, 4}}, + {m68k_op_move_32_pi_a , 0xf1f8, 0x20c8, { 12, 12, 4}}, + {m68k_op_move_32_pi_ai , 0xf1f8, 0x20d0, { 20, 20, 8}}, + {m68k_op_move_32_pi_pi , 0xf1f8, 0x20d8, { 20, 20, 8}}, + {m68k_op_move_32_pi_pd , 0xf1f8, 0x20e0, { 22, 22, 9}}, + {m68k_op_move_32_pi_di , 0xf1f8, 0x20e8, { 24, 24, 9}}, + {m68k_op_move_32_pi_ix , 0xf1f8, 0x20f0, { 26, 26, 11}}, + {m68k_op_move_32_pd_d , 0xf1f8, 0x2100, { 12, 14, 5}}, + {m68k_op_move_32_pd_a , 0xf1f8, 0x2108, { 12, 14, 5}}, + {m68k_op_move_32_pd_ai , 0xf1f8, 0x2110, { 20, 22, 9}}, + {m68k_op_move_32_pd_pi , 0xf1f8, 0x2118, { 20, 22, 9}}, + {m68k_op_move_32_pd_pd , 0xf1f8, 0x2120, { 22, 24, 10}}, + {m68k_op_move_32_pd_di , 0xf1f8, 0x2128, { 24, 26, 10}}, + {m68k_op_move_32_pd_ix , 0xf1f8, 0x2130, { 26, 28, 12}}, + {m68k_op_move_32_di_d , 0xf1f8, 0x2140, { 16, 16, 5}}, + {m68k_op_move_32_di_a , 0xf1f8, 0x2148, { 16, 16, 5}}, + {m68k_op_move_32_di_ai , 0xf1f8, 0x2150, { 24, 24, 9}}, + {m68k_op_move_32_di_pi , 0xf1f8, 0x2158, { 24, 24, 9}}, + {m68k_op_move_32_di_pd , 0xf1f8, 0x2160, { 26, 26, 10}}, + {m68k_op_move_32_di_di , 0xf1f8, 0x2168, { 28, 28, 10}}, + {m68k_op_move_32_di_ix , 0xf1f8, 0x2170, { 30, 30, 12}}, + {m68k_op_move_32_ix_d , 0xf1f8, 0x2180, { 18, 18, 7}}, + {m68k_op_move_32_ix_a , 0xf1f8, 0x2188, { 18, 18, 7}}, + {m68k_op_move_32_ix_ai , 0xf1f8, 0x2190, { 26, 26, 11}}, + {m68k_op_move_32_ix_pi , 0xf1f8, 0x2198, { 26, 26, 11}}, + {m68k_op_move_32_ix_pd , 0xf1f8, 0x21a0, { 28, 28, 12}}, + {m68k_op_move_32_ix_di , 0xf1f8, 0x21a8, { 30, 30, 12}}, + {m68k_op_move_32_ix_ix , 0xf1f8, 0x21b0, { 32, 32, 14}}, + {m68k_op_move_16_d_d , 0xf1f8, 0x3000, { 4, 4, 2}}, + {m68k_op_move_16_d_a , 0xf1f8, 0x3008, { 4, 4, 2}}, + {m68k_op_move_16_d_ai , 0xf1f8, 0x3010, { 8, 8, 6}}, + {m68k_op_move_16_d_pi , 0xf1f8, 0x3018, { 8, 8, 6}}, + {m68k_op_move_16_d_pd , 0xf1f8, 0x3020, { 10, 10, 7}}, + {m68k_op_move_16_d_di , 0xf1f8, 0x3028, { 12, 12, 7}}, + {m68k_op_move_16_d_ix , 0xf1f8, 0x3030, { 14, 14, 9}}, + {m68k_op_movea_16_d , 0xf1f8, 0x3040, { 4, 4, 2}}, + {m68k_op_movea_16_a , 0xf1f8, 0x3048, { 4, 4, 2}}, + {m68k_op_movea_16_ai , 0xf1f8, 0x3050, { 8, 8, 6}}, + {m68k_op_movea_16_pi , 0xf1f8, 0x3058, { 8, 8, 6}}, + {m68k_op_movea_16_pd , 0xf1f8, 0x3060, { 10, 10, 7}}, + {m68k_op_movea_16_di , 0xf1f8, 0x3068, { 12, 12, 7}}, + {m68k_op_movea_16_ix , 0xf1f8, 0x3070, { 14, 14, 9}}, + {m68k_op_move_16_ai_d , 0xf1f8, 0x3080, { 8, 8, 4}}, + {m68k_op_move_16_ai_a , 0xf1f8, 0x3088, { 8, 8, 4}}, + {m68k_op_move_16_ai_ai , 0xf1f8, 0x3090, { 12, 12, 8}}, + {m68k_op_move_16_ai_pi , 0xf1f8, 0x3098, { 12, 12, 8}}, + {m68k_op_move_16_ai_pd , 0xf1f8, 0x30a0, { 14, 14, 9}}, + {m68k_op_move_16_ai_di , 0xf1f8, 0x30a8, { 16, 16, 9}}, + {m68k_op_move_16_ai_ix , 0xf1f8, 0x30b0, { 18, 18, 11}}, + {m68k_op_move_16_pi_d , 0xf1f8, 0x30c0, { 8, 8, 4}}, + {m68k_op_move_16_pi_a , 0xf1f8, 0x30c8, { 8, 8, 4}}, + {m68k_op_move_16_pi_ai , 0xf1f8, 0x30d0, { 12, 12, 8}}, + {m68k_op_move_16_pi_pi , 0xf1f8, 0x30d8, { 12, 12, 8}}, + {m68k_op_move_16_pi_pd , 0xf1f8, 0x30e0, { 14, 14, 9}}, + {m68k_op_move_16_pi_di , 0xf1f8, 0x30e8, { 16, 16, 9}}, + {m68k_op_move_16_pi_ix , 0xf1f8, 0x30f0, { 18, 18, 11}}, + {m68k_op_move_16_pd_d , 0xf1f8, 0x3100, { 8, 8, 5}}, + {m68k_op_move_16_pd_a , 0xf1f8, 0x3108, { 8, 8, 5}}, + {m68k_op_move_16_pd_ai , 0xf1f8, 0x3110, { 12, 12, 9}}, + {m68k_op_move_16_pd_pi , 0xf1f8, 0x3118, { 12, 12, 9}}, + {m68k_op_move_16_pd_pd , 0xf1f8, 0x3120, { 14, 14, 10}}, + {m68k_op_move_16_pd_di , 0xf1f8, 0x3128, { 16, 16, 10}}, + {m68k_op_move_16_pd_ix , 0xf1f8, 0x3130, { 18, 18, 12}}, + {m68k_op_move_16_di_d , 0xf1f8, 0x3140, { 12, 12, 5}}, + {m68k_op_move_16_di_a , 0xf1f8, 0x3148, { 12, 12, 5}}, + {m68k_op_move_16_di_ai , 0xf1f8, 0x3150, { 16, 16, 9}}, + {m68k_op_move_16_di_pi , 0xf1f8, 0x3158, { 16, 16, 9}}, + {m68k_op_move_16_di_pd , 0xf1f8, 0x3160, { 18, 18, 10}}, + {m68k_op_move_16_di_di , 0xf1f8, 0x3168, { 20, 20, 10}}, + {m68k_op_move_16_di_ix , 0xf1f8, 0x3170, { 22, 22, 12}}, + {m68k_op_move_16_ix_d , 0xf1f8, 0x3180, { 14, 14, 7}}, + {m68k_op_move_16_ix_a , 0xf1f8, 0x3188, { 14, 14, 7}}, + {m68k_op_move_16_ix_ai , 0xf1f8, 0x3190, { 18, 18, 11}}, + {m68k_op_move_16_ix_pi , 0xf1f8, 0x3198, { 18, 18, 11}}, + {m68k_op_move_16_ix_pd , 0xf1f8, 0x31a0, { 20, 20, 12}}, + {m68k_op_move_16_ix_di , 0xf1f8, 0x31a8, { 22, 22, 12}}, + {m68k_op_move_16_ix_ix , 0xf1f8, 0x31b0, { 24, 24, 14}}, + {m68k_op_chk_32_d , 0xf1f8, 0x4100, { 0, 0, 8}}, + {m68k_op_chk_32_ai , 0xf1f8, 0x4110, { 0, 0, 12}}, + {m68k_op_chk_32_pi , 0xf1f8, 0x4118, { 0, 0, 12}}, + {m68k_op_chk_32_pd , 0xf1f8, 0x4120, { 0, 0, 13}}, + {m68k_op_chk_32_di , 0xf1f8, 0x4128, { 0, 0, 13}}, + {m68k_op_chk_32_ix , 0xf1f8, 0x4130, { 0, 0, 15}}, + {m68k_op_chk_16_d , 0xf1f8, 0x4180, { 10, 8, 8}}, + {m68k_op_chk_16_ai , 0xf1f8, 0x4190, { 14, 12, 12}}, + {m68k_op_chk_16_pi , 0xf1f8, 0x4198, { 14, 12, 12}}, + {m68k_op_chk_16_pd , 0xf1f8, 0x41a0, { 16, 14, 13}}, + {m68k_op_chk_16_di , 0xf1f8, 0x41a8, { 18, 16, 13}}, + {m68k_op_chk_16_ix , 0xf1f8, 0x41b0, { 20, 18, 15}}, + {m68k_op_lea_32_ai , 0xf1f8, 0x41d0, { 4, 4, 6}}, + {m68k_op_lea_32_di , 0xf1f8, 0x41e8, { 8, 8, 7}}, + {m68k_op_lea_32_ix , 0xf1f8, 0x41f0, { 12, 12, 9}}, + {m68k_op_addq_8_d , 0xf1f8, 0x5000, { 4, 4, 2}}, + {m68k_op_addq_8_ai , 0xf1f8, 0x5010, { 12, 12, 8}}, + {m68k_op_addq_8_pi , 0xf1f8, 0x5018, { 12, 12, 8}}, + {m68k_op_addq_8_pd , 0xf1f8, 0x5020, { 14, 14, 9}}, + {m68k_op_addq_8_di , 0xf1f8, 0x5028, { 16, 16, 9}}, + {m68k_op_addq_8_ix , 0xf1f8, 0x5030, { 18, 18, 11}}, + {m68k_op_addq_16_d , 0xf1f8, 0x5040, { 4, 4, 2}}, + {m68k_op_addq_16_a , 0xf1f8, 0x5048, { 4, 4, 2}}, + {m68k_op_addq_16_ai , 0xf1f8, 0x5050, { 12, 12, 8}}, + {m68k_op_addq_16_pi , 0xf1f8, 0x5058, { 12, 12, 8}}, + {m68k_op_addq_16_pd , 0xf1f8, 0x5060, { 14, 14, 9}}, + {m68k_op_addq_16_di , 0xf1f8, 0x5068, { 16, 16, 9}}, + {m68k_op_addq_16_ix , 0xf1f8, 0x5070, { 18, 18, 11}}, + {m68k_op_addq_32_d , 0xf1f8, 0x5080, { 8, 8, 2}}, + {m68k_op_addq_32_a , 0xf1f8, 0x5088, { 8, 8, 2}}, + {m68k_op_addq_32_ai , 0xf1f8, 0x5090, { 20, 20, 8}}, + {m68k_op_addq_32_pi , 0xf1f8, 0x5098, { 20, 20, 8}}, + {m68k_op_addq_32_pd , 0xf1f8, 0x50a0, { 22, 22, 9}}, + {m68k_op_addq_32_di , 0xf1f8, 0x50a8, { 24, 24, 9}}, + {m68k_op_addq_32_ix , 0xf1f8, 0x50b0, { 26, 26, 11}}, + {m68k_op_subq_8_d , 0xf1f8, 0x5100, { 4, 4, 2}}, + {m68k_op_subq_8_ai , 0xf1f8, 0x5110, { 12, 12, 8}}, + {m68k_op_subq_8_pi , 0xf1f8, 0x5118, { 12, 12, 8}}, + {m68k_op_subq_8_pd , 0xf1f8, 0x5120, { 14, 14, 9}}, + {m68k_op_subq_8_di , 0xf1f8, 0x5128, { 16, 16, 9}}, + {m68k_op_subq_8_ix , 0xf1f8, 0x5130, { 18, 18, 11}}, + {m68k_op_subq_16_d , 0xf1f8, 0x5140, { 4, 4, 2}}, + {m68k_op_subq_16_a , 0xf1f8, 0x5148, { 8, 4, 2}}, + {m68k_op_subq_16_ai , 0xf1f8, 0x5150, { 12, 12, 8}}, + {m68k_op_subq_16_pi , 0xf1f8, 0x5158, { 12, 12, 8}}, + {m68k_op_subq_16_pd , 0xf1f8, 0x5160, { 14, 14, 9}}, + {m68k_op_subq_16_di , 0xf1f8, 0x5168, { 16, 16, 9}}, + {m68k_op_subq_16_ix , 0xf1f8, 0x5170, { 18, 18, 11}}, + {m68k_op_subq_32_d , 0xf1f8, 0x5180, { 8, 8, 2}}, + {m68k_op_subq_32_a , 0xf1f8, 0x5188, { 8, 8, 2}}, + {m68k_op_subq_32_ai , 0xf1f8, 0x5190, { 20, 20, 8}}, + {m68k_op_subq_32_pi , 0xf1f8, 0x5198, { 20, 20, 8}}, + {m68k_op_subq_32_pd , 0xf1f8, 0x51a0, { 22, 22, 9}}, + {m68k_op_subq_32_di , 0xf1f8, 0x51a8, { 24, 24, 9}}, + {m68k_op_subq_32_ix , 0xf1f8, 0x51b0, { 26, 26, 11}}, + {m68k_op_or_8_er_d , 0xf1f8, 0x8000, { 4, 4, 2}}, + {m68k_op_or_8_er_ai , 0xf1f8, 0x8010, { 8, 8, 6}}, + {m68k_op_or_8_er_pi , 0xf1f8, 0x8018, { 8, 8, 6}}, + {m68k_op_or_8_er_pd , 0xf1f8, 0x8020, { 10, 10, 7}}, + {m68k_op_or_8_er_di , 0xf1f8, 0x8028, { 12, 12, 7}}, + {m68k_op_or_8_er_ix , 0xf1f8, 0x8030, { 14, 14, 9}}, + {m68k_op_or_16_er_d , 0xf1f8, 0x8040, { 4, 4, 2}}, + {m68k_op_or_16_er_ai , 0xf1f8, 0x8050, { 8, 8, 6}}, + {m68k_op_or_16_er_pi , 0xf1f8, 0x8058, { 8, 8, 6}}, + {m68k_op_or_16_er_pd , 0xf1f8, 0x8060, { 10, 10, 7}}, + {m68k_op_or_16_er_di , 0xf1f8, 0x8068, { 12, 12, 7}}, + {m68k_op_or_16_er_ix , 0xf1f8, 0x8070, { 14, 14, 9}}, + {m68k_op_or_32_er_d , 0xf1f8, 0x8080, { 6, 6, 2}}, + {m68k_op_or_32_er_ai , 0xf1f8, 0x8090, { 14, 14, 6}}, + {m68k_op_or_32_er_pi , 0xf1f8, 0x8098, { 14, 14, 6}}, + {m68k_op_or_32_er_pd , 0xf1f8, 0x80a0, { 16, 16, 7}}, + {m68k_op_or_32_er_di , 0xf1f8, 0x80a8, { 18, 18, 7}}, + {m68k_op_or_32_er_ix , 0xf1f8, 0x80b0, { 20, 20, 9}}, + {m68k_op_divu_16_d , 0xf1f8, 0x80c0, {140, 108, 44}}, + {m68k_op_divu_16_ai , 0xf1f8, 0x80d0, {144, 112, 48}}, + {m68k_op_divu_16_pi , 0xf1f8, 0x80d8, {144, 112, 48}}, + {m68k_op_divu_16_pd , 0xf1f8, 0x80e0, {146, 114, 49}}, + {m68k_op_divu_16_di , 0xf1f8, 0x80e8, {148, 116, 49}}, + {m68k_op_divu_16_ix , 0xf1f8, 0x80f0, {150, 118, 51}}, + {m68k_op_sbcd_8_rr , 0xf1f8, 0x8100, { 6, 6, 4}}, + {m68k_op_sbcd_8_mm , 0xf1f8, 0x8108, { 18, 18, 16}}, + {m68k_op_or_8_re_ai , 0xf1f8, 0x8110, { 12, 12, 8}}, + {m68k_op_or_8_re_pi , 0xf1f8, 0x8118, { 12, 12, 8}}, + {m68k_op_or_8_re_pd , 0xf1f8, 0x8120, { 14, 14, 9}}, + {m68k_op_or_8_re_di , 0xf1f8, 0x8128, { 16, 16, 9}}, + {m68k_op_or_8_re_ix , 0xf1f8, 0x8130, { 18, 18, 11}}, + {m68k_op_pack_16_rr , 0xf1f8, 0x8140, { 0, 0, 6}}, + {m68k_op_pack_16_mm , 0xf1f8, 0x8148, { 0, 0, 13}}, + {m68k_op_or_16_re_ai , 0xf1f8, 0x8150, { 12, 12, 8}}, + {m68k_op_or_16_re_pi , 0xf1f8, 0x8158, { 12, 12, 8}}, + {m68k_op_or_16_re_pd , 0xf1f8, 0x8160, { 14, 14, 9}}, + {m68k_op_or_16_re_di , 0xf1f8, 0x8168, { 16, 16, 9}}, + {m68k_op_or_16_re_ix , 0xf1f8, 0x8170, { 18, 18, 11}}, + {m68k_op_unpk_16_rr , 0xf1f8, 0x8180, { 0, 0, 8}}, + {m68k_op_unpk_16_mm , 0xf1f8, 0x8188, { 0, 0, 13}}, + {m68k_op_or_32_re_ai , 0xf1f8, 0x8190, { 20, 20, 8}}, + {m68k_op_or_32_re_pi , 0xf1f8, 0x8198, { 20, 20, 8}}, + {m68k_op_or_32_re_pd , 0xf1f8, 0x81a0, { 22, 22, 9}}, + {m68k_op_or_32_re_di , 0xf1f8, 0x81a8, { 24, 24, 9}}, + {m68k_op_or_32_re_ix , 0xf1f8, 0x81b0, { 26, 26, 11}}, + {m68k_op_divs_16_d , 0xf1f8, 0x81c0, {158, 122, 56}}, + {m68k_op_divs_16_ai , 0xf1f8, 0x81d0, {162, 126, 60}}, + {m68k_op_divs_16_pi , 0xf1f8, 0x81d8, {162, 126, 60}}, + {m68k_op_divs_16_pd , 0xf1f8, 0x81e0, {164, 128, 61}}, + {m68k_op_divs_16_di , 0xf1f8, 0x81e8, {166, 130, 61}}, + {m68k_op_divs_16_ix , 0xf1f8, 0x81f0, {168, 132, 63}}, + {m68k_op_sub_8_er_d , 0xf1f8, 0x9000, { 4, 4, 2}}, + {m68k_op_sub_8_er_ai , 0xf1f8, 0x9010, { 8, 8, 6}}, + {m68k_op_sub_8_er_pi , 0xf1f8, 0x9018, { 8, 8, 6}}, + {m68k_op_sub_8_er_pd , 0xf1f8, 0x9020, { 10, 10, 7}}, + {m68k_op_sub_8_er_di , 0xf1f8, 0x9028, { 12, 12, 7}}, + {m68k_op_sub_8_er_ix , 0xf1f8, 0x9030, { 14, 14, 9}}, + {m68k_op_sub_16_er_d , 0xf1f8, 0x9040, { 4, 4, 2}}, + {m68k_op_sub_16_er_a , 0xf1f8, 0x9048, { 4, 4, 2}}, + {m68k_op_sub_16_er_ai , 0xf1f8, 0x9050, { 8, 8, 6}}, + {m68k_op_sub_16_er_pi , 0xf1f8, 0x9058, { 8, 8, 6}}, + {m68k_op_sub_16_er_pd , 0xf1f8, 0x9060, { 10, 10, 7}}, + {m68k_op_sub_16_er_di , 0xf1f8, 0x9068, { 12, 12, 7}}, + {m68k_op_sub_16_er_ix , 0xf1f8, 0x9070, { 14, 14, 9}}, + {m68k_op_sub_32_er_d , 0xf1f8, 0x9080, { 6, 6, 2}}, + {m68k_op_sub_32_er_a , 0xf1f8, 0x9088, { 6, 6, 2}}, + {m68k_op_sub_32_er_ai , 0xf1f8, 0x9090, { 14, 14, 6}}, + {m68k_op_sub_32_er_pi , 0xf1f8, 0x9098, { 14, 14, 6}}, + {m68k_op_sub_32_er_pd , 0xf1f8, 0x90a0, { 16, 16, 7}}, + {m68k_op_sub_32_er_di , 0xf1f8, 0x90a8, { 18, 18, 7}}, + {m68k_op_sub_32_er_ix , 0xf1f8, 0x90b0, { 20, 20, 9}}, + {m68k_op_suba_16_d , 0xf1f8, 0x90c0, { 8, 8, 2}}, + {m68k_op_suba_16_a , 0xf1f8, 0x90c8, { 8, 8, 2}}, + {m68k_op_suba_16_ai , 0xf1f8, 0x90d0, { 12, 12, 6}}, + {m68k_op_suba_16_pi , 0xf1f8, 0x90d8, { 12, 12, 6}}, + {m68k_op_suba_16_pd , 0xf1f8, 0x90e0, { 14, 14, 7}}, + {m68k_op_suba_16_di , 0xf1f8, 0x90e8, { 16, 16, 7}}, + {m68k_op_suba_16_ix , 0xf1f8, 0x90f0, { 18, 18, 9}}, + {m68k_op_subx_8_rr , 0xf1f8, 0x9100, { 4, 4, 2}}, + {m68k_op_subx_8_mm , 0xf1f8, 0x9108, { 18, 18, 12}}, + {m68k_op_sub_8_re_ai , 0xf1f8, 0x9110, { 12, 12, 8}}, + {m68k_op_sub_8_re_pi , 0xf1f8, 0x9118, { 12, 12, 8}}, + {m68k_op_sub_8_re_pd , 0xf1f8, 0x9120, { 14, 14, 9}}, + {m68k_op_sub_8_re_di , 0xf1f8, 0x9128, { 16, 16, 9}}, + {m68k_op_sub_8_re_ix , 0xf1f8, 0x9130, { 18, 18, 11}}, + {m68k_op_subx_16_rr , 0xf1f8, 0x9140, { 4, 4, 2}}, + {m68k_op_subx_16_mm , 0xf1f8, 0x9148, { 18, 18, 12}}, + {m68k_op_sub_16_re_ai , 0xf1f8, 0x9150, { 12, 12, 8}}, + {m68k_op_sub_16_re_pi , 0xf1f8, 0x9158, { 12, 12, 8}}, + {m68k_op_sub_16_re_pd , 0xf1f8, 0x9160, { 14, 14, 9}}, + {m68k_op_sub_16_re_di , 0xf1f8, 0x9168, { 16, 16, 9}}, + {m68k_op_sub_16_re_ix , 0xf1f8, 0x9170, { 18, 18, 11}}, + {m68k_op_subx_32_rr , 0xf1f8, 0x9180, { 8, 6, 2}}, + {m68k_op_subx_32_mm , 0xf1f8, 0x9188, { 30, 30, 12}}, + {m68k_op_sub_32_re_ai , 0xf1f8, 0x9190, { 20, 20, 8}}, + {m68k_op_sub_32_re_pi , 0xf1f8, 0x9198, { 20, 20, 8}}, + {m68k_op_sub_32_re_pd , 0xf1f8, 0x91a0, { 22, 22, 9}}, + {m68k_op_sub_32_re_di , 0xf1f8, 0x91a8, { 24, 24, 9}}, + {m68k_op_sub_32_re_ix , 0xf1f8, 0x91b0, { 26, 26, 11}}, + {m68k_op_suba_32_d , 0xf1f8, 0x91c0, { 6, 6, 2}}, + {m68k_op_suba_32_a , 0xf1f8, 0x91c8, { 6, 6, 2}}, + {m68k_op_suba_32_ai , 0xf1f8, 0x91d0, { 14, 14, 6}}, + {m68k_op_suba_32_pi , 0xf1f8, 0x91d8, { 14, 14, 6}}, + {m68k_op_suba_32_pd , 0xf1f8, 0x91e0, { 16, 16, 7}}, + {m68k_op_suba_32_di , 0xf1f8, 0x91e8, { 18, 18, 7}}, + {m68k_op_suba_32_ix , 0xf1f8, 0x91f0, { 20, 20, 9}}, + {m68k_op_cmp_8_d , 0xf1f8, 0xb000, { 4, 4, 2}}, + {m68k_op_cmp_8_ai , 0xf1f8, 0xb010, { 8, 8, 6}}, + {m68k_op_cmp_8_pi , 0xf1f8, 0xb018, { 8, 8, 6}}, + {m68k_op_cmp_8_pd , 0xf1f8, 0xb020, { 10, 10, 7}}, + {m68k_op_cmp_8_di , 0xf1f8, 0xb028, { 12, 12, 7}}, + {m68k_op_cmp_8_ix , 0xf1f8, 0xb030, { 14, 14, 9}}, + {m68k_op_cmp_16_d , 0xf1f8, 0xb040, { 4, 4, 2}}, + {m68k_op_cmp_16_a , 0xf1f8, 0xb048, { 4, 4, 2}}, + {m68k_op_cmp_16_ai , 0xf1f8, 0xb050, { 8, 8, 6}}, + {m68k_op_cmp_16_pi , 0xf1f8, 0xb058, { 8, 8, 6}}, + {m68k_op_cmp_16_pd , 0xf1f8, 0xb060, { 10, 10, 7}}, + {m68k_op_cmp_16_di , 0xf1f8, 0xb068, { 12, 12, 7}}, + {m68k_op_cmp_16_ix , 0xf1f8, 0xb070, { 14, 14, 9}}, + {m68k_op_cmp_32_d , 0xf1f8, 0xb080, { 6, 6, 2}}, + {m68k_op_cmp_32_a , 0xf1f8, 0xb088, { 6, 6, 2}}, + {m68k_op_cmp_32_ai , 0xf1f8, 0xb090, { 14, 14, 6}}, + {m68k_op_cmp_32_pi , 0xf1f8, 0xb098, { 14, 14, 6}}, + {m68k_op_cmp_32_pd , 0xf1f8, 0xb0a0, { 16, 16, 7}}, + {m68k_op_cmp_32_di , 0xf1f8, 0xb0a8, { 18, 18, 7}}, + {m68k_op_cmp_32_ix , 0xf1f8, 0xb0b0, { 20, 20, 9}}, + {m68k_op_cmpa_16_d , 0xf1f8, 0xb0c0, { 6, 6, 4}}, + {m68k_op_cmpa_16_a , 0xf1f8, 0xb0c8, { 6, 6, 4}}, + {m68k_op_cmpa_16_ai , 0xf1f8, 0xb0d0, { 10, 10, 8}}, + {m68k_op_cmpa_16_pi , 0xf1f8, 0xb0d8, { 10, 10, 8}}, + {m68k_op_cmpa_16_pd , 0xf1f8, 0xb0e0, { 12, 12, 9}}, + {m68k_op_cmpa_16_di , 0xf1f8, 0xb0e8, { 14, 14, 9}}, + {m68k_op_cmpa_16_ix , 0xf1f8, 0xb0f0, { 16, 16, 11}}, + {m68k_op_eor_8_d , 0xf1f8, 0xb100, { 4, 4, 2}}, + {m68k_op_cmpm_8 , 0xf1f8, 0xb108, { 12, 12, 9}}, + {m68k_op_eor_8_ai , 0xf1f8, 0xb110, { 12, 12, 8}}, + {m68k_op_eor_8_pi , 0xf1f8, 0xb118, { 12, 12, 8}}, + {m68k_op_eor_8_pd , 0xf1f8, 0xb120, { 14, 14, 9}}, + {m68k_op_eor_8_di , 0xf1f8, 0xb128, { 16, 16, 9}}, + {m68k_op_eor_8_ix , 0xf1f8, 0xb130, { 18, 18, 11}}, + {m68k_op_eor_16_d , 0xf1f8, 0xb140, { 4, 4, 2}}, + {m68k_op_cmpm_16 , 0xf1f8, 0xb148, { 12, 12, 9}}, + {m68k_op_eor_16_ai , 0xf1f8, 0xb150, { 12, 12, 8}}, + {m68k_op_eor_16_pi , 0xf1f8, 0xb158, { 12, 12, 8}}, + {m68k_op_eor_16_pd , 0xf1f8, 0xb160, { 14, 14, 9}}, + {m68k_op_eor_16_di , 0xf1f8, 0xb168, { 16, 16, 9}}, + {m68k_op_eor_16_ix , 0xf1f8, 0xb170, { 18, 18, 11}}, + {m68k_op_eor_32_d , 0xf1f8, 0xb180, { 8, 6, 2}}, + {m68k_op_cmpm_32 , 0xf1f8, 0xb188, { 20, 20, 9}}, + {m68k_op_eor_32_ai , 0xf1f8, 0xb190, { 20, 20, 8}}, + {m68k_op_eor_32_pi , 0xf1f8, 0xb198, { 20, 20, 8}}, + {m68k_op_eor_32_pd , 0xf1f8, 0xb1a0, { 22, 22, 9}}, + {m68k_op_eor_32_di , 0xf1f8, 0xb1a8, { 24, 24, 9}}, + {m68k_op_eor_32_ix , 0xf1f8, 0xb1b0, { 26, 26, 11}}, + {m68k_op_cmpa_32_d , 0xf1f8, 0xb1c0, { 6, 6, 4}}, + {m68k_op_cmpa_32_a , 0xf1f8, 0xb1c8, { 6, 6, 4}}, + {m68k_op_cmpa_32_ai , 0xf1f8, 0xb1d0, { 14, 14, 8}}, + {m68k_op_cmpa_32_pi , 0xf1f8, 0xb1d8, { 14, 14, 8}}, + {m68k_op_cmpa_32_pd , 0xf1f8, 0xb1e0, { 16, 16, 9}}, + {m68k_op_cmpa_32_di , 0xf1f8, 0xb1e8, { 18, 18, 9}}, + {m68k_op_cmpa_32_ix , 0xf1f8, 0xb1f0, { 20, 20, 11}}, + {m68k_op_and_8_er_d , 0xf1f8, 0xc000, { 4, 4, 2}}, + {m68k_op_and_8_er_ai , 0xf1f8, 0xc010, { 8, 8, 6}}, + {m68k_op_and_8_er_pi , 0xf1f8, 0xc018, { 8, 8, 6}}, + {m68k_op_and_8_er_pd , 0xf1f8, 0xc020, { 10, 10, 7}}, + {m68k_op_and_8_er_di , 0xf1f8, 0xc028, { 12, 12, 7}}, + {m68k_op_and_8_er_ix , 0xf1f8, 0xc030, { 14, 14, 9}}, + {m68k_op_and_16_er_d , 0xf1f8, 0xc040, { 4, 4, 2}}, + {m68k_op_and_16_er_ai , 0xf1f8, 0xc050, { 8, 8, 6}}, + {m68k_op_and_16_er_pi , 0xf1f8, 0xc058, { 8, 8, 6}}, + {m68k_op_and_16_er_pd , 0xf1f8, 0xc060, { 10, 10, 7}}, + {m68k_op_and_16_er_di , 0xf1f8, 0xc068, { 12, 12, 7}}, + {m68k_op_and_16_er_ix , 0xf1f8, 0xc070, { 14, 14, 9}}, + {m68k_op_and_32_er_d , 0xf1f8, 0xc080, { 6, 6, 2}}, + {m68k_op_and_32_er_ai , 0xf1f8, 0xc090, { 14, 14, 6}}, + {m68k_op_and_32_er_pi , 0xf1f8, 0xc098, { 14, 14, 6}}, + {m68k_op_and_32_er_pd , 0xf1f8, 0xc0a0, { 16, 16, 7}}, + {m68k_op_and_32_er_di , 0xf1f8, 0xc0a8, { 18, 18, 7}}, + {m68k_op_and_32_er_ix , 0xf1f8, 0xc0b0, { 20, 20, 9}}, + {m68k_op_mulu_16_d , 0xf1f8, 0xc0c0, { 54, 30, 27}}, + {m68k_op_mulu_16_ai , 0xf1f8, 0xc0d0, { 58, 34, 31}}, + {m68k_op_mulu_16_pi , 0xf1f8, 0xc0d8, { 58, 34, 31}}, + {m68k_op_mulu_16_pd , 0xf1f8, 0xc0e0, { 60, 36, 32}}, + {m68k_op_mulu_16_di , 0xf1f8, 0xc0e8, { 62, 38, 32}}, + {m68k_op_mulu_16_ix , 0xf1f8, 0xc0f0, { 64, 40, 34}}, + {m68k_op_abcd_8_rr , 0xf1f8, 0xc100, { 6, 6, 4}}, + {m68k_op_abcd_8_mm , 0xf1f8, 0xc108, { 18, 18, 16}}, + {m68k_op_and_8_re_ai , 0xf1f8, 0xc110, { 12, 12, 8}}, + {m68k_op_and_8_re_pi , 0xf1f8, 0xc118, { 12, 12, 8}}, + {m68k_op_and_8_re_pd , 0xf1f8, 0xc120, { 14, 14, 9}}, + {m68k_op_and_8_re_di , 0xf1f8, 0xc128, { 16, 16, 9}}, + {m68k_op_and_8_re_ix , 0xf1f8, 0xc130, { 18, 18, 11}}, + {m68k_op_exg_32_dd , 0xf1f8, 0xc140, { 6, 6, 2}}, + {m68k_op_exg_32_aa , 0xf1f8, 0xc148, { 6, 6, 2}}, + {m68k_op_and_16_re_ai , 0xf1f8, 0xc150, { 12, 12, 8}}, + {m68k_op_and_16_re_pi , 0xf1f8, 0xc158, { 12, 12, 8}}, + {m68k_op_and_16_re_pd , 0xf1f8, 0xc160, { 14, 14, 9}}, + {m68k_op_and_16_re_di , 0xf1f8, 0xc168, { 16, 16, 9}}, + {m68k_op_and_16_re_ix , 0xf1f8, 0xc170, { 18, 18, 11}}, + {m68k_op_exg_32_da , 0xf1f8, 0xc188, { 6, 6, 2}}, + {m68k_op_and_32_re_ai , 0xf1f8, 0xc190, { 20, 20, 8}}, + {m68k_op_and_32_re_pi , 0xf1f8, 0xc198, { 20, 20, 8}}, + {m68k_op_and_32_re_pd , 0xf1f8, 0xc1a0, { 22, 22, 9}}, + {m68k_op_and_32_re_di , 0xf1f8, 0xc1a8, { 24, 24, 9}}, + {m68k_op_and_32_re_ix , 0xf1f8, 0xc1b0, { 26, 26, 11}}, + {m68k_op_muls_16_d , 0xf1f8, 0xc1c0, { 54, 32, 27}}, + {m68k_op_muls_16_ai , 0xf1f8, 0xc1d0, { 58, 36, 31}}, + {m68k_op_muls_16_pi , 0xf1f8, 0xc1d8, { 58, 36, 31}}, + {m68k_op_muls_16_pd , 0xf1f8, 0xc1e0, { 60, 38, 32}}, + {m68k_op_muls_16_di , 0xf1f8, 0xc1e8, { 62, 40, 32}}, + {m68k_op_muls_16_ix , 0xf1f8, 0xc1f0, { 64, 42, 34}}, + {m68k_op_add_8_er_d , 0xf1f8, 0xd000, { 4, 4, 2}}, + {m68k_op_add_8_er_ai , 0xf1f8, 0xd010, { 8, 8, 6}}, + {m68k_op_add_8_er_pi , 0xf1f8, 0xd018, { 8, 8, 6}}, + {m68k_op_add_8_er_pd , 0xf1f8, 0xd020, { 10, 10, 7}}, + {m68k_op_add_8_er_di , 0xf1f8, 0xd028, { 12, 12, 7}}, + {m68k_op_add_8_er_ix , 0xf1f8, 0xd030, { 14, 14, 9}}, + {m68k_op_add_16_er_d , 0xf1f8, 0xd040, { 4, 4, 2}}, + {m68k_op_add_16_er_a , 0xf1f8, 0xd048, { 4, 4, 2}}, + {m68k_op_add_16_er_ai , 0xf1f8, 0xd050, { 8, 8, 6}}, + {m68k_op_add_16_er_pi , 0xf1f8, 0xd058, { 8, 8, 6}}, + {m68k_op_add_16_er_pd , 0xf1f8, 0xd060, { 10, 10, 7}}, + {m68k_op_add_16_er_di , 0xf1f8, 0xd068, { 12, 12, 7}}, + {m68k_op_add_16_er_ix , 0xf1f8, 0xd070, { 14, 14, 9}}, + {m68k_op_add_32_er_d , 0xf1f8, 0xd080, { 6, 6, 2}}, + {m68k_op_add_32_er_a , 0xf1f8, 0xd088, { 6, 6, 2}}, + {m68k_op_add_32_er_ai , 0xf1f8, 0xd090, { 14, 14, 6}}, + {m68k_op_add_32_er_pi , 0xf1f8, 0xd098, { 14, 14, 6}}, + {m68k_op_add_32_er_pd , 0xf1f8, 0xd0a0, { 16, 16, 7}}, + {m68k_op_add_32_er_di , 0xf1f8, 0xd0a8, { 18, 18, 7}}, + {m68k_op_add_32_er_ix , 0xf1f8, 0xd0b0, { 20, 20, 9}}, + {m68k_op_adda_16_d , 0xf1f8, 0xd0c0, { 8, 8, 2}}, + {m68k_op_adda_16_a , 0xf1f8, 0xd0c8, { 8, 8, 2}}, + {m68k_op_adda_16_ai , 0xf1f8, 0xd0d0, { 12, 12, 6}}, + {m68k_op_adda_16_pi , 0xf1f8, 0xd0d8, { 12, 12, 6}}, + {m68k_op_adda_16_pd , 0xf1f8, 0xd0e0, { 14, 14, 7}}, + {m68k_op_adda_16_di , 0xf1f8, 0xd0e8, { 16, 16, 7}}, + {m68k_op_adda_16_ix , 0xf1f8, 0xd0f0, { 18, 18, 9}}, + {m68k_op_addx_8_rr , 0xf1f8, 0xd100, { 4, 4, 2}}, + {m68k_op_addx_8_mm , 0xf1f8, 0xd108, { 18, 18, 12}}, + {m68k_op_add_8_re_ai , 0xf1f8, 0xd110, { 12, 12, 8}}, + {m68k_op_add_8_re_pi , 0xf1f8, 0xd118, { 12, 12, 8}}, + {m68k_op_add_8_re_pd , 0xf1f8, 0xd120, { 14, 14, 9}}, + {m68k_op_add_8_re_di , 0xf1f8, 0xd128, { 16, 16, 9}}, + {m68k_op_add_8_re_ix , 0xf1f8, 0xd130, { 18, 18, 11}}, + {m68k_op_addx_16_rr , 0xf1f8, 0xd140, { 4, 4, 2}}, + {m68k_op_addx_16_mm , 0xf1f8, 0xd148, { 18, 18, 12}}, + {m68k_op_add_16_re_ai , 0xf1f8, 0xd150, { 12, 12, 8}}, + {m68k_op_add_16_re_pi , 0xf1f8, 0xd158, { 12, 12, 8}}, + {m68k_op_add_16_re_pd , 0xf1f8, 0xd160, { 14, 14, 9}}, + {m68k_op_add_16_re_di , 0xf1f8, 0xd168, { 16, 16, 9}}, + {m68k_op_add_16_re_ix , 0xf1f8, 0xd170, { 18, 18, 11}}, + {m68k_op_addx_32_rr , 0xf1f8, 0xd180, { 8, 6, 2}}, + {m68k_op_addx_32_mm , 0xf1f8, 0xd188, { 30, 30, 12}}, + {m68k_op_add_32_re_ai , 0xf1f8, 0xd190, { 20, 20, 8}}, + {m68k_op_add_32_re_pi , 0xf1f8, 0xd198, { 20, 20, 8}}, + {m68k_op_add_32_re_pd , 0xf1f8, 0xd1a0, { 22, 22, 9}}, + {m68k_op_add_32_re_di , 0xf1f8, 0xd1a8, { 24, 24, 9}}, + {m68k_op_add_32_re_ix , 0xf1f8, 0xd1b0, { 26, 26, 11}}, + {m68k_op_adda_32_d , 0xf1f8, 0xd1c0, { 6, 6, 2}}, + {m68k_op_adda_32_a , 0xf1f8, 0xd1c8, { 6, 6, 2}}, + {m68k_op_adda_32_ai , 0xf1f8, 0xd1d0, { 14, 14, 6}}, + {m68k_op_adda_32_pi , 0xf1f8, 0xd1d8, { 14, 14, 6}}, + {m68k_op_adda_32_pd , 0xf1f8, 0xd1e0, { 16, 16, 7}}, + {m68k_op_adda_32_di , 0xf1f8, 0xd1e8, { 18, 18, 7}}, + {m68k_op_adda_32_ix , 0xf1f8, 0xd1f0, { 20, 20, 9}}, + {m68k_op_asr_8_s , 0xf1f8, 0xe000, { 6, 6, 6}}, + {m68k_op_lsr_8_s , 0xf1f8, 0xe008, { 6, 6, 4}}, + {m68k_op_roxr_8_s , 0xf1f8, 0xe010, { 6, 6, 12}}, + {m68k_op_ror_8_s , 0xf1f8, 0xe018, { 6, 6, 8}}, + {m68k_op_asr_8_r , 0xf1f8, 0xe020, { 6, 6, 6}}, + {m68k_op_lsr_8_r , 0xf1f8, 0xe028, { 6, 6, 6}}, + {m68k_op_roxr_8_r , 0xf1f8, 0xe030, { 6, 6, 12}}, + {m68k_op_ror_8_r , 0xf1f8, 0xe038, { 6, 6, 8}}, + {m68k_op_asr_16_s , 0xf1f8, 0xe040, { 6, 6, 6}}, + {m68k_op_lsr_16_s , 0xf1f8, 0xe048, { 6, 6, 4}}, + {m68k_op_roxr_16_s , 0xf1f8, 0xe050, { 6, 6, 12}}, + {m68k_op_ror_16_s , 0xf1f8, 0xe058, { 6, 6, 8}}, + {m68k_op_asr_16_r , 0xf1f8, 0xe060, { 6, 6, 6}}, + {m68k_op_lsr_16_r , 0xf1f8, 0xe068, { 6, 6, 6}}, + {m68k_op_roxr_16_r , 0xf1f8, 0xe070, { 6, 6, 12}}, + {m68k_op_ror_16_r , 0xf1f8, 0xe078, { 6, 6, 8}}, + {m68k_op_asr_32_s , 0xf1f8, 0xe080, { 8, 8, 6}}, + {m68k_op_lsr_32_s , 0xf1f8, 0xe088, { 8, 8, 4}}, + {m68k_op_roxr_32_s , 0xf1f8, 0xe090, { 8, 8, 12}}, + {m68k_op_ror_32_s , 0xf1f8, 0xe098, { 8, 8, 8}}, + {m68k_op_asr_32_r , 0xf1f8, 0xe0a0, { 8, 8, 6}}, + {m68k_op_lsr_32_r , 0xf1f8, 0xe0a8, { 8, 8, 6}}, + {m68k_op_roxr_32_r , 0xf1f8, 0xe0b0, { 8, 8, 12}}, + {m68k_op_ror_32_r , 0xf1f8, 0xe0b8, { 8, 8, 8}}, + {m68k_op_asl_8_s , 0xf1f8, 0xe100, { 6, 6, 8}}, + {m68k_op_lsl_8_s , 0xf1f8, 0xe108, { 6, 6, 4}}, + {m68k_op_roxl_8_s , 0xf1f8, 0xe110, { 6, 6, 12}}, + {m68k_op_rol_8_s , 0xf1f8, 0xe118, { 6, 6, 8}}, + {m68k_op_asl_8_r , 0xf1f8, 0xe120, { 6, 6, 8}}, + {m68k_op_lsl_8_r , 0xf1f8, 0xe128, { 6, 6, 6}}, + {m68k_op_roxl_8_r , 0xf1f8, 0xe130, { 6, 6, 12}}, + {m68k_op_rol_8_r , 0xf1f8, 0xe138, { 6, 6, 8}}, + {m68k_op_asl_16_s , 0xf1f8, 0xe140, { 6, 6, 8}}, + {m68k_op_lsl_16_s , 0xf1f8, 0xe148, { 6, 6, 4}}, + {m68k_op_roxl_16_s , 0xf1f8, 0xe150, { 6, 6, 12}}, + {m68k_op_rol_16_s , 0xf1f8, 0xe158, { 6, 6, 8}}, + {m68k_op_asl_16_r , 0xf1f8, 0xe160, { 6, 6, 8}}, + {m68k_op_lsl_16_r , 0xf1f8, 0xe168, { 6, 6, 6}}, + {m68k_op_roxl_16_r , 0xf1f8, 0xe170, { 6, 6, 12}}, + {m68k_op_rol_16_r , 0xf1f8, 0xe178, { 6, 6, 8}}, + {m68k_op_asl_32_s , 0xf1f8, 0xe180, { 8, 8, 8}}, + {m68k_op_lsl_32_s , 0xf1f8, 0xe188, { 8, 8, 4}}, + {m68k_op_roxl_32_s , 0xf1f8, 0xe190, { 8, 8, 12}}, + {m68k_op_rol_32_s , 0xf1f8, 0xe198, { 8, 8, 8}}, + {m68k_op_asl_32_r , 0xf1f8, 0xe1a0, { 8, 8, 8}}, + {m68k_op_lsl_32_r , 0xf1f8, 0xe1a8, { 8, 8, 6}}, + {m68k_op_roxl_32_r , 0xf1f8, 0xe1b0, { 8, 8, 12}}, + {m68k_op_rol_32_r , 0xf1f8, 0xe1b8, { 8, 8, 8}}, + {m68k_op_cpdbcc_32 , 0xf1f8, 0xf048, { 0, 0, 4}}, + {m68k_op_cptrapcc_32 , 0xf1f8, 0xf078, { 0, 0, 4}}, + {m68k_op_rtm_32 , 0xfff0, 0x06c0, { 0, 0, 19}}, + {m68k_op_trap , 0xfff0, 0x4e40, { 4, 4, 4}}, + {m68k_op_btst_8_r_pi7 , 0xf1ff, 0x011f, { 8, 8, 8}}, + {m68k_op_btst_8_r_pd7 , 0xf1ff, 0x0127, { 10, 10, 9}}, + {m68k_op_btst_8_r_aw , 0xf1ff, 0x0138, { 12, 12, 8}}, + {m68k_op_btst_8_r_al , 0xf1ff, 0x0139, { 16, 16, 8}}, + {m68k_op_btst_8_r_pcdi , 0xf1ff, 0x013a, { 12, 12, 9}}, + {m68k_op_btst_8_r_pcix , 0xf1ff, 0x013b, { 14, 14, 11}}, + {m68k_op_btst_8_r_i , 0xf1ff, 0x013c, { 8, 8, 6}}, + {m68k_op_bchg_8_r_pi7 , 0xf1ff, 0x015f, { 12, 12, 8}}, + {m68k_op_bchg_8_r_pd7 , 0xf1ff, 0x0167, { 14, 14, 9}}, + {m68k_op_bchg_8_r_aw , 0xf1ff, 0x0178, { 16, 16, 8}}, + {m68k_op_bchg_8_r_al , 0xf1ff, 0x0179, { 20, 20, 8}}, + {m68k_op_bclr_8_r_pi7 , 0xf1ff, 0x019f, { 12, 14, 8}}, + {m68k_op_bclr_8_r_pd7 , 0xf1ff, 0x01a7, { 14, 16, 9}}, + {m68k_op_bclr_8_r_aw , 0xf1ff, 0x01b8, { 16, 18, 8}}, + {m68k_op_bclr_8_r_al , 0xf1ff, 0x01b9, { 20, 22, 8}}, + {m68k_op_bset_8_r_pi7 , 0xf1ff, 0x01df, { 12, 12, 8}}, + {m68k_op_bset_8_r_pd7 , 0xf1ff, 0x01e7, { 14, 14, 9}}, + {m68k_op_bset_8_r_aw , 0xf1ff, 0x01f8, { 16, 16, 8}}, + {m68k_op_bset_8_r_al , 0xf1ff, 0x01f9, { 20, 20, 8}}, + {m68k_op_move_8_d_pi7 , 0xf1ff, 0x101f, { 8, 8, 6}}, + {m68k_op_move_8_d_pd7 , 0xf1ff, 0x1027, { 10, 10, 7}}, + {m68k_op_move_8_d_aw , 0xf1ff, 0x1038, { 12, 12, 6}}, + {m68k_op_move_8_d_al , 0xf1ff, 0x1039, { 16, 16, 6}}, + {m68k_op_move_8_d_pcdi , 0xf1ff, 0x103a, { 12, 12, 7}}, + {m68k_op_move_8_d_pcix , 0xf1ff, 0x103b, { 14, 14, 9}}, + {m68k_op_move_8_d_i , 0xf1ff, 0x103c, { 8, 8, 4}}, + {m68k_op_move_8_ai_pi7 , 0xf1ff, 0x109f, { 12, 12, 8}}, + {m68k_op_move_8_ai_pd7 , 0xf1ff, 0x10a7, { 14, 14, 9}}, + {m68k_op_move_8_ai_aw , 0xf1ff, 0x10b8, { 16, 16, 8}}, + {m68k_op_move_8_ai_al , 0xf1ff, 0x10b9, { 20, 20, 8}}, + {m68k_op_move_8_ai_pcdi , 0xf1ff, 0x10ba, { 16, 16, 9}}, + {m68k_op_move_8_ai_pcix , 0xf1ff, 0x10bb, { 18, 18, 11}}, + {m68k_op_move_8_ai_i , 0xf1ff, 0x10bc, { 12, 12, 6}}, + {m68k_op_move_8_pi_pi7 , 0xf1ff, 0x10df, { 12, 12, 8}}, + {m68k_op_move_8_pi_pd7 , 0xf1ff, 0x10e7, { 14, 14, 9}}, + {m68k_op_move_8_pi_aw , 0xf1ff, 0x10f8, { 16, 16, 8}}, + {m68k_op_move_8_pi_al , 0xf1ff, 0x10f9, { 20, 20, 8}}, + {m68k_op_move_8_pi_pcdi , 0xf1ff, 0x10fa, { 16, 16, 9}}, + {m68k_op_move_8_pi_pcix , 0xf1ff, 0x10fb, { 18, 18, 11}}, + {m68k_op_move_8_pi_i , 0xf1ff, 0x10fc, { 12, 12, 6}}, + {m68k_op_move_8_pd_pi7 , 0xf1ff, 0x111f, { 12, 12, 9}}, + {m68k_op_move_8_pd_pd7 , 0xf1ff, 0x1127, { 14, 14, 10}}, + {m68k_op_move_8_pd_aw , 0xf1ff, 0x1138, { 16, 16, 9}}, + {m68k_op_move_8_pd_al , 0xf1ff, 0x1139, { 20, 20, 9}}, + {m68k_op_move_8_pd_pcdi , 0xf1ff, 0x113a, { 16, 16, 10}}, + {m68k_op_move_8_pd_pcix , 0xf1ff, 0x113b, { 18, 18, 12}}, + {m68k_op_move_8_pd_i , 0xf1ff, 0x113c, { 12, 12, 7}}, + {m68k_op_move_8_di_pi7 , 0xf1ff, 0x115f, { 16, 16, 9}}, + {m68k_op_move_8_di_pd7 , 0xf1ff, 0x1167, { 18, 18, 10}}, + {m68k_op_move_8_di_aw , 0xf1ff, 0x1178, { 20, 20, 9}}, + {m68k_op_move_8_di_al , 0xf1ff, 0x1179, { 24, 24, 9}}, + {m68k_op_move_8_di_pcdi , 0xf1ff, 0x117a, { 20, 20, 10}}, + {m68k_op_move_8_di_pcix , 0xf1ff, 0x117b, { 22, 22, 12}}, + {m68k_op_move_8_di_i , 0xf1ff, 0x117c, { 16, 16, 7}}, + {m68k_op_move_8_ix_pi7 , 0xf1ff, 0x119f, { 18, 18, 11}}, + {m68k_op_move_8_ix_pd7 , 0xf1ff, 0x11a7, { 20, 20, 12}}, + {m68k_op_move_8_ix_aw , 0xf1ff, 0x11b8, { 22, 22, 11}}, + {m68k_op_move_8_ix_al , 0xf1ff, 0x11b9, { 26, 26, 11}}, + {m68k_op_move_8_ix_pcdi , 0xf1ff, 0x11ba, { 22, 22, 12}}, + {m68k_op_move_8_ix_pcix , 0xf1ff, 0x11bb, { 24, 24, 14}}, + {m68k_op_move_8_ix_i , 0xf1ff, 0x11bc, { 18, 18, 9}}, + {m68k_op_move_32_d_aw , 0xf1ff, 0x2038, { 16, 16, 6}}, + {m68k_op_move_32_d_al , 0xf1ff, 0x2039, { 20, 20, 6}}, + {m68k_op_move_32_d_pcdi , 0xf1ff, 0x203a, { 16, 16, 7}}, + {m68k_op_move_32_d_pcix , 0xf1ff, 0x203b, { 18, 18, 9}}, + {m68k_op_move_32_d_i , 0xf1ff, 0x203c, { 12, 12, 6}}, + {m68k_op_movea_32_aw , 0xf1ff, 0x2078, { 16, 16, 6}}, + {m68k_op_movea_32_al , 0xf1ff, 0x2079, { 20, 20, 6}}, + {m68k_op_movea_32_pcdi , 0xf1ff, 0x207a, { 16, 16, 7}}, + {m68k_op_movea_32_pcix , 0xf1ff, 0x207b, { 18, 18, 9}}, + {m68k_op_movea_32_i , 0xf1ff, 0x207c, { 12, 12, 6}}, + {m68k_op_move_32_ai_aw , 0xf1ff, 0x20b8, { 24, 24, 8}}, + {m68k_op_move_32_ai_al , 0xf1ff, 0x20b9, { 28, 28, 8}}, + {m68k_op_move_32_ai_pcdi , 0xf1ff, 0x20ba, { 24, 24, 9}}, + {m68k_op_move_32_ai_pcix , 0xf1ff, 0x20bb, { 26, 26, 11}}, + {m68k_op_move_32_ai_i , 0xf1ff, 0x20bc, { 20, 20, 8}}, + {m68k_op_move_32_pi_aw , 0xf1ff, 0x20f8, { 24, 24, 8}}, + {m68k_op_move_32_pi_al , 0xf1ff, 0x20f9, { 28, 28, 8}}, + {m68k_op_move_32_pi_pcdi , 0xf1ff, 0x20fa, { 24, 24, 9}}, + {m68k_op_move_32_pi_pcix , 0xf1ff, 0x20fb, { 26, 26, 11}}, + {m68k_op_move_32_pi_i , 0xf1ff, 0x20fc, { 20, 20, 8}}, + {m68k_op_move_32_pd_aw , 0xf1ff, 0x2138, { 24, 26, 9}}, + {m68k_op_move_32_pd_al , 0xf1ff, 0x2139, { 28, 30, 9}}, + {m68k_op_move_32_pd_pcdi , 0xf1ff, 0x213a, { 24, 26, 10}}, + {m68k_op_move_32_pd_pcix , 0xf1ff, 0x213b, { 26, 28, 12}}, + {m68k_op_move_32_pd_i , 0xf1ff, 0x213c, { 20, 22, 9}}, + {m68k_op_move_32_di_aw , 0xf1ff, 0x2178, { 28, 28, 9}}, + {m68k_op_move_32_di_al , 0xf1ff, 0x2179, { 32, 32, 9}}, + {m68k_op_move_32_di_pcdi , 0xf1ff, 0x217a, { 28, 28, 10}}, + {m68k_op_move_32_di_pcix , 0xf1ff, 0x217b, { 30, 30, 12}}, + {m68k_op_move_32_di_i , 0xf1ff, 0x217c, { 24, 24, 9}}, + {m68k_op_move_32_ix_aw , 0xf1ff, 0x21b8, { 30, 30, 11}}, + {m68k_op_move_32_ix_al , 0xf1ff, 0x21b9, { 34, 34, 11}}, + {m68k_op_move_32_ix_pcdi , 0xf1ff, 0x21ba, { 30, 30, 12}}, + {m68k_op_move_32_ix_pcix , 0xf1ff, 0x21bb, { 32, 32, 14}}, + {m68k_op_move_32_ix_i , 0xf1ff, 0x21bc, { 26, 26, 11}}, + {m68k_op_move_16_d_aw , 0xf1ff, 0x3038, { 12, 12, 6}}, + {m68k_op_move_16_d_al , 0xf1ff, 0x3039, { 16, 16, 6}}, + {m68k_op_move_16_d_pcdi , 0xf1ff, 0x303a, { 12, 12, 7}}, + {m68k_op_move_16_d_pcix , 0xf1ff, 0x303b, { 14, 14, 9}}, + {m68k_op_move_16_d_i , 0xf1ff, 0x303c, { 8, 8, 4}}, + {m68k_op_movea_16_aw , 0xf1ff, 0x3078, { 12, 12, 6}}, + {m68k_op_movea_16_al , 0xf1ff, 0x3079, { 16, 16, 6}}, + {m68k_op_movea_16_pcdi , 0xf1ff, 0x307a, { 12, 12, 7}}, + {m68k_op_movea_16_pcix , 0xf1ff, 0x307b, { 14, 14, 9}}, + {m68k_op_movea_16_i , 0xf1ff, 0x307c, { 8, 8, 4}}, + {m68k_op_move_16_ai_aw , 0xf1ff, 0x30b8, { 16, 16, 8}}, + {m68k_op_move_16_ai_al , 0xf1ff, 0x30b9, { 20, 20, 8}}, + {m68k_op_move_16_ai_pcdi , 0xf1ff, 0x30ba, { 16, 16, 9}}, + {m68k_op_move_16_ai_pcix , 0xf1ff, 0x30bb, { 18, 18, 11}}, + {m68k_op_move_16_ai_i , 0xf1ff, 0x30bc, { 12, 12, 6}}, + {m68k_op_move_16_pi_aw , 0xf1ff, 0x30f8, { 16, 16, 8}}, + {m68k_op_move_16_pi_al , 0xf1ff, 0x30f9, { 20, 20, 8}}, + {m68k_op_move_16_pi_pcdi , 0xf1ff, 0x30fa, { 16, 16, 9}}, + {m68k_op_move_16_pi_pcix , 0xf1ff, 0x30fb, { 18, 18, 11}}, + {m68k_op_move_16_pi_i , 0xf1ff, 0x30fc, { 12, 12, 6}}, + {m68k_op_move_16_pd_aw , 0xf1ff, 0x3138, { 16, 16, 9}}, + {m68k_op_move_16_pd_al , 0xf1ff, 0x3139, { 20, 20, 9}}, + {m68k_op_move_16_pd_pcdi , 0xf1ff, 0x313a, { 16, 16, 10}}, + {m68k_op_move_16_pd_pcix , 0xf1ff, 0x313b, { 18, 18, 12}}, + {m68k_op_move_16_pd_i , 0xf1ff, 0x313c, { 12, 12, 7}}, + {m68k_op_move_16_di_aw , 0xf1ff, 0x3178, { 20, 20, 9}}, + {m68k_op_move_16_di_al , 0xf1ff, 0x3179, { 24, 24, 9}}, + {m68k_op_move_16_di_pcdi , 0xf1ff, 0x317a, { 20, 20, 10}}, + {m68k_op_move_16_di_pcix , 0xf1ff, 0x317b, { 22, 22, 12}}, + {m68k_op_move_16_di_i , 0xf1ff, 0x317c, { 16, 16, 7}}, + {m68k_op_move_16_ix_aw , 0xf1ff, 0x31b8, { 22, 22, 11}}, + {m68k_op_move_16_ix_al , 0xf1ff, 0x31b9, { 26, 26, 11}}, + {m68k_op_move_16_ix_pcdi , 0xf1ff, 0x31ba, { 22, 22, 12}}, + {m68k_op_move_16_ix_pcix , 0xf1ff, 0x31bb, { 24, 24, 14}}, + {m68k_op_move_16_ix_i , 0xf1ff, 0x31bc, { 18, 18, 9}}, + {m68k_op_chk_32_aw , 0xf1ff, 0x4138, { 0, 0, 12}}, + {m68k_op_chk_32_al , 0xf1ff, 0x4139, { 0, 0, 12}}, + {m68k_op_chk_32_pcdi , 0xf1ff, 0x413a, { 0, 0, 13}}, + {m68k_op_chk_32_pcix , 0xf1ff, 0x413b, { 0, 0, 15}}, + {m68k_op_chk_32_i , 0xf1ff, 0x413c, { 0, 0, 12}}, + {m68k_op_chk_16_aw , 0xf1ff, 0x41b8, { 18, 16, 12}}, + {m68k_op_chk_16_al , 0xf1ff, 0x41b9, { 22, 20, 12}}, + {m68k_op_chk_16_pcdi , 0xf1ff, 0x41ba, { 18, 16, 13}}, + {m68k_op_chk_16_pcix , 0xf1ff, 0x41bb, { 20, 18, 15}}, + {m68k_op_chk_16_i , 0xf1ff, 0x41bc, { 14, 12, 10}}, + {m68k_op_lea_32_aw , 0xf1ff, 0x41f8, { 8, 8, 6}}, + {m68k_op_lea_32_al , 0xf1ff, 0x41f9, { 12, 12, 6}}, + {m68k_op_lea_32_pcdi , 0xf1ff, 0x41fa, { 8, 8, 7}}, + {m68k_op_lea_32_pcix , 0xf1ff, 0x41fb, { 12, 12, 9}}, + {m68k_op_addq_8_pi7 , 0xf1ff, 0x501f, { 12, 12, 8}}, + {m68k_op_addq_8_pd7 , 0xf1ff, 0x5027, { 14, 14, 9}}, + {m68k_op_addq_8_aw , 0xf1ff, 0x5038, { 16, 16, 8}}, + {m68k_op_addq_8_al , 0xf1ff, 0x5039, { 20, 20, 8}}, + {m68k_op_addq_16_aw , 0xf1ff, 0x5078, { 16, 16, 8}}, + {m68k_op_addq_16_al , 0xf1ff, 0x5079, { 20, 20, 8}}, + {m68k_op_addq_32_aw , 0xf1ff, 0x50b8, { 24, 24, 8}}, + {m68k_op_addq_32_al , 0xf1ff, 0x50b9, { 28, 28, 8}}, + {m68k_op_subq_8_pi7 , 0xf1ff, 0x511f, { 12, 12, 8}}, + {m68k_op_subq_8_pd7 , 0xf1ff, 0x5127, { 14, 14, 9}}, + {m68k_op_subq_8_aw , 0xf1ff, 0x5138, { 16, 16, 8}}, + {m68k_op_subq_8_al , 0xf1ff, 0x5139, { 20, 20, 8}}, + {m68k_op_subq_16_aw , 0xf1ff, 0x5178, { 16, 16, 8}}, + {m68k_op_subq_16_al , 0xf1ff, 0x5179, { 20, 20, 8}}, + {m68k_op_subq_32_aw , 0xf1ff, 0x51b8, { 24, 24, 8}}, + {m68k_op_subq_32_al , 0xf1ff, 0x51b9, { 28, 28, 8}}, + {m68k_op_or_8_er_pi7 , 0xf1ff, 0x801f, { 8, 8, 6}}, + {m68k_op_or_8_er_pd7 , 0xf1ff, 0x8027, { 10, 10, 7}}, + {m68k_op_or_8_er_aw , 0xf1ff, 0x8038, { 12, 12, 6}}, + {m68k_op_or_8_er_al , 0xf1ff, 0x8039, { 16, 16, 6}}, + {m68k_op_or_8_er_pcdi , 0xf1ff, 0x803a, { 12, 12, 7}}, + {m68k_op_or_8_er_pcix , 0xf1ff, 0x803b, { 14, 14, 9}}, + {m68k_op_or_8_er_i , 0xf1ff, 0x803c, { 10, 8, 4}}, + {m68k_op_or_16_er_aw , 0xf1ff, 0x8078, { 12, 12, 6}}, + {m68k_op_or_16_er_al , 0xf1ff, 0x8079, { 16, 16, 6}}, + {m68k_op_or_16_er_pcdi , 0xf1ff, 0x807a, { 12, 12, 7}}, + {m68k_op_or_16_er_pcix , 0xf1ff, 0x807b, { 14, 14, 9}}, + {m68k_op_or_16_er_i , 0xf1ff, 0x807c, { 10, 8, 4}}, + {m68k_op_or_32_er_aw , 0xf1ff, 0x80b8, { 18, 18, 6}}, + {m68k_op_or_32_er_al , 0xf1ff, 0x80b9, { 22, 22, 6}}, + {m68k_op_or_32_er_pcdi , 0xf1ff, 0x80ba, { 18, 18, 7}}, + {m68k_op_or_32_er_pcix , 0xf1ff, 0x80bb, { 20, 20, 9}}, + {m68k_op_or_32_er_i , 0xf1ff, 0x80bc, { 16, 14, 6}}, + {m68k_op_divu_16_aw , 0xf1ff, 0x80f8, {148, 116, 48}}, + {m68k_op_divu_16_al , 0xf1ff, 0x80f9, {152, 120, 48}}, + {m68k_op_divu_16_pcdi , 0xf1ff, 0x80fa, {148, 116, 49}}, + {m68k_op_divu_16_pcix , 0xf1ff, 0x80fb, {150, 118, 51}}, + {m68k_op_divu_16_i , 0xf1ff, 0x80fc, {144, 112, 46}}, + {m68k_op_sbcd_8_mm_ay7 , 0xf1ff, 0x810f, { 18, 18, 16}}, + {m68k_op_or_8_re_pi7 , 0xf1ff, 0x811f, { 12, 12, 8}}, + {m68k_op_or_8_re_pd7 , 0xf1ff, 0x8127, { 14, 14, 9}}, + {m68k_op_or_8_re_aw , 0xf1ff, 0x8138, { 16, 16, 8}}, + {m68k_op_or_8_re_al , 0xf1ff, 0x8139, { 20, 20, 8}}, + {m68k_op_pack_16_mm_ay7 , 0xf1ff, 0x814f, { 0, 0, 13}}, + {m68k_op_or_16_re_aw , 0xf1ff, 0x8178, { 16, 16, 8}}, + {m68k_op_or_16_re_al , 0xf1ff, 0x8179, { 20, 20, 8}}, + {m68k_op_unpk_16_mm_ay7 , 0xf1ff, 0x818f, { 0, 0, 13}}, + {m68k_op_or_32_re_aw , 0xf1ff, 0x81b8, { 24, 24, 8}}, + {m68k_op_or_32_re_al , 0xf1ff, 0x81b9, { 28, 28, 8}}, + {m68k_op_divs_16_aw , 0xf1ff, 0x81f8, {166, 130, 60}}, + {m68k_op_divs_16_al , 0xf1ff, 0x81f9, {170, 134, 60}}, + {m68k_op_divs_16_pcdi , 0xf1ff, 0x81fa, {166, 130, 61}}, + {m68k_op_divs_16_pcix , 0xf1ff, 0x81fb, {168, 132, 63}}, + {m68k_op_divs_16_i , 0xf1ff, 0x81fc, {162, 126, 58}}, + {m68k_op_sub_8_er_pi7 , 0xf1ff, 0x901f, { 8, 8, 6}}, + {m68k_op_sub_8_er_pd7 , 0xf1ff, 0x9027, { 10, 10, 7}}, + {m68k_op_sub_8_er_aw , 0xf1ff, 0x9038, { 12, 12, 6}}, + {m68k_op_sub_8_er_al , 0xf1ff, 0x9039, { 16, 16, 6}}, + {m68k_op_sub_8_er_pcdi , 0xf1ff, 0x903a, { 12, 12, 7}}, + {m68k_op_sub_8_er_pcix , 0xf1ff, 0x903b, { 14, 14, 9}}, + {m68k_op_sub_8_er_i , 0xf1ff, 0x903c, { 10, 8, 4}}, + {m68k_op_sub_16_er_aw , 0xf1ff, 0x9078, { 12, 12, 6}}, + {m68k_op_sub_16_er_al , 0xf1ff, 0x9079, { 16, 16, 6}}, + {m68k_op_sub_16_er_pcdi , 0xf1ff, 0x907a, { 12, 12, 7}}, + {m68k_op_sub_16_er_pcix , 0xf1ff, 0x907b, { 14, 14, 9}}, + {m68k_op_sub_16_er_i , 0xf1ff, 0x907c, { 10, 8, 4}}, + {m68k_op_sub_32_er_aw , 0xf1ff, 0x90b8, { 18, 18, 6}}, + {m68k_op_sub_32_er_al , 0xf1ff, 0x90b9, { 22, 22, 6}}, + {m68k_op_sub_32_er_pcdi , 0xf1ff, 0x90ba, { 18, 18, 7}}, + {m68k_op_sub_32_er_pcix , 0xf1ff, 0x90bb, { 20, 20, 9}}, + {m68k_op_sub_32_er_i , 0xf1ff, 0x90bc, { 16, 14, 6}}, + {m68k_op_suba_16_aw , 0xf1ff, 0x90f8, { 16, 16, 6}}, + {m68k_op_suba_16_al , 0xf1ff, 0x90f9, { 20, 20, 6}}, + {m68k_op_suba_16_pcdi , 0xf1ff, 0x90fa, { 16, 16, 7}}, + {m68k_op_suba_16_pcix , 0xf1ff, 0x90fb, { 18, 18, 9}}, + {m68k_op_suba_16_i , 0xf1ff, 0x90fc, { 14, 12, 4}}, + {m68k_op_subx_8_mm_ay7 , 0xf1ff, 0x910f, { 18, 18, 12}}, + {m68k_op_sub_8_re_pi7 , 0xf1ff, 0x911f, { 12, 12, 8}}, + {m68k_op_sub_8_re_pd7 , 0xf1ff, 0x9127, { 14, 14, 9}}, + {m68k_op_sub_8_re_aw , 0xf1ff, 0x9138, { 16, 16, 8}}, + {m68k_op_sub_8_re_al , 0xf1ff, 0x9139, { 20, 20, 8}}, + {m68k_op_sub_16_re_aw , 0xf1ff, 0x9178, { 16, 16, 8}}, + {m68k_op_sub_16_re_al , 0xf1ff, 0x9179, { 20, 20, 8}}, + {m68k_op_sub_32_re_aw , 0xf1ff, 0x91b8, { 24, 24, 8}}, + {m68k_op_sub_32_re_al , 0xf1ff, 0x91b9, { 28, 28, 8}}, + {m68k_op_suba_32_aw , 0xf1ff, 0x91f8, { 18, 18, 6}}, + {m68k_op_suba_32_al , 0xf1ff, 0x91f9, { 22, 22, 6}}, + {m68k_op_suba_32_pcdi , 0xf1ff, 0x91fa, { 18, 18, 7}}, + {m68k_op_suba_32_pcix , 0xf1ff, 0x91fb, { 20, 20, 9}}, + {m68k_op_suba_32_i , 0xf1ff, 0x91fc, { 16, 14, 6}}, + {m68k_op_cmp_8_pi7 , 0xf1ff, 0xb01f, { 8, 8, 6}}, + {m68k_op_cmp_8_pd7 , 0xf1ff, 0xb027, { 10, 10, 7}}, + {m68k_op_cmp_8_aw , 0xf1ff, 0xb038, { 12, 12, 6}}, + {m68k_op_cmp_8_al , 0xf1ff, 0xb039, { 16, 16, 6}}, + {m68k_op_cmp_8_pcdi , 0xf1ff, 0xb03a, { 12, 12, 7}}, + {m68k_op_cmp_8_pcix , 0xf1ff, 0xb03b, { 14, 14, 9}}, + {m68k_op_cmp_8_i , 0xf1ff, 0xb03c, { 8, 8, 4}}, + {m68k_op_cmp_16_aw , 0xf1ff, 0xb078, { 12, 12, 6}}, + {m68k_op_cmp_16_al , 0xf1ff, 0xb079, { 16, 16, 6}}, + {m68k_op_cmp_16_pcdi , 0xf1ff, 0xb07a, { 12, 12, 7}}, + {m68k_op_cmp_16_pcix , 0xf1ff, 0xb07b, { 14, 14, 9}}, + {m68k_op_cmp_16_i , 0xf1ff, 0xb07c, { 8, 8, 4}}, + {m68k_op_cmp_32_aw , 0xf1ff, 0xb0b8, { 18, 18, 6}}, + {m68k_op_cmp_32_al , 0xf1ff, 0xb0b9, { 22, 22, 6}}, + {m68k_op_cmp_32_pcdi , 0xf1ff, 0xb0ba, { 18, 18, 7}}, + {m68k_op_cmp_32_pcix , 0xf1ff, 0xb0bb, { 20, 20, 9}}, + {m68k_op_cmp_32_i , 0xf1ff, 0xb0bc, { 14, 14, 6}}, + {m68k_op_cmpa_16_aw , 0xf1ff, 0xb0f8, { 14, 14, 8}}, + {m68k_op_cmpa_16_al , 0xf1ff, 0xb0f9, { 18, 18, 8}}, + {m68k_op_cmpa_16_pcdi , 0xf1ff, 0xb0fa, { 14, 14, 9}}, + {m68k_op_cmpa_16_pcix , 0xf1ff, 0xb0fb, { 16, 16, 11}}, + {m68k_op_cmpa_16_i , 0xf1ff, 0xb0fc, { 10, 10, 6}}, + {m68k_op_cmpm_8_ay7 , 0xf1ff, 0xb10f, { 12, 12, 9}}, + {m68k_op_eor_8_pi7 , 0xf1ff, 0xb11f, { 12, 12, 8}}, + {m68k_op_eor_8_pd7 , 0xf1ff, 0xb127, { 14, 14, 9}}, + {m68k_op_eor_8_aw , 0xf1ff, 0xb138, { 16, 16, 8}}, + {m68k_op_eor_8_al , 0xf1ff, 0xb139, { 20, 20, 8}}, + {m68k_op_eor_16_aw , 0xf1ff, 0xb178, { 16, 16, 8}}, + {m68k_op_eor_16_al , 0xf1ff, 0xb179, { 20, 20, 8}}, + {m68k_op_eor_32_aw , 0xf1ff, 0xb1b8, { 24, 24, 8}}, + {m68k_op_eor_32_al , 0xf1ff, 0xb1b9, { 28, 28, 8}}, + {m68k_op_cmpa_32_aw , 0xf1ff, 0xb1f8, { 18, 18, 8}}, + {m68k_op_cmpa_32_al , 0xf1ff, 0xb1f9, { 22, 22, 8}}, + {m68k_op_cmpa_32_pcdi , 0xf1ff, 0xb1fa, { 18, 18, 9}}, + {m68k_op_cmpa_32_pcix , 0xf1ff, 0xb1fb, { 20, 20, 11}}, + {m68k_op_cmpa_32_i , 0xf1ff, 0xb1fc, { 14, 14, 8}}, + {m68k_op_and_8_er_pi7 , 0xf1ff, 0xc01f, { 8, 8, 6}}, + {m68k_op_and_8_er_pd7 , 0xf1ff, 0xc027, { 10, 10, 7}}, + {m68k_op_and_8_er_aw , 0xf1ff, 0xc038, { 12, 12, 6}}, + {m68k_op_and_8_er_al , 0xf1ff, 0xc039, { 16, 16, 6}}, + {m68k_op_and_8_er_pcdi , 0xf1ff, 0xc03a, { 12, 12, 7}}, + {m68k_op_and_8_er_pcix , 0xf1ff, 0xc03b, { 14, 14, 9}}, + {m68k_op_and_8_er_i , 0xf1ff, 0xc03c, { 10, 8, 4}}, + {m68k_op_and_16_er_aw , 0xf1ff, 0xc078, { 12, 12, 6}}, + {m68k_op_and_16_er_al , 0xf1ff, 0xc079, { 16, 16, 6}}, + {m68k_op_and_16_er_pcdi , 0xf1ff, 0xc07a, { 12, 12, 7}}, + {m68k_op_and_16_er_pcix , 0xf1ff, 0xc07b, { 14, 14, 9}}, + {m68k_op_and_16_er_i , 0xf1ff, 0xc07c, { 10, 8, 4}}, + {m68k_op_and_32_er_aw , 0xf1ff, 0xc0b8, { 18, 18, 6}}, + {m68k_op_and_32_er_al , 0xf1ff, 0xc0b9, { 22, 22, 6}}, + {m68k_op_and_32_er_pcdi , 0xf1ff, 0xc0ba, { 18, 18, 7}}, + {m68k_op_and_32_er_pcix , 0xf1ff, 0xc0bb, { 20, 20, 9}}, + {m68k_op_and_32_er_i , 0xf1ff, 0xc0bc, { 16, 14, 6}}, + {m68k_op_mulu_16_aw , 0xf1ff, 0xc0f8, { 62, 38, 31}}, + {m68k_op_mulu_16_al , 0xf1ff, 0xc0f9, { 66, 42, 31}}, + {m68k_op_mulu_16_pcdi , 0xf1ff, 0xc0fa, { 62, 38, 32}}, + {m68k_op_mulu_16_pcix , 0xf1ff, 0xc0fb, { 64, 40, 34}}, + {m68k_op_mulu_16_i , 0xf1ff, 0xc0fc, { 58, 34, 29}}, + {m68k_op_abcd_8_mm_ay7 , 0xf1ff, 0xc10f, { 18, 18, 16}}, + {m68k_op_and_8_re_pi7 , 0xf1ff, 0xc11f, { 12, 12, 8}}, + {m68k_op_and_8_re_pd7 , 0xf1ff, 0xc127, { 14, 14, 9}}, + {m68k_op_and_8_re_aw , 0xf1ff, 0xc138, { 16, 16, 8}}, + {m68k_op_and_8_re_al , 0xf1ff, 0xc139, { 20, 20, 8}}, + {m68k_op_and_16_re_aw , 0xf1ff, 0xc178, { 16, 16, 8}}, + {m68k_op_and_16_re_al , 0xf1ff, 0xc179, { 20, 20, 8}}, + {m68k_op_and_32_re_aw , 0xf1ff, 0xc1b8, { 24, 24, 8}}, + {m68k_op_and_32_re_al , 0xf1ff, 0xc1b9, { 28, 28, 8}}, + {m68k_op_muls_16_aw , 0xf1ff, 0xc1f8, { 62, 40, 31}}, + {m68k_op_muls_16_al , 0xf1ff, 0xc1f9, { 66, 44, 31}}, + {m68k_op_muls_16_pcdi , 0xf1ff, 0xc1fa, { 62, 40, 32}}, + {m68k_op_muls_16_pcix , 0xf1ff, 0xc1fb, { 64, 42, 34}}, + {m68k_op_muls_16_i , 0xf1ff, 0xc1fc, { 58, 36, 29}}, + {m68k_op_add_8_er_pi7 , 0xf1ff, 0xd01f, { 8, 8, 6}}, + {m68k_op_add_8_er_pd7 , 0xf1ff, 0xd027, { 10, 10, 7}}, + {m68k_op_add_8_er_aw , 0xf1ff, 0xd038, { 12, 12, 6}}, + {m68k_op_add_8_er_al , 0xf1ff, 0xd039, { 16, 16, 6}}, + {m68k_op_add_8_er_pcdi , 0xf1ff, 0xd03a, { 12, 12, 7}}, + {m68k_op_add_8_er_pcix , 0xf1ff, 0xd03b, { 14, 14, 9}}, + {m68k_op_add_8_er_i , 0xf1ff, 0xd03c, { 10, 8, 4}}, + {m68k_op_add_16_er_aw , 0xf1ff, 0xd078, { 12, 12, 6}}, + {m68k_op_add_16_er_al , 0xf1ff, 0xd079, { 16, 16, 6}}, + {m68k_op_add_16_er_pcdi , 0xf1ff, 0xd07a, { 12, 12, 7}}, + {m68k_op_add_16_er_pcix , 0xf1ff, 0xd07b, { 14, 14, 9}}, + {m68k_op_add_16_er_i , 0xf1ff, 0xd07c, { 10, 8, 4}}, + {m68k_op_add_32_er_aw , 0xf1ff, 0xd0b8, { 18, 18, 6}}, + {m68k_op_add_32_er_al , 0xf1ff, 0xd0b9, { 22, 22, 6}}, + {m68k_op_add_32_er_pcdi , 0xf1ff, 0xd0ba, { 18, 18, 7}}, + {m68k_op_add_32_er_pcix , 0xf1ff, 0xd0bb, { 20, 20, 9}}, + {m68k_op_add_32_er_i , 0xf1ff, 0xd0bc, { 16, 14, 6}}, + {m68k_op_adda_16_aw , 0xf1ff, 0xd0f8, { 16, 16, 6}}, + {m68k_op_adda_16_al , 0xf1ff, 0xd0f9, { 20, 20, 6}}, + {m68k_op_adda_16_pcdi , 0xf1ff, 0xd0fa, { 16, 16, 7}}, + {m68k_op_adda_16_pcix , 0xf1ff, 0xd0fb, { 18, 18, 9}}, + {m68k_op_adda_16_i , 0xf1ff, 0xd0fc, { 14, 12, 4}}, + {m68k_op_addx_8_mm_ay7 , 0xf1ff, 0xd10f, { 18, 18, 12}}, + {m68k_op_add_8_re_pi7 , 0xf1ff, 0xd11f, { 12, 12, 8}}, + {m68k_op_add_8_re_pd7 , 0xf1ff, 0xd127, { 14, 14, 9}}, + {m68k_op_add_8_re_aw , 0xf1ff, 0xd138, { 16, 16, 8}}, + {m68k_op_add_8_re_al , 0xf1ff, 0xd139, { 20, 20, 8}}, + {m68k_op_add_16_re_aw , 0xf1ff, 0xd178, { 16, 16, 8}}, + {m68k_op_add_16_re_al , 0xf1ff, 0xd179, { 20, 20, 8}}, + {m68k_op_add_32_re_aw , 0xf1ff, 0xd1b8, { 24, 24, 8}}, + {m68k_op_add_32_re_al , 0xf1ff, 0xd1b9, { 28, 28, 8}}, + {m68k_op_adda_32_aw , 0xf1ff, 0xd1f8, { 18, 18, 6}}, + {m68k_op_adda_32_al , 0xf1ff, 0xd1f9, { 22, 22, 6}}, + {m68k_op_adda_32_pcdi , 0xf1ff, 0xd1fa, { 18, 18, 7}}, + {m68k_op_adda_32_pcix , 0xf1ff, 0xd1fb, { 20, 20, 9}}, + {m68k_op_adda_32_i , 0xf1ff, 0xd1fc, { 16, 14, 6}}, + {m68k_op_ori_8_d , 0xfff8, 0x0000, { 8, 8, 2}}, + {m68k_op_ori_8_ai , 0xfff8, 0x0010, { 16, 16, 8}}, + {m68k_op_ori_8_pi , 0xfff8, 0x0018, { 16, 16, 8}}, + {m68k_op_ori_8_pd , 0xfff8, 0x0020, { 18, 18, 9}}, + {m68k_op_ori_8_di , 0xfff8, 0x0028, { 20, 20, 9}}, + {m68k_op_ori_8_ix , 0xfff8, 0x0030, { 22, 22, 11}}, + {m68k_op_ori_16_d , 0xfff8, 0x0040, { 8, 8, 2}}, + {m68k_op_ori_16_ai , 0xfff8, 0x0050, { 16, 16, 8}}, + {m68k_op_ori_16_pi , 0xfff8, 0x0058, { 16, 16, 8}}, + {m68k_op_ori_16_pd , 0xfff8, 0x0060, { 18, 18, 9}}, + {m68k_op_ori_16_di , 0xfff8, 0x0068, { 20, 20, 9}}, + {m68k_op_ori_16_ix , 0xfff8, 0x0070, { 22, 22, 11}}, + {m68k_op_ori_32_d , 0xfff8, 0x0080, { 16, 14, 2}}, + {m68k_op_ori_32_ai , 0xfff8, 0x0090, { 28, 28, 8}}, + {m68k_op_ori_32_pi , 0xfff8, 0x0098, { 28, 28, 8}}, + {m68k_op_ori_32_pd , 0xfff8, 0x00a0, { 30, 30, 9}}, + {m68k_op_ori_32_di , 0xfff8, 0x00a8, { 32, 32, 9}}, + {m68k_op_ori_32_ix , 0xfff8, 0x00b0, { 34, 34, 11}}, + {m68k_op_chk2cmp2_8_ai , 0xfff8, 0x00d0, { 0, 0, 22}}, + {m68k_op_chk2cmp2_8_di , 0xfff8, 0x00e8, { 0, 0, 23}}, + {m68k_op_chk2cmp2_8_ix , 0xfff8, 0x00f0, { 0, 0, 25}}, + {m68k_op_andi_8_d , 0xfff8, 0x0200, { 8, 8, 2}}, + {m68k_op_andi_8_ai , 0xfff8, 0x0210, { 16, 16, 8}}, + {m68k_op_andi_8_pi , 0xfff8, 0x0218, { 16, 16, 8}}, + {m68k_op_andi_8_pd , 0xfff8, 0x0220, { 18, 18, 9}}, + {m68k_op_andi_8_di , 0xfff8, 0x0228, { 20, 20, 9}}, + {m68k_op_andi_8_ix , 0xfff8, 0x0230, { 22, 22, 11}}, + {m68k_op_andi_16_d , 0xfff8, 0x0240, { 8, 8, 2}}, + {m68k_op_andi_16_ai , 0xfff8, 0x0250, { 16, 16, 8}}, + {m68k_op_andi_16_pi , 0xfff8, 0x0258, { 16, 16, 8}}, + {m68k_op_andi_16_pd , 0xfff8, 0x0260, { 18, 18, 9}}, + {m68k_op_andi_16_di , 0xfff8, 0x0268, { 20, 20, 9}}, + {m68k_op_andi_16_ix , 0xfff8, 0x0270, { 22, 22, 11}}, + {m68k_op_andi_32_d , 0xfff8, 0x0280, { 14, 14, 2}}, + {m68k_op_andi_32_ai , 0xfff8, 0x0290, { 28, 28, 8}}, + {m68k_op_andi_32_pi , 0xfff8, 0x0298, { 28, 28, 8}}, + {m68k_op_andi_32_pd , 0xfff8, 0x02a0, { 30, 30, 9}}, + {m68k_op_andi_32_di , 0xfff8, 0x02a8, { 32, 32, 9}}, + {m68k_op_andi_32_ix , 0xfff8, 0x02b0, { 34, 34, 11}}, + {m68k_op_chk2cmp2_16_ai , 0xfff8, 0x02d0, { 0, 0, 22}}, + {m68k_op_chk2cmp2_16_di , 0xfff8, 0x02e8, { 0, 0, 23}}, + {m68k_op_chk2cmp2_16_ix , 0xfff8, 0x02f0, { 0, 0, 25}}, + {m68k_op_subi_8_d , 0xfff8, 0x0400, { 8, 8, 2}}, + {m68k_op_subi_8_ai , 0xfff8, 0x0410, { 16, 16, 8}}, + {m68k_op_subi_8_pi , 0xfff8, 0x0418, { 16, 16, 8}}, + {m68k_op_subi_8_pd , 0xfff8, 0x0420, { 18, 18, 9}}, + {m68k_op_subi_8_di , 0xfff8, 0x0428, { 20, 20, 9}}, + {m68k_op_subi_8_ix , 0xfff8, 0x0430, { 22, 22, 11}}, + {m68k_op_subi_16_d , 0xfff8, 0x0440, { 8, 8, 2}}, + {m68k_op_subi_16_ai , 0xfff8, 0x0450, { 16, 16, 8}}, + {m68k_op_subi_16_pi , 0xfff8, 0x0458, { 16, 16, 8}}, + {m68k_op_subi_16_pd , 0xfff8, 0x0460, { 18, 18, 9}}, + {m68k_op_subi_16_di , 0xfff8, 0x0468, { 20, 20, 9}}, + {m68k_op_subi_16_ix , 0xfff8, 0x0470, { 22, 22, 11}}, + {m68k_op_subi_32_d , 0xfff8, 0x0480, { 16, 14, 2}}, + {m68k_op_subi_32_ai , 0xfff8, 0x0490, { 28, 28, 8}}, + {m68k_op_subi_32_pi , 0xfff8, 0x0498, { 28, 28, 8}}, + {m68k_op_subi_32_pd , 0xfff8, 0x04a0, { 30, 30, 9}}, + {m68k_op_subi_32_di , 0xfff8, 0x04a8, { 32, 32, 9}}, + {m68k_op_subi_32_ix , 0xfff8, 0x04b0, { 34, 34, 11}}, + {m68k_op_chk2cmp2_32_ai , 0xfff8, 0x04d0, { 0, 0, 22}}, + {m68k_op_chk2cmp2_32_di , 0xfff8, 0x04e8, { 0, 0, 23}}, + {m68k_op_chk2cmp2_32_ix , 0xfff8, 0x04f0, { 0, 0, 25}}, + {m68k_op_addi_8_d , 0xfff8, 0x0600, { 8, 8, 2}}, + {m68k_op_addi_8_ai , 0xfff8, 0x0610, { 16, 16, 8}}, + {m68k_op_addi_8_pi , 0xfff8, 0x0618, { 16, 16, 8}}, + {m68k_op_addi_8_pd , 0xfff8, 0x0620, { 18, 18, 9}}, + {m68k_op_addi_8_di , 0xfff8, 0x0628, { 20, 20, 9}}, + {m68k_op_addi_8_ix , 0xfff8, 0x0630, { 22, 22, 11}}, + {m68k_op_addi_16_d , 0xfff8, 0x0640, { 8, 8, 2}}, + {m68k_op_addi_16_ai , 0xfff8, 0x0650, { 16, 16, 8}}, + {m68k_op_addi_16_pi , 0xfff8, 0x0658, { 16, 16, 8}}, + {m68k_op_addi_16_pd , 0xfff8, 0x0660, { 18, 18, 9}}, + {m68k_op_addi_16_di , 0xfff8, 0x0668, { 20, 20, 9}}, + {m68k_op_addi_16_ix , 0xfff8, 0x0670, { 22, 22, 11}}, + {m68k_op_addi_32_d , 0xfff8, 0x0680, { 16, 14, 2}}, + {m68k_op_addi_32_ai , 0xfff8, 0x0690, { 28, 28, 8}}, + {m68k_op_addi_32_pi , 0xfff8, 0x0698, { 28, 28, 8}}, + {m68k_op_addi_32_pd , 0xfff8, 0x06a0, { 30, 30, 9}}, + {m68k_op_addi_32_di , 0xfff8, 0x06a8, { 32, 32, 9}}, + {m68k_op_addi_32_ix , 0xfff8, 0x06b0, { 34, 34, 11}}, + {m68k_op_callm_32_ai , 0xfff8, 0x06d0, { 0, 0, 64}}, + {m68k_op_callm_32_di , 0xfff8, 0x06e8, { 0, 0, 65}}, + {m68k_op_callm_32_ix , 0xfff8, 0x06f0, { 0, 0, 67}}, + {m68k_op_btst_32_s_d , 0xfff8, 0x0800, { 10, 10, 4}}, + {m68k_op_btst_8_s_ai , 0xfff8, 0x0810, { 12, 12, 8}}, + {m68k_op_btst_8_s_pi , 0xfff8, 0x0818, { 12, 12, 8}}, + {m68k_op_btst_8_s_pd , 0xfff8, 0x0820, { 14, 14, 9}}, + {m68k_op_btst_8_s_di , 0xfff8, 0x0828, { 16, 16, 9}}, + {m68k_op_btst_8_s_ix , 0xfff8, 0x0830, { 18, 18, 11}}, + {m68k_op_bchg_32_s_d , 0xfff8, 0x0840, { 12, 12, 4}}, + {m68k_op_bchg_8_s_ai , 0xfff8, 0x0850, { 16, 16, 8}}, + {m68k_op_bchg_8_s_pi , 0xfff8, 0x0858, { 16, 16, 8}}, + {m68k_op_bchg_8_s_pd , 0xfff8, 0x0860, { 18, 18, 9}}, + {m68k_op_bchg_8_s_di , 0xfff8, 0x0868, { 20, 20, 9}}, + {m68k_op_bchg_8_s_ix , 0xfff8, 0x0870, { 22, 22, 11}}, + {m68k_op_bclr_32_s_d , 0xfff8, 0x0880, { 14, 14, 4}}, + {m68k_op_bclr_8_s_ai , 0xfff8, 0x0890, { 16, 16, 8}}, + {m68k_op_bclr_8_s_pi , 0xfff8, 0x0898, { 16, 16, 8}}, + {m68k_op_bclr_8_s_pd , 0xfff8, 0x08a0, { 18, 18, 9}}, + {m68k_op_bclr_8_s_di , 0xfff8, 0x08a8, { 20, 20, 9}}, + {m68k_op_bclr_8_s_ix , 0xfff8, 0x08b0, { 22, 22, 11}}, + {m68k_op_bset_32_s_d , 0xfff8, 0x08c0, { 12, 12, 4}}, + {m68k_op_bset_8_s_ai , 0xfff8, 0x08d0, { 16, 16, 8}}, + {m68k_op_bset_8_s_pi , 0xfff8, 0x08d8, { 16, 16, 8}}, + {m68k_op_bset_8_s_pd , 0xfff8, 0x08e0, { 18, 18, 9}}, + {m68k_op_bset_8_s_di , 0xfff8, 0x08e8, { 20, 20, 9}}, + {m68k_op_bset_8_s_ix , 0xfff8, 0x08f0, { 22, 22, 11}}, + {m68k_op_eori_8_d , 0xfff8, 0x0a00, { 8, 8, 2}}, + {m68k_op_eori_8_ai , 0xfff8, 0x0a10, { 16, 16, 8}}, + {m68k_op_eori_8_pi , 0xfff8, 0x0a18, { 16, 16, 8}}, + {m68k_op_eori_8_pd , 0xfff8, 0x0a20, { 18, 18, 9}}, + {m68k_op_eori_8_di , 0xfff8, 0x0a28, { 20, 20, 9}}, + {m68k_op_eori_8_ix , 0xfff8, 0x0a30, { 22, 22, 11}}, + {m68k_op_eori_16_d , 0xfff8, 0x0a40, { 8, 8, 2}}, + {m68k_op_eori_16_ai , 0xfff8, 0x0a50, { 16, 16, 8}}, + {m68k_op_eori_16_pi , 0xfff8, 0x0a58, { 16, 16, 8}}, + {m68k_op_eori_16_pd , 0xfff8, 0x0a60, { 18, 18, 9}}, + {m68k_op_eori_16_di , 0xfff8, 0x0a68, { 20, 20, 9}}, + {m68k_op_eori_16_ix , 0xfff8, 0x0a70, { 22, 22, 11}}, + {m68k_op_eori_32_d , 0xfff8, 0x0a80, { 16, 14, 2}}, + {m68k_op_eori_32_ai , 0xfff8, 0x0a90, { 28, 28, 8}}, + {m68k_op_eori_32_pi , 0xfff8, 0x0a98, { 28, 28, 8}}, + {m68k_op_eori_32_pd , 0xfff8, 0x0aa0, { 30, 30, 9}}, + {m68k_op_eori_32_di , 0xfff8, 0x0aa8, { 32, 32, 9}}, + {m68k_op_eori_32_ix , 0xfff8, 0x0ab0, { 34, 34, 11}}, + {m68k_op_cas_8_ai , 0xfff8, 0x0ad0, { 0, 0, 16}}, + {m68k_op_cas_8_pi , 0xfff8, 0x0ad8, { 0, 0, 16}}, + {m68k_op_cas_8_pd , 0xfff8, 0x0ae0, { 0, 0, 17}}, + {m68k_op_cas_8_di , 0xfff8, 0x0ae8, { 0, 0, 17}}, + {m68k_op_cas_8_ix , 0xfff8, 0x0af0, { 0, 0, 19}}, + {m68k_op_cmpi_8_d , 0xfff8, 0x0c00, { 8, 8, 2}}, + {m68k_op_cmpi_8_ai , 0xfff8, 0x0c10, { 12, 12, 6}}, + {m68k_op_cmpi_8_pi , 0xfff8, 0x0c18, { 12, 12, 6}}, + {m68k_op_cmpi_8_pd , 0xfff8, 0x0c20, { 14, 14, 7}}, + {m68k_op_cmpi_8_di , 0xfff8, 0x0c28, { 16, 16, 7}}, + {m68k_op_cmpi_8_ix , 0xfff8, 0x0c30, { 18, 18, 9}}, + {m68k_op_cmpi_16_d , 0xfff8, 0x0c40, { 8, 8, 2}}, + {m68k_op_cmpi_16_ai , 0xfff8, 0x0c50, { 12, 12, 6}}, + {m68k_op_cmpi_16_pi , 0xfff8, 0x0c58, { 12, 12, 6}}, + {m68k_op_cmpi_16_pd , 0xfff8, 0x0c60, { 14, 14, 7}}, + {m68k_op_cmpi_16_di , 0xfff8, 0x0c68, { 16, 16, 7}}, + {m68k_op_cmpi_16_ix , 0xfff8, 0x0c70, { 18, 18, 9}}, + {m68k_op_cmpi_32_d , 0xfff8, 0x0c80, { 14, 12, 2}}, + {m68k_op_cmpi_32_ai , 0xfff8, 0x0c90, { 20, 20, 6}}, + {m68k_op_cmpi_32_pi , 0xfff8, 0x0c98, { 20, 20, 6}}, + {m68k_op_cmpi_32_pd , 0xfff8, 0x0ca0, { 22, 22, 7}}, + {m68k_op_cmpi_32_di , 0xfff8, 0x0ca8, { 24, 24, 7}}, + {m68k_op_cmpi_32_ix , 0xfff8, 0x0cb0, { 26, 26, 9}}, + {m68k_op_cas_16_ai , 0xfff8, 0x0cd0, { 0, 0, 16}}, + {m68k_op_cas_16_pi , 0xfff8, 0x0cd8, { 0, 0, 16}}, + {m68k_op_cas_16_pd , 0xfff8, 0x0ce0, { 0, 0, 17}}, + {m68k_op_cas_16_di , 0xfff8, 0x0ce8, { 0, 0, 17}}, + {m68k_op_cas_16_ix , 0xfff8, 0x0cf0, { 0, 0, 19}}, + {m68k_op_moves_8_ai , 0xfff8, 0x0e10, { 0, 18, 9}}, + {m68k_op_moves_8_pi , 0xfff8, 0x0e18, { 0, 18, 9}}, + {m68k_op_moves_8_pd , 0xfff8, 0x0e20, { 0, 20, 10}}, + {m68k_op_moves_8_di , 0xfff8, 0x0e28, { 0, 26, 10}}, + {m68k_op_moves_8_ix , 0xfff8, 0x0e30, { 0, 30, 12}}, + {m68k_op_moves_16_ai , 0xfff8, 0x0e50, { 0, 18, 9}}, + {m68k_op_moves_16_pi , 0xfff8, 0x0e58, { 0, 18, 9}}, + {m68k_op_moves_16_pd , 0xfff8, 0x0e60, { 0, 20, 10}}, + {m68k_op_moves_16_di , 0xfff8, 0x0e68, { 0, 26, 10}}, + {m68k_op_moves_16_ix , 0xfff8, 0x0e70, { 0, 30, 12}}, + {m68k_op_moves_32_ai , 0xfff8, 0x0e90, { 0, 22, 9}}, + {m68k_op_moves_32_pi , 0xfff8, 0x0e98, { 0, 22, 9}}, + {m68k_op_moves_32_pd , 0xfff8, 0x0ea0, { 0, 28, 10}}, + {m68k_op_moves_32_di , 0xfff8, 0x0ea8, { 0, 32, 10}}, + {m68k_op_moves_32_ix , 0xfff8, 0x0eb0, { 0, 36, 12}}, + {m68k_op_cas_32_ai , 0xfff8, 0x0ed0, { 0, 0, 16}}, + {m68k_op_cas_32_pi , 0xfff8, 0x0ed8, { 0, 0, 16}}, + {m68k_op_cas_32_pd , 0xfff8, 0x0ee0, { 0, 0, 17}}, + {m68k_op_cas_32_di , 0xfff8, 0x0ee8, { 0, 0, 17}}, + {m68k_op_cas_32_ix , 0xfff8, 0x0ef0, { 0, 0, 19}}, + {m68k_op_move_8_aw_d , 0xfff8, 0x11c0, { 12, 12, 4}}, + {m68k_op_move_8_aw_ai , 0xfff8, 0x11d0, { 16, 16, 8}}, + {m68k_op_move_8_aw_pi , 0xfff8, 0x11d8, { 16, 16, 8}}, + {m68k_op_move_8_aw_pd , 0xfff8, 0x11e0, { 18, 18, 9}}, + {m68k_op_move_8_aw_di , 0xfff8, 0x11e8, { 20, 20, 9}}, + {m68k_op_move_8_aw_ix , 0xfff8, 0x11f0, { 22, 22, 11}}, + {m68k_op_move_8_al_d , 0xfff8, 0x13c0, { 16, 16, 6}}, + {m68k_op_move_8_al_ai , 0xfff8, 0x13d0, { 20, 20, 10}}, + {m68k_op_move_8_al_pi , 0xfff8, 0x13d8, { 20, 20, 10}}, + {m68k_op_move_8_al_pd , 0xfff8, 0x13e0, { 22, 22, 11}}, + {m68k_op_move_8_al_di , 0xfff8, 0x13e8, { 24, 24, 11}}, + {m68k_op_move_8_al_ix , 0xfff8, 0x13f0, { 26, 26, 13}}, + {m68k_op_move_8_pi7_d , 0xfff8, 0x1ec0, { 8, 8, 4}}, + {m68k_op_move_8_pi7_ai , 0xfff8, 0x1ed0, { 12, 12, 8}}, + {m68k_op_move_8_pi7_pi , 0xfff8, 0x1ed8, { 12, 12, 8}}, + {m68k_op_move_8_pi7_pd , 0xfff8, 0x1ee0, { 14, 14, 9}}, + {m68k_op_move_8_pi7_di , 0xfff8, 0x1ee8, { 16, 16, 9}}, + {m68k_op_move_8_pi7_ix , 0xfff8, 0x1ef0, { 18, 18, 11}}, + {m68k_op_move_8_pd7_d , 0xfff8, 0x1f00, { 8, 8, 5}}, + {m68k_op_move_8_pd7_ai , 0xfff8, 0x1f10, { 12, 12, 9}}, + {m68k_op_move_8_pd7_pi , 0xfff8, 0x1f18, { 12, 12, 9}}, + {m68k_op_move_8_pd7_pd , 0xfff8, 0x1f20, { 14, 14, 10}}, + {m68k_op_move_8_pd7_di , 0xfff8, 0x1f28, { 16, 16, 10}}, + {m68k_op_move_8_pd7_ix , 0xfff8, 0x1f30, { 18, 18, 12}}, + {m68k_op_move_32_aw_d , 0xfff8, 0x21c0, { 16, 16, 4}}, + {m68k_op_move_32_aw_a , 0xfff8, 0x21c8, { 16, 16, 4}}, + {m68k_op_move_32_aw_ai , 0xfff8, 0x21d0, { 24, 24, 8}}, + {m68k_op_move_32_aw_pi , 0xfff8, 0x21d8, { 24, 24, 8}}, + {m68k_op_move_32_aw_pd , 0xfff8, 0x21e0, { 26, 26, 9}}, + {m68k_op_move_32_aw_di , 0xfff8, 0x21e8, { 28, 28, 9}}, + {m68k_op_move_32_aw_ix , 0xfff8, 0x21f0, { 30, 30, 11}}, + {m68k_op_move_32_al_d , 0xfff8, 0x23c0, { 20, 20, 6}}, + {m68k_op_move_32_al_a , 0xfff8, 0x23c8, { 20, 20, 6}}, + {m68k_op_move_32_al_ai , 0xfff8, 0x23d0, { 28, 28, 10}}, + {m68k_op_move_32_al_pi , 0xfff8, 0x23d8, { 28, 28, 10}}, + {m68k_op_move_32_al_pd , 0xfff8, 0x23e0, { 30, 30, 11}}, + {m68k_op_move_32_al_di , 0xfff8, 0x23e8, { 32, 32, 11}}, + {m68k_op_move_32_al_ix , 0xfff8, 0x23f0, { 34, 34, 13}}, + {m68k_op_move_16_aw_d , 0xfff8, 0x31c0, { 12, 12, 4}}, + {m68k_op_move_16_aw_a , 0xfff8, 0x31c8, { 12, 12, 4}}, + {m68k_op_move_16_aw_ai , 0xfff8, 0x31d0, { 16, 16, 8}}, + {m68k_op_move_16_aw_pi , 0xfff8, 0x31d8, { 16, 16, 8}}, + {m68k_op_move_16_aw_pd , 0xfff8, 0x31e0, { 18, 18, 9}}, + {m68k_op_move_16_aw_di , 0xfff8, 0x31e8, { 20, 20, 9}}, + {m68k_op_move_16_aw_ix , 0xfff8, 0x31f0, { 22, 22, 11}}, + {m68k_op_move_16_al_d , 0xfff8, 0x33c0, { 16, 16, 6}}, + {m68k_op_move_16_al_a , 0xfff8, 0x33c8, { 16, 16, 6}}, + {m68k_op_move_16_al_ai , 0xfff8, 0x33d0, { 20, 20, 10}}, + {m68k_op_move_16_al_pi , 0xfff8, 0x33d8, { 20, 20, 10}}, + {m68k_op_move_16_al_pd , 0xfff8, 0x33e0, { 22, 22, 11}}, + {m68k_op_move_16_al_di , 0xfff8, 0x33e8, { 24, 24, 11}}, + {m68k_op_move_16_al_ix , 0xfff8, 0x33f0, { 26, 26, 13}}, + {m68k_op_negx_8_d , 0xfff8, 0x4000, { 4, 4, 2}}, + {m68k_op_negx_8_ai , 0xfff8, 0x4010, { 12, 12, 8}}, + {m68k_op_negx_8_pi , 0xfff8, 0x4018, { 12, 12, 8}}, + {m68k_op_negx_8_pd , 0xfff8, 0x4020, { 14, 14, 9}}, + {m68k_op_negx_8_di , 0xfff8, 0x4028, { 16, 16, 9}}, + {m68k_op_negx_8_ix , 0xfff8, 0x4030, { 18, 18, 11}}, + {m68k_op_negx_16_d , 0xfff8, 0x4040, { 4, 4, 2}}, + {m68k_op_negx_16_ai , 0xfff8, 0x4050, { 12, 12, 8}}, + {m68k_op_negx_16_pi , 0xfff8, 0x4058, { 12, 12, 8}}, + {m68k_op_negx_16_pd , 0xfff8, 0x4060, { 14, 14, 9}}, + {m68k_op_negx_16_di , 0xfff8, 0x4068, { 16, 16, 9}}, + {m68k_op_negx_16_ix , 0xfff8, 0x4070, { 18, 18, 11}}, + {m68k_op_negx_32_d , 0xfff8, 0x4080, { 6, 6, 2}}, + {m68k_op_negx_32_ai , 0xfff8, 0x4090, { 20, 20, 8}}, + {m68k_op_negx_32_pi , 0xfff8, 0x4098, { 20, 20, 8}}, + {m68k_op_negx_32_pd , 0xfff8, 0x40a0, { 22, 22, 9}}, + {m68k_op_negx_32_di , 0xfff8, 0x40a8, { 24, 24, 9}}, + {m68k_op_negx_32_ix , 0xfff8, 0x40b0, { 26, 26, 11}}, + {m68k_op_move_16_frs_d , 0xfff8, 0x40c0, { 6, 4, 8}}, + {m68k_op_move_16_frs_ai , 0xfff8, 0x40d0, { 12, 12, 12}}, + {m68k_op_move_16_frs_pi , 0xfff8, 0x40d8, { 12, 12, 12}}, + {m68k_op_move_16_frs_pd , 0xfff8, 0x40e0, { 14, 14, 13}}, + {m68k_op_move_16_frs_di , 0xfff8, 0x40e8, { 16, 16, 13}}, + {m68k_op_move_16_frs_ix , 0xfff8, 0x40f0, { 18, 18, 15}}, + {m68k_op_clr_8_d , 0xfff8, 0x4200, { 4, 4, 2}}, + {m68k_op_clr_8_ai , 0xfff8, 0x4210, { 12, 8, 8}}, + {m68k_op_clr_8_pi , 0xfff8, 0x4218, { 12, 8, 8}}, + {m68k_op_clr_8_pd , 0xfff8, 0x4220, { 14, 10, 9}}, + {m68k_op_clr_8_di , 0xfff8, 0x4228, { 16, 12, 9}}, + {m68k_op_clr_8_ix , 0xfff8, 0x4230, { 18, 14, 11}}, + {m68k_op_clr_16_d , 0xfff8, 0x4240, { 4, 4, 2}}, + {m68k_op_clr_16_ai , 0xfff8, 0x4250, { 12, 8, 8}}, + {m68k_op_clr_16_pi , 0xfff8, 0x4258, { 12, 8, 8}}, + {m68k_op_clr_16_pd , 0xfff8, 0x4260, { 14, 10, 9}}, + {m68k_op_clr_16_di , 0xfff8, 0x4268, { 16, 12, 9}}, + {m68k_op_clr_16_ix , 0xfff8, 0x4270, { 18, 14, 11}}, + {m68k_op_clr_32_d , 0xfff8, 0x4280, { 6, 6, 2}}, + {m68k_op_clr_32_ai , 0xfff8, 0x4290, { 20, 12, 8}}, + {m68k_op_clr_32_pi , 0xfff8, 0x4298, { 20, 12, 8}}, + {m68k_op_clr_32_pd , 0xfff8, 0x42a0, { 22, 14, 9}}, + {m68k_op_clr_32_di , 0xfff8, 0x42a8, { 24, 16, 9}}, + {m68k_op_clr_32_ix , 0xfff8, 0x42b0, { 26, 20, 11}}, + {m68k_op_move_16_frc_d , 0xfff8, 0x42c0, { 0, 4, 4}}, + {m68k_op_move_16_frc_ai , 0xfff8, 0x42d0, { 0, 12, 8}}, + {m68k_op_move_16_frc_pi , 0xfff8, 0x42d8, { 0, 12, 8}}, + {m68k_op_move_16_frc_pd , 0xfff8, 0x42e0, { 0, 14, 9}}, + {m68k_op_move_16_frc_di , 0xfff8, 0x42e8, { 0, 16, 9}}, + {m68k_op_move_16_frc_ix , 0xfff8, 0x42f0, { 0, 18, 11}}, + {m68k_op_neg_8_d , 0xfff8, 0x4400, { 4, 4, 2}}, + {m68k_op_neg_8_ai , 0xfff8, 0x4410, { 12, 12, 8}}, + {m68k_op_neg_8_pi , 0xfff8, 0x4418, { 12, 12, 8}}, + {m68k_op_neg_8_pd , 0xfff8, 0x4420, { 14, 14, 9}}, + {m68k_op_neg_8_di , 0xfff8, 0x4428, { 16, 16, 9}}, + {m68k_op_neg_8_ix , 0xfff8, 0x4430, { 18, 18, 11}}, + {m68k_op_neg_16_d , 0xfff8, 0x4440, { 4, 4, 2}}, + {m68k_op_neg_16_ai , 0xfff8, 0x4450, { 12, 12, 8}}, + {m68k_op_neg_16_pi , 0xfff8, 0x4458, { 12, 12, 8}}, + {m68k_op_neg_16_pd , 0xfff8, 0x4460, { 14, 14, 9}}, + {m68k_op_neg_16_di , 0xfff8, 0x4468, { 16, 16, 9}}, + {m68k_op_neg_16_ix , 0xfff8, 0x4470, { 18, 18, 11}}, + {m68k_op_neg_32_d , 0xfff8, 0x4480, { 6, 6, 2}}, + {m68k_op_neg_32_ai , 0xfff8, 0x4490, { 20, 20, 8}}, + {m68k_op_neg_32_pi , 0xfff8, 0x4498, { 20, 20, 8}}, + {m68k_op_neg_32_pd , 0xfff8, 0x44a0, { 22, 22, 9}}, + {m68k_op_neg_32_di , 0xfff8, 0x44a8, { 24, 24, 9}}, + {m68k_op_neg_32_ix , 0xfff8, 0x44b0, { 26, 26, 11}}, + {m68k_op_move_16_toc_d , 0xfff8, 0x44c0, { 12, 12, 4}}, + {m68k_op_move_16_toc_ai , 0xfff8, 0x44d0, { 16, 16, 8}}, + {m68k_op_move_16_toc_pi , 0xfff8, 0x44d8, { 16, 16, 8}}, + {m68k_op_move_16_toc_pd , 0xfff8, 0x44e0, { 18, 18, 9}}, + {m68k_op_move_16_toc_di , 0xfff8, 0x44e8, { 20, 20, 9}}, + {m68k_op_move_16_toc_ix , 0xfff8, 0x44f0, { 22, 22, 11}}, + {m68k_op_not_8_d , 0xfff8, 0x4600, { 4, 4, 2}}, + {m68k_op_not_8_ai , 0xfff8, 0x4610, { 12, 12, 8}}, + {m68k_op_not_8_pi , 0xfff8, 0x4618, { 12, 12, 8}}, + {m68k_op_not_8_pd , 0xfff8, 0x4620, { 14, 14, 9}}, + {m68k_op_not_8_di , 0xfff8, 0x4628, { 16, 16, 9}}, + {m68k_op_not_8_ix , 0xfff8, 0x4630, { 18, 18, 11}}, + {m68k_op_not_16_d , 0xfff8, 0x4640, { 4, 4, 2}}, + {m68k_op_not_16_ai , 0xfff8, 0x4650, { 12, 12, 8}}, + {m68k_op_not_16_pi , 0xfff8, 0x4658, { 12, 12, 8}}, + {m68k_op_not_16_pd , 0xfff8, 0x4660, { 14, 14, 9}}, + {m68k_op_not_16_di , 0xfff8, 0x4668, { 16, 16, 9}}, + {m68k_op_not_16_ix , 0xfff8, 0x4670, { 18, 18, 11}}, + {m68k_op_not_32_d , 0xfff8, 0x4680, { 6, 6, 2}}, + {m68k_op_not_32_ai , 0xfff8, 0x4690, { 20, 20, 8}}, + {m68k_op_not_32_pi , 0xfff8, 0x4698, { 20, 20, 8}}, + {m68k_op_not_32_pd , 0xfff8, 0x46a0, { 22, 22, 9}}, + {m68k_op_not_32_di , 0xfff8, 0x46a8, { 24, 24, 9}}, + {m68k_op_not_32_ix , 0xfff8, 0x46b0, { 26, 26, 11}}, + {m68k_op_move_16_tos_d , 0xfff8, 0x46c0, { 12, 12, 8}}, + {m68k_op_move_16_tos_ai , 0xfff8, 0x46d0, { 16, 16, 12}}, + {m68k_op_move_16_tos_pi , 0xfff8, 0x46d8, { 16, 16, 12}}, + {m68k_op_move_16_tos_pd , 0xfff8, 0x46e0, { 18, 18, 13}}, + {m68k_op_move_16_tos_di , 0xfff8, 0x46e8, { 20, 20, 13}}, + {m68k_op_move_16_tos_ix , 0xfff8, 0x46f0, { 22, 22, 15}}, + {m68k_op_nbcd_8_d , 0xfff8, 0x4800, { 6, 6, 6}}, + {m68k_op_link_32 , 0xfff8, 0x4808, { 0, 0, 6}}, + {m68k_op_nbcd_8_ai , 0xfff8, 0x4810, { 12, 12, 10}}, + {m68k_op_nbcd_8_pi , 0xfff8, 0x4818, { 12, 12, 10}}, + {m68k_op_nbcd_8_pd , 0xfff8, 0x4820, { 14, 14, 11}}, + {m68k_op_nbcd_8_di , 0xfff8, 0x4828, { 16, 16, 11}}, + {m68k_op_nbcd_8_ix , 0xfff8, 0x4830, { 18, 18, 13}}, + {m68k_op_swap_32 , 0xfff8, 0x4840, { 4, 4, 4}}, + {m68k_op_bkpt , 0xfff8, 0x4848, { 0, 10, 10}}, + {m68k_op_pea_32_ai , 0xfff8, 0x4850, { 10, 10, 9}}, + {m68k_op_pea_32_di , 0xfff8, 0x4868, { 16, 16, 10}}, + {m68k_op_pea_32_ix , 0xfff8, 0x4870, { 20, 20, 12}}, + {m68k_op_ext_16 , 0xfff8, 0x4880, { 4, 4, 4}}, + {m68k_op_movem_16_re_ai , 0xfff8, 0x4890, { 12, 12, 8}}, + {m68k_op_movem_16_re_pd , 0xfff8, 0x48a0, { 8, 8, 4}}, + {m68k_op_movem_16_re_di , 0xfff8, 0x48a8, { 16, 16, 9}}, + {m68k_op_movem_16_re_ix , 0xfff8, 0x48b0, { 18, 18, 11}}, + {m68k_op_ext_32 , 0xfff8, 0x48c0, { 4, 4, 4}}, + {m68k_op_movem_32_re_ai , 0xfff8, 0x48d0, { 16, 16, 8}}, + {m68k_op_movem_32_re_pd , 0xfff8, 0x48e0, { 8, 8, 4}}, + {m68k_op_movem_32_re_di , 0xfff8, 0x48e8, { 20, 20, 9}}, + {m68k_op_movem_32_re_ix , 0xfff8, 0x48f0, { 22, 22, 11}}, + {m68k_op_extb_32 , 0xfff8, 0x49c0, { 0, 0, 4}}, + {m68k_op_tst_8_d , 0xfff8, 0x4a00, { 4, 4, 2}}, + {m68k_op_tst_8_ai , 0xfff8, 0x4a10, { 8, 8, 6}}, + {m68k_op_tst_8_pi , 0xfff8, 0x4a18, { 8, 8, 6}}, + {m68k_op_tst_8_pd , 0xfff8, 0x4a20, { 10, 10, 7}}, + {m68k_op_tst_8_di , 0xfff8, 0x4a28, { 12, 12, 7}}, + {m68k_op_tst_8_ix , 0xfff8, 0x4a30, { 14, 14, 9}}, + {m68k_op_tst_16_d , 0xfff8, 0x4a40, { 4, 4, 2}}, + {m68k_op_tst_16_a , 0xfff8, 0x4a48, { 0, 0, 2}}, + {m68k_op_tst_16_ai , 0xfff8, 0x4a50, { 8, 8, 6}}, + {m68k_op_tst_16_pi , 0xfff8, 0x4a58, { 8, 8, 6}}, + {m68k_op_tst_16_pd , 0xfff8, 0x4a60, { 10, 10, 7}}, + {m68k_op_tst_16_di , 0xfff8, 0x4a68, { 12, 12, 7}}, + {m68k_op_tst_16_ix , 0xfff8, 0x4a70, { 14, 14, 9}}, + {m68k_op_tst_32_d , 0xfff8, 0x4a80, { 4, 4, 2}}, + {m68k_op_tst_32_a , 0xfff8, 0x4a88, { 0, 0, 2}}, + {m68k_op_tst_32_ai , 0xfff8, 0x4a90, { 12, 12, 6}}, + {m68k_op_tst_32_pi , 0xfff8, 0x4a98, { 12, 12, 6}}, + {m68k_op_tst_32_pd , 0xfff8, 0x4aa0, { 14, 14, 7}}, + {m68k_op_tst_32_di , 0xfff8, 0x4aa8, { 16, 16, 7}}, + {m68k_op_tst_32_ix , 0xfff8, 0x4ab0, { 18, 18, 9}}, + {m68k_op_tas_8_d , 0xfff8, 0x4ac0, { 4, 4, 4}}, + {m68k_op_tas_8_ai , 0xfff8, 0x4ad0, { 18, 18, 16}}, + {m68k_op_tas_8_pi , 0xfff8, 0x4ad8, { 18, 18, 16}}, + {m68k_op_tas_8_pd , 0xfff8, 0x4ae0, { 20, 20, 17}}, + {m68k_op_tas_8_di , 0xfff8, 0x4ae8, { 22, 22, 17}}, + {m68k_op_tas_8_ix , 0xfff8, 0x4af0, { 24, 24, 19}}, + {m68k_op_mull_32_d , 0xfff8, 0x4c00, { 0, 0, 43}}, + {m68k_op_mull_32_ai , 0xfff8, 0x4c10, { 0, 0, 47}}, + {m68k_op_mull_32_pi , 0xfff8, 0x4c18, { 0, 0, 47}}, + {m68k_op_mull_32_pd , 0xfff8, 0x4c20, { 0, 0, 48}}, + {m68k_op_mull_32_di , 0xfff8, 0x4c28, { 0, 0, 48}}, + {m68k_op_mull_32_ix , 0xfff8, 0x4c30, { 0, 0, 50}}, + {m68k_op_divl_32_d , 0xfff8, 0x4c40, { 0, 0, 84}}, + {m68k_op_divl_32_ai , 0xfff8, 0x4c50, { 0, 0, 88}}, + {m68k_op_divl_32_pi , 0xfff8, 0x4c58, { 0, 0, 88}}, + {m68k_op_divl_32_pd , 0xfff8, 0x4c60, { 0, 0, 89}}, + {m68k_op_divl_32_di , 0xfff8, 0x4c68, { 0, 0, 89}}, + {m68k_op_divl_32_ix , 0xfff8, 0x4c70, { 0, 0, 91}}, + {m68k_op_movem_16_er_ai , 0xfff8, 0x4c90, { 16, 16, 12}}, + {m68k_op_movem_16_er_pi , 0xfff8, 0x4c98, { 12, 12, 8}}, + {m68k_op_movem_16_er_di , 0xfff8, 0x4ca8, { 20, 20, 13}}, + {m68k_op_movem_16_er_ix , 0xfff8, 0x4cb0, { 22, 22, 15}}, + {m68k_op_movem_32_er_ai , 0xfff8, 0x4cd0, { 20, 20, 12}}, + {m68k_op_movem_32_er_pi , 0xfff8, 0x4cd8, { 12, 12, 8}}, + {m68k_op_movem_32_er_di , 0xfff8, 0x4ce8, { 24, 24, 13}}, + {m68k_op_movem_32_er_ix , 0xfff8, 0x4cf0, { 26, 26, 15}}, + {m68k_op_link_16 , 0xfff8, 0x4e50, { 16, 16, 5}}, + {m68k_op_unlk_32 , 0xfff8, 0x4e58, { 12, 12, 6}}, + {m68k_op_move_32_tou , 0xfff8, 0x4e60, { 4, 6, 2}}, + {m68k_op_move_32_fru , 0xfff8, 0x4e68, { 4, 6, 2}}, + {m68k_op_jsr_32_ai , 0xfff8, 0x4e90, { 16, 16, 4}}, + {m68k_op_jsr_32_di , 0xfff8, 0x4ea8, { 18, 18, 5}}, + {m68k_op_jsr_32_ix , 0xfff8, 0x4eb0, { 22, 22, 7}}, + {m68k_op_jmp_32_ai , 0xfff8, 0x4ed0, { 8, 8, 4}}, + {m68k_op_jmp_32_di , 0xfff8, 0x4ee8, { 10, 10, 5}}, + {m68k_op_jmp_32_ix , 0xfff8, 0x4ef0, { 12, 12, 7}}, + {m68k_op_st_8_d , 0xfff8, 0x50c0, { 6, 4, 4}}, + {m68k_op_dbt_16 , 0xfff8, 0x50c8, { 12, 12, 6}}, + {m68k_op_st_8_ai , 0xfff8, 0x50d0, { 12, 12, 10}}, + {m68k_op_st_8_pi , 0xfff8, 0x50d8, { 12, 12, 10}}, + {m68k_op_st_8_pd , 0xfff8, 0x50e0, { 14, 14, 11}}, + {m68k_op_st_8_di , 0xfff8, 0x50e8, { 16, 16, 11}}, + {m68k_op_st_8_ix , 0xfff8, 0x50f0, { 18, 18, 13}}, + {m68k_op_sf_8_d , 0xfff8, 0x51c0, { 4, 4, 4}}, + {m68k_op_dbf_16 , 0xfff8, 0x51c8, { 14, 14, 6}}, + {m68k_op_sf_8_ai , 0xfff8, 0x51d0, { 12, 12, 10}}, + {m68k_op_sf_8_pi , 0xfff8, 0x51d8, { 12, 12, 10}}, + {m68k_op_sf_8_pd , 0xfff8, 0x51e0, { 14, 14, 11}}, + {m68k_op_sf_8_di , 0xfff8, 0x51e8, { 16, 16, 11}}, + {m68k_op_sf_8_ix , 0xfff8, 0x51f0, { 18, 18, 13}}, + {m68k_op_shi_8_d , 0xfff8, 0x52c0, { 4, 4, 4}}, + {m68k_op_dbhi_16 , 0xfff8, 0x52c8, { 12, 12, 6}}, + {m68k_op_shi_8_ai , 0xfff8, 0x52d0, { 12, 12, 10}}, + {m68k_op_shi_8_pi , 0xfff8, 0x52d8, { 12, 12, 10}}, + {m68k_op_shi_8_pd , 0xfff8, 0x52e0, { 14, 14, 11}}, + {m68k_op_shi_8_di , 0xfff8, 0x52e8, { 16, 16, 11}}, + {m68k_op_shi_8_ix , 0xfff8, 0x52f0, { 18, 18, 13}}, + {m68k_op_sls_8_d , 0xfff8, 0x53c0, { 4, 4, 4}}, + {m68k_op_dbls_16 , 0xfff8, 0x53c8, { 12, 12, 6}}, + {m68k_op_sls_8_ai , 0xfff8, 0x53d0, { 12, 12, 10}}, + {m68k_op_sls_8_pi , 0xfff8, 0x53d8, { 12, 12, 10}}, + {m68k_op_sls_8_pd , 0xfff8, 0x53e0, { 14, 14, 11}}, + {m68k_op_sls_8_di , 0xfff8, 0x53e8, { 16, 16, 11}}, + {m68k_op_sls_8_ix , 0xfff8, 0x53f0, { 18, 18, 13}}, + {m68k_op_scc_8_d , 0xfff8, 0x54c0, { 4, 4, 4}}, + {m68k_op_dbcc_16 , 0xfff8, 0x54c8, { 12, 12, 6}}, + {m68k_op_scc_8_ai , 0xfff8, 0x54d0, { 12, 12, 10}}, + {m68k_op_scc_8_pi , 0xfff8, 0x54d8, { 12, 12, 10}}, + {m68k_op_scc_8_pd , 0xfff8, 0x54e0, { 14, 14, 11}}, + {m68k_op_scc_8_di , 0xfff8, 0x54e8, { 16, 16, 11}}, + {m68k_op_scc_8_ix , 0xfff8, 0x54f0, { 18, 18, 13}}, + {m68k_op_scs_8_d , 0xfff8, 0x55c0, { 4, 4, 4}}, + {m68k_op_dbcs_16 , 0xfff8, 0x55c8, { 12, 12, 6}}, + {m68k_op_scs_8_ai , 0xfff8, 0x55d0, { 12, 12, 10}}, + {m68k_op_scs_8_pi , 0xfff8, 0x55d8, { 12, 12, 10}}, + {m68k_op_scs_8_pd , 0xfff8, 0x55e0, { 14, 14, 11}}, + {m68k_op_scs_8_di , 0xfff8, 0x55e8, { 16, 16, 11}}, + {m68k_op_scs_8_ix , 0xfff8, 0x55f0, { 18, 18, 13}}, + {m68k_op_sne_8_d , 0xfff8, 0x56c0, { 4, 4, 4}}, + {m68k_op_dbne_16 , 0xfff8, 0x56c8, { 12, 12, 6}}, + {m68k_op_sne_8_ai , 0xfff8, 0x56d0, { 12, 12, 10}}, + {m68k_op_sne_8_pi , 0xfff8, 0x56d8, { 12, 12, 10}}, + {m68k_op_sne_8_pd , 0xfff8, 0x56e0, { 14, 14, 11}}, + {m68k_op_sne_8_di , 0xfff8, 0x56e8, { 16, 16, 11}}, + {m68k_op_sne_8_ix , 0xfff8, 0x56f0, { 18, 18, 13}}, + {m68k_op_seq_8_d , 0xfff8, 0x57c0, { 4, 4, 4}}, + {m68k_op_dbeq_16 , 0xfff8, 0x57c8, { 12, 12, 6}}, + {m68k_op_seq_8_ai , 0xfff8, 0x57d0, { 12, 12, 10}}, + {m68k_op_seq_8_pi , 0xfff8, 0x57d8, { 12, 12, 10}}, + {m68k_op_seq_8_pd , 0xfff8, 0x57e0, { 14, 14, 11}}, + {m68k_op_seq_8_di , 0xfff8, 0x57e8, { 16, 16, 11}}, + {m68k_op_seq_8_ix , 0xfff8, 0x57f0, { 18, 18, 13}}, + {m68k_op_svc_8_d , 0xfff8, 0x58c0, { 4, 4, 4}}, + {m68k_op_dbvc_16 , 0xfff8, 0x58c8, { 12, 12, 6}}, + {m68k_op_svc_8_ai , 0xfff8, 0x58d0, { 12, 12, 10}}, + {m68k_op_svc_8_pi , 0xfff8, 0x58d8, { 12, 12, 10}}, + {m68k_op_svc_8_pd , 0xfff8, 0x58e0, { 14, 14, 11}}, + {m68k_op_svc_8_di , 0xfff8, 0x58e8, { 16, 16, 11}}, + {m68k_op_svc_8_ix , 0xfff8, 0x58f0, { 18, 18, 13}}, + {m68k_op_svs_8_d , 0xfff8, 0x59c0, { 4, 4, 4}}, + {m68k_op_dbvs_16 , 0xfff8, 0x59c8, { 12, 12, 6}}, + {m68k_op_svs_8_ai , 0xfff8, 0x59d0, { 12, 12, 10}}, + {m68k_op_svs_8_pi , 0xfff8, 0x59d8, { 12, 12, 10}}, + {m68k_op_svs_8_pd , 0xfff8, 0x59e0, { 14, 14, 11}}, + {m68k_op_svs_8_di , 0xfff8, 0x59e8, { 16, 16, 11}}, + {m68k_op_svs_8_ix , 0xfff8, 0x59f0, { 18, 18, 13}}, + {m68k_op_spl_8_d , 0xfff8, 0x5ac0, { 4, 4, 4}}, + {m68k_op_dbpl_16 , 0xfff8, 0x5ac8, { 12, 12, 6}}, + {m68k_op_spl_8_ai , 0xfff8, 0x5ad0, { 12, 12, 10}}, + {m68k_op_spl_8_pi , 0xfff8, 0x5ad8, { 12, 12, 10}}, + {m68k_op_spl_8_pd , 0xfff8, 0x5ae0, { 14, 14, 11}}, + {m68k_op_spl_8_di , 0xfff8, 0x5ae8, { 16, 16, 11}}, + {m68k_op_spl_8_ix , 0xfff8, 0x5af0, { 18, 18, 13}}, + {m68k_op_smi_8_d , 0xfff8, 0x5bc0, { 4, 4, 4}}, + {m68k_op_dbmi_16 , 0xfff8, 0x5bc8, { 12, 12, 6}}, + {m68k_op_smi_8_ai , 0xfff8, 0x5bd0, { 12, 12, 10}}, + {m68k_op_smi_8_pi , 0xfff8, 0x5bd8, { 12, 12, 10}}, + {m68k_op_smi_8_pd , 0xfff8, 0x5be0, { 14, 14, 11}}, + {m68k_op_smi_8_di , 0xfff8, 0x5be8, { 16, 16, 11}}, + {m68k_op_smi_8_ix , 0xfff8, 0x5bf0, { 18, 18, 13}}, + {m68k_op_sge_8_d , 0xfff8, 0x5cc0, { 4, 4, 4}}, + {m68k_op_dbge_16 , 0xfff8, 0x5cc8, { 12, 12, 6}}, + {m68k_op_sge_8_ai , 0xfff8, 0x5cd0, { 12, 12, 10}}, + {m68k_op_sge_8_pi , 0xfff8, 0x5cd8, { 12, 12, 10}}, + {m68k_op_sge_8_pd , 0xfff8, 0x5ce0, { 14, 14, 11}}, + {m68k_op_sge_8_di , 0xfff8, 0x5ce8, { 16, 16, 11}}, + {m68k_op_sge_8_ix , 0xfff8, 0x5cf0, { 18, 18, 13}}, + {m68k_op_slt_8_d , 0xfff8, 0x5dc0, { 4, 4, 4}}, + {m68k_op_dblt_16 , 0xfff8, 0x5dc8, { 12, 12, 6}}, + {m68k_op_slt_8_ai , 0xfff8, 0x5dd0, { 12, 12, 10}}, + {m68k_op_slt_8_pi , 0xfff8, 0x5dd8, { 12, 12, 10}}, + {m68k_op_slt_8_pd , 0xfff8, 0x5de0, { 14, 14, 11}}, + {m68k_op_slt_8_di , 0xfff8, 0x5de8, { 16, 16, 11}}, + {m68k_op_slt_8_ix , 0xfff8, 0x5df0, { 18, 18, 13}}, + {m68k_op_sgt_8_d , 0xfff8, 0x5ec0, { 4, 4, 4}}, + {m68k_op_dbgt_16 , 0xfff8, 0x5ec8, { 12, 12, 6}}, + {m68k_op_sgt_8_ai , 0xfff8, 0x5ed0, { 12, 12, 10}}, + {m68k_op_sgt_8_pi , 0xfff8, 0x5ed8, { 12, 12, 10}}, + {m68k_op_sgt_8_pd , 0xfff8, 0x5ee0, { 14, 14, 11}}, + {m68k_op_sgt_8_di , 0xfff8, 0x5ee8, { 16, 16, 11}}, + {m68k_op_sgt_8_ix , 0xfff8, 0x5ef0, { 18, 18, 13}}, + {m68k_op_sle_8_d , 0xfff8, 0x5fc0, { 4, 4, 4}}, + {m68k_op_dble_16 , 0xfff8, 0x5fc8, { 12, 12, 6}}, + {m68k_op_sle_8_ai , 0xfff8, 0x5fd0, { 12, 12, 10}}, + {m68k_op_sle_8_pi , 0xfff8, 0x5fd8, { 12, 12, 10}}, + {m68k_op_sle_8_pd , 0xfff8, 0x5fe0, { 14, 14, 11}}, + {m68k_op_sle_8_di , 0xfff8, 0x5fe8, { 16, 16, 11}}, + {m68k_op_sle_8_ix , 0xfff8, 0x5ff0, { 18, 18, 13}}, + {m68k_op_sbcd_8_mm_ax7 , 0xfff8, 0x8f08, { 18, 18, 16}}, + {m68k_op_pack_16_mm_ax7 , 0xfff8, 0x8f48, { 0, 0, 13}}, + {m68k_op_unpk_16_mm_ax7 , 0xfff8, 0x8f88, { 0, 0, 13}}, + {m68k_op_subx_8_mm_ax7 , 0xfff8, 0x9f08, { 18, 18, 12}}, + {m68k_op_cmpm_8_ax7 , 0xfff8, 0xbf08, { 12, 12, 9}}, + {m68k_op_abcd_8_mm_ax7 , 0xfff8, 0xcf08, { 18, 18, 16}}, + {m68k_op_addx_8_mm_ax7 , 0xfff8, 0xdf08, { 18, 18, 12}}, + {m68k_op_asr_16_ai , 0xfff8, 0xe0d0, { 12, 12, 9}}, + {m68k_op_asr_16_pi , 0xfff8, 0xe0d8, { 12, 12, 9}}, + {m68k_op_asr_16_pd , 0xfff8, 0xe0e0, { 14, 14, 10}}, + {m68k_op_asr_16_di , 0xfff8, 0xe0e8, { 16, 16, 10}}, + {m68k_op_asr_16_ix , 0xfff8, 0xe0f0, { 18, 18, 12}}, + {m68k_op_asl_16_ai , 0xfff8, 0xe1d0, { 12, 12, 10}}, + {m68k_op_asl_16_pi , 0xfff8, 0xe1d8, { 12, 12, 10}}, + {m68k_op_asl_16_pd , 0xfff8, 0xe1e0, { 14, 14, 11}}, + {m68k_op_asl_16_di , 0xfff8, 0xe1e8, { 16, 16, 11}}, + {m68k_op_asl_16_ix , 0xfff8, 0xe1f0, { 18, 18, 13}}, + {m68k_op_lsr_16_ai , 0xfff8, 0xe2d0, { 12, 12, 9}}, + {m68k_op_lsr_16_pi , 0xfff8, 0xe2d8, { 12, 12, 9}}, + {m68k_op_lsr_16_pd , 0xfff8, 0xe2e0, { 14, 14, 10}}, + {m68k_op_lsr_16_di , 0xfff8, 0xe2e8, { 16, 16, 10}}, + {m68k_op_lsr_16_ix , 0xfff8, 0xe2f0, { 18, 18, 12}}, + {m68k_op_lsl_16_ai , 0xfff8, 0xe3d0, { 12, 12, 9}}, + {m68k_op_lsl_16_pi , 0xfff8, 0xe3d8, { 12, 12, 9}}, + {m68k_op_lsl_16_pd , 0xfff8, 0xe3e0, { 14, 14, 10}}, + {m68k_op_lsl_16_di , 0xfff8, 0xe3e8, { 16, 16, 10}}, + {m68k_op_lsl_16_ix , 0xfff8, 0xe3f0, { 18, 18, 12}}, + {m68k_op_roxr_16_ai , 0xfff8, 0xe4d0, { 12, 12, 9}}, + {m68k_op_roxr_16_pi , 0xfff8, 0xe4d8, { 12, 12, 9}}, + {m68k_op_roxr_16_pd , 0xfff8, 0xe4e0, { 14, 14, 10}}, + {m68k_op_roxr_16_di , 0xfff8, 0xe4e8, { 16, 16, 10}}, + {m68k_op_roxr_16_ix , 0xfff8, 0xe4f0, { 18, 18, 12}}, + {m68k_op_roxl_16_ai , 0xfff8, 0xe5d0, { 12, 12, 9}}, + {m68k_op_roxl_16_pi , 0xfff8, 0xe5d8, { 12, 12, 9}}, + {m68k_op_roxl_16_pd , 0xfff8, 0xe5e0, { 14, 14, 10}}, + {m68k_op_roxl_16_di , 0xfff8, 0xe5e8, { 16, 16, 10}}, + {m68k_op_roxl_16_ix , 0xfff8, 0xe5f0, { 18, 18, 12}}, + {m68k_op_ror_16_ai , 0xfff8, 0xe6d0, { 12, 12, 11}}, + {m68k_op_ror_16_pi , 0xfff8, 0xe6d8, { 12, 12, 11}}, + {m68k_op_ror_16_pd , 0xfff8, 0xe6e0, { 14, 14, 12}}, + {m68k_op_ror_16_di , 0xfff8, 0xe6e8, { 16, 16, 12}}, + {m68k_op_ror_16_ix , 0xfff8, 0xe6f0, { 18, 18, 14}}, + {m68k_op_rol_16_ai , 0xfff8, 0xe7d0, { 12, 12, 11}}, + {m68k_op_rol_16_pi , 0xfff8, 0xe7d8, { 12, 12, 11}}, + {m68k_op_rol_16_pd , 0xfff8, 0xe7e0, { 14, 14, 12}}, + {m68k_op_rol_16_di , 0xfff8, 0xe7e8, { 16, 16, 12}}, + {m68k_op_rol_16_ix , 0xfff8, 0xe7f0, { 18, 18, 14}}, + {m68k_op_bftst_32_d , 0xfff8, 0xe8c0, { 0, 0, 6}}, + {m68k_op_bftst_32_ai , 0xfff8, 0xe8d0, { 0, 0, 17}}, + {m68k_op_bftst_32_di , 0xfff8, 0xe8e8, { 0, 0, 18}}, + {m68k_op_bftst_32_ix , 0xfff8, 0xe8f0, { 0, 0, 20}}, + {m68k_op_bfextu_32_d , 0xfff8, 0xe9c0, { 0, 0, 8}}, + {m68k_op_bfextu_32_ai , 0xfff8, 0xe9d0, { 0, 0, 19}}, + {m68k_op_bfextu_32_di , 0xfff8, 0xe9e8, { 0, 0, 20}}, + {m68k_op_bfextu_32_ix , 0xfff8, 0xe9f0, { 0, 0, 22}}, + {m68k_op_bfchg_32_d , 0xfff8, 0xeac0, { 0, 0, 12}}, + {m68k_op_bfchg_32_ai , 0xfff8, 0xead0, { 0, 0, 24}}, + {m68k_op_bfchg_32_di , 0xfff8, 0xeae8, { 0, 0, 25}}, + {m68k_op_bfchg_32_ix , 0xfff8, 0xeaf0, { 0, 0, 27}}, + {m68k_op_bfexts_32_d , 0xfff8, 0xebc0, { 0, 0, 8}}, + {m68k_op_bfexts_32_ai , 0xfff8, 0xebd0, { 0, 0, 19}}, + {m68k_op_bfexts_32_di , 0xfff8, 0xebe8, { 0, 0, 20}}, + {m68k_op_bfexts_32_ix , 0xfff8, 0xebf0, { 0, 0, 22}}, + {m68k_op_bfclr_32_d , 0xfff8, 0xecc0, { 0, 0, 12}}, + {m68k_op_bfclr_32_ai , 0xfff8, 0xecd0, { 0, 0, 24}}, + {m68k_op_bfclr_32_di , 0xfff8, 0xece8, { 0, 0, 25}}, + {m68k_op_bfclr_32_ix , 0xfff8, 0xecf0, { 0, 0, 27}}, + {m68k_op_bfffo_32_d , 0xfff8, 0xedc0, { 0, 0, 18}}, + {m68k_op_bfffo_32_ai , 0xfff8, 0xedd0, { 0, 0, 32}}, + {m68k_op_bfffo_32_di , 0xfff8, 0xede8, { 0, 0, 33}}, + {m68k_op_bfffo_32_ix , 0xfff8, 0xedf0, { 0, 0, 35}}, + {m68k_op_bfset_32_d , 0xfff8, 0xeec0, { 0, 0, 12}}, + {m68k_op_bfset_32_ai , 0xfff8, 0xeed0, { 0, 0, 24}}, + {m68k_op_bfset_32_di , 0xfff8, 0xeee8, { 0, 0, 25}}, + {m68k_op_bfset_32_ix , 0xfff8, 0xeef0, { 0, 0, 27}}, + {m68k_op_bfins_32_d , 0xfff8, 0xefc0, { 0, 0, 10}}, + {m68k_op_bfins_32_ai , 0xfff8, 0xefd0, { 0, 0, 21}}, + {m68k_op_bfins_32_di , 0xfff8, 0xefe8, { 0, 0, 22}}, + {m68k_op_bfins_32_ix , 0xfff8, 0xeff0, { 0, 0, 24}}, + {m68k_op_ori_8_pi7 , 0xffff, 0x001f, { 16, 16, 8}}, + {m68k_op_ori_8_pd7 , 0xffff, 0x0027, { 18, 18, 9}}, + {m68k_op_ori_8_aw , 0xffff, 0x0038, { 20, 20, 8}}, + {m68k_op_ori_8_al , 0xffff, 0x0039, { 24, 24, 8}}, + {m68k_op_ori_16_toc , 0xffff, 0x003c, { 20, 16, 12}}, + {m68k_op_ori_16_aw , 0xffff, 0x0078, { 20, 20, 8}}, + {m68k_op_ori_16_al , 0xffff, 0x0079, { 24, 24, 8}}, + {m68k_op_ori_16_tos , 0xffff, 0x007c, { 20, 16, 12}}, + {m68k_op_ori_32_aw , 0xffff, 0x00b8, { 32, 32, 8}}, + {m68k_op_ori_32_al , 0xffff, 0x00b9, { 36, 36, 8}}, + {m68k_op_chk2cmp2_8_aw , 0xffff, 0x00f8, { 0, 0, 22}}, + {m68k_op_chk2cmp2_8_al , 0xffff, 0x00f9, { 0, 0, 22}}, + {m68k_op_chk2cmp2_8_pcdi , 0xffff, 0x00fa, { 0, 0, 23}}, + {m68k_op_chk2cmp2_8_pcix , 0xffff, 0x00fb, { 0, 0, 25}}, + {m68k_op_andi_8_pi7 , 0xffff, 0x021f, { 16, 16, 8}}, + {m68k_op_andi_8_pd7 , 0xffff, 0x0227, { 18, 18, 9}}, + {m68k_op_andi_8_aw , 0xffff, 0x0238, { 20, 20, 8}}, + {m68k_op_andi_8_al , 0xffff, 0x0239, { 24, 24, 8}}, + {m68k_op_andi_16_toc , 0xffff, 0x023c, { 20, 16, 12}}, + {m68k_op_andi_16_aw , 0xffff, 0x0278, { 20, 20, 8}}, + {m68k_op_andi_16_al , 0xffff, 0x0279, { 24, 24, 8}}, + {m68k_op_andi_16_tos , 0xffff, 0x027c, { 20, 16, 12}}, + {m68k_op_andi_32_aw , 0xffff, 0x02b8, { 32, 32, 8}}, + {m68k_op_andi_32_al , 0xffff, 0x02b9, { 36, 36, 8}}, + {m68k_op_chk2cmp2_16_aw , 0xffff, 0x02f8, { 0, 0, 22}}, + {m68k_op_chk2cmp2_16_al , 0xffff, 0x02f9, { 0, 0, 22}}, + {m68k_op_chk2cmp2_16_pcdi , 0xffff, 0x02fa, { 0, 0, 23}}, + {m68k_op_chk2cmp2_16_pcix , 0xffff, 0x02fb, { 0, 0, 25}}, + {m68k_op_subi_8_pi7 , 0xffff, 0x041f, { 16, 16, 8}}, + {m68k_op_subi_8_pd7 , 0xffff, 0x0427, { 18, 18, 9}}, + {m68k_op_subi_8_aw , 0xffff, 0x0438, { 20, 20, 8}}, + {m68k_op_subi_8_al , 0xffff, 0x0439, { 24, 24, 8}}, + {m68k_op_subi_16_aw , 0xffff, 0x0478, { 20, 20, 8}}, + {m68k_op_subi_16_al , 0xffff, 0x0479, { 24, 24, 8}}, + {m68k_op_subi_32_aw , 0xffff, 0x04b8, { 32, 32, 8}}, + {m68k_op_subi_32_al , 0xffff, 0x04b9, { 36, 36, 8}}, + {m68k_op_chk2cmp2_32_aw , 0xffff, 0x04f8, { 0, 0, 22}}, + {m68k_op_chk2cmp2_32_al , 0xffff, 0x04f9, { 0, 0, 22}}, + {m68k_op_chk2cmp2_32_pcdi , 0xffff, 0x04fa, { 0, 0, 23}}, + {m68k_op_chk2cmp2_32_pcix , 0xffff, 0x04fb, { 0, 0, 25}}, + {m68k_op_addi_8_pi7 , 0xffff, 0x061f, { 16, 16, 8}}, + {m68k_op_addi_8_pd7 , 0xffff, 0x0627, { 18, 18, 9}}, + {m68k_op_addi_8_aw , 0xffff, 0x0638, { 20, 20, 8}}, + {m68k_op_addi_8_al , 0xffff, 0x0639, { 24, 24, 8}}, + {m68k_op_addi_16_aw , 0xffff, 0x0678, { 20, 20, 8}}, + {m68k_op_addi_16_al , 0xffff, 0x0679, { 24, 24, 8}}, + {m68k_op_addi_32_aw , 0xffff, 0x06b8, { 32, 32, 8}}, + {m68k_op_addi_32_al , 0xffff, 0x06b9, { 36, 36, 8}}, + {m68k_op_callm_32_aw , 0xffff, 0x06f8, { 0, 0, 64}}, + {m68k_op_callm_32_al , 0xffff, 0x06f9, { 0, 0, 64}}, + {m68k_op_callm_32_pcdi , 0xffff, 0x06fa, { 0, 0, 65}}, + {m68k_op_callm_32_pcix , 0xffff, 0x06fb, { 0, 0, 67}}, + {m68k_op_btst_8_s_pi7 , 0xffff, 0x081f, { 12, 12, 8}}, + {m68k_op_btst_8_s_pd7 , 0xffff, 0x0827, { 14, 14, 9}}, + {m68k_op_btst_8_s_aw , 0xffff, 0x0838, { 16, 16, 8}}, + {m68k_op_btst_8_s_al , 0xffff, 0x0839, { 20, 20, 8}}, + {m68k_op_btst_8_s_pcdi , 0xffff, 0x083a, { 16, 16, 9}}, + {m68k_op_btst_8_s_pcix , 0xffff, 0x083b, { 18, 18, 11}}, + {m68k_op_bchg_8_s_pi7 , 0xffff, 0x085f, { 16, 16, 8}}, + {m68k_op_bchg_8_s_pd7 , 0xffff, 0x0867, { 18, 18, 9}}, + {m68k_op_bchg_8_s_aw , 0xffff, 0x0878, { 20, 20, 8}}, + {m68k_op_bchg_8_s_al , 0xffff, 0x0879, { 24, 24, 8}}, + {m68k_op_bclr_8_s_pi7 , 0xffff, 0x089f, { 16, 16, 8}}, + {m68k_op_bclr_8_s_pd7 , 0xffff, 0x08a7, { 18, 18, 9}}, + {m68k_op_bclr_8_s_aw , 0xffff, 0x08b8, { 20, 20, 8}}, + {m68k_op_bclr_8_s_al , 0xffff, 0x08b9, { 24, 24, 8}}, + {m68k_op_bset_8_s_pi7 , 0xffff, 0x08df, { 16, 16, 8}}, + {m68k_op_bset_8_s_pd7 , 0xffff, 0x08e7, { 18, 18, 9}}, + {m68k_op_bset_8_s_aw , 0xffff, 0x08f8, { 20, 20, 8}}, + {m68k_op_bset_8_s_al , 0xffff, 0x08f9, { 24, 24, 8}}, + {m68k_op_eori_8_pi7 , 0xffff, 0x0a1f, { 16, 16, 8}}, + {m68k_op_eori_8_pd7 , 0xffff, 0x0a27, { 18, 18, 9}}, + {m68k_op_eori_8_aw , 0xffff, 0x0a38, { 20, 20, 8}}, + {m68k_op_eori_8_al , 0xffff, 0x0a39, { 24, 24, 8}}, + {m68k_op_eori_16_toc , 0xffff, 0x0a3c, { 20, 16, 12}}, + {m68k_op_eori_16_aw , 0xffff, 0x0a78, { 20, 20, 8}}, + {m68k_op_eori_16_al , 0xffff, 0x0a79, { 24, 24, 8}}, + {m68k_op_eori_16_tos , 0xffff, 0x0a7c, { 20, 16, 12}}, + {m68k_op_eori_32_aw , 0xffff, 0x0ab8, { 32, 32, 8}}, + {m68k_op_eori_32_al , 0xffff, 0x0ab9, { 36, 36, 8}}, + {m68k_op_cas_8_pi7 , 0xffff, 0x0adf, { 0, 0, 16}}, + {m68k_op_cas_8_pd7 , 0xffff, 0x0ae7, { 0, 0, 17}}, + {m68k_op_cas_8_aw , 0xffff, 0x0af8, { 0, 0, 16}}, + {m68k_op_cas_8_al , 0xffff, 0x0af9, { 0, 0, 16}}, + {m68k_op_cmpi_8_pi7 , 0xffff, 0x0c1f, { 12, 12, 6}}, + {m68k_op_cmpi_8_pd7 , 0xffff, 0x0c27, { 14, 14, 7}}, + {m68k_op_cmpi_8_aw , 0xffff, 0x0c38, { 16, 16, 6}}, + {m68k_op_cmpi_8_al , 0xffff, 0x0c39, { 20, 20, 6}}, + {m68k_op_cmpi_8_pcdi , 0xffff, 0x0c3a, { 0, 0, 7}}, + {m68k_op_cmpi_8_pcix , 0xffff, 0x0c3b, { 0, 0, 9}}, + {m68k_op_cmpi_16_aw , 0xffff, 0x0c78, { 16, 16, 6}}, + {m68k_op_cmpi_16_al , 0xffff, 0x0c79, { 20, 20, 6}}, + {m68k_op_cmpi_16_pcdi , 0xffff, 0x0c7a, { 0, 0, 7}}, + {m68k_op_cmpi_16_pcix , 0xffff, 0x0c7b, { 0, 0, 9}}, + {m68k_op_cmpi_32_aw , 0xffff, 0x0cb8, { 24, 24, 6}}, + {m68k_op_cmpi_32_al , 0xffff, 0x0cb9, { 28, 28, 6}}, + {m68k_op_cmpi_32_pcdi , 0xffff, 0x0cba, { 0, 0, 7}}, + {m68k_op_cmpi_32_pcix , 0xffff, 0x0cbb, { 0, 0, 9}}, + {m68k_op_cas_16_aw , 0xffff, 0x0cf8, { 0, 0, 16}}, + {m68k_op_cas_16_al , 0xffff, 0x0cf9, { 0, 0, 16}}, + {m68k_op_cas2_16 , 0xffff, 0x0cfc, { 0, 0, 12}}, + {m68k_op_moves_8_pi7 , 0xffff, 0x0e1f, { 0, 18, 9}}, + {m68k_op_moves_8_pd7 , 0xffff, 0x0e27, { 0, 20, 10}}, + {m68k_op_moves_8_aw , 0xffff, 0x0e38, { 0, 26, 9}}, + {m68k_op_moves_8_al , 0xffff, 0x0e39, { 0, 30, 9}}, + {m68k_op_moves_16_aw , 0xffff, 0x0e78, { 0, 26, 9}}, + {m68k_op_moves_16_al , 0xffff, 0x0e79, { 0, 30, 9}}, + {m68k_op_moves_32_aw , 0xffff, 0x0eb8, { 0, 32, 9}}, + {m68k_op_moves_32_al , 0xffff, 0x0eb9, { 0, 36, 9}}, + {m68k_op_cas_32_aw , 0xffff, 0x0ef8, { 0, 0, 16}}, + {m68k_op_cas_32_al , 0xffff, 0x0ef9, { 0, 0, 16}}, + {m68k_op_cas2_32 , 0xffff, 0x0efc, { 0, 0, 12}}, + {m68k_op_move_8_aw_pi7 , 0xffff, 0x11df, { 16, 16, 8}}, + {m68k_op_move_8_aw_pd7 , 0xffff, 0x11e7, { 18, 18, 9}}, + {m68k_op_move_8_aw_aw , 0xffff, 0x11f8, { 20, 20, 8}}, + {m68k_op_move_8_aw_al , 0xffff, 0x11f9, { 24, 24, 8}}, + {m68k_op_move_8_aw_pcdi , 0xffff, 0x11fa, { 20, 20, 9}}, + {m68k_op_move_8_aw_pcix , 0xffff, 0x11fb, { 22, 22, 11}}, + {m68k_op_move_8_aw_i , 0xffff, 0x11fc, { 16, 16, 6}}, + {m68k_op_move_8_al_pi7 , 0xffff, 0x13df, { 20, 20, 10}}, + {m68k_op_move_8_al_pd7 , 0xffff, 0x13e7, { 22, 22, 11}}, + {m68k_op_move_8_al_aw , 0xffff, 0x13f8, { 24, 24, 10}}, + {m68k_op_move_8_al_al , 0xffff, 0x13f9, { 28, 28, 10}}, + {m68k_op_move_8_al_pcdi , 0xffff, 0x13fa, { 24, 24, 11}}, + {m68k_op_move_8_al_pcix , 0xffff, 0x13fb, { 26, 26, 13}}, + {m68k_op_move_8_al_i , 0xffff, 0x13fc, { 20, 20, 8}}, + {m68k_op_move_8_pi7_pi7 , 0xffff, 0x1edf, { 12, 12, 8}}, + {m68k_op_move_8_pi7_pd7 , 0xffff, 0x1ee7, { 14, 14, 9}}, + {m68k_op_move_8_pi7_aw , 0xffff, 0x1ef8, { 16, 16, 8}}, + {m68k_op_move_8_pi7_al , 0xffff, 0x1ef9, { 20, 20, 8}}, + {m68k_op_move_8_pi7_pcdi , 0xffff, 0x1efa, { 16, 16, 9}}, + {m68k_op_move_8_pi7_pcix , 0xffff, 0x1efb, { 18, 18, 11}}, + {m68k_op_move_8_pi7_i , 0xffff, 0x1efc, { 12, 12, 6}}, + {m68k_op_move_8_pd7_pi7 , 0xffff, 0x1f1f, { 12, 12, 9}}, + {m68k_op_move_8_pd7_pd7 , 0xffff, 0x1f27, { 14, 14, 10}}, + {m68k_op_move_8_pd7_aw , 0xffff, 0x1f38, { 16, 16, 9}}, + {m68k_op_move_8_pd7_al , 0xffff, 0x1f39, { 20, 20, 9}}, + {m68k_op_move_8_pd7_pcdi , 0xffff, 0x1f3a, { 16, 16, 10}}, + {m68k_op_move_8_pd7_pcix , 0xffff, 0x1f3b, { 18, 18, 12}}, + {m68k_op_move_8_pd7_i , 0xffff, 0x1f3c, { 12, 12, 7}}, + {m68k_op_move_32_aw_aw , 0xffff, 0x21f8, { 28, 28, 8}}, + {m68k_op_move_32_aw_al , 0xffff, 0x21f9, { 32, 32, 8}}, + {m68k_op_move_32_aw_pcdi , 0xffff, 0x21fa, { 28, 28, 9}}, + {m68k_op_move_32_aw_pcix , 0xffff, 0x21fb, { 30, 30, 11}}, + {m68k_op_move_32_aw_i , 0xffff, 0x21fc, { 24, 24, 8}}, + {m68k_op_move_32_al_aw , 0xffff, 0x23f8, { 32, 32, 10}}, + {m68k_op_move_32_al_al , 0xffff, 0x23f9, { 36, 36, 10}}, + {m68k_op_move_32_al_pcdi , 0xffff, 0x23fa, { 32, 32, 11}}, + {m68k_op_move_32_al_pcix , 0xffff, 0x23fb, { 34, 34, 13}}, + {m68k_op_move_32_al_i , 0xffff, 0x23fc, { 28, 28, 10}}, + {m68k_op_move_16_aw_aw , 0xffff, 0x31f8, { 20, 20, 8}}, + {m68k_op_move_16_aw_al , 0xffff, 0x31f9, { 24, 24, 8}}, + {m68k_op_move_16_aw_pcdi , 0xffff, 0x31fa, { 20, 20, 9}}, + {m68k_op_move_16_aw_pcix , 0xffff, 0x31fb, { 22, 22, 11}}, + {m68k_op_move_16_aw_i , 0xffff, 0x31fc, { 16, 16, 6}}, + {m68k_op_move_16_al_aw , 0xffff, 0x33f8, { 24, 24, 10}}, + {m68k_op_move_16_al_al , 0xffff, 0x33f9, { 28, 28, 10}}, + {m68k_op_move_16_al_pcdi , 0xffff, 0x33fa, { 24, 24, 11}}, + {m68k_op_move_16_al_pcix , 0xffff, 0x33fb, { 26, 26, 13}}, + {m68k_op_move_16_al_i , 0xffff, 0x33fc, { 20, 20, 8}}, + {m68k_op_negx_8_pi7 , 0xffff, 0x401f, { 12, 12, 8}}, + {m68k_op_negx_8_pd7 , 0xffff, 0x4027, { 14, 14, 9}}, + {m68k_op_negx_8_aw , 0xffff, 0x4038, { 16, 16, 8}}, + {m68k_op_negx_8_al , 0xffff, 0x4039, { 20, 20, 8}}, + {m68k_op_negx_16_aw , 0xffff, 0x4078, { 16, 16, 8}}, + {m68k_op_negx_16_al , 0xffff, 0x4079, { 20, 20, 8}}, + {m68k_op_negx_32_aw , 0xffff, 0x40b8, { 24, 24, 8}}, + {m68k_op_negx_32_al , 0xffff, 0x40b9, { 28, 28, 8}}, + {m68k_op_move_16_frs_aw , 0xffff, 0x40f8, { 16, 16, 12}}, + {m68k_op_move_16_frs_al , 0xffff, 0x40f9, { 20, 20, 12}}, + {m68k_op_clr_8_pi7 , 0xffff, 0x421f, { 12, 8, 8}}, + {m68k_op_clr_8_pd7 , 0xffff, 0x4227, { 14, 10, 9}}, + {m68k_op_clr_8_aw , 0xffff, 0x4238, { 16, 12, 8}}, + {m68k_op_clr_8_al , 0xffff, 0x4239, { 20, 14, 8}}, + {m68k_op_clr_16_aw , 0xffff, 0x4278, { 16, 12, 8}}, + {m68k_op_clr_16_al , 0xffff, 0x4279, { 20, 14, 8}}, + {m68k_op_clr_32_aw , 0xffff, 0x42b8, { 24, 16, 8}}, + {m68k_op_clr_32_al , 0xffff, 0x42b9, { 28, 20, 8}}, + {m68k_op_move_16_frc_aw , 0xffff, 0x42f8, { 0, 16, 8}}, + {m68k_op_move_16_frc_al , 0xffff, 0x42f9, { 0, 20, 8}}, + {m68k_op_neg_8_pi7 , 0xffff, 0x441f, { 12, 12, 8}}, + {m68k_op_neg_8_pd7 , 0xffff, 0x4427, { 14, 14, 9}}, + {m68k_op_neg_8_aw , 0xffff, 0x4438, { 16, 16, 8}}, + {m68k_op_neg_8_al , 0xffff, 0x4439, { 20, 20, 8}}, + {m68k_op_neg_16_aw , 0xffff, 0x4478, { 16, 16, 8}}, + {m68k_op_neg_16_al , 0xffff, 0x4479, { 20, 20, 8}}, + {m68k_op_neg_32_aw , 0xffff, 0x44b8, { 24, 24, 8}}, + {m68k_op_neg_32_al , 0xffff, 0x44b9, { 28, 28, 8}}, + {m68k_op_move_16_toc_aw , 0xffff, 0x44f8, { 20, 20, 8}}, + {m68k_op_move_16_toc_al , 0xffff, 0x44f9, { 24, 24, 8}}, + {m68k_op_move_16_toc_pcdi , 0xffff, 0x44fa, { 20, 20, 9}}, + {m68k_op_move_16_toc_pcix , 0xffff, 0x44fb, { 22, 22, 11}}, + {m68k_op_move_16_toc_i , 0xffff, 0x44fc, { 16, 16, 6}}, + {m68k_op_not_8_pi7 , 0xffff, 0x461f, { 12, 12, 8}}, + {m68k_op_not_8_pd7 , 0xffff, 0x4627, { 14, 14, 9}}, + {m68k_op_not_8_aw , 0xffff, 0x4638, { 16, 16, 8}}, + {m68k_op_not_8_al , 0xffff, 0x4639, { 20, 20, 8}}, + {m68k_op_not_16_aw , 0xffff, 0x4678, { 16, 16, 8}}, + {m68k_op_not_16_al , 0xffff, 0x4679, { 20, 20, 8}}, + {m68k_op_not_32_aw , 0xffff, 0x46b8, { 24, 24, 8}}, + {m68k_op_not_32_al , 0xffff, 0x46b9, { 28, 28, 8}}, + {m68k_op_move_16_tos_aw , 0xffff, 0x46f8, { 20, 20, 12}}, + {m68k_op_move_16_tos_al , 0xffff, 0x46f9, { 24, 24, 12}}, + {m68k_op_move_16_tos_pcdi , 0xffff, 0x46fa, { 20, 20, 13}}, + {m68k_op_move_16_tos_pcix , 0xffff, 0x46fb, { 22, 22, 15}}, + {m68k_op_move_16_tos_i , 0xffff, 0x46fc, { 16, 16, 10}}, + {m68k_op_link_32_a7 , 0xffff, 0x480f, { 0, 0, 6}}, + {m68k_op_nbcd_8_pi7 , 0xffff, 0x481f, { 12, 12, 10}}, + {m68k_op_nbcd_8_pd7 , 0xffff, 0x4827, { 14, 14, 11}}, + {m68k_op_nbcd_8_aw , 0xffff, 0x4838, { 16, 16, 10}}, + {m68k_op_nbcd_8_al , 0xffff, 0x4839, { 20, 20, 10}}, + {m68k_op_pea_32_aw , 0xffff, 0x4878, { 16, 16, 9}}, + {m68k_op_pea_32_al , 0xffff, 0x4879, { 20, 20, 9}}, + {m68k_op_pea_32_pcdi , 0xffff, 0x487a, { 16, 16, 10}}, + {m68k_op_pea_32_pcix , 0xffff, 0x487b, { 20, 20, 12}}, + {m68k_op_movem_16_re_aw , 0xffff, 0x48b8, { 16, 16, 8}}, + {m68k_op_movem_16_re_al , 0xffff, 0x48b9, { 20, 20, 8}}, + {m68k_op_movem_32_re_aw , 0xffff, 0x48f8, { 20, 20, 8}}, + {m68k_op_movem_32_re_al , 0xffff, 0x48f9, { 24, 24, 8}}, + {m68k_op_tst_8_pi7 , 0xffff, 0x4a1f, { 8, 8, 6}}, + {m68k_op_tst_8_pd7 , 0xffff, 0x4a27, { 10, 10, 7}}, + {m68k_op_tst_8_aw , 0xffff, 0x4a38, { 12, 12, 6}}, + {m68k_op_tst_8_al , 0xffff, 0x4a39, { 16, 16, 6}}, + {m68k_op_tst_8_pcdi , 0xffff, 0x4a3a, { 0, 0, 7}}, + {m68k_op_tst_8_pcix , 0xffff, 0x4a3b, { 0, 0, 9}}, + {m68k_op_tst_8_i , 0xffff, 0x4a3c, { 0, 0, 6}}, + {m68k_op_tst_16_aw , 0xffff, 0x4a78, { 12, 12, 6}}, + {m68k_op_tst_16_al , 0xffff, 0x4a79, { 16, 16, 6}}, + {m68k_op_tst_16_pcdi , 0xffff, 0x4a7a, { 0, 0, 7}}, + {m68k_op_tst_16_pcix , 0xffff, 0x4a7b, { 0, 0, 9}}, + {m68k_op_tst_16_i , 0xffff, 0x4a7c, { 0, 0, 6}}, + {m68k_op_tst_32_aw , 0xffff, 0x4ab8, { 16, 16, 6}}, + {m68k_op_tst_32_al , 0xffff, 0x4ab9, { 20, 20, 6}}, + {m68k_op_tst_32_pcdi , 0xffff, 0x4aba, { 0, 0, 7}}, + {m68k_op_tst_32_pcix , 0xffff, 0x4abb, { 0, 0, 9}}, + {m68k_op_tst_32_i , 0xffff, 0x4abc, { 0, 0, 6}}, + {m68k_op_tas_8_pi7 , 0xffff, 0x4adf, { 18, 18, 16}}, + {m68k_op_tas_8_pd7 , 0xffff, 0x4ae7, { 20, 20, 17}}, + {m68k_op_tas_8_aw , 0xffff, 0x4af8, { 22, 22, 16}}, + {m68k_op_tas_8_al , 0xffff, 0x4af9, { 26, 26, 16}}, + {m68k_op_illegal , 0xffff, 0x4afc, { 4, 4, 4}}, + {m68k_op_mull_32_aw , 0xffff, 0x4c38, { 0, 0, 47}}, + {m68k_op_mull_32_al , 0xffff, 0x4c39, { 0, 0, 47}}, + {m68k_op_mull_32_pcdi , 0xffff, 0x4c3a, { 0, 0, 48}}, + {m68k_op_mull_32_pcix , 0xffff, 0x4c3b, { 0, 0, 50}}, + {m68k_op_mull_32_i , 0xffff, 0x4c3c, { 0, 0, 47}}, + {m68k_op_divl_32_aw , 0xffff, 0x4c78, { 0, 0, 88}}, + {m68k_op_divl_32_al , 0xffff, 0x4c79, { 0, 0, 88}}, + {m68k_op_divl_32_pcdi , 0xffff, 0x4c7a, { 0, 0, 89}}, + {m68k_op_divl_32_pcix , 0xffff, 0x4c7b, { 0, 0, 91}}, + {m68k_op_divl_32_i , 0xffff, 0x4c7c, { 0, 0, 88}}, + {m68k_op_movem_16_er_aw , 0xffff, 0x4cb8, { 20, 20, 12}}, + {m68k_op_movem_16_er_al , 0xffff, 0x4cb9, { 24, 24, 12}}, + {m68k_op_movem_16_er_pcdi , 0xffff, 0x4cba, { 20, 20, 13}}, + {m68k_op_movem_16_er_pcix , 0xffff, 0x4cbb, { 22, 22, 15}}, + {m68k_op_movem_32_er_aw , 0xffff, 0x4cf8, { 24, 24, 12}}, + {m68k_op_movem_32_er_al , 0xffff, 0x4cf9, { 28, 28, 12}}, + {m68k_op_movem_32_er_pcdi , 0xffff, 0x4cfa, { 24, 24, 13}}, + {m68k_op_movem_32_er_pcix , 0xffff, 0x4cfb, { 26, 26, 15}}, + {m68k_op_link_16_a7 , 0xffff, 0x4e57, { 16, 16, 5}}, + {m68k_op_unlk_32_a7 , 0xffff, 0x4e5f, { 12, 12, 6}}, + {m68k_op_reset , 0xffff, 0x4e70, { 0, 0, 0}}, + {m68k_op_nop , 0xffff, 0x4e71, { 4, 4, 2}}, + {m68k_op_stop , 0xffff, 0x4e72, { 4, 4, 8}}, + {m68k_op_rte_32 , 0xffff, 0x4e73, { 20, 24, 20}}, + {m68k_op_rtd_32 , 0xffff, 0x4e74, { 0, 16, 10}}, + {m68k_op_rts_32 , 0xffff, 0x4e75, { 16, 16, 10}}, + {m68k_op_trapv , 0xffff, 0x4e76, { 4, 4, 4}}, + {m68k_op_rtr_32 , 0xffff, 0x4e77, { 20, 20, 14}}, + {m68k_op_movec_32_cr , 0xffff, 0x4e7a, { 0, 12, 6}}, + {m68k_op_movec_32_rc , 0xffff, 0x4e7b, { 0, 10, 12}}, + {m68k_op_jsr_32_aw , 0xffff, 0x4eb8, { 18, 18, 4}}, + {m68k_op_jsr_32_al , 0xffff, 0x4eb9, { 20, 20, 4}}, + {m68k_op_jsr_32_pcdi , 0xffff, 0x4eba, { 18, 18, 5}}, + {m68k_op_jsr_32_pcix , 0xffff, 0x4ebb, { 22, 22, 7}}, + {m68k_op_jmp_32_aw , 0xffff, 0x4ef8, { 10, 10, 4}}, + {m68k_op_jmp_32_al , 0xffff, 0x4ef9, { 12, 12, 4}}, + {m68k_op_jmp_32_pcdi , 0xffff, 0x4efa, { 10, 10, 5}}, + {m68k_op_jmp_32_pcix , 0xffff, 0x4efb, { 14, 14, 7}}, + {m68k_op_st_8_pi7 , 0xffff, 0x50df, { 12, 12, 10}}, + {m68k_op_st_8_pd7 , 0xffff, 0x50e7, { 14, 14, 11}}, + {m68k_op_st_8_aw , 0xffff, 0x50f8, { 16, 16, 10}}, + {m68k_op_st_8_al , 0xffff, 0x50f9, { 20, 20, 10}}, + {m68k_op_trapt_16 , 0xffff, 0x50fa, { 0, 0, 6}}, + {m68k_op_trapt_32 , 0xffff, 0x50fb, { 0, 0, 8}}, + {m68k_op_trapt , 0xffff, 0x50fc, { 0, 0, 4}}, + {m68k_op_sf_8_pi7 , 0xffff, 0x51df, { 12, 12, 10}}, + {m68k_op_sf_8_pd7 , 0xffff, 0x51e7, { 14, 14, 11}}, + {m68k_op_sf_8_aw , 0xffff, 0x51f8, { 16, 16, 10}}, + {m68k_op_sf_8_al , 0xffff, 0x51f9, { 20, 20, 10}}, + {m68k_op_trapf_16 , 0xffff, 0x51fa, { 0, 0, 6}}, + {m68k_op_trapf_32 , 0xffff, 0x51fb, { 0, 0, 8}}, + {m68k_op_trapf , 0xffff, 0x51fc, { 0, 0, 4}}, + {m68k_op_shi_8_pi7 , 0xffff, 0x52df, { 12, 12, 10}}, + {m68k_op_shi_8_pd7 , 0xffff, 0x52e7, { 14, 14, 11}}, + {m68k_op_shi_8_aw , 0xffff, 0x52f8, { 16, 16, 10}}, + {m68k_op_shi_8_al , 0xffff, 0x52f9, { 20, 20, 10}}, + {m68k_op_traphi_16 , 0xffff, 0x52fa, { 0, 0, 6}}, + {m68k_op_traphi_32 , 0xffff, 0x52fb, { 0, 0, 8}}, + {m68k_op_traphi , 0xffff, 0x52fc, { 0, 0, 4}}, + {m68k_op_sls_8_pi7 , 0xffff, 0x53df, { 12, 12, 10}}, + {m68k_op_sls_8_pd7 , 0xffff, 0x53e7, { 14, 14, 11}}, + {m68k_op_sls_8_aw , 0xffff, 0x53f8, { 16, 16, 10}}, + {m68k_op_sls_8_al , 0xffff, 0x53f9, { 20, 20, 10}}, + {m68k_op_trapls_16 , 0xffff, 0x53fa, { 0, 0, 6}}, + {m68k_op_trapls_32 , 0xffff, 0x53fb, { 0, 0, 8}}, + {m68k_op_trapls , 0xffff, 0x53fc, { 0, 0, 4}}, + {m68k_op_scc_8_pi7 , 0xffff, 0x54df, { 12, 12, 10}}, + {m68k_op_scc_8_pd7 , 0xffff, 0x54e7, { 14, 14, 11}}, + {m68k_op_scc_8_aw , 0xffff, 0x54f8, { 16, 16, 10}}, + {m68k_op_scc_8_al , 0xffff, 0x54f9, { 20, 20, 10}}, + {m68k_op_trapcc_16 , 0xffff, 0x54fa, { 0, 0, 6}}, + {m68k_op_trapcc_32 , 0xffff, 0x54fb, { 0, 0, 8}}, + {m68k_op_trapcc , 0xffff, 0x54fc, { 0, 0, 4}}, + {m68k_op_scs_8_pi7 , 0xffff, 0x55df, { 12, 12, 10}}, + {m68k_op_scs_8_pd7 , 0xffff, 0x55e7, { 14, 14, 11}}, + {m68k_op_scs_8_aw , 0xffff, 0x55f8, { 16, 16, 10}}, + {m68k_op_scs_8_al , 0xffff, 0x55f9, { 20, 20, 10}}, + {m68k_op_trapcs_16 , 0xffff, 0x55fa, { 0, 0, 6}}, + {m68k_op_trapcs_32 , 0xffff, 0x55fb, { 0, 0, 8}}, + {m68k_op_trapcs , 0xffff, 0x55fc, { 0, 0, 4}}, + {m68k_op_sne_8_pi7 , 0xffff, 0x56df, { 12, 12, 10}}, + {m68k_op_sne_8_pd7 , 0xffff, 0x56e7, { 14, 14, 11}}, + {m68k_op_sne_8_aw , 0xffff, 0x56f8, { 16, 16, 10}}, + {m68k_op_sne_8_al , 0xffff, 0x56f9, { 20, 20, 10}}, + {m68k_op_trapne_16 , 0xffff, 0x56fa, { 0, 0, 6}}, + {m68k_op_trapne_32 , 0xffff, 0x56fb, { 0, 0, 8}}, + {m68k_op_trapne , 0xffff, 0x56fc, { 0, 0, 4}}, + {m68k_op_seq_8_pi7 , 0xffff, 0x57df, { 12, 12, 10}}, + {m68k_op_seq_8_pd7 , 0xffff, 0x57e7, { 14, 14, 11}}, + {m68k_op_seq_8_aw , 0xffff, 0x57f8, { 16, 16, 10}}, + {m68k_op_seq_8_al , 0xffff, 0x57f9, { 20, 20, 10}}, + {m68k_op_trapeq_16 , 0xffff, 0x57fa, { 0, 0, 6}}, + {m68k_op_trapeq_32 , 0xffff, 0x57fb, { 0, 0, 8}}, + {m68k_op_trapeq , 0xffff, 0x57fc, { 0, 0, 4}}, + {m68k_op_svc_8_pi7 , 0xffff, 0x58df, { 12, 12, 10}}, + {m68k_op_svc_8_pd7 , 0xffff, 0x58e7, { 14, 14, 11}}, + {m68k_op_svc_8_aw , 0xffff, 0x58f8, { 16, 16, 10}}, + {m68k_op_svc_8_al , 0xffff, 0x58f9, { 20, 20, 10}}, + {m68k_op_trapvc_16 , 0xffff, 0x58fa, { 0, 0, 6}}, + {m68k_op_trapvc_32 , 0xffff, 0x58fb, { 0, 0, 8}}, + {m68k_op_trapvc , 0xffff, 0x58fc, { 0, 0, 4}}, + {m68k_op_svs_8_pi7 , 0xffff, 0x59df, { 12, 12, 10}}, + {m68k_op_svs_8_pd7 , 0xffff, 0x59e7, { 14, 14, 11}}, + {m68k_op_svs_8_aw , 0xffff, 0x59f8, { 16, 16, 10}}, + {m68k_op_svs_8_al , 0xffff, 0x59f9, { 20, 20, 10}}, + {m68k_op_trapvs_16 , 0xffff, 0x59fa, { 0, 0, 6}}, + {m68k_op_trapvs_32 , 0xffff, 0x59fb, { 0, 0, 8}}, + {m68k_op_trapvs , 0xffff, 0x59fc, { 0, 0, 4}}, + {m68k_op_spl_8_pi7 , 0xffff, 0x5adf, { 12, 12, 10}}, + {m68k_op_spl_8_pd7 , 0xffff, 0x5ae7, { 14, 14, 11}}, + {m68k_op_spl_8_aw , 0xffff, 0x5af8, { 16, 16, 10}}, + {m68k_op_spl_8_al , 0xffff, 0x5af9, { 20, 20, 10}}, + {m68k_op_trappl_16 , 0xffff, 0x5afa, { 0, 0, 6}}, + {m68k_op_trappl_32 , 0xffff, 0x5afb, { 0, 0, 8}}, + {m68k_op_trappl , 0xffff, 0x5afc, { 0, 0, 4}}, + {m68k_op_smi_8_pi7 , 0xffff, 0x5bdf, { 12, 12, 10}}, + {m68k_op_smi_8_pd7 , 0xffff, 0x5be7, { 14, 14, 11}}, + {m68k_op_smi_8_aw , 0xffff, 0x5bf8, { 16, 16, 10}}, + {m68k_op_smi_8_al , 0xffff, 0x5bf9, { 20, 20, 10}}, + {m68k_op_trapmi_16 , 0xffff, 0x5bfa, { 0, 0, 6}}, + {m68k_op_trapmi_32 , 0xffff, 0x5bfb, { 0, 0, 8}}, + {m68k_op_trapmi , 0xffff, 0x5bfc, { 0, 0, 4}}, + {m68k_op_sge_8_pi7 , 0xffff, 0x5cdf, { 12, 12, 10}}, + {m68k_op_sge_8_pd7 , 0xffff, 0x5ce7, { 14, 14, 11}}, + {m68k_op_sge_8_aw , 0xffff, 0x5cf8, { 16, 16, 10}}, + {m68k_op_sge_8_al , 0xffff, 0x5cf9, { 20, 20, 10}}, + {m68k_op_trapge_16 , 0xffff, 0x5cfa, { 0, 0, 6}}, + {m68k_op_trapge_32 , 0xffff, 0x5cfb, { 0, 0, 8}}, + {m68k_op_trapge , 0xffff, 0x5cfc, { 0, 0, 4}}, + {m68k_op_slt_8_pi7 , 0xffff, 0x5ddf, { 12, 12, 10}}, + {m68k_op_slt_8_pd7 , 0xffff, 0x5de7, { 14, 14, 11}}, + {m68k_op_slt_8_aw , 0xffff, 0x5df8, { 16, 16, 10}}, + {m68k_op_slt_8_al , 0xffff, 0x5df9, { 20, 20, 10}}, + {m68k_op_traplt_16 , 0xffff, 0x5dfa, { 0, 0, 6}}, + {m68k_op_traplt_32 , 0xffff, 0x5dfb, { 0, 0, 8}}, + {m68k_op_traplt , 0xffff, 0x5dfc, { 0, 0, 4}}, + {m68k_op_sgt_8_pi7 , 0xffff, 0x5edf, { 12, 12, 10}}, + {m68k_op_sgt_8_pd7 , 0xffff, 0x5ee7, { 14, 14, 11}}, + {m68k_op_sgt_8_aw , 0xffff, 0x5ef8, { 16, 16, 10}}, + {m68k_op_sgt_8_al , 0xffff, 0x5ef9, { 20, 20, 10}}, + {m68k_op_trapgt_16 , 0xffff, 0x5efa, { 0, 0, 6}}, + {m68k_op_trapgt_32 , 0xffff, 0x5efb, { 0, 0, 8}}, + {m68k_op_trapgt , 0xffff, 0x5efc, { 0, 0, 4}}, + {m68k_op_sle_8_pi7 , 0xffff, 0x5fdf, { 12, 12, 10}}, + {m68k_op_sle_8_pd7 , 0xffff, 0x5fe7, { 14, 14, 11}}, + {m68k_op_sle_8_aw , 0xffff, 0x5ff8, { 16, 16, 10}}, + {m68k_op_sle_8_al , 0xffff, 0x5ff9, { 20, 20, 10}}, + {m68k_op_traple_16 , 0xffff, 0x5ffa, { 0, 0, 6}}, + {m68k_op_traple_32 , 0xffff, 0x5ffb, { 0, 0, 8}}, + {m68k_op_traple , 0xffff, 0x5ffc, { 0, 0, 4}}, + {m68k_op_bra_16 , 0xffff, 0x6000, { 10, 10, 10}}, + {m68k_op_bra_32 , 0xffff, 0x60ff, { 0, 0, 10}}, + {m68k_op_bsr_16 , 0xffff, 0x6100, { 18, 18, 7}}, + {m68k_op_bsr_32 , 0xffff, 0x61ff, { 0, 0, 7}}, + {m68k_op_bhi_16 , 0xffff, 0x6200, { 10, 10, 6}}, + {m68k_op_bhi_32 , 0xffff, 0x62ff, { 0, 0, 6}}, + {m68k_op_bls_16 , 0xffff, 0x6300, { 10, 10, 6}}, + {m68k_op_bls_32 , 0xffff, 0x63ff, { 0, 0, 6}}, + {m68k_op_bcc_16 , 0xffff, 0x6400, { 10, 10, 6}}, + {m68k_op_bcc_32 , 0xffff, 0x64ff, { 0, 0, 6}}, + {m68k_op_bcs_16 , 0xffff, 0x6500, { 10, 10, 6}}, + {m68k_op_bcs_32 , 0xffff, 0x65ff, { 0, 0, 6}}, + {m68k_op_bne_16 , 0xffff, 0x6600, { 10, 10, 6}}, + {m68k_op_bne_32 , 0xffff, 0x66ff, { 0, 0, 6}}, + {m68k_op_beq_16 , 0xffff, 0x6700, { 10, 10, 6}}, + {m68k_op_beq_32 , 0xffff, 0x67ff, { 0, 0, 6}}, + {m68k_op_bvc_16 , 0xffff, 0x6800, { 10, 10, 6}}, + {m68k_op_bvc_32 , 0xffff, 0x68ff, { 0, 0, 6}}, + {m68k_op_bvs_16 , 0xffff, 0x6900, { 10, 10, 6}}, + {m68k_op_bvs_32 , 0xffff, 0x69ff, { 0, 0, 6}}, + {m68k_op_bpl_16 , 0xffff, 0x6a00, { 10, 10, 6}}, + {m68k_op_bpl_32 , 0xffff, 0x6aff, { 0, 0, 6}}, + {m68k_op_bmi_16 , 0xffff, 0x6b00, { 10, 10, 6}}, + {m68k_op_bmi_32 , 0xffff, 0x6bff, { 0, 0, 6}}, + {m68k_op_bge_16 , 0xffff, 0x6c00, { 10, 10, 6}}, + {m68k_op_bge_32 , 0xffff, 0x6cff, { 0, 0, 6}}, + {m68k_op_blt_16 , 0xffff, 0x6d00, { 10, 10, 6}}, + {m68k_op_blt_32 , 0xffff, 0x6dff, { 0, 0, 6}}, + {m68k_op_bgt_16 , 0xffff, 0x6e00, { 10, 10, 6}}, + {m68k_op_bgt_32 , 0xffff, 0x6eff, { 0, 0, 6}}, + {m68k_op_ble_16 , 0xffff, 0x6f00, { 10, 10, 6}}, + {m68k_op_ble_32 , 0xffff, 0x6fff, { 0, 0, 6}}, + {m68k_op_sbcd_8_mm_axy7 , 0xffff, 0x8f0f, { 18, 18, 16}}, + {m68k_op_pack_16_mm_axy7 , 0xffff, 0x8f4f, { 0, 0, 13}}, + {m68k_op_unpk_16_mm_axy7 , 0xffff, 0x8f8f, { 0, 0, 13}}, + {m68k_op_subx_8_mm_axy7 , 0xffff, 0x9f0f, { 18, 18, 12}}, + {m68k_op_cmpm_8_axy7 , 0xffff, 0xbf0f, { 12, 12, 9}}, + {m68k_op_abcd_8_mm_axy7 , 0xffff, 0xcf0f, { 18, 18, 16}}, + {m68k_op_addx_8_mm_axy7 , 0xffff, 0xdf0f, { 18, 18, 12}}, + {m68k_op_asr_16_aw , 0xffff, 0xe0f8, { 16, 16, 9}}, + {m68k_op_asr_16_al , 0xffff, 0xe0f9, { 20, 20, 9}}, + {m68k_op_asl_16_aw , 0xffff, 0xe1f8, { 16, 16, 10}}, + {m68k_op_asl_16_al , 0xffff, 0xe1f9, { 20, 20, 10}}, + {m68k_op_lsr_16_aw , 0xffff, 0xe2f8, { 16, 16, 9}}, + {m68k_op_lsr_16_al , 0xffff, 0xe2f9, { 20, 20, 9}}, + {m68k_op_lsl_16_aw , 0xffff, 0xe3f8, { 16, 16, 9}}, + {m68k_op_lsl_16_al , 0xffff, 0xe3f9, { 20, 20, 9}}, + {m68k_op_roxr_16_aw , 0xffff, 0xe4f8, { 16, 16, 9}}, + {m68k_op_roxr_16_al , 0xffff, 0xe4f9, { 20, 20, 9}}, + {m68k_op_roxl_16_aw , 0xffff, 0xe5f8, { 16, 16, 9}}, + {m68k_op_roxl_16_al , 0xffff, 0xe5f9, { 20, 20, 9}}, + {m68k_op_ror_16_aw , 0xffff, 0xe6f8, { 16, 16, 11}}, + {m68k_op_ror_16_al , 0xffff, 0xe6f9, { 20, 20, 11}}, + {m68k_op_rol_16_aw , 0xffff, 0xe7f8, { 16, 16, 11}}, + {m68k_op_rol_16_al , 0xffff, 0xe7f9, { 20, 20, 11}}, + {m68k_op_bftst_32_aw , 0xffff, 0xe8f8, { 0, 0, 17}}, + {m68k_op_bftst_32_al , 0xffff, 0xe8f9, { 0, 0, 17}}, + {m68k_op_bftst_32_pcdi , 0xffff, 0xe8fa, { 0, 0, 18}}, + {m68k_op_bftst_32_pcix , 0xffff, 0xe8fb, { 0, 0, 20}}, + {m68k_op_bfextu_32_aw , 0xffff, 0xe9f8, { 0, 0, 19}}, + {m68k_op_bfextu_32_al , 0xffff, 0xe9f9, { 0, 0, 19}}, + {m68k_op_bfextu_32_pcdi , 0xffff, 0xe9fa, { 0, 0, 20}}, + {m68k_op_bfextu_32_pcix , 0xffff, 0xe9fb, { 0, 0, 22}}, + {m68k_op_bfchg_32_aw , 0xffff, 0xeaf8, { 0, 0, 24}}, + {m68k_op_bfchg_32_al , 0xffff, 0xeaf9, { 0, 0, 24}}, + {m68k_op_bfexts_32_aw , 0xffff, 0xebf8, { 0, 0, 19}}, + {m68k_op_bfexts_32_al , 0xffff, 0xebf9, { 0, 0, 19}}, + {m68k_op_bfexts_32_pcdi , 0xffff, 0xebfa, { 0, 0, 20}}, + {m68k_op_bfexts_32_pcix , 0xffff, 0xebfb, { 0, 0, 22}}, + {m68k_op_bfclr_32_aw , 0xffff, 0xecf8, { 0, 0, 24}}, + {m68k_op_bfclr_32_al , 0xffff, 0xecf9, { 0, 0, 24}}, + {m68k_op_bfffo_32_aw , 0xffff, 0xedf8, { 0, 0, 32}}, + {m68k_op_bfffo_32_al , 0xffff, 0xedf9, { 0, 0, 32}}, + {m68k_op_bfffo_32_pcdi , 0xffff, 0xedfa, { 0, 0, 33}}, + {m68k_op_bfffo_32_pcix , 0xffff, 0xedfb, { 0, 0, 35}}, + {m68k_op_bfset_32_aw , 0xffff, 0xeef8, { 0, 0, 24}}, + {m68k_op_bfset_32_al , 0xffff, 0xeef9, { 0, 0, 24}}, + {m68k_op_bfins_32_aw , 0xffff, 0xeff8, { 0, 0, 21}}, + {m68k_op_bfins_32_al , 0xffff, 0xeff9, { 0, 0, 21}}, + {0, 0, 0, {0, 0, 0}} +}; + + +/* Build the opcode handler jump table */ +void m68ki_build_opcode_table(void) +{ + opcode_handler_struct *ostruct; + int instr; + int i; + int j; + int k; + + for(i = 0; i < 0x10000; i++) + { + /* default to illegal */ + m68ki_instruction_jump_table[i] = m68k_op_illegal; + for(k=0;kmask != 0xff00) + { + for(i = 0;i < 0x10000;i++) + { + if((i & ostruct->mask) == ostruct->match) + { + m68ki_instruction_jump_table[i] = ostruct->opcode_handler; + for(k=0;kcycles[k]; + } + } + ostruct++; + } + while(ostruct->mask == 0xff00) + { + for(i = 0;i <= 0xff;i++) + { + m68ki_instruction_jump_table[ostruct->match | i] = ostruct->opcode_handler; + for(k=0;kmatch | i] = ostruct->cycles[k]; + } + ostruct++; + } + while(ostruct->mask == 0xf1f8) + { + for(i = 0;i < 8;i++) + { + for(j = 0;j < 8;j++) + { + instr = ostruct->match | (i << 9) | j; + m68ki_instruction_jump_table[instr] = ostruct->opcode_handler; + for(k=0;kcycles[k]; + if((instr & 0xf000) == 0xe000 && (!(instr & 0x20))) + m68ki_cycles[0][instr] = m68ki_cycles[1][instr] = ostruct->cycles[k] + ((((j-1)&7)+1)<<1); + } + } + ostruct++; + } + while(ostruct->mask == 0xfff0) + { + for(i = 0;i <= 0x0f;i++) + { + m68ki_instruction_jump_table[ostruct->match | i] = ostruct->opcode_handler; + for(k=0;kmatch | i] = ostruct->cycles[k]; + } + ostruct++; + } + while(ostruct->mask == 0xf1ff) + { + for(i = 0;i <= 0x07;i++) + { + m68ki_instruction_jump_table[ostruct->match | (i << 9)] = ostruct->opcode_handler; + for(k=0;kmatch | (i << 9)] = ostruct->cycles[k]; + } + ostruct++; + } + while(ostruct->mask == 0xfff8) + { + for(i = 0;i <= 0x07;i++) + { + m68ki_instruction_jump_table[ostruct->match | i] = ostruct->opcode_handler; + for(k=0;kmatch | i] = ostruct->cycles[k]; + } + ostruct++; + } + while(ostruct->mask == 0xffff) + { + m68ki_instruction_jump_table[ostruct->match] = ostruct->opcode_handler; + for(k=0;kmatch] = ostruct->cycles[k]; + ostruct++; + } +} + + +/* ======================================================================== */ +/* ============================== END OF FILE ============================= */ +/* ======================================================================== */ + + diff --git a/source/m68k/m68kops.h b/source/m68k/m68kops.h new file mode 100644 index 0000000..d3c4e07 --- /dev/null +++ b/source/m68k/m68kops.h @@ -0,0 +1,1984 @@ +#ifndef M68KOPS__HEADER +#define M68KOPS__HEADER + +/* ======================================================================== */ +/* ============================ OPCODE HANDLERS =========================== */ +/* ======================================================================== */ + + +void m68k_op_1010(void); +void m68k_op_1111(void); +void m68k_op_abcd_8_rr(void); +void m68k_op_abcd_8_mm_ax7(void); +void m68k_op_abcd_8_mm_ay7(void); +void m68k_op_abcd_8_mm_axy7(void); +void m68k_op_abcd_8_mm(void); +void m68k_op_add_8_er_d(void); +void m68k_op_add_8_er_ai(void); +void m68k_op_add_8_er_pi(void); +void m68k_op_add_8_er_pi7(void); +void m68k_op_add_8_er_pd(void); +void m68k_op_add_8_er_pd7(void); +void m68k_op_add_8_er_di(void); +void m68k_op_add_8_er_ix(void); +void m68k_op_add_8_er_aw(void); +void m68k_op_add_8_er_al(void); +void m68k_op_add_8_er_pcdi(void); +void m68k_op_add_8_er_pcix(void); +void m68k_op_add_8_er_i(void); +void m68k_op_add_16_er_d(void); +void m68k_op_add_16_er_a(void); +void m68k_op_add_16_er_ai(void); +void m68k_op_add_16_er_pi(void); +void m68k_op_add_16_er_pd(void); +void m68k_op_add_16_er_di(void); +void m68k_op_add_16_er_ix(void); +void m68k_op_add_16_er_aw(void); +void m68k_op_add_16_er_al(void); +void m68k_op_add_16_er_pcdi(void); +void m68k_op_add_16_er_pcix(void); +void m68k_op_add_16_er_i(void); +void m68k_op_add_32_er_d(void); +void m68k_op_add_32_er_a(void); +void m68k_op_add_32_er_ai(void); +void m68k_op_add_32_er_pi(void); +void m68k_op_add_32_er_pd(void); +void m68k_op_add_32_er_di(void); +void m68k_op_add_32_er_ix(void); +void m68k_op_add_32_er_aw(void); +void m68k_op_add_32_er_al(void); +void m68k_op_add_32_er_pcdi(void); +void m68k_op_add_32_er_pcix(void); +void m68k_op_add_32_er_i(void); +void m68k_op_add_8_re_ai(void); +void m68k_op_add_8_re_pi(void); +void m68k_op_add_8_re_pi7(void); +void m68k_op_add_8_re_pd(void); +void m68k_op_add_8_re_pd7(void); +void m68k_op_add_8_re_di(void); +void m68k_op_add_8_re_ix(void); +void m68k_op_add_8_re_aw(void); +void m68k_op_add_8_re_al(void); +void m68k_op_add_16_re_ai(void); +void m68k_op_add_16_re_pi(void); +void m68k_op_add_16_re_pd(void); +void m68k_op_add_16_re_di(void); +void m68k_op_add_16_re_ix(void); +void m68k_op_add_16_re_aw(void); +void m68k_op_add_16_re_al(void); +void m68k_op_add_32_re_ai(void); +void m68k_op_add_32_re_pi(void); +void m68k_op_add_32_re_pd(void); +void m68k_op_add_32_re_di(void); +void m68k_op_add_32_re_ix(void); +void m68k_op_add_32_re_aw(void); +void m68k_op_add_32_re_al(void); +void m68k_op_adda_16_d(void); +void m68k_op_adda_16_a(void); +void m68k_op_adda_16_ai(void); +void m68k_op_adda_16_pi(void); +void m68k_op_adda_16_pd(void); +void m68k_op_adda_16_di(void); +void m68k_op_adda_16_ix(void); +void m68k_op_adda_16_aw(void); +void m68k_op_adda_16_al(void); +void m68k_op_adda_16_pcdi(void); +void m68k_op_adda_16_pcix(void); +void m68k_op_adda_16_i(void); +void m68k_op_adda_32_d(void); +void m68k_op_adda_32_a(void); +void m68k_op_adda_32_ai(void); +void m68k_op_adda_32_pi(void); +void m68k_op_adda_32_pd(void); +void m68k_op_adda_32_di(void); +void m68k_op_adda_32_ix(void); +void m68k_op_adda_32_aw(void); +void m68k_op_adda_32_al(void); +void m68k_op_adda_32_pcdi(void); +void m68k_op_adda_32_pcix(void); +void m68k_op_adda_32_i(void); +void m68k_op_addi_8_d(void); +void m68k_op_addi_8_ai(void); +void m68k_op_addi_8_pi(void); +void m68k_op_addi_8_pi7(void); +void m68k_op_addi_8_pd(void); +void m68k_op_addi_8_pd7(void); +void m68k_op_addi_8_di(void); +void m68k_op_addi_8_ix(void); +void m68k_op_addi_8_aw(void); +void m68k_op_addi_8_al(void); +void m68k_op_addi_16_d(void); +void m68k_op_addi_16_ai(void); +void m68k_op_addi_16_pi(void); +void m68k_op_addi_16_pd(void); +void m68k_op_addi_16_di(void); +void m68k_op_addi_16_ix(void); +void m68k_op_addi_16_aw(void); +void m68k_op_addi_16_al(void); +void m68k_op_addi_32_d(void); +void m68k_op_addi_32_ai(void); +void m68k_op_addi_32_pi(void); +void m68k_op_addi_32_pd(void); +void m68k_op_addi_32_di(void); +void m68k_op_addi_32_ix(void); +void m68k_op_addi_32_aw(void); +void m68k_op_addi_32_al(void); +void m68k_op_addq_8_d(void); +void m68k_op_addq_8_ai(void); +void m68k_op_addq_8_pi(void); +void m68k_op_addq_8_pi7(void); +void m68k_op_addq_8_pd(void); +void m68k_op_addq_8_pd7(void); +void m68k_op_addq_8_di(void); +void m68k_op_addq_8_ix(void); +void m68k_op_addq_8_aw(void); +void m68k_op_addq_8_al(void); +void m68k_op_addq_16_d(void); +void m68k_op_addq_16_a(void); +void m68k_op_addq_16_ai(void); +void m68k_op_addq_16_pi(void); +void m68k_op_addq_16_pd(void); +void m68k_op_addq_16_di(void); +void m68k_op_addq_16_ix(void); +void m68k_op_addq_16_aw(void); +void m68k_op_addq_16_al(void); +void m68k_op_addq_32_d(void); +void m68k_op_addq_32_a(void); +void m68k_op_addq_32_ai(void); +void m68k_op_addq_32_pi(void); +void m68k_op_addq_32_pd(void); +void m68k_op_addq_32_di(void); +void m68k_op_addq_32_ix(void); +void m68k_op_addq_32_aw(void); +void m68k_op_addq_32_al(void); +void m68k_op_addx_8_rr(void); +void m68k_op_addx_16_rr(void); +void m68k_op_addx_32_rr(void); +void m68k_op_addx_8_mm_ax7(void); +void m68k_op_addx_8_mm_ay7(void); +void m68k_op_addx_8_mm_axy7(void); +void m68k_op_addx_8_mm(void); +void m68k_op_addx_16_mm(void); +void m68k_op_addx_32_mm(void); +void m68k_op_and_8_er_d(void); +void m68k_op_and_8_er_ai(void); +void m68k_op_and_8_er_pi(void); +void m68k_op_and_8_er_pi7(void); +void m68k_op_and_8_er_pd(void); +void m68k_op_and_8_er_pd7(void); +void m68k_op_and_8_er_di(void); +void m68k_op_and_8_er_ix(void); +void m68k_op_and_8_er_aw(void); +void m68k_op_and_8_er_al(void); +void m68k_op_and_8_er_pcdi(void); +void m68k_op_and_8_er_pcix(void); +void m68k_op_and_8_er_i(void); +void m68k_op_and_16_er_d(void); +void m68k_op_and_16_er_ai(void); +void m68k_op_and_16_er_pi(void); +void m68k_op_and_16_er_pd(void); +void m68k_op_and_16_er_di(void); +void m68k_op_and_16_er_ix(void); +void m68k_op_and_16_er_aw(void); +void m68k_op_and_16_er_al(void); +void m68k_op_and_16_er_pcdi(void); +void m68k_op_and_16_er_pcix(void); +void m68k_op_and_16_er_i(void); +void m68k_op_and_32_er_d(void); +void m68k_op_and_32_er_ai(void); +void m68k_op_and_32_er_pi(void); +void m68k_op_and_32_er_pd(void); +void m68k_op_and_32_er_di(void); +void m68k_op_and_32_er_ix(void); +void m68k_op_and_32_er_aw(void); +void m68k_op_and_32_er_al(void); +void m68k_op_and_32_er_pcdi(void); +void m68k_op_and_32_er_pcix(void); +void m68k_op_and_32_er_i(void); +void m68k_op_and_8_re_ai(void); +void m68k_op_and_8_re_pi(void); +void m68k_op_and_8_re_pi7(void); +void m68k_op_and_8_re_pd(void); +void m68k_op_and_8_re_pd7(void); +void m68k_op_and_8_re_di(void); +void m68k_op_and_8_re_ix(void); +void m68k_op_and_8_re_aw(void); +void m68k_op_and_8_re_al(void); +void m68k_op_and_16_re_ai(void); +void m68k_op_and_16_re_pi(void); +void m68k_op_and_16_re_pd(void); +void m68k_op_and_16_re_di(void); +void m68k_op_and_16_re_ix(void); +void m68k_op_and_16_re_aw(void); +void m68k_op_and_16_re_al(void); +void m68k_op_and_32_re_ai(void); +void m68k_op_and_32_re_pi(void); +void m68k_op_and_32_re_pd(void); +void m68k_op_and_32_re_di(void); +void m68k_op_and_32_re_ix(void); +void m68k_op_and_32_re_aw(void); +void m68k_op_and_32_re_al(void); +void m68k_op_andi_8_d(void); +void m68k_op_andi_8_ai(void); +void m68k_op_andi_8_pi(void); +void m68k_op_andi_8_pi7(void); +void m68k_op_andi_8_pd(void); +void m68k_op_andi_8_pd7(void); +void m68k_op_andi_8_di(void); +void m68k_op_andi_8_ix(void); +void m68k_op_andi_8_aw(void); +void m68k_op_andi_8_al(void); +void m68k_op_andi_16_d(void); +void m68k_op_andi_16_ai(void); +void m68k_op_andi_16_pi(void); +void m68k_op_andi_16_pd(void); +void m68k_op_andi_16_di(void); +void m68k_op_andi_16_ix(void); +void m68k_op_andi_16_aw(void); +void m68k_op_andi_16_al(void); +void m68k_op_andi_32_d(void); +void m68k_op_andi_32_ai(void); +void m68k_op_andi_32_pi(void); +void m68k_op_andi_32_pd(void); +void m68k_op_andi_32_di(void); +void m68k_op_andi_32_ix(void); +void m68k_op_andi_32_aw(void); +void m68k_op_andi_32_al(void); +void m68k_op_andi_16_toc(void); +void m68k_op_andi_16_tos(void); +void m68k_op_asr_8_s(void); +void m68k_op_asr_16_s(void); +void m68k_op_asr_32_s(void); +void m68k_op_asr_8_r(void); +void m68k_op_asr_16_r(void); +void m68k_op_asr_32_r(void); +void m68k_op_asr_16_ai(void); +void m68k_op_asr_16_pi(void); +void m68k_op_asr_16_pd(void); +void m68k_op_asr_16_di(void); +void m68k_op_asr_16_ix(void); +void m68k_op_asr_16_aw(void); +void m68k_op_asr_16_al(void); +void m68k_op_asl_8_s(void); +void m68k_op_asl_16_s(void); +void m68k_op_asl_32_s(void); +void m68k_op_asl_8_r(void); +void m68k_op_asl_16_r(void); +void m68k_op_asl_32_r(void); +void m68k_op_asl_16_ai(void); +void m68k_op_asl_16_pi(void); +void m68k_op_asl_16_pd(void); +void m68k_op_asl_16_di(void); +void m68k_op_asl_16_ix(void); +void m68k_op_asl_16_aw(void); +void m68k_op_asl_16_al(void); +void m68k_op_bhi_8(void); +void m68k_op_bls_8(void); +void m68k_op_bcc_8(void); +void m68k_op_bcs_8(void); +void m68k_op_bne_8(void); +void m68k_op_beq_8(void); +void m68k_op_bvc_8(void); +void m68k_op_bvs_8(void); +void m68k_op_bpl_8(void); +void m68k_op_bmi_8(void); +void m68k_op_bge_8(void); +void m68k_op_blt_8(void); +void m68k_op_bgt_8(void); +void m68k_op_ble_8(void); +void m68k_op_bhi_16(void); +void m68k_op_bls_16(void); +void m68k_op_bcc_16(void); +void m68k_op_bcs_16(void); +void m68k_op_bne_16(void); +void m68k_op_beq_16(void); +void m68k_op_bvc_16(void); +void m68k_op_bvs_16(void); +void m68k_op_bpl_16(void); +void m68k_op_bmi_16(void); +void m68k_op_bge_16(void); +void m68k_op_blt_16(void); +void m68k_op_bgt_16(void); +void m68k_op_ble_16(void); +void m68k_op_bhi_32(void); +void m68k_op_bls_32(void); +void m68k_op_bcc_32(void); +void m68k_op_bcs_32(void); +void m68k_op_bne_32(void); +void m68k_op_beq_32(void); +void m68k_op_bvc_32(void); +void m68k_op_bvs_32(void); +void m68k_op_bpl_32(void); +void m68k_op_bmi_32(void); +void m68k_op_bge_32(void); +void m68k_op_blt_32(void); +void m68k_op_bgt_32(void); +void m68k_op_ble_32(void); +void m68k_op_bchg_32_r_d(void); +void m68k_op_bchg_8_r_ai(void); +void m68k_op_bchg_8_r_pi(void); +void m68k_op_bchg_8_r_pi7(void); +void m68k_op_bchg_8_r_pd(void); +void m68k_op_bchg_8_r_pd7(void); +void m68k_op_bchg_8_r_di(void); +void m68k_op_bchg_8_r_ix(void); +void m68k_op_bchg_8_r_aw(void); +void m68k_op_bchg_8_r_al(void); +void m68k_op_bchg_32_s_d(void); +void m68k_op_bchg_8_s_ai(void); +void m68k_op_bchg_8_s_pi(void); +void m68k_op_bchg_8_s_pi7(void); +void m68k_op_bchg_8_s_pd(void); +void m68k_op_bchg_8_s_pd7(void); +void m68k_op_bchg_8_s_di(void); +void m68k_op_bchg_8_s_ix(void); +void m68k_op_bchg_8_s_aw(void); +void m68k_op_bchg_8_s_al(void); +void m68k_op_bclr_32_r_d(void); +void m68k_op_bclr_8_r_ai(void); +void m68k_op_bclr_8_r_pi(void); +void m68k_op_bclr_8_r_pi7(void); +void m68k_op_bclr_8_r_pd(void); +void m68k_op_bclr_8_r_pd7(void); +void m68k_op_bclr_8_r_di(void); +void m68k_op_bclr_8_r_ix(void); +void m68k_op_bclr_8_r_aw(void); +void m68k_op_bclr_8_r_al(void); +void m68k_op_bclr_32_s_d(void); +void m68k_op_bclr_8_s_ai(void); +void m68k_op_bclr_8_s_pi(void); +void m68k_op_bclr_8_s_pi7(void); +void m68k_op_bclr_8_s_pd(void); +void m68k_op_bclr_8_s_pd7(void); +void m68k_op_bclr_8_s_di(void); +void m68k_op_bclr_8_s_ix(void); +void m68k_op_bclr_8_s_aw(void); +void m68k_op_bclr_8_s_al(void); +void m68k_op_bfchg_32_d(void); +void m68k_op_bfchg_32_ai(void); +void m68k_op_bfchg_32_di(void); +void m68k_op_bfchg_32_ix(void); +void m68k_op_bfchg_32_aw(void); +void m68k_op_bfchg_32_al(void); +void m68k_op_bfclr_32_d(void); +void m68k_op_bfclr_32_ai(void); +void m68k_op_bfclr_32_di(void); +void m68k_op_bfclr_32_ix(void); +void m68k_op_bfclr_32_aw(void); +void m68k_op_bfclr_32_al(void); +void m68k_op_bfexts_32_d(void); +void m68k_op_bfexts_32_ai(void); +void m68k_op_bfexts_32_di(void); +void m68k_op_bfexts_32_ix(void); +void m68k_op_bfexts_32_aw(void); +void m68k_op_bfexts_32_al(void); +void m68k_op_bfexts_32_pcdi(void); +void m68k_op_bfexts_32_pcix(void); +void m68k_op_bfextu_32_d(void); +void m68k_op_bfextu_32_ai(void); +void m68k_op_bfextu_32_di(void); +void m68k_op_bfextu_32_ix(void); +void m68k_op_bfextu_32_aw(void); +void m68k_op_bfextu_32_al(void); +void m68k_op_bfextu_32_pcdi(void); +void m68k_op_bfextu_32_pcix(void); +void m68k_op_bfffo_32_d(void); +void m68k_op_bfffo_32_ai(void); +void m68k_op_bfffo_32_di(void); +void m68k_op_bfffo_32_ix(void); +void m68k_op_bfffo_32_aw(void); +void m68k_op_bfffo_32_al(void); +void m68k_op_bfffo_32_pcdi(void); +void m68k_op_bfffo_32_pcix(void); +void m68k_op_bfins_32_d(void); +void m68k_op_bfins_32_ai(void); +void m68k_op_bfins_32_di(void); +void m68k_op_bfins_32_ix(void); +void m68k_op_bfins_32_aw(void); +void m68k_op_bfins_32_al(void); +void m68k_op_bfset_32_d(void); +void m68k_op_bfset_32_ai(void); +void m68k_op_bfset_32_di(void); +void m68k_op_bfset_32_ix(void); +void m68k_op_bfset_32_aw(void); +void m68k_op_bfset_32_al(void); +void m68k_op_bftst_32_d(void); +void m68k_op_bftst_32_ai(void); +void m68k_op_bftst_32_di(void); +void m68k_op_bftst_32_ix(void); +void m68k_op_bftst_32_aw(void); +void m68k_op_bftst_32_al(void); +void m68k_op_bftst_32_pcdi(void); +void m68k_op_bftst_32_pcix(void); +void m68k_op_bkpt(void); +void m68k_op_bra_8(void); +void m68k_op_bra_16(void); +void m68k_op_bra_32(void); +void m68k_op_bset_32_r_d(void); +void m68k_op_bset_8_r_ai(void); +void m68k_op_bset_8_r_pi(void); +void m68k_op_bset_8_r_pi7(void); +void m68k_op_bset_8_r_pd(void); +void m68k_op_bset_8_r_pd7(void); +void m68k_op_bset_8_r_di(void); +void m68k_op_bset_8_r_ix(void); +void m68k_op_bset_8_r_aw(void); +void m68k_op_bset_8_r_al(void); +void m68k_op_bset_32_s_d(void); +void m68k_op_bset_8_s_ai(void); +void m68k_op_bset_8_s_pi(void); +void m68k_op_bset_8_s_pi7(void); +void m68k_op_bset_8_s_pd(void); +void m68k_op_bset_8_s_pd7(void); +void m68k_op_bset_8_s_di(void); +void m68k_op_bset_8_s_ix(void); +void m68k_op_bset_8_s_aw(void); +void m68k_op_bset_8_s_al(void); +void m68k_op_bsr_8(void); +void m68k_op_bsr_16(void); +void m68k_op_bsr_32(void); +void m68k_op_btst_32_r_d(void); +void m68k_op_btst_8_r_ai(void); +void m68k_op_btst_8_r_pi(void); +void m68k_op_btst_8_r_pi7(void); +void m68k_op_btst_8_r_pd(void); +void m68k_op_btst_8_r_pd7(void); +void m68k_op_btst_8_r_di(void); +void m68k_op_btst_8_r_ix(void); +void m68k_op_btst_8_r_aw(void); +void m68k_op_btst_8_r_al(void); +void m68k_op_btst_8_r_pcdi(void); +void m68k_op_btst_8_r_pcix(void); +void m68k_op_btst_8_r_i(void); +void m68k_op_btst_32_s_d(void); +void m68k_op_btst_8_s_ai(void); +void m68k_op_btst_8_s_pi(void); +void m68k_op_btst_8_s_pi7(void); +void m68k_op_btst_8_s_pd(void); +void m68k_op_btst_8_s_pd7(void); +void m68k_op_btst_8_s_di(void); +void m68k_op_btst_8_s_ix(void); +void m68k_op_btst_8_s_aw(void); +void m68k_op_btst_8_s_al(void); +void m68k_op_btst_8_s_pcdi(void); +void m68k_op_btst_8_s_pcix(void); +void m68k_op_callm_32_ai(void); +void m68k_op_callm_32_di(void); +void m68k_op_callm_32_ix(void); +void m68k_op_callm_32_aw(void); +void m68k_op_callm_32_al(void); +void m68k_op_callm_32_pcdi(void); +void m68k_op_callm_32_pcix(void); +void m68k_op_cas_8_ai(void); +void m68k_op_cas_8_pi(void); +void m68k_op_cas_8_pi7(void); +void m68k_op_cas_8_pd(void); +void m68k_op_cas_8_pd7(void); +void m68k_op_cas_8_di(void); +void m68k_op_cas_8_ix(void); +void m68k_op_cas_8_aw(void); +void m68k_op_cas_8_al(void); +void m68k_op_cas_16_ai(void); +void m68k_op_cas_16_pi(void); +void m68k_op_cas_16_pd(void); +void m68k_op_cas_16_di(void); +void m68k_op_cas_16_ix(void); +void m68k_op_cas_16_aw(void); +void m68k_op_cas_16_al(void); +void m68k_op_cas_32_ai(void); +void m68k_op_cas_32_pi(void); +void m68k_op_cas_32_pd(void); +void m68k_op_cas_32_di(void); +void m68k_op_cas_32_ix(void); +void m68k_op_cas_32_aw(void); +void m68k_op_cas_32_al(void); +void m68k_op_cas2_16(void); +void m68k_op_cas2_32(void); +void m68k_op_chk_16_d(void); +void m68k_op_chk_16_ai(void); +void m68k_op_chk_16_pi(void); +void m68k_op_chk_16_pd(void); +void m68k_op_chk_16_di(void); +void m68k_op_chk_16_ix(void); +void m68k_op_chk_16_aw(void); +void m68k_op_chk_16_al(void); +void m68k_op_chk_16_pcdi(void); +void m68k_op_chk_16_pcix(void); +void m68k_op_chk_16_i(void); +void m68k_op_chk_32_d(void); +void m68k_op_chk_32_ai(void); +void m68k_op_chk_32_pi(void); +void m68k_op_chk_32_pd(void); +void m68k_op_chk_32_di(void); +void m68k_op_chk_32_ix(void); +void m68k_op_chk_32_aw(void); +void m68k_op_chk_32_al(void); +void m68k_op_chk_32_pcdi(void); +void m68k_op_chk_32_pcix(void); +void m68k_op_chk_32_i(void); +void m68k_op_chk2cmp2_8_ai(void); +void m68k_op_chk2cmp2_8_di(void); +void m68k_op_chk2cmp2_8_ix(void); +void m68k_op_chk2cmp2_8_aw(void); +void m68k_op_chk2cmp2_8_al(void); +void m68k_op_chk2cmp2_8_pcdi(void); +void m68k_op_chk2cmp2_8_pcix(void); +void m68k_op_chk2cmp2_16_ai(void); +void m68k_op_chk2cmp2_16_di(void); +void m68k_op_chk2cmp2_16_ix(void); +void m68k_op_chk2cmp2_16_aw(void); +void m68k_op_chk2cmp2_16_al(void); +void m68k_op_chk2cmp2_16_pcdi(void); +void m68k_op_chk2cmp2_16_pcix(void); +void m68k_op_chk2cmp2_32_ai(void); +void m68k_op_chk2cmp2_32_di(void); +void m68k_op_chk2cmp2_32_ix(void); +void m68k_op_chk2cmp2_32_aw(void); +void m68k_op_chk2cmp2_32_al(void); +void m68k_op_chk2cmp2_32_pcdi(void); +void m68k_op_chk2cmp2_32_pcix(void); +void m68k_op_clr_8_d(void); +void m68k_op_clr_8_ai(void); +void m68k_op_clr_8_pi(void); +void m68k_op_clr_8_pi7(void); +void m68k_op_clr_8_pd(void); +void m68k_op_clr_8_pd7(void); +void m68k_op_clr_8_di(void); +void m68k_op_clr_8_ix(void); +void m68k_op_clr_8_aw(void); +void m68k_op_clr_8_al(void); +void m68k_op_clr_16_d(void); +void m68k_op_clr_16_ai(void); +void m68k_op_clr_16_pi(void); +void m68k_op_clr_16_pd(void); +void m68k_op_clr_16_di(void); +void m68k_op_clr_16_ix(void); +void m68k_op_clr_16_aw(void); +void m68k_op_clr_16_al(void); +void m68k_op_clr_32_d(void); +void m68k_op_clr_32_ai(void); +void m68k_op_clr_32_pi(void); +void m68k_op_clr_32_pd(void); +void m68k_op_clr_32_di(void); +void m68k_op_clr_32_ix(void); +void m68k_op_clr_32_aw(void); +void m68k_op_clr_32_al(void); +void m68k_op_cmp_8_d(void); +void m68k_op_cmp_8_ai(void); +void m68k_op_cmp_8_pi(void); +void m68k_op_cmp_8_pi7(void); +void m68k_op_cmp_8_pd(void); +void m68k_op_cmp_8_pd7(void); +void m68k_op_cmp_8_di(void); +void m68k_op_cmp_8_ix(void); +void m68k_op_cmp_8_aw(void); +void m68k_op_cmp_8_al(void); +void m68k_op_cmp_8_pcdi(void); +void m68k_op_cmp_8_pcix(void); +void m68k_op_cmp_8_i(void); +void m68k_op_cmp_16_d(void); +void m68k_op_cmp_16_a(void); +void m68k_op_cmp_16_ai(void); +void m68k_op_cmp_16_pi(void); +void m68k_op_cmp_16_pd(void); +void m68k_op_cmp_16_di(void); +void m68k_op_cmp_16_ix(void); +void m68k_op_cmp_16_aw(void); +void m68k_op_cmp_16_al(void); +void m68k_op_cmp_16_pcdi(void); +void m68k_op_cmp_16_pcix(void); +void m68k_op_cmp_16_i(void); +void m68k_op_cmp_32_d(void); +void m68k_op_cmp_32_a(void); +void m68k_op_cmp_32_ai(void); +void m68k_op_cmp_32_pi(void); +void m68k_op_cmp_32_pd(void); +void m68k_op_cmp_32_di(void); +void m68k_op_cmp_32_ix(void); +void m68k_op_cmp_32_aw(void); +void m68k_op_cmp_32_al(void); +void m68k_op_cmp_32_pcdi(void); +void m68k_op_cmp_32_pcix(void); +void m68k_op_cmp_32_i(void); +void m68k_op_cmpa_16_d(void); +void m68k_op_cmpa_16_a(void); +void m68k_op_cmpa_16_ai(void); +void m68k_op_cmpa_16_pi(void); +void m68k_op_cmpa_16_pd(void); +void m68k_op_cmpa_16_di(void); +void m68k_op_cmpa_16_ix(void); +void m68k_op_cmpa_16_aw(void); +void m68k_op_cmpa_16_al(void); +void m68k_op_cmpa_16_pcdi(void); +void m68k_op_cmpa_16_pcix(void); +void m68k_op_cmpa_16_i(void); +void m68k_op_cmpa_32_d(void); +void m68k_op_cmpa_32_a(void); +void m68k_op_cmpa_32_ai(void); +void m68k_op_cmpa_32_pi(void); +void m68k_op_cmpa_32_pd(void); +void m68k_op_cmpa_32_di(void); +void m68k_op_cmpa_32_ix(void); +void m68k_op_cmpa_32_aw(void); +void m68k_op_cmpa_32_al(void); +void m68k_op_cmpa_32_pcdi(void); +void m68k_op_cmpa_32_pcix(void); +void m68k_op_cmpa_32_i(void); +void m68k_op_cmpi_8_d(void); +void m68k_op_cmpi_8_ai(void); +void m68k_op_cmpi_8_pi(void); +void m68k_op_cmpi_8_pi7(void); +void m68k_op_cmpi_8_pd(void); +void m68k_op_cmpi_8_pd7(void); +void m68k_op_cmpi_8_di(void); +void m68k_op_cmpi_8_ix(void); +void m68k_op_cmpi_8_aw(void); +void m68k_op_cmpi_8_al(void); +void m68k_op_cmpi_8_pcdi(void); +void m68k_op_cmpi_8_pcix(void); +void m68k_op_cmpi_16_d(void); +void m68k_op_cmpi_16_ai(void); +void m68k_op_cmpi_16_pi(void); +void m68k_op_cmpi_16_pd(void); +void m68k_op_cmpi_16_di(void); +void m68k_op_cmpi_16_ix(void); +void m68k_op_cmpi_16_aw(void); +void m68k_op_cmpi_16_al(void); +void m68k_op_cmpi_16_pcdi(void); +void m68k_op_cmpi_16_pcix(void); +void m68k_op_cmpi_32_d(void); +void m68k_op_cmpi_32_ai(void); +void m68k_op_cmpi_32_pi(void); +void m68k_op_cmpi_32_pd(void); +void m68k_op_cmpi_32_di(void); +void m68k_op_cmpi_32_ix(void); +void m68k_op_cmpi_32_aw(void); +void m68k_op_cmpi_32_al(void); +void m68k_op_cmpi_32_pcdi(void); +void m68k_op_cmpi_32_pcix(void); +void m68k_op_cmpm_8_ax7(void); +void m68k_op_cmpm_8_ay7(void); +void m68k_op_cmpm_8_axy7(void); +void m68k_op_cmpm_8(void); +void m68k_op_cmpm_16(void); +void m68k_op_cmpm_32(void); +void m68k_op_cpbcc_32(void); +void m68k_op_cpdbcc_32(void); +void m68k_op_cpgen_32(void); +void m68k_op_cpscc_32(void); +void m68k_op_cptrapcc_32(void); +void m68k_op_dbt_16(void); +void m68k_op_dbf_16(void); +void m68k_op_dbhi_16(void); +void m68k_op_dbls_16(void); +void m68k_op_dbcc_16(void); +void m68k_op_dbcs_16(void); +void m68k_op_dbne_16(void); +void m68k_op_dbeq_16(void); +void m68k_op_dbvc_16(void); +void m68k_op_dbvs_16(void); +void m68k_op_dbpl_16(void); +void m68k_op_dbmi_16(void); +void m68k_op_dbge_16(void); +void m68k_op_dblt_16(void); +void m68k_op_dbgt_16(void); +void m68k_op_dble_16(void); +void m68k_op_divs_16_d(void); +void m68k_op_divs_16_ai(void); +void m68k_op_divs_16_pi(void); +void m68k_op_divs_16_pd(void); +void m68k_op_divs_16_di(void); +void m68k_op_divs_16_ix(void); +void m68k_op_divs_16_aw(void); +void m68k_op_divs_16_al(void); +void m68k_op_divs_16_pcdi(void); +void m68k_op_divs_16_pcix(void); +void m68k_op_divs_16_i(void); +void m68k_op_divu_16_d(void); +void m68k_op_divu_16_ai(void); +void m68k_op_divu_16_pi(void); +void m68k_op_divu_16_pd(void); +void m68k_op_divu_16_di(void); +void m68k_op_divu_16_ix(void); +void m68k_op_divu_16_aw(void); +void m68k_op_divu_16_al(void); +void m68k_op_divu_16_pcdi(void); +void m68k_op_divu_16_pcix(void); +void m68k_op_divu_16_i(void); +void m68k_op_divl_32_d(void); +void m68k_op_divl_32_ai(void); +void m68k_op_divl_32_pi(void); +void m68k_op_divl_32_pd(void); +void m68k_op_divl_32_di(void); +void m68k_op_divl_32_ix(void); +void m68k_op_divl_32_aw(void); +void m68k_op_divl_32_al(void); +void m68k_op_divl_32_pcdi(void); +void m68k_op_divl_32_pcix(void); +void m68k_op_divl_32_i(void); +void m68k_op_eor_8_d(void); +void m68k_op_eor_8_ai(void); +void m68k_op_eor_8_pi(void); +void m68k_op_eor_8_pi7(void); +void m68k_op_eor_8_pd(void); +void m68k_op_eor_8_pd7(void); +void m68k_op_eor_8_di(void); +void m68k_op_eor_8_ix(void); +void m68k_op_eor_8_aw(void); +void m68k_op_eor_8_al(void); +void m68k_op_eor_16_d(void); +void m68k_op_eor_16_ai(void); +void m68k_op_eor_16_pi(void); +void m68k_op_eor_16_pd(void); +void m68k_op_eor_16_di(void); +void m68k_op_eor_16_ix(void); +void m68k_op_eor_16_aw(void); +void m68k_op_eor_16_al(void); +void m68k_op_eor_32_d(void); +void m68k_op_eor_32_ai(void); +void m68k_op_eor_32_pi(void); +void m68k_op_eor_32_pd(void); +void m68k_op_eor_32_di(void); +void m68k_op_eor_32_ix(void); +void m68k_op_eor_32_aw(void); +void m68k_op_eor_32_al(void); +void m68k_op_eori_8_d(void); +void m68k_op_eori_8_ai(void); +void m68k_op_eori_8_pi(void); +void m68k_op_eori_8_pi7(void); +void m68k_op_eori_8_pd(void); +void m68k_op_eori_8_pd7(void); +void m68k_op_eori_8_di(void); +void m68k_op_eori_8_ix(void); +void m68k_op_eori_8_aw(void); +void m68k_op_eori_8_al(void); +void m68k_op_eori_16_d(void); +void m68k_op_eori_16_ai(void); +void m68k_op_eori_16_pi(void); +void m68k_op_eori_16_pd(void); +void m68k_op_eori_16_di(void); +void m68k_op_eori_16_ix(void); +void m68k_op_eori_16_aw(void); +void m68k_op_eori_16_al(void); +void m68k_op_eori_32_d(void); +void m68k_op_eori_32_ai(void); +void m68k_op_eori_32_pi(void); +void m68k_op_eori_32_pd(void); +void m68k_op_eori_32_di(void); +void m68k_op_eori_32_ix(void); +void m68k_op_eori_32_aw(void); +void m68k_op_eori_32_al(void); +void m68k_op_eori_16_toc(void); +void m68k_op_eori_16_tos(void); +void m68k_op_exg_32_dd(void); +void m68k_op_exg_32_aa(void); +void m68k_op_exg_32_da(void); +void m68k_op_ext_16(void); +void m68k_op_ext_32(void); +void m68k_op_extb_32(void); +void m68k_op_illegal(void); +void m68k_op_jmp_32_ai(void); +void m68k_op_jmp_32_di(void); +void m68k_op_jmp_32_ix(void); +void m68k_op_jmp_32_aw(void); +void m68k_op_jmp_32_al(void); +void m68k_op_jmp_32_pcdi(void); +void m68k_op_jmp_32_pcix(void); +void m68k_op_jsr_32_ai(void); +void m68k_op_jsr_32_di(void); +void m68k_op_jsr_32_ix(void); +void m68k_op_jsr_32_aw(void); +void m68k_op_jsr_32_al(void); +void m68k_op_jsr_32_pcdi(void); +void m68k_op_jsr_32_pcix(void); +void m68k_op_lea_32_ai(void); +void m68k_op_lea_32_di(void); +void m68k_op_lea_32_ix(void); +void m68k_op_lea_32_aw(void); +void m68k_op_lea_32_al(void); +void m68k_op_lea_32_pcdi(void); +void m68k_op_lea_32_pcix(void); +void m68k_op_link_16_a7(void); +void m68k_op_link_16(void); +void m68k_op_link_32_a7(void); +void m68k_op_link_32(void); +void m68k_op_lsr_8_s(void); +void m68k_op_lsr_16_s(void); +void m68k_op_lsr_32_s(void); +void m68k_op_lsr_8_r(void); +void m68k_op_lsr_16_r(void); +void m68k_op_lsr_32_r(void); +void m68k_op_lsr_16_ai(void); +void m68k_op_lsr_16_pi(void); +void m68k_op_lsr_16_pd(void); +void m68k_op_lsr_16_di(void); +void m68k_op_lsr_16_ix(void); +void m68k_op_lsr_16_aw(void); +void m68k_op_lsr_16_al(void); +void m68k_op_lsl_8_s(void); +void m68k_op_lsl_16_s(void); +void m68k_op_lsl_32_s(void); +void m68k_op_lsl_8_r(void); +void m68k_op_lsl_16_r(void); +void m68k_op_lsl_32_r(void); +void m68k_op_lsl_16_ai(void); +void m68k_op_lsl_16_pi(void); +void m68k_op_lsl_16_pd(void); +void m68k_op_lsl_16_di(void); +void m68k_op_lsl_16_ix(void); +void m68k_op_lsl_16_aw(void); +void m68k_op_lsl_16_al(void); +void m68k_op_move_8_d_d(void); +void m68k_op_move_8_d_ai(void); +void m68k_op_move_8_d_pi(void); +void m68k_op_move_8_d_pi7(void); +void m68k_op_move_8_d_pd(void); +void m68k_op_move_8_d_pd7(void); +void m68k_op_move_8_d_di(void); +void m68k_op_move_8_d_ix(void); +void m68k_op_move_8_d_aw(void); +void m68k_op_move_8_d_al(void); +void m68k_op_move_8_d_pcdi(void); +void m68k_op_move_8_d_pcix(void); +void m68k_op_move_8_d_i(void); +void m68k_op_move_8_ai_d(void); +void m68k_op_move_8_ai_ai(void); +void m68k_op_move_8_ai_pi(void); +void m68k_op_move_8_ai_pi7(void); +void m68k_op_move_8_ai_pd(void); +void m68k_op_move_8_ai_pd7(void); +void m68k_op_move_8_ai_di(void); +void m68k_op_move_8_ai_ix(void); +void m68k_op_move_8_ai_aw(void); +void m68k_op_move_8_ai_al(void); +void m68k_op_move_8_ai_pcdi(void); +void m68k_op_move_8_ai_pcix(void); +void m68k_op_move_8_ai_i(void); +void m68k_op_move_8_pi7_d(void); +void m68k_op_move_8_pi_d(void); +void m68k_op_move_8_pi7_ai(void); +void m68k_op_move_8_pi7_pi(void); +void m68k_op_move_8_pi7_pi7(void); +void m68k_op_move_8_pi7_pd(void); +void m68k_op_move_8_pi7_pd7(void); +void m68k_op_move_8_pi7_di(void); +void m68k_op_move_8_pi7_ix(void); +void m68k_op_move_8_pi7_aw(void); +void m68k_op_move_8_pi7_al(void); +void m68k_op_move_8_pi7_pcdi(void); +void m68k_op_move_8_pi7_pcix(void); +void m68k_op_move_8_pi7_i(void); +void m68k_op_move_8_pi_ai(void); +void m68k_op_move_8_pi_pi(void); +void m68k_op_move_8_pi_pi7(void); +void m68k_op_move_8_pi_pd(void); +void m68k_op_move_8_pi_pd7(void); +void m68k_op_move_8_pi_di(void); +void m68k_op_move_8_pi_ix(void); +void m68k_op_move_8_pi_aw(void); +void m68k_op_move_8_pi_al(void); +void m68k_op_move_8_pi_pcdi(void); +void m68k_op_move_8_pi_pcix(void); +void m68k_op_move_8_pi_i(void); +void m68k_op_move_8_pd7_d(void); +void m68k_op_move_8_pd_d(void); +void m68k_op_move_8_pd7_ai(void); +void m68k_op_move_8_pd7_pi(void); +void m68k_op_move_8_pd7_pi7(void); +void m68k_op_move_8_pd7_pd(void); +void m68k_op_move_8_pd7_pd7(void); +void m68k_op_move_8_pd7_di(void); +void m68k_op_move_8_pd7_ix(void); +void m68k_op_move_8_pd7_aw(void); +void m68k_op_move_8_pd7_al(void); +void m68k_op_move_8_pd7_pcdi(void); +void m68k_op_move_8_pd7_pcix(void); +void m68k_op_move_8_pd7_i(void); +void m68k_op_move_8_pd_ai(void); +void m68k_op_move_8_pd_pi(void); +void m68k_op_move_8_pd_pi7(void); +void m68k_op_move_8_pd_pd(void); +void m68k_op_move_8_pd_pd7(void); +void m68k_op_move_8_pd_di(void); +void m68k_op_move_8_pd_ix(void); +void m68k_op_move_8_pd_aw(void); +void m68k_op_move_8_pd_al(void); +void m68k_op_move_8_pd_pcdi(void); +void m68k_op_move_8_pd_pcix(void); +void m68k_op_move_8_pd_i(void); +void m68k_op_move_8_di_d(void); +void m68k_op_move_8_di_ai(void); +void m68k_op_move_8_di_pi(void); +void m68k_op_move_8_di_pi7(void); +void m68k_op_move_8_di_pd(void); +void m68k_op_move_8_di_pd7(void); +void m68k_op_move_8_di_di(void); +void m68k_op_move_8_di_ix(void); +void m68k_op_move_8_di_aw(void); +void m68k_op_move_8_di_al(void); +void m68k_op_move_8_di_pcdi(void); +void m68k_op_move_8_di_pcix(void); +void m68k_op_move_8_di_i(void); +void m68k_op_move_8_ix_d(void); +void m68k_op_move_8_ix_ai(void); +void m68k_op_move_8_ix_pi(void); +void m68k_op_move_8_ix_pi7(void); +void m68k_op_move_8_ix_pd(void); +void m68k_op_move_8_ix_pd7(void); +void m68k_op_move_8_ix_di(void); +void m68k_op_move_8_ix_ix(void); +void m68k_op_move_8_ix_aw(void); +void m68k_op_move_8_ix_al(void); +void m68k_op_move_8_ix_pcdi(void); +void m68k_op_move_8_ix_pcix(void); +void m68k_op_move_8_ix_i(void); +void m68k_op_move_8_aw_d(void); +void m68k_op_move_8_aw_ai(void); +void m68k_op_move_8_aw_pi(void); +void m68k_op_move_8_aw_pi7(void); +void m68k_op_move_8_aw_pd(void); +void m68k_op_move_8_aw_pd7(void); +void m68k_op_move_8_aw_di(void); +void m68k_op_move_8_aw_ix(void); +void m68k_op_move_8_aw_aw(void); +void m68k_op_move_8_aw_al(void); +void m68k_op_move_8_aw_pcdi(void); +void m68k_op_move_8_aw_pcix(void); +void m68k_op_move_8_aw_i(void); +void m68k_op_move_8_al_d(void); +void m68k_op_move_8_al_ai(void); +void m68k_op_move_8_al_pi(void); +void m68k_op_move_8_al_pi7(void); +void m68k_op_move_8_al_pd(void); +void m68k_op_move_8_al_pd7(void); +void m68k_op_move_8_al_di(void); +void m68k_op_move_8_al_ix(void); +void m68k_op_move_8_al_aw(void); +void m68k_op_move_8_al_al(void); +void m68k_op_move_8_al_pcdi(void); +void m68k_op_move_8_al_pcix(void); +void m68k_op_move_8_al_i(void); +void m68k_op_move_16_d_d(void); +void m68k_op_move_16_d_a(void); +void m68k_op_move_16_d_ai(void); +void m68k_op_move_16_d_pi(void); +void m68k_op_move_16_d_pd(void); +void m68k_op_move_16_d_di(void); +void m68k_op_move_16_d_ix(void); +void m68k_op_move_16_d_aw(void); +void m68k_op_move_16_d_al(void); +void m68k_op_move_16_d_pcdi(void); +void m68k_op_move_16_d_pcix(void); +void m68k_op_move_16_d_i(void); +void m68k_op_move_16_ai_d(void); +void m68k_op_move_16_ai_a(void); +void m68k_op_move_16_ai_ai(void); +void m68k_op_move_16_ai_pi(void); +void m68k_op_move_16_ai_pd(void); +void m68k_op_move_16_ai_di(void); +void m68k_op_move_16_ai_ix(void); +void m68k_op_move_16_ai_aw(void); +void m68k_op_move_16_ai_al(void); +void m68k_op_move_16_ai_pcdi(void); +void m68k_op_move_16_ai_pcix(void); +void m68k_op_move_16_ai_i(void); +void m68k_op_move_16_pi_d(void); +void m68k_op_move_16_pi_a(void); +void m68k_op_move_16_pi_ai(void); +void m68k_op_move_16_pi_pi(void); +void m68k_op_move_16_pi_pd(void); +void m68k_op_move_16_pi_di(void); +void m68k_op_move_16_pi_ix(void); +void m68k_op_move_16_pi_aw(void); +void m68k_op_move_16_pi_al(void); +void m68k_op_move_16_pi_pcdi(void); +void m68k_op_move_16_pi_pcix(void); +void m68k_op_move_16_pi_i(void); +void m68k_op_move_16_pd_d(void); +void m68k_op_move_16_pd_a(void); +void m68k_op_move_16_pd_ai(void); +void m68k_op_move_16_pd_pi(void); +void m68k_op_move_16_pd_pd(void); +void m68k_op_move_16_pd_di(void); +void m68k_op_move_16_pd_ix(void); +void m68k_op_move_16_pd_aw(void); +void m68k_op_move_16_pd_al(void); +void m68k_op_move_16_pd_pcdi(void); +void m68k_op_move_16_pd_pcix(void); +void m68k_op_move_16_pd_i(void); +void m68k_op_move_16_di_d(void); +void m68k_op_move_16_di_a(void); +void m68k_op_move_16_di_ai(void); +void m68k_op_move_16_di_pi(void); +void m68k_op_move_16_di_pd(void); +void m68k_op_move_16_di_di(void); +void m68k_op_move_16_di_ix(void); +void m68k_op_move_16_di_aw(void); +void m68k_op_move_16_di_al(void); +void m68k_op_move_16_di_pcdi(void); +void m68k_op_move_16_di_pcix(void); +void m68k_op_move_16_di_i(void); +void m68k_op_move_16_ix_d(void); +void m68k_op_move_16_ix_a(void); +void m68k_op_move_16_ix_ai(void); +void m68k_op_move_16_ix_pi(void); +void m68k_op_move_16_ix_pd(void); +void m68k_op_move_16_ix_di(void); +void m68k_op_move_16_ix_ix(void); +void m68k_op_move_16_ix_aw(void); +void m68k_op_move_16_ix_al(void); +void m68k_op_move_16_ix_pcdi(void); +void m68k_op_move_16_ix_pcix(void); +void m68k_op_move_16_ix_i(void); +void m68k_op_move_16_aw_d(void); +void m68k_op_move_16_aw_a(void); +void m68k_op_move_16_aw_ai(void); +void m68k_op_move_16_aw_pi(void); +void m68k_op_move_16_aw_pd(void); +void m68k_op_move_16_aw_di(void); +void m68k_op_move_16_aw_ix(void); +void m68k_op_move_16_aw_aw(void); +void m68k_op_move_16_aw_al(void); +void m68k_op_move_16_aw_pcdi(void); +void m68k_op_move_16_aw_pcix(void); +void m68k_op_move_16_aw_i(void); +void m68k_op_move_16_al_d(void); +void m68k_op_move_16_al_a(void); +void m68k_op_move_16_al_ai(void); +void m68k_op_move_16_al_pi(void); +void m68k_op_move_16_al_pd(void); +void m68k_op_move_16_al_di(void); +void m68k_op_move_16_al_ix(void); +void m68k_op_move_16_al_aw(void); +void m68k_op_move_16_al_al(void); +void m68k_op_move_16_al_pcdi(void); +void m68k_op_move_16_al_pcix(void); +void m68k_op_move_16_al_i(void); +void m68k_op_move_32_d_d(void); +void m68k_op_move_32_d_a(void); +void m68k_op_move_32_d_ai(void); +void m68k_op_move_32_d_pi(void); +void m68k_op_move_32_d_pd(void); +void m68k_op_move_32_d_di(void); +void m68k_op_move_32_d_ix(void); +void m68k_op_move_32_d_aw(void); +void m68k_op_move_32_d_al(void); +void m68k_op_move_32_d_pcdi(void); +void m68k_op_move_32_d_pcix(void); +void m68k_op_move_32_d_i(void); +void m68k_op_move_32_ai_d(void); +void m68k_op_move_32_ai_a(void); +void m68k_op_move_32_ai_ai(void); +void m68k_op_move_32_ai_pi(void); +void m68k_op_move_32_ai_pd(void); +void m68k_op_move_32_ai_di(void); +void m68k_op_move_32_ai_ix(void); +void m68k_op_move_32_ai_aw(void); +void m68k_op_move_32_ai_al(void); +void m68k_op_move_32_ai_pcdi(void); +void m68k_op_move_32_ai_pcix(void); +void m68k_op_move_32_ai_i(void); +void m68k_op_move_32_pi_d(void); +void m68k_op_move_32_pi_a(void); +void m68k_op_move_32_pi_ai(void); +void m68k_op_move_32_pi_pi(void); +void m68k_op_move_32_pi_pd(void); +void m68k_op_move_32_pi_di(void); +void m68k_op_move_32_pi_ix(void); +void m68k_op_move_32_pi_aw(void); +void m68k_op_move_32_pi_al(void); +void m68k_op_move_32_pi_pcdi(void); +void m68k_op_move_32_pi_pcix(void); +void m68k_op_move_32_pi_i(void); +void m68k_op_move_32_pd_d(void); +void m68k_op_move_32_pd_a(void); +void m68k_op_move_32_pd_ai(void); +void m68k_op_move_32_pd_pi(void); +void m68k_op_move_32_pd_pd(void); +void m68k_op_move_32_pd_di(void); +void m68k_op_move_32_pd_ix(void); +void m68k_op_move_32_pd_aw(void); +void m68k_op_move_32_pd_al(void); +void m68k_op_move_32_pd_pcdi(void); +void m68k_op_move_32_pd_pcix(void); +void m68k_op_move_32_pd_i(void); +void m68k_op_move_32_di_d(void); +void m68k_op_move_32_di_a(void); +void m68k_op_move_32_di_ai(void); +void m68k_op_move_32_di_pi(void); +void m68k_op_move_32_di_pd(void); +void m68k_op_move_32_di_di(void); +void m68k_op_move_32_di_ix(void); +void m68k_op_move_32_di_aw(void); +void m68k_op_move_32_di_al(void); +void m68k_op_move_32_di_pcdi(void); +void m68k_op_move_32_di_pcix(void); +void m68k_op_move_32_di_i(void); +void m68k_op_move_32_ix_d(void); +void m68k_op_move_32_ix_a(void); +void m68k_op_move_32_ix_ai(void); +void m68k_op_move_32_ix_pi(void); +void m68k_op_move_32_ix_pd(void); +void m68k_op_move_32_ix_di(void); +void m68k_op_move_32_ix_ix(void); +void m68k_op_move_32_ix_aw(void); +void m68k_op_move_32_ix_al(void); +void m68k_op_move_32_ix_pcdi(void); +void m68k_op_move_32_ix_pcix(void); +void m68k_op_move_32_ix_i(void); +void m68k_op_move_32_aw_d(void); +void m68k_op_move_32_aw_a(void); +void m68k_op_move_32_aw_ai(void); +void m68k_op_move_32_aw_pi(void); +void m68k_op_move_32_aw_pd(void); +void m68k_op_move_32_aw_di(void); +void m68k_op_move_32_aw_ix(void); +void m68k_op_move_32_aw_aw(void); +void m68k_op_move_32_aw_al(void); +void m68k_op_move_32_aw_pcdi(void); +void m68k_op_move_32_aw_pcix(void); +void m68k_op_move_32_aw_i(void); +void m68k_op_move_32_al_d(void); +void m68k_op_move_32_al_a(void); +void m68k_op_move_32_al_ai(void); +void m68k_op_move_32_al_pi(void); +void m68k_op_move_32_al_pd(void); +void m68k_op_move_32_al_di(void); +void m68k_op_move_32_al_ix(void); +void m68k_op_move_32_al_aw(void); +void m68k_op_move_32_al_al(void); +void m68k_op_move_32_al_pcdi(void); +void m68k_op_move_32_al_pcix(void); +void m68k_op_move_32_al_i(void); +void m68k_op_movea_16_d(void); +void m68k_op_movea_16_a(void); +void m68k_op_movea_16_ai(void); +void m68k_op_movea_16_pi(void); +void m68k_op_movea_16_pd(void); +void m68k_op_movea_16_di(void); +void m68k_op_movea_16_ix(void); +void m68k_op_movea_16_aw(void); +void m68k_op_movea_16_al(void); +void m68k_op_movea_16_pcdi(void); +void m68k_op_movea_16_pcix(void); +void m68k_op_movea_16_i(void); +void m68k_op_movea_32_d(void); +void m68k_op_movea_32_a(void); +void m68k_op_movea_32_ai(void); +void m68k_op_movea_32_pi(void); +void m68k_op_movea_32_pd(void); +void m68k_op_movea_32_di(void); +void m68k_op_movea_32_ix(void); +void m68k_op_movea_32_aw(void); +void m68k_op_movea_32_al(void); +void m68k_op_movea_32_pcdi(void); +void m68k_op_movea_32_pcix(void); +void m68k_op_movea_32_i(void); +void m68k_op_move_16_frc_d(void); +void m68k_op_move_16_frc_ai(void); +void m68k_op_move_16_frc_pi(void); +void m68k_op_move_16_frc_pd(void); +void m68k_op_move_16_frc_di(void); +void m68k_op_move_16_frc_ix(void); +void m68k_op_move_16_frc_aw(void); +void m68k_op_move_16_frc_al(void); +void m68k_op_move_16_toc_d(void); +void m68k_op_move_16_toc_ai(void); +void m68k_op_move_16_toc_pi(void); +void m68k_op_move_16_toc_pd(void); +void m68k_op_move_16_toc_di(void); +void m68k_op_move_16_toc_ix(void); +void m68k_op_move_16_toc_aw(void); +void m68k_op_move_16_toc_al(void); +void m68k_op_move_16_toc_pcdi(void); +void m68k_op_move_16_toc_pcix(void); +void m68k_op_move_16_toc_i(void); +void m68k_op_move_16_frs_d(void); +void m68k_op_move_16_frs_ai(void); +void m68k_op_move_16_frs_pi(void); +void m68k_op_move_16_frs_pd(void); +void m68k_op_move_16_frs_di(void); +void m68k_op_move_16_frs_ix(void); +void m68k_op_move_16_frs_aw(void); +void m68k_op_move_16_frs_al(void); +void m68k_op_move_16_tos_d(void); +void m68k_op_move_16_tos_ai(void); +void m68k_op_move_16_tos_pi(void); +void m68k_op_move_16_tos_pd(void); +void m68k_op_move_16_tos_di(void); +void m68k_op_move_16_tos_ix(void); +void m68k_op_move_16_tos_aw(void); +void m68k_op_move_16_tos_al(void); +void m68k_op_move_16_tos_pcdi(void); +void m68k_op_move_16_tos_pcix(void); +void m68k_op_move_16_tos_i(void); +void m68k_op_move_32_fru(void); +void m68k_op_move_32_tou(void); +void m68k_op_movec_32_cr(void); +void m68k_op_movec_32_rc(void); +void m68k_op_movem_16_re_pd(void); +void m68k_op_movem_16_re_ai(void); +void m68k_op_movem_16_re_di(void); +void m68k_op_movem_16_re_ix(void); +void m68k_op_movem_16_re_aw(void); +void m68k_op_movem_16_re_al(void); +void m68k_op_movem_32_re_pd(void); +void m68k_op_movem_32_re_ai(void); +void m68k_op_movem_32_re_di(void); +void m68k_op_movem_32_re_ix(void); +void m68k_op_movem_32_re_aw(void); +void m68k_op_movem_32_re_al(void); +void m68k_op_movem_16_er_pi(void); +void m68k_op_movem_16_er_ai(void); +void m68k_op_movem_16_er_di(void); +void m68k_op_movem_16_er_ix(void); +void m68k_op_movem_16_er_aw(void); +void m68k_op_movem_16_er_al(void); +void m68k_op_movem_16_er_pcdi(void); +void m68k_op_movem_16_er_pcix(void); +void m68k_op_movem_32_er_pi(void); +void m68k_op_movem_32_er_ai(void); +void m68k_op_movem_32_er_di(void); +void m68k_op_movem_32_er_ix(void); +void m68k_op_movem_32_er_aw(void); +void m68k_op_movem_32_er_al(void); +void m68k_op_movem_32_er_pcdi(void); +void m68k_op_movem_32_er_pcix(void); +void m68k_op_movep_16_re(void); +void m68k_op_movep_32_re(void); +void m68k_op_movep_16_er(void); +void m68k_op_movep_32_er(void); +void m68k_op_moves_8_ai(void); +void m68k_op_moves_8_pi(void); +void m68k_op_moves_8_pi7(void); +void m68k_op_moves_8_pd(void); +void m68k_op_moves_8_pd7(void); +void m68k_op_moves_8_di(void); +void m68k_op_moves_8_ix(void); +void m68k_op_moves_8_aw(void); +void m68k_op_moves_8_al(void); +void m68k_op_moves_16_ai(void); +void m68k_op_moves_16_pi(void); +void m68k_op_moves_16_pd(void); +void m68k_op_moves_16_di(void); +void m68k_op_moves_16_ix(void); +void m68k_op_moves_16_aw(void); +void m68k_op_moves_16_al(void); +void m68k_op_moves_32_ai(void); +void m68k_op_moves_32_pi(void); +void m68k_op_moves_32_pd(void); +void m68k_op_moves_32_di(void); +void m68k_op_moves_32_ix(void); +void m68k_op_moves_32_aw(void); +void m68k_op_moves_32_al(void); +void m68k_op_moveq_32(void); +void m68k_op_muls_16_d(void); +void m68k_op_muls_16_ai(void); +void m68k_op_muls_16_pi(void); +void m68k_op_muls_16_pd(void); +void m68k_op_muls_16_di(void); +void m68k_op_muls_16_ix(void); +void m68k_op_muls_16_aw(void); +void m68k_op_muls_16_al(void); +void m68k_op_muls_16_pcdi(void); +void m68k_op_muls_16_pcix(void); +void m68k_op_muls_16_i(void); +void m68k_op_mulu_16_d(void); +void m68k_op_mulu_16_ai(void); +void m68k_op_mulu_16_pi(void); +void m68k_op_mulu_16_pd(void); +void m68k_op_mulu_16_di(void); +void m68k_op_mulu_16_ix(void); +void m68k_op_mulu_16_aw(void); +void m68k_op_mulu_16_al(void); +void m68k_op_mulu_16_pcdi(void); +void m68k_op_mulu_16_pcix(void); +void m68k_op_mulu_16_i(void); +void m68k_op_mull_32_d(void); +void m68k_op_mull_32_ai(void); +void m68k_op_mull_32_pi(void); +void m68k_op_mull_32_pd(void); +void m68k_op_mull_32_di(void); +void m68k_op_mull_32_ix(void); +void m68k_op_mull_32_aw(void); +void m68k_op_mull_32_al(void); +void m68k_op_mull_32_pcdi(void); +void m68k_op_mull_32_pcix(void); +void m68k_op_mull_32_i(void); +void m68k_op_nbcd_8_d(void); +void m68k_op_nbcd_8_ai(void); +void m68k_op_nbcd_8_pi(void); +void m68k_op_nbcd_8_pi7(void); +void m68k_op_nbcd_8_pd(void); +void m68k_op_nbcd_8_pd7(void); +void m68k_op_nbcd_8_di(void); +void m68k_op_nbcd_8_ix(void); +void m68k_op_nbcd_8_aw(void); +void m68k_op_nbcd_8_al(void); +void m68k_op_neg_8_d(void); +void m68k_op_neg_8_ai(void); +void m68k_op_neg_8_pi(void); +void m68k_op_neg_8_pi7(void); +void m68k_op_neg_8_pd(void); +void m68k_op_neg_8_pd7(void); +void m68k_op_neg_8_di(void); +void m68k_op_neg_8_ix(void); +void m68k_op_neg_8_aw(void); +void m68k_op_neg_8_al(void); +void m68k_op_neg_16_d(void); +void m68k_op_neg_16_ai(void); +void m68k_op_neg_16_pi(void); +void m68k_op_neg_16_pd(void); +void m68k_op_neg_16_di(void); +void m68k_op_neg_16_ix(void); +void m68k_op_neg_16_aw(void); +void m68k_op_neg_16_al(void); +void m68k_op_neg_32_d(void); +void m68k_op_neg_32_ai(void); +void m68k_op_neg_32_pi(void); +void m68k_op_neg_32_pd(void); +void m68k_op_neg_32_di(void); +void m68k_op_neg_32_ix(void); +void m68k_op_neg_32_aw(void); +void m68k_op_neg_32_al(void); +void m68k_op_negx_8_d(void); +void m68k_op_negx_8_ai(void); +void m68k_op_negx_8_pi(void); +void m68k_op_negx_8_pi7(void); +void m68k_op_negx_8_pd(void); +void m68k_op_negx_8_pd7(void); +void m68k_op_negx_8_di(void); +void m68k_op_negx_8_ix(void); +void m68k_op_negx_8_aw(void); +void m68k_op_negx_8_al(void); +void m68k_op_negx_16_d(void); +void m68k_op_negx_16_ai(void); +void m68k_op_negx_16_pi(void); +void m68k_op_negx_16_pd(void); +void m68k_op_negx_16_di(void); +void m68k_op_negx_16_ix(void); +void m68k_op_negx_16_aw(void); +void m68k_op_negx_16_al(void); +void m68k_op_negx_32_d(void); +void m68k_op_negx_32_ai(void); +void m68k_op_negx_32_pi(void); +void m68k_op_negx_32_pd(void); +void m68k_op_negx_32_di(void); +void m68k_op_negx_32_ix(void); +void m68k_op_negx_32_aw(void); +void m68k_op_negx_32_al(void); +void m68k_op_nop(void); +void m68k_op_not_8_d(void); +void m68k_op_not_8_ai(void); +void m68k_op_not_8_pi(void); +void m68k_op_not_8_pi7(void); +void m68k_op_not_8_pd(void); +void m68k_op_not_8_pd7(void); +void m68k_op_not_8_di(void); +void m68k_op_not_8_ix(void); +void m68k_op_not_8_aw(void); +void m68k_op_not_8_al(void); +void m68k_op_not_16_d(void); +void m68k_op_not_16_ai(void); +void m68k_op_not_16_pi(void); +void m68k_op_not_16_pd(void); +void m68k_op_not_16_di(void); +void m68k_op_not_16_ix(void); +void m68k_op_not_16_aw(void); +void m68k_op_not_16_al(void); +void m68k_op_not_32_d(void); +void m68k_op_not_32_ai(void); +void m68k_op_not_32_pi(void); +void m68k_op_not_32_pd(void); +void m68k_op_not_32_di(void); +void m68k_op_not_32_ix(void); +void m68k_op_not_32_aw(void); +void m68k_op_not_32_al(void); +void m68k_op_or_8_er_d(void); +void m68k_op_or_8_er_ai(void); +void m68k_op_or_8_er_pi(void); +void m68k_op_or_8_er_pi7(void); +void m68k_op_or_8_er_pd(void); +void m68k_op_or_8_er_pd7(void); +void m68k_op_or_8_er_di(void); +void m68k_op_or_8_er_ix(void); +void m68k_op_or_8_er_aw(void); +void m68k_op_or_8_er_al(void); +void m68k_op_or_8_er_pcdi(void); +void m68k_op_or_8_er_pcix(void); +void m68k_op_or_8_er_i(void); +void m68k_op_or_16_er_d(void); +void m68k_op_or_16_er_ai(void); +void m68k_op_or_16_er_pi(void); +void m68k_op_or_16_er_pd(void); +void m68k_op_or_16_er_di(void); +void m68k_op_or_16_er_ix(void); +void m68k_op_or_16_er_aw(void); +void m68k_op_or_16_er_al(void); +void m68k_op_or_16_er_pcdi(void); +void m68k_op_or_16_er_pcix(void); +void m68k_op_or_16_er_i(void); +void m68k_op_or_32_er_d(void); +void m68k_op_or_32_er_ai(void); +void m68k_op_or_32_er_pi(void); +void m68k_op_or_32_er_pd(void); +void m68k_op_or_32_er_di(void); +void m68k_op_or_32_er_ix(void); +void m68k_op_or_32_er_aw(void); +void m68k_op_or_32_er_al(void); +void m68k_op_or_32_er_pcdi(void); +void m68k_op_or_32_er_pcix(void); +void m68k_op_or_32_er_i(void); +void m68k_op_or_8_re_ai(void); +void m68k_op_or_8_re_pi(void); +void m68k_op_or_8_re_pi7(void); +void m68k_op_or_8_re_pd(void); +void m68k_op_or_8_re_pd7(void); +void m68k_op_or_8_re_di(void); +void m68k_op_or_8_re_ix(void); +void m68k_op_or_8_re_aw(void); +void m68k_op_or_8_re_al(void); +void m68k_op_or_16_re_ai(void); +void m68k_op_or_16_re_pi(void); +void m68k_op_or_16_re_pd(void); +void m68k_op_or_16_re_di(void); +void m68k_op_or_16_re_ix(void); +void m68k_op_or_16_re_aw(void); +void m68k_op_or_16_re_al(void); +void m68k_op_or_32_re_ai(void); +void m68k_op_or_32_re_pi(void); +void m68k_op_or_32_re_pd(void); +void m68k_op_or_32_re_di(void); +void m68k_op_or_32_re_ix(void); +void m68k_op_or_32_re_aw(void); +void m68k_op_or_32_re_al(void); +void m68k_op_ori_8_d(void); +void m68k_op_ori_8_ai(void); +void m68k_op_ori_8_pi(void); +void m68k_op_ori_8_pi7(void); +void m68k_op_ori_8_pd(void); +void m68k_op_ori_8_pd7(void); +void m68k_op_ori_8_di(void); +void m68k_op_ori_8_ix(void); +void m68k_op_ori_8_aw(void); +void m68k_op_ori_8_al(void); +void m68k_op_ori_16_d(void); +void m68k_op_ori_16_ai(void); +void m68k_op_ori_16_pi(void); +void m68k_op_ori_16_pd(void); +void m68k_op_ori_16_di(void); +void m68k_op_ori_16_ix(void); +void m68k_op_ori_16_aw(void); +void m68k_op_ori_16_al(void); +void m68k_op_ori_32_d(void); +void m68k_op_ori_32_ai(void); +void m68k_op_ori_32_pi(void); +void m68k_op_ori_32_pd(void); +void m68k_op_ori_32_di(void); +void m68k_op_ori_32_ix(void); +void m68k_op_ori_32_aw(void); +void m68k_op_ori_32_al(void); +void m68k_op_ori_16_toc(void); +void m68k_op_ori_16_tos(void); +void m68k_op_pack_16_rr(void); +void m68k_op_pack_16_mm_ax7(void); +void m68k_op_pack_16_mm_ay7(void); +void m68k_op_pack_16_mm_axy7(void); +void m68k_op_pack_16_mm(void); +void m68k_op_pea_32_ai(void); +void m68k_op_pea_32_di(void); +void m68k_op_pea_32_ix(void); +void m68k_op_pea_32_aw(void); +void m68k_op_pea_32_al(void); +void m68k_op_pea_32_pcdi(void); +void m68k_op_pea_32_pcix(void); +void m68k_op_reset(void); +void m68k_op_ror_8_s(void); +void m68k_op_ror_16_s(void); +void m68k_op_ror_32_s(void); +void m68k_op_ror_8_r(void); +void m68k_op_ror_16_r(void); +void m68k_op_ror_32_r(void); +void m68k_op_ror_16_ai(void); +void m68k_op_ror_16_pi(void); +void m68k_op_ror_16_pd(void); +void m68k_op_ror_16_di(void); +void m68k_op_ror_16_ix(void); +void m68k_op_ror_16_aw(void); +void m68k_op_ror_16_al(void); +void m68k_op_rol_8_s(void); +void m68k_op_rol_16_s(void); +void m68k_op_rol_32_s(void); +void m68k_op_rol_8_r(void); +void m68k_op_rol_16_r(void); +void m68k_op_rol_32_r(void); +void m68k_op_rol_16_ai(void); +void m68k_op_rol_16_pi(void); +void m68k_op_rol_16_pd(void); +void m68k_op_rol_16_di(void); +void m68k_op_rol_16_ix(void); +void m68k_op_rol_16_aw(void); +void m68k_op_rol_16_al(void); +void m68k_op_roxr_8_s(void); +void m68k_op_roxr_16_s(void); +void m68k_op_roxr_32_s(void); +void m68k_op_roxr_8_r(void); +void m68k_op_roxr_16_r(void); +void m68k_op_roxr_32_r(void); +void m68k_op_roxr_16_ai(void); +void m68k_op_roxr_16_pi(void); +void m68k_op_roxr_16_pd(void); +void m68k_op_roxr_16_di(void); +void m68k_op_roxr_16_ix(void); +void m68k_op_roxr_16_aw(void); +void m68k_op_roxr_16_al(void); +void m68k_op_roxl_8_s(void); +void m68k_op_roxl_16_s(void); +void m68k_op_roxl_32_s(void); +void m68k_op_roxl_8_r(void); +void m68k_op_roxl_16_r(void); +void m68k_op_roxl_32_r(void); +void m68k_op_roxl_16_ai(void); +void m68k_op_roxl_16_pi(void); +void m68k_op_roxl_16_pd(void); +void m68k_op_roxl_16_di(void); +void m68k_op_roxl_16_ix(void); +void m68k_op_roxl_16_aw(void); +void m68k_op_roxl_16_al(void); +void m68k_op_rtd_32(void); +void m68k_op_rte_32(void); +void m68k_op_rtm_32(void); +void m68k_op_rtr_32(void); +void m68k_op_rts_32(void); +void m68k_op_sbcd_8_rr(void); +void m68k_op_sbcd_8_mm_ax7(void); +void m68k_op_sbcd_8_mm_ay7(void); +void m68k_op_sbcd_8_mm_axy7(void); +void m68k_op_sbcd_8_mm(void); +void m68k_op_st_8_d(void); +void m68k_op_st_8_ai(void); +void m68k_op_st_8_pi(void); +void m68k_op_st_8_pi7(void); +void m68k_op_st_8_pd(void); +void m68k_op_st_8_pd7(void); +void m68k_op_st_8_di(void); +void m68k_op_st_8_ix(void); +void m68k_op_st_8_aw(void); +void m68k_op_st_8_al(void); +void m68k_op_sf_8_d(void); +void m68k_op_sf_8_ai(void); +void m68k_op_sf_8_pi(void); +void m68k_op_sf_8_pi7(void); +void m68k_op_sf_8_pd(void); +void m68k_op_sf_8_pd7(void); +void m68k_op_sf_8_di(void); +void m68k_op_sf_8_ix(void); +void m68k_op_sf_8_aw(void); +void m68k_op_sf_8_al(void); +void m68k_op_shi_8_d(void); +void m68k_op_sls_8_d(void); +void m68k_op_scc_8_d(void); +void m68k_op_scs_8_d(void); +void m68k_op_sne_8_d(void); +void m68k_op_seq_8_d(void); +void m68k_op_svc_8_d(void); +void m68k_op_svs_8_d(void); +void m68k_op_spl_8_d(void); +void m68k_op_smi_8_d(void); +void m68k_op_sge_8_d(void); +void m68k_op_slt_8_d(void); +void m68k_op_sgt_8_d(void); +void m68k_op_sle_8_d(void); +void m68k_op_shi_8_ai(void); +void m68k_op_shi_8_pi(void); +void m68k_op_shi_8_pi7(void); +void m68k_op_shi_8_pd(void); +void m68k_op_shi_8_pd7(void); +void m68k_op_shi_8_di(void); +void m68k_op_shi_8_ix(void); +void m68k_op_shi_8_aw(void); +void m68k_op_shi_8_al(void); +void m68k_op_sls_8_ai(void); +void m68k_op_sls_8_pi(void); +void m68k_op_sls_8_pi7(void); +void m68k_op_sls_8_pd(void); +void m68k_op_sls_8_pd7(void); +void m68k_op_sls_8_di(void); +void m68k_op_sls_8_ix(void); +void m68k_op_sls_8_aw(void); +void m68k_op_sls_8_al(void); +void m68k_op_scc_8_ai(void); +void m68k_op_scc_8_pi(void); +void m68k_op_scc_8_pi7(void); +void m68k_op_scc_8_pd(void); +void m68k_op_scc_8_pd7(void); +void m68k_op_scc_8_di(void); +void m68k_op_scc_8_ix(void); +void m68k_op_scc_8_aw(void); +void m68k_op_scc_8_al(void); +void m68k_op_scs_8_ai(void); +void m68k_op_scs_8_pi(void); +void m68k_op_scs_8_pi7(void); +void m68k_op_scs_8_pd(void); +void m68k_op_scs_8_pd7(void); +void m68k_op_scs_8_di(void); +void m68k_op_scs_8_ix(void); +void m68k_op_scs_8_aw(void); +void m68k_op_scs_8_al(void); +void m68k_op_sne_8_ai(void); +void m68k_op_sne_8_pi(void); +void m68k_op_sne_8_pi7(void); +void m68k_op_sne_8_pd(void); +void m68k_op_sne_8_pd7(void); +void m68k_op_sne_8_di(void); +void m68k_op_sne_8_ix(void); +void m68k_op_sne_8_aw(void); +void m68k_op_sne_8_al(void); +void m68k_op_seq_8_ai(void); +void m68k_op_seq_8_pi(void); +void m68k_op_seq_8_pi7(void); +void m68k_op_seq_8_pd(void); +void m68k_op_seq_8_pd7(void); +void m68k_op_seq_8_di(void); +void m68k_op_seq_8_ix(void); +void m68k_op_seq_8_aw(void); +void m68k_op_seq_8_al(void); +void m68k_op_svc_8_ai(void); +void m68k_op_svc_8_pi(void); +void m68k_op_svc_8_pi7(void); +void m68k_op_svc_8_pd(void); +void m68k_op_svc_8_pd7(void); +void m68k_op_svc_8_di(void); +void m68k_op_svc_8_ix(void); +void m68k_op_svc_8_aw(void); +void m68k_op_svc_8_al(void); +void m68k_op_svs_8_ai(void); +void m68k_op_svs_8_pi(void); +void m68k_op_svs_8_pi7(void); +void m68k_op_svs_8_pd(void); +void m68k_op_svs_8_pd7(void); +void m68k_op_svs_8_di(void); +void m68k_op_svs_8_ix(void); +void m68k_op_svs_8_aw(void); +void m68k_op_svs_8_al(void); +void m68k_op_spl_8_ai(void); +void m68k_op_spl_8_pi(void); +void m68k_op_spl_8_pi7(void); +void m68k_op_spl_8_pd(void); +void m68k_op_spl_8_pd7(void); +void m68k_op_spl_8_di(void); +void m68k_op_spl_8_ix(void); +void m68k_op_spl_8_aw(void); +void m68k_op_spl_8_al(void); +void m68k_op_smi_8_ai(void); +void m68k_op_smi_8_pi(void); +void m68k_op_smi_8_pi7(void); +void m68k_op_smi_8_pd(void); +void m68k_op_smi_8_pd7(void); +void m68k_op_smi_8_di(void); +void m68k_op_smi_8_ix(void); +void m68k_op_smi_8_aw(void); +void m68k_op_smi_8_al(void); +void m68k_op_sge_8_ai(void); +void m68k_op_sge_8_pi(void); +void m68k_op_sge_8_pi7(void); +void m68k_op_sge_8_pd(void); +void m68k_op_sge_8_pd7(void); +void m68k_op_sge_8_di(void); +void m68k_op_sge_8_ix(void); +void m68k_op_sge_8_aw(void); +void m68k_op_sge_8_al(void); +void m68k_op_slt_8_ai(void); +void m68k_op_slt_8_pi(void); +void m68k_op_slt_8_pi7(void); +void m68k_op_slt_8_pd(void); +void m68k_op_slt_8_pd7(void); +void m68k_op_slt_8_di(void); +void m68k_op_slt_8_ix(void); +void m68k_op_slt_8_aw(void); +void m68k_op_slt_8_al(void); +void m68k_op_sgt_8_ai(void); +void m68k_op_sgt_8_pi(void); +void m68k_op_sgt_8_pi7(void); +void m68k_op_sgt_8_pd(void); +void m68k_op_sgt_8_pd7(void); +void m68k_op_sgt_8_di(void); +void m68k_op_sgt_8_ix(void); +void m68k_op_sgt_8_aw(void); +void m68k_op_sgt_8_al(void); +void m68k_op_sle_8_ai(void); +void m68k_op_sle_8_pi(void); +void m68k_op_sle_8_pi7(void); +void m68k_op_sle_8_pd(void); +void m68k_op_sle_8_pd7(void); +void m68k_op_sle_8_di(void); +void m68k_op_sle_8_ix(void); +void m68k_op_sle_8_aw(void); +void m68k_op_sle_8_al(void); +void m68k_op_stop(void); +void m68k_op_sub_8_er_d(void); +void m68k_op_sub_8_er_ai(void); +void m68k_op_sub_8_er_pi(void); +void m68k_op_sub_8_er_pi7(void); +void m68k_op_sub_8_er_pd(void); +void m68k_op_sub_8_er_pd7(void); +void m68k_op_sub_8_er_di(void); +void m68k_op_sub_8_er_ix(void); +void m68k_op_sub_8_er_aw(void); +void m68k_op_sub_8_er_al(void); +void m68k_op_sub_8_er_pcdi(void); +void m68k_op_sub_8_er_pcix(void); +void m68k_op_sub_8_er_i(void); +void m68k_op_sub_16_er_d(void); +void m68k_op_sub_16_er_a(void); +void m68k_op_sub_16_er_ai(void); +void m68k_op_sub_16_er_pi(void); +void m68k_op_sub_16_er_pd(void); +void m68k_op_sub_16_er_di(void); +void m68k_op_sub_16_er_ix(void); +void m68k_op_sub_16_er_aw(void); +void m68k_op_sub_16_er_al(void); +void m68k_op_sub_16_er_pcdi(void); +void m68k_op_sub_16_er_pcix(void); +void m68k_op_sub_16_er_i(void); +void m68k_op_sub_32_er_d(void); +void m68k_op_sub_32_er_a(void); +void m68k_op_sub_32_er_ai(void); +void m68k_op_sub_32_er_pi(void); +void m68k_op_sub_32_er_pd(void); +void m68k_op_sub_32_er_di(void); +void m68k_op_sub_32_er_ix(void); +void m68k_op_sub_32_er_aw(void); +void m68k_op_sub_32_er_al(void); +void m68k_op_sub_32_er_pcdi(void); +void m68k_op_sub_32_er_pcix(void); +void m68k_op_sub_32_er_i(void); +void m68k_op_sub_8_re_ai(void); +void m68k_op_sub_8_re_pi(void); +void m68k_op_sub_8_re_pi7(void); +void m68k_op_sub_8_re_pd(void); +void m68k_op_sub_8_re_pd7(void); +void m68k_op_sub_8_re_di(void); +void m68k_op_sub_8_re_ix(void); +void m68k_op_sub_8_re_aw(void); +void m68k_op_sub_8_re_al(void); +void m68k_op_sub_16_re_ai(void); +void m68k_op_sub_16_re_pi(void); +void m68k_op_sub_16_re_pd(void); +void m68k_op_sub_16_re_di(void); +void m68k_op_sub_16_re_ix(void); +void m68k_op_sub_16_re_aw(void); +void m68k_op_sub_16_re_al(void); +void m68k_op_sub_32_re_ai(void); +void m68k_op_sub_32_re_pi(void); +void m68k_op_sub_32_re_pd(void); +void m68k_op_sub_32_re_di(void); +void m68k_op_sub_32_re_ix(void); +void m68k_op_sub_32_re_aw(void); +void m68k_op_sub_32_re_al(void); +void m68k_op_suba_16_d(void); +void m68k_op_suba_16_a(void); +void m68k_op_suba_16_ai(void); +void m68k_op_suba_16_pi(void); +void m68k_op_suba_16_pd(void); +void m68k_op_suba_16_di(void); +void m68k_op_suba_16_ix(void); +void m68k_op_suba_16_aw(void); +void m68k_op_suba_16_al(void); +void m68k_op_suba_16_pcdi(void); +void m68k_op_suba_16_pcix(void); +void m68k_op_suba_16_i(void); +void m68k_op_suba_32_d(void); +void m68k_op_suba_32_a(void); +void m68k_op_suba_32_ai(void); +void m68k_op_suba_32_pi(void); +void m68k_op_suba_32_pd(void); +void m68k_op_suba_32_di(void); +void m68k_op_suba_32_ix(void); +void m68k_op_suba_32_aw(void); +void m68k_op_suba_32_al(void); +void m68k_op_suba_32_pcdi(void); +void m68k_op_suba_32_pcix(void); +void m68k_op_suba_32_i(void); +void m68k_op_subi_8_d(void); +void m68k_op_subi_8_ai(void); +void m68k_op_subi_8_pi(void); +void m68k_op_subi_8_pi7(void); +void m68k_op_subi_8_pd(void); +void m68k_op_subi_8_pd7(void); +void m68k_op_subi_8_di(void); +void m68k_op_subi_8_ix(void); +void m68k_op_subi_8_aw(void); +void m68k_op_subi_8_al(void); +void m68k_op_subi_16_d(void); +void m68k_op_subi_16_ai(void); +void m68k_op_subi_16_pi(void); +void m68k_op_subi_16_pd(void); +void m68k_op_subi_16_di(void); +void m68k_op_subi_16_ix(void); +void m68k_op_subi_16_aw(void); +void m68k_op_subi_16_al(void); +void m68k_op_subi_32_d(void); +void m68k_op_subi_32_ai(void); +void m68k_op_subi_32_pi(void); +void m68k_op_subi_32_pd(void); +void m68k_op_subi_32_di(void); +void m68k_op_subi_32_ix(void); +void m68k_op_subi_32_aw(void); +void m68k_op_subi_32_al(void); +void m68k_op_subq_8_d(void); +void m68k_op_subq_8_ai(void); +void m68k_op_subq_8_pi(void); +void m68k_op_subq_8_pi7(void); +void m68k_op_subq_8_pd(void); +void m68k_op_subq_8_pd7(void); +void m68k_op_subq_8_di(void); +void m68k_op_subq_8_ix(void); +void m68k_op_subq_8_aw(void); +void m68k_op_subq_8_al(void); +void m68k_op_subq_16_d(void); +void m68k_op_subq_16_a(void); +void m68k_op_subq_16_ai(void); +void m68k_op_subq_16_pi(void); +void m68k_op_subq_16_pd(void); +void m68k_op_subq_16_di(void); +void m68k_op_subq_16_ix(void); +void m68k_op_subq_16_aw(void); +void m68k_op_subq_16_al(void); +void m68k_op_subq_32_d(void); +void m68k_op_subq_32_a(void); +void m68k_op_subq_32_ai(void); +void m68k_op_subq_32_pi(void); +void m68k_op_subq_32_pd(void); +void m68k_op_subq_32_di(void); +void m68k_op_subq_32_ix(void); +void m68k_op_subq_32_aw(void); +void m68k_op_subq_32_al(void); +void m68k_op_subx_8_rr(void); +void m68k_op_subx_16_rr(void); +void m68k_op_subx_32_rr(void); +void m68k_op_subx_8_mm_ax7(void); +void m68k_op_subx_8_mm_ay7(void); +void m68k_op_subx_8_mm_axy7(void); +void m68k_op_subx_8_mm(void); +void m68k_op_subx_16_mm(void); +void m68k_op_subx_32_mm(void); +void m68k_op_swap_32(void); +void m68k_op_tas_8_d(void); +void m68k_op_tas_8_ai(void); +void m68k_op_tas_8_pi(void); +void m68k_op_tas_8_pi7(void); +void m68k_op_tas_8_pd(void); +void m68k_op_tas_8_pd7(void); +void m68k_op_tas_8_di(void); +void m68k_op_tas_8_ix(void); +void m68k_op_tas_8_aw(void); +void m68k_op_tas_8_al(void); +void m68k_op_trap(void); +void m68k_op_trapt(void); +void m68k_op_trapt_16(void); +void m68k_op_trapt_32(void); +void m68k_op_trapf(void); +void m68k_op_trapf_16(void); +void m68k_op_trapf_32(void); +void m68k_op_traphi(void); +void m68k_op_trapls(void); +void m68k_op_trapcc(void); +void m68k_op_trapcs(void); +void m68k_op_trapne(void); +void m68k_op_trapeq(void); +void m68k_op_trapvc(void); +void m68k_op_trapvs(void); +void m68k_op_trappl(void); +void m68k_op_trapmi(void); +void m68k_op_trapge(void); +void m68k_op_traplt(void); +void m68k_op_trapgt(void); +void m68k_op_traple(void); +void m68k_op_traphi_16(void); +void m68k_op_trapls_16(void); +void m68k_op_trapcc_16(void); +void m68k_op_trapcs_16(void); +void m68k_op_trapne_16(void); +void m68k_op_trapeq_16(void); +void m68k_op_trapvc_16(void); +void m68k_op_trapvs_16(void); +void m68k_op_trappl_16(void); +void m68k_op_trapmi_16(void); +void m68k_op_trapge_16(void); +void m68k_op_traplt_16(void); +void m68k_op_trapgt_16(void); +void m68k_op_traple_16(void); +void m68k_op_traphi_32(void); +void m68k_op_trapls_32(void); +void m68k_op_trapcc_32(void); +void m68k_op_trapcs_32(void); +void m68k_op_trapne_32(void); +void m68k_op_trapeq_32(void); +void m68k_op_trapvc_32(void); +void m68k_op_trapvs_32(void); +void m68k_op_trappl_32(void); +void m68k_op_trapmi_32(void); +void m68k_op_trapge_32(void); +void m68k_op_traplt_32(void); +void m68k_op_trapgt_32(void); +void m68k_op_traple_32(void); +void m68k_op_trapv(void); +void m68k_op_tst_8_d(void); +void m68k_op_tst_8_ai(void); +void m68k_op_tst_8_pi(void); +void m68k_op_tst_8_pi7(void); +void m68k_op_tst_8_pd(void); +void m68k_op_tst_8_pd7(void); +void m68k_op_tst_8_di(void); +void m68k_op_tst_8_ix(void); +void m68k_op_tst_8_aw(void); +void m68k_op_tst_8_al(void); +void m68k_op_tst_8_pcdi(void); +void m68k_op_tst_8_pcix(void); +void m68k_op_tst_8_i(void); +void m68k_op_tst_16_d(void); +void m68k_op_tst_16_a(void); +void m68k_op_tst_16_ai(void); +void m68k_op_tst_16_pi(void); +void m68k_op_tst_16_pd(void); +void m68k_op_tst_16_di(void); +void m68k_op_tst_16_ix(void); +void m68k_op_tst_16_aw(void); +void m68k_op_tst_16_al(void); +void m68k_op_tst_16_pcdi(void); +void m68k_op_tst_16_pcix(void); +void m68k_op_tst_16_i(void); +void m68k_op_tst_32_d(void); +void m68k_op_tst_32_a(void); +void m68k_op_tst_32_ai(void); +void m68k_op_tst_32_pi(void); +void m68k_op_tst_32_pd(void); +void m68k_op_tst_32_di(void); +void m68k_op_tst_32_ix(void); +void m68k_op_tst_32_aw(void); +void m68k_op_tst_32_al(void); +void m68k_op_tst_32_pcdi(void); +void m68k_op_tst_32_pcix(void); +void m68k_op_tst_32_i(void); +void m68k_op_unlk_32_a7(void); +void m68k_op_unlk_32(void); +void m68k_op_unpk_16_rr(void); +void m68k_op_unpk_16_mm_ax7(void); +void m68k_op_unpk_16_mm_ay7(void); +void m68k_op_unpk_16_mm_axy7(void); +void m68k_op_unpk_16_mm(void); +/* Build the opcode handler table */ +void m68ki_build_opcode_table(void); + +extern void (*m68ki_instruction_jump_table[0x10000])(void); /* opcode handler jump table */ +extern unsigned char m68ki_cycles[][0x10000]; + + +/* ======================================================================== */ +/* ============================== END OF FILE ============================= */ +/* ======================================================================== */ + +#endif /* M68KOPS__HEADER */ + + diff --git a/source/macros.h b/source/macros.h new file mode 100644 index 0000000..7f45920 --- /dev/null +++ b/source/macros.h @@ -0,0 +1,34 @@ + +#ifndef _MACROS_H_ +#define _MACROS_H_ + +#ifdef LSB_FIRST + +#define READ_BYTE(BASE, ADDR) (BASE)[(ADDR)^1] +#define READ_WORD(BASE, ADDR) (((BASE)[ADDR]<<8) | \ + (BASE)[(ADDR)+1]) +#define READ_WORD_LONG(BASE, ADDR) (((BASE)[ADDR]<<24) | \ + ((BASE)[(ADDR)+1]<<16) | \ + ((BASE)[(ADDR)+2]<<8) | \ + (BASE)[(ADDR)+3]) + +#define WRITE_BYTE(BASE, ADDR, VAL) (BASE)[(ADDR)^1] = (VAL)&0xff +#define WRITE_WORD(BASE, ADDR, VAL) (BASE)[ADDR] = ((VAL)>>8) & 0xff; \ + (BASE)[(ADDR)+1] = (VAL)&0xff +#define WRITE_WORD_LONG(BASE, ADDR, VAL) (BASE)[(ADDR] = ((VAL)>>24) & 0xff; \ + (BASE)[(ADDR)+1] = ((VAL)>>16)&0xff; \ + (BASE)[(ADDR)+2] = ((VAL)>>8)&0xff; \ + (BASE)[(ADDR)+3] = (VAL)&0xff + +#else + +#define READ_BYTE(BASE, ADDR) (BASE)[ADDR] +#define READ_WORD(BASE, ADDR) *(uint16 *)((BASE) + (ADDR)); +#define READ_WORD_LONG(BASE, ADDR) *(uint32 *)((BASE) + (ADDR)); +#define WRITE_BYTE(BASE, ADDR, VAL) (BASE)[ADDR] = VAL & 0xff +#define WRITE_WORD(BASE, ADDR, VAL) *(uint16 *)((BASE) + (ADDR)) = VAL & 0xffff +#define WRITE_WORD_LONG(BASE, ADDR, VAL) *(uint32 *)((BASE) + (ADDR)) = VAL & 0xffffffff +#endif + + +#endif /* _MACROS_H_ */ diff --git a/source/mem68k.c b/source/mem68k.c new file mode 100644 index 0000000..f90780a --- /dev/null +++ b/source/mem68k.c @@ -0,0 +1,776 @@ +#include "shared.h" + +static uint16 next_int = 1; +static uint8 prot_bytes[2]; /* simple protection faking (from Picodrive) */ + +unsigned int m68k_read_bus_8(unsigned int address) +{ + uint16 temp = m68k_read_bus_16(address); + return ((address & 1) ? (temp & 0xFF) : (temp >> 8)); +} + +unsigned int m68k_read_bus_16(unsigned int address) +{ + next_int ^= 0xFFFF; + return next_int; +} + + +void m68k_unused_w (unsigned int address, unsigned int value) +{ + error("Unused 3 %08X = %08X \n", address, value); +} + +void m68k_unused_8_w (unsigned int address, unsigned int value) +{ + error("Unused 2 %08X = %02X \n", address, value); +} + +void m68k_unused_16_w (unsigned int address, unsigned int value) +{ + error("Unused 1 %08X = %04X \n", address, value); +} + +/* + Functions to handle memory accesses which cause the Genesis to halt + either temporarily (press RESET button to restart) or unrecoverably + (cycle power to restart). +*/ + +void m68k_lockup_w_8 (unsigned int address, unsigned int value) +{ + error ("Lockup %08X = %02X (%08X)\n", address, value, m68k_get_reg (NULL, M68K_REG_PC)); + gen_running = 0; + m68k_end_timeslice (); +} + +void m68k_lockup_w_16 (unsigned int address, unsigned int value) +{ + error ("Lockup %08X = %04X (%08X)\n", address, value, m68k_get_reg (NULL, M68K_REG_PC)); + gen_running = 0; + m68k_end_timeslice (); +} + +unsigned int m68k_lockup_r_8 (unsigned int address) +{ + error ("Lockup %08X.b (%08X)\n", address, m68k_get_reg (NULL, M68K_REG_PC)); + gen_running = 0; + m68k_end_timeslice (); + return -1; +} + +unsigned int m68k_lockup_r_16 (unsigned int address) +{ + error ("Lockup %08X.w (%08X)\n", address, m68k_get_reg (NULL, M68K_REG_PC)); + gen_running = 0; + m68k_end_timeslice (); + return -1; +} + + +/*--------------------------------------------------------------------------*/ +/* 68000 memory handlers */ +/*--------------------------------------------------------------------------*/ + +unsigned int m68k_read_memory_8 (unsigned int address) +{ + switch ((address >> 21) & 7) + { + case 0: /* ROM Cartridge*/ + case 1: + /* SRAM */ + if (sram.on) + { + if (address >= sram.start && address <= sram.end) + { + if (sram.custom) return (EEPROM_Read(address)&0xffff); + return READ_BYTE(sram.sram, (address - sram.start) & 0xffff); + } + } + + /* ROM data */ + if (address < genromsize) return READ_BYTE(cart_rom, address); + + /* default */ + return 0x00; + + case 7: /* RAM */ + return READ_BYTE(work_ram, address & 0xFFFF); + + case 5: /* Z80 & I/O */ + if (address <= 0xA0FFFF) /* Z80 area */ + { + /* Z80 controls Z bus */ + if (zbusack == 1) return (m68k_read_bus_8 (address)); + else + { + /* Read data from Z bus */ + switch (address & 0x6000) + { + case 0x0000: /* RAM */ + case 0x2000: + return (zram[(address & 0x1FFF)]); + + case 0x4000: /* YM2612 */ + return (fm_read (address & 3)); + + case 0x6000: /* Unused */ + switch (address & 0xFF00) + { + case 0x7F00: /* VDP */ + m68k_lockup_r_8 (address); + + default: /* Unused */ + return (0xFF); + } + break; + } + } + } + else if (address <= 0xA1001F) + { + /* I/O */ + return (io_read((address >> 1) & 0x0F)); + } + else if (address <= 0xA1FFFF) /* CONTROL */ + { + switch ((address >> 8) & 0xFF) + { + case 0x11: /* BUSACK */ + if ((address & 1) == 0) return (gen_busack_r () | (m68k_read_bus_8 (address) & 0xFE)); + else return (m68k_read_bus_8 (address)); + + case 0x00: /* UNKNOWN (BallZ) */ + case 0x10: /* MEMORY MODE */ + case 0x12: /* RESET */ + case 0x20: /* MEGA-CD */ + case 0x40: /* TMSS */ + case 0x41: /* BOOTROM */ + case 0x50: /* SVP REGISTERS */ + return (m68k_read_bus_8 (address)); + + default: /* Unused */ + return (m68k_lockup_r_8 (address)); + } + } + else + { + /* Unused */ + return (m68k_lockup_r_8 (address)); + } + + break; + + case 6: /* VDP */ + if ((address & 0xE700E0) == 0xC00000) + { + switch (address & 0x1F) + { + case 0x00: /* DATA */ + case 0x02: + return (vdp_data_r () >> 8); + + case 0x01: /* DATA */ + case 0x03: + return (vdp_data_r () & 0xFF); + + case 0x04: /* CTRL */ + case 0x06: + return ((m68k_read_bus_8 (address) & 0xFC) | (vdp_ctrl_r () >> 8)); + + case 0x05: /* CTRL */ + case 0x07: + return (vdp_ctrl_r () & 0xFF); + + case 0x08: /* HVC */ + case 0x0A: + case 0x0C: + case 0x0E: + return (vdp_hvc_r () >> 8); + + case 0x09: /* HVC */ + case 0x0B: + case 0x0D: + case 0x0F: + return (vdp_hvc_r () & 0xFF); + + case 0x10: /* PSG */ + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + return (m68k_lockup_r_8 (address)); + + case 0x18: /* Unused */ + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: + case 0x1F: + return (m68k_read_bus_8 (address)); + } + } + else + { + /* Unused */ + return (m68k_lockup_r_8 (address)); + } + break; + + case 2: /* Unused */ + /* Some unlicensed games have a simple protection device mapped here */ + return prot_bytes[(address>>2)&1]; + + case 3: /* Unused */ + return (m68k_read_bus_8 (address)); + + case 4: /* Unused */ + return (m68k_lockup_r_8 (address)); + } + + return -1; +} + + +unsigned int m68k_read_memory_16 (unsigned int address) +{ + switch ((address >> 21) & 7) + { + case 0: /* ROM Cartridge */ + case 1: + /* SRAM */ + if (sram.on) + { + if (address >= sram.start && address <= sram.end) + { + if (sram.custom) return (EEPROM_Read(address) & 0xffff); + return *(uint16 *)(sram.sram + ((address - sram.start) & 0xffff)); + } + } + + /* ROM Data */ + if (address < genromsize) return *(uint16 *)(cart_rom + address); + + /* j-CART */ + if (j_cart && ((address == 0x3FFFFE) || (address == 0x38FFFE))) + return (gamepad_read(5) | (gamepad_read(6) << 8)); + + /* Virtua Racing SVP */ + if (address == 0x30fe02) return 0x01; + + /* default */ + return 0x00; + + case 7: /* RAM */ + return *(uint16 *)(work_ram + (address & 0xffff)); + + case 5: /* Z80 & I/O */ + if (address <= 0xA0FFFF) /* Z80 area */ + { + if (zbusack == 1) return (m68k_read_bus_16 (address)); + else + { + uint8 temp; + switch (address & 0x6000) + { + case 0x0000: /* RAM */ + case 0x2000: + temp = zram[address & 0x1FFF]; + return (temp << 8 | temp); + + case 0x4000: /* YM2612 */ + temp = fm_read (address & 3); + return (temp << 8 | temp); + + case 0x6000: + switch (address & 0xFF00) + { + case 0x7F00: /* VDP */ + m68k_lockup_r_16 (address); + + default: /* Unused */ + return (0xFFFF); + } + break; + } + } + } + else if (address <= 0xA1001F) /* I/O */ + { + uint8 temp = io_read ((address >> 1) & 0x0F); + return (temp << 8 | temp); + } + else if (address <= 0xA1FFFF) /* CONTROL */ + { + switch ((address >> 8) & 0xFF) + { + case 0x11: /* BUSACK */ + return ((m68k_read_bus_16 (address) & 0xFEFF) | (gen_busack_r () << 8)); + + case 0x00: /* UNKNOWN (BallZ) */ + case 0x10: /* MEMORY MODE */ + case 0x12: /* RESET */ + case 0x20: /* MEGA-CD */ + case 0x40: /* TMSS */ + case 0x41: /* BOOTROM */ + case 0x50: /* SVP REGISTERS */ + return (m68k_read_bus_16 (address)); + + default: /* Unused */ + return (m68k_lockup_r_16 (address)); + } + } + else + { + /* Unused */ + return (m68k_lockup_r_16 (address)); + } + + break; + + case 6: /* VDP */ + if ((address & 0xE700E0) == 0xC00000) + { + switch (address & 0x1F) + { + case 0x00: /* DATA */ + case 0x02: + return (vdp_data_r ()); + + case 0x04: /* CTRL */ + case 0x06: + return (vdp_ctrl_r () | (m68k_read_bus_16 (address) & 0xFC00)); + + case 0x08: /* HVC */ + case 0x0A: + case 0x0C: + case 0x0E: + return (vdp_hvc_r ()); + + case 0x10: /* PSG */ + case 0x12: + case 0x14: + case 0x16: + return (m68k_lockup_r_16 (address)); + + case 0x18: /* Unused */ + case 0x1A: + case 0x1C: + case 0x1E: + return (m68k_read_bus_16 (address)); + } + } + else + { + return (m68k_lockup_r_16 (address)); + } + break; + + case 2: + case 3: + return (m68k_read_bus_16 (address)); + + case 4: + return (m68k_lockup_r_16 (address)); + } + + return (0xA5A5); +} + + +unsigned int m68k_read_memory_32 (unsigned int address) +{ + /* Split into 2 reads */ + return (m68k_read_memory_16 (address + 0) << 16 | + m68k_read_memory_16 (address + 2)); +} + + +void m68k_write_memory_8 (unsigned int address, unsigned int value) +{ + switch ((address >> 21) & 7) + { + case 7: /* RAM */ + WRITE_BYTE(work_ram, address & 0xFFFF, value); + return; + + case 6: /* VDP */ + if ((address & 0xE700E0) == 0xC00000) + { + switch (address & 0x1F) + { + case 0x00: /* DATA */ + case 0x01: + case 0x02: + case 0x03: + vdp_data_w (value << 8 | value); + return; + + case 0x04: /* CTRL */ + case 0x05: + case 0x06: + case 0x07: + vdp_ctrl_w (value << 8 | value); + return; + + case 0x08: /* HVC */ + case 0x09: + case 0x0A: + case 0x0B: + case 0x0C: + case 0x0D: + case 0x0E: + case 0x0F: + m68k_lockup_w_8 (address, value); + return; + + case 0x10: /* PSG */ + case 0x12: + case 0x14: + case 0x16: + m68k_unused_8_w (address, value); + return; + + case 0x11: /* PSG */ + case 0x13: + case 0x15: + case 0x17: + psg_write (value); + return; + + case 0x18: /* Unused */ + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: + case 0x1F: + m68k_unused_8_w (address, value); + return; + } + } + else + { + m68k_lockup_w_8 (address, value); + return; + } + + case 5: /* Z80 & IO */ + if (address <= 0xA0FFFF) /* Z80 area */ + { + if (zbusack == 1) + { + m68k_unused_8_w (address, value); + return; + } + else + { + switch (address & 0x6000) + { + case 0x0000: + case 0x2000: + zram[(address & 0x1FFF)] = value; + return; + + case 0x4000: + fm_write (address & 3, value); + return; + + case 0x6000: + switch (address & 0xFF00) + { + case 0x6000: /* BANK */ + gen_bank_w (value & 1); + return; + + case 0x7F00: /* VDP */ + m68k_lockup_w_8 (address, value); + return; + + default: /* Unused */ + m68k_unused_8_w (address, value); + return; + } + break; + } + } + } + else if (address <= 0xA1001F) /* I/O */ + { + /* I/O chip only gets /LWR */ + if (address & 1) io_write ((address >> 1) & 0x0F, value); + return; + } + else if (address <= 0xA1FFFF) /* CONTROL */ + { + switch ((address >> 8) & 0xFF) + { + case 0x11: /* BUSREQ */ + if ((address & 1) == 0) gen_busreq_w (value & 1); + else m68k_unused_8_w (address, value); + return; + + case 0x12: /* RESET */ + gen_reset_w (value & 1); + return; + + case 0x30: /* TIME */ + if (SSF2TNC) ssf2bankrom (address, value & 0xf); /* banked ROM */ + else if (address == 0xA130F1) /* banked SRAM */ + { + sram.on = value & 1; + sram.write = (value & 2) ? 0 : 1; + } + else m68k_unused_8_w (address, value); + return; + + case 0x10: /* MEMORY MODE */ + case 0x20: /* MEGA-CD */ + case 0x40: /* TMSS */ + case 0x41: /* BOOTROM */ + case 0x50: /* SVP REGISTERS */ + m68k_unused_8_w (address, value); + return; + + default: + m68k_lockup_w_8 (address, value); + return; + } + } + else + { + /* Unused */ + m68k_lockup_w_8 (address, value); + return; + } + break; + + case 0: /* ROM Cartridge */ + case 1: + + /* external SRAM */ + if (sram.on && sram.write) + { + if (address >= sram.start && address <= sram.end) + { + /* serial EEPROM */ + if (sram.custom) + { + EEPROM_Write(address, value); + return; + } + + /* normal SRAM */ + WRITE_BYTE(sram.sram, (address - sram.start) & 0xffff, value & 0xff); + return; + } + } + m68k_unused_8_w (address, value); + return; + + case 2: /* Unused */ + /* Some unlicensed games have a simple protection device mapped here */ + prot_bytes[(address>>2)&1] = value; + return; + case 3: + m68k_unused_8_w (address, value); + return; + + case 4: /* Unused */ + m68k_lockup_w_8 (address, value); + return; + } +} + + +void m68k_write_memory_16 (unsigned int address, unsigned int value) +{ + switch ((address >> 21) & 7) + { + case 7: /* Work RAM */ + *(uint16 *)(work_ram + (address& 0xFFFF)) = value & 0xffff; + return; + + case 6: /* VDP */ + if ((address & 0xE700E0) == 0xC00000) + { + switch (address & 0x1C) + { + case 0x00: /* DATA */ + vdp_data_w (value); + return; + + case 0x04: /* CTRL */ + vdp_ctrl_w (value); + return; + + case 0x08: /* HV counter */ + case 0x0C: /* HV counter */ + m68k_lockup_w_16 (address, value); + return; + + case 0x10: /* PSG */ + case 0x14: /* PSG */ + psg_write (value & 0xFF); + return; + + case 0x18: /* Unused */ + case 0x1C: /* Unused */ + m68k_unused_8_w (address, value); + return; + } + } + else + { + /* Invalid address */ + m68k_lockup_w_16 (address, value); + } + break; + + case 5: /* Z80 area, I/O chip, miscellaneous. */ + if (address <= 0xA0FFFF) /* Z80 area */ + { + /* Writes are ignored when the Z80 hogs the Z-bus */ + if (zbusack == 1) + { + m68k_unused_8_w (address, value); + return; + } + + /* Write into Z80 address space */ + switch (address & 0x6000) + { + case 0x0000: /* Work RAM */ + case 0x2000: /* Work RAM */ + zram[(address & 0x1FFF)] = (value >> 8) & 0xFF; + return; + + case 0x4000: /* YM2612 */ + fm_write (address & 3, (value >> 8) & 0xFF); + return; + + case 0x6000: /* Bank register and VDP */ + switch (address & 0x7F00) + { + case 0x6000: /* Bank register */ + gen_bank_w ((value >> 8) & 1); + return; + + case 0x7F00: /* VDP registers */ + m68k_lockup_w_16 (address, value); + return; + + default: /* Unused */ + m68k_unused_8_w (address, value); + return; + } + break; + } + } + else if (address <= 0xA1001F) /* I/O */ + { + io_write ((address >> 1) & 0x0F, value & 0x00FF); + return; + } + else if (address <= 0xA1FFFF) /* CONTROL */ + { + switch ((address >> 8) & 0xFF) + { + case 0x11: /* BUSREQ */ + gen_busreq_w ((value >> 8) & 1); + return; + + case 0x12: /* RESET */ + gen_reset_w ((value >> 8) & 1); + return; + + case 0x30: /* TIME */ + if (SSF2TNC) ssf2bankrom (address, value & 0xf); /* banked ROM */ + else if (address == 0xA130F1) /* banked SRAM */ + { + sram.on = value & 1; + sram.write = (value & 2) ? 0 : 1; + } + else m68k_unused_16_w (address, value); + return; + + case 0x10: /* MEMORY MODE */ + case 0x20: /* MEGA-CD */ + case 0x40: /* TMSS */ + case 0x41: /* BOOTROM */ + case 0x50: /* SVP REGISTERS */ + m68k_unused_16_w (address, value); + return; + + default: /* Unused */ + m68k_lockup_w_16 (address, value); + return; + } + } + else + { + m68k_lockup_w_16 (address, value); + return; + } + + break; + + case 0: /* Cartridge ROM */ + case 1: + /* J-CART extension (TH signal) */ + if ((address == 0x3FFFFE) || (address == 0x38FFFE)) + { + if (!j_cart) + { + j_cart = 1; + input_reset(pad_type); + } + gamepad_write(5, (value&1) <<6 ); + gamepad_write(6, (value&1) <<6); + return; + } + + /* external SRAM */ + if (sram.on && sram.write) + { + if (address >= sram.start && address <= sram.end) + { + /* serial EEPROM */ + if (sram.custom) + { + EEPROM_Write(address, value); + return; + } + + /* normal SRAM */ + *(uint16 *)(sram.sram + ((address - sram.start) & 0xffff)) = value & 0xffff; + return; + } + } + m68k_unused_16_w (address, value); + return; + + case 2: /* Unused */ + case 3: + m68k_unused_16_w (address, value); + return; + + case 4: /* Unused */ + m68k_lockup_w_16 (address, value); + return; + } +} + + +void m68k_write_memory_32 (unsigned int address, unsigned int value) +{ + /* Split into 2 writes */ + m68k_write_memory_16 (address, (value >> 16) & 0xFFFF); + m68k_write_memory_16 (address + 2, value & 0xFFFF); +} diff --git a/source/mem68k.h b/source/mem68k.h new file mode 100644 index 0000000..af23e68 --- /dev/null +++ b/source/mem68k.h @@ -0,0 +1,14 @@ + +#ifndef _MEM68K_H_ +#define _MEM68K_H_ + +/* Function prototypes */ +unsigned int m68k_read_bus_8 (unsigned int address); +unsigned int m68k_read_bus_16 (unsigned int address); +void m68k_unused_w (unsigned int address, unsigned int value); +void m68k_lockup_w_8 (unsigned int address, unsigned int value); +void m68k_lockup_w_16 (unsigned int address, unsigned int value); +unsigned int m68k_lockup_r_8 (unsigned int address); +unsigned int m68k_lockup_r_16 (unsigned int address); + +#endif /* _MEM68K_H_ */ diff --git a/source/membnk.c b/source/membnk.c new file mode 100644 index 0000000..af84dcd --- /dev/null +++ b/source/membnk.c @@ -0,0 +1,296 @@ +/* + membnk.c -- + Memory handlers Z80 access to the banked V-bus address space. +*/ + +#include "shared.h" + + +void z80_write_banked_memory(unsigned int address, unsigned int data) +{ + switch((address >> 21) & 7) + { + case 0: /* Cartridge ROM */ + case 1: + z80bank_unused_w(address, data); + return; + + case 2: /* Unused */ + case 3: + z80bank_unused_w(address, data); + return; + + case 4: /* Unused (lockup) */ + z80bank_lockup_w(address, data); + return; + + case 5: /* Z80, I/O chip, etc. */ + if(address <= 0xA0FFFF) + { + z80bank_lockup_w(address, data); + return; + } + else + { + switch((address >> 8) & 0xFF) + { + case 0x00: /* I/O chip */ + if(address <= 0xA1001F) io_write((address >> 1) & 0x0F, data); + else z80bank_unused_w(address, data); + return; + + case 0x11: /* /BUSREQ */ + if (address & 1) z80bank_unused_w (address, data); + else gen_busreq_w (data & 1); + return; + + case 0x12: /* /RESET (w) */ + if (address & 1) z80bank_unused_w (address, data); + else gen_reset_w (data & 1); + return; + + case 0x10: /* MEMORY MODE */ + case 0x13: /* TIME */ + case 0x20: /* ? */ + case 0x30: /* ? */ + z80bank_unused_w(address, data); + return; + + default: /* Invalid */ + z80bank_lockup_w(address, data); + return; + } + } + return; + + case 6: /* VDP */ + z80bank_vdp_w(address, data); + return; + + case 7: /* Work RAM */ + WRITE_BYTE(work_ram, address & 0xFFFF, data); + return; + } +} + + +int z80_read_banked_memory(unsigned int address) +{ + switch((address >> 21) & 7) + { + case 0: /* Cartridge ROM */ + case 1: + return READ_BYTE(cart_rom, address); + + case 2: /* Unused */ + case 3: + return z80bank_unused_r(address); + + case 4: /* Unused (lockup) */ + return z80bank_lockup_r(address); + + case 5: /* Z80, I/O chip, etc.*/ + if (address <= 0xA0FFFF) return z80bank_lockup_r (address); + else + { + switch((address >> 8) & 0xFF) + { + case 0x00: /* I/O chip */ + if (address <= 0xA1001F) return io_read((address >> 1) & 0x0F); + else return z80bank_unused_r (address); + break; + + case 0x11: /* /BUSACK from Z80 */ + /* The Z80 can't read this bit (it would be halted + when the bit was zero) so we always return '1'. */ + return 0xFF; + + case 0x10: /* Unused */ + case 0x12: /* Unused */ + case 0x13: /* /TIME region */ + case 0x20: /* Unused */ + case 0x30: /* Unused */ + return z80bank_unused_r(address); + + default: /* Lockup */ + return z80bank_lockup_r(address); + } + } + break; + + case 6: /* VDP */ + return z80bank_vdp_r(address); + + case 7: /* Work RAM - can't be read on some Genesis models (!) */ + return 0xFF; + } + + return (-1); +} + + +void z80bank_vdp_w(int address, int data) +{ + if((address & 0xE700E0) == 0xC00000) + { + switch(address & 0x1F) + { + case 0x00: /* Data port */ + case 0x01: + case 0x02: + case 0x03: + vdp_data_w(data << 8 | data); + return; + + case 0x04: /* Control port */ + case 0x05: + case 0x06: + case 0x07: + vdp_ctrl_w(data << 8 | data); + return; + + case 0x08: /* Lockup (HVC) */ + case 0x09: + case 0x0A: + case 0x0B: + case 0x0C: + case 0x0D: + case 0x0E: + case 0x0F: + z80bank_lockup_w(address, data); + return; + + case 0x10: /* Unused */ + case 0x12: + case 0x14: + case 0x16: + z80bank_unused_w(address, data); + return; + + case 0x11: /* PSG */ + case 0x13: + case 0x15: + case 0x17: + psg_write(data); + return; + + case 0x18: /* Unused */ + case 0x19: + case 0x1A: + case 0x1B: + z80bank_unused_w(address, data); + return; + + case 0x1C: /* Test register */ + case 0x1D: + case 0x1E: + case 0x1F: + vdp_test_w(data << 8 | data); + return; + } + } + else + { + /* Invalid VDP address */ + z80bank_lockup_w(address, data); + return; + } +} + + +int z80bank_vdp_r(int address) +{ + if((address & 0xE700E0) == 0xC00000) + { + switch(address & 0x1F) + { + case 0x00: /* Data */ + case 0x02: + return (vdp_data_r() >> 8) & 0xFF; + + case 0x01: /* Data */ + case 0x03: + return vdp_data_r() & 0xFF; + + case 0x04: /* Control */ + case 0x06: + return (0xFC | (vdp_ctrl_r() >> 8)) & 0xFF; + + case 0x05: /* Control */ + case 0x07: + return vdp_ctrl_r() & 0xFF; + + case 0x08: /* HVC */ + case 0x0A: + case 0x0C: + case 0x0E: + return (vdp_hvc_r() >> 8) & 0xFF; + + case 0x09: /* HVC */ + case 0x0B: + case 0x0D: + case 0x0F: + return vdp_hvc_r() & 0xFF; + + case 0x10: /* Lockup */ + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + return z80bank_lockup_r(address); + + case 0x18: /* Unused */ + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: + case 0x1F: + return (z80bank_unused_r(address) | 0xFF); + } + } + else + { + /* Invalid VDP address */ + return z80bank_lockup_r(address); + } + + return 0xFF; +} + + + + +/* + Handlers for access to unused addresses and those which make the + machine lock up. +*/ +void z80bank_unused_w(int address, int data) +{ + error("Z80 bank unused write %06X = %02X (%04X)\n", address, data, z80_get_reg(Z80_PC)); +} + +int z80bank_unused_r(int address) +{ + error("Z80 bank unused read %06X (%04X)\n", address, z80_get_reg(Z80_PC)); + return (address & 1) ? 0x00 : 0xFF; +} + +void z80bank_lockup_w(int address, int data) +{ + error("Z80 bank lockup write %06X = %02X (%04X)\n", address, data, z80_get_reg(Z80_PC)); + gen_running = 0; + z80_end_timeslice(); +} + +int z80bank_lockup_r(int address) +{ + error("Z80 bank lockup read %06X (%04X)\n", address, z80_get_reg(Z80_PC)); + gen_running = 0; + z80_end_timeslice(); + return 0xFF; +} diff --git a/source/membnk.h b/source/membnk.h new file mode 100644 index 0000000..70e8e38 --- /dev/null +++ b/source/membnk.h @@ -0,0 +1,15 @@ + +#ifndef _MEMBNK_H_ +#define _MEMBNK_H_ + +/* Function prototypes */ +void z80_write_banked_memory (unsigned int address, unsigned int data); +int z80_read_banked_memory (unsigned int address); +void z80bank_vdp_w (int address, int data); +int z80bank_vdp_r (int address); +void z80bank_unused_w (int address, int data); +int z80bank_unused_r (int address); +void z80bank_lockup_w (int address, int data); +int z80bank_lockup_r (int address); + +#endif /* _MEMBNK_H_ */ diff --git a/source/memvdp.c b/source/memvdp.c new file mode 100644 index 0000000..a85fe35 --- /dev/null +++ b/source/memvdp.c @@ -0,0 +1,48 @@ +/* + memvdp.c -- + Memory handlers for when the VDP reads the V-bus during DMA. +*/ + +#include "shared.h" + +unsigned int vdp_dma_r(unsigned int address) +{ + switch((address >> 21) & 7) + { + case 0: /* Cartridge ROM */ + case 1: + return *(uint16 *)(cart_rom + address); + + case 2: /* Unused */ + case 3: + return 0xFF00; + + case 4: /* Work RAM */ + case 6: + case 7: + return *(uint16 *)(work_ram + (address & 0xffff)); + + case 5: /* Z80 area and I/O chip */ + /* Z80 area always returns $FFFF */ + if(address <= 0xA0FFFF) + { + /* Return $FFFF only when the Z80 isn't hogging the Z-bus. + (e.g. Z80 isn't reset and 68000 has the bus) */ + return (zbusack == 0) ? 0xFFFF : *(uint16 *)(work_ram + (address & 0xffff)); + } + + /* The I/O chip and work RAM try to drive the data bus which + results in both values being combined in random ways when read. + We return the I/O chip values which seem to have precedence, */ + else if (address <= 0xA1001F) + { + uint8 temp = io_read((address >> 1) & 0x0F); + return (temp << 8 | temp); + } + /* All remaining locations access work RAM */ + else return *(uint16 *)(work_ram + (address & 0xffff)); + } + + return -1; +} + diff --git a/source/memvdp.h b/source/memvdp.h new file mode 100644 index 0000000..365301f --- /dev/null +++ b/source/memvdp.h @@ -0,0 +1,8 @@ + +#ifndef _MEMVDP_H_ +#define _MEMVDP_H_ + +/* Function prototypes */ +unsigned int vdp_dma_r (unsigned int address); + +#endif /* _MEMVDP_H_ */ diff --git a/source/memz80.c b/source/memz80.c new file mode 100644 index 0000000..86d0e48 --- /dev/null +++ b/source/memz80.c @@ -0,0 +1,246 @@ +/* + memz80.c -- + Memory handlers for Z80 memory and port access, and the Z80 to + VDP interface. +*/ + +#define LOG_PORT 0 /* 1= Log Z80 I/O port accesses */ + +#include "shared.h" + + +unsigned int cpu_readmem16(unsigned int address) +{ + switch((address >> 13) & 7) + { + case 0: /* Work RAM */ + case 1: + return zram[address & 0x1FFF]; + + case 2: /* YM2612 */ + return fm_read(address & 3); + + case 3: /* VDP */ + if ((address & 0xFF00) == 0x7F00) return z80_vdp_r (address); + return 0xFF; + + default: /* V-bus bank */ + return z80_read_banked_memory(zbank | (address & 0x7FFF)); + } + + return 0xFF; +} + + +void cpu_writemem16(unsigned int address, unsigned int data) +{ + switch((address >> 13) & 7) + { + case 0: /* Work RAM */ + case 1: + zram[address & 0x1FFF] = data; + return; + + case 2: /* YM2612 */ + fm_write(address & 3, data); + return; + + case 3: /* Bank register and VDP */ + switch(address & 0xFF00) + { + case 0x6000: + gen_bank_w(data & 1); + return; + + case 0x7F00: + z80_vdp_w(address, data); + return; + + default: + z80_unused_w(address, data); + return; + } + return; + + default: /* V-bus bank */ + z80_write_banked_memory(zbank | (address & 0x7FFF), data); + return; + } +} + + +int z80_vdp_r(int address) +{ + switch(address & 0xFF) + { + case 0x00: /* VDP data port */ + case 0x02: + return (vdp_data_r() >> 8) & 0xFF; + + case 0x01: /* VDP data port */ + case 0x03: + return (vdp_data_r() & 0xFF); + + case 0x04: /* VDP control port */ + case 0x06: + return (0xFF | ((vdp_ctrl_r() >> 8) & 3)); + + case 0x05: /* VDP control port */ + case 0x07: + return (vdp_ctrl_r() & 0xFF); + + case 0x08: /* HV counter */ + case 0x0A: + case 0x0C: + case 0x0E: + return (vdp_hvc_r() >> 8) & 0xFF; + + case 0x09: /* HV counter */ + case 0x0B: + case 0x0D: + case 0x0F: + return (vdp_hvc_r() & 0xFF); + + case 0x10: /* Unused (PSG) */ + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + return z80_lockup_r(address); + + case 0x18: /* Unused */ + case 0x19: + case 0x1A: + case 0x1B: + return z80_unused_r(address); + + case 0x1C: /* Unused (test register) */ + case 0x1D: + case 0x1E: + case 0x1F: + return z80_unused_r(address); + + default: /* Invalid VDP addresses */ + return z80_lockup_r(address); + } + + return 0xFF; +} + + +void z80_vdp_w(int address, int data) +{ + switch(address & 0xFF) + { + case 0x00: /* VDP data port */ + case 0x01: + case 0x02: + case 0x03: + vdp_data_w(data << 8 | data); + return; + + case 0x04: /* VDP control port */ + case 0x05: + case 0x06: + case 0x07: + vdp_ctrl_w(data << 8 | data); + return; + + case 0x08: /* Unused (HV counter) */ + case 0x09: + case 0x0A: + case 0x0B: + case 0x0C: + case 0x0D: + case 0x0E: + case 0x0F: + z80_lockup_w(address, data); + return; + + case 0x11: /* PSG */ + case 0x13: + case 0x15: + case 0x17: + psg_write(data); + return; + + case 0x10: /* Unused */ + case 0x12: + case 0x14: + case 0x16: + case 0x18: + case 0x19: + case 0x1A: + case 0x1B: + z80_unused_w(address, data); + return; + + case 0x1C: /* Test register */ + case 0x1D: + case 0x1E: + case 0x1F: + vdp_test_w(data << 8 | data); + return; + + default: /* Invalid VDP addresses */ + z80_lockup_w(address, data); + return; + } +} + + +/* + Port handlers. Ports are unused when not in Mark III compatability mode. + + Games that access ports anyway: + - Thunder Force IV reads port $BF in it's interrupt handler. +*/ + +unsigned int cpu_readport16(unsigned int port) +{ +#if LOG_PORT + error("Z80 read port %04X (%04X)\n", port, z80_get_reg(Z80_PC)); +#endif + return 0xFF; +} + +void cpu_writeport16(unsigned int port, unsigned int data) +{ +#if LOG_PORT + error("Z80 write %02X to port %04X (%04X)\n", data, port, z80_get_reg(Z80_PC)); +#endif +} + + +/* + Handlers for access to unused addresses and those which make the + machine lock up. +*/ +void z80_unused_w(int address, int data) +{ + error("Z80 unused write %04X = %02X (%04X)\n", address, data, z80_get_reg(Z80_PC)); +} + +int z80_unused_r(int address) +{ + error("Z80 unused read %04X (%04X)\n", address, z80_get_reg(Z80_PC)); + return 0xFF; +} + +void z80_lockup_w(int address, int data) +{ + error("Z80 lockup write %04X = %02X (%04X)\n", address, data, z80_get_reg(Z80_PC)); + gen_running = 0; + z80_end_timeslice(); +} + +int z80_lockup_r(int address) +{ + error("Z80 lockup read %04X (%04X)\n", address, z80_get_reg(Z80_PC)); + gen_running = 0; + z80_end_timeslice(); + return 0xFF; +} diff --git a/source/memz80.h b/source/memz80.h new file mode 100644 index 0000000..5c3ad0a --- /dev/null +++ b/source/memz80.h @@ -0,0 +1,17 @@ + +#ifndef _MEMZ80_H_ +#define _MEMZ80_H_ + +/* Function prototypes */ +unsigned int cpu_readmem16 (unsigned int address); +void cpu_writemem16 (unsigned int address, unsigned int data); +unsigned int cpu_readport16 (unsigned int port); +void cpu_writeport16 (unsigned int port, unsigned int data); +void z80_unused_w (int address, int data); +int z80_unused_r (int address); +void z80_lockup_w (int address, int data); +int z80_lockup_r (int address); +int z80_vdp_r (int address); +void z80_vdp_w (int address, int data); + +#endif /* _MEMZ80_H_ */ diff --git a/source/ngc/gcaram.c b/source/ngc/gcaram.c new file mode 100644 index 0000000..b29c1a0 --- /dev/null +++ b/source/ngc/gcaram.c @@ -0,0 +1,85 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ***************************************************************************/ +#include "shared.h" + +#define ARAMSTART 0x8000 + +/** + * Nintendo GameCube ARAM Wrapper for libOGC aram.c + * + * This is an often overlooked area of ~16Mb extra RAM + * It's use in Genesis Plus is to shadow the ROM. + * Actually, only SSF2TNC needs shadowing, but it's always + * Good to know :) + */ + +#define ARAM_READ 1 +#define ARAM_WRITE 0 + +/** + * StartARAM + * This simply sets up the call to internal libOGC. + * Passing NULL for array list, and 0 items to allocate. + * Required so libOGC knows to handle any interrupts etc. + */ +void +StartARAM () +{ + AR_Init (NULL, 0); +} + +/** + * ARAMPut + * + * Move data from MAIN memory to ARAM + */ +void +ARAMPut (char *src, char *dst, int len) +{ + DCFlushRange (src, len); + AR_StartDMA( ARAM_WRITE, (u32)src, (u32)dst, len); + while (AR_GetDMAStatus()); +} + +/** + * ARAMFetch + * + * This function will move data from ARAM to MAIN memory + */ +void +ARAMFetch (char *dst, char *src, int len) +{ + DCInvalidateRange(dst, len); + AR_StartDMA( ARAM_READ, (u32) dst, (u32) src, len); + while (AR_GetDMAStatus()); +} + +/** + * ShadowROM + * Copy the rom from cart_rom into ARAM + * NB: libOGC appears to use the first 0x4000 bytes. + * As there's plenty left, all ARAM addresses are 0x8000 based. + * Here, the ROM is simply copied in one swift movement :) + */ +void +ShadowROM () +{ + ARAMPut (cart_rom, (void *) ARAMSTART, genromsize); +} diff --git a/source/ngc/gcaram.h b/source/ngc/gcaram.h new file mode 100644 index 0000000..b4cd8c0 --- /dev/null +++ b/source/ngc/gcaram.h @@ -0,0 +1,25 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ***************************************************************************/ + +extern void StartARAM (); +void ShadowROM (); +void ARAMFetch (char *src, char *dst, int len); +void ARAMPut (char *src, char *dst, int len); + diff --git a/source/ngc/gui/confjoy.c b/source/ngc/gui/confjoy.c new file mode 100644 index 0000000..01fb9c3 --- /dev/null +++ b/source/ngc/gui/confjoy.c @@ -0,0 +1,208 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * NGC - Joypad Configuration + ***************************************************************************/ +#include + +extern int domenu (char items[][20], int maxitems); +extern unsigned short gcpadmap[]; +extern int menu; +extern char menutitle[]; +extern int padcal; +extern void reloadrom(); + +int configpadcount = 11; +char padmenu[11][20] = { + {"Genesis A - B"}, + {"Genesis B - A"}, + {"Genesis C - X"}, + {"Genesis X - TL"}, + {"Genesis Y - Y"}, + {"Genesis Z - TR"}, + {"Analog - 70"}, + {"Type - 3BUTTONS"}, + {"PortA - GAMEPAD"}, + {"PortB - GAMEPAD"}, + {" Exit Config "} +}; + +uint8 mpads[6] = {0, 1, 2, 3, 4, 5 }; /*** Default Mapping ***/ +uint8 sys_type[2] = {0,0}; +uint8 old_sys_type[2] = {0,0}; + +/**************************************************************************** + * UpdatePadMaps + ****************************************************************************/ +void UpdatePadMaps (uint8 padvalue, int padnum) +{ + padmenu[padnum][15] = ' '; + padmenu[padnum][16] = ' '; + switch (padvalue) + { + case 0: + gcpadmap[padnum] = PAD_BUTTON_B; + padmenu[padnum][16] = 'B'; + break; + + case 1: + gcpadmap[padnum] = PAD_BUTTON_A; + padmenu[padnum][16] = 'A'; + break; + + case 2: + gcpadmap[padnum] = PAD_BUTTON_X; + padmenu[padnum][16] = 'X'; + break; + + case 3: + gcpadmap[padnum] = PAD_TRIGGER_R; + padmenu[padnum][15] = 'T'; + padmenu[padnum][16] = 'R'; + break; + + case 4: + gcpadmap[padnum] = PAD_BUTTON_Y; + padmenu[padnum][16] = 'Y'; + break; + + case 5: + gcpadmap[padnum] = PAD_TRIGGER_L; + padmenu[padnum][15] = 'T'; + padmenu[padnum][16] = 'L'; + break; + } +} + +/**************************************************************************** + * ConfigureJoypads + ****************************************************************************/ +void ConfigureJoypads () +{ + int ret; + int quit = 0; + int prevmenu = menu; + + strcpy (menutitle, ""); + + if (pad_type) sprintf (padmenu[7], "Type - 6BUTTONS"); + else sprintf (padmenu[7], "Type - 3BUTTONS"); + + if (input.system[1] == SYSTEM_MENACER) sprintf (padmenu[8], "PortA - NONE"); + else if (sys_type[0] == 0) sprintf (padmenu[8], "PortA - GAMEPAD"); + else if (sys_type[0] == 1) sprintf (padmenu[8], "PortA - MULTITAP"); + else if (sys_type[0] == 2) sprintf (padmenu[8], "PortA - NONE"); + + if (input.system[1] == SYSTEM_MENACER) sprintf (padmenu[9], "PortB - MENACER"); + else if (sys_type[1] == 0) sprintf (padmenu[9], "PortB - GAMEPAD"); + else if (sys_type[1] == 1) sprintf (padmenu[9], "PortB - MULTITAP"); + else if (sys_type[1] == 2) sprintf (padmenu[9], "PortB - NONE"); + + menu = 0; + while (quit == 0) + { + ret = domenu (&padmenu[0], configpadcount); + switch (ret) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + mpads[ret]++; + if (mpads[ret] > 5) mpads[ret] = 0; + UpdatePadMaps (mpads[ret], ret); + break; + + case 6: /*** Pad calibrate analog ***/ + case -8: + if (ret>0) padcal += 2; + else padcal -= 2; + if (padcal > 90) padcal = 0; + if (padcal < 0) padcal = 90; + sprintf (padmenu[6], "Analog - %02d", padcal); + break; + + case 7: + pad_type ^= 1; + if (pad_type) sprintf (padmenu[7], "Type - 6BUTTONS"); + else sprintf (padmenu[7], "Type - 3BUTTONS"); + system_reset(); + break; + + case 8: + if (input.system[1] == SYSTEM_MENACER) break; + sys_type[0] ++; + if (sys_type[0] > 2) sys_type[0] = 0; + + if (sys_type[0] == 0) + { + input.system[0] = SYSTEM_GAMEPAD; + sprintf (padmenu[8], "PortA - GAMEPAD"); + } + else if (sys_type[0] == 1) + { + input.system[0] = SYSTEM_TEAMPLAYER; + sprintf (padmenu[8], "PortA - MULTITAP"); + } + else if (sys_type[0] == 2) + { + input.system[0] = NO_SYSTEM; + sprintf (padmenu[8], "PortA - NONE"); + } + break; + + case 9: + if (input.system[1] == SYSTEM_MENACER) break; + sys_type[1] ++; + if (sys_type[1] > 2) sys_type[1] = 0; + + if (sys_type[1] == 0) + { + input.system[1] = SYSTEM_GAMEPAD; + sprintf (padmenu[9], "PortB - GAMEPAD"); + } + else if (sys_type[1] == 1) + { + input.system[1] = SYSTEM_TEAMPLAYER; + sprintf (padmenu[9], "PortB - MULTITAP"); + } + else if (sys_type[1] == 2) + { + input.system[1] = NO_SYSTEM; + sprintf (padmenu[9], "PortB - NONE"); + } + break; + + case 10: + case -1: + if ((old_sys_type[0] != sys_type[0]) || (old_sys_type[1] != sys_type[1])) + { + old_sys_type[0] = sys_type[0]; + old_sys_type[1] = sys_type[1]; + system_reset(); + } + quit = 1; + break; + } + } + + menu = prevmenu; +} diff --git a/source/ngc/gui/dkpro.h b/source/ngc/gui/dkpro.h new file mode 100644 index 0000000..fb9cf82 --- /dev/null +++ b/source/ngc/gui/dkpro.h @@ -0,0 +1,877 @@ +/******************************************************************* + * Image File : /public/dkpro.bmp + * Width : 218 + * Height : 65 + * + * This header contains a compressed Zip image. + * Use zlib1.2.3 uncompress function to restore. + *******************************************************************/ + +#define dkpro_RAW 28340 +#define dkpro_COMPRESSED 6887 +#define dkpro_WIDTH 218 +#define dkpro_HEIGHT 65 + +unsigned char dkpro[6887] = { + 0x78, 0xda, 0xed, 0x9c, 0x67, 0x70, 0x54, 0x57, 0x96, 0xc7, 0xf9, 0xb8, + 0xb5, 0x55, 0xbb, 0x55, + 0x53, 0xb5, 0xb5, 0xb3, 0x9e, 0x31, 0xc6, 0x98, 0x20, 0x31, 0xf6, 0x38, + 0x7b, 0xc6, 0x33, 0x0e, + 0xe3, 0x34, 0x60, 0x03, 0x36, 0xc9, 0x80, 0x49, 0xb6, 0x41, 0x42, 0x59, + 0x42, 0x39, 0x20, 0x75, + 0xbf, 0xd3, 0x92, 0x90, 0x84, 0x32, 0x41, 0x02, 0x11, 0xd4, 0x48, 0xe4, + 0x60, 0x72, 0x0e, 0x22, + 0x98, 0x8c, 0x8d, 0x04, 0x26, 0x83, 0x31, 0xe0, 0xec, 0x71, 0x06, 0xe7, + 0xa0, 0xfd, 0xdd, 0xdb, + 0xdd, 0xaf, 0x5f, 0xb7, 0xba, 0x07, 0x30, 0xc6, 0xf6, 0x87, 0xd6, 0xbf, + 0x1e, 0xb4, 0x6e, 0x38, + 0xf7, 0xe4, 0x7b, 0xee, 0x7b, 0x4f, 0xdd, 0x4e, 0xda, 0x5d, 0x1d, 0xaa, + 0xc3, 0x52, 0xba, 0x38, + 0x3b, 0x46, 0x75, 0x70, 0xb6, 0x8f, 0xbd, 0xb1, 0xfe, 0xc6, 0xf8, 0x3f, + 0x3a, 0x6f, 0x8c, 0x6f, + 0xef, 0xbc, 0x29, 0xb6, 0x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, + 0xdd, 0xe0, 0xbc, 0x21, + 0x31, 0x74, 0x5d, 0xdb, 0xd5, 0xa1, 0xaa, 0x5d, 0x7a, 0x20, 0x9b, 0x85, + 0xcd, 0xea, 0x34, 0x7a, + 0x4d, 0x61, 0x6b, 0xee, 0xe7, 0xc6, 0x67, 0xf2, 0x99, 0x7c, 0x4e, 0xdc, + 0x9c, 0x93, 0x72, 0xe2, + 0x69, 0x08, 0x96, 0x19, 0x75, 0x19, 0x8c, 0xc4, 0x76, 0x03, 0x24, 0x81, + 0xac, 0xf9, 0x9d, 0x7c, + 0x21, 0x9f, 0x69, 0x7c, 0x65, 0x04, 0xaf, 0x34, 0x43, 0xb8, 0x3a, 0xac, + 0x99, 0xdc, 0x21, 0xb9, + 0x6d, 0xdd, 0xd1, 0x35, 0xb5, 0xc3, 0xc4, 0xe6, 0x94, 0xef, 0xed, 0x9f, + 0x88, 0xc2, 0x25, 0x62, + 0xac, 0x51, 0x86, 0x62, 0x89, 0xc8, 0xab, 0xc0, 0x48, 0x79, 0x4e, 0xc6, + 0xca, 0x19, 0xec, 0xf6, + 0xa9, 0x7c, 0x12, 0xc2, 0xcf, 0x05, 0xea, 0x8a, 0x39, 0x35, 0x1d, 0x92, + 0xda, 0xc6, 0x58, 0x97, + 0xc8, 0x23, 0xf2, 0x95, 0xfd, 0x43, 0x51, 0xf8, 0x42, 0x8e, 0x92, 0x0f, + 0x87, 0x73, 0x45, 0x5d, + 0x35, 0x46, 0x92, 0x45, 0x17, 0x90, 0x1d, 0x3f, 0x96, 0x0f, 0x43, 0xf8, + 0x79, 0x60, 0x7c, 0x21, + 0x8d, 0x35, 0x37, 0x27, 0xf9, 0xd7, 0xf6, 0xed, 0x27, 0xee, 0x4e, 0xbd, + 0x64, 0x7f, 0x5f, 0xde, + 0x67, 0xff, 0xfa, 0x5a, 0x56, 0x90, 0x0d, 0x47, 0x4b, 0xec, 0x4f, 0x44, + 0x8c, 0x3c, 0x2f, 0x42, + 0xa4, 0xaa, 0x5a, 0x32, 0x84, 0x6b, 0xc3, 0x87, 0x58, 0xe4, 0x7d, 0xe3, + 0x73, 0x69, 0xf0, 0xb3, + 0x99, 0xaa, 0x15, 0xe7, 0x17, 0x7c, 0x99, 0xf7, 0xae, 0xbc, 0x2b, 0xef, + 0x11, 0x8b, 0x33, 0x89, + 0xb0, 0x38, 0x89, 0xbf, 0x26, 0x44, 0x63, 0x37, 0xb5, 0xcb, 0x85, 0x70, + 0x2d, 0x18, 0x28, 0x47, + 0x88, 0xa1, 0x77, 0x8d, 0x4f, 0xc5, 0xe9, 0x67, 0xb3, 0x9b, 0xa7, 0x66, + 0xc4, 0x7d, 0x61, 0x7f, + 0xdb, 0xf1, 0x16, 0xe7, 0xad, 0xcf, 0x64, 0xaa, 0x44, 0x48, 0xa2, 0x24, + 0x5d, 0x33, 0x12, 0x43, + 0xb8, 0x66, 0x8c, 0x94, 0x63, 0xc4, 0xd1, 0x5b, 0xc6, 0x47, 0x52, 0x6f, + 0xb5, 0x59, 0x75, 0x97, + 0xd4, 0xbf, 0x95, 0x5f, 0x4c, 0xbf, 0x60, 0x9c, 0x97, 0xf3, 0xd8, 0x74, + 0x16, 0x95, 0x44, 0x4a, + 0x08, 0xbf, 0x11, 0x44, 0xc9, 0x6b, 0xf2, 0x96, 0x9c, 0x37, 0x3e, 0x90, + 0xe9, 0x35, 0x1d, 0x4d, + 0x9b, 0x85, 0x3b, 0x3b, 0x8e, 0xde, 0xe6, 0x78, 0xdb, 0x7e, 0x56, 0xce, + 0x62, 0xd1, 0xd5, 0xec, + 0x46, 0x69, 0x57, 0x81, 0x74, 0x13, 0x69, 0xd7, 0x1d, 0xe9, 0x57, 0xb9, + 0x5a, 0xaa, 0xbe, 0x52, + 0xaf, 0x61, 0x95, 0xf4, 0x5f, 0x54, 0xbe, 0x40, 0x88, 0x91, 0x43, 0x44, + 0xd2, 0x59, 0xe3, 0x5d, + 0x99, 0x66, 0xb1, 0xd9, 0x2d, 0x75, 0xa9, 0x71, 0x1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 0x6e, 0xa2, 0x55, 0xda, 0xe3, 0xf9, 0x81, 0x66, 0x78, 0xe7, 0xfd, 0x34, + 0x14, 0xc3, 0xfb, 0x48, + 0x59, 0x21, 0xdf, 0x9a, 0x6b, 0x7d, 0x45, 0x5e, 0xb8, 0x87, 0xd6, 0x60, + 0x34, 0xf3, 0xc8, 0x9c, + 0x1f, 0x11, 0x69, 0x17, 0xdd, 0x50, 0x36, 0x8b, 0xd0, 0x12, 0xa6, 0xd0, + 0xe7, 0xe5, 0xfa, 0x12, + 0x67, 0x9b, 0xfb, 0x89, 0x98, 0x22, 0xdd, 0x97, 0x43, 0xae, 0xb4, 0x4a, + 0x14, 0x1c, 0xad, 0x64, + 0xea, 0x61, 0x78, 0xd2, 0xb8, 0x9f, 0x20, 0x4b, 0xb1, 0x45, 0x2b, 0x97, + 0x87, 0x21, 0x3b, 0xd8, + 0x75, 0x0e, 0x18, 0x87, 0xa5, 0xb2, 0x16, 0x9b, 0x55, 0x87, 0xa5, 0xdc, + 0x56, 0x71, 0x32, 0x75, + 0xaf, 0xec, 0x25, 0xde, 0x97, 0xb2, 0x7e, 0x69, 0x50, 0x94, 0x81, 0x52, + 0x19, 0x2f, 0x25, 0x7a, + 0xad, 0x12, 0x3e, 0x95, 0x92, 0xd1, 0x93, 0xd0, 0xa2, 0xf7, 0x9e, 0x58, + 0xab, 0x74, 0x44, 0x8b, + 0xae, 0x91, 0xbe, 0x33, 0xc6, 0xb9, 0x65, 0x73, 0xcd, 0xf3, 0x8c, 0x08, + 0xbe, 0x8e, 0xff, 0x88, + 0x32, 0x68, 0x44, 0xc1, 0xe1, 0x25, 0x73, 0xad, 0xcf, 0x90, 0xe3, 0x7e, + 0xe8, 0x05, 0xa3, 0x95, + 0x0f, 0x6f, 0xff, 0x72, 0x3f, 0x13, 0x72, 0xd9, 0x4c, 0xd5, 0x91, 0x6a, + 0x6c, 0x06, 0x36, 0xfb, + 0xc6, 0xa4, 0xf3, 0x09, 0x67, 0x9f, 0x07,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 0x64, + 0x9c, 0x5e, 0x5b, 0xd8, + 0xcf, 0xbe, 0xb4, 0x48, 0xa4, 0x70, 0xc9, 0x8d, 0x4f, 0xf1, 0x01, 0x6b, + 0xfb, 0x47, 0xb2, 0x4b, + 0x06, 0x6a, 0x69, 0x8a, 0xcd, 0xf5, 0x0b, 0xa1, 0x5f, 0xaa, 0xa5, 0xb2, + 0xe9, 0x3a, 0x3d, 0x9f, + 0xcf, 0x15, 0xa6, 0x36, 0x4a, 0xdc, 0xfa, 0x8b, 0xd7, 0x77, 0x64, 0x93, + 0xa8, 0x2e, 0x6c, 0x3a, + 0x4e, 0xca, 0x4d, 0x8d, 0x05, 0x42, 0x09, 0x75, 0xd7, 0x2e, 0xd9, 0x49, + 0x2e, 0x2c, 0xad, 0xb9, + 0x25, 0x91, 0x9a, 0x71, 0x74, 0x4d, 0xc1, 0xee, 0xbc, 0xed, 0x54, 0x61, + 0x5b, 0x99, 0x39, 0x31, + 0x28, 0x26, 0x40, 0x73, 0x1c, 0xd2, 0xa6, 0xf0, 0x79, 0x31, 0x15, 0x54, + 0x23, 0xdc, 0xc4, 0xea, + 0x3a, 0xfa, 0x23, 0x64, 0xf6, 0xe0, 0x92, 0x74, 0x41, 0x57, 0xae, 0xf1, + 0x55, 0x7c, 0xca, 0x65, + 0x44, 0x3a, 0xf5, 0xda, 0x22, 0xd9, 0x48, 0xfd, 0xb0, 0x89, 0x99, 0x55, + 0x50, 0x88, 0x25, 0x7f, + 0x96, 0xd2, 0xaa, 0xc6, 0x14, 0xf3, 0x39, 0x85, 0x2a, 0x4c, 0x21, 0x09, + 0xaf, 0x55, 0x3d, 0x13, + 0x98, 0x5f, 0x05, 0xa7, 0x79, 0xcc, 0x4d, 0xd4, 0x3d, 0x63, 0xb0, 0xbb, + 0xb0, 0xef, 0x2f, 0x40, + 0x53, 0x9e, 0xb5, 0xde, 0x26, 0x63, 0x3c, 0xc4, 0xb8, 0x4a, 0xf4, 0x94, + 0x61, 0xd2, 0x48, 0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60, 0x21, 0x63, 0xbd, 0xd8, 0xb1, 0x59, 0xe7, 0xa9, 0x71, 0x71, 0xeb, + 0xec, 0xcb, 0x88, 0x89, + 0xa5, 0xe4, 0x9d, 0x40, 0x98, 0xc3, 0x35, 0x03, 0x49, 0x5f, 0x62, 0x17, + 0xdc, 0x6a, 0x62, 0x3b, + 0xfa, 0x6c, 0x61, 0x9d, 0x3d, 0x96, 0x36, 0x85, 0x83, 0x9c, 0x72, 0xeb, + 0xf4, 0xea, 0xbb, 0xcc, + 0xb6, 0x6d, 0x9c, 0x22, 0xba, 0xcb, 0x7f, 0xa2, 0xcb, 0x8e, 0x68, 0xf4, + 0x80, 0xd9, 0xbe, 0x03, + 0x4e, 0xa2, 0xb4, 0xef, 0x16, 0x22, 0x85, 0xa7, 0x75, 0x37, 0x96, 0xc9, + 0x81, 0x46, 0x1e, 0xeb, + 0x7a, 0x57, 0x3c, 0x2c, 0xe1, 0xec, 0x35, 0x0e, 0xfc, 0x61, 0xa7, 0xd9, + 0xf6, 0x32, 0x96, 0x79, + 0x1c, 0x7a, 0xdb, 0xcc, 0x75, 0x0e, 0xb1, 0xeb, 0xdc, 0x4a, 0x84, 0xce, + 0x85, 0xeb, 0x39, 0xe4, + 0x94, 0x34, 0xf6, 0xfa, 0x6d, 0xe6, 0xf8, 0x7d, 0x78, 0x47, 0x0e, 0x36, + 0x19, 0x2a, 0x37, 0xca, + 0x53, 0x16, 0x3e, 0xb6, 0xe3, 0x33, 0x37, 0x63, 0x97, 0x4e, 0xf2, 0x77, + 0xbd, 0xa3, 0x27, 0x92, + 0x93, 0xad, 0x32, 0xed, 0x97, 0xde, 0xfa, 0xe4, 0x9c, 0x8f, 0xd7, 0xcd, + 0xb1, 0xc8, 0xa5, 0xd0, + 0x42, 0x16, 0x2e, 0x64, 0xc7, 0x5a, 0xae, 0x6b, 0x38, 0xaf, 0xc4, 0xd6, + 0x35, 0xd5, 0x3d, 0xce, + 0x55, 0x96, 0xfe, 0x6d, 0x50, 0x4c, 0x93, 0x47, 0x39, 0x07, 0x6e, 0x41, + 0x06, 0xeb, 0x3a, 0xc3, + 0x89, 0xe7, 0x46, 0xad, 0x71, 0x5f, 0x34, 0x62, 0x1d, 0x6c, 0x64, 0xac, + 0x91, 0xbc, 0xda, 0x4e, + 0x89, 0x9d, 0x6a, 0xd3, 0x12, 0x56, 0xda, 0x17, 0x8b, 0xc2, 0x82, 0x20, + 0x98, 0x8f, 0x06, 0x33, + 0x58, 0x73, 0x9d, 0x89, 0x0d, 0xec, 0x7e, 0x0f, 0xc8, 0x7f, 0x53, 0x41, + 0xa7, 0xa2, 0xd7, 0x75, + 0x16, 0xec, 0x92, 0x7b, 0x89, 0x11, 0x55, 0x5d, 0x6c, 0x36, 0xdb, 0xb6, + 0x22, 0x53, 0x7b, 0x64, + 0x9e, 0x82, 0xff, 0x0f, 0x67, 0xc7, 0x6e, 0x32, 0x7b, 0xb6, 0x93, 0xc5, + 0xab, 0xd0, 0x52, 0x2c, + 0xa3, 0xd7, 0xbb, 0xdb, 0x36, 0x52, 0x67, 0x0c, 0xa3, 0x2d, 0x07, 0xcf, + 0xf2, 0xb4, 0x6d, 0xc2, + 0xfb, 0xee, 0x84, 0x8b, 0x22, 0x64, 0xda, 0x64, 0xe1, 0x62, 0x01, 0xb2, + 0x6c, 0x74, 0xff, 0xb6, + 0x1e, 0x4d, 0xdf, 0x4f, 0x66, 0x9e, 0x4a, 0x0e, 0x77, 0xf1, 0x3d, 0x83, + 0x75, 0xbd, 0x34, 0xd4, + 0x6a, 0x23, 0xb0, 0xfb, 0x1c, 0xec, 0x92, 0xc8, 0xce, 0xb6, 0xcd, 0x42, + 0x67, 0x39, 0x5c, 0x67, + 0x62, 0x97, 0x6a, 0xac, 0x3d, 0x4d, 0x47, 0xe7, 0x3a, 0x1f, 0xbc, 0x0c, + 0xcf, 0x0a, 0x5b, 0x2c, + 0xab, 0xbb, 0x78, 0x5d, 0x8a, 0x8f, 0xd4, 0x52, 0xd9, 0x2c, 0x82, 0xca, + 0x3a, 0x3f, 0xac, 0x67, + 0xf4, 0x2e, 0x6c, 0x96, 0x82, 0x57, 0x36, 0x59, 0xda, 0xf7, 0xb0, 0x5a, + 0x07, 0x2c, 0xd6, 0x97, + 0x9c, 0xbb, 0xce, 0x32, 0xaf, 0x09, 0x0e, 0x6c, 0x70, 0xb0, 0x30, 0x80, + 0x0d, 0xb4, 0x85, 0x8c, + 0x15, 0x32, 0x56, 0xd9, 0xac, 0x26, 0x2b, 0x71, 0xa9, 0xa1, 0x5a, 0x17, + 0x92, 0x69, 0x16, 0x07, + 0xc0, 0x12, 0x7a, 0x6a, 0xc8, 0x61, 0x6b, 0x90, 0xcc, 0x83, 0x2d, 0x9c, + 0x8b, 0xee, 0x85, 0xd3, + 0x5c, 0xf9, 0x07, 0xbe, 0xb7, 0xda, 0xd2, 0xb3, 0x59, 0xfe, 0x8a, 0xcd, + 0x0a, 0xf0, 0x8c, 0x95, + 0x66, 0xdb, 0x26, 0xec, 0xdb, 0x47, 0xdf, 0xcd, 0x53, 0x77, 0x79, 0x5f, + 0x44, 0x16, 0x4f, 0xcf, + 0x5a, 0x5a, 0x6d, 0xd8, 0x23, 0x85, 0x6b, 0xa5, 0x85, 0x46, 0x1f, 0x5d, + 0xe7, 0x7b, 0x57, 0xdc, + 0x28, 0x83, 0xd9, 0x17, 0xe6, 0x90, 0x9d, 0xaa, 0x7c, 0x56, 0x5b, 0x69, + 0x99, 0xb5, 0x16, 0x9e, + 0xd4, 0xbe, 0xf3, 0x12, 0x1c, 0xbb, 0xe0, 0xc4, 0xee, 0x8b, 0x64, 0x85, + 0x39, 0x62, 0x03, 0xbe, + 0x50, 0xa0, 0xa5, 0x9c, 0x42, 0x0e, 0x5c, 0x6b, 0xa1, 0xb2, 0x80, 0xaa, + 0x65, 0xb6, 0xce, 0x35, + 0x4b, 0xd8, 0x3d, 0x52, 0x2d, 0x7d, 0xff, 0x1e, 0x4d, 0x9c, 0x20, 0x5e, + 0x60, 0xef, 0xb0, 0xc3, + 0xdb, 0x4a, 0x9f, 0x9e, 0x55, 0xd8, 0x7d, 0x0d, 0x3e, 0x30, 0x15, 0x3f, + 0x49, 0xc1, 0x4b, 0x56, + 0x5b, 0x56, 0x5b, 0x2c, 0xff, 0xa7, 0x4f, 0x3f, 0x73, 0xe8, 0xb1, 0xea, + 0x75, 0x15, 0x5e, 0x16, + 0x41, 0x84, 0x2c, 0x69, 0x63, 0x89, 0x25, 0x2e, 0x3b, 0x1a, 0x4b, 0x25, + 0x5b, 0xc7, 0x59, 0x46, + 0xe2, 0x22, 0x43, 0x65, 0x92, 0xb9, 0x48, 0xb7, 0x2c, 0x00, 0x96, 0x33, + 0x63, 0x22, 0xd9, 0xdc, + 0x1b, 0x87, 0x8b, 0xe0, 0x32, 0x1c, 0xaf, 0x5f, 0x89, 0x7e, 0x6a, 0xd9, + 0x39, 0x97, 0x5a, 0xfc, + 0x61, 0x15, 0xf9, 0x45, 0xed, 0x66, 0x8d, 0x16, 0x6f, 0x59, 0x08, 0x1f, + 0x0b, 0x88, 0x9e, 0xb9, + 0x5c, 0xf3, 0xc1, 0x42, 0x0b, 0xa5, 0xa9, 0xd8, 0x70, 0x2e, 0x12, 0x64, + 0x41, 0xcb, 0xd3, 0xba, + 0x8c, 0x8c, 0x99, 0x48, 0xac, 0x2e, 0x31, 0x5b, 0x56, 0x10, 0x3f, 0xd5, + 0x70, 0x50, 0xee, 0xc3, + 0x87, 0x2f, 0x96, 0xe3, 0xb9, 0x39, 0x7a, 0xf6, 0x72, 0xf7, 0x35, 0x07, + 0xaf, 0xb2, 0xf2, 0xb1, + 0x9c, 0x1d, 0xb1, 0x98, 0x7f, 0x97, 0xc2, 0xa1, 0xcd, 0x42, 0x7d, 0x11, + 0x3b, 0xc6, 0x93, 0x8c, + 0x5e, 0xae, 0x67, 0x39, 0xa9, 0x19, 0x5e, 0x0a, 0x9a, 0x73, 0xac, 0x50, + 0x67, 0xa3, 0x1b, 0x91, + 0x60, 0x01, 0x59, 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x9d, 0xcc, 0x9e, 0x47, 0x5b, 0x7f, + 0x2c, 0x96, 0x86, 0xc5, + 0xd6, 0xc3, 0xfd, 0x78, 0xbc, 0x7a, 0xba, 0x65, 0xf4, 0x58, 0xf2, 0xb4, + 0xca, 0xe8, 0x1b, 0xb8, + 0x96, 0xeb, 0xbb, 0x70, 0x5e, 0xae, 0xd5, 0x9b, 0x36, 0x39, 0x58, 0x61, + 0x03, 0x7c, 0xcc, 0x62, + 0xb7, 0xf0, 0xae, 0xa5, 0x28, 0x28, 0x0f, 0x6e, 0x6b, 0x83, 0x8d, 0xfa, + 0x1c, 0x36, 0xc3, 0x68, + 0x94, 0x94, 0xda, 0xce, 0xd4, 0xfa, 0x03, 0x62, 0x1a, 0xec, 0x75, 0x8e, + 0x3a, 0xb4, 0xbc, 0x81, + 0x9d, 0x67, 0x63, 0x1b, 0xa8, 0x5d, 0xb7, 0x8e, 0x8c, 0x5d, 0x83, 0xb7, + 0xb8, 0x50, 0x83, 0x4d, + 0x86, 0xb2, 0xea, 0x66, 0x66, 0xcc, 0xc7, 0x63, 0xbd, 0x3d, 0x93, 0x58, + 0xf7, 0x31, 0x74, 0x5c, + 0xc0, 0xbe, 0x33, 0xc9, 0x32, 0x3e, 0x5f, 0x3f, 0x1b, 0xf6, 0xc0, 0xfa, + 0x04, 0xd6, 0x86, 0xb6, + 0x96, 0xb1, 0x82, 0x93, 0xba, 0x7f, 0x8a, 0x39, 0x63, 0x0a, 0x55, 0x89, + 0xf7, 0x37, 0x27, 0x27, + 0xb3, 0x09, 0xec, 0xa1, 0x6b, 0x68, 0x33, 0x7c, 0x56, 0xf3, 0xc7, 0x14, + 0x72, 0xea, 0x14, 0xbc, + 0x69, 0xa3, 0x96, 0x64, 0xa9, 0xbe, 0x17, 0x32, 0xd9, 0xec, 0xad, 0x23, + 0x27, 0x4d, 0xa0, 0x67, + 0x03, 0x5e, 0x6f, 0xe5, 0x7a, 0x32, 0x79, 0xb8, 0x37, 0x5c, 0x6c, 0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 0x39, 0xf7, + 0xf6, 0x4f, 0xa4, 0x52, 0x9b, 0x4c, 0xcf, 0x16, 0x46, 0xd8, 0x7c, 0xe4, + 0x29, 0xe4, 0x1c, 0xbe, + 0x50, 0xfb, 0xf3, 0x16, 0x74, 0x66, 0xf8, 0xd1, 0xac, 0x93, 0x76, 0x70, + 0x7d, 0x0f, 0xb8, 0x9b, + 0xeb, 0x21, 0xa8, 0x24, 0x63, 0xc7, 0x75, 0xee, 0x8a, 0xbe, 0x09, 0x2d, + 0x4c, 0xf0, 0x91, 0x77, + 0x02, 0x36, 0xcb, 0xd6, 0xf7, 0x13, 0x95, 0xf6, 0xd6, 0xeb, 0xb8, 0xab, + 0xb4, 0x70, 0x98, 0x06, + 0x8f, 0xab, 0xe9, 0x5b, 0x8f, 0x3c, 0x36, 0x1f, 0x99, 0x0d, 0x72, 0xf4, + 0xba, 0x00, 0x56, 0xd8, + 0xc1, 0xc8, 0xc9, 0x52, 0x63, 0x4c, 0x93, 0xc4, 0x9a, 0xce, 0x89, 0xe1, + 0xce, 0x3b, 0x22, 0x6a, + 0xed, 0xea, 0x3e, 0x64, 0x25, 0xfe, 0xb2, 0x93, 0xde, 0xb6, 0xd8, 0x86, + 0x1c, 0xd9, 0x3e, 0xcf, + 0x7a, 0xca, 0x38, 0x29, 0x96, 0x22, 0x79, 0x83, 0xbe, 0xef, 0x6e, 0xed, + 0x29, 0x47, 0xfa, 0xe5, + 0xda, 0x33, 0xbd, 0xad, 0xa5, 0x8c, 0xce, 0x42, 0x27, 0xcb, 0xb0, 0xf3, + 0x6c, 0xd6, 0x2e, 0xd5, + 0x99, 0xb0, 0x50, 0xdf, 0xab, 0x99, 0xaf, 0x6b, 0xf0, 0x1d, 0x68, 0xab, + 0x82, 0x6a, 0xbb, 0x24, + 0xc0, 0xb3, 0xa3, 0x72, 0x62, 0x20, 0x1e, 0xbe, 0x5f, 0x46, 0x0b, 0x33, + 0x7d, 0xe8, 0x16, 0xc1, + 0xf3, 0x5f, 0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, 0x63, 0xc9, + 0x41, 0xe3, 0x65, 0xa4, + 0x7e, 0x27, 0xd1, 0xbb, 0x56, 0x2c, 0x1e, 0xb8, 0x0d, 0x3d, 0x57, 0xe1, + 0x39, 0x5e, 0x8a, 0xd9, + 0xe4, 0x80, 0x06, 0xbd, 0x56, 0x13, 0x76, 0x49, 0x69, 0xc3, 0x4f, 0x36, + 0xb6, 0x99, 0x88, 0x7f, + 0x8c, 0x27, 0x97, 0xa5, 0xb7, 0x91, 0xe9, 0x60, 0xd0, 0xfb, 0xbb, 0x3b, + 0xf5, 0x5d, 0x01, 0x2b, + 0x9d, 0x7e, 0xc4, 0xea, 0x2b, 0xee, 0x19, 0x07, 0xf5, 0x5b, 0x5c, 0xe9, + 0x54, 0x25, 0x99, 0x41, + 0xdf, 0x74, 0x4d, 0xd7, 0xef, 0x7d, 0xa9, 0x7b, 0x45, 0x07, 0x02, 0xae, + 0x73, 0x84, 0xd3, 0x29, + 0x79, 0xdf, 0x28, 0x97, 0xc8, 0xda, 0x2e, 0x09, 0xed, 0xaa, 0xc3, 0x53, + 0xfe, 0x54, 0x51, 0x99, + 0x5a, 0xa8, 0xdf, 0x91, 0x99, 0xab, 0xef, 0x9e, 0xb6, 0x45, 0x0b, 0x56, + 0x9b, 0x43, 0xa5, 0x9c, + 0xae, 0x9f, 0xfc, 0x59, 0x91, 0xca, 0x6a, 0x03, 0xb0, 0x8e, 0xf7, 0xf7, + 0x7e, 0xfa, 0xce, 0xe8, + 0x7e, 0x3c, 0xb6, 0xa7, 0x7e, 0x4a, 0x96, 0x1c, 0x10, 0xea, 0x5e, 0xed, + 0xdf, 0xe5, 0x7e, 0xf6, + 0xef, 0xc3, 0xee, 0x35, 0x5e, 0x25, 0xd2, 0xd4, 0x73, 0x6c, 0xdf, 0x71, + 0x59, 0xd4, 0x2b, 0x33, + 0xf4, 0x98, 0xc3, 0xfa, 0xdd, 0x87, 0x31, 0x96, 0x11, 0xea, 0x3d, 0xc4, + 0x44, 0xfc, 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x3b, 0x26, 0x3f, 0x9c, 0xd0, + 0xd3, 0x20, 0xca, 0xf2, + 0xfa, 0xe6, 0xf7, 0xb5, 0xf7, 0x71, 0xf4, 0x31, 0xfa, 0x88, 0xbe, 0xec, + 0x7d, 0x1d, 0x7d, 0x6d, + 0xfd, 0x1c, 0xfd, 0xed, 0xcf, 0x38, 0x9e, 0xa8, 0xbc, 0x2f, 0x45, 0xed, + 0x85, 0xa1, 0xf8, 0xfa, + 0x6d, 0xd8, 0x4d, 0xd9, 0x22, 0xac, 0xa1, 0xdb, 0xa8, 0x3b, 0x6a, 0xef, + 0x8f, 0x7f, 0xa8, 0xf4, + 0xb1, 0x8c, 0x7f, 0x16, 0xf6, 0x18, 0xdb, 0xa3, 0xb0, 0x7b, 0xee, 0xe3, + 0xe3, 0xff, 0x91, 0xf5, + 0xc0, 0xa4, 0xbb, 0x93, 0x6e, 0x65, 0xff, 0x53, 0x7b, 0x60, 0xb7, 0x50, + 0x7c, 0xfd, 0x26, 0x6d, + 0x17, 0xde, 0xc0, 0xd5, 0x88, 0x8d, 0xd4, 0xa5, 0x3e, 0x63, 0xa7, 0x90, + 0xad, 0x42, 0x08, 0x21, + 0x30, 0xfe, 0x1f, 0x7e, 0x26, 0xe7, 0x5b +}; diff --git a/source/ngc/gui/dvd.c b/source/ngc/gui/dvd.c new file mode 100644 index 0000000..d6c9145 --- /dev/null +++ b/source/ngc/gui/dvd.c @@ -0,0 +1,148 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Nintendo Gamecube DVD Reading Library + * + * This is NOT a complete DVD library, in that it works for reading + * ISO9660 discs only. + * + * If you need softmod drivecodes etc, look elsewhere. + * There are known issues with libogc dvd handling, so these work + * outside of it ,if you will. + * + * This is ideal for using with a gc-linux self booting DVD only. + * Go http://www.gc-linux.org for further information and the tools + * for your platform. + * + * To keep libOGC stable, make sure you call DVD_Init before using + * these functions. + ***************************************************************************/ +#include "shared.h" + +/** DVD I/O Address base **/ +volatile unsigned long *dvd = (volatile unsigned long *) 0xCC006000; +static unsigned char *inquiry=(unsigned char *)0x80000004; + +/** Due to lack of memory, we'll use this little 2k keyhole for all DVD operations **/ +unsigned char DVDreadbuffer[2048] ATTRIBUTE_ALIGN (32); + +/*************************************************************************** + * dvd_read + * + * Read DVD disc sectors + ***************************************************************************/ +extern u8 isWII; + +int dvd_read (void *dst, unsigned int len, u64 offset) +{ + unsigned char *buffer = (unsigned char *) (unsigned int) DVDreadbuffer; + + if (len > 2048) return 1; /*** We only allow 2k reads **/ + DCInvalidateRange((void *)buffer, len); + + if(offset < 0x57057C00 || (isWII == 1 && offset < 0x118244F00LL)) // don't read past the end of the DVD + { + offset >>= 2; + dvd[0] = 0x2E; + dvd[1] = 0; + dvd[2] = 0xA8000000; + dvd[3] = (u32)offset; + dvd[4] = len; + dvd[5] = (unsigned long) buffer; + dvd[6] = len; + dvd[7] = 3; /*** Enable reading with DMA ***/ + while (dvd[7] & 1); + memcpy (dst, buffer, len); + } + else return 0; // Let's not read past end of DVD + + if (dvd[0] & 0x4) return 0; /* Ensure it has completed */ + + return 1; +} + +/**************************************************************************** + * uselessinquiry + * + * As the name suggests, this function is quite useless. + * It's only purpose is to stop any pending DVD interrupts while we use the + * memcard interface. + * + * libOGC tends to foul up if you don't, and sometimes does if you do! + ****************************************************************************/ +void uselessinquiry () +{ + + dvd[0] = 0; + dvd[1] = 0; + dvd[2] = 0x12000000; + dvd[3] = 0; + dvd[4] = 0x20; + dvd[5] = 0x80000000; + dvd[6] = 0x20; + dvd[7] = 1; + + while (dvd[7] & 1); +} + +/**************************************************************************** + * dvd_motor_off + * + * Stop the DVD Motor + * + * This can be used to prevent the Disc from spinning during playtime + ****************************************************************************/ +void dvd_motor_off( ) +{ + dvd[0] = 0x2e; + dvd[1] = 0; + dvd[2] = 0xe3000000; + dvd[3] = 0; + dvd[4] = 0; + dvd[5] = 0; + dvd[6] = 0; + dvd[7] = 1; // Do immediate + while (dvd[7] & 1); + + /*** PSO Stops blackscreen at reload ***/ + dvd[0] = 0x14; + dvd[1] = 0; +} + +/**************************************************************************** + * dvd_inquiry + * + * Return the Current DVD Drive ID + * + * This can be used to determine whereas the console is a Gamecube or a Wii + ****************************************************************************/ +int dvd_inquiry() +{ + dvd[0] = 0x2e; + dvd[1] = 0; + dvd[2] = 0x12000000; + dvd[3] = 0; + dvd[4] = 0x20; + dvd[5] = 0x80000000; + dvd[6] = 0x20; + dvd[7] = 3; + while( dvd[7] & 1 ); + DCFlushRange((void *)0x80000000, 32); + return (int)inquiry[2]; +} diff --git a/source/ngc/gui/dvd.h b/source/ngc/gui/dvd.h new file mode 100644 index 0000000..3394211 --- /dev/null +++ b/source/ngc/gui/dvd.h @@ -0,0 +1,24 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ***************************************************************************/ + +extern int dvd_read (void *dst, unsigned int len, u64 offset); +extern void uselessinquiry (); +extern void dvd_motor_off (); +extern int dvd_inquiry(); diff --git a/source/ngc/gui/filesel.c b/source/ngc/gui/filesel.c new file mode 100644 index 0000000..3d5549d --- /dev/null +++ b/source/ngc/gui/filesel.c @@ -0,0 +1,540 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * File Selection + ***************************************************************************/ +#include "shared.h" +#include "dvd.h" +#include "iso9660.h" +#include "font.h" +#include "unzip.h" + +#define PAGESIZE 12 +#define PADCAL 70 + +static int maxfiles; +u8 havedir = 0; +u8 haveSDdir = 0; +u8 UseSDCARD = 0; +sd_file *filehandle; +char rootSDdir[SDCARD_MAX_PATH_LEN]; +int LoadFile (unsigned char *buffer); +int offset = 0; +int selection = 0; +int old_selection = 0; +int old_offset = 0; + +extern void reloadrom (); + +/*************************************************************************** + * Showfile screen + ***************************************************************************/ +static void ShowFiles (int offset, int selection) +{ + int i, j; + char text[MAXJOLIET+2]; + + ClearScreen (); + j = 0; + + for (i = offset; i < (offset + PAGESIZE) && (i < maxfiles); i++) + { + memset(text,0,MAXJOLIET+2); + if (filelist[i].flags) sprintf(text, "[%s]", filelist[i].filename + filelist[i].filename_offset); + else sprintf (text, "%s", filelist[i].filename + filelist[i].filename_offset); + + if (j == (selection - offset)) WriteCentre_HL ((j * fheight) + 120, text); + else WriteCentre ((j * fheight) + 120, text); + j++; + } + SetScreen (); +} + +/*************************************************************************** + * Update SDCARD curent directory name + ***************************************************************************/ +int updateSDdirname() +{ + int size=0; + char *test; + char temp[1024]; + + /* current directory doesn't change */ + if (strcmp(filelist[selection].filename,".") == 0) return 0; + + /* go up to parent directory */ + else if (strcmp(filelist[selection].filename,"..") == 0) + { + /* determine last subdirectory namelength */ + sprintf(temp,"%s",rootSDdir); + test= strtok(temp,"\\"); + while (test != NULL) + { + size = strlen(test); + test = strtok(NULL,"\\"); + } + + /* remove last subdirectory name */ + size = strlen(rootSDdir) - size - 1; + rootSDdir[size] = 0; + + /* handles root name */ + if (strcmp(rootSDdir,"dev0:") == 0) sprintf(rootSDdir,"dev0:\\genplus\\.."); + + return 1; + } + else + { + /* test new directory namelength */ + if ((strlen(rootSDdir)+1+strlen(filelist[selection].filename)) < SDCARD_MAX_PATH_LEN) + { + /* handles root name */ + if (strcmp(rootSDdir,"dev0:\\genplus\\..") == 0) sprintf(rootSDdir,"dev0:"); + + /* update current directory name */ + sprintf(rootSDdir, "%s\\%s",rootSDdir, filelist[selection].filename); + return 1; + } + else + { + WaitPrompt ("Dirname is too long !"); + return -1; + } + } +} + +/*************************************************************************** + * Browse SDCARD subdirectories + ***************************************************************************/ +int parseSDdirectory() +{ + int entries = 0; + int nbfiles = 0; + DIR *sddir = NULL; + + /* Get a list of files from the actual root directory */ + entries = SDCARD_ReadDir (rootSDdir, &sddir); + + if (entries < 0) entries = 0; + if (entries > MAXFILES) entries = MAXFILES; + + /* Move to DVD structure - this is required for the file selector */ + while (entries) + { + memset (&filelist[nbfiles], 0, sizeof (FILEENTRIES)); + strncpy(filelist[nbfiles].filename,sddir[nbfiles].fname,MAXJOLIET); + filelist[nbfiles].filename[MAXJOLIET-1] = 0; + filelist[nbfiles].length = sddir[nbfiles].fsize; + filelist[nbfiles].flags = (char)(sddir[nbfiles].fattr & SDCARD_ATTR_DIR); + nbfiles++; + entries--; + } + + /*** Release memory ***/ + free(sddir); + + return nbfiles; +} + +/**************************************************************************** + * FileSelector + * + * Let user select a file from the File listing + ****************************************************************************/ +void FileSelector () +{ + short p; + signed char a,b; + int haverom = 0; + int redraw = 1; + int go_up = 0; + int i,size; + + while (haverom == 0) + { + if (redraw) ShowFiles (offset, selection); + redraw = 0; + p = PAD_ButtonsDown (0); + a = PAD_StickY (0); + b = PAD_StickX (0); + + /* + * check selection screen changes + */ + + /* scroll displayed filename */ + if ((p & PAD_BUTTON_LEFT) || (b < -PADCAL)) + { + if (filelist[selection].filename_offset > 0) + { + filelist[selection].filename_offset --; + redraw = 1; + } + } + else if ((p & PAD_BUTTON_RIGHT) || (b > PADCAL)) + { + size = 0; + for (i=filelist[selection].filename_offset; i back_framewidth) + { + filelist[selection].filename_offset ++; + redraw = 1; + } + } + + /* highlight next item */ + else if ((p & PAD_BUTTON_DOWN) || (a < -PADCAL)) + { + filelist[selection].filename_offset = 0; + selection++; + if (selection == maxfiles) selection = offset = 0; + if ((selection - offset) >= PAGESIZE) offset += PAGESIZE; + redraw = 1; + } + + /* highlight previous item */ + else if ((p & PAD_BUTTON_UP) || (a > PADCAL)) + { + filelist[selection].filename_offset = 0; + selection--; + if (selection < 0) + { + selection = maxfiles - 1; + offset = selection - PAGESIZE + 1; + } + if (selection < offset) offset -= PAGESIZE; + if (offset < 0) offset = 0; + redraw = 1; + } + + /* go back one page */ + else if (p & PAD_TRIGGER_L) + { + filelist[selection].filename_offset = 0; + selection -= PAGESIZE; + if (selection < 0) + { + selection = maxfiles - 1; + offset = selection - PAGESIZE + 1; + } + if (selection < offset) offset -= PAGESIZE; + if (offset < 0) offset = 0; + redraw = 1; + } + + /* go forward one page */ + else if (p & PAD_TRIGGER_R) + { + filelist[selection].filename_offset = 0; + selection += PAGESIZE; + if (selection > maxfiles - 1) selection = offset = 0; + if ((selection - offset) >= PAGESIZE) offset += PAGESIZE; + redraw = 1; + } + + /* + * Check pressed key + */ + + /* go up one directory or quit */ + if (p & PAD_BUTTON_B) + { + filelist[selection].filename_offset = 0; + if (((!UseSDCARD) && (basedir == rootdir)) || + (UseSDCARD && strcmp(rootSDdir,"dev0:\\genplus\\..") == 0)) return; + go_up = 1; + } + + /* quit */ + if (p & PAD_TRIGGER_Z) + { + filelist[selection].filename_offset = 0; + return; + } + + /* open selected file or directory */ + if ((p & PAD_BUTTON_A) || go_up) + { + filelist[selection].filename_offset = 0; + if (go_up) + { + go_up = 0; + selection = 1; + } + + /*** This is directory ***/ + if (filelist[selection].flags) + { + if (UseSDCARD) /* SDCARD directory handler */ + { + /* update current directory */ + int status = updateSDdirname(); + + /* move to new directory */ + if (status == 1) + { + /* reinit selector (previous value is saved for one level) */ + if (selection == 1) + { + selection = old_selection; + offset = old_offset; + old_selection = 0; + old_offset = 0; + } + else + { + /* save current selector value */ + old_selection = selection; + old_offset = offset; + selection = 0; + offset = 0; + } + + + /* set new entry list */ + maxfiles = parseSDdirectory(); + if (!maxfiles) + { + /* quit */ + WaitPrompt ("Error reading directory !"); + haverom = 1; + haveSDdir = 0; + } + } + else if (status == -1) + { + /* quit */ + haverom = 1; + haveSDdir = 0; + } + } + else /* DVD directory handler */ + { + /* move to a new directory */ + if (selection != 0) + { + /* update current directory */ + rootdir = filelist[selection].offset; + rootdirlength = filelist[selection].length; + + /* reinit selector (previous value is saved for one level) */ + if (selection == 1) + { + selection = old_selection; + offset = old_offset; + old_selection = 0; + old_offset = 0; + } + else + { + /* save current selector value */ + old_selection = selection; + old_offset = offset; + selection = 0; + offset = 0; + } + + /* get new entry list */ + maxfiles = parsedirectory (); + } + } + } + else /*** This is a file ***/ + { + rootdir = filelist[selection].offset; + rootdirlength = filelist[selection].length; + genromsize = LoadFile (cart_rom); + reloadrom (); + haverom = 1; + } + redraw = 1; + } + } +} + +/**************************************************************************** + * OpenDVD + * + * Function to load a DVD directory and display to user. + ****************************************************************************/ +void OpenDVD () +{ + UseSDCARD = 0; + if (!getpvd()) + { + ShowAction("Mounting DVD ... Wait"); + DVD_Mount(); + havedir = 0; + if (!getpvd()) + { + WaitPrompt ("Failed to mount DVD"); + return; + } + } + + if (havedir == 0) + { + /* don't mess with SD entries */ + haveSDdir = 0; + + /* reinit selector */ + rootdir = basedir; + old_selection = selection = offset = old_offset = 0; + + if ((maxfiles = parsedirectory ())) + { + FileSelector (); + havedir = 1; + } + } + else FileSelector (); +} + +/**************************************************************************** + * OpenSD updated to use the new libogc. Written by softdev and pasted + * into this code by Drack. + * Modified for subdirectory browing & quick filelist recovery + * Enjoy! +*****************************************************************************/ +int OpenSD () +{ + UseSDCARD = 1; + + if (haveSDdir == 0) + { + /* don't mess with DVD entries */ + havedir = 0; + + /* reinit selector */ + old_selection = selection = offset = old_offset = 0; + + /* Reset SDCARD root directory */ + sprintf(rootSDdir,"dev0:\\genplus\\roms"); + + /* Parse initial root directory and get entries list */ + ShowAction("Reading Directory ..."); + if ((maxfiles = parseSDdirectory ())) + { + /* Select an entry */ + FileSelector (); + + /* memorize last entries list, actual root directory and selection for next access */ + haveSDdir = 1; + } + else + { + /* no entries found */ + WaitPrompt ("Error reading dev0:\\genplus\\roms"); + return 0; + } + } + /* Retrieve previous entries list and made a new selection */ + else FileSelector (); + + return 1; +} + +/**************************************************************************** + * SDCard Get Info + ****************************************************************************/ +void GetSDInfo () +{ + char fname[SDCARD_MAX_PATH_LEN]; + rootdirlength = 0; + + /* Check filename length */ + if ((strlen(rootSDdir)+1+strlen(filelist[selection].filename)) < SDCARD_MAX_PATH_LEN) + sprintf(fname, "%s\\%s",rootSDdir,filelist[selection].filename); + + else + { + WaitPrompt ("Maximum Filename Length reached !"); + haveSDdir = 0; // reset everything before next access + } + + filehandle = SDCARD_OpenFile (fname, "rb"); + if (filehandle == NULL) + { + WaitPrompt ("Unable to open file!"); + return; + } + rootdirlength = SDCARD_GetFileSize (filehandle); +} + +/**************************************************************************** + * LoadFile + * + * This function will load a file from DVD or SDCARD, in BIN, SMD or ZIP format. + * The values for offset and length are inherited from rootdir and + * rootdirlength. + * + * The buffer parameter should re-use the initial ROM buffer. + ****************************************************************************/ +int LoadFile (unsigned char *buffer) +{ + int offset; + int blocks; + int i; + u64 discoffset; + char readbuffer[2048]; + + /* SDCard Addition */ + if (UseSDCARD) GetSDInfo (); + + /* How many 2k blocks to read */ + if (rootdirlength == 0) return 0; + blocks = rootdirlength / 2048; + + offset = 0; + discoffset = rootdir; + ShowAction ("Loading ... Wait"); + + if (UseSDCARD) SDCARD_ReadFile (filehandle, &readbuffer, 2048); + else dvd_read (&readbuffer, 2048, discoffset); + + if (!IsZipFile ((char *) readbuffer)) + { + if (UseSDCARD) SDCARD_SeekFile (filehandle, 0, SDCARD_SEEK_SET); + + for (i = 0; i < blocks; i++) + { + if (UseSDCARD) SDCARD_ReadFile (filehandle, &readbuffer, 2048); + else dvd_read(readbuffer, 2048, discoffset); + memcpy (buffer + offset, readbuffer, 2048); + offset += 2048; + discoffset += 2048; + } + + /* And final cleanup */ + if (rootdirlength % 2048) + { + i = rootdirlength % 2048; + if (UseSDCARD) SDCARD_ReadFile (filehandle, &readbuffer, i); + else dvd_read (readbuffer, 2048, discoffset); + memcpy (buffer + offset, readbuffer, i); + } + } + else return UnZipBuffer (buffer, discoffset, rootdirlength); + + if (UseSDCARD) SDCARD_CloseFile (filehandle); + + return rootdirlength; +} diff --git a/source/ngc/gui/font.c b/source/ngc/gui/font.c new file mode 100644 index 0000000..34a9b95 --- /dev/null +++ b/source/ngc/gui/font.c @@ -0,0 +1,388 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + ***************************************************************************/ + +/***************************************************************************** + * IPL FONT Engine + * + * Based on Qoob MP3 Player Font + * Added IPL font extraction + *****************************************************************************/ +#include "shared.h" +#include "font.h" +#include "gpback.h" + +/*** Backdrop ***/ +char backdrop[(640 * 480 * 2) + 32]; + +/* Backdrop Frame Width (to avoid writing outside of the background frame) */ +u16 back_framewidth = 640; + +typedef struct +{ + unsigned short font_type, first_char, last_char, subst_char, ascent_units, descent_units, widest_char_width, + leading_space, cell_width, cell_height; + unsigned long texture_size; + unsigned short texture_format, texture_columns, texture_rows, texture_width, texture_height, offset_charwidth; + unsigned long offset_tile, size_tile; +} FONT_HEADER; + +static unsigned char fontWork[ 0x20000 ] __attribute__((aligned(32))); +static unsigned char fontFont[ 0x40000 ] __attribute__((aligned(32))); +extern unsigned int *xfb[2]; +extern int whichfb; + +/**************************************************************************** + * YAY0 Decoding + ****************************************************************************/ +/* Yay0 decompression */ +void yay0_decode(unsigned char *s, unsigned char *d) +{ + int i, j, k, p, q, cnt; + + i = *(unsigned long *)(s + 4); // size of decoded data + j = *(unsigned long *)(s + 8); // link table + k = *(unsigned long *)(s + 12); // byte chunks and count modifiers + + q = 0; // current offset in dest buffer + cnt = 0; // mask bit counter + p = 16; // current offset in mask table + + unsigned long r22 = 0, r5; + + do + { + // if all bits are done, get next mask + if(cnt == 0) + { + // read word from mask data block + r22 = *(unsigned long *)(s + p); + p += 4; + cnt = 32; // bit counter + } + // if next bit is set, chunk is non-linked + if(r22 & 0x80000000) + { + // get next byte + *(unsigned char *)(d + q) = *(unsigned char *)(s + k); + k++, q++; + } + // do copy, otherwise + else + { + // read 16-bit from link table + int r26 = *(unsigned short *)(s + j); + j += 2; + // 'offset' + int r25 = q - (r26 & 0xfff); + // 'count' + int r30 = r26 >> 12; + if(r30 == 0) + { + // get 'count' modifier + r5 = *(unsigned char *)(s + k); + k++; + r30 = r5 + 18; + } + else r30 += 2; + // do block copy + unsigned char *pt = ((unsigned char*)d) + r25; + int i; + for(i=0; i>6)&3); + *d++ = ((v>>4)&3); + *d++ = ((v>>2)&3); + *d++ = ((v)&3); + } + } + } +} + +int font_offset[256], font_size[256], fheight; +extern void __SYS_ReadROM(void *buf,u32 len,u32 offset); + +void init_font(void) +{ + int i; + + __SYS_ReadROM((unsigned char *)&fontFont,0x3000,0x1FCF00); + yay0_decode((unsigned char *)&fontFont, (unsigned char *)&fontWork); + FONT_HEADER *fnt; + + fnt = ( FONT_HEADER * )&fontWork; + + untile((unsigned char*)&fontFont, (unsigned char*)&fontWork[fnt->offset_tile], fnt->texture_width, fnt->texture_height); + + for (i=0; i<256; ++i) + { + int c = i; + + if ((c < fnt->first_char) || (c > fnt->last_char)) c = fnt->subst_char; + else c -= fnt->first_char; + + font_size[i] = ((unsigned char*)fnt)[fnt->offset_charwidth + c]; + + int r = c / fnt->texture_columns; + c %= fnt->texture_columns; + font_offset[i] = (r * fnt->cell_height) * fnt->texture_width + (c * fnt->cell_width); + } + + fheight = fnt->cell_height; +} + +#define TRANSPARENCY (COLOR_BLACK) + +unsigned int blit_lookup[4] = {COLOR_BLACK, 0x6d896d77, 0xb584b57b, 0xff80ff80}; +unsigned int blit_lookup_inv[4] = {COLOR_WHITE, 0xb584b57b, 0x6d896d77, 0x258e2573}; + +void setfontcolour (int fcolour) +{ + if (fcolour == COLOR_WHITE) + { + blit_lookup[1] = 0x6d896d77; + blit_lookup[2] = 0xb584b57b; + blit_lookup[3] = 0xff80ff80; + } + else + { + blit_lookup[1] = fcolour; + blit_lookup[2] = fcolour; + blit_lookup[3] = fcolour; + } +} + +void blit_char(int x, int y, unsigned char c, unsigned int *lookup) +{ + unsigned char *fnt = ((unsigned char*)fontFont) + font_offset[c]; + int ay, ax; + unsigned int llookup; + + for (ay=0; ay> 1); + unsigned long o = xfb[whichfb][p]; + + llookup = lookup[v0]; + + if ((o != TRANSPARENCY) && (v0 == 0) && (lookup[0] == TRANSPARENCY)) + llookup = o; + + if ((ax+x) & 1) + { + o &= ~0x00FFFFFF; + o |= llookup & 0x00FFFFFF; + } + else + { + o &= ~0xFF000000; + o |= llookup & 0xFF000000; + } + + xfb[whichfb][p] = o; + } + + fnt += 512; + } +} + +void write_font(int x, int y, const unsigned char *string) +{ + int ox = x; + while (*string && (x < (ox + back_framewidth))) + { + blit_char(x, y, *string, blit_lookup); + x += font_size[*string]; + string++; + } +} + +void writex(int x, int y, int sx, int sy, const unsigned char *string, unsigned int *lookup) +{ + int ox = x; + while ((*string) && ((x) < (ox + sx))) + { + blit_char(x, y, *string, lookup); + x += font_size[*string]; + string++; + } + + int ay; + for (ay=0; ayback_framewidth) x=back_framewidth; + x = (640 - x) >> 1; + write_font(x, y, string); +} + +void WriteCentre_HL( int y, const unsigned char *string) +{ + int x,t,h; + for (x=t=0; tback_framewidth) x = back_framewidth; + h = x; + x = (640 - x) >> 1; + writex(x, y, h, fheight, string, blit_lookup_inv); +} + + +/**************************************************************************** + * Draw functions + * + ****************************************************************************/ +void fntDrawHLine (int x1, int x2, int y, int color) +{ + int i; + y = 320 * y; + x1 >>= 1; + x2 >>= 1; + for (i = x1; i <= x2; i++) xfb[whichfb][y + i] = color; +} + +void fntDrawVLine (int x, int y1, int y2, int color) +{ + int i; + x >>= 1; + for (i = y1; i <= y2; i++) xfb[whichfb][x + (640 * i) / 2] = color; +} + +void fntDrawBox (int x1, int y1, int x2, int y2, int color) +{ + fntDrawHLine (x1, x2, y1, color); + fntDrawHLine (x1, x2, y2, color); + fntDrawVLine (x1, y1, y2, color); + fntDrawVLine (x2, y1, y2, color); +} + +void fntDrawBoxFilled (int x1, int y1, int x2, int y2, int color) +{ + int h; + for (h = y1; h <= y2; h++) fntDrawHLine (x1, x2, h, color); +} + +/**************************************************************************** + * Display functions + * + ****************************************************************************/ +u8 SILENT = 0; + +void SetScreen () +{ + VIDEO_SetNextFramebuffer (xfb[whichfb]); + VIDEO_Flush (); + VIDEO_WaitVSync (); +} + +void ClearScreen () +{ + whichfb ^= 1; + memcpy (xfb[whichfb], &backdrop, 1280 * 480); + back_framewidth = 440; +} + +void WaitPrompt (char *msg) +{ + int quit = 0; + + if (SILENT) return; + + while (PAD_ButtonsDown(0) & PAD_BUTTON_A) {}; + while (!(PAD_ButtonsDown(0) & PAD_BUTTON_A) && (quit == 0)) + { + ClearScreen(); + WriteCentre(254, msg); + WriteCentre(254 + fheight, "Press A to Continue"); + SetScreen(); + while (!(PAD_ButtonsDown(0) & PAD_BUTTON_A)); + } +} + +void ShowAction (char *msg) +{ + if (SILENT) return; + + ClearScreen(); + WriteCentre(254, msg); + SetScreen(); +} + +void WaitButtonA () +{ + while (PAD_ButtonsDown(0) & PAD_BUTTON_A) {}; + while (!(PAD_ButtonsDown(0) & PAD_BUTTON_A)); +} + +/**************************************************************************** + * Unpack Backdrop + * + * Called at startup to unpack our backdrop to a temporary + * framebuffer. + ****************************************************************************/ +void unpackBackdrop () +{ + unsigned long res, inbytes, outbytes; + + inbytes = gpback_COMPRESSED; + outbytes = gpback_RAW; + res = uncompress ((char *) &backdrop[0], &outbytes, (char *) &gpback[0], inbytes); + if (res != Z_OK) while (1); +} + diff --git a/source/ngc/gui/font.h b/source/ngc/gui/font.h new file mode 100644 index 0000000..a452a68 --- /dev/null +++ b/source/ngc/gui/font.h @@ -0,0 +1,42 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + ***************************************************************************/ +/***************************************************************************** + * IPL FONT Engine + * + * Based on Qoob MP3 Player Font + * Added IPL font extraction + *****************************************************************************/ + +extern void init_font(void); +extern void WriteCentre_HL( int y, const unsigned char *string); +extern void WriteCentre (int y, const unsigned char *text); +extern void write_font (int x, int y, const unsigned char *text); +extern void WaitPrompt (char *msg); +extern void ShowAction (char *msg); +extern void WaitButtonA (); +extern void unpackBackdrop (); +extern void ClearScreen (); +extern void SetScreen (); +extern void fntDrawBoxFilled (int x1, int y1, int x2, int y2, int color); +extern void setfontcolour (int fcolour); +extern int fheight; +extern int font_size[256]; +extern u16 back_framewidth; diff --git a/source/ngc/gui/ggentry.c b/source/ngc/gui/ggentry.c new file mode 100644 index 0000000..2b372d9 --- /dev/null +++ b/source/ngc/gui/ggentry.c @@ -0,0 +1,351 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Nintendo Gamecube Game Genie Entry + ***************************************************************************/ + +#include "shared.h" +#include "font.h" +#include "rominfo.h" + +#define MAXCODES 8 + +typedef struct +{ + int address; + unsigned short data; +} GGPATCH; + +/*** Game Genie Codes Array ***/ +unsigned char ggcodes[MAXCODES][10]; /*** Codes are entered as XXXX-XXXX ***/ +int gghpos[MAXCODES]; /*** Edit positions ***/ +int ggrow = 0; +int editing = 0; +char ggvalidchars[] = "ABCDEFGHJKLMNPRSTVWXYZ0123456789*"; +GGPATCH ggpatch[8]; +extern char menutitle[]; + +/**************************************************************************** + * Decode Game Genie entries to memory patches + ****************************************************************************/ +void decode_genie (char *code, int which) +{ + char *p; + int n, i; + for (i = 0; i < 8; i++) + { + /*** This should only happen if memory is corrupt! ***/ + p = strchr (ggvalidchars, code[i]); + if (p == NULL) + { + ggpatch[which].address = ggpatch[which].data = 0; + return; + } + + n = p - ggvalidchars; + + switch (i) + { + case 0: + ggpatch[which].data |= n << 3; + break; + + case 1: + ggpatch[which].data |= n >> 2; + ggpatch[which].address |= (n & 3) << 14; + break; + + case 2: + ggpatch[which].address |= n << 9; + break; + + case 3: + ggpatch[which].address |= (n & 0xF) << 20 | (n >> 4) << 8; + break; + + case 4: + ggpatch[which].data |= (n & 1) << 12; + ggpatch[which].address |= (n >> 1) << 16; + break; + + case 5: + ggpatch[which].data |= (n & 1) << 15 | (n >> 1) << 8; + break; + + case 6: + ggpatch[which].data |= (n >> 3) << 13; + ggpatch[which].address |= (n & 7) << 5; + break; + + case 7: + ggpatch[which].address |= n; + break; + } + } +} + +void decode_ggcodes () +{ + int i, j; + char thiscode[10]; + + /*** Clear out any old patches ***/ + memset (&ggpatch[0], 0, 8 * sizeof (GGPATCH)); + memset (&thiscode, 0, 10); + + j = 0; + for (i = 0; i < 8; i++) + { + if (strcmp (ggcodes[i], "AAAA-AAAA")) + { + /*** Move the code into thiscode ***/ + memcpy (&thiscode, &ggcodes[i], 4); + memcpy (&thiscode[4], &ggcodes[i][5], 4); + + decode_genie (thiscode, j); + j++; + } + } + + /*** And now apply the patches ***/ + if (j) + { + for (i = 0; i < j; i++) + { + if (ggpatch[i].address < rominfo.romend) + { + /*** Patching ROM space ***/ + cart_rom[ggpatch[i].address] = ggpatch[i].data & 0x0ff; + cart_rom[ggpatch[i].address + 1] = (ggpatch[i].data & 0xff00) >> 8; + } + else + { + /*** Patching 68K memory ***/ + m68k_write_memory_16 (ggpatch[i].address, ggpatch[i].data); + } + } + /* TODO : Fix Checksum */ + } +} + +/**************************************************************************** + * ClearGGCodes + * + * Should be called whenever a new rom is loaded + ****************************************************************************/ +void ClearGGCodes () +{ + int i; + + for (i = 0; i < MAXCODES; i++) + { + strcpy (ggcodes[i], "AAAA-AAAA"); + gghpos[i] = 0; + } + ggrow = 0; +} + +/**************************************************************************** + * DrawGGCodes + * + * Just draw the codes, with the current one highlighted. + ****************************************************************************/ +void DrawGGCodes () +{ + int i,j; + unsigned char c[2] = { 0, 0 }; + + ClearScreen (); + WriteCentre (134, menutitle); + + for (i = 0; i < MAXCODES; i++) + { + if (i == ggrow) + { + /*** Highlight selected ***/ + WriteCentre_HL (i * fheight + 224, ggcodes[i]); + + /*** If editing, highlight the current character ***/ + if (editing) + { + int hpos = 0; + + for (j=0; j> 1); + for (j=0; j 70)) + { + /*** Increment the entry ***/ + redraw = 1; + c[0] = ggcodes[ggrow][gghpos[ggrow]]; + v = strstr (ggvalidchars, c); + v++; + if (*v == '*') ggcodes[ggrow][gghpos[ggrow]] = 'A'; + else ggcodes[ggrow][gghpos[ggrow]] = *v; + } + + if ((p & PAD_BUTTON_DOWN) || (y < -70)) + { + /*** Decrement entry ***/ + redraw = 1; + c[0] = ggcodes[ggrow][gghpos[ggrow]]; + v = strstr (ggvalidchars, c); + if (*v == 'A') ggcodes[ggrow][gghpos[ggrow]] = '9'; + else + { + v--; + ggcodes[ggrow][gghpos[ggrow]] = *v; + } + } + + if ((p & PAD_BUTTON_LEFT) || (x < -70)) + { + redraw = 1; + gghpos[ggrow]--; + if (gghpos[ggrow] == 4) gghpos[ggrow]--; + } + + if ((p & PAD_BUTTON_RIGHT) || (x > 70)) + { + redraw = 1; + gghpos[ggrow]++; + if (gghpos[ggrow] == 4) gghpos[ggrow]++; + } + + if (gghpos[ggrow] < 0) gghpos[ggrow] = 8; + if (gghpos[ggrow] > 8) gghpos[ggrow] = 0; + } + + /** Lose any previous A press **/ + while (PAD_ButtonsDown (0) & PAD_BUTTON_A); + + editing = 0; +} + +/**************************************************************************** + * GGSelectLine + * + * Select which line to edit + ****************************************************************************/ +void GGSelectLine () +{ + int redraw = 1; + int quit = 0; + short j; + signed char y; + + /*** To select a line, just move up or down. + Pressing A will enter edit mode. + Pressing B will exit to caller. ***/ + + while (!(PAD_ButtonsDown (0) & PAD_BUTTON_B) && (quit == 0)) + { + if (redraw) + { + DrawGGCodes (); + redraw = 0; + } + + j = PAD_ButtonsDown (0); + y = PAD_StickY (0); + + if ((j & PAD_BUTTON_UP) || (y > 70)) + { + ggrow--; + redraw = 1; + } + + if ((j & PAD_BUTTON_DOWN) || (y < -70)) + { + ggrow++; + redraw = 1; + } + + if (ggrow < 0) ggrow = MAXCODES - 1; + if (ggrow == MAXCODES) ggrow = 0; + + if (j & PAD_BUTTON_B) quit = 1; + + if (j & PAD_BUTTON_A) + { + GGEditLine (); + redraw = 1; + } + } +} + +/**************************************************************************** + * GetGGEntries + * + * Screen to return encoded Game Genie codes. + * No keyboard is available, so it's just a simple wrap round each line kind + * of thing. + ****************************************************************************/ +void GetGGEntries () +{ + editing = 0; + strcpy (menutitle, "Game Genie Entry"); + GGSelectLine (); +} diff --git a/source/ngc/gui/gpback.h b/source/ngc/gui/gpback.h new file mode 100644 index 0000000..ff42e31 --- /dev/null +++ b/source/ngc/gui/gpback.h @@ -0,0 +1,8991 @@ +/******************************************************************* + * Image File : genplus.bmp + * Width : 640 + * Height : 480 + * + * This header contains a compressed Zip image. + * Use zlib1.2.3 uncompress function to restore. + * + * Backdrop design by brakken[at]tehskeen.com + *******************************************************************/ + +#define gpback_RAW 614400 +#define gpback_COMPRESSED 71779 +#define gpback_WIDTH 640 +#define gpback_HEIGHT 480 + +unsigned char gpback[71779] = { + 0x78, 0xda, 0xe4, 0xbd, 0x07, 0x98, 0x1b, 0xd5, 0xbd, 0x3e, 0xec, 0x6d, + 0xd2, 0x6a, 0xab, 0xa4, + 0x5d, 0x77, 0x1b, 0xdb, 0xb8, 0x62, 0x3a, 0x06, 0x4c, 0xef, 0x10, 0x20, + 0xa1, 0x04, 0x48, 0x4c, + 0x35, 0x60, 0x8c, 0x6d, 0xc0, 0x75, 0x8b, 0xa4, 0xd1, 0xcc, 0x29, 0x53, + 0x34, 0x55, 0x7d, 0x7b, + 0x5f, 0xdb, 0x60, 0x1b, 0x30, 0xcd, 0x74, 0x02, 0x09, 0x1d, 0x17, 0x6c, + 0x53, 0x43, 0x0d, 0x10, + 0x48, 0x21, 0xe5, 0xa6, 0x53, 0x6e, 0x72, 0xef, 0xe5, 0x3b, 0x67, 0xb4, + 0x45, 0xbb, 0xab, 0x32, + 0xbb, 0x96, 0xcd, 0xff, 0x79, 0x3e, 0xf6, 0x39, 0x8c, 0x56, 0xd6, 0x6a, + 0xe6, 0x9c, 0x99, 0xf3, + 0x9e, 0xf7, 0xf7, 0xfe, 0xca, 0x19, 0x87, 0xc7, 0xa5, 0xfd, 0xc9, 0x53, + 0x6c, 0xc0, 0x6e, 0x14, + 0xb0, 0x49, 0xef, 0xa1, 0x3c, 0x31, 0x1f, 0xe6, 0x2b, 0x05, 0xa0, 0xc8, + 0xb0, 0xb1, 0xf6, 0x88, + 0xdd, 0x6f, 0x8f, 0x92, 0x46, 0x8f, 0x61, 0x9b, 0xdf, 0xa6, 0x17, 0xb2, + 0x05, 0x72, 0x3e, 0xc8, + 0x13, 0xf3, 0x60, 0x1e, 0x3f, 0x0e, 0x0d, 0xf9, 0x36, 0x21, 0x1f, 0xd9, + 0xc3, 0x76, 0xff, 0x88, + 0xf7, 0x87, 0x9f, 0x53, 0x25, 0xe7, 0xd4, 0xf3, 0xb9, 0x4c, 0x9f, 0xa1, + 0xd7, 0x51, 0x18, 0xb2, + 0xb3, 0x85, 0xd2, 0x38, 0x98, 0xf1, 0x53, 0x62, 0x01, 0xa4, 0xd7, 0x95, + 0x87, 0x53, 0x9f, 0x33, + 0x4f, 0xc8, 0x83, 0xf9, 0x72, 0x01, 0x28, 0x34, 0xec, 0x23, 0xfb, 0x62, + 0x14, 0xb1, 0x05, 0x4a, + 0x3e, 0xc8, 0x1f, 0xec, 0x0b, 0x2a, 0x0a, 0xd9, 0xfd, 0x05, 0xd9, 0xce, + 0x29, 0x91, 0x73, 0x86, + 0x6c, 0xfe, 0x71, 0x38, 0x73, 0x3f, 0xf3, 0x35, 0x3b, 0x67, 0xd7, 0xf2, + 0x32, 0xf7, 0x93, 0xcf, + 0x43, 0x36, 0x32, 0x66, 0x05, 0x62, 0xb6, 0x73, 0x16, 0x92, 0x73, 0x16, + 0xb1, 0xf9, 0x01, 0xd2, + 0x17, 0xbd, 0x88, 0xa3, 0x7f, 0x33, 0xd8, 0x17, 0xbb, 0xdf, 0x16, 0x2c, + 0x62, 0x0b, 0xd5, 0x02, + 0xce, 0x3c, 0xa7, 0x6a, 0x9e, 0x13, 0x65, 0x3b, 0x67, 0xbe, 0x98, 0xf9, + 0xfa, 0xc7, 0x05, 0x0a, + 0x81, 0x3d, 0x58, 0xc8, 0x66, 0xb9, 0x4f, 0x38, 0x5f, 0xb7, 0x73, 0x36, + 0x25, 0x0f, 0x64, 0xed, + 0x27, 0xb9, 0xd6, 0x7c, 0xa1, 0xef, 0x9c, 0xe4, 0xf7, 0x7c, 0x29, 0x1f, + 0x16, 0x68, 0x85, 0x9c, + 0x2d, 0xd4, 0xd7, 0x97, 0x68, 0xa2, 0x2f, 0xf4, 0xde, 0x98, 0x7d, 0x91, + 0xe8, 0x7d, 0xc9, 0x43, + 0xa9, 0xfa, 0x52, 0x40, 0xee, 0xa7, 0x4d, 0x1e, 0x97, 0xf9, 0x9c, 0xf4, + 0x79, 0x24, 0xe7, 0xcc, + 0x13, 0xb2, 0x3c, 0x8f, 0x23, 0xe7, 0x40, 0xea, 0xe7, 0x31, 0x68, 0x67, + 0x8b, 0x02, 0xa9, 0xee, + 0x53, 0x1e, 0xca, 0xa3, 0x7d, 0x51, 0x49, 0x5f, 0x82, 0x43, 0xe7, 0x8c, + 0x2d, 0x64, 0x63, 0x8b, + 0xf4, 0x42, 0x2e, 0x3f, 0x90, 0x0f, 0xc9, 0xb3, 0x38, 0xd0, 0x97, 0xc4, + 0x39, 0x73, 0x35, 0x07, + 0xe8, 0xbc, 0x4b, 0x3f, 0x07, 0x92, 0xe6, 0x1d, 0x97, 0x75, 0xde, 0x91, + 0xf1, 0xa6, 0x73, 0xa0, + 0x88, 0xdc, 0x97, 0xa2, 0x61, 0x7d, 0xa1, 0xcf, 0x7c, 0x11, 0x9d, 0xff, + 0x01, 0x32, 0xff, 0xc9, + 0x73, 0x68, 0x7d, 0x0e, 0xe4, 0xe7, 0x74, 0x0e, 0x64, 0x7d, 0x1e, 0x93, + 0xe6, 0x40, 0x9e, 0x90, + 0x0f, 0x0f, 0x60, 0x4c, 0x4c, 0x2c, 0x34, 0xef, 0x6b, 0xb8, 0x6f, 0x0c, + 0x92, 0xc7, 0x82, 0x8c, + 0x91, 0x39, 0x16, 0xfd, 0xf7, 0x55, 0x1c, 0x0d, 0x2e, 0x7c, 0x0f, 0x63, + 0x42, 0xfa, 0x99, 0x12, + 0xd7, 0x43, 0x7d, 0xb8, 0x4e, 0xfa, 0x42, 0xe7, 0x62, 0xd6, 0x73, 0x52, + 0x5c, 0x08, 0x59, 0xc4, + 0x05, 0x75, 0x94, 0xb8, 0x90, 0xee, 0x3e, 0xc9, 0x45, 0xc9, 0x58, 0x84, + 0x06, 0x70, 0x5d, 0x1f, + 0xbe, 0x46, 0x25, 0xb0, 0x70, 0x18, 0xae, 0xa7, 0xc4, 0x85, 0xfc, 0xdc, + 0xe2, 0x82, 0x35, 0x2c, + 0x4a, 0x79, 0x3d, 0x04, 0x0b, 0xfb, 0x71, 0x3d, 0x94, 0x02, 0xd7, 0x15, + 0x82, 0x85, 0x49, 0x6b, + 0xd4, 0x00, 0x2e, 0x04, 0xac, 0xe0, 0x42, 0xae, 0xd6, 0x63, 0x13, 0x17, + 0xb2, 0x63, 0x91, 0x94, + 0x58, 0x8f, 0x87, 0xe0, 0xfa, 0x40, 0x5f, 0x6c, 0x6c, 0x3f, 0xae, 0xe7, + 0xab, 0x07, 0x65, 0x0e, + 0xa0, 0x6c, 0xcf, 0xa3, 0xd5, 0xf5, 0x38, 0xf1, 0x6c, 0x24, 0xe3, 0xfa, + 0xd0, 0x35, 0x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 0xcc, 0x8e, 0xe0, 0x93, 0xd6, 0xeb, 0xf0, 0x50, 0x9b, 0xd2, 0xb4, 0x5d, + 0x94, 0x8c, 0xf7, 0x15, + 0x7d, 0x5f, 0x63, 0x92, 0xd2, 0x76, 0x49, 0xb6, 0xc3, 0x86, 0x61, 0xa1, + 0x79, 0x5f, 0x29, 0xae, + 0xd3, 0x35, 0x2e, 0xc9, 0x0e, 0xcb, 0x39, 0x2e, 0x58, 0xe1, 0xcc, 0xaa, + 0xdd, 0x92, 0xed, 0x62, + 0x0b, 0xf7, 0xdb, 0x2e, 0x49, 0x6b, 0x54, 0x92, 0x1d, 0xd6, 0x67, 0xbb, + 0xf4, 0x9f, 0x13, 0x1f, + 0x5a, 0x5c, 0x28, 0xb2, 0xc4, 0x99, 0xed, 0xca, 0x38, 0x6e, 0x08, 0xae, + 0xa7, 0xb0, 0xc3, 0xe8, + 0x39, 0x0b, 0x87, 0xe3, 0xfa, 0x88, 0x73, 0x5a, 0xc4, 0x05, 0x9d, 0xcc, + 0x01, 0x65, 0x8c, 0xb8, + 0x30, 0x82, 0xa7, 0x93, 0x67, 0x23, 0x38, 0xe2, 0x79, 0x44, 0x54, 0x2f, + 0x4a, 0xe8, 0x30, 0x19, + 0x70, 0x5d, 0x18, 0xc6, 0xd7, 0x0f, 0xd5, 0x1c, 0x18, 0xed, 0xbc, 0x23, + 0x63, 0x51, 0xa0, 0x11, + 0xbb, 0x31, 0x9c, 0xb8, 0x0f, 0x43, 0x38, 0xae, 0x61, 0xf2, 0xf5, 0x84, + 0xed, 0x21, 0xe4, 0xe5, + 0x72, 0x6d, 0x24, 0xf3, 0xce, 0xc2, 0x1c, 0x48, 0xf0, 0xf4, 0xec, 0x6b, + 0x63, 0x8e, 0xc6, 0x24, + 0xd9, 0x0e, 0x1b, 0x8e, 0x85, 0x89, 0xb1, 0x18, 0x61, 0x87, 0x7d, 0x2f, + 0x63, 0x62, 0xb3, 0x32, + 0x26, 0x81, 0x42, 0x13, 0x17, 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+ 0xe0, 0xeb, 0x03, 0xb8, + 0x4e, 0x70, 0xc1, 0x1d, 0x2e, 0xf2, 0x66, 0xce, 0x37, 0x49, 0xe0, 0x82, + 0xc3, 0x3a, 0x2e, 0x64, + 0xec, 0xa7, 0x2d, 0x4c, 0x70, 0x21, 0x54, 0xe0, 0xcd, 0xc6, 0x99, 0xe9, + 0x39, 0x07, 0xf8, 0x82, + 0x90, 0x0f, 0x8b, 0x08, 0xae, 0x97, 0x24, 0xf3, 0xf5, 0xbe, 0xbe, 0xd0, + 0x7e, 0x96, 0x06, 0x87, + 0xe2, 0x7a, 0x2a, 0x5c, 0xb0, 0xca, 0xd3, 0x6d, 0x63, 0xc7, 0x05, 0x3c, + 0x7c, 0x6d, 0x1c, 0xc2, + 0xd3, 0x93, 0xee, 0x61, 0xa1, 0x6c, 0x63, 0x13, 0xb8, 0xee, 0x1c, 0x8a, + 0xeb, 0x7d, 0x7c, 0xdd, + 0xae, 0x0c, 0xe5, 0xeb, 0x79, 0x16, 0xe7, 0x40, 0xc9, 0x81, 0xcf, 0x81, + 0x24, 0x5d, 0xb2, 0x92, + 0xac, 0x8d, 0x59, 0xd6, 0x63, 0xf2, 0x6c, 0xd0, 0x39, 0x50, 0x1e, 0x29, + 0xf1, 0x8e, 0xc0, 0x75, + 0xba, 0x46, 0x45, 0x4a, 0x89, 0xed, 0x41, 0xe6, 0x3f, 0xb1, 0xb5, 0x2c, + 0x71, 0xe6, 0x90, 0xd3, + 0x57, 0x16, 0xcc, 0x1f, 0x72, 0xfd, 0xe9, 0xe2, 0x1c, 0xf2, 0xf5, 0x8a, + 0x43, 0x85, 0x0b, 0x83, + 0xe7, 0xcc, 0x68, 0x47, 0xd0, 0x35, 0xce, 0xc6, 0x15, 0x07, 0x4b, 0x99, + 0xca, 0x11, 0xb6, 0x4b, + 0xff, 0x58, 0x90, 0xfb, 0x3a, 0x60, 0xbb, 0xd8, 0xad, 0xd9, 0x11, 0x21, + 0x57, 0x76, 0x8e, 0x32, + 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x03, 0xf5, 0x5c, 0x1c, + 0x23, 0xf6, 0x99, 0xfc, 0x3e, 0xe2, 0x78, 0xcd, 0x31, 0x89, 0x67, 0x19, + 0x13, 0x72, 0x5f, 0xa9, + 0x1d, 0x51, 0x19, 0x2b, 0xab, 0xcf, 0x98, 0x6f, 0x62, 0xda, 0x2e, 0x16, + 0xed, 0x88, 0x5c, 0xee, + 0x4d, 0x6b, 0x61, 0x0f, 0x4a, 0xd3, 0x17, 0x4e, 0xf9, 0x42, 0xda, 0x7a, + 0x2e, 0x7d, 0x76, 0x18, + 0xad, 0x5d, 0x43, 0xf3, 0x4d, 0x32, 0xd9, 0x2e, 0xb9, 0xde, 0x9b, 0xd6, + 0xac, 0x5d, 0x33, 0x89, + 0xfd, 0x1b, 0xde, 0x8d, 0xf6, 0xa3, 0x3d, 0x68, 0x1f, 0x78, 0x07, 0xfd, + 0x5e, 0xbe, 0x1d, 0x54, + 0x75, 0x2f, 0xf4, 0x2f, 0xe8, 0x38, 0x82, 0x99, 0xdf, 0xb5, 0x80, 0xa9, + 0xea, 0x28, 0x62, 0xcf, + 0x8a, 0xbf, 0xee, 0xff, 0x5c, 0xd8, 0x8f, 0x16, 0xb7, 0x14, 0xb2, 0x73, + 0xda, 0x4f, 0x67, 0x16, + 0x77, 0x9f, 0xc4, 0x9c, 0xda, 0x3e, 0x87, 0xd9, 0x1a, 0xea, 0x26, 0x5c, + 0x71, 0x8a, 0xff, 0xf2, + 0xf6, 0x1f, 0x79, 0x7e, 0xd8, 0x75, 0x85, 0xe7, 0xdc, 0x9e, 0x29, 0xbe, + 0x23, 0x7b, 0x8e, 0xf7, + 0xd9, 0x7b, 0x96, 0x32, 0x67, 0x76, 0x55, 0xf8, 0x9a, 0x1b, 0xd7, 0xfb, + 0x7e, 0xd0, 0x75, 0x8d, + 0x77, 0x49, 0xfb, 0x39, 0xbe, 0x19, 0x1b, 0x5d, 0x9e, 0x8d, 0x81, 0x5f, + 0x83, 0x9d, 0x98, 0x20, + 0x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, 0x2b, 0x32, 0xca, 0xdc, 0xb7, 0x6c, 0xf9, 0x26, 0xc1, 0x84, 0x0e, + 0x93, 0xce, 0x1f, 0x6e, + 0x95, 0xa7, 0x5b, 0xad, 0xbf, 0x6c, 0xc5, 0xe7, 0xd5, 0x77, 0xdd, 0x28, + 0xa7, 0x71, 0xbc, 0x14, + 0x8b, 0xf4, 0x02, 0x26, 0xd3, 0xfe, 0xc1, 0x34, 0x7e, 0xcd, 0xac, 0xf3, + 0x95, 0x65, 0x6f, 0xc6, + 0xef, 0x63, 0x6f, 0xda, 0x11, 0xba, 0xde, 0x81, 0xe4, 0x9b, 0x58, 0xf0, + 0x85, 0xcf, 0x43, 0xbf, + 0x30, 0xe7, 0xfe, 0xbf, 0x84, 0x8d, 0x7c, 0xbd, 0x26, 0x4a, 0x92, 0x1a, + 0x90, 0x64, 0x55, 0x25, + 0x47, 0x51, 0x0a, 0x28, 0xa2, 0xc0, 0x2b, 0x12, 0x2f, 0x68, 0xb2, 0xa0, + 0x69, 0xaa, 0x20, 0x69, + 0x01, 0x21, 0xa0, 0x06, 0x04, 0x51, 0x85, 0x58, 0xd0, 0x30, 0xe6, 0x34, + 0x0e, 0x23, 0x0d, 0xf3, + 0xbc, 0x8a, 0x04, 0xa8, 0x41, 0xd2, 0x78, 0x01, 0xab, 0x9c, 0x00, 0x54, + 0x5e, 0x60, 0x55, 0x46, + 0x80, 0x0a, 0x12, 0x59, 0x85, 0x13, 0x39, 0x85, 0xbc, 0x27, 0x43, 0x01, + 0xcb, 0xd8, 0x3c, 0xf2, + 0xe4, 0xc8, 0xcb, 0x40, 0x84, 0x32, 0x14, 0x05, 0x19, 0x61, 0x10, 0x20, + 0x7f, 0x26, 0x93, 0x37, + 0x65, 0x01, 0x63, 0x99, 0xc7, 0xf4, 0x3d, 0xd8, 0xf7, 0x1a, 0xcb, 0x1c, + 0xe6, 0xc8, 0x6b, 0xf2, + 0x1e, 0xc2, 0xb2, 0x88, 0x44, 0x99, 0x47, 0x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25, 0xc2, 0x8d, 0xea, 0x12, 0x71, 0x89, 0x46, 0x5e, 0x6b, + 0xd7, 0x8a, 0x37, 0x68, + 0x37, 0x8b, 0xb7, 0xe9, 0x4b, 0xc9, 0xf1, 0x06, 0xd2, 0x6e, 0x15, 0x6f, + 0x25, 0xaf, 0x6f, 0xd1, + 0x97, 0x89, 0xcb, 0xf5, 0xdb, 0xc5, 0xdb, 0xb5, 0xdb, 0xc5, 0x95, 0xda, + 0x32, 0x91, 0xf4, 0x45, + 0x24, 0x7d, 0x11, 0x97, 0x92, 0x23, 0x7d, 0xef, 0x36, 0xe5, 0x56, 0x61, + 0xa9, 0x72, 0x9d, 0x70, + 0x33, 0x39, 0x2e, 0x53, 0x96, 0x91, 0xe3, 0xcd, 0xe2, 0x2a, 0x85, 0xbe, + 0x7f, 0x87, 0xb8, 0x52, + 0x59, 0x29, 0xac, 0x51, 0x56, 0x89, 0xcb, 0x95, 0xdb, 0x85, 0xe5, 0xca, + 0x0a, 0xf2, 0xfb, 0x6a, + 0x61, 0xb5, 0xb2, 0x5a, 0xbc, 0x43, 0x59, 0x2b, 0xd6, 0x28, 0xf5, 0x62, + 0x9d, 0xb2, 0x41, 0x58, + 0x2d, 0xd7, 0xa2, 0x1a, 0x79, 0x1d, 0xae, 0x91, 0xd7, 0xe0, 0x3b, 0x8c, + 0x35, 0xf8, 0x4e, 0x65, + 0x25, 0xee, 0xe5, 0x7f, 0x8b, 0x29, 0x2b, 0xbe, 0x57, 0x3c, 0x12, 0x50, + 0x5f, 0x83, 0x59, 0x23, + 0x9d, 0x62, 0x07, 0xf5, 0x67, 0x35, 0x56, 0xd6, 0x25, 0x72, 0x22, 0x87, + 0xe5, 0xfd, 0x53, 0xff, + 0x3b, 0xd5, 0xf5, 0xb2, 0xc6, 0xb2, 0x3b, 0xb8, 0xca, 0x68, 0xa9, 0x27, + 0xab, 0x9f, 0x8d, 0xf0, + 0x0e, 0xa7, 0x91, 0x93, 0xfd, 0x1a, 0x90, 0x99, 0x87, 0xd6, 0x58, 0x51, + 0x9b, 0xa9, 0x9e, 0x0b, + 0xc5, 0xf5, 0x6c, 0xda, 0x76, 0xbf, 0x2f, 0x3c, 0x97, 0x31, 0xab, 0x09, + 0x5e, 0x54, 0x08, 0x0e, + 0xe6, 0xde, 0xb4, 0xc3, 0xeb, 0xb9, 0x24, 0xfc, 0x26, 0xc3, 0x62, 0xac, + 0xd3, 0xe4, 0x9b, 0x1c, + 0x60, 0xad, 0xfa, 0x83, 0x58, 0xbb, 0x26, 0xa1, 0xf7, 0x3b, 0xb2, 0xe4, + 0x9b, 0x14, 0x1a, 0xe9, + 0x73, 0x10, 0xf3, 0xf0, 0x4f, 0xf0, 0xaf, 0xf8, 0xef, 0xf8, 0xef, 0x84, + 0x0f, 0x70, 0x83, 0xb6, + 0x46, 0xf4, 0xeb, 0x86, 0x20, 0xeb, 0x92, 0xa0, 0xc8, 0x62, 0x20, 0xa0, + 0xe0, 0x00, 0x50, 0xc4, + 0x80, 0x28, 0x83, 0x80, 0x48, 0x5e, 0x43, 0x55, 0x0c, 0x20, 0x1d, 0x89, + 0xbc, 0x2e, 0x90, 0x86, + 0x44, 0x48, 0x30, 0xd1, 0xa7, 0xb3, 0x22, 0xab, 0x73, 0xa2, 0x4f, 0xf3, + 0x88, 0x5e, 0xad, 0x5e, + 0xf0, 0x68, 0x5e, 0x72, 0xf4, 0x8a, 0x8c, 0xe6, 0x13, 0x58, 0x0d, 0x09, + 0x9c, 0xe6, 0x17, 0x3c, + 0xba, 0x8f, 0x70, 0xc4, 0x3a, 0x5c, 0xab, 0x7b, 0xb0, 0x5f, 0xf1, 0x0b, + 0x3e, 0x85, 0x60, 0xa7, + 0xea, 0x11, 0x3c, 0x8a, 0x97, 0xf7, 0x29, 0x75, 0xbc, 0x47, 0xad, 0xc7, + 0x35, 0x6a, 0x9d, 0xb0, + 0x56, 0x59, 0x27, 0xac, 0x57, 0xea, 0x84, 0x3a, 0xf2, 0x6f, 0x1b, 0xd4, + 0x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 0xda, 0x8d, 0x99, 0xf7, 0x37, 0x29, 0xa7, 0xb5, 0x90, + 0x83, 0x36, 0x5f, 0xc6, + 0x7c, 0x93, 0x9c, 0xee, 0xc3, 0xda, 0x77, 0x7d, 0x72, 0x11, 0x38, 0xb4, + 0x71, 0xbc, 0x7d, 0xba, + 0x5e, 0x43, 0x69, 0x5d, 0xda, 0x7a, 0x2e, 0x7d, 0x7e, 0x13, 0xb3, 0xce, + 0x97, 0xf6, 0xff, 0xee, + 0xde, 0xb4, 0x09, 0x3b, 0x22, 0x2f, 0xf5, 0xfe, 0xc1, 0xcd, 0x7d, 0xb9, + 0xf2, 0x64, 0x6d, 0x19, + 0x9e, 0x6f, 0x92, 0xcf, 0x9f, 0x8c, 0x5f, 0xa0, 0xd8, 0x87, 0xff, 0x81, + 0x77, 0x10, 0x2e, 0x00, + 0x74, 0x4d, 0x32, 0x34, 0x45, 0x90, 0x35, 0x4d, 0x50, 0x74, 0x62, 0x03, + 0x6b, 0x5c, 0x00, 0x2a, + 0xaa, 0x18, 0x0c, 0x20, 0x09, 0x04, 0x38, 0x09, 0x2a, 0x50, 0x22, 0x36, + 0xad, 0x28, 0x11, 0x70, + 0x94, 0x14, 0x41, 0xc0, 0x64, 0xae, 0x88, 0xc4, 0xe6, 0x84, 0x1a, 0xcb, + 0xfb, 0x35, 0x1f, 0xf2, + 0xe9, 0x3e, 0x48, 0xb0, 0x0e, 0x91, 0x39, 0x89, 0xbc, 0x3a, 0x0b, 0x15, + 0xad, 0x09, 0x85, 0xc9, + 0xdc, 0xf2, 0x93, 0x79, 0xea, 0x31, 0x7c, 0x04, 0x0b, 0x39, 0x62, 0x1b, + 0xfb, 0x08, 0x76, 0x31, + 0x7c, 0xbd, 0xea, 0x41, 0x35, 0x04, 0x6f, 0xea, 0x09, 0xbe, 0xd4, 0x6a, + 0xb5, 0x78, 0xad, 0xb6, + 0x1a, 0xaf, 0xd6, 0x09, 0x4e, 0xe9, 0xab, 0xf9, 0x55, 0xda, 0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xca, 0x93, 0xef, + 0xe1, 0x6f, 0x22, 0x9f, 0x5d, 0xa6, 0xdc, 0x46, 0x1b, 0xe1, 0xb8, 0x2b, + 0x84, 0x55, 0xca, 0x1d, + 0xfc, 0x1d, 0xea, 0x6a, 0xbc, 0x82, 0x70, 0xe1, 0x3b, 0x49, 0x9f, 0xef, + 0x20, 0xd8, 0x7f, 0x17, + 0xc5, 0x68, 0xd2, 0xd7, 0x1a, 0x0d, 0x11, 0x5e, 0x0e, 0xb1, 0x4f, 0x5d, + 0xcf, 0xaf, 0x53, 0xd7, + 0x92, 0xcf, 0xad, 0xe2, 0xd7, 0x12, 0x3c, 0x5f, 0x43, 0x70, 0x7d, 0x95, + 0x5a, 0x8b, 0x81, 0x06, + 0x08, 0xde, 0x31, 0x98, 0xd1, 0x59, 0x82, 0xcd, 0x1c, 0xc1, 0x33, 0x84, + 0xfd, 0xe4, 0x88, 0x55, + 0x91, 0xbc, 0xae, 0x21, 0x63, 0xb9, 0x8e, 0x60, 0x68, 0x1d, 0x5f, 0x43, + 0xf0, 0xb5, 0xd6, 0xa0, + 0x63, 0xe2, 0xe1, 0xc9, 0x3a, 0x85, 0x13, 0x58, 0x0e, 0x31, 0x50, 0x39, + 0x1e, 0x6a, 0x7e, 0xfa, + 0x1d, 0xc8, 0x27, 0xfb, 0x31, 0x08, 0x10, 0xac, 0x35, 0x6a, 0xd1, 0xed, + 0x81, 0x46, 0xfc, 0x36, + 0xfe, 0x27, 0x79, 0x3a, 0xde, 0x40, 0x97, 0x6a, 0x2e, 0x7f, 0x59, 0x7f, + 0xbe, 0x49, 0x52, 0x0d, + 0x14, 0x57, 0xb3, 0xab, 0x96, 0x3e, 0x5f, 0xce, 0x86, 0x4a, 0x73, 0xff, + 0xa7, 0xca, 0x78, 0x65, + 0x5d, 0xb6, 0x98, 0xad, 0x7c, 0xad, 0xcc, 0x4f, 0x31, 0x26, 0xab, 0x9e, + 0x1e, 0x75, 0x7a, 0xb2, + 0xc7, 0xc8, 0x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 0x08, 0x60, + 0x05, 0x02, 0x7f, 0x00, 0x40, 0x21, 0xa4, 0x03, 0x23, 0x24, 0xb3, 0x7e, + 0xb5, 0x86, 0x23, 0x98, + 0x01, 0x7c, 0x5a, 0x3d, 0xa8, 0xd7, 0xea, 0xb9, 0x1a, 0x63, 0x3d, 0xb7, + 0x56, 0x5f, 0xc3, 0xdd, + 0xa2, 0xaf, 0xe6, 0x90, 0xf6, 0x53, 0xee, 0x54, 0xed, 0x7a, 0xc2, 0x05, + 0x65, 0x41, 0x33, 0x64, + 0xac, 0x68, 0x04, 0xbb, 0x8c, 0x3b, 0x89, 0xbd, 0xb5, 0x1f, 0xbd, 0xdb, + 0xd0, 0xc3, 0xb5, 0xc7, + 0xbb, 0x7c, 0xcd, 0xa1, 0x06, 0x36, 0x2a, 0x47, 0xb8, 0xb0, 0x16, 0x25, + 0x2d, 0x06, 0x1a, 0xd5, + 0x38, 0x8c, 0x2a, 0x31, 0x10, 0x57, 0xa3, 0x30, 0x22, 0x87, 0x51, 0x58, + 0x09, 0xe3, 0x68, 0x30, + 0x04, 0xa5, 0x68, 0x33, 0x1b, 0xd7, 0x2e, 0x87, 0x67, 0x2b, 0x37, 0x62, + 0x8a, 0x55, 0xd1, 0x60, + 0x1b, 0x6c, 0x52, 0xba, 0x71, 0x87, 0xdc, 0x8e, 0x3b, 0x94, 0x36, 0xd8, + 0xa6, 0x34, 0x82, 0x06, + 0xa3, 0xc1, 0x1f, 0x8c, 0xf5, 0x10, 0xbc, 0x5d, 0xc7, 0x7b, 0x14, 0x96, + 0x87, 0x06, 0x2b, 0x00, + 0x95, 0xe5, 0x19, 0x99, 0x60, 0x00, 0xc1, 0x81, 0x1a, 0x72, 0xfe, 0x9f, + 0xa9, 0xdb, 0x50, 0xaf, + 0xd4, 0x05, 0x3a, 0x02, 0x3d, 0xdc, 0x66, 0xbd, 0x07, 0xc4, 0x8c, 0x10, + 0xb8, 0x33, 0xb8, 0x04, + 0x1a, 0x41, 0x3f, 0xf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0xb6, + 0x5a, 0xb9, 0x02, 0x8b, 0x8a, 0x42, 0xb8, 0x9d, 0x81, 0x3a, 0x5b, 0xae, + 0xf1, 0x9e, 0xd9, 0x71, + 0x36, 0x73, 0x72, 0xfc, 0x68, 0xff, 0x82, 0xe0, 0x5c, 0xee, 0x08, 0xe3, + 0x08, 0xf6, 0x38, 0x63, + 0x16, 0x1b, 0x50, 0x63, 0x26, 0xfe, 0x05, 0x34, 0x05, 0x1b, 0x8a, 0x88, + 0x24, 0x32, 0xdc, 0x75, + 0x7a, 0x00, 0xed, 0xd7, 0x7f, 0xef, 0xef, 0xe8, 0xba, 0x6c, 0xc3, 0x05, + 0x1d, 0x17, 0xd7, 0x1e, + 0xdb, 0x30, 0x17, 0x1c, 0xae, 0x4d, 0x47, 0x87, 0x29, 0xf3, 0xd0, 0xc2, + 0xc0, 0x02, 0x3c, 0x4f, + 0x9a, 0x8b, 0xe6, 0x48, 0x33, 0xd1, 0xe1, 0xd2, 0x6c, 0x34, 0x43, 0x9c, + 0x07, 0xe7, 0xe2, 0x59, + 0x68, 0xb6, 0x3c, 0x0f, 0x4d, 0x8e, 0x9c, 0xe4, 0xb9, 0x33, 0xb2, 0x98, + 0xad, 0x92, 0xce, 0x02, + 0x77, 0x49, 0xab, 0xd0, 0xad, 0x81, 0x95, 0x18, 0x10, 0x0c, 0x94, 0xc5, + 0xe7, 0xf0, 0x6f, 0xc8, + 0xcf, 0x4b, 0x70, 0x09, 0x2e, 0x4c, 0x5f, 0xa3, 0x87, 0xab, 0x0c, 0x3b, + 0x3c, 0x66, 0xcd, 0x42, + 0x82, 0x1f, 0x14, 0x27, 0x2a, 0x62, 0x15, 0xf5, 0xb4, 0x51, 0x1c, 0x2c, + 0x0b, 0x97, 0x7a, 0x68, + 0x2c, 0x8d, 0xcd, 0x28, 0xf3, 0x39, 0x94, 0x7c, 0x36, 0x23, 0x57, 0x20, + 0xcf, 0x2a, 0xc5, 0xbf, + 0x82, 0x1c, 0xed, 0xc3, 0x3a, 0xc6, 0xfd, 0x16, 0xd3, 0xd6, 0x73, 0x19, + 0xcc, 0x37, 0x49, 0xb1, + 0x7f, 0xb0, 0xc5, 0xfa, 0x4d, 0x45, 0x5a, 0x21, 0x57, 0x10, 0x20, 0xcf, + 0x13, 0xe1, 0x51, 0x05, + 0x86, 0x9d, 0xad, 0xcc, 0x29, 0x2e, 0xe4, 0xa8, 0x9e, 0x4f, 0x7f, 0x9d, + 0x2f, 0x21, 0x4b, 0xbe, + 0x09, 0x79, 0xaf, 0x2a, 0x56, 0x52, 0x5f, 0x30, 0x7c, 0x3f, 0xb2, 0x31, + 0xd5, 0xb4, 0xb2, 0x5b, + 0xda, 0xb3, 0xba, 0x30, 0x38, 0xfa, 0x9a, 0x56, 0xf3, 0xf9, 0x27, 0x4c, + 0xec, 0xfb, 0xbb, 0xf4, + 0x33, 0xde, 0x08, 0xa9, 0x42, 0x5b, 0xb8, 0x51, 0x68, 0x26, 0x2d, 0x66, + 0x34, 0x08, 0x84, 0x8f, + 0x09, 0xb2, 0x16, 0x10, 0x9e, 0x13, 0xbe, 0xe3, 0xbf, 0x0d, 0x70, 0xc8, + 0x1e, 0xcc, 0x07, 0x13, + 0xa4, 0x89, 0xd2, 0x14, 0xde, 0xc5, 0x3b, 0xf9, 0x0a, 0x5c, 0x26, 0x4e, + 0xc3, 0xc7, 0x45, 0x4e, + 0x81, 0xa7, 0x84, 0x8e, 0x85, 0x53, 0x95, 0x4a, 0x58, 0x29, 0x4f, 0xe0, + 0xa7, 0x2b, 0x53, 0x84, + 0x2a, 0xd5, 0x29, 0x54, 0x92, 0x4f, 0x38, 0x50, 0x01, 0x2e, 0x97, 0x4f, + 0x80, 0x67, 0x2a, 0x17, + 0x41, 0x45, 0xbb, 0x87, 0x6f, 0xd6, 0x0c, 0x3e, 0xa4, 0x47, 0x05, 0x2d, + 0xc4, 0x89, 0x7c, 0xe0, + 0x25, 0xf0, 0xbf, 0xf2, 0xef, 0xfc, 0xfe, 0xee, 0xc3, 0x6b, 0x27, 0x74, + 0xcd, 0xad, 0x3b, 0x2c, + 0x3a, 0x01, 0xb8, 0xc4, 0x4a, 0xde, 0xad, 0x4e, 0xc0, 0x53, 0xd5, 0x49, + 0x60, 0xbc, 0xe4, 0x44, + 0xe5, 0x42, 0x19, 0x2e, 0x17, 0xca, 0x71, 0x09, 0x5f, 0x22, 0x94, 0x93, + 0x6f, 0x2c, 0xd1, 0x5d, + 0xec, 0xd1, 0xd1, 0x4b, 0xfc, 0x27, 0x68, 0xa7, 0x22, 0xaf, 0xd6, 0x80, + 0x02, 0x1a, 0x24, 0x7c, + 0x92, 0xe1, 0x7f, 0x11, 0x5b, 0xc9, 0x8d, 0x13, 0x2b, 0x91, 0x4b, 0x22, + 0x2d, 0xe0, 0x42, 0x2e, + 0x79, 0x22, 0x9e, 0xa9, 0x2d, 0x40, 0x33, 0xe3, 0x15, 0xcc, 0xa2, 0xa8, + 0xec, 0xff, 0x45, 0xf4, + 0x6e, 0x8e, 0x6a, 0x5a, 0x84, 0x7f, 0x21, 0x9e, 0xd8, 0xb3, 0x3e, 0xc2, + 0x89, 0xea, 0xf4, 0x16, + 0xf4, 0xbc, 0x32, 0x15, 0x95, 0xe8, 0x33, 0xe1, 0x51, 0xd1, 0xf9, 0xdc, + 0x64, 0xcd, 0xc9, 0x96, + 0xa8, 0x55, 0x60, 0xba, 0xfa, 0x43, 0x14, 0x53, 0x05, 0x84, 0x54, 0x09, + 0x49, 0x6a, 0x3d, 0xaa, + 0x97, 0x77, 0xa3, 0xef, 0x08, 0xaf, 0xbb, 0xb2, 0xdd, 0x55, 0x3b, 0x3e, + 0x36, 0x9e, 0x2b, 0x11, + 0x8b, 0xb1, 0x4d, 0x70, 0xf0, 0xa5, 0xe4, 0xda, 0x1c, 0x42, 0x21, 0x2e, + 0xe2, 0x69, 0x23, 0x98, + 0xc5, 0x17, 0x0a, 0xc5, 0x52, 0x05, 0xc1, 0xe6, 0x39, 0xde, 0x79, 0x1d, + 0xc7, 0xd4, 0x5f, 0xdf, + 0x70, 0xb5, 0xef, 0x34, 0x79, 0x25, 0x88, 0x12, 0x0e, 0xe6, 0xd7, 0x05, + 0x8c, 0x94, 0x0d, 0x78, + 0xbd, 0x42, 0x78, 0x53, 0xf8, 0x0d, 0xae, 0xae, 0x73, 0x9e, 0x67, 0x7c, + 0xb4, 0x1a, 0x38, 0xa4, + 0x42, 0xde, 0x2e, 0x94, 0x08, 0xc5, 0x7c, 0xb1, 0x58, 0x20, 0x10, 0xeb, + 0x41, 0x28, 0xe4, 0x8b, + 0x44, 0xbb, 0x60, 0x17, 0x08, 0x96, 0x0a, 0xa5, 0x78, 0x46, 0xe4, 0x78, + 0x78, 0x52, 0xc7, 0x02, + 0xaf, 0xa3, 0xc1, 0xe6, 0xbf, 0x50, 0xdb, 0x00, 0x6e, 0x92, 0x6e, 0xe7, + 0xe3, 0x5a, 0x9c, 0x60, + 0x9f, 0x84, 0xfd, 0x5a, 0x33, 0xba, 0xaf, 0xe9, 0x58, 0xef, 0x8c, 0x96, + 0x99, 0xbe, 0xea, 0x50, + 0x39, 0x53, 0xa1, 0x55, 0x10, 0xbe, 0x30, 0x91, 0x39, 0x26, 0x7c, 0x22, + 0xab, 0x69, 0x61, 0x1c, + 0xd2, 0x0d, 0xac, 0xea, 0x0a, 0xd6, 0x55, 0x05, 0x78, 0x74, 0x80, 0x7e, + 0x21, 0xfd, 0x83, 0x7b, + 0xa9, 0xfd, 0xfa, 0xfa, 0x05, 0xbd, 0xc7, 0xd4, 0xcc, 0x6f, 0x98, 0xe4, + 0x73, 0xcb, 0x0e, 0xa1, + 0x48, 0x2e, 0x12, 0x4a, 0x95, 0x4a, 0xa1, 0x52, 0x29, 0xe5, 0x89, 0x1d, + 0x47, 0x30, 0x86, 0x3c, + 0x5f, 0xb4, 0x21, 0x3b, 0xb6, 0x0b, 0x85, 0x30, 0xdf, 0x98, 0xc0, 0x9d, + 0x11, 0xba, 0xd1, 0x7f, + 0x8c, 0x74, 0x14, 0x64, 0xf4, 0x2e, 0xe4, 0x0f, 0x5c, 0x83, 0x7e, 0x28, + 0x5f, 0x8b, 0xee, 0x52, + 0x75, 0x08, 0xb4, 0x0d, 0x28, 0x22, 0xbe, 0x8c, 0x3f, 0xc1, 0xbf, 0xc2, + 0x0f, 0xa2, 0x93, 0x70, + 0x2a, 0xec, 0xa2, 0xba, 0x5e, 0x65, 0xd0, 0x36, 0x64, 0x7f, 0x13, 0xea, + 0x13, 0xa1, 0xb5, 0xf1, + 0x28, 0x16, 0x9a, 0x18, 0x18, 0x29, 0xf3, 0x94, 0x86, 0x49, 0x23, 0xf6, + 0x64, 0x71, 0x9f, 0x7d, + 0x9c, 0x52, 0x2b, 0x24, 0xf3, 0x8e, 0x7e, 0x3e, 0x2f, 0x87, 0x35, 0xa9, + 0x2d, 0xe5, 0x79, 0xa5, + 0xd5, 0xb0, 0x92, 0xfc, 0x26, 0x0d, 0xee, 0xba, 0x8c, 0xfb, 0x07, 0x9b, + 0xf9, 0x26, 0xd9, 0xf3, + 0x39, 0xcc, 0x3a, 0x08, 0x66, 0xed, 0x67, 0x1b, 0x5b, 0x14, 0xb2, 0xb3, + 0xe5, 0x66, 0xae, 0x7c, + 0x86, 0x3d, 0x37, 0x47, 0x53, 0xe7, 0x2b, 0x57, 0xfb, 0x72, 0x06, 0x8a, + 0x53, 0xe4, 0x03, 0x26, + 0xef, 0x1f, 0x3c, 0x34, 0xdf, 0xc4, 0x8c, 0x0d, 0x48, 0x97, 0x6f, 0x92, + 0xe3, 0x9a, 0xd4, 0xb6, + 0xe1, 0x35, 0xa9, 0xd3, 0xd4, 0x5b, 0x48, 0xce, 0x71, 0x69, 0x20, 0xd8, + 0xf7, 0xad, 0xf0, 0x1a, + 0xdf, 0x18, 0x54, 0x84, 0xc6, 0x70, 0xbb, 0xd8, 0x16, 0x6e, 0x15, 0xda, + 0x22, 0x6d, 0x42, 0x93, + 0xd1, 0x24, 0x84, 0x42, 0x06, 0x7a, 0x34, 0xf0, 0x57, 0xfc, 0xa5, 0xd4, + 0x84, 0x8e, 0xd2, 0xf3, + 0xa0, 0x4b, 0x9c, 0x28, 0x54, 0xf0, 0x15, 0x92, 0x9b, 0xe0, 0x91, 0x43, + 0x76, 0x0b, 0xb3, 0x8d, + 0x45, 0xc2, 0x49, 0xe1, 0x85, 0x68, 0x7a, 0x60, 0x02, 0xae, 0x14, 0x5c, + 0x42, 0xb5, 0x34, 0x1e, + 0xbb, 0xc5, 0x72, 0x54, 0x2a, 0x11, 0xcc, 0x12, 0x0b, 0xe0, 0x78, 0x6d, + 0x06, 0xfc, 0x51, 0x78, + 0x03, 0xac, 0x37, 0x36, 0xc2, 0x4d, 0x46, 0x0c, 0x37, 0x18, 0x71, 0xdc, + 0x18, 0x14, 0xb1, 0x10, + 0x7a, 0x04, 0x7d, 0x13, 0xf8, 0x0d, 0xdb, 0xd0, 0x7e, 0x52, 0x9d, 0xbb, + 0x67, 0x41, 0xed, 0x9c, + 0x86, 0x09, 0x8c, 0x53, 0x2e, 0x41, 0xe5, 0xa2, 0x0b, 0x8e, 0xd7, 0xa7, + 0xc0, 0x6a, 0xd9, 0x09, + 0x4b, 0xf9, 0x52, 0x58, 0x2c, 0x94, 0xa0, 0x12, 0xd2, 0x8a, 0xa5, 0x12, + 0x5c, 0x66, 0x54, 0xa0, + 0xf9, 0xb1, 0xc5, 0x2c, 0x17, 0xae, 0xe3, 0xee, 0x50, 0x5a, 0x70, 0xa3, + 0x86, 0x91, 0x68, 0xc8, + 0x04, 0xa3, 0x04, 0xe1, 0x8d, 0xd8, 0x5a, 0xc2, 0xdd, 0x08, 0xee, 0x89, + 0x4e, 0xe4, 0x56, 0xaa, + 0xe1, 0x34, 0x7d, 0x1e, 0x58, 0x18, 0x5b, 0xe8, 0x3b, 0x3c, 0x78, 0x18, + 0xb1, 0xb1, 0xc6, 0xa1, + 0x0b, 0x23, 0x06, 0xdc, 0x1e, 0xee, 0x05, 0x3c, 0xb1, 0xcd, 0x03, 0x9a, + 0x86, 0x05, 0x1d, 0x61, + 0xc6, 0xe8, 0x42, 0x2f, 0xeb, 0x33, 0xe0, 0x74, 0xe3, 0x28, 0x30, 0xd7, + 0x98, 0x08, 0xca, 0x94, + 0x52, 0x50, 0x15, 0x9c, 0x05, 0xa6, 0x19, 0xe7, 0xa1, 0x26, 0x43, 0x42, + 0xb2, 0x2c, 0xa2, 0x3a, + 0xa3, 0x8e, 0xfb, 0x58, 0xf9, 0xd2, 0xbf, 0xb6, 0x69, 0xbc, 0xaf, 0xb2, + 0x71, 0x06, 0x53, 0x15, + 0x28, 0x83, 0x0e, 0xa1, 0x94, 0x2f, 0x17, 0x2b, 0xf8, 0x4a, 0x91, 0x8e, + 0x44, 0x19, 0xef, 0x10, + 0xed, 0x7c, 0x59, 0xa0, 0x98, 0x77, 0xa8, 0x55, 0xe8, 0xb0, 0xf0, 0x6c, + 0x66, 0x6e, 0xd3, 0x29, + 0xf5, 0xa7, 0xb6, 0x7a, 0xbd, 0x2d, 0x0d, 0xab, 0x38, 0x5e, 0x09, 0x21, + 0x60, 0x40, 0x1e, 0x29, + 0x5e, 0xe4, 0x95, 0xbb, 0xc1, 0xbb, 0xca, 0xfb, 0xac, 0xda, 0x72, 0x94, + 0xcf, 0xd9, 0x32, 0xcd, + 0x37, 0x81, 0x8c, 0x53, 0x05, 0xc1, 0x6b, 0xa7, 0xe4, 0xc4, 0xe5, 0xa2, + 0x83, 0x27, 0x3f, 0xc8, + 0x2e, 0x38, 0x50, 0x05, 0x69, 0x65, 0xbc, 0x13, 0xcc, 0x08, 0x1d, 0xe3, + 0x3f, 0xad, 0xf9, 0x78, + 0xef, 0xc4, 0xa6, 0x99, 0xbe, 0x73, 0x43, 0x06, 0x78, 0xce, 0x68, 0xc0, + 0x21, 0x2d, 0x26, 0xc8, + 0xba, 0x86, 0x69, 0xe3, 0x09, 0x1e, 0xdd, 0x17, 0x39, 0xda, 0x3f, 0x3d, + 0x34, 0x85, 0x73, 0xcb, + 0x6e, 0xe0, 0x52, 0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54, 0x2a, + 0x15, 0xb0, 0x2c, 0x50, + 0x8a, 0xca, 0x03, 0x15, 0xb0, 0x44, 0xb1, 0x41, 0x97, 0x36, 0x85, 0x9b, + 0x1d, 0x3b, 0x93, 0x5d, + 0x11, 0xf9, 0x09, 0xd0, 0xd4, 0x56, 0xd4, 0x4c, 0xe6, 0xbf, 0x66, 0x04, + 0x91, 0x18, 0x52, 0x60, + 0x40, 0x91, 0x85, 0x5f, 0xc6, 0xd6, 0x13, 0xfe, 0x3c, 0x01, 0x8f, 0x97, + 0x26, 0xe1, 0xc3, 0x28, + 0xf6, 0x45, 0x17, 0xfa, 0x0f, 0x8f, 0x4e, 0x63, 0xc6, 0xcb, 0x04, 0x8b, + 0xc5, 0x62, 0xf3, 0xd9, + 0x38, 0xa9, 0x41, 0x64, 0x9f, 0x88, 0xf7, 0x70, 0x5e, 0x62, 0x13, 0x6a, + 0xba, 0x88, 0xa1, 0xd1, + 0x09, 0x7f, 0x1e, 0x39, 0x06, 0xcc, 0x31, 0x66, 0x71, 0x6e, 0xb1, 0x04, + 0x56, 0x2a, 0x13, 0xe1, + 0x44, 0x6d, 0x32, 0x98, 0xa0, 0x9d, 0x0b, 0x5b, 0x08, 0xf7, 0x43, 0x1a, + 0x87, 0x36, 0xc9, 0xff, + 0x07, 0x1e, 0x6f, 0x70, 0xd7, 0xbb, 0x1a, 0xa6, 0x72, 0xd3, 0x54, 0x27, + 0x2c, 0x0a, 0x38, 0xa0, + 0x43, 0x2a, 0x85, 0x25, 0x92, 0x1d, 0xda, 0xa5, 0x42, 0x98, 0x47, 0xb0, + 0x75, 0x9c, 0x98, 0x67, + 0xda, 0xda, 0xae, 0xd0, 0x1c, 0x76, 0x76, 0xd3, 0x51, 0xbe, 0x33, 0x1a, + 0x4e, 0x62, 0x7f, 0x64, + 0xe8, 0xd8, 0xd0, 0x54, 0xaa, 0xbd, 0x11, 0x9b, 0x97, 0xd8, 0x9e, 0x5a, + 0x04, 0xbd, 0x13, 0xfc, + 0x3d, 0xdb, 0xde, 0x7c, 0x9c, 0xc7, 0xd1, 0x38, 0x9e, 0x99, 0x18, 0xa8, + 0x44, 0x04, 0x47, 0x39, + 0x82, 0x9f, 0xd0, 0x46, 0xb8, 0x5e, 0x3e, 0x4f, 0x56, 0x70, 0xba, 0x86, + 0x93, 0xd7, 0x05, 0xa4, + 0x15, 0xab, 0x33, 0xd0, 0xc2, 0xc6, 0x23, 0xfd, 0x87, 0x35, 0x1d, 0xe6, + 0x3d, 0x23, 0x72, 0x3b, + 0x68, 0x52, 0x1f, 0xe7, 0xe3, 0x04, 0xeb, 0x75, 0x5d, 0x45, 0x7a, 0x50, + 0xc6, 0x5a, 0x30, 0x84, + 0xa5, 0xe0, 0x26, 0xfc, 0x10, 0xc1, 0x6f, 0x47, 0x80, 0xf0, 0x70, 0xb2, + 0x2a, 0xb9, 0x88, 0x2d, + 0x3b, 0x3b, 0x34, 0xc9, 0x3f, 0x5b, 0x39, 0x16, 0x86, 0xf4, 0x16, 0x1c, + 0x35, 0x9a, 0x71, 0xdc, + 0x08, 0xe0, 0x6d, 0xd2, 0x37, 0xe8, 0xcb, 0x30, 0xf6, 0x1d, 0x75, 0xcf, + 0x61, 0xeb, 0x8f, 0x6b, + 0x3f, 0xaa, 0x7e, 0x82, 0x5a, 0x04, 0x8a, 0x02, 0x36, 0x5c, 0x12, 0x28, + 0x07, 0x25, 0x22, 0xc1, + 0x5c, 0xb2, 0x76, 0xf7, 0x6b, 0x0b, 0x94, 0x03, 0x14, 0xf1, 0xc5, 0xb8, + 0x5c, 0x99, 0x06, 0x4e, + 0x8b, 0x5c, 0x0d, 0x2e, 0xd1, 0x4f, 0x04, 0x77, 0x6a, 0x51, 0x14, 0x26, + 0xe7, 0x16, 0x83, 0x06, + 0xc1, 0xbb, 0xeb, 0x50, 0x8d, 0x72, 0x15, 0xba, 0x53, 0x0d, 0x20, 0x44, + 0xec, 0x69, 0x41, 0xe3, + 0x61, 0x9d, 0xce, 0xc0, 0x1e, 0x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5d, 0x0e, 0x2f, + 0x8f, 0x2e, 0x82, 0x67, + 0xc7, 0x3d, 0x10, 0x34, 0xae, 0xe6, 0xae, 0x8a, 0x1c, 0x07, 0x0e, 0xd3, + 0x89, 0x1d, 0x19, 0xba, + 0x90, 0x5b, 0x17, 0xed, 0x85, 0x3d, 0x04, 0xf3, 0xda, 0xb5, 0x66, 0x21, + 0x6e, 0xb4, 0xf1, 0x8d, + 0xe1, 0x20, 0x7e, 0x34, 0xf4, 0x7b, 0xee, 0xe1, 0x96, 0xf3, 0x3c, 0xae, + 0x8d, 0x73, 0xea, 0x16, + 0x34, 0xcf, 0xf2, 0x4d, 0x33, 0xca, 0xc1, 0x74, 0xfd, 0x7c, 0x6e, 0xba, + 0x4a, 0xb0, 0x2b, 0x38, + 0x87, 0x9b, 0x66, 0x54, 0x71, 0xb3, 0x8c, 0x79, 0xdc, 0x11, 0xc6, 0xd1, + 0xf0, 0x48, 0x6d, 0x11, + 0xbc, 0x48, 0xf9, 0x31, 0x3a, 0x47, 0x1f, 0x0f, 0x16, 0x87, 0x56, 0x71, + 0x72, 0x30, 0x86, 0x1a, + 0xb4, 0x28, 0x8e, 0xe8, 0x11, 0x62, 0xdf, 0x85, 0xb1, 0xae, 0x87, 0xa0, + 0xac, 0x04, 0xf0, 0xa7, + 0x21, 0x0f, 0xc1, 0xbf, 0x49, 0xc4, 0xe6, 0x9d, 0x8f, 0x8f, 0x0c, 0x1f, + 0xe5, 0x5f, 0x10, 0x9b, + 0xcd, 0x4c, 0xd4, 0xcb, 0x40, 0x99, 0x58, 0x46, 0x38, 0x65, 0x29, 0x2a, + 0x41, 0x76, 0x7e, 0x5c, + 0xa0, 0x00, 0xfe, 0xa4, 0xf1, 0x15, 0xe6, 0xdd, 0x48, 0x10, 0x00, 0x4d, + 0xe3, 0x15, 0xa3, 0x87, + 0x7f, 0xda, 0x38, 0x96, 0x60, 0x9e, 0x1b, 0x94, 0xc9, 0xd5, 0x60, 0x8a, + 0x3c, 0x11, 0x96, 0x4b, + 0x55, 0x60, 0xbc, 0x7c, 0x1e, 0x68, 0x57, 0x64, 0x14, 0x08, 0xee, 0x83, + 0xdf, 0x28, 0x5b, 0xd8, + 0x19, 0xb1, 0x32, 0xe6, 0x68, 0x75, 0x3a, 0x74, 0x0a, 0x65, 0xf0, 0x70, + 0xb5, 0xda, 0x5f, 0xa6, + 0xb8, 0x09, 0xdf, 0x1a, 0x0f, 0x26, 0xcb, 0x87, 0x73, 0x0b, 0xb5, 0x23, + 0xd8, 0x79, 0xca, 0x5c, + 0xff, 0xb1, 0xea, 0x62, 0xf6, 0xe8, 0xd0, 0x61, 0xec, 0xbc, 0xc8, 0x51, + 0xec, 0xfc, 0xd0, 0x12, + 0x14, 0xd6, 0xc2, 0xbc, 0xa2, 0x05, 0x71, 0x40, 0x97, 0x79, 0xa4, 0xf1, + 0xfc, 0x53, 0xe1, 0x8f, + 0xc1, 0xb6, 0xb6, 0x73, 0x3d, 0x25, 0xad, 0xd5, 0xbe, 0x69, 0x7a, 0x35, + 0x28, 0x97, 0x8a, 0xf1, + 0x0c, 0x6d, 0x3e, 0x74, 0xc9, 0x4e, 0x50, 0x1d, 0x98, 0x0c, 0xab, 0x03, + 0x13, 0xc1, 0x34, 0x79, + 0x16, 0x9c, 0xaf, 0xcc, 0x06, 0xd3, 0xe5, 0xb3, 0xc0, 0x55, 0x91, 0x8b, + 0xc0, 0x39, 0xf1, 0xa3, + 0xb8, 0x63, 0x42, 0x27, 0xb2, 0x67, 0xe8, 0x5e, 0x28, 0x19, 0x06, 0x96, + 0x43, 0x3a, 0x0a, 0xe8, + 0x41, 0x14, 0x09, 0xe9, 0x38, 0x66, 0x44, 0xb0, 0xac, 0x6d, 0xc3, 0x8f, + 0x6b, 0x6e, 0x98, 0x47, + 0x18, 0x9b, 0x43, 0x2c, 0xc7, 0x93, 0xb5, 0x19, 0x68, 0x8a, 0x52, 0x02, + 0x66, 0xca, 0x27, 0x00, + 0x43, 0x6f, 0x83, 0xb1, 0xb0, 0xce, 0xb7, 0x6b, 0x6f, 0x83, 0x6f, 0x95, + 0x2e, 0xee, 0xc4, 0x4d, + 0x87, 0x6d, 0x38, 0xb1, 0xf7, 0x84, 0xda, 0x59, 0x46, 0x25, 0x3b, 0x35, + 0x70, 0x04, 0x9c, 0xa2, + 0x4c, 0xe3, 0x66, 0xc8, 0xd3, 0xb8, 0xc3, 0x03, 0xb3, 0xd1, 0x2c, 0xe9, + 0x30, 0x74, 0xb8, 0x78, + 0x14, 0x9a, 0x47, 0x38, 0xdf, 0x4c, 0x7e, 0x06, 0x9a, 0x27, 0xcd, 0x47, + 0x47, 0x04, 0xcf, 0x82, + 0xe7, 0x06, 0x2f, 0x86, 0xcb, 0x94, 0x30, 0x6c, 0x30, 0x44, 0x72, 0x7e, + 0x11, 0x0a, 0xba, 0x0c, + 0x05, 0x63, 0x3d, 0xbc, 0x5d, 0x5b, 0x03, 0x79, 0x1d, 0x42, 0xa8, 0x63, + 0xc8, 0x6b, 0x08, 0x08, + 0x1a, 0x0b, 0x56, 0xea, 0xad, 0x60, 0x27, 0xbe, 0x60, 0x04, 0x2e, 0xd8, + 0x83, 0xe5, 0x3e, 0x62, + 0x63, 0xb2, 0xd9, 0xb8, 0x98, 0xc3, 0x28, 0xf1, 0xf5, 0xd9, 0xb5, 0x88, + 0xe2, 0x47, 0x41, 0xa0, + 0xcf, 0x46, 0xee, 0xc3, 0xc2, 0x69, 0x8d, 0xa5, 0x1b, 0xe8, 0x91, 0xd6, + 0xf8, 0xb4, 0x0d, 0xfa, + 0x4d, 0xe0, 0x98, 0x35, 0x2c, 0xe9, 0xd0, 0xec, 0xb7, 0x38, 0xa4, 0x0e, + 0xfe, 0xf0, 0x7c, 0x13, + 0x82, 0x65, 0x76, 0xb5, 0x80, 0xe2, 0x60, 0x7f, 0xed, 0x67, 0x94, 0xbc, + 0x26, 0x98, 0x76, 0x30, + 0xe1, 0x49, 0x23, 0xf4, 0xb5, 0xa4, 0x3a, 0xf8, 0xc5, 0xa1, 0x72, 0x5f, + 0xa2, 0xce, 0x57, 0xc6, + 0x7e, 0x7c, 0x0f, 0x7b, 0xd3, 0x8e, 0x1c, 0x93, 0xd4, 0xf5, 0x5c, 0xfa, + 0xf6, 0x66, 0xec, 0xab, + 0xbf, 0x96, 0x2e, 0xdf, 0x24, 0xf7, 0x35, 0xa9, 0x07, 0xeb, 0x76, 0x84, + 0x09, 0xfe, 0x3d, 0x17, + 0x8a, 0xa3, 0x9e, 0x68, 0x2f, 0xda, 0x18, 0xee, 0x26, 0x6d, 0x93, 0x40, + 0x8e, 0x62, 0x6f, 0xf4, + 0x19, 0x84, 0x1b, 0x09, 0xff, 0xd2, 0xa7, 0x08, 0x13, 0x84, 0x2a, 0x81, + 0xd8, 0x48, 0x42, 0x05, + 0x76, 0xa3, 0x33, 0xb5, 0xeb, 0xb1, 0x57, 0x59, 0x2d, 0xdc, 0xa9, 0xac, + 0x10, 0xee, 0xd0, 0x6a, + 0x05, 0x56, 0x97, 0x84, 0xa6, 0x60, 0x80, 0xf7, 0x85, 0x3a, 0xf0, 0xd6, + 0x70, 0x37, 0xd0, 0x0d, + 0x0f, 0xbe, 0xd3, 0x58, 0x29, 0x2c, 0x8b, 0x84, 0xe1, 0x7d, 0x91, 0x36, + 0xd0, 0x14, 0x69, 0x84, + 0xed, 0xe1, 0x36, 0xbe, 0x9d, 0xf0, 0x91, 0x86, 0x50, 0x13, 0x86, 0xd1, + 0x35, 0x6c, 0x55, 0xcf, + 0xb4, 0xba, 0x85, 0xad, 0xb3, 0x3c, 0x53, 0x43, 0x13, 0xb9, 0x6a, 0xa9, + 0x14, 0xcd, 0xd2, 0x16, + 0xb3, 0xe7, 0xa9, 0x77, 0x08, 0xcb, 0x82, 0xcb, 0xe1, 0x6d, 0xc1, 0x65, + 0x70, 0x6d, 0xd0, 0x0b, + 0x40, 0x10, 0xc0, 0x5a, 0xdd, 0x8f, 0x1a, 0xd5, 0x6e, 0xa4, 0x69, 0xcb, + 0xd1, 0x5d, 0x7a, 0x03, + 0xea, 0x36, 0xda, 0x70, 0x93, 0xd1, 0x80, 0x1a, 0xb5, 0x06, 0x82, 0x31, + 0x0d, 0x28, 0xae, 0x19, + 0x48, 0x57, 0x55, 0xf4, 0x47, 0x9d, 0x65, 0x6d, 0xf2, 0x1c, 0x7c, 0x64, + 0xe8, 0x58, 0x70, 0x6c, + 0xc3, 0x42, 0x66, 0x76, 0xc8, 0xed, 0x9f, 0xa2, 0x1e, 0x0d, 0x5c, 0x52, + 0x09, 0x34, 0x75, 0x3a, + 0xb1, 0x84, 0x27, 0xf6, 0x38, 0xe1, 0x69, 0x93, 0x61, 0x34, 0xf2, 0x06, + 0xf7, 0xbc, 0xa6, 0xf2, + 0xac, 0x72, 0xb7, 0xf0, 0xa0, 0x3e, 0x13, 0x95, 0x2a, 0x2e, 0x30, 0x41, + 0x99, 0x04, 0xaa, 0x64, + 0xd2, 0x57, 0xc9, 0x05, 0x27, 0xca, 0x17, 0x73, 0x1d, 0xaa, 0x81, 0xe2, + 0xe1, 0x2d, 0xf0, 0x46, + 0x62, 0x83, 0x54, 0x07, 0x67, 0xb3, 0x47, 0x4a, 0x93, 0x61, 0xb9, 0x50, + 0x05, 0x8f, 0xd7, 0xe6, + 0xfb, 0x8f, 0x57, 0x4f, 0x86, 0xa7, 0xa9, 0x67, 0xc2, 0x2b, 0x95, 0x9b, + 0xe1, 0x0a, 0xfd, 0x56, + 0x78, 0x8d, 0x7a, 0x25, 0xdc, 0x20, 0x03, 0xfc, 0x53, 0xe5, 0x04, 0x74, + 0x86, 0x7a, 0x31, 0xf4, + 0x04, 0x37, 0xc1, 0x58, 0xc8, 0x40, 0x41, 0xcd, 0xc0, 0x61, 0x5d, 0x26, + 0xb6, 0xaa, 0x8a, 0x37, + 0xc6, 0x97, 0xf9, 0x4b, 0x5a, 0xcb, 0xbc, 0x33, 0x23, 0x13, 0xd9, 0x0a, + 0xc5, 0x85, 0x9c, 0x4a, + 0x19, 0x9c, 0xad, 0x1e, 0x81, 0x8e, 0x10, 0x8f, 0x03, 0x27, 0x48, 0xc7, + 0x83, 0x53, 0xc4, 0x1f, + 0x82, 0xcb, 0x94, 0x25, 0xf8, 0x5a, 0xf5, 0x0c, 0x7c, 0x8d, 0xda, 0xcb, + 0x3f, 0x26, 0x89, 0xe8, + 0x27, 0xe2, 0xe9, 0x78, 0x91, 0x72, 0x0e, 0x5e, 0xae, 0xf5, 0xa0, 0x66, + 0x23, 0x8a, 0xe2, 0x04, + 0xfb, 0x43, 0x14, 0xf7, 0x83, 0x71, 0x3e, 0xae, 0xc7, 0xb0, 0xae, 0x3e, + 0x80, 0x9f, 0xd0, 0x2a, + 0x01, 0xdd, 0xd1, 0xbd, 0x42, 0x9a, 0x80, 0x26, 0xca, 0xd5, 0xa8, 0x5c, + 0x2a, 0x44, 0x73, 0x03, + 0x8b, 0x89, 0xfd, 0xdb, 0xc2, 0xc5, 0xc9, 0x5a, 0xb3, 0x35, 0xf8, 0x3c, + 0xbb, 0xb4, 0x63, 0x6a, + 0xed, 0x31, 0xbd, 0x8b, 0x6b, 0x8e, 0x6a, 0x9c, 0xc6, 0xb8, 0xa4, 0x02, + 0x74, 0xa2, 0x7c, 0x3e, + 0x98, 0x28, 0x4f, 0x27, 0xf8, 0x37, 0x93, 0x9b, 0xab, 0x1c, 0x83, 0x4e, + 0x53, 0xae, 0x41, 0xcb, + 0x94, 0x1b, 0xe1, 0x15, 0xe2, 0x65, 0xf0, 0x72, 0xfe, 0x42, 0x78, 0x7a, + 0xe0, 0x48, 0x74, 0x44, + 0x60, 0x11, 0x3a, 0x57, 0x46, 0xa8, 0x45, 0xd5, 0x91, 0xac, 0x12, 0xee, + 0xa7, 0xf2, 0x08, 0xa9, + 0x18, 0x61, 0x5d, 0x02, 0xaa, 0x21, 0x00, 0x9f, 0xe1, 0x03, 0x40, 0x47, + 0xa4, 0x31, 0x80, 0xd5, + 0x01, 0xd8, 0xa0, 0x45, 0xe1, 0x0b, 0xe8, 0xa2, 0x91, 0x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, 0xe2, 0xe1, 0xe8, + 0x58, 0x75, 0x03, 0xda, 0x19, 0x7c, 0x4c, 0x78, 0x24, 0xf8, 0xa0, 0xb0, + 0x3d, 0xf4, 0x30, 0x7f, + 0xbf, 0x7e, 0xaf, 0xb8, 0x45, 0xdb, 0x26, 0x6c, 0x37, 0x7a, 0x70, 0x9b, + 0xde, 0x89, 0xef, 0xd6, + 0xef, 0x15, 0xb6, 0x07, 0x1f, 0x12, 0xb7, 0x87, 0x7b, 0x70, 0x53, 0xb8, + 0x15, 0xb6, 0x46, 0x3a, + 0x50, 0x57, 0xa4, 0x07, 0x77, 0x86, 0x5b, 0x41, 0x5b, 0xa8, 0x0b, 0xdf, + 0x15, 0x39, 0x1f, 0xce, + 0xee, 0x38, 0xb2, 0x6e, 0x56, 0x64, 0x92, 0xcf, 0xad, 0xb9, 0x60, 0x95, + 0xec, 0x42, 0x33, 0xf5, + 0xd3, 0x59, 0xa0, 0x3f, 0xc6, 0xdf, 0x1b, 0xbe, 0x17, 0x6d, 0x09, 0x6d, + 0x45, 0x9b, 0xc2, 0x9d, + 0xa8, 0xc3, 0xe8, 0xc2, 0x1b, 0xf5, 0x6e, 0xdc, 0xa2, 0xb7, 0xe2, 0x5e, + 0x6d, 0x0b, 0xbf, 0x45, + 0x6b, 0xc5, 0x71, 0xbd, 0x19, 0xb5, 0x93, 0xd6, 0x48, 0xb0, 0xb0, 0x51, + 0x6f, 0x21, 0x2d, 0x4e, + 0x30, 0x30, 0x06, 0xbf, 0x52, 0x0d, 0xae, 0x3a, 0x7c, 0x32, 0x38, 0x21, + 0x7e, 0x8c, 0x6f, 0x7e, + 0xd3, 0x4c, 0x66, 0x92, 0x56, 0x4a, 0xf8, 0xe4, 0x39, 0xa0, 0x44, 0xb6, + 0x41, 0xa7, 0x54, 0x84, + 0xec, 0x81, 0x12, 0x54, 0x2c, 0x94, 0x62, 0x07, 0x7d, 0x9e, 0xe4, 0x53, + 0xe1, 0x5e, 0xed, 0x5f, + 0xf0,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, 0xf9, + 0x26, 0xa3, 0x8d, 0x5c, 0x5b, 0x0b, 0x6c, 0xd6, 0x09, 0xdf, 0x25, 0x98, + 0x15, 0x0e, 0x6e, 0x83, + 0x9b, 0x1b, 0xe6, 0x33, 0x15, 0xc1, 0xf1, 0x5c, 0x95, 0xe8, 0x26, 0x58, + 0x55, 0x81, 0x4a, 0xf8, + 0x7c, 0x3c, 0x45, 0xba, 0x16, 0xd3, 0x3e, 0xb6, 0x06, 0xbb, 0x70, 0x6f, + 0xb0, 0x1d, 0xb7, 0x19, + 0xcd, 0xa0, 0xd3, 0xe8, 0x84, 0x2d, 0xa4, 0x3f, 0xf1, 0x60, 0x9c, 0xf4, + 0xb1, 0x93, 0xf0, 0xdd, + 0x4e, 0xc2, 0xfd, 0xda, 0x50, 0x7b, 0xb0, 0x15, 0xb6, 0x84, 0x9a, 0x61, + 0x53, 0xb0, 0x99, 0x7c, + 0x77, 0x33, 0x59, 0x67, 0xda, 0x71, 0xc4, 0x78, 0x0c, 0xfd, 0x5c, 0x75, + 0xc2, 0x42, 0xd1, 0xc9, + 0x57, 0x8a, 0x65, 0xd4, 0x47, 0x4e, 0xf0, 0x3d, 0x1f, 0x1d, 0x23, 0x5e, + 0x88, 0x82, 0x46, 0x1b, + 0x17, 0xd1, 0x5a, 0xb9, 0x57, 0x5b, 0x6e, 0x64, 0x66, 0xb6, 0x2d, 0xf4, + 0xcc, 0x08, 0x4f, 0xe0, + 0x5c, 0xa4, 0x9f, 0x55, 0x92, 0x1d, 0x2e, 0x54, 0xce, 0x27, 0xb6, 0x6b, + 0x2f, 0x68, 0x32, 0x62, + 0x20, 0x1e, 0x6a, 0x00, 0x8d, 0xa1, 0x08, 0x88, 0x84, 0xa2, 0x20, 0x1a, + 0x0c, 0x12, 0xdc, 0x24, + 0xf6, 0xae, 0xda, 0x40, 0x30, 0xbd, 0x01, 0xa8, 0xba, 0x0a, 0x02, 0xba, + 0x08, 0x14, 0x43, 0x06, + 0x42, 0x50, 0x04, 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x70, 0x84, 0xef, 0xb0, + 0xd0, 0x04, 0x9f, 0x8b, + 0xd8, 0xb0, 0x4e, 0xb1, 0x04, 0x4d, 0x57, 0x5d, 0xa0, 0x56, 0x7f, 0x09, + 0xae, 0x50, 0x67, 0x22, + 0xc2, 0x5e, 0x09, 0xb7, 0x2b, 0x86, 0xd5, 0xea, 0x3c, 0x74, 0x4a, 0xf0, + 0x2c, 0x6e, 0x5e, 0x30, + 0x1f, 0x14, 0x87, 0x57, 0xc2, 0x58, 0x64, 0x32, 0xb0, 0x8b, 0x65, 0xa8, + 0x54, 0xa0, 0xbe, 0xd7, + 0x62, 0xc2, 0x13, 0x1d, 0xf0, 0x18, 0x6d, 0x39, 0xb7, 0x39, 0x14, 0x47, + 0x9b, 0x23, 0x3b, 0xc0, + 0xb1, 0x7a, 0x19, 0xe7, 0x0e, 0x54, 0xe3, 0x69, 0x82, 0x13, 0x55, 0x88, + 0xe5, 0xf0, 0xdc, 0x20, + 0xe0, 0x7a, 0x43, 0x31, 0x62, 0xc7, 0x47, 0x51, 0x28, 0x14, 0xc2, 0x91, + 0x48, 0x0c, 0x46, 0x43, + 0x06, 0x0c, 0x87, 0xc2, 0x84, 0xe7, 0x05, 0xc9, 0x7b, 0x51, 0x1c, 0x09, + 0x6b, 0xb0, 0x21, 0xbc, + 0x19, 0x6e, 0xd5, 0x08, 0x3e, 0x53, 0x8e, 0x6a, 0xec, 0x00, 0xdb, 0xc3, + 0x53, 0xfc, 0x0e, 0xc5, + 0x0d, 0xdd, 0x92, 0x93, 0x2f, 0x25, 0x58, 0x55, 0xce, 0x3b, 0xb0, 0x53, + 0xbc, 0x84, 0xe0, 0x18, + 0xe5, 0x7d, 0x84, 0xc3, 0xea, 0xc4, 0xbe, 0x25, 0x36, 0x6e, 0xd0, 0x30, + 0x50, 0x84, 0x70, 0x47, + 0x72, 0xc4, 0x21, 0x23, 0x8e, 0xe3, 0x41, 0xf2, 0x7d, 0xa1, 0x08, 0x8a, + 0x05, 0x09, 0x56, 0x19, + 0x4d, 0xa0, 0x21, 0x18, 0x07, 0x71, 0xad, 0x8b, 0xe0, 0x62, 0x17, 0xf9, + 0xdc, 0xe3, 0xf0, 0x25, + 0xd2, 0x47, 0xbb, 0x58, 0x49, 0xbe, 0xb3, 0x98, 0xe0, 0x5f, 0x31, 0xf9, + 0xd6, 0x71, 0xf8, 0x38, + 0xe9, 0x12, 0x64, 0x04, 0xbb, 0x60, 0x93, 0xd1, 0xc2, 0xbd, 0xd0, 0x74, + 0xad, 0xdf, 0x15, 0x99, + 0xc2, 0x4d, 0x50, 0xaa, 0x71, 0xb5, 0xe4, 0x42, 0xe5, 0x62, 0x01, 0x58, + 0x28, 0x9f, 0x85, 0xd6, + 0x69, 0x51, 0x20, 0x1b, 0x0a, 0x90, 0x83, 0x12, 0x10, 0x83, 0x02, 0xc1, + 0x36, 0x72, 0x34, 0x24, + 0x4e, 0x30, 0x78, 0x4e, 0xd2, 0x34, 0x20, 0xab, 0x3c, 0xf9, 0x3d, 0x40, + 0x70, 0x8f, 0x70, 0xc2, + 0x20, 0x07, 0x90, 0xc1, 0x12, 0xdc, 0x13, 0xc8, 0xd1, 0xcf, 0xb1, 0x06, + 0xc7, 0x31, 0x86, 0x97, + 0xb4, 0x3a, 0xe0, 0xd1, 0xeb, 0x41, 0x8d, 0x5e, 0x0b, 0xee, 0x20, 0x1c, + 0x71, 0x1b, 0xba, 0x70, + 0x04, 0x07, 0xa0, 0xfa, 0x5d, 0xc6, 0xd8, 0x0c, 0xb1, 0x18, 0xcc, 0xbc, + 0x67, 0xf1, 0x2d, 0x57, + 0xbe, 0x4e, 0x6c, 0xdc, 0xe1, 0xb8, 0xf7, 0x06, 0x73, 0x5a, 0xef, 0x03, + 0xcf, 0x5e, 0xfb, 0x81, + 0xfe, 0x9d, 0xe7, 0xde, 0x17, 0x57, 0x5e, 0xb4, 0xf2, 0x85, 0x45, 0x17, + 0x0f, 0xe7, 0x30, 0x66, + 0xbe, 0x49, 0x52, 0x6d,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1, 0xf2, 0xf4, + 0xfb, 0x07, 0x53, 0x5c, 0xd7, 0x2c, 0xe6, 0xfd, 0x44, 0x86, 0xd6, 0xae, + 0xa1, 0xf6, 0xef, 0xae, + 0xd0, 0x46, 0xf4, 0x50, 0xe4, 0x01, 0x74, 0x5f, 0xe4, 0x61, 0xf4, 0x60, + 0x6c, 0x3b, 0x7c, 0x28, + 0xba, 0x1d, 0x3d, 0x14, 0x7f, 0x87, 0x5b, 0x29, 0x8f, 0x83, 0x13, 0x02, + 0x33, 0xf9, 0x23, 0x42, + 0x8b, 0xd0, 0x09, 0x0d, 0x0b, 0xc1, 0x4c, 0x63, 0x12, 0x5c, 0x64, 0xd4, + 0xe3, 0x67, 0xe2, 0xdb, + 0xf9, 0x7b, 0x23, 0xf7, 0xf3, 0xf7, 0x1a, 0x0f, 0xf0, 0x8f, 0x84, 0xef, + 0x15, 0x7a, 0x8c, 0x67, + 0xd1, 0x37, 0xca, 0xaf, 0xa1, 0xa7, 0x75, 0x36, 0x63, 0x8f, 0x14, 0xb0, + 0x79, 0xf2, 0xb0, 0xe7, + 0x34, 0x30, 0x87, 0xfc, 0x6d, 0x1d, 0xfb, 0x5c, 0xf4, 0x7e, 0xee, 0xde, + 0xf8, 0x55, 0x5c, 0xa1, + 0x56, 0x05, 0x5c, 0x4a, 0x25, 0x5f, 0x21, 0x94, 0x09, 0xc5, 0x82, 0x8d, + 0x2f, 0x0b, 0x9c, 0x0f, + 0x2f, 0x0a, 0x9e, 0x8c, 0x7e, 0x10, 0xff, 0x09, 0x77, 0x6d, 0xe3, 0xd5, + 0xdc, 0x0f, 0x63, 0x97, + 0x82, 0x4b, 0x42, 0x17, 0xc3, 0x4b, 0x8d, 0xcb, 0xc1, 0x55, 0xf2, 0xe5, + 0xf0, 0x32, 0xed, 0x02, + 0x70, 0x61, 0xe4, 0x16, 0xee, 0x4a, 0xf5, 0x58, 0x70, 0x89, 0x16, 0x84, + 0xf7, 0x05, 0xef, 0x81, + 0x9b, 0x83, 0x5b, 0x09, 0x4f, 0xdc, 0x44, 0x38, 0x61, 0x27, 0xf8, 0x5b, + 0x10, 0xc0, 0x42, 0x63, + 0x12, 0x3b, 0x49, 0xae, 0x86, 0x2e, 0xa5, 0x02, 0x97, 0x4b, 0xc5, 0x04, + 0xff, 0x26, 0x72, 0x2b, + 0x83, 0x0f, 0x81, 0xa6, 0xd0, 0x3d, 0xe8, 0x61, 0xc3, 0x80, 0x3f, 0x32, + 0xa6, 0xc2, 0x73, 0x43, + 0xa7, 0x83, 0xe9, 0xc6, 0x74, 0x38, 0x49, 0x99, 0x40, 0xf0, 0x80, 0xa0, + 0x05, 0xc1, 0xa1, 0x12, + 0x91, 0xf0, 0x26, 0xbe, 0x18, 0x97, 0xf2, 0x25, 0xc8, 0x46, 0x70, 0xe4, + 0x27, 0x11, 0xc8, 0x6e, + 0x0e, 0xb5, 0xa1, 0x47, 0x42, 0x4f, 0x82, 0x59, 0x5a, 0x19, 0x8d, 0xc3, + 0xe1, 0x0f, 0x13, 0xdc, + 0xc8, 0x81, 0x6d, 0x78, 0x89, 0x2c, 0xb1, 0x5c, 0x54, 0xf3, 0x86, 0x5b, + 0xe2, 0xde, 0x48, 0xa3, + 0xee, 0x95, 0xa2, 0x12, 0x1b, 0x88, 0xc5, 0x7d, 0xf1, 0x78, 0xd4, 0x17, + 0x8d, 0x12, 0x92, 0x64, + 0xd4, 0x82, 0x06, 0x85, 0x83, 0x67, 0x4b, 0xd7, 0x21, 0xcd, 0xd8, 0x44, + 0xb8, 0xe9, 0x46, 0xd4, + 0x15, 0xdc, 0x0e, 0x1f, 0x31, 0xa6, 0xc1, 0x42, 0xaa, 0x3f, 0x0a, 0x76, + 0x5c, 0x2a, 0x97, 0x9b, + 0x38, 0x34, 0x3b, 0x00, 0x71, 0x50, 0x6f, 0x63, 0x7b, 0xe2, 0xdd, 0x5c, + 0x4f, 0x88, 0xf4, 0x43, + 0xdd, 0xc4, 0x3d, 0x14, 0x7e, 0x98, 0x79, 0x3c, 0xfa, 0x38, 0xb3, 0x23, + 0xf2, 0x28, 0xfb, 0x60, + 0x70, 0x3b, 0xd8, 0xa1, 0xed, 0x00, 0x8f, 0x92, 0xb6, 0x43, 0x79, 0x12, + 0x3d, 0x29, 0x3f, 0x82, + 0xb6, 0xa8, 0x0f, 0xa3, 0x5a, 0x75, 0x15, 0x7c, 0x30, 0xb8, 0x11, 0xb5, + 0x05, 0x7f, 0x06, 0x5f, + 0x50, 0xa8, 0xfd, 0x5b, 0x8a, 0x4b, 0xcc, 0xef, 0x76, 0x90, 0x3e, 0x8c, + 0xc3, 0x67, 0xca, 0xd7, + 0xf1, 0x6a, 0xb8, 0x07, 0x35, 0x12, 0xfc, 0x7b, 0x2e, 0x7c, 0x19, 0x28, + 0x94, 0xaa, 0x91, 0x4b, + 0xac, 0x24, 0x1c, 0xb7, 0x14, 0x95, 0x91, 0x7b, 0x31, 0x3b, 0x50, 0x8b, + 0x9a, 0xb5, 0x1d, 0xf0, + 0xf9, 0xc0, 0x4b, 0xf0, 0x05, 0xf9, 0x25, 0x6e, 0xa7, 0xf4, 0x12, 0x78, + 0x56, 0x7d, 0x86, 0x7b, + 0x46, 0x7d, 0x96, 0x7d, 0x3c, 0xf8, 0xa0, 0xff, 0x11, 0xfd, 0x31, 0xee, + 0x19, 0xf9, 0x67, 0xec, + 0xb3, 0xe2, 0x73, 0xec, 0x73, 0xc2, 0xd3, 0xec, 0x63, 0xf2, 0x0e, 0x70, + 0x7f, 0x60, 0x07, 0xf0, + 0x04, 0xae, 0x87, 0x98, 0xd8, 0xba, 0x5e, 0x82, 0x7b, 0xb5, 0xfa, 0x06, + 0x6e, 0xbd, 0xbe, 0x01, + 0xac, 0xd3, 0xd6, 0x82, 0xd5, 0xda, 0x5d, 0xe0, 0x36, 0x95, 0x81, 0xcd, + 0xe8, 0xdc, 0x11, 0x76, + 0xa1, 0x43, 0xb7, 0x8d, 0xb4, 0x93, 0xe2, 0x47, 0xae, 0x4f, 0x69, 0xe3, + 0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0x43, 0x75, 0x20, 0x07, 0xb1, 0xa5, 0x27, 0x09, 0x25, 0xb8, + 0x94, 0xb0, 0x2c, 0xc2, + 0x1d, 0x50, 0xa5, 0x3e, 0x85, 0x9b, 0x12, 0xae, 0x04, 0xf9, 0x14, 0xe3, + 0xe5, 0x7c, 0x68, 0x8b, + 0xd9, 0xd9, 0x42, 0x3d, 0x2f, 0x91, 0x13, 0x18, 0xc8, 0x47, 0x79, 0x6a, + 0x29, 0x5c, 0x61, 0x3c, + 0x00, 0x1f, 0x09, 0x6e, 0x84, 0xbd, 0x46, 0x2f, 0xda, 0x18, 0x7c, 0x00, + 0x6e, 0x53, 0xc7, 0xc3, + 0x7c, 0xde, 0xce, 0x17, 0xe1, 0xe2, 0x84, 0x4e, 0x07, 0x6d, 0xb8, 0x42, + 0x76, 0xf3, 0x93, 0x42, + 0x73, 0xb8, 0xc3, 0x22, 0x2e, 0x98, 0x27, 0x24, 0xe2, 0x08, 0xed, 0xd1, + 0x2a, 0xb6, 0x3a, 0x56, + 0xc1, 0x94, 0x04, 0x09, 0x4f, 0x09, 0x10, 0x6e, 0x2f, 0x8e, 0x43, 0x79, + 0x34, 0x9f, 0x50, 0x4a, + 0xe4, 0xd6, 0x8d, 0x23, 0xb8, 0x9e, 0xaf, 0x2e, 0x87, 0x8f, 0x13, 0xfc, + 0xeb, 0x08, 0x3e, 0x07, + 0x1f, 0x57, 0x4b, 0x60, 0x81, 0x40, 0x75, 0x3f, 0x7a, 0xfd, 0x25, 0xb8, + 0x84, 0x8c, 0xd7, 0x79, + 0xca, 0x06, 0xac, 0x45, 0x3a, 0x41, 0xa3, 0xd1, 0xcc, 0x3e, 0x13, 0x3a, + 0x17, 0xe5, 0x13, 0xdb, + 0xbd, 0x8c, 0x27, 0xfd, 0x30, 0xf5, 0x4f, 0x3b, 0xae, 0x14, 0x8f, 0xc5, + 0x0b, 0xa5, 0x05, 0xe8, + 0xa8, 0xc0, 0x22, 0x78, 0x66, 0xe8, 0x12, 0x70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0x3f, + 0xda, 0xbd, 0x69, 0x47, + 0x5f, 0xbb, 0x66, 0x68, 0x3d, 0x97, 0x01, 0xbf, 0x49, 0xb6, 0x7c, 0x13, + 0x3c, 0x32, 0xc7, 0xc5, + 0x20, 0xcf, 0xd8, 0xde, 0xf0, 0xfd, 0xe8, 0xe9, 0xe8, 0x33, 0xe0, 0x99, + 0xe8, 0x53, 0xe8, 0xc9, + 0xd8, 0x93, 0xf0, 0x31, 0x82, 0x85, 0xcf, 0x44, 0x3e, 0x87, 0xfe, 0x86, + 0x29, 0xe0, 0x94, 0xa6, + 0x93, 0xc0, 0xc2, 0xd8, 0x0c, 0x34, 0x4d, 0x9b, 0x84, 0xaa, 0x03, 0x13, + 0xf1, 0x82, 0x10, 0xc0, + 0x2f, 0x07, 0x1f, 0x45, 0x8f, 0x87, 0x1f, 0x45, 0x0f, 0x46, 0x9f, 0x44, + 0x9f, 0xea, 0xbf, 0x64, + 0xb5, 0x8e, 0x33, 0x7d, 0x8e, 0xae, 0x32, 0x5f, 0xb5, 0x51, 0x86, 0x4a, + 0x78, 0x1b, 0xe1, 0x74, + 0x65, 0xa8, 0x54, 0x2c, 0x83, 0xa5, 0x92, 0x13, 0x4d, 0xd0, 0xe6, 0x72, + 0x73, 0x63, 0xa7, 0x72, + 0x97, 0x18, 0x22, 0xfb, 0xb3, 0xd8, 0xbd, 0xdc, 0xce, 0xd8, 0x0d, 0x4c, + 0x9e, 0xe8, 0x22, 0x36, + 0x20, 0xc1, 0x21, 0x8a, 0x2a, 0x7c, 0x19, 0x74, 0x69, 0xd3, 0xe1, 0xec, + 0xd0, 0x5c, 0x70, 0x58, + 0x70, 0x12, 0xb1, 0xb7, 0xcb, 0x91, 0x13, 0x11, 0x6c, 0xa4, 0xff, 0x26, + 0x96, 0x60, 0x9b, 0x3a, + 0x05, 0xcf, 0xd4, 0x8f, 0x45, 0x30, 0xd8, 0x8a, 0x9e, 0xd0, 0x9f, 0x47, + 0xdb, 0x09, 0x9f, 0xba, + 0x3f, 0x78, 0x1f, 0xdc, 0x4a, 0x38, 0xe0, 0x36, 0x82, 0x7f, 0x9b, 0x09, + 0x77, 0xda, 0x19, 0xba, + 0x05, 0xe4, 0x2b, 0xe3, 0xa1, 0x9b, 0x70, 0x3a, 0x87, 0xe8, 0x40, 0x25, + 0x82, 0x0d, 0x4f, 0xd4, + 0x4e, 0xe5, 0x58, 0xc2, 0xff, 0x7a, 0x08, 0xb7, 0xdd, 0xa2, 0x6f, 0x84, + 0x5b, 0xf5, 0x27, 0x51, + 0xb3, 0xae, 0xa2, 0xf5, 0xca, 0x99, 0x68, 0x92, 0xe4, 0xc0, 0x94, 0x37, + 0x15, 0x0b, 0x14, 0x17, + 0x1c, 0x26, 0x7e, 0x38, 0x08, 0x56, 0x4f, 0x35, 0x66, 0x82, 0x1f, 0xc4, + 0x18, 0xdf, 0x96, 0x60, + 0x17, 0x7c, 0xda, 0xf8, 0xff, 0xd8, 0xbb, 0xee, 0xf8, 0x28, 0xaa, 0xb5, + 0x9d, 0xde, 0x7b, 0xe8, + 0xbd, 0x49, 0xb5, 0x21, 0x22, 0x08, 0x16, 0x04, 0x45, 0xe5, 0xaa, 0xd8, + 0xaf, 0xf5, 0xb3, 0x8b, + 0x15, 0x90, 0x12, 0xb2, 0x3b, 0x73, 0xca, 0xec, 0xce, 0x4e, 0xd9, 0x96, + 0x46, 0x00, 0x11, 0x15, + 0x0b, 0x0a, 0xa8, 0x28, 0x48, 0x11, 0x08, 0xbd, 0x4b, 0xef, 0x24, 0x24, + 0x01, 0x42, 0x6f, 0xd2, + 0x44, 0xc5, 0x7b, 0x95, 0xef, 0x3d, 0xb3, 0xbb, 0x61, 0x93, 0x6c, 0x99, + 0x85, 0xd5, 0xeb, 0x1f, + 0xfc, 0xce, 0xef, 0xb0, 0x61, 0xb3, 0x75, 0x32, 0xef, 0x33, 0x6f, 0x7b, + 0x9e, 0x77, 0x3a, 0xaa, + 0x6f, 0x89, 0x23, 0xf1, 0xa6, 0x74, 0xd2, 0x04, 0x1e, 0x17, 0x67, 0x4a, + 0x11, 0x1a, 0x4b, 0x1d, + 0xd1, 0x8d, 0x05, 0xd7, 0xe1, 0xe6, 0xe0, 0x77, 0x25, 0xcb, 0x59, 0xa4, + 0x45, 0x7e, 0x3b, 0x63, + 0x73, 0x7b, 0x7d, 0xbe, 0xbe, 0x99, 0x69, 0x40, 0x75, 0xc3, 0x39, 0xf6, + 0xe1, 0x78, 0x28, 0x7c, + 0xbe, 0xa5, 0xf6, 0x29, 0x78, 0x92, 0x6d, 0x32, 0xf9, 0x1c, 0xfc, 0xbf, + 0x89, 0xf6, 0xc5, 0xb8, + 0x44, 0x4d, 0xc2, 0x11, 0x80, 0x7e, 0xf1, 0xe0, 0xa3, 0x25, 0x08, 0xb1, + 0xa6, 0x18, 0x31, 0x9b, + 0x76, 0xc9, 0xeb, 0x81, 0x6f, 0x2c, 0x6c, 0x43, 0x1a, 0x58, 0x12, 0x49, + 0xac, 0x29, 0x03, 0x35, + 0x72, 0xb4, 0xe4, 0x9a, 0xe7, 0xb7, 0xe0, 0x1a, 0xaa, 0x69, 0x7c, 0x82, + 0x39, 0x86, 0x44, 0x9b, + 0x62, 0x68, 0x0c, 0x7c, 0x8f, 0x18, 0x01, 0x6e, 0x49, 0x2c, 0x89, 0x01, + 0xff, 0x33, 0x5e, 0x48, + 0x26, 0x3d, 0x55, 0x91, 0x7c, 0xe3, 0x98, 0x88, 0x3f, 0xb2, 0x7f, 0x0b, + 0xf8, 0x9a, 0x42, 0x22, + 0x01, 0xd3, 0xe2, 0x01, 0x57, 0x21, 0x7a, 0x07, 0x2f, 0x36, 0x9a, 0x3c, + 0x68, 0x35, 0x20, 0x5b, + 0xde, 0x47, 0x68, 0xac, 0x6d, 0x34, 0x3f, 0xc9, 0x71, 0x2b, 0x89, 0x10, + 0x58, 0xed, 0x3b, 0x01, + 0x8e, 0x49, 0x3c, 0x89, 0x37, 0x27, 0x9b, 0xe2, 0x85, 0x08, 0x13, 0xd8, + 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x91, 0x4c, 0xb9, + 0x3d, 0x7f, 0x8f, 0xfa, + 0x10, 0xd7, 0x5f, 0xea, 0x4d, 0x3a, 0x4a, 0xcd, 0x71, 0x43, 0xe9, 0x66, + 0xda, 0x8a, 0xc6, 0x99, + 0x53, 0xc5, 0x7a, 0x42, 0x07, 0x67, 0x67, 0xbe, 0x9d, 0xa3, 0x09, 0x4a, + 0x94, 0x5b, 0x90, 0x81, + 0x05, 0x4e, 0x7e, 0x61, 0xde, 0xd7, 0xfc, 0x92, 0x82, 0x27, 0x21, 0x16, + 0x02, 0xff, 0x0e, 0x7c, + 0xbb, 0x14, 0xb1, 0x01, 0x6d, 0x6e, 0xbb, 0x86, 0x6b, 0x5f, 0xd0, 0x81, + 0x6b, 0x65, 0x6b, 0xca, + 0x35, 0x95, 0x1b, 0xa1, 0x7a, 0x62, 0x03, 0x92, 0x2d, 0x67, 0xd1, 0xfa, + 0x6a, 0x3d, 0xd2, 0x46, + 0x69, 0x00, 0x31, 0xd9, 0x08, 0x32, 0xd3, 0xba, 0x1c, 0x36, 0xc4, 0xb0, + 0xf6, 0x39, 0x64, 0x96, + 0xed, 0x7b, 0xc0, 0x40, 0x86, 0x7f, 0xb0, 0x6d, 0xd3, 0xd0, 0x34, 0xc7, + 0x54, 0xb2, 0x5a, 0x7d, + 0x09, 0xfc, 0x9c, 0x2c, 0x92, 0x66, 0x62, 0xb9, 0xb0, 0x14, 0xad, 0x97, + 0xa5, 0x8d, 0xed, 0x31, + 0x7e, 0xb4, 0x7d, 0x0e, 0xff, 0x35, 0xf8, 0x61, 0x53, 0xad, 0xd3, 0xc9, + 0x37, 0xd6, 0x6f, 0xc8, + 0x34, 0xeb, 0x57, 0x64, 0xb6, 0xb2, 0x08, 0x17, 0xcb, 0xf7, 0x93, 0xa6, + 0x52, 0x1b, 0x92, 0x6d, + 0x8e, 0x25, 0x29, 0x8c, 0x6f, 0x2b, 0x35, 0x26, 0x1d, 0xed, 0x5d, 0xf8, + 0x0e, 0x05, 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xdc, 0xb7, 0x28, 0x73, 0x60, 0x5c, 0x0b, + 0x4d, 0xe7, 0x2b, 0x2a, + 0xa8, 0xce, 0x17, 0x3b, 0x26, 0x09, 0xbe, 0xf8, 0x26, 0x5e, 0x75, 0x93, + 0x04, 0x7b, 0x4a, 0xae, + 0x4b, 0xe7, 0x2b, 0x30, 0xdf, 0x24, 0x94, 0xd9, 0xb4, 0x31, 0xba, 0xfa, + 0xf5, 0x12, 0xf4, 0x6a, + 0xd7, 0x04, 0xe5, 0x9b, 0xb0, 0xef, 0xe5, 0xcd, 0x37, 0xb1, 0x0b, 0x80, + 0x7f, 0xf9, 0xf3, 0xd1, + 0xca, 0x82, 0x65, 0xdc, 0x8a, 0xc2, 0x65, 0xe0, 0x03, 0x2e, 0xe3, 0x97, + 0xe7, 0xad, 0xe4, 0x17, + 0x5a, 0xcf, 0x73, 0xce, 0xa2, 0x14, 0xae, 0x85, 0xa5, 0xb1, 0x50, 0x4f, + 0xcc, 0x34, 0xd5, 0x03, + 0xaf, 0x2e, 0x5d, 0x88, 0x14, 0x06, 0x39, 0x97, 0xd1, 0xa5, 0xb6, 0xa5, + 0xf4, 0x13, 0xa6, 0xe3, + 0x2c, 0x8b, 0xb4, 0x40, 0xfd, 0x10, 0x7f, 0xa1, 0x4c, 0xe1, 0x27, 0x38, + 0x8a, 0xc9, 0xe8, 0xbc, + 0x71, 0xc8, 0xaa, 0x74, 0xc3, 0x59, 0xe0, 0x65, 0x34, 0x77, 0x74, 0xc1, + 0x5d, 0xec, 0xad, 0x50, + 0x7d, 0x29, 0x83, 0x26, 0x29, 0xad, 0xd0, 0x13, 0x45, 0x85, 0xc6, 0x65, + 0x79, 0xd3, 0xd0, 0xcc, + 0x82, 0x87, 0xe0, 0x33, 0xa6, 0xd0, 0x54, 0x88, 0x01, 0x5b, 0xc8, 0x1d, + 0x68, 0x27, 0x67, 0x33, + 0xf0, 0xff, 0x06, 0xf0, 0x8d, 0xd5, 0x86, 0x7c, 0x0b, 0xf9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, 0x2f, 0xfb, + 0x74, 0x32, 0x1d, 0x3e, 0xdb, 0x34, 0xdb, 0x77, 0x64, 0x9a, 0x7d, 0x19, + 0x1a, 0x6c, 0x8b, 0xe4, + 0x93, 0xe4, 0x0c, 0x92, 0x69, 0x6d, 0x8d, 0x6e, 0xb6, 0xf6, 0x46, 0x77, + 0xe4, 0x77, 0x43, 0x1d, + 0xf2, 0xdb, 0xf1, 0xd7, 0x38, 0xda, 0xc2, 0x77, 0xbf, 0x09, 0xdd, 0xee, + 0xbc, 0x15, 0xdf, 0x28, + 0x5d, 0x4b, 0xaf, 0xb1, 0x34, 0x05, 0x3f, 0x3b, 0x0d, 0xde, 0x33, 0x1e, + 0x47, 0x4a, 0xf5, 0x70, + 0x17, 0xc6, 0x33, 0xa6, 0x09, 0x24, 0x81, 0xa6, 0x92, 0xfa, 0x96, 0x66, + 0xa4, 0xa9, 0x9a, 0x41, + 0x06, 0x3a, 0xc1, 0x07, 0x76, 0x7c, 0x41, 0x26, 0xd9, 0x26, 0x61, 0x83, + 0x3d, 0x05, 0x47, 0x01, + 0xb6, 0x25, 0x82, 0xef, 0xdb, 0x5c, 0x6d, 0x83, 0x9a, 0x4a, 0xc9, 0xa8, + 0x95, 0xda, 0x17, 0x15, + 0x59, 0x3f, 0xc0, 0xa3, 0x6d, 0x45, 0x3c, 0xa7, 0x36, 0xd7, 0xfc, 0xbf, + 0x34, 0xe6, 0xcb, 0x81, + 0x47, 0x97, 0x69, 0x6e, 0x48, 0x3a, 0xc8, 0x37, 0xe1, 0xeb, 0xad, 0x1d, + 0xf8, 0xf6, 0xd6, 0x96, + 0x7c, 0x13, 0xb1, 0x39, 0x69, 0x65, 0x6a, 0x4e, 0x9b, 0x9b, 0x5b, 0xe3, + 0x66, 0x26, 0xb8, 0xee, + 0x90, 0x4c, 0xf0, 0x51, 0x1b, 0xe0, 0x66, 0x2c, 0x9f, 0x88, 0x13, 0x85, + 0x54, 0x5a, 0x5f, 0x68, + 0x2a, 0xb6, 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, 0xe3, 0xbb, 0x48, + 0x5d, 0x48, 0x6f, 0xcd, + 0x17, 0x4c, 0x20, 0x19, 0xe0, 0xdb, 0xb5, 0x92, 0x9b, 0xd2, 0x06, 0x4a, + 0x1a, 0xe9, 0x66, 0xcf, + 0x07, 0x8c, 0x9d, 0x4c, 0x3e, 0x85, 0xef, 0x55, 0x60, 0x8d, 0x26, 0xd1, + 0x34, 0x45, 0x68, 0x28, + 0xb7, 0x26, 0xad, 0x94, 0xfa, 0x28, 0xdd, 0x1c, 0x8d, 0xaf, 0xb5, 0xdc, + 0x4f, 0x14, 0x65, 0x3c, + 0x2a, 0xb4, 0x16, 0xf3, 0x03, 0x94, 0x26, 0xf8, 0x1a, 0x73, 0x07, 0xd2, + 0x45, 0xec, 0x48, 0x3a, + 0x98, 0x3b, 0xe1, 0x0e, 0xe2, 0x75, 0xb8, 0x9b, 0xd8, 0x15, 0xdf, 0xa4, + 0xdc, 0x8b, 0xff, 0x6d, + 0x7b, 0x10, 0xdf, 0x23, 0xdd, 0x86, 0x6f, 0x35, 0xdf, 0x4d, 0x1e, 0x91, + 0x07, 0xa2, 0x7e, 0xe6, + 0x1e, 0xe4, 0x7a, 0x53, 0x47, 0xda, 0xca, 0x7c, 0x3d, 0xed, 0x6a, 0x8e, + 0xa3, 0x69, 0x10, 0x03, + 0x37, 0x86, 0x78, 0xbb, 0x85, 0xa5, 0x29, 0xca, 0xb4, 0x34, 0x40, 0xf7, + 0x48, 0xcf, 0x62, 0xad, + 0x3f, 0x65, 0xd3, 0xd0, 0xde, 0xde, 0xd8, 0xf4, 0xea, 0xac, 0xa7, 0x1f, + 0x7b, 0x50, 0x7c, 0x1c, + 0xbf, 0x40, 0xba, 0x69, 0xdc, 0xff, 0xe8, 0x71, 0xdd, 0xdf, 0x66, 0xf7, + 0xcf, 0x28, 0xbe, 0xf8, + 0x6e, 0x35, 0xba, 0x4d, 0x1e, 0xfa, 0x3c, 0xbb, 0xef, 0x59, 0xd6, 0xef, + 0x32, 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 0x70, 0xae, + 0x80, 0xcf, 0x00, 0x9f, 0xd7, 0x56, 0x82, 0xb6, 0x58, 0x2b, 0xd1, 0x5e, + 0xeb, 0x5e, 0x7c, 0xc0, + 0x7a, 0x00, 0xef, 0x53, 0x0f, 0xe0, 0x2a, 0xb5, 0x82, 0x94, 0xab, 0xe5, + 0x64, 0x8b, 0x75, 0x2b, + 0xd9, 0xac, 0xac, 0x27, 0x47, 0x94, 0xa7, 0x48, 0x3d, 0xdb, 0x4d, 0x7c, + 0x73, 0x7b, 0x43, 0x54, + 0xdf, 0x94, 0x4a, 0x92, 0x59, 0x77, 0x9f, 0xd8, 0x90, 0xa6, 0xc8, 0xaf, + 0xf3, 0xab, 0x95, 0xef, + 0xd0, 0x14, 0x75, 0x0a, 0xff, 0x81, 0xa3, 0x2d, 0x97, 0x2e, 0x65, 0x60, + 0x56, 0xef, 0xd6, 0xfa, + 0x65, 0xe0, 0xef, 0x7f, 0xad, 0x85, 0xa3, 0x36, 0xd9, 0x8a, 0x14, 0x59, + 0xc1, 0x80, 0x7d, 0x98, + 0xca, 0x3c, 0x32, 0xc8, 0x23, 0x01, 0xf7, 0x06, 0xe3, 0x21, 0x16, 0x88, + 0x73, 0x2d, 0xef, 0xa2, + 0xc1, 0x96, 0x21, 0x68, 0x08, 0xec, 0xc1, 0x96, 0x77, 0xf0, 0xe0, 0xf1, + 0x6f, 0xbe, 0xe5, 0xc1, + 0x26, 0x76, 0xfb, 0x46, 0x41, 0xdb, 0x11, 0x6d, 0x2c, 0xf5, 0x70, 0x9a, + 0x98, 0x8c, 0x13, 0x59, + 0xcf, 0x0e, 0x53, 0x48, 0x15, 0xe0, 0x2c, 0x10, 0xbb, 0x93, 0xd7, 0x59, + 0xfd, 0x62, 0xf1, 0x8c, + 0xfb, 0xbc, 0xb1, 0x49, 0x7b, 0xee, 0x57, 0x77, 0x3c, 0x73, 0x17, 0xe9, + 0x58, 0x7d, 0x4e, 0xf5, + 0x59, 0x31, 0xa8, 0xdf, 0xa0, 0x79, 0x2b, 0x1e, 0xf4, 0xf6, 0xe1, 0x3c, + 0x9c, 0xde, 0x6a, 0x5e, + 0x5b, 0x88, 0x6b, 0x22, 0x7b, 0x4d, 0x78, 0x8d, 0x86, 0x6a, 0xc4, 0x28, + 0x7f, 0xf9, 0xf4, 0xcc, + 0xa2, 0xb4, 0x11, 0x61, 0x9d, 0xb7, 0x68, 0xd1, 0x63, 0x77, 0xa9, 0xc1, + 0xf8, 0x26, 0xa3, 0x12, + 0xf2, 0x32, 0x73, 0x32, 0x9d, 0xb1, 0xa3, 0x02, 0xf2, 0x4d, 0x04, 0x57, + 0xdf, 0x4b, 0xb5, 0x1e, + 0x8c, 0x33, 0xde, 0xe8, 0x53, 0xcf, 0x25, 0xc4, 0xbc, 0x5e, 0x76, 0xb8, + 0x67, 0x50, 0x06, 0x3c, + 0x26, 0x8c, 0x6f, 0x92, 0x62, 0xd0, 0x6a, 0x24, 0x01, 0xe6, 0x07, 0x33, + 0x5c, 0x77, 0xe9, 0x74, + 0x07, 0xd3, 0x91, 0x89, 0x0a, 0x41, 0xd3, 0xea, 0xf2, 0xb4, 0x6b, 0x58, + 0xff, 0xcb, 0x21, 0xc7, + 0x66, 0xae, 0xb4, 0xa0, 0xd4, 0x50, 0x99, 0x57, 0xce, 0xef, 0xca, 0xaf, + 0xc0, 0x95, 0x79, 0xa5, + 0x68, 0x7b, 0x7e, 0x05, 0xff, 0xac, 0x14, 0x41, 0x1b, 0x98, 0xea, 0xd1, + 0x2c, 0x31, 0xdb, 0xd4, + 0x58, 0x6e, 0x6f, 0xba, 0xae, 0xa8, 0x23, 0xff, 0x54, 0xc1, 0x48, 0xfe, + 0x25, 0xe5, 0x59, 0xe1, + 0x19, 0xe5, 0x49, 0xe1, 0x19, 0xe9, 0x39, 0xd3, 0x6b, 0xa6, 0x37, 0x4d, + 0x6f, 0xb2, 0xb9, 0x88, + 0x05, 0x23, 0xf8, 0x77, 0x47, 0x3f, 0xc7, 0x3f, 0xea, 0x7c, 0x81, 0xb4, + 0x57, 0x32, 0x48, 0xb6, + 0x25, 0x93, 0x26, 0x9a, 0x63, 0x49, 0x4b, 0x47, 0x6b, 0xfe, 0xde, 0xe2, + 0x77, 0x8d, 0x9f, 0xda, + 0xcb, 0xb8, 0x6d, 0x8e, 0x32, 0x7e, 0xc5, 0xd8, 0xa7, 0x8d, 0xf5, 0xd4, + 0xc6, 0x04, 0x10, 0x55, + 0x48, 0x17, 0xd3, 0x71, 0x96, 0x98, 0x82, 0x93, 0x95, 0x67, 0x91, 0x90, + 0x3f, 0x98, 0x1b, 0xc6, + 0xe6, 0x05, 0xdb, 0x72, 0x78, 0x9c, 0x67, 0x32, 0x5a, 0x9c, 0x16, 0x1e, + 0xd9, 0x72, 0xd0, 0x08, + 0x25, 0x87, 0x70, 0x16, 0x23, 0x19, 0x25, 0x8e, 0xa2, 0x9c, 0xd9, 0x40, + 0x47, 0xc8, 0x2f, 0x92, + 0x57, 0x9d, 0x32, 0xff, 0xb4, 0xb3, 0x07, 0x7a, 0x43, 0xfd, 0x1c, 0x6d, + 0x66, 0xb9, 0xb5, 0xc2, + 0x77, 0xf8, 0xce, 0x85, 0x5d, 0x8c, 0xe0, 0x53, 0x72, 0x99, 0xa6, 0x0c, + 0x16, 0x2b, 0x0a, 0xe9, + 0xb6, 0xfb, 0xd1, 0x24, 0x65, 0x3b, 0x5a, 0x63, 0x5d, 0x83, 0x7e, 0x54, + 0xd7, 0xa2, 0x75, 0xd6, + 0x75, 0xb0, 0xd7, 0xa2, 0xb5, 0xf0, 0x33, 0xdc, 0x87, 0xd7, 0xc9, 0x9b, + 0xc8, 0x94, 0xfc, 0x4e, + 0xa8, 0xa1, 0xb5, 0x21, 0x9f, 0x2d, 0xa4, 0x93, 0x54, 0x21, 0x95, 0xa6, + 0x5a, 0x62, 0xc8, 0xad, + 0x63, 0x26, 0x19, 0xb6, 0xcb, 0xab, 0xc8, 0xa6, 0x82, 0xaf, 0xf8, 0xeb, + 0xf2, 0x9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0x30, 0x6b, 0x04, 0x9b, 0x0d, 0x13, 0x90, 0x6f, + 0x62, 0xba, 0x3c, 0x4d, + 0xab, 0x80, 0xda, 0x35, 0xb5, 0xf4, 0x7c, 0xf2, 0x01, 0xff, 0xce, 0xdb, + 0x76, 0x1a, 0x77, 0x14, + 0x54, 0x1a, 0xf6, 0xe4, 0xed, 0xe1, 0xf6, 0xe4, 0x95, 0xa1, 0x3d, 0x79, + 0x95, 0xa8, 0x22, 0x7f, + 0x17, 0xff, 0x6f, 0x39, 0x82, 0x64, 0x01, 0xfe, 0x35, 0x90, 0xdb, 0x0a, + 0x5d, 0xf2, 0x6f, 0xe4, + 0xbb, 0x8c, 0x6e, 0xcb, 0x65, 0x29, 0xf1, 0x34, 0xc6, 0x5c, 0x7b, 0xce, + 0x43, 0x03, 0xda, 0xb2, + 0xb8, 0xb1, 0x31, 0xa5, 0x10, 0xfc, 0x7d, 0x39, 0x0a, 0xd7, 0x33, 0x37, + 0xa0, 0xe9, 0x62, 0x3c, + 0x6d, 0x62, 0x6b, 0x89, 0x6e, 0x2a, 0x7a, 0xcf, 0x30, 0x33, 0xef, 0x68, + 0xee, 0x81, 0xbc, 0x8d, + 0x86, 0x4d, 0x8e, 0x6d, 0x68, 0xcd, 0xe8, 0xfe, 0x7c, 0x8c, 0x89, 0x69, + 0xca, 0xa4, 0x9b, 0xd2, + 0xcd, 0x19, 0x38, 0xd9, 0x92, 0x26, 0x34, 0x94, 0xb3, 0x48, 0xbc, 0x1a, + 0x89, 0x35, 0x1e, 0x82, + 0x2d, 0x16, 0x25, 0x16, 0x26, 0x18, 0x62, 0x94, 0x08, 0x14, 0xe1, 0xab, + 0x1e, 0x65, 0x89, 0xc1, + 0xe0, 0x93, 0xf1, 0x9d, 0xa5, 0x89, 0xe0, 0x1f, 0xee, 0x43, 0x9b, 0x6c, + 0x9b, 0xf0, 0xaa, 0xa2, + 0x17, 0xb9, 0xa6, 0xf9, 0x2d, 0x8c, 0x0d, 0xd9, 0xec, 0x23, 0x73, 0x1a, + 0xcd, 0x84, 0x48, 0x31, + 0xd5, 0xf1, 0x30, 0xfa, 0xca, 0x5a, 0x06, 0x98, 0xb7, 0x01, 0x30, 0x6f, + 0x23, 0xda, 0x64, 0xdd, + 0x0c, 0x58, 0xb9, 0x01, 0xad, 0x57, 0xd7, 0xc1, 0xde, 0x80, 0xd7, 0xca, + 0xdb, 0xc8, 0x62, 0x47, + 0x7b, 0x9c, 0x0e, 0xcf, 0x49, 0x27, 0x19, 0x42, 0xb2, 0x98, 0x24, 0x24, + 0x4b, 0x71, 0xa4, 0x53, + 0xd1, 0x68, 0x43, 0xb9, 0xb4, 0x8e, 0x6c, 0xb2, 0x7d, 0x44, 0x9a, 0xd8, + 0xea, 0x73, 0xed, 0x47, + 0x77, 0xcd, 0xed, 0x56, 0xd4, 0xc6, 0xd8, 0x58, 0xae, 0x8f, 0x13, 0x4d, + 0x11, 0xd5, 0x73, 0xed, + 0x18, 0x3f, 0x2d, 0x92, 0xf5, 0xe8, 0x0b, 0x7e, 0xb9, 0x42, 0x04, 0xfe, + 0x7e, 0xe4, 0x75, 0x69, + 0x15, 0xde, 0x6b, 0xdb, 0x8c, 0x36, 0xd8, 0x37, 0xa0, 0xd5, 0xf6, 0x15, + 0x68, 0x8f, 0x73, 0x03, + 0x92, 0xf3, 0x7b, 0xa3, 0x14, 0x36, 0x47, 0xcf, 0xe4, 0x35, 0xb3, 0xce, + 0xab, 0xfe, 0x57, 0xcf, + 0xd6, 0x1a, 0x37, 0x29, 0x6a, 0xc3, 0xb5, 0xb0, 0x66, 0xf0, 0xa9, 0x24, + 0x4d, 0x60, 0xdd, 0x79, + 0xcd, 0xac, 0x9d, 0x51, 0x13, 0xcb, 0x63, 0xfc, 0xb7, 0xea, 0x2a, 0x7e, + 0xa6, 0x75, 0x3a, 0xff, + 0x95, 0x3a, 0x9d, 0x97, 0xe4, 0x04, 0x8d, 0x53, 0xc2, 0x7a, 0xa4, 0x19, + 0x87, 0x25, 0x45, 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80, 0xf3, 0xa9, 0xe7, 0xc2, 0x7a, 0x79, 0xf3, 0x93, 0x47, 0x32, 0xde, + 0x46, 0x82, 0x1c, 0x78, + 0xae, 0x7c, 0x8d, 0x7c, 0x7f, 0x88, 0xb8, 0x70, 0x85, 0x33, 0x28, 0x03, + 0xf0, 0x4d, 0xb2, 0x6b, + 0x60, 0x61, 0x7a, 0x20, 0xbe, 0x49, 0x2d, 0xad, 0xfa, 0xbf, 0x42, 0xa7, + 0x9b, 0x07, 0xfc, 0xbb, + 0x28, 0x5c, 0x20, 0xfb, 0xed, 0x3b, 0x8d, 0x65, 0x85, 0x7b, 0x73, 0xf7, + 0xe5, 0x97, 0x73, 0x55, + 0x8e, 0x4a, 0x54, 0xe6, 0xd8, 0x8b, 0x9e, 0x51, 0x98, 0xfe, 0x41, 0x5b, + 0x73, 0xa7, 0xbc, 0xae, + 0xb8, 0x6b, 0x51, 0x27, 0xbe, 0x99, 0xdc, 0x80, 0xd4, 0x17, 0x1a, 0x8b, + 0xcd, 0xcc, 0xf5, 0x4c, + 0x19, 0x34, 0xcb, 0x9c, 0x42, 0xd3, 0xcc, 0xf5, 0xe5, 0x2e, 0xa4, 0x77, + 0x51, 0x6f, 0xee, 0xfa, + 0x31, 0x6d, 0x0c, 0x8d, 0x20, 0x56, 0x6b, 0x64, 0xae, 0x47, 0x32, 0x4c, + 0x71, 0x34, 0x5b, 0xea, + 0x80, 0x5b, 0xdb, 0x7a, 0x71, 0x79, 0xce, 0xfd, 0xc6, 0x43, 0xce, 0x2d, + 0x86, 0x6d, 0xce, 0x5d, + 0xdc, 0xae, 0xbc, 0x9d, 0xdc, 0xaa, 0xc2, 0xde, 0x5c, 0xa4, 0x90, 0x29, + 0xa4, 0x99, 0xd2, 0x85, + 0x4c, 0xc6, 0x71, 0x93, 0x5b, 0xd0, 0xeb, 0x6c, 0x1d, 0x68, 0x33, 0xb9, + 0xa1, 0xd0, 0xd8, 0xda, + 0x92, 0xef, 0x94, 0xd7, 0x81, 0x6b, 0xee, 0xa8, 0xcf, 0x67, 0x89, 0x9a, + 0x4f, 0x26, 0xa4, 0xd3, + 0x74, 0x9a, 0x46, 0x53, 0x29, 0xa0, 0x25, 0x89, 0x92, 0x53, 0xf0, 0xb5, + 0xd6, 0x01, 0xe8, 0x45, + 0x75, 0x02, 0x3a, 0xa9, 0x1c, 0xc1, 0xeb, 0xad, 0xdb, 0xd0, 0x36, 0x75, + 0x17, 0xbf, 0xb2, 0xf8, + 0x61, 0x63, 0x9a, 0xd2, 0x08, 0xd5, 0x83, 0x57, 0x4c, 0x37, 0xa7, 0xd2, + 0x34, 0x53, 0x92, 0x90, + 0x6a, 0xbb, 0x0b, 0x4f, 0x82, 0xf8, 0x72, 0x93, 0xb2, 0x15, 0x6f, 0x55, + 0xb7, 0xe2, 0xed, 0x6a, + 0x29, 0xde, 0xa9, 0x6c, 0xc3, 0xdb, 0xa4, 0xed, 0xdc, 0x16, 0x79, 0x33, + 0xb7, 0xc1, 0xba, 0x03, + 0xfd, 0xa0, 0x36, 0x05, 0xff, 0x29, 0x4d, 0x48, 0x33, 0xa7, 0x99, 0x52, + 0xc5, 0x54, 0x13, 0xdc, + 0x92, 0xa6, 0x79, 0x94, 0xdb, 0xa7, 0x6e, 0x16, 0xb6, 0xaa, 0x45, 0xa4, + 0x51, 0x5e, 0xdb, 0x51, + 0x3d, 0x8a, 0xaf, 0x31, 0x36, 0xb2, 0x36, 0xc6, 0x99, 0x96, 0x0c, 0xc0, + 0x8e, 0x24, 0x4d, 0x47, + 0x20, 0xd5, 0x9c, 0x4d, 0x1a, 0x5a, 0xe0, 0x58, 0x98, 0x33, 0xe1, 0xbb, + 0xa6, 0x10, 0xc6, 0xf7, + 0x4b, 0x01, 0x7f, 0x89, 0xf1, 0x99, 0x53, 0x01, 0x39, 0xa2, 0x94, 0xe6, + 0xf8, 0x2e, 0x67, 0x4f, + 0xee, 0x79, 0x79, 0x0d, 0x7f, 0x4e, 0xde, 0x89, 0xd7, 0x28, 0x9b, 0xc8, + 0x0e, 0x75, 0x15, 0x5e, + 0x6d, 0x3d, 0x85, 0xe7, 0x14, 0x0d, 0xe4, 0xeb, 0x39, 0x12, 0x50, 0x9a, + 0x94, 0x88, 0x13, 0xcc, + 0x71, 0xac, 0xb7, 0x59, 0x88, 0x37, 0xc7, 0x0a, 0x09, 0x80, 0x63, 0xb1, + 0x42, 0xa2, 0xa9, 0x31, + 0xe0, 0xdc, 0xb5, 0x45, 0xd7, 0x18, 0x9a, 0xdb, 0xeb, 0x71, 0x19, 0xf0, + 0x5d, 0x12, 0x4d, 0x91, + 0x34, 0x43, 0x6a, 0x4f, 0xee, 0xb3, 0x8e, 0x44, 0x1f, 0x2b, 0xbb, 0xf8, + 0xf5, 0xea, 0x1c, 0xee, + 0x7b, 0x65, 0x26, 0x3f, 0x5d, 0x9e, 0x8a, 0x72, 0xe4, 0x68, 0x12, 0x47, + 0x99, 0x32, 0x03, 0xc3, + 0x3e, 0x4d, 0xff, 0x94, 0x36, 0x36, 0x75, 0xa2, 0x39, 0x16, 0x0b, 0x60, + 0xdf, 0x30, 0xfc, 0x1e, + 0xc4, 0xbb, 0xef, 0x5a, 0xde, 0x41, 0x2f, 0xca, 0x2f, 0xa2, 0x97, 0xe4, + 0x3e, 0xb8, 0x1e, 0xe0, + 0x6d, 0x34, 0x8d, 0xa5, 0xd1, 0x34, 0x9a, 0x44, 0xc1, 0x7e, 0x74, 0x9d, + 0xcb, 0x27, 0x2b, 0x29, + 0xbc, 0x38, 0xa4, 0x3a, 0x96, 0xfd, 0x3a, 0xee, 0x99, 0x18, 0xf6, 0x9a, + 0x70, 0x16, 0x26, 0x99, + 0x9b, 0x91, 0x7a, 0xe6, 0xf6, 0xf8, 0x1e, 0xe1, 0x39, 0xf2, 0x94, 0xf0, + 0x30, 0x19, 0xf8, 0xc5, + 0x2b, 0x2f, 0xd4, 0xee, 0x5f, 0xde, 0x38, 0x67, 0xd0, 0xc0, 0x41, 0xab, + 0xff, 0x7d, 0xd7, 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6, 0x7a, 0x44, 0x53, 0x09, 0xc5, 0x71, 0x52, 0x9a, 0x90, 0x2e, 0x24, + 0x0b, 0xf1, 0x42, 0xa2, + 0xd4, 0x5c, 0xe8, 0x59, 0xdc, 0x87, 0xeb, 0x36, 0xa1, 0xa3, 0xa1, 0x65, + 0x41, 0x03, 0x2e, 0xdb, + 0x52, 0x8f, 0xa4, 0x03, 0xf6, 0xa5, 0x5a, 0xba, 0x90, 0x66, 0xd6, 0x46, + 0x78, 0xb8, 0xba, 0x9d, + 0x3b, 0x6b, 0x2b, 0xe3, 0xb6, 0xe4, 0xef, 0x30, 0x6e, 0xcf, 0xdb, 0x6e, + 0x2c, 0x77, 0x96, 0x73, + 0x6b, 0x9d, 0x5d, 0x79, 0xd6, 0xff, 0x9c, 0x62, 0x4a, 0xa1, 0x09, 0x62, + 0x06, 0xed, 0x6c, 0xeb, + 0x86, 0x3a, 0xda, 0x9b, 0xe0, 0x86, 0xb6, 0x96, 0xb8, 0x93, 0xb3, 0x8b, + 0xa6, 0x31, 0x93, 0x65, + 0x49, 0x63, 0xd9, 0x38, 0x9a, 0x24, 0xb0, 0xc7, 0x25, 0xc1, 0xce, 0xa0, + 0xb1, 0x62, 0x2a, 0xe9, + 0xac, 0x74, 0x46, 0x9d, 0xad, 0x79, 0xe8, 0x88, 0xe5, 0x3c, 0xae, 0x04, + 0xdf, 0x6e, 0x97, 0x75, + 0x37, 0xda, 0xad, 0xee, 0xe6, 0xd7, 0x17, 0x0d, 0x30, 0xc6, 0x4b, 0xd9, + 0x28, 0x93, 0xcd, 0xe4, + 0x14, 0x34, 0x7d, 0x3d, 0x52, 0xdf, 0xda, 0x86, 0x14, 0xa9, 0x3f, 0x91, + 0x9d, 0xca, 0x4e, 0x52, + 0xae, 0x56, 0x90, 0xdd, 0xca, 0x5e, 0xb2, 0x4f, 0x2a, 0x27, 0x65, 0x96, + 0x4a, 0xbe, 0x4c, 0xda, + 0xc5, 0x97, 0x59, 0xf7, 0xa2, 0x4f, 0xa5, 0x0c, 0x88, 0xf1, 0x32, 0xa8, + 0x67, 0xf6, 0x59, 0xaa, + 0xb9, 0x1e, 0xce, 0x76, 0xbe, 0xc5, 0x1d, 0x51, 0x76, 0x09, 0x3b, 0x6c, + 0x05, 0xb8, 0xdd, 0x98, + 0x9b, 0x46, 0x75, 0xca, 0x6f, 0x67, 0x7c, 0xc0, 0xd4, 0x82, 0x26, 0x43, + 0x7c, 0x9c, 0x4c, 0x92, + 0x69, 0x92, 0x98, 0x49, 0x1a, 0x58, 0xea, 0x93, 0x2c, 0x29, 0x1d, 0xa7, + 0x9a, 0x52, 0xb0, 0x16, + 0x27, 0x32, 0xbe, 0x33, 0x4d, 0xa2, 0xa9, 0x28, 0x19, 0xce, 0x93, 0x0c, + 0xd2, 0xa5, 0xf0, 0x61, + 0x54, 0x54, 0xf0, 0x3d, 0x77, 0x46, 0xae, 0x42, 0x9b, 0xd5, 0xed, 0xb8, + 0xcc, 0xb6, 0x99, 0x2c, + 0xc8, 0x5b, 0x8a, 0x97, 0x17, 0x71, 0x28, 0xdd, 0x19, 0x85, 0xd2, 0xe4, + 0x0c, 0x78, 0x5e, 0x22, + 0x61, 0x1c, 0x8f, 0x24, 0xad, 0xc6, 0x10, 0xcf, 0xf4, 0xb7, 0x48, 0x23, + 0x7b, 0x27, 0x7c, 0x43, + 0xf1, 0xf5, 0x86, 0xf6, 0x85, 0x4d, 0x0d, 0xf5, 0xb4, 0xc7, 0x44, 0xd1, + 0x74, 0xcb, 0x75, 0xe4, + 0x0e, 0xa5, 0x2f, 0x7e, 0x5f, 0xae, 0x40, 0x65, 0xca, 0x72, 0x56, 0x0f, + 0xe2, 0xe6, 0xc9, 0xb3, + 0xd1, 0xb7, 0xd2, 0x77, 0x10, 0xdb, 0x32, 0x34, 0x4b, 0xa0, 0x89, 0xf0, + 0x9d, 0x5d, 0xdc, 0x97, + 0x18, 0x5a, 0xdf, 0xdc, 0x86, 0x0e, 0x16, 0x39, 0x7e, 0x30, 0xe0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55, 0x48, 0xbb, 0xf0, + 0x3e, 0x79, 0x1b, 0xfd, 0x97, 0x1c, 0x45, 0x12, 0xe5, 0x34, 0x94, 0x29, + 0x37, 0xc6, 0xad, 0xe4, + 0x86, 0x28, 0xde, 0x12, 0x05, 0x3e, 0xf7, 0x8b, 0xe8, 0x84, 0x54, 0x85, + 0x37, 0xaa, 0xfd, 0x70, + 0x8c, 0x3d, 0x99, 0x8f, 0x82, 0x6b, 0x71, 0xa2, 0x25, 0x0e, 0x45, 0xca, + 0x91, 0x38, 0xde, 0x9a, + 0x81, 0x32, 0xd5, 0x06, 0xa4, 0x99, 0xd4, 0x81, 0x76, 0x14, 0xd3, 0x00, + 0x9f, 0x3b, 0xd1, 0x01, + 0x96, 0x01, 0xf4, 0x7a, 0x4b, 0x03, 0x9a, 0x62, 0x8e, 0xa1, 0x11, 0x4a, + 0x5b, 0xf2, 0xbc, 0x7d, + 0x1c, 0xda, 0x2c, 0x9e, 0x46, 0xdb, 0xa4, 0x2d, 0x68, 0xbb, 0xb2, 0x8d, + 0x2e, 0xb7, 0x8f, 0x26, + 0x0f, 0xa9, 0x37, 0xe0, 0xf6, 0xf0, 0xfc, 0x08, 0xc0, 0x65, 0xb8, 0x7e, + 0xe3, 0x24, 0xc0, 0xb6, + 0x0c, 0x31, 0x9b, 0x36, 0x92, 0x5a, 0xa2, 0xe6, 0x72, 0x2b, 0xd4, 0x42, + 0x6a, 0x80, 0x9a, 0xa9, + 0xdd, 0x85, 0x07, 0xf2, 0xba, 0xf3, 0x1d, 0x1d, 0x37, 0xa3, 0xeb, 0xa5, + 0x06, 0x42, 0xa2, 0x18, + 0x0b, 0x78, 0xdc, 0x09, 0x19, 0xe5, 0x39, 0x7c, 0x95, 0xb2, 0x13, 0xad, + 0x52, 0x57, 0xf3, 0xcb, + 0xd4, 0xa5, 0xdc, 0x22, 0x65, 0x3e, 0x37, 0x47, 0xfa, 0x0e, 0x4d, 0x13, + 0x27, 0xe1, 0x07, 0x4d, + 0x91,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 0x31, 0xbf, + 0x93, 0xa3, 0xd6, 0xc3, 0xe8, 0xb8, 0x7a, 0x18, 0x1d, 0xb6, 0x1e, 0xe3, + 0x4f, 0x2a, 0x27, 0x8d, + 0x47, 0x95, 0x23, 0xc6, 0xe3, 0xea, 0x21, 0xee, 0xa0, 0xfd, 0x08, 0x77, + 0xd6, 0xf2, 0x2b, 0x7f, + 0xc1, 0xfc, 0x0b, 0xfa, 0xd9, 0xf2, 0x33, 0x3a, 0x6f, 0x39, 0x87, 0x4e, + 0xcb, 0xda, 0x73, 0xf9, + 0xb3, 0xf2, 0x19, 0xee, 0x94, 0x74, 0xda, 0x70, 0x52, 0x3d, 0xce, 0x9d, + 0x93, 0x4e, 0xa2, 0x83, + 0x72, 0x15, 0x7f, 0x58, 0x39, 0xc9, 0x9f, 0x96, 0x7e, 0xe6, 0xcf, 0x41, + 0xcc, 0x7b, 0x4e, 0xae, + 0x44, 0x65, 0x6a, 0x25, 0xb7, 0x47, 0xa9, 0x34, 0xee, 0x95, 0xf7, 0xc0, + 0xde, 0x6b, 0xdc, 0x03, + 0xb7, 0xe0, 0x03, 0xc2, 0x63, 0xce, 0xe1, 0xb3, 0xca, 0x09, 0xee, 0xa8, + 0x7c, 0xd8, 0x78, 0x18, + 0xde, 0xeb, 0xb0, 0x72, 0xc0, 0x78, 0x48, 0xfe, 0x99, 0x3f, 0xa2, 0xec, + 0xe0, 0x2b, 0x00, 0x33, + 0xcb, 0xc1, 0x07, 0xdc, 0x25, 0xed, 0xe6, 0x77, 0x03, 0xf6, 0x95, 0x4a, + 0xa5, 0x80, 0x99, 0xbb, + 0xb9, 0x52, 0xcb, 0x2e, 0x74, 0x12, 0x3e, 0xc3, 0x19, 0xf9, 0x0c, 0x7f, + 0x52, 0x3e, 0xc1, 0x1f, + 0x93, 0x4f, 0x72, 0x67, 0xa4, 0xb3, 0xdc, 0x2f, 0xe2, 0x61, 0x7e, 0xab, + 0x65, 0x27, 0xb7, 0xd7, + 0x72, 0x96, 0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b, 0x77, 0xf3, 0x80, 0x6d, 0x3c, 0xbb, 0xdd, 0x2d, 0xef, 0x40, 0xbb, + 0xe4, 0x72, 0x54, 0x21, + 0x97, 0x82, 0xdf, 0x56, 0x01, 0x58, 0xb8, 0x0b, 0xb0, 0x6e, 0x27, 0xaa, + 0xb4, 0x1c, 0x20, 0x07, + 0xa5, 0xdd, 0x78, 0xb7, 0x5c, 0x4e, 0x76, 0x83, 0x1f, 0x5a, 0x01, 0xf7, + 0x31, 0xff, 0x71, 0xa7, + 0xb2, 0x13, 0xed, 0x54, 0x77, 0xa0, 0x6d, 0xea, 0x16, 0xb4, 0x4d, 0x01, + 0x3c, 0x94, 0x01, 0xf3, + 0xe0, 0x3d, 0x01, 0xdf, 0xf8, 0x52, 0xeb, 0x6e, 0x54, 0x61, 0xad, 0x44, + 0xe5, 0x70, 0xbb, 0xcb, + 0x5a, 0xca, 0xed, 0xb1, 0x56, 0xf1, 0x95, 0xd6, 0x4a, 0xbe, 0x5c, 0x85, + 0xcf, 0xa2, 0xc2, 0xfb, + 0xc1, 0x66, 0x38, 0x5f, 0x09, 0x9f, 0xb5, 0xc2, 0x52, 0xc9, 0x57, 0xc9, + 0x15, 0x7c, 0x85, 0xbc, + 0x17, 0x7c, 0x49, 0x86, 0xb9, 0x65, 0xf0, 0x59, 0x00, 0x37, 0xe5, 0x9d, + 0x80, 0xb1, 0xdb, 0xd1, + 0x56, 0x75, 0x23, 0xf8, 0x80, 0x3f, 0xf2, 0x2b, 0xe4, 0x05, 0x68, 0x8e, + 0x38, 0x13, 0x7d, 0x6b, + 0x99, 0x84, 0x3e, 0x16, 0xdf, 0x47, 0x05, 0xa2, 0x0d, 0x19, 0xe7, 0xd7, + 0xe4, 0xd0, 0x6a, 0xf3, + 0x83, 0x26, 0x96, 0xbe, 0x1a, 0x10, 0x5b, 0xc0, 0x67, 0xab, 0xee, 0x33, + 0xf1, 0xc1, 0xd3, 0x7d, + 0x78, 0x4c, 0x8f, 0x77, 0x7a, 0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 0x68, 0x52, 0xeb, 0xd2, 0xae, 0x19, 0x13, 0x9c, + 0xe3, 0xa2, 0xe9, 0x43, + 0x83, 0x4f, 0x1f, 0x80, 0x6f, 0x62, 0x88, 0xb3, 0xc4, 0x70, 0xe1, 0xd4, + 0xa4, 0x8e, 0xb9, 0x02, + 0xed, 0x9a, 0x00, 0x1a, 0x15, 0x2e, 0x5c, 0x97, 0x35, 0x5c, 0x1f, 0x55, + 0xbb, 0x1e, 0xce, 0xfc, + 0xf7, 0xcc, 0x82, 0xa4, 0x91, 0x75, 0xae, 0xd7, 0x3e, 0xfa, 0xe7, 0xe3, + 0x75, 0x69, 0xcf, 0xea, + 0x9c, 0xc3, 0x7a, 0xb9, 0x1a, 0x15, 0x82, 0xab, 0x97, 0x57, 0xc3, 0x42, + 0x4d, 0xfb, 0x24, 0x25, + 0x27, 0x05, 0x7c, 0xf4, 0x24, 0xf0, 0x39, 0x12, 0xa6, 0xbd, 0xfc, 0x74, + 0x20, 0xad, 0x29, 0x9f, + 0x1c, 0x0b, 0xd3, 0x79, 0xa4, 0xf5, 0xe2, 0xcd, 0x6a, 0xfa, 0x48, 0xa0, + 0x59, 0x45, 0x1e, 0x1d, + 0x82, 0x92, 0xf1, 0x55, 0x6f, 0xf8, 0xf4, 0x2f, 0x21, 0x9e, 0xae, 0x81, + 0x9d, 0x96, 0x13, 0xdc, + 0x8a, 0x2f, 0xa7, 0x3c, 0xef, 0xab, 0x7f, 0xa5, 0xeb, 0xe8, 0x88, 0xc1, + 0xd5, 0xfd, 0xd1, 0x80, + 0x83, 0x09, 0x6a, 0x82, 0x31, 0x4e, 0x89, 0x37, 0x26, 0x5a, 0x13, 0x0d, + 0x2c, 0xef, 0x02, 0x3b, + 0x97, 0xfd, 0xcc, 0x66, 0x08, 0xb3, 0x58, 0x9f, 0x61, 0x61, 0x94, 0x9c, + 0xc4, 0xa5, 0x58, 0x63, + 0x0c, 0xc1, 0x7b, 0x56, 0xb3, 0x46, 0x06, 0xed, 0x07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x2f, 0x41, 0xe7, 0xbe, 0x49, 0x21, 0xd4, 0x01, 0xed, 0x5e, 0x5c, 0x79, + 0x5f, 0xf9, 0xb5, 0x31, + 0xae, 0xd8, 0xc5, 0x5f, 0xff, 0x5a, 0xc8, 0xb8, 0x50, 0x93, 0x9f, 0x1f, + 0xf8, 0x98, 0x5c, 0x41, + 0xbe, 0xdf, 0xbb, 0x6e, 0xe2, 0x93, 0x6f, 0x62, 0xad, 0xcd, 0x37, 0xf9, + 0x87, 0xf6, 0xf1, 0x6a, + 0xd7, 0xee, 0x74, 0x6d, 0xbe, 0x67, 0x40, 0xbe, 0x09, 0x5c, 0xaf, 0x19, + 0x16, 0x85, 0x55, 0x7b, + 0x36, 0x8c, 0xb5, 0x70, 0xa6, 0x51, 0x11, 0x94, 0x6f, 0x52, 0x94, 0x39, + 0x3c, 0xab, 0x20, 0x39, + 0x30, 0xdf, 0x44, 0x6f, 0xcf, 0xaa, 0x18, 0xcf, 0xa7, 0x3a, 0x13, 0x47, + 0xd5, 0x78, 0x8d, 0x89, + 0x0f, 0xd5, 0x99, 0xb7, 0x5b, 0xca, 0x7c, 0xc2, 0xb5, 0x03, 0xef, 0x08, + 0x86, 0xb9, 0xac, 0x1e, + 0xd9, 0x7e, 0xee, 0xcb, 0x0f, 0xd5, 0xd2, 0x21, 0x30, 0x6a, 0xf5, 0x7d, + 0x8d, 0x73, 0x92, 0x60, + 0x64, 0xdc, 0x8c, 0x24, 0x7b, 0x52, 0x6e, 0x92, 0xc6, 0xd1, 0x48, 0x30, + 0xc4, 0x2b, 0xb1, 0x46, + 0xc6, 0x57, 0x8b, 0xac, 0x85, 0x85, 0xba, 0xf3, 0x7a, 0x05, 0x7e, 0xf2, + 0x7a, 0xb5, 0xec, 0x8e, + 0xf5, 0xb9, 0xe9, 0xea, 0x59, 0x0d, 0x58, 0xf3, 0x62, 0x3d, 0x5b, 0x09, + 0x1c, 0xf3, 0x15, 0x58, + 0x3c, 0xed, 0x53, 0xcf, 0x45,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 0x01, + 0x31, 0x25, 0x9c, 0x57, + 0x97, 0xfa, 0x92, 0x5d, 0x3d, 0x35, 0x2e, 0xae, 0xeb, 0xa5, 0x9c, 0x52, + 0xac, 0x96, 0xd7, 0xd3, + 0x31, 0xb7, 0xbd, 0x38, 0xbc, 0xf3, 0x16, 0x83, 0xe7, 0xb6, 0x5d, 0x39, + 0x36, 0x56, 0x4b, 0xf0, + 0x95, 0x5f, 0xfb, 0x46, 0xb2, 0x91, 0x0f, 0xa4, 0xf1, 0x9a, 0x0d, 0xbf, + 0xef, 0xb2, 0x61, 0x97, + 0xfd, 0xc2, 0x1e, 0xeb, 0xb6, 0xe1, 0x31, 0x6e, 0x1b, 0x2e, 0x96, 0x45, + 0x3a, 0xd9, 0x99, 0x9d, + 0x1b, 0xb6, 0xde, 0x34, 0x9d, 0x3a, 0x2d, 0x09, 0xce, 0x78, 0x63, 0xec, + 0x25, 0xee, 0x1b, 0xb9, + 0xa2, 0x63, 0xc2, 0xe2, 0x6b, 0x6b, 0x92, 0x91, 0xe1, 0x46, 0x66, 0x0d, + 0xff, 0x38, 0xb3, 0x8e, + 0x0e, 0x7e, 0x50, 0x5c, 0x30, 0x4d, 0x27, 0xa3, 0xa5, 0x4f, 0xc9, 0xa7, + 0xd2, 0x27, 0xe4, 0x13, + 0xd8, 0x13, 0xa5, 0x89, 0x14, 0x36, 0xf9, 0x58, 0xfa, 0x98, 0x7e, 0x24, + 0x7d, 0xa4, 0xed, 0x0f, + 0xa5, 0x0f, 0xb5, 0x3d, 0x41, 0x9a, 0x40, 0xed, 0xd2, 0x37, 0x24, 0x26, + 0x3c, 0xf9, 0x7e, 0xca, + 0x6a, 0x0c, 0xac, 0x27, 0xab, 0xc6, 0xfc, 0xe0, 0x71, 0xb5, 0xae, 0x71, + 0x10, 0x87, 0xb1, 0xb8, + 0x1f, 0x62, 0x17, 0x3e, 0x60, 0xec, 0xf2, 0x3f, 0x98, 0x4d, 0x5b, 0x37, + 0xdf, 0xef, 0x27, 0xbf, + 0xe6, 0xe1, 0x9b, 0xe4, 0x05, 0xd0, 0x5f, 0x0c, 0x49, 0xd3, 0x2a, 0x8c, + 0xda, 0xb3, 0xfe, 0xaf, + 0x8d, 0xd5, 0x75, 0x93, 0x94, 0xa2, 0xac, 0x80, 0x7c, 0x13, 0x2d, 0x0e, + 0xd3, 0xe1, 0x33, 0x87, + 0xd4, 0xcb, 0x9e, 0x97, 0x99, 0x13, 0xb4, 0x16, 0x0e, 0xef, 0xc9, 0x8e, + 0x73, 0xb0, 0xf3, 0x31, + 0x02, 0xde, 0x93, 0xe5, 0x12, 0x2f, 0x69, 0xa0, 0x00, 0x0e, 0x7a, 0xfa, + 0x92, 0x8b, 0x5c, 0x31, + 0x25, 0xfb, 0x2e, 0xac, 0x4f, 0x36, 0xd5, 0xa5, 0x69, 0x4a, 0x02, 0xe2, + 0x42, 0x71, 0x78, 0x7b, + 0x56, 0x75, 0x6b, 0xd5, 0x0b, 0x97, 0xf8, 0x26, 0xde, 0x7a, 0x2e, 0x33, + 0xa4, 0xd1, 0x60, 0xbf, + 0x9f, 0x32, 0xfb, 0xa5, 0x9f, 0x80, 0xed, 0xba, 0x6c, 0xf8, 0x63, 0xb0, + 0xe1, 0x8f, 0xdc, 0x36, + 0xfc, 0xa1, 0xdb, 0x86, 0x27, 0xd0, 0x09, 0x10, 0x17, 0x7f, 0x03, 0xf8, + 0x97, 0x1c, 0x5c, 0x33, + 0x2a, 0x8c, 0x35, 0xaf, 0x48, 0x92, 0x98, 0x17, 0x6f, 0x08, 0x81, 0xfb, + 0x16, 0xfc, 0x98, 0x98, + 0x59, 0xec, 0x92, 0x39, 0x8c, 0xe5, 0x01, 0x02, 0xd5, 0x4d, 0x34, 0xae, + 0x65, 0x41, 0x82, 0xff, + 0xd8, 0xc5, 0x34, 0x9b, 0x4e, 0xb0, 0x4c, 0xa1, 0x93, 0xa5, 0x29, 0x64, + 0xb2, 0x65, 0x32, 0xdc, + 0x4e, 0x26, 0x5f, 0x48, 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0xfa, 0x83, 0xfe, 0x97, + 0xfe, 0x87, 0xfe, 0x4e, + 0x2f, 0xd0, 0xdf, 0xe8, 0x2f, 0x60, 0xd7, 0xe7, 0xdc, 0x68, 0x78, 0x02, + 0x50, 0xea, 0x08, 0x3d, + 0x44, 0x0f, 0x68, 0x58, 0xb8, 0x07, 0x90, 0xad, 0x1c, 0xf0, 0xad, 0xac, + 0x7a, 0xed, 0x86, 0xff, + 0x57, 0x00, 0x46, 0xee, 0xa1, 0xfb, 0xe0, 0x11, 0x07, 0x00, 0xef, 0x00, + 0xed, 0xe0, 0x39, 0x27, + 0x00, 0x47, 0x01, 0xc3, 0xe0, 0x55, 0x18, 0x76, 0xb9, 0x90, 0xea, 0x17, + 0xf7, 0xfa, 0xb5, 0xc6, + 0xfa, 0xcd, 0xbd, 0x2e, 0x68, 0xeb, 0x77, 0x6d, 0xfd, 0x07, 0xd6, 0x7f, + 0xb5, 0xf5, 0x87, 0x7b, + 0xfd, 0x59, 0x63, 0xfd, 0x73, 0x8e, 0xdd, 0x06, 0xf1, 0x1b, 0x3a, 0x47, + 0xb3, 0x61, 0x66, 0xbf, + 0xb3, 0xdd, 0xf6, 0x3b, 0x8b, 0xce, 0xb4, 0x30, 0x1b, 0xfe, 0x5e, 0xb3, + 0xe1, 0x19, 0x9a, 0x0d, + 0x4f, 0x07, 0x1b, 0x9e, 0x44, 0x4b, 0x1c, 0x99, 0x86, 0x24, 0x35, 0xd6, + 0xaf, 0x9e, 0xcb, 0xa5, + 0x5e, 0xf6, 0x84, 0xb0, 0xcd, 0x5b, 0x4c, 0xc9, 0x8f, 0xcf, 0x0d, 0x16, + 0x37, 0x86, 0xd2, 0xdf, + 0x1f, 0x8a, 0xce, 0x57, 0x9a, 0x23, 0x7e, 0x54, 0x52, 0x9d, 0x79, 0xdd, + 0xee, 0x38, 0xcc, 0xba, + 0xd2, 0x38, 0x4b, 0x5c, 0x44, 0x16, 0x89, 0x0b, 0xc9, 0x42, 0x71, 0x21, + 0x5d, 0x20, 0x96, 0x68, + 0xbb, 0x44, 0xdb, 0xf3, 0xe9, 0x7c, 0x71, 0x3e, 0x99, 0x27, 0xce, 0x83, + 0x3d, 0x97, 0xce, 0x15, + 0xe7, 0x92, 0x6f, 0xc4, 0x35, 0xe4, 0x13, 0x7a, 0x75, 0x5d, 0x5d, 0xe1, + 0x5d, 0x13, 0xdd, 0xeb, + 0x63, 0xfa, 0x11, 0xac, 0x0f, 0xe9, 0x04, 0xfa, 0x01, 0xac, 0xf7, 0x61, + 0x8d, 0xa3, 0x63, 0x60, + 0x8d, 0xa6, 0x45, 0xb4, 0x90, 0x16, 0xd0, 0x7c, 0x9a, 0x07, 0xcb, 0x49, + 0x1d, 0x35, 0x96, 0x13, + 0x56, 0x1e, 0xfc, 0xae, 0x00, 0x56, 0x21, 0x3c, 0x72, 0x34, 0x2d, 0x86, + 0xe7, 0x8c, 0x85, 0xe7, + 0xb2, 0x57, 0x18, 0xaf, 0xbd, 0xd6, 0x04, 0x58, 0x1f, 0xd6, 0x59, 0x1f, + 0xf9, 0x5c, 0x1f, 0x6b, + 0x6b, 0xa2, 0xcf, 0xf5, 0xcf, 0x3b, 0x76, 0x1b, 0xcc, 0xb3, 0xe8, 0x22, + 0xb0, 0x61, 0x66, 0xbf, + 0x0b, 0xc5, 0x05, 0x60, 0xb7, 0x0b, 0xdc, 0xf6, 0x5b, 0xc2, 0xec, 0x17, + 0xf6, 0x3c, 0xcd, 0x86, + 0x99, 0xfd, 0xce, 0x05, 0xac, 0x5c, 0x0a, 0xfe, 0x1f, 0x8b, 0xf7, 0x03, + 0xf1, 0x4d, 0x42, 0xc9, + 0x61, 0xe9, 0x99, 0xc3, 0x9a, 0x92, 0x17, 0x17, 0x54, 0x7b, 0xb6, 0x46, + 0x1f, 0x6f, 0x18, 0x67, + 0x58, 0x54, 0xd7, 0x01, 0x59, 0xde, 0x54, 0xd3, 0x1c, 0xf2, 0xaa, 0x53, + 0x3a, 0xd7, 0xe6, 0x2e, + 0x14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0xac, 0xba, + 0x7a, 0xc6, 0x5d, 0x5d, + 0x57, 0xd7, 0x3f, 0x68, 0x1d, 0xa6, 0xc7, 0xc1, 0x76, 0x7f, 0x22, 0x3f, + 0x81, 0xed, 0x9e, 0x14, + 0x4e, 0x50, 0xd8, 0xc4, 0x65, 0xbb, 0x9a, 0x1d, 0x33, 0xfb, 0xa5, 0xc7, + 0xc0, 0x76, 0x5d, 0x36, + 0x7c, 0x90, 0xec, 0x0f, 0xd6, 0x87, 0x17, 0x20, 0xaf, 0xe7, 0x5d, 0x37, + 0x49, 0xf7, 0xa5, 0xfb, + 0x61, 0xab, 0xcd, 0x0f, 0x77, 0xc5, 0xaa, 0xf1, 0xb5, 0x7c, 0x35, 0xa6, + 0x81, 0xe0, 0xad, 0x07, + 0xe3, 0x99, 0x33, 0xa9, 0x69, 0xd5, 0x5b, 0xa3, 0x0d, 0x81, 0xe6, 0x42, + 0x87, 0x77, 0x36, 0xed, + 0x31, 0x72, 0x96, 0x9e, 0x23, 0xe7, 0x84, 0x73, 0x5a, 0x8f, 0xfb, 0x59, + 0xe1, 0x2c, 0x39, 0x2b, + 0x9c, 0x21, 0x67, 0xdc, 0xfb, 0x34, 0xeb, 0x81, 0x17, 0x4e, 0x93, 0x53, + 0xc2, 0x29, 0xd8, 0x3f, + 0xc1, 0x71, 0x3d, 0x7c, 0x35, 0xff, 0x77, 0x75, 0x5d, 0x5d, 0xff, 0xa0, + 0x75, 0x94, 0xf5, 0x77, + 0x83, 0xfd, 0x9e, 0x73, 0xf1, 0x54, 0x08, 0xb3, 0x61, 0x8f, 0xfd, 0x9e, + 0x71, 0xdb, 0xef, 0x69, + 0xcd, 0x7e, 0x4f, 0x01, 0x46, 0x9e, 0x00, 0xbc, 0x0c, 0x82, 0x7f, 0xfa, + 0xb8, 0xe8, 0x24, 0x3e, + 0x2f, 0x33, 0x27, 0xab, 0x20, 0x79, 0x64, 0xa0, 0xf9, 0xc1, 0xac, 0x6e, + 0xc2, 0x70, 0x32,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0x9f, 0x7b, 0x39, + 0x4e, 0xb5, 0x64, 0xf3, 0x83, 0x1d, 0x5f, 0x55, 0xd2, 0xcf, 0x91, 0x1a, + 0xa4, 0xba, 0x9a, 0xe0, + 0xb0, 0x1a, 0xb6, 0x56, 0x56, 0xe3, 0x62, 0x5a, 0x31, 0xbf, 0x76, 0x1b, + 0xd3, 0xfb, 0xc6, 0xd7, + 0x24, 0xa8, 0x86, 0x91, 0xf4, 0x8f, 0x8c, 0x2c, 0x49, 0xfa, 0x67, 0xd5, + 0xeb, 0x29, 0x7b, 0x2b, + 0x38, 0x7f, 0xd9, 0x1d, 0xd7, 0xeb, 0x59, 0x6c, 0x2a, 0x1f, 0x07, 0x1f, + 0x34, 0x11, 0x72, 0x05, + 0xb2, 0xf9, 0xc1, 0x8e, 0xaf, 0x2a, 0xa9, 0x91, 0x01, 0x06, 0x82, 0xbe, + 0xd0, 0x5b, 0x36, 0x07, + 0x3f, 0x35, 0x29, 0x36, 0x31, 0x4c, 0x2b, 0x3e, 0x97, 0x73, 0x99, 0x3a, + 0xc4, 0xd4, 0xc8, 0x60, + 0xe6, 0x72, 0x06, 0xd7, 0x30, 0x92, 0xfe, 0x91, 0x91, 0x25, 0x49, 0xff, + 0xac, 0x3e, 0x2f, 0x65, + 0xdc, 0x2c, 0x90, 0x69, 0x65, 0xeb, 0x85, 0x9d, 0x37, 0x39, 0xde, 0x3a, + 0xac, 0x32, 0xbf, 0x38, + 0x6c, 0x7e, 0x30, 0xf7, 0xa7, 0xe7, 0xe5, 0x86, 0xac, 0x46, 0xc6, 0xcd, + 0x7e, 0x06, 0x0e, 0xfe, + 0xf6, 0xd9, 0xf6, 0x01, 0xe8, 0x5f, 0x46, 0xca, 0x73, 0x71, 0xc7, 0xf5, + 0x36, 0x50, 0x71, 0x3d, + 0xcc, 0x5c, 0xce, 0x60, 0x7d, 0x26, 0xfd, 0x23, 0x23, 0x4b, 0x92, 0xfe, + 0xc1, 0x0c, 0xca, 0x38, + 0x98, 0x56, 0xc2, 0x57, 0x15, 0x9c, 0x16, 0x7d, 0xaa, 0xc8, 0x9b, 0x1c, + 0x0b, 0x5f, 0x3a, 0x48, + 0xcb, 0x80, 0xfd, 0x9c, 0x1a, 0xa7, 0x3b, 0x36, 0x07, 0xdf, 0x89, 0x35, + 0xde, 0x92, 0xf0, 0x5c, + 0x5c, 0x71, 0xbd, 0x22, 0x26, 0xae, 0x77, 0xa7, 0xbc, 0xa7, 0xea, 0x4d, + 0xce, 0x2c, 0x64, 0x6b, + 0x42, 0xfa, 0x47, 0x46, 0x96, 0x24, 0xfd, 0x83, 0x19, 0x94, 0xd5, 0x63, + 0x1c, 0xd3, 0x2a, 0xaf, + 0xee, 0x7d, 0x73, 0xc7, 0xf5, 0x24, 0xf3, 0x83, 0x21, 0x6f, 0x52, 0x75, + 0xfa, 0x4d, 0xd2, 0x7d, + 0x67, 0xd6, 0xdb, 0xda, 0x99, 0x0e, 0xb4, 0x70, 0xf3, 0xb4, 0x72, 0x00, + 0x3c, 0x05, 0x39, 0xcf, + 0x85, 0xf9, 0xd7, 0xec, 0xfd, 0x6d, 0x63, 0xea, 0x09, 0x91, 0xb1, 0x4e, + 0x5d, 0xba, 0x26, 0xa4, + 0x7f, 0x64, 0x64, 0x49, 0xd2, 0x3f, 0x88, 0xeb, 0xdd, 0x47, 0xa6, 0x95, + 0x73, 0x3e, 0xf3, 0xf4, + 0x9b, 0xdc, 0x59, 0x69, 0x59, 0xf1, 0x44, 0x6f, 0x64, 0x67, 0x99, 0x56, + 0x7a, 0x08, 0x3a, 0xb6, + 0xde, 0x77, 0xc7, 0xf4, 0x99, 0xf7, 0x26, 0xcb, 0x79, 0x2e, 0x3b, 0xfb, + 0xa5, 0x65, 0x9e, 0xd7, + 0x2b, 0xe6, 0x47, 0x5a, 0x3b, 0x2c, 0x4f, 0x22, 0x38, 0x5f, 0x88, 0x58, + 0xe7, 0x59, 0xf5, 0x20, + 0xb8, 0x86, 0x91, 0xf4, 0x8f, 0x8c, 0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2, 0x3f, 0x93, + 0x91, 0x25, 0x45, 0xff, 0xf2, 0xb2, 0xb8, 0x9e, 0x87, 0x83, 0x5f, 0xd9, + 0x53, 0xf1, 0x5c, 0x22, + 0xc4, 0xf5, 0x70, 0x9c, 0x16, 0xa7, 0xee, 0x26, 0xd7, 0x56, 0xc6, 0xf5, + 0x62, 0x9e, 0xcb, 0xe9, + 0xe7, 0x7c, 0x79, 0xe6, 0x07, 0xcf, 0x2e, 0x9b, 0xa4, 0x7f, 0x64, 0x64, + 0x89, 0xd0, 0x3f, 0xa3, + 0x88, 0x88, 0xeb, 0x69, 0xc0, 0x1f, 0x65, 0x3e, 0x60, 0xe9, 0x74, 0xab, + 0x16, 0xc6, 0xc1, 0x4f, + 0x47, 0xe0, 0x2f, 0x2b, 0x39, 0x2d, 0xf6, 0x59, 0x6c, 0x9e, 0x6b, 0xed, + 0x4c, 0x15, 0x71, 0x3d, + 0x9b, 0x69, 0x15, 0x53, 0x0d, 0x63, 0xd8, 0x9a, 0x68, 0x3d, 0x9a, 0xff, + 0x46, 0x46, 0x96, 0x08, + 0xfd, 0xeb, 0x21, 0x67, 0x50, 0x0e, 0x20, 0xae, 0xb7, 0xb3, 0xb7, 0x11, + 0xca, 0x73, 0x29, 0xef, + 0x41, 0xfc, 0xb0, 0x7a, 0x5a, 0x38, 0xc8, 0x0c, 0x24, 0xf3, 0x83, 0x6d, + 0x5f, 0x55, 0xd1, 0xcf, + 0xa1, 0xad, 0x72, 0xae, 0x46, 0x66, 0x99, 0x6b, 0x15, 0xaf, 0xcc, 0xaa, + 0xf7, 0xfb, 0xb5, 0x78, + 0xce, 0x97, 0x7c, 0x4d, 0x28, 0xff, 0x41, 0x46, 0x96, 0x08, 0xfd, 0xb3, + 0x99, 0x56, 0x0a, 0x66, + 0x94, 0x16, 0xc8, 0xaa, 0xf7, 0xf2, 0x5c, 0x76, 0x3d, 0x79, 0x53, 0x2b, + 0x6f, 0x32, 0xf1, 0xcd, + 0x0f, 0x76, 0xf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x96, 0xe6, 0x1a, 0x4a, 0xff, + 0x38, 0xd3, 0x0a, 0x3b, + 0x97, 0x53, 0xcd, 0xb4, 0xea, 0xec, 0x22, 0xe6, 0x72, 0xa6, 0x97, 0x15, + 0x9e, 0xeb, 0x71, 0xe6, + 0x07, 0x93, 0xfe, 0x91, 0x91, 0x25, 0x52, 0xff, 0x82, 0x59, 0xf5, 0x2e, + 0x9e, 0x4b, 0x10, 0x07, + 0x3f, 0x60, 0x7e, 0xf0, 0xca, 0x57, 0xc5, 0xf1, 0x97, 0x37, 0xa7, 0x5a, + 0x0b, 0xf3, 0xae, 0x51, + 0x71, 0xbd, 0x55, 0x0d, 0x23, 0xa2, 0x46, 0x46, 0xed, 0x4b, 0xf3, 0x35, + 0x71, 0x7a, 0xdf, 0xd8, + 0x5a, 0x1c, 0x5d, 0x76, 0x49, 0xff, 0xc8, 0xc8, 0x12, 0xa7, 0x7f, 0x16, + 0xab, 0x3e, 0xc4, 0x6f, + 0x04, 0x0e, 0x3e, 0xf3, 0x09, 0x2b, 0xb7, 0xab, 0x6f, 0xd9, 0xb9, 0xb0, + 0x62, 0x85, 0x41, 0x3c, + 0x97, 0x7e, 0xaa, 0x93, 0x9a, 0x6f, 0xe3, 0x66, 0x94, 0x33, 0x5f, 0xb5, + 0xe0, 0xeb, 0x37, 0xb1, + 0xce, 0x64, 0x46, 0x90, 0x56, 0xaa, 0xe3, 0x7a, 0x01, 0xfc, 0xfe, 0xa0, + 0x53, 0x22, 0xae, 0x86, + 0x31, 0x60, 0x4d, 0x28, 0xff, 0x41, 0x46, 0x96, 0x3c, 0xfd, 0xc3, 0xb2, + 0xea, 0x75, 0xde, 0xfb, + 0x06, 0x1a, 0x27, 0xe3, 0xb9, 0x40, 0xde, 0x64, 0xf3, 0x74, 0xa7, 0x56, + 0x3d, 0xcd, 0xd7, 0xa4, + 0x75, 0xc5, 0x96, 0x9e, 0x82, 0xaf, 0x9a, 0xf3, 0x9d, 0xd5, 0x80, 0x81, + 0x90, 0x19, 0xa7, 0x3b, + 0x2e, 0x1e, 0x0c, 0xff, 0xfe, 0xe8, 0xac, 0xfa, 0x90, 0x58, 0x62, 0x84, + 0xde, 0x37, 0x6f, 0xac, + 0x93, 0xf4, 0x8f, 0x8c, 0x2c, 0x71, 0xfa, 0x17, 0x9d, 0x69, 0x65, 0xac, + 0x72, 0x05, 0x5e, 0x9e, + 0x8b, 0x27, 0x6f, 0x7a, 0x26, 0x99, 0x1f, 0xec, 0xf2, 0x55, 0xb3, 0xbe, + 0xb9, 0x97, 0x6e, 0xf6, + 0x33, 0x70, 0xf0, 0x45, 0x5d, 0x72, 0xba, 0x8d, 0xab, 0x27, 0x14, 0x73, + 0x39, 0xb5, 0x38, 0xe6, + 0x72, 0x06, 0xae, 0x09, 0xe9, 0x1f, 0x19, 0x59, 0xe2, 0xf4, 0x0f, 0xcb, + 0xb4, 0x9a, 0x6c, 0x41, + 0x5c, 0x4f, 0xe6, 0x37, 0x3a, 0x79, 0x93, 0x2d, 0x76, 0x6e, 0x0a, 0x9d, + 0x1f, 0x0c, 0x79, 0x13, + 0xcb, 0x57, 0xf5, 0x9f, 0xd5, 0x80, 0x81, 0x90, 0x75, 0xf1, 0x60, 0x76, + 0x2d, 0xff, 0x1a, 0xb4, + 0xb2, 0x38, 0xcb, 0x36, 0x64, 0x3c, 0x17, 0xfe, 0xfe, 0x22, 0xc4, 0xf5, + 0xae, 0xc6, 0xf9, 0x22, + 0xfd, 0x23, 0x23, 0x4b, 0x9c, 0xfe, 0xd9, 0xf5, 0x7a, 0xea, 0xde, 0x37, + 0x4c, 0x5c, 0xcf, 0x84, + 0x1a, 0x99, 0xad, 0x45, 0xb6, 0xa1, 0xca, 0x9b, 0x80, 0xbf, 0x1c, 0xec, + 0xab, 0x6a, 0x86, 0xcd, + 0xc1, 0xf7, 0xd6, 0x25, 0x57, 0x5c, 0x3c, 0x97, 0xac, 0x87, 0xe7, 0x12, + 0x3d, 0xae, 0xa7, 0x29, + 0x39, 0x5f, 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0x12, 0x71, 0xbd, + 0x4c, 0x3c, 0x73, 0x39, 0xf9, 0xdc, 0x4b, 0x58, 0x13, 0xce, 0xc1, 0xf7, + 0xcf, 0x0f, 0x26, 0xfe, + 0x33, 0x19, 0x59, 0x42, 0xf4, 0x2f, 0x9c, 0x55, 0xbf, 0xe2, 0xe0, 0x6f, + 0xd7, 0x20, 0x2e, 0x16, + 0xc6, 0x73, 0x01, 0x2d, 0xcc, 0x44, 0x98, 0x51, 0xae, 0xf4, 0x55, 0x2d, + 0x7d, 0xce, 0x2c, 0x72, + 0xad, 0xd8, 0x98, 0x56, 0x11, 0x6a, 0x18, 0xfd, 0xbd, 0x6f, 0xce, 0xfc, + 0x60, 0x3a, 0xff, 0x91, + 0x91, 0x25, 0x43, 0xff, 0x22, 0xd6, 0xeb, 0xd9, 0x1c, 0x7c, 0x59, 0xde, + 0x04, 0x7c, 0xe9, 0xca, + 0x32, 0x8d, 0xea, 0x7d, 0x53, 0xc6, 0x12, 0x2d, 0x2d, 0xd2, 0x97, 0xb9, + 0x66, 0x61, 0x14, 0x17, + 0xd3, 0x2a, 0x8e, 0x1a, 0x46, 0xca, 0x7f, 0x90, 0x91, 0x25, 0x42, 0xff, + 0x90, 0x33, 0x28, 0xbd, + 0x71, 0x3d, 0x09, 0xcf, 0x85, 0xcf, 0x4a, 0xdb, 0xdd, 0x2b, 0x9f, 0x15, + 0x0f, 0xf2, 0x13, 0xc9, + 0xfc, 0x60, 0xab, 0x46, 0x46, 0xd5, 0xcf, 0x01, 0x0c, 0x04, 0xe8, 0x89, + 0xdb, 0x60, 0x97, 0x7e, + 0x9c, 0x6b, 0x2a, 0xeb, 0x09, 0xd1, 0x4c, 0xab, 0x38, 0x38, 0x5f, 0xa4, + 0x7f, 0x64, 0x64, 0x89, + 0xd0, 0x3f, 0xe4, 0x0c, 0xca, 0xb4, 0x2c, 0xae, 0xe7, 0xe1, 0xe0, 0x97, + 0xf7, 0xab, 0xaa, 0xf9, + 0xc1, 0xdc, 0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, + 0xfe, 0x91, 0x91, 0x25, 0x43, 0xff, 0x44, 0x3d, 0x88, 0x9c, 0xe7, 0x02, + 0x1c, 0xfc, 0xd2, 0x79, + 0x65, 0xbf, 0x7c, 0x92, 0x3f, 0x4c, 0xcb, 0x78, 0x2e, 0x11, 0xe2, 0x7a, + 0x16, 0xa7, 0x65, 0x1f, + 0xf5, 0x1e, 0x07, 0xe9, 0x6e, 0x6e, 0xa9, 0x37, 0x37, 0x5e, 0x84, 0xb9, + 0x9c, 0xa1, 0xfd, 0x26, + 0xc3, 0xcb, 0x0e, 0xe9, 0x1f, 0x19, 0xd9, 0x0d, 0xd7, 0xbf, 0xc9, 0x56, + 0x6b, 0x2d, 0xae, 0xe7, + 0xe1, 0xb9, 0xac, 0x7a, 0x2c, 0x76, 0xad, 0x5c, 0x41, 0x20, 0xcf, 0x45, + 0xd4, 0xc8, 0x74, 0x31, + 0x33, 0xca, 0x05, 0xa7, 0x45, 0xed, 0xab, 0x8a, 0xbc, 0x06, 0x3b, 0x93, + 0x2d, 0x33, 0x4a, 0x46, + 0x34, 0xd4, 0xeb, 0x61, 0x99, 0x56, 0x91, 0xe6, 0x72, 0xca, 0xfa, 0x4d, + 0xe6, 0xc4, 0x7f, 0x26, + 0x23, 0xbb, 0xf1, 0xfa, 0x37, 0xdd, 0x69, 0x86, 0xf6, 0x79, 0x59, 0x33, + 0x73, 0xc1, 0x6f, 0xac, + 0xdc, 0x76, 0xb1, 0x9f, 0xef, 0xf8, 0x78, 0x2e, 0x90, 0x37, 0x19, 0xe4, + 0xda, 0x10, 0xd7, 0x53, + 0xf5, 0x56, 0x70, 0x4e, 0x8b, 0xd2, 0x57, 0x15, 0x3f, 0xc3, 0xd3, 0xfb, + 0x16, 0x16, 0xd7, 0x3b, + 0x8b, 0x83, 0x69, 0x65, 0xe9, 0xb3, 0x84, 0xf3, 0xe5, 0xe1, 0xe0, 0xcf, + 0x2e, 0x9b, 0xa4, 0x7f, + 0x64, 0x64, 0x09, 0xc8,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0xc5, 0xd6, + 0x52, 0xa3, 0x42, 0x0b, + 0x74, 0x2f, 0x88, 0x83, 0xbf, 0xb9, 0xc8, 0x34, 0xd3, 0x23, 0xa6, 0x75, + 0xec, 0x4c, 0x07, 0x79, + 0x5f, 0xc8, 0x81, 0x78, 0x7b, 0xdf, 0x82, 0x79, 0x2e, 0xe0, 0xfb, 0x02, + 0x4b, 0x5a, 0xce, 0x73, + 0x89, 0x10, 0xd7, 0xc3, 0xd6, 0x30, 0x52, 0xfe, 0x97, 0x8c, 0x2c, 0x01, + 0xf5, 0x2f, 0x65, 0x65, + 0x6f, 0x59, 0x66, 0x01, 0x7e, 0x23, 0x6e, 0xae, 0xda, 0x26, 0x82, 0xa3, + 0x25, 0x7a, 0xdf, 0xd6, + 0xfb, 0x4d, 0x38, 0xff, 0x19, 0x66, 0xbd, 0x2d, 0xf5, 0x66, 0x66, 0xa1, + 0xb7, 0x78, 0xef, 0xdb, + 0x89, 0xa4, 0xf7, 0xcd, 0x5d, 0x97, 0x7c, 0x61, 0xf9, 0xd7, 0x32, 0x9e, + 0x8b, 0x38, 0x53, 0x22, + 0xf9, 0xfd, 0x79, 0x54, 0xac, 0x33, 0x7d, 0x74, 0xd9, 0x25, 0xfd, 0x23, + 0x23, 0xbb, 0xe1, 0xfa, + 0x37, 0xd9, 0x6a, 0x6d, 0xc4, 0xc4, 0xb4, 0x82, 0x1a, 0x14, 0x75, 0xef, + 0x5b, 0x00, 0xa7, 0xc5, + 0xea, 0x37, 0xd1, 0xa7, 0x99, 0x96, 0xbe, 0xb0, 0x72, 0x1e, 0xc0, 0x7f, + 0xee, 0x47, 0xe8, 0x7d, + 0x3b, 0xdb, 0x3c, 0xe0, 0x1c, 0xfc, 0x20, 0x9e, 0x8b, 0x95, 0x37, 0x89, + 0x95, 0xf3, 0xd5, 0xa7, + 0xfe, 0x37, 0x32, 0xb2, 0x1b, 0xaf, 0x7f, 0xa3, 0xa2, 0x92, 0x41, 0x9a, + 0x3f, 0xf3, 0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x73, 0xa9, 0xb8, 0xea, 0x92, 0xab, 0xb7, 0x76, 0xf6, + 0x80, 0x19, 0xb5, 0x39, + 0x93, 0xf3, 0x5c, 0xf0, 0x71, 0x3d, 0x24, 0xa7, 0x85, 0xe7, 0x7d, 0xb3, + 0x2d, 0xc8, 0x81, 0x64, + 0x94, 0x73, 0xdf, 0x62, 0x9c, 0xcb, 0x69, 0xcf, 0x02, 0x9d, 0x66, 0x9a, + 0xb2, 0xf9, 0xc1, 0x3c, + 0x6f, 0x32, 0x2f, 0x34, 0x76, 0x49, 0xff, 0xc8, 0xc8, 0x92, 0xa2, 0x7f, + 0xde, 0x5c, 0x81, 0xab, + 0x2e, 0xb9, 0x7a, 0xc7, 0xcb, 0xc1, 0x0f, 0xe2, 0xb9, 0xf0, 0x7a, 0x90, + 0x53, 0x44, 0x5c, 0x0f, + 0xcb, 0x69, 0x19, 0x65, 0x79, 0xde, 0x97, 0xf7, 0xbe, 0xa9, 0x66, 0xc4, + 0x61, 0xeb, 0xf5, 0x4e, + 0xae, 0x32, 0x97, 0x53, 0x32, 0x3f, 0x18, 0xe6, 0x67, 0x2e, 0x48, 0xff, + 0xc8, 0xc8, 0x92, 0xa7, + 0x7f, 0xde, 0x3c, 0x44, 0x76, 0xb1, 0x73, 0x08, 0xfa, 0x22, 0xe7, 0xb9, + 0x88, 0xbc, 0x89, 0x7f, + 0xae, 0x5a, 0xb0, 0xaf, 0x8a, 0xe3, 0xb4, 0x08, 0xe6, 0x73, 0xaa, 0xad, + 0x23, 0xe6, 0xbe, 0x21, + 0xe7, 0x72, 0x5a, 0xbd, 0x6f, 0x48, 0xce, 0x57, 0x90, 0xe6, 0x7a, 0xfa, + 0x4d, 0xd8, 0x5a, 0x90, + 0xfe, 0x91, 0x91, 0x25, 0x5b, 0xff, 0x78, 0xdc, 0xac, 0x0c, 0x7c, 0xe8, + 0x9a, 0x94, 0xe7, 0x02, + 0x79, 0x93, 0xf3, 0xad, 0x03, 0xe1, 0x37, 0xa6, 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95, 0x37, 0xe1, 0xb5, 0x38, 0xee, 0xbc, 0xc9, + 0xc5, 0xf6, 0x3e, 0xd4, + 0x26, 0x16, 0xe4, 0xf3, 0x83, 0x7d, 0x6b, 0x42, 0xfa, 0x47, 0x46, 0x76, + 0xe3, 0xf5, 0x6f, 0xb1, + 0xdb, 0x08, 0xe2, 0xb9, 0x80, 0xf6, 0x08, 0x56, 0xbd, 0xaa, 0x1e, 0x24, + 0xcd, 0xfd, 0xc6, 0xab, + 0xf0, 0x97, 0x03, 0xcf, 0x57, 0x56, 0xef, 0x1b, 0xe6, 0xdd, 0x63, 0x7b, + 0xdf, 0x02, 0xe7, 0x72, + 0xf6, 0x80, 0xfd, 0x9c, 0x6f, 0x85, 0xe5, 0x4d, 0x82, 0xfa, 0x4d, 0xf2, + 0x4e, 0xac, 0x93, 0xf4, + 0x8f, 0x8c, 0xec, 0xe6, 0x9f, 0xff, 0x4a, 0xad, 0x35, 0x9e, 0x8b, 0x55, + 0x97, 0x0c, 0xbd, 0x65, + 0x5b, 0xd3, 0x54, 0x38, 0x83, 0x80, 0xf3, 0x97, 0xab, 0x18, 0xfe, 0x32, + 0x82, 0xd3, 0xb2, 0x61, + 0x64, 0x16, 0xb9, 0x56, 0x66, 0xa8, 0x88, 0x11, 0x5a, 0x5f, 0x5b, 0x38, + 0xab, 0xa2, 0xe7, 0x72, + 0x86, 0xf1, 0xfb, 0x21, 0x6f, 0x92, 0x3f, 0x29, 0x1f, 0x02, 0xd7, 0xcf, + 0x9d, 0x37, 0x59, 0xeb, + 0x37, 0x39, 0xd2, 0xba, 0x2b, 0xce, 0x17, 0xe9, 0x1f, 0x19, 0x59, 0x12, + 0xf2, 0x1f, 0x6e, 0x9e, + 0xcb, 0x8a, 0x83, 0xcf, 0xce, 0x84, 0x4c, 0x03, 0xca, 0x21, 0x3c, 0x17, + 0x3b, 0xae, 0xc7, 0x99, + 0x56, 0xb1, 0xf0, 0x97, 0x35, 0x43, 0x5f, 0xe6, 0x98, 0xff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, 0xdf, 0x30, 0xcf, + 0x99, 0x56, 0x5a, 0x40, 0x9f, 0x84, 0x9b, 0x83, 0x5f, 0xbd, 0xbb, 0x9e, + 0x37, 0xf1, 0xf0, 0x5c, + 0xac, 0x1a, 0x19, 0x14, 0x7f, 0x79, 0x90, 0xee, 0xc2, 0xdc, 0x37, 0x97, + 0xaf, 0x6a, 0x5c, 0x37, + 0xae, 0x97, 0x5e, 0x22, 0x6a, 0x18, 0xaf, 0xc4, 0xf9, 0xa2, 0xfc, 0x07, + 0x19, 0x59, 0x52, 0xf5, + 0x0f, 0xc3, 0xaa, 0x87, 0xbc, 0x49, 0xe1, 0xb4, 0x7a, 0x00, 0xb5, 0x73, + 0xd2, 0xf9, 0xc1, 0x90, + 0x37, 0x19, 0xa4, 0x3b, 0xa8, 0x19, 0xe5, 0x43, 0x98, 0xfb, 0x96, 0x71, + 0xce, 0x88, 0xe9, 0x51, + 0xaa, 0x03, 0x39, 0x97, 0xc0, 0xf3, 0x60, 0x14, 0x56, 0xfd, 0x32, 0x9e, + 0xb9, 0x9c, 0xde, 0x35, + 0x21, 0xfd, 0x23, 0x23, 0x4b, 0xac, 0xfe, 0x21, 0xeb, 0xf5, 0xf2, 0xa7, + 0xbb, 0xb5, 0xed, 0xa9, + 0xd6, 0x08, 0xe2, 0xb9, 0x38, 0x79, 0x93, 0x93, 0x62, 0xad, 0x72, 0xbb, + 0xb2, 0x97, 0x1b, 0xa5, + 0x5a, 0xb2, 0xf9, 0xc1, 0x42, 0x5f, 0xf4, 0x76, 0x6e, 0x9e, 0x76, 0xf4, + 0x8f, 0xb3, 0x10, 0x96, + 0x7a, 0x33, 0x3b, 0xcb, 0xb4, 0x81, 0x83, 0xef, 0xa9, 0x4b, 0x16, 0xac, + 0x7a, 0x14, 0xd3, 0x4a, + 0x5d, 0xc3, 0x88, 0x9c, 0xcb, 0x39, 0xdd, 0x76, 0xc5, 0x3a, 0x49, 0xff, + 0xc8, 0xc8, 0x92, 0xaa, + 0x7f, 0x11, 0x99, 0x56, 0x2d, 0xf7, 0xbf, 0xb9, 0xe7, 0x07, 0xef, 0xba, + 0x39, 0x04, 0x16, 0x07, + 0x5f, 0xd6, 0x6f, 0x92, 0x9a, 0xea, 0x4e, 0xef, 0x1b, 0xcf, 0x19, 0x2f, + 0x2d, 0x16, 0x8c, 0xc5, + 0xc1, 0x2f, 0x5f, 0xec, 0xec, 0x3b, 0x35, 0xda, 0xf3, 0x38, 0xe3, 0x7a, + 0xb8, 0xb9, 0x9c, 0xde, + 0x35, 0x21, 0xfd, 0x23, 0x23, 0x4b, 0xaa, 0xfe, 0x89, 0x7a, 0xbd, 0xab, + 0x32, 0xad, 0xdc, 0x79, + 0x53, 0xbd, 0x55, 0x38, 0xde, 0x3a, 0x84, 0xb3, 0x60, 0xd8, 0xfc, 0x60, + 0x88, 0x33, 0x66, 0x66, + 0xb9, 0x96, 0x87, 0x79, 0x0a, 0x0c, 0x84, 0x61, 0xaa, 0x9b, 0x9e, 0x66, + 0xdb, 0x50, 0x17, 0xe3, + 0xf1, 0xaf, 0x2f, 0xca, 0xfb, 0xc0, 0x3e, 0xc8, 0xca, 0x78, 0x2e, 0x11, + 0xe3, 0x7a, 0x18, 0xce, + 0x97, 0xb7, 0x86, 0x91, 0xf4, 0x8f, 0x8c, 0x2c, 0xa9, 0xfa, 0x17, 0x89, + 0x69, 0xa5, 0xa8, 0x41, + 0x61, 0xbe, 0x6a, 0x0b, 0x6a, 0x50, 0x02, 0xe7, 0x07, 0xbb, 0x38, 0xf8, + 0x59, 0xe8, 0x7d, 0x1b, + 0x4b, 0xe6, 0x07, 0x33, 0x8d, 0xd3, 0x27, 0x85, 0x66, 0xf1, 0x64, 0xbb, + 0xc6, 0xfb, 0xd5, 0xee, + 0x0a, 0xff, 0x9a, 0x6b, 0x61, 0x10, 0xcf, 0xc5, 0xca, 0xd5, 0x44, 0x8f, + 0xeb, 0x85, 0xd4, 0xc8, + 0x78, 0xd6, 0x84, 0xf4, 0x8f, 0x8c,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, 0x63, 0x9d, 0xf3, 0xff, + 0x52, 0x03, 0xc9, 0xcc, + 0x4b, 0xf0, 0xbb, 0xa7, 0xa5, 0xe6, 0xee, 0xed, 0xed, 0x3d, 0x39, 0xcf, + 0x45, 0x70, 0xf0, 0x79, + 0x5c, 0x6f, 0x1e, 0x0f, 0xbf, 0x3f, 0x78, 0x4d, 0x48, 0xff, 0xc8, 0xc8, + 0x92, 0xa6, 0x7f, 0x7e, + 0x56, 0xbd, 0xec, 0x5c, 0x57, 0xbc, 0xe0, 0x35, 0x28, 0x0a, 0xbf, 0x51, + 0x70, 0x5a, 0x64, 0x35, + 0x28, 0x4e, 0xde, 0xe4, 0x4c, 0xf4, 0x9b, 0x94, 0xce, 0x73, 0x75, 0x1e, + 0xeb, 0x3b, 0xce, 0x35, + 0xf5, 0x79, 0xb6, 0x15, 0x1c, 0xd7, 0x63, 0x5a, 0x24, 0xea, 0x09, 0x43, + 0x63, 0x8d, 0x90, 0x23, + 0xde, 0x5e, 0xe6, 0x0e, 0xa5, 0x3c, 0x97, 0x28, 0xb1, 0xce, 0xc0, 0x35, + 0x21, 0xfd, 0x23, 0x23, + 0x4b, 0x9a, 0xfe, 0x85, 0xb0, 0xea, 0x3d, 0xfe, 0x28, 0x7e, 0xae, 0xda, + 0x36, 0x6e, 0xae, 0xda, + 0x69, 0xbe, 0x06, 0x73, 0x3f, 0x32, 0x73, 0xc1, 0x7e, 0x86, 0x78, 0x5f, + 0xd0, 0xd7, 0x06, 0xc7, + 0xf5, 0x5c, 0x3c, 0x97, 0x20, 0x0e, 0x7e, 0x10, 0xcf, 0xc5, 0x89, 0x75, + 0x22, 0x38, 0x5f, 0x0b, + 0xee, 0x4b, 0x93, 0xfe, 0x91, 0x91, 0x25, 0x5c, 0xff, 0xb0, 0x4c, 0x2b, + 0x4c, 0x0d, 0x8a, 0x36, + 0x29, 0xb5, 0xd0, 0x9c, 0x96, 0x15, 0x7f, 0xd9, 0xd0, 0xfa, 0xa9, 0x6e, + 0x7a, 0x9c, 0xe9, 0x48, + 0xb5, 0x32, 0xac, 0xf7, 0x0d, 0x38, 0xf8, 0xe3, 0x7c, 0x0b, 0xde, 0x9f, + 0x13, 0x2b, 0x0c, 0xe2, + 0xb9, 0x40, 0xde, 0x64, 0xbc, 0x79, 0x0d, 0xce, 0x17, 0xe9, 0x1f, 0x19, + 0x59, 0xd2, 0xf4, 0xaf, + 0x70, 0x8a, 0x60, 0xd5, 0xf7, 0x33, 0x68, 0xa6, 0x55, 0x6c, 0x9c, 0x16, + 0xb7, 0x56, 0xaa, 0x98, + 0x56, 0xec, 0x7c, 0xca, 0x6b, 0x18, 0x47, 0xa9, 0x16, 0x8f, 0x35, 0x06, + 0xf0, 0x5c, 0x78, 0xde, + 0xe4, 0xb8, 0x74, 0xc8, 0x39, 0x5f, 0xb2, 0xbc, 0x8b, 0x1d, 0xeb, 0x84, + 0x7e, 0xc0, 0xb5, 0x35, + 0x21, 0xfd, 0x23, 0x23, 0xbb, 0xf1, 0xfa, 0xc7, 0xce, 0x72, 0xae, 0xfd, + 0x8f, 0x67, 0x5a, 0x45, + 0xe7, 0x2f, 0x4b, 0x63, 0x89, 0x28, 0x4e, 0x8b, 0xad, 0x95, 0x67, 0x38, + 0xa6, 0x95, 0x9f, 0xdf, + 0xbf, 0xc6, 0x73, 0x71, 0x71, 0xbe, 0xa4, 0xf3, 0x83, 0xad, 0xd7, 0x0c, + 0x5e, 0x13, 0xd2, 0x3f, + 0x32, 0xb2, 0x1b, 0xaf, 0x7f, 0xb3, 0x72, 0x13, 0xea, 0x92, 0x37, 0x67, + 0xa2, 0x2e, 0x19, 0x19, + 0xd7, 0x43, 0x33, 0xad, 0x22, 0x70, 0x5a, 0x10, 0xfa, 0xe7, 0xd4, 0xeb, + 0x21, 0x98, 0x56, 0xd2, + 0xb8, 0xde, 0x8a, 0x83, 0x7f, 0x5e, 0x5d, 0xd5, 0x25, 0xba, 0xe7, 0x07, + 0x7b, 0x38, 0xf8, 0x82, + 0xdf, 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, 0x18, + 0x7a, 0x2c, 0xac, 0x7e, + 0x93, 0x86, 0x95, 0x37, 0x31, 0x82, 0xe2, 0x79, 0x36, 0x07, 0x1f, 0xbe, + 0x76, 0x55, 0xa3, 0x1d, + 0xc0, 0x73, 0x81, 0xef, 0xe7, 0xbd, 0xc9, 0x58, 0xa6, 0xd5, 0x75, 0x38, + 0x5f, 0xa4, 0x7f, 0x64, + 0x64, 0x89, 0xd1, 0x3f, 0x2b, 0xae, 0x87, 0x63, 0x5a, 0x95, 0x70, 0x4c, + 0x2b, 0x7f, 0x5c, 0xcf, + 0x33, 0x3f, 0xd8, 0xd7, 0x63, 0x71, 0xb1, 0xb3, 0x97, 0x67, 0x3e, 0x2e, + 0x70, 0xee, 0xb5, 0x23, + 0xcd, 0x08, 0x88, 0xcb, 0xf1, 0xb8, 0x5e, 0x71, 0x9e, 0xab, 0x4b, 0x79, + 0x2e, 0x50, 0x97, 0x3c, + 0x2d, 0x34, 0xa1, 0x46, 0x46, 0x8b, 0x83, 0xdf, 0x1f, 0xba, 0x26, 0xa4, + 0x7f, 0x64, 0x64, 0xc9, + 0xd1, 0xbf, 0x98, 0x99, 0x56, 0x10, 0xd7, 0x0b, 0xeb, 0x7d, 0x83, 0xbc, + 0xc9, 0xa4, 0xd0, 0xe4, + 0xe7, 0x38, 0x4b, 0xcb, 0x4a, 0x67, 0xb9, 0x3a, 0x67, 0x3f, 0x33, 0x9f, + 0x17, 0x38, 0xf8, 0x7e, + 0xed, 0x74, 0xf7, 0xbe, 0x71, 0x9e, 0xcb, 0x34, 0xdf, 0x5c, 0xe7, 0xe0, + 0x97, 0xf7, 0x80, 0x8f, + 0xbf, 0x39, 0x93, 0xf2, 0x5c, 0x44, 0x5c, 0xef, 0xac, 0x7a, 0x50, 0x9e, + 0x5f, 0x81, 0xdf, 0x4f, + 0xfa, 0x47, 0x46, 0x96, 0x3c, 0xfd, 0xb3, 0x58, 0xf5, 0xf1, 0xd4, 0xeb, + 0x21, 0x39, 0x2d,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x42, 0xfa, 0x47, 0x46, 0x96, 0x88, 0xfc, 0xc7, 0x51, + 0xaa, 0x0b, 0xf5, 0x2a, + 0xe5, 0xf3, 0xad, 0x03, 0x87, 0x77, 0xfa, 0x94, 0xcd, 0x7e, 0x76, 0xf5, + 0x58, 0x30, 0x8d, 0xc0, + 0xf3, 0x97, 0x71, 0x35, 0x32, 0xca, 0x59, 0x73, 0x76, 0xdd, 0xcd, 0x3c, + 0xd7, 0xc2, 0xce, 0xe5, + 0xcc, 0x5c, 0xa7, 0x86, 0xd1, 0xce, 0x9b, 0x2c, 0x4b, 0xf5, 0xd0, 0x7e, + 0x13, 0xe2, 0x5f, 0x91, + 0x91, 0x25, 0x24, 0xff, 0x2b, 0xb4, 0x08, 0xfc, 0x46, 0x8d, 0x9d, 0xa1, + 0xa0, 0x87, 0xa2, 0x78, + 0xba, 0x5d, 0x73, 0x78, 0xa7, 0x4e, 0xae, 0x60, 0xeb, 0x00, 0xfa, 0x6f, + 0x73, 0x63, 0x39, 0xcf, + 0x05, 0x1d, 0xd7, 0xc3, 0x72, 0x5a, 0xac, 0xb3, 0x62, 0x66, 0x99, 0x6b, + 0x95, 0xe2, 0x62, 0x5a, + 0x45, 0x98, 0xcb, 0x59, 0x5a, 0x48, 0xfa, 0x4d, 0x66, 0x97, 0x4d, 0xd2, + 0x3f, 0x32, 0xb2, 0x04, + 0xe8, 0x9f, 0x84, 0x55, 0xaf, 0xf5, 0x81, 0x77, 0xec, 0xeb, 0xdb, 0x65, + 0x7f, 0x42, 0x7c, 0x0c, + 0x72, 0x05, 0x41, 0x3c, 0x17, 0x3b, 0xae, 0x57, 0x5d, 0xa6, 0x50, 0xbe, + 0xaa, 0x8a, 0xd3, 0x62, + 0x6b, 0x91, 0xbe, 0xcc, 0x35, 0x95, 0x71, 0xbd, 0x48, 0x4c, 0x2b, 0xe4, + 0x5c, 0xce, 0x81, 0xab, + 0xdf, 0xc4, 0x3d, 0x3f, 0x78, 0x41, 0xfc, 0x67, 0x32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1f, 0x0f, + 0xd3, 0x2a, 0x88, 0xf3, + 0xe5, 0xee, 0x37, 0x71, 0xe5, 0x4d, 0x48, 0xff, 0xc8, 0xc8, 0x12, 0xaa, + 0x7f, 0x6e, 0xbf, 0xf1, + 0xb8, 0x72, 0x58, 0x3d, 0x2b, 0x1c, 0x14, 0x64, 0x3c, 0x17, 0x2b, 0x6f, + 0x02, 0x73, 0x2f, 0x55, + 0x71, 0x3d, 0x6d, 0xe5, 0xab, 0x9a, 0xe1, 0xb9, 0x0a, 0xa6, 0x7f, 0x13, + 0xad, 0x0d, 0x39, 0x90, + 0x8d, 0xb8, 0x98, 0x56, 0xec, 0xfd, 0x5d, 0x97, 0xf3, 0xe5, 0xe9, 0x37, + 0xa1, 0xf8, 0x1f, 0x19, + 0x59, 0xe2, 0xf5, 0x2f, 0x0f, 0x4c, 0xab, 0x99, 0xe0, 0x43, 0x07, 0xf3, + 0x5c, 0x76, 0x79, 0xac, + 0x10, 0xfc, 0xc6, 0xd2, 0x22, 0x57, 0xcf, 0x86, 0xcc, 0xcc, 0xc5, 0xf2, + 0x97, 0x21, 0xef, 0xab, + 0x8f, 0x36, 0x42, 0x7b, 0xdf, 0xdc, 0x71, 0x3d, 0x19, 0xab, 0xde, 0x5f, + 0x23, 0x83, 0xac, 0x61, + 0xc4, 0x71, 0xbe, 0x66, 0x54, 0xff, 0x47, 0x46, 0x96, 0x70, 0xfd, 0x93, + 0xb1, 0xea, 0x0d, 0x0f, + 0x07, 0xff, 0x4e, 0x75, 0x8d, 0xe7, 0xe2, 0x9f, 0x1f, 0xbc, 0xaa, 0x91, + 0xc9, 0x29, 0x39, 0x5a, + 0x19, 0x2b, 0xef, 0x6b, 0xf5, 0xbe, 0x85, 0x9d, 0xff, 0x70, 0xac, 0x7a, + 0x9b, 0x69, 0xd5, 0x47, + 0x71, 0xbe, 0xd6, 0xf4, 0xef, 0x83, 0x83, 0xb7, 0x1b, 0xef, 0x1d, 0xbc, + 0xd7, 0x78, 0xcf, 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 0x9e, 0x8d, 0x41, 0xfd, + 0x26, 0x77, 0xbd, 0xfd, + 0x26, 0xba, 0x24, 0x1f, 0xfe, 0x62, 0xd4, 0xac, 0x86, 0xc6, 0xb6, 0x23, + 0xf6, 0x9b, 0x88, 0x3a, + 0xde, 0xe2, 0x03, 0xa9, 0x65, 0x8f, 0x18, 0xdb, 0x16, 0xf3, 0x16, 0x97, + 0xfa, 0x61, 0xc8, 0xfc, + 0x60, 0x9e, 0x37, 0x81, 0xcf, 0x9f, 0xea, 0x35, 0x63, 0xae, 0x65, 0x47, + 0xc5, 0xb6, 0xe3, 0x5d, + 0x13, 0x91, 0x37, 0x01, 0xce, 0x17, 0xdc, 0xbb, 0x74, 0x7e, 0x30, 0x3c, + 0xe3, 0x2c, 0xdf, 0x25, + 0x2e, 0xce, 0x57, 0x9c, 0x6b, 0xa2, 0x59, 0x75, 0x39, 0x22, 0x6f, 0xb2, + 0x29, 0xed, 0x37, 0xe1, + 0xfe, 0xfb, 0x34, 0xd5, 0x0c, 0xed, 0x37, 0x79, 0x31, 0x66, 0xd3, 0x06, + 0xe4, 0x01, 0x83, 0xe7, + 0x4c, 0x22, 0xfa, 0x4d, 0xee, 0x7b, 0x2d, 0x7b, 0x48, 0x1d, 0xef, 0x40, + 0xd1, 0x6f, 0x72, 0x12, + 0xd2, 0x6f, 0x32, 0x5c, 0x9d, 0xd7, 0xc5, 0x79, 0x41, 0x7b, 0x78, 0x6a, + 0x56, 0x7d, 0x67, 0x94, + 0xfc, 0x54, 0xd1, 0x6f, 0x32, 0xdf, 0xaa, 0x5b, 0x7b, 0xc0, 0x50, 0xf9, + 0xef, 0xd8, 0xda, 0xb4, + 0xf4, 0xfd, 0x98, 0xb7, 0x28, 0x99, 0x1f, 0x0c, 0xf7, 0x02, 0xfb, 0x2e, + 0x8c, 0xe7, 0x72, 0x1f, + 0x6a, 0xd9, 0x51, 0x35, 0xab, 0x6e, 0x5d, 0x40, 0xd5, 0xf1, 0x9e, 0x22, + 0xea,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, 0xe1, 0x5e, 0xb4, 0x2e, 0xec, 0x81, + 0xd2, 0x4c, 0x31, 0x0f, + 0x32, 0xd6, 0x3d, 0x00, 0x71, 0x0a, 0xb6, 0x07, 0x54, 0x33, 0x28, 0x79, + 0x6f, 0x16, 0x7b, 0xcd, + 0x81, 0xd6, 0x81, 0xfe, 0x2b, 0xd8, 0xff, 0x9b, 0x67, 0xde, 0x7b, 0x29, + 0x9e, 0xb2, 0x7b, 0x59, + 0xe4, 0x1b, 0xa5, 0x93, 0x5c, 0x5d, 0x53, 0xf4, 0x9b, 0x84, 0xed, 0x01, + 0x60, 0x20, 0x58, 0xbf, + 0x57, 0x63, 0xa5, 0x0b, 0x29, 0xa5, 0x2e, 0xc0, 0xef, 0xe1, 0x81, 0xae, + 0x09, 0xdb, 0x2f, 0xb0, + 0x26, 0xf9, 0x05, 0xf0, 0xae, 0x7d, 0xbf, 0x57, 0xb6, 0x16, 0x79, 0xa8, + 0x2b, 0x1c, 0xa6, 0x3b, + 0xa9, 0x49, 0xa1, 0x85, 0xd6, 0x85, 0x49, 0x4c, 0xba, 0x30, 0x65, 0xba, + 0x70, 0x9c, 0x6d, 0xa8, + 0x5e, 0x33, 0x77, 0x52, 0xaa, 0xe7, 0x79, 0xbf, 0x89, 0xd6, 0xb5, 0x75, + 0x7d, 0xf3, 0xb4, 0x78, + 0xe8, 0xd1, 0x42, 0xf6, 0x19, 0x85, 0x7d, 0xa7, 0x8f, 0x43, 0xea, 0xc5, + 0xb9, 0x2e, 0x80, 0x16, + 0xc5, 0xa9, 0x0b, 0xc5, 0x43, 0x55, 0xce, 0x2b, 0x1d, 0xa8, 0x45, 0x90, + 0x6b, 0xc8, 0x74, 0xb2, + 0x33, 0x76, 0xfe, 0x38, 0x95, 0xe8, 0xfa, 0x88, 0xb3, 0x36, 0xbc, 0x7e, + 0x18, 0xd7, 0x85, 0xcd, + 0xc3, 0x38, 0x75, 0x41, 0x75, 0x7e, 0xe5, 0xcf, 0xe3, 0xd3, 0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9f, 0x4f, 0x69, 0xad, 0x05, 0x8f, 0xaf, 0x81, 0xae, 0x5b, + 0xba, 0xa0, 0x3c, 0xbf, + 0x8e, 0x23, 0xe8, 0x82, 0xca, 0x7f, 0x47, 0x9e, 0x99, 0x85, 0xef, 0xa2, + 0x83, 0xef, 0x62, 0xc7, + 0xd7, 0x1a, 0x6b, 0xf1, 0x35, 0xa6, 0xeb, 0x5c, 0x17, 0xc4, 0x7c, 0x13, + 0x43, 0x75, 0x66, 0x8e, + 0x4b, 0x17, 0x72, 0x98, 0x33, 0x33, 0x68, 0x91, 0xef, 0xd9, 0x18, 0x18, + 0x5f, 0x13, 0x5a, 0x58, + 0x2b, 0xb0, 0xe7, 0xb5, 0x2f, 0xbe, 0x66, 0xac, 0xf9, 0xef, 0xc3, 0x2b, + 0xc5, 0xf5, 0x82, 0x75, + 0x61, 0x79, 0xbd, 0xd8, 0xb6, 0xe3, 0x87, 0xb1, 0x7b, 0x29, 0x79, 0xef, + 0x65, 0x2d, 0xbe, 0x06, + 0xf7, 0x92, 0x46, 0xed, 0x01, 0x0d, 0xb9, 0x07, 0x72, 0x11, 0x62, 0xdb, + 0xea, 0xd7, 0x84, 0x3d, + 0x00, 0xe7, 0x03, 0x59, 0x7c, 0x8d, 0xeb, 0x3a, 0xd3, 0x16, 0x6b, 0x0f, + 0x18, 0xaa, 0x73, 0x7a, + 0x5c, 0x7b, 0xe0, 0x4a, 0xb1, 0x6d, 0x91, 0x2b, 0x58, 0x3f, 0xaf, 0xb3, + 0x7b, 0x81, 0x3d, 0x00, + 0xe7, 0x75, 0x79, 0xbd, 0xb8, 0xfd, 0x5c, 0x48, 0x77, 0x80, 0x81, 0x0f, + 0x97, 0x73, 0x26, 0x84, + 0xff, 0xbf, 0xd0, 0x5b, 0x99, 0x09, 0xfb, 0xde, 0x81, 0x88, 0x15, 0x6a, + 0xc3, 0x6c, 0x27, 0xb7, + 0xc8, 0xb4, 0x94, 0xb9, 0x94, 0x59, 0xae, 0xa5, 0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 0xd7, 0x4c, + 0x8d, 0x98, 0xff, 0x31, + 0x5b, 0xff, 0xbd, 0x00, 0x63, 0x38, 0x3d, 0x4e, 0x75, 0xe0, 0x35, 0xf5, + 0xb1, 0xd6, 0x51, 0xbd, + 0x26, 0x6e, 0x0f, 0x64, 0x31, 0x7b, 0xc0, 0x10, 0x7b, 0x40, 0xb5, 0xef, + 0x7c, 0x9f, 0xc7, 0x23, + 0xb1, 0xff, 0x33, 0x33, 0x31, 0x07, 0xc3, 0xbd, 0xff, 0xe1, 0x7e, 0x32, + 0xec, 0x77, 0xe6, 0xcf, + 0x15, 0x5c, 0x69, 0x0f, 0x9c, 0x5c, 0x69, 0x0f, 0x04, 0xde, 0x27, 0xfb, + 0x3c, 0xb6, 0x32, 0x41, + 0x9f, 0x47, 0xf7, 0x4c, 0x8f, 0x25, 0xfb, 0xdd, 0x48, 0xb5, 0x4c, 0x5b, + 0xab, 0x3d, 0xcb, 0x59, + 0xba, 0x20, 0x7e, 0xaf, 0x59, 0xef, 0xef, 0x15, 0xbe, 0x1f, 0x7e, 0xaf, + 0x53, 0xf0, 0x6b, 0x9c, + 0xb8, 0xa9, 0xf1, 0x40, 0x74, 0x61, 0x7c, 0xc5, 0x35, 0xf1, 0xcd, 0x37, + 0x71, 0xee, 0xe5, 0x04, + 0xd6, 0x22, 0xeb, 0xd1, 0x75, 0xff, 0xbd, 0x60, 0x75, 0x41, 0xbf, 0xbe, + 0x2e, 0xb8, 0xce, 0x62, + 0xec, 0x35, 0xa7, 0x92, 0xd7, 0xec, 0x09, 0x66, 0x59, 0x9a, 0x69, 0x9e, + 0x7e, 0x12, 0xa0, 0xeb, + 0x53, 0xb8, 0x97, 0x54, 0xd7, 0x99, 0x6f, 0x30, 0xc8, 0x74, 0x5f, 0x04, + 0x5d, 0xc0, 0x3f, 0x1b, + 0xd9, 0x7d, 0xc2, 0x33, 0x8a, 0xeb, 0xfa, 0xa9, 0x4f, 0xd7, 0xad, 0x79, + 0x84, 0xd6, 0x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0x94, 0x31, 0x2c, + 0xfe, 0x9a, 0x99, 0x96, + 0x52, 0xd7, 0xe7, 0xd6, 0x73, 0x2a, 0xec, 0xf7, 0x8e, 0x7c, 0x36, 0x6a, + 0x51, 0xce, 0xe9, 0x23, + 0xcc, 0xdc, 0x8f, 0x58, 0xd7, 0xc4, 0xd0, 0xc6, 0x59, 0x91, 0x77, 0x09, + 0x8a, 0xaf, 0xb9, 0xfa, + 0x4d, 0x44, 0xbc, 0x7f, 0x23, 0x96, 0x58, 0x67, 0xac, 0x79, 0x40, 0x4b, + 0x8b, 0x78, 0xbd, 0x4f, + 0x58, 0xde, 0x04, 0xf6, 0xe0, 0xc2, 0xe3, 0xbb, 0x5c, 0x2f, 0xae, 0x77, + 0xbf, 0xf3, 0x80, 0xbd, + 0x00, 0x3f, 0xec, 0x34, 0x3c, 0xbe, 0x86, 0xd7, 0x85, 0x8d, 0xb8, 0x74, + 0x01, 0x17, 0xef, 0xef, + 0x89, 0x9a, 0x4f, 0x1e, 0xa7, 0x08, 0x8b, 0xaf, 0x81, 0xae, 0x0f, 0x91, + 0xb9, 0xf0, 0xd8, 0xcf, + 0x28, 0x19, 0xd4, 0x6b, 0xea, 0xec, 0x8c, 0x22, 0x8d, 0xaf, 0x2d, 0x85, + 0xef, 0x21, 0xe2, 0x97, + 0xe1, 0x35, 0x5b, 0x1b, 0x71, 0xea, 0xc2, 0xd5, 0x63, 0xdb, 0xae, 0x3a, + 0xa7, 0xf5, 0x3d, 0x93, + 0x9d, 0x85, 0xe4, 0xc3, 0x23, 0xed, 0x01, 0xdc, 0xf3, 0x38, 0x2c, 0xb6, + 0xfd, 0xff, 0x03, 0x75, + 0x97, 0x23, 0xba +}; diff --git a/source/ngc/gui/iso9660.c b/source/ngc/gui/iso9660.c new file mode 100644 index 0000000..2a8bb9a --- /dev/null +++ b/source/ngc/gui/iso9660.c @@ -0,0 +1,239 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * DVD ISO9660/Joliet Parsing + * + * This is not intended as a complete guide to ISO9660. + * Here I use the bare minimum! + ***************************************************************************/ +#include "shared.h" +#include "dvd.h" +#include "iso9660.h" + +/** Minimal ISO Directory Definition **/ +#define RECLEN 0 /* Record length */ +#define EXTENT 6 /* Extent */ +#define FILE_LENGTH 14 /* File length (BIG ENDIAN) */ +#define FILE_FLAGS 25 /* File flags */ +#define FILENAME_LENGTH 32 /* Filename length */ +#define FILENAME 33 /* ASCIIZ filename */ + +/** Minimal Primary Volume Descriptor **/ +#define PVDROOT 0x9c + +static int IsJoliet = 0; +u64 rootdir = 0; +u64 basedir = 0; +int rootdirlength = 0; + +/** Global file entry table **/ +FILEENTRIES filelist[MAXFILES]; +static char dvdbuffer[2048]; + +/**************************************************************************** + * Primary Volume Descriptor + * + * The PVD should reside between sector 16 and 31. + * This is for single session DVD only. + ****************************************************************************/ +int getpvd () +{ + int sector = 16; + u32 rootdir32; + + basedir = rootdirlength = 0; + IsJoliet = -1; + + /** Look for Joliet PVD first **/ + while (sector < 32) + { + if (dvd_read (&dvdbuffer, 2048, (u64)(sector << 11))) + { + if (memcmp (&dvdbuffer, "\2CD001\1", 8) == 0) + { + memcpy(&rootdir32, &dvdbuffer[PVDROOT + EXTENT], 4); + basedir = (u64)rootdir32; + memcpy (&rootdirlength, &dvdbuffer[PVDROOT + FILE_LENGTH], 4); + basedir <<= 11; + IsJoliet = 1; + break; + } + } + else return 0; /*** Can't read sector! ***/ + sector++; + } + + if (IsJoliet > 0) return 1; /*** Joliet PVD Found ? ***/ + + /*** Look for standard ISO9660 PVD ***/ + sector = 16; + while (sector < 32) + { + if (dvd_read (&dvdbuffer, 2048, (u64)(sector << 11))) + { + if (memcmp (&dvdbuffer, "\1CD001\1", 8) == 0) + { + memcpy (&rootdir32, &dvdbuffer[PVDROOT + EXTENT], 4); + basedir = (u64)rootdir32; + memcpy (&rootdirlength, &dvdbuffer[PVDROOT + FILE_LENGTH], 4); + IsJoliet = 0; + basedir <<= 11; + break; + } + } + else return 0; /*** Can't read sector! ***/ + sector++; + } + + return (IsJoliet == 0); +} + +/**************************************************************************** + * getentry + * + * Support function to return the next file entry, if any + * Declared static to avoid accidental external entry. + ****************************************************************************/ +static int diroffset = 0; +static int getentry (int entrycount) +{ + char fname[512]; /* Huge, but experience has determined this */ + char *ptr; + char *filename; + char *filenamelength; + char *rr; + int j; + u32 offset32; + + /* Basic checks */ + if (entrycount >= MAXFILES) return 0; + if (diroffset >= 2048) return 0; + + /** Decode this entry **/ + if (dvdbuffer[diroffset]) /* Record length available */ + { + /* Update offsets into sector buffer */ + ptr = (char *) &dvdbuffer[0]; + ptr += diroffset; + filename = ptr + FILENAME; + filenamelength = ptr + FILENAME_LENGTH; + + /* Check for wrap round - illegal in ISO spec, + * but certain crap writers do it! */ + if ((diroffset + dvdbuffer[diroffset]) > 2048) return 0; + + if (*filenamelength) + { + memset (&fname, 0, 512); + + /*** Do ISO 9660 first ***/ + if (!IsJoliet) strcpy (fname, filename); + else + { + /*** The more tortuous unicode joliet entries ***/ + for (j = 0; j < (*filenamelength >> 1); j++) + { + fname[j] = filename[j * 2 + 1]; + } + + fname[j] = 0; + + if (strlen (fname) >= MAXJOLIET) fname[MAXJOLIET - 1] = 0; + if (strlen (fname) == 0) fname[0] = filename[0]; + } + + if (strlen (fname) == 0) strcpy (fname, "."); + else + { + if (fname[0] == 1) strcpy (fname, ".."); + else + { + /* + * Move *filenamelength to t, + * Only to stop gcc warning for noobs :) + */ + int t = *filenamelength; + fname[t] = 0; + } + } + + /** Rockridge Check **/ + rr = strstr (fname, ";"); + if (rr != NULL) *rr = 0; + + strcpy (filelist[entrycount].filename, fname); + memcpy (&offset32, &dvdbuffer[diroffset + EXTENT], 4); + filelist[entrycount].offset = (u64)offset32; + memcpy (&filelist[entrycount].length, &dvdbuffer[diroffset + FILE_LENGTH], 4); + memcpy (&filelist[entrycount].flags, &dvdbuffer[diroffset + FILE_FLAGS], 1); + + filelist[entrycount].offset <<= 11; + filelist[entrycount].flags = filelist[entrycount].flags & 2; + filelist[entrycount].filename_offset = 0; + + /*** Prepare for next entry ***/ + diroffset += dvdbuffer[diroffset]; + + return 1; + } + } + return 0; +} + +/**************************************************************************** + * parsedirectory + * + * This function will parse the directory tree. + * It relies on rootdir and rootdirlength being pre-populated by a call to + * getpvd, a previous parse or a menu selection. + * + * The return value is number of files collected, or 0 on failure. + ****************************************************************************/ +int parsedirectory () +{ + int pdlength; + u64 pdoffset; + u64 rdoffset; + int len = 0; + int filecount = 0; + + pdoffset = rdoffset = rootdir; + pdlength = rootdirlength; + filecount = 0; + + /** Clear any existing values ***/ + memset (&filelist, 0, sizeof (FILEENTRIES) * MAXFILES); + + /*** Get as many files as possible ***/ + while (len < pdlength) + { + if (dvd_read (&dvdbuffer, 2048, pdoffset) == 0) return 0; + + diroffset = 0; + + while (getentry (filecount)) + { + if (filecount < MAXFILES) filecount++; + } + + len += 2048; + pdoffset = rdoffset + len; + } + return filecount; +} diff --git a/source/ngc/gui/iso9660.h b/source/ngc/gui/iso9660.h new file mode 100644 index 0000000..ae132d6 --- /dev/null +++ b/source/ngc/gui/iso9660.h @@ -0,0 +1,44 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * DVD ISO9660/Joliet Parsing + * + * This is not intended as a complete guide to ISO9660. + * Here I use the bare minimum! + ***************************************************************************/ + +#define MAXJOLIET 256 +#define MAXFILES 1000 /** Restrict to 1000 files per dir **/ + +typedef struct +{ + u64 offset; + unsigned int length; + char flags; + char filename[MAXJOLIET]; + u16 filename_offset; +} FILEENTRIES; + +extern u64 basedir; +extern u64 rootdir; +extern int rootdirlength; + +extern int getpvd (); +extern int parsedirectory (); +extern FILEENTRIES filelist[MAXFILES]; diff --git a/source/ngc/gui/legal.c b/source/ngc/gui/legal.c new file mode 100644 index 0000000..e5fde47 --- /dev/null +++ b/source/ngc/gui/legal.c @@ -0,0 +1,100 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ***************************************************************************/ + +#include "shared.h" +#include "font.h" +#include "dkpro.h" + +extern u32 *xfb[2]; +extern int whichfb; + +/* + * Unpack the devkit pro logo + */ +u32 *dkproraw; + +int dkunpack () +{ + unsigned long res, inbytes, outbytes; + + inbytes = dkpro_COMPRESSED; + outbytes = dkpro_RAW; + dkproraw = malloc (dkpro_RAW + 16); + res = uncompress ((char *) dkproraw, &outbytes, (char *) &dkpro[0], inbytes); + if (res == Z_OK) return 1; + free (dkproraw); + return 0; +} + +/* + * This is the legal stuff - which must be shown at program startup + * Any derivative work MUST include the same textual output. + * + * In other words, play nice and give credit where it's due. + */ +void legal () +{ + int ypos = 64; + + whichfb ^= 1; + VIDEO_ClearFrameBuffer(&TVNtsc480IntDf, xfb[whichfb], COLOR_BLACK); + back_framewidth = 640; + + WriteCentre (ypos, "Genesis Plus Sega Mega Drive Emulator (v1.2a)"); + ypos += fheight; + WriteCentre (ypos, "(C) 1999 - 2003 Charles MacDonald"); + ypos += fheight; + WriteCentre (ypos, "This is free software, and you are welcome to"); + ypos += fheight; + WriteCentre (ypos, "redistribute it under the conditions of the"); + ypos += fheight; + WriteCentre (ypos, "GNU GENERAL PUBLIC LICENSE Version 2"); + ypos += fheight; + WriteCentre (ypos, "Additionally, the developers of this port"); + ypos += fheight; + WriteCentre (ypos, "disclaims all copyright interests in the "); + ypos += fheight; + WriteCentre (ypos, "Nintendo Gamecube Porting code."); + ypos += fheight; + WriteCentre (ypos, "You are free to use it as you wish."); + ypos += 6 * fheight; + + if (dkunpack ()) + { + int w, h, p, dispoffset; + p = 0; + dispoffset = (316 * 320) + ((640 - dkpro_WIDTH) >> 2); + + for (h = 0; h < dkpro_HEIGHT; h++) + { + for (w = 0; w < dkpro_WIDTH >> 1; w++) + xfb[whichfb][dispoffset + w] = dkproraw[p++]; + + dispoffset += 320; + } + + free (dkproraw); + } + else WriteCentre (ypos, "Developed with DevkitPPC and libOGC"); + + WriteCentre (ypos, "Press A to continue"); + SetScreen (); + WaitButtonA (); +} diff --git a/source/ngc/gui/mcard.c b/source/ngc/gui/mcard.c new file mode 100644 index 0000000..5433c6c --- /dev/null +++ b/source/ngc/gui/mcard.c @@ -0,0 +1,587 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ***************************************************************************/ +#include "shared.h" +#include "dvd.h" +#include "font.h" +#include "rominfo.h" +#include "saveicon.h" /*** Nice little icon - thanks brakken! ***/ + +/* Support for MemCards */ +/** + * libOGC System Work Area + */ +static u8 SysArea[CARD_WORKAREA] ATTRIBUTE_ALIGN (32); + +/** + * DMA Transfer Area. + * Must be 32-byte aligned. + * 64k SRAM + 2k Icon + */ +unsigned char savebuffer[0x24000] ATTRIBUTE_ALIGN (32); + +card_dir CardDir; +card_file CardFile; +card_stat CardStatus; +extern int CARDSLOT; +extern int use_SDCARD; + +int ManageSRAM (int direction); +int ManageState (int direction); + +/**************************************************************************** + * SRAM autoload + * + * the detection order is the following: + * MCARD (SLOTA) > MCARD (SLOTB) > SDCARD (SLOTA) > SDCARD (SLOTB) + * + *****************************************************************************/ +extern u8 SILENT; + +void sram_autoload() +{ + int ret = 0; + int i = 0; + int old_cardslot = CARDSLOT; + int old_sdcard = use_SDCARD; + + SILENT = 1; /* this should be transparent to the user */ + while ((i < 4) && (!ret)) + { + use_SDCARD = (i&2) ? 1 : 0; + CARDSLOT = (i&1) ? CARD_SLOTB : CARD_SLOTA; + ret = ManageSRAM(1); + i++; + } + if (!ret) + { + /* restore old settings if not found */ + CARDSLOT = old_cardslot; + use_SDCARD = old_sdcard; + } + SILENT = 0; +} + +/**************************************************************************** + * SDCARD Access functions + * + * We use the same buffer as for Memory Card manager + * Function returns TRUE on success. + *****************************************************************************/ +int SD_ManageFile(char *filename, int direction, int filetype) +{ + char name[1024]; + sd_file *handle; + int len = 0; + int offset = 0; + int filesize; + unsigned long inbytes,outbytes; + + /* build complete SDCARD filename */ + sprintf (name, "dev%d:\\genplus\\saves\\%s", CARDSLOT, filename); + + /* open file */ + handle = direction ? SDCARD_OpenFile (name, "rb") : + SDCARD_OpenFile (name, "wb"); + + if (handle == NULL) + { + sprintf (filename, "Error opening %s", name); + WaitPrompt(filename); + return 0; + } + + switch (direction) + { + case 0: /* SAVING */ + + if (filetype) /* SRAM */ + { + inbytes = 0x10000; + outbytes = 0x12000; + compress2 ((char *) &savebuffer[sizeof(outbytes)], &outbytes, (char *) &sram.sram, inbytes, 9); + memcpy(&savebuffer[0], &outbytes, sizeof(outbytes)); + filesize = outbytes + sizeof(outbytes); + } + else filesize = state_save(&savebuffer[0]); /* STATE */ + + len = SDCARD_WriteFile (handle, savebuffer, filesize); + SDCARD_CloseFile (handle); + + if (len != filesize) + { + sprintf (filename, "Error writing %s", name); + WaitPrompt (filename); + return 0; + } + + sprintf (filename, "Saved %d bytes successfully", filesize); + WaitPrompt (filename); + return 1; + + case 1: /* LOADING */ + + while ((len = SDCARD_ReadFile (handle, &savebuffer[offset], 2048)) > 0) offset += len; + if (filetype) /* SRAM */ + { + memcpy(&inbytes,&savebuffer[0],sizeof(inbytes)); + outbytes = 0x10000; + uncompress ((char *) &sram.sram, &outbytes, (char *) &savebuffer[sizeof(inbytes)], inbytes); + sram.crc = crc32 (0, &sram.sram[0], outbytes); + system_reset (); + } + else state_load(&savebuffer[0]); /* STATE */ + SDCARD_CloseFile (handle); + + sprintf (filename, "Loaded %d bytes successfully", offset); + WaitPrompt (filename); + return 1; + } + + return 0; +} + +/**************************************************************************** + * MountTheCard + * + * libOGC provides the CARD_Mount function, and it should be all you need. + * However, experience with previous emulators has taught me that you are + * better off doing a little bit more than that! + * + * Function returns TRUE on success. + *****************************************************************************/ +int MountTheCard () +{ + int tries = 0; + int CardError; + while (tries < 10) + { + *(unsigned long *) (0xcc006800) |= 1 << 13; /*** Disable Encryption ***/ + uselessinquiry (); + VIDEO_WaitVSync (); + CardError = CARD_Mount (CARDSLOT, SysArea, NULL); /*** Don't need or want a callback ***/ + if (CardError == 0) return 1; + else EXI_ProbeReset (); + tries++; + } + return 0; +} + +/**************************************************************************** + * CardFileExists + * + * Wrapper to search through the files on the card. + * Returns TRUE if found. + ****************************************************************************/ +int CardFileExists (char *filename) +{ + int CardError = CARD_FindFirst (CARDSLOT, &CardDir, TRUE); + while (CardError != CARD_ERROR_NOFILE) + { + CardError = CARD_FindNext (&CardDir); + if (strcmp ((char *) CardDir.filename, filename) == 0) return 1; + } + return 0; +} + +/**************************************************************************** + * ManageSRAM + * + * Here is the main SRAM Management stuff. + * The output file contains an icon (2K), 64 bytes comment and the SRAM (64k). + * As memcards are allocated in blocks of 8k or more, you have a around + * 6k bytes to save/load any other data you wish without altering any of the + * main save / load code. + * + * direction == 0 save, 1 load. + ****************************************************************************/ +int ManageSRAM (int direction) +{ + char filename[128]; + char action[80]; + int CardError; + unsigned int SectorSize; + int blocks; + char comment[2][32] = { {"Genesis Plus 1.2a"}, {"SRAM Save"} }; + int outbytes = 0; + int sbo; + int i; + unsigned long inzipped,outzipped; + + if (!genromsize) return 0; + + if (direction) ShowAction ("Loading SRAM ..."); + else ShowAction ("Saving SRAM ..."); + + /* First, build a filename based on the information retrieved for this ROM */ + if (strlen (rominfo.domestic)) strcpy (filename, rominfo.domestic); + else strcpy (filename, rominfo.international); + + /* As these names tend to be bulked with spaces, let's strip them */ + /* Name should be in 16 character blocks, so take first 16 */ + filename[16] = 0; + for (i = strlen (filename) - 1; i > 0; i--) + if (filename[i] != 32) break; + filename[i + 1] = 0; + + /* Now add the 16bit checksum, to ensure it's the same ROM */ + sprintf (filename, "%s%02X.srm", filename, rominfo.checksum); + strcpy (comment[1], filename); + + /* device is SDCARD, let's go */ + if (use_SDCARD) return SD_ManageFile(filename,direction,1); + + /* device is MCARD, we continue */ + if (direction == 0) /*** Saving ***/ + { + /*** Build the output buffer ***/ + memcpy (&savebuffer, &icon, 2048); + memcpy (&savebuffer[2048], &comment[0], 64); + + inzipped = 0x10000; + outzipped = 0x12000; + compress2 ((char *) &savebuffer[2112+sizeof(outzipped)], &outzipped, (char *) &sram.sram, inzipped, 9); + memcpy(&savebuffer[2112], &outzipped, sizeof(outzipped)); + } + + outbytes = 2048 + 64 + outzipped + sizeof(outzipped); + + /*** Initialise the CARD system ***/ + memset (&SysArea, 0, CARD_WORKAREA); + CARD_Init ("GENP", "00"); + + /*** Attempt to mount the card ***/ + CardError = MountTheCard (); + + if (CardError) + { + /*** Retrieve the sector size ***/ + CardError = CARD_GetSectorSize (CARDSLOT, &SectorSize); + + switch (direction) + { + case 0: /*** Saving ***/ + /*** Determine number of blocks on this card ***/ + blocks = (outbytes / SectorSize) * SectorSize; + if (outbytes % SectorSize) blocks += SectorSize; + + /*** Check if a previous save exists ***/ + if (CardFileExists (filename)) + { + CardError = CARD_Open (CARDSLOT, filename, &CardFile); + if (CardError) + { + sprintf (action, "Error Open : %d", CardError); + WaitPrompt (action); + CARD_Unmount (CARDSLOT); + return 0; + } + + int size = CardFile.len; + CARD_Close (&CardFile); + + if (size < blocks) + { + /* new size is bigger: check if there is enough space left */ + CardError = CARD_Create (CARDSLOT, "TEMP", blocks-size, &CardFile); + if (CardError) + { + sprintf (action, "Error Update : %d", CardError); + WaitPrompt (action); + CARD_Unmount (CARDSLOT); + return 0; + } + CARD_Close (&CardFile); + CARD_Delete(CARDSLOT, "TEMP"); + } + + /* always delete existing slot */ + CARD_Delete(CARDSLOT, filename); + } + + /*** Create a new slot ***/ + CardError = CARD_Create (CARDSLOT, filename, blocks, &CardFile); + if (CardError) + { + sprintf (action, "Error create : %d %d", CardError, CARDSLOT); + WaitPrompt (action); + CARD_Unmount (CARDSLOT); + return 0; + } + + /*** Continue and save ***/ + CARD_GetStatus (CARDSLOT, CardFile.filenum, &CardStatus); + CardStatus.icon_addr = 0x0; + CardStatus.icon_fmt = 2; + CardStatus.icon_speed = 1; + CardStatus.comment_addr = 2048; + CARD_SetStatus (CARDSLOT, CardFile.filenum, &CardStatus); + + /*** And write the blocks out ***/ + sbo = 0; + while (outbytes > 0) + { + CardError = CARD_Write (&CardFile, &savebuffer[sbo], SectorSize, sbo); + outbytes -= SectorSize; + sbo += SectorSize; + } + + CARD_Close (&CardFile); + CARD_Unmount (CARDSLOT); + sram.crc = crc32 (0, &sram.sram[0], 0x10000); + sprintf (action, "Saved %d bytes successfully", blocks); + WaitPrompt (action); + return 1; + + default: /*** Loading ***/ + if (!CardFileExists (filename)) + { + WaitPrompt ("No SRAM File Found"); + CARD_Unmount (CARDSLOT); + return 0; + } + + memset (&CardFile, 0, sizeof (CardFile)); + CardError = CARD_Open (CARDSLOT, filename, &CardFile); + if (CardError) + { + sprintf (action, "Error Open : %d", CardError); + WaitPrompt (action); + CARD_Unmount (CARDSLOT); + return 0; + } + + blocks = CardFile.len; + if (blocks < SectorSize) blocks = SectorSize; + if (blocks % SectorSize) blocks++; + + /*** Just read the file back in ***/ + sbo = 0; + int size = blocks; + while (blocks > 0) + { + CARD_Read (&CardFile, &savebuffer[sbo], SectorSize, sbo); + sbo += SectorSize; + blocks -= SectorSize; + } + CARD_Close (&CardFile); + CARD_Unmount (CARDSLOT); + + /* Copy to SRAM */ + memcpy(&inzipped,&savebuffer[2112],sizeof(inzipped)); + outzipped = 0x10000; + uncompress ((char *) &sram.sram, &outzipped, (char *) &savebuffer[2112+sizeof(inzipped)], inzipped); + sram.crc = crc32 (0, &sram.sram[0], 0x10000); + system_reset (); + + /*** Inform user ***/ + sprintf (action, "Loaded %d bytes successfully", size); + WaitPrompt (action); + return 1; + } + } + else WaitPrompt ("Unable to mount memory card"); + return 0; /*** Signal failure ***/ +} + +/**************************************************************************** + * ManageSTATE + * + * Here is the main Freeze File Management stuff. + * The output file contains an icon (2K), 64 bytes comment and the STATE (~128k) + * + * direction == 0 save, 1 load. + ****************************************************************************/ +int ManageState (int direction) +{ + char filename[128]; + char action[80]; + int CardError; + unsigned int SectorSize; + int blocks; + char comment[2][32] = { {"Genesis Plus 1.2a [FRZ]"}, {"Freeze State"} }; + int outbytes; + int sbo; + int i; + int state_size = 0; + + if (!genromsize) return 0; + + if (direction) ShowAction ("Loading State ..."); + else ShowAction ("Saving State ..."); + + /* First, build a filename based on the information retrieved for this ROM */ + if (strlen (rominfo.domestic)) strcpy (filename, rominfo.domestic); + else strcpy (filename, rominfo.international); + + /* As these names tend to be bulked with spaces, let's strip them */ + /* Name should be in 16 character blocks, so take first 16 */ + filename[16] = 0; + for (i = strlen (filename) - 1; i > 0; i--) if (filename[i] != 32) break; + filename[i + 1] = 0; + + /* Now add the 16bit checksum, to ensure it's the same ROM */ + sprintf (filename, "%s%02X.gpz", filename, rominfo.checksum); + strcpy (comment[1], filename); + + /* device is SDCARD, let's go */ + if (use_SDCARD) return SD_ManageFile(filename,direction,0); + + /* device is MCARD, we continue */ + if (direction == 0) /* Saving */ + { + /* Build the output buffer */ + memcpy (&savebuffer, &icon, 2048); + memcpy (&savebuffer[2048], &comment[0], 64); + state_size = state_save(&savebuffer[2112]); + } + + outbytes = 2048 + 64 + state_size; + + /*** Initialise the CARD system ***/ + memset (&SysArea, 0, CARD_WORKAREA); + CARD_Init ("GENP", "00"); + + /*** Attempt to mount the card ***/ + CardError = MountTheCard (); + + if (CardError) + { + /*** Retrieve the sector size ***/ + CardError = CARD_GetSectorSize (CARDSLOT, &SectorSize); + + switch (direction) + { + case 0: /*** Saving ***/ + /*** Determine number of blocks on this card ***/ + blocks = (outbytes / SectorSize) * SectorSize; + if (outbytes % SectorSize) blocks += SectorSize; + + /*** Check if a previous save exists ***/ + if (CardFileExists (filename)) + { + CardError = CARD_Open (CARDSLOT, filename, &CardFile); + if (CardError) + { + sprintf (action, "Error Open : %d", CardError); + WaitPrompt (action); + CARD_Unmount (CARDSLOT); + return 0; + } + + int size = CardFile.len; + CARD_Close (&CardFile); + + if (size < blocks) + { + /* new size is bigger: check if there is enough space left */ + CardError = CARD_Create (CARDSLOT, "TEMP", blocks-size, &CardFile); + if (CardError) + { + sprintf (action, "Error Update : %d", CardError); + WaitPrompt (action); + CARD_Unmount (CARDSLOT); + return 0; + } + CARD_Close (&CardFile); + CARD_Delete(CARDSLOT, "TEMP"); + } + + /* always delete existing slot */ + CARD_Delete(CARDSLOT, filename); + } + + /*** Create a new slot ***/ + CardError = CARD_Create (CARDSLOT, filename, blocks, &CardFile); + if (CardError) + { + sprintf (action, "Error create : %d %d", CardError, CARDSLOT); + WaitPrompt (action); + CARD_Unmount (CARDSLOT); + return 0; + } + + /*** Continue and save ***/ + CARD_GetStatus (CARDSLOT, CardFile.filenum, &CardStatus); + CardStatus.icon_addr = 0x0; + CardStatus.icon_fmt = 2; + CardStatus.icon_speed = 1; + CardStatus.comment_addr = 2048; + CARD_SetStatus (CARDSLOT, CardFile.filenum, &CardStatus); + + /*** And write the blocks out ***/ + sbo = 0; + while (outbytes > 0) + { + CardError = CARD_Write (&CardFile, &savebuffer[sbo], SectorSize, sbo); + outbytes -= SectorSize; + sbo += SectorSize; + } + + CARD_Close (&CardFile); + CARD_Unmount (CARDSLOT); + sprintf (action, "Saved %d bytes successfully", blocks); + WaitPrompt (action); + return 1; + + default: /*** Loading ***/ + if (!CardFileExists (filename)) + { + WaitPrompt ("No Savestate Found"); + CARD_Unmount (CARDSLOT); + return 0; + } + + memset (&CardFile, 0, sizeof (CardFile)); + CardError = CARD_Open (CARDSLOT, filename, &CardFile); + if (CardError) + { + sprintf (action, "Error Open : %d", CardError); + WaitPrompt (action); + CARD_Unmount (CARDSLOT); + return 0; + } + + blocks = CardFile.len; + if (blocks < SectorSize) blocks = SectorSize; + if (blocks % SectorSize) blocks++; + + /*** Just read the file back in ***/ + sbo = 0; + int size = blocks; + while (blocks > 0) + { + CARD_Read (&CardFile, &savebuffer[sbo], SectorSize, sbo); + sbo += SectorSize; + blocks -= SectorSize; + } + CARD_Close (&CardFile); + CARD_Unmount (CARDSLOT); + + state_load(&savebuffer[2112]); + + /*** Inform user ***/ + sprintf (action, "Loaded %d bytes successfully", size); + WaitPrompt (action); + return 1; + } + } + else WaitPrompt ("Unable to mount memory card"); + return 0; /*** Signal failure ***/ +} diff --git a/source/ngc/gui/menu.c b/source/ngc/gui/menu.c new file mode 100644 index 0000000..c0ca9e9 --- /dev/null +++ b/source/ngc/gui/menu.c @@ -0,0 +1,623 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Nintendo Gamecube Menus + * + * Please put any user menus here! - softdev March 12 2006 + ***************************************************************************/ +#include "shared.h" +#include "dvd.h" +#include "rominfo.h" +#include "font.h" + +#define PSOSDLOADID 0x7c6000a6 + +/*************************************************************************** + * drawmenu + * + * As it says, simply draws the menu with a highlight on the currently + * selected item :) + ***************************************************************************/ +char menutitle[60] = { "" }; +int menu = 0; + +void drawmenu (char items[][20], int maxitems, int selected) +{ + int i; + int ypos; + + ypos = (310 - (fheight * maxitems)) >> 1; + ypos += 130; + + ClearScreen (); + WriteCentre (134, menutitle); + + for (i = 0; i < maxitems; i++) + { + if (i == selected) WriteCentre_HL (i * fheight + ypos, (char *) items[i]); + else WriteCentre (i * fheight + ypos, (char *) items[i]); + } + + SetScreen (); +} + +/**************************************************************************** + * domenu + * + * Returns index into menu array when A is pressed, -1 for B + ****************************************************************************/ +int domenu (char items[][20], int maxitems) +{ + int redraw = 1; + int quit = 0; + short p; + int ret = 0; + signed char a,b; + + while (quit == 0) + { + if (redraw) + { + drawmenu (&items[0], maxitems, menu); + redraw = 0; + } + + p = PAD_ButtonsDown (0); + a = PAD_StickY (0); + b = PAD_StickX (0); + + /*** Look for up ***/ + if ((p & PAD_BUTTON_UP) || (a > 70)) + { + redraw = 1; + menu--; + if (menu < 0) menu = maxitems - 1; + } + + /*** Look for down ***/ + if ((p & PAD_BUTTON_DOWN) || (a < -70)) + { + redraw = 1; + menu++; + if (menu == maxitems) menu = 0; + } + + if ((p & PAD_BUTTON_A) || (b > 40) || (p & PAD_BUTTON_RIGHT)) + { + quit = 1; + ret = menu; + } + + if ((b < -40) || (p & PAD_BUTTON_LEFT)) + { + quit = 1; + ret = 0 - 2 - menu; + } + + if (p & PAD_BUTTON_B) + { + quit = 1; + ret = -1; + } + } + + return ret; +} + +/**************************************************************************** + * Sound Option menu + * + ****************************************************************************/ +double psg_preamp = 3.0; +double fm_preamp = 1.0; +u8 boost = 1; +uint8 clipping = 2; +uint8 hq_fm = 1; +uint8 FM_GENS = 0; +uint8 PSG_MAME = 0; + +void soundmenu () +{ + int ret; + int quit = 0; + int prevmenu = menu; + int count = 7; + char items[7][20]; + + strcpy (menutitle, "Sound Options"); + + sprintf (items[0], "PSG Volume : %1.2f", psg_preamp); + sprintf (items[1], "FM Volume : %1.2f", fm_preamp); + sprintf (items[2], "Volume Boost: %dX", boost); + sprintf (items[3], "HQ YM2612: %s", hq_fm ? "Y" : "N"); + sprintf (items[4], "FM core : %s", FM_GENS ? "GENS" : "MAME"); + sprintf (items[5], "PSG core: %s", PSG_MAME ? "MAME" : "SMSP"); + + strcpy (items[6], "Return to previous"); + + menu = 0; + while (quit == 0) + { + ret = domenu (&items[0], count); + switch (ret) + { + case 0: + case -2: + if (ret<0) psg_preamp -= 0.01; + else psg_preamp += 0.01; + if (psg_preamp < 0.0) psg_preamp = 5.0; + if (psg_preamp > 5.0) psg_preamp = 0.0; + sprintf (items[0], "PSG Volume : %1.2f", psg_preamp); + break; + + case 1: + case -3: + if (ret<0) fm_preamp -= 0.01; + else fm_preamp += 0.01; + if (fm_preamp < 0.0) fm_preamp = 5.0; + if (fm_preamp > 5.0) fm_preamp = 0.0; + sprintf (items[1], "FM Volume : %1.2f", fm_preamp); + break; + + case 2: + boost ++; + if (boost > 4) boost = 0; + sprintf (items[2], "Volume Boost: %dX", boost); + break; + + case 3: + hq_fm ^= 1; + sprintf (items[3], "HQ YM2612: %s", hq_fm ? "Y" : "N"); + if (genromsize) + { audio_init(48000); + fm_restore(); + } + break; + + case 4: + FM_GENS ^= 1; + psg_preamp = PSG_MAME ? (FM_GENS ? 0.85 : 0.50) : (FM_GENS ? 4.0 : 3.0); + fm_preamp = 1.0; + sprintf (items[0], "PSG Volume : %1.2f", psg_preamp); + sprintf (items[1], "FM Volume : %1.2f", fm_preamp); + sprintf (items[4], "FM core : %s", FM_GENS ? "GENS" : "MAME"); + if (genromsize) + { + audio_init(48000); + fm_restore(); + } + break; + + case 5: + PSG_MAME ^= 1; + psg_preamp = PSG_MAME ? (FM_GENS ? 0.85 : 0.50) : (FM_GENS ? 4.0 : 3.0); + fm_preamp = 1.0; + sprintf (items[0], "PSG Volume : %1.2f", psg_preamp); + sprintf (items[1], "FM Volume : %1.2f", fm_preamp); + sprintf (items[5], "PSG core: %s", PSG_MAME ? "MAME" : "SMSP"); + if (genromsize) audio_init(48000); + break; + + case 6: + case -1: + quit = 1; + break; + } + } + menu = prevmenu; +} + +/**************************************************************************** + * Misc Option menu + * + ****************************************************************************/ +extern void reloadrom (); +extern s16 square[]; +extern int oldvwidth, oldvheight; +extern uint8 alttiming; +extern uint8 dmatiming; +extern uint8 vdptiming; + +uint8 autoload = 0; +uint8 region_detect = 0; +uint8 cpu_detect = 0; + +void miscmenu () +{ + int ret; + int quit = 0; + int prevmenu = menu; + int count = 9; + char items[9][20]; + + sprintf (items[0], "Scale X: %02d", square[3]); + sprintf (items[1], "Scale Y: %02d", square[1]); + sprintf (items[2], "Vdp Latency: %s", vdptiming ? "Y" : "N"); + sprintf (items[3], "Dma Timing : %s", dmatiming ? "Y" : "N"); + sprintf (items[4], "Alt Timing : %s", alttiming ? "Y" : "N"); + if (cpu_detect == 0) sprintf (items[5], "Cpu Mode: AUTO"); + else if (cpu_detect == 1) sprintf (items[5], "Cpu Mode: NTSC"); + else if (cpu_detect == 2) sprintf (items[5], "Cpu Mode: PAL"); + if (region_detect == 0) sprintf (items[6], "Region: AUTO"); + else if (region_detect == 1) sprintf (items[6], "Region: USA"); + else if (region_detect == 2) sprintf (items[6], "Region: EUR"); + else if (region_detect == 3) sprintf (items[6], "Region: JAP-NTSC"); + else if (region_detect == 4) sprintf (items[6], "Region: JAP-PAL"); + sprintf (items[7], "SRAM autoload: %s", autoload ? "Y" : "N"); + strcpy (items[8], "Return to previous"); + + menu = 0; + while (quit == 0) + { + strcpy (menutitle, ""); + ret = domenu (&items[0], count); + switch (ret) + { + case 0: /*** Scale X ***/ + case -2: + if (ret<0) square[3] -= 2; + else square[3] += 2; + if (square[3] < 40) square[3] = 80; + if (square[3] > 80) square[3] = 40; + square[6] = square[3]; + square[0] = square[9] = -square[3]; + oldvwidth = -1; + sprintf (items[0], "Scale X: %02d", square[3]); + break; + + case 1: /*** Scale Y ***/ + case -3: + if (ret<0) square[1] -= 2; + else square[1] += 2; + if (square[1] < 30) square[1] = 60; + if (square[1] > 60) square[1] = 30; + square[4] = square[1]; + square[7] = square[10] = -square[1]; + oldvheight = -1; + sprintf (items[1], "Scale Y: %02d", square[1]); + break; + + case 2: /*** VDP access latency ***/ + vdptiming ^= 1; + sprintf (items[2], "Vdp Latency: %s", vdptiming ? "Y" : "N"); + break; + + case 3: /*** DMA timing fix ***/ + dmatiming ^= 1; + sprintf (items[3], "Dma Timing : %s", dmatiming ? "Y" : "N"); + break; + + case 4: /*** Alternate rendering timing ***/ + alttiming ^= 1; + sprintf (items[4], "Alt Timing : %s", alttiming ? "Y" : "N"); + break; + + case 5: /*** Cpu mode : PAL (50hz) or NTSC (60Hz) ***/ + cpu_detect ++; + if (cpu_detect > 2) cpu_detect = 0; + if (cpu_detect == 0) sprintf (items[5], "Cpu Mode: AUTO"); + else if (cpu_detect == 1) sprintf (items[5], "Cpu Mode: NTSC"); + else if (cpu_detect == 2) sprintf (items[5], "Cpu Mode: PAL"); + if (genromsize) reloadrom(); + break; + + case 6: /* region detection */ + region_detect ++; + if (region_detect > 4) region_detect = 0; + if (region_detect == 0) sprintf (items[6], "Region: AUTO"); + else if (region_detect == 1) sprintf (items[6], "Region: USA"); + else if (region_detect == 2) sprintf (items[6], "Region: EUR"); + else if (region_detect == 3) sprintf (items[6], "Region: JAP-NTSC"); + else if (region_detect == 4) sprintf (items[6], "Region: JAP-PAL"); + if (genromsize) reloadrom(); + break; + + case 7: /*** VDP access latency ***/ + autoload ^= 1; + sprintf (items[7], "SRAM autoload: %s", autoload ? "Y" : "N"); + break; + + case 8: + case -1: + quit = 1; + break; + } + } + menu = prevmenu; +} + +/**************************************************************************** + * Main Option menu + * + ****************************************************************************/ +extern void ConfigureJoypads(); +extern void GetGGEntries(); + +void optionmenu () +{ + int ret; + int quit = 0; + int prevmenu = menu; + int count = 5; + char items[5][20] = { + "Misc. Options", + "Sound Options", + "Configure Joypads", + "Game Genie Codes", + "Return to previous" + }; + + menu = 0; + while (quit == 0) + { + strcpy (menutitle, ""); + ret = domenu (&items[0], count); + switch (ret) + { + case 0: + miscmenu(); + break; + case 1: + soundmenu(); + break; + case 2: + ConfigureJoypads(); + break; + case 3: + GetGGEntries(); + break; + case 4: + case -1: + quit = 1; + break; + } + } + menu = prevmenu; +} + +/**************************************************************************** +* Generic Load/Save menu +* +****************************************************************************/ +int CARDSLOT = CARD_SLOTB; +int use_SDCARD = 0; +extern int ManageSRAM (int direction); +extern int ManageState (int direction); + +int loadsavemenu (int which) +{ + int prevmenu = menu; + int quit = 0; + int ret; + int count = 5; + char items[5][20]; + + strcpy (menutitle, ""); + + if (use_SDCARD) sprintf(items[0], "Device: SDCARD"); + else sprintf(items[0], "Device: MCARD"); + + if (CARDSLOT == CARD_SLOTA) sprintf(items[1], "Use: SLOT A"); + else sprintf(items[1], "Use: SLOT B"); + + if (which) + { + sprintf(items[2], "Save State"); + sprintf(items[3], "Load State"); + } + else + { + sprintf(items[2], "Save SRAM"); + sprintf(items[3], "Load SRAM"); + } + sprintf(items[4], "Return to previous"); + + menu = 2; + + while (quit == 0) + { + ret = domenu (&items[0], count); + switch (ret) + { + case -1: + case 4: + quit = 1; + break; + + case 0: + use_SDCARD ^= 1; + if (use_SDCARD) sprintf(items[0], "Device: SDCARD"); + else sprintf(items[0], "Device: MCARD"); + break; + case 1: + CARDSLOT ^= 1; + if (CARDSLOT == CARD_SLOTA) sprintf(items[1], "Use: SLOT A"); + else sprintf(items[1], "Use: SLOT B"); + break; + case 2: + case 3: + if (which) quit = ManageState(ret-2); + else quit = ManageSRAM(ret-2); + if (quit) return 1; + break; + } + } + + menu = prevmenu; + return 0; +} + + +/**************************************************************************** + * File Manager menu + * + ****************************************************************************/ +int filemenu () +{ + int prevmenu = menu; + int ret; + int quit = 0; + uint32 crccheck; + int count = 3; + char items[3][20] = { + {"SRAM Manager"}, + {"STATE Manager"}, + {"Return to previous"} + }; + + crccheck = crc32 (0, &sram.sram[0], 0x10000); + if (genromsize && (crccheck != sram.crc)) strcpy (menutitle, "*** SRAM has been modified ***"); + else strcpy (menutitle, ""); + + menu = 0; + + while (quit == 0) + { + ret = domenu (&items[0], count); + switch (ret) + { + case -1: /*** Button B ***/ + case 2: /*** Quit ***/ + ret = 0; + quit = 1; + break; + case 0: /*** SRAM Manager ***/ + case 1: /*** SaveState Manager ***/ + if (loadsavemenu(ret)) return 1; + break; + } + } + + menu = prevmenu; + return 0; +} + +/**************************************************************************** + * Load Rom menu + * + ****************************************************************************/ +extern void OpenDVD (); +extern int OpenSD (); +extern u8 UseSDCARD; + +void loadmenu () +{ + int prevmenu = menu; + int ret; + int quit = 0; + int count = 3; + char item[3][20] = { + {"Load from DVD"}, + {"Load from SDCARD"}, + {"Return to previous"} + }; + + menu = UseSDCARD ? 1 : 0; + + while (quit == 0) + { + strcpy (menutitle, ""); + ret = domenu (&item[0], count); + switch (ret) + { + case -1: /*** Button B ***/ + case 2: /*** Quit ***/ + quit = 1; + menu = prevmenu; + break; + case 0: /*** Load from DVD ***/ + OpenDVD (); + quit = 1; + break; + case 1: /*** Load from SCDARD ***/ + OpenSD (); + quit = 1; + break; + } + } +} + +/**************************************************************************** + * Main menu + * + ****************************************************************************/ + +void MainMenu () +{ + menu = 0; + int ret; + int quit = 0; + int *psoid = (int *) 0x80001800; + void (*PSOReload) () = (void (*)()) 0x80001800; /*** Stock PSO/SD Reload call ***/ + int count = 8; + char items[8][20] = { + {"Play Game"}, + {"Game Infos"}, + {"Reset Game"}, + {"Load New Game"}, + {"File Management"}, + {"Emulator Options"}, + {"Stop DVD Motor"}, + {"System Reboot"} + }; + + while (quit == 0) + { + strcpy (menutitle, ""); + ret = domenu (&items[0], count); + switch (ret) + { + case -1: /*** Button B ***/ + case 0: /*** Play Game ***/ + quit = 1; + break; + case 1: /*** ROM Information ***/ + showrominfo (); + break; + case 2: /*** Emulator Reset ***/ + system_reset (); + quit = 1; + break; + case 3: /*** Load ROM Menu ***/ + loadmenu(); + menu = 0; + break; + case 4: /*** Memory Manager ***/ + quit = filemenu (); + break; + case 5: /*** Emulator Options */ + optionmenu (); + break; + case 6: /*** Stop DVD Motor ***/ + ShowAction("Stopping DVD Motor ..."); + dvd_motor_off(); + break; + case 7: /*** SD/PSO Reload ***/ + if (psoid[0] == PSOSDLOADID) PSOReload (); + else SYS_ResetSystem(SYS_HOTRESET,0,FALSE); + break; + } + } + + /*** Remove any still held buttons ***/ + while(PAD_ButtonsHeld(0)) VIDEO_WaitVSync(); + + /*** Stop the DVD from causing clicks while playing ***/ + uselessinquiry (); +} diff --git a/source/ngc/gui/rominfo.c b/source/ngc/gui/rominfo.c new file mode 100644 index 0000000..a2bb6e2 --- /dev/null +++ b/source/ngc/gui/rominfo.c @@ -0,0 +1,403 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Information in this module was gleaned from + * http://en.wikibooks.org/wiki/Genesis_Programming + ***************************************************************************/ + +#include "shared.h" +#include "font.h" +#include "rominfo.h" + +#define MAXCOMPANY 64 + +/*** ROM Information ***/ +#define ROMCONSOLE 256 +#define ROMCOPYRIGHT 272 +#define ROMDOMESTIC 288 +#define ROMWORLD 336 +#define ROMTYPE0 384 +#define ROMTYPE1 385 +#define ROMPRODUCT 386 +#define ROMCHECKSUM 398 +#define ROMIOSUPPORT 400 +#define ROMROMSTART 416 +#define ROMROMEND 420 +#define ROMRAMINFO 424 +#define ROMRAMSTART 436 +#define ROMRAMEND 440 +#define ROMMODEMINFO 444 +#define ROMMEMO 456 +#define ROMCOUNTRY 496 + +#define P3BUTTONS 1 +#define P6BUTTONS 2 +#define PKEYBOARD 4 +#define PPRINTER 8 +#define PBALL 16 +#define PFLOPPY 32 +#define PACTIVATOR 64 +#define PTEAMPLAYER 128 +#define PMSYSTEMPAD 256 +#define PSERIAL 512 +#define PTABLET 1024 +#define PPADDLE 2048 +#define PCDROM 4096 +#define PMOUSE 8192 + +typedef struct +{ + char companyid[6]; + char company[30]; +} COMPANYINFO; + +typedef struct +{ + char pID[2]; + char pName[21]; +} PERIPHERALINFO; + +int peripherals; +int checksumok; +ROMINFO rominfo; +uint16 GetRealChecksum (); + + /*************************************************************************** + * Genesis ROM Manufacturers + * + * Based on the document provided at + * http://www.zophar.net/tech/files/Genesis_ROM_Format.txt + ***************************************************************************/ +COMPANYINFO companyinfo[MAXCOMPANY] = { + {"ACLD", "Ballistic"}, + {"RSI", "Razorsoft"}, + {"SEGA", "SEGA"}, + {"TREC", "Treco"}, + {"VRGN", "Virgin Games"}, + {"WSTN", "Westone"}, + {"10", "Takara"}, + {"11", "Taito or Accolade"}, + {"12", "Capcom"}, + {"13", "Data East"}, + {"14", "Namco or Tengen"}, + {"15", "Sunsoft"}, + {"16", "Bandai"}, + {"17", "Dempa"}, + {"18", "Technosoft"}, + {"19", "Technosoft"}, + {"20", "Asmik"}, + {"22", "Micronet"}, + {"23", "Vic Tokai"}, + {"24", "American Sammy"}, + {"29", "Kyugo"}, + {"32", "Wolfteam"}, + {"33", "Kaneko"}, + {"35", "Toaplan"}, + {"36", "Tecmo"}, + {"40", "Toaplan"}, + {"42", "UFL Company Limited"}, + {"43", "Human"}, + {"45", "Game Arts"}, + {"47", "Sage's Creation"}, + {"48", "Tengen"}, + {"49", "Renovation or Telenet"}, + {"50", "Electronic Arts"}, + {"56", "Razorsoft"}, + {"58", "Mentrix"}, + {"60", "Victor Musical Industries"}, + {"69", "Arena"}, + {"70", "Virgin"}, + {"73", "Soft Vision"}, + {"74", "Palsoft"}, + {"76", "Koei"}, + {"79", "U.S. Gold"}, + {"81", "Acclaim/Flying Edge"}, + {"83", "Gametek"}, + {"86", "Absolute"}, + {"87", "Mindscape"}, + {"93", "Sony"}, + {"95", "Konami"}, + {"97", "Tradewest"}, + {"100", "T*HQ Software"}, + {"101", "Tecmagik"}, + {"112", "Designer Software"}, + {"113", "Psygnosis"}, + {"119", "Accolade"}, + {"120", "Code Masters"}, + {"125", "Interplay"}, + {"130", "Activision"}, + {"132", "Shiny & Playmates"}, + {"144", "Atlus"}, + {"151", "Infogrames"}, + {"161", "Fox Interactive"}, + {"177", "Ubisoft"}, + {"239", "Disney Interactive"}, + {"---", "Unknown"} +}; + + /*************************************************************************** + * Genesis Peripheral Information + * + * Based on the document provided at + * http://www.zophar.net/tech/files/Genesis_ROM_Format.txt + ***************************************************************************/ +PERIPHERALINFO peripheralinfo[14] = { + {"J", "3-Button Joypad"}, + {"6", "6-button Joypad"}, + {"K", "Keyboard"}, + {"P", "Printer"}, + {"B", "Control Ball"}, + {"F", "Floppy Drive"}, + {"L", "Activator"}, + {"4", "Team Player"}, + {"0", "MS Joypad"}, + {"R", "RS232C Serial"}, + {"T", "Tablet"}, + {"V", "Paddle"}, + {"C", "CD-ROM"}, + {"M", "Mega Mouse"} +}; + +/**************************************************************************** + * getcompany + * + * Try to determine which company made this rom + * + * Ok, for some reason there's no standard for this. + * It seems that there can be pretty much anything you like following the + * copyright (C) symbol! + ****************************************************************************/ +int getcompany () +{ + char *s; + int i; + char company[10]; + + for (i = 3; i < 8; i++) company[i - 3] = rominfo.copyright[i]; + company[5] = 0; + + /** OK, first look for a hyphen + * Capcom use T-12 for example + */ + s = strstr (company, "-"); + if (s != NULL) + { + s++; + strcpy (company, s); + } + + /** Strip any trailing spaces **/ + for (i = strlen (company) - 1; i >= 0; i--) + if (company[i] == 32) company[i] = 0; + + if (strlen (company) == 0) return MAXCOMPANY - 1; + + for (i = 0; i < MAXCOMPANY - 1; i++) + { + if (!(strncmp (company, companyinfo[i].companyid, strlen (company)))) return i; + } + + return MAXCOMPANY - 1; +} + + + /*************************************************************************** + * getrominfo + * + * Pass a pointer to the ROM base address. + ***************************************************************************/ +void getrominfo (char *romheader) +{ + int i; + + memset (&rominfo, 0, sizeof (ROMINFO)); + + memcpy (&rominfo.consoletype, romheader + ROMCONSOLE, 16); + memcpy (&rominfo.copyright, romheader + ROMCOPYRIGHT, 16); + memcpy (&rominfo.domestic, romheader + ROMDOMESTIC, 48); + memcpy (&rominfo.international, romheader + ROMWORLD, 48); + memcpy (&rominfo.ROMType, romheader + ROMTYPE0, 2); + memcpy (&rominfo.product, romheader + ROMPRODUCT, 12); + memcpy (&rominfo.checksum, romheader + ROMCHECKSUM, 2); + memcpy (&rominfo.io_support, romheader + ROMIOSUPPORT, 16); + memcpy (&rominfo.romstart, romheader + ROMROMSTART, 4); + memcpy (&rominfo.romend, romheader + ROMROMEND, 4); + memcpy (&rominfo.RAMInfo, romheader + ROMRAMINFO, 12); + memcpy (&rominfo.ramstart, romheader + ROMRAMSTART, 4); + memcpy (&rominfo.ramend, romheader + ROMRAMEND, 4); + memcpy (&rominfo.modem, romheader + ROMMODEMINFO, 12); + memcpy (&rominfo.memo, romheader + ROMMEMO, 40); + memcpy (&rominfo.country, romheader + ROMCOUNTRY, 16); + + checksumok = (GetRealChecksum ((char *) cart_rom + 512, genromsize - 512) + == rominfo.checksum); + + peripherals = 0; + + for (i = 0; i < 14; i++) + { + if (rominfo.io_support[i] == peripheralinfo[i].pID[0]) peripherals |= (1 << i); + } + + if (peripherals & P6BUTTONS) pad_type = DEVICE_6BUTTON; + else pad_type = DEVICE_3BUTTON; + +} + +/*************************************************************************** + * Show rom info screen + ***************************************************************************/ + /* Automatically fixing the checksum is not a cool idea + * This should be user switchable, or at least only applied + * when genromsize == ( romend - romstart ) + if(realchecksum != (rominfo.checksum)) + { + sprintf(msg, "WARNING: Possible hacked ROM loaded!"); + write_font( 10, 224, msg); + cart_rom[0x18e] = realchecksum >> 8; + cart_rom[0x18f] = realchecksum & 0xff; + sprintf(msg, "Checksum corrected to %04x", realchecksum); + write_font( 10, 248, msg); + } + */ +void showrominfo () +{ + int ypos; + u8 i,j,quit,redraw,max; + char msg[128]; + short p; + signed char a; + uint16 realchecksum = GetRealChecksum (((uint8 *) cart_rom) + 0x200, genromsize - 0x200); + + quit = 0; + j = 0; + redraw = 1; + + /*** Remove any still held buttons ***/ + while(PAD_ButtonsHeld(0)) VIDEO_WaitVSync(); + + max = 14; + for (i = 0; i < 14; i++) + { + if ((char) rominfo.io_support[i] == peripheralinfo[i].pID[0]) max ++; + } + + + while (quit == 0) + { + if (redraw) + { + ClearScreen (); + + ypos = 134; + WriteCentre(ypos, "ROM Header Information"); + ypos += 2*fheight; + + for (i=0; i<8; i++) + { + switch (i+j) + { + case 0: + sprintf (msg, "Console type: %s", rominfo.consoletype); + break; + case 1: + sprintf (msg, "Copyright: %s", rominfo.copyright); + break; + case 2: + sprintf (msg, "Company: %s", companyinfo[getcompany ()].company); + break; + case 3: + sprintf (msg, "Game Domestic Name:"); + break; + case 4: + sprintf(msg, " %s",rominfo.domestic); + break; + case 5: + sprintf (msg, "Game International Name:"); + break; + case 6: + sprintf(msg, " %s",rominfo.international); + break; + case 7: + sprintf (msg, "Type - %s : %s", rominfo.ROMType, strcmp (rominfo.ROMType, "AI") ? "Game" : "Educational"); + break; + case 8: + sprintf (msg, "Product - %s", rominfo.product); + break; + case 9: + sprintf (msg, "Checksum - %04x (%04x) (%s)", rominfo.checksum, realchecksum, rominfo.checksum == realchecksum ? "Good" : "Bad"); + break; + case 10: + sprintf (msg, "ROM end: 0x%06X", rominfo.romend); + break; + case 11: + if (sram.detected) sprintf (msg, "External RAM start: 0x%06X", rominfo.ramstart); + else sprintf (msg, "External RAM start: UNDETECTED"); + break; + case 12: + if (sram.detected) sprintf (msg, "External RAM end : 0x%06X", rominfo.ramend); + else sprintf (msg, "External RAM end : UNDETECTED"); + break; + case 13: + if (region_code == REGION_USA) sprintf (msg, "Region - %s (USA)", rominfo.country); + else if (region_code == REGION_EUROPE) sprintf (msg, "Region - %s (EUR)", rominfo.country); + else if (region_code == REGION_JAPAN_NTSC) sprintf (msg, "Region - %s (JAP)", rominfo.country); + else if (region_code == REGION_JAPAN_PAL) sprintf (msg, "Region - %s (JPAL)", rominfo.country); + break; + default: + sprintf (msg, "Supports - %s", peripheralinfo[i+j-14].pName); + break; + } + + write_font (100, ypos, msg); + ypos += fheight; + } + + ypos += fheight; + WriteCentre (ypos, "Press A to Continue"); + SetScreen (); + } + + p = PAD_ButtonsDown (0); + a = PAD_StickY (0); + redraw = 0; + + if ((j<(max-8)) && ((p & PAD_BUTTON_DOWN) || (a < -70))) {redraw = 1; j++;} + if ((j>0) && ((p & PAD_BUTTON_UP) || (a > 70))) {redraw = 1; j--;} + if (p & PAD_BUTTON_A) quit = 1; + if (p & PAD_BUTTON_B) quit = 1; + } +} + +/* + * softdev - New Checksum Calculation + */ +uint16 GetRealChecksum (uint8 * rom, int length) +{ + int i; + uint16 checksum = 0; + + for (i = 0; i < length; i += 2) + { + checksum += (uint16) rom[i]; + checksum += (uint16) rom[i + 1] << 8; + } + + return checksum; +} diff --git a/source/ngc/gui/rominfo.h b/source/ngc/gui/rominfo.h new file mode 100644 index 0000000..2d92275 --- /dev/null +++ b/source/ngc/gui/rominfo.h @@ -0,0 +1,49 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Information in this module was gleaned from + * http://en.wikibooks.org/wiki/Genesis_Programming + ***************************************************************************/ +#include "shared.h" + + +typedef struct +{ + char consoletype[18]; /* Genesis or Mega Drive */ + char copyright[18]; /* Copyright message */ + char domestic[50]; /* Domestic name of ROM */ + char international[50]; /* International name of ROM */ + char ROMType[4]; + char product[14]; /* Product type and serial number */ + unsigned short checksum; /* Checksum */ + char io_support[18]; /* Actually 16 chars :) */ + unsigned int romstart; + unsigned int romend; + char RAMInfo[14]; + unsigned int ramstart; + unsigned int ramend; + char modem[14]; + char memo[50]; + char country[18]; +} ROMINFO; + + +extern void getrominfo (char *romheader); +extern void showrominfo (); +extern ROMINFO rominfo; diff --git a/source/ngc/gui/saveicon.h b/source/ngc/gui/saveicon.h new file mode 100644 index 0000000..edf898d --- /dev/null +++ b/source/ngc/gui/saveicon.h @@ -0,0 +1,136 @@ +/*********************************************************** + * Genesis Plus Save Icon + * Made by Brakken (http://www.tehskeen.com) + * + ************************************************************/ +unsigned short icon[1024] = { + + 0xFFFF, 0xFFFF, 0xFBDE, 0xFBDE, 0xFBDE, 0xFBDE, 0xFBDE, 0xEB5A, + 0xFBDE, 0xFBDE, 0xFBDE, 0xBDCD, 0xFBDE, 0xF7BD, 0xF7BD, 0xAD49, + 0xEB59, 0xB9AD, 0xC1EF, 0xC1EF, 0x9062, 0x8000, 0x8C41, 0x8C41, + 0x8000, 0x9CE6, 0xA0E6, 0xA507, 0x8400, 0x9CC5, 0xA0E6, 0xA0E6, + 0xC1EF, 0xC1EF, 0xC1EF, 0xC1EF, 0x8000, 0x8000, 0x8000, 0x8000, + 0x9083, 0x8C63, 0x8C63, 0x9484, 0x8C63, 0x9083, 0x9484, 0x94A4, + 0xC1EF, 0xC20F, 0xC20F, 0xBDCE, 0x8000, 0x8000, 0x8000, 0x8000, + 0x9083, 0x8821, 0x8842, 0x8842, 0x8842, 0xA107, 0xB58C, 0xAD6B, + 0xA529, 0x94A4, 0x9083, 0x94A4, 0x8000, 0x8000, 0x8400, 0x8400, + 0x8842, 0x8842, 0x8842, 0x8821, 0xB18B, 0xA949, 0xA108, 0xA107, + 0xA528, 0xB9AD, 0xC630, 0xCE51, 0x8000, 0x8000, 0x8000, 0x8000, + 0x8821, 0x8821, 0x8821, 0x8400, 0xA108, 0xA529, 0xA108, 0xA529, + 0xCA30, 0xC630, 0xCA30, 0xFBDE, 0x8000, 0x8000, 0x8000, 0xAD27, + 0x8400, 0x9083, 0x8863, 0x8400, 0x9CE6, 0x8842, 0x8C63, 0x8C20, + 0xFBDE, 0xFBDE, 0xFFFF, 0xFFFF, 0xFBDE, 0xFBDE, 0xFBDE, 0xFBDE, + 0xDA92, 0xFBDE, 0xFBDE, 0xFBDE, 0xC1AB, 0xF7BD, 0xFBDE, 0xFBDE, + 0xF7BD, 0xF7BD, 0xF7BD, 0xA0E6, 0xF7BD, 0xF7BD, 0xF39C, 0x9484, + 0xF39C, 0xF39C, 0xDEF7, 0x8C41, 0xF39C, 0xEF7B, 0xD272, 0x8400, + 0x8C42, 0x9CE6, 0xA507, 0xA0E6, 0x8C63, 0x9CC5, 0xA107, 0x9CE6, + 0x9484, 0x98A5, 0x9CE6, 0x98C5, 0x9CC5, 0x98C5, 0xA0E7, 0x98C5, + 0x8C42, 0x9083, 0x94A5, 0x9083, 0x8C42, 0x9083, 0x9084, 0x8C62, + 0x8C62, 0x9083, 0x9084, 0x8C62, 0x8C63, 0x9083, 0x94A4, 0x8C63, + 0x8842, 0x9CC6, 0xA107, 0xA0E7, 0x8842, 0x8842, 0xA108, 0xA54A, + 0x8842, 0x8C63, 0xB5AD, 0xB5AD, 0x8C63, 0x8C62, 0x8842, 0x8C63, + 0x98C5, 0xA528, 0xB5AC, 0xB5AC, 0xA52A, 0xBDEF, 0xC631, 0xCA52, + 0xB9CE, 0xB9CE, 0xA94A, 0xAD6B, 0x8C63, 0x8821, 0x8821, 0x8821, + 0xA529, 0x98C5, 0x98C5, 0xA0E6, 0xC210, 0xA529, 0xA529, 0xA529, + 0xB5AD, 0xB5CD, 0xB5AD, 0xBDEF, 0x8400, 0x8821, 0x8C62, 0x8821, + 0xA0E7, 0x8842, 0x8842, 0x8C41, 0x9083, 0x8842, 0x8842, 0x8842, + 0x94A5, 0x8842, 0x8C62, 0x8C62, 0x8C42, 0x9083, 0x8C62, 0x8C62, + 0xB548, 0xF7BD, 0xF7BD, 0xF7BD, 0xA4C4, 0xF7BD, 0xF7BD, 0xF7BD, + 0x9461, 0xDED5, 0xF39C, 0xF39C, 0x8C20, 0xD271, 0xF39C, 0xF39C, + 0xEF7B, 0xEF7B, 0xC610, 0x8400, 0xEF7B, 0xEB5A, 0xB9AC, 0x8000, + 0xEB5A, 0xEB5A, 0xA528, 0x9CC5, 0xE739, 0xE739, 0x9CC6, 0x98A5, + 0x98C5, 0x98C5, 0xA0E6, 0x94A4, 0x94A4, 0x98C5, 0x94A5, 0x9484, + 0xA528, 0x98C5, 0x9CE6, 0xA0E7, 0x9CE6, 0xA4E6, 0x98A4, 0xA507, + 0x8C62, 0x9083, 0x9484, 0x9083, 0x94A4, 0x94A5, 0x98C5, 0x98C5, + 0xA107, 0xA107, 0xA107, 0xB18B, 0xA907, 0x9062, 0x9484, 0x9CE6, + 0x8842, 0x94A4, 0x9484, 0x9084, 0x8C62, 0x8C63, 0x9CC5, 0x9CC5, + 0x98C6, 0x8C63, 0x9484, 0xA0E6, 0x9CE6, 0x9084, 0x94A4, 0x90A5, + 0x8C63, 0x8C42, 0x8C62, 0x8C62, 0x8C63, 0xA108, 0xA94A, 0xA528, + 0x94A5, 0x8884, 0x8884, 0x8884, 0xB0A5, 0xBC84, 0xA483, 0xA484, + 0x8C63, 0x8C42, 0x8C63, 0x9083, 0xA94A, 0x9083, 0x8C62, 0x94A4, + 0x8884, 0x8063, 0x90A5, 0x94A4, 0xA483, 0xBC63, 0xA884, 0x8884, + 0x9083, 0x8C63, 0x8C42, 0x8C63, 0x9084, 0x8842, 0x9083, 0x9084, + 0x8C42, 0x8C62, 0x98C6, 0xAD6A, 0x9083, 0x8C63, 0x98C5, 0xA107, + 0x8400, 0xC1ED, 0xEF7B, 0xEF7B, 0x8400, 0xAD27, 0xEF7B, 0xEF7B, + 0x9CE6, 0x9CA4, 0xEB5A, 0xEB5A, 0x9CE6, 0x9062, 0xDAB4, 0xE739, + 0xE739, 0xE318, 0x9483, 0x8C63, 0xE318, 0xCE72, 0x9062, 0x9CC5, + 0xDEF7, 0xC20F, 0x8C41, 0x9CE6, 0xDAD6, 0xB9AC, 0x8C20, 0x9CC5, + 0xA0E6, 0xA528, 0x9CC5, 0xA528, 0xA508, 0x94A5, 0x98C6, 0xA108, + 0x9CE6, 0x9CC5, 0xA0E7, 0xA94A, 0xA0E6, 0xA0E7, 0xA507, 0xAD6B, + 0xA107, 0x98C6, 0x9CE6, 0x9083, 0x98C6, 0xA108, 0xA107, 0x98C5, + 0xB9CD, 0xB18B, 0xA107, 0x9CC6, 0xC210, 0xB9CE, 0xA528, 0x9CC6, + 0x98C5, 0x94A5, 0x9084, 0x8884, 0x9CC6, 0x9CE6, 0x9CC6, 0x94A5, + 0x9CE6, 0x9CE6, 0x9CE7, 0xA108, 0x98C5, 0x98C5, 0x98C6, 0x98C6, + 0xB0C6, 0xD0C6, 0xD0C6, 0xD0C6, 0x90A4, 0x90A4, 0x98A5, 0x9CA4, + 0x9CE6, 0x90A4, 0x9084, 0x9084, 0x98C6, 0x98C6, 0x98C6, 0x98C6, + 0xD0A5, 0xD0A5, 0xA484, 0x8483, 0x9484, 0x9083, 0x8C83, 0x9084, + 0x90A5, 0x94A5, 0x9CE6, 0x9CE6, 0x98C6, 0x98C6, 0x9CE6, 0x98C6, + 0x8C63, 0x9084, 0x9484, 0x9083, 0x98C5, 0x98C5, 0x94A4, 0x94A5, + 0x98C6, 0x98C6, 0x98C5, 0x98C5, 0x98C6, 0x98C6, 0x98C6, 0x98C6, + 0x9084, 0x8821, 0xCE51, 0xE739, 0x94A5, 0x8C20, 0xBDCE, 0xE318, + 0x98C5, 0x8821, 0xB18B, 0xE318, 0x98C6, 0x8842, 0xAD49, 0xDEF7, + 0xDAD6, 0xAD49, 0x8C41, 0xA508, 0xD6B5, 0xBDCC, 0x8C20, 0x8C41, + 0xD6B5, 0xD294, 0xB98A, 0xAD06, 0xD294, 0xCE73, 0xCE73, 0xCA52, + 0xA94A, 0xB5AD, 0xB18C, 0xAD6B, 0x9062, 0x9062, 0x9062, 0x9062, + 0xAD27, 0xAD06, 0xAD06, 0xAD06, 0xCA52, 0xC631, 0xC631, 0xC210, + 0xA94B, 0xB18C, 0xB58D, 0xAD6B, 0x9062, 0x9484, 0x98A4, 0x98A4, + 0xA906, 0xA906, 0xA506, 0xA907, 0xC210, 0xC210, 0xB9F0, 0xBDEF, + 0xA94B, 0xA94B, 0xA94B, 0xA94B, 0x98A5, 0x98A5, 0x98A4, 0x98A4, + 0xA907, 0xA907, 0xA907, 0xA506, 0xBDEF, 0xBDEF, 0xBDEF, 0xB1F2, + 0xA94B, 0xA94A, 0xA54A, 0xA529, 0x9484, 0x9484, 0x9483, 0x9483, + 0xA4E6, 0xA4E6, 0xA4E6, 0xA4E6, 0xBDEF, 0xBDEF, 0xBDEF, 0xBDEF, + 0xA529, 0xA529, 0xA529, 0xA108, 0x9062, 0x8C63, 0x9062, 0x9062, + 0xA4E6, 0x9CE6, 0xA0E6, 0xA506, 0xBDEF, 0xC210, 0xC210, 0xC210, + 0xA108, 0x9CE7, 0x9CE7, 0x98C6, 0x8C41, 0x8C42, 0x8C41, 0x8C41, + 0xA507, 0xA508, 0xAD27, 0xB127, 0xC631, 0xC631, 0xCA52, 0xCA52, + 0x98C6, 0x8C63, 0xA0E6, 0xDAD6, 0x8C41, 0x8400, 0xB548, 0xDAD6, + 0xB127, 0xB548, 0xD6B5, 0xD6B5, 0xCE73, 0xCE73, 0xD294, 0xD6B5, + 0xD294, 0xCA74, 0xBA56, 0xB635, 0x9A3B, 0x81FF, 0x81FF, 0x81FF, + 0x81FF, 0x8A1F, 0xA27F, 0xA27F, 0x81FF, 0xA27F, 0xFFFF, 0xFFFF, + 0xB635, 0xB214, 0xB214, 0xBE11, 0x81FF, 0x81FF, 0x81FF, 0x81FF, + 0xA27F, 0xA27F, 0xA27F, 0x8A1F, 0xFFFF, 0xFFFF, 0xFFFF, 0xDF7F, + 0xA1F7, 0x91FA, 0x81FF, 0x95F9, 0x81FF, 0x81FF, 0x8A1F, 0x81FF, + 0x81FF, 0xD75F, 0xBEFF, 0x81FF, 0x81FF, 0xFFFF, 0xBEFF, 0x81FF, + 0xB9CE, 0xB9CE, 0x8DFC, 0x81FF, 0xA9D2, 0xA9D2, 0x81FF, 0x9A5F, + 0x99D6, 0x99D6, 0x81FF, 0xBEFF, 0x99D6, 0x99D6, 0x81FF, 0xBEFF, + 0x85FD, 0x95F9, 0xB5CF, 0xB1F1, 0x81FF, 0x81FF, 0x95F9, 0x81FF, + 0xEFBF, 0x81FF, 0x85FD, 0x81FF, 0xFFFF, 0x81FF, 0x81FF, 0x81FF, + 0xA5F5, 0xA5F5, 0xB5F2, 0xB214, 0x81FF, 0x81FF, 0x81FF, 0x81FF, + 0xB2BF, 0xB2BF, 0x81FF, 0x9A5F, 0xDF7F, 0xDF7F, 0x81FF, 0xE79F, + 0xA218, 0xA218, 0xA218, 0xA639, 0x81FF, 0x81FF, 0x81FF, 0x81FF, + 0xBEFF, 0xBEFF, 0xBEFF, 0xBEFF, 0xF7DF, 0xDF7F, 0xDF7F, 0xDF7F, + 0xA639, 0xB657, 0xCA75, 0xD294, 0x81FF, 0x81FF, 0x861E, 0xCA95, + 0xBEFF, 0xAA9F, 0x81FF, 0xB658, 0xD75F, 0x8A1F, 0x81FF, 0xCA75, + 0x81FF, 0xA27F, 0xFFFF, 0xA27F, 0x81FF, 0xA27F, 0xFFFF, 0xFFFF, + 0x81FF, 0xA27F, 0xFFFF, 0xBADF, 0x81FF, 0xA27F, 0xFFFF, 0xA27F, + 0x81FF, 0x81FF, 0xCF3F, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xBADF, + 0xA27F, 0xA27F, 0xA27F, 0x81FF, 0x81FF, 0x81FF, 0x81FF, 0x81FF, + 0x923F, 0xFFFF, 0xBEFF, 0x81FF, 0x81FF, 0xFFFF, 0xBEFF, 0x81FF, + 0x81FF, 0xFFFF, 0xCF3F, 0xA27F, 0x81FF, 0xFFFF, 0xFFFF, 0xFFFF, + 0x99D6, 0x99D6, 0x81FF, 0xBEFF, 0x81FF, 0x81FF, 0x81FF, 0xBEFF, + 0xA27F, 0xA27F, 0x9A5F, 0xBADF, 0xFFFF, 0xFFFF, 0xA27F, 0x81FF, + 0xFFFF, 0x81FF, 0x81FF, 0x81FF, 0xFFFF, 0x81FF, 0x81FF, 0x81FF, + 0xFFFF, 0xBEFF, 0xBEFF, 0xBEFF, 0xC71F, 0xDF7F, 0xDF7F, 0xDF7F, + 0xDF7F, 0xDF7F, 0x923F, 0xF7DF, 0xDF7F, 0xDF7F, 0x81FF, 0xAA9F, + 0xEFBF, 0xC71F, 0x81FF, 0x9A5F, 0xCF3F, 0x81FF, 0x8A1F, 0xD75F, + 0xE79F, 0xBEFF, 0xBEFF, 0xBEFF, 0xDF7F, 0xDF7F, 0xDF7F, 0xDF7F, + 0xBEFF, 0xBEFF, 0xBEFF, 0xC71F, 0xDF7F, 0xDF7F, 0xDF7F, 0xDF7F, + 0xBEFF, 0x81FF, 0x81FF, 0xB657, 0xFFFF, 0xC71F, 0x81FF, 0xA23A, + 0xFFFF, 0xC71F, 0x81FF, 0xA23A, 0xD75F, 0x8A1F, 0x81FF, 0xB658, + 0x81FF, 0x9A5F, 0xAA9F, 0x81FF, 0x921D, 0x81FF, 0x81FF, 0x85FE, + 0xD294, 0xBE55, 0xB657, 0xC653, 0xD294, 0xD294, 0xCE73, 0xCA52, + 0x8A1D, 0xB214, 0xB214, 0x8DFC, 0xBA34, 0xC631, 0xC210, 0xB612, + 0xC631, 0xC631, 0xC631, 0xC210, 0xCA52, 0xCA52, 0xC631, 0xC631, + 0x81FF, 0x81FF, 0x81FF, 0x81FF, 0x8DFC, 0x81FF, 0x81FF, 0x81FF, + 0xC210, 0xBE10, 0xBDEF, 0xBDEF, 0xC210, 0xC210, 0xC210, 0xBE10, + 0x81FF, 0x81FF, 0x81FF, 0x81FF, 0x81FF, 0x81FF, 0x8DFB, 0xA5D4, + 0xBDEF, 0xB9CE, 0xB9CE, 0xB9CE, 0xBDEF, 0xBDEF, 0xBDEF, 0xBDEF, + 0x81FF, 0x81FF, 0x81FF, 0x81FF, 0x99F8, 0x8DFB, 0x8DFB, 0x8DFB, + 0xB9CE, 0xBDEF, 0xBDEF, 0xBDEF, 0xBDEF, 0xBDEF, 0xBE10, 0xC210, + 0x81FF, 0x81FF, 0x81FF, 0x81FF, 0x95F9, 0xA5F5, 0xA1F7, 0x91FA, + 0xBDEF, 0xBE10, 0xC210, 0xC210, 0xC210, 0xC210, 0xC631, 0xC631, + 0x81FF, 0x81FF, 0x81FF, 0x81FF, 0x921C, 0x921C, 0x921C, 0x921C, + 0xC631, 0xC631, 0xCA52, 0xCA52, 0xC631, 0xCA52, 0xCA52, 0xCE73, + 0x81FF, 0x81FF, 0x9A3B, 0xD294, 0x961B, 0xAA39, 0xD294, 0xD294, + 0xCE73, 0xCE73, 0xD294, 0xD6B5, 0xCE73, 0xD294, 0xD6B5, 0xD6B5, +}; diff --git a/source/ngc/loadrom.c b/source/ngc/loadrom.c new file mode 100644 index 0000000..73be6ec --- /dev/null +++ b/source/ngc/loadrom.c @@ -0,0 +1,201 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ***************************************************************************/ + +#include "shared.h" +#include "rominfo.h" +#include + +/* 05/05/2006: new region detection routine (taken from GENS sourcecode) */ +extern uint8 region_detect; +extern uint8 cpu_detect; + +void genesis_set_region () +{ + /* country codes used to differentiate region */ + /* 0001 = japan ntsc (1) */ + /* 0010 = japan pal (2) */ + /* 0100 = usa (4) */ + /* 1000 = europe (8) */ + + int country = 0; + int i = 0; + char c; + + /* reading header to find the country */ + if (!strnicmp(rominfo.country, "eur", 3)) country |= 8; + else if (!strnicmp(rominfo.country, "usa", 3)) country |= 4; + else if (!strnicmp(rominfo.country, "jap", 3)) country |= 1; + + else for(i = 0; i < 4; i++) + { + c = toupper((int)rominfo.country[i]); + if (c == 'U') country |= 4; + else if (c == 'J') country |= 1; + else if (c == 'E') country |= 8; + else if (c < 16) country |= c; + else if ((c >= '0') && (c <= '9')) country |= c - '0'; + else if ((c >= 'A') && (c <= 'F')) country |= c - 'A' + 10; + } + + /* automatic detection */ + /* setting region */ + /* this is used by IO register */ + if (country & 4) region_code = REGION_USA; + else if (country & 8) region_code = REGION_EUROPE; + else if (country & 1) region_code = REGION_JAPAN_NTSC; + else if (country & 2) region_code = REGION_JAPAN_PAL; + else region_code = REGION_USA; + + /* cpu mode: PAL or NTSC */ + if ((region_code == REGION_EUROPE) || (region_code == REGION_JAPAN_PAL)) vdp_pal = 1; + else vdp_pal = 0; + + /* Force region setting */ + if (region_detect == 1) region_code = REGION_USA; + else if (region_detect == 2) region_code = REGION_EUROPE; + else if (region_detect == 3) region_code = REGION_JAPAN_NTSC; + else if (region_detect == 4) region_code = REGION_JAPAN_PAL; + + /* Force CPU mode */ + if (cpu_detect == 1) vdp_pal = 0; + else if (cpu_detect == 2) vdp_pal = 1; +} + + +/* patch_game + * set specific timings for some games + */ + extern uint8 alttiming; + extern uint8 irqtiming; + extern uint8 sys_type[2]; + + void patch_game() + { + if ((strstr(rominfo.product,"T-50406") != NULL) || /* Legend of Galahad */ + (strstr(rominfo.product,"MK-1079") != NULL) || /* Sonic the Hedgehog 3 (JUE) */ + (strstr(rominfo.product,"MK-1563") != NULL) || /* Sonic & Knuckes + Sonic the Hedgehog 3 (JUE) */ + (strstr(rominfo.product,"T-50116") != NULL) || /* Road Rash */ + (strstr(rominfo.product,"T-50496") != NULL) || /* Road Rash 2 (UE) */ + (strstr(rominfo.product,"T-106143") != NULL) || /* Road Rash 2 (J) */ + (strstr(rominfo.product,"T-50966") != NULL) /* Road Rash 3 (UE) */ + ) alttiming = 1; + else alttiming = 0; + + /* Sesame's Street Counting Cafe */ + if (strstr(rominfo.product,"T-50896") != NULL) irqtiming = 1; + else irqtiming = 0; + + /* Menacer 6-in-1 Pack */ + if (strstr(rominfo.product,"MK-1658") != NULL) + { + input.system[0] = NO_SYSTEM; + input.system[1] = SYSTEM_MENACER; + } + else + { + if (sys_type[0] == 0) input.system[0] = SYSTEM_GAMEPAD; + else if (sys_type[0] == 1) input.system[0] = SYSTEM_TEAMPLAYER; + else if (sys_type[0] == 2) input.system[0] = NO_SYSTEM; + + if (sys_type[1] == 0) input.system[1] = SYSTEM_GAMEPAD; + else if (sys_type[1] == 1) input.system[1] = SYSTEM_TEAMPLAYER; + else if (sys_type[1] == 2) input.system[1] = NO_SYSTEM; + } + +} + +/* SMD -interleaved) rom support */ +static uint8 block[0x4000]; + +void deinterleave_block (uint8 * src) +{ + int i; + memcpy (block, src, 0x4000); + for (i = 0; i < 0x2000; i += 1) + { + src[i * 2 + 0] = block[0x2000 + (i)]; + src[i * 2 + 1] = block[0x0000 + (i)]; + } +} + +/* + * load_memrom + * softdev 12 March 2006 + * Changed from using ROM buffer to a single copy in cart_rom + * + * Saving ROM size in bytes :) + * Required for remote loading. + * + * WIP3 - Removed 5Mb SSF2TNC from main memory to Audio ROM + */ +void load_memrom (int size) +{ + int offset = 0; + + SSF2TNC = 0; + + /* Support for interleaved roms */ + if ((size / 512) & 1) + { + int i; + size -= 512; + offset += 512; + + for (i = 0; i < (size / 0x4000); i += 1) + { + deinterleave_block (cart_rom + offset + (i * 0x4000)); + } + } + + if (size > 0x500000) size = 0x500000; + if (offset) memcpy (cart_rom, cart_rom + offset, size); + if (size > 0x400000) SSF2TNC = 1; /*** Assume SSF2TNC (mapped ROM) ***/ + + genromsize = size; + + /*** Clear out space ***/ + if (size < 0x500000) memset (cart_rom + size, 0, 0x500000 - size); + return; +} + +/*** Reloadrom + performs some initialization before running the new rom + ***/ +extern void decode_ggcodes (); +extern void ClearGGCodes (); +extern void sram_autoload(); +extern uint8 autoload; + +void reloadrom () +{ + load_memrom (genromsize); + SRAM_Init (); /* SRAM Infos from ROM header */ + getrominfo (cart_rom); /* Other Infos from ROM Header */ + genesis_set_region (); /* Region Detection */ + patch_game(); /* game special patches */ + + system_init (); + audio_init(48000); + ClearGGCodes (); /* Game Genie */ + decode_ggcodes (); + + system_reset (); + if (autoload) sram_autoload(); +} diff --git a/source/ngc/ngc.c b/source/ngc/ngc.c new file mode 100644 index 0000000..c13b3f0 --- /dev/null +++ b/source/ngc/ngc.c @@ -0,0 +1,640 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ***************************************************************************/ +#include "shared.h" +#include "gcaram.h" +#include "dvd.h" +#include "font.h" + +#define ROMOFFSET 0x80600000 + +unsigned char *gen_bmp; /*** Work bitmap ***/ +int frameticker = 0; +int ConfigRequested = 0; +int padcal = 70; +int RenderedFrameCount = 0; +int FrameCount = 0; +int FramesPerSecond = 0; +u8 isWII = 0; + +/*************************************************************************** + * Nintendo Gamecube Hardware Specific Functions + * + * T I M E R + ***************************************************************************/ +#define TB_CLOCK 40500000 +#define mftb(rval) ({unsigned long u; do { \ + asm volatile ("mftbu %0" : "=r" (u)); \ + asm volatile ("mftb %0" : "=r" ((rval)->l)); \ + asm volatile ("mftbu %0" : "=r" ((rval)->u)); \ + } while(u != ((rval)->u)); }) + +typedef struct +{ + unsigned long l, u; +} tb_t; + +unsigned long tb_diff_msec(tb_t *end, tb_t *start) +{ + unsigned long upper, lower; + upper = end->u - start->u; + if (start->l > end->l) upper--; + lower = end->l - start->l; + return ((upper*((unsigned long)0x80000000/(TB_CLOCK/2000))) + (lower/(TB_CLOCK/1000))); +} + +int msBetweenFrames = 20; +tb_t now, prev; + + +/*************************************************************************** + * Nintendo Gamecube Hardware Specific Functions + * + * V I D E O + ***************************************************************************/ +/*** 2D Video ***/ +unsigned int *xfb[2]; /*** Double buffered ***/ +int whichfb = 0; /*** Switch ***/ +GXRModeObj *vmode; /*** General video mode ***/ + +/*** GX ***/ +#define TEX_WIDTH 320 +#define TEX_HEIGHT 256 +#define DEFAULT_FIFO_SIZE 256 * 1024 + +static u8 gp_fifo[DEFAULT_FIFO_SIZE] ATTRIBUTE_ALIGN (32); +static u8 texturemem[TEX_WIDTH * (TEX_HEIGHT + 8) * 2] ATTRIBUTE_ALIGN (32); +GXTexObj texobj; +static Mtx view; +int vwidth, vheight, oldvwidth, oldvheight; + +/* New texture based scaler */ +#define HASPECT 76 +#define VASPECT 54 + +typedef struct tagcamera +{ + Vector pos; + Vector up; + Vector view; +} camera; + +/*** Square Matrix + This structure controls the size of the image on the screen. + Think of the output as a -80 x 80 by -60 x 60 graph. +***/ +s16 square[] ATTRIBUTE_ALIGN (32) = +{ + /* + * X, Y, Z + * Values set are for roughly 4:3 aspect + */ + -HASPECT, VASPECT, 0, // 0 + HASPECT, VASPECT, 0, // 1 + HASPECT, -VASPECT, 0, // 2 + -HASPECT, -VASPECT, 0, // 3 +}; + +static camera cam = { {0.0F, 0.0F, 0.0F}, +{0.0F, 0.5F, 0.0F}, +{0.0F, 0.0F, -0.5F} +}; + +/*** Framestart function + Simply increment the tick counter + ***/ +static void framestart() +{ + frameticker++; +} + +/*** WIP3 - Scaler Support Functions + ***/ +static void draw_init (void) +{ + GX_ClearVtxDesc (); + GX_SetVtxDesc (GX_VA_POS, GX_INDEX8); + GX_SetVtxDesc (GX_VA_CLR0, GX_INDEX8); + GX_SetVtxDesc (GX_VA_TEX0, GX_DIRECT); + GX_SetVtxAttrFmt (GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0); + GX_SetVtxAttrFmt (GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0); + GX_SetVtxAttrFmt (GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0); + GX_SetArray (GX_VA_POS, square, 3 * sizeof (s16)); + GX_SetNumTexGens (1); + GX_SetTexCoordGen (GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY); + GX_InvalidateTexAll (); + GX_InitTexObj (&texobj, texturemem, vwidth, vheight, GX_TF_RGB565, GX_CLAMP, GX_CLAMP, GX_FALSE); +} + +static void draw_vert (u8 pos, u8 c, f32 s, f32 t) +{ + GX_Position1x8 (pos); + GX_Color1x8 (c); + GX_TexCoord2f32 (s, t); +} + +static void draw_square (Mtx v) +{ + Mtx m; // model matrix. + Mtx mv; // modelview matrix. + + guMtxIdentity (m); + guMtxTransApply (m, m, 0, 0, -100); + guMtxConcat (v, m, mv); + GX_LoadPosMtxImm (mv, GX_PNMTX0); + GX_Begin (GX_QUADS, GX_VTXFMT0, 4); + draw_vert (0, 0, 0.0, 0.0); + draw_vert (1, 0, 1.0, 0.0); + draw_vert (2, 0, 1.0, 1.0); + draw_vert (3, 0, 0.0, 1.0); + GX_End (); +} + +/*** StartGX + This function initialises the GX. + WIP3 - Based on texturetest from libOGC examples. + ***/ +static void StartGX (void) +{ + Mtx p; + GXColor gxbackground = { 0, 0, 0, 0xff }; + + /*** Clear out FIFO area ***/ + memset (&gp_fifo, 0, DEFAULT_FIFO_SIZE); + + /*** Initialise GX ***/ + GX_Init (&gp_fifo, DEFAULT_FIFO_SIZE); + GX_SetCopyClear (gxbackground, 0x00ffffff); + GX_SetViewport (0, 0, vmode->fbWidth, vmode->efbHeight, 0, 1); + GX_SetDispCopyYScale ((f32) vmode->xfbHeight / (f32) vmode->efbHeight); + GX_SetScissor (0, 0, vmode->fbWidth, vmode->efbHeight); + GX_SetDispCopySrc (0, 0, vmode->fbWidth, vmode->efbHeight); + GX_SetDispCopyDst (vmode->fbWidth, vmode->xfbHeight); + GX_SetCopyFilter (vmode->aa, vmode->sample_pattern, GX_TRUE, vmode->vfilter); + GX_SetFieldMode (vmode->field_rendering, ((vmode->viHeight == 2 * vmode->xfbHeight) ? GX_ENABLE : GX_DISABLE)); + GX_SetPixelFmt (GX_PF_RGB8_Z24, GX_ZC_LINEAR); + GX_SetCullMode (GX_CULL_NONE); + GX_CopyDisp (xfb[whichfb ^ 1], GX_TRUE); + GX_SetDispCopyGamma (GX_GM_1_0); + guPerspective (p, 60, 1.33F, 10.0F, 1000.0F); + GX_LoadProjectionMtx (p, GX_PERSPECTIVE); + memset (texturemem, 0, TEX_WIDTH * TEX_HEIGHT * 2); + vwidth = 100; + vheight = 100; +} + +/*** InitGCVideo + This function MUST be called at startup. + ***/ +static void InitGCVideo () +{ + int *romptr = (int *)ROMOFFSET; + + /* + * Before doing anything else under libogc, + * Call VIDEO_Init + */ + VIDEO_Init (); + + /* + * Before any memory is allocated etc. + * Rescue any tagged ROM in data 2 + */ + StartARAM(); + if ( memcmp((char *)romptr,"GENPLUSR",8) == 0 ) + { + genromsize = romptr[2]; + ARAMPut ((char *) 0x80600020, (char *) 0x8000, genromsize); + } + else genromsize = 0; + + /* Init Gamepads */ + PAD_Init (); + + /* + * Reset the video mode + * This is always set to 60hz + * Whether your running PAL or NTSC + */ + vmode = &TVNtsc480IntDf; + VIDEO_Configure (vmode); + + /*** Now configure the framebuffer. + Really a framebuffer is just a chunk of memory + to hold the display line by line. + **/ + xfb[0] = (u32 *) MEM_K0_TO_K1((u32 *) SYS_AllocateFramebuffer(vmode)); + + /*** I prefer also to have a second buffer for double-buffering. + This is not needed for the console demo. + ***/ + xfb[1] = (u32 *) MEM_K0_TO_K1((u32 *) SYS_AllocateFramebuffer(vmode)); + + /*** Define a console ***/ + console_init(xfb[0], 20, 64, vmode->fbWidth, vmode->xfbHeight, vmode->fbWidth * 2); + + /*** Clear framebuffer to black ***/ + VIDEO_ClearFrameBuffer(vmode, xfb[0], COLOR_BLACK); + VIDEO_ClearFrameBuffer(vmode, xfb[1], COLOR_BLACK); + + /*** Set the framebuffer to be displayed at next VBlank ***/ + VIDEO_SetNextFramebuffer(xfb[0]); + + /*** Increment frameticker and timer ***/ + VIDEO_SetPreRetraceCallback(framestart); + + /*** Get the PAD status updated by libogc ***/ + VIDEO_SetPostRetraceCallback(PAD_ScanPads); + VIDEO_SetBlack (FALSE); + + /*** Update the video for next vblank ***/ + VIDEO_Flush(); + + /*** Wait for VBL ***/ + VIDEO_WaitVSync(); + if (vmode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync(); + + DVD_Init (); + SDCARD_Init (); + unpackBackdrop (); + init_font(); + StartGX (); + + /* Wii drive detection for 4.7Gb support */ + int driveid = dvd_inquiry(); + if ((driveid == 4) || (driveid == 6) || (driveid == 8)) isWII = 0; + else isWII = 1; +} + +/*** Video Update + called after each emulation frame + ***/ +static void update_video () +{ + int h, w; + vwidth = (reg[12] & 1) ? 320 : 256; + vheight = (reg[1] & 8) ? 240 : 224; + + long long int *dst = (long long int *)texturemem; + long long int *src1 = (long long int *)(bitmap.data + 64); + long long int *src2 = src1 + 256; + long long int *src3 = src2 + 256; + long long int *src4 = src3 + 256; + long long int stride = 1024 - ( vwidth >> 2 ); + + whichfb ^= 1; + + if ((oldvheight != vheight) || (oldvwidth != vwidth)) + { + /** Update scaling **/ + oldvwidth = vwidth; + oldvheight = vheight; + draw_init (); + memset (&view, 0, sizeof (Mtx)); + guLookAt(view, &cam.pos, &cam.up, &cam.view); + GX_SetViewport (0, 0, vmode->fbWidth, vmode->efbHeight, 0, 1); + } + + GX_InvVtxCache (); + GX_InvalidateTexAll (); + GX_SetTevOp (GX_TEVSTAGE0, GX_DECAL); + GX_SetTevOrder (GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0); + + for (h = 0; h < vheight; h += 4) + { + for (w = 0; w < (vwidth >> 2); w++ ) + { + *dst++ = *src1++; + *dst++ = *src2++; + *dst++ = *src3++; + *dst++ = *src4++; + } + + src1 += stride; + src2 += stride; + src3 += stride; + src4 += stride; + } + + DCFlushRange (texturemem, TEX_WIDTH * TEX_HEIGHT * 2); + GX_SetNumChans (1); + GX_LoadTexObj (&texobj, GX_TEXMAP0); + draw_square (view); + GX_DrawDone (); + GX_SetZMode (GX_TRUE, GX_LEQUAL, GX_TRUE); + GX_SetColorUpdate (GX_TRUE); + GX_CopyDisp (xfb[whichfb], GX_TRUE); + GX_Flush (); + VIDEO_SetNextFramebuffer (xfb[whichfb]); + VIDEO_Flush (); +} + +/*************************************************************************** + * Nintendo Gamecube Hardware Specific Functions + * + * A U D I O + ***************************************************************************/ +unsigned char soundbuffer[16][3840] ATTRIBUTE_ALIGN(32); +int mixbuffer = 0; +int playbuffer = 0; +int IsPlaying = 0; + +/*** AudioSwitchBuffers + Genesis Plus only provides sound data on completion of each frame. + To try to make the audio less choppy, this function is called from both the + DMA completion and update_audio. + Testing for data in the buffer ensures that there are no clashes. + ***/ +static void AudioSwitchBuffers() +{ + u32 dma_len = (vdp_pal) ? 3840 : 3200; + + if ( !ConfigRequested ) + { + AUDIO_InitDMA((u32) soundbuffer[playbuffer], dma_len); + DCFlushRange(soundbuffer[playbuffer], dma_len); + AUDIO_StartDMA(); + playbuffer++; + playbuffer &= 0xf; + if ( playbuffer == mixbuffer ) playbuffer--; + if ( playbuffer < 0 ) playbuffer = 15; + IsPlaying = 1; + } + else IsPlaying = 0; +} + +/*** InitGCAudio + Stock code to set the DSP at 48Khz + ***/ +static void InitGCAudio () +{ + AUDIO_Init (NULL); + AUDIO_SetDSPSampleRate (AI_SAMPLERATE_48KHZ); + AUDIO_RegisterDMACallback (AudioSwitchBuffers); + memset(soundbuffer, 0, 16 * 3840); +} + +/*** Audio Update + called after each emulation frame + ***/ +static void update_audio () +{ + if (IsPlaying == 0) AudioSwitchBuffers (); +} + +/*************************************************************************** + * Nintendo Gamecube Hardware Specific Functions + * + * I N P U T + ***************************************************************************/ +/** + * IMPORTANT + * If you change the padmap here, be sure to update confjoy to + * reflect the changes - or confusion will ensue! + * + * DEFAULT MAPPING IS: + * Genesis Gamecube + * A B + * B A + * C X + * X LT + * Y Y + * Z RT + * + * Mode is unused, as it's our menu hotkey for now :) + * Also note that libOGC has LT/RT reversed - it's not a typo! + */ +unsigned int gppadmap[] = { INPUT_A, INPUT_B, INPUT_C, + INPUT_X, INPUT_Y, INPUT_Z, + INPUT_UP, INPUT_DOWN, + INPUT_LEFT, INPUT_RIGHT, + INPUT_START, INPUT_MODE +}; + +unsigned short gcpadmap[] = { PAD_BUTTON_B, PAD_BUTTON_A, PAD_BUTTON_X, + PAD_TRIGGER_L, PAD_BUTTON_Y, PAD_TRIGGER_R, + PAD_BUTTON_UP, PAD_BUTTON_DOWN, + PAD_BUTTON_LEFT, PAD_BUTTON_RIGHT, + PAD_BUTTON_START, PAD_TRIGGER_Z +}; + +static unsigned int DecodeJoy (unsigned short p) +{ + unsigned int J = 0; + int i; + + for (i = 0; i < 12; i++) if (p & gcpadmap[i]) J |= gppadmap[i]; + return J; +} + +static unsigned int GetAnalog (int Joy) +{ + signed char x, y; + unsigned int i = 0; + + x = PAD_StickX (Joy); + y = PAD_StickY (Joy); + if (x > padcal) i |= INPUT_RIGHT; + if (x < -padcal) i |= INPUT_LEFT; + if (y > padcal) i |= INPUT_UP; + if (y < -padcal) i |= INPUT_DOWN; + return i; +} + +/*** Inputs Update + called before each emulation frame + ***/ +static void update_inputs() +{ + int i = 0; + int joynum = 0; + + /*** Check for SOFT-RESET combo ***/ + if ((PAD_ButtonsHeld (0) & PAD_TRIGGER_Z) && + (PAD_ButtonsHeld (0) & PAD_TRIGGER_L)) + { + m68k_pulse_reset (); + return; + } + + /*** Check for menu combo ***/ + if (PAD_ButtonsHeld (0) & PAD_TRIGGER_Z) + { + ConfigRequested = 1; + return; + } + + for (i=0; i msBetweenFrames) + { + memcpy(&prev, &now, sizeof(tb_t)); + system_frame(1); + } + else + { + /*** Delay ***/ + while (tb_diff_msec(&now, &prev) < msBetweenFrames) mftb(&now); + memcpy(&prev, &now, sizeof(tb_t) ); + system_frame(0); + RenderedFrameCount++; + } + } + else /* NTSC 60Hz (use vsync) */ + { + while ( frameticker < 1 ) usleep(10); + + /** Simulate a frame **/ + if (frameticker > 1) + { + frameticker--; + if (frameticker > 5) + { + system_frame (0); + RenderedFrameCount++; + frameticker = 1; + } + else system_frame (1); + } + else + { + system_frame (0); + RenderedFrameCount++; + } + } + + frameticker--; + + /** Draw the frame **/ + update_video (); + + /** add the audio **/ + update_audio (); + + /** Check render frames **/ + if ((FrameCount == vdp_rate)) + { + FramesPerSecond = RenderedFrameCount; + RenderedFrameCount = 0; + FrameCount = 0; + } + + if (ConfigRequested) + { + AUDIO_StopDMA (); + IsPlaying = mixbuffer = playbuffer = 0; + MainMenu (); + ConfigRequested = 0; + } + } + return 0; +} diff --git a/source/ngc/osd.h b/source/ngc/osd.h new file mode 100644 index 0000000..d5ae408 --- /dev/null +++ b/source/ngc/osd.h @@ -0,0 +1,16 @@ + +#ifndef _OSD_H_ +#define _OSD_H_ + +#define NGC 1 + +#include +#include +#include +#include +#include +#include + +extern void error (char *format, ...); + +#endif /* _OSD_H_ */ diff --git a/source/ngc/unzip.c b/source/ngc/unzip.c new file mode 100644 index 0000000..e7941a1 --- /dev/null +++ b/source/ngc/unzip.c @@ -0,0 +1,190 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Nintendo Gamecube Zip Support + * + * Only partial support is included, in that only the first file within the archive + * is considered to be a Genesis ROM image. + ***************************************************************************/ +#include +#include +#include "shared.h" +#include "dvd.h" +#include "font.h" + +extern sd_file *filehandle; +extern u8 UseSDCARD; + +/* + * PKWare Zip Header - adopted into zip standard + */ +#define PKZIPID 0x504b0304 +#define MAXROM 0x500000 +#define ZIPCHUNK 2048 + +/* + * Zip file header definition + */ +typedef struct +{ + unsigned int zipid __attribute__ ((__packed__)); // 0x04034b50 + unsigned short zipversion __attribute__ ((__packed__)); + unsigned short zipflags __attribute__ ((__packed__)); + unsigned short compressionMethod __attribute__ ((__packed__)); + unsigned short lastmodtime __attribute__ ((__packed__)); + unsigned short lastmoddate __attribute__ ((__packed__)); + unsigned int crc32 __attribute__ ((__packed__)); + unsigned int compressedSize __attribute__ ((__packed__)); + unsigned int uncompressedSize __attribute__ ((__packed__)); + unsigned short filenameLength __attribute__ ((__packed__)); + unsigned short extraDataLength __attribute__ ((__packed__)); +} PKZIPHEADER; + +/* + * Zip files are stored little endian + * Support functions for short and int types + */ +static inline u32 FLIP32 (u32 b) +{ + unsigned int c; + c = (b & 0xff000000) >> 24; + c |= (b & 0xff0000) >> 8; + c |= (b & 0xff00) << 8; + c |= (b & 0xff) << 24; + return c; +} + +static inline u16 FLIP16 (u16 b) +{ + u16 c; + c = (b & 0xff00) >> 8; + c |= (b & 0xff) << 8; + return c; +} + +/**************************************************************************** + * IsZipFile + * + * Returns TRUE when PKZIPID is first four characters of buffer + ****************************************************************************/ +int IsZipFile (char *buffer) +{ + unsigned int *check; + check = (unsigned int *) buffer; + if (check[0] == PKZIPID) return 1; + return 0; +} + + /***************************************************************************** + * UnZipBuffer + * + * It should be noted that there is a limit of 5MB total size for any ROM + ******************************************************************************/ +int UnZipBuffer (unsigned char *outbuffer, u64 discoffset, int length) +{ + PKZIPHEADER pkzip; + int zipoffset = 0; + int zipchunk = 0; + char out[ZIPCHUNK]; + z_stream zs; + int res; + int bufferoffset = 0; + int have = 0; + char readbuffer[2048]; + char msg[128]; + + /*** Read Zip Header ***/ + if ( UseSDCARD ) + { + SDCARD_SeekFile(filehandle, 0, SDCARD_SEEK_SET); + SDCARD_ReadFile(filehandle, &readbuffer, 2048); + } + else dvd_read (&readbuffer, 2048, discoffset); + + /*** Copy PKZip header to local, used as info ***/ + memcpy (&pkzip, &readbuffer, sizeof (PKZIPHEADER)); + + sprintf (msg, "Unzipping %d bytes ... Wait", FLIP32 (pkzip.uncompressedSize)); + ShowAction (msg); + + /*** Prepare the zip stream ***/ + memset (&zs, 0, sizeof (z_stream)); + zs.zalloc = Z_NULL; + zs.zfree = Z_NULL; + zs.opaque = Z_NULL; + zs.avail_in = 0; + zs.next_in = Z_NULL; + res = inflateInit2 (&zs, -MAX_WBITS); + + if (res != Z_OK) return 0; + + /*** Set ZipChunk for first pass ***/ + zipoffset = (sizeof (PKZIPHEADER) + FLIP16 (pkzip.filenameLength) + FLIP16 (pkzip.extraDataLength)); + zipchunk = ZIPCHUNK - zipoffset; + + /*** Now do it! ***/ + do + { + zs.avail_in = zipchunk; + zs.next_in = (Bytef *) & readbuffer[zipoffset]; + + /*** Now inflate until input buffer is exhausted ***/ + do + { + zs.avail_out = ZIPCHUNK; + zs.next_out = (Bytef *) & out; + res = inflate (&zs, Z_NO_FLUSH); + + if (res == Z_MEM_ERROR) + { + inflateEnd (&zs); + return 0; + } + + have = ZIPCHUNK - zs.avail_out; + if (have) + { + /*** Copy to normal block buffer ***/ + memcpy (&outbuffer[bufferoffset], &out, have); + bufferoffset += have; + } + } + while (zs.avail_out == 0); + + /*** Readup the next 2k block ***/ + zipoffset = 0; + zipchunk = ZIPCHUNK; + discoffset += 2048; + + if (UseSDCARD) SDCARD_ReadFile(filehandle, &readbuffer, 2048); + else dvd_read (&readbuffer, 2048, discoffset); + } + while (res != Z_STREAM_END); + + inflateEnd (&zs); + + if ( UseSDCARD ) SDCARD_CloseFile(filehandle); + + if (res == Z_STREAM_END) + { + if (FLIP32 (pkzip.uncompressedSize) == (u32) bufferoffset) return bufferoffset; + else return FLIP32 (pkzip.uncompressedSize); + } + + return 0; +} diff --git a/source/ngc/unzip.h b/source/ngc/unzip.h new file mode 100644 index 0000000..c033928 --- /dev/null +++ b/source/ngc/unzip.h @@ -0,0 +1,26 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Nintendo Gamecube Zip Support + * + * Only partial support is included, in that only the first file within the archive + * is considered to be a ROM image. + ***************************************************************************/ + +extern int IsZipFile (char *buffer); +int UnZipBuffer (unsigned char *outbuffer, u64 discoffset, int length); diff --git a/source/render.c b/source/render.c new file mode 100644 index 0000000..7577516 --- /dev/null +++ b/source/render.c @@ -0,0 +1,1536 @@ +/* + only update window clip on window change (?) + fix leftmost window/nta render and window bug + sprite masking isn't right in sonic/micromachines 2, but + seems ok in galaxy force 2 + + Eke-Eke (2007): + . pixel sprite limit fixed (sonic/micromachines 2) + . sprite collision detection added + . big endian support improved + . fixed leftmost window/nta render and window bug + . some code speedup (minor) +*/ + + +#include "shared.h" + +#ifndef LSB_FIRST +static uint32 ATTR_MSB; +#endif + +#ifdef ALIGN_LONG + +/* Or change the names if you depend on these from elsewhere.. */ +#undef READ_LONG +#undef WRITE_LONG + +static __inline__ uint32 READ_LONG(void *address) +{ + if ((uint32)address & 3) + { +#ifdef LSB_FIRST /* little endian version */ + return ( *((uint8 *)address) + + (*((uint8 *)address+1) << 8) + + (*((uint8 *)address+2) << 16) + + (*((uint8 *)address+3) << 24) ); +#else /* big endian version */ + return ( *((uint8 *)address+3) + + (*((uint8 *)address+2) << 8) + + (*((uint8 *)address+1) << 16) + + (*((uint8 *)address) << 24) ); +#endif /* LSB_FIRST */ + } + else return *(uint32 *)address; +} + +static __inline__ void WRITE_LONG(void *address, uint32 data) +{ + if ((uint32)address & 3) + { +#ifdef LSB_FIRST + *((uint8 *)address) = data; + *((uint8 *)address+1) = (data >> 8); + *((uint8 *)address+2) = (data >> 16); + *((uint8 *)address+3) = (data >> 24); +#else + *((uint8 *)address+3) = data; + *((uint8 *)address+2) = (data >> 8); + *((uint8 *)address+1) = (data >> 16); + *((uint8 *)address) = (data >> 24); +#endif /* LSB_FIRST */ + return; + } + else *(uint32 *)address = data; +} + +#endif /* ALIGN_LONG */ + + +/* + Two Pattern Attributes are written in VRAM as two 16bits WORD: + + P = priority bit + C = color palette (2 bits) + V = Vertical Flip bit + H = Horizontal Flip bit + N = Pattern Number (11 bits) + + MSB PCCVHNNN NNNNNNNN LSB PCCVHNNN NNNNNNNN LSB + PATTERN1 PATTERN2 + + Pattern attributes are read from VRAM as 32bits WORD like this: + + LIT_ENDIAN: ATTR is MSB PCCVHNNN NNNNNNNN PCCVHNNN NNNNNNNN LSB + PATTERN2 PATTERN1 + + BIG_ENDIAN: ATTR is MSB PCCVHNNN NNNNNNNN PCCVHNNN NNNNNNNN LSB + PATTERN1 PATTERN2 + + + Each Line Buffer written byte describe one pixel data like this: + + msb SPppcccc lsb + + with: + S = sprite data indicator (not written here) + P = priority bit (from Pattern Attribute) + p = color palette (from Pattern Attribute) + c = color data (from Pattern Cache) + + + A column is 2 patterns wide + A pattern is 8 pixels wide = 8 bytes = two 32 bits write +*/ + +/* Draw a single 8-pixel column */ +/* + pattern cache is addressed like this: 00000VHN NNNNNNNN NNYYYXXX + with : Y = pattern row (1-8 lines) + X = pattern column (1-8 pixels) + V = Vertical Flip bit + H = Horizontal Flip bit + N = Pattern Number (1-2048) +*/ +#ifdef ALIGN_LONG +#ifdef LSB_FIRST +#define DRAW_COLUMN(ATTR, LINE) \ + atex = atex_table[(ATTR >> 13) & 7]; \ + src = (uint32 *)&bg_pattern_cache[(ATTR & 0x1FFF) << 6 | (LINE)]; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; \ + ATTR >>= 16; \ + atex = atex_table[(ATTR >> 13) & 7]; \ + src = (uint32 *)&bg_pattern_cache[(ATTR & 0x1FFF) << 6 | (LINE)]; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; +#else +#define DRAW_COLUMN(ATTR, LINE) \ + ATTR_MSB = ATTR >> 16; \ + atex = atex_table[(ATTR_MSB >> 13) & 7]; \ + src = (uint32 *)&bg_pattern_cache[(ATTR_MSB & 0x1FFF) << 6 | (LINE)]; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; \ + atex = atex_table[(ATTR >> 13) & 7]; \ + src = (uint32 *)&bg_pattern_cache[(ATTR & 0x1FFF) << 6 | (LINE)]; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; +#endif +#else /* NOT ALIGNED */ +#ifdef LSB_FIRST +#define DRAW_COLUMN(ATTR, LINE) \ + atex = atex_table[(ATTR >> 13) & 7]; \ + src = (uint32 *)&bg_pattern_cache[(ATTR & 0x1FFF) << 6 | (LINE)]; \ + *dst++ = (*src++ | atex); \ + *dst++ = (*src++ | atex); \ + ATTR >>= 16; \ + atex = atex_table[(ATTR >> 13) & 7]; \ + src = (uint32 *)&bg_pattern_cache[(ATTR & 0x1FFF) << 6 | (LINE)]; \ + *dst++ = (*src++ | atex); \ + *dst++ = (*src++ | atex); +#else +#define DRAW_COLUMN(ATTR, LINE) \ + ATTR_MSB = ATTR >> 16; \ + atex = atex_table[(ATTR_MSB >> 13) & 7]; \ + src = (uint32 *)&bg_pattern_cache[(ATTR_MSB & 0x1FFF) << 6 | (LINE)]; \ + *dst++ = (*src++ | atex); \ + *dst++ = (*src++ | atex); \ + atex = atex_table[(ATTR >> 13) & 7]; \ + src = (uint32 *)&bg_pattern_cache[(ATTR & 0x1FFF) << 6 | (LINE)]; \ + *dst++ = (*src++ | atex); \ + *dst++ = (*src++ | atex); +#endif +#endif /* ALIGN_LONG */ + + +/* Draw a single 16-pixel column */ +/* + pattern cache is addressed like this: 00000VHN NNNNNNNN NYYYYXXX + with : Y = pattern row (1-16 lines) + X = pattern column (1-8 pixels) + V = Vertical Flip bit + H = Horizontal Flip bit + N = Pattern Number (1-1024) + + one pattern line is 8 pixels = 8 bytes = 2 * 32 bits +*/ +#ifdef ALIGN_LONG +#ifdef LSB_FIRST +#define DRAW_COLUMN_IM2(ATTR, LINE) \ + atex = atex_table[(ATTR >> 13) & 7]; \ + offs = (ATTR & 0x03FF) << 7 | (ATTR & 0x1800) << 6 | (LINE); \ + if(ATTR & 0x1000) offs ^= 0x40; \ + src = (uint32 *)&bg_pattern_cache[offs]; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; \ + ATTR >>= 16; \ + atex = atex_table[(ATTR >> 13) & 7]; \ + offs = (ATTR & 0x03FF) << 7 | (ATTR & 0x1800) << 6 | (LINE); \ + if(ATTR & 0x1000) offs ^= 0x40; \ + src = (uint32 *)&bg_pattern_cache[offs]; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; +#else +#define DRAW_COLUMN_IM2(ATTR, LINE) \ + ATTR_MSB = ATTR >> 16; \ + atex = atex_table[(ATTR_MSB >> 13) & 7]; \ + offs = (ATTR_MSB & 0x03FF) << 7 | (ATTR_MSB & 0x1800) << 6 | (LINE); \ + if(ATTR_MSB & 0x1000) offs ^= 0x40; \ + src = (uint32 *)&bg_pattern_cache[offs]; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; \ + atex = atex_table[(ATTR >> 13) & 7]; \ + offs = (ATTR & 0x03FF) << 7 | (ATTR & 0x1800) << 6 | (LINE); \ + if(ATTR & 0x1000) offs ^= 0x40; \ + src = (uint32 *)&bg_pattern_cache[offs]; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; \ + WRITE_LONG(dst, READ_LONG(src) | atex); \ + dst++; \ + src++; +#endif +#else /* NOT ALIGNED */ +#ifdef LSB_FIRST +#define DRAW_COLUMN_IM2(ATTR, LINE) \ + atex = atex_table[(ATTR >> 13) & 7]; \ + offs = (ATTR & 0x03FF) << 7 | (ATTR & 0x1800) << 6 | (LINE); \ + if(ATTR & 0x1000) offs ^= 0x40; \ + src = (uint32 *)&bg_pattern_cache[offs]; \ + *dst++ = (*src++ | atex); \ + *dst++ = (*src++ | atex); \ + ATTR >>= 16; \ + atex = atex_table[(ATTR >> 13) & 7]; \ + offs = (ATTR & 0x03FF) << 7 | (ATTR & 0x1800) << 6 | (LINE); \ + if(ATTR & 0x1000) offs ^= 0x40; \ + src = (uint32 *)&bg_pattern_cache[offs]; \ + *dst++ = (*src++ | atex); \ + *dst++ = (*src++ | atex); +#else +#define DRAW_COLUMN_IM2(ATTR, LINE) \ + ATTR_MSB = ATTR >> 16; \ + atex = atex_table[(ATTR_MSB >> 13) & 7]; \ + offs = (ATTR_MSB & 0x03FF) << 7 | (ATTR_MSB & 0x1800) << 6 | (LINE); \ + if(ATTR_MSB & 0x1000) offs ^= 0x40; \ + src = (uint32 *)&bg_pattern_cache[offs]; \ + *dst++ = (*src++ | atex); \ + *dst++ = (*src++ | atex); \ + atex = atex_table[(ATTR >> 13) & 7]; \ + offs = (ATTR & 0x03FF) << 7 | (ATTR & 0x1800) << 6 | (LINE); \ + if(ATTR & 0x1000) offs ^= 0x40; \ + src = (uint32 *)&bg_pattern_cache[offs]; \ + *dst++ = (*src++ | atex); \ + *dst++ = (*src++ | atex); +#endif +#endif /* ALIGN_LONG */ + +/* + gcc complains about this: + *lb++ = table[(*lb << 8) |(*src++ | palette)]; + .. claiming the result on lb is undefined. + So we manually advance lb and use constant offsets into the line buffer. +*/ + +/* added sprite collision detection: + check if non-transparent sprite data has been previously drawn +*/ +#define DRAW_SPRITE_TILE \ + for(i=0; i<8; i++) \ + { \ + if ((lb[i] & 0x80) && ((lb[i] | src[i]) & 0x0F)) status |= 0x20; \ + lb[i] = table[(lb[i] << 8) |(src[i] | palette)]; \ + } + + +/* Pixel creation macros, input is four bits each */ +/* 8:8:8 RGB */ +#define MAKE_PIXEL_32(r,g,b) ((r) << 20 | (g) << 12 | (b) << 4) + +/* 5:5:5 RGB */ +#define MAKE_PIXEL_15(r,g,b) ((r) << 11 | (g) << 6 | (b) << 1) + +/* 5:6:5 RGB */ +#define MAKE_PIXEL_16(r,g,b) ((r) << 11 | (g) << 5 | (b)) + +/* 3:3:2 RGB */ +#define MAKE_PIXEL_8(r,g,b) ((r) << 5 | (g) << 2 | ((b) >> 1)) + +/* Clip data */ +static clip_t clip[2]; + +/* Attribute expansion table */ +static const uint32 atex_table[] = { + 0x00000000, 0x10101010, 0x20202020, 0x30303030, + 0x40404040, 0x50505050, 0x60606060, 0x70707070 +}; + +/* Sprite name look-up table */ +uint8 name_lut[0x400]; + +/* Sprite line buffer data */ +uint8 object_index_count; + +struct +{ + uint16 ypos; + uint16 xpos; + uint16 attr; + uint8 size; + uint8 index; +} object_info[20]; + +/* Pixel look-up tables and table base address */ +uint8 *lut[5]; +uint8 *lut_base = NULL; + +/* 8-bit pixel remapping data */ +uint8 pixel_8[0x100]; +uint8 pixel_8_lut[3][0x200]; + +/* 15-bit pixel remapping data */ +uint16 pixel_15[0x100]; +uint16 pixel_15_lut[3][0x200]; + +/* 16-bit pixel remapping data */ +uint16 pixel_16[0x100]; +uint16 pixel_16_lut[3][0x200]; + +/* 32-bit pixel remapping data */ +uint32 pixel_32[0x100]; +uint32 pixel_32_lut[3][0x200]; + +/* Line buffers */ +uint8 tmp_buf[0x400]; /* Temporary buffer */ +uint8 bg_buf[0x400]; /* Merged background buffer */ +uint8 nta_buf[0x400]; /* Plane A / Window line buffer */ +uint8 ntb_buf[0x400]; /* Plane B line buffer */ +uint8 obj_buf[0x400]; /* Object layer line buffer */ + +/* + 3:3:3 to 5:6:5 RGB pixel extrapolation tables + this is used to convert 3bits RGB values to 5bits (R,B) or 6bits (G) values + there is three color modes: + normal: RGB range is [0;MAX] + half: RGB range is [0;MAX/2] (shadow mode) + high: RGB range is [MAX/2;MAX] (highlight mode) + + MAX is 31 (R,B) or 63 (G) for 5:6:5 pixels and 7 (R,G,B) for 3:3:3 pixels + MAX/2 is rounded to inferior value (15, 31 or 3) + + the extrapolation is linear and calculated like this: + + for (i=0; i<8; i++) + { + rgb565_norm[0][i] = round(((double)i * 31.0) / 7.0); + rgb565_norm[1][i] = round(((double)i * 63.0) / 7.0); + + rgb565_half[0][i] = round(((double)i * 31.0) / 7.0 / 2.0); + rgb565_half[1][i] = round(((double)i * 63.0) / 7.0 / 2.0); + + rgb565_high[0][i] = round(((double)i * 31.0) / 7.0 / 2.0 + 15.5); + rgb565_high[1][i] = round(((double)i * 63.0) / 7.0 / 2.0 + 31.5); + } + +*/ + +uint8 rgb565_norm[2][8] = {{0 , 4, 9, 13, 18, 22, 27, 31}, + {0 , 9, 18, 27, 36, 45, 54, 63}}; +uint8 rgb565_half[2][8] = {{0 , 2, 4, 7, 9, 11, 13, 15}, + {0 , 4, 9, 13, 18, 22, 27, 31}}; +uint8 rgb565_high[2][8] = {{15, 18, 20, 22, 24, 27, 29, 31}, + {31, 36, 40, 45, 49, 54, 58, 63}}; + + +/*--------------------------------------------------------------------------*/ +/* Init, reset, shutdown routines */ +/*--------------------------------------------------------------------------*/ + +int render_init (void) +{ + int bx, ax, i; + + /* Allocate and align pixel look-up tables */ + if (lut_base == NULL) lut_base = malloc ((LUT_MAX * LUT_SIZE) + LUT_SIZE); + lut[0] = (uint8 *) (((uint32) lut_base + LUT_SIZE) & ~(LUT_SIZE - 1)); + for (i = 1; i < LUT_MAX; i += 1) lut[i] = lut[0] + (i * LUT_SIZE); + + /* Make pixel look-up table data */ + for (bx = 0; bx < 0x100; bx += 1) + for (ax = 0; ax < 0x100; ax += 1) + { + uint16 index = (bx << 8) | (ax); + lut[0][index] = make_lut_bg (bx, ax); + lut[1][index] = make_lut_obj (bx, ax); + lut[2][index] = make_lut_bg_ste (bx, ax); + lut[3][index] = make_lut_obj_ste (bx, ax); + lut[4][index] = make_lut_bgobj_ste (bx, ax); + } + + /* Make pixel data tables */ + for (i = 0; i < 0x200; i += 1) + { + int r, g, b; + + r = (i >> 6) & 7; + g = (i >> 3) & 7; + b = (i >> 0) & 7; + + pixel_8_lut[0][i] = MAKE_PIXEL_8(r>>1,g>>1,b>>1); + pixel_8_lut[1][i] = MAKE_PIXEL_8(r,g,b); + pixel_8_lut[2][i] = MAKE_PIXEL_8((r>>1)|4,(g>>1)|4,(b>>1)|4); + + pixel_15_lut[0][i] = MAKE_PIXEL_15(r,g,b); + pixel_15_lut[1][i] = MAKE_PIXEL_15(r<<1,g<<1,b<<1); + pixel_15_lut[2][i] = MAKE_PIXEL_15(r|8,g|8,b|8); + + /* RGB 565 format: we extrapolate each 3-bit value into a 5-bit (R,B) or 6-bit (G) value + this is needed to correctly cover full color range: [0-31] for R,B or [0-63] for G */ + pixel_16_lut[0][i] = MAKE_PIXEL_16(rgb565_half[0][r],rgb565_half[1][g],rgb565_half[0][b]); + pixel_16_lut[1][i] = MAKE_PIXEL_16(rgb565_norm[0][r],rgb565_norm[1][g],rgb565_norm[0][b]); + pixel_16_lut[2][i] = MAKE_PIXEL_16(rgb565_high[0][r],rgb565_high[1][g],rgb565_high[0][b]); + + pixel_32_lut[0][i] = MAKE_PIXEL_32(r,g,b); + pixel_32_lut[1][i] = MAKE_PIXEL_32(r<<1,g<<1,b<<1); + pixel_32_lut[2][i] = MAKE_PIXEL_32(r|8,g|8,b|8); + } + + /* Set up color update function */ + switch(bitmap.depth) + { + case 8: color_update = color_update_8; break; + case 15: color_update = color_update_15; break; + case 16: color_update = color_update_16; break; + case 32: color_update = color_update_32; break; + } + + /* Make sprite name look-up table */ + make_name_lut(); + + return (1); +} + +void make_name_lut(void) +{ + int col, row; + int vcol, vrow; + int width, height; + int flipx, flipy; + int i, name; + + memset (name_lut, 0, sizeof (name_lut)); + + for (i = 0; i < 0x400; i += 1) + { + vcol = col = i & 3; + vrow = row = (i >> 2) & 3; + height = (i >> 4) & 3; + width = (i >> 6) & 3; + flipx = (i >> 8) & 1; + flipy = (i >> 9) & 1; + + if(flipx) vcol = (width - col); + if(flipy) vrow = (height - row); + + name = vrow + (vcol * (height + 1)); + + if ((row > height) || col > width) name = -1; + + name_lut[i] = name; + } +} + +void render_reset(void) +{ + memset(&clip, 0, sizeof(clip)); + + memset(bg_buf, 0, sizeof(bg_buf)); + memset(tmp_buf, 0, sizeof(tmp_buf)); + memset(nta_buf, 0, sizeof(nta_buf)); + memset(ntb_buf, 0, sizeof(ntb_buf)); + memset(obj_buf, 0, sizeof(obj_buf)); + + memset(&pixel_8, 0, sizeof(pixel_8)); + memset(&pixel_15, 0, sizeof(pixel_15)); + memset(&pixel_16, 0, sizeof(pixel_16)); + memset(&pixel_32, 0, sizeof(pixel_32)); +} + + +void render_shutdown(void) +{ + if(lut_base) free(lut_base); +} + +/*--------------------------------------------------------------------------*/ +/* Line render function */ +/*--------------------------------------------------------------------------*/ + +void render_line(int line) +{ + uint8 *lb = tmp_buf; + int width = bitmap.viewport.w; + + if((reg[1] & 0x40) == 0x00) + { + memset(&lb[bitmap.viewport.x], 0x40 | border, width); + } + else + { + update_bg_pattern_cache(); + window_clip(line); + + if(im2_flag) + { + if (clip[0].enable) render_ntx_im2(0, line, nta_buf); + render_ntx_im2(1, line, ntb_buf); + if (clip[1].enable) render_ntw_im2(line, nta_buf); + } + else + { + if(reg[11] & 4) + { + if (clip[0].enable) render_ntx_vs(0, line, nta_buf); + render_ntx_vs(1, line, ntb_buf); + } + else + { + if (clip[0].enable) render_ntx(0, line, nta_buf); + render_ntx(1, line, ntb_buf); + } + if (clip[1].enable) render_ntw(line, nta_buf); + } + + if(reg[12] & 8) + { + merge(&nta_buf[0x20], &ntb_buf[0x20], &bg_buf[0x20], lut[2], width); + memset(&obj_buf[0x20], 0, width); + + if(im2_flag) render_obj_im2(line, obj_buf, lut[3]); + else render_obj(line, obj_buf, lut[3]); + + merge(&obj_buf[0x20], &bg_buf[0x20], &lb[0x20], lut[4], width); + } + else + { + merge(&nta_buf[0x20], &ntb_buf[0x20], &lb[0x20], lut[0], width); + if(im2_flag) render_obj_im2(line, lb, lut[1]); + else render_obj(line, lb, lut[1]); + } + } + + if(reg[0] & 0x20) + { + memset(&lb[bitmap.viewport.x], 0x40 | border, 0x08); + } + + void *out = (void *)&bitmap.data[(line * bitmap.pitch) + (bitmap.viewport.x * bitmap.granularity)]; + switch(bitmap.depth) + { + case 8: + remap_8(lb+0x20, (uint8 *)out, pixel_8, width); + break; + case 15: + remap_16(lb+0x20, (uint16 *)out, pixel_15, width); + break; + case 16: + remap_16(lb+0x20, (uint16 *)out, pixel_16, width); + break; + case 32: + remap_32(lb+0x20, (uint32 *)out, pixel_32, width); + break; + } + } + +/*--------------------------------------------------------------------------*/ +/* Window rendering */ +/*--------------------------------------------------------------------------*/ + +void render_ntw(int line, uint8 *buf) +{ + int column, v_line, width; + uint32 *nt, *src, *dst, atex, atbuf; + + v_line = (line & 7) << 3; + width = (reg[12] & 1) ? 7 : 6; + nt = (uint32 *)&vram[ntwb | ((line >> 3) << width)]; + dst = (uint32 *)&buf[0x20 + (clip[1].left << 4)]; + + for(column = clip[1].left; column < clip[1].right; column ++) + { + atbuf = nt[column]; + DRAW_COLUMN(atbuf, v_line) + } +} + +void render_ntw_im2(int line, uint8 *buf) +{ + int column, v_line, width; + uint32 *nt, *src, *dst, atex, atbuf, offs; + + v_line = ((line & 7) << 1 | ((status >> 4) & 1)) << 3; + width = (reg[12] & 1) ? 7 : 6; + nt = (uint32 *)&vram[ntwb | ((line >> 3) << width)]; + dst = (uint32 *)&buf[0x20 + (clip[1].left << 4)]; + + for(column = clip[1].left; column < clip[1].right; column ++) + { + atbuf = nt[column]; + DRAW_COLUMN_IM2(atbuf, v_line) + } +} + +/*--------------------------------------------------------------------------*/ +/* Background plane rendering */ +/*--------------------------------------------------------------------------*/ + +void render_ntx(int which, int line, uint8 *buf) +{ + int column; + int start, end; + int index; + int shift; + int v_line; + uint32 atex, atbuf, *src, *dst; + uint16 xscroll; + int y_scroll; + uint32 *nt; + uint32 *vs; + uint16 table[2] = {ntab,ntbb}; + uint8 xshift[2] = {0,2}; +#ifdef LSB_FIRST + uint8 vsr_shift[2] = {0,16}; +#else + uint8 vsr_shift[2] = {16,0}; +#endif + + get_hscroll(line, xshift[which], &xscroll); + shift = (xscroll & 0x0F); + index = playfield_col_mask + 1 - ((xscroll >> 4) & playfield_col_mask); + + if(which) + { + start = 0; + end = (reg[12] & 1) ? 20 : 16; + } + else + { + start = clip[0].left; + end = clip[0].right; + index = (index + clip[0].left) & playfield_col_mask; + } + + vs = (uint32 *)&vsram[0]; + y_scroll = (vs[0] >> vsr_shift[which]) & 0x3FF; + y_scroll = (line + y_scroll) & playfield_row_mask; + v_line = (y_scroll & 7) << 3; + nt = (uint32 *)&vram[table[which] + (((y_scroll >> 3) << playfield_shift) & y_mask)]; + + if(shift) + { + dst = (uint32 *)&buf[0x10 + shift + (start<<4)]; + + /* Window bug */ + if (start) atbuf = nt[(index) & playfield_col_mask]; + else atbuf = nt[(index-1) & playfield_col_mask]; + + DRAW_COLUMN(atbuf, v_line); + } + + dst = (uint32 *)&buf[0x20 + shift + (start<<4)]; + + for(column = start; column < end; column ++, index ++) + { + atbuf = nt[index & playfield_col_mask]; + DRAW_COLUMN(atbuf, v_line) + } +} + +void render_ntx_im2(int which, int line, uint8 *buf) +{ + int column; + int start, end; + int index; + int shift; + int v_line; + uint32 atex, atbuf, *src, *dst; + uint16 xscroll; + int y_scroll; + uint32 *nt; + uint32 *vs; + uint32 offs; + uint16 table[2] = {ntab,ntbb}; + uint8 xshift[2] = {0,2}; +#ifdef LSB_FIRST + uint8 vsr_shift[2] = {1,17}; +#else + uint8 vsr_shift[2] = {17,1}; +#endif + + get_hscroll(line, xshift[which], &xscroll); + shift = (xscroll & 0x0F); + index = playfield_col_mask + 1 - ((xscroll >> 4) & playfield_col_mask); + + if(which) + { + start = 0; + end = (reg[0x0C] & 1) ? 20 : 16; + } + else + { + start = clip[0].left; + end = clip[0].right; + index = (index + clip[0].left) & playfield_col_mask; + } + + vs = (uint32 *)&vsram[0]; + y_scroll = (vs[0] >> vsr_shift[which]) & 0x3FF; + y_scroll = (line + y_scroll) & playfield_row_mask; + v_line = (((y_scroll & 7) << 1) | ((status >> 4) & 1)) << 3; + nt = (uint32 *)&vram[table[which] + (((y_scroll >> 3) << playfield_shift) & y_mask)]; + + if(shift) + { + dst = (uint32 *)&buf[0x10 + shift + (start<<4)]; + + /* Window bug */ + if (start) atbuf = nt[(index) & playfield_col_mask]; + else atbuf = nt[(index-1) & playfield_col_mask]; + + DRAW_COLUMN(atbuf, v_line); + } + + dst = (uint32 *)&buf[0x20 + shift + (start<<4)]; + for(column = start; column < end; column ++, index ++) + { + atbuf = nt[index & playfield_col_mask]; + DRAW_COLUMN_IM2(atbuf, v_line) + } +} + +void render_ntx_vs(int which, int line, uint8 *buf) +{ + int column; + int start, end; + int index; + int shift; + int v_line; + uint32 atex, atbuf, *src, *dst; + uint16 xscroll; + int y_scroll; + uint32 *nt; + uint32 *vs; + uint16 table[2] = {ntab,ntbb}; + uint8 xshift[2] = {0,2}; +#ifdef LSB_FIRST + uint8 vsr_shift[2] = {0,16}; +#else + uint8 vsr_shift[2] = {16,0}; +#endif + + get_hscroll(line, xshift[which], &xscroll); + shift = (xscroll & 0x0F); + index = playfield_col_mask + 1 - ((xscroll >> 4) & playfield_col_mask); + + if(which) + { + start = 0; + end = (reg[0x0C] & 1) ? 20 : 16; + } + else + { + start = clip[0].left; + end = clip[0].right; + index = (index + clip[0].left) & playfield_col_mask; + } + + vs = (uint32 *)&vsram[0]; + + if(shift) + { + dst = (uint32 *)&buf[0x10 + shift + (start<<4)]; + y_scroll = (line & playfield_row_mask); + v_line = (y_scroll & 7) << 3; + nt = (uint32 *)&vram[table[which] + (((y_scroll >> 3) << playfield_shift) & y_mask)]; + + /* Window bug */ + if (start) atbuf = nt[(index) & playfield_col_mask]; + else atbuf = nt[(index-1) & playfield_col_mask]; + + DRAW_COLUMN(atbuf, v_line); + } + + dst = (uint32 *)&buf[0x20 + shift + (start<<4)]; + + for(column = start; column < end; column ++, index ++) + { + y_scroll = (vs[column] >> vsr_shift[which]) & 0x3FF; + y_scroll = (line + y_scroll) & playfield_row_mask; + v_line = (y_scroll & 7) << 3; + nt = (uint32 *)&vram[table[which] + (((y_scroll >> 3) << playfield_shift) & y_mask)]; + atbuf = nt[index & playfield_col_mask]; + DRAW_COLUMN(atbuf, v_line) + } +} + +/*--------------------------------------------------------------------------*/ +/* Helper functions (cache update, hscroll, window clip) */ +/*--------------------------------------------------------------------------*/ + +void update_bg_pattern_cache(void) +{ + int i; + uint8 x, y, c; + uint16 name; +#ifdef LSB_FIRST + uint8 shift_table[8] = {12, 8, 4, 0, 28, 24, 20, 16}; + #else + uint8 shift_table[8] = {28, 24, 20, 16, 12, 8, 4, 0}; + #endif + + if(!bg_list_index) return; + + for(i = 0; i < bg_list_index; i ++) + { + name = bg_name_list[i]; + bg_name_list[i] = 0; + + for(y = 0; y < 8; y ++) + { + if(bg_name_dirty[name] & (1 << y)) + { + uint8 *dst = &bg_pattern_cache[name << 6]; + uint32 bp = *(uint32 *)&vram[(name << 5) | (y << 2)]; + + for(x = 0; x < 8; x ++) + { + c = (bp >> shift_table[x]) & 0x0F; + dst[0x00000 | (y << 3) | (x)] = (c); /* hf=0, vf=0: normal */ + dst[0x20000 | (y << 3) | (x ^ 7)] = (c); /* hf=1, vf=0: horizontal flipped */ + dst[0x40000 | ((y ^ 7) << 3) | (x)] = (c); /* hf=0, vf=1: vertical flipped */ + dst[0x60000 | ((y ^ 7) << 3) | (x ^ 7)] = (c); /* hf=1, vf=1: horizontal & vertical flipped */ + } + } + } + bg_name_dirty[name] = 0; + } + bg_list_index = 0; +} + +void get_hscroll(int line, int shift, uint16 *scroll) +{ + switch(reg[11] & 3) + { + case 0: /* Full-screen */ + *scroll = *(uint16 *)&vram[hscb + shift]; + break; + + case 1: /* First 8 lines */ + *scroll = *(uint16 *)&vram[hscb + ((line & 7) << 2) + shift]; + break; + + case 2: /* Every 8 lines */ + *scroll = *(uint16 *)&vram[hscb + ((line & ~7) << 2) + shift]; + break; + + case 3: /* Every line */ + *scroll = *(uint16 *)&vram[hscb + (line << 2) + shift]; + break; + } + + *scroll &= 0x03FF; +} + +void window_clip(int line) +{ + /* Window size and invert flags */ + int hp = (reg[17] & 0x1F); + int hf = (reg[17] >> 7) & 1; + int vp = (reg[18] & 0x1F) << 3; + int vf = (reg[18] >> 7) & 1; + + /* Display size */ + int sw = (reg[12] & 1) ? 20 : 16; + + /* Clear clipping data */ + memset(&clip, 0, sizeof(clip)); + + /* Check if line falls within window range */ + if(vf == (line >= vp)) + { + /* Window takes up entire line */ + clip[1].right = sw; + clip[1].enable = 1; + } + else + { + /* Perform horizontal clipping; the results are applied in reverse + if the horizontal inversion flag is set */ + int a = hf; + int w = hf ^ 1; + + if(hp) + { + if(hp > sw) + { + /* Plane W takes up entire line */ + clip[w].right = sw; + clip[w].enable = 1; + } + else + { + /* Window takes left side, Plane A takes right side */ + clip[w].right = hp; + clip[a].left = hp; + clip[a].right = sw; + clip[0].enable = clip[1].enable = 1; + } + } + else + { + /* Plane A takes up entire line */ + clip[a].right = sw; + clip[a].enable = 1; + } + } +} + + +/*--------------------------------------------------------------------------*/ +/* Look-up table functions (handles priority between layers pixels) */ +/*--------------------------------------------------------------------------*/ + +/* Input (bx): d5-d0=color, d6=priority, d7=unused */ +/* Input (ax): d5-d0=color, d6=priority, d7=unused */ +/* Output: d5-d0=color, d6=priority, d7=unused */ +int make_lut_bg(int bx, int ax) +{ + int bf, bp, b; + int af, ap, a; + int x = 0; + int c; + + bf = (bx & 0x7F); + bp = (bx >> 6) & 1; + b = (bx & 0x0F); + + af = (ax & 0x7F); + ap = (ax >> 6) & 1; + a = (ax & 0x0F); + + c = (ap ? (a ? af : (b ? bf : x)) : \ + (bp ? (b ? bf : (a ? af : x)) : \ + ( (a ? af : (b ? bf : x)) ))); + + /* Strip palette bits from transparent pixels */ + if((c & 0x0F) == 0x00) c &= 0xC0; + + return (c); +} + + +/* Input (bx): d5-d0=color, d6=priority, d7=sprite pixel marker */ +/* Input (sx): d5-d0=color, d6=priority, d7=unused */ +/* Output: d5-d0=color, d6=zero, d7=sprite pixel marker */ +int make_lut_obj(int bx, int sx) +{ + int bf, bp, bs, b; + int sf, sp, s; + int c; + + bf = (bx & 0x3F); + bs = (bx >> 7) & 1; + bp = (bx >> 6) & 1; + b = (bx & 0x0F); + + sf = (sx & 0x3F); + sp = (sx >> 6) & 1; + s = (sx & 0x0F); + + if(s == 0) return bx; + + if(bs) + { + c = bf; /* previous sprite has higher priority */ + } + else + { + c = (sp ? (s ? sf : bf) : \ + (bp ? (b ? bf : (s ? sf : bf)) : \ + (s ? sf : bf) )); + } + + /* Strip palette bits from transparent pixels */ + if((c & 0x0F) == 0x00) c &= 0xC0; + + return (c | 0x80); +} + + +/* Input (bx): d5-d0=color, d6=priority, d7=unused */ +/* Input (sx): d5-d0=color, d6=priority, d7=unused */ +/* Output: d5-d0=color, d6=priority, d7=intensity select (half/normal) */ +int make_lut_bg_ste(int bx, int ax) +{ + int bf, bp, b; + int af, ap, a; + int gi; + int x = 0; + int c; + + bf = (bx & 0x7F); + bp = (bx >> 6) & 1; + b = (bx & 0x0F); + + af = (ax & 0x7F); + ap = (ax >> 6) & 1; + a = (ax & 0x0F); + + gi = (ap | bp) ? 0x80 : 0x00; + + c = (ap ? (a ? af : (b ? bf : x)) : + (bp ? (b ? bf : (a ? af : x)) : ((a ? af : (b ? bf : x))))); + + c |= gi; + + /* Strip palette bits from transparent pixels */ + if((c & 0x0F) == 0x00) c &= 0xC0; + + return (c); +} + + +/* Input (bx): d5-d0=color, d6=priority, d7=sprite pixel marker */ +/* Input (sx): d5-d0=color, d6=priority, d7=unused */ +/* Output: d5-d0=color, d6=priority, d7=sprite pixel marker */ +int make_lut_obj_ste(int bx, int sx) +{ + int bf, bs; + int sf; + int c; + + bf = (bx & 0x7F); + bs = (bx >> 7) & 1; + sf = (sx & 0x7F); + + if((sx & 0x0F) == 0) return bx; + + c = (bs) ? bf : sf; + + /* Strip palette bits from transparent pixels */ + if((c & 0x0F) == 0x00) c &= 0xC0; + + return (c | 0x80); +} + + +/* Input (bx): d5-d0=color, d6=priority, d7=intensity (half/normal) */ +/* Input (sx): d5-d0=color, d6=priority, d7=sprite marker */ +/* Output: d5-d0=color, d6=intensity (half/normal), d7=(double/invalid) */ +int make_lut_bgobj_ste(int bx, int sx) +{ + int c; + + int bf = (bx & 0x3F); + int bp = (bx >> 6) & 1; + int bi = (bx & 0x80) ? 0x40 : 0x00; + int b = (bx & 0x0F); + + int sf = (sx & 0x3F); + int sp = (sx >> 6) & 1; + int si = (sx & 0x40); + int s = (sx & 0x0F); + + if(bi & 0x40) si |= 0x40; + + if(sp) + { + if(s) + { + if((sf & 0x3E) == 0x3E) + { + if(sf & 1) + { + c = (bf | 0x00); + } + else + { + c = (bx & 0x80) ? (bf | 0x80) : (bf | 0x40); + } + } + else + { + if(sf == 0x0E || sf == 0x1E || sf == 0x2E) + { + c = (sf | 0x40); + } + else + { + c = (sf | si); + } + } + } + else + { + c = (bf | bi); + } + } + else + { + if(bp) + { + if(b) + { + c = (bf | bi); + } + else + { + if(s) + { + if((sf & 0x3E) == 0x3E) + { + if(sf & 1) + { + c = (bf | 0x00); + } + else + { + c = (bx & 0x80) ? (bf | 0x80) : (bf | 0x40); + } + } + else + { + if(sf == 0x0E || sf == 0x1E || sf == 0x2E) + { + c = (sf | 0x40); + } + else + { + c = (sf | si); + } + } + } + else + { + c = (bf | bi); + } + } + } + else + { + if(s) + { + if((sf & 0x3E) == 0x3E) + { + if(sf & 1) + { + c = (bf | 0x00); + } + else + { + c = (bx & 0x80) ? (bf | 0x80) : (bf | 0x40); + } + } + else + { + if(sf == 0x0E || sf == 0x1E || sf == 0x2E) + { + c = (sf | 0x40); + } + else + { + c = (sf | si); + } + } + } + else + { + c = (bf | bi); + } + } + } + + if((c & 0x0f) == 0x00) c &= 0xC0; + + return (c); +} + +/*--------------------------------------------------------------------------*/ +/* Remap functions */ +/*--------------------------------------------------------------------------*/ + +void remap_8(uint8 *src, uint8 *dst, uint8 *table, int length) +{ + int count; + for(count = 0; count < length; count += 1) + { + *dst++ = table[*src++]; + } +} + +void remap_16(uint8 *src, uint16 *dst, uint16 *table, int length) +{ + int count; + for(count = 0; count < length; count += 1) + { + *dst++ = table[*src++]; + } +} + +void remap_32(uint8 *src, uint32 *dst, uint32 *table, int length) +{ + int count; + for(count = 0; count < length; count += 1) + { + *dst++ = table[*src++]; + } +} + +/*--------------------------------------------------------------------------*/ +/* Merge functions */ +/*--------------------------------------------------------------------------*/ + +void merge(uint8 *srca, uint8 *srcb, uint8 *dst, uint8 *table, int width) +{ + int i; + for(i = 0; i < width; i += 1) + { + uint8 a = srca[i]; + uint8 b = srcb[i]; + uint8 c = table[(b << 8) | (a)]; + dst[i] = c; + } +} + +/*--------------------------------------------------------------------------*/ +/* Color update functions */ +/*--------------------------------------------------------------------------*/ + +void color_update_8(int index, uint16 data) +{ + if(reg[12] & 8) + { + pixel_8[0x00 | index] = pixel_8_lut[0][data]; + pixel_8[0x40 | index] = pixel_8_lut[1][data]; + pixel_8[0x80 | index] = pixel_8_lut[2][data]; + } + else + { + uint8 temp = pixel_8_lut[1][data]; + pixel_8[0x00 | index] = temp; + pixel_8[0x40 | index] = temp; + pixel_8[0x80 | index] = temp; + } +} + +void color_update_15(int index, uint16 data) +{ + if(reg[12] & 8) + { + pixel_15[0x00 | index] = pixel_15_lut[0][data]; + pixel_15[0x40 | index] = pixel_15_lut[1][data]; + pixel_15[0x80 | index] = pixel_15_lut[2][data]; + } + else + { + uint16 temp = pixel_15_lut[1][data]; + pixel_15[0x00 | index] = temp; + pixel_15[0x40 | index] = temp; + pixel_15[0x80 | index] = temp; + } +} + +void color_update_16(int index, uint16 data) +{ + if(reg[12] & 8) + { + pixel_16[0x00 | index] = pixel_16_lut[0][data]; + pixel_16[0x40 | index] = pixel_16_lut[1][data]; + pixel_16[0x80 | index] = pixel_16_lut[2][data]; + } + else + { + uint16 temp = pixel_16_lut[1][data]; + pixel_16[0x00 | index] = temp; + pixel_16[0x40 | index] = temp; + pixel_16[0x80 | index] = temp; + } +} + +void color_update_32(int index, uint16 data) +{ + if(reg[12] & 8) + { + pixel_32[0x00 | index] = pixel_32_lut[0][data]; + pixel_32[0x40 | index] = pixel_32_lut[1][data]; + pixel_32[0x80 | index] = pixel_32_lut[2][data]; + } + else + { + uint32 temp = pixel_32_lut[1][data]; + pixel_32[0x00 | index] = temp; + pixel_32[0x40 | index] = temp; + pixel_32[0x80 | index] = temp; + } +} + +/*--------------------------------------------------------------------------*/ +/* Object render functions */ +/*--------------------------------------------------------------------------*/ + +void parse_satb(int line) +{ + static uint8 sizetab[] = {8, 16, 24, 32}; + uint8 link = 0; + uint16 *p, *q; + uint16 ypos; + uint8 size; + int count; + int height; + + int limit = (reg[12] & 1) ? 20 : 16; + int total = (reg[12] & 1) ? 80 : 64; + + object_index_count = 0; + + for(count = 0; count < total; count += 1) + { + q = (uint16 *) &sat[link << 3]; + + ypos = q[0]; + if(im2_flag) ypos = (ypos >> 1) & 0x1FF; + else ypos &= 0x1FF; + + size = q[1] >> 8; + height = sizetab[size & 3]; + + if((line >= ypos) && (line < (ypos + height))) + { + /* sprite limit (max. 16 or 20 sprites displayed per line) */ + if(object_index_count == limit) + { + if(vint_pending == 0) status |= 0x40; + return; + } + + // using xpos from internal satb stops sprite x + // scrolling in bloodlin.bin, + // but this seems to go against the test prog + p = (uint16 *) &vram[satb + (link << 3)]; + object_info[object_index_count].ypos = q[0]; + object_info[object_index_count].xpos = p[3]; + object_info[object_index_count].attr = p[2]; + object_info[object_index_count].size = size; + object_info[object_index_count].index = count; + object_index_count += 1; + } + + link = q[1] & 0x7F; + if(link == 0) break; + } +} + +void render_obj(int line, uint8 *buf, uint8 *table) +{ + uint16 ypos; + uint16 attr; + uint16 xpos; + uint8 sizetab[] = {8, 16, 24, 32}; + uint8 size; + uint8 *src; + + int count; + int pixelcount = 0; + int width; + int height; + int v_line; + int column; + int sol_flag = 0; + int left = 0x80; + int right = 0x80 + bitmap.viewport.w; + int i; + + uint8 *s, *lb; + uint16 name, index; + uint8 palette; + + int attr_mask, nt_row; + + for(count = 0; count < object_index_count; count += 1) + { + xpos = object_info[count].xpos; + xpos &= 0x1ff; + + /* sprite masking */ + if(xpos != 0) sol_flag = 1; + else if(xpos == 0 && sol_flag) return; + + size = object_info[count].size & 0x0f; + width = sizetab[(size >> 2) & 3]; + + /* update pixel count (off-screen sprites included) */ + pixelcount += width; + + if(((xpos + width) >= left) && (xpos < right)) + { + ypos = object_info[count].ypos; + ypos &= 0x1ff; + attr = object_info[count].attr; + attr_mask = (attr & 0x1800); + + height = sizetab[size & 3]; + palette = (attr >> 9) & 0x70; + + v_line = (line - ypos); + nt_row = (v_line >> 3) & 3; + v_line = (v_line & 7) << 3; + + name = (attr & 0x07FF); + s = &name_lut[((attr >> 3) & 0x300) | (size << 4) | (nt_row << 2)]; + + lb = (uint8 *)&buf[0x20 + (xpos - 0x80)]; + + /* number of tiles to draw */ + width >>= 3; + + for(column = 0; column < width; column += 1, lb+=8) + { + index = attr_mask | ((name + s[column]) & 0x07FF); + src = &bg_pattern_cache[(index << 6) | (v_line)]; + DRAW_SPRITE_TILE; + } + + } + + /* sprite limit (256 or 320 pixels) */ + if (pixelcount >= bitmap.viewport.w) return; + + } +} + +void render_obj_im2(int line, uint8 *buf, uint8 *table) +{ + uint16 ypos; + uint16 attr; + uint16 xpos; + uint8 sizetab[] = {8, 16, 24, 32}; + uint8 size; + uint8 *src; + + int count; + int pixelcount = 0; + int width; + int height; + int v_line; + int column; + int sol_flag = 0; + int left = 0x80; + int right = 0x80 + bitmap.viewport.w; + int i; + + uint8 *s, *lb; + uint16 name, index; + uint8 palette; + uint32 offs; + + int attr_mask, nt_row; + + for(count = 0; count < object_index_count; count += 1) + { + xpos = object_info[count].xpos; + xpos &= 0x1ff; + + /* sprite masking */ + if(xpos != 0) sol_flag = 1; + else if(xpos == 0 && sol_flag) return; + + size = object_info[count].size & 0x0f; + width = sizetab[(size >> 2) & 3]; + + /* update pixel count (off-screen sprites included) */ + pixelcount += width; + + if(((xpos + width) >= left) && (xpos < right)) + { + ypos = object_info[count].ypos; + ypos = (ypos >> 1) & 0x1ff; + attr = object_info[count].attr; + attr_mask = (attr & 0x1800); + + height = sizetab[size & 3]; + palette = (attr >> 9) & 0x70; + + v_line = (line - ypos); + nt_row = (v_line >> 3) & 3; + v_line = (((v_line & 7) << 1) | ((status >> 4) & 1)) << 3; + + name = (attr & 0x03FF); + s = &name_lut[((attr >> 3) & 0x300) | (size << 4) | (nt_row << 2)]; + + lb = (uint8 *)&buf[0x20 + (xpos - 0x80)]; + + /* number of tiles to draw */ + width >>= 3; + + for(column = 0; column < width; column += 1, lb+=8) + { + index = (name + s[column]) & 0x3ff; + offs = index << 7 | attr_mask << 6 | v_line; + if(attr & 0x1000) offs ^= 0x40; + src = &bg_pattern_cache[offs]; + DRAW_SPRITE_TILE; + } + } + + /* sprite limit (256 or 320 pixels) */ + if (pixelcount >= bitmap.viewport.w) return; + } +} + diff --git a/source/render.h b/source/render.h new file mode 100644 index 0000000..50cdd32 --- /dev/null +++ b/source/render.h @@ -0,0 +1,53 @@ + +#ifndef _RENDER_H_ +#define _RENDER_H_ + + +/* Look-up pixel table information */ +#define LUT_MAX (5) +#define LUT_SIZE (0x10000) + +/* Clip structure */ +typedef struct +{ + uint8 left; + uint8 right; + uint8 enable; +}clip_t; + +/* Function prototypes */ +int render_init(void); +void render_reset(void); +void render_shutdown(void); +void render_line(int line); +void render_obj(int line, uint8 *buf, uint8 *table); +void render_obj_im2(int line, uint8 *buf, uint8 *table); +void render_ntw(int line, uint8 *buf); +void render_ntw_im2(int line, uint8 *buf); +void render_ntx(int which, int line, uint8 *buf); +void render_ntx_im2(int which, int line, uint8 *buf); +void render_ntx_vs(int which, int line, uint8 *buf); +void update_bg_pattern_cache(void); +void get_hscroll(int line, int shift, uint16 *scroll); +void window_clip(int line); +int make_lut_bg(int bx, int ax); +int make_lut_obj(int bx, int sx); +int make_lut_bg_ste(int bx, int ax); +int make_lut_obj_ste(int bx, int sx); +int make_lut_bgobj_ste(int bx, int sx); +void remap_8(uint8 *src, uint8 *dst, uint8 *table, int length); +void remap_16(uint8 *src, uint16 *dst, uint16 *table, int length); +void remap_32(uint8 *src, uint32 *dst, uint32 *table, int length); +void merge(uint8 *srca, uint8 *srcb, uint8 *dst, uint8 *table, int width); +void color_update_8(int index, uint16 data); +void color_update_15(int index, uint16 data); +void color_update_16(int index, uint16 data); +void color_update_32(int index, uint16 data); +void make_name_lut(void); +void parse_satb(int line); + +/* global variables */ +extern uint8 object_index_count; + +#endif /* _RENDER_H_ */ + diff --git a/source/shared.h b/source/shared.h new file mode 100644 index 0000000..55035a4 --- /dev/null +++ b/source/shared.h @@ -0,0 +1,43 @@ +#ifndef _SHARED_H_ +#define _SHARED_H_ + + +#include +#include +#include + +#include "types.h" +#include "macros.h" +#include "m68k.h" +#include "z80.h" +#include "genesis.h" +#include "vdp.h" +#include "render.h" +#include "mem68k.h" +#include "memz80.h" +#include "membnk.h" +#include "memvdp.h" +#include "system.h" +#ifndef NGC +#include "unzip.h" +#include "fileio.h" +#include "loadrom.h" +#endif +#include "io.h" +#include "input.h" +#include "sound.h" +#include "fm.h" +#include "sn76496.h" +#include "osd.h" +#include "state.h" +#include "sram.h" +#include "eeprom.h" +#include "ssf2tnc.h" +#include "sn76489.h" +#include "ym2612.h" + +extern uint8 FM_GENS; +extern uint8 PSG_MAME; + +#endif /* _SHARED_H_ */ + diff --git a/source/sound/fm.c b/source/sound/fm.c new file mode 100644 index 0000000..eaabaa5 --- /dev/null +++ b/source/sound/fm.c @@ -0,0 +1,4745 @@ +#define YM2610B_WARNING + +/* +** +** File: fm.c -- software implementation of Yamaha FM sound generator +** +** Copyright (C) 2001, 2002, 2003 Jarek Burczynski (bujar at mame dot net) +** Copyright (C) 1998 Tatsuyuki Satoh , MultiArcadeMachineEmulator development +** +** Version 1.4 (final beta) +** +*/ + +/* +** History: +** +** 03-08-2003 Jarek Burczynski: +** - fixed YM2608 initial values (after the reset) +** - fixed flag and irqmask handling (YM2608) +** - fixed BUFRDY flag handling (YM2608) +** +** 14-06-2003 Jarek Burczynski: +** - implemented all of the YM2608 status register flags +** - implemented support for external memory read/write via YM2608 +** - implemented support for deltat memory limit register in YM2608 emulation +** +** 22-05-2003 Jarek Burczynski: +** - fixed LFO PM calculations (copy&paste bugfix) +** +** 08-05-2003 Jarek Burczynski: +** - fixed SSG support +** +** 22-04-2003 Jarek Burczynski: +** - implemented 100% correct LFO generator (verified on real YM2610 and YM2608) +** +** 15-04-2003 Jarek Burczynski: +** - added support for YM2608's register 0x110 - status mask +** +** 01-12-2002 Jarek Burczynski: +** - fixed register addressing in YM2608, YM2610, YM2610B chips. (verified on real YM2608) +** The addressing patch used for early Neo-Geo games can be removed now. +** +** 26-11-2002 Jarek Burczynski, Nicola Salmoria: +** - recreated YM2608 ADPCM ROM using data from real YM2608's output which leads to: +** - added emulation of YM2608 drums. +** - output of YM2608 is two times lower now - same as YM2610 (verified on real YM2608) +** +** 16-08-2002 Jarek Burczynski: +** - binary exact Envelope Generator (verified on real YM2203); +** identical to YM2151 +** - corrected 'off by one' error in feedback calculations (when feedback is off) +** - corrected connection (algorithm) calculation (verified on real YM2203 and YM2610) +** +** 18-12-2001 Jarek Burczynski: +** - added SSG-EG support (verified on real YM2203) +** +** 12-08-2001 Jarek Burczynski: +** - corrected sin_tab and tl_tab data (verified on real chip) +** - corrected feedback calculations (verified on real chip) +** - corrected phase generator calculations (verified on real chip) +** - corrected envelope generator calculations (verified on real chip) +** - corrected FM volume level (YM2610 and YM2610B). +** - changed YMxxxUpdateOne() functions (YM2203, YM2608, YM2610, YM2610B, YM2612) : +** this was needed to calculate YM2610 FM channels output correctly. +** (Each FM channel is calculated as in other chips, but the output of the channel +** gets shifted right by one *before* sending to accumulator. That was impossible to do +** with previous implementation). +** +** 23-07-2001 Jarek Burczynski, Nicola Salmoria: +** - corrected YM2610 ADPCM type A algorithm and tables (verified on real chip) +** +** 11-06-2001 Jarek Burczynski: +** - corrected end of sample bug in ADPCMA_calc_cha(). +** Real YM2610 checks for equality between current and end addresses (only 20 LSB bits). +** +** 08-12-98 hiro-shi: +** rename ADPCMA -> ADPCMB, ADPCMB -> ADPCMA +** move ROM limit check.(CALC_CH? -> 2610Write1/2) +** test program (ADPCMB_TEST) +** move ADPCM A/B end check. +** ADPCMB repeat flag(no check) +** change ADPCM volume rate (8->16) (32->48). +** +** 09-12-98 hiro-shi: +** change ADPCM volume. (8->16, 48->64) +** replace ym2610 ch0/3 (YM-2610B) +** change ADPCM_SHIFT (10->8) missing bank change 0x4000-0xffff. +** add ADPCM_SHIFT_MASK +** change ADPCMA_DECODE_MIN/MAX. +*/ + + + + +/************************************************************************/ +/* comment of hiro-shi(Hiromitsu Shioya) */ +/* YM2610(B) = OPN-B */ +/* YM2610 : PSG:3ch FM:4ch ADPCM(18.5KHz):6ch DeltaT ADPCM:1ch */ +/* YM2610B : PSG:3ch FM:6ch ADPCM(18.5KHz):6ch DeltaT ADPCM:1ch */ +/************************************************************************/ + +#include +#include +#include +#include +#include + +#if 0 +#ifndef __RAINE__ +#include "sndintrf.h" /* use M.A.M.E. */ +#else +#include "deftypes.h" /* use RAINE */ +#include "support.h" /* use RAINE */ +#endif +#include "ay8910.h" +#endif + +#include "fm.h" + + +/* include external DELTA-T unit (when needed) */ +#if (BUILD_YM2608||BUILD_YM2610||BUILD_YM2610B) + #include "ymdeltat.h" +#endif + +/* shared function building option */ +#define BUILD_OPN (BUILD_YM2203||BUILD_YM2608||BUILD_YM2610||BUILD_YM2610B||BUILD_YM2612) +#define BUILD_OPN_PRESCALER (BUILD_YM2203||BUILD_YM2608) + + +/* globals */ +#define TYPE_SSG 0x01 /* SSG support */ +#define TYPE_LFOPAN 0x02 /* OPN type LFO and PAN */ +#define TYPE_6CH 0x04 /* FM 6CH / 3CH */ +#define TYPE_DAC 0x08 /* YM2612's DAC device */ +#define TYPE_ADPCM 0x10 /* two ADPCM units */ + + +#define TYPE_YM2203 (TYPE_SSG) +#define TYPE_YM2608 (TYPE_SSG |TYPE_LFOPAN |TYPE_6CH |TYPE_ADPCM) +#define TYPE_YM2610 (TYPE_SSG |TYPE_LFOPAN |TYPE_6CH |TYPE_ADPCM) +#define TYPE_YM2612 (TYPE_DAC |TYPE_LFOPAN |TYPE_6CH) + + + +#define FREQ_SH 16 /* 16.16 fixed point (frequency calculations) */ +#define EG_SH 16 /* 16.16 fixed point (envelope generator timing) */ +#define LFO_SH 24 /* 8.24 fixed point (LFO calculations) */ +#define TIMER_SH 16 /* 16.16 fixed point (timers calculations) */ + +#define FREQ_MASK ((1<>3) + +/* sin waveform table in 'decibel' scale */ +static unsigned int sin_tab[SIN_LEN]; + +/* sustain level table (3dB per step) */ +/* bit0, bit1, bit2, bit3, bit4, bit5, bit6 */ +/* 1, 2, 4, 8, 16, 32, 64 (value)*/ +/* 0.75, 1.5, 3, 6, 12, 24, 48 (dB)*/ + +/* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/ +#define SC(db) (UINT32) ( db * (4.0/ENV_STEP) ) +static const UINT32 sl_table[16]={ + SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7), + SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(31) +}; +#undef SC + + +#define RATE_STEPS (8) +static const UINT8 eg_inc[19*RATE_STEPS]={ + +/*cycle:0 1 2 3 4 5 6 7*/ + +/* 0 */ 0,1, 0,1, 0,1, 0,1, /* rates 00..11 0 (increment by 0 or 1) */ +/* 1 */ 0,1, 0,1, 1,1, 0,1, /* rates 00..11 1 */ +/* 2 */ 0,1, 1,1, 0,1, 1,1, /* rates 00..11 2 */ +/* 3 */ 0,1, 1,1, 1,1, 1,1, /* rates 00..11 3 */ + +/* 4 */ 1,1, 1,1, 1,1, 1,1, /* rate 12 0 (increment by 1) */ +/* 5 */ 1,1, 1,2, 1,1, 1,2, /* rate 12 1 */ +/* 6 */ 1,2, 1,2, 1,2, 1,2, /* rate 12 2 */ +/* 7 */ 1,2, 2,2, 1,2, 2,2, /* rate 12 3 */ + +/* 8 */ 2,2, 2,2, 2,2, 2,2, /* rate 13 0 (increment by 2) */ +/* 9 */ 2,2, 2,4, 2,2, 2,4, /* rate 13 1 */ +/*10 */ 2,4, 2,4, 2,4, 2,4, /* rate 13 2 */ +/*11 */ 2,4, 4,4, 2,4, 4,4, /* rate 13 3 */ + +/*12 */ 4,4, 4,4, 4,4, 4,4, /* rate 14 0 (increment by 4) */ +/*13 */ 4,4, 4,8, 4,4, 4,8, /* rate 14 1 */ +/*14 */ 4,8, 4,8, 4,8, 4,8, /* rate 14 2 */ +/*15 */ 4,8, 8,8, 4,8, 8,8, /* rate 14 3 */ + +/*16 */ 8,8, 8,8, 8,8, 8,8, /* rates 15 0, 15 1, 15 2, 15 3 (increment by 8) */ +/*17 */ 16,16,16,16,16,16,16,16, /* rates 15 2, 15 3 for attack */ +/*18 */ 0,0, 0,0, 0,0, 0,0, /* infinity rates for attack and decay(s) */ +}; + + +#define O(a) (a*RATE_STEPS) + +/*note that there is no O(17) in this table - it's directly in the code */ +static const UINT8 eg_rate_select[32+64+32]={ /* Envelope Generator rates (32 + 64 rates + 32 RKS) */ +/* 32 infinite time rates */ +O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), +O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), +O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), +O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), + +/* rates 00-11 */ +O( 0),O( 1),O( 2),O( 3), +O( 0),O( 1),O( 2),O( 3), +O( 0),O( 1),O( 2),O( 3), +O( 0),O( 1),O( 2),O( 3), +O( 0),O( 1),O( 2),O( 3), +O( 0),O( 1),O( 2),O( 3), +O( 0),O( 1),O( 2),O( 3), +O( 0),O( 1),O( 2),O( 3), +O( 0),O( 1),O( 2),O( 3), +O( 0),O( 1),O( 2),O( 3), +O( 0),O( 1),O( 2),O( 3), +O( 0),O( 1),O( 2),O( 3), + +/* rate 12 */ +O( 4),O( 5),O( 6),O( 7), + +/* rate 13 */ +O( 8),O( 9),O(10),O(11), + +/* rate 14 */ +O(12),O(13),O(14),O(15), + +/* rate 15 */ +O(16),O(16),O(16),O(16), + +/* 32 dummy rates (same as 15 3) */ +O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16), +O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16), +O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16), +O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16) + +}; +#undef O + +/*rate 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15*/ +/*shift 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0 */ +/*mask 2047, 1023, 511, 255, 127, 63, 31, 15, 7, 3, 1, 0, 0, 0, 0, 0 */ + +#define O(a) (a*1) +static const UINT8 eg_rate_shift[32+64+32]={ /* Envelope Generator counter shifts (32 + 64 rates + 32 RKS) */ +/* 32 infinite time rates */ +O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), +O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), +O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), +O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), + +/* rates 00-11 */ +O(11),O(11),O(11),O(11), +O(10),O(10),O(10),O(10), +O( 9),O( 9),O( 9),O( 9), +O( 8),O( 8),O( 8),O( 8), +O( 7),O( 7),O( 7),O( 7), +O( 6),O( 6),O( 6),O( 6), +O( 5),O( 5),O( 5),O( 5), +O( 4),O( 4),O( 4),O( 4), +O( 3),O( 3),O( 3),O( 3), +O( 2),O( 2),O( 2),O( 2), +O( 1),O( 1),O( 1),O( 1), +O( 0),O( 0),O( 0),O( 0), + +/* rate 12 */ +O( 0),O( 0),O( 0),O( 0), + +/* rate 13 */ +O( 0),O( 0),O( 0),O( 0), + +/* rate 14 */ +O( 0),O( 0),O( 0),O( 0), + +/* rate 15 */ +O( 0),O( 0),O( 0),O( 0), + +/* 32 dummy rates (same as 15 3) */ +O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), +O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), +O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), +O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0) + +}; +#undef O + +static const UINT8 dt_tab[4 * 32]={ +/* this is YM2151 and YM2612 phase increment data (in 10.10 fixed point format)*/ +/* FD=0 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* FD=1 */ + 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, + 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8, 8, 8, 8, +/* FD=2 */ + 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, + 5, 6, 6, 7, 8, 8, 9,10,11,12,13,14,16,16,16,16, +/* FD=3 */ + 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, + 8 , 8, 9,10,11,12,13,14,16,17,19,20,22,22,22,22 +}; + + +/* OPN key frequency number -> key code follow table */ +/* fnum higher 4bit -> keycode lower 2bit */ +static const UINT8 opn_fktable[16] = {0,0,0,0,0,0,0,1,2,3,3,3,3,3,3,3}; + + +/* 8 LFO speed parameters */ +/* each value represents number of samples that one LFO level will last for */ +static const UINT32 lfo_samples_per_step[8] = {108, 77, 71, 67, 62, 44, 8, 5}; + + + +/*There are 4 different LFO AM depths available, they are: + 0 dB, 1.4 dB, 5.9 dB, 11.8 dB + Here is how it is generated (in EG steps): + + 11.8 dB = 0, 2, 4, 6, 8, 10,12,14,16...126,126,124,122,120,118,....4,2,0 + 5.9 dB = 0, 1, 2, 3, 4, 5, 6, 7, 8....63, 63, 62, 61, 60, 59,.....2,1,0 + 1.4 dB = 0, 0, 0, 0, 1, 1, 1, 1, 2,...15, 15, 15, 15, 14, 14,.....0,0,0 + + (1.4 dB is loosing precision as you can see) + + It's implemented as generator from 0..126 with step 2 then a shift + right N times, where N is: + 8 for 0 dB + 3 for 1.4 dB + 1 for 5.9 dB + 0 for 11.8 dB +*/ +static const UINT8 lfo_ams_depth_shift[4] = {8, 3, 1, 0}; + + + +/*There are 8 different LFO PM depths available, they are: + 0, 3.4, 6.7, 10, 14, 20, 40, 80 (cents) + + Modulation level at each depth depends on F-NUMBER bits: 4,5,6,7,8,9,10 + (bits 8,9,10 = FNUM MSB from OCT/FNUM register) + + Here we store only first quarter (positive one) of full waveform. + Full table (lfo_pm_table) containing all 128 waveforms is build + at run (init) time. + + One value in table below represents 4 (four) basic LFO steps + (1 PM step = 4 AM steps). + + For example: + at LFO SPEED=0 (which is 108 samples per basic LFO step) + one value from "lfo_pm_output" table lasts for 432 consecutive + samples (4*108=432) and one full LFO waveform cycle lasts for 13824 + samples (32*432=13824; 32 because we store only a quarter of whole + waveform in the table below) +*/ +static const UINT8 lfo_pm_output[7*8][8]={ /* 7 bits meaningful (of F-NUMBER), 8 LFO output levels per one depth (out of 32), 8 LFO depths */ +/* FNUM BIT 4: 000 0001xxxx */ +/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 1 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 2 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 3 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 4 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 5 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 6 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 7 */ {0, 0, 0, 0, 1, 1, 1, 1}, + +/* FNUM BIT 5: 000 0010xxxx */ +/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 1 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 2 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 3 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 4 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 5 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 6 */ {0, 0, 0, 0, 1, 1, 1, 1}, +/* DEPTH 7 */ {0, 0, 1, 1, 2, 2, 2, 3}, + +/* FNUM BIT 6: 000 0100xxxx */ +/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 1 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 2 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 3 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 4 */ {0, 0, 0, 0, 0, 0, 0, 1}, +/* DEPTH 5 */ {0, 0, 0, 0, 1, 1, 1, 1}, +/* DEPTH 6 */ {0, 0, 1, 1, 2, 2, 2, 3}, +/* DEPTH 7 */ {0, 0, 2, 3, 4, 4, 5, 6}, + +/* FNUM BIT 7: 000 1000xxxx */ +/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 1 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 2 */ {0, 0, 0, 0, 0, 0, 1, 1}, +/* DEPTH 3 */ {0, 0, 0, 0, 1, 1, 1, 1}, +/* DEPTH 4 */ {0, 0, 0, 1, 1, 1, 1, 2}, +/* DEPTH 5 */ {0, 0, 1, 1, 2, 2, 2, 3}, +/* DEPTH 6 */ {0, 0, 2, 3, 4, 4, 5, 6}, +/* DEPTH 7 */ {0, 0, 4, 6, 8, 8, 0xa, 0xc}, + +/* FNUM BIT 8: 001 0000xxxx */ +/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 1 */ {0, 0, 0, 0, 1, 1, 1, 1}, +/* DEPTH 2 */ {0, 0, 0, 1, 1, 1, 2, 2}, +/* DEPTH 3 */ {0, 0, 1, 1, 2, 2, 3, 3}, +/* DEPTH 4 */ {0, 0, 1, 2, 2, 2, 3, 4}, +/* DEPTH 5 */ {0, 0, 2, 3, 4, 4, 5, 6}, +/* DEPTH 6 */ {0, 0, 4, 6, 8, 8, 0xa, 0xc}, +/* DEPTH 7 */ {0, 0, 8, 0xc,0x10,0x10,0x14,0x18}, + +/* FNUM BIT 9: 010 0000xxxx */ +/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 1 */ {0, 0, 0, 0, 2, 2, 2, 2}, +/* DEPTH 2 */ {0, 0, 0, 2, 2, 2, 4, 4}, +/* DEPTH 3 */ {0, 0, 2, 2, 4, 4, 6, 6}, +/* DEPTH 4 */ {0, 0, 2, 4, 4, 4, 6, 8}, +/* DEPTH 5 */ {0, 0, 4, 6, 8, 8, 0xa, 0xc}, +/* DEPTH 6 */ {0, 0, 8, 0xc,0x10,0x10,0x14,0x18}, +/* DEPTH 7 */ {0, 0,0x10,0x18,0x20,0x20,0x28,0x30}, + +/* FNUM BIT10: 100 0000xxxx */ +/* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, +/* DEPTH 1 */ {0, 0, 0, 0, 4, 4, 4, 4}, +/* DEPTH 2 */ {0, 0, 0, 4, 4, 4, 8, 8}, +/* DEPTH 3 */ {0, 0, 4, 4, 8, 8, 0xc, 0xc}, +/* DEPTH 4 */ {0, 0, 4, 8, 8, 8, 0xc,0x10}, +/* DEPTH 5 */ {0, 0, 8, 0xc,0x10,0x10,0x14,0x18}, +/* DEPTH 6 */ {0, 0,0x10,0x18,0x20,0x20,0x28,0x30}, +/* DEPTH 7 */ {0, 0,0x20,0x30,0x40,0x40,0x50,0x60}, + +}; + +/* all 128 LFO PM waveforms */ +static INT32 lfo_pm_table[128*8*32]; /* 128 combinations of 7 bits meaningful (of F-NUMBER), 8 LFO depths, 32 LFO output levels per one depth */ + + + + + +/* register number to channel number , slot offset */ +#define OPN_CHAN(N) (N&3) +#define OPN_SLOT(N) ((N>>2)&3) + +/* slot number */ +#define SLOT1 0 +#define SLOT2 2 +#define SLOT3 1 +#define SLOT4 3 + +/* bit0 = Right enable , bit1 = Left enable */ +#define OUTD_RIGHT 1 +#define OUTD_LEFT 2 +#define OUTD_CENTER 3 + + +/* save output as raw 16-bit sample */ +/* #define SAVE_SAMPLE */ + +#ifdef SAVE_SAMPLE +static FILE *sample[1]; + #if 1 /*save to MONO file */ + #define SAVE_ALL_CHANNELS \ + { signed int pom = lt; \ + fputc((unsigned short)pom&0xff,sample[0]); \ + fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ + } + #else /*save to STEREO file */ + #define SAVE_ALL_CHANNELS \ + { signed int pom = lt; \ + fputc((unsigned short)pom&0xff,sample[0]); \ + fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ + pom = rt; \ + fputc((unsigned short)pom&0xff,sample[0]); \ + fputc(((unsigned short)pom>>8)&0xff,sample[0]); \ + } + #endif +#endif + + +/* struct describing a single operator (SLOT) */ +typedef struct +{ + INT32 *DT; /* detune :dt_tab[DT] */ + UINT8 KSR; /* key scale rate :3-KSR */ + UINT32 ar; /* attack rate */ + UINT32 d1r; /* decay rate */ + UINT32 d2r; /* sustain rate */ + UINT32 rr; /* release rate */ + UINT8 ksr; /* key scale rate :kcode>>(3-KSR) */ + UINT32 mul; /* multiple :ML_TABLE[ML] */ + + /* Phase Generator */ + UINT32 phase; /* phase counter */ + UINT32 Incr; /* phase step */ + + /* Envelope Generator */ + UINT8 state; /* phase type */ + UINT32 tl; /* total level: TL << 3 */ + INT32 volume; /* envelope counter */ + UINT32 sl; /* sustain level:sl_table[SL] */ + UINT32 vol_out; /* current output from EG circuit (without AM from LFO) */ + + UINT8 eg_sh_ar; /* (attack state) */ + UINT8 eg_sel_ar; /* (attack state) */ + UINT8 eg_sh_d1r; /* (decay state) */ + UINT8 eg_sel_d1r; /* (decay state) */ + UINT8 eg_sh_d2r; /* (sustain state) */ + UINT8 eg_sel_d2r; /* (sustain state) */ + UINT8 eg_sh_rr; /* (release state) */ + UINT8 eg_sel_rr; /* (release state) */ + + UINT8 ssg; /* SSG-EG waveform */ + UINT8 ssgn; /* SSG-EG negated output */ + + UINT32 key; /* 0=last key was KEY OFF, 1=KEY ON */ + + /* LFO */ + UINT32 AMmask; /* AM enable flag */ + +} FM_SLOT; + +typedef struct +{ + FM_SLOT SLOT[4]; /* four SLOTs (operators) */ + + UINT8 ALGO; /* algorithm */ + UINT8 FB; /* feedback shift */ + INT32 op1_out[2]; /* op1 output for feedback */ + + INT32 *connect1; /* SLOT1 output pointer */ + INT32 *connect3; /* SLOT3 output pointer */ + INT32 *connect2; /* SLOT2 output pointer */ + INT32 *connect4; /* SLOT4 output pointer */ + + INT32 *mem_connect;/* where to put the delayed sample (MEM) */ + INT32 mem_value; /* delayed sample (MEM) value */ + + INT32 pms; /* channel PMS */ + UINT8 ams; /* channel AMS */ + + UINT32 fc; /* fnum,blk:adjusted to sample rate */ + UINT8 kcode; /* key code: */ + UINT32 block_fnum; /* current blk/fnum value for this slot (can be different betweeen slots of one channel in 3slot mode) */ +} FM_CH; + + +typedef struct +{ + void * param; /* this chip parameter */ + int clock; /* master clock (Hz) */ + int rate; /* sampling rate (Hz) */ + double freqbase; /* frequency base */ + double TimerBase; /* Timer base time */ +#if FM_BUSY_FLAG_SUPPORT + double BusyExpire; /* ExpireTime of Busy clear */ +#endif + UINT8 address; /* address register */ + UINT8 irq; /* interrupt level */ + UINT8 irqmask; /* irq mask */ + UINT8 status; /* status flag */ + UINT32 mode; /* mode CSM / 3SLOT */ + UINT8 prescaler_sel;/* prescaler selector */ + UINT8 fn_h; /* freq latch */ + INT32 TA; /* timer a */ + INT32 TAC; /* timer a counter */ + UINT8 TB; /* timer b */ + INT32 TBC; /* timer b counter */ + /* local time tables */ + INT32 dt_tab[8][32];/* DeTune table */ + /* Extention Timer and IRQ handler */ + FM_TIMERHANDLER Timer_Handler; + FM_IRQHANDLER IRQ_Handler; + const struct ssg_callbacks *SSG; +} FM_ST; + + + +/***********************************************************/ +/* OPN unit */ +/***********************************************************/ + +/* OPN 3slot struct */ +typedef struct +{ + UINT32 fc[3]; /* fnum3,blk3: calculated */ + UINT8 fn_h; /* freq3 latch */ + UINT8 kcode[3]; /* key code */ + UINT32 block_fnum[3]; /* current fnum value for this slot (can be different betweeen slots of one channel in 3slot mode) */ +} FM_3SLOT; + +/* OPN/A/B common state */ +typedef struct +{ + UINT8 type; /* chip type */ + FM_ST ST; /* general state */ + FM_3SLOT SL3; /* 3 slot mode state */ + FM_CH *P_CH; /* pointer of CH */ + unsigned int pan[6*2]; /* fm channels output masks (0xffffffff = enable) */ + + UINT32 eg_cnt; /* global envelope generator counter */ + UINT32 eg_timer; /* global envelope generator counter works at frequency = chipclock/64/3 */ + UINT32 eg_timer_add; /* step of eg_timer */ + UINT32 eg_timer_overflow;/* envelope generator timer overlfows every 3 samples (on real chip) */ + + + /* there are 2048 FNUMs that can be generated using FNUM/BLK registers + but LFO works with one more bit of a precision so we really need 4096 elements */ + + UINT32 fn_table[4096]; /* fnumber->increment counter */ + + + /* LFO */ + UINT32 lfo_cnt; + UINT32 lfo_inc; + + UINT32 lfo_freq[8]; /* LFO FREQ table */ +} FM_OPN; + + + +/* current chip state */ +static INT32 m2,c1,c2; /* Phase Modulation input for operators 2,3,4 */ +static INT32 mem; /* one sample delay memory */ + +static INT32 out_fm[8]; /* outputs of working channels */ + +#if (BUILD_YM2608||BUILD_YM2610||BUILD_YM2610B) +static INT32 out_adpcm[4]; /* channel output NONE,LEFT,RIGHT or CENTER for YM2608/YM2610 ADPCM */ +static INT32 out_delta[4]; /* channel output NONE,LEFT,RIGHT or CENTER for YM2608/YM2610 DELTAT*/ +#endif + +static UINT32 LFO_AM; /* runtime LFO calculations helper */ +static INT32 LFO_PM; /* runtime LFO calculations helper */ + + +/* log output level */ +#define LOG_ERR 3 /* ERROR */ +#define LOG_WAR 2 /* WARNING */ +#define LOG_INF 1 /* INFORMATION */ +#define LOG_LEVEL LOG_INF + +#ifndef __RAINE__ +#define LOG(n,x) if( (n)>=LOG_LEVEL ) logerror x +#endif + +/* limitter */ +#define Limit(val, max,min) { \ + if ( val > max ) val = max; \ + else if ( val < min ) val = min; \ +} + + +/* status set and IRQ handling */ +INLINE void FM_STATUS_SET(FM_ST *ST,int flag) +{ + /* set status flag */ + ST->status |= flag; + if ( !(ST->irq) && (ST->status & ST->irqmask) ) + { + ST->irq = 1; + /* callback user interrupt handler (IRQ is OFF to ON) */ + if(ST->IRQ_Handler) (ST->IRQ_Handler)(ST->param,1); + } +} + +/* status reset and IRQ handling */ +INLINE void FM_STATUS_RESET(FM_ST *ST,int flag) +{ + /* reset status flag */ + ST->status &=~flag; + if ( (ST->irq) && !(ST->status & ST->irqmask) ) + { + ST->irq = 0; + /* callback user interrupt handler (IRQ is ON to OFF) */ + if(ST->IRQ_Handler) (ST->IRQ_Handler)(ST->param,0); + } +} + +/* IRQ mask set */ +INLINE void FM_IRQMASK_SET(FM_ST *ST,int flag) +{ + ST->irqmask = flag; + /* IRQ handling check */ + FM_STATUS_SET(ST,0); + FM_STATUS_RESET(ST,0); +} + +/* OPN Mode Register Write */ +INLINE void set_timers( FM_ST *ST, void *n, int v ) +{ + /* b7 = CSM MODE */ + /* b6 = 3 slot mode */ + /* b5 = reset b */ + /* b4 = reset a */ + /* b3 = timer enable b */ + /* b2 = timer enable a */ + /* b1 = load b */ + /* b0 = load a */ + ST->mode = v; + + /* reset Timer b flag */ + if( v & 0x20 ) + FM_STATUS_RESET(ST,0x02); + /* reset Timer a flag */ + if( v & 0x10 ) + FM_STATUS_RESET(ST,0x01); + /* load b */ + if( v & 0x02 ) + { + if( ST->TBC == 0 ) + { + ST->TBC = ( 256-ST->TB)<<4; + /* External timer handler */ + if (ST->Timer_Handler) (ST->Timer_Handler)(n,1,ST->TBC,ST->TimerBase); + } + } + else + { /* stop timer b */ + if( ST->TBC != 0 ) + { + ST->TBC = 0; + if (ST->Timer_Handler) (ST->Timer_Handler)(n,1,0,ST->TimerBase); + } + } + /* load a */ + if( v & 0x01 ) + { + if( ST->TAC == 0 ) + { + ST->TAC = (1024-ST->TA); + /* External timer handler */ + if (ST->Timer_Handler) (ST->Timer_Handler)(n,0,ST->TAC,ST->TimerBase); + } + } + else + { /* stop timer a */ + if( ST->TAC != 0 ) + { + ST->TAC = 0; + if (ST->Timer_Handler) (ST->Timer_Handler)(n,0,0,ST->TimerBase); + } + } +} + + +/* Timer A Overflow */ +INLINE void TimerAOver(FM_ST *ST) +{ + /* set status (if enabled) */ + if(ST->mode & 0x04) FM_STATUS_SET(ST,0x01); + /* clear or reload the counter */ + ST->TAC = (1024-ST->TA); + if (ST->Timer_Handler) (ST->Timer_Handler)(ST->param,0,ST->TAC,ST->TimerBase); +} +/* Timer B Overflow */ +INLINE void TimerBOver(FM_ST *ST) +{ + /* set status (if enabled) */ + if(ST->mode & 0x08) FM_STATUS_SET(ST,0x02); + /* clear or reload the counter */ + ST->TBC = ( 256-ST->TB)<<4; + if (ST->Timer_Handler) (ST->Timer_Handler)(ST->param,1,ST->TBC,ST->TimerBase); +} + + +#if FM_INTERNAL_TIMER +/* ----- internal timer mode , update timer */ + +/* ---------- calculate timer A ---------- */ + #define INTERNAL_TIMER_A(ST,CSM_CH) \ + { \ + if( ST->TAC && (ST->Timer_Handler==0) ) \ + if( (ST->TAC -= (int)(ST->freqbase*4096)) <= 0 ) \ + { \ + TimerAOver( ST ); \ + /* CSM mode total level latch and auto key on */ \ + if( ST->mode & 0x80 ) \ + CSMKeyControll( CSM_CH ); \ + } \ + } +/* ---------- calculate timer B ---------- */ + #define INTERNAL_TIMER_B(ST,step) \ + { \ + if( ST->TBC && (ST->Timer_Handler==0) ) \ + if( (ST->TBC -= (int)(ST->freqbase*4096*step)) <= 0 ) \ + TimerBOver( ST ); \ + } +#else /* FM_INTERNAL_TIMER */ +/* external timer mode */ +#define INTERNAL_TIMER_A(ST,CSM_CH) +#define INTERNAL_TIMER_B(ST,step) +#endif /* FM_INTERNAL_TIMER */ + + + +#if FM_BUSY_FLAG_SUPPORT +INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST) +{ + if( ST->BusyExpire ) + { + if( (ST->BusyExpire - FM_GET_TIME_NOW()) > 0) + return ST->status | 0x80; /* with busy */ + /* expire */ + ST->BusyExpire = 0; + } + return ST->status; +} +INLINE void FM_BUSY_SET(FM_ST *ST,int busyclock ) +{ + ST->BusyExpire = FM_GET_TIME_NOW() + (ST->TimerBase * busyclock); +} +#define FM_BUSY_CLEAR(ST) ((ST)->BusyExpire = 0) +#else +#define FM_STATUS_FLAG(ST) ((ST)->status) +#define FM_BUSY_SET(ST,bclock) {} +#define FM_BUSY_CLEAR(ST) {} +#endif + + + + +INLINE void FM_KEYON(FM_CH *CH , int s ) +{ + FM_SLOT *SLOT = &CH->SLOT[s]; + if( !SLOT->key ) + { + SLOT->key = 1; + SLOT->phase = 0; /* restart Phase Generator */ + SLOT->state = EG_ATT; /* phase -> Attack */ + } +} + +INLINE void FM_KEYOFF(FM_CH *CH , int s ) +{ + FM_SLOT *SLOT = &CH->SLOT[s]; + if( SLOT->key ) + { + SLOT->key = 0; + if (SLOT->state>EG_REL) + SLOT->state = EG_REL;/* phase -> Release */ + } +} + +/* set algorithm connection */ +static void setup_connection( FM_CH *CH, int ch ) +{ + INT32 *carrier = &out_fm[ch]; + + INT32 **om1 = &CH->connect1; + INT32 **om2 = &CH->connect3; + INT32 **oc1 = &CH->connect2; + + INT32 **memc = &CH->mem_connect; + + switch( CH->ALGO ){ + case 0: + /* M1---C1---MEM---M2---C2---OUT */ + *om1 = &c1; + *oc1 = &mem; + *om2 = &c2; + *memc= &m2; + break; + case 1: + /* M1------+-MEM---M2---C2---OUT */ + /* C1-+ */ + *om1 = &mem; + *oc1 = &mem; + *om2 = &c2; + *memc= &m2; + break; + case 2: + /* M1-----------------+-C2---OUT */ + /* C1---MEM---M2-+ */ + *om1 = &c2; + *oc1 = &mem; + *om2 = &c2; + *memc= &m2; + break; + case 3: + /* M1---C1---MEM------+-C2---OUT */ + /* M2-+ */ + *om1 = &c1; + *oc1 = &mem; + *om2 = &c2; + *memc= &c2; + break; + case 4: + /* M1---C1-+-OUT */ + /* M2---C2-+ */ + /* MEM: not used */ + *om1 = &c1; + *oc1 = carrier; + *om2 = &c2; + *memc= &mem; /* store it anywhere where it will not be used */ + break; + case 5: + /* +----C1----+ */ + /* M1-+-MEM---M2-+-OUT */ + /* +----C2----+ */ + *om1 = 0; /* special mark */ + *oc1 = carrier; + *om2 = carrier; + *memc= &m2; + break; + case 6: + /* M1---C1-+ */ + /* M2-+-OUT */ + /* C2-+ */ + /* MEM: not used */ + *om1 = &c1; + *oc1 = carrier; + *om2 = carrier; + *memc= &mem; /* store it anywhere where it will not be used */ + break; + case 7: + /* M1-+ */ + /* C1-+-OUT */ + /* M2-+ */ + /* C2-+ */ + /* MEM: not used*/ + *om1 = carrier; + *oc1 = carrier; + *om2 = carrier; + *memc= &mem; /* store it anywhere where it will not be used */ + break; + } + + CH->connect4 = carrier; +} + +/* set detune & multiple */ +INLINE void set_det_mul(FM_ST *ST,FM_CH *CH,FM_SLOT *SLOT,int v) +{ + SLOT->mul = (v&0x0f)? (v&0x0f)*2 : 1; + SLOT->DT = ST->dt_tab[(v>>4)&7]; + CH->SLOT[SLOT1].Incr=-1; +} + +/* set total level */ +INLINE void set_tl(FM_CH *CH,FM_SLOT *SLOT , int v) +{ + SLOT->tl = (v&0x7f)<<(ENV_BITS-7); /* 7bit TL */ +} + +/* set attack rate & key scale */ +INLINE void set_ar_ksr(FM_CH *CH,FM_SLOT *SLOT,int v) +{ + UINT8 old_KSR = SLOT->KSR; + + SLOT->ar = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; + + SLOT->KSR = 3-(v>>6); + if (SLOT->KSR != old_KSR) + { + CH->SLOT[SLOT1].Incr=-1; + } + else + { + /* refresh Attack rate */ + if ((SLOT->ar + SLOT->ksr) < 32+62) + { + SLOT->eg_sh_ar = eg_rate_shift [SLOT->ar + SLOT->ksr ]; + SLOT->eg_sel_ar = eg_rate_select[SLOT->ar + SLOT->ksr ]; + } + else + { + SLOT->eg_sh_ar = 0; + SLOT->eg_sel_ar = 17*RATE_STEPS; + } + } +} + +/* set decay rate */ +INLINE void set_dr(FM_SLOT *SLOT,int v) +{ + SLOT->d1r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; + + SLOT->eg_sh_d1r = eg_rate_shift [SLOT->d1r + SLOT->ksr]; + SLOT->eg_sel_d1r= eg_rate_select[SLOT->d1r + SLOT->ksr]; + +} + +/* set sustain rate */ +INLINE void set_sr(FM_SLOT *SLOT,int v) +{ + SLOT->d2r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; + + SLOT->eg_sh_d2r = eg_rate_shift [SLOT->d2r + SLOT->ksr]; + SLOT->eg_sel_d2r= eg_rate_select[SLOT->d2r + SLOT->ksr]; +} + +/* set release rate */ +INLINE void set_sl_rr(FM_SLOT *SLOT,int v) +{ + SLOT->sl = sl_table[ v>>4 ]; + + SLOT->rr = 34 + ((v&0x0f)<<2); + + SLOT->eg_sh_rr = eg_rate_shift [SLOT->rr + SLOT->ksr]; + SLOT->eg_sel_rr = eg_rate_select[SLOT->rr + SLOT->ksr]; +} + + + +INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm) +{ + UINT32 p; + + p = (env<<3) + sin_tab[ ( ((signed int)((phase & ~FREQ_MASK) + (pm<<15))) >> FREQ_SH ) & SIN_MASK ]; + + if (p >= TL_TAB_LEN) + return 0; + return tl_tab[p]; +} + +INLINE signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) +{ + UINT32 p; + + p = (env<<3) + sin_tab[ ( ((signed int)((phase & ~FREQ_MASK) + pm )) >> FREQ_SH ) & SIN_MASK ]; + + if (p >= TL_TAB_LEN) + return 0; + return tl_tab[p]; +} + +/* advance LFO to next sample */ +INLINE void advance_lfo(FM_OPN *OPN) +{ + UINT8 pos; + UINT8 prev_pos; + + if (OPN->lfo_inc) /* LFO enabled ? */ + { + prev_pos = OPN->lfo_cnt>>LFO_SH & 127; + + OPN->lfo_cnt += OPN->lfo_inc; + + pos = (OPN->lfo_cnt >> LFO_SH) & 127; + + + /* update AM when LFO output changes */ + + /*if (prev_pos != pos)*/ + /* actually I can't optimize is this way without rewritting chan_calc() + to use chip->lfo_am instead of global lfo_am */ + { + + /* triangle */ + /* AM: 0 to 126 step +2, 126 to 0 step -2 */ + if (pos<64) + LFO_AM = (pos&63) * 2; + else + LFO_AM = 126 - ((pos&63) * 2); + } + + /* PM works with 4 times slower clock */ + prev_pos >>= 2; + pos >>= 2; + /* update PM when LFO output changes */ + /*if (prev_pos != pos)*/ /* can't use global lfo_pm for this optimization, must be chip->lfo_pm instead*/ + { + LFO_PM = pos; + } + + } + else + { + LFO_AM = 0; + LFO_PM = 0; + } +} + +INLINE void advance_eg_channel(FM_OPN *OPN, FM_SLOT *SLOT) +{ + unsigned int out; + unsigned int swap_flag = 0; + unsigned int i; + + + i = 4; /* four operators per channel */ + do + { + switch(SLOT->state) + { + case EG_ATT: /* attack phase */ + if ( !(OPN->eg_cnt & ((1<eg_sh_ar)-1) ) ) + { + SLOT->volume += (~SLOT->volume * + (eg_inc[SLOT->eg_sel_ar + ((OPN->eg_cnt>>SLOT->eg_sh_ar)&7)]) + ) >>4; + + if (SLOT->volume <= MIN_ATT_INDEX) + { + SLOT->volume = MIN_ATT_INDEX; + SLOT->state = EG_DEC; + } + } + break; + + case EG_DEC: /* decay phase */ + if (SLOT->ssg&0x08) /* SSG EG type envelope selected */ + { + if ( !(OPN->eg_cnt & ((1<eg_sh_d1r)-1) ) ) + { + SLOT->volume += 4 * eg_inc[SLOT->eg_sel_d1r + ((OPN->eg_cnt>>SLOT->eg_sh_d1r)&7)]; + + if ( SLOT->volume >= SLOT->sl ) + SLOT->state = EG_SUS; + } + } + else + { + if ( !(OPN->eg_cnt & ((1<eg_sh_d1r)-1) ) ) + { + SLOT->volume += eg_inc[SLOT->eg_sel_d1r + ((OPN->eg_cnt>>SLOT->eg_sh_d1r)&7)]; + + if ( SLOT->volume >= SLOT->sl ) + SLOT->state = EG_SUS; + } + } + break; + + case EG_SUS: /* sustain phase */ + if (SLOT->ssg&0x08) /* SSG EG type envelope selected */ + { + if ( !(OPN->eg_cnt & ((1<eg_sh_d2r)-1) ) ) + { + SLOT->volume += 4 * eg_inc[SLOT->eg_sel_d2r + ((OPN->eg_cnt>>SLOT->eg_sh_d2r)&7)]; + + if ( SLOT->volume >= MAX_ATT_INDEX ) + { + SLOT->volume = MAX_ATT_INDEX; + + if (SLOT->ssg&0x01) /* bit 0 = hold */ + { + if (SLOT->ssgn&1) /* have we swapped once ??? */ + { + /* yes, so do nothing, just hold current level */ + } + else + swap_flag = (SLOT->ssg&0x02) | 1 ; /* bit 1 = alternate */ + + } + else + { + /* same as KEY-ON operation */ + + /* restart of the Phase Generator should be here, + only if AR is not maximum ??? */ + /*SLOT->phase = 0;*/ + + /* phase -> Attack */ + SLOT->state = EG_ATT; + + swap_flag = (SLOT->ssg&0x02); /* bit 1 = alternate */ + } + } + } + } + else + { + if ( !(OPN->eg_cnt & ((1<eg_sh_d2r)-1) ) ) + { + SLOT->volume += eg_inc[SLOT->eg_sel_d2r + ((OPN->eg_cnt>>SLOT->eg_sh_d2r)&7)]; + + if ( SLOT->volume >= MAX_ATT_INDEX ) + { + SLOT->volume = MAX_ATT_INDEX; + /* do not change SLOT->state (verified on real chip) */ + } + } + + } + break; + + case EG_REL: /* release phase */ + if ( !(OPN->eg_cnt & ((1<eg_sh_rr)-1) ) ) + { + SLOT->volume += eg_inc[SLOT->eg_sel_rr + ((OPN->eg_cnt>>SLOT->eg_sh_rr)&7)]; + + if ( SLOT->volume >= MAX_ATT_INDEX ) + { + SLOT->volume = MAX_ATT_INDEX; + SLOT->state = EG_OFF; + } + } + break; + + } + + out = SLOT->tl + ((UINT32)SLOT->volume); + + if ((SLOT->ssg&0x08) && (SLOT->ssgn&2)) /* negate output (changes come from alternate bit, init comes from attack bit) */ + out ^= ((1<vol_out = out; + + SLOT->ssgn ^= swap_flag; + + SLOT++; + i--; + }while (i); + +} + + + +#define volume_calc(OP) ((OP)->vol_out + (AM & (OP)->AMmask)) + +INLINE void chan_calc(FM_OPN *OPN, FM_CH *CH) +{ + unsigned int eg_out; + + UINT32 AM = LFO_AM >> CH->ams; + + + m2 = c1 = c2 = mem = 0; + + *CH->mem_connect = CH->mem_value; /* restore delayed sample (MEM) value to m2 or c2 */ + + eg_out = volume_calc(&CH->SLOT[SLOT1]); + { + INT32 out = CH->op1_out[0] + CH->op1_out[1]; + CH->op1_out[0] = CH->op1_out[1]; + + if( !CH->connect1 ){ + /* algorithm 5 */ + mem = c1 = c2 = CH->op1_out[0]; + }else{ + /* other algorithms */ + *CH->connect1 += CH->op1_out[0]; + } + + CH->op1_out[1] = 0; + if( eg_out < ENV_QUIET ) /* SLOT 1 */ + { + if (!CH->FB) + out=0; + + CH->op1_out[1] = op_calc1(CH->SLOT[SLOT1].phase, eg_out, (out<FB) ); + } + } + + eg_out = volume_calc(&CH->SLOT[SLOT3]); + if( eg_out < ENV_QUIET ) /* SLOT 3 */ + *CH->connect3 += op_calc(CH->SLOT[SLOT3].phase, eg_out, m2); + + eg_out = volume_calc(&CH->SLOT[SLOT2]); + if( eg_out < ENV_QUIET ) /* SLOT 2 */ + *CH->connect2 += op_calc(CH->SLOT[SLOT2].phase, eg_out, c1); + + eg_out = volume_calc(&CH->SLOT[SLOT4]); + if( eg_out < ENV_QUIET ) /* SLOT 4 */ + *CH->connect4 += op_calc(CH->SLOT[SLOT4].phase, eg_out, c2); + + + /* store current MEM */ + CH->mem_value = mem; + + /* update phase counters AFTER output calculations */ + if(CH->pms) + { + + + /* add support for 3 slot mode */ + + + UINT32 block_fnum = CH->block_fnum; + + UINT32 fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; + INT32 lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + CH->pms + LFO_PM ]; + + if (lfo_fn_table_index_offset) /* LFO phase modulation active */ + { + UINT8 blk; + UINT32 fn; + int kc,fc; + + block_fnum = block_fnum*2 + lfo_fn_table_index_offset; + + blk = (block_fnum&0x7000) >> 12; + fn = block_fnum & 0xfff; + + /* keyscale code */ + kc = (blk<<2) | opn_fktable[fn >> 8]; + /* phase increment counter */ + fc = OPN->fn_table[fn]>>(7-blk); + + CH->SLOT[SLOT1].phase += ((fc+CH->SLOT[SLOT1].DT[kc])*CH->SLOT[SLOT1].mul) >> 1; + CH->SLOT[SLOT2].phase += ((fc+CH->SLOT[SLOT2].DT[kc])*CH->SLOT[SLOT2].mul) >> 1; + CH->SLOT[SLOT3].phase += ((fc+CH->SLOT[SLOT3].DT[kc])*CH->SLOT[SLOT3].mul) >> 1; + CH->SLOT[SLOT4].phase += ((fc+CH->SLOT[SLOT4].DT[kc])*CH->SLOT[SLOT4].mul) >> 1; + } + else /* LFO phase modulation = zero */ + { + CH->SLOT[SLOT1].phase += CH->SLOT[SLOT1].Incr; + CH->SLOT[SLOT2].phase += CH->SLOT[SLOT2].Incr; + CH->SLOT[SLOT3].phase += CH->SLOT[SLOT3].Incr; + CH->SLOT[SLOT4].phase += CH->SLOT[SLOT4].Incr; + } + } + else /* no LFO phase modulation */ + { + CH->SLOT[SLOT1].phase += CH->SLOT[SLOT1].Incr; + CH->SLOT[SLOT2].phase += CH->SLOT[SLOT2].Incr; + CH->SLOT[SLOT3].phase += CH->SLOT[SLOT3].Incr; + CH->SLOT[SLOT4].phase += CH->SLOT[SLOT4].Incr; + } +} + +/* update phase increment and envelope generator */ +INLINE void refresh_fc_eg_slot(FM_SLOT *SLOT , int fc , int kc ) +{ + int ksr; + + /* (frequency) phase increment counter */ + SLOT->Incr = ((fc+SLOT->DT[kc])*SLOT->mul) >> 1; + + ksr = kc >> SLOT->KSR; + if( SLOT->ksr != ksr ) + { + SLOT->ksr = ksr; + + /* calculate envelope generator rates */ + if ((SLOT->ar + SLOT->ksr) < 32+62) + { + SLOT->eg_sh_ar = eg_rate_shift [SLOT->ar + SLOT->ksr ]; + SLOT->eg_sel_ar = eg_rate_select[SLOT->ar + SLOT->ksr ]; + } + else + { + SLOT->eg_sh_ar = 0; + SLOT->eg_sel_ar = 17*RATE_STEPS; + } + + SLOT->eg_sh_d1r = eg_rate_shift [SLOT->d1r + SLOT->ksr]; + SLOT->eg_sel_d1r= eg_rate_select[SLOT->d1r + SLOT->ksr]; + + SLOT->eg_sh_d2r = eg_rate_shift [SLOT->d2r + SLOT->ksr]; + SLOT->eg_sel_d2r= eg_rate_select[SLOT->d2r + SLOT->ksr]; + + SLOT->eg_sh_rr = eg_rate_shift [SLOT->rr + SLOT->ksr]; + SLOT->eg_sel_rr = eg_rate_select[SLOT->rr + SLOT->ksr]; + } +} + +/* update phase increment counters */ +INLINE void refresh_fc_eg_chan(FM_CH *CH ) +{ + if( CH->SLOT[SLOT1].Incr==-1){ + int fc = CH->fc; + int kc = CH->kcode; + refresh_fc_eg_slot(&CH->SLOT[SLOT1] , fc , kc ); + refresh_fc_eg_slot(&CH->SLOT[SLOT2] , fc , kc ); + refresh_fc_eg_slot(&CH->SLOT[SLOT3] , fc , kc ); + refresh_fc_eg_slot(&CH->SLOT[SLOT4] , fc , kc ); + } +} + +/* initialize time tables */ +static void init_timetables( FM_ST *ST , const UINT8 *dttable ) +{ + int i,d; + double rate; + +#if 0 + logerror("FM.C: samplerate=%8i chip clock=%8i freqbase=%f \n", + ST->rate, ST->clock, ST->freqbase ); +#endif + + /* DeTune table */ + for (d = 0;d <= 3;d++){ + for (i = 0;i <= 31;i++){ + rate = ((double)dttable[d*32 + i]) * SIN_LEN * ST->freqbase * (1<dt_tab[d][i] = (INT32) rate; + ST->dt_tab[d+4][i] = -ST->dt_tab[d][i]; +#if 0 + logerror("FM.C: DT [%2i %2i] = %8x \n", d, i, ST->dt_tab[d][i] ); +#endif + } + } + +} + + +static void reset_channels( FM_ST *ST , FM_CH *CH , int num ) +{ + int c,s; + + ST->mode = 0; /* normal mode */ + ST->TA = 0; + ST->TAC = 0; + ST->TB = 0; + ST->TBC = 0; + + for( c = 0 ; c < num ; c++ ) + { + CH[c].fc = 0; + for(s = 0 ; s < 4 ; s++ ) + { + CH[c].SLOT[s].ssg = 0; + CH[c].SLOT[s].ssgn = 0; + CH[c].SLOT[s].state= EG_OFF; + CH[c].SLOT[s].volume = MAX_ATT_INDEX; + CH[c].SLOT[s].vol_out= MAX_ATT_INDEX; + } + } +} + +/* initialize generic tables */ +static int init_tables(void) +{ + signed int i,x; + signed int n; + double o,m; + + for (x=0; x>= 4; /* 12 bits here */ + if (n&1) /* round to nearest */ + n = (n>>1)+1; + else + n = n>>1; + /* 11 bits here (rounded) */ + n <<= 2; /* 13 bits here (as in real chip) */ + tl_tab[ x*2 + 0 ] = n; + tl_tab[ x*2 + 1 ] = -tl_tab[ x*2 + 0 ]; + + for (i=1; i<13; i++) + { + tl_tab[ x*2+0 + i*2*TL_RES_LEN ] = tl_tab[ x*2+0 ]>>i; + tl_tab[ x*2+1 + i*2*TL_RES_LEN ] = -tl_tab[ x*2+0 + i*2*TL_RES_LEN ]; + } + #if 0 + logerror("tl %04i", x); + for (i=0; i<13; i++) + logerror(", [%02i] %4x", i*2, tl_tab[ x*2 /*+1*/ + i*2*TL_RES_LEN ]); + logerror("\n"); + } + #endif + } + /*logerror("FM.C: TL_TAB_LEN = %i elements (%i bytes)\n",TL_TAB_LEN, (int)sizeof(tl_tab));*/ + + + for (i=0; i0.0) + o = 8*log(1.0/m)/log(2); /* convert to 'decibels' */ + else + o = 8*log(-1.0/m)/log(2); /* convert to 'decibels' */ + + o = o / (ENV_STEP/4); + + n = (int)(2.0*o); + if (n&1) /* round to nearest */ + n = (n>>1)+1; + else + n = n>>1; + + sin_tab[ i ] = n*2 + (m>=0.0? 0: 1 ); + /*logerror("FM.C: sin [%4i]= %4i (tl_tab value=%5i)\n", i, sin_tab[i],tl_tab[sin_tab[i]]);*/ + } + + /*logerror("FM.C: ENV_QUIET= %08x\n",ENV_QUIET );*/ + + + /* build LFO PM modulation table */ + for(i = 0; i < 8; i++) /* 8 PM depths */ + { + UINT8 fnum; + for (fnum=0; fnum<128; fnum++) /* 7 bits meaningful of F-NUMBER */ + { + UINT8 value; + UINT8 step; + UINT32 offset_depth = i; + UINT32 offset_fnum_bit; + UINT32 bit_tmp; + + for (step=0; step<8; step++) + { + value = 0; + for (bit_tmp=0; bit_tmp<7; bit_tmp++) /* 7 bits */ + { + if (fnum & (1<op1_out); + state_save_register_item(state_name, num, CH->fc); + /* slots */ + for(slot=0;slot<4;slot++) + { + FM_SLOT *SLOT = &CH->SLOT[slot]; + + sprintf(state_name,"%s.CH%d.SLOT%d",name,ch,slot_array[slot]); + state_save_register_item(state_name, num, SLOT->phase); + state_save_register_item(state_name, num, SLOT->state); + state_save_register_item(state_name, num, SLOT->volume); + } + } +} + +static void FMsave_state_st(const char *state_name,int num,FM_ST *ST) +{ +#if FM_BUSY_FLAG_SUPPORT + state_save_register_item(state_name, num, ST->BusyExpire ); +#endif + state_save_register_item(state_name, num, ST->address ); + state_save_register_item(state_name, num, ST->irq ); + state_save_register_item(state_name, num, ST->irqmask ); + state_save_register_item(state_name, num, ST->status ); + state_save_register_item(state_name, num, ST->mode ); + state_save_register_item(state_name, num, ST->prescaler_sel ); + state_save_register_item(state_name, num, ST->fn_h ); + state_save_register_item(state_name, num, ST->TA ); + state_save_register_item(state_name, num, ST->TAC ); + state_save_register_item(state_name, num, ST->TB ); + state_save_register_item(state_name, num, ST->TBC ); +} +#endif /* _STATE_H */ + +#if BUILD_OPN + + + +/* prescaler set (and make time tables) */ +static void OPNSetPres(FM_OPN *OPN , int pres , int TimerPres, int SSGpres) +{ + int i; + + /* frequency base */ + OPN->ST.freqbase = (OPN->ST.rate) ? ((double)OPN->ST.clock / OPN->ST.rate) / pres : 0; + +#if 0 + OPN->ST.rate = (double)OPN->ST.clock / pres; + OPN->ST.freqbase = 1.0; +#endif + + OPN->eg_timer_add = (1<ST.freqbase; + OPN->eg_timer_overflow = ( 3 ) * (1<ST.TimerBase = 1.0/((double)OPN->ST.clock / (double)TimerPres); + + /* SSG part prescaler set */ + if( SSGpres ) (*OPN->ST.SSG->set_clock)( OPN->ST.param, OPN->ST.clock * 2 / SSGpres ); + + /* make time tables */ + init_timetables( &OPN->ST, dt_tab ); + + /* there are 2048 FNUMs that can be generated using FNUM/BLK registers + but LFO works with one more bit of a precision so we really need 4096 elements */ + /* calculate fnumber -> increment counter table */ + for(i = 0; i < 4096; i++) + { + /* freq table for octave 7 */ + /* OPN phase increment counter = 20bit */ + OPN->fn_table[i] = (UINT32)( (double)i * 32 * OPN->ST.freqbase * (1<<(FREQ_SH-10)) ); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ +#if 0 + logerror("FM.C: fn_table[%4i] = %08x (dec=%8i)\n", + i, OPN->fn_table[i]>>6,OPN->fn_table[i]>>6 ); +#endif + } + + /* LFO freq. table */ + for(i = 0; i < 8; i++) + { + /* Amplitude modulation: 64 output levels (triangle waveform); 1 level lasts for one of "lfo_samples_per_step" samples */ + /* Phase modulation: one entry from lfo_pm_output lasts for one of 4 * "lfo_samples_per_step" samples */ + OPN->lfo_freq[i] = (1.0 / lfo_samples_per_step[i]) * (1<ST.freqbase; +#if 0 + logerror("FM.C: lfo_freq[%i] = %08x (dec=%8i)\n", + i, OPN->lfo_freq[i],OPN->lfo_freq[i] ); +#endif + } +} + + + +/* write a OPN mode register 0x20-0x2f */ +static void OPNWriteMode(FM_OPN *OPN, int r, int v) +{ + UINT8 c; + FM_CH *CH; + + switch(r){ + case 0x21: /* Test */ + break; + case 0x22: /* LFO FREQ (YM2608/YM2610/YM2610B/YM2612) */ + if( OPN->type & TYPE_LFOPAN ) + { + if (v&0x08) /* LFO enabled ? */ + { + OPN->lfo_inc = OPN->lfo_freq[v&7]; + } + else + { + OPN->lfo_inc = 0; + } + } + break; + case 0x24: /* timer A High 8*/ + OPN->ST.TA = (OPN->ST.TA & 0x03)|(((int)v)<<2); + break; + case 0x25: /* timer A Low 2*/ + OPN->ST.TA = (OPN->ST.TA & 0x3fc)|(v&3); + break; + case 0x26: /* timer B */ + OPN->ST.TB = v; + break; + case 0x27: /* mode, timer control */ + set_timers( &(OPN->ST),OPN->ST.param,v ); + break; + case 0x28: /* key on / off */ + c = v & 0x03; + if( c == 3 ) break; + if( (v&0x04) && (OPN->type & TYPE_6CH) ) c+=3; + CH = OPN->P_CH; + CH = &CH[c]; + if(v&0x10) FM_KEYON(CH,SLOT1); else FM_KEYOFF(CH,SLOT1); + if(v&0x20) FM_KEYON(CH,SLOT2); else FM_KEYOFF(CH,SLOT2); + if(v&0x40) FM_KEYON(CH,SLOT3); else FM_KEYOFF(CH,SLOT3); + if(v&0x80) FM_KEYON(CH,SLOT4); else FM_KEYOFF(CH,SLOT4); + break; + } +} + +/* write a OPN register (0x30-0xff) */ +static void OPNWriteReg(FM_OPN *OPN, int r, int v) +{ + FM_CH *CH; + FM_SLOT *SLOT; + + UINT8 c = OPN_CHAN(r); + + if (c == 3) return; /* 0xX3,0xX7,0xXB,0xXF */ + + if (r >= 0x100) c+=3; + + CH = OPN->P_CH; + CH = &CH[c]; + + SLOT = &(CH->SLOT[OPN_SLOT(r)]); + + switch( r & 0xf0 ) { + case 0x30: /* DET , MUL */ + set_det_mul(&OPN->ST,CH,SLOT,v); + break; + + case 0x40: /* TL */ + set_tl(CH,SLOT,v); + break; + + case 0x50: /* KS, AR */ + set_ar_ksr(CH,SLOT,v); + break; + + case 0x60: /* bit7 = AM ENABLE, DR */ + set_dr(SLOT,v); + + if(OPN->type & TYPE_LFOPAN) /* YM2608/2610/2610B/2612 */ + { + SLOT->AMmask = (v&0x80) ? ~0 : 0; + } + break; + + case 0x70: /* SR */ + set_sr(SLOT,v); + break; + + case 0x80: /* SL, RR */ + set_sl_rr(SLOT,v); + break; + + case 0x90: /* SSG-EG */ + + SLOT->ssg = v&0x0f; + SLOT->ssgn = (v&0x04)>>1; /* bit 1 in ssgn = attack */ + + /* SSG-EG envelope shapes : + + E AtAlH + 1 0 0 0 \\\\ + + 1 0 0 1 \___ + + 1 0 1 0 \/\/ + ___ + 1 0 1 1 \ + + 1 1 0 0 //// + ___ + 1 1 0 1 / + + 1 1 1 0 /\/\ + + 1 1 1 1 /___ + + + E = SSG-EG enable + + + The shapes are generated using Attack, Decay and Sustain phases. + + Each single character in the diagrams above represents this whole + sequence: + + - when KEY-ON = 1, normal Attack phase is generated (*without* any + difference when compared to normal mode), + + - later, when envelope level reaches minimum level (max volume), + the EG switches to Decay phase (which works with bigger steps + when compared to normal mode - see below), + + - later when envelope level passes the SL level, + the EG swithes to Sustain phase (which works with bigger steps + when compared to normal mode - see below), + + - finally when envelope level reaches maximum level (min volume), + the EG switches to Attack phase again (depends on actual waveform). + + Important is that when switch to Attack phase occurs, the phase counter + of that operator will be zeroed-out (as in normal KEY-ON) but not always. + (I havent found the rule for that - perhaps only when the output level is low) + + The difference (when compared to normal Envelope Generator mode) is + that the resolution in Decay and Sustain phases is 4 times lower; + this results in only 256 steps instead of normal 1024. + In other words: + when SSG-EG is disabled, the step inside of the EG is one, + when SSG-EG is enabled, the step is four (in Decay and Sustain phases). + + Times between the level changes are the same in both modes. + + + Important: + Decay 1 Level (so called SL) is compared to actual SSG-EG output, so + it is the same in both SSG and no-SSG modes, with this exception: + + when the SSG-EG is enabled and is generating raising levels + (when the EG output is inverted) the SL will be found at wrong level !!! + For example, when SL=02: + 0 -6 = -6dB in non-inverted EG output + 96-6 = -90dB in inverted EG output + Which means that EG compares its level to SL as usual, and that the + output is simply inverted afterall. + + + The Yamaha's manuals say that AR should be set to 0x1f (max speed). + That is not necessary, but then EG will be generating Attack phase. + + */ + + + break; + + case 0xa0: + switch( OPN_SLOT(r) ){ + case 0: /* 0xa0-0xa2 : FNUM1 */ + { + UINT32 fn = (((UINT32)( (OPN->ST.fn_h)&7))<<8) + v; + UINT8 blk = OPN->ST.fn_h>>3; + /* keyscale code */ + CH->kcode = (blk<<2) | opn_fktable[fn >> 7]; + /* phase increment counter */ + CH->fc = OPN->fn_table[fn*2]>>(7-blk); + + /* store fnum in clear form for LFO PM calculations */ + CH->block_fnum = (blk<<11) | fn; + + CH->SLOT[SLOT1].Incr=-1; + } + break; + case 1: /* 0xa4-0xa6 : FNUM2,BLK */ + OPN->ST.fn_h = v&0x3f; + break; + case 2: /* 0xa8-0xaa : 3CH FNUM1 */ + if(r < 0x100) + { + UINT32 fn = (((UINT32)(OPN->SL3.fn_h&7))<<8) + v; + UINT8 blk = OPN->SL3.fn_h>>3; + /* keyscale code */ + OPN->SL3.kcode[c]= (blk<<2) | opn_fktable[fn >> 7]; + /* phase increment counter */ + OPN->SL3.fc[c] = OPN->fn_table[fn*2]>>(7-blk); + OPN->SL3.block_fnum[c] = fn; + (OPN->P_CH)[2].SLOT[SLOT1].Incr=-1; + } + break; + case 3: /* 0xac-0xae : 3CH FNUM2,BLK */ + if(r < 0x100) + OPN->SL3.fn_h = v&0x3f; + break; + } + break; + + case 0xb0: + switch( OPN_SLOT(r) ){ + case 0: /* 0xb0-0xb2 : FB,ALGO */ + { + int feedback = (v>>3)&7; + CH->ALGO = v&7; + CH->FB = feedback ? feedback+6 : 0; + setup_connection( CH, c ); + } + break; + case 1: /* 0xb4-0xb6 : L , R , AMS , PMS (YM2612/YM2610B/YM2610/YM2608) */ + if( OPN->type & TYPE_LFOPAN) + { + /* b0-2 PMS */ + CH->pms = (v & 7) * 32; /* CH->pms = PM depth * 32 (index in lfo_pm_table) */ + + /* b4-5 AMS */ + CH->ams = lfo_ams_depth_shift[(v>>4) & 0x03]; + + /* PAN : b7 = L, b6 = R */ + OPN->pan[ c*2 ] = (v & 0x80) ? ~0 : 0; + OPN->pan[ c*2+1 ] = (v & 0x40) ? ~0 : 0; + + } + break; + } + break; + } +} + +#endif /* BUILD_OPN */ + +#if BUILD_OPN_PRESCALER +/* + prescaler circuit (best guess to verified chip behaviour) + + +--------------+ +-sel2-+ + | +--|in20 | + +---+ | +-sel1-+ | | +M-CLK -+-|1/2|-+--|in10 | +---+ | out|--INT_CLOCK + | +---+ | out|-|1/3|-|in21 | + +----------|in11 | +---+ +------+ + +------+ + +reg.2d : sel2 = in21 (select sel2) +reg.2e : sel1 = in11 (select sel1) +reg.2f : sel1 = in10 , sel2 = in20 (clear selector) +reset : sel1 = in11 , sel2 = in21 (clear both) + +*/ +void OPNPrescaler_w(FM_OPN *OPN , int addr, int pre_divider) +{ + static const int opn_pres[4] = { 2*12 , 2*12 , 6*12 , 3*12 }; + static const int ssg_pres[4] = { 1 , 1 , 4 , 2 }; + int sel; + + switch(addr) + { + case 0: /* when reset */ + OPN->ST.prescaler_sel = 2; + break; + case 1: /* when postload */ + break; + case 0x2d: /* divider sel : select 1/1 for 1/3line */ + OPN->ST.prescaler_sel |= 0x02; + break; + case 0x2e: /* divider sel , select 1/3line for output */ + OPN->ST.prescaler_sel |= 0x01; + break; + case 0x2f: /* divider sel , clear both selector to 1/2,1/2 */ + OPN->ST.prescaler_sel = 0; + break; + } + sel = OPN->ST.prescaler_sel & 3; + /* update prescaler */ + OPNSetPres( OPN, opn_pres[sel]*pre_divider, + opn_pres[sel]*pre_divider, + ssg_pres[sel]*pre_divider ); +} +#endif /* BUILD_OPN_PRESCALER */ + +#if BUILD_YM2203 +/*****************************************************************************/ +/* YM2203 local section */ +/*****************************************************************************/ + +/* here's the virtual YM2203(OPN) */ +typedef struct +{ + UINT8 REGS[256]; /* registers */ + FM_OPN OPN; /* OPN state */ + FM_CH CH[3]; /* channel state */ +} YM2203; + +/* Generate samples for one of the YM2203s */ +void YM2203UpdateOne(void *chip, FMSAMPLE *buffer, int length) +{ + YM2203 *F2203 = chip; + FM_OPN *OPN = &F2203->OPN; + int i; + FMSAMPLE *buf = buffer; + FM_CH *cch[3]; + + cch[0] = &F2203->CH[0]; + cch[1] = &F2203->CH[1]; + cch[2] = &F2203->CH[2]; + + + /* refresh PG and EG */ + refresh_fc_eg_chan( cch[0] ); + refresh_fc_eg_chan( cch[1] ); + if( (F2203->OPN.ST.mode & 0xc0) ) + { + /* 3SLOT MODE */ + if( cch[2]->SLOT[SLOT1].Incr==-1) + { + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT1] , OPN->SL3.fc[1] , OPN->SL3.kcode[1] ); + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT2] , OPN->SL3.fc[2] , OPN->SL3.kcode[2] ); + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT3] , OPN->SL3.fc[0] , OPN->SL3.kcode[0] ); + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT4] , cch[2]->fc , cch[2]->kcode ); + } + }else refresh_fc_eg_chan( cch[2] ); + + + /* YM2203 doesn't have LFO so we must keep these globals at 0 level */ + LFO_AM = 0; + LFO_PM = 0; + + /* buffering */ + for (i=0; i < length ; i++) + { + /* clear outputs */ + out_fm[0] = 0; + out_fm[1] = 0; + out_fm[2] = 0; + + /* advance envelope generator */ + OPN->eg_timer += OPN->eg_timer_add; + while (OPN->eg_timer >= OPN->eg_timer_overflow) + { + OPN->eg_timer -= OPN->eg_timer_overflow; + OPN->eg_cnt++; + + advance_eg_channel(OPN, &cch[0]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[1]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[2]->SLOT[SLOT1]); + } + + /* calculate FM */ + chan_calc(OPN, cch[0] ); + chan_calc(OPN, cch[1] ); + chan_calc(OPN, cch[2] ); + + /* buffering */ + { + int lt; + + lt = out_fm[0] + out_fm[1] + out_fm[2]; + + lt >>= FINAL_SH; + + Limit( lt , MAXOUT, MINOUT ); + + #ifdef SAVE_SAMPLE + SAVE_ALL_CHANNELS + #endif + + /* buffering */ + buf[i] = lt; + } + + /* timer A control */ + INTERNAL_TIMER_A( &F2203->OPN.ST , cch[2] ) + } + INTERNAL_TIMER_B(&F2203->OPN.ST,length) +} + +/* ---------- reset one of chip ---------- */ +void YM2203ResetChip(void *chip) +{ + int i; + YM2203 *F2203 = chip; + FM_OPN *OPN = &F2203->OPN; + + /* Reset Prescaler */ + OPNPrescaler_w(OPN, 0 , 1 ); + /* reset SSG section */ + (*OPN->ST.SSG->reset)(OPN->ST.param); + /* status clear */ + FM_IRQMASK_SET(&OPN->ST,0x03); + FM_BUSY_CLEAR(&OPN->ST); + OPNWriteMode(OPN,0x27,0x30); /* mode 0 , timer reset */ + + OPN->eg_timer = 0; + OPN->eg_cnt = 0; + + FM_STATUS_RESET(&OPN->ST, 0xff); + + reset_channels( &OPN->ST , F2203->CH , 3 ); + /* reset OPerator paramater */ + for(i = 0xb2 ; i >= 0x30 ; i-- ) OPNWriteReg(OPN,i,0); + for(i = 0x26 ; i >= 0x20 ; i-- ) OPNWriteReg(OPN,i,0); +} + +#ifdef __STATE_H__ +void YM2203Postload(void *chip) +{ + if (chip) + { + YM2203 *F2203 = (YM2203 *)chip; + int r; + + /* prescaler */ + OPNPrescaler_w(&F2203->OPN,1,1); + + /* SSG registers */ + for(r=0;r<16;r++) + { + (*F2203->OPN.ST.SSG->write)(F2203->OPN.ST.param,0,r); + (*F2203->OPN.ST.SSG->write)(F2203->OPN.ST.param,1,F2203->REGS[r]); + } + + /* OPN registers */ + /* DT / MULTI , TL , KS / AR , AMON / DR , SR , SL / RR , SSG-EG */ + for(r=0x30;r<0x9e;r++) + if((r&3) != 3) + OPNWriteReg(&F2203->OPN,r,F2203->REGS[r]); + /* FB / CONNECT , L / R / AMS / PMS */ + for(r=0xb0;r<0xb6;r++) + if((r&3) != 3) + OPNWriteReg(&F2203->OPN,r,F2203->REGS[r]); + + /* channels */ + /*FM_channel_postload(F2203->CH,3);*/ + } +} + +static void YM2203_save_state(YM2203 *F2203, int index) +{ + static const char statename[] = "YM2203"; + + state_save_register_item_array(statename, index, F2203->REGS); + FMsave_state_st(statename,index,&F2203->OPN.ST); + FMsave_state_channel(statename,index,F2203->CH,3); + /* 3slots */ + state_save_register_item_array (statename, index, F2203->OPN.SL3.fc); + state_save_register_item (statename, index, F2203->OPN.SL3.fn_h); + state_save_register_item_array (statename, index, F2203->OPN.SL3.kcode); +} +#endif /* _STATE_H */ + +/* ---------- Initialize YM2203 emulator(s) ---------- + 'num' is the number of virtual YM2203s to allocate + 'clock' is the chip clock in Hz + 'rate' is sampling rate +*/ +void * YM2203Init(void *param, int index, int clock, int rate, + FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler, const struct ssg_callbacks *ssg) +{ + YM2203 *F2203; + + /* allocate ym2203 state space */ + if( (F2203 = (YM2203 *)malloc(sizeof(YM2203)))==NULL) + return NULL; + /* clear */ + memset(F2203,0,sizeof(YM2203)); + + if( !init_tables() ) + { + free( F2203 ); + return NULL; + } + + F2203->OPN.ST.param = param; + F2203->OPN.type = TYPE_YM2203; + F2203->OPN.P_CH = F2203->CH; + F2203->OPN.ST.clock = clock; + F2203->OPN.ST.rate = rate; + + F2203->OPN.ST.Timer_Handler = TimerHandler; + F2203->OPN.ST.IRQ_Handler = IRQHandler; + F2203->OPN.ST.SSG = ssg; + YM2203ResetChip(F2203); + +#ifdef __STATE_H__ + YM2203_save_state(F2203, index); +#endif + return F2203; +} + +/* shut down emulator */ +void YM2203Shutdown(void *chip) +{ + YM2203 *FM2203 = chip; + + FMCloseTable(); + free(FM2203); +} + +/* YM2203 I/O interface */ +int YM2203Write(void *chip,int a,UINT8 v) +{ + YM2203 *F2203 = chip; + FM_OPN *OPN = &F2203->OPN; + + if( !(a&1) ) + { /* address port */ + OPN->ST.address = (v &= 0xff); + + /* Write register to SSG emulator */ + if( v < 16 ) (*OPN->ST.SSG->write)(OPN->ST.param,0,v); + + /* prescaler select : 2d,2e,2f */ + if( v >= 0x2d && v <= 0x2f ) + OPNPrescaler_w(OPN , v , 1); + } + else + { /* data port */ + int addr = OPN->ST.address; + F2203->REGS[addr] = v; + switch( addr & 0xf0 ) + { + case 0x00: /* 0x00-0x0f : SSG section */ + /* Write data to SSG emulator */ + (*OPN->ST.SSG->write)(OPN->ST.param,a,v); + break; + case 0x20: /* 0x20-0x2f : Mode section */ + YM2203UpdateReq(OPN->ST.param); + /* write register */ + OPNWriteMode(OPN,addr,v); + break; + default: /* 0x30-0xff : OPN section */ + YM2203UpdateReq(OPN->ST.param); + /* write register */ + OPNWriteReg(OPN,addr,v); + } + FM_BUSY_SET(&OPN->ST,1); + } + return OPN->ST.irq; +} + +UINT8 YM2203Read(void *chip,int a) +{ + YM2203 *F2203 = chip; + int addr = F2203->OPN.ST.address; + UINT8 ret = 0; + + if( !(a&1) ) + { /* status port */ + ret = FM_STATUS_FLAG(&F2203->OPN.ST); + } + else + { /* data port (only SSG) */ + if( addr < 16 ) ret = (*F2203->OPN.ST.SSG->read)(F2203->OPN.ST.param); + } + return ret; +} + +int YM2203TimerOver(void *chip,int c) +{ + YM2203 *F2203 = chip; + + if( c ) + { /* Timer B */ + TimerBOver( &(F2203->OPN.ST) ); + } + else + { /* Timer A */ + YM2203UpdateReq(F2203->OPN.ST.param); + /* timer update */ + TimerAOver( &(F2203->OPN.ST) ); + /* CSM mode key,TL control */ + if( F2203->OPN.ST.mode & 0x80 ) + { /* CSM mode auto key on */ + CSMKeyControll( &(F2203->CH[2]) ); + } + } + return F2203->OPN.ST.irq; +} +#endif /* BUILD_YM2203 */ + + + +#if (BUILD_YM2608||BUILD_YM2610||BUILD_YM2610B) + +/* ADPCM type A channel struct */ +typedef struct +{ + UINT8 flag; /* port state */ + UINT8 flagMask; /* arrived flag mask */ + UINT8 now_data; /* current ROM data */ + UINT32 now_addr; /* current ROM address */ + UINT32 now_step; + UINT32 step; + UINT32 start; /* sample data start address*/ + UINT32 end; /* sample data end address */ + UINT8 IL; /* Instrument Level */ + INT32 adpcm_acc; /* accumulator */ + INT32 adpcm_step; /* step */ + INT32 adpcm_out; /* (speedup) hiro-shi!! */ + INT8 vol_mul; /* volume in "0.75dB" steps */ + UINT8 vol_shift; /* volume in "-6dB" steps */ + INT32 *pan; /* &out_adpcm[OPN_xxxx] */ +} ADPCM_CH; + +/* here's the virtual YM2610 */ +typedef struct +{ + UINT8 REGS[512]; /* registers */ + FM_OPN OPN; /* OPN state */ + FM_CH CH[6]; /* channel state */ + UINT8 addr_A1; /* address line A1 */ + + /* ADPCM-A unit */ + UINT8 *pcmbuf; /* pcm rom buffer */ + UINT32 pcm_size; /* size of pcm rom */ + UINT8 adpcmTL; /* adpcmA total level */ + ADPCM_CH adpcm[6]; /* adpcm channels */ + UINT32 adpcmreg[0x30]; /* registers */ + UINT8 adpcm_arrivedEndAddress; + YM_DELTAT deltaT; /* Delta-T ADPCM unit */ + + UINT8 flagmask; /* YM2608 only */ + UINT8 irqmask; /* YM2608 only */ +} YM2610; + +/* here is the virtual YM2608 */ +typedef YM2610 YM2608; + + +/**** YM2610 ADPCM defines ****/ +#define ADPCM_SHIFT (16) /* frequency step rate */ +#define ADPCMA_ADDRESS_SHIFT 8 /* adpcm A address shift */ + +static UINT8 *pcmbufA; +static UINT32 pcmsizeA; + + +/* Algorithm and tables verified on real YM2608 and YM2610 */ + +/* usual ADPCM table (16 * 1.1^N) */ +static int steps[49] = +{ + 16, 17, 19, 21, 23, 25, 28, + 31, 34, 37, 41, 45, 50, 55, + 60, 66, 73, 80, 88, 97, 107, + 118, 130, 143, 157, 173, 190, 209, + 230, 253, 279, 307, 337, 371, 408, + 449, 494, 544, 598, 658, 724, 796, + 876, 963, 1060, 1166, 1282, 1411, 1552 +}; + +/* different from the usual ADPCM table */ +static int step_inc[8] = { -1*16, -1*16, -1*16, -1*16, 2*16, 5*16, 7*16, 9*16 }; + +/* speedup purposes only */ +static int jedi_table[ 49*16 ]; + + +static void Init_ADPCMATable(void){ + + int step, nib; + + for (step = 0; step < 49; step++) + { + /* loop over all nibbles and compute the difference */ + for (nib = 0; nib < 16; nib++) + { + int value = (2*(nib & 0x07) + 1) * steps[step] / 8; + jedi_table[step*16 + nib] = (nib&0x08) ? -value : value; + } + } +} + +/* ADPCM A (Non control type) : calculate one channel output */ +INLINE void ADPCMA_calc_chan( YM2610 *F2610, ADPCM_CH *ch ) +{ + UINT32 step; + UINT8 data; + + + ch->now_step += ch->step; + if ( ch->now_step >= (1<now_step >> ADPCM_SHIFT; + ch->now_step &= (1< instead of == */ + /* YM2610 checks lower 20 bits only, the 4 MSB bits are sample bank */ + /* Here we use 1<<21 to compensate for nibble calculations */ + + if ( (ch->now_addr & ((1<<21)-1)) == ((ch->end<<1) & ((1<<21)-1)) ) + { + ch->flag = 0; + F2610->adpcm_arrivedEndAddress |= ch->flagMask; + return; + } +#if 0 + if ( ch->now_addr > (pcmsizeA<<1) ) { + LOG(LOG_WAR,("YM2610: Attempting to play past adpcm rom size!\n" )); + return; + } +#endif + if ( ch->now_addr&1 ) + data = ch->now_data & 0x0f; + else + { + ch->now_data = *(pcmbufA+(ch->now_addr>>1)); + data = (ch->now_data >> 4) & 0x0f; + } + + ch->now_addr++; + + ch->adpcm_acc += jedi_table[ch->adpcm_step + data]; + + /* extend 12-bit signed int */ + if (ch->adpcm_acc & 0x800) + ch->adpcm_acc |= ~0xfff; + else + ch->adpcm_acc &= 0xfff; + + ch->adpcm_step += step_inc[data & 7]; + Limit( ch->adpcm_step, 48*16, 0*16 ); + + }while(--step); + + /* calc pcm * volume data */ + ch->adpcm_out = ((ch->adpcm_acc * ch->vol_mul) >> ch->vol_shift) & ~3; /* multiply, shift and mask out 2 LSB bits */ + } + + /* output for work of output channels (out_adpcm[OPNxxxx])*/ + *(ch->pan) += ch->adpcm_out; +} + +/* ADPCM type A Write */ +static void FM_ADPCMAWrite(YM2610 *F2610,int r,int v) +{ + ADPCM_CH *adpcm = F2610->adpcm; + UINT8 c = r&0x07; + + F2610->adpcmreg[r] = v&0xff; /* stock data */ + switch( r ){ + case 0x00: /* DM,--,C5,C4,C3,C2,C1,C0 */ + if( !(v&0x80) ) + { + /* KEY ON */ + for( c = 0; c < 6; c++ ) + { + if( (v>>c)&1 ) + { + /**** start adpcm ****/ + adpcm[c].step = (UINT32)((float)(1<OPN.ST.freqbase)/3.0); + adpcm[c].now_addr = adpcm[c].start<<1; + adpcm[c].now_step = 0; + adpcm[c].adpcm_acc = 0; + adpcm[c].adpcm_step= 0; + adpcm[c].adpcm_out = 0; + adpcm[c].flag = 1; + + if(F2610->pcmbuf==NULL){ /* Check ROM Mapped */ + logerror("YM2608-YM2610: ADPCM-A rom not mapped\n"); + adpcm[c].flag = 0; + } else{ + if(adpcm[c].end >= F2610->pcm_size){ /* Check End in Range */ + logerror("YM2610: ADPCM-A end out of range: $%08x\n",adpcm[c].end); + /*adpcm[c].end = F2610->pcm_size-1;*/ /* JB: DO NOT uncomment this, otherwise you will break the comparison in the ADPCM_CALC_CHA() */ + } + if(adpcm[c].start >= F2610->pcm_size) /* Check Start in Range */ + { + logerror("YM2608-YM2610: ADPCM-A start out of range: $%08x\n",adpcm[c].start); + adpcm[c].flag = 0; + } + } + } + } + } + else + { + /* KEY OFF */ + for( c = 0; c < 6; c++ ) + if( (v>>c)&1 ) + adpcm[c].flag = 0; + } + break; + case 0x01: /* B0-5 = TL */ + F2610->adpcmTL = (v & 0x3f) ^ 0x3f; + for( c = 0; c < 6; c++ ) + { + int volume = F2610->adpcmTL + adpcm[c].IL; + + if ( volume >= 63 ) /* This is correct, 63 = quiet */ + { + adpcm[c].vol_mul = 0; + adpcm[c].vol_shift = 0; + } + else + { + adpcm[c].vol_mul = 15 - (volume & 7); /* so called 0.75 dB */ + adpcm[c].vol_shift = 1 + (volume >> 3); /* Yamaha engineers used the approximation: each -6 dB is close to divide by two (shift right) */ + } + + /* calc pcm * volume data */ + adpcm[c].adpcm_out = ((adpcm[c].adpcm_acc * adpcm[c].vol_mul) >> adpcm[c].vol_shift) & ~3; /* multiply, shift and mask out low 2 bits */ + } + break; + default: + c = r&0x07; + if( c >= 0x06 ) return; + switch( r&0x38 ){ + case 0x08: /* B7=L,B6=R, B4-0=IL */ + { + int volume; + + adpcm[c].IL = (v & 0x1f) ^ 0x1f; + + volume = F2610->adpcmTL + adpcm[c].IL; + + if ( volume >= 63 ) /* This is correct, 63 = quiet */ + { + adpcm[c].vol_mul = 0; + adpcm[c].vol_shift = 0; + } + else + { + adpcm[c].vol_mul = 15 - (volume & 7); /* so called 0.75 dB */ + adpcm[c].vol_shift = 1 + (volume >> 3); /* Yamaha engineers used the approximation: each -6 dB is close to divide by two (shift right) */ + } + + adpcm[c].pan = &out_adpcm[(v>>6)&0x03]; + + /* calc pcm * volume data */ + adpcm[c].adpcm_out = ((adpcm[c].adpcm_acc * adpcm[c].vol_mul) >> adpcm[c].vol_shift) & ~3; /* multiply, shift and mask out low 2 bits */ + } + break; + case 0x10: + case 0x18: + adpcm[c].start = ( (F2610->adpcmreg[0x18 + c]*0x0100 | F2610->adpcmreg[0x10 + c]) << ADPCMA_ADDRESS_SHIFT); + break; + case 0x20: + case 0x28: + adpcm[c].end = ( (F2610->adpcmreg[0x28 + c]*0x0100 | F2610->adpcmreg[0x20 + c]) << ADPCMA_ADDRESS_SHIFT); + adpcm[c].end += (1<flag); + state_save_register_item(state_name, num, adpcm->now_data); + state_save_register_item(state_name, num, adpcm->now_addr); + state_save_register_item(state_name, num, adpcm->now_step); + state_save_register_item(state_name, num, adpcm->adpcm_acc); + state_save_register_item(state_name, num, adpcm->adpcm_step); + state_save_register_item(state_name, num, adpcm->adpcm_out); + } +} +#endif /* _STATE_H */ + +#endif /* (BUILD_YM2608||BUILD_YM2610||BUILD_YM2610B) */ + + +#if BUILD_YM2608 +/*****************************************************************************/ +/* YM2608 local section */ +/*****************************************************************************/ + + + +static unsigned int YM2608_ADPCM_ROM_addr[2*6] = { +0x0000, 0x01bf, /* bass drum */ +0x01c0, 0x043f, /* snare drum */ +0x0440, 0x1b7f, /* top cymbal */ +0x1b80, 0x1cff, /* high hat */ +0x1d00, 0x1f7f, /* tom tom */ +0x1f80, 0x1fff /* rim shot */ +}; + + +/* + This data is derived from the chip's output - internal ROM can't be read. + It was verified, using real YM2608, that this ADPCM stream produces 100% correct output signal. +*/ + +static unsigned char YM2608_ADPCM_ROM[0x2000] = { + +/* Source: 01BD.ROM */ +/* Length: 448 / 0x000001C0 */ + +0x88,0x08,0x08,0x08,0x00,0x88,0x16,0x76,0x99,0xB8,0x22,0x3A,0x84,0x3C,0xB1,0x54, +0x10,0xA9,0x98,0x32,0x80,0x33,0x9A,0xA7,0x4A,0xB4,0x58,0xBC,0x15,0x29,0x8A,0x97, +0x9B,0x44,0xAC,0x80,0x12,0xDE,0x13,0x1B,0xC0,0x58,0xC8,0x11,0x0A,0xA2,0x1A,0xA0, +0x00,0x98,0x0B,0x93,0x9E,0x92,0x0A,0x88,0xBE,0x14,0x1B,0x98,0x08,0xA1,0x4A,0xC1, +0x30,0xD9,0x33,0x98,0x10,0x89,0x17,0x1A,0x82,0x29,0x37,0x0C,0x83,0x50,0x9A,0x24, +0x1A,0x83,0x10,0x23,0x19,0xB3,0x72,0x8A,0x16,0x10,0x0A,0x93,0x70,0x99,0x23,0x99, +0x02,0x20,0x91,0x18,0x02,0x41,0xAB,0x24,0x18,0x81,0x99,0x4A,0xE8,0x28,0x9A,0x99, +0xA1,0x2F,0xA8,0x9D,0x90,0x08,0xCC,0xA3,0x1D,0xCA,0x82,0x0B,0xD8,0x08,0xB9,0x09, +0xBC,0xB8,0x00,0xBE,0x90,0x1B,0xCA,0x00,0x9B,0x8A,0xA8,0x91,0x0F,0xB3,0x3D,0xB8, +0x31,0x0B,0xA5,0x0A,0x11,0xA1,0x48,0x92,0x10,0x50,0x91,0x30,0x23,0x09,0x37,0x39, +0xA2,0x72,0x89,0x92,0x30,0x83,0x1C,0x96,0x28,0xB9,0x24,0x8C,0xA1,0x31,0xAD,0xA9, +0x13,0x9C,0xBA,0xA8,0x0B,0xBF,0xB8,0x9B,0xCA,0x88,0xDB,0xB8,0x19,0xFC,0x92,0x0A, +0xBA,0x89,0xAB,0xB8,0xAB,0xD8,0x08,0xAD,0xBA,0x33,0x9D,0xAA,0x83,0x3A,0xC0,0x40, +0xB9,0x15,0x39,0xA2,0x52,0x89,0x02,0x63,0x88,0x13,0x23,0x03,0x52,0x02,0x54,0x00, +0x11,0x23,0x23,0x35,0x20,0x01,0x44,0x41,0x80,0x24,0x40,0xA9,0x45,0x19,0x81,0x12, +0x81,0x02,0x11,0x21,0x19,0x02,0x61,0x8A,0x13,0x3A,0x10,0x12,0x23,0x8B,0x37,0x18, +0x91,0x24,0x10,0x81,0x34,0x20,0x05,0x32,0x82,0x53,0x20,0x14,0x33,0x31,0x34,0x52, +0x00,0x43,0x32,0x13,0x52,0x22,0x13,0x52,0x11,0x43,0x11,0x32,0x32,0x32,0x22,0x02, +0x13,0x12,0x89,0x22,0x19,0x81,0x81,0x08,0xA8,0x08,0x8B,0x90,0x1B,0xBA,0x8A,0x9B, +0xB9,0x89,0xCA,0xB9,0xAB,0xCA,0x9B,0xCA,0xB9,0xAB,0xDA,0x99,0xAC,0xBB,0x9B,0xAC, +0xAA,0xBA,0xAC,0xAB,0x9A,0xAA,0xAA,0xBA,0xB8,0xA9,0xBA,0x99,0xA9,0x9A,0xA0,0x8A, +0xA9,0x08,0x8A,0xA9,0x00,0x99,0x89,0x88,0x98,0x08,0x99,0x00,0x89,0x80,0x08,0x98, +0x00,0x88,0x88,0x80,0x90,0x80,0x90,0x80,0x81,0x99,0x08,0x88,0x99,0x09,0x00,0x1A, +0xA8,0x10,0x9A,0x88,0x08,0x0A,0x8A,0x89,0x99,0xA8,0x98,0xA9,0x99,0x99,0xA9,0x99, +0xAA,0x8A,0xAA,0x9B,0x8A,0x9A,0xA9,0x9A,0xBA,0x99,0x9A,0xAA,0x99,0x89,0xA9,0x99, +0x98,0x9A,0x98,0x88,0x09,0x89,0x09,0x08,0x08,0x09,0x18,0x18,0x00,0x12,0x00,0x11, +0x11,0x11,0x12,0x12,0x21,0x21,0x22,0x22,0x22,0x22,0x22,0x22,0x32,0x31,0x32,0x31, +0x32,0x32,0x21,0x31,0x21,0x32,0x21,0x12,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80, + +/* Source: 02SD.ROM */ +/* Length: 640 / 0x00000280 */ + +0x0A,0xDC,0x14,0x0B,0xBA,0xBC,0x01,0x0F,0xF5,0x2F,0x87,0x19,0xC9,0x24,0x1B,0xA1, +0x31,0x99,0x90,0x32,0x32,0xFE,0x83,0x48,0xA8,0xA9,0x23,0x19,0xBC,0x91,0x02,0x41, +0xDE,0x81,0x28,0xA8,0x0A,0xB1,0x72,0xDA,0x23,0xBC,0x04,0x19,0xB8,0x21,0x8A,0x03, +0x29,0xBA,0x14,0x21,0x0B,0xC0,0x43,0x08,0x91,0x50,0x93,0x0F,0x86,0x1A,0x91,0x18, +0x21,0xCB,0x27,0x0A,0xA1,0x42,0x8C,0xA9,0x21,0x10,0x08,0xAB,0x94,0x2A,0xDA,0x02, +0x8B,0x91,0x09,0x98,0xAE,0x80,0xA9,0x02,0x0A,0xE9,0x21,0xBB,0x15,0x20,0xBE,0x92, +0x42,0x09,0xA9,0x11,0x34,0x08,0x12,0x0A,0x27,0x29,0xA1,0x52,0x12,0x8E,0x92,0x28, +0x92,0x2B,0xD1,0x23,0xBF,0x81,0x10,0x99,0xA8,0x0A,0xC4,0x3B,0xB9,0xB0,0x00,0x62, +0xCF,0x92,0x29,0x92,0x2B,0xB1,0x1C,0xB2,0x72,0xAA,0x88,0x11,0x18,0x80,0x13,0x9E, +0x03,0x18,0xB0,0x60,0xA1,0x28,0x88,0x08,0x04,0x10,0x8F,0x96,0x19,0x90,0x01,0x09, +0xC8,0x50,0x91,0x8A,0x01,0xAB,0x03,0x50,0xBA,0x9D,0x93,0x68,0xBA,0x80,0x22,0xCB, +0x41,0xBC,0x92,0x60,0xB9,0x1A,0x95,0x4A,0xC8,0x20,0x88,0x33,0xAC,0x92,0x38,0x83, +0x09,0x80,0x16,0x09,0x29,0xD0,0x54,0x8C,0xA2,0x28,0x91,0x89,0x93,0x60,0xCD,0x85, +0x1B,0xA1,0x49,0x90,0x8A,0x80,0x34,0x0C,0xC9,0x14,0x19,0x98,0xA0,0x40,0xA9,0x21, +0xD9,0x34,0x0A,0xA9,0x10,0x23,0xCB,0x25,0xAA,0x25,0x9B,0x13,0xCD,0x16,0x09,0xA0, +0x80,0x01,0x19,0x90,0x88,0x21,0xAC,0x33,0x8B,0xD8,0x27,0x3B,0xB8,0x81,0x31,0x80, +0xAF,0x97,0x0A,0x82,0x0A,0xA0,0x21,0x89,0x8A,0xA2,0x32,0x8D,0xBB,0x87,0x19,0x21, +0xC9,0xBC,0x45,0x09,0x90,0x09,0xA1,0x24,0x1A,0xD0,0x10,0x08,0x11,0xA9,0x21,0xE8, +0x60,0xA9,0x14,0x0C,0xD1,0x32,0xAB,0x04,0x0C,0x81,0x90,0x29,0x83,0x9B,0x01,0x8F, +0x97,0x0B,0x82,0x18,0x88,0xBA,0x06,0x39,0xC8,0x23,0xBC,0x04,0x09,0x92,0x08,0x1A, +0xBB,0x74,0x8C,0x81,0x18,0x81,0x9D,0x83,0x41,0xCD,0x81,0x40,0x9A,0x90,0x10,0x12, +0x9C,0xA1,0x68,0xD8,0x33,0x9C,0x91,0x01,0x12,0xBE,0x02,0x09,0x12,0x99,0x9A,0x36, +0x0A,0xB0,0x30,0x88,0xA3,0x2D,0x12,0xBC,0x03,0x3A,0x11,0xBD,0x08,0xC8,0x62,0x80, +0x8B,0xD8,0x23,0x38,0xF9,0x12,0x08,0x99,0x91,0x21,0x99,0x85,0x2F,0xB2,0x30,0x90, +0x88,0xD9,0x53,0xAC,0x82,0x19,0x91,0x20,0xCC,0x96,0x29,0xC9,0x24,0x89,0x80,0x99, +0x12,0x08,0x18,0x88,0x99,0x23,0xAB,0x73,0xCB,0x33,0x9F,0x04,0x2B,0xB1,0x08,0x03, +0x1B,0xC9,0x21,0x32,0xFA,0x33,0xDB,0x02,0x33,0xAE,0xB9,0x54,0x8B,0xA1,0x20,0x89, +0x90,0x11,0x88,0x09,0x98,0x23,0xBE,0x37,0x8D,0x81,0x20,0xAA,0x34,0xBB,0x13,0x18, +0xB9,0x40,0xB1,0x18,0x83,0x8E,0xB2,0x72,0xBC,0x82,0x30,0xA9,0x9A,0x24,0x8B,0x27, +0x0E,0x91,0x20,0x90,0x08,0xB0,0x32,0xB9,0x21,0xB0,0xAC,0x45,0x9A,0xA1,0x50,0xA9, +0x80,0x0A,0x26,0x9B,0x11,0xBB,0x23,0x71,0xCB,0x12,0x10,0xB8,0x40,0xA9,0xA5,0x39, +0xC0,0x30,0xB2,0x20,0xAA,0xBA,0x76,0x1C,0xC1,0x48,0x98,0x80,0x18,0x81,0xAA,0x23, +0x9C,0xA2,0x32,0xAC,0x9A,0x43,0x9C,0x12,0xAD,0x82,0x72,0xBC,0x00,0x82,0x39,0xD1, +0x3A,0xB8,0x35,0x9B,0x10,0x40,0xF9,0x22,0x0A,0xC0,0x51,0xB9,0x82,0x18,0x98,0xA3, +0x79,0xD0,0x20,0x88,0x09,0x01,0x99,0x82,0x11,0x38,0xFC,0x33,0x09,0xC8,0x40,0xA9, +0x11,0x29,0xAA,0x94,0x3A,0xC2,0x4A,0xC0,0x89,0x52,0xBC,0x11,0x08,0x09,0xB8,0x71, +0xA9,0x08,0xA8,0x62,0x8D,0x92,0x10,0x00,0x9E,0x94,0x38,0xBA,0x13,0x88,0x90,0x4A, +0xE2,0x30,0xBA,0x02,0x00,0x19,0xD9,0x62,0xBB,0x04,0x0B,0xA3,0x68,0xB9,0x21,0x88, +0x9D,0x04,0x10,0x8C,0xC8,0x62,0x99,0xAA,0x24,0x1A,0x80,0x9A,0x14,0x9B,0x26,0x8C, +0x92,0x30,0xB9,0x09,0xA3,0x71,0xBB,0x10,0x19,0x82,0x39,0xDB,0x02,0x44,0x9F,0x10, + +/* Source: 04TOP.ROM */ +/* Length: 5952 / 0x00001740 */ + +0x07,0xFF,0x7C,0x3C,0x31,0xC6,0xC4,0xBB,0x7F,0x7F,0x7B,0x82,0x8A,0x4D,0x5F,0x7C, +0x3E,0x44,0xD2,0xB3,0xA0,0x19,0x1B,0x6C,0x81,0x28,0xC4,0xA1,0x1C,0x4B,0x18,0x00, +0x2A,0xA2,0x0A,0x7C,0x2A,0x00,0x01,0x89,0x98,0x48,0x8A,0x3C,0x28,0x2A,0x5B,0x3E, +0x3A,0x1A,0x3B,0x3D,0x4B,0x3B,0x4A,0x08,0x2A,0x1A,0x2C,0x4A,0x3B,0x82,0x99,0x3C, +0x5D,0x29,0x2B,0x39,0x0B,0x23,0xAB,0x1A,0x4C,0x79,0xA3,0x01,0xC1,0x2A,0x0A,0x38, +0xA7,0xB9,0x12,0x1F,0x29,0x08,0x82,0xA1,0x08,0xA9,0x42,0xAA,0x95,0xB3,0x90,0x81, +0x09,0xD4,0x1A,0x80,0x1B,0x07,0xB8,0x12,0x8E,0x49,0x81,0x92,0xD3,0x90,0xA1,0x2A, +0x02,0xE1,0xA3,0x99,0x02,0xB3,0x94,0xB3,0xB0,0xF4,0x98,0x93,0x90,0x13,0xE1,0x81, +0x99,0x38,0x91,0xA6,0xD3,0x99,0x94,0xC1,0x83,0xB1,0x92,0x98,0x49,0xC4,0xB2,0xA4, +0xA3,0xD0,0x1A,0x30,0xBA,0x59,0x02,0xD4,0xA0,0xA4,0xA2,0x8A,0x01,0x00,0xB7,0xA8, +0x18,0x2A,0x2B,0x1E,0x23,0xC8,0x1A,0x00,0x39,0xA0,0x18,0x92,0x4F,0x2D,0x5A,0x10, +0x89,0x81,0x2A,0x8B,0x6A,0x02,0x09,0xB3,0x8D,0x48,0x1B,0x80,0x19,0x34,0xF8,0x29, +0x0A,0x7B,0x2A,0x28,0x81,0x0C,0x02,0x1E,0x29,0x09,0x12,0xC2,0x94,0xE1,0x18,0x98, +0x02,0xC4,0x89,0x91,0x1A,0x20,0xA9,0x02,0x1B,0x48,0x8E,0x20,0x88,0x2D,0x08,0x59, +0x1B,0x02,0xA3,0xB1,0x8A,0x1E,0x58,0x80,0xC2,0xB6,0x88,0x91,0x88,0x11,0xA1,0xA3, +0xE2,0x01,0xB0,0x19,0x11,0x09,0xF4,0x88,0x09,0x88,0x19,0x89,0x12,0xF1,0x2A,0x28, +0x8C,0x25,0x99,0xA4,0x98,0x39,0xA1,0x00,0xD0,0x58,0xAA,0x59,0x01,0x0C,0x00,0x2B, +0x00,0x08,0x89,0x6B,0x69,0x90,0x01,0x90,0x98,0x12,0xB3,0xF3,0xA0,0x89,0x02,0x3B, +0x0C,0x50,0xA9,0x4E,0x6B,0x19,0x28,0x09,0xA2,0x08,0x2F,0x20,0x88,0x92,0x8A,0x11, +0xC4,0x93,0xF1,0x18,0x88,0x11,0xF2,0x80,0x92,0xA8,0x02,0xA8,0xB7,0xB3,0xA3,0xA0, +0x88,0x1A,0x40,0xE2,0x91,0x19,0x88,0x18,0x91,0x83,0xC1,0xB5,0x92,0xA9,0xC6,0x90, +0x01,0xC2,0x81,0x98,0x03,0xF0,0x00,0x2C,0x2A,0x92,0x2C,0x83,0x1F,0x3A,0x29,0x00, +0xB8,0x70,0xAB,0x69,0x18,0x89,0x10,0x0D,0x12,0x0B,0x88,0x4A,0x3A,0x9B,0x70,0xA8, +0x28,0x2F,0x2A,0x3A,0x1B,0x85,0x88,0x8B,0x6A,0x29,0x00,0x91,0x91,0x1B,0x7C,0x29, +0x01,0x88,0x90,0x19,0x2B,0x2B,0x00,0x39,0xA8,0x5E,0x21,0x89,0x91,0x09,0x3A,0x6F, +0x2A,0x18,0x18,0x8B,0x50,0x89,0x2B,0x19,0x49,0x88,0x29,0xF5,0x89,0x08,0x09,0x12, +0xAA,0x15,0xB0,0x82,0xAC,0x38,0x00,0x3F,0x81,0x10,0xB0,0x49,0xA2,0x81,0x3A,0xC8, +0x87,0x90,0xC4,0xA3,0x99,0x19,0x83,0xE1,0x84,0xE2,0xA2,0x90,0x80,0x93,0xB5,0xC4, +0xB3,0xA1,0x0A,0x18,0x92,0xC4,0xA0,0x93,0x0C,0x3A,0x18,0x01,0x1E,0x20,0xB1,0x82, +0x8C,0x03,0xB5,0x2E,0x82,0x19,0xB2,0x1B,0x1B,0x6B,0x4C,0x19,0x12,0x8B,0x5A,0x11, +0x0C,0x3A,0x2C,0x18,0x3D,0x08,0x2A,0x5C,0x18,0x00,0x88,0x3D,0x29,0x80,0x2A,0x09, +0x00,0x7A,0x0A,0x10,0x0B,0x69,0x98,0x10,0x81,0x3F,0x00,0x18,0x19,0x91,0xB7,0x9A, +0x28,0x8A,0x48,0x92,0xF3,0xA2,0x88,0x98,0x87,0xA1,0x88,0x80,0x81,0x95,0xD1,0xA3, +0x1B,0x1C,0x39,0x10,0xA1,0x2A,0x0B,0x7A,0x4B,0x80,0x13,0xC1,0xD1,0x2B,0x2A,0x85, +0xB2,0xA2,0x93,0xB2,0xD3,0x80,0xD1,0x18,0x08,0x08,0xB7,0x98,0x81,0x3F,0x01,0x88, +0x01,0xE2,0x00,0x9A,0x59,0x08,0x10,0xC3,0x99,0x84,0xA9,0xA5,0x91,0x91,0x91,0x80, +0xB5,0x94,0xC0,0x01,0x98,0x09,0x84,0xB0,0x80,0x7A,0x08,0x18,0x90,0xA8,0x6A,0x1C, +0x39,0x2A,0xB7,0x98,0x19,0x10,0x2A,0xA1,0x10,0xBD,0x39,0x18,0x2D,0x39,0x3F,0x10, +0x3F,0x01,0x09,0x19,0x0A,0x38,0x8C,0x40,0xB3,0xB4,0x93,0xAD,0x20,0x2B,0xD4,0x81, +0xC3,0xB0,0x39,0xA0,0x23,0xD8,0x04,0xB1,0x9B,0xA7,0x1A,0x92,0x08,0xA5,0x88,0x81, +0xE2,0x01,0xB8,0x01,0x81,0xC1,0xC7,0x90,0x92,0x80,0xA1,0x97,0xA0,0xA2,0x82,0xB8, +0x18,0x00,0x9C,0x78,0x98,0x83,0x0B,0x0B,0x32,0x7D,0x19,0x10,0xA1,0x19,0x09,0x0A, +0x78,0xA8,0x10,0x1B,0x29,0x29,0x1A,0x14,0x2F,0x88,0x4A,0x1B,0x10,0x10,0xAB,0x79, +0x0D,0x49,0x18,0xA0,0x02,0x1F,0x19,0x3A,0x2B,0x11,0x8A,0x88,0x79,0x8A,0x20,0x49, +0x9B,0x58,0x0B,0x28,0x18,0xA9,0x3A,0x7D,0x00,0x29,0x88,0x82,0x3D,0x1A,0x38,0xBA, +0x15,0x09,0xAA,0x51,0x8B,0x83,0x3C,0x8A,0x58,0x1B,0xB5,0x01,0xBB,0x50,0x19,0x99, +0x24,0xCA,0x21,0x1B,0xA2,0x87,0xA8,0xB1,0x68,0xA1,0xA6,0xA2,0xA8,0x29,0x8B,0x24, +0xB4,0xE2,0x92,0x8A,0x00,0x19,0x93,0xB5,0xB4,0xB1,0x81,0xB1,0x03,0x9A,0x82,0xA7, +0x90,0xD6,0xA0,0x80,0x1B,0x29,0x01,0xA4,0xE1,0x18,0x0A,0x2A,0x29,0x92,0xC7,0xA8, +0x81,0x19,0x89,0x30,0x10,0xE0,0x30,0xB8,0x10,0x0C,0x1A,0x79,0x1B,0xA7,0x80,0xA0, +0x00,0x0B,0x28,0x18,0xB1,0x85,0x1E,0x00,0x20,0xA9,0x18,0x18,0x1C,0x13,0xBC,0x15, +0x99,0x2E,0x12,0x00,0xE1,0x00,0x0B,0x3B,0x21,0x90,0x06,0xC9,0x2A,0x49,0x0A,0x18, +0x20,0xD1,0x3C,0x08,0x00,0x83,0xC9,0x41,0x8E,0x18,0x08,0x02,0xA0,0x09,0xA4,0x7B, +0x90,0x19,0x2A,0x10,0x2A,0xA8,0x71,0xBA,0x10,0x4A,0x0E,0x22,0xB2,0xB2,0x1B,0x8C, +0x78,0x1A,0xB5,0x93,0xA9,0x1B,0x49,0x19,0x29,0xA3,0xC6,0x88,0xAA,0x32,0x0D,0x1B, +0x22,0x08,0xC2,0x18,0xB9,0x79,0x3F,0x01,0x10,0xA9,0x84,0x1C,0x09,0x21,0xB0,0xA7, +0x0A,0x99,0x50,0x0C,0x81,0x28,0x8B,0x48,0x2E,0x00,0x08,0x99,0x38,0x5B,0x88,0x14, +0xA9,0x08,0x11,0xAA,0x72,0xC1,0xB3,0x09,0x8A,0x05,0x91,0xF2,0x81,0xA1,0x09,0x02, +0xF2,0x92,0x99,0x1A,0x49,0x80,0xC5,0x90,0x90,0x18,0x09,0x12,0xA1,0xF2,0x81,0x98, +0xC6,0x91,0xA0,0x11,0xA0,0x94,0xB4,0xF2,0x81,0x8B,0x03,0x80,0xD2,0x93,0xA8,0x88, +0x69,0xA0,0x03,0xB8,0x88,0x32,0xBC,0x97,0x80,0xB1,0x3B,0x1A,0xA6,0x00,0xD1,0x01, +0x0B,0x3B,0x30,0x9B,0x31,0x3E,0x92,0x19,0x8A,0xD3,0x5C,0x1B,0x41,0xA0,0x93,0xA2, +0xAF,0x39,0x4C,0x01,0x92,0xA8,0x81,0x3C,0x0D,0x78,0x98,0x00,0x19,0x0A,0x20,0x2D, +0x29,0x3C,0x1B,0x48,0x88,0x99,0x7A,0x2D,0x29,0x2A,0x82,0x80,0xA8,0x49,0x3E,0x19, +0x11,0x98,0x82,0x9A,0x3B,0x28,0x2F,0x20,0x4C,0x90,0x29,0x19,0x9A,0x7A,0x29,0x28, +0x98,0x88,0x33,0xCD,0x11,0x3A,0xC1,0xA4,0xA0,0xC4,0x82,0xC8,0x50,0x98,0xB2,0x21, +0xC0,0xB6,0x98,0x82,0x80,0x9C,0x23,0x00,0xF8,0x30,0xA8,0x1A,0x68,0xA8,0x86,0x9A, +0x01,0x2A,0x0A,0x97,0x91,0xC1,0x18,0x89,0x02,0x83,0xE0,0x01,0x8B,0x29,0x30,0xE2, +0x91,0x0B,0x18,0x3B,0x1C,0x11,0x28,0xAC,0x78,0x80,0x93,0x91,0xA9,0x49,0x8B,0x87, +0x90,0x99,0x3D,0x5A,0x81,0x08,0xA1,0x11,0x2F,0x1A,0x21,0x9B,0x15,0xA2,0xB0,0x11, +0xC0,0x91,0x5B,0x98,0x24,0xA2,0xF2,0x92,0x8B,0x6A,0x18,0x81,0xB5,0xB1,0x88,0x4C, +0x00,0x00,0xA4,0xC1,0x2B,0x1A,0x59,0x0A,0x02,0x80,0x1E,0x02,0x08,0xB3,0x80,0x9A, +0x23,0xB8,0xF2,0x84,0xAB,0x01,0x48,0x90,0xA7,0x90,0x0A,0x29,0x09,0x95,0x99,0xA0, +0x59,0x2B,0x00,0x97,0xB0,0x29,0x89,0x2A,0x03,0xD0,0xB7,0x1B,0x81,0x00,0xA6,0xB1, +0x90,0x09,0x48,0xC0,0x11,0x00,0x8A,0x00,0x5B,0x83,0x9A,0x18,0x2F,0x3C,0x18,0x11, +0xA9,0x04,0x1A,0x4F,0x01,0x98,0x81,0x09,0x09,0x4A,0x18,0xB4,0xA2,0x0B,0x59,0x90, +0x3B,0x49,0xBC,0x40,0x6A,0x88,0x3A,0x08,0x3E,0x3A,0x80,0x93,0xB0,0xE1,0x5A,0x00, +0xA4,0xB3,0xE3,0x90,0x0D,0x38,0x09,0x82,0xC4,0xA1,0xB1,0x4C,0x18,0x10,0x91,0xB2, +0x13,0xEA,0x34,0x99,0x88,0xA6,0x89,0x92,0x91,0xC1,0x20,0xB2,0xC2,0x86,0xD2,0xB3, +0x80,0xB2,0x08,0x09,0x87,0x91,0xC0,0x11,0x89,0x90,0x28,0xB9,0x79,0x19,0xA4,0x82, +0xD0,0x03,0x0C,0xA3,0xA5,0xB2,0xB2,0x1B,0x29,0x13,0xF1,0xB4,0x81,0x9D,0x38,0x00, +0xC4,0xA1,0x89,0x59,0x1A,0x81,0xA4,0xA9,0x1C,0x6A,0x19,0x02,0xB1,0x1A,0x4A,0x0B, +0x78,0x89,0x81,0x1C,0x2A,0x29,0x4A,0xA3,0x3E,0x1C,0x49,0x1A,0x08,0x21,0xAE,0x28, +0x4B,0x19,0x20,0x8C,0x10,0x3A,0xAB,0x26,0x8B,0x18,0x59,0x99,0x13,0xA2,0xAB,0x79, +0x2F,0x18,0x10,0xB2,0x80,0x1B,0x4D,0x5A,0x80,0x82,0x98,0x81,0x80,0x09,0xA5,0x90, +0x91,0x03,0xC2,0xE2,0x81,0xA8,0x82,0x09,0xC6,0xA3,0xB1,0x08,0x5B,0x08,0x05,0xD1, +0xA2,0x89,0x2A,0x28,0x91,0xA6,0x88,0xB0,0x49,0x80,0x09,0x08,0x88,0x07,0xB8,0x05, +0x99,0x81,0x88,0x18,0xE2,0x00,0xC3,0x18,0x0D,0x10,0x30,0xD0,0x93,0x8A,0x09,0x10, +0x2F,0x11,0x90,0xA1,0x20,0x9B,0xB1,0x73,0xC8,0x94,0x98,0x3B,0x01,0x0C,0x30,0x19, +0xF8,0x12,0x90,0xBA,0x78,0x0A,0x11,0x98,0xA0,0x79,0x8A,0x30,0x2B,0xC2,0x11,0x0D, +0x09,0x7A,0x00,0x82,0xB9,0x01,0x7A,0x89,0x21,0x09,0xA1,0x0A,0x7C,0x10,0x88,0xB5, +0x88,0x0A,0x2B,0x69,0x1A,0x10,0xA0,0x5B,0x19,0x1A,0x10,0x19,0x1A,0x6C,0x20,0x90, +0xA5,0x98,0x1B,0x0A,0x69,0x82,0xD1,0x18,0x09,0x19,0x2A,0x93,0xD4,0x9A,0x01,0x49, +0xA2,0xA2,0x82,0xD8,0x22,0xAA,0x97,0xA9,0x2D,0x38,0x2A,0xB6,0x80,0x90,0x0A,0x3C, +0x82,0x94,0xB8,0x21,0x0E,0x2A,0x22,0xB8,0x00,0x4F,0x2B,0x3A,0x81,0xA1,0x29,0x2C, +0x6A,0x13,0xD1,0xA2,0x98,0x28,0x0C,0x01,0xD5,0x08,0xA9,0x31,0xB3,0xB0,0xA7,0xB0, +0x29,0x1B,0x87,0xA2,0xA1,0xB2,0x4A,0x89,0x11,0xC3,0xF3,0x98,0x08,0x03,0xA0,0xA3, +0xC5,0x90,0xB3,0xB5,0xB4,0xB8,0x02,0x91,0x91,0xD3,0xA4,0xC1,0x1B,0x82,0x28,0xA4, +0xD1,0x94,0x8A,0x28,0x08,0x03,0xE0,0x80,0xD4,0x90,0x91,0xA1,0x3B,0x3D,0x02,0xE4, +0xA1,0x92,0x89,0x1A,0x4B,0x95,0xB3,0x90,0x99,0x6A,0x0A,0x30,0xA1,0x93,0xA6,0xA9, +0x85,0x8B,0x82,0x10,0xB1,0xA3,0x94,0xF8,0x38,0x9A,0x30,0x1A,0x8B,0xA7,0x89,0x01, +0x5B,0x19,0x18,0x11,0xF0,0x18,0x1C,0x39,0x19,0x0C,0x12,0x1C,0x2A,0x7B,0x3A,0x88, +0x2B,0x18,0x2B,0x5C,0x20,0x92,0x8D,0x38,0x8A,0x3A,0x5B,0x2E,0x3A,0x2B,0x10,0x12, +0xBB,0x6A,0x4D,0x18,0x10,0xB1,0x81,0x2A,0x8B,0x79,0x80,0x01,0x0A,0x09,0x5B,0x2D, +0x84,0x8A,0x08,0x02,0xA2,0x91,0x82,0xE8,0x50,0x9B,0x85,0xA3,0xB0,0xA3,0x1B,0x02, +0x18,0xF3,0xA2,0x88,0xAB,0x53,0xD1,0xB4,0xA3,0x09,0x09,0x18,0xD4,0x08,0xB0,0x09, +0x58,0xD1,0x82,0x89,0x81,0x1A,0x18,0x05,0xB9,0xC3,0x30,0xC0,0x95,0x80,0xC3,0x89, +0x89,0x13,0x88,0xF2,0x93,0x0E,0x18,0x01,0x92,0xA5,0xB8,0x2A,0x39,0xAA,0x33,0x9A, +0xB1,0x11,0xF5,0xA1,0xA1,0x0A,0x50,0xB8,0x03,0xC4,0xA0,0x4E,0x29,0x10,0x88,0xC2, +0x1A,0x39,0x1D,0x28,0x98,0x94,0x0E,0x10,0x2A,0x3C,0x02,0x2D,0x1B,0x4B,0x3B,0x49, +0x19,0xA9,0x48,0x2F,0x29,0x10,0x89,0x02,0x0C,0x10,0x09,0xB9,0x70,0x1B,0x8A,0x50, +0xA8,0x2B,0x49,0x89,0x69,0x88,0x95,0x89,0x90,0x92,0x4C,0x19,0x82,0xC1,0x01,0x80, +0xA0,0x2B,0x7A,0x81,0x10,0xC2,0xB7,0x98,0x88,0x19,0x2C,0x03,0xB1,0xA4,0xA1,0x0C, +0x3B,0x78,0x88,0x85,0xB1,0xA0,0x1B,0x3A,0x4A,0x08,0x94,0x81,0xF1,0x80,0x00,0x0C, +0x59,0x09,0x18,0x90,0xA6,0x92,0x8C,0x1A,0x79,0x92,0xA8,0x00,0x81,0x2E,0x2A,0x13, +0xA2,0xB0,0xA5,0x88,0x88,0x89,0x11,0x19,0xA0,0xF3,0x82,0xB0,0x83,0x5F,0x2A,0x01, +0xA1,0x94,0xB0,0x09,0x78,0x98,0xA3,0xA6,0xA0,0x91,0x80,0x93,0x98,0xC1,0x12,0x18, +0xC9,0x17,0xA0,0xA0,0x1A,0x21,0x80,0x99,0xD4,0x30,0x9D,0x00,0x10,0x2F,0x08,0x1C, +0x21,0x08,0xB4,0xC3,0x2B,0xA9,0x52,0xD2,0xA3,0xD1,0x09,0x10,0x8B,0x24,0x92,0xD1, +0x80,0x19,0xA0,0x2C,0x12,0x49,0xAA,0xB6,0x95,0xB8,0x08,0x3A,0x2B,0x01,0xF3,0xB3, +0x0B,0x09,0x79,0x18,0xA2,0xA4,0xA0,0x18,0x0C,0x20,0x08,0xA9,0x16,0x0C,0x00,0x1B, +0x08,0x2B,0x7B,0x01,0x01,0xB9,0x59,0x19,0x8B,0x45,0xA8,0x80,0x0C,0x1A,0x41,0x1E, +0x00,0x28,0xA8,0x5A,0x00,0xC1,0x49,0x99,0x21,0x1D,0x08,0x85,0x99,0x95,0x89,0x90, +0x11,0x90,0xD1,0x28,0xB2,0xA7,0x99,0x81,0x02,0xAC,0x13,0x81,0xB2,0xA6,0xA9,0x28, +0x1C,0xB1,0x33,0xD1,0xC1,0x58,0xA8,0x14,0xB0,0xB7,0x91,0xA0,0x82,0x89,0xC2,0x28, +0xA1,0xB2,0x49,0xD2,0x94,0xC8,0x12,0x80,0x99,0x85,0x08,0xD3,0x09,0xA2,0xB3,0x1E, +0x08,0x21,0xB9,0x23,0xB4,0xAB,0x41,0xAC,0x87,0x09,0xA2,0xC5,0x0B,0x2A,0x5A,0x91, +0x20,0x9A,0x89,0x78,0x9B,0x31,0x89,0x80,0x29,0x0A,0xB7,0x3C,0x98,0x48,0x1D,0x00, +0x01,0xB0,0x20,0x2F,0x29,0x4A,0x89,0x94,0x1C,0x88,0x28,0x2B,0x10,0x88,0x9A,0x71, +0x9A,0x08,0x4A,0x2F,0x18,0x2B,0x18,0x02,0xA8,0x4B,0x7A,0x99,0x48,0x80,0xA8,0x20, +0x1D,0x40,0xA8,0x10,0x08,0xA8,0xC5,0x88,0xC2,0x18,0x88,0x2A,0x12,0xF3,0x82,0xD8, +0x20,0x0A,0x09,0xA6,0x98,0x04,0xB9,0x11,0x18,0xC3,0xE1,0x29,0xA1,0x11,0xC1,0x03, +0xE2,0x9A,0x33,0xA9,0xB5,0x98,0x92,0xA1,0x02,0xF8,0x21,0xA8,0x10,0x02,0xC1,0xB7, +0x1B,0x90,0x5B,0x3C,0x83,0x93,0xE0,0x19,0x1A,0x11,0x11,0xF1,0x92,0x89,0x19,0x2C, +0x2C,0x41,0x99,0x92,0x90,0x3F,0x18,0x4B,0x00,0x08,0xD2,0x01,0xB2,0xAA,0x78,0x09, +0x01,0x91,0xA2,0x98,0x2F,0x3A,0x2C,0x01,0x00,0x93,0xE0,0x28,0x2C,0x2B,0x01,0x12, +0xE1,0x80,0xB3,0x3D,0x3A,0x0A,0x50,0x98,0xC2,0xA0,0x11,0xAA,0x30,0x87,0x90,0xC2, +0x29,0x88,0x38,0xC8,0xB5,0x90,0xBA,0x70,0x1A,0x02,0x94,0xD0,0x80,0x1A,0x82,0xA6, +0xB0,0x91,0x18,0xB3,0x00,0x13,0xF1,0xA2,0xC1,0x82,0xB0,0x00,0x15,0x0B,0xD3,0x02, +0xA8,0x91,0x2B,0x1F,0x49,0x88,0xA6,0x80,0x88,0x08,0x1B,0xA5,0x80,0xB9,0x06,0x0B, +0x90,0x21,0x9D,0x48,0x18,0xA0,0x15,0xC9,0x82,0x2B,0x1A,0x42,0x9A,0xC4,0x39,0xBC, +0x69,0x00,0xA0,0x29,0x8C,0x39,0x59,0x08,0x09,0x49,0xA9,0x6B,0x81,0x00,0x98,0xB0, +0x68,0x3D,0x81,0x88,0x18,0x19,0x1D,0x12,0x80,0xB2,0x3A,0x3F,0x85,0x92,0xD0,0x00, +0x0A,0x19,0x12,0xF1,0x02,0x9B,0x19,0x40,0xB9,0x11,0x02,0xF2,0x1A,0x08,0x94,0x0A, +0xC2,0x83,0x0B,0xB4,0xA4,0xC0,0x32,0xD8,0x86,0x98,0x90,0x95,0x89,0xA3,0x83,0xC2, +0x92,0xE1,0x92,0x82,0xD9,0x03,0x08,0xA9,0x85,0x92,0xA2,0x80,0xE0,0x30,0x8B,0xB3, +0x87,0x89,0x90,0x83,0xA0,0x08,0x92,0x93,0x3E,0xAB,0x43,0x89,0xE3,0x80,0x83,0x2F, +0x00,0xA3,0x80,0xC9,0x22,0x3F,0x08,0x81,0x0B,0x33,0x9A,0xA3,0x7B,0x0C,0x29,0x4A, +0x1B,0x21,0xAA,0x70,0x1B,0x0D,0x48,0x1A,0x81,0x88,0xB1,0x39,0x3F,0x08,0x58,0xA0, +0x81,0x1A,0x1A,0x2B,0x6D,0x11,0x0A,0x91,0x01,0x1A,0x98,0x5A,0x0C,0x03,0xB1,0x84, +0xA3,0xAD,0x58,0x2A,0xA1,0x84,0xB1,0xA0,0x5C,0x2B,0x13,0xA8,0x95,0x83,0xE8,0x10, +0x81,0xB0,0x00,0xC2,0x96,0xA0,0x91,0x00,0x2C,0x90,0x30,0xF2,0x80,0xA8,0x39,0x21, +0xC1,0x03,0xAC,0x39,0x7C,0x29,0x91,0x1A,0x00,0x19,0x2C,0x3A,0x93,0xB0,0x29,0x8F, +0x28,0x02,0x93,0xF3,0xA9,0x01,0x03,0xE0,0x08,0x09,0x1D,0x58,0xA1,0x83,0xA9,0x6B, +0x2A,0x3C,0x21,0x89,0xC2,0x2C,0x4B,0x8A,0x50,0x81,0x98,0xA8,0x32,0x0C,0x8E,0x24, +0x0B,0x1A,0x81,0x92,0xA1,0x4F,0x18,0x3A,0x0A,0xB4,0x18,0x2E,0x39,0x82,0x19,0xD3, +0xD0,0x28,0x1B,0x11,0x98,0x07,0xAA,0x28,0x00,0x88,0xB4,0x89,0x1B,0x1F,0x22,0x00, +0xB3,0xC9,0x33,0xAB,0x2B,0xB5,0x48,0x98,0x98,0xA7,0x10,0xD2,0xC1,0x23,0xCA,0x93, +0xC6,0x80,0xA1,0x88,0x02,0x89,0xE2,0x09,0x38,0xBA,0x40,0x89,0x21,0xD8,0x49,0x10, +0x8D,0x02,0x90,0xC3,0x9A,0x24,0x89,0x08,0x84,0xA5,0x9C,0x10,0x11,0x9C,0x88,0x30, +0x3C,0xA1,0x94,0x58,0x8C,0x0B,0x69,0x29,0x9A,0x81,0x12,0x2B,0x8B,0x79,0x94,0xB0, +0xC1,0x84,0xC2,0x99,0x25,0x99,0x11,0xA2,0x93,0xE4,0x99,0x80,0x0A,0x00,0x10,0xB7, +0xB0,0x31,0xBA,0x3C,0x21,0xB3,0xF1,0x18,0xA0,0x2A,0x20,0xA3,0x06,0xE8,0x28,0xA1, +0xB4,0x08,0x0B,0x11,0x4B,0xB7,0x90,0xA5,0x98,0x3D,0x19,0x02,0xA1,0xC4,0xB2,0x19, +0x28,0xC0,0xA5,0x92,0xB1,0xA3,0x0A,0x0A,0x08,0x2B,0x70,0xC4,0xB3,0x00,0xBC,0x4B, +0x39,0x12,0xE3,0xA0,0x00,0x3F,0x18,0x29,0x94,0xD1,0x19,0x09,0x00,0xA1,0x83,0x99, +0x9B,0x35,0x80,0xC4,0xB1,0x6A,0x1A,0x1C,0x29,0x38,0x0E,0x19,0x5A,0x1A,0x82,0x8A, +0x59,0x2A,0x2E,0x20,0x88,0xA8,0x3A,0x38,0x3D,0x00,0xB3,0x29,0xAD,0x49,0x10,0x0C, +0x01,0x01,0xA3,0x8F,0x85,0x09,0x1B,0x88,0x10,0xA3,0xD2,0x90,0x3C,0x5C,0x39,0x03, +0xD1,0xA0,0x00,0x2A,0x0B,0x04,0xA7,0x90,0xA0,0x11,0x90,0x99,0x83,0xB4,0xB1,0xF1, +0x84,0x88,0x90,0x18,0x18,0xD3,0xD2,0xB3,0xA0,0x1A,0x21,0xA7,0xB2,0xB3,0x92,0x9A, +0x22,0xB9,0x28,0x38,0xBD,0x87,0x2A,0xB1,0x13,0x0D,0x0A,0x38,0xC9,0x24,0xC0,0x19, +0x23,0x0F,0x01,0x88,0xC0,0x2A,0x82,0x18,0x28,0xF0,0x18,0x2A,0x29,0x4B,0x35,0xB8, +0xA3,0x9D,0x18,0x1B,0x40,0x00,0x9A,0x5C,0x3A,0x09,0x2F,0x38,0x8A,0x3B,0x3B,0x11, +0x5C,0x19,0x2B,0x4A,0x08,0x0A,0x3D,0x20,0x4F,0x3A,0x19,0x2A,0x18,0x4D,0x1B,0x3A, +0x11,0x0D,0x3A,0x3C,0x4B,0x93,0x81,0xAA,0x6B,0x4A,0x18,0x00,0xC3,0xC3,0x9A,0x59, +0x2A,0x1B,0xA7,0xA1,0x81,0x88,0x88,0x58,0xB2,0xB1,0x2B,0x83,0xD4,0x81,0x08,0x0F, +0x00,0x20,0xC2,0xE2,0x80,0x08,0x1C,0x29,0x04,0xB1,0xA2,0x01,0x1C,0x91,0x00,0x0C, +0x49,0xB0,0x43,0xF2,0x99,0x39,0x3F,0x00,0x81,0x94,0xC1,0x09,0x1A,0x69,0x90,0x80, +0x94,0xAA,0x20,0x2A,0x91,0xB1,0x39,0x7A,0x38,0xD1,0x10,0x8A,0x8C,0x5A,0x01,0xB5, +0x98,0x80,0x2A,0x0B,0x32,0x92,0xF1,0x81,0x9A,0x23,0x8A,0xA3,0xB7,0x09,0x03,0x08, +0xD0,0x94,0x9A,0x09,0x01,0x93,0xB7,0xC2,0x8C,0x3A,0x83,0x99,0x05,0xA0,0x0B,0x29, +0x93,0xE5,0x80,0x89,0x38,0x90,0x8A,0xD7,0xA1,0x19,0x1B,0x48,0x98,0x92,0xC3,0xA1, +0x09,0x3F,0x02,0x0C,0x22,0xC3,0xB2,0xA1,0x01,0x9F,0x4A,0x01,0xA3,0xD3,0xB0,0x28, +0x3F,0x29,0x20,0xA2,0xC2,0xB1,0x08,0x5A,0x98,0x13,0xD2,0xC1,0x01,0xB2,0x80,0x3D, +0x03,0xC1,0x89,0x96,0x90,0x90,0x3A,0x1A,0x9A,0x32,0xB6,0xA2,0x8E,0x4A,0x28,0x8A, +0x84,0xA2,0x8A,0x2D,0x49,0x09,0x88,0x18,0x30,0x9D,0x2C,0x23,0xB1,0x0C,0x92,0x2D, +0x39,0x82,0xC4,0x2E,0x10,0x1A,0x10,0xB9,0x48,0x19,0x39,0xBA,0x34,0xDA,0x2D,0x48, +0x1A,0xA6,0x98,0x83,0x9A,0x1D,0x38,0x04,0xD0,0x18,0x90,0x2C,0x11,0x93,0xD3,0x9A, +0x11,0x08,0x82,0xF1,0x01,0xA0,0x2A,0x93,0xD3,0xB4,0xB8,0x82,0x2F,0x11,0xA3,0xB3, +0xA8,0x3B,0x09,0x23,0x96,0xC8,0x3B,0x3F,0x93,0x82,0xA1,0x90,0x3F,0x28,0x81,0xD1, +0x93,0x08,0x2D,0x18,0x91,0xB3,0xB5,0x98,0x2A,0x2B,0x84,0xB1,0x5B,0x8A,0x31,0x18, +0x80,0x8B,0x7E,0x39,0x2B,0x02,0xC1,0x8B,0x6C,0x49,0x09,0x10,0xA1,0x08,0x01,0x0C, +0x20,0xA1,0x09,0x4F,0x18,0x00,0x01,0xA0,0x5C,0x1B,0x5B,0x10,0x92,0x90,0x2B,0x5A, +0x3D,0x18,0x91,0x19,0x98,0x2D,0x39,0x89,0x2D,0x3A,0x48,0x2C,0x11,0xB5,0x9A,0x19, +0x5B,0x28,0x90,0x95,0x98,0x89,0x2B,0x40,0x08,0x90,0xF3,0x0A,0x08,0xA6,0x80,0x91, +0xB2,0xA0,0x02,0xF2,0xA1,0xB7,0x89,0x81,0x82,0x91,0xB1,0x21,0xAB,0x32,0xE9,0x04, +0xA2,0x8D,0x12,0x91,0xA3,0xA3,0xD2,0x8B,0x39,0xD1,0x84,0xE2,0x90,0x00,0x2B,0x29, +0xA3,0xD4,0xA1,0x91,0x1D,0x5A,0x08,0x19,0x11,0x99,0x08,0x18,0x49,0x0F,0x18,0x10, +0x82,0xF1,0x00,0x89,0x2F,0x3A,0x01,0xB3,0xC2,0x81,0x3F,0x29,0x08,0x10,0xA1,0xA1, +0x3B,0x5D,0x19,0x28,0x0B,0x38,0x82,0x91,0x19,0xBD,0x3B,0x7A,0x80,0x12,0xB3,0xE0, +0x0B,0x6A,0x01,0x88,0xA4,0x08,0x0B,0x08,0x59,0x80,0x80,0x1D,0x49,0x89,0x00,0x84, +0x99,0x1A,0x2B,0x32,0xE3,0xB4,0xA9,0x3A,0x99,0x31,0xE3,0xAA,0x58,0x3B,0x88,0x95, +0xC0,0x18,0x4A,0x09,0x30,0xF2,0xA3,0x1C,0x1B,0x49,0x00,0xD3,0xB2,0xA0,0x18,0x11, +0x92,0xD3,0xB2,0x91,0x80,0xE7,0xA1,0x91,0x98,0x19,0x22,0xC2,0xD2,0x18,0x8D,0x3B, +0x10,0xA5,0x91,0x98,0x02,0x3E,0x80,0x01,0x90,0xAA,0x13,0xF1,0x02,0xD1,0x08,0x19, +0x49,0xB4,0x91,0xB4,0x99,0x2A,0x0C,0x32,0xC0,0x05,0x88,0x0B,0x80,0x2C,0x81,0x10, +0x0B,0x51,0xA9,0x19,0x05,0xBF,0x28,0x20,0xE1,0x90,0x80,0x28,0x19,0x08,0x26,0xB1, +0xA1,0x18,0x88,0x2A,0xF0,0x12,0x8A,0xB3,0x14,0x1B,0xD4,0xD8,0x10,0x08,0x8A,0x17, +0xA0,0x98,0x2B,0x3A,0x29,0x48,0xA4,0x99,0x0E,0x4A,0x12,0x8B,0x31,0x8B,0x4E,0x1A, +0x11,0xB5,0x89,0x91,0x29,0x89,0xC2,0x97,0x90,0x0A,0x19,0x11,0x91,0xC1,0xD5,0x08, +0x89,0x20,0x91,0xB1,0x1A,0x2D,0x18,0x29,0xD2,0x3B,0x3E,0x3A,0x2A,0x90,0x82,0x1C, +0x49,0x3B,0x93,0xB6,0xC8,0x4C,0x02,0x91,0x93,0xF2,0x88,0x2D,0x28,0x81,0x82,0xC1, +0x89,0x2D,0x6B,0x19,0x82,0x80,0x18,0x8B,0x39,0x39,0xC8,0x3A,0x6A,0x0A,0x22,0xD2, +0x09,0x2C,0x1A,0x68,0x92,0xE2,0x89,0x2A,0x2A,0x30,0xC2,0xA3,0xB4,0x1D,0x2A,0x09, +0x93,0x18,0xF2,0x89,0x28,0xB3,0x01,0x8F,0x18,0x11,0xA1,0x93,0x90,0xD1,0x7A,0x20, +0xC3,0xA2,0xA8,0x88,0x1D,0x28,0xA5,0xA2,0xA2,0x0B,0x29,0x2B,0x87,0xC1,0x80,0x0A, +0x19,0x01,0x12,0xF1,0x10,0x80,0x0A,0x18,0x08,0x2F,0x4A,0x02,0x89,0x1B,0x29,0x5D, +0x4C,0x08,0x82,0xA1,0x0A,0x3A,0x4B,0x29,0xC6,0xC3,0x09,0x09,0x88,0x39,0x98,0x82, +0xA5,0x1A,0x30,0x11,0xBD,0x3F,0x12,0x8B,0x28,0xC3,0x88,0x3F,0x2B,0x3B,0x48,0xA1, +0x80,0x8A,0x4D,0x39,0x01,0x93,0xA2,0xF1,0x19,0x19,0x0A,0x02,0xB2,0x8B,0x24,0xD2, +0x4B,0x12,0xC8,0x2E,0x10,0xB5,0x89,0x01,0x09,0x1C,0x2A,0x03,0xD4,0x91,0x98,0x99, +0x11,0x2B,0xE4,0x00,0x00,0x01,0xE0,0xA5,0x89,0x99,0x31,0x18,0xD0,0xB7,0x98,0x18, +0x0A,0x10,0x94,0xC2,0x90,0x18,0x00,0x99,0x87,0xA0,0x90,0x2A,0x3C,0x02,0xB8,0xC1, +0x79,0x1A,0x20,0x08,0xA1,0xD2,0x1C,0x29,0x03,0xD1,0x29,0x99,0x2C,0x50,0xB3,0xD1, +0x08,0x09,0x3C,0x10,0x04,0xB2,0x0D,0x2B,0x59,0x80,0x90,0x01,0x0F,0x3A,0x18,0x01, +0xA2,0x9B,0x5B,0x3D,0x81,0x03,0xD2,0x98,0x59,0x90,0x81,0x92,0xB4,0x8B,0x1B,0x40, +0xB2,0xB5,0x08,0x4B,0x01,0x09,0xD1,0x91,0x8B,0x7A,0x10,0xB3,0xC3,0x99,0x49,0x1A, +0x29,0xB5,0xA2,0xAB,0x40,0x81,0x19,0xB7,0xB0,0x20,0x2B,0xD4,0x88,0xA1,0x91,0x3C, +0x82,0x37,0xD3,0xB1,0x8A,0x1B,0x30,0xB3,0xF4,0xA1,0x91,0x09,0x10,0x03,0xD0,0x83, +0xA9,0x8F,0x10,0x01,0x90,0x18,0x80,0x20,0x2B,0xF1,0x28,0x99,0x2A,0x41,0xF0,0x12, +0xAA,0x83,0x82,0xD1,0xC1,0x08,0x89,0x59,0x09,0x83,0x87,0xB0,0x2A,0x4D,0x18,0x09, +0x19,0xB3,0x4B,0x3F,0x39,0x19,0x09,0x01,0x89,0x03,0x1F,0x00,0x1A,0x0B,0x10,0x68, +0xA0,0x18,0x8C,0x6A,0x09,0x08,0x97,0xA1,0x81,0x1B,0x2B,0x4C,0x03,0xB4,0xA8,0x92, +0x4B,0x3C,0xA1,0x81,0x95,0xA8,0x81,0x12,0xBB,0x92,0x45,0xB9,0x93,0xF4,0x88,0x0A, +0x2D,0x28,0x00,0xA3,0xA3,0x8A,0x3F,0x48,0xB1,0x92,0xB4,0xA8,0x30,0x80,0xD3,0x80, +0xD1,0x19,0x3B,0xC4,0x81,0xC1,0x29,0x0D,0x20,0x13,0xC8,0xB4,0x4C,0x09,0x00,0x82, +0xC2,0x3B,0x0D,0x30,0x0B,0x12,0xF0,0x1B,0x20,0x0A,0xA6,0x80,0x0A,0x4A,0x4A,0x80, +0x94,0xB1,0x2E,0x3B,0x1A,0x10,0x93,0x10,0x4C,0x3D,0x08,0x82,0xC9,0x19,0x6A,0x2B, +0x38,0xD1,0x08,0x19,0x2A,0x5A,0x82,0xB1,0x8D,0x29,0x78,0x09,0x82,0x0A,0x2C,0x1B, +0x19,0x41,0xB8,0x8C,0x79,0x2B,0x11,0x88,0x82,0x91,0xDC,0x28,0x11,0xB0,0x11,0x18, +0xC9,0x62,0xA1,0x91,0x98,0x3B,0x3A,0xB0,0xF4,0x01,0xC0,0x29,0x39,0xF8,0x95,0x91, +0x88,0x88,0x91,0x03,0xA1,0xE2,0x18,0x82,0xD1,0xA2,0xD1,0x80,0x19,0x20,0x83,0xB1, +0xE3,0x80,0x91,0x4D,0x1A,0x03,0xB2,0x09,0x18,0xD1,0x19,0x09,0x92,0xA6,0xA0,0xB6, +0xB2,0x8B,0x38,0x10,0x42,0xD3,0xD0,0xA8,0x20,0x2C,0x10,0x01,0xB1,0xB4,0xAB,0x5B, +0x79,0x80,0x10,0x1A,0xA8,0x3D,0x18,0x20,0xB3,0x8F,0x18,0x01,0x00,0x09,0xF3,0x89, +0x69,0x88,0x81,0x91,0x08,0xE1,0x1A,0x08,0x11,0x81,0x1E,0x29,0xA0,0x01,0x00,0x90, +0x3E,0x7B,0x18,0x82,0xC3,0xA1,0x2A,0x2C,0x5B,0x81,0xA5,0x90,0x81,0x00,0x0B,0x1A, +0x1C,0x2C,0x32,0xC0,0xF3,0x80,0x2D,0x2A,0x10,0x02,0xE4,0xC1,0x89,0x4A,0x09,0x01, +0x03,0xD2,0x98,0x2A,0x39,0x8A,0x89,0x26,0xB1,0xB2,0x12,0xC0,0x0A,0x5A,0x18,0x98, +0xF3,0x92,0x99,0x99,0x79,0x01,0xB5,0xA1,0x80,0x80,0x90,0x83,0xA0,0xE2,0x81,0x29, +0x93,0x8A,0x0A,0x6A,0x1F,0x18,0x02,0xC8,0x01,0x19,0x3B,0x4A,0x98,0x17,0xA8,0x0D, +0x38,0xA1,0x91,0x10,0xA2,0x2B,0x4C,0xA6,0x81,0xBA,0x21,0x4C,0x80,0x21,0xD1,0x92, +0x2C,0x08,0x30,0x9F,0x93,0x2A,0x89,0x03,0x8B,0x87,0x0A,0x0D,0x12,0x98,0xA4,0x93, +0xBB,0x59,0x18,0xA1,0x32,0xE9,0x84,0x08,0x8A,0x02,0xA1,0x91,0x4B,0xB4,0x20,0x88, +0xF0,0x3A,0x1A,0x88,0x87,0xB1,0x92,0x0A,0x08,0x6B,0x83,0xC3,0x91,0xC0,0x2B,0x79, +0x08,0x8A,0x84,0xA0,0x89,0x40,0x1B,0xA1,0x39,0x98,0x17,0xC2,0xA2,0x12,0xCD,0x20, +0x89,0x92,0x25,0xB0,0x2D,0x3A,0x8B,0x58,0x2A,0xA0,0x4C,0x08,0x30,0xAE,0x82,0x59, +0x89,0x1A,0x10,0xC2,0x18,0x2C,0x40,0x1E,0x01,0xA3,0x8A,0x81,0x2C,0x29,0x29,0xA9, +0x13,0x51,0xAD,0x12,0x89,0x8F,0x18,0x2C,0x39,0x00,0xC1,0x10,0x3C,0x2A,0x41,0xC8, +0xA2,0x91,0x0A,0x6C,0x10,0x12,0x88,0xE8,0x30,0x91,0x81,0xD8,0x01,0x1B,0x0D,0x07, +0x00,0xA8,0x92,0x0A,0x28,0xD2,0xC3,0x02,0xAA,0x94,0x81,0xB4,0xB3,0x1A,0x0B,0x13, +0xF9,0x16,0xA1,0x8A,0x59,0x19,0x02,0xC1,0x91,0x8B,0x3D,0x18,0x3B,0xA4,0x94,0x80, +0x99,0x88,0x1C,0x79,0x0A,0x02,0x03,0xF8,0x90,0x39,0x5B,0x19,0x02,0xC3,0x90,0xBB, +0x58,0x6A,0x09,0x02,0x89,0x91,0x88,0x1A,0x69,0x8A,0x19,0x15,0xA0,0xA2,0x00,0x9A, +0x6B,0x49,0x88,0xA3,0x92,0xBB,0x6B,0x3D,0x38,0x01,0x98,0x91,0x3F,0x09,0x18,0x20, +0x90,0x80,0xAC,0x70,0x91,0x9B,0x51,0x09,0x88,0x99,0x14,0x8B,0x98,0x83,0x79,0xA0, +0x99,0x13,0x01,0x19,0xE0,0x83,0x0B,0xB0,0x0C,0x31,0x95,0xB5,0xC2,0x8A,0x39,0x20, +0x80,0x39,0xF3,0xB1,0x10,0x88,0x5E,0x18,0x94,0xA1,0x88,0xA1,0x98,0x15,0xAA,0x39, +0xD4,0x84,0xC0,0xA2,0xA2,0x0C,0x81,0x86,0xB5,0xA1,0xB1,0x14,0x1B,0xB1,0x02,0x92, +0xC3,0xE0,0x88,0x11,0xAA,0x69,0x18,0x81,0xA3,0xB0,0x01,0xBF,0x2A,0x31,0x93,0xF1, +0x00,0x89,0x18,0x19,0x11,0xD3,0xE0,0x10,0x18,0xB1,0x18,0x24,0x9A,0x2B,0xA4,0xC0, +0xB0,0x31,0x6C,0x19,0xB4,0x12,0xA8,0xEA,0x58,0x10,0x8B,0x93,0x82,0x88,0x9A,0x41, +0x10,0xC3,0xEA,0x41,0xA9,0x9C,0x34,0xA1,0x2A,0x79,0xA2,0x01,0xA8,0xB3,0x28,0xCC, +0x41,0x9A,0xB3,0x4B,0xB3,0x27,0x8B,0x83,0x2B,0x2F,0x08,0x28,0xB2,0x80,0x2C,0x30, +0x5E,0x09,0x12,0x9B,0x09,0x22,0x5B,0x19,0x8A,0x11,0x59,0x99,0xA4,0x32,0xCD,0x18, +0x08,0x10,0x85,0xB3,0xB4,0x1E,0x88,0x28,0x8A,0x11,0x09,0xC0,0x79,0x80,0x91,0x3B, +0x80,0x10,0x0F,0x01,0x80,0x91,0x19,0x3D,0x92,0x28,0xA8,0x37,0x9A,0x0A,0x3A,0x8A, +0x45,0xA9,0xA4,0x00,0xAA,0x09,0x3D,0x59,0x20,0xE1,0x08,0x98,0x90,0x59,0x10,0x09, +0xA3,0xC3,0x93,0x99,0x2B,0x69,0x11,0xD1,0xB1,0xA4,0x91,0x3C,0x89,0x83,0xF0,0x10, +0x91,0xA1,0x89,0x59,0x05,0x99,0x93,0x94,0xC8,0x08,0x0A,0x09,0x17,0xB1,0x83,0xC1, +0x91,0x40,0xA2,0xC2,0x98,0xC3,0xBA,0x28,0x23,0x0F,0x80,0x50,0xB8,0x19,0x10,0x96, +0x98,0x8C,0x05,0x98,0x19,0x29,0x2B,0x3B,0x0A,0xE2,0x01,0x0F,0x3C,0x38,0x08,0x09, +0x81,0x4A,0x6C,0x08,0x00,0x88,0x98,0x38,0x2C,0x5A,0x1B,0x20,0x1A,0x39,0xB0,0x09, +0xCB,0x5B,0x49,0x09,0x71,0x00,0xC1,0x0E,0x08,0x38,0x0C,0x02,0x10,0x0E,0x10,0x8A, +0x48,0x19,0x90,0x92,0x0D,0xA3,0x98,0x3B,0x79,0x19,0x01,0x10,0xE1,0x80,0x19,0x2B, +0x10,0xF2,0x02,0xAB,0x84,0x9A,0x29,0xB4,0x80,0x92,0x03,0x88,0x95,0xD0,0x03,0x90, +0xA0,0xC7,0xA1,0xB0,0xA2,0x02,0x18,0xB5,0xD4,0x01,0xC0,0x08,0xA2,0x93,0xA8,0xA0, +0xC3,0x20,0xF3,0x90,0x00,0xD5,0x08,0x89,0xA5,0x80,0xA0,0x81,0x82,0xC2,0x09,0xD1, +0x13,0xCB,0x03,0x84,0x91,0xE1,0x1B,0x12,0x08,0xAB,0x87,0x18,0xAB,0x58,0x89,0x28, +0x81,0xC9,0x33,0xA9,0x80,0x2E,0x20,0x83,0xB9,0x20,0x3B,0x9E,0x7A,0x08,0x81,0x18, +0x0B,0x88,0x79,0x80,0x8B,0x00,0x12,0x0E,0x89,0x51,0x1B,0x81,0xA0,0x3A,0x01,0xAF, +0x11,0x28,0xBA,0x35,0x98,0x88,0x52,0xC0,0x83,0x2F,0xA9,0x11,0x0A,0x19,0x25,0xD0, +0x30,0x9C,0x08,0x21,0x98,0x81,0x2A,0xF3,0x2A,0x80,0xB6,0x2B,0x08,0x93,0xE9,0x02, +0x81,0x8C,0x21,0x00,0xA6,0xA9,0x94,0x01,0x8F,0x80,0x94,0x98,0x93,0xB4,0x00,0x08, +0xC0,0x14,0x98,0xB3,0xB4,0xC1,0x09,0x18,0xA7,0x00,0xA3,0xC8,0x0A,0x3C,0x19,0x96, +0x83,0xC1,0x99,0x19,0x4A,0x85,0x80,0xC1,0x91,0x99,0x90,0x2A,0x17,0x95,0x99,0x88, +0x12,0xAE,0x39,0x08,0x92,0x84,0xB0,0xA8,0x79,0x09,0x19,0x01,0xB2,0xA3,0x8F,0x28, +0x2B,0xA2,0x40,0x82,0xA0,0x4C,0xA9,0x39,0x8D,0x81,0x70,0x88,0xA0,0x1A,0x49,0x2D, +0x1A,0x26,0xA8,0x98,0x08,0x29,0x0B,0x12,0x96,0xB1,0xB2,0x3A,0x13,0x9B,0x60,0xA0, +0x88,0xB2,0x34,0xEA,0x1A,0x2A,0x79,0x98,0x10,0x04,0x8C,0x1C,0x81,0x04,0x8C,0x83, +0x19,0x2F,0x81,0x93,0x98,0x10,0x08,0x30,0x2A,0xFA,0x05,0x08,0x2A,0x89,0x91,0xA3, +0xFA,0x11,0x11,0x00,0x8C,0x04,0x8A,0x2A,0xB5,0x10,0xA9,0xC2,0x3D,0x1B,0x32,0x04, +0x0A,0x1A,0x09,0x40,0x1F,0x92,0x1D,0x2A,0x91,0x10,0x30,0x2F,0x0B,0x68,0x99,0xA2, +0x92,0x88,0x78,0xA9,0x20,0x28,0xE2,0x92,0x1A,0x99,0x4B,0x19,0x22,0xA1,0xE2,0x21, +0x2F,0x98,0x29,0x18,0x91,0x08,0xB0,0x79,0x1A,0x82,0x3B,0xB1,0xA7,0x8A,0xB3,0x98, +0x5B,0x23,0xCA,0x42,0x83,0xF0,0x90,0x18,0x98,0x08,0xB4,0x20,0xA3,0xC0,0x43,0xD8, +0x80,0x81,0xA3,0x99,0xD9,0xA7,0x19,0x90,0x10,0x05,0xB1,0x8B,0x02,0xA4,0xBD,0x23, +0x93,0x8A,0x99,0x4B,0x03,0xC1,0xF8,0x38,0x09,0x2B,0x14,0xD0,0x03,0x8A,0x2A,0x39, +0xB9,0x97,0x90,0xAA,0x50,0x01,0x99,0x51,0xD1,0x09,0x1A,0xB5,0x00,0x8B,0x93,0x08, +0x98,0x11,0xF9,0x85,0x2B,0x08,0x96,0x89,0x90,0x2A,0x12,0x4A,0xD8,0x85,0x2B,0x0E, +0x10,0x00,0x01,0xB1,0x9B,0x69,0x1A,0x90,0x40,0xB8,0x01,0x08,0x0A,0x2C,0x09,0x14, +0x4B,0xE2,0x82,0x88,0xB1,0x78,0x0A,0x01,0xC2,0x93,0x19,0xCE,0x20,0x3C,0x82,0xB4, +0x1B,0x20,0x8C,0x3B,0x29,0xAB,0x86,0x23,0xD8,0x81,0x9A,0x5A,0x49,0xB0,0x16,0xA0, +0xB0,0x28,0x1B,0x13,0x93,0xE4,0xA2,0xA9,0x08,0x5A,0xB3,0x12,0xC1,0xE1,0x10,0x88, +0x01,0x0C,0x92,0x08,0x89,0xB7,0x88,0x81,0x10,0x9A,0x17,0xA0,0xB0,0x13,0x99,0xE0, +0x39,0x31,0xD2,0xB2,0x80,0x0B,0x2D,0x49,0x80,0x01,0xB0,0x06,0x09,0x0C,0x3A,0x69, +0xA0,0x08,0xB2,0xA1,0x69,0x2B,0x5A,0x81,0x92,0xBA,0x21,0xB1,0x7D,0x10,0x80,0x08, +0x88,0x82,0x32,0x0D,0xB0,0x1A,0x1C,0x21,0x94,0xA9,0x58,0xB9,0x5A,0x4A,0xA0,0x13, +0xA9,0x80,0x7C,0x00,0x20,0x8A,0x04,0x0C,0x00,0x82,0x2A,0xB2,0xAC,0x4B,0x69,0xA0, +0xA6,0x81,0x9B,0x19,0x38,0x8B,0x17,0xB2,0x81,0x2A,0xBB,0x94,0x29,0xA2,0x15,0xBA, +0x97,0xA3,0xB9,0x79,0x01,0xB2,0x02,0xF1,0x90,0x0A,0x29,0x11,0x88,0xE5,0xA0,0x81, +0x19,0x91,0x90,0x28,0xB3,0x14,0xD0,0xB5,0x91,0x9A,0x29,0x0B,0x07,0xA2,0xB3,0x01, +0x9D,0x28,0x41,0xD0,0x91,0x90,0x82,0x1A,0xA8,0x44,0x9A,0xA9,0x21,0xE3,0xA9,0x4B, +0x19,0x78,0x89,0x83,0xA3,0xB9,0x5A,0x3D,0x80,0x82,0xA2,0xA0,0x6C,0x10,0x20,0x8B, +0x93,0x8B,0x0E,0x33,0xA9,0xB1,0x68,0x8A,0x31,0xAC,0x94,0xB4,0x8B,0x32,0x0B,0xB4, +0x81,0x91,0x1D,0x33,0xD9,0x31,0xE1,0x8B,0x3B,0x30,0x12,0x49,0xD2,0x8E,0x29,0x18, +0x8A,0x92,0x02,0xAA,0x59,0x1C,0x32,0x88,0x01,0x23,0xFB,0x83,0x29,0xDA,0x59,0x01, +0x81,0x92,0xE1,0x18,0x8A,0x1D,0x30,0x93,0xF1,0x00,0x01,0x0B,0x39,0x92,0x89,0xA0, +0x11,0x5B,0xE0,0x82,0x09,0x13,0xAA,0xB4,0x16,0xD8,0x91,0x2A,0x29,0x84,0x1B,0xC5, +0x98,0x98,0x31,0x98,0x99,0x17,0xA9,0x20,0x92,0xC3,0x18,0x9D,0x20,0x3D,0x89,0x94, +0xA2,0x1C,0x5C,0x29,0x39,0xA0,0xB3,0x00,0x0C,0x4C,0x48,0x92,0x0A,0x91,0x85,0x9A, +0x01,0x82,0x1F,0x10,0x99,0x15,0xC1,0xA0,0x39,0x1A,0x1D,0x85,0xB4,0x90,0x1A,0x2A, +0x4B,0x01,0xB2,0x93,0xBE,0x12,0x83,0xC9,0x18,0x09,0x20,0x78,0xF1,0x08,0x19,0x88, +0x3A,0x83,0xB3,0xA9,0x93,0x7A,0x0A,0x96,0x98,0x00,0xA8,0x3A,0x30,0x92,0xF2,0x9B, +0x3D,0x38,0x92,0x92,0xC3,0xB8,0x6B,0x29,0x01,0x01,0xB2,0x2F,0x09,0x19,0x18,0x01, +0x3B,0x7B,0x10,0xA1,0x90,0x39,0x0F,0x38,0x0A,0xB5,0xA4,0x89,0x8B,0x6A,0x2B,0x12, +0xC8,0x90,0x40,0x2A,0x9E,0x22,0x88,0x18,0x09,0x3A,0xC3,0xE8,0x09,0x59,0x08,0x12, +0x94,0xD0,0x1A,0x2C,0x38,0x00,0xA1,0x83,0xE8,0x08,0x3A,0x08,0x10,0x9E,0x83,0x1D, +0x92,0x19,0x2C,0x39,0x3B,0x59,0x04,0xE1,0x80,0x08,0x8D,0x21,0x81,0xB2,0xB2,0x02, +0x99,0x91,0xA4,0xD6,0x98,0x99,0x03,0x80,0x98,0xA7,0x91,0x09,0xA1,0xB2,0xB3,0xE1, +0x12,0x92,0xB1,0x81,0x06,0x99,0x0A,0x23,0xC4,0xB1,0xF2,0x89,0x19,0x3A,0x94,0x82, +0xE0,0x89,0x38,0x0B,0xA4,0xA5,0x80,0x80,0x8C,0x34,0xB9,0xA9,0x23,0x13,0xB9,0xC1, +0xC7,0x1B,0x89,0x10,0x20,0x11,0xE3,0xA8,0x4B,0x0B,0x40,0x91,0x90,0x1B,0x5F,0x2A, +0x18,0x82,0x91,0x0B,0x4A,0x28,0xCA,0x40,0x80,0x5B,0x2C,0x13,0xB0,0x8A,0xA9,0x5A, +0x58,0x89,0x82,0x88,0x2E,0x3B,0x31,0xA1,0x9B,0x01,0x7A,0x2C,0x01,0x91,0x93,0x3F, +0x88,0x39,0x10,0xF1,0x91,0x8B,0x48,0x0A,0x12,0xE3,0xA8,0x18,0x28,0x92,0x97,0x98, +0x99,0x19,0xA1,0x11,0xB6,0x88,0x3B,0x10,0xD3,0xC3,0xA1,0x2A,0x8A,0x49,0x04,0xF1, +0x91,0x02,0x8A,0x89,0x04,0xF1,0x98,0x80,0x18,0x12,0xE3,0x81,0x98,0x80,0x01,0xB3, +0xF2,0x99,0x12,0x2A,0xB5,0xB3,0x92,0xAA,0x19,0x50,0xB2,0xC3,0x92,0xD0,0x2B,0x68, +0x93,0x99,0xC0,0x2C,0x3E,0x80,0x20,0x08,0x93,0x0D,0x2A,0x31,0x8D,0x02,0x2B,0x91, +0x08,0x0A,0x03,0x2C,0x3C,0x52,0xB9,0xA0,0x12,0xBF,0x3A,0x29,0x01,0x88,0xC0,0x6A, +0x3C,0x0A,0x49,0x18,0x0B,0x39,0x2B,0x69,0x0A,0x84,0x2A,0x2A,0x1C,0x2A,0xC3,0x8C, +0x19,0x50,0x09,0x91,0xA7,0x8D,0x18,0x1A,0x28,0x00,0xA0,0x94,0x10,0x1F,0x20,0x90, +0x8A,0x12,0xD0,0x1A,0x5A,0x81,0x04,0xBC,0x23,0x10,0xE0,0x90,0x90,0x18,0x1A,0xA6, +0x12,0xB1,0xD0,0x4A,0x08,0x82,0x92,0xB6,0x9A,0x0A,0x12,0x88,0xC3,0xC5,0x8A,0x89, +0x20,0xB5,0x93,0x0B,0x18,0x00,0x09,0xF2,0x88,0x2A,0x4A,0x08,0x05,0xB2,0xA9,0x3B, +0x5D,0x28,0xA4,0xB1,0x00,0x19,0x19,0x7A,0xA3,0xB3,0x0A,0x90,0xA1,0xC4,0x80,0xBA, +0x50,0x13,0xC1,0xC2,0x9A,0x2A,0x7B,0x28,0x84,0xC1,0x09,0x3B,0x4E,0x20,0x91,0xA1, +0x18,0xAB,0x79,0x10,0xB4,0x08,0x9A,0x11,0x2B,0xF0,0x93,0xAA,0x01,0x6A,0x01,0x93, +0x80,0xB8,0x2A,0x5B,0x10,0x80,0x89,0x4A,0x5B,0x92,0x15,0xB2,0xA0,0x2F,0x19,0x93, +0xB8,0x95,0x80,0x1C,0x21,0xA9,0x02,0x0B,0xA0,0x5A,0x18,0x98,0x39,0x1B,0x68,0x00, +0x91,0x91,0x9C,0x39,0x3E,0x18,0x84,0xB3,0x9B,0x7A,0x08,0x18,0x0A,0xB5,0x91,0x0B, +0x28,0x39,0x19,0x90,0x0A,0x50,0xAC,0x11,0x01,0xAB,0x88,0x52,0x1B,0x83,0xC4,0xA2, +0x9A,0xAB,0x03,0x90,0x19,0x93,0x81,0x08,0x92,0x9A,0x68,0x98,0x19,0x39,0xC1,0x92, +0x8A,0x38,0x4E,0x02,0xB1,0x90,0xC3,0x18,0x2B,0x04,0xC3,0xD2,0x91,0x90,0x81,0x89, +0x13,0xF1,0x88,0x93,0xA2,0x00,0x91,0xC0,0x5B,0x21,0x99,0x93,0x06,0x9A,0x1B,0x48, +0x99,0xB7,0x90,0x89,0x18,0x1B,0x11,0xA4,0xB2,0x81,0x9A,0x08,0x97,0x98,0x91,0x10, +0xB8,0x06,0xA2,0xA0,0x29,0x2B,0x21,0xC2,0xD1,0x10,0x1A,0x4A,0x29,0xF1,0x98,0x29, +0x1B,0x31,0x10,0xA0,0xA1,0x1D,0x5A,0x29,0xB2,0x82,0xA8,0x0F,0x28,0x21,0x09,0x91, +0x82,0x4D,0x10,0xA3,0xB0,0x89,0x4C,0x39,0xA0,0xA4,0xA1,0x89,0x1E,0x28,0x29,0xA3, +0xC3,0x2D,0x19,0x01,0x49,0x01,0x9B,0x0C,0x21,0xC2,0xA2,0x93,0x7C,0x2A,0x10,0x90, + +/* Source: 08HH.ROM */ +/* Length: 384 / 0x00000180 */ + +0x75,0xF2,0xAB,0x7D,0x7E,0x5C,0x3B,0x4B,0x3C,0x4D,0x4A,0x02,0xB3,0xC5,0xE7,0xE3, +0x92,0xB3,0xC4,0xB3,0xC3,0x8A,0x3B,0x5D,0x5C,0x3A,0x84,0xC2,0x91,0xA4,0xE7,0xF7, +0xF7,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x2C,0x7C,0x28,0x81,0xA3, +0xB2,0xA3,0xB1,0x08,0x1A,0x3C,0x18,0x2E,0x4C,0x39,0xA5,0xB3,0xB4,0xC2,0x88,0x08, +0x19,0x0A,0x49,0xB7,0xB3,0xA2,0xA1,0x92,0xA1,0x93,0xB1,0x0C,0x7D,0x39,0x93,0xB3, +0xB1,0x1A,0x19,0x5D,0x28,0xA6,0xC4,0xB2,0x90,0x09,0x2A,0x18,0x1B,0x5B,0x28,0x88, +0x2C,0x29,0x82,0xA0,0x18,0x91,0x2D,0x29,0x2B,0x5C,0x4C,0x3B,0x4C,0x28,0x80,0x92, +0x90,0x09,0x2B,0x28,0x1D,0x6B,0x11,0xC5,0xB2,0x0B,0x39,0x09,0x4D,0x28,0x88,0x00, +0x1B,0x28,0x94,0xE3,0xA0,0x1A,0x28,0xB5,0xB4,0xB3,0xB2,0x93,0xE2,0x91,0x92,0xD4, +0xA0,0x1B,0x4A,0x01,0xA1,0x88,0x2D,0x5C,0x3B,0x28,0x08,0x93,0xD4,0xB2,0x91,0xB4, +0xA0,0x3E,0x3B,0x4B,0x3B,0x29,0x08,0x93,0x9B,0x7B,0x3A,0x19,0x00,0x80,0x80,0xA0, + +/* Source: 10TOM.ROM */ +/* Length: 640 / 0x00000280 */ + +0x77,0x27,0x87,0x01,0x2D,0x4F,0xC3,0xC1,0x92,0x91,0x89,0x59,0x83,0x1A,0x32,0xC2, +0x95,0xB1,0x81,0x88,0x81,0x4A,0x3D,0x11,0x9E,0x0B,0x88,0x0C,0x18,0x3B,0x11,0x11, +0x91,0x00,0xA0,0xE2,0x0A,0x48,0x13,0x24,0x81,0x48,0x1B,0x39,0x1C,0x83,0x84,0xA1, +0xD1,0x8E,0x8A,0x0B,0xC0,0x98,0x92,0xB8,0x39,0x90,0x10,0x92,0xF0,0xB5,0x88,0x32, +0x49,0x51,0x21,0x03,0x82,0x10,0x8A,0x7A,0x09,0x00,0xA2,0xCA,0x1B,0xCC,0x1C,0xB9, +0x8E,0x89,0x89,0xA1,0x89,0x92,0x29,0x11,0x60,0x40,0x14,0x22,0x32,0x78,0x40,0x01, +0x02,0x90,0x81,0xAB,0x0B,0x00,0xAF,0x99,0xCC,0xAB,0xDA,0xA9,0x99,0x1B,0x30,0x14, +0x92,0x22,0x19,0x68,0x32,0x14,0x26,0x13,0x23,0x23,0x20,0x12,0x9A,0xA8,0xB9,0xFA, +0xAA,0xCA,0xCC,0x0C,0xA8,0xAE,0x88,0xB9,0x88,0xA0,0x02,0x21,0x50,0x43,0x03,0x81, +0x2A,0x11,0x34,0x63,0x24,0x33,0x22,0x38,0x8B,0xEA,0xAE,0x99,0xA0,0x90,0x82,0x00, +0x89,0xBF,0x8A,0xE8,0xA9,0x90,0x01,0x12,0x13,0x12,0x08,0xA9,0xAA,0xC9,0x22,0x63, +0x63,0x12,0x44,0x00,0x10,0x88,0x9C,0x98,0xA1,0x85,0x03,0x32,0x36,0x80,0x89,0xDB, +0xDB,0xBB,0xB9,0xBA,0x01,0x81,0x28,0x19,0xCB,0xFA,0xBC,0x09,0x13,0x37,0x34,0x34, +0x23,0x31,0x20,0x10,0x00,0x00,0x28,0x38,0x10,0x88,0xEC,0x8D,0xCB,0xBC,0xCC,0xBB, +0xBB,0xC9,0x99,0x00,0x00,0x33,0x11,0x22,0x81,0x07,0x41,0x54,0x34,0x34,0x22,0x31, +0x00,0x88,0x9A,0x9B,0x98,0xAB,0x8E,0x9B,0xBD,0x9C,0xBC,0xBB,0xDA,0xAA,0xA9,0x99, +0x18,0x38,0x60,0x20,0x31,0x13,0x13,0x51,0x14,0x31,0x53,0x33,0x35,0x22,0x01,0x8A, +0x9C,0xA9,0xCA,0xC9,0xA8,0x00,0x10,0x81,0x9C,0x9E,0xAB,0xCC,0xAB,0xBA,0x98,0x30, +0x52,0x03,0x81,0x08,0x9C,0xAC,0xAC,0x18,0x11,0x03,0x51,0x61,0x41,0x31,0x31,0x02, +0x01,0x20,0x24,0x43,0x44,0x40,0x30,0x10,0xBC,0xBE,0xCB,0xDB,0xAB,0xBA,0x99,0x98, +0x99,0xAA,0xBD,0xAA,0xC8,0x90,0x11,0x53,0x37,0x23,0x43,0x34,0x33,0x33,0x33,0x11, +0x28,0x00,0x19,0xA9,0x9A,0xCB,0xCE,0xBB,0xEB,0xBC,0xBB,0xCA,0xBA,0xA8,0x88,0x11, +0x12,0x21,0x20,0x22,0x26,0x26,0x23,0x23,0x43,0x24,0x22,0x32,0x20,0x31,0x81,0x9A, +0xBC,0xBC,0xCB,0xBD,0x9A,0xA9,0x90,0x98,0xBA,0xCC,0xCB,0xBC,0x8B,0x88,0x22,0x35, +0x23,0x12,0x99,0x8B,0xAA,0xAA,0x89,0x82,0x93,0x31,0x42,0x23,0x23,0x21,0x32,0x11, +0x20,0x13,0x13,0x24,0x24,0x24,0x22,0x11,0x8A,0x9E,0xAC,0xAC,0xAA,0xBA,0xAA,0xAB, +0xBD,0xBC,0xCB,0xCB,0xA9,0xA8,0x91,0x12,0x44,0x43,0x44,0x34,0x34,0x42,0x33,0x42, +0x21,0x11,0x11,0x88,0x80,0xAA,0x0B,0xAC,0xCB,0xEC,0xAC,0xBA,0xCA,0xAB,0x9A,0x99, +0x80,0x91,0x09,0x08,0x10,0x22,0x44,0x43,0x44,0x33,0x43,0x22,0x13,0x21,0x22,0x20, +0x09,0x88,0xB9,0xC8,0xBB,0xAB,0xAB,0xA9,0xA9,0x9B,0x9B,0x99,0x90,0x90,0x00,0x81, +0x00,0x08,0x09,0x8A,0x9A,0xAA,0xA9,0xA9,0x99,0x90,0x80,0x01,0x80,0x00,0x09,0x31, +0x32,0x44,0x33,0x43,0x34,0x33,0x24,0x22,0x23,0x12,0x10,0x09,0x9B,0xAB,0xCA,0xCC, +0xBB,0xCB,0xDA,0xCA,0xAB,0xCA,0xAB,0xA9,0xA8,0x92,0x12,0x43,0x53,0x35,0x23,0x33, +0x43,0x43,0x52,0x22,0x22,0x21,0x01,0x09,0x89,0xA9,0xBB,0xBD,0xBC,0xCB,0xDA,0xAB, +0xAB,0xAB,0xAA,0xA9,0x99,0xA8,0x09,0x01,0x11,0x34,0x25,0x23,0x33,0x51,0x22,0x31, +0x12,0x20,0x21,0x12,0x10,0x80,0x99,0x9A,0x99,0x99,0x88,0x08,0x00,0x88,0xA9,0x99, +0x99,0x80,0x80,0x10,0x01,0x00,0x9A,0xAA,0xBB,0xBA,0xBA,0xA9,0x99,0x99,0x89,0x99, +0x99,0x00,0x01,0x33,0x35,0x24,0x23,0x34,0x23,0x33,0x34,0x33,0x43,0x32,0x21,0x88, +0xAB,0xBD,0xBB,0xDB,0xAB,0xBA,0xBB,0xDA,0xBB,0xCB,0xBB,0xBC,0xA8,0x90,0x01,0x12, +0x23,0x43,0x53,0x34,0x34,0x39,0x80,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00, + +/* Source: 20RIM.ROM */ +/* Length: 128 / 0x00000080 */ + +0x0F,0xFF,0x73,0x8E,0x71,0xCD,0x00,0x49,0x10,0x90,0x21,0x49,0xA0,0xDB,0x02,0x3A, +0xE3,0x0A,0x50,0x98,0xC0,0x59,0xA2,0x99,0x09,0x22,0xA2,0x80,0x10,0xA8,0x5B,0xD2, +0x88,0x21,0x09,0x96,0xA8,0x10,0x0A,0xE0,0x08,0x48,0x19,0xAB,0x52,0xA8,0x92,0x0C, +0x03,0x19,0xE2,0x0A,0x12,0xC2,0x81,0x1E,0x01,0xD0,0x48,0x88,0x98,0x01,0x49,0x91, +0xAA,0x2C,0x25,0x89,0x88,0xB5,0x81,0xA2,0x9A,0x12,0x9E,0x38,0x3B,0x81,0x9B,0x59, +0x01,0x93,0xCA,0x4A,0x21,0xA0,0x3D,0x0A,0x39,0x3D,0x12,0xA8,0x3F,0x18,0x01,0x92, +0x1C,0x00,0xB2,0x48,0xB9,0x94,0xA3,0x19,0x4F,0x19,0xB2,0x32,0x90,0xBA,0x01,0xE6, +0x91,0x80,0xC1,0xA4,0x2A,0x08,0xA1,0xB1,0x25,0xD2,0x88,0x99,0x21,0x80,0x88,0x80, +}; + + + +/* flag enable control 0x110 */ +INLINE void YM2608IRQFlagWrite(FM_OPN *OPN, YM2608 *F2608, int v) +{ + if( v & 0x80 ) + { /* Reset IRQ flag */ + FM_STATUS_RESET(&OPN->ST, 0xf7); /* don't touch BUFRDY flag otherwise we'd have to call ymdeltat module to set the flag back */ + } + else + { /* Set status flag mask */ + F2608->flagmask = (~(v&0x1f)); + FM_IRQMASK_SET(&OPN->ST, (F2608->irqmask & F2608->flagmask) ); + } +} + +/* compatible mode & IRQ enable control 0x29 */ +INLINE void YM2608IRQMaskWrite(FM_OPN *OPN, YM2608 *F2608, int v) +{ + /* SCH,xx,xxx,EN_ZERO,EN_BRDY,EN_EOS,EN_TB,EN_TA */ + + /* extend 3ch. enable/disable */ + if(v&0x80) + OPN->type |= TYPE_6CH; /* OPNA mode - 6 FM channels */ + else + OPN->type &= ~TYPE_6CH; /* OPN mode - 3 FM channels */ + + /* IRQ MASK store and set */ + F2608->irqmask = v&0x1f; + FM_IRQMASK_SET(&OPN->ST, (F2608->irqmask & F2608->flagmask) ); +} + +/* Generate samples for one of the YM2608s */ +void YM2608UpdateOne(void *chip, FMSAMPLE **buffer, int length) +{ + YM2608 *F2608 = chip; + FM_OPN *OPN = &F2608->OPN; + YM_DELTAT *DELTAT = &F2608->deltaT; + int i,j; + FMSAMPLE *bufL,*bufR; + FM_CH *cch[6]; + + /* set bufer */ + bufL = buffer[0]; + bufR = buffer[1]; + + cch[0] = &F2608->CH[0]; + cch[1] = &F2608->CH[1]; + cch[2] = &F2608->CH[2]; + cch[3] = &F2608->CH[3]; + cch[4] = &F2608->CH[4]; + cch[5] = &F2608->CH[5]; + /* setup adpcm rom address */ + pcmbufA = F2608->pcmbuf; + pcmsizeA = F2608->pcm_size; + + /* refresh PG and EG */ + refresh_fc_eg_chan( cch[0] ); + refresh_fc_eg_chan( cch[1] ); + if( (OPN->ST.mode & 0xc0) ) + { + /* 3SLOT MODE */ + if( cch[2]->SLOT[SLOT1].Incr==-1) + { + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT1] , OPN->SL3.fc[1] , OPN->SL3.kcode[1] ); + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT2] , OPN->SL3.fc[2] , OPN->SL3.kcode[2] ); + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT3] , OPN->SL3.fc[0] , OPN->SL3.kcode[0] ); + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT4] , cch[2]->fc , cch[2]->kcode ); + } + }else refresh_fc_eg_chan( cch[2] ); + refresh_fc_eg_chan( cch[3] ); + refresh_fc_eg_chan( cch[4] ); + refresh_fc_eg_chan( cch[5] ); + + + /* buffering */ + for(i=0; i < length ; i++) + { + + advance_lfo(OPN); + + /* clear output acc. */ + out_adpcm[OUTD_LEFT] = out_adpcm[OUTD_RIGHT]= out_adpcm[OUTD_CENTER] = 0; + out_delta[OUTD_LEFT] = out_delta[OUTD_RIGHT]= out_delta[OUTD_CENTER] = 0; + /* clear outputs */ + out_fm[0] = 0; + out_fm[1] = 0; + out_fm[2] = 0; + out_fm[3] = 0; + out_fm[4] = 0; + out_fm[5] = 0; + + /* advance envelope generator */ + OPN->eg_timer += OPN->eg_timer_add; + while (OPN->eg_timer >= OPN->eg_timer_overflow) + { + OPN->eg_timer -= OPN->eg_timer_overflow; + OPN->eg_cnt++; + + advance_eg_channel(OPN, &cch[0]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[1]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[2]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[3]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[4]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[5]->SLOT[SLOT1]); + } + + /* calculate FM */ + chan_calc(OPN, cch[0] ); + chan_calc(OPN, cch[1] ); + chan_calc(OPN, cch[2] ); + chan_calc(OPN, cch[3] ); + chan_calc(OPN, cch[4] ); + chan_calc(OPN, cch[5] ); + + /* deltaT ADPCM */ + if( DELTAT->portstate&0x80 ) + YM_DELTAT_ADPCM_CALC(DELTAT); + + /* ADPCMA */ + for( j = 0; j < 6; j++ ) + { + if( F2608->adpcm[j].flag ) + ADPCMA_calc_chan( F2608, &F2608->adpcm[j]); + } + + /* buffering */ + { + int lt,rt; + + lt = out_adpcm[OUTD_LEFT] + out_adpcm[OUTD_CENTER]; + rt = out_adpcm[OUTD_RIGHT] + out_adpcm[OUTD_CENTER]; + lt += (out_delta[OUTD_LEFT] + out_delta[OUTD_CENTER])>>9; + rt += (out_delta[OUTD_RIGHT] + out_delta[OUTD_CENTER])>>9; + lt += ((out_fm[0]>>1) & OPN->pan[0]); /* shift right verified on real YM2608 */ + rt += ((out_fm[0]>>1) & OPN->pan[1]); + lt += ((out_fm[1]>>1) & OPN->pan[2]); + rt += ((out_fm[1]>>1) & OPN->pan[3]); + lt += ((out_fm[2]>>1) & OPN->pan[4]); + rt += ((out_fm[2]>>1) & OPN->pan[5]); + lt += ((out_fm[3]>>1) & OPN->pan[6]); + rt += ((out_fm[3]>>1) & OPN->pan[7]); + lt += ((out_fm[4]>>1) & OPN->pan[8]); + rt += ((out_fm[4]>>1) & OPN->pan[9]); + lt += ((out_fm[5]>>1) & OPN->pan[10]); + rt += ((out_fm[5]>>1) & OPN->pan[11]); + + lt >>= FINAL_SH; + rt >>= FINAL_SH; + + Limit( lt, MAXOUT, MINOUT ); + Limit( rt, MAXOUT, MINOUT ); + /* buffering */ + bufL[i] = lt; + bufR[i] = rt; + + #ifdef SAVE_SAMPLE + SAVE_ALL_CHANNELS + #endif + + } + + /* timer A control */ + INTERNAL_TIMER_A( &OPN->ST , cch[2] ) + } + INTERNAL_TIMER_B(&OPN->ST,length) + + + /* check IRQ for DELTA-T EOS */ + FM_STATUS_SET(&OPN->ST, 0); + +} +#ifdef __STATE_H__ +void YM2608Postload(void *chip) +{ + if (chip) + { + YM2608 *F2608 = (YM2608 *)chip; + int r; + + /* prescaler */ + OPNPrescaler_w(&F2608->OPN,1,2); + F2608->deltaT.freqbase = F2608->OPN.ST.freqbase; + /* IRQ mask / mode */ + YM2608IRQMaskWrite(&F2608->OPN, F2608, F2608->REGS[0x29]); + /* SSG registers */ + for(r=0;r<16;r++) + { + (*F2608->OPN.ST.SSG->write)(F2608->OPN.ST.param,0,r); + (*F2608->OPN.ST.SSG->write)(F2608->OPN.ST.param,1,F2608->REGS[r]); + } + + /* OPN registers */ + /* DT / MULTI , TL , KS / AR , AMON / DR , SR , SL / RR , SSG-EG */ + for(r=0x30;r<0x9e;r++) + if((r&3) != 3) + { + OPNWriteReg(&F2608->OPN,r,F2608->REGS[r]); + OPNWriteReg(&F2608->OPN,r|0x100,F2608->REGS[r|0x100]); + } + /* FB / CONNECT , L / R / AMS / PMS */ + for(r=0xb0;r<0xb6;r++) + if((r&3) != 3) + { + OPNWriteReg(&F2608->OPN,r,F2608->REGS[r]); + OPNWriteReg(&F2608->OPN,r|0x100,F2608->REGS[r|0x100]); + } + /* FM channels */ + /*FM_channel_postload(F2608->CH,6);*/ + /* rhythm(ADPCMA) */ + FM_ADPCMAWrite(F2608,1,F2608->REGS[0x111]); + for( r=0x08 ; r<0x0c ; r++) + FM_ADPCMAWrite(F2608,r,F2608->REGS[r+0x110]); + /* Delta-T ADPCM unit */ + YM_DELTAT_postload(&F2608->deltaT , &F2608->REGS[0x100] ); + } +} + +static void YM2608_save_state(YM2608 *F2608, int index) +{ + static const char statename[] = "YM2608"; + + state_save_register_item_array(statename, index, F2608->REGS); + FMsave_state_st(statename,index,&F2608->OPN.ST); + FMsave_state_channel(statename,index,F2608->CH,6); + /* 3slots */ + state_save_register_item_array(statename, index, F2608->OPN.SL3.fc); + state_save_register_item(statename, index, F2608->OPN.SL3.fn_h); + state_save_register_item_array(statename, index, F2608->OPN.SL3.kcode); + /* address register1 */ + state_save_register_item(statename, index, F2608->addr_A1); + /* rythm(ADPCMA) */ + FMsave_state_adpcma(statename,index,F2608->adpcm); + /* Delta-T ADPCM unit */ + YM_DELTAT_savestate(statename,index,&F2608->deltaT); +} +#endif /* _STATE_H */ + +static void YM2608_deltat_status_set(void *chip, UINT8 changebits) +{ + YM2608 *F2608 = chip; + FM_STATUS_SET(&(F2608->OPN.ST), changebits); +} +static void YM2608_deltat_status_reset(void *chip, UINT8 changebits) +{ + YM2608 *F2608 = chip; + FM_STATUS_RESET(&(F2608->OPN.ST), changebits); +} +/* YM2608(OPNA) */ +void * YM2608Init(void *param, int index, int clock, int rate, + void *pcmrom,int pcmsize, + FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler, const struct ssg_callbacks *ssg) +{ + YM2608 *F2608; + + /* allocate extend state space */ + if( (F2608 = (YM2608 *)malloc(sizeof(YM2608)))==NULL) + return NULL; + /* clear */ + memset(F2608,0,sizeof(YM2608)); + /* allocate total level table (128kb space) */ + if( !init_tables() ) + { + free( F2608 ); + return NULL; + } + + F2608->OPN.ST.param = param; + F2608->OPN.type = TYPE_YM2608; + F2608->OPN.P_CH = F2608->CH; + F2608->OPN.ST.clock = clock; + F2608->OPN.ST.rate = rate; + + /* External handlers */ + F2608->OPN.ST.Timer_Handler = TimerHandler; + F2608->OPN.ST.IRQ_Handler = IRQHandler; + F2608->OPN.ST.SSG = ssg; + + /* DELTA-T */ + F2608->deltaT.memory = (UINT8 *)pcmrom; + F2608->deltaT.memory_size = pcmsize; + + /*F2608->deltaT.write_time = 20.0 / clock;*/ /* a single byte write takes 20 cycles of main clock */ + /*F2608->deltaT.read_time = 18.0 / clock;*/ /* a single byte read takes 18 cycles of main clock */ + + F2608->deltaT.status_set_handler = YM2608_deltat_status_set; + F2608->deltaT.status_reset_handler = YM2608_deltat_status_reset; + F2608->deltaT.status_change_which_chip = F2608; + F2608->deltaT.status_change_EOS_bit = 0x04; /* status flag: set bit2 on End Of Sample */ + F2608->deltaT.status_change_BRDY_bit = 0x08; /* status flag: set bit3 on BRDY */ + F2608->deltaT.status_change_ZERO_bit = 0x10; /* status flag: set bit4 if silence continues for more than 290 miliseconds while recording the ADPCM */ + + /* ADPCM Rhythm */ + F2608->pcmbuf = YM2608_ADPCM_ROM; + F2608->pcm_size = 0x2000; + + YM2608ResetChip(F2608); + + Init_ADPCMATable(); + +#ifdef __STATE_H__ + YM2608_save_state(F2608, index); +#endif + return F2608; +} + +/* shut down emulator */ +void YM2608Shutdown(void *chip) +{ + YM2608 *F2608 = chip; + + FMCloseTable(); + free(F2608); +} + +/* reset one of chips */ +void YM2608ResetChip(void *chip) +{ + int i; + YM2608 *F2608 = chip; + FM_OPN *OPN = &F2608->OPN; + YM_DELTAT *DELTAT = &F2608->deltaT; + + /* Reset Prescaler */ + OPNPrescaler_w(OPN , 0 , 2); + F2608->deltaT.freqbase = OPN->ST.freqbase; + /* reset SSG section */ + (*OPN->ST.SSG->reset)(OPN->ST.param); + + /* status clear */ + FM_BUSY_CLEAR(&OPN->ST); + + /* register 0x29 - default value after reset is: + enable only 3 FM channels and enable all the status flags */ + YM2608IRQMaskWrite(OPN, F2608, 0x1f ); /* default value for D4-D0 is 1 */ + + /* register 0x10, A1=1 - default value is 1 for D4, D3, D2, 0 for the rest */ + YM2608IRQFlagWrite(OPN, F2608, 0x1c ); /* default: enable timer A and B, disable EOS, BRDY and ZERO */ + + OPNWriteMode(OPN,0x27,0x30); /* mode 0 , timer reset */ + + OPN->eg_timer = 0; + OPN->eg_cnt = 0; + + FM_STATUS_RESET(&OPN->ST, 0xff); + + reset_channels( &OPN->ST , F2608->CH , 6 ); + /* reset OPerator paramater */ + for(i = 0xb6 ; i >= 0xb4 ; i-- ) + { + OPNWriteReg(OPN,i ,0xc0); + OPNWriteReg(OPN,i|0x100,0xc0); + } + for(i = 0xb2 ; i >= 0x30 ; i-- ) + { + OPNWriteReg(OPN,i ,0); + OPNWriteReg(OPN,i|0x100,0); + } + for(i = 0x26 ; i >= 0x20 ; i-- ) OPNWriteReg(OPN,i,0); + + /* ADPCM - percussion sounds */ + for( i = 0; i < 6; i++ ) + { + if (i<=3) /* channels 0,1,2,3 */ + F2608->adpcm[i].step = (UINT32)((float)(1<OPN.ST.freqbase)/3.0); + else /* channels 4 and 5 work with slower clock */ + F2608->adpcm[i].step = (UINT32)((float)(1<OPN.ST.freqbase)/6.0); + + F2608->adpcm[i].start = YM2608_ADPCM_ROM_addr[i*2]; + F2608->adpcm[i].end = YM2608_ADPCM_ROM_addr[i*2+1]; + + F2608->adpcm[i].now_addr = 0; + F2608->adpcm[i].now_step = 0; + /* F2608->adpcm[i].delta = 21866; */ + F2608->adpcm[i].vol_mul = 0; + F2608->adpcm[i].pan = &out_adpcm[OUTD_CENTER]; /* default center */ + F2608->adpcm[i].flagMask = 0; + F2608->adpcm[i].flag = 0; + F2608->adpcm[i].adpcm_acc = 0; + F2608->adpcm[i].adpcm_step= 0; + F2608->adpcm[i].adpcm_out = 0; + } + F2608->adpcmTL = 0x3f; + + F2608->adpcm_arrivedEndAddress = 0; /* not used */ + + /* DELTA-T unit */ + DELTAT->freqbase = OPN->ST.freqbase; + DELTAT->output_pointer = out_delta; + DELTAT->portshift = 5; /* always 5bits shift */ /* ASG */ + DELTAT->output_range = 1<<23; + YM_DELTAT_ADPCM_Reset(DELTAT,OUTD_CENTER,YM_DELTAT_EMULATION_MODE_NORMAL); +} + +/* YM2608 write */ +/* n = number */ +/* a = address */ +/* v = value */ +int YM2608Write(void *chip, int a,UINT8 v) +{ + YM2608 *F2608 = chip; + FM_OPN *OPN = &F2608->OPN; + int addr; + + v &= 0xff; /*adjust to 8 bit bus */ + + + switch(a&3) + { + case 0: /* address port 0 */ + OPN->ST.address = v; + F2608->addr_A1 = 0; + + /* Write register to SSG emulator */ + if( v < 16 ) (*OPN->ST.SSG->write)(OPN->ST.param,0,v); + /* prescaler selecter : 2d,2e,2f */ + if( v >= 0x2d && v <= 0x2f ) + { + OPNPrescaler_w(OPN , v , 2); + F2608->deltaT.freqbase = OPN->ST.freqbase; + } + break; + + case 1: /* data port 0 */ + if (F2608->addr_A1 != 0) + break; /* verified on real YM2608 */ + + addr = OPN->ST.address; + F2608->REGS[addr] = v; + switch(addr & 0xf0) + { + case 0x00: /* SSG section */ + /* Write data to SSG emulator */ + (*OPN->ST.SSG->write)(OPN->ST.param,a,v); + break; + case 0x10: /* 0x10-0x1f : Rhythm section */ + YM2608UpdateReq(OPN->ST.param); + FM_ADPCMAWrite(F2608,addr-0x10,v); + break; + case 0x20: /* Mode Register */ + switch(addr) + { + case 0x29: /* SCH,xx,xxx,EN_ZERO,EN_BRDY,EN_EOS,EN_TB,EN_TA */ + YM2608IRQMaskWrite(OPN, F2608, v); + break; + default: + YM2608UpdateReq(OPN->ST.param); + OPNWriteMode(OPN,addr,v); + } + break; + default: /* OPN section */ + YM2608UpdateReq(OPN->ST.param); + OPNWriteReg(OPN,addr,v); + } + break; + + case 2: /* address port 1 */ + OPN->ST.address = v; + F2608->addr_A1 = 1; + break; + + case 3: /* data port 1 */ + if (F2608->addr_A1 != 1) + break; /* verified on real YM2608 */ + + addr = OPN->ST.address; + F2608->REGS[addr | 0x100] = v; + YM2608UpdateReq(OPN->ST.param); + switch( addr & 0xf0 ) + { + case 0x00: /* DELTAT PORT */ + switch( addr ) + { + case 0x0e: /* DAC data */ + logerror("YM2608: write to DAC data (unimplemented) value=%02x\n",v); + break; + default: + /* 0x00-0x0d */ + YM_DELTAT_ADPCM_Write(&F2608->deltaT,addr,v); + } + break; + case 0x10: /* IRQ Flag control */ + if( addr == 0x10 ) + { + YM2608IRQFlagWrite(OPN, F2608, v); + } + break; + default: + OPNWriteReg(OPN,addr | 0x100,v); + } + } + return OPN->ST.irq; +} + +UINT8 YM2608Read(void *chip,int a) +{ + YM2608 *F2608 = chip; + int addr = F2608->OPN.ST.address; + UINT8 ret = 0; + + switch( a&3 ){ + case 0: /* status 0 : YM2203 compatible */ + /* BUSY:x:x:x:x:x:FLAGB:FLAGA */ + ret = FM_STATUS_FLAG(&F2608->OPN.ST) & 0x83; + break; + + case 1: /* status 0, ID */ + if( addr < 16 ) ret = (*F2608->OPN.ST.SSG->read)(F2608->OPN.ST.param); + else if(addr == 0xff) ret = 0x01; /* ID code */ + break; + + case 2: /* status 1 : status 0 + ADPCM status */ + /* BUSY : x : PCMBUSY : ZERO : BRDY : EOS : FLAGB : FLAGA */ + ret = (FM_STATUS_FLAG(&F2608->OPN.ST) & (F2608->flagmask|0x80)) | ((F2608->deltaT.PCM_BSY & 1)<<5) ; + break; + + case 3: + if(addr == 0x08) + { + ret = YM_DELTAT_ADPCM_Read(&F2608->deltaT); + } + else + { + if(addr == 0x0f) + { + logerror("YM2608 A/D convertion is accessed but not implemented !\n"); + ret = 0x80; /* 2's complement PCM data - result from A/D convertion */ + } + } + break; + } + return ret; +} + +int YM2608TimerOver(void *chip,int c) +{ + YM2608 *F2608 = chip; + + switch(c) + { +#if 0 + case 2: + { /* BUFRDY flag */ + YM_DELTAT_BRDY_callback( &F2608->deltaT ); + } + break; +#endif + case 1: + { /* Timer B */ + TimerBOver( &(F2608->OPN.ST) ); + } + break; + case 0: + { /* Timer A */ + YM2608UpdateReq(F2608->OPN.ST.param); + /* timer update */ + TimerAOver( &(F2608->OPN.ST) ); + /* CSM mode key,TL controll */ + if( F2608->OPN.ST.mode & 0x80 ) + { /* CSM mode total level latch and auto key on */ + CSMKeyControll( &(F2608->CH[2]) ); + } + } + break; + default: + break; + } + + return F2608->OPN.ST.irq; +} + +#endif /* BUILD_YM2608 */ + + + +#if (BUILD_YM2610||BUILD_YM2610B) +/* YM2610(OPNB) */ + +/* Generate samples for one of the YM2610s */ +void YM2610UpdateOne(void *chip, FMSAMPLE **buffer, int length) +{ + YM2610 *F2610 = chip; + FM_OPN *OPN = &F2610->OPN; + YM_DELTAT *DELTAT = &F2610->deltaT; + int i,j; + FMSAMPLE *bufL,*bufR; + FM_CH *cch[4]; + + /* buffer setup */ + bufL = buffer[0]; + bufR = buffer[1]; + + cch[0] = &F2610->CH[1]; + cch[1] = &F2610->CH[2]; + cch[2] = &F2610->CH[4]; + cch[3] = &F2610->CH[5]; + /* setup adpcm rom address */ + pcmbufA = F2610->pcmbuf; + pcmsizeA = F2610->pcm_size; + +#ifdef YM2610B_WARNING +#define FM_KEY_IS(SLOT) ((SLOT)->key) +#define FM_MSG_YM2610B "YM2610-%p.CH%d is playing,Check whether the type of the chip is YM2610B\n" + /* Check YM2610B warning message */ + if( FM_KEY_IS(&F2610->CH[0].SLOT[3]) ) + LOG(LOG_WAR,(FM_MSG_YM2610B,F2610->OPN.ST.param,0)); + if( FM_KEY_IS(&F2610->CH[3].SLOT[3]) ) + LOG(LOG_WAR,(FM_MSG_YM2610B,F2610->OPN.ST.param,3)); +#endif + + /* refresh PG and EG */ + refresh_fc_eg_chan( cch[0] ); + if( (OPN->ST.mode & 0xc0) ) + { + /* 3SLOT MODE */ + if( cch[1]->SLOT[SLOT1].Incr==-1) + { + refresh_fc_eg_slot(&cch[1]->SLOT[SLOT1] , OPN->SL3.fc[1] , OPN->SL3.kcode[1] ); + refresh_fc_eg_slot(&cch[1]->SLOT[SLOT2] , OPN->SL3.fc[2] , OPN->SL3.kcode[2] ); + refresh_fc_eg_slot(&cch[1]->SLOT[SLOT3] , OPN->SL3.fc[0] , OPN->SL3.kcode[0] ); + refresh_fc_eg_slot(&cch[1]->SLOT[SLOT4] , cch[1]->fc , cch[1]->kcode ); + } + }else refresh_fc_eg_chan( cch[1] ); + refresh_fc_eg_chan( cch[2] ); + refresh_fc_eg_chan( cch[3] ); + + /* buffering */ + for(i=0; i < length ; i++) + { + + advance_lfo(OPN); + + /* clear output acc. */ + out_adpcm[OUTD_LEFT] = out_adpcm[OUTD_RIGHT]= out_adpcm[OUTD_CENTER] = 0; + out_delta[OUTD_LEFT] = out_delta[OUTD_RIGHT]= out_delta[OUTD_CENTER] = 0; + /* clear outputs */ + out_fm[1] = 0; + out_fm[2] = 0; + out_fm[4] = 0; + out_fm[5] = 0; + + /* advance envelope generator */ + OPN->eg_timer += OPN->eg_timer_add; + while (OPN->eg_timer >= OPN->eg_timer_overflow) + { + OPN->eg_timer -= OPN->eg_timer_overflow; + OPN->eg_cnt++; + + advance_eg_channel(OPN, &cch[0]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[1]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[2]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[3]->SLOT[SLOT1]); + } + + /* calculate FM */ + chan_calc(OPN, cch[0] ); /*remapped to 1*/ + chan_calc(OPN, cch[1] ); /*remapped to 2*/ + chan_calc(OPN, cch[2] ); /*remapped to 4*/ + chan_calc(OPN, cch[3] ); /*remapped to 5*/ + + /* deltaT ADPCM */ + if( DELTAT->portstate&0x80 ) + YM_DELTAT_ADPCM_CALC(DELTAT); + + /* ADPCMA */ + for( j = 0; j < 6; j++ ) + { + if( F2610->adpcm[j].flag ) + ADPCMA_calc_chan( F2610, &F2610->adpcm[j]); + } + + /* buffering */ + { + int lt,rt; + + lt = out_adpcm[OUTD_LEFT] + out_adpcm[OUTD_CENTER]; + rt = out_adpcm[OUTD_RIGHT] + out_adpcm[OUTD_CENTER]; + lt += (out_delta[OUTD_LEFT] + out_delta[OUTD_CENTER])>>9; + rt += (out_delta[OUTD_RIGHT] + out_delta[OUTD_CENTER])>>9; + + + lt += ((out_fm[1]>>1) & OPN->pan[2]); /* the shift right was verified on real chip */ + rt += ((out_fm[1]>>1) & OPN->pan[3]); + lt += ((out_fm[2]>>1) & OPN->pan[4]); + rt += ((out_fm[2]>>1) & OPN->pan[5]); + + lt += ((out_fm[4]>>1) & OPN->pan[8]); + rt += ((out_fm[4]>>1) & OPN->pan[9]); + lt += ((out_fm[5]>>1) & OPN->pan[10]); + rt += ((out_fm[5]>>1) & OPN->pan[11]); + + + lt >>= FINAL_SH; + rt >>= FINAL_SH; + + Limit( lt, MAXOUT, MINOUT ); + Limit( rt, MAXOUT, MINOUT ); + + #ifdef SAVE_SAMPLE + SAVE_ALL_CHANNELS + #endif + + /* buffering */ + bufL[i] = lt; + bufR[i] = rt; + } + + /* timer A control */ + INTERNAL_TIMER_A( &OPN->ST , cch[1] ) + } + INTERNAL_TIMER_B(&OPN->ST,length) + +} + +#if BUILD_YM2610B +/* Generate samples for one of the YM2610Bs */ +void YM2610BUpdateOne(void *chip, FMSAMPLE **buffer, int length) +{ + YM2610 *F2610 = chip; + FM_OPN *OPN = &F2610->OPN; + YM_DELTAT *DELTAT = &F2610->deltaT; + int i,j; + FMSAMPLE *bufL,*bufR; + FM_CH *cch[6]; + + /* buffer setup */ + bufL = buffer[0]; + bufR = buffer[1]; + + cch[0] = &F2610->CH[0]; + cch[1] = &F2610->CH[1]; + cch[2] = &F2610->CH[2]; + cch[3] = &F2610->CH[3]; + cch[4] = &F2610->CH[4]; + cch[5] = &F2610->CH[5]; + /* setup adpcm rom address */ + pcmbufA = F2610->pcmbuf; + pcmsizeA = F2610->pcm_size; + + /* refresh PG and EG */ + refresh_fc_eg_chan( cch[0] ); + refresh_fc_eg_chan( cch[1] ); + if( (OPN->ST.mode & 0xc0) ) + { + /* 3SLOT MODE */ + if( cch[2]->SLOT[SLOT1].Incr==-1) + { + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT1] , OPN->SL3.fc[1] , OPN->SL3.kcode[1] ); + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT2] , OPN->SL3.fc[2] , OPN->SL3.kcode[2] ); + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT3] , OPN->SL3.fc[0] , OPN->SL3.kcode[0] ); + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT4] , cch[2]->fc , cch[2]->kcode ); + } + }else refresh_fc_eg_chan( cch[2] ); + refresh_fc_eg_chan( cch[3] ); + refresh_fc_eg_chan( cch[4] ); + refresh_fc_eg_chan( cch[5] ); + + /* buffering */ + for(i=0; i < length ; i++) + { + + advance_lfo(OPN); + + /* clear output acc. */ + out_adpcm[OUTD_LEFT] = out_adpcm[OUTD_RIGHT]= out_adpcm[OUTD_CENTER] = 0; + out_delta[OUTD_LEFT] = out_delta[OUTD_RIGHT]= out_delta[OUTD_CENTER] = 0; + /* clear outputs */ + out_fm[0] = 0; + out_fm[1] = 0; + out_fm[2] = 0; + out_fm[3] = 0; + out_fm[4] = 0; + out_fm[5] = 0; + + /* advance envelope generator */ + OPN->eg_timer += OPN->eg_timer_add; + while (OPN->eg_timer >= OPN->eg_timer_overflow) + { + OPN->eg_timer -= OPN->eg_timer_overflow; + OPN->eg_cnt++; + + advance_eg_channel(OPN, &cch[0]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[1]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[2]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[3]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[4]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[5]->SLOT[SLOT1]); + } + + /* calculate FM */ + chan_calc(OPN, cch[0] ); + chan_calc(OPN, cch[1] ); + chan_calc(OPN, cch[2] ); + chan_calc(OPN, cch[3] ); + chan_calc(OPN, cch[4] ); + chan_calc(OPN, cch[5] ); + + /* deltaT ADPCM */ + if( DELTAT->portstate&0x80 ) + YM_DELTAT_ADPCM_CALC(DELTAT); + + /* ADPCMA */ + for( j = 0; j < 6; j++ ) + { + if( F2610->adpcm[j].flag ) + ADPCMA_calc_chan( F2610, &F2610->adpcm[j]); + } + + /* buffering */ + { + int lt,rt; + + lt = out_adpcm[OUTD_LEFT] + out_adpcm[OUTD_CENTER]; + rt = out_adpcm[OUTD_RIGHT] + out_adpcm[OUTD_CENTER]; + lt += (out_delta[OUTD_LEFT] + out_delta[OUTD_CENTER])>>9; + rt += (out_delta[OUTD_RIGHT] + out_delta[OUTD_CENTER])>>9; + + lt += ((out_fm[0]>>1) & OPN->pan[0]); /* the shift right is verified on YM2610 */ + rt += ((out_fm[0]>>1) & OPN->pan[1]); + lt += ((out_fm[1]>>1) & OPN->pan[2]); + rt += ((out_fm[1]>>1) & OPN->pan[3]); + lt += ((out_fm[2]>>1) & OPN->pan[4]); + rt += ((out_fm[2]>>1) & OPN->pan[5]); + lt += ((out_fm[3]>>1) & OPN->pan[6]); + rt += ((out_fm[3]>>1) & OPN->pan[7]); + lt += ((out_fm[4]>>1) & OPN->pan[8]); + rt += ((out_fm[4]>>1) & OPN->pan[9]); + lt += ((out_fm[5]>>1) & OPN->pan[10]); + rt += ((out_fm[5]>>1) & OPN->pan[11]); + + + lt >>= FINAL_SH; + rt >>= FINAL_SH; + + Limit( lt, MAXOUT, MINOUT ); + Limit( rt, MAXOUT, MINOUT ); + + #ifdef SAVE_SAMPLE + SAVE_ALL_CHANNELS + #endif + + /* buffering */ + bufL[i] = lt; + bufR[i] = rt; + } + + /* timer A control */ + INTERNAL_TIMER_A( &OPN->ST , cch[2] ) + } + INTERNAL_TIMER_B(&OPN->ST,length) + +} +#endif /* BUILD_YM2610B */ + + +#ifdef __STATE_H__ +void YM2610Postload(void *chip) +{ + if (chip) + { + YM2610 *F2610 = (YM2610 *)chip; + int r; + + /* SSG registers */ + for(r=0;r<16;r++) + { + (*F2610->OPN.ST.SSG->write)(F2610->OPN.ST.param,0,r); + (*F2610->OPN.ST.SSG->write)(F2610->OPN.ST.param,1,F2610->REGS[r]); + } + + /* OPN registers */ + /* DT / MULTI , TL , KS / AR , AMON / DR , SR , SL / RR , SSG-EG */ + for(r=0x30;r<0x9e;r++) + if((r&3) != 3) + { + OPNWriteReg(&F2610->OPN,r,F2610->REGS[r]); + OPNWriteReg(&F2610->OPN,r|0x100,F2610->REGS[r|0x100]); + } + /* FB / CONNECT , L / R / AMS / PMS */ + for(r=0xb0;r<0xb6;r++) + if((r&3) != 3) + { + OPNWriteReg(&F2610->OPN,r,F2610->REGS[r]); + OPNWriteReg(&F2610->OPN,r|0x100,F2610->REGS[r|0x100]); + } + /* FM channels */ + /*FM_channel_postload(F2610->CH,6);*/ + + /* rhythm(ADPCMA) */ + FM_ADPCMAWrite(F2610,1,F2610->REGS[0x101]); + for( r=0 ; r<6 ; r++) + { + FM_ADPCMAWrite(F2610,r+0x08,F2610->REGS[r+0x108]); + FM_ADPCMAWrite(F2610,r+0x10,F2610->REGS[r+0x110]); + FM_ADPCMAWrite(F2610,r+0x18,F2610->REGS[r+0x118]); + FM_ADPCMAWrite(F2610,r+0x20,F2610->REGS[r+0x120]); + FM_ADPCMAWrite(F2610,r+0x28,F2610->REGS[r+0x128]); + } + /* Delta-T ADPCM unit */ + YM_DELTAT_postload(&F2610->deltaT , &F2610->REGS[0x010] ); + } +} + +static void YM2610_save_state(YM2610 *F2610, int index) +{ + static const char statename[] = "YM2610"; + + state_save_register_item_array(statename, index, F2610->REGS); + FMsave_state_st(statename,index,&F2610->OPN.ST); + FMsave_state_channel(statename,index,F2610->CH,6); + /* 3slots */ + state_save_register_item_array(statename, index, F2610->OPN.SL3.fc); + state_save_register_item(statename, index, F2610->OPN.SL3.fn_h); + state_save_register_item_array(statename, index, F2610->OPN.SL3.kcode); + /* address register1 */ + state_save_register_item(statename, index, F2610->addr_A1); + + state_save_register_item(statename, index, F2610->adpcm_arrivedEndAddress); + /* rythm(ADPCMA) */ + FMsave_state_adpcma(statename,index,F2610->adpcm); + /* Delta-T ADPCM unit */ + YM_DELTAT_savestate(statename,index,&F2610->deltaT); +} +#endif /* _STATE_H */ + +static void YM2610_deltat_status_set(void *chip, UINT8 changebits) +{ + YM2610 *F2610 = chip; + F2610->adpcm_arrivedEndAddress |= changebits; +} +static void YM2610_deltat_status_reset(void *chip, UINT8 changebits) +{ + YM2610 *F2610 = chip; + F2610->adpcm_arrivedEndAddress &= (~changebits); +} + +void *YM2610Init(void *param, int index, int clock, int rate, + void *pcmroma,int pcmsizea,void *pcmromb,int pcmsizeb, + FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler, const struct ssg_callbacks *ssg) + +{ + YM2610 *F2610; + + /* allocate extend state space */ + if( (F2610 = (YM2610 *)malloc(sizeof(YM2610)))==NULL) + return NULL; + /* clear */ + memset(F2610,0,sizeof(YM2610)); + /* allocate total level table (128kb space) */ + if( !init_tables() ) + { + free( F2610 ); + return NULL; + } + + /* FM */ + F2610->OPN.ST.param = param; + F2610->OPN.type = TYPE_YM2610; + F2610->OPN.P_CH = F2610->CH; + F2610->OPN.ST.clock = clock; + F2610->OPN.ST.rate = rate; + /* Extend handler */ + F2610->OPN.ST.Timer_Handler = TimerHandler; + F2610->OPN.ST.IRQ_Handler = IRQHandler; + F2610->OPN.ST.SSG = ssg; + /* ADPCM */ + F2610->pcmbuf = (UINT8 *)pcmroma; + F2610->pcm_size = pcmsizea; + /* DELTA-T */ + F2610->deltaT.memory = (UINT8 *)pcmromb; + F2610->deltaT.memory_size = pcmsizeb; + + F2610->deltaT.status_set_handler = YM2610_deltat_status_set; + F2610->deltaT.status_reset_handler = YM2610_deltat_status_reset; + F2610->deltaT.status_change_which_chip = F2610; + F2610->deltaT.status_change_EOS_bit = 0x80; /* status flag: set bit7 on End Of Sample */ + + YM2610ResetChip(F2610); + + Init_ADPCMATable(); +#ifdef __STATE_H__ + YM2610_save_state(F2610, index); +#endif + return F2610; +} + +/* shut down emulator */ +void YM2610Shutdown(void *chip) +{ + YM2610 *F2610 = chip; + + FMCloseTable(); + free(F2610); +} + +/* reset one of chip */ +void YM2610ResetChip(void *chip) +{ + int i; + YM2610 *F2610 = chip; + FM_OPN *OPN = &F2610->OPN; + YM_DELTAT *DELTAT = &F2610->deltaT; + + /* Reset Prescaler */ + OPNSetPres( OPN, 6*24, 6*24, 4*2); /* OPN 1/6 , SSG 1/4 */ + /* reset SSG section */ + (*OPN->ST.SSG->reset)(OPN->ST.param); + /* status clear */ + FM_IRQMASK_SET(&OPN->ST,0x03); + FM_BUSY_CLEAR(&OPN->ST); + OPNWriteMode(OPN,0x27,0x30); /* mode 0 , timer reset */ + + OPN->eg_timer = 0; + OPN->eg_cnt = 0; + + FM_STATUS_RESET(&OPN->ST, 0xff); + + reset_channels( &OPN->ST , F2610->CH , 6 ); + /* reset OPerator paramater */ + for(i = 0xb6 ; i >= 0xb4 ; i-- ) + { + OPNWriteReg(OPN,i ,0xc0); + OPNWriteReg(OPN,i|0x100,0xc0); + } + for(i = 0xb2 ; i >= 0x30 ; i-- ) + { + OPNWriteReg(OPN,i ,0); + OPNWriteReg(OPN,i|0x100,0); + } + for(i = 0x26 ; i >= 0x20 ; i-- ) OPNWriteReg(OPN,i,0); + /**** ADPCM work initial ****/ + for( i = 0; i < 6 ; i++ ){ + F2610->adpcm[i].step = (UINT32)((float)(1<OPN.ST.freqbase)/3.0); + F2610->adpcm[i].now_addr = 0; + F2610->adpcm[i].now_step = 0; + F2610->adpcm[i].start = 0; + F2610->adpcm[i].end = 0; + /* F2610->adpcm[i].delta = 21866; */ + F2610->adpcm[i].vol_mul = 0; + F2610->adpcm[i].pan = &out_adpcm[OUTD_CENTER]; /* default center */ + F2610->adpcm[i].flagMask = 1<adpcm[i].flag = 0; + F2610->adpcm[i].adpcm_acc = 0; + F2610->adpcm[i].adpcm_step= 0; + F2610->adpcm[i].adpcm_out = 0; + } + F2610->adpcmTL = 0x3f; + + F2610->adpcm_arrivedEndAddress = 0; + + /* DELTA-T unit */ + DELTAT->freqbase = OPN->ST.freqbase; + DELTAT->output_pointer = out_delta; + DELTAT->portshift = 8; /* allways 8bits shift */ + DELTAT->output_range = 1<<23; + YM_DELTAT_ADPCM_Reset(DELTAT,OUTD_CENTER,YM_DELTAT_EMULATION_MODE_YM2610); +} + +/* YM2610 write */ +/* n = number */ +/* a = address */ +/* v = value */ +int YM2610Write(void *chip, int a, UINT8 v) +{ + YM2610 *F2610 = chip; + FM_OPN *OPN = &F2610->OPN; + int addr; + int ch; + + v &= 0xff; /* adjust to 8 bit bus */ + + switch( a&3 ){ + case 0: /* address port 0 */ + OPN->ST.address = v; + F2610->addr_A1 = 0; + + /* Write register to SSG emulator */ + if( v < 16 ) (*OPN->ST.SSG->write)(OPN->ST.param,0,v); + break; + + case 1: /* data port 0 */ + if (F2610->addr_A1 != 0) + break; /* verified on real YM2608 */ + + addr = OPN->ST.address; + F2610->REGS[addr] = v; + switch(addr & 0xf0) + { + case 0x00: /* SSG section */ + /* Write data to SSG emulator */ + (*OPN->ST.SSG->write)(OPN->ST.param,a,v); + break; + case 0x10: /* DeltaT ADPCM */ + YM2610UpdateReq(OPN->ST.param); + + switch(addr) + { + case 0x10: /* control 1 */ + case 0x11: /* control 2 */ + case 0x12: /* start address L */ + case 0x13: /* start address H */ + case 0x14: /* stop address L */ + case 0x15: /* stop address H */ + + case 0x19: /* delta-n L */ + case 0x1a: /* delta-n H */ + case 0x1b: /* volume */ + { + YM_DELTAT_ADPCM_Write(&F2610->deltaT,addr-0x10,v); + } + break; + + case 0x1c: /* FLAG CONTROL : Extend Status Clear/Mask */ + { + UINT8 statusmask = ~v; + /* set arrived flag mask */ + for(ch=0;ch<6;ch++) + F2610->adpcm[ch].flagMask = statusmask&(1<deltaT.status_change_EOS_bit = statusmask & 0x80; /* status flag: set bit7 on End Of Sample */ + + /* clear arrived flag */ + F2610->adpcm_arrivedEndAddress &= statusmask; + } + break; + + default: + logerror("YM2610: write to unknown deltat register %02x val=%02x\n",addr,v); + break; + } + + break; + case 0x20: /* Mode Register */ + YM2610UpdateReq(OPN->ST.param); + OPNWriteMode(OPN,addr,v); + break; + default: /* OPN section */ + YM2610UpdateReq(OPN->ST.param); + /* write register */ + OPNWriteReg(OPN,addr,v); + } + break; + + case 2: /* address port 1 */ + OPN->ST.address = v; + F2610->addr_A1 = 1; + break; + + case 3: /* data port 1 */ + if (F2610->addr_A1 != 1) + break; /* verified on real YM2608 */ + + YM2610UpdateReq(OPN->ST.param); + addr = OPN->ST.address; + F2610->REGS[addr | 0x100] = v; + if( addr < 0x30 ) + /* 100-12f : ADPCM A section */ + FM_ADPCMAWrite(F2610,addr,v); + else + OPNWriteReg(OPN,addr | 0x100,v); + } + return OPN->ST.irq; +} + +UINT8 YM2610Read(void *chip,int a) +{ + YM2610 *F2610 = chip; + int addr = F2610->OPN.ST.address; + UINT8 ret = 0; + + switch( a&3){ + case 0: /* status 0 : YM2203 compatible */ + ret = FM_STATUS_FLAG(&F2610->OPN.ST) & 0x83; + break; + case 1: /* data 0 */ + if( addr < 16 ) ret = (*F2610->OPN.ST.SSG->read)(F2610->OPN.ST.param); + if( addr == 0xff ) ret = 0x01; + break; + case 2: /* status 1 : ADPCM status */ + /* ADPCM STATUS (arrived End Address) */ + /* B,--,A5,A4,A3,A2,A1,A0 */ + /* B = ADPCM-B(DELTA-T) arrived end address */ + /* A0-A5 = ADPCM-A arrived end address */ + ret = F2610->adpcm_arrivedEndAddress; + break; + case 3: + ret = 0; + break; + } + return ret; +} + +int YM2610TimerOver(void *chip,int c) +{ + YM2610 *F2610 = chip; + + if( c ) + { /* Timer B */ + TimerBOver( &(F2610->OPN.ST) ); + } + else + { /* Timer A */ + YM2610UpdateReq(F2610->OPN.ST.param); + /* timer update */ + TimerAOver( &(F2610->OPN.ST) ); + /* CSM mode key,TL controll */ + if( F2610->OPN.ST.mode & 0x80 ) + { /* CSM mode total level latch and auto key on */ + CSMKeyControll( &(F2610->CH[2]) ); + } + } + return F2610->OPN.ST.irq; +} + +#endif /* (BUILD_YM2610||BUILD_YM2610B) */ + + + +#if BUILD_YM2612 +/*******************************************************************************/ +/* YM2612 local section */ +/*******************************************************************************/ +/* here's the virtual YM2612 */ +typedef struct +{ + UINT8 REGS[512]; /* registers */ + FM_OPN OPN; /* OPN state */ + FM_CH CH[6]; /* channel state */ + UINT8 addr_A1; /* address line A1 */ + + /* dac output (YM2612) */ + int dacen; + INT32 dacout; +} YM2612; + +static int dacen; +static long dac_highpass; +/* Generate samples for one of the YM2612s */ +void YM2612UpdateOne(void *chip, FMSAMPLE **buffer, int length) +{ + YM2612 *F2612 = chip; + FM_OPN *OPN = &F2612->OPN; + int i; + FMSAMPLE *bufL,*bufR; + INT32 dacout = F2612->dacout; + FM_CH *cch[6]; + + /* set buffer */ + bufL = buffer[0]; + bufR = buffer[1]; + + cch[0] = &F2612->CH[0]; + cch[1] = &F2612->CH[1]; + cch[2] = &F2612->CH[2]; + cch[3] = &F2612->CH[3]; + cch[4] = &F2612->CH[4]; + cch[5] = &F2612->CH[5]; + /* DAC mode */ + dacen = F2612->dacen; + + /* refresh PG and EG */ + refresh_fc_eg_chan( cch[0] ); + refresh_fc_eg_chan( cch[1] ); + if( (OPN->ST.mode & 0xc0) ) + { + /* 3SLOT MODE */ + if( cch[2]->SLOT[SLOT1].Incr==-1) + { + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT1] , OPN->SL3.fc[1] , OPN->SL3.kcode[1] ); + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT2] , OPN->SL3.fc[2] , OPN->SL3.kcode[2] ); + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT3] , OPN->SL3.fc[0] , OPN->SL3.kcode[0] ); + refresh_fc_eg_slot(&cch[2]->SLOT[SLOT4] , cch[2]->fc , cch[2]->kcode ); + } + }else refresh_fc_eg_chan( cch[2] ); + refresh_fc_eg_chan( cch[3] ); + refresh_fc_eg_chan( cch[4] ); + refresh_fc_eg_chan( cch[5] ); + + /* buffering */ + for(i=0; i < length ; i++) + { + + advance_lfo(OPN); + + /* clear outputs */ + out_fm[0] = 0; + out_fm[1] = 0; + out_fm[2] = 0; + out_fm[3] = 0; + out_fm[4] = 0; + out_fm[5] = 0; + + /* advance envelope generator */ + OPN->eg_timer += OPN->eg_timer_add; + while (OPN->eg_timer >= OPN->eg_timer_overflow) + { + OPN->eg_timer -= OPN->eg_timer_overflow; + OPN->eg_cnt++; + + advance_eg_channel(OPN, &cch[0]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[1]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[2]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[3]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[4]->SLOT[SLOT1]); + advance_eg_channel(OPN, &cch[5]->SLOT[SLOT1]); + } + + /* calculate FM */ + chan_calc(OPN, cch[0] ); + chan_calc(OPN, cch[1] ); + chan_calc(OPN, cch[2] ); + chan_calc(OPN, cch[3] ); + chan_calc(OPN, cch[4] ); + if (dacen) + { + long dac = (dacout << 15) - dac_highpass; + dac_highpass += dac >> 9; + dac >>= 15; + *cch[5]->connect4 += dac; + } + else chan_calc(OPN, cch[5] ); + + { + int lt,rt; + + lt = ((out_fm[0]>>0) & OPN->pan[0]); + rt = ((out_fm[0]>>0) & OPN->pan[1]); + lt += ((out_fm[1]>>0) & OPN->pan[2]); + rt += ((out_fm[1]>>0) & OPN->pan[3]); + lt += ((out_fm[2]>>0) & OPN->pan[4]); + rt += ((out_fm[2]>>0) & OPN->pan[5]); + lt += ((out_fm[3]>>0) & OPN->pan[6]); + rt += ((out_fm[3]>>0) & OPN->pan[7]); + lt += ((out_fm[4]>>0) & OPN->pan[8]); + rt += ((out_fm[4]>>0) & OPN->pan[9]); + lt += ((out_fm[5]>>0) & OPN->pan[10]); + rt += ((out_fm[5]>>0) & OPN->pan[11]); + + + lt >>= FINAL_SH; + rt >>= FINAL_SH; + + Limit( lt, MAXOUT, MINOUT ); + Limit( rt, MAXOUT, MINOUT ); + + #ifdef SAVE_SAMPLE + SAVE_ALL_CHANNELS + #endif + + /* buffering */ + bufL[i] = lt; + bufR[i] = rt; + } + + /* timer A control */ + INTERNAL_TIMER_A( &OPN->ST , cch[2] ) + } + INTERNAL_TIMER_B(&OPN->ST,length) + +} + +#ifdef __STATE_H__ +void YM2612Postload(void *chip) +{ + if (chip) + { + YM2612 *F2612 = (YM2612 *)chip; + int r; + + /* DAC data & port */ + F2612->dacout = ((int)F2612->REGS[0x2a] - 0x80) << 0; /* level unknown */ + F2612->dacen = F2612->REGS[0x2d] & 0x80; + /* OPN registers */ + /* DT / MULTI , TL , KS / AR , AMON / DR , SR , SL / RR , SSG-EG */ + for(r=0x30;r<0x9e;r++) + if((r&3) != 3) + { + OPNWriteReg(&F2612->OPN,r,F2612->REGS[r]); + OPNWriteReg(&F2612->OPN,r|0x100,F2612->REGS[r|0x100]); + } + /* FB / CONNECT , L / R / AMS / PMS */ + for(r=0xb0;r<0xb6;r++) + if((r&3) != 3) + { + OPNWriteReg(&F2612->OPN,r,F2612->REGS[r]); + OPNWriteReg(&F2612->OPN,r|0x100,F2612->REGS[r|0x100]); + } + /* channels */ + /*FM_channel_postload(F2612->CH,6);*/ + } +} + +static void YM2612_save_state(YM2612 *F2612, int index) +{ + static const char statename[] = "YM2612"; + + state_save_register_item_array(statename, index, F2612->REGS); + FMsave_state_st(statename,index,&F2612->OPN.ST); + FMsave_state_channel(statename,index,F2612->CH,6); + /* 3slots */ + state_save_register_item_array(statename, index, F2612->OPN.SL3.fc); + state_save_register_item(statename, index, F2612->OPN.SL3.fn_h); + state_save_register_item_array(statename, index, F2612->OPN.SL3.kcode); + /* address register1 */ + state_save_register_item(statename, index, F2612->addr_A1); +} +#endif /* _STATE_H */ + +/* initialize YM2612 emulator(s) */ +void * YM2612Init(void *param, int index, int clock, int rate, + FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler) +{ + YM2612 *F2612; + + /* allocate extend state space */ + if( (F2612 = (YM2612 *)malloc(sizeof(YM2612)))==NULL) + return NULL; + /* clear */ + memset(F2612,0,sizeof(YM2612)); + /* allocate total level table (128kb space) */ + if( !init_tables() ) + { + free( F2612 ); + return NULL; + } + + F2612->OPN.ST.param = param; + F2612->OPN.type = TYPE_YM2612; + F2612->OPN.P_CH = F2612->CH; + F2612->OPN.ST.clock = clock; + F2612->OPN.ST.rate = rate; + /* F2612->OPN.ST.irq = 0; */ + /* F2612->OPN.ST.status = 0; */ + /* Extend handler */ + F2612->OPN.ST.Timer_Handler = TimerHandler; + F2612->OPN.ST.IRQ_Handler = IRQHandler; + YM2612ResetChip(F2612); + +#ifdef __STATE_H__ + YM2612_save_state(F2612, index); +#endif + return F2612; +} + +/* shut down emulator */ +void YM2612Shutdown(void *chip) +{ + YM2612 *F2612 = chip; + + FMCloseTable(); + free(F2612); +} + +/* reset one of chip */ +void YM2612ResetChip(void *chip) +{ + int i; + YM2612 *F2612 = chip; + FM_OPN *OPN = &F2612->OPN; + + OPNSetPres( OPN, 6*24, 6*24, 0); + /* status clear */ + FM_IRQMASK_SET(&OPN->ST,0x03); + FM_BUSY_CLEAR(&OPN->ST); + OPNWriteMode(OPN,0x27,0x30); /* mode 0 , timer reset */ + + OPN->eg_timer = 0; + OPN->eg_cnt = 0; + + FM_STATUS_RESET(&OPN->ST, 0xff); + + reset_channels( &OPN->ST , &F2612->CH[0] , 6 ); + for(i = 0xb6 ; i >= 0xb4 ; i-- ) + { + OPNWriteReg(OPN,i ,0xc0); + OPNWriteReg(OPN,i|0x100,0xc0); + } + for(i = 0xb2 ; i >= 0x30 ; i-- ) + { + OPNWriteReg(OPN,i ,0); + OPNWriteReg(OPN,i|0x100,0); + } + for(i = 0x26 ; i >= 0x20 ; i-- ) OPNWriteReg(OPN,i,0); + /* DAC mode clear */ + F2612->dacen = 0; + dac_highpass = 0; +} + +/* YM2612 write */ +/* n = number */ +/* a = address */ +/* v = value */ +int YM2612Write(void *chip, int a, UINT8 v) +{ + YM2612 *F2612 = chip; + int addr; + + v &= 0xff; /* adjust to 8 bit bus */ + + switch( a&3){ + case 0: /* address port 0 */ + F2612->OPN.ST.address = v; + F2612->addr_A1 = 0; + break; + + case 1: /* data port 0 */ + addr = F2612->OPN.ST.address; + F2612->REGS[addr] = v; + switch( addr & 0xf0 ) + { + case 0x20: /* 0x20-0x2f Mode */ + switch( addr ) + { + case 0x2a: /* DAC data (YM2612) */ + YM2612UpdateReq(F2612->OPN.ST.param); + F2612->dacout = ((int)v - 0x80) << 6; /* level unknown */ + break; + case 0x2b: /* DAC Sel (YM2612) */ + /* b7 = dac enable */ + F2612->dacen = v & 0x80; + break; + default: /* OPN section */ + YM2612UpdateReq(F2612->OPN.ST.param); + /* write register */ + OPNWriteMode(&(F2612->OPN),addr,v); + } + break; + default: /* 0x30-0xff OPN section */ + YM2612UpdateReq(F2612->OPN.ST.param); + /* write register */ + OPNWriteReg(&(F2612->OPN),addr,v); + } + break; + + case 2: /* address port 1 */ + F2612->OPN.ST.address = v; + F2612->addr_A1 = 1; + break; + + case 3: /* data port 1 */ + addr = F2612->OPN.ST.address; + F2612->REGS[addr | 0x100] = v; + YM2612UpdateReq(F2612->OPN.ST.param); + OPNWriteReg(&(F2612->OPN),addr | 0x100,v); + break; + } + return F2612->OPN.ST.irq; +} + +UINT8 YM2612Read(void *chip,int a) +{ + YM2612 *F2612 = chip; + + switch( a&3){ + case 0: /* status 0 */ + return FM_STATUS_FLAG(&F2612->OPN.ST); + case 1: + case 2: + case 3: +#if 0 + LOG(LOG_WAR,("YM2612 #%p:A=%d read unmapped area\n",F2612->OPN.ST.param,a)); +#endif + return FM_STATUS_FLAG(&F2612->OPN.ST); + } + return 0; +} + +int YM2612TimerOver(void *chip,int c) +{ + YM2612 *F2612 = chip; + + if( c ) + { /* Timer B */ + TimerBOver( &(F2612->OPN.ST) ); + } + else + { /* Timer A */ + YM2612UpdateReq(F2612->OPN.ST.param); + /* timer update */ + TimerAOver( &(F2612->OPN.ST) ); + /* CSM mode key,TL controll */ + if( F2612->OPN.ST.mode & 0x80 ) + { /* CSM mode total level latch and auto key on */ + CSMKeyControll( &(F2612->CH[2]) ); + } + } + return F2612->OPN.ST.irq; +} + +void YM2612UpdateRequest(void *param) +{ +} + +#endif /* BUILD_YM2612 */ diff --git a/source/sound/fm.h b/source/sound/fm.h new file mode 100644 index 0000000..16ab0ec --- /dev/null +++ b/source/sound/fm.h @@ -0,0 +1,205 @@ +/* + File: fm.h -- header file for software emulation for FM sound generator + +*/ +#ifndef _H_FM_FM_ +#define _H_FM_FM_ +#define HAS_YM2612 1 +#include "shared.h" +/* --- select emulation chips --- */ +#define BUILD_YM2203 (HAS_YM2203) /* build YM2203(OPN) emulator */ +#define BUILD_YM2608 (HAS_YM2608) /* build YM2608(OPNA) emulator */ +#define BUILD_YM2610 (HAS_YM2610) /* build YM2610(OPNB) emulator */ +#define BUILD_YM2610B (HAS_YM2610B) /* build YM2610B(OPNB?)emulator */ +#define BUILD_YM2612 (HAS_YM2612 || HAS_YM3438) /* build YM2612(OPN2) emulator */ + +/* select bit size of output : 8 or 16 */ +#define FM_SAMPLE_BITS 16 + +/* select timer system internal or external */ +#define FM_INTERNAL_TIMER 0 + +/* --- speedup optimize --- */ +/* busy flag enulation , The definition of FM_GET_TIME_NOW() is necessary. */ +#define FM_BUSY_FLAG_SUPPORT 0 + +/* --- external SSG(YM2149/AY-3-8910)emulator interface port */ +/* used by YM2203,YM2608,and YM2610 */ +struct ssg_callbacks +{ + void (*set_clock)(void *param, int clock); + void (*write)(void *param, int address, int data); + int (*read)(void *param); + void (*reset)(void *param); +}; + +/* --- external callback funstions for realtime update --- */ + +/* for busy flag emulation , function FM_GET_TIME_NOW() should */ +/* return present time in seconds with "double" precision */ +/* in timer.c */ +#define FM_GET_TIME_NOW() timer_get_time() + +#if BUILD_YM2203 + /* in 2203intf.c */ + void YM2203UpdateRequest(void *param); + #define YM2203UpdateReq(chip) YM2203UpdateRequest(chip) +#endif +#if BUILD_YM2608 + /* in 2608intf.c */ + void YM2608UpdateRequest(void *param); + #define YM2608UpdateReq(chip) YM2608UpdateRequest(chip); +#endif +#if BUILD_YM2610 + /* in 2610intf.c */ + void YM2610UpdateRequest(void *param); + #define YM2610UpdateReq(chip) YM2610UpdateRequest(chip); +#endif +#if BUILD_YM2612 + /* in 2612intf.c */ + void YM2612UpdateRequest(void *param); + #define YM2612UpdateReq(chip) YM2612UpdateRequest(chip); +#endif + +/* compiler dependence */ +#if 0 +#ifndef OSD_CPU_H +#define OSD_CPU_H +typedef unsigned char UINT8; /* unsigned 8bit */ +typedef unsigned short UINT16; /* unsigned 16bit */ +typedef unsigned int UINT32; /* unsigned 32bit */ +typedef signed char INT8; /* signed 8bit */ +typedef signed short INT16; /* signed 16bit */ +typedef signed int INT32; /* signed 32bit */ +#endif +#endif + +#ifndef INLINE +#define INLINE static __inline__ +#endif + + +typedef INT16 FMSAMPLE; +/* +#if (FM_SAMPLE_BITS==16) +typedef INT16 FMSAMPLE; +#endif +#if (FM_SAMPLE_BITS==8) +typedef unsigned char FMSAMPLE; +#endif +*/ + +typedef void (*FM_TIMERHANDLER)(void *param,int c,int cnt,double stepTime); +typedef void (*FM_IRQHANDLER)(void *param,int irq); +/* FM_TIMERHANDLER : Stop or Start timer */ +/* int n = chip number */ +/* int c = Channel 0=TimerA,1=TimerB */ +/* int count = timer count (0=stop) */ +/* doube stepTime = step time of one count (sec.)*/ + +/* FM_IRQHHANDLER : IRQ level changing sense */ +/* int n = chip number */ +/* int irq = IRQ level 0=OFF,1=ON */ + +#if BUILD_YM2203 +/* -------------------- YM2203(OPN) Interface -------------------- */ + +/* +** Initialize YM2203 emulator(s). +** +** 'num' is the number of virtual YM2203's to allocate +** 'baseclock' +** 'rate' is sampling rate +** 'TimerHandler' timer callback handler when timer start and clear +** 'IRQHandler' IRQ callback handler when changed IRQ level +** return 0 = success +*/ +void * YM2203Init(void *param, int index, int baseclock, int rate, + FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler, const struct ssg_callbacks *ssg); + +/* +** shutdown the YM2203 emulators +*/ +void YM2203Shutdown(void *chip); + +/* +** reset all chip registers for YM2203 number 'num' +*/ +void YM2203ResetChip(void *chip); + +/* +** update one of chip +*/ +void YM2203UpdateOne(void *chip, FMSAMPLE *buffer, int length); + +/* +** Write +** return : InterruptLevel +*/ +int YM2203Write(void *chip,int a,unsigned char v); + +/* +** Read +** return : InterruptLevel +*/ +unsigned char YM2203Read(void *chip,int a); + +/* +** Timer OverFlow +*/ +int YM2203TimerOver(void *chip, int c); + +/* +** State Save +*/ +void YM2203Postload(void *chip); +#endif /* BUILD_YM2203 */ + +#if BUILD_YM2608 +/* -------------------- YM2608(OPNA) Interface -------------------- */ +void * YM2608Init(void *param, int index, int baseclock, int rate, + void *pcmroma,int pcmsizea, + FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler, const struct ssg_callbacks *ssg); +void YM2608Shutdown(void *chip); +void YM2608ResetChip(void *chip); +void YM2608UpdateOne(void *chip, FMSAMPLE **buffer, int length); + +int YM2608Write(void *chip, int a,unsigned char v); +unsigned char YM2608Read(void *chip,int a); +int YM2608TimerOver(void *chip, int c ); +void YM2608Postload(void *chip); +#endif /* BUILD_YM2608 */ + +#if (BUILD_YM2610||BUILD_YM2610B) +/* -------------------- YM2610(OPNB) Interface -------------------- */ +void * YM2610Init(void *param, int index, int baseclock, int rate, + void *pcmroma,int pcmasize,void *pcmromb,int pcmbsize, + FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler, const struct ssg_callbacks *ssg); +void YM2610Shutdown(void *chip); +void YM2610ResetChip(void *chip); +void YM2610UpdateOne(void *chip, FMSAMPLE **buffer, int length); +#if BUILD_YM2610B +void YM2610BUpdateOne(void *chip, FMSAMPLE **buffer, int length); +#endif + +int YM2610Write(void *chip, int a,unsigned char v); +unsigned char YM2610Read(void *chip,int a); +int YM2610TimerOver(void *chip, int c ); +void YM2610Postload(void *chip); +#endif /* BUILD_YM2610 */ + +#if BUILD_YM2612 +void * YM2612Init(void *param, int index, int baseclock, int rate, + FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler); +void YM2612Shutdown(void *chip); +void YM2612ResetChip(void *chip); +void YM2612UpdateOne(void *chip, FMSAMPLE **buffer, int length); + +int YM2612Write(void *chip, int a,unsigned char v); +unsigned char YM2612Read(void *chip,int a); +int YM2612TimerOver(void *chip, int c ); +void YM2612Postload(void *chip); +#endif /* BUILD_YM2612 */ + + +#endif /* _H_FM_FM_ */ diff --git a/source/sound/sn76489.c b/source/sound/sn76489.c new file mode 100644 index 0000000..4ea0850 --- /dev/null +++ b/source/sound/sn76489.c @@ -0,0 +1,290 @@ +/* + SN76489 emulation + by Maxim in 2001 and 2002 + converted from my original Delphi implementation + + I'm a C newbie so I'm sure there are loads of stupid things + in here which I'll come back to some day and redo + + Includes: + - Super-high quality tone channel "oversampling" by calculating fractional positions on transitions + - Noise output pattern reverse engineered from actual SMS output + - Volume levels taken from actual SMS output + + 07/08/04 Charles MacDonald + Modified for use with SMS Plus: + - Added support for multiple PSG chips. + - Added reset/config/update routines. + - Added context management routines. + - Removed SN76489_GetValues(). + - Removed some unused variables. + + 25/04/07 Eke-Eke + Modified for use with GenesisPlus Gamecube's port: + - made SN76489_Update outputs 16bits mono samples + - replaced volume table with VGM plugin's one +*/ + +#include "sn76489.h" +#include // for FLT_MIN +#include // for memcpy + +#define NoiseInitialState 0x8000 /* Initial state of shift register */ +#define PSG_CUTOFF 0x6 /* Value below which PSG does not output */ + +static const int PSGVolumeValues[2][16] = { + /* These values are taken from a real SMS2's output */ + {892,892,892,760,623,497,404,323,257,198,159,123,96,75,60,0}, /* I can't remember why 892... :P some scaling I did at some point */ + /* these values are true volumes for 2dB drops at each step (multiply previous by 10^-0.1), normalised at 760 */ + {1516,1205,957,760,603,479,381,303,240,191,152,120,96,76,60,0} +}; + +static SN76489_Context SN76489[MAX_SN76489]; + +void SN76489_Init(int which, int PSGClockValue, int SamplingRate) +{ + SN76489_Context *p = &SN76489[which]; + p->dClock=(float)PSGClockValue/16/SamplingRate; + SN76489_Config(which, MUTE_ALLON, VOL_FULL, FB_SEGAVDP, SRW_SEGAVDP, 1); + SN76489_Reset(which); +} + +void SN76489_Reset(int which) +{ + SN76489_Context *p = &SN76489[which]; + int i; + + p->PSGStereo = 0xFF; + + for(i = 0; i <= 3; i++) + { + /* Initialise PSG state */ + p->Registers[2*i] = 1; /* tone freq=1 */ + p->Registers[2*i+1] = 0xf; /* vol=off */ + p->NoiseFreq = 0x10; + + /* Set counters to 0 */ + p->ToneFreqVals[i] = 0; + + /* Set flip-flops to 1 */ + p->ToneFreqPos[i] = 1; + + /* Set intermediate positions to do-not-use value */ + p->IntermediatePos[i] = FLT_MIN; + + /* Set panning to centre */ + p->panning[0]=127; + } + + p->LatchedRegister=0; + + /* Initialise noise generator */ + p->NoiseShiftRegister=NoiseInitialState; + + /* Zero clock */ + p->Clock=0; + +} + +void SN76489_Shutdown(void) +{ +} + +void SN76489_Config(int which, int mute, int volume, int feedback, int sr_width, int boost_noise) +{ + SN76489_Context *p = &SN76489[which]; + + p->Mute = mute; + p->VolumeArray = volume; + p->WhiteNoiseFeedback = feedback; + p->SRWidth = sr_width; + p->BoostNoise = boost_noise; +} + +void SN76489_SetContext(int which, uint8 *data) +{ + memcpy(&SN76489[which], data, sizeof(SN76489_Context)); +} + +void SN76489_GetContext(int which, uint8 *data) +{ + memcpy(data, &SN76489[which], sizeof(SN76489_Context)); +} + +uint8 *SN76489_GetContextPtr(int which) +{ + return (uint8 *)&SN76489[which]; +} + +int SN76489_GetContextSize(void) +{ + return sizeof(SN76489_Context); +} + +void SN76489_Write(int which, int data) +{ + SN76489_Context *p = &SN76489[which]; + + if (data&0x80) { + /* Latch/data byte %1 cc t dddd */ + p->LatchedRegister=((data>>4)&0x07); + p->Registers[p->LatchedRegister]= + (p->Registers[p->LatchedRegister] & 0x3f0) /* zero low 4 bits */ + | (data&0xf); /* and replace with data */ + } else { + /* Data byte %0 - dddddd */ + if (!(p->LatchedRegister%2)&&(p->LatchedRegister<5)) + /* Tone register */ + p->Registers[p->LatchedRegister]= + (p->Registers[p->LatchedRegister] & 0x00f) /* zero high 6 bits */ + | ((data&0x3f)<<4); /* and replace with data */ + else + /* Other register */ + p->Registers[p->LatchedRegister]=data&0x0f; /* Replace with data */ + } + switch (p->LatchedRegister) { + case 0: + case 2: + case 4: /* Tone channels */ + if (p->Registers[p->LatchedRegister]==0) p->Registers[p->LatchedRegister]=1; /* Zero frequency changed to 1 to avoid div/0 */ + break; + case 6: /* Noise */ + p->NoiseShiftRegister=NoiseInitialState; /* reset shift register */ + p->NoiseFreq=0x10<<(p->Registers[6]&0x3); /* set noise signal generator frequency */ + break; + } +} + +void SN76489_GGStereoWrite(int which, int data) +{ + SN76489_Context *p = &SN76489[which]; + p->PSGStereo=data; +} + +void SN76489_Update(int which, INT16 *buffer, int length) +{ + SN76489_Context *p = &SN76489[which]; + int i, j; + + for(j = 0; j < length; j++) + { + for (i=0;i<=2;++i) + if (p->IntermediatePos[i]!=FLT_MIN) + p->Channels[i]=(short)((p->Mute >> i & 0x1)*PSGVolumeValues[p->VolumeArray][p->Registers[2*i+1]]*p->IntermediatePos[i]); + else + p->Channels[i]=(p->Mute >> i & 0x1)*PSGVolumeValues[p->VolumeArray][p->Registers[2*i+1]]*p->ToneFreqPos[i]; + + p->Channels[3]=(short)((p->Mute >> 3 & 0x1)*PSGVolumeValues[p->VolumeArray][p->Registers[7]]*(p->NoiseShiftRegister & 0x1)); + + if (p->BoostNoise) p->Channels[3]<<=1; /* double noise volume */ + + buffer[j] =0; + for (i=0;i<=3;++i) buffer[j] += p->Channels[i]; + + p->Clock+=p->dClock; + p->NumClocksForSample=(int)p->Clock; /* truncates */ + p->Clock-=p->NumClocksForSample; /* remove integer part */ + /* Looks nicer in Delphi... */ + /* Clock:=Clock+p->dClock; */ + /* NumClocksForSample:=Trunc(Clock); */ + /* Clock:=Frac(Clock); */ + + /* Decrement tone channel counters */ + for (i=0;i<=2;++i) + p->ToneFreqVals[i]-=p->NumClocksForSample; + + /* Noise channel: match to tone2 or decrement its counter */ + if (p->NoiseFreq==0x80) p->ToneFreqVals[3]=p->ToneFreqVals[2]; + else p->ToneFreqVals[3]-=p->NumClocksForSample; + + /* Tone channels: */ + for (i=0;i<=2;++i) { + if (p->ToneFreqVals[i]<=0) { /* If it gets below 0... */ + if (p->Registers[i*2]>PSG_CUTOFF) { + /* Calculate how much of the sample is + and how much is - */ + /* Go to floating point and include the clock fraction for extreme accuracy :D */ + /* Store as long int, maybe it's faster? I'm not very good at this */ + p->IntermediatePos[i]=(p->NumClocksForSample-p->Clock+2*p->ToneFreqVals[i])*p->ToneFreqPos[i]/(p->NumClocksForSample+p->Clock); + p->ToneFreqPos[i]=-p->ToneFreqPos[i]; /* Flip the flip-flop */ + } else { + p->ToneFreqPos[i]=1; /* stuck value */ + p->IntermediatePos[i]=FLT_MIN; + } + p->ToneFreqVals[i]+=p->Registers[i*2]*(p->NumClocksForSample/p->Registers[i*2]+1); + } else p->IntermediatePos[i]=FLT_MIN; + } + + /* Noise channel */ + if (p->ToneFreqVals[3]<=0) { /* If it gets below 0... */ + p->ToneFreqPos[3]=-p->ToneFreqPos[3]; /* Flip the flip-flop */ + if (p->NoiseFreq!=0x80) /* If not matching tone2, decrement counter */ + p->ToneFreqVals[3]+=p->NoiseFreq*(p->NumClocksForSample/p->NoiseFreq+1); + if (p->ToneFreqPos[3]==1) { /* Only once per cycle... */ + int Feedback; + if (p->Registers[6]&0x4) { /* White noise */ + /* Calculate parity of fed-back bits for feedback */ + switch (p->WhiteNoiseFeedback) { + /* Do some optimised calculations for common (known) feedback values */ + case 0x0003: /* SC-3000, BBC %00000011 */ + case 0x0009: /* SMS, GG, MD %00001001 */ + /* If two bits fed back, I can do Feedback=(nsr & fb) && (nsr & fb ^ fb) */ + /* since that's (one or more bits set) && (not all bits set) */ + Feedback=((p->NoiseShiftRegister&p->WhiteNoiseFeedback) && ((p->NoiseShiftRegister&p->WhiteNoiseFeedback)^p->WhiteNoiseFeedback)); + break; + default: /* Default handler for all other feedback values */ + Feedback=p->NoiseShiftRegister&p->WhiteNoiseFeedback; + Feedback^=Feedback>>8; + Feedback^=Feedback>>4; + Feedback^=Feedback>>2; + Feedback^=Feedback>>1; + Feedback&=1; + break; + } + } else /* Periodic noise */ + Feedback=p->NoiseShiftRegister&1; + + p->NoiseShiftRegister=(p->NoiseShiftRegister>>1) | (Feedback << (p->SRWidth-1)); + + /* Original code: */ + /* p->NoiseShiftRegister=(p->NoiseShiftRegister>>1) | ((p->Registers[6]&0x4?((p->NoiseShiftRegister&0x9) && (p->NoiseShiftRegister&0x9^0x9)):p->NoiseShiftRegister&1)<<15); */ + } + } + } +} + +/*void SN76489_UpdateOne(int which, int *l, int *r) +{ + INT16 tl,tr; + INT16 *buff[2]={&tl,&tr}; + SN76489_Update(which,buff,1); + *l=tl; + *r=tr; +}*/ + +int SN76489_GetMute(int which) +{ + return SN76489[which].Mute; +} + +void SN76489_SetMute(int which, int val) +{ + SN76489[which].Mute=val; +} + +int SN76489_GetVolType(int which) +{ + return SN76489[which].VolumeArray; +} + +void SN76489_SetVolType(int which, int val) +{ + SN76489[which].VolumeArray=val; +} + +void SN76489_SetPanning(int which, int ch0, int ch1, int ch2, int ch3) +{ + SN76489[which].panning[0]=ch0; + SN76489[which].panning[1]=ch1; + SN76489[which].panning[2]=ch2; + SN76489[which].panning[3]=ch3; +} diff --git a/source/sound/sn76489.h b/source/sound/sn76489.h new file mode 100644 index 0000000..517b800 --- /dev/null +++ b/source/sound/sn76489.h @@ -0,0 +1,91 @@ + +#ifndef _SN76489_H_ +#define _SN76489_H_ + +#define MAX_SN76489 4 +#include "shared.h" +/* + More testing is needed to find and confirm feedback patterns for + SN76489 variants and compatible chips. +*/ +enum feedback_patterns { + FB_BBCMICRO = 0x8005, /* Texas Instruments TMS SN76489N (original) from BBC Micro computer */ + FB_SC3000 = 0x0006, /* Texas Instruments TMS SN76489AN (rev. A) from SC-3000H computer */ + FB_SEGAVDP = 0x0009, /* SN76489 clone in Sega's VDP chips (315-5124, 315-5246, 315-5313, Game Gear) */ +}; + +enum sr_widths { + SRW_SC3000BBCMICRO = 15, + SRW_SEGAVDP = 16 +}; + +enum volume_modes { + VOL_TRUNC = 0, /* Volume levels 13-15 are identical */ + VOL_FULL = 1, /* Volume levels 13-15 are unique */ +}; + +enum mute_values { + MUTE_ALLOFF = 0, /* All channels muted */ + MUTE_TONE1 = 1, /* Tone 1 mute control */ + MUTE_TONE2 = 2, /* Tone 2 mute control */ + MUTE_TONE3 = 4, /* Tone 3 mute control */ + MUTE_NOISE = 8, /* Noise mute control */ + MUTE_ALLON = 15, /* All channels enabled */ +}; + +typedef struct +{ + int Mute; // per-channel muting + int VolumeArray; + int BoostNoise; // double noise volume when non-zero + + /* Variables */ + float Clock; + float dClock; + int PSGStereo; + int NumClocksForSample; + int WhiteNoiseFeedback; + int SRWidth; + + /* PSG registers: */ + int Registers[8]; /* Tone, vol x4 */ + int LatchedRegister; + int NoiseShiftRegister; + int NoiseFreq; /* Noise channel signal generator frequency */ + + /* Output calculation variables */ + int ToneFreqVals[4]; /* Frequency register values (counters) */ + int ToneFreqPos[4]; /* Frequency channel flip-flops */ + int Channels[4]; /* Value of each channel, before stereo is applied */ + float IntermediatePos[4]; /* intermediate values used at boundaries between + and - (does not need double accuracy)*/ + + int panning[4]; /* fake stereo - 0..127..254 */ + +} SN76489_Context; + +/* Function prototypes */ +void SN76489_Init(int which, int PSGClockValue, int SamplingRate); +void SN76489_Reset(int which); +void SN76489_Shutdown(void); +void SN76489_Config(int which, int mute, int volume, int feedback, int sw_width, int boost_noise); +void SN76489_SetContext(int which, uint8 *data); +void SN76489_GetContext(int which, uint8 *data); +uint8 *SN76489_GetContextPtr(int which); +int SN76489_GetContextSize(void); +void SN76489_Write(int which, int data); +/*void SN76489_GGStereoWrite(int which, int data);*/ +void SN76489_Update(int which, INT16 *buffer, int length); + +/* Non-standard getters and setters */ +int SN76489_GetMute(int which); +void SN76489_SetMute(int which, int val); +int SN76489_GetVolType(int which); +void SN76489_SetVolType(int which, int val); + +void SN76489_SetPanning(int which, int ch0, int ch1, int ch2, int ch3); + +/* and a non-standard data getter */ +/*void SN76489_UpdateOne(int which, int *l, int *r);*/ + +#endif /* _SN76489_H_ */ + diff --git a/source/sound/sn76496.c b/source/sound/sn76496.c new file mode 100644 index 0000000..2dc3a16 --- /dev/null +++ b/source/sound/sn76496.c @@ -0,0 +1,311 @@ + +#include "shared.h" + +#define MAX_OUTPUT 0x7fff +#define STEP 0x10000 +#define FB_WNOISE 0x14002 +#define FB_PNOISE 0x08000 +#define NG_PRESET 0x0F35 + + + +struct SN76496 sn[MAX_76496]; + +void SN76496Write (int chip, int data) +{ + struct SN76496 *R = &sn[chip]; + int n; + + if (data & 0x80) + { + int r = (data & 0x70) >> 4; + int c = r / 2; + + R->LastRegister = r; + R->Register[r] = (R->Register[r] & 0x3f0) | (data & 0x0f); + switch (r) + { + case 0: /* tone 0 : frequency */ + case 2: /* tone 1 : frequency */ + case 4: /* tone 2 : frequency */ + R->Period[c] = R->UpdateStep * R->Register[r]; + if (R->Period[c] == 0) + R->Period[c] = R->UpdateStep; + if (r == 4) + { + /* update noise shift frequency */ + if ((R->Register[6] & 0x03) == 0x03) + R->Period[3] = 2 * R->Period[2]; + } + break; + case 1: /* tone 0 : volume */ + case 3: /* tone 1 : volume */ + case 5: /* tone 2 : volume */ + case 7: /* noise : volume */ + R->Volume[c] = R->VolTable[data & 0x0f]; + break; + case 6: /* noise : frequency, mode */ + { + n = R->Register[6]; + R->NoiseFB = (n & 4) ? FB_WNOISE : FB_PNOISE; + n &= 3; + /* N/512,N/1024,N/2048,Tone #3 output */ + + /* + * Amended from Mame 1.04s + * + * R->Period[3] = (n == 3) ? 2 * R->Period[2] : (R->UpdateStep << (5+n)); + */ + R->Period[3] = + ((n & 3) == + 3) ? 2 * R->Period[2] : (R->UpdateStep << (5 + (n & 3))); + + /* reset noise shifter */ + R->RNG = NG_PRESET; + R->Output[3] = R->RNG & 1; + } + break; + } + } + else + { + int r = R->LastRegister; + int c = r / 2; + + switch (r) + { + case 0: /* tone 0 : frequency */ + case 2: /* tone 1 : frequency */ + case 4: /* tone 2 : frequency */ + R->Register[r] = (R->Register[r] & 0x0f) | ((data & 0x3f) << 4); + R->Period[c] = R->UpdateStep * R->Register[r]; + if (R->Period[c] == 0) + R->Period[c] = R->UpdateStep; + if (r == 4) + { + /* update noise shift frequency */ + if ((R->Register[6] & 0x03) == 0x03) + R->Period[3] = 2 * R->Period[2]; + } + break; + + /* + * Additions from Mame 1.04 + * Start Here + */ + + case 1: /* tone 0 : volume */ + case 3: /* tone 1 : volume */ + case 5: /* tone 2 : volume */ + case 7: /* noise : volume */ + R->Volume[c] = R->VolTable[data & 0x0f]; + R->Register[r] = (R->Register[r] & 0x3f0) | (data & 0x0f); + break; + case 6: /* noise : frequency, mode */ + { + R->Register[r] = (R->Register[r] & 0x3f0) | (data & 0x0f); + n = R->Register[6]; + R->NoiseFB = (n & 4) ? FB_WNOISE : FB_PNOISE; + n &= 3; + /* N/512,N/1024,N/2048,Tone #3 output */ + R->Period[3] = + ((n & 3) == + 3) ? 2 * R->Period[2] : (R->UpdateStep << (5 + (n & 3))); + /* reset noise shifter */ + R->RNG = NG_PRESET; + R->Output[3] = R->RNG & 1; + } + break; + } + } +} + + +void SN76496Update (int chip, signed short int *buffer, int length) +{ + int i; + struct SN76496 *R = &sn[chip]; + + + /* If the volume is 0, increase the counter */ + for (i = 0; i < 4; i++) + { + if (R->Volume[i] == 0) + { + /* note that I do count += length, NOT count = length + 1. You might think */ + /* it's the same since the volume is 0, but doing the latter could cause */ + /* interferencies when the program is rapidly modulating the volume. */ + if (R->Count[i] <= length * STEP) + R->Count[i] += length * STEP; + } + } + + while (length > 0) + { + int vol[4]; + unsigned int out; + int left; + + + /* vol[] keeps track of how long each square wave stays */ + /* in the 1 position during the sample period. */ + vol[0] = vol[1] = vol[2] = vol[3] = 0; + + for (i = 0; i < 3; i++) + { + if (R->Output[i]) + vol[i] += R->Count[i]; + R->Count[i] -= STEP; + /* Period[i] is the half period of the square wave. Here, in each */ + /* loop I add Period[i] twice, so that at the end of the loop the */ + /* square wave is in the same status (0 or 1) it was at the start. */ + /* vol[i] is also incremented by Period[i], since the wave has been 1 */ + /* exactly half of the time, regardless of the initial position. */ + /* If we exit the loop in the middle, Output[i] has to be inverted */ + /* and vol[i] incremented only if the exit status of the square */ + /* wave is 1. */ + while (R->Count[i] <= 0) + { + R->Count[i] += R->Period[i]; + if (R->Count[i] > 0) + { + R->Output[i] ^= 1; + if (R->Output[i]) + vol[i] += R->Period[i]; + break; + } + R->Count[i] += R->Period[i]; + vol[i] += R->Period[i]; + } + if (R->Output[i]) + vol[i] -= R->Count[i]; + } + + left = STEP; + do + { + int nextevent; + + + if (R->Count[3] < left) + nextevent = R->Count[3]; + else + nextevent = left; + + if (R->Output[3]) + vol[3] += R->Count[3]; + R->Count[3] -= nextevent; + if (R->Count[3] <= 0) + { + if (R->RNG & 1) + R->RNG ^= R->NoiseFB; + R->RNG >>= 1; + R->Output[3] = R->RNG & 1; + R->Count[3] += R->Period[3]; + if (R->Output[3]) + vol[3] += R->Period[3]; + } + if (R->Output[3]) + vol[3] -= R->Count[3]; + + left -= nextevent; + } + while (left > 0); + + out = vol[0] * R->Volume[0] + vol[1] * R->Volume[1] + + vol[2] * R->Volume[2] + vol[3] * R->Volume[3]; + + if (out > MAX_OUTPUT * STEP) + out = MAX_OUTPUT * STEP; + + *(buffer++) = out / STEP; + + length--; + } +} + + + +void SN76496_set_clock (int chip, int clock) +{ + struct SN76496 *R = &sn[chip]; + + + /* the base clock for the tone generators is the chip clock divided by 16; */ + /* for the noise generator, it is clock / 256. */ + /* Here we calculate the number of steps which happen during one sample */ + /* at the given sample rate. No. of events = sample rate / (clock/16). */ + /* STEP is a multiplier used to turn the fraction into a fixed point */ + /* number. */ + R->UpdateStep = ((double) STEP * R->SampleRate * 16) / clock; +} + + + +void SN76496_set_gain (int chip, int gain) +{ + struct SN76496 *R = &sn[chip]; + int i; + double out; + + + gain &= 0xff; + + /* increase max output basing on gain (0.2 dB per step) */ + out = MAX_OUTPUT / 3; + while (gain-- > 0) + out *= 1.023292992; /* = (10 ^ (0.2/20)) */ + + /* build volume table (2dB per step) */ + for (i = 0; i < 15; i++) + { + /* limit volume to avoid clipping */ + if (out > MAX_OUTPUT / 3) + R->VolTable[i] = MAX_OUTPUT / 3; + else + R->VolTable[i] = out; + + out /= 1.258925412; /* = 10 ^ (2/20) = 2dB */ + } + R->VolTable[15] = 0; +} + + + +int SN76496_init (int chip, int clock, int volume, int sample_rate) +{ + int i; + struct SN76496 *R = &sn[chip]; + + R->SampleRate = sample_rate; + SN76496_set_clock (chip, clock); + + for (i = 0; i < 4; i++) + R->Volume[i] = 0; + + R->LastRegister = 0; + for (i = 0; i < 8; i += 2) + { + R->Register[i] = 0; + R->Register[i + 1] = 0x0f; /* volume = 0 */ + } + + for (i = 0; i < 4; i++) + { + R->Output[i] = 0; + R->Period[i] = R->Count[i] = R->UpdateStep; + } + R->RNG = NG_PRESET; + R->Output[3] = R->RNG & 1; + + return 0; +} + + + +int SN76496_sh_start (int clock, int volume, int rate) +{ + SN76496_init (0, clock, volume & 0xff, rate); + SN76496_set_gain (0, (volume >> 8) & 0xff); + return 0; +} diff --git a/source/sound/sn76496.h b/source/sound/sn76496.h new file mode 100644 index 0000000..66dde58 --- /dev/null +++ b/source/sound/sn76496.h @@ -0,0 +1,38 @@ +#ifndef SN76496_H +#define SN76496_H + +#define MAX_76496 1 + +struct SN76496interface +{ + int num; + int baseclock[MAX_76496]; + int volume[MAX_76496]; +}; + +struct SN76496 +{ + int SampleRate; + unsigned int UpdateStep; + int VolTable[16]; + int Register[8]; + int LastRegister; + int Volume[4]; + unsigned int RNG; + int NoiseFB; + int Period[4]; + int Count[4]; + int Output[4]; +}; + +extern struct SN76496 sn[MAX_76496]; + +/* Function prototypes */ +void SN76496Write (int chip, int data); +void SN76496Update (int chip, signed short int *buffer, int length); +void SN76496_set_clock (int chip, int clock); +void SN76496_set_gain (int chip, int gain); +int SN76496_init (int chip, int clock, int volume, int sample_rate); +int SN76496_sh_start (int clock, int volume, int rate); + +#endif diff --git a/source/sound/sound.c b/source/sound/sound.c new file mode 100644 index 0000000..b77af89 --- /dev/null +++ b/source/sound/sound.c @@ -0,0 +1,224 @@ +/* + sound.c + YM2612 and SN76489 emulation +*/ + +#include "shared.h" + +/* YM2612 data */ +int fm_timera_tab[0x400]; /* Precalculated timer A values */ +int fm_timerb_tab[0x100]; /* Precalculated timer B values */ +uint8 fm_reg[2][0x100]; /* Register arrays (2x256) */ +uint8 fm_latch[2]; /* Register latches */ +uint8 fm_status; /* Read-only status flags */ +t_timer timer[2]; /* Timers A and B */ +extern void *myFM; + +/* Initialize the YM2612 and SN76489 emulation */ +void sound_init(void) +{ + /* Timers run at half the YM2612 input clock */ + float clock = ((CPU_Clock / 1000000.0) / 7.0) / 2.0; + int i; + + /* Make Timer A table */ + for(i = 0; i < 1024; i += 1) + { + /* Formula is "time(us) = 72 * (1024 - A) / clock" */ + fm_timera_tab[i] = (int)((double)(72 * (1024 - i)) / clock); + } + + /* Make Timer B table */ + for(i = 0; i < 256; i += 1) + { + /* Formula is "time(us) = 1152 * (256 - B) / clock" */ + fm_timerb_tab[i] = (int)((double)(1152 * (256 - i)) / clock); + } +} + +void fm_restore(void) +{ + int i; + + if (FM_GENS) YM2612_Reset(); + else YM2612ResetChip(myFM); + + /* feed all the registers and update internal state */ + for(i = 0; i < 0x100; i++) + { + if (FM_GENS) + { + YM2612_Write(0, i); + YM2612_Write(1, fm_reg[0][i]); + YM2612_Write(2, i); + YM2612_Write(3, fm_reg[1][i]); + } + else + { + YM2612Write(myFM, 0, i); + YM2612Write(myFM, 1, fm_reg[0][i]); + YM2612Write(myFM, 2, i); + YM2612Write(myFM, 3, fm_reg[1][i]); + } + } +} + +void fm_reset(void) +{ + if (FM_GENS) YM2612_Reset(); + else YM2612ResetChip(myFM); + + /* reset timers status */ + timer[0].running = 0; + timer[1].running = 0; + timer[0].enable = 0; + timer[1].enable = 0; + timer[0].count = 0; + timer[1].count = 0; + timer[0].base = 0; + timer[1].base = 0; + timer[0].index = 0; + timer[1].index = 0; + + /* reset FM status */ + fm_status = 0; +} + +void fm_write(int address, int data) +{ + int a0 = (address & 1); + int a1 = (address >> 1) & 1; + + if(a0) + { + /* Register data */ + fm_reg[a1][fm_latch[a1]] = data; + + /* Timer control only in set A */ + if(a1 == 0) + switch(fm_latch[a1]) + { + case 0x24: /* Timer A (LSB) */ + timer[0].index = ((timer[0].index & 0x0003) | (data << 2)) & 0x03FF; + if (timer[0].base != fm_timera_tab[timer[0].index]) + { + timer[0].base = fm_timera_tab[timer[0].index]; + timer[0].count = 0; + } + break; + case 0x25: /* Timer A (MSB) */ + timer[0].index = ((timer[0].index & 0x03FC) | (data & 3)) & 0x03FF; + if (timer[0].base != fm_timera_tab[timer[0].index]) + { + timer[0].base = fm_timera_tab[timer[0].index]; + timer[0].count = 0; + } + break; + case 0x26: /* Timer B */ + timer[1].index = data; + if (timer[1].base != fm_timerb_tab[timer[1].index]) + { + timer[1].base = fm_timerb_tab[timer[1].index]; + timer[1].count = 0; + } + break; + case 0x27: /* Timer Control */ + /* LOAD */ + timer[0].running = (data & 1); + timer[1].running = (data & 2); + /* ENABLE */ + timer[0].enable = (data >> 2) & 1; + timer[1].enable = (data >> 3) & 1; + /* RESET */ + if(data & 0x10) fm_status &= ~1; + if(data & 0x20) fm_status &= ~2; + break; + } + } + else + { + /* Register latch */ + fm_latch[a1] = data; + } + + if(snd.enabled) + { + if(snd.fm.curStage - snd.fm.lastStage > 0) + { + if (FM_GENS) + { + int *tempBuffer[2]; + tempBuffer[0] = snd.fm.gens_buffer[0] + snd.fm.lastStage; + tempBuffer[1] = snd.fm.gens_buffer[1] + snd.fm.lastStage; + YM2612_Update(tempBuffer, snd.fm.curStage - snd.fm.lastStage); + } + else + { + int16 *tempBuffer[2]; + tempBuffer[0] = snd.fm.buffer[0] + snd.fm.lastStage; + tempBuffer[1] = snd.fm.buffer[1] + snd.fm.lastStage; + YM2612UpdateOne(myFM, tempBuffer, snd.fm.curStage - snd.fm.lastStage); + } + snd.fm.lastStage = snd.fm.curStage; + } + + if (FM_GENS) YM2612_Write(address & 3, data); + else YM2612Write(myFM, address & 3, data); + } +} + +int fm_read(int address) +{ + return (fm_status); +} + +void fm_update_timers(int inc) +{ + int i; + + /* Process YM2612 timers */ + for(i = 0; i < 2; i += 1) + { + /* Is the timer running? */ + if(timer[i].running) + { + /* Each scanline takes up roughly 64 microseconds */ + timer[i].count += inc; + + /* Check if the counter overflowed */ + if(timer[i].count >= timer[i].base) + { + /* Reload counter */ + timer[i].count -= timer[i].base; + + /* Set overflow flag (if flag setting is enabled) */ + if(timer[i].enable) fm_status |= (1 << i); + + /* Notice FM core (some CH operation on TimerA) */ + if(i==0) + { + if (FM_GENS) YM2612TimerAOver(); + else YM2612TimerOver(myFM,0); + } + } + } + } +} + +void psg_write(int data) +{ + if(snd.enabled) + { + if(snd.psg.curStage - snd.psg.lastStage > 0) + { + int16 *tempBuffer; + tempBuffer = snd.psg.buffer + snd.psg.lastStage; + if (PSG_MAME) SN76496Update (0, tempBuffer, snd.psg.curStage - snd.psg.lastStage); + else SN76489_Update(0, tempBuffer, snd.psg.curStage - snd.psg.lastStage); + snd.psg.lastStage = snd.psg.curStage; + } + + if (PSG_MAME) SN76496Write(0, data); + else SN76489_Write(0, data); + } +} diff --git a/source/sound/sound.h b/source/sound/sound.h new file mode 100644 index 0000000..7128ecf --- /dev/null +++ b/source/sound/sound.h @@ -0,0 +1,29 @@ + +#ifndef _SOUND_H_ +#define _SOUND_H_ + +typedef struct +{ + int running; + int enable; + int count; + int base; + int index; +} t_timer; + +/* Global variables */ +extern uint8 fm_reg[2][0x100]; +extern uint8 fm_latch[2]; +extern uint8 fm_status; +extern t_timer timer[2]; + +/* Function prototypes */ +void sound_init (void); +void fm_reset (void); +void fm_restore(void); +void fm_write (int address, int data); +int fm_read (int address); +void fm_update_timers (int inc); +void psg_write (int data); + +#endif /* _SOUND_H_ */ diff --git a/source/sound/ym2612.c b/source/sound/ym2612.c new file mode 100644 index 0000000..620bb5a --- /dev/null +++ b/source/sound/ym2612.c @@ -0,0 +1,2365 @@ +/*********************************************************** + * * + * YM2612.C : YM2612 emulator * + * * + * Almost constantes are taken from the MAME core * + * * + * This source is a part of Gens project * + * Written by Stéphane Dallongeville (gens@consolemul.com) * + * Copyright (c) 2002 by Stéphane Dallongeville * + * * + ***********************************************************/ + +#include +#include +#include "shared.h" + +/******************************************** + * Partie définition * + ********************************************/ + +#define YM_DEBUG_LEVEL 0 + +#ifndef PI +#define PI 3.14159265358979323846 +#endif + +#define ATTACK 0 +#define DECAY 1 +#define SUBSTAIN 2 +#define RELEASE 3 + +// SIN_LBITS <= 16 +// LFO_HBITS <= 16 +// (SIN_LBITS + SIN_HBITS) <= 26 +// (ENV_LBITS + ENV_HBITS) <= 28 +// (LFO_LBITS + LFO_HBITS) <= 28 + +#define SIN_HBITS 12 // Sinus phase counter int part +#define SIN_LBITS (26 - SIN_HBITS) // Sinus phase counter float part (best setting) + +#if (SIN_LBITS > 16) +#define SIN_LBITS 16 // Can't be greater than 16 bits +#endif + +#define ENV_HBITS 12 // Env phase counter int part +#define ENV_LBITS (28 - ENV_HBITS) // Env phase counter float part (best setting) + +#define LFO_HBITS 10 // LFO phase counter int part +#define LFO_LBITS (28 - LFO_HBITS) // LFO phase counter float part (best setting) + +#define SIN_LENGHT (1 << SIN_HBITS) +#define ENV_LENGHT (1 << ENV_HBITS) +#define LFO_LENGHT (1 << LFO_HBITS) + +#define TL_LENGHT (ENV_LENGHT * 3) // Env + TL scaling + LFO + +#define SIN_MASK (SIN_LENGHT - 1) +#define ENV_MASK (ENV_LENGHT - 1) +#define LFO_MASK (LFO_LENGHT - 1) + +#define ENV_STEP (96.0 / ENV_LENGHT) // ENV_MAX = 96 dB + +#define ENV_ATTACK ((ENV_LENGHT * 0) << ENV_LBITS) +#define ENV_DECAY ((ENV_LENGHT * 1) << ENV_LBITS) +#define ENV_END ((ENV_LENGHT * 2) << ENV_LBITS) + +#define MAX_OUT_BITS (SIN_HBITS + SIN_LBITS + 2) // Modulation = -4 <--> +4 +#define MAX_OUT ((1 << MAX_OUT_BITS) - 1) + +//Just for tests stuff... +// +//#define COEF_MOD 0.5 +//#define MAX_OUT ((int) (((1 << MAX_OUT_BITS) - 1) * COEF_MOD)) + +#define OUT_BITS (OUTPUT_BITS - 2) +#define OUT_SHIFT (MAX_OUT_BITS - OUT_BITS) +#define LIMIT_CH_OUT ((int) (((1 << OUT_BITS) * 1.5) - 1)) + +#define PG_CUT_OFF ((int) (78.0 / ENV_STEP)) +#define ENV_CUT_OFF ((int) (68.0 / ENV_STEP)) + +#define AR_RATE 399128 +#define DR_RATE 5514396 + +//#define AR_RATE 426136 +//#define DR_RATE (AR_RATE * 12) + +#define LFO_FMS_LBITS 9 // FIXED (LFO_FMS_BASE gives somethink as 1) +#define LFO_FMS_BASE ((int) (0.05946309436 * 0.0338 * (double) (1 << LFO_FMS_LBITS))) + +#define S0 0 // Stupid typo of the YM2612 +#define S1 2 +#define S2 1 +#define S3 3 + + +/******************************************** + * Partie variables * + ********************************************/ + + +struct ym2612__ YM2612; + +int *SIN_TAB[SIN_LENGHT]; // SINUS TABLE (pointer on TL TABLE) +int TL_TAB[TL_LENGHT * 2]; // TOTAL LEVEL TABLE (positif and minus) +unsigned int ENV_TAB[2 * ENV_LENGHT + 8]; // ENV CURVE TABLE (attack & decay) + +//unsigned int ATTACK_TO_DECAY[ENV_LENGHT]; // Conversion from attack to decay phase +unsigned int DECAY_TO_ATTACK[ENV_LENGHT]; // Conversion from decay to attack phase + +unsigned int FINC_TAB[2048]; // Frequency step table + +unsigned int AR_TAB[128]; // Attack rate table +unsigned int DR_TAB[96]; // Decay rate table +unsigned int DT_TAB[8][32]; // Detune table +unsigned int SL_TAB[16]; // Substain level table +unsigned int NULL_RATE[32]; // Table for NULL rate + +int LFO_ENV_TAB[LFO_LENGHT]; // LFO AMS TABLE (adjusted for 11.8 dB) +int LFO_FREQ_TAB[LFO_LENGHT]; // LFO FMS TABLE +int LFO_ENV_UP[MAX_UPDATE_LENGHT]; // Temporary calculated LFO AMS (adjusted for 11.8 dB) +int LFO_FREQ_UP[MAX_UPDATE_LENGHT]; // Temporary calculated LFO FMS + +int INTER_TAB[MAX_UPDATE_LENGHT]; // Interpolation table + +int LFO_INC_TAB[8]; // LFO step table + +int in0, in1, in2, in3; // current phase calculation +int en0, en1, en2, en3; // current enveloppe calculation + +const void (*UPDATE_CHAN[8 * 8])(channel_ *CH, int **buf, int lenght) = // Update Channel functions pointer table +{ + (void *)Update_Chan_Algo0, + (void *)Update_Chan_Algo1, + (void *)Update_Chan_Algo2, + (void *)Update_Chan_Algo3, + (void *)Update_Chan_Algo4, + (void *)Update_Chan_Algo5, + (void *)Update_Chan_Algo6, + (void *)Update_Chan_Algo7, + (void *)Update_Chan_Algo0_LFO, + (void *)Update_Chan_Algo1_LFO, + (void *)Update_Chan_Algo2_LFO, + (void *)Update_Chan_Algo3_LFO, + (void *)Update_Chan_Algo4_LFO, + (void *)Update_Chan_Algo5_LFO, + (void *)Update_Chan_Algo6_LFO, + (void *)Update_Chan_Algo7_LFO, + (void *)Update_Chan_Algo0_Int, + (void *)Update_Chan_Algo1_Int, + (void *)Update_Chan_Algo2_Int, + (void *)Update_Chan_Algo3_Int, + (void *)Update_Chan_Algo4_Int, + (void *)Update_Chan_Algo5_Int, + (void *)Update_Chan_Algo6_Int, + (void *)Update_Chan_Algo7_Int, + (void *)Update_Chan_Algo0_LFO_Int, + (void *)Update_Chan_Algo1_LFO_Int, + (void *)Update_Chan_Algo2_LFO_Int, + (void *)Update_Chan_Algo3_LFO_Int, + (void *)Update_Chan_Algo4_LFO_Int, + (void *)Update_Chan_Algo5_LFO_Int, + (void *)Update_Chan_Algo6_LFO_Int, + (void *)Update_Chan_Algo7_LFO_Int +}; + +const void (*ENV_NEXT_EVENT[8])(slot_ *SL) = // Next Enveloppe phase functions pointer table +{ + (void *)Env_Attack_Next, + (void *)Env_Decay_Next, + (void *)Env_Substain_Next, + (void *)Env_Release_Next, + (void *)Env_NULL_Next, + (void *)Env_NULL_Next, + (void *)Env_NULL_Next, + (void *)Env_NULL_Next +}; + +const unsigned int DT_DEF_TAB[4 * 32] = +{ +// FD = 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + +// FD = 1 + 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, + 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 8, 8, 8, 8, + +// FD = 2 + 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, + 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 16, 16, 16, 16, + +// FD = 3 + 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, + 8 , 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 20, 22, 22, 22, 22 +}; + +const unsigned int FKEY_TAB[16] = +{ + 0, 0, 0, 0, + 0, 0, 0, 1, + 2, 3, 3, 3, + 3, 3, 3, 3 +}; + +const unsigned int LFO_AMS_TAB[4] = +{ + 31, 4, 1, 0 +}; + +const unsigned int LFO_FMS_TAB[8] = +{ + LFO_FMS_BASE * 0, LFO_FMS_BASE * 1, + LFO_FMS_BASE * 2, LFO_FMS_BASE * 3, + LFO_FMS_BASE * 4, LFO_FMS_BASE * 6, + LFO_FMS_BASE * 12, LFO_FMS_BASE * 24 +}; + +int int_cnt; // Interpolation calculation + + +#if YM_DEBUG_LEVEL > 0 // Debug +FILE *debug_file = NULL; +#endif + + +/*********************************************** + * fonctions calcul param * + ***********************************************/ + + +INLINE void CALC_FINC_SL(slot_ *SL, int finc, int kc) +{ + int ksr; + + SL->Finc = (finc + SL->DT[kc]) * SL->MUL; + + ksr = kc >> SL->KSR_S; // keycode atténuation + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "FINC = %d SL->Finc = %d\n", finc, SL->Finc); +#endif + + if (SL->KSR != ksr) // si le KSR a changé alors + { // les différents taux pour l'enveloppe sont mis à jour + SL->KSR = ksr; + + SL->EincA = SL->AR[ksr]; + SL->EincD = SL->DR[ksr]; + SL->EincS = SL->SR[ksr]; + SL->EincR = SL->RR[ksr]; + + if (SL->Ecurp == ATTACK) SL->Einc = SL->EincA; + else if (SL->Ecurp == DECAY) SL->Einc = SL->EincD; + else if (SL->Ecnt < ENV_END) + { + if (SL->Ecurp == SUBSTAIN) SL->Einc = SL->EincS; + else if (SL->Ecurp == RELEASE) SL->Einc = SL->EincR; + } + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "KSR = %.4X EincA = %.8X EincD = %.8X EincS = %.8X EincR = %.8X\n", ksr, SL->EincA, SL->EincD, SL->EincS, SL->EincR); +#endif + } +} + + +INLINE void CALC_FINC_CH(channel_ *CH) +{ + int finc, kc; + + finc = FINC_TAB[CH->FNUM[0]] >> (7 - CH->FOCT[0]); + kc = CH->KC[0]; + + CALC_FINC_SL(&CH->SLOT[0], finc, kc); + CALC_FINC_SL(&CH->SLOT[1], finc, kc); + CALC_FINC_SL(&CH->SLOT[2], finc, kc); + CALC_FINC_SL(&CH->SLOT[3], finc, kc); +} + + + +/*********************************************** + * fonctions setting * + ***********************************************/ + + +INLINE void KEY_ON(channel_ *CH, int nsl) +{ + slot_ *SL = &(CH->SLOT[nsl]); // on recupère le bon pointeur de slot + + if (SL->Ecurp == RELEASE) // la touche est-elle relâchée ? + { + SL->Fcnt = 0; + + // Fix Ecco 2 splash sound + + SL->Ecnt = (DECAY_TO_ATTACK[ENV_TAB[SL->Ecnt >> ENV_LBITS]] + ENV_ATTACK) & SL->ChgEnM; + SL->ChgEnM = 0xFFFFFFFF; + +// SL->Ecnt = DECAY_TO_ATTACK[ENV_TAB[SL->Ecnt >> ENV_LBITS]] + ENV_ATTACK; +// SL->Ecnt = 0; + + SL->Einc = SL->EincA; + SL->Ecmp = ENV_DECAY; + SL->Ecurp = ATTACK; + } +} + + +INLINE void KEY_OFF(channel_ *CH, int nsl) +{ + slot_ *SL = &(CH->SLOT[nsl]); // on recupère le bon pointeur de slot + + if (SL->Ecurp != RELEASE) // la touche est-elle appuyée ? + { + if (SL->Ecnt < ENV_DECAY) // attack phase ? + { + SL->Ecnt = (ENV_TAB[SL->Ecnt >> ENV_LBITS] << ENV_LBITS) + ENV_DECAY; + } + + SL->Einc = SL->EincR; + SL->Ecmp = ENV_END; + SL->Ecurp = RELEASE; + } +} + + +INLINE void CSM_Key_Control() +{ + KEY_ON(&YM2612.CHANNEL[2], 0); + KEY_ON(&YM2612.CHANNEL[2], 1); + KEY_ON(&YM2612.CHANNEL[2], 2); + KEY_ON(&YM2612.CHANNEL[2], 3); +} + + +int SLOT_SET(int Adr, unsigned char data) +{ + channel_ *CH; + slot_ *SL; + int nch, nsl; + + if ((nch = Adr & 3) == 3) return 1; + nsl = (Adr >> 2) & 3; + + if (Adr & 0x100) nch += 3; + + CH = &(YM2612.CHANNEL[nch]); + SL = &(CH->SLOT[nsl]); + + switch(Adr & 0xF0) + { + case 0x30: + if ((SL->MUL = (data & 0x0F))) SL->MUL <<= 1; + else SL->MUL = 1; + + SL->DT = DT_TAB[(data >> 4) & 7]; + + CH->SLOT[0].Finc = -1; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "CHANNEL[%d], SLOT[%d] DTMUL = %.2X\n", nch, nsl, data & 0x7F); +#endif + break; + + case 0x40: + SL->TL = data & 0x7F; + + // SOR2 do a lot of TL adjustement and this fix R.Shinobi jump sound... + YM2612_Special_Update(); + +#if ((ENV_HBITS - 7) < 0) + SL->TLL = SL->TL >> (7 - ENV_HBITS); +#else + SL->TLL = SL->TL << (ENV_HBITS - 7); +#endif + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "CHANNEL[%d], SLOT[%d] TL = %.2X\n", nch, nsl, SL->TL); +#endif + break; + + case 0x50: + SL->KSR_S = 3 - (data >> 6); + + CH->SLOT[0].Finc = -1; + + if (data &= 0x1F) SL->AR = &AR_TAB[data << 1]; + else SL->AR = &NULL_RATE[0]; + + SL->EincA = SL->AR[SL->KSR]; + if (SL->Ecurp == ATTACK) SL->Einc = SL->EincA; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "CHANNEL[%d], SLOT[%d] AR = %.2X EincA = %.6X\n", nch, nsl, data, SL->EincA); +#endif + break; + + case 0x60: + if ((SL->AMSon = (data & 0x80))) SL->AMS = CH->AMS; + else SL->AMS = 31; + + if (data &= 0x1F) SL->DR = &DR_TAB[data << 1]; + else SL->DR = &NULL_RATE[0]; + + SL->EincD = SL->DR[SL->KSR]; + if (SL->Ecurp == DECAY) SL->Einc = SL->EincD; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "CHANNEL[%d], SLOT[%d] AMS = %d DR = %.2X EincD = %.6X\n", nch, nsl, SL->AMSon, data, SL->EincD); +#endif + break; + + case 0x70: + if (data &= 0x1F) SL->SR = &DR_TAB[data << 1]; + else SL->SR = &NULL_RATE[0]; + + SL->EincS = SL->SR[SL->KSR]; + if ((SL->Ecurp == SUBSTAIN) && (SL->Ecnt < ENV_END)) SL->Einc = SL->EincS; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "CHANNEL[%d], SLOT[%d] SR = %.2X EincS = %.6X\n", nch, nsl, data, SL->EincS); +#endif + break; + + case 0x80: + SL->SLL = SL_TAB[data >> 4]; + + SL->RR = &DR_TAB[((data & 0xF) << 2) + 2]; + + SL->EincR = SL->RR[SL->KSR]; + if ((SL->Ecurp == RELEASE) && (SL->Ecnt < ENV_END)) SL->Einc = SL->EincR; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "CHANNEL[%d], SLOT[%d] SL = %.8X\n", nch, nsl, SL->SLL); + fprintf(debug_file, "CHANNEL[%d], SLOT[%d] RR = %.2X EincR = %.2X\n", nch, nsl, ((data & 0xF) << 1) | 2, SL->EincR); +#endif + break; + + case 0x90: +/* // SSG-EG envelope shapes : + // + // E At Al H + // + // 1 0 0 0 \\\\ + // + // 1 0 0 1 \___ + // + // 1 0 1 0 \/\/ + // ___ + // 1 0 1 1 \ + // + // 1 1 0 0 //// + // ___ + // 1 1 0 1 / + // + // 1 1 1 0 /\/\ + // + // 1 1 1 1 /___ + // + // E = SSG-EG enable + // At = Start negate + // Al = Altern + // H = Hold +*/ + if (data & 0x08) SL->SEG = data & 0x0F; + else SL->SEG = 0; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "CHANNEL[%d], SLOT[%d] SSG-EG = %.2X\n", nch, nsl, data); +#endif + break; + } + + return 0; +} + + +int CHANNEL_SET(int Adr, unsigned char data) +{ + channel_ *CH; + int num; + + if ((num = Adr & 3) == 3) return 1; + + switch(Adr & 0xFC) + { + case 0xA0: + if (Adr & 0x100) num += 3; + CH = &(YM2612.CHANNEL[num]); + + YM2612_Special_Update(); + + CH->FNUM[0] = (CH->FNUM[0] & 0x700) + data; + CH->KC[0] = (CH->FOCT[0] << 2) | FKEY_TAB[CH->FNUM[0] >> 7]; + + CH->SLOT[0].Finc = -1; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "CHANNEL[%d] part1 FNUM = %d KC = %d\n", num, CH->FNUM[0], CH->KC[0]); +#endif + break; + + case 0xA4: + if (Adr & 0x100) num += 3; + CH = &(YM2612.CHANNEL[num]); + + YM2612_Special_Update(); + + CH->FNUM[0] = (CH->FNUM[0] & 0x0FF) + ((int) (data & 0x07) << 8); + CH->FOCT[0] = (data & 0x38) >> 3; + CH->KC[0] = (CH->FOCT[0] << 2) | FKEY_TAB[CH->FNUM[0] >> 7]; + + CH->SLOT[0].Finc = -1; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "CHANNEL[%d] part2 FNUM = %d FOCT = %d KC = %d\n", num, CH->FNUM[0], CH->FOCT[0], CH->KC[0]); +#endif + break; + + case 0xA8: + if (Adr < 0x100) + { + num++; + + YM2612_Special_Update(); + + YM2612.CHANNEL[2].FNUM[num] = (YM2612.CHANNEL[2].FNUM[num] & 0x700) + data; + YM2612.CHANNEL[2].KC[num] = (YM2612.CHANNEL[2].FOCT[num] << 2) | FKEY_TAB[YM2612.CHANNEL[2].FNUM[num] >> 7]; + + YM2612.CHANNEL[2].SLOT[0].Finc = -1; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "CHANNEL[2] part1 FNUM[%d] = %d KC[%d] = %d\n", num, YM2612.CHANNEL[2].FNUM[num], num, YM2612.CHANNEL[2].KC[num]); +#endif + } + break; + + case 0xAC: + if (Adr < 0x100) + { + num++; + + YM2612_Special_Update(); + + YM2612.CHANNEL[2].FNUM[num] = (YM2612.CHANNEL[2].FNUM[num] & 0x0FF) + ((int) (data & 0x07) << 8); + YM2612.CHANNEL[2].FOCT[num] = (data & 0x38) >> 3; + YM2612.CHANNEL[2].KC[num] = (YM2612.CHANNEL[2].FOCT[num] << 2) | FKEY_TAB[YM2612.CHANNEL[2].FNUM[num] >> 7]; + + YM2612.CHANNEL[2].SLOT[0].Finc = -1; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "CHANNEL[2] part2 FNUM[%d] = %d FOCT[%d] = %d KC[%d] = %d\n", num, YM2612.CHANNEL[2].FNUM[num], num, YM2612.CHANNEL[2].FOCT[num], num, YM2612.CHANNEL[2].KC[num]); +#endif + } + break; + + case 0xB0: + if (Adr & 0x100) num += 3; + CH = &(YM2612.CHANNEL[num]); + + if (CH->ALGO != (data & 7)) + { + // Fix VectorMan 2 heli sound (level 1) + YM2612_Special_Update(); + + CH->ALGO = data & 7; + + CH->SLOT[0].ChgEnM = 0; + CH->SLOT[1].ChgEnM = 0; + CH->SLOT[2].ChgEnM = 0; + CH->SLOT[3].ChgEnM = 0; + } + + CH->FB = 9 - ((data >> 3) & 7); // Real thing ? + +// if (CH->FB = ((data >> 3) & 7)) CH->FB = 9 - CH->FB; // Thunder force 4 (music stage 8), Gynoug, Aladdin bug sound... +// else CH->FB = 31; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "CHANNEL[%d] ALGO = %d FB = %d\n", num, CH->ALGO, CH->FB); +#endif + break; + + case 0xB4: + if (Adr & 0x100) num += 3; + CH = &(YM2612.CHANNEL[num]); + + YM2612_Special_Update(); + + if (data & 0x80) CH->LEFT = 0xFFFFFFFF; + else CH->LEFT = 0; + + if (data & 0x40) CH->RIGHT = 0xFFFFFFFF; + else CH->RIGHT = 0; + + CH->AMS = LFO_AMS_TAB[(data >> 4) & 3]; + CH->FMS = LFO_FMS_TAB[data & 7]; + + if (CH->SLOT[0].AMSon) CH->SLOT[0].AMS = CH->AMS; + else CH->SLOT[0].AMS = 31; + if (CH->SLOT[1].AMSon) CH->SLOT[1].AMS = CH->AMS; + else CH->SLOT[1].AMS = 31; + if (CH->SLOT[2].AMSon) CH->SLOT[2].AMS = CH->AMS; + else CH->SLOT[2].AMS = 31; + if (CH->SLOT[3].AMSon) CH->SLOT[3].AMS = CH->AMS; + else CH->SLOT[3].AMS = 31; + +#if YM_DEBUG_LEVEL > 0 + fprintf(debug_file, "CHANNEL[%d] AMS = %d FMS = %d\n", num, CH->AMS, CH->FMS); +#endif + break; + } + + return 0; +} + + +int YM_SET(int Adr, unsigned char data) +{ + channel_ *CH; + int nch; + + switch(Adr) + { + case 0x22: + if (data & 8) + { + // Cool Spot music 1, LFO modified severals time which + // distord the sound, have to check that on a real genesis... + + YM2612.LFOinc = LFO_INC_TAB[data & 7]; + +#if YM_DEBUG_LEVEL > 0 + fprintf(debug_file, "\nLFO Enable, LFOinc = %.8X %d\n", YM2612.LFOinc, data & 7); +#endif + } + else + { + YM2612.LFOinc = YM2612.LFOcnt = 0; + +#if YM_DEBUG_LEVEL > 0 + fprintf(debug_file, "\nLFO Disable\n"); +#endif + } + break; + + case 0x24: + YM2612.TimerA = (YM2612.TimerA & 0x003) | (((int) data) << 2); + + if (YM2612.TimerAL != (1024 - YM2612.TimerA) << 12) + { + YM2612.TimerAcnt = YM2612.TimerAL = (1024 - YM2612.TimerA) << 12; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "Timer A Set = %.8X\n", YM2612.TimerAcnt); +#endif + } + break; + + case 0x25: + YM2612.TimerA = (YM2612.TimerA & 0x3fc) | (data & 3); + + if (YM2612.TimerAL != (1024 - YM2612.TimerA) << 12) + { + YM2612.TimerAcnt = YM2612.TimerAL = (1024 - YM2612.TimerA) << 12; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "Timer A Set = %.8X\n", YM2612.TimerAcnt); +#endif + } + break; + + case 0x26: + YM2612.TimerB = data; + + if (YM2612.TimerBL != (256 - YM2612.TimerB) << (4 + 12)) + { + YM2612.TimerBcnt = YM2612.TimerBL = (256 - YM2612.TimerB) << (4 + 12); + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "Timer B Set = %.8X\n", YM2612.TimerBcnt); +#endif + } + break; + + case 0x27: + // Paramètre divers + // b7 = CSM MODE + // b6 = 3 slot mode + // b5 = reset b + // b4 = reset a + // b3 = timer enable b + // b2 = timer enable a + // b1 = load b + // b0 = load a + + if ((data ^ YM2612.Mode) & 0x40) + { + // We changed the channel 2 mode, so recalculate phase step + // This fix the punch sound in Street of Rage 2 + + YM2612_Special_Update(); + + YM2612.CHANNEL[2].SLOT[0].Finc = -1; // recalculate phase step + } + +// if ((data & 2) && (YM2612.Status & 2)) YM2612.TimerBcnt = YM2612.TimerBL; +// if ((data & 1) && (YM2612.Status & 1)) YM2612.TimerAcnt = YM2612.TimerAL; + +// YM2612.Status &= (~data >> 4); // Reset du Status au cas ou c'est demandé + YM2612.Status &= (~data >> 4) & (data >> 2); // Reset Status + + YM2612.Mode = data; + +#if YM_DEBUG_LEVEL > 0 + fprintf(debug_file, "Mode reg = %.2X\n", data); +#endif + break; + + case 0x28: + if ((nch = data & 3) == 3) return 1; + + if (data & 4) nch += 3; + CH = &(YM2612.CHANNEL[nch]); + + YM2612_Special_Update(); + + if (data & 0x10) KEY_ON(CH, S0); // On appuie sur la touche pour le slot 1 + else KEY_OFF(CH, S0); // On relâche la touche pour le slot 1 + if (data & 0x20) KEY_ON(CH, S1); // On appuie sur la touche pour le slot 3 + else KEY_OFF(CH, S1); // On relâche la touche pour le slot 3 + if (data & 0x40) KEY_ON(CH, S2); // On appuie sur la touche pour le slot 2 + else KEY_OFF(CH, S2); // On relâche la touche pour le slot 2 + if (data & 0x80) KEY_ON(CH, S3); // On appuie sur la touche pour le slot 4 + else KEY_OFF(CH, S3); // On relâche la touche pour le slot 4 + +#if YM_DEBUG_LEVEL > 0 + fprintf(debug_file, "CHANNEL[%d] KEY %.1X\n", nch, ((data & 0xf0) >> 4)); +#endif + break; + + case 0x2A: + YM2612.DACdata = ((int) data - 0x80) << 7; // donnée du DAC + break; + + case 0x2B: + if (YM2612.DAC ^ (data & 0x80)) YM2612_Special_Update(); + + YM2612.DAC = data & 0x80; // activation/désactivation du DAC + break; + } + + return 0; +} + + + +/*********************************************** + * fonctions de génération * + ***********************************************/ + + +void Env_NULL_Next(slot_ *SL) +{ +} + + +void Env_Attack_Next(slot_ *SL) +{ + // Verified with Gynoug even in HQ (explode SFX) + SL->Ecnt = ENV_DECAY; + + SL->Einc = SL->EincD; + SL->Ecmp = SL->SLL; + SL->Ecurp = DECAY; +} + + +void Env_Decay_Next(slot_ *SL) +{ + // Verified with Gynoug even in HQ (explode SFX) + SL->Ecnt = SL->SLL; + + SL->Einc = SL->EincS; + SL->Ecmp = ENV_END; + SL->Ecurp = SUBSTAIN; +} + + +void Env_Substain_Next(slot_ *SL) +{ + if (SL->SEG & 8) // SSG envelope type + { + if (SL->SEG & 1) + { + SL->Ecnt = ENV_END; + SL->Einc = 0; + SL->Ecmp = ENV_END + 1; + } + else + { + // re KEY ON + + // SL->Fcnt = 0; + // SL->ChgEnM = 0xFFFFFFFF; + + SL->Ecnt = 0; + SL->Einc = SL->EincA; + SL->Ecmp = ENV_DECAY; + SL->Ecurp = ATTACK; + } + + SL->SEG ^= (SL->SEG & 2) << 1; + } + else + { + SL->Ecnt = ENV_END; + SL->Einc = 0; + SL->Ecmp = ENV_END + 1; + } +} + + +void Env_Release_Next(slot_ *SL) +{ + SL->Ecnt = ENV_END; + SL->Einc = 0; + SL->Ecmp = ENV_END + 1; +} + + +#define GET_CURRENT_PHASE \ +in0 = CH->SLOT[S0].Fcnt; \ +in1 = CH->SLOT[S1].Fcnt; \ +in2 = CH->SLOT[S2].Fcnt; \ +in3 = CH->SLOT[S3].Fcnt; + + +#define UPDATE_PHASE \ +CH->SLOT[S0].Fcnt += CH->SLOT[S0].Finc; \ +CH->SLOT[S1].Fcnt += CH->SLOT[S1].Finc; \ +CH->SLOT[S2].Fcnt += CH->SLOT[S2].Finc; \ +CH->SLOT[S3].Fcnt += CH->SLOT[S3].Finc; + + +#define UPDATE_PHASE_LFO \ +if ((freq_LFO = (CH->FMS * LFO_FREQ_UP[i]) >> (LFO_HBITS - 1))) \ +{ \ + CH->SLOT[S0].Fcnt += CH->SLOT[S0].Finc + ((CH->SLOT[S0].Finc * freq_LFO) >> LFO_FMS_LBITS); \ + CH->SLOT[S1].Fcnt += CH->SLOT[S1].Finc + ((CH->SLOT[S1].Finc * freq_LFO) >> LFO_FMS_LBITS); \ + CH->SLOT[S2].Fcnt += CH->SLOT[S2].Finc + ((CH->SLOT[S2].Finc * freq_LFO) >> LFO_FMS_LBITS); \ + CH->SLOT[S3].Fcnt += CH->SLOT[S3].Finc + ((CH->SLOT[S3].Finc * freq_LFO) >> LFO_FMS_LBITS); \ +} \ +else \ +{ \ + CH->SLOT[S0].Fcnt += CH->SLOT[S0].Finc; \ + CH->SLOT[S1].Fcnt += CH->SLOT[S1].Finc; \ + CH->SLOT[S2].Fcnt += CH->SLOT[S2].Finc; \ + CH->SLOT[S3].Fcnt += CH->SLOT[S3].Finc; \ +} + + +#define GET_CURRENT_ENV \ +if (CH->SLOT[S0].SEG & 4) \ +{ \ + if ((en0 = ENV_TAB[(CH->SLOT[S0].Ecnt >> ENV_LBITS)] + CH->SLOT[S0].TLL) > ENV_MASK) en0 = 0; \ + else en0 ^= ENV_MASK; \ +} \ +else en0 = ENV_TAB[(CH->SLOT[S0].Ecnt >> ENV_LBITS)] + CH->SLOT[S0].TLL; \ +if (CH->SLOT[S1].SEG & 4) \ +{ \ + if ((en1 = ENV_TAB[(CH->SLOT[S1].Ecnt >> ENV_LBITS)] + CH->SLOT[S1].TLL) > ENV_MASK) en1 = 0; \ + else en1 ^= ENV_MASK; \ +} \ +else en1 = ENV_TAB[(CH->SLOT[S1].Ecnt >> ENV_LBITS)] + CH->SLOT[S1].TLL; \ +if (CH->SLOT[S2].SEG & 4) \ +{ \ + if ((en2 = ENV_TAB[(CH->SLOT[S2].Ecnt >> ENV_LBITS)] + CH->SLOT[S2].TLL) > ENV_MASK) en2 = 0; \ + else en2 ^= ENV_MASK; \ +} \ +else en2 = ENV_TAB[(CH->SLOT[S2].Ecnt >> ENV_LBITS)] + CH->SLOT[S2].TLL; \ +if (CH->SLOT[S3].SEG & 4) \ +{ \ + if ((en3 = ENV_TAB[(CH->SLOT[S3].Ecnt >> ENV_LBITS)] + CH->SLOT[S3].TLL) > ENV_MASK) en3 = 0; \ + else en3 ^= ENV_MASK; \ +} \ +else en3 = ENV_TAB[(CH->SLOT[S3].Ecnt >> ENV_LBITS)] + CH->SLOT[S3].TLL; + + +#define GET_CURRENT_ENV_LFO \ +env_LFO = LFO_ENV_UP[i]; \ + \ +if (CH->SLOT[S0].SEG & 4) \ +{ \ + if ((en0 = ENV_TAB[(CH->SLOT[S0].Ecnt >> ENV_LBITS)] + CH->SLOT[S0].TLL) > ENV_MASK) en0 = 0; \ + else en0 = (en0 ^ ENV_MASK) + (env_LFO >> CH->SLOT[S0].AMS); \ +} \ +else en0 = ENV_TAB[(CH->SLOT[S0].Ecnt >> ENV_LBITS)] + CH->SLOT[S0].TLL + (env_LFO >> CH->SLOT[S0].AMS); \ +if (CH->SLOT[S1].SEG & 4) \ +{ \ + if ((en1 = ENV_TAB[(CH->SLOT[S1].Ecnt >> ENV_LBITS)] + CH->SLOT[S1].TLL) > ENV_MASK) en1 = 0; \ + else en1 = (en1 ^ ENV_MASK) + (env_LFO >> CH->SLOT[S1].AMS); \ +} \ +else en1 = ENV_TAB[(CH->SLOT[S1].Ecnt >> ENV_LBITS)] + CH->SLOT[S1].TLL + (env_LFO >> CH->SLOT[S1].AMS); \ +if (CH->SLOT[S2].SEG & 4) \ +{ \ + if ((en2 = ENV_TAB[(CH->SLOT[S2].Ecnt >> ENV_LBITS)] + CH->SLOT[S2].TLL) > ENV_MASK) en2 = 0; \ + else en2 = (en2 ^ ENV_MASK) + (env_LFO >> CH->SLOT[S2].AMS); \ +} \ +else en2 = ENV_TAB[(CH->SLOT[S2].Ecnt >> ENV_LBITS)] + CH->SLOT[S2].TLL + (env_LFO >> CH->SLOT[S2].AMS); \ +if (CH->SLOT[S3].SEG & 4) \ +{ \ + if ((en3 = ENV_TAB[(CH->SLOT[S3].Ecnt >> ENV_LBITS)] + CH->SLOT[S3].TLL) > ENV_MASK) en3 = 0; \ + else en3 = (en3 ^ ENV_MASK) + (env_LFO >> CH->SLOT[S3].AMS); \ +} \ +else en3 = ENV_TAB[(CH->SLOT[S3].Ecnt >> ENV_LBITS)] + CH->SLOT[S3].TLL + (env_LFO >> CH->SLOT[S3].AMS); + + +#define UPDATE_ENV \ +if ((CH->SLOT[S0].Ecnt += CH->SLOT[S0].Einc) >= CH->SLOT[S0].Ecmp) \ + ENV_NEXT_EVENT[CH->SLOT[S0].Ecurp](&(CH->SLOT[S0])); \ +if ((CH->SLOT[S1].Ecnt += CH->SLOT[S1].Einc) >= CH->SLOT[S1].Ecmp) \ + ENV_NEXT_EVENT[CH->SLOT[S1].Ecurp](&(CH->SLOT[S1])); \ +if ((CH->SLOT[S2].Ecnt += CH->SLOT[S2].Einc) >= CH->SLOT[S2].Ecmp) \ + ENV_NEXT_EVENT[CH->SLOT[S2].Ecurp](&(CH->SLOT[S2])); \ +if ((CH->SLOT[S3].Ecnt += CH->SLOT[S3].Einc) >= CH->SLOT[S3].Ecmp) \ + ENV_NEXT_EVENT[CH->SLOT[S3].Ecurp](&(CH->SLOT[S3])); + + +#define DO_LIMIT \ +if (CH->OUTd > LIMIT_CH_OUT) CH->OUTd = LIMIT_CH_OUT; \ +else if (CH->OUTd < -LIMIT_CH_OUT) CH->OUTd = -LIMIT_CH_OUT; + + +#define DO_FEEDBACK0 \ +in0 += CH->S0_OUT[0] >> CH->FB; \ +CH->S0_OUT[0] = SIN_TAB[(in0 >> SIN_LBITS) & SIN_MASK][en0]; + + +#define DO_FEEDBACK \ +in0 += (CH->S0_OUT[0] + CH->S0_OUT[1]) >> CH->FB; \ +CH->S0_OUT[1] = CH->S0_OUT[0]; \ +CH->S0_OUT[0] = SIN_TAB[(in0 >> SIN_LBITS) & SIN_MASK][en0]; + + +#define DO_FEEDBACK2 \ +in0 += (CH->S0_OUT[0] + (CH->S0_OUT[0] >> 2) + CH->S0_OUT[1]) >> CH->FB; \ +CH->S0_OUT[1] = CH->S0_OUT[0] >> 2; \ +CH->S0_OUT[0] = SIN_TAB[(in0 >> SIN_LBITS) & SIN_MASK][en0]; + + +#define DO_FEEDBACK3 \ +in0 += (CH->S0_OUT[0] + CH->S0_OUT[1] + CH->S0_OUT[2] + CH->S0_OUT[3]) >> CH->FB; \ +CH->S0_OUT[3] = CH->S0_OUT[2] >> 1; \ +CH->S0_OUT[2] = CH->S0_OUT[1] >> 1; \ +CH->S0_OUT[1] = CH->S0_OUT[0] >> 1; \ +CH->S0_OUT[0] = SIN_TAB[(in0 >> SIN_LBITS) & SIN_MASK][en0]; + + +#define DO_ALGO_0 \ +DO_FEEDBACK \ +in1 += CH->S0_OUT[1]; \ +in2 += SIN_TAB[(in1 >> SIN_LBITS) & SIN_MASK][en1]; \ +in3 += SIN_TAB[(in2 >> SIN_LBITS) & SIN_MASK][en2]; \ +CH->OUTd = (SIN_TAB[(in3 >> SIN_LBITS) & SIN_MASK][en3]) >> OUT_SHIFT; + +#define DO_ALGO_1 \ +DO_FEEDBACK \ +in2 += CH->S0_OUT[1] + SIN_TAB[(in1 >> SIN_LBITS) & SIN_MASK][en1]; \ +in3 += SIN_TAB[(in2 >> SIN_LBITS) & SIN_MASK][en2]; \ +CH->OUTd = (SIN_TAB[(in3 >> SIN_LBITS) & SIN_MASK][en3]) >> OUT_SHIFT; + +#define DO_ALGO_2 \ +DO_FEEDBACK \ +in2 += SIN_TAB[(in1 >> SIN_LBITS) & SIN_MASK][en1]; \ +in3 += CH->S0_OUT[1] + SIN_TAB[(in2 >> SIN_LBITS) & SIN_MASK][en2]; \ +CH->OUTd = (SIN_TAB[(in3 >> SIN_LBITS) & SIN_MASK][en3]) >> OUT_SHIFT; + +#define DO_ALGO_3 \ +DO_FEEDBACK \ +in1 += CH->S0_OUT[1]; \ +in3 += SIN_TAB[(in1 >> SIN_LBITS) & SIN_MASK][en1] + SIN_TAB[(in2 >> SIN_LBITS) & SIN_MASK][en2]; \ +CH->OUTd = (SIN_TAB[(in3 >> SIN_LBITS) & SIN_MASK][en3]) >> OUT_SHIFT; + +#define DO_ALGO_4 \ +DO_FEEDBACK \ +in1 += CH->S0_OUT[1]; \ +in3 += SIN_TAB[(in2 >> SIN_LBITS) & SIN_MASK][en2]; \ +CH->OUTd = ((int) SIN_TAB[(in3 >> SIN_LBITS) & SIN_MASK][en3] + (int) SIN_TAB[(in1 >> SIN_LBITS) & SIN_MASK][en1]) >> OUT_SHIFT; \ +DO_LIMIT + +#define DO_ALGO_5 \ +DO_FEEDBACK \ +in1 += CH->S0_OUT[1]; \ +in2 += CH->S0_OUT[1]; \ +in3 += CH->S0_OUT[1]; \ +CH->OUTd = ((int) SIN_TAB[(in3 >> SIN_LBITS) & SIN_MASK][en3] + (int) SIN_TAB[(in1 >> SIN_LBITS) & SIN_MASK][en1] + (int) SIN_TAB[(in2 >> SIN_LBITS) & SIN_MASK][en2]) >> OUT_SHIFT; \ +DO_LIMIT + +#define DO_ALGO_6 \ +DO_FEEDBACK \ +in1 += CH->S0_OUT[1]; \ +CH->OUTd = ((int) SIN_TAB[(in3 >> SIN_LBITS) & SIN_MASK][en3] + (int) SIN_TAB[(in1 >> SIN_LBITS) & SIN_MASK][en1] + (int) SIN_TAB[(in2 >> SIN_LBITS) & SIN_MASK][en2]) >> OUT_SHIFT; \ +DO_LIMIT + +#define DO_ALGO_7 \ +DO_FEEDBACK \ +CH->OUTd = ((int) SIN_TAB[(in3 >> SIN_LBITS) & SIN_MASK][en3] + (int) SIN_TAB[(in1 >> SIN_LBITS) & SIN_MASK][en1] + (int) SIN_TAB[(in2 >> SIN_LBITS) & SIN_MASK][en2] + CH->S0_OUT[1]) >> OUT_SHIFT; \ +DO_LIMIT + + +#define DO_OUTPUT \ +buf[0][i] += CH->OUTd & CH->LEFT; \ +buf[1][i] += CH->OUTd & CH->RIGHT; + + +#define DO_OUTPUT_INT0 \ +if ((int_cnt += YM2612.Inter_Step) & 0x04000) \ +{ \ + int_cnt &= 0x3FFF; \ + buf[0][i] += CH->OUTd & CH->LEFT; \ + buf[1][i] += CH->OUTd & CH->RIGHT; \ +} \ +else i--; + + +#define DO_OUTPUT_INT1 \ +CH->Old_OUTd = (CH->OUTd + CH->Old_OUTd) >> 1; \ +if ((int_cnt += YM2612.Inter_Step) & 0x04000) \ +{ \ + int_cnt &= 0x3FFF; \ + buf[0][i] += CH->Old_OUTd & CH->LEFT; \ + buf[1][i] += CH->Old_OUTd & CH->RIGHT; \ +} \ +else i--; + + +#define DO_OUTPUT_INT2 \ +if ((int_cnt += YM2612.Inter_Step) & 0x04000) \ +{ \ + int_cnt &= 0x3FFF; \ + CH->Old_OUTd = (CH->OUTd + CH->Old_OUTd) >> 1; \ + buf[0][i] += CH->Old_OUTd & CH->LEFT; \ + buf[1][i] += CH->Old_OUTd & CH->RIGHT; \ +} \ +else i--; \ +CH->Old_OUTd = CH->OUTd; + + +#define DO_OUTPUT_INT \ +if ((int_cnt += YM2612.Inter_Step) & 0x04000) \ +{ \ + int_cnt &= 0x3FFF; \ + CH->Old_OUTd = (((int_cnt ^ 0x3FFF) * CH->OUTd) + (int_cnt * CH->Old_OUTd)) >> 14; \ + buf[0][i] += CH->Old_OUTd & CH->LEFT; \ + buf[1][i] += CH->Old_OUTd & CH->RIGHT; \ +} \ +else i--; \ +CH->Old_OUTd = CH->OUTd; + + +void Update_Chan_Algo0(channel_ *CH, int **buf, int lenght) +{ + int i; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 0 len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_0 + DO_OUTPUT + } +} + + +void Update_Chan_Algo1(channel_ *CH, int **buf, int lenght) +{ + int i; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 1 len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_1 + DO_OUTPUT + } +} + + +void Update_Chan_Algo2(channel_ *CH, int **buf, int lenght) +{ + int i; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 2 len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_2 + DO_OUTPUT + } +} + + +void Update_Chan_Algo3(channel_ *CH, int **buf, int lenght) +{ + int i; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 3 len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_3 + DO_OUTPUT + } +} + + +void Update_Chan_Algo4(channel_ *CH, int **buf, int lenght) +{ + int i; + + if ((CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 4 len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_4 + DO_OUTPUT + } +} + + +void Update_Chan_Algo5(channel_ *CH, int **buf, int lenght) +{ + int i; + + if ((CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S2].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 5 len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_5 + DO_OUTPUT + } +} + + +void Update_Chan_Algo6(channel_ *CH, int **buf, int lenght) +{ + int i; + + if ((CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S2].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 6 len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_6 + DO_OUTPUT + } +} + + +void Update_Chan_Algo7(channel_ *CH, int **buf, int lenght) +{ + int i; + + if ((CH->SLOT[S0].Ecnt == ENV_END) && (CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S2].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 7 len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_7 + DO_OUTPUT + } +} + + +void Update_Chan_Algo0_LFO(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 0 LFO len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_0 + DO_OUTPUT + } +} + + +void Update_Chan_Algo1_LFO(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 1 LFO len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_1 + DO_OUTPUT + } +} + + +void Update_Chan_Algo2_LFO(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 2 LFO len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_2 + DO_OUTPUT + } +} + + +void Update_Chan_Algo3_LFO(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 3 LFO len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_3 + DO_OUTPUT + } +} + + +void Update_Chan_Algo4_LFO(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if ((CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 4 LFO len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_4 + DO_OUTPUT + } +} + + +void Update_Chan_Algo5_LFO(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if ((CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S2].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 5 LFO len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_5 + DO_OUTPUT + } +} + + +void Update_Chan_Algo6_LFO(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if ((CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S2].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 6 LFO len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_6 + DO_OUTPUT + } +} + + +void Update_Chan_Algo7_LFO(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if ((CH->SLOT[S0].Ecnt == ENV_END) && (CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S2].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 7 LFO len = %d\n\n", lenght); +#endif + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_7 + DO_OUTPUT + } +} + + +/****************************************************** + * Interpolated output * + *****************************************************/ + + +void Update_Chan_Algo0_Int(channel_ *CH, int **buf, int lenght) +{ + int i; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 0 len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_0 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo1_Int(channel_ *CH, int **buf, int lenght) +{ + int i; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 1 len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_1 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo2_Int(channel_ *CH, int **buf, int lenght) +{ + int i; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 2 len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_2 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo3_Int(channel_ *CH, int **buf, int lenght) +{ + int i; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 3 len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_3 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo4_Int(channel_ *CH, int **buf, int lenght) +{ + int i; + + if ((CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 4 len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_4 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo5_Int(channel_ *CH, int **buf, int lenght) +{ + int i; + + if ((CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S2].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 5 len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_5 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo6_Int(channel_ *CH, int **buf, int lenght) +{ + int i; + + if ((CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S2].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 6 len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_6 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo7_Int(channel_ *CH, int **buf, int lenght) +{ + int i; + + if ((CH->SLOT[S0].Ecnt == ENV_END) && (CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S2].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 7 len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE + GET_CURRENT_ENV + UPDATE_ENV + DO_ALGO_7 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo0_LFO_Int(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 0 LFO len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_0 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo1_LFO_Int(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 1 LFO len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_1 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo2_LFO_Int(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 2 LFO len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_2 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo3_LFO_Int(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if (CH->SLOT[S3].Ecnt == ENV_END) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 3 LFO len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_3 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo4_LFO_Int(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if ((CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 4 LFO len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_4 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo5_LFO_Int(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if ((CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S2].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 5 LFO len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_5 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo6_LFO_Int(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if ((CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S2].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 6 LFO len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_6 + DO_OUTPUT_INT + } +} + + +void Update_Chan_Algo7_LFO_Int(channel_ *CH, int **buf, int lenght) +{ + int i, env_LFO, freq_LFO; + + if ((CH->SLOT[S0].Ecnt == ENV_END) && (CH->SLOT[S1].Ecnt == ENV_END) && (CH->SLOT[S2].Ecnt == ENV_END) && (CH->SLOT[S3].Ecnt == ENV_END)) return; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nAlgo 7 LFO len = %d\n\n", lenght); +#endif + + int_cnt = YM2612.Inter_Cnt; + + for(i = 0; i < lenght; i++) + { + GET_CURRENT_PHASE + UPDATE_PHASE_LFO + GET_CURRENT_ENV_LFO + UPDATE_ENV + DO_ALGO_7 + DO_OUTPUT_INT + } +} + + + +/*********************************************** + * fonctions publiques * + ***********************************************/ + +static long dac_highpass; + +// Initialisation de l'émulateur YM2612 +int YM2612_Init(int Clock, int Rate, int Interpolation) +{ + int i, j; + double x; + + if ((Rate == 0) || (Clock == 0)) return 1; + + memset(&YM2612, 0, sizeof(YM2612)); + +#if YM_DEBUG_LEVEL > 0 + if (debug_file == NULL) + { + debug_file = fopen("ym2612.log", "w"); + fprintf(debug_file, "YM2612 logging :\n\n"); + } +#endif + + YM2612.Clock = Clock; + YM2612.Rate = Rate; + + // 144 = 12 * (prescale * 2) = 12 * 6 * 2 + // prescale set to 6 by default + + YM2612.Frequence = ((double) YM2612.Clock / (double) YM2612.Rate) / 144.0; + YM2612.TimerBase = (int) (YM2612.Frequence * 4096.0); + + if ((Interpolation) && (YM2612.Frequence > 1.0)) + { + YM2612.Inter_Step = (unsigned int) ((1.0 / YM2612.Frequence) * (double) (0x4000)); + YM2612.Inter_Cnt = 0; + + // We recalculate rate and frequence after interpolation + + YM2612.Rate = YM2612.Clock / 144; + YM2612.Frequence = 1.0; + } + else + { + YM2612.Inter_Step = 0x4000; + YM2612.Inter_Cnt = 0; + } + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "YM2612 frequence = %g rate = %d interp step = %.8X\n\n", YM2612.Frequence, YM2612.Rate, YM2612.Inter_Step); +#endif + + // Tableau TL : + // [0 - 4095] = +output [4095 - ...] = +output overflow (fill with 0) + // [12288 - 16383] = -output [16384 - ...] = -output overflow (fill with 0) + + for(i = 0; i < TL_LENGHT; i++) + { + if (i >= PG_CUT_OFF) // YM2612 cut off sound after 78 dB (14 bits output ?) + { + TL_TAB[TL_LENGHT + i] = TL_TAB[i] = 0; + } + else + { + x = MAX_OUT; // Max output + x /= pow(10, (ENV_STEP * i) / 20); // Decibel -> Voltage + + TL_TAB[i] = (int) x; + TL_TAB[TL_LENGHT + i] = -TL_TAB[i]; + } + +#if YM_DEBUG_LEVEL > 2 + fprintf(debug_file, "TL_TAB[%d] = %.8X TL_TAB[%d] = %.8X\n", i, TL_TAB[i], TL_LENGHT + i, TL_TAB[TL_LENGHT + i]); +#endif + } + +#if YM_DEBUG_LEVEL > 2 + fprintf(debug_file, "\n\n\n\n"); +#endif + + // Tableau SIN : + // SIN_TAB[x][y] = sin(x) * y; + // x = phase and y = volume + + SIN_TAB[0] = SIN_TAB[SIN_LENGHT / 2] = &TL_TAB[(int)PG_CUT_OFF]; + + for(i = 1; i <= SIN_LENGHT / 4; i++) + { + x = sin(2.0 * PI * (double) (i) / (double) (SIN_LENGHT)); // Sinus + x = 20 * log10(1 / x); // convert to dB + + j = (int) (x / ENV_STEP); // Get TL range + + if (j > PG_CUT_OFF) j = (int) PG_CUT_OFF; + + SIN_TAB[i] = SIN_TAB[(SIN_LENGHT / 2) - i] = &TL_TAB[j]; + SIN_TAB[(SIN_LENGHT / 2) + i] = SIN_TAB[SIN_LENGHT - i] = &TL_TAB[TL_LENGHT + j]; + +#if YM_DEBUG_LEVEL > 2 + fprintf(debug_file, "SIN[%d][0] = %.8X SIN[%d][0] = %.8X SIN[%d][0] = %.8X SIN[%d][0] = %.8X\n", i, SIN_TAB[i][0], (SIN_LENGHT / 2) - i, SIN_TAB[(SIN_LENGHT / 2) - i][0], (SIN_LENGHT / 2) + i, SIN_TAB[(SIN_LENGHT / 2) + i][0], SIN_LENGHT - i, SIN_TAB[SIN_LENGHT - i][0]); +#endif + } + +#if YM_DEBUG_LEVEL > 2 + fprintf(debug_file, "\n\n\n\n"); +#endif + + // Tableau LFO (LFO wav) : + + for(i = 0; i < LFO_LENGHT; i++) + { + x = sin(2.0 * PI * (double) (i) / (double) (LFO_LENGHT)); // Sinus + x += 1.0; + x /= 2.0; // positive only + x *= 11.8 / ENV_STEP; // ajusted to MAX enveloppe modulation + + LFO_ENV_TAB[i] = (int) x; + + x = sin(2.0 * PI * (double) (i) / (double) (LFO_LENGHT)); // Sinus + x *= (double) ((1 << (LFO_HBITS - 1)) - 1); + + LFO_FREQ_TAB[i] = (int) x; + +#if YM_DEBUG_LEVEL > 2 + fprintf(debug_file, "LFO[%d] = %.8X\n", i, LFO_ENV_TAB[i]); +#endif + } + +#if YM_DEBUG_LEVEL > 2 + fprintf(debug_file, "\n\n\n\n"); +#endif + + // Tableau Enveloppe : + // ENV_TAB[0] -> ENV_TAB[ENV_LENGHT - 1] = attack curve + // ENV_TAB[ENV_LENGHT] -> ENV_TAB[2 * ENV_LENGHT - 1] = decay curve + + for(i = 0; i < ENV_LENGHT; i++) + { + // Attack curve (x^8 - music level 2 Vectorman 2) + x = pow(((double) ((ENV_LENGHT - 1) - i) / (double) (ENV_LENGHT)), 8); + x *= ENV_LENGHT; + + ENV_TAB[i] = (int) x; + + // Decay curve (just linear) + x = pow(((double) (i) / (double) (ENV_LENGHT)), 1); + x *= ENV_LENGHT; + + ENV_TAB[ENV_LENGHT + i] = (int) x; + +#if YM_DEBUG_LEVEL > 2 + fprintf(debug_file, "ATTACK[%d] = %d DECAY[%d] = %d\n", i, ENV_TAB[i], i, ENV_TAB[ENV_LENGHT + i]); +#endif + } + + ENV_TAB[ENV_END >> ENV_LBITS] = ENV_LENGHT - 1; // for the stopped state + + // Tableau pour la conversion Attack -> Decay and Decay -> Attack + + for(i = 0, j = ENV_LENGHT - 1; i < ENV_LENGHT; i++) + { + while (j && (ENV_TAB[j] < (unsigned) i)) j--; + + DECAY_TO_ATTACK[i] = j << ENV_LBITS; + } + + // Tableau pour le Substain Level + + for(i = 0; i < 15; i++) + { + x = i * 3; // 3 and not 6 (Mickey Mania first music for test) + x /= ENV_STEP; + + j = (int) x; + j <<= ENV_LBITS; + + SL_TAB[i] = j + ENV_DECAY; + } + + j = ENV_LENGHT - 1; // special case : volume off + j <<= ENV_LBITS; + SL_TAB[15] = j + ENV_DECAY; + + // Tableau Frequency Step + + for(i = 0; i < 2048; i++) + { + x = (double) (i) * YM2612.Frequence; + +#if ((SIN_LBITS + SIN_HBITS - (21 - 7)) < 0) + x /= (double) (1 << ((21 - 7) - SIN_LBITS - SIN_HBITS)); +#else + x *= (double) (1 << (SIN_LBITS + SIN_HBITS - (21 - 7))); +#endif + + x /= 2.0; // because MUL = value * 2 + + FINC_TAB[i] = (unsigned int) x; + } + + // Tableaux Attack & Decay Rate + + for(i = 0; i < 4; i++) + { + AR_TAB[i] = 0; + DR_TAB[i] = 0; + } + + for(i = 0; i < 60; i++) + { + x = YM2612.Frequence; + + x *= 1.0 + ((i & 3) * 0.25); // bits 0-1 : x1.00, x1.25, x1.50, x1.75 + x *= (double) (1 << ((i >> 2))); // bits 2-5 : shift bits (x2^0 - x2^15) + x *= (double) (ENV_LENGHT << ENV_LBITS); // on ajuste pour le tableau ENV_TAB + + AR_TAB[i + 4] = (unsigned int) (x / AR_RATE); + DR_TAB[i + 4] = (unsigned int) (x / DR_RATE); + } + + for(i = 64; i < 96; i++) + { + AR_TAB[i] = AR_TAB[63]; + DR_TAB[i] = DR_TAB[63]; + + NULL_RATE[i - 64] = 0; + } + + // Tableau Detune + + for(i = 0; i < 4; i++) + { + for (j = 0; j < 32; j++) + { +#if ((SIN_LBITS + SIN_HBITS - 21) < 0) + x = (double) DT_DEF_TAB[(i << 5) + j] * YM2612.Frequence / (double) (1 << (21 - SIN_LBITS - SIN_HBITS)); +#else + x = (double) DT_DEF_TAB[(i << 5) + j] * YM2612.Frequence * (double) (1 << (SIN_LBITS + SIN_HBITS - 21)); +#endif + + DT_TAB[i + 0][j] = (int) x; + DT_TAB[i + 4][j] = (int) -x; + } + } + + // Tableau LFO + + j = (YM2612.Rate * YM2612.Inter_Step) / 0x4000; + + LFO_INC_TAB[0] = (unsigned int) (3.98 * (double) (1 << (LFO_HBITS + LFO_LBITS)) / j); + LFO_INC_TAB[1] = (unsigned int) (5.56 * (double) (1 << (LFO_HBITS + LFO_LBITS)) / j); + LFO_INC_TAB[2] = (unsigned int) (6.02 * (double) (1 << (LFO_HBITS + LFO_LBITS)) / j); + LFO_INC_TAB[3] = (unsigned int) (6.37 * (double) (1 << (LFO_HBITS + LFO_LBITS)) / j); + LFO_INC_TAB[4] = (unsigned int) (6.88 * (double) (1 << (LFO_HBITS + LFO_LBITS)) / j); + LFO_INC_TAB[5] = (unsigned int) (9.63 * (double) (1 << (LFO_HBITS + LFO_LBITS)) / j); + LFO_INC_TAB[6] = (unsigned int) (48.1 * (double) (1 << (LFO_HBITS + LFO_LBITS)) / j); + LFO_INC_TAB[7] = (unsigned int) (72.2 * (double) (1 << (LFO_HBITS + LFO_LBITS)) / j); + + YM2612_Reset(); + + return 0; +} + + +int YM2612_End(void) +{ + +#if YM_DEBUG_LEVEL > 0 + if (debug_file) fclose(debug_file); + debug_file = NULL; +#endif + + return 0; +} + + +int YM2612_Reset(void) +{ + int i, j; + +#if YM_DEBUG_LEVEL > 0 + fprintf(debug_file, "\n\nStarting reseting YM2612 ...\n\n"); +#endif + + YM2612.LFOcnt = 0; + YM2612.TimerA = 0; + YM2612.TimerAL = 0; + YM2612.TimerAcnt = 0; + YM2612.TimerB = 0; + YM2612.TimerBL = 0; + YM2612.TimerBcnt = 0; + YM2612.DAC = 0; + YM2612.DACdata = 0; + dac_highpass = 0; + + YM2612.Status = 0; + + YM2612.OPNAadr = 0; + YM2612.OPNBadr = 0; + YM2612.Inter_Cnt = 0; + + for(i = 0; i < 6; i++) + { + YM2612.CHANNEL[i].Old_OUTd = 0; + YM2612.CHANNEL[i].OUTd = 0; + YM2612.CHANNEL[i].LEFT = 0xFFFFFFFF; + YM2612.CHANNEL[i].RIGHT = 0xFFFFFFFF; + YM2612.CHANNEL[i].ALGO = 0;; + YM2612.CHANNEL[i].FB = 31; + YM2612.CHANNEL[i].FMS = 0; + YM2612.CHANNEL[i].AMS = 0; + + for(j = 0 ;j < 4 ; j++) + { + YM2612.CHANNEL[i].S0_OUT[j] = 0; + YM2612.CHANNEL[i].FNUM[j] = 0; + YM2612.CHANNEL[i].FOCT[j] = 0; + YM2612.CHANNEL[i].KC[j] = 0; + + YM2612.CHANNEL[i].SLOT[j].Fcnt = 0; + YM2612.CHANNEL[i].SLOT[j].Finc = 0; + YM2612.CHANNEL[i].SLOT[j].Ecnt = ENV_END; // Put it at the end of Decay phase... + YM2612.CHANNEL[i].SLOT[j].Einc = 0; + YM2612.CHANNEL[i].SLOT[j].Ecmp = 0; + YM2612.CHANNEL[i].SLOT[j].Ecurp = RELEASE; + + YM2612.CHANNEL[i].SLOT[j].ChgEnM = 0; + } + } + + for(i = 0; i < 0x100; i++) + { + YM2612.REG[0][i] = -1; + YM2612.REG[1][i] = -1; + } + + for(i = 0xB6; i >= 0xB4; i--) + { + YM2612_Write(0, (unsigned char) i); + YM2612_Write(2, (unsigned char) i); + YM2612_Write(1, 0xC0); + YM2612_Write(3, 0xC0); + } + + for(i = 0xB2; i >= 0x22; i--) + { + YM2612_Write(0, (unsigned char) i); + YM2612_Write(2, (unsigned char) i); + YM2612_Write(1, 0); + YM2612_Write(3, 0); + } + + YM2612_Write(0, 0x2A); + YM2612_Write(1, 0x80); + +#if YM_DEBUG_LEVEL > 0 + fprintf(debug_file, "\n\nFinishing reseting YM2612 ...\n\n"); +#endif + + return 0; +} + + +int YM2612_Read(void) +{ +/* static int cnt = 0; + + if (cnt++ == 50) + { + cnt = 0; + return YM2612.Status; + } + else return YM2612.Status | 0x80; +*/ + return YM2612.Status; +} + +extern uint8 dacshift; + +int YM2612_Write(unsigned char adr, unsigned char data) +{ + int d; + + data &= 0xFF; + adr &= 0x3; + + switch(adr) + { + case 0: + YM2612.OPNAadr = data; + break; + + case 1: + // Trivial optimisation + + if (YM2612.OPNAadr == 0x2A) + { + YM2612.DACdata = ((int) data - 0x80) << 7; + return 0; + } + + d = YM2612.OPNAadr & 0xF0; + + if (d >= 0x30) + { + if (YM2612.REG[0][YM2612.OPNAadr] == data) return 2; + YM2612.REG[0][YM2612.OPNAadr] = data; + + if (d < 0xA0) // SLOT + { + SLOT_SET(YM2612.OPNAadr, data); + } + else // CHANNEL + { + CHANNEL_SET(YM2612.OPNAadr, data); + } + } + else // YM2612 + { + YM2612.REG[0][YM2612.OPNAadr] = data; + YM_SET(YM2612.OPNAadr, data); + } + break; + + case 2: + YM2612.OPNBadr = data; + break; + + case 3: + d = YM2612.OPNBadr & 0xF0; + + if (d >= 0x30) + { + if (YM2612.REG[1][YM2612.OPNBadr] == data) return 2; + YM2612.REG[1][YM2612.OPNBadr] = data; + + if (d < 0xA0) // SLOT + { + SLOT_SET(YM2612.OPNBadr + 0x100, data); + } + else // CHANNEL + { + CHANNEL_SET(YM2612.OPNBadr + 0x100, data); + } + } + else return 1; + break; + } + + return 0; +} + + +void YM2612_Update(int **buf, int length) +{ + int i, j, algo_type; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nStarting generating sound...\n\n"); +#endif + + // Mise à jour des pas des compteurs-fréquences s'ils ont été modifiés + + if (YM2612.CHANNEL[0].SLOT[0].Finc == -1) CALC_FINC_CH(&YM2612.CHANNEL[0]); + if (YM2612.CHANNEL[1].SLOT[0].Finc == -1) CALC_FINC_CH(&YM2612.CHANNEL[1]); + if (YM2612.CHANNEL[2].SLOT[0].Finc == -1) + { + if (YM2612.Mode & 0x40) + { + CALC_FINC_SL(&(YM2612.CHANNEL[2].SLOT[S0]), FINC_TAB[YM2612.CHANNEL[2].FNUM[2]] >> (7 - YM2612.CHANNEL[2].FOCT[2]), YM2612.CHANNEL[2].KC[2]); + CALC_FINC_SL(&(YM2612.CHANNEL[2].SLOT[S1]), FINC_TAB[YM2612.CHANNEL[2].FNUM[3]] >> (7 - YM2612.CHANNEL[2].FOCT[3]), YM2612.CHANNEL[2].KC[3]); + CALC_FINC_SL(&(YM2612.CHANNEL[2].SLOT[S2]), FINC_TAB[YM2612.CHANNEL[2].FNUM[1]] >> (7 - YM2612.CHANNEL[2].FOCT[1]), YM2612.CHANNEL[2].KC[1]); + CALC_FINC_SL(&(YM2612.CHANNEL[2].SLOT[S3]), FINC_TAB[YM2612.CHANNEL[2].FNUM[0]] >> (7 - YM2612.CHANNEL[2].FOCT[0]), YM2612.CHANNEL[2].KC[0]); + } + else + { + CALC_FINC_CH(&YM2612.CHANNEL[2]); + } + } + if (YM2612.CHANNEL[3].SLOT[0].Finc == -1) CALC_FINC_CH(&YM2612.CHANNEL[3]); + if (YM2612.CHANNEL[4].SLOT[0].Finc == -1) CALC_FINC_CH(&YM2612.CHANNEL[4]); + if (YM2612.CHANNEL[5].SLOT[0].Finc == -1) CALC_FINC_CH(&YM2612.CHANNEL[5]); + +/* + CALC_FINC_CH(&YM2612.CHANNEL[0]); + CALC_FINC_CH(&YM2612.CHANNEL[1]); + if (YM2612.Mode & 0x40) + { + CALC_FINC_SL(&(YM2612.CHANNEL[2].SLOT[0]), FINC_TAB[YM2612.CHANNEL[2].FNUM[2]] >> (7 - YM2612.CHANNEL[2].FOCT[2]), YM2612.CHANNEL[2].KC[2]); + CALC_FINC_SL(&(YM2612.CHANNEL[2].SLOT[1]), FINC_TAB[YM2612.CHANNEL[2].FNUM[3]] >> (7 - YM2612.CHANNEL[2].FOCT[3]), YM2612.CHANNEL[2].KC[3]); + CALC_FINC_SL(&(YM2612.CHANNEL[2].SLOT[2]), FINC_TAB[YM2612.CHANNEL[2].FNUM[1]] >> (7 - YM2612.CHANNEL[2].FOCT[1]), YM2612.CHANNEL[2].KC[1]); + CALC_FINC_SL(&(YM2612.CHANNEL[2].SLOT[3]), FINC_TAB[YM2612.CHANNEL[2].FNUM[0]] >> (7 - YM2612.CHANNEL[2].FOCT[0]), YM2612.CHANNEL[2].KC[0]); + } + else + { + CALC_FINC_CH(&YM2612.CHANNEL[2]); + } + CALC_FINC_CH(&YM2612.CHANNEL[3]); + CALC_FINC_CH(&YM2612.CHANNEL[4]); + CALC_FINC_CH(&YM2612.CHANNEL[5]); +*/ + + if (YM2612.Inter_Step & 0x04000) algo_type = 0; + else algo_type = 16; + + if (YM2612.LFOinc) + { + // Precalcul LFO wav + + for(i = 0; i < length; i++) + { + j = ((YM2612.LFOcnt += YM2612.LFOinc) >> LFO_LBITS) & LFO_MASK; + + LFO_ENV_UP[i] = LFO_ENV_TAB[j]; + LFO_FREQ_UP[i] = LFO_FREQ_TAB[j]; + +#if YM_DEBUG_LEVEL > 3 + fprintf(debug_file, "LFO_ENV_UP[%d] = %d LFO_FREQ_UP[%d] = %d\n", i, LFO_ENV_UP[i], i, LFO_FREQ_UP[i]); +#endif + } + + algo_type |= 8; + } + + UPDATE_CHAN[YM2612.CHANNEL[0].ALGO + algo_type](&(YM2612.CHANNEL[0]), buf, length); + UPDATE_CHAN[YM2612.CHANNEL[1].ALGO + algo_type](&(YM2612.CHANNEL[1]), buf, length); + UPDATE_CHAN[YM2612.CHANNEL[2].ALGO + algo_type](&(YM2612.CHANNEL[2]), buf, length); + UPDATE_CHAN[YM2612.CHANNEL[3].ALGO + algo_type](&(YM2612.CHANNEL[3]), buf, length); + UPDATE_CHAN[YM2612.CHANNEL[4].ALGO + algo_type](&(YM2612.CHANNEL[4]), buf, length); + if (!(YM2612.DAC)) UPDATE_CHAN[YM2612.CHANNEL[5].ALGO + algo_type](&(YM2612.CHANNEL[5]), buf, length); + else + { + for(i = 0; i < length; i++) + { + long dac = (YM2612.DACdata << 15) - dac_highpass; + dac_highpass += dac >> 9; + dac >>= 15; + buf[0][i] += dac & YM2612.CHANNEL[5].LEFT; + buf[1][i] += dac & YM2612.CHANNEL[5].RIGHT; + } + } + + YM2612.Inter_Cnt = int_cnt; + +#if YM_DEBUG_LEVEL > 1 + fprintf(debug_file, "\n\nFinishing generating sound...\n\n"); +#endif + +} + +void YM2612_Special_Update(void) +{} + +void YM2612TimerAOver() +{ + if (YM2612.Mode & 0x80) CSM_Key_Control(); +} + + diff --git a/source/sound/ym2612.h b/source/sound/ym2612.h new file mode 100644 index 0000000..ecf9d8d --- /dev/null +++ b/source/sound/ym2612.h @@ -0,0 +1,171 @@ +#ifndef _YM2612_H_ +#define _YM2612_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +// Change it if you need to do long update +#define MAX_UPDATE_LENGHT 2000 + +// Gens always uses 16 bits sound (in 32 bits buffer) and do the convertion later if needed. +#define OUTPUT_BITS 16 + +typedef struct slot__ { + int *DT; // paramètre detune + int MUL; // paramètre "multiple de fréquence" + int TL; // Total Level = volume lorsque l'enveloppe est au plus haut + int TLL; // Total Level ajusted + int SLL; // Sustin Level (ajusted) = volume où l'enveloppe termine sa première phase de régression + int KSR_S; // Key Scale Rate Shift = facteur de prise en compte du KSL dans la variations de l'enveloppe + int KSR; // Key Scale Rate = cette valeur est calculée par rapport à la fréquence actuelle, elle va influer + // sur les différents paramètres de l'enveloppe comme l'attaque, le decay ... comme dans la réalité ! + int SEG; // Type enveloppe SSG + int *AR; // Attack Rate (table pointeur) = Taux d'attaque (AR[KSR]) + int *DR; // Decay Rate (table pointeur) = Taux pour la régression (DR[KSR]) + int *SR; // Sustin Rate (table pointeur) = Taux pour le maintien (SR[KSR]) + int *RR; // Release Rate (table pointeur) = Taux pour le relâchement (RR[KSR]) + int Fcnt; // Frequency Count = compteur-fréquence pour déterminer l'amplitude actuelle (SIN[Finc >> 16]) + int Finc; // frequency step = pas d'incrémentation du compteur-fréquence + // plus le pas est grand, plus la fréquence est aïgu (ou haute) + int Ecurp; // Envelope current phase = cette variable permet de savoir dans quelle phase + // de l'enveloppe on se trouve, par exemple phase d'attaque ou phase de maintenue ... + // en fonction de la valeur de cette variable, on va appeler une fonction permettant + // de mettre à jour l'enveloppe courante. + int Ecnt; // Envelope counter = le compteur-enveloppe permet de savoir où l'on se trouve dans l'enveloppe + int Einc; // Envelope step courant + int Ecmp; // Envelope counter limite pour la prochaine phase + int EincA; // Envelope step for Attack = pas d'incrémentation du compteur durant la phase d'attaque + // cette valeur est égal à AR[KSR] + int EincD; // Envelope step for Decay = pas d'incrémentation du compteur durant la phase de regression + // cette valeur est égal à DR[KSR] + int EincS; // Envelope step for Sustain = pas d'incrémentation du compteur durant la phase de maintenue + // cette valeur est égal à SR[KSR] + int EincR; // Envelope step for Release = pas d'incrémentation du compteur durant la phase de relâchement + // cette valeur est égal à RR[KSR] + int *OUTp; // pointeur of SLOT output = pointeur permettant de connecter la sortie de ce slot à l'entrée + // d'un autre ou carrement à la sortie de la voie + int INd; // input data of the slot = données en entrée du slot + int ChgEnM; // Change envelop mask. + int AMS; // AMS depth level of this SLOT = degré de modulation de l'amplitude par le LFO + int AMSon; // AMS enable flag = drapeau d'activation de l'AMS +} slot_; + +typedef struct channel__ { + int S0_OUT[4]; // anciennes sorties slot 0 (pour le feed back) + int Old_OUTd; // ancienne sortie de la voie (son brut) + int OUTd; // sortie de la voie (son brut) + int LEFT; // LEFT enable flag + int RIGHT; // RIGHT enable flag + int ALGO; // Algorythm = détermine les connections entre les opérateurs + int FB; // shift count of self feed back = degré de "Feed-Back" du SLOT 1 (il est son unique entrée) + int FMS; // Fréquency Modulation Sensitivity of channel = degré de modulation de la fréquence sur la voie par le LFO + int AMS; // Amplitude Modulation Sensitivity of channel = degré de modulation de l'amplitude sur la voie par le LFO + int FNUM[4]; // hauteur fréquence de la voie (+ 3 pour le mode spécial) + int FOCT[4]; // octave de la voie (+ 3 pour le mode spécial) + int KC[4]; // Key Code = valeur fonction de la fréquence (voir KSR pour les slots, KSR = KC >> KSR_S) + struct slot__ SLOT[4]; // four slot.operators = les 4 slots de la voie + int FFlag; // Frequency step recalculation flag +} channel_; + +typedef struct ym2612__ { + int Clock; // Horloge YM2612 + int Rate; // Sample Rate (11025/22050/44100) + int TimerBase; // TimerBase calculation + int Status; // YM2612 Status (timer overflow) + int OPNAadr; // addresse pour l'écriture dans l'OPN A (propre à l'émulateur) + int OPNBadr; // addresse pour l'écriture dans l'OPN B (propre à l'émulateur) + int LFOcnt; // LFO counter = compteur-fréquence pour le LFO + int LFOinc; // LFO step counter = pas d'incrémentation du compteur-fréquence du LFO + // plus le pas est grand, plus la fréquence est grande + int TimerA; // timerA limit = valeur jusqu'à laquelle le timer A doit compter + int TimerAL; + int TimerAcnt; // timerA counter = valeur courante du Timer A + int TimerB; // timerB limit = valeur jusqu'à laquelle le timer B doit compter + int TimerBL; + int TimerBcnt; // timerB counter = valeur courante du Timer B + int Mode; // Mode actuel des voie 3 et 6 (normal / spécial) + int DAC; // DAC enabled flag + int DACdata; // DAC data + double Frequence; // Fréquence de base, se calcul par rapport à l'horlage et au sample rate + unsigned int Inter_Cnt; // Interpolation Counter + unsigned int Inter_Step; // Interpolation Step + struct channel__ CHANNEL[6]; // Les 6 voies du YM2612 + int REG[2][0x100]; // Sauvegardes des valeurs de tout les registres, c'est facultatif + // cela nous rend le débuggage plus facile +} ym2612_; + +/* Gens */ + +extern int YM2612_Enable; +extern int YM2612_Improv; +extern int DAC_Enable; +extern int *YM_Buf[2]; +extern int YM_Len; + +/* end */ + +int YM2612_Init(int clock, int rate, int interpolation); +int YM2612_End(void); +int YM2612_Reset(void); +int YM2612_Read(void); +int YM2612_Write(unsigned char adr, unsigned char data); +void YM2612_Update(int **buf, int length); +int YM2612_Save(unsigned char SAVE[0x200]); +int YM2612_Restore(unsigned char SAVE[0x200]); + + +void YM2612_Special_Update(void); +void YM2612TimerAOver(void); + +/* end */ + +// used for foward... +void Update_Chan_Algo0(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo1(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo2(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo3(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo4(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo5(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo6(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo7(channel_ *CH, int **buf, int lenght); + +void Update_Chan_Algo0_LFO(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo1_LFO(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo2_LFO(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo3_LFO(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo4_LFO(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo5_LFO(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo6_LFO(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo7_LFO(channel_ *CH, int **buf, int lenght); + +void Update_Chan_Algo0_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo1_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo2_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo3_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo4_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo5_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo6_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo7_Int(channel_ *CH, int **buf, int lenght); + +void Update_Chan_Algo0_LFO_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo1_LFO_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo2_LFO_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo3_LFO_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo4_LFO_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo5_LFO_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo6_LFO_Int(channel_ *CH, int **buf, int lenght); +void Update_Chan_Algo7_LFO_Int(channel_ *CH, int **buf, int lenght); + +// used for foward... +void Env_Attack_Next(slot_ *SL); +void Env_Decay_Next(slot_ *SL); +void Env_Substain_Next(slot_ *SL); +void Env_Release_Next(slot_ *SL); +void Env_NULL_Next(slot_ *SL); + +#ifdef __cplusplus +}; +#endif + +#endif diff --git a/source/sram.c b/source/sram.c new file mode 100644 index 0000000..8d17de9 --- /dev/null +++ b/source/sram.c @@ -0,0 +1,77 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * SRAM MANAGER + ***************************************************************************/ + +#include "shared.h" + +T_SRAM sram; + +/**************************************************************************** + * A quick guide to SRAM on the Genesis + * + * This is based on observations only - it may be completely wrong! + * + * The SRAM definition is held at offset 0x1b0 of the ROM header. + * From looking at several ROMS, an ID appears: + * + * 0x1b0 : 0x52 0x41 0xF8 0x20 0x00200001 0x0020ffff + * + * Assuming 64k SRAM / Battery RAM throughout + ****************************************************************************/ +void SRAM_Init () +{ + memset (&sram, 0, sizeof (T_SRAM)); + sram.crc = crc32 (0, &sram.sram[0], 0x10000); + + if ((cart_rom[0x1b0] == 0x52) && (cart_rom[0x1b1] == 0x41)) + { + sram.on = 1; + sram.write = 1; + sram.detected = 1; + sram.start = READ_WORD_LONG(cart_rom, 0x1b4); + sram.end = READ_WORD_LONG(cart_rom, 0x1b8); + + /* some games have incorrect header informations */ + if ((sram.start > sram.end) || ((sram.end - sram.start) >= 0x10000)) + sram.end = sram.start + 0xffff; + sram.start &= 0xfffffffe; + sram.end |= 1; + + /* game using serial EEPROM as external RAM */ + if (sram.end - sram.start < 2) EEPROM_Init(); + } + else + { + /* set SRAM memory region by default */ + sram.start = 0x200000; + sram.end = 0x20ffff; + + /* set SRAM ON by default if game is smaller than 2M */ + if (genromsize <= 0x200000) + { + sram.on = 1; + sram.write = 1; + } + + /* some games using EEPROM don't have the correct header */ + EEPROM_Init(); + } +} diff --git a/source/sram.h b/source/sram.h new file mode 100644 index 0000000..5aed5d8 --- /dev/null +++ b/source/sram.h @@ -0,0 +1,40 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * NGC MANAGER + ***************************************************************************/ + +typedef struct +{ + uint8 detected; + uint8 on; + uint8 write; + uint8 custom; + uint32 start; + uint32 end; + int crc; + uint8 sram[0x10000]; +} T_SRAM; + +/* Function prototypes */ +extern void SRAM_Init (); + +/* global variables */ +extern T_SRAM sram; + diff --git a/source/ssf2tnc.c b/source/ssf2tnc.c new file mode 100644 index 0000000..896815d --- /dev/null +++ b/source/ssf2tnc.c @@ -0,0 +1,98 @@ +/**************************************************************************** + * Super Street Fighter 2 - The New Challengers + * + * This is the ROM mapper for this game. + * Called from mem68k.c + ***************************************************************************/ +#include "shared.h" + +#ifdef NGC +char *shadow_rom = (char *) 0x8000; +#else +char shadow_rom[0x500000]; +#endif + +int SSF2TNC = 0; +static int oldaddr = 0; +static uint8 olddata = 0; + +void ssf2bankrom (int address, unsigned char data) +{ + /* Banking performed on odd addresses only */ + if (!(address & 1)) return; + + /* + * Whilst debugging the ARAM stuff, I noticed that this ROM + * requested the same address/data on subsequent calls. + * This is just a little speedup, which seems to make the + * sound etc in the intro much less choppy. + * + * Happy dance anyone? + */ + if ((oldaddr == address) && (olddata == data)) return; + + if ((address > 0xa130f2) && (address < 0xa13100)) + { + switch (address & 0xf) + { + case 0x3: /* 080000-0FFFFF */ +#ifdef NGC + ARAMFetch (cart_rom + 0x080000, shadow_rom + (data * 0x80000), 0x80000); +#else + memcpy (cart_rom + 0x080000, shadow_rom + (data * 0x80000), 0x80000); +#endif + break; + + case 0x5: /* 100000 - 17FFFF */ +#ifdef NGC + ARAMFetch (cart_rom + 0x100000, shadow_rom + (data * 0x80000), 0x80000); +#else + memcpy (cart_rom + 0x100000, shadow_rom + (data * 0x80000), 0x80000); +#endif + break; + + case 0x7: /* 180000 - 1FFFFF */ +#ifdef NGC + ARAMFetch (cart_rom + 0x180000, shadow_rom + ( data * 0x80000), 0x80000); +#else + memcpy (cart_rom + 0x180000, shadow_rom + ( data * 0x80000), 0x80000); +#endif + break; + + case 0x9: /* 200000 - 27FFFF */ +#ifdef NGC + ARAMFetch (cart_rom + 0x200000, shadow_rom + ( data * 0x80000), 0x80000); +#else + memcpy (cart_rom + 0x200000, shadow_rom + ( data * 0x80000), 0x80000); +#endif + break; + + case 0xb: /* 280000 - 2FFFFF */ +#ifdef NGC + ARAMFetch (cart_rom + 0x280000, shadow_rom + ( data * 0x80000), 0x80000); +#else + memcpy (cart_rom + 0x280000, shadow_rom + ( data * 0x80000), 0x80000); +#endif + break; + + case 0xd: /* 300000 - 37FFFF */ +#ifdef NGC + ARAMFetch (cart_rom + 0x300000, shadow_rom + ( data * 0x80000), 0x80000); +#else + memcpy (cart_rom + 0x300000, shadow_rom + ( data * 0x80000), 0x80000); +#endif + break; + + case 0xf: /* 380000 - 3FFFFF */ +#ifdef NGC + ARAMFetch (cart_rom + 0x380000, shadow_rom + ( data * 0x80000), 0x80000); +#else + memcpy (cart_rom + 0x380000, shadow_rom + ( data * 0x80000), 0x80000); +#endif + break; + } + } + + oldaddr = address; + olddata = data; +} diff --git a/source/ssf2tnc.h b/source/ssf2tnc.h new file mode 100644 index 0000000..22a756b --- /dev/null +++ b/source/ssf2tnc.h @@ -0,0 +1,17 @@ +/**************************************************************************** + * Super Street Fighter 2 - The New Challengers + * + * This is the ROM mapper for this game. + * Called from mem68k.c + ***************************************************************************/ + +/* Function prototypes */ +extern void ssf2bankrom (int address, unsigned char data); + +/* global variables */ +extern int SSF2TNC; +#ifdef NGC +extern char *shadow_rom; +#else +extern char shadow_rom[0x500000]; +#endif diff --git a/source/state.c b/source/state.c new file mode 100644 index 0000000..2dfe411 --- /dev/null +++ b/source/state.c @@ -0,0 +1,356 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * STATE MANAGER + ***************************************************************************/ +#include "shared.h" + +unsigned char state[0x23000]; +unsigned int bufferptr; + +void load_param(void *param, unsigned int size) +{ + memcpy(param, &state[bufferptr], size); + bufferptr+= size; +} + +void save_param(void *param, unsigned int size) +{ + memcpy(&state[bufferptr], param, size); + bufferptr+= size; +} + +void state_load(unsigned char *buffer) +{ + uint32 tmp32; + uint16 tmp16; + int i; + int height, width; + unsigned long inbytes, outbytes; + + /* get compressed state size & uncompress state file */ + memcpy(&inbytes,&buffer[0],sizeof(inbytes)); + +#ifdef NGC + outbytes = 0x23000; + uncompress ((char *) &state[0], &outbytes, (char *) &buffer[sizeof(inbytes)], inbytes); +#else + outbytes = inbytes; + memcpy(&state[0], &buffer[sizeof(inbytes)], outbytes); +#endif + + /* load state */ + system_reset(); + bufferptr = 0; + + // gen.c stuff + load_param(work_ram, sizeof(work_ram)); + load_param(zram, sizeof(zram)); + load_param(&zbusreq, sizeof(zbusreq)); + load_param(&zreset, sizeof(zreset)); + load_param(&zbusack, sizeof(zbusack)); + load_param(&zirq, sizeof(zirq)); + load_param(&zbank, sizeof(zbank)); + load_param(&lastbusreqcnt, sizeof(lastbusreqcnt)); + load_param(&lastbusack, sizeof(lastbusack)); + + // io.c stuff + load_param(io_reg, sizeof(io_reg)); + + // render.c stuff + load_param(&object_index_count,sizeof(object_index_count)); + + // vdp.c stuff + load_param(sat, sizeof(sat)); + load_param(vram, sizeof(vram)); + load_param(cram, sizeof(cram)); + load_param(vsram, sizeof(vsram)); + load_param(reg, sizeof(reg)); + load_param(&addr, sizeof(addr)); + load_param(&addr_latch, sizeof(addr_latch)); + load_param(&code, sizeof(code)); + load_param(&pending, sizeof(pending)); + load_param(&status, sizeof(status)); + load_param(&ntab, sizeof(ntab)); + load_param(&ntbb, sizeof(ntbb)); + load_param(&ntwb, sizeof(ntwb)); + load_param(&satb, sizeof(satb)); + load_param(&hscb, sizeof(hscb)); + load_param(&sat_base_mask, sizeof(sat_base_mask)); + load_param(&sat_addr_mask, sizeof(sat_addr_mask)); + load_param(&border, sizeof(border)); + load_param(&playfield_shift, sizeof(playfield_shift)); + load_param(&playfield_col_mask, sizeof(playfield_col_mask)); + load_param(&playfield_row_mask, sizeof(playfield_row_mask)); + load_param(&y_mask, sizeof(y_mask)); + load_param(&hint_pending, sizeof(hint_pending)); + load_param(&vint_pending, sizeof(vint_pending)); + load_param(&h_counter, sizeof(h_counter)); + load_param(&hc_latch, sizeof(hc_latch)); + load_param(&v_counter, sizeof(v_counter)); + load_param(&dmafill, sizeof(dmafill)); + load_param(&im2_flag, sizeof(im2_flag)); + load_param(&frame_end, sizeof(frame_end)); + load_param(&dma_endCycles, sizeof(dma_endCycles)); + + // system.c stuff + load_param(&aim_m68k,sizeof(aim_m68k)); + load_param(&count_m68k,sizeof(count_m68k)); + load_param(&dma_m68k,sizeof(dma_m68k)); + load_param(&aim_z80,sizeof(aim_z80)); + load_param(&count_z80,sizeof(count_z80)); + + // FM stuff + load_param(fm_reg,sizeof(fm_reg)); + load_param(&fm_status,sizeof(fm_status)); + load_param(timer,sizeof(timer)); + fm_restore(); + + // psg stuff + load_param(&PSG_MAME,1); + if (PSG_MAME) + { + struct SN76496 *R = &sn[0]; + load_param(R->Register,27*4); + } + else load_param(SN76489_GetContextPtr (0),SN76489_GetContextSize ()); + + // Window size + load_param(&height, sizeof(int)); + load_param(&width, sizeof(int)); + if (height != bitmap.viewport.h) + { + bitmap.viewport.oh = bitmap.viewport.h; + bitmap.viewport.h = height; + bitmap.viewport.changed = 1; + } + if (width != bitmap.viewport.w) + { + bitmap.viewport.ow = bitmap.viewport.w; + bitmap.viewport.w = width; + bitmap.viewport.changed = 1; + } + + // 68000 CPU + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_D0, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_D1, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_D2, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_D3, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_D4, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_D5, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_D6, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_D7, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_A0, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_A1, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_A2, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_A3, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_A4, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_A5, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_A6, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_A7, tmp32); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_PC, tmp32); + load_param(&tmp16, 2); m68k_set_reg(M68K_REG_SR, tmp16); + load_param(&tmp32, 4); m68k_set_reg(M68K_REG_USP,tmp32); + + // MAME Z80 CPU + load_param(&tmp32, 4); z80_set_reg(Z80_PC, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_SP, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_AF, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_BC, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_DE, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_HL, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_IX, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_IY, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_R, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_I, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_AF2, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_BC2, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_DE2, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_HL2, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_IM, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_IFF1,tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_IFF2,tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_HALT,tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_NMI_STATE,tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_IRQ_STATE,tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_DC0, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_DC1, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_DC2, tmp32); + load_param(&tmp32, 4); z80_set_reg(Z80_DC3, tmp32); + + // Remake cache + for (i=0;i<0x800;i++) + { + bg_name_list[i]=i; + bg_name_dirty[i]=0xFF; + } + bg_list_index=0x800; + color_update = color_update_16; + for(i = 0; i < 0x40; i += 1) color_update(i, *(uint16 *)&cram[i << 1]); + color_update(0x00, *(uint16 *)&cram[border << 1]); +} + +int state_save(unsigned char *buffer) +{ + uint32 tmp32; + uint16 tmp16; + unsigned long inbytes, outbytes; + + /* save state */ + bufferptr = 0; + + // gen.c stuff + save_param(work_ram, sizeof(work_ram)); + save_param(zram, sizeof(zram)); + save_param(&zbusreq, sizeof(zbusreq)); + save_param(&zreset, sizeof(zreset)); + save_param(&zbusack, sizeof(zbusack)); + save_param(&zirq, sizeof(zirq)); + save_param(&zbank, sizeof(zbank)); + save_param(&lastbusreqcnt, sizeof(lastbusreqcnt)); + save_param(&lastbusack, sizeof(lastbusack)); + + // io.c stuff + save_param(io_reg, sizeof(io_reg)); + + // render.c stuff + save_param(&object_index_count,sizeof(object_index_count)); + + // vdp.c stuff + save_param(sat, sizeof(sat)); + save_param(vram, sizeof(vram)); + save_param(cram, sizeof(cram)); + save_param(vsram, sizeof(vsram)); + save_param(reg, sizeof(reg)); + save_param(&addr, sizeof(addr)); + save_param(&addr_latch, sizeof(addr_latch)); + save_param(&code, sizeof(code)); + save_param(&pending, sizeof(pending)); + save_param(&status, sizeof(status)); + save_param(&ntab, sizeof(ntab)); + save_param(&ntbb, sizeof(ntbb)); + save_param(&ntwb, sizeof(ntwb)); + save_param(&satb, sizeof(satb)); + save_param(&hscb, sizeof(hscb)); + save_param(&sat_base_mask, sizeof(sat_base_mask)); + save_param(&sat_addr_mask, sizeof(sat_addr_mask)); + save_param(&border, sizeof(border)); + save_param(&playfield_shift, sizeof(playfield_shift)); + save_param(&playfield_col_mask, sizeof(playfield_col_mask)); + save_param(&playfield_row_mask, sizeof(playfield_row_mask)); + save_param(&y_mask, sizeof(y_mask)); + save_param(&hint_pending, sizeof(hint_pending)); + save_param(&vint_pending, sizeof(vint_pending)); + save_param(&h_counter, sizeof(h_counter)); + save_param(&hc_latch, sizeof(hc_latch)); + save_param(&v_counter, sizeof(v_counter)); + save_param(&dmafill, sizeof(dmafill)); + save_param(&im2_flag, sizeof(im2_flag)); + save_param(&frame_end, sizeof(frame_end)); + save_param(&dma_endCycles, sizeof(dma_endCycles)); + + // system.c stuff + save_param(&aim_m68k,sizeof(aim_m68k)); + save_param(&count_m68k,sizeof(count_m68k)); + save_param(&dma_m68k,sizeof(dma_m68k)); + save_param(&aim_z80,sizeof(aim_z80)); + save_param(&count_z80,sizeof(count_z80)); + + // FM stuff + save_param(fm_reg,sizeof(fm_reg)); + save_param(&fm_status,sizeof(fm_status)); + save_param(timer,sizeof(timer)); + + // PSG stuff + save_param(&PSG_MAME,1); + if (PSG_MAME) + { + struct SN76496 *R = &sn[0]; + save_param(R->Register,27*4); + } + else save_param(SN76489_GetContextPtr (0),SN76489_GetContextSize ()); + + // Window size + save_param(&bitmap.viewport.h, sizeof(int)); + save_param(&bitmap.viewport.w, sizeof(int)); + + // 68000 CPU + tmp32 = m68k_get_reg(NULL, M68K_REG_D0); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_D1); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_D2); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_D3); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_D4); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_D5); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_D6); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_D7); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_A0); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_A1); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_A2); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_A3); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_A4); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_A5); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_A6); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_A7); save_param(&tmp32, 4); + tmp32 = m68k_get_reg(NULL, M68K_REG_PC); save_param(&tmp32, 4); + tmp16 = m68k_get_reg(NULL, M68K_REG_SR); save_param(&tmp16, 2); + tmp32 = m68k_get_reg(NULL, M68K_REG_USP); save_param(&tmp32, 4); + + // Z80 CPU + tmp32 = z80_get_reg(Z80_PC); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_SP); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_AF); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_BC); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_DE); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_HL); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_IX); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_IY); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_R); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_I); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_AF2); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_BC2); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_DE2); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_HL2); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_IM); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_IFF1); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_IFF2); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_HALT); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_NMI_STATE); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_IRQ_STATE); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_DC0); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_DC1); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_DC2); save_param(&tmp32, 4); + tmp32 = z80_get_reg(Z80_DC3); save_param(&tmp32, 4); + + inbytes = bufferptr; + +#ifdef NGC + /* compress state file */ + outbytes = 0x24000; + compress2 ((char *) &buffer[sizeof(outbytes)], &outbytes, (char *) &state[0], inbytes, 9); +#else + outbytes = inbytes; + memcpy(&buffer[sizeof(outbytes)], &state[0], outbytes); +#endif + + /* write compressed size in the first 32 bits for decompression */ + memcpy(&buffer[0], &outbytes, sizeof(outbytes)); + + /* return total size */ + return (sizeof(outbytes) + outbytes); +} diff --git a/source/state.h b/source/state.h new file mode 100644 index 0000000..c3bad4d --- /dev/null +++ b/source/state.h @@ -0,0 +1,29 @@ +/**************************************************************************** + * Genesis Plus 1.2a + * + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * STATE MANAGER + ***************************************************************************/ +#ifndef _STATE_H_ +#define _STATE_H_ + +/* Function prototypes */ +void state_load(unsigned char *buffer); +int state_save(unsigned char *buffer); + +#endif diff --git a/source/system.c b/source/system.c new file mode 100644 index 0000000..e6e20c3 --- /dev/null +++ b/source/system.c @@ -0,0 +1,432 @@ +/* + Copyright (C) 1999, 2000, 2001, 2002, 2003 Charles MacDonald + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "shared.h" + +#define CLOCK_NTSC 53693175 +#define CLOCK_PAL 53203424 +#define SND_SIZE (snd.buffer_size * sizeof(int16)) + +t_bitmap bitmap; +t_snd snd; +uint32 aim_m68k = 0; +uint32 count_m68k = 0; +uint32 dma_m68k = 0; +uint32 aim_z80 = 0; +uint32 count_z80 = 0; +uint16 misc68Kcycles = 488; +uint16 miscZ80cycles = 228; +uint16 lines_per_frame = 262; +double CPU_Clock = (double)CLOCK_NTSC; +void *myFM = NULL; +static int sound_tbl[312]; +static int sound_inc[312]; +uint8 alttiming = 0; + +void m68k_run (int cyc) +{ + int cyc_do = cyc - count_m68k; /* cycles remaining to run for the line */ + if (cyc_do > 0) + { + m68k_execute(cyc_do); + count_m68k += cyc_do; + } +} + +void z80_run (int cyc) +{ + int cyc_do = cyc - count_z80; + if (cyc_do > 0) count_z80 += z80_execute(cyc_do); +} + +void m68k_freeze(int cycles) +{ + extern int m68ki_remaining_cycles; + int extra_cycles = cycles - m68k_cycles_remaining(); + + if (extra_cycles > 0) + { + /* end of 68k execution */ + m68ki_remaining_cycles = 0; + + /* extra cycles are burned at next execution */ + count_m68k += extra_cycles; + } + else m68ki_remaining_cycles -= cycles; /* we burn some 68k cycles */ +} + +extern uint8 hq_fm; +int audio_init (int rate) +{ + int i; + int vclk = (int)(CPU_Clock / 7.0); /* 68000 and YM2612 clock */ + int zclk = (int)(CPU_Clock / 15.0); /* Z80 and SN76489 clock */ + + /* Clear the sound data context */ + memset (&snd, 0, sizeof (snd)); + + /* Make sure the requested sample rate is valid */ + if (!rate || ((rate < 8000) | (rate > 48000))) return (0); + + /* Calculate the sound buffer size */ + snd.buffer_size = (rate / vdp_rate); + snd.sample_rate = rate; + + /* Allocate sound buffers */ + if (FM_GENS) + { + snd.fm.gens_buffer[0] = realloc (snd.fm.gens_buffer[0], snd.buffer_size * sizeof (int)); + snd.fm.gens_buffer[1] = realloc (snd.fm.gens_buffer[1], snd.buffer_size * sizeof (int)); + if (!snd.fm.gens_buffer[0] || !snd.fm.gens_buffer[1]) return (-1); + memset (snd.fm.gens_buffer[0], 0, SND_SIZE*2); + memset (snd.fm.gens_buffer[1], 0, SND_SIZE*2); + } + else + { + snd.fm.buffer[0] = realloc (snd.fm.buffer[0], snd.buffer_size * sizeof (int16)); + snd.fm.buffer[1] = realloc (snd.fm.buffer[1], snd.buffer_size * sizeof (int16)); + if (!snd.fm.buffer[0] || !snd.fm.buffer[1]) return (-1); + memset (snd.fm.buffer[0], 0, SND_SIZE); + memset (snd.fm.buffer[1], 0, SND_SIZE); + } + + snd.psg.buffer = realloc (snd.psg.buffer, snd.buffer_size * sizeof (int16)); + if (!snd.psg.buffer) return (-1); + memset (snd.psg.buffer, 0, SND_SIZE); + + /* Set audio enable flag */ + snd.enabled = 1; + + /* Initialize sound chip emulation */ + if (PSG_MAME) SN76496_sh_start(zclk, 0, rate); + else + { + SN76489_Init(0, zclk, rate); + SN76489_Config(0, MUTE_ALLON, VOL_FULL, FB_SEGAVDP, SRW_SEGAVDP, 0); + } + + if (FM_GENS) YM2612_Init(vclk, rate, hq_fm); + else if (!myFM) myFM = YM2612Init (0, 0, vclk, rate, 0, 0); + + /* Make sound table */ + for (i = 0; i < lines_per_frame; i++) + { + float p = (snd.buffer_size * i) / lines_per_frame; + float q = (snd.buffer_size * (i+1)) / lines_per_frame; + sound_tbl[i] = p; + sound_inc[i] = ((q - p) * 1000000) / snd.sample_rate; + } + return (0); +} + +void system_init (void) +{ + /* PAL or NTSC timings */ + vdp_rate = (vdp_pal) ? 50 : 60; + lines_per_frame = (vdp_pal) ? 313 : 262; + CPU_Clock = (vdp_pal) ? (double)CLOCK_PAL : (double)CLOCK_NTSC; + miscZ80cycles = (vdp_pal) ? 227 : 228; + misc68Kcycles = (vdp_pal) ? 487 : 488; + + gen_init (); + vdp_init (); + render_init (); + sound_init(); +} + +void system_reset (void) +{ + aim_m68k = 0; + count_m68k = 0; + dma_m68k = 0; + aim_z80 = 0; + count_z80 = 0; + + gen_reset (); + io_reset(); + vdp_reset (); + render_reset (); + + if (snd.enabled) + { + fm_reset(); + if (FM_GENS) + { + memset (snd.fm.gens_buffer[0], 0, SND_SIZE*2); + memset (snd.fm.gens_buffer[1], 0, SND_SIZE*2); + } + else + { + memset (snd.fm.buffer[0], 0, SND_SIZE); + memset (snd.fm.buffer[1], 0, SND_SIZE); + } + + if (!PSG_MAME) SN76489_Reset(0); + memset (snd.psg.buffer, 0, SND_SIZE); + } +} + +void system_shutdown (void) +{ + gen_shutdown (); + vdp_shutdown (); + render_shutdown (); +} + +int system_frame (int do_skip) +{ + /* update total cycles count */ + dma_m68k += count_m68k; + + /* reset line cycles counts */ + aim_m68k = 0; + count_m68k = 0; + aim_z80 = 0; + count_z80 = 0; + lastbusreqcnt = -1000; + + if (!gen_running) return 0; + + /* Clear V-Blank flag */ + status &= 0xFFF7; + + /* Toggle even/odd flag (IM2 only) */ + if (im2_flag) status ^= 0x0010; + + /* Reset HCounter */ + h_counter = reg[10]; + + /* Point to start of sound buffer */ + snd.fm.lastStage = snd.fm.curStage = 0; + snd.psg.lastStage = snd.psg.curStage = 0; + + /* Parse sprites for line 0 (done on line 261 or 312) */ + parse_satb (0x80); + + /* Line processing */ + for (v_counter = 0; v_counter < lines_per_frame; v_counter ++) + { + /* update cpu cycles goal for the line */ + aim_z80 += miscZ80cycles; + aim_m68k += misc68Kcycles; + + /* 6-Buttons or Menacer update */ + input_update(); + + /* If a Z80 interrupt is still pending after a scanline, cancel it */ + if (zirq) + { + zirq = 0; + z80_set_irq_line(0, CLEAR_LINE); + } + + /* H Int */ + if (v_counter <= frame_end) + { + if(--h_counter < 0) + { + h_counter = reg[10]; + hint_pending = 1; + if(reg[0] & 0x10) m68k_set_irq(4); + } + } + + /* Render a line of the display if needed */ + if (do_skip == 0 && !alttiming) + { + if (v_counter < frame_end) render_line(v_counter); + if (v_counter < (frame_end-1)) parse_satb(0x81 + v_counter); + } + + /* H retrace */ + status |= 0x0004; // HBlank = 1 + m68k_run(aim_m68k - 404); + status &= 0xFFFB; // HBlank = 0 + + if (do_skip == 0 && alttiming) /* hack for Legend of Galahad and Road Rash serie (one-line glitch)*/ + { + if (v_counter < frame_end) render_line(v_counter); + if (v_counter < (frame_end-1)) parse_satb(0x81 + v_counter); + } + + if (v_counter == frame_end) + { + /* V Retrace */ + status |= 0x0008; // VBlank = 1 + m68k_run(aim_m68k - 360); + if (zreset == 1 && zbusreq == 0) z80_run(aim_z80 - 168); + else count_z80 = aim_z80 - 168; + + /* V Int */ + status |= 0x0080; + vint_pending = 1; + if (reg[1] & 0x20) m68k_set_irq(6); + + /* Z Int */ + if (zreset == 1 && zbusreq == 0) + { + zirq = 1; + z80_set_irq_line(0, ASSERT_LINE); + } + } + + /* Process end of line */ + m68k_run(aim_m68k); + if (zreset == 1 && zbusreq == 0) z80_run(aim_z80); + else count_z80 = aim_z80; + + /* Update sound buffers and timers */ + fm_update_timers (sound_inc[v_counter]); + snd.fm.curStage = sound_tbl[v_counter]; + snd.psg.curStage = sound_tbl[v_counter]; + } + + if (snd.enabled) audio_update (); + return gen_running; +} + +#ifdef NGC +/**************************************************************************** + * softdev - 09 Mar 2006 + * + * + * Nintendo Gamecube Specific Mixer from here on in ... + ****************************************************************************/ +extern unsigned char soundbuffer[16][3840]; +extern int mixbuffer; +extern double psg_preamp; +extern double fm_preamp; +extern u8 boost; +static int ll, rr; + +void audio_update (void) +{ + int i; + int l, r; + int16 *tempBuffer[2]; + int16 *sb = (int16 *) soundbuffer[mixbuffer]; + + /* get remaining samples */ + /* YM2612 */ + if (FM_GENS) + { + int *fmBuffer[2]; + fmBuffer[0] = snd.fm.gens_buffer[0] + snd.fm.lastStage; + fmBuffer[1] = snd.fm.gens_buffer[1] + snd.fm.lastStage; + YM2612_Update(fmBuffer, snd.buffer_size - snd.fm.lastStage); + } + else + { + tempBuffer[0] = snd.fm.buffer[0] + snd.fm.lastStage; + tempBuffer[1] = snd.fm.buffer[1] + snd.fm.lastStage; + YM2612UpdateOne (myFM, tempBuffer, snd.buffer_size - snd.fm.lastStage); + } + + /* PSG */ + tempBuffer[0] = snd.psg.buffer + snd.psg.lastStage; + if (PSG_MAME) SN76496Update (0, tempBuffer[0], snd.buffer_size - snd.psg.lastStage); + else SN76489_Update(0, tempBuffer[0], snd.buffer_size - snd.psg.lastStage); + + /* mix samples */ + for (i = 0; i < snd.buffer_size; i ++) + { + /* PSG */ + l = r = (int) ((double)snd.psg.buffer[i] * psg_preamp); + + if (FM_GENS) + { + l += (int) ((double)snd.fm.gens_buffer[0][i] * fm_preamp); + r += (int) ((double)snd.fm.gens_buffer[1][i] * fm_preamp); + snd.fm.gens_buffer[0][i] = 0; + snd.fm.gens_buffer[1][i] = 0; + } + else + { + l += (int) ((double)snd.fm.buffer[0][i] * fm_preamp); + r += (int) ((double)snd.fm.buffer[1][i] * fm_preamp); + } + + /* single-pole low-pass filter (6 dB/octave) */ + ll = (ll + l) >> 1; + rr = (rr + r) >> 1; + + l = ll * boost; + r = rr * boost; + + /* clipping */ + if (l > 32767) l = 32767; + else if (l < -32768) l = -32768; + if (r > 32767) r = 32767; + else if (r < -32768) r = -32768; + + *sb++ = l; + *sb++ = r; + } + + mixbuffer++; + mixbuffer &= 0xf; +} +#else +void audio_update (void) +{ + int i; + int16 acc; + int16 *tempBuffer[2]; + + if (FM_GENS) + { + int *fmBuffer[2]; + fmBuffer[0] = snd.fm.gens_buffer[0] + snd.fm.lastStage; + fmBuffer[1] = snd.fm.gens_buffer[1] + snd.fm.lastStage; + YM2612_Update(fmBuffer, snd.buffer_size - snd.fm.lastStage); + } + else + { + tempBuffer[0] = snd.fm.buffer[0] + snd.fm.lastStage; + tempBuffer[1] = snd.fm.buffer[1] + snd.fm.lastStage; + YM2612UpdateOne (myFM, tempBuffer, snd.buffer_size - snd.fm.lastStage); + } + + tempBuffer[0] = snd.psg.buffer + snd.psg.lastStage; + if (PSG_MAME) SN76496Update (0, tempBuffer[0], snd.buffer_size - snd.psg.lastStage); + else SN76489_Update(0, tempBuffer[0], snd.buffer_size - snd.psg.lastStage); + + for (i = 0; i < snd.buffer_size; i += 1) + { + int16 psg = snd.psg.buffer[i] / 2; + + acc = 0; + acc += FM_GENS ? snd.fm.gens_buffer[0][i] : snd.fm.buffer[0][i]; + acc += psg; + snd.buffer[0][i] = acc; + + acc = 0; + acc += FM_GENS ? snd.fm.gens_buffer[1][i] : snd.fm.buffer[1][i]; + acc += psg; + snd.buffer[1][i] = acc; + + if (FM_GENS) + { + snd.fm.gens_buffer[0][i] = 0; + snd.fm.gens_buffer[1][i] = 0; + } + + } +} +#endif + diff --git a/source/system.h b/source/system.h new file mode 100644 index 0000000..3bfb2ba --- /dev/null +++ b/source/system.h @@ -0,0 +1,74 @@ + +#ifndef _SYSTEM_H_ +#define _SYSTEM_H_ + +typedef struct +{ + uint8 *data; /* Bitmap data */ + int width; /* Bitmap width (32+512+32) */ + int height; /* Bitmap height (256) */ + int depth; /* Color depth (8 bits) */ + int pitch; /* Width of bitmap in bytes */ + int granularity; /* Size of each pixel in bytes */ + int remap; /* 1= Translate pixel data */ + struct + { + int x; /* X offset of viewport within bitmap */ + int y; /* Y offset of viewport within bitmap */ + int w; /* Width of viewport */ + int h; /* Height of viewport */ + int ow; /* Previous width of viewport */ + int oh; /* Previous height of viewport */ + int changed; /* 1= Viewport width or height have changed */ + } viewport; +} t_bitmap; + + +typedef struct +{ + int sample_rate; /* Sample rate (8000-44100) */ + int enabled; /* 1= sound emulation is enabled */ + int buffer_size; /* Size of sound buffer (in bytes) */ + int16 *buffer[2]; /* Signed 16-bit stereo sound data */ + struct + { + int curStage; + int lastStage; + int *gens_buffer[2]; + int16 *buffer[2]; + } fm; + struct + { + int curStage; + int lastStage; + int16 *buffer; + } psg; +} t_snd; + +/* Global variables */ +extern t_bitmap bitmap; +extern t_snd snd; +extern uint8 initialized; +extern uint32 aim_m68k; +extern uint32 count_m68k; +extern uint32 dma_m68k; +extern uint32 aim_z80; +extern uint32 count_z80; +extern uint16 misc68Kcycles; +extern uint16 miscZ80cycles; +extern uint16 lines_per_frame; +extern double CPU_Clock; + +/* Function prototypes */ +void system_init (void); +void system_reset (void); +void system_shutdown (void); +int system_frame(int skip); +void m68k_run (int cyc); +void z80_run (int cyc); +void m68k_freeze(int cycles); +int audio_init (int rate); +void audio_update (void); + +#endif /* _SYSTEM_H_ */ + diff --git a/source/types.h b/source/types.h new file mode 100644 index 0000000..8436c5e --- /dev/null +++ b/source/types.h @@ -0,0 +1,13 @@ + +#ifndef _TYPES_H_ +#define _TYPES_H_ + +typedef unsigned char uint8; +typedef unsigned short int uint16; +typedef unsigned long int uint32; + +typedef signed char int8; +typedef signed short int int16; +typedef signed long int int32; + +#endif /* _TYPES_H_ */ diff --git a/source/unused/dos/SEALINTF.C b/source/unused/dos/SEALINTF.C new file mode 100644 index 0000000..3be0dbc --- /dev/null +++ b/source/unused/dos/SEALINTF.C @@ -0,0 +1,288 @@ + +#include "osd.h" + +int seal_sample_rate = 44100; +int seal_sound_card = -1; + +HAC hVoice[NUMVOICES]; +LPAUDIOWAVE lpWave[NUMVOICES]; +AUDIOINFO info; +AUDIOCAPS caps; +int c[MAX_STREAM_CHANNELS]; +int nominal_sample_rate; +static int attenuation = 0; +static int master_volume = 256; + + +void osd_update_audio(void) +{ + if (seal_sample_rate == 0) return; + AUpdateAudio(); +} + + +/* attenuation in dB */ +void osd_set_mastervolume(int _attenuation) +{ + float volume; + + attenuation = _attenuation; + + volume = 256.0; /* range is 0-256 */ + while (_attenuation++ < 0) + volume /= 1.122018454; /* = (10 ^ (1/20)) = 1dB */ + + master_volume = volume; + + ASetAudioMixerValue(AUDIO_MIXER_MASTER_VOLUME,master_volume); +} + + +int msdos_init_sound(int *rate, int card) +{ + int i; + + seal_sample_rate = *rate; + seal_sound_card = card; + + if (AInitialize() != AUDIO_ERROR_NONE) + return 1; + + /* Ask the user if no sound card was chosen */ + if (seal_sound_card == -1) + { + unsigned int k; + + printf("\n SELECT YOUR AUDIO DEVICE :\n\n" + " AWE32/64 playback requires onboard DRAM,\n" + " Sound Blaster playback is the most compatible & better for emulation\n\n"); + + for (k = 0;k < AGetAudioNumDevs();k++) + { + if (AGetAudioDevCaps(k,&caps) == AUDIO_ERROR_NONE) + printf(" %2d. %s\n",k,caps.szProductName); + } + printf("\n"); + + if (k < 10) + { + i = getch(); + seal_sound_card = i - '0'; + } + else + scanf("%d",&seal_sound_card); + } + + /* initialize SEAL audio library */ + if (seal_sound_card == 0) /* silence */ + { + /* update the Machine structure to show that sound is disabled */ + seal_sample_rate = 0; + exit(0); + return 0; + } + + /* open audio device */ + /* info.nDeviceId = AUDIO_DEVICE_MAPPER;*/ + info.nDeviceId = seal_sound_card; + /* always use 16 bit mixing if possible - better quality and same speed of 8 bit */ + info.wFormat = AUDIO_FORMAT_16BITS | AUDIO_FORMAT_STEREO | AUDIO_FORMAT_RAW_SAMPLE; + + info.nSampleRate = seal_sample_rate; + if (AOpenAudio(&info) != AUDIO_ERROR_NONE) + { + return (1); + } + + AGetAudioDevCaps(info.nDeviceId,&caps); + printf("Using `%s' at %d-bit %s %u Hz\n", + caps.szProductName, + info.wFormat & AUDIO_FORMAT_16BITS ? 16 : 8, + info.wFormat & AUDIO_FORMAT_STEREO ? "stereo" : "mono", + info.nSampleRate); + + /* open and allocate voices, allocate waveforms */ + if (AOpenVoices(NUMVOICES) != AUDIO_ERROR_NONE) + { + printf("voices initialization failed\n"); + return 1; + } + + for (i = 0; i < NUMVOICES; i++) + { + if (ACreateAudioVoice(&hVoice[i]) != AUDIO_ERROR_NONE) + { + printf("voice #%d creation failed\n",i); + return 1; + } + + ASetVoicePanning(hVoice[i],128); + + lpWave[i] = 0; + } + + /* update the Machine structure to reflect the actual sample rate */ + *rate = seal_sample_rate = info.nSampleRate; + + { + uclock_t a,b; + LONG start,end; + + + if ((lpWave[0] = (LPAUDIOWAVE)malloc(sizeof(AUDIOWAVE))) == 0) + return 1; + + lpWave[0]->wFormat = AUDIO_FORMAT_8BITS | AUDIO_FORMAT_MONO; + lpWave[0]->nSampleRate = seal_sample_rate; + lpWave[0]->dwLength = 3*seal_sample_rate; + lpWave[0]->dwLoopStart = 0; + lpWave[0]->dwLoopEnd = 3*seal_sample_rate; + if (ACreateAudioData(lpWave[0]) != AUDIO_ERROR_NONE) + { + free(lpWave[0]); + lpWave[0] = 0; + + return 1; + } + + memset(lpWave[0]->lpData,0,3*seal_sample_rate); + /* upload the data to the audio DRAM local memory */ + AWriteAudioData(lpWave[0],0,3*seal_sample_rate); + APrimeVoice(hVoice[0],lpWave[0]); + ASetVoiceFrequency(hVoice[0],seal_sample_rate); + ASetVoiceVolume(hVoice[0],0); + AStartVoice(hVoice[0]); + + a = uclock(); + /* wait some time to let everything stabilize */ + do + { + osd_update_audio(); + b = uclock(); + } while (b-a < UCLOCKS_PER_SEC/10); + + a = uclock(); + AGetVoicePosition(hVoice[0],&start); + do + { + osd_update_audio(); + b = uclock(); + } while (b-a < UCLOCKS_PER_SEC); + AGetVoicePosition(hVoice[0],&end); + + nominal_sample_rate = seal_sample_rate; + seal_sample_rate = end - start; + + AStopVoice(hVoice[0]); + ADestroyAudioData(lpWave[0]); + free(lpWave[0]); + lpWave[0] = 0; + } + + osd_set_mastervolume(0); /* start at maximum volume */ + + return 0; +} + + +void msdos_shutdown_sound(void) +{ + if (seal_sample_rate != 0) + { + int n; + + /* stop and release voices */ + for (n = 0; n < NUMVOICES; n++) + { + AStopVoice(hVoice[n]); + ADestroyAudioVoice(hVoice[n]); + if (lpWave[n]) + { + ADestroyAudioData(lpWave[n]); + free(lpWave[n]); + lpWave[n] = 0; + } + } + ACloseVoices(); + ACloseAudio(); + } +} + + +void playstreamedsample(int channel,signed char *data,int len,int freq,int volume,int pan,int bits) +{ + static int playing[NUMVOICES]; + static int c[NUMVOICES]; + + /* backwards compatibility with old 0-255 volume range */ + if (volume > 100) volume = volume * 25 / 255; + + if (seal_sample_rate == 0 || channel >= NUMVOICES) return; + + if (!playing[channel]) + { + if (lpWave[channel]) + { + AStopVoice(hVoice[channel]); + ADestroyAudioData(lpWave[channel]); + free(lpWave[channel]); + lpWave[channel] = 0; + } + + if ((lpWave[channel] = (LPAUDIOWAVE)malloc(sizeof(AUDIOWAVE))) == 0) + return; + + lpWave[channel]->wFormat = (bits == 8 ? AUDIO_FORMAT_8BITS : AUDIO_FORMAT_16BITS) + | AUDIO_FORMAT_MONO | AUDIO_FORMAT_LOOP; + lpWave[channel]->nSampleRate = nominal_sample_rate; + lpWave[channel]->dwLength = 3*len; + lpWave[channel]->dwLoopStart = 0; + lpWave[channel]->dwLoopEnd = 3*len; + if (ACreateAudioData(lpWave[channel]) != AUDIO_ERROR_NONE) + { + free(lpWave[channel]); + lpWave[channel] = 0; + + return; + } + + memset(lpWave[channel]->lpData,0,3*len); + memcpy(lpWave[channel]->lpData,data,len); + /* upload the data to the audio DRAM local memory */ + AWriteAudioData(lpWave[channel],0,3*len); + APrimeVoice(hVoice[channel],lpWave[channel]); + /* need to cast to double because freq*nominal_sample_rate can exceed the size of an int */ + ASetVoiceFrequency(hVoice[channel],(double)freq*nominal_sample_rate/seal_sample_rate); + AStartVoice(hVoice[channel]); + playing[channel] = 1; + c[channel] = 1; + } + else + { + LONG pos; + + for(;;) + { + AGetVoicePosition(hVoice[channel],&pos); + if (c[channel] == 0 && pos >= len) break; + if (c[channel] == 1 && (pos < len || pos >= 2*len)) break; + if (c[channel] == 2 && pos < 2*len) break; + osd_update_audio(); + } + + memcpy(&lpWave[channel]->lpData[len * c[channel]],data,len); + AWriteAudioData(lpWave[channel],len*c[channel],len); + c[channel]++; + if (c[channel] == 3) c[channel] = 0; + } + + + ASetVoiceVolume(hVoice[channel],volume * 64 / 100); + ASetVoicePanning(hVoice[channel],(pan + 100) * 255 / 200); +} + +void osd_play_streamed_sample_16(int channel,signed short *data,int len,int freq,int volume,int pan) +{ + playstreamedsample(channel,(signed char *)data,len,freq,volume,pan,16); +} + diff --git a/source/unused/dos/SEALINTF.H b/source/unused/dos/SEALINTF.H new file mode 100644 index 0000000..368ab71 --- /dev/null +++ b/source/unused/dos/SEALINTF.H @@ -0,0 +1,17 @@ + +#ifndef _SEALINTF_H_ +#define _SEALINTF_H_ + +#define MAX_SOUND 4 +#define NUMVOICES 16 +#define MAX_STREAM_CHANNELS 6 + +/* Function prototypes */ +void osd_update_audio(void); +void osd_set_mastervolume(int _attenuation); +int msdos_init_sound(int *rate, int card); +void msdos_shutdown_sound(void); +void playstreamedsample(int channel,signed char *data,int len,int freq,int volume,int pan,int bits); +void osd_play_streamed_sample_16(int channel,signed short *data,int len,int freq,int volume,int pan); + +#endif /* _SEALINTF_H_ */ diff --git a/source/unused/dos/config.c b/source/unused/dos/config.c new file mode 100644 index 0000000..06c1fb7 --- /dev/null +++ b/source/unused/dos/config.c @@ -0,0 +1,256 @@ + +#include "osd.h" + +t_option option; + +void do_config(char *file) +{ + extern int __crt0_argc; + extern char **__crt0_argv; + + /* Our token list */ + int i, argc; + char *argv[TOKEN_LIST_SIZE]; + + set_option_defaults(); + for(i = 0; i < TOKEN_LIST_SIZE; i += 1) argv[i] = NULL; + + /* Check configuration file */ + if(file) parse_file(file, &argc, argv); + + /* Check extracted tokens */ + parse_args(argc, argv); + + /* Free token list */ + for(i = 0; i < argc; i += 1) if(argv[argc]) free (argv[argc]); + + /* Check command line */ + parse_args(__crt0_argc, __crt0_argv); +} + + +/* Parse configuration file */ +int parse_file(char *filename, int *argc, char **argv) +{ + char token[0x100]; + FILE *handle = NULL; + + *argc = 0; + handle = fopen(filename, "r"); + if(!handle) return (0); + + fscanf(handle, "%s", &token[0]); + while(!(feof(handle))) + { + int size = strlen(token) + 1; + argv[*argc] = malloc(size); + if(!argv[*argc]) return (0); + strcpy(argv[*argc], token); + *argc += 1; + fscanf(handle, "%s", &token[0]); + } + + if(handle) fclose(handle); + return (1); +} + + +int check_bool(char *token) +{ + int result = 1; + if(stricmp("off", token) == 0) + result = 0; + if(stricmp("no", token) == 0) + result = 0; + return (result); +} + + +void set_option_defaults(void) +{ + option.video_driver = GFX_AUTODETECT; + option.video_width = 320; + option.video_height = 240; + option.video_depth = 8; + + option.remap = 0; + option.scanlines = 0; + option.scale = 0; + + option.vsync = 0; + option.throttle = 0; + option.skip = 1; + + option.sound = 0; + option.sndcard = -1; + option.sndrate = 44100; + option.swap = 0; + + option.joy_driver = JOY_TYPE_AUTODETECT; +} + + +void print_options(void) +{ + printf(" -vdriver \t Select video driver (auto)\n"); + printf(" -res \t Specify display resolution (320x240)\n"); + printf(" -depth \t Specify display depth (8)\n"); + printf(" -remap \t Enable raster-based palette effects (8-bit color only)\n"); + printf(" -scanlines \t Enable scanlines effect\n"); + printf(" -scale \t Scale display to width of screen\n"); + printf(" -vsync \t Enable vsync polling\n"); + printf(" -throttle \t Enable speed throttling\n"); + printf(" -skip \t Specify frame skip level (1=no frames skipped)\n"); + printf(" -sound \t Enable sound output\n"); + printf(" -sndcard \t Select sound card\n"); + printf(" -sndrate \t Specify sound sample rate (8000-44100)\n"); + printf(" -swap \t Swap left and right channels\n"); + printf(" -joy \t Select joystick driver (auto)\n"); +} + + +void parse_args(int argc, char **argv) +{ + int i, j; + + for(i = 0; i < argc; i += 1) + { + if(stricmp("-vdriver", argv[i]) == 0) + { + for(j = 0; video_driver_table[j].token != NULL; j += 1) + { + if(stricmp(argv[i+1], video_driver_table[j].token) == 0) + { + option.video_driver = video_driver_table[j].value; + } + } + } + + if(stricmp("-res", argv[i]) == 0) + { + option.video_width = atoi(argv[i+1]); + option.video_height = atoi(argv[i+2]); + } + + if(stricmp("-depth", argv[i]) == 0) + { + option.video_depth = atoi(argv[i+1]); + } + + if(stricmp("-remap", argv[i]) == 0) + { + option.remap = check_bool(argv[i+1]); + } + + if(stricmp("-scanlines", argv[i]) == 0) + { + option.scanlines = check_bool(argv[i+1]); + } + + if(stricmp("-scale", argv[i]) == 0) + { + option.scale = check_bool(argv[i+1]); + } + + if(stricmp("-vsync", argv[i]) == 0) + { + option.vsync = check_bool(argv[i+1]); + } + + if(stricmp("-throttle", argv[i]) == 0) + { + option.throttle = check_bool(argv[i+1]); + } + + if(stricmp("-skip", argv[i]) == 0) + { + option.skip = atoi(argv[i+1]); + if(!option.skip) option.skip = 1; + } + + if(stricmp("-sound", argv[i]) == 0) + { + option.sound = check_bool(argv[i+1]); + } + + if(stricmp("-sndcard", argv[i]) == 0) + { + option.sndcard = atoi(argv[i+1]); + } + + if(stricmp("-sndrate", argv[i]) == 0) + { + option.sndrate = atoi(argv[i+1]); + } + + if(stricmp("-swap", argv[i]) == 0) + { + option.swap = check_bool(argv[i+1]); + } + + if(stricmp("-joy", argv[i]) == 0) + { + for(j = 0; joy_driver_table[j].token != NULL; j += 1) + { + if(stricmp(argv[i+1], joy_driver_table[j].token) == 0) + { + option.joy_driver = joy_driver_table[j].value; + } + } + } + } + + if(option.remap) option.video_depth = 8; +} + + +t_strint video_driver_table[] = +{ + { "auto", GFX_AUTODETECT }, + { "safe", GFX_SAFE }, + { "vga", GFX_VGA }, + { "modex", GFX_MODEX }, + { "vesa2l", GFX_VESA2L }, + { "vesa3", GFX_VESA3 }, + { "vbeaf", GFX_VBEAF }, + { NULL, 0 } +}; + + +t_strint joy_driver_table[] = +{ + { "auto", JOY_TYPE_AUTODETECT }, + { "none", JOY_TYPE_NONE }, + { "standard", JOY_TYPE_STANDARD }, + { "2pads", JOY_TYPE_2PADS }, + { "4button", JOY_TYPE_4BUTTON }, + { "6button", JOY_TYPE_6BUTTON }, + { "8button", JOY_TYPE_8BUTTON }, + { "fspro", JOY_TYPE_FSPRO }, + { "wingex", JOY_TYPE_WINGEX }, + { "sidewinder", JOY_TYPE_SIDEWINDER }, + { "gamepadpro", JOY_TYPE_GAMEPAD_PRO }, + { "grip", JOY_TYPE_GRIP }, + { "grip4", JOY_TYPE_GRIP4 }, + { "sneslpt1", JOY_TYPE_SNESPAD_LPT1 }, + { "sneslpt2", JOY_TYPE_SNESPAD_LPT2 }, + { "sneslpt3", JOY_TYPE_SNESPAD_LPT3 }, + { "psxlpt1", JOY_TYPE_PSXPAD_LPT1 }, + { "psxlpt2", JOY_TYPE_PSXPAD_LPT2 }, + { "psxlpt3", JOY_TYPE_PSXPAD_LPT3 }, + { "n64lpt1", JOY_TYPE_N64PAD_LPT1 }, + { "n64lpt2", JOY_TYPE_N64PAD_LPT2 }, + { "n64lpt3", JOY_TYPE_N64PAD_LPT3 }, + { "db9lpt1", JOY_TYPE_DB9_LPT1 }, + { "db9lpt2", JOY_TYPE_DB9_LPT2 }, + { "db9lpt3", JOY_TYPE_DB9_LPT3 }, + { "tglpt1", JOY_TYPE_TURBOGRAFX_LPT1 }, + { "tglpt2", JOY_TYPE_TURBOGRAFX_LPT2 }, + { "tglpt3", JOY_TYPE_TURBOGRAFX_LPT3 }, + { "wingwar", JOY_TYPE_WINGWARRIOR }, + { "segaisa", JOY_TYPE_IFSEGA_ISA}, + { "segapci", JOY_TYPE_IFSEGA_PCI}, + { "segapci2", JOY_TYPE_IFSEGA_PCI_FAST}, + { NULL, 0 } +}; + diff --git a/source/unused/dos/config.h b/source/unused/dos/config.h new file mode 100644 index 0000000..a8d4118 --- /dev/null +++ b/source/unused/dos/config.h @@ -0,0 +1,65 @@ + +#ifndef _CONFIG_H_ +#define _CONFIG_H_ + +#define PATH_SIZE (0x100) +#define TOKEN_LIST_SIZE (0x20) + +typedef struct +{ + char *token; + int value; +}t_strint; + +typedef struct +{ + int video_width; + int video_height; + int video_depth; + int video_driver; + + int autores; + int autores_w; + int autores_h; + + int remap; + int blur; + int scanlines; + int scale; + + int vsync; + int throttle; + int fps; + int skip; + + int sound; + int sndcard; + int sndrate; + int swap; + + int wave; + char wavpath[PATH_SIZE]; + + int joy_driver; + + int split; /* 1= Split image at 2 megabit boundary */ + int flip; /* 1= Bit-flip image */ + int usa; /* 1= Set D6 of $1000 to indicate US machine */ + int softres; /* 1= Allow RUN+SELECT */ +} t_option; + +/* Global variables */ +extern t_option option; +extern t_strint video_driver_table[]; +extern t_strint joy_driver_table[]; + +/* Function prototypes */ +void do_config(char *file); +int parse_file(char *filename, int *argc, char **argv); +void parse_args(int argc, char **argv); +void print_options(void); +int check_bool(char *token); +void set_option_defaults(void); + +#endif /* _CONFIG_H_ */ + diff --git a/source/unused/dos/dos.c b/source/unused/dos/dos.c new file mode 100644 index 0000000..d85c087 --- /dev/null +++ b/source/unused/dos/dos.c @@ -0,0 +1,466 @@ +/* + dos.c -- + DOS interface code for the emulator +*/ + +#include "osd.h" + +#define FRAMES_PER_SECOND 60 + +RGB vdp_palette[3][0x200]; +PALETTE gen_pal; +BITMAP *gen_bmp; + +volatile int frame_skip = 1; +volatile int frame_count = 0; +volatile int frames_rendered = 0; +volatile int frame_rate = 0; +volatile int tick_count = 0; +volatile int old_tick_count = 0; +volatile int skip = 0; + +int quit = 0; + +int main (int argc, char *argv[]) +{ + if(argc < 2) { + printf("Genesis Plus - Sega Mega Drive emulator (v1.0)\n"); + printf("(C) 1999, 2000, 2001, 2002, 2003 Charles MacDonald\n"); + printf("Usage %s file.[bin|smd|zip] [-options]\n", argv[0]); + printf("Type `%s -help' for a list of options.\n", argv[0]); + exit(1); + }; + + if(stricmp(argv[1], "-help") == 0) + { + print_options(); + return (0); + } + + if(!load_rom(argv[1])) + { + printf("File `%s' not found.\n", argv[1]); + return (0); + } + + init_machine(); + + error_init(); + system_init(); + + if(option.sound) + { + audio_init(option.sndrate); + } + + system_reset(); + + + for(;;) + { + frame_count += 1; + if(quit) break; + dos_update_input(); + if(frame_count % frame_skip == 0) + { + system_frame(0); + dos_update_video(); + } + else + { + system_frame(1); + } + if(option.sound) dos_update_audio(); + } + + trash_machine(); + system_shutdown(); + error_shutdown(); + return (0); +} + +/* Timer handler */ +void tick_handler(void) +{ + tick_count += 1; + if(tick_count % FRAMES_PER_SECOND == 0) + { + frame_rate = frames_rendered; + frames_rendered = 0; + } +} +END_OF_FUNCTION(tick_handler); + + +int load_file(char *filename, char *buf, int size) +{ + FILE *fd = fopen(filename, "rb"); + if(!fd) return (0); + fread(buf, size, 1, fd); + fclose(fd); + return (1); +} + +int save_file(char *filename, char *buf, int size) +{ + FILE *fd = NULL; + if(!(fd = fopen(filename, "wb"))) return (0); + fwrite(buf, size, 1, fd); + fclose(fd); + return (1); +} + + +void dos_update_input(void) +{ + if(key[KEY_ESC] || key[KEY_END]) + { + quit = 1; + } + + input.pad[0] = 0; + + /* Is the joystick being used ? */ + if(option.joy_driver != JOY_TYPE_NONE) + { + poll_joystick(); + + /* Check player 1 joystick */ + if(joy[0].stick[0].axis[1].d1) input.pad[0] |= INPUT_UP; + else + if(joy[0].stick[0].axis[1].d2) input.pad[0] |= INPUT_DOWN; + + if(joy[0].stick[0].axis[0].d1) input.pad[0] |= INPUT_LEFT; + else + if(joy[0].stick[0].axis[0].d2) input.pad[0] |= INPUT_RIGHT; + + if(joy[0].button[0].b) input.pad[0] |= INPUT_A; + if(joy[0].button[1].b) input.pad[0] |= INPUT_B; + if(joy[0].button[2].b) input.pad[0] |= INPUT_C; + if(joy[0].button[3].b) input.pad[0] |= INPUT_START; + if(joy[0].button[4].b) input.pad[0] |= INPUT_X; + if(joy[0].button[5].b) input.pad[0] |= INPUT_Y; + if(joy[0].button[6].b) input.pad[0] |= INPUT_Z; + if(joy[0].button[7].b) input.pad[0] |= INPUT_MODE; + + /* More than one joystick supported ? */ + if(num_joysticks > 2) + { + /* Check player 2 joystick */ + if(joy[1].stick[0].axis[1].d1) input.pad[1] |= INPUT_UP; + else + if(joy[1].stick[0].axis[1].d2) input.pad[1] |= INPUT_DOWN; + + if(joy[1].stick[0].axis[0].d1) input.pad[1] |= INPUT_LEFT; + else + if(joy[1].stick[0].axis[0].d1) input.pad[1] |= INPUT_RIGHT; + + if(joy[1].button[0].b) input.pad[1] |= INPUT_A; + if(joy[1].button[1].b) input.pad[1] |= INPUT_B; + if(joy[1].button[2].b) input.pad[1] |= INPUT_C; + if(joy[1].button[3].b) input.pad[1] |= INPUT_START; + if(joy[1].button[4].b) input.pad[1] |= INPUT_X; + if(joy[1].button[5].b) input.pad[1] |= INPUT_Y; + if(joy[1].button[6].b) input.pad[1] |= INPUT_Z; + if(joy[1].button[7].b) input.pad[1] |= INPUT_MODE; + } + } + + if(key[KEY_UP]) input.pad[0] |= INPUT_UP; + else + if(key[KEY_DOWN]) input.pad[0] |= INPUT_DOWN; + if(key[KEY_LEFT]) input.pad[0] |= INPUT_LEFT; + else + if(key[KEY_RIGHT]) input.pad[0] |= INPUT_RIGHT; + + if(key[KEY_A]) input.pad[0] |= INPUT_A; + if(key[KEY_S]) input.pad[0] |= INPUT_B; + if(key[KEY_D]) input.pad[0] |= INPUT_C; + if(key[KEY_F]) input.pad[0] |= INPUT_START; + if(key[KEY_Z]) input.pad[0] |= INPUT_X; + if(key[KEY_X]) input.pad[0] |= INPUT_Y; + if(key[KEY_C]) input.pad[0] |= INPUT_Z; + if(key[KEY_V]) input.pad[0] |= INPUT_MODE; + + if(check_key(KEY_TAB)) + system_reset(); + + if(check_key(KEY_F1)) frame_skip = 1; + if(check_key(KEY_F2)) frame_skip = 2; + if(check_key(KEY_F3)) frame_skip = 3; + if(check_key(KEY_F4)) frame_skip = 4; +} + +void dos_update_audio(void) +{ + osd_play_streamed_sample_16(option.swap ^ 0, snd.buffer[0], snd.buffer_size * 2, option.sndrate, FRAMES_PER_SECOND, -100); + osd_play_streamed_sample_16(option.swap ^ 1, snd.buffer[1], snd.buffer_size * 2, option.sndrate, FRAMES_PER_SECOND, 100); +} + +void dos_update_palette(void) +{ + if(is_border_dirty) + { + uint16 data = *(uint16 *)&cram[(border << 1)]; + RGB *color; + + is_border_dirty = 0; + + if(reg[12] & 8) + { + int j; + for(j = 0; j < 3; j += 1) + { + color = &vdp_palette[j][data]; + set_color((j << 6), color); + } + } + else + { + color = &vdp_palette[1][data]; + set_color(0x00, color); + set_color(0x40, color); + set_color(0x80, color); + } + } + + if(is_color_dirty) + { + int i; + uint16 *p = (uint16 *)&cram[0]; + is_color_dirty = 0; + + for(i = 0; i < 64; i += 1) + { + if((color_dirty[i]) && ((i & 0x0F) != 0x00)) + { + RGB *color; + color_dirty[i] = 0; + if(reg[12] & 8) + { + int j; + for(j = 0; j < 3; j += 1) + { + color = &vdp_palette[j][p[i]]; + set_color((j << 6) | i, color); + } + } + else + { + color = &vdp_palette[1][p[i]]; + set_color(0x00 | i, color); + set_color(0x40 | i, color); + set_color(0x80 | i, color); + } + } + } + } +} + +void dos_update_video(void) +{ + int width = (reg[12] & 1) ? 320 : 256; + int height = (reg[1] & 8) ? 240 : 224; + int center_x = (SCREEN_W - width) / 2; + int center_y = (SCREEN_H / (option.scanlines ? 4 : 2)) - (height / 2); + + /* Wait for VSync */ + if(option.vsync) vsync(); + + if(bitmap.viewport.changed) + { + bitmap.viewport.changed = 0; + if(bitmap.remap) + { + clear(screen); + } + else + { + clear_to_color(screen, 0xFF); + } + } + + if(bitmap.remap == 0) + { + dos_update_palette(); + } + + + if(option.scanlines) + { + int y; + for(y = 0; y < height; y += 1) + { + blit(gen_bmp, screen, 0x20, y, center_x, (center_y + y) << 1, width, 1); + } + } + else + { + + blit(gen_bmp, screen, 0x20, 0, center_x, center_y, width, height); + } +} + +void init_machine(void) +{ + do_config("gen.cfg"); + + if(option.sound) + { + msdos_init_sound(&option.sndrate, option.sndcard); + } + + allegro_init(); + install_keyboard(); + install_joystick(option.joy_driver); + + install_timer(); + LOCK_FUNCTION(tick_handler); + LOCK_VARIABLE(tick_count); + LOCK_VARIABLE(frame_rate); + install_int_ex(tick_handler, BPS_TO_TIMER(FRAMES_PER_SECOND)); + + set_color_depth(option.video_depth); + gen_bmp = create_bitmap(512, 512); + clear(gen_bmp); + + memset(&bitmap, 0, sizeof(bitmap)); + bitmap.data = (uint8 *)&gen_bmp->line[0][0]; + bitmap.width = gen_bmp->w; + bitmap.height = gen_bmp->h; + bitmap.depth = option.video_depth; + switch(option.video_depth) + { + case 8: + bitmap.granularity = 1; + break; + case 15: + bitmap.granularity = 2; + break; + case 16: + bitmap.granularity = 2; + break; + case 32: + bitmap.granularity = 4; + break; + } + bitmap.pitch = (bitmap.width * bitmap.granularity); + bitmap.viewport.w = 256; + bitmap.viewport.h = 224; + bitmap.viewport.x = 0x20; + bitmap.viewport.y = 0x00; + bitmap.remap = 0; + if(option.remap) bitmap.remap = 1; + else + if(bitmap.depth > 8) bitmap.remap = 1; + + make_vdp_palette(); + + memcpy(gen_pal, black_palette, sizeof(PALETTE)); + gen_pal[0xFE].r = \ + gen_pal[0xFE].g = \ + gen_pal[0xFE].b = 0x3F; + + dos_change_mode(); +} + +void trash_machine(void) +{ + if(option.sound) + { + msdos_shutdown_sound(); + } + clear(screen); + destroy_bitmap(gen_bmp); + set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); +} + +void make_vdp_palette(void) +{ + uint8 lut[3][8] = + { + {0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C}, + {0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38}, + {0x20, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C}, + }; + + int j; + for(j = 0; j < 0x600; j += 1) + { + + int r = (j >> 6) & 7; + int g = (j >> 3) & 7; + int b = (j >> 0) & 7; + int i = (j >> 9) & 3; + + vdp_palette[i][j & 0x1FF].r = lut[i][r]; + vdp_palette[i][j & 0x1FF].g = lut[i][g]; + vdp_palette[i][j & 0x1FF].b = lut[i][b]; + } +} + +void dos_change_mode(void) +{ + int ret; + int width = option.video_width; + int height = option.video_height; + + if(option.scanlines) height *= 2; + ret = set_gfx_mode(option.video_driver, width, height, 0, 0); + if(ret != 0) + { + set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); + printf("Error setting graphics mode (%dx%d %dbpp).\nAllegro says: `%s'\n", width, height, option.video_depth, allegro_error); + exit(1); + } + + if(bitmap.depth == 8) + { + if(bitmap.remap) + { + int i; + for(i = 0; i < 0x100; i += 1) + { + gen_pal[i].r = ((i >> 5) & 7) << 3; + gen_pal[i].g = ((i >> 2) & 7) << 3; + gen_pal[i].b = ((i >> 0) & 3) << 4; + } + set_palette(gen_pal); + } + else + { + clear_to_color(screen, 0xFF); + gen_pal[0xfe].r = 0xff; + gen_pal[0xfe].g = 0xff; + gen_pal[0xfe].b = 0xff; + set_palette(gen_pal); + inp(0x3DA); + outp(0x3C0, 0x31); + outp(0x3C0, 0xFF); + } + } + else + { + clear(screen); + } +} + + + +/* Check if a key is pressed */ +int check_key(int code) +{ + static char lastbuf[0x100] = {0}; + + if((!key[code]) && (lastbuf[code] == 1)) + lastbuf[code] = 0; + + if((key[code]) && (lastbuf[code] == 0)) + { + lastbuf[code] = 1; + return (1); + } + + return (0); +} + diff --git a/source/unused/dos/dos.h b/source/unused/dos/dos.h new file mode 100644 index 0000000..e32d62c --- /dev/null +++ b/source/unused/dos/dos.h @@ -0,0 +1,19 @@ + +#ifndef _DOS_H_ +#define _DOS_H_ + +/* Function prototypes */ +int load_file(char *filename, char *buf, int size); +int save_file(char *filename, char *buf, int size); +void dos_update_input(void); +void dos_update_audio(void); +void dos_update_palette(void); +void dos_update_video(void); +void init_machine(void); +void trash_machine(void); +void make_vdp_palette(void); +void dos_change_mode(void); +int check_key(int code); + +#endif /* _DOS_H_ */ + diff --git a/source/unused/dos/error.c b/source/unused/dos/error.c new file mode 100644 index 0000000..7032ae9 --- /dev/null +++ b/source/unused/dos/error.c @@ -0,0 +1,29 @@ + +#include "osd.h" + +FILE *error_log; + +struct { + int enabled; + int verbose; + FILE *log; +} t_error; + +void error_init(void) +{ + error_log = fopen("error.log","w"); +} + +void error_shutdown(void) +{ + if(error_log) fclose(error_log); +} + +void error(char *format, ...) +{ + va_list ap; + va_start(ap, format); + if(error_log) vfprintf(error_log, format, ap); + va_end(ap); +} + diff --git a/source/unused/dos/error.h b/source/unused/dos/error.h new file mode 100644 index 0000000..14dc8e6 --- /dev/null +++ b/source/unused/dos/error.h @@ -0,0 +1,13 @@ + +#ifndef _ERROR_H_ +#define _ERROR_H_ + +/* Global variables */ +FILE *error_log; + +/* Function prototypes */ +void error_init(void); +void error_shutdown(void); +void error(char *format, ...); + +#endif /* _ERROR_H_ */ diff --git a/source/unused/dos/osd.h b/source/unused/dos/osd.h new file mode 100644 index 0000000..2b1c6d0 --- /dev/null +++ b/source/unused/dos/osd.h @@ -0,0 +1,18 @@ + +#ifndef _OSD_H_ +#define _OSD_H_ + +#include +#include +#include +#include +#include +#include + +#include "shared.h" +#include "dos.h" +#include "config.h" +#include "sealintf.h" +#include "error.h" + +#endif /* _OSD_H_ */ diff --git a/source/unused/fileio.c b/source/unused/fileio.c new file mode 100644 index 0000000..b7f57b8 --- /dev/null +++ b/source/unused/fileio.c @@ -0,0 +1,153 @@ + +#include "shared.h" + + +/* + Load a normal file, or ZIP/GZ archive. + Returns NULL if an error occured. +*/ +uint8 *load_archive(char *filename, int *file_size) +{ + int size = 0; + uint8 *buf = NULL; + + if(check_zip(filename)) + { + unzFile *fd = NULL; + unz_file_info info; + int ret = 0; + + /* Attempt to open the archive */ + fd = unzOpen(filename); + if(!fd) return (NULL); + + /* Go to first file in archive */ + ret = unzGoToFirstFile(fd); + if(ret != UNZ_OK) + { + unzClose(fd); + return (NULL); + } + + ret = unzGetCurrentFileInfo(fd, &info, NULL, 0, NULL, 0, NULL, 0); + if(ret != UNZ_OK) + { + unzClose(fd); + return (NULL); + } + + /* Open the file for reading */ + ret = unzOpenCurrentFile(fd); + if(ret != UNZ_OK) + { + unzClose(fd); + return (NULL); + } + + /* Allocate file data buffer */ + size = info.uncompressed_size; + buf = malloc(size); + if(!buf) + { + unzClose(fd); + return (NULL); + } + + /* Read (decompress) the file */ + ret = unzReadCurrentFile(fd, buf, info.uncompressed_size); + if(ret != info.uncompressed_size) + { + free(buf); + unzCloseCurrentFile(fd); + unzClose(fd); + return (NULL); + } + + /* Close the current file */ + ret = unzCloseCurrentFile(fd); + if(ret != UNZ_OK) + { + free(buf); + unzClose(fd); + return (NULL); + } + + /* Close the archive */ + ret = unzClose(fd); + if(ret != UNZ_OK) + { + free(buf); + return (NULL); + } + + /* Update file size and return pointer to file data */ + *file_size = size; + return (buf); + } + else + { + gzFile *gd = NULL; + + /* Open file */ + gd = gzopen(filename, "rb"); + if(!gd) return (0); + + /* Get file size */ + size = gzsize(gd); + + /* Allocate file data buffer */ + buf = malloc(size); + if(!buf) + { + gzclose(gd); + return (0); + } + + /* Read file data */ + gzread(gd, buf, size); + + /* Close file */ + gzclose(gd); + + /* Update file size and return pointer to file data */ + *file_size = size; + return (buf); + } +} + + +/* + Verifies if a file is a ZIP archive or not. + Returns: 1= ZIP archive, 0= not a ZIP archive +*/ +int check_zip(char *filename) +{ + uint8 buf[2]; + FILE *fd = NULL; + fd = fopen(filename, "rb"); + if(!fd) return (0); + fread(buf, 2, 1, fd); + fclose(fd); + if(memcmp(buf, "PK", 2) == 0) return (1); + return (0); +} + + +/* + Returns the size of a GZ compressed file. +*/ +int gzsize(gzFile *gd) +{ + #define CHUNKSIZE (0x10000) + int size = 0, length = 0; + unsigned char buffer[CHUNKSIZE]; + gzrewind(gd); + do { + size = gzread(gd, buffer, CHUNKSIZE); + if(size <= 0) break; + length += size; + } while (!gzeof(gd)); + gzrewind(gd); + return (length); + #undef CHUNKSIZE +} diff --git a/source/unused/fileio.h b/source/unused/fileio.h new file mode 100644 index 0000000..09b0ab7 --- /dev/null +++ b/source/unused/fileio.h @@ -0,0 +1,15 @@ + +#ifndef _FILEIO_H_ +#define _FILEIO_H_ + +/* Global variables */ +extern int cart_size; +extern char cart_name[0x100]; + +/* Function prototypes */ +uint8 *load_archive(char *filename, int *file_size); +int load_cart(char *filename); +int check_zip(char *filename); +int gzsize(gzFile *gd); + +#endif /* _FILEIO_H_ */ diff --git a/source/unused/loadrom.c b/source/unused/loadrom.c new file mode 100644 index 0000000..e0a4381 --- /dev/null +++ b/source/unused/loadrom.c @@ -0,0 +1,52 @@ + +#include "shared.h" + +static uint8 block[0x4000]; + +void deinterleave_block(uint8 *src) +{ + int i; + memcpy(block, src, 0x4000); + for(i = 0; i < 0x2000; i += 1) + { + src[i*2+0] = block[0x2000 + (i)]; + src[i*2+1] = block[0x0000 + (i)]; + } +} + +int load_rom(char *filename) +{ + int size, offset = 0; + uint8 header[0x200]; + uint8 *ptr; + + ptr = load_archive(filename, &size); + if(!ptr) return (0); + + if((size / 512) & 1) + { + int i; + + size -= 512; + offset += 512; + + memcpy(header, ptr, 512); + + for(i = 0; i < (size / 0x4000); i += 1) + { + deinterleave_block(ptr + offset + (i * 0x4000)); + } + } + + memset(cart_rom, 0, 0x400000); + if(size > 0x400000) size = 0x400000; + memcpy(cart_rom, ptr + offset, size); + + /* Free allocated file data */ + free(ptr); + + return (1); +} + + + diff --git a/source/unused/loadrom.h b/source/unused/loadrom.h new file mode 100644 index 0000000..5c654d2 --- /dev/null +++ b/source/unused/loadrom.h @@ -0,0 +1,10 @@ + +#ifndef _LOADROM_H_ +#define _LOADROM_H_ + +/* Function prototypes */ +void deinterleave_block(uint8 *src); +int load_rom(char *filename); + +#endif /* _LOADROM_H_ */ + diff --git a/source/unused/unzip.c b/source/unused/unzip.c new file mode 100644 index 0000000..e56c55f --- /dev/null +++ b/source/unused/unzip.c @@ -0,0 +1,1301 @@ +/* unzip.c -- IO on .zip files using zlib + Version 0.15 beta, Mar 19th, 1998, + + Read unzip.h for more info +*/ + + +#include +#include +#include +#include "zlib.h" +#include "unzip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + + + +#if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) && \ + !defined(CASESENSITIVITYDEFAULT_NO) +#define CASESENSITIVITYDEFAULT_NO +#endif + + +#ifndef UNZ_BUFSIZE +#define UNZ_BUFSIZE (16384) +#endif + +#ifndef UNZ_MAXFILENAMEINZIP +#define UNZ_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) + +/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ + +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif + +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif + +const char unz_copyright[] = + " unzip 0.15 Copyright 1998 Gilles Vollant "; + +/* unz_file_info_interntal contain internal info about a file in zipfile*/ +typedef struct unz_file_info_internal_s +{ + uLong offset_curfile;/* relative offset of local header 4 bytes */ +} unz_file_info_internal; + + +/* file_in_zip_read_info_s contain internal information about a file in zipfile, + when reading and decompress it */ +typedef struct +{ + char *read_buffer; /* internal buffer for compressed data */ + z_stream stream; /* zLib stream structure for inflate */ + + uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ + uLong stream_initialised; /* flag set if stream structure is initialised*/ + + uLong offset_local_extrafield;/* offset of the local extra field */ + uInt size_local_extrafield;/* size of the local extra field */ + uLong pos_local_extrafield; /* position in the local extra field in read*/ + + uLong crc32; /* crc32 of all data uncompressed */ + uLong crc32_wait; /* crc32 we must obtain after decompress all */ + uLong rest_read_compressed; /* number of byte to be decompressed */ + uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/ + FILE* file; /* io structore of the zipfile */ + uLong compression_method; /* compression method (0==store) */ + uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ +} file_in_zip_read_info_s; + + +/* unz_s contain internal information about the zipfile +*/ +typedef struct +{ + FILE* file; /* io structore of the zipfile */ + unz_global_info gi; /* public global information */ + uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + uLong num_file; /* number of the current file in the zipfile*/ + uLong pos_in_central_dir; /* pos of the current file in the central dir*/ + uLong current_file_ok; /* flag about the usability of the current file*/ + uLong central_pos; /* position of the beginning of the central dir*/ + + uLong size_central_dir; /* size of the central directory */ + uLong offset_central_dir; /* offset of start of central directory with + respect to the starting disk number */ + + unz_file_info cur_file_info; /* public info about the current file in zip*/ + unz_file_info_internal cur_file_info_internal; /* private info about it*/ + file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current + file if we are decompressing it */ +} unz_s; + + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been sucessfully opened for reading. +*/ + + +local int unzlocal_getByte(fin,pi) + FILE *fin; + int *pi; +{ + unsigned char c; + int err = fread(&c, 1, 1, fin); + if (err==1) + { + *pi = (int)c; + return UNZ_OK; + } + else + { + if (ferror(fin)) + return UNZ_ERRNO; + else + return UNZ_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int unzlocal_getShort (fin,pX) + FILE* fin; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = unzlocal_getByte(fin,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unzlocal_getByte(fin,&i); + x += ((uLong)i)<<8; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int unzlocal_getLong (fin,pX) + FILE* fin; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = unzlocal_getByte(fin,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unzlocal_getByte(fin,&i); + x += ((uLong)i)<<8; + + if (err==UNZ_OK) + err = unzlocal_getByte(fin,&i); + x += ((uLong)i)<<16; + + if (err==UNZ_OK) + err = unzlocal_getByte(fin,&i); + x += ((uLong)i)<<24; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + + +/* My own strcmpi / strcasecmp */ +local int strcmpcasenosensitive_internal (fileName1,fileName2) + const char* fileName1; + const char* fileName2; +{ + for (;;) + { + char c1=*(fileName1++); + char c2=*(fileName2++); + if ((c1>='a') && (c1<='z')) + c1 -= 0x20; + if ((c2>='a') && (c2<='z')) + c2 -= 0x20; + if (c1=='\0') + return ((c2=='\0') ? 0 : -1); + if (c2=='\0') + return 1; + if (c1c2) + return 1; + } +} + + +#ifdef CASESENSITIVITYDEFAULT_NO +#define CASESENSITIVITYDEFAULTVALUE 2 +#else +#define CASESENSITIVITYDEFAULTVALUE 1 +#endif + +#ifndef STRCMPCASENOSENTIVEFUNCTION +#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal +#endif + +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) + +*/ +extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity) + const char* fileName1; + const char* fileName2; + int iCaseSensitivity; +{ + if (iCaseSensitivity==0) + iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; + + if (iCaseSensitivity==1) + return strcmp(fileName1,fileName2); + + return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); +} + +#define BUFREADCOMMENT (0x400) + +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local uLong unzlocal_SearchCentralDir(fin) + FILE *fin; +{ + unsigned char* buf; + uLong uSizeFile; + uLong uBackRead; + uLong uMaxBack=0xffff; /* maximum size of global comment */ + uLong uPosFound=0; + + if (fseek(fin,0,SEEK_END) != 0) + return 0; + + + uSizeFile = ftell( fin ); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); + if (fseek(fin,uReadPos,SEEK_SET)!=0) + break; + + if (fread(buf,(uInt)uReadSize,1,fin)!=1) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} + +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\test\\zlib109.zip" or on an Unix computer + "zlib/zlib109.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ +extern unzFile ZEXPORT unzOpen (path) + const char *path; +{ + unz_s us; + unz_s *s; + uLong central_pos,uL; + FILE * fin ; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + uLong number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + + int err=UNZ_OK; + + if (unz_copyright[0]!=' ') + return NULL; + + fin=fopen(path,"rb"); + if (fin==NULL) + return NULL; + + central_pos = unzlocal_SearchCentralDir(fin); + if (central_pos==0) + err=UNZ_ERRNO; + + if (fseek(fin,central_pos,SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unzlocal_getLong(fin,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unzlocal_getShort(fin,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unzlocal_getShort(fin,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (unzlocal_getShort(fin,&us.gi.number_entry)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir */ + if (unzlocal_getShort(fin,&number_entry_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unzlocal_getLong(fin,&us.size_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unzlocal_getLong(fin,&us.offset_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* zipfile comment length */ + if (unzlocal_getShort(fin,&us.gi.size_comment)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((central_pospfile_in_zip_read!=NULL) + unzCloseCurrentFile(file); + + fclose(s->file); + TRYFREE(s); + return UNZ_OK; +} + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ +extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info) + unzFile file; + unz_global_info *pglobal_info; +{ + unz_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + *pglobal_info=s->gi; + return UNZ_OK; +} + + +/* + Translate date/time from Dos format to tm_unz (readable more easilty) +*/ +local void unzlocal_DosDateToTmuDate (ulDosDate, ptm) + uLong ulDosDate; + tm_unz* ptm; +{ + uLong uDate; + uDate = (uLong)(ulDosDate>>16); + ptm->tm_mday = (uInt)(uDate&0x1f) ; + ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; + ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; + + ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); + ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; + ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; +} + +/* + Get Info about the current file in the zipfile, with internal only info +*/ +local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file, + unz_file_info *pfile_info, + unz_file_info_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); + +local int unzlocal_GetCurrentFileInfoInternal (file, + pfile_info, + pfile_info_internal, + szFileName, fileNameBufferSize, + extraField, extraFieldBufferSize, + szComment, commentBufferSize) + unzFile file; + unz_file_info *pfile_info; + unz_file_info_internal *pfile_info_internal; + char *szFileName; + uLong fileNameBufferSize; + void *extraField; + uLong extraFieldBufferSize; + char *szComment; + uLong commentBufferSize; +{ + unz_s* s; + unz_file_info file_info; + unz_file_info_internal file_info_internal; + int err=UNZ_OK; + uLong uMagic; + long lSeek=0; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (fseek(s->file,s->pos_in_central_dir+s->byte_before_the_zipfile,SEEK_SET)!=0) + err=UNZ_ERRNO; + + + /* we check the magic */ + if (err==UNZ_OK) + { + if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x02014b50) + err=UNZ_BADZIPFILE; + } + + if (unzlocal_getShort(s->file,&file_info.version) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.version_needed) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.flag) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.compression_method) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info.dosDate) != UNZ_OK) + err=UNZ_ERRNO; + + unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); + + if (unzlocal_getLong(s->file,&file_info.crc) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info.compressed_size) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info.uncompressed_size) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.size_filename) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.size_file_extra) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.size_file_comment) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.disk_num_start) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&file_info.internal_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info.external_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&file_info_internal.offset_curfile) != UNZ_OK) + err=UNZ_ERRNO; + + lSeek+=file_info.size_filename; + if ((err==UNZ_OK) && (szFileName!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_filename0) && (fileNameBufferSize>0)) + if (fread(szFileName,(uInt)uSizeRead,1,s->file)!=1) + err=UNZ_ERRNO; + lSeek -= uSizeRead; + } + + + if ((err==UNZ_OK) && (extraField!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_extrafile,lSeek,SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) + if (fread(extraField,(uInt)uSizeRead,1,s->file)!=1) + err=UNZ_ERRNO; + lSeek += file_info.size_file_extra - uSizeRead; + } + else + lSeek+=file_info.size_file_extra; + + + if ((err==UNZ_OK) && (szComment!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_commentfile,lSeek,SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + if ((file_info.size_file_comment>0) && (commentBufferSize>0)) + if (fread(szComment,(uInt)uSizeRead,1,s->file)!=1) + err=UNZ_ERRNO; + lSeek+=file_info.size_file_comment - uSizeRead; + } + else + lSeek+=file_info.size_file_comment; + + if ((err==UNZ_OK) && (pfile_info!=NULL)) + *pfile_info=file_info; + + if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) + *pfile_info_internal=file_info_internal; + + return err; +} + + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. +*/ +extern int ZEXPORT unzGetCurrentFileInfo (file, + pfile_info, + szFileName, fileNameBufferSize, + extraField, extraFieldBufferSize, + szComment, commentBufferSize) + unzFile file; + unz_file_info *pfile_info; + char *szFileName; + uLong fileNameBufferSize; + void *extraField; + uLong extraFieldBufferSize; + char *szComment; + uLong commentBufferSize; +{ + return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); +} + +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ +extern int ZEXPORT unzGoToFirstFile (file) + unzFile file; +{ + int err=UNZ_OK; + unz_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + s->pos_in_central_dir=s->offset_central_dir; + s->num_file=0; + err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + + +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ +extern int ZEXPORT unzGoToNextFile (file) + unzFile file; +{ + unz_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + if (s->num_file+1==s->gi.number_entry) + return UNZ_END_OF_LIST_OF_FILE; + + s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + + s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; + s->num_file++; + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + + +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzipStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ +extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity) + unzFile file; + const char *szFileName; + int iCaseSensitivity; +{ + unz_s* s; + int err; + + + uLong num_fileSaved; + uLong pos_in_central_dirSaved; + + + if (file==NULL) + return UNZ_PARAMERROR; + + if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) + return UNZ_PARAMERROR; + + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + num_fileSaved = s->num_file; + pos_in_central_dirSaved = s->pos_in_central_dir; + + err = unzGoToFirstFile(file); + + while (err == UNZ_OK) + { + char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; + unzGetCurrentFileInfo(file,NULL, + szCurrentFileName,sizeof(szCurrentFileName)-1, + NULL,0,NULL,0); + if (unzStringFileNameCompare(szCurrentFileName, + szFileName,iCaseSensitivity)==0) + return UNZ_OK; + err = unzGoToNextFile(file); + } + + s->num_file = num_fileSaved ; + s->pos_in_central_dir = pos_in_central_dirSaved ; + return err; +} + + +/* + Read the local header of the current zipfile + Check the coherency of the local header and info in the end of central + directory about this file + store in *piSizeVar the size of extra info in local header + (filename and size of extra field data) +*/ +local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar, + poffset_local_extrafield, + psize_local_extrafield) + unz_s* s; + uInt* piSizeVar; + uLong *poffset_local_extrafield; + uInt *psize_local_extrafield; +{ + uLong uMagic,uData,uFlags; + uLong size_filename; + uLong size_extra_field; + int err=UNZ_OK; + + *piSizeVar = 0; + *poffset_local_extrafield = 0; + *psize_local_extrafield = 0; + + if (fseek(s->file,s->cur_file_info_internal.offset_curfile + + s->byte_before_the_zipfile,SEEK_SET)!=0) + return UNZ_ERRNO; + + + if (err==UNZ_OK) + { + if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x04034b50) + err=UNZ_BADZIPFILE; + } + + if (unzlocal_getShort(s->file,&uData) != UNZ_OK) + err=UNZ_ERRNO; +/* + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) + err=UNZ_BADZIPFILE; +*/ + if (unzlocal_getShort(s->file,&uFlags) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(s->file,&uData) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) + err=UNZ_BADZIPFILE; + + if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* date/time */ + err=UNZ_ERRNO; + + if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* crc */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* size compr */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* size uncompr */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + + if (unzlocal_getShort(s->file,&size_filename) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) + err=UNZ_BADZIPFILE; + + *piSizeVar += (uInt)size_filename; + + if (unzlocal_getShort(s->file,&size_extra_field) != UNZ_OK) + err=UNZ_ERRNO; + *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + + SIZEZIPLOCALHEADER + size_filename; + *psize_local_extrafield = (uInt)size_extra_field; + + *piSizeVar += (uInt)size_extra_field; + + return err; +} + +/* + Open for reading data the current file in the zipfile. + If there is no error and the file is opened, the return value is UNZ_OK. +*/ +extern int ZEXPORT unzOpenCurrentFile (file) + unzFile file; +{ + int err=UNZ_OK; + int Store; + uInt iSizeVar; + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + uLong offset_local_extrafield; /* offset of the local extra field */ + uInt size_local_extrafield; /* size of the local extra field */ + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_PARAMERROR; + + if (s->pfile_in_zip_read != NULL) + unzCloseCurrentFile(file); + + if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar, + &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) + return UNZ_BADZIPFILE; + + pfile_in_zip_read_info = (file_in_zip_read_info_s*) + ALLOC(sizeof(file_in_zip_read_info_s)); + if (pfile_in_zip_read_info==NULL) + return UNZ_INTERNALERROR; + + pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); + pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; + pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; + pfile_in_zip_read_info->pos_local_extrafield=0; + + if (pfile_in_zip_read_info->read_buffer==NULL) + { + TRYFREE(pfile_in_zip_read_info); + return UNZ_INTERNALERROR; + } + + pfile_in_zip_read_info->stream_initialised=0; + + if ((s->cur_file_info.compression_method!=0) && + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + Store = s->cur_file_info.compression_method==0; + + pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; + pfile_in_zip_read_info->crc32=0; + pfile_in_zip_read_info->compression_method = + s->cur_file_info.compression_method; + pfile_in_zip_read_info->file=s->file; + pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; + + pfile_in_zip_read_info->stream.total_out = 0; + + if (!Store) + { + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + + err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=1; + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. + * In unzip, i don't wait absolutely Z_STREAM_END because I known the + * size of both compressed and uncompressed data + */ + } + pfile_in_zip_read_info->rest_read_compressed = + s->cur_file_info.compressed_size ; + pfile_in_zip_read_info->rest_read_uncompressed = + s->cur_file_info.uncompressed_size ; + + + pfile_in_zip_read_info->pos_in_zipfile = + s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + + iSizeVar; + + pfile_in_zip_read_info->stream.avail_in = (uInt)0; + + + s->pfile_in_zip_read = pfile_in_zip_read_info; + return UNZ_OK; +} + + +/* + Read bytes from the current file. + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ +extern int ZEXPORT unzReadCurrentFile (file, buf, len) + unzFile file; + voidp buf; + unsigned len; +{ + int err=UNZ_OK; + uInt iRead = 0; + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->read_buffer == NULL)) + return UNZ_END_OF_LIST_OF_FILE; + if (len==0) + return 0; + + pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; + + pfile_in_zip_read_info->stream.avail_out = (uInt)len; + + if (len>pfile_in_zip_read_info->rest_read_uncompressed) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_uncompressed; + + while (pfile_in_zip_read_info->stream.avail_out>0) + { + if ((pfile_in_zip_read_info->stream.avail_in==0) && + (pfile_in_zip_read_info->rest_read_compressed>0)) + { + uInt uReadThis = UNZ_BUFSIZE; + if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; + if (uReadThis == 0) + return UNZ_EOF; + if (fseek(pfile_in_zip_read_info->file, + pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile,SEEK_SET)!=0) + return UNZ_ERRNO; + if (fread(pfile_in_zip_read_info->read_buffer,uReadThis,1, + pfile_in_zip_read_info->file)!=1) + return UNZ_ERRNO; + pfile_in_zip_read_info->pos_in_zipfile += uReadThis; + + pfile_in_zip_read_info->rest_read_compressed-=uReadThis; + + pfile_in_zip_read_info->stream.next_in = + (Bytef*)pfile_in_zip_read_info->read_buffer; + pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; + } + + if (pfile_in_zip_read_info->compression_method==0) + { + uInt uDoCopy,i ; + if (pfile_in_zip_read_info->stream.avail_out < + pfile_in_zip_read_info->stream.avail_in) + uDoCopy = pfile_in_zip_read_info->stream.avail_out ; + else + uDoCopy = pfile_in_zip_read_info->stream.avail_in ; + + for (i=0;istream.next_out+i) = + *(pfile_in_zip_read_info->stream.next_in+i); + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, + pfile_in_zip_read_info->stream.next_out, + uDoCopy); + pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; + pfile_in_zip_read_info->stream.avail_in -= uDoCopy; + pfile_in_zip_read_info->stream.avail_out -= uDoCopy; + pfile_in_zip_read_info->stream.next_out += uDoCopy; + pfile_in_zip_read_info->stream.next_in += uDoCopy; + pfile_in_zip_read_info->stream.total_out += uDoCopy; + iRead += uDoCopy; + } + else + { + uLong uTotalOutBefore,uTotalOutAfter; + const Bytef *bufBefore; + uLong uOutThis; + int flush=Z_SYNC_FLUSH; + + uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; + bufBefore = pfile_in_zip_read_info->stream.next_out; + + /* + if ((pfile_in_zip_read_info->rest_read_uncompressed == + pfile_in_zip_read_info->stream.avail_out) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + flush = Z_FINISH; + */ + err=inflate(&pfile_in_zip_read_info->stream,flush); + + uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->crc32 = + crc32(pfile_in_zip_read_info->crc32,bufBefore, + (uInt)(uOutThis)); + + pfile_in_zip_read_info->rest_read_uncompressed -= + uOutThis; + + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + if (err==Z_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=Z_OK) + break; + } + } + + if (err==Z_OK) + return iRead; + return err; +} + + +/* + Give the current position in uncompressed data +*/ +extern z_off_t ZEXPORT unztell (file) + unzFile file; +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + return (z_off_t)pfile_in_zip_read_info->stream.total_out; +} + + +/* + return 1 if the end of file was reached, 0 elsewhere +*/ +extern int ZEXPORT unzeof (file) + unzFile file; +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + return 1; + else + return 0; +} + + + +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field that can be read + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ +extern int ZEXPORT unzGetLocalExtrafield (file,buf,len) + unzFile file; + voidp buf; + unsigned len; +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + uInt read_now; + uLong size_to_read; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + size_to_read = (pfile_in_zip_read_info->size_local_extrafield - + pfile_in_zip_read_info->pos_local_extrafield); + + if (buf==NULL) + return (int)size_to_read; + + if (len>size_to_read) + read_now = (uInt)size_to_read; + else + read_now = (uInt)len ; + + if (read_now==0) + return 0; + + if (fseek(pfile_in_zip_read_info->file, + pfile_in_zip_read_info->offset_local_extrafield + + pfile_in_zip_read_info->pos_local_extrafield,SEEK_SET)!=0) + return UNZ_ERRNO; + + if (fread(buf,(uInt)size_to_read,1,pfile_in_zip_read_info->file)!=1) + return UNZ_ERRNO; + + return (int)read_now; +} + +/* + Close the file in zip opened with unzipOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ +extern int ZEXPORT unzCloseCurrentFile (file) + unzFile file; +{ + int err=UNZ_OK; + + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + { + if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) + err=UNZ_CRCERROR; + } + + + TRYFREE(pfile_in_zip_read_info->read_buffer); + pfile_in_zip_read_info->read_buffer = NULL; + if (pfile_in_zip_read_info->stream_initialised) + inflateEnd(&pfile_in_zip_read_info->stream); + + pfile_in_zip_read_info->stream_initialised = 0; + TRYFREE(pfile_in_zip_read_info); + + s->pfile_in_zip_read=NULL; + + return err; +} + + +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ +extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf) + unzFile file; + char *szComment; + uLong uSizeBuf; +{ +/* int err=UNZ_OK; */ + unz_s* s; + uLong uReadThis ; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + uReadThis = uSizeBuf; + if (uReadThis>s->gi.size_comment) + uReadThis = s->gi.size_comment; + + if (fseek(s->file,s->central_pos+22,SEEK_SET)!=0) + return UNZ_ERRNO; + + if (uReadThis>0) + { + *szComment='\0'; + if (fread(szComment,(uInt)uReadThis,1,s->file)!=1) + return UNZ_ERRNO; + } + + if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) + *(szComment+s->gi.size_comment)='\0'; + return (int)uReadThis; +} diff --git a/source/unused/unzip.h b/source/unused/unzip.h new file mode 100644 index 0000000..b8b02c0 --- /dev/null +++ b/source/unused/unzip.h @@ -0,0 +1,274 @@ +/* unzip.h -- IO for uncompress .zip files using zlib + Version 0.15 beta, Mar 19th, 1998, + + Copyright (C) 1998 Gilles Vollant + + This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + Encryption and multi volume ZipFile (span) are not supported. + Old compressions used by old PKZip 1.x are not supported + + THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE + CAN CHANGE IN FUTURE VERSION !! + I WAIT FEEDBACK at mail info@winimage.com + Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* for more info about .ZIP format, see + ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip */ + +#ifndef _unz_H +#define _unz_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagunzFile__ { int unused; } unzFile__; +typedef unzFile__ *unzFile; +#else +typedef voidp unzFile; +#endif + + +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) + +/* tm_unz contain date/time info */ +typedef struct tm_unz_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_unz; + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info_s +{ + uLong number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + + +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_info_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + uLong compressed_size; /* compressed size 4 bytes */ + uLong uncompressed_size; /* uncompressed size 4 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info; + +extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, + const char* fileName2, + int iCaseSensitivity)); +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) +*/ + + +extern unzFile ZEXPORT unzOpen OF((const char *path)); +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer + "zlib/zlib111.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ + +extern int ZEXPORT unzClose OF((unzFile file)); +/* + Close a ZipFile opened with unzipOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzipCloseCurrentFile before call unzipClose. + return UNZ_OK if there is no problem. */ + +extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, + unz_global_info *pglobal_info)); +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ + + +extern int ZEXPORT unzGetGlobalComment OF((unzFile file, + char *szComment, + uLong uSizeBuf)); +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ + + +/***************************************************************************/ +/* Unzip package allow you browse the directory of the zipfile */ + +extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ + +extern int ZEXPORT unzGoToNextFile OF((unzFile file)); +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +extern int ZEXPORT unzLocateFile OF((unzFile file, + const char *szFileName, + int iCaseSensitivity)); +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ + + +extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, + unz_file_info *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); +/* + Get Info about the current file + if pfile_info!=NULL, the *pfile_info structure will contain somes info about + the current file + if szFileName!=NULL, the filemane string will be copied in szFileName + (fileNameBufferSize is the size of the buffer) + if extraField!=NULL, the extra field information will be copied in extraField + (extraFieldBufferSize is the size of the buffer). + This is the Central-header version of the extra field + if szComment!=NULL, the comment string of the file will be copied in szComment + (commentBufferSize is the size of the buffer) +*/ + +/***************************************************************************/ +/* for reading the content of the current zipfile, you can open it, read data + from it, and close it (you can close it before reading all the file) + */ + +extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); +/* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); +/* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ + + +extern int ZEXPORT unzReadCurrentFile OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read bytes from the current file (opened by unzOpenCurrentFile) + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ + +extern z_off_t ZEXPORT unztell OF((unzFile file)); +/* + Give the current position in uncompressed data +*/ + +extern int ZEXPORT unzeof OF((unzFile file)); +/* + return 1 if the end of file was reached, 0 elsewhere +*/ + +extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _unz_H */ diff --git a/source/unused/win/error.c b/source/unused/win/error.c new file mode 100644 index 0000000..9bfa15d --- /dev/null +++ b/source/unused/win/error.c @@ -0,0 +1,39 @@ +/* + error.c -- + Error logging +*/ + +#include "shared.h" + +FILE *error_log; + +struct { + int enabled; + int verbose; + FILE *log; +} t_error; + +void error_init(void) +{ +#ifdef DEBUG + error_log = fopen("error.log","w"); +#endif +} + +void error_shutdown(void) +{ +#ifdef DEBUG + if(error_log) fclose(error_log); +#endif +} + +void error(char *format, ...) +{ +#ifdef DEBUG + va_list ap; + va_start(ap, format); + if(error_log) vfprintf(error_log, format, ap); + va_end(ap); +#endif +} + diff --git a/source/unused/win/error.h b/source/unused/win/error.h new file mode 100644 index 0000000..14dc8e6 --- /dev/null +++ b/source/unused/win/error.h @@ -0,0 +1,13 @@ + +#ifndef _ERROR_H_ +#define _ERROR_H_ + +/* Global variables */ +FILE *error_log; + +/* Function prototypes */ +void error_init(void); +void error_shutdown(void); +void error(char *format, ...); + +#endif /* _ERROR_H_ */ diff --git a/source/unused/win/main.c b/source/unused/win/main.c new file mode 100644 index 0000000..7ba316b --- /dev/null +++ b/source/unused/win/main.c @@ -0,0 +1,203 @@ + +#include +#include +#include "shared.h" + +int timer_count = 0; +int old_timer_count = 0; +int paused = 0; +int frame_count = 0; + +int update_input(void); +unsigned char *keystate; + + +Uint32 fps_callback(Uint32 interval) +{ + if(paused) return 1000/60; + timer_count++; + if(timer_count % 60 == 0) + { + int fps = frame_count; + char caption[32]; + sprintf(caption, "Genesis Plus/SDL FPS=%d", fps); + SDL_WM_SetCaption(caption, NULL); + frame_count = 0; + } + return 1000/60; +} + + +int main (int argc, char **argv) +{ + int running = 1; + + SDL_Rect viewport, src; + SDL_Surface *bmp, *screen; + SDL_Event event; + + error_init(); + + /* Print help if no game specified */ + if(argc < 2) + { + char caption[256]; + sprintf(caption, "Genesis Plus\nby Charles MacDonald\nWWW: http://cgfm2.emuviews.com\nusage: %s gamename\n", argv[0]); + MessageBox(NULL, caption, "Information", 0); + exit(1); + } + + /* Load game */ + if(!load_rom(argv[1])) + { + char caption[256]; + sprintf(caption, "Error loading file `%s'.", argv[1]); + MessageBox(NULL, caption, "Error", 0); + exit(1); + } + + viewport.x = 0; + viewport.y = 0; + viewport.w = 256; + viewport.h = 224; + + src.x = 32; + src.y = 0; + src.w = viewport.w; + src.h = viewport.h; + + if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) + { + exit(1); + } + SDL_WM_SetCaption("Genesis Plus/SDL", NULL); + + screen = SDL_SetVideoMode(viewport.w, viewport.h, 16, SDL_SWSURFACE); + viewport.x = 0; + viewport.y = 0; + + bmp = SDL_CreateRGBSurface(SDL_SWSURFACE, 1024, 512, 16, 0xF800, 0x07E0, 0x001F, 0x0000); + + + + memset(&bitmap, 0, sizeof(t_bitmap)); + bitmap.width = 1024; + bitmap.height = 512; + bitmap.depth = 16; + bitmap.granularity = 2; + bitmap.pitch = (bitmap.width * bitmap.granularity); + bitmap.data = (unsigned char *)bmp->pixels; + bitmap.viewport.w = 256; + bitmap.viewport.h = 224; + bitmap.viewport.x = 0x20; + bitmap.viewport.y = 0x00; + bitmap.remap = 1; + + system_init(); + system_reset(); + + SDL_SetTimer(1000/60, fps_callback); + + while(running) + { + running = update_input(); + + while (SDL_PollEvent(&event)) + { + switch(event.type) + { + case SDL_QUIT: /* Windows was closed */ + running = 0; + break; + + case SDL_ACTIVEEVENT: /* Window focus changed or was minimized */ + if(event.active.state & (SDL_APPINPUTFOCUS | SDL_APPACTIVE)) + { + paused = !event.active.gain; + } + break; + + default: + break; + } + } + + if(!paused) + { + frame_count++; + + update_input(); + + if(!system_frame(0)) + system_reset(); + + if(bitmap.viewport.changed) + { + bitmap.viewport.changed = 0; + src.w = bitmap.viewport.w; + src.h = bitmap.viewport.h; + viewport.w = bitmap.viewport.w; + viewport.h = bitmap.viewport.h; + screen = SDL_SetVideoMode(bitmap.viewport.w, bitmap.viewport.h, 16, SDL_SWSURFACE); + } + + SDL_BlitSurface(bmp, &src, screen, &viewport); + SDL_UpdateRect(screen, viewport.x, viewport.y, viewport.w, viewport.h); + } + } + + system_shutdown(); + SDL_Quit(); + error_shutdown(); + + return 0; +} + + +/* Check if a key is pressed */ +int check_key(int code) +{ + static char lastbuf[0x100] = {0}; + + if((!keystate[code]) && (lastbuf[code] == 1)) + lastbuf[code] = 0; + + if((keystate[code]) && (lastbuf[code] == 0)) + { + lastbuf[code] = 1; + return (1); + } + + return (0); +} + +int update_input(void) +{ + int running = 1; + + keystate = SDL_GetKeyState(NULL); + + memset(&input, 0, sizeof(t_input)); + if(keystate[SDLK_UP]) input.pad[0] |= INPUT_UP; + else + if(keystate[SDLK_DOWN]) input.pad[0] |= INPUT_DOWN; + if(keystate[SDLK_LEFT]) input.pad[0] |= INPUT_LEFT; + else + if(keystate[SDLK_RIGHT]) input.pad[0] |= INPUT_RIGHT; + + if(keystate[SDLK_a]) input.pad[0] |= INPUT_A; + if(keystate[SDLK_s]) input.pad[0] |= INPUT_B; + if(keystate[SDLK_d]) input.pad[0] |= INPUT_C; + if(keystate[SDLK_f]) input.pad[0] |= INPUT_START; + if(keystate[SDLK_z]) input.pad[0] |= INPUT_X; + if(keystate[SDLK_x]) input.pad[0] |= INPUT_Y; + if(keystate[SDLK_c]) input.pad[0] |= INPUT_Z; + if(keystate[SDLK_v]) input.pad[0] |= INPUT_MODE; + + if(keystate[SDLK_TAB]) system_reset(); + + if(keystate[SDLK_ESCAPE]) running = 0; + return (running); +} + + diff --git a/source/unused/win/main.h b/source/unused/win/main.h new file mode 100644 index 0000000..b369df6 --- /dev/null +++ b/source/unused/win/main.h @@ -0,0 +1,7 @@ + +#ifndef _MAIN_H_ +#define _MAIN_H_ + + + +#endif /* _MAIN_H_ */ diff --git a/source/unused/win/osd.h b/source/unused/win/osd.h new file mode 100644 index 0000000..46f6e7e --- /dev/null +++ b/source/unused/win/osd.h @@ -0,0 +1,18 @@ + +#ifndef _OSD_H_ +#define _OSD_H_ + +#include +#include +#include +#include +#include + +#include "SDL.h" +#include + +#include "error.h" +#include "shared.h" +#include "main.h" + +#endif /* _OSD_H_ */ diff --git a/source/vdp.c b/source/vdp.c new file mode 100644 index 0000000..61c9c8e --- /dev/null +++ b/source/vdp.c @@ -0,0 +1,600 @@ + +#include "shared.h" +#include "hvc.h" + +/* Pack and unpack CRAM data */ +#define PACK_CRAM(d) ((((d)&0xE00)>>9)|(((d)&0x0E0)>>2)|(((d)&0x00E)<<5)) +#define UNPACK_CRAM(d) ((((d)&0x1C0)>>5)|((d)&0x038)<<2|(((d)&0x007)<<9)) + +/* Mark a pattern as dirty */ +#define MARK_BG_DIRTY(addr) \ +{ \ + int name = (addr >> 5) & 0x7FF; \ + if(bg_name_dirty[name] == 0) bg_name_list[bg_list_index++] = name; \ + bg_name_dirty[name] |= (1 << ((addr >> 2) & 0x07)); \ +} + +/* Tables that define the playfield layout */ +uint8 shift_table[] = { 6, 7, 0, 8 }; +uint8 col_mask_table[] = { 0x0F, 0x1F, 0x0F, 0x3F }; +uint16 row_mask_table[] = { 0x0FF, 0x1FF, 0x2FF, 0x3FF }; +uint32 y_mask_table[] = { 0x1FC0, 0x1F80, 0x1FC0, 0x1F00 }; + +/* DMA Timings Table + + + DMA Mode Width Display Transfer Count + ----------------------------------------------------- + 68K > VDP 32-cell Active 16 + Blanking 167 + 40-cell Active 18 + Blanking 205 + VRAM Fill 32-cell Active 15 + Blanking 166 + 40-cell Active 17 + Blanking 204 + VRAM Copy 32-cell Active 8 + Blanking 83 + 40-cell Active 9 + Blanking 102 + +*/ + +uint8 dmarate_table[16] = { + 83 , 102, 8, 9, // M68k to VRAM + 167, 205, 16, 18, // M68k to VSRAM or CRAM + 166, 204, 15, 17, // DMA fill + 83 , 102, 8, 9 // DMA Copy +}; + +uint8 sat[0x400]; /* Internal copy of sprite attribute table */ +uint8 vram[0x10000]; /* Video RAM (64Kx8) */ +uint8 cram[0x80]; /* On-chip color RAM (64x9) */ +uint8 vsram[0x80]; /* On-chip vertical scroll RAM (40x11) */ +uint8 reg[0x20]; /* Internal VDP registers (23x8) */ +uint16 addr; /* Address register */ +uint16 addr_latch; /* Latched A15, A14 of address */ +uint8 code; /* Code register */ +uint8 pending; /* Pending write flag */ +uint16 status; /* VDP status flags */ +uint16 ntab; /* Name table A base address */ +uint16 ntbb; /* Name table B base address */ +uint16 ntwb; /* Name table W base address */ +uint16 satb; /* Sprite attribute table base address */ +uint16 hscb; /* Horizontal scroll table base address */ +uint16 sat_base_mask; /* Base bits of SAT */ +uint16 sat_addr_mask; /* Index bits of SAT */ +uint8 border; /* Border color index */ +uint8 bg_name_dirty[0x800]; /* 1= This pattern is dirty */ +uint16 bg_name_list[0x800]; /* List of modified pattern indices */ +uint16 bg_list_index; /* # of modified patterns in list */ +uint8 bg_pattern_cache[0x80000]; /* Cached and flipped patterns */ +uint8 playfield_shift; /* Width of planes A, B (in bits) */ +uint8 playfield_col_mask; /* Vertical scroll mask */ +uint16 playfield_row_mask; /* Horizontal scroll mask */ +uint32 y_mask; /* Name table Y-index bits mask */ +uint8 hint_pending; /* 0= Line interrupt is pending */ +uint8 vint_pending; /* 1= Frame interrupt is pending */ +int16 h_counter; /* Raster counter */ +int16 hc_latch; /* latched HCounter (INT2) */ +uint16 v_counter; /* VDP scan line counter */ +uint8 im2_flag; /* 1= Interlace mode 2 is being used */ +uint16 frame_end; /* End-of-frame (IRQ line) */ +uint8 dmafill; /* 1= DMA fill has been requested */ +uint32 dma_endCycles; /* DMA ending cycles count */ +uint8 vdp_pal = 0 ; /* CPU mode (NTSC by default) */ +uint8 vdp_rate = 60; /* CPU speed (60Hz by default)*/ +void (*color_update) (int index, uint16 data); + +uint8 dmatiming = 1; +uint8 vdptiming = 0; +uint8 irqtiming = 0; + +/*--------------------------------------------------------------------------*/ +/* Init, reset, shutdown functions */ +/*--------------------------------------------------------------------------*/ +void vdp_init (void) +{} + +void vdp_reset (void) +{ + memset ((char *) sat, 0, sizeof (sat)); + memset ((char *) vram, 0, sizeof (vram)); + memset ((char *) cram, 0, sizeof (cram)); + memset ((char *) vsram, 0, sizeof (vsram)); + memset ((char *) reg, 0, sizeof (reg)); + + addr = addr_latch = code = pending = 0; + ntab = ntbb = ntwb = satb = hscb = 0; + sat_base_mask = 0xFE00; + sat_addr_mask = 0x01FF; + + /* Mark all colors as dirty to force a palette update */ + border = 0x00; + + memset ((char *) bg_name_dirty, 0, sizeof (bg_name_dirty)); + memset ((char *) bg_name_list, 0, sizeof (bg_name_list)); + bg_list_index = 0; + memset ((char *) bg_pattern_cache, 0, sizeof (bg_pattern_cache)); + + playfield_shift = 6; + playfield_col_mask = 0x0F; + playfield_row_mask = 0x0FF; + y_mask = 0x1FC0; + + hint_pending = vint_pending = 0; + h_counter = 0; + hc_latch = -1; + v_counter = 0; + dmafill = 0; + im2_flag = 0; + frame_end = 0xE0; + dma_endCycles = 0; + + status = 0x200; /* fifo empty - all other flags clear */ + + /* Initialize viewport */ + bitmap.viewport.x = 0x20; + bitmap.viewport.y = 0x20; + bitmap.viewport.w = 256; + bitmap.viewport.h = 224; + bitmap.viewport.oh = 256; + bitmap.viewport.ow = 224; + bitmap.viewport.changed = 1; +} + +void vdp_shutdown (void) +{} + +/*--------------------------------------------------------------------------*/ +/* DMA Operations */ +/*--------------------------------------------------------------------------*/ + +/* DMA Timings */ +/* timing type = 0 (Copy to VRAM), 1 (Copy to VSRAM or CRAM), 2 (VRAM Fill), 3 (VRAM Copy) */ +void dma_update(int type, int length) +{ + uint32 dma_cycles; + uint8 index = 4 * type; /* DMA timing type */ + + if (!dmatiming) return; + + /* get the appropriate tranfer rate (bytes/line) for this DMA operation */ + if (!(status&8) && (reg[1]&0x40)) index += 2; /* not in VBLANK and Display ON */ + index += (reg[12] & 1); /* 32 or 40 Horizontal Cells */ + + /* determinate associated 68kcycles number */ + dma_cycles = (misc68Kcycles * length ) / dmarate_table[index]; + + if (type < 2) + { + /* 68K COPY to V-RAM */ + /* 68K is frozen during DMA operation */ + m68k_freeze(dma_cycles); + } + else + { + /* VRAM Fill or VRAM Copy */ + /* we keep the number of cycles executed so far */ + /* used for DMA Busy flag update on status read */ + dma_endCycles = count_m68k + m68k_cycles_run() + dma_cycles; + dma_m68k = 0; + + /* set DMA Busy flag */ + status |= 0x0002; + } +} + +/* VRAM to VRAM copy + Read byte from VRAM (source), write to VRAM (addr), + bump source and add r15 to addr. + + - see how source addr is affected + (can it make high source byte inc?) */ +void dma_copy (void) +{ + int length = (reg[20] << 8 | reg[19]) & 0xFFFF; + int source = (reg[22] << 8 | reg[21]) & 0xFFFF; + if (!length) length = 0x10000; + + dma_update(3,length); + + do + { + vram[addr] = vram[source]; + MARK_BG_DIRTY (addr); + source = (source + 1) & 0xFFFF; + addr += reg[15]; + } + while (--length); + + reg[19] = length & 0xFF; + reg[20] = (length >> 8) & 0xFF; + reg[21] = source & 0xFF; /* not sure */ + reg[22] = (source >> 8) & 0xFF; +} + + +/* 68K Copy to VRAM, VSRAM or CRAM */ +void dma_vbus (void) +{ + uint32 base, source = ((reg[23] & 0x7F) << 17 | reg[22] << 9 | reg[21] << 1) & 0xFFFFFE; + uint32 length = (reg[20] << 8 | reg[19]) & 0xFFFF; + uint8 old_vdptiming = vdptiming; + + if (!length) length = 0x10000; + base = source; + + /* DMA timings */ + if ((code & 0x0F) == 0x01) dma_update(0,length); /* VRAM */ + else dma_update(1,length); /* CRAM & VSRAM */ + vdptiming = 0; + + do + { + uint16 temp = vdp_dma_r (source); + source += 2; + source = ((base & 0xFE0000) | (source & 0x1FFFF)); + vdp_data_w (temp); + } + while (--length); + + vdptiming = old_vdptiming; + reg[19] = length & 0xFF; + reg[20] = (length >> 8) & 0xFF; + reg[21] = (source >> 1) & 0xFF; + reg[22] = (source >> 9) & 0xFF; + reg[23] = (reg[23] & 0x80) | ((source >> 17) & 0x7F); +} + +/* VRAM FILL */ +void dma_fill(uint16 data) +{ + int length = (reg[20] << 8 | reg[19]) & 0xFFFF; + + if (!length) length = 0x10000; + + dma_update(2, length); + WRITE_BYTE(vram, addr, data & 0xFF); + + do + { + WRITE_BYTE(vram, addr^1, (data >> 8) & 0xFF); + MARK_BG_DIRTY (addr); + addr += reg[15]; + } + while (--length); + + reg[19] = length & 0xFF; + reg[20] = (length >> 8) & 0xFF; + dmafill = 0; +} + + +/*--------------------------------------------------------------------------*/ +/* Memory access functions */ +/*--------------------------------------------------------------------------*/ + +void vdp_ctrl_w (uint16 data) +{ + if (pending == 0) + { + if ((data & 0xC000) == 0x8000) + { + uint8 r = (data >> 8) & 0x1F; + uint8 d = data & 0xFF; + vdp_reg_w (r, d); + } + else pending = 1; + + addr = ((addr_latch & 0xC000) | (data & 0x3FFF)) & 0xFFFF; + code = ((code & 0x3C) | ((data >> 14) & 0x03)) & 0x3F; + } + else + { + /* Clear pending flag */ + pending = 0; + + /* Update address and code registers */ + addr = ((addr & 0x3FFF) | ((data & 3) << 14)) & 0xFFFF; + code = ((code & 0x03) | ((data >> 2) & 0x3C)) & 0x3F; + + /* Save address bits A15 and A14 */ + addr_latch = (addr & 0xC000); + + if ((code & 0x20) && (reg[1] & 0x10)) + { + switch (reg[23] & 0xC0) + { + case 0x00: /* V bus to VDP DMA */ + case 0x40: /* V bus to VDP DMA */ + dma_vbus (); + break; + + case 0x80: /* VRAM fill */ + dmafill = 1; + break; + + case 0xC0: /* VRAM copy */ + dma_copy (); + break; + } + } + } +} + +uint16 vdp_ctrl_r (void) +{ + /** + * Return vdp status + * + * Bits are + * 0 0:1 ntsc:pal + * 1 DMA Busy + * 2 During HBlank + * 3 During VBlank + * 4 Frame Interlace 0:even 1:odd + * 5 Sprite collision + * 6 Too many sprites per line + * 7 v interrupt occurred + * 8 Write FIFO full + * 9 Write FIFO empty + * 10 - 15 Next word on bus + */ + + uint16 temp; + int dma_lastCycles = dma_endCycles - (dma_m68k + count_m68k + m68k_cycles_run()); + + /* reset DMA status flag if needed */ + if ((status & 0x0002) && (dma_lastCycles <= 0)) status &= 0xFFFD; + + temp = status | vdp_pal; + pending = 0; + + /* reset status */ + status ^= 0xFF00; /* toggle FIFO status & new word on bus */ + status &= 0xFF9F; /* clear sprite overflow & sprite collision */ + if (!(status & 8)) status &= ~0x0080; /* not in VBLANK: clear vint flag */ + + if (!(reg[1] & 0x40)) temp |= 0x8; /* no display => in VBLANK*/ + + return (temp); +} + + +void vdp_data_w (uint16 data) +{ + /* Clear pending flag */ + pending = 0; + + if (dmafill) + { + dma_fill(data); + return; + } + + /* delays VDP RAM access */ + /* hack for Chaos Engine / Soldiers of Fortune */ + if (vdptiming && !(status&8) && (reg[1]&0x40)) + { + if (reg[12] & 1) m68k_freeze(30); // 40 cell + else m68k_freeze(27); // 32 cell + } + + switch (code & 0x0F) + { + case 0x01: /* VRAM */ + + /* Byte-swap data if A0 is set */ + if (addr & 1) data = (data >> 8) | (data << 8); + + /* Copy SAT data to the internal SAT */ + if ((addr & sat_base_mask) == satb) + { + *(uint16 *) & sat[addr & sat_addr_mask] = data; + } + + /* Only write unique data to VRAM */ + if (data != *(uint16 *) & vram[addr & 0xFFFE]) + { + /* Write data to VRAM */ + *(uint16 *) & vram[addr & 0xFFFE] = data; + + /* Update the pattern cache */ + MARK_BG_DIRTY (addr); + } + break; + + case 0x03: /* CRAM */ + { + uint16 *p = (uint16 *) & cram[(addr & 0x7E)]; + data = PACK_CRAM (data & 0x0EEE); + if (data != *p) + { + int index = (addr >> 1) & 0x3F; + *p = data; + color_update (index, *p); + color_update (0x00, *(uint16 *)&cram[border << 1]); + } + } + break; + + case 0x05: /* VSRAM */ + *(uint16 *) & vsram[(addr & 0x7E)] = data; + break; + } + + /* Bump address register */ + addr += reg[15]; + +} + + +uint16 vdp_data_r (void) +{ + uint16 temp = 0; + + /* Clear pending flag */ + pending = 0; + + switch (code & 0x0F) + { + case 0x00: /* VRAM */ + temp = *(uint16 *) & vram[(addr & 0xFFFE)]; + break; + + case 0x08: /* CRAM */ + temp = *(uint16 *) & cram[(addr & 0x7E)]; + temp = UNPACK_CRAM (temp); + break; + + case 0x04: /* VSRAM */ + temp = *(uint16 *) & vsram[(addr & 0x7E)]; + break; + } + + /* Bump address register */ + addr += reg[15]; + + /* return data */ + return (temp); +} + + +/* + The reg[] array is updated at the *end* of this function, so the new + register data can be compared with the previous data. +*/ +void vdp_reg_w (uint8 r, uint8 d) +{ + switch (r) + { + case 0x00: /* CTRL #1 */ + if (vint_pending && (reg[1] & 0x20)) m68k_set_irq (6); + else if (hint_pending && (d & 0x10)) m68k_set_irq (4); + else m68k_set_irq (0); + if (!(d & 0x02)) hc_latch = -1; + + break; + + case 0x01: /* CTRL #2 */ + if (vint_pending && (d & 0x20)) + { + if (irqtiming) m68k_run(count_m68k + 24); /* hack for Sesame's Street */ + m68k_set_irq (6); + } + else if (hint_pending && (reg[0] & 0x10)) m68k_set_irq (4); /* fix Lemmings status bar */ + else m68k_set_irq (0); + + /* Change the frame timing */ + frame_end = (d & 8) ? 0xF0 : 0xE0; + + /* Check if the viewport height has actually been changed */ + if ((reg[1] & 8) != (d & 8)) + { + /* Update the height of the viewport */ + bitmap.viewport.oh = bitmap.viewport.h; + bitmap.viewport.h = (d & 8) ? 240 : 224; + bitmap.viewport.changed = 1; + } + break; + + case 0x02: /* NTAB */ + ntab = (d << 10) & 0xE000; + break; + + case 0x03: /* NTWB */ + ntwb = (d << 10) & ((reg[12] & 1) ? 0xF000 : 0xF800); + break; + + case 0x04: /* NTBB */ + ntbb = (d << 13) & 0xE000; + break; + + case 0x05: /* SATB */ + sat_base_mask = (reg[12] & 1) ? 0xFC00 : 0xFE00; + sat_addr_mask = (reg[12] & 1) ? 0x03FF : 0x01FF; + satb = (d << 9) & sat_base_mask; + break; + + case 0x07: + d &= 0x3F; + + /* Check if the border color has actually changed */ + if (border != d) + { + /* Mark the border color as modified */ + border = d; + color_update (0x00, *(uint16 *) & cram[(border << 1)]); + } + break; + + case 0x0C: + /* Check if the viewport width has actually been changed */ + if ((reg[0x0C] & 1) != (d & 1)) + { + /* Update the width of the viewport */ + bitmap.viewport.ow = bitmap.viewport.w; + bitmap.viewport.w = (d & 1) ? 320 : 256; + bitmap.viewport.changed = 1; + } + + /* See if the S/TE mode bit has changed */ + if ((reg[0x0C] & 8) != (d & 8)) + { + int i; + reg[0x0C] = d; + + /* Update colors */ + for (i = 0; i < 0x40; i += 1) color_update (i, *(uint16 *) & cram[i << 1]); + color_update (0x00, *(uint16 *) & cram[border << 1]); + } + + /* Check interlace mode 2 setting */ + im2_flag = ((d & 0x06) == 0x06) ? 1 : 0; + + /* The following register updates check this value */ + reg[0x0C] = d; + + /* Update display-dependant registers */ + vdp_reg_w (0x03, reg[0x03]); + vdp_reg_w (0x05, reg[0x05]); + break; + + case 0x0D: /* HSCB */ + hscb = (d << 10) & 0xFC00; + break; + + case 0x10: /* Playfield size */ + playfield_shift = shift_table[(d & 3)]; + playfield_col_mask = col_mask_table[(d & 3)]; + playfield_row_mask = row_mask_table[(d >> 4) & 3]; + y_mask = y_mask_table[(d & 3)]; + break; + } + + /* Write new register value */ + reg[r] = d; +} + + +uint16 vdp_hvc_r (void) +{ + int cycles = (count_m68k + m68k_cycles_run ()) % misc68Kcycles; + uint8 *hctab = (reg[12] & 1) ? cycle2hc40 : cycle2hc32; + uint16 *vctab = (vdp_pal) ? vc_pal_224 : vc_ntsc_224; + if ((reg[1] & 8) && vdp_pal) vctab = vc_pal_240; + + uint8 hc = (hc_latch == -1) ? hctab[cycles] : (hc_latch&0xFF); + + uint16 vc = vctab[v_counter]; + + /* interlace mode 2 */ + if (im2_flag) vc = (vc & 0xFE) | ((vc >> 8) & 0x01); + + return (((vc << 8)&0xFF00) | hc); +} + + +void vdp_test_w (uint16 value) +{} diff --git a/source/vdp.h b/source/vdp.h new file mode 100644 index 0000000..7bf6c64 --- /dev/null +++ b/source/vdp.h @@ -0,0 +1,62 @@ + +#ifndef _VDP_H_ +#define _VDP_H_ + +/* Global variables */ +extern uint8 sat[0x400]; +extern uint8 vram[0x10000]; +extern uint8 cram[0x80]; +extern uint8 vsram[0x80]; +extern uint8 reg[0x20]; +extern uint16 addr; +extern uint16 addr_latch; +extern uint8 code; +extern uint8 pending; +extern uint16 status; +extern uint16 ntab; +extern uint16 ntbb; +extern uint16 ntwb; +extern uint16 satb; +extern uint16 hscb; +extern uint16 sat_base_mask; +extern uint16 sat_addr_mask; +extern uint8 border; +extern uint8 bg_name_dirty[0x800]; +extern uint16 bg_name_list[0x800]; +extern uint16 bg_list_index; +extern uint8 bg_pattern_cache[0x80000]; +extern uint8 playfield_shift; +extern uint8 playfield_col_mask; +extern uint16 playfield_row_mask; +extern uint32 y_mask; +extern uint8 hint_pending; +extern uint8 vint_pending; +extern int16 h_counter; +extern int16 hc_latch; +extern uint16 v_counter; +extern uint8 im2_flag; +extern uint16 frame_end; +extern uint8 dmafill; +extern uint8 vdp_pal; +extern uint8 vdp_rate; +extern uint32 dma_endCycles; +extern void (*color_update)(int index, uint16 data); + + +/* Function prototypes */ +void vdp_init(void); +void vdp_reset(void); +void vdp_shutdown(void); +void vdp_ctrl_w(uint16 data); +uint16 vdp_ctrl_r(void); +void vdp_data_w(uint16 data); +uint16 vdp_data_r(void); +void vdp_reg_w(uint8 r, uint8 d); +uint16 vdp_hvc_r(void); +void dma_copy(void); +void dma_vbus(void); +void dma_update(int type, int length); +void dma_fill(uint16 data); +void vdp_test_w(uint16 value); + +#endif /* _VDP_H_ */