]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc2020b11.zip
authorToni Wilen <twilen@winuae.net>
Sat, 13 Feb 2010 11:46:34 +0000 (13:46 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 20:17:29 +0000 (22:17 +0200)
261 files changed:
a2065.cpp [moved from a2065.c with 99% similarity]
a2091.cpp [moved from a2091.c with 99% similarity]
adide.cpp [moved from adide.c with 100% similarity]
akiko.cpp [moved from akiko.c with 99% similarity]
akiko2.cpp [moved from akiko2.c with 100% similarity]
amax.cpp [moved from amax.c with 98% similarity]
ar.cpp [moved from ar.c with 99% similarity]
arcadia.cpp [moved from arcadia.c with 98% similarity]
archivers/7z/7zBuf.cpp [moved from archivers/7z/7zBuf.c with 100% similarity]
archivers/7z/7zCrc.cpp [moved from archivers/7z/7zCrc.c with 100% similarity]
archivers/7z/7zStream.cpp [moved from archivers/7z/7zStream.c with 100% similarity]
archivers/7z/Archive/7z/7zAlloc.cpp [moved from archivers/7z/Archive/7z/7zAlloc.c with 100% similarity]
archivers/7z/Archive/7z/7zDecode.cpp [moved from archivers/7z/Archive/7z/7zDecode.c with 100% similarity]
archivers/7z/Archive/7z/7zExtract.cpp [moved from archivers/7z/Archive/7z/7zExtract.c with 100% similarity]
archivers/7z/Archive/7z/7zHeader.cpp [moved from archivers/7z/Archive/7z/7zHeader.c with 100% similarity]
archivers/7z/Archive/7z/7zIn.cpp [moved from archivers/7z/Archive/7z/7zIn.c with 100% similarity]
archivers/7z/Archive/7z/7zItem.cpp [moved from archivers/7z/Archive/7z/7zItem.c with 100% similarity]
archivers/7z/Bcj2.cpp [moved from archivers/7z/Bcj2.c with 100% similarity]
archivers/7z/Bra.cpp [moved from archivers/7z/Bra.c with 100% similarity]
archivers/7z/Bra86.cpp [moved from archivers/7z/Bra86.c with 100% similarity]
archivers/7z/LzmaDec.cpp [moved from archivers/7z/LzmaDec.c with 100% similarity]
archivers/dms/crc_csum.cpp [moved from archivers/dms/crc_csum.c with 100% similarity]
archivers/dms/getbits.cpp [moved from archivers/dms/getbits.c with 100% similarity]
archivers/dms/maketbl.cpp [moved from archivers/dms/maketbl.c with 100% similarity]
archivers/dms/pfile.cpp [moved from archivers/dms/pfile.c with 98% similarity]
archivers/dms/tables.cpp [moved from archivers/dms/tables.c with 100% similarity]
archivers/dms/u_deep.cpp [moved from archivers/dms/u_deep.c with 95% similarity]
archivers/dms/u_heavy.cpp [moved from archivers/dms/u_heavy.c with 98% similarity]
archivers/dms/u_init.cpp [moved from archivers/dms/u_init.c with 100% similarity]
archivers/dms/u_medium.cpp [moved from archivers/dms/u_medium.c with 100% similarity]
archivers/dms/u_quick.cpp [moved from archivers/dms/u_quick.c with 100% similarity]
archivers/dms/u_rle.cpp [moved from archivers/dms/u_rle.c with 100% similarity]
archivers/lha/crcio.cpp [moved from archivers/lha/crcio.c with 91% similarity]
archivers/lha/dhuf.cpp [moved from archivers/lha/dhuf.c with 95% similarity]
archivers/lha/header.cpp [moved from archivers/lha/header.c with 94% similarity]
archivers/lha/huf.cpp [moved from archivers/lha/huf.c with 95% similarity]
archivers/lha/larc.cpp [moved from archivers/lha/larc.c with 89% similarity]
archivers/lha/lha.h
archivers/lha/lhamaketbl.cpp [moved from archivers/lha/lhamaketbl.c with 92% similarity]
archivers/lha/lharc.cpp [moved from archivers/lha/lharc.c with 89% similarity]
archivers/lha/shuf.cpp [moved from archivers/lha/shuf.c with 91% similarity]
archivers/lha/slide.cpp [moved from archivers/lha/slide.c with 99% similarity]
archivers/lha/uae_lha.cpp [moved from archivers/lha/uae_lha.c with 99% similarity]
archivers/lha/util.cpp [moved from archivers/lha/util.c with 96% similarity]
archivers/lzx/unlzx.cpp [moved from archivers/lzx/unlzx.c with 98% similarity]
archivers/wrp/warp.c [deleted file]
archivers/wrp/warp.cpp [new file with mode: 0644]
archivers/xfd/main.cpp [moved from archivers/xfd/main.c with 100% similarity]
archivers/xfd/xfd.cpp [moved from archivers/xfd/xfd.c with 100% similarity]
archivers/zip/unzip.cpp [moved from archivers/zip/unzip.c with 91% similarity]
audio.cpp [moved from audio.c with 99% similarity]
autoconf.cpp [moved from autoconf.c with 99% similarity]
blitops.cpp [moved from blitops.c with 100% similarity]
blitter.cpp [moved from blitter.c with 99% similarity]
blkdev.cpp [moved from blkdev.c with 98% similarity]
blkdev_cdimage.cpp [moved from blkdev_cdimage.c with 99% similarity]
bsdsocket.cpp [moved from bsdsocket.c with 98% similarity]
build68k.cpp [moved from build68k.c with 100% similarity]
catweasel.cpp [moved from catweasel.c with 99% similarity]
cd32_fmv.cpp [moved from cd32_fmv.c with 99% similarity]
cdrom.cpp [moved from cdrom.c with 100% similarity]
cdtv.cpp [moved from cdtv.c with 100% similarity]
cfgfile.cpp [moved from cfgfile.c with 99% similarity]
cia.cpp [moved from cia.c with 99% similarity]
consolehook.cpp [moved from consolehook.c with 96% similarity]
core.cw4.cpp [moved from core.cw4.c with 100% similarity]
cpummu.cpp [moved from cpummu.c with 100% similarity]
cpuopti.cpp [moved from cpuopti.c with 100% similarity]
crc32.cpp [moved from crc32.c with 96% similarity]
custom.cpp [moved from custom.c with 99% similarity]
debug.cpp [moved from debug.c with 98% similarity]
disk.cpp [moved from disk.c with 98% similarity]
diskutil.cpp [moved from diskutil.c with 100% similarity]
dongle.cpp [moved from dongle.c with 100% similarity]
drawing.cpp [moved from drawing.c with 99% similarity]
driveclick.cpp [moved from driveclick.c with 98% similarity]
enforcer.cpp [moved from enforcer.c with 99% similarity]
epsonprinter.cpp [moved from epsonprinter.c with 99% similarity]
ersatz.cpp [moved from ersatz.c with 100% similarity]
expansion.cpp [moved from expansion.c with 99% similarity]
fdi2raw.cpp [moved from fdi2raw.c with 99% similarity]
filesys.cpp [moved from filesys.c with 96% similarity]
filesys_bootrom.cpp [moved from filesys_bootrom.c with 100% similarity]
fpp.cpp [moved from fpp.c with 99% similarity]
fsdb.cpp [moved from fsdb.c with 94% similarity]
fsdb_unix.cpp [moved from fsdb_unix.c with 100% similarity]
fsusage.cpp [moved from fsusage.c with 100% similarity]
gayle.cpp [moved from gayle.c with 98% similarity]
genblitter.cpp [moved from genblitter.c with 100% similarity]
gencpu.cpp [moved from gencpu.c with 99% similarity]
gencpu_mini.cpp [moved from gencpu_mini.c with 100% similarity]
gengenblitter.cpp [moved from gengenblitter.c with 100% similarity]
genlinetoscr.cpp [moved from genlinetoscr.c with 98% similarity]
genp2c.cpp [moved from genp2c.c with 100% similarity]
gfxlib.cpp [moved from gfxlib.c with 100% similarity]
gfxutil.cpp [moved from gfxutil.c with 100% similarity]
gtkui.cpp [moved from gtkui.c with 100% similarity]
hardfile.cpp [moved from hardfile.c with 97% similarity]
hrtmon.rom.cpp [moved from hrtmon.rom.c with 100% similarity]
identify.cpp [moved from identify.c with 100% similarity]
include/blkdev.h
include/bsdsocket.h
include/cpu_prefetch.h
include/debug.h
include/disk.h
include/driveclick.h
include/filesys.h
include/fsdb.h
include/fsusage.h
include/gfxfilter.h
include/memory.h
include/moduleripper.h
include/newcpu.h
include/options.h
include/readcpu.h
include/sysdeps.h
include/xwin.h
include/zarchive.h
include/zfile.h
inprec.cpp [moved from inprec.c with 100% similarity]
inputdevice.cpp [moved from inputdevice.c with 99% similarity]
jit/codegen_x86.cpp [moved from jit/codegen_x86.c with 100% similarity]
jit/compemu_fpp.cpp [moved from jit/compemu_fpp.c with 100% similarity]
jit/compemu_optimizer_x86.cpp [moved from jit/compemu_optimizer_x86.c with 100% similarity]
jit/compemu_raw_x86.cpp [moved from jit/compemu_raw_x86.c with 99% similarity]
jit/compemu_support.cpp [moved from jit/compemu_support.c with 99% similarity]
jit/compemu_support_codegen.cpp [moved from jit/compemu_support_codegen.c with 100% similarity]
jit/gencomp.cpp [moved from jit/gencomp.c with 98% similarity]
keybuf.cpp [moved from keybuf.c with 99% similarity]
main.cpp [moved from main.c with 100% similarity]
memory.cpp [moved from memory.c with 99% similarity]
missing.cpp [moved from missing.c with 97% similarity]
moduleripper.cpp [moved from moduleripper.c with 96% similarity]
native2amiga.cpp [moved from native2amiga.c with 100% similarity]
ncr_scsi.cpp [moved from ncr_scsi.c with 99% similarity]
newcpu.cpp [moved from newcpu.c with 99% similarity]
nogui.cpp [moved from nogui.c with 100% similarity]
od-win32/7zplugin.cpp [moved from od-win32/7zplugin.c with 100% similarity]
od-win32/ahidsound_dsonly.cpp [moved from od-win32/ahidsound_dsonly.c with 94% similarity]
od-win32/ahidsound_new.cpp [moved from od-win32/ahidsound_new.c with 99% similarity]
od-win32/ahidsound_new2.cpp [moved from od-win32/ahidsound_new2.c with 100% similarity]
od-win32/ahidsound_unified.cpp [moved from od-win32/ahidsound_unified.c with 100% similarity]
od-win32/ahidsoundx_new.cpp [moved from od-win32/ahidsoundx_new.c with 100% similarity]
od-win32/avioutput.cpp [moved from od-win32/avioutput.c with 97% similarity]
od-win32/avioutput.h
od-win32/blkdev_win32_aspi.cpp [moved from od-win32/blkdev_win32_aspi.c with 98% similarity]
od-win32/blkdev_win32_ioctl.cpp [moved from od-win32/blkdev_win32_ioctl.c with 99% similarity]
od-win32/blkdev_win32_spti.cpp [moved from od-win32/blkdev_win32_spti.c with 95% similarity]
od-win32/bsdsock.cpp [moved from od-win32/bsdsock.c with 98% similarity]
od-win32/build68k_msvc/build68k_msvc.rc [deleted file]
od-win32/build68k_msvc/build68k_msvc.vcproj
od-win32/build68k_msvc/build68k_msvc.vcxproj
od-win32/build68k_msvc/build68k_msvc.vcxproj.filters
od-win32/caps/caps_win32.cpp [moved from od-win32/caps/caps_win32.c with 99% similarity]
od-win32/clipboard_win32.cpp [moved from od-win32/clipboard_win32.c with 96% similarity]
od-win32/clirun.cpp [moved from od-win32/clirun.c with 100% similarity]
od-win32/cloanto/RetroPlatformGuestIPC.cpp [moved from od-win32/cloanto/RetroPlatformGuestIPC.c with 100% similarity]
od-win32/debug_win32.cpp [moved from od-win32/debug_win32.c with 99% similarity]
od-win32/dinput.cpp [moved from od-win32/dinput.c with 97% similarity]
od-win32/direct3d.cpp
od-win32/diskutil.cpp [moved from od-win32/diskutil.c with 100% similarity]
od-win32/driveclick_win32.cpp [moved from od-win32/driveclick_win32.c with 100% similarity]
od-win32/dxwrap.cpp [moved from od-win32/dxwrap.c with 99% similarity]
od-win32/dxwrap.h
od-win32/fdrawcmd.cpp [moved from od-win32/fdrawcmd.c with 100% similarity]
od-win32/fsdb_mywin32.cpp [moved from od-win32/fsdb_mywin32.c with 91% similarity]
od-win32/fsdb_win32.cpp [moved from od-win32/fsdb_win32.c with 94% similarity]
od-win32/genblitter_msvc/genblitter_msvc.vcproj
od-win32/genblitter_msvc/genblitter_msvc.vcxproj
od-win32/genblitter_msvc/genblitter_msvc.vcxproj.filters
od-win32/gencomp_msvc/gencomp_msvc.vcproj
od-win32/gencomp_msvc/gencomp_msvc.vcxproj
od-win32/gencomp_msvc/gencomp_msvc.vcxproj.filters
od-win32/gencpu_msvc/gencpu.exe.manifest [deleted file]
od-win32/gencpu_msvc/gencpu_msvc.vcproj
od-win32/gencpu_msvc/gencpu_msvc.vcxproj
od-win32/gencpu_msvc/gencpu_msvc.vcxproj.filters
od-win32/genlinetoscr_msvc/genlinetoscr_msvc.vcproj
od-win32/genlinetoscr_msvc/genlinetoscr_msvc.vcxproj
od-win32/genlinetoscr_msvc/genlinetoscr_msvc.vcxproj.filters
od-win32/hardfile_win32.cpp [moved from od-win32/hardfile_win32.c with 93% similarity]
od-win32/hq2x_d3d.cpp [moved from od-win32/hq2x_d3d.c with 100% similarity]
od-win32/ioport.cpp [moved from od-win32/ioport.c with 99% similarity]
od-win32/ipctester.cpp [moved from od-win32/ipctester.c with 100% similarity]
od-win32/keyboard_win32.cpp [moved from od-win32/keyboard_win32.c with 100% similarity]
od-win32/lcd.cpp [moved from od-win32/lcd.c with 96% similarity]
od-win32/machdep/support.cpp [moved from od-win32/machdep/support.c with 100% similarity]
od-win32/midi.cpp [moved from od-win32/midi.c with 98% similarity]
od-win32/midiin.cpp [moved from od-win32/midiin.c with 100% similarity]
od-win32/mman.c [deleted file]
od-win32/mman.cpp [new file with mode: 0644]
od-win32/opengl.cpp [moved from od-win32/opengl.c with 100% similarity]
od-win32/parser.cpp [moved from od-win32/parser.c with 93% similarity]
od-win32/picasso96_win.cpp [moved from od-win32/picasso96_win.c with 98% similarity]
od-win32/picasso96_win.h
od-win32/posixemu.cpp [moved from od-win32/posixemu.c with 98% similarity]
od-win32/registry.cpp [moved from od-win32/registry.c with 87% similarity]
od-win32/rp.cpp [moved from od-win32/rp.c with 99% similarity]
od-win32/scaler.cpp [moved from od-win32/scaler.c with 99% similarity]
od-win32/scaler2.cpp [moved from od-win32/scaler2.c with 100% similarity]
od-win32/scaler_more.cpp [moved from od-win32/scaler_more.c with 100% similarity]
od-win32/screenshot.cpp [moved from od-win32/screenshot.c with 96% similarity]
od-win32/serial_win32.cpp [moved from od-win32/serial_win32.c with 99% similarity]
od-win32/sfhelper.cpp [moved from od-win32/sfhelper.c with 100% similarity]
od-win32/shm.cpp [moved from od-win32/shm.c with 100% similarity]
od-win32/soundcheck.cpp [moved from od-win32/soundcheck.c with 100% similarity]
od-win32/sounddep/sound.cpp [moved from od-win32/sounddep/sound.c with 90% similarity]
od-win32/sounddep/sound.h
od-win32/srcrelease.cmd
od-win32/support.cpp [moved from od-win32/support.c with 100% similarity]
od-win32/tun.cpp [moved from od-win32/tun.c with 100% similarity]
od-win32/uaeunp/uaeunp.vcproj
od-win32/uaeunp/uaeunp.vcxproj
od-win32/uaeunp/uaeunp.vcxproj.filters
od-win32/uaeunp_win32.cpp [moved from od-win32/uaeunp_win32.c with 89% similarity]
od-win32/unicode.cpp [moved from od-win32/unicode.c with 96% similarity]
od-win32/win32.cpp [moved from od-win32/win32.c with 98% similarity]
od-win32/win32.h
od-win32/win32_decompress.cpp [moved from od-win32/win32_decompress.c with 100% similarity]
od-win32/win32_filesys.cpp [moved from od-win32/win32_filesys.c with 99% similarity]
od-win32/win32_nogui.cpp [moved from od-win32/win32_nogui.c with 100% similarity]
od-win32/win32_scale2x.cpp [moved from od-win32/win32_scale2x.c with 99% similarity]
od-win32/win32_uaenet.cpp [moved from od-win32/win32_uaenet.c with 91% similarity]
od-win32/win32gfx.cpp [moved from od-win32/win32gfx.c with 99% similarity]
od-win32/win32gfx.h
od-win32/win32gui.cpp [moved from od-win32/win32gui.c with 99% similarity]
od-win32/win32gui.h
od-win32/win32gui_extra.cpp [moved from od-win32/win32gui_extra.c with 92% similarity]
od-win32/winuae_msvc/winuae_msvc.vcproj
od-win32/winuae_msvc10/winuae_msvc.vcproj [deleted file]
od-win32/winuae_msvc10/winuae_msvc.vcxproj
od-win32/winuae_msvc10/winuae_msvc.vcxproj.filters
od-win32/winuaechangelog.txt
od-win32/writelog.cpp [moved from od-win32/writelog.c with 98% similarity]
p96_blit.cpp [moved from p96_blit.c with 100% similarity]
picasso96.cpp [moved from picasso96.c with 100% similarity]
prowizard/include/extern.h
prowizard/include/globals.h
prowizard/misc/misc.c
readcpu.cpp [moved from readcpu.c with 99% similarity]
readdisk.cpp [moved from readdisk.c with 100% similarity]
rommgr.cpp [moved from rommgr.c with 98% similarity]
rpc.cpp [moved from rpc.c with 100% similarity]
sampler.cpp [moved from sampler.c with 98% similarity]
sana2.cpp [moved from sana2.c with 99% similarity]
savestate.cpp [moved from savestate.c with 99% similarity]
scsi.cpp [moved from scsi.c with 95% similarity]
scsidev.cpp [moved from scsidev.c with 100% similarity]
scsiemul.cpp [moved from scsiemul.c with 100% similarity]
serial.cpp [moved from serial.c with 100% similarity]
sinctable.cpp [moved from sinctable.c with 100% similarity]
traps.cpp [moved from traps.c with 99% similarity]
uaeexe.cpp [moved from uaeexe.c with 95% similarity]
uaeipc.cpp [moved from uaeipc.c with 88% similarity]
uaelib.cpp [moved from uaelib.c with 100% similarity]
uaeresource.cpp [moved from uaeresource.c with 100% similarity]
uaeserial.cpp [moved from uaeserial.c with 99% similarity]
uaeunp.cpp [moved from uaeunp.c with 98% similarity]
writelog.cpp [moved from writelog.c with 100% similarity]
zfile.cpp [moved from zfile.c with 96% similarity]
zfile_archive.cpp [moved from zfile_archive.c with 97% similarity]

similarity index 99%
rename from a2065.c
rename to a2065.cpp
index c6d35bd6c912e9e633819e33c6f5cc84fdcb00e0..1d4c4fbe352d7cf1f53a1d65616b9efad74da14a 100644 (file)
--- a/a2065.c
+++ b/a2065.cpp
@@ -515,7 +515,7 @@ static void chip_init (void)
        uaenet_close (sysdata);
        if (td != NULL) {
                if (!sysdata)
-                       sysdata = xcalloc (uaenet_getdatalenght(), 1);
+                       sysdata = xcalloc (uae_u8, uaenet_getdatalenght());
                if (!uaenet_open (sysdata, td, NULL, gotfunc, getfunc, prom)) {
                        write_log (L"A2065: failed to initialize winpcap driver\n");
                }
@@ -719,7 +719,7 @@ static void REGPARAM2 a2065_lput (uaecptr addr, uae_u32 l)
        a2065_wput (addr + 2, l);
 }
 
-static addrbank a2065_bank;
+extern addrbank a2065_bank;
 
 static void REGPARAM2 a2065_bput (uaecptr addr, uae_u32 b)
 {
similarity index 99%
rename from a2091.c
rename to a2091.cpp
index 4b1f45de149c0fde1e6e150c57b3ce0c70f76925..32237438213bb62e599114147ea39561fcfc8c1a 100644 (file)
--- a/a2091.c
+++ b/a2091.cpp
@@ -1205,7 +1205,7 @@ int addscsi (int ch, TCHAR *path, int blocksize, int readonly,
 
        freescsi (scsis[ch]);
        scsis[ch] = NULL;
-       hfd = xcalloc (sizeof (struct hd_hardfiledata), 1);
+       hfd = xcalloc (struct hd_hardfiledata, 1);
        if (!hdf_hd_open (hfd, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys))
                return 0;
        hfd->ansi_version = scsi_level;
@@ -1350,7 +1350,7 @@ void a2091_init (void)
                if (z) {
                        write_log (L"A590/A2091 BOOT ROM %d.%d ", rd->ver, rd->rev);
                        rom_size = rd->size;
-                       rom = xmalloc (rom_size);
+                       rom = xmalloc (uae_u8, rom_size);
                        if (rl->rd->id == 56)
                                rombankswitcher = 1;
                        zfile_fread (rom, rom_size, 1, z);
similarity index 100%
rename from adide.c
rename to adide.cpp
similarity index 99%
rename from akiko.c
rename to akiko.cpp
index 71a1e837d10755206003973394e531964da94ce6..3724215ecb92b205834fd5535cc240f149fd7543 100644 (file)
--- a/akiko.c
+++ b/akiko.cpp
@@ -800,7 +800,7 @@ static int cdrom_command_status (void)
        if (unitnum >= 0)
                cdrom_toc ();
        /* firmware info */
-       strcpy (cdrom_result_buffer + 2, FIRMWAREVERSION);
+       memcpy (cdrom_result_buffer + 2, FIRMWAREVERSION, sizeof FIRMWAREVERSION);
        cdrom_result_buffer[0] = cdrom_command;
        cd_initialized = 1;
        return 20;
@@ -1694,10 +1694,10 @@ int akiko_init (void)
                }
                if (!sys_cddev_open ()) {
                        cdromok = 1;
-                       sector_buffer_1 = xmalloc (SECTOR_BUFFER_SIZE * 2048);
-                       sector_buffer_2 = xmalloc (SECTOR_BUFFER_SIZE * 2048);
-                       sector_buffer_info_1 = xmalloc (SECTOR_BUFFER_SIZE);
-                       sector_buffer_info_2 = xmalloc (SECTOR_BUFFER_SIZE);
+                       sector_buffer_1 = xmalloc (uae_u8, SECTOR_BUFFER_SIZE * 2048);
+                       sector_buffer_2 = xmalloc (uae_u8, SECTOR_BUFFER_SIZE * 2048);
+                       sector_buffer_info_1 = xmalloc (uae_u8, SECTOR_BUFFER_SIZE);
+                       sector_buffer_info_2 = xmalloc (uae_u8, SECTOR_BUFFER_SIZE);
                        sector_buffer_sector_1 = -1;
                        sector_buffer_sector_2 = -1;
                }
@@ -1725,7 +1725,7 @@ uae_u8 *save_akiko(int *len)
        if (!currprefs.cs_cd32cd)
                return NULL;
 
-       dstbak = dst = malloc (1000);
+       dstbak = dst = xmalloc (uae_u8, 1000);
        save_u16 (0);
        save_u16 (0xCAFE);
        save_u32 (cdrom_intreq);
similarity index 100%
rename from akiko2.c
rename to akiko2.cpp
diff --git a/amax.c b/amax.cpp
similarity index 98%
rename from amax.c
rename to amax.cpp
index e66349dbef94e2a4c792547f465bb8cc6fdc18e3..c593c23d00bd3c6248afda2367714d99133ac8e9 100644 (file)
--- a/amax.c
+++ b/amax.cpp
@@ -147,7 +147,7 @@ void amax_init (void)
        zfile_fseek (z, 0, SEEK_END);
        rom_size = zfile_ftell (z);
        zfile_fseek (z, 0, SEEK_SET);
-       rom = xmalloc (rom_size);
+       rom = xmalloc (uae_u8, rom_size);
        zfile_fread (rom, rom_size, 1, z);
        zfile_fclose (z);
        write_log (L"AMAX: '%s' loaded, %d bytes\n", currprefs.amaxromfile, rom_size);
diff --git a/ar.c b/ar.cpp
similarity index 99%
rename from ar.c
rename to ar.cpp
index d68295278c3c953c3bcf3315bd11cffb0c8248a4..06e02eb8063569739cb40ed8918d19a42b1040e6 100644 (file)
--- a/ar.c
+++ b/ar.cpp
@@ -1662,7 +1662,7 @@ int action_replay_load (void)
                return 0;
        }
        action_replay_flag = ACTION_REPLAY_INACTIVE;
-       armemory_rom = xmalloc (ar_rom_file_size);
+       armemory_rom = xmalloc (uae_u8, ar_rom_file_size);
        zfile_fread (armemory_rom, 1, ar_rom_file_size, f);
        zfile_fclose (f);
        if (ar_rom_file_size == 65536) {
@@ -1681,7 +1681,7 @@ int action_replay_load (void)
        }
        arram_mask = arram_size - 1;
        arrom_mask = arrom_size - 1;
-       armemory_ram = xcalloc (arram_size, 1);
+       armemory_ram = xcalloc (uae_u8, arram_size);
        write_log (L"Action Replay %d installed at %08X, size %08X\n", armodel, arrom_start, arrom_size);
        action_replay_version();
        return armodel;
@@ -1739,7 +1739,7 @@ void action_replay_cleanup()
 #endif
 
 #ifdef ACTION_REPLAY_HRTMON
-#include "hrtmon.rom.c"
+#include "hrtmon.rom.cpp"
 #endif
 
 int hrtmon_lang = 0;
@@ -2072,7 +2072,7 @@ uae_u8 *save_action_replay (int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = malloc (arram_size + sizeof ar_custom + sizeof ar_ciaa + sizeof ar_ciab + 1024);
+               dstbak = dst = xmalloc (uae_u8, arram_size + sizeof ar_custom + sizeof ar_ciaa + sizeof ar_ciab + 1024);
        save_u8 (0);
        save_u8 (armodel);
        save_u32 (get_crc32 (armemory_rom + 4, arrom_size - 4));
similarity index 98%
rename from arcadia.c
rename to arcadia.cpp
index 5053b90570edc0523ad5514575ad87fce1a9c135..8b05fe7b7098e48f40874f60cc3546506dd7cf05 100644 (file)
--- a/arcadia.c
@@ -38,7 +38,7 @@
 *
 */
 
-static void multigame(int);
+static void multigame (int);
 
 int arcadia_flag, arcadia_coin[2];
 struct arcadiarom *arcadia_bios, *arcadia_game;
@@ -91,7 +91,7 @@ static int load_rom8 (TCHAR *xpath, uae_u8 *mem,      int extra)
        struct zfile *zf;
        TCHAR path[MAX_DPATH];
        int i;
-       uae_u8 *tmp = xmalloc (131072);
+       uae_u8 *tmp = xmalloc (uae_u8, 131072);
        TCHAR *bin = extra == 1 ? L".bin" : L"";
 
        memset (tmp, 0, 131072);
@@ -397,7 +397,7 @@ int arcadia_map_banks (void)
 {
        if (!arcadia_bios)
                return 0;
-       arbmemory = (uae_u8*)xmalloc (allocated_arbmemory);
+       arbmemory = xmalloc (uae_u8, allocated_arbmemory);
        arbbmemory = arbmemory + bios_offset;
        memset (arbmemory, 0, allocated_arbmemory);
        if (!load_roms (arcadia_bios)) {
similarity index 100%
rename from archivers/7z/7zBuf.c
rename to archivers/7z/7zBuf.cpp
similarity index 100%
rename from archivers/7z/7zCrc.c
rename to archivers/7z/7zCrc.cpp
similarity index 100%
rename from archivers/7z/Bcj2.c
rename to archivers/7z/Bcj2.cpp
similarity index 100%
rename from archivers/7z/Bra.c
rename to archivers/7z/Bra.cpp
similarity index 100%
rename from archivers/7z/Bra86.c
rename to archivers/7z/Bra86.cpp
similarity index 98%
rename from archivers/dms/pfile.c
rename to archivers/dms/pfile.cpp
index e892c84b1be962924886e4316cb7690e8096cf15..f84b8e9e6c295c7d93ed999775b9f4e42f7031a8 100644 (file)
@@ -47,7 +47,7 @@ static int passfound, passretries;
 static TCHAR modes[7][7]={L"NOCOMP",L"SIMPLE",L"QUICK ",L"MEDIUM",L"DEEP  ",L"HEAVY1",L"HEAVY2"};
 static USHORT PWDCRC;
 
-UCHAR *text;
+static UCHAR *text;
 
 static void log_error(int track)
 {
@@ -84,14 +84,14 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o
 
        passfound = 0;
        passretries = 2;
-       b1 = (UCHAR *)calloc((size_t)TRACK_BUFFER_LEN,1);
+       b1 = xcalloc(UCHAR,TRACK_BUFFER_LEN);
        if (!b1) return ERR_NOMEMORY;
-       b2 = (UCHAR *)calloc((size_t)TRACK_BUFFER_LEN,1);
+       b2 = xcalloc(UCHAR,TRACK_BUFFER_LEN);
        if (!b2) {
                free(b1);
                return ERR_NOMEMORY;
        }
-       text = (UCHAR *)calloc((size_t)TEMP_BUFFER_LEN,1);
+       text = xcalloc(UCHAR,TEMP_BUFFER_LEN);
        if (!text) {
                free(b1);
                free(b2);
@@ -365,7 +365,7 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR
                        // did we have another cylinder 0 already?
                        uae_u8 *p;
                        zfile_fseek (fo, 0, SEEK_SET);
-                       p = xcalloc (512 * 22, 1);
+                       p = xcalloc (uae_u8, 512 * 22);
                        zfile_fread (p, 512 * 22, 1, fo);
                        addextra(L"BigFakeBootBlock", extra, p, 512 * 22);
                        xfree (p);
@@ -535,7 +535,7 @@ static void printbandiz(UCHAR *m, USHORT len){
                if (*i == 10) {
                        TCHAR *u;
                        *i=0;
-                       u = au (j);
+                       u = au ((char*)j);
                        write_log (L"%s\n",u);
                        xfree (u);
                        j=i+1;
similarity index 95%
rename from archivers/dms/u_deep.c
rename to archivers/dms/u_deep.cpp
index e1e5dcaf6fb177ed8b58503225c6109105725b3a..45d040ae455604d9c7d70a223211e7fd19239522 100644 (file)
@@ -38,13 +38,13 @@ int init_deep_tabs=1;
 #define MAX_FREQ    0x8000      /* updates tree when the */
 
 
-USHORT freq[T + 1]; /* frequency table */
+static USHORT freq[T + 1]; /* frequency table */
 
-USHORT prnt[T + N_CHAR]; /* pointers to parent nodes, except for the */
+static USHORT prnt[T + N_CHAR]; /* pointers to parent nodes, except for the */
                                /* elements [T..T + N_CHAR - 1] which are used to get */
                                /* the positions of leaves corresponding to the codes. */
 
-USHORT son[T];   /* pointers to child nodes (son[], son[] + 1) */
+static USHORT son[T];   /* pointers to child nodes (son[], son[] + 1) */
 
 
 
similarity index 98%
rename from archivers/dms/u_heavy.c
rename to archivers/dms/u_heavy.cpp
index b9de0b170b78d675aa629585c16d9f12a1d05ded..42d2eb81a35326e7c9bf90b277490befa24323f0 100644 (file)
@@ -21,7 +21,7 @@
 #define N1 510
 #define OFFSET 253
 
-USHORT left[2 * NC - 1], right[2 * NC - 1 + 9];
+static USHORT left[2 * NC - 1], right[2 * NC - 1 + 9];
 static UCHAR c_len[NC], pt_len[NPT];
 static USHORT c_table[4096], pt_table[256];
 USHORT lastlen, np;
similarity index 91%
rename from archivers/lha/crcio.c
rename to archivers/lha/crcio.cpp
index ecf60ce18bff364b03c0b958d9349b51d5c6802e..3d1b2672e5905e80601324125a7e9942291fe77a 100644 (file)
@@ -51,9 +51,7 @@ put_indicator(count)
 
 /* ------------------------------------------------------------------------ */
 unsigned short
-calccrc(p, n)
-       unsigned char  *p;
-       unsigned int    n;
+calccrc(unsigned char *p, unsigned int n)
 {
        reading_size += n;
 #ifdef NEED_INCREMENTAL_INDICATOR
@@ -66,8 +64,7 @@ calccrc(p, n)
 
 /* ------------------------------------------------------------------------ */
 void
-fillbuf(n)                     /* Shift bitbuf n bits left, read n bits */
-       unsigned char   n;
+fillbuf(unsigned char n)                       /* Shift bitbuf n bits left, read n bits */
 {
        while (n > bitcount) {
                n -= bitcount;
@@ -87,8 +84,7 @@ fillbuf(n)                    /* Shift bitbuf n bits left, read n bits */
 
 /* ------------------------------------------------------------------------ */
 unsigned short
-getbits(n)
-       unsigned char   n;
+getbits(unsigned char n)
 {
        unsigned short  x;
 
@@ -154,10 +150,7 @@ putbits(n, x)                      /* Write rightmost n bits of x */
 #endif
 /* ------------------------------------------------------------------------ */
 int
-fread_crc(p, n, fp)
-       unsigned char  *p;
-       int             n;
-       struct zfile   *fp;
+fread_crc(unsigned char *p, int n, struct zfile *fp)
 {
        n = zfile_fread(p, 1, n, fp);
 
@@ -167,10 +160,7 @@ fread_crc(p, n, fp)
 
 /* ------------------------------------------------------------------------ */
 void
-fwrite_crc(p, n, fp)
-       unsigned char  *p;
-       int             n;
-       struct zfile   *fp;
+fwrite_crc(unsigned char *p, int n, struct zfile *fp)
 {
        calccrc(p, n);
        if (verify_mode)
@@ -183,7 +173,7 @@ fwrite_crc(p, n, fp)
 
 /* ------------------------------------------------------------------------ */
 void
-init_code_cache( /* void */ )
+init_code_cache(void)
 {                              /* called from copyfile() in util.c */
 #ifdef EUC
        putc_euc_cache = EOF;
@@ -192,7 +182,7 @@ init_code_cache( /* void */ )
 }
 
 void
-init_getbits( /* void */ )
+init_getbits(void)
 {
        lhabitbuf = 0;
        subbitbuf = 0;
@@ -255,10 +245,7 @@ putc_euc(c, fd)
 
 /* ------------------------------------------------------------------------ */
 int
-fwrite_txt(p, n, fp)
-       unsigned char  *p;
-       int             n;
-       FILE           *fp;
+fwrite_txt(unsigned char *p, int n, FILE *fp)
 {
        while (--n >= 0) {
                if (*p != '\015' && *p != '\032') {
@@ -276,10 +263,7 @@ fwrite_txt(p, n, fp)
 
 /* ------------------------------------------------------------------------ */
 int
-fread_txt(p, n, fp)
-       unsigned char  *p;
-       int             n;
-       FILE           *fp;
+fread_txt(unsigned char *p, int n, FILE *fp)
 {
        int             c;
        int             cnt = 0;
@@ -337,9 +321,7 @@ fread_txt(p, n, fp)
 
 /* ------------------------------------------------------------------------ */
 unsigned short
-calc_header_crc(p, n)          /* Thanks T.Okamoto */
-       unsigned char  *p;
-       unsigned int    n;
+calc_header_crc(unsigned char *p, unsigned int n)              /* Thanks T.Okamoto */
 {
        crc = 0;
        while (n-- > 0)
similarity index 95%
rename from archivers/lha/dhuf.c
rename to archivers/lha/dhuf.cpp
index cdf52aa576247341bca0dcf77804febc8509625d..0f215a79b514bae9714a1f9f1c41445864716d5a 100644 (file)
@@ -21,7 +21,7 @@ static int      most_p, nn;
 static unsigned long nextcount;
 /* ------------------------------------------------------------------------ */
 void
-start_c_dyn( /* void */ )
+start_c_dyn(void)
 {
        int             i, j, f;
 
@@ -56,7 +56,7 @@ start_c_dyn( /* void */ )
 
 /* ------------------------------------------------------------------------ */
 static void
-start_p_dyn( /* void */ )
+start_p_dyn(void)
 {
        freq[ROOT_P] = 1;
        child[ROOT_P] = ~(N_CHAR);
@@ -70,7 +70,7 @@ start_p_dyn( /* void */ )
 
 /* ------------------------------------------------------------------------ */
 void
-decode_start_dyn( /* void */ )
+decode_start_dyn(void)
 {
        n_max = 286;
        maxmatch = MAXMATCH;
@@ -81,9 +81,7 @@ decode_start_dyn( /* void */ )
 
 /* ------------------------------------------------------------------------ */
 static void
-reconst(start, end)
-       int             start;
-       int             end;
+reconst(int start, int end)
 {
        int             i, j, k, l, b;
        unsigned int    f, g;
@@ -137,8 +135,7 @@ reconst(start, end)
 
 /* ------------------------------------------------------------------------ */
 static int
-swap_inc(p)
-       int             p;
+swap_inc(int p)
 {
        int             b, q, r, s;
 
@@ -178,8 +175,7 @@ Adjust:
 
 /* ------------------------------------------------------------------------ */
 static void
-update_c(p)
-       int             p;
+update_c(int p)
 {
        int             q;
 
@@ -195,8 +191,7 @@ update_c(p)
 
 /* ------------------------------------------------------------------------ */
 static void
-update_p(p)
-       int             p;
+update_p(int p)
 {
        int             q;
 
@@ -214,8 +209,7 @@ update_p(p)
 
 /* ------------------------------------------------------------------------ */
 static void
-make_new_node(p)
-       int             p;
+make_new_node(int p)
 {
        int             q, r;
 
@@ -269,7 +263,7 @@ encode_c_dyn(c)
 #endif
 /* ------------------------------------------------------------------------ */
 unsigned short
-decode_c_dyn( /* void */ )
+decode_c_dyn(void)
 {
        int             c;
        short           buf, cnt;
@@ -296,7 +290,7 @@ decode_c_dyn( /* void */ )
 
 /* ------------------------------------------------------------------------ */
 unsigned short
-decode_p_dyn( /* void */ )
+decode_p_dyn(void)
 {
        int             c;
        short           buf, cnt;
similarity index 94%
rename from archivers/lha/header.c
rename to archivers/lha/header.cpp
index dbe72861494641a391e4e1ab0abb2b59903977d8..30d5b7ead7ac2cbdeb778f0a9eb5227c411563f5 100644 (file)
 /* ------------------------------------------------------------------------ */
 static char    *get_ptr;
 /* ------------------------------------------------------------------------ */
-int
-calc_sum(p, len)
-       register char  *p;
-       register int    len;
+int calc_sum(char *p, int len)
 {
        register int    sum;
 
@@ -30,8 +27,7 @@ calc_sum(p, len)
 }
 
 /* ------------------------------------------------------------------------ */
-static unsigned short
-get_word ()
+static unsigned short get_word (void)
 {
        int             b0, b1;
 
@@ -41,17 +37,14 @@ get_word ()
 }
 
 /* ------------------------------------------------------------------------ */
-static void
-put_word (v)
-       unsigned int    v;
+static void put_word (unsigned int v)
 {
        put_byte (v);
        put_byte (v >> 8);
 }
 
 /* ------------------------------------------------------------------------ */
-static long
-get_longword()
+static long get_longword(void)
 {
        long            b0, b1, b2, b3;
 
@@ -63,9 +56,7 @@ get_longword()
 }
 
 /* ------------------------------------------------------------------------ */
-static void
-put_longword(v)
-       long            v;
+static void put_longword(long v)
 {
        put_byte (v);
        put_byte (v >> 8);
@@ -74,10 +65,7 @@ put_longword(v)
 }
 
 /* ------------------------------------------------------------------------ */
-static void
-msdos_to_unix_filename(name, len)
-       register char  *name;
-       register int    len;
+static void msdos_to_unix_filename(char *name, int len)
 {
        register int    i;
 
@@ -102,10 +90,7 @@ msdos_to_unix_filename(name, len)
 }
 
 /* ------------------------------------------------------------------------ */
-static void
-generic_to_unix_filename(name, len)
-       register char  *name;
-       register int    len;
+static void generic_to_unix_filename(char *name, int len)
 {
        register int    i;
        boolean         lower_case_used = FALSE;
@@ -146,9 +131,7 @@ generic_to_unix_filename(name, len)
 
 /* ------------------------------------------------------------------------ */
 static void
-macos_to_unix_filename(name, len)
-       register char  *name;
-       register int    len;
+macos_to_unix_filename(char *name, int len)
 {
        register int    i;
 
@@ -162,9 +145,7 @@ macos_to_unix_filename(name, len)
 
 /* ------------------------------------------------------------------------ */
 static void
-unix_to_generic_filename(name, len)
-       register char  *name;
-       register int    len;
+unix_to_generic_filename(char *name, int len)
 {
        register int    i;
 
@@ -302,9 +283,7 @@ msdos_to_unix_stamp_tm(a)
 #endif
 
 /* ------------------------------------------------------------------------ */
-static          time_t
-generic_to_unix_stamp(t)
-       long            t;
+static time_t generic_to_unix_stamp(long t)
 #if defined(MKTIME) || defined(TIMELOCAL)
 {
        struct tm       dostm;
@@ -320,8 +299,8 @@ generic_to_unix_stamp(t)
        dostm.tm_min = t >> 5 & 0x3f;
        dostm.tm_hour = t >> 11 & 0x1f;
        dostm.tm_mday = t >> 16 & 0x1f;
-       dostm.tm_mon = (t >> 16 + 5 & 0x0f) - 1;        /* 0..11 */
-       dostm.tm_year = (t >> 16 + 9 & 0x7f) + 80;
+       dostm.tm_mon = ((t >> 16) + 5 & 0x0f) - 1;      /* 0..11 */
+       dostm.tm_year = ((t >> 16) + 9 & 0x7f) + 80;
 #if 0
        dostm.tm_isdst = 0;     /* correct? */
 #endif
@@ -377,9 +356,7 @@ generic_to_unix_stamp(t)
 #endif                         /* defined(MKTIME) || defined(TIMELOCAL) */
 
 /* ------------------------------------------------------------------------ */
-static long
-unix_to_generic_stamp(t)
-       time_t          t;
+static long unix_to_generic_stamp(time_t t)
 {
        struct tm      *tm = localtime(&t);
 
@@ -394,10 +371,7 @@ unix_to_generic_stamp(t)
 /* ------------------------------------------------------------------------ */
 /* build header functions                                                                                                      */
 /* ------------------------------------------------------------------------ */
-boolean
-get_header(fp, hdr)
-       struct zfile   *fp;
-       register LzHeader *hdr;
+boolean get_header(struct zfile *fp, LzHeader *hdr)
 {
        int             header_size;
        int             name_length;
@@ -554,7 +528,7 @@ get_header(fp, hdr)
                                for (i = 0; i < header_size - 3; i++)
                                        dirname[i] = (char) get_byte ();
                                dirname[header_size - 3] = '\0';
-                               convdelim(dirname, DELIM);
+                               convdelim((unsigned char*)dirname, DELIM);
                                dir_length = header_size - 3;
                                break;
                        case 0x40:
@@ -663,11 +637,7 @@ get_header(fp, hdr)
 }
 
 /* ------------------------------------------------------------------------ */
-void
-init_header(name, v_stat, hdr)
-       char           *name;
-       struct stat    *v_stat;
-       LzHeader       *hdr;
+void init_header(char *name, struct stat *v_stat, LzHeader *hdr)
 {
        int             len;
 
similarity index 95%
rename from archivers/lha/huf.c
rename to archivers/lha/huf.cpp
index 33d23a25d02ea585ad9eac366f616ccf0a8a2c56..e6ddd3f7c8667df70ab55f6eaf6bc73ee6968ca4 100644 (file)
@@ -32,8 +32,7 @@ static                        int       np;
 /* ------------------------------------------------------------------------ */
 /*                                                             Encording                                                                       */
 /* ------------------------------------------------------------------------ */
-static void
-count_t_freq(/*void*/)
+static void count_t_freq(void)
 {
        short           i, k, n, count;
 
@@ -253,8 +252,7 @@ output_st1(c, p)
 #endif
 
 /* ------------------------------------------------------------------------ */
-unsigned char  *
-alloc_buf( /* void */ )
+unsigned char  *alloc_buf(void)
 {
        bufsiz = 16 * 1024 *2;  /* 65408U; */ /* t.okamoto */
        while ((buf = (unsigned char *) malloc(bufsiz)) == NULL) {
@@ -315,11 +313,7 @@ encode_end_st1( /* void */ )
 /* ------------------------------------------------------------------------ */
 /*                                                             decoding                                                                        */
 /* ------------------------------------------------------------------------ */
-static void
-read_pt_len(nn, nbit, i_special)
-       short           nn;
-       short           nbit;
-       short           i_special;
+static void read_pt_len(short nn, short nbit, short i_special)
 {
        int           i, c, n;
 
@@ -352,13 +346,12 @@ read_pt_len(nn, nbit, i_special)
                }
                while (i < nn)
                        pt_len[i++] = 0;
-               make_table(nn, pt_len, 8, pt_table);
+               lha_make_table(nn, pt_len, 8, pt_table);
        }
 }
 
 /* ------------------------------------------------------------------------ */
-static void
-read_c_len( /* void */ )
+static void read_c_len(void)
 {
        short           i, c, n;
 
@@ -399,13 +392,12 @@ read_c_len( /* void */ )
                }
                while (i < NC)
                        c_len[i++] = 0;
-               make_table(NC, c_len, 12, c_table);
+               lha_make_table(NC, c_len, 12, c_table);
        }
 }
 
 /* ------------------------------------------------------------------------ */
-unsigned short
-decode_c_st1( /*void*/ )
+unsigned short decode_c_st1(void)
 {
        unsigned short  j, mask;
 
@@ -435,8 +427,7 @@ decode_c_st1( /*void*/ )
 }
 
 /* ------------------------------------------------------------------------ */
-unsigned short
-decode_p_st1( /* void */ )
+unsigned short decode_p_st1(void)
 {
        unsigned short  j, mask;
 
@@ -461,8 +452,7 @@ decode_p_st1( /* void */ )
 }
 
 /* ------------------------------------------------------------------------ */
-void
-decode_start_st1( /* void */ )
+void decode_start_st1(void)
 {
        if (dicbit <= 13)  {
                np = 14;
similarity index 89%
rename from archivers/lha/larc.c
rename to archivers/lha/larc.cpp
index a6a2642c479676b6c81eae91d3bcc4dc5ab7cb11..a1a9d43e7e1e333e45a9e3edc2a6fbd36bc7a3da 100644 (file)
@@ -11,8 +11,7 @@
 /* ------------------------------------------------------------------------ */
 static int      flag, flagcnt, matchpos;
 /* ------------------------------------------------------------------------ */
-unsigned short
-decode_c_lzs( /*void*/ )
+unsigned short decode_c_lzs(void)
 {
        if (getbits(1)) {
                return getbits(8);
@@ -24,22 +23,19 @@ decode_c_lzs( /*void*/ )
 }
 
 /* ------------------------------------------------------------------------ */
-unsigned short
-decode_p_lzs( /*void*/ )
+unsigned short decode_p_lzs(void)
 {
        return (loc - matchpos - MAGIC0) & 0x7ff;
 }
 
 /* ------------------------------------------------------------------------ */
-void
-decode_start_lzs( /*void*/ )
+void decode_start_lzs(void)
 {
        init_getbits();
 }
 
 /* ------------------------------------------------------------------------ */
-unsigned short
-decode_c_lz5( /*void*/ )
+unsigned short decode_c_lz5(void)
 {
        int             c;
 
@@ -61,15 +57,13 @@ decode_c_lz5( /*void*/ )
 }
 
 /* ------------------------------------------------------------------------ */
-unsigned short
-decode_p_lz5( /*void*/ )
+unsigned short decode_p_lz5(void)
 {
        return (loc - matchpos - MAGIC5) & 0xfff;
 }
 
 /* ------------------------------------------------------------------------ */
-void
-decode_start_lz5( /*void*/ )
+void decode_start_lz5(void)
 {
        int             i;
 
index 9415584a63d3c3abf418c66c2153b9ea5572ee51..34a123c07434cbc0a4bc3916b2fd1bfddf4e37b2 100644 (file)
@@ -229,13 +229,13 @@ extern void               build_standard_archive_name();
 
 extern FILE            *open_old_archive();
 extern void            init_header();
-extern boolean get_header();
+extern boolean get_header(struct zfile *fp, LzHeader *hdr);
 extern boolean archive_is_msdos_sfx1();
 extern boolean skip_msdos_sfx1_code();
 extern void            write_header();
 extern void            write_archive_tail();
 extern void            copy_old_one();
-extern unsigned char *convdelim();
+extern unsigned char *convdelim(unsigned char *path, unsigned char delim);
 extern long            copyfile();
 
 extern void            cmd_list(), cmd_extract(), cmd_add(), cmd_delete();
@@ -246,7 +246,7 @@ extern char         *extract_directory;
 
 extern int             encode_alloc();
 extern void            encode();
-extern int             decode();
+extern int             decode(struct interfacing*);
 
 /* from append.c */
 extern void     start_indicator();
@@ -289,8 +289,8 @@ extern unsigned short decode_p_lz5();
 extern void                      decode_start_lzs();
 extern void                      decode_start_lz5();
 
-extern void    make_table(     /* int nchar, uchar bitlen[], int tablebits,
-                                                       ushort table[] */ );
+extern void lha_make_table(short nchar, unsigned char bitlen[], short tablebits, unsigned short table[]);
+
 
 /* from maketree.c */
 /*
@@ -303,13 +303,13 @@ extern short      make_tree( /* int nparm, ushort freqparm[], uchar lenparm[],
 
 /* from crcio.c */
 extern void                            make_crctable();
-extern unsigned short  calccrc( /* uchar *p, uint n */ );
-extern void                            fillbuf( /* uchar n */ );
-extern unsigned short  getbits( /* uchar n */ );
-extern void                            putcode( /* uchar n, ushort x */ );
-extern void                            putbits( /* uchar n, ushort x */ );
-extern int                             fread_crc( /* uchar *p, int n, FILE *f */ );
-extern void                            fwrite_crc( /* uchar *p, int n, FILE *f */ );
+extern unsigned short  calccrc(unsigned char *p, unsigned int n);
+extern void                            fillbuf(unsigned char n);
+extern unsigned short  getbits(unsigned char n);
+extern void                            putcode(unsigned char n, unsigned short x);
+extern void                            putbits(unsigned char n, unsigned short x);
+extern int                             fread_crc(unsigned char *p, int n, struct zfile *f);
+extern void                            fwrite_crc(unsigned char *p, int n, struct zfile *f);
 extern void                            init_getbits();
 extern void                            init_putbits();
 extern void                    make_crctable();
similarity index 92%
rename from archivers/lha/lhamaketbl.c
rename to archivers/lha/lhamaketbl.cpp
index 00bf544fb3e3849006ed035cc8748400bbc5618a..791636b94551492a6afe422f4ce2381a093d7153 100644 (file)
@@ -8,12 +8,7 @@
 /* ------------------------------------------------------------------------ */
 #include "lha.h"
 
-void
-lha_make_table(nchar, bitlen, tablebits, table)
-       short           nchar;
-       unsigned char   bitlen[];
-       short           tablebits;
-       unsigned short  table[];
+void lha_make_table(short nchar, unsigned char bitlen[], short tablebits, unsigned short table[])
 {
        unsigned short  count[17];      /* count of bitlen */
        unsigned short  weight[17];     /* 0x10000ul >> bitlen */
similarity index 89%
rename from archivers/lha/lharc.c
rename to archivers/lha/lharc.cpp
index 6c23f0e421f2b69eb89200a6f0ddf24ee8c24e85..6d006cb4876d894a8e4cc0f5fdf5d9302776a4a3 100644 (file)
@@ -129,9 +129,7 @@ init_variable()             /* Added N.Watazaki */
 /* ------------------------------------------------------------------------ */
 /*                                                                                                                                                     */
 /* ------------------------------------------------------------------------ */
-static int
-sort_by_ascii(a, b)
-       char          **a, **b;
+static int sort_by_ascii(char **a, char **b)
 {
        register char  *p, *q;
        register int    c1, c2;
@@ -159,12 +157,9 @@ sort_by_ascii(a, b)
 }
 
 /* ------------------------------------------------------------------------ */
-char           *
-xrealloc(old, size)
-       char           *old;
-       int             size;
+char *xxrealloc(char *old, int size)
 {
-       char           *p = (char *) realloc(old, size);
+       char           *p = (char *) xrealloc(char, old, size);
        if (!p)
                fatal_error(L"Not enough memory");
        return p;
@@ -189,26 +184,20 @@ xrealloc(old, size)
 */
 
 /* ------------------------------------------------------------------------ */
-void
-init_sp(sp)
-       struct string_pool *sp;
+void init_sp(struct string_pool *sp)
 {
        sp->size = 1024 - 8;    /* any ( >=0 ) */
        sp->used = 0;
        sp->n = 0;
-       sp->buffer = (char *) xmalloc(sp->size * sizeof(char));
+       sp->buffer = (char *) xmalloc(char, sp->size);
 }
 
 /* ------------------------------------------------------------------------ */
-void
-add_sp(sp, name, len)
-       struct string_pool *sp;
-       char           *name;   /* stored '\0' at tail */
-       int             len;    /* include '\0' */
+void add_sp(struct string_pool *sp, char *name, int len)
 {
        while (sp->used + len > sp->size) {
                sp->size *= 2;
-               sp->buffer = (char *) xrealloc(sp->buffer, sp->size * sizeof(char));
+               sp->buffer = (char *) xxrealloc(sp->buffer, sp->size * sizeof(char));
        }
        bcopy(name, sp->buffer + sp->used, len);
        sp->used += len;
@@ -216,17 +205,13 @@ add_sp(sp, name, len)
 }
 
 /* ------------------------------------------------------------------------ */
-void
-finish_sp(sp, v_count, v_vector)
-       register struct string_pool *sp;
-       int            *v_count;
-       char         ***v_vector;
+void finish_sp(struct string_pool *sp, int *v_count, char ***v_vector)
 {
        int             i;
        register char  *p;
        char          **v;
 
-       v = (char **) xmalloc((sp->n + 1) * sizeof(char *));
+       v = (char **) xmalloc(char*, sp->n + 1);
        *v++ = sp->buffer;
        *v_vector = v;
        *v_count = sp->n;
@@ -239,9 +224,7 @@ finish_sp(sp, v_count, v_vector)
 }
 
 /* ------------------------------------------------------------------------ */
-void
-free_sp(vector)
-       char          **vector;
+void free_sp(char **vector)
 {
        vector--;
        free(*vector);          /* free string pool */
@@ -252,9 +235,7 @@ free_sp(vector)
 /* ------------------------------------------------------------------------ */
 /*                                                     READ DIRECTORY FILES                                                    */
 /* ------------------------------------------------------------------------ */
-static          boolean
-include_path_p(path, name)
-       char           *path, *name;
+static boolean include_path_p(char *path, char *name)
 {
        char           *n = name;
        while (*path)
similarity index 91%
rename from archivers/lha/shuf.c
rename to archivers/lha/shuf.cpp
index 07d21fc80b3822e09d0eab81688adc0d0800ca2d..62e9b1aa610b605a15d3aa8a27f01f9ac754c0cc 100644 (file)
@@ -21,8 +21,7 @@ int             fixed[2][16] = {
        {2, 0x01, 0x01, 0x03, 0x06, 0x0D, 0x1F, 0x4E, 0}        /* 8K buf */
 };
 /* ------------------------------------------------------------------------ */
-void
-decode_start_st0( /*void*/ )
+void decode_start_st0(void)
 {
        n_max = 286;
        maxmatch = MAXMATCH;
@@ -49,9 +48,7 @@ encode_p_st0(j)
 }
 #endif
 /* ------------------------------------------------------------------------ */
-static void
-ready_made(method)
-       int             method;
+static void ready_made(int method)
 {
        int             i, j;
        unsigned int    code, weight;
@@ -87,8 +84,7 @@ encode_start_fix( /*void*/ )
 }
 #endif
 /* ------------------------------------------------------------------------ */
-static void
-read_tree_c( /*void*/ )
+static void read_tree_c(void)
 {                              /* read tree from file */
        int             i, c;
 
@@ -107,12 +103,11 @@ read_tree_c( /*void*/ )
                        return;
                }
        }
-       make_table(N1, c_len, 12, c_table);
+       lha_make_table(N1, c_len, 12, c_table);
 }
 
 /* ------------------------------------------------------------------------ */
-static void
-read_tree_p(/*void*/)
+static void read_tree_p(void)
 {                              /* read tree from file */
        int             i, c;
 
@@ -135,8 +130,7 @@ read_tree_p(/*void*/)
 }
 
 /* ------------------------------------------------------------------------ */
-void
-decode_start_fix(/*void*/)
+void decode_start_fix(void)
 {
        n_max = 314;
        maxmatch = 60;
@@ -144,12 +138,11 @@ decode_start_fix(/*void*/)
        np = 1 << (12 - 6);
        start_c_dyn();
        ready_made(0);
-       make_table(np, pt_len, 8, pt_table);
+       lha_make_table(np, pt_len, 8, pt_table);
 }
 
 /* ------------------------------------------------------------------------ */
-unsigned short
-decode_c_st0(/*void*/)
+unsigned short decode_c_st0(void)
 {
        int             i, j;
        static unsigned short blocksize = 0;
@@ -163,7 +156,7 @@ decode_c_st0(/*void*/)
                else {
                        ready_made(1);
                }
-               make_table(NP, pt_len, 8, pt_table);
+               lha_make_table(NP, pt_len, 8, pt_table);
        }
        blocksize--;
        j = c_table[lhabitbuf >> 4];
@@ -187,8 +180,7 @@ decode_c_st0(/*void*/)
 }
 
 /* ------------------------------------------------------------------------ */
-unsigned short
-decode_p_st0(/*void*/)
+unsigned short decode_p_st0(void)
 {
        int             i, j;
 
similarity index 99%
rename from archivers/lha/slide.c
rename to archivers/lha/slide.cpp
index ab721eac00e49d4a04c733ca59d1097601b88684..71af62be39f97e4f8b811c5d66cc5b506694b2d4 100644 (file)
@@ -378,9 +378,7 @@ struct interfacing *lhinterface;
 
 #endif
 
-int
-decode(lhinterface)
-       struct interfacing *lhinterface;
+int decode(struct interfacing *lhinterface)
 {
        unsigned int i, j, k, c;
        unsigned int dicsiz1, offset;
similarity index 99%
rename from archivers/lha/uae_lha.c
rename to archivers/lha/uae_lha.cpp
index 7547269f9c0cc75ebff0c7ada600dd35d418299c..6d9ad2b8569e5ccca58e95c0f9a9c2259decae83 100644 (file)
@@ -5,10 +5,9 @@
 
 #include "sysconfig.h"
 #include "sysdeps.h"
-#include "zfile.h"
+#include "lha.h"
 #include "zarchive.h"
 
-#include "lha.h"
 
 static char *methods[] =
 {
similarity index 96%
rename from archivers/lha/util.c
rename to archivers/lha/util.cpp
index 3c9c0c9a62737a59255ec90b33fadd6340c11c27..1492da1610933e2f507c1bd02e9ea3f30c28a0cf 100644 (file)
@@ -21,10 +21,7 @@ extern unsigned short crc;
 /*     convert path delimit
        erreturns *filename                                                                                                             */
 /* ------------------------------------------------------------------------ */
-unsigned char  *
-convdelim(path, delim)
-       unsigned char  *path;
-       unsigned char   delim;
+unsigned char *convdelim(unsigned char *path, unsigned char delim)
 {
        unsigned char   c;
        unsigned char  *p;
@@ -205,9 +202,7 @@ mkdir(path, mode)
  */
 
 #ifndef USESTRCASECMP
-static int
-my_toupper(n)
-       register int    n;
+static int my_toupper(int n)
 {
        if (n >= 'a' && n <= 'z')
                return n & (~('a' - 'A'));
@@ -215,9 +210,7 @@ my_toupper(n)
 }
 
 /* ------------------------------------------------------------------------ */
-int
-strucmp(s, t)
-       register char  *s, *t;
+int strucmp(char *s, char *t)
 {
        while (my_toupper(*s++) == my_toupper(*t++))
                if (!*s || !*t)
similarity index 98%
rename from archivers/lzx/unlzx.c
rename to archivers/lzx/unlzx.cpp
index 79530180ec134394c590e43d584498aa8bd77dff..a7b6d6e858f4eed24a1ab7eb098b1ab3de8e1a11 100644 (file)
@@ -642,9 +642,9 @@ struct zfile *archive_access_lzx (struct znode *zn)
     startpos = znlast->offset;
     compsize = znlast->packedsize;
     zfile_fseek (zf, startpos, SEEK_SET);
-    buf = xmalloc(compsize);
+    buf = xmalloc (uae_u8, compsize);
     zfile_fread (buf, compsize, 1, zf);
-    dbuf = xcalloc (unpsize, 1);
+    dbuf = xcalloc (uae_u8, unpsize);
 
     /* unpack complete block */
     memset(offset_len, 0, sizeof offset_len);
@@ -709,8 +709,8 @@ struct zvolume *archive_directory_lzx (struct zfile *in_file)
  unsigned int pack_size;
  unsigned int unpack_size;
  unsigned char archive_header[31];
unsigned char header_filename[256];
unsigned char header_comment[256];
+ char header_filename[256];
+ char header_comment[256];
 
  if (zfile_fread(archive_header, 1, 10, in_file) != 10)
      return 0;
@@ -742,7 +742,7 @@ struct zvolume *archive_directory_lzx (struct zfile *in_file)
       if(actual == temp)
       {
        header_filename[temp] = 0;
-       crc_calc(header_filename, temp);
+       crc_calc((unsigned char*)header_filename, temp);
        temp = archive_header[14]; /* comment length */
        actual = zfile_fread(header_comment, 1, temp, in_file);
        if(!zfile_ferror(in_file))
@@ -750,7 +750,7 @@ struct zvolume *archive_directory_lzx (struct zfile *in_file)
        if(actual == temp)
        {
         header_comment[temp] = 0;
-        crc_calc(header_comment, temp);
+        crc_calc((unsigned char*)header_comment, temp);
         if(sum == crc)
         {
          unsigned int year, month, day;
diff --git a/archivers/wrp/warp.c b/archivers/wrp/warp.c
deleted file mode 100644 (file)
index a1477ba..0000000
+++ /dev/null
@@ -1,481 +0,0 @@
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include "sysconfig.h"
-#include "sysdeps.h"
-#include "zfile.h"
-#include "crc32.h"
-
-/* based on http://libxad.cvs.sourceforge.net/libxad/libxad/portable/clients/ by Dirk Stoecker */
-
-#define XADERR_ILLEGALDATA 1
-#define XADERR_DECRUNCH 2
-#define XADERR_NOMEMORY 3
-
-struct rledata {
-  uae_u32 rledata;
-};
-
-struct fout {
-    struct zfile *zf;
-    int xio_BitNum;
-    int xio_BitBuf;
-    int err;
-};
-
-
-static void putrle (uae_u8 data, struct zfile *out, struct rledata *rled)
-{
-    int num;
-    uae_u32 a;
-
-    if (!rled) {
-       zfile_putc (data, out);
-       return;
-    }
-    a = rled->rledata;
-    if (a & 0x100) /* was RLE mode */
-    {
-       if (!data || (data == 1 && (a & 0x80000000))) {
-           a = 0x90; num = 1;
-       } else {
-           a &= 0xFF; num = data - 1;
-       }
-    } else if (data == 0x90) {
-       num = 0; a |= 0x100;
-    } else {
-       num = 1; a = data;
-    }
-    rled->rledata = a;
-    while (num--)
-       zfile_putc (a, out);
-}
-
-static uae_u32 xadIOGetBitsLow(struct fout *io, uae_u8 bits)
-{
-  uae_u32 x;
-
-  io->err = 0;
-  while(io->xio_BitNum < bits)
-  {
-      int v = zfile_getc (io->zf);
-      if (v == -1) {
-         io->err = 1;
-         return 0;
-      }
-      io->xio_BitBuf |= v << io->xio_BitNum;
-      io->xio_BitNum += 8;
-  }
-  x = io->xio_BitBuf & ((1<<bits)-1);
-  io->xio_BitBuf >>= bits;
-  io->xio_BitNum -= bits;
-  return x;
-}
-
-#define ARCSQSPEOF   256                /* special endfile token */
-#define ARCSQNUMVALS 257                /* 256 data values plus SPEOF */
-
-static uae_s32 ARCunsqueeze(struct zfile *in, struct zfile *out, struct rledata *rled)
-{
-  uae_s32 err = 0;
-  uae_s32 i, numnodes;
-  uae_s16 *node;
-  struct fout io;
-
-  io.zf = in;
-  io.xio_BitBuf = 0;
-  io.xio_BitNum = 0;
-  io.err = 0;
-
-  if((node = (uae_s16 *) xcalloc(2*2*ARCSQNUMVALS, 1)))
-  {
-    numnodes = xadIOGetBitsLow(&io, 16);
-
-    if(numnodes < 0 || numnodes >= ARCSQNUMVALS)
-      err = XADERR_DECRUNCH;
-    else
-    {  /* initialize for possible empty tree (SPEOF only) */
-      node[0] = node[1] = -(ARCSQSPEOF + 1);
-
-      numnodes *= 2; i = 0;
-      while(i < numnodes && !io.err)       /* get decoding tree from file */
-      {
-        node[i++] = xadIOGetBitsLow(&io, 16);
-        node[i++] = xadIOGetBitsLow(&io, 16);
-      }
-
-      do
-      {
-        /* follow bit stream in tree to a leaf */
-        i = 0;
-        while(i >= 0 && !io.err)
-          i = node[2*i + xadIOGetBitsLow(&io, 1)];
-
-        i = -(i + 1); /* decode fake node index to original data value */
-
-        if(i != ARCSQSPEOF)
-          putrle (i, out, rled);
-      } while(i != ARCSQSPEOF);
-    }
-    xfree(node);
-  }
-  else
-    err = XADERR_NOMEMORY;
-
-  return err;
-}
-
-
-
-
-#define UCOMPMAXCODE(n) (((uae_u32) 1 << (n)) - 1)
-#define UCOMPBITS          16
-#define UCOMPSTACKSIZE   8000
-#define UCOMPFIRST        257           /* first free entry */
-#define UCOMPCLEAR        256           /* table clear output code */
-#define UCOMPINIT_BITS      9           /* initial number of bits/code */
-#define UCOMPBIT_MASK    0x1f
-#define UCOMPBLOCK_MASK  0x80
-
-struct UCompData {
-  uae_s16   clear_flg;
-  uae_u16   n_bits;                 /* number of bits/code */
-  uae_u16   maxbits;                /* user settable max # bits/code */
-  uae_u32   maxcode;                /* maximum code, given n_bits */
-  uae_u32   maxmaxcode;
-  uae_s32   free_ent;
-  uae_s32   offset;
-  uae_s32   size;
-  uae_u16  *tab_prefixof;
-  uae_u8   *tab_suffixof;
-  uae_u8    stack[UCOMPSTACKSIZE];
-  uae_u8    buf[UCOMPBITS];
-  int      insize;
-  struct    rledata *rled;
-};
-
-
-/* Read one code from input. If EOF, return -1. */
-static uae_s32 UCompgetcode(struct zfile *in, struct UCompData *cd)
-{
-  uae_s32 code, r_off, bits;
-  uae_u8 *bp = cd->buf;
-
-  if(cd->clear_flg > 0 || cd->offset >= cd->size || cd->free_ent > cd->maxcode)
-  {
-    /*
-     * If the next entry will be too big for the current code
-     * size, then we must increase the size.  This implies reading
-     * a new buffer full, too.
-     */
-    if(cd->free_ent > cd->maxcode)
-    {
-      if(++cd->n_bits == cd->maxbits)
-        cd->maxcode = cd->maxmaxcode;   /* won't get any bigger now */
-      else
-        cd->maxcode = UCOMPMAXCODE(cd->n_bits);
-    }
-    if(cd->clear_flg > 0)
-    {
-      cd->maxcode = UCOMPMAXCODE(cd->n_bits = UCOMPINIT_BITS);
-      cd->clear_flg = 0;
-    }
-
-    /* This reads maximum n_bits characters into buf */
-    cd->size = 0;
-    while(cd->size < cd->n_bits) {
-       int v;
-       if (cd->insize == 0)
-           break;
-       v = zfile_getc (in);
-       if (v == -1)
-           break;
-       cd->insize--;
-       cd->buf[cd->size++] = v;
-    }
-    if(cd->size <= 0)
-      return -1;
-
-    cd->offset = 0;
-    /* Round size down to integral number of codes */
-    cd->size = (cd->size << 3) - (cd->n_bits - 1);
-  }
-
-  r_off = cd->offset;
-  bits = cd->n_bits;
-
-  /* Get to the first byte. */
-  bp += (r_off >> 3);
-  r_off &= 7;
-
-  /* Get first part (low order bits) */
-  code = (*bp++ >> r_off);
-  bits -= (8 - r_off);
-  r_off = 8 - r_off;                    /* now, offset into code word */
-
-  /* Get any 8 bit parts in the middle (<=1 for up to 16 bits). */
-  if(bits >= 8)
-  {
-    code |= *bp++ << r_off;
-    r_off += 8;
-    bits -= 8;
-  }
-
-  /* high order bits. */
-  code |= (*bp & ((1<<bits)-1)) << r_off;
-  cd->offset += cd->n_bits;
-
-  return code;
-}
-
-static uae_u32 xadIO_Compress(struct zfile *in, struct zfile *out, int insize, struct rledata *rled, uae_u8 bitinfo)
-{
-  int err = 0;
-  struct UCompData *cd;
-
-  if((bitinfo & UCOMPBIT_MASK) < UCOMPINIT_BITS)
-    return XADERR_ILLEGALDATA;
-
-  if((cd = xcalloc(sizeof(struct UCompData), 1)))
-  {
-    int finchar, code, oldcode, incode, blockcomp;
-    uae_u8 *stackp, *stack, *stackend;
-
-    stackp = stack = cd->stack;
-    stackend = stack + UCOMPSTACKSIZE;
-    cd->maxbits = bitinfo & UCOMPBIT_MASK;
-    blockcomp = bitinfo & UCOMPBLOCK_MASK;
-    cd->maxmaxcode = 1 << cd->maxbits;
-    cd->maxcode = UCOMPMAXCODE(cd->n_bits = UCOMPINIT_BITS);
-    cd->free_ent = blockcomp ? UCOMPFIRST : 256;
-    cd->insize = insize;
-    cd->rled = rled;
-
-    if((cd->tab_prefixof = xcalloc(sizeof(uae_u16) * cd->maxmaxcode, 1)))
-    {
-      if((cd->tab_suffixof = xcalloc(cd->maxmaxcode, 1)))
-      {
-        /* Initialize the first 256 entries in the table. */
-        for(code = 255; code >= 0; code--)
-          cd->tab_suffixof[code] = code;
-
-        if((finchar = oldcode = UCompgetcode(in, cd)) == -1)
-          err = XADERR_DECRUNCH;
-        else
-        {
-         putrle (finchar, out, cd->rled); /* first code must be 8 bits = uae_u8 */
-
-          while((code = UCompgetcode(in, cd)) > -1)
-          {
-            if((code == UCOMPCLEAR) && blockcomp)
-            {
-              for(code = 255; code >= 0; code--)
-                cd->tab_prefixof[code] = 0;
-              cd->clear_flg = 1;
-              cd->free_ent = UCOMPFIRST - 1;
-              if((code = UCompgetcode(in, cd)) == -1)
-                break;                                /* O, untimely death! */
-            }
-            incode = code;
-
-            /* Special case for KwKwK string. */
-            if(code >= cd->free_ent)
-            {
-              if(code > cd->free_ent)
-              {
-                err = XADERR_ILLEGALDATA;
-                break;
-              }
-              *stackp++ = finchar;
-              code = oldcode;
-            }
-
-            /* Generate output characters in reverse order */
-            while(stackp < stackend && code >= 256)
-            {
-              *stackp++ = cd->tab_suffixof[code];
-              code = cd->tab_prefixof[code];
-            }
-            if(stackp >= stackend)
-            {
-              err = XADERR_ILLEGALDATA;
-              break;
-            }
-            *(stackp++) = finchar = cd->tab_suffixof[code];
-
-            /* And put them out in forward order */
-            do
-            {
-              putrle (*(--stackp), out, cd->rled);
-            } while(stackp > stack);
-
-            /* Generate the new entry. */
-            if((code = cd->free_ent) < cd->maxmaxcode)
-            {
-              cd->tab_prefixof[code] = (uae_u16) oldcode;
-              cd->tab_suffixof[code] = finchar;
-              cd->free_ent = code+1;
-            }
-            /* Remember previous code. */
-            oldcode = incode;
-          }
-        }
-        xfree (cd->tab_suffixof);
-      }
-      else
-        err = XADERR_NOMEMORY;
-      xfree(cd->tab_prefixof);
-    }
-    else
-      err = XADERR_NOMEMORY;
-    xfree(cd);
-  }
-  else
-    err = XADERR_NOMEMORY;
-
-  return err;
-}
-
-static void MakeCRC16(uae_u16 *buf, uae_u16 ID)
-{
-  uae_u16 i, j, k;
-
-  for(i = 0; i < 256; ++i)
-  {
-    k = i;
-
-    for(j = 0; j < 8; ++j)
-    {
-      if(k & 1)
-        k = (k >> 1) ^ ID;
-      else
-        k >>= 1;
-    }
-    buf[i] = k;
-  }
-}
-
-static uae_u16 wrpcrc16 (uae_u16 *tab, uae_u8 *buf, int len)
-{
-    uae_u16 crc = 0;
-    while (len-- > 0)
-       crc = tab[(crc ^ *buf++) & 0xFF] ^ (crc >> 8);
-    return crc;
-}
-
-static int iswrp (uae_u8 *data)
-{
-    if(data[0] == 'W' && data[1] == 'a' && data[2] == 'r' && data[3] == 'p'
-       && data[4] == ' ' && data[5] == 'v' && data[6] == '1' && data[7] == '.'
-       && data[8] == '1' && !data[9] && !data[18] && data[19] <= 3)
-           return 1;
-    return 0;
-}
-
-#define COMPBUF 30000
-
-struct zfile *unwarp(struct zfile *zf)
-{
-    int err = 0;
-    uae_u8 buf[26] = { 0 };
-    int algo, side, track;
-    int pos, dstpos, olddstpos;
-    uae_u16 crc;
-    uae_u32 size;
-    struct zfile *nf = NULL, *tmpf = NULL;
-    uae_u8 *zero, *data;
-    int outsize = 11 * 512;
-    int outsize2 = 11 * (512 + 16);
-    struct rledata rled;
-    uae_u16 wrpcrc16table[256];
-
-    MakeCRC16 (wrpcrc16table, 0xa001);
-
-    zero = xcalloc (outsize2, 1);
-    olddstpos = 0;
-    for (;;) {
-       if (zfile_fread (buf, sizeof buf, 1, zf) == 0)
-           break;
-       if (!iswrp (buf))
-           break;
-       if (!nf) {
-           nf = zfile_fopen_empty (zf, L"zipped.wrp", 1760 * 512);
-           tmpf = zfile_fopen_empty (zf, L"tmp", outsize2);
-       }
-       track = (buf[10] << 8) | buf[11];
-        algo = buf[19];
-       side = -1;
-       if (!memcmp (buf + 12, "BOT\0", 4))
-           side = 1;
-       if (!memcmp (buf + 12, "TOP\0", 4))
-           side = 0;
-       crc = (buf[20] << 8) | buf[21];
-       pos = zfile_ftell (zf);
-       dstpos = -1;
-       if (side >= 0 && track >= 0 && track <= 79)
-           dstpos = track * 22 * 512 + (side * 11 * 512);
-        zfile_fseek (tmpf, 0, SEEK_SET);
-       zfile_fwrite (zero, outsize2, 1, tmpf);
-        zfile_fseek (tmpf, 0, SEEK_SET);
-       size = (buf[22] << 24) | (buf[23] << 16) | (buf[24] << 8) | buf[25];
-       err = 0;
-       memset (&rled, 0, sizeof rled);
-
-       switch (algo)
-       {
-           case 1:
-               if (zfile_getc (zf) != 12)
-                   err = XADERR_ILLEGALDATA;
-               else
-                   err = xadIO_Compress (zf, tmpf, size - 1, &rled, 12 | UCOMPBLOCK_MASK);
-           break;
-           case 2:
-               err = ARCunsqueeze (zf, tmpf, &rled);
-           break;
-           case 0:
-           case 3:
-           {
-               int i;
-               for (i = 0; i < size; i++) {
-                   uae_u8 v = zfile_getc (zf);
-                   putrle (v, tmpf, algo == 3 ? &rled : NULL);
-               }
-           }
-           break;
-           default:
-               write_log (L"WRP unknown compression method %d, track=%d,size=%d\n", algo, track, side);
-               goto end;
-           break;
-       }
-       if (err) {
-           write_log (L"WRP corrupt data, track=%d,side=%d,err=%d\n", track, side, err);
-       } else {
-           uae_u16 crc2;
-           int os = zfile_ftell (tmpf);
-           data = zfile_getdata (tmpf, 0, os);
-           crc2 = wrpcrc16 (wrpcrc16table, data, os);
-           if (crc != crc2)
-               write_log (L"WRP crc error %04x<>%04x, track=%d,side=%d\n", crc, crc2, track, side);
-           xfree (data);
-       }
-       if (dstpos >= 0) {
-           zfile_fseek (nf, dstpos, SEEK_SET);
-           data = zfile_getdata (tmpf, 0, outsize);
-           zfile_fwrite (data, outsize, 1, nf);
-       }
-        zfile_fseek (zf, pos + size, SEEK_SET);
-    }
-end:
-    xfree (zero);
-    zfile_fclose (tmpf);
-    if (nf) {
-       zfile_fclose (zf);
-       zf = nf;
-    }
-    return zf;
-}
-
diff --git a/archivers/wrp/warp.cpp b/archivers/wrp/warp.cpp
new file mode 100644 (file)
index 0000000..529a6e4
--- /dev/null
@@ -0,0 +1,481 @@
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "sysconfig.h"
+#include "sysdeps.h"
+#include "zfile.h"
+#include "crc32.h"
+
+/* based on http://libxad.cvs.sourceforge.net/libxad/libxad/portable/clients/ by Dirk Stoecker */
+
+#define XADERR_ILLEGALDATA 1
+#define XADERR_DECRUNCH 2
+#define XADERR_NOMEMORY 3
+
+struct rledata {
+       uae_u32 rledatav;
+};
+
+struct fout {
+       struct zfile *zf;
+       int xio_BitNum;
+       int xio_BitBuf;
+       int err;
+};
+
+
+static void putrle (uae_u8 data, struct zfile *out, struct rledata *rled)
+{
+       int num;
+       uae_u32 a;
+
+       if (!rled) {
+               zfile_putc (data, out);
+               return;
+       }
+       a = rled->rledatav;
+       if (a & 0x100) /* was RLE mode */
+       {
+               if (!data || (data == 1 && (a & 0x80000000))) {
+                       a = 0x90; num = 1;
+               } else {
+                       a &= 0xFF; num = data - 1;
+               }
+       } else if (data == 0x90) {
+               num = 0; a |= 0x100;
+       } else {
+               num = 1; a = data;
+       }
+       rled->rledatav = a;
+       while (num--)
+               zfile_putc (a, out);
+}
+
+static uae_u32 xadIOGetBitsLow(struct fout *io, uae_u8 bits)
+{
+       uae_u32 x;
+
+       io->err = 0;
+       while(io->xio_BitNum < bits)
+       {
+               int v = zfile_getc (io->zf);
+               if (v == -1) {
+                       io->err = 1;
+                       return 0;
+               }
+               io->xio_BitBuf |= v << io->xio_BitNum;
+               io->xio_BitNum += 8;
+       }
+       x = io->xio_BitBuf & ((1<<bits)-1);
+       io->xio_BitBuf >>= bits;
+       io->xio_BitNum -= bits;
+       return x;
+}
+
+#define ARCSQSPEOF   256                /* special endfile token */
+#define ARCSQNUMVALS 257                /* 256 data values plus SPEOF */
+
+static uae_s32 ARCunsqueeze(struct zfile *in, struct zfile *out, struct rledata *rled)
+{
+       uae_s32 err = 0;
+       uae_s32 i, numnodes;
+       uae_s16 *node;
+       struct fout io;
+
+       io.zf = in;
+       io.xio_BitBuf = 0;
+       io.xio_BitNum = 0;
+       io.err = 0;
+
+       if((node = (uae_s16 *) xcalloc(uae_s16, 2*ARCSQNUMVALS)))
+       {
+               numnodes = xadIOGetBitsLow(&io, 16);
+
+               if(numnodes < 0 || numnodes >= ARCSQNUMVALS)
+                       err = XADERR_DECRUNCH;
+               else
+               {  /* initialize for possible empty tree (SPEOF only) */
+                       node[0] = node[1] = -(ARCSQSPEOF + 1);
+
+                       numnodes *= 2; i = 0;
+                       while(i < numnodes && !io.err)       /* get decoding tree from file */
+                       {
+                               node[i++] = xadIOGetBitsLow(&io, 16);
+                               node[i++] = xadIOGetBitsLow(&io, 16);
+                       }
+
+                       do
+                       {
+                               /* follow bit stream in tree to a leaf */
+                               i = 0;
+                               while(i >= 0 && !io.err)
+                                       i = node[2*i + xadIOGetBitsLow(&io, 1)];
+
+                               i = -(i + 1); /* decode fake node index to original data value */
+
+                               if(i != ARCSQSPEOF)
+                                       putrle (i, out, rled);
+                       } while(i != ARCSQSPEOF);
+               }
+               xfree(node);
+       }
+       else
+               err = XADERR_NOMEMORY;
+
+       return err;
+}
+
+
+
+
+#define UCOMPMAXCODE(n) (((uae_u32) 1 << (n)) - 1)
+#define UCOMPBITS          16
+#define UCOMPSTACKSIZE   8000
+#define UCOMPFIRST        257           /* first free entry */
+#define UCOMPCLEAR        256           /* table clear output code */
+#define UCOMPINIT_BITS      9           /* initial number of bits/code */
+#define UCOMPBIT_MASK    0x1f
+#define UCOMPBLOCK_MASK  0x80
+
+struct UCompData {
+       uae_s16   clear_flg;
+       uae_u16   n_bits;                 /* number of bits/code */
+       uae_u16   maxbits;                /* user settable max # bits/code */
+       uae_u32   maxcode;                /* maximum code, given n_bits */
+       uae_u32   maxmaxcode;
+       uae_s32   free_ent;
+       uae_s32   offset;
+       uae_s32   size;
+       uae_u16  *tab_prefixof;
+       uae_u8   *tab_suffixof;
+       uae_u8    stack[UCOMPSTACKSIZE];
+       uae_u8    buf[UCOMPBITS];
+       int         insize;
+       struct    rledata *rled;
+};
+
+
+/* Read one code from input. If EOF, return -1. */
+static uae_s32 UCompgetcode(struct zfile *in, struct UCompData *cd)
+{
+       uae_s32 code, r_off, bits;
+       uae_u8 *bp = cd->buf;
+
+       if(cd->clear_flg > 0 || cd->offset >= cd->size || cd->free_ent > cd->maxcode)
+       {
+               /*
+               * If the next entry will be too big for the current code
+               * size, then we must increase the size.  This implies reading
+               * a new buffer full, too.
+               */
+               if(cd->free_ent > cd->maxcode)
+               {
+                       if(++cd->n_bits == cd->maxbits)
+                               cd->maxcode = cd->maxmaxcode;   /* won't get any bigger now */
+                       else
+                               cd->maxcode = UCOMPMAXCODE(cd->n_bits);
+               }
+               if(cd->clear_flg > 0)
+               {
+                       cd->maxcode = UCOMPMAXCODE(cd->n_bits = UCOMPINIT_BITS);
+                       cd->clear_flg = 0;
+               }
+
+               /* This reads maximum n_bits characters into buf */
+               cd->size = 0;
+               while(cd->size < cd->n_bits) {
+                       int v;
+                       if (cd->insize == 0)
+                               break;
+                       v = zfile_getc (in);
+                       if (v == -1)
+                               break;
+                       cd->insize--;
+                       cd->buf[cd->size++] = v;
+               }
+               if(cd->size <= 0)
+                       return -1;
+
+               cd->offset = 0;
+               /* Round size down to integral number of codes */
+               cd->size = (cd->size << 3) - (cd->n_bits - 1);
+       }
+
+       r_off = cd->offset;
+       bits = cd->n_bits;
+
+       /* Get to the first byte. */
+       bp += (r_off >> 3);
+       r_off &= 7;
+
+       /* Get first part (low order bits) */
+       code = (*bp++ >> r_off);
+       bits -= (8 - r_off);
+       r_off = 8 - r_off;                    /* now, offset into code word */
+
+       /* Get any 8 bit parts in the middle (<=1 for up to 16 bits). */
+       if(bits >= 8)
+       {
+               code |= *bp++ << r_off;
+               r_off += 8;
+               bits -= 8;
+       }
+
+       /* high order bits. */
+       code |= (*bp & ((1<<bits)-1)) << r_off;
+       cd->offset += cd->n_bits;
+
+       return code;
+}
+
+static uae_u32 xadIO_Compress(struct zfile *in, struct zfile *out, int insize, struct rledata *rled, uae_u8 bitinfo)
+{
+       int err = 0;
+       struct UCompData *cd;
+
+       if((bitinfo & UCOMPBIT_MASK) < UCOMPINIT_BITS)
+               return XADERR_ILLEGALDATA;
+
+       if((cd = xcalloc(struct UCompData, 1)))
+       {
+               int finchar, code, oldcode, incode, blockcomp;
+               uae_u8 *stackp, *stack, *stackend;
+
+               stackp = stack = cd->stack;
+               stackend = stack + UCOMPSTACKSIZE;
+               cd->maxbits = bitinfo & UCOMPBIT_MASK;
+               blockcomp = bitinfo & UCOMPBLOCK_MASK;
+               cd->maxmaxcode = 1 << cd->maxbits;
+               cd->maxcode = UCOMPMAXCODE(cd->n_bits = UCOMPINIT_BITS);
+               cd->free_ent = blockcomp ? UCOMPFIRST : 256;
+               cd->insize = insize;
+               cd->rled = rled;
+
+               if((cd->tab_prefixof = xcalloc(uae_u16, cd->maxmaxcode)))
+               {
+                       if((cd->tab_suffixof = xcalloc(uae_u8, cd->maxmaxcode)))
+                       {
+                               /* Initialize the first 256 entries in the table. */
+                               for(code = 255; code >= 0; code--)
+                                       cd->tab_suffixof[code] = code;
+
+                               if((finchar = oldcode = UCompgetcode(in, cd)) == -1)
+                                       err = XADERR_DECRUNCH;
+                               else
+                               {
+                                       putrle (finchar, out, cd->rled); /* first code must be 8 bits = uae_u8 */
+
+                                       while((code = UCompgetcode(in, cd)) > -1)
+                                       {
+                                               if((code == UCOMPCLEAR) && blockcomp)
+                                               {
+                                                       for(code = 255; code >= 0; code--)
+                                                               cd->tab_prefixof[code] = 0;
+                                                       cd->clear_flg = 1;
+                                                       cd->free_ent = UCOMPFIRST - 1;
+                                                       if((code = UCompgetcode(in, cd)) == -1)
+                                                               break;                                /* O, untimely death! */
+                                               }
+                                               incode = code;
+
+                                               /* Special case for KwKwK string. */
+                                               if(code >= cd->free_ent)
+                                               {
+                                                       if(code > cd->free_ent)
+                                                       {
+                                                               err = XADERR_ILLEGALDATA;
+                                                               break;
+                                                       }
+                                                       *stackp++ = finchar;
+                                                       code = oldcode;
+                                               }
+
+                                               /* Generate output characters in reverse order */
+                                               while(stackp < stackend && code >= 256)
+                                               {
+                                                       *stackp++ = cd->tab_suffixof[code];
+                                                       code = cd->tab_prefixof[code];
+                                               }
+                                               if(stackp >= stackend)
+                                               {
+                                                       err = XADERR_ILLEGALDATA;
+                                                       break;
+                                               }
+                                               *(stackp++) = finchar = cd->tab_suffixof[code];
+
+                                               /* And put them out in forward order */
+                                               do
+                                               {
+                                                       putrle (*(--stackp), out, cd->rled);
+                                               } while(stackp > stack);
+
+                                               /* Generate the new entry. */
+                                               if((code = cd->free_ent) < cd->maxmaxcode)
+                                               {
+                                                       cd->tab_prefixof[code] = (uae_u16) oldcode;
+                                                       cd->tab_suffixof[code] = finchar;
+                                                       cd->free_ent = code+1;
+                                               }
+                                               /* Remember previous code. */
+                                               oldcode = incode;
+                                       }
+                               }
+                               xfree (cd->tab_suffixof);
+                       }
+                       else
+                               err = XADERR_NOMEMORY;
+                       xfree(cd->tab_prefixof);
+               }
+               else
+                       err = XADERR_NOMEMORY;
+               xfree(cd);
+       }
+       else
+               err = XADERR_NOMEMORY;
+
+       return err;
+}
+
+static void MakeCRC16(uae_u16 *buf, uae_u16 ID)
+{
+       uae_u16 i, j, k;
+
+       for(i = 0; i < 256; ++i)
+       {
+               k = i;
+
+               for(j = 0; j < 8; ++j)
+               {
+                       if(k & 1)
+                               k = (k >> 1) ^ ID;
+                       else
+                               k >>= 1;
+               }
+               buf[i] = k;
+       }
+}
+
+static uae_u16 wrpcrc16 (uae_u16 *tab, uae_u8 *buf, int len)
+{
+       uae_u16 crc = 0;
+       while (len-- > 0)
+               crc = tab[(crc ^ *buf++) & 0xFF] ^ (crc >> 8);
+       return crc;
+}
+
+static int iswrp (uae_u8 *data)
+{
+       if(data[0] == 'W' && data[1] == 'a' && data[2] == 'r' && data[3] == 'p'
+               && data[4] == ' ' && data[5] == 'v' && data[6] == '1' && data[7] == '.'
+               && data[8] == '1' && !data[9] && !data[18] && data[19] <= 3)
+               return 1;
+       return 0;
+}
+
+#define COMPBUF 30000
+
+struct zfile *unwarp(struct zfile *zf)
+{
+       int err = 0;
+       uae_u8 buf[26] = { 0 };
+       int algo, side, track;
+       int pos, dstpos, olddstpos;
+       uae_u16 crc;
+       uae_u32 size;
+       struct zfile *nf = NULL, *tmpf = NULL;
+       uae_u8 *zero, *data;
+       int outsize = 11 * 512;
+       int outsize2 = 11 * (512 + 16);
+       struct rledata rled;
+       uae_u16 wrpcrc16table[256];
+
+       MakeCRC16 (wrpcrc16table, 0xa001);
+
+       zero = xcalloc (uae_u8, outsize2);
+       olddstpos = 0;
+       for (;;) {
+               if (zfile_fread (buf, sizeof buf, 1, zf) == 0)
+                       break;
+               if (!iswrp (buf))
+                       break;
+               if (!nf) {
+                       nf = zfile_fopen_empty (zf, L"zipped.wrp", 1760 * 512);
+                       tmpf = zfile_fopen_empty (zf, L"tmp", outsize2);
+               }
+               track = (buf[10] << 8) | buf[11];
+               algo = buf[19];
+               side = -1;
+               if (!memcmp (buf + 12, "BOT\0", 4))
+                       side = 1;
+               if (!memcmp (buf + 12, "TOP\0", 4))
+                       side = 0;
+               crc = (buf[20] << 8) | buf[21];
+               pos = zfile_ftell (zf);
+               dstpos = -1;
+               if (side >= 0 && track >= 0 && track <= 79)
+                       dstpos = track * 22 * 512 + (side * 11 * 512);
+               zfile_fseek (tmpf, 0, SEEK_SET);
+               zfile_fwrite (zero, outsize2, 1, tmpf);
+               zfile_fseek (tmpf, 0, SEEK_SET);
+               size = (buf[22] << 24) | (buf[23] << 16) | (buf[24] << 8) | buf[25];
+               err = 0;
+               memset (&rled, 0, sizeof rled);
+
+               switch (algo)
+               {
+               case 1:
+                       if (zfile_getc (zf) != 12)
+                               err = XADERR_ILLEGALDATA;
+                       else
+                               err = xadIO_Compress (zf, tmpf, size - 1, &rled, 12 | UCOMPBLOCK_MASK);
+                       break;
+               case 2:
+                       err = ARCunsqueeze (zf, tmpf, &rled);
+                       break;
+               case 0:
+               case 3:
+                       {
+                               int i;
+                               for (i = 0; i < size; i++) {
+                                       uae_u8 v = zfile_getc (zf);
+                                       putrle (v, tmpf, algo == 3 ? &rled : NULL);
+                               }
+                       }
+                       break;
+               default:
+                       write_log (L"WRP unknown compression method %d, track=%d,size=%d\n", algo, track, side);
+                       goto end;
+                       break;
+               }
+               if (err) {
+                       write_log (L"WRP corrupt data, track=%d,side=%d,err=%d\n", track, side, err);
+               } else {
+                       uae_u16 crc2;
+                       int os = zfile_ftell (tmpf);
+                       data = zfile_getdata (tmpf, 0, os);
+                       crc2 = wrpcrc16 (wrpcrc16table, data, os);
+                       if (crc != crc2)
+                               write_log (L"WRP crc error %04x<>%04x, track=%d,side=%d\n", crc, crc2, track, side);
+                       xfree (data);
+               }
+               if (dstpos >= 0) {
+                       zfile_fseek (nf, dstpos, SEEK_SET);
+                       data = zfile_getdata (tmpf, 0, outsize);
+                       zfile_fwrite (data, outsize, 1, nf);
+               }
+               zfile_fseek (zf, pos + size, SEEK_SET);
+       }
+end:
+       xfree (zero);
+       zfile_fclose (tmpf);
+       if (nf) {
+               zfile_fclose (zf);
+               zf = nf;
+       }
+       return zf;
+}
+
similarity index 100%
rename from archivers/xfd/main.c
rename to archivers/xfd/main.cpp
similarity index 100%
rename from archivers/xfd/xfd.c
rename to archivers/xfd/xfd.cpp
similarity index 91%
rename from archivers/zip/unzip.c
rename to archivers/zip/unzip.cpp
index 7f874394959d9d1541e33c5136196e87fb9cc6d4..6c28b8d69522777f9d6072ec376d59c3159b8580 100644 (file)
@@ -137,9 +137,7 @@ typedef     struct
 */
 
 
-local int unzlocal_getByte(fin,pi)
-       struct zfile *fin;
-       int *pi;
+local int unzlocal_getByte(struct zfile *fin,int *pi)
 {
     unsigned char c;
        int err = zfile_fread(&c, 1, 1, fin);
@@ -158,9 +156,7 @@ local int unzlocal_getByte(fin,pi)
 /* ===========================================================================
    Reads a long in LSB order from the given gz_stream. Sets
 */
-local int unzlocal_getShort (fin,pX)
-       struct zfile* fin;
-    uLong *pX;
+local int unzlocal_getShort (struct zfile *fin,uLong *pX)
 {
     uLong x ;
     int i;
@@ -180,9 +176,7 @@ local int unzlocal_getShort (fin,pX)
     return err;
 }
 
-local int unzlocal_getLong (fin,pX)
-       struct zfile* fin;
-    uLong *pX;
+local int unzlocal_getLong (struct zfile *fin, uLong *pX)
 {
     uLong x ;
     int i;
@@ -212,9 +206,7 @@ local int unzlocal_getLong (fin,pX)
 
 
 /* My own strcmpi / strcasecmp */
-local int strcmpcasenosensitive_internal (fileName1,fileName2)
-       const char* fileName1;
-       const char* fileName2;
+local int strcmpcasenosensitive_internal (const char *fileName1, const char *fileName2)
 {
        for (;;)
        {
@@ -255,10 +247,7 @@ local int strcmpcasenosensitive_internal (fileName1,fileName2)
        (like 1 on Unix, 2 on Windows)
 
 */
-extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity)
-       const char* fileName1;
-       const char* fileName2;
-       int iCaseSensitivity;
+extern int ZEXPORT unzStringFileNameCompare (const char*fileName1, const char*fileName2, int iCaseSensitivity)
 {
        if (iCaseSensitivity==0)
                iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE;
@@ -275,8 +264,7 @@ extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivit
   Locate the Central directory of a zipfile (at the end, just before
     the global comment)
 */
-local uLong unzlocal_SearchCentralDir(fin)
-       struct zfile *fin;
+local uLong unzlocal_SearchCentralDir(struct zfile *fin)
 {
        unsigned char* buf;
        uLong uSizeFile;
@@ -340,8 +328,7 @@ local uLong unzlocal_SearchCentralDir(fin)
      Else, the return value is a unzFile Handle, usable with other function
           of this unzip package.
 */
-extern unzFile ZEXPORT unzOpen (fin)
-       struct zfile *fin;
+extern unzFile ZEXPORT unzOpen (struct zfile *fin)
 {
        unz_s us;
        unz_s *s;
@@ -431,8 +418,7 @@ extern unzFile ZEXPORT unzOpen (fin)
   If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
     these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
   return UNZ_OK if there is no problem. */
-extern int ZEXPORT unzClose (file)
-       unzFile file;
+extern int ZEXPORT unzClose (unzFile file)
 {
        unz_s* s;
        if (file==NULL)
@@ -451,9 +437,7 @@ extern int ZEXPORT unzClose (file)
   Write info about the ZipFile in the *pglobal_info structure.
   No preparation of the structure is needed
   return UNZ_OK if there is no problem. */
-extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info)
-       unzFile file;
-       unz_global_info *pglobal_info;
+extern int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info *pglobal_info)
 {
        unz_s* s;
        if (file==NULL)
@@ -467,9 +451,7 @@ extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info)
 /*
    Translate date/time from Dos format to tm_unz (readable more easilty)
 */
-local void unzlocal_DosDateToTmuDate (ulDosDate, ptm)
-    uLong ulDosDate;
-    tm_unz* ptm;
+local void unzlocal_DosDateToTmuDate (uLong ulDosDate, tm_unz *ptm)
 {
     uLong uDate;
     uDate = (uLong)(ulDosDate>>16);
@@ -496,21 +478,12 @@ local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file,
                                                  char *szComment,
                                                                                                  uLong commentBufferSize));
 
-local int unzlocal_GetCurrentFileInfoInternal (file,
-                                             pfile_info,
-                                             pfile_info_internal,
-                                             szFileName, fileNameBufferSize,
-                                             extraField, extraFieldBufferSize,
-                                             szComment,  commentBufferSize)
-       unzFile file;
-       unz_file_info *pfile_info;
-       unz_file_info_internal *pfile_info_internal;
-       char *szFileName;
-       uLong fileNameBufferSize;
-       void *extraField;
-       uLong extraFieldBufferSize;
-       char *szComment;
-       uLong commentBufferSize;
+local int unzlocal_GetCurrentFileInfoInternal (unzFile file,
+                                             unz_file_info *pfile_info,
+                                             unz_file_info_internal *pfile_info_internal,
+                                             char *szFileName, uLong fileNameBufferSize,
+                                             void *extraField, uLong extraFieldBufferSize,
+                                             char *szComment,  uLong commentBufferSize)
 {
        unz_s* s;
        unz_file_info file_info;
@@ -661,19 +634,11 @@ local int unzlocal_GetCurrentFileInfoInternal (file,
   No preparation of the structure is needed
   return UNZ_OK if there is no problem.
 */
-extern int ZEXPORT unzGetCurrentFileInfo (file,
-                                                 pfile_info,
-                                                 szFileName, fileNameBufferSize,
-                                                 extraField, extraFieldBufferSize,
-                                                 szComment,  commentBufferSize)
-       unzFile file;
-       unz_file_info *pfile_info;
-       char *szFileName;
-       uLong fileNameBufferSize;
-       void *extraField;
-       uLong extraFieldBufferSize;
-       char *szComment;
-       uLong commentBufferSize;
+extern int ZEXPORT unzGetCurrentFileInfo (unzFile file,
+                                                 unz_file_info *pfile_info,
+                                                 char *szFileName, uLong fileNameBufferSize,
+                                                 void *extraField, uLong extraFieldBufferSize,
+                                                 char *szComment,  uLong commentBufferSize)
 {
        return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL,
                                                                                                szFileName,fileNameBufferSize,
@@ -685,8 +650,7 @@ extern int ZEXPORT unzGetCurrentFileInfo (file,
   Set the current file of the zipfile to the first file.
   return UNZ_OK if there is no problem
 */
-extern int ZEXPORT unzGoToFirstFile (file)
-       unzFile file;
+extern int ZEXPORT unzGoToFirstFile (unzFile file)
 {
        int err=UNZ_OK;
        unz_s* s;
@@ -708,8 +672,7 @@ extern int ZEXPORT unzGoToFirstFile (file)
   return UNZ_OK if there is no problem
   return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
 */
-extern int ZEXPORT unzGoToNextFile (file)
-       unzFile file;
+extern int ZEXPORT unzGoToNextFile (unzFile file)
 {
        unz_s* s;
        int err;
@@ -741,10 +704,7 @@ extern int ZEXPORT unzGoToNextFile (file)
   UNZ_OK if the file is found. It becomes the current file.
   UNZ_END_OF_LIST_OF_FILE if the file is not found
 */
-extern int ZEXPORT unzLocateFile (file,        szFileName, iCaseSensitivity)
-       unzFile file;
-       const char *szFileName;
-       int iCaseSensitivity;
+extern int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity)
 {
        unz_s* s;
        int err;
@@ -794,13 +754,9 @@ extern int ZEXPORT unzLocateFile (file,    szFileName, iCaseSensitivity)
   store in *piSizeVar the size of extra info in local header
        (filename and size of extra field data)
 */
-local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
-                                                                                                       poffset_local_extrafield,
-                                                                                                       psize_local_extrafield)
-       unz_s* s;
-       uInt* piSizeVar;
-       uLong *poffset_local_extrafield;
-       uInt  *psize_local_extrafield;
+local int unzlocal_CheckCurrentFileCoherencyHeader (unz_s *s, uInt *piSizeVar,
+                                                                                                       uLong *poffset_local_extrafield,
+                                                                                                       uInt *psize_local_extrafield)
 {
        uLong uMagic,uData,uFlags;
        uLong size_filename;
@@ -884,8 +840,7 @@ local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
   Open for reading data the current file in the zipfile.
   If there is no error and the file is opened, the return value is UNZ_OK.
 */
-extern int ZEXPORT unzOpenCurrentFile (file)
-       unzFile file;
+extern int ZEXPORT unzOpenCurrentFile (unzFile file)
 {
        int err=UNZ_OK;
        int Store;
@@ -985,10 +940,7 @@ extern int ZEXPORT unzOpenCurrentFile (file)
   return <0 with error code if there is an error
     (UNZ_ERRNO for IO error, or zLib error for uncompress error)
 */
-extern int ZEXPORT unzReadCurrentFile  (file, buf, len)
-       unzFile file;
-       voidp buf;
-       unsigned len;
+extern int ZEXPORT unzReadCurrentFile  (unzFile file, voidp buf, unsigned int len)
 {
        int err=UNZ_OK;
        uInt iRead = 0;
@@ -1112,8 +1064,7 @@ extern int ZEXPORT unzReadCurrentFile  (file, buf, len)
 /*
   Give the current position in uncompressed data
 */
-extern z_off_t ZEXPORT unztell (file)
-       unzFile file;
+extern z_off_t ZEXPORT unztell (unzFile file)
 {
        unz_s* s;
        file_in_zip_read_info_s* pfile_in_zip_read_info;
@@ -1132,8 +1083,7 @@ extern z_off_t ZEXPORT unztell (file)
 /*
   return 1 if the end of file was reached, 0 elsewhere
 */
-extern int ZEXPORT unzeof (file)
-       unzFile file;
+extern int ZEXPORT unzeof (unzFile file)
 {
        unz_s* s;
        file_in_zip_read_info_s* pfile_in_zip_read_info;
@@ -1165,10 +1115,7 @@ extern int ZEXPORT unzeof (file)
   the return value is the number of bytes copied in buf, or (if <0)
        the error code
 */
-extern int ZEXPORT unzGetLocalExtrafield (file,buf,len)
-       unzFile file;
-       voidp buf;
-       unsigned len;
+extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned int len)
 {
        unz_s* s;
        file_in_zip_read_info_s* pfile_in_zip_read_info;
@@ -1212,8 +1159,7 @@ extern int ZEXPORT unzGetLocalExtrafield (file,buf,len)
   Close the file in zip opened with unzipOpenCurrentFile
   Return UNZ_CRCERROR if all the file was read but the CRC is not good
 */
-extern int ZEXPORT unzCloseCurrentFile (file)
-       unzFile file;
+extern int ZEXPORT unzCloseCurrentFile (unzFile file)
 {
        int err=UNZ_OK;
 
@@ -1254,10 +1200,7 @@ extern int ZEXPORT unzCloseCurrentFile (file)
   uSizeBuf is the size of the szComment buffer.
   return the number of byte copied or an error code <0
 */
-extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf)
-       unzFile file;
-       char *szComment;
-       uLong uSizeBuf;
+extern int ZEXPORT unzGetGlobalComment (unzFile file, char *szComment, uLong uSizeBuf)
 {
        int err=UNZ_OK;
        unz_s* s;
similarity index 99%
rename from audio.c
rename to audio.cpp
index 589685ea97a08e44b102e2a3f85773c3d56f736a..13c3169bb544797ebbcb40d97c796d25904debf9 100644 (file)
--- a/audio.c
+++ b/audio.cpp
@@ -68,7 +68,7 @@ static int debugchannel (int ch)
 * entries so that CPU updates during minimum period can be played back. */
 #define SINC_QUEUE_LENGTH (SINC_QUEUE_MAX_AGE / 16 + 2)
 
-#include "sinctable.c"
+#include "sinctable.cpp"
 
 typedef struct {
        int age, output;
@@ -240,7 +240,7 @@ static void do_samplerip (struct audio_channel_data *adp)
                        /* replace old identical but shorter sample */
                        if (len > rs->len && !memcmp (rs->sample, smp, rs->len)) {
                                xfree (rs->sample);
-                               rs->sample = xmalloc (len);
+                               rs->sample = xmalloc (uae_u8, len);
                                memcpy (rs->sample, smp, len);
                                write_log (L"SAMPLERIPPER: replaced sample %d (%d -> %d)\n", cnt, rs->len, len);
                                rs->len = len;
@@ -256,14 +256,14 @@ static void do_samplerip (struct audio_channel_data *adp)
        }
        if (rs || cnt > 100)
                return;
-       rs = xmalloc (sizeof(struct ripped_sample));
+       rs = xmalloc (struct ripped_sample ,1);
        if (prev)
                prev->next = rs;
        else
                ripped_samples = rs;
        rs->len = len;
        rs->per = adp->per / CYCLE_UNIT;
-       rs->sample = xmalloc (len);
+       rs->sample = xmalloc (uae_u8, len);
        memcpy (rs->sample, smp, len);
        rs->next = NULL;
        rs->changed = 1;
@@ -1589,8 +1589,6 @@ void audio_evhandler (void)
        schedule_audio ();
 }
 
-uae_u16        dmacon;
-
 void audio_hsync (int hpos)
 {
        int nr, handle;
similarity index 99%
rename from autoconf.c
rename to autoconf.cpp
index 31fa5e1695aeef57c833afdd63cb04f558044559..86af5d93c53aedd40bbe1e1b284569e475aba84b 100644 (file)
@@ -202,7 +202,7 @@ static uae_u32 REGPARAM2 getchipmemsize (TrapContext *context)
 
 static uae_u32 REGPARAM2 uae_puts (TrapContext *context)
 {
-       puts ((uae_u8*)get_real_address (m68k_areg (regs, 0)));
+       puts ((char*)get_real_address (m68k_areg (regs, 0)));
        return 0;
 }
 
similarity index 100%
rename from blitops.c
rename to blitops.cpp
similarity index 99%
rename from blitter.c
rename to blitter.cpp
index db251073b0299a6cc86d1c70b7d0469b02c2cac1..628ef15e685dbe63a44d33f51be3bf075d8737aa 100644 (file)
--- a/blitter.c
@@ -1517,7 +1517,7 @@ uae_u8 *save_blitter (int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = xmalloc (16);
+               dstbak = dst = xmalloc (uae_u8, 16);
        save_u32 (((bltstate != BLT_done) ? 0 : 1) | forced | 4);
        *len = dst - dstbak;
        return dstbak;
similarity index 98%
rename from blkdev.c
rename to blkdev.cpp
index a51893e51ae842eb82f9ef1f1fe1bdc471730baa..d714127d26c42d78c336877dc8f1c344c5d1c07c 100644 (file)
--- a/blkdev.c
@@ -294,7 +294,7 @@ void scsi_atapi_fixup_pre (uae_u8 *scsi_cmd, int *len, uae_u8 **datap, int *data
                scsi_cmd[9] = scsi_cmd[5];
                scsi_cmd[2] = scsi_cmd[3] = scsi_cmd[4] = scsi_cmd[5] = scsi_cmd[6] = 0;
                *len = 10;
-               p = (uae_u8*)xmalloc (8 + datalen + 4);
+               p = xmalloc (uae_u8, 8 + datalen + 4);
                if (datalen > 4)
                        memcpy (p + 8, data + 4, datalen - 4);
                p[0] = 0;
@@ -313,7 +313,7 @@ void scsi_atapi_fixup_pre (uae_u8 *scsi_cmd, int *len, uae_u8 **datap, int *data
                scsi_cmd[3] = scsi_cmd[4] = scsi_cmd[5] = scsi_cmd[6] = 0;
                if (l > 8)
                        datalen += 4;
-               *datap = (uae_u8*)xmalloc (datalen);
+               *datap = xmalloc (uae_u8, datalen);
                *len = 10;
                *parm = MODE_SENSE_10;
        }
@@ -445,7 +445,7 @@ uae_u8 *save_cd (int num, int *len)
        if (!currprefs.cdimagefile[0])
                return NULL;
 
-       dstbak = dst = xmalloc (4 + 256);
+       dstbak = dst = xmalloc (uae_u8, 4 + 256);
        save_u32 (4);
        save_string (currprefs.cdimagefile);
        *len = dst - dstbak;
similarity index 99%
rename from blkdev_cdimage.c
rename to blkdev_cdimage.cpp
index c28d3e9a123cd40838ab904503ac023204ec409d..7381d09b76fac208daded42e8cfcea8a459efab9 100644 (file)
@@ -282,7 +282,7 @@ static uae_u8 *mp3decoder_get (struct zfile *zf, int maxsize)
                return NULL;
        }
        zfile_fseek (zf, 0, SEEK_SET);
-       outbuf = xcalloc (maxsize, 1);
+       outbuf = xcalloc (uae_u8, maxsize);
        for (;;) {
                int count = zfile_fread (mp3buf, 1, MP3_BLOCK_SIZE, zf);
                if (count != MP3_BLOCK_SIZE)
@@ -361,7 +361,7 @@ static void *cdda_play_func (void *v)
                Sleep (10);
        oldplay = -1;
 
-       p = xmalloc (2 * num_sectors * 4096);
+       p = xmalloc (uae_u8, 2 * num_sectors * 4096);
        px[0] = p;
        px[1] = p + num_sectors * 4096;
        bufon[0] = bufon[1] = 0;
@@ -375,7 +375,7 @@ static void *cdda_play_func (void *v)
                for (i = 0; i < 2; i++) {
                        memset (&whdr[i], 0, sizeof (WAVEHDR));
                        whdr[i].dwBufferLength = 2352 * num_sectors;
-                       whdr[i].lpData = px[i];
+                       whdr[i].lpData = (LPSTR)px[i];
                        mmr = waveOutPrepareHeader (cdda_wavehandle, &whdr[i], sizeof (WAVEHDR));
                        if (mmr != MMSYSERR_NOERROR) {
                                write_log (L"CDDA: waveOutPrepareHeader %d:%d\n", i, mmr);
similarity index 98%
rename from bsdsocket.c
rename to bsdsocket.cpp
index 0d4b81290a11dd9ab364782a4cd9faa18c3a26ab..e14062805c537068edc7ca346e640896edb54fb2 100644 (file)
@@ -26,6 +26,7 @@
 
 #ifdef BSDSOCKET
 
+struct socketbase *socketbases;
 static uae_u32 SockLibBase;
 
 #define SOCKPOOLSIZE 128
@@ -82,7 +83,7 @@ uae_u32 addmem (uae_u32 * dst, const uae_char *src, int len)
        if (!src)
                return 0;
 
-       memcpyha_safe (*dst, src, len);
+       memcpyha_safe (*dst, (uae_u8*)src, len);
        (*dst) += len;
 
        return res;
@@ -216,7 +217,7 @@ SOCKET_TYPE getsock (SB, int sd)
                        ot1 = get_long (sb1->ownertask + 10);
                        if (!addr_valid (L"getsock4", ot1, 1))
                                break;
-                       if (strcmp(get_real_address (ot1), get_real_address (ot)) == 0) {
+                       if (strcmp((char*)get_real_address (ot1), (char*)get_real_address (ot)) == 0) {
                                // Task with same name already exists -> use same dtable
                                if (sb1->dtable[sd - 1] != INVALID_SOCKET)
                                        return sb1->dtable[sd - 1];
@@ -372,7 +373,7 @@ static struct socketbase *alloc_socketbase (TrapContext *context)
        SB;
        int i;
 
-       if ((sb = (struct socketbase*)calloc (sizeof (struct socketbase), 1)) != NULL) {
+       if ((sb = xcalloc (struct socketbase, 1)) != NULL) {
                sb->ownertask = gettask (context);
 
                m68k_dreg (regs, 0) = -1;
@@ -691,7 +692,7 @@ static uae_u32 bsdsocklib_SetDTableSize (SB, int newSize)
 {
        int *newdtable;
        int *newftable;
-       int *newmtable;
+       unsigned int *newmtable;
        int i;
 
        if (newSize < sb->dtablesize) {
@@ -699,9 +700,9 @@ static uae_u32 bsdsocklib_SetDTableSize (SB, int newSize)
                return 0;
        }
 
-       newdtable = (int *)calloc(newSize, sizeof(*sb->dtable));
-       newftable = (int *)calloc(newSize, sizeof(*sb->ftable));
-       newmtable = (int *)calloc(newSize, sizeof(*sb->mtable));
+       newdtable = xcalloc (int, newSize);
+       newftable = xcalloc (int, newSize);
+       newmtable = xcalloc (unsigned int, newSize);
 
        if (newdtable == NULL || newftable == NULL || newmtable == NULL) {
                sb->resultval = -1;
@@ -712,9 +713,9 @@ static uae_u32 bsdsocklib_SetDTableSize (SB, int newSize)
                return -1;
        }
 
-       memcpy(newdtable, sb->dtable, sb->dtablesize * sizeof(*sb->dtable));
-       memcpy(newftable, sb->ftable, sb->dtablesize * sizeof(*sb->ftable));
-       memcpy(newmtable, sb->mtable, sb->dtablesize * sizeof(*sb->mtable));
+       memcpy (newdtable, sb->dtable, sb->dtablesize * sizeof(*sb->dtable));
+       memcpy (newftable, sb->ftable, sb->dtablesize * sizeof(*sb->ftable));
+       memcpy (newmtable, sb->mtable, sb->dtablesize * sizeof(*sb->mtable));
        for (i = sb->dtablesize + 1; i < newSize; i++)
                newdtable[i] = -1;
 
@@ -1228,11 +1229,11 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context)
                                        break;
                                case SBTC_ERRNO:
                                        BSDTRACE ((L"SBTC_ERRNO),%d", currval));
-                                       tagcopy (currtag, currval, tagptr, &sb->sb_errno);
+                                       tagcopy (currtag, currval, tagptr, (uae_u32*)&sb->sb_errno);
                                        break;
                                case SBTC_HERRNO:
                                        BSDTRACE ((L"SBTC_HERRNO),%d", currval));
-                                       tagcopy (currtag, currval, tagptr, &sb->sb_herrno);
+                                       tagcopy (currtag, currval, tagptr, (uae_u32*)&sb->sb_herrno);
                                        break;
                                case SBTC_DTABLESIZE:
                                        BSDTRACE ((L"SBTC_DTABLESIZE),0x%lx", currval));
@@ -1522,7 +1523,7 @@ void bsdlib_install (void)
        int i;
 
        if (!sockdata) {
-               sockdata = xcalloc (sizeof (struct sockd), 1);
+               sockdata = xcalloc (struct sockd, 1);
                for (i = 0; i < SOCKPOOLSIZE; i++)
                        sockdata->sockpoolids[i] = UNIQUE_ID;
        }
similarity index 100%
rename from build68k.c
rename to build68k.cpp
similarity index 99%
rename from catweasel.c
rename to catweasel.cpp
index 5bdea34c2de28d77cc4aec66eda7e8c0ab7c865c..a05f7e7c3302e7fa6f9d230da01047cdd8148534 100644 (file)
@@ -311,7 +311,7 @@ void catweasel_do_bput (uaecptr     addr, uae_u32 b)
        //write_log (L"P %02X %02X %d\n", (uae_u8)addr, (uae_u8)b, did_read);
 }
 
-#include "core.cw4.c"
+#include "core.cw4.cpp"
 
 static int cw_config_done (void)
 {
@@ -522,7 +522,8 @@ static int detected;
 int catweasel_init(void)
 {
        TCHAR name[32], tmp[1000], *s;
-       int i, len;
+       int i;
+       DWORD len;
        uae_u8 buffer[10000];
        uae_u32 model, base;
        int detect = 0;
@@ -589,7 +590,7 @@ int catweasel_init(void)
                        write_log (L"CW: CW_GET_VERSION failed %d\n", GetLastError ());
                        goto fail;
                }
-               s = au (buffer);
+               s = au ((char*)buffer);
                write_log (L"CW driver version string '%s'\n", s);
                xfree (s);
                if (!DeviceIoControl (handle, CW_GET_HWVERSION, 0, 0, buffer, sizeof (buffer), &len, 0)) {
similarity index 99%
rename from cd32_fmv.c
rename to cd32_fmv.cpp
index f475af9e38f50bc78e39c25cfa08b1f7319bda89..c7027939048c9f0b55c41101988debedbc454e64 100644 (file)
@@ -146,7 +146,7 @@ static void REGPARAM2 fmv_wput (uaecptr addr, uae_u32 w)
        fmv_bput2 (addr + 1, w);
 }
 
-static addrbank fmv_bank;
+extern addrbank fmv_bank;
 
 static void REGPARAM2 fmv_bput (uaecptr addr, uae_u32 b)
 {
similarity index 100%
rename from cdrom.c
rename to cdrom.cpp
diff --git a/cdtv.c b/cdtv.cpp
similarity index 100%
rename from cdtv.c
rename to cdtv.cpp
similarity index 99%
rename from cfgfile.c
rename to cfgfile.cpp
index 0db8c17893584e33d2a50ce3ac99230919c3bfae..804a67470cf06feca95c4a8b771c21bc18dfe03d 100644 (file)
--- a/cfgfile.c
@@ -213,7 +213,7 @@ TCHAR *cfgfile_subst_path (const TCHAR *path, const TCHAR *subst, const TCHAR *f
        /* @@@ use strcasecmp for some targets.  */
        if (_tcslen (path) > 0 && _tcsncmp (file, path, _tcslen (path)) == 0) {
                int l;
-               TCHAR *p = xmalloc ((_tcslen (file) + _tcslen (subst) + 2) * sizeof (TCHAR));
+               TCHAR *p = xmalloc (TCHAR, _tcslen (file) + _tcslen (subst) + 2);
                _tcscpy (p, subst);
                l = _tcslen (p);
                while (l > 0 && p[l - 1] == '/')
@@ -245,11 +245,11 @@ static size_t cfg_write (void *b, struct zfile *z)
        size_t v;
        if (unicode_config) {
                TCHAR lf = 10;
-               v = zfile_fwrite (b, _tcslen (b), sizeof (TCHAR), z);
+               v = zfile_fwrite (b, _tcslen ((TCHAR*)b), sizeof (TCHAR), z);
                zfile_fwrite (&lf, 1, 1, z);
        } else {
                char lf = 10;
-               char *s = ua (b);
+               char *s = ua ((TCHAR*)b);
                v = zfile_fwrite (s, strlen (s), 1, z);
                zfile_fwrite (&lf, 1, 1, z);
                xfree (s);
@@ -854,7 +854,7 @@ int cfgfile_yesno (const TCHAR *option, const TCHAR *value, const TCHAR *name, i
        return 1;
 }
 
-int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, int scale)
+int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, unsigned int *location, int scale)
 {
        int base = 10;
        TCHAR *endptr;
@@ -879,6 +879,17 @@ int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name,
        }
        return 1;
 }
+int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, int scale)
+{
+       unsigned int v = 0;
+       int r = cfgfile_intval (option, value, name, &v, scale);
+       if (!r)
+               return 0;
+       *location = (int)v;
+       return r;
+}
+
+
 
 int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, const TCHAR *table[], int more)
 {
@@ -1405,7 +1416,7 @@ static void decode_rom_ident (TCHAR *romfile, int maxlen, TCHAR *ident)
 
        if (!ident[0])
                return;
-       romtxt = malloc (10000 * sizeof (TCHAR));
+       romtxt = xmalloc (TCHAR, 10000);
        romtxt[0] = 0;
        for (round = 0; round < 2; round++) {
                ver = rev = subver = subrev = -1;
@@ -1543,7 +1554,7 @@ struct uaedev_config_info *add_filesys_config (struct uae_prefs *p, int index,
 
 static void parse_addmem (struct uae_prefs *p, TCHAR *buf, int num)
 {
-       uae_u32 size = 0, addr = 0;
+       int size = 0, addr = 0;
 
        if (!getintval2 (&buf, &addr, ','))
                return;
@@ -2131,7 +2142,7 @@ static void cfgfile_parse_separated_line (struct uae_prefs *p, TCHAR *line1b, TC
                        if (sl->option && !strcasecmp (line1b, sl->option)) break;
                }
                if (!sl) {
-                       struct strlist *u = xcalloc (sizeof (struct strlist), 1);
+                       struct strlist *u = xcalloc (struct strlist, 1);
                        u->option = my_strdup (line3b);
                        u->value = my_strdup (line4b);
                        u->next = p->all_lines;
@@ -2335,7 +2346,7 @@ int cfgfile_save (struct uae_prefs *p, const TCHAR *filename, int type)
 int cfgfile_get_description (const TCHAR *filename, TCHAR *description, TCHAR *hostlink, TCHAR *hardwarelink, int *type)
 {
        int result = 0;
-       struct uae_prefs *p = xmalloc (sizeof (struct uae_prefs));
+       struct uae_prefs *p = xmalloc (struct uae_prefs, 1);
 
        p->description[0] = 0;
        p->config_host_path[0] = 0;
@@ -2586,7 +2597,7 @@ static void parse_cpu_specs (struct uae_prefs *p, const TCHAR *spec)
 /* Returns the number of args used up (0 or 1).  */
 int parse_cmdline_option (struct uae_prefs *p, TCHAR c, const TCHAR *arg)
 {
-       struct strlist *u = xcalloc (sizeof (struct strlist), 1);
+       struct strlist *u = xcalloc (struct strlist, 1);
        const TCHAR arg_required[] = L"0123rKpImWSAJwNCZUFcblOdHRv";
 
        if (_tcschr (arg_required, c) && ! arg) {
@@ -2594,7 +2605,7 @@ int parse_cmdline_option (struct uae_prefs *p, TCHAR c, const TCHAR *arg)
                return 0;
        }
 
-       u->option = xmalloc (2 * sizeof (TCHAR));
+       u->option = xmalloc (TCHAR, 2);
        u->option[0] = c;
        u->option[1] = 0;
        u->value = my_strdup (arg);
@@ -2727,7 +2738,7 @@ void cfgfile_addcfgparam (TCHAR *line)
        }
        if (!cfgfile_separate_line (line, line1b, line2b))
                return;
-       u = xcalloc (sizeof (struct strlist), 1);
+       u = xcalloc (struct strlist, 1);
        u->option = my_strdup (line1b);
        u->value = my_strdup (line2b);
        u->next = temp_lines;
@@ -2768,7 +2779,7 @@ static int cfgfile_handle_custom_event (TCHAR *custom, int mode)
        }
 
        nextp = NULL;
-       tmp = p = xcalloc (_tcslen (custom) + 2, 1);
+       tmp = p = xcalloc (TCHAR, _tcslen (custom) + 2);
        _tcscpy (tmp, custom);
        while (p && *p) {
                if (*p == '\"') {
@@ -3022,13 +3033,13 @@ uae_u32 cfgfile_uaelib_modify (uae_u32 index, uae_u32 parms, uae_u32 size, uae_u
                while (get_byte (parms + size) != 0)
                        size++;
        }
-       parms_p = xmalloc (size + 1);
+       parms_p = xmalloc (uae_char, size + 1);
        if (!parms_p) {
                ret = 10;
                goto end;
        }
        if (out) {
-               out_p = xmalloc ((outsize + 1) * sizeof (TCHAR));
+               out_p = xmalloc (TCHAR, outsize + 1);
                if (!out_p) {
                        ret = 10;
                        goto end;
@@ -3100,10 +3111,10 @@ uae_u32 cfgfile_uaelib (int mode, uae_u32 name, uae_u32 dst, uae_u32 maxlen)
 
 uae_u8 *restore_configuration (uae_u8 *src)
 {
-       TCHAR *s = au (src);
+       TCHAR *s = au ((char*)src);
        //write_log (s);
        xfree (s);
-       src += strlen (src) + 1;
+       src += strlen ((char*)src) + 1;
        return src;
 }
 
@@ -3113,7 +3124,7 @@ uae_u8 *save_configuration (int *len)
        uae_u8 *dstbak, *dst, *p;
        int index = -1;
 
-       dstbak = dst = malloc (tmpsize * sizeof (TCHAR));
+       dstbak = dst = xmalloc (uae_u8, tmpsize);
        p = dst;
        for (;;) {
                TCHAR tmpout[256];
@@ -3126,10 +3137,10 @@ uae_u8 *save_configuration (int *len)
                        if (!_tcsncmp (tmpout, L"input.", 6))
                                continue;
                        out = ua (tmpout);
-                       strcpy (p, out);
+                       strcpy ((char*)p, out);
                        xfree (out);
-                       strcat (p, "\n");
-                       p += strlen (p);
+                       strcat ((char*)p, "\n");
+                       p += strlen ((char*)p);
                        if (p - dstbak >= tmpsize - sizeof (tmpout))
                                break;
                }
diff --git a/cia.c b/cia.cpp
similarity index 99%
rename from cia.c
rename to cia.cpp
index 08a11d652a8ea6c984985fd5e7ceb749610371f8..49a419c374ddece2cca9ed48186223a81204fe4d 100644 (file)
--- a/cia.c
+++ b/cia.cpp
@@ -1232,7 +1232,7 @@ addrbank cia_bank = {
 };
 
 
-STATIC_INLINE isgayle (void)
+STATIC_INLINE int isgayle (void)
 {
        return (currprefs.cs_ide == IDE_A600A1200 || currprefs.cs_pcmcia);
 }
similarity index 96%
rename from consolehook.c
rename to consolehook.cpp
index 9bf747ce33c401929b98acfcc8856980e9a2b98c..e503e1cc9db86b6e40b047b3055ea57a3ff9272e 100644 (file)
@@ -90,11 +90,11 @@ uaecptr consolehook_beginio (uaecptr request)
 
        if (cmd == CMD_WRITE) {
                TCHAR *buf;
-               const char *src = get_real_address (io_data);
+               const char *src = (char*)get_real_address (io_data);
                int len = io_length;
                if (io_length == -1)
                        len = strlen (src);
-               buf = xmalloc ((len + 1) * sizeof (TCHAR));
+               buf = xmalloc (TCHAR, len + 1);
                au_copy (buf, len, src);
                buf[len] = 0;
                f_out (L"%s", buf);
similarity index 100%
rename from core.cw4.c
rename to core.cw4.cpp
similarity index 100%
rename from cpummu.c
rename to cpummu.cpp
similarity index 100%
rename from cpuopti.c
rename to cpuopti.cpp
similarity index 96%
rename from crc32.c
rename to crc32.cpp
index a82fd9d6bcfdb9df5164427eedb90ccd61ff43a4..f0c681643a91ae05109d502db11bbf0f7eed1b64 100644 (file)
--- a/crc32.c
+++ b/crc32.cpp
@@ -30,8 +30,9 @@ uae_u32 get_crc32_val (uae_u8 v, uae_u32 crc)
        crc = crc_table32[(crc ^ v) & 0xff] ^ (crc >> 8);
        return crc ^ 0xffffffff;
 }
-uae_u32 get_crc32 (uae_u8 *buf, int len)
+uae_u32 get_crc32 (void *vbuf, int len)
 {
+       uae_u8 *buf = (uae_u8*)vbuf;
        uae_u32 crc;
        if (!crc_table32[1])
                make_crc_table();
@@ -40,8 +41,9 @@ uae_u32 get_crc32 (uae_u8 *buf, int len)
                crc = crc_table32[(crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
        return crc ^ 0xffffffff;
 }
-uae_u16 get_crc16 (uae_u8 *buf, int len)
+uae_u16 get_crc16 (void *vbuf, int len)
 {
+       uae_u8 *buf = (uae_u8*)vbuf;
        uae_u16 crc;
        if (!crc_table32[1])
                make_crc_table();
@@ -327,16 +329,19 @@ static void sha1_finish( sha1_context *ctx, unsigned char output[20] )
        PUT_UINT32_BE( ctx->state[4], output, 16 );
 }
 
-void get_sha1 (uae_u8 *input, int len, uae_u8 *out)
+void get_sha1 (void *vinput, int len, void *vout)
 {
+       uae_u8 *input = (uae_u8*)vinput;
+       uae_u8 *out = (uae_u8*)vout;
        sha1_context ctx;
 
        sha1_starts( &ctx );
        sha1_update( &ctx, input, len );
        sha1_finish( &ctx, out );
 }
-const TCHAR *get_sha1_txt (uae_u8 *input, int len)
+const TCHAR *get_sha1_txt (void *vinput, int len)
 {
+       uae_u8 *input = (uae_u8*)vinput;
        static TCHAR outtxt[SHA1_SIZE * 2 + 1];
        uae_u8 out[SHA1_SIZE];
        int i;
similarity index 99%
rename from custom.c
rename to custom.cpp
index 35e6c0076fedf9063197f55a8f9110e53c6c3496..19dfef556889effa8c12713cab41e76299493a89 100644 (file)
--- a/custom.c
@@ -243,7 +243,6 @@ static unsigned int diwstrt, diwstop, diwhigh;
 static int diwhigh_written;
 static unsigned int ddfstrt, ddfstop, ddfstrt_old_hpos;
 static int ddf_change, badmode, diw_change;
-static int fmode;
 static int bplcon1_hpos;
 
 /* The display and data fetch windows */
@@ -441,7 +440,7 @@ STATIC_INLINE void setclr (uae_u16 *p, uae_u16 val)
                *p &= ~val;
 }
 
-STATIC_INLINE alloc_cycle (int hpos, int type)
+STATIC_INLINE void alloc_cycle (int hpos, int type)
 {
 #ifdef CPUEMU_12
 #if 0
@@ -455,7 +454,7 @@ STATIC_INLINE alloc_cycle (int hpos, int type)
        cycle_line[hpos] = type;
 #endif
 }
-STATIC_INLINE alloc_cycle_maybe (int hpos, int type)
+STATIC_INLINE void alloc_cycle_maybe (int hpos, int type)
 {
        if (cycle_line[hpos] == 0)
                alloc_cycle (hpos, type);
@@ -992,7 +991,7 @@ static void maybe_setup_fmodes (int hpos)
        }
 }
 
-STATIC_INLINE maybe_check (int hpos)
+STATIC_INLINE void maybe_check (int hpos)
 {
        if (bpldmasetuphpos > 0 && hpos >= bpldmasetuphpos)
                maybe_setup_fmodes (hpos);
@@ -1599,8 +1598,10 @@ STATIC_INLINE int one_fetch_cycle_0 (int pos, int ddfstop_to_test, int dma, int
                        finish_final_fetch (pos, fm);
                        return 1;
                }
-               if (plf_state >= plf_passed_stop)
-                       plf_state++;
+               if (plf_state == plf_passed_stop)
+                       plf_state = plf_passed_stop2;
+               else if (plf_state == plf_passed_stop2)
+                       plf_state = plf_end;
        }
 
        maybe_check (pos);
@@ -2710,12 +2711,7 @@ void compute_vsynctime (void)
        else
                vsynctime = vsynctime_orig = syncbase / fake_vblank_hz;
        if (!picasso_on) {
-#ifdef OPENGL
-               OGL_refresh ();
-#endif
-#ifdef D3D
-               D3D_refresh ();
-#endif
+               updatedisplayarea ();
        }
        if (currprefs.produce_sound > 1)
                update_sound (fake_vblank_hz, (bplcon0 & 4) ? -1 : lof, islinetoggle ());
@@ -3401,7 +3397,7 @@ int intlev (void)
        return -1;
 }
 
-#define INT_PROCESSING_DELAY 1
+#define INT_PROCESSING_DELAY 3 * CYCLE_UNIT
 STATIC_INLINE int use_eventmode (uae_u16 v)
 {
        if (!currprefs.cpu_cycle_exact)
@@ -3450,7 +3446,7 @@ static void INTENA (uae_u16 v)
        }
 
        if (use_eventmode (v))
-               event2_newevent_xx (-1, INT_PROCESSING_DELAY * CYCLE_UNIT, intena, send_intena_do);
+               event2_newevent_xx (-1, INT_PROCESSING_DELAY, intena, send_intena_do);
        else
                send_intena_do (intena);
 #if 0
@@ -3472,7 +3468,7 @@ void INTREQ_0 (uae_u16 v)
                return;
        }
        if (use_eventmode (v))
-               event2_newevent_xx (-1, INT_PROCESSING_DELAY * CYCLE_UNIT, intreq, send_intreq_do);
+               event2_newevent_xx (-1, INT_PROCESSING_DELAY, intreq, send_intreq_do);
        else
                send_intreq_do (intreq);
 }
@@ -5871,8 +5867,8 @@ void customreset (int hardreset)
 
 void dumpcustom (void)
 {
-       console_out_f (L"DMACON: %x INTENA: %x INTREQ: %x VPOS: %x HPOS: %x\n", DMACONR (current_hpos ()),
-               (unsigned int)intena, (unsigned int)intreq, (unsigned int)vpos, (unsigned int)current_hpos());
+       console_out_f (L"DMACON: %04x INTENA: %04x (%04x) INTREQ: %04x (%04x) VPOS: %x HPOS: %x\n", DMACONR (current_hpos ()),
+               intena, intena_internal, intreq, intreq_internal, vpos, current_hpos ());
        console_out_f (L"COP1LC: %08lx, COP2LC: %08lx COPPTR: %08lx\n", (unsigned long)cop1lc, (unsigned long)cop2lc, cop_state.ip);
        console_out_f (L"DIWSTRT: %04x DIWSTOP: %04x DDFSTRT: %04x DDFSTOP: %04x\n",
                (unsigned int)diwstrt, (unsigned int)diwstop, (unsigned int)ddfstrt, (unsigned int)ddfstop);
@@ -6612,7 +6608,7 @@ uae_u8 *save_custom (int *len, uae_u8 *dstptr, int full)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = malloc (8 + 256 * 2);
+               dstbak = dst = xmalloc (uae_u8, 8 + 256 * 2);
 
        SL (currprefs.chipset_mask);
        SW (0);                 /* 000 BLTDDAT */
@@ -6792,7 +6788,7 @@ uae_u8 *save_custom_agacolors (int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = xmalloc (256*4);
+               dstbak = dst = xmalloc (uae_u8, 256 * 4);
        for (i = 0; i < 256; i++)
 #ifdef AGA
                SL (current_colors.color_regs_aga[i] | (color_regs_aga_genlock[i] ? 0x80000000 : 0));
@@ -6828,7 +6824,7 @@ uae_u8 *save_custom_sprite(int num, int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = xmalloc (30);
+               dstbak = dst = xmalloc (uae_u8, 30);
        SL (spr[num].pt);               /* 120-13E SPRxPT */
        SW (sprpos[num]);               /* 1x0 SPRxPOS */
        SW (sprctl[num]);               /* 1x2 SPRxPOS */
similarity index 98%
rename from debug.c
rename to debug.cpp
index 31b7fae5dcdb3109cadc9e37ef0f28128473a9ef..0650c64868678817a6948dbf0dbdda8032d8316a 100644 (file)
--- a/debug.c
+++ b/debug.cpp
@@ -838,8 +838,8 @@ struct dma_rec *record_dma (uae_u16 reg, uae_u16 dat, uae_u32 addr, int hpos, in
        struct dma_rec *dr;
 
        if (!dma_record[0]) {
-               dma_record[0] = xmalloc (NR_DMA_REC_HPOS * NR_DMA_REC_VPOS * sizeof (struct dma_rec));
-               dma_record[1] = xmalloc (NR_DMA_REC_HPOS * NR_DMA_REC_VPOS * sizeof (struct dma_rec));
+               dma_record[0] = xmalloc (struct dma_rec, NR_DMA_REC_HPOS * NR_DMA_REC_VPOS);
+               dma_record[1] = xmalloc (struct dma_rec, NR_DMA_REC_HPOS * NR_DMA_REC_VPOS);
                dma_record_toggle = 0;
                record_dma_reset ();
        }
@@ -954,8 +954,8 @@ void record_copper (uaecptr addr, int hpos, int vpos)
 {
        int t = nr_cop_records[curr_cop_set];
        if (!cop_record[0]) {
-               cop_record[0] = xmalloc (NR_COPPER_RECORDS * sizeof (struct cop_rec));
-               cop_record[1] = xmalloc (NR_COPPER_RECORDS * sizeof (struct cop_rec));
+               cop_record[0] = xmalloc (struct cop_rec, NR_COPPER_RECORDS);
+               cop_record[1] = xmalloc (struct cop_rec, NR_COPPER_RECORDS);
        }
        if (t < NR_COPPER_RECORDS) {
                cop_record[curr_cop_set][t].addr = addr;
@@ -1111,7 +1111,7 @@ static int totaltrainers;
 static void clearcheater(void)
 {
        if (!trainerdata)
-               trainerdata =  xmalloc(MAX_CHEAT_VIEW * sizeof (struct trainerstruct));
+               trainerdata =  xmalloc(struct trainerstruct, MAX_CHEAT_VIEW);
        memset(trainerdata, 0, sizeof (struct trainerstruct) * MAX_CHEAT_VIEW);
        totaltrainers = 0;
 }
@@ -1194,7 +1194,7 @@ static void deepcheatsearch (TCHAR **c)
                        addr = end - 1;
                }
                memsize2 = (memsize + 7) / 8;
-               memtmp = xmalloc (memsize + memsize2);
+               memtmp = xmalloc (uae_u8, memsize + memsize2);
                if (!memtmp)
                        return;
                memset (memtmp + memsize, 0xff, memsize2);
@@ -1320,7 +1320,7 @@ static void cheatsearch (TCHAR **c)
                console_out (L"Search reset\n");
                xfree (vlist);
                listsize = memsize;
-               vlist = xcalloc (listsize >> 3, 1);
+               vlist = xcalloc (uae_u8, listsize >> 3);
                return;
        }
        val = readint (c);
@@ -1342,7 +1342,7 @@ static void cheatsearch (TCHAR **c)
 
        if (vlist == NULL) {
                listsize = memsize;
-               vlist = xcalloc (listsize >> 3, 1);
+               vlist = xcalloc (uae_u8, listsize >> 3);
        }
 
        count = 0;
@@ -1417,8 +1417,8 @@ static void illg_init (void)
        uae_u8 c = 3;
        uaecptr addr, end;
 
-       illgdebug = xcalloc (0x01000000, 1);
-       illghdebug = xcalloc (65536, 1);
+       illgdebug = xcalloc (uae_u8, 0x01000000);
+       illghdebug = xcalloc (uae_u8, 65536);
        if (!illgdebug || !illghdebug) {
                illg_free();
                return;
@@ -1552,7 +1552,7 @@ static void smc_detect_init (TCHAR **c)
        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_table = xmalloc (struct smc_item, smc_size);
        if (!smc_table)
                return;
        for (i = 0; i < smc_size; i++) {
@@ -1932,9 +1932,9 @@ static void initialize_memwatch (int mode)
 
        deinitialize_memwatch ();
        as = currprefs.address_space_24 ? 256 : 65536;
-       debug_mem_banks = xmalloc (sizeof (addrbank*) * as);
-       debug_mem_area = xmalloc (sizeof (addrbank) * as);
-       membank_stores = xcalloc (sizeof (struct membank_store), 32);
+       debug_mem_banks = xmalloc (addrbank*, as);
+       debug_mem_area = xmalloc (addrbank, as);
+       membank_stores = xcalloc (struct membank_store, 32);
        oa = NULL;
        for (i = 0; i < as; i++) {
                a1 = debug_mem_banks[i] = debug_mem_area + i;
@@ -2016,7 +2016,7 @@ static void memwatch_dump (int num)
        TCHAR *buf;
        int multiplier = num < 0 ? MEMWATCH_TOTAL : 1;
 
-       buf = malloc (50 * multiplier * sizeof (TCHAR));
+       buf = xmalloc (TCHAR, 50 * multiplier);
        if (!buf)
                return;
        memwatch_dump2 (buf, 50 * multiplier, num);
@@ -2259,7 +2259,7 @@ STATIC_INLINE uaecptr BPTR2APTR (uaecptr addr)
 static TCHAR *BSTR2CSTR (uae_u8 *bstr)
 {
        WCHAR *s;
-       char *cstr = xmalloc (bstr[0] + 1);
+       char *cstr = xmalloc (char, bstr[0] + 1);
        if (cstr) {
                memcpy (cstr, bstr + 1, bstr[0]);
                cstr[bstr[0]] = 0;
@@ -2275,7 +2275,7 @@ static void print_task_info (uaecptr node)
        int process = get_byte (node + 8) == 13 ? 1 : 0;
 
        console_out_f (L"%08X: ", node);
-       s = au (get_real_address (get_long (node + 10)));
+       s = au ((char*)get_real_address (get_long (node + 10)));
        console_out_f (process ? L" PROCESS '%s'" : L" TASK    '%s'\n", s);
        xfree (s);
        if (process) {
@@ -2339,7 +2339,7 @@ static void show_exec_lists (TCHAR t)
                return;
        node = get_long (list);
        while (get_long (node)) {
-               TCHAR *name = au (get_real_address (get_long (node + 10)));
+               TCHAR *name = au ((char*)get_real_address (get_long (node + 10)));
                console_out_f (L"%08x %s\n", node, name);
                xfree (name);
                node = get_long (node);
@@ -3339,7 +3339,7 @@ void debug (void)
                                        uaecptr execbase = get_long (4);
                                        uaecptr activetask = get_long (execbase + 276);
                                        int process = get_byte (activetask + 8) == 13 ? 1 : 0;
-                                       uae_u8 *name = get_real_address (get_long (activetask + 10));
+                                       char *name = (char*)get_real_address (get_long (activetask + 10));
                                        if (process) {
                                                uaecptr cli = BPTR2APTR(get_long (activetask + 172));
                                                uaecptr seglist = 0;
@@ -3347,13 +3347,13 @@ void debug (void)
                                                uae_char *command = NULL;
                                                if (cli) {
                                                        if (processname)
-                                                               command = get_real_address (BPTR2APTR(get_long (cli + 16)));
+                                                               command = (char*)get_real_address (BPTR2APTR(get_long (cli + 16)));
                                                        seglist = BPTR2APTR(get_long (cli + 60));
                                                } else {
                                                        seglist = BPTR2APTR(get_long (activetask + 128));
                                                        seglist = BPTR2APTR(get_long (seglist + 12));
                                                }
-                                               if (activetask == processptr || (processname && (!stricmp(name, processname) || (command && command[0] && !strnicmp(command + 1, processname, command[0]) && processname[command[0]] == 0)))) {
+                                               if (activetask == processptr || (processname && (!stricmp (name, processname) || (command && command[0] && !strnicmp (command + 1, processname, command[0]) && processname[command[0]] == 0)))) {
                                                        while (seglist) {
                                                                uae_u32 size = get_long (seglist - 4) - 4;
                                                                if (pc >= (seglist + 4) && pc < (seglist + size)) {
@@ -3479,6 +3479,7 @@ struct mmunode {
        struct mmunode *next;
 };
 static struct mmunode **mmunl;
+extern regstruct mmu_backup_regs;
 
 #define MMU_READ_U (1 << 0)
 #define MMU_WRITE_U (1 << 1)
@@ -3777,7 +3778,7 @@ int mmu_init(int mode, uaecptr parm, uaecptr parm2)
        }
 
        mmu_slots = 1 << ((currprefs.address_space_24 ? 24 : 32) - MMU_PAGE_SHIFT);
-       mmunl = xcalloc (sizeof (struct mmunode*) * mmu_slots, 1);
+       mmunl = xcalloc (struct mmunode*, mmu_slots);
        size = 1;
        p2 = get_long (p);
        while (get_long (p2) != 0xffffffff) {
@@ -3785,7 +3786,7 @@ int mmu_init(int mode, uaecptr parm, uaecptr parm2)
                size++;
        }
        p = banks = get_long (p);
-       snptr = mmubanks = xmalloc (sizeof (struct mmudata) * size);
+       snptr = mmubanks = xmalloc (struct mmudata, size);
        for (;;) {
                int off;
                if (getmmubank(snptr, p))
@@ -3793,12 +3794,12 @@ int mmu_init(int mode, uaecptr parm, uaecptr parm2)
                p += 16;
                off = snptr->addr >> MMU_PAGE_SHIFT;
                if (mmunl[off] == NULL) {
-                       mn = mmunl[off] = xcalloc (sizeof (struct mmunode), 1);
+                       mn = mmunl[off] = xcalloc (struct mmunode, 1);
                } else {
                        mn = mmunl[off];
                        while (mn->next)
                                mn = mn->next;
-                       mn = mn->next = xcalloc (sizeof (struct mmunode), 1);
+                       mn = mn->next = xcalloc (struct mmunode, 1);
                }
                mn->mmubank = snptr;
                snptr++;
diff --git a/disk.c b/disk.cpp
similarity index 98%
rename from disk.c
rename to disk.cpp
index 76a7d7cc8033beed23044098318efd5487ad0d5b..3b4acde51f43c486e928d9bdbb8c8053f5c9fdd5 100644 (file)
--- a/disk.c
+++ b/disk.cpp
@@ -134,7 +134,7 @@ typedef struct {
 #define DRIVE_ID_35HD  0xAAAAAAAA
 #define DRIVE_ID_525SD 0x55555555 /* 40 track 5.25 drive , kickstart does not recognize this */
 
-typedef enum { ADF_NORMAL, ADF_EXT1, ADF_EXT2, ADF_FDI, ADF_IPF, ADF_CATWEASEL, ADF_PCDOS } drive_filetype;
+typedef enum { ADF_NONE = -1, ADF_NORMAL, ADF_EXT1, ADF_EXT2, ADF_FDI, ADF_IPF, ADF_CATWEASEL, ADF_PCDOS } drive_filetype;
 typedef struct {
        struct zfile *diskfile;
        struct zfile *writediskfile;
@@ -280,7 +280,7 @@ static void createbootblock (uae_u8 *sector, int bootable)
                memcpy (sector, bootblock, sizeof (bootblock));
 }
 
-static void createrootblock (uae_u8 *sector, uae_u8 *disk_name)
+static void createrootblock (uae_u8 *sector, char *disk_name)
 {
        memset (sector, 0, FS_FLOPPY_BLOCKSIZE);
        sector[0+3] = 2;
@@ -288,7 +288,7 @@ static void createrootblock (uae_u8 *sector, uae_u8 *disk_name)
        sector[312] = sector[313] = sector[314] = sector[315] = (uae_u8)0xff;
        sector[316+2] = 881 >> 8; sector[316+3] = 881 & 255;
        sector[432] = strlen (disk_name);
-       strcpy (sector + 433, disk_name);
+       strcpy ((char*)sector + 433, disk_name);
        sector[508 + 3] = 1;
        disk_date (sector + 420);
        memcpy (sector + 472, sector + 420, 3 * 4);
@@ -325,7 +325,7 @@ static int createdirheaderblock (uae_u8 *sector, int parent, const char *filenam
        pl (sector, 4, block);
        disk_date (sector + 512 - 92);
        sector[512 - 80] = strlen (filename);
-       strcpy (sector + 512 - 79, filename);
+       strcpy ((char*)sector + 512 - 79, filename);
        pl (sector, 512 - 12, parent);
        pl (sector, 512 - 4, 2);
        return block;
@@ -355,7 +355,7 @@ static int createfileheaderblock (struct zfile *z,uae_u8 *sector, int parent, co
        pl (sector, FS_FLOPPY_BLOCKSIZE - 188, size);
        disk_date (sector + FS_FLOPPY_BLOCKSIZE - 92);
        sector[FS_FLOPPY_BLOCKSIZE - 80] = strlen (filename);
-       strcpy (sector + FS_FLOPPY_BLOCKSIZE - 79, filename);
+       strcpy ((char*)sector + FS_FLOPPY_BLOCKSIZE - 79, filename);
        pl (sector, FS_FLOPPY_BLOCKSIZE - 12, parent);
        pl (sector, FS_FLOPPY_BLOCKSIZE - 4, -3);
        extensioncounter = 0;
@@ -563,7 +563,7 @@ static void drive_image_free (drive *drv)
 #endif
                break;
        }
-       drv->filetype = -1;
+       drv->filetype = ADF_NONE;
        zfile_fclose (drv->diskfile);
        drv->diskfile = 0;
        zfile_fclose (drv->writediskfile);
@@ -654,8 +654,10 @@ static void update_drive_gui (int num)
 
 static void drive_fill_bigbuf (drive * drv,int);
 
-struct zfile *DISK_validate_filename (const TCHAR *fname, int leave_open, int *wrprot, uae_u32 *crc32)
+int DISK_validate_filename (const TCHAR *fname, int leave_open, int *wrprot, uae_u32 *crc32, struct zfile **zf)
 {
+       if (zf)
+               *zf = NULL;
        if (crc32)
                *crc32 = 0;
        if (leave_open) {
@@ -670,7 +672,11 @@ struct zfile *DISK_validate_filename (const TCHAR *fname, int leave_open, int *w
                }
                if (f && crc32)
                        *crc32 = zfile_crc32 (f);
-               return f;
+               if (!zf)
+                       zfile_fclose (f);
+               else
+                       *zf = f;
+               return f ? 1 : 0;
        } else {
                if (zfile_exists (fname)) {
                        if (wrprot)
@@ -681,7 +687,7 @@ struct zfile *DISK_validate_filename (const TCHAR *fname, int leave_open, int *w
                                        *crc32 = zfile_crc32 (f);
                                zfile_fclose (f);
                        }
-                       return (void*)1;
+                       return 1;
                } else {
                        if (wrprot)
                                *wrprot = 1;
@@ -719,7 +725,7 @@ static int read_header_ext2 (struct zfile *diskfile, trackid *trackdata, int *nu
 
        zfile_fseek (diskfile, 0, SEEK_SET);
        zfile_fread (buffer, 1, 8, diskfile);
-       if (strncmp (buffer, "UAE-1ADF", 8))
+       if (strncmp ((char*)buffer, "UAE-1ADF", 8))
                return 0;
        zfile_fread (buffer, 1, 4, diskfile);
        *num_tracks = buffer[2] * 256 + buffer[3];
@@ -728,7 +734,7 @@ static int read_header_ext2 (struct zfile *diskfile, trackid *trackdata, int *nu
        for (i = 0; i < (*num_tracks); i++) {
                tid = trackdata + i;
                zfile_fread (buffer, 2 + 2 + 4 + 4, 1, diskfile);
-               tid->type = buffer[3];
+               tid->type = (image_tracktype)buffer[3];
                tid->revolutions = buffer[2] + 1;
                tid->len = buffer[5] * 65536 + buffer[6] * 256 + buffer[7];
                tid->bitlen = buffer[9] * 65536 + buffer[10] * 256 + buffer[11];
@@ -771,7 +777,9 @@ TCHAR *DISK_get_saveimagepath (const TCHAR *name)
 
 static struct zfile *getwritefile (const TCHAR *name, int *wrprot)
 {
-       return DISK_validate_filename (DISK_get_saveimagepath (name), 1, wrprot, NULL);
+       struct zfile *zf;
+       DISK_validate_filename (DISK_get_saveimagepath (name), 1, wrprot, NULL, &zf);
+       return zf;
 }
 
 static int iswritefileempty (const TCHAR *name)
@@ -826,7 +834,7 @@ static int diskfile_iswriteprotect (const TCHAR *fname, int *needwritefile, driv
 
        *needwritefile = 0;
        *drvtype = DRV_35_DD;
-       zf1 = DISK_validate_filename (fname, 1, &wrprot1, NULL);
+       DISK_validate_filename (fname, 1, &wrprot1, NULL, &zf1);
        if (!zf1)
                return 1;
        if (zfile_iscompressed (zf1)) {
@@ -867,11 +875,11 @@ static int drive_insert (drive * drv, struct uae_prefs *p, int dnum, const TCHAR
        trackid *tid;
        int num_tracks, size;
        int canauto;
-       TCHAR *ext;
+       const TCHAR *ext;
 
        gui_disk_image_change (dnum, fname);
        drive_image_free (drv);
-       drv->diskfile = DISK_validate_filename (fname, 1, &drv->wrprot, &drv->crc32);
+       DISK_validate_filename (fname, 1, &drv->wrprot, &drv->crc32, &drv->diskfile);
        drv->ddhd = 1;
        drv->num_secs = 0;
        drv->hard_num_cyls = p->dfxtype[dnum] == DRV_525_SD ? 40 : 80;
@@ -1666,7 +1674,7 @@ static void drive_fill_bigbuf (drive * drv, int force)
 }
 
 /* Update ADF_EXT2 track header */
-static void diskfile_update (struct zfile *diskfile, trackid *ti, int len, uae_u8 type)
+static void diskfile_update (struct zfile *diskfile, trackid *ti, int len, image_tracktype type)
 {
        uae_u8 buf[2 + 2 + 4 + 4], *zerobuf;
 
@@ -1681,7 +1689,7 @@ static void diskfile_update (struct zfile *diskfile, trackid *ti, int len, uae_u
        do_put_mem_long ((uae_u32 *) (buf + 8), ti->bitlen);
        zfile_fwrite (buf, sizeof (buf), 1, diskfile);
        if (ti->len > (len + 7) / 8) {
-               zerobuf = malloc (ti->len);
+               zerobuf = xmalloc (uae_u8, ti->len);
                memset (zerobuf, 0, ti->len);
                zfile_fseek (diskfile, ti->offs, SEEK_SET);
                zfile_fwrite (zerobuf, 1, ti->len, diskfile);
@@ -2059,7 +2067,7 @@ void disk_creatediskfile (TCHAR *name, int type, drive_type adftype, TCHAR *disk
        }
 
        f = zfile_fopen (name, L"wb", 0);
-       chunk = xmalloc (32768);
+       chunk = xmalloc (uae_u8, 32768);
        if (f && chunk) {
                int cylsize = sectors * 2 * 512;
                memset (chunk, 0, 32768);
@@ -2069,7 +2077,7 @@ void disk_creatediskfile (TCHAR *name, int type, drive_type adftype, TCHAR *disk
                                if (adftype <= 1) {
                                        if (i == 0) {
                                                /* boot block */
-                                               strcpy (chunk, "DOS");
+                                               strcpy ((char*)chunk, "DOS");
                                        } else if (i == file_size / 2) {
                                                int block = file_size / 1024;
                                                /* root block */
@@ -2079,7 +2087,7 @@ void disk_creatediskfile (TCHAR *name, int type, drive_type adftype, TCHAR *disk
                                                chunk[316+2] = (block + 1) >> 8; chunk[316+3] = (block + 1) & 255;
                                                s = ua (disk_name);
                                                chunk[432] = strlen (s);
-                                               strcpy (chunk + 433, s);
+                                               strcpy ((char*)chunk + 433, s);
                                                xfree (s);
                                                chunk[508 + 3] = 1;
                                                disk_date (chunk + 420);
@@ -2172,7 +2180,7 @@ int disk_setwriteprotect (int num, const TCHAR *name, int protect)
        drive_type drvtype;
 
        oldprotect = diskfile_iswriteprotect (name, &needwritefile, &drvtype);
-       zf1 = DISK_validate_filename (name, 1, &wrprot1, NULL);
+       DISK_validate_filename (name, 1, &wrprot1, NULL, &zf1);
        if (!zf1)
                return 0;
        if (zfile_iscompressed (zf1))
@@ -3496,7 +3504,7 @@ static uae_u32 getadfcrc (drive *drv)
                return 0;
        zfile_fseek (drv->diskfile, 0, SEEK_END);
        size = zfile_ftell (drv->diskfile);
-       b = (uae_u8*)malloc (size);
+       b = xmalloc (uae_u8, size);
        if (!b)
                return 0;
        zfile_fseek (drv->diskfile, 0, SEEK_SET);
@@ -3515,7 +3523,7 @@ uae_u8 *save_disk (int num, int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = xmalloc (2+1+1+1+1+4+4+256);
+               dstbak = dst = xmalloc (uae_u8, 2+1+1+1+1+4+4+256);
        save_u32 (drv->drive_id);           /* drive type ID */
        save_u8 ((drv->motoroff ? 0:1) | ((disabled & (1 << num)) ? 2 : 0) | (drv->idbit ? 4 : 0) | (drv->dskchange ? 8 : 0));
        save_u8 (drv->cyl);                 /* cylinder */
@@ -3555,7 +3563,7 @@ uae_u8 *save_floppy(int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = xmalloc (2 + 1 + 1 + 1 + 1 + 2);
+               dstbak = dst = xmalloc (uae_u8, 2 + 1 + 1 + 1 + 1 + 2);
        save_u16 (word);                /* current fifo (low word) */
        save_u8 (bitoffset);    /* dma bit offset */
        save_u8 (dma_enable);   /* disk sync found */
similarity index 100%
rename from diskutil.c
rename to diskutil.cpp
similarity index 100%
rename from dongle.c
rename to dongle.cpp
similarity index 99%
rename from drawing.c
rename to drawing.cpp
index 31de0d04941f6b6d602252985ab8466a2b2f8d23..0ca26e491ddf56c4f03900de5d3c13fec50721b3 100644 (file)
--- a/drawing.c
@@ -866,7 +866,7 @@ STATIC_INLINE uae_u8 render_sprites (int pos, int dualpf, uae_u8 apixel, int aga
        return 0;
 }
 
-#include "linetoscr.c"
+#include "linetoscr.cpp"
 
 #ifdef ECS_DENISE
 /* ECS SuperHires special cases */
@@ -1724,8 +1724,8 @@ static void init_aspect_maps (void)
                xfree (amiga2aspect_line_map);
 
        /* At least for this array the +1 is necessary. */
-       amiga2aspect_line_map = xmalloc (sizeof (int) * (MAXVPOS + 1) * 2 + 1);
-       native2amiga_line_map = xmalloc (sizeof (int) * gfxvidinfo.height);
+       amiga2aspect_line_map = xmalloc (int, (MAXVPOS + 1) * 2 + 1);
+       native2amiga_line_map = xmalloc (int, gfxvidinfo.height);
 
        maxl = (MAXVPOS + 1) * (linedbld ? 2 : 1);
        min_ypos_for_screen = minfirstline << (linedbl ? 1 : 0);
similarity index 98%
rename from driveclick.c
rename to driveclick.cpp
index f4e058da21a8b7c887c84047cab0fcf9fa5b8ff1..76bdae664ab2debb8f4d61409d1a98bdc9627a6a 100644 (file)
@@ -49,7 +49,7 @@ uae_s16 *decodewav (uae_u8 *s, int *lenp)
                if (!memcmp (s, "data", 4)) {
                        s += 4;
                        len = s[0] | (s[1] << 8) | (s[2] << 16) | (s[3] << 24);
-                       dst = xmalloc (len);
+                       dst = xmalloc (uae_s16, len / 2);
                        memcpy (dst, s + 4, len);
                        *lenp = len / 2;
                        return dst;
@@ -78,7 +78,7 @@ static int loadsample (TCHAR *path, struct drvsample *ds)
        }
        zfile_fseek (f, 0, SEEK_END);
        size = zfile_ftell (f);
-       buf = xmalloc (size);
+       buf = xmalloc (uae_u8, size);
        zfile_fseek (f, 0, SEEK_SET);
        zfile_fread (buf, size, 1, f);
        zfile_fclose (f);
@@ -216,7 +216,7 @@ void driveclick_reset (void)
        clickbuffer = NULL;
        if (!wave_initialized)
                return;
-       clickbuffer = xmalloc (paula_sndbufsize);
+       clickbuffer = xmalloc (uae_s16, paula_sndbufsize / 2);
        sample_step = (freq << DS_SHIFT) / currprefs.sound_freq;
 }
 
similarity index 99%
rename from enforcer.c
rename to enforcer.cpp
index 835f9931a153be6875ec5507fd1e53e6934e9c21..b0563cad794b6ca8e55acdfd394b5666c1c78ab6 100644 (file)
@@ -126,7 +126,7 @@ static int enforcer_decode_hunk_and_offset (TCHAR *buf, uae_u32 pc)
                uae_u8 *native_string = amiga2native (string, 100);
 
                if (native_string) {
-                       if (!strcmp (native_string, "SegTracker"))
+                       if (!strcmp ((char*)native_string, "SegTracker"))
                                break;
                }
                node = amiga_node_next (node);
@@ -162,7 +162,7 @@ static int enforcer_decode_hunk_and_offset (TCHAR *buf, uae_u32 pc)
                                        offset = pc - address - 4;
                                        name = get_long (node + 8); /* ln_Name */
                                        if (name) {
-                                               native_name = au (amiga2native(name,100));
+                                               native_name = au ((char*)amiga2native(name,100));
                                                if (!native_name)
                                                        native_name = my_strdup (L"Unknown");
                                        } else {
@@ -213,7 +213,7 @@ static void enforcer_display_hit (const TCHAR *addressmode, uae_u32 pc, uaecptr
                goto end;
 
        task_name = get_long (this_task + 10); /* ln_Name */
-       native_task_name = au (amiga2native (task_name, 100));
+       native_task_name = au ((char*)amiga2native (task_name, 100));
        /*if (strcmp(native_task_name,"c:MCP")!=0)
        {
        Exception (0x2d,0);
similarity index 99%
rename from epsonprinter.c
rename to epsonprinter.cpp
index 2525e85e8a8f5490fcacdc7f5beb2655dd400dd4..2afd205fe6c51e52c85a0b423f99a0f85a6e162f 100644 (file)
@@ -797,7 +797,7 @@ static void resetPrinterHard(void)
        resetPrinter();
 }
 
-static printer_init(Bit16u dpi2, Bit16u width, Bit16u height, TCHAR* output2, int multipageOutput2, int numpins)
+static int printer_init(Bit16u dpi2, Bit16u width, Bit16u height, TCHAR* output2, int multipageOutput2, int numpins)
 {
        pins = numpins;
        if (ft == NULL || FT_Init_FreeType(&FTlib))
@@ -818,7 +818,7 @@ static printer_init(Bit16u dpi2, Bit16u width, Bit16u height, TCHAR* output2, in
                page_h = (Bitu)(defaultPageHeight*dpi);
                pagesize =  page_w * page_h;
                page_pitch = page_w;
-               page = xcalloc (pagesize, 1);
+               page = xcalloc (uae_u8, pagesize);
                curFont = NULL;
                charRead = false;
                autoFeed = false;
@@ -856,10 +856,11 @@ static printer_init(Bit16u dpi2, Bit16u width, Bit16u height, TCHAR* output2, in
 #endif
                }
        }
+       return 1;
 };
 
 
-static printer_close(void)
+static void printer_close(void)
 {
        if (page != NULL)
        {
@@ -1473,7 +1474,7 @@ static int processCommandChar(Bit8u ch)
                        break;
                case 0x6b: // Select typeface (ESC k)
                        if (params[0] <= 11 || params[0] == 30 || params[0] == 31) 
-                               LQtypeFace = params[0];
+                               LQtypeFace = (Typeface)params[0];
                        updateFont();
                        break;
                case 0x6c: // Set left margin (ESC 1)
similarity index 100%
rename from ersatz.c
rename to ersatz.cpp
similarity index 99%
rename from expansion.c
rename to expansion.cpp
index 198f9142f5fc8c0f6e5d439969669e23c47d86b1..407542829c189eae7264edd77b50af0693a32ff0 100644 (file)
@@ -947,7 +947,7 @@ static void expamem_init_filesys (void)
 * Zorro III expansion memory
 */
 
-static void expamem_map_z3fastmem_2 (addrbank *bank, int *startp, uae_u32 size, uae_u32 allocated)
+static void expamem_map_z3fastmem_2 (addrbank *bank, uaecptr *startp, uae_u32 size, uae_u32 allocated)
 {
        int z3fs = ((expamem_hi | (expamem_lo >> 4)) << 16);
        int start = *startp;
similarity index 99%
rename from fdi2raw.c
rename to fdi2raw.cpp
index c567a71cff3bb5ad39319e0158cbeb2daee07c09..177ae853b2c3416c32b7e7fc2945e08ebdd380ba 100644 (file)
--- a/fdi2raw.c
@@ -105,7 +105,7 @@ static void *fdi_malloc (int size)
        return (int*)p + 1;
 }
 #else
-#define fdi_free free
+#define fdi_free xfree
 #define fdi_malloc xmalloc
 #endif
 
@@ -195,10 +195,10 @@ static uae_u8 *expand_tree (uae_u8 *stream, NODE *node)
                        temp = *stream++;
                        temp2 = 0x80;
                }
-               node->left = (NODE*)fdi_malloc (sizeof (NODE));
+               node->left = fdi_malloc (NODE, 1);
                memset (node->left, 0, sizeof (NODE));
                stream_temp = expand_tree (stream, node->left);
-               node->right = (NODE*)fdi_malloc (sizeof (NODE));
+               node->right = fdi_malloc (NODE ,1);
                memset (node->right, 0, sizeof (NODE));
                return expand_tree (stream_temp, node->right);
        }
@@ -1358,7 +1358,7 @@ static uae_u8 *fdi_decompress (int pulses, uae_u8 *sizep, uae_u8 *src, int *dofr
                        src += 4;
                }
        } else if (mode == 1) {
-               dst = (uae_u8*)fdi_malloc (pulses *4);
+               dst = fdi_malloc (uae_u8, pulses *4);
                *dofree = 1;
                fdi_decode (src, pulses, dst);
        } else {
@@ -1864,7 +1864,7 @@ static int decode_lowlevel_track (FDI *fdi, int track, struct fdi_cache *cache)
                        idx_off3 = 4;
                }
        } else {
-               idxp = (uae_u8*)fdi_malloc (pulses * 2);
+               idxp = fdi_malloc (uae_u8, pulses * 2);
                idx_free = 1;
                for (i = 0; i < pulses; i++) {
                        idxp[i * 2 + 0] = 2;
@@ -2015,7 +2015,7 @@ FDI *fdi2raw_header(struct zfile *f)
        FDI *fdi;
 
        debuglog ("ALLOC: memory allocated %d\n", fdi_allocated);
-       fdi = (FDI*)fdi_malloc(sizeof(FDI));
+       fdi = fdi_malloc (FDI, 1);
        memset (fdi, 0, sizeof (FDI));
        fdi->file = f;
        oldseek = zfile_ftell (fdi->file);
@@ -2041,10 +2041,10 @@ FDI *fdi2raw_header(struct zfile *f)
                }
        }
 
-       fdi->mfmsync_buffer = (int*)fdi_malloc (MAX_MFM_SYNC_BUFFER * sizeof(int));
-       fdi->track_src_buffer = (uae_u8*)fdi_malloc (MAX_SRC_BUFFER);
-       fdi->track_dst_buffer = (uae_u8*)fdi_malloc (MAX_DST_BUFFER);
-       fdi->track_dst_buffer_timing = (uae_u16*)fdi_malloc (MAX_TIMING_BUFFER);
+       fdi->mfmsync_buffer = fdi_malloc (int, MAX_MFM_SYNC_BUFFER);
+       fdi->track_src_buffer = fdi_malloc (uae_u8, MAX_SRC_BUFFER);
+       fdi->track_dst_buffer = fdi_malloc (uae_u8, MAX_DST_BUFFER);
+       fdi->track_dst_buffer_timing = fdi_malloc (uae_u16, MAX_TIMING_BUFFER / 2);
 
        fdi->last_track = ((fdi->header[142] << 8) + fdi->header[143]) + 1;
        fdi->last_track *= fdi->header[144] + 1;
similarity index 96%
rename from filesys.c
rename to filesys.cpp
index 6792db0c3a634150ad996c317259a62b47e5cdbe..7bef42e701f70350a134369fd4e146c88f232ac6 100644 (file)
--- a/filesys.c
@@ -136,7 +136,7 @@ typedef struct {
        uae_thread_id tid;
        struct _unit *self;
        /* Reset handling */
-       volatile uae_sem_t reset_sync_sem;
+       uae_sem_t reset_sync_sem;
        volatile int reset_state;
 
        /* RDB stuff */
@@ -365,7 +365,7 @@ TCHAR *filesys_createvolname (const TCHAR *volname, const TCHAR *rootdir, const
                                        continue;
                                if (!_tcscmp (p + i, L":\\")) {
                                        xfree (p);
-                                       p = xmalloc (10 * sizeof (TCHAR));
+                                       p = xmalloc (TCHAR, 10);
                                        p[0] = rootdir[0];
                                        p[1] = 0;
                                        i = 0;
@@ -777,7 +777,7 @@ typedef struct key {
        struct key *next;
        a_inode *aino;
        uae_u32 uniq;
-       void *fd;
+       struct fs_filehandle *fd;
        uae_u64 file_pos;
        int dosmode;
        int createmode;
@@ -793,7 +793,7 @@ typedef struct notify {
 
 typedef struct exallkey {
        uae_u32 id;
-       void *dirhandle;
+       struct fs_dirhandle *dirhandle;
        TCHAR *fn;
        uaecptr control;
 } ExAllKey;
@@ -963,60 +963,72 @@ static Unit*
        return u;
 }
 
-
-static void *fs_opendir (Unit *u, const TCHAR *nname)
+static struct fs_dirhandle *fs_opendir (Unit *u, const TCHAR *nname)
 {
-       if (u->volflags & MYVOLUMEINFO_ARCHIVE)
-               return zfile_opendir_archive (nname);
+       struct fs_dirhandle *fsd = xmalloc (struct fs_dirhandle, 1);
+       fsd->isarch = !!(u->volflags & MYVOLUMEINFO_ARCHIVE);
+       if (fsd->isarch)
+               fsd->zd = zfile_opendir_archive (nname);
        else
-               return my_opendir (nname);
+               fsd->od = my_opendir (nname);
+       return fsd;
 }
-static void fs_closedir (Unit *u, void *d)
+static void fs_closedir (struct fs_dirhandle *fsd)
 {
-       if (u->volflags & MYVOLUMEINFO_ARCHIVE)
-               zfile_closedir_archive (d);
+       if (!fsd)
+               return;
+       if (fsd->isarch)
+               zfile_closedir_archive (fsd->zd);
        else
-               my_closedir (d);
+               my_closedir (fsd->od);
+       xfree (fsd);
 }
-static void *fs_open (Unit *unit, const TCHAR *name, int flags)
+static struct fs_filehandle *fs_open (Unit *unit, const TCHAR *name, int flags)
 {
-       int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
-       if (isarch)
-               return zfile_open_archive (name, flags);
+       struct fs_filehandle *fsf = xmalloc (struct fs_filehandle, 1);
+       fsf->isarch = !!(unit->volflags & MYVOLUMEINFO_ARCHIVE);
+       if (fsf->isarch)
+               fsf->zf = zfile_open_archive (name, flags);
        else
-               return my_open (name, flags);
+               fsf->of = my_open (name, flags);
+       return fsf;
 }
-static void fs_close (Unit *unit, void *fd)
+static void fs_close (struct fs_filehandle *fd)
 {
-       int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
-       if (isarch)
-               zfile_close_archive (fd);
+       if (!fd)
+               return;
+       if (fd->isarch)
+               zfile_close_archive (fd->zf);
        else
-               my_close (fd);
+               my_close (fd->of);
 }
-static unsigned int fs_read (Unit *unit, void *d, void *b, unsigned int size)
+static unsigned int fs_read (struct fs_filehandle *fsf, void *b, unsigned int size)
 {
-       int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
-       if (isarch)
-               return zfile_read_archive (d, b, size);
+       if (fsf->isarch)
+               return zfile_read_archive (fsf->zf, b, size);
        else
-               return my_read (d, b, size);
+               return my_read (fsf->of, b, size);
 }
-static uae_u64 fs_lseek64 (Unit *unit, void *d, uae_s64 offset, int whence)
+static unsigned int fs_write (struct fs_filehandle *fsf, void *b, unsigned int size)
 {
-       int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
-       if (isarch)
-               return zfile_lseek_archive (d, offset, whence);
+       if (fsf->isarch)
+               return 0;
+       return my_write (fsf->of, b, size);
+}
+
+static uae_u64 fs_lseek64 (struct fs_filehandle *fsf, uae_s64 offset, int whence)
+{
+       if (fsf->isarch)
+               return zfile_lseek_archive (fsf->zf, offset, whence);
        else
-               return my_lseek (d, offset, whence);
+               return my_lseek (fsf->of, offset, whence);
 }
-static uae_u32 fs_lseek (Unit *unit, void *d, uae_s32 offset, int whence)
+static uae_u32 fs_lseek (struct fs_filehandle *fsf, uae_s32 offset, int whence)
 {
-       int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
-       if (isarch)
-               return (uae_u32)zfile_lseek_archive (d, (uae_s32)offset, whence);
+       if (fsf->isarch)
+               return (uae_u32)zfile_lseek_archive (fsf->zf, (uae_s32)offset, whence);
        else
-               return (uae_u32)my_lseek (d, (uae_s32)offset, whence);
+               return (uae_u32)my_lseek (fsf->of, (uae_s32)offset, whence);
 }
 static void set_volume_name (Unit *unit)
 {
@@ -1051,7 +1063,7 @@ static void clear_exkeys (Unit *unit)
                unit->examine_keys[i].uniq = 0;
        }
        for (i = 0; i < EXALLKEYS; i++) {
-               fs_closedir (unit, unit->exalls[i].dirhandle);
+               fs_closedir (unit->exalls[i].dirhandle);
                unit->exalls[i].dirhandle = NULL;
                xfree (unit->exalls[i].fn);
                unit->exalls[i].fn = NULL;
@@ -1479,7 +1491,7 @@ static void update_child_names (Unit *unit, a_inode *a, a_inode *parent)
                        write_log (L"malformed file name");
                }
                name_start++;
-               new_name = xmalloc ((_tcslen (name_start) + l0) * sizeof (TCHAR));
+               new_name = xmalloc (TCHAR, _tcslen (name_start) + l0);
                _tcscpy (new_name, parent->nname);
                _tcscat (new_name, dirsep);
                _tcscat (new_name, name_start);
@@ -1594,7 +1606,7 @@ static a_inode *lookup_aino (Unit *unit, uae_u32 uniq)
 TCHAR *build_nname (const TCHAR *d, const TCHAR *n)
 {
        TCHAR dsep[2] = { FSDB_DIR_SEPARATOR, 0 };
-       TCHAR *p = xmalloc ((_tcslen (d) + 1 + _tcslen (n) + 1) * sizeof (TCHAR));
+       TCHAR *p = xmalloc (TCHAR, _tcslen (d) + 1 + _tcslen (n) + 1);
        _tcscpy (p, d);
        _tcscat (p, dsep);
        _tcscat (p, n);
@@ -1603,7 +1615,7 @@ TCHAR *build_nname (const TCHAR *d, const TCHAR *n)
 
 TCHAR *build_aname (const TCHAR *d, const TCHAR *n)
 {
-       TCHAR *p = xmalloc ((_tcslen (d) + 1 + _tcslen (n) + 1) * sizeof (TCHAR));
+       TCHAR *p = xmalloc (TCHAR, _tcslen (d) + 1 + _tcslen (n) + 1);
        _tcscpy (p, d);
        _tcscat (p, L"/");
        _tcscat (p, n);
@@ -1775,7 +1787,7 @@ static a_inode *new_child_aino (Unit *unit, a_inode *base, TCHAR *rel)
                if (nn == 0)
                        return 0;
 
-               aino = xcalloc (sizeof (a_inode), 1);
+               aino = xcalloc (a_inode, 1);
                if (aino == 0)
                        return 0;
                aino->aname = modified_rel ? modified_rel : my_strdup (rel);
@@ -1800,7 +1812,7 @@ static a_inode *new_child_aino (Unit *unit, a_inode *base, TCHAR *rel)
 
 static a_inode *create_child_aino (Unit *unit, a_inode *base, TCHAR *rel, int isdir)
 {
-       a_inode *aino = xcalloc (sizeof (a_inode), 1);
+       a_inode *aino = xcalloc (a_inode, 1);
        if (aino == 0)
                return 0;
 
@@ -1824,7 +1836,7 @@ static a_inode *create_child_aino (Unit *unit, a_inode *base, TCHAR *rel, int is
        return aino;
 }
 
-static a_inode *lookup_child_aino (Unit *unit, a_inode *base, TCHAR *rel, uae_u32 *err)
+static a_inode *lookup_child_aino (Unit *unit, a_inode *base, TCHAR *rel, int *err)
 {
        a_inode *c = base->child;
        int l0 = _tcslen (rel);
@@ -1876,7 +1888,7 @@ static a_inode *lookup_child_aino_for_exnext (Unit *unit, a_inode *base, TCHAR *
        if (!isarch)
                c = fsdb_lookup_aino_nname (base, rel);
        if (c == 0) {
-               c = xcalloc (sizeof (a_inode), 1);
+               c = xcalloc (a_inode, 1);
                if (c == 0) {
                        *err = ERROR_NO_FREE_STORE;
                        return 0;
@@ -1902,7 +1914,7 @@ static a_inode *lookup_child_aino_for_exnext (Unit *unit, a_inode *base, TCHAR *
        return c;
 }
 
-static a_inode *get_aino (Unit *unit, a_inode *base, const TCHAR *rel, uae_u32 *err)
+static a_inode *get_aino (Unit *unit, a_inode *base, const TCHAR *rel, int *err)
 {
        TCHAR *tmp;
        TCHAR *p;
@@ -1968,7 +1980,7 @@ static uae_u32 notifyhash (TCHAR *s)
 
 static Notify *new_notify (Unit *unit, TCHAR *name)
 {
-       Notify *n = xmalloc (sizeof (Notify));
+       Notify *n = xmalloc (Notify, 1);
        uae_u32 hash = notifyhash (name);
        n->next = unit->notifyhash[hash];
        unit->notifyhash[hash] = n;
@@ -2018,7 +2030,7 @@ static Unit *startup_create_unit (UnitInfo *uinfo, int num)
        int i;
        Unit *unit, *u;
 
-       unit = xcalloc (sizeof (Unit), 1);
+       unit = xcalloc (Unit, 1);
        /* keep list in insertion order */
        u = units;
        if (u) {
@@ -2089,8 +2101,8 @@ static void filesys_start_thread (UnitInfo *ui, int nr)
        }
 #ifdef UAE_FILESYS_THREADS
        if (is_hardfile (nr) == FILESYS_VIRTUAL) {
-               ui->unit_pipe = xmalloc (sizeof (smp_comm_pipe));
-               ui->back_pipe = xmalloc (sizeof (smp_comm_pipe));
+               ui->unit_pipe = xmalloc (smp_comm_pipe, 1);
+               ui->back_pipe = xmalloc (smp_comm_pipe, 1);
                init_comm_pipe (ui->unit_pipe, 100, 3);
                init_comm_pipe (ui->back_pipe, 100, 1);
                uae_start_thread (L"filesys", filesys_thread, (void *)ui, &ui->tid);
@@ -2259,7 +2271,7 @@ static void free_key (Unit *unit, Key *k)
        }
 
        if (k->fd != NULL)
-               fs_close (unit, k->fd);
+               fs_close (k->fd);
 
        xfree(k);
 }
@@ -2281,7 +2293,7 @@ static Key *lookup_key (Unit *unit, uae_u32 uniq)
 
 static Key *new_key (Unit *unit)
 {
-       Key *k = xcalloc (sizeof (Key), 1);
+       Key *k = xcalloc (Key, 1);
        k->uniq = ++key_uniq;
        k->fd = NULL;
        k->file_pos = 0;
@@ -2313,7 +2325,7 @@ static void
        TRACE((L" }\n"));
 }
 
-static a_inode *find_aino (Unit *unit, uaecptr lock, const TCHAR *name, uae_u32 *err)
+static a_inode *find_aino (Unit *unit, uaecptr lock, const TCHAR *name, int *err)
 {
        a_inode *a;
 
@@ -2391,7 +2403,7 @@ static void notify_check (Unit *unit, a_inode *a)
        for (n = unit->notifyhash[hash]; n; n = n->next) {
                uaecptr nr = n->notifyrequest;
                if (same_aname(n->partname, a->aname)) {
-                       uae_u32 err;
+                       int err;
                        a_inode *a2 = find_aino (unit, 0, n->fullname, &err);
                        if (err == 0 && a == a2)
                                notify_send (unit, n);
@@ -2402,7 +2414,7 @@ static void notify_check (Unit *unit, a_inode *a)
                for (n = unit->notifyhash[hash]; n; n = n->next) {
                        uaecptr nr = n->notifyrequest;
                        if (same_aname(n->partname, a->parent->aname)) {
-                               uae_u32 err;
+                               int err;
                                a_inode *a2 = find_aino (unit, 0, n->fullname, &err);
                                if (err == 0 && a->parent == a2)
                                        notify_send (unit, n);
@@ -2457,7 +2469,7 @@ static void
        n->notifyrequest = nr;
        n->fullname = name;
        if (flags & NRF_NOTIFY_INITIAL) {
-               uae_u32 err;
+               int err;
                a_inode *a = find_aino (unit, 0, n->fullname, &err);
                if (err == 0)
                        notify_send (unit, n);
@@ -2522,7 +2534,7 @@ static void
        uaecptr name = GET_PCK_ARG2 (packet) << 2;
        long mode = GET_PCK_ARG3 (packet);
        a_inode *a;
-       uae_u32 err;
+       int err;
 
        if (mode != SHARED_LOCK && mode != EXCLUSIVE_LOCK) {
                TRACE((L"Bad mode %d (should be %d or %d).\n", mode, SHARED_LOCK, EXCLUSIVE_LOCK));
@@ -2883,7 +2895,8 @@ static int exalldo (uaecptr exalldata, uae_u32 exalldatasize, uae_u32 type, uaec
        int size, size2;
        int entrytype;
        TCHAR *xs = NULL, *commentx = NULL;
-       uae_u32 flags = 15, days, mins, ticks;
+       uae_u32 flags = 15;
+       long days, mins, ticks;
        struct _stat64 statbuf;
        int fsdb_can = fsdb_cando (unit);
        uae_u16 uid = 0, gid = 0;
@@ -2998,8 +3011,7 @@ static int action_examine_all_do (Unit *unit, uaecptr lock, ExAllKey *eak, uaecp
        a_inode *aino, *base;
        int ok;
        uae_u32 err;
-       int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
-       void *d;
+       struct fs_dirhandle *d;
        TCHAR fn[MAX_DPATH];
 
        if (lock != 0)
@@ -3010,11 +3022,11 @@ static int action_examine_all_do (Unit *unit, uaecptr lock, ExAllKey *eak, uaecp
                d = eak->dirhandle;
                if (!eak->fn) {
                        do {
-                               if (isarch)
-                                       ok = zfile_readdir_archive (d, fn);
+                               if (d->isarch)
+                                       ok = zfile_readdir_archive (d->zd, fn);
                                else
-                                       ok = my_readdir (d, fn);
-                       } while (ok && !isarch && fsdb_name_invalid (fn));
+                                       ok = my_readdir (d->od, fn);
+                       } while (ok && !d->isarch && fsdb_name_invalid (fn));
                        if (!ok)
                                return 0;
                } else {
@@ -3054,7 +3066,7 @@ static int action_examine_all_end (Unit *unit, dpacket packet)
                doserr = ERROR_OBJECT_WRONG_TYPE;
        } else {
                eak->id = 0;
-               fs_closedir (unit, eak->dirhandle);
+               fs_closedir (eak->dirhandle);
                xfree (eak->fn);
                eak->fn = NULL;
                eak->dirhandle = NULL;
@@ -3077,9 +3089,8 @@ static int action_examine_all (Unit *unit, dpacket packet)
        uaecptr control = GET_PCK_ARG5 (packet);
 
        ExAllKey *eak = NULL;
-       int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
        a_inode *base;
-       void *d;
+       struct fs_dirhandle *d;
        int ok, i;
        uaecptr exp;
        uae_u32 id, doserr = ERROR_NO_MORE_ENTRIES;
@@ -3175,7 +3186,7 @@ fail:
                PUT_PCK_RES2 (packet, doserr);
                if (eak) {
                        eak->id = 0;
-                       fs_closedir (unit, eak->dirhandle);
+                       fs_closedir (eak->dirhandle);
                        eak->dirhandle = NULL;
                        xfree (eak->fn);
                        eak->fn = NULL;
@@ -3239,9 +3250,8 @@ finished - they may never finish!  */
 
 static void populate_directory (Unit *unit, a_inode *base)
 {
-       void *d;
+       struct fs_dirhandle *d;
        a_inode *aino;
-       int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
 
        d = fs_opendir (unit, base->nname);
        if (!d)
@@ -3260,18 +3270,18 @@ static void populate_directory (Unit *unit, a_inode *base)
                /* Find next file that belongs to the Amiga fs (skipping things
                like "..", "." etc.  */
                do {
-                       if (isarch)
-                               ok = zfile_readdir_archive(d, fn);
+                       if (d->isarch)
+                               ok = zfile_readdir_archive(d->zd, fn);
                        else
-                               ok = my_readdir (d, fn);
-               } while (ok && !isarch && fsdb_name_invalid (fn));
+                               ok = my_readdir (d->od, fn);
+               } while (ok && !d->isarch && fsdb_name_invalid (fn));
                if (!ok)
                        break;
                /* This calls init_child_aino, which will notice that the parent is
                being ExNext()ed, and it will increment the locked counts.  */
                aino = lookup_child_aino_for_exnext (unit, base, fn, &err);
        }
-       fs_closedir (unit, d);
+       fs_closedir (d);
 }
 
 static void do_examine (Unit *unit, dpacket packet, ExamineKey *ek, uaecptr info)
@@ -3360,8 +3370,8 @@ static void do_find (Unit *unit, dpacket packet, int mode, int create, int fallb
        uaecptr name = GET_PCK_ARG3 (packet) << 2;
        a_inode *aino;
        Key *k;
-       void *fd;
-       uae_u32 err;
+       struct fs_filehandle *fd;
+       int err;
        mode_t openmode;
        int aino_created = 0;
        int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
@@ -3486,7 +3496,7 @@ static void
        uaecptr lock = GET_PCK_ARG2 (packet) << 2;
        a_inode *aino;
        Key *k;
-       void *fd;
+       struct fs_filehandle *fd;
        mode_t openmode;
        int mode;
        int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
@@ -3638,7 +3648,7 @@ static void
        if (valid_address (addr, size)) {
                uae_u8 *realpt;
                realpt = get_real_address (addr);
-               actual = fs_read (unit, k->fd, realpt, size);
+               actual = fs_read (k->fd, realpt, size);
 
                if (actual == 0) {
                        PUT_PCK_RES1 (packet, 0);
@@ -3657,19 +3667,19 @@ static void
                write_log (L"unixfs warning: Bad pointer passed for read: %08x, size %d\n", addr, size);
                /* ugh this is inefficient but easy */
 
-               old = fs_lseek (unit, k->fd, 0, SEEK_CUR);
-               filesize = fs_lseek (unit, k->fd, 0, SEEK_END);
-               fs_lseek (unit, k->fd, old, SEEK_SET);
+               old = fs_lseek (k->fd, 0, SEEK_CUR);
+               filesize = fs_lseek (k->fd, 0, SEEK_END);
+               fs_lseek (k->fd, old, SEEK_SET);
                if (size > filesize)
                        size = filesize;
 
-               buf = xmalloc (size);
+               buf = xmalloc (uae_u8, size);
                if (!buf) {
                        PUT_PCK_RES1 (packet, -1);
                        PUT_PCK_RES2 (packet, ERROR_NO_FREE_STORE);
                        return;
                }
-               actual = fs_read (unit, k->fd, buf, size);
+               actual = fs_read (k->fd, buf, size);
 
                if (actual < 0) {
                        PUT_PCK_RES1 (packet, 0);
@@ -3693,7 +3703,7 @@ static void
        uaecptr addr = GET_PCK_ARG2 (packet);
        long size = GET_PCK_ARG3 (packet);
        long actual;
-       TCHAR *buf;
+       uae_u8 *buf;
        int i;
 
        if (k == 0) {
@@ -3713,13 +3723,13 @@ static void
 
        if (valid_address (addr, size)) {
                uae_u8 *realpt = get_real_address (addr);
-               actual = my_write (k->fd, realpt, size);
+               actual = fs_write (k->fd, realpt, size);
 
        } else {
 
                write_log (L"unixfs warning: Bad pointer passed for write: %08x, size %d\n", addr, size);
                /* ugh this is inefficient but easy */
-               buf = (TCHAR *)malloc(size);
+               buf = xmalloc (uae_u8, size);
                if (!buf) {
                        PUT_PCK_RES1 (packet, -1);
                        PUT_PCK_RES2 (packet, ERROR_NO_FREE_STORE);
@@ -3729,7 +3739,7 @@ static void
                for (i = 0; i < size; i++)
                        buf[i] = get_byte (addr + i);
 
-               actual = my_write (k->fd, buf, size);
+               actual = fs_write (k->fd, buf, size);
                xfree (buf);
        }
 
@@ -3767,11 +3777,11 @@ static void
        TRACE((L"ACTION_SEEK(%s,%d,%d)\n", k->aino->nname, pos, mode));
        gui_flicker_led (LED_HD, unit->unit, 1);
 
-       old = fs_lseek (unit, k->fd, 0, SEEK_CUR);
+       old = fs_lseek (k->fd, 0, SEEK_CUR);
        {
                uae_s64 temppos;
-               uae_s64 filesize = fs_lseek64 (unit, k->fd, 0, SEEK_END);
-               fs_lseek (unit, k->fd, old, SEEK_SET);
+               uae_s64 filesize = fs_lseek64 (k->fd, 0, SEEK_END);
+               fs_lseek (k->fd, old, SEEK_SET);
 
                if (whence == SEEK_CUR)
                        temppos = old + pos;
@@ -3786,12 +3796,12 @@ static void
                        return;
                }
        }
-       res = fs_lseek64 (unit, k->fd, pos, whence);
+       res = fs_lseek64 (k->fd, pos, whence);
 
        if (-1 == res || old > MAXFILESIZE32) {
                PUT_PCK_RES1 (packet, -1);
                PUT_PCK_RES2 (packet, ERROR_SEEK_ERROR);
-               fs_lseek64 (unit, k->fd, old, SEEK_SET);
+               fs_lseek64 (k->fd, old, SEEK_SET);
                res = old;
        } else {
                PUT_PCK_RES1 (packet, old);
@@ -3806,7 +3816,7 @@ static void
        uaecptr name = GET_PCK_ARG3 (packet) << 2;
        uae_u32 mask = GET_PCK_ARG4 (packet);
        a_inode *a;
-       uae_u32 err;
+       int err;
 
        TRACE((L"ACTION_SET_PROTECT(0x%lx,\"%s\",0x%lx)\n", lock, bstr (unit, name), mask));
 
@@ -3844,7 +3854,7 @@ static void action_set_comment (Unit * unit, dpacket packet)
        uaecptr comment = GET_PCK_ARG4 (packet) << 2;
        TCHAR *commented = NULL;
        a_inode *a;
-       uae_u32 err;
+       int err;
 
        if (unit->ui.readonly) {
                PUT_PCK_RES1 (packet, DOS_FALSE);
@@ -3861,7 +3871,7 @@ static void action_set_comment (Unit * unit, dpacket packet)
                }
                if (_tcslen (commented) > 0) {
                        TCHAR *p = commented;
-                       commented = xmalloc (81 * sizeof (TCHAR));
+                       commented = xmalloc (TCHAR, 81);
                        _tcsncpy (commented, p, 80);
                        commented[80] = 0;
                } else {
@@ -3925,7 +3935,7 @@ static void
        long mode = GET_PCK_ARG3 (packet);
        unsigned long uniq;
        a_inode *a = NULL, *olda = NULL;
-       uae_u32 err = 0;
+       int err = 0;
        TRACE((L"ACTION_CHANGE_MODE(0x%lx,%d,%d)\n", object, type, mode));
 
        if (! object || (type != CHANGE_FH && type != CHANGE_LOCK)) {
@@ -4032,7 +4042,7 @@ static void
        uaecptr lock = GET_PCK_ARG1 (packet) << 2;
        uaecptr name = GET_PCK_ARG2 (packet) << 2;
        a_inode *aino;
-       uae_u32 err;
+       int err;
 
        TRACE((L"ACTION_CREATE_DIR(0x%lx,\"%s\")\n", lock, bstr (unit, name)));
 
@@ -4137,11 +4147,11 @@ static void
        }
 
        /* Write one then truncate: that should give the right size in all cases.  */
-       offset = fs_lseek (unit, k->fd, offset, whence);
-       my_write (k->fd, /* whatever */(uae_u8*)&k1, 1);
+       offset = fs_lseek (k->fd, offset, whence);
+       fs_write (k->fd, /* whatever */(uae_u8*)&k1, 1);
        if (k->file_pos > offset)
                k->file_pos = offset;
-       fs_lseek (unit, k->fd, (off_t)k->file_pos, SEEK_SET);
+       fs_lseek (k->fd, (off_t)k->file_pos, SEEK_SET);
 
        /* Brian: no bug here; the file _must_ be one byte too large after writing
        The write is supposed to guarantee that the file can't be smaller than
@@ -4166,7 +4176,7 @@ static int relock_do(Unit *unit, a_inode *a1)
                knext = k1->next;
                if (k1->aino == a1 && k1->fd) {
                        wehavekeys++;
-                       fs_close (unit, k1->fd);
+                       fs_close (k1->fd);
                        write_log (L"handle %p freed\n", k1->fd);
                }
        }
@@ -4200,7 +4210,7 @@ static void relock_re (Unit *unit, a_inode *a1, a_inode *a2, int failed)
                                write_log (L"relocking failed '%s' -> '%s'\n", a1->nname, a2->nname);
                                free_key (unit, k1);
                        } else {
-                               fs_lseek64 (unit, k1->fd, k1->file_pos, SEEK_SET);
+                               fs_lseek64 (k1->fd, k1->file_pos, SEEK_SET);
                        }
                }
        }
@@ -4212,7 +4222,7 @@ static void
        uaecptr lock = GET_PCK_ARG1 (packet) << 2;
        uaecptr name = GET_PCK_ARG2 (packet) << 2;
        a_inode *a;
-       uae_u32 err;
+       int err;
 
        TRACE((L"ACTION_DELETE_OBJECT(0x%lx,\"%s\")\n", lock, bstr (unit, name)));
 
@@ -4274,7 +4284,7 @@ static void
        uaecptr date = GET_PCK_ARG4 (packet);
        a_inode *a;
        struct utimbuf ut;
-       uae_u32 err;
+       int err;
 
        TRACE((L"ACTION_SET_DATE(0x%lx,\"%s\")\n", lock, bstr (unit, name)));
 
@@ -4307,7 +4317,7 @@ static void
        uaecptr lock2 = GET_PCK_ARG3 (packet) << 2;
        uaecptr name2 = GET_PCK_ARG4 (packet) << 2;
        a_inode *a1, *a2;
-       uae_u32 err1, err2;
+       int err1, err2;
        Key *k1, *knext;
        int wehavekeys = 0;
 
@@ -4514,11 +4524,11 @@ static void action_change_file_position64 (Unit *unit, dpacket packet)
        TRACE((L"ACTION_CHANGE_FILE_POSITION64(%s,%I64d,%d)\n", k->aino->nname, pos, mode));
        gui_flicker_led (LED_HD, unit->unit, 1);
 
-       old = fs_lseek64 (unit, k->fd, 0, SEEK_CUR);
+       old = fs_lseek64 (k->fd, 0, SEEK_CUR);
        {
                uae_s64 temppos;
-               uae_s64 filesize = fs_lseek64 (unit, k->fd, 0, SEEK_END);
-               fs_lseek64 (unit, k->fd, old, SEEK_SET);
+               uae_s64 filesize = fs_lseek64 (k->fd, 0, SEEK_END);
+               fs_lseek64 (k->fd, old, SEEK_SET);
 
                if (whence == SEEK_CUR)
                        temppos = old + pos;
@@ -4533,7 +4543,7 @@ static void action_change_file_position64 (Unit *unit, dpacket packet)
                        return;
                }
        }
-       res = fs_lseek64 (unit, k->fd, pos, whence);
+       res = fs_lseek64 (k->fd, pos, whence);
 
        if (-1 == res) {
                PUT_PCK64_RES1 (packet, DOS_FALSE);
@@ -4597,11 +4607,11 @@ static void action_change_file_size64 (Unit *unit, dpacket packet)
        }
 
        /* Write one then truncate: that should give the right size in all cases.  */
-       offset = fs_lseek (unit, k->fd, offset, whence);
-       my_write (k->fd, /* whatever */(uae_u8*)&k1, 1);
+       offset = fs_lseek (k->fd, offset, whence);
+       fs_write (k->fd, /* whatever */(uae_u8*)&k1, 1);
        if (k->file_pos > offset)
                k->file_pos = offset;
-       fs_lseek (unit, k->fd, k->file_pos, SEEK_SET);
+       fs_lseek (k->fd, k->file_pos, SEEK_SET);
 
        if (my_truncate (k->aino->nname, offset) == -1) {
                PUT_PCK64_RES1 (packet, DOS_FALSE);
@@ -4627,11 +4637,11 @@ static void action_get_file_size64 (Unit *unit, dpacket packet)
                return;
        }
        TRACE((L"ACTION_GET_FILE_SIZE64(%s)\n", k->aino->nname));
-       old = fs_lseek64 (unit, k->fd, 0, SEEK_CUR);
+       old = fs_lseek64 (k->fd, 0, SEEK_CUR);
        if (old >= 0) {
-               filesize = fs_lseek64 (unit, k->fd, 0, SEEK_END);
+               filesize = fs_lseek64 (k->fd, 0, SEEK_END);
                if (filesize >= 0) {
-                       fs_lseek64 (unit, k->fd, old, SEEK_SET);
+                       fs_lseek64 (k->fd, old, SEEK_SET);
                        PUT_PCK64_RES1 (packet, filesize);
                        PUT_PCK64_RES2 (packet, 0);
                        return;
@@ -5008,7 +5018,7 @@ void filesys_free_handles (void)
                for (k1 = u->keys; k1; k1 = knext) {
                        knext = k1->next;
                        if (k1->fd)
-                               fs_close (u, k1->fd);
+                               fs_close (k1->fd);
                        xfree (k1);
                }
                u->keys = NULL;
@@ -5323,9 +5333,9 @@ static TCHAR *device_dupfix (uaecptr expbase, TCHAR *devname)
        return my_strdup (newname);
 }
 
-static void dump_partinfo (uae_char *name, int num, uaecptr pp, int partblock)
+static void dump_partinfo (uae_u8 *name, int num, uaecptr pp, int partblock)
 {
-       TCHAR *s = au (name);
+       TCHAR *s = au ((char*)name);
        uae_u32 dostype = get_long (pp + 80);
        uae_u64 size;
 
@@ -5421,7 +5431,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke
                        rdblock, fileblock, hfd->cylinders, hfd->sectors, hfd->heads);
        }
 
-       buf = xmalloc (readblocksize);
+       buf = xmalloc (uae_u8, readblocksize);
        for (i = 0; i <= partnum; i++) {
                if (i == 0)
                        partblock = rl (bufrdb + 28);
@@ -5451,7 +5461,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke
                m68k_dreg (regs, 7) = m68k_dreg (regs, 7) & ~1;
 
        buf[37 + buf[36]] = 0; /* zero terminate BSTR */
-       s = au (buf + 37);
+       s = au ((char*)buf + 37);
        uip->rdb_devname_amiga[partnum] = ds (device_dupfix (get_long (parmpacket + PP_EXPLIB), s));
        xfree (s);
        put_long (parmpacket, uip->rdb_devname_amiga[partnum]); /* name */
@@ -5533,7 +5543,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke
                put_byte (parmpacket + PP_FSHDSTART + i, buf[32 + i]);
        put_long (parmpacket + PP_FSHDSTART, dostype);
        /* we found required FSHD block */
-       fsmem = xmalloc (262144);
+       fsmem = xmalloc (uae_u8, 262144);
        lsegblock = rl (buf + 72);
        i = 0;
        for (;;) {
@@ -5636,7 +5646,7 @@ static int dofakefilesys (UnitInfo *uip, uaecptr parmpacket)
        size = zfile_ftell (zf);
        if (size > 0) {
                zfile_fseek (zf, 0, SEEK_SET);
-               uip->rdb_filesysstore = xmalloc (size);
+               uip->rdb_filesysstore = xmalloc (uae_u8, size);
                zfile_fread (uip->rdb_filesysstore, size, 1, zf);
        }
        zfile_fclose (zf);
@@ -5825,7 +5835,7 @@ void filesys_install_code (void)
        bootrom_header = 3 * 4;
        align(4);
        a = here ();
-#include "filesys_bootrom.c"
+#include "filesys_bootrom.cpp"
 
        bootrom_items = dlg (a + 8);
        /* The last offset comes from the code itself, look for it near the top. */
@@ -5834,7 +5844,7 @@ void filesys_install_code (void)
        filesys_initcode = a + dlg (b) + bootrom_header - 4;
 }
 
-#include "od-win32/win32_filesys.c"
+#include "od-win32/win32_filesys.cpp"
 
 static uae_u8 *restore_filesys_hardfile (UnitInfo *ui, uae_u8 *src)
 {
@@ -5904,7 +5914,7 @@ static a_inode *restore_filesys_get_base (Unit *u, TCHAR *npath)
        /* iterate from root to last to previous path part,
        * create ainos if not already created.
        */
-       path = xcalloc((_tcslen (npath) + 2) * sizeof (TCHAR), 1);
+       path = xcalloc(TCHAR, _tcslen (npath) + 2);
        cnt = 1;
        for (;;) {
                _tcscpy (path, npath);
@@ -5971,7 +5981,7 @@ static TCHAR *makenativepath (UnitInfo *ui, TCHAR *apath)
        int i;
        TCHAR *pn;
        /* create native path. FIXME: handle 'illegal' characters */
-       pn = xcalloc ((_tcslen (apath) + 1 + _tcslen (ui->rootdir) + 1) * sizeof (TCHAR), 1);
+       pn = xcalloc (TCHAR, _tcslen (apath) + 1 + _tcslen (ui->rootdir) + 1);
        _stprintf (pn, L"%s/%s", ui->rootdir, apath);
        if (FSDB_DIR_SEPARATOR != '/') {
                for (i = 0; i < _tcslen (pn); i++) {
@@ -5990,7 +6000,7 @@ static uae_u8 *restore_aino (UnitInfo *ui, Unit *u, uae_u8 *src)
        a_inode *base, *a;
 
        missing = 0;
-       a = xcalloc (sizeof (a_inode), 1);
+       a = xcalloc (a_inode, 1);
        a->uniq = restore_u64 ();
        a->locked_children = restore_u32 ();
        a->exnext_count = restore_u32 ();
@@ -6061,13 +6071,13 @@ static uae_u8 *restore_key (UnitInfo *ui, Unit *u, uae_u8 *src)
        int savedsize, uniq;
        TCHAR *p, *pn;
        mode_t openmode;
-       DWORD err;
+       int err;
        int missing;
        a_inode *a;
        Key *k;
 
        missing = 0;
-       k = xcalloc (sizeof (Key), 1);
+       k = xcalloc (Key, 1);
        k->uniq = restore_u64 ();
        k->file_pos = restore_u32 ();
        k->createmode = restore_u32 ();
@@ -6095,11 +6105,11 @@ static uae_u8 *restore_key (UnitInfo *ui, Unit *u, uae_u8 *src)
                        write_log (L"*** FS: Open file '%s' is missing, creating dummy file!\n", p);
                        k->fd = fs_open (u, pn, openmode | O_CREAT |O_BINARY);
                        if (k->fd) {
-                               uae_u8 *buf = xcalloc (10000, 1);
+                               uae_u8 *buf = xcalloc (uae_u8, 10000);
                                int sp = savedsize;
                                while (sp) {
                                        int s = sp >= 10000 ? 10000 : sp;
-                                       my_write(k->fd, buf, s);
+                                       fs_write (k->fd, buf, s);
                                        sp -= s;
                                }
                                xfree(buf);
@@ -6115,14 +6125,14 @@ static uae_u8 *restore_key (UnitInfo *ui, Unit *u, uae_u8 *src)
                        missing = 1;
                } else {
                        uae_s64 s;
-                       s = fs_lseek64 (u, k->fd, 0, SEEK_END);
+                       s = fs_lseek64 (k->fd, 0, SEEK_END);
                        if (s != savedsize)
                                write_log (L"FS: restored file '%s' size changed! orig=%d, now=%d!!\n", p, savedsize, s);
                        if (k->file_pos > s) {
                                write_log (L"FS: restored filepos larger than size of file '%s'!! %d > %d\n", p, k->file_pos, s);
                                k->file_pos = s;
                        }
-                       fs_lseek64 (u,k->fd, k->file_pos, SEEK_SET);
+                       fs_lseek64 (k->fd, k->file_pos, SEEK_SET);
                }
        }
        xfree (p);
@@ -6137,13 +6147,13 @@ static uae_u8 *restore_key (UnitInfo *ui, Unit *u, uae_u8 *src)
 
 static uae_u8 *restore_notify (UnitInfo *ui, Unit *u, uae_u8 *src)
 {
-       Notify *n = xcalloc (sizeof (Notify), 1);
+       Notify *n = xcalloc (Notify, 1);
        uae_u32 hash;
        TCHAR *s;
 
        n->notifyrequest = restore_u32 ();
        s = restore_string ();
-       n->fullname = xmalloc ((_tcslen (ui->volname) + 2 + _tcslen (s) + 1) * sizeof (TCHAR));
+       n->fullname = xmalloc (TCHAR, _tcslen (ui->volname) + 2 + _tcslen (s) + 1);
        _stprintf (n->fullname, L"%s:%s", ui->volname, s);
        xfree(s);
        s = _tcsrchr (n->fullname, '/');
@@ -6212,7 +6222,7 @@ static TCHAR *getfullaname(a_inode *a)
        TCHAR *p;
        int first = 1;
 
-       p = xcalloc (2000 * sizeof (TCHAR), 1);
+       p = xcalloc (TCHAR, 2000);
        while (a) {
                int len = _tcslen (a->aname);
                memmove (p + len + 1, p, (_tcslen (p) + 1) * sizeof (TCHAR));
@@ -6275,10 +6285,10 @@ static uae_u8 *save_key (uae_u8 *dst, Key *k)
        save_u32 ((uae_u32)k->file_pos);
        save_u32 (k->createmode);
        save_u32 (k->dosmode);
-       size = my_lseek (k->fd, 0, SEEK_END);
+       size = fs_lseek (k->fd, 0, SEEK_END);
        save_u32 ((uae_u32)size);
        save_u64 (k->aino->uniq);
-       my_lseek (k->fd, k->file_pos, SEEK_SET);
+       fs_lseek (k->fd, k->file_pos, SEEK_SET);
        save_string (fn);
        save_u64 (k->file_pos);
        save_u64 (size);
@@ -6376,7 +6386,7 @@ uae_u8 *save_filesys_common (int *len)
        uae_u8 *dstbak, *dst;
        if (nr_units () == 0)
                return NULL;
-       dstbak = dst = xmalloc (1000);
+       dstbak = dst = xmalloc (uae_u8, 1000);
        save_u32 (2);
        save_u64 (a_uniq);
        save_u64 (key_uniq);
@@ -6408,7 +6418,7 @@ uae_u8 *save_filesys (int num, int *len)
        if (type == FILESYS_VIRTUAL && (ui->self == NULL || ui->volname == NULL))
                return NULL;
        write_log (L"FS_FILESYS: '%s' '%s'\n", ui->devname, ui->volname);
-       dstbak = dst = xmalloc (100000);
+       dstbak = dst = xmalloc (uae_u8, 100000);
        save_u32 (2); /* version */
        save_u32 (ui->devno);
        save_u16 (type);
similarity index 100%
rename from filesys_bootrom.c
rename to filesys_bootrom.cpp
diff --git a/fpp.c b/fpp.cpp
similarity index 99%
rename from fpp.c
rename to fpp.cpp
index c5940cdd9f5358c237abde215900787c7c53804c..d819c92ea9a8c83ccfb3346f7c35495676d4453e 100644 (file)
--- a/fpp.c
+++ b/fpp.cpp
@@ -325,6 +325,8 @@ STATIC_INLINE tointtype toint (fptype src, fptype minval, fptype maxval)
 #endif
 }
 
+extern int isinf (double x);
+
 uae_u32 get_fpsr (void)
 {
        uae_u32 answer = regs.fpsr & 0x00ffffff;
@@ -1744,7 +1746,7 @@ uae_u8 *save_fpu (int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = malloc (4+4+8*10+4+4+4+4+4);
+               dstbak = dst = xmalloc (uae_u8, 4+4+8*10+4+4+4+4+4);
        save_u32 (currprefs.fpu_model);
        save_u32 (0x80000000);
        for (i = 0; i < 8; i++) {
diff --git a/fsdb.c b/fsdb.cpp
similarity index 94%
rename from fsdb.c
rename to fsdb.cpp
index b8af475a0d82f234e69229598e91818a814664d6..c24b993915f2884748fdbdd87ea783de272e7dbe 100644 (file)
--- a/fsdb.c
+++ b/fsdb.cpp
@@ -146,18 +146,18 @@ void fsdb_clean_dir (a_inode *dir)
 static a_inode *aino_from_buf (a_inode *base, uae_u8 *buf, long off)
 {
        uae_u32 mode;
-       a_inode *aino = (a_inode *) xcalloc (sizeof (a_inode), 1);
+       a_inode *aino = xcalloc (a_inode, 1);
        TCHAR *s;
 
        mode = do_get_mem_long ((uae_u32 *)(buf + 1));
        buf += 5;
-       aino->aname = au (buf);
+       aino->aname = au ((char*)buf);
        buf += 257;
-       s = au (buf);
+       s = au ((char*)buf);
        aino->nname = build_nname (base->nname, s);
        xfree (s);
        buf += 257;
-       aino->comment = *buf != '\0' ? au (buf) : 0;
+       aino->comment = *buf != '\0' ? au ((char*)buf) : 0;
        fsdb_fill_file_attrs (base, aino);
        aino->amigaos_mode = mode;
        aino->has_dbentry = 1;
@@ -181,7 +181,7 @@ a_inode *fsdb_lookup_aino_aname (a_inode *base, const TCHAR *aname)
                TCHAR *s;
                if (fread (buf, 1, sizeof buf, f) < sizeof buf)
                        break;
-               s = au (buf + 5);
+               s = au ((char*)buf + 5);
                if (buf[0] != 0 && same_aname (s, aname)) {
                        long pos = ftell (f) - sizeof buf;
                        fclose (f);
@@ -210,7 +210,7 @@ a_inode *fsdb_lookup_aino_nname (a_inode *base, const TCHAR *nname)
                uae_u8 buf[1 + 4 + 257 + 257 + 81];
                if (fread (buf, 1, sizeof buf, f) < sizeof buf)
                        break;
-               if (buf[0] != 0 && strcmp (buf + 5 + 257, s) == 0) {
+               if (buf[0] != 0 && strcmp ((char*)buf + 5 + 257, s) == 0) {
                        long pos = ftell (f) - sizeof buf;
                        fclose (f);
                        xfree (s);
@@ -239,7 +239,7 @@ int fsdb_used_as_nname (a_inode *base, const TCHAR *nname)
                        break;
                if (buf[0] == 0)
                        continue;
-               s = au (buf + 5 + 257);
+               s = au ((char*)buf + 5 + 257);
                if (_tcscmp (s, nname) == 0) {
                        xfree (s);
                        fclose (f);
@@ -271,11 +271,11 @@ static void write_aino (FILE *f, a_inode *aino)
 
        buf[0] = aino->needs_dbentry;
        do_put_mem_long ((uae_u32 *)(buf + 1), aino->amigaos_mode);
-       ua_copy (buf + 5, 256, aino->aname);
+       ua_copy ((char*)buf + 5, 256, aino->aname);
        buf[5 + 256] = '\0';
-       ua_copy (buf + 5 + 257, 256, nname_begin (aino->nname));
+       ua_copy ((char*)buf + 5 + 257, 256, nname_begin (aino->nname));
        buf[5 + 257 + 256] = '\0';
-       ua_copy (buf + 5 + 2 * 257, 80, aino->comment ? aino->comment : L"");
+       ua_copy ((char*)buf + 5 + 2 * 257, 80, aino->comment ? aino->comment : L"");
        buf[5 + 2 * 257 + 80] = '\0';
        aino->db_offset = ftell (f);
        fwrite (buf, 1, sizeof buf, f);
@@ -359,7 +359,7 @@ void fsdb_dir_writeback (a_inode *dir)
 
                i = 0;
                while (!aino->has_dbentry && i < size) {
-                       TCHAR *s = au (tmpbuf + i +  5);
+                       TCHAR *s = au ((char*)tmpbuf + i +  5);
                        if (!_tcscmp (s, aino->aname)) {
                                aino->has_dbentry = 1;
                                aino->db_offset = i;
similarity index 100%
rename from fsdb_unix.c
rename to fsdb_unix.cpp
similarity index 100%
rename from fsusage.c
rename to fsusage.cpp
index 2e418f4d2292e53556ee33ffd676e0f085c32b7b..ac8f8fe4be28a95317c955279ae65aa758f77307 100644 (file)
--- a/fsusage.c
@@ -16,6 +16,7 @@ along with this program; if not, write to the Free Software Foundation,
 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "sysconfig.h"
+#include "sysdeps.h"
 
 #include <stdlib.h>
 #include <sys/types.h>
@@ -46,7 +47,6 @@ static long adjust_blocks (long blocks, int fromsize, int tosize)
 }
 
 #ifdef _WIN32
-#include "sysdeps.h"
 #include "od-win32/posixemu.h"
 #include <windows.h>
 int get_fs_usage (const TCHAR *path, const TCHAR *disk, struct fs_usage *fsp)
similarity index 98%
rename from gayle.c
rename to gayle.cpp
index 35fb41f1ca9b5c3f7dd7542ea330f8d62955b55d..febb4454d13bd4a65d43ce08b14fb01c91c3659c 100644 (file)
--- a/gayle.c
+++ b/gayle.cpp
@@ -1486,17 +1486,17 @@ static void initsramattr (int size, int readonly)
        *p++= 4; /* PCMCIA 2.1 */
        *p++= 1;
        if (real) {
-               ua_copy (p, -1, hfd->product_id);
-               p += strlen (p) + 1;
-               ua_copy(p, -1, hfd->product_rev);
+               ua_copy ((char*)p, -1, hfd->product_id);
+               p += strlen ((char*)p) + 1;
+               ua_copy ((char*)p, -1, hfd->product_rev);
        } else {
-               strcpy (p, "UAE");
-               p += strlen (p) + 1;
-               strcpy (p, "68000");
+               strcpy ((char*)p, "UAE");
+               p += strlen ((char*)p) + 1;
+               strcpy ((char*)p, "68000");
        }
-       p += strlen (p) + 1;
-       sprintf (p, "Generic Emulated %dKB PCMCIA SRAM Card", size >> 10);
-       p += strlen (p) + 1;
+       p += strlen ((char*)p) + 1;
+       sprintf ((char*)p, "Generic Emulated %dKB PCMCIA SRAM Card", size >> 10);
+       p += strlen ((char*)p) + 1;
        *p++= 0;
        *p++= 0xff;
        *rp = p - rp; 
@@ -1583,7 +1583,7 @@ static int initpcmcia (const TCHAR *path, int readonly, int reset)
                return 0;
        freepcmcia (reset);
        if (!pcmcia_sram)
-               pcmcia_sram = xcalloc (sizeof (struct hd_hardfiledata), 1);
+               pcmcia_sram = xcalloc (struct hd_hardfiledata, 1);
        if (!pcmcia_sram->hfd.handle_valid)
                reset = 1;
        if (reset) {
@@ -1597,14 +1597,14 @@ static int initpcmcia (const TCHAR *path, int readonly, int reset)
        pcmcia_common_size = 0;
        pcmcia_readonly = readonly;
        pcmcia_attrs_size = 256;
-       pcmcia_attrs = xcalloc (pcmcia_attrs_size, 1);
+       pcmcia_attrs = xcalloc (uae_u8, pcmcia_attrs_size);
        if (!pcmcia_sram->hfd.drive_empty) {
                pcmcia_common_size = pcmcia_sram->hfd.virtsize;
                if (pcmcia_sram->hfd.virtsize > 4 * 1024 * 1024) {
                        write_log (L"PCMCIA SRAM: too large device, %d bytes\n", pcmcia_sram->hfd.virtsize);
                        pcmcia_common_size = 4 * 1024 * 1024;
                }
-               pcmcia_common = xcalloc (pcmcia_common_size, 1);
+               pcmcia_common = xcalloc (uae_u8, pcmcia_common_size);
                write_log (L"PCMCIA SRAM: '%s' open, size=%d\n", path, pcmcia_common_size);
                hdf_read (&pcmcia_sram->hfd, pcmcia_common, 0, pcmcia_common_size);
                pcmcia_card = 1;
@@ -1838,7 +1838,7 @@ static void alloc_ide_mem (struct ide_hdf **ide, int max)
 
        for (i = 0; i < max; i++) {
                if (!ide[i])
-                       ide[i] = xcalloc (sizeof (struct ide_hdf), 1);
+                       ide[i] = xcalloc (struct ide_hdf, 1);
        }
 }
 
@@ -1960,7 +1960,7 @@ uae_u8 *save_gayle (int *len)
 
        if (currprefs.cs_ide <= 0)
                return NULL;
-       dstbak = dst = malloc (1000);
+       dstbak = dst = xmalloc (uae_u8, 1000);
        save_u8 (currprefs.cs_ide);
        save_u8 (gayle_int);
        save_u8 (gayle_irq);
@@ -1983,7 +1983,7 @@ uae_u8 *save_ide (int num, int *len)
        ide = idedrive[num];
        if (ide->hdhfd.size == 0)
                return NULL;
-       dstbak = dst = malloc (1000);
+       dstbak = dst = xmalloc (uae_u8, 1000);
        save_u32 (num);
        save_u64 (ide->hdhfd.size);
        save_string (ide->hdhfd.path);
similarity index 100%
rename from genblitter.c
rename to genblitter.cpp
similarity index 99%
rename from gencpu.c
rename to gencpu.cpp
index 9a3af8803ccaebe41d33c18704dc6958af7f9c64..9e327636075aa4343f15cd7eedbcf796683b0298 100644 (file)
--- a/gencpu.c
@@ -353,6 +353,8 @@ static void irc2ir (void)
        if (!using_prefetch)
                return;
        printf ("\tregs.ir = regs.irc;\n");
+       if (using_ce)
+               printf ("\tipl_fetch ();\n");
 }
 
 static int did_prefetch;
@@ -3756,10 +3758,10 @@ int main (int argc, char **argv)
        read_table68k ();
        do_merges ();
 
-       opcode_map = (int *) xmalloc (sizeof (int) * nr_cpuop_funcs);
-       opcode_last_postfix = (int *) xmalloc (sizeof (int) * nr_cpuop_funcs);
-       opcode_next_clev = (int *) xmalloc (sizeof (int) * nr_cpuop_funcs);
-       counts = (unsigned long *) xmalloc (65536 * sizeof (unsigned long));
+       opcode_map =  xmalloc (int, nr_cpuop_funcs);
+       opcode_last_postfix = xmalloc (int, nr_cpuop_funcs);
+       opcode_next_clev = xmalloc (int, nr_cpuop_funcs);
+       counts = xmalloc (unsigned long, 65536);
        read_counts ();
 
        /* It would be a lot nicer to put all in one file (we'd also get rid of
@@ -3768,7 +3770,7 @@ int main (int argc, char **argv)
 
        headerfile = fopen ("cputbl.h", "wb");
 
-       stblfile = fopen ("cpustbl.c", "wb");
+       stblfile = fopen ("cpustbl.cpp", "wb");
        generate_includes (stblfile);
 
        using_prefetch = 0;
@@ -3786,7 +3788,7 @@ int main (int argc, char **argv)
                        if (generate_stbl)
                                fprintf (stblfile, "#ifdef CPUEMU_%d\n", postfix);
                        postfix2 = postfix;
-                       sprintf (fname, "cpuemu_%d.c", postfix);
+                       sprintf (fname, "cpuemu_%d.cpp", postfix);
                        freopen (fname, "wb", stdout);
                        generate_includes (stdout);
                }
similarity index 100%
rename from gencpu_mini.c
rename to gencpu_mini.cpp
similarity index 100%
rename from gengenblitter.c
rename to gengenblitter.cpp
similarity index 98%
rename from genlinetoscr.c
rename to genlinetoscr.cpp
index a12ccfdda0328754159e4dd5e68d5ea42a7dea89..7c54dd82699c8ad520cbd803192010f3634a6b55 100644 (file)
 /* Output for big-endian target if true, little-endian is false. */
 int do_bigendian;
 
-typedef enum
-{
-       DEPTH_8BPP,
-       DEPTH_16BPP,
-       DEPTH_32BPP,
-} DEPTH_T;
+typedef int DEPTH_T;
+
+#define DEPTH_8BPP 0
+#define DEPTH_16BPP 1
+#define DEPTH_32BPP 2
 #define DEPTH_MAX DEPTH_32BPP
 
 static const char *get_depth_str (DEPTH_T bpp)
@@ -41,17 +40,15 @@ static const char *get_depth_type_str (DEPTH_T bpp)
                return "uae_u32";
 }
 
+typedef int HMODE_T;
 
-typedef enum
-{
-       HMODE_NORMAL,
-       HMODE_DOUBLE,
-       HMODE_DOUBLE2X,
-       HMODE_HALVE1,
-       HMODE_HALVE1F,
-       HMODE_HALVE2,
-       HMODE_HALVE2F
-} HMODE_T;
+#define HMODE_NORMAL 0
+#define HMODE_DOUBLE 1
+#define HMODE_DOUBLE2X 2
+#define HMODE_HALVE1 3
+#define HMODE_HALVE1F 4
+#define HMODE_HALVE2 5
+#define HMODE_HALVE2F 6
 #define HMODE_MAX HMODE_HALVE2F
 
 static const char *get_hmode_str (HMODE_T hmode)
similarity index 100%
rename from genp2c.c
rename to genp2c.cpp
similarity index 100%
rename from gfxlib.c
rename to gfxlib.cpp
similarity index 100%
rename from gfxutil.c
rename to gfxutil.cpp
similarity index 100%
rename from gtkui.c
rename to gtkui.cpp
similarity index 97%
rename from hardfile.c
rename to hardfile.cpp
index 37092e317939d7a911267ea6a0093d86c57311d7..146d16eb118b56539c92754f983d5cf94516f871 100644 (file)
@@ -215,7 +215,7 @@ static void create_virtual_rdb (struct hardfiledata *hfd, uae_u32 dostype, int b
        int cyls = 262144 / (cyl * 512);
        int size = cyl * cyls * 512;
 
-       rdb = (uae_u8*)xcalloc (size, 1);
+       rdb = xcalloc (uae_u8, size);
        hfd->virtual_rdb = rdb;
        hfd->virtual_size = size;
        part = rdb + 512;
@@ -259,9 +259,9 @@ static void create_virtual_rdb (struct hardfiledata *hfd, uae_u32 dostype, int b
        pl(rdb, 37, 0); // autopark
        pl(rdb, 38, 2); // highrdskblock
        pl(rdb, 39, -1); // res
-       ua_copy (rdb + 40 * 4, -1, hfd->vendor_id);
-       ua_copy (rdb + 42 * 4, -1, hfd->product_id);
-       ua_copy (rdb + 46 * 4, -1, L"UAE");
+       ua_copy ((char*)rdb + 40 * 4, -1, hfd->vendor_id);
+       ua_copy ((char*)rdb + 42 * 4, -1, hfd->product_id);
+       ua_copy ((char*)rdb + 46 * 4, -1, L"UAE");
        rdb_crc (rdb);
 
        pl(part, 0, 0x50415254);
@@ -274,7 +274,7 @@ static void create_virtual_rdb (struct hardfiledata *hfd, uae_u32 dostype, int b
        pl(part, 7, -1);
        pl(part, 8, 0); // devflags
        part[9 * 4] = _tcslen (hfd->device_name);
-       ua_copy (part + 9 * 4 + 1, -1, hfd->device_name);
+       ua_copy ((char*)part + 9 * 4 + 1, -1, hfd->device_name);
 
        denv = part + 128;
        pl(denv, 0, 80);
@@ -405,10 +405,10 @@ static int hdf_open2 (struct hardfiledata *hfd, const TCHAR *pname)
                hfd->vhd_bamoffset = gl (tmp + 8 + 8 + 4);
                hfd->vhd_bamsize = (((hfd->virtsize + hfd->vhd_blocksize - 1) / hfd->vhd_blocksize) * 4 + 511) & ~511;
                size = hfd->vhd_bamoffset + hfd->vhd_bamsize;
-               hfd->vhd_header = xmalloc (size);
+               hfd->vhd_header = xmalloc (uae_u8, size);
                if (hdf_read_target (hfd, hfd->vhd_header, 0, size) != size)
                        goto end;
-               hfd->vhd_sectormap = xmalloc (512);
+               hfd->vhd_sectormap = xmalloc (uae_u8, 512);
                hfd->vhd_sectormapblock = -1;
                hfd->vhd_bitmapsize = ((hfd->vhd_blocksize / (8 * 512)) + 511) & ~511;
        }
@@ -460,11 +460,12 @@ int hdf_dup (struct hardfiledata *dhfd, const struct hardfiledata *shfd)
 
 extern int get_guid_target (uae_u8 *out);
 
-static uae_u64 vhd_read (struct hardfiledata *hfd, uae_u8 *dataptr, uae_u64 offset, uae_u64 len)
+static uae_u64 vhd_read (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_u64 len)
 {
        uae_u32 bamoffset;
        uae_u32 sectoroffset;
        uae_u64 read;
+       uae_u8 *dataptr = (uae_u8*)v;
 
        //write_log (L"%08x %08x\n", (uae_u32)offset, (uae_u32)len);
        read = 0;
@@ -524,7 +525,7 @@ static int vhd_write_enlarge (struct hardfiledata *hfd, uae_u32 bamoffset)
        int v;
 
        len = hfd->vhd_blocksize + hfd->vhd_bitmapsize + 512;
-       buf = xcalloc (len, 1);
+       buf = xcalloc (uae_u8, len);
        if (!hdf_resize_target (hfd, hfd->physsize + len - 512)) {
                write_log (L"vhd_enlarge: failure\n");
                return 0;
@@ -553,11 +554,12 @@ static int vhd_write_enlarge (struct hardfiledata *hfd, uae_u32 bamoffset)
        return 1;
 }
 
-static uae_u64 vhd_write (struct hardfiledata *hfd, uae_u8 *dataptr, uae_u64 offset, uae_u64 len)
+static uae_u64 vhd_write (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_u64 len)
 {
        uae_u32 bamoffset;
        uae_u32 sectoroffset;
        uae_u64 written;
+       uae_u8 *dataptr = (uae_u8*)v;
 
        //write_log (L"%08x %08x\n", (uae_u32)offset, (uae_u32)len);
        written = 0;
@@ -636,14 +638,14 @@ int vhd_create (const TCHAR *name, uae_u64 size, uae_u32 dostype)
        zf = zfile_fopen (name, L"wb", 0);
        if (!zf)
                goto end;
-       b = xcalloc (512 + 1024 + batsize + 512, 1);
+       b = xcalloc (uae_u8, 512 + 1024 + batsize + 512);
        if (zfile_fwrite (b, 512 + 1024 + batsize + 512, 1, zf) != 1)
                goto end;
 
        memset (&hfd, 0, sizeof hfd);
        hfd.virtsize = hfd.physsize = size;
        hfd.blocksize = 512;
-       strcpy (b, "conectix"); // cookie
+       strcpy ((char*)b, "conectix"); // cookie
        b[0x0b] = 2; // features
        b[0x0d] = 1; // version
        b[0x10 + 6] = 2; // data offset
@@ -653,9 +655,9 @@ int vhd_create (const TCHAR *name, uae_u64 size, uae_u32 dostype)
        b[0x19] = tm >> 16;
        b[0x1a] = tm >>  8;
        b[0x1b] = tm >>  0;
-       strcpy (b + 0x1c, "vpc "); // creator application
+       strcpy ((char*)b + 0x1c, "vpc "); // creator application
        b[0x21] = 5; // creator version
-       strcpy (b + 0x24, "Wi2k"); // creator host os
+       strcpy ((char*)b + 0x24, "Wi2k"); // creator host os
        // original and current size
        b[0x28] = b[0x30] = size >> 56;
        b[0x29] = b[0x31] = size >> 48;
@@ -692,7 +694,7 @@ int vhd_create (const TCHAR *name, uae_u64 size, uae_u32 dostype)
        // dynamic disk header
        memset (b, 0, 1024);
        // cookie
-       strcpy (b, "cxsparse");
+       strcpy ((char*)b, "cxsparse");
        // data offset
        for (i = 0; i < 8; i++)
                b[0x08 + i] = 0xff;
@@ -757,9 +759,10 @@ static int hdf_read2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset, in
                return hdf_read_target (hfd, buffer, offset, len);
 }
 
-static void adide_decode (uae_u8 *buffer, int len)
+static void adide_decode (void *v, int len)
 {
        int i;
+       uae_u8 *buffer = (uae_u8*)v;
        for (i = 0; i < len; i += 2) {
                uae_u8 *b =  buffer + i;
                uae_u16 w = (b[0] << 8) | (b[1] << 0);
@@ -809,9 +812,10 @@ static void adide_decode (uae_u8 *buffer, int len)
                b[1] = o >> 0;
        }
 }
-static void adide_encode (uae_u8 *buffer, int len)
+static void adide_encode (void *v, int len)
 {
        int i;
+       uae_u8 *buffer = (uae_u8*)v;
        for (i = 0; i < len; i += 2) {
                uae_u8 *b =  buffer + i;
                uae_u16 w = (b[0] << 8) | (b[1] << 0);
@@ -862,9 +866,11 @@ static void adide_encode (uae_u8 *buffer, int len)
        }
 }
 
-static void hdf_byteswap (uae_u8 *b, int len)
+static void hdf_byteswap (void *v, int len)
 {
        int i;
+       uae_u8 *b = (uae_u8*)v;
+
        for (i = 0; i < len; i += 2) {
                uae_u8 tmp = b[i];
                b[i] = b[i + 1];
@@ -1285,7 +1291,7 @@ static int handle_scsi (uaecptr request, struct hardfiledata *hfd)
 {
        uae_u32 acmd = get_long (request + 40);
        uaecptr scsi_data = get_long (acmd + 0);
-       uae_u32 scsi_len = get_long (acmd + 4);
+       int scsi_len = get_long (acmd + 4);
        uaecptr scsi_cmd = get_long (acmd + 12);
        uae_u16 scsi_cmd_len = get_word (acmd + 16);
        uae_u8 scsi_flags = get_byte (acmd + 20);
similarity index 100%
rename from hrtmon.rom.c
rename to hrtmon.rom.cpp
similarity index 100%
rename from identify.c
rename to identify.cpp
index c5eda1c407b96ace780a8f2e9413024e64dd6c54..79cda4f32dd9c7c5994949d3f0074cf41412521e 100644 (file)
@@ -52,9 +52,9 @@ struct device_scsi_info {
 struct amigascsi
 {
     uae_u8 *data;
-    uae_u32 len;
+    uae_s32 len;
     uae_u8 cmd[16];
-    uae_u32 cmd_len;
+    uae_s32 cmd_len;
     uae_u8 flags;
     uae_u8 sensedata[256];
     uae_u16 sense_len;
index 6a223fe5aead5376ded724f9a28bc393ee216d98..1393b48005c68ef86cb3b7a33640fa19edf44273 100644 (file)
@@ -86,8 +86,7 @@ struct socketbase {
     uae_u32 timeout;
     uae_u32 sigmp;
 #endif
-} *socketbases;
-
+};
 
 #define LIBRARY_SIZEOF 36
 
index cd402ee1e1e1366168955828ab817e2b57f73102..9c7f8b56bb00e29f09f8c15d5f4eb599c9696ae0 100644 (file)
@@ -269,6 +269,11 @@ STATIC_INLINE uae_u32 next_ilong_020ce (void)
 
 #ifdef CPUEMU_12
 
+STATIC_INLINE void ipl_fetch (void)
+{
+       regs.ipl = regs.ipl_pin;
+}
+
 STATIC_INLINE uae_u32 mem_access_delay_word_read (uaecptr addr)
 {
        switch (ce_banktype[addr >> 16])
index d4f7fdde986bd67e34f5b30db1ab84cda64e4e36..19860cc75721e0634268662a77896778cdfec09e 100644 (file)
@@ -67,9 +67,9 @@ extern void memwatch_dump2 (TCHAR *buf, int bufsize, int num);
 void debug_lgetpeek (uaecptr addr, uae_u32 v);
 void debug_wgetpeek (uaecptr addr, uae_u32 v);
 void debug_bgetpeek (uaecptr addr, uae_u32 v);
-void debug_bputpeek(uaecptr addr, uae_u32 v);
-void debug_wputpeek(uaecptr addr, uae_u32 v);
-void debug_lputpeek(uaecptr addr, uae_u32 v);
+void debug_bputpeek (uaecptr addr, uae_u32 v);
+void debug_wputpeek (uaecptr addr, uae_u32 v);
+void debug_lputpeek (uaecptr addr, uae_u32 v);
 
 enum debugtest_item { DEBUGTEST_BLITTER, DEBUGTEST_KEYBOARD, DEBUGTEST_FLOPPY, DEBUGTEST_MAX };
 void debugtest (enum debugtest_item, const TCHAR *, ...);
index cb5b3d9779d2b52dfd575b5fd1ed6d0d59053cca..c561594f781f66191b345d1c950699ee6d91474d 100644 (file)
@@ -20,7 +20,7 @@ extern int disk_empty (int num);
 extern void disk_insert (int num, const TCHAR *name);
 extern void disk_insert_force (int num, const TCHAR *name);
 extern void DISK_check_change (void);
-extern struct zfile *DISK_validate_filename (const TCHAR *, int, int *, uae_u32 *);
+extern int DISK_validate_filename (const TCHAR *fname, int leave_open, int *wrprot, uae_u32 *crc32, struct zfile **zf);
 extern void DISK_handler (uae_u32);
 extern void DISK_update (int hpos);
 extern void DISK_hsync (int hpos);
index 54f348c7d0504d2c5378113b6de904b220ea4842..6be25f24ac4703e4a8ab9e52b2b0569f7b52e93c 100644 (file)
 #define CLICK_TRACKS 84
 
 struct drvsample {
-    unsigned int len;
-    unsigned pos;
+    int len;
+    int pos;
     uae_s16 *p;
-    unsigned int indexes[CLICK_TRACKS];
-    unsigned int lengths[CLICK_TRACKS];
+    int indexes[CLICK_TRACKS];
+    int lengths[CLICK_TRACKS];
 };
 
 #define DS_CLICK 0
index 901852fa25e803077b6d0a8c81d288f37761e944..610ab9652a84fa97fe51c16f87a4d4cd71c042be 100644 (file)
@@ -6,6 +6,8 @@
   * Copyright 1997 Bernd Schmidt
   */
 
+struct hardfilehandle;
+
 struct hardfiledata {
     uae_u64 virtsize; // virtual size
     uae_u64 physsize; // physical size (dynamic disk)
@@ -15,7 +17,7 @@ struct hardfiledata {
     int surfaces;
     int reservedblocks;
     int blocksize;
-    void *handle;
+    struct hardfilehandle *handle;
     int handle_valid;
     int readonly;
     int dangerous;
@@ -28,9 +30,9 @@ struct hardfiledata {
     TCHAR product_rev[4 + 1];
     TCHAR device_name[256];
     /* geometry from possible RDSK block */
-    unsigned int cylinders;
-    unsigned int sectors;
-    unsigned int heads;
+    int cylinders;
+    int sectors;
+    int heads;
     uae_u8 *virtual_rdb;
     uae_u64 virtual_size;
     int unitnum;
@@ -57,12 +59,12 @@ struct hd_hardfiledata {
     struct hardfiledata hfd;
     int bootpri;
     uae_u64 size;
-    unsigned int cyls;
-    unsigned int heads;
-    unsigned int secspertrack;
-    unsigned int cyls_def;
-    unsigned int secspertrack_def;
-    unsigned int heads_def;
+    int cyls;
+    int heads;
+    int secspertrack;
+    int cyls_def;
+    int secspertrack_def;
+    int heads_def;
     TCHAR *path;
     int ansi_version;
 };
index f81994be3c7c2b91d10dd05b8690ffc694721f63..197733b30bbdf6bd9034e4753bbf1e76ef1be161 100644 (file)
@@ -123,9 +123,12 @@ extern int fsdb_mode_representable_p (const a_inode *, int);
 extern int fsdb_mode_supported (const a_inode *);
 extern TCHAR *fsdb_create_unique_nname (a_inode *base, const TCHAR *);
 
-extern void *my_opendir (const TCHAR*);
-extern void my_closedir (void*);
-extern int my_readdir (void*, TCHAR*);
+struct my_opendir_s;
+struct my_openfile_s;
+
+extern struct my_opendir_s *my_opendir (const TCHAR*);
+extern void my_closedir (struct my_opendir_s*);
+extern int my_readdir (struct my_opendir_s*, TCHAR*);
 
 extern int my_rmdir (const TCHAR*);
 extern int my_mkdir (const TCHAR*);
@@ -133,11 +136,11 @@ extern int my_unlink (const TCHAR*);
 extern int my_rename (const TCHAR*, const TCHAR*);
 extern int my_setcurrentdir (const TCHAR *curdir, TCHAR *oldcur);
 
-extern void *my_open (const TCHAR*, int);
-extern void my_close (void*);
-extern uae_s64 my_lseek (void*, uae_s64, int);
-extern unsigned int my_read (void*, void*, unsigned int);
-extern unsigned int my_write (void*, void*, unsigned int);
+extern struct my_openfile_s *my_open (const TCHAR*, int);
+extern void my_close (struct my_openfile_s*);
+extern uae_s64 my_lseek (struct my_openfile_s*, uae_s64, int);
+extern unsigned int my_read (struct my_openfile_s*, void*, unsigned int);
+extern unsigned int my_write (struct my_openfile_s*, void*, unsigned int);
 extern int my_truncate (const TCHAR *name, uae_u64 len);
 extern int dos_errno (void);
 extern int my_existsfile (const TCHAR *name);
index 24e3a3c353674992a3a8e6feff082b8d0562b777..01783bf2f2c1567e022a8c9a85859913100ff116 100644 (file)
@@ -25,13 +25,4 @@ struct fs_usage
   unsigned long fsu_ffree;             /* Free file nodes. */
 };
 
-#ifndef __P
-#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
-#define __P(args) args
-#else
-#define __P(args) ()
-#endif  /* GCC.  */
-#endif  /* Not __P.  */
-
-int get_fs_usage __P ((const char *path, const char *disk,
-                      struct fs_usage *fsp));
+int get_fs_usage (const TCHAR *path, const TCHAR *disk, struct fs_usage *fsp);
index 605186d8c55bde0b8ed7dd8cd0e876f0afb6c4e4..f8d2978daee0233e6f39ff1d632bbefe6ca50ba6 100644 (file)
@@ -22,26 +22,30 @@ typedef unsigned long uint32;
 typedef int bool;
 #endif
 
-extern void S2X_configure (int rb, int gb, int bb, int rs, int gs, int bs);
-extern int Init_2xSaI (int rb, int gb, int bb, int rs, int gs, int bs);
-extern void Super2xSaI_16 (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void Super2xSaI_32 (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void SuperEagle_16 (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void SuperEagle_32 (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void _2xSaI_16 (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void _2xSaI_32 (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void AdMame2x (u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */
-             u8 *dstPtr, u32 dstPitch, int width, int height);
-extern void AdMame2x32 (u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */
-             u8 *dstPtr, u32 dstPitch, int width, int height);
+extern "C"
+{
+       extern void S2X_configure (int rb, int gb, int bb, int rs, int gs, int bs);
+       extern int Init_2xSaI (int rb, int gb, int bb, int rs, int gs, int bs);
+       extern void Super2xSaI_16 (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
+       extern void Super2xSaI_32 (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
+       extern void SuperEagle_16 (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
+       extern void SuperEagle_32 (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
+       extern void _2xSaI_16 (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
+       extern void _2xSaI_32 (const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
+       extern void AdMame2x (u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */
+                     u8 *dstPtr, u32 dstPitch, int width, int height);
+       extern void AdMame2x32 (u8 *srcPtr, u32 srcPitch, /* u8 deltaPtr, */
+                     u8 *dstPtr, u32 dstPitch, int width, int height);
+
+       extern void hq_init (int rb, int gb, int bb, int rs, int gs, int bs);
 
-extern void hq_init (int rb, int gb, int bb, int rs, int gs, int bs);
-extern void _cdecl hq2x_16 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
-extern void _cdecl hq2x_32 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
-extern void _cdecl hq3x_16 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
-extern void _cdecl hq3x_32 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
-extern void _cdecl hq4x_16 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
-extern void _cdecl hq4x_32 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
+       extern void _cdecl hq2x_16 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
+       extern void _cdecl hq2x_32 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
+       extern void _cdecl hq3x_16 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
+       extern void _cdecl hq3x_32 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
+       extern void _cdecl hq4x_16 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
+       extern void _cdecl hq4x_32 (unsigned char*, unsigned char*, DWORD, DWORD, DWORD);
+}
 
 #define UAE_FILTER_NULL 1
 #define UAE_FILTER_SCALE2X 2
index 3ef610370a74bcfe8deda637b865d3389443bc3e..0a4f02ae200d885bd57dd7b832fcd57070648ed2 100644 (file)
@@ -14,8 +14,8 @@ extern int special_mem;
 #define S_READ 1
 #define S_WRITE 2
 
-extern void *cache_alloc (int);
-extern void cache_free (void*);
+extern uae_u8 *cache_alloc (int);
+extern void cache_free (uae_u8*);
 #endif
 
 int init_shm (void);
@@ -345,7 +345,7 @@ extern void mapkick (void);
 extern void a3000_fakekick (int);
 
 extern uaecptr strcpyha_safe (uaecptr dst, const uae_char *src);
-extern uae_char *strcpyah_safe (uae_u8 *dst, uaecptr src, int maxsize);
+extern uae_char *strcpyah_safe (uae_char *dst, uaecptr src, int maxsize);
 extern void memcpyha_safe (uaecptr dst, const uae_u8 *src, int size);
 extern void memcpyha (uaecptr dst, const uae_u8 *src, int size);
 extern void memcpyah_safe (uae_u8 *dst, uaecptr src, int size);
index 02e8ad1446d2bad09819f0d180df046134d35eec..5dd3830a4d17fcbd37af055bef04c37905cd6234 100644 (file)
@@ -1,4 +1,3 @@
-extern int prowizard_search (unsigned char *in_data, int in_size);
+
+extern "C" int prowizard_search (unsigned char *in_data, int in_size);
 extern void moduleripper (void);
-extern FILE *moduleripper_fopen(const char *, const char *);
-extern FILE *moduleripper2_fopen(const char *, const char *, const char *, int, int);
index dded7b47fca446dfcdece264d1a86cf30dbefb49..563a190c9e5016f5ab3b24e8a9bbad551952029d 100644 (file)
@@ -47,8 +47,6 @@ extern int fpp_movem_index2[256];
 extern int fpp_movem_next[256];
 #endif
 
-struct regstruct;
-
 typedef unsigned long REGPARAM3 cpuop_func (uae_u32) REGPARAM;
 typedef void REGPARAM3 cpuop_func_ce (uae_u32) REGPARAM;
 
@@ -112,8 +110,7 @@ struct cache040
        int count;
 };
 
-struct flag_struct regflags;
-extern struct regstruct
+struct regstruct
 {
        uae_u32 regs[16];
 
@@ -168,7 +165,9 @@ extern struct regstruct
        int ce020memcycles;
        evt lastfetch;
 
-} regs, lastint_regs, mmu_backup_regs;
+};
+
+extern struct regstruct regs;
 
 STATIC_INLINE uae_u32 munge24 (uae_u32 x)
 {
index 2f4f2a89983d060cad571fcec0020228e1e2b6e3..4c08b3afe1b90505555983af81e069f90e6ebb28 100644 (file)
@@ -458,92 +458,3 @@ extern struct uae_prefs currprefs, changed_prefs;
 
 extern int machdep_init (void);
 extern void machdep_free (void);
-
-/* AIX doesn't think it is Unix. Neither do I. */
-#if defined(_ALL_SOURCE) || defined(_AIX)
-#undef __unix
-#define __unix
-#endif
-
-#define MAX_COLOR_MODES 5
-
-/* #define NEED_TO_DEBUG_BADLY */
-
-#if !defined(USER_PROGRAMS_BEHAVE)
-#define USER_PROGRAMS_BEHAVE 0
-#endif
-
-/* Some memsets which know that they can safely overwrite some more memory
- * at both ends and use that knowledge to align the pointers. */
-
-#define QUADRUPLIFY(c) (((c) | ((c) << 8)) | (((c) | ((c) << 8)) << 16))
-
-/* When you call this routine, bear in mind that it rounds the bounds and
- * may need some padding for the array. */
-
-#define fuzzy_memset(p, c, o, l) fuzzy_memset_1 ((p), QUADRUPLIFY (c), (o) & ~3, ((l) + 4) >> 2)
-STATIC_INLINE void fuzzy_memset_1 (void *p, uae_u32 c, int offset, int len)
-{
-    uae_u32 *p2 = (uae_u32 *)((TCHAR *)p + offset);
-    int a = len & 7;
-    len >>= 3;
-    switch (a) {
-     case 7: p2--; goto l1;
-     case 6: p2-=2; goto l2;
-     case 5: p2-=3; goto l3;
-     case 4: p2-=4; goto l4;
-     case 3: p2-=5; goto l5;
-     case 2: p2-=6; goto l6;
-     case 1: p2-=7; goto l7;
-     case 0: if (!--len) return; break;
-    }
-
-    for (;;) {
-       p2[0] = c;
-       l1:
-       p2[1] = c;
-       l2:
-       p2[2] = c;
-       l3:
-       p2[3] = c;
-       l4:
-       p2[4] = c;
-       l5:
-       p2[5] = c;
-       l6:
-       p2[6] = c;
-       l7:
-       p2[7] = c;
-
-       if (!len)
-           break;
-       len--;
-       p2 += 8;
-    }
-}
-
-/* This one knows it will never be asked to clear more than 32 bytes.  Make sure you call this with a
-   constant for the length.  */
-#define fuzzy_memset_le32(p, c, o, l) fuzzy_memset_le32_1 ((p), QUADRUPLIFY (c), (o) & ~3, ((l) + 7) >> 2)
-STATIC_INLINE void fuzzy_memset_le32_1 (void *p, uae_u32 c, int offset, int len)
-{
-    uae_u32 *p2 = (uae_u32 *)((TCHAR *)p + offset);
-
-    switch (len) {
-     case 9: p2[0] = c; p2[1] = c; p2[2] = c; p2[3] = c; p2[4] = c; p2[5] = c; p2[6] = c; p2[7] = c; p2[8] = c; break;
-     case 8: p2[0] = c; p2[1] = c; p2[2] = c; p2[3] = c; p2[4] = c; p2[5] = c; p2[6] = c; p2[7] = c; break;
-     case 7: p2[0] = c; p2[1] = c; p2[2] = c; p2[3] = c; p2[4] = c; p2[5] = c; p2[6] = c; break;
-     case 6: p2[0] = c; p2[1] = c; p2[2] = c; p2[3] = c; p2[4] = c; p2[5] = c; break;
-     case 5: p2[0] = c; p2[1] = c; p2[2] = c; p2[3] = c; p2[4] = c; break;
-     case 4: p2[0] = c; p2[1] = c; p2[2] = c; p2[3] = c; break;
-     case 3: p2[0] = c; p2[1] = c; p2[2] = c; break;
-     case 2: p2[0] = c; p2[1] = c; break;
-     case 1: p2[0] = c; break;
-     case 0: break;
-     default: printf("Hit the programmer.\n"); break;
-    }
-}
-
-#if defined(AMIGA) && defined(__GNUC__)
-#include "od-amiga/amiga-kludges.h"
-#endif
index 47b50782570037126fb0d664d96ad09fec427378..570f34e8186912b17bd1b1881607ea51563550c5 100644 (file)
@@ -33,11 +33,13 @@ ENUMDECL {
     i_LPSTOP
 } ENUMNAME (instrmnem);
 
-extern struct mnemolookup {
+struct mnemolookup {
     instrmnem mnemo;
     const TCHAR *name;
     const TCHAR *friendlyname;
-} lookuptab[];
+};
+
+extern struct mnemolookup lookuptab[];
 
 ENUMDECL {
     sz_byte, sz_word, sz_long
index 23083e9ab5ae8673aa73fb840de5afb02c8abf73..4382cb72e63dea46653203ac83c6a41ba4188ca6 100644 (file)
 #include <limits.h>
 #include <tchar.h>
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
 #ifndef __STDC__
 #ifndef _MSC_VER
 #error "Your compiler is not ANSI. Get a real one."
@@ -183,7 +178,7 @@ extern void* q_memcpy(void*,const void*,size_t);
 /* If char has more then 8 bits, good night. */
 typedef unsigned char uae_u8;
 typedef signed char uae_s8;
-typedef unsigned char uae_char;
+typedef char uae_char;
 
 typedef struct { uae_u8 RGB[3]; } RGB;
 
@@ -249,10 +244,6 @@ extern char *uutf8 (const TCHAR *s);
 extern TCHAR *utf8u (const char *s);
 extern void unicode_init (void);
 
-extern void *xmalloc (size_t);
-extern void *xcalloc (size_t, size_t);
-extern void xfree (const void*);
-
 /* We can only rely on GNU C getting enums right. Mickeysoft VSC++ is known
  * to have problems, and it's likely that other compilers choke too. */
 #ifdef __GNUC__
@@ -489,8 +480,8 @@ extern void gui_message (const TCHAR *,...);
 extern int gui_message_multibutton (int flags, const TCHAR *format,...);
 #define write_log_err write_log
 extern void logging_init (void);
-extern void *log_open (const TCHAR *name, int append, int bootlog);
-extern void log_close (void *f);
+extern FILE *log_open (const TCHAR *name, int append, int bootlog);
+extern void log_close (FILE *f);
 
 
 #ifndef O_BINARY
@@ -560,6 +551,24 @@ extern void log_close (void *f);
 
 #endif
 
-#ifdef __cplusplus
-}
+#ifndef __cplusplus
+
+#define xmalloc(T, N) malloc(sizeof (T) * (N))
+#define xcalloc(T, N) calloc(sizeof (T), N)
+#define xfree(T) free(T)
+#define xrealloc(T, TP, N) realloc(TP, sizeof (T) * (N))
+
+#if 0
+extern void *xmalloc (size_t);
+extern void *xcalloc (size_t, size_t);
+extern void xfree (const void*);
 #endif
+
+#else
+
+#define xmalloc(T, N) static_cast<T*>(malloc (sizeof (T) * (N)))
+#define xcalloc(T, N) static_cast<T*>(calloc (sizeof (T), N))
+#define xrealloc(T, TP, N) static_cast<T*>(realloc (TP, sizeof (T) * (N)))
+#define xfree(T) free(T)
+
+#endif
\ No newline at end of file
index 19025bf0be67a3e7215e28cc86131f168c0b8b81..3fee419f44b2814328829c555bdb62130bd23ccb 100644 (file)
@@ -28,6 +28,7 @@ extern void desktop_coords (int *dw, int *dh, int *x, int *y, int *w, int *h);
 extern int vsync_switchmode (int, int);
 extern void doflashscreen (void);
 extern int flashscreen;
+extern void updatedisplayarea (void);
 
 extern void flush_line (int);
 extern void flush_block (int, int);
index 5219ed725fcacb78b5995c2c9c60fe7c189d85e7..8005dab19222f138a6ebc662e396b297a7d11b7b 100644 (file)
@@ -73,7 +73,7 @@ struct zvolume
 
 struct zarchive_info
 {
-    const TCHAR *name;
+    TCHAR *name;
     uae_s64 size;
     int flags;
     TCHAR *comment;
index 7dda3d786e2d8555a1ae7f35984e8127a8bca064..5ccb9a89354b55df294b5abc2cdcfc8d82c16b1f 100644 (file)
@@ -8,6 +8,24 @@
 
 struct zfile;
 struct zvolume;
+struct zdirectory;
+
+struct fs_dirhandle
+{
+       int isarch;
+       union {
+               struct zdirectory *zd;
+               struct my_opendir_s *od;
+       };
+};
+struct fs_filehandle
+{
+       int isarch;
+       union {
+               struct zfile *zf;
+               struct my_openfile_s *of;
+       };
+};
 
 typedef int (*zfile_callback)(struct zfile*, void*);
 
@@ -84,13 +102,13 @@ extern struct zvolume *zfile_fopen_archive_root (const TCHAR *filename);
 extern void zfile_fclose_archive (struct zvolume *zv);
 extern int zfile_fs_usage_archive (const TCHAR *path, const TCHAR *disk, struct fs_usage *fsp);
 extern int zfile_stat_archive (const TCHAR *path, struct _stat64 *statbuf);
-extern void *zfile_opendir_archive (const TCHAR *path);
-extern void zfile_closedir_archive (void*);
-extern int zfile_readdir_archive (void*, TCHAR*);
-extern void zfile_resetdir_archive (void*);
+extern struct zdirectory *zfile_opendir_archive (const TCHAR *path);
+extern void zfile_closedir_archive (struct zdirectory *);
+extern int zfile_readdir_archive (struct zdirectory *, TCHAR*);
+extern void zfile_resetdir_archive (struct zdirectory *);
 extern int zfile_fill_file_attrs_archive (const TCHAR *path, int *isdir, int *flags, TCHAR **comment);
-extern uae_s64 zfile_lseek_archive (void *d, uae_s64 offset, int whence);
-extern unsigned int zfile_read_archive (void *d, void *b, unsigned int size);
-extern void zfile_close_archive (void *d);
-extern void *zfile_open_archive (const TCHAR *path, int flags);
-extern int zfile_exists_archive(const TCHAR *path, const TCHAR *rel);
+extern uae_s64 zfile_lseek_archive (struct zfile *d, uae_s64 offset, int whence);
+extern unsigned int zfile_read_archive (struct zfile *d, void *b, unsigned int size);
+extern void zfile_close_archive (struct zfile *d);
+extern struct zfile *zfile_open_archive (const TCHAR *path, int flags);
+extern int zfile_exists_archive (const TCHAR *path, const TCHAR *rel);
similarity index 100%
rename from inprec.c
rename to inprec.cpp
similarity index 99%
rename from inputdevice.c
rename to inputdevice.cpp
index faa2e0ee89c68780e2153345508fe1c0d26968c8..2978a246afce7644d704bb1e952a8f8d7bdce743 100644 (file)
@@ -160,7 +160,7 @@ int inprec_open (TCHAR *fname, int record)
                zfile_fseek (inprec_zf, 0, SEEK_END);
                inprec_size = zfile_ftell (inprec_zf);
                zfile_fseek (inprec_zf, 0, SEEK_SET);
-               inprec_buffer = inprec_p = xmalloc (inprec_size);
+               inprec_buffer = inprec_p = xmalloc (uae_u8, inprec_size);
                zfile_fread (inprec_buffer, inprec_size, 1, inprec_zf);
                inprec_plastptr = inprec_buffer;
                id = inprec_pu32();
@@ -179,7 +179,7 @@ int inprec_open (TCHAR *fname, int record)
                if (record < -1)
                        inprec_div = maxvpos;
        } else if (record > 0) {
-               inprec_buffer = inprec_p = xmalloc (inprec_size);
+               inprec_buffer = inprec_p = xmalloc (uae_u8, inprec_size);
                inprec_ru32 ('UAE\0');
                inprec_ru8 (1);
                inprec_ru8 (UAEMAJOR);
@@ -642,9 +642,9 @@ void write_inputdevice_config (struct uae_prefs *p, struct zfile *f)
        }
 }
 
-static int getnum (const TCHAR **pp)
+static int getnum (TCHAR **pp)
 {
-       const TCHAR *p = *pp;
+       TCHAR *p = *pp;
        int v = _tstol (p);
 
        while (*p != 0 && *p !='.' && *p != ',')
@@ -654,11 +654,11 @@ static int getnum (const TCHAR **pp)
        *pp = p;
        return v;
 }
-static TCHAR *getstring (const TCHAR **pp)
+static TCHAR *getstring (TCHAR **pp)
 {
        int i;
        static TCHAR str[1000];
-       const TCHAR *p = *pp;
+       TCHAR *p = *pp;
 
        if (*p == 0)
                return 0;
@@ -3264,7 +3264,7 @@ static void matchdevices (struct inputdevice_functions *inf, struct uae_input_de
                if (match >= 0) {
                        j = match;
                        if (j != i) {
-                               struct uae_input_device *tmp = xmalloc (sizeof (struct uae_input_device));
+                               struct uae_input_device *tmp = xmalloc (struct uae_input_device, 1);
                                memcpy (tmp, &uid[j], sizeof (struct uae_input_device));
                                memcpy (&uid[j], &uid[i], sizeof (struct uae_input_device));
                                memcpy (&uid[i], tmp, sizeof (struct uae_input_device));
similarity index 100%
rename from jit/codegen_x86.c
rename to jit/codegen_x86.cpp
similarity index 100%
rename from jit/compemu_fpp.c
rename to jit/compemu_fpp.cpp
similarity index 99%
rename from jit/compemu_raw_x86.c
rename to jit/compemu_raw_x86.cpp
index e4b52fc16310de7f3b66332d4981c8bc29289d69..485b2b4f90c472463620ce9f7e78dca40aa0ada7 100644 (file)
 #define STACK_ALIGN            16
 #define STACK_OFFSET   sizeof(void *)
 
-uae_s8 always_used[]={4,-1};
+uae_u8 always_used[]={4,0xff};
 #if defined(__x86_64__)
 uae_s8 can_byte[]={0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,-1};
 uae_s8 can_word[]={0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,-1};
 #else
-uae_s8 can_byte[]={0,1,2,3,-1};
-uae_s8 can_word[]={0,1,2,3,5,6,7,-1};
+uae_u8 can_byte[]={0,1,2,3,0xff};
+uae_u8 can_word[]={0,1,2,3,5,6,7,0xff};
 #endif
 
 uae_u8 call_saved[]={0,0,0,0,1,0,0,0};
@@ -1925,7 +1925,7 @@ int EvalException (LPEXCEPTION_POINTERS blah, int n_except)
                emit_byte(0xe9);
                emit_long(ctxPC+len-(uae_u32)target-4);
                in_handler=1;
-               target=tmp;
+               target=(uae_u8*)tmp;
            }
            bi=active;
            while (bi) {
@@ -2324,7 +2324,7 @@ x86_get_cpu_vendor(struct cpuinfo_x86 *c)
 static void cpuid(uae_u32 op, uae_u32 *eax, uae_u32 *ebx, uae_u32 *ecx, uae_u32 *edx)
 {
   const int CPUID_SPACE = 4096;
-  uae_u8* cpuid_space = cache_alloc(CPUID_SPACE);
+  uae_u8* cpuid_space = (uae_u8*)cache_alloc(CPUID_SPACE);
   static uae_u32 s_op, s_eax, s_ebx, s_ecx, s_edx;
   uae_u8* tmp=get_target();
 
similarity index 99%
rename from jit/compemu_support.c
rename to jit/compemu_support.cpp
index 60c4788fcc9a1f660cb3dd84a053deba938e5009..ffaf507938957b4b8a744d07f68507a39480dcad 100644 (file)
@@ -192,7 +192,7 @@ STATIC_INLINE void remove_from_cl_list(blockinfo* bi)
     if (cache_tags[cl+1].bi)
        cache_tags[cl].handler=cache_tags[cl+1].bi->handler_to_use;
     else
-       cache_tags[cl].handler=popall_execute_normal;
+       cache_tags[cl].handler=(cpuop_func*)popall_execute_normal;
 }
 
 STATIC_INLINE void remove_from_list(blockinfo* bi)
@@ -292,7 +292,7 @@ STATIC_INLINE void set_dhtu(blockinfo* bi, void* dh)
            }
            x=x->next;
        }
-       bi->direct_handler_to_use=dh;
+       bi->direct_handler_to_use=(cpuop_func*)dh;
     }
 }
 
@@ -303,7 +303,7 @@ STATIC_INLINE void invalidate_block(blockinfo* bi)
     bi->optlevel=0;
     bi->count=currprefs.optcount[0]-1;
     bi->handler=NULL;
-    bi->handler_to_use=popall_execute_normal;
+    bi->handler_to_use=(cpuop_func*)popall_execute_normal;
     bi->direct_handler=NULL;
     set_dhtu(bi,bi->direct_pen);
     bi->needed_flags=0xff;
@@ -379,7 +379,7 @@ STATIC_INLINE blockinfo* get_blockinfo_addr_new(void* addr, int setstate)
 
                bi=hold_bi[i];
                hold_bi[i]=NULL;
-               bi->pc_p=addr;
+               bi->pc_p=(uae_u8*)addr;
                invalidate_block(bi);
                add_to_active(bi);
                add_to_cl_list(bi);
@@ -541,7 +541,7 @@ int check_prefs_changed_comp (void)
  ********************************************************************/
 
 //#include "compemu_optimizer.c"
-#include "compemu_optimizer_x86.c"
+#include "compemu_optimizer_x86.cpp"
 
 /********************************************************************
  * Functions to emit data into memory, and other general support    *
@@ -599,7 +599,7 @@ STATIC_INLINE uae_u8* get_target(void)
  * Getting the information about the target CPU                     *
  ********************************************************************/
 
-#include "compemu_raw_x86.c"
+#include "compemu_raw_x86.cpp"
 
 
 /********************************************************************
@@ -5652,13 +5652,13 @@ static void prepare_block(blockinfo* bi)
 
     set_target(current_compile_p);
     align_target(32);
-    bi->direct_pen=(void*)get_target();
+    bi->direct_pen=(cpuop_func*)get_target();
     raw_mov_l_rm(0,(uae_u32)&(bi->pc_p));
     raw_mov_l_mr((uae_u32)&regs.pc_p,0);
     raw_jmp((uae_u32)popall_execute_normal);
 
     align_target(32);
-    bi->direct_pcc=(void*)get_target();
+    bi->direct_pcc=(cpuop_func*)get_target();
     raw_mov_l_rm(0,(uae_u32)&(bi->pc_p));
     raw_mov_l_mr((uae_u32)&regs.pc_p,0);
     raw_jmp((uae_u32)popall_check_checksum);
@@ -5802,7 +5802,7 @@ void build_comp(void)
     reset_lists();
 
     for (i=0;i<TAGSIZE;i+=2) {
-       cache_tags[i].handler=(void*)popall_execute_normal;
+       cache_tags[i].handler=(cpuop_func*)popall_execute_normal;
        cache_tags[i+1].bi=NULL;
     }
     compemu_reset();
@@ -5833,13 +5833,13 @@ static void flush_icache_hard(uae_u32 ptr, int n)
 #endif
     bi=active;
     while(bi) {
-       cache_tags[cacheline(bi->pc_p)].handler=(void*)popall_execute_normal;
+       cache_tags[cacheline(bi->pc_p)].handler=(cpuop_func*)popall_execute_normal;
        cache_tags[cacheline(bi->pc_p)+1].bi=NULL;
        bi=bi->next;
     }
     bi=dormant;
     while(bi) {
-       cache_tags[cacheline(bi->pc_p)].handler=(void*)popall_execute_normal;
+       cache_tags[cacheline(bi->pc_p)].handler=(cpuop_func*)popall_execute_normal;
        cache_tags[cacheline(bi->pc_p)+1].bi=NULL;
        bi=bi->next;
     }
@@ -5875,13 +5875,13 @@ void flush_icache(uaecptr ptr, int n)
        if (!bi->handler) {
            /* invalidated block */
            if (bi==cache_tags[cl+1].bi)
-               cache_tags[cl].handler=popall_execute_normal;
-           bi->handler_to_use=popall_execute_normal;
+               cache_tags[cl].handler=(cpuop_func*)popall_execute_normal;
+           bi->handler_to_use=(cpuop_func*)popall_execute_normal;
            set_dhtu(bi,bi->direct_pen);
        } else {
            if (bi==cache_tags[cl+1].bi)
-               cache_tags[cl].handler=popall_check_checksum;
-           bi->handler_to_use=popall_check_checksum;
+               cache_tags[cl].handler=(cpuop_func*)popall_check_checksum;
+           bi->handler_to_use=(cpuop_func*)popall_check_checksum;
            set_dhtu(bi,bi->direct_pcc);
        }
        bi2=bi;
@@ -5991,7 +5991,7 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles)
        /* Now aligned at n*32+16 */
 
        bi->handler=
-           bi->handler_to_use=(void*)get_target();
+           bi->handler_to_use=(cpuop_func*)get_target();
        raw_cmp_l_mi((uae_u32)&regs.pc_p,(uae_u32)pc_hist[0].location);
        raw_jnz((uae_u32)popall_cache_miss);
        /* This was 16 bytes on the x86, so now aligned on (n+1)*32 */
@@ -6005,7 +6005,7 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles)
        was_comp=1;
 #endif
 
-       bi->direct_handler=(void*)get_target();
+       bi->direct_handler=(cpuop_func*)get_target();
        set_dhtu(bi,bi->direct_handler);
        current_block_start_target=(uae_u32)get_target();
 
@@ -6101,7 +6101,7 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles)
                        raw_mov_l_rm(0,(uae_u32)specflags);
                        raw_test_l_rr(0,0);
                        raw_jz_b_oponly();
-                       branchadd=get_target();
+                       branchadd=(uae_s8*)get_target();
                        emit_byte(0);
                        raw_sub_l_mi((uae_u32)&countdown,scaled_cycles(totcycles));
                        raw_jmp((uae_u32)popall_do_nothing);
similarity index 98%
rename from jit/gencomp.c
rename to jit/gencomp.cpp
index fb1c744c34b4b8c8a0a28ebc9ef6d82872d53ade..65df05372cea59d3d8508a72bdec2a8bba807e0d 100644 (file)
@@ -1782,7 +1782,7 @@ gen_opcode (unsigned long int opcode)
        comprintf("\tm68k_pc_offset=0;\n");
        comprintf("\tadd_l(PC_P,src);\n");
 
-       comprintf("\tcomp_pc_p=(void*)get_const(PC_P);\n");
+       comprintf("\tcomp_pc_p=(uae_u8*)get_const(PC_P);\n");
        break;
      case i_Bcc:
        comprintf("\tuae_u32 v1,v2;\n");
@@ -1819,7 +1819,7 @@ gen_opcode (unsigned long int opcode)
        switch(curi->cc) {
         case 0:  /* Unconditional jump */
            comprintf("\tmov_l_rr(PC_P,src);\n");
-           comprintf("\tcomp_pc_p=(void*)get_const(PC_P);\n");
+           comprintf("\tcomp_pc_p=(uae_u8*)get_const(PC_P);\n");
            break;
         case 1: break; /* This is silly! */
         case 8: failure; break;  /* Work out details! FIXME */
@@ -2869,15 +2869,14 @@ gen_opcode (unsigned long int opcode)
 }
 
 static void
-generate_includes (FILE * f)
+generate_includes (FILE * f, int bigger)
 {
     fprintf (f, "#include \"sysconfig.h\"\n");
     fprintf (f, "#if defined(JIT)\n");
     fprintf (f, "#include \"sysdeps.h\"\n");
-    fprintf (f, "#include \"options.h\"\n");
+       if (bigger)
+               fprintf (f, "#include \"options.h\"\n");
     fprintf (f, "#include \"memory.h\"\n");
-    fprintf (f, "#include \"custom.h\"\n");
-    fprintf (f, "#include \"events.h\"\n");
     fprintf (f, "#include \"newcpu.h\"\n");
     fprintf (f, "#include \"comptbl.h\"\n");
 }
@@ -3012,18 +3011,22 @@ generate_one_opcode (int rp, int noflags)
        comprintf ("return 0;\n");
        comprintf ("}\n");
 
+       char name[100] = { 0 };
+       for (int k = 0; lookuptab[i].name[k]; k++)
+               name[k] = lookuptab[i].name[k];
+       
        if (aborted) {
-           fprintf (stblfile, "{ NULL, %ld, 0x%08x }, /* %s */\n", opcode, flags, lookuptab[i].name);
+           fprintf (stblfile, "{ NULL, %ld, 0x%08x }, /* %s */\n", opcode, flags, name);
            com_discard();
        } else {
            if (noflags) {
-               fprintf (stblfile, "{ op_%lx_%d_comp_nf, %ld, 0x%08x }, /* %s */\n", opcode, postfix, opcode, flags, lookuptab[i].name);
+               fprintf (stblfile, "{ op_%lx_%d_comp_nf, %ld, 0x%08x }, /* %s */\n", opcode, postfix, opcode, flags, name);
                fprintf (headerfile, "extern compop_func op_%lx_%d_comp_nf;\n", opcode, postfix);
-               printf ("unsigned long REGPARAM2 op_%lx_%d_comp_nf(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, lookuptab[i].name);
+               printf ("unsigned long REGPARAM2 op_%lx_%d_comp_nf(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, name);
            } else {
-               fprintf (stblfile, "{ op_%lx_%d_comp_ff, %ld, 0x%08x }, /* %s */\n", opcode, postfix, opcode, flags, lookuptab[i].name);
+               fprintf (stblfile, "{ op_%lx_%d_comp_ff, %ld, 0x%08x }, /* %s */\n", opcode, postfix, opcode, flags, name);
                fprintf (headerfile, "extern compop_func op_%lx_%d_comp_ff;\n", opcode, postfix);
-               printf ("unsigned long REGPARAM2 op_%lx_%d_comp_ff(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, lookuptab[i].name);
+               printf ("unsigned long REGPARAM2 op_%lx_%d_comp_ff(uae_u32 opcode) /* %s */\n{\n", opcode, postfix, name);
            }
            com_flush();
        }
@@ -3066,7 +3069,7 @@ generate_func (int noflags)
                 "#define PART_7 1\n"
                 "#define PART_8 1\n"
                 "#endif\n\n"
-                "extern void setzflg_l();\n"
+                "extern void setzflg_l(uae_u32);\n"
                 "extern void comp_fpp_opp();\n"
                 "extern void comp_fscc_opp();\n"
                 "extern void comp_fbcc_opp();\n\n");
@@ -3092,10 +3095,10 @@ main (int argc, char **argv)
     read_table68k ();
     do_merges ();
 
-    opcode_map = (int *) xmalloc (sizeof (int) * nr_cpuop_funcs);
-    opcode_last_postfix = (int *) xmalloc (sizeof (int) * nr_cpuop_funcs);
-    opcode_next_clev = (int *) xmalloc (sizeof (int) * nr_cpuop_funcs);
-    counts = (unsigned long *) xmalloc (65536 * sizeof (unsigned long));
+    opcode_map = xmalloc (int, nr_cpuop_funcs);
+    opcode_last_postfix = xmalloc (int, nr_cpuop_funcs);
+    opcode_next_clev = xmalloc (int, nr_cpuop_funcs);
+    counts = xmalloc (unsigned long, 65536);
     read_counts ();
 
     /* It would be a lot nicer to put all in one file (we'd also get rid of
@@ -3103,11 +3106,21 @@ main (int argc, char **argv)
      * I don't dare to touch the 68k version.  */
 
     headerfile = fopen ("jit/comptbl.h", "wb");
-    stblfile = fopen ("jit/compstbl.c", "wb");
-    freopen ("jit/compemu.c", "wb", stdout);
 
-    generate_includes (stdout);
-    generate_includes (stblfile);
+       fprintf (headerfile, "" \
+               "#ifdef NOFLAGS_SUPPORT\n" \
+               "/* 68040 */\n" \
+               "extern const struct comptbl op_smalltbl_0_nf[];\n" \
+               "#endif\n" \
+               "extern const struct comptbl op_smalltbl_0_comp_nf[];\n" \
+               "extern const struct comptbl op_smalltbl_0_comp_ff[];\n" \
+               "");
+       
+       stblfile = fopen ("jit/compstbl.cpp", "wb");
+    freopen ("jit/compemu.cpp", "wb", stdout);
+
+    generate_includes (stdout, 1);
+    generate_includes (stblfile, 0);
 
     printf("#include \"compemu.h\"\n");
 
@@ -3115,10 +3128,10 @@ main (int argc, char **argv)
     generate_func (noflags);
 
 
-    opcode_map = (int *) xmalloc (sizeof (int) * nr_cpuop_funcs);
-    opcode_last_postfix = (int *) xmalloc (sizeof (int) * nr_cpuop_funcs);
-    opcode_next_clev = (int *) xmalloc (sizeof (int) * nr_cpuop_funcs);
-    counts = (unsigned long *) xmalloc (65536 * sizeof (unsigned long));
+    opcode_map = xmalloc (int, nr_cpuop_funcs);
+    opcode_last_postfix = xmalloc (int, nr_cpuop_funcs);
+    opcode_next_clev = xmalloc (int, nr_cpuop_funcs);
+    counts = xmalloc (unsigned long, 65536);
     read_counts ();
     noflags=1;
     generate_func (noflags);
similarity index 99%
rename from keybuf.c
rename to keybuf.cpp
index b0c229f33de8b7448dd711809c921f362c408b79..5906bb0bb49dfd88631a82f8a2c798e07ae1594e 100644 (file)
--- a/keybuf.c
@@ -227,7 +227,7 @@ void keybuf_init (void)
 uae_u8 *save_keyboard (int *len)
 {
        uae_u8 *dst, *t;
-       dst = t = xmalloc (8);
+       dst = t = xmalloc (uae_u8, 8);
        save_u32 (getcapslockstate () ? 1 : 0);
        save_u32 (0);
        *len = 8;
diff --git a/main.c b/main.cpp
similarity index 100%
rename from main.c
rename to main.cpp
similarity index 99%
rename from memory.c
rename to memory.cpp
index 217a6d783c611a1c468fa9334125f1ac9f4e1347..65321c7f4156b3b2ec374c7d702653742302e4ca 100644 (file)
--- a/memory.c
@@ -1444,7 +1444,7 @@ void a3000_fakekick (int map)
                uae_u8 *fkickmemory = a3000lmemory + allocated_a3000lmem - fkickmem_size;
                if (fkickmemory[2] == 0x4e && fkickmemory[3] == 0xf9 && fkickmemory[4] == 0x00) {
                        if (!kickstore)
-                               kickstore = xmalloc (fkickmem_size);
+                               kickstore = xmalloc (uae_u8, fkickmem_size);
                        memcpy (kickstore, kickmemory, fkickmem_size);
                        if (fkickmemory[5] == 0xfc) {
                                memcpy (kickmemory, fkickmemory, fkickmem_size / 2);
@@ -1539,7 +1539,7 @@ static int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksu
        }
        if (currprefs.cs_a1000ram) {
                int off = 0;
-               a1000_bootrom = xcalloc (262144, 1);
+               a1000_bootrom = xcalloc (uae_u8, 262144);
                while (off + i < 262144) {
                        memcpy (a1000_bootrom + off, kickmemory, i);
                        off += i;
@@ -1811,7 +1811,7 @@ err:
 
 uae_u8 *mapped_malloc (size_t s, TCHAR *file)
 {
-       return xmalloc (s);
+       return xmalloc (uae_u8, s);
 }
 
 void mapped_free (uae_u8 *p)
@@ -1911,10 +1911,10 @@ static void add_shmmaps (uae_u32 start, addrbank *what)
        x = find_shmpiece (base);
        if (!x)
                return;
-       y = xmalloc (sizeof (shmpiece));
+       y = xmalloc (shmpiece, 1);
        *y = *x;
        base = ((uae_u8 *) NATMEM_OFFSET) + start;
-       y->native_address = shmat (y->id, base, 0);
+       y->native_address = (uae_u8*)shmat (y->id, base, 0);
        if (y->native_address == (void *) -1) {
                write_log (L"NATMEM: Failure to map existing at %08x (%p)\n", start, base);
                dumplist ();
@@ -1936,7 +1936,7 @@ uae_u8 *mapped_malloc (size_t s, const TCHAR *file)
 
        if (!canjit()) {
                nocanbang ();
-               return xcalloc (s + 4, 1);
+               return xcalloc (uae_u8, s + 4);
        }
 
        id = shmget (IPC_PRIVATE, s, 0x1ff, file);
@@ -1954,7 +1954,7 @@ uae_u8 *mapped_malloc (size_t s, const TCHAR *file)
        answer = shmat (id, 0, 0);
        shmctl (id, IPC_RMID, NULL);
        if (answer != (void *) -1) {
-               x = xmalloc (sizeof (shmpiece));
+               x = xmalloc (shmpiece, 1);
                x->native_address = (uae_u8*)answer;
                x->id = id;
                x->size = s;
@@ -1963,7 +1963,7 @@ uae_u8 *mapped_malloc (size_t s, const TCHAR *file)
                if (x->next)
                        x->next->prev = x;
                shm_start = x;
-               return answer;
+               return (uae_u8*)answer;
        }
        nocanbang ();
        return mapped_malloc (s, file);
@@ -2846,7 +2846,7 @@ uae_u8 *save_rom (int first, int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = xmalloc (4 + 4 + 4 + 4 + 4 + 256 + 256 + mem_size);
+               dstbak = dst = xmalloc (uae_u8, 4 + 4 + 4 + 4 + 4 + 256 + 256 + mem_size);
        save_u32 (mem_start);
        save_u32 (mem_size);
        save_u32 (mem_type);
similarity index 97%
rename from missing.c
rename to missing.cpp
index 2c26668db169770fd553330173d5591d11351367..c63538ad5283705aaef1aa1f949e355156bbcd47 100644 (file)
--- a/missing.c
@@ -22,6 +22,8 @@ TCHAR *my_strdup (const TCHAR *s)
 
 #endif
 
+#if 0
+
 void *xmalloc (size_t n)
 {
        void *a = malloc (n);
@@ -39,3 +41,5 @@ void xfree (const void *p)
 
        free (p);
 }
+
+#endif
similarity index 96%
rename from moduleripper.c
rename to moduleripper.cpp
index a8137e1a1635f38c8c63b24893e436255de8e145..6a7817ef036d6b06ba68c01e7cdc7183a872ccb3 100644 (file)
@@ -46,7 +46,7 @@ void moduleripper (void)
        size += currprefs.mbresmem_high_size;
        size += currprefs.z3fastmem_size;
        size += currprefs.z3fastmem2_size;
-       buf = p = xmalloc (size);
+       buf = p = xmalloc (uae_u8, size);
        if (!buf)
                return;
        memcpy (p, chipmemory, currprefs.chipmem_size);
@@ -82,6 +82,9 @@ void moduleripper (void)
        xfree (buf);
 }
 
+extern "C"
+{
+
 FILE *moduleripper_fopen (const char *aname, const char *amode)
 {
        TCHAR tmp2[MAX_DPATH];
@@ -120,6 +123,12 @@ FILE *moduleripper2_fopen (const char *name, const char *mode, const char *aid,
        return moduleripper_fopen (name, mode);
 }
 
+void pw_write_log (const char *format,...)
+{
+}
+
+}
+
 #else
 
 FILE *moduleripper_fopen (const char *name, const char *mode)
similarity index 100%
rename from native2amiga.c
rename to native2amiga.cpp
similarity index 99%
rename from ncr_scsi.c
rename to ncr_scsi.cpp
index 92e86f7acacde45d022333169e5c9eec4ebd81fb..749da20934cc7c63be3188c7913456a8891837d7 100644 (file)
@@ -312,7 +312,7 @@ uae_u32 ncr_bget2 (uaecptr addr)
        return v;
 }
 
-static addrbank ncr_bank;
+extern addrbank ncr_bank;
 
 static uae_u32 REGPARAM2 ncr_lget (uaecptr addr)
 {
@@ -488,17 +488,17 @@ void ncr_init (void)
                z = read_rom (&rd);
                if (z) {
                        write_log (L"A4091 BOOT ROM %d.%d\n", rd->ver, rd->rev);
-                       rom = (uae_u8*)xmalloc (ROM_SIZE * 4);
+                       rom = xmalloc (uae_u8, ROM_SIZE * 4);
                        for (i = 0; i < ROM_SIZE; i++) {
                                uae_u8 b;
-                               zfile_fread(&b, 1, 1, z);
+                               zfile_fread (&b, 1, 1, z);
                                rom[i * 4 + 0] = b;
                                rom[i * 4 + 2] = b << 4;
                        }
                        zfile_fclose(z);
                }
        } else {
-               romwarning(roms);
+               romwarning (roms);
        }
        map_banks (&ncr_bank, 0xe80000 >> 16, 65536 >> 16, 0);
 }
similarity index 99%
rename from newcpu.c
rename to newcpu.cpp
index 1b4226bde10b35f33390829bf69153b3669f7863..17f1f1081db94439964494c98d87e467a24b7a47 100644 (file)
--- a/newcpu.c
@@ -82,7 +82,7 @@ static uae_u32 tt0_030, tt1_030, tc_030;
 static uae_u16 mmusr_030;
 
 static struct cache020 caches020[CACHELINES020];
-static struct cache040 caches040[CACHELINES040];
+static struct cache040 caches040[CACHESETS040];
 
 #if COUNT_INSTRS
 static unsigned long int instrcount[65536];
@@ -472,6 +472,7 @@ void init_m68k (void)
 }
 
 struct regstruct regs, mmu_backup_regs;
+struct flag_struct regflags;
 static struct regstruct regs_backup[16];
 static int backup_pointer = 0;
 static long int m68kpc_offset;
@@ -2674,9 +2675,8 @@ STATIC_INLINE int do_specialties (int cycles)
                        do_copper ();
 
                if (currprefs.cpu_cycle_exact) {
-                       regs.ipl = regs.ipl_pin;
+                       ipl_fetch ();
                        if (time_for_interrupt ()) {
-                               unset_special (SPCFLAG_INT | SPCFLAG_DOINT);
                                do_interrupt (regs.ipl);
                        }
                } else {
@@ -2722,7 +2722,6 @@ STATIC_INLINE int do_specialties (int cycles)
 
        if (currprefs.cpu_cycle_exact) {
                if (time_for_interrupt ()) {
-                       unset_special (SPCFLAG_INT | SPCFLAG_DOINT);
                        do_interrupt (regs.ipl);
                }
        } else {
@@ -2832,7 +2831,6 @@ 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;
@@ -2886,7 +2884,7 @@ static void m68k_run_1_ce (void)
 {
        struct regstruct *r = &regs;
 
-       regs.ipl = regs.ipl_pin;
+       ipl_fetch ();
        for (;;) {
                uae_u32 opcode = r->ir;
                (*cpufunctbl[opcode])(opcode);
@@ -2894,7 +2892,6 @@ static void m68k_run_1_ce (void)
                        if (do_specialties (0))
                                return;
                }
-               regs.ipl = regs.ipl_pin;
                if (!currprefs.cpu_cycle_exact || currprefs.cpu_model > 68000)
                        return;
        }
@@ -3544,7 +3541,7 @@ void m68k_disasm_ea (void *f, uaecptr addr, uaecptr *nextpc, int cnt, uae_u32 *s
 {
        TCHAR *buf;
 
-       buf = malloc ((MAX_LINEWIDTH + 1) * cnt * sizeof (TCHAR));
+       buf = xmalloc (TCHAR, (MAX_LINEWIDTH + 1) * cnt);
        if (!buf)
                return;
        m68k_disasm_2 (buf, (MAX_LINEWIDTH + 1) * cnt, addr, nextpc, cnt, seaddr, deaddr, 1);
@@ -3555,7 +3552,7 @@ void m68k_disasm (void *f, uaecptr addr, uaecptr *nextpc, int cnt)
 {
        TCHAR *buf;
 
-       buf = malloc ((MAX_LINEWIDTH + 1) * cnt * sizeof (TCHAR));
+       buf = xmalloc (TCHAR, (MAX_LINEWIDTH + 1) * cnt);
        if (!buf)
                return;
        m68k_disasm_2 (buf, (MAX_LINEWIDTH + 1) * cnt, addr, nextpc, cnt, NULL, NULL, 0);
@@ -3864,7 +3861,7 @@ uae_u8 *save_cpu (int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = xmalloc (1000);
+               dstbak = dst = xmalloc (uae_u8, 1000);
        model = currprefs.cpu_model;
        save_u32 (model);                                       /* MODEL */
        save_u32 (0x80000000 | (currprefs.address_space_24 ? 1 : 0)); /* FLAGS */
@@ -3932,7 +3929,7 @@ uae_u8 *save_mmu (int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = xmalloc (1000);
+               dstbak = dst = xmalloc (uae_u8, 1000);
        save_u32 (model);       /* MODEL */
        save_u32 (0);   /* FLAGS */
        *len = dst - dstbak;
similarity index 100%
rename from nogui.c
rename to nogui.cpp
similarity index 100%
rename from od-win32/7zplugin.c
rename to od-win32/7zplugin.cpp
similarity index 94%
rename from od-win32/ahidsound_dsonly.c
rename to od-win32/ahidsound_dsonly.cpp
index 5274470e8ccda2ac342e8c5f7873869fea94dd37..669dc94c14344c9353048d16e513862470a7c172 100644 (file)
@@ -12,6 +12,7 @@
 #define RECORDBUFFER 50 //survive 9 sec of blocking at 44100
 
 #include "sysconfig.h"
+#include "sysdeps.h"
 
 #if defined(AHI)
 
@@ -24,7 +25,6 @@
 #include <dsound.h>
 #include <stdio.h>
 
-#include "sysdeps.h"
 #include "options.h"
 #include "audio.h"
 #include "memory.h"
 #include "custom.h"
 #include "newcpu.h"
 #include "traps.h"
-#include "od-win32/win32.h"
 #include "sounddep/sound.h"
 #include "dxwrap.h"
 #include "win32.h"
 #include "parser.h"
 #include "enforcer.h"
 #include "ahidsound.h"
+#include "picasso96_win.h"
 
 static long samples, playchannel, intcount;
 static int record_enabled;
@@ -183,8 +183,8 @@ void ahi_close_sound (void)
 void ahi_updatesound(int force)
 {
        HRESULT hr;
-       int pos;
-       unsigned int dwBytes1, dwBytes2;
+       DWORD pos;
+       DWORD dwBytes1, dwBytes2;
        LPVOID dwData1, dwData2;
        static int oldpos;
 
@@ -192,14 +192,14 @@ void ahi_updatesound(int force)
                oldpos = 0;
                intcount = 1;
                INTREQ (0x8000 | 0x2000);
-               hr = IDirectSoundBuffer_Play (lpDSB2, 0, 0, DSBPLAY_LOOPING);
+               hr = lpDSB2->Play (0, 0, DSBPLAY_LOOPING);
                if(hr == DSERR_BUFFERLOST) {
-                       IDirectSoundBuffer_Restore (lpDSB2);
-                       hr = IDirectSoundBuffer_Play (lpDSB2, 0, 0, DSBPLAY_LOOPING);
+                       lpDSB2->Restore ();
+                       hr = lpDSB2->Play (0, 0, DSBPLAY_LOOPING);
                }
        }
 
-       hr = IDirectSoundBuffer_GetCurrentPosition (lpDSB2, &pos, 0);
+       hr = lpDSB2->GetCurrentPosition (&pos, 0);
        if (hr != DSERR_BUFFERLOST) {
                pos -= ahitweak;
                if (pos < 0)
@@ -218,11 +218,11 @@ void ahi_updatesound(int force)
                }
        }
 
-       hr = IDirectSoundBuffer_Lock (lpDSB2, oldpos, amigablksize * 4, &dwData1, &dwBytes1, &dwData2, &dwBytes2, 0);
+       hr = lpDSB2->Lock (oldpos, amigablksize * 4, &dwData1, &dwBytes1, &dwData2, &dwBytes2, 0);
        if(hr == DSERR_BUFFERLOST) {
                write_log (L"AHI: lostbuf %d %x\n", pos, amigablksize);
                IDirectSoundBuffer_Restore (lpDSB2);
-               hr = IDirectSoundBuffer_Lock (lpDSB2, oldpos, amigablksize * 4, &dwData1, &dwBytes1, &dwData2, &dwBytes2, 0);
+               hr = lpDSB2->Lock (oldpos, amigablksize * 4, &dwData1, &dwBytes1, &dwData2, &dwBytes2, 0);
        }
        if(FAILED(hr))
                return;
@@ -335,7 +335,7 @@ static int ahi_init_sound_win32 (void)
                return 0;
        soundneutral = 0;
        ahisndbufsize = (amigablksize * 4) * NATIVBUFFNUM;  // use 4 native buffer
-       ahisndbuffer = malloc (ahisndbufsize + 32);
+       ahisndbuffer = xmalloc (uae_u8, ahisndbufsize + 32);
        if (!ahisndbuffer)
                return 0;
        if (sound_devices[currprefs.win32_soundcard].type != SOUND_DEVICE_DS)
@@ -495,10 +495,12 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
 
        case 3:
                {
-                       LPTSTR pos1,pos2;
+                       LPVOID pos1, pos2;
+                       DWORD t, cur_pos;
                        uaecptr addr;
                        HRESULT hr;
-                       int i, t, todo, byte1, byte2, cur_pos;
+                       int i, todo;
+                       DWORD byte1, byte2;
 
                        if (!ahi_on)
                                return -2;
@@ -506,7 +508,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
                                ahi_init_record_win32();
                        if (record_enabled < 0)
                                return -2;
-                       hr = IDirectSoundCaptureBuffer_GetCurrentPosition(lpDSB2r, &t, &cur_pos);
+                       hr = lpDSB2r->GetCurrentPosition(&t, &cur_pos);
                        if (FAILED(hr))
                                return -1;
 
@@ -517,7 +519,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
                                todo = cur_pos + (RECORDBUFFER * t) - cap_pos;
                        if (todo < t) //if no complete buffer ready exit
                                return -1;
-                       hr = IDirectSoundCaptureBuffer_Lock(lpDSB2r, cap_pos, t, &pos1, &byte1, &pos2, &byte2, 0);
+                       hr = lpDSB2r->Lock(cap_pos, t, &pos1, &byte1, &pos2, &byte2, 0);
                        if (FAILED(hr))
                                return -1;
                        if ((cap_pos + t) < (t * RECORDBUFFER))
@@ -532,7 +534,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
                                addr += 4;
                        }
                        t *= 4;
-                       IDirectSoundCaptureBuffer_Unlock(lpDSB2r, pos1, byte1, pos2, byte2);
+                       lpDSB2r->Unlock(pos1, byte1, pos2, byte2);
                        return (todo - t) / t;
                }
 
@@ -555,7 +557,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
        case 10:
 #if 1
                if (OpenClipboard (0)) {
-                       clipdat = GetClipboardData (CF_UNICODETEXT);
+                       clipdat = (TCHAR*)GetClipboardData (CF_UNICODETEXT);
                        if (clipdat) {
                                clipsize = _tcslen (clipdat);
                                clipsize++;
@@ -585,7 +587,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
        case 12:
                {
 #if 1
-                       TCHAR *s = au (get_real_address (m68k_areg (regs, 0)));
+                       TCHAR *s = au ((char*)get_real_address (m68k_areg (regs, 0)));
                        static LPTSTR p;
                        int slen;
 
@@ -594,9 +596,9 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
                                slen = _tcslen (s);
                                if (p)
                                        GlobalFree (p);
-                               p = GlobalAlloc (GMEM_MOVEABLE, (slen + 1) * sizeof (TCHAR));
+                               p = (LPTSTR)GlobalAlloc (GMEM_MOVEABLE, (slen + 1) * sizeof (TCHAR));
                                if (p) {
-                                       TCHAR *p2 = GlobalLock (p);
+                                       TCHAR *p2 = (TCHAR*)GlobalLock (p);
                                        if (p2) {
                                                _tcscpy (p2, s);
                                                GlobalUnlock (p);
@@ -694,7 +696,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
                        char *funcname;
                        m = (HMODULE) m68k_dreg (regs, 1);
                        funcaddr = m68k_areg (regs, 0);
-                       funcname = get_real_address (funcaddr);
+                       funcname = (char*)get_real_address (funcaddr);
                        return (uae_u32) GetProcAddress (m, funcname);
                }
 
similarity index 99%
rename from od-win32/ahidsound_new.c
rename to od-win32/ahidsound_new.cpp
index 944092cfc749d43ea1c176d002a9940175c3adff..f7d16fc8a0c490d3f8c0d25d7dfd5cfcafaa2905 100644 (file)
@@ -700,7 +700,7 @@ error:
                        dsahip->chout, dsahip->channellength);
 
                dsahip->tmpbuffer_size = 1000000;
-               dsahip->tmpbuffer = xmalloc (dsahip->tmpbuffer_size);
+               dsahip->tmpbuffer = xmalloc (uae_u8, dsahip->tmpbuffer_size);
                if (ahi_debug)
                        write_log (L"AHI: OpenAL initialized: %s\n", sound_devices[dsahip->output].name);
 
@@ -773,7 +773,7 @@ error:
        {
                if (dsahip->bits24) {
                } else {
-                       uae_s16 *dst2 = (uae_u16*)(&dst[idx * och2]);
+                       uae_s16 *dst2 = (uae_s16*)(&dst[idx * och2]);
                        l >>= 8;
                        r >>= 8;
                        if (dc->cs.volume < 0) {
@@ -1384,8 +1384,8 @@ error:
                if (cansurround)
                        ret |= AHISF_KNOWMULTICHANNEL;
 
-               dsahip->sample = xcalloc (sizeof (struct dssample), dsahip->sounds);
-               dsahip->channel = xcalloc (sizeof (struct dschannel), dsahip->channels);
+               dsahip->sample = xcalloc (struct dssample, dsahip->sounds);
+               dsahip->channel = xcalloc (struct dschannel, dsahip->channels);
                for (i = 0; i < dsahip->channels; i++) {
                        struct dschannel *dc = &dsahip->channel[i];
                        dc->num = i;
@@ -1694,7 +1694,7 @@ error:
                uae_u16 channel = m68k_dreg (regs, 0);
                uae_u16 sound = m68k_dreg (regs, 1);
                uae_u32 offset = m68k_dreg (regs, 2);
-               uae_u32 length  = m68k_dreg (regs, 3);
+               int length  = m68k_dreg (regs, 3);
                uae_u32 audioctrl = m68k_areg (regs, 2);
                uae_u32 flags = m68k_dreg (regs, 4);
                struct DSAHI *dsahip = GETAHI;
similarity index 97%
rename from od-win32/avioutput.c
rename to od-win32/avioutput.cpp
index b8202d5a8c5f92698bc2a72b4d75357a1a0a1ac1..4841d40360180de78d4a01daa54bbb3443d94f61 100644 (file)
@@ -64,8 +64,8 @@ static int videoallocated;
 
 int avioutput_width, avioutput_height, avioutput_bits;
 int avioutput_fps = VBLANK_HZ_PAL;
-DWORD avioutput_framelimiter = 0, avioutput_nosoundoutput = 0;
-DWORD avioutput_nosoundsync = 1, avioutput_originalsize = 0;
+int avioutput_framelimiter = 0, avioutput_nosoundoutput = 0;
+int avioutput_nosoundsync = 1, avioutput_originalsize = 0;
 
 TCHAR avioutput_filename[MAX_DPATH];
 static TCHAR avioutput_filename_tmp[MAX_DPATH];
@@ -147,8 +147,8 @@ static void freeavientry (struct avientry *ae)
 
 static struct avientry *allocavientry_audio (uae_u8 *snd, int size)
 {
-       struct avientry *ae = xcalloc (sizeof (struct avientry), 1);
-       ae->lpAudio = xmalloc (size);
+       struct avientry *ae = xcalloc (struct avientry, 1);
+       ae->lpAudio = xmalloc (uae_u8, size);
        memcpy (ae->lpAudio, snd, size);
        ae->sndsize = size;
        return ae;
@@ -156,10 +156,10 @@ static struct avientry *allocavientry_audio (uae_u8 *snd, int size)
 
 static struct avientry *allocavientry_video (void)
 {
-       struct avientry *ae = xcalloc (sizeof (struct avientry), 1); 
-       ae->lpbi = xmalloc (lpbisize ());
+       struct avientry *ae = xcalloc (struct avientry, 1); 
+       ae->lpbi = (LPBITMAPINFOHEADER)xmalloc (uae_u8, lpbisize ());
        memcpy (ae->lpbi, lpbi, lpbisize ());
-       ae->lpVideo = calloc (lpbi->biSizeImage, 1);
+       ae->lpVideo = xcalloc (uae_u8, lpbi->biSizeImage);
        return ae;
 }
 
@@ -221,7 +221,7 @@ static void storesettings (UAEREG *avikey)
 }
 static void getsettings (UAEREG *avikey)
 {
-       DWORD val;
+       int val;
        if (regqueryint (avikey, L"NoSoundOutput", &val))
                avioutput_nosoundoutput = val;
        if (regqueryint (avikey, L"NoSoundSync", &val))
@@ -264,8 +264,6 @@ static int AVIOutput_AudioAllocated (void)
        return pwfxDst ? 1 : 0;
 }
 
-const static GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001,0x0000,0x0010,{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}};
-
 static int AVIOutput_AllocateAudio (void)
 {
        MMRESULT err;
@@ -305,7 +303,7 @@ static int AVIOutput_AllocateAudio (void)
                }
        }
 
-       if (!(pwfxDst = (LPWAVEFORMATEX) xmalloc (wfxMaxFmtSize)))
+       if (!(pwfxDst = (LPWAVEFORMATEX)xmalloc (uae_u8, wfxMaxFmtSize)))
                return 0;
 
        // set the initial destination format to match source
@@ -365,7 +363,7 @@ static int AVIOutput_ValidateAudio (WAVEFORMATEX *wft, TCHAR *name, int len)
 
 static int AVIOutput_GetAudioFromRegistry (WAVEFORMATEX *wft)
 {
-       DWORD ss;
+       int ss;
        int ok = 0;
        UAEREG *avikey;
 
@@ -504,7 +502,7 @@ static int AVIOutput_AllocateVideo (void)
                avioutput_bits = 24;
        if (avioutput_bits > 24)
                avioutput_bits = 24;
-       lpbi = xcalloc (lpbisize (), 1);
+       lpbi = (LPBITMAPINFOHEADER)xcalloc (uae_u8, lpbisize ());
        lpbi->biSize = sizeof (BITMAPINFOHEADER);
        lpbi->biWidth = avioutput_width;
        lpbi->biHeight = avioutput_height;
@@ -534,7 +532,7 @@ static void AVIOutput_FreeCOMPVARS (COMPVARS *pcv)
 static int AVIOutput_GetCOMPVARSFromRegistry (COMPVARS *pcv)
 {
        UAEREG *avikey;
-       DWORD ss;
+       int ss;
        int ok = 0;
 
        avikey = openavikey ();
@@ -550,7 +548,7 @@ static int AVIOutput_GetCOMPVARSFromRegistry (COMPVARS *pcv)
                        pcv->cbState = 0;
                        if (regquerydatasize (avikey, L"VideoConfigurationState", &ss)) {
                                if (ss > 0) {
-                                       LPBYTE state = xmalloc (ss);
+                                       LPBYTE state = xmalloc (BYTE, ss);
                                        if (regquerydata (avikey, L"VideoConfigurationState", state, &ss)) {
                                                pcv->hic = ICOpen (pcv->fccType, pcv->fccHandler, ICMODE_COMPRESS);
                                                if (pcv->hic) {
@@ -635,7 +633,7 @@ int AVIOutput_ChooseVideoCodec (HWND hwnd, TCHAR *s, int len)
                ss = ICGetState (pcompvars->hic, NULL, 0);
                if (ss > 0) {
                        DWORD err;
-                       state = xmalloc (ss);
+                       state = xmalloc (uae_u8, ss);
                        err = ICGetState (pcompvars->hic, state, ss);
                        if (err < 0) {
                                ss = 0;
@@ -645,7 +643,7 @@ int AVIOutput_ChooseVideoCodec (HWND hwnd, TCHAR *s, int len)
                        ss = 0;
                }
                if (ss == 0)
-                       state = xmalloc (1);
+                       state = xmalloc (uae_u8, 1);
                avikey = openavikey ();
                if (avikey) {
                        regsetdata (avikey, L"VideoConfigurationState", state, ss);
@@ -712,7 +710,8 @@ static void AVIOuput_AVIWriteAudio (uae_u8 *sndbuffer, int sndbufsize)
 
 static int AVIOutput_AVIWriteAudio_Thread (struct avientry *ae)
 {
-       DWORD dwOutputBytes = 0, written = 0, swritten = 0;
+       DWORD dwOutputBytes = 0;
+       LONG written = 0, swritten = 0;
        unsigned int err;
        uae_u8 *lpAudio = NULL;
 
@@ -725,7 +724,7 @@ static int AVIOutput_AVIWriteAudio_Thread (struct avientry *ae)
                        goto error;
                }
 
-               if (!(lpAudio = xmalloc (dwOutputBytes)))
+               if (!(lpAudio = xmalloc (uae_u8, dwOutputBytes)))
                        goto error;
 
                ash.cbStruct = sizeof (ACMSTREAMHEADER);
@@ -816,7 +815,7 @@ static int getFromDC (struct avientry *avie)
        // create a memory device context compatible with the application's current screen
        hdcMem = CreateCompatibleDC (hdc);
        hbitmap = CreateCompatibleBitmap (hdc, avioutput_width, avioutput_height);
-       hbitmapOld = SelectObject (hdcMem, hbitmap);
+       hbitmapOld = (HBITMAP)SelectObject (hdcMem, hbitmap);
        // probably not the best idea to use slow GDI functions for this,
        // locking the surfaces and copying them by hand would be more efficient perhaps
        // draw centered in frame
@@ -939,7 +938,7 @@ void AVIOutput_WriteVideo (void)
 
 static int AVIOutput_AVIWriteVideo_Thread (struct avientry *ae)
 {
-       DWORD written = 0;
+       LONG written = 0;
        unsigned int err;
 
        if (avioutput_video) {
@@ -1289,7 +1288,7 @@ void AVIOutput_Initialize (void)
        InitializeCriticalSection (&AVIOutput_CriticalSection);
        cs_allocated = 1;
 
-       pcompvars = xcalloc (sizeof (COMPVARS), 1);
+       pcompvars = xcalloc (COMPVARS, 1);
        if (!pcompvars)
                return;
        pcompvars->cbSize = sizeof (COMPVARS);
index 72ad2cc5d6d332ea1964a8d521b215cd7b61c53c..7b626db1ab74faff2b53d968ceba14492d8f3d2f 100644 (file)
@@ -10,9 +10,9 @@ extern int avioutput_video, avioutput_audio, avioutput_enabled, avioutput_reques
 
 extern int avioutput_width, avioutput_height, avioutput_bits;
 extern int avioutput_fps;
-extern DWORD avioutput_framelimiter, avioutput_nosoundoutput;
-extern DWORD avioutput_nosoundsync, avioutput_originalsize;
-extern DWORD screenshot_originalsize;
+extern int avioutput_framelimiter, avioutput_nosoundoutput;
+extern int avioutput_nosoundsync, avioutput_originalsize;
+extern int screenshot_originalsize;
 
 extern TCHAR avioutput_filename[MAX_DPATH];
 
similarity index 98%
rename from od-win32/blkdev_win32_aspi.c
rename to od-win32/blkdev_win32_aspi.cpp
index 210e54ce42662029bf5eb0032d5b7380720cc001..74a83bf65114734eb7670b850473ba8f8083d705 100644 (file)
@@ -31,7 +31,7 @@ static DWORD (_cdecl *pfnSendASPI32Command)(LPSRB);
 static BOOL (_cdecl *pfnGetASPI32Buffer)(PASPI32BUFF);
 static BOOL (_cdecl *pfnFreeASPI32Buffer)(PASPI32BUFF);
 static BOOL (_cdecl *pfnTranslateASPI32Address)(PDWORD, PDWORD);
-static HANDLE hAspiLib;
+static HMODULE hAspiLib;
 static int scanphase;
 
 struct scsi_info {
@@ -55,7 +55,7 @@ static int getversion(const TCHAR *name, VS_FIXEDFILEINFO *ver)
 
        dwFileVersionInfoSize = GetFileVersionInfoSize(name, &dwVersionHandle);
        if (dwFileVersionInfoSize) {
-               if (lpFileVersionData = calloc(1, dwFileVersionInfoSize)) {
+               if (lpFileVersionData = xcalloc(uae_u8, dwFileVersionInfoSize)) {
                        if (GetFileVersionInfo(name, dwVersionHandle, dwFileVersionInfoSize, lpFileVersionData)) {
                                VS_FIXEDFILEINFO *vsFileInfo = NULL;
                                UINT uLen;
@@ -77,7 +77,7 @@ static int getversion(const TCHAR *name, VS_FIXEDFILEINFO *ver)
        return ok;
 }
 
-const TCHAR *get_aspi_path(int aspitype)
+const TCHAR *get_aspi_path (int aspitype)
 {
        static int nero, adaptec, frog;
        static TCHAR path_nero[MAX_DPATH];
@@ -157,8 +157,8 @@ static int ha_inquiry (SCSI *scgp, int id, SRB_HAInquiry *ip)
 
        Status = pfnSendASPI32Command((LPSRB)ip);
        if (log_scsi) {
-               TCHAR *s1 = au (ip->HA_ManagerId);
-               TCHAR *s2 = au (ip->HA_Identifier);
+               TCHAR *s1 = au ((char*)ip->HA_ManagerId);
+               TCHAR *s2 = au ((char*)ip->HA_Identifier);
                write_log (L"ASPI: S=%d ha=%d, ID=%d, M='%s', Id='%s'\n",
                        Status, ip->HA_Count, ip->HA_SCSI_ID, s1, s2);
                xfree (s2);
@@ -335,7 +335,7 @@ static SCSI *scsi_smalloc(void)
        scgp->scmd = (struct scg_cmd *)malloc(sizeof(struct scg_cmd));
        if (scgp->scmd == NULL)
                goto err;
-       scgp->errstr = malloc(SCSI_ERRSTR_SIZE);
+       scgp->errstr = xmalloc(char, SCSI_ERRSTR_SIZE);
        if (scgp->errstr == NULL)
                goto err;
        scgp->errptr = scgp->errbeg = scgp->errstr;
@@ -579,7 +579,7 @@ static int scsicmd(SCSI *scgp)
        s.SRB_Target = scg_target(scgp); /* Target SCSI ID */
        s.SRB_Lun = scg_lun(scgp); /* Target SCSI LUN */
        s.SRB_BufLen = sp->size; /* # of bytes transferred */
-       s.SRB_BufPointer= sp->addr; /* pointer to data buffer */
+       s.SRB_BufPointer= (BYTE*)sp->addr; /* pointer to data buffer */
        s.SRB_CDBLen = sp->cdb_len;  /* SCSI command length */
        s.SRB_PostProc = Event; /* Post proc event */
        s.SRB_SenseLen = SENSE_LEN; /* Lenght of sense buffer */
@@ -728,7 +728,7 @@ static void scan_scsi_bus (SCSI *scgp, int flags)
                                                write_log (L"]");
                                                if (use) {
                                                        unitcnt++;
-                                                       cis->buf = malloc (DEVICE_SCSI_BUFSIZE);
+                                                       cis->buf = xmalloc (uae_u8, DEVICE_SCSI_BUFSIZE);
                                                        cis->scsibus = scgp->addr.scsibus;
                                                        cis->target = scgp->addr.target;
                                                        cis->lun = scgp->addr.lun;
similarity index 99%
rename from od-win32/blkdev_win32_ioctl.c
rename to od-win32/blkdev_win32_ioctl.cpp
index 4f80034275b310f105609b72a700a99fe3fc8262..731d2c65f518db63c6f1f1619ef9652e7ce4defb 100644 (file)
@@ -287,7 +287,7 @@ static int cdda_openwav (struct dev_info_ioctl *ciw)
 static void *cdda_play (void *v)
 {
        DWORD len;
-       struct dev_info_ioctl *ciw = v;
+       struct dev_info_ioctl *ciw = (struct dev_info_ioctl*)v;
        int unitnum = ciw32 - ciw;
        int cdda_pos;
        int num_sectors = CDDA_BUFFERS;
@@ -311,7 +311,7 @@ static void *cdda_play (void *v)
                Sleep (10);
        oldplay = -1;
 
-       p = VirtualAlloc (NULL, 2 * num_sectors * 4096, MEM_COMMIT, PAGE_READWRITE);
+       p = (uae_u8*)VirtualAlloc (NULL, 2 * num_sectors * 4096, MEM_COMMIT, PAGE_READWRITE);
        px[0] = p;
        px[1] = p + num_sectors * 4096;
        bufon[0] = bufon[1] = 0;
@@ -325,7 +325,7 @@ static void *cdda_play (void *v)
                for (i = 0; i < 2; i++) {
                        memset (&whdr[i], 0, sizeof (WAVEHDR));
                        whdr[i].dwBufferLength = 2352 * num_sectors;
-                       whdr[i].lpData = px[i];
+                       whdr[i].lpData = (LPSTR)px[i];
                        mmr = waveOutPrepareHeader (ciw->cdda_wavehandle, &whdr[i], sizeof (WAVEHDR));
                        if (mmr != MMSYSERR_NOERROR) {
                                write_log (L"CDDA: waveOutPrepareHeader %d:%d\n", i, mmr);
@@ -1073,7 +1073,7 @@ static int sys_cddev_open (int unitnum)
        ciw->cdda_volume = 0xffff;
        ciw->cdda_volume_main = currprefs.sound_volume;
        /* buffer must be page aligned for device access */
-       ciw->tempbuffer = VirtualAlloc (NULL, IOCTL_DATA_BUFFER, MEM_COMMIT, PAGE_READWRITE);
+       ciw->tempbuffer = (uae_u8*)VirtualAlloc (NULL, IOCTL_DATA_BUFFER, MEM_COMMIT, PAGE_READWRITE);
        if (!ciw->tempbuffer) {
                write_log (L"IOCTL: failed to allocate buffer");
                return 1;
similarity index 95%
rename from od-win32/blkdev_win32_spti.c
rename to od-win32/blkdev_win32_spti.cpp
index 923ca7c8d090045836e213faf9f7d9497ed50624..0ac18c1fed767430666c667b5ff22f8227c4eda2 100644 (file)
@@ -50,7 +50,7 @@ static int unitcnt = 0;
 struct dev_info_spti {
        TCHAR *drvpath;
        TCHAR *name;
-       TCHAR *inquirydata;
+       uae_u8 *inquirydata;
        TCHAR *ident;
        int mediainserted;
        HANDLE handle;
@@ -74,7 +74,7 @@ static int doscsi (int unitnum, SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER *swb, int *
        if (log_scsi) {
                write_log (L"SCSI, H=%X:%d:%d:%d:%d: ", di->handle, di->bus, di->path, di->target, di->lun);
                scsi_log_before (swb->spt.Cdb, swb->spt.CdbLength,
-                       swb->spt.DataIn == SCSI_IOCTL_DATA_OUT ? swb->spt.DataBuffer : 0,swb->spt.DataTransferLength);
+                       swb->spt.DataIn == SCSI_IOCTL_DATA_OUT ? (uae_u8*)swb->spt.DataBuffer : NULL, swb->spt.DataTransferLength);
        }
        gui_flicker_led (LED_CD, unitnum, 1);
        swb->spt.ScsiStatus = 0;
@@ -93,10 +93,10 @@ static int doscsi (int unitnum, SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER *swb, int *
                write_log (L"SCSI ERROR, H=%X:%d:%d:%d:%d: ", di->handle, di->bus, di->path, di->target, di->lun);
                write_log (L"Status = %d, Error code = %d, LastError=%d\n", status, swb->spt.ScsiStatus, lasterror);
                scsi_log_before (swb->spt.Cdb, swb->spt.CdbLength,
-                       swb->spt.DataIn == SCSI_IOCTL_DATA_OUT ? swb->spt.DataBuffer : 0,swb->spt.DataTransferLength);
+                       swb->spt.DataIn == SCSI_IOCTL_DATA_OUT ? (uae_u8*)swb->spt.DataBuffer : 0,swb->spt.DataTransferLength);
        }
        if (log_scsi)
-               scsi_log_after (swb->spt.DataIn == SCSI_IOCTL_DATA_IN ? swb->spt.DataBuffer : 0, swb->spt.DataTransferLength,
+               scsi_log_after (swb->spt.DataIn == SCSI_IOCTL_DATA_IN ? (uae_u8*)swb->spt.DataBuffer : NULL, swb->spt.DataTransferLength,
                swb->SenseBuf, swb->spt.SenseInfoLength);
        if (swb->spt.SenseInfoLength > 0 && (swb->SenseBuf[0] == 0 || swb->SenseBuf[0] == 1))
                swb->spt.SenseInfoLength = 0; /* 0 and 1 = success, not error.. */
@@ -281,9 +281,10 @@ static void checkcapabilities (int unitnum)
 {
        struct dev_info_spti *di = &dev_info[unitnum];
        STORAGE_ADAPTER_DESCRIPTOR desc;
-       STORAGE_PROPERTY_QUERY query = { 0 };
+       STORAGE_PROPERTY_QUERY query;
        DWORD ret, status;
 
+       memset (&query, 0, sizeof STORAGE_PROPERTY_QUERY);
        query.PropertyId = StorageAdapterProperty;
        query.QueryType = PropertyStandardQuery;
        status = DeviceIoControl (di->handle, IOCTL_STORAGE_QUERY_PROPERTY,
@@ -395,13 +396,13 @@ int open_scsi_device (int unitnum)
        if (!di)
                return 0;
        if (di->bus >= 0) {
-               dev = xmalloc (100);
+               dev = xmalloc (TCHAR, 100);
                _stprintf (dev, L"\\\\.\\Scsi%d:", di->bus);
        } else {
                dev = my_strdup (di->drvpath);
        }
        if (!di->scsibuf)
-               di->scsibuf = VirtualAlloc (NULL, DEVICE_SCSI_BUFSIZE, MEM_COMMIT, PAGE_READWRITE);
+               di->scsibuf = (uae_u8*)VirtualAlloc (NULL, DEVICE_SCSI_BUFSIZE, MEM_COMMIT, PAGE_READWRITE);
        h = CreateFile(dev,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL);
        di->handle = h;
        if (h == INVALID_HANDLE_VALUE) {
@@ -417,7 +418,7 @@ int open_scsi_device (int unitnum)
                        return 0;
                }
                inqdata[INQUIRY_SIZE] = 0;
-               di->name = my_strdup_ansi (inqdata + 8);
+               di->name = my_strdup_ansi ((char*)inqdata + 8);
                if (di->type == INQ_ROMD) {
                        dev_info[unitnum].mediainserted = mediacheck (unitnum);
                        write_log (L"SPTI: unit %d opened [%s], %s, '%s'\n", unitnum,
@@ -428,7 +429,7 @@ int open_scsi_device (int unitnum)
                        write_log (L"SPTI: unit %d, type %d, '%s'\n",
                                unitnum, di->type, di->name);
                }
-               di->inquirydata = xmalloc (INQUIRY_SIZE);
+               di->inquirydata = xmalloc (uae_u8, INQUIRY_SIZE);
                memcpy (di->inquirydata, inqdata, INQUIRY_SIZE);
                xfree (dev);
                return 1;
@@ -573,7 +574,7 @@ static int getCDROMProperty (int idx, HDEVINFO DevInfo, const GUID *guid)
        }
 
        interfaceDetailDataSize = reqSize;
-       interfaceDetailData = malloc (interfaceDetailDataSize);
+       interfaceDetailData = (PSP_DEVICE_INTERFACE_DETAIL_DATA)xmalloc (uae_u8, interfaceDetailDataSize);
        if (interfaceDetailData == NULL)
                return FALSE;
        interfaceDetailData->cbSize = sizeof (SP_INTERFACE_DEVICE_DETAIL_DATA);
@@ -611,7 +612,7 @@ static void scanscsi (void)
        int idx;
        TCHAR DeviceName[256];
 
-       AdapterInfo = xmalloc (SCSI_INFO_BUFFER_SIZE) ;
+       AdapterInfo = (PSCSI_ADAPTER_BUS_INFO)xmalloc (uae_u8, SCSI_INFO_BUFFER_SIZE);
        if (AdapterInfo == NULL)
                return;
 
similarity index 98%
rename from od-win32/bsdsock.c
rename to od-win32/bsdsock.cpp
index 1a48e181a9294adb17a52330fa7674a00a8c8d0b..4ebd25406b1abd9f776be0d4037016116656ffad 100644 (file)
@@ -68,11 +68,11 @@ struct bsdsockdata {
        HANDLE hSockReqHandled;
        CRITICAL_SECTION csSigQueueLock;
        CRITICAL_SECTION SockThreadCS;
-       DWORD threadid;
+       unsigned int threadid;
        WSADATA wsbData;
 
        volatile HANDLE hGetThreads[MAX_GET_THREADS];
-       volatile struct threadargs threadGetargs[MAX_GET_THREADS];
+       struct threadargs threadGetargs[MAX_GET_THREADS];
        volatile int threadGetargs_inuse[MAX_GET_THREADS];
        volatile HANDLE hGetEvents[MAX_GET_THREADS];
 
@@ -147,7 +147,7 @@ static int mySockStartup(void)
        TCHAR *ss;
 
        if (!bsd) {
-               bsd = calloc (sizeof (struct bsdsockdata), 1);
+               bsd = xcalloc (struct bsdsockdata, 1);
                for (i = 0; i < MAX_GET_THREADS; i++)
                        threadindextable[i] = i;
        }
@@ -201,7 +201,7 @@ int init_socket_layer (void)
                                wc.hInstance = hInst;
                                wc.hIcon = LoadIcon (GetModuleHandle (NULL), MAKEINTRESOURCE (IDI_APPICON));
                                wc.hCursor = LoadCursor (NULL, IDC_ARROW);
-                               wc.hbrBackground = GetStockObject (BLACK_BRUSH);
+                               wc.hbrBackground = (HBRUSH)GetStockObject (BLACK_BRUSH);
                                wc.lpszMenuName = 0;
                                wc.lpszClassName = L"SocketFun";
                                RegisterClass(&wc);
@@ -315,7 +315,7 @@ int host_sbinit(TrapContext *context, SB)
        if ((sb->hEvent = CreateEvent(NULL,FALSE,FALSE,NULL)) == NULL)
                return 0;
 
-       sb->mtable = calloc(sb->dtablesize, sizeof(*sb->mtable));
+       sb->mtable = xcalloc(unsigned int, sb->dtablesize);
 
        return 1;
 }
@@ -1016,7 +1016,7 @@ void host_connect(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 na
 void host_sendto (TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 len, uae_u32 flags, uae_u32 to, uae_u32 tolen)
 {
        SOCKET s;
-       uae_char *realpt;
+       char *realpt;
        unsigned int wMsg;
        uae_char buf[MAXADDRLEN];
        int iCut;
@@ -1033,7 +1033,7 @@ void host_sendto (TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 len
        if (s != INVALID_SOCKET) {
                if (!addr_valid (L"host_sendto1", msg, 4))
                        return;
-               realpt = get_real_address (msg);
+               realpt = (char*)get_real_address (msg);
 
                if (to) {
                        if (tolen > sizeof buf) {
@@ -1199,7 +1199,7 @@ void host_recvfrom(TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 le
        if (s != INVALID_SOCKET) {
                if (!addr_valid (L"host_recvfrom1", msg, 4))
                        return;
-               realpt = get_real_address (msg);
+               realpt = (char*)get_real_address (msg);
 
                if (addr) {
                        if (!addr_valid (L"host_recvfrom1", addrlen, 4))
@@ -1987,11 +1987,11 @@ uae_u32 host_Inet_NtoA(TrapContext *context, SB, uae_u32 in)
 uae_u32 host_inet_addr(uae_u32 cp)
 {
        uae_u32 addr;
-       uae_char *cp_rp;
+       char *cp_rp;
 
        if (!addr_valid (L"host_inet_addr", cp, 4))
                return 0;
-       cp_rp = get_real_address (cp);
+       cp_rp = (char*)get_real_address (cp);
 
        addr = htonl(inet_addr(cp_rp));
 
@@ -2025,11 +2025,11 @@ static unsigned int thread_get2 (void *indexp)
 {
        int index = *((int*)indexp);
        unsigned int result = 0;
-       volatile struct threadargs *args;
+       struct threadargs *args;
        uae_u32 name;
        uae_u32 namelen;
        long addrtype;
-       uae_char *name_rp;
+       char *name_rp;
        SB;
 
        while (bsd->hGetEvents[index]) {
@@ -2054,7 +2054,7 @@ static unsigned int thread_get2 (void *indexp)
                                namelen = args->args3;
                                addrtype = args->args4;
                                if (addr_valid (L"thread_get1", name, 1))
-                                       name_rp = get_real_address (name);
+                                       name_rp = (char*)get_real_address (name);
                                else
                                        name_rp = "";
 
@@ -2085,7 +2085,7 @@ static unsigned int thread_get2 (void *indexp)
 
                                name = args->args2;
                                if (addr_valid (L"thread_get2", name, 1))
-                                       name_rp = get_real_address (name);
+                                       name_rp = (char*)get_real_address (name);
                                else
                                        name_rp = "";
                                proto = getprotobyname (name_rp);
@@ -2106,7 +2106,7 @@ static unsigned int thread_get2 (void *indexp)
                                uae_u32 nameport;
                                uae_u32 proto;
                                uae_u32 type;
-                               uae_char *proto_rp = 0;
+                               char *proto_rp = 0;
                                struct servent *serv;
 
                                nameport = args->args2;
@@ -2115,14 +2115,14 @@ static unsigned int thread_get2 (void *indexp)
 
                                if (proto) {
                                        if (addr_valid (L"thread_get3", proto, 1))
-                                               proto_rp = get_real_address (proto);
+                                               proto_rp = (char*)get_real_address (proto);
                                }
 
                                if (type) {
                                        serv = getservbyport(nameport, proto_rp);
                                } else {
                                        if (addr_valid (L"thread_get4", nameport, 1))
-                                               name_rp = get_real_address (nameport);
+                                               name_rp = (char*)get_real_address (nameport);
                                        serv = getservbyname(name_rp, proto_rp);
                                }
                                if (bsd->threadGetargs_inuse[index] != -1) {
@@ -2133,7 +2133,7 @@ static unsigned int thread_get2 (void *indexp)
                                                BSDTRACE((L"failed (%d) - ", sb->sb_errno));
                                        } else {
                                                bsdsocklib_seterrno(sb, 0);
-                                               memcpy(args->buf, serv, sizeof(struct servent));
+                                               memcpy(args->buf, serv, sizeof (struct servent));
                                        }
                                }
                        }
@@ -2219,7 +2219,7 @@ void host_gethostbynameaddr (TrapContext *context, SB, uae_u32 name, uae_u32 nam
        HOSTENT *h;
        int size, numaliases = 0, numaddr = 0;
        uae_u32 aptr;
-       uae_char *name_rp;
+       char *name_rp;
        int i;
        struct threadargs args;
        volatile struct threadargs *argsp;
@@ -2238,7 +2238,7 @@ void host_gethostbynameaddr (TrapContext *context, SB, uae_u32 name, uae_u32 nam
        name_rp = "";
 
        if (addr_valid (L"host_gethostbynameaddr", name, 1))
-               name_rp = get_real_address (name);
+               name_rp = (char*)get_real_address (name);
 
        if (addrtype == -1) {
                BSDTRACE((L"gethostbyname(%s) -> ",name_rp));
@@ -2337,14 +2337,14 @@ void host_getprotobyname(TrapContext *context, SB, uae_u32 name)
        PROTOENT *p;
        int size, numaliases = 0;
        uae_u32 aptr;
-       uae_char *name_rp;
+       char *name_rp;
        int i;
        struct threadargs args;
        volatile struct threadargs *argsp;
 
        name_rp = "";
        if (addr_valid (L"host_gethostbynameaddr", name, 1))
-               name_rp = get_real_address (name);
+               name_rp = (char*)get_real_address (name);
 
        BSDTRACE((L"getprotobyname(%s) -> ",name_rp));
 
@@ -2422,14 +2422,14 @@ void host_getservbynameport(TrapContext *context, SB, uae_u32 nameport, uae_u32
 
        if (proto) {
                if (addr_valid (L"host_getservbynameport1", proto, 1))
-                       proto_rp = au (get_real_address (proto));
+                       proto_rp = au ((char*)get_real_address (proto));
        }
 
        if (type) {
                BSDTRACE((L"getservbyport(%d,%s) -> ",nameport, proto_rp ? proto_rp : L"NULL"));
        } else {
                if (addr_valid (L"host_getservbynameport2", nameport, 1))
-                       name_rp = au (get_real_address (nameport));
+                       name_rp = au ((char*)get_real_address (nameport));
                BSDTRACE((L"getservbyname(%s,%s) -> ",name_rp, proto_rp ? proto_rp : L"NULL"));
        }
 
@@ -2500,7 +2500,7 @@ uae_u32 host_gethostname(uae_u32 name, uae_u32 namelen)
 {
        if (!addr_valid (L"host_gethostname", name, namelen))
                return -1;
-       return gethostname(get_real_address (name),namelen);
+       return gethostname ((char*)get_real_address (name),namelen);
 }
 
 #endif
diff --git a/od-win32/build68k_msvc/build68k_msvc.rc b/od-win32/build68k_msvc/build68k_msvc.rc
deleted file mode 100644 (file)
index 3eee795..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-LANGUAGE 9, 1
-#pragma code_page(1252)
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE  
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE  
-BEGIN
-    "#include ""afxres.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE  
-BEGIN
-    "\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-#endif    // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-
index a783e62f659ed4b41ea3f3580c23254fd44bddeb..86f8060685392d1ded1aede6f17b8ed17441cc69 100644 (file)
@@ -66,8 +66,8 @@
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="deleting cpudefs.c"
-                               CommandLine="del ..\..\cpudefs.c"
+                               Description="deleting cpudefs.cpp"
+                               CommandLine="del ..\..\cpudefs.cpp"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPostBuildEventTool"
-                               Description="creating cpudefs.c"
+                               Description="creating cpudefs.cpp"
                                CommandLine="build68k.exe &gt;..\..\cpudefs.c &lt;..\..\table68k"
                        />
                </Configuration>
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="deleting cpudefs.c"
-                               CommandLine="del ..\..\cpudefs.c"
+                               Description="deleting cpudefs.cpp"
+                               CommandLine="del ..\..\cpudefs.cpp"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPostBuildEventTool"
-                               Description="creating cpudefs.c"
+                               Description="creating cpudefs.cpp"
                                CommandLine="build68k.exe &gt;..\..\cpudefs.c &lt;..\..\table68k"
                        />
                </Configuration>
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="deleting cpudefs.c"
-                               CommandLine="del ..\..\cpudefs.c"
+                               Description="deleting cpudefs.cpp"
+                               CommandLine="del ..\..\cpudefs.cpp"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPostBuildEventTool"
-                               Description="creating cpudefs.c"
+                               Description="creating cpudefs.cpp"
                                CommandLine="build68k.exe &gt;..\..\cpudefs.c &lt;..\..\table68k"
                        />
                </Configuration>
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="deleting cpudefs.c"
-                               CommandLine="del ..\..\cpudefs.c"
+                               Description="deleting cpudefs.cpp"
+                               CommandLine="del ..\..\cpudefs.cpp"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPostBuildEventTool"
-                               Description="creating cpudefs.c"
+                               Description="creating cpudefs.cpp"
                                CommandLine="build68k.exe &gt;..\..\cpudefs.c &lt;..\..\table68k"
                        />
                </Configuration>
                        Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
                        >
                        <File
-                               RelativePath="..\..\build68k.c"
+                               RelativePath="..\..\build68k.cpp"
                                >
                        </File>
                </Filter>
index e0f6b0dabc481e4441c1fd5794bcbefa604cf577..1acddfe4fcf2bc92284885e3e2a45af5c377cb7f 100644 (file)
@@ -99,8 +99,8 @@
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <PreLinkEvent>
-      <Message>deleting cpudefs.c</Message>
-      <Command>del ..\..\cpudefs.c</Command>
+      <Message>deleting cpudefs.cpp</Message>
+      <Command>del ..\..\cpudefs.cpp</Command>
     </PreLinkEvent>
     <Link>
       <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
       </DataExecutionPrevention>
     </Link>
     <PostBuildEvent>
-      <Message>creating cpudefs.c</Message>
-      <Command>build68k.exe &gt;..\..\cpudefs.c &lt;..\..\table68k</Command>
+      <Message>creating cpudefs.cpp</Message>
+      <Command>build68k.exe &gt;..\..\cpudefs.cpp &lt;..\..\table68k
+del build68k.exe
+</Command>
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\build68k.c" />
+    <ClCompile Include="..\..\build68k.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index 47fe46b37c5a271fcc3d364e8f8268caa87e19d6..919edbea8d189aab3df979ef1a5c4166b0e70110 100644 (file)
@@ -7,7 +7,7 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\build68k.c">
+    <ClCompile Include="..\..\build68k.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
similarity index 99%
rename from od-win32/caps/caps_win32.c
rename to od-win32/caps/caps_win32.cpp
index e03ea37fca530023cfc6cc519d3f8bea367d4674..a1528ec1bdbdc6831f78fa2d8e7d912509d8785e 100644 (file)
@@ -4,11 +4,12 @@
 
 #ifdef CAPS
 
+#include <shlobj.h>
+
 #include "caps_win32.h"
 #include "zfile.h"
 #include "gui.h"
 #include "win32.h"
-#include <shlobj.h>
 
 #include "ComType.h"
 #include "CapsAPI.h"
@@ -114,7 +115,7 @@ int caps_loadimage (struct zfile *zf, int drv, int *num_tracks)
        zfile_fseek (zf, 0, SEEK_END);
        len = zfile_ftell (zf);
        zfile_fseek (zf, 0, SEEK_SET);
-       buf = xmalloc (len);
+       buf = xmalloc (uae_u8, len);
        if (!buf)
                return 0;
        if (zfile_fread (buf, len, 1, zf) == 0)
similarity index 96%
rename from od-win32/clipboard_win32.c
rename to od-win32/clipboard_win32.cpp
index add5768929fe3dc06560b1641e7367413895bd2c..773381c9c874313713d5665c9ba5fea52712134f 100644 (file)
@@ -75,7 +75,7 @@ static uae_char *pctoamiga (const uae_char *txt)
        int i, j;
 
        len = strlen (txt) + 1;
-       txt2 = xmalloc (len);
+       txt2 = xmalloc (uae_char, len);
        j = 0;
        for (i = 0; i < len; i++) {
                uae_char c = txt[i];
@@ -86,7 +86,7 @@ static uae_char *pctoamiga (const uae_char *txt)
        return txt2;
 }
 
-static int parsecsi (const uae_char *txt, int off, int len)
+static int parsecsi (const char *txt, int off, int len)
 {
        while (off < len) {
                if (txt[off] >= 0x40)
@@ -96,7 +96,7 @@ static int parsecsi (const uae_char *txt, int off, int len)
        return off;
 }
 
-static TCHAR *amigatopc (const uae_u8 *txt)
+static TCHAR *amigatopc (const char *txt)
 {
        int i, j, cnt;
        int len, pc;
@@ -115,7 +115,7 @@ static TCHAR *amigatopc (const uae_u8 *txt)
        }
        if (pc)
                return my_strdup_ansi (txt);
-       txt2 = xcalloc (len + cnt, 1);
+       txt2 = xcalloc (char, len + cnt);
        j = 0;
        for (i = 0; i < len; i++) {
                uae_char c = txt[i];
@@ -161,7 +161,7 @@ static void to_iff_text (TCHAR *pctxt)
        b[18] = size >>  8;
        b[19] = size >>  0;
        to_amiga_size = sizeof b + txtlen + (txtlen & 1);
-       to_amiga = xcalloc (to_amiga_size, 1);
+       to_amiga = xcalloc (uae_u8, to_amiga_size);
        memcpy (to_amiga, b, sizeof b);
        memcpy (to_amiga + sizeof b, txt, txtlen);
        to_amiga_start ();
@@ -199,7 +199,7 @@ static void from_iff_text (uaecptr ftxt, uae_u32 len)
                if (!memcmp (addr, "CHRS", 4) && csize) {
                        int prevsize = txtsize;
                        txtsize += csize;
-                       txt = realloc (txt, txtsize + 1);
+                       txt = xrealloc (char, txt, txtsize + 1);
                        memcpy (txt + prevsize, addr + 8, csize);
                        txt[txtsize] = 0;
                }
@@ -243,7 +243,7 @@ static void to_iff_ilbm (HBITMAP hbmp)
                return;
        bmpw = (w * bpp / 8 + 3) & ~3;
        size = bmpw * h;
-       bmp.bmBits = xmalloc (size);
+       bmp.bmBits = xmalloc (uae_u8, size);
        if (!GetBitmapBits (hbmp, size, bmp.bmBits)) {
                xfree (bmp.bmBits);
                return;
@@ -280,7 +280,7 @@ static void to_iff_ilbm (HBITMAP hbmp)
        bodysize = (((w + 15) & ~15) / 8) * h * iffbpp;
 
        iffsize = sizeof (iffilbm) + (8 + 256 * 3 + 1) + (4 + 4) + bodysize;
-       iff = xcalloc (iffsize, 1);
+       iff = xcalloc (uae_u8, iffsize);
        memcpy (iff, iffilbm, sizeof iffilbm);
        p = iff + 5 * 4;
        // BMHD
@@ -404,7 +404,7 @@ static uae_u8 *iff_decomp (uae_u8 *addr, int w, int h, int planes)
        uae_u8 *dst;
 
        w2 = (w + 15) & ~15;
-       dst = xmalloc (w2 * h * planes);
+       dst = xmalloc (uae_u8, w2 * h * planes);
        for (y = 0; y < h * planes; y++) {
                uae_u8 *p = dst + w2 * y;
                uae_u8 *end = p + w2;
@@ -519,7 +519,7 @@ static void from_iff_ilbm (uaecptr ilbm, uae_u32 len)
                        bmsize = sizeof (BITMAPINFO);
                        if (bmpdepth <= 8)
                                bmsize += (1 << planes) * sizeof (RGBQUAD);
-                       bmih = xcalloc (bmsize, 1);
+                       bmih = (BITMAPINFO*)xcalloc (uae_u8, bmsize);
                        bmih->bmiHeader.biSize = sizeof (bmih->bmiHeader);
                        bmih->bmiHeader.biWidth = w;
                        bmih->bmiHeader.biHeight = -h;
@@ -545,7 +545,7 @@ static void from_iff_ilbm (uaecptr ilbm, uae_u32 len)
                                        }
                                }
                        }
-                       bmptr = xcalloc (bmpw * h, 1);
+                       bmptr = xcalloc (uae_u8, bmpw * h);
 
                        if (compr)
                                addr = caddr = iff_decomp (addr, w, h, planes + (masking == 1 ? 1 : 0));
@@ -687,7 +687,7 @@ static void clipboard_read (HWND hwnd)
        if (text) {
                hglb = GetClipboardData (CF_UNICODETEXT); 
                if (hglb != NULL) { 
-                       TCHAR *lptstr = GlobalLock (hglb); 
+                       TCHAR *lptstr = (TCHAR*)GlobalLock (hglb); 
                        if (lptstr != NULL) {
                                //write_log (L"clipboard: CF_UNICODETEXT '%s'\n", lptstr);
                                to_iff_text (lptstr);
@@ -695,7 +695,7 @@ static void clipboard_read (HWND hwnd)
                        }
                }
        } else if (bmp) {
-               HBITMAP hbmp = GetClipboardData (CF_BITMAP);
+               HBITMAP hbmp = (HBITMAP)GetClipboardData (CF_BITMAP);
                if (hbmp != NULL) {
                        //write_log (L"clipboard: CF_BITMAP\n");
                        to_iff_ilbm (hbmp);
@@ -757,7 +757,7 @@ static int clipboard_put_text_real (const TCHAR *txt)
        EmptyClipboard (); 
        hglb = GlobalAlloc (GMEM_MOVEABLE, (_tcslen (txt) + 1) * sizeof (TCHAR));
        if (hglb) {
-               TCHAR *lptstr = GlobalLock (hglb);
+               TCHAR *lptstr = (TCHAR*)GlobalLock (hglb);
                _tcscpy (lptstr, txt);
                GlobalUnlock (hglb);
                SetClipboardData (CF_UNICODETEXT, hglb); 
@@ -858,7 +858,7 @@ void clipboard_active (HWND hwnd, int active)
        }
        if (!clipactive && clipboard_delayed_data) {
                if (clipboard_delayed_size < 0) {
-                       clipboard_put_text_real (clipboard_delayed_data);
+                       clipboard_put_text_real ((TCHAR*)clipboard_delayed_data);
                        xfree (clipboard_delayed_data);
                } else {
                        clipboard_put_bmp_real ((HBITMAP)clipboard_delayed_data);
similarity index 100%
rename from od-win32/clirun.c
rename to od-win32/clirun.cpp
similarity index 99%
rename from od-win32/debug_win32.c
rename to od-win32/debug_win32.cpp
index c9a97b8d1b329dbf626d29d23809f5250c174cf9..264313826d148ff9da69044df1c31c0d22d2fed8 100644 (file)
@@ -101,7 +101,7 @@ static void OutputCurrHistNode(HWND hWnd)
 
        if (currhist->command) {
                txtlen = GetWindowTextLength(hWnd);
-               buf = xmalloc((txtlen + 1) * sizeof (TCHAR));
+               buf = xmalloc(TCHAR, txtlen + 1);
                GetWindowText(hWnd, buf, txtlen + 1);
                if (_tcscmp(buf, currhist->command)) {
                        SetWindowText(hWnd, currhist->command);
@@ -165,7 +165,7 @@ static void AddToHistory(const TCHAR *command)
        else if (histcount == MAXINPUTHIST)
                DeleteFromHistory(1);
        tmp = lasthist;
-       lasthist = malloc(sizeof(struct histnode));
+       lasthist = xmalloc(struct histnode, 1);
        if (histcount == 0)
                firsthist = lasthist;
        lasthist->command = my_strdup(command);
@@ -241,7 +241,7 @@ void WriteOutput(const TCHAR *out, int len)
                        pos = p - tmp + 1;
                        if (pos > (MAX_LINEWIDTH + 1))
                                pos = MAX_LINEWIDTH + 1;
-                       buf = xcalloc(pos + 2, sizeof (TCHAR));
+                       buf = xcalloc(TCHAR, pos + 2);
                        _tcsncpy(buf, tmp, pos - 1);
                        _tcscat(buf, linebreak);
                } else if (_tcslen(tmp) == 0) {
@@ -251,7 +251,7 @@ void WriteOutput(const TCHAR *out, int len)
                        index = SendMessage(hOutput, EM_LINEINDEX, count - 1, 0);
                        txtlen = SendMessage(hOutput, EM_LINELENGTH, index, 0);
                        if (_tcslen(tmp) + txtlen > MAX_LINEWIDTH) {
-                               buf = xcalloc(MAX_LINEWIDTH + 3 - txtlen, sizeof (TCHAR));
+                               buf = xcalloc(TCHAR, MAX_LINEWIDTH + 3 - txtlen);
                                _tcsncpy(buf, tmp, MAX_LINEWIDTH - txtlen);
                                _tcscat(buf, linebreak);
                        }
@@ -830,7 +830,7 @@ static LRESULT CALLBACK MemInputProc (HWND hWnd, UINT message, WPARAM wParam, LP
                        return TRUE;
                hdata = GetClipboardData(CF_UNICODETEXT);
                if (hdata) {
-                       lptstr = GlobalLock(hdata);
+                       lptstr = (LPWSTR)GlobalLock(hdata);
                        if (lptstr) {
                                if (_tcsspn(lptstr, allowed) != _tcslen(lptstr))
                                        ok = 0;
@@ -956,7 +956,7 @@ static void CopyListboxText(HWND hwnd, BOOL all)
        hdata = GlobalAlloc(GMEM_MOVEABLE, size * sizeof (TCHAR));
        if (hdata) {
                int pos = 0;
-               lptstr = GlobalLock(hdata);
+               lptstr = (LPWSTR)GlobalLock(hdata);
                lptstr[size - 1] = '\0';
                for (i = start; i < end; i++) {
                        int len = SendMessage(hwnd, LB_GETTEXTLEN, i, 0);
@@ -1149,7 +1149,7 @@ static LRESULT CALLBACK ListboxEditProc(HWND hWnd, UINT message, WPARAM wParam,
                        return TRUE;
                hdata = GetClipboardData(CF_UNICODETEXT);
                if (hdata) {
-                       lptstr = GlobalLock(hdata);
+                       lptstr = (LPWSTR)GlobalLock(hdata);
                        if (lptstr) {
                                if (_tcsspn(lptstr, allowed) != _tcslen(lptstr))
                                        ok = 0;
@@ -1374,9 +1374,9 @@ static LRESULT CALLBACK ListboxProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
                count = SendMessage(hWnd, LB_GETCOUNT, 0, 0);
                compdc = CreateCompatibleDC(hdc);
                compbmp = CreateCompatibleBitmap(hdc, width, height);
-               oldbmp = SelectObject(compdc, compbmp);
+               oldbmp = (HBITMAP)SelectObject(compdc, compbmp);
                font = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0);
-               oldfont = SelectObject(compdc, font);
+               oldfont = (HFONT)SelectObject(compdc, font);
                id = GetDlgCtrlID(hWnd);
                dis.CtlType = ODT_LISTBOX;
                dis.CtlID = id;
@@ -1708,7 +1708,7 @@ static void SelectListboxLine(HWND hwnd, int x, int y)
        dbgpage[currpage].selection = index;
 }
 
-static LRESULT CALLBACK DebuggerProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK DebuggerProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 {
        HWND hwnd;
        static BOOL sizing = FALSE;
@@ -1716,7 +1716,7 @@ static LRESULT CALLBACK DebuggerProc (HWND hDlg, UINT message, WPARAM wParam, LP
        case WM_INITDIALOG:
                {
                        int newpos = 0;
-                       LONG x, y, w, h;
+                       int x, y, w, h;
                        RECT rw;
                        HFONT hfont;
                        LOGFONT lf;
similarity index 97%
rename from od-win32/dinput.c
rename to od-win32/dinput.cpp
index 913106fcc79447c0b2f9903b3a72daf4ff7368a6..269b7bb1b4083ef2cf80aeaf845435d2ba1d87df 100644 (file)
@@ -125,7 +125,7 @@ int dinput_winmousemode (void)
        return 0;
 }
 
-static isrealbutton (struct didata *did, int num)
+static int isrealbutton (struct didata *did, int num)
 {
        if (num >= did->buttons)
                return 0;
@@ -186,7 +186,7 @@ typedef UINT (CALLBACK* GETRAWINPUTDATA)
        (HRAWINPUT, UINT, LPVOID, PUINT, UINT);
 static GETRAWINPUTDATA pGetRawInputData;
 typedef UINT (CALLBACK* GETRAWINPUTDEVICELIST)
-       (PRAWINPUTDEVICEKUST, PUINT, UINT);
+       (PRAWINPUTDEVICELIST, PUINT, UINT);
 static GETRAWINPUTDEVICELIST pGetRawInputDeviceList;
 typedef UINT (CALLBACK* GETRAWINPUTDEVICEINFO)
        (HANDLE, UINT, LPVOID, PUINT);
@@ -498,7 +498,7 @@ int close_tablet (void *ctx)
 {
 #ifndef _WIN64
        if (ctx != NULL)
-               WTClose (ctx);
+               WTClose ((HCTX)ctx);
        ctx = NULL;
        if (!tablet)
                return 0;
@@ -516,7 +516,7 @@ int is_tablet (void)
 static int initialize_tablet (void)
 {
 #ifndef _WIN64
-       HANDLE h;
+       HMODULE h;
        TCHAR name[MAX_DPATH];
        struct tagAXIS ori[3];
        int tilt = 0;
@@ -736,7 +736,8 @@ static TCHAR *rawkeyboardlabels[256] =
 static int initialize_rawinput (void)
 {
        RAWINPUTDEVICELIST *ridl = 0;
-       int num = 500, gotnum, i, bufsize, vtmp;
+       UINT num = 500, vtmp;
+       int gotnum, i, bufsize;
        int rnum_mouse, rnum_kb, rnum_raw;
        TCHAR *buf = NULL;
        int rmouse = 0, rkb = 0;
@@ -762,7 +763,7 @@ static int initialize_rawinput (void)
                goto error;
 
        bufsize = 10000 * sizeof (TCHAR);
-       buf = xmalloc (bufsize);
+       buf = xmalloc (TCHAR, bufsize / sizeof (TCHAR));
 
        register_rawinput ();
        if (pGetRawInputDeviceList (NULL, &num, sizeof (RAWINPUTDEVICELIST)) != 0) {
@@ -772,7 +773,7 @@ static int initialize_rawinput (void)
        write_log (L"RAWINPUT: found %d devices\n", num);
        if (num <= 0)
                goto error2;
-       ridl = xcalloc (sizeof (RAWINPUTDEVICELIST), num);
+       ridl = xcalloc (RAWINPUTDEVICELIST, num);
        gotnum = pGetRawInputDeviceList (ridl, &num, sizeof (RAWINPUTDEVICELIST));
        if (gotnum <= 0) {
                write_log (L"RAWINPUT didn't find any devices\n");
@@ -1268,7 +1269,7 @@ static int makesort_mouse (const GUID *g, int *dwofs)
 
 static BOOL CALLBACK EnumObjectsCallback (const DIDEVICEOBJECTINSTANCE* pdidoi, VOID *pContext)
 {
-       struct didata *did = pContext;
+       struct didata *did = (struct didata*)pContext;
        int i;
        TCHAR tmp[100];
 
@@ -1402,10 +1403,10 @@ static BOOL di_enumcallback2 (LPCDIDEVICEINSTANCE lpddi, int joy)
        cleardid (did);
        if (lpddi->tszInstanceName) {
                len = _tcslen (lpddi->tszInstanceName) + 5 + 1;
-               did->name = malloc (len * sizeof (TCHAR));
+               did->name = xmalloc (TCHAR, len);
                _tcscpy (did->name, lpddi->tszInstanceName);
        } else {
-               did->name = malloc (100);
+               did->name = xmalloc (TCHAR, 100);
                _stprintf (did->name, L"[no name]");
        }
        trimws (did->name);
@@ -1431,11 +1432,11 @@ static BOOL di_enumcallback2 (LPCDIDEVICEINSTANCE lpddi, int joy)
        return DIENUM_CONTINUE;
 }
 
-static BOOL CALLBACK di_enumcallback (LPCDIDEVICEINSTANCE lpddi, LPVOID *dd)
+static BOOL CALLBACK di_enumcallback (LPCDIDEVICEINSTANCE lpddi, LPVOID dd)
 {
        return di_enumcallback2 (lpddi, 0);
 }
-static BOOL CALLBACK di_enumcallbackj (LPCDIDEVICEINSTANCE lpddi, LPVOID *dd)
+static BOOL CALLBACK di_enumcallbackj (LPCDIDEVICEINSTANCE lpddi, LPVOID dd)
 {
        return di_enumcallback2 (lpddi, 1);
 }
@@ -1466,7 +1467,7 @@ static int di_do_init (void)
                di_dev_free (&di_mouse[i]);
                di_dev_free (&di_keyboard[i]);
        }
-       hr = DirectInput8Create (hInst, DIRECTINPUT_VERSION, &IID_IDirectInput8, (LPVOID *)&g_lpdi, NULL);
+       hr = DirectInput8Create (hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID *)&g_lpdi, NULL);
        if (FAILED(hr)) {
                write_log (L"DirectInput8Create failed, %s\n", DXError (hr));
                gui_message (L"Failed to initialize DirectInput!");
@@ -1474,16 +1475,16 @@ static int di_do_init (void)
        }
        if (dinput_enum_all) {
                write_log (L"DirectInput enumeration..\n");
-               IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_ALL, di_enumcallback, 0, DIEDFL_ATTACHEDONLY);
+               g_lpdi->EnumDevices (DI8DEVCLASS_ALL, di_enumcallback, 0, DIEDFL_ATTACHEDONLY);
        } else {
                if (rawkeyboard <= 0) {
                        write_log (L"DirectInput enumeration.. Keyboards..\n");
-                       IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_KEYBOARD, di_enumcallback, 0, DIEDFL_ATTACHEDONLY);
+                       g_lpdi->EnumDevices (DI8DEVCLASS_KEYBOARD, di_enumcallback, 0, DIEDFL_ATTACHEDONLY);
                }
                write_log (L"DirectInput enumeration.. Pointing devices..\n");
-               IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_POINTER, di_enumcallback, 0, DIEDFL_ATTACHEDONLY);
+               g_lpdi->EnumDevices (DI8DEVCLASS_POINTER, di_enumcallback, 0, DIEDFL_ATTACHEDONLY);
                write_log (L"DirectInput enumeration.. Game controllers..\n");
-               IDirectInput8_EnumDevices (g_lpdi, DI8DEVCLASS_GAMECTRL, di_enumcallbackj, 0, DIEDFL_ATTACHEDONLY);
+               g_lpdi->EnumDevices (DI8DEVCLASS_GAMECTRL, di_enumcallbackj, 0, DIEDFL_ATTACHEDONLY);
        }
        write_log (L"RawInput enumeration..\n");
        initialize_rawinput ();
@@ -1593,7 +1594,7 @@ static int init_mouse (void)
        for (i = 0; i < num_mouse; i++) {
                did = &di_mouse[i];
                if (did->connection == DIDC_DX) {
-                       hr = IDirectInput8_CreateDevice (g_lpdi, &did->iguid, &lpdi, NULL);
+                       hr = g_lpdi->CreateDevice (did->iguid, &lpdi, NULL);
                        if (SUCCEEDED (hr)) {
                                hr = IDirectInputDevice8_SetDataFormat (lpdi, &c_dfDIMouse2);
                                IDirectInputDevice8_EnumObjects (lpdi, EnumObjectsCallback, (void*)did, DIDFT_ALL);
@@ -1948,9 +1949,9 @@ static int init_kb (void)
        for (i = 0; i < num_keyboard; i++) {
                struct didata *did = &di_keyboard[i];
                if (did->connection == DIDC_DX) {
-                       hr = IDirectInput8_CreateDevice (g_lpdi, &did->iguid, &lpdi, NULL);
+                       hr = g_lpdi->CreateDevice (did->iguid, &lpdi, NULL);
                        if (SUCCEEDED (hr)) {
-                               hr = IDirectInputDevice8_SetDataFormat (lpdi, &c_dfDIKeyboard);
+                               hr = lpdi->SetDataFormat (&c_dfDIKeyboard);
                                if (FAILED (hr))
                                        write_log (L"keyboard setdataformat failed, %s\n", DXError (hr));
                                memset (&dipdw, 0, sizeof (dipdw));
@@ -1959,10 +1960,10 @@ static int init_kb (void)
                                dipdw.diph.dwObj = 0;
                                dipdw.diph.dwHow = DIPH_DEVICE;
                                dipdw.dwData = DI_KBBUFFER;
-                               hr = IDirectInputDevice8_SetProperty (lpdi, DIPROP_BUFFERSIZE, &dipdw.diph);
+                               hr = lpdi->SetProperty (DIPROP_BUFFERSIZE, &dipdw.diph);
                                if (FAILED (hr))
                                        write_log (L"keyboard setpropertry failed, %s\n", DXError (hr));
-                               IDirectInputDevice8_EnumObjects (lpdi, EnumObjectsCallback, did, DIDFT_ALL);
+                               lpdi->EnumObjects (EnumObjectsCallback, did, DIDFT_ALL);
                                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;
@@ -2431,12 +2432,12 @@ static int init_joystick (void)
        for (i = 0; i < num_joystick; i++) {
                did = &di_joystick[i];
                if (did->connection == DIDC_DX) {
-                       hr = IDirectInput8_CreateDevice (g_lpdi, &did->iguid, &lpdi, NULL);
+                       hr = g_lpdi->CreateDevice (did->iguid, &lpdi, NULL);
                        if (SUCCEEDED (hr)) {
-                               hr = IDirectInputDevice8_SetDataFormat (lpdi, &c_dfDIJoystick);
+                               hr = lpdi->SetDataFormat (&c_dfDIJoystick);
                                if (SUCCEEDED (hr)) {
                                        did->lpdi = lpdi;
-                                       IDirectInputDevice8_EnumObjects (lpdi, EnumObjectsCallback, (void*)did, DIDFT_ALL);
+                                       lpdi->EnumObjects (EnumObjectsCallback, (void*)did, DIDFT_ALL);
                                        fixbuttons (did);
                                        fixthings (did);
                                        sortobjects (did, did->axismappings, did->axissort, did->axisname, did->axistype, did->axles);
index ae9bbc73ff45025903d67de9a111d88983a67145..03348e8fdcfdc35efc59aa14c21850988594c690 100644 (file)
@@ -6,8 +6,6 @@
 
 #if defined (D3D) && defined (GFXFILTER)
 
-extern "C"
-{
 #include "options.h"
 #include "xwin.h"
 #include "custom.h"
@@ -20,7 +18,6 @@ extern "C"
 #include "hq2x_d3d.h"
 #include "zfile.h"
 extern int D3DEX, d3ddebug;
-}
 
 #include <d3d9.h>
 #include <d3dx9.h>
@@ -857,7 +854,7 @@ static int createmasktexture (TCHAR *filename)
                }
        }
        size = zfile_size (zf);
-       buf = (uae_u8*)xmalloc (size);
+       buf = xmalloc (uae_u8, size);
        zfile_fread (buf, size, 1, zf);
        zfile_fclose (zf);
        hr = D3DXCreateTextureFromFileInMemoryEx (d3ddev, buf, size,
similarity index 100%
rename from od-win32/diskutil.c
rename to od-win32/diskutil.cpp
similarity index 99%
rename from od-win32/dxwrap.c
rename to od-win32/dxwrap.cpp
index 28eb233447c172a099f75ade517b1bcfaa1a2be4..7f5089ea13763f19e8d4005d2cd4e83a9584561e 100644 (file)
@@ -658,9 +658,9 @@ void DirectDraw_SurfaceUnlock (void)
        unlocksurface (getlocksurface ());
 }
 
-void *DirectDraw_GetSurfacePointer (void)
+uae_u8 *DirectDraw_GetSurfacePointer (void)
 {
-       return dxdata.locksurface.lpSurface;
+       return (uae_u8*)dxdata.locksurface.lpSurface;
 }
 DWORD DirectDraw_GetSurfacePitch (void)
 {
@@ -687,9 +687,9 @@ DWORD DirectDraw_GetPixelFormatBitMask (DirectDraw_Mask_e mask)
        }
        return result;
 }
-DWORD DirectDraw_GetPixelFormat (void)
+RGBFTYPE DirectDraw_GetPixelFormat (void)
 {
-       return DirectDraw_GetSurfacePixelFormat (&dxdata.native);
+       return (RGBFTYPE)DirectDraw_GetSurfacePixelFormat (&dxdata.native);
 }
 DWORD DirectDraw_GetBytesPerPixel (void)
 {
@@ -1173,7 +1173,7 @@ int DirectDraw_Start (GUID *guid)
                goto oops;
        }
 #else
-       ddrval = DirectDrawCreateEx (guid, &dxdata.maindd, &IID_IDirectDraw7, NULL);
+       ddrval = DirectDrawCreateEx (guid, (void**)&dxdata.maindd, IID_IDirectDraw7, NULL);
        if (FAILED (ddrval)) {
                write_log (L"DirectDrawCreateEx() failed, %s\n", DXError (ddrval));
                if (guid != NULL)
index e49257f9a78d2d5c9fdaf2e7cc4db243bbeb6cf3..2b196e3f5e300104bc35ca6e0cdad74f755e8038 100644 (file)
@@ -112,11 +112,11 @@ DWORD DirectDraw_CurrentHeight (void);
 DWORD DirectDraw_GetCurrentDepth (void);
 int DirectDraw_SurfaceLock (void);
 void DirectDraw_SurfaceUnlock (void);
-void *DirectDraw_GetSurfacePointer (void);
+uae_u8 *DirectDraw_GetSurfacePointer (void);
 DWORD DirectDraw_GetSurfacePitch (void);
 int DirectDraw_IsLocked (void);
 DWORD DirectDraw_GetPixelFormatBitMask (DirectDraw_Mask_e mask);
-DWORD DirectDraw_GetPixelFormat (void);
+RGBFTYPE DirectDraw_GetPixelFormat (void);
 DWORD DirectDraw_GetBytesPerPixel (void);
 HRESULT DirectDraw_GetDC(HDC *hdc);
 HRESULT DirectDraw_ReleaseDC(HDC hdc);
similarity index 100%
rename from od-win32/fdrawcmd.c
rename to od-win32/fdrawcmd.cpp
similarity index 91%
rename from od-win32/fsdb_mywin32.c
rename to od-win32/fsdb_mywin32.cpp
index 384d9ee9730e97f5a52c2d6f6b8449fec3e580da..30662da82106b28a7aea0606670f5f5ced14383c 100644 (file)
@@ -32,7 +32,7 @@ static int recycle (const TCHAR *name)
        } else {
                SHFILEOPSTRUCT fos;
                /* name must be terminated by \0\0 */
-               TCHAR *p = xcalloc ((_tcslen (name) + 2) * sizeof (TCHAR), 1);
+               TCHAR *p = xcalloc (TCHAR, _tcslen (name) + 2);
                int v;
 
                _tcscpy (p, name);
@@ -63,7 +63,7 @@ static int recycle (const TCHAR *name)
 
 int my_rmdir (const TCHAR *name)
 {
-       void *od;
+       struct my_opendir_s *od;
        int cnt;
        TCHAR tname[MAX_DPATH];
 
@@ -100,20 +100,20 @@ int my_rename (const TCHAR *oldname, const TCHAR *newname)
        return MoveFile (oldname, newname) == 0 ? -1 : 0;
 }
 
-struct my_opendirs {
-       HANDLE *h;
+struct my_opendir_s {
+       HANDLE h;
        WIN32_FIND_DATA fd;
        int first;
 };
 
-void *my_opendir (const TCHAR *name)
+struct my_opendir_s *my_opendir (const TCHAR *name)
 {
-       struct my_opendirs *mod;
+       struct my_opendir_s *mod;
        TCHAR tmp[MAX_DPATH];
 
        _tcscpy (tmp, name);
        _tcscat (tmp, L"\\*.*");
-       mod = xmalloc (sizeof (struct my_opendirs));
+       mod = xmalloc (struct my_opendir_s, 1);
        if (!mod)
                return NULL;
        mod->h = FindFirstFile(tmp, &mod->fd);
@@ -125,17 +125,15 @@ void *my_opendir (const TCHAR *name)
        return mod;
 }
 
-void my_closedir (void *d)
+void my_closedir (struct my_opendir_s *mod)
 {
-       struct my_opendirs *mod = d;
-       if (d)
+       if (mod)
                FindClose (mod->h);
        xfree (mod);
 }
 
-int my_readdir (void *d, TCHAR *name)
+int my_readdir (struct my_opendir_s *mod, TCHAR *name)
 {
-       struct my_opendirs *mod = d;
        if (mod->first) {
                _tcscpy (name, mod->fd.cFileName);
                mod->first = 0;
@@ -147,20 +145,18 @@ int my_readdir (void *d, TCHAR *name)
        return 1;
 }
 
-struct my_opens {
-       HANDLE *h;
+struct my_openfile_s {
+       HANDLE h;
 };
 
-void my_close (void *d)
+void my_close (struct my_openfile_s *mos)
 {
-       struct my_opens *mos = d;
        CloseHandle (mos->h);
        xfree (mos);
 }
 
-uae_s64 int my_lseek (void *d, uae_s64 int offset, int whence)
+uae_s64 int my_lseek (struct my_openfile_s *mos, uae_s64 int offset, int whence)
 {
-       struct my_opens *mos = d;
        LARGE_INTEGER li;
 
        li.QuadPart = offset;
@@ -171,17 +167,15 @@ uae_s64 int my_lseek (void *d, uae_s64 int offset, int whence)
        return li.QuadPart;
 }
 
-unsigned int my_read (void *d, void *b, unsigned int size)
+unsigned int my_read (struct my_openfile_s *mos, void *b, unsigned int size)
 {
-       struct my_opens *mos = d;
        DWORD read = 0;
        ReadFile (mos->h, b, size, &read, NULL);
        return read;
 }
 
-unsigned int my_write (void *d, void *b, unsigned int size)
+unsigned int my_write (struct my_openfile_s *mos, void *b, unsigned int size)
 {
-       struct my_opens *mos = d;
        DWORD written = 0;
        WriteFile (mos->h, b, size, &written, NULL);
        return written;
@@ -217,9 +211,9 @@ int my_existsdir (const TCHAR *name)
        return 0;
 }
 
-void *my_open (const TCHAR *name, int flags)
+struct my_openfile_s *my_open (const TCHAR *name, int flags)
 {
-       struct my_opens *mos;
+       struct my_openfile_s *mos;
        HANDLE h;
        DWORD DesiredAccess = GENERIC_READ;
        DWORD ShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
@@ -227,7 +221,7 @@ void *my_open (const TCHAR *name, int flags)
        DWORD FlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
        DWORD attr;
 
-       mos = xmalloc (sizeof (struct my_opens));
+       mos = xmalloc (struct my_openfile_s, 1);
        if (!mos)
                return NULL;
        attr = GetFileAttributesSafe (name);
similarity index 94%
rename from od-win32/fsdb_win32.c
rename to od-win32/fsdb_win32.cpp
index 4f4bfccdf272b61ecebb287c5a62938b442e6729..73d79a10575a2a36ca11f9d2af667360953db30b 100644 (file)
@@ -60,7 +60,7 @@ static TCHAR *make_uaefsdbpath (const TCHAR *dir, const TCHAR *name)
        if (name)
                len += 1 + _tcslen (name);
        len += 1 + _tcslen (FSDB_FILE);
-       p = xmalloc (len * sizeof (TCHAR));
+       p = xmalloc (TCHAR, len);
        if (!p)
                return NULL;
        if (name)
@@ -91,9 +91,9 @@ static int read_uaefsdb (const TCHAR *dir, const TCHAR *name, uae_u8 *fsdb)
                        if (fsdb_debug) {
                                TCHAR *an, *nn, *co;
                                write_log (L"->ok\n");
-                               an = aucp (fsdb + 5, currprefs.win32_fscodepage);
-                               nn = aucp (fsdb + 262, currprefs.win32_fscodepage);
-                               co = aucp (fsdb + 519, currprefs.win32_fscodepage);
+                               an = aucp ((char*)fsdb + 5, currprefs.win32_fscodepage);
+                               nn = aucp ((char*)fsdb + 262, currprefs.win32_fscodepage);
+                               co = aucp ((char*)fsdb + 519, currprefs.win32_fscodepage);
                                write_log (L"v=%02x flags=%08x an='%s' nn='%s' c='%s'\n",
                                        fsdb[0], ((uae_u32*)(fsdb+1))[0], an, nn, co);
                                xfree (co);
@@ -148,9 +148,9 @@ static int write_uaefsdb (const TCHAR *dir, uae_u8 *fsdb)
                NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
        if (fsdb_debug) {
                TCHAR *an, *nn, *co;
-               an = aucp (fsdb + 5, currprefs.win32_fscodepage);
-               nn = aucp (fsdb + 262, currprefs.win32_fscodepage);
-               co = aucp (fsdb + 519, currprefs.win32_fscodepage);
+               an = aucp ((char*)fsdb + 5, currprefs.win32_fscodepage);
+               nn = aucp ((char*)fsdb + 262, currprefs.win32_fscodepage);
+               co = aucp ((char*)fsdb + 519, currprefs.win32_fscodepage);
                write_log (L"write_uaefsdb '%s' = %x\n", p, h);
                write_log (L"v=%02x flags=%08x an='%s' nn='%s' c='%s'\n",
                        fsdb[0], ((uae_u32*)(fsdb+1))[0], an, nn, co);
@@ -206,16 +206,16 @@ static void create_uaefsdb (a_inode *aino, uae_u8 *buf, int winmode)
        buf[0] = 1;
        do_put_mem_long ((uae_u32 *)(buf + 1), aino->amigaos_mode);
        s = uacp (aino->aname, currprefs.win32_fscodepage);
-       strncpy (buf + 5, s, 256);
+       strncpy ((char*)buf + 5, s, 256);
        buf[5 + 256] = '\0';
        xfree (s);
        nn = nname_begin (aino->nname);
        s = uacp (nn, currprefs.win32_fscodepage);
-       strncpy (buf + 5 + 257, s, 256);
+       strncpy ((char*)buf + 5 + 257, s, 256);
        buf[5 + 257 + 256] = '\0';
        xfree (s);
        s = uacp (aino->comment ? aino->comment : L"", currprefs.win32_fscodepage);
-       strncpy (buf + 5 + 2 * 257, s, 80);
+       strncpy ((char*)buf + 5 + 2 * 257, s, 80);
        buf[5 + 2 * 257 + 80] = '\0';
        xfree (s);
        do_put_mem_long ((uae_u32 *)(buf + 5 + 2 * 257 + 81), winmode);
@@ -227,7 +227,7 @@ static void create_uaefsdb (a_inode *aino, uae_u8 *buf, int winmode)
 static a_inode *aino_from_buf (a_inode *base, uae_u8 *buf, int *winmode)
 {
        uae_u32 mode;
-       a_inode *aino = xcalloc (sizeof (a_inode), 1);
+       a_inode *aino = xcalloc (a_inode, 1);
        uae_u8 *buf2;
        TCHAR *s;
 
@@ -237,19 +237,19 @@ static a_inode *aino_from_buf (a_inode *base, uae_u8 *buf, int *winmode)
        if (buf2[0]) {
                aino->aname = my_strdup ((TCHAR*)buf2);
        } else {
-               aino->aname = aucp (buf, currprefs.win32_fscodepage);
+               aino->aname = aucp ((char*)buf, currprefs.win32_fscodepage);
        }
        buf += 257;
        buf2 += 257 * 2;
        if (buf2[0]) {
                aino->nname = build_nname (base->nname, (TCHAR*)buf2);
        } else {
-               s = aucp (buf, currprefs.win32_fscodepage);
+               s = aucp ((char*)buf, currprefs.win32_fscodepage);
                aino->nname = build_nname (base->nname, s);
                xfree (s);
        }
        buf += 257;
-       aino->comment = *buf != '\0' ? my_strdup_ansi (buf) : 0;
+       aino->comment = *buf != '\0' ? my_strdup_ansi ((char*)buf) : 0;
        buf += 81;
        aino->amigaos_mode = mode;
        *winmode = do_get_mem_long ((uae_u32 *)buf);
@@ -365,7 +365,7 @@ int fsdb_fill_file_attrs (a_inode *base, a_inode *aino)
                xfree (aino->comment);
                aino->comment = NULL;
                if (fsdb[5 + 2 * 257])
-                       aino->comment = my_strdup_ansi (fsdb + 5 + 2 * 257);
+                       aino->comment = my_strdup_ansi ((char*)fsdb + 5 + 2 * 257);
                xfree (aino_from_buf (base, fsdb, &winmode));
                if (winmode == mode) /* no Windows-side editing? */
                        return 1;
@@ -552,7 +552,7 @@ static a_inode *custom_fsdb_lookup_aino (a_inode *base, const TCHAR *aname, int
        if (h != INVALID_HANDLE_VALUE) {
                do {
                        if (read_uaefsdb (base->nname, fd.cFileName, fsdb)) {
-                               TCHAR *s = au (fsdb + offset);
+                               TCHAR *s = au ((char*)fsdb + offset);
                                if (same_aname (s, aname)) {
                                        int winmode;
                                        FindClose (h);
index e179c9d1271a380f0e191784c2de721300c226d4..2c379292ee08d8726e9b513d365cbb937a14a275 100644 (file)
                        Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
                        >
                        <File
-                               RelativePath="..\..\blitops.c"
+                               RelativePath="..\..\blitops.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\genblitter.c"
+                               RelativePath="..\..\genblitter.cpp"
                                >
                        </File>
                </Filter>
index f59602ce7f82c973dd8fbbacdd66e7feed854cdf..7e8cb44b12a499414a4141fa224c0f0db2342ac7 100644 (file)
     <PreLinkEvent>
       <Message>deleting blitter files</Message>
       <Command>del ..\..\blit.h
-del ..\..\blitfunc.c
+del ..\..\blitfunc.cpp
 del ..\..\blitfunc.h
-del ..\..\blittable.c
-</Command>
+del ..\..\blittable.cpp</Command>
     </PreLinkEvent>
     <Link>
       <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
@@ -119,9 +118,10 @@ del ..\..\blittable.c
     <PostBuildEvent>
       <Message>generating blitter files</Message>
       <Command>genblitter.exe i &gt;..\..\blit.h
-genblitter.exe f &gt;..\..\blitfunc.c
+genblitter.exe f &gt;..\..\blitfunc.cpp
 genblitter.exe h &gt;..\..\blitfunc.h
-genblitter.exe t &gt;..\..\blittable.c
+genblitter.exe t &gt;..\..\blittable.cpp
+del genblitter.exe
 </Command>
     </PostBuildEvent>
   </ItemDefinitionGroup>
@@ -280,8 +280,8 @@ genblitter.exe t &gt;..\..\blittable.c
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\blitops.c" />
-    <ClCompile Include="..\..\genblitter.c" />
+    <ClCompile Include="..\..\blitops.cpp" />
+    <ClCompile Include="..\..\genblitter.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index e8d1afe0b6e2a9d00ebc14c06d8cc4cfa051246d..a91d1e804a5d27b8431677888f5409baa35d6666 100644 (file)
@@ -7,10 +7,10 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\blitops.c">
+    <ClCompile Include="..\..\blitops.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\genblitter.c">
+    <ClCompile Include="..\..\genblitter.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
index b305bb5253e8e758674f1a50466552cf192290e3..0f37a2e8c034f0234de904b5645213880dd752e1 100644 (file)
                        Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
                        >
                        <File
-                               RelativePath="..\..\cpudefs.c"
+                               RelativePath="..\..\cpudefs.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\jit\gencomp.c"
+                               RelativePath="..\..\jit\gencomp.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\missing.c"
+                               RelativePath="..\..\missing.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\readcpu.c"
+                               RelativePath="..\..\readcpu.cpp"
                                >
                        </File>
                </Filter>
index 40f2b3fd19bf2b2c6863bf7f722a36b5bbdb5a96..88ee243fcabefc6f546989494049a7871f8c06e7 100644 (file)
       <Message>generating gencomp files</Message>
       <Command>cd ..\..
 od-win32\gencomp_msvc\gencomp.exe
+del od-win32\gencomp_msvc\gencomp.exe
+
 </Command>
     </PostBuildEvent>
   </ItemDefinitionGroup>
@@ -243,10 +245,10 @@ od-win32\gencomp_msvc\gencomp.exe
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\cpudefs.c" />
-    <ClCompile Include="..\..\jit\gencomp.c" />
-    <ClCompile Include="..\..\missing.c" />
-    <ClCompile Include="..\..\readcpu.c" />
+    <ClCompile Include="..\..\cpudefs.cpp" />
+    <ClCompile Include="..\..\jit\gencomp.cpp" />
+    <ClCompile Include="..\..\missing.cpp" />
+    <ClCompile Include="..\..\readcpu.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index dc77363cb0401f86b4edadf5a309fb923b9dffd9..21011b42317720df0a1804528a14f424b4e3d506 100644 (file)
@@ -7,16 +7,16 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\cpudefs.c">
+    <ClCompile Include="..\..\cpudefs.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\jit\gencomp.c">
+    <ClCompile Include="..\..\jit\gencomp.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\missing.c">
+    <ClCompile Include="..\..\missing.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\readcpu.c">
+    <ClCompile Include="..\..\readcpu.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
diff --git a/od-win32/gencpu_msvc/gencpu.exe.manifest b/od-win32/gencpu_msvc/gencpu.exe.manifest
deleted file mode 100644 (file)
index 11bb704..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
-  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
-    <security>
-      <requestedPrivileges>
-        <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
-      </requestedPrivileges>
-    </security>
-  </trustInfo>
-</assembly>
\ No newline at end of file
index 9e3660efcd8b325c104ef3b9df52a76af1c54d79..44b91ccf49bec16110b7b18c12b516cffd40ba4c 100644 (file)
                        Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
                        >
                        <File
-                               RelativePath="..\..\cpudefs.c"
+                               RelativePath="..\..\cpudefs.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\gencpu.c"
+                               RelativePath="..\..\gencpu.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\missing.c"
+                               RelativePath="..\..\missing.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\readcpu.c"
+                               RelativePath="..\..\readcpu.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\unicode.c"
+                               RelativePath="..\unicode.cpp"
                                >
                        </File>
                </Filter>
index 4cddf6115efc88c77e3db1c93efffce1e5ffae7d..5f5ac7bb9d51ad39e129d47a533a9513147895fe 100644 (file)
@@ -151,8 +151,9 @@ od-win32\gencpu_msvc\gencpu.exe
     <PreLinkEvent>
       <Message>deleting gencpu files</Message>
       <Command>del ..\..\cputbl.h
-del ..\..\cpustbl.c
-del ..\..\cpuemu.c
+del ..\..\cpustbl.cpp
+del ..\..\cpuemu.cpp
+
 </Command>
     </PreLinkEvent>
     <Link>
@@ -169,6 +170,7 @@ del ..\..\cpuemu.c
       <Message>generating gencpu files</Message>
       <Command>cd ..\..
 od-win32\gencpu_msvc\gencpu.exe
+del od-win32\gencpu_msvc\gencpu.exe
 </Command>
     </PostBuildEvent>
   </ItemDefinitionGroup>
@@ -267,11 +269,11 @@ od-win32\gencpu_msvc\gencpu.exe
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\cpudefs.c" />
-    <ClCompile Include="..\..\gencpu.c" />
-    <ClCompile Include="..\..\missing.c" />
-    <ClCompile Include="..\..\readcpu.c" />
-    <ClCompile Include="..\unicode.c" />
+    <ClCompile Include="..\..\cpudefs.cpp" />
+    <ClCompile Include="..\..\gencpu.cpp" />
+    <ClCompile Include="..\..\missing.cpp" />
+    <ClCompile Include="..\..\readcpu.cpp" />
+    <ClCompile Include="..\unicode.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index c707f41dce2fd95344e62f7821199b115541d316..6365f2c8d82ed5604aa03e9f69448c4731ba8aa7 100644 (file)
@@ -7,19 +7,19 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\cpudefs.c">
+    <ClCompile Include="..\..\cpudefs.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\gencpu.c">
+    <ClCompile Include="..\..\gencpu.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\missing.c">
+    <ClCompile Include="..\..\missing.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\readcpu.c">
+    <ClCompile Include="..\..\readcpu.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\unicode.c">
+    <ClCompile Include="..\unicode.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
index 6e4d076fc8cf9a2e12316e395b1b1f2bda39c2ed..aa2dc089b6456b122cab682b3953ee146a0b1b0e 100644 (file)
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="deleteing linetoscr.c"
-                               CommandLine="del ..\..\linetoscr.c"
+                               Description="deleteing linetoscr.cpp"
+                               CommandLine="del ..\..\linetoscr.cpp"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPostBuildEventTool"
-                               Description="generating linetoscr.c"
-                               CommandLine="genlinetoscr.exe &gt;..\..\linetoscr.c"
+                               Description="generating linetoscr.cpp"
+                               CommandLine="genlinetoscr.exe &gt;..\..\linetoscr.cpp"
                        />
                </Configuration>
                <Configuration
                        />
                        <Tool
                                Name="VCPreLinkEventTool"
-                               Description="deleteing linetoscr.c"
-                               CommandLine="del ..\..\linetoscr.c"
+                               Description="deleteing linetoscr.cpp"
+                               CommandLine="del ..\..\linetoscr.cpp"
                        />
                        <Tool
                                Name="VCLinkerTool"
                        />
                        <Tool
                                Name="VCPostBuildEventTool"
-                               Description="generating linetoscr.c"
-                               CommandLine="genlinetoscr.exe &gt;..\..\linetoscr.c"
+                               Description="generating linetoscr.cpp"
+                               CommandLine="genlinetoscr.exe &gt;..\..\linetoscr.cpp"
                        />
                </Configuration>
        </Configurations>
                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
                        >
                        <File
-                               RelativePath="..\..\genlinetoscr.c"
+                               RelativePath="..\..\genlinetoscr.cpp"
                                >
                        </File>
                </Filter>
index 3ed1075c6da41decd1ad9c8acb1bd85b0d9aa19d..b07c1ec64a586362c58bbf05524a54b3e407cf6a 100644 (file)
@@ -95,8 +95,9 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <PreLinkEvent>
-      <Message>deleteing linetoscr.c</Message>
-      <Command>del ..\..\linetoscr.c</Command>
+      <Message>deleteing linetoscr.cpp</Message>
+      <Command>del ..\..\linetoscr.cpp
+</Command>
     </PreLinkEvent>
     <Link>
       <OutputFile>genlinetoscr.exe</OutputFile>
     </Link>
     <PostBuildEvent>
       <Message>generating linetoscr.c</Message>
-      <Command>genlinetoscr.exe &gt;..\..\linetoscr.c</Command>
+      <Command>genlinetoscr.exe &gt;..\..\linetoscr.cpp
+del genlinetoscr.exe
+</Command>
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='FullRelease|Win32'">
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\genlinetoscr.c" />
+    <ClCompile Include="..\..\genlinetoscr.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index 7f375d7438f73bd37ec7dd08e496f5c96c5bccb4..469cf00b980d096518713af5cd6aba74018675ce 100644 (file)
@@ -7,7 +7,7 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\genlinetoscr.c">
+    <ClCompile Include="..\..\genlinetoscr.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
similarity index 93%
rename from od-win32/hardfile_win32.c
rename to od-win32/hardfile_win32.cpp
index c5f69cb40ec4c68ad7be6d2f1526784c33791c9f..29e9dd8fcf585a84ab63a27f394dbb8ef51d4206 100644 (file)
 
 static int usefloppydrives = 0;
 
+struct hardfilehandle
+{
+       int zfile;
+       struct zfile *zf;
+       HANDLE h;
+};
+
 struct uae_driveinfo {
        TCHAR vendor_id[128];
        TCHAR product_id[128];
@@ -73,7 +80,7 @@ static int isnomediaerr (DWORD err)
        return 0;
 }
 
-static void rdbdump (HANDLE *h, uae_u64 offset, uae_u8 *buf, int blocksize)
+static void rdbdump (HANDLE h, uae_u64 offset, uae_u8 *buf, int blocksize)
 {
        static int cnt = 1;
        int i, blocks;
@@ -88,7 +95,8 @@ static void rdbdump (HANDLE *h, uae_u64 offset, uae_u8 *buf, int blocksize)
        if (!f)
                return;
        for (i = 0; i <= blocks; i++) {
-               DWORD outlen, high;
+               DWORD outlen;
+               LONG high;
                high = (DWORD)(offset >> 32);
                if (SetFilePointer (h, (DWORD)offset, &high, FILE_BEGIN) == INVALID_FILE_SIZE)
                        break;
@@ -108,7 +116,7 @@ static int getsignfromhandle (HANDLE h, DWORD *sign, DWORD *pstyle)
 
        ok = 0; 
        outsize = sizeof (DRIVE_LAYOUT_INFORMATION_EX) + sizeof (PARTITION_INFORMATION_EX) * 32;
-       dli = xmalloc (outsize);
+       dli = (DRIVE_LAYOUT_INFORMATION_EX*)xmalloc (uae_u8, outsize);
        if (DeviceIoControl (h, IOCTL_DISK_GET_DRIVE_LAYOUT_EX, NULL, 0, dli, outsize, &written, NULL)) {
                *sign = dli->Mbr.Signature;
                *pstyle = dli->PartitionStyle;
@@ -154,7 +162,7 @@ static int ismounted (HANDLE hd)
                                        isntfs = 1;
                                }
                                outsize = sizeof (VOLUME_DISK_EXTENTS) + sizeof (DISK_EXTENT) * 32;
-                               vde = xmalloc (outsize);
+                               vde = (VOLUME_DISK_EXTENTS*)xmalloc (uae_u8, outsize);
                                if (DeviceIoControl (d, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, NULL, 0, vde, outsize, &written, NULL)) {
                                        int i;
                                        for (i = 0; i < vde->NumberOfDiskExtents; i++) {
@@ -186,13 +194,14 @@ static int ismounted (HANDLE hd)
 }
 
 #define CA "Commodore\0Amiga\0"
-static int safetycheck (HANDLE *h, const TCHAR *name, uae_u64 offset, uae_u8 *buf, int blocksize)
+static int safetycheck (HANDLE h, const TCHAR *name, uae_u64 offset, uae_u8 *buf, int blocksize)
 {
        int i, j, blocks = 63, empty = 1;
-       DWORD outlen, high;
+       DWORD outlen;
+       LONG high;
 
        for (j = 0; j < blocks; j++) {
-               high = (DWORD)(offset >> 32);
+               high = (LONG)(offset >> 32);
                if (SetFilePointer (h, (DWORD)offset, &high, FILE_BEGIN) == INVALID_FILE_SIZE) {
                        write_log (L"hd ignored, SetFilePointer failed, error %d\n", GetLastError ());
                        return 1;
@@ -238,7 +247,7 @@ static int safetycheck (HANDLE *h, const TCHAR *name, uae_u64 offset, uae_u8 *bu
                        int match = 0;
                        if (fkey) {
                                int idx = 0;
-                               DWORD size, size2;
+                               int size, size2;
                                TCHAR tmp2[MAX_DPATH], tmp[MAX_DPATH];
                                for (;;) {
                                        size = sizeof (tmp) / sizeof (TCHAR);
@@ -336,7 +345,7 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname)
        hfd->flags = 0;
        hfd->drive_empty = 0;
        hdf_close (hfd);
-       hfd->cache = VirtualAlloc (NULL, CACHE_SIZE, MEM_COMMIT, PAGE_READWRITE);
+       hfd->cache = (uae_u8*)VirtualAlloc (NULL, CACHE_SIZE, MEM_COMMIT, PAGE_READWRITE);
        hfd->cache_valid = 0;
        hfd->virtual_size = 0;
        hfd->virtual_rdb = NULL;
@@ -344,6 +353,8 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname)
                write_log (L"VirtualAlloc(%d) failed, error %d\n", CACHE_SIZE, GetLastError ());
                goto end;
        }
+       hfd->handle = xcalloc (struct hardfilehandle, 1);
+       hfd->handle->h = INVALID_HANDLE_VALUE;
        hfd_log (L"hfd open: '%s'\n", name);
        if (_tcslen (name) > 4 && !_tcsncmp (name, L"HD_", 3)) {
                hdf_init_target ();
@@ -361,7 +372,7 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname)
                                GENERIC_READ | (hfd->readonly ? 0 : GENERIC_WRITE),
                                FILE_SHARE_READ | (hfd->readonly ? 0 : FILE_SHARE_WRITE),
                                NULL, OPEN_EXISTING, flags, NULL);
-                       hfd->handle = h;
+                       hfd->handle->h = h;
                        if (h == INVALID_HANDLE_VALUE)
                                goto end;
                        if (!DeviceIoControl(h, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, &r, NULL))
@@ -373,7 +384,7 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname)
                        hfd->physsize = hfd->virtsize = udi->size;
                        hfd->blocksize = udi->bytespersector;
                        if (hfd->offset == 0 && !hfd->drive_empty) {
-                               int sf = safetycheck (hfd->handle, udi->device_path, 0, hfd->cache, hfd->blocksize);
+                               int sf = safetycheck (hfd->handle->h, udi->device_path, 0, hfd->cache, hfd->blocksize);
                                if (sf > 0)
                                        goto end;
                                if (sf == 0 && !hfd->readonly && harddrive_dangerous != 0x1234dead) {
@@ -385,7 +396,7 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname)
                                                GENERIC_READ,
                                                FILE_SHARE_READ | FILE_SHARE_WRITE,
                                                NULL, OPEN_EXISTING, flags, NULL);
-                                       hfd->handle = h;
+                                       hfd->handle->h = h;
                                        if (h == INVALID_HANDLE_VALUE)
                                                goto end;
                                        if (!DeviceIoControl(h, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, &r, NULL))
@@ -428,7 +439,7 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname)
                }
                h = CreateFile (name, GENERIC_READ | (hfd->readonly ? 0 : GENERIC_WRITE), hfd->readonly ? FILE_SHARE_READ : 0, NULL,
                        OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
-               hfd->handle = h;
+               hfd->handle->h = h;
                i = _tcslen (name) - 1;
                while (i >= 0) {
                        if ((i > 0 && (name[i - 1] == '/' || name[i - 1] == '\\')) || i == 0) {
@@ -440,33 +451,35 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname)
                        i--;
                }
                if (h != INVALID_HANDLE_VALUE) {
-                       DWORD ret, low, high;
-                       high = 0;
+                       DWORD ret, low;
+                       LONG high = 0;
+                       DWORD high2;
                        ret = SetFilePointer (h, 0, &high, FILE_END);
                        if (ret == INVALID_FILE_SIZE && GetLastError () != NO_ERROR)
                                goto end;
-                       low = GetFileSize (h, &high);
+                       low = GetFileSize (h, &high2);
                        if (low == INVALID_FILE_SIZE && GetLastError () != NO_ERROR)
                                goto end;
                        low &= ~(hfd->blocksize - 1);
-                       hfd->physsize = hfd->virtsize = ((uae_u64)high << 32) | low;
+                       hfd->physsize = hfd->virtsize = ((uae_u64)high2 << 32) | low;
                        hfd->handle_valid = HDF_HANDLE_WIN32;
                        if (hfd->physsize < 64 * 1024 * 1024 && zmode) {
                                write_log (L"HDF '%s' re-opened in zfile-mode\n", name);
                                CloseHandle (h);
-                               hfd->handle = h = zfile_fopen(name, hfd->readonly ? L"rb" : L"r+b", ZFD_NORMAL);
+                               hfd->handle->h = INVALID_HANDLE_VALUE;
+                               hfd->handle->zf = zfile_fopen(name, hfd->readonly ? L"rb" : L"r+b", ZFD_NORMAL);
+                               hfd->handle->zfile = 1;
                                if (!h)
                                        goto end;
-                               zfile_fseek (h, 0, SEEK_END);
-                               hfd->physsize = hfd->virtsize = zfile_ftell (h);
-                               zfile_fseek (h, 0, SEEK_SET);
+                               zfile_fseek (hfd->handle->zf, 0, SEEK_END);
+                               hfd->physsize = hfd->virtsize = zfile_ftell (hfd->handle->zf);
+                               zfile_fseek (hfd->handle->zf, 0, SEEK_SET);
                                hfd->handle_valid = HDF_HANDLE_ZFILE;
                        }
                } else {
                        write_log (L"HDF '%s' failed to open. error = %d\n", name, GetLastError ());
                }
        }
-       hfd->handle = h;
        if (hfd->handle_valid || hfd->drive_empty) {
                hfd_log (L"HDF '%s' opened, size=%dK mode=%d empty=%d\n",
                        name, hfd->physsize / 1024, hfd->handle_valid, hfd->drive_empty);
@@ -478,19 +491,26 @@ end:
        return 0;
 }
 
+static void freehandle (struct hardfilehandle *h)
+{
+       if (!h)
+               return;
+       if (!h->zfile && h->h != INVALID_HANDLE_VALUE)
+               CloseHandle (h->h);
+       if (h->zfile && h->zf)
+               zfile_fclose (h->zf);
+       h->zf = NULL;
+       h->h = INVALID_HANDLE_VALUE;
+       h->zfile = 0;
+}
+
 void hdf_close_target (struct hardfiledata *hfd)
 {
-       if (hfd->handle_valid) {
-               if (hfd->handle && hfd->handle != INVALID_HANDLE_VALUE) {
-                       if (hfd->handle_valid == HDF_HANDLE_WIN32)
-                               CloseHandle (hfd->handle);
-                       else if(hfd->handle_valid == HDF_HANDLE_ZFILE)
-                               zfile_fclose (hfd->handle);
-               }
-       }
+       freehandle (hfd->handle);
+       xfree (hfd->handle);
        xfree (hfd->emptyname);
        hfd->emptyname = NULL;
-       hfd->handle = 0;
+       hfd->handle = NULL;
        hfd->handle_valid = 0;
        if (hfd->cache)
                VirtualFree (hfd->cache, 0, MEM_RELEASE);
@@ -507,21 +527,23 @@ int hdf_dup_target (struct hardfiledata *dhfd, const struct hardfiledata *shfd)
 {
        if (!shfd->handle_valid)
                return 0;
+       freehandle (dhfd->handle);
        if (shfd->handle_valid == HDF_HANDLE_WIN32) {
                HANDLE duphandle;
-               if (!DuplicateHandle (GetCurrentProcess (), shfd->handle, GetCurrentProcess () , &duphandle, 0, FALSE, DUPLICATE_SAME_ACCESS))
+               if (!DuplicateHandle (GetCurrentProcess (), shfd->handle->h, GetCurrentProcess () , &duphandle, 0, FALSE, DUPLICATE_SAME_ACCESS))
                        return 0;
-               dhfd->handle = duphandle;
+               dhfd->handle->h = duphandle;
                dhfd->handle_valid = HDF_HANDLE_WIN32;
        } else if (shfd->handle_valid == HDF_HANDLE_ZFILE) {
                struct zfile *zf;
-               zf = zfile_dup (shfd->handle);
+               zf = zfile_dup (shfd->handle->zf);
                if (!zf)
                        return 0;
-               dhfd->handle = zf;
+               dhfd->handle->zf = zf;
+               dhfd->handle->zfile = 1;
                dhfd->handle_valid = HDF_HANDLE_ZFILE;
        }
-       dhfd->cache = VirtualAlloc (NULL, CACHE_SIZE, MEM_COMMIT, PAGE_READWRITE);
+       dhfd->cache = (uae_u8*)VirtualAlloc (NULL, CACHE_SIZE, MEM_COMMIT, PAGE_READWRITE);
        dhfd->cache_valid = 0;
        if (!dhfd->cache) {
                hdf_close (dhfd);
@@ -532,7 +554,7 @@ int hdf_dup_target (struct hardfiledata *dhfd, const struct hardfiledata *shfd)
 
 static int hdf_seek (struct hardfiledata *hfd, uae_u64 offset)
 {
-       DWORD high, ret;
+       DWORD ret;
 
        if (hfd->handle_valid == 0) {
                gui_message (L"hd: hdf handle is not valid. bug.");
@@ -549,24 +571,24 @@ static int hdf_seek (struct hardfiledata *hfd, uae_u64 offset)
                abort ();
        }
        if (hfd->handle_valid == HDF_HANDLE_WIN32) {
-               high = (DWORD)(offset >> 32);
-               ret = SetFilePointer (hfd->handle, (DWORD)offset, &high, FILE_BEGIN);
+               LONG high = (LONG)(offset >> 32);
+               ret = SetFilePointer (hfd->handle->h, (DWORD)offset, &high, FILE_BEGIN);
                if (ret == INVALID_FILE_SIZE && GetLastError() != NO_ERROR)
                        return -1;
        } else if (hfd->handle_valid == HDF_HANDLE_ZFILE) {
-               zfile_fseek (hfd->handle, (long)offset, SEEK_SET);
+               zfile_fseek (hfd->handle->zf, (long)offset, SEEK_SET);
        }
        return 0;
 }
 
 static void poscheck (struct hardfiledata *hfd, int len)
 {
-       DWORD high, ret, err;
+       DWORD ret, err;
        uae_u64 pos;
 
        if (hfd->handle_valid == HDF_HANDLE_WIN32) {
-               high = 0;
-               ret = SetFilePointer (hfd->handle, 0, &high, FILE_CURRENT);
+               LONG high = 0;
+               ret = SetFilePointer (hfd->handle->h, 0, &high, FILE_CURRENT);
                err = GetLastError ();
                if (ret == INVALID_FILE_SIZE && err != NO_ERROR) {
                        gui_message (L"hd: poscheck failed. seek failure, error %d", err);
@@ -574,7 +596,7 @@ static void poscheck (struct hardfiledata *hfd, int len)
                }
                pos = ((uae_u64)high) << 32 | ret;
        } else if (hfd->handle_valid == HDF_HANDLE_ZFILE) {
-               pos = zfile_ftell (hfd->handle);
+               pos = zfile_ftell (hfd->handle->zf);
        }
        if (len < 0) {
                gui_message (L"hd: poscheck failed, negative length! (%d)", len);
@@ -727,9 +749,9 @@ static int hdf_read_2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset, i
        hdf_seek (hfd, hfd->cache_offset);
        poscheck (hfd, CACHE_SIZE);
        if (hfd->handle_valid == HDF_HANDLE_WIN32)
-               ReadFile (hfd->handle, hfd->cache, CACHE_SIZE, &outlen, NULL);
+               ReadFile (hfd->handle->h, hfd->cache, CACHE_SIZE, &outlen, NULL);
        else if (hfd->handle_valid == HDF_HANDLE_ZFILE)
-               outlen = zfile_fread (hfd->cache, 1, CACHE_SIZE, hfd->handle);
+               outlen = zfile_fread (hfd->cache, 1, CACHE_SIZE, hfd->handle->zf);
        hfd->cache_valid = 0;
        if (outlen != CACHE_SIZE)
                return 0;
@@ -747,7 +769,7 @@ static int hdf_read_2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset, i
 int hdf_read_target (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len)
 {
        int got = 0;
-       uae_u8 *p = buffer;
+       uae_u8 *p = (uae_u8*)buffer;
 
        if (hfd->drive_empty)
                return 0;
@@ -760,16 +782,17 @@ int hdf_read_target (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int
        }
        offset -= hfd->virtual_size;
        while (len > 0) {
-               int ret, maxlen;
+               int maxlen;
+               DWORD ret;
                if (hfd->physsize < CACHE_SIZE) {
                        hfd->cache_valid = 0;
                        hdf_seek (hfd, offset);
                        poscheck (hfd, len);
                        if (hfd->handle_valid == HDF_HANDLE_WIN32) {
-                               ReadFile (hfd->handle, hfd->cache, len, &ret, NULL);
+                               ReadFile (hfd->handle->h, hfd->cache, len, &ret, NULL);
                                memcpy (buffer, hfd->cache, ret);
                        } else if (hfd->handle_valid == HDF_HANDLE_ZFILE) {
-                               ret = zfile_fread (buffer, 1, len, hfd->handle);
+                               ret = zfile_fread (buffer, 1, len, hfd->handle->zf);
                        }
                        maxlen = len;
                } else {
@@ -799,15 +822,15 @@ static int hdf_write_2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset,
        poscheck (hfd, len);
        memcpy (hfd->cache, buffer, len);
        if (hfd->handle_valid == HDF_HANDLE_WIN32)
-               WriteFile (hfd->handle, hfd->cache, len, &outlen, NULL);
+               WriteFile (hfd->handle->h, hfd->cache, len, &outlen, NULL);
        else if (hfd->handle_valid == HDF_HANDLE_ZFILE)
-               outlen = zfile_fwrite (hfd->cache, 1, len, hfd->handle);
+               outlen = zfile_fwrite (hfd->cache, 1, len, hfd->handle->zf);
        return outlen;
 }
 int hdf_write_target (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len)
 {
        int got = 0;
-       uae_u8 *p = buffer;
+       uae_u8 *p = (uae_u8*)buffer;
 
        if (hfd->drive_empty)
                return 0;
@@ -816,7 +839,7 @@ int hdf_write_target (struct hardfiledata *hfd, void *buffer, uae_u64 offset, in
        offset -= hfd->virtual_size;
        while (len > 0) {
                int maxlen = len > CACHE_SIZE ? CACHE_SIZE : len;
-               int ret = hdf_write_2(hfd, p, offset, maxlen);
+               int ret = hdf_write_2 (hfd, p, offset, maxlen);
                if (ret < 0)
                        return ret;
                got += ret;
@@ -836,16 +859,16 @@ int hdf_resize_target (struct hardfiledata *hfd, uae_u64 newsize)
 
        if (newsize >= 0x80000000) {
                highword = (DWORD)(newsize >> 32);
-               ret = SetFilePointer (hfd->handle, (DWORD)newsize, &highword, FILE_BEGIN);
+               ret = SetFilePointer (hfd->handle->h, (DWORD)newsize, &highword, FILE_BEGIN);
        } else {
-               ret = SetFilePointer (hfd->handle, (DWORD)newsize, NULL, FILE_BEGIN);
+               ret = SetFilePointer (hfd->handle->h, (DWORD)newsize, NULL, FILE_BEGIN);
        }
        err = GetLastError ();
        if (ret == INVALID_SET_FILE_POINTER && err != NO_ERROR) {
                write_log (L"hdf_resize_target: SetFilePointer() %d\n", err);
                return 0;
        }
-       if (SetEndOfFile (hfd->handle)) {
+       if (SetEndOfFile (hfd->handle->h)) {
                hfd->physsize = newsize;
                return 1;
        }
@@ -1261,7 +1284,7 @@ static BOOL GetDeviceProperty(HDEVINFO IntDevInfo, DWORD Index, DWORD *index2, u
        //
 
        interfaceDetailDataSize = reqSize;
-       interfaceDetailData = malloc (interfaceDetailDataSize);
+       interfaceDetailData = (PSP_DEVICE_INTERFACE_DETAIL_DATA)xmalloc (uae_u8, interfaceDetailDataSize);
        if (interfaceDetailData == NULL) {
                write_log (L"Unable to allocate memory to get the interface detail data.\n");
                ret = 0;
@@ -1314,7 +1337,7 @@ static int hdf_init2 (int force)
        done = 1;
        num_drives = 0;
 #ifdef WINDDK
-       buffer = VirtualAlloc (NULL, 65536, MEM_COMMIT, PAGE_READWRITE);
+       buffer = (uae_u8*)VirtualAlloc (NULL, 65536, MEM_COMMIT, PAGE_READWRITE);
        if (buffer) {
                errormode = SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
                memset (uae_drives, 0, sizeof (uae_drives));
@@ -1452,7 +1475,7 @@ TCHAR *hdf_getnameharddrive (int index, int flags, int *sectorsize, int *dangero
 
 static int hmc (struct hardfiledata *hfd)
 {
-       uae_u8 *buf = xmalloc (hfd->blocksize);
+       uae_u8 *buf = xmalloc (uae_u8, hfd->blocksize);
        DWORD ret, got, err, status;
        int first = 1;
 
@@ -1461,8 +1484,8 @@ static int hmc (struct hardfiledata *hfd)
                write_log (L"testing if %s has media inserted\n", hfd->emptyname);
                status = 0;
                errormode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
-               SetFilePointer (hfd->handle, 0, NULL, FILE_BEGIN);
-               ret = ReadFile (hfd->handle, buf, hfd->blocksize, &got, NULL);
+               SetFilePointer (hfd->handle->h, 0, NULL, FILE_BEGIN);
+               ret = ReadFile (hfd->handle->h, buf, hfd->blocksize, &got, NULL);
                err = GetLastError ();
                SetErrorMode(errormode);
                if (ret) {
similarity index 100%
rename from od-win32/hq2x_d3d.c
rename to od-win32/hq2x_d3d.cpp
similarity index 99%
rename from od-win32/ioport.c
rename to od-win32/ioport.cpp
index 6dc1cd05ceeb48e259a7bd42b06d1f5c4d5acf95..322fa1d3d1305d4591beb13406ce3582d2295ec9 100644 (file)
@@ -8,7 +8,9 @@
 #define io_log
 #define para_log write_log
 
+#ifndef __cplusplus
 typedef int bool;
+#endif
 
 #include <windows.h>
 #include "win32.h"
similarity index 100%
rename from od-win32/ipctester.c
rename to od-win32/ipctester.cpp
similarity index 96%
rename from od-win32/lcd.c
rename to od-win32/lcd.cpp
index b4e20016312f42d5d8fdd5c659fe2d1a3d141d59..d4646bff619d0860b640cf92216a9d4dfd043e7e 100644 (file)
@@ -66,10 +66,10 @@ static int lcd_init (void)
                lcd_close ();
                return 0;
        }
-       lbh = xcalloc (1, sizeof (lgLcdBitmapHeader) + desc.Width * (desc.Height + 20));
+       lbh = (lgLcdBitmapHeader*)xcalloc (uae_u8, sizeof (lgLcdBitmapHeader) + desc.Width * (desc.Height + 20));
        lbh->Format = LGLCD_BMP_FORMAT_160x43x1;
        bitmap = (uae_u8*)lbh + sizeof (lgLcdBitmapHeader);
-       origbitmap = xcalloc (1, desc.Width * desc.Height);
+       origbitmap = xcalloc (uae_u8, desc.Width * desc.Height);
        memset (&octx, 0, sizeof (octx));
        octx.connection = cctx.connection;
        octx.index = 0;
similarity index 98%
rename from od-win32/midi.c
rename to od-win32/midi.cpp
index 9001261ce079d13ae8b9d740f95368c7b6d63f3a..7afc9510684db75e9b27548ee8579106a1503e95 100644 (file)
@@ -72,7 +72,7 @@ static uae_u8 *outbuffer[MIDI_BUFFERS] = { 0, 0 };
 static long outbufferlength[MIDI_BUFFERS] = { 0, 0 };
 static int outbufferselect = 0;
 static int out_allocated = 0;
-static volatile exitin = 0;
+static volatile int exitin = 0;
 static CRITICAL_SECTION cs_proc;
 /*
 * FUNCTION:   getmidiouterr
@@ -120,7 +120,7 @@ static int MidiOut_Alloc(void)
        if(!out_allocated) {
                for(i = 0; i < MIDI_BUFFERS; i++) {
                        if(!outbuffer[i]) {
-                               outbuffer[i] = (char*)xmalloc(BUFFLEN);
+                               outbuffer[i] = xmalloc(uae_u8, BUFFLEN);
                                if(outbuffer[i]) {
                                        outbufferlength[i] = BUFFLEN;
                                        out_allocated++;
@@ -252,7 +252,7 @@ static int MidiIn_Alloc(void)
        if(!in_allocated)  {
                for(i = 0; i < MIDI_INBUFFERS; i++)  {
                        if(!inbuffer[i]) {
-                               inbuffer[i] = (char*)xmalloc(INBUFFLEN);
+                               inbuffer[i] = xmalloc(uae_u8, INBUFFLEN);
                                if(inbuffer[i]) {
                                        inbufferlength[i] = INBUFFLEN;
                                        in_allocated++;
@@ -364,7 +364,7 @@ int Midi_Parse(midi_direction_e direction, BYTE *dataptr)
                                                bufferindex = BUFFLEN - 1;
                                        out_status.status = MIDI_SYSX;
                                        // Flush this buffer using midiOutLongMsg
-                                       MidiOut_PrepareHeader(&midiout[outbufferselect], bufferpoint, bufferindex);
+                                       MidiOut_PrepareHeader(&midiout[outbufferselect], (LPSTR)bufferpoint, bufferindex);
                                        midiOutLongMsg(outHandle, &midiout[outbufferselect], sizeof(MIDIHDR));
                                        outbufferselect = !outbufferselect;
                                        bufferpoint = outbuffer[outbufferselect];
@@ -634,7 +634,7 @@ int Midi_Open(void)
                                        midi_in_ready = FALSE;
                                } else {
                                        for (i = 0;i < MIDI_INBUFFERS; i++) {
-                                               midiin[i].lpData = inbuffer[i];
+                                               midiin[i].lpData = (LPSTR)inbuffer[i];
                                                midiin[i].dwBufferLength = INBUFFLEN - 1;
                                                midiin[i].dwBytesRecorded = INBUFFLEN - 1;
                                                midiin[i].dwUser = 0;
similarity index 100%
rename from od-win32/midiin.c
rename to od-win32/midiin.cpp
diff --git a/od-win32/mman.c b/od-win32/mman.c
deleted file mode 100644 (file)
index db66736..0000000
+++ /dev/null
@@ -1,689 +0,0 @@
-// Implement mprotect() for Win32
-// Copyright (C) 2000, Brian King
-// GNU Public License
-
-#include <float.h>
-
-#include "sysconfig.h"
-#include "sysdeps.h"
-#include "sys/mman.h"
-#include "memory.h"
-#include "options.h"
-#include "autoconf.h"
-#include "win32.h"
-
-#if defined(NATMEM_OFFSET)
-
-#define BARRIER 32
-#define MAXZ3MEM 0x7F000000
-#define MAXZ3MEM64 0xF0000000
-
-static struct shmid_ds shmids[MAX_SHMID];
-static int memwatchok = 0;
-uae_u8 *natmem_offset, *natmem_offset_end;
-static uae_u8 *p96mem_offset;
-static int p96mem_size;
-static SYSTEM_INFO si;
-int maxmem;
-
-static void *virtualallocwithlock (LPVOID addr, SIZE_T size, DWORD allocationtype, DWORD protect)
-{
-       void *p = VirtualAlloc (addr, size, allocationtype, protect);
-       return p;
-}
-static void virtualfreewithlock (LPVOID addr, SIZE_T size, DWORD freetype)
-{
-       VirtualFree(addr, size, freetype);
-}
-
-void cache_free (void *cache)
-{
-       virtualfreewithlock (cache, 0, MEM_RELEASE);
-}
-
-void *cache_alloc (int size)
-{
-       return virtualallocwithlock (NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
-}
-
-#if 0
-static void setworkingset(void)
-{
-       typedef BOOL (CALLBACK* SETPROCESSWORKINGSETSIZE)(HANDLE,SIZE_T,SIZE_T);
-       SETPROCESSWORKINGSETSIZE pSetProcessWorkingSetSize;
-       pSetProcessWorkingSetSize = (SETPROCESSWORKINGSETSIZE)GetProcAddress(GetModuleHandle("kernal32.dll", "GetProcessWorkingSetSize");
-       if (!pSetProcessWorkingSetSize)
-               return;
-       pSetProcessWorkingSetSize(GetCurrentProcess (),
-               );
-#endif
-
-       static uae_u32 lowmem (void)
-       {
-               uae_u32 change = 0;
-               if (currprefs.z3fastmem_size + currprefs.z3fastmem2_size >= 8 * 1024 * 1024) {
-                       if (currprefs.z3fastmem2_size) {
-                               if (currprefs.z3fastmem2_size <= 128 * 1024 * 1024) {
-                                       change = currprefs.z3fastmem2_size;
-                                       currprefs.z3fastmem2_size = 0;
-                               } else {
-                                       change = currprefs.z3fastmem2_size / 2;
-                                       currprefs.z3fastmem2_size >>= 1;
-                                       changed_prefs.z3fastmem2_size = currprefs.z3fastmem2_size;
-                               }
-                       } else {
-                               change = currprefs.z3fastmem_size - currprefs.z3fastmem_size / 4;
-                               currprefs.z3fastmem2_size = changed_prefs.z3fastmem2_size = currprefs.z3fastmem_size / 4;
-                               currprefs.z3fastmem_size >>= 1;
-                               changed_prefs.z3fastmem_size = currprefs.z3fastmem_size;
-                       }
-               } else if (currprefs.gfxmem_size >= 1 * 1024 * 1024) {
-                       change = currprefs.gfxmem_size - currprefs.gfxmem_size / 2;
-                       currprefs.gfxmem_size >>= 1;
-                       changed_prefs.gfxmem_size = currprefs.gfxmem_size;
-               }
-               if (currprefs.z3fastmem2_size < 128 * 1024 * 1024)
-                       currprefs.z3fastmem2_size = changed_prefs.z3fastmem2_size = 0;
-               return change;
-       }
-
-       typedef UINT (CALLBACK* GETWRITEWATCH)
-               (DWORD,PVOID,SIZE_T,PVOID*,PULONG_PTR,PULONG);
-#define TEST_SIZE (2 * 4096)
-       static int testwritewatch (void)
-       {
-               GETWRITEWATCH pGetWriteWatch;
-               void *mem;
-               void *pages[16];
-               ULONG_PTR gwwcnt;
-               ULONG ps;
-               int ret = 0;
-
-               ps = si.dwPageSize;
-
-               pGetWriteWatch = (GETWRITEWATCH)GetProcAddress (GetModuleHandle (L"kernel32.dll"), "GetWriteWatch");
-               if (pGetWriteWatch == NULL) {
-                       write_log (L"GetWriteWatch(): missing!?\n");
-                       return 0;
-               }
-               mem = VirtualAlloc (NULL, TEST_SIZE, MEM_RESERVE | MEM_WRITE_WATCH, PAGE_EXECUTE_READWRITE);
-               if (mem == NULL) {
-                       write_log (L"GetWriteWatch(): MEM_WRITE_WATCH not supported!? err=%d\n", GetLastError());
-                       return 0;
-               }
-               if (VirtualAlloc (mem, TEST_SIZE, MEM_COMMIT, PAGE_EXECUTE_READWRITE) == NULL) {
-                       write_log (L"GetWriteWatch(): test memory area MEM_COMMIT failed!? err=%d\n", GetLastError());
-                       goto end;
-               }
-               ResetWriteWatch (mem, TEST_SIZE);
-               ((uae_u8*)mem)[1] = 0;
-               gwwcnt = TEST_SIZE / ps;
-               if (GetWriteWatch (WRITE_WATCH_FLAG_RESET, mem, TEST_SIZE, pages, &gwwcnt, &ps)) {
-                       write_log (L"GetWriteWatch(): failed!? err=%d\n", GetLastError ());
-                       goto end;
-               }
-               if (ps != si.dwPageSize) {
-                       write_log (L"GetWriteWatch(): pagesize %d != %d!?\n", si.dwPageSize, ps);
-                       goto end;
-               }
-               if (gwwcnt != 1) {
-                       write_log (L"GetWriteWatch(): modified pages returned %d != 1!?\n", gwwcnt);
-                       goto end;
-               }
-               if (pages[0] != mem) {
-                       write_log (L"GetWriteWatch(): modified page was wrong!?\n");
-                       goto end;
-               }
-               write_log (L"GetWriteWatch() test ok\n");
-               ret = 1;
-               memwatchok = 1;
-end:
-               if (mem) {
-                       VirtualFree (mem, TEST_SIZE, MEM_DECOMMIT);
-                       VirtualFree (mem, 0, MEM_RELEASE);
-               }
-               return ret;
-       }
-
-       static uae_u8 *memwatchtable;
-
-       int mman_GetWriteWatch (PVOID lpBaseAddress, SIZE_T dwRegionSize, PVOID *lpAddresses, PULONG_PTR lpdwCount, PULONG lpdwGranularity)
-       {
-               int i, j, off;
-
-               if (memwatchok)
-                       return GetWriteWatch (0, lpBaseAddress, dwRegionSize, lpAddresses, lpdwCount, lpdwGranularity);
-               j = 0;
-               off = ((uae_u8*)lpBaseAddress - (natmem_offset + p96ram_start)) / si.dwPageSize;
-               for (i = 0; i < dwRegionSize / si.dwPageSize; i++) {
-                       if (j >= *lpdwCount)
-                               break;
-                       if (memwatchtable[off + i])
-                               lpAddresses[j++] = (uae_u8*)lpBaseAddress + i * si.dwPageSize;
-               }
-               *lpdwCount = j;
-               *lpdwGranularity = si.dwPageSize;
-               return 0;
-       }
-       void mman_ResetWatch (PVOID lpBaseAddress, SIZE_T dwRegionSize)
-       {
-               if (memwatchok) {
-                       if (ResetWriteWatch (lpBaseAddress, dwRegionSize))
-                               write_log (L"ResetWriteWatch() failed, %d\n", GetLastError ());
-               } else {
-                       DWORD op;
-                       memset (memwatchtable, 0, p96mem_size / si.dwPageSize);
-                       if (!VirtualProtect (lpBaseAddress, dwRegionSize, PAGE_READWRITE | PAGE_GUARD, &op))
-                               write_log (L"VirtualProtect() failed, err=%d\n", GetLastError ());
-               }
-       }
-
-       int mman_guard_exception (LPEXCEPTION_POINTERS p)
-       {
-               PEXCEPTION_RECORD record = p->ExceptionRecord;
-               PCONTEXT context = p->ContextRecord;
-               ULONG_PTR addr = record->ExceptionInformation[1];
-               int rw = record->ExceptionInformation[0];
-               ULONG_PTR p96addr = (ULONG_PTR)p96mem_offset;
-
-               if (memwatchok)
-                       return EXCEPTION_CONTINUE_SEARCH;
-               if (addr < p96addr || addr >= p96addr + p96mem_size)
-                       return EXCEPTION_CONTINUE_EXECUTION;
-               addr -= p96addr;
-               addr /= si.dwPageSize;
-               memwatchtable[addr] = 1;
-               return EXCEPTION_CONTINUE_EXECUTION;
-       }
-
-       static uae_u64 size64;
-       typedef BOOL (CALLBACK* GLOBALMEMORYSTATUSEX)(LPMEMORYSTATUSEX);
-
-       void preinit_shm (void)
-       {
-               int i;
-               uae_u64 total64;
-               uae_u64 totalphys64;
-               MEMORYSTATUS memstats;
-               GLOBALMEMORYSTATUSEX pGlobalMemoryStatusEx;
-               MEMORYSTATUSEX memstatsex;
-               uae_u32 max_allowed_mman;
-
-               GetSystemInfo (&si);
-               max_allowed_mman = 1536;
-               if (os_64bit)
-                       max_allowed_mman = 2048;
-
-               memstats.dwLength = sizeof(memstats);
-               GlobalMemoryStatus(&memstats);
-               totalphys64 = memstats.dwTotalPhys;
-               total64 = (uae_u64)memstats.dwAvailPageFile + (uae_u64)memstats.dwTotalPhys;
-               pGlobalMemoryStatusEx = (GLOBALMEMORYSTATUSEX)GetProcAddress (GetModuleHandle (L"kernel32.dll"), "GlobalMemoryStatusEx");
-               if (pGlobalMemoryStatusEx) {
-                       memstatsex.dwLength = sizeof (MEMORYSTATUSEX);
-                       if (pGlobalMemoryStatusEx(&memstatsex)) {
-                               totalphys64 = memstatsex.ullTotalPhys;
-                               total64 = memstatsex.ullAvailPageFile + memstatsex.ullTotalPhys;
-                       }
-               }
-               size64 = total64;
-               if (maxmem < 0)
-                       size64 = MAXZ3MEM;
-               else if (maxmem > 0)
-                       size64 = maxmem * 1024 * 1024;
-               if (os_64bit) {
-                       if (size64 > MAXZ3MEM64)
-                               size64 = MAXZ3MEM64;
-               } else {
-                       if (size64 > MAXZ3MEM)
-                               size64 = MAXZ3MEM;
-               }
-               if (size64 < 8 * 1024 * 1024)
-                       size64 = 8 * 1024 * 1024;
-               if (max_allowed_mman * 1024 * 1024 > size64)
-                       max_allowed_mman = size64 / (1024 * 1024);
-               max_z3fastmem = max_allowed_mman * 1024 * 1024;
-               if (max_z3fastmem < 512 * 1024 * 1024)
-                       max_z3fastmem = 512 * 1024 * 1024;
-
-               shm_start = 0;
-               for (i = 0; i < MAX_SHMID; i++) {
-                       shmids[i].attached = 0;
-                       shmids[i].key = -1;
-                       shmids[i].size = 0;
-                       shmids[i].addr = NULL;
-                       shmids[i].name[0] = 0;
-               }
-
-               write_log (L"Max Z3FastRAM %dM. Total physical RAM %uM\n", max_z3fastmem >> 20, totalphys64 >> 20);
-               testwritewatch ();
-               canbang = 1;
-       }
-
-       static void resetmem (void)
-       {
-               int i;
-
-               if (!shm_start)
-                       return;
-               for (i = 0; i < MAX_SHMID; i++) {
-                       struct shmid_ds *s = &shmids[i];
-                       int size = s->size;
-                       uae_u8 *shmaddr;
-                       uae_u8 *result;
-
-                       if (!s->attached)
-                               continue;
-                       if (!s->natmembase)
-                               continue;
-                       shmaddr = natmem_offset + ((uae_u8*)s->attached - (uae_u8*)s->natmembase);
-                       result = virtualallocwithlock (shmaddr, size, MEM_COMMIT, s->mode);
-                       if (result != shmaddr)
-                               write_log (L"NATMEM: realloc(%p,%d,%d) failed, err=%x\n", shmaddr, size, s->mode, GetLastError ());
-                       else
-                               write_log (L"NATMEM: rellocated(%p,%d,%s)\n", shmaddr, size, s->name);
-               }
-       }
-
-       int init_shm (void)
-       {
-               uae_u32 size, totalsize, z3size, natmemsize, rtgbarrier, rtgextra;
-               int rounds = 0;
-
-restart:
-               for (;;) {
-                       int lowround = 0;
-                       LPVOID blah = NULL;
-                       if (rounds > 0)
-                               write_log (L"NATMEM: retrying %d..\n", rounds);
-                       rounds++;
-                       if (natmem_offset)
-                               VirtualFree(natmem_offset, 0, MEM_RELEASE);
-                       natmem_offset = NULL;
-                       natmem_offset_end = NULL;
-                       canbang = 0;
-
-                       z3size = 0;
-                       size = 0x1000000;
-                       rtgextra = 0;
-                       rtgbarrier = si.dwPageSize;
-                       if (currprefs.cpu_model >= 68020)
-                               size = 0x10000000;
-                       if (currprefs.z3fastmem_size || currprefs.z3fastmem2_size) {
-                               z3size = currprefs.z3fastmem_size + currprefs.z3fastmem2_size + (currprefs.z3fastmem_start - 0x10000000);
-                               if (currprefs.gfxmem_size)
-                                       rtgbarrier = 16 * 1024 * 1024;
-                       } else {
-                               rtgbarrier = 0;
-                       }
-                       totalsize = size + z3size + currprefs.gfxmem_size;
-                       while (totalsize > size64) {
-                               int change = lowmem ();
-                               if (!change)
-                                       return 0;
-                               write_log (L"NATMEM: %d, %dM > %dM = %dM\n", ++lowround, totalsize >> 20, size64 >> 20, (totalsize - change) >> 20);
-                               totalsize -= change;
-                       }
-                       if ((rounds > 1 && totalsize < 0x10000000) || rounds > 20) {
-                               write_log (L"NATMEM: No special area could be allocated (3)!\n");
-                               return 0;
-                       }
-                       natmemsize = size + z3size;
-
-                       xfree (memwatchtable);
-                       memwatchtable = 0;
-                       if (currprefs.gfxmem_size) {
-                               if (!memwatchok) {
-                                       write_log (L"GetWriteWatch() not supported, using guard pages, RTG performance will be slower.\n");
-                                       memwatchtable = xcalloc (currprefs.gfxmem_size / si.dwPageSize + 1, 1);
-                               }
-                       }
-                       if (currprefs.gfxmem_size) {
-                               rtgextra = si.dwPageSize;
-                       } else {
-                               rtgbarrier = 0;
-                               rtgextra = 0;
-                       }
-                       blah = VirtualAlloc (NULL, natmemsize + rtgbarrier + currprefs.gfxmem_size + rtgextra + 16 * si.dwPageSize, MEM_RESERVE, PAGE_READWRITE);
-                       if (blah) {
-                               natmem_offset = blah;
-                               break;
-                       }
-                       write_log (L"NATMEM: %dM area failed to allocate, err=%d (Z3=%dM,RTG=%dM)\n",
-                               natmemsize >> 20, GetLastError (), (currprefs.z3fastmem_size + currprefs.z3fastmem2_size) >> 20, currprefs.gfxmem_size >> 20);
-                       if (!lowmem ()) {
-                               write_log (L"NATMEM: No special area could be allocated (2)!\n");
-                               return 0;
-                       }
-               }
-               p96mem_size = currprefs.gfxmem_size;
-               if (p96mem_size) {
-                       VirtualFree (natmem_offset, 0, MEM_RELEASE);
-                       if (!VirtualAlloc (natmem_offset, natmemsize + rtgbarrier, MEM_RESERVE, PAGE_READWRITE)) {
-                               write_log (L"VirtualAlloc() part 2 error %d. RTG disabled.\n", GetLastError ());
-                               currprefs.gfxmem_size = changed_prefs.gfxmem_size = 0;
-                               rtgbarrier = si.dwPageSize;
-                               rtgextra = 0;
-                               goto restart;
-                       }
-                       p96mem_offset = VirtualAlloc (natmem_offset + natmemsize + rtgbarrier, p96mem_size + rtgextra,
-                               MEM_RESERVE | (memwatchok == 1 ? MEM_WRITE_WATCH : 0), PAGE_READWRITE);
-                       if (!p96mem_offset) {
-                               currprefs.gfxmem_size = changed_prefs.gfxmem_size = 0;
-                               write_log (L"NATMEM: failed to allocate special Picasso96 GFX RAM, err=%d\n", GetLastError ());
-                       }
-               }
-
-               if (!natmem_offset) {
-                       write_log (L"NATMEM: No special area could be allocated! (1) err=%d\n", GetLastError ());
-               } else {
-                       write_log (L"NATMEM: Our special area: 0x%p-0x%p (%08x %dM)\n",
-                               natmem_offset, (uae_u8*)natmem_offset + natmemsize,
-                               natmemsize, natmemsize >> 20);
-                       if (currprefs.gfxmem_size)
-                               write_log (L"NATMEM: P96 special area: 0x%p-0x%p (%08x %dM)\n",
-                               p96mem_offset, (uae_u8*)p96mem_offset + currprefs.gfxmem_size,
-                               currprefs.gfxmem_size, currprefs.gfxmem_size >> 20);
-                       canbang = 1;
-                       natmem_offset_end = p96mem_offset + currprefs.gfxmem_size;
-               }
-
-               resetmem ();
-
-               return canbang;
-       }
-
-
-       void mapped_free (uae_u8 *mem)
-       {
-               shmpiece *x = shm_start;
-
-               if (mem == filesysory) {
-                       while(x) {
-                               if (mem == x->native_address) {
-                                       int shmid = x->id;
-                                       shmids[shmid].key = -1;
-                                       shmids[shmid].name[0] = '\0';
-                                       shmids[shmid].size = 0;
-                                       shmids[shmid].attached = 0;
-                                       shmids[shmid].mode = 0;
-                                       shmids[shmid].natmembase = 0;
-                               }
-                               x = x->next;
-                       }
-                       return;
-               }
-
-               while(x) {
-                       if(mem == x->native_address)
-                               shmdt (x->native_address);
-                       x = x->next;
-               }
-               x = shm_start;
-               while(x) {
-                       struct shmid_ds blah;
-                       if (mem == x->native_address) {
-                               if (shmctl (x->id, IPC_STAT, &blah) == 0)
-                                       shmctl (x->id, IPC_RMID, &blah);
-                       }
-                       x = x->next;
-               }
-       }
-
-       static key_t get_next_shmkey (void)
-       {
-               key_t result = -1;
-               int i;
-               for (i = 0; i < MAX_SHMID; i++) {
-                       if (shmids[i].key == -1) {
-                               shmids[i].key = i;
-                               result = i;
-                               break;
-                       }
-               }
-               return result;
-       }
-
-       STATIC_INLINE key_t find_shmkey (key_t key)
-       {
-               int result = -1;
-               if(shmids[key].key == key) {
-                       result = key;
-               }
-               return result;
-       }
-
-       int mprotect (void *addr, size_t len, int prot)
-       {
-               int result = 0;
-               return result;
-       }
-
-       void *shmat (int shmid, void *shmaddr, int shmflg)
-       {
-               void *result = (void *)-1;
-               BOOL got = FALSE;
-               int p96special = FALSE;
-               DWORD protect = PAGE_READWRITE;
-
-#ifdef NATMEM_OFFSET
-               unsigned int size = shmids[shmid].size;
-
-               if (shmids[shmid].attached)
-                       return shmids[shmid].attached;
-
-               if ((uae_u8*)shmaddr < natmem_offset) {
-                       if(!_tcscmp (shmids[shmid].name, L"chip")) {
-                               shmaddr=natmem_offset;
-                               got = TRUE;
-                               if (currprefs.fastmem_size == 0 || currprefs.chipmem_size < 2 * 1024 * 1024)
-                                       size += BARRIER;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"kick")) {
-                               shmaddr=natmem_offset + 0xf80000;
-                               got = TRUE;
-                               size += BARRIER;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"rom_a8")) {
-                               shmaddr=natmem_offset + 0xa80000;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"rom_e0")) {
-                               shmaddr=natmem_offset + 0xe00000;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"rom_f0")) {
-                               shmaddr=natmem_offset + 0xf00000;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"rtarea")) {
-                               shmaddr=natmem_offset + rtarea_base;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"fast")) {
-                               shmaddr=natmem_offset + 0x200000;
-                               got = TRUE;
-                               size += BARRIER;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"ramsey_low")) {
-                               shmaddr=natmem_offset + a3000lmem_start;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"ramsey_high")) {
-                               shmaddr=natmem_offset + a3000hmem_start;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"z3")) {
-                               shmaddr=natmem_offset + currprefs.z3fastmem_start;
-                               if (!currprefs.z3fastmem2_size)
-                                       size += BARRIER;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"z3_2")) {
-                               shmaddr=natmem_offset + currprefs.z3fastmem_start + currprefs.z3fastmem_size;
-                               size += BARRIER;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"gfx")) {
-                               got = TRUE;
-                               p96special = TRUE;
-                               p96ram_start = p96mem_offset - natmem_offset;
-                               shmaddr = natmem_offset + p96ram_start;
-                               size += BARRIER;
-                               if (!memwatchok)
-                                       protect |= PAGE_GUARD;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"bogo")) {
-                               shmaddr=natmem_offset+0x00C00000;
-                               got = TRUE;
-                               if (currprefs.bogomem_size <= 0x100000)
-                                       size += BARRIER;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"filesys")) {
-                               static uae_u8 *filesysptr;
-                               if (filesysptr == NULL)
-                                       filesysptr = xcalloc (size, 1);
-                               result = filesysptr;
-                               shmids[shmid].attached = result;
-                               return result;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"custmem1")) {
-                               shmaddr=natmem_offset + currprefs.custom_memory_addrs[0];
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"custmem2")) {
-                               shmaddr=natmem_offset + currprefs.custom_memory_addrs[1];
-                               got = TRUE;
-                       }
-
-                       if(!_tcscmp (shmids[shmid].name, L"hrtmem")) {
-                               shmaddr=natmem_offset + 0x00a10000;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"arhrtmon")) {
-                               shmaddr=natmem_offset + 0x00800000;
-                               size += BARRIER;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"xpower_e2")) {
-                               shmaddr=natmem_offset + 0x00e20000;
-                               size += BARRIER;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"xpower_f2")) {
-                               shmaddr=natmem_offset + 0x00f20000;
-                               size += BARRIER;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"nordic_f0")) {
-                               shmaddr=natmem_offset + 0x00f00000;
-                               size += BARRIER;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"nordic_f4")) {
-                               shmaddr=natmem_offset + 0x00f40000;
-                               size += BARRIER;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"nordic_f6")) {
-                               shmaddr=natmem_offset + 0x00f60000;
-                               size += BARRIER;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp(shmids[shmid].name, L"superiv_b0")) {
-                               shmaddr=natmem_offset + 0x00b00000;
-                               size += BARRIER;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"superiv_d0")) {
-                               shmaddr=natmem_offset + 0x00d00000;
-                               size += BARRIER;
-                               got = TRUE;
-                       }
-                       if(!_tcscmp (shmids[shmid].name, L"superiv_e0")) {
-                               shmaddr=natmem_offset + 0x00e00000;
-                               size += BARRIER;
-                               got = TRUE;
-                       }
-               }
-#endif
-
-               if (shmids[shmid].key == shmid && shmids[shmid].size) {
-                       shmids[shmid].mode = protect;
-                       shmids[shmid].natmembase = natmem_offset;
-                       if (shmaddr)
-                               virtualfreewithlock (shmaddr, size, MEM_DECOMMIT);
-                       result = virtualallocwithlock (shmaddr, size, MEM_COMMIT, protect);
-                       if (result == NULL) {
-                               result = (void*)-1;
-                               write_log (L"VirtualAlloc %08X - %08X %x (%dk) failed %d\n",
-                                       (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size,
-                                       size, size >> 10, GetLastError ());
-                       } else {
-                               shmids[shmid].attached = result;
-                               write_log (L"VirtualAlloc %08X - %08X %x (%dk) ok%s\n",
-                                       (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size,
-                                       size, size >> 10, p96special ? L" P96" : L"");
-                       }
-               }
-               return result;
-       }
-
-       int shmdt (const void *shmaddr)
-       {
-               return 0;
-       }
-
-       int shmget (key_t key, size_t size, int shmflg, const TCHAR *name)
-       {
-               int result = -1;
-
-               if((key == IPC_PRIVATE) || ((shmflg & IPC_CREAT) && (find_shmkey (key) == -1))) {
-                       write_log (L"shmget of size %d (%dk) for %s\n", size, size >> 10, name);
-                       if ((result = get_next_shmkey ()) != -1) {
-                               shmids[result].size = size;
-                               _tcscpy (shmids[result].name, name);
-                       } else {
-                               result = -1;
-                       }
-               }
-               return result;
-       }
-
-       int shmctl (int shmid, int cmd, struct shmid_ds *buf)
-       {
-               int result = -1;
-
-               if ((find_shmkey (shmid) != -1) && buf) {
-                       switch (cmd)
-                       {
-                       case IPC_STAT:
-                               *buf = shmids[shmid];
-                               result = 0;
-                               break;
-                       case IPC_RMID:
-                               VirtualFree (shmids[shmid].attached, shmids[shmid].size, MEM_DECOMMIT);
-                               shmids[shmid].key = -1;
-                               shmids[shmid].name[0] = '\0';
-                               shmids[shmid].size = 0;
-                               shmids[shmid].attached = 0;
-                               shmids[shmid].mode = 0;
-                               result = 0;
-                               break;
-                       }
-               }
-               return result;
-       }
-
-#endif
-
-       int isinf (double x)
-       {
-               const int nClass = _fpclass (x);
-               int result;
-               if (nClass == _FPCLASS_NINF || nClass == _FPCLASS_PINF)
-                       result = 1;
-               else
-                       result = 0;
-               return result;
-       }
diff --git a/od-win32/mman.cpp b/od-win32/mman.cpp
new file mode 100644 (file)
index 0000000..625aa21
--- /dev/null
@@ -0,0 +1,690 @@
+// Implement mprotect() for Win32
+// Copyright (C) 2000, Brian King
+// GNU Public License
+
+#include <float.h>
+
+#include "sysconfig.h"
+#include "sysdeps.h"
+#include "sys/mman.h"
+#include "memory.h"
+#include "options.h"
+#include "autoconf.h"
+#include "win32.h"
+
+#if defined(NATMEM_OFFSET)
+
+#define BARRIER 32
+#define MAXZ3MEM 0x7F000000
+#define MAXZ3MEM64 0xF0000000
+
+static struct shmid_ds shmids[MAX_SHMID];
+static int memwatchok = 0;
+uae_u8 *natmem_offset, *natmem_offset_end;
+static uae_u8 *p96mem_offset;
+static int p96mem_size;
+static SYSTEM_INFO si;
+int maxmem;
+
+static uae_u8 *virtualallocwithlock (LPVOID addr, SIZE_T size, DWORD allocationtype, DWORD protect)
+{
+       uae_u8 *p = (uae_u8*)VirtualAlloc (addr, size, allocationtype, protect);
+       return p;
+}
+static void virtualfreewithlock (LPVOID addr, SIZE_T size, DWORD freetype)
+{
+       VirtualFree(addr, size, freetype);
+}
+
+void cache_free (uae_u8 *cache)
+{
+       virtualfreewithlock (cache, 0, MEM_RELEASE);
+}
+
+uae_u8 *cache_alloc (int size)
+{
+       return virtualallocwithlock (NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
+}
+
+#if 0
+static void setworkingset(void)
+{
+       typedef BOOL (CALLBACK* SETPROCESSWORKINGSETSIZE)(HANDLE,SIZE_T,SIZE_T);
+       SETPROCESSWORKINGSETSIZE pSetProcessWorkingSetSize;
+       pSetProcessWorkingSetSize = (SETPROCESSWORKINGSETSIZE)GetProcAddress(GetModuleHandle("kernal32.dll", "GetProcessWorkingSetSize");
+       if (!pSetProcessWorkingSetSize)
+               return;
+       pSetProcessWorkingSetSize(GetCurrentProcess (),
+               );
+}
+#endif
+
+static uae_u32 lowmem (void)
+{
+       uae_u32 change = 0;
+       if (currprefs.z3fastmem_size + currprefs.z3fastmem2_size >= 8 * 1024 * 1024) {
+               if (currprefs.z3fastmem2_size) {
+                       if (currprefs.z3fastmem2_size <= 128 * 1024 * 1024) {
+                               change = currprefs.z3fastmem2_size;
+                               currprefs.z3fastmem2_size = 0;
+                       } else {
+                               change = currprefs.z3fastmem2_size / 2;
+                               currprefs.z3fastmem2_size >>= 1;
+                               changed_prefs.z3fastmem2_size = currprefs.z3fastmem2_size;
+                       }
+               } else {
+                       change = currprefs.z3fastmem_size - currprefs.z3fastmem_size / 4;
+                       currprefs.z3fastmem2_size = changed_prefs.z3fastmem2_size = currprefs.z3fastmem_size / 4;
+                       currprefs.z3fastmem_size >>= 1;
+                       changed_prefs.z3fastmem_size = currprefs.z3fastmem_size;
+               }
+       } else if (currprefs.gfxmem_size >= 1 * 1024 * 1024) {
+               change = currprefs.gfxmem_size - currprefs.gfxmem_size / 2;
+               currprefs.gfxmem_size >>= 1;
+               changed_prefs.gfxmem_size = currprefs.gfxmem_size;
+       }
+       if (currprefs.z3fastmem2_size < 128 * 1024 * 1024)
+               currprefs.z3fastmem2_size = changed_prefs.z3fastmem2_size = 0;
+       return change;
+}
+
+typedef UINT (CALLBACK* GETWRITEWATCH)
+       (DWORD,PVOID,SIZE_T,PVOID*,PULONG_PTR,PULONG);
+#define TEST_SIZE (2 * 4096)
+static int testwritewatch (void)
+{
+       GETWRITEWATCH pGetWriteWatch;
+       void *mem;
+       void *pages[16];
+       ULONG_PTR gwwcnt;
+       ULONG ps;
+       int ret = 0;
+
+       ps = si.dwPageSize;
+
+       pGetWriteWatch = (GETWRITEWATCH)GetProcAddress (GetModuleHandle (L"kernel32.dll"), "GetWriteWatch");
+       if (pGetWriteWatch == NULL) {
+               write_log (L"GetWriteWatch(): missing!?\n");
+               return 0;
+       }
+       mem = VirtualAlloc (NULL, TEST_SIZE, MEM_RESERVE | MEM_WRITE_WATCH, PAGE_EXECUTE_READWRITE);
+       if (mem == NULL) {
+               write_log (L"GetWriteWatch(): MEM_WRITE_WATCH not supported!? err=%d\n", GetLastError());
+               return 0;
+       }
+       if (VirtualAlloc (mem, TEST_SIZE, MEM_COMMIT, PAGE_EXECUTE_READWRITE) == NULL) {
+               write_log (L"GetWriteWatch(): test memory area MEM_COMMIT failed!? err=%d\n", GetLastError());
+               goto end;
+       }
+       ResetWriteWatch (mem, TEST_SIZE);
+       ((uae_u8*)mem)[1] = 0;
+       gwwcnt = TEST_SIZE / ps;
+       if (GetWriteWatch (WRITE_WATCH_FLAG_RESET, mem, TEST_SIZE, pages, &gwwcnt, &ps)) {
+               write_log (L"GetWriteWatch(): failed!? err=%d\n", GetLastError ());
+               goto end;
+       }
+       if (ps != si.dwPageSize) {
+               write_log (L"GetWriteWatch(): pagesize %d != %d!?\n", si.dwPageSize, ps);
+               goto end;
+       }
+       if (gwwcnt != 1) {
+               write_log (L"GetWriteWatch(): modified pages returned %d != 1!?\n", gwwcnt);
+               goto end;
+       }
+       if (pages[0] != mem) {
+               write_log (L"GetWriteWatch(): modified page was wrong!?\n");
+               goto end;
+       }
+       write_log (L"GetWriteWatch() test ok\n");
+       ret = 1;
+       memwatchok = 1;
+end:
+       if (mem) {
+               VirtualFree (mem, TEST_SIZE, MEM_DECOMMIT);
+               VirtualFree (mem, 0, MEM_RELEASE);
+       }
+       return ret;
+}
+
+static uae_u8 *memwatchtable;
+
+int mman_GetWriteWatch (PVOID lpBaseAddress, SIZE_T dwRegionSize, PVOID *lpAddresses, PULONG_PTR lpdwCount, PULONG lpdwGranularity)
+{
+       int i, j, off;
+
+       if (memwatchok)
+               return GetWriteWatch (0, lpBaseAddress, dwRegionSize, lpAddresses, lpdwCount, lpdwGranularity);
+       j = 0;
+       off = ((uae_u8*)lpBaseAddress - (natmem_offset + p96ram_start)) / si.dwPageSize;
+       for (i = 0; i < dwRegionSize / si.dwPageSize; i++) {
+               if (j >= *lpdwCount)
+                       break;
+               if (memwatchtable[off + i])
+                       lpAddresses[j++] = (uae_u8*)lpBaseAddress + i * si.dwPageSize;
+       }
+       *lpdwCount = j;
+       *lpdwGranularity = si.dwPageSize;
+       return 0;
+}
+void mman_ResetWatch (PVOID lpBaseAddress, SIZE_T dwRegionSize)
+{
+       if (memwatchok) {
+               if (ResetWriteWatch (lpBaseAddress, dwRegionSize))
+                       write_log (L"ResetWriteWatch() failed, %d\n", GetLastError ());
+       } else {
+               DWORD op;
+               memset (memwatchtable, 0, p96mem_size / si.dwPageSize);
+               if (!VirtualProtect (lpBaseAddress, dwRegionSize, PAGE_READWRITE | PAGE_GUARD, &op))
+                       write_log (L"VirtualProtect() failed, err=%d\n", GetLastError ());
+       }
+}
+
+int mman_guard_exception (LPEXCEPTION_POINTERS p)
+{
+       PEXCEPTION_RECORD record = p->ExceptionRecord;
+       PCONTEXT context = p->ContextRecord;
+       ULONG_PTR addr = record->ExceptionInformation[1];
+       int rw = record->ExceptionInformation[0];
+       ULONG_PTR p96addr = (ULONG_PTR)p96mem_offset;
+
+       if (memwatchok)
+               return EXCEPTION_CONTINUE_SEARCH;
+       if (addr < p96addr || addr >= p96addr + p96mem_size)
+               return EXCEPTION_CONTINUE_EXECUTION;
+       addr -= p96addr;
+       addr /= si.dwPageSize;
+       memwatchtable[addr] = 1;
+       return EXCEPTION_CONTINUE_EXECUTION;
+}
+
+static uae_u64 size64;
+typedef BOOL (CALLBACK* GLOBALMEMORYSTATUSEX)(LPMEMORYSTATUSEX);
+
+void preinit_shm (void)
+{
+       int i;
+       uae_u64 total64;
+       uae_u64 totalphys64;
+       MEMORYSTATUS memstats;
+       GLOBALMEMORYSTATUSEX pGlobalMemoryStatusEx;
+       MEMORYSTATUSEX memstatsex;
+       uae_u32 max_allowed_mman;
+
+       GetSystemInfo (&si);
+       max_allowed_mman = 1536;
+       if (os_64bit)
+               max_allowed_mman = 2048;
+
+       memstats.dwLength = sizeof(memstats);
+       GlobalMemoryStatus(&memstats);
+       totalphys64 = memstats.dwTotalPhys;
+       total64 = (uae_u64)memstats.dwAvailPageFile + (uae_u64)memstats.dwTotalPhys;
+       pGlobalMemoryStatusEx = (GLOBALMEMORYSTATUSEX)GetProcAddress (GetModuleHandle (L"kernel32.dll"), "GlobalMemoryStatusEx");
+       if (pGlobalMemoryStatusEx) {
+               memstatsex.dwLength = sizeof (MEMORYSTATUSEX);
+               if (pGlobalMemoryStatusEx(&memstatsex)) {
+                       totalphys64 = memstatsex.ullTotalPhys;
+                       total64 = memstatsex.ullAvailPageFile + memstatsex.ullTotalPhys;
+               }
+       }
+       size64 = total64;
+       if (maxmem < 0)
+               size64 = MAXZ3MEM;
+       else if (maxmem > 0)
+               size64 = maxmem * 1024 * 1024;
+       if (os_64bit) {
+               if (size64 > MAXZ3MEM64)
+                       size64 = MAXZ3MEM64;
+       } else {
+               if (size64 > MAXZ3MEM)
+                       size64 = MAXZ3MEM;
+       }
+       if (size64 < 8 * 1024 * 1024)
+               size64 = 8 * 1024 * 1024;
+       if (max_allowed_mman * 1024 * 1024 > size64)
+               max_allowed_mman = size64 / (1024 * 1024);
+       max_z3fastmem = max_allowed_mman * 1024 * 1024;
+       if (max_z3fastmem < 512 * 1024 * 1024)
+               max_z3fastmem = 512 * 1024 * 1024;
+
+       shm_start = 0;
+       for (i = 0; i < MAX_SHMID; i++) {
+               shmids[i].attached = 0;
+               shmids[i].key = -1;
+               shmids[i].size = 0;
+               shmids[i].addr = NULL;
+               shmids[i].name[0] = 0;
+       }
+
+       write_log (L"Max Z3FastRAM %dM. Total physical RAM %uM\n", max_z3fastmem >> 20, totalphys64 >> 20);
+       testwritewatch ();
+       canbang = 1;
+}
+
+static void resetmem (void)
+{
+       int i;
+
+       if (!shm_start)
+               return;
+       for (i = 0; i < MAX_SHMID; i++) {
+               struct shmid_ds *s = &shmids[i];
+               int size = s->size;
+               uae_u8 *shmaddr;
+               uae_u8 *result;
+
+               if (!s->attached)
+                       continue;
+               if (!s->natmembase)
+                       continue;
+               shmaddr = natmem_offset + ((uae_u8*)s->attached - (uae_u8*)s->natmembase);
+               result = virtualallocwithlock (shmaddr, size, MEM_COMMIT, s->mode);
+               if (result != shmaddr)
+                       write_log (L"NATMEM: realloc(%p,%d,%d) failed, err=%x\n", shmaddr, size, s->mode, GetLastError ());
+               else
+                       write_log (L"NATMEM: rellocated(%p,%d,%s)\n", shmaddr, size, s->name);
+       }
+}
+
+int init_shm (void)
+{
+       uae_u32 size, totalsize, z3size, natmemsize, rtgbarrier, rtgextra;
+       int rounds = 0;
+
+restart:
+       for (;;) {
+               int lowround = 0;
+               uae_u8 *blah = NULL;
+               if (rounds > 0)
+                       write_log (L"NATMEM: retrying %d..\n", rounds);
+               rounds++;
+               if (natmem_offset)
+                       VirtualFree(natmem_offset, 0, MEM_RELEASE);
+               natmem_offset = NULL;
+               natmem_offset_end = NULL;
+               canbang = 0;
+
+               z3size = 0;
+               size = 0x1000000;
+               rtgextra = 0;
+               rtgbarrier = si.dwPageSize;
+               if (currprefs.cpu_model >= 68020)
+                       size = 0x10000000;
+               if (currprefs.z3fastmem_size || currprefs.z3fastmem2_size) {
+                       z3size = currprefs.z3fastmem_size + currprefs.z3fastmem2_size + (currprefs.z3fastmem_start - 0x10000000);
+                       if (currprefs.gfxmem_size)
+                               rtgbarrier = 16 * 1024 * 1024;
+               } else {
+                       rtgbarrier = 0;
+               }
+               totalsize = size + z3size + currprefs.gfxmem_size;
+               while (totalsize > size64) {
+                       int change = lowmem ();
+                       if (!change)
+                               return 0;
+                       write_log (L"NATMEM: %d, %dM > %dM = %dM\n", ++lowround, totalsize >> 20, size64 >> 20, (totalsize - change) >> 20);
+                       totalsize -= change;
+               }
+               if ((rounds > 1 && totalsize < 0x10000000) || rounds > 20) {
+                       write_log (L"NATMEM: No special area could be allocated (3)!\n");
+                       return 0;
+               }
+               natmemsize = size + z3size;
+
+               xfree (memwatchtable);
+               memwatchtable = 0;
+               if (currprefs.gfxmem_size) {
+                       if (!memwatchok) {
+                               write_log (L"GetWriteWatch() not supported, using guard pages, RTG performance will be slower.\n");
+                               memwatchtable = xcalloc (uae_u8, currprefs.gfxmem_size / si.dwPageSize + 1);
+                       }
+               }
+               if (currprefs.gfxmem_size) {
+                       rtgextra = si.dwPageSize;
+               } else {
+                       rtgbarrier = 0;
+                       rtgextra = 0;
+               }
+               blah = (uae_u8*)VirtualAlloc (NULL, natmemsize + rtgbarrier + currprefs.gfxmem_size + rtgextra + 16 * si.dwPageSize, MEM_RESERVE, PAGE_READWRITE);
+               if (blah) {
+                       natmem_offset = blah;
+                       break;
+               }
+               write_log (L"NATMEM: %dM area failed to allocate, err=%d (Z3=%dM,RTG=%dM)\n",
+                       natmemsize >> 20, GetLastError (), (currprefs.z3fastmem_size + currprefs.z3fastmem2_size) >> 20, currprefs.gfxmem_size >> 20);
+               if (!lowmem ()) {
+                       write_log (L"NATMEM: No special area could be allocated (2)!\n");
+                       return 0;
+               }
+       }
+       p96mem_size = currprefs.gfxmem_size;
+       if (p96mem_size) {
+               VirtualFree (natmem_offset, 0, MEM_RELEASE);
+               if (!VirtualAlloc (natmem_offset, natmemsize + rtgbarrier, MEM_RESERVE, PAGE_READWRITE)) {
+                       write_log (L"VirtualAlloc() part 2 error %d. RTG disabled.\n", GetLastError ());
+                       currprefs.gfxmem_size = changed_prefs.gfxmem_size = 0;
+                       rtgbarrier = si.dwPageSize;
+                       rtgextra = 0;
+                       goto restart;
+               }
+               p96mem_offset = (uae_u8*)VirtualAlloc (natmem_offset + natmemsize + rtgbarrier, p96mem_size + rtgextra,
+                       MEM_RESERVE | (memwatchok == 1 ? MEM_WRITE_WATCH : 0), PAGE_READWRITE);
+               if (!p96mem_offset) {
+                       currprefs.gfxmem_size = changed_prefs.gfxmem_size = 0;
+                       write_log (L"NATMEM: failed to allocate special Picasso96 GFX RAM, err=%d\n", GetLastError ());
+               }
+       }
+
+       if (!natmem_offset) {
+               write_log (L"NATMEM: No special area could be allocated! (1) err=%d\n", GetLastError ());
+       } else {
+               write_log (L"NATMEM: Our special area: 0x%p-0x%p (%08x %dM)\n",
+                       natmem_offset, (uae_u8*)natmem_offset + natmemsize,
+                       natmemsize, natmemsize >> 20);
+               if (currprefs.gfxmem_size)
+                       write_log (L"NATMEM: P96 special area: 0x%p-0x%p (%08x %dM)\n",
+                       p96mem_offset, (uae_u8*)p96mem_offset + currprefs.gfxmem_size,
+                       currprefs.gfxmem_size, currprefs.gfxmem_size >> 20);
+               canbang = 1;
+               natmem_offset_end = p96mem_offset + currprefs.gfxmem_size;
+       }
+
+       resetmem ();
+
+       return canbang;
+}
+
+
+void mapped_free (uae_u8 *mem)
+{
+       shmpiece *x = shm_start;
+
+       if (mem == filesysory) {
+               while(x) {
+                       if (mem == x->native_address) {
+                               int shmid = x->id;
+                               shmids[shmid].key = -1;
+                               shmids[shmid].name[0] = '\0';
+                               shmids[shmid].size = 0;
+                               shmids[shmid].attached = 0;
+                               shmids[shmid].mode = 0;
+                               shmids[shmid].natmembase = 0;
+                       }
+                       x = x->next;
+               }
+               return;
+       }
+
+       while(x) {
+               if(mem == x->native_address)
+                       shmdt (x->native_address);
+               x = x->next;
+       }
+       x = shm_start;
+       while(x) {
+               struct shmid_ds blah;
+               if (mem == x->native_address) {
+                       if (shmctl (x->id, IPC_STAT, &blah) == 0)
+                               shmctl (x->id, IPC_RMID, &blah);
+               }
+               x = x->next;
+       }
+}
+
+static key_t get_next_shmkey (void)
+{
+       key_t result = -1;
+       int i;
+       for (i = 0; i < MAX_SHMID; i++) {
+               if (shmids[i].key == -1) {
+                       shmids[i].key = i;
+                       result = i;
+                       break;
+               }
+       }
+       return result;
+}
+
+STATIC_INLINE key_t find_shmkey (key_t key)
+{
+       int result = -1;
+       if(shmids[key].key == key) {
+               result = key;
+       }
+       return result;
+}
+
+int mprotect (void *addr, size_t len, int prot)
+{
+       int result = 0;
+       return result;
+}
+
+void *shmat (int shmid, void *shmaddr, int shmflg)
+{
+       void *result = (void *)-1;
+       BOOL got = FALSE;
+       int p96special = FALSE;
+       DWORD protect = PAGE_READWRITE;
+
+#ifdef NATMEM_OFFSET
+       unsigned int size = shmids[shmid].size;
+
+       if (shmids[shmid].attached)
+               return shmids[shmid].attached;
+
+       if ((uae_u8*)shmaddr < natmem_offset) {
+               if(!_tcscmp (shmids[shmid].name, L"chip")) {
+                       shmaddr=natmem_offset;
+                       got = TRUE;
+                       if (currprefs.fastmem_size == 0 || currprefs.chipmem_size < 2 * 1024 * 1024)
+                               size += BARRIER;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"kick")) {
+                       shmaddr=natmem_offset + 0xf80000;
+                       got = TRUE;
+                       size += BARRIER;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"rom_a8")) {
+                       shmaddr=natmem_offset + 0xa80000;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"rom_e0")) {
+                       shmaddr=natmem_offset + 0xe00000;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"rom_f0")) {
+                       shmaddr=natmem_offset + 0xf00000;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"rtarea")) {
+                       shmaddr=natmem_offset + rtarea_base;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"fast")) {
+                       shmaddr=natmem_offset + 0x200000;
+                       got = TRUE;
+                       size += BARRIER;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"ramsey_low")) {
+                       shmaddr=natmem_offset + a3000lmem_start;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"ramsey_high")) {
+                       shmaddr=natmem_offset + a3000hmem_start;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"z3")) {
+                       shmaddr=natmem_offset + currprefs.z3fastmem_start;
+                       if (!currprefs.z3fastmem2_size)
+                               size += BARRIER;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"z3_2")) {
+                       shmaddr=natmem_offset + currprefs.z3fastmem_start + currprefs.z3fastmem_size;
+                       size += BARRIER;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"gfx")) {
+                       got = TRUE;
+                       p96special = TRUE;
+                       p96ram_start = p96mem_offset - natmem_offset;
+                       shmaddr = natmem_offset + p96ram_start;
+                       size += BARRIER;
+                       if (!memwatchok)
+                               protect |= PAGE_GUARD;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"bogo")) {
+                       shmaddr=natmem_offset+0x00C00000;
+                       got = TRUE;
+                       if (currprefs.bogomem_size <= 0x100000)
+                               size += BARRIER;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"filesys")) {
+                       static uae_u8 *filesysptr;
+                       if (filesysptr == NULL)
+                               filesysptr = xcalloc (uae_u8, size);
+                       result = filesysptr;
+                       shmids[shmid].attached = result;
+                       return result;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"custmem1")) {
+                       shmaddr=natmem_offset + currprefs.custom_memory_addrs[0];
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"custmem2")) {
+                       shmaddr=natmem_offset + currprefs.custom_memory_addrs[1];
+                       got = TRUE;
+               }
+
+               if(!_tcscmp (shmids[shmid].name, L"hrtmem")) {
+                       shmaddr=natmem_offset + 0x00a10000;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"arhrtmon")) {
+                       shmaddr=natmem_offset + 0x00800000;
+                       size += BARRIER;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"xpower_e2")) {
+                       shmaddr=natmem_offset + 0x00e20000;
+                       size += BARRIER;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"xpower_f2")) {
+                       shmaddr=natmem_offset + 0x00f20000;
+                       size += BARRIER;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"nordic_f0")) {
+                       shmaddr=natmem_offset + 0x00f00000;
+                       size += BARRIER;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"nordic_f4")) {
+                       shmaddr=natmem_offset + 0x00f40000;
+                       size += BARRIER;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"nordic_f6")) {
+                       shmaddr=natmem_offset + 0x00f60000;
+                       size += BARRIER;
+                       got = TRUE;
+               }
+               if(!_tcscmp(shmids[shmid].name, L"superiv_b0")) {
+                       shmaddr=natmem_offset + 0x00b00000;
+                       size += BARRIER;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"superiv_d0")) {
+                       shmaddr=natmem_offset + 0x00d00000;
+                       size += BARRIER;
+                       got = TRUE;
+               }
+               if(!_tcscmp (shmids[shmid].name, L"superiv_e0")) {
+                       shmaddr=natmem_offset + 0x00e00000;
+                       size += BARRIER;
+                       got = TRUE;
+               }
+       }
+#endif
+
+       if (shmids[shmid].key == shmid && shmids[shmid].size) {
+               shmids[shmid].mode = protect;
+               shmids[shmid].natmembase = natmem_offset;
+               if (shmaddr)
+                       virtualfreewithlock (shmaddr, size, MEM_DECOMMIT);
+               result = virtualallocwithlock (shmaddr, size, MEM_COMMIT, protect);
+               if (result == NULL) {
+                       result = (void*)-1;
+                       write_log (L"VirtualAlloc %08X - %08X %x (%dk) failed %d\n",
+                               (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size,
+                               size, size >> 10, GetLastError ());
+               } else {
+                       shmids[shmid].attached = result;
+                       write_log (L"VirtualAlloc %08X - %08X %x (%dk) ok%s\n",
+                               (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size,
+                               size, size >> 10, p96special ? L" P96" : L"");
+               }
+       }
+       return result;
+}
+
+int shmdt (const void *shmaddr)
+{
+       return 0;
+}
+
+int shmget (key_t key, size_t size, int shmflg, const TCHAR *name)
+{
+       int result = -1;
+
+       if((key == IPC_PRIVATE) || ((shmflg & IPC_CREAT) && (find_shmkey (key) == -1))) {
+               write_log (L"shmget of size %d (%dk) for %s\n", size, size >> 10, name);
+               if ((result = get_next_shmkey ()) != -1) {
+                       shmids[result].size = size;
+                       _tcscpy (shmids[result].name, name);
+               } else {
+                       result = -1;
+               }
+       }
+       return result;
+}
+
+int shmctl (int shmid, int cmd, struct shmid_ds *buf)
+{
+       int result = -1;
+
+       if ((find_shmkey (shmid) != -1) && buf) {
+               switch (cmd)
+               {
+               case IPC_STAT:
+                       *buf = shmids[shmid];
+                       result = 0;
+                       break;
+               case IPC_RMID:
+                       VirtualFree (shmids[shmid].attached, shmids[shmid].size, MEM_DECOMMIT);
+                       shmids[shmid].key = -1;
+                       shmids[shmid].name[0] = '\0';
+                       shmids[shmid].size = 0;
+                       shmids[shmid].attached = 0;
+                       shmids[shmid].mode = 0;
+                       result = 0;
+                       break;
+               }
+       }
+       return result;
+}
+
+#endif
+
+int isinf (double x)
+{
+       const int nClass = _fpclass (x);
+       int result;
+       if (nClass == _FPCLASS_NINF || nClass == _FPCLASS_PINF)
+               result = 1;
+       else
+               result = 0;
+       return result;
+}
similarity index 100%
rename from od-win32/opengl.c
rename to od-win32/opengl.cpp
similarity index 93%
rename from od-win32/parser.c
rename to od-win32/parser.cpp
index 77699a7eed3ee4e5937a861c9b3c5f0674d56b98..30df4c1a7c47493ab7c4d0a320fa005f54a15fe1 100644 (file)
@@ -53,6 +53,7 @@
 #include "ahidsound_new.h"
 #include "uaeipc.h"
 #include "xwin.h"
+#include "drawing.h"
 
 #include <Ghostscript/iapi.h>
 #include <Ghostscript/ierrors.h>
@@ -98,11 +99,11 @@ static GSAPI_INIT_WITH_ARGS ptr_gsapi_init_with_args;
 typedef int (CALLBACK* GSAPI_EXIT)(void *instance);
 static GSAPI_EXIT ptr_gsapi_exit;
 
-typedef (CALLBACK* GSAPI_RUN_STRING_BEGIN)(void *instance, int user_errors, int *pexit_code);
+typedef int (CALLBACK* GSAPI_RUN_STRING_BEGIN)(void *instance, int user_errors, int *pexit_code);
 static GSAPI_RUN_STRING_BEGIN ptr_gsapi_run_string_begin;
-typedef (CALLBACK* GSAPI_RUN_STRING_CONTINUE)(void *instance, const char *str, unsigned int length, int user_errors, int *pexit_code);
+typedef int (CALLBACK* GSAPI_RUN_STRING_CONTINUE)(void *instance, const char *str, unsigned int length, int user_errors, int *pexit_code);
 static GSAPI_RUN_STRING_CONTINUE ptr_gsapi_run_string_continue;
-typedef (CALLBACK* GSAPI_RUN_STRING_END)(void *instance, int user_errors, int *pexit_code);
+typedef int (CALLBACK* GSAPI_RUN_STRING_END)(void *instance, int user_errors, int *pexit_code);
 static GSAPI_RUN_STRING_END ptr_gsapi_run_string_end;
 
 static uae_u8 **psbuffer;
@@ -176,7 +177,7 @@ static int openprinter_ps (void)
 
 static void *prt_thread (void *p)
 {
-       uae_u8 **buffers = p;
+       uae_u8 **buffers = (uae_u8**)p;
        int err, cnt, ok;
 
        ok = 1;
@@ -189,7 +190,7 @@ static void *prt_thread (void *p)
                        cnt = 0;
                        while (buffers[cnt]) {
                                uae_u8 *p = buffers[cnt];
-                               err = ptr_gsapi_run_string_continue (gsinstance, p + 2, (p[0] << 8) | p[1], 0, &gs_exitcode);
+                               err = ptr_gsapi_run_string_continue (gsinstance, (char*)p + 2, (p[0] << 8) | p[1], 0, &gs_exitcode);
                                if (err != e_NeedInput && err <= e_Fatal) {
                                        ptr_gsapi_exit (gsinstance);
                                        write_log (L"PostScript parsing failed.\n");
@@ -245,8 +246,8 @@ static void flushprtbuf (void)
 
                if (psmode) {
                        uae_u8 *p;
-                       psbuffer = realloc (psbuffer, (psbuffers + 2) * sizeof (uae_u8*));
-                       p = malloc (prtbufbytes + 2);
+                       psbuffer = xrealloc (uae_u8*, psbuffer, (psbuffers + 2));
+                       p = xmalloc (uae_u8, prtbufbytes + 2);
                        p[0] = prtbufbytes >> 8;
                        p[1] = prtbufbytes;
                        memcpy (p + 2, prtbuf, prtbufbytes);
@@ -332,7 +333,7 @@ static void DoSomeWeirdPrintingStuff (uae_char val)
                                prtdump = zfile_fopen (L"psdump.dat", L"wb", 0);
 
                        psmode = 1;
-                       psbuffer = malloc (sizeof (uae_u8*));
+                       psbuffer = xmalloc (uae_u8*, 1);
                        psbuffer[0] = 0;
                        psbuffers = 0;
                        strcpy (prtbuf, "%!PS");
@@ -481,7 +482,7 @@ static void openprinter (void)
                        DocInfo.pOutputFile = NULL;
                        DocInfo.pDatatype = (currprefs.parallel_matrix_emulation || currprefs.parallel_postscript_detection) ? L"TEXT" : L"RAW";
                        // Inform the spooler the document is beginning.
-                       if ((dwJob = StartDocPrinter (hPrt, 1, (LPSTR)&DocInfo)) == 0) {
+                       if ((dwJob = StartDocPrinter (hPrt, 1, (LPBYTE)&DocInfo)) == 0) {
                                ClosePrinter (hPrt );
                                hPrt = INVALID_HANDLE_VALUE;
                        } else if (StartPagePrinter (hPrt)) {
@@ -557,16 +558,18 @@ int uaeser_getdatalenght (void)
        return sizeof (struct uaeserialdatawin32);
 }
 
-static void uaeser_initdata (struct uaeserialdatawin32 *sd, void *user)
+static void uaeser_initdata (void *vsd, void *user)
 {
+       struct uaeserialdatawin32 *sd = (struct uaeserialdatawin32*)vsd;
        memset (sd, 0, sizeof (struct uaeserialdatawin32));
        sd->hCom = INVALID_HANDLE_VALUE;
        sd->evtr = sd->evtw = sd->evtt = sd->evtwce = 0;
        sd->user = user;
 }
 
-int uaeser_query (struct uaeserialdatawin32 *sd, uae_u16 *status, uae_u32 *pending)
+int uaeser_query (void *vsd, uae_u16 *status, uae_u32 *pending)
 {
+       struct uaeserialdatawin32 *sd = (struct uaeserialdatawin32*)vsd;
        DWORD err, modem;
        COMSTAT ComStat;
        uae_u16 s = 0;
@@ -587,8 +590,9 @@ int uaeser_query (struct uaeserialdatawin32 *sd, uae_u16 *status, uae_u32 *pendi
        return 1;
 }
 
-int uaeser_break (struct uaeserialdatawin32 *sd, int brklen)
+int uaeser_break (void *vsd, int brklen)
 {
+       struct uaeserialdatawin32 *sd = (struct uaeserialdatawin32*)vsd;
        if (!SetCommBreak (sd->hCom))
                return 0;
        Sleep (brklen / 1000);
@@ -596,8 +600,9 @@ int uaeser_break (struct uaeserialdatawin32 *sd, int brklen)
        return 1;
 }
 
-int uaeser_setparams (struct uaeserialdatawin32 *sd, int baud, int rbuffer, int bits, int sbits, int rtscts, int parity, uae_u32 xonxoff)
+int uaeser_setparams (void *vsd, int baud, int rbuffer, int bits, int sbits, int rtscts, int parity, uae_u32 xonxoff)
 {
+       struct uaeserialdatawin32 *sd = (struct uaeserialdatawin32*)vsd;
        DCB dcb;
 
        memset (&dcb, 0, sizeof (dcb));
@@ -658,10 +663,10 @@ static void startwce(struct uaeserialdatawin32 *sd, DWORD *evtmask)
 
 static void *uaeser_trap_thread (void *arg)
 {
-       struct uaeserialdatawin32 *sd = arg;
+       struct uaeserialdatawin32 *sd = (struct uaeserialdatawin32*)arg;
        HANDLE handles[4];
-       int cnt, actual;
-       DWORD evtmask;
+       int cnt;
+       DWORD evtmask, actual;
 
        uae_set_thread_priority (NULL, 1);
        sd->threadactive = 1;
@@ -699,13 +704,15 @@ static void *uaeser_trap_thread (void *arg)
        return 0;
 }
 
-void uaeser_trigger (struct uaeserialdatawin32 *sd)
+void uaeser_trigger (void *vsd)
 {
+       struct uaeserialdatawin32 *sd = (struct uaeserialdatawin32*)vsd;
        SetEvent (sd->evtt);
 }
 
-int uaeser_write (struct uaeserialdatawin32 *sd, uae_u8 *data, uae_u32 len)
+int uaeser_write (void *vsd, uae_u8 *data, uae_u32 len)
 {
+       struct uaeserialdatawin32 *sd = (struct uaeserialdatawin32*)vsd;
        int ret = 1;
        if (!WriteFile (sd->hCom, data, len, NULL, &sd->olw)) {
                sd->writeactive = 1;
@@ -718,8 +725,9 @@ int uaeser_write (struct uaeserialdatawin32 *sd, uae_u8 *data, uae_u32 len)
        return ret;
 }
 
-int uaeser_read (struct uaeserialdatawin32 *sd, uae_u8 *data, uae_u32 len)
+int uaeser_read (void *vsd, uae_u8 *data, uae_u32 len)
 {
+       struct uaeserialdatawin32 *sd = (struct uaeserialdatawin32*)vsd;
        int ret = 1;
        DWORD err;
        COMSTAT ComStat;
@@ -738,13 +746,15 @@ int uaeser_read (struct uaeserialdatawin32 *sd, uae_u8 *data, uae_u32 len)
        return ret;
 }
 
-void uaeser_clearbuffers (struct uaeserialdatawin32 *sd)
+void uaeser_clearbuffers (void *vsd)
 {
+       struct uaeserialdatawin32 *sd = (struct uaeserialdatawin32*)vsd;
        PurgeComm (sd->hCom, PURGE_TXCLEAR | PURGE_RXCLEAR);
 }
 
-int uaeser_open (struct uaeserialdatawin32 *sd, void *user, int unit)
+int uaeser_open (void *vsd, void *user, int unit)
 {
+       struct uaeserialdatawin32 *sd = (struct uaeserialdatawin32*)vsd;
        TCHAR buf[256];
        COMMTIMEOUTS CommTimeOuts;
 
@@ -790,8 +800,9 @@ end:
        return 0;
 }
 
-void uaeser_close (struct uaeserialdatawin32 *sd)
+void uaeser_close (void *vsd)
 {
+       struct uaeserialdatawin32 *sd = (struct uaeserialdatawin32*)vsd;
        if (sd->threadactive) {
                sd->threadactive = -1;
                SetEvent (sd->evtt);
@@ -821,7 +832,7 @@ static uae_u8 inputbuffer[SERIAL_READ_BUFFER];
 static int datainoutput;
 static int dataininput, dataininputcnt;
 static OVERLAPPED writeol, readol;
-static writepending;
+static int writepending;
 
 int openser (TCHAR *sername)
 {
@@ -1200,7 +1211,7 @@ static int enumserialports_2 (int cnt)
        if(hDevInfo == INVALID_HANDLE_VALUE)
                return 0;
        // Enumerate the serial ports
-       pDetData = xmalloc (dwDetDataSize);
+       pDetData = (SP_DEVICE_INTERFACE_DETAIL_DATA*)xmalloc (uae_u8, dwDetDataSize);
        // This is required, according to the documentation. Yes,
        // it's weird.
        ifcData.cbSize = sizeof (SP_DEVICE_INTERFACE_DATA);
@@ -1228,7 +1239,7 @@ static int enumserialports_2 (int cnt)
                                        comports[cnt].name = my_strdup (fname);
                                        p = _tcsstr (fname, L"(COM");
                                        if (p && (p[5] == ')' || p[6] == ')')) {
-                                               comports[cnt].cfgname = xmalloc (100 * sizeof (TCHAR));
+                                               comports[cnt].cfgname = xmalloc (TCHAR, 100);
                                                if (isdigit(p[5]))
                                                        _stprintf (comports[cnt].cfgname, L"COM%c%c", p[4], p[5]);
                                                else
@@ -1291,7 +1302,7 @@ int enumserialports (void)
                if (j == cnt) {
                        if (cnt >= MAX_SERIAL_PORTS)
                                break;
-                       comports[j].dev = xmalloc (100 * sizeof (TCHAR));
+                       comports[j].dev = xmalloc (TCHAR, 100);
                        _stprintf (comports[cnt].dev, L"\\.\\\\%s", name);
                        comports[j].cfgname = my_strdup (name);
                        comports[j].name = my_strdup (name);
similarity index 98%
rename from od-win32/picasso96_win.c
rename to od-win32/picasso96_win.cpp
index 08ff887e91b0d4648d3169f3f1ba96c24f72ee0f..61d35ec13e690854ac0b7a6565006f84539861c8 100644 (file)
@@ -402,7 +402,7 @@ static int CopyRenderInfoStructureA2U (uaecptr amigamemptr, struct RenderInfo *r
        if (valid_address (memp, PSSO_RenderInfo_sizeof)) {
                ri->Memory = get_real_address (memp);
                ri->BytesPerRow = get_word (amigamemptr + PSSO_RenderInfo_BytesPerRow);
-               ri->RGBFormat = get_long (amigamemptr + PSSO_RenderInfo_RGBFormat);
+               ri->RGBFormat = (RGBFTYPE)get_long (amigamemptr + PSSO_RenderInfo_RGBFormat);
                return 1;
        }
        write_log (L"ERROR - Invalid RenderInfo memory area...\n");
@@ -971,50 +971,50 @@ void picasso_refresh (void)
 #define BLT_MULT 1
 #define BLT_NAME BLIT_FALSE_32
 #define BLT_FUNC(s,d) *d = 0
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOR_32
 #define BLT_FUNC(s,d) *d = ~(*s | * d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_ONLYDST_32
 #define BLT_FUNC(s,d) *d = (*d) & ~(*s)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTSRC_32
 #define BLT_FUNC(s,d) *d = ~(*s)
-#include "p96_blit.c" 
+#include "p96_blit.cpp
 #define BLT_NAME BLIT_ONLYSRC_32
 #define BLT_FUNC(s,d) *d = (*s) & ~(*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTDST_32
 #define BLT_FUNC(s,d) *d = ~(*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_EOR_32
 #define BLT_FUNC(s,d) *d = (*s) ^ (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NAND_32
 #define BLT_FUNC(s,d) *d = ~((*s) & (*d))
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_AND_32
 #define BLT_FUNC(s,d) *d = (*s) & (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NEOR_32
 #define BLT_FUNC(s,d) *d = ~((*s) ^ (*d))
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTONLYSRC_32
 #define BLT_FUNC(s,d) *d = ~(*s) | (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTONLYDST_32
 #define BLT_FUNC(s,d) *d = ~(*d) | (*s)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_OR_32
 #define BLT_FUNC(s,d) *d = (*s) | (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_TRUE_32
 #define BLT_FUNC(s,d) *d = 0xffffffff
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_30_32
 #define BLT_FUNC(s,d) tmp = *d ; *d = *s; *s = tmp;
 #define BLT_TEMP
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #undef BLT_SIZE
 #undef BLT_MULT
 
@@ -1022,50 +1022,50 @@ void picasso_refresh (void)
 #define BLT_MULT 1
 #define BLT_NAME BLIT_FALSE_24
 #define BLT_FUNC(s,d) *d = 0
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOR_24
 #define BLT_FUNC(s,d) *d = ~(*s | * d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_ONLYDST_24
 #define BLT_FUNC(s,d) *d = (*d) & ~(*s)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTSRC_24
 #define BLT_FUNC(s,d) *d = ~(*s)
-#include "p96_blit.c" 
+#include "p96_blit.cpp
 #define BLT_NAME BLIT_ONLYSRC_24
 #define BLT_FUNC(s,d) *d = (*s) & ~(*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTDST_24
 #define BLT_FUNC(s,d) *d = ~(*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_EOR_24
 #define BLT_FUNC(s,d) *d = (*s) ^ (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NAND_24
 #define BLT_FUNC(s,d) *d = ~((*s) & (*d))
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_AND_24
 #define BLT_FUNC(s,d) *d = (*s) & (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NEOR_24
 #define BLT_FUNC(s,d) *d = ~((*s) ^ (*d))
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTONLYSRC_24
 #define BLT_FUNC(s,d) *d = ~(*s) | (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTONLYDST_24
 #define BLT_FUNC(s,d) *d = ~(*d) | (*s)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_OR_24
 #define BLT_FUNC(s,d) *d = (*s) | (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_TRUE_24
 #define BLT_FUNC(s,d) *d = 0xffffffff
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_30_24
 #define BLT_FUNC(s,d) tmp = *d ; *d = *s; *s = tmp;
 #define BLT_TEMP
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #undef BLT_SIZE
 #undef BLT_MULT
 
@@ -1073,50 +1073,50 @@ void picasso_refresh (void)
 #define BLT_MULT 2
 #define BLT_NAME BLIT_FALSE_16
 #define BLT_FUNC(s,d) *d = 0
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOR_16
 #define BLT_FUNC(s,d) *d = ~(*s | * d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_ONLYDST_16
 #define BLT_FUNC(s,d) *d = (*d) & ~(*s)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTSRC_16
 #define BLT_FUNC(s,d) *d = ~(*s)
-#include "p96_blit.c" 
+#include "p96_blit.cpp
 #define BLT_NAME BLIT_ONLYSRC_16
 #define BLT_FUNC(s,d) *d = (*s) & ~(*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTDST_16
 #define BLT_FUNC(s,d) *d = ~(*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_EOR_16
 #define BLT_FUNC(s,d) *d = (*s) ^ (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NAND_16
 #define BLT_FUNC(s,d) *d = ~((*s) & (*d))
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_AND_16
 #define BLT_FUNC(s,d) *d = (*s) & (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NEOR_16
 #define BLT_FUNC(s,d) *d = ~((*s) ^ (*d))
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTONLYSRC_16
 #define BLT_FUNC(s,d) *d = ~(*s) | (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTONLYDST_16
 #define BLT_FUNC(s,d) *d = ~(*d) | (*s)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_OR_16
 #define BLT_FUNC(s,d) *d = (*s) | (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_TRUE_16
 #define BLT_FUNC(s,d) *d = 0xffffffff
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_30_16
 #define BLT_FUNC(s,d) tmp = *d ; *d = *s; *s = tmp;
 #define BLT_TEMP
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #undef BLT_SIZE
 #undef BLT_MULT
 
@@ -1124,50 +1124,50 @@ void picasso_refresh (void)
 #define BLT_MULT 4
 #define BLT_NAME BLIT_FALSE_8
 #define BLT_FUNC(s,d) *d = 0
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOR_8
 #define BLT_FUNC(s,d) *d = ~(*s | * d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_ONLYDST_8
 #define BLT_FUNC(s,d) *d = (*d) & ~(*s)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTSRC_8
 #define BLT_FUNC(s,d) *d = ~(*s)
-#include "p96_blit.c" 
+#include "p96_blit.cpp
 #define BLT_NAME BLIT_ONLYSRC_8
 #define BLT_FUNC(s,d) *d = (*s) & ~(*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTDST_8
 #define BLT_FUNC(s,d) *d = ~(*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_EOR_8
 #define BLT_FUNC(s,d) *d = (*s) ^ (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NAND_8
 #define BLT_FUNC(s,d) *d = ~((*s) & (*d))
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_AND_8
 #define BLT_FUNC(s,d) *d = (*s) & (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NEOR_8
 #define BLT_FUNC(s,d) *d = ~((*s) ^ (*d))
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTONLYSRC_8
 #define BLT_FUNC(s,d) *d = ~(*s) | (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_NOTONLYDST_8
 #define BLT_FUNC(s,d) *d = ~(*d) | (*s)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_OR_8
 #define BLT_FUNC(s,d) *d = (*s) | (*d)
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_TRUE_8
 #define BLT_FUNC(s,d) *d = 0xffffffff
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #define BLT_NAME BLIT_30_8
 #define BLT_FUNC(s,d) tmp = *d ; *d = *s; *s = tmp;
 #define BLT_TEMP
-#include "p96_blit.c"
+#include "p96_blit.cpp"
 #undef BLT_SIZE
 #undef BLT_MULT
 
@@ -1598,8 +1598,8 @@ int createwindowscursor (uaecptr src, int w, int h, int hiressprite, int doubled
        xorBM = CreateCompatibleBitmap (DC, w2, h2);
        if (!andBM || !xorBM)
                goto end;
-       andoBM = SelectObject (andDC, andBM);
-       xoroBM = SelectObject (xorDC, xorBM);
+       andoBM = (HBITMAP)SelectObject (andDC, andBM);
+       xoroBM = (HBITMAP)SelectObject (xorDC, xorBM);
 
        isdata = 0;
        for (y = 0, yy = 0; y < h2; yy++) {
@@ -1653,7 +1653,7 @@ end:
                wincursor = CreateIconIndirect (&ic);
                tmp_sprite_w = w;
                tmp_sprite_h = h;
-               tmp_sprite_data = xmalloc (datasize);
+               tmp_sprite_data = xmalloc (uae_u8, datasize);
                tmp_sprite_hires = hiressprite;
                tmp_sprite_doubled = doubledsprite;
                memcpy (tmp_sprite_data, realsrc, datasize);
@@ -1746,7 +1746,7 @@ static uae_u32 setspriteimage (uaecptr bi)
        createwindowscursor (get_long (bi + PSSO_BoardInfo_MouseImage) + 4 * hiressprite,
                w, h, hiressprite, doubledsprite, 0);
 
-       tmpbuf = xmalloc (w * h * bpp);
+       tmpbuf = xmalloc (uae_u8, w * h * bpp);
        for (y = 0, yy = 0; y < h; y++, yy++) {
                uae_u8 *p = tmpbuf + w * bpp * y;
                uae_u8 *pprev = p;
@@ -2100,7 +2100,7 @@ static void init_alloc (void)
        gwwpagesize = si.dwPageSize;
        gwwbufsize = allocated_gfxmem / gwwpagesize + 1;
        gwwpagemask = gwwpagesize - 1;
-       gwwbuf = xmalloc (gwwbufsize * sizeof (void*));
+       gwwbuf = xmalloc (void*, gwwbufsize);
 }
 
 static int p96depth (int depth)
@@ -2141,7 +2141,7 @@ void picasso96_alloc (TrapContext *ctx)
                return;
        misscnt = 0;
        cnt = 0;
-       newmodes = xmalloc (sizeof (struct PicassoResolution) * MAX_PICASSO_MODES);
+       newmodes = xmalloc (struct PicassoResolution, MAX_PICASSO_MODES);
        size = 0;
 
        depths = 0;
@@ -2757,7 +2757,7 @@ static uae_u32 REGPARAM2 picasso_SetPanning (TrapContext *ctx)
        put_word (bi + PSSO_BoardInfo_YOffset, picasso96_state.YOffset);
        picasso96_state.VirtualWidth = bme_width;
        picasso96_state.VirtualHeight = bme_height;
-       picasso96_state.RGBFormat = m68k_dreg (regs, 7);
+       picasso96_state.RGBFormat = (RGBFTYPE)m68k_dreg (regs, 7);
        picasso96_state.BytesPerPixel = GetBytesPerPixel (picasso96_state.RGBFormat);
        picasso96_state.BytesPerRow = picasso96_state.VirtualWidth * picasso96_state.BytesPerPixel;
        picasso_SetPanningInit();
@@ -2871,7 +2871,7 @@ static uae_u32 REGPARAM2 picasso_FillRect (TrapContext *ctx)
        uae_u32 Height = (uae_u16)m68k_dreg (regs, 3);
        uae_u32 Pen = m68k_dreg (regs, 4);
        uae_u8 Mask = (uae_u8)m68k_dreg (regs, 5);
-       RGBFTYPE RGBFormat = m68k_dreg (regs, 7);
+       RGBFTYPE RGBFormat = (RGBFTYPE)m68k_dreg (regs, 7);
        uae_u8 *oldstart;
        int Bpp;
        struct RenderInfo ri;
@@ -3083,7 +3083,7 @@ static uae_u32 REGPARAM2 picasso_BlitRectNoMaskComplete (TrapContext *ctx)
        unsigned long dsty = (uae_u16)m68k_dreg (regs, 3);
        unsigned long width = (uae_u16)m68k_dreg (regs, 4);
        unsigned long height = (uae_u16)m68k_dreg (regs, 5);
-       uae_u8 OpCode = m68k_dreg (regs, 6);
+       BLIT_OPCODE OpCode = (BLIT_OPCODE)(m68k_dreg (regs, 6) & 0xff);
        uae_u32 RGBFmt = m68k_dreg (regs, 7);
        uae_u32 result = 0;
 
@@ -4159,7 +4159,7 @@ static void flushpixels (void)
                }
 
                for (i = 0; i < gwwcnt; i++) {
-                       uae_u8 *p = gwwbuf[i];
+                       uae_u8 *p = (uae_u8*)gwwbuf[i];
 
                        if (p >= src_start && p < src_end) {
                                int y, x, realoffset;
@@ -4756,7 +4756,7 @@ uae_u8 *restore_p96 (uae_u8 *src)
        interrupt_enabled = !!(flags & 32);
        changed_prefs.gfxmem_size = restore_u32 ();
        picasso96_state.Address = restore_u32 ();
-       picasso96_state.RGBFormat = restore_u32 ();
+       picasso96_state.RGBFormat = (RGBFTYPE)restore_u32 ();
        picasso96_state.Width = restore_u16 ();
        picasso96_state.Height = restore_u16 ();
        picasso96_state.VirtualWidth = restore_u16 ();
@@ -4788,7 +4788,7 @@ uae_u8 *save_p96 (int *len, uae_u8 *dstptr)
        if (dstptr)
                dstbak = dst = dstptr;
        else
-               dstbak = dst = malloc (1000);
+               dstbak = dst = xmalloc (uae_u8, 1000);
        save_u32 (2);
        save_u32 ((picasso_on ? 1 : 0) | (set_gc_called ? 2 : 0) | (set_panning_called ? 4 : 0) |
                (hwsprite ? 8 : 0) | (cursorvisible ? 16 : 0) | (interrupt_enabled ? 32 : 0));
index a49cca062a55c443d1ec87cb707eda80c46598d2..c3fc6e434291bffbc7cd9b421b62d72b3decb506 100644 (file)
@@ -228,7 +228,7 @@ struct RenderInfo {
 #define PSSO_Pattern_DrawMode 17
 #define PSSO_Pattern_sizeof 18
 struct Pattern {
-    char *Memory;
+    uae_u8 *Memory;
     uae_u16 XOffset, YOffset;
     uae_u32 FgPen, BgPen;
     uae_u8 Size;                                       /* Width: 16, Height: (1<<pat_Size) */
@@ -244,7 +244,7 @@ struct Pattern {
 #define PSSO_Template_sizeof 16
 
 struct Template {
-    char *Memory;
+    uae_u8 *Memory;
     uae_s16 BytesPerRow;
     uae_u8 XOffset;
     uae_u8 DrawMode;
@@ -511,7 +511,7 @@ struct Line {
 /************************************************************************/
 struct picasso96_state_struct
 {
-    uae_u32             RGBFormat;   /* true-colour, CLUT, hi-colour, etc.*/
+    RGBFTYPE            RGBFormat;   /* true-colour, CLUT, hi-colour, etc.*/
     struct MyCLUTEntry  CLUT[256];   /* Duh! */
     uaecptr             Address;     /* Active screen address (Amiga-side)*/
     uaecptr             Extent;      /* End address of screen (Amiga-side)*/
similarity index 98%
rename from od-win32/posixemu.c
rename to od-win32/posixemu.cpp
index 9203c14da7c226d5e1792f35c3a7fbd06d0d05f1..f56d355306307e08973b43af3a101213899f4af0 100644 (file)
@@ -73,7 +73,7 @@ static void get_time (time_t t, long *days, long *mins, long *ticks)
        *ticks = t * 50;
 }
 
-static DWORD getattr (const TCHAR *name, LPFILETIME lpft, uae_u64 *size)
+static DWORD getattr (const TCHAR *name, LPFILETIME lpft, uae_s64 *size)
 {
        HANDLE hFind;
        WIN32_FIND_DATA fd;
@@ -243,7 +243,7 @@ struct thparms
 
 static unsigned __stdcall thread_init (void *f)
 {
-       struct thparms *thp = f;
+       struct thparms *thp = (struct thparms*)f;
        void *(*fp)(void*) = thp->f;
        void *arg = thp->arg;
 
@@ -275,7 +275,7 @@ int uae_start_thread (TCHAR *name, void *(*f)(void *), void *arg, uae_thread_id
        unsigned foo;
        struct thparms *thp;
 
-       thp = xmalloc (sizeof (struct thparms));
+       thp = xmalloc (struct thparms, 1);
        thp->f = f;
        thp->arg = arg;
        hThread = (HANDLE)_beginthreadex (NULL, 0, thread_init, thp, 0, &foo);
similarity index 87%
rename from od-win32/registry.c
rename to od-win32/registry.cpp
index a291666f1b6583f500f7894ebd5548ed31d2c9ee..3ddb979a7e4c73c791416a8b1df4e8fa3a58cd95 100644 (file)
@@ -3,8 +3,8 @@
 #include "sysdeps.h"
 
 #include <windows.h>
-#include "win32.h"
 #include <shlwapi.h>
+#include "win32.h"
 #include "registry.h"
 #include "crc32.h"
 
@@ -30,7 +30,7 @@ static TCHAR *gsn (UAEREG *root, const TCHAR *name)
        if (!root)
                return my_strdup (name);
        r = gs (root);
-       s = xmalloc ((_tcslen (r) + 1 + _tcslen (name) + 1) * sizeof (TCHAR));
+       s = xmalloc (TCHAR, _tcslen (r) + 1 + _tcslen (name) + 1);
        _stprintf (s, L"%s/%s", r, name);
        return s;
 }
@@ -91,7 +91,7 @@ int regquerystr (UAEREG *root, const TCHAR *name, TCHAR *str, int *size)
 {
        if (inimode) {
                int ret = 0;
-               TCHAR *tmp = xmalloc (((*size) + 1) * sizeof (TCHAR));
+               TCHAR *tmp = xmalloc (TCHAR, (*size) + 1);
                GetPrivateProfileString (gs (root), name, PUPPA, tmp, *size, inipath);
                if (_tcscmp (tmp, PUPPA)) {
                        _tcscpy (str, tmp);
@@ -100,10 +100,13 @@ int regquerystr (UAEREG *root, const TCHAR *name, TCHAR *str, int *size)
                xfree (tmp);
                return ret;
        } else {
+               DWORD size2 = *size;
                HKEY rk = gr (root);
                if (!rk)
                        return 0;
-               return RegQueryValueEx (rk, name, 0, NULL, (LPBYTE)str, size) == ERROR_SUCCESS;
+               int v = RegQueryValueEx (rk, name, 0, NULL, (LPBYTE)str, &size2) == ERROR_SUCCESS;
+               *size = size2;
+               return v;
        }
 }
 
@@ -114,7 +117,7 @@ int regenumstr (UAEREG *root, int idx, TCHAR *name, int *nsize, TCHAR *str, int
        if (inimode) {
                int ret = 0;
                int tmpsize = 65536;
-               TCHAR *tmp = xmalloc (tmpsize * sizeof (TCHAR));
+               TCHAR *tmp = xmalloc (TCHAR, tmpsize);
                if (GetPrivateProfileSection (gs (root), tmp, tmpsize, inipath) > 0) {
                        int i;
                        TCHAR *p = tmp, *p2;
@@ -134,10 +137,15 @@ int regenumstr (UAEREG *root, int idx, TCHAR *name, int *nsize, TCHAR *str, int
                xfree (tmp);
                return ret;
        } else {
+               DWORD nsize2 = *nsize;
+               DWORD size2 = *size;
                HKEY rk = gr (root);
                if (!rk)
                        return 0;
-               return RegEnumValue (rk, idx, name, nsize, NULL, NULL, (LPBYTE)str, size) == ERROR_SUCCESS;
+               int v = RegEnumValue (rk, idx, name, &nsize2, NULL, NULL, (LPBYTE)str, &size2) == ERROR_SUCCESS;
+               *nsize = nsize2;
+               *size = size2;
+               return v;
        }
 }
 
@@ -146,7 +154,7 @@ int regquerydatasize (UAEREG *root, const TCHAR *name, int *size)
        if (inimode) {
                int ret = 0;
                int csize = 65536;
-               TCHAR *tmp = xmalloc (csize * sizeof (TCHAR));
+               TCHAR *tmp = xmalloc (TCHAR, csize);
                if (regquerystr (root, name, tmp, &csize)) {
                        *size = _tcslen (tmp) / 2;
                        ret = 1;
@@ -157,17 +165,20 @@ int regquerydatasize (UAEREG *root, const TCHAR *name, int *size)
                HKEY rk = gr (root);
                if (!rk)
                        return 0;
-               return RegQueryValueEx(rk, name, 0, NULL, NULL, size) == ERROR_SUCCESS;
+               DWORD size2 = *size;
+               int v = RegQueryValueEx(rk, name, 0, NULL, NULL, &size2) == ERROR_SUCCESS;
+               *size = size2;
+               return v;
        }
 }
 
-int regsetdata (UAEREG *root, const TCHAR *name, void *str, int size)
+int regsetdata (UAEREG *root, const TCHAR *name, const void *str, int size)
 {
        if (inimode) {
-               uae_u8 *in = str;
+               uae_u8 *in = (uae_u8*)str;
                DWORD ret;
                int i;
-               TCHAR *tmp = xmalloc ((size * 2 + 1) * sizeof (TCHAR));
+               TCHAR *tmp = xmalloc (TCHAR, size * 2 + 1);
                for (i = 0; i < size; i++)
                        _stprintf (tmp + i * 2, L"%02X", in[i]); 
                ret = WritePrivateProfileString (gs (root), name, tmp, inipath);
@@ -186,8 +197,8 @@ int regquerydata (UAEREG *root, const TCHAR *name, void *str, int *size)
                int csize = (*size) * 2 + 1;
                int i, j;
                int ret = 0;
-               TCHAR *tmp = xmalloc (csize * sizeof (TCHAR));
-               uae_u8 *out = str;
+               TCHAR *tmp = xmalloc (TCHAR, csize);
+               uae_u8 *out = (uae_u8*)str;
 
                if (!regquerystr (root, name, tmp, &csize))
                        goto err;
@@ -217,7 +228,10 @@ err:
                HKEY rk = gr (root);
                if (!rk)
                        return 0;
-               return RegQueryValueEx(rk, name, 0, NULL, str, size) == ERROR_SUCCESS;
+               DWORD size2 = *size;
+               int v = RegQueryValueEx(rk, name, 0, NULL, (LPBYTE)str, &size2) == ERROR_SUCCESS;
+               *size = size2;
+               return v;
        }
 }
 
@@ -238,7 +252,7 @@ int regexists (UAEREG *root, const TCHAR *name)
 {
        if (inimode) {
                int ret = 1;
-               TCHAR *tmp = xmalloc ((_tcslen (PUPPA) + 1) * sizeof (TCHAR));
+               TCHAR *tmp = xmalloc (TCHAR, _tcslen (PUPPA) + 1);
                int size = _tcslen (PUPPA) + 1;
                GetPrivateProfileString (gs (root), name, PUPPA, tmp, size, inipath);
                if (!_tcscmp (tmp, PUPPA))
@@ -278,7 +292,7 @@ int regexiststree (UAEREG *root, const TCHAR *name)
                TCHAR *s = gsn (root, name);
                if (!s)
                        return 0;
-               tmp = xmalloc (tmpsize);
+               tmp = xmalloc (TCHAR, tmpsize / sizeof (TCHAR));
                tmp[0] = 0;
                GetPrivateProfileSectionNames (tmp, tmpsize, inipath);
                p = tmp;
@@ -320,10 +334,10 @@ UAEREG *regcreatetree (UAEREG *root, const TCHAR *name)
                        else
                                ininame = my_strdup (name);
                } else {
-                       ininame = xmalloc ((_tcslen (root->inipath) + 1 + _tcslen (name) + 1) * sizeof (TCHAR));
+                       ininame = xmalloc (TCHAR, _tcslen (root->inipath) + 1 + _tcslen (name) + 1);
                        _stprintf (ininame, L"%s/%s", root->inipath, name);
                }
-               fkey = xcalloc (sizeof (UAEREG), 1);
+               fkey = xcalloc (UAEREG, 1);
                fkey->inipath = ininame;
        } else {
                DWORD err;
@@ -338,7 +352,7 @@ UAEREG *regcreatetree (UAEREG *root, const TCHAR *name)
                        KEY_READ | KEY_WRITE, NULL, &rkey, NULL);
                if (err != ERROR_SUCCESS)
                        return 0;
-               fkey = xcalloc (sizeof (UAEREG), 1);
+               fkey = xcalloc (UAEREG, 1);
                fkey->fkey = rkey;
        }
        return fkey;
similarity index 99%
rename from od-win32/rp.c
rename to od-win32/rp.cpp
index ef303f3125ae6e4cce638f2102e0c9bfee16e283..c74888bc0fc897664cfb8cc1b649320b6a2ef3eb 100644 (file)
@@ -827,7 +827,7 @@ static void rp_device_change (int dev, int num, const TCHAR *name)
        if (name != NULL)
                _tcscpy (np, name);
        dc_size = sizeof (struct RPDeviceContent) + (_tcslen (np) + 1) * sizeof (TCHAR);
-       dc = xcalloc (dc_size, 1);
+       dc = (RPDeviceContent*)xcalloc (uae_u8, dc_size);
        dc->btDeviceCategory = dev;
        dc->btDeviceNumber = num;
        _tcscpy (dc->szContent, np);
similarity index 99%
rename from od-win32/scaler.c
rename to od-win32/scaler.cpp
index 51be377d6608f5ca87471e48040fc206237e57dd..0bc947f6e355c09d35e0e73e8d2ce672d10192b2 100644 (file)
 
 /* Scaler (except Scale2x) code borrowed from ScummVM project */
 
+extern int cpu_mmx;
+
+extern "C"
+{
+
 #include "sysconfig.h"
 #include "sysdeps.h"
 
@@ -845,7 +850,6 @@ void _2xSaI_32(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPi
 */
 
 #define MMX
-extern int cpu_mmx;
 
 /* Suggested in "Intel Optimization" for Pentium II */
 #define ASM_JUMP_ALIGN ".p2align 4\n"
@@ -1886,3 +1890,4 @@ void hq_init (int rb, int gb, int bb, int rs, int gs, int bs)
        }
 }
 
+}
similarity index 100%
rename from od-win32/scaler2.c
rename to od-win32/scaler2.cpp
similarity index 96%
rename from od-win32/screenshot.c
rename to od-win32/screenshot.cpp
index 02174cd66577ac3d03784cbaed53c45cf2d2f3ef..07c075dc2642613a1c38ce0128aa7fac1507762d 100644 (file)
@@ -21,7 +21,7 @@
 #include "png.h"
 
 int screenshotmode = PNG_SCREENSHOTS;
-DWORD screenshot_originalsize = 0;
+int screenshot_originalsize = 0;
 
 static void namesplit (TCHAR *s)
 {
@@ -52,7 +52,7 @@ static int toclipboard (BITMAPINFO *bi, void *bmp)
        EmptyClipboard ();
        hg = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, bi->bmiHeader.biSize + bi->bmiHeader.biSizeImage);
        if (hg) {
-               dib = GlobalLock (hg);
+               dib = (uae_u8*)GlobalLock (hg);
                if (dib) {
                        memcpy (dib, &bi->bmiHeader, bi->bmiHeader.biSize);
                        memcpy (dib + bi->bmiHeader.biSize, bmp, bi->bmiHeader.biSizeImage);
@@ -94,7 +94,7 @@ static int rgb_rb, rgb_gb, rgb_bb, rgb_rs, rgb_gs, rgb_bs;
 
 int screenshot_prepare (void)
 {
-       unsigned int width, height;
+       int width, height;
        HGDIOBJ hgdiobj;
        int bits;
 
@@ -122,7 +122,7 @@ int screenshot_prepare (void)
                bi.bmiHeader.biYPelsPerMeter = 0;
                bi.bmiHeader.biClrUsed = 0;
                bi.bmiHeader.biClrImportant = 0;
-               if (!(lpvBits = xmalloc (bi.bmiHeader.biSizeImage)))
+               if (!(lpvBits = xmalloc (uae_u8, bi.bmiHeader.biSizeImage)))
                        goto oops;
                dst = (uae_u8*)lpvBits + (height - 1) * dpitch;
                for (y = 0; y < height; y++) {
@@ -203,7 +203,7 @@ donormal:
                bi.bmiHeader.biClrImportant = 0;
 
                // Reserve memory for bitmap bits
-               if (!(lpvBits = xmalloc (bi.bmiHeader.biSizeImage)))
+               if (!(lpvBits = xmalloc (uae_u8, bi.bmiHeader.biSizeImage)))
                        goto oops; // out of memory
 
                // Have GetDIBits convert offscreen_bitmap to a DIB (device-independent bitmap):
@@ -235,10 +235,11 @@ void Screenshot_RGBinfo (int rb, int gb, int bb, int rs, int gs, int bs)
 
 static void _cdecl pngtest_blah (png_structp png_ptr, png_const_charp message)
 {
-       TCHAR *name = L"unknown";
+       TCHAR *name = au ("unknown");
        if (png_ptr != NULL && png_ptr->error_ptr != NULL)
-               name = png_ptr->error_ptr;
+               name = au ((char*)png_ptr->error_ptr);
        write_log (L"%s: libpng warning: %s\n", name, message);
+       xfree (name);
 }
 
 static int savepng (FILE *fp)
@@ -268,7 +269,7 @@ static int savepng (FILE *fp)
        png_set_IHDR (png_ptr, info_ptr,
                w, h, 8, PNG_COLOR_TYPE_RGB,
                PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
-       row_pointers = xmalloc (h * sizeof (png_bytep*));
+       row_pointers = xmalloc (png_bytep, h);
        for (i = 0; i < h; i++) {
                int j = h - i - 1;
                row_pointers[i] = (uae_u8*)lpvBits + j * (((w * 24 + 31) & ~31) / 8);
similarity index 99%
rename from od-win32/serial_win32.c
rename to od-win32/serial_win32.cpp
index c62c9bdf469b1b86e9688ff7eed54feddda52380..c8a5faff1d1d6fe8bc784b9bb09cba86dcc0ea4c 100644 (file)
@@ -578,7 +578,7 @@ static void enet_service (int serveronly)
                                        {
                                                uae_u8 *p = evt.packet->data;
                                                int len = evt.packet->dataLength;
-                                               if (len == 6 && !strncmp (p, "UAE_", 4)) {
+                                               if (len == 6 && !memcmp (p, "UAE_", 4)) {
                                                        if (((enet_receive_off_w + 1) & 0xff) != enet_receive_off_r) {
                                                                enet_receive[enet_receive_off_w++] = (p[4] << 8) | p[5];
                                                        }
@@ -720,7 +720,7 @@ int enet_open (TCHAR *name)
                enet_close ();
                return 0;
        }
-       strcpy (data, "UAE_HELLO");
+       memcpy (data, "UAE_HELLO", 10);
        p = enet_packet_create (data, sizeof data, ENET_PACKET_FLAG_RELIABLE);
        enet_peer_send (enetpeer, 0, p);
        enet_host_flush (enetclient);
@@ -734,7 +734,7 @@ void enet_writeser (uae_u16 w)
        ENetPacket *p;
        uae_u8 data[16];
 
-       strcpy (data, "UAE_");
+       memcpy (data, "UAE_", 4);
        data[4] = w >> 8;
        data[5] = w >> 0;
        write_log (L"W=%04X ", w);
similarity index 100%
rename from od-win32/sfhelper.c
rename to od-win32/sfhelper.cpp
similarity index 100%
rename from od-win32/shm.c
rename to od-win32/shm.cpp
similarity index 90%
rename from od-win32/sounddep/sound.c
rename to od-win32/sounddep/sound.cpp
index 8c491bad6171f0000b57cd7f06445b4d8fe75e10..0464972db4bdb171b180b852db08f3de1d57386e 100644 (file)
@@ -53,7 +53,7 @@ struct sound_dp
        LPDIRECTSOUNDBUFFER8 lpDSBsecondary;
        DWORD writepos;
        int dsoundbuf;
-       int safedist;
+       DWORD safedist;
        int snd_writeoffset;
        int snd_maxoffset;
        int snd_totalmaxoffset_uf;
@@ -97,7 +97,7 @@ struct sound_dp
        UINT64 wasapiclock;
 #endif
        REFERENCE_TIME hnsRequestedDuration;
-       int bufferFrameCount;
+       UINT32 bufferFrameCount;
        UINT64 wasapiframes;
        int wasapiexclusive;
        int framecounter;
@@ -207,7 +207,7 @@ static void pause_audio_wasapi (struct sound_data *sd)
        struct sound_dp *s = sd->data;
        HRESULT hr;
 
-       hr = s->pAudioClient->lpVtbl->Stop (s->pAudioClient);
+       hr = s->pAudioClient->Stop ();
        if (FAILED (hr))
                write_log (L"WASAPI: Stop() %08X\n", hr);
 }
@@ -218,15 +218,15 @@ static void resume_audio_wasapi (struct sound_data *sd)
        BYTE *pData;
        int framecnt;
 
-       hr = s->pAudioClient->lpVtbl->Reset (s->pAudioClient);
+       hr = s->pAudioClient->Reset ();
        if (FAILED (hr))
                write_log (L"WASAPI: Reset() %08X\n", hr);
        framecnt = s->wasapigoodsize;
-       hr = s->pRenderClient->lpVtbl->GetBuffer (s->pRenderClient, framecnt, &pData);
+       hr = s->pRenderClient->GetBuffer (framecnt, &pData);
        if (FAILED (hr))
                return;
-       hr = s->pRenderClient->lpVtbl->ReleaseBuffer (s->pRenderClient, framecnt, AUDCLNT_BUFFERFLAGS_SILENT);
-       hr = s->pAudioClient->lpVtbl->Start (s->pAudioClient);
+       hr = s->pRenderClient->ReleaseBuffer (framecnt, AUDCLNT_BUFFERFLAGS_SILENT);
+       hr = s->pAudioClient->Start ();
        if (FAILED (hr))
                write_log (L"WASAPI: Start() %08X\n", hr);
        s->wasapiframes = 0;
@@ -366,8 +366,8 @@ static void recalc_offsets (struct sound_data *sd)
        s->snd_totalmaxoffset_uf = s->max_sndbufsize + (s->dsoundbuf - s->max_sndbufsize) * 7 / 9;
 }
 
-const static GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001,0x0000,0x0010,
-{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}};
+//const static GUID KSDATAFORMAT_SUBTYPE_PCM = {0x00000001,0x0000,0x0010,
+//{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}};
 #define KSAUDIO_SPEAKER_QUAD_SURROUND   (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \
        SPEAKER_SIDE_LEFT  | SPEAKER_SIDE_RIGHT)
 
@@ -385,7 +385,7 @@ static DWORD fillsupportedmodes (struct sound_data *sd, int freq, struct dsaudio
        DWORD rn[4];
        struct sound_dp *s = sd->data;
        LPDIRECTSOUND8 lpDS = s->lpDS;
-       static done;
+       static int done;
 
        if (done)
                return speakerconfig;
@@ -475,7 +475,7 @@ static int _cdecl portAudioCallback (const void *inputBuffer, void *outputBuffer
        PaStreamCallbackFlags statusFlags,
        void *userData)
 {
-       struct sound_data *sd = userData;
+       struct sound_data *sd = (struct sound_data*)userData;
        struct sound_dp *s = sd->data;
 
        if (framesPerBuffer != sd->sndbufsize / (sd->channels * 2)) {
@@ -584,7 +584,7 @@ static int open_audio_pa (struct sound_data *sd, int index)
        //    }
        s->paevent = CreateEvent (NULL, FALSE, FALSE, NULL);
        for (i = 0; i < 2; i++)
-               s->pasoundbuffer[i] = xcalloc (sd->sndbufsize, 1);
+               s->pasoundbuffer[i] = xcalloc (uae_u8, sd->sndbufsize);
        name = au (di->name);
        write_log (L"PASOUND: CH=%d,FREQ=%d (%s) '%s' buffer %d\n",
                ch, freq, sound_devices[index].name, name, sd->sndbufsize);
@@ -633,7 +633,7 @@ static int open_audio_al (struct sound_data *sd, int index)
        if (sd->sndbufsize > SND_MAX_BUFFER)
                sd->sndbufsize = SND_MAX_BUFFER;
        s->al_bufsize = size;
-       s->al_bigbuffer = xcalloc (s->al_bufsize, 1);
+       s->al_bigbuffer = xcalloc (uae_u8, s->al_bufsize);
        name = ua (sound_devices[index].alname);
        s->al_dev = alcOpenDevice (name);
        xfree (name);
@@ -680,25 +680,19 @@ static void close_audio_wasapi (struct sound_data *sd)
        struct sound_dp *s = sd->data;
 
        if (s->pRenderClient)
-               s->pRenderClient->lpVtbl->Release (s->pRenderClient);
+               s->pRenderClient->Release ();
 #if 0
        if (s->pAudioClock)
-               s->pAudioClock->lpVtbl->Release (s->pAudioClock);
+               s->pAudioClock->Release ();
 #endif
        if (s->pAudioClient)
-               s->pAudioClient->lpVtbl->Release (s->pAudioClient);
+               s->pAudioClient->Release ();
        if (s->pDevice)
-               s->pDevice->lpVtbl->Release (s->pDevice);
+               s->pDevice->Release ();
        if (s->pEnumerator)
-               s->pEnumerator->lpVtbl->Release (s->pEnumerator);
+               s->pEnumerator->Release ();
 }
 
-const static GUID XIID_IAudioClient = {0x1CB9AD4C,0xDBFA,0x4c32,{0xB1,0x78,0xC2,0xF5,0x68,0xA7,0x03,0xB2}};
-const static GUID XIID_IAudioRenderClient = {0xF294ACFC,0x3146,0x4483,{0xA7,0xBF,0xAD,0xDC,0xA7,0xC2,0x60,0xE2}};
-const static GUID XIID_IMMDeviceEnumerator = {0xA95664D2,0x9614,0x4F35,{0xA7,0x46,0xDE,0x8D,0xB6,0x36,0x17,0xE6}};
-const static GUID XCLSID_MMDeviceEnumerator = {0xBCDE0395,0xE52F,0x467C,{0x8E,0x3D,0xC4,0x57,0x92,0x91,0x69,0x2E}};
-const static GUID XIID_IAudioClock = {0xCD63314F,0x3FBA,0x4a1b,{0x81,0x2C,0xEF,0x96,0x35,0x87,0x28,0xE7}};
-
 static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive)
 {
        HRESULT hr;
@@ -719,8 +713,8 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive)
        else
                sharemode = AUDCLNT_SHAREMODE_SHARED;
 
-       hr = CoCreateInstance (&XCLSID_MMDeviceEnumerator, NULL,
-               CLSCTX_ALL, &XIID_IMMDeviceEnumerator,
+       hr = CoCreateInstance (__uuidof(MMDeviceEnumerator), NULL,
+               CLSCTX_ALL, __uuidof(IMMDeviceEnumerator),
                (void**)&s->pEnumerator);
        if (FAILED (hr)) {
                write_log (L"WASAPI: %d\n", hr);
@@ -728,33 +722,33 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive)
        }
 
        if (sound_devices[index].alname == NULL)
-               hr = s->pEnumerator->lpVtbl->GetDefaultAudioEndpoint (s->pEnumerator, eRender, eMultimedia, &s->pDevice);
+               hr = s->pEnumerator->GetDefaultAudioEndpoint (eRender, eMultimedia, &s->pDevice);
        else
-               hr = s->pEnumerator->lpVtbl->GetDevice (s->pEnumerator, sound_devices[index].alname, &s->pDevice);
+               hr = s->pEnumerator->GetDevice (sound_devices[index].alname, &s->pDevice);
        if (FAILED (hr)) {
                write_log (L"WASAPI: GetDevice(%s) %08X\n", sound_devices[index].alname ? sound_devices[index].alname : L"NULL", hr);
                goto error;
        }
 
-       hr = s->pDevice->lpVtbl->GetId (s->pDevice, &name);
+       hr = s->pDevice->GetId (&name);
        if (FAILED (hr)) {
                write_log (L"WASAPI: GetId() %08X\n", hr);
                goto error;
        }
 
-       hr = s->pDevice->lpVtbl->Activate (s->pDevice, &XIID_IAudioClient, CLSCTX_ALL, NULL, (void**)&s->pAudioClient);
+       hr = s->pDevice->Activate (__uuidof(IAudioClient), CLSCTX_ALL, NULL, (void**)&s->pAudioClient);
        if (FAILED (hr)) {
                write_log (L"WASAPI: Activate() %d\n", hr);
                goto error;
        }
 
-       hr = s->pAudioClient->lpVtbl->GetMixFormat (s->pAudioClient, &pwfx);
+       hr = s->pAudioClient->GetMixFormat (&pwfx);
        if (FAILED (hr)) {
                write_log (L"WASAPI: GetMixFormat() %08X\n", hr);
                goto error;
        }
 
-       hr = s->pAudioClient->lpVtbl->GetDevicePeriod (s->pAudioClient, NULL, &s->hnsRequestedDuration);
+       hr = s->pAudioClient->GetDevicePeriod (NULL, &s->hnsRequestedDuration);
        if (FAILED (hr)) {
                write_log (L"WASAPI: GetDevicePeriod() %08X\n", hr);
                goto error;
@@ -795,7 +789,7 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive)
                wavfmt.Format.nAvgBytesPerSec = wavfmt.Format.nBlockAlign * wavfmt.Format.nSamplesPerSec;
                CoTaskMemFree (pwfx);
                pwfx = NULL;
-               hr = s->pAudioClient->lpVtbl->IsFormatSupported (s->pAudioClient, sharemode, &wavfmt.Format, &pwfx);
+               hr = s->pAudioClient->IsFormatSupported (sharemode, &wavfmt.Format, &pwfx);
                if (SUCCEEDED (hr) && hr != S_FALSE)
                        break;
                write_log (L"WASAPI: IsFormatSupported(%d,%08X,%d) (%d,%d) %08X\n",
@@ -867,16 +861,15 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive)
                        );
        }
 
-       hr = s->pAudioClient->lpVtbl->Initialize (s->pAudioClient,
-               sharemode, AUDCLNT_STREAMFLAGS_NOPERSIST,
+       hr = s->pAudioClient->Initialize (sharemode, AUDCLNT_STREAMFLAGS_NOPERSIST,
                s->hnsRequestedDuration, s->wasapiexclusive ? s->hnsRequestedDuration : 0, pwfx ? pwfx : &wavfmt.Format, NULL);
        if (hr == AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED) {
-               hr = s->pAudioClient->lpVtbl->GetBufferSize (s->pAudioClient, &s->bufferFrameCount);
+               hr = s->pAudioClient->GetBufferSize (&s->bufferFrameCount);
                if (FAILED (hr)) {
                        write_log (L"WASAPI: GetBufferSize() %08X\n", hr);
                        goto error;
                }
-               s->pAudioClient->lpVtbl->Release (s->pAudioClient);
+               s->pAudioClient->Release ();
                s->hnsRequestedDuration = // hns =
                        (REFERENCE_TIME)(
                        10000.0 * // (hns / ms) *
@@ -886,13 +879,12 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive)
                        + 0.5 // rounding
                        );
                s->hnsRequestedDuration *= sd->sndbufsize / 512;
-               hr = s->pDevice->lpVtbl->Activate (s->pDevice, &XIID_IAudioClient, CLSCTX_ALL, NULL, (void**)&s->pAudioClient);
+               hr = s->pDevice->Activate (__uuidof(IAudioClient), CLSCTX_ALL, NULL, (void**)&s->pAudioClient);
                if (FAILED (hr)) {
                        write_log (L"WASAPI: Activate() %08X\n", hr);
                        goto error;
                }
-               hr = s->pAudioClient->lpVtbl->Initialize (s->pAudioClient,
-                       sharemode, AUDCLNT_STREAMFLAGS_NOPERSIST,
+               hr = s->pAudioClient->Initialize (sharemode, AUDCLNT_STREAMFLAGS_NOPERSIST,
                        s->hnsRequestedDuration, s->wasapiexclusive ? s->hnsRequestedDuration : 0, pwfx ? pwfx : &wavfmt.Format, NULL);
        }
        if (FAILED (hr)) {
@@ -900,7 +892,7 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive)
                goto error;
        }
 
-       hr = s->pAudioClient->lpVtbl->GetBufferSize (s->pAudioClient, &s->bufferFrameCount);
+       hr = s->pAudioClient->GetBufferSize (&s->bufferFrameCount);
        if (FAILED (hr)) {
                write_log (L"WASAPI: GetBufferSize() %08X\n", hr);
                goto error;
@@ -915,17 +907,17 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive)
                + 0.5 // rounding
                );
 
-       hr = s->pAudioClient->lpVtbl->GetService (s->pAudioClient, &XIID_IAudioRenderClient, (void**)&s->pRenderClient);
+       hr = s->pAudioClient->GetService (__uuidof(IAudioRenderClient), (void**)&s->pRenderClient);
        if (FAILED (hr)) {
-               write_log (L"WASAPI: GetService(IID_IAudioRenderClient) %08X\n", hr);
+               write_log (L"WASAPI: GetService(IAudioRenderClient) %08X\n", hr);
                goto error;
        }
 #if 0
-       hr = s->pAudioClient->lpVtbl->GetService (s->pAudioClient, &XIID_IAudioClock, (void**)&s->pAudioClock);
+       hr = s->pAudioClient->GetService (IAudioClock, (void**)&s->pAudioClock);
        if (FAILED (hr)) {
-               write_log (L"WASAPI: GetService(IID_IAudioClock) %08X\n", hr);
+               write_log (L"WASAPI: GetService(IAudioClock) %08X\n", hr);
        } else {
-               hr = s->pAudioClock->lpVtbl->GetFrequency (s->pAudioClock, &s->wasapiclock);
+               hr = s->pAudioClock->GetFrequency (&s->wasapiclock);
                if (FAILED (hr)) {
                        write_log (L"WASAPI: GetFrequency() %08X\n", hr);
                }
@@ -1089,7 +1081,7 @@ static int open_audio_ds (struct sound_data *sd, int index)
 
        if (pdsb == NULL)
                goto error;
-       hr = IDirectSound_QueryInterface (pdsb, &IID_IDirectSoundBuffer8, (LPVOID*)&s->lpDSBsecondary);
+       hr = pdsb->QueryInterface (IID_IDirectSoundBuffer8, (LPVOID*)&s->lpDSBsecondary);
        if (FAILED (hr))  {
                write_log (L"DSSOUND: Secondary QueryInterface() failure: %s\n", DXError (hr));
                goto error;
@@ -1107,7 +1099,7 @@ error:
 int open_sound_device (struct sound_data *sd, int index, int exclusive, int bufsize, int freq, int channels)
 {
        int ret = 0;
-       struct sound_dp *sdp = xcalloc (sizeof (struct sound_dp), 1);
+       struct sound_dp *sdp = xcalloc (struct sound_dp, 1);
        sd->data = sdp;
        sd->sndbufsize = bufsize;
        sd->freq = freq;
@@ -1578,7 +1570,8 @@ static void finish_sound_buffer_wasapi (struct sound_data *sd, uae_u16 *sndbuffe
        BYTE *pData;
        DWORD v;
        double skipmode;
-       int numFramesPadding, avail;
+       UINT32 numFramesPadding;
+       int avail;
        int stuck = 2000;
        int oldpadding = 0;
 
@@ -1592,7 +1585,7 @@ static void finish_sound_buffer_wasapi (struct sound_data *sd, uae_u16 *sndbuffe
        }
 
        for (;;) {
-               hr = s->pAudioClient->lpVtbl->GetCurrentPadding (s->pAudioClient, &numFramesPadding);
+               hr = s->pAudioClient->GetCurrentPadding (&numFramesPadding);
                if (FAILED (hr)) {
                        write_log (L"WASAPI: GetCurrentPadding() %08X\n", hr);
                        return;
@@ -1618,10 +1611,10 @@ static void finish_sound_buffer_wasapi (struct sound_data *sd, uae_u16 *sndbuffe
                skipmode = sync_sound (gui_data.sndbuf / 70.0);
                sound_setadjust (skipmode);
        }
-       hr = s->pRenderClient->lpVtbl->GetBuffer (s->pRenderClient, s->sndbufframes, &pData);
+       hr = s->pRenderClient->GetBuffer (s->sndbufframes, &pData);
        if (SUCCEEDED (hr)) {
                memcpy (pData, sndbuffer, sd->sndbufsize);
-               s->pRenderClient->lpVtbl->ReleaseBuffer (s->pRenderClient, s->sndbufframes, 0);
+               s->pRenderClient->ReleaseBuffer (s->sndbufframes, 0);
        }
 
 }
@@ -1641,14 +1634,14 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer)
                return;
 
        if (sd->waiting_for_buffer == 1) {
-               hr = IDirectSoundBuffer_Play (s->lpDSBsecondary, 0, 0, DSBPLAY_LOOPING);
+               hr = s->lpDSBsecondary->Play (0, 0, DSBPLAY_LOOPING);
                if (FAILED (hr)) {
                        write_log (L"DSSOUND: Play failed: %s\n", DXError (hr));
                        restore_ds (sd, DSERR_BUFFERLOST);
                        sd->waiting_for_buffer = 0;
                        return;
                }
-               hr = IDirectSoundBuffer_SetCurrentPosition (s->lpDSBsecondary, 0);
+               hr = s->lpDSBsecondary->SetCurrentPosition (0);
                if (FAILED (hr)) {
                        write_log (L"DSSOUND: 1st SetCurrentPosition failed: %s\n", DXError (hr));
                        restore_ds (sd, DSERR_BUFFERLOST);
@@ -1658,7 +1651,7 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer)
                /* there are crappy drivers that return PLAYCURSOR = WRITECURSOR = 0 without this.. */
                counter = 5000;
                for (;;) {
-                       hr = IDirectSoundBuffer_GetCurrentPosition (s->lpDSBsecondary, &playpos, &s->safedist);
+                       hr = s->lpDSBsecondary->GetCurrentPosition (&playpos, &s->safedist);
                        if (playpos > 0)
                                break;
                        sleep_millis (1);
@@ -1696,7 +1689,7 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer)
        }
 
        counter = 5000;
-       hr = IDirectSoundBuffer_GetStatus (s->lpDSBsecondary, &status);
+       hr = s->lpDSBsecondary->GetStatus (&status);
        if (FAILED (hr)) {
                write_log (L"DSSOUND: GetStatus() failed: %s\n", DXError (hr));
                restore_ds (sd, DSERR_BUFFERLOST);
@@ -1713,7 +1706,7 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer)
                return;
        }
        for (;;) {
-               hr = IDirectSoundBuffer_GetCurrentPosition (s->lpDSBsecondary, &playpos, &safepos);
+               hr = s->lpDSBsecondary->GetCurrentPosition (&playpos, &safepos);
                if (FAILED (hr)) {
                        restore_ds (sd, hr);
                        write_log (L"DSSOUND: GetCurrentPosition failed: %s\n", DXError (hr));
@@ -1769,7 +1762,7 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer)
                break;
        }
 
-       hr = IDirectSoundBuffer_Lock (s->lpDSBsecondary, s->writepos, sd->sndbufsize, &b1, &s1, &b2, &s2, 0);
+       hr = s->lpDSBsecondary->Lock (s->writepos, sd->sndbufsize, &b1, &s1, &b2, &s2, 0);
        if (restore_ds (sd, hr))
                return;
        if (FAILED (hr)) {
@@ -1779,7 +1772,7 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer)
        memcpy (b1, sndbuffer, s1);
        if (b2)
                memcpy (b2, (uae_u8*)sndbuffer + s1, s2);
-       IDirectSoundBuffer_Unlock (s->lpDSBsecondary, b1, s1, b2, s2);
+       s->lpDSBsecondary->Unlock (b1, s1, b2, s2);
 
        if (sd == sdp) {
                double vdiff, m, skipmode;
@@ -1874,7 +1867,7 @@ void finish_sound_buffer (void)
 
 static BOOL CALLBACK DSEnumProc (LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrvName, LPVOID lpContext)
 {
-       struct sound_device *sd = lpContext;
+       struct sound_device *sd = (struct sound_device*)lpContext;
        int i;
 
        for (i = 0; i < MAX_SOUND_DEVICES; i++) {
@@ -1907,35 +1900,34 @@ static void wasapi_enum (struct sound_device *sd)
        if (cnt >= MAX_SOUND_DEVICES)
                return;
 
-       hr = CoCreateInstance (&XCLSID_MMDeviceEnumerator, NULL,
-               CLSCTX_ALL, &XIID_IMMDeviceEnumerator,
-               (void**)&enumerator);
+       hr = CoCreateInstance (__uuidof(MMDeviceEnumerator), NULL,
+               CLSCTX_ALL, __uuidof(IMMDeviceEnumerator), (void**)&enumerator);
        if (SUCCEEDED (hr)) {
-               hr = enumerator->lpVtbl->EnumAudioEndpoints (enumerator, eRender, DEVICE_STATE_ACTIVE, &col);
+               hr = enumerator->EnumAudioEndpoints (eRender, DEVICE_STATE_ACTIVE, &col);
                if (SUCCEEDED (hr)) {
                        UINT num;
-                       hr = col->lpVtbl->GetCount (col, &num);
+                       hr = col->GetCount (&num);
                        if (SUCCEEDED (hr)) {
                                for (i = 0; i < num && cnt < MAX_SOUND_DEVICES; i++) {
                                        IMMDevice *dev;
                                        LPWSTR devid = NULL;
                                        LPWSTR devname = NULL;
-                                       hr = col->lpVtbl->Item (col, i, &dev);
+                                       hr = col->Item (i, &dev);
                                        if (SUCCEEDED (hr)) {
                                                IPropertyStore *prop;
-                                               dev->lpVtbl->GetId (dev, &devid);
-                                               hr = dev->lpVtbl->OpenPropertyStore (dev, STGM_READ, &prop);
+                                               dev->GetId (&devid);
+                                               hr = dev->OpenPropertyStore (STGM_READ, &prop);
                                                if (SUCCEEDED (hr)) {
                                                        PROPVARIANT pv;
                                                        PropVariantInit (&pv);
-                                                       hr = prop->lpVtbl->GetValue (prop, &PKEY_Device_FriendlyName, &pv);
+                                                       hr = prop->GetValue (PKEY_Device_FriendlyName, &pv);
                                                        if (SUCCEEDED (hr)) {
                                                                devname = my_strdup (pv.pwszVal);
                                                        }
                                                        PropVariantClear (&pv);
-                                                       prop->lpVtbl->Release (prop);
+                                                       prop->Release ();
                                                }
-                                               dev->lpVtbl->Release (dev);
+                                               dev->Release ();
                                        }
                                        if (devid && devname) {
                                                TCHAR tmp[MAX_DPATH];
@@ -1961,9 +1953,9 @@ static void wasapi_enum (struct sound_device *sd)
                                        CoTaskMemFree (devid);
                                }
                        }
-                       col->lpVtbl->Release (col);
+                       col->Release ();
                }
-               enumerator->lpVtbl->Release (enumerator);
+               enumerator->Release ();
        }
 }
 
@@ -2166,12 +2158,7 @@ int enumerate_sound_devices (void)
 /*
 Based on
 http://blogs.msdn.com/larryosterman/archive/2007/03/06/how-do-i-change-the-master-volume-in-windows-vista.aspx
-
 */
-const static GUID XIID_MMDeviceEnumerator = {0xBCDE0395,0xE52F,0x467C,
-{0x8E,0x3D,0xC4,0x57,0x92,0x91,0x69,0x2E}};
-const static GUID XIID_IAudioEndpointVolume = {0x5CDF2C82, 0x841E,0x4546,
-{0x97,0x22,0x0C,0xF7,0x40,0x78,0x22,0x9A}};
 
 static int setget_master_volume_vista (int setvolume, int *volume, int *mute)
 {
@@ -2184,33 +2171,33 @@ static int setget_master_volume_vista (int setvolume, int *volume, int *mute)
        hr = CoInitialize (NULL);
        if (FAILED (hr))
                return 0;
-       hr = CoCreateInstance (&XIID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &XIID_IMMDeviceEnumerator, (LPVOID *)&deviceEnumerator);
+       hr = CoCreateInstance (__uuidof(MMDeviceEnumerator), NULL, CLSCTX_INPROC_SERVER, __uuidof(IMMDeviceEnumerator), (LPVOID *)&deviceEnumerator);
        if (FAILED (hr))
                return 0;
-       hr = deviceEnumerator->lpVtbl->GetDefaultAudioEndpoint (deviceEnumerator, eRender, eConsole, &defaultDevice);
+       hr = deviceEnumerator->GetDefaultAudioEndpoint (eRender, eConsole, &defaultDevice);
        if (SUCCEEDED (hr)) {
-               hr = defaultDevice->lpVtbl->Activate (defaultDevice, &XIID_IAudioEndpointVolume, CLSCTX_INPROC_SERVER, NULL, (LPVOID *)&endpointVolume);
+               hr = defaultDevice->Activate (__uuidof(IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, (LPVOID *)&endpointVolume);
                if (SUCCEEDED (hr)) {
                        if (setvolume) {
-                               if (SUCCEEDED (endpointVolume->lpVtbl->SetMasterVolumeLevelScalar (endpointVolume, (float)(*volume) / (float)65535.0, NULL)))
+                               if (SUCCEEDED (endpointVolume->SetMasterVolumeLevelScalar ((float)(*volume) / (float)65535.0, NULL)))
                                        ok++;
-                               if (SUCCEEDED (endpointVolume->lpVtbl->SetMute (endpointVolume, *mute, NULL)))
+                               if (SUCCEEDED (endpointVolume->SetMute (*mute, NULL)))
                                        ok++;
                        } else {
                                float vol;
-                               if (SUCCEEDED (endpointVolume->lpVtbl->GetMasterVolumeLevelScalar (endpointVolume, &vol))) {
+                               if (SUCCEEDED (endpointVolume->GetMasterVolumeLevelScalar (&vol))) {
                                        ok++;
                                        *volume = vol * 65535.0;
                                }
-                               if (SUCCEEDED (endpointVolume->lpVtbl->GetMute (endpointVolume, mute))) {
+                               if (SUCCEEDED (endpointVolume->GetMute (mute))) {
                                        ok++;
                                }
                        }
-                       endpointVolume->lpVtbl->Release (endpointVolume);
+                       endpointVolume->Release ();
                }
-               defaultDevice->lpVtbl->Release (defaultDevice);
+               defaultDevice->Release ();
        }
-       deviceEnumerator->lpVtbl->Release (deviceEnumerator);
+       deviceEnumerator->Release ();
        CoUninitialize ();
        return ok == 2;
 }
index 68ad9a6b371b3c90a3e9ac2a076daa9680256198..1e6c97bcfa59c21bea7fc4aed1e437ef34c3aa62 100644 (file)
@@ -28,6 +28,8 @@ extern void sound_volume (int);
 extern void set_volume (int, int);
 extern void master_sound_volume (int);
 
+struct sound_dp;
+
 struct sound_data
 {
     int waiting_for_buffer;
@@ -39,7 +41,7 @@ struct sound_data
     int freq;
     int samplesize;
     int sndbufsize;
-    void *data;
+    struct sound_dp *data;
 };
 
 
index 398106692f41a4115992ea349686b5f0e7870182..a32dc93fa2e1b0a80c1b6d879c6224d379dd836b 100644 (file)
@@ -6,31 +6,31 @@ copy d:\amiga\text\winuaechangelog.txt c:\projects\winuae_bak\bak\od-win32
 copy d:\amiga\amiga\filesys.asm c:\projects\winuae_bak\bak
 
 cd bak
-del *.obj *.ilk *.exe *.pdb *.pch *.idb /s
+del *.obj *.ilk *.exe *.pdb *.pch *.idb *.ncb *.sln *.suo *.ncb *.sdf /s
 
 
 
-del cpudefs.c
+del cpudefs.cpp
 del blit.h
-del blitfunc.c
+del blitfunc.cpp
 del blitfunc.h
-del blittable.c
+del blittable.cpp
 del cputbl.h
-del cpustbl.c
-del compemu.c
+del cpustbl.cpp
+del compemu.cpp
 del comptbl.h
-del compstbl.c
-del cpuemu_0.c
-del cpuemu_11.c
-del cpuemu_12.c
-del cpuemu_21.c
-del cpuemu_31.c
-del linetoscr.c
+del compstbl.cpp
+del cpuemu_0.cpp
+del cpuemu_11.cpp
+del cpuemu_12.cpp
+del cpuemu_20.cpp
+del cpuemu_31.cpp
+del linetoscr.cpp
 
 cd jit
-del compemu.c
+del compemu.cpp
 del compstbl.h
-del compstbl.c
+del compstbl.cpp
 cd ..
 
 cd od-win32
@@ -82,27 +82,18 @@ rm -rf fullrelease
 cd ..
 
 cd winuae_msvc
-rm -f winuae_msvc.ncb
 rm -rf debug
 rm -rf release
 rm -rf fullrelease
 cd ..
 
 cd winuae_msvc10
-rm -f winuae_msvc.ncb
-rm -f winuae_msvc.sdf
 rm -rf debug
 rm -rf release
 rm -rf fullrelease
 rm -rf ipch
 cd ..
 
-cd soundcheck
-rm -rf debug
-rm -rf release
-rm -rf fullrelease
-cd ..
-
 cd singlefilehelper
 rm -rf debug
 rm -rf release
@@ -140,7 +131,7 @@ zip -9 -r winuaesrc *
 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 winuae_msvc\fullrelease\winuae.pdb
+zip -9 winuaedebug%1 winuae_msvc\release\winuae.pdb winuae_msvc\fullrelease\winuae.pdb winuae_msvc10\release\winuae.pdb  winuae_msvc10\fullrelease\winuae.pdb 
 move winuaedebug%1.zip d:\amiga\winuaepackets\
-copy winuae_msvc\fullrelease\winuae.pdb d:\amiga\dump
+copy winuae_msvc10\fullrelease\winuae.pdb d:\amiga\dump
 copy d:\amiga\winuae.exe d:\amiga\dump
similarity index 100%
rename from od-win32/support.c
rename to od-win32/support.cpp
similarity index 100%
rename from od-win32/tun.c
rename to od-win32/tun.cpp
index b60a1059b2566ebd2b50eda7cc19372f8db776d7..9cca58aa61796fd2316119552b31771cd78c941f 100644 (file)
                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
                        >
                        <File
-                               RelativePath="..\..\crc32.c"
+                               RelativePath="..\..\crc32.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\diskutil.c"
+                               RelativePath="..\..\diskutil.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\fdi2raw.c"
+                               RelativePath="..\..\fdi2raw.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\missing.c"
+                               RelativePath="..\..\missing.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\uaeunp.c"
+                               RelativePath="..\..\uaeunp.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\zfile.c"
+                               RelativePath="..\..\zfile.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\zfile_archive.c"
+                               RelativePath="..\..\zfile_archive.cpp"
                                >
                        </File>
                        <Filter
                                        Name="dms"
                                        >
                                        <File
-                                               RelativePath="..\..\archivers\dms\crc_csum.c"
+                                               RelativePath="..\..\archivers\dms\crc_csum.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\dms\getbits.c"
+                                               RelativePath="..\..\archivers\dms\getbits.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\dms\maketbl.c"
+                                               RelativePath="..\..\archivers\dms\maketbl.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\dms\pfile.c"
+                                               RelativePath="..\..\archivers\dms\pfile.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\dms\tables.c"
+                                               RelativePath="..\..\archivers\dms\tables.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\dms\u_deep.c"
+                                               RelativePath="..\..\archivers\dms\u_deep.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\dms\u_heavy.c"
+                                               RelativePath="..\..\archivers\dms\u_heavy.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\dms\u_init.c"
+                                               RelativePath="..\..\archivers\dms\u_init.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\dms\u_medium.c"
+                                               RelativePath="..\..\archivers\dms\u_medium.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\dms\u_quick.c"
+                                               RelativePath="..\..\archivers\dms\u_quick.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\dms\u_rle.c"
+                                               RelativePath="..\..\archivers\dms\u_rle.cpp"
                                                >
                                        </File>
                                </Filter>
                                        Name="7z"
                                        >
                                        <File
-                                               RelativePath="..\..\archivers\7z\Archive\7z\7zAlloc.c"
+                                               RelativePath="..\..\archivers\7z\Archive\7z\7zAlloc.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\7z\7zBuf.c"
+                                               RelativePath="..\..\archivers\7z\7zBuf.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\7z\7zCrc.c"
+                                               RelativePath="..\..\archivers\7z\7zCrc.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\7z\Archive\7z\7zDecode.c"
+                                               RelativePath="..\..\archivers\7z\Archive\7z\7zDecode.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\7z\Archive\7z\7zExtract.c"
+                                               RelativePath="..\..\archivers\7z\Archive\7z\7zExtract.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\7z\Archive\7z\7zHeader.c"
+                                               RelativePath="..\..\archivers\7z\Archive\7z\7zHeader.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\7z\Archive\7z\7zIn.c"
+                                               RelativePath="..\..\archivers\7z\Archive\7z\7zIn.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\7z\Archive\7z\7zItem.c"
+                                               RelativePath="..\..\archivers\7z\Archive\7z\7zItem.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\7z\7zStream.c"
+                                               RelativePath="..\..\archivers\7z\7zStream.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\7z\Bcj2.c"
+                                               RelativePath="..\..\archivers\7z\Bcj2.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\7z\Bra.c"
+                                               RelativePath="..\..\archivers\7z\Bra.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\7z\Bra86.c"
+                                               RelativePath="..\..\archivers\7z\Bra86.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\7z\LzmaDec.c"
+                                               RelativePath="..\..\archivers\7z\LzmaDec.cpp"
                                                >
                                        </File>
                                </Filter>
                                        Name="lha"
                                        >
                                        <File
-                                               RelativePath="..\..\archivers\lha\crcio.c"
+                                               RelativePath="..\..\archivers\lha\crcio.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\lha\dhuf.c"
+                                               RelativePath="..\..\archivers\lha\dhuf.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\lha\header.c"
+                                               RelativePath="..\..\archivers\lha\header.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\lha\huf.c"
+                                               RelativePath="..\..\archivers\lha\huf.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\lha\larc.c"
+                                               RelativePath="..\..\archivers\lha\larc.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\lha\lhamaketbl.c"
+                                               RelativePath="..\..\archivers\lha\lhamaketbl.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\lha\lharc.c"
+                                               RelativePath="..\..\archivers\lha\lharc.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\lha\shuf.c"
+                                               RelativePath="..\..\archivers\lha\shuf.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\lha\slide.c"
+                                               RelativePath="..\..\archivers\lha\slide.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\lha\uae_lha.c"
+                                               RelativePath="..\..\archivers\lha\uae_lha.cpp"
                                                >
                                        </File>
                                        <File
-                                               RelativePath="..\..\archivers\lha\util.c"
+                                               RelativePath="..\..\archivers\lha\util.cpp"
                                                >
                                        </File>
                                </Filter>
                                        Name="zip"
                                        >
                                        <File
-                                               RelativePath="..\..\archivers\zip\unzip.c"
+                                               RelativePath="..\..\archivers\zip\unzip.cpp"
                                                >
                                        </File>
                                </Filter>
                                        Name="lzx"
                                        >
                                        <File
-                                               RelativePath="..\..\archivers\lzx\unlzx.c"
+                                               RelativePath="..\..\archivers\lzx\unlzx.cpp"
                                                >
                                        </File>
                                </Filter>
                                        Name="wrp"
                                        >
                                        <File
-                                               RelativePath="..\..\archivers\wrp\warp.c"
+                                               RelativePath="..\..\archivers\wrp\warp.cpp"
                                                >
                                        </File>
                                </Filter>
                                Name="win32"
                                >
                                <File
-                                       RelativePath="..\caps\caps_win32.c"
+                                       RelativePath="..\caps\caps_win32.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\fsdb_mywin32.c"
+                                       RelativePath="..\fsdb_mywin32.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\posixemu.c"
+                                       RelativePath="..\posixemu.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\uaeunp_win32.c"
+                                       RelativePath="..\uaeunp_win32.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\unicode.c"
+                                       RelativePath="..\unicode.cpp"
                                        >
                                </File>
                        </Filter>
index b45efcfb45e67726a07970bf516efd0c43cce6bb..e9554e88531c014aa6f2a772c8f71565f847d3b9 100644 (file)
@@ -48,7 +48,7 @@
     <ClCompile>
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>..\..\include;..\..;..\;..\resources;..\osdep;..\sounddep;..\..\prowizard\include;..\tun;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WINVER=0x0500;_DEBUG;WIN32_IE=0x0700;WIN32;CINTERFACE;COBJMACROS;_CRT_SECURE_NO_WARNINGS;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WINVER=0x0500;_DEBUG;WIN32_IE=0x0700;WIN32;_CRT_SECURE_NO_WARNINGS;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@@ -56,6 +56,7 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+      <CompileAs>Default</CompileAs>
     </ClCompile>
     <Link>
       <AdditionalDependencies>zlibstat.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\crc32.c" />
-    <ClCompile Include="..\..\diskutil.c" />
-    <ClCompile Include="..\..\fdi2raw.c" />
-    <ClCompile Include="..\..\missing.c" />
-    <ClCompile Include="..\..\uaeunp.c" />
-    <ClCompile Include="..\..\zfile.c" />
-    <ClCompile Include="..\..\zfile_archive.c" />
-    <ClCompile Include="..\..\archivers\dms\crc_csum.c" />
-    <ClCompile Include="..\..\archivers\dms\getbits.c" />
-    <ClCompile Include="..\..\archivers\dms\maketbl.c" />
-    <ClCompile Include="..\..\archivers\dms\pfile.c" />
-    <ClCompile Include="..\..\archivers\dms\tables.c" />
-    <ClCompile Include="..\..\archivers\dms\u_deep.c" />
-    <ClCompile Include="..\..\archivers\dms\u_heavy.c" />
-    <ClCompile Include="..\..\archivers\dms\u_init.c" />
-    <ClCompile Include="..\..\archivers\dms\u_medium.c" />
-    <ClCompile Include="..\..\archivers\dms\u_quick.c" />
-    <ClCompile Include="..\..\archivers\dms\u_rle.c" />
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zAlloc.c" />
-    <ClCompile Include="..\..\archivers\7z\7zBuf.c" />
-    <ClCompile Include="..\..\archivers\7z\7zCrc.c" />
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zDecode.c" />
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zExtract.c" />
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zHeader.c" />
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zIn.c" />
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zItem.c" />
-    <ClCompile Include="..\..\archivers\7z\7zStream.c" />
-    <ClCompile Include="..\..\archivers\7z\Bcj2.c" />
-    <ClCompile Include="..\..\archivers\7z\Bra.c" />
-    <ClCompile Include="..\..\archivers\7z\Bra86.c" />
-    <ClCompile Include="..\..\archivers\7z\LzmaDec.c" />
-    <ClCompile Include="..\..\archivers\lha\crcio.c" />
-    <ClCompile Include="..\..\archivers\lha\dhuf.c" />
-    <ClCompile Include="..\..\archivers\lha\header.c" />
-    <ClCompile Include="..\..\archivers\lha\huf.c" />
-    <ClCompile Include="..\..\archivers\lha\larc.c" />
-    <ClCompile Include="..\..\archivers\lha\lhamaketbl.c" />
-    <ClCompile Include="..\..\archivers\lha\lharc.c" />
-    <ClCompile Include="..\..\archivers\lha\shuf.c" />
-    <ClCompile Include="..\..\archivers\lha\slide.c" />
-    <ClCompile Include="..\..\archivers\lha\uae_lha.c" />
-    <ClCompile Include="..\..\archivers\lha\util.c" />
-    <ClCompile Include="..\..\archivers\zip\unzip.c" />
-    <ClCompile Include="..\..\archivers\lzx\unlzx.c" />
-    <ClCompile Include="..\..\archivers\wrp\warp.c" />
-    <ClCompile Include="..\caps\caps_win32.c" />
-    <ClCompile Include="..\fsdb_mywin32.c" />
-    <ClCompile Include="..\posixemu.c" />
-    <ClCompile Include="..\uaeunp_win32.c" />
-    <ClCompile Include="..\unicode.c" />
+    <ClCompile Include="..\..\crc32.cpp" />
+    <ClCompile Include="..\..\diskutil.cpp" />
+    <ClCompile Include="..\..\fdi2raw.cpp" />
+    <ClCompile Include="..\..\missing.cpp" />
+    <ClCompile Include="..\..\uaeunp.cpp" />
+    <ClCompile Include="..\..\zfile.cpp" />
+    <ClCompile Include="..\..\zfile_archive.cpp" />
+    <ClCompile Include="..\..\archivers\dms\crc_csum.cpp" />
+    <ClCompile Include="..\..\archivers\dms\getbits.cpp" />
+    <ClCompile Include="..\..\archivers\dms\maketbl.cpp" />
+    <ClCompile Include="..\..\archivers\dms\pfile.cpp" />
+    <ClCompile Include="..\..\archivers\dms\tables.cpp" />
+    <ClCompile Include="..\..\archivers\dms\u_deep.cpp" />
+    <ClCompile Include="..\..\archivers\dms\u_heavy.cpp" />
+    <ClCompile Include="..\..\archivers\dms\u_init.cpp" />
+    <ClCompile Include="..\..\archivers\dms\u_medium.cpp" />
+    <ClCompile Include="..\..\archivers\dms\u_quick.cpp" />
+    <ClCompile Include="..\..\archivers\dms\u_rle.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zAlloc.cpp" />
+    <ClCompile Include="..\..\archivers\7z\7zBuf.cpp" />
+    <ClCompile Include="..\..\archivers\7z\7zCrc.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zDecode.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zExtract.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zHeader.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zIn.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zItem.cpp" />
+    <ClCompile Include="..\..\archivers\7z\7zStream.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Bcj2.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Bra.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Bra86.cpp" />
+    <ClCompile Include="..\..\archivers\7z\LzmaDec.cpp" />
+    <ClCompile Include="..\..\archivers\lha\crcio.cpp" />
+    <ClCompile Include="..\..\archivers\lha\dhuf.cpp" />
+    <ClCompile Include="..\..\archivers\lha\header.cpp" />
+    <ClCompile Include="..\..\archivers\lha\huf.cpp" />
+    <ClCompile Include="..\..\archivers\lha\larc.cpp" />
+    <ClCompile Include="..\..\archivers\lha\lhamaketbl.cpp" />
+    <ClCompile Include="..\..\archivers\lha\lharc.cpp" />
+    <ClCompile Include="..\..\archivers\lha\shuf.cpp" />
+    <ClCompile Include="..\..\archivers\lha\slide.cpp" />
+    <ClCompile Include="..\..\archivers\lha\uae_lha.cpp" />
+    <ClCompile Include="..\..\archivers\lha\util.cpp" />
+    <ClCompile Include="..\..\archivers\zip\unzip.cpp" />
+    <ClCompile Include="..\..\archivers\lzx\unlzx.cpp" />
+    <ClCompile Include="..\..\archivers\wrp\warp.cpp" />
+    <ClCompile Include="..\caps\caps_win32.cpp" />
+    <ClCompile Include="..\fsdb_mywin32.cpp" />
+    <ClCompile Include="..\posixemu.cpp" />
+    <ClCompile Include="..\uaeunp_win32.cpp" />
+    <ClCompile Include="..\unicode.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index bec54a4af0e187fc088158887dd418b8432eb5c5..358d6fe0e26c665581479a5c8c9c4801cc6676fe 100644 (file)
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\crc32.c">
+    <ClCompile Include="..\..\crc32.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\diskutil.c">
+    <ClCompile Include="..\..\diskutil.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\fdi2raw.c">
+    <ClCompile Include="..\..\fdi2raw.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\missing.c">
+    <ClCompile Include="..\..\missing.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\uaeunp.c">
+    <ClCompile Include="..\..\uaeunp.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\zfile.c">
+    <ClCompile Include="..\..\zfile.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\zfile_archive.c">
+    <ClCompile Include="..\..\zfile_archive.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\crc_csum.c">
+    <ClCompile Include="..\..\archivers\dms\crc_csum.cpp">
       <Filter>Source Files\decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\getbits.c">
+    <ClCompile Include="..\..\archivers\dms\getbits.cpp">
       <Filter>Source Files\decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\maketbl.c">
+    <ClCompile Include="..\..\archivers\dms\maketbl.cpp">
       <Filter>Source Files\decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\pfile.c">
+    <ClCompile Include="..\..\archivers\dms\pfile.cpp">
       <Filter>Source Files\decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\tables.c">
+    <ClCompile Include="..\..\archivers\dms\tables.cpp">
       <Filter>Source Files\decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\u_deep.c">
+    <ClCompile Include="..\..\archivers\dms\u_deep.cpp">
       <Filter>Source Files\decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\u_heavy.c">
+    <ClCompile Include="..\..\archivers\dms\u_heavy.cpp">
       <Filter>Source Files\decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\u_init.c">
+    <ClCompile Include="..\..\archivers\dms\u_init.cpp">
       <Filter>Source Files\decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\u_medium.c">
+    <ClCompile Include="..\..\archivers\dms\u_medium.cpp">
       <Filter>Source Files\decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\u_quick.c">
+    <ClCompile Include="..\..\archivers\dms\u_quick.cpp">
       <Filter>Source Files\decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\u_rle.c">
+    <ClCompile Include="..\..\archivers\dms\u_rle.cpp">
       <Filter>Source Files\decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zAlloc.c">
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zAlloc.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\7zBuf.c">
+    <ClCompile Include="..\..\archivers\7z\7zBuf.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\7zCrc.c">
+    <ClCompile Include="..\..\archivers\7z\7zCrc.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zDecode.c">
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zDecode.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zExtract.c">
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zExtract.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zHeader.c">
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zHeader.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zIn.c">
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zIn.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zItem.c">
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zItem.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\7zStream.c">
+    <ClCompile Include="..\..\archivers\7z\7zStream.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Bcj2.c">
+    <ClCompile Include="..\..\archivers\7z\Bcj2.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Bra.c">
+    <ClCompile Include="..\..\archivers\7z\Bra.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Bra86.c">
+    <ClCompile Include="..\..\archivers\7z\Bra86.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\LzmaDec.c">
+    <ClCompile Include="..\..\archivers\7z\LzmaDec.cpp">
       <Filter>Source Files\decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\crcio.c">
+    <ClCompile Include="..\..\archivers\lha\crcio.cpp">
       <Filter>Source Files\decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\dhuf.c">
+    <ClCompile Include="..\..\archivers\lha\dhuf.cpp">
       <Filter>Source Files\decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\header.c">
+    <ClCompile Include="..\..\archivers\lha\header.cpp">
       <Filter>Source Files\decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\huf.c">
+    <ClCompile Include="..\..\archivers\lha\huf.cpp">
       <Filter>Source Files\decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\larc.c">
+    <ClCompile Include="..\..\archivers\lha\larc.cpp">
       <Filter>Source Files\decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\lhamaketbl.c">
+    <ClCompile Include="..\..\archivers\lha\lhamaketbl.cpp">
       <Filter>Source Files\decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\lharc.c">
+    <ClCompile Include="..\..\archivers\lha\lharc.cpp">
       <Filter>Source Files\decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\shuf.c">
+    <ClCompile Include="..\..\archivers\lha\shuf.cpp">
       <Filter>Source Files\decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\slide.c">
+    <ClCompile Include="..\..\archivers\lha\slide.cpp">
       <Filter>Source Files\decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\uae_lha.c">
+    <ClCompile Include="..\..\archivers\lha\uae_lha.cpp">
       <Filter>Source Files\decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\util.c">
+    <ClCompile Include="..\..\archivers\lha\util.cpp">
       <Filter>Source Files\decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\zip\unzip.c">
+    <ClCompile Include="..\..\archivers\zip\unzip.cpp">
       <Filter>Source Files\decompressors\zip</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lzx\unlzx.c">
+    <ClCompile Include="..\..\archivers\lzx\unlzx.cpp">
       <Filter>Source Files\decompressors\lzx</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\wrp\warp.c">
+    <ClCompile Include="..\..\archivers\wrp\warp.cpp">
       <Filter>Source Files\decompressors\wrp</Filter>
     </ClCompile>
-    <ClCompile Include="..\caps\caps_win32.c">
+    <ClCompile Include="..\caps\caps_win32.cpp">
       <Filter>Source Files\win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\fsdb_mywin32.c">
+    <ClCompile Include="..\fsdb_mywin32.cpp">
       <Filter>Source Files\win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\posixemu.c">
+    <ClCompile Include="..\posixemu.cpp">
       <Filter>Source Files\win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\uaeunp_win32.c">
+    <ClCompile Include="..\uaeunp_win32.cpp">
       <Filter>Source Files\win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\unicode.c">
+    <ClCompile Include="..\unicode.cpp">
       <Filter>Source Files\win32</Filter>
     </ClCompile>
   </ItemGroup>
similarity index 89%
rename from od-win32/uaeunp_win32.c
rename to od-win32/uaeunp_win32.cpp
index 1ac23c8a25b0ee7850e756afa1eae3d25218cde7..1bd2961c538a8b9fa792b16bf3d0f3d11fbf5960 100644 (file)
@@ -29,7 +29,7 @@ HMODULE WIN32_LoadLibrary (const TCHAR *name)
 #endif
     int round;
 
-    newname = xmalloc ((_tcslen (name) + 1 + 10) * sizeof (TCHAR));
+    newname = xmalloc (TCHAR, _tcslen (name) + 1 + 10);
     if (!newname)
        return NULL;
     for (round = 0; round < 4; round++) {
@@ -57,7 +57,7 @@ HMODULE WIN32_LoadLibrary (const TCHAR *name)
            break;
        }
 #endif
-       s = xmalloc ((_tcslen (start_path_exe) + _tcslen (WIN32_PLUGINDIR) + _tcslen (newname) + 1) * sizeof (TCHAR));
+       s = xmalloc (TCHAR, _tcslen (start_path_exe) + _tcslen (WIN32_PLUGINDIR) + _tcslen (newname) + 1);
        if (s) {
            _stprintf (s, L"%s%s%s", start_path_exe, WIN32_PLUGINDIR, newname);
            m = LoadLibrary (s);
similarity index 96%
rename from od-win32/unicode.c
rename to od-win32/unicode.cpp
index 7f716796ac8e80c688d8f22d88de39352f9747f3..4228484fbef7cba13cad2945470270000514bca8 100644 (file)
@@ -47,7 +47,7 @@ char *uutf8 (const WCHAR *s)
                err (__FUNCTION__, s, NULL, CP_UTF8);
                return strdup ("");
        }
-       d = xmalloc (len + 1);
+       d = xmalloc (char, len + 1);
        WideCharToMultiByte (CP_UTF8, 0, s, -1, d, len, 0, FALSE);
        return d;
 }
@@ -61,9 +61,9 @@ WCHAR *utf8u (const char *s)
        len = MultiByteToWideChar (CP_UTF8, 0, s, -1, NULL, 0);
        if (!len) {
                err (__FUNCTION__, NULL, s, CP_UTF8);
-               return xcalloc (2, 1);
+               return xcalloc (WCHAR, 1);
        }
-       d = xmalloc ((len + 1) * sizeof (WCHAR));
+       d = xmalloc (WCHAR, len + 1);
        MultiByteToWideChar (CP_UTF8, 0, s, -1, d, len);
        return d;
 }
@@ -80,7 +80,7 @@ static char *ua_2 (const WCHAR *s, UINT cp)
                err (__FUNCTION__, s, NULL, cp);
                return strdup ("");
        }
-       d = xmalloc (len + 1);
+       d = xmalloc (char, len + 1);
        WideCharToMultiByte (cp, 0, s, -1, d, len, 0, FALSE);
        return d;
 }
@@ -104,9 +104,9 @@ static WCHAR *au_2 (const char *s, UINT cp)
        len = MultiByteToWideChar (cp, 0, s, -1, NULL, 0);
        if (!len) {
                err (__FUNCTION__, NULL, s, cp);
-               return xcalloc (2, 1);
+               return xcalloc (WCHAR, 1);
        }
-       d = xmalloc ((len + 1) * sizeof (WCHAR));
+       d = xmalloc (WCHAR, len + 1);
        MultiByteToWideChar (cp, 0, s, -1, d, len);
        return d;
 }
@@ -166,7 +166,7 @@ char *ua_fs (const WCHAR *s, int defchar)
                err (__FUNCTION__, s, NULL, fscodepage);
                return strdup ("");
        }
-       d = xmalloc (len + 1);
+       d = xmalloc (char, len + 1);
        dc = FALSE;
        WideCharToMultiByte (fscodepage, DWFLAGS | WC_NO_BEST_FIT_CHARS, s, -1, d, len, &def, &dc);
        if (dc) {
@@ -235,7 +235,7 @@ WCHAR *au_fs (const char *s)
        WCHAR *d;
        
        len = strlen (s);
-       d = xmalloc ((len + 1) * sizeof (WCHAR));
+       d = xmalloc (WCHAR, len + 1);
        for (i = 0; i < len; i++)
                d[i] = aufstable[(uae_u8)s[i]];
        d[len] = 0;
similarity index 98%
rename from od-win32/win32.c
rename to od-win32/win32.cpp
index 68ffccbc366bf61a285b4b6b30db4e971bc4b618..bf25f7056eb7bfb4be8a0ff0a1a5020a57956c56 100644 (file)
@@ -99,7 +99,7 @@ extern int console_logging;
 OSVERSIONINFO osVersion;
 static SYSTEM_INFO SystemInfo;
 static int logging_started;
-static DWORD minidumpmode = MiniDumpNormal;
+static MINIDUMP_TYPE minidumpmode = MiniDumpNormal;
 static int doquit;
 static int console_started;
 void *globalipc, *serialipc;
@@ -164,7 +164,7 @@ TCHAR start_path_new1[MAX_DPATH]; /* AF2005 */
 TCHAR start_path_new2[MAX_DPATH]; /* AMIGAFOREVERDATA */
 TCHAR help_file[MAX_DPATH];
 int af_path_2005, af_path_old;
-DWORD quickstart = 1, configurationcache = 1;
+int quickstart = 1, configurationcache = 1;
 
 static int multi_display = 1;
 static TCHAR *inipath = NULL;
@@ -201,7 +201,7 @@ static int init_mmtimer (void)
        int i;
 
        mm_timerres = 0;
-       if (timeGetDevCaps (&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR)
+       if (timeGetDevCaps (&tc, sizeof (TIMECAPS)) != TIMERR_NOERROR)
                return 0;
        mm_timerres = min (max (tc.wPeriodMin, 1), tc.wPeriodMax);
        sleep_resolution = 1000 / mm_timerres;
@@ -224,7 +224,7 @@ void sleep_millis (int ms)
        if (timehandlecounter >= MAX_TIMEHANDLES)
                timehandlecounter = 0;
        LeaveCriticalSection (&cs_time);
-       TimerEvent = timeSetEvent (ms, 0, timehandle[cnt], 0, TIME_ONESHOT | TIME_CALLBACK_EVENT_SET);
+       TimerEvent = timeSetEvent (ms, 0, (LPTIMECALLBACK)timehandle[cnt], 0, TIME_ONESHOT | TIME_CALLBACK_EVENT_SET);
        WaitForSingleObject (timehandle[cnt], ms);
        ResetEvent (timehandle[cnt]);
        timeKillEvent (TimerEvent);
@@ -1838,7 +1838,7 @@ HMODULE language_load (WORD language)
                if (result)  {
                        dwFileVersionInfoSize = GetFileVersionInfoSize (dllbuf, &dwVersionHandle);
                        if (dwFileVersionInfoSize) {
-                               if (lpFileVersionData = xcalloc (1, dwFileVersionInfoSize)) {
+                               if (lpFileVersionData = xcalloc (uae_u8, dwFileVersionInfoSize)) {
                                        if (GetFileVersionInfo (dllbuf, dwVersionHandle, dwFileVersionInfoSize, lpFileVersionData)) {
                                                VS_FIXEDFILEINFO *vsFileInfo = NULL;
                                                UINT uLen;
@@ -2045,7 +2045,7 @@ uae_u8 *save_log (int bootlog, int *len)
        if (size > 30000)
                size = 30000;
        if (size > 0) {
-               dst = xcalloc (1, size + 1);
+               dst = xcalloc (uae_u8, size + 1);
                if (dst)
                        fread (dst, 1, size, f);
                fclose (f);
@@ -2105,7 +2105,7 @@ uae_u8 *target_load_keyfile (struct uae_prefs *p, TCHAR *path, int *sizep, TCHAR
                //write_log (L"size: %d\n", size);
                if (size > 0) {
                        int gotsize;
-                       keybuf = xmalloc (size);
+                       keybuf = xmalloc (uae_u8, size);
                        gotsize = pfnGetKey (keybuf, size);
                        //write_log (L"gotsize: %d\n", gotsize);
                        if (gotsize != size) {
@@ -2120,9 +2120,9 @@ uae_u8 *target_load_keyfile (struct uae_prefs *p, TCHAR *path, int *sizep, TCHAR
 }
 
 
-extern TCHAR *get_aspi_path(int);
+extern const TCHAR *get_aspi_path (int);
 
-static get_aspi (int old)
+static int get_aspi (int old)
 {
        if ((old == UAESCSI_SPTI || old == UAESCSI_SPTISCAN) && os_winnt_admin)
                return old;
@@ -2370,7 +2370,7 @@ static TCHAR **parseargstring (TCHAR *s)
                return NULL;
        wparse_cmdline (s, NULL, NULL, &numa, &numc);
        numa++;
-       p = xcalloc (numa * sizeof (TCHAR*) + numc * sizeof (TCHAR), 1);
+       p = (TCHAR**)xcalloc (uae_u8, numa * sizeof (TCHAR*) + numc * sizeof (TCHAR));
        wparse_cmdline (s, (wchar_t **)p, (wchar_t *)(((char *)p) + numa * sizeof(wchar_t *)), &numa, &numc);
        if (numa > MAX_ARGUMENTS)
                p[MAX_ARGUMENTS] = NULL;
@@ -2399,7 +2399,7 @@ static void shellexecute (TCHAR *command)
                        i++;
                }
                exec = NULL;
-               cmd = xcalloc (len, sizeof (TCHAR));
+               cmd = xcalloc (TCHAR, len);
                for (k = j; k < i; k++) {
                        int quote = 0;
                        if (_tcslen (cmd) > 0)
@@ -2415,7 +2415,7 @@ static void shellexecute (TCHAR *command)
                                int size;
                                size = GetEnvironmentVariable (L"ComSpec", NULL, 0);
                                if (size > 0) {
-                                       exec = xcalloc (size + 1, sizeof (TCHAR));
+                                       exec = xcalloc (TCHAR, size + 1);
                                        GetEnvironmentVariable (L"ComSpec", exec, size);
                                }
                                cmd[0] = 0;
@@ -3357,7 +3357,7 @@ static void WIN32_HandleRegistryStuff (void)
        RGBFTYPE colortype = RGBFB_NONE;
        DWORD dwType = REG_DWORD;
        DWORD dwDisplayInfoSize = sizeof (colortype);
-       DWORD size;
+       int size;
        TCHAR path[MAX_DPATH] = L"";
        TCHAR version[100];
 
@@ -3688,7 +3688,7 @@ static void getstartpaths (void)
        xstart_path_uae[0] = xstart_path_old[0] = xstart_path_new1[0] = xstart_path_new2[0] = 0;
        key = regcreatetree (NULL, NULL);
        if (key)  {
-               DWORD size = sizeof (prevpath) / sizeof (TCHAR);
+               int size = sizeof (prevpath) / sizeof (TCHAR);
                if (!regquerystr (key, L"PathMode", prevpath, &size))
                        prevpath[0] = 0;
                regclosetree (key);
@@ -4056,7 +4056,7 @@ static int parseargs (const TCHAR *arg, const TCHAR *np, const TCHAR *np2)
                return 2;
        }
        if (!_tcscmp (arg, L"-minidumpmode")) {
-               minidumpmode = getval (np);
+               minidumpmode = (MINIDUMP_TYPE)getval (np);
                return 2;
        }
        if (!_tcscmp (arg, L"-jitevent")) {
@@ -4195,7 +4195,7 @@ static TCHAR **WIN32_InitRegistry (TCHAR **argv)
 {
        DWORD disposition;
        TCHAR tmp[MAX_DPATH];
-       DWORD size = sizeof tmp / sizeof (TCHAR);
+       int size = sizeof tmp / sizeof (TCHAR);
 
        reginitializeinit (inipath);
        hWinUAEKey = NULL;
@@ -4257,7 +4257,7 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR
        hMutex = CreateMutex (NULL, FALSE, L"WinUAE Instantiated"); // To tell the installer we're running
 
 
-       argv = xcalloc (sizeof (TCHAR*), MAX_ARGUMENTS);
+       argv = xcalloc (TCHAR*, MAX_ARGUMENTS);
        argv3 = NULL;
        argc = process_arg (lpCmdLine, argv, &argv3);
        if (doquit)
@@ -4408,7 +4408,7 @@ int driveclick_loadresource (struct drvsample *sp, int drivetype)
                if (res != 0) {
                        HANDLE h = LoadResource (NULL, res);
                        int len = SizeofResource (NULL, res);
-                       uae_u8 *p = LockResource (h);
+                       uae_u8 *p = (uae_u8*)LockResource (h);
                        s->p = decodewav (p, &len);
                        s->len = len;
                } else {
@@ -4450,7 +4450,7 @@ static void savedump (MINIDUMPWRITEDUMP dump, HANDLE f, struct _EXCEPTION_POINTE
        MINIDUMP_EXCEPTION_INFORMATION exinfo;
        MINIDUMP_USER_STREAM_INFORMATION musi, *musip;
        MINIDUMP_USER_STREAM mus[2], *musp;
-       uae_char *log;
+       uae_u8 *log;
        int loglen;
 
        musip = NULL;
@@ -4736,7 +4736,7 @@ HMODULE WIN32_LoadLibrary_2 (const TCHAR *name, int expand)
 #endif
        int round;
 
-       newname = xmalloc ((_tcslen (name) + 1 + 10) * sizeof (TCHAR));
+       newname = xmalloc (TCHAR, _tcslen (name) + 1 + 10);
        if (!newname)
                return NULL;
        for (round = 0; round < 4; round++) {
@@ -4754,8 +4754,8 @@ HMODULE WIN32_LoadLibrary_2 (const TCHAR *name, int expand)
                        break;
                case 1:
                        p = _tcschr (newname, '.');
-                       _tcscpy(p, L"_64");
-                       _tcscat(p, _tcschr (name, '.'));
+                       _tcscpy (p, L"_64");
+                       _tcscat (p, _tcschr (name, '.'));
                        break;
                case 2:
                        p = _tcschr (newname, '.');
@@ -4764,18 +4764,18 @@ HMODULE WIN32_LoadLibrary_2 (const TCHAR *name, int expand)
                        break;
                }
 #endif
-               s = xmalloc ((_tcslen (start_path_exe) + _tcslen (WIN32_PLUGINDIR) + _tcslen (newname) + 1) * sizeof (TCHAR));
+               s = xmalloc (TCHAR, _tcslen (start_path_exe) + _tcslen (WIN32_PLUGINDIR) + _tcslen (newname) + 1);
                if (s) {
                        _stprintf (s, L"%s%s%s", start_path_exe, WIN32_PLUGINDIR, newname);
                        m = LoadLibrary (s);
-                       LLError(m, s);
+                       LLError (m, s);
                        if (m) {
                                xfree (s);
                                goto end;
                        }
                        _stprintf (s, L"%s%s", start_path_exe, newname);
                        m = LoadLibrary (s);
-                       LLError(m ,s);
+                       LLError (m ,s);
                        if (m) {
                                xfree (s);
                                goto end;
@@ -4813,7 +4813,7 @@ int isdllversion (const TCHAR *name, int version, int revision, int subver, int
 
        dwFileVersionInfoSize = GetFileVersionInfoSize (name, &dwVersionHandle);
        if (dwFileVersionInfoSize) {
-               if (lpFileVersionData = xcalloc (1, dwFileVersionInfoSize)) {
+               if (lpFileVersionData = xcalloc (uae_u8, dwFileVersionInfoSize)) {
                        if (GetFileVersionInfo (name, dwVersionHandle, dwFileVersionInfoSize, lpFileVersionData)) {
                                VS_FIXEDFILEINFO *vsFileInfo = NULL;
                                UINT uLen;
@@ -4871,9 +4871,9 @@ void target_addtorecent (const TCHAR *name, int t)
                if (!pSHCreateItemFromParsingName)
                        return;
                shard.pszAppID = WINUAEAPPNAME;
-               if (SUCCEEDED (pSHCreateItemFromParsingName (tmp, NULL, &IID_IShellItem, &shard.psi))) {
+               if (SUCCEEDED (pSHCreateItemFromParsingName (tmp, NULL, IID_IShellItem, (void**)&shard.psi))) {
                        SHAddToRecentDocs (SHARD_APPIDINFO, &shard);
-                       IShellItem_Release (shard.psi);
+                       shard.psi->Release();
                }
        } else {
                SHAddToRecentDocs (SHARD_PATH, tmp);
index 0b20ff39694ccc45770f06862f4a3727b9b71aa1..3561792246b9662c796f944e454042f2def017fd 100644 (file)
@@ -18,8 +18,8 @@
 #define WINUAEPUBLICBETA 1
 #define LANG_DLL 1
 
-#define WINUAEBETA L"10"
-#define WINUAEDATE MAKEBD(2010, 2, 10)
+#define WINUAEBETA L"11"
+#define WINUAEDATE MAKEBD(2010, 2, 13)
 #define WINUAEEXTRA L""
 #define WINUAEREV L""
 
@@ -65,7 +65,6 @@ extern void resumepaused (int priority);
 extern void setpaused (int priority);
 
 void finishjob (void);
-void updatedisplayarea (void);
 void init_colors (void);
 
 extern int pause_emulation;
@@ -78,7 +77,7 @@ extern int os_winnt_admin, os_64bit, os_vista, os_winxp, os_win7;
 extern OSVERSIONINFO osVersion;
 extern int paraport_mask;
 extern int gui_active;
-extern DWORD quickstart, configurationcache;
+extern int quickstart, configurationcache;
 
 extern HKEY hWinUAEKey;
 extern int screen_is_picasso, scalepicasso;
similarity index 99%
rename from od-win32/win32_filesys.c
rename to od-win32/win32_filesys.cpp
index 6b0e9d8729c1404844311c7b73ec9389869e9ee4..a259c1e8cdebfd5a2f8bb0d6aba2f86c1084b1c9 100644 (file)
@@ -99,7 +99,7 @@ static int getidfromhandle (HANDLE h)
        VOLUME_DISK_EXTENTS *vde;
 
        outsize = sizeof (VOLUME_DISK_EXTENTS) + sizeof (DISK_EXTENT) * 32;
-       vde = xmalloc (outsize);
+       vde = (VOLUME_DISK_EXTENTS*)xmalloc (uae_u8, outsize);
        if (DeviceIoControl (h, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, NULL, 0, vde, outsize, &written, NULL)) {
                if (vde->NumberOfDiskExtents > 0)
                        drvnum = vde->Extents[0].DiskNumber;
similarity index 99%
rename from od-win32/win32_scale2x.c
rename to od-win32/win32_scale2x.cpp
index dcf4e5b9de0e8cf95ada43f0af4e1d0e5292080a..ad8c16dd5affec4cab07f9eee3715d3074523ba3 100644 (file)
@@ -528,8 +528,8 @@ void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd)
        if (usedfilter->type == UAE_FILTER_HQ) {
                int w = amiga_width > dst_width ? amiga_width : dst_width;
                int h = amiga_height > dst_height ? amiga_height : dst_height;
-               tempsurf2 = xmalloc (w * h * (amiga_depth / 8) * ((scale + 1) / 2));
-               tempsurf3 = xmalloc (w * h *(dst_depth / 8) * 4 * scale);
+               tempsurf2 = xmalloc (uae_u8, w * h * (amiga_depth / 8) * ((scale + 1) / 2));
+               tempsurf3 = xmalloc (uae_u8, w * h *(dst_depth / 8) * 4 * scale);
                if (!d3d)
                        tempsurf = allocsystemsurface (temp_width, temp_height);
        } else {
@@ -548,7 +548,7 @@ void S2X_render (void)
        int ok = 0;
        RECT sr, dr, zr;
        DDSURFACEDESC2 desc;
-       DWORD pitch;
+       int pitch;
        uae_u8 *surfstart;
 
        aw = amiga_width;
similarity index 91%
rename from od-win32/win32_uaenet.c
rename to od-win32/win32_uaenet.cpp
index 0354ac9d9e88e562fcb9b58007bf015071170c6c..d021abbca536ebd4eedf0131250ba6ee877c82c5 100644 (file)
@@ -144,7 +144,7 @@ static void *uaenet_trap_thread (void *arg)
 
 static void *uaenet_trap_threadr (void *arg)
 {
-       struct uaenetdatawin32 *sd = arg;
+       struct uaenetdatawin32 *sd = (struct uaenetdatawin32*)arg;
        struct pcap_pkthdr *header;
        const u_char *pkt_data;
 
@@ -156,7 +156,7 @@ static void *uaenet_trap_threadr (void *arg)
                r = pcap_next_ex (sd->fp, &header, &pkt_data);
                if (r == 1) {
                        uae_sem_wait (&sd->change_sem);
-                       sd->gotfunc (sd->user, pkt_data, header->len);
+                       sd->gotfunc ((struct devstruct*)sd->user, pkt_data, header->len);
                        uae_sem_post (&sd->change_sem);
                }
                if (r < 0) {
@@ -171,7 +171,7 @@ static void *uaenet_trap_threadr (void *arg)
 
 static void *uaenet_trap_threadw (void *arg)
 {
-       struct uaenetdatawin32 *sd = arg;
+       struct uaenetdatawin32 *sd = (struct uaenetdatawin32*)arg;
 
        uae_set_thread_priority (NULL, 1);
        sd->threadactivew = 1;
@@ -180,7 +180,7 @@ static void *uaenet_trap_threadw (void *arg)
                int donotwait = 0;
                int towrite = sd->mtu;
                uae_sem_wait (&sd->change_sem);
-               if (sd->getfunc (sd->user, sd->writebuffer, &towrite)) {
+               if (sd->getfunc ((struct devstruct*)sd->user, sd->writebuffer, &towrite)) {
                        pcap_sendpacket (sd->fp, sd->writebuffer, towrite);
                        donotwait = 1;
                }
@@ -193,15 +193,17 @@ static void *uaenet_trap_threadw (void *arg)
        return 0;
 }
 
-void uaenet_trigger (struct uaenetdatawin32 *sd)
+void uaenet_trigger (void *vsd)
 {
+       struct uaenetdatawin32 *sd = (struct uaenetdatawin32*)vsd;
        if (!sd)
                return;
        SetEvent (sd->evttw);
 }
 
-int uaenet_open (struct uaenetdatawin32 *sd, struct netdriverdata *tc, void *user, uaenet_gotfunc *gotfunc, uaenet_getfunc *getfunc, int promiscuous)
+int uaenet_open (void *vsd, struct netdriverdata *tc, void *user, uaenet_gotfunc *gotfunc, uaenet_getfunc *getfunc, int promiscuous)
 {
+       struct uaenetdatawin32 *sd = (struct uaenetdatawin32*)vsd;
        char *s;
 
        s = ua (tc->name);
@@ -220,8 +222,8 @@ int uaenet_open (struct uaenetdatawin32 *sd, struct netdriverdata *tc, void *use
        if (!sd->evttw)
                goto end;
        sd->mtu = tc->mtu;
-       sd->readbuffer = xmalloc (sd->mtu);
-       sd->writebuffer = xmalloc (sd->mtu);
+       sd->readbuffer = xmalloc (uae_u8, sd->mtu);
+       sd->writebuffer = xmalloc (uae_u8, sd->mtu);
        sd->gotfunc = gotfunc;
        sd->getfunc = getfunc;
 
@@ -240,8 +242,9 @@ end:
        return 0;
 }
 
-void uaenet_close (struct uaenetdatawin32 *sd)
+void uaenet_close (void *vsd)
 {
+       struct uaenetdatawin32 *sd = (struct uaenetdatawin32*)vsd;
        if (!sd)
                return;
        if (sd->threadactiver) {
@@ -391,7 +394,7 @@ struct netdriverdata *uaenet_enumerate (struct netdriverdata **out, const TCHAR
                                write_log (L"- PacketOpenAdapter() failed\n");
                        continue;
                }
-               OidData = calloc (6 + sizeof(PACKET_OID_DATA), 1);
+               OidData = (PPACKET_OID_DATA)xcalloc (uae_u8, 6 + sizeof(PACKET_OID_DATA));
                if (OidData) {
                        OidData->Length = 6;
                        OidData->Oid = OID_802_3_CURRENT_ADDRESS;
@@ -408,7 +411,7 @@ struct netdriverdata *uaenet_enumerate (struct netdriverdata **out, const TCHAR
                        } else {
                                write_log (L" - failed to get MAC\n");
                        }
-                       free (OidData);
+                       xfree (OidData);
                }
                PacketCloseAdapter (lpAdapter);
        }
similarity index 99%
rename from od-win32/win32gfx.c
rename to od-win32/win32gfx.cpp
index 654a2b4a2cd1870d2a70f0a7a6b1eb9d67a3458b..ba5c1ba2ffef9fb1fc15ccafca63c999fde59fe1 100644 (file)
@@ -107,6 +107,8 @@ static struct winuae_currentmode *currentmode = &currentmodestruct;
 
 int screen_is_picasso = 0;
 
+extern int reopen (int);
+
 int WIN32GFX_IsPicassoScreen (void)
 {
        return screen_is_picasso;
@@ -175,7 +177,7 @@ int WIN32GFX_GetHeight (void)
 static int init_round;
 static BOOL doInit (void);
 
-uae_u32 default_freq = 0;
+int default_freq = 0;
 
 HWND hStatusWnd = NULL;
 
@@ -432,7 +434,7 @@ static void addmode (struct MultiDisplay *md, int w, int h, int d, int rate, int
 
 static HRESULT CALLBACK modesCallback (LPDDSURFACEDESC2 modeDesc, LPVOID context)
 {
-       struct MultiDisplay *md = context;
+       struct MultiDisplay *md = (struct MultiDisplay*)context;
        RGBFTYPE colortype;
        int depth, ct;
 
@@ -630,7 +632,7 @@ void sortdisplays (void)
 
        md1 = Displays;
        while (md1->name) {
-               md1->DisplayModes = xmalloc (sizeof (struct PicassoResolution) * MAX_PICASSO_MODES);
+               md1->DisplayModes = xmalloc (struct PicassoResolution, MAX_PICASSO_MODES);
                md1->DisplayModes[0].depth = -1;
                md1->disabled = 1;
                if (DirectDraw_Start (md1->primary ? NULL : &md1->guid)) {
@@ -712,7 +714,7 @@ void sortdisplays (void)
 /* DirectX will fail with "Mode not supported" if we try to switch to a full
 * screen mode that doesn't match one of the dimensions we got during enumeration.
 * So try to find a best match for the given resolution in our list.  */
-int WIN32GFX_AdjustScreenmode (struct MultiDisplay *md, uae_u32 *pwidth, uae_u32 *pheight, uae_u32 *ppixbits)
+int WIN32GFX_AdjustScreenmode (struct MultiDisplay *md, int *pwidth, int *pheight, int *ppixbits)
 {
        struct PicassoResolution *best;
        uae_u32 selected_mask = (*ppixbits == 8 ? RGBMASK_8BIT
@@ -1299,7 +1301,6 @@ int check_prefs_changed_gfx (void)
                        DirectDraw_BlitToPrimary (NULL);
                }
                if ((c & 16) || ((c & 8) && keepfsmode)) {
-                       extern int reopen (int);
                        if (reopen (c & 2))
                                c |= 2;
                }
@@ -1966,7 +1967,7 @@ static void createstatuswindow (void)
        /* Allocate an array for holding the right edge coordinates. */
        hloc = LocalAlloc (LHND, sizeof (int) * num_parts);
        if (hloc) {
-               lpParts = LocalLock (hloc);
+               lpParts = (LPINT)LocalLock (hloc);
                /* Calculate the right edge coordinate for each part, and copy the coords
                * to the array.  */
                lpParts[0] = rc.right - (drive_width * 4) - power_width - idle_width - fps_width - cd_width - hd_width - snd_width - extra;
@@ -2174,7 +2175,7 @@ static int create_windows_2 (void)
 
        if (!dxfs && !d3dfs)  {
                RECT rc;
-               LONG stored_x = 1, stored_y = cymenu + cyborder;
+               int stored_x = 1, stored_y = cymenu + cyborder;
                int oldx, oldy;
                int first = 2;
 
@@ -2467,7 +2468,7 @@ static BOOL doInit (void)
                int w = currentmode->amiga_width * 2;
                int h = currentmode->amiga_height * 2;
                int size = (w * 2) * (h * 3) * gfxvidinfo.pixbytes;
-               gfxvidinfo.realbufmem = xmalloc (size);
+               gfxvidinfo.realbufmem = xmalloc (uae_u8, size);
                memset (gfxvidinfo.realbufmem, 0, size);
                gfxvidinfo.bufmem = gfxvidinfo.realbufmem + (w + (w * 2) * h) * gfxvidinfo.pixbytes;
                gfxvidinfo.rowbytes = w * 2 * gfxvidinfo.pixbytes;
@@ -2476,7 +2477,7 @@ static BOOL doInit (void)
        } else if (currentmode->flags & DM_D3D) {
 
                int size = currentmode->amiga_width * currentmode->amiga_height * gfxvidinfo.pixbytes;
-               gfxvidinfo.realbufmem = xmalloc (size);
+               gfxvidinfo.realbufmem = xmalloc (uae_u8, size);
                gfxvidinfo.bufmem = gfxvidinfo.realbufmem;
                gfxvidinfo.rowbytes = currentmode->amiga_width * gfxvidinfo.pixbytes;
                gfxvidinfo.bufmemend = gfxvidinfo.bufmem + size;
index a75986352ab31b90fadc2642ad8ba74f9b1b9c42..905732f1861203a27611fd3afc7639d2fff0c058 100644 (file)
@@ -22,11 +22,11 @@ void WIN32GFX_WindowSize (void);;
 void DX_Invalidate (int x, int y, int width, int height);
 
 RGBFTYPE WIN32GFX_FigurePixelFormats (RGBFTYPE colortype);
-int WIN32GFX_AdjustScreenmode (struct MultiDisplay *md, uae_u32 *pwidth, uae_u32 *pheight, uae_u32 *ppixbits);
+int WIN32GFX_AdjustScreenmode (struct MultiDisplay *md, int *pwidth, int *pheight, int *ppixbits);
 extern HCURSOR normalcursor;
 
 extern HWND hStatusWnd;
-extern uae_u32 default_freq;
+extern int default_freq;
 extern int normal_display_change_starting;
 extern int window_led_drives, window_led_drives_end;
 extern int window_led_hd, window_led_hd_end;
similarity index 99%
rename from od-win32/win32gui.c
rename to od-win32/win32gui.cpp
index cf874bb8293d8dbaa4ce1077bd72c8e3e71b6b2f..429983ecc9c6479a0b40b769e701164fb1b63fa6 100644 (file)
@@ -135,9 +135,9 @@ void WIN32GUI_LoadUIString (DWORD id, TCHAR *string, DWORD dwStringLen)
                LoadString (hInst, id, string, dwStringLen);
 }
 
-static DWORD quickstart_model = 0, quickstart_conf = 0, quickstart_compa = 1;
-static DWORD quickstart_floppy = 1, quickstart_cd = 0;
-static DWORD quickstart_cdtype = 0;
+static int quickstart_model = 0, quickstart_conf = 0, quickstart_compa = 1;
+static int quickstart_floppy = 1, quickstart_cd = 0;
+static int quickstart_cdtype = 0;
 static int quickstart_ok, quickstart_ok_floppy;
 static void addfloppytype (HWND hDlg, int n);
 static void addfloppyhistory (HWND hDlg);
@@ -261,10 +261,10 @@ static BOOL GetFileDialog (OPENFILENAME *opn, const GUID *guid, int mode)
        pSHCreateItemFromParsingName = (SHCREATEITEMFROMPARSINGNAME)GetProcAddress (
                GetModuleHandle (L"shell32.dll"), "SHCreateItemFromParsingName");
        if (pSHCreateItemFromParsingName)
-               hr = CoCreateInstance (mode > 0 ? &CLSID_FileSaveDialog : &CLSID_FileOpenDialog
+               hr = CoCreateInstance (mode > 0 ? __uuidof(FileSaveDialog) : __uuidof(FileOpenDialog)
                NULL, 
                CLSCTX_INPROC_SERVER, 
-               mode > 0 ? &IID_IFileSaveDialog : &IID_IFileOpenDialog, (LPVOID*)&pfd);
+               mode > 0 ? IID_IFileSaveDialog : IID_IFileOpenDialog, (LPVOID*)&pfd);
        if (FAILED (hr)) {
                if (mode > 0)
                        return GetSaveFileName (opn);
@@ -273,16 +273,16 @@ static BOOL GetFileDialog (OPENFILENAME *opn, const GUID *guid, int mode)
                else
                        return DirectorySelection2 (opn);
        }
-       IFileDialog_GetOptions (pfd, &pfos);
+       pfd->GetOptions (&pfos);
        pfos |= FOS_FORCEFILESYSTEM;
        if (opn->Flags & OFN_ALLOWMULTISELECT)
                pfos |= FOS_ALLOWMULTISELECT;
        if (mode < 0)
                pfos |= FOS_PICKFOLDERS;
-       IFileDialog_SetOptions (pfd, pfos);
+       pfd->SetOptions (pfos);
 
        if (guid)
-               IFileDialog_SetClientGuid (pfd, guid);
+               pfd->SetClientGuid (*guid);
 
        if (opn->lpstrFilter) {
                const TCHAR *p = opn->lpstrFilter;
@@ -293,7 +293,7 @@ static BOOL GetFileDialog (OPENFILENAME *opn, const GUID *guid, int mode)
                        filtercnt++;
                }
                if (filtercnt) {
-                       fs = xmalloc (sizeof (COMDLG_FILTERSPEC) * filtercnt);
+                       fs = xmalloc (COMDLG_FILTERSPEC, filtercnt);
                        p = opn->lpstrFilter;
                        for (i = 0; i < filtercnt; i++) {
                                fs[i].pszName = p;
@@ -301,28 +301,28 @@ static BOOL GetFileDialog (OPENFILENAME *opn, const GUID *guid, int mode)
                                fs[i].pszSpec = p;
                                p += _tcslen (p) + 1;
                        }
-                       IFileDialog_SetFileTypes (pfd, filtercnt, fs);
+                       pfd->SetFileTypes (filtercnt, fs);
                }
-               IFileOpenDialog_SetFileTypeIndex (pfd, opn->nFilterIndex);
+               pfd->SetFileTypeIndex (opn->nFilterIndex);
        }
 
        if (opn->lpstrTitle) {
-               IFileDialog_SetTitle (pfd, opn->lpstrTitle);
+               pfd->SetTitle (opn->lpstrTitle);
        }
        if (opn->lpstrDefExt) {
-               IFileDialog_SetDefaultExtension (pfd, opn->lpstrDefExt);
+               pfd->SetDefaultExtension (opn->lpstrDefExt);
        }
        if (opn->lpstrInitialDir) {
                TCHAR tmp[MAX_DPATH];
                const TCHAR *p = opn->lpstrInitialDir;
                if (GetFullPathName (p, sizeof tmp / sizeof (TCHAR), tmp, NULL)) 
                        p = tmp;
-               hr = pSHCreateItemFromParsingName (p, NULL, &IID_IShellItem, &shellitem);
+               hr = pSHCreateItemFromParsingName (p, NULL, IID_IShellItem, (void**)&shellitem);
                if (SUCCEEDED (hr))
-                       IFileDialog_SetFolder (pfd, shellitem);
+                       pfd->SetFolder (shellitem);
        }
 
-       hr = IFileDialog_Show (pfd, opn->hwndOwner);
+       hr = pfd->Show (opn->hwndOwner);
        if (SUCCEEDED (hr)) {
                UINT idx;
                IShellItemArray *pitema;
@@ -332,10 +332,10 @@ static BOOL GetFileDialog (OPENFILENAME *opn, const GUID *guid, int mode)
                        opn->lpstrFileTitle[0] = 0;
                if (mode > 0) {
                        IShellItem *pitem;
-                       hr = IFileOpenDialog_GetResult (pfd, &pitem);
+                       hr = pfd->GetResult (&pitem);
                        if (SUCCEEDED (hr)) {
                                WCHAR *path = NULL;
-                               hr = IShellItem_GetDisplayName (pitem, SIGDN_FILESYSPATH, &path);
+                               hr = pitem->GetDisplayName (SIGDN_FILESYSPATH, &path);
                                if (SUCCEEDED (hr)) {
                                        TCHAR *p = opn->lpstrFile;
                                        _tcscpy (p, path);
@@ -344,21 +344,21 @@ static BOOL GetFileDialog (OPENFILENAME *opn, const GUID *guid, int mode)
                                        if (p && opn->lpstrFileTitle)
                                                _tcscpy (opn->lpstrFileTitle, p);
                                }
-                               IShellItem_Release (pitem);
+                               pitem->Release ();
                        }
                } else {
-                       hr = IFileOpenDialog_GetResults (pfd, &pitema);
+                       hr = pfd->GetResults (&pitema);
                        if (SUCCEEDED (hr)) {
                                DWORD cnt;
-                               hr = IShellItemArray_GetCount (pitema, &cnt);
+                               hr = pitema->GetCount (&cnt);
                                if (SUCCEEDED (hr)) {
                                        int i;
                                        for (i = 0; i < cnt; i++) {
                                                IShellItem *pitem;
-                                               hr = IShellItemArray_GetItemAt (pitema, i, &pitem);
+                                               hr = pitema->GetItemAt (i, &pitem);
                                                if (SUCCEEDED (hr)) {
                                                        WCHAR *path = NULL;
-                                                       hr = IShellItem_GetDisplayName (pitem, SIGDN_FILESYSPATH, &path);
+                                                       hr = pitem->GetDisplayName (SIGDN_FILESYSPATH, &path);
                                                        if (SUCCEEDED (hr)) {
                                                                TCHAR *p = opn->lpstrFile;
                                                                while (*p)
@@ -377,19 +377,19 @@ static BOOL GetFileDialog (OPENFILENAME *opn, const GUID *guid, int mode)
                                                }
                                        }
                                }
-                               IShellItemArray_Release (pitema);
+                               pitema->Release ();
                        }
                }
-               hr = IFileOpenDialog_GetFileTypeIndex (pfd, &idx);
+               hr = pfd->GetFileTypeIndex (&idx);
                if (SUCCEEDED (hr))
                        opn->nFilterIndex = idx;
                ret = 1;
        }
 
 
-       IFileDialog_Release (pfd);
+       pfd->Release ();
        if (shellitem)
-               IShellItem_Release (shellitem);
+               shellitem->Release ();
        if (filtercnt) {
                xfree (fs);
        }
@@ -467,11 +467,10 @@ UAEREG *read_disk_history (int type)
 {
        static int regread;
        TCHAR tmp2[1000];
-       DWORD size2;
+       int size, size2;
        int idx, idx2;
        UAEREG *fkey;
        TCHAR tmp[1000];
-       DWORD size;
 
        fkey = regcreatetree (NULL, type ? L"CDImageMRUList" : L"DiskImageMRUList");
        if (fkey == NULL || (regread & (1 << type)))
@@ -687,7 +686,7 @@ static TCHAR *favoritepopup (HWND hwnd)
                num = 0;
                for (;;) {
                        TCHAR *p;
-                       DWORD size, size2;
+                       int size, size2;
                        TCHAR tmp[1000], tmp2[1000];
                        size = sizeof (tmp) / sizeof (TCHAR);
                        size2 = sizeof (tmp2) / sizeof (TCHAR);
@@ -857,7 +856,7 @@ static int drag_end (HWND hWnd, HWND hListView, LPARAM lParam, int **draggeditem
        }
        if (cnt == 0)
                return -1;
-       *draggeditems = xmalloc (sizeof (int) * (cnt + 1));
+       *draggeditems = xmalloc (int, cnt + 1);
        iPos = ListView_GetNextItem(hListView, -1, LVNI_SELECTED);
        cnt = 0;
        while (iPos != -1) {
@@ -934,7 +933,7 @@ static struct romdata *scan_single_rom_2 (struct zfile *f)
        } else {
                zfile_fseek (f, 0, SEEK_SET);
        }
-       rombuf = xcalloc (size, 1);
+       rombuf = xcalloc (uae_u8, size);
        if (!rombuf)
                return 0;
        zfile_fread (rombuf, 1, size, f);
@@ -1036,7 +1035,7 @@ static int isromext (TCHAR *path)
        ext++;
 
        if (!_tcsicmp (ext, L"rom") ||  !_tcsicmp (ext, L"adf") || !_tcsicmp (ext, L"key")
-               || !_tcsicmp (ext, L"a500") || !_tcsicmp (ext, L"a1200") || !_tcsicmp (ext, L"a4000"))
+               || !_tcsicmp (ext, L"a500") || !_tcsicmp (ext, L"a1200") || !_tcsicmp (ext, L"a4000") || !_tcsicmp (ext, L"cd32"))
                return 1;
        if (_tcslen (ext) >= 2 && toupper(ext[0]) == 'U' && isdigit (ext[1]))
                return 1;
@@ -1047,8 +1046,9 @@ static int isromext (TCHAR *path)
        return 0;
 }
 
-static int scan_rom_2 (struct zfile *f, struct romscandata *rsd)
+static int scan_rom_2 (struct zfile *f, void *vrsd)
 {
+       struct romscandata *rsd = (struct romscandata*)vrsd;
        TCHAR *path = zfile_getname(f);
        struct romdata *rd;
 
@@ -1083,7 +1083,7 @@ static int scan_rom (TCHAR *path, UAEREG *fkey)
                }
                break;
        }
-       zfile_zopen (path, scan_rom_2, &rsd);
+       zfile_zopen (path, scan_rom_2, (void*)&rsd);
        return rsd.got;
 }
 
@@ -1131,7 +1131,7 @@ static void show_rom_list (void)
        _tcscat (unavail, L"\n");
        p1 = L"A500 Boot ROM 1.2\0A500 Boot ROM 1.3\0A500+\0A600\0A1000\0A1200\0A3000\0A4000\0\nCD32\0CDTV\0Arcadia Multi Select\0High end WinUAE\0\nA590/A2091 SCSI Boot ROM\0\0";
 
-       p = malloc (100000);
+       p = xmalloc (TCHAR, 100000);
        if (!p)
                return;
        WIN32GUI_LoadUIString (IDS_ROMSCANEND, p, 100);
@@ -1198,7 +1198,7 @@ static int scan_roms_2 (UAEREG *fkey, TCHAR *path)
 
 #define MAX_ROM_PATHS 10
 
-static int scan_roms_3(void *fkey, TCHAR **paths, TCHAR *path)
+static int scan_roms_3(UAEREG *fkey, TCHAR **paths, TCHAR *path)
 {
        int i, ret;
        TCHAR pathp[MAX_DPATH];
@@ -1334,7 +1334,7 @@ static struct ConfigStruct *getconfigstorefrompath (TCHAR *path, TCHAR *out, int
 int target_cfgfile_load (struct uae_prefs *p, TCHAR *filename, int type, int isdefault)
 {
        int v, i, type2;
-       DWORD ct, ct2, size;
+       int ct, ct2, size;
        TCHAR tmp1[MAX_DPATH], tmp2[MAX_DPATH];
        TCHAR fname[MAX_DPATH];
 
@@ -1946,11 +1946,11 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
                                TCHAR disk_name[32];
                                disk_name[0] = 0; disk_name[31] = 0;
                                GetDlgItemText (hDlg, IDC_CREATE_NAME, disk_name, 30);
-                               disk_creatediskfile (full_path, 0, SendDlgItemMessage (hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L), disk_name);
+                               disk_creatediskfile (full_path, 0, (drive_type)SendDlgItemMessage (hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L), disk_name);
                        }
                        break;
                case IDC_CREATE_RAW:
-                       disk_creatediskfile (full_path, 1, SendDlgItemMessage(hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L), NULL);
+                       disk_creatediskfile (full_path, 1, (drive_type)SendDlgItemMessage (hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L), NULL);
                        break;
                case IDC_LOAD:
                        if (target_cfgfile_load (&workprefs, full_path, 0, 0) == 0) {
@@ -2259,7 +2259,7 @@ struct ConfigStruct *AllocConfigStruct (void)
 {
        struct ConfigStruct *config;
 
-       config = xcalloc (sizeof (struct ConfigStruct), 1);
+       config = xcalloc (struct ConfigStruct, 1);
        return config;
 }
 
@@ -2421,7 +2421,7 @@ static struct ConfigStruct *readconfigcache (const TCHAR *path)
                cs = AllocConfigStruct ();
                if (configstore == NULL || configstoreallocated == configstoresize) {
                        configstoreallocated += 100;
-                       configstore = realloc (configstore, sizeof (struct ConfigStruct*) * configstoreallocated);
+                       configstore = xrealloc (struct ConfigStruct*, configstore, configstoreallocated);
                }
                configstore[configstoresize++] = cs;
                if (!first)
@@ -2703,7 +2703,7 @@ static struct ConfigStruct *GetConfigs (struct ConfigStruct *configparent, int u
                        config->Parent = configparent;
                        if (configstore == NULL || configstoreallocated == configstoresize) {
                                configstoreallocated += 100;
-                               configstore = realloc (configstore, sizeof (struct ConfigStruct*) * configstoreallocated);
+                               configstore = xrealloc (struct ConfigStruct*, configstore, configstoreallocated);
                        }
                        configstore[configstoresize++] = config;
                        if (first == NULL)
@@ -3548,7 +3548,7 @@ static struct ConfigStruct *initloadsave (HWND hDlg, struct ConfigStruct *config
 {
        HTREEITEM root;
        TCHAR name_buf[MAX_DPATH];
-       DWORD dwRFPsize = sizeof (name_buf) / sizeof (TCHAR);
+       int dwRFPsize = sizeof (name_buf) / sizeof (TCHAR);
        TCHAR path[MAX_DPATH];
 
        EnableWindow (GetDlgItem (hDlg, IDC_VIEWINFO), workprefs.info[0]);
@@ -6312,20 +6312,6 @@ static INT_PTR CALLBACK MemoryDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA
                enable_for_memorydlg (hDlg);
                break;
 
-       case WM_COMMAND:
-               {
-                       if (recursive > 0)
-                               break;
-                       recursive++;
-                       switch (LOWORD (wParam))
-                       {
-                               ;
-                       }
-                       if (HIWORD (wParam) == CBN_SELENDOK || HIWORD (wParam) == CBN_KILLFOCUS || HIWORD (wParam) == CBN_EDITCHANGE)  {
-                       }
-                       recursive--;
-               }
-               break;
        }
        return FALSE;
 }
@@ -6344,8 +6330,8 @@ static void addromfiles (UAEREG *fkey, HWND hDlg, DWORD d, TCHAR *path, int type
        idx = 0;
        seltmp[0] = 0;
        for (;fkey;) {
-               DWORD size = sizeof (tmp) / sizeof (TCHAR);
-               DWORD size2 = sizeof (tmp2) / sizeof (TCHAR);
+               int size = sizeof (tmp) / sizeof (TCHAR);
+               int size2 = sizeof (tmp2) / sizeof (TCHAR);
                if (!regenumstr (fkey, idx, tmp, &size, tmp2, &size2))
                        break;
                if (_tcslen (tmp) == 7 || _tcslen (tmp) == 13) {
@@ -6624,16 +6610,16 @@ static void misc_addpri (HWND hDlg, int v, int pri)
 
 }
 
-extern TCHAR *get_aspi_path (int);
+extern const TCHAR *get_aspi_path (int);
 
 static void misc_scsi (HWND hDlg)
 {
        SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_RESETCONTENT, 0, 0);
        SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)L"SPTI *");
        SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)L"SPTI + SCSI SCAN");
-       SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path(0)) ? L"AdaptecASPI" : L"(AdaptecASPI)"));
-       SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path(1)) ? L"NeroASPI" : L"(NeroASPI)"));
-       SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path(2)) ? L"FrogASPI" : L"(FrogASPI)"));
+       SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path (0)) ? L"AdaptecASPI" : L"(AdaptecASPI)"));
+       SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path (1)) ? L"NeroASPI" : L"(NeroASPI)"));
+       SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path (2)) ? L"FrogASPI" : L"(FrogASPI)"));
        SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_SETCURSEL, workprefs.win32_uaescsimode - 1, 0);
 }
 
@@ -7371,7 +7357,7 @@ static void sound_loaddrivesamples (void)
                                if (p - drivesounds < 1000) {
                                        TCHAR *oldp = p;
                                        len += 2000;
-                                       drivesounds = p = realloc (drivesounds, len);
+                                       drivesounds = p = xrealloc (TCHAR, drivesounds, len);
                                        if (oldp) {
                                                do {
                                                        p = p + _tcslen (p) + 1;
@@ -8000,7 +7986,7 @@ static void sethfdostype (HWND hDlg, int idx)
 
 static void hardfile_testrdb (HWND hDlg, struct hfdlg_vals *hdf)
 {
-       void *f = zfile_fopen (hdf->filename, L"rb", ZFD_NORMAL);
+       struct zfile *f = zfile_fopen (hdf->filename, L"rb", ZFD_NORMAL);
        uae_u8 tmp[8];
        int i;
 
@@ -8904,7 +8890,7 @@ static void addfloppytype (HWND hDlg, int n)
        chk = !showcd && disk_getwriteprotect (text) && state == TRUE ? BST_CHECKED : 0;
        if (f_wp >= 0)
                CheckDlgButton(hDlg, f_wp, chk);
-       chk = !showcd && state && DISK_validate_filename (text, 0, NULL, NULL) ? TRUE : FALSE;
+       chk = !showcd && state && DISK_validate_filename (text, 0, NULL, NULL, NULL) ? TRUE : FALSE;
        if (f_wp >= 0) {
                ew (hDlg, f_wp, chk);
                ew (hDlg, f_wptext, chk);
@@ -8958,7 +8944,7 @@ static int getfloppybox (HWND hDlg, int f_text, TCHAR *out, int maxlen, int type
        else
                SendDlgItemMessage (hDlg, f_text, WM_GETTEXT, (WPARAM)maxlen, (LPARAM)out);
 
-       tmp = xmalloc ((maxlen + 1) * sizeof (TCHAR));
+       tmp = xmalloc (TCHAR, maxlen + 1);
        _tcscpy (tmp, out);
        p1 = _tcsstr(tmp, L" { ");
        p2 = _tcsstr(tmp, L" }");
@@ -9984,7 +9970,7 @@ static void init_portsdlg (HWND hDlg)
                EnumPrinters (flags, NULL, 1, (LPBYTE)pInfo, 0, &needed, &dwEnumeratedPrinters);
                if (needed > 0) {
                        DWORD size = needed;
-                       pInfo = xcalloc (1, size);
+                       pInfo = (PRINTER_INFO_1*)xcalloc (uae_u8, size);
                        dwEnumeratedPrinters = 0;
                        EnumPrinters (flags, NULL, 1, (LPBYTE)pInfo, size, &needed, &dwEnumeratedPrinters);
                }
@@ -11058,7 +11044,7 @@ static void values_to_hw3ddlg (HWND hDlg)
        if (fkey) {
                int idx = 0;
                TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH];
-               DWORD size, size2;
+               int size, size2;
 
                for (;;) {
                        size = sizeof (tmp) / sizeof (TCHAR);
@@ -11090,7 +11076,7 @@ static void filter_preset (HWND hDlg, WPARAM wParam)
 {
        int ok, load, i, builtin, userfilter;
        TCHAR tmp1[MAX_DPATH], tmp2[MAX_DPATH];
-       DWORD outsize;
+       int outsize;
        UAEREG *fkey;
        LRESULT item;
 
@@ -12142,7 +12128,7 @@ static void centerWindow (HWND hDlg)
 {
        RECT rc, rcDlg, rcOwner;
        HWND owner = GetParent(hDlg);
-       LONG x = 0, y = 0;
+       int x = 0, y = 0;
        POINT pt1, pt2;
 
        if (owner == NULL)
@@ -12530,7 +12516,8 @@ struct newresource *getresource (int tmpl)
        HRSRC hrsrc;
        HGLOBAL res;
        HINSTANCE inst = hUIDLL ? hUIDLL : hInst;
-       void *resdata, *newres;
+       void *resdata;
+       LPCDLGTEMPLATEW newres;
        struct newresource *nr;
        int size;
 
@@ -12547,9 +12534,9 @@ struct newresource *getresource (int tmpl)
                return NULL;
        resdata = LockResource (res);
        size = SizeofResource (inst, hrsrc);
-       nr = xcalloc (sizeof (struct newresource), 1);
-       newres = xmalloc (size);
-       memcpy (newres, resdata, size);
+       nr = xcalloc (struct newresource, 1);
+       newres = (LPCDLGTEMPLATEW)xmalloc (uae_u8, size);
+       memcpy ((void*)newres, resdata, size);
        nr->resource = newres;
        nr->size = size;
        nr->tmpl = tmpl;
@@ -12595,7 +12582,7 @@ static int init_page (int tmpl, int icon, int title,
        INT_PTR (CALLBACK FAR *func) (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam), ACCEL *accels, TCHAR *help)
 {
        LPTSTR lpstrTitle;
-       static id = 0;
+       static int id = 0;
        int i = -1;
        struct newresource *res;
 
@@ -12604,7 +12591,7 @@ static int init_page (int tmpl, int icon, int title,
                return -1;
        ppage[id].nres = res;
        ppage[id].icon = MAKEINTRESOURCE (icon);
-       lpstrTitle = calloc (1, MAX_DPATH);
+       lpstrTitle = xcalloc (TCHAR, MAX_DPATH);
        LoadString (hUIDLL, title, lpstrTitle, MAX_DPATH);
        ppage[id].title = lpstrTitle;
        ppage[id].dlgproc = func;
@@ -12869,7 +12856,6 @@ void gui_exit (void)
 }
 
 extern HWND hStatusWnd;
-struct gui_info gui_data;
 
 void check_prefs_changed_gui (void)
 {
@@ -13067,7 +13053,8 @@ int gui_message_multibutton (int flags, const TCHAR *format,...)
        int flipflop = 0;
        int fullscreen = 0;
        int focuso = isfocus ();
-       int mbflags, ret;
+       int ret;
+       DWORD mbflags;
        HWND hwnd;
 
        mbflags = MB_ICONWARNING | MB_TASKMODAL;
index 9dde7c730af9c775e11c8c3382c09a297a2fd0b6..654ec5bf5c9745a279d191df724fa423cf1a94d4 100644 (file)
@@ -20,7 +20,7 @@ void write_disk_history (void);
 
 struct newresource
 {
-    void *resource;
+    LPCDLGTEMPLATEW resource;
     HINSTANCE inst;
     int size;
     int tmpl;
similarity index 92%
rename from od-win32/win32gui_extra.c
rename to od-win32/win32gui_extra.cpp
index ca9f0884c8ad5c77575c833422215e242f60c37b..f6b4f568d29384279ccd591d08d4730182e47566 100644 (file)
@@ -150,23 +150,23 @@ struct newresource *scaleresource (struct newresource *res, HWND parent)
        int i;
        struct newresource *ns;
 
-       d = res->resource;
-       d2 = res->resource;
+       d = (DLGTEMPLATEEX*)res->resource;
+       d2 = (DLGTEMPLATEEX_END*)res->resource;
 
        if (d->dlgVer != 1 || d->signature != 0xffff)
                return 0;
        if (!(d->style & (DS_SETFONT | DS_SHELLFONT)))
                return 0;
 
-       ns = xcalloc (sizeof (struct newresource), 1);
+       ns = xcalloc (struct newresource, 1);
        ns->inst = res->inst;
        ns->size = res->size;
        ns->tmpl = res->tmpl;
-       ns->resource = xmalloc (ns->size);
-       memcpy (ns->resource, res->resource, ns->size);
+       ns->resource = (LPCDLGTEMPLATEW)xmalloc (uae_u8, ns->size);
+       memcpy ((void*)ns->resource, res->resource, ns->size);
 
-       d = ns->resource;
-       d2 = ns->resource;
+       d = (DLGTEMPLATEEX*)ns->resource;
+       d2 = (DLGTEMPLATEEX_END*)ns->resource;
        p = (BYTE*)d + sizeof (DLGTEMPLATEEX);
        p = skiptext (p);
        p = skiptext (p);
@@ -206,7 +206,7 @@ struct newresource *scaleresource (struct newresource *res, HWND parent)
 
 void freescaleresource (struct newresource *ns)
 {
-       xfree (ns->resource);
+       xfree ((void*)ns->resource);
        xfree (ns);
 }
 
index 6997bfbff21cd96c1d80483ad4b608430259b1a7..14fdec77e6201302efe47d2e0bec21156dbf34a5 100644 (file)
                        Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
                        >
                        <File
-                               RelativePath="..\ahidsound_dsonly.c"
+                               RelativePath="..\ahidsound_dsonly.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\ahidsound_new.c"
+                               RelativePath="..\ahidsound_new.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\avioutput.c"
+                               RelativePath="..\avioutput.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\blkdev_win32_aspi.c"
+                               RelativePath="..\blkdev_win32_aspi.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\blkdev_win32_ioctl.c"
+                               RelativePath="..\blkdev_win32_ioctl.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\blkdev_win32_spti.c"
+                               RelativePath="..\blkdev_win32_spti.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\bsdsock.c"
+                               RelativePath="..\bsdsock.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\caps\caps_win32.c"
+                               RelativePath="..\caps\caps_win32.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\clipboard_win32.c"
+                               RelativePath="..\clipboard_win32.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\debug_win32.c"
+                               RelativePath="..\debug_win32.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\dinput.c"
+                               RelativePath="..\dinput.cpp"
                                >
                        </File>
                        <File
                                >
                        </File>
                        <File
-                               RelativePath="..\driveclick_win32.c"
+                               RelativePath="..\driveclick_win32.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\dxwrap.c"
+                               RelativePath="..\dxwrap.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\fsdb_mywin32.c"
+                               RelativePath="..\fsdb_mywin32.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\fsdb_win32.c"
+                               RelativePath="..\fsdb_win32.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\hardfile_win32.c"
+                               RelativePath="..\hardfile_win32.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\hq2x_d3d.c"
+                               RelativePath="..\hq2x_d3d.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\ioport.c"
+                               RelativePath="..\ioport.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\keyboard_win32.c"
+                               RelativePath="..\keyboard_win32.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\lcd.c"
+                               RelativePath="..\lcd.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\midi.c"
+                               RelativePath="..\midi.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\mman.c"
+                               RelativePath="..\mman.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\parser.c"
+                               RelativePath="..\parser.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\picasso96_win.c"
+                               RelativePath="..\picasso96_win.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\posixemu.c"
+                               RelativePath="..\posixemu.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\registry.c"
+                               RelativePath="..\registry.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\cloanto\RetroPlatformGuestIPC.c"
+                               RelativePath="..\cloanto\RetroPlatformGuestIPC.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\rp.c"
+                               RelativePath="..\rp.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\scaler.c"
+                               RelativePath="..\scaler.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\scaler_more.c"
+                               RelativePath="..\scaler_more.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\screenshot.c"
+                               RelativePath="..\screenshot.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\serial_win32.c"
+                               RelativePath="..\serial_win32.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\sounddep\sound.c"
+                               RelativePath="..\sounddep\sound.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\unicode.c"
+                               RelativePath="..\unicode.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\win32.c"
+                               RelativePath="..\win32.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\win32_scale2x.c"
+                               RelativePath="..\win32_scale2x.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\win32_uaenet.c"
+                               RelativePath="..\win32_uaenet.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\win32gfx.c"
+                               RelativePath="..\win32gfx.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\win32gui.c"
+                               RelativePath="..\win32gui.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\win32gui_extra.c"
+                               RelativePath="..\win32gui_extra.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\writelog.c"
+                               RelativePath="..\writelog.cpp"
                                >
                        </File>
                        <Filter
                        Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
                        >
                        <File
-                               RelativePath="..\..\a2065.c"
+                               RelativePath="..\..\a2065.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\a2091.c"
+                               RelativePath="..\..\a2091.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\akiko.c"
+                               RelativePath="..\..\akiko.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\amax.c"
+                               RelativePath="..\..\amax.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\ar.c"
+                               RelativePath="..\..\ar.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\arcadia.c"
+                               RelativePath="..\..\arcadia.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\audio.c"
+                               RelativePath="..\..\audio.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\autoconf.c"
+                               RelativePath="..\..\autoconf.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\blitfunc.c"
+                               RelativePath="..\..\blitfunc.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\blittable.c"
+                               RelativePath="..\..\blittable.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\blitter.c"
+                               RelativePath="..\..\blitter.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\blkdev.c"
+                               RelativePath="..\..\blkdev.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\blkdev_cdimage.c"
+                               RelativePath="..\..\blkdev_cdimage.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\bsdsocket.c"
+                               RelativePath="..\..\bsdsocket.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\catweasel.c"
+                               RelativePath="..\..\catweasel.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cd32_fmv.c"
+                               RelativePath="..\..\cd32_fmv.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cdrom.c"
+                               RelativePath="..\..\cdrom.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cdtv.c"
+                               RelativePath="..\..\cdtv.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cfgfile.c"
+                               RelativePath="..\..\cfgfile.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cia.c"
+                               RelativePath="..\..\cia.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\consolehook.c"
+                               RelativePath="..\..\consolehook.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cpudefs.c"
+                               RelativePath="..\..\cpudefs.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cpuemu_0.c"
+                               RelativePath="..\..\cpuemu_0.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cpuemu_11.c"
+                               RelativePath="..\..\cpuemu_11.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cpuemu_12.c"
+                               RelativePath="..\..\cpuemu_12.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cpuemu_20.c"
+                               RelativePath="..\..\cpuemu_20.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cpuemu_31.c"
+                               RelativePath="..\..\cpuemu_31.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cpummu.c"
+                               RelativePath="..\..\cpummu.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\cpustbl.c"
+                               RelativePath="..\..\cpustbl.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\crc32.c"
+                               RelativePath="..\..\crc32.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\custom.c"
+                               RelativePath="..\..\custom.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\debug.c"
+                               RelativePath="..\..\debug.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\disk.c"
+                               RelativePath="..\..\disk.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\diskutil.c"
+                               RelativePath="..\..\diskutil.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\dongle.c"
+                               RelativePath="..\..\dongle.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\drawing.c"
+                               RelativePath="..\..\drawing.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\driveclick.c"
+                               RelativePath="..\..\driveclick.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\enforcer.c"
+                               RelativePath="..\..\enforcer.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\epsonprinter.c"
+                               RelativePath="..\..\epsonprinter.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\ersatz.c"
+                               RelativePath="..\..\ersatz.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\expansion.c"
+                               RelativePath="..\..\expansion.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\fdi2raw.c"
+                               RelativePath="..\..\fdi2raw.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\filesys.c"
+                               RelativePath="..\..\filesys.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\fpp.c"
+                               RelativePath="..\..\fpp.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\fsdb.c"
+                               RelativePath="..\..\fsdb.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\fsusage.c"
+                               RelativePath="..\..\fsusage.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\gayle.c"
+                               RelativePath="..\..\gayle.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\gfxutil.c"
+                               RelativePath="..\..\gfxutil.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\hardfile.c"
+                               RelativePath="..\..\hardfile.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\identify.c"
+                               RelativePath="..\..\identify.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\inputdevice.c"
+                               RelativePath="..\..\inputdevice.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\keybuf.c"
+                               RelativePath="..\..\keybuf.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\main.c"
+                               RelativePath="..\..\main.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\memory.c"
+                               RelativePath="..\..\memory.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\missing.c"
+                               RelativePath="..\..\missing.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\native2amiga.c"
+                               RelativePath="..\..\native2amiga.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\ncr_scsi.c"
+                               RelativePath="..\..\ncr_scsi.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\newcpu.c"
+                               RelativePath="..\..\newcpu.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\readcpu.c"
+                               RelativePath="..\..\readcpu.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\rommgr.c"
+                               RelativePath="..\..\rommgr.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\sampler.c"
+                               RelativePath="..\..\sampler.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\sana2.c"
+                               RelativePath="..\..\sana2.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\savestate.c"
+                               RelativePath="..\..\savestate.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\scsi.c"
+                               RelativePath="..\..\scsi.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\scsiemul.c"
+                               RelativePath="..\..\scsiemul.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\traps.c"
+                               RelativePath="..\..\traps.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\uaeexe.c"
+                               RelativePath="..\..\uaeexe.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\uaeipc.c"
+                               RelativePath="..\..\uaeipc.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\uaelib.c"
+                               RelativePath="..\..\uaelib.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\uaeresource.c"
+                               RelativePath="..\..\uaeresource.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\uaeserial.c"
+                               RelativePath="..\..\uaeserial.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\zfile.c"
+                               RelativePath="..\..\zfile.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\zfile_archive.c"
+                               RelativePath="..\..\zfile_archive.cpp"
                                >
                        </File>
                </Filter>
                        Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
                        >
                        <File
-                               RelativePath="..\..\jit\compemu.c"
+                               RelativePath="..\..\jit\compemu.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\jit\compemu_fpp.c"
+                               RelativePath="..\..\jit\compemu_fpp.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\jit\compemu_support.c"
+                               RelativePath="..\..\jit\compemu_support.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\jit\compstbl.c"
+                               RelativePath="..\..\jit\compstbl.cpp"
                                >
                        </File>
                </Filter>
                        Name="prowizard"
                        >
                        <File
-                               RelativePath="..\..\moduleripper.c"
+                               RelativePath="..\..\moduleripper.cpp"
                                >
                        </File>
                </Filter>
                                Name="dms"
                                >
                                <File
-                                       RelativePath="..\..\archivers\dms\crc_csum.c"
+                                       RelativePath="..\..\archivers\dms\crc_csum.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\dms\getbits.c"
+                                       RelativePath="..\..\archivers\dms\getbits.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\dms\maketbl.c"
+                                       RelativePath="..\..\archivers\dms\maketbl.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\dms\pfile.c"
+                                       RelativePath="..\..\archivers\dms\pfile.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\dms\tables.c"
+                                       RelativePath="..\..\archivers\dms\tables.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\dms\u_deep.c"
+                                       RelativePath="..\..\archivers\dms\u_deep.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\dms\u_heavy.c"
+                                       RelativePath="..\..\archivers\dms\u_heavy.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\dms\u_init.c"
+                                       RelativePath="..\..\archivers\dms\u_init.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\dms\u_medium.c"
+                                       RelativePath="..\..\archivers\dms\u_medium.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\dms\u_quick.c"
+                                       RelativePath="..\..\archivers\dms\u_quick.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\dms\u_rle.c"
+                                       RelativePath="..\..\archivers\dms\u_rle.cpp"
                                        >
                                </File>
                        </Filter>
                                Name="7z"
                                >
                                <File
-                                       RelativePath="..\..\archivers\7z\Archive\7z\7zAlloc.c"
+                                       RelativePath="..\..\archivers\7z\Archive\7z\7zAlloc.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\7z\7zBuf.c"
+                                       RelativePath="..\..\archivers\7z\7zBuf.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\7z\7zCrc.c"
+                                       RelativePath="..\..\archivers\7z\7zCrc.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\7z\Archive\7z\7zDecode.c"
+                                       RelativePath="..\..\archivers\7z\Archive\7z\7zDecode.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\7z\Archive\7z\7zExtract.c"
+                                       RelativePath="..\..\archivers\7z\Archive\7z\7zExtract.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\7z\Archive\7z\7zHeader.c"
+                                       RelativePath="..\..\archivers\7z\Archive\7z\7zHeader.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\7z\Archive\7z\7zIn.c"
+                                       RelativePath="..\..\archivers\7z\Archive\7z\7zIn.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\7z\Archive\7z\7zItem.c"
+                                       RelativePath="..\..\archivers\7z\Archive\7z\7zItem.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\7z\7zStream.c"
+                                       RelativePath="..\..\archivers\7z\7zStream.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\7z\Bcj2.c"
+                                       RelativePath="..\..\archivers\7z\Bcj2.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\7z\Bra.c"
+                                       RelativePath="..\..\archivers\7z\Bra.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\7z\Bra86.c"
+                                       RelativePath="..\..\archivers\7z\Bra86.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\7z\LzmaDec.c"
+                                       RelativePath="..\..\archivers\7z\LzmaDec.cpp"
                                        >
                                </File>
                        </Filter>
                                Name="lha"
                                >
                                <File
-                                       RelativePath="..\..\archivers\lha\crcio.c"
+                                       RelativePath="..\..\archivers\lha\crcio.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\lha\dhuf.c"
+                                       RelativePath="..\..\archivers\lha\dhuf.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\lha\header.c"
+                                       RelativePath="..\..\archivers\lha\header.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\lha\huf.c"
+                                       RelativePath="..\..\archivers\lha\huf.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\lha\larc.c"
+                                       RelativePath="..\..\archivers\lha\larc.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\lha\lhamaketbl.c"
+                                       RelativePath="..\..\archivers\lha\lhamaketbl.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\lha\lharc.c"
+                                       RelativePath="..\..\archivers\lha\lharc.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\lha\shuf.c"
+                                       RelativePath="..\..\archivers\lha\shuf.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\lha\slide.c"
+                                       RelativePath="..\..\archivers\lha\slide.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\lha\uae_lha.c"
+                                       RelativePath="..\..\archivers\lha\uae_lha.cpp"
                                        >
                                </File>
                                <File
-                                       RelativePath="..\..\archivers\lha\util.c"
+                                       RelativePath="..\..\archivers\lha\util.cpp"
                                        >
                                </File>
                        </Filter>
                                Name="zip"
                                >
                                <File
-                                       RelativePath="..\..\archivers\zip\unzip.c"
+                                       RelativePath="..\..\archivers\zip\unzip.cpp"
                                        >
                                </File>
                        </Filter>
                                Name="lzx"
                                >
                                <File
-                                       RelativePath="..\..\archivers\lzx\unlzx.c"
+                                       RelativePath="..\..\archivers\lzx\unlzx.cpp"
                                        >
                                </File>
                        </Filter>
                                Name="wrp"
                                >
                                <File
-                                       RelativePath="..\..\archivers\wrp\warp.c"
+                                       RelativePath="..\..\archivers\wrp\warp.cpp"
                                        >
                                </File>
                        </Filter>
diff --git a/od-win32/winuae_msvc10/winuae_msvc.vcproj b/od-win32/winuae_msvc10/winuae_msvc.vcproj
deleted file mode 100644 (file)
index 6997bfb..0000000
+++ /dev/null
@@ -1,1815 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-       ProjectType="Visual C++"
-       Version="9,00"
-       Name="winuae"
-       ProjectGUID="{4ADAA943-1AC8-4FB5-82E5-4FB753B6C2DA}"
-       RootNamespace="winuae"
-       TargetFrameworkVersion="131072"
-       >
-       <Platforms>
-               <Platform
-                       Name="Win32"
-               />
-               <Platform
-                       Name="x64"
-               />
-       </Platforms>
-       <ToolFiles>
-       </ToolFiles>
-       <Configurations>
-               <Configuration
-                       Name="Debug|Win32"
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
-                       ConfigurationType="1"
-                       UseOfMFC="0"
-                       ATLMinimizesCRunTimeLibraryUsage="false"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <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,..\..\prowizard\include,..\tun"
-                               PreprocessorDefinitions="WINVER=0x0500,_DEBUG,WIN32_IE=0x0700;WIN32;CINTERFACE;COBJMACROS;_CRT_SECURE_NO_WARNINGS;D3D_DEBUG_INFO"
-                               GeneratePreprocessedFile="0"
-                               KeepComments="false"
-                               ExceptionHandling="0"
-                               BasicRuntimeChecks="3"
-                               RuntimeLibrary="1"
-                               BufferSecurityCheck="true"
-                               RuntimeTypeInfo="false"
-                               PrecompiledHeaderFile=".\Debug/winuae_msvc.pch"
-                               AssemblerListingLocation=".\Debug/"
-                               ObjectFile=".\Debug/"
-                               ProgramDataBaseFileName=".\Debug/"
-                               WarningLevel="3"
-                               SuppressStartupBanner="true"
-                               Detect64BitPortabilityProblems="false"
-                               DebugInformationFormat="4"
-                               CallingConvention="2"
-                               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="ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib dxerr.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib wpcap.lib packet.lib openal32.lib wintab32.lib portaudio_x86.lib freetype.lib vfw32.lib wtsapi32.lib avrt.lib wininet.lib enet.lib prowizard.lib"
-                               ShowProgress="0"
-                               OutputFile="d:\amiga\winuae.exe"
-                               LinkIncremental="2"
-                               SuppressStartupBanner="true"
-                               GenerateManifest="false"
-                               IgnoreDefaultLibraryNames="LIBCMT"
-                               DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_42.dll;openal32.dll;wintab32.dll;portaudio_x86.dll;freetype6.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;avrt.dll"
-                               GenerateDebugInformation="true"
-                               ProgramDatabaseFile=".\Debug/winuae.pdb"
-                               SubSystem="2"
-                               StackReserveSize="2621440"
-                               StackCommitSize="2621440"
-                               LargeAddressAware="2"
-                               RandomizedBaseAddress="1"
-                               DataExecutionPrevention="0"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCManifestTool"
-                               AdditionalManifestFiles="..\resources\winuae.exe.manifest"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCAppVerifierTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Debug|x64"
-                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
-                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-                       ConfigurationType="1"
-                       UseOfMFC="0"
-                       ATLMinimizesCRunTimeLibraryUsage="false"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="_DEBUG"
-                               MkTypLibCompatible="true"
-                               SuppressStartupBanner="true"
-                               TargetEnvironment="3"
-                               TypeLibraryName=".\Debug/winuae_msvc.tlb"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               AdditionalOptions=""
-                               Optimization="0"
-                               AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep,..\..\prowizard\include,..\tun"
-                               PreprocessorDefinitions="WINVER=0x0500,_DEBUG,WIN32_IE=0x0700;WIN32;WIN64;CINTERFACE;COBJMACROS;_CRT_SECURE_NO_WARNINGS;D3D_DEBUG_INFO"
-                               ExceptionHandling="0"
-                               BasicRuntimeChecks="3"
-                               RuntimeLibrary="1"
-                               BufferSecurityCheck="true"
-                               RuntimeTypeInfo="true"
-                               PrecompiledHeaderFile=".\Debug64/winuae_msvc.pch"
-                               AssemblerListingLocation=".\Debug/"
-                               ObjectFile=".\Debug/"
-                               ProgramDataBaseFileName=".\Debug/"
-                               WarningLevel="3"
-                               SuppressStartupBanner="true"
-                               Detect64BitPortabilityProblems="true"
-                               DebugInformationFormat="3"
-                               CallingConvention="2"
-                               CompileAs="0"
-                               DisableSpecificWarnings="4996"
-                               EnablePREfast="false"
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="_DEBUG"
-                               Culture="1033"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalDependencies="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 dxerr.lib shlwapi.lib zlibstat.lib portaudio_x64.lib packet.lib wpcap.lib openal32.lib libpng.lib lglcd.lib wtsapi32.lib wntab32x.lib enet_x64.lib prowizard.lib"
-                               OutputFile="d:\amiga\winuae64.exe"
-                               LinkIncremental="2"
-                               SuppressStartupBanner="true"
-                               GenerateManifest="false"
-                               IgnoreDefaultLibraryNames="MSVCRT.lib"
-                               DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_42.dll;openal32.dll;wintab32.dll;portaudio_x64.dll;freetype6.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;avrt.dll"
-                               GenerateDebugInformation="true"
-                               ProgramDatabaseFile=".\Debug/winuae.pdb"
-                               SubSystem="2"
-                               StackReserveSize="2621440"
-                               StackCommitSize="2621440"
-                               LargeAddressAware="2"
-                               RandomizedBaseAddress="1"
-                               DataExecutionPrevention="0"
-                               TargetMachine="17"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCManifestTool"
-                               AdditionalManifestFiles="..\resources\winuae64.exe.manifest"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCAppVerifierTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|Win32"
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
-                       ConfigurationType="1"
-                       UseOfMFC="0"
-                       ATLMinimizesCRunTimeLibraryUsage="false"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="true"
-                               SuppressStartupBanner="true"
-                               TargetEnvironment="1"
-                               TypeLibraryName=".\Release/winuae_msvc.tlb"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               Optimization="3"
-                               InlineFunctionExpansion="2"
-                               EnableIntrinsicFunctions="true"
-                               FavorSizeOrSpeed="1"
-                               OmitFramePointers="true"
-                               WholeProgramOptimization="false"
-                               AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep,..\..\prowizard\include"
-                               PreprocessorDefinitions="WINVER=0x0500;NDEBUG;_WIN32_IE=0x0700;WIN32;CINTERFACE;COBJMACROS"
-                               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"
-                               CallingConvention="2"
-                               CompileAs="0"
-                               DisableSpecificWarnings="4996"
-                               ForcedIncludeFiles=""
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               Culture="1033"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalDependencies="ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib dxerr.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib wpcap.lib packet.lib openal32.lib wintab32.lib portaudio_x86.lib freetype.lib vfw32.lib wtsapi32.lib avrt.lib wininet.lib enet.lib prowizard.lib"
-                               OutputFile="d:\amiga\winuae.exe"
-                               LinkIncremental="1"
-                               SuppressStartupBanner="true"
-                               AdditionalLibraryDirectories=""
-                               GenerateManifest="false"
-                               AdditionalManifestDependencies=""
-                               IgnoreDefaultLibraryNames=""
-                               DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_42.dll;openal32.dll;wintab32.dll;portaudio_x86.dll;freetype6.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;avrt.dll;wininet.dll"
-                               GenerateDebugInformation="true"
-                               ProgramDatabaseFile=".\Release/winuae.pdb"
-                               SubSystem="2"
-                               StackReserveSize="2621440"
-                               StackCommitSize="2621440"
-                               LargeAddressAware="2"
-                               OptimizeReferences="2"
-                               EnableCOMDATFolding="2"
-                               OptimizeForWindows98="0"
-                               LinkTimeCodeGeneration="0"
-                               RandomizedBaseAddress="2"
-                               FixedBaseAddress="1"
-                               DataExecutionPrevention="2"
-                               TargetMachine="1"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCManifestTool"
-                               AdditionalManifestFiles="..\resources\winuae9.exe.manifest"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCAppVerifierTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-               <Configuration
-                       Name="Release|x64"
-                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
-                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-                       ConfigurationType="1"
-                       UseOfMFC="0"
-                       ATLMinimizesCRunTimeLibraryUsage="false"
-                       CharacterSet="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <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;NDEBUG;_WIN32_IE=0x0700;WIN32;WIN64;CINTERFACE;COBJMACROS"
-                               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"
-                               CallingConvention="2"
-                               CompileAs="0"
-                               DisableSpecificWarnings="4996"
-                               ForcedIncludeFiles=""
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               Culture="1033"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalDependencies="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 dxerr.lib shlwapi.lib zlibstat.lib portaudio_x64.lib packet.lib wpcap.lib openal32.lib libpng.lib lglcd.lib wtsapi32.lib wntab32x.lib enet_x64.lib prowizard.lib"
-                               ShowProgress="0"
-                               OutputFile="d:\amiga\winuae64.exe"
-                               LinkIncremental="1"
-                               SuppressStartupBanner="true"
-                               AdditionalLibraryDirectories=""
-                               GenerateManifest="true"
-                               IgnoreDefaultLibraryNames="MSVCRT.lib"
-                               DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_42.dll;openal32.dll;wintab32.dll;portaudio_x64.dll;freetype6.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;avrt.dll"
-                               GenerateDebugInformation="true"
-                               ProgramDatabaseFile=".\Release/winuae.pdb"
-                               SubSystem="2"
-                               StackReserveSize="0"
-                               StackCommitSize="0"
-                               OptimizeReferences="2"
-                               EnableCOMDATFolding="2"
-                               OptimizeForWindows98="0"
-                               LinkTimeCodeGeneration="0"
-                               RandomizedBaseAddress="2"
-                               FixedBaseAddress="1"
-                               DataExecutionPrevention="2"
-                               TargetMachine="17"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCManifestTool"
-                               AdditionalManifestFiles="..\resources\winuae64.exe.manifest"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCAppVerifierTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-               <Configuration
-                       Name="FullRelease|Win32"
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
-                       ConfigurationType="1"
-                       UseOfMFC="0"
-                       ATLMinimizesCRunTimeLibraryUsage="false"
-                       CharacterSet="1"
-                       WholeProgramOptimization="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="true"
-                               SuppressStartupBanner="true"
-                               TargetEnvironment="1"
-                               TypeLibraryName=".\Release/winuae_msvc.tlb"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               Optimization="3"
-                               InlineFunctionExpansion="2"
-                               EnableIntrinsicFunctions="true"
-                               FavorSizeOrSpeed="1"
-                               OmitFramePointers="true"
-                               WholeProgramOptimization="true"
-                               AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep,..\..\prowizard\include"
-                               PreprocessorDefinitions="WINVER=0x0500;NDEBUG;_WIN32_IE=0x0700;WIN32;CINTERFACE;COBJMACROS"
-                               StringPooling="true"
-                               ExceptionHandling="0"
-                               BasicRuntimeChecks="0"
-                               RuntimeLibrary="0"
-                               BufferSecurityCheck="false"
-                               EnableFunctionLevelLinking="true"
-                               EnableEnhancedInstructionSet="0"
-                               FloatingPointModel="0"
-                               TreatWChar_tAsBuiltInType="false"
-                               RuntimeTypeInfo="false"
-                               UsePrecompiledHeader="0"
-                               PrecompiledHeaderFile=".\FullRelease/winuae_msvc.pch"
-                               AssemblerListingLocation=".\FullRelease/"
-                               ObjectFile=".\FullRelease/"
-                               ProgramDataBaseFileName=".\FullRelease/"
-                               WarningLevel="3"
-                               SuppressStartupBanner="true"
-                               CallingConvention="2"
-                               CompileAs="0"
-                               DisableSpecificWarnings="4996"
-                               ForcedIncludeFiles=""
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               Culture="1033"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalDependencies="ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib dxerr.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib wpcap.lib packet.lib openal32.lib wintab32.lib portaudio_x86.lib freetype.lib vfw32.lib wtsapi32.lib avrt.lib wininet.lib enet.lib prowizard.lib"
-                               OutputFile="d:\amiga\winuae.exe"
-                               LinkIncremental="1"
-                               SuppressStartupBanner="true"
-                               AdditionalLibraryDirectories=""
-                               GenerateManifest="false"
-                               AdditionalManifestDependencies=""
-                               IgnoreDefaultLibraryNames=""
-                               DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_42.dll;openal32.dll;wintab32.dll;portaudio_x86.dll;freetype6.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;avrt.dll;wininet.dll"
-                               GenerateDebugInformation="true"
-                               ProgramDatabaseFile=".\FullRelease/winuae.pdb"
-                               SubSystem="2"
-                               StackReserveSize="2621440"
-                               StackCommitSize="2621440"
-                               LargeAddressAware="2"
-                               OptimizeReferences="2"
-                               EnableCOMDATFolding="2"
-                               OptimizeForWindows98="0"
-                               LinkTimeCodeGeneration="1"
-                               RandomizedBaseAddress="2"
-                               FixedBaseAddress="1"
-                               DataExecutionPrevention="2"
-                               TargetMachine="1"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCManifestTool"
-                               AdditionalManifestFiles="..\resources\winuae9.exe.manifest"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCAppVerifierTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-               <Configuration
-                       Name="FullRelease|x64"
-                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
-                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
-                       ConfigurationType="1"
-                       UseOfMFC="0"
-                       ATLMinimizesCRunTimeLibraryUsage="false"
-                       CharacterSet="1"
-                       WholeProgramOptimization="1"
-                       >
-                       <Tool
-                               Name="VCPreBuildEventTool"
-                       />
-                       <Tool
-                               Name="VCCustomBuildTool"
-                       />
-                       <Tool
-                               Name="VCXMLDataGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCWebServiceProxyGeneratorTool"
-                       />
-                       <Tool
-                               Name="VCMIDLTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               MkTypLibCompatible="true"
-                               SuppressStartupBanner="true"
-                               TargetEnvironment="3"
-                               TypeLibraryName=".\Release/winuae_msvc.tlb"
-                       />
-                       <Tool
-                               Name="VCCLCompilerTool"
-                               Optimization="3"
-                               InlineFunctionExpansion="2"
-                               EnableIntrinsicFunctions="true"
-                               FavorSizeOrSpeed="1"
-                               OmitFramePointers="true"
-                               WholeProgramOptimization="true"
-                               AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep"
-                               PreprocessorDefinitions="WINVER=0x0500;NDEBUG;_WIN32_IE=0x0700;WIN32;WIN64;CINTERFACE;COBJMACROS"
-                               StringPooling="true"
-                               ExceptionHandling="0"
-                               BasicRuntimeChecks="0"
-                               RuntimeLibrary="0"
-                               BufferSecurityCheck="false"
-                               EnableFunctionLevelLinking="true"
-                               EnableEnhancedInstructionSet="0"
-                               FloatingPointModel="0"
-                               TreatWChar_tAsBuiltInType="false"
-                               RuntimeTypeInfo="false"
-                               UsePrecompiledHeader="0"
-                               PrecompiledHeaderFile=".\FullRelease/winuae_msvc.pch"
-                               AssemblerListingLocation=".\FullRelease/"
-                               ObjectFile=".\FullRelease/"
-                               ProgramDataBaseFileName=".\FullRelease/"
-                               WarningLevel="3"
-                               SuppressStartupBanner="true"
-                               CallingConvention="2"
-                               CompileAs="0"
-                               DisableSpecificWarnings="4996"
-                               ForcedIncludeFiles=""
-                       />
-                       <Tool
-                               Name="VCManagedResourceCompilerTool"
-                       />
-                       <Tool
-                               Name="VCResourceCompilerTool"
-                               PreprocessorDefinitions="NDEBUG"
-                               Culture="1033"
-                       />
-                       <Tool
-                               Name="VCPreLinkEventTool"
-                       />
-                       <Tool
-                               Name="VCLinkerTool"
-                               AdditionalDependencies="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 dxerr.lib shlwapi.lib zlibstat.lib portaudio_x64.lib packet.lib wpcap.lib openal32.lib libpng.lib lglcd.lib wtsapi32.lib wntab32x.lib enet_x64.lib prowizard.lib"
-                               ShowProgress="0"
-                               OutputFile="d:\amiga\winuae64.exe"
-                               LinkIncremental="1"
-                               SuppressStartupBanner="true"
-                               AdditionalLibraryDirectories=""
-                               GenerateManifest="false"
-                               IgnoreDefaultLibraryNames="MSVCRT.lib"
-                               DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_42.dll;openal32.dll;wintab32.dll;portaudio_x64.dll;freetype6.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;avrt.dll"
-                               GenerateDebugInformation="true"
-                               ProgramDatabaseFile=".\FullRelease/winuae.pdb"
-                               SubSystem="2"
-                               StackReserveSize="0"
-                               StackCommitSize="0"
-                               OptimizeReferences="2"
-                               EnableCOMDATFolding="2"
-                               OptimizeForWindows98="0"
-                               LinkTimeCodeGeneration="1"
-                               RandomizedBaseAddress="2"
-                               FixedBaseAddress="1"
-                               DataExecutionPrevention="2"
-                               TargetMachine="17"
-                       />
-                       <Tool
-                               Name="VCALinkTool"
-                       />
-                       <Tool
-                               Name="VCManifestTool"
-                               AdditionalManifestFiles="..\resources\winuae64.exe.manifest"
-                       />
-                       <Tool
-                               Name="VCXDCMakeTool"
-                       />
-                       <Tool
-                               Name="VCBscMakeTool"
-                       />
-                       <Tool
-                               Name="VCFxCopTool"
-                       />
-                       <Tool
-                               Name="VCAppVerifierTool"
-                       />
-                       <Tool
-                               Name="VCPostBuildEventTool"
-                       />
-               </Configuration>
-       </Configurations>
-       <References>
-       </References>
-       <Files>
-               <Filter
-                       Name="win32"
-                       Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-                       >
-                       <File
-                               RelativePath="..\ahidsound_dsonly.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\ahidsound_new.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\avioutput.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\blkdev_win32_aspi.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\blkdev_win32_ioctl.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\blkdev_win32_spti.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\bsdsock.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\caps\caps_win32.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\clipboard_win32.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\debug_win32.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\dinput.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\direct3d.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\driveclick_win32.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\dxwrap.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\fsdb_mywin32.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\fsdb_win32.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\hardfile_win32.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\hq2x_d3d.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\ioport.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\keyboard_win32.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\lcd.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\midi.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\mman.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\parser.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\picasso96_win.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\posixemu.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\registry.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\cloanto\RetroPlatformGuestIPC.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\rp.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\scaler.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\scaler_more.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\screenshot.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\serial_win32.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\sounddep\sound.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\unicode.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\win32.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\win32_scale2x.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\win32_uaenet.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\win32gfx.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\win32gui.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\win32gui_extra.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\writelog.c"
-                               >
-                       </File>
-                       <Filter
-                               Name="Resource Files"
-                               Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-                               >
-                               <File
-                                       RelativePath="..\resources\35floppy.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\amigainfo.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\avioutput.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\chip.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\configfile.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath=".\configfile.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\cpu.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath=".\diskimage.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\diskimage.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\Drive.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\expansion.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath=".\expansion.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\file.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath=".\file.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\folder.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\h_arrow.cur"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\icon3.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\joystick.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\lcd.bmp"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\misc.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\move_dow.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\move_up.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\paths.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\port.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath=".\port.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\quickstart.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\root.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\screen.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\sound.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\winuae.ico"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\resources\winuae.rc"
-                                       >
-                                       <FileConfiguration
-                                               Name="Debug|Win32"
-                                               >
-                                               <Tool
-                                                       Name="VCResourceCompilerTool"
-                                                       AdditionalIncludeDirectories="\projects\winuae\src\od-win32\resources;$(NoInherit)"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Debug|x64"
-                                               >
-                                               <Tool
-                                                       Name="VCResourceCompilerTool"
-                                                       AdditionalIncludeDirectories="\projects\winuae\src\od-win32\resources;$(NoInherit)"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Release|Win32"
-                                               >
-                                               <Tool
-                                                       Name="VCResourceCompilerTool"
-                                                       AdditionalIncludeDirectories="\projects\winuae\src\od-win32\resources;$(NoInherit)"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Release|x64"
-                                               >
-                                               <Tool
-                                                       Name="VCResourceCompilerTool"
-                                                       AdditionalIncludeDirectories="\projects\winuae\src\od-win32\resources;$(NoInherit)"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="FullRelease|Win32"
-                                               >
-                                               <Tool
-                                                       Name="VCResourceCompilerTool"
-                                                       AdditionalIncludeDirectories="\projects\winuae\src\od-win32\resources;$(NoInherit)"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="FullRelease|x64"
-                                               >
-                                               <Tool
-                                                       Name="VCResourceCompilerTool"
-                                                       AdditionalIncludeDirectories="\projects\winuae\src\od-win32\resources;$(NoInherit)"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="TestRelease|x64"
-                                               >
-                                               <Tool
-                                                       Name="VCResourceCompilerTool"
-                                                       AdditionalIncludeDirectories="\projects\winuae\src\od-win32\resources;$(NoInherit)"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Release64|x64"
-                                               >
-                                               <Tool
-                                                       Name="VCResourceCompilerTool"
-                                                       AdditionalIncludeDirectories="\projects\winuae\src\od-win32\resources;$(NoInherit)"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Debug64|Win32"
-                                               >
-                                               <Tool
-                                                       Name="VCResourceCompilerTool"
-                                                       AdditionalIncludeDirectories="\projects\winuae\src\od-win32\resources;$(NoInherit)"
-                                               />
-                                       </FileConfiguration>
-                                       <FileConfiguration
-                                               Name="Debug64|x64"
-                                               >
-                                               <Tool
-                                                       Name="VCResourceCompilerTool"
-                                                       AdditionalIncludeDirectories="\projects\winuae\src\od-win32\resources;$(NoInherit)"
-                                               />
-                                       </FileConfiguration>
-                               </File>
-                               <File
-                                       RelativePath="..\resources\xarcade-winuae.bmp"
-                                       >
-                               </File>
-                       </Filter>
-               </Filter>
-               <Filter
-                       Name="common"
-                       Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-                       >
-                       <File
-                               RelativePath="..\..\a2065.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\a2091.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\akiko.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\amax.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\ar.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\arcadia.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\audio.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\autoconf.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\blitfunc.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\blittable.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\blitter.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\blkdev.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\blkdev_cdimage.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\bsdsocket.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\catweasel.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cd32_fmv.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cdrom.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cdtv.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cfgfile.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cia.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\consolehook.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cpudefs.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cpuemu_0.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cpuemu_11.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cpuemu_12.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cpuemu_20.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cpuemu_31.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cpummu.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\cpustbl.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\crc32.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\custom.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\debug.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\disk.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\diskutil.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\dongle.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\drawing.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\driveclick.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\enforcer.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\epsonprinter.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\ersatz.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\expansion.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\fdi2raw.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\filesys.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\fpp.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\fsdb.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\fsusage.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\gayle.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\gfxutil.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\hardfile.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\identify.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\inputdevice.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\keybuf.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\main.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\memory.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\missing.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\native2amiga.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\ncr_scsi.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\newcpu.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\readcpu.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\rommgr.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\sampler.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\sana2.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\savestate.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\scsi.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\scsiemul.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\traps.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\uaeexe.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\uaeipc.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\uaelib.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\uaeresource.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\uaeserial.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\zfile.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\zfile_archive.c"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="jit"
-                       Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-                       >
-                       <File
-                               RelativePath="..\..\jit\compemu.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\jit\compemu_fpp.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\jit\compemu_support.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\jit\compstbl.c"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="prowizard"
-                       >
-                       <File
-                               RelativePath="..\..\moduleripper.c"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="decompressors"
-                       >
-                       <Filter
-                               Name="dms"
-                               >
-                               <File
-                                       RelativePath="..\..\archivers\dms\crc_csum.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\dms\getbits.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\dms\maketbl.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\dms\pfile.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\dms\tables.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\dms\u_deep.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\dms\u_heavy.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\dms\u_init.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\dms\u_medium.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\dms\u_quick.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\dms\u_rle.c"
-                                       >
-                               </File>
-                       </Filter>
-                       <Filter
-                               Name="7z"
-                               >
-                               <File
-                                       RelativePath="..\..\archivers\7z\Archive\7z\7zAlloc.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\7z\7zBuf.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\7z\7zCrc.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\7z\Archive\7z\7zDecode.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\7z\Archive\7z\7zExtract.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\7z\Archive\7z\7zHeader.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\7z\Archive\7z\7zIn.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\7z\Archive\7z\7zItem.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\7z\7zStream.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\7z\Bcj2.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\7z\Bra.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\7z\Bra86.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\7z\LzmaDec.c"
-                                       >
-                               </File>
-                       </Filter>
-                       <Filter
-                               Name="lha"
-                               >
-                               <File
-                                       RelativePath="..\..\archivers\lha\crcio.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\lha\dhuf.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\lha\header.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\lha\huf.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\lha\larc.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\lha\lhamaketbl.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\lha\lharc.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\lha\shuf.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\lha\slide.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\lha\uae_lha.c"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\..\archivers\lha\util.c"
-                                       >
-                               </File>
-                       </Filter>
-                       <Filter
-                               Name="zip"
-                               >
-                               <File
-                                       RelativePath="..\..\archivers\zip\unzip.c"
-                                       >
-                               </File>
-                       </Filter>
-                       <Filter
-                               Name="lzx"
-                               >
-                               <File
-                                       RelativePath="..\..\archivers\lzx\unlzx.c"
-                                       >
-                               </File>
-                       </Filter>
-                       <Filter
-                               Name="xfd"
-                               >
-                       </Filter>
-                       <Filter
-                               Name="wrp"
-                               >
-                               <File
-                                       RelativePath="..\..\archivers\wrp\warp.c"
-                                       >
-                               </File>
-                       </Filter>
-               </Filter>
-               <File
-                       RelativePath="..\resources\drive_click.wav"
-                       >
-               </File>
-               <File
-                       RelativePath="..\resources\drive_snatch.wav"
-                       >
-               </File>
-               <File
-                       RelativePath="..\resources\drive_spin.wav"
-                       >
-               </File>
-               <File
-                       RelativePath="..\resources\drive_spinnd.wav"
-                       >
-               </File>
-               <File
-                       RelativePath="..\resources\drive_startup.wav"
-                       >
-               </File>
-               <File
-                       RelativePath="..\hq2x16.obj"
-                       >
-                       <FileConfiguration
-                               Name="Debug|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-                       <FileConfiguration
-                               Name="Release|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-                       <FileConfiguration
-                               Name="FullRelease|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-               </File>
-               <File
-                       RelativePath="..\hq2x32.obj"
-                       >
-                       <FileConfiguration
-                               Name="Debug|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-                       <FileConfiguration
-                               Name="Release|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-                       <FileConfiguration
-                               Name="FullRelease|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-               </File>
-               <File
-                       RelativePath="..\hq3x16.obj"
-                       >
-                       <FileConfiguration
-                               Name="Debug|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-                       <FileConfiguration
-                               Name="Release|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-                       <FileConfiguration
-                               Name="FullRelease|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-               </File>
-               <File
-                       RelativePath="..\hq3x32.obj"
-                       >
-                       <FileConfiguration
-                               Name="Debug|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-                       <FileConfiguration
-                               Name="Release|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-                       <FileConfiguration
-                               Name="FullRelease|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-               </File>
-               <File
-                       RelativePath="..\hq4x16.obj"
-                       >
-                       <FileConfiguration
-                               Name="Debug|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-                       <FileConfiguration
-                               Name="Release|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-                       <FileConfiguration
-                               Name="FullRelease|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-               </File>
-               <File
-                       RelativePath="..\hq4x32.obj"
-                       >
-                       <FileConfiguration
-                               Name="Debug|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-                       <FileConfiguration
-                               Name="Release|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-                       <FileConfiguration
-                               Name="FullRelease|x64"
-                               ExcludedFromBuild="true"
-                               >
-                               <Tool
-                                       Name="VCCustomBuildTool"
-                               />
-                       </FileConfiguration>
-               </File>
-               <File
-                       RelativePath="..\resources\resource"
-                       >
-               </File>
-       </Files>
-       <Globals>
-       </Globals>
-</VisualStudioProject>
index 1a6d314fc065271cd00c2f76fb6baf135b760f7a..13fc09676c82e96625a09aeb0c612b4257faec65 100644 (file)
       <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>..\..\include;..\..;..\;..\resources;..\osdep;..\sounddep;..\..\prowizard\include;..\tun;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WINVER=0x0500;_DEBUG;WIN32_IE=0x0700;WIN32;CINTERFACE;COBJMACROS;_CRT_SECURE_NO_WARNINGS;D3D_DEBUG_INFO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WINVER=0x0500;_DEBUG;WIN32_IE=0x0700;WIN32;_CRT_SECURE_NO_WARNINGS;D3D_DEBUG_INFO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessToFile>false</PreprocessToFile>
       <PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers>
       <PreprocessKeepComments>false</PreprocessKeepComments>
       <CompileAs>Default</CompileAs>
       <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <EnablePREfast>false</EnablePREfast>
+      <TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
+      <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
       <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;freetype.lib;vfw32.lib;wtsapi32.lib;avrt.lib;wininet.lib;enet.lib;prowizard.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;freetype.lib;vfw32.lib;wtsapi32.lib;enet.lib;prowizard.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <ShowProgress>NotSet</ShowProgress>
       <OutputFile>d:\amiga\winuae.exe</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
       <DataExecutionPrevention>
       </DataExecutionPrevention>
+      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <IgnoreAllDefaultLibraries>
+      </IgnoreAllDefaultLibraries>
     </Link>
     <Manifest>
       <AdditionalManifestFiles>..\resources\winuae.exe.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
       <OmitFramePointers>true</OmitFramePointers>
       <WholeProgramOptimization>false</WholeProgramOptimization>
       <AdditionalIncludeDirectories>..\..\include;..\..;..\;..\resources;..\osdep;..\sounddep;..\..\prowizard\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WINVER=0x0500;NDEBUG;_WIN32_IE=0x0700;WIN32;CINTERFACE;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WINVER=0x0500;NDEBUG;_WIN32_IE=0x0700;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
       <CompileAs>Default</CompileAs>
       <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;freetype.lib;vfw32.lib;wtsapi32.lib;avrt.lib;wininet.lib;enet.lib;prowizard.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;freetype.lib;vfw32.lib;wtsapi32.lib;enet.lib;prowizard.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>d:\amiga\winuae.exe</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <OmitFramePointers>true</OmitFramePointers>
       <WholeProgramOptimization>true</WholeProgramOptimization>
       <AdditionalIncludeDirectories>..\..\include;..\..;..\;..\resources;..\osdep;..\sounddep;..\..\prowizard\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WINVER=0x0500;NDEBUG;_WIN32_IE=0x0700;WIN32;CINTERFACE;COBJMACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WINVER=0x0500;NDEBUG;_WIN32_IE=0x0700;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
       <CompileAs>Default</CompileAs>
       <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </Manifest>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="..\ahidsound_dsonly.c" />
-    <ClCompile Include="..\ahidsound_new.c" />
-    <ClCompile Include="..\avioutput.c" />
-    <ClCompile Include="..\blkdev_win32_aspi.c" />
-    <ClCompile Include="..\blkdev_win32_ioctl.c" />
-    <ClCompile Include="..\blkdev_win32_spti.c" />
-    <ClCompile Include="..\bsdsock.c" />
-    <ClCompile Include="..\caps\caps_win32.c" />
-    <ClCompile Include="..\clipboard_win32.c" />
-    <ClCompile Include="..\debug_win32.c" />
-    <ClCompile Include="..\dinput.c" />
+    <ClCompile Include="..\ahidsound_dsonly.cpp" />
+    <ClCompile Include="..\ahidsound_new.cpp" />
+    <ClCompile Include="..\avioutput.cpp" />
+    <ClCompile Include="..\blkdev_win32_aspi.cpp" />
+    <ClCompile Include="..\blkdev_win32_ioctl.cpp" />
+    <ClCompile Include="..\blkdev_win32_spti.cpp" />
+    <ClCompile Include="..\bsdsock.cpp" />
+    <ClCompile Include="..\caps\caps_win32.cpp" />
+    <ClCompile Include="..\clipboard_win32.cpp" />
+    <ClCompile Include="..\debug_win32.cpp" />
+    <ClCompile Include="..\dinput.cpp" />
     <ClCompile Include="..\direct3d.cpp" />
-    <ClCompile Include="..\driveclick_win32.c" />
-    <ClCompile Include="..\dxwrap.c" />
-    <ClCompile Include="..\fsdb_mywin32.c" />
-    <ClCompile Include="..\fsdb_win32.c" />
-    <ClCompile Include="..\hardfile_win32.c" />
-    <ClCompile Include="..\hq2x_d3d.c" />
-    <ClCompile Include="..\ioport.c" />
-    <ClCompile Include="..\keyboard_win32.c" />
-    <ClCompile Include="..\lcd.c" />
-    <ClCompile Include="..\midi.c" />
-    <ClCompile Include="..\mman.c" />
-    <ClCompile Include="..\parser.c" />
-    <ClCompile Include="..\picasso96_win.c" />
-    <ClCompile Include="..\posixemu.c" />
-    <ClCompile Include="..\registry.c" />
-    <ClCompile Include="..\cloanto\RetroPlatformGuestIPC.c" />
-    <ClCompile Include="..\rp.c" />
-    <ClCompile Include="..\scaler.c" />
-    <ClCompile Include="..\scaler_more.c" />
-    <ClCompile Include="..\screenshot.c" />
-    <ClCompile Include="..\serial_win32.c" />
-    <ClCompile Include="..\sounddep\sound.c" />
-    <ClCompile Include="..\unicode.c" />
-    <ClCompile Include="..\win32.c" />
-    <ClCompile Include="..\win32_scale2x.c" />
-    <ClCompile Include="..\win32_uaenet.c" />
-    <ClCompile Include="..\win32gfx.c" />
-    <ClCompile Include="..\win32gui.c" />
-    <ClCompile Include="..\win32gui_extra.c" />
-    <ClCompile Include="..\writelog.c" />
-    <ClCompile Include="..\..\a2065.c" />
-    <ClCompile Include="..\..\a2091.c" />
-    <ClCompile Include="..\..\akiko.c" />
-    <ClCompile Include="..\..\amax.c" />
-    <ClCompile Include="..\..\ar.c" />
-    <ClCompile Include="..\..\arcadia.c" />
-    <ClCompile Include="..\..\audio.c" />
-    <ClCompile Include="..\..\autoconf.c" />
-    <ClCompile Include="..\..\blitfunc.c" />
-    <ClCompile Include="..\..\blittable.c" />
-    <ClCompile Include="..\..\blitter.c" />
-    <ClCompile Include="..\..\blkdev.c" />
-    <ClCompile Include="..\..\blkdev_cdimage.c" />
-    <ClCompile Include="..\..\bsdsocket.c" />
-    <ClCompile Include="..\..\catweasel.c" />
-    <ClCompile Include="..\..\cd32_fmv.c" />
-    <ClCompile Include="..\..\cdrom.c" />
-    <ClCompile Include="..\..\cdtv.c" />
-    <ClCompile Include="..\..\cfgfile.c" />
-    <ClCompile Include="..\..\cia.c" />
-    <ClCompile Include="..\..\consolehook.c" />
-    <ClCompile Include="..\..\cpudefs.c" />
-    <ClCompile Include="..\..\cpuemu_0.c" />
-    <ClCompile Include="..\..\cpuemu_11.c" />
-    <ClCompile Include="..\..\cpuemu_12.c" />
-    <ClCompile Include="..\..\cpuemu_20.c" />
-    <ClCompile Include="..\..\cpuemu_31.c" />
-    <ClCompile Include="..\..\cpummu.c" />
-    <ClCompile Include="..\..\cpustbl.c" />
-    <ClCompile Include="..\..\crc32.c" />
-    <ClCompile Include="..\..\custom.c" />
-    <ClCompile Include="..\..\debug.c" />
-    <ClCompile Include="..\..\disk.c" />
-    <ClCompile Include="..\..\diskutil.c" />
-    <ClCompile Include="..\..\dongle.c" />
-    <ClCompile Include="..\..\drawing.c" />
-    <ClCompile Include="..\..\driveclick.c" />
-    <ClCompile Include="..\..\enforcer.c" />
-    <ClCompile Include="..\..\epsonprinter.c" />
-    <ClCompile Include="..\..\ersatz.c" />
-    <ClCompile Include="..\..\expansion.c" />
-    <ClCompile Include="..\..\fdi2raw.c" />
-    <ClCompile Include="..\..\filesys.c" />
-    <ClCompile Include="..\..\fpp.c" />
-    <ClCompile Include="..\..\fsdb.c" />
-    <ClCompile Include="..\..\fsusage.c" />
-    <ClCompile Include="..\..\gayle.c" />
-    <ClCompile Include="..\..\gfxutil.c" />
-    <ClCompile Include="..\..\hardfile.c" />
-    <ClCompile Include="..\..\identify.c" />
-    <ClCompile Include="..\..\inputdevice.c" />
-    <ClCompile Include="..\..\keybuf.c" />
-    <ClCompile Include="..\..\main.c" />
-    <ClCompile Include="..\..\memory.c" />
-    <ClCompile Include="..\..\missing.c" />
-    <ClCompile Include="..\..\native2amiga.c" />
-    <ClCompile Include="..\..\ncr_scsi.c" />
-    <ClCompile Include="..\..\newcpu.c" />
-    <ClCompile Include="..\..\readcpu.c" />
-    <ClCompile Include="..\..\rommgr.c" />
-    <ClCompile Include="..\..\sampler.c" />
-    <ClCompile Include="..\..\sana2.c" />
-    <ClCompile Include="..\..\savestate.c" />
-    <ClCompile Include="..\..\scsi.c" />
-    <ClCompile Include="..\..\scsiemul.c" />
-    <ClCompile Include="..\..\traps.c" />
-    <ClCompile Include="..\..\uaeexe.c" />
-    <ClCompile Include="..\..\uaeipc.c" />
-    <ClCompile Include="..\..\uaelib.c" />
-    <ClCompile Include="..\..\uaeresource.c" />
-    <ClCompile Include="..\..\uaeserial.c" />
-    <ClCompile Include="..\..\zfile.c" />
-    <ClCompile Include="..\..\zfile_archive.c" />
-    <ClCompile Include="..\..\jit\compemu.c" />
-    <ClCompile Include="..\..\jit\compemu_fpp.c" />
-    <ClCompile Include="..\..\jit\compemu_support.c" />
-    <ClCompile Include="..\..\jit\compstbl.c" />
-    <ClCompile Include="..\..\moduleripper.c" />
-    <ClCompile Include="..\..\archivers\dms\crc_csum.c" />
-    <ClCompile Include="..\..\archivers\dms\getbits.c" />
-    <ClCompile Include="..\..\archivers\dms\maketbl.c" />
-    <ClCompile Include="..\..\archivers\dms\pfile.c" />
-    <ClCompile Include="..\..\archivers\dms\tables.c" />
-    <ClCompile Include="..\..\archivers\dms\u_deep.c" />
-    <ClCompile Include="..\..\archivers\dms\u_heavy.c" />
-    <ClCompile Include="..\..\archivers\dms\u_init.c" />
-    <ClCompile Include="..\..\archivers\dms\u_medium.c" />
-    <ClCompile Include="..\..\archivers\dms\u_quick.c" />
-    <ClCompile Include="..\..\archivers\dms\u_rle.c" />
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zAlloc.c" />
-    <ClCompile Include="..\..\archivers\7z\7zBuf.c" />
-    <ClCompile Include="..\..\archivers\7z\7zCrc.c" />
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zDecode.c" />
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zExtract.c" />
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zHeader.c" />
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zIn.c" />
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zItem.c" />
-    <ClCompile Include="..\..\archivers\7z\7zStream.c" />
-    <ClCompile Include="..\..\archivers\7z\Bcj2.c" />
-    <ClCompile Include="..\..\archivers\7z\Bra.c" />
-    <ClCompile Include="..\..\archivers\7z\Bra86.c" />
-    <ClCompile Include="..\..\archivers\7z\LzmaDec.c" />
-    <ClCompile Include="..\..\archivers\lha\crcio.c" />
-    <ClCompile Include="..\..\archivers\lha\dhuf.c" />
-    <ClCompile Include="..\..\archivers\lha\header.c" />
-    <ClCompile Include="..\..\archivers\lha\huf.c" />
-    <ClCompile Include="..\..\archivers\lha\larc.c" />
-    <ClCompile Include="..\..\archivers\lha\lhamaketbl.c" />
-    <ClCompile Include="..\..\archivers\lha\lharc.c" />
-    <ClCompile Include="..\..\archivers\lha\shuf.c" />
-    <ClCompile Include="..\..\archivers\lha\slide.c" />
-    <ClCompile Include="..\..\archivers\lha\uae_lha.c" />
-    <ClCompile Include="..\..\archivers\lha\util.c" />
-    <ClCompile Include="..\..\archivers\zip\unzip.c" />
-    <ClCompile Include="..\..\archivers\lzx\unlzx.c" />
-    <ClCompile Include="..\..\archivers\wrp\warp.c" />
+    <ClCompile Include="..\driveclick_win32.cpp" />
+    <ClCompile Include="..\dxwrap.cpp" />
+    <ClCompile Include="..\fsdb_mywin32.cpp" />
+    <ClCompile Include="..\fsdb_win32.cpp" />
+    <ClCompile Include="..\hardfile_win32.cpp" />
+    <ClCompile Include="..\hq2x_d3d.cpp" />
+    <ClCompile Include="..\ioport.cpp" />
+    <ClCompile Include="..\keyboard_win32.cpp" />
+    <ClCompile Include="..\lcd.cpp" />
+    <ClCompile Include="..\midi.cpp" />
+    <ClCompile Include="..\mman.cpp" />
+    <ClCompile Include="..\parser.cpp" />
+    <ClCompile Include="..\picasso96_win.cpp" />
+    <ClCompile Include="..\posixemu.cpp" />
+    <ClCompile Include="..\registry.cpp" />
+    <ClCompile Include="..\cloanto\RetroPlatformGuestIPC.cpp" />
+    <ClCompile Include="..\rp.cpp" />
+    <ClCompile Include="..\scaler.cpp" />
+    <ClCompile Include="..\scaler_more.cpp" />
+    <ClCompile Include="..\screenshot.cpp" />
+    <ClCompile Include="..\serial_win32.cpp" />
+    <ClCompile Include="..\sounddep\sound.cpp" />
+    <ClCompile Include="..\unicode.cpp" />
+    <ClCompile Include="..\win32.cpp" />
+    <ClCompile Include="..\win32_scale2x.cpp" />
+    <ClCompile Include="..\win32_uaenet.cpp" />
+    <ClCompile Include="..\win32gfx.cpp" />
+    <ClCompile Include="..\win32gui.cpp" />
+    <ClCompile Include="..\win32gui_extra.cpp" />
+    <ClCompile Include="..\writelog.cpp" />
+    <ClCompile Include="..\..\a2065.cpp" />
+    <ClCompile Include="..\..\a2091.cpp" />
+    <ClCompile Include="..\..\akiko.cpp" />
+    <ClCompile Include="..\..\amax.cpp" />
+    <ClCompile Include="..\..\ar.cpp" />
+    <ClCompile Include="..\..\arcadia.cpp" />
+    <ClCompile Include="..\..\audio.cpp" />
+    <ClCompile Include="..\..\autoconf.cpp" />
+    <ClCompile Include="..\..\blitfunc.cpp" />
+    <ClCompile Include="..\..\blittable.cpp" />
+    <ClCompile Include="..\..\blitter.cpp" />
+    <ClCompile Include="..\..\blkdev.cpp" />
+    <ClCompile Include="..\..\blkdev_cdimage.cpp" />
+    <ClCompile Include="..\..\bsdsocket.cpp" />
+    <ClCompile Include="..\..\catweasel.cpp" />
+    <ClCompile Include="..\..\cd32_fmv.cpp" />
+    <ClCompile Include="..\..\cdrom.cpp" />
+    <ClCompile Include="..\..\cdtv.cpp" />
+    <ClCompile Include="..\..\cfgfile.cpp" />
+    <ClCompile Include="..\..\cia.cpp" />
+    <ClCompile Include="..\..\consolehook.cpp" />
+    <ClCompile Include="..\..\cpudefs.cpp" />
+    <ClCompile Include="..\..\cpuemu_0.cpp" />
+    <ClCompile Include="..\..\cpuemu_11.cpp" />
+    <ClCompile Include="..\..\cpuemu_12.cpp" />
+    <ClCompile Include="..\..\cpuemu_20.cpp" />
+    <ClCompile Include="..\..\cpuemu_31.cpp" />
+    <ClCompile Include="..\..\cpummu.cpp" />
+    <ClCompile Include="..\..\cpustbl.cpp" />
+    <ClCompile Include="..\..\crc32.cpp" />
+    <ClCompile Include="..\..\custom.cpp" />
+    <ClCompile Include="..\..\debug.cpp" />
+    <ClCompile Include="..\..\disk.cpp" />
+    <ClCompile Include="..\..\diskutil.cpp" />
+    <ClCompile Include="..\..\dongle.cpp" />
+    <ClCompile Include="..\..\drawing.cpp" />
+    <ClCompile Include="..\..\driveclick.cpp" />
+    <ClCompile Include="..\..\enforcer.cpp" />
+    <ClCompile Include="..\..\epsonprinter.cpp" />
+    <ClCompile Include="..\..\ersatz.cpp" />
+    <ClCompile Include="..\..\expansion.cpp" />
+    <ClCompile Include="..\..\fdi2raw.cpp" />
+    <ClCompile Include="..\..\filesys.cpp" />
+    <ClCompile Include="..\..\fpp.cpp" />
+    <ClCompile Include="..\..\fsdb.cpp" />
+    <ClCompile Include="..\..\fsusage.cpp" />
+    <ClCompile Include="..\..\gayle.cpp" />
+    <ClCompile Include="..\..\gfxutil.cpp" />
+    <ClCompile Include="..\..\hardfile.cpp" />
+    <ClCompile Include="..\..\identify.cpp" />
+    <ClCompile Include="..\..\inputdevice.cpp" />
+    <ClCompile Include="..\..\keybuf.cpp" />
+    <ClCompile Include="..\..\main.cpp" />
+    <ClCompile Include="..\..\memory.cpp" />
+    <ClCompile Include="..\..\missing.cpp" />
+    <ClCompile Include="..\..\native2amiga.cpp" />
+    <ClCompile Include="..\..\ncr_scsi.cpp" />
+    <ClCompile Include="..\..\newcpu.cpp" />
+    <ClCompile Include="..\..\readcpu.cpp" />
+    <ClCompile Include="..\..\rommgr.cpp" />
+    <ClCompile Include="..\..\sampler.cpp" />
+    <ClCompile Include="..\..\sana2.cpp" />
+    <ClCompile Include="..\..\savestate.cpp" />
+    <ClCompile Include="..\..\scsi.cpp" />
+    <ClCompile Include="..\..\scsiemul.cpp" />
+    <ClCompile Include="..\..\traps.cpp" />
+    <ClCompile Include="..\..\uaeexe.cpp" />
+    <ClCompile Include="..\..\uaeipc.cpp" />
+    <ClCompile Include="..\..\uaelib.cpp" />
+    <ClCompile Include="..\..\uaeresource.cpp" />
+    <ClCompile Include="..\..\uaeserial.cpp" />
+    <ClCompile Include="..\..\zfile.cpp" />
+    <ClCompile Include="..\..\zfile_archive.cpp" />
+    <ClCompile Include="..\..\jit\compemu.cpp" />
+    <ClCompile Include="..\..\jit\compemu_fpp.cpp" />
+    <ClCompile Include="..\..\jit\compemu_support.cpp" />
+    <ClCompile Include="..\..\jit\compstbl.cpp" />
+    <ClCompile Include="..\..\moduleripper.cpp" />
+    <ClCompile Include="..\..\archivers\dms\crc_csum.cpp" />
+    <ClCompile Include="..\..\archivers\dms\getbits.cpp" />
+    <ClCompile Include="..\..\archivers\dms\maketbl.cpp" />
+    <ClCompile Include="..\..\archivers\dms\pfile.cpp" />
+    <ClCompile Include="..\..\archivers\dms\tables.cpp" />
+    <ClCompile Include="..\..\archivers\dms\u_deep.cpp" />
+    <ClCompile Include="..\..\archivers\dms\u_heavy.cpp" />
+    <ClCompile Include="..\..\archivers\dms\u_init.cpp" />
+    <ClCompile Include="..\..\archivers\dms\u_medium.cpp" />
+    <ClCompile Include="..\..\archivers\dms\u_quick.cpp" />
+    <ClCompile Include="..\..\archivers\dms\u_rle.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zAlloc.cpp" />
+    <ClCompile Include="..\..\archivers\7z\7zBuf.cpp" />
+    <ClCompile Include="..\..\archivers\7z\7zCrc.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zDecode.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zExtract.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zHeader.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zIn.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zItem.cpp" />
+    <ClCompile Include="..\..\archivers\7z\7zStream.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Bcj2.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Bra.cpp" />
+    <ClCompile Include="..\..\archivers\7z\Bra86.cpp" />
+    <ClCompile Include="..\..\archivers\7z\LzmaDec.cpp" />
+    <ClCompile Include="..\..\archivers\lha\crcio.cpp" />
+    <ClCompile Include="..\..\archivers\lha\dhuf.cpp" />
+    <ClCompile Include="..\..\archivers\lha\header.cpp" />
+    <ClCompile Include="..\..\archivers\lha\huf.cpp" />
+    <ClCompile Include="..\..\archivers\lha\larc.cpp" />
+    <ClCompile Include="..\..\archivers\lha\lhamaketbl.cpp" />
+    <ClCompile Include="..\..\archivers\lha\lharc.cpp" />
+    <ClCompile Include="..\..\archivers\lha\shuf.cpp" />
+    <ClCompile Include="..\..\archivers\lha\slide.cpp" />
+    <ClCompile Include="..\..\archivers\lha\uae_lha.cpp" />
+    <ClCompile Include="..\..\archivers\lha\util.cpp" />
+    <ClCompile Include="..\..\archivers\zip\unzip.cpp" />
+    <ClCompile Include="..\..\archivers\lzx\unlzx.cpp" />
+    <ClCompile Include="..\..\archivers\wrp\warp.cpp" />
   </ItemGroup>
   <ItemGroup>
     <None Include="..\resources\35floppy.ico" />
index e9404334f55dd5b9065468efdf16ab49ff51628a..5802e2342dce6dc7111de5ef3e3f34f8c661c603 100644 (file)
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\ahidsound_dsonly.c">
+    <ClCompile Include="..\ahidsound_dsonly.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\ahidsound_new.c">
+    <ClCompile Include="..\ahidsound_new.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\avioutput.c">
+    <ClCompile Include="..\avioutput.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\blkdev_win32_aspi.c">
+    <ClCompile Include="..\blkdev_win32_aspi.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\blkdev_win32_ioctl.c">
+    <ClCompile Include="..\blkdev_win32_ioctl.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\blkdev_win32_spti.c">
+    <ClCompile Include="..\blkdev_win32_spti.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\bsdsock.c">
+    <ClCompile Include="..\bsdsock.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\caps\caps_win32.c">
+    <ClCompile Include="..\caps\caps_win32.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\clipboard_win32.c">
+    <ClCompile Include="..\clipboard_win32.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\debug_win32.c">
+    <ClCompile Include="..\debug_win32.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\dinput.c">
+    <ClCompile Include="..\dinput.cpp">
       <Filter>win32</Filter>
     </ClCompile>
     <ClCompile Include="..\direct3d.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\driveclick_win32.c">
+    <ClCompile Include="..\driveclick_win32.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\dxwrap.c">
+    <ClCompile Include="..\dxwrap.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\fsdb_mywin32.c">
+    <ClCompile Include="..\fsdb_mywin32.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\fsdb_win32.c">
+    <ClCompile Include="..\fsdb_win32.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\hardfile_win32.c">
+    <ClCompile Include="..\hardfile_win32.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\hq2x_d3d.c">
+    <ClCompile Include="..\hq2x_d3d.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\ioport.c">
+    <ClCompile Include="..\ioport.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\keyboard_win32.c">
+    <ClCompile Include="..\keyboard_win32.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\lcd.c">
+    <ClCompile Include="..\lcd.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\midi.c">
+    <ClCompile Include="..\midi.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\mman.c">
+    <ClCompile Include="..\mman.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\parser.c">
+    <ClCompile Include="..\parser.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\picasso96_win.c">
+    <ClCompile Include="..\picasso96_win.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\posixemu.c">
+    <ClCompile Include="..\posixemu.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\registry.c">
+    <ClCompile Include="..\registry.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\cloanto\RetroPlatformGuestIPC.c">
+    <ClCompile Include="..\cloanto\RetroPlatformGuestIPC.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\rp.c">
+    <ClCompile Include="..\rp.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\scaler.c">
+    <ClCompile Include="..\scaler.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\scaler_more.c">
+    <ClCompile Include="..\scaler_more.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\screenshot.c">
+    <ClCompile Include="..\screenshot.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\serial_win32.c">
+    <ClCompile Include="..\serial_win32.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\sounddep\sound.c">
+    <ClCompile Include="..\sounddep\sound.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\unicode.c">
+    <ClCompile Include="..\unicode.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\win32.c">
+    <ClCompile Include="..\win32.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\win32_scale2x.c">
+    <ClCompile Include="..\win32_scale2x.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\win32_uaenet.c">
+    <ClCompile Include="..\win32_uaenet.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\win32gfx.c">
+    <ClCompile Include="..\win32gfx.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\win32gui.c">
+    <ClCompile Include="..\win32gui.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\win32gui_extra.c">
+    <ClCompile Include="..\win32gui_extra.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\writelog.c">
+    <ClCompile Include="..\writelog.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\a2065.c">
+    <ClCompile Include="..\..\a2065.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\a2091.c">
+    <ClCompile Include="..\..\a2091.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\akiko.c">
+    <ClCompile Include="..\..\akiko.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\amax.c">
+    <ClCompile Include="..\..\amax.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\ar.c">
+    <ClCompile Include="..\..\ar.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\arcadia.c">
+    <ClCompile Include="..\..\arcadia.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\audio.c">
+    <ClCompile Include="..\..\audio.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\autoconf.c">
+    <ClCompile Include="..\..\autoconf.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\blitfunc.c">
+    <ClCompile Include="..\..\blitfunc.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\blittable.c">
+    <ClCompile Include="..\..\blittable.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\blitter.c">
+    <ClCompile Include="..\..\blitter.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\blkdev.c">
+    <ClCompile Include="..\..\blkdev.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\blkdev_cdimage.c">
+    <ClCompile Include="..\..\blkdev_cdimage.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\bsdsocket.c">
+    <ClCompile Include="..\..\bsdsocket.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\catweasel.c">
+    <ClCompile Include="..\..\catweasel.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cd32_fmv.c">
+    <ClCompile Include="..\..\cd32_fmv.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cdrom.c">
+    <ClCompile Include="..\..\cdrom.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cdtv.c">
+    <ClCompile Include="..\..\cdtv.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cfgfile.c">
+    <ClCompile Include="..\..\cfgfile.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cia.c">
+    <ClCompile Include="..\..\cia.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\consolehook.c">
+    <ClCompile Include="..\..\consolehook.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cpudefs.c">
+    <ClCompile Include="..\..\cpudefs.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cpuemu_0.c">
+    <ClCompile Include="..\..\cpuemu_0.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cpuemu_11.c">
+    <ClCompile Include="..\..\cpuemu_11.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cpuemu_12.c">
+    <ClCompile Include="..\..\cpuemu_12.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cpuemu_20.c">
+    <ClCompile Include="..\..\cpuemu_20.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cpuemu_31.c">
+    <ClCompile Include="..\..\cpuemu_31.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cpummu.c">
+    <ClCompile Include="..\..\cpummu.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\cpustbl.c">
+    <ClCompile Include="..\..\cpustbl.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\crc32.c">
+    <ClCompile Include="..\..\crc32.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\custom.c">
+    <ClCompile Include="..\..\custom.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\debug.c">
+    <ClCompile Include="..\..\debug.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\disk.c">
+    <ClCompile Include="..\..\disk.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\diskutil.c">
+    <ClCompile Include="..\..\diskutil.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\dongle.c">
+    <ClCompile Include="..\..\dongle.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\drawing.c">
+    <ClCompile Include="..\..\drawing.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\driveclick.c">
+    <ClCompile Include="..\..\driveclick.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\enforcer.c">
+    <ClCompile Include="..\..\enforcer.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\epsonprinter.c">
+    <ClCompile Include="..\..\epsonprinter.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\ersatz.c">
+    <ClCompile Include="..\..\ersatz.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\expansion.c">
+    <ClCompile Include="..\..\expansion.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\fdi2raw.c">
+    <ClCompile Include="..\..\fdi2raw.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\filesys.c">
+    <ClCompile Include="..\..\filesys.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\fpp.c">
+    <ClCompile Include="..\..\fpp.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\fsdb.c">
+    <ClCompile Include="..\..\fsdb.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\fsusage.c">
+    <ClCompile Include="..\..\fsusage.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\gayle.c">
+    <ClCompile Include="..\..\gayle.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\gfxutil.c">
+    <ClCompile Include="..\..\gfxutil.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\hardfile.c">
+    <ClCompile Include="..\..\hardfile.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\identify.c">
+    <ClCompile Include="..\..\identify.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\inputdevice.c">
+    <ClCompile Include="..\..\inputdevice.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\keybuf.c">
+    <ClCompile Include="..\..\keybuf.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\main.c">
+    <ClCompile Include="..\..\main.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\memory.c">
+    <ClCompile Include="..\..\memory.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\missing.c">
+    <ClCompile Include="..\..\missing.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\native2amiga.c">
+    <ClCompile Include="..\..\native2amiga.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\ncr_scsi.c">
+    <ClCompile Include="..\..\ncr_scsi.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\newcpu.c">
+    <ClCompile Include="..\..\newcpu.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\readcpu.c">
+    <ClCompile Include="..\..\readcpu.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\rommgr.c">
+    <ClCompile Include="..\..\rommgr.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sampler.c">
+    <ClCompile Include="..\..\sampler.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sana2.c">
+    <ClCompile Include="..\..\sana2.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\savestate.c">
+    <ClCompile Include="..\..\savestate.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\scsi.c">
+    <ClCompile Include="..\..\scsi.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\scsiemul.c">
+    <ClCompile Include="..\..\scsiemul.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\traps.c">
+    <ClCompile Include="..\..\traps.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\uaeexe.c">
+    <ClCompile Include="..\..\uaeexe.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\uaeipc.c">
+    <ClCompile Include="..\..\uaeipc.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\uaelib.c">
+    <ClCompile Include="..\..\uaelib.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\uaeresource.c">
+    <ClCompile Include="..\..\uaeresource.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\uaeserial.c">
+    <ClCompile Include="..\..\uaeserial.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\zfile.c">
+    <ClCompile Include="..\..\zfile.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\zfile_archive.c">
+    <ClCompile Include="..\..\zfile_archive.cpp">
       <Filter>common</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\jit\compemu.c">
+    <ClCompile Include="..\..\jit\compemu.cpp">
       <Filter>jit</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\jit\compemu_fpp.c">
+    <ClCompile Include="..\..\jit\compemu_fpp.cpp">
       <Filter>jit</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\jit\compemu_support.c">
+    <ClCompile Include="..\..\jit\compemu_support.cpp">
       <Filter>jit</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\jit\compstbl.c">
+    <ClCompile Include="..\..\jit\compstbl.cpp">
       <Filter>jit</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\moduleripper.c">
+    <ClCompile Include="..\..\moduleripper.cpp">
       <Filter>prowizard</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\crc_csum.c">
+    <ClCompile Include="..\..\archivers\dms\crc_csum.cpp">
       <Filter>decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\getbits.c">
+    <ClCompile Include="..\..\archivers\dms\getbits.cpp">
       <Filter>decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\maketbl.c">
+    <ClCompile Include="..\..\archivers\dms\maketbl.cpp">
       <Filter>decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\pfile.c">
+    <ClCompile Include="..\..\archivers\dms\pfile.cpp">
       <Filter>decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\tables.c">
+    <ClCompile Include="..\..\archivers\dms\tables.cpp">
       <Filter>decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\u_deep.c">
+    <ClCompile Include="..\..\archivers\dms\u_deep.cpp">
       <Filter>decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\u_heavy.c">
+    <ClCompile Include="..\..\archivers\dms\u_heavy.cpp">
       <Filter>decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\u_init.c">
+    <ClCompile Include="..\..\archivers\dms\u_init.cpp">
       <Filter>decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\u_medium.c">
+    <ClCompile Include="..\..\archivers\dms\u_medium.cpp">
       <Filter>decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\u_quick.c">
+    <ClCompile Include="..\..\archivers\dms\u_quick.cpp">
       <Filter>decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\dms\u_rle.c">
+    <ClCompile Include="..\..\archivers\dms\u_rle.cpp">
       <Filter>decompressors\dms</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zAlloc.c">
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zAlloc.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\7zBuf.c">
+    <ClCompile Include="..\..\archivers\7z\7zBuf.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\7zCrc.c">
+    <ClCompile Include="..\..\archivers\7z\7zCrc.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zDecode.c">
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zDecode.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zExtract.c">
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zExtract.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zHeader.c">
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zHeader.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zIn.c">
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zIn.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zItem.c">
+    <ClCompile Include="..\..\archivers\7z\Archive\7z\7zItem.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\7zStream.c">
+    <ClCompile Include="..\..\archivers\7z\7zStream.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Bcj2.c">
+    <ClCompile Include="..\..\archivers\7z\Bcj2.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Bra.c">
+    <ClCompile Include="..\..\archivers\7z\Bra.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\Bra86.c">
+    <ClCompile Include="..\..\archivers\7z\Bra86.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\7z\LzmaDec.c">
+    <ClCompile Include="..\..\archivers\7z\LzmaDec.cpp">
       <Filter>decompressors\7z</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\crcio.c">
+    <ClCompile Include="..\..\archivers\lha\crcio.cpp">
       <Filter>decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\dhuf.c">
+    <ClCompile Include="..\..\archivers\lha\dhuf.cpp">
       <Filter>decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\header.c">
+    <ClCompile Include="..\..\archivers\lha\header.cpp">
       <Filter>decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\huf.c">
+    <ClCompile Include="..\..\archivers\lha\huf.cpp">
       <Filter>decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\larc.c">
+    <ClCompile Include="..\..\archivers\lha\larc.cpp">
       <Filter>decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\lhamaketbl.c">
+    <ClCompile Include="..\..\archivers\lha\lhamaketbl.cpp">
       <Filter>decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\lharc.c">
+    <ClCompile Include="..\..\archivers\lha\lharc.cpp">
       <Filter>decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\shuf.c">
+    <ClCompile Include="..\..\archivers\lha\shuf.cpp">
       <Filter>decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\slide.c">
+    <ClCompile Include="..\..\archivers\lha\slide.cpp">
       <Filter>decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\uae_lha.c">
+    <ClCompile Include="..\..\archivers\lha\uae_lha.cpp">
       <Filter>decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lha\util.c">
+    <ClCompile Include="..\..\archivers\lha\util.cpp">
       <Filter>decompressors\lha</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\zip\unzip.c">
+    <ClCompile Include="..\..\archivers\zip\unzip.cpp">
       <Filter>decompressors\zip</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\lzx\unlzx.c">
+    <ClCompile Include="..\..\archivers\lzx\unlzx.cpp">
       <Filter>decompressors\lzx</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\archivers\wrp\warp.c">
+    <ClCompile Include="..\..\archivers\wrp\warp.cpp">
       <Filter>decompressors\wrp</Filter>
     </ClCompile>
   </ItemGroup>
index 30340c20c53cb04b2e7a70336386831d8a417f6e..c88dc3a29e17046ff2304feb1449c1eaa3951152 100644 (file)
@@ -1,5 +1,20 @@
 
-- hpos "offset" was accidentally changed (cmp.w #0,$dff006 is possible)
+Beta 11:
+
+- hpos "offset" was accidentally changed (DFF006 = 0000 is possible)
+- .cd32 rom file extension added (missed when .a500, .a1200 and .a4000
+  was added long time ago)
+- b10 interrupt issues at least partially fixed (freezing or crashing demos)
+- code cleanup, compiles as C++ now (do not worry, this is not "just add
+  hundreds of casts to make it compile") This project has gotten so big
+  that plain C is making things painful (for example archive filehandling
+  would be less messy if written properly in C++, core emulation works fine
+  in C, also future wxwidgets GUI is now at least theoretically possible..)
+  This should also make portability simpler, easier to have better
+  "insulation" between portable and OS specific code. Anyway, nothing
+  really changes until (much) later..
+  Random things can be broken! Report all kinds of undocumented changes
+  compared to previous betas and 2.0.1.
 
 Beta 10:
 
similarity index 98%
rename from od-win32/writelog.c
rename to od-win32/writelog.cpp
index 2f91f0ed7a2d4f2bd57f176bd399600bd4ce8f23..e65ac284bded0eb318845199f0b6f5bfb5d2f7b8 100644 (file)
@@ -65,7 +65,7 @@ static int cs_init;
 
 FILE *debugfile = NULL;
 int console_logging = 0;
-static LONG debugger_type = -1;
+static int debugger_type = -1;
 extern BOOL debuggerinitializing;
 int always_flush_log = 0;
 
@@ -162,7 +162,7 @@ void reopen_console (void)
        hwnd = myGetConsoleWindow ();
        if (hwnd) {
                int newpos = 1;
-               LONG x, y, w, h;
+               int x, y, w, h;
                if (!regqueryint (NULL, L"LoggerPosX", &x))
                        newpos = 0;
                if (!regqueryint (NULL, L"LoggerPosY", &y))
@@ -427,7 +427,7 @@ void write_log (const TCHAR *format, ...)
                        bufsize *= 10;
                        if (bufp != buffer)
                                xfree (bufp);
-                       bufp = xmalloc (bufsize * sizeof (TCHAR));
+                       bufp = xmalloc (TCHAR, bufsize);
                        continue;
                }
                break;
@@ -495,7 +495,7 @@ TCHAR* buf_out (TCHAR *buffer, int *bufsize, const TCHAR *format, ...)
        return buffer + _tcslen (buffer);
 }
 
-void *log_open (const TCHAR *name, int append, int bootlog)
+FILE *log_open (const TCHAR *name, int append, int bootlog)
 {
        FILE *f = NULL;
 
@@ -522,7 +522,7 @@ void *log_open (const TCHAR *name, int append, int bootlog)
        return f;
 }
 
-void log_close (void *f)
+void log_close (FILE *f)
 {
        fclose (f);
 }
@@ -543,6 +543,3 @@ void jit_abort (const TCHAR *format,...)
        happened = 1;
        uae_reset (1);
 }
-
-
-
similarity index 100%
rename from p96_blit.c
rename to p96_blit.cpp
similarity index 100%
rename from picasso96.c
rename to picasso96.cpp
index 8655a79c58bf17fa5a26b894f215ec88eda0f323..d2f7ec30267832c30b3c7ed3610452351284a989 100644 (file)
@@ -352,4 +352,6 @@ extern char Extensions[_KNOWN_FORMATS+1][33];
 extern Uchar CONVERT;
 extern Uchar Amiga_EXE_Header;
 
-extern void write_log (const char *, ...);
\ No newline at end of file
+extern void pw_write_log (const char *, ...);
+extern FILE *moduleripper2_fopen (const char *name, const char *mode, const char *aid, int addr, int size);
+extern FILE *moduleripper_fopen (const char *aname, const char *amode);
index 047e13612151aebc9ae4fe7f904690594a3fefbe..a32710ba5fe4fbe98d087a2871b42e03c2f81927 100644 (file)
@@ -21,7 +21,6 @@ typedef unsigned char Uchar;
 typedef unsigned long Ulong;
 typedef unsigned short Ushort;
 
-#include "moduleripper.h"
 #ifdef _WIN32
 __inline Ulong htonlx (Ulong v)
 {
index e88369a7bde2d4a4bc164e78b4fee77e40af37f7..46f1233c69f06765102241035b62486e8f4f57e5 100644 (file)
@@ -229,17 +229,17 @@ void Support_Types_FileDefault ( void )
 void Save_Rip ( char * format_to_save, int FMT_EXT )
 {
   Save_Status = BAD;
-  write_log ( "%s found at %ld !. its size is : %ld\n", format_to_save , PW_Start_Address , OutputSize );
+  pw_write_log ( "%s found at %ld !. its size is : %ld\n", format_to_save , PW_Start_Address , OutputSize );
   if ( (PW_Start_Address + (long)OutputSize) > PW_in_size )
   {
-    write_log ( "!!! Truncated, missing (%ld byte(s) !)\n"
+    pw_write_log ( "!!! Truncated, missing (%ld byte(s) !)\n"
              , (PW_Start_Address+OutputSize)-PW_in_size );
     PW_i += 2 ;
     return;
   }
   BZERO ( OutName_final, sizeof OutName_final);
   sprintf ( OutName_final , "%ld.%s" , Cpt_Filename , Extensions[FMT_EXT] );
-  write_log ( "  saving in file \"%s\" ... " , OutName_final );
+  pw_write_log ( "  saving in file \"%s\" ... " , OutName_final );
   Cpt_Filename += 1;
   PW_out = moduleripper2_fopen ( OutName_final , "w+b", format_to_save, PW_Start_Address, OutputSize);
   //PW_out = PW_fopen ( OutName_final , "w+b" );
@@ -247,10 +247,10 @@ void Save_Rip ( char * format_to_save, int FMT_EXT )
       return;
   fwrite ( &in_data[PW_Start_Address] , OutputSize , 1 , PW_out );
   fclose ( PW_out );
-  write_log ( "done\n" );
+  pw_write_log ( "done\n" );
   if ( CONVERT == GOOD )
   {
-    write_log ( "  converting to Protracker ... " );
+    pw_write_log ( "  converting to Protracker ... " );
   }
   //fflush ( stdout );
   Save_Status = GOOD;
@@ -263,31 +263,31 @@ void Save_Rip ( char * format_to_save, int FMT_EXT )
 void Save_Rip_Special ( char * format_to_save, int FMT_EXT, Uchar * Header_Block , Ulong Block_Size )
 {
   Save_Status = BAD;
-  write_log ( "%s found at %ld !. its size is : %ld\n", format_to_save , PW_Start_Address , OutputSize );
+  pw_write_log ( "%s found at %ld !. its size is : %ld\n", format_to_save , PW_Start_Address , OutputSize );
   if ( (PW_Start_Address + (long)OutputSize) > PW_in_size )
   {
-    write_log ( "!!! Truncated, missing (%ld byte(s) !)\n"
+    pw_write_log ( "!!! Truncated, missing (%ld byte(s) !)\n"
              , (PW_Start_Address+OutputSize)-PW_in_size );
     PW_i += 2 ;
     return;
   }
   BZERO (OutName_final, sizeof OutName_final);
   sprintf ( OutName_final , "%ld.%s" , Cpt_Filename , Extensions[FMT_EXT] );
-  write_log ( "  saving in file \"%s\" ... " , OutName_final );
+  pw_write_log ( "  saving in file \"%s\" ... " , OutName_final );
   Cpt_Filename += 1;
 //  PW_out = PW_fopen ( OutName_final , "w+b" );
   PW_out = moduleripper2_fopen ( OutName_final , "w+b", format_to_save, PW_Start_Address, OutputSize );
   fwrite ( Header_Block , Block_Size  , 1 , PW_out );
   fwrite ( &in_data[PW_Start_Address] , OutputSize , 1 , PW_out );
   fclose ( PW_out );
-  write_log ( "done\n" );
+  pw_write_log ( "done\n" );
   if ( CONVERT == GOOD )
   {
-    write_log ( "  converting to Protracker ... " );
+    pw_write_log ( "  converting to Protracker ... " );
   }
-  write_log ( "  Header of this file was missing and has been rebuilt !\n" );
+  pw_write_log ( "  Header of this file was missing and has been rebuilt !\n" );
   if ( FMT_EXT == DragPack252)
-    write_log ( "  WARNING !: it's a fake header since in this case !!\n" );
+    pw_write_log ( "  WARNING !: it's a fake header since in this case !!\n" );
   //fflush ( stdout );
   Amiga_EXE_Header = GOOD;
   Save_Status = GOOD;
similarity index 99%
rename from readcpu.c
rename to readcpu.cpp
index 09aae6003c2e43a0deaac1a6183f9ce6a11d3983..5a1cdfeac32deb931dba699ac81d2c0de4d94d3d 100644 (file)
--- a/readcpu.c
@@ -773,7 +773,7 @@ void read_table68k (void)
        int i;
 
        free (table68k);
-       table68k = (struct instr *)xmalloc (65536 * sizeof (struct instr));
+       table68k = xmalloc (struct instr, 65536);
        for (i = 0; i < 65536; i++) {
                table68k[i].mnemo = i_ILLG;
                table68k[i].handler = -1;
similarity index 100%
rename from readdisk.c
rename to readdisk.cpp
similarity index 98%
rename from rommgr.c
rename to rommgr.cpp
index e73f8eec5b2b8c7aef7631a0fe5d934a460e3e71..7c114ff0909f4323b0df9280626785854e6ad882 100644 (file)
--- a/rommgr.c
@@ -66,7 +66,7 @@ void romlist_add (TCHAR *path, struct romdata *rd)
                return;
        }
        romlist_cnt++;
-       rl = realloc (rl, sizeof (struct romlist) * romlist_cnt);
+       rl = xrealloc (struct romlist, rl, romlist_cnt);
        rl2 = rl + romlist_cnt - 1;
        rl2->path = my_strdup (path);
        rl2->rd = rd;
@@ -325,7 +325,7 @@ void romlist_clear (void)
                                TCHAR *newpn;
                                if (parent->partnumber == NULL)
                                        parent->partnumber = my_strdup (L"");
-                               newpn = xcalloc ((_tcslen (parent->partnumber) + 1 + _tcslen (rd->partnumber) + 1) * sizeof (TCHAR), 1);
+                               newpn = xcalloc (TCHAR, _tcslen (parent->partnumber) + 1 + _tcslen (rd->partnumber) + 1);
                                if (_tcslen (parent->partnumber) > 0) {
                                        _tcscpy (newpn, parent->partnumber);
                                        _tcscat (newpn, L"/");
@@ -390,7 +390,7 @@ struct romlist **getromlistbyident(int ver, int rev, int subver, int subrev, TCH
                max = i;
        else
                max = romlist_cnt;
-       buf = xmalloc ((sizeof (struct romlist*) + sizeof (struct romlist)) * (i + 1));
+       buf = xmalloc (uae_u8, (sizeof (struct romlist*) + sizeof (struct romlist)) * (i + 1));
        rdout = (struct romlist**)buf;
        rltmp = (struct romlist*)((uae_u8*)buf + (i + 1) * sizeof (struct romlist*));
        out = 0;
@@ -485,7 +485,7 @@ struct romlist **getarcadiaroms(void)
                if (roms[i].group == 0 && (roms[i].type == ROMTYPE_ARCADIABIOS || roms[i].type == ROMTYPE_ARCADIAGAME))
                        max++;
        }
-       buf = xmalloc ((sizeof (struct romlist*) + sizeof (struct romlist)) * (max + 1));
+       buf = xmalloc (uae_u8, (sizeof (struct romlist*) + sizeof (struct romlist)) * (max + 1));
        rdout = (struct romlist**)buf;
        rltmp = (struct romlist*)((uae_u8*)buf + (max + 1) * sizeof (struct romlist*));
        out = 0;
@@ -567,7 +567,7 @@ static void addkeyfile (const TCHAR *path)
        keysize = zfile_ftell (f);
        if (keysize > 0) {
                zfile_fseek (f, 0, SEEK_SET);
-               keybuf = xmalloc (keysize);
+               keybuf = xmalloc (uae_u8, keysize);
                zfile_fread (keybuf, 1, keysize, f);
                addkey (keybuf, keysize, path);
        }
@@ -856,7 +856,7 @@ struct romdata *getromdatabydata (uae_u8 *rom, int size)
        struct romdata *ret = NULL;
 
        if (size > 11 && !memcmp (rom, "AMIROMTYPE1", 11)) {
-               uae_u8 *tmpbuf = xmalloc (size);
+               uae_u8 *tmpbuf = xmalloc (uae_u8, size);
                int tmpsize = size - 11;
                memcpy (tmpbuf, rom + 11, tmpsize);
                decode_rom (tmpbuf, tmpsize, 1, tmpsize);
@@ -865,7 +865,7 @@ struct romdata *getromdatabydata (uae_u8 *rom, int size)
        }
 #if 0
        if (size > 0x6c + 524288 && !memcmp (rom, "AMIG", 4)) {
-               uae_u8 *tmpbuf = (uae_u8*)xmalloc (size);
+               uae_u8 *tmpbuf = (uae_u8*)xmalloc (uae_u8, size);
                int tmpsize = size - 0x6c;
                memcpy (tmpbuf, rom + 0x6c, tmpsize);
                decode_rom (tmpbuf, tmpsize, 2, tmpsize);
@@ -900,7 +900,7 @@ struct romdata *getromdatabyzfile (struct zfile *f)
        pos = zfile_ftell (f);
        zfile_fseek (f, 0, SEEK_END);
        size = zfile_ftell (f);
-       p = xmalloc (size);
+       p = xmalloc (uae_u8, size);
        if (!p)
                return 0;
        memset (p, 0, size);
@@ -1079,7 +1079,7 @@ struct zfile *read_rom (struct romdata **prd)
        size = rd2->size;
        crc32 = rd2->crc32;
        name = rd->name;
-       buf = xmalloc (size * 2);
+       buf = xmalloc (uae_u8, size * 2);
        memset (buf, 0xff, size * 2);
        if (!buf)
                return NULL;
@@ -1201,7 +1201,7 @@ struct zfile *read_rom_name (const TCHAR *filename)
                        zfile_fseek (f, 0, SEEK_END);
                        size = zfile_ftell (f) - sizeof tmp;
                        zfile_fseek (f, sizeof tmp, SEEK_SET);
-                       buf = xmalloc (size);
+                       buf = xmalloc (uae_u8, size);
                        zfile_fread (buf, size, 1, f);
                        df = zfile_fopen_empty (f, L"tmp.rom", size);
                        decode_cloanto_rom_do (buf, size, size);
diff --git a/rpc.c b/rpc.cpp
similarity index 100%
rename from rpc.c
rename to rpc.cpp
similarity index 98%
rename from sampler.c
rename to sampler.cpp
index c8c7a323c52aac68c688d90ea86f5c6194aa2d72..51ab261a4d9524d1e45afa08599e574f07232298 100644 (file)
--- a/sampler.c
@@ -59,7 +59,7 @@ static int capture_init (void)
                write_log (L"SAMPLER: DirectSoundCaptureBuffer_Start failed: %s\n", DXError (hr));
                return 0;
        }
-       samplebuffer = xcalloc (SAMPLEBUFFER, 1);
+       samplebuffer = xcalloc (uae_u8, SAMPLEBUFFER);
        write_log (L"SAMPLER: Parallel port sampler initialized\n");
        return 1;
 }
similarity index 99%
rename from sana2.c
rename to sana2.cpp
index c43e98cfe57cc68ae99abbee02640ca2ae838dfd..26f3e4f7f331f36bfce51a6a87cdfb8d761f5707 100644 (file)
--- a/sana2.c
+++ b/sana2.cpp
@@ -390,7 +390,7 @@ static uae_u32 REGPARAM2 dev_open_2 (TrapContext *context)
 
        if (dev->opencnt == 0) {
                dev->unit = unit;
-               dev->sysdata = xcalloc (uaenet_getdatalenght(), 1);
+               dev->sysdata = xcalloc (uae_u8, uaenet_getdatalenght ());
                if (!uaenet_open (dev->sysdata, pdev->td, dev, uaenet_gotdata, uaenet_getdata, pdev->promiscuous)) {
                        xfree (dev->sysdata);
                        dev->sysdata = NULL;
@@ -495,7 +495,7 @@ static void add_async_packet (struct devstruct *dev, struct s2packet *s2p, uaecp
 {
        struct asyncreq *ar, *ar2;
 
-       ar = (struct asyncreq*)xcalloc (sizeof (struct asyncreq), 1);
+       ar = xcalloc (struct asyncreq, 1);
        ar->s2p = s2p;
        if (!dev->s2p) {
                dev->s2p = ar;
@@ -559,7 +559,7 @@ static int add_async_request (struct devstruct *dev, uaecptr request)
                write_log (L"%s:%d async request %x added\n", getdevname(), dev->unit, request);
 
        uae_sem_wait (&async_sem);
-       ar = (struct asyncreq*)xcalloc (sizeof (struct asyncreq), 1);
+       ar = xcalloc (struct asyncreq, 1);
        ar->request = request;
        if (!dev->ar) {
                dev->ar = ar;
@@ -710,7 +710,7 @@ static void addmulticastaddresses (struct devstruct *dev, uae_u64 start, uae_u64
                }
                mc = mc->next;
        }
-       mc = xcalloc (sizeof (struct mcast), 1);
+       mc = xcalloc (struct mcast, 1);
        mc->start = start;
        mc->end = end;
        mc->cnt = 1;
@@ -751,8 +751,8 @@ static int delmulticastaddresses (struct devstruct *dev, uae_u64 start, uae_u64
 
 static struct s2packet *createreadpacket (struct devstruct *dev, const uae_u8 *d, int len)
 {
-       struct s2packet *s2p = xcalloc (sizeof (struct s2packet), 1);
-       s2p->data = xmalloc (dev->td->mtu + ETH_HEADER_SIZE + 2);
+       struct s2packet *s2p = xcalloc (struct s2packet, 1);
+       s2p->data = xmalloc (uae_u8, dev->td->mtu + ETH_HEADER_SIZE + 2);
        memcpy (s2p->data, d, len);
        s2p->len = len;
        return s2p;
@@ -865,8 +865,8 @@ static struct s2packet *createwritepacket (TrapContext *ctx, uaecptr request)
                return NULL;
        if (!copyfrombuff (ctx, data, pdev->tempbuf, datalength, pdev->copyfrombuff))
                return NULL;
-       s2p = xcalloc (sizeof (struct s2packet), 1);
-       s2p->data = xmalloc (pdev->td->mtu + ETH_HEADER_SIZE + 2);
+       s2p = xcalloc (struct s2packet, 1);
+       s2p->data = xmalloc (uae_u8, pdev->td->mtu + ETH_HEADER_SIZE + 2);
        if (flags & SANA2IOF_RAW) {
                memcpyah_safe (s2p->data, pdev->tempbuf, datalength);
                packettype = (s2p->data[2 * ADDR_SIZE + 0] << 8) | (s2p->data[2 * ADDR_SIZE + 1]);
similarity index 99%
rename from savestate.c
rename to savestate.cpp
index 05bea49cacb81d4678de34534d81012ad85b8608..f048330580e1ddb724bbe659db8c2809c681a63c 100644 (file)
@@ -202,12 +202,12 @@ TCHAR *restore_string_func (uae_u8 **dstp)
        char *top, *to;
        TCHAR *s;
 
-       len = strlen(dst) + 1;
-       top = to = (char*)malloc (len);
+       len = strlen ((char*)dst) + 1;
+       top = to = xmalloc (char, len);
        do {
                v = *dst++;
                *top++ = v;
-       } while(v);
+       } while (v);
        *dstp = dst;
        s = au (to);
        xfree (to);
@@ -292,7 +292,7 @@ static uae_u8 *restore_chunk (struct zfile *f, TCHAR *name, size_t *len, size_t
        /* chunk name */
        zfile_fread (tmp, 1, 4, f);
        tmp[4] = 0;
-       au_copy (name, 5, tmp);
+       au_copy (name, 5, (char*)tmp);
        /* chunk size */
        zfile_fread (tmp, 1, 4, f);
        src = tmp;
@@ -330,7 +330,7 @@ static uae_u8 *restore_chunk (struct zfile *f, TCHAR *name, size_t *len, size_t
                && _tcscmp (name, L"A3K2") != 0)
        {
                /* without zeros at the end old state files may not work */
-               mem = calloc (1, *totallen + 32);
+               mem = xcalloc (uae_u8, *totallen + 32);
                if (flags & 1) {
                        zfile_zuncompress (mem, *totallen, f, len2);
                } else {
@@ -380,7 +380,7 @@ static uae_u8 *restore_log (uae_u8 *src)
        write_log (L"%s\n", s);
        xfree (s);
 #endif
-       src += strlen (src) + 1;
+       src += strlen ((char*)src) + 1;
        return src;
 }
 
@@ -685,7 +685,7 @@ int save_state (const TCHAR *filename, const TCHAR *description)
                        int len, len2, i;
                        uae_u8 *tmp;
                        len = zfile_ftell (f) - pos;
-                       tmp = xmalloc (len);
+                       tmp = xmalloc (uae_u8, len);
                        zfile_fseek(f, pos, SEEK_SET);
                        len2 = zfile_fread (tmp, 1, len, f);
                        for (i = 0; i < len2; i++)
@@ -1208,7 +1208,7 @@ void savestate_init (void)
        frameextra = 0;
        if (currprefs.statecapture && currprefs.statecapturebuffersize && currprefs.statecapturerate) {
                replaybuffersize = currprefs.statecapturebuffersize;
-               replaybuffer = xmalloc (replaybuffersize);
+               replaybuffer = xmalloc (uae_u8, replaybuffersize);
        }
 }
 
diff --git a/scsi.c b/scsi.cpp
similarity index 95%
rename from scsi.c
rename to scsi.cpp
index 2518ca269a1689e63a5d0eb5f50f20cb7171292d..d0d6804e1e5c1da21445dfe759184c9843195cd2 100644 (file)
--- a/scsi.c
+++ b/scsi.cpp
@@ -88,7 +88,7 @@ void scsi_emulate_cmd(struct scsi_data *sd)
 
 struct scsi_data *scsi_alloc(int id, struct hd_hardfiledata *hfd)
 {
-       struct scsi_data *sd = (struct scsi_data*)xcalloc(sizeof (struct scsi_data), 1);
+       struct scsi_data *sd = xcalloc (struct scsi_data, 1);
        sd->hfd = hfd;
        sd->id = id;
        sd->nativescsiunit = -1;
@@ -102,7 +102,7 @@ struct scsi_data *scsi_alloc_native(int id, int nativeunit)
                write_log (L"SCSI: native scsi unit %d failed to open\n", nativeunit);
                return NULL;
        }
-       sd = (struct scsi_data*)xcalloc(sizeof (struct scsi_data), 1);
+       sd = xcalloc (struct scsi_data, 1);
        sd->id = id;
        sd->nativescsiunit = nativeunit;
        return sd;
similarity index 100%
rename from scsidev.c
rename to scsidev.cpp
similarity index 100%
rename from scsiemul.c
rename to scsiemul.cpp
similarity index 100%
rename from serial.c
rename to serial.cpp
similarity index 100%
rename from sinctable.c
rename to sinctable.cpp
similarity index 99%
rename from traps.c
rename to traps.cpp
index 4b71bce233186e051fe9180049f6879d6371133e..bdc4ec3ab7b0fc0b553046e390df1eae0050348c 100644 (file)
--- a/traps.c
+++ b/traps.cpp
@@ -269,7 +269,7 @@ static void *trap_thread (void *arg)
 */
 static void trap_HandleExtendedTrap (TrapHandler handler_func, int has_retval)
 {
-       struct TrapContext *context = calloc (1, sizeof (TrapContext));
+       struct TrapContext *context = xcalloc (TrapContext, 1);
 
        if (context) {
                uae_sem_init (&context->switch_to_trap_sem, 0, 0);
@@ -426,7 +426,7 @@ static uae_u32 REGPARAM3 exit_trap_handler (TrapContext *dummy_ctx)
        uae_sem_destroy (&context->switch_to_trap_sem);
        uae_sem_destroy (&context->switch_to_emu_sem);
 
-       free (context);
+       xfree (context);
 
        /* End critical section */
        uae_sem_post (&trap_mutex);
similarity index 95%
rename from uaeexe.c
rename to uaeexe.cpp
index d2102be0ce650170354e6b5ad31afc9544d0555c..c2b656bf57767080d486e7a0d38606d754a90455 100644 (file)
--- a/uaeexe.c
@@ -51,12 +51,12 @@ int uaeexe (const TCHAR *cmd)
        if (!running)
                goto NORUN;
 
-       nw = malloc (sizeof *nw);
+       nw = xmalloc (struct uae_xcmd, 1);
        if (!nw)
                goto NOMEM;
-       nw->cmd = malloc ((_tcslen (cmd) + 1) * sizeof (TCHAR));
+       nw->cmd = xmalloc (TCHAR, _tcslen (cmd) + 1);
        if (!nw->cmd) {
-               free (nw);
+               xfree (nw);
                goto NOMEM;
        }
 
similarity index 88%
rename from uaeipc.c
rename to uaeipc.cpp
index 9f6fee203faa63ebf0009766997a3e71a6f41833..329523dbdbe90534f4e8ec2690d99eb911c5590a 100644 (file)
--- a/uaeipc.c
@@ -59,8 +59,9 @@ static void parsemessage(TCHAR *in, struct uae_prefs *p, TCHAR *out, int outsize
        }
 }
 
-static int listenIPC(struct uaeipc *ipc)
+static int listenIPC (void *vipc)
 {
+       struct uaeipc *ipc = (struct uaeipc*)vipc;
        DWORD err;
 
        memset(&ipc->ol, 0, sizeof (OVERLAPPED));
@@ -85,8 +86,9 @@ static int listenIPC(struct uaeipc *ipc)
        return 1;
 }
 
-static void disconnectIPC(struct uaeipc *ipc)
+static void disconnectIPC (void *vipc)
 {
+       struct uaeipc *ipc = (struct uaeipc*)vipc;
        ipc->readpending = ipc->writepending = FALSE;
        if (ipc->connected) {
                if (!DisconnectNamedPipe(ipc->hipc))
@@ -95,20 +97,22 @@ static void disconnectIPC(struct uaeipc *ipc)
        }
 }
 
-static void resetIPC(struct uaeipc *ipc)
+static void resetIPC (void *vipc)
 {
-       disconnectIPC(ipc);
-       listenIPC(ipc);
+       struct uaeipc *ipc = (struct uaeipc*)vipc;
+       disconnectIPC (ipc);
+       listenIPC (ipc);
 }
 
-void closeIPC(struct uaeipc *ipc)
+void closeIPC (void *vipc)
 {
+       struct uaeipc *ipc = (struct uaeipc*)vipc;
        if (!ipc)
                return;
-       disconnectIPC(ipc);
+       disconnectIPC (ipc);
        if (ipc->hipc == INVALID_HANDLE_VALUE)
                return;
-       CloseHandle(ipc->hipc);
+       CloseHandle (ipc->hipc);
        ipc->hipc = INVALID_HANDLE_VALUE;
        if (ipc->olevent != INVALID_HANDLE_VALUE)
                CloseHandle (ipc->olevent);
@@ -116,13 +120,13 @@ void closeIPC(struct uaeipc *ipc)
        xfree (ipc);
 }
 
-void *createIPC(const TCHAR *name, int binary)
+void *createIPC (const TCHAR *name, int binary)
 {
        TCHAR tmpname[100];
        int cnt = 0;
        struct uaeipc *ipc;
 
-       ipc = xcalloc (sizeof (struct uaeipc), 1);
+       ipc = xcalloc (struct uaeipc, 1);
        ipc->connected = FALSE;
        ipc->readpending = FALSE;
        ipc->writepending = FALSE;
@@ -157,13 +161,15 @@ void *createIPC(const TCHAR *name, int binary)
        return NULL;
 }
 
-void *geteventhandleIPC(struct uaeipc *ipc)
+void *geteventhandleIPC (void *vipc)
 {
+       struct uaeipc *ipc = (struct uaeipc*)vipc;
        return ipc->olevent;
 }
 
-int sendIPC(struct uaeipc *ipc, TCHAR *msg)
+int sendIPC (void *vipc, TCHAR *msg)
 {
+       struct uaeipc *ipc = (struct uaeipc*)vipc;
        if (ipc->hipc == INVALID_HANDLE_VALUE)
                return 0;
        if (ipc->outmessages >= MAX_OUTMESSAGES)
@@ -173,8 +179,9 @@ int sendIPC(struct uaeipc *ipc, TCHAR *msg)
                SetEvent (ipc->olevent);
        return 1;
 }
-int sendBinIPC(struct uaeipc *ipc, uae_u8 *msg, int len)
+int sendBinIPC (void *vipc, uae_u8 *msg, int len)
 {
+       struct uaeipc *ipc = (struct uaeipc*)vipc;
        if (ipc->hipc == INVALID_HANDLE_VALUE)
                return 0;
        if (ipc->outmessages >= MAX_OUTMESSAGES)
@@ -186,8 +193,9 @@ int sendBinIPC(struct uaeipc *ipc, uae_u8 *msg, int len)
        return 1;
 }
 
-int checkIPC(struct uaeipc *ipc, struct uae_prefs *p)
+int checkIPC (void *vipc, struct uae_prefs *p)
 {
+       struct uaeipc *ipc = (struct uaeipc*)vipc;
        BOOL ok;
        DWORD ret, err;
 
@@ -274,7 +282,7 @@ int checkIPC(struct uaeipc *ipc, struct uae_prefs *p)
 
 int isIPC (const TCHAR *pipename)
 {
-       HANDLE *p;
+       HANDLE p;
 
        p = CreateFile(
                pipename,
similarity index 100%
rename from uaelib.c
rename to uaelib.cpp
similarity index 100%
rename from uaeresource.c
rename to uaeresource.cpp
similarity index 99%
rename from uaeserial.c
rename to uaeserial.cpp
index 743ce7f16c8446a64c11eb409a1f230f569d33d4..441bcc78aad426310abc82fb907ee1d3680b2023 100644 (file)
@@ -277,7 +277,7 @@ static uae_u32 REGPARAM2 dev_open (TrapContext *context)
        if (i == MAX_TOTAL_DEVICES)
                return openfail (ioreq, IOERR_OPENFAIL);
        dev = &devst[i];
-       dev->sysdata = xcalloc (uaeser_getdatalenght(), 1);
+       dev->sysdata = xcalloc (uae_u8, uaeser_getdatalenght ());
        if (!uaeser_open (dev->sysdata, dev, unit)) {
                xfree (dev->sysdata);
                return openfail (ioreq, IOERR_OPENFAIL);
@@ -337,7 +337,7 @@ static int add_async_request (struct devstruct *dev, uaecptr request)
                write_log (L"%s:%d async request %x added\n", getdevname(), dev->unit, request);
 
        uae_sem_wait (&async_sem);
-       ar = (struct asyncreq*)xcalloc (sizeof (struct asyncreq), 1);
+       ar = xcalloc (struct asyncreq, 1);
        ar->request = request;
        if (!dev->ar) {
                dev->ar = ar;
@@ -400,8 +400,9 @@ static uae_u8 *memmap(uae_u32 addr, uae_u32 len)
        return bank_data->xlateaddr (addr);
 }
 
-void uaeser_signal (struct devstruct *dev, int sigmask)
+void uaeser_signal (void *vdev, int sigmask)
 {
+       struct devstruct *dev = (struct devstruct*)vdev;
        struct asyncreq *ar;
        int i = 0;
 
similarity index 98%
rename from uaeunp.c
rename to uaeunp.cpp
index 4029c6569dfffab033cb270e55af20d7f0fb256b..7ec5a98a1af5c4e4a3d48b613dc63870701bfc1f 100644 (file)
--- a/uaeunp.c
@@ -203,7 +203,7 @@ static void resetlist (void)
 static int unlist2 (struct arcdir *adp, const TCHAR *src, int all)
 {
        struct zvolume *zv;
-       void *h;
+       struct zdirectory *h;
        int i;
        TCHAR p[MAX_DPATH];
        TCHAR fn[MAX_DPATH];
@@ -230,7 +230,7 @@ static int unlist2 (struct arcdir *adp, const TCHAR *src, int all)
        while (zfile_readdir_archive (h, fn)) {
                struct _stat64 st; 
                int isdir;
-               uae_u32 flags;
+               int flags;
                TCHAR *comment;
                struct zfile *zf;
                uae_u32 crc32 = 0;
@@ -288,7 +288,7 @@ static int unlist2 (struct arcdir *adp, const TCHAR *src, int all)
        if (parentid >= 0)
                return 1;
 
-       filelist = xmalloc (entries * sizeof (struct arcdir*));
+       filelist = xmalloc (struct arcdir*, entries);
        for (i = 0; i < entries; i++) {
                filelist[i] = &adp[i];
        }
@@ -316,7 +316,7 @@ static int unlist2 (struct arcdir *adp, const TCHAR *src, int all)
 static int unlist (const TCHAR *src, int all)
 {
        struct arcdir *adp;
-       adp = xcalloc (sizeof (struct arcdir), maxentries);
+       adp = xcalloc (struct arcdir, maxentries);
        unlist2 (adp, src, all);
        return 1;
 }
@@ -369,7 +369,7 @@ static int found;
 
 static int unpack (const TCHAR *src, const TCHAR *filename, const TCHAR *dst, int out, int all, int level)
 {
-       void *h;
+       struct zdirectory *h;
        struct zvolume *zv;
        int ret;
        uae_u8 *b;
@@ -430,7 +430,7 @@ static int unpack (const TCHAR *src, const TCHAR *filename, const TCHAR *dst, in
                        zfile_fseek (s, 0, SEEK_END);
                        size = zfile_ftell (s);
                        zfile_fseek (s, 0, SEEK_SET);
-                       b = xcalloc (size, 1);
+                       b = xcalloc (uae_u8, size);
                        if (b) {
                                if (zfile_fread (b, size, 1, s) == 1) {
                                        if (out) {
@@ -464,7 +464,7 @@ static int unpack (const TCHAR *src, const TCHAR *filename, const TCHAR *dst, in
 
 static int unpack2 (const TCHAR *src, const TCHAR *match, int level)
 {
-       void *h;
+       struct zdirectory *h;
        struct zvolume *zv;
        int ret;
        uae_u8 *b;
@@ -523,7 +523,7 @@ static int unpack2 (const TCHAR *src, const TCHAR *match, int level)
                        zfile_fseek (s, 0, SEEK_END); 
                        size = zfile_ftell (s);
                        zfile_fseek (s, 0, SEEK_SET);
-                       b = xcalloc (size, 1);
+                       b = xcalloc (uae_u8, size);
                        if (b) {
                                if (zfile_fread (b, size, 1, s) == 1) {
                                        d = zfile_fopen (dst, L"wb", 0);
@@ -551,7 +551,7 @@ static int unpack2 (const TCHAR *src, const TCHAR *match, int level)
 static int scanpath (TCHAR *src, TCHAR *outpath)
 {
        struct zvolume *zv;
-       void *h;
+       struct zdirectory *h;
        TCHAR fn[MAX_DPATH];
 
        zv = zfile_fopen_archive_root (src);
similarity index 100%
rename from writelog.c
rename to writelog.cpp
similarity index 96%
rename from zfile.c
rename to zfile.cpp
index af9c8cc2a051ed5d356179bcc333f2dd1cbf8892..419f50d972ade90c91c53cffffd9ce6d6207ac35 100644 (file)
--- a/zfile.c
+++ b/zfile.cpp
@@ -139,7 +139,7 @@ static struct zcache *zcache_put (const TCHAR *name, struct zdiskimage *data)
        struct zcache *zc;
        
        zcache_check ();
-       zc = xcalloc (sizeof (struct zcache), 1);
+       zc = xcalloc (struct zcache, 1);
        zc->next = zcachedata;
        zcachedata = zc;
        zc->zd = data;
@@ -152,7 +152,7 @@ static struct zfile *zfile_create (struct zfile *prev)
 {
        struct zfile *z;
 
-       z = xmalloc (sizeof *z);
+       z = xmalloc (struct zfile, 1);
        if (!z)
                return 0;
        memset (z, 0, sizeof *z);
@@ -329,13 +329,14 @@ struct zfile_vhd
 };
 
 
-static uae_u64 vhd_fread2 (struct zfile *zf, uae_u8 *dataptr, uae_u64 offset, uae_u64 len)
+static uae_u64 vhd_fread2 (struct zfile *zf, void *dataptrv, uae_u64 offset, uae_u64 len)
 {
        uae_u32 bamoffset;
        uae_u32 sectoroffset;
        uae_u64 read;
        struct zfile *zp = zf->parent;
-       struct zfile_vhd *zvhd = zf->userdata;
+       struct zfile_vhd *zvhd = (struct zfile_vhd*)zf->userdata;
+       uae_u8 *dataptr = (uae_u8*)dataptrv;
 
        //write_log (L"%08x %08x\n", (uae_u32)offset, (uae_u32)len);
        read = 0;
@@ -384,21 +385,20 @@ static uae_u64 vhd_fread2 (struct zfile *zf, uae_u8 *dataptr, uae_u64 offset, ua
        }
        return read;
 }
-static uae_u64 vhd_fread (uae_u8 *data, uae_u64 l1, uae_u64 l2, struct zfile *zf)
+static uae_s64 vhd_fread (void *data, uae_u64 l1, uae_u64 l2, struct zfile *zf)
 {
        uae_u64 size = l1 * l2;
        uae_u64 out = 0;
        int len = 0;
 
        if ((zf->seek & 511) || (size & 511)) {
-               int seek;
                uae_u8 tmp[512];
 
                if (zf->seek & 511) {
                        int s;
                        s = 512 - (zf->seek & 511);
                        vhd_fread2 (zf, tmp, zf->seek & ~511, 512);
-                       memcpy (data + len, tmp + 512 - s, s);
+                       memcpy ((uae_u8*)data + len, tmp + 512 - s, s);
                        len += s;
                        out += s;
                        zf->seek += s;
@@ -406,7 +406,7 @@ static uae_u64 vhd_fread (uae_u8 *data, uae_u64 l1, uae_u64 l2, struct zfile *zf
                while (size > 0) {
                        int s = size > 512 ? 512 : size;
                        vhd_fread2 (zf, tmp, zf->seek, 512);
-                       memcpy (data + len, tmp, s);
+                       memcpy ((uae_u8*)data + len, tmp, s);
                        zf->seek += s;
                        size -= s;
                        out += s;
@@ -426,7 +426,7 @@ static struct zfile *vhd (struct zfile *z)
        struct zfile_vhd *zvhd;
        uae_u64 fsize;
 
-       zvhd = xcalloc (sizeof (struct zfile_vhd), 1);
+       zvhd = xcalloc (struct zfile_vhd, 1);
        zfile_fseek (z, 0, SEEK_END);
        fsize = zfile_ftell (z);
        zfile_fseek (z, 0, SEEK_SET);
@@ -472,11 +472,11 @@ static struct zfile *vhd (struct zfile *z)
                zvhd->vhd_bamoffset = gl (tmp + 8 + 8 + 4);
                zvhd->vhd_bamsize = (((zvhd->virtsize + zvhd->vhd_blocksize - 1) / zvhd->vhd_blocksize) * 4 + 511) & ~511;
                size = zvhd->vhd_bamoffset + zvhd->vhd_bamsize;
-               zvhd->vhd_header = xmalloc (size);
+               zvhd->vhd_header = xmalloc (uae_u8, size);
                zfile_fseek (z, 0, SEEK_SET);
                if (zfile_fread (zvhd->vhd_header, 1, size, z) != size)
                        goto end;
-               zvhd->vhd_sectormap = xmalloc (512);
+               zvhd->vhd_sectormap = xmalloc (uae_u8, 512);
                zvhd->vhd_sectormapblock = -1;
                zvhd->vhd_bitmapsize = ((zvhd->vhd_blocksize / (8 * 512)) + 511) & ~511;
        }
@@ -589,7 +589,7 @@ static void truncate880k (struct zfile *z)
                return;
        if (z->size < 880 * 512 * 2) {
                int size = 880 * 512 * 2 - z->size;
-               b = xcalloc (size, 1);
+               b = xcalloc (uae_u8, size);
                zfile_fwrite (b, size, 1, z);
                xfree (b);
                return;
@@ -619,9 +619,9 @@ static struct zfile *extadf (struct zfile *z, int index, int *retcode)
        if (index > 1)
                return NULL;
 
-       mfm = xcalloc (32000, 1);
-       amigamfmbuffer = xcalloc (32000, 1);
-       outbuf = xcalloc (16384, 1);
+       mfm = xcalloc (uae_u16, 32000 / 2);
+       amigamfmbuffer = xcalloc (uae_u16, 32000 / 2);
+       outbuf = xcalloc (uae_u8, 16384);
 
        zfile_fread (buffer, 1, 8, z);
        zfile_fread (buffer, 1, 4, z);
@@ -734,15 +734,15 @@ static struct zfile *fdi (struct zfile *z, int index, int *retcode)
                fdi = fdi2raw_header (z);
                if (!fdi)
                        return NULL;
-               mfm = xcalloc (32000, 1);
-               zd = xcalloc (sizeof (struct zdiskimage), 1);
+               mfm = xcalloc (uae_u16, 32000 / 2);
+               zd = xcalloc (struct zdiskimage, 1);
                tracks = fdi2raw_get_last_track (fdi);
                zd->tracks = tracks;
                for (i = 0; i < tracks; i++) {
                        uae_u8 *buf, *p;
                        fdi2raw_loadtrack (fdi, mfm, NULL, i, &len, NULL, NULL, 1);
                        len /= 8;
-                       buf = p = xmalloc (len);
+                       buf = p = xmalloc (uae_u8, len);
                        for (j = 0; j < len / 2; j++) {
                                uae_u16 v = mfm[j];
                                *p++ = v >> 8;
@@ -755,8 +755,8 @@ static struct zfile *fdi (struct zfile *z, int index, int *retcode)
                zc = zcache_put (z->name, zd);
        }
 
-       amigamfmbuffer = xcalloc (32000, 1);
-       outbuf = xcalloc (16384, 1);
+       amigamfmbuffer = xcalloc (uae_u16, 32000 / 2);
+       outbuf = xcalloc (uae_u8, 16384);
        tracks = zc->zd->tracks;
        if (ext) {
                _tcscpy (newname, orgname);
@@ -786,7 +786,7 @@ static struct zfile *fdi (struct zfile *z, int index, int *retcode)
        }
        outsize = 0;
        for (i = 0; i < tracks; i++) {
-               uae_u8 *p = zc->zd->zdisktracks[i].data;
+               uae_u8 *p = (uae_u8*)zc->zd->zdisktracks[i].data;
                len = zc->zd->zdisktracks[i].len;
                memset (writebuffer_ok, 0, sizeof writebuffer_ok);
                memset (outbuf, 0, 16384);
@@ -861,8 +861,8 @@ static struct zfile *ipf (struct zfile *z, int index, int *retcode)
                struct zdiskimage *zd;
                if (!caps_loadimage (z, 0, &tracks))
                        return NULL;
-               mfm = xcalloc (32000, 1);
-               zd = xcalloc (sizeof (struct zdiskimage), 1);
+               mfm = xcalloc (uae_u16, 32000 / 2);
+               zd = xcalloc (struct zdiskimage, 1);
                zd->tracks = tracks;
                for (i = 0; i < tracks; i++) {
                        uae_u8 *buf, *p;
@@ -870,7 +870,7 @@ static struct zfile *ipf (struct zfile *z, int index, int *retcode)
                        caps_loadtrack (mfm, NULL, 0, i, &len, &mrev, &gapo);
                        //write_log (L"%d: %d %d %d\n", i, mrev, gapo, len);
                        len /= 8;
-                       buf = p = xmalloc (len);
+                       buf = p = xmalloc (uae_u8, len);
                        for (j = 0; j < len / 2; j++) {
                                uae_u16 v = mfm[j];
                                *p++ = v >> 8;
@@ -883,8 +883,8 @@ static struct zfile *ipf (struct zfile *z, int index, int *retcode)
                zc = zcache_put (z->name, zd);
        }
 
-       outbuf = xcalloc (16384, 1);
-       amigamfmbuffer = xcalloc (32000, 1);
+       outbuf = xcalloc (uae_u8, 16384);
+       amigamfmbuffer = xcalloc (uae_u16, 32000 / 2);
        if (ext) {
                _tcscpy (newname, orgname);
                _tcscpy (newname + _tcslen (newname) - _tcslen (ext), L".adf");
@@ -919,7 +919,7 @@ static struct zfile *ipf (struct zfile *z, int index, int *retcode)
 
        outsize = 0;
        for (i = 0; i < tracks; i++) {
-               uae_u8 *p = zc->zd->zdisktracks[i].data;
+               uae_u8 *p = (uae_u8*)zc->zd->zdisktracks[i].data;
                len = zc->zd->zdisktracks[i].len;
                memset (writebuffer_ok, 0, sizeof writebuffer_ok);
                memset (outbuf, 0, 16384);
@@ -999,7 +999,7 @@ static struct zfile *dsq (struct zfile *z, int lzx)
                                size = 1760 * 512;
 
                        if (zfile_getfilename (zi) && _tcslen (zfile_getfilename (zi))) {
-                               fn = xmalloc ((_tcslen (zfile_getfilename (zi)) + 5) * sizeof (TCHAR));
+                               fn = xmalloc (TCHAR, (_tcslen (zfile_getfilename (zi)) + 5));
                                _tcscpy (fn, zfile_getfilename (zi));
                                _tcscat (fn, L".adf");
                        } else {
@@ -1076,7 +1076,7 @@ static struct zfile *dms (struct zfile *z, int index, int *retcode)
                if (index > 0) {
                        zfile_fclose (zo);
                        zo = NULL;
-                       for (i = 0; i < zextra[i]; i++);
+                       for (i = 0; i < DMS_EXTRA_SIZE && zextra[i]; i++);
                        if (index > i)
                                goto end;
                        zo = zextra[index - 1];
@@ -1105,7 +1105,7 @@ const TCHAR *uae_diskimageextensions[] =
 int zfile_is_ignore_ext (const TCHAR *name)
 {
        int i;
-       TCHAR *ext;
+       const TCHAR *ext;
 
        ext = _tcsrchr (name, '.');
        if (!ext)
@@ -1121,7 +1121,7 @@ int zfile_is_diskimage (const TCHAR *name)
 {
        int i;
 
-       TCHAR *ext = _tcsrchr (name, '.');
+       const TCHAR *ext = _tcsrchr (name, '.');
        if (!ext)
                return 0;
        i = 0;
@@ -1647,7 +1647,7 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode,
        }
 
        datalen = 0;
-       data = malloc (bufferlen);
+       data = xmalloc (uae_u8, bufferlen);
        for (;;) {
                if (!InternetReadFile (i, data + datalen, INETBUFFERLEN, &didread)) {
                        DWORD err = GetLastError ();
@@ -1661,7 +1661,7 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode,
                datalen += didread;
                if (datalen > bufferlen - INETBUFFERLEN) {
                        bufferlen += INETBUFFERLEN;
-                       data = realloc (data, bufferlen);
+                       data = xrealloc (uae_u8, data, bufferlen);
                        if (!data) {
                                datalen = 0;
                                break;
@@ -1757,7 +1757,7 @@ struct zfile *zfile_dup (struct zfile *zf)
                nzf = zfile_create (zf);
        } else if (zf->data) {
                nzf = zfile_create (zf);
-               nzf->data = xmalloc (zf->size);
+               nzf->data = xmalloc (uae_u8, zf->size);
                memcpy (nzf->data, zf->data, zf->size);
                nzf->size = zf->size;
        } else if (zf->zipname) {
@@ -1801,14 +1801,14 @@ struct zfile *zfile_fopen_empty (struct zfile *prev, const TCHAR *name, uae_u64
        l = zfile_create (prev);
        l->name = name ? my_strdup (name) : L"";
        if (size) {
-               l->data = xcalloc (size, 1);
+               l->data = xcalloc (uae_u8, size);
                if (!l->data)  {
                        xfree (l);
                        return NULL;
                }
                l->size = size;
        } else {
-               l->data = xcalloc (1, 1);
+               l->data = xcalloc (uae_u8, 1);
                l->size = 0;
        }
        return l;
@@ -1845,7 +1845,7 @@ struct zfile *zfile_fopen_data (const TCHAR *name, uae_u64 size, uae_u8 *data)
 
        l = zfile_create (NULL);
        l->name = name ? my_strdup (name) : L"";
-       l->data = xmalloc (size);
+       l->data = xmalloc (uae_u8, size);
        l->size = size;
        memcpy (l->data, data, size);
        return l;
@@ -1858,7 +1858,6 @@ uae_s64 zfile_size (struct zfile *z)
 
 uae_s64 zfile_ftell (struct zfile *z)
 {
-       uae_s64 v;
        if (z->data || z->dataseek || z->parent)
                return z->seek;
        return _ftelli64 (z->f);
@@ -1898,7 +1897,7 @@ uae_s64 zfile_fseek (struct zfile *z, uae_s64 offset, int mode)
        return 1;
 }
 
-size_t zfile_fread  (void *b, size_t l1, size_t l2,struct zfile *z)
+size_t zfile_fread  (void *b, size_t l1, size_t l2, struct zfile *z)
 {
        if (z->zfileread)
                return z->zfileread (b, l1, l2, z);
@@ -1946,7 +1945,7 @@ size_t zfile_fwrite (void *b, size_t l1, size_t l2, struct zfile *z)
        if (z->data) {
                int off = z->seek + l1 * l2;
                if (off > z->size) {
-                       z->data = realloc (z->data, off);
+                       z->data = xrealloc (uae_u8, z->data, off);
                        z->size = off;
                }
                memcpy (z->data + z->seek, b, l1 * l2);
@@ -2060,7 +2059,7 @@ uae_u8 *zfile_getdata (struct zfile *z, uae_s64 offset, int len)
                len = zfile_ftell (z);
                zfile_fseek (z, 0, SEEK_SET);
        }
-       b = xmalloc (len);
+       b = xmalloc (uae_u8, len);
        if (z->data) {
                memcpy (b, z->data + offset, len);
        } else {
@@ -2158,7 +2157,7 @@ uae_u32 zfile_crc32 (struct zfile *f)
        pos = zfile_ftell (f);
        zfile_fseek (f, 0, SEEK_END);
        size = zfile_ftell (f);
-       p = xmalloc (size);
+       p = xmalloc (uae_u8, size);
        if (!p)
                return 0;
        memset (p, 0, size);
@@ -2194,7 +2193,7 @@ static struct znode *znode_alloc (struct znode *parent, const TCHAR *name)
 {
        TCHAR fullpath[MAX_DPATH];
        TCHAR tmpname[MAX_DPATH];
-       struct znode *zn = xcalloc (sizeof (struct znode), 1);
+       struct znode *zn = xcalloc (struct znode, 1);
        struct znode *zn2;
        TCHAR sep[] = { FSDB_DIR_SEPARATOR, 0 };
 
@@ -2284,7 +2283,7 @@ static void zvolume_addtolist (struct zvolume *zv)
 
 static struct zvolume *zvolume_alloc_2 (const TCHAR *name, struct zfile *z, unsigned int id, void *handle, const TCHAR *volname)
 {
-       struct zvolume *zv = xcalloc (sizeof (struct zvolume), 1);
+       struct zvolume *zv = xcalloc (struct zvolume, 1);
        struct znode *root;
        uae_s64 pos;
        int i;
@@ -2689,7 +2688,7 @@ struct znode *zvolume_addfile_abs (struct zvolume *zv, struct zarchive_info *zai
 struct zvolume *zfile_fopen_directory (const TCHAR *dirname)
 {
        struct zvolume *zv = NULL;
-       void *dir;
+       struct my_opendir_s *dir;
        TCHAR fname[MAX_DPATH];
 
        dir = my_opendir (dirname);
@@ -2858,7 +2857,7 @@ struct zdirectory {
        struct znode *n;
 };
 
-void *zfile_opendir_archive (const TCHAR *path)
+struct zdirectory *zfile_opendir_archive (const TCHAR *path)
 {
        struct zvolume *zv = get_zvolume (path);
        struct znode *zn = get_znode (zv, path, TRUE);
@@ -2866,7 +2865,7 @@ void *zfile_opendir_archive (const TCHAR *path)
 
        if (!zn || (!zn->child && !zn->vchild))
                return NULL;
-       zd = xmalloc (sizeof (struct zdirectory));
+       zd = xmalloc (struct zdirectory, 1);
        if (zn->child) {
                zd->n = zn->child;
        } else {
@@ -2945,24 +2944,24 @@ int zfile_stat_archive (const TCHAR *path, struct _stat64 *s)
        return 1;
 }
 
-uae_s64 zfile_lseek_archive (void *d, uae_s64 offset, int whence)
+uae_s64 zfile_lseek_archive (struct zfile *d, uae_s64 offset, int whence)
 {
        if (zfile_fseek (d, offset, whence))
                return -1;
        return zfile_ftell (d);
 }
 
-unsigned int zfile_read_archive (void *d, void *b, unsigned int size)
+unsigned int zfile_read_archive (struct zfile *d, void *b, unsigned int size)
 {
        return zfile_fread (b, 1, size, d);
 }
 
-void zfile_close_archive (void *d)
+void zfile_close_archive (struct zfile *d)
 {
        /* do nothing, keep file cached */
 }
 
-void *zfile_open_archive (const TCHAR *path, int flags)
+struct zfile *zfile_open_archive (const TCHAR *path, int flags)
 {
        struct zvolume *zv = get_zvolume (path);
        struct znode *zn = get_znode (zv, path, TRUE);
@@ -2998,10 +2997,8 @@ int zfile_exists_archive (const TCHAR *path, const TCHAR *rel)
 int zfile_convertimage (const TCHAR *src, const TCHAR *dst)
 {
        struct zfile *s, *d;
-       struct zvolume *zv;
        int ret = 0;
 
-       zv = zfile_open_archive (src, 0);
        s = zfile_fopen (src, L"rb", ZFD_NORMAL);
        if (s) {
                uae_u8 *b;
@@ -3009,7 +3006,7 @@ int zfile_convertimage (const TCHAR *src, const TCHAR *dst)
                zfile_fseek (s, 0, SEEK_END);
                size = zfile_ftell (s);
                zfile_fseek (s, 0, SEEK_SET);
-               b = xcalloc (size, 1);
+               b = xcalloc (uae_u8, size);
                if (b) {
                        if (zfile_fread (b, size, 1, s) == 1) {
                                d = zfile_fopen (dst, L"wb", 0);
similarity index 97%
rename from zfile_archive.c
rename to zfile_archive.cpp
index 2b7cd94d3a6ba82a195cbbfaa8ccb496cde3044f..1fa0df5379537b4c82e64fc7f7489bac5ba4c6f8 100644 (file)
@@ -286,8 +286,8 @@ struct zvolume *archive_directory_tar (struct zfile *z)
                        ustar = 1;
                name[0] = 0;
                if (ustar)
-                       strcpy (name, block + 345);
-               strcat (name, block);
+                       strcpy (name, (char*)block + 345);
+               strcat (name, (char*)block);
 
                if (name[0] == 0)
                        valid = 0;
@@ -296,13 +296,13 @@ struct zvolume *archive_directory_tar (struct zfile *z)
                if (ustar && (block[256] != 0 && block[256] != '0'))
                        valid = 0;
 
-               size = _strtoui64 (block + 124, NULL, 8);
+               size = _strtoui64 ((char*)block + 124, NULL, 8);
 
                if (valid) {
                        memset (&zai, 0, sizeof zai);
                        zai.name = au (name);
                        zai.size = size;
-                       zai.t = _strtoui64 (block + 136, NULL, 8);
+                       zai.t = _strtoui64 ((char*)block + 136, NULL, 8);
                        zai.t += _timezone;
                        if (_daylight)
                                zai.t -= 1 * 60 * 60;
@@ -425,7 +425,7 @@ struct zfile *archive_access_zip (struct znode *zn)
        s = NULL;
        if (unzOpenCurrentFile (uz) != UNZ_OK)
                return 0;
-       z = zfile_fopen_empty (uz, zn->fullname, zn->size);
+       z = zfile_fopen_empty (NULL, zn->fullname, zn->size);
        if (z) {
                err = unzReadCurrentFile (uz, z->data, zn->size);
        }
@@ -499,10 +499,11 @@ struct SevenZContext
        UInt32 blockIndex;
 };
 
-static void archive_close_7z (struct SevenZContext *ctx)
+static void archive_close_7z (void *ctx)
 {
-       SzArEx_Free (&ctx->db, &allocImp);
-       allocImp.Free (&allocImp, ctx->outBuffer);
+       struct SevenZContext *ctx7 = (struct SevenZContext*)ctx;
+       SzArEx_Free (&ctx7->db, &allocImp);
+       allocImp.Free (&allocImp, ctx7->outBuffer);
        xfree (ctx);
 }
 
@@ -517,7 +518,7 @@ struct zvolume *archive_directory_7z (struct zfile *z)
        struct SevenZContext *ctx;
 
        init_7z ();
-       ctx = xcalloc (sizeof (struct SevenZContext), 1);
+       ctx = xcalloc (struct SevenZContext, 1);
        ctx->blockIndex = 0xffffffff;
        ctx->archiveStream.s.Read = SzFileReadImp;
        ctx->archiveStream.s.Seek = SzFileSeekImp;
@@ -572,7 +573,7 @@ struct zfile *archive_access_7z (struct znode *zn)
        size_t outSizeProcessed;
        struct SevenZContext *ctx;
 
-       ctx = zv->handle;
+       ctx = (struct SevenZContext*)zv->handle;
        res = SzAr_Extract (&ctx->db, &ctx->lookStream.s, zn->offset,
                &ctx->blockIndex, &ctx->outBuffer, &ctx->outBufferSize,
                &offset, &outSizeProcessed,
@@ -672,9 +673,9 @@ static int rar_resetf (struct zfile *z)
        return 1;
 }
 
-static void archive_close_rar (struct RARContext *rc)
+static void archive_close_rar (void *ctx)
 {
-       xfree (rc);
+       xfree ((struct RARContext*)ctx);
 }
 
 struct zvolume *archive_directory_rar (struct zfile *z)
@@ -689,7 +690,7 @@ struct zvolume *archive_directory_rar (struct zfile *z)
        if (z->data)
                /* wtf? stupid unrar.dll only accept filename as an input.. */
                return archive_directory_arcacc (z, ArchiveFormatRAR);
-       rc = xcalloc (sizeof (struct RARContext), 1);
+       rc = xcalloc (struct RARContext, 1);
        zv = zvolume_alloc (z, ArchiveFormatRAR, rc, NULL);
        //fclose (z->f); /* bleh, unrar.dll fails to open the archive if it is already open.. */
        //z->f = NULL;
@@ -728,7 +729,7 @@ struct zvolume *archive_directory_rar (struct zfile *z)
 
 struct zfile *archive_access_rar (struct znode *zn)
 {
-       struct RARContext *rc = zn->volume->handle;
+       struct RARContext *rc = (struct RARContext*)zn->volume->handle;
        int i;
        struct zfile *zf = NULL;
 
@@ -965,8 +966,8 @@ static struct znode *addfile (struct zvolume *zv, struct zfile *zf, const TCHAR
 
        z = zfile_fopen_empty (zf, path, size);
        zfile_fwrite (data, size, 1, z);
-       memset(&zai, 0, sizeof zai);
-       zai.name = path;
+       memset (&zai, 0, sizeof zai);
+       zai.name = my_strdup (path);
        zai.flags = -1;
        zai.size = size;
        zn = zvolume_addfile_abs (zv, &zai);
@@ -974,6 +975,7 @@ static struct znode *addfile (struct zvolume *zv, struct zfile *zf, const TCHAR
                zn->f = z;
        else
                zfile_fclose (z);
+       xfree (zai.name);
        return zn;
 }
 
@@ -1000,10 +1002,10 @@ struct zvolume *archive_directory_plain (struct zfile *z)
        zfile_fseek(z, 0, SEEK_SET);
        zn = zvolume_addfile_abs (zv, &zai);
        if (!memcmp (id, exeheader, sizeof id)) {
-               uae_u8 *an = ua (zai.name);
-               uae_u8 *data = xmalloc (1 + strlen (an) + 1 + 1 + 1);
+               char *an = ua (zai.name);
+               char *data = xmalloc (char, 1 + strlen (an) + 1 + 1 + 1);
                sprintf (data, "\"%s\"\n", an);
-               zn = addfile (zv, z, L"s/startup-sequence", data, strlen (data));
+               zn = addfile (zv, z, L"s/startup-sequence", (uae_u8*)data, strlen (data));
                xfree (data);
                xfree (an);
        }
@@ -1149,7 +1151,7 @@ static void recurseadf (struct znode *zn, int root, TCHAR *name)
 {
        int i;
        struct zvolume *zv = zn->volume;
-       struct adfhandle *adf = zv->handle;
+       struct adfhandle *adf = (struct adfhandle*)zv->handle;
        TCHAR name2[MAX_DPATH];
        int bs = adf->blocksize;
 
@@ -1207,7 +1209,7 @@ static void recurseadf (struct znode *zn, int root, TCHAR *name)
 static void recursesfs (struct znode *zn, int root, TCHAR *name, int sfs2)
 {
        struct zvolume *zv = zn->volume;
-       struct adfhandle *adf = zv->handle;
+       struct adfhandle *adf = (struct adfhandle*)zv->handle;
        TCHAR name2[MAX_DPATH];
        int bs = adf->blocksize;
        int block;
@@ -1227,7 +1229,7 @@ static void recursesfs (struct znode *zn, int root, TCHAR *name, int sfs2)
                        memset (&zai, 0, sizeof zai);
                        zai.flags = glx (p + 8) ^ 0x0f;
                        s = p + (sfs2 ? 27 : 25);
-                       fname = au (s);
+                       fname = au ((char*)s);
                        i = 0;
                        while (*s) {
                                s++;
@@ -1236,7 +1238,7 @@ static void recursesfs (struct znode *zn, int root, TCHAR *name, int sfs2)
                        s++;
                        i++;
                        if (*s)
-                               zai.comment = au (s);
+                               zai.comment = au ((char*)s);
                        while (*s) {
                                s++;
                                i++;
@@ -1297,7 +1299,7 @@ struct zvolume *archive_directory_adf (struct znode *parent, struct zfile *z)
        TCHAR name[MAX_DPATH];
        int gotroot = 0;
 
-       adf = xcalloc (sizeof (struct adfhandle), 1);
+       adf = xcalloc (struct adfhandle, 1);
        zfile_fseek (z, 0, SEEK_END);
        adf->size = zfile_ftell (z);
        zfile_fseek (z, 0, SEEK_SET);
@@ -1461,7 +1463,7 @@ static int sfsfindblock (struct adfhandle *adf, int btree, int theblock, struct
                                struct sfsblock *sb;
                                if (*sfsblockcnt >= *sfsmaxblockcnt) {
                                        *sfsmaxblockcnt += 100;
-                                       *sfsb = realloc (*sfsb, (*sfsmaxblockcnt) * sizeof (struct sfsblock));
+                                       *sfsb = xrealloc (struct sfsblock, *sfsb, *sfsmaxblockcnt);
                                }
                                sb = *sfsb + (*sfsblockcnt);
                                sb->block = key;
@@ -1490,7 +1492,7 @@ struct zfile *archive_access_adf (struct znode *zn)
 {
        struct zfile *z = NULL;
        int root, ffs;
-       struct adfhandle *adf = zn->volume->handle;
+       struct adfhandle *adf = (struct adfhandle*)zn->volume->handle;
        int size, bs;
        int i;
        uae_u8 *dst;
@@ -1587,7 +1589,7 @@ end:
 
 static void archive_close_adf (void *v)
 {
-       struct adfhandle *adf = v;
+       struct adfhandle *adf = (struct adfhandle*)v;
        xfree (adf);
 }
 
@@ -1902,7 +1904,7 @@ static void fatdirectory (struct zfile *z, struct zvolume *zv, TCHAR *name, int
                }
                fatname[cnt] = 0;
 
-               fname = au (fatname);
+               fname = au ((char*)fatname);
                name2[0] = 0;
                if (name[0]) {
                        TCHAR sep[] = { FSDB_DIR_SEPARATOR, 0 };