From: Toni Wilen Date: Wed, 7 Jul 2004 18:48:00 +0000 (+0300) Subject: imported winuaesrc0990b8.zip X-Git-Tag: 2100~340 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=280ae36c1bf744ae40f111155c892369d73aa227;p=francis%2Fwinuae.git imported winuaesrc0990b8.zip --- diff --git a/blitter.c b/blitter.c index 187d1a92..7c485504 100755 --- a/blitter.c +++ b/blitter.c @@ -817,7 +817,7 @@ static void blit_bltset (int con) * negative effects. */ static int warn = 1; if (warn) - write_log ("warning: weird fill mode (further messages suppressed)\n"); + write_log ("warning: weird fill mode (further messages suppressed) PC=%x\n", m68k_getpc()); warn = 0; blitife = 0; } @@ -825,7 +825,7 @@ static void blit_bltset (int con) if (blitfill && !blitdesc) { static int warn = 1; if (warn) - write_log ("warning: blitter fill without desc (further messages suppressed)\n"); + write_log ("warning: blitter fill without desc (further messages suppressed) PC=%x\n", m68k_getpc()); warn = 0; } blit_diag = blitfill ? blit_cycle_diagram_fill[blit_ch] : blit_cycle_diagram[blit_ch]; diff --git a/cfgfile.c b/cfgfile.c index ccb70829..b85c4bb9 100755 --- a/cfgfile.c +++ b/cfgfile.c @@ -1265,11 +1265,33 @@ static int cfgfile_load_2 (struct uae_prefs *p, const char *filename, int real, int cfgfile_load (struct uae_prefs *p, const char *filename, int *type) { int v; + char tmp[MAX_DPATH]; + int type2; + static int recursive; + if (recursive > 1) + return 0; + recursive++; write_log ("load config '%s':%d\n", filename, type ? *type : -1); v = cfgfile_load_2 (p, filename, 1, type); - if (!v) + if (!v) { write_log ("load failed\n"); + goto end; + } + if (p->config_hardware_path[0]) { + fetch_configurationpath (tmp, sizeof (tmp)); + strncat (tmp, p->config_hardware_path, sizeof (tmp)); + type2 = CONFIG_TYPE_HARDWARE; + cfgfile_load (p, tmp, &type2); + } + if (p->config_host_path[0]) { + fetch_configurationpath (tmp, sizeof (tmp)); + strncat (tmp, p->config_host_path, sizeof (tmp)); + type2 = CONFIG_TYPE_HOST; + cfgfile_load (p, tmp, &type2); + } +end: + recursive--; return v; } @@ -1786,6 +1808,8 @@ void default_prefs (struct uae_prefs *p, int type) memset (p, 0, sizeof (*p)); strcpy (p->description, "UAE default configuration"); + p->config_hardware_path[0] = 0; + p->config_host_path[0] = 0; p->start_gui = 1; p->start_debugger = 0; @@ -2032,11 +2056,11 @@ static void set_68000_compa (struct uae_prefs *p, int compa) static int bip_a1000 (struct uae_prefs *p, int config, int compa, int romcheck) { - int rom[4]; + int roms[4]; - rom[0] = 23; - rom[1] = 24; - rom[2] = -1; + roms[0] = 23; + roms[1] = 24; + roms[2] = -1; p->chipset_mask = 0; p->bogomem_size = 0; p->sound_filter = 2; @@ -2044,23 +2068,22 @@ static int bip_a1000 (struct uae_prefs *p, int config, int compa, int romcheck) p->chipmem_size = 0x40000; set_68000_compa (p, compa); p->dfxtype[1] = -1; - return configure_rom (p, rom, romcheck); + return configure_rom (p, roms, romcheck); } static int bip_cdtv (struct uae_prefs *p, int config, int compa, int romcheck) { - int rom[4]; + int roms[4]; - rom[0] = 6; - rom[1] = 32; - rom[2] = -1; - if (!configure_rom (p, rom, romcheck)) + roms[0] = 6; + roms[1] = 32; + roms[2] = -1; + if (!configure_rom (p, roms, romcheck)) return 0; - rom[0] = 20; - rom[1] = 22; - rom[2] = 21; - rom[3] = -1; - if (!configure_rom (p, rom, romcheck)) + roms[0] = 20; + roms[1] = 21; + roms[2] = -1; + if (!configure_rom (p, roms, romcheck)) return 0; p->bogomem_size = 0; p->chipmem_size = 0x100000; @@ -2072,15 +2095,15 @@ static int bip_cdtv (struct uae_prefs *p, int config, int compa, int romcheck) static int bip_cd32 (struct uae_prefs *p, int config, int compa, int romcheck) { - int rom[2]; + int roms[2]; buildin_default_prefs_68020 (p); - rom[0] = 18; - rom[1] = -1; - if (!configure_rom (p, rom, romcheck)) + roms[0] = 18; + roms[1] = -1; + if (!configure_rom (p, roms, romcheck)) return 0; - rom[0] = 19; - if (!configure_rom (p, rom, romcheck)) + roms[0] = 19; + if (!configure_rom (p, roms, romcheck)) return 0; p->nr_floppies = 0; p->dfxtype[0] = -1; @@ -2091,27 +2114,27 @@ static int bip_cd32 (struct uae_prefs *p, int config, int compa, int romcheck) static int bip_a1200 (struct uae_prefs *p, int config, int compa, int romcheck) { - int rom[4]; + int roms[4]; buildin_default_prefs_68020 (p); - rom[0] = 11; - rom[1] = 31; - rom[2] = 15; - rom[3] = -1; + roms[0] = 11; + roms[1] = 31; + roms[2] = 15; + roms[3] = -1; if (config == 1) p->fastmem_size = 0x400000; set_68020_compa (p, compa); - return configure_rom (p, rom, romcheck); + return configure_rom (p, roms, romcheck); } static int bip_a600 (struct uae_prefs *p, int config, int compa, int romcheck) { - int rom[4]; + int roms[4]; - rom[0] = 10; - rom[1] = 9; - rom[2] = 8; - rom[3] = -1; + roms[0] = 10; + roms[1] = 9; + roms[2] = 8; + roms[3] = -1; p->bogomem_size = 0; p->chipmem_size = 0x100000; if (config == 1) @@ -2120,15 +2143,15 @@ static int bip_a600 (struct uae_prefs *p, int config, int compa, int romcheck) p->fastmem_size = 0x400000; p->chipset_mask = CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE; set_68000_compa (p, compa); - return configure_rom (p, rom, romcheck); + return configure_rom (p, roms, romcheck); } static int bip_a500p (struct uae_prefs *p, int config, int compa, int romcheck) { - int rom[2]; + int roms[2]; - rom[0] = 7; - rom[1] = -1; + roms[0] = 7; + roms[1] = -1; p->bogomem_size = 0; p->chipmem_size = 0x100000; if (config == 1) @@ -2137,68 +2160,68 @@ static int bip_a500p (struct uae_prefs *p, int config, int compa, int romcheck) p->fastmem_size = 0x400000; p->chipset_mask = CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE; set_68000_compa (p, compa); - return configure_rom (p, rom, romcheck); + return configure_rom (p, roms, romcheck); } static int bip_a500 (struct uae_prefs *p, int config, int compa, int romcheck) { - int rom[4]; + int roms[4]; - rom[0] = rom[1] = rom[2] = rom[3] = -1; + roms[0] = roms[1] = roms[2] = roms[3] = -1; switch (config) { case 0: // KS 1.3, OCS Agnus, 0.5M Chip + 0.5M Slow - rom[0] = 6; - rom[1] = 32; + roms[0] = 6; + roms[1] = 32; p->chipset_mask = 0; break; case 1: // KS 1.3, ECS Agnus, 0.5M Chip + 0.5M Slow - rom[0] = 6; - rom[1] = 32; + roms[0] = 6; + roms[1] = 32; break; case 2: // KS 1.3, ECS Agnus, 1.0M Chip - rom[0] = 6; - rom[1] = 32; + roms[0] = 6; + roms[1] = 32; p->bogomem_size = 0; p->chipmem_size = 0x100000; break; case 3: // KS 1.3, OCS Agnus, 0.5M Chip - rom[0] = 6; - rom[1] = 32; + roms[0] = 6; + roms[1] = 32; p->bogomem_size = 0; p->chipset_mask = 0; p->dfxtype[1] = -1; break; case 4: // KS 1.2, OCS Agnus, 0.5M Chip - rom[0] = 5; - rom[1] = 4; - rom[2] = 3; + roms[0] = 5; + roms[1] = 4; + roms[2] = 3; p->bogomem_size = 0; p->chipset_mask = 0; p->dfxtype[1] = -1; break; case 5: // KS 1.2, OCS Agnus, 0.5M Chip + 0.5M Slow - rom[0] = 5; - rom[1] = 4; - rom[2] = 3; + roms[0] = 5; + roms[1] = 4; + roms[2] = 3; p->chipset_mask = 0; break; } set_68000_compa (p, compa); - return configure_rom (p, rom, romcheck); + return configure_rom (p, roms, romcheck); } static int bip_super (struct uae_prefs *p, int config, int compa, int romcheck) { - int rom[8]; - - rom[0] = 16; - rom[1] = 31; - rom[2] = 15; - rom[3] = 14; - rom[4] = 13; - rom[5] = 12; - rom[6] = 11; - rom[7] = -1; + int roms[8]; + + roms[0] = 17; + roms[1] = 16; + roms[2] = 31; + roms[3] = 15; + roms[4] = 14; + roms[5] = 12; + roms[6] = 11; + roms[7] = -1; p->bogomem_size = 0; p->chipmem_size = 0x400000; p->z3fastmem_size = 8 * 1024 * 1024; @@ -2215,31 +2238,44 @@ static int bip_super (struct uae_prefs *p, int config, int compa, int romcheck) p->cpu_idle = 150; p->scsi = 1; p->socket_emu = 1; - return configure_rom (p, rom, romcheck); + return configure_rom (p, roms, romcheck); } int build_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck) { + int v = 0, i; buildin_default_prefs (p); switch (model) { case 0: - return bip_a500 (p, config, compa, romcheck); + v = bip_a500 (p, config, compa, romcheck); + break; case 1: - return bip_a500p (p, config, compa, romcheck); + v = bip_a500p (p, config, compa, romcheck); + break; case 2: - return bip_a600 (p, config, compa, romcheck); + v = bip_a600 (p, config, compa, romcheck); + break; case 3: - return bip_a1000 (p, config, compa, romcheck); + v = bip_a1000 (p, config, compa, romcheck); + break; case 4: - return bip_a1200 (p, config, compa, romcheck); + v = bip_a1200 (p, config, compa, romcheck); + break; case 5: - return bip_cd32 (p, config, compa, romcheck); + v = bip_cd32 (p, config, compa, romcheck); + break; case 6: - return bip_cdtv (p, config, compa, romcheck); + v = bip_cdtv (p, config, compa, romcheck); + break; case 10: - return bip_super (p, config, compa, romcheck); + v = bip_super (p, config, compa, romcheck); + break; } - return 0; + for (i = 0; i < 4; i++) { + if (p->dfxtype[i] < 0) + p->df[i][0] = 0; + } + return v; } \ No newline at end of file diff --git a/custom.c b/custom.c index c0b43c1d..9444661a 100755 --- a/custom.c +++ b/custom.c @@ -5464,7 +5464,7 @@ uae_u8 *save_custom_sprite(int num, int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = malloc (25); + dstbak = dst = malloc (25); SL (spr[num].pt); /* 120-13E SPRxPT */ SW (sprpos[num]); /* 1x0 SPRxPOS */ SW (sprctl[num]); /* 1x2 SPRxPOS */ diff --git a/drawing.c b/drawing.c index d1b9fddd..cd9c978d 100755 --- a/drawing.c +++ b/drawing.c @@ -1268,19 +1268,20 @@ STATIC_INLINE void do_color_changes (line_draw_func worker_border, line_draw_fun { int i; int lastpos = visible_left_border; + int endpos = visible_left_border + gfxvidinfo.width; for (i = dip_for_drawing->first_color_change; i <= dip_for_drawing->last_color_change; i++) { int regno = curr_color_changes[i].regno; unsigned int value = curr_color_changes[i].value; int nextpos, nextpos_in_range; if (i == dip_for_drawing->last_color_change) - nextpos = max_diwlastword; + nextpos = endpos; else nextpos = coord_hw_to_window_x (curr_color_changes[i].linepos * 2); nextpos_in_range = nextpos; - if (nextpos > visible_right_border) - nextpos_in_range = visible_right_border; + if (nextpos > endpos) + nextpos_in_range = endpos; if (nextpos_in_range > lastpos) { if (lastpos < playfield_start) { @@ -1309,7 +1310,7 @@ STATIC_INLINE void do_color_changes (line_draw_func worker_border, line_draw_fun colors_for_drawing.acolors[regno] = getxcolor (value); } } - if (lastpos >= visible_right_border) + if (lastpos >= endpos) break; } } diff --git a/filesys.asm b/filesys.asm index ade04726..de2f3816 100755 --- a/filesys.asm +++ b/filesys.asm @@ -285,8 +285,10 @@ r18 addq.l #1,d6 bne.s r15 moveq #0,d6 -r3 - move.l 0(a4,d6.l*4),a0 +r3 move.l d6,d1 + add.l d1,d1 + add.l d1,d1 + move.l 0(a4,d1.l),a0 addq.l #4,a0 move.l (a3)+,d3 ; hunk type move.l (a3)+,d4 ; hunk size @@ -313,12 +315,17 @@ r7 ; scan for reloc32 or hunk_end bne.s r13 ; relocate - move.l 0(a4,d6.l*4),a0 ; current hunk + move.l d6,d1 + add.l d1,d1 + add.l d1,d1 + move.l 0(a4,d1.l),a0 ; current hunk addq.l #4,a0 r11 move.l (a3)+,d0 ;number of relocs beq.s r7 move.l (a3)+,d1 ;hunk - move.l 0(a4,d1.l*4),d3 ;hunk start address + add.l d1,d1 + add.l d1,d1 + move.l 0(a4,d1.l),d3 ;hunk start address addq.l #4,d3 r9 move.l (a3)+,d2 ;offset add.l d3,0(a0,d2.l) diff --git a/filesys.c b/filesys.c index c567aa44..170db9b7 100755 --- a/filesys.c +++ b/filesys.c @@ -43,6 +43,7 @@ #include "fsdb.h" #include "zfile.h" #include "gui.h" +#include "savestate.h" #define TRACING_ENABLED 0 #if TRACING_ENABLED @@ -1292,44 +1293,21 @@ static a_inode *get_aino (Unit *unit, a_inode *base, const char *rel, uae_u32 *e return curr; } -static uae_u32 startup_handler (void) +static void startup_update_unit (Unit *unit, UnitInfo *uinfo) { - /* Just got the startup packet. It's in A4. DosBase is in A2, - * our allocated volume structure is in D6, A5 is a pointer to - * our port. */ - uaecptr rootnode = get_long (m68k_areg (regs, 2) + 34); - uaecptr dos_info = get_long (rootnode + 24) << 2; - uaecptr pkt = m68k_dreg (regs, 3); - uaecptr arg2 = get_long (pkt + dp_Arg2); - int i, namelen; - char* devname = bstr1 (get_long (pkt + dp_Arg1) << 2); - char* s; - Unit *unit; - UnitInfo *uinfo; - - /* find UnitInfo with correct device name */ - s = strchr (devname, ':'); - if (s) - *s = '\0'; - - for (i = 0; i < current_mountinfo->num_units; i++) { - /* Hardfile volume name? */ - if (current_mountinfo->ui[i].volname == 0) - continue; - - if (current_mountinfo->ui[i].startup == arg2) - break; - } + unit->ui.devname = uinfo->devname; + xfree (unit->ui.volname); + unit->ui.volname = my_strdup (uinfo->volname); /* might free later for rename */ + unit->ui.rootdir = uinfo->rootdir; + unit->ui.readonly = uinfo->readonly; + unit->ui.unit_pipe = uinfo->unit_pipe; + unit->ui.back_pipe = uinfo->back_pipe; +} - if (i == current_mountinfo->num_units - || access (current_mountinfo->ui[i].rootdir, R_OK) != 0) - { - write_log ("Failed attempt to mount device\n", devname); - put_long (pkt + dp_Res1, DOS_FALSE); - put_long (pkt + dp_Res2, ERROR_DEVICE_NOT_MOUNTED); - return 1; - } - uinfo = current_mountinfo->ui + i; +static Unit *startup_create_unit (UnitInfo *uinfo) +{ + int i; + Unit *unit; unit = (Unit *) xcalloc (sizeof (Unit), 1); unit->next = units; @@ -1340,12 +1318,8 @@ static uae_u32 startup_handler (void) unit->port = m68k_areg (regs, 5); unit->unit = unit_num++; - unit->ui.devname = uinfo->devname; - unit->ui.volname = my_strdup (uinfo->volname); /* might free later for rename */ - unit->ui.rootdir = uinfo->rootdir; - unit->ui.readonly = uinfo->readonly; - unit->ui.unit_pipe = uinfo->unit_pipe; - unit->ui.back_pipe = uinfo->back_pipe; + startup_update_unit (unit, uinfo); + unit->cmds_complete = 0; unit->cmds_sent = 0; unit->cmds_acked = 0; @@ -1376,6 +1350,48 @@ static uae_u32 startup_handler (void) unit->aino_cache_size = 0; for (i = 0; i < MAX_AINO_HASH; i++) unit->aino_hash[i] = 0; + return unit; +} + +static uae_u32 startup_handler (void) +{ + /* Just got the startup packet. It's in A4. DosBase is in A2, + * our allocated volume structure is in D6, A5 is a pointer to + * our port. */ + uaecptr rootnode = get_long (m68k_areg (regs, 2) + 34); + uaecptr dos_info = get_long (rootnode + 24) << 2; + uaecptr pkt = m68k_dreg (regs, 3); + uaecptr arg2 = get_long (pkt + dp_Arg2); + int i, namelen; + char* devname = bstr1 (get_long (pkt + dp_Arg1) << 2); + char* s; + Unit *unit; + UnitInfo *uinfo; + + /* find UnitInfo with correct device name */ + s = strchr (devname, ':'); + if (s) + *s = '\0'; + + for (i = 0; i < current_mountinfo->num_units; i++) { + /* Hardfile volume name? */ + if (current_mountinfo->ui[i].volname == 0) + continue; + + if (current_mountinfo->ui[i].startup == arg2) + break; + } + + if (i == current_mountinfo->num_units + || access (current_mountinfo->ui[i].rootdir, R_OK) != 0) + { + write_log ("Failed attempt to mount device\n", devname); + put_long (pkt + dp_Res1, DOS_FALSE); + put_long (pkt + dp_Res2, ERROR_DEVICE_NOT_MOUNTED); + return 1; + } + uinfo = current_mountinfo->ui + i; + unit = startup_create_unit (uinfo); /* write_comm_pipe_int (unit->ui.unit_pipe, -1, 1);*/ @@ -3484,9 +3500,11 @@ void filesys_start_threads (void) UnitInfo *ui = &uip[i]; ui->unit_pipe = 0; ui->back_pipe = 0; - ui->startup = 0; - ui->reset_state = 0; - ui->self = 0; + ui->reset_state = FS_STARTUP; + if (savestate_state != STATE_RESTORE) { + ui->startup = 0; + ui->self = 0; + } #ifdef UAE_FILESYS_THREADS if (is_hardfile (current_mountinfo, i) == FILESYS_VIRTUAL) { ui->unit_pipe = (smp_comm_pipe *)xmalloc (sizeof (smp_comm_pipe)); @@ -3496,6 +3514,8 @@ void filesys_start_threads (void) uae_start_thread (filesys_thread, (void *)(uip + i), &uip[i].tid); } #endif + if (savestate_state == STATE_RESTORE) + startup_update_unit (uip->self, uip); } } @@ -3510,7 +3530,7 @@ void filesys_reset (void) /* We get called once from customreset at the beginning of the program * before filesys_start_threads has been called. Survive that. */ - if (current_mountinfo == 0) + if (current_mountinfo == 0 || savestate_state == STATE_RESTORE) return; for (u = units; u; u = u1) { @@ -3540,7 +3560,7 @@ void filesys_prepare_reset (void) Unit *u; int i; - if (!current_mountinfo) + if (!current_mountinfo || savestate_state == STATE_RESTORE) return; uip = current_mountinfo->ui; #ifdef UAE_FILESYS_THREADS @@ -4133,37 +4153,37 @@ void filesys_install_code (void) /* see filesys.asm for source */ db(0x00); db(0x00); db(0x00); db(0x10); db(0x00); db(0x00); db(0x00); db(0x00); - db(0x60); db(0x00); db(0x04); db(0xe0); db(0x00); db(0x00); db(0x03); db(0x9c); + db(0x60); db(0x00); db(0x04); db(0xf0); db(0x00); db(0x00); db(0x03); db(0xac); db(0x00); db(0x00); db(0x00); db(0x30); db(0x00); db(0x00); db(0x00); db(0xd0); db(0x00); db(0x00); db(0x00); db(0x1c); db(0x00); db(0x00); db(0x01); db(0x8a); - db(0x00); db(0x00); db(0x06); db(0x98); db(0x43); db(0xfa); db(0x06); db(0xc5); + db(0x00); db(0x00); db(0x06); db(0xa8); db(0x43); db(0xfa); db(0x06); db(0xd5); db(0x4e); db(0xae); db(0xff); db(0xa0); db(0x20); db(0x40); db(0x20); db(0x28); db(0x00); db(0x16); db(0x20); db(0x40); db(0x4e); db(0x90); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0xff); db(0xfe); db(0x2c); db(0x78); db(0x00); db(0x04); - db(0x30); db(0x3c); db(0xff); db(0xfc); db(0x61); db(0x00); db(0x06); db(0x4a); - db(0x2a); db(0x50); db(0x43); db(0xfa); db(0x06); db(0xab); db(0x70); db(0x24); + db(0x30); db(0x3c); db(0xff); db(0xfc); db(0x61); db(0x00); db(0x06); db(0x5a); + db(0x2a); db(0x50); db(0x43); db(0xfa); db(0x06); db(0xbb); db(0x70); db(0x24); db(0x7a); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x4a); db(0x80); - db(0x66); db(0x0c); db(0x43); db(0xfa); db(0x06); db(0x9b); db(0x70); db(0x00); + db(0x66); db(0x0c); db(0x43); db(0xfa); db(0x06); db(0xab); db(0x70); db(0x00); db(0x7a); db(0x01); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x28); db(0x40); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x02); db(0x2c); db(0x72); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x26); db(0x40); db(0x27); db(0x4c); db(0x01); db(0x9c); db(0x7c); db(0x00); db(0xbc); db(0xad); db(0x01); db(0x0c); db(0x64); db(0x24); db(0x2f); db(0x06); db(0x7e); db(0x01); db(0x2f); db(0x0b); - db(0x20); db(0x4b); db(0x61); db(0x00); db(0x03); db(0x18); db(0x26); db(0x5f); + db(0x20); db(0x4b); db(0x61); db(0x00); db(0x03); db(0x28); db(0x26); db(0x5f); db(0x0c); db(0x80); db(0xff); db(0xff); db(0xff); db(0xfe); db(0x67); db(0x08); db(0x48); db(0x46); db(0x52); db(0x46); db(0x48); db(0x46); db(0x60); db(0xe4); db(0x2c); db(0x1f); db(0x52); db(0x46); db(0x60); db(0xd6); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x22); db(0x4c); db(0x4e); db(0xae); db(0xfe); db(0x62); - db(0x30); db(0x3c); db(0xff); db(0x80); db(0x61); db(0x00); db(0x05); db(0xda); + db(0x30); db(0x3c); db(0xff); db(0x80); db(0x61); db(0x00); db(0x05); db(0xea); db(0x4e); db(0x90); db(0x72); db(0x03); db(0x74); db(0xf6); db(0x20); db(0x7c); db(0x00); db(0x20); db(0x00); db(0x00); db(0x90); db(0x88); db(0x65); db(0x0a); db(0x67); db(0x08); db(0x78); db(0x00); db(0x22); db(0x44); db(0x4e); db(0xae); db(0xfd); db(0x96); db(0x4c); db(0xdf); db(0x7f); db(0xff); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0x00); db(0x20); db(0x30); db(0x3c); db(0xff); db(0x50); - db(0x61); db(0x00); db(0x05); db(0xae); db(0x70); db(0x00); db(0x4e); db(0x90); + db(0x61); db(0x00); db(0x05); db(0xbe); db(0x70); db(0x00); db(0x4e); db(0x90); db(0x4a); db(0x80); db(0x67); db(0x00); db(0x00); db(0xa0); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); - db(0x05); db(0x98); db(0x70); db(0x02); db(0x4e); db(0x90); db(0x0c); db(0x40); + db(0x05); db(0xa8); db(0x70); db(0x02); db(0x4e); db(0x90); db(0x0c); db(0x40); db(0x00); db(0x01); db(0x6d); db(0x7a); db(0x6e); db(0x06); db(0x4e); db(0xae); db(0xfe); db(0x92); db(0x60); db(0xe6); db(0x0c); db(0x40); db(0x00); db(0x02); db(0x6e); db(0x08); db(0x20); db(0x01); db(0x4e); db(0xae); db(0xfe); db(0xbc); @@ -4180,11 +4200,11 @@ void filesys_install_code (void) db(0x12); db(0x34); db(0x00); db(0x18); db(0x25); db(0x49); db(0x00); db(0x1a); db(0x20); db(0x69); db(0x00); db(0x10); db(0x22); db(0x4a); db(0x4e); db(0xae); db(0xfe); db(0x92); db(0x60); db(0x00); db(0xff); db(0x76); db(0x30); db(0x3c); - db(0xff); db(0x50); db(0x61); db(0x00); db(0x05); db(0x0c); db(0x70); db(0x04); + db(0xff); db(0x50); db(0x61); db(0x00); db(0x05); db(0x1c); db(0x70); db(0x04); db(0x4e); db(0x90); db(0x70); db(0x01); db(0x4c); db(0xdf); db(0x04); db(0x00); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0xc0); db(0xc0); db(0x70); db(0x1a); db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); - db(0xff); db(0x3a); db(0x22); db(0x40); db(0x41); db(0xfa); db(0x05); db(0x36); + db(0xff); db(0x3a); db(0x22); db(0x40); db(0x41); db(0xfa); db(0x05); db(0x46); db(0x23); db(0x48); db(0x00); db(0x0a); db(0x41); db(0xfa); db(0xff); db(0x2a); db(0x23); db(0x48); db(0x00); db(0x0e); db(0x41); db(0xfa); db(0xff); db(0x22); db(0x23); db(0x48); db(0x00); db(0x12); db(0x33); db(0x7c); db(0x02); db(0x14); @@ -4197,12 +4217,12 @@ void filesys_install_code (void) db(0x01); db(0xa0); db(0x11); db(0xb1); db(0x00); db(0x00); db(0x00); db(0x0e); db(0x52); db(0x40); db(0x0c); db(0x40); db(0x00); db(0x8c); db(0x66); db(0xf2); db(0x20); db(0x0a); db(0xe4); db(0x88); db(0x21); db(0x40); db(0x00); db(0x36); - db(0x22); db(0x48); db(0x41); db(0xfa); db(0x04); db(0xd0); db(0x23); db(0x48); + db(0x22); db(0x48); db(0x41); db(0xfa); db(0x04); db(0xe0); db(0x23); db(0x48); db(0x00); db(0x0a); db(0x20); db(0x6b); db(0x01); db(0x98); db(0x41); db(0xe8); db(0x00); db(0x12); db(0x4e); db(0xae); db(0xff); db(0x10); db(0x4c); db(0xdf); db(0x4f); db(0x03); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0x7f); db(0x7e); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x24); db(0x48); db(0x0c); db(0x9a); - db(0x00); db(0x00); db(0x03); db(0xf3); db(0x66); db(0x00); db(0x00); db(0xdc); + db(0x00); db(0x00); db(0x03); db(0xf3); db(0x66); db(0x00); db(0x00); db(0xec); db(0x50); db(0x8a); db(0x2e); db(0x2a); db(0x00); db(0x04); db(0x9e); db(0x92); db(0x50); db(0x8a); db(0x52); db(0x87); db(0x26); db(0x4a); db(0x20); db(0x07); db(0xd0); db(0x80); db(0xd0); db(0x80); db(0xd7); db(0xc0); db(0x28); db(0x4a); @@ -4212,23 +4232,25 @@ void filesys_install_code (void) db(0x08); db(0x83); db(0x00); db(0x1f); db(0x08); db(0x83); db(0x00); db(0x1e); db(0x20); db(0x02); db(0x66); db(0x04); db(0x42); db(0x9a); db(0x60); db(0x1e); db(0x50); db(0x80); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x4a); db(0x80); - db(0x67); db(0x00); db(0x00); db(0x90); db(0x20); db(0x40); db(0x20); db(0xc2); + db(0x67); db(0x00); db(0x00); db(0xa0); db(0x20); db(0x40); db(0x20); db(0xc2); db(0x24); db(0xc8); db(0x22); db(0x0d); db(0x67); db(0x06); db(0x20); db(0x08); db(0xe4); db(0x88); db(0x2a); db(0x80); db(0x2a); db(0x48); db(0x52); db(0x86); - db(0xbe); db(0x86); db(0x66); db(0xb8); db(0x7c); db(0x00); db(0x20); db(0x74); - db(0x6c); db(0x00); db(0x58); db(0x88); db(0x26); db(0x1b); db(0x28); db(0x1b); - db(0xe5); db(0x8c); db(0x0c); db(0x83); db(0x00); db(0x00); db(0x03); db(0xe9); - db(0x67); db(0x08); db(0x0c); db(0x83); db(0x00); db(0x00); db(0x03); db(0xea); - db(0x66); db(0x0c); db(0x20); db(0x04); db(0x4a); db(0x80); db(0x67); db(0x0e); - db(0x10); db(0xdb); db(0x53); db(0x80); db(0x60); db(0xf6); db(0x0c); db(0x83); - db(0x00); db(0x00); db(0x03); db(0xeb); db(0x66); db(0x44); db(0x26); db(0x1b); - db(0x0c); db(0x83); db(0x00); db(0x00); db(0x03); db(0xec); db(0x66); db(0x1e); - db(0x20); db(0x74); db(0x6c); db(0x00); db(0x58); db(0x88); db(0x20); db(0x1b); - db(0x67); db(0xec); db(0x22); db(0x1b); db(0x26); db(0x34); db(0x1c); db(0x00); + db(0xbe); db(0x86); db(0x66); db(0xb8); db(0x7c); db(0x00); db(0x22); db(0x06); + db(0xd2); db(0x81); db(0xd2); db(0x81); db(0x20); db(0x74); db(0x18); db(0x00); + db(0x58); db(0x88); db(0x26); db(0x1b); db(0x28); db(0x1b); db(0xe5); db(0x8c); + db(0x0c); db(0x83); db(0x00); db(0x00); db(0x03); db(0xe9); db(0x67); db(0x08); + db(0x0c); db(0x83); db(0x00); db(0x00); db(0x03); db(0xea); db(0x66); db(0x0c); + db(0x20); db(0x04); db(0x4a); db(0x80); db(0x67); db(0x0e); db(0x10); db(0xdb); + db(0x53); db(0x80); db(0x60); db(0xf6); db(0x0c); db(0x83); db(0x00); db(0x00); + db(0x03); db(0xeb); db(0x66); db(0x4e); db(0x26); db(0x1b); db(0x0c); db(0x83); + db(0x00); db(0x00); db(0x03); db(0xec); db(0x66); db(0x28); db(0x22); db(0x06); + db(0xd2); db(0x81); db(0xd2); db(0x81); db(0x20); db(0x74); db(0x18); db(0x00); + db(0x58); db(0x88); db(0x20); db(0x1b); db(0x67); db(0xe6); db(0x22); db(0x1b); + db(0xd2); db(0x81); db(0xd2); db(0x81); db(0x26); db(0x34); db(0x18); db(0x00); db(0x58); db(0x83); db(0x24); db(0x1b); db(0xd7); db(0xb0); db(0x28); db(0x00); - db(0x53); db(0x80); db(0x66); db(0xf6); db(0x60); db(0xe8); db(0x0c); db(0x83); + db(0x53); db(0x80); db(0x66); db(0xf6); db(0x60); db(0xe4); db(0x0c); db(0x83); db(0x00); db(0x00); db(0x03); db(0xf2); db(0x66); db(0x14); db(0x52); db(0x86); - db(0xbe); db(0x86); db(0x66); db(0x00); db(0xff); db(0x9a); db(0x7e); db(0x01); + db(0xbe); db(0x86); db(0x66); db(0x00); db(0xff); db(0x8a); db(0x7e); db(0x01); db(0x20); db(0x54); db(0x20); db(0x07); db(0x4c); db(0xdf); db(0x7e); db(0xfe); db(0x4e); db(0x75); db(0x30); db(0x3c); db(0x75); db(0x30); db(0x33); db(0xfc); db(0x0f); db(0x00); db(0x00); db(0xdf); db(0xf1); db(0x80); db(0x33); db(0xfc); @@ -4255,9 +4277,9 @@ void filesys_install_code (void) db(0x22); db(0x48); db(0x20); db(0x5f); db(0x42); db(0xa8); db(0x01); db(0x90); db(0x42); db(0xa8); db(0x01); db(0x94); db(0x4e); db(0x91); db(0x26); db(0x00); db(0x0c); db(0x83); db(0xff); db(0xff); db(0xff); db(0xfe); db(0x67); db(0x00); - db(0xfc); db(0xfe); db(0x0c); db(0x83); db(0x00); db(0x00); db(0x00); db(0x02); + db(0xfc); db(0xee); db(0x0c); db(0x83); db(0x00); db(0x00); db(0x00); db(0x02); db(0x67); db(0x0c); db(0xc0); db(0x85); db(0x67); db(0x08); db(0x4a); db(0xa8); - db(0x01); db(0x90); db(0x67); db(0x00); db(0xfc); db(0xea); db(0x20); db(0x28); + db(0x01); db(0x90); db(0x67); db(0x00); db(0xfc); db(0xda); db(0x20); db(0x28); db(0x01); db(0x90); db(0x67); db(0x12); db(0x2f); db(0x08); db(0x72); db(0x01); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x20); db(0x5f); db(0x21); db(0x40); db(0x01); db(0x94); db(0x4a); db(0x83); @@ -4269,16 +4291,16 @@ void filesys_install_code (void) db(0x4e); db(0x90); db(0x70); db(0x00); db(0x27); db(0x40); db(0x00); db(0x08); db(0x27); db(0x40); db(0x00); db(0x10); db(0x27); db(0x40); db(0x00); db(0x20); db(0x4a); db(0xa9); db(0x01); db(0x94); db(0x67); db(0x28); db(0x20); db(0x69); - db(0x01); db(0x94); db(0x61); db(0x00); db(0xfd); db(0xd8); db(0x48); db(0xe7); + db(0x01); db(0x94); db(0x61); db(0x00); db(0xfd); db(0xc8); db(0x48); db(0xe7); db(0x80); db(0xc0); db(0x20); db(0x29); db(0x01); db(0x90); db(0x22); db(0x69); db(0x01); db(0x94); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x4e); db(0xae); db(0xff); db(0x2e); db(0x4c); db(0xdf); db(0x03); db(0x01); db(0x4a); db(0x80); - db(0x67); db(0x04); db(0x61); db(0x00); db(0xfd); db(0x62); db(0x4a); db(0x83); - db(0x6b); db(0x00); db(0xfc); db(0x64); db(0x30); db(0x3c); db(0xff); db(0x18); + db(0x67); db(0x04); db(0x61); db(0x00); db(0xfd); db(0x52); db(0x4a); db(0x83); + db(0x6b); db(0x00); db(0xfc); db(0x54); db(0x30); db(0x3c); db(0xff); db(0x18); db(0x61); db(0x00); db(0x02); db(0x16); db(0x4e); db(0x90); db(0x20); db(0x03); db(0x16); db(0x29); db(0x00); db(0x4f); db(0x4a); db(0x80); db(0x66); db(0x1a); db(0x27); db(0x7c); db(0x00); db(0x00); db(0x0f); db(0xa0); db(0x00); db(0x14); - db(0x43); db(0xfa); db(0xfb); db(0x72); db(0x20); db(0x09); db(0xe4); db(0x88); + db(0x43); db(0xfa); db(0xfb); db(0x62); db(0x20); db(0x09); db(0xe4); db(0x88); db(0x27); db(0x40); db(0x00); db(0x20); db(0x70); db(0xff); db(0x27); db(0x40); db(0x00); db(0x24); db(0x4a); db(0x87); db(0x67); db(0x36); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x70); db(0x14); db(0x72); db(0x00); db(0x4e); db(0xae); @@ -4342,7 +4364,7 @@ void filesys_install_code (void) db(0x24); db(0x51); db(0x70); db(0x18); db(0x4e); db(0xae); db(0xff); db(0x2e); db(0x06); db(0x86); db(0x00); db(0x01); db(0x00); db(0x00); db(0x20); db(0x0a); db(0x66); db(0xec); db(0x26); db(0x87); db(0x2a); db(0x1f); db(0x4e); db(0x75); - db(0x41); db(0xfa); db(0xf9); db(0x6a); db(0x02); db(0x80); db(0x00); db(0x00); + db(0x41); db(0xfa); db(0xf9); db(0x5a); db(0x02); db(0x80); db(0x00); db(0x00); db(0xff); db(0xff); db(0xd1); db(0xc0); db(0x4e); db(0x75); db(0x00); db(0x00); db(0x0c); db(0xaf); db(0x00); db(0x00); db(0x00); db(0x22); db(0x00); db(0x08); db(0x66); db(0x30); db(0x48); db(0xe7); db(0xc0); db(0xe2); db(0x2c); db(0x78); @@ -4365,3 +4387,119 @@ void filesys_install_code (void) } #include "od-win32/win32_filesys.c" + +static uae_u8 *restore_filesys_virtual (UnitInfo *ui, uae_u8 *src) +{ + Unit *u = startup_create_unit (ui); + int cnt; + + u->a_uniq = restore_u64 (); + u->key_uniq = restore_u64 (); + u->dosbase = restore_u32 (); + u->volume = restore_u32 (); + u->port = restore_u32 (); + u->locklist = restore_u32 (); + u->dummy_message = restore_u32 (); + u->cmds_sent = restore_u64 (); + u->cmds_complete = restore_u64 (); + u->cmds_acked = restore_u64 (); + cnt = restore_u32 (); + while (cnt-- > 0) { + restore_u64 (); + restore_u32 (); + restore_u32 (); + restore_u32 (); + xfree (restore_string ()); + } + return src; +} + +static uae_u8 *save_filesys_virtual (UnitInfo *ui, uae_u8 *dst) +{ + Unit *u = ui->self; + Key *k; + int cnt; + + save_u64 (u->a_uniq); + save_u64 (u->key_uniq); + save_u32 (u->dosbase); + save_u32 (u->volume); + save_u32 (u->port); + save_u32 (u->locklist); + save_u32 (u->dummy_message); + save_u64 (u->cmds_sent); + save_u64 (u->cmds_complete); + save_u64 (u->cmds_acked); + cnt = 0; + for (k = u->keys; k; k = k->next) + cnt++; + save_u32 (cnt); + for (k = u->keys; k; k = k->next) { + save_u64 (k->uniq); + save_u32 (k->file_pos); + save_u32 (k->createmode); + save_u32 (k->dosmode); + save_string (k->aino->nname); + } + return dst; +} + +uae_u8 *save_filesys (int num, int *len) +{ + uae_u8 *dstbak, *dst; + UnitInfo *ui; + int type = is_hardfile (current_mountinfo, num); + + dstbak = dst = malloc (10000); + ui = ¤t_mountinfo->ui[num]; + save_u32 (1); /* version */ + save_u32 (ui->devno); + save_u16 (type); + save_string (ui->rootdir); + save_string (ui->devname); + save_string (ui->volname); + save_string (ui->filesysdir); + save_u8 (ui->bootpri); + save_u8 (ui->readonly); + save_u32 (ui->startup); + if (type == FILESYS_VIRTUAL) + dst = save_filesys_virtual (ui, dst); + *len = dst - dstbak; + return dstbak; +} + +uae_u8 *restore_filesys (uae_u8 *src) +{ + int type, devno; + UnitInfo *ui; + char *devname = 0, *volname = 0, *rootdir = 0, *filesysdir = 0; + int bootpri, readonly; + + if (restore_u32 () != 1) + return src; + devno = restore_u32 (); + if (devno >= current_mountinfo->num_units) + return src; + type = restore_u16 (); + rootdir = restore_string (); + devname = restore_string (); + volname = restore_string (); + filesysdir = restore_string (); + bootpri = restore_u8 (); + readonly = restore_u8 (); + if (set_filesys_unit (current_mountinfo, devno, devname, volname, rootdir, readonly, + 0, 0, 0, 0, bootpri, filesysdir[0] ? filesysdir : NULL)) { + write_log ("filesys '%s' failed to restore\n", rootdir); + goto end; + } + ui = ¤t_mountinfo->ui[devno]; + ui->startup = restore_u32 (); + if (type == FILESYS_VIRTUAL) + src = restore_filesys_virtual (ui, src); +end: + xfree (rootdir); + xfree (devname); + xfree (volname); + xfree (filesysdir); + return src; +} diff --git a/include/savestate.h b/include/savestate.h index 9904bd16..057b5ffa 100755 --- a/include/savestate.h +++ b/include/savestate.h @@ -10,23 +10,27 @@ /* functions to save byte,word or long word * independent of CPU's endianess */ -extern void save_u16_func (uae_u8 **, uae_u16); +extern void save_u64_func (uae_u8 **, uae_u64); extern void save_u32_func (uae_u8 **, uae_u32); +extern void save_u16_func (uae_u8 **, uae_u16); extern void save_u8_func (uae_u8 **, uae_u8); -extern uae_u16 restore_u16_func (uae_u8 **); +extern uae_u64 restore_u64_func (uae_u8 **); extern uae_u32 restore_u32_func (uae_u8 **); +extern uae_u16 restore_u16_func (uae_u8 **); extern uae_u8 restore_u8_func (uae_u8 **); extern void save_string_func (uae_u8 **, char*); extern char *restore_string_func (uae_u8 **); -#define save_u16(x) save_u16_func (&dst, (x)) +#define save_u64(x) save_u64_func (&dst, (x)) #define save_u32(x) save_u32_func (&dst, (x)) +#define save_u16(x) save_u16_func (&dst, (x)) #define save_u8(x) save_u8_func (&dst, (x)) -#define restore_u16() restore_u16_func (&src) +#define restore_u64() restore_u64_func (&src) #define restore_u32() restore_u32_func (&src) +#define restore_u16() restore_u16_func (&src) #define restore_u8() restore_u8_func (&src) #define save_string(x) save_string_func (&dst, (x)) @@ -74,6 +78,9 @@ extern uae_u8 *save_p96 (int *, uae_u8 *); extern uae_u8 *restore_keyboard (uae_u8 *); extern uae_u8 *save_keyboard (int *); +extern uae_u8 *restore_filesys (uae_u8 *src); +extern uae_u8 *save_filesys (int num, int *len); + extern void restore_cram (int, long); extern void restore_bram (int, long); extern void restore_fram (int, long); diff --git a/include/uae.h b/include/uae.h index 2638298e..0c7caf10 100755 --- a/include/uae.h +++ b/include/uae.h @@ -42,3 +42,4 @@ struct bstring { extern char *colormodes[]; extern void fetch_saveimagepath (char*, int, int); +extern void fetch_configurationpath (char *out, int size); diff --git a/memory.c b/memory.c index c4911cff..918869bb 100755 --- a/memory.c +++ b/memory.c @@ -85,7 +85,7 @@ char *romlist_get (struct romdata *rd) void romlist_clear (void) { - free (rl); + xfree (rl); rl = 0; romlist_cnt = 0; } @@ -93,34 +93,34 @@ void romlist_clear (void) static struct romdata roms[] = { { "Cloanto Amiga Forever ROM key", 0, 0, 0x869ae1b1, 2069, 0, 68000, ROMTYPE_KEY }, - { "Kickstart v1.0", 0, 0, 0x299790ff, 262144, 1, 68000, ROMTYPE_KICK }, - { "Kickstart v1.1 (NTSC)", 31, 34, 0xd060572a, 262144, 2, 68000, ROMTYPE_KICK }, - { "Kickstart v1.1 (PAL)", 31, 34, 0xec86dae2, 262144, 3, 68000, ROMTYPE_KICK }, - { "Kickstart v1.2", 33, 166, 0x0ed783d0, 262144, 4, 68000, ROMTYPE_KICK }, - { "Kickstart v1.2", 33, 180, 0xa6ce1636, 262144, 5, 68000, ROMTYPE_KICK }, - { "Kickstart v1.3", 34, 5, 0xc4f0f55f, 262144, 6, 68000, ROMTYPE_KICK }, - { "Kickstart v1.3", 34, 5, 0xe0f37258, 262144, 32, 68000, ROMTYPE_KICK }, - - { "Kickstart v2.04", 37, 175, 0xc3bdb240, 524288, 7, 68000, ROMTYPE_KICK }, - { "Kickstart v2.05", 37, 299, 0x83028fb5, 524288, 8, 68000, ROMTYPE_KICK }, - { "Kickstart v2.05", 37, 300, 0x64466c2a, 524288, 9, 68000, ROMTYPE_KICK }, - { "Kickstart v2.05", 37, 350, 0x43b0df7b, 524288, 10, 68000, ROMTYPE_KICK }, - - { "Kickstart v3.0", 39, 106, 0x6c9b07d2, 524288, 11, 68000, ROMTYPE_KICK }, - { "Kickstart v3.0", 39, 106, 0x9e6ac152, 524288, 12, 68020, ROMTYPE_KICK }, - { "Kickstart v3.1", 40, 55, 0x14e93bcc, 524288, 13, 68020, ROMTYPE_KICK }, - { "Kickstart v3.1", 40, 63, 0xfc24ae0d, 524288, 14, 68000, ROMTYPE_KICK }, - { "Kickstart v3.1", 40, 68, 0x1483a091, 524288, 15, 68020, ROMTYPE_KICK }, - { "Kickstart v3.1 (Cloanto)", 40, 68, 0x43b6dd22, 524288, 31, 68020, ROMTYPE_KICK }, - { "Kickstart v3.1", 40, 68, 0xd6bae334, 524288, 16, 68020, ROMTYPE_KICK }, -// { "Kickstart v3.1", 40, 70, 0x917100a0, 524288, 17, 68020, ROMTYPE_KICK }, + { "Kickstart v1.0 (A1000)(NTSC)", 0, 0, 0x299790ff, 262144, 1, 68000, ROMTYPE_KICK }, + { "Kickstart v1.1 (A1000)(NTSC)", 31, 34, 0xd060572a, 262144, 2, 68000, ROMTYPE_KICK }, + { "Kickstart v1.1 (A1000)(PAL)", 31, 34, 0xec86dae2, 262144, 3, 68000, ROMTYPE_KICK }, + { "Kickstart v1.2 (A1000)", 33, 166, 0x0ed783d0, 262144, 4, 68000, ROMTYPE_KICK }, + { "Kickstart v1.2 (A500,A1000,A2000)", 33, 180, 0xa6ce1636, 262144, 5, 68000, ROMTYPE_KICK }, + { "Kickstart v1.3 (A500,A1000,A2000)", 34, 5, 0xc4f0f55f, 262144, 6, 68000, ROMTYPE_KICK }, + { "Kickstart v1.3 (A3000)", 34, 5, 0xe0f37258, 262144, 32, 68000, ROMTYPE_KICK }, + + { "Kickstart v2.04 (A500+)", 37, 175, 0xc3bdb240, 524288, 7, 68000, ROMTYPE_KICK }, + { "Kickstart v2.05 (A600)", 37, 299, 0x83028fb5, 524288, 8, 68000, ROMTYPE_KICK }, + { "Kickstart v2.05 (A600HD)", 37, 300, 0x64466c2a, 524288, 9, 68000, ROMTYPE_KICK }, + { "Kickstart v2.05 (A600HD)", 37, 350, 0x43b0df7b, 524288, 10, 68000, ROMTYPE_KICK }, + + { "Kickstart v3.0 (A1200)", 39, 106, 0x6c9b07d2, 524288, 11, 68000, ROMTYPE_KICK }, + { "Kickstart v3.0 (A4000)", 39, 106, 0x9e6ac152, 524288, 12, 68020, ROMTYPE_KICK }, +// { "Kickstart v3.1", 40, 55, 0x14e93bcc, 524288, 13, 68020, ROMTYPE_KICK }, !! HACK + { "Kickstart v3.1 (A500,A600,A2000)", 40, 63, 0xfc24ae0d, 524288, 14, 68000, ROMTYPE_KICK }, + { "Kickstart v3.1 (A1200)", 40, 68, 0x1483a091, 524288, 15, 68020, ROMTYPE_KICK }, + { "Kickstart v3.1 (A4000)(Cloanto)", 40, 68, 0x43b6dd22, 524288, 31, 68020, ROMTYPE_KICK }, + { "Kickstart v3.1 (A4000)", 40, 68, 0xd6bae334, 524288, 16, 68020, ROMTYPE_KICK }, + { "Kickstart v3.1 (A4000T)", 40, 70, 0x75932c3a, 524288, 17, 68020, ROMTYPE_KICK }, { "CD32 Kickstart v3.1", 40, 60, 0x1e62d4a5, 524288, 18, 68020, ROMTYPE_KICKCD32 }, { "CD32 Extended", 40, 60, 0x87746be2, 524288, 19, 68020, ROMTYPE_EXTCD32 }, { "CDTV Extended v1.0", 0, 0, 0x42baa124, 262144, 20, 68000, ROMTYPE_EXTCDTV }, { "CDTV Extended v2.3", 0, 0, 0x30b54232, 262144, 21, 68000, ROMTYPE_EXTCDTV }, - { "CDTV Extended v2.7", 0, 0, 0xceae68d2, 262144, 22, 68000, ROMTYPE_EXTCDTV }, +// { "CDTV Extended v2.7", 0, 0, 0xceae68d2, 262144, 22, 68000, ROMTYPE_EXTCDTV }, !! Non Confirmed { "A1000 Bootstrap", 0, 0, 0x62f11c04, 8192, 23, 68000, ROMTYPE_KICK }, { "A1000 Bootstrap", 0, 0, 0x0b1ad2d0, 65536, 24, 68000, ROMTYPE_KICK }, @@ -1162,7 +1162,7 @@ uae_u8 *load_keyfile (struct uae_prefs *p, char *path, int *size) keysize = zfile_ftell (f); if (keysize > 0) { zfile_fseek (f, 0, SEEK_SET); - keybuf = malloc (keysize); + keybuf = xmalloc (keysize); zfile_fread (keybuf, 1, keysize, f); } zfile_fclose (f); @@ -1172,7 +1172,7 @@ uae_u8 *load_keyfile (struct uae_prefs *p, char *path, int *size) } void free_keyfile (uae_u8 *key) { - free (key); + xfree (key); } static int decode_cloanto_rom (uae_u8 *mem, int size, int real_size) @@ -1246,7 +1246,7 @@ int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksum, int return 0; } if (i == 8192 || i == 65536) { - a1000_bootrom = malloc (65536); + a1000_bootrom = xmalloc (65536); memcpy (a1000_bootrom, kickmemory, 65536); memset (kickmemory, 0, kickmem_size); a1000_handle_kickstart (1); @@ -1392,12 +1392,12 @@ err: uae_u8 *mapped_malloc (size_t s, char *file) { - return malloc (s); + return xmalloc (s); } void mapped_free (uae_u8 *p) { - free (p); + xfree (p); } #else @@ -1466,7 +1466,7 @@ static void delete_shmmaps (uae_u32 start, uae_u32 size) x->prev->next = x->next; else shm_start = x->next; - free (x); + xfree (x); } else { size -= 0x10000; start += 0x10000; @@ -1488,7 +1488,7 @@ static void add_shmmaps (uae_u32 start, addrbank *what) x = find_shmpiece (base); if (!x) return; - y = malloc (sizeof (shmpiece)); + y = xmalloc (sizeof (shmpiece)); *y = *x; base = ((uae_u8 *) NATMEM_OFFSET) + start; y->native_address = shmat (y->id, base, 0); @@ -1522,7 +1522,7 @@ uae_u8 *mapped_malloc (size_t s, char *file) answer = shmat (id, 0, 0); shmctl (id, IPC_RMID, NULL); if (answer != (void *) -1) { - x = malloc (sizeof (shmpiece)); + x = xmalloc (sizeof (shmpiece)); x->native_address = answer; x->id = id; x->size = s; @@ -1657,7 +1657,7 @@ void memory_reset (void) { ersatzkickfile = 0; a1000_handle_kickstart (0); - free (a1000_bootrom); + xfree (a1000_bootrom); a1000_bootrom = 0; a1000_kickstart_mode = 0; memcpy (currprefs.romfile, changed_prefs.romfile, sizeof currprefs.romfile); @@ -1804,7 +1804,7 @@ void memory_cleanup (void) if (kickmemory) mapped_free (kickmemory); if (a1000_bootrom) - free (a1000_bootrom); + xfree (a1000_bootrom); if (chipmemory) mapped_free (chipmemory); @@ -1924,6 +1924,7 @@ uae_u8 *restore_rom (uae_u8 *src) } } src += strlen (src) + 1; + src += strlen (src) + 1; return src; } @@ -1965,7 +1966,7 @@ uae_u8 *save_rom (int first, int *len, uae_u8 *dstptr) if (dstptr) dstbak = dst = dstptr; else - dstbak = dst = malloc (4 + 4 + 4 + 4 + 4 + 256 + 256 + mem_size); + dstbak = dst = xmalloc (4 + 4 + 4 + 4 + 4 + 256 + 256 + mem_size); save_u32 (mem_start); save_u32 (mem_size); save_u32 (mem_type); diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index 359f2be8..44ee7892 100755 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -201,6 +201,7 @@ #define IDS_STARTEMULATION 238 #define IDS_TREEVIEW_ABOUT 239 #define IDS_NOHARDDRIVES 240 +#define IDS_DEFAULT_HOST 241 #define IDS_NUMSG_NEEDEXT2 300 #define IDS_NUMSG_NOROMKEY 301 #define IDS_NUMSG_KSROMCRCERROR 302 @@ -220,6 +221,18 @@ #define IDS_IMGCHK_DAMAGED 316 #define IDS_IMGCHK_KS2 317 #define IDS_IMGCHK_KS3 318 +#define IDS_ROMSCANEND 319 +#define IDS_ROM_AVAILABLE 320 +#define IDS_ROM_UNAVAILABLE 321 +#define IDS_QS_MODELS 1000 +#define IDS_QS_MODEL_A500 1001 +#define IDS_QS_MODEL_A500P 1002 +#define IDS_QS_MODEL_A600 1003 +#define IDS_QS_MODEL_A1000 1004 +#define IDS_QS_MODEL_A1200 1005 +#define IDS_QS_MODEL_CD32 1006 +#define IDS_QS_MODEL_CDTV 1007 +#define IDS_QS_MODEL_UAE 1008 #define IDC_RESOLUTION 1021 #define IDC_SERIAL 1022 #define IDC_REFRESHRATE 1022 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 83f4d1c0..f26c7211 100755 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -624,13 +624,13 @@ BEGIN CONTROL "ECS Agnus [] Partial Enhanced Chipset. Later A500 and A2000 hardware revisions.", IDC_ECS_AGNUS,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP, 38,47,55,10 - CONTROL "Full ECS [] Full ECS Chipset, ECS Agnus and ECS Denise. (A500+/A600, A3000)", + CONTROL "Full ECS [] Full ECS Chipset, ECS Agnus and ECS Denise. (A500+, A600, A3000)", IDC_ECS,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,38,63, 52,10 CONTROL "AGA [] The next generation Amiga chipset (A1200, A4000 and CD32)", IDC_AGA,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,101,31, 51,10 - CONTROL "NTSC [] North American and Japanese display standard, 60Hz refresh rate. (PAL is 50Hz)", + CONTROL "NTSC [] North American and Japanese display standard, 60Hz refresh rate. Other countries use PAL (50Hz. display refresh rate)", IDC_NTSC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,63,50, 10 GROUPBOX "Misc chipset options",IDC_STATIC,168,11,114,82 @@ -1327,6 +1327,7 @@ END STRINGTABLE BEGIN IDS_NOHARDDRIVES "No Amiga formatted or completely empty harddrives detected." + IDS_DEFAULT_HOST "Default Configuration" END STRINGTABLE @@ -1355,6 +1356,30 @@ BEGIN IDS_IMGCHK_DAMAGED "Selected disk image is damaged or unformatted" IDS_IMGCHK_KS2 "Selected disk image requires Kickstart 2.04 or 3.0\nConfiguration updated" IDS_IMGCHK_KS3 "Selected disk image requires Kickstart 3.0 or later\nConfiguration updated" + IDS_ROMSCANEND "ROM scan finished" +END + +STRINGTABLE +BEGIN + IDS_ROM_AVAILABLE "available" + IDS_ROM_UNAVAILABLE "unavailable" +END + +STRINGTABLE +BEGIN + IDS_QS_MODELS "Amiga 500\nAmiga 500+\nAmiga 600\nAmiga 1000\nAmiga 1200\nCD32\nCDTV (CDROM emulation not yet working)\nExpanded UAE example configuration" + IDS_QS_MODEL_A500 "KS 1.3, OCS Agnus, 0.5M Chip + 0.5M Slow (most common)\nThis configuration is capable of running most games and demos ever produced for the first Amiga line. Only few exceptions need different configuration. Oldest Amiga games tend to be incompatible with this configuration.\nKS 1.3, ECS Agnus, 0.5M Chip + 0.5M Slow\nLater hardware revision of Amiga 500. Nearly 100% compatible with previous configuration.\nKS 1.3, ECS Agnus, 1.0M Chip\nFew newer games and demos require this configuration.\nKS 1.3, OCS Agnus, 0.5M Chip\nVery old (~1987 and older) games and demos may require this configuration.\nKS 1.2, OCS Agnus, 0.5M Chip\nThe first Amiga 500 produced had this configuration. Some very old programs only work correctly with this configuration. NOTE: This configuration cannot boot the Amiga OS installed on an emulated HD.\nKS 1.2, OCS Agnus, 0.5M Chip + 0.5M Slow\nThis configuration adds expansion memory to the first Amiga 500 ever produced. Try this if your game do not work with newer configurations but works with the previous one. It could add some features to the game and faster game loading. NOTE: This configuration cannot boot the Amiga OS installed on an emulated HD." + IDS_QS_MODEL_A500P "Basic non-expanded configuration\nA500+ is basically an Amiga 500 with ECS Agnus, 1MB of Chip RAM and Kickstart 2.0 ROM. Many Amiga 500 games and demos won't work properly on an Amiga 500+.\n2M Chip RAM expanded configuration\n\n4M Fast RAM expanded configuration\n" + IDS_QS_MODEL_A600 "Basic non-expanded configuration\nA600 is basically smaller Amiga 500+ with updated Kickstart 2.0 ROM.\n2M Chip RAM expanded configuration\n\n4M Fast RAM expanded configuration\n" + IDS_QS_MODEL_A1000 "0.5M Chip\nThe Amiga 1000 was the first Amiga ever produced, configuration is basically an OCS A500. You should never use this configuration unless you are nostalgic and you want to hear short special A1000 boot tune\n256K Chip\nUnexpanded Amiga 1000. All later A1000 models were sold with 256K RAM expansion build-in." + IDS_QS_MODEL_A1200 "Basic non-expanded configuration\nUse this configuration to run most AGA demos and games\n4M Fast RAM expanded configuration\nSome newer AGA games and demos need an expanded A1200 to run." + IDS_QS_MODEL_CD32 "CD32\nCD32 was the first 32bit console. It is basically an A1200 with build-in CDROM. Insert your CD32 or CDTV CDROM into a free CDROM drive before starting emulation." + IDS_QS_MODEL_CDTV "CDTV\nCDTV was Commodore`s first attempt at making a CD-ROM equipped computer. It is an 1MB ECS Amiga 500 in a black box that looks like a CD player." +END + +STRINGTABLE +BEGIN + IDS_QS_MODEL_UAE "High-end expanded configuration\nThis configuration can be used as a basis for your own A3000/A4000-style high-performance, expanded custom configuration for Workbench, applications, WHDLoad etc.." END #endif // English (U.S.) resources diff --git a/od-win32/win32.c b/od-win32/win32.c index 6dfe20bf..f0a30075 100755 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -1538,6 +1538,10 @@ void fetch_saveimagepath (char *out, int size, int dir) fetch_path ("SaveimagePath", out, size); } } +void fetch_configurationpath (char *out, int size) +{ + fetch_path ("ConfigurationPath", out, size); +} void fetch_path (char *name, char *out, int size) { @@ -1549,6 +1553,8 @@ void fetch_path (char *name, char *out, int size) strcat (out, "..\\shared\\hdf\\"); if (!strcmp (name, "KickstartPath")) strcat (out, "..\\shared\\rom\\"); + if (!strcmp (name, "ConfigurationPath")) + strcat (out, "Configurations\\"); if (hWinUAEKey) RegQueryValueEx (hWinUAEKey, name, 0, NULL, out, &size); if (out[0] == '\\') { /* relative? */ diff --git a/od-win32/win32.h b/od-win32/win32.h index e277b0dd..a1633510 100755 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -21,7 +21,7 @@ extern int manual_painting_needed; extern int manual_palette_refresh_needed; extern int mouseactive, focus; #define WINUAEBETA 1 -#define WINUAEBETASTR " Beta 7" +#define WINUAEBETASTR " Beta 8" extern void my_kbd_handler (int, int, int); extern void clearallkeys(void); diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index e2d14339..c39c4fc0 100755 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -96,9 +96,6 @@ extern char *start_path; static char config_filename[ MAX_DPATH ] = ""; -static drive_specs blankdrive = -{"", "", 1, 32, 1, 2, 0, 0}; - #define Error(x) MessageBox( NULL, (x), "WinUAE Error", MB_OK ) void WIN32GUI_LoadUIString( DWORD id, char *string, DWORD dwStringLen ) @@ -248,49 +245,95 @@ static void show_rom_list (void) { char *p; int roms[6], ok; + char unavail[MAX_DPATH], avail[MAX_DPATH], tmp1[MAX_DPATH]; + char *p1, *p2; + + WIN32GUI_LoadUIString (IDS_ROM_AVAILABLE, avail, sizeof (avail)); + WIN32GUI_LoadUIString (IDS_ROM_UNAVAILABLE, unavail, sizeof (avail)); + strcat (avail, "\n"); + strcat (unavail, "\n"); + WIN32GUI_LoadUIString (IDS_QS_MODELS, tmp1, sizeof (tmp1)); + p1 = tmp1; p = malloc (100000); if (!p) return; - strcpy (p, "ROM scan results:\n\n"); + WIN32GUI_LoadUIString (IDS_ROMSCANEND, p, 100); + strcat (p, "\n\n"); - strcat (p, "Amiga 500 Kickstart 1.2: "); + /* A500 */ + p2 = strchr (p1, '\n'); + if (!p2) goto end; + *p2++= 0; strcat (p, p1); strcat (p, " Kickstart 1.2:"); roms[0] = 5; roms[1] = 4; roms[2] = -1; - if (listrom (roms)) strcat (p, "available"); else strcat (p, "unavailable"); - - strcat (p, "\nAmiga 500 Kickstart 1.3: "); + if (listrom (roms)) strcat (p, avail); else strcat (p, unavail); + strcat (p, p1); strcat (p, " Kickstart 1.3:"); roms[0] = 6; roms[1] = 32; roms[2] = -1; - if (listrom (roms)) strcat (p, "available"); else strcat (p, "unavailable"); - - strcat (p, "\nAmiga 1000: "); + if (listrom (roms)) strcat (p, avail); else strcat (p, unavail); + p1 = p2; + + /* A500+ */ + p2 = strchr (p1, '\n'); + if (!p2) goto end; + *p2++= 0; strcat (p, p1); strcat (p, ": "); + roms[0] = 7; roms[1] = -1; + if (listrom (roms)) strcat (p, avail); else strcat (p, unavail); + p1 = p2; + + /* A600 */ + p2 = strchr (p1, '\n'); + if (!p2) goto end; + *p2++= 0; strcat (p, p1); strcat (p, ": "); + roms[0] = 9; roms[1] = 10; roms[2] = -1; + if (listrom (roms)) strcat (p, avail); else strcat (p, unavail); + p1 = p2; + + /* A1000 */ + p2 = strchr (p1, '\n'); + if (!p2) goto end; + *p2++= 0; strcat (p, p1); strcat (p, ": "); roms[0] = 23; roms[1] = 24; roms[2] = -1; - if (listrom (roms)) strcat (p, "available"); else strcat (p, "unavailable"); + if (listrom (roms)) strcat (p, avail); else strcat (p, unavail); + p1 = p2; - strcat (p, "\nAmiga 1200: "); + /* A1200 */ + p2 = strchr (p1, '\n'); + if (!p2) goto end; + *p2++= 0; strcat (p, p1); strcat (p, ": "); roms[0] = 11; roms[1] = 31; roms[2] = 15; roms[3] = -1; - if (listrom (roms)) strcat (p, "available"); else strcat (p, "unavailable"); + if (listrom (roms)) strcat (p, avail); else strcat (p, unavail); + p1 = p2; + /* CD32 */ ok = 0; - strcat (p, "\nCD32: "); + p2 = strchr (p1, '\n'); + if (!p2) goto end; + *p2++= 0; strcat (p, p1); strcat (p, ": "); roms[0] = 18; roms[1] = -1; if (listrom (roms)) { roms[0] = 19; if (listrom (roms)) ok = 1; } - if (ok) strcat (p, "available"); else strcat (p, "unavailable"); + if (ok) strcat (p, avail); else strcat (p, unavail); + p1 = p2; + /* CDTV */ ok = 0; - strcat (p, "\nCDTV: "); - roms[0] = 20; roms[1] = 21; roms[2] = 22; roms[3] = -1; + p2 = strchr (p1, '\n'); + if (!p2) goto end; + *p2++= 0; strcat (p, p1); strcat (p, ": "); + roms[0] = 20; roms[1] = 21; roms[2] = -1; if (listrom (roms)) { roms[0] = 6; roms[1] = 32; roms[2] = -1; if (listrom (roms)) ok = 1; } - if (ok) strcat (p, "available"); else strcat (p, "unavailable"); + if (ok) strcat (p, avail); else strcat (p, unavail); + p1 = p2; pre_gui_message (p); +end: free (p); } @@ -2180,6 +2223,9 @@ static BOOL CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP recursive++; pages[PATHS_ID] = hDlg; currentpage = PATHS_ID; +#ifndef WINUAEBETA + ShowWindow (GetDlgItem (hDlg, IDC_RESETREGISTRY), FALSE); +#endif values_to_pathsdialog (hDlg); recursive--; return TRUE; @@ -2259,102 +2305,21 @@ static BOOL CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP } struct amigamodels { - char *name; int compalevels; + int id; }; static struct amigamodels amodels[] = { - { "Amiga 500", 4 }, - { "Amiga 500+", 4 }, - { "Amiga 600", 4 }, - { "Amiga 1000", 4 }, - { "Amiga 1200", 3 }, - { "CD32", 3 }, - { "CDTV (CDROM emulation not yet working)", 4 }, - { "", 0 }, - { "", 0 }, - { "", 0 }, - { "Expanded UAE example configuration", 1 }, - { 0 } -}; - -struct amigaconfig { - int model; - char *name; - char *info; -}; -static struct amigaconfig aconf[] = { - { 0, "KS 1.3, OCS Agnus, 0.5M Chip + 0.5M Slow (most common)", - "This configuration is capable of running most games and demos ever produced " - "for the first Amiga line. Only few exceptions need different configuration. " - "Oldest Amiga games tend to be incompatible with this configuration. " - }, - { 0, "KS 1.3, ECS Agnus, 0.5M Chip + 0.5M Slow", - "Later hardware revision of Amiga 500. Nearly 100% compatible with " - "previous configuration." - }, - { 0, "KS 1.3, ECS Agnus, 1.0M Chip", - "Few newer games and demos require this configuration." - }, - { 0, "KS 1.3, OCS Agnus, 0.5M Chip", - "Very old (~1987 and older) games and demos may require this configuration." - }, - { 0, "KS 1.2, OCS Agnus, 0.5M Chip", - "The first Amiga 500 produced had this configuration. Some very " - "old programs only work correctly with this configuration. NOTE: This configuration " - "cannot boot the Amiga OS installed on an emulated HD." - }, - { 0, "KS 1.2, OCS Agnus, 0.5M Chip + 0.5M Slow", - "This configuration adds expansion memory to the first Amiga 500 ever " - "produced. Try this if your game do not work with newer configurations " - "but works with the previous one. It could add some features to the game and " - "faster game loading. NOTE: This configuration cannot boot the Amiga OS " - "installed on an emulated HD." - }, - - { 1, "Basic non-expanded configuration", - "A500+ is basically an Amiga 500 with ECS Agnus, " - "1MB of Chip RAM and Kickstart 2.0 ROM. " - "Many Amiga 500 games and demos won't work properly on an Amiga 500+." }, - { 1, "2M Chip RAM expanded configuration", - NULL }, - { 1, "4M Fast RAM expanded configuration", - NULL }, - - { 2, "Basic non-expanded configuration", - "A600 is basically smaller Amiga 500+ with updated Kickstart 2.0 ROM." }, - { 2, "2M Chip RAM expanded configuration", - NULL }, - { 2, "4M Fast RAM expanded configuration", - NULL }, - - { 3, "0.5M Chip", - "The Amiga 1000 was the first Amiga ever produced, configuration is basically " - "an OCS A500. You should never use this configuration unless " - "you are nostalgic and you want to hear short special A1000 boot tune :)" - }, - { 3, "256K Chip", - "Unexpanded Amiga 1000. All later A1000 models were sold with 256K RAM " - "expansion build-in." - }, - { 4, "Basic non-expanded configuration", - "Use this configuration to run most AGA demos and games." - }, - { 4, "4M Fast RAM expanded configuration", - "Some newer AGA games and demos need an expanded A1200 to run." - }, - { 5, "CD32", - "CD32 was the first 32bit console. It is basically an A1200 with " - "build-in CDROM. Insert your CD32 or CDTV CDROM into a free CDROM drive before " - "starting emulation." - }, - { 6, "CDTV", - "CDTV was Commodore`s first attempt at making a CD-ROM equipped computer. " - "It is an 1MB ECS Amiga 500 in a black box that looks like a CD player." - }, - { 10, "High-end expanded configuration", - "This configuration can be used as a basis for your own A3000/A4000-style " - "high-performance, expanded custom configuration for Workbench, applications, WHDLoad etc.." - }, + { 4, IDS_QS_MODEL_A500 }, // "Amiga 500" + { 4, IDS_QS_MODEL_A500P }, // "Amiga 500+" + { 4, IDS_QS_MODEL_A600 }, // "Amiga 600" + { 4, IDS_QS_MODEL_A1000 }, // "Amiga 1000" + { 3, IDS_QS_MODEL_A1200 }, // "Amiga 1200", + { 3, IDS_QS_MODEL_CD32 }, // "CD32" + { 4, IDS_QS_MODEL_CDTV }, // "CDTV" + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 1, IDS_QS_MODEL_UAE }, // "Expanded UAE example configuration" { -1 } }; @@ -2405,9 +2370,10 @@ static void init_quickstartdlg_tooltip (HWND hDlg, char *tt) static void init_quickstartdlg (HWND hDlg) { static int firsttime; - int i, j, cnt, idx, idx2; + int i, j, idx, idx2; DWORD dwType, qssize; - char tmp1[MAX_DPATH], tmp2[MAX_DPATH]; + char tmp1[2 * MAX_DPATH], tmp2[MAX_DPATH]; + char *p1, *p2; qssize = sizeof (tmp1); RegQueryValueEx (hWinUAEKey, "QuickStartHostConfig", 0, &dwType, (LPBYTE)tmp1, &qssize); @@ -2433,12 +2399,20 @@ static void init_quickstartdlg (HWND hDlg) CheckDlgButton (hDlg, IDC_QUICKSTARTMODE, quickstart); + WIN32GUI_LoadUIString (IDS_QS_MODELS, tmp1, sizeof (tmp1)); + strcat (tmp1, "\n"); + p1 = tmp1; SendDlgItemMessage (hDlg, IDC_QUICKSTART_MODEL, CB_RESETCONTENT, 0, 0L); idx = idx2 = 0; i = 0; - while (amodels[i].name) { + while (amodels[i].compalevels >= 0) { if (amodels[i].compalevels > 0) { - SendDlgItemMessage (hDlg, IDC_QUICKSTART_MODEL, CB_ADDSTRING, 0, (LPARAM)amodels[i].name); + p2 = strchr (p1, '\n'); + if (p2 && strlen (p2) > 0) { + *p2++ = 0; + SendDlgItemMessage (hDlg, IDC_QUICKSTART_MODEL, CB_ADDSTRING, 0, (LPARAM)p1); + p1 = p2; + } if (i == quickstart_model) idx2 = idx; idx++; @@ -2447,24 +2421,34 @@ static void init_quickstartdlg (HWND hDlg) } SendDlgItemMessage (hDlg, IDC_QUICKSTART_MODEL, CB_SETCURSEL, idx2, 0); + WIN32GUI_LoadUIString (amodels[quickstart_model].id, tmp1, sizeof (tmp1)); + strcat (tmp1, "\n"); + p1 = tmp1; init_quickstartdlg_tooltip (hDlg, 0); SendDlgItemMessage (hDlg, IDC_QUICKSTART_CONFIGURATION, CB_RESETCONTENT, 0, 0L); i = 0; - cnt = 0; - while (aconf[i].model >= 0) { - if (aconf[i].model == quickstart_model) { - SendDlgItemMessage (hDlg, IDC_QUICKSTART_CONFIGURATION, CB_ADDSTRING, 0, (LPARAM)aconf[i].name); - if (quickstart_conf == cnt) { - init_quickstartdlg_tooltip (hDlg, aconf[i].info); - } - cnt++; - } + for (;;) { + p2 = strchr (p1, '\n'); + if (!p2) + break; + *p2++= 0; + SendDlgItemMessage (hDlg, IDC_QUICKSTART_CONFIGURATION, CB_ADDSTRING, 0, (LPARAM)p1); + p1 = p2; + p2 = strchr (p1, '\n'); + if (!p2) + break; + *p2++= 0; + if (quickstart_conf == i && strlen (p1) > 0) + init_quickstartdlg_tooltip (hDlg, p1); + p1 = p2; i++; } - if (quickstart_conf >= cnt) + if (quickstart_conf >= i) quickstart_conf = 0; SendDlgItemMessage (hDlg, IDC_QUICKSTART_CONFIGURATION, CB_SETCURSEL, quickstart_conf, 0); + if (quickstart_compa >= amodels[quickstart_model].compalevels) + quickstart_compa = 1; if (quickstart_compa >= amodels[quickstart_model].compalevels) quickstart_compa = 0; i = amodels[quickstart_model].compalevels; @@ -2474,7 +2458,8 @@ static void init_quickstartdlg (HWND hDlg) SendDlgItemMessage( hDlg, IDC_QUICKSTART_COMPATIBILITY, TBM_SETPOS, TRUE, quickstart_compa); SendDlgItemMessage (hDlg, IDC_QUICKSTART_HOSTCONFIG, CB_RESETCONTENT, 0, 0L); - SendDlgItemMessage (hDlg, IDC_QUICKSTART_HOSTCONFIG, CB_ADDSTRING, 0, (LPARAM)"Default configuration"); + WIN32GUI_LoadUIString (IDS_DEFAULT_HOST, tmp1, sizeof (tmp1)); + SendDlgItemMessage (hDlg, IDC_QUICKSTART_HOSTCONFIG, CB_ADDSTRING, 0, (LPARAM)tmp1); idx = 0; j = 1; for (i = 0; i < configstoresize; i++) { @@ -2606,7 +2591,7 @@ static BOOL CALLBACK QuickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR val = SendDlgItemMessage (hDlg, IDC_QUICKSTART_MODEL, CB_GETCURSEL, 0, 0L); if (val != CB_ERR) { i = 0; - while (amodels[i].name) { + while (amodels[i].compalevels >= 0) { if (amodels[i].compalevels > 0) val--; if (val < 0) @@ -2683,16 +2668,20 @@ static BOOL CALLBACK QuickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR recursive--; break; } - if (strcmp (workprefs.df[0], df0) || workprefs.dfxtype[0] != dfxtype[0]) { - strcpy (df0, workprefs.df[0]); - dfxtype[0] = workprefs.dfxtype[0]; - testimage (hDlg, 0); - enable_for_quickstart (hDlg); - } - if (strcmp (workprefs.df[1], df1) || workprefs.dfxtype[1] != dfxtype[1]) { - strcpy (df1, workprefs.df[1]); - dfxtype[1] = workprefs.dfxtype[1]; - testimage (hDlg, 1); + if (recursive == 0) { + recursive++; + if (strcmp (workprefs.df[0], df0) || workprefs.dfxtype[0] != dfxtype[0]) { + strcpy (df0, workprefs.df[0]); + dfxtype[0] = workprefs.dfxtype[0]; + testimage (hDlg, 0); + enable_for_quickstart (hDlg); + } + if (strcmp (workprefs.df[1], df1) || workprefs.dfxtype[1] != dfxtype[1]) { + strcpy (df1, workprefs.df[1]); + dfxtype[1] = workprefs.dfxtype[1]; + testimage (hDlg, 1); + } + recursive--; } return ret; } @@ -7778,7 +7767,7 @@ void gui_message (const char *format,...) int flipflop = 0; int fullscreen = 0; int focuso = focus; - DWORD flags = MB_OK | MB_ICONWARNING | MB_TASKMODAL; + DWORD flags = MB_OK | MB_TASKMODAL; HWND hwnd; va_start (parms, format); @@ -7810,7 +7799,7 @@ void gui_message (const char *format,...) void pre_gui_message (const char *format,...) { char msg[2048]; - char szTitle[ MAX_DPATH ]; + char szTitle[MAX_DPATH]; va_list parms; va_start (parms, format); @@ -7820,8 +7809,8 @@ void pre_gui_message (const char *format,...) if (msg[strlen(msg)-1]!='\n') write_log("\n"); - WIN32GUI_LoadUIString( IDS_ERRORTITLE, szTitle, MAX_DPATH ); - MessageBox (guiDlg, msg, szTitle, MB_OK | MB_ICONWARNING | MB_TASKMODAL | MB_SETFOREGROUND ); + WIN32GUI_LoadUIString (IDS_ERRORTITLE, szTitle, MAX_DPATH); + MessageBox (guiDlg, msg, szTitle, MB_OK | MB_TASKMODAL | MB_SETFOREGROUND ); } diff --git a/od-win32/win32gui.h b/od-win32/win32gui.h index 710e9a94..03227bed 100755 --- a/od-win32/win32gui.h +++ b/od-win32/win32gui.h @@ -1,36 +1,7 @@ #ifndef WIN32GUI_H #define WIN32GUI_H -#define MAXJOYSTICKS 2 - -#define MAX_BUFFER_SIZE 256 -#define NUM_DRIVES 16 - -typedef struct -{ - char path[256]; - char name[256]; - uae_u16 rw; - uae_u8 sectors; - uae_u8 surfaces; - uae_u8 reserved; - uae_u8 hardfile; - uae_u16 spare; -} drive_specs; - -extern drive_specs drives[NUM_DRIVES]; - #define CFG_DESCRIPTION_LENGTH 128 -#define CFG_SER_LENGTH 256 -#define CFG_ROM_LENGTH 256 -#define CFG_PAR_LENGTH 256 -#define CFG_KEY_LENGTH 256 - -#define CONFIG_VERSION_MAJOR 1 -#define CONFIG_VERSION_MINOR 2 - -#define DIRECT_SOUND_ENABLED 0x01 -#define AHI_ENABLED 0x02 #define CONFIG_SAVE 0 #define CONFIG_LOAD 1 diff --git a/savestate.c b/savestate.c index 85c76065..84ef6661 100755 --- a/savestate.c +++ b/savestate.c @@ -92,6 +92,11 @@ void save_u32_func (uae_u8 **dstp, uae_u32 v) *dst++ = (uae_u8)(v >> 0); *dstp = dst; } +void save_u64_func (uae_u8 **dstp, uae_u64 v) +{ + save_u32_func (dstp, (uae_u32)(v >> 32)); + save_u32_func (dstp, (uae_u32)v); +} void save_u16_func (uae_u8 **dstp, uae_u16 v) { uae_u8 *dst = *dstp; @@ -108,7 +113,7 @@ void save_u8_func (uae_u8 **dstp, uae_u8 v) void save_string_func (uae_u8 **dstp, char *from) { uae_u8 *dst = *dstp; - while(*from) + while(from && *from) *dst++ = *from++; *dst++ = 0; *dstp = dst; @@ -122,6 +127,15 @@ uae_u32 restore_u32_func (uae_u8 **dstp) *dstp = dst + 4; return v; } +uae_u64 restore_u64_func (uae_u8 **dstp) +{ + uae_u64 v; + + v = restore_u32_func (dstp); + v <<= 32; + v |= restore_u32_func (dstp); + return v; +} uae_u16 restore_u16_func (uae_u8 **dstp) { uae_u16 v; @@ -306,9 +320,9 @@ static void restore_header (uae_u8 *src) description = restore_string (); write_log ("Saved with: '%s %s', description: '%s'\n", emuname,emuversion,description); - free (description); - free (emuversion); - free (emuname); + xfree (description); + xfree (emuversion); + xfree (emuname); } /* restore all subsystems */ @@ -334,7 +348,7 @@ void restore_state (char *filename) } savestate_file = f; restore_header (chunk); - free (chunk); + xfree (chunk); changed_prefs.bogomem_size = 0; changed_prefs.chipmem_size = 0; changed_prefs.fastmem_size = 0; @@ -432,13 +446,17 @@ void restore_state (char *filename) #ifdef ACTION_REPLAY else if (!strcmp (name, "ACTR")) end = restore_action_replay (chunk); +#endif +#ifdef FILESYS + else if (!strcmp (name, "FSYS")) + end = restore_filesys (chunk); #endif else write_log ("unknown chunk '%s' size %d bytes\n", name, len); if (len != end - chunk) write_log ("Chunk '%s' total size %d bytes but read %d bytes!\n", name, len, end - chunk); - free (chunk); + xfree (chunk); } return; @@ -446,7 +464,7 @@ void restore_state (char *filename) savestate_state = 0; savestate_file = 0; if (chunk) - free (chunk); + xfree (chunk); if (f) zfile_fclose (f); } @@ -532,12 +550,12 @@ void save_state (char *filename, char *description) dst = save_cpu (&len, 0); save_chunk (f, dst, len, "CPU ", 0); - free (dst); + xfree (dst); #ifdef FPUEMU dst = save_fpu (&len,0 ); save_chunk (f, dst, len, "FPU ", 0); - free (dst); + xfree (dst); #endif strcpy(name, "DSKx"); @@ -546,31 +564,31 @@ void save_state (char *filename, char *description) if (dst) { name[3] = i + '0'; save_chunk (f, dst, len, name, 0); - free (dst); + xfree (dst); } } dst = save_floppy (&len, 0); save_chunk (f, dst, len, "DISK", 0); - free (dst); + xfree (dst); dst = save_custom (&len, 0, 0); save_chunk (f, dst, len, "CHIP", 0); - free (dst); + xfree (dst); dst = save_blitter (&len, 0); save_chunk (f, dst, len, "BLIT", 0); - free (dst); + xfree (dst); dst = save_custom_agacolors (&len, 0); save_chunk (f, dst, len, "AGAC", 0); - free (dst); + xfree (dst); strcpy (name, "SPRx"); for (i = 0; i < 8; i++) { dst = save_custom_sprite (i, &len, 0); name[3] = i + '0'; save_chunk (f, dst, len, name, 0); - free (dst); + xfree (dst); } strcpy (name, "AUDx"); @@ -578,20 +596,20 @@ void save_state (char *filename, char *description) dst = save_audio (i, &len, 0); name[3] = i + '0'; save_chunk (f, dst, len, name, 0); - free (dst); + xfree (dst); } dst = save_cia (0, &len, 0); save_chunk (f, dst, len, "CIAA", 0); - free (dst); + xfree (dst); dst = save_cia (1, &len, 0); save_chunk (f, dst, len, "CIAB", 0); - free (dst); + xfree (dst); dst = save_keyboard (&len); save_chunk (f, dst, len, "KEYB", 0); - free (dst); + xfree (dst); #ifdef AUTOCONFIG dst = save_expansion (&len, 0); @@ -604,13 +622,22 @@ void save_state (char *filename, char *description) if (!dst) break; save_chunk (f, dst, len, "ROM ", 0); - free (dst); + xfree (dst); } while ((dst = save_rom (0, &len, 0))); #ifdef ACTION_REPLAY dst = save_action_replay (&len, 0); save_chunk (f, dst, len, "ACTR", 0); #endif +#ifdef FILESYS + for (i = 0; i < nr_units (currprefs.mountinfo); i++) { + dst = save_filesys (i, &len); + if (dst) { + save_chunk (f, dst, len, "FSYS", 0); + xfree (dst); + } + } +#endif zfile_fwrite ("END ", 1, 4, f); zfile_fwrite ("\0\0\0\08", 1, 4, f); @@ -947,7 +974,7 @@ retry: void savestate_free (void) { - free (replaybuffer); + xfree (replaybuffer); replaybuffer = 0; }