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");
}
a2065_wput (addr + 2, l);
}
-static addrbank a2065_bank;
+extern addrbank a2065_bank;
static void REGPARAM2 a2065_bput (uaecptr addr, uae_u32 b)
{
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;
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);
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;
}
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;
}
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);
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);
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) {
}
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;
#endif
#ifdef ACTION_REPLAY_HRTMON
-#include "hrtmon.rom.c"
+#include "hrtmon.rom.cpp"
#endif
int hrtmon_lang = 0;
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));
*
*/
-static void multigame(int);
+static void multigame (int);
int arcadia_flag, arcadia_coin[2];
struct arcadiarom *arcadia_bios, *arcadia_game;
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);
{
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)) {
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)
{
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);
// 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);
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;
#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) */
#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;
/* ------------------------------------------------------------------------ */
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
/* ------------------------------------------------------------------------ */
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;
/* ------------------------------------------------------------------------ */
unsigned short
-getbits(n)
- unsigned char n;
+getbits(unsigned char n)
{
unsigned short 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);
/* ------------------------------------------------------------------------ */
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)
/* ------------------------------------------------------------------------ */
void
-init_code_cache( /* void */ )
+init_code_cache(void)
{ /* called from copyfile() in util.c */
#ifdef EUC
putc_euc_cache = EOF;
}
void
-init_getbits( /* void */ )
+init_getbits(void)
{
lhabitbuf = 0;
subbitbuf = 0;
/* ------------------------------------------------------------------------ */
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') {
/* ------------------------------------------------------------------------ */
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;
/* ------------------------------------------------------------------------ */
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)
static unsigned long nextcount;
/* ------------------------------------------------------------------------ */
void
-start_c_dyn( /* void */ )
+start_c_dyn(void)
{
int i, j, f;
/* ------------------------------------------------------------------------ */
static void
-start_p_dyn( /* void */ )
+start_p_dyn(void)
{
freq[ROOT_P] = 1;
child[ROOT_P] = ~(N_CHAR);
/* ------------------------------------------------------------------------ */
void
-decode_start_dyn( /* void */ )
+decode_start_dyn(void)
{
n_max = 286;
maxmatch = MAXMATCH;
/* ------------------------------------------------------------------------ */
static void
-reconst(start, end)
- int start;
- int end;
+reconst(int start, int end)
{
int i, j, k, l, b;
unsigned int f, g;
/* ------------------------------------------------------------------------ */
static int
-swap_inc(p)
- int p;
+swap_inc(int p)
{
int b, q, r, s;
/* ------------------------------------------------------------------------ */
static void
-update_c(p)
- int p;
+update_c(int p)
{
int q;
/* ------------------------------------------------------------------------ */
static void
-update_p(p)
- int p;
+update_p(int p)
{
int q;
/* ------------------------------------------------------------------------ */
static void
-make_new_node(p)
- int p;
+make_new_node(int p)
{
int q, r;
#endif
/* ------------------------------------------------------------------------ */
unsigned short
-decode_c_dyn( /* void */ )
+decode_c_dyn(void)
{
int c;
short buf, cnt;
/* ------------------------------------------------------------------------ */
unsigned short
-decode_p_dyn( /* void */ )
+decode_p_dyn(void)
{
int c;
short buf, cnt;
/* ------------------------------------------------------------------------ */
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;
}
/* ------------------------------------------------------------------------ */
-static unsigned short
-get_word ()
+static unsigned short get_word (void)
{
int b0, b1;
}
/* ------------------------------------------------------------------------ */
-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;
}
/* ------------------------------------------------------------------------ */
-static void
-put_longword(v)
- long v;
+static void put_longword(long v)
{
put_byte (v);
put_byte (v >> 8);
}
/* ------------------------------------------------------------------------ */
-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;
}
/* ------------------------------------------------------------------------ */
-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;
/* ------------------------------------------------------------------------ */
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;
/* ------------------------------------------------------------------------ */
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;
#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;
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
#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);
/* ------------------------------------------------------------------------ */
/* 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;
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:
}
/* ------------------------------------------------------------------------ */
-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;
/* ------------------------------------------------------------------------ */
/* Encording */
/* ------------------------------------------------------------------------ */
-static void
-count_t_freq(/*void*/)
+static void count_t_freq(void)
{
short i, k, n, count;
#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) {
/* ------------------------------------------------------------------------ */
/* 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;
}
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;
}
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;
}
/* ------------------------------------------------------------------------ */
-unsigned short
-decode_p_st1( /* void */ )
+unsigned short decode_p_st1(void)
{
unsigned short j, mask;
}
/* ------------------------------------------------------------------------ */
-void
-decode_start_st1( /* void */ )
+void decode_start_st1(void)
{
if (dicbit <= 13) {
np = 14;
/* ------------------------------------------------------------------------ */
static int flag, flagcnt, matchpos;
/* ------------------------------------------------------------------------ */
-unsigned short
-decode_c_lzs( /*void*/ )
+unsigned short decode_c_lzs(void)
{
if (getbits(1)) {
return getbits(8);
}
/* ------------------------------------------------------------------------ */
-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;
}
/* ------------------------------------------------------------------------ */
-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;
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();
extern int encode_alloc();
extern void encode();
-extern int decode();
+extern int decode(struct interfacing*);
/* from append.c */
extern void start_indicator();
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 */
/*
/* 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();
/* ------------------------------------------------------------------------ */
#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 */
/* ------------------------------------------------------------------------ */
/* */
/* ------------------------------------------------------------------------ */
-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;
}
/* ------------------------------------------------------------------------ */
-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;
*/
/* ------------------------------------------------------------------------ */
-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;
}
/* ------------------------------------------------------------------------ */
-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;
}
/* ------------------------------------------------------------------------ */
-void
-free_sp(vector)
- char **vector;
+void free_sp(char **vector)
{
vector--;
free(*vector); /* free string pool */
/* ------------------------------------------------------------------------ */
/* 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)
{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;
}
#endif
/* ------------------------------------------------------------------------ */
-static void
-ready_made(method)
- int method;
+static void ready_made(int method)
{
int i, j;
unsigned int code, weight;
}
#endif
/* ------------------------------------------------------------------------ */
-static void
-read_tree_c( /*void*/ )
+static void read_tree_c(void)
{ /* read tree from file */
int i, c;
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;
}
/* ------------------------------------------------------------------------ */
-void
-decode_start_fix(/*void*/)
+void decode_start_fix(void)
{
n_max = 314;
maxmatch = 60;
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;
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];
}
/* ------------------------------------------------------------------------ */
-unsigned short
-decode_p_st0(/*void*/)
+unsigned short decode_p_st0(void)
{
int i, j;
#endif
-int
-decode(lhinterface)
- struct interfacing *lhinterface;
+int decode(struct interfacing *lhinterface)
{
unsigned int i, j, k, c;
unsigned int dicsiz1, offset;
#include "sysconfig.h"
#include "sysdeps.h"
-#include "zfile.h"
+#include "lha.h"
#include "zarchive.h"
-#include "lha.h"
static char *methods[] =
{
/* 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;
*/
#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'));
}
/* ------------------------------------------------------------------------ */
-int
-strucmp(s, t)
- register char *s, *t;
+int strucmp(char *s, char *t)
{
while (my_toupper(*s++) == my_toupper(*t++))
if (!*s || !*t)
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);
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;
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))
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;
+++ /dev/null
-
-
-#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;
-}
-
--- /dev/null
+
+
+#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;
+}
+
*/
-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);
/* ===========================================================================
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;
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;
/* 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 (;;)
{
(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;
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;
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;
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)
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)
/*
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);
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;
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,
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;
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;
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;
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;
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;
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;
/*
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;
/*
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;
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;
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;
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;
* 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;
/* 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;
}
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;
schedule_audio ();
}
-uae_u16 dmacon;
-
void audio_hsync (int hpos)
{
int nr, handle;
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;
}
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;
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;
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;
}
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;
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)
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;
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);
#ifdef BSDSOCKET
+struct socketbase *socketbases;
static uae_u32 SockLibBase;
#define SOCKPOOLSIZE 128
if (!src)
return 0;
- memcpyha_safe (*dst, src, len);
+ memcpyha_safe (*dst, (uae_u8*)src, len);
(*dst) += len;
return res;
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];
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;
{
int *newdtable;
int *newftable;
- int *newmtable;
+ unsigned int *newmtable;
int i;
if (newSize < sb->dtablesize) {
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;
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;
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));
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;
}
//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)
{
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;
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)) {
fmv_bput2 (addr + 1, w);
}
-static addrbank fmv_bank;
+extern addrbank fmv_bank;
static void REGPARAM2 fmv_bput (uaecptr addr, uae_u32 b)
{
/* @@@ 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] == '/')
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);
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;
}
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)
{
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;
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;
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;
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;
/* 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) {
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);
}
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;
}
nextp = NULL;
- tmp = p = xcalloc (_tcslen (custom) + 2, 1);
+ tmp = p = xcalloc (TCHAR, _tcslen (custom) + 2);
_tcscpy (tmp, custom);
while (p && *p) {
if (*p == '\"') {
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;
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;
}
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];
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;
}
};
-STATIC_INLINE isgayle (void)
+STATIC_INLINE int isgayle (void)
{
return (currprefs.cs_ide == IDE_A600A1200 || currprefs.cs_pcmcia);
}
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);
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();
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();
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;
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 */
*p &= ~val;
}
-STATIC_INLINE alloc_cycle (int hpos, int type)
+STATIC_INLINE void alloc_cycle (int hpos, int type)
{
#ifdef CPUEMU_12
#if 0
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);
}
}
-STATIC_INLINE maybe_check (int hpos)
+STATIC_INLINE void maybe_check (int hpos)
{
if (bpldmasetuphpos > 0 && hpos >= bpldmasetuphpos)
maybe_setup_fmodes (hpos);
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);
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 ());
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)
}
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
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);
}
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);
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 */
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));
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 */
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 ();
}
{
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;
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;
}
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);
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);
if (vlist == NULL) {
listsize = memsize;
- vlist = xcalloc (listsize >> 3, 1);
+ vlist = xcalloc (uae_u8, listsize >> 3);
}
count = 0;
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;
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++) {
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;
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);
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;
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) {
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);
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;
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)) {
struct mmunode *next;
};
static struct mmunode **mmunl;
+extern regstruct mmu_backup_regs;
#define MMU_READ_U (1 << 0)
#define MMU_WRITE_U (1 << 1)
}
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) {
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))
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++;
#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;
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;
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);
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;
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;
#endif
break;
}
- drv->filetype = -1;
+ drv->filetype = ADF_NONE;
zfile_fclose (drv->diskfile);
drv->diskfile = 0;
zfile_fclose (drv->writediskfile);
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) {
}
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)
*crc32 = zfile_crc32 (f);
zfile_fclose (f);
}
- return (void*)1;
+ return 1;
} else {
if (wrprot)
*wrprot = 1;
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];
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];
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)
*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)) {
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;
}
/* 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;
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);
}
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);
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 */
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);
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))
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);
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 */
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 */
return 0;
}
-#include "linetoscr.c"
+#include "linetoscr.cpp"
#ifdef ECS_DENISE
/* ECS SuperHires special cases */
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);
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;
}
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);
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;
}
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);
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 {
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);
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))
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;
#endif
}
}
+ return 1;
};
-static printer_close(void)
+static void printer_close(void)
{
if (page != NULL)
{
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)
* 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;
return (int*)p + 1;
}
#else
-#define fdi_free free
+#define fdi_free xfree
#define fdi_malloc xmalloc
#endif
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);
}
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 {
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;
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);
}
}
- 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;
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 */
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;
struct key *next;
a_inode *aino;
uae_u32 uniq;
- void *fd;
+ struct fs_filehandle *fd;
uae_u64 file_pos;
int dosmode;
int createmode;
typedef struct exallkey {
uae_u32 id;
- void *dirhandle;
+ struct fs_dirhandle *dirhandle;
TCHAR *fn;
uaecptr control;
} ExAllKey;
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)
{
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;
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);
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);
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);
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);
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;
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);
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;
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;
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;
int i;
Unit *unit, *u;
- unit = xcalloc (sizeof (Unit), 1);
+ unit = xcalloc (Unit, 1);
/* keep list in insertion order */
u = units;
if (u) {
}
#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);
}
if (k->fd != NULL)
- fs_close (unit, k->fd);
+ fs_close (k->fd);
xfree(k);
}
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;
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;
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);
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);
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);
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));
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;
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)
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 {
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;
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;
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;
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)
/* 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)
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;
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;
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);
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);
uaecptr addr = GET_PCK_ARG2 (packet);
long size = GET_PCK_ARG3 (packet);
long actual;
- TCHAR *buf;
+ uae_u8 *buf;
int i;
if (k == 0) {
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);
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);
}
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;
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);
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));
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);
}
if (_tcslen (commented) > 0) {
TCHAR *p = commented;
- commented = xmalloc (81 * sizeof (TCHAR));
+ commented = xmalloc (TCHAR, 81);
_tcsncpy (commented, p, 80);
commented[80] = 0;
} else {
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)) {
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)));
}
/* 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
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);
}
}
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);
}
}
}
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)));
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)));
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;
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;
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);
}
/* 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);
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;
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;
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;
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);
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 */
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 (;;) {
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);
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. */
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)
{
/* 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);
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++) {
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 ();
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 ();
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);
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);
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, '/');
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));
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);
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);
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);
#endif
}
+extern int isinf (double x);
+
uae_u32 get_fpsr (void)
{
uae_u32 answer = regs.fpsr & 0x00ffffff;
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++) {
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;
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);
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);
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);
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);
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;
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysconfig.h"
+#include "sysdeps.h"
#include <stdlib.h>
#include <sys/types.h>
}
#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)
*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;
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) {
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;
for (i = 0; i < max; i++) {
if (!ide[i])
- ide[i] = xcalloc (sizeof (struct ide_hdf), 1);
+ ide[i] = xcalloc (struct ide_hdf, 1);
}
}
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);
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);
if (!using_prefetch)
return;
printf ("\tregs.ir = regs.irc;\n");
+ if (using_ce)
+ printf ("\tipl_fetch ();\n");
}
static int did_prefetch;
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
headerfile = fopen ("cputbl.h", "wb");
- stblfile = fopen ("cpustbl.c", "wb");
+ stblfile = fopen ("cpustbl.cpp", "wb");
generate_includes (stblfile);
using_prefetch = 0;
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);
}
/* 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)
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)
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;
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);
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);
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;
}
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;
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;
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;
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
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;
// 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;
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);
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);
}
}
-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];
{
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);
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;
uae_u32 timeout;
uae_u32 sigmp;
#endif
-} *socketbases;
-
+};
#define LIBRARY_SIZEOF 36
#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])
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 *, ...);
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);
#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
* Copyright 1997 Bernd Schmidt
*/
+struct hardfilehandle;
+
struct hardfiledata {
uae_u64 virtsize; // virtual size
uae_u64 physsize; // physical size (dynamic disk)
int surfaces;
int reservedblocks;
int blocksize;
- void *handle;
+ struct hardfilehandle *handle;
int handle_valid;
int readonly;
int dangerous;
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;
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;
};
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*);
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);
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);
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
#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);
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);
-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);
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;
int count;
};
-struct flag_struct regflags;
-extern struct regstruct
+struct regstruct
{
uae_u32 regs[16];
int ce020memcycles;
evt lastfetch;
-} regs, lastint_regs, mmu_backup_regs;
+};
+
+extern struct regstruct regs;
STATIC_INLINE uae_u32 munge24 (uae_u32 x)
{
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
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
#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."
/* 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;
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__
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
#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
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);
struct zarchive_info
{
- const TCHAR *name;
+ TCHAR *name;
uae_s64 size;
int flags;
TCHAR *comment;
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*);
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);
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();
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);
}
}
-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 != ',')
*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;
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));
#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};
emit_byte(0xe9);
emit_long(ctxPC+len-(uae_u32)target-4);
in_handler=1;
- target=tmp;
+ target=(uae_u8*)tmp;
}
bi=active;
while (bi) {
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();
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)
}
x=x->next;
}
- bi->direct_handler_to_use=dh;
+ bi->direct_handler_to_use=(cpuop_func*)dh;
}
}
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;
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);
********************************************************************/
//#include "compemu_optimizer.c"
-#include "compemu_optimizer_x86.c"
+#include "compemu_optimizer_x86.cpp"
/********************************************************************
* Functions to emit data into memory, and other general support *
* Getting the information about the target CPU *
********************************************************************/
-#include "compemu_raw_x86.c"
+#include "compemu_raw_x86.cpp"
/********************************************************************
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)®s.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)®s.pc_p,0);
raw_jmp((uae_u32)popall_check_checksum);
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();
#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;
}
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;
/* 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)®s.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 */
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();
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);
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");
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 */
}
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");
}
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();
}
"#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");
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
* 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");
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);
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;
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);
}
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;
uae_u8 *mapped_malloc (size_t s, TCHAR *file)
{
- return xmalloc (s);
+ return xmalloc (uae_u8, s);
}
void mapped_free (uae_u8 *p)
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 ();
if (!canjit()) {
nocanbang ();
- return xcalloc (s + 4, 1);
+ return xcalloc (uae_u8, s + 4);
}
id = shmget (IPC_PRIVATE, s, 0x1ff, 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;
if (x->next)
x->next->prev = x;
shm_start = x;
- return answer;
+ return (uae_u8*)answer;
}
nocanbang ();
return mapped_malloc (s, file);
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);
#endif
+#if 0
+
void *xmalloc (size_t n)
{
void *a = malloc (n);
free (p);
}
+
+#endif
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);
xfree (buf);
}
+extern "C"
+{
+
FILE *moduleripper_fopen (const char *aname, const char *amode)
{
TCHAR tmp2[MAX_DPATH];
return moduleripper_fopen (name, mode);
}
+void pw_write_log (const char *format,...)
+{
+}
+
+}
+
#else
FILE *moduleripper_fopen (const char *name, const char *mode)
return v;
}
-static addrbank ncr_bank;
+extern addrbank ncr_bank;
static uae_u32 REGPARAM2 ncr_lget (uaecptr addr)
{
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);
}
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];
}
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;
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 {
if (currprefs.cpu_cycle_exact) {
if (time_for_interrupt ()) {
- unset_special (SPCFLAG_INT | SPCFLAG_DOINT);
do_interrupt (regs.ipl);
}
} else {
/* 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 = ®s;
{
struct regstruct *r = ®s;
- regs.ipl = regs.ipl_pin;
+ ipl_fetch ();
for (;;) {
uae_u32 opcode = r->ir;
(*cpufunctbl[opcode])(opcode);
if (do_specialties (0))
return;
}
- regs.ipl = regs.ipl_pin;
if (!currprefs.cpu_cycle_exact || currprefs.cpu_model > 68000)
return;
}
{
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);
{
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);
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 */
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;
#define RECORDBUFFER 50 //survive 9 sec of blocking at 44100
#include "sysconfig.h"
+#include "sysdeps.h"
#if defined(AHI)
#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;
void ahi_updatesound(int force)
{
HRESULT hr;
- int pos;
- unsigned int dwBytes1, dwBytes2;
+ DWORD pos;
+ DWORD dwBytes1, dwBytes2;
LPVOID dwData1, dwData2;
static int oldpos;
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)
}
}
- 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;
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)
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;
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;
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))
addr += 4;
}
t *= 4;
- IDirectSoundCaptureBuffer_Unlock(lpDSB2r, pos1, byte1, pos2, byte2);
+ lpDSB2r->Unlock(pos1, byte1, pos2, byte2);
return (todo - t) / t;
}
case 10:
#if 1
if (OpenClipboard (0)) {
- clipdat = GetClipboardData (CF_UNICODETEXT);
+ clipdat = (TCHAR*)GetClipboardData (CF_UNICODETEXT);
if (clipdat) {
clipsize = _tcslen (clipdat);
clipsize++;
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;
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);
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);
}
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);
{
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) {
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;
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;
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];
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;
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;
}
}
static void getsettings (UAEREG *avikey)
{
- DWORD val;
+ int val;
if (regqueryint (avikey, L"NoSoundOutput", &val))
avioutput_nosoundoutput = val;
if (regqueryint (avikey, L"NoSoundSync", &val))
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;
}
}
- if (!(pwfxDst = (LPWAVEFORMATEX) xmalloc (wfxMaxFmtSize)))
+ if (!(pwfxDst = (LPWAVEFORMATEX)xmalloc (uae_u8, wfxMaxFmtSize)))
return 0;
// set the initial destination format to match source
static int AVIOutput_GetAudioFromRegistry (WAVEFORMATEX *wft)
{
- DWORD ss;
+ int ss;
int ok = 0;
UAEREG *avikey;
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;
static int AVIOutput_GetCOMPVARSFromRegistry (COMPVARS *pcv)
{
UAEREG *avikey;
- DWORD ss;
+ int ss;
int ok = 0;
avikey = openavikey ();
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) {
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;
ss = 0;
}
if (ss == 0)
- state = xmalloc (1);
+ state = xmalloc (uae_u8, 1);
avikey = openavikey ();
if (avikey) {
regsetdata (avikey, L"VideoConfigurationState", state, ss);
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;
goto error;
}
- if (!(lpAudio = xmalloc (dwOutputBytes)))
+ if (!(lpAudio = xmalloc (uae_u8, dwOutputBytes)))
goto error;
ash.cbStruct = sizeof (ACMSTREAMHEADER);
// 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
static int AVIOutput_AVIWriteVideo_Thread (struct avientry *ae)
{
- DWORD written = 0;
+ LONG written = 0;
unsigned int err;
if (avioutput_video) {
InitializeCriticalSection (&AVIOutput_CriticalSection);
cs_allocated = 1;
- pcompvars = xcalloc (sizeof (COMPVARS), 1);
+ pcompvars = xcalloc (COMPVARS, 1);
if (!pcompvars)
return;
pcompvars->cbSize = sizeof (COMPVARS);
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];
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 {
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;
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];
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);
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;
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 */
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;
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;
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;
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);
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;
struct dev_info_spti {
TCHAR *drvpath;
TCHAR *name;
- TCHAR *inquirydata;
+ uae_u8 *inquirydata;
TCHAR *ident;
int mediainserted;
HANDLE handle;
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;
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.. */
{
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,
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) {
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,
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;
}
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);
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;
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];
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;
}
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);
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;
}
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;
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) {
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))
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));
{
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]) {
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 = "";
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);
uae_u32 nameport;
uae_u32 proto;
uae_u32 type;
- uae_char *proto_rp = 0;
+ char *proto_rp = 0;
struct servent *serv;
nameport = args->args2;
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) {
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));
}
}
}
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;
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));
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));
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"));
}
{
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
+++ /dev/null
-// 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
-
/>
<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 >..\..\cpudefs.c <..\..\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 >..\..\cpudefs.c <..\..\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 >..\..\cpudefs.c <..\..\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 >..\..\cpudefs.c <..\..\table68k"
/>
</Configuration>
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
- RelativePath="..\..\build68k.c"
+ RelativePath="..\..\build68k.cpp"
>
</File>
</Filter>
<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 >..\..\cpudefs.c <..\..\table68k</Command>
+ <Message>creating cpudefs.cpp</Message>
+ <Command>build68k.exe >..\..\cpudefs.cpp <..\..\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">
</Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="..\..\build68k.c">
+ <ClCompile Include="..\..\build68k.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
#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"
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)
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];
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)
return off;
}
-static TCHAR *amigatopc (const uae_u8 *txt)
+static TCHAR *amigatopc (const char *txt)
{
int i, j, cnt;
int len, pc;
}
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];
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 ();
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;
}
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;
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
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;
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;
}
}
}
- 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));
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);
}
}
} 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);
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);
}
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);
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);
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);
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) {
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);
}
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;
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);
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;
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;
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;
case WM_INITDIALOG:
{
int newpos = 0;
- LONG x, y, w, h;
+ int x, y, w, h;
RECT rw;
HFONT hfont;
LOGFONT lf;
return 0;
}
-static isrealbutton (struct didata *did, int num)
+static int isrealbutton (struct didata *did, int num)
{
if (num >= did->buttons)
return 0;
(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);
{
#ifndef _WIN64
if (ctx != NULL)
- WTClose (ctx);
+ WTClose ((HCTX)ctx);
ctx = NULL;
if (!tablet)
return 0;
static int initialize_tablet (void)
{
#ifndef _WIN64
- HANDLE h;
+ HMODULE h;
TCHAR name[MAX_DPATH];
struct tagAXIS ori[3];
int tilt = 0;
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;
goto error;
bufsize = 10000 * sizeof (TCHAR);
- buf = xmalloc (bufsize);
+ buf = xmalloc (TCHAR, bufsize / sizeof (TCHAR));
register_rawinput ();
if (pGetRawInputDeviceList (NULL, &num, sizeof (RAWINPUTDEVICELIST)) != 0) {
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");
static BOOL CALLBACK EnumObjectsCallback (const DIDEVICEOBJECTINSTANCE* pdidoi, VOID *pContext)
{
- struct didata *did = pContext;
+ struct didata *did = (struct didata*)pContext;
int i;
TCHAR tmp[100];
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);
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);
}
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!");
}
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 ();
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);
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));
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;
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);
#if defined (D3D) && defined (GFXFILTER)
-extern "C"
-{
#include "options.h"
#include "xwin.h"
#include "custom.h"
#include "hq2x_d3d.h"
#include "zfile.h"
extern int D3DEX, d3ddebug;
-}
#include <d3d9.h>
#include <d3dx9.h>
}
}
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,
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)
{
}
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)
{
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)
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);
} 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);
int my_rmdir (const TCHAR *name)
{
- void *od;
+ struct my_opendir_s *od;
int cnt;
TCHAR tname[MAX_DPATH];
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);
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;
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;
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;
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;
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);
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)
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);
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);
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);
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;
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);
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;
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);
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>
<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>
<PostBuildEvent>
<Message>generating blitter files</Message>
<Command>genblitter.exe i >..\..\blit.h
-genblitter.exe f >..\..\blitfunc.c
+genblitter.exe f >..\..\blitfunc.cpp
genblitter.exe h >..\..\blitfunc.h
-genblitter.exe t >..\..\blittable.c
+genblitter.exe t >..\..\blittable.cpp
+del genblitter.exe
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
</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">
</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>
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>
<Message>generating gencomp files</Message>
<Command>cd ..\..
od-win32\gencomp_msvc\gencomp.exe
+del od-win32\gencomp_msvc\gencomp.exe
+
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
</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">
</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>
+++ /dev/null
-<?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
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>
<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>
<Message>generating gencpu files</Message>
<Command>cd ..\..
od-win32\gencpu_msvc\gencpu.exe
+del od-win32\gencpu_msvc\gencpu.exe
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
</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">
</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>
/>
<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 >..\..\linetoscr.c"
+ Description="generating linetoscr.cpp"
+ CommandLine="genlinetoscr.exe >..\..\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 >..\..\linetoscr.c"
+ Description="generating linetoscr.cpp"
+ CommandLine="genlinetoscr.exe >..\..\linetoscr.cpp"
/>
</Configuration>
</Configurations>
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
- RelativePath="..\..\genlinetoscr.c"
+ RelativePath="..\..\genlinetoscr.cpp"
>
</File>
</Filter>
<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 >..\..\linetoscr.c</Command>
+ <Command>genlinetoscr.exe >..\..\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">
</Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="..\..\genlinetoscr.c">
+ <ClCompile Include="..\..\genlinetoscr.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
static int usefloppydrives = 0;
+struct hardfilehandle
+{
+ int zfile;
+ struct zfile *zf;
+ HANDLE h;
+};
+
struct uae_driveinfo {
TCHAR vendor_id[128];
TCHAR product_id[128];
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;
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;
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;
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++) {
}
#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;
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);
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;
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 ();
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))
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) {
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))
}
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) {
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);
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);
{
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);
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.");
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);
}
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);
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;
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;
}
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 {
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;
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;
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;
}
//
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;
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));
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;
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) {
#define io_log
#define para_log write_log
+#ifndef __cplusplus
typedef int bool;
+#endif
#include <windows.h>
#include "win32.h"
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;
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
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++;
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++;
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];
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;
+++ /dev/null
-// 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;
- }
--- /dev/null
+// 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;
+}
#include "ahidsound_new.h"
#include "uaeipc.h"
#include "xwin.h"
+#include "drawing.h"
#include <Ghostscript/iapi.h>
#include <Ghostscript/ierrors.h>
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;
static void *prt_thread (void *p)
{
- uae_u8 **buffers = p;
+ uae_u8 **buffers = (uae_u8**)p;
int err, cnt, ok;
ok = 1;
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");
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);
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");
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)) {
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;
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);
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));
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;
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;
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;
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;
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);
static int datainoutput;
static int dataininput, dataininputcnt;
static OVERLAPPED writeol, readol;
-static writepending;
+static int writepending;
int openser (TCHAR *sername)
{
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);
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
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);
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");
#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
#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
#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
#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
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++) {
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);
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;
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)
return;
misscnt = 0;
cnt = 0;
- newmodes = xmalloc (sizeof (struct PicassoResolution) * MAX_PICASSO_MODES);
+ newmodes = xmalloc (struct PicassoResolution, MAX_PICASSO_MODES);
size = 0;
depths = 0;
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();
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;
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;
}
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;
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 ();
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));
#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) */
#define PSSO_Template_sizeof 16
struct Template {
- char *Memory;
+ uae_u8 *Memory;
uae_s16 BytesPerRow;
uae_u8 XOffset;
uae_u8 DrawMode;
/************************************************************************/
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)*/
*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;
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;
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);
#include "sysdeps.h"
#include <windows.h>
-#include "win32.h"
#include <shlwapi.h>
+#include "win32.h"
#include "registry.h"
#include "crc32.h"
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;
}
{
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);
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;
}
}
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;
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;
}
}
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;
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);
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;
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;
}
}
{
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))
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;
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;
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;
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);
/* Scaler (except Scale2x) code borrowed from ScummVM project */
+extern int cpu_mmx;
+
+extern "C"
+{
+
#include "sysconfig.h"
#include "sysdeps.h"
*/
#define MMX
-extern int cpu_mmx;
/* Suggested in "Intel Optimization" for Pentium II */
#define ASM_JUMP_ALIGN ".p2align 4\n"
}
}
+}
#include "png.h"
int screenshotmode = PNG_SCREENSHOTS;
-DWORD screenshot_originalsize = 0;
+int screenshot_originalsize = 0;
static void namesplit (TCHAR *s)
{
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);
int screenshot_prepare (void)
{
- unsigned int width, height;
+ int width, height;
HGDIOBJ hgdiobj;
int bits;
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++) {
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):
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)
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);
{
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];
}
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);
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);
LPDIRECTSOUNDBUFFER8 lpDSBsecondary;
DWORD writepos;
int dsoundbuf;
- int safedist;
+ DWORD safedist;
int snd_writeoffset;
int snd_maxoffset;
int snd_totalmaxoffset_uf;
UINT64 wasapiclock;
#endif
REFERENCE_TIME hnsRequestedDuration;
- int bufferFrameCount;
+ UINT32 bufferFrameCount;
UINT64 wasapiframes;
int wasapiexclusive;
int framecounter;
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);
}
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;
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)
DWORD rn[4];
struct sound_dp *s = sd->data;
LPDIRECTSOUND8 lpDS = s->lpDS;
- static done;
+ static int done;
if (done)
return speakerconfig;
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)) {
// }
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);
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);
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;
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);
}
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;
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",
);
}
- 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) *
+ 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)) {
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;
+ 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);
}
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;
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;
BYTE *pData;
DWORD v;
double skipmode;
- int numFramesPadding, avail;
+ UINT32 numFramesPadding;
+ int avail;
int stuck = 2000;
int oldpadding = 0;
}
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;
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);
}
}
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);
/* 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);
}
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);
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));
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)) {
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;
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++) {
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];
CoTaskMemFree (devid);
}
}
- col->lpVtbl->Release (col);
+ col->Release ();
}
- enumerator->lpVtbl->Release (enumerator);
+ enumerator->Release ();
}
}
/*
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)
{
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;
}
extern void set_volume (int, int);
extern void master_sound_volume (int);
+struct sound_dp;
+
struct sound_data
{
int waiting_for_buffer;
int freq;
int samplesize;
int sndbufsize;
- void *data;
+ struct sound_dp *data;
};
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
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
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
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>
<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>
</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">
</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>
#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++) {
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);
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;
}
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;
}
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;
}
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;
}
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) {
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;
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;
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;
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;
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);
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;
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);
//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) {
}
-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;
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;
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)
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;
RGBFTYPE colortype = RGBFB_NONE;
DWORD dwType = REG_DWORD;
DWORD dwDisplayInfoSize = sizeof (colortype);
- DWORD size;
+ int size;
TCHAR path[MAX_DPATH] = L"";
TCHAR version[100];
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);
return 2;
}
if (!_tcscmp (arg, L"-minidumpmode")) {
- minidumpmode = getval (np);
+ minidumpmode = (MINIDUMP_TYPE)getval (np);
return 2;
}
if (!_tcscmp (arg, L"-jitevent")) {
{
DWORD disposition;
TCHAR tmp[MAX_DPATH];
- DWORD size = sizeof tmp / sizeof (TCHAR);
+ int size = sizeof tmp / sizeof (TCHAR);
reginitializeinit (inipath);
hWinUAEKey = NULL;
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)
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 {
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;
#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++) {
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, '.');
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;
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;
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);
#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""
extern void setpaused (int priority);
void finishjob (void);
-void updatedisplayarea (void);
void init_colors (void);
extern int pause_emulation;
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;
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;
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 {
int ok = 0;
RECT sr, dr, zr;
DDSURFACEDESC2 desc;
- DWORD pitch;
+ int pitch;
uae_u8 *surfstart;
aw = amiga_width;
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;
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) {
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;
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;
}
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);
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;
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) {
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;
} else {
write_log (L" - failed to get MAC\n");
}
- free (OidData);
+ xfree (OidData);
}
PacketCloseAdapter (lpAdapter);
}
int screen_is_picasso = 0;
+extern int reopen (int);
+
int WIN32GFX_IsPicassoScreen (void)
{
return screen_is_picasso;
static int init_round;
static BOOL doInit (void);
-uae_u32 default_freq = 0;
+int default_freq = 0;
HWND hStatusWnd = NULL;
static HRESULT CALLBACK modesCallback (LPDDSURFACEDESC2 modeDesc, LPVOID context)
{
- struct MultiDisplay *md = context;
+ struct MultiDisplay *md = (struct MultiDisplay*)context;
RGBFTYPE colortype;
int depth, ct;
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)) {
/* 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
DirectDraw_BlitToPrimary (NULL);
}
if ((c & 16) || ((c & 8) && keepfsmode)) {
- extern int reopen (int);
if (reopen (c & 2))
c |= 2;
}
/* 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;
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;
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;
} 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;
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;
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);
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);
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;
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;
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;
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);
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)
}
}
}
- 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);
}
{
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)))
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);
}
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) {
} 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);
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;
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;
}
break;
}
- zfile_zopen (path, scan_rom_2, &rsd);
+ zfile_zopen (path, scan_rom_2, (void*)&rsd);
return rsd.got;
}
_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);
#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];
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];
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) {
{
struct ConfigStruct *config;
- config = xcalloc (sizeof (struct ConfigStruct), 1);
+ config = xcalloc (struct ConfigStruct, 1);
return config;
}
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)
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)
{
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]);
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;
}
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) {
}
-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);
}
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;
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;
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);
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" }");
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);
}
if (fkey) {
int idx = 0;
TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH];
- DWORD size, size2;
+ int size, size2;
for (;;) {
size = sizeof (tmp) / sizeof (TCHAR);
{
int ok, load, i, builtin, userfilter;
TCHAR tmp1[MAX_DPATH], tmp2[MAX_DPATH];
- DWORD outsize;
+ int outsize;
UAEREG *fkey;
LRESULT item;
{
RECT rc, rcDlg, rcOwner;
HWND owner = GetParent(hDlg);
- LONG x = 0, y = 0;
+ int x = 0, y = 0;
POINT pt1, pt2;
if (owner == NULL)
HRSRC hrsrc;
HGLOBAL res;
HINSTANCE inst = hUIDLL ? hUIDLL : hInst;
- void *resdata, *newres;
+ void *resdata;
+ LPCDLGTEMPLATEW newres;
struct newresource *nr;
int size;
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;
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;
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;
}
extern HWND hStatusWnd;
-struct gui_info gui_data;
void check_prefs_changed_gui (void)
{
int flipflop = 0;
int fullscreen = 0;
int focuso = isfocus ();
- int mbflags, ret;
+ int ret;
+ DWORD mbflags;
HWND hwnd;
mbflags = MB_ICONWARNING | MB_TASKMODAL;
struct newresource
{
- void *resource;
+ LPCDLGTEMPLATEW resource;
HINSTANCE inst;
int size;
int tmpl;
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);
void freescaleresource (struct newresource *ns)
{
- xfree (ns->resource);
+ xfree ((void*)ns->resource);
xfree (ns);
}
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>
+++ /dev/null
-<?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>
<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" />
</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>
-- 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:
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;
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))
bufsize *= 10;
if (bufp != buffer)
xfree (bufp);
- bufp = xmalloc (bufsize * sizeof (TCHAR));
+ bufp = xmalloc (TCHAR, bufsize);
continue;
}
break;
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;
return f;
}
-void log_close (void *f)
+void log_close (FILE *f)
{
fclose (f);
}
happened = 1;
uae_reset (1);
}
-
-
-
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);
typedef unsigned long Ulong;
typedef unsigned short Ushort;
-#include "moduleripper.h"
#ifdef _WIN32
__inline Ulong htonlx (Ulong v)
{
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" );
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;
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;
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;
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;
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"/");
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;
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;
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);
}
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);
}
#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);
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);
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;
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);
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;
}
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;
{
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;
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;
}
mc = mc->next;
}
- mc = xcalloc (sizeof (struct mcast), 1);
+ mc = xcalloc (struct mcast, 1);
mc->start = start;
mc->end = end;
mc->cnt = 1;
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;
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]);
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);
/* 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;
&& _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 {
write_log (L"%s\n", s);
xfree (s);
#endif
- src += strlen (src) + 1;
+ src += strlen ((char*)src) + 1;
return src;
}
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++)
frameextra = 0;
if (currprefs.statecapture && currprefs.statecapturebuffersize && currprefs.statecapturerate) {
replaybuffersize = currprefs.statecapturebuffersize;
- replaybuffer = xmalloc (replaybuffersize);
+ replaybuffer = xmalloc (uae_u8, replaybuffersize);
}
}
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;
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;
*/
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);
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);
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;
}
}
}
-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));
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))
}
}
-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);
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;
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)
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)
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;
int isIPC (const TCHAR *pipename)
{
- HANDLE *p;
+ HANDLE p;
p = CreateFile(
pipename,
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);
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;
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;
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];
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;
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];
}
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;
}
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;
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) {
static int unpack2 (const TCHAR *src, const TCHAR *match, int level)
{
- void *h;
+ struct zdirectory *h;
struct zvolume *zv;
int ret;
uae_u8 *b;
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);
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);
struct zcache *zc;
zcache_check ();
- zc = xcalloc (sizeof (struct zcache), 1);
+ zc = xcalloc (struct zcache, 1);
zc->next = zcachedata;
zcachedata = zc;
zc->zd = data;
{
struct zfile *z;
- z = xmalloc (sizeof *z);
+ z = xmalloc (struct zfile, 1);
if (!z)
return 0;
memset (z, 0, sizeof *z);
};
-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;
}
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;
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;
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);
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;
}
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;
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);
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;
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);
}
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);
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;
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;
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");
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);
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 {
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];
int zfile_is_ignore_ext (const TCHAR *name)
{
int i;
- TCHAR *ext;
+ const TCHAR *ext;
ext = _tcsrchr (name, '.');
if (!ext)
{
int i;
- TCHAR *ext = _tcsrchr (name, '.');
+ const TCHAR *ext = _tcsrchr (name, '.');
if (!ext)
return 0;
i = 0;
}
datalen = 0;
- data = malloc (bufferlen);
+ data = xmalloc (uae_u8, bufferlen);
for (;;) {
if (!InternetReadFile (i, data + datalen, INETBUFFERLEN, &didread)) {
DWORD err = GetLastError ();
datalen += didread;
if (datalen > bufferlen - INETBUFFERLEN) {
bufferlen += INETBUFFERLEN;
- data = realloc (data, bufferlen);
+ data = xrealloc (uae_u8, data, bufferlen);
if (!data) {
datalen = 0;
break;
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) {
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;
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;
uae_s64 zfile_ftell (struct zfile *z)
{
- uae_s64 v;
if (z->data || z->dataseek || z->parent)
return z->seek;
return _ftelli64 (z->f);
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);
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);
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 {
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);
{
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 };
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;
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);
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);
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 {
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);
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;
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);
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;
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;
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);
}
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);
}
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;
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,
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)
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;
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;
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);
zn->f = z;
else
zfile_fclose (z);
+ xfree (zai.name);
return zn;
}
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);
}
{
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;
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;
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++;
s++;
i++;
if (*s)
- zai.comment = au (s);
+ zai.comment = au ((char*)s);
while (*s) {
s++;
i++;
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);
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;
{
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;
static void archive_close_adf (void *v)
{
- struct adfhandle *adf = v;
+ struct adfhandle *adf = (struct adfhandle*)v;
xfree (adf);
}
}
fatname[cnt] = 0;
- fname = au (fatname);
+ fname = au ((char*)fatname);
name2[0] = 0;
if (name[0]) {
TCHAR sep[] = { FSDB_DIR_SEPARATOR, 0 };