--- /dev/null
+
+#include "sysconfig.h"
+#include "sysdeps.h"
+
+#include "options.h"
+#include "zfile.h"
+#include "amax.h"
+#include "custom.h"
+#include "memory.h"
+#include "newcpu.h"
+
+static int data_scramble[8] = { 3, 2, 4, 5, 7, 6, 0, 1 };
+static int addr_scramble[16] = { 14, 12, 2, 10, 15, 13, 1, 0, 7, 6, 5, 4, 8, 9, 11, 3 };
+
+static int romptr;
+static uae_u8 *rom;
+static int rom_size, rom_oddeven;
+static uae_u8 data;
+static uae_u8 bfd100, bfe001;
+static uae_u8 dselect;
+
+#define AMAX_LOG 0
+
+static void load_byte (void)
+{
+ int addr, i;
+ uae_u8 val, v;
+
+ v = 0xff;
+ addr = 0;
+ for (i = 0; i < 16; i++) {
+ if (romptr & (1 << i))
+ addr |= 1 << addr_scramble[i];
+ }
+ if (rom_oddeven < 0) {
+ val = v;
+ } else {
+ v = rom[addr * 2 + rom_oddeven];
+ val = 0;
+ for (i = 0; i < 8; i++) {
+ if (v & (1 << data_scramble[i]))
+ val |= 1 << i;
+ }
+ }
+ data = val;
+ if (AMAX_LOG > 0)
+ write_log ("AMAX: load byte, rom=%d addr=%06x (%06x) data=%02x (%02x) PC=%08X\n", rom_oddeven, romptr, addr, v, val, M68K_GETPC);
+}
+
+static void amax_check (void)
+{
+ /* DIR low = reset address counter */
+ if ((bfd100 & 2)) {
+ if (romptr && AMAX_LOG > 0)
+ write_log ("AMAX: counter reset PC=%08X\n", M68K_GETPC);
+ romptr = 0;
+ }
+}
+
+static int dwlastbit;
+
+void amax_diskwrite (uae_u16 w)
+{
+ int i;
+
+ /* this is weird, 1->0 transition in disk write line increases address pointer.. */
+ for (i = 0; i < 16; i++) {
+ if (dwlastbit && !(w & 0x8000)) {
+ romptr++;
+ if (AMAX_LOG > 0)
+ write_log ("AMAX: counter increase %d PC=%08X\n", romptr, M68K_GETPC);
+ }
+ dwlastbit = (w & 0x8000) ? 1 : 0;
+ w <<= 1;
+ }
+ romptr &= rom_size - 1;
+ amax_check ();
+}
+
+static uae_u8 bfe001_ov;
+
+void amax_bfe001_write (uae_u8 pra, uae_u8 dra)
+{
+ uae_u8 v = dra & pra;
+
+ bfe001 = v;
+ /* CHNG low -> high: shift data register */
+ if ((v & 4) && !(bfe001_ov & 4)) {
+ data <<= 1;
+ data |= 1;
+ if (AMAX_LOG > 0)
+ write_log ("AMAX: data shifted\n");
+ }
+ /* TK0 = even, WPRO = odd */
+ rom_oddeven = -1;
+ if ((v & (8 | 16)) != (8 | 16)) {
+ rom_oddeven = 0;
+ if (!(v & 16))
+ rom_oddeven = 1;
+ }
+ bfe001_ov = v;
+ amax_check ();
+}
+
+void amax_disk_select (uae_u8 v, uae_u8 ov)
+{
+ bfd100 = v;
+
+ if (!(bfd100 & dselect) && (ov & dselect))
+ load_byte ();
+ amax_check ();
+}
+
+uae_u8 amax_disk_status (void)
+{
+ uae_u8 st = 0x3c;
+
+ if (!(data & 0x80))
+ st &= ~0x20;
+ return st;
+}
+
+void amax_reset (void)
+{
+ romptr = 0;
+ rom_oddeven = 0;
+ bfe001_ov = 0;
+ dwlastbit = 0;
+ data = 0xff;
+ xfree (rom);
+ rom = NULL;
+ dselect = 0;
+}
+
+void amax_init (void)
+{
+ struct zfile *z;
+
+ if (!currprefs.amaxromfile[0])
+ return;
+ amax_reset ();
+ z = zfile_fopen (currprefs.amaxromfile, "rb");
+ if (!z) {
+ write_log ("AMAX: failed to load rom '%s'\n", currprefs.amaxromfile);
+ return;
+ }
+ zfile_fseek (z, 0, SEEK_END);
+ rom_size = zfile_ftell (z);
+ zfile_fseek (z, 0, SEEK_SET);
+ rom = xmalloc (rom_size);
+ zfile_fread (rom, rom_size, 1, z);
+ zfile_fclose (z);
+ write_log ("AMAX: '%s' loaded, %d bytes\n", currprefs.amaxromfile, rom_size);
+ dselect = 0x20;
+}
+
+
+
va_start (parms, format);
vsprintf (tmp, format, parms);
- if (!isdefault (tmp))
+ if (1 || !isdefault (tmp))
zfile_fwrite (tmp, 1, strlen (tmp), f);
va_end (parms);
}
sprintf(tmp, "%d", model);
if (model == 68020 && (p->fpu_model == 68881 || p->fpu_model == 68882))
strcat(tmp,"/68881");
- cfgfile_dwrite (f, "cpu_type=%s\n", tmp);
+ cfgfile_write (f, "cpu_type=%s\n", tmp);
}
void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
cfgfile_write (f, "; common\n");
- cfgfile_dwrite (f, "use_gui=%s\n", guimode1[p->start_gui]);
- cfgfile_dwrite (f, "use_debugger=%s\n", p->start_debugger ? "true" : "false");
+ cfgfile_write (f, "use_gui=%s\n", guimode1[p->start_gui]);
+ cfgfile_write (f, "use_debugger=%s\n", p->start_debugger ? "true" : "false");
str = cfgfile_subst_path (p->path_rom, UNEXPANDED, p->romfile);
- cfgfile_dwrite (f, "kickstart_rom_file=%s\n", str);
+ cfgfile_write (f, "kickstart_rom_file=%s\n", str);
free (str);
if (p->romident[0])
cfgfile_dwrite (f, "kickstart_rom=%s\n", p->romident);
str = cfgfile_subst_path (p->path_rom, UNEXPANDED, p->romextfile);
- cfgfile_dwrite (f, "kickstart_ext_rom_file=%s\n", str);
+ cfgfile_write (f, "kickstart_ext_rom_file=%s\n", str);
free (str);
if (p->romextident[0])
- cfgfile_dwrite (f, "kickstart_ext_rom=%s\n", p->romextident);
+ cfgfile_write (f, "kickstart_ext_rom=%s\n", p->romextident);
str = cfgfile_subst_path (p->path_rom, UNEXPANDED, p->flashfile);
- cfgfile_dwrite (f, "flash_file=%s\n", str);
+ cfgfile_write (f, "flash_file=%s\n", str);
free (str);
str = cfgfile_subst_path (p->path_rom, UNEXPANDED, p->cartfile);
- cfgfile_dwrite (f, "cart_file=%s\n", str);
+ cfgfile_write (f, "cart_file=%s\n", str);
free (str);
if (p->cartident[0])
- cfgfile_dwrite (f, "cart=%s\n", p->cartident);
- //cfgfile_dwrite (f, "cart_internal=%s\n", cartsmode[p->cart_internal]);
- cfgfile_dwrite (f, "kickshifter=%s\n", p->kickshifter ? "true" : "false");
+ cfgfile_write (f, "cart=%s\n", p->cartident);
+ //cfgfile_write (f, "cart_internal=%s\n", cartsmode[p->cart_internal]);
+ if (p->amaxromfile[0]) {
+ str = cfgfile_subst_path (p->path_rom, UNEXPANDED, p->amaxromfile);
+ cfgfile_write (f, "amax_rom_file=%s\n", str);
+ free (str);
+ }
+
+ cfgfile_write (f, "kickshifter=%s\n", p->kickshifter ? "true" : "false");
p->nr_floppies = 4;
for (i = 0; i < 4; i++) {
str = cfgfile_subst_path (p->path_floppy, UNEXPANDED, p->df[i]);
- cfgfile_dwrite (f, "floppy%d=%s\n", i, str);
+ cfgfile_write (f, "floppy%d=%s\n", i, str);
free (str);
cfgfile_dwrite (f, "floppy%dtype=%d\n", i, p->dfxtype[i]);
cfgfile_dwrite (f, "floppy%dsound=%d\n", i, p->dfxclick[i]);
cfgfile_dwrite (f, "diskimage%d=%s\n", i, p->dfxlist[i]);
}
- cfgfile_dwrite (f, "nr_floppies=%d\n", p->nr_floppies);
- cfgfile_dwrite (f, "floppy_speed=%d\n", p->floppy_speed);
- cfgfile_dwrite (f, "floppy_volume=%d\n", p->dfxclickvolume);
- cfgfile_dwrite (f, "parallel_on_demand=%s\n", p->parallel_demand ? "true" : "false");
- cfgfile_dwrite (f, "serial_on_demand=%s\n", p->serial_demand ? "true" : "false");
- cfgfile_dwrite (f, "serial_hardware_ctsrts=%s\n", p->serial_hwctsrts ? "true" : "false");
- cfgfile_dwrite (f, "serial_direct=%s\n", p->serial_direct ? "true" : "false");
- cfgfile_dwrite (f, "scsi=%s\n", scsimode[p->scsi]);
- cfgfile_dwrite (f, "uaeserial=%s\n", p->uaeserial ? "true" : "false");
- cfgfile_dwrite (f, "sana2=%s\n", p->sana2[0] ? p->sana2 : "none");
-
- cfgfile_dwrite (f, "sound_output=%s\n", soundmode1[p->produce_sound]);
- cfgfile_dwrite (f, "sound_bits=%d\n", p->sound_bits);
- cfgfile_dwrite (f, "sound_channels=%s\n", stereomode[p->sound_stereo]);
- cfgfile_dwrite (f, "sound_stereo_separation=%d\n", p->sound_stereo_separation);
- cfgfile_dwrite (f, "sound_stereo_mixing_delay=%d\n", p->sound_mixed_stereo_delay >= 0 ? p->sound_mixed_stereo_delay : 0);
- cfgfile_dwrite (f, "sound_max_buff=%d\n", p->sound_maxbsiz);
- cfgfile_dwrite (f, "sound_frequency=%d\n", p->sound_freq);
- cfgfile_dwrite (f, "sound_latency=%d\n", p->sound_latency);
- cfgfile_dwrite (f, "sound_interpol=%s\n", interpolmode[p->sound_interpol]);
- cfgfile_dwrite (f, "sound_filter=%s\n", soundfiltermode1[p->sound_filter]);
- cfgfile_dwrite (f, "sound_filter_type=%s\n", soundfiltermode2[p->sound_filter_type]);
- cfgfile_dwrite (f, "sound_volume=%d\n", p->sound_volume);
- cfgfile_dwrite (f, "sound_auto=%s\n", p->sound_auto ? "yes" : "no");
- cfgfile_dwrite (f, "sound_stereo_swap_paula=%s\n", p->sound_stereo_swap_paula ? "yes" : "no");
- cfgfile_dwrite (f, "sound_stereo_swap_ahi=%s\n", p->sound_stereo_swap_ahi ? "yes" : "no");
-
- cfgfile_dwrite (f, "comp_trustbyte=%s\n", compmode[p->comptrustbyte]);
- cfgfile_dwrite (f, "comp_trustword=%s\n", compmode[p->comptrustword]);
- cfgfile_dwrite (f, "comp_trustlong=%s\n", compmode[p->comptrustlong]);
- cfgfile_dwrite (f, "comp_trustnaddr=%s\n", compmode[p->comptrustnaddr]);
- cfgfile_dwrite (f, "comp_nf=%s\n", p->compnf ? "true" : "false");
- cfgfile_dwrite (f, "comp_constjump=%s\n", p->comp_constjump ? "true" : "false");
- cfgfile_dwrite (f, "comp_oldsegv=%s\n", p->comp_oldsegv ? "true" : "false");
-
- cfgfile_dwrite (f, "comp_flushmode=%s\n", flushmode[p->comp_hardflush]);
- cfgfile_dwrite (f, "compforcesettings=%s\n", p->compforcesettings ? "true" : "false");
- cfgfile_dwrite (f, "compfpu=%s\n", p->compfpu ? "true" : "false");
- cfgfile_dwrite (f, "fpu_strict=%s\n", p->fpu_strict ? "true" : "false");
- cfgfile_dwrite (f, "comp_midopt=%s\n", p->comp_midopt ? "true" : "false");
- cfgfile_dwrite (f, "comp_lowopt=%s\n", p->comp_lowopt ? "true" : "false");
- cfgfile_dwrite (f, "avoid_cmov=%s\n", p->avoid_cmov ? "true" : "false" );
- cfgfile_dwrite (f, "avoid_dga=%s\n", p->avoid_dga ? "true" : "false" );
- cfgfile_dwrite (f, "avoid_vid=%s\n", p->avoid_vid ? "true" : "false" );
- cfgfile_dwrite (f, "cachesize=%d\n", p->cachesize);
+ cfgfile_write (f, "nr_floppies=%d\n", p->nr_floppies);
+ cfgfile_write (f, "floppy_speed=%d\n", p->floppy_speed);
+ cfgfile_write (f, "floppy_volume=%d\n", p->dfxclickvolume);
+ cfgfile_write (f, "parallel_on_demand=%s\n", p->parallel_demand ? "true" : "false");
+ cfgfile_write (f, "serial_on_demand=%s\n", p->serial_demand ? "true" : "false");
+ cfgfile_write (f, "serial_hardware_ctsrts=%s\n", p->serial_hwctsrts ? "true" : "false");
+ cfgfile_write (f, "serial_direct=%s\n", p->serial_direct ? "true" : "false");
+ cfgfile_write (f, "scsi=%s\n", scsimode[p->scsi]);
+ cfgfile_write (f, "uaeserial=%s\n", p->uaeserial ? "true" : "false");
+ cfgfile_write (f, "sana2=%s\n", p->sana2[0] ? p->sana2 : "none");
+
+ cfgfile_write (f, "sound_output=%s\n", soundmode1[p->produce_sound]);
+ cfgfile_write (f, "sound_bits=%d\n", p->sound_bits);
+ cfgfile_write (f, "sound_channels=%s\n", stereomode[p->sound_stereo]);
+ cfgfile_write (f, "sound_stereo_separation=%d\n", p->sound_stereo_separation);
+ cfgfile_write (f, "sound_stereo_mixing_delay=%d\n", p->sound_mixed_stereo_delay >= 0 ? p->sound_mixed_stereo_delay : 0);
+ cfgfile_write (f, "sound_max_buff=%d\n", p->sound_maxbsiz);
+ cfgfile_write (f, "sound_frequency=%d\n", p->sound_freq);
+ cfgfile_write (f, "sound_latency=%d\n", p->sound_latency);
+ cfgfile_write (f, "sound_interpol=%s\n", interpolmode[p->sound_interpol]);
+ cfgfile_write (f, "sound_filter=%s\n", soundfiltermode1[p->sound_filter]);
+ cfgfile_write (f, "sound_filter_type=%s\n", soundfiltermode2[p->sound_filter_type]);
+ cfgfile_write (f, "sound_volume=%d\n", p->sound_volume);
+ cfgfile_write (f, "sound_auto=%s\n", p->sound_auto ? "yes" : "no");
+ cfgfile_write (f, "sound_stereo_swap_paula=%s\n", p->sound_stereo_swap_paula ? "yes" : "no");
+ cfgfile_write (f, "sound_stereo_swap_ahi=%s\n", p->sound_stereo_swap_ahi ? "yes" : "no");
+
+ cfgfile_write (f, "comp_trustbyte=%s\n", compmode[p->comptrustbyte]);
+ cfgfile_write (f, "comp_trustword=%s\n", compmode[p->comptrustword]);
+ cfgfile_write (f, "comp_trustlong=%s\n", compmode[p->comptrustlong]);
+ cfgfile_write (f, "comp_trustnaddr=%s\n", compmode[p->comptrustnaddr]);
+ cfgfile_write (f, "comp_nf=%s\n", p->compnf ? "true" : "false");
+ cfgfile_write (f, "comp_constjump=%s\n", p->comp_constjump ? "true" : "false");
+ cfgfile_write (f, "comp_oldsegv=%s\n", p->comp_oldsegv ? "true" : "false");
+
+ cfgfile_write (f, "comp_flushmode=%s\n", flushmode[p->comp_hardflush]);
+ cfgfile_write (f, "compforcesettings=%s\n", p->compforcesettings ? "true" : "false");
+ cfgfile_write (f, "compfpu=%s\n", p->compfpu ? "true" : "false");
+ cfgfile_write (f, "fpu_strict=%s\n", p->fpu_strict ? "true" : "false");
+ cfgfile_write (f, "comp_midopt=%s\n", p->comp_midopt ? "true" : "false");
+ cfgfile_write (f, "comp_lowopt=%s\n", p->comp_lowopt ? "true" : "false");
+ cfgfile_write (f, "avoid_cmov=%s\n", p->avoid_cmov ? "true" : "false" );
+ cfgfile_write (f, "avoid_dga=%s\n", p->avoid_dga ? "true" : "false" );
+ cfgfile_write (f, "avoid_vid=%s\n", p->avoid_vid ? "true" : "false" );
+ cfgfile_write (f, "cachesize=%d\n", p->cachesize);
if (p->override_dga_address)
- cfgfile_dwrite (f, "override_dga_address=0x%08x\n", p->override_dga_address);
+ cfgfile_write (f, "override_dga_address=0x%08x\n", p->override_dga_address);
for (i = 0; i < 2; i++) {
int v = i == 0 ? p->jport0 : p->jport1;
sprintf (tmp2, "mouse%d", v - JSEM_MICE);
}
sprintf (tmp1, "joyport%d=%s\n", i, tmp2);
- cfgfile_dwrite (f, tmp1);
+ cfgfile_write (f, tmp1);
}
- cfgfile_dwrite (f, "bsdsocket_emu=%s\n", p->socket_emu ? "true" : "false");
+ cfgfile_write (f, "bsdsocket_emu=%s\n", p->socket_emu ? "true" : "false");
- cfgfile_dwrite (f, "synchronize_clock=%s\n", p->tod_hack ? "yes" : "no");
- cfgfile_dwrite (f, "maprom=0x%x\n", p->maprom);
- cfgfile_dwrite (f, "parallel_postscript_emulation=%s\n", p->parallel_postscript_emulation ? "yes" : "no");
- cfgfile_dwrite (f, "parallel_postscript_detection=%s\n", p->parallel_postscript_detection ? "yes" : "no");
- cfgfile_dwrite (f, "ghostscript_parameters=%s\n", p->ghostscript_parameters);
- cfgfile_dwrite (f, "parallel_autoflush=%d\n", p->parallel_autoflush_time);
+ cfgfile_write (f, "synchronize_clock=%s\n", p->tod_hack ? "yes" : "no");
+ cfgfile_write (f, "maprom=0x%x\n", p->maprom);
+ cfgfile_write (f, "parallel_postscript_emulation=%s\n", p->parallel_postscript_emulation ? "yes" : "no");
+ cfgfile_write (f, "parallel_postscript_detection=%s\n", p->parallel_postscript_detection ? "yes" : "no");
+ cfgfile_write (f, "ghostscript_parameters=%s\n", p->ghostscript_parameters);
+ cfgfile_write (f, "parallel_autoflush=%d\n", p->parallel_autoflush_time);
cfgfile_dwrite (f, "gfx_display=%d\n", p->gfx_display);
cfgfile_dwrite (f, "gfx_framerate=%d\n", p->gfx_framerate);
cfgfile_dwrite (f, "gfx_gamma=%d\n", p->gfx_gamma);
#endif
- cfgfile_dwrite (f, "immediate_blits=%s\n", p->immediate_blits ? "true" : "false");
- cfgfile_dwrite (f, "ntsc=%s\n", p->ntscmode ? "true" : "false");
- cfgfile_dwrite (f, "genlock=%s\n", p->genlock ? "true" : "false");
+ cfgfile_write (f, "immediate_blits=%s\n", p->immediate_blits ? "true" : "false");
+ cfgfile_write (f, "ntsc=%s\n", p->ntscmode ? "true" : "false");
+ cfgfile_write (f, "genlock=%s\n", p->genlock ? "true" : "false");
cfgfile_dwrite (f, "show_leds=%s\n", p->leds_on_screen ? "true" : "false");
cfgfile_dwrite (f, "keyboard_leds=numlock:%s,capslock:%s,scrolllock:%s\n",
kbleds[p->keyboard_leds[0]], kbleds[p->keyboard_leds[1]], kbleds[p->keyboard_leds[2]]);
cfgfile_dwrite (f, "chipset=ecs_denise\n");
else
cfgfile_dwrite (f, "chipset=ocs\n");
- cfgfile_dwrite (f, "chipset_refreshrate=%d\n", p->chipset_refreshrate);
- cfgfile_dwrite (f, "collision_level=%s\n", collmode[p->collision_level]);
+ cfgfile_write (f, "chipset_refreshrate=%d\n", p->chipset_refreshrate);
+ cfgfile_write (f, "collision_level=%s\n", collmode[p->collision_level]);
- cfgfile_dwrite (f, "chipset_compatible=%s\n", cscompa[p->cs_compatible]);
+ cfgfile_write (f, "chipset_compatible=%s\n", cscompa[p->cs_compatible]);
cfgfile_dwrite (f, "ciaatod=%s\n", ciaatodmode[p->cs_ciaatod]);
cfgfile_dwrite (f, "rtc=%s\n", rtctype[p->cs_rtc]);
//cfgfile_dwrite (f, "chipset_rtc_adjust=%d\n", p->cs_rtc_adjust);
cfgfile_dwrite (f, "scsi_a3000=%s\n", p->cs_mbdmac == 1 ? "true" : "false");
cfgfile_dwrite (f, "scsi_a4000t=%s\n", p->cs_mbdmac == 2 ? "true" : "false");
- cfgfile_dwrite (f, "fastmem_size=%d\n", p->fastmem_size / 0x100000);
- cfgfile_dwrite (f, "a3000mem_size=%d\n", p->mbresmem_low_size / 0x100000);
- cfgfile_dwrite (f, "mbresmem_size=%d\n", p->mbresmem_high_size / 0x100000);
- cfgfile_dwrite (f, "z3mem_size=%d\n", p->z3fastmem_size / 0x100000);
- cfgfile_dwrite (f, "z3mem_start=0x%x\n", p->z3fastmem_start);
- cfgfile_dwrite (f, "bogomem_size=%d\n", p->bogomem_size / 0x40000);
- cfgfile_dwrite (f, "gfxcard_size=%d\n", p->gfxmem_size / 0x100000);
- cfgfile_dwrite (f, "chipmem_size=%d\n", (p->chipmem_size == 0x40000) ? 0 : p->chipmem_size / 0x80000);
+ cfgfile_write (f, "fastmem_size=%d\n", p->fastmem_size / 0x100000);
+ cfgfile_write (f, "a3000mem_size=%d\n", p->mbresmem_low_size / 0x100000);
+ cfgfile_write (f, "mbresmem_size=%d\n", p->mbresmem_high_size / 0x100000);
+ cfgfile_write (f, "z3mem_size=%d\n", p->z3fastmem_size / 0x100000);
+ cfgfile_write (f, "z3mem_start=0x%x\n", p->z3fastmem_start);
+ cfgfile_write (f, "bogomem_size=%d\n", p->bogomem_size / 0x40000);
+ cfgfile_write (f, "gfxcard_size=%d\n", p->gfxmem_size / 0x100000);
+ cfgfile_write (f, "chipmem_size=%d\n", (p->chipmem_size == 0x40000) ? 0 : p->chipmem_size / 0x80000);
if (p->m68k_speed > 0)
- cfgfile_dwrite (f, "finegrain_cpu_speed=%d\n", p->m68k_speed);
+ cfgfile_write (f, "finegrain_cpu_speed=%d\n", p->m68k_speed);
else
- cfgfile_dwrite (f, "cpu_speed=%s\n", p->m68k_speed == -1 ? "max" : "real");
+ cfgfile_write (f, "cpu_speed=%s\n", p->m68k_speed == -1 ? "max" : "real");
/* do not reorder start */
write_compatibility_cpu(f, p);
- cfgfile_dwrite (f, "cpu_model=%d\n", p->cpu_model);
+ cfgfile_write (f, "cpu_model=%d\n", p->cpu_model);
if (p->fpu_model)
- cfgfile_dwrite (f, "fpu_model=%d\n", p->fpu_model);
- cfgfile_dwrite (f, "cpu_compatible=%s\n", p->cpu_compatible ? "true" : "false");
- cfgfile_dwrite (f, "cpu_24bit_addressing=%s\n", p->address_space_24 ? "true" : "false");
+ cfgfile_write (f, "fpu_model=%d\n", p->fpu_model);
+ cfgfile_write (f, "cpu_compatible=%s\n", p->cpu_compatible ? "true" : "false");
+ cfgfile_write (f, "cpu_24bit_addressing=%s\n", p->address_space_24 ? "true" : "false");
/* do not reorder end */
- cfgfile_dwrite (f, "cpu_cycle_exact=%s\n", p->cpu_cycle_exact ? "true" : "false");
- cfgfile_dwrite (f, "blitter_cycle_exact=%s\n", p->blitter_cycle_exact ? "true" : "false");
- cfgfile_dwrite (f, "rtg_nocustom=%s\n", p->picasso96_nocustom ? "true" : "false");
+ cfgfile_write (f, "cpu_cycle_exact=%s\n", p->cpu_cycle_exact ? "true" : "false");
+ cfgfile_write (f, "blitter_cycle_exact=%s\n", p->blitter_cycle_exact ? "true" : "false");
+ cfgfile_write (f, "rtg_nocustom=%s\n", p->picasso96_nocustom ? "true" : "false");
- cfgfile_dwrite (f, "log_illegal_mem=%s\n", p->illegal_mem ? "true" : "false");
+ cfgfile_write (f, "log_illegal_mem=%s\n", p->illegal_mem ? "true" : "false");
if (p->catweasel >= 100)
cfgfile_dwrite (f, "catweasel=0x%x\n", p->catweasel);
else
cfgfile_dwrite (f, "catweasel=%d\n", p->catweasel);
- cfgfile_dwrite (f, "kbd_lang=%s\n", (p->keyboard_lang == KBD_LANG_DE ? "de"
+ cfgfile_write (f, "kbd_lang=%s\n", (p->keyboard_lang == KBD_LANG_DE ? "de"
: p->keyboard_lang == KBD_LANG_DK ? "dk"
: p->keyboard_lang == KBD_LANG_ES ? "es"
: p->keyboard_lang == KBD_LANG_US ? "us"
#ifdef FILESYS
write_filesys_config (p, UNEXPANDED, p->path_hardfile, f);
if (p->filesys_no_uaefsdb)
- cfgfile_dwrite (f, "filesys_no_fsdb=%s\n", p->filesys_no_uaefsdb ? "true" : "false");
+ cfgfile_write (f, "filesys_no_fsdb=%s\n", p->filesys_no_uaefsdb ? "true" : "false");
#endif
write_inputdevice_config (p, f);
uci->autoboot = 0;
if (bootpri < -128)
uci->donotmount = 1;
- else if (bootpri > -127)
+ else if (bootpri >= -127)
uci->autoboot = 1;
uci->controller = hdc;
strcpy (uci->filesys, filesysdir ? filesysdir : "");
if (cfgfile_string (option, value, "kickstart_rom_file", p->romfile, sizeof p->romfile)
|| cfgfile_string (option, value, "kickstart_ext_rom_file", p->romextfile, sizeof p->romextfile)
+ || cfgfile_string (option, value, "amax_rom_file", p->amaxromfile, sizeof p->amaxromfile)
|| cfgfile_string (option, value, "sana2", p->sana2, sizeof p->sana2)
|| cfgfile_string (option, value, "flash_file", p->flashfile, sizeof p->flashfile)
|| cfgfile_string (option, value, "cart_file", p->cartfile, sizeof p->cartfile)
strcpy (p->romextfile, "");
strcpy (p->flashfile, "");
strcpy (p->cartfile, "");
+ strcpy (p->amaxromfile, "");
p->prtname[0] = 0;
p->sername[0] = 0;
ciaapra = (ciaapra & ~0xc3) | (val & 0xc3);
bfe001_change ();
handle_cd32_joystick_cia (ciaapra, ciaadra);
+#ifdef AMAX
+ if (currprefs.amaxromfile[0])
+ amax_bfe001_write (val, ciaadra);
+#endif
break;
case 1:
#ifdef DONGLE_DEBUG
static void INTREQ_d (uae_u16 v, int d)
{
intreqr = intreq;
- setclr (&intreqr, v); /* data in intreq is immediately available */
+ /* data in intreq is immediately available (vsync only currently because there is something unknown..) */
+ setclr (&intreqr, v & (0x8000 | 0x20));
if (!use_eventmode() || v == 0)
INTREQ_f(v);
else
*p1++ = get_byte (i);
addr = end - 1;
}
- console_out("deep trainer first pass complete.\n");
+ console_out("Deep trainer first pass complete.\n");
return;
}
inconly = deconly = 0;
}
val = readint (c);
if (first) {
- ignore_ws (c);
if (val > 255)
size = 2;
if (val > 65535)
size = 3;
if (val > 16777215)
size = 4;
- if (more_params(c))
- size = readint(c);
}
+ ignore_ws (c);
+ if (more_params(c))
+ size = readint(c);
if (size > 4)
size = 4;
if (size < 1)
while ((addr = nextaddr(addr, &end)) != 0xffffffff) {
if (addr + size < end) {
for (i = 0; i < size; i++) {
- if (get_byte (addr + i) != val >> ((size - i - 1) << 8))
+ int shift = (size - i - 1) * 8;
+ if (get_byte (addr + i) != ((val >> shift) & 0xff))
break;
}
if (i == size) {
vlist[prevmemcnt >> 3] &= ~(1 << (prevmemcnt & 7));
prevmemcnt++;
}
- listcheater(0, size);
+ listcheater (0, size);
}
console_out ("Found %d possible addresses with 0x%X (%u) (%d bytes)\n", count, val, val, size);
- console_out ("Now continue with 'g' and use 'C' with a different value\n");
+ if (count > 0)
+ console_out ("Now continue with 'g' and use 'C' with a different value\n");
first = 0;
}
#endif
#include "crc32.h"
#include "inputdevice.h"
+#include "amax.h"
#undef CATWEASEL
catweasel_drive *catweasel;
#else
int catweasel;
+ int amax;
#endif
} drive;
gui_data.drive_disabled[i] = 1;
}
+static void setamax(void)
+{
+#ifdef AMAX
+ if (currprefs.amaxromfile[0]) {
+ /* Put A-Max as last drive in drive chain */
+ int j;
+ for (j = 0; j < MAX_FLOPPY_DRIVES; j++)
+ if (floppy[j].amax)
+ return;
+ for (j = 0; j < MAX_FLOPPY_DRIVES; j++) {
+ if ((1 << j) & disabled) {
+ floppy[j].amax = 1;
+ write_log ("AMAX: drive %d\n", j);
+ return;
+ }
+ }
+ }
+#endif
+}
+
static void reset_drive(int i)
{
drive *drv = &floppy[i];
+
+ drv->amax = 0;
drive_image_free (drv);
drv->motoroff = 1;
disabled &= ~(1 << i);
if (disk_debug_logging > 1)
write_log ("%08.8X %02.2X %s drvmask=%x", M68K_GETPC, data, tobin(data), selected ^ 15);
+#ifdef AMAX
+ if (currprefs.amaxromfile[0])
+ amax_disk_select (data, prevdata);
+#endif
+
if ((prevdata & 0x80) != (data & 0x80)) {
for (dr = 0; dr < 4; dr++) {
if (floppy[dr].indexhackmode > 1 && !(selected & (1 << dr))) {
for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) {
drive *drv = floppy + dr;
- if (!((selected | disabled) & (1 << dr))) {
+ if (drv->amax) {
+ st = amax_disk_status ();
+ } else if (!((selected | disabled) & (1 << dr))) {
if (drive_running (drv)) {
if (drv->catweasel) {
#ifdef CATWEASEL
}
} else if (!(selected & (1 << dr))) {
if (drv->idbit)
- st &= ~0x20;
+ st &= ~0x20;
}
}
return st;
if (!bitoffset) {
for (dr = 0; dr < MAX_FLOPPY_DRIVES ; dr++) {
drive *drv2 = &floppy[dr];
+ uae_u16 w = get_word (dskpt);
if (drives[dr])
- drv2->bigmfmbuf[drv2->mfmpos >> 4] = get_word (dskpt);
+ drv2->bigmfmbuf[drv2->mfmpos >> 4] = w;
+#ifdef AMAX
+ if (currprefs.amaxromfile[0])
+ amax_diskwrite (w);
+#endif
}
dskpt += 2;
dsklength--;
break;
}
if (dr == 4) {
- write_log ("disk %s DMA started, drvmask=%x motormask=%x\n",
- dskdmaen == 3 ? "write" : "read", selected ^ 15, motormask);
+ write_log ("disk %s DMA started, drvmask=%x motormask=%x\n",
+ dskdmaen == 3 ? "write" : "read", selected ^ 15, motormask);
noselected = 1;
} else {
if (disk_debug_logging > 0) {
} else if (dskdmaen == 3) { /* TURBO write */
for (i = 0; i < dsklength; i++) {
- drv->bigmfmbuf[pos >> 4] = get_word (dskpt + i * 2);
+ uae_u16 w = get_word (dskpt + i * 2);
+ drv->bigmfmbuf[pos >> 4] = w;
+#ifdef AMAX
+ if (currprefs.amaxromfile[0])
+ amax_diskwrite (w);
+#endif
pos += 16;
pos %= drv->tracklen;
}
}
if (!done && noselected) {
while (dsklength-- > 0) {
- put_word (dskpt, 0);
+ if (dskdmaen == 3) {
+ uae_u16 w = get_word (dskpt);
+#ifdef AMAX
+ if (currprefs.amaxromfile[0])
+ amax_diskwrite (w);
+#endif
+ } else {
+ put_word (dskpt, 0);
+ }
dskpt += 2;
}
INTREQ_f (0x8000 | 0x1000);
}
if (disk_empty (0))
write_log ("No disk in drive 0.\n");
+ amax_init ();
}
void DISK_reset (void)
disabled = 0;
for (i = 0; i < MAX_FLOPPY_DRIVES; i++)
reset_drive (i);
+ setamax ();
}
int DISK_examine_image (struct uae_prefs *p, int num, uae_u32 *crc32)
dskbytr_val = pdskbytr;
}
+void restore_disk_finish (void)
+{
+ setamax();
+}
+
uae_u8 *restore_disk(int num,uae_u8 *src)
{
drive *drv;
if (enforcer_hit)
return; /* our function itself generated a hit ;), avoid endless loop */
- if (regs.vbr < 0x100 && addr >= 0x0c && addr < 0x78)
+ if (regs.vbr < 0x100 && addr >= 0x0c && addr < 0x80)
return;
enforcer_hit = 1;
return 1;
if (currprefs.scsi == 1)
return 1;
- if (currprefs.sana2)
+ if (currprefs.sana2[0])
return 1;
if (currprefs.win32_outsidemouse)
return 1;
--- /dev/null
+
+void amax_diskwrite (uae_u16 w);
+void amax_bfe001_write (uae_u8 pra, uae_u8 dra);
+uae_u8 amax_disk_status (void);
+void amax_disk_select (uae_u8 v, uae_u8 ov);
+void amax_reset (void);
+void amax_init (void);
\ No newline at end of file
char pci_devices[256];
char prtname[256];
char sername[256];
+ char amaxromfile[MAX_DPATH];
char path_floppy[256];
char path_hardfile[256];
extern uae_u8 *save_floppy (int *len, uae_u8 *);
extern void DISK_save_custom (uae_u32 *pdskpt, uae_u16 *pdsklen, uae_u16 *pdsksync, uae_u16 *pdskbytr);
extern void DISK_restore_custom (uae_u32 pdskpt, uae_u16 pdsklength, uae_u16 pdskbytr);
+extern void restore_disk_finish (void);
extern uae_u8 *restore_custom (uae_u8 *);
extern uae_u8 *save_custom (int *, uae_u8 *, int);
static void out_config (struct zfile *f, int id, int num, char *s1, char *s2)
{
- cfgfile_dwrite (f, "input.%d.%s%d=%s\n", id, s1, num, s2);
- //write_log ("-input.%d.%s%d=%s\n", id, s1, num, s2);
+ cfgfile_write (f, "input.%d.%s%d=%s\n", id, s1, num, s2);
}
static void write_config2 (struct zfile *f, int idnum, int i, int offset, char *tmp1, struct uae_input_device *id)
if (!isdevice (id))
return;
- cfgfile_dwrite (f, "input.%d.%s.%d.disabled=%d\n", idnum, name, devnum, id->enabled ? 0 : 1);
+ cfgfile_write (f, "input.%d.%s.%d.disabled=%d\n", idnum, name, devnum, id->enabled ? 0 : 1);
sprintf (tmp1, "%s.%d.axis.", name, devnum);
for (i = 0; i < ID_AXIS_TOTAL; i++)
write_config2 (f, idnum, i, ID_AXIS_OFFSET, tmp1, id);
sprintf (tmp3, "%d", kbr->extra[i][0]);
kbrlabel (tmp3);
sprintf (tmp1, "keyboard.%d.button.%s", devnum, tmp3);
- cfgfile_dwrite (f, "input.%d.%s=%s\n", idnum, tmp1, tmp2[0] ? tmp2 : "NULL");
+ cfgfile_write (f, "input.%d.%s=%s\n", idnum, tmp1, tmp2[0] ? tmp2 : "NULL");
i++;
}
}
{
int i, id;
- cfgfile_dwrite (f, "input.config=%d\n", p->input_selected_setting);
- cfgfile_dwrite (f, "input.joymouse_speed_analog=%d\n", p->input_joymouse_multiplier);
- cfgfile_dwrite (f, "input.joymouse_speed_digital=%d\n", p->input_joymouse_speed);
- cfgfile_dwrite (f, "input.joymouse_deadzone=%d\n", p->input_joymouse_deadzone);
- cfgfile_dwrite (f, "input.joystick_deadzone=%d\n", p->input_joystick_deadzone);
- cfgfile_dwrite (f, "input.mouse_speed=%d\n", p->input_mouse_speed);
- cfgfile_dwrite (f, "input.autofire=%d\n", p->input_autofire_framecnt);
+ cfgfile_write (f, "input.config=%d\n", p->input_selected_setting);
+ cfgfile_write (f, "input.joymouse_speed_analog=%d\n", p->input_joymouse_multiplier);
+ cfgfile_write (f, "input.joymouse_speed_digital=%d\n", p->input_joymouse_speed);
+ cfgfile_write (f, "input.joymouse_deadzone=%d\n", p->input_joymouse_deadzone);
+ cfgfile_write (f, "input.joystick_deadzone=%d\n", p->input_joystick_deadzone);
+ cfgfile_write (f, "input.mouse_speed=%d\n", p->input_mouse_speed);
+ cfgfile_write (f, "input.autofire=%d\n", p->input_autofire_framecnt);
for (id = 1; id <= MAX_INPUT_SETTINGS; id++) {
for (i = 0; i < MAX_INPUT_DEVICES; i++)
write_config (f, id, i, "joystick", &p->joystick_settings[id][i], &joysticks2[i]);
int buttonmappings[MAX_MAPPINGS];
char *buttonname[MAX_MAPPINGS];
int buttonsort[MAX_MAPPINGS];
+
+ int axisparent[MAX_MAPPINGS];
+ int axisparentdir[MAX_MAPPINGS];
};
#define DI_BUFFER 30
return 0;
}
+static void fixbuttons (struct didata *did)
+{
+ if (did->buttons > 0)
+ return;
+ write_log ("'%s' has no buttons, adding single default button\n", did->name);
+ did->buttonmappings[0] = DIJOFS_BUTTON(0);
+ did->buttonsort[0] = 0;
+ did->buttonname[0] = my_strdup("Button");
+ did->buttons++;
+}
+
+#define AXISBUTTON 0x20000
+#define AXISBUTTON_2 0x10000
+
+static void fixthings (struct didata *did)
+{
+ int i, j;
+ char tmp[256];
+
+ for (i = 0; i < did->axles; i++) {
+ if (did->buttons + 1 >= MAX_MAPPINGS)
+ break;
+ for (j = 0; j < 2; j++) {
+ sprintf (tmp, "%s [%c]", did->axisname[i], j ? '+' : '-');
+ did->buttonname[did->buttons] = my_strdup (tmp);
+ did->buttonmappings[did->buttons] = did->axismappings[i];
+ did->buttonsort[did->buttons] = 1000 + (did->axismappings[i] + did->axistype[i]) * 2 + j;
+ did->axisparent[did->buttons] = i;
+ did->axisparentdir[did->buttons] = j;
+ did->buttons++;
+ }
+ }
+}
+
typedef BOOL (CALLBACK* REGISTERRAWINPUTDEVICES)
(PCRAWINPUTDEVICE, UINT, UINT);
static REGISTERRAWINPUTDEVICES pRegisterRawInputDevices;
for (i = 0; i < MAX_MAPPINGS; i++) {
did->axismappings[i] = -1;
did->buttonmappings[i] = -1;
+ did->axisparent[i] = -1;
}
}
did->sortname = my_strdup (tmp);
did->buttons = 3;
did->axles = 2;
- did->axistype[0] = 1;
did->axissort[0] = 0;
did->axisname[0] = my_strdup ("X-Axis");
- did->axistype[1] = 1;
did->axissort[1] = 1;
did->axisname[1] = my_strdup ("Y-Axis");
for (j = 0; j < did->buttons; j++) {
did->sortname = my_strdup (tmp);
did->buttons = (catweasel_isjoystick() & 0x80) ? 3 : 1;
did->axles = 2;
- did->axistype[0] = 1;
did->axissort[0] = 0;
did->axisname[0] = my_strdup ("X-Axis");
- did->axistype[1] = 1;
did->axissort[1] = 1;
did->axisname[1] = my_strdup ("Y-Axis");
for (j = 0; j < did->buttons; j++) {
did->buttonname[j] = my_strdup (tmp);
}
did->priority = -1;
+ fixbuttons (did);
+ fixthings (did);
num_joystick++;
}
}
rdim->dwId, rdim->dwNumberOfButtons, rdim->fHasHorizontalWheel, rdim->dwSampleRate);
did->buttons = rdim->dwNumberOfButtons;
did->axles = 3;
- did->axistype[0] = 1;
did->axissort[0] = 0;
did->axisname[0] = my_strdup ("X-Axis");
- did->axistype[1] = 1;
did->axissort[1] = 1;
did->axisname[1] = my_strdup ("Y-Axis");
- did->axistype[2] = 1;
did->axissort[2] = 2;
did->axisname[2] = my_strdup ("Wheel");
if (rdim->fHasHorizontalWheel) {
- did->axistype[3] = 1;
did->axissort[3] = 3;
did->axisname[3] = my_strdup ("HWheel");
did->axles++;
if (did->buttons > 3 && !os_winnt)
did->buttons = 3; /* Windows 98/ME support max 3 non-DI buttons */
did->axles = os_vista ? 4 : 3;
- did->axistype[0] = 1;
did->axissort[0] = 0;
did->axisname[0] = my_strdup ("X-Axis");
- did->axistype[1] = 1;
did->axissort[1] = 1;
did->axisname[1] = my_strdup ("Y-Axis");
if (did->axles > 2) {
- did->axistype[2] = 1;
did->axissort[2] = 2;
did->axisname[2] = my_strdup ("Wheel");
}
if (did->axles > 3) {
- did->axistype[3] = 1;
did->axissort[3] = 3;
did->axisname[3] = my_strdup ("HWheel");
}
}
-static void fixbuttons (struct didata *did)
-{
- if (did->buttons > 0)
- return;
- write_log ("'%s' has no buttons, adding single default button\n", did->name);
- did->buttonmappings[0] = DIJOFS_BUTTON(0);
- did->buttonsort[0] = 0;
- did->buttonname[0] = my_strdup("Button");
- did->buttons++;
-}
-
static void sortobjects (struct didata *did, int *mappings, int *sort, char **names, int *types, int num)
{
int i, j, tmpi;
sprintf (tmp, "%s (%d)", pdidoi->tszName, i + 1);
did->axisname[did->axles + i] = my_strdup (tmp);
did->axissort[did->axles + i] = did->axissort[did->axles];
- did->axistype[did->axles + i] = 1;
+ did->axistype[did->axles + i] = i + 1;
}
did->axles += 2;
}
data -= 32768;
for (k = 0; k < did->buttons; k++) {
- if (did->buttonmappings[k] == dimofs) {
+
+ if (did->axisparent >= 0 && did->buttonmappings[k] == dimofs) {
+ int bstate = 0;
+ int axis = did->axisparent[k];
+ int dir = did->axisparentdir[k];
+
+ if (did->axistype[axis] == 1) {
+ if (!dir)
+ bstate = (data2 >= 20250 && data2 <= 33750) ? 1 : 0;
+ else
+ bstate = (data2 >= 2250 && data2 <= 15750) ? 1 : 0;
+ } else if (did->axistype[axis] == 2) {
+ if (!dir)
+ bstate = ((data2 >= 29250 && data2 <= 33750) || (data2 >= 0 && data2 <= 6750)) ? 1 : 0;
+ else
+ bstate = (data2 >= 11250 && data2 <= 24750) ? 1 : 0;
+ } else if (did->axistype[axis] == 0) {
+ if (dir)
+ bstate = data > 20000 ? 1 : 0;
+ else
+ bstate = data < -20000 ? 1 : 0;
+ }
+ setjoybuttonstate (i, k, bstate);
+#ifdef DI_DEBUG2
+ write_log ("AB:NUM=%d OFF=%d AXIS=%d DIR=%d NAME=%s VAL=%d STATE=%d\n",
+ k, dimofs, axis, dir, did->buttonname[k], data, state);
+#endif
+
+ } else if (did->buttonmappings[k] == dimofs) {
#ifdef DI_DEBUG2
write_log ("B:NUM=%d OFF=%d NAME=%s VAL=%d STATE=%d\n",
k, dimofs, did->buttonname[k], data, state);
#endif
setjoybuttonstate (i, k, state);
- break;
}
}
+
for (k = 0; k < did->axles; k++) {
if (did->axismappings[k] == dimofs) {
- if (did->axistype[k]) {
+ if (did->axistype[k] == 1) {
setjoystickstate (i, k, (data2 >= 20250 && data2 <= 33750) ? -1 : (data2 >= 2250 && data2 <= 15750) ? 1 : 0, 1);
- setjoystickstate (i, k + 1, ((data2 >= 29250 && data2 <= 33750) || (data2 >= 0 && data2 <= 6750)) ? -1 : (data2 >= 11250 && data2 <= 24750) ? 1 : 0, 1);
+ } else if (did->axistype[k] == 2) {
+ setjoystickstate (i, k, ((data2 >= 29250 && data2 <= 33750) || (data2 >= 0 && data2 <= 6750)) ? -1 : (data2 >= 11250 && data2 <= 24750) ? 1 : 0, 1);
#ifdef DI_DEBUG2
write_log ("P:NUM=%d OFF=%d NAME=%s VAL=%d\n", k, dimofs, did->axisname[k], data2);
#endif
- } else {
+ } else if (did->axistype[k] == 0) {
#ifdef DI_DEBUG2
if (data < -20000 || data > 20000)
write_log ("A:NUM=%d OFF=%d NAME=%s VAL=%d\n", k, dimofs, did->axisname[k], data);
#endif
setjoystickstate (i, k, data, 32768);
}
- break;
}
}
+
}
+
} else if (hr == DIERR_INPUTLOST) {
acquire (lpdi, "joystick");
} else if (did->acquired && hr == DIERR_NOTACQUIRED) {
did->lpdi = lpdi;
IDirectInputDevice8_EnumObjects (lpdi, EnumObjectsCallback, (void*)did, DIDFT_ALL);
fixbuttons (did);
+ fixthings (did);
sortobjects (did, did->axismappings, did->axissort, did->axisname, did->axistype, did->axles);
sortobjects (did, did->buttonmappings, did->buttonsort, did->buttonname, 0, did->buttons);
}
#define A2091 /* A590/A2091 SCSI */
#define NCR /* A4000T/A4091 SCSI */
#define SANA2 /* SANA2 network driver */
+#define AMAX /* A-Max ROM adapater emulation */
#else
int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
SETPROCESSDPIAWARE pSetProcessDPIAware;
+ DWORD_PTR sys_aff;
+
+ original_affinity = 1;
+ GetProcessAffinityMask (GetCurrentProcess(), &original_affinity, &sys_aff);
+#if 0
HANDLE thread;
thread = GetCurrentThread();
original_affinity = SetThreadAffinityMask(thread, 1);
-#if 0
CHANGEWINDOWMESSAGEFILTER pChangeWindowMessageFilter;
pChangeWindowMessageFilter = (CHANGEWINDOWMESSAGEFILTER)GetProcAddress(
GetModuleHandle("user32.dll"), "ChangeWindowMessageFilter");
WinMain2 (hInstance, hPrevInstance, lpCmdLine, nCmdShow);
} __except(WIN32_ExceptionFilter(GetExceptionInformation(), GetExceptionCode())) {
}
+#if 0
SetThreadAffinityMask(thread, original_affinity);
+#endif
return FALSE;
}
#define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
#define GETBDD(x) ((x) % 100)
-#define WINUAEBETA 2
+#define WINUAEBETA 3
#define WINUAEPUBLICBETA 1
-#define WINUAEDATE MAKEBD(2007, 10, 6)
+#define WINUAEDATE MAKEBD(2007, 10, 13)
#define WINUAEEXTRA ""
#define WINUAEREV ""
SetDlgItemText (hDlg, IDC_VOLUME_NAME, current_fsvdlg.volume);
SetDlgItemText (hDlg, IDC_VOLUME_DEVICE, current_fsvdlg.device);
SetDlgItemText (hDlg, IDC_PATH_NAME, current_fsvdlg.rootdir);
- SetDlgItemInt (hDlg, IDC_VOLUME_BOOTPRI, current_fsvdlg.bootpri, TRUE);
+ SetDlgItemInt (hDlg, IDC_VOLUME_BOOTPRI, current_fsvdlg.bootpri >= -127 ? current_fsvdlg.bootpri : -127, TRUE);
if (archivehd)
current_fsvdlg.rw = 0;
CheckDlgButton (hDlg, IDC_FS_RW, current_fsvdlg.rw);
CheckDlgButton (hDlg, IDC_FS_AUTOBOOT, current_fsvdlg.autoboot);
+ current_fsvdlg.donotmount = 0;
ew (hDlg, IDC_FS_RW, !archivehd);
recursive--;
}
SetDlgItemInt (hDlg, IDC_HEADS, current_hfdlg.surfaces, FALSE);
SetDlgItemInt (hDlg, IDC_RESERVED, current_hfdlg.reserved, FALSE);
SetDlgItemInt (hDlg, IDC_BLOCKSIZE, current_hfdlg.blocksize, FALSE);
- SetDlgItemInt (hDlg, IDC_HARDFILE_BOOTPRI, current_hfdlg.bootpri, TRUE);
+ SetDlgItemInt (hDlg, IDC_HARDFILE_BOOTPRI, current_hfdlg.bootpri >= -127 ? current_hfdlg.bootpri : -127, TRUE);
CheckDlgButton (hDlg, IDC_HDF_RW, current_hfdlg.rw);
CheckDlgButton (hDlg, IDC_HDF_AUTOBOOT, current_hfdlg.autoboot);
CheckDlgButton (hDlg, IDC_HDF_DONOTMOUNT, current_hfdlg.donotmount);
RelativePath="..\..\akiko.c"
>
</File>
+ <File
+ RelativePath="..\..\amax.c"
+ >
+ </File>
<File
RelativePath="..\..\ar.c"
>
RelativePath="..\..\akiko.c"
>
</File>
+ <File
+ RelativePath="..\..\amax.c"
+ >
+ </File>
<File
RelativePath="..\..\ar.c"
>
+Beta 3:
+
+- autoboot/donotmount checkbox problems fixed
+- winuaenforcer enabled and VBR not moved: interrupt levels
+ 6 and 7 caused enforcer hit flood
+- uae boot rom was always mounted (b2)
+- b2 interrupt fix update, only "pre-delay" vblank interrupt
+- A-Max rom-"dongle" emulation added (manual configuration file
+ editing currently needed, amaxromfile=<rom file>) Yes, this is
+ very pointless feature. (A-Max technical info by Mark Knibbs)
+- C debugger command only worked in byte-mode
+- disk write without drives selected was emulated as a read without
+ drives selected, clearing disk dma buffer
+- input configuration is fully saved again, need design update..
+ (in b2 all default settings disappeared after saving and loading..)
+- added "directional buttons" to input panel list, for example
+ "X-Axis" is available as "X-Axis" (original), "X-Axis [-]" (button
+ event when joystick/dpad moved left) and "X-Axis [+]" (button
+ event when joystick/dpad moved right) Currently new "buttons"
+ are at the end of the list.
+
Beta 2:
- warp (.wrp) disk compression format supported
- high end quickstart cpu changed back to 68040 (68060 does not boot
very well without 68060.library..)
-
Beta 1:
- CDTV and CD32 interrupt handling improved, fixes "Snoopy In The
{
int count;
char buffer[WRITE_LOG_BUF_SIZE], *ts;
+ int bufsize = WRITE_LOG_BUF_SIZE;
+ char *bufp;
va_list parms;
va_start(parms, format);
- count = _vsnprintf(buffer, WRITE_LOG_BUF_SIZE - 1, format, parms);
+ bufp = buffer;
+ for (;;) {
+ count = _vsnprintf(bufp, bufsize - 1, format, parms);
+ if (count < 0) {
+ bufsize *= 10;
+ if (bufp != buffer)
+ xfree (bufp);
+ bufp = xmalloc (bufsize);
+ continue;
+ }
+ break;
+ }
+ bufp[bufsize - 1] = 0;
ts = writets();
- if (buffer[0] == '*')
+ if (bufp[0] == '*')
count++;
if (SHOW_CONSOLE || console_logging) {
if (lfdetected && ts)
writeconsole(ts);
- writeconsole(buffer);
+ writeconsole(bufp);
}
if (debugfile) {
if (lfdetected && ts)
fprintf(debugfile, ts);
- fprintf(debugfile, buffer);
+ fprintf(debugfile, bufp);
fflush(debugfile);
}
lfdetected = 0;
- if (strlen(buffer) > 0 && buffer[strlen(buffer) - 1] == '\n')
+ if (strlen(bufp) > 0 && bufp[strlen(bufp) - 1] == '\n')
lfdetected = 1;
va_end (parms);
+ if (bufp != buffer)
+ xfree (bufp);
}
void f_out (void *f, const char *format, ...)
*
* SanaII emulation
*
+ * partially based on code from 3c589 PCMCIA driver by Neil Cafferke
+ *
* Copyright 2007 Toni Wilen
*
*/
#define S2EVENT_HARDWARE (1L<<6) /* hardware error catch all */
#define S2EVENT_SOFTWARE (1L<<7) /* software error catch all */
+#define KNOWN_EVENTS (S2EVENT_ERROR|S2EVENT_TX|S2EVENT_RX|S2EVENT_ONLINE|\
+ S2EVENT_OFFLINE|S2EVENT_BUFF|S2EVENT_HARDWARE|S2EVENT_SOFTWARE)
+
#define DRIVE_NEWSTYLE 0x4E535459L /* 'NSTY' */
#define NSCMD_DEVICEQUERY 0x4000
int flags; /* OpenDevice() */
int configured;
int adapter;
+ int online;
uae_u8 mac[ADDR_SIZE];
struct tapdata *td;
- int packetsreceived;
- int packetssent;
- int baddata;
- int overruns;
- int unknowntypesreceived;
- int reconfigurations;
+ uae_u32 packetsreceived;
+ uae_u32 packetssent;
+ uae_u32 baddata;
+ uae_u32 overruns;
+ uae_u32 unknowntypesreceived;
+ uae_u32 reconfigurations;
+ uae_u32 online_micro;
+ uae_u32 online_secs;
};
static struct tapdata td;
break;
case CMD_READ:
- goto offline;
+ if (!pdev->online)
+ goto offline;
break;
+
case S2_READORPHAN:
- goto offline;
+ if (!pdev->online)
+ goto offline;
break;
- case CMD_WRITE:
- goto offline;
- break;
case S2_BROADCAST:
- goto offline;
+ if (!pdev->online)
+ goto offline;
+ put_byte (dstaddr + 0, 0xff);
+ put_byte (dstaddr + 1, 0xff);
+ put_byte (dstaddr + 2, 0xff);
+ put_byte (dstaddr + 3, 0xff);
+ put_byte (dstaddr + 4, 0xff);
+ put_byte (dstaddr + 5, 0xff);
+ /* fall through */
+ case CMD_WRITE:
+ if (!pdev->online)
+ goto offline;
break;
+
case S2_MULTICAST:
+ if (!pdev->online)
+ goto offline;
+ if ((get_byte (dstaddr + 0) & 1) == 0) {
+ io_error = S2ERR_BAD_ADDRESS;
+ wire_error = S2WERR_BAD_MULTICAST;
+ goto end;
+ }
io_error = S2WERR_BAD_MULTICAST;
break;
put_long (statdata + 12, pdev->overruns);
put_long (statdata + 16, pdev->unknowntypesreceived);
put_long (statdata + 20, pdev->reconfigurations);
+ put_long (statdata + 24, pdev->online_secs);
+ put_long (statdata + 28, pdev->online_micro);
break;
case S2_GETSPECIALSTATS:
wire_error = S2WERR_RCVREL_HDW_ERR;
}
if (!io_error) {
+ time_t t;
pdev->packetsreceived = 0;
pdev->packetssent = 0;
pdev->baddata = 0;
pdev->overruns = 0;
pdev->unknowntypesreceived = 0;
pdev->reconfigurations = 0;
+ pdev->online = 1;
+ t = time (NULL);
+ pdev->online_micro = 0;
+ pdev->online_secs = (uae_u32)t;
}
break;
case S2_OFFLINE:
+ pdev->online = 0;
break;
case S2_ONEVENT:
- io_error = S2ERR_NOT_SUPPORTED;
- wire_error = S2WERR_BAD_EVENT;
+ {
+ int complete = FALSE;
+ uae_u32 events;
+ uae_u32 wanted_events = get_long (request + 32);
+ if (wanted_events & ~KNOWN_EVENTS) {
+ io_error = S2ERR_NOT_SUPPORTED;
+ events = S2WERR_BAD_EVENT;
+ } else {
+ if (!pdev->online)
+ events = S2EVENT_ONLINE;
+ else
+ events = S2EVENT_OFFLINE;
+ events &= wanted_events;
+ }
+ if (events) {
+ wire_error = events;
+ complete = TRUE;
+ } else {
+ io_error = S2ERR_NOT_SUPPORTED;
+ wire_error = S2WERR_BAD_EVENT;
+ }
+ }
break;
default:
wire_error = S2WERR_UNIT_OFFLINE;
break;
}
+end:
put_long (request + 32, wire_error);
put_byte (request + 31, io_error);
return async;
name, len, end - chunk);
xfree (chunk);
}
+ restore_disk_finish();
restore_blitter_finish();
restore_akiko_finish();
return;
char *zfile_getdata (struct zfile *z, int offset, int len)
{
size_t pos;
- uae_u8 *b = xmalloc (len);
+ uae_u8 *b;
+ if (len < 0)
+ len = z->size;
+ b = xmalloc (len);
if (z->data) {
memcpy (b, z->data + offset, len);
} else {