]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1340b2.zip
authorToni Wilen <twilen@winuae.net>
Sat, 2 Dec 2006 15:03:56 +0000 (17:03 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:30:10 +0000 (21:30 +0200)
455 files changed:
7z/7zAlloc.c [changed mode: 0755->0644]
7z/7zAlloc.h [changed mode: 0755->0644]
7z/7zBuffer.c [changed mode: 0755->0644]
7z/7zBuffer.h [changed mode: 0755->0644]
7z/7zCrc.c [changed mode: 0755->0644]
7z/7zCrc.h [changed mode: 0755->0644]
7z/7zDecode.c [changed mode: 0755->0644]
7z/7zDecode.h [changed mode: 0755->0644]
7z/7zExtract.c [changed mode: 0755->0644]
7z/7zExtract.h [changed mode: 0755->0644]
7z/7zHeader.c [changed mode: 0755->0644]
7z/7zHeader.h [changed mode: 0755->0644]
7z/7zIn.c [changed mode: 0755->0644]
7z/7zIn.h [changed mode: 0755->0644]
7z/7zItem.c [changed mode: 0755->0644]
7z/7zItem.h [changed mode: 0755->0644]
7z/7zMain.c [changed mode: 0755->0644]
7z/7zMethodID.c [changed mode: 0755->0644]
7z/7zMethodID.h [changed mode: 0755->0644]
7z/7zTypes.h [changed mode: 0755->0644]
7z/LzmaDecode.c [changed mode: 0755->0644]
7z/LzmaDecode.h [changed mode: 0755->0644]
7z/LzmaTypes.h [changed mode: 0755->0644]
ChangeLog [changed mode: 0755->0644]
akiko.c [changed mode: 0755->0644]
akiko2.c [changed mode: 0755->0644]
ar.c [changed mode: 0755->0644]
arcadia.c [changed mode: 0755->0644]
audio.c [changed mode: 0755->0644]
autoconf.c [changed mode: 0755->0644]
blitops.c [changed mode: 0755->0644]
blitter.c [changed mode: 0755->0644]
blitter2.c [changed mode: 0755->0644]
blitter3.c [changed mode: 0755->0644]
blkdev.c [changed mode: 0755->0644]
bsdsocket.c [changed mode: 0755->0644]
build68k.c [changed mode: 0755->0644]
catweasel.c [changed mode: 0755->0644]
cdrom.c [changed mode: 0755->0644]
cdtv.c [changed mode: 0755->0644]
cfgfile.c [changed mode: 0755->0644]
cia.c [changed mode: 0755->0644]
compemu_fpp.c [changed mode: 0755->0644]
compemu_optimizer.c [changed mode: 0755->0644]
compemu_optimizer_x86.c [changed mode: 0755->0644]
compemu_raw_x86.c [changed mode: 0755->0644]
compemu_support.c [changed mode: 0755->0644]
core.cw4.c [changed mode: 0755->0644]
cpuopti.c [changed mode: 0755->0644]
crc32.c [changed mode: 0755->0644]
custom.c [changed mode: 0755->0644]
custom2.c [changed mode: 0755->0644]
debug.c [changed mode: 0755->0644]
disk.c [changed mode: 0755->0644]
dms/cdata.h [changed mode: 0755->0644]
dms/crc_csum.c [changed mode: 0755->0644]
dms/crc_csum.h [changed mode: 0755->0644]
dms/getbits.c [changed mode: 0755->0644]
dms/getbits.h [changed mode: 0755->0644]
dms/maketbl.c [changed mode: 0755->0644]
dms/maketbl.h [changed mode: 0755->0644]
dms/pfile.c [changed mode: 0755->0644]
dms/pfile.h [changed mode: 0755->0644]
dms/tables.c [changed mode: 0755->0644]
dms/tables.h [changed mode: 0755->0644]
dms/u_deep.c [changed mode: 0755->0644]
dms/u_deep.h [changed mode: 0755->0644]
dms/u_heavy.c [changed mode: 0755->0644]
dms/u_heavy.h [changed mode: 0755->0644]
dms/u_init.c [changed mode: 0755->0644]
dms/u_init.h [changed mode: 0755->0644]
dms/u_medium.c [changed mode: 0755->0644]
dms/u_medium.h [changed mode: 0755->0644]
dms/u_quick.c [changed mode: 0755->0644]
dms/u_quick.h [changed mode: 0755->0644]
dms/u_rle.c [changed mode: 0755->0644]
dms/u_rle.h [changed mode: 0755->0644]
drawing.c [changed mode: 0755->0644]
driveclick.c [changed mode: 0755->0644]
enforcer.c [changed mode: 0755->0644]
ersatz.c [changed mode: 0755->0644]
expansion.c [changed mode: 0755->0644]
fdi2raw.c [changed mode: 0755->0644]
filesys.asm [changed mode: 0755->0644]
filesys.c [changed mode: 0755->0644]
filesys.sh [changed mode: 0755->0644]
filesys_bootrom.c [changed mode: 0755->0644]
fpp.c [changed mode: 0755->0644]
fsdb.c [changed mode: 0755->0644]
fsdb_unix.c [changed mode: 0755->0644]
fsusage.c [changed mode: 0755->0644]
gayle.c [changed mode: 0755->0644]
genblitter.c [changed mode: 0755->0644]
gencomp.c [changed mode: 0755->0644]
gencpu.c [changed mode: 0755->0644]
gengenblitter.c [changed mode: 0755->0644]
genlinetoscr.c [changed mode: 0755->0644]
genp2c.c [changed mode: 0755->0644]
gfxlib.c [changed mode: 0755->0644]
gfxutil.c [changed mode: 0755->0644]
gtkui.c [changed mode: 0755->0644]
hardfile.c [changed mode: 0755->0644]
hrtmon_rom.c [changed mode: 0755->0644]
identify.c [changed mode: 0755->0644]
include/akiko.h [changed mode: 0755->0644]
include/ar.h [changed mode: 0755->0644]
include/arcadia.h [changed mode: 0755->0644]
include/audio.h [changed mode: 0755->0644]
include/autoconf.h [changed mode: 0755->0644]
include/blitter.h [changed mode: 0755->0644]
include/blkdev.h [changed mode: 0755->0644]
include/bsdsocket.h [changed mode: 0755->0644]
include/catweasel.h [changed mode: 0755->0644]
include/cdtv.h [changed mode: 0755->0644]
include/cia.h [changed mode: 0755->0644]
include/commpipe.h [changed mode: 0755->0644]
include/compemu.h [changed mode: 0755->0644]
include/cpu_prefetch.h [changed mode: 0755->0644]
include/crc32.h [changed mode: 0755->0644]
include/custom.h [changed mode: 0755->0644]
include/debug.h [changed mode: 0755->0644]
include/disk.h [changed mode: 0755->0644]
include/drawing.h [changed mode: 0755->0644]
include/driveclick.h [changed mode: 0755->0644]
include/enforcer.h [changed mode: 0755->0644]
include/ersatz.h [changed mode: 0755->0644]
include/events.h [changed mode: 0755->0644]
include/events_jit.h [changed mode: 0755->0644]
include/events_normal.h [changed mode: 0755->0644]
include/execlib.h [changed mode: 0755->0644]
include/fdi2raw.h [changed mode: 0755->0644]
include/filesys.h [changed mode: 0755->0644]
include/filter.h [changed mode: 0755->0644]
include/fpp-ieee-be.h [changed mode: 0755->0644]
include/fpp-unknown.h [changed mode: 0755->0644]
include/fsdb.h [changed mode: 0755->0644]
include/fsusage.h [changed mode: 0755->0644]
include/genblitter.h [changed mode: 0755->0644]
include/gensound.h [changed mode: 0755->0644]
include/gfxfilter.h [changed mode: 0755->0644]
include/gui.h [changed mode: 0755->0644]
include/identify.h [changed mode: 0755->0644]
include/inputdevice.h [changed mode: 0755->0644]
include/keyboard.h [changed mode: 0755->0644]
include/keybuf.h [changed mode: 0755->0644]
include/mackbd.h [changed mode: 0755->0644]
include/memory.h [changed mode: 0755->0644]
include/moduleripper.h [changed mode: 0755->0644]
include/native2amiga.h [changed mode: 0755->0644]
include/newcpu.h [changed mode: 0755->0644]
include/options.h [changed mode: 0755->0644]
include/osemu.h [changed mode: 0755->0644]
include/parallel.h [changed mode: 0755->0644]
include/picasso96.h [changed mode: 0755->0644]
include/readcpu.h [changed mode: 0755->0644]
include/savestate.h [changed mode: 0755->0644]
include/scsidev.h [changed mode: 0755->0644]
include/serial.h [changed mode: 0755->0644]
include/sysconfig.h.win32 [changed mode: 0755->0644]
include/sysdeps.h [changed mode: 0755->0644]
include/traps.h [changed mode: 0755->0644]
include/tui.h [changed mode: 0755->0644]
include/uae.h [changed mode: 0755->0644]
include/uaeexe.h [changed mode: 0755->0644]
include/uaeipc.h [changed mode: 0755->0644]
include/unzip.h [changed mode: 0755->0644]
include/xwin.h [changed mode: 0755->0644]
include/zfile.h [changed mode: 0755->0644]
inputdevice.c [changed mode: 0755->0644]
inputevents.def [changed mode: 0755->0644]
keybuf.c [changed mode: 0755->0644]
main.c [changed mode: 0755->0644]
memory.c [changed mode: 0755->0644]
missing.c [changed mode: 0755->0644]
moduleripper.c [changed mode: 0755->0644]
native2amiga.c [changed mode: 0755->0644]
ncurses.c [changed mode: 0755->0644]
newcpu.c [changed mode: 0755->0644]
nogui.c [changed mode: 0755->0644]
od-generic/exectasks.h [changed mode: 0755->0644]
od-generic/joystick.c [changed mode: 0755->0644]
od-generic/memory.h [changed mode: 0755->0644]
od-generic/sound.c [changed mode: 0755->0644]
od-generic/sound.h [changed mode: 0755->0644]
od-win32/7zplugin.c [changed mode: 0755->0644]
od-win32/WinUAE_Install.nsi [changed mode: 0755->0644]
od-win32/ahidsound.c [changed mode: 0755->0644]
od-win32/ahidsound.h [changed mode: 0755->0644]
od-win32/asm.bat [changed mode: 0755->0644]
od-win32/avioutput.c [changed mode: 0755->0644]
od-win32/avioutput.h [changed mode: 0755->0644]
od-win32/blkdev_win32_aspi.c [changed mode: 0755->0644]
od-win32/blkdev_win32_ioctl.c [changed mode: 0755->0644]
od-win32/blkdev_win32_spti.c [changed mode: 0755->0644]
od-win32/bsdsock.c [changed mode: 0755->0644]
od-win32/build68k_msvc/build68k_msvc.rc [changed mode: 0755->0644]
od-win32/build68k_msvc/build68k_msvc.vcproj [changed mode: 0755->0644]
od-win32/build68k_msvc/resource.h [deleted file]
od-win32/caps/CapsAPI.h [changed mode: 0755->0644]
od-win32/caps/CapsLib.h [changed mode: 0755->0644]
od-win32/caps/Comlib.h [changed mode: 0755->0644]
od-win32/caps/Comtype.h [changed mode: 0755->0644]
od-win32/caps/caps_win32.c [changed mode: 0755->0644]
od-win32/caps/caps_win32.h [changed mode: 0755->0644]
od-win32/dinput.c [changed mode: 0755->0644]
od-win32/direct3d.c [changed mode: 0755->0644]
od-win32/direct3d.h [changed mode: 0755->0644]
od-win32/diskutil.c [changed mode: 0755->0644]
od-win32/diskutil.h [changed mode: 0755->0644]
od-win32/driveclick_win32.c [changed mode: 0755->0644]
od-win32/dxwrap.c [changed mode: 0755->0644]
od-win32/dxwrap.h [changed mode: 0755->0644]
od-win32/fdrawcmd.c [changed mode: 0755->0644]
od-win32/fsdb_win32.c [changed mode: 0755->0644]
od-win32/genblitter_msvc/genblitter_msvc.vcproj [changed mode: 0755->0644]
od-win32/gencomp_msvc/gencomp_msvc.vcproj [changed mode: 0755->0644]
od-win32/gencpu_msvc/gencpu_msvc.vcproj [changed mode: 0755->0644]
od-win32/genlinetoscr_msvc/genlinetoscr_msvc.vcproj [changed mode: 0755->0644]
od-win32/graphics/amiga_header.bmp [changed mode: 0755->0644]
od-win32/graphics/amiga_welcome.bmp [changed mode: 0755->0644]
od-win32/graphics/installer_icon.ico [changed mode: 0755->0644]
od-win32/hardfile_win32.c [changed mode: 0755->0644]
od-win32/hq2x32.asm [changed mode: 0755->0644]
od-win32/hq3x16.asm [changed mode: 0755->0644]
od-win32/hq3x32.asm [changed mode: 0755->0644]
od-win32/hq4x32.asm [changed mode: 0755->0644]
od-win32/ioport.c [changed mode: 0755->0644]
od-win32/ioport.h [changed mode: 0755->0644]
od-win32/ipctester.c [changed mode: 0755->0644]
od-win32/keyboard_win32.c [changed mode: 0755->0644]
od-win32/lcd.c [changed mode: 0755->0644]
od-win32/lcd.h [changed mode: 0755->0644]
od-win32/machdep/m68k.h [changed mode: 0755->0644]
od-win32/machdep/maccess.h [changed mode: 0755->0644]
od-win32/machdep/rpt.h [changed mode: 0755->0644]
od-win32/machdep/support.c [changed mode: 0755->0644]
od-win32/makeexe.bat [changed mode: 0755->0644]
od-win32/md-fpp.h [changed mode: 0755->0644]
od-win32/midi.c [changed mode: 0755->0644]
od-win32/midi.h [changed mode: 0755->0644]
od-win32/midiin.c [changed mode: 0755->0644]
od-win32/mman.c [changed mode: 0755->0644]
od-win32/opengl.c [changed mode: 0755->0644]
od-win32/opengl.h [changed mode: 0755->0644]
od-win32/parser.c [changed mode: 0755->0644]
od-win32/parser.h [changed mode: 0755->0644]
od-win32/picasso96_win.c [changed mode: 0755->0644]
od-win32/picasso96_win.h [changed mode: 0755->0644]
od-win32/posixemu.c [changed mode: 0755->0644]
od-win32/posixemu.h [changed mode: 0755->0644]
od-win32/resources/35floppy.ico [changed mode: 0755->0644]
od-win32/resources/Mycomp.ico [changed mode: 0755->0644]
od-win32/resources/RCa00564 [changed mode: 0755->0644]
od-win32/resources/WinUAE_German.rc [changed mode: 0755->0644]
od-win32/resources/amigainfo.ico [changed mode: 0755->0644]
od-win32/resources/avioutput.ico [changed mode: 0755->0644]
od-win32/resources/chip.ico [changed mode: 0755->0644]
od-win32/resources/cpu.ico [changed mode: 0755->0644]
od-win32/resources/drive.ico [changed mode: 0755->0644]
od-win32/resources/drive_click.wav [changed mode: 0755->0644]
od-win32/resources/drive_snatch.wav [changed mode: 0755->0644]
od-win32/resources/drive_spin.wav [changed mode: 0755->0644]
od-win32/resources/drive_spinnd.wav [changed mode: 0755->0644]
od-win32/resources/drive_startup.wav [changed mode: 0755->0644]
od-win32/resources/file.ico [changed mode: 0755->0644]
od-win32/resources/folder.ico [changed mode: 0755->0644]
od-win32/resources/h_arrow.cur [changed mode: 0755->0644]
od-win32/resources/joystick.ico [changed mode: 0755->0644]
od-win32/resources/lcd.bmp [changed mode: 0755->0644]
od-win32/resources/misc.ico [changed mode: 0755->0644]
od-win32/resources/move_dow.ico [changed mode: 0755->0644]
od-win32/resources/move_up.ico [changed mode: 0755->0644]
od-win32/resources/paths.ico [changed mode: 0755->0644]
od-win32/resources/quickstart.ico [changed mode: 0755->0644]
od-win32/resources/resource.h [changed mode: 0755->0644]
od-win32/resources/resource.hm [changed mode: 0755->0644]
od-win32/resources/root.ico [changed mode: 0755->0644]
od-win32/resources/screen.ico [changed mode: 0755->0644]
od-win32/resources/sound.ico [changed mode: 0755->0644]
od-win32/resources/winuae.exe.manifest [changed mode: 0755->0644]
od-win32/resources/winuae.ico [changed mode: 0755->0644]
od-win32/resources/winuae.rc [changed mode: 0755->0644]
od-win32/resources/winuae_minimal.rc [changed mode: 0755->0644]
od-win32/resources/xarcade-winuae.bmp [changed mode: 0755->0644]
od-win32/scaler.c [changed mode: 0755->0644]
od-win32/scaler2.c [changed mode: 0755->0644]
od-win32/screenshot.c [changed mode: 0755->0644]
od-win32/scsidef.h [changed mode: 0755->0644]
od-win32/serial_win32.c [changed mode: 0755->0644]
od-win32/sfhelper.c [changed mode: 0755->0644]
od-win32/shm.c [changed mode: 0755->0644]
od-win32/soundcheck.c [changed mode: 0755->0644]
od-win32/sounddep/sound.c [changed mode: 0755->0644]
od-win32/sounddep/sound.h [changed mode: 0755->0644]
od-win32/srcrelease.bat [changed mode: 0755->0644]
od-win32/support.c [changed mode: 0755->0644]
od-win32/sys/ipc.h [changed mode: 0755->0644]
od-win32/sys/mman.h [changed mode: 0755->0644]
od-win32/sys/shm.h [changed mode: 0755->0644]
od-win32/sysconfig.h [changed mode: 0755->0644]
od-win32/target.h [changed mode: 0755->0644]
od-win32/threaddep/thread.h [changed mode: 0755->0644]
od-win32/unistd.h [changed mode: 0755->0644]
od-win32/wcc.sh [changed mode: 0755->0644]
od-win32/win32.c [changed mode: 0755->0644]
od-win32/win32.h [changed mode: 0755->0644]
od-win32/win32_decompress.c [changed mode: 0755->0644]
od-win32/win32_filesys.c [changed mode: 0755->0644]
od-win32/win32_nogui.c [changed mode: 0755->0644]
od-win32/win32_scale2x.c [changed mode: 0755->0644]
od-win32/win32gfx.c [changed mode: 0755->0644]
od-win32/win32gfx.h [changed mode: 0755->0644]
od-win32/win32gui.c [changed mode: 0755->0644]
od-win32/win32gui.h [changed mode: 0755->0644]
od-win32/winuae_msvc/winuae_msvc.vcproj [changed mode: 0755->0644]
od-win32/winuaechangelog.txt [changed mode: 0755->0644]
od-win32/wrc.sh [changed mode: 0755->0644]
od-win32/writelog.c [changed mode: 0755->0644]
picasso96.c [changed mode: 0755->0644]
prowizard/misc/misc.c [changed mode: 0755->0644]
prowizard/misc/testbag.c [changed mode: 0755->0644]
prowizard/prowiz.c [changed mode: 0755->0644]
prowizard/rippers/AC1D_packer.c [changed mode: 0755->0644]
prowizard/rippers/AMOS-MusicBank.c [changed mode: 0755->0644]
prowizard/rippers/AMOS-PowerPackerBank.c [changed mode: 0755->0644]
prowizard/rippers/BP-Soundmonitor.c [changed mode: 0755->0644]
prowizard/rippers/BSI-FutureComposer.c [changed mode: 0755->0644]
prowizard/rippers/Bytekiller.c [changed mode: 0755->0644]
prowizard/rippers/ChipTracker.c [changed mode: 0755->0644]
prowizard/rippers/Crunchmania-Address.c [changed mode: 0755->0644]
prowizard/rippers/Crunchmania-Simple.c [changed mode: 0755->0644]
prowizard/rippers/DefjamCruncher32-pro.c [changed mode: 0755->0644]
prowizard/rippers/DigiBooster17.c [changed mode: 0755->0644]
prowizard/rippers/DigitalIllusion.c [changed mode: 0755->0644]
prowizard/rippers/DoubleAction.c [changed mode: 0755->0644]
prowizard/rippers/Dragpack100.c [changed mode: 0755->0644]
prowizard/rippers/Dragpack252.c [changed mode: 0755->0644]
prowizard/rippers/EurekaPacker.c [changed mode: 0755->0644]
prowizard/rippers/FC-M-Packer.c [changed mode: 0755->0644]
prowizard/rippers/FastTracker2.c [changed mode: 0755->0644]
prowizard/rippers/FuchsTracker.c [changed mode: 0755->0644]
prowizard/rippers/FutureComposer13.c [changed mode: 0755->0644]
prowizard/rippers/FutureComposer14.c [changed mode: 0755->0644]
prowizard/rippers/FuzzacPacker.c [changed mode: 0755->0644]
prowizard/rippers/GNUPacker12.c [changed mode: 0755->0644]
prowizard/rippers/GPMO.c [changed mode: 0755->0644]
prowizard/rippers/GameMusicCreator.c [changed mode: 0755->0644]
prowizard/rippers/GnuPlayer.c [changed mode: 0755->0644]
prowizard/rippers/HQC2.c [changed mode: 0755->0644]
prowizard/rippers/HeatseekerMC10.c [changed mode: 0755->0644]
prowizard/rippers/HornetPacker.c [changed mode: 0755->0644]
prowizard/rippers/JamCracker.c [changed mode: 0755->0644]
prowizard/rippers/KefrensSoundMachine.c [changed mode: 0755->0644]
prowizard/rippers/MED-Octamed.c [changed mode: 0755->0644]
prowizard/rippers/MOD-compatible.c [changed mode: 0755->0644]
prowizard/rippers/MasterCruncher30-Address.c [changed mode: 0755->0644]
prowizard/rippers/MaxPacker12.c [changed mode: 0755->0644]
prowizard/rippers/MegaCruncher-Object.c [changed mode: 0755->0644]
prowizard/rippers/MegaCruncher.c [changed mode: 0755->0644]
prowizard/rippers/ModuleProtector.c [changed mode: 0755->0644]
prowizard/rippers/Mugician.c [changed mode: 0755->0644]
prowizard/rippers/Newtron.c [changed mode: 0755->0644]
prowizard/rippers/NoiseFromHeaven.c [changed mode: 0755->0644]
prowizard/rippers/NoisePacker1.c [changed mode: 0755->0644]
prowizard/rippers/NoisePacker2.c [changed mode: 0755->0644]
prowizard/rippers/NoisePacker3.c [changed mode: 0755->0644]
prowizard/rippers/NoiseRunner.c [changed mode: 0755->0644]
prowizard/rippers/PhaPacker.c [changed mode: 0755->0644]
prowizard/rippers/PolkaPacker.c [changed mode: 0755->0644]
prowizard/rippers/PowerMusic.c [changed mode: 0755->0644]
prowizard/rippers/PowerPacker23.c [changed mode: 0755->0644]
prowizard/rippers/PowerPacker30.c [changed mode: 0755->0644]
prowizard/rippers/PowerPacker40-library.c [changed mode: 0755->0644]
prowizard/rippers/PowerPacker40.c [changed mode: 0755->0644]
prowizard/rippers/ProPacker10.c [changed mode: 0755->0644]
prowizard/rippers/ProPacker21.c [changed mode: 0755->0644]
prowizard/rippers/ProPacker30.c [changed mode: 0755->0644]
prowizard/rippers/Promizer01.c [changed mode: 0755->0644]
prowizard/rippers/Promizer10c.c [changed mode: 0755->0644]
prowizard/rippers/Promizer18a.c [changed mode: 0755->0644]
prowizard/rippers/Promizer20.c [changed mode: 0755->0644]
prowizard/rippers/Promizer40.c [changed mode: 0755->0644]
prowizard/rippers/Prorunner10.c [changed mode: 0755->0644]
prowizard/rippers/Prorunner20.c [changed mode: 0755->0644]
prowizard/rippers/QuadraComposer.c [changed mode: 0755->0644]
prowizard/rippers/RelokIt10.c [changed mode: 0755->0644]
prowizard/rippers/SGT-Packer.c [changed mode: 0755->0644]
prowizard/rippers/SkytPacker.c [changed mode: 0755->0644]
prowizard/rippers/SoundFX.c [changed mode: 0755->0644]
prowizard/rippers/SoundTracker.c [changed mode: 0755->0644]
prowizard/rippers/SoundTracker26.c [changed mode: 0755->0644]
prowizard/rippers/SpikeCruncher.c [changed mode: 0755->0644]
prowizard/rippers/StartrekkerPack.c [changed mode: 0755->0644]
prowizard/rippers/StimPacker.c [changed mode: 0755->0644]
prowizard/rippers/StoneCracker270.c [changed mode: 0755->0644]
prowizard/rippers/StoneCracker299.c [changed mode: 0755->0644]
prowizard/rippers/StoneCracker299b.c [changed mode: 0755->0644]
prowizard/rippers/StoneCracker299d.c [changed mode: 0755->0644]
prowizard/rippers/StoneCracker300.c [changed mode: 0755->0644]
prowizard/rippers/StoneCracker310.c [changed mode: 0755->0644]
prowizard/rippers/SuperCruncher27.c [changed mode: 0755->0644]
prowizard/rippers/SyncroPacker46.c [changed mode: 0755->0644]
prowizard/rippers/TMK.c [changed mode: 0755->0644]
prowizard/rippers/TNMCruncher.c [changed mode: 0755->0644]
prowizard/rippers/TetraPack102.c [changed mode: 0755->0644]
prowizard/rippers/TetraPack21.c [changed mode: 0755->0644]
prowizard/rippers/TetraPack22.c [changed mode: 0755->0644]
prowizard/rippers/TheDarkDemon.c [changed mode: 0755->0644]
prowizard/rippers/ThePlayer22a.c [changed mode: 0755->0644]
prowizard/rippers/ThePlayer30a.c [changed mode: 0755->0644]
prowizard/rippers/ThePlayer40.c [changed mode: 0755->0644]
prowizard/rippers/ThePlayer41a.c [changed mode: 0755->0644]
prowizard/rippers/ThePlayer50a.c [changed mode: 0755->0644]
prowizard/rippers/ThePlayer60a.c [changed mode: 0755->0644]
prowizard/rippers/ThePlayer61a.c [changed mode: 0755->0644]
prowizard/rippers/TimeCruncher17.c [changed mode: 0755->0644]
prowizard/rippers/TrackerPacker1.c [changed mode: 0755->0644]
prowizard/rippers/TrackerPacker2.c [changed mode: 0755->0644]
prowizard/rippers/TrackerPacker3.c [changed mode: 0755->0644]
prowizard/rippers/TreasurePattern.c [changed mode: 0755->0644]
prowizard/rippers/TryItCruncher101.c [changed mode: 0755->0644]
prowizard/rippers/TurboSqueezer61.c [changed mode: 0755->0644]
prowizard/rippers/UnicTracker.c [changed mode: 0755->0644]
prowizard/rippers/UnicTracker2.c [changed mode: 0755->0644]
prowizard/rippers/WantonPacker.c [changed mode: 0755->0644]
prowizard/rippers/XannPlayer.c [changed mode: 0755->0644]
prowizard/rippers/ZenPacker.c [changed mode: 0755->0644]
prowizard/rippers/datacrunchers.c [changed mode: 0755->0644]
prowizard/rippers/extern.h [changed mode: 0755->0644]
prowizard/rippers/globals.h [changed mode: 0755->0644]
prowizard/rippers/ptktable.h [changed mode: 0755->0644]
prowizard/rippers/tuning.h [changed mode: 0755->0644]
prowizard/rippers/vars.h [changed mode: 0755->0644]
readcpu.c [changed mode: 0755->0644]
readdisk.c [changed mode: 0755->0644]
rpc.c [changed mode: 0755->0644]
savestate.c [changed mode: 0755->0644]
scsi-none.c [changed mode: 0755->0644]
scsidev.c [changed mode: 0755->0644]
scsiemul.c [changed mode: 0755->0644]
sdl-joystick.c [changed mode: 0755->0644]
serial.c [changed mode: 0755->0644]
sinctable.c [changed mode: 0755->0644]
svga.c [changed mode: 0755->0644]
svgancui.c [changed mode: 0755->0644]
table68k [changed mode: 0755->0644]
traps.c [changed mode: 0755->0644]
tui.c [changed mode: 0755->0644]
uaeexe.c [changed mode: 0755->0644]
uaeipc.c [changed mode: 0755->0644]
uaelib.c [changed mode: 0755->0644]
uaeserial.c [changed mode: 0755->0644]
unzip.c [changed mode: 0755->0644]
writelog.c [changed mode: 0755->0644]
zfile.c [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/akiko.c b/akiko.c
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/ar.c b/ar.c
old mode 100755 (executable)
new mode 100644 (file)
index bedd29a..7c1c852
--- a/ar.c
+++ b/ar.c
@@ -283,6 +283,7 @@ static addrbank hrtmem_bank = {
     hrtmem_lget, hrtmem_wget, hrtmem_bget,
     hrtmem_lput, hrtmem_wput, hrtmem_bput,
     hrtmem_xlate, hrtmem_check, NULL, "HRTMon memory",
+    hrtmem_lget, hrtmem_wget, ABFLAG_RAM
 };
 
 static void copyfromamiga(uae_u8 *dst,uaecptr src,int len)
@@ -685,11 +686,13 @@ static addrbank arrom_bank = {
     arrom_lget, arrom_wget, arrom_bget,
     arrom_lput, arrom_wput, arrom_bput,
     arrom_xlate, arrom_check, NULL, "Action Replay ROM",
+    arrom_lget, arrom_wget, ABFLAG_ROM
 };
 static addrbank arram_bank = {
     arram_lget, arram_wget, arram_bget,
     arram_lput, arram_wput, arram_bput,
     arram_xlate, arram_check, NULL, "Action Replay RAM",
+    arram_lget, arram_wget, ABFLAG_RAM
 };
 
 static void action_replay_unmap_banks()
old mode 100755 (executable)
new mode 100644 (file)
index efccddd..b109545
--- a/arcadia.c
+++ b/arcadia.c
@@ -254,7 +254,8 @@ static void REGPARAM2 arbb_bput (uaecptr addr, uae_u32 b)
 static addrbank arcadia_boot_bank = {
     arbb_lget, arbb_wget, arbb_bget,
     arbb_lput, arbb_wput, arbb_bput,
-    default_xlate, default_check, NULL, "Arcadia BIOS"
+    default_xlate, default_check, NULL, "Arcadia BIOS",
+    arbb_lget, arbb_wget, ABFLAG_ROM
 };
 
 static uae_u32 REGPARAM2 arb_lget (uaecptr addr)
@@ -321,7 +322,8 @@ static void REGPARAM2 arb_bput (uaecptr addr, uae_u32 b)
 static addrbank arcadia_rom_bank = {
     arb_lget, arb_wget, arb_bget,
     arb_lput, arb_wput, arb_bput,
-    default_xlate, default_check, NULL, "Arcadia Game ROM"
+    default_xlate, default_check, NULL, "Arcadia Game ROM",
+    arb_lget, arb_wget, ABFLAG_ROM
 };
 
 int is_arcadia_rom (char *path)
diff --git a/audio.c b/audio.c
old mode 100755 (executable)
new mode 100644 (file)
index c485ee8..9cb4620
--- a/audio.c
+++ b/audio.c
@@ -1444,7 +1444,7 @@ void audio_hsync (int dmaaction)
        audio_activate();
     }
 
-    if (audio_work_to_do > 0) {
+    if (audio_work_to_do > 0 && currprefs.sound_auto) {
        audio_work_to_do--;
        if (audio_work_to_do == 0)
            audio_deactivate();
old mode 100755 (executable)
new mode 100644 (file)
index 9d43904..55ab611
@@ -40,7 +40,8 @@ static uae_u8 *REGPARAM3 rtarea_xlate (uaecptr) REGPARAM;
 addrbank rtarea_bank = {
     rtarea_lget, rtarea_wget, rtarea_bget,
     rtarea_lput, rtarea_wput, rtarea_bput,
-    rtarea_xlate, default_check, NULL, "UAE Boot ROM"
+    rtarea_xlate, default_check, NULL, "UAE Boot ROM",
+    rtarea_lget, rtarea_wget, ABFLAG_ROMIN
 };
 
 uae_u8 *REGPARAM2 rtarea_xlate (uaecptr addr)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 9777388..48c5bb8
--- a/blitter.c
+++ b/blitter.c
@@ -267,7 +267,7 @@ static void blitter_done (void)
     bltstate = BLT_done;
     blitter_done_notify ();
     INTREQ(0x8040);
-    eventtab[ev_blitter].active = 0;
+    event2_remevent(ev2_blitter);
     unset_special (&regs, SPCFLAG_BLTNASTY);
 #ifdef BLITTER_DEBUG
     write_log ("vpos=%d, cycles %d, missed %d, total %d\n",
@@ -642,13 +642,12 @@ static void actually_do_blit(void)
     }
 }
 
-void blitter_handler(void)
+void blitter_handler(uae_u32 data)
 {
     static int blitter_stuck;
+
     if (!dmaen(DMA_BLITTER)) {
-        eventtab[ev_blitter].active = 1;
-        eventtab[ev_blitter].oldcycles = get_cycles ();
-        eventtab[ev_blitter].evtime = 10 * CYCLE_UNIT + get_cycles (); /* wait a little */
+       event2_newevent (ev2_blitter, 10);
        blitter_stuck++;
        if (blitter_stuck < 20000 || !currprefs.immediate_blits)
            return; /* gotta come back later. */
@@ -659,9 +658,7 @@ void blitter_handler(void)
     }
     blitter_stuck = 0;
     if (blit_slowdown > 0 && !currprefs.immediate_blits) {
-        eventtab[ev_blitter].active = 1;
-        eventtab[ev_blitter].oldcycles = get_cycles ();
-        eventtab[ev_blitter].evtime = blit_slowdown * CYCLE_UNIT + get_cycles ();
+       event2_newevent (ev2_blitter, blit_slowdown);
         blit_slowdown = -1;
         return;
     }
@@ -957,7 +954,7 @@ static void blit_bltset (int con)
        blit_diag = blitfill ? blit_cycle_diagram_fill[blit_ch] : blit_cycle_diagram[blit_ch];
     }
     if ((bltcon1 & 0x80) && (currprefs.chipset_mask & CSMASK_ECS_AGNUS))
-       write_log("warning: BLTCON1 DOFF-bit set\n");
+       write_log("warning: ECS BLTCON1 DOFF-bit set\n");
 
     ddat1use = ddat2use = 0;
     blit_dmacount = blit_dmacount2 = 0;
@@ -994,8 +991,10 @@ void reset_blit (int bltcon)
 {
     if (bltstate == BLT_done)
        return;
-    if (bltcon)
-       blit_bltset (bltcon);
+    if (bltcon) {
+       if (bltstate != BLT_work)
+           blit_bltset (bltcon);
+    }
     blit_modset ();
 }
 
@@ -1019,7 +1018,8 @@ void do_blitter (int hpos)
     blit_last_hpos = hpos;
     blit_cyclecounter = 0;
 
-    reset_blit (1|2);
+    blit_bltset (1|2);
+    blit_modset ();
 
     if (blitline) {
        blitsing = bltcon1 & 0x2;
@@ -1029,7 +1029,7 @@ void do_blitter (int hpos)
        blitonedot = 0;
        cycles = blt_info.vblitsize;
     } else {
-       blit_firstline_cycles = blit_first_cycle + blit_diag[1] * blt_info.hblitsize * CYCLE_UNIT;
+       blit_firstline_cycles = blit_first_cycle + (blit_diag[1] * blt_info.hblitsize + cpu_cycles) * CYCLE_UNIT;
        cycles = blt_info.vblitsize * blt_info.hblitsize;
     }
 
@@ -1074,13 +1074,9 @@ void do_blitter (int hpos)
     if (currprefs.immediate_blits)
        cycles = 1;
 
-    eventtab[ev_blitter].active = 1;
-    eventtab[ev_blitter].oldcycles = get_cycles ();
-    eventtab[ev_blitter].evtime = cycles * blit_diag[1] * CYCLE_UNIT + get_cycles ();
-    events_schedule();
+    event2_newevent(ev2_blitter, cycles * blit_diag[1]);
 }
 
-
 void maybe_blit (int hpos, int hack)
 {
     static int warned;
@@ -1104,15 +1100,13 @@ void maybe_blit (int hpos, int hack)
        goto end;
     }
 
-    if (!eventtab[ev_blitter].active)
-       write_log ("FOO!!?\n");
     if (hack == 1 && get_cycles() < blit_firstline_cycles)
        goto end;
 
-    blitter_handler ();
+    blitter_handler (0);
 end:;
 #ifdef BLITTER_DEBUG
-       blitter_delayed_debug = 1;
+    blitter_delayed_debug = 1;
 #endif
 }
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 7069094..13b3218
@@ -220,24 +220,20 @@ SOCKET_TYPE getsock (SB, int sd)
     if ((unsigned int) (sd - 1) >= (unsigned int) sb->dtablesize) {
        TRACE (("Invalid Socket Descriptor (%d)\n", sd));
        bsdsocklib_seterrno (sb, 38); /* ENOTSOCK */
-
        return -1;
     }
-       if (sb->dtable[sd -1] == INVALID_SOCKET)
-               {
-               struct socketbase *sb1,*nsb;
-               // Fix for Newsrog (All Tasks of Newsrog using the same dtable)
-           for (sb1 = socketbases; sb1; sb1 = nsb) 
-                       {
-                       if (strcmp(get_real_address (get_long (sb1->ownertask + 10)),get_real_address (get_long (sb->ownertask + 10))) == 0)
-                               { // Task with same name already exists -> use same dtable 
-                               if (sb1->dtable[sd-1] != INVALID_SOCKET)
-                                       return sb1->dtable[sd-1];
-                               }
-       
-                       nsb = sb1->next;
-                       }
-               }
+    if (sb->dtable[sd - 1] == INVALID_SOCKET) {
+       struct socketbase *sb1,*nsb;
+       // Fix for Newsrog (All Tasks of Newsrog using the same dtable)
+       for (sb1 = socketbases; sb1; sb1 = nsb) {
+           if (strcmp(get_real_address (get_long (sb1->ownertask + 10)), get_real_address (get_long (sb->ownertask + 10))) == 0) {
+               // Task with same name already exists -> use same dtable 
+               if (sb1->dtable[sd - 1] != INVALID_SOCKET)
+                   return sb1->dtable[sd - 1];
+           }
+           nsb = sb1->next;
+       }
+    }
     return sb->dtable[sd - 1];
 }
 
@@ -268,7 +264,7 @@ void addtosigqueue (SB, int events)
 
     unlocksigqueue ();
 
-    INTREQ (0xA000);
+    INTREQ (0x8000 | 0x2000);
 }
 
 static uae_u32 REGPARAM2 bsdsock_int_handler (TrapContext *context)
@@ -1199,23 +1195,17 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context)
                        TRACE (("ERRNOSTRPTR),invalid"));
                    } else {
                        unsigned long ulTmp;
-                       if (currtag & 0x8000)
-                               { /* SBTM_GETREF */
-                               ulTmp = get_long(currval);
-                               }
-                       else
-                               { /* SBTM_GETVAL */
-                               ulTmp = currval;
-                               }
+                       if (currtag & 0x8000) { /* SBTM_GETREF */
+                           ulTmp = get_long(currval);
+                       } else { /* SBTM_GETVAL */
+                           ulTmp = currval;
+                       }
                        TRACE (("ERRNOSTRPTR),%d", ulTmp));
-                       if (ulTmp < number_sys_error)
-                               { 
-                               tagcopy (currtag, currval, tagptr, &errnotextptrs[ulTmp]);
-                               }
-                       else
-                               {
-                               tagcopy (currtag, currval, tagptr, &strErrptr);
-                               }
+                       if (ulTmp < number_sys_error) { 
+                           tagcopy (currtag, currval, tagptr, &errnotextptrs[ulTmp]);
+                       } else {
+                           tagcopy (currtag, currval, tagptr, &strErrptr);
+                       }
                    }
                    break;
                 case SBTC_HERRNOSTRPTR:
@@ -1223,23 +1213,17 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context)
                        TRACE (("HERRNOSTRPTR),invalid"));
                    } else {
                        unsigned long ulTmp;
-                       if (currtag & 0x8000)
-                               { /* SBTM_GETREF */
-                               ulTmp = get_long(currval);
-                               }
-                       else
-                               { /* SBTM_GETVAL */
-                               ulTmp = currval;
-                               }
+                       if (currtag & 0x8000) { /* SBTM_GETREF */
+                           ulTmp = get_long(currval);
+                       } else { /* SBTM_GETVAL */
+                           ulTmp = currval;
+                       }
                        TRACE (("HERRNOSTRPTR),%d", ulTmp));
-                       if (ulTmp < number_host_error)
-                               {
-                               tagcopy (currtag, currval, tagptr, &herrnotextptrs[ulTmp]);
-                               }
-                       else
-                               {
-                               tagcopy (currtag, currval, tagptr, &strErrptr);
-                               }
+                       if (ulTmp < number_host_error) {
+                           tagcopy (currtag, currval, tagptr, &herrnotextptrs[ulTmp]);
+                       } else {
+                           tagcopy (currtag, currval, tagptr, &strErrptr);
+                       }
                    }
                    break;
                 case SBTC_ERRNOBYTEPTR:
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 8c3d1c9..f3ca014
@@ -103,7 +103,6 @@ static uae_u8 get_buttons(void)
 
 int catweasel_read_mouse(int port, int *dx, int *dy, int *buttons)
 {
-    return 0;
     if (!cwc.can_mouse)
        return 0;
     *dx = mouse_x[port];
@@ -308,9 +307,22 @@ static void cw_resetFPGA(void)
     ioport_write (cwc.iobase + 3, 65);
 }
 
-int catweasel4_configure(void)
+static int catweasel3_configure(void)
+{
+    ioport_write (cwc.iobase, 241);
+    ioport_write (cwc.iobase + 1, 0);
+    ioport_write (cwc.iobase + 2, 0);
+    ioport_write (cwc.iobase + 4, 0);
+    ioport_write (cwc.iobase + 5, 0);
+    ioport_write (cwc.iobase + 0x29, 0);
+    ioport_write (cwc.iobase + 0x2b, 0);
+    return 1;
+}
+
+static int catweasel4_configure(void)
 {
     struct zfile *f;
+    time_t t;
 
     ioport_write (cwc.iobase, 241);
     ioport_write (cwc.iobase + 1, 0);
@@ -320,10 +332,11 @@ int catweasel4_configure(void)
     ioport_write (cwc.iobase + 5, 0);
     ioport_write (cwc.iobase + 0x29, 0);
     ioport_write (cwc.iobase + 0x2b, 0);
+    sleep_millis(10);
 
     if (cw_config_done()) {
        write_log ("CW: FPGA already configured, skipping core upload\n");
-       goto ok;
+       return 1;
     }
     cw_resetFPGA();
     sleep_millis(10);
@@ -337,12 +350,19 @@ int catweasel4_configure(void)
        f = zfile_gunzip (f);
     }
     write_log ("CW: starting core upload, this will take few seconds\n");
+    t = time(NULL) + 10; // give up if upload takes more than 10s
     for (;;) {
        uae_u8 b;
        if (zfile_fread (&b, 1, 1, f) != 1)
            break;
        ioport_write (cwc.iobase + 3, (b & 1) ? 67 : 65);
-       while (!cw_fpga_ready());
+       while (!cw_fpga_ready()) {
+           if (time(NULL) >= t) {
+               write_log ("CW: FPGA core upload got stuck!?\n");
+               cw_resetFPGA();
+               return 0;
+           }
+       }
        ioport_write (cwc.iobase + 192, b);
     }
     if (!cw_config_done()) {
@@ -352,7 +372,6 @@ int catweasel4_configure(void)
     }
     sleep_millis(10);
     write_log ("CW: core uploaded successfully\n");
-ok:
     return 1;
 }
 
@@ -363,7 +382,7 @@ ok:
 #define PCI_CW_MK4 "PCI\\VEN_E159&DEV_0001&SUBSYS_00035213"
 #define PCI_CW_MK4_BUG "PCI\\VEN_E159&DEV_0001&SUBSYS_00025213"
 
-extern int os_64bit;
+extern int os_winnt;
 int force_direct_catweasel;
 static int direct_detect(void)
 {
@@ -373,7 +392,7 @@ static int direct_detect(void)
     int devIndex;
     int cw = 0;
 
-    if (!os_64bit && !force_direct_catweasel)
+    if (!os_winnt)
        return 0;
     devs = SetupDiGetClassDevsEx(NULL, NULL, NULL, DIGCF_ALLCLASSES | DIGCF_PRESENT, NULL, NULL, NULL);
     if (devs == INVALID_HANDLE_VALUE)
@@ -469,6 +488,10 @@ static int direct_detect(void)
        }
     }
     SetupDiDestroyDeviceInfoList(devs);
+    if (cw) {
+       if (!ioport_init ())
+           cw = 0;
+    }
     return cw;
 }
 
@@ -478,17 +501,19 @@ int catweasel_init(void)
     int i, len;
     uae_u8 buffer[10000];
     uae_u32 model, base;
+    int detect = 0;
 
     if (cwc.type)
        return 1;
-    catweasel_detect();
 
-    if (currprefs.catweasel >= 100) {
-       cwc.type = currprefs.catweasel >= 0x400 ? 3 : 1;
-       cwc.iobase = currprefs.catweasel;
-       if (!ioport_init())
-           goto fail;
-       strcpy(name, "[DIRECT]");
+    if (force_direct_catweasel >= 100) {
+
+        cwc.iobase = force_direct_catweasel & 0xffff;
+       if (force_direct_catweasel > 0xffff) {
+           cwc.direct_type = force_direct_catweasel >> 16;
+       } else {
+           cwc.direct_type = force_direct_catweasel >= 0x400 ? 3 : 1;
+       }
 
     } else {
 
@@ -501,30 +526,31 @@ int catweasel_init(void)
            if (handle != INVALID_HANDLE_VALUE || currprefs.catweasel > 0)
                break;
        }
-       if (handle == INVALID_HANDLE_VALUE) {
-           strcpy(name, "[DIRECT]");
-           if (ioport_init()) {
-               if (cwc.direct_type == 4) {
-                   if (catweasel4_configure()) {
-                       cwc.type = 4;
-                       cwc.can_joy = 2;
-                       cwc.can_sid = 2;
-                       cwc.can_kb = 1;
-                       cwc.can_mouse = 2;
-                   }
-               } else if (cwc.direct_type == 3) {
-                   cwc.type = 3;
-                   cwc.can_joy = 1;
-                   cwc.can_sid = 1;
-                   cwc.can_kb = 1;
-                   cwc.can_mouse = 0;
-               }
-           }
-           if (cwc.type == 0) {
-               write_log ("CW: No Catweasel detected\n");
-               goto fail;
+       if (handle == INVALID_HANDLE_VALUE)
+           catweasel_detect();
+    }
+
+    if (handle == INVALID_HANDLE_VALUE) {
+        strcpy(name, "[DIRECT]");
+       if (cwc.direct_type && ioport_init()) {
+           if (cwc.direct_type == 4 && catweasel4_configure()) {
+               cwc.type = 4;
+               cwc.can_joy = 2;
+               cwc.can_sid = 2;
+               cwc.can_kb = 1;
+               cwc.can_mouse = 2;
+           } else if (cwc.direct_type == 3 && catweasel3_configure()) {
+               cwc.type = 3;
+               cwc.can_joy = 1;
+               cwc.can_sid = 1;
+               cwc.can_kb = 1;
+               cwc.can_mouse = 0;
            }
        }
+       if (cwc.type == 0) {
+           write_log ("CW: No Catweasel detected\n");
+           goto fail;
+       }
     }
 
     if (!cwc.direct_type) {
@@ -624,17 +650,23 @@ int catweasel_detect (void)
            OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
        if (handle != INVALID_HANDLE_VALUE) {
            CloseHandle (handle);
-           break;
+           write_log("CW: Windows driver device detected '%s'\n", name);
+           detected = 1;
+           return TRUE;
        }
     }
     if (handle == INVALID_HANDLE_VALUE) {
+       if (force_direct_catweasel >= 100) {
+           if (ioport_init()) 
+               return TRUE;
+           return FALSE;
+       }
        if (direct_detect()) {
            detected = 1;
            return TRUE;
        }
     }
-    detected = 1;
-    return TRUE;
+    return FALSE;
 }
 
 #define outb(v,port) catweasel_do_bput(port,v)
diff --git a/cdrom.c b/cdrom.c
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/cdtv.c b/cdtv.c
old mode 100755 (executable)
new mode 100644 (file)
index 2ed259c..8190238
--- a/cdtv.c
+++ b/cdtv.c
@@ -224,6 +224,7 @@ void dmac_init (void)
 addrbank dmac_bank = {
     dmac_lget, dmac_wget, dmac_bget,
     dmac_lput, dmac_wput, dmac_bput,
-    default_xlate, default_check, NULL, "DMAC"
+    default_xlate, default_check, NULL, "DMAC",
+    dummy_lgeti, dummy_wgeti, ABFLAG_IO
 };
 
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/cia.c b/cia.c
old mode 100755 (executable)
new mode 100644 (file)
index 777a28a..5203079
--- a/cia.c
+++ b/cia.c
@@ -322,7 +322,7 @@ static int checkalarm (unsigned long tod, unsigned long alarm, int inc)
        return 0;
     /* emulate buggy TODMED counter.
      * it counts: .. 29 2A 2B 2C 2D 2E 2F 20 30 31 32 ..
-     * (0F->00->10 only takes couple of cycles but it will trigger alarm..
+     * (2F->20->30 only takes couple of cycles but it will trigger alarm..
      */
     if (tod & 0x000fff)
        return 0;
@@ -1037,6 +1037,8 @@ void dumpcia (void)
 static uae_u32 REGPARAM3 cia_lget (uaecptr) REGPARAM;
 static uae_u32 REGPARAM3 cia_wget (uaecptr) REGPARAM;
 static uae_u32 REGPARAM3 cia_bget (uaecptr) REGPARAM;
+static uae_u32 REGPARAM3 cia_lgeti (uaecptr) REGPARAM;
+static uae_u32 REGPARAM3 cia_wgeti (uaecptr) REGPARAM;
 static void REGPARAM3 cia_lput (uaecptr, uae_u32) REGPARAM;
 static void REGPARAM3 cia_wput (uaecptr, uae_u32) REGPARAM;
 static void REGPARAM3 cia_bput (uaecptr, uae_u32) REGPARAM;
@@ -1044,7 +1046,8 @@ static void REGPARAM3 cia_bput (uaecptr, uae_u32) REGPARAM;
 addrbank cia_bank = {
     cia_lget, cia_wget, cia_bget,
     cia_lput, cia_wput, cia_bput,
-    default_xlate, default_check, NULL, "CIA"
+    default_xlate, default_check, NULL, "CIA",
+    cia_lgeti, cia_wgeti, ABFLAG_IO
 };
 
 
@@ -1167,6 +1170,19 @@ uae_u32 REGPARAM2 cia_lget (uaecptr addr)
     return v;
 }
 
+static uae_u32 REGPARAM2 cia_wgeti (uaecptr addr)
+{
+    if (currprefs.cpu_level >= 2)
+       return dummy_wgeti(addr);
+    return cia_wget(addr);
+}
+static uae_u32 REGPARAM2 cia_lgeti (uaecptr addr)
+{
+    if (currprefs.cpu_level >= 2)
+       return dummy_lgeti(addr);
+    return cia_lget(addr);
+}
+
 void REGPARAM2 cia_bput (uaecptr addr, uae_u32 value)
 {
     int r = (addr & 0xf00) >> 8;
@@ -1289,7 +1305,8 @@ static void REGPARAM3 clock_bput (uaecptr, uae_u32) REGPARAM;
 addrbank clock_bank = {
     clock_lget, clock_wget, clock_bget,
     clock_lput, clock_wput, clock_bput,
-    default_xlate, default_check, NULL, "Battery backed up clock"
+    default_xlate, default_check, NULL, "Battery backed up clock",
+    dummy_lgeti, dummy_wgeti, ABFLAG_IO
 };
 
 uae_u32 REGPARAM2 clock_lget (uaecptr addr)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/crc32.c b/crc32.c
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index cb25ef7..d172bc2
--- a/custom.c
+++ b/custom.c
@@ -114,6 +114,7 @@ long cycles_to_hsync_event;
 
 static int rpt_did_reset;
 struct ev eventtab[ev_max];
+struct ev2 eventtab2[ev2_max];
 
 volatile frame_time_t vsynctime, vsyncmintime;
 
@@ -165,6 +166,7 @@ unsigned int beamcon0, new_beamcon0;
 uae_u16 vtotal = MAXVPOS_PAL, htotal = MAXHPOS_PAL;
 static uae_u16 hsstop, hbstrt, hbstop, vsstop, vbstrt, vbstop, hsstrt, vsstrt, hcenter;
 static int interlace_started;
+static int ciavsyncmode;
 
 #define HSYNCTIME (maxhpos * CYCLE_UNIT);
 
@@ -279,7 +281,8 @@ static int cop_min_waittime;
  */
 
 /* Used also by bebox.cpp */
-unsigned long int frametime = 0, lastframetime = 0, timeframes = 0, hsync_counter = 0;
+unsigned long int frametime = 0, lastframetime = 0, timeframes = 0;
+unsigned long hsync_counter = 0, vsync_counter = 0, ciavsync_counter = 0;
 unsigned long int idletime;
 int bogusframe;
 
@@ -2220,6 +2223,7 @@ void init_hz (void)
        changed_prefs.chipset_refreshrate = abs (currprefs.gfx_refreshrate);
     }
 
+    ciavsyncmode = 0;
     beamcon0 = new_beamcon0;
     isntsc = beamcon0 & 0x20 ? 0 : 1;
     if (hack_vpos > 0) {
@@ -2259,6 +2263,7 @@ void init_hz (void)
            minfirstline = 2;
        sprite_vblank_endline = minfirstline - 2;
        dumpsync();
+       ciavsyncmode = 1;
     }
     /* limit to sane values */
     if (vblank_hz < 10)
@@ -2487,16 +2492,12 @@ STATIC_INLINE void COP2LCL (uae_u16 v) { cop2lc = (cop2lc & ~0xffff) | (v & 0xff
 
 static void COPJMP (int num)
 {
-    int was_active = eventtab[ev_copper].active;
     int oldstrobe = cop_state.strobe;
 
-    eventtab[ev_copper].active = 0;
     if (nocustom()) {
        immediate_copper (num);
        return;
     }
-    if (was_active)
-       events_schedule ();
 
     unset_special (&regs, SPCFLAG_COPPER);
     cop_state.ignore_next = 0;
@@ -2543,7 +2544,6 @@ static void DMACON (int hpos, uae_u16 v)
     newcop = (dmacon & DMA_COPPER) && (dmacon & DMA_MASTER);
 
     if (oldcop != newcop) {
-       eventtab[ev_copper].active = 0;
        if (newcop && !oldcop) {
            compute_spcflag_copper ();
        } else if (!newcop) {
@@ -2577,97 +2577,30 @@ static void DMACON (int hpos, uae_u16 v)
     events_schedule();
 }
 
-#define INTDELAY
-
-static int intlev_2 (void)
+int intlev (void)
 {
     uae_u16 imask = intreq & intena;
-    unsigned long cycles = get_cycles ();
-    int c = 4;
-    int i;
-
-    if (!(imask && (intena & 0x4000))) {
-       unset_special (&regs, SPCFLAG_INT);
+    if (!(imask && (intena & 0x4000)))
        return -1;
-    }
-    for (i = 14; i >= 0; i--) {
-       if (imask & (1 << i)) {
-#ifdef INTDELAY
-           if (!(irqdelay[i] && (cycles - irqcycles[i]) < c * CYCLE_UNIT)) {
-#endif
-               irqdelay[i] = 0;
-               if (i == 13 || i == 14)
-                   return 6;
-               else if (i == 11 || i == 12)
-                   return 5;
-               else if (i >= 7 && i <= 10)
-                   return 4;
-               else if (i >= 4 && i <= 6)
-                   return 3;
-               else if (i == 3)
-                   return 2;
-               else
-                   return 1;
-           }
-#ifdef INTDELAY
-       }
-#endif
-    }
+    if (imask & (0x4000 | 0x2000)) // 13 14
+        return 6;
+    if (imask & (0x1000 | 0x0800)) // 11 12
+        return 5;
+    if (imask & (0x0400 | 0x0200 | 0x0100 | 0x0080)) // 7 8 9 10
+        return 4;
+    if (imask & (0x0040 | 0x0020 | 0x0010)) // 4 5 6
+        return 3;
+    if (imask & 0x0008) // 3
+        return 2;
+    if (imask & (0x0001 | 0x0002 | 0x0004)) // 0 1 2
+        return 1;
     return -1;
 }
 
-int intlev (void)
-{
-    int il = -1;
-#ifdef JIT
-    if (currprefs.cachesize) {
-       uae_u16 imask = intreq & intena;
-       if (imask && (intena & 0x4000)) {
-           if (imask & 0x6000)
-               il = 6;
-           if (imask & 0x1800)
-               il = 5;
-           if (imask & 0x0780)
-               il = 4;
-           if (imask & 0x0070)
-               il = 3;
-           if (imask & 0x0008)
-               il = 2;
-           if (imask & 0x0007)
-               il = 1;
-       }
-    } else {
-#endif
-       il = intlev_2 ();
-       if (il >= 0 && il <= regs.intmask)
-           unset_special (&regs, SPCFLAG_INT);
-#ifdef JIT
-    }
-#endif
-    return il;
-}
-
-static void doint (void)
+static void INTENA_f(uae_u32 data)
 {
-    int i;
-    uae_u16 imask;
-
-    set_special (&regs, SPCFLAG_INT);
-#ifdef JIT
-    if (currprefs.cachesize)
-       return;
-#endif
-    imask = intreq & intena;
-    if (imask && (intena & 0x4000)) {
-       for (i = 0; i < 15; i++) {
-           if ((imask & (1 << i)) && irqdelay[i] == 0) {
-               irqdelay[i] = 1;
-               irqcycles[i] = get_cycles ();
-           }
-       }
-    }
+    doint();
 }
-
 STATIC_INLINE void INTENA (uae_u16 v)
 {
     setclr (&intena,v);
@@ -2675,37 +2608,37 @@ STATIC_INLINE void INTENA (uae_u16 v)
     if (v & 0x40)
        write_log("INTENA %04.4X (%04.4X) %p\n", intena, v, M68K_GETPC);
 #endif
-    if (v & 0x8000)
-       doint ();
+    if (v & 0x8000) {
+       if (!currprefs.cpu_compatible > 0)
+           INTENA_f(0);
+       else
+           event2_newevent2 (6, 0, INTENA_f);
+    }
 }
 
 void INTREQ_0 (uae_u16 v)
 {
-    int i;
     if (v & (0x80|0x100|0x200|0x400))
        audio_update_irq (v);
     setclr (&intreq, v);
-    if (!(v & 0x8000)) {
-       for (i = 0; i < 15; i++) {
-           if (v & (1 << i))
-               irqdelay[i] = 0;
-       }
-    }
     doint ();
 }
 
-void INTREQ (uae_u16 v)
+static void INTREQ_f(uae_u32 data)
 {
-#if 0
-    if ((v & (0xc000)) == 0xc000)
-       write_log("%d INTREQ %04.4X (%04.4X) %x %x %x\n",
-           vpos, intreq, v, M68K_GETPC, cop1lc, cop2lc);
-#endif
-    INTREQ_0 (v);
+    INTREQ_0 (data);
     serial_check_irq ();
     rethink_cias ();
 }
 
+void INTREQ (uae_u16 v)
+{
+    if (!currprefs.cpu_compatible)
+       INTREQ_f(v);
+    else
+       event2_newevent2(6, v, INTREQ_f);
+}
+
 static void ADKCON (int hpos, uae_u16 v)
 {
     if (currprefs.produce_sound > 0)
@@ -3067,8 +3000,10 @@ static void BLTSIZE (uae_u16 v)
 
     blt_info.vblitsize = v >> 6;
     blt_info.hblitsize = v & 0x3F;
-    if (!blt_info.vblitsize) blt_info.vblitsize = 1024;
-    if (!blt_info.hblitsize) blt_info.hblitsize = 64;
+    if (!blt_info.vblitsize)
+       blt_info.vblitsize = 1024;
+    if (!blt_info.hblitsize)
+       blt_info.hblitsize = 64;
     do_blitter (current_hpos());
 }
 
@@ -3472,8 +3407,8 @@ static void dump_copper (char *error, int until_hpos)
        error, vpos, until_hpos);
     write_log("cvcmp=%d chcmp=%d chpos=%d cvpos=%d ci1=%04.4X ci2=%04.4X\n",
        cop_state.vcmp,cop_state.hcmp,cop_state.hpos,cop_state.vpos,cop_state.saved_i1,cop_state.saved_i2);
-    write_log("cstate=%d ip=%08.8X ev_copper=%d\n",
-       cop_state.state,cop_state.ip,eventtab[ev_copper].active);
+    write_log("cstate=%d ip=%08.8X\n",
+       cop_state.state,cop_state.ip);
 }
 
 static void update_copper (int until_hpos)
@@ -3481,20 +3416,11 @@ static void update_copper (int until_hpos)
     int vp = vpos & (((cop_state.saved_i2 >> 8) & 0x7F) | 0x80);
     int c_hpos = cop_state.hpos;
 
-    if (nocustom()) {
-       eventtab[ev_copper].active = 0;
-       return;
-    }
-
-    if (eventtab[ev_copper].active) {
-       dump_copper ("error1",until_hpos);
-       eventtab[ev_copper].active = 0;
+    if (nocustom())
        return;
-    }
-
     if (cop_state.state == COP_wait && vp < cop_state.vcmp) {
        dump_copper ("error2",until_hpos);
-       eventtab[ev_copper].active = 0;
        copper_enabled_thisline = 0;
        return;
     }
@@ -3686,14 +3612,8 @@ static void update_copper (int until_hpos)
 
        case COP_skip1:
        {
-           static int skipped_before;
            unsigned int vcmp, hcmp, vp1, hp1;
 
-           if (! skipped_before) {
-               skipped_before = 1;
-               write_log ("Program uses Copper SKIP instruction.\n");
-           }
-
            if (c_hpos >= (maxhpos & ~1))
                break;
 
@@ -3749,20 +3669,15 @@ static void compute_spcflag_copper (void)
            return;
     }
     copper_enabled_thisline = 1;
-
-    if (! eventtab[ev_copper].active)
-       set_special (&regs, SPCFLAG_COPPER);
+    set_special (&regs, SPCFLAG_COPPER);
 }
 
 static void copper_handler (void)
 {
     /* This will take effect immediately, within the same cycle.  */
     set_special (&regs, SPCFLAG_COPPER);
-
     if (! copper_enabled_thisline)
        uae_abort ("copper_handler");
-
-    eventtab[ev_copper].active = 0;
 }
 
 void blitter_done_notify (void)
@@ -3790,12 +3705,6 @@ void do_copper (void)
 STATIC_INLINE void sync_copper_with_cpu (int hpos, int do_schedule)
 {
     /* Need to let the copper advance to the current position.  */
-    if (eventtab[ev_copper].active) {
-       eventtab[ev_copper].active = 0;
-       if (do_schedule)
-           events_schedule ();
-       set_special (&regs, SPCFLAG_COPPER);
-    }
     if (copper_enabled_thisline)
        update_copper (hpos);
 }
@@ -4259,7 +4168,6 @@ static void vsync_handler (void)
 
     lof_changed = 0;
 
-    eventtab[ev_copper].active = 0;
     COPJMP (1);
 
     init_hardware_frame ();
@@ -4309,15 +4217,35 @@ static void copper_check (int n)
     if (cop_state.state == COP_wait) {
        int vp = vpos & (((cop_state.saved_i2 >> 8) & 0x7F) | 0x80);
        if (vp < cop_state.vcmp) {
-           if (eventtab[ev_copper].active || copper_enabled_thisline)
-               write_log ("COPPER BUG %d: vp=%d vpos=%d vcmp=%d act=%d thisline=%d\n", n, vp, vpos, cop_state.vcmp, eventtab[ev_copper].active, copper_enabled_thisline);
+           if (copper_enabled_thisline)
+               write_log ("COPPER BUG %d: vp=%d vpos=%d vcmp=%d act=%d thisline=%d\n", n, vp, vpos, cop_state.vcmp, copper_enabled_thisline);
        }
     }
 }
 
+static void CIA_vsync_prehandler(void)
+{
+    CIA_vsync_handler ();
+#if 0
+    if (input_recording > 0) {
+        inprec_rstart(INPREC_CIAVSYNC);
+        inprec_ru32(ciavsync_counter);
+        inprec_rend();
+    } else if (input_recording < 0) {
+        uae_u32 v = -1;
+        while (inprec_pstart(INPREC_CIAVSYNC)) {
+           v = inprec_pu32();
+           inprec_pend();
+       }
+       if (v != ciavsync_counter)
+           write_log("INPREC: ciavsync sync error %d <> %d\n", v, ciavsync_counter);
+    }
+#endif
+    ciavsync_counter++;
+}
+
 static void hsync_handler (void)
 {
-    static int ciahsync;
     int hpos = current_hpos ();
 
     if (!nocustom()) {
@@ -4362,14 +4290,17 @@ static void hsync_handler (void)
     picasso_handle_hsync ();
 #endif
 
-    ciahsync++;
-    if (ciahsync >= (currprefs.ntscmode ? MAXVPOS_NTSC : MAXVPOS_PAL) * MAXHPOS_PAL / maxhpos) { /* not so perfect.. */
-       CIA_vsync_handler ();
-       ciahsync = 0;
+    if (ciavsyncmode) {
+       static int ciahsync;
+       ciahsync++;
+       if (ciahsync >= (currprefs.ntscmode ? MAXVPOS_NTSC : MAXVPOS_PAL) * MAXHPOS_PAL / maxhpos) { /* not so perfect.. */
+           CIA_vsync_prehandler ();
+           ciahsync = 0;
+       }
     }
 
     if ((currprefs.chipset_mask & CSMASK_AGA) || (!currprefs.chipset_mask & CSMASK_ECS_AGNUS))
-       last_custom_value = rand ();
+       last_custom_value = uaerand ();
     else
        last_custom_value = 0xffff;
 
@@ -4397,6 +4328,24 @@ static void hsync_handler (void)
        }
        vpos = 0;
        vsync_handler ();
+#if 0
+       if (input_recording > 0) {
+           inprec_rstart(INPREC_VSYNC);
+           inprec_ru32(vsync_counter);
+           inprec_rend();
+       } else if (input_recording < 0) {
+           uae_u32 v = -1;
+           while (inprec_pstart(INPREC_VSYNC)) {
+               v = inprec_pu32();
+               inprec_pend();
+           }
+           if (v != vsync_counter)
+               write_log("INPREC: vsync sync error %d <> %d\n", v, vsync_counter);
+       }
+#endif
+       vsync_counter++;
+       if (!ciavsyncmode)
+           CIA_vsync_prehandler();
     }
 
     DISK_hsync (maxhpos);
@@ -4421,27 +4370,25 @@ static void hsync_handler (void)
 #endif
 
     if (!nocustom()) {
+        int lineno = vpos;
        if (bplcon0 & 4)
            notice_interlace_seen ();
 
-       if (!nodraw ()) {
-           int lineno = vpos;
-           nextline_how = nln_normal;
-           if (currprefs.gfx_linedbl) {
-               lineno *= 2;
-               nextline_how = currprefs.gfx_linedbl == 1 ? nln_doubled : nln_nblack;
-               if (bplcon0 & 4) {
-                   if (!lof) {
-                       lineno++;
-                       nextline_how = nln_lower;
-                   } else {
-                       nextline_how = nln_upper;
-                   }
+        nextline_how = nln_normal;
+        if (currprefs.gfx_linedbl) {
+           lineno *= 2;
+           nextline_how = currprefs.gfx_linedbl == 1 ? nln_doubled : nln_nblack;
+           if (bplcon0 & 4) {
+               if (!lof) {
+                   lineno++;
+                   nextline_how = nln_lower;
+               } else {
+                   nextline_how = nln_upper;
                }
            }
-           next_lineno = lineno;
-           reset_decisions ();
        }
+       next_lineno = lineno;
+       reset_decisions ();
     }
 
 #ifdef FILESYS
@@ -4461,26 +4408,121 @@ static void hsync_handler (void)
 #endif
 
     while (input_recording < 0 && inprec_pstart(INPREC_KEY)) {
-       record_key_direct (inprec_pu8());
-       inprec_pend();
+        record_key_direct (inprec_pu8());
+        inprec_pend();
     }
     while (input_recording < 0 && inprec_pstart(INPREC_DISKREMOVE)) {
-       disk_eject (inprec_pu8());
-       inprec_pend();
+        disk_eject (inprec_pu8());
+        inprec_pend();
     }
     while (input_recording < 0 && inprec_pstart(INPREC_DISKINSERT)) {
-       int drv = inprec_pu8();
-       inprec_pstr (currprefs.df[drv]);
-       strcpy (changed_prefs.df[drv], currprefs.df[drv]);
-       disk_insert_force (drv, currprefs.df[drv]);
-       inprec_pend();
+        int drv = inprec_pu8();
+        inprec_pstr (currprefs.df[drv]);
+        strcpy (changed_prefs.df[drv], currprefs.df[drv]);
+        disk_insert_force (drv, currprefs.df[drv]);
+        inprec_pend();
     }
+
     inputdevice_hsync ();
 
     hsync_counter++;
     //copper_check (2);
 }
 
+#if 0
+    unsigned long int mintime = ~0L;
+    for (i = 0; i < ev_max; i++) {
+       if (eventtab[i].active) {
+           unsigned long int eventtime = eventtab[i].evtime - currcycle;
+#ifdef EVENT_DEBUG
+           if (eventtime == 0) {
+               write_log("event %d bug\n",i);
+           }
+#endif
+           if (eventtime < mintime)
+               mintime = eventtime;
+       }
+    }
+    nextevent = currcycle + mintime;
+#endif
+
+static void MISC_handler(void)
+{
+    int i, recheck;
+    evt mintime;
+    evt ct = get_cycles();
+    static int recursive;
+
+    if (recursive)
+       return;
+    recursive++;
+    eventtab[ev_misc].active = 0;
+    recheck = 1;
+    while (recheck) {
+       recheck = 0;
+       mintime = ~0L;
+       for (i = 0; i < ev2_max; i++) {
+           if (eventtab2[i].active) {
+               if (eventtab2[i].evtime == ct) {
+                   eventtab2[i].active = 0;
+                   eventtab2[i].handler(eventtab2[i].data);
+                   if (eventtab2[i].active)
+                       recheck = 1;
+               } else {
+                   evt eventtime = eventtab2[i].evtime - ct;
+                   if (eventtime < mintime)
+                       mintime = eventtime;
+               }
+           }
+       }
+    }
+    if (mintime != ~0L) {
+       eventtab[ev_misc].active = 1;
+       eventtab[ev_misc].oldcycles = ct;
+       eventtab[ev_misc].evtime = ct + mintime;
+       events_schedule();
+    }
+    recursive--;
+}
+
+STATIC_INLINE void event2_newevent_x(int no, evt t, uae_u32 data, evfunc2 func)
+{
+    evt et = t * CYCLE_UNIT + get_cycles();
+
+    if (no < 0) {
+       for (no = ev2_misc; no < ev2_max; no++) {
+           if (!eventtab2[no].active)
+               break;
+           if (eventtab2[no].evtime == et && eventtab2[no].handler == func) {
+               eventtab2[no].handler(eventtab2[no].data);
+               break;
+           }
+       }
+       if (no == ev2_max) {
+           write_log("out of event2's! PC=%x\n", M68K_GETPC);
+           return;
+       }
+    }
+    eventtab2[no].active = 1;
+    eventtab2[no].evtime = et;
+    eventtab2[no].handler = func;
+    eventtab2[no].data = data;
+    MISC_handler();
+}
+void event2_newevent(int no, evt t)
+{
+    event2_newevent_x(no, t, 0, eventtab2[no].handler);
+}
+void event2_newevent2(evt t, uae_u32 data, evfunc2 func)
+{
+    event2_newevent_x(-1, t, data, func);
+}
+
+void event2_remevent(int no)
+{
+    eventtab2[no].active = 0;
+}
+
 void init_eventtab (void)
 {
     int i;
@@ -4491,20 +4533,20 @@ void init_eventtab (void)
        eventtab[i].active = 0;
        eventtab[i].oldcycles = 0;
     }
+    for (i = 0; i < ev2_max; i++) {
+       eventtab2[i].active = 0;
+    }
 
     eventtab[ev_cia].handler = CIA_handler;
     eventtab[ev_hsync].handler = hsync_handler;
     eventtab[ev_hsync].evtime = get_cycles () + HSYNCTIME;
     eventtab[ev_hsync].active = 1;
-
-    eventtab[ev_copper].handler = copper_handler;
-    eventtab[ev_copper].active = 0;
-    eventtab[ev_blitter].handler = blitter_handler;
-    eventtab[ev_blitter].active = 0;
-    eventtab[ev_disk].handler = DISK_handler;
-    eventtab[ev_disk].active = 0;
+    eventtab[ev_misc].handler = MISC_handler;
     eventtab[ev_audio].handler = audio_evhandler;
-    eventtab[ev_audio].active = 0;
+
+    eventtab2[ev2_blitter].handler = blitter_handler;
+    eventtab2[ev2_disk].handler = DISK_handler;
+
     events_schedule ();
 }
 
@@ -4513,8 +4555,11 @@ void customreset (void)
     int i;
     int zero = 0;
 
-    write_log ("reset at %x\n", m68k_getpc(&regs));
+    write_log ("Reset at %08.8X\n", m68k_getpc(&regs));
+    memory_map_dump();
     hsync_counter = 0;
+    vsync_counter = 0;
+    ciavsync_counter = 0;
     lightpen_x = lightpen_y = lightpen_triggered = 0;
     lightpen_cx = lightpen_cy = -1;
     if (! savestate_state) {
@@ -4797,8 +4842,22 @@ addrbank custom_bank = {
     custom_lget, custom_wget, custom_bget,
     custom_lput, custom_wput, custom_bput,
     default_xlate, default_check, NULL, "Custom chipset",
+    custom_lgeti, custom_wgeti, ABFLAG_IO
 };
 
+static uae_u32 REGPARAM2 custom_wgeti (uaecptr addr)
+{
+    if (currprefs.cpu_level >= 2)
+       return dummy_wgeti(addr);
+    return custom_wget(addr);
+}
+static uae_u32 REGPARAM2 custom_lgeti (uaecptr addr)
+{
+    if (currprefs.cpu_level >= 2)
+       return dummy_lgeti(addr);
+    return custom_lget(addr);
+}
+
 STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (uaecptr addr, int noput)
 {
     uae_u16 v;
@@ -5149,6 +5208,14 @@ static void REGPARAM2 custom_lput(uaecptr addr, uae_u32 value)
 
 void custom_prepare_savestate (void)
 {
+    int i;
+
+    for (i = 0; i < ev2_max; i++) {
+       if (eventtab2[i].active) {
+           eventtab2[i].active = 0;
+           eventtab2[i].handler(eventtab2[i].data);
+       }
+    }
 }
 
 #define RB restore_u8 ()
@@ -5568,11 +5635,6 @@ void check_prefs_changed_custom (void)
 
 STATIC_INLINE void sync_copper (int hpos)
 {
-    if (eventtab[ev_copper].active) {
-       eventtab[ev_copper].active = 0;
-       update_copper (hpos);
-       return;
-    }
     if (copper_enabled_thisline)
        update_copper (hpos);
 }
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/debug.c b/debug.c
old mode 100755 (executable)
new mode 100644 (file)
index edabbab..f8a386d
--- a/debug.c
+++ b/debug.c
@@ -30,6 +30,7 @@
 #include "autoconf.h"
 #include "akiko.h"
 #include "inputdevice.h"
+#include "crc32.h"
 
 static int debugger_active;
 static uaecptr skipaddr_start, skipaddr_end;
@@ -42,6 +43,7 @@ int debugging;
 int exception_debugging;
 int debug_copper;
 int debug_sprite_mask = 0xff;
+
 static uaecptr debug_copper_pc;
 
 extern int audio_channel_mask;
@@ -85,7 +87,7 @@ static char help[] = {
     "  fl                    List breakpoints\n"
     "  fd                    Remove all breakpoints\n"
     "  f <addr1> <addr2>     Step forward until <addr1> <= PC <= <addr2>\n"
-    "  e                     Dump contents of all custom registers\n"
+    "  e                     Dump contents of all custom registers, ea = AGA colors\n"
     "  i [<addr>]            Dump contents of interrupt and trap vectors\n"
     "  o <0-2|addr> [<lines>]View memory as Copper instructions\n"
     "  od                    Enable/disable Copper vpos/hpos tracing\n"
@@ -98,7 +100,7 @@ static char help[] = {
     "  Cl                    List currently found trainer addresses\n"
     "  D                     Deep trainer\n"
     "  W <address> <value>   Write into Amiga memory\n"
-    "  w <num> <address> <length> <R/W/RW/F> [<value>]\n"
+    "  w <num> <address> <length> <R/W/I/F> [<value>] (read/write/opcode/freeze)\n"
     "                        Add/remove memory watchpoints\n"
     "  wd                    Enable illegal access logger\n"
     "  S <file> <addr> <n>   Save a block of Amiga memory\n"
@@ -809,7 +811,7 @@ static addrbank *debug_mem_area;
 struct memwatch_node {
     uaecptr addr;
     int size;
-    int rw;
+    int rwi;
     uae_u32 val;
     int val_enabled;
     uae_u32 modval;
@@ -871,42 +873,41 @@ static void illg_init (void)
 }
 
 /* add special custom register check here */
-static void illg_debug_check (uaecptr addr, int rw, int size, uae_u32 val)
+static void illg_debug_check (uaecptr addr, int rwi, int size, uae_u32 val)
 {
     return;
 }
 
-static void illg_debug_do (uaecptr addr, int rw, int size, uae_u32 val)
+static void illg_debug_do (uaecptr addr, int rwi, int size, uae_u32 val)
 {
     uae_u8 mask;
     uae_u32 pc = m68k_getpc (&regs);
-    char rws = rw ? 'W' : 'R';
     int i;
 
     for (i = size - 1; i >= 0; i--) {
        uae_u8 v = val >> (i * 8);
        uae_u32 ad = addr + i;
        if (ad >= 0x1000000)
-           mask = 3;
+           mask = 7;
        else
            mask = illgdebug[ad];
        if (!mask)
            continue;
        if (mask & 0x80) {
-           illg_debug_check (ad, rw, size, val);
+           illg_debug_check (ad, rwi, size, val);
        } else if ((mask & 3) == 3) {
-           if (rw)
-               console_out ("RW: %08.8X=%02.2X %c PC=%08.8X\n", ad, v, rws, pc);
-           else
-               console_out ("RW: %08.8X    %c PC=%08.8X\n", ad, rws, pc);
+           if (rwi & 2)
+               console_out ("W: %08.8X=%02.2X PC=%08.8X\n", ad, v, pc);
+           else if (rwi & 1)
+               console_out ("R: %08.8X    PC=%08.8X\n", ad, pc);
            if (illgdebug_break)
                activate_debugger ();
-       } else if ((mask & 1) && rw) {
-           console_out ("RO: %08.8X=%02.2X %c PC=%08.8X\n", ad, v, rws, pc);
+       } else if ((mask & 1) && (rwi & 1)) {
+           console_out ("RO: %08.8X=%02.2X PC=%08.8X\n", ad, v, pc);
            if (illgdebug_break)
                activate_debugger ();
-       } else if ((mask & 2) && !rw) {
-           console_out ("WO: %08.8X    %c PC=%08.8X\n", ad, rws, pc);
+       } else if ((mask & 2) && (rwi & 2)) {
+           console_out ("WO: %08.8X    PC=%08.8X\n", ad, pc);
            if (illgdebug_break)
                activate_debugger ();
        }
@@ -918,25 +919,106 @@ static int debug_mem_off (uaecptr addr)
     return munge24 (addr) >> 16;
 }
 
-static int memwatch_func (uaecptr addr, int rw, int size, uae_u32 val)
+struct smc_item {
+    uae_u32 addr;
+    uae_u8 cnt;
+};
+
+static int smc_size;
+static struct smc_item *smc_table;
+
+static void smc_reset(void)
+{
+    int i;
+    if (!smc_table)
+       return;
+    for (i = 0; i < smc_size; i++) {
+       smc_table[i].addr = 0xffffffff;
+       smc_table[i].cnt = 0;
+    }
+}
+
+static void smc_detect_init(void)
+{
+    xfree(smc_table);
+    smc_table = NULL;
+    smc_size = 1 << 24;
+    if (currprefs.z3fastmem_size)
+       smc_size = currprefs.z3fastmem_start + currprefs.z3fastmem_size;
+    smc_size += 4;
+    smc_table = xmalloc (smc_size * sizeof (struct smc_item));
+    smc_reset();
+    console_out("SMCD enabled\n");
+}
+
+#define SMC_MAXHITS 8
+static void smc_detector(uaecptr addr, int rwi, int size, uae_u32 *valp)
+{
+    int i, hitcnt;
+    uaecptr hitaddr, hitpc;
+
+    if (!smc_table)
+       return;
+    if (addr >= smc_size)
+       return;
+    if (rwi == 2) {
+       for (i = 0; i < size; i++) {
+           if (smc_table[addr + i].cnt < SMC_MAXHITS) {
+               smc_table[addr + i].addr = m68k_getpc(&regs);
+           }
+       }
+       return;
+    }
+    hitpc = smc_table[addr].addr;
+    if (hitpc == 0xffffffff)
+       return;
+    hitaddr = addr;
+    hitcnt = 0;
+    while (addr < smc_size && smc_table[addr].addr != 0xffffffff) {
+       smc_table[addr++].addr = 0xffffffff;
+       hitcnt++;
+    }
+    if ((hitpc & 0xFFF80000) == 0xF80000)
+       return;
+    if (currprefs.cpu_level == 0 && currprefs.cpu_compatible) {
+       /* ignore single-word unconditional jump instructions
+        * (instruction prefetch from PC+2 can cause false positives) */
+       if (regs.irc == 0x4e75 || regs.irc == 4e74 || regs.irc == 0x4e72 || regs.irc == 4e77)
+           return; /* RTS, RTD, RTE, RTR */
+       if ((regs.irc & 0xff00) == 0x6000 && (regs.irc & 0x00ff) != 0 && (regs.irc & 0x00ff) != 0xff)
+           return; /* BRA.B */
+    }
+    if (hitcnt < 100) {
+        smc_table[hitaddr].cnt++;
+       console_out("SMC at %08.8X - %08.8X (%d) from %08.8X\n",
+           hitaddr, hitaddr + hitcnt, hitcnt, hitpc);
+       if (smc_table[hitaddr].cnt >= SMC_MAXHITS)
+           console_out("* hit count >= %d, future hits ignored\n", SMC_MAXHITS);
+    }
+}
+
+static int memwatch_func (uaecptr addr, int rwi, int size, uae_u32 *valp)
 {
     int i, brk;
+    uae_u32 val = *valp;
 
     if (illgdebug)
-       illg_debug_do (addr, rw, size, val);
+       illg_debug_do (addr, rwi, size, val);
     addr = munge24 (addr);
+    if (smc_table && (rwi >= 2))
+       smc_detector(addr, rwi, size, valp);
     for (i = 0; i < MEMWATCH_TOTAL; i++) {
        struct memwatch_node *m = &mwnodes[i];
        uaecptr addr2 = m->addr;
        uaecptr addr3 = addr2 + m->size;
-       int rw2 = m->rw;
+       int rwi2 = m->rwi;
 
        brk = 0;
        if (m->size == 0)
            continue;
-       if (m->val_enabled && m->val != val)
+       if (!m->frozen && m->val_enabled && m->val != val)
            continue;
-       if (rw != rw2 && rw2 < 2)
+       if (!(rwi & rwi2))
            continue;
        if (addr >= addr2 && addr < addr3)
            brk = 1;
@@ -945,7 +1027,7 @@ static int memwatch_func (uaecptr addr, int rw, int size, uae_u32 val)
        if (!brk && size == 4 && ((addr + 2 >= addr2 && addr + 2 < addr3) || (addr + 3 >= addr2 && addr + 3 < addr3)))
            brk = 1;
        if (brk && m->modval_written) {
-           if (!rw) {
+           if (!rwi) {
                brk = 0;
            } else if (m->modval_written == 1) {
                m->modval_written = 2;
@@ -956,13 +1038,16 @@ static int memwatch_func (uaecptr addr, int rw, int size, uae_u32 val)
            }
        }
        if (brk) {
-           if (m->frozen)
+           if (m->frozen) {
+               if (m->val_enabled)
+                   *valp = m->val;
                return 0;
+           }
            mwhit.addr = addr;
-           mwhit.rw = rw;
+           mwhit.rwi = rwi;
            mwhit.size = size;
            mwhit.val = 0;
-           if (mwhit.rw)
+           if (mwhit.rwi & 2)
                mwhit.val = val;
            memwatch_triggered = i + 1;
            debugging = 1;
@@ -973,7 +1058,7 @@ static int memwatch_func (uaecptr addr, int rw, int size, uae_u32 val)
     return 1;
 }
 
-static int mmu_hit (uaecptr addr, int size, int rw, uae_u32 *v);
+static int mmu_hit (uaecptr addr, int size, int rwi, uae_u32 *v);
 
 static uae_u32 REGPARAM2 mmu_lget (uaecptr addr)
 {
@@ -1023,15 +1108,32 @@ static uae_u32 REGPARAM2 debug_lget (uaecptr addr)
     int off = debug_mem_off (addr);
     uae_u32 v;
     v = debug_mem_banks[off]->lget(addr);
-    memwatch_func (addr, 0, 4, v);
+    memwatch_func (addr, 1, 4, &v);
     return v;
 }
+static uae_u32 REGPARAM2 mmu_lgeti (uaecptr addr)
+{
+    int off = debug_mem_off (addr);
+    uae_u32 v = 0;
+    if (!mmu_hit(addr, 4, 4, &v))
+        v = debug_mem_banks[off]->lgeti(addr);
+    return v;
+}
+static uae_u32 REGPARAM2 mmu_wgeti (uaecptr addr)
+{
+    int off = debug_mem_off (addr);
+    uae_u32 v = 0;
+    if (!mmu_hit(addr, 2, 4, &v))
+        v = debug_mem_banks[off]->wgeti(addr);
+    return v;
+}
+
 static uae_u32 REGPARAM2 debug_wget (uaecptr addr)
 {
     int off = debug_mem_off (addr);
     uae_u32 v;
     v = debug_mem_banks[off]->wget(addr);
-    memwatch_func (addr, 0, 2, v);
+    memwatch_func (addr, 1, 2, &v);
     return v;
 }
 static uae_u32 REGPARAM2 debug_bget (uaecptr addr)
@@ -1039,25 +1141,41 @@ static uae_u32 REGPARAM2 debug_bget (uaecptr addr)
     int off = debug_mem_off (addr);
     uae_u32 v;
     v = debug_mem_banks[off]->bget(addr);
-    memwatch_func (addr, 0, 1, v);
+    memwatch_func (addr, 1, 1, &v);
+    return v;
+}
+static uae_u32 REGPARAM2 debug_lgeti (uaecptr addr)
+{
+    int off = debug_mem_off (addr);
+    uae_u32 v;
+    v = debug_mem_banks[off]->lgeti(addr);
+    memwatch_func (addr, 4, 4, &v);
+    return v;
+}
+static uae_u32 REGPARAM2 debug_wgeti (uaecptr addr)
+{
+    int off = debug_mem_off (addr);
+    uae_u32 v;
+    v = debug_mem_banks[off]->wgeti(addr);
+    memwatch_func (addr, 4, 2, &v);
     return v;
 }
 static void REGPARAM2 debug_lput (uaecptr addr, uae_u32 v)
 {
     int off = debug_mem_off (addr);
-    if (memwatch_func (addr, 1, 4, v))
+    if (memwatch_func (addr, 2, 4, &v))
        debug_mem_banks[off]->lput(addr, v);
 }
 static void REGPARAM2 debug_wput (uaecptr addr, uae_u32 v)
 {
     int off = debug_mem_off (addr);
-    if (memwatch_func (addr, 1, 2, v))
+    if (memwatch_func (addr, 2, 2, &v))
        debug_mem_banks[off]->wput(addr, v);
 }
 static void REGPARAM2 debug_bput (uaecptr addr, uae_u32 v)
 {
     int off = debug_mem_off (addr);
-    if (memwatch_func (addr, 1, 1, v))
+    if (memwatch_func (addr, 2, 1, &v))
        debug_mem_banks[off]->bput(addr, v);
 }
 
@@ -1117,6 +1235,8 @@ static void initialize_memwatch (int mode)
        a2->lput = mode ? mmu_lput : debug_lput;
        a2->check = debug_check;
        a2->xlateaddr = debug_xlate;
+       a2->wgeti = mode ? mmu_wgeti : debug_wgeti;
+       a2->lgeti = mode ? mmu_lgeti : debug_lgeti;
     }
     if (mode)
        mmu_enabled = 1;
@@ -1133,9 +1253,11 @@ static void memwatch_dump (int num)
            mwn = &mwnodes[i];
            if (mwn->size == 0)
                continue;
-           console_out ("%d: %08.8X - %08.8X (%d) %s",
+           console_out ("%d: %08.8X - %08.8X (%d) %c%c%c",
                i, mwn->addr, mwn->addr + (mwn->size - 1), mwn->size,
-               mwn->frozen ? "F" : (mwn->rw == 0 ? "R" : (mwn->rw == 1 ? "W" : "RW")));
+               (mwn->rwi & 1) ? 'R' : ' ', (mwn->rwi & 2) ? 'W' : ' ', (mwn->rwi & 4) ? 'I' : ' ');
+           if (mwn->frozen)
+               console_out ("F");
            if (mwn->val_enabled)
                console_out (" =%X", mwn->val);
            if (mwn->modval_written)
@@ -1205,7 +1327,7 @@ static void memwatch (char **c)
     }
     mwn->addr = readhex (c);
     mwn->size = 1;
-    mwn->rw = 2;
+    mwn->rwi = 7;
     mwn->val_enabled = 0;
     mwn->frozen = 0;
     mwn->modval_written = 0;
@@ -1214,15 +1336,24 @@ static void memwatch (char **c)
        mwn->size = readhex (c);
        ignore_ws (c);
        if (more_params (c)) {
-           char nc = toupper (next_char (c));
-           if (nc == 'F')
-               mwn->frozen = 1;
-           else if (nc == 'W')
-               mwn->rw = 1;
-           else if (nc == 'R' && toupper(**c) != 'W')
-               mwn->rw = 0;
-           else if (nc == 'R' && toupper(**c) == 'W')
-               next_char (c);
+           for (;;) {
+               char ncc = peek_next_char(c);
+               char nc = toupper (next_char (c));
+               if (mwn->rwi == 7)
+                   mwn->rwi = 0;
+               if (nc == 'F')
+                   mwn->frozen = 1;
+               if (nc == 'W')
+                   mwn->rwi |= 2;
+               if (nc == 'I')
+                   mwn->rwi |= 4;
+               if (nc == 'R')
+                   mwn->rwi |= 1;
+               if (ncc == ' ')
+                   break;
+               if (!more_params(c))
+                   break;
+           }
            ignore_ws (c);
            if (more_params (c)) {
                if (toupper(**c) == 'M') {
@@ -1260,11 +1391,21 @@ static void writeintomem (char **c)
     console_out ("Wrote %x (%u) at %08x.%c\n", val, val, addr, cc);
 }
 
-static void memory_map_dump (void)
+static uae_u8 *dump_xlate(uae_u32 addr)
+{
+    if (!mem_banks[addr >> 16]->check(addr, 1))
+       return NULL;
+    return mem_banks[addr >> 16]->xlateaddr(addr);
+}
+
+static void memory_map_dump_2 (int log)
 {
-    int i, j, max;
+    int i, j, max, im;
     addrbank *a1 = mem_banks[0];
+    char txt[256];
 
+    im = currprefs.illegal_mem;
+    currprefs.illegal_mem = 0;
     max = currprefs.address_space_24 ? 256 : 65536;
     j = 0;
     for (i = 0; i < max + 1; i++) {
@@ -1272,14 +1413,59 @@ static void memory_map_dump (void)
        if (i < max)
            a2 = mem_banks[i];
        if (a1 != a2) {
-           char *name = a1->name;
+           int k, mirrored, size;
+           uae_u8 *caddr;
+           char *name;
+           char tmp[MAX_DPATH];
+           
+           name = a1->name;
            if (name == NULL)
                name = "<none>";
-           console_out("%08.8X %6dK %s\n", j << 16, (i - j) << (16 - 10), name);
+           
+           k = j;
+           caddr = dump_xlate(k << 16);
+           mirrored = caddr ? 1 : 0;
+           k++;
+           while (k < i && caddr) {
+               if (dump_xlate(k << 16) == caddr)
+                   mirrored++;
+               k++;
+           }
+           size = (i - j) << (16 - 10);
+           sprintf (txt, "%08.8X %7dK/%d = %7dK %s", j << 16, size, mirrored, mirrored ? size / mirrored : size, name);
+
+           tmp[0] = 0;
+           if (a1->flags == ABFLAG_ROM && mirrored) {
+               char *p = txt + strlen(txt);
+               uae_u32 crc = get_crc32(a1->xlateaddr(j << 16), (size * 1024) / mirrored);
+               struct romdata *rd = getromdatabycrc(crc);
+               sprintf(p, " (%08.8X)", crc);
+               if (rd) {
+                   tmp[0] = '=';
+                   getromname(rd, tmp + 1);
+                   strcat(tmp,"\n");
+               }
+           }
+           strcat(txt,"\n");
+           if (log)
+               write_log (txt);
+           else
+               console_out(txt);
+           if (tmp[0]) {
+               if (log)
+                   write_log (tmp);
+               else
+                   console_out(tmp);
+           }
            j = i;
            a1 = a2;
        }
     }
+    currprefs.illegal_mem = im;
+}
+void memory_map_dump (void)
+{
+    memory_map_dump_2 (1);
 }
 
 static void show_exec_tasks (void)
@@ -1681,10 +1867,19 @@ static void debug_1 (void)
            if (*inptr == 'c') {
                screenshot (1, 1);
            } else if (*inptr == 'm') {
-               next_char(&inptr);
-               if (more_params(&inptr))
-                   debug_sprite_mask = readint(&inptr);
-               console_out("sprite mask: %02.2X\n", debug_sprite_mask);
+               if (*(inptr + 1) == 'c') {
+                   if (!memwatch_enabled)
+                       initialize_memwatch(0);
+                   if (!smc_table)
+                       smc_detect_init();
+                   else
+                       smc_reset();
+               } else {
+                   next_char(&inptr);
+                   if (more_params(&inptr))
+                       debug_sprite_mask = readint(&inptr);
+                   console_out("sprite mask: %02.2X\n", debug_sprite_mask);
+               }
            } else {
                searchmem (&inptr);
            }
@@ -1695,7 +1890,7 @@ static void debug_1 (void)
                next_char(&inptr);
                disk_debug(&inptr);
            }  else if(*inptr == 'm') {
-               memory_map_dump();
+               memory_map_dump_2(0);
            } else {
                uae_u32 daddr;
                int count;
@@ -1926,8 +2121,10 @@ void debug (void)
            }
        }
     } else {
-       console_out ("Memwatch %d: break at %08.8X.%c %c %08.8X\n", memwatch_triggered - 1, mwhit.addr,
-           mwhit.size == 1 ? 'B' : (mwhit.size == 2 ? 'W' : 'L'), mwhit.rw ? 'W' : 'R', mwhit.val);
+       console_out ("Memwatch %d: break at %08.8X.%c %c%c%c %08.8X\n", memwatch_triggered - 1, mwhit.addr,
+           mwhit.size == 1 ? 'B' : (mwhit.size == 2 ? 'W' : 'L'),
+           (mwhit.rwi & 1) ? 'R' : ' ', (mwhit.rwi & 2) ? 'W' : ' ', (mwhit.rwi & 4) ? 'I' : ' ',
+           mwhit.val);
        memwatch_triggered = 0;
     }
     if (skipaddr_doskip > 0) {
diff --git a/disk.c b/disk.c
old mode 100755 (executable)
new mode 100644 (file)
index 813dc60..6e851b6
--- a/disk.c
+++ b/disk.c
@@ -79,8 +79,7 @@ static uae_u8 writebuffer[544 * 11 * DDHDMULT];
 
 #define DISK_INDEXSYNC 1
 #define DISK_WORDSYNC 2
-#define DISK_MOTORDELAY 4
-#define DISK_REVOLUTION 8 /* 8,16,32,64 */
+#define DISK_REVOLUTION 4 /* 8,16,32,64 */
 
 #define DSKREADY_TIME 4
 #define DSKREADY_DOWN_TIME 10
@@ -976,7 +975,9 @@ static int drive_insert (drive * drv, struct uae_prefs *p, int dnum, const char
     openwritefile (drv, 0);
     drive_settype_id(drv); /* Set DD or HD drive */
     drive_fill_bigbuf (drv, 1);
-    drv->mfmpos = (rand () | (rand () << 16)) % drv->tracklen;
+    drv->mfmpos = uaerand ();
+    drv->mfmpos |= (uaerand () << 16);
+    drv->mfmpos %= drv->tracklen;
     drv->prevtracklen = 0;
 #ifdef DRIVESOUND
     driveclick_insert (drv - floppy, 0);
@@ -986,10 +987,10 @@ static int drive_insert (drive * drv, struct uae_prefs *p, int dnum, const char
 
 static void rand_shifter (drive *drv)
 {
-    int r = ((rand () >> 4) & 7) + 1;
+    int r = ((uaerand () >> 4) & 7) + 1;
     while (r-- > 0) {
        word <<= 1;
-       word |= (rand () & 0x1000) ? 1 : 0;
+       word |= (uaerand () & 0x1000) ? 1 : 0;
        bitoffset++;
        bitoffset &= 15;
     }
@@ -1090,6 +1091,11 @@ static int drive_running (drive * drv)
     return !drv->motoroff;
 }
 
+static void motordelay_func(uae_u32 v)
+{
+    floppy[v].motordelay = 0;
+}
+
 static void drive_motor (drive * drv, int off)
 {
     if (drv->motoroff && !off) {
@@ -1114,11 +1120,7 @@ static void drive_motor (drive * drv, int off)
            write_log (" ->motor off");
        if (currprefs.cpu_level <= 1) {
            drv->motordelay = 1;
-           diskevent_flag = DISK_MOTORDELAY;
-           eventtab[ev_disk].oldcycles = get_cycles ();
-           eventtab[ev_disk].evtime = get_cycles () + 30 * CYCLE_UNIT;
-           eventtab[ev_disk].active = 1;
-           events_schedule ();
+           event2_newevent2(30, drv - floppy, motordelay_func);
        }
     }
     drv->motoroff = off;
@@ -2308,10 +2310,11 @@ static void fetchnextrevolution (drive *drv)
     }
 }
 
-void DISK_handler (void)
+void DISK_handler (uae_u32 data)
 {
     int flag = diskevent_flag;
-    eventtab[ev_disk].active = 0;
+
+    event2_remevent(ev2_disk);
     DISK_update (disk_sync_cycle);
     if (flag & (DISK_REVOLUTION << 0))
        fetchnextrevolution (&floppy[0]);
@@ -2325,7 +2328,6 @@ void DISK_handler (void)
        INTREQ (0x8000 | 0x1000);
     if (flag & DISK_INDEXSYNC)
        cia_diskindex ();
-    floppy[0].motordelay = floppy[1].motordelay = floppy[2].motordelay = floppy[3].motordelay = 0;
 #if 0
        {   
        int i;
@@ -2425,7 +2427,7 @@ static void disk_doupdate_predict (drive * drv, int startcycle)
            tword <<= 1;
            if (!drive_empty (drv)) {
                if (unformatted (drv))
-                   tword |= (rand() & 0x1000) ? 1 : 0;
+                   tword |= (uaerand() & 0x1000) ? 1 : 0;
                else
                    tword |= getonebit (drv->bigmfmbuf, mfmpos);
            }
@@ -2459,10 +2461,7 @@ static void disk_doupdate_predict (drive * drv, int startcycle)
        updatetrackspeed (drv, drv->mfmpos);
     if (diskevent_flag) {
        disk_sync_cycle = startcycle >> 8;
-       eventtab[ev_disk].oldcycles = get_cycles ();
-       eventtab[ev_disk].evtime = get_cycles () + startcycle - firstcycle;
-       eventtab[ev_disk].active = 1;
-       events_schedule ();
+        event2_newevent(ev2_disk, startcycle - firstcycle);
     }
 }
 
@@ -2498,7 +2497,7 @@ static void disk_doupdate_read (drive * drv, int floppybits)
        word <<= 1;
         if (!drive_empty (drv)) {
            if (unformatted (drv))
-               word |= (rand() & 0x1000) ? 1 : 0;
+               word |= (uaerand() & 0x1000) ? 1 : 0;
            else
                word |= getonebit (drv->bigmfmbuf, drv->mfmpos);
        }
@@ -2670,7 +2669,7 @@ void DISK_update (int tohpos)
     int cycles = (tohpos << 8) - disk_hpos;
     int startcycle = disk_hpos;
 
-    disk_jitter = ((rand () >> 4) & 3) + 1;
+    disk_jitter = ((uaerand () >> 4) & 3) + 1;
     if (disk_jitter > 2)
        disk_jitter = 1;
     if (cycles <= 0)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index e8809b4..e0d8ae8
--- a/drawing.c
+++ b/drawing.c
@@ -209,6 +209,8 @@ STATIC_INLINE void count_frame (void)
     framecnt++;
     if (framecnt >= currprefs.gfx_framerate)
        framecnt = 0;
+    if (inhibit_frame)
+        framecnt = 1;
 }
 
 int coord_native_to_amiga_x (int x)
@@ -2163,9 +2165,6 @@ void vsync_handle_redraw (int long_frame, int lof_changed)
        check_prefs_changed_custom ();
        check_prefs_changed_cpu ();
 
-       if (inhibit_frame != 0)
-           framecnt = 1;
-
        if (framecnt == 0)
            init_drawing_frame ();
     } else {
@@ -2281,7 +2280,6 @@ void reset_drawing (void)
 
     init_drawing_frame ();
 
-    //flush_clear_screen ();
     notice_screen_contents_lost ();
     frame_res_cnt = FRAMES_UNTIL_RES_SWITCH;
     lightpen_y1 = lightpen_y2 = -1;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 11b98f6..80106f6
@@ -22,6 +22,7 @@
 #include "zfile.h"
 #include "catweasel.h"
 #include "cdtv.h"
+#include "debug.h"
 
 #define MAX_EXPANSION_BOARDS 8
 
@@ -167,7 +168,6 @@ static void expamem_map_clear (void)
 {
     write_log ("expamem_map_clear() got called. Shouldn't happen.\n");
 }
-
 static void expamem_init_clear (void)
 {
     memset (expamem, 0xff, sizeof expamem);
@@ -178,6 +178,13 @@ static void expamem_init_clear2 (void)
     ecard = MAX_EXPANSION_BOARDS - 1;
 }
 
+static void expamem_init_last (void)
+{
+    write_log("Memory map after autoconfig:\n");
+    memory_map_dump();
+    expamem_init_clear();
+}
+
 static uae_u32 REGPARAM3 expamem_lget (uaecptr) REGPARAM;
 static uae_u32 REGPARAM3 expamem_wget (uaecptr) REGPARAM;
 static uae_u32 REGPARAM3 expamem_bget (uaecptr) REGPARAM;
@@ -188,7 +195,8 @@ static void REGPARAM3 expamem_bput (uaecptr, uae_u32) REGPARAM;
 addrbank expamem_bank = {
     expamem_lget, expamem_wget, expamem_bget,
     expamem_lput, expamem_wput, expamem_bput,
-    default_xlate, default_check, NULL, "Autoconfig"
+    default_xlate, default_check, NULL, "Autoconfig",
+    dummy_lgeti, dummy_wgeti, ABFLAG_IO
 };
 
 static uae_u32 REGPARAM2 expamem_lget (uaecptr addr)
@@ -406,7 +414,8 @@ static uae_u8 *REGPARAM2 fastmem_xlate (uaecptr addr)
 addrbank fastmem_bank = {
     fastmem_lget, fastmem_wget, fastmem_bget,
     fastmem_lput, fastmem_wput, fastmem_bput,
-    fastmem_xlate, fastmem_check, NULL, "Fast memory"
+    fastmem_xlate, fastmem_check, NULL, "Fast memory",
+    fastmem_lget, fastmem_wget, ABFLAG_RAM
 };
 
 
@@ -484,7 +493,6 @@ static void REGPARAM2 catweasel_bput (uaecptr addr, uae_u32 b)
 
 static int REGPARAM2 catweasel_check (uaecptr addr, uae_u32 size)
 {
-    write_log ("catweasel_check @%08.8X size %08.8X\n", addr, size);
     return 0;
 }
 
@@ -497,7 +505,8 @@ static uae_u8 *REGPARAM2 catweasel_xlate (uaecptr addr)
 static addrbank catweasel_bank = {
     catweasel_lget, catweasel_wget, catweasel_bget,
     catweasel_lput, catweasel_wput, catweasel_bput,
-    catweasel_xlate, catweasel_check, NULL, "Catweasel"
+    catweasel_xlate, catweasel_check, NULL, "Catweasel",
+    dummy_lgeti, dummy_wgeti, ABFLAG_IO
 };
 
 static void expamem_map_catweasel (void)
@@ -621,7 +630,8 @@ static void REGPARAM2 filesys_bput (uaecptr addr, uae_u32 b)
 static addrbank filesys_bank = {
     filesys_lget, filesys_wget, filesys_bget,
     filesys_lput, filesys_wput, filesys_bput,
-    default_xlate, default_check, NULL, "Filesystem Autoconfig Area"
+    default_xlate, default_check, NULL, "Filesystem Autoconfig Area",
+    dummy_lgeti, dummy_wgeti, ABFLAG_IO
 };
 
 #endif /* FILESYS */
@@ -711,7 +721,8 @@ static uae_u8 *REGPARAM2 z3fastmem_xlate (uaecptr addr)
 addrbank z3fastmem_bank = {
     z3fastmem_lget, z3fastmem_wget, z3fastmem_bget,
     z3fastmem_lput, z3fastmem_wput, z3fastmem_bput,
-    z3fastmem_xlate, z3fastmem_check, NULL, "ZorroIII Fast RAM"
+    z3fastmem_xlate, z3fastmem_check, NULL, "ZorroIII Fast RAM",
+    z3fastmem_lget, z3fastmem_wget, ABFLAG_RAM
 };
 
 /* Z3-based UAEGFX-card */
@@ -897,7 +908,7 @@ static void expamem_map_gfxcard (void)
 {
     gfxmem_start = ((expamem_hi | (expamem_lo >> 4)) << 16);
     map_banks (&gfxmem_bank, gfxmem_start >> 16, allocated_gfxmem >> 16, allocated_gfxmem);
-    write_log ("UAEGFX-card: mapped @$%lx \n", gfxmem_start);
+    write_log ("UAEGFX-card: mapped @$%lx, %d MB RTG RAM\n", gfxmem_start, allocated_gfxmem / 0x100000);
 }
 
 static void expamem_init_gfxcard (void)
@@ -1082,6 +1093,10 @@ void expamem_reset (void)
        card_map[cardno++] = expamem_map_catweasel;
     }
 #endif
+    if (cardno > 0 && cardno < MAX_EXPANSION_BOARDS) {
+       card_init[cardno] = expamem_init_last;
+       card_map[cardno++] = expamem_map_clear;
+    }
     while (cardno < MAX_EXPANSION_BOARDS) {
        card_init[cardno] = expamem_init_clear;
        card_map[cardno++] = expamem_map_clear;
old mode 100755 (executable)
new mode 100644 (file)
index b8ab9e8..6dd1f23
--- a/fdi2raw.c
+++ b/fdi2raw.c
@@ -37,6 +37,7 @@
 #include "sysconfig.h"
 #include "sysdeps.h"
 #include "zfile.h"
+#include "uae.h"
 /* ELSE */
 //#include "types.h"
 
@@ -1474,7 +1475,7 @@ static void fdi2_decode (FDI *fdi, unsigned long totalavg, uae_u32 *avgp, uae_u3
                        if (i >= pulses)
                                i = 0;
                        indx = idx[i];
-                       if (rand() <= (indx * RAND_MAX) / maxidx) {
+                       if (uaerand() <= (indx * RAND_MAX) / maxidx) {
                                pulse += avgp[i] - ref_pulse;
                                if (indx >= maxidx)
                                        ref_pulse = 0;
@@ -1624,7 +1625,7 @@ static void fdi2_decode (FDI *fdi, unsigned long totalavg, uae_u32 *avgp, uae_u3
                                        max_pulse = avg_pulse + (avgp[nexti] - minp[nexti]);
                                if (min_pulse < ref_pulse)
                                        min_pulse = ref_pulse;
-                               randval = rand();
+                               randval = uaerand();
                                if (randval < (RAND_MAX / 2)) {
                                        if (randval > (RAND_MAX / 4)) {
                                                if (randval <= (3 * RAND_MAX / 8))
@@ -1655,11 +1656,11 @@ static void fdi2_decode (FDI *fdi, unsigned long totalavg, uae_u32 *avgp, uae_u3
                                ref_pulse = 0;
                                if (i == eodat)
                                        outstep++;
-                       } else if (rand() <= ((idx[i] * RAND_MAX) / maxidx)) {
+                       } else if (uaerand() <= ((idx[i] * RAND_MAX) / maxidx)) {
                                avg_pulse = avgp[i];
                                min_pulse = minp[i];
                                max_pulse = maxp[i];
-                               randval = rand();
+                               randval = uaerand();
                                if (randval < (RAND_MAX / 2)) {
                                        if (randval > (RAND_MAX / 4)) {
                                                if (randval <= (3 * RAND_MAX / 8))
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index d5bd1e3..0b4cad8
--- a/filesys.c
+++ b/filesys.c
@@ -2314,13 +2314,13 @@ action_lock_from_fh (Unit *unit, dpacket packet)
 {
     uaecptr out;
     Key *k = lookup_key (unit, GET_PCK_ARG1 (packet));
-    write_log("lock_from_fh %x\n", k);
+    //write_log("lock_from_fh %x\n", k);
     if (k == 0) {
        PUT_PCK_RES1 (packet, DOS_FALSE);
        return;
     }
     out = action_dup_lock_2 (unit, packet, make_lock (unit, k->aino->uniq, -2));
-    write_log("=%x\n", out);
+    //write_log("=%x\n", out);
 }
 
 static void
@@ -3995,6 +3995,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke
            err = -2;
            goto error;
        }
+       memset (buf, 0, readblocksize);
        hdf_read (hfd, buf, partblock * hfd->blocksize, readblocksize);
        if (!rdb_checksum ("PART", buf, partblock)) {
            err = -2;
@@ -4069,6 +4070,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke
            err = -1;
            goto error;
        }
+       memset (buf, 0, readblocksize);
        hdf_read (hfd, buf, fileblock * hfd->blocksize, readblocksize);
        if (!rdb_checksum ("FSHD", buf, fileblock)) {
            write_log("RDB: checksum error in FSHD block %d\n", fileblock);
@@ -4099,12 +4101,16 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke
     lsegblock = rl (buf + 72);
     i = 0;
     for (;;) {
+       int pb = lsegblock;
        if (!legalrdbblock (uip, lsegblock))
            goto error;
+       memset (buf, 0, readblocksize);
        hdf_read (hfd, buf, lsegblock * hfd->blocksize, readblocksize);
        if (!rdb_checksum ("LSEG", buf, lsegblock))
            goto error;
        lsegblock = rl (buf + 16);
+       if (lsegblock == pb)
+           goto error;
        memcpy (fsmem + i * (blocksize - 20), buf + 20, blocksize - 20);
        i++;
        if (lsegblock == -1)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/fpp.c b/fpp.c
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/fsdb.c b/fsdb.c
old mode 100755 (executable)
new mode 100644 (file)
index 7e7e9ac..aee1469
--- a/fsdb.c
+++ b/fsdb.c
@@ -243,7 +243,7 @@ static int needs_dbentry (a_inode *aino)
     if (aino->deleted)
        return 0;
 
-    if (! fsdb_mode_representable_p (aino) || aino->comment != 0)
+    if (! fsdb_mode_representable_p (aino, aino->amigaos_mode) || aino->comment != 0)
        return 1;
 
     nn_begin = nname_begin (aino->nname);
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/gayle.c b/gayle.c
old mode 100755 (executable)
new mode 100644 (file)
index c3f4a10..ec2ea54
--- a/gayle.c
+++ b/gayle.c
@@ -180,7 +180,8 @@ static void REGPARAM3 gayle_bput (uaecptr, uae_u32) REGPARAM;
 addrbank gayle_bank = {
     gayle_lget, gayle_wget, gayle_bget,
     gayle_lput, gayle_wput, gayle_bput,
-    default_xlate, default_check, NULL, "Gayle"
+    default_xlate, default_check, NULL, "Gayle",
+    dummy_lgeti, dummy_wgeti, ABFLAG_IO
 };
 
 uae_u32 REGPARAM2 gayle_lget (uaecptr addr)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index bfc5c12..4c316b8
--- a/gencpu.c
+++ b/gencpu.c
@@ -29,7 +29,7 @@
 static FILE *headerfile;
 static FILE *stblfile;
 
-static int using_prefetch;
+static int using_prefetch, using_indirect;
 static int using_exception_3;
 static int using_ce;
 static int cpu_level;
@@ -212,6 +212,9 @@ static void gen_nextilong (char *type, char *name, int norefill)
                printf ("\t%s %s = get_long_prefetch (regs, %d);\n", type, name, r + 2);
                insn_n_cycles += 8;
            }
+       } else if (using_indirect) {
+           insn_n_cycles += 8;
+           printf ("\t%s %s = get_ilongi (%d);\n", type, name, r);
        } else {
            insn_n_cycles += 8;
            printf ("\t%s %s = get_ilong (regs, %d);\n", type, name, r);
@@ -238,6 +241,9 @@ static const char *gen_nextiword (int norefill)
                sprintf (buffer, "get_word_prefetch (regs, %d)", r + 2);
                insn_n_cycles += 4;
            }
+       } else if (using_indirect) {
+           sprintf (buffer, "get_iwordi(%d)", r);
+           insn_n_cycles += 4;
        } else {
            sprintf (buffer, "get_iword (regs, %d)", r);
            insn_n_cycles += 4;
@@ -266,6 +272,9 @@ static const char *gen_nextibyte (int norefill)
                sprintf (buffer, "(uae_u8)get_word_prefetch (regs, %d)", r + 2);
                insn_n_cycles += 4;
            }
+       } else if (using_indirect)  {
+           sprintf (buffer, "get_ibytei (%d)", r);
+           insn_n_cycles += 4;
        } else {
            sprintf (buffer, "get_ibyte (regs, %d)", r);
            insn_n_cycles += 4;
@@ -1701,6 +1710,8 @@ static void gen_opcode (unsigned long int opcode)
     case i_RTS:
        if (using_ce)
            printf ("\tm68k_do_rts_ce(regs);\n");
+       else if (using_indirect)
+           printf ("\tm68k_do_rtsi(regs);\n");
        else
            printf ("\tm68k_do_rts(regs);\n");
        m68k_pc_offset = 0;
@@ -1777,6 +1788,8 @@ static void gen_opcode (unsigned long int opcode)
        addcycles (2);
        if (using_ce)
            printf ("\tm68k_do_bsr_ce (regs, m68k_getpc(regs) + %d, s);\n", m68k_pc_offset);
+       else if (using_indirect)
+           printf ("\tm68k_do_bsri (regs, m68k_getpc(regs) + %d, s);\n", m68k_pc_offset);
        else
            printf ("\tm68k_do_bsr (regs, m68k_getpc(regs) + %d, s);\n", m68k_pc_offset);
        m68k_pc_offset = 0;
@@ -3158,6 +3171,7 @@ int main (int argc, char **argv)
     generate_includes (stblfile);
 
     using_prefetch = 0;
+    using_indirect = 0;
     using_exception_3 = 1;
     using_ce = 0;
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/gtkui.c b/gtkui.c
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index a245cc0..c51cd06
@@ -30,7 +30,7 @@ extern void maybe_blit (int, int);
 extern void reset_blit (int);
 extern int blitnasty (void);
 extern int blitnnasty (int);
-extern void blitter_handler (void);
+extern void blitter_handler (uae_u32);
 extern void build_blitfilltable (void);
 extern void do_blitter (int);
 extern void decide_blitter (int hpos);
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 01cfebc..3825250
@@ -2,7 +2,7 @@
 STATIC_INLINE uae_u32 get_word_prefetch (struct regstruct *regs, int o)
 {
     uae_u32 v = regs->irc;
-    regs->irc = get_word (m68k_getpc(regs) + o);
+    regs->irc = get_wordi (m68k_getpc(regs) + o);
     return v;
 }
 STATIC_INLINE uae_u32 get_long_prefetch (struct regstruct *regs, int o)
@@ -13,29 +13,25 @@ STATIC_INLINE uae_u32 get_long_prefetch (struct regstruct *regs, int o)
 }
 
 #ifdef CPUEMU_6
-
-#if 0
-STATIC_INLINE uae_u32 mem_access_delay_word_read_cycles (uaecptr addr, int *cycles)
+STATIC_INLINE uae_u32 mem_access_delay_word_read (uaecptr addr)
 {
     if (addr < 0x200000 || (addr >= 0xc00000 && addr < 0xe00000)) {
-       return wait_cpu_cycle_read_cycles (addr, 1, cycles);
+       return wait_cpu_cycle_read (addr, 1);
     } else if (!(addr >= 0xa00000 && addr < 0xc00000)) {
        do_cycles_ce (4 * CYCLE_UNIT / 2);
-       *cycles = 4;
     }
     return get_word (addr);
 }
-#endif
-
-STATIC_INLINE uae_u32 mem_access_delay_word_read (uaecptr addr)
+STATIC_INLINE uae_u32 mem_access_delay_wordi_read (uaecptr addr)
 {
     if (addr < 0x200000 || (addr >= 0xc00000 && addr < 0xe00000)) {
        return wait_cpu_cycle_read (addr, 1);
     } else if (!(addr >= 0xa00000 && addr < 0xc00000)) {
        do_cycles_ce (4 * CYCLE_UNIT / 2);
     }
-    return get_word (addr);
+    return get_wordi (addr);
 }
+
 STATIC_INLINE uae_u32 mem_access_delay_byte_read (uaecptr addr)
 {
     if (addr < 0x200000 || (addr >= 0xc00000 && addr < 0xe00000)) {
@@ -70,6 +66,10 @@ STATIC_INLINE uae_u32 get_word_ce (uaecptr addr)
 {
     return mem_access_delay_word_read (addr);
 }
+STATIC_INLINE uae_u32 get_wordi_ce (uaecptr addr)
+{
+    return mem_access_delay_wordi_read (addr);
+}
 
 STATIC_INLINE uae_u32 get_byte_ce (uaecptr addr)
 {
@@ -79,19 +79,10 @@ STATIC_INLINE uae_u32 get_byte_ce (uaecptr addr)
 STATIC_INLINE uae_u32 get_word_ce_prefetch (struct regstruct *regs, int o)
 {
     uae_u32 v = regs->irc;
-    regs->irc = get_word_ce (m68k_getpc(regs) + o);
+    regs->irc = get_wordi_ce (m68k_getpc(regs) + o);
     return v;
 }
 
-#if 0
-STATIC_INLINE int get_word_ce_prefetch_cycles (int o)
-{
-    int cycles = 0;
-    regs.irc = mem_access_delay_word_read_cycles (m68k_getpc() + o, &cycles);
-    return cycles;
-}
-#endif
-
 STATIC_INLINE void put_word_ce (uaecptr addr, uae_u16 v)
 {
     mem_access_delay_word_write (addr, v);
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 56d4bda..52eb43f
@@ -25,7 +25,7 @@ extern void record_copper_reset(void);
 extern int mmu_init(int,uaecptr,uaecptr);
 extern void mmu_do_hit(void);
 extern void dump_aga_custom (void);
-
+extern void memory_map_dump (void);
 #else
 
 STATIC_INLINE void activate_debugger (void) { };
old mode 100755 (executable)
new mode 100644 (file)
index 92848ba..2b782d2
@@ -18,7 +18,7 @@ extern void disk_insert (int num, const char *name);
 extern void disk_insert_force (int num, const char *name);
 extern void DISK_check_change (void);
 extern struct zfile *DISK_validate_filename (const char *, int, int *, uae_u32 *);
-extern void DISK_handler (void);
+extern void DISK_handler (uae_u32);
 extern void DISK_update (int hpos);
 extern void DISK_hsync (int hpos);
 extern void DISK_reset (void);
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index eef0d8a..21849d8
@@ -28,21 +28,41 @@ extern void do_cycles_ce (long cycles);
 extern unsigned long currcycle, nextevent, is_lastline;
 extern unsigned long sample_evtime;
 typedef void (*evfunc)(void);
+typedef void (*evfunc2)(uae_u32);
+
+typedef unsigned long int evt;
 
 struct ev
 {
     int active;
-    unsigned long int evtime, oldcycles;
+    evt evtime, oldcycles;
     evfunc handler;
 };
 
+struct ev2
+{
+    int active;
+    evt evtime;
+    uae_u32 data;
+    evfunc2 handler;
+};
+
 enum {
-    ev_hsync, ev_copper, ev_audio, ev_cia, ev_blitter, ev_disk,
+    ev_hsync, ev_audio, ev_cia, ev_misc,
     ev_max
 };
 
+enum {
+    ev2_blitter, ev2_disk, ev2_misc,
+    ev2_max = 8
+};
+
 extern struct ev eventtab[ev_max];
+extern struct ev2 eventtab2[ev2_max];
 
+extern void event2_newevent(int, evt);
+extern void event2_newevent2(evt, uae_u32, evfunc2);
+extern void event2_remevent(int);
 
 #ifdef JIT
 #include "events_jit.h"
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 6326b00..4a8c523
@@ -114,7 +114,7 @@ STATIC_INLINE int same_aname (const char *an1, const char *an2)
 extern int fsdb_name_invalid (const char *n);
 extern int fsdb_fill_file_attrs (a_inode *, a_inode *);
 extern int fsdb_set_file_attrs (a_inode *);
-extern int fsdb_mode_representable_p (const a_inode *);
+extern int fsdb_mode_representable_p (const a_inode *, int);
 extern int fsdb_mode_supported (const a_inode *);
 extern char *fsdb_create_unique_nname (a_inode *base, const char *);
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index fb2b842..075fa87
@@ -160,6 +160,8 @@ extern int inputdevice_uaelib (char*, char*);
 #define INPREC_KEY 3
 #define INPREC_DISKINSERT 4
 #define INPREC_DISKREMOVE 5
+#define INPREC_VSYNC 6
+#define INPREC_CIAVSYNC 7
 #define INPREC_END 0xff
 
 extern int input_recording;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 0764b3c..4c7d4cd
@@ -64,6 +64,7 @@ extern uae_u16 kickstart_version;
 
 extern uae_u8* baseaddr[];
 
+enum { ABFLAG_UNK = 0, ABFLAG_RAM, ABFLAG_ROM, ABFLAG_ROMIN, ABFLAG_IO, ABFLAG_NONE };
 typedef struct {
     /* These ones should be self-explanatory... */
     mem_get_func lget, wget, bget;
@@ -84,6 +85,9 @@ typedef struct {
        for this particular bank. */
     uae_u8 *baseaddr;
     char *name;
+    /* for instruction opcode/operand fetches */
+    mem_get_func lgeti, wgeti;
+    int flags;
 } addrbank;
 
 extern uae_u8 *filesysory;
@@ -116,6 +120,9 @@ extern int address_space_24;
 
 extern int REGPARAM3 default_check(uaecptr addr, uae_u32 size) REGPARAM;
 extern uae_u8 *REGPARAM3 default_xlate(uaecptr addr) REGPARAM;
+/* 680x0 opcode fetches */
+extern uae_u32 REGPARAM3 dummy_lgeti (uaecptr addr) REGPARAM;
+extern uae_u32 REGPARAM3 dummy_wgeti (uaecptr addr) REGPARAM;
 
 #define bankindex(addr) (((uaecptr)(addr)) >> 16)
 
@@ -149,6 +156,8 @@ extern void memory_hardreset (void);
 #define longget(addr) (call_mem_get_func(get_mem_bank(addr).lget, addr))
 #define wordget(addr) (call_mem_get_func(get_mem_bank(addr).wget, addr))
 #define byteget(addr) (call_mem_get_func(get_mem_bank(addr).bget, addr))
+#define longgeti(addr) (call_mem_get_func(get_mem_bank(addr).lgeti, addr))
+#define wordgeti(addr) (call_mem_get_func(get_mem_bank(addr).wgeti, addr))
 #define longput(addr,l) (call_mem_put_func(get_mem_bank(addr).lput, addr, l))
 #define wordput(addr,w) (call_mem_put_func(get_mem_bank(addr).wput, addr, w))
 #define byteput(addr,b) (call_mem_put_func(get_mem_bank(addr).bput, addr, b))
@@ -165,6 +174,14 @@ STATIC_INLINE uae_u32 get_byte(uaecptr addr)
 {
     return byteget(addr);
 }
+STATIC_INLINE uae_u32 get_longi(uaecptr addr)
+{
+    return longgeti(addr);
+}
+STATIC_INLINE uae_u32 get_wordi(uaecptr addr)
+{
+    return wordgeti(addr);
+}
 
 /*
  * Read a host pointer from addr
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index e0d9082..f592479
@@ -151,6 +151,7 @@ STATIC_INLINE uae_u32 munge24(uae_u32 x)
 extern unsigned long irqcycles[15];
 extern int irqdelay[15];
 extern int mmu_enabled, mmu_triggered;
+extern int cpu_cycles;
 
 STATIC_INLINE void set_special (struct regstruct *regs, uae_u32 x)
 {
@@ -183,10 +184,26 @@ STATIC_INLINE uaecptr m68k_getpc_p (struct regstruct *regs, uae_u8 *p)
     return regs->pc + ((char *)p - (char *)regs->pc_oldp);
 }
 
+STATIC_INLINE void m68k_setpci(struct regstruct *regs, uaecptr newpc)
+{
+    regs->pc = newpc;
+}
+STATIC_INLINE uaecptr m68k_getpci(struct regstruct *regs)
+{
+    return regs->pc;
+}
+STATIC_INLINE void m68k_incpci(struct regstruct *regs, int o)
+{
+    regs->pc += o;
+}
+
 #define get_ibyte(regs, o) do_get_mem_byte((uae_u8 *)((regs)->pc_p + (o) + 1))
 #define get_iword(regs, o) do_get_mem_word((uae_u16 *)((regs)->pc_p + (o)))
 #define get_ilong(regs, o) do_get_mem_long((uae_u32 *)((regs)->pc_p + (o)))
 
+#define get_iwordi(o) get_wordi(o)
+#define get_ilongi(o) get_longi(o)
+
 #define m68k_incpc(regs, o) ((regs)->pc_p += (o))
 
 /* These are only used by the 68020/68881 code, and therefore don't
@@ -204,6 +221,12 @@ STATIC_INLINE uae_u32 next_iword (struct regstruct *regs)
     m68k_incpc (regs, 2);
     return r;
 }
+STATIC_INLINE uae_u32 next_iwordi (struct regstruct *regs)
+{
+    uae_u32 r = get_iwordi (m68k_getpci(regs));
+    m68k_incpc (regs, 2);
+    return r;
+}
 
 STATIC_INLINE uae_u32 next_ilong (struct regstruct *regs)
 {
@@ -211,12 +234,23 @@ STATIC_INLINE uae_u32 next_ilong (struct regstruct *regs)
     m68k_incpc (regs, 4);
     return r;
 }
+STATIC_INLINE uae_u32 next_ilongi (struct regstruct *regs)
+{
+    uae_u32 r = get_ilongi (m68k_getpci(regs));
+    m68k_incpc (regs, 4);
+    return r;
+}
 
 STATIC_INLINE void m68k_do_rts(struct regstruct *regs)
 {
     m68k_setpc(regs, get_long(m68k_areg(regs, 7)));
     m68k_areg(regs, 7) += 4;
 }
+STATIC_INLINE void m68k_do_rtsi(struct regstruct *regs)
+{
+    m68k_setpci(regs, get_long(m68k_areg(regs, 7)));
+    m68k_areg(regs, 7) += 4;
+}
 
 STATIC_INLINE void m68k_do_bsr(struct regstruct *regs, uaecptr oldpc, uae_s32 offset)
 {
@@ -224,6 +258,12 @@ STATIC_INLINE void m68k_do_bsr(struct regstruct *regs, uaecptr oldpc, uae_s32 of
     put_long(m68k_areg(regs, 7), oldpc);
     m68k_incpc(regs, offset);
 }
+STATIC_INLINE void m68k_do_bsri(struct regstruct *regs, uaecptr oldpc, uae_s32 offset)
+{
+    m68k_areg(regs, 7) -= 4;
+    put_long(m68k_areg(regs, 7), oldpc);
+    m68k_incpci(regs, offset);
+}
 
 STATIC_INLINE void m68k_do_jsr(struct regstruct *regs, uaecptr oldpc, uaecptr dest)
 {
@@ -242,6 +282,7 @@ STATIC_INLINE void m68k_setstopped (struct regstruct *regs, int stop)
 }
 
 extern uae_u32 REGPARAM3 get_disp_ea_020 (struct regstruct *regs, uae_u32 base, uae_u32 dp) REGPARAM;
+extern uae_u32 REGPARAM3 get_disp_ea_020i (struct regstruct *regs, uae_u32 base, uae_u32 dp) REGPARAM;
 extern uae_u32 REGPARAM3 get_disp_ea_000 (struct regstruct *regs, uae_u32 base, uae_u32 dp) REGPARAM;
 extern void m68k_disasm_ea (void *f, uaecptr addr, uaecptr *nextpc, int cnt, uae_u32 *seaddr, uae_u32 *deaddr);
 extern void m68k_disasm (void *f, uaecptr addr, uaecptr *nextpc, int cnt);
@@ -250,6 +291,7 @@ extern void REGPARAM3 MakeSR (struct regstruct *regs) REGPARAM;
 extern void REGPARAM3 MakeFromSR (struct regstruct *regs) REGPARAM;
 extern void REGPARAM3 Exception (int, struct regstruct *regs, uaecptr) REGPARAM;
 extern void Interrupt (int nr);
+extern void doint (void);
 extern void dump_counts (void);
 extern int m68k_move2c (int, uae_u32 *);
 extern int m68k_movec2 (int, uae_u32 *);
old mode 100755 (executable)
new mode 100644 (file)
index 0a7051d..8b666cc
@@ -9,7 +9,7 @@
 
 #define UAEMAJOR 1
 #define UAEMINOR 3
-#define UAESUBREV 3
+#define UAESUBREV 4
 
 typedef enum { KBD_LANG_US, KBD_LANG_DK, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR, KBD_LANG_IT, KBD_LANG_ES } KbdLang;
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 59448fe..9f49193
@@ -46,3 +46,4 @@ extern char *colormodes[];
 extern void fetch_saveimagepath (char*, int, int);
 extern void fetch_configurationpath (char *out, int size);
 extern void fetch_screenshotpath (char *out, int size);
+extern int uaerand(void);
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index fc019c9..2ad4825
@@ -118,6 +118,7 @@ static struct zfile *inprec_zf;
 static int inprec_size;
 int input_recording = 0;
 static uae_u8 *inprec_plast, *inprec_plastptr;
+static int inprec_div;
 
 static uae_u32 oldbuttons[4];
 static uae_u16 oldjoy[2];
@@ -132,6 +133,7 @@ int inprec_open(char *fname, int record)
     if (inprec_zf == NULL)
        return 0;
     inprec_size = 10000;
+    inprec_div = 1;
     if (record < 0) {
        uae_u32 id;
        zfile_fseek (inprec_zf, 0, SEEK_END);
@@ -146,13 +148,15 @@ int inprec_open(char *fname, int record)
            return 0;
        }
        inprec_pu32();
-       srand(inprec_pu32());
+       t = inprec_pu32();
        i = inprec_pu32();
        while (i-- > 0)
            inprec_pu8();
        inprec_p = inprec_plastptr;
        oldbuttons[0] = oldbuttons[1] = oldbuttons[2] = oldbuttons[3] = 0;
        oldjoy[0] = oldjoy[1] = 0;
+       if (record < -1)
+           inprec_div = maxvpos;
     } else if (record > 0) {
        inprec_buffer = inprec_p = xmalloc (inprec_size);
        inprec_ru32('UAE\0');
@@ -166,6 +170,7 @@ int inprec_open(char *fname, int record)
        return 0;
     }
     input_recording = record;
+    srand(t);
     CIA_inprec_prepare();
     write_log ("inprec initialized '%s', mode=%d\n", fname, input_recording);
     return 1;
@@ -235,6 +240,8 @@ int inprec_pstart(uae_u8 type)
 {
     uae_u8 *p = inprec_p;
     uae_u32 hc = hsync_counter;
+    static uae_u8 *lastp;
+    uae_u32 hc_orig, hc2_orig;
 
     if (savestate_state)
        return 0;
@@ -242,20 +249,29 @@ int inprec_pstart(uae_u8 type)
        inprec_close();
        return 0;
     }
-    if (input_recording < -1) {
-       hc /= maxvpos;
-       hc *= maxvpos;
-    }
+    hc_orig = hc;
+    hc /= inprec_div;
+    hc *= inprec_div;
     for (;;) {
        uae_u32 hc2 = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
-       if (input_recording < -1) {
-           hc2 /= maxvpos;
-           hc2 *= maxvpos;
+       if (p > lastp) {
+           write_log("INPREC: Next %08.8x (%08.8x=%d): %d (%d)\n", hc2, hc, hc2 - hc, p[5 + 1], p[5]);
+           lastp = p;
        }
-       if (hc2 != hc)
+       hc2_orig = hc2;
+       hc2 /= inprec_div;
+       hc2 *= inprec_div;
+       if (hc > hc2) {
+           write_log("INPREC: %08.8x > %08.8x: %d (%d) missed!\n", hc, hc2, p[5 + 1], p[5]);
+           inprec_close();
+           return 0;
+       }
+       if (hc2 != hc) {
+           lastp = p;
            break;
+       }
        if (p[5 + 1] == type) {
-           write_log("INPREC: %08.8x: %d (%d)\n", hc, type, p[5]);
+           write_log("INPREC: %08.8x: %d (%d) (%+d)\n", hc, type, p[5], hc_orig - hc2_orig);
            inprec_plast = p;
            inprec_plastptr = p + 5 + 2;
            return 1;
@@ -275,16 +291,12 @@ void inprec_pend(void)
     inprec_plast[5 + 1] = 0;
     inprec_plast = NULL;
     inprec_plastptr = NULL;
-    if (input_recording < -1) {
-       hc /= maxvpos;
-       hc *= maxvpos;
-    }
+    hc /= inprec_div;
+    hc *= inprec_div;
     for (;;) {
        uae_u32 hc2 = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
-       if (input_recording < -1) {
-           hc2 /= maxvpos;
-           hc2 *= maxvpos;
-       }
+       hc2 /= inprec_div;
+       hc2 *= inprec_div;
        if (hc2 != hc)
            break;
        if (p[5 + 1] != 0)
@@ -789,7 +801,9 @@ int getbuttonstate (int joy, int button)
 
     v = (joybutton[joy] & (1 << button)) ? 1 : 0;
     if (input_recording > 0 && ((joybutton[joy] ^ oldbuttons[joy]) & (1 << button))) {
-       oldbuttons[joy] = joybutton[joy];
+       oldbuttons[joy] &= ~(1 << button);
+       if (v)
+           oldbuttons[joy] |= 1 << button;
        inprec_rstart(INPREC_JOYBUTTON);
        inprec_ru8(joy);
        inprec_ru8(button);
@@ -1585,7 +1599,7 @@ void inputdevice_vsync (void)
        }
     }
     mouseupdate (100);
-    inputdelay = rand () % (maxvpos - 1);
+    inputdelay = uaerand () % (maxvpos - 1);
     idev[IDTYPE_MOUSE].read ();
     input_read = 1;
     input_vpos = 0;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/main.c b/main.c
old mode 100755 (executable)
new mode 100644 (file)
index 5232551..4105fff
--- a/main.c
+++ b/main.c
@@ -59,6 +59,10 @@ char warning_buffer[256];
 
 char optionsfile[256];
 
+int uaerand(void)
+{
+    return rand();
+}
 /* If you want to pipe printer output to a file, put something like
  * "cat >>printerfile.tmp" above.
  * The printer support was only tested with the driver "PostScript" on
old mode 100755 (executable)
new mode 100644 (file)
index 621cedc..b387983
--- a/memory.c
+++ b/memory.c
@@ -539,6 +539,8 @@ struct romdata *getromdatabyzfile (struct zfile *f)
 void getromname        (struct romdata *rd, char *name)
 {
     name[0] = 0;
+    if (!rd)
+       return;
     strcat (name, rd->name);
     if (rd->subrev && rd->subrev != rd->rev)
        sprintf (name + strlen (name), " rev %d.%d", rd->subver, rd->subrev);
@@ -601,7 +603,7 @@ static int REGPARAM3 dummy_check (uaecptr addr, uae_u32 size) REGPARAM;
 #define NONEXISTINGDATA 0
 //#define NONEXISTINGDATA 0xffffffff
 
-static void dummylog(int rw, uaecptr addr, int size, uae_u32 val)
+static void dummylog(int rw, uaecptr addr, int size, uae_u32 val, int ins)
 {
     if (illegal_count >= MAX_ILG)
        return;
@@ -613,7 +615,10 @@ static void dummylog(int rw, uaecptr addr, int size, uae_u32 val)
        return;
     if (MAX_ILG >= 0)
        illegal_count++;
-    if (rw) {
+    if (ins) {
+       write_log ("WARNING: Illegal opcode %cget at %08lx PC=%x\n",
+           size == 2 ? 'w' : 'l', addr, M68K_GETPC);
+    } else if (rw) {
        write_log ("Illegal %cput at %08lx=%08lx PC=%x\n",
            size == 1 ? 'b' : size == 2 ? 'w' : 'l', addr, val, M68K_GETPC);
     } else {
@@ -628,7 +633,18 @@ uae_u32 REGPARAM2 dummy_lget (uaecptr addr)
     special_mem |= S_READ;
 #endif
     if (currprefs.illegal_mem)
-       dummylog(0, addr, 4, 0);
+       dummylog(0, addr, 4, 0, 0);
+    if (currprefs.cpu_level >= 2)
+       return NONEXISTINGDATA;
+    return (regs.irc << 16) | regs.irc;
+}
+uae_u32 REGPARAM2 dummy_lgeti (uaecptr addr)
+{
+#ifdef JIT
+    special_mem |= S_READ;
+#endif
+    if (currprefs.illegal_mem)
+       dummylog(0, addr, 4, 0, 1);
     if (currprefs.cpu_level >= 2)
        return NONEXISTINGDATA;
     return (regs.irc << 16) | regs.irc;
@@ -640,7 +656,18 @@ uae_u32 REGPARAM2 dummy_wget (uaecptr addr)
     special_mem |= S_READ;
 #endif
     if (currprefs.illegal_mem)
-       dummylog(0, addr, 2, 0);
+       dummylog(0, addr, 2, 0, 0);
+    if (currprefs.cpu_level >= 2)
+       return NONEXISTINGDATA;
+    return regs.irc;
+}
+uae_u32 REGPARAM2 dummy_wgeti (uaecptr addr)
+{
+#ifdef JIT
+    special_mem |= S_READ;
+#endif
+    if (currprefs.illegal_mem)
+       dummylog(0, addr, 2, 0, 1);
     if (currprefs.cpu_level >= 2)
        return NONEXISTINGDATA;
     return regs.irc;
@@ -652,7 +679,7 @@ uae_u32 REGPARAM2 dummy_bget (uaecptr addr)
     special_mem |= S_READ;
 #endif
     if (currprefs.illegal_mem)
-       dummylog(0, addr, 1, 0);
+       dummylog(0, addr, 1, 0, 0);
     if (currprefs.cpu_level >= 2)
        return NONEXISTINGDATA;
     return (addr & 1) ? regs.irc : regs.irc >> 8;
@@ -664,7 +691,7 @@ void REGPARAM2 dummy_lput (uaecptr addr, uae_u32 l)
     special_mem |= S_WRITE;
 #endif
    if (currprefs.illegal_mem)
-       dummylog(1, addr, 4, l);
+       dummylog(1, addr, 4, l, 0);
 }
 void REGPARAM2 dummy_wput (uaecptr addr, uae_u32 w)
 {
@@ -672,7 +699,7 @@ void REGPARAM2 dummy_wput (uaecptr addr, uae_u32 w)
     special_mem |= S_WRITE;
 #endif
    if (currprefs.illegal_mem)
-       dummylog(1, addr, 2, w);
+       dummylog(1, addr, 2, w, 0);
 }
 void REGPARAM2 dummy_bput (uaecptr addr, uae_u32 b)
 {
@@ -680,7 +707,7 @@ void REGPARAM2 dummy_bput (uaecptr addr, uae_u32 b)
     special_mem |= S_WRITE;
 #endif
    if (currprefs.illegal_mem)
-       dummylog(1, addr, 1, b);
+       dummylog(1, addr, 1, b, 0);
 }
 
 int REGPARAM2 dummy_check (uaecptr addr, uae_u32 size)
@@ -1486,67 +1513,77 @@ uae_u8 *REGPARAM2 default_xlate (uaecptr a)
 addrbank dummy_bank = {
     dummy_lget, dummy_wget, dummy_bget,
     dummy_lput, dummy_wput, dummy_bput,
-    default_xlate, dummy_check, NULL, NULL
+    default_xlate, dummy_check, NULL, NULL,
+    dummy_lgeti, dummy_wgeti, ABFLAG_NONE
 };
 
 #ifdef AUTOCONFIG
 addrbank mbres_bank = {
     mbres_lget, mbres_wget, mbres_bget,
     mbres_lput, mbres_wput, mbres_bput,
-    default_xlate, mbres_check, NULL, "MBRES"
+    default_xlate, mbres_check, NULL, "MBRES",
+    dummy_lgeti, dummy_wgeti, ABFLAG_RAM
 };
 #endif
 
 addrbank chipmem_bank = {
     chipmem_lget, chipmem_wget, chipmem_bget,
     chipmem_lput, chipmem_wput, chipmem_bput,
-    chipmem_xlate, chipmem_check, NULL, "Chip memory"
+    chipmem_xlate, chipmem_check, NULL, "Chip memory",
+    chipmem_lget, chipmem_wget, ABFLAG_RAM
 };
 
 addrbank chipmem_agnus_bank = {
     chipmem_agnus_lget, chipmem_agnus_wget, chipmem_agnus_bget,
     chipmem_agnus_lput, chipmem_agnus_wput, chipmem_agnus_bput,
-    chipmem_xlate, chipmem_check, NULL, "Chip memory"
+    chipmem_xlate, chipmem_check, NULL, "Chip memory",
+    chipmem_agnus_lget, chipmem_agnus_wget, ABFLAG_RAM
 };
 
 #ifdef AGA
 addrbank chipmem_bank_ce2 = {
     chipmem_lget_ce2, chipmem_wget_ce2, chipmem_bget_ce2,
     chipmem_lput_ce2, chipmem_wput_ce2, chipmem_bput_ce2,
-    chipmem_xlate, chipmem_check, NULL, "Chip memory"
+    chipmem_xlate, chipmem_check, NULL, "Chip memory",
+    chipmem_lget_ce2, chipmem_wget_ce2, ABFLAG_RAM
 };
 #endif
 
 addrbank bogomem_bank = {
     bogomem_lget, bogomem_wget, bogomem_bget,
     bogomem_lput, bogomem_wput, bogomem_bput,
-    bogomem_xlate, bogomem_check, NULL, "Slow memory"
+    bogomem_xlate, bogomem_check, NULL, "Slow memory",
+    bogomem_lget, bogomem_wget, ABFLAG_RAM
 };
 
 #ifdef AUTOCONFIG
 addrbank a3000mem_bank = {
     a3000mem_lget, a3000mem_wget, a3000mem_bget,
     a3000mem_lput, a3000mem_wput, a3000mem_bput,
-    a3000mem_xlate, a3000mem_check, NULL, "A3000 memory"
+    a3000mem_xlate, a3000mem_check, NULL, "A3000 memory",
+    a3000mem_lget, a3000mem_wget, ABFLAG_RAM
 };
 #endif
 
 addrbank kickmem_bank = {
     kickmem_lget, kickmem_wget, kickmem_bget,
     kickmem_lput, kickmem_wput, kickmem_bput,
-    kickmem_xlate, kickmem_check, NULL, "Kickstart ROM"
+    kickmem_xlate, kickmem_check, NULL, "Kickstart ROM",
+    kickmem_lget, kickmem_wget, ABFLAG_ROM
 };
 
 addrbank kickram_bank = {
     kickmem_lget, kickmem_wget, kickmem_bget,
     kickmem2_lput, kickmem2_wput, kickmem2_bput,
-    kickmem_xlate, kickmem_check, NULL, "Kickstart Shadow RAM"
+    kickmem_xlate, kickmem_check, NULL, "Kickstart Shadow RAM",
+    kickmem_lget, kickmem_wget, ABFLAG_UNK
 };
 
 addrbank extendedkickmem_bank = {
     extendedkickmem_lget, extendedkickmem_wget, extendedkickmem_bget,
     extendedkickmem_lput, extendedkickmem_wput, extendedkickmem_bput,
-    extendedkickmem_xlate, extendedkickmem_check, NULL, "Extended Kickstart ROM"
+    extendedkickmem_xlate, extendedkickmem_check, NULL, "Extended Kickstart ROM",
+    extendedkickmem_lget, extendedkickmem_wget, ABFLAG_ROM
 };
 
 static int kickstart_checksum (uae_u8 *mem, int size)
@@ -1611,12 +1648,12 @@ int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksum, int
        dochecksum = 0;
     }
     for (j = 0; j < 256 && i >= 262144; j++) {
-       if (!memcmp (kickmemory + j, kickstring, strlen (kickstring) + 1))
+       if (!memcmp (mem + j, kickstring, strlen (kickstring) + 1))
            break;
     }
+
     if (j == 256 || i < 262144)
        dochecksum = 0;
-
     if (dochecksum)
        kickstart_checksum (mem, size);
     return i;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 7ab3f89..30364be
--- a/newcpu.c
+++ b/newcpu.c
@@ -1,4 +1,4 @@
- /*
+/*
   * UAE - The Un*x Amiga Emulator
   *
   * MC68000 emulation
 extern uae_u8* compiled_code;
 #include "compemu.h"
 #include <signal.h>
-int oink=0;
 /* For faster cycles handling */
-signed long pissoff=0;
+signed long pissoff = 0;
 /* Counter for missed vsyncmintime deadlines */
-int gonebad=0;
+int gonebad = 0;
 #else
 /* Need to have these somewhere */
 static void build_comp(void) {}
@@ -53,6 +52,7 @@ static int last_instructionaccess_for_exception_3;
 unsigned long irqcycles[15];
 int irqdelay[15];
 int mmu_enabled, mmu_triggered;
+int cpu_cycles;
 
 const int areg_byteinc[] = { 1,1,1,1,1,1,1,2 };
 const int imm8_table[] = { 8,1,2,3,4,5,6,7 };
@@ -810,7 +810,7 @@ void REGPARAM2 MakeFromSR (struct regstruct *regs)
        }
     }
 
-    set_special (regs, SPCFLAG_INT);
+    doint();
     if (regs->t1 || regs->t0)
        set_special (regs, SPCFLAG_TRACE);
     else
@@ -1099,7 +1099,7 @@ STATIC_INLINE void do_interrupt(int nr, struct regstruct *regs)
     Exception (nr + 24, regs, 0);
 
     regs->intmask = nr;
-    set_special (regs, SPCFLAG_INT);
+    doint();
 }
 
 void Interrupt (int nr)
@@ -1718,6 +1718,7 @@ STATIC_INLINE int do_specialties (int cycles, struct regstruct *regs)
 
     if (regs->spcflags & SPCFLAG_DOTRACE)
        Exception (9, regs, last_trace_ad);
+       
     if (regs->spcflags & SPCFLAG_TRAP) {
        unset_special (regs, SPCFLAG_TRAP);
        Exception (3, regs, 0);
@@ -1729,10 +1730,7 @@ STATIC_INLINE int do_specialties (int cycles, struct regstruct *regs)
            do_copper ();
        if (regs->spcflags & (SPCFLAG_INT | SPCFLAG_DOINT)) {
            int intr = intlev ();
-#ifdef JIT
-           if (currprefs.cachesize)
-               unset_special (regs, SPCFLAG_INT | SPCFLAG_DOINT);
-#endif
+           unset_special (regs, SPCFLAG_INT | SPCFLAG_DOINT);
            if (intr != -1 && intr > regs->intmask)
                Interrupt (intr);
        }
@@ -1766,30 +1764,16 @@ STATIC_INLINE int do_specialties (int cycles, struct regstruct *regs)
     if (regs->spcflags & SPCFLAG_TRACE)
        do_trace ();
 
-    /* interrupt takes at least 2 cycles (maybe 4) to reach the CPU and
-     * there are programs that require this delay (which is not too surprising..)
-     */
-#ifdef JIT
-    if ((regs->spcflags & SPCFLAG_DOINT)
-       || (!currprefs.cachesize && (regs->spcflags & SPCFLAG_INT))) {
-#else
     if (regs->spcflags & SPCFLAG_INT) {
-#endif
        int intr = intlev ();
-#ifdef JIT
-       if (currprefs.cachesize)
-           unset_special (regs, SPCFLAG_DOINT);
-#endif
+        unset_special (regs, SPCFLAG_INT | SPCFLAG_DOINT);
        if (intr != -1 && intr > regs->intmask)
            do_interrupt (intr, regs);
     }
-
-#ifdef JIT
-    if ((regs->spcflags & SPCFLAG_INT) && currprefs.cachesize) {
-       unset_special (regs, SPCFLAG_INT);
-       set_special (regs, SPCFLAG_DOINT);
+    if (regs->spcflags & SPCFLAG_DOINT) {
+        unset_special (regs, SPCFLAG_DOINT);
+        set_special (regs, SPCFLAG_INT);
     }
-#endif
 
     if ((regs->spcflags & (SPCFLAG_BRK | SPCFLAG_MODE_CHANGE))) {
        unset_special (regs, SPCFLAG_BRK | SPCFLAG_MODE_CHANGE);
@@ -1798,7 +1782,14 @@ STATIC_INLINE int do_specialties (int cycles, struct regstruct *regs)
     return 0;
 }
 
-static uae_u32 pcs[1000];
+void doint (void)
+{
+    if (currprefs.cpu_compatible)
+       set_special (&regs, SPCFLAG_INT);
+    else
+       set_special (&regs, SPCFLAG_DOINT);
+}
+//static uae_u32 pcs[1000];
 
 
 #ifndef CPUEMU_5
@@ -1812,12 +1803,12 @@ static void m68k_run_1 (void)
 /* It's really sad to have two almost identical functions for this, but we
    do it all for performance... :(
    This version emulates 68000's prefetch "cache" */
+int cpu_cycles;
 static void m68k_run_1 (void)
 {
     struct regstruct *r = &regs;
 
     for (;;) {
-       int cycles;
        uae_u32 opcode = r->ir;
 
        count_instr (opcode);
@@ -1832,14 +1823,12 @@ static void m68k_run_1 (void)
            //write_log("%08.8X-%04.4X ",pc, opcode);
        }
 #endif
-
-       cycles = (*cpufunctbl[opcode])(opcode, r);
-
-       cycles &= cycles_mask;
-       cycles |= cycles_val;
-       do_cycles (cycles);
+       do_cycles (cpu_cycles);
+       cpu_cycles = (*cpufunctbl[opcode])(opcode, r);
+       cpu_cycles &= cycles_mask;
+       cpu_cycles |= cycles_val;
        if (r->spcflags) {
-           if (do_specialties (cycles, r))
+           if (do_specialties (cpu_cycles, r))
                return;
        }
        if (!currprefs.cpu_compatible || (currprefs.cpu_cycle_exact && currprefs.cpu_level == 0))
@@ -1889,17 +1878,17 @@ void do_nothing(void)
 void exec_nostats(void)
 {
     struct regstruct *r = &regs;
-    int new_cycles;
 
     for (;;)
     {
        uae_u16 opcode = get_iword(r, 0);
 
-       new_cycles = (*cpufunctbl[opcode])(opcode, r);
+       cpu_cycles = (*cpufunctbl[opcode])(opcode, r);
 
-       new_cycles &= cycles_mask;
-       new_cycles |= cycles_val;
-       do_cycles (new_cycles);
+       cpu_cycles &= cycles_mask;
+       cpu_cycles |= cycles_val;
+
+       do_cycles (cpu_cycles);
 
        if (end_block(opcode) || r->spcflags)
            return; /* We will deal with the spcflags in the caller */
@@ -1913,7 +1902,6 @@ void execute_normal(void)
     struct regstruct *r = &regs;
     int blocklen;
     cpu_history pc_hist[MAXRUN];
-    int new_cycles;
     int total_cycles;
 
     if (check_for_cache_miss())
@@ -1930,12 +1918,12 @@ void execute_normal(void)
        special_mem = DISTRUST_CONSISTENT_MEM;
        pc_hist[blocklen].location = (uae_u16*)r->pc_p;
 
-       new_cycles = (*cpufunctbl[opcode])(opcode, r);
+       cpu_cycles = (*cpufunctbl[opcode])(opcode, r);
 
-       new_cycles &= cycles_mask;
-       new_cycles |= cycles_val;
-       do_cycles (new_cycles);
-       total_cycles += new_cycles;
+       cpu_cycles &= cycles_mask;
+       cpu_cycles |= cycles_val;
+       do_cycles (cpu_cycles);
+       total_cycles += cpu_cycles;
        pc_hist[blocklen].specmem = special_mem;
        blocklen++;
        if (end_block(opcode) || blocklen >= MAXRUN || r->spcflags) {
@@ -2029,28 +2017,29 @@ static void m68k_run_2p (void)
     struct regstruct *r = &regs;
 
     prefetch_pc = m68k_getpc (r);
-    prefetch = get_long (prefetch_pc);
+    prefetch = get_longi (prefetch_pc);
     for (;;) {
-       int cycles;
        uae_u32 opcode;
        uae_u32 pc = m68k_getpc (r);
+
+       do_cycles (cpu_cycles);
+
        if (pc == prefetch_pc)
            opcode = prefetch >> 16;
        else if (pc == prefetch_pc + 2)
            opcode = prefetch & 0xffff;
        else
-           opcode = get_word (pc);
+           opcode = get_wordi (pc);
 
        count_instr (opcode);
 
        prefetch_pc = m68k_getpc (r) + 2;
-       prefetch = get_long (prefetch_pc);
-       cycles = (*cpufunctbl[opcode])(opcode, r);
-       cycles &= cycles_mask;
-       cycles |= cycles_val;
-       do_cycles (cycles);
+       prefetch = get_longi (prefetch_pc);
+       cpu_cycles = (*cpufunctbl[opcode])(opcode, r);
+       cpu_cycles &= cycles_mask;
+       cpu_cycles |= cycles_val;
        if (r->spcflags) {
-           if (do_specialties (cycles, r))
+           if (do_specialties (cpu_cycles, r))
                return;
        }
     }
@@ -2062,17 +2051,15 @@ static void m68k_run_2 (void)
    struct regstruct *r = &regs;
 
    for (;;) {
-       int cycles;
        uae_u32 opcode = get_iword (r, 0);
        count_instr (opcode);
 
-       cycles = (*cpufunctbl[opcode])(opcode, r);
-
-       cycles &= cycles_mask;
-       cycles |= cycles_val;
-       do_cycles (cycles);
+       do_cycles (cpu_cycles);
+       cpu_cycles = (*cpufunctbl[opcode])(opcode, r);
+       cpu_cycles &= cycles_mask;
+       cpu_cycles |= cycles_val;
        if (r->spcflags) {
-           if (do_specialties (cycles, r))
+           if (do_specialties (cpu_cycles, r))
                return;
        }
     }
@@ -2082,17 +2069,16 @@ static void m68k_run_2 (void)
 static void m68k_run_mmu (void)
 {
    for (;;) {
-       int cycles;
        uae_u32 opcode = get_iword (&regs, 0);
+       do_cycles (cpu_cycles);
        mmu_backup_regs = regs;
-       cycles = (*cpufunctbl[opcode])(opcode, &regs);
-       cycles &= cycles_mask;
-       cycles |= cycles_val;
+       cpu_cycles = (*cpufunctbl[opcode])(opcode, &regs);
+       cpu_cycles &= cycles_mask;
+       cpu_cycles |= cycles_val;
        if (mmu_triggered)
            mmu_do_hit();
-       do_cycles (cycles);
        if (regs.spcflags) {
-           if (do_specialties (cycles, &regs))
+           if (do_specialties (cpu_cycles, &regs))
                return;
        }
     }
@@ -2182,12 +2168,14 @@ void m68k_go (int may_quit)
            }
        }
 
+#if 0 /* what was the meaning of this? this breaks trace emulation if debugger is used */
        if (regs.spcflags) {
            uae_u32 of = regs.spcflags;
            regs.spcflags &= ~(SPCFLAG_BRK | SPCFLAG_MODE_CHANGE);
            do_specialties (0, &regs);
            regs.spcflags |= of & (SPCFLAG_BRK | SPCFLAG_MODE_CHANGE);
        }
+#endif
 #ifndef JIT
        run_func = currprefs.cpu_level == 0 && currprefs.cpu_cycle_exact ? m68k_run_1_ce :
                    currprefs.cpu_level == 0 && currprefs.cpu_compatible ? m68k_run_1 :
diff --git a/nogui.c b/nogui.c
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 04ed3d3..70cbbc5
 #include "sounddep/sound.h"
 #include "dxwrap.h"
 #include "win32.h"
-#include "win32gfx.h"
 #include "parser.h"
 #include "enforcer.h"
 #include "ahidsound.h"
 
-static long samples,playchannel,intcount,norec;
+static long samples, playchannel, intcount;
+static int record_enabled;
 int ahi_on;
-static char *sndptrmax, soundneutral,sndptr,*tempmem;
-#if 0
-static HWND dsound_tmpw;
-#endif
-static WAVEFORMATEX wavfmt;
+static char *sndptrmax, soundneutral, sndptr;
 
 static LPSTR lpData,sndptrout;
 extern uae_u32 chipmem_mask;
-unsigned int samplecount,*sndbufrecpt;
+unsigned int *sndbufrecpt;
 static char *ahisndbuffer,*sndrecbuffer; 
-static int ahisndbufsize,oldpos,*ahisndbufpt,ahitweak;;
-static unsigned int dwBytes,dwBytes1,dwBytes2,espstore;
-static LPVOID dwData1,dwData2;
+static int ahisndbufsize,*ahisndbufpt,ahitweak;;
 int ahi_pollrate = 40;
 
 int sound_freq_ahi, sound_channels_ahi, sound_bits_ahi;
@@ -96,6 +90,7 @@ static struct winuae *a6;
 
 static uae_u32 REGPARAM2 emulib_ExecuteNativeCode2 (TrapContext *context)
 { 
+    unsigned int espstore;
     uae_u8* object_UAM = (uae_u8*) m68k_areg(&context->regs, 0);
     uae_u32 d1 = m68k_dreg(&context->regs, 1);
     uae_u32 d2 = m68k_dreg(&context->regs, 2);
@@ -115,9 +110,8 @@ static uae_u32 REGPARAM2 emulib_ExecuteNativeCode2 (TrapContext *context)
     uaevar.z3offset = (uae_u32)(get_real_address (0x10000000) - 0x10000000);
     uaevar.amigawnd = hAmigaWnd;
     a6 = &uaevar;    
-    if( object_UAM ) 
-    {
-       SET_NATIVE_FUNC2(object_UAM );
+    if(object_UAM)  {
+       SET_NATIVE_FUNC2(object_UAM);
     __asm
        {   mov espstore,esp
            push regs_
@@ -139,9 +133,9 @@ static uae_u32 REGPARAM2 emulib_ExecuteNativeCode2 (TrapContext *context)
            mov esp,espstore
        }
        //CALL_NATIVE_FUNC2( d1, d2,d3, d4, d5, d6, d7, a1, a2, a3, a4 , a5 , a6 , a7);
+    } else {
+       return 0;
     }
-       else
-    return 0;
 }
 
 #endif
@@ -152,113 +146,70 @@ void ahi_close_sound (void)
    
     if (!ahi_on)
        return;
-    ahi_on=0;
-    ahisndbufpt =(int*) ahisndbuffer;
-    samplecount = 0;
-    if(lpDSB2) {
-       hr = IDirectSoundBuffer_Stop(lpDSB2);
-    }
-       
-    if(FAILED(hr)) {
-       write_log( "AHI: SoundStop() failure: %s\n", DXError(hr));
+    ahi_on = 0;
+    record_enabled = 0;
+    ahisndbufpt = (int*) ahisndbuffer;
+
+    if (lpDSB2) {
+       hr = IDirectSoundBuffer_Stop (lpDSB2);
+       if(FAILED(hr))
+           write_log( "AHI: SoundStop() failure: %s\n", DXError(hr));
     } else {
        write_log( "AHI: Sound Stopped...\n" );
     }
-    if(lpDSB2) {
-       IDirectSoundBuffer_Release( lpDSB2 );
-       lpDSB2 = NULL;
-    }
-    if(lpDSBprimary2)
-    {
-       IDirectSoundBuffer_Release(lpDSBprimary2);
-       lpDSBprimary2 = NULL;
-    }
-    if(lpDS2)
-    {
-       IDirectSound_Release(lpDS2);
-       lpDS2 = NULL;
-    }
+
+    if (lpDSB2)
+       IDirectSoundBuffer_Release (lpDSB2);
+    lpDSB2 = NULL;
+    if (lpDSBprimary2)
+       IDirectSoundBuffer_Release (lpDSBprimary2);
+    lpDSBprimary2 = NULL;
+    if (lpDS2)
+       IDirectSound_Release (lpDS2);
+    lpDS2 = NULL;
     
-    if(lpDSB2r)
-    {
-       IDirectSoundCaptureBuffer_Release(lpDSB2r);
-       lpDSB2r = NULL;
-    }
-    if(lpDS2r)
-    {
-       IDirectSound_Release(lpDS2r);
-       lpDS2 = NULL;
-    }
-#if 0
-    if (dsound_tmpw)
-    {
-       DestroyWindow(dsound_tmpw);
-       dsound_tmpw = 0;
-    }
-#endif
+    if (lpDSB2r)
+       IDirectSoundCaptureBuffer_Release (lpDSB2r);
+    lpDSB2r = NULL;
+    if (lpDS2r)
+       IDirectSound_Release (lpDS2r);
+    lpDS2r = NULL;
     if (ahisndbuffer)
        free(ahisndbuffer);
+    ahisndbuffer = NULL;
 }
 
 void ahi_updatesound(int force)
 {
     HRESULT hr;
-    int i;
+    int pos;
+    unsigned int dwBytes1, dwBytes2;
+    LPVOID dwData1, dwData2;
+    static int oldpos;
 
-    if(sound_flushes2 == 1)
-    {
-       oldpos=0;
-       INTREQ(0xa000);
-       intcount=1;
-       /* Lock the entire buffer */
-       hr = IDirectSoundBuffer_Lock(lpDSB2, 0, ahisndbufsize, &lpData, &dwBytes,&dwData2,&dwBytes2,0);
-       if(hr == DSERR_BUFFERLOST)
-       {
+    if(sound_flushes2 == 1) {
+       oldpos = 0;
+       intcount = 1;
+       INTREQ(0x8000 | 0x2000);
+       hr = IDirectSoundBuffer_Play(lpDSB2, 0, 0, DSBPLAY_LOOPING);
+       if(hr == DSERR_BUFFERLOST) {
            IDirectSoundBuffer_Restore(lpDSB2);
-           hr = IDirectSoundBuffer_Lock(lpDSB2, 0, 0, &lpData, &dwBytes,&dwData2,&dwBytes2, DSBLOCK_ENTIREBUFFER);
+           hr = IDirectSoundBuffer_Play(lpDSB2, 0, 0, DSBPLAY_LOOPING);
        }
-       /* Get the big looping IDirectSoundBuffer_Play() rolling here, but only once at startup */
-       hr = IDirectSoundBuffer_Play(lpDSB2, 0, 0, DSBPLAY_LOOPING);
-       hr = IDirectSoundBuffer_Unlock(lpDSB2,lpData,dwBytes,dwData2,dwBytes2); 
-       if (!norec)
-           hr = IDirectSoundCaptureBuffer_Start(lpDSB2r,DSBPLAY_LOOPING);
-       //memset( lpData, 0x80,4 );
     }
-/*
-{
-long dwEvt=1;
-
-  dwEvt = MsgWaitForMultipleObjects(
-           2,      // How many possible events
-           rghEvent,       // Location of handles
-           FALSE,          // Wait for all?
-           INFINITE,       // How long to wait
-           QS_ALLINPUT);   // Any message is an event
-
-calcsound=1;
-if (dwEvt==0)freeblock=0;
-if (dwEvt==1)freeblock=1;
 
-
-if (dwEvt>1 ){calcsound=0;return;}
-}
-*/
-
-    hr = IDirectSoundBuffer_GetCurrentPosition(lpDSB2, &i, 0);
-    if(hr != DSERR_BUFFERLOST)
-    {
-       i -= ahitweak;
-       if (i < 0)
-           i = i + ahisndbufsize;                  
-       if (i >= ahisndbufsize)
-           i = i - ahisndbufsize;
-       i = (i / (amigablksize * 4)) * (amigablksize * 4);
-       if (force == 1)
-       {
-           if ((oldpos != i))
-           {
-               INTREQ(0xa000);
+    hr = IDirectSoundBuffer_GetCurrentPosition(lpDSB2, &pos, 0);
+    if(hr != DSERR_BUFFERLOST) {
+       pos -= ahitweak;
+       if (pos < 0)
+           pos += ahisndbufsize;                  
+       if (pos >= ahisndbufsize)
+           pos -= ahisndbufsize;
+       pos = (pos / (amigablksize * 4)) * (amigablksize * 4);
+       if (force == 1) {
+           if (oldpos != pos) {
                intcount = 1;
+               INTREQ(0x8000 | 0x2000);
                return; //to generate amiga ints every amigablksize
            } else {
                return;
@@ -267,47 +218,44 @@ if (dwEvt>1 ){calcsound=0;return;}
     }
 
     hr = IDirectSoundBuffer_Lock(lpDSB2, oldpos, amigablksize * 4, &dwData1, &dwBytes1, &dwData2, &dwBytes2, 0);
-    if(hr == DSERR_BUFFERLOST)
-    {
-       write_log("AHI: lostbuf%d  %x\n",i,amigablksize);
+    if(hr == DSERR_BUFFERLOST) {
+       write_log("AHI: lostbuf %d %x\n", pos, amigablksize);
        IDirectSoundBuffer_Restore(lpDSB2);
-       hr = IDirectSoundBuffer_Lock(lpDSB2, 0, 0, &lpData, &dwBytes, NULL, NULL, DSBLOCK_ENTIREBUFFER);
-       dwData1=lpData;dwBytes1=dwBytes;dwBytes2=0;dwData2=0;
+       hr = IDirectSoundBuffer_Lock(lpDSB2, oldpos, amigablksize * 4, &dwData1, &dwBytes1, &dwData2, &dwBytes2, 0);
     }
     if(FAILED(hr))
        return;
 
-    //write_log("%d  %x\n",freeblock,blksize);
-
     if (currprefs.sound_stereo_swap_ahi) {
        int i;
-       uae_s16 *p1 = (uae_s16*)ahisndbuffer;
-       uae_s16 *p2 = (uae_s16*)dwData1;
-       for (i = 0; i < dwBytes1 / 2; i += 2) {
-           p2[i + 0] = p1[i + 1];
-           p2[i + 1] = p1[i + 0];
+       uae_s16 *p = (uae_s16*)ahisndbuffer;
+       for (i = 0; i < (dwBytes1 + dwBytes2) / 2; i += 2) {
+           uae_s16 tmp;
+           tmp = p[i + 0];
+           p[i + 0] = p[i + 1];
+           p[i + 1] = tmp;
        }
-    } else {
-       memcpy(dwData1,ahisndbuffer,dwBytes1);
     }
 
-    sndptrmax = ahisndbuffer+ahisndbufsize;
+    memcpy(dwData1, ahisndbuffer, dwBytes1);
+    if (dwData2)
+       memcpy(dwData2, (uae_u8*)ahisndbuffer + dwBytes1, dwBytes2);
+
+    sndptrmax = ahisndbuffer + ahisndbufsize;
     ahisndbufpt = (int*)ahisndbuffer;
  
-    IDirectSoundBuffer_Unlock(lpDSB2, dwData1,dwBytes1,dwData2, dwBytes2); 
+    IDirectSoundBuffer_Unlock(lpDSB2, dwData1, dwBytes1, dwData2, dwBytes2); 
+
     oldpos += amigablksize * 4;
     if (oldpos >= ahisndbufsize)
        oldpos -= ahisndbufsize;
-    if (oldpos != i) {
-       INTREQ(0xa000);
+    if (oldpos != pos) {
        intcount = 1;
+       INTREQ(0x8000 | 0x2000);
     }
 }
 
 
-/* Use this to pause or stop Win32 sound output */
-
-
 void ahi_finish_sound_buffer( void )
 {
     sound_flushes2++;
@@ -316,12 +264,48 @@ void ahi_finish_sound_buffer( void )
 
 extern GUID sound_device_guid[];
 
+static WAVEFORMATEX wavfmt;
+
+static int ahi_init_record_win32 (void)
+{
+    HRESULT hr;
+    DSCBUFFERDESC sound_buffer_rec;
+    // Record begin
+    hr = DirectSoundCaptureCreate(NULL, &lpDS2r, NULL);
+    if (FAILED(hr)) {
+       write_log( "AHI: DirectSoundCaptureCreate() failure: %s\n", DXError(hr));
+       record_enabled = -1;
+       return 0;
+    }
+    memset (&sound_buffer_rec, 0, sizeof(DSCBUFFERDESC));
+    sound_buffer_rec.dwSize = sizeof(DSCBUFFERDESC);
+    sound_buffer_rec.dwBufferBytes = amigablksize * 4 * RECORDBUFFER;
+    sound_buffer_rec.lpwfxFormat = &wavfmt;
+    sound_buffer_rec.dwFlags = 0 ;
+  
+    hr = IDirectSoundCapture_CreateCaptureBuffer(lpDS2r, &sound_buffer_rec, &lpDSB2r, NULL);
+    if (FAILED(hr)) {
+        write_log ("AHI: CreateCaptureSoundBuffer() failure: %s\n", DXError(hr));
+        record_enabled = -1;
+       return 0;
+    }
+
+    hr = IDirectSoundCaptureBuffer_Start(lpDSB2r, DSCBSTART_LOOPING);
+    if (FAILED(hr)) {
+       write_log("AHI: DirectSoundCaptureBuffer_Start failed: %s\n", DXError(hr));
+       record_enabled = -1;
+       return 0;
+    }
+    record_enabled = 1;
+    write_log("AHI: Init AHI Audio Recording \n");
+    return 1;
+}
+
 static int ahi_init_sound_win32 (void)
 {
     HRESULT hr;
     DSBUFFERDESC sound_buffer;
     DSCAPS DSCaps;
-    DSCBUFFERDESC sound_buffer_rec;
     
     if (lpDS2)
        return 0;
@@ -340,147 +324,77 @@ static int ahi_init_sound_win32 (void)
     ahisndbuffer = malloc(ahisndbufsize + 32);
     if (!ahisndbuffer)
        return 0;
-    hr = DirectSoundCreate( &sound_device_guid[currprefs.win32_soundcard], &lpDS2, NULL );
-    if (FAILED(hr))
-    {
+    hr = DirectSoundCreate(&sound_device_guid[currprefs.win32_soundcard], &lpDS2, NULL);
+    if (FAILED(hr)) {
        write_log( "AHI: DirectSoundCreate() failure: %s\n", DXError(hr));
        return 0;
     }
-    memset (&sound_buffer, 0, sizeof( DSBUFFERDESC ));
-    sound_buffer.dwSize = sizeof( DSBUFFERDESC );
+    memset (&sound_buffer, 0, sizeof(DSBUFFERDESC));
+    sound_buffer.dwSize = sizeof(DSBUFFERDESC);
     sound_buffer.dwFlags = DSBCAPS_PRIMARYBUFFER;
     sound_buffer.dwBufferBytes = 0;
     sound_buffer.lpwfxFormat = NULL;
-#if 0
-    dsound_tmpw = CreateWindowEx( WS_EX_ACCEPTFILES,
-                                 "PCsuxRox",
-                                 "Argh",
-                                 WS_CAPTION,
-                                 CW_USEDEFAULT, CW_USEDEFAULT,
-                                 10, 10,
-                                 NULL,
-                                 NULL,
-                                 0,
-                                 NULL);
-#endif
+
     DSCaps.dwSize = sizeof(DSCAPS);
     hr = IDirectSound_GetCaps(lpDS2, &DSCaps);
-    if(SUCCEEDED(hr))
-    {
+    if(SUCCEEDED(hr)) {
        if(DSCaps.dwFlags & DSCAPS_EMULDRIVER)
            write_log( "AHI: Your DirectSound Driver is emulated via WaveOut - yuck!\n" );
     }
     if FAILED(IDirectSound_SetCooperativeLevel(lpDS2, hMainWnd, DSSCL_PRIORITY))
        return 0;
     hr = IDirectSound_CreateSoundBuffer(lpDS2, &sound_buffer, &lpDSBprimary2, NULL);
-    if(FAILED(hr))
-    {
+    if(FAILED(hr)) {
        write_log("AHI: CreateSoundBuffer() failure: %s\n", DXError(hr));
        return 0;
     }
     hr = IDirectSoundBuffer_SetFormat(lpDSBprimary2, &wavfmt);
-    if(FAILED(hr))
-    {
+    if(FAILED(hr)) {
        write_log( "AHI: SetFormat() failure: %s\n", DXError(hr));
        return 0;
     }
     sound_buffer.dwBufferBytes = ahisndbufsize;
     sound_buffer.lpwfxFormat = &wavfmt;
     sound_buffer.dwFlags = DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLVOLUME /*| DSBCAPS_CTRLPOSITIONNOTIFY */
-       | DSBCAPS_GETCURRENTPOSITION2|DSBCAPS_GLOBALFOCUS |DSBCAPS_STATIC ;
+       | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_GLOBALFOCUS | DSBCAPS_STATIC ;
     hr = IDirectSound_CreateSoundBuffer(lpDS2, &sound_buffer, &lpDSB2, NULL);
-    if (FAILED(hr))
-    {
+    if (FAILED(hr)) {
        write_log("AHI: CreateSoundBuffer() failure: %s\n", DXError(hr));
        return 0;
     }
-/*  //used for PositionNotify 
-    for ( i = 0; i < 2; i++)
-    {
-       rghEvent[i] = CreateEvent(NULL, FALSE, FALSE, NULL);
-       if (NULL == rghEvent[i]) return FALSE;
-    }
-    rgdsbpn[0].dwOffset = 0;
-    rgdsbpn[0].hEventNotify = rghEvent[0];
-    rgdsbpn[1].dwOffset = (soundbufsize/2)*1;
-    rgdsbpn[1].hEventNotify = rghEvent[1];
-
-   
-    if FAILED(IDirectSoundBuffer_QueryInterface(lpDSB, 
-           &IID_IDirectSoundNotify, (VOID **)&lpdsNotify))
-       return FALSE; 
-    if FAILED(IDirectSoundNotify_SetNotificationPositions(
-            lpdsNotify, 2,rgdsbpn))
-    {
-       IDirectSoundNotify_Release(lpdsNotify);
-       return FALSE;
-    }
-
-*/
 
     hr = IDirectSoundBuffer_SetVolume (lpDSB2, 0);
-    if (FAILED(hr))
-    {
+    if (FAILED(hr)) {
        write_log("AHI: SetVolume() 2 failure: %s\n", DXError(hr));
        return 0;
     }
 
     hr = IDirectSoundBuffer_GetFormat(lpDSBprimary2,&wavfmt,500,0);
-    if(FAILED(hr))
-    {
+    if(FAILED(hr)) {
        write_log("AHI: GetFormat() failure: %s\n", DXError(hr));
        return 0;
     }
-    // Record begin
-    hr = DirectSoundCaptureCreate( NULL, &lpDS2r, NULL );
-    if (FAILED(hr))
-    {
-       write_log( "AHI: DirectSoundCaptureCreate() failure: %s\n", DXError(hr));
-       norec = 1;
-    }
-    memset (&sound_buffer_rec, 0, sizeof( DSCBUFFERDESC ));
-    sound_buffer_rec.dwSize = sizeof( DSCBUFFERDESC );
-    sound_buffer_rec.dwBufferBytes = amigablksize*4*RECORDBUFFER;
-    sound_buffer_rec.lpwfxFormat = &wavfmt;
-    sound_buffer_rec.dwFlags = 0 ;
-  
-    if (!norec)
-    {  
-       hr = IDirectSoundCapture_CreateCaptureBuffer( lpDS2r, &sound_buffer_rec, &lpDSB2r, NULL );
-       if (FAILED(hr)) 
-       {
-           write_log ("AHI: CreateCaptureSoundBuffer() failure: %s\n", DXError(hr));
-           norec = 1;
-       }
-    }
 
-    if(ahisndbuffer==0)
-       return 0;
-    ahisndbufpt =(int*) ahisndbuffer;
+    ahisndbufpt =(int*)ahisndbuffer;
     sndptrmax = ahisndbuffer + ahisndbufsize;
-    samplecount = 0;
-    memset(ahisndbuffer,  soundneutral, amigablksize*8);
+    memset(ahisndbuffer,  soundneutral, amigablksize * 8);
     write_log("AHI: Init AHI Sound Rate %d, Channels %d, Bits %d, Buffsize %d\n",
        sound_freq_ahi, sound_channels_ahi, sound_bits_ahi, amigablksize); 
-    if (!norec)
-       write_log("AHI: Init AHI Audio Recording \n");
     ahi_on = 1;
     return sound_freq_ahi;
 }
 
-static int rate;
-
 int ahi_open_sound (void)
 {  
+    int rate;
+
     uaevar.changenum++;
     if (!sound_freq_ahi)
        return 0;
-    if (ahi_on) {
+    if (ahi_on)
        ahi_close_sound();
-    }
     sound_flushes2 = 1;
-    if ((rate = ahi_init_sound_win32 ()) )
+    if ((rate = ahi_init_sound_win32 ()))
        return rate;
     return 0;
 } 
@@ -528,12 +442,9 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
     int opcode = m68k_dreg (&context->regs, 0);
     switch (opcode)
     {
-       int i,slen,t,todo,byte1,byte2;
-       LPTSTR p,p2,pos1,pos2;
        uae_u32 src, num_vars;
-       static int cap_pos,clipsize;
+       static int cap_pos, clipsize;
        static LPTSTR clipdat;
-       int cur_pos;
 
        case 0:
            cap_pos = 0;
@@ -561,6 +472,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
 
        case 2:
        {
+           int i;
            uaecptr addr = m68k_areg (&context->regs, 0);
            for (i = 0; i < amigablksize * 4; i += 4)
                *ahisndbufpt++ = get_long(addr + i);
@@ -570,50 +482,56 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
 
        case 3:
        {
+           LPTSTR pos1,pos2;
            uaecptr addr;
            HRESULT hr;
-           if (norec)
-               return -1;
+           int i, t, todo, byte1, byte2, cur_pos;
+
            if (!ahi_on)
                return -2;
-           hr = IDirectSoundCaptureBuffer_GetCurrentPosition(lpDSB2r,&t,&cur_pos);
+           if (record_enabled == 0)
+               ahi_init_record_win32();
+           if (record_enabled < 0)
+               return -2;
+           hr = IDirectSoundCaptureBuffer_GetCurrentPosition(lpDSB2r, &t, &cur_pos);
            if (FAILED(hr))
                return -1;
+
            t =  amigablksize * 4;
-               
            if (cap_pos <= cur_pos)
                todo = cur_pos - cap_pos;
            else
                todo = cur_pos + (RECORDBUFFER * t) - cap_pos;
-           if (todo < t) //if no complete buffer ready exit
+           if (todo < t) //if no complete buffer ready exit
                return -1;
-           }
-           hr = IDirectSoundCaptureBuffer_Lock(lpDSB2r,cap_pos,t,&pos1,&byte1,&pos2,&byte2,0);
+           hr = IDirectSoundCaptureBuffer_Lock(lpDSB2r, cap_pos, t, &pos1, &byte1, &pos2, &byte2, 0);
            if (FAILED(hr))
                return -1;
-           if ((cap_pos + t) < (t * RECORDBUFFER)) {
+           if ((cap_pos + t) < (t * RECORDBUFFER))
                cap_pos = cap_pos + t;
-           } else {
-               cap_pos = 0;
-           }  
+           else
+               cap_pos = 0;  
            addr = m68k_areg (&context->regs, 0);
            sndbufrecpt = (unsigned int*)pos1;
-           t=t/4;
+           t /= 4;
            for (i = 0; i < t; i++) {
                put_long(addr, *sndbufrecpt++);
                addr += 4;
            }
            t *= 4;
-           IDirectSoundCaptureBuffer_Unlock(lpDSB2r,pos1,byte1,pos2,byte2);
+           IDirectSoundCaptureBuffer_Unlock(lpDSB2r, pos1, byte1, pos2, byte2);
+           return (todo - t) / t;
        }
-       return (todo - t) / t;
 
        case 4:
+       {
+           int i;
            if (!ahi_on)
                return -2;
            i = intcount;
            intcount = 0;
-       return i;
+           return i;
+       }
 
        case 5:
            if (!ahi_on)
@@ -633,18 +551,27 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
        return 0;
 
        case 11:
+       {
+           int i;
            for (i = 0; i < clipsize; i++)
-               put_byte(m68k_areg (&context->regs, 0) + i,clipdat[i]);
+               put_byte(m68k_areg (&context->regs, 0) + i, clipdat[i]);
            CloseClipboard();
+       }
        return 0;
 
        case 12:
        {
-           uae_u8 *addr = get_real_address (m68k_areg (&context->regs, 0));
+           uae_u8 *addr = get_real_address (m68k_areg (&regs, 0));
+           static LPTSTR p;
+           int slen;
+           LPTSTR p2;
+
            if (OpenClipboard (0)) {
                EmptyClipboard();
                slen = strlen(addr);
-               p = GlobalAlloc (GMEM_DDESHARE,slen+2);
+               if (p)
+                   GlobalFree (p);
+               p = GlobalAlloc (GMEM_MOVEABLE,slen+2);
                if (p) {
                    p2 = GlobalLock (p);
                    if (p2) {
@@ -653,8 +580,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
                        GlobalUnlock (p);
                        SetClipboardData (CF_TEXT,p2);
                    }
-                   GlobalFree (p);
-               }
+                }
                CloseClipboard ();
            }
        }
@@ -689,12 +615,12 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
        {
            char *dllname;
            uae_u32 result;
-           dllname = ( char *) m68k_areg (&context->regs, 0);
+           dllname = (char *) m68k_areg (&context->regs, 0);
            dllname = (char *)get_real_address ((uae_u32)dllname);
            result=(uae_u32) LoadLibrary(dllname);
            write_log("%s windows dll/alib loaded at %d (0 mean failure)\n",dllname,result); 
            syncdivisor = (3580000.0 * CYCLE_UNIT) / (double)syncbase;
-       return result;
+           return result;
        }
 
        case 101:       //get dll label
@@ -704,7 +630,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
            m = (HMODULE) m68k_dreg (&context->regs, 1);
            funcname = (char *)m68k_areg (&context->regs, 0);
            funcname = (char *)get_real_address ((uae_u32)funcname);
-       return (uae_u32) GetProcAddress(m,funcname);
+           return (uae_u32) GetProcAddress(m,funcname);
        }
 
        case 102:       //execute native code
@@ -735,16 +661,18 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
 
        case 104:        //screenlost
        {
-           static int oldnum=0;
+           static int oldnum = 0;
            if (uaevar.changenum == oldnum)
                return 0;
-           oldnum=uaevar.changenum;
+           oldnum = uaevar.changenum;
            return 1;
        }
 
 #if defined(X86_MSVC_ASSEMBLY)
+
        case 105:   //returns memory offset
            return (uae_u32) get_real_address(0);
+
        case 106:   //byteswap 16bit vars
                    //a0 = start address
                    //d1 = number of 16bit vars
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 6c67958..60892b7
@@ -47,7 +47,7 @@ static int partcnt;
 static int first_frame = 1;
 
 static unsigned int StreamSizeAudio; // audio write position
-static double StreamSizeAudioExpected;
+static unsigned int StreamSizeAudioExpected;
 
 int avioutput_audio, avioutput_video, avioutput_enabled, avioutput_requested;
 
@@ -409,10 +409,13 @@ static int AVIOutput_AllocateVideo(void)
     return 1;
 }
 
+static int compressorallocated;
 static void AVIOutput_FreeCOMPVARS(COMPVARS *pcv)
 {
     ICClose(pcv->hic);
-    ICCompressorFree(pcv);
+    if (compressorallocated)
+       ICCompressorFree(pcv);
+    compressorallocated = FALSE;
     pcv->hic = NULL;
 }
 
@@ -513,10 +516,13 @@ int AVIOutput_ChooseVideoCodec(HWND hwnd, char *s, int len)
        int ss;
        uae_u8 *state;
 
+       compressorallocated = TRUE;
        ss = ICGetState(pcompvars->hic, NULL, 0);
        if (ss > 0) {
+           DWORD err;
            state = xmalloc (ss);
-           if (ICGetState(pcompvars->hic, state, ss) != ICERR_OK) {
+           err = ICGetState(pcompvars->hic, state, ss);
+           if (err < 0) {
                ss = 0;
                xfree(state);
            }
@@ -1115,12 +1121,13 @@ void AVIOutput_Initialize(void)
 
 #include <math.h>
 
-#define ADJUST_SIZE 50
+#define ADJUST_SIZE 100
 #define EXP 1.5
 
 void frame_drawn(void)
 {
     double diff, skipmode;
+    int idiff;
 
     if (!avioutput_video || !avioutput_enabled)
        return;
@@ -1132,16 +1139,24 @@ void frame_drawn(void)
 
     AVIOutput_WriteVideo();
 
-    if (avioutput_audio && (frame_count % avioutput_fps) == 0) {
-       StreamSizeAudioExpected += currprefs.sound_freq;
-       diff = (StreamSizeAudio - StreamSizeAudioExpected) / sndbufsize;
-       skipmode = pow (diff < 0 ? -diff : diff, EXP);
-       if (diff < 0) skipmode = -skipmode;
-       if (skipmode < -ADJUST_SIZE) skipmode = -ADJUST_SIZE;
-       if (skipmode > ADJUST_SIZE) skipmode = ADJUST_SIZE;
-       sound_setadjust (skipmode);
-       write_log("AVIOutput: diff=%.2f skip=%.2f\n", diff, skipmode);
-    }
+    if (!avioutput_audio || (frame_count % avioutput_fps))
+       return;
+
+    StreamSizeAudioExpected += currprefs.sound_freq;
+    idiff = StreamSizeAudio - StreamSizeAudioExpected;
+    diff = idiff / 100.0;
+    skipmode = pow (diff < 0 ? -diff : diff, EXP);
+    if (idiff < 0)
+       skipmode = -skipmode;
+    if (skipmode < -ADJUST_SIZE)
+       skipmode = -ADJUST_SIZE;
+    if (skipmode > ADJUST_SIZE)
+       skipmode = ADJUST_SIZE;
+
+    sound_setadjust (skipmode);
+
+    write_log("AVIOutput: diff=%.2f skip=%.2f (%d-%d=%d)\n", diff, skipmode,
+       StreamSizeAudio, StreamSizeAudioExpected, idiff);
 }
 
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 72d683c..4a0c4a1
@@ -43,13 +43,8 @@ static int hWndSelector = 0; /* Set this to zero to get hSockWnd */
 static CRITICAL_SECTION csSigQueueLock;
 
 static DWORD threadid;
-#ifdef __GNUC__
-#define THREAD(func,arg) CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)func,(LPVOID)arg,0,&threadid)
-#define THREADEND()
-#else
 #define THREAD(func,arg) (HANDLE)_beginthreadex(NULL, 0, func, arg, 0, &threadid)
 #define THREADEND(result) _endthreadex(result)
-#endif
 
 #define SETERRNO bsdsocklib_seterrno(sb, WSAGetLastError() - WSABASEERR)
 #define SETHERRNO bsdsocklib_setherrno(sb, WSAGetLastError() - WSABASEERR)
@@ -103,8 +98,8 @@ static HANDLE hSockReq, hSockReqHandled;
 static unsigned int __stdcall sock_thread(void *);
 
 static CRITICAL_SECTION SockThreadCS;
-#define PREPARE_THREAD EnterCriticalSection( &SockThreadCS )
-#define TRIGGER_THREAD { SetEvent( hSockReq ); WaitForSingleObject( hSockReqHandled, INFINITE ); LeaveCriticalSection( &SockThreadCS ); }
+#define PREPARE_THREAD EnterCriticalSection(&SockThreadCS)
+#define TRIGGER_THREAD { SetEvent(hSockReq); WaitForSingleObject(hSockReqHandled, INFINITE); LeaveCriticalSection(&SockThreadCS); }
 
 #define SOCKVER_MAJOR 2
 #define SOCKVER_MINOR 2
@@ -128,21 +123,21 @@ static void bsdsetpriority (HANDLE thread)
        SetThreadPriority(thread, pri);
 }
 
-static int mySockStartup( void )
+static int mySockStartup(void)
 {
        int result = 0;
        SOCKET dummy;
        DWORD lasterror;
 
-       if (WSAStartup(MAKEWORD( SOCKVER_MAJOR, SOCKVER_MINOR ), &wsbData)) {
+       if (WSAStartup(MAKEWORD(SOCKVER_MAJOR, SOCKVER_MINOR), &wsbData)) {
            lasterror = WSAGetLastError();
 
-           if( lasterror == WSAVERNOTSUPPORTED ) {
-                       char szMessage[ MAX_DPATH ];
-                       WIN32GUI_LoadUIString( IDS_WSOCK2NEEDED, szMessage, MAX_DPATH );
-                                       gui_message( szMessage );
+           if(lasterror == WSAVERNOTSUPPORTED) {
+                       char szMessage[MAX_DPATH];
+                       WIN32GUI_LoadUIString(IDS_WSOCK2NEEDED, szMessage, MAX_DPATH);
+                                       gui_message(szMessage);
            } else
-                       write_log( "BSDSOCK: ERROR - Unable to initialize Windows socket layer! Error code: %d\n", lasterror );
+                       write_log("BSDSOCK: ERROR - Unable to initialize Windows socket layer! Error code: %d\n", lasterror);
            return 0;
        }
 
@@ -153,15 +148,15 @@ static int mySockStartup( void )
 
                return 0;
        } else {
-               write_log( "BSDSOCK: using %s\n", wsbData.szDescription );
+               write_log("BSDSOCK: using %s\n", wsbData.szDescription);
                // make sure WSP/NSPStartup gets called from within the regular stack
                // (Windows 95/98 need this)
                if((dummy = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP)) != INVALID_SOCKET)  {
                        closesocket(dummy);
                        result = 1;
                } else {
-                       write_log( "BSDSOCK: ERROR - WSPStartup/NSPStartup failed! Error code: %d\n",
-                               WSAGetLastError() );
+                       write_log("BSDSOCK: ERROR - WSPStartup/NSPStartup failed! Error code: %d\n",
+                               WSAGetLastError());
                        result = 0;
                }
        }
@@ -175,16 +170,16 @@ int init_socket_layer(void)
 {
     int result = 0;
 
-    if(currprefs.socket_emu) {
+    if (currprefs.socket_emu) {
                if((result = mySockStartup())) {
                        InitializeCriticalSection(&csSigQueueLock);
 
                        if(hSockThread == NULL) {
                                WNDCLASS wc;    // Set up an invisible window and dummy wndproc
                                
-                               InitializeCriticalSection( &SockThreadCS );
-                               hSockReq = CreateEvent( NULL, FALSE, FALSE, NULL );
-                               hSockReqHandled = CreateEvent( NULL, FALSE, FALSE, NULL );
+                               InitializeCriticalSection(&SockThreadCS);
+                               hSockReq = CreateEvent(NULL, FALSE, FALSE, NULL);
+                               hSockReqHandled = CreateEvent(NULL, FALSE, FALSE, NULL);
 
                                wc.style = CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW;
                                wc.lpfnWndProc = SocketWindowProc;
@@ -197,7 +192,7 @@ int init_socket_layer(void)
                                wc.lpszMenuName = 0;
                                wc.lpszClassName = "SocketFun";
                                if(RegisterClass(&wc)) {
-                                       hSockWnd = CreateWindowEx ( 0,
+                                       hSockWnd = CreateWindowEx (0,
                                                "SocketFun", "WinUAE Socket Window",
                                                WS_POPUP,
                                                0, 0,
@@ -216,7 +211,7 @@ int init_socket_layer(void)
 void deinit_socket_layer(void)
 {
        int i;
-       if(currprefs.socket_emu) {
+       if (currprefs.socket_emu) {
                WSACleanup();
                if(socket_layer_initialized) {
                        DeleteCriticalSection(&csSigQueueLock);
@@ -288,8 +283,7 @@ void host_closesocketquick(SOCKET s)
 {
        BOOL true = 1;
 
-       if( s )
-       {
+       if(s) {
            setsockopt(s,SOL_SOCKET,SO_DONTLINGER,(char *)&true,sizeof(true));
            shutdown(s,1);
            closesocket(s);
@@ -304,11 +298,10 @@ void host_sbcleanup(SB)
 
        if (sb->hEvent != NULL) CloseHandle(sb->hEvent);
        
-       for (i = sb->dtablesize; i--; )
-       {
+       for (i = sb->dtablesize; i--; ) {
                if (sb->dtable[i] != INVALID_SOCKET) host_closesocketquick(sb->dtable[i]);
                
-               if (sb->mtable[i]) asyncsb[(sb->mtable[i]-0xb000)/2] = NULL;
+               if (sb->mtable[i]) asyncsb[(sb->mtable[i] - 0xb000) / 2] = NULL;
        }
 
        shutdown(sb->sockAbort,1);
@@ -319,10 +312,10 @@ void host_sbcleanup(SB)
 
 void host_sbreset(void)
 {
-       memset(asyncsb,0,sizeof asyncsb);
-       memset(asyncsock,0,sizeof asyncsock);
-       memset(asyncsd,0,sizeof asyncsd);
-       memset(threadargsw,0,sizeof threadargsw);
+       memset(asyncsb, 0, sizeof asyncsb);
+       memset(asyncsock, 0, sizeof asyncsock);
+       memset(asyncsd, 0, sizeof asyncsd);
+       memset(threadargsw, 0, sizeof threadargsw);
 }
 
 void sockmsg(unsigned int msg, WPARAM wParam, LPARAM lParam)
@@ -340,11 +333,11 @@ void sockmsg(unsigned int msg, WPARAM wParam, LPARAM lParam)
                if ((SOCKET)wParam != asyncsock[index])
                {
                        // cancel socket event
-                       WSAAsyncSelect((SOCKET)wParam,hWndSelector ? hAmigaWnd : hSockWnd,0,0);
+                       WSAAsyncSelect((SOCKET)wParam, hWndSelector ? hAmigaWnd : hSockWnd, 0, 0);
                        return;
                }
 
-               sdi = asyncsd[index]-1;
+               sdi = asyncsd[index] - 1;
 
                // asynchronous socket event?
                if (sb && !(sb->ftable[sdi] & SF_BLOCKINGINPROGRESS) && sb->mtable[sdi])
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index f1f45c3..9859fda
                                RelativePath="..\..\build68k.c"
                                >
                        </File>
-                       <File
-                               RelativePath=".\build68k.rc"
-                               >
-                       </File>
                </Filter>
-               <File
-                       RelativePath=".\resource.h"
-                       >
-               </File>
        </Files>
        <Globals>
        </Globals>
diff --git a/od-win32/build68k_msvc/resource.h b/od-win32/build68k_msvc/resource.h
deleted file mode 100755 (executable)
index 0a253e1..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by build68k.rc
-
-// Next default values for new objects
-// 
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        101
-#define _APS_NEXT_COMMAND_VALUE         40001
-#define _APS_NEXT_CONTROL_VALUE         1001
-#define _APS_NEXT_SYMED_VALUE           101
-#endif
-#endif
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 77022be..295f818
@@ -233,6 +233,15 @@ static int initialize_catweasel(void)
 #define RDP_MOUSE1 "\\??\\Root#RDP_MOU#"
 #define RDP_MOUSE2 "\\\\?\\Root#RDP_MOU#"
 
+static int rdpmouse(char *buf)
+{
+    if (!memcmp (RDP_MOUSE1, buf, strlen (RDP_MOUSE1)))
+        return 1;
+    if (!memcmp (RDP_MOUSE2, buf, strlen (RDP_MOUSE2)))
+        return 1;
+    return 0;
+}
+
 static int initialize_rawinput (void)
 {
     RAWINPUTDEVICELIST *ridl = 0;
@@ -263,9 +272,10 @@ static int initialize_rawinput (void)
 
     ridl = malloc (sizeof(RAWINPUTDEVICELIST) * num);
     memset (ridl, 0, sizeof (RAWINPUTDEVICELIST) * num);
-    bufsize = 1000;
+    bufsize = 10000;
     buf = malloc (bufsize);
 
+    register_rawinput();
     gotnum = pGetRawInputDeviceList(ridl, &num, sizeof (RAWINPUTDEVICELIST));
     if (gotnum <= 0) {
        write_log ("RAWINPUT didn't find any devices\n");
@@ -276,12 +286,14 @@ static int initialize_rawinput (void)
     for (i = 0; i < gotnum; i++) {
        int type = ridl[i].dwType;
        HANDLE h = ridl[i].hDevice;
-       vtmp = bufsize;
-       pGetRawInputDeviceInfo (h, RIDI_DEVICENAME, buf, &vtmp);
 
-       if (!memcmp (RDP_MOUSE1, buf, strlen (RDP_MOUSE1)))
+       if (pGetRawInputDeviceInfo (h, RIDI_DEVICENAME, NULL, &vtmp) == 1)
+           continue;
+       if (vtmp >= bufsize)
+           continue;
+       if (pGetRawInputDeviceInfo (h, RIDI_DEVICENAME, buf, &vtmp) == -1)
            continue;
-       if (!memcmp (RDP_MOUSE2, buf, strlen (RDP_MOUSE2)))
+       if (rdpmouse(buf))
            continue;
        if (type == RIM_TYPEMOUSE)
            rnum_mouse++;
@@ -298,15 +310,17 @@ static int initialize_rawinput (void)
            PRID_DEVICE_INFO rdi;
            int v, j;
 
-           vtmp = bufsize;
-           pGetRawInputDeviceInfo (h, RIDI_DEVICENAME, buf, &vtmp);
+           if (pGetRawInputDeviceInfo (h, RIDI_DEVICENAME, NULL, &vtmp) == -1)
+               continue;
+           if (vtmp >= bufsize)
+               continue;
+           if (pGetRawInputDeviceInfo (h, RIDI_DEVICENAME, buf, &vtmp) == -1)
+               continue;
 
            if (did == di_mouse) {
-               if (!memcmp (RDP_MOUSE1, buf, strlen (RDP_MOUSE1)))
+               if (rdpmouse(buf))
                    continue;
-               if (!memcmp (RDP_MOUSE2, buf, strlen (RDP_MOUSE2)))
-                   continue;
-               if (rnum_mouse < 2)
+               if (rnum_mouse < 2 && !os_vista)
                    continue;
                if (num_mouse >= MAX_INPUT_DEVICES - 1) /* leave space for Windows mouse */
                    continue;
@@ -335,14 +349,18 @@ static int initialize_rawinput (void)
            write_log ("%p %s: ", h, type == RIM_TYPEMOUSE ? "mouse" : "keyboard");
            did->sortname = my_strdup (buf);
            write_log ("'%s'\n", buf);
-           vtmp = bufsize;
            rdi = (PRID_DEVICE_INFO)buf;
            rdi->cbSize = sizeof (RID_DEVICE_INFO);
-           pGetRawInputDeviceInfo (h, RIDI_DEVICEINFO, buf, &vtmp);
+           if (pGetRawInputDeviceInfo (h, RIDI_DEVICEINFO, NULL, &vtmp) == -1)
+               continue;
+           if (vtmp >= bufsize)
+               continue;
+           if (pGetRawInputDeviceInfo (h, RIDI_DEVICEINFO, buf, &vtmp) == -1)
+               continue;
            if (type == RIM_TYPEMOUSE) {
                PRID_DEVICE_INFO_MOUSE rdim = &rdi->mouse;
-               write_log ("id=%d buttons=%d rate=%d", 
-                   rdim->dwId, rdim->dwNumberOfButtons, rdim->dwSampleRate);
+               write_log ("id=%d buttons=%d hw=%d rate=%d\n", 
+                   rdim->dwId, rdim->dwNumberOfButtons, rdim->fHasHorizontalWheel, rdim->dwSampleRate);
                did->buttons = rdim->dwNumberOfButtons;
                did->axles = 3;
                did->axistype[0] = 1;
@@ -354,6 +372,12 @@ static int initialize_rawinput (void)
                did->axistype[2] = 1;
                did->axissort[2] = 2;
                did->axisname[2] = my_strdup ("Wheel");
+               if (rdim->fHasHorizontalWheel) {
+                   did->axistype[3] = 1;
+                   did->axissort[3] = 3;
+                   did->axisname[3] = my_strdup ("HWheel");
+                   did->axles++;
+               }
                for (j = 0; j < did->buttons; j++) {
                    did->buttonsort[j] = j;
                    sprintf (tmp, "Button %d", j + 1);
@@ -366,7 +390,6 @@ static int initialize_rawinput (void)
                    rdik->dwType, rdik->dwSubType, rdik->dwKeyboardMode,
                    rdik->dwNumberOfFunctionKeys, rdik->dwNumberOfIndicators, rdik->dwNumberOfKeysTotal);
            }
-           write_log("\n");
        }
     }
 
@@ -406,7 +429,7 @@ static void initialize_windowsmouse (void)
            did->buttons = 5; /* no non-direcinput support for >5 buttons */
        if (did->buttons > 3 && !os_winnt)
            did->buttons = 3; /* Windows 98/ME support max 3 non-DI buttons */
-       did->axles = 3;
+       did->axles = os_vista ? 4 : 3;
        did->axistype[0] = 1;
        did->axissort[0] = 0;
        did->axisname[0] = my_strdup ("X-Axis");
@@ -418,6 +441,11 @@ static void initialize_windowsmouse (void)
            did->axissort[2] = 2;
            did->axisname[2] = my_strdup ("Wheel");
        }
+       if (did->axles > 3) {
+           did->axistype[3] = 1;
+           did->axissort[3] = 3;
+           did->axisname[3] = my_strdup ("HWheel");
+       }
        for (j = 0; j < did->buttons; j++) {
            did->buttonsort[j] = j;
            sprintf (tmp, "Button %d", j + 1);
@@ -598,6 +626,17 @@ static void sortdd (struct didata *dd, int num, int type)
 
 }
 
+static void fixbuttons (struct didata *did)
+{
+    if (did->buttons > 0)
+       return;
+    write_log("'%s' has no buttons, adding single default button\n", did->name);
+    did->buttonmappings[0] = DIJOFS_BUTTON(0);
+    did->buttonsort[0] = 0;
+    did->buttonname[0] = my_strdup("Button");
+    did->buttons++;
+}
+
 static void sortobjects (struct didata *did, int *mappings, int *sort, char **names, int *types, int num)
 {
     int i, j, tmpi;
@@ -698,6 +737,7 @@ static BOOL CALLBACK EnumObjectsCallback (const DIDEVICEOBJECTINSTANCE* pdidoi,
        }
        did->axles += 2;
     }
+
     if (pdidoi->dwType & DIDFT_BUTTON) {
        if (did->buttons >= MAX_MAPPINGS)
            return DIENUM_CONTINUE;
@@ -713,6 +753,7 @@ static BOOL CALLBACK EnumObjectsCallback (const DIDEVICEOBJECTINSTANCE* pdidoi,
        }
        did->buttons++;
     }
+
     return DIENUM_CONTINUE;
 }
 
@@ -918,6 +959,7 @@ static int init_mouse (void)
            if (hr == DI_OK) {
                hr = IDirectInputDevice8_SetDataFormat(lpdi, &c_dfDIMouse); 
                IDirectInputDevice8_EnumObjects (lpdi, EnumObjectsCallback, (void*)did, DIDFT_ALL);
+               fixbuttons (did);
                sortobjects (did, did->axismappings, did->axissort, did->axisname, did->axistype, did->axles);
                sortobjects (did, did->buttonmappings, did->buttonsort, did->buttonname, 0, did->buttons);
                did->lpdi = lpdi;
@@ -1015,14 +1057,15 @@ static void read_mouse (void)
            continue;
        if (did->connection == DIDC_CAT) {
            int cx, cy, cbuttons;
-           catweasel_read_mouse(did->catweasel, &cx, &cy, &cbuttons);
-           if (cx)
-               setmousestate(i, 0, cx, 0);
-           if (cy)
-               setmousestate(i, 1, cy, 0);
-           setmousebuttonstate(i, 0, cbuttons & 8);
-           setmousebuttonstate(i, 1, cbuttons & 4);
-           setmousebuttonstate(i, 2, cbuttons & 2);
+           if (catweasel_read_mouse(did->catweasel, &cx, &cy, &cbuttons)) {
+               if (cx)
+                   setmousestate(i, 0, cx, 0);
+               if (cy)
+                   setmousestate(i, 1, cy, 0);
+               setmousebuttonstate(i, 0, cbuttons & 8);
+               setmousebuttonstate(i, 1, cbuttons & 4);
+               setmousebuttonstate(i, 2, cbuttons & 2);
+           }
            continue;
        }
        if (!lpdi || did->connection != DIDC_DX)
@@ -1145,9 +1188,12 @@ static uae_u32 get_leds (void)
            &InputBuffer, DataLength, &OutputBuffer, DataLength, &ReturnedLength, NULL))
            return 0;
        led = 0;
-       if (OutputBuffer.LedFlags & KEYBOARD_NUM_LOCK_ON) led |= KBLED_NUMLOCK;
-       if (OutputBuffer.LedFlags & KEYBOARD_CAPS_LOCK_ON) led |= KBLED_CAPSLOCK;
-       if (OutputBuffer.LedFlags & KEYBOARD_SCROLL_LOCK_ON) led |= KBLED_SCROLLLOCK;
+       if (OutputBuffer.LedFlags & KEYBOARD_NUM_LOCK_ON)
+           led |= KBLED_NUMLOCK;
+       if (OutputBuffer.LedFlags & KEYBOARD_CAPS_LOCK_ON)
+           led |= KBLED_CAPSLOCK;
+       if (OutputBuffer.LedFlags & KEYBOARD_SCROLL_LOCK_ON) led
+           |= KBLED_SCROLLLOCK;
 #endif
     }
     return led;
@@ -1662,14 +1708,15 @@ static void read_joystick (void)
            continue;
        if (did->connection == DIDC_CAT) {
            uae_u8 cdir, cbuttons;
-           catweasel_read_joystick(&cdir, &cbuttons);
-           cdir >>= did->catweasel * 4;
-           cbuttons >>= did->catweasel * 4;
-           setjoystickstate(i, 0, !(cdir & 1) ? 1 : !(cdir & 2) ? -1 : 0, 0);
-           setjoystickstate(i, 1, !(cdir & 4) ? 1 : !(cdir & 8) ? -1 : 0, 0);
-           setjoybuttonstate(i, 0, cbuttons & 8);
-           setjoybuttonstate(i, 1, cbuttons & 4);
-           setjoybuttonstate(i, 2, cbuttons & 2);
+           if (catweasel_read_joystick(&cdir, &cbuttons)) {
+               cdir >>= did->catweasel * 4;
+               cbuttons >>= did->catweasel * 4;
+               setjoystickstate(i, 0, !(cdir & 1) ? 1 : !(cdir & 2) ? -1 : 0, 0);
+               setjoystickstate(i, 1, !(cdir & 4) ? 1 : !(cdir & 8) ? -1 : 0, 0);
+               setjoybuttonstate(i, 0, cbuttons & 8);
+               setjoybuttonstate(i, 1, cbuttons & 4);
+               setjoybuttonstate(i, 2, cbuttons & 2);
+           }
            continue;
        }
        lpdi = did->lpdi;
@@ -1743,6 +1790,7 @@ static int init_joystick (void)
                if (hr == DI_OK) {
                    did->lpdi = lpdi;
                    IDirectInputDevice8_EnumObjects (lpdi, EnumObjectsCallback, (void*)did, DIDFT_ALL);
+                   fixbuttons (did);
                    sortobjects (did, did->axismappings, did->axissort, did->axisname, did->axistype, did->axles);
                    sortobjects (did, did->buttonmappings, did->buttonsort, did->buttonname, 0, did->buttons);
                }
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index d4cd2bb..fe2aaa6
@@ -118,17 +118,23 @@ static ULONG getmfmlong (UWORD * mbuf)
 
 static int drive_write_adf_amigados (UWORD *mbuf, UWORD *mend, UBYTE *writebuffer, UBYTE *writebuffer_ok, int track)
 {
-       int i, secwritten = 0;
+       int i;
        ULONG odd, even, chksum, id, dlong;
        UBYTE *secdata;
        UBYTE secbuf[544];
-       char sectable[11];
 
-       memset (sectable, 0, sizeof (sectable));
        mend -= (4 + 16 + 8 + 512);
-       while (secwritten < 11) {
+       for (;;) {
                int trackoffs;
 
+       /* all sectors complete? */
+               for (i = 0; i < 11; i++) {
+                       if (!writebuffer_ok[i])
+                               break;
+               }
+               if (i == 11)
+                       return 0;
+
                do {
                        while (*mbuf++ != 0x4489) {
                                if (mbuf >= mend) {
@@ -148,6 +154,10 @@ static int drive_write_adf_amigados (UWORD *mbuf, UWORD *mend, UBYTE *writebuffe
                        printf("* corrupt sector number %d\n", trackoffs);
                        goto next;
                }
+               /* this sector is already ok? */
+               if (writebuffer_ok[trackoffs])
+                       goto next;
+
                chksum = odd ^ even;
                for (i = 0; i < 4; i++) {
                        odd = getmfmlong (mbuf);
@@ -187,16 +197,12 @@ static int drive_write_adf_amigados (UWORD *mbuf, UWORD *mend, UBYTE *writebuffe
                        printf("* sector %d data crc error\n", trackoffs);
                        goto next;
                }
-               sectable[trackoffs] = 1;
-               secwritten++;
                memcpy (writebuffer + trackoffs * 512, secbuf + 32, 512);
-               writebuffer_ok[trackoffs] = 1;
+               writebuffer_ok[trackoffs] = 0xff;
                continue;
 next:
                mbuf += 8;
        }
-    if (secwritten == 0 || secwritten < 0) return 5;
-       return 0;
 }
 
 /* search and align to 0x4489 WORDSYNC markers */
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 4eb6181..6c21df4
 #define TRACK_SIZE 16384
 #define MAX_RETRIES 50
 
-static UBYTE writebuffer[11 * 512];
-static UBYTE writebuffer_ok[11];
+#define SECTORS 11
+#define CYLINDERS 80
+#define TRACKS (CYLINDERS * 2)
+#define BLOCKSIZE 512
+
+static UBYTE writebuffer[SECTORS * BLOCKSIZE];
 
 static BYTE *trackbuffer;
 static HANDLE h = INVALID_HANDLE_VALUE;
-static FILE *fout;
 
 static int checkversion(void)
 {
@@ -122,46 +125,104 @@ static void readloop(char *fname)
        int trk, i, j, sec;
        int errsec, oktrk, retr;
        time_t t = time(0);
+       static FILE *fout, *ferr;
+       char *fnameerr;
+       UBYTE writebuffer_ok[SECTORS];
+       int fromscratch = 0;
+
+       memset (writebuffer, 0, sizeof writebuffer);
+       fout = fopen(fname,"r+b");
+       if (!fout) {
+               if (!(fout = fopen(fname, "w+b"))) {
+                       printf("Failed to create '%s'\n", fname);
+                       return;
+               }
+               /* pre-create the image */
+               for (i = 0; i < (sizeof writebuffer) / 8; i++)
+                       memcpy (writebuffer + i * 8, "*NULADF*", 8);
+               for (i = 0; i < TRACKS; i++)
+                       fwrite(writebuffer, SECTORS * BLOCKSIZE, 1, fout);
+               fromscratch = 1;
+       }
 
-       if (!(fout = fopen(fname, "wb"))) {
-               printf("Failed to open '%s'\n", fname);
-               return;
+       /* create error status file */
+       memset (writebuffer, 0, sizeof writebuffer);
+       fnameerr = malloc (strlen (fname) + 10);
+       sprintf (fnameerr, "%s.status", fname);
+       ferr = fopen(fnameerr, "r+b");
+       if (!ferr) {
+               ferr = fopen(fnameerr, "w+b");
+               fromscratch = 1;
        }
+       if (ferr && fromscratch)
+               fwrite(writebuffer, SECTORS * TRACKS, 1, ferr);
+
        errsec = oktrk = retr = 0;
-       for (trk = 0; trk < 2 * 80; trk++) {
+       for (trk = 0; trk < TRACKS; trk++) {
+
                printf ("Track %d: processing started..\n", trk);
                memset (writebuffer_ok, 0, sizeof writebuffer_ok);
-               memset (writebuffer, 0, sizeof writebuffer);
-               sec = 0;
-               for (j = 0; j < MAX_RETRIES; j++) {
+               /* fill decoded trackbuffer with easily detectable error code */
+               for (i = 0; i < (sizeof writebuffer) / 8; i++)
+                       memcpy (writebuffer + i * 8, "*ERRADF*", 8);
+
+               /* read possible old track */
+               if (ferr) {
+                       if (!fseek(ferr, trk * SECTORS, SEEK_SET))
+                               fread (writebuffer_ok, SECTORS, 1, ferr);
+                       if (!fseek(fout, SECTORS * BLOCKSIZE * trk, SEEK_SET))
+                               fread (writebuffer, SECTORS * BLOCKSIZE, 1, fout);
+               }
+
+               j = 0;
+               for (;;) {
+                       /* all sectors ok? */
+                       sec = 0;
+                       for (i = 0; i < SECTORS; i++) {
+                               if (writebuffer_ok[i])
+                                       sec++;
+                       }
+                       if (sec == SECTORS || j >= MAX_RETRIES)
+                               break;
+
                        if (j > 0)
-                               printf("Retrying.. (%d of max %d), %d/%d sectors ok\n", j, MAX_RETRIES - 1, sec, 11);
+                               printf("Retrying.. (%d of max %d), %d/%d sectors ok\n", j, MAX_RETRIES - 1, sec, SECTORS);
+                       /* read raw track */
                        if (!readraw(trk / 2, trk % 2)) {
                                printf("Raw read error, possible reasons:\nMissing second drive or your hardware only supports single drive.\nOperation aborted.\n");
                                return;
                        }
+                       /* decode track (ignores already ok sectors) */
                        isamigatrack(trackbuffer, TRACK_SIZE, writebuffer, writebuffer_ok, trk);
-                       sec = 0;
-                       for (i = 0; i < 11; i++) {
-                               if (writebuffer_ok[i])
-                                       sec++;
-                       }
-                       if (sec == 11)
-                               break;
                        retr++;
                        if ((retr % 10) == 0)
                                seek(trk == 0 ? 2 : 0, 0);
+                       j++;
                }
-               errsec += 11 - sec;
+               errsec += SECTORS - sec;
                if (j == MAX_RETRIES) {
-                       printf("Track %d: read error or non-AmigaDOS formatted track (%d/%d sectors ok)\n", trk, sec, 11);
+                       printf("Track %d: read error or non-AmigaDOS formatted track (%d/%d sectors ok)\n", trk, sec, SECTORS);
                } else {
                        oktrk++;
                        printf("Track %d: all sectors ok (%d retries)\n", trk, j);
                }
-               fwrite(writebuffer, 11 * 512, 1, fout);
+               /* write decoded track */
+               fseek(fout, SECTORS * BLOCKSIZE * trk, SEEK_SET);
+               fwrite(writebuffer, SECTORS * BLOCKSIZE, 1, fout);
+               /* write sector status */
+               if (ferr) {
+                       fseek(ferr, trk * SECTORS, SEEK_SET);
+                       fwrite (writebuffer_ok, SECTORS, 1, ferr);
+               };
+
        }
        fclose(fout);
+       if (ferr) {
+               fclose(ferr);
+               if (oktrk >= TRACKS)
+                       unlink(fnameerr);
+       }
+       free(fnameerr);
        t = time(0) - t;
        printf ("Completed. %02.2dm%02.2ds, %d/160 tracks read without errors, %d retries, %d faulty sectors\n",
                t / 60, t % 60, oktrk, retr, errsec);
old mode 100755 (executable)
new mode 100644 (file)
index 5250027..988ccbd
@@ -307,7 +307,7 @@ static int needs_fsdb (a_inode *aino)
     if (aino->deleted)
        return 0;
 
-    if (!fsdb_mode_representable_p (aino) || aino->comment != 0)
+    if (!fsdb_mode_representable_p (aino, aino->amigaos_mode) || aino->comment != 0)
        return 1;
 
     nn_begin = nname_begin (aino->nname);
@@ -327,9 +327,7 @@ int fsdb_set_file_attrs (a_inode *aino)
        return ERROR_OBJECT_NOT_AROUND;
     mode &= FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
 
-    /* Unix dirs behave differently than AmigaOS ones.  */
-    /* windows dirs go where no dir has gone before...  */
-    if (! aino->dir) {
+    if (1 || ! aino->dir) {
        mode = 0;
        if ((tmpmask & (A_FIBF_WRITE | A_FIBF_DELETE)) == 0)
            mode |= FILE_ATTRIBUTE_READONLY;
@@ -358,30 +356,40 @@ int fsdb_set_file_attrs (a_inode *aino)
 int fsdb_mode_supported (const a_inode *aino)
 {
     int mask = aino->amigaos_mode;
-    if (fsdb_mode_representable_p (aino))
+    if (0 && aino->dir)
+       return 0;
+    if (fsdb_mode_representable_p (aino, mask))
+        return mask;
+    mask &= ~(A_FIBF_SCRIPT | A_FIBF_READ | A_FIBF_EXECUTE);
+    if (fsdb_mode_representable_p (aino, mask))
+        return mask;
+    mask &= ~A_FIBF_WRITE;
+    if (fsdb_mode_representable_p (aino, mask))
         return mask;
-    mask &= ~(A_FIBF_SCRIPT | A_FIBF_DELETE | A_FIBF_WRITE);
-    return mask;
+    mask &= ~A_FIBF_DELETE;
+    if (fsdb_mode_representable_p (aino, mask))
+        return mask;
+    return 0;
 }
 
 /* Return nonzero if we can represent the amigaos_mode of AINO within the
  * native FS.  Return zero if that is not possible.  */
-int fsdb_mode_representable_p (const a_inode *aino)
+int fsdb_mode_representable_p (const a_inode *aino, int amigaos_mode)
 {
-    int mask = aino->amigaos_mode ^ 15;
+    int mask = amigaos_mode ^ 15;
 
-    if (aino->dir)
-       return aino->amigaos_mode == 0;
+    if (0 && aino->dir)
+       return amigaos_mode == 0;
 
-    if (mask == 15) /* ---RWED == OK */
+    if (mask & A_FIBF_SCRIPT) /* script */
+       return 0;
+    if ((mask & 15) == 15) /* xxxxRWED == OK */
        return 1;
     if (!(mask & A_FIBF_EXECUTE)) /* not executable */
        return 0;
     if (!(mask & A_FIBF_READ)) /* not readable */
        return 0;
-    if (mask & A_FIBF_SCRIPT) /* script */
-       return 0;
-    if ((mask & 15) == (A_FIBF_READ | A_FIBF_EXECUTE)) /* ----R-E- == ReadOnly */
+    if ((mask & 15) == (A_FIBF_READ | A_FIBF_EXECUTE)) /* ----RxEx == ReadOnly */
        return 1;
     return 0;
 }
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 978f0a5..b9395e0
@@ -18,7 +18,6 @@
                        OutputDirectory=".\Release"
                        IntermediateDirectory=".\Release"
                        ConfigurationType="1"
-                       InheritedPropertySheets="..\..\..\..\..\msvs2005\VC\VCProjectDefaults\UpgradeFromVC71.vsprops"
                        UseOfMFC="0"
                        ATLMinimizesCRunTimeLibraryUsage="false"
                        CharacterSet="2"
                        OutputDirectory=".\Debug"
                        IntermediateDirectory=".\Debug"
                        ConfigurationType="1"
-                       InheritedPropertySheets="..\..\..\..\..\msvs2005\VC\VCProjectDefaults\UpgradeFromVC71.vsprops"
                        UseOfMFC="0"
                        ATLMinimizesCRunTimeLibraryUsage="false"
                        CharacterSet="2"
                        OutputDirectory="$(ConfigurationName)"
                        IntermediateDirectory="$(ConfigurationName)"
                        ConfigurationType="1"
-                       InheritedPropertySheets="..\..\..\..\..\msvs2005\VC\VCProjectDefaults\UpgradeFromVC71.vsprops"
                        UseOfMFC="0"
                        ATLMinimizesCRunTimeLibraryUsage="false"
                        CharacterSet="2"
old mode 100755 (executable)
new mode 100644 (file)
index 39b99f4..1c26a0b
@@ -18,7 +18,6 @@
                        OutputDirectory=".\Debug"
                        IntermediateDirectory=".\Debug"
                        ConfigurationType="1"
-                       InheritedPropertySheets="..\..\..\..\..\msvs2005\VC\VCProjectDefaults\UpgradeFromVC71.vsprops"
                        UseOfMFC="0"
                        ATLMinimizesCRunTimeLibraryUsage="false"
                        CharacterSet="2"
                        OutputDirectory=".\Release"
                        IntermediateDirectory=".\Release"
                        ConfigurationType="1"
-                       InheritedPropertySheets="..\..\..\..\..\msvs2005\VC\VCProjectDefaults\UpgradeFromVC71.vsprops"
                        UseOfMFC="0"
                        ATLMinimizesCRunTimeLibraryUsage="false"
                        CharacterSet="2"
                        OutputDirectory="$(ConfigurationName)"
                        IntermediateDirectory="$(ConfigurationName)"
                        ConfigurationType="1"
-                       InheritedPropertySheets="..\..\..\..\..\msvs2005\VC\VCProjectDefaults\UpgradeFromVC71.vsprops"
                        UseOfMFC="0"
                        ATLMinimizesCRunTimeLibraryUsage="false"
                        CharacterSet="2"
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index ba4b79b..0a52656
@@ -162,6 +162,7 @@ int hdf_open (struct hardfiledata *hfd, char *name)
        hdf_init ();
        i = isharddrive (name);
        if (i >= 0) {
+           DWORD r;
            udi = &uae_drives[i];
            hfd->flags = 1;
            flags =  FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS;
@@ -171,6 +172,8 @@ int hdf_open (struct hardfiledata *hfd, char *name)
                hdf_close (hfd);
                return 0;
            }
+           if (!DeviceIoControl(h, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, &r, NULL))
+               write_log("FSCTL_ALLOW_EXTENDED_DASD_IO returned %d\n", GetLastError());
            strncpy (hfd->vendor_id, udi->vendor_id, 8);
            strncpy (hfd->product_id, udi->product_id, 16);
            strncpy (hfd->product_rev, udi->product_rev, 4);
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 4d74777..3367daf
@@ -310,6 +310,9 @@ void my_kbd_handler (int keyboard, int scancode, int newstate)
     int code = 0;
     static int swapperdrive = 0;
 
+    if (scancode == specialkeycode())
+       return;
+
     //write_log( "keyboard = %d scancode = 0x%02.2x state = %d\n", keyboard, scancode, newstate ); 
     if (newstate) {
        switch (scancode)
@@ -453,8 +456,6 @@ void my_kbd_handler (int keyboard, int scancode, int newstate)
        return;
     }
 
-    if (scancode == specialkeycode())
-       return;
     if (specialpressed())
        return;
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index a7e52bd..7839de7
@@ -42,11 +42,11 @@ struct flag_struct {
 #define FLAGVAL_V      (1 << FLAGBIT_V)
 #define FLAGVAL_X      (1 << FLAGBIT_X)
 
-#define SET_ZFLG(flags, y)     ((flags)->cznv = ((flags)->cznv & ~FLAGVAL_Z) | (((y) & 1) << FLAGBIT_Z))
-#define SET_CFLG(flags, y)     ((flags)->cznv = ((flags)->cznv & ~FLAGVAL_C) | (((y) & 1) << FLAGBIT_C))
-#define SET_VFLG(flags, y)     ((flags)->cznv = ((flags)->cznv & ~FLAGVAL_V) | (((y) & 1) << FLAGBIT_V))
-#define SET_NFLG(flags, y)     ((flags)->cznv = ((flags)->cznv & ~FLAGVAL_N) | (((y) & 1) << FLAGBIT_N))
-#define SET_XFLG(flags, y)     ((flags)->x    = (y) << FLAGBIT_X)
+#define SET_ZFLG(flags, y)     ((flags)->cznv = ((flags)->cznv & ~FLAGVAL_Z) | (((y) ? 1 : 0) << FLAGBIT_Z))
+#define SET_CFLG(flags, y)     ((flags)->cznv = ((flags)->cznv & ~FLAGVAL_C) | (((y) ? 1 : 0) << FLAGBIT_C))
+#define SET_VFLG(flags, y)     ((flags)->cznv = ((flags)->cznv & ~FLAGVAL_V) | (((y) ? 1 : 0) << FLAGBIT_V))
+#define SET_NFLG(flags, y)     ((flags)->cznv = ((flags)->cznv & ~FLAGVAL_N) | (((y) ? 1 : 0) << FLAGBIT_N))
+#define SET_XFLG(flags, y)     ((flags)->x    = ((y) ? 1 : 0) << FLAGBIT_X)
 
 #define GET_ZFLG(flags)                (((flags)->cznv >> FLAGBIT_Z) & 1)
 #define GET_CFLG(flags)                (((flags)->cznv >> FLAGBIT_C) & 1)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 8a2c602..1eaad80
@@ -56,10 +56,23 @@ void init_shm(void)
 
     memstats.dwLength = sizeof(memstats);
     GlobalMemoryStatus(&memstats);
-
     totalphys64 = memstats.dwTotalPhys;
-    size64 = 16 * 1024 * 1024;
     total64 = (uae_u64)memstats.dwAvailPageFile + (uae_u64)memstats.dwAvailPhys;
+    if (os_winnt) {
+       typedef BOOL (CALLBACK* GLOBALMEMORYSTATUSEX)(LPMEMORYSTATUSEX);
+       GLOBALMEMORYSTATUSEX pGlobalMemoryStatusEx;
+       MEMORYSTATUSEX memstatsex;
+       pGlobalMemoryStatusEx = (GLOBALMEMORYSTATUSEX)GetProcAddress(GetModuleHandle("kernel32.dll"), "GlobalMemoryStatusEx");
+       if (pGlobalMemoryStatusEx) {
+           memstatsex.dwLength = sizeof (MEMORYSTATUSEX);
+           if (pGlobalMemoryStatusEx(&memstatsex)) {
+               totalphys64 = memstatsex.ullTotalPhys;
+               total64 = memstatsex.ullAvailPageFile + memstatsex.ullAvailPhys;
+           }
+       }
+    }
+
+    size64 = 16 * 1024 * 1024;
     while (total64 >= (size64 << 1)
        && size64 != ((uae_u64)2048) * 1024 * 1024)
            size64 <<= 1;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 73088d4..302e7f3
@@ -3784,7 +3784,8 @@ static uae_u8 *REGPARAM2 gfxmem_xlate (uaecptr addr)
 addrbank gfxmem_bank = {
     gfxmem_lget, gfxmem_wget, gfxmem_bget,
     gfxmem_lput, gfxmem_wput, gfxmem_bput,
-    gfxmem_xlate, gfxmem_check, NULL
+    gfxmem_xlate, gfxmem_check, NULL, "RTG RAM",
+    dummy_lgeti, dummy_wgeti, ABFLAG_RAM
 };
 
 /* Call this function first, near the beginning of code flow
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 1c0997a..4e04fba
@@ -535,8 +535,8 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD
 FONT 8, "MS Sans Serif", 0, 0, 0x1
 BEGIN
     COMBOBOX        IDC_INPUTTYPE,5,5,98,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_INPUTDEVICE,109,4,167,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    CONTROL         "",IDC_INPUTDEVICEDISABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,282,7,9,8
+    COMBOBOX        IDC_INPUTDEVICE,109,5,167,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    CONTROL         "",IDC_INPUTDEVICEDISABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,282,8,9,8
     CONTROL         "List1",IDC_INPUTLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,22,290,146
     COMBOBOX        IDC_INPUTAMIGACNT,5,174,24,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
     COMBOBOX        IDC_INPUTAMIGA,33,174,262,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
@@ -765,7 +765,7 @@ BEGIN
 
     IDD_INPUT, DIALOG
     BEGIN
-        BOTTOMMARGIN, 187
+        BOTTOMMARGIN, 240
     END
 
     IDD_QUICKSTART, DIALOG
@@ -838,8 +838,8 @@ IDI_PATHS               ICON                    "paths.ico"
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,3,3,0
- PRODUCTVERSION 1,3,3,0
+ FILEVERSION 1,3,4,0
+ PRODUCTVERSION 1,3,4,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -855,12 +855,12 @@ BEGIN
         BLOCK "040904b0"
         BEGIN
             VALUE "FileDescription", "WinUAE"
-            VALUE "FileVersion", "1.3.3"
+            VALUE "FileVersion", "1.3.4"
             VALUE "InternalName", "WinUAE"
             VALUE "LegalCopyright", "© 1996-2006 under the GNU Public License (GPL)"
             VALUE "OriginalFilename", "WinUAE.exe"
             VALUE "ProductName", "WinUAE"
-            VALUE "ProductVersion", "1.3.3"
+            VALUE "ProductVersion", "1.3.4"
         END
     END
     BLOCK "VarFileInfo"
@@ -1053,7 +1053,7 @@ BEGIN
     IDS_DELETECONFIGCONFIRMATION 
                             "Are you sure you want to Delete this configuration?\n"
     IDS_DELETECONFIGTITLE   "Confirm Delete"
-    IDS_GFXCARDCHECK        "WinUAE will now determine the 16-bit pixel format of your graphics card. Your\nscreen will go black for two seconds, with a resolution of 640x480 @ 60Hz. This\nprocedure is required for best rendering of the emulation environment on 16-bit\ndisplay-modes, and should be done whenever you run WinUAE for the first time, or\ninstall a new graphics card in your PC. Proceed with this test?"
+    IDS_GFXCARDCHECK        "WinUAE will now determine the 16-bit pixel format of your graphics card. Your screen will go black for two seconds, with a resolution of 640x480 @ 60Hz. This procedure is required for best rendering of the emulation environment on 16-bit display-modes, and should be done whenever you run WinUAE for the first time, or install a new graphics card in your PC. Proceed with this test?"
     IDS_GFXCARDTITLE        "Pixel format detection"
     IDS_MUSTSELECTPATH      "You must select a path!"
     IDS_SETTINGSERROR       "Settings error"
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 4baf508..1edcd20
@@ -33,8 +33,8 @@
 
 #include <math.h>
 
-#define ADJUST_SIZE 100
-#define EXP 1.9
+#define ADJUST_SIZE 30
+#define EXP 2.1
 
 int sound_debug = 0;
 
@@ -293,7 +293,7 @@ static int open_audio_ds (int size)
     if (max_sndbufsize > dsoundbuf)
         max_sndbufsize = dsoundbuf;
 
-    snd_writeoffset = max_sndbufsize * 3 / 4;
+    snd_writeoffset = max_sndbufsize * 5 / 8;
     snd_maxoffset = max_sndbufsize;
     snd_totalmaxoffset_of = max_sndbufsize + (dsoundbuf - max_sndbufsize) / 3;
     snd_totalmaxoffset_uf = max_sndbufsize + (dsoundbuf - max_sndbufsize) * 2 / 3;
@@ -332,7 +332,7 @@ static int open_audio_ds (int size)
 
     write_log ("DS driver '%s'/%d/%d bits/%d Hz/buffer %d/dist %d\n",
        sound_devices[currprefs.win32_soundcard],
-       currprefs.sound_stereo,
+       wavfmt.nChannels,
        16, freq, max_sndbufsize, snd_configsize);
     obtainedfreq = currprefs.sound_freq;
 
@@ -475,6 +475,7 @@ void restart_sound_buffer(void)
 
 static void finish_sound_buffer_ds (void)
 {
+    static int tfprev;
     DWORD playpos, safepos, status;
     HRESULT hr;
     void *b1, *b2;
@@ -513,6 +514,8 @@ static void finish_sound_buffer_ds (void)
            return;
        }
        safedist -= playpos;
+       if (safedist < 64)
+           safedist = 64;
        safedist += sndbufsize;
        if (safedist < 0)
            safedist += dsoundbuf;
@@ -527,8 +530,11 @@ static void finish_sound_buffer_ds (void)
        cf (snd_writeoffset);
        waiting_for_buffer = -1;
        restart_sound_buffer();
-       write_log("SOUND: safe=%d w=%d max=%d tof=%d tuf=%d\n",
-           safedist, snd_writeoffset, snd_maxoffset, snd_totalmaxoffset_of, snd_totalmaxoffset_uf);
+       write_log("SOUND: safe=%d bs=%d w=%d max=%d tof=%d tuf=%d\n",
+           safedist - sndbufsize, sndbufsize, snd_writeoffset,
+           snd_maxoffset, snd_totalmaxoffset_of, snd_totalmaxoffset_uf);
+       tfprev = timeframes + 10;
+       tfprev = (tfprev / 10) * 10;
     }
 
     hr = IDirectSoundBuffer_GetStatus (lpDSBsecondary, &status);
@@ -577,8 +583,7 @@ static void finish_sound_buffer_ds (void)
        if (diff > snd_totalmaxoffset_of) {
            gui_data.sndbuf_status = 2;
            statuscnt = SND_STATUSCNT;
-           writepos = safepos + snd_writeoffset;
-           cf(writepos);
+           restart_sound_buffer();
            diff = snd_writeoffset;
            break;
        }
@@ -612,7 +617,7 @@ static void finish_sound_buffer_ds (void)
 
     vdiff = diff - snd_writeoffset;
     m = 100.0 * vdiff / max_sndbufsize;
-    skipmode = pow (m < 0 ? -m : m, EXP) / 2.0;
+    skipmode = pow (m < 0 ? -m : m, EXP) / 2;
 
     if (m < 0)
        skipmode = -skipmode;
@@ -621,22 +626,18 @@ static void finish_sound_buffer_ds (void)
     if (skipmode > ADJUST_SIZE)
        skipmode = ADJUST_SIZE;
 
-    if (sound_debug) {
-       static int tfprev;
-       if (tfprev != timeframes && !(timeframes % 10)) {
-           write_log ("b=%5d,%5d,%5d,%5d d=%5d vd=%5.0f s=%+02.1f\n",
+    if (tfprev != timeframes) {
+       if (sound_debug && !(tfprev % 10))
+           write_log ("b=%4d,%5d,%5d,%5d d=%5d vd=%5.0f s=%+02.1f\n",
                sndbufsize, snd_configsize, max_sndbufsize, dsoundbuf, diff, vdiff, skipmode);
-       }
        tfprev = timeframes;
+        if (!avioutput_audio)
+           sound_setadjust (skipmode);
+        gui_data.sndbuf = vdiff * 1000 / (snd_maxoffset - snd_writeoffset);
     }
 
     writepos += sndbufsize;
     cf(writepos);
-
-    if (!avioutput_audio)
-       sound_setadjust (skipmode);
-
-    gui_data.sndbuf = vdiff * 1000 / snd_maxoffset;
 }
 
 static void channelswap(uae_s16 *sndbuffer, int len)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 3fd401b..9df918f
@@ -1,8 +1,8 @@
-cd d:\projects\winuae_bak
+cd c:\projects\winuae_bak
 rm -rf bak
 mkdir bak
-copy /s d:\projects\winuae\src\*.* d:\projects\winuae_bak\bak\
-copy f:\amiga\text\winuaechangelog.txt d:\projects\winuae_bak\bak\od-win32
+copy /s c:\projects\winuae\src\*.* c:\projects\winuae_bak\bak\
+copy d:\amiga\text\winuaechangelog.txt c:\projects\winuae_bak\bak\od-win32
 cd bak
 del *.obj *.ilk *.exe *.pdb *.pch *.idb /s
 
@@ -92,8 +92,8 @@ cd ..
 
 zip -9 -r winuaesrc *
 
-copy winuaesrc.zip f:\amiga\winuaepackets\winuaesrc%1.zip
-move winuaesrc.zip f:\amiga
-cd d:\projects\winuae\src\od-win32
+copy winuaesrc.zip d:\amiga\winuaepackets\winuaesrc%1.zip
+move winuaesrc.zip d:\amiga
+cd c:\projects\winuae\src\od-win32
 zip -9 winuaedebug%1 winuae_msvc\release\winuae.pdb
-move winuaedebug%1.zip f:\amiga\winuaepackets\
+move winuaedebug%1.zip d:\amiga\winuaepackets\
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index ea6b9fc..944228b
@@ -16,7 +16,7 @@
 #include <stdarg.h>
 #include <signal.h>
 
-#define _WIN32_WINNT 0x501 /* XButtons */
+#define _WIN32_WINNT 0x600 /* XButtons + MOUSEHWHEEL */
 
 #include <windows.h>
 #include <commctrl.h>
@@ -88,6 +88,7 @@ static int TaskbarRestartOk;
 static int forceroms;
 
 char VersionStr[256];
+char BetaStr[64];
 
 int in_sizemove;
 int manual_painting_needed;
@@ -298,9 +299,9 @@ static int figure_processor_speed (void)
     if (QueryPerformanceFrequency(&freq)) {
        qpc_avail = 1;
        qpfrate = freq.QuadPart;
-        /* we don't want 32-bit overflow, limit to 100MHz */
+        /* limit to 10MHz */
        qpcdivisor = 0;
-       while (qpfrate > 100000000) {
+       while (qpfrate > 10000000) {
            qpfrate >>= 1;
            qpcdivisor++;
            qpc_avail = -1;
@@ -454,7 +455,7 @@ void setmouseactive (int active)
 {
     int oldactive = mouseactive;
     static int mousecapture, showcursor;
-    char txt[100], txt2[110];
+    char txt[400], txt2[200];
 
     if (active > 0 && mousehack_allowed () && mousehack_alive ()) {
        if (!isfullscreen ())
@@ -464,10 +465,15 @@ void setmouseactive (int active)
 
     mouseactive = active;
     strcpy (txt, "WinUAE");
+    txt2[0] = 0;
     if (mouseactive > 0) {
        focus = 1;
        WIN32GUI_LoadUIString (currprefs.win32_middle_mouse ? IDS_WINUAETITLE_MMB : IDS_WINUAETITLE_NORMAL,
            txt2, sizeof (txt2));
+    }
+    if (WINUAEBETA > 0)
+       strcat (txt, BetaStr);
+    if (txt2[0]) {
        strcat (txt, " - ");
        strcat (txt, txt2);
     }
@@ -824,6 +830,10 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
        if (dinput_winmouse () >= 0)
            setmousestate (dinput_winmouse(), 2, ((short)HIWORD(wParam)), 0);
     return 0;
+    case WM_MOUSEHWHEEL:
+       if (dinput_winmouse () >= 0)
+           setmousestate (dinput_winmouse(), 3, ((short)HIWORD(wParam)), 0);
+    return 0;
 
     case WM_PAINT:
     {
@@ -993,15 +1003,15 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
                {
                    LPNMMOUSE lpnm = (LPNMMOUSE) lParam; 
                    int num = (int)lpnm->dwItemSpec;
-                   if (num >= 6 && num <= 9) {
-                       num -= 6;
+                   if (num >= 7 && num <= 10) {
+                       num -= 7;
                        if (nm->code == NM_RCLICK) {
                            disk_eject (num);
                        } else if (changed_prefs.dfxtype[num] >= 0) {
                            DiskSelection (hWnd, IDC_DF0 + num, 0, &changed_prefs, 0);
                            disk_insert (num, changed_prefs.df[num]);
                        }
-                   } else if (num == 3) {
+                   } else if (num == 4) {
                        if (nm->code == NM_CLICK)
                            gui_display (-1);
                        else
@@ -1676,7 +1686,7 @@ void target_default_options (struct uae_prefs *p, int type)
        p->win32_iconified_pause = 1;
        p->win32_inactive_nosound = 0;
        p->win32_inactive_pause = 0;
-       p->win32_no_overlay = 0;
+       p->win32_no_overlay = os_vista ? 1 : 0;
        p->win32_ctrl_F11_is_quit = 0;
        p->win32_soundcard = 0;
        p->win32_active_priority = 1;
@@ -2094,8 +2104,7 @@ static void WIN32_HandleRegistryStuff(void)
        initpath ("SaveimagePath", start_path_data);
        initpath ("VideoPath", start_path_data);
        initpath ("InputPath", start_path_data);
-       if (disposition == REG_CREATED_NEW_KEY)
-       {
+       if (disposition == REG_CREATED_NEW_KEY) {
            /* Create and initialize all our sub-keys to the default values */
            colortype = 0;
            RegSetValueEx(hWinUAEKey, "DisplayInfo", 0, REG_DWORD, (CONST BYTE *)&colortype, sizeof(colortype));
@@ -2167,8 +2176,87 @@ static void WIN32_HandleRegistryStuff(void)
     load_keyring(NULL, NULL);
 }
 
-static void betamessage (void)
+static char *BETAMESSAGE = {
+    "This is unstable beta software. Click cancel if you are not comfortable using software that is incomplete and can have serious programming errors."
+};
+
+static int betamessage (void)
 {
+#ifdef WINUAEPUBLICBETA
+    int showmsg = TRUE;
+    HANDLE h = INVALID_HANDLE_VALUE;
+    ULONGLONG regft64;
+    ULARGE_INTEGER ft64;
+    ULARGE_INTEGER sft64;
+    struct tm *t;
+    __int64 ltime;
+    DWORD dwType, size, data;
+
+    ft64.QuadPart = 0;
+    for (;;) {
+       FILETIME ft, sft;
+       SYSTEMTIME st;
+       char tmp1[MAX_DPATH];
+
+       if (!hWinUAEKey)
+           break;
+        if (GetModuleFileName(NULL, tmp1, sizeof tmp1) == 0)
+           break;
+       h = CreateFile(tmp1, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+       if (h == INVALID_HANDLE_VALUE)
+           break;
+       if (GetFileTime(h, &ft, NULL, NULL) == 0)
+           break;
+       ft64.LowPart = ft.dwLowDateTime;
+       ft64.HighPart = ft.dwHighDateTime;
+       dwType = REG_QWORD;
+       size = sizeof regft64;
+       if (RegQueryValueEx(hWinUAEKey, "BetaToken", 0, &dwType, (LPBYTE)&regft64, &size) != ERROR_SUCCESS)
+           break;
+       GetSystemTime(&st);
+       SystemTimeToFileTime(&st, &sft);
+       sft64.LowPart = sft.dwLowDateTime;
+       sft64.HighPart = sft.dwHighDateTime;
+       if (ft64.QuadPart == regft64)
+           showmsg = FALSE;
+       /* complain again in 7 days */
+       if (sft64.QuadPart > regft64 + (ULONGLONG)1000000000 * 60 * 60 * 24 * 7)
+           showmsg = TRUE;
+       break;
+    }
+    if (h != INVALID_HANDLE_VALUE)
+       CloseHandle(h);
+    if (showmsg) {
+       int r;
+       char title[MAX_DPATH];
+
+       dwType = REG_DWORD;
+       size = sizeof data;
+       if (hWinUAEKey && RegQueryValueEx(hWinUAEKey, "Beta_Just_Shut_Up", 0, &dwType, (LPBYTE)&data, &size) == ERROR_SUCCESS) {
+           if (data == 68000) {
+               write_log("I was told to shut up :(\n");
+               return 1;
+           }
+       }
+
+       _time64(&ltime);
+       t = _gmtime64 (&ltime);
+       /* "expire" in 1 month */
+       if (MAKEBD(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday) > WINUAEDATE + 100)
+           pre_gui_message("This beta build of WinUAE is obsolete.\nPlease download newer version.");
+
+       strcpy (title, "WinUAE Public Beta Disclaimer");
+       strcat (title, BetaStr);
+       r = MessageBox (NULL, BETAMESSAGE, title, MB_OKCANCEL | MB_TASKMODAL | MB_SETFOREGROUND | MB_ICONWARNING | MB_DEFBUTTON2);
+       if (r == IDABORT || r == IDCANCEL)
+           return 0;
+       if (ft64.QuadPart > 0) {
+           regft64 = ft64.QuadPart;
+           RegSetValueEx(hWinUAEKey, "BetaToken", 0, REG_QWORD, (LPBYTE)&regft64, sizeof regft64);
+       }
+    }
+#endif
+    return 1;
 }
 
 static int dxdetect (void)
@@ -2189,7 +2277,7 @@ static int dxdetect (void)
 #endif
 }
 
-int os_winnt, os_winnt_admin, os_64bit;
+int os_winnt, os_winnt_admin, os_64bit, os_vista;
 
 static int isadminpriv (void) 
 {
@@ -2255,6 +2343,7 @@ static int osdetect (void)
 {
     os_winnt = 0;
     os_winnt_admin = 0;
+    os_vista = 0;
     os_64bit = 0;
 
     pGetNativeSystemInfo = (PGETNATIVESYSTEMINFO)GetProcAddress(
@@ -2275,6 +2364,8 @@ static int osdetect (void)
        }
        if (osVersion.dwPlatformId == VER_PLATFORM_WIN32_NT)
            os_winnt = 1;
+       if (osVersion.dwMajorVersion >= 6)
+           os_vista = 1;
        if (SystemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
            os_64bit = 1;
     }
@@ -2417,6 +2508,30 @@ extern int force_direct_catweasel, cpu_affinity;
 
 static int original_affinity;
 
+static int getval(char *s)
+{
+    int base = 10;
+    int v;
+    char *endptr;
+
+    if (s[0] == '0' && s[1] == 'x')
+       s += 2, base = 16;
+    v = strtol (s, &endptr, base);
+    if (*endptr != '\0' || *s == '\0')
+       return 0;
+    return v;
+}
+
+static void makeverstr(char *s)
+{
+#if WINUAEBETA > 0
+    sprintf(BetaStr, " (%sBeta %d, %d.%02d.%02d)", WINUAEPUBLICBETA > 0 ? "Public " : "", WINUAEBETA,
+       GETBDY(WINUAEDATE), GETBDM(WINUAEDATE), GETBDD(WINUAEDATE));
+#endif
+    sprintf(s, "WinUAE %d.%d.%d%s",
+       UAEMAJOR, UAEMINOR, UAESUBREV, BetaStr);
+}
+
 static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
                    int nCmdShow)
 {
@@ -2450,11 +2565,7 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
     AVIOutput_Initialize();
 #endif
 
-#ifdef __MINGW32__
-    argc = _argc; argv = _argv;
-#else
     argc = __argc; argv = __argv;
-#endif
     for (i = 1; i < argc; i++) {
        char *arg = argv[i];
        if (!strcmp (arg, "-log")) console_logging = 1;
@@ -2474,18 +2585,20 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
        if (!strcmp (arg, "-screenshotbmp")) screenshotmode = 0;
        if (!strcmp (arg, "-psprintdebug")) postscript_print_debugging = 1;
        if (!strcmp (arg, "-sounddebug")) sound_debug = 1;
-       if (!strcmp (arg, "-directcatweasel")) force_direct_catweasel = 1;
+       if (!strcmp (arg, "-directcatweasel")) {
+           force_direct_catweasel = 1;
+           if (i + 1 < argc)
+               force_direct_catweasel = getval (argv[++i]);
+       }
        if (!strcmp (arg, "-affinity") && i + 1 < argc) {
-           cpu_affinity = atol (argv[i + 1]);
+           cpu_affinity = getval (argv[++i]);
            if (cpu_affinity == 0)
                cpu_affinity = original_affinity;
            SetThreadAffinityMask(GetCurrentThread(), cpu_affinity);
-           i++;
        }
        if (!strcmp (arg, "-datapath") && i + 1 < argc) {
-           strcpy(start_path_data, argv[i + 1]);
+           strcpy(start_path_data, argv[++i]);
            start_data = 1;
-           i++;
        }
     }
 #if 0
@@ -2493,20 +2606,12 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
     argv[0] = 0;
 #endif
     getstartpaths(start_data);
-    sprintf(VersionStr, "WinUAE %d.%d.%d%s (%d-bit)",
-       UAEMAJOR, UAEMINOR, UAESUBREV, WINUAEBETA ? WINUAEBETASTR : "",
-       #if defined(WIN64)
-       64
-       #else
-       32
-       #endif
-    );
+    makeverstr(VersionStr);
     SetCurrentDirectory (start_path_data);
 
     logging_init ();
 
-    if(WIN32_RegisterClasses() && WIN32_InitLibraries() && DirectDraw_Start(NULL))
-    {
+    if(WIN32_RegisterClasses() && WIN32_InitLibraries() && DirectDraw_Start(NULL)) {
        DEVMODE devmode;
        DWORD i = 0;
 
@@ -2530,16 +2635,17 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
        WIN32_InitLang();
        WIN32_InitHtmlHelp();
        DirectDraw_Release();
-       betamessage ();
-       keyboard_settrans ();
+       if (betamessage ()) {
+           keyboard_settrans ();
 #ifdef CATWEASEL
-       catweasel_init();
+           catweasel_init();
 #endif
 #ifdef PARALLEL_PORT
-       paraport_mask = paraport_init ();
+           paraport_mask = paraport_init ();
 #endif
-       createIPC();
-       real_main (argc, argv);
+           createIPC();
+           real_main (argc, argv);
+       }
     }
 
     closeIPC();
@@ -2872,12 +2978,22 @@ end:
     return m;
 }
 
+typedef BOOL (CALLBACK* CHANGEWINDOWMESSAGEFILTER)(UINT, DWORD);
+#define MSGFLT_ADD 1
+
 int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
 {
     HANDLE thread;
 
     thread = GetCurrentThread();
     original_affinity = SetThreadAffinityMask(thread, 1); 
+#if 0
+    CHANGEWINDOWMESSAGEFILTER pChangeWindowMessageFilter;
+    pChangeWindowMessageFilter = (CHANGEWINDOWMESSAGEFILTER)GetProcAddress(
+       GetModuleHandle("user32.dll"), "ChangeWindowMessageFilter");
+    if (pChangeWindowMessageFilter)
+       pChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD);
+#endif
     __try {
        WinMain2 (hInstance, hPrevInstance, lpCmdLine, nCmdShow);
     } __except(ExceptionFilter(GetExceptionInformation(), GetExceptionCode())) {
old mode 100755 (executable)
new mode 100644 (file)
index 8b33df2..10b0308
 #ifndef __WIN32_H__
 #define __WIN32_H__
 
+#define MAKEBD(x,y,z) ((((x) - 2000) * 10000 + (y)) * 100 + (z))
+#define GETBDY(x) ((x) / 1000000 + 2000)
+#define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
+#define GETBDD(x) ((x) % 100)
+
+#define WINUAEBETA 2
+#define WINUAEPUBLICBETA 1
+#define WINUAEDATE MAKEBD(2006, 12, 2)
+
 #define IHF_WINDOWHIDDEN 6
 #define NORMAL_WINDOW_STYLE (WS_VISIBLE | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU )
 
@@ -21,8 +30,6 @@ extern int manual_painting_needed;
 extern int manual_palette_refresh_needed;
 extern int mouseactive, focus;
 extern int ignore_messages_all;
-#define WINUAEBETA 0
-#define WINUAEBETASTR ""
 
 extern char start_path_exe[MAX_DPATH];
 extern char start_path_data[MAX_DPATH];
@@ -56,7 +63,8 @@ extern int sound_available;
 extern int framecnt;
 extern char prtname[];
 extern char VersionStr[256];
-extern int os_winnt, os_winnt_admin, os_64bit;
+extern char BetaStr[64];
+extern int os_winnt, os_winnt_admin, os_64bit, os_vista;
 extern int paraport_mask;
 extern int gui_active;
 extern DWORD quickstart;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 55aad9d..40bef5b
@@ -549,8 +549,10 @@ BOOL CALLBACK displaysCallback (GUID *guid, LPSTR desc, LPSTR name, LPVOID ctx,
     write_log ("'%s' '%s' %s\n", desc, name, outGUID(guid));
     if ((strstr(desc, "X1900") || strstr(desc, "X1800") || strstr(desc, "X1600")) && !b0rken_ati_overlay) {
        b0rken_ati_overlay = 1;
-       write_log ("** Radeon X1x00 series display card detected, enabling overlay workaround.\n");
-       write_log ("** (blank display with Catalyst 6.1 and newer). Use -disableowr to disable workaround.\n");
+       if (!os_vista) {
+           write_log ("** Radeon X1x00 series display card detected, enabling overlay workaround.\n");
+           write_log ("** (blank display with Catalyst 6.1 and newer). Use -disableowr to disable workaround.\n");
+       }
     }
     return 1;
 }
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 481eddf..f32028f
@@ -932,7 +932,7 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
     int next;
     int filterindex = 0;
 
-    char szTitle[MAX_DPATH];
+    char szTitle[MAX_DPATH] = { 0 };
     char szFormat[MAX_DPATH];
     char szFilter[MAX_DPATH] = { 0 };
     
@@ -981,7 +981,6 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
        sprintf( szFilter, "%s ", szFormat );
        memcpy( szFilter + strlen( szFilter ), DISK_FORMAT_STRING, sizeof(DISK_FORMAT_STRING) + 1);
 
-       openFileName.lpstrTitle = szTitle;
        openFileName.lpstrDefExt = "ADF";
        openFileName.lpstrFilter = szFilter;
        break;
@@ -991,7 +990,6 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
        sprintf( szFilter, "%s ", szFormat );
        memcpy( szFilter + strlen( szFilter ), "(*.adf)\0*.adf\0", 15 );
 
-       openFileName.lpstrTitle = szTitle;
        openFileName.lpstrDefExt = "ADF";
        openFileName.lpstrFilter = szFilter;
        break;
@@ -1002,7 +1000,6 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
        sprintf( szFilter, "%s ", szFormat );
        memcpy( szFilter + strlen( szFilter ),  HDF_FORMAT_STRING, sizeof (HDF_FORMAT_STRING) + 1);
 
-       openFileName.lpstrTitle = szTitle;
        openFileName.lpstrDefExt = "HDF";
        openFileName.lpstrFilter = szFilter;
        break;
@@ -1013,7 +1010,6 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
        sprintf( szFilter, "%s ", szFormat );
        memcpy( szFilter + strlen( szFilter ), "(*.uae)\0*.uae\0", 15 );
 
-       openFileName.lpstrTitle  = szTitle;
        openFileName.lpstrDefExt = "UAE";
        openFileName.lpstrFilter = szFilter;
        break;
@@ -1023,7 +1019,6 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
        sprintf( szFilter, "%s ", szFormat );
        memcpy( szFilter + strlen( szFilter ), ROM_FORMAT_STRING, sizeof (ROM_FORMAT_STRING) + 1);
 
-       openFileName.lpstrTitle = szTitle;
        openFileName.lpstrDefExt = "ROM";
        openFileName.lpstrFilter = szFilter;
        break;
@@ -1033,7 +1028,6 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
        sprintf( szFilter, "%s ", szFormat );
        memcpy( szFilter + strlen( szFilter ), "(*.key)\0*.key\0", 15 );
 
-       openFileName.lpstrTitle = szTitle;
        openFileName.lpstrDefExt = "KEY";
        openFileName.lpstrFilter = szFilter;
        break;
@@ -1044,7 +1038,6 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
        sprintf( szFilter, "%s ", szFormat );
        memcpy( szFilter + strlen( szFilter ), INP_FORMAT_STRING, sizeof (INP_FORMAT_STRING) + 1);
 
-       openFileName.lpstrTitle = szTitle;
        openFileName.lpstrDefExt = "INP";
        openFileName.lpstrFilter = szFilter;
        break;
@@ -1084,7 +1077,6 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
            all = 0;
            filterindex = statefile_previousfilter;
        }
-       openFileName.lpstrTitle  = szTitle;
        openFileName.lpstrDefExt = "USS";
        openFileName.lpstrFilter = szFilter;
        break;
@@ -1094,7 +1086,6 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
        sprintf( szFilter, "%s ", szFormat );
        memcpy( szFilter + strlen( szFilter ), "(*.nvr)\0*.nvr\0", 15 );
 
-       openFileName.lpstrTitle  = szTitle;
        openFileName.lpstrDefExt = "NVR";
        openFileName.lpstrFilter = szFilter;
        break;
@@ -1102,14 +1093,12 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
     default:
        WIN32GUI_LoadUIString( IDS_SELECTINFO, szTitle, MAX_DPATH );
 
-       openFileName.lpstrTitle = szTitle;
        openFileName.lpstrFilter = NULL;
        openFileName.lpstrDefExt = NULL;
        break;
     case 12:
        WIN32GUI_LoadUIString( IDS_SELECTFS, szTitle, MAX_DPATH );
 
-       openFileName.lpstrTitle = szTitle;
        openFileName.lpstrFilter = NULL;
        openFileName.lpstrDefExt = NULL;
        openFileName.lpstrInitialDir = path_out;
@@ -1117,7 +1106,6 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
     case 13:
        WIN32GUI_LoadUIString( IDS_SELECTINFO, szTitle, MAX_DPATH );
 
-       openFileName.lpstrTitle = szTitle;
        openFileName.lpstrFilter = NULL;
        openFileName.lpstrDefExt = NULL;
        openFileName.lpstrInitialDir = path_out;
@@ -1146,6 +1134,8 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
     openFileName.lpfnHook = NULL;
     openFileName.lpTemplateName = NULL;
     openFileName.lCustData = 0;
+    openFileName.lpstrTitle = szTitle;
+
     if (multi)
        openFileName.Flags |= OFN_ALLOWMULTISELECT;
     if (flag == 1 || flag == 3 || flag == 5 || flag == 9 || flag == 11 || flag == 16) {
@@ -1260,7 +1250,7 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
            strcpy (workprefs.cartfile, full_path);
            break;
        case IDC_INPREC_PLAY:
-           inprec_open(full_path, IsDlgButtonChecked(hDlg, IDC_AVIOUTPUT_AUDIO) == BST_CHECKED ? -2 : -1);
+           inprec_open(full_path, IsDlgButtonChecked(hDlg, IDC_INPREC_PLAYMODE) == BST_CHECKED ? -1 : -2);
            break;
        case IDC_INPREC_RECORD:
            inprec_open(full_path, 1);
@@ -1805,36 +1795,36 @@ void InitializeListView (HWND hDlg)
     if (hDlg == pages[HARDDISK_ID]) {
        listview_num_columns = HARDDISK_COLUMNS;
        lv_type = LV_HARDDISK;
-       WIN32GUI_LoadUIString( IDS_DEVICE, column_heading[0], MAX_COLUMN_HEADING_WIDTH );
-       WIN32GUI_LoadUIString( IDS_VOLUME, column_heading[1], MAX_COLUMN_HEADING_WIDTH );
-       WIN32GUI_LoadUIString( IDS_PATH, column_heading[2], MAX_COLUMN_HEADING_WIDTH );
-       WIN32GUI_LoadUIString( IDS_RW, column_heading[3], MAX_COLUMN_HEADING_WIDTH );
-       WIN32GUI_LoadUIString( IDS_BLOCKSIZE, column_heading[4], MAX_COLUMN_HEADING_WIDTH );
-       WIN32GUI_LoadUIString( IDS_HFDSIZE, column_heading[5], MAX_COLUMN_HEADING_WIDTH );
-       WIN32GUI_LoadUIString( IDS_BOOTPRI, column_heading[6], MAX_COLUMN_HEADING_WIDTH );
-       list = GetDlgItem( hDlg, IDC_VOLUMELIST );
+       WIN32GUI_LoadUIString(IDS_DEVICE, column_heading[0], MAX_COLUMN_HEADING_WIDTH);
+       WIN32GUI_LoadUIString(IDS_VOLUME, column_heading[1], MAX_COLUMN_HEADING_WIDTH);
+       WIN32GUI_LoadUIString(IDS_PATH, column_heading[2], MAX_COLUMN_HEADING_WIDTH);
+       WIN32GUI_LoadUIString(IDS_RW, column_heading[3], MAX_COLUMN_HEADING_WIDTH);
+       WIN32GUI_LoadUIString(IDS_BLOCKSIZE, column_heading[4], MAX_COLUMN_HEADING_WIDTH);
+       WIN32GUI_LoadUIString(IDS_HFDSIZE, column_heading[5], MAX_COLUMN_HEADING_WIDTH);
+       WIN32GUI_LoadUIString(IDS_BOOTPRI, column_heading[6], MAX_COLUMN_HEADING_WIDTH);
+       list = GetDlgItem(hDlg, IDC_VOLUMELIST);
     } else if (hDlg == pages[INPUT_ID]) {
        listview_num_columns = INPUT_COLUMNS;
        lv_type = LV_INPUT;
-       WIN32GUI_LoadUIString( IDS_INPUTHOSTWIDGET, column_heading[0], MAX_COLUMN_HEADING_WIDTH );
-       WIN32GUI_LoadUIString( IDS_INPUTAMIGAEVENT, column_heading[1], MAX_COLUMN_HEADING_WIDTH );
-       WIN32GUI_LoadUIString( IDS_INPUTAUTOFIRE, column_heading[2], MAX_COLUMN_HEADING_WIDTH );
+       WIN32GUI_LoadUIString(IDS_INPUTHOSTWIDGET, column_heading[0], MAX_COLUMN_HEADING_WIDTH);
+       WIN32GUI_LoadUIString(IDS_INPUTAMIGAEVENT, column_heading[1], MAX_COLUMN_HEADING_WIDTH);
+       WIN32GUI_LoadUIString(IDS_INPUTAUTOFIRE, column_heading[2], MAX_COLUMN_HEADING_WIDTH);
        strcpy (column_heading[3], "#");
-       list = GetDlgItem( hDlg, IDC_INPUTLIST );
+       list = GetDlgItem(hDlg, IDC_INPUTLIST);
     } else {
        listview_num_columns = DISK_COLUMNS;
        lv_type = LV_DISK;
        strcpy (column_heading[0], "#");
-       WIN32GUI_LoadUIString( IDS_DISK_IMAGENAME, column_heading[1], MAX_COLUMN_HEADING_WIDTH );
-       WIN32GUI_LoadUIString( IDS_DISK_DRIVENAME, column_heading[2], MAX_COLUMN_HEADING_WIDTH );
+       WIN32GUI_LoadUIString(IDS_DISK_IMAGENAME, column_heading[1], MAX_COLUMN_HEADING_WIDTH);
+       WIN32GUI_LoadUIString(IDS_DISK_DRIVENAME, column_heading[2], MAX_COLUMN_HEADING_WIDTH);
        list = GetDlgItem (hDlg, IDC_DISK);
     }
     cachedlist = list;
 
-    ListView_DeleteAllItems( list );
+    ListView_DeleteAllItems(list);
 
-    for( i = 0; i < listview_num_columns; i++ )
-       listview_column_width[i] = ListView_GetStringWidth( list, column_heading[i] ) + 15;
+    for(i = 0; i < listview_num_columns; i++)
+       listview_column_width[i] = ListView_GetStringWidth(list, column_heading[i]) + 15;
 
     // If there are no columns, then insert some
     lvcolumn.mask = LVCF_WIDTH;
@@ -1899,13 +1889,13 @@ void InitializeListView (HWND hDlg)
            if (drv >= 0)
                sprintf (tmp, "DF%d:", drv);
            ListView_SetItemText (list, result, 2, tmp);
-           width = ListView_GetStringWidth( list, lvstruct.pszText ) + 15;
+           width = ListView_GetStringWidth(list, lvstruct.pszText) + 15;
            if (width > listview_column_width[0])
                listview_column_width[ 0 ] = width;
            entry++;
        }
        listview_column_width[0] = 30;
-       listview_column_width[1] = 354;
+       listview_column_width[1] = 336;
        listview_column_width[2] = 50;
 
     }
@@ -2040,11 +2030,13 @@ static int listview_find_selected (HWND list)
 static int listview_entry_from_click (HWND list, int *column)
 {
     POINT point;
+    POINTS p;
     DWORD pos = GetMessagePos ();
     int items, entry;
 
-    point.x = LOWORD (pos);
-    point.y = HIWORD (pos);
+    p = MAKEPOINTS (pos);
+    point.x = p.x;
+    point.y = p.y;
     ScreenToClient (list, &point);
     entry = ListView_GetTopIndex (list);
     items = entry + ListView_GetCountPerPage (list);
@@ -2056,19 +2048,24 @@ static int listview_entry_from_click (HWND list, int *column)
        /* Get the bounding rectangle of an item. If the mouse
         * location is within the bounding rectangle of the item,
         * you know you have found the item that was being clicked.  */
-       ListView_GetItemRect (list, entry, &rect, LVIR_BOUNDS);
-       if (PtInRect (&rect, point)) {
-           int i, x = 0;
-           UINT flag = LVIS_SELECTED | LVIS_FOCUSED;
-           ListView_SetItemState (list, entry, flag, flag);
-           for (i = 0; i < listview_num_columns && column; i++) {
-               if (x < point.x && x + listview_column_width[i] > point.x) {
-                   *column = i;
-                   break;
+       if (ListView_GetItemRect (list, entry, &rect, LVIR_BOUNDS)) {
+           if (PtInRect (&rect, point)) {
+               POINT ppt;
+               int i, x;
+               UINT flag = LVIS_SELECTED | LVIS_FOCUSED;
+
+               ListView_GetItemPosition(list, entry, &ppt);
+               x = ppt.x;
+               ListView_SetItemState (list, entry, flag, flag);
+               for (i = 0; i < listview_num_columns && column; i++) {
+                   if (x < point.x && x + listview_column_width[i] > point.x) {
+                       *column = i;
+                       break;
+                   }
+                   x += listview_column_width[i];
                }
-               x += listview_column_width[i];
+               return entry;
            }
-           return entry;
        }
        entry++;
     }
@@ -4617,6 +4614,7 @@ static void values_to_miscdlg (HWND hDlg)
        misc_kbled (hDlg, IDC_KBLED1, workprefs.keyboard_leds[0]);
        misc_kbled (hDlg, IDC_KBLED2, workprefs.keyboard_leds[1]);
        misc_kbled (hDlg, IDC_KBLED3, workprefs.keyboard_leds[2]);
+       CheckDlgButton (hDlg, IDC_KBLED_USB, workprefs.win32_kbledmode);
 
        SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_RESETCONTENT, 0, 0);
        SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"1");
@@ -6592,10 +6590,6 @@ static INT_PTR CALLBACK FloppyDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA
        break;
     }
 
-    strcpy (changed_prefs.df[0], workprefs.df[0]);
-    strcpy (changed_prefs.df[1], workprefs.df[1]);
-    strcpy (changed_prefs.df[2], workprefs.df[2]);
-    strcpy (changed_prefs.df[3], workprefs.df[3]);
     return FALSE;
 }
 
@@ -7495,21 +7489,21 @@ static void values_from_inputdlg (HWND hDlg)
     BOOL success;
     LRESULT item;
 
-    v  = GetDlgItemInt( hDlg, IDC_INPUTDEADZONE, &success, FALSE );
+    v  = GetDlgItemInt(hDlg, IDC_INPUTDEADZONE, &success, FALSE);
     if (success) {
        currprefs.input_joystick_deadzone = workprefs.input_joystick_deadzone = v;
        currprefs.input_joystick_deadzone = workprefs.input_joymouse_deadzone = v;
     }
-    v  = GetDlgItemInt( hDlg, IDC_INPUTAUTOFIRERATE, &success, FALSE );
+    v  = GetDlgItemInt(hDlg, IDC_INPUTAUTOFIRERATE, &success, FALSE);
     if (success)
        currprefs.input_autofire_framecnt = workprefs.input_autofire_framecnt = v;
-    v  = GetDlgItemInt( hDlg, IDC_INPUTSPEEDD, &success, FALSE );
+    v  = GetDlgItemInt(hDlg, IDC_INPUTSPEEDD, &success, FALSE);
     if (success)
        currprefs.input_joymouse_speed = workprefs.input_joymouse_speed = v;
-    v  = GetDlgItemInt( hDlg, IDC_INPUTSPEEDA, &success, FALSE );
+    v  = GetDlgItemInt(hDlg, IDC_INPUTSPEEDA, &success, FALSE);
     if (success)
        currprefs.input_joymouse_multiplier = workprefs.input_joymouse_multiplier = v;
-    v  = GetDlgItemInt( hDlg, IDC_INPUTSPEEDM, &success, FALSE );
+    v  = GetDlgItemInt(hDlg, IDC_INPUTSPEEDM, &success, FALSE);
     if (success)
        currprefs.input_mouse_speed = workprefs.input_mouse_speed = v;
 
@@ -7581,14 +7575,14 @@ static void input_copy (HWND hDlg)
 
 static void input_toggleautofire (void)
 {
-    int af, flags, event;
+    int af, flags, evt;
     char name[256];
     char custom[MAX_DPATH];
     if (input_selected_device < 0 || input_selected_widget < 0)
        return;
-    event = inputdevice_get_mapped_name (input_selected_device, input_selected_widget,
+    evt = inputdevice_get_mapped_name (input_selected_device, input_selected_widget,
        &flags, name, custom, input_selected_sub_num);
-    if (event <= 0)
+    if (evt <= 0)
        return;
     af = (flags & IDEV_MAPPED_AUTOFIRE_SET) ? 0 : 1;
     inputdevice_set_mapping (input_selected_device, input_selected_widget,
@@ -8932,7 +8926,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int   currentpage)
                    } else {
                        DISK_history_add (file, -1);
                        strcpy (workprefs.df[drv], file);
-                       strcpy (changed_prefs.df[drv], workprefs.df[drv]);
+                       disk_insert (drv, workprefs.df[drv]);
                        drv++;
                        if (drv >= (currentpage == QUICKSTART_ID ? 2 : 4))
                            drv = 0;
@@ -9175,11 +9169,18 @@ static int GetSettings (int all_options, HWND hwnd)
 
     dialogreturn = -1;
     hAccelTable = NULL;
+    DragAcceptFiles(hwnd, TRUE);
     dhwnd = CreateDialog (hUIDLL ? hUIDLL : hInst, MAKEINTRESOURCE (IDD_PANEL), hwnd, DialogProc);
     psresult = 0;
     if (dhwnd != NULL) {
        MSG msg;
        DWORD v;
+       char tmp[MAX_DPATH];
+
+       if (WINUAEBETA > 0 && GetWindowText (dhwnd, tmp, sizeof (tmp)) > 0) {
+           strcat (tmp, BetaStr);
+           SetWindowText (dhwnd, tmp);
+       }
        ShowWindow (dhwnd, SW_SHOW);
        for (;;) {
            HANDLE IPChandle;
@@ -9364,7 +9365,7 @@ void gui_led (int led, int on)
        pos = 0;
        ptr = drive_text + pos * 16;
        if (gui_data.sndbuf_status < 3) {
-           sprintf(ptr, "SND: %.0f%%", (double)((gui_data.sndbuf) / 10.0));
+           sprintf(ptr, "SND: %+.0f%%", (double)((gui_data.sndbuf) / 10.0));
        } else {
            strcpy (ptr, "SND: -");
            on = 0;
@@ -9524,6 +9525,7 @@ void pre_gui_message (const char *format,...)
        write_log("\n");
 
     WIN32GUI_LoadUIString (IDS_ERRORTITLE, szTitle, MAX_DPATH);
+    strcat (szTitle, BetaStr);
     MessageBox (guiDlg, msg, szTitle, MB_OK | MB_TASKMODAL | MB_SETFOREGROUND );
 
 }
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 913fe91..9aec0d1
@@ -85,7 +85,7 @@
                                AdditionalOptions="/MACHINE:I386"
                                AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib capsimg.lib dxerr8.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib"
                                ShowProgress="0"
-                               OutputFile="f:\amiga\winuae.exe"
+                               OutputFile="d:\amiga\winuae.exe"
                                LinkIncremental="2"
                                SuppressStartupBanner="true"
                                GenerateManifest="false"
                        />
                        <Tool
                                Name="VCManifestTool"
+                               AdditionalManifestFiles="..\resources\winuae.exe.manifest"
                        />
                        <Tool
                                Name="VCXDCMakeTool"
                        />
                </Configuration>
                <Configuration
-                       Name="Debug|x64"
-                       OutputDirectory="x64\$(ConfigurationName)"
-                       IntermediateDirectory="x64\$(ConfigurationName)"
+                       Name="Release|Win32"
+                       OutputDirectory="d:\amiga"
+                       IntermediateDirectory=".\Release"
                        ConfigurationType="1"
                        UseOfMFC="0"
                        ATLMinimizesCRunTimeLibraryUsage="false"
                        />
                        <Tool
                                Name="VCMIDLTool"
-                               PreprocessorDefinitions="_DEBUG"
+                               PreprocessorDefinitions="NDEBUG"
                                MkTypLibCompatible="true"
                                SuppressStartupBanner="true"
-                               TargetEnvironment="3"
-                               TypeLibraryName=".\Debug/winuae_msvc.tlb"
+                               TargetEnvironment="1"
+                               TypeLibraryName=".\Release/winuae_msvc.tlb"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalOptions=""
-                               Optimization="0"
+                               Optimization="3"
+                               InlineFunctionExpansion="1"
+                               EnableIntrinsicFunctions="true"
+                               FavorSizeOrSpeed="1"
+                               OmitFramePointers="true"
+                               WholeProgramOptimization="false"
                                AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep"
-                               PreprocessorDefinitions="WINVER=0x0500,_DEBUG,WIN32,_WINDOWS,ZLIB_DLL,OPENGL_SUPPORT,_WIN32_IE 0x0500,UNIX;WIN64"
+                               PreprocessorDefinitions="WINVER=0x0500,WIN32,NDEBUG,_WINDOWS,_WIN32_IE=0x0500,UNIX"
+                               StringPooling="true"
                                ExceptionHandling="0"
-                               BasicRuntimeChecks="3"
-                               RuntimeLibrary="1"
-                               BufferSecurityCheck="true"
-                               RuntimeTypeInfo="true"
-                               PrecompiledHeaderFile=".\Debug/winuae_msvc.pch"
-                               AssemblerListingLocation=".\Debug/"
-                               ObjectFile=".\Debug/"
-                               ProgramDataBaseFileName=".\Debug/"
+                               BasicRuntimeChecks="0"
+                               RuntimeLibrary="0"
+                               BufferSecurityCheck="false"
+                               EnableFunctionLevelLinking="false"
+                               EnableEnhancedInstructionSet="0"
+                               FloatingPointModel="0"
+                               TreatWChar_tAsBuiltInType="false"
+                               RuntimeTypeInfo="false"
+                               UsePrecompiledHeader="0"
+                               PrecompiledHeaderFile=".\Release/winuae_msvc.pch"
+                               AssemblerListingLocation=".\Release/"
+                               ObjectFile=".\Release/"
+                               ProgramDataBaseFileName=".\Release/"
                                WarningLevel="3"
                                SuppressStartupBanner="true"
-                               Detect64BitPortabilityProblems="true"
-                               DebugInformationFormat="3"
                                CompileAs="0"
                                DisableSpecificWarnings="4996"
-                               EnablePREfast="false"
+                               ForcedIncludeFiles=""
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="_DEBUG"
+                               PreprocessorDefinitions="NDEBUG"
                                Culture="1033"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib zlib1.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib capsimg.lib dxerr8.lib shlwapi.lib"
+                               AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib dxerr8.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib"
                                OutputFile="d:\amiga\winuae.exe"
-                               LinkIncremental="2"
+                               LinkIncremental="1"
                                SuppressStartupBanner="true"
-                               GenerateManifest="false"
+                               AdditionalLibraryDirectories=""
+                               GenerateManifest="true"
+                               AdditionalManifestDependencies=""
                                DelayLoadDLLs="setupapi.dll"
                                GenerateDebugInformation="true"
-                               ProgramDatabaseFile=".\Debug/winuae.pdb"
+                               ProgramDatabaseFile=".\Release/winuae.pdb"
                                SubSystem="2"
                                StackReserveSize="2621440"
                                StackCommitSize="2621440"
-                               TargetMachine="17"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               OptimizeForWindows98="0"
+                               LinkTimeCodeGeneration="0"
+                               TargetMachine="1"
                        />
                        <Tool
                                Name="VCALinkTool"
                        />
                        <Tool
                                Name="VCManifestTool"
+                               AdditionalManifestFiles="..\resources\winuae.exe.manifest"
                        />
                        <Tool
                                Name="VCXDCMakeTool"
                        />
                </Configuration>
                <Configuration
-                       Name="Release|Win32"
-                       OutputDirectory="f:\amiga"
-                       IntermediateDirectory=".\Release"
+                       Name="TestRelease|Win32"
+                       IntermediateDirectory="$(ConfigurationName)"
                        ConfigurationType="1"
-                       UseOfMFC="0"
-                       ATLMinimizesCRunTimeLibraryUsage="false"
-                       CharacterSet="2"
                        >
                        <Tool
                                Name="VCPreBuildEventTool"
                        />
                        <Tool
                                Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="true"
-                               SuppressStartupBanner="true"
-                               TargetEnvironment="1"
-                               TypeLibraryName=".\Release/winuae_msvc.tlb"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               Optimization="3"
-                               InlineFunctionExpansion="1"
-                               EnableIntrinsicFunctions="true"
-                               FavorSizeOrSpeed="1"
-                               OmitFramePointers="true"
-                               WholeProgramOptimization="false"
-                               AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep"
-                               PreprocessorDefinitions="WINVER=0x0500,WIN32,NDEBUG,_WINDOWS,_WIN32_IE=0x0500,UNIX"
-                               StringPooling="true"
-                               ExceptionHandling="0"
-                               BasicRuntimeChecks="0"
-                               RuntimeLibrary="0"
-                               BufferSecurityCheck="false"
-                               EnableFunctionLevelLinking="false"
-                               EnableEnhancedInstructionSet="0"
-                               FloatingPointModel="0"
-                               TreatWChar_tAsBuiltInType="false"
-                               RuntimeTypeInfo="false"
-                               UsePrecompiledHeader="0"
-                               PrecompiledHeaderFile=".\Release/winuae_msvc.pch"
-                               AssemblerListingLocation=".\Release/"
-                               ObjectFile=".\Release/"
-                               ProgramDataBaseFileName=".\Release/"
-                               WarningLevel="3"
-                               SuppressStartupBanner="true"
-                               CompileAs="0"
-                               DisableSpecificWarnings="4996"
-                               ForcedIncludeFiles=""
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               Culture="1033"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib dxerr8.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib"
-                               OutputFile="f:\amiga\winuae.exe"
-                               LinkIncremental="1"
-                               SuppressStartupBanner="true"
-                               AdditionalLibraryDirectories=""
-                               GenerateManifest="true"
-                               AdditionalManifestDependencies=""
-                               DelayLoadDLLs="setupapi.dll"
-                               GenerateDebugInformation="true"
-                               ProgramDatabaseFile=".\Release/winuae.pdb"
-                               SubSystem="2"
-                               StackReserveSize="2621440"
-                               StackCommitSize="2621440"
-                               OptimizeReferences="2"
-                               EnableCOMDATFolding="2"
-                               OptimizeForWindows98="0"
-                               LinkTimeCodeGeneration="0"
-                               TargetMachine="1"
                        />
                        <Tool
                                Name="VCALinkTool"
                        />
                        <Tool
                                Name="VCManifestTool"
-                               AdditionalManifestFiles="..\resources\winuae.exe.manifest"
-                               SuppressStartupBanner="false"
-                               VerboseOutput="true"
                        />
                        <Tool
                                Name="VCXDCMakeTool"
                        />
                </Configuration>
                <Configuration
-                       Name="Release|x64"
-                       OutputDirectory="$(SolutionDir)x64\$(ConfigurationName)"
-                       IntermediateDirectory="x64\$(ConfigurationName)"
+                       Name="Release64|Win32"
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+                       IntermediateDirectory="$(ConfigurationName)"
                        ConfigurationType="1"
-                       UseOfMFC="0"
-                       ATLMinimizesCRunTimeLibraryUsage="false"
-                       CharacterSet="2"
                        >
                        <Tool
                                Name="VCPreBuildEventTool"
                        />
                        <Tool
                                Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="true"
-                               SuppressStartupBanner="true"
-                               TargetEnvironment="3"
-                               TypeLibraryName=".\Release/winuae_msvc.tlb"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               Optimization="3"
-                               InlineFunctionExpansion="1"
-                               EnableIntrinsicFunctions="true"
-                               FavorSizeOrSpeed="1"
-                               OmitFramePointers="true"
-                               WholeProgramOptimization="false"
-                               AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep"
-                               PreprocessorDefinitions="WINVER=0x0500,WIN32,NDEBUG,_WINDOWS,ZLIB_DLL,_WIN32_IE 0x0500,WIN64,_WIN64,UNIX"
-                               StringPooling="true"
-                               ExceptionHandling="0"
-                               BasicRuntimeChecks="0"
-                               RuntimeLibrary="0"
-                               BufferSecurityCheck="false"
-                               EnableFunctionLevelLinking="true"
-                               EnableEnhancedInstructionSet="0"
-                               FloatingPointModel="0"
-                               TreatWChar_tAsBuiltInType="false"
-                               RuntimeTypeInfo="false"
-                               UsePrecompiledHeader="0"
-                               PrecompiledHeaderFile=".\Release/winuae_msvc.pch"
-                               AssemblerListingLocation=".\Release/"
-                               ObjectFile=".\Release/"
-                               ProgramDataBaseFileName=".\Release/"
-                               WarningLevel="3"
-                               SuppressStartupBanner="true"
-                               CompileAs="1"
-                               DisableSpecificWarnings="4996"
-                               ForcedIncludeFiles=""
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               Culture="1033"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib setupapi.lib wininet.lib dxerr8.lib shlwapi.lib"
-                               ShowProgress="0"
-                               OutputFile="d:\amiga\winuae64.exe"
-                               LinkIncremental="1"
-                               SuppressStartupBanner="true"
-                               AdditionalLibraryDirectories=""
-                               GenerateManifest="true"
-                               DelayLoadDLLs=""
-                               GenerateDebugInformation="true"
-                               ProgramDatabaseFile=".\Release/winuae.pdb"
-                               SubSystem="2"
-                               StackReserveSize="0"
-                               StackCommitSize="0"
-                               OptimizeReferences="2"
-                               EnableCOMDATFolding="2"
-                               OptimizeForWindows98="0"
-                               LinkTimeCodeGeneration="0"
-                               TargetMachine="17"
                        />
                        <Tool
                                Name="VCALinkTool"
                        />
                </Configuration>
                <Configuration
-                       Name="TestRelease|Win32"
+                       Name="Debug64|Win32"
+                       OutputDirectory="$(ConfigurationName)"
                        IntermediateDirectory="$(ConfigurationName)"
                        ConfigurationType="1"
+                       UseOfMFC="0"
+                       ATLMinimizesCRunTimeLibraryUsage="false"
+                       CharacterSet="2"
                        >
                        <Tool
                                Name="VCPreBuildEventTool"
                        />
                        <Tool
                                Name="VCMIDLTool"
+                               PreprocessorDefinitions="_DEBUG"
+                               MkTypLibCompatible="true"
+                               SuppressStartupBanner="true"
+                               TargetEnvironment="1"
+                               TypeLibraryName=".\Debug/winuae_msvc.tlb"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
+                               AdditionalOptions=""
+                               Optimization="0"
+                               AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep"
+                               PreprocessorDefinitions="WINVER=0x0500,_DEBUG,WIN32,_WINDOWS,ZLIB_DLL,OPENGL_SUPPORT,_WIN32_IE 0x0500,UNIX"
+                               ExceptionHandling="0"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="1"
+                               BufferSecurityCheck="true"
+                               RuntimeTypeInfo="true"
+                               PrecompiledHeaderFile=".\Debug/winuae_msvc.pch"
+                               AssemblerListingLocation=".\Debug/"
+                               ObjectFile=".\Debug/"
+                               ProgramDataBaseFileName=".\Debug/"
+                               WarningLevel="3"
+                               SuppressStartupBanner="true"
+                               Detect64BitPortabilityProblems="true"
+                               DebugInformationFormat="4"
+                               CompileAs="0"
+                               DisableSpecificWarnings="4996"
+                               EnablePREfast="false"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCResourceCompilerTool"
+                               PreprocessorDefinitions="_DEBUG"
+                               Culture="1033"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
                        />
                        <Tool
                                Name="VCLinkerTool"
+                               AdditionalOptions="/MACHINE:I386"
+                               AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib zdll.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib capsimg.lib dxerr8.lib shlwapi.lib"
+                               OutputFile="d:\amiga\winuae.exe"
+                               LinkIncremental="2"
+                               SuppressStartupBanner="true"
+                               GenerateManifest="false"
+                               DelayLoadDLLs="setupapi.dll"
+                               GenerateDebugInformation="true"
+                               ProgramDatabaseFile=".\Debug/winuae.pdb"
+                               SubSystem="2"
+                               StackReserveSize="2621440"
+                               StackCommitSize="2621440"
                        />
                        <Tool
                                Name="VCALinkTool"
                        />
                </Configuration>
                <Configuration
-                       Name="TestRelease|x64"
-                       OutputDirectory="$(SolutionDir)x64\$(ConfigurationName)"
+                       Name="Debug|x64"
+                       OutputDirectory="x64\$(ConfigurationName)"
                        IntermediateDirectory="x64\$(ConfigurationName)"
                        ConfigurationType="1"
                        UseOfMFC="0"
                        />
                        <Tool
                                Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
+                               PreprocessorDefinitions="_DEBUG"
                                MkTypLibCompatible="true"
                                SuppressStartupBanner="true"
                                TargetEnvironment="3"
-                               TypeLibraryName=".\Release/winuae_msvc.tlb"
+                               TypeLibraryName=".\Debug/winuae_msvc.tlb"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalOptions="/Oy-"
+                               AdditionalOptions=""
                                Optimization="0"
-                               InlineFunctionExpansion="1"
-                               EnableIntrinsicFunctions="true"
-                               FavorSizeOrSpeed="0"
-                               OmitFramePointers="false"
                                AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep"
-                               PreprocessorDefinitions="WINVER=0x0500,WIN32,NDEBUG,_WINDOWS,ZLIB_DLL,_WIN32_IE 0x0500,UNIX;WIN64"
-                               StringPooling="true"
+                               PreprocessorDefinitions="WINVER=0x0500,_DEBUG,WIN32,_WINDOWS,ZLIB_DLL,OPENGL_SUPPORT,_WIN32_IE 0x0500,UNIX;WIN64"
                                ExceptionHandling="0"
-                               RuntimeLibrary="0"
-                               BufferSecurityCheck="false"
-                               EnableFunctionLevelLinking="true"
-                               EnableEnhancedInstructionSet="0"
-                               TreatWChar_tAsBuiltInType="false"
-                               RuntimeTypeInfo="false"
-                               UsePrecompiledHeader="0"
-                               PrecompiledHeaderFile=".\Release/winuae_msvc.pch"
-                               AssemblerListingLocation=".\TestRelease/"
-                               ObjectFile=".\TestRelease/"
-                               ProgramDataBaseFileName=".\TestRelease/"
+                               BasicRuntimeChecks="3"
+                               RuntimeLibrary="1"
+                               BufferSecurityCheck="true"
+                               RuntimeTypeInfo="true"
+                               PrecompiledHeaderFile=".\Debug/winuae_msvc.pch"
+                               AssemblerListingLocation=".\Debug/"
+                               ObjectFile=".\Debug/"
+                               ProgramDataBaseFileName=".\Debug/"
                                WarningLevel="3"
                                SuppressStartupBanner="true"
-                               CompileAs="1"
-                               ForcedIncludeFiles=""
+                               Detect64BitPortabilityProblems="true"
+                               DebugInformationFormat="3"
+                               CompileAs="0"
+                               DisableSpecificWarnings="4996"
+                               EnablePREfast="false"
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG"
+                               PreprocessorDefinitions="_DEBUG"
                                Culture="1033"
                        />
                        <Tool
                                Name="VCLinkerTool"
                                AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib zlib1.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib capsimg.lib dxerr8.lib shlwapi.lib"
                                OutputFile="d:\amiga\winuae.exe"
-                               LinkIncremental="1"
+                               LinkIncremental="2"
                                SuppressStartupBanner="true"
+                               GenerateManifest="false"
                                DelayLoadDLLs="setupapi.dll"
                                GenerateDebugInformation="true"
-                               ProgramDatabaseFile=".\Release/winuae.pdb"
+                               ProgramDatabaseFile=".\Debug/winuae.pdb"
                                SubSystem="2"
                                StackReserveSize="2621440"
                                StackCommitSize="2621440"
-                               OptimizeReferences="2"
-                               EnableCOMDATFolding="2"
-                               OptimizeForWindows98="0"
                                TargetMachine="17"
                        />
                        <Tool
                        />
                </Configuration>
                <Configuration
-                       Name="Release64|Win32"
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
+                       Name="Release|x64"
+                       OutputDirectory="$(SolutionDir)x64\$(ConfigurationName)"
+                       IntermediateDirectory="x64\$(ConfigurationName)"
                        ConfigurationType="1"
+                       UseOfMFC="0"
+                       ATLMinimizesCRunTimeLibraryUsage="false"
+                       CharacterSet="2"
                        >
                        <Tool
                                Name="VCPreBuildEventTool"
                        />
                        <Tool
                                Name="VCMIDLTool"
+                               PreprocessorDefinitions="NDEBUG"
+                               MkTypLibCompatible="true"
+                               SuppressStartupBanner="true"
+                               TargetEnvironment="3"
+                               TypeLibraryName=".\Release/winuae_msvc.tlb"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
+                               Optimization="3"
+                               InlineFunctionExpansion="1"
+                               EnableIntrinsicFunctions="true"
+                               FavorSizeOrSpeed="1"
+                               OmitFramePointers="true"
+                               WholeProgramOptimization="false"
+                               AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep"
+                               PreprocessorDefinitions="WINVER=0x0500,WIN32,NDEBUG,_WINDOWS,ZLIB_DLL,_WIN32_IE 0x0500,WIN64,_WIN64,UNIX"
+                               StringPooling="true"
+                               ExceptionHandling="0"
+                               BasicRuntimeChecks="0"
+                               RuntimeLibrary="0"
+                               BufferSecurityCheck="false"
+                               EnableFunctionLevelLinking="true"
+                               EnableEnhancedInstructionSet="0"
+                               FloatingPointModel="0"
+                               TreatWChar_tAsBuiltInType="false"
+                               RuntimeTypeInfo="false"
+                               UsePrecompiledHeader="0"
+                               PrecompiledHeaderFile=".\Release/winuae_msvc.pch"
+                               AssemblerListingLocation=".\Release/"
+                               ObjectFile=".\Release/"
+                               ProgramDataBaseFileName=".\Release/"
+                               WarningLevel="3"
+                               SuppressStartupBanner="true"
+                               CompileAs="1"
+                               DisableSpecificWarnings="4996"
+                               ForcedIncludeFiles=""
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCResourceCompilerTool"
+                               PreprocessorDefinitions="NDEBUG"
+                               Culture="1033"
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
                        />
                        <Tool
                                Name="VCLinkerTool"
+                               AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib setupapi.lib wininet.lib dxerr8.lib shlwapi.lib"
+                               ShowProgress="0"
+                               OutputFile="d:\amiga\winuae64.exe"
+                               LinkIncremental="1"
+                               SuppressStartupBanner="true"
+                               AdditionalLibraryDirectories=""
+                               GenerateManifest="true"
+                               DelayLoadDLLs=""
+                               GenerateDebugInformation="true"
+                               ProgramDatabaseFile=".\Release/winuae.pdb"
+                               SubSystem="2"
+                               StackReserveSize="0"
+                               StackCommitSize="0"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               OptimizeForWindows98="0"
+                               LinkTimeCodeGeneration="0"
+                               TargetMachine="17"
                        />
                        <Tool
                                Name="VCALinkTool"
                        />
                </Configuration>
                <Configuration
-                       Name="Release64|x64"
+                       Name="TestRelease|x64"
                        OutputDirectory="$(SolutionDir)x64\$(ConfigurationName)"
                        IntermediateDirectory="x64\$(ConfigurationName)"
                        ConfigurationType="1"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               Optimization="3"
+                               AdditionalOptions="/Oy-"
+                               Optimization="0"
                                InlineFunctionExpansion="1"
                                EnableIntrinsicFunctions="true"
-                               FavorSizeOrSpeed="1"
-                               OmitFramePointers="true"
-                               WholeProgramOptimization="false"
+                               FavorSizeOrSpeed="0"
+                               OmitFramePointers="false"
                                AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep"
-                               PreprocessorDefinitions="WINVER=0x0500,WIN32,NDEBUG,_WINDOWS,_WIN32_IE 0x0500,UNIX;WIN64"
+                               PreprocessorDefinitions="WINVER=0x0500,WIN32,NDEBUG,_WINDOWS,ZLIB_DLL,_WIN32_IE 0x0500,UNIX;WIN64"
                                StringPooling="true"
                                ExceptionHandling="0"
-                               BasicRuntimeChecks="0"
                                RuntimeLibrary="0"
                                BufferSecurityCheck="false"
-                               EnableFunctionLevelLinking="false"
+                               EnableFunctionLevelLinking="true"
                                EnableEnhancedInstructionSet="0"
-                               FloatingPointModel="0"
                                TreatWChar_tAsBuiltInType="false"
                                RuntimeTypeInfo="false"
                                UsePrecompiledHeader="0"
-                               PrecompiledHeaderFile=".\Release64/winuae_msvc.pch"
-                               AssemblerListingLocation=".\Release64/"
-                               ObjectFile=".\Release64/"
-                               ProgramDataBaseFileName=".\Release64/"
+                               PrecompiledHeaderFile=".\Release/winuae_msvc.pch"
+                               AssemblerListingLocation=".\TestRelease/"
+                               ObjectFile=".\TestRelease/"
+                               ProgramDataBaseFileName=".\TestRelease/"
                                WarningLevel="3"
                                SuppressStartupBanner="true"
-                               Detect64BitPortabilityProblems="true"
                                CompileAs="1"
-                               DisableSpecificWarnings="4996"
                                ForcedIncludeFiles=""
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib dxerr8.lib shlwapi.lib zlib.lib"
-                               OutputFile="d:\amiga\winuae64.exe"
+                               AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib zlib1.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib capsimg.lib dxerr8.lib shlwapi.lib"
+                               OutputFile="d:\amiga\winuae.exe"
                                LinkIncremental="1"
                                SuppressStartupBanner="true"
-                               AdditionalLibraryDirectories=""
-                               GenerateManifest="true"
-                               DelayLoadDLLs=""
+                               DelayLoadDLLs="setupapi.dll"
                                GenerateDebugInformation="true"
-                               ProgramDatabaseFile=".\Release64/winuae.pdb"
+                               ProgramDatabaseFile=".\Release/winuae.pdb"
                                SubSystem="2"
                                StackReserveSize="2621440"
                                StackCommitSize="2621440"
                                OptimizeReferences="2"
                                EnableCOMDATFolding="2"
                                OptimizeForWindows98="0"
-                               LinkTimeCodeGeneration="0"
                                TargetMachine="17"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCManifestTool"
-                               AdditionalManifestFiles="..\resources\winuae.exe.manifest"
                        />
                        <Tool
                                Name="VCXDCMakeTool"
                        />
                </Configuration>
                <Configuration
-                       Name="Debug64|Win32"
-                       OutputDirectory="$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
+                       Name="Release64|x64"
+                       OutputDirectory="$(SolutionDir)x64\$(ConfigurationName)"
+                       IntermediateDirectory="x64\$(ConfigurationName)"
                        ConfigurationType="1"
                        UseOfMFC="0"
                        ATLMinimizesCRunTimeLibraryUsage="false"
                        />
                        <Tool
                                Name="VCMIDLTool"
-                               PreprocessorDefinitions="_DEBUG"
+                               PreprocessorDefinitions="NDEBUG"
                                MkTypLibCompatible="true"
                                SuppressStartupBanner="true"
-                               TargetEnvironment="1"
-                               TypeLibraryName=".\Debug/winuae_msvc.tlb"
+                               TargetEnvironment="3"
+                               TypeLibraryName=".\Release/winuae_msvc.tlb"
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               AdditionalOptions=""
-                               Optimization="0"
+                               Optimization="3"
+                               InlineFunctionExpansion="1"
+                               EnableIntrinsicFunctions="true"
+                               FavorSizeOrSpeed="1"
+                               OmitFramePointers="true"
+                               WholeProgramOptimization="false"
                                AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep"
-                               PreprocessorDefinitions="WINVER=0x0500,_DEBUG,WIN32,_WINDOWS,ZLIB_DLL,OPENGL_SUPPORT,_WIN32_IE 0x0500,UNIX"
+                               PreprocessorDefinitions="WINVER=0x0500,WIN32,NDEBUG,_WINDOWS,_WIN32_IE 0x0500,UNIX;WIN64"
+                               StringPooling="true"
                                ExceptionHandling="0"
-                               BasicRuntimeChecks="3"
-                               RuntimeLibrary="1"
-                               BufferSecurityCheck="true"
-                               RuntimeTypeInfo="true"
-                               PrecompiledHeaderFile=".\Debug/winuae_msvc.pch"
-                               AssemblerListingLocation=".\Debug/"
-                               ObjectFile=".\Debug/"
-                               ProgramDataBaseFileName=".\Debug/"
+                               BasicRuntimeChecks="0"
+                               RuntimeLibrary="0"
+                               BufferSecurityCheck="false"
+                               EnableFunctionLevelLinking="false"
+                               EnableEnhancedInstructionSet="0"
+                               FloatingPointModel="0"
+                               TreatWChar_tAsBuiltInType="false"
+                               RuntimeTypeInfo="false"
+                               UsePrecompiledHeader="0"
+                               PrecompiledHeaderFile=".\Release64/winuae_msvc.pch"
+                               AssemblerListingLocation=".\Release64/"
+                               ObjectFile=".\Release64/"
+                               ProgramDataBaseFileName=".\Release64/"
                                WarningLevel="3"
                                SuppressStartupBanner="true"
                                Detect64BitPortabilityProblems="true"
-                               DebugInformationFormat="4"
-                               CompileAs="0"
+                               CompileAs="1"
                                DisableSpecificWarnings="4996"
-                               EnablePREfast="false"
+                               ForcedIncludeFiles=""
                        />
                        <Tool
                                Name="VCManagedResourceCompilerTool"
                        />
                        <Tool
                                Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="_DEBUG"
+                               PreprocessorDefinitions="NDEBUG"
                                Culture="1033"
                        />
                        <Tool
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalOptions="/MACHINE:I386"
-                               AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib zdll.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib capsimg.lib dxerr8.lib shlwapi.lib"
-                               OutputFile="d:\amiga\winuae.exe"
-                               LinkIncremental="2"
+                               AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib dxerr8.lib shlwapi.lib zlib.lib"
+                               OutputFile="d:\amiga\winuae64.exe"
+                               LinkIncremental="1"
                                SuppressStartupBanner="true"
-                               GenerateManifest="false"
-                               DelayLoadDLLs="setupapi.dll"
+                               AdditionalLibraryDirectories=""
+                               GenerateManifest="true"
+                               DelayLoadDLLs=""
                                GenerateDebugInformation="true"
-                               ProgramDatabaseFile=".\Debug/winuae.pdb"
+                               ProgramDatabaseFile=".\Release64/winuae.pdb"
                                SubSystem="2"
                                StackReserveSize="2621440"
                                StackCommitSize="2621440"
+                               OptimizeReferences="2"
+                               EnableCOMDATFolding="2"
+                               OptimizeForWindows98="0"
+                               LinkTimeCodeGeneration="0"
+                               TargetMachine="17"
                        />
                        <Tool
                                Name="VCALinkTool"
                        />
                        <Tool
                                Name="VCManifestTool"
+                               AdditionalManifestFiles="..\resources\winuae.exe.manifest"
                        />
                        <Tool
                                Name="VCXDCMakeTool"
                                                />
                                        </FileConfiguration>
                                        <FileConfiguration
-                                               Name="Debug|x64"
+                                               Name="Release|Win32"
                                                >
                                                <Tool
                                                        Name="VCResourceCompilerTool"
                                                />
                                        </FileConfiguration>
                                        <FileConfiguration
-                                               Name="Release|Win32"
+                                               Name="Debug64|Win32"
                                                >
                                                <Tool
                                                        Name="VCResourceCompilerTool"
                                                />
                                        </FileConfiguration>
                                        <FileConfiguration
-                                               Name="Release|x64"
+                                               Name="Debug|x64"
                                                >
                                                <Tool
                                                        Name="VCResourceCompilerTool"
                                                />
                                        </FileConfiguration>
                                        <FileConfiguration
-                                               Name="TestRelease|x64"
+                                               Name="Release|x64"
                                                >
                                                <Tool
                                                        Name="VCResourceCompilerTool"
                                                />
                                        </FileConfiguration>
                                        <FileConfiguration
-                                               Name="Release64|x64"
+                                               Name="TestRelease|x64"
                                                >
                                                <Tool
                                                        Name="VCResourceCompilerTool"
                                                />
                                        </FileConfiguration>
                                        <FileConfiguration
-                                               Name="Debug64|Win32"
+                                               Name="Release64|x64"
                                                >
                                                <Tool
                                                        Name="VCResourceCompilerTool"
old mode 100755 (executable)
new mode 100644 (file)
index 8545196..6cec7f8
@@ -1,8 +1,69 @@
 
-- CPU emulation changes needed for some new future features, will
-  explain later, not yet finished.. breakage possible.
+Beta 2:
+
+- fixed possible crash when input recording stops (introduced in b1)
+- log memory map after reset and also after autoconfig
+- log loaded KS ROM information in memory map dump
+- fixed boot crash (some CPU/KS combinations only)
+- bug in new event handler fixed (symptom was random really slow
+  non-ce/non-immediate blitter)
+- interrupt priorities are correct again (broke in b1) Some tweaks.
+- filesystem flag emulation updates (again) Protection flags on FAT
+  volumes should now work properly in non-UAEFSDB mode.
+- filesystem directory protection flags supported (on FAT volumes)
+  Very old comment says: "Unix dirs behave differently than AmigaOS
+  ones. windows dirs go where no dir has gone before..." Perhaps
+  Windows 95 had some issues? Hope I didn't miss something..
+
+Beta 1:
+
+- dms files inside archives automatically added to disk history
+- Windows98/ME direct MK4 catweasel support. Need command line
+  parameter "-directcatweasel 0xyzzzz". y = CW model (3 or 4,
+  3 is default), zzzz is io address in hexadecimal. (simple, quick
+  workaround if someone really wants to use MK3/4 under 98/ME for
+  some unknown reason) IO address in configuration file is obsoleted
+  (was never compatible with CW joystick or mouse port detection)
+- Catweasel MK4 mouse support fixed (broke in 1.3.3)
+- Catweasel direct mode automatically enabled if Windows is 2000
+  or newer, IO library is installed and CW driver is not installed
+  (previously was automatically enabled only if OS was 64-bit)
+- compiler updated to beta SP1. I am very anti-"don't fix it if it
+  is not broken" person but I think you must already know it :)
+- updated to latest Windows SDK
+- winuaeclipboard crash fix (BR)
+- finally replaced really ugly interrupt delay hack with more
+  cleaner and accurate method (fixes Fun School 4)
+- made non-ce "more compatible" CPU emulators' main loop more
+  compatible with programs requiring delayed interrups
+- windowed mode "leds" had incorrect mouse click positions
+- debugger memwatch "freeze" option now also accepts memory values
+- added separate memory bank function for 680x0 opcode fetches
 - debugger memwatch points can now detect between opcode fetch
-  and data fetch, 68000-only currently. (see above)
+  and data fetch, 68000-only currently.
+- basic self modifying code (SMC) detection implemented in
+  debugger (smc-command) Works in 68000-mode only.
+- Windows Vista rawinput crash fix (weird change in vista..)
+- avioutput sound sync errors fixed (broke in 1.3.3)
+- avioutput video codec type registry saving improved
+- fixed CPU emulation condition code bug caused by compiler bug or
+  undefined C behaviour (not sure yet..) Affected some copy
+  protections. Introduced in E-UAE merge.
+- added horizontal mouse wheel input-panel support (hwheel support
+  added in Windows Vista, not tested)
+- add single "fake" button entry if joystick driver reports zero
+  buttons (PPJoy in two-player mode, no idea if this helps)
+- cleaned up AHI emulation, initialize and start recording only
+  when requested for the first time
+- disk image dragndrop caused instant disk swap instead of delayed
+  swap (eject, wait 1.5s, insert new disk)
+- fixed Windows only bug in new stack magic replacement code, both
+  bsdsocket and AHI leaked Windows handles (SR)
+- less aggressive sound adjustment
+- horizontally scrolling list view selection fix (for example input
+  panel with wide enough key name could have made autofire selection
+  impossible)
+- inputrecording reliability increased (but it still loses sync)
 
 Final 1.3.3
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/rpc.c b/rpc.c
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/svga.c b/svga.c
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/traps.c b/traps.c
old mode 100755 (executable)
new mode 100644 (file)
index 6fc1b37..7085e9c
--- a/traps.c
+++ b/traps.c
@@ -415,6 +415,9 @@ static uae_u32 REGPARAM2 exit_trap_handler (struct regstruct *regs)
     if (context->trap_has_retval)
        m68k_dreg (regs, 0) = context->trap_retval;
 
+#ifdef _WIN32
+    CloseHandle(context->thread);
+#endif
     uae_sem_destroy (&context->switch_to_trap_sem);
     uae_sem_destroy (&context->switch_to_emu_sem);
 
diff --git a/tui.c b/tui.c
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 9a00ad6..33ecf48
 
 static int log_serial = 1;
 
+#define CMD_INVALID    0
+#define CMD_RESET      1
+#define CMD_READ       2
+#define CMD_WRITE      3
+#define CMD_UPDATE     4
+#define CMD_CLEAR      5
+#define CMD_STOP       6
+#define CMD_START      7
+#define CMD_FLUSH      8
+#define SDCMD_QUERY    9
+#define SDCMD_BREAK    10
+#define SDCMD_SETPARAMS        11
+
+#define SerErr_DevBusy        1
+#define SerErr_BaudMismatch    2
+#define SerErr_BufErr         4
+#define SerErr_InvParam        5
+#define SerErr_LineErr        6
+#define SerErr_ParityErr       9
+#define SerErr_TimerErr       11
+#define SerErr_BufOverflow    12
+#define SerErr_NoDSR         13
+#define SerErr_DetectedBreak  15
+
+#define SERB_XDISABLED 7       /* io_SerFlags xOn-xOff feature disabled bit */
+#define SERF_XDISABLED (1<<7)  /*    "     xOn-xOff feature disabled mask */
+#define        SERB_EOFMODE    6       /*    "     EOF mode enabled bit */
+#define        SERF_EOFMODE    (1<<6)  /*    "     EOF mode enabled mask */
+#define        SERB_SHARED     5       /*    "     non-exclusive access bit */
+#define        SERF_SHARED     (1<<5)  /*    "     non-exclusive access mask */
+#define SERB_RAD_BOOGIE 4      /*    "     high-speed mode active bit */
+#define SERF_RAD_BOOGIE (1<<4) /*    "     high-speed mode active mask */
+#define        SERB_QUEUEDBRK  3       /*    "     queue this Break ioRqst */
+#define        SERF_QUEUEDBRK  (1<<3)  /*    "     queue this Break ioRqst */
+#define        SERB_7WIRE      2       /*    "     RS232 7-wire protocol */
+#define        SERF_7WIRE      (1<<2)  /*    "     RS232 7-wire protocol */
+#define        SERB_PARTY_ODD  1       /*    "     parity feature enabled bit */
+#define        SERF_PARTY_ODD  (1<<1)  /*    "     parity feature enabled mask */
+#define        SERB_PARTY_ON   0       /*    "     parity-enabled bit */
+#define        SERF_PARTY_ON   (1<<0)  /*    "     parity-enabled mask */
+
+#define        IO_STATB_XOFFREAD 12       /* io_Status receive currently xOFF'ed bit */
+#define        IO_STATF_XOFFREAD (1<<12)  /*    "     receive currently xOFF'ed mask */
+#define        IO_STATB_XOFFWRITE 11      /*    "     transmit currently xOFF'ed bit */
+#define        IO_STATF_XOFFWRITE (1<<11) /*    "     transmit currently xOFF'ed mask */
+#define        IO_STATB_READBREAK 10      /*    "     break was latest input bit */
+#define        IO_STATF_READBREAK (1<<10) /*    "     break was latest input mask */
+#define        IO_STATB_WROTEBREAK 9      /*    "     break was latest output bit */
+#define        IO_STATF_WROTEBREAK (1<<9) /*    "     break was latest output mask */
+#define        IO_STATB_OVERRUN 8         /*    "     status word RBF overrun bit */
+#define        IO_STATF_OVERRUN (1<<8)    /*    "     status word RBF overrun mask */
+
+#define io_CtlChar     0x30    /* ULONG control char's (order = xON,xOFF,INQ,ACK) */
+#define io_RBufLen     0x34    /* ULONG length in bytes of serial port's read buffer */
+#define io_ExtFlags    0x38    /* ULONG additional serial flags (see bitdefs below) */
+#define io_Baud                0x3c    /* ULONG baud rate requested (true baud) */
+#define io_BrkTime     0x40    /* ULONG duration of break signal in MICROseconds */
+#define io_TermArray0  0x44    /* ULONG termination character array */
+#define io_TermArray1  0x48    /* ULONG termination character array */
+#define io_ReadLen     0x4c    /* UBYTE bits per read character (# of bits) */
+#define io_WriteLen    0x4d    /* UBYTE bits per write character (# of bits) */
+#define io_StopBits    0x4e    /* UBYTE stopbits for read (# of bits) */
+#define io_SerFlags    0x4f    /* UBYTE see SerFlags bit definitions below  */
+#define io_Status      0x50    /* UWORD */
+
+/* status of serial port, as follows:
+*                 BIT  ACTIVE  FUNCTION
+*                  0    ---    reserved
+*                  1    ---    reserved
+*                  2    high   Connected to parallel "select" on the A1000.
+*                              Connected to both the parallel "select" and
+*                              serial "ring indicator" pins on the A500
+*                              & A2000.  Take care when making cables.
+*                  3    low    Data Set Ready
+*                  4    low    Clear To Send
+*                  5    low    Carrier Detect
+*                  6    low    Ready To Send
+*                  7    low    Data Terminal Ready
+*                  8    high   read overrun
+*                  9    high   break sent
+*                 10    high   break received
+*                 11    high   transmit x-OFFed
+*                 12    high   receive x-OFFed
+*              13-15           reserved
+*/
+
+
 struct devstruct {
     int unit;
     char *name;
-    int opencnt;
+    int uniq;
+    int exclusive;
     volatile uaecptr d_request[MAX_ASYNC_REQUESTS];
     volatile int d_request_type[MAX_ASYNC_REQUESTS];
     volatile uae_u32 d_request_data[MAX_ASYNC_REQUESTS];
@@ -45,19 +133,9 @@ struct devstruct {
     uae_sem_t sync_sem;
 };
 
-struct priv_devstruct {
-    int inuse;
-    int unit;
-    int mode;
-    int scsi;
-    int ioctl;
-    int noscsi;
-    int type;
-    int flags; /* OpenDevice() */
-};
+static int uniq;
 
 static struct devstruct devst[MAX_TOTAL_DEVICES];
-static struct priv_devstruct pdevst[MAX_OPEN_DEVICES];
 
 static uae_sem_t change_sem;
 
@@ -80,30 +158,19 @@ static void memcpyha (uae_u32 dst, char *src, int size)
        put_byte (dst++, *src++);
 }
 
-static struct devstruct *getdevstruct (int unit)
+static struct devstruct *getdevstruct (int uniq)
 {
     int i;
     for (i = 0; i < MAX_TOTAL_DEVICES; i++) {
-       if (unit >= 0 && devst[i].unit == unit) return &devst[i];
+       if (devst[i].uniq == uniq)
+           return &devst[i];
     }
     return 0;
 }
 
-static struct priv_devstruct *getpdevstruct (uaecptr request)
-{
-    int i = get_long (request + 24);
-    if (i < 0 || i >= MAX_OPEN_DEVICES || pdevst[i].inuse == 0) {
-       write_log ("serial.device: corrupt iorequest %08.8X %d\n", request, i);
-       return 0;
-    }
-    return &pdevst[i];
-}
-
 static void *dev_thread (void *devs);
 static int start_thread (struct devstruct *dev)
 {
-    if (dev->thread_running)
-        return 1;
     init_comm_pipe (&dev->requests, 100, 1);
     uae_sem_init (&dev->sync_sem, 0, 0);
     uae_start_thread (dev_thread, dev, &dev->tid);
@@ -111,30 +178,24 @@ static int start_thread (struct devstruct *dev)
     return dev->thread_running;
 }
 
-static void dev_close_3 (struct devstruct *dev, struct priv_devstruct *pdev)
+static void dev_close_3 (struct devstruct *dev)
 {
-    if (!dev->opencnt) return;
-    dev->opencnt--;
-    if (!dev->opencnt) {
-       pdev->inuse = 0;
-        write_comm_pipe_u32 (&dev->requests, 0, 1);
-    }
+    dev->unit = -1;
+    xfree(dev->name);
+    write_comm_pipe_u32 (&dev->requests, 0, 1);
 }
 
 static uae_u32 dev_close_2 (void)
 {
     uae_u32 request = m68k_areg (regs, 1);
-    struct priv_devstruct *pdev = getpdevstruct (request);
     struct devstruct *dev;
 
-    if (!pdev)
-       return 0;
-    dev = getdevstruct (pdev->unit);
+    dev = getdevstruct (pdev->uniq);
     if (log_serial)
-       write_log ("%s:%d close, req=%08.8X\n", getdevname (pdev->type), pdev->unit, request);
+       write_log ("%s:%d close, req=%08.8X\n", dev->name, dev->unit, request);
     if (!dev)
        return 0;
-    dev_close_3 (dev, pdev);
+    dev_close_3 (dev);
     put_long (request + 24, 0);
     put_word (m68k_areg(regs, 6) + 32, get_word (m68k_areg(regs, 6) + 32) - 1);
     return 0;
@@ -161,35 +222,30 @@ static uae_u32 dev_open_2 (int type)
     uaecptr ioreq = m68k_areg(regs, 1);
     uae_u32 unit = m68k_dreg (regs, 0);
     uae_u32 flags = m68k_dreg (regs, 1);
-    struct devstruct *dev = getdevstruct (unit);
-    struct priv_devstruct *pdev = 0;
+    struct devstruct *dev;
     int i;
+    char devname[256];
 
     if (log_serial)
        write_log ("opening %s:%d ioreq=%08.8X\n", getdevname (type), unit, ioreq);
-    if (!dev)
-       return openfail (ioreq, 32); /* badunitnum */
-    if (!dev->opencnt) {
-        for (i = 0; i < MAX_OPEN_DEVICES; i++) {
-           pdev = &pdevst[i];
-           if (pdev->inuse == 0) break;
-       }
-        pdev->type = type;
-        pdev->unit = unit;
-       pdev->flags = flags;
-       pdev->inuse = 1;
-        put_long (ioreq + 24, pdev - pdevst);
-       start_thread (dev);
-    } else {
-        for (i = 0; i < MAX_OPEN_DEVICES; i++) {
-           pdev = &pdevst[i];
-           if (pdev->inuse && pdev->unit == unit) break;
-       }
-       if (i == MAX_OPEN_DEVICES)
-           return openfail (ioreq, -1);
-        put_long (ioreq + 24, pdev - pdevst);
+    sprintf(devname,"COM%d", unit);
+    for (i = 0; i < MAX_TOTAL_DEVICES; i++) {
+       if (devst[i].unit == unit && devst[i].exclusive)
+           return openfail (ioreq, -6); /* busy */
     }
-    dev->opencnt++;
+    for (i = 0; i < MAX_TOTAL_DEVICES; i++) {
+       if (devst[i].unit == -1)
+           break;
+    }
+    dev = &devst[i];
+    if (i == MAX_TOTAL_DEVICES)
+       return openfail (ioreq, 32); /* badunitnum */
+    dev->unit = unit;
+    dev->name = my_strdup (devname);
+    dev->uniq = ++uniq;
+    dev->exclusive = (get_word(ioreq + io_SerFlags) & SERF_SHARED) ? 0 : 1;
+    put_long (ioreq + 24, i);
+    start_thread (dev);
 
     put_word (m68k_areg(regs, 6) + 32, get_word (m68k_areg(regs, 6) + 32) + 1);
     put_byte (ioreq + 31, 0);
@@ -206,16 +262,13 @@ static uae_u32 dev_expunge (void)
 {
     return 0;
 }
-static uae_u32 diskdev_expunge (void)
-{
-    return 0;
-}
 
 static int is_async_request (struct devstruct *dev, uaecptr request)
 {
     int i = 0;
     while (i < MAX_ASYNC_REQUESTS) {
-       if (dev->d_request[i] == request) return 1;
+       if (dev->d_request[i] == request)
+           return 1;
        i++;
     }
     return 0;
@@ -295,14 +348,29 @@ static int dev_do_io (struct devstruct *dev, uaecptr request)
     uae_u32 io_offset = get_long (request + 44); // 0x2c
     uae_u32 io_error = 0;
     int async = 0;
-    struct priv_devstruct *pdev = getpdevstruct (request);
+    struct devstruct *dev = getdevstruct (get_long(request + 24));
 
-    if (!pdev)
+    if (!dev)
        return 0;
     command = get_word (request+28);
 
     switch (command)
     {
+       case SDCMD_QUERY:
+       break;
+       case SDCMD_SETPARAMS:
+       break;
+       case CMD_WRITE:
+       break;
+       case CMD_READ:
+       break;
+       case SDCMD_BREAK;
+       case CMD_FLUSH;
+       case CMD_START:
+       case CMD_STOP:
+       case CMD_CLEAR:
+       case CMD_RESET:
+       break;
        default:
        io_error = -3;
        break;
@@ -335,18 +403,17 @@ static uae_u32 dev_beginio (void)
     uae_u32 request = m68k_areg(regs, 1);
     uae_u8 flags = get_byte (request + 30);
     int command = get_word (request + 28);
-    struct priv_devstruct *pdev = getpdevstruct (request);
-    struct devstruct *dev = getdevstruct (pdev->unit);
+    struct devstruct *dev = getdevstruct (get_long(request + 24));
 
     put_byte (request+8, NT_MESSAGE);
-    if (!dev || !pdev) {
+    if (!dev) {
        put_byte (request + 31, 32);
        return get_byte (request + 31);
     }
     put_byte (request+31, 0);
     if ((flags & 1) && dev_canquick (dev, request)) {
        if (dev_do_io (dev, request))
-           write_log ("device %s command %d bug with IO_QUICK\n", getdevname (pdev->type), command);
+           write_log ("device %s:%d command %d bug with IO_QUICK\n", dev->name, dev->unit, command);
        return get_byte (request + 31);
     } else {
         add_async_request (dev, request, ASYNC_REQUEST_TEMP, 0);
@@ -400,38 +467,19 @@ static uae_u32 dev_init (void)
 static uae_u32 dev_abortio (void)
 {
     uae_u32 request = m68k_areg(regs, 1);
-    struct priv_devstruct *pdev = getpdevstruct (request);
-    struct devstruct *dev;
+    struct devstruct *dev = getdevstruct (get_long(request + 24));
 
-    if (!pdev) {
-       put_byte (request + 31, 32);
-       return get_byte (request + 31);
-    }
-    dev = getdevstruct (pdev->unit);
     if (!dev) {
        put_byte (request + 31, 32);
        return get_byte (request + 31);
     }
     put_byte (request + 31, -2);
     if (log_serial)
-       write_log ("abortio %s unit=%d, request=%08.8X\n", getdevname (pdev->type), pdev->unit, request);
+       write_log ("abortio %s:%d, request=%08.8X\n", dev->name, dev->unit, request);
     abort_async (dev, request, -2, 0);
     return 0;
 }
 
-struct uaeserial_info {
-    char *name;
-    int num;
-};
-
-static struct uaeserial_info devices[] = {
-    { "COM1", 1 },
-    { "COM2", 2 },
-    { "COM3", 3 },
-    { "COM4", 4 },
-    { NULL }
-};
-
 static void dev_reset (void)
 {
     int i, j;
@@ -451,14 +499,6 @@ static void dev_reset (void)
        memset (dev, 0, sizeof (struct devstruct));
        dev->unit = -1;
     }
-    for (i = 0; i < MAX_TOTAL_DEVICES; i++) {
-       dev = &devst[i];
-       uaedev = &devices[i];
-       if (!dev->name)
-           break;
-       dev->unit = uaedev->num;
-       dev->name = strdup (uaedev->name);
-    }
 }
 
 static uaecptr ROM_serialdev_resname = 0,
diff --git a/unzip.c b/unzip.c
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/zfile.c b/zfile.c
old mode 100755 (executable)
new mode 100644 (file)
index 58b5d3e..c8ef31e
--- a/zfile.c
+++ b/zfile.c
@@ -343,7 +343,7 @@ static struct zfile *dms (struct zfile *z)
 const char *uae_ignoreextensions[] =
     { ".gif", ".jpg", ".png", ".xml", ".pdf", ".txt", 0 };
 const char *uae_diskimageextensions[] =
-    { ".adf", ".adz", ".ipf", ".fdi", ".exe", 0 };
+    { ".adf", ".adz", ".ipf", ".fdi", ".exe", ".dms", 0 };
 
 
 int zfile_is_ignore_ext(const char *name)