[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx: [531] trunk
Brought to you by:
fredm
|
From: <fr...@us...> - 2008-05-10 23:53:27
|
Revision: 531
http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=531&view=rev
Author: fredm
Date: 2008-05-10 16:53:25 -0700 (Sat, 10 May 2008)
Log Message:
-----------
Merge up to vendor revision 3612.
Revision Links:
--------------
http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=3612&view=rev
Modified Paths:
--------------
trunk/FuseGenerator/libspectrum.h
trunk/FuseImporter/libspectrum.h
trunk/README
trunk/fuse/ChangeLog
trunk/fuse/Makefile.am
trunk/fuse/README
trunk/fuse/ay.c
trunk/fuse/compat/amiga/Makefile.am
trunk/fuse/compat/amiga/paths.c
trunk/fuse/configure.in
trunk/fuse/dck.c
trunk/fuse/debugger/commandl.l
trunk/fuse/debugger/commandy.y
trunk/fuse/debugger/debugger.c
trunk/fuse/debugger/debugger_internals.h
trunk/fuse/disk/Makefile.am
trunk/fuse/disk/beta.c
trunk/fuse/disk/disk.c
trunk/fuse/disk/disk.h
trunk/fuse/disk/fdd.c
trunk/fuse/disk/fdd.h
trunk/fuse/disk/plusd.c
trunk/fuse/disk/wd_fdc.c
trunk/fuse/disk/wd_fdc.h
trunk/fuse/display.c
trunk/fuse/divide.c
trunk/fuse/event.c
trunk/fuse/event.h
trunk/fuse/fuse.cpp
trunk/fuse/fuse.h
trunk/fuse/fusepb/English.lproj/InfoPlist.strings
trunk/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
trunk/fuse/fusepb/Info-Fuse.plist
trunk/fuse/fusepb/controllers/FuseController.h
trunk/fuse/fusepb/controllers/FuseController.m
trunk/fuse/fusepb/models/Emulator.h
trunk/fuse/fusepb/models/Emulator.m
trunk/fuse/fusepb/nibs/MainMenu.nib/classes.nib
trunk/fuse/fusepb/nibs/MainMenu.nib/info.nib
trunk/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib
trunk/fuse/fusepb/nibs/Preferences.nib/keyedobjects.nib
trunk/fuse/fusepb/views/DisplayOpenGLView.h
trunk/fuse/fusepb/views/DisplayOpenGLView.m
trunk/fuse/hacking/ChangeLog
trunk/fuse/hacking/cvs-tags
trunk/fuse/if1.c
trunk/fuse/input.c
trunk/fuse/kempmouse.c
trunk/fuse/kempmouse.h
trunk/fuse/keysyms.pl
trunk/fuse/loader.c
trunk/fuse/loader.h
trunk/fuse/machine.c
trunk/fuse/machine.h
trunk/fuse/machines/pentagon.c
trunk/fuse/machines/pentagon.h
trunk/fuse/machines/pentagon1024.c
trunk/fuse/machines/pentagon512.c
trunk/fuse/machines/scorpion.c
trunk/fuse/machines/spec128.c
trunk/fuse/machines/spec128.h
trunk/fuse/machines/spec16.c
trunk/fuse/machines/spec48.c
trunk/fuse/machines/spec48.h
trunk/fuse/machines/spec_se.c
trunk/fuse/machines/specplus2.c
trunk/fuse/machines/specplus2a.c
trunk/fuse/machines/specplus3.c
trunk/fuse/machines/specplus3.h
trunk/fuse/machines/specplus3e.c
trunk/fuse/machines/tc2048.c
trunk/fuse/machines/tc2068.c
trunk/fuse/machines/tc2068.h
trunk/fuse/machines/ts2068.c
trunk/fuse/man/fuse.1
trunk/fuse/memory.c
trunk/fuse/memory.h
trunk/fuse/menu.c
trunk/fuse/menu_data.dat
trunk/fuse/periph.c
trunk/fuse/roms/plus3e-0.rom
trunk/fuse/roms/plus3e-1.rom
trunk/fuse/roms/plus3e-2.rom
trunk/fuse/settings.dat
trunk/fuse/settings.pl
trunk/fuse/simpleide.c
trunk/fuse/sound/Makefile.am
trunk/fuse/sound/aosound.c
trunk/fuse/spectrum.c
trunk/fuse/spectrum.h
trunk/fuse/tape.c
trunk/fuse/tape.h
trunk/fuse/timer/Makefile.am
trunk/fuse/ui/Makefile.am
trunk/fuse/ui/fb/fbkeyboard.c
trunk/fuse/ui/gtk/Makefile.am
trunk/fuse/ui/gtk/fileselector.c
trunk/fuse/ui/gtk/gtkdisplay.c
trunk/fuse/ui/options.dat
trunk/fuse/ui/scaler/Makefile.am
trunk/fuse/ui/sdl/Makefile.am
trunk/fuse/ui/sdl/sdldisplay.c
trunk/fuse/ui/sdl/sdlkeyboard.c
trunk/fuse/ui/svga/svgakeyboard.c
trunk/fuse/ui/win32/Makefile.am
trunk/fuse/ui/win32/debugger.c
trunk/fuse/ui/win32/debugger.h
trunk/fuse/ui/win32/debugger.rc
trunk/fuse/ui/win32/error.c
trunk/fuse/ui/win32/icons/Makefile.am
trunk/fuse/ui/win32/options-header.pl
trunk/fuse/ui/win32/options-resource.pl
trunk/fuse/ui/win32/options.pl
trunk/fuse/ui/win32/pokefinder.c
trunk/fuse/ui/win32/pokefinder.h
trunk/fuse/ui/win32/pokefinder.rc
trunk/fuse/ui/win32/statusbar.c
trunk/fuse/ui/win32/win32display.c
trunk/fuse/ui/win32/win32display.h
trunk/fuse/ui/win32/win32internals.h
trunk/fuse/ui/win32/win32keyboard.h
trunk/fuse/ui/win32/win32ui.c
trunk/fuse/ui/xlib/xdisplay.c
trunk/fuse/ui/xlib/xerror.c
trunk/fuse/ui/xlib/xkeyboard.c
trunk/fuse/ui.c
trunk/fuse/ula.c
trunk/fuse/utils.c
trunk/fuse/windres.rc
trunk/fuse/z80/z80.c
trunk/fuse/z80/z80_ops.c
trunk/libspectrum/config.h
trunk/libspectrum/libspectrum/ChangeLog
trunk/libspectrum/libspectrum/README
trunk/libspectrum/libspectrum/accessor.pl
trunk/libspectrum/libspectrum/configure.in
trunk/libspectrum/libspectrum/doc/libspectrum.txt
trunk/libspectrum/libspectrum/hacking/ChangeLog
trunk/libspectrum/libspectrum/ide.c
trunk/libspectrum/libspectrum/internals.h
trunk/libspectrum/libspectrum/libspectrum.c
trunk/libspectrum/libspectrum/libspectrum.h.in
trunk/libspectrum/libspectrum/sna.c
trunk/libspectrum/libspectrum/snap_accessors.txt
trunk/libspectrum/libspectrum/snapshot.c
trunk/libspectrum/libspectrum/szx.c
trunk/libspectrum/libspectrum/tape.c
trunk/libspectrum/libspectrum/test/Makefile.am
trunk/libspectrum/libspectrum/test/edges.c
trunk/libspectrum/libspectrum/test/test.h
trunk/libspectrum/libspectrum/test/test15.c
trunk/libspectrum/libspectrum/z80.c
trunk/libspectrum/libspectrum.h
Added Paths:
-----------
trunk/fuse/compat/amiga/osname.c
trunk/fuse/disk/upd_fdc.c
trunk/fuse/disk/upd_fdc.h
trunk/fuse/fuse.c
trunk/fuse/fusepb/main.m
trunk/fuse/fusepb/scaler/scalers16.c
trunk/fuse/sound/win32sound.c
trunk/fuse/ui/scaler/scaler.c
trunk/fuse/ui/scaler/scaler.h
trunk/fuse/ui/scaler/scaler_hq2x.c
trunk/fuse/ui/scaler/scaler_hq3x.c
trunk/fuse/ui/scaler/scaler_internals.h
trunk/fuse/ui/scaler/scalers.c
trunk/fuse/ui/ui.h
trunk/fuse/ui/widget/
trunk/fuse/ui/widget/Makefile.am
trunk/fuse/ui/widget/browse.c
trunk/fuse/ui/widget/debugger.c
trunk/fuse/ui/widget/error.c
trunk/fuse/ui/widget/filesel.c
trunk/fuse/ui/widget/fuse.font.sbf
trunk/fuse/ui/widget/memory.c
trunk/fuse/ui/widget/menu.c
trunk/fuse/ui/widget/mkfusefont.pl
trunk/fuse/ui/widget/options-header.pl
trunk/fuse/ui/widget/options.pl
trunk/fuse/ui/widget/picture.c
trunk/fuse/ui/widget/pokefinder.c
trunk/fuse/ui/widget/query.c
trunk/fuse/ui/widget/roms.c
trunk/fuse/ui/widget/select.c
trunk/fuse/ui/widget/text.c
trunk/fuse/ui/widget/widget.c
trunk/fuse/ui/widget/widget.h
trunk/fuse/ui/widget/widget_internals.h
trunk/fuse/ui/win32/binary.c
trunk/fuse/ui/win32/binary.h
trunk/fuse/ui/win32/binary.rc
trunk/fuse/ui/win32/browse.c
trunk/fuse/ui/win32/browse.h
trunk/fuse/ui/win32/browse.rc
trunk/fuse/ui/win32/icons/mdr_active.bmp
trunk/fuse/ui/win32/icons/mdr_inactive.bmp
trunk/fuse/ui/win32/icons/mouse_active.bmp
trunk/fuse/ui/win32/icons/mouse_inactive.bmp
trunk/fuse/ui/win32/icons/tape_marker_mask.bmp
trunk/fuse/ui/win32/memorybrowser.c
trunk/fuse/ui/win32/memorybrowser.h
trunk/fuse/ui/win32/memorybrowser.rc
trunk/fuse/ui/win32/picture.c
trunk/fuse/ui/win32/picture.h
trunk/fuse/ui/win32/picture.rc
trunk/fuse/ui/win32/rollback.c
trunk/fuse/ui/win32/rollback.h
trunk/fuse/ui/win32/rollback.rc
trunk/fuse/ui/win32/roms.c
trunk/fuse/ui/win32/roms.h
trunk/fuse/ui/win32/roms.rc
trunk/fuse/ui/win32/select_template.h
trunk/fuse/ui/win32/select_template.rc
trunk/fuse/ui/win32/statusbar.rc
trunk/fuse/ui/win32/win32joystick.c
trunk/fuse/ui/win32/win32joystick.h
trunk/fuse/ui/win32/win32joystick.rc
trunk/fuse/ui/win32/win32mouse.c
trunk/fuse/unittests/
trunk/fuse/unittests/Makefile.am
trunk/fuse/unittests/unittests.c
trunk/fuse/unittests/unittests.h
trunk/fuse/winfuse.ico
Removed Paths:
-------------
trunk/fuse/fusepb/main.mm
trunk/fuse/fusepb/scaler/hq2x.cpp
trunk/fuse/fusepb/scaler/hq2x.h
trunk/fuse/fusepb/scaler/hq3x.cpp
trunk/fuse/fusepb/scaler/hq3x.h
trunk/fuse/fusepb/scaler/intern.h
trunk/fuse/fusepb/scaler/scalers16.cpp
trunk/fuse/hacking/win32_todo.txt
trunk/fuse/ui/scaler/scaler.c
trunk/fuse/ui/scaler/scaler.h
trunk/fuse/ui/scaler/scaler_internals.h
trunk/fuse/ui/scaler/scalers.cpp
trunk/fuse/ui/ui.h
trunk/fuse/ui/widget/Makefile.am
trunk/fuse/ui/widget/browse.c
trunk/fuse/ui/widget/debugger.c
trunk/fuse/ui/widget/error.c
trunk/fuse/ui/widget/filesel.c
trunk/fuse/ui/widget/fuse.font.sbf
trunk/fuse/ui/widget/memory.c
trunk/fuse/ui/widget/menu.c
trunk/fuse/ui/widget/mkfusefont.pl
trunk/fuse/ui/widget/options-header.pl
trunk/fuse/ui/widget/options.pl
trunk/fuse/ui/widget/picture.c
trunk/fuse/ui/widget/pokefinder.c
trunk/fuse/ui/widget/query.c
trunk/fuse/ui/widget/roms.c
trunk/fuse/ui/widget/select.c
trunk/fuse/ui/widget/text.c
trunk/fuse/ui/widget/widget.c
trunk/fuse/ui/widget/widget.h
trunk/fuse/ui/widget/widget_internals.h
trunk/fuse/ui/win32/del_o.bat
trunk/fuse/ui/win32/menu_data.c
trunk/fuse/ui/win32/menu_data.h
trunk/fuse/ui/win32/menu_data.rc
trunk/fuse/ui/win32/win32ui.rc
trunk/fuse/unittests/Makefile.am
trunk/fuse/unittests/unittests.c
trunk/fuse/unittests/unittests.h
trunk/fuse/widget/
trunk/lib765/
trunk/libspectrum/libspectrum/TODO
Modified: trunk/FuseGenerator/libspectrum.h
===================================================================
--- trunk/FuseGenerator/libspectrum.h 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/FuseGenerator/libspectrum.h 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
/* libspectrum.h: the library for dealing with ZX Spectrum emulator files
Copyright (c) 2001-2007 Philip Kendall, Darren Salt, Fredrick Meunier
- $Id: libspectrum.h.in 3426 2007-12-18 19:29:30Z zubzero $
+ $Id: libspectrum.h.in 3595 2008-04-01 10:51:58Z pak21 $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -613,6 +613,8 @@
void WIN32_DLL libspectrum_snap_set_beta_active( libspectrum_snap *snap, int beta_active );
int WIN32_DLL libspectrum_snap_beta_paged( libspectrum_snap *snap );
void WIN32_DLL libspectrum_snap_set_beta_paged( libspectrum_snap *snap, int beta_paged );
+int WIN32_DLL libspectrum_snap_beta_custom_rom( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_beta_custom_rom( libspectrum_snap *snap, int beta_custom_rom );
int WIN32_DLL libspectrum_snap_beta_direction( libspectrum_snap *snap );
void WIN32_DLL libspectrum_snap_set_beta_direction( libspectrum_snap *snap, int beta_direction );
libspectrum_byte WIN32_DLL libspectrum_snap_beta_system( libspectrum_snap *snap );
@@ -625,6 +627,8 @@
void WIN32_DLL libspectrum_snap_set_beta_data( libspectrum_snap *snap, libspectrum_byte beta_data );
libspectrum_byte WIN32_DLL libspectrum_snap_beta_status( libspectrum_snap *snap );
void WIN32_DLL libspectrum_snap_set_beta_status( libspectrum_snap *snap, libspectrum_byte beta_status );
+libspectrum_byte WIN32_DLL * libspectrum_snap_beta_rom( libspectrum_snap *snap, int idx );
+void WIN32_DLL libspectrum_snap_set_beta_rom( libspectrum_snap *snap, int idx, libspectrum_byte* beta_rom );
int WIN32_DLL libspectrum_snap_plusd_active( libspectrum_snap *snap );
void WIN32_DLL libspectrum_snap_set_plusd_active( libspectrum_snap *snap, int plusd_active );
int WIN32_DLL libspectrum_snap_plusd_paged( libspectrum_snap *snap );
@@ -647,6 +651,14 @@
void WIN32_DLL libspectrum_snap_set_plusd_rom( libspectrum_snap *snap, int idx, libspectrum_byte* plusd_rom );
libspectrum_byte WIN32_DLL * libspectrum_snap_plusd_ram( libspectrum_snap *snap, int idx );
void WIN32_DLL libspectrum_snap_set_plusd_ram( libspectrum_snap *snap, int idx, libspectrum_byte* plusd_ram );
+int WIN32_DLL libspectrum_snap_custom_rom( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_custom_rom( libspectrum_snap *snap, int custom_rom );
+size_t WIN32_DLL libspectrum_snap_custom_rom_pages( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_custom_rom_pages( libspectrum_snap *snap, size_t custom_rom_pages );
+libspectrum_byte WIN32_DLL * libspectrum_snap_roms( libspectrum_snap *snap, int idx );
+void WIN32_DLL libspectrum_snap_set_roms( libspectrum_snap *snap, int idx, libspectrum_byte* roms );
+size_t WIN32_DLL libspectrum_snap_rom_length( libspectrum_snap *snap, int idx );
+void WIN32_DLL libspectrum_snap_set_rom_length( libspectrum_snap *snap, int idx, size_t rom_length );
libspectrum_byte WIN32_DLL * libspectrum_snap_pages( libspectrum_snap *snap, int idx );
void WIN32_DLL libspectrum_snap_set_pages( libspectrum_snap *snap, int idx, libspectrum_byte* pages );
libspectrum_byte WIN32_DLL * libspectrum_snap_slt( libspectrum_snap *snap, int idx );
@@ -709,7 +721,26 @@
void WIN32_DLL libspectrum_snap_set_joystick_list( libspectrum_snap *snap, int idx, libspectrum_joystick joystick_list );
int WIN32_DLL libspectrum_snap_joystick_inputs( libspectrum_snap *snap, int idx );
void WIN32_DLL libspectrum_snap_set_joystick_inputs( libspectrum_snap *snap, int idx, int joystick_inputs );
+int WIN32_DLL libspectrum_snap_kempston_mouse_active( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_kempston_mouse_active( libspectrum_snap *snap, int kempston_mouse_active );
+int WIN32_DLL libspectrum_snap_simpleide_active( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_simpleide_active( libspectrum_snap *snap, int simpleide_active );
+int WIN32_DLL libspectrum_snap_divide_active( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_divide_active( libspectrum_snap *snap, int divide_active );
+int WIN32_DLL libspectrum_snap_divide_eprom_writeprotect( libspectrum_snap *snap);
+void WIN32_DLL libspectrum_snap_set_divide_eprom_writeprotect( libspectrum_snap *snap, int divide_eprom_writeprotect );
+int WIN32_DLL libspectrum_snap_divide_paged( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_divide_paged( libspectrum_snap *snap, int divide_paged );
+libspectrum_byte WIN32_DLL libspectrum_snap_divide_control( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_divide_control( libspectrum_snap *snap, libspectrum_byte divide_control );
+size_t WIN32_DLL libspectrum_snap_divide_pages( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_divide_pages( libspectrum_snap *snap, size_t divide_pages );
+libspectrum_byte WIN32_DLL * libspectrum_snap_divide_eprom( libspectrum_snap *snap, int idx );
+void WIN32_DLL libspectrum_snap_set_divide_eprom( libspectrum_snap *snap, int idx, libspectrum_byte* divide_eprom );
+libspectrum_byte WIN32_DLL * libspectrum_snap_divide_ram( libspectrum_snap *snap , int idx );
+void WIN32_DLL libspectrum_snap_set_divide_ram( libspectrum_snap *snap, int idx, libspectrum_byte* divide_ram );
+
/* DEPRECATED: use libspectrum_snap_read() instead */
DEPRECATED
libspectrum_error WIN32_DLL
@@ -786,6 +817,8 @@
extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_NO_EDGE; /* Edge isn't really an edge */
extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LEVEL_LOW; /* Set level low */
extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LEVEL_HIGH; /* Set level high */
+extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LENGTH_SHORT;
+extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LENGTH_LONG;
/* The states which a block can be in */
typedef enum libspectrum_tape_state_type {
Modified: trunk/FuseImporter/libspectrum.h
===================================================================
--- trunk/FuseImporter/libspectrum.h 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/FuseImporter/libspectrum.h 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
/* libspectrum.h: the library for dealing with ZX Spectrum emulator files
Copyright (c) 2001-2007 Philip Kendall, Darren Salt, Fredrick Meunier
- $Id: libspectrum.h.in 3426 2007-12-18 19:29:30Z zubzero $
+ $Id: libspectrum.h.in 3595 2008-04-01 10:51:58Z pak21 $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -613,6 +613,8 @@
void WIN32_DLL libspectrum_snap_set_beta_active( libspectrum_snap *snap, int beta_active );
int WIN32_DLL libspectrum_snap_beta_paged( libspectrum_snap *snap );
void WIN32_DLL libspectrum_snap_set_beta_paged( libspectrum_snap *snap, int beta_paged );
+int WIN32_DLL libspectrum_snap_beta_custom_rom( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_beta_custom_rom( libspectrum_snap *snap, int beta_custom_rom );
int WIN32_DLL libspectrum_snap_beta_direction( libspectrum_snap *snap );
void WIN32_DLL libspectrum_snap_set_beta_direction( libspectrum_snap *snap, int beta_direction );
libspectrum_byte WIN32_DLL libspectrum_snap_beta_system( libspectrum_snap *snap );
@@ -625,6 +627,8 @@
void WIN32_DLL libspectrum_snap_set_beta_data( libspectrum_snap *snap, libspectrum_byte beta_data );
libspectrum_byte WIN32_DLL libspectrum_snap_beta_status( libspectrum_snap *snap );
void WIN32_DLL libspectrum_snap_set_beta_status( libspectrum_snap *snap, libspectrum_byte beta_status );
+libspectrum_byte WIN32_DLL * libspectrum_snap_beta_rom( libspectrum_snap *snap, int idx );
+void WIN32_DLL libspectrum_snap_set_beta_rom( libspectrum_snap *snap, int idx, libspectrum_byte* beta_rom );
int WIN32_DLL libspectrum_snap_plusd_active( libspectrum_snap *snap );
void WIN32_DLL libspectrum_snap_set_plusd_active( libspectrum_snap *snap, int plusd_active );
int WIN32_DLL libspectrum_snap_plusd_paged( libspectrum_snap *snap );
@@ -647,6 +651,14 @@
void WIN32_DLL libspectrum_snap_set_plusd_rom( libspectrum_snap *snap, int idx, libspectrum_byte* plusd_rom );
libspectrum_byte WIN32_DLL * libspectrum_snap_plusd_ram( libspectrum_snap *snap, int idx );
void WIN32_DLL libspectrum_snap_set_plusd_ram( libspectrum_snap *snap, int idx, libspectrum_byte* plusd_ram );
+int WIN32_DLL libspectrum_snap_custom_rom( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_custom_rom( libspectrum_snap *snap, int custom_rom );
+size_t WIN32_DLL libspectrum_snap_custom_rom_pages( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_custom_rom_pages( libspectrum_snap *snap, size_t custom_rom_pages );
+libspectrum_byte WIN32_DLL * libspectrum_snap_roms( libspectrum_snap *snap, int idx );
+void WIN32_DLL libspectrum_snap_set_roms( libspectrum_snap *snap, int idx, libspectrum_byte* roms );
+size_t WIN32_DLL libspectrum_snap_rom_length( libspectrum_snap *snap, int idx );
+void WIN32_DLL libspectrum_snap_set_rom_length( libspectrum_snap *snap, int idx, size_t rom_length );
libspectrum_byte WIN32_DLL * libspectrum_snap_pages( libspectrum_snap *snap, int idx );
void WIN32_DLL libspectrum_snap_set_pages( libspectrum_snap *snap, int idx, libspectrum_byte* pages );
libspectrum_byte WIN32_DLL * libspectrum_snap_slt( libspectrum_snap *snap, int idx );
@@ -709,7 +721,26 @@
void WIN32_DLL libspectrum_snap_set_joystick_list( libspectrum_snap *snap, int idx, libspectrum_joystick joystick_list );
int WIN32_DLL libspectrum_snap_joystick_inputs( libspectrum_snap *snap, int idx );
void WIN32_DLL libspectrum_snap_set_joystick_inputs( libspectrum_snap *snap, int idx, int joystick_inputs );
+int WIN32_DLL libspectrum_snap_kempston_mouse_active( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_kempston_mouse_active( libspectrum_snap *snap, int kempston_mouse_active );
+int WIN32_DLL libspectrum_snap_simpleide_active( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_simpleide_active( libspectrum_snap *snap, int simpleide_active );
+int WIN32_DLL libspectrum_snap_divide_active( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_divide_active( libspectrum_snap *snap, int divide_active );
+int WIN32_DLL libspectrum_snap_divide_eprom_writeprotect( libspectrum_snap *snap);
+void WIN32_DLL libspectrum_snap_set_divide_eprom_writeprotect( libspectrum_snap *snap, int divide_eprom_writeprotect );
+int WIN32_DLL libspectrum_snap_divide_paged( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_divide_paged( libspectrum_snap *snap, int divide_paged );
+libspectrum_byte WIN32_DLL libspectrum_snap_divide_control( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_divide_control( libspectrum_snap *snap, libspectrum_byte divide_control );
+size_t WIN32_DLL libspectrum_snap_divide_pages( libspectrum_snap *snap );
+void WIN32_DLL libspectrum_snap_set_divide_pages( libspectrum_snap *snap, size_t divide_pages );
+libspectrum_byte WIN32_DLL * libspectrum_snap_divide_eprom( libspectrum_snap *snap, int idx );
+void WIN32_DLL libspectrum_snap_set_divide_eprom( libspectrum_snap *snap, int idx, libspectrum_byte* divide_eprom );
+libspectrum_byte WIN32_DLL * libspectrum_snap_divide_ram( libspectrum_snap *snap , int idx );
+void WIN32_DLL libspectrum_snap_set_divide_ram( libspectrum_snap *snap, int idx, libspectrum_byte* divide_ram );
+
/* DEPRECATED: use libspectrum_snap_read() instead */
DEPRECATED
libspectrum_error WIN32_DLL
@@ -786,6 +817,8 @@
extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_NO_EDGE; /* Edge isn't really an edge */
extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LEVEL_LOW; /* Set level low */
extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LEVEL_HIGH; /* Set level high */
+extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LENGTH_SHORT;
+extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LENGTH_LONG;
/* The states which a block can be in */
typedef enum libspectrum_tape_state_type {
Modified: trunk/README
===================================================================
--- trunk/README 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/README 2008-05-10 23:53:25 UTC (rev 531)
@@ -22,9 +22,6 @@
cd audiofile
xcodebuild -configuration Deployment
cd ..
-cd lib765
-xcodebuild -configuration Deployment
-cd ..
cd libgcrypt
xcodebuild -configuration Deployment
cd ..
Modified: trunk/fuse/ChangeLog
===================================================================
--- trunk/fuse/ChangeLog 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/ChangeLog 2008-05-10 23:53:25 UTC (rev 531)
@@ -878,4 +878,4 @@
* Version 0.1.0 released.
-$Id: ChangeLog 3462 2008-01-04 09:34:40Z pak21 $
+$Id: ChangeLog 3482 2008-01-07 12:32:26Z pak21 $
Modified: trunk/fuse/Makefile.am
===================================================================
--- trunk/fuse/Makefile.am 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/Makefile.am 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
# Process this file with automake to produce Makefile.in
-## Copyright (c) 1999-2004 Philip Kendall
+## Copyright (c) 1999-2008 Philip Kendall
-## $Id: Makefile.am 3318 2007-11-21 19:25:31Z zubzero $
+## $Id: Makefile.am 3609 2008-05-01 13:17:56Z fredm $
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -38,7 +38,7 @@
sound \
timer \
ui \
- @WIDGET@ \
+ unittests \
z80
DIST_SUBDIRS = debugger \
@@ -53,7 +53,7 @@
sound \
timer \
ui \
- widget \
+ unittests \
z80
fuse_SOURCES = ay.c \
@@ -112,20 +112,21 @@
fuse_LDADD = debugger/libdebugger.a \
@UI_LIBS@ \
+machines/libmachines.a \
disk/libdisk.a \
-machines/libmachines.a \
pokefinder/libpokefinder.a \
sound/libsound.a \
ui/scaler/libscaler.a \
+unittests/libunittests.a \
debugger/libdebugger.a \
timer/libtimer.a \
z80/libz80.a \
-@DSKLIBS@ \
@LIBSPEC_LIBS@ \
@GLIB_LIBS@ \
@PNG_LIBS@ \
@SOUND_LIBS@ \
@SAMPLERATE_LIBS@ \
+@SDL_LIBS@ \
@X_LIBS@ \
@XML_LIBS@ \
compat/@COMPAT_OSNAME@/libcompatos.a \
@@ -136,6 +137,7 @@
debugger/libdebugger.a \
machines/libmachines.a \
sound/libsound.a \
+ unittests/libunittests.a\
z80/libz80.a \
@WINDRES_OBJ@
@@ -150,8 +152,8 @@
settings.h: settings-header.pl settings.dat
@PERL@ -I$(srcdir)/perl $(srcdir)/settings-header.pl $(srcdir)/settings.dat > $@.tmp && mv $@.tmp $@
-INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ @DSK_CFLAGS@\
-@XML_CFLAGS@ @SAMPLERATE_CFLAGS@ -DFUSEDATADIR="\"${pkgdatadir}\""
+INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ \
+@XML_CFLAGS@ @SAMPLERATE_CFLAGS@ -DFUSEDATADIR="\"${pkgdatadir}\"" @SDL_CFLAGS@
noinst_HEADERS = ay.h \
bitmap.h \
@@ -201,7 +203,8 @@
menu_data.pl \
settings.pl \
settings-header.pl \
- settings.dat
+ settings.dat \
+ winfuse.ico
CLEANFILES = settings.c \
settings.h
Modified: trunk/fuse/README
===================================================================
--- trunk/fuse/README 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/README 2008-05-10 23:53:25 UTC (rev 531)
@@ -40,11 +40,6 @@
Optional:
-* If you want +3 and +3e support, you'll need John Elliott's lib765
- installed; get it from http://www.seasip.demon.co.uk/Unix/LibDsk/
- If you also have libdsk (from the same location) installed, you'll
- also get support for extended .dsk files (see 'THE .DSK FORMAT'
- section in fuse(1) for more details on this).
* Other libraries will give you some extended functionality:
* libgcrypt: the ability to digitally sign input recordings (note that
Fuse requires version 1.1.42 or later).
@@ -117,8 +112,7 @@
---------------------------------
The native Cocoa port by Fredrick Meunier <fr...@sp...> comes as
-a set of Xcode projects for libbz2, lib765, libdsk, libgcrypt,
-libspectrum and Fuse itself.
+a set of Xcode projects for libgcrypt, libspectrum and Fuse itself.
Closing comments
----------------
@@ -149,4 +143,4 @@
Philip Kendall <phi...@sh...>
5 January 2008
-$Id: README 3462 2008-01-04 09:34:40Z pak21 $
+$Id: README 3584 2008-03-25 10:27:30Z fredm $
Modified: trunk/fuse/ay.c
===================================================================
--- trunk/fuse/ay.c 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/ay.c 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
/* ay.c: AY-8-3912 routines
Copyright (c) 1999-2004 Philip Kendall
- $Id: ay.c 3390 2007-12-03 12:59:54Z fredm $
+ $Id: ay.c 3494 2008-01-15 16:37:50Z pak21 $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -66,7 +66,7 @@
}
static void
-ay_reset( int hard_reset )
+ay_reset( int hard_reset GCC_UNUSED )
{
ayinfo *ay = &machine_current->ay;
Modified: trunk/fuse/compat/amiga/Makefile.am
===================================================================
--- trunk/fuse/compat/amiga/Makefile.am 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/compat/amiga/Makefile.am 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
## Copyright (c) 2007 Philip Kendall
-## $Id: Makefile.am 3115 2007-08-19 02:49:14Z fredm $
+## $Id: Makefile.am 3578 2008-03-22 20:51:36Z zubzero $
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
noinst_LIBRARIES = libcompatos.a
-libcompatos_a_SOURCES = ../unix/osname.c \
+libcompatos_a_SOURCES = osname.c \
paths.c
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
Copied: trunk/fuse/compat/amiga/osname.c (from rev 530, vendor/fuse-emulator/current/fuse/compat/amiga/osname.c)
===================================================================
--- trunk/fuse/compat/amiga/osname.c (rev 0)
+++ trunk/fuse/compat/amiga/osname.c 2008-05-10 23:53:25 UTC (rev 531)
@@ -0,0 +1,61 @@
+/* osname.c: Get a representation of the OS we're running on
+ Copyright (c) 1999-2007 Philip Kendall
+
+ $Id: osname.c 3578 2008-03-22 20:51:36Z zubzero $
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Author contact information:
+
+ E-mail: phi...@sh...
+
+*/
+
+#include <config.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <proto/exec.h>
+#include <proto/expansion.h>
+
+#include "ui/ui.h"
+
+struct Library *ExpansionBase;
+struct ExpansionIFace *IExpansion;
+
+int compat_osname( char *buffer, size_t length )
+{
+ STRPTR machine;
+
+ if( ExpansionBase = IExec->OpenLibrary( "expansion.library", 52 ) ) {
+ if( IExpansion = ( struct ExpansionIFace * ) IExec->GetInterface( ExpansionBase,"main",1,NULL ) ) {
+
+ IExpansion->GetMachineInfoTags( GMIT_MachineString, &machine,
+ TAG_DONE );
+
+ snprintf( buffer, length, "%s %s %s", "AmigaOS", machine, "4.0" );
+
+ IExec->DropInterface( ( struct Interface * )IExpansion );
+ }
+ IExec->CloseLibrary( ExpansionBase );
+ }
+ else
+ {
+ return 1;
+ }
+
+ return 0;
+}
Modified: trunk/fuse/compat/amiga/paths.c
===================================================================
--- trunk/fuse/compat/amiga/paths.c 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/compat/amiga/paths.c 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
/* paths.c: Path-related compatibility routines
Copyright (c) 1999-2007 Philip Kendall
- $Id: paths.c 3253 2007-10-26 02:02:17Z zubzero $
+ $Id: paths.c 3578 2008-03-22 20:51:36Z zubzero $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Modified: trunk/fuse/configure.in
===================================================================
--- trunk/fuse/configure.in 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/configure.in 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $Id: configure.in 3429 2007-12-18 20:02:35Z zubzero $
+dnl $Id: configure.in 3609 2008-05-01 13:17:56Z fredm $
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@@ -113,7 +113,7 @@
AC_DEFINE([USE_WIDGET], 1,
[Defined if we're using a widget-based UI])
UI=svga; WIDGET=widget;
- UI_LIBS="ui/svga/libuisvga.a widget/libwidget.a",
+ UI_LIBS="ui/svga/libuisvga.a ui/widget/libwidget.a",
AC_MSG_ERROR([svgalib not found]))
fi
@@ -129,7 +129,7 @@
AC_DEFINE([UI_FB], 1, [Defined if framebuffer UI in use])
AC_DEFINE([USE_WIDGET], 1, [Defined if we're using a widget-based UI])
UI=fb; WIDGET=widget;
- UI_LIBS="ui/fb/libuifb.a widget/libwidget.a"
+ UI_LIBS="ui/fb/libuifb.a ui/widget/libwidget.a"
dnl Look for libgpm (default=yes)
AC_MSG_CHECKING(whether gpm requested)
AC_ARG_WITH(gpm,
@@ -162,35 +162,11 @@
AC_DEFINE([USE_WIDGET], 1,
[Defined if we're using a widget-based UI])
UI=sdl; WIDGET=widget;
- UI_LIBS="ui/sdl/libuisdl.a widget/libwidget.a",
+ UI_LIBS="ui/sdl/libuisdl.a ui/widget/libwidget.a",
AC_MSG_ERROR([SDL version $SDL_VERSION not found]))
- CFLAGS="$CFLAGS $SDL_CFLAGS"
- CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
- LIBS="$LIBS $SDL_LIBS"
fi
fi
-dnl Look for GGI (default=no)
-dnl Disabled -- doesn't work and unmaintained -- PAK 20040702
-dnl if test -z "$UI"; then
-dnl AC_MSG_CHECKING(whether GGI UI requested)
-dnl AC_ARG_WITH(ggi,
-dnl [ --with-ggi use GGI for user interface],
-dnl if test "$withval" = no; then sdl=no; else ggi=yes; fi,
-dnl ggi=no)
-dnl AC_MSG_RESULT($ggi)
-dnl if test "$ggi" = yes; then
-dnl AC_CHECK_HEADER(ggi/ggi.h,
-dnl AC_DEFINE([UI_GGI], 1, [Defined if GGI UI in use])
-dnl AC_DEFINE([USE_WIDGET], 1,
-dnl [Defined if we're using a widget-based UI])
-dnl UI=ggi; WIDGET=widget;
-dnl UI_LIBS="ui/ggi/libuiggi.a widget/libwidget.a"
-dnl LIBS="$LIBS -lggi",
-dnl AC_MSG_ERROR([ggi/ggi.h not found]))
-dnl fi
-dnl fi
-
dnl Look for GTK+ (default=yes)
if test -z "$UI"; then
AC_MSG_CHECKING(whether GTK+ UI requested)
@@ -244,7 +220,7 @@
AC_DEFINE([UI_X], 1, [Defined if Xlib UI in use])
UI=xlib; WIDGET=widget;
AC_DEFINE([USE_WIDGET], 1, [Defined if we're using a widget-based UI])
- UI_LIBS="ui/xlib/libuixlib.a widget/libwidget.a"
+ UI_LIBS="ui/xlib/libuixlib.a ui/widget/libwidget.a"
fi
AC_SUBST(UI)
@@ -336,30 +312,6 @@
lib/tape_se.szx
lib/tape_ts2068.szx])
-dnl Do we want +3 disk support?
-AC_MSG_CHECKING(whether +3 disk support requested)
-AC_ARG_WITH(plus3-disk,
- [ --without-plus3-disk disable +3 disk support],
- if test "$withval" = no; then plus3disk = no; else plus3disk=yes; fi,
- plus3disk=yes)
-AC_MSG_RESULT($plus3disk)
-if test "$plus3disk" = yes; then
- AC_ARG_WITH(plus3-disk-prefix,
- [ --with-plus3-disk-prefix=PFX where the +3 libraries are installed (optional)],
- DSK_CFLAGS=-I$withval/include; DSKLIBS=-L$withval/lib,
- DSK_CFLAGS=""; DSK_LIBS="")
- ac_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $DSK_CFLAGS"
- AC_CHECK_HEADERS(765.h, DSKLIBS="$DSKLIBS -l765"; lib765=yes,
- AC_MSG_WARN(765.h not found - disk support disabled))
- if test "$lib765" = yes; then
- AC_CHECK_HEADERS(libdsk.h, DSKLIBS="$DSKLIBS -ldsk")
- fi
- CPPFLAGS="$ac_save_CPPFLAGS"
-fi
-AC_SUBST(DSK_CFLAGS)
-AC_SUBST(DSKLIBS)
-
dnl Check if a version of libpng which supplies png_write_png is available
AC_CHECK_LIB( png, png_write_png,
[AC_CHECK_HEADER(
@@ -415,6 +367,14 @@
[AC_MSG_WARN(dsound.h not found - no DirectSound output)]
)
+dnl Check if MS Windows Multimedia API sound is available
+AC_CHECK_HEADER(
+ mmsystem.h,
+ [win32sound_available=yes],
+ [AC_MSG_WARN(mmsystem.h not found - no MS Windows Multimedia API sound output)],
+ [#include <windows.h>]
+)
+
dnl Check if libsamplerate is available
AC_MSG_CHECKING(whether libsamplerate support requested)
AC_ARG_WITH(libsamplerate,
@@ -446,6 +406,9 @@
if test "$dxsound_available" = yes; then
SOUND_LIBADD='dxsound.$(OBJEXT)' SOUND_LIBS='-ldsound -lole32 -ldxguid'
AC_MSG_RESULT(DirectX)
+elif test "$win32sound_available" = yes; then
+ SOUND_LIBADD='win32sound.$(OBJEXT)' SOUND_LIBS='-lwinmm'
+ AC_MSG_RESULT(win32sound)
elif test "$UI" = sdl; then
SOUND_LIBADD='sdlsound.$(OBJEXT)' SOUND_LIBS='' sound_fifo=yes
AC_MSG_RESULT(SDL)
@@ -509,7 +472,7 @@
dnl If there is none, or you override this here, we use libjsw.
dnl (svgalib appears to dislike switched joysticks on the parallel port...)
case "$UI" in
- svga|sdl)
+ svga|sdl|win32)
dnl Libraries such as svgalib provide their own joystick code.
AC_MSG_CHECKING([whether to use $UI's joystick support])
AC_ARG_ENABLE(ui-joystick,
@@ -687,9 +650,10 @@
ui/svga/Makefile \
ui/sdl/Makefile \
ui/scaler/Makefile \
+ui/widget/Makefile \
ui/win32/Makefile \
ui/win32/icons/Makefile \
ui/xlib/Makefile \
-widget/Makefile \
+unittests/Makefile \
z80/Makefile \
z80/tests/Makefile)
Modified: trunk/fuse/dck.c
===================================================================
--- trunk/fuse/dck.c 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/dck.c 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
/* dck.c: dock snapshot (Warajevo .DCK) handling routines
Copyright (c) 2003-2004 Darren Salt, Fredrick Meunier, Philip Kendall
- $Id: dck.c 2995 2007-06-17 14:31:36Z pak21 $
+ $Id: dck.c 3609 2008-05-01 13:17:56Z fredm $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -42,7 +42,6 @@
#include "ui/ui.h"
#include "utils.h"
#include "debugger/debugger.h"
-#include "widget/widget.h"
/* Dock cart inserted? */
int dck_active = 0;
Modified: trunk/fuse/debugger/commandl.l
===================================================================
--- trunk/fuse/debugger/commandl.l 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/debugger/commandl.l 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
/* commandl.l: Debugger command lexical scanner
Copyright (c) 2002 Philip Kendall
- $Id: commandl.l 3032 2007-06-28 22:48:54Z zubzero $
+ $Id: commandl.l 3503 2008-01-30 14:58:55Z pak21 $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -56,6 +56,7 @@
del|dele|delet|delete { return DEBUGGER_DELETE; }
di|dis|disa|disas|disass|disasse|disassm|disassmb|diasassmbl|disassemble {
return DISASSEMBLE; }
+ex|exi|exit { return EXIT; }
fi|fin|fini|finis|finish { return FINISH; }
if { return IF; }
i|ig|ign|igno|ignor|ignore { return DEBUGGER_IGNORE; }
Modified: trunk/fuse/debugger/commandy.y
===================================================================
--- trunk/fuse/debugger/commandy.y 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/debugger/commandy.y 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
/* commandy.y: Parse a debugger command
Copyright (c) 2002-2004 Philip Kendall
- $Id: commandy.y 3115 2007-08-19 02:49:14Z fredm $
+ $Id: commandy.y 3503 2008-01-30 14:58:55Z pak21 $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -75,6 +75,7 @@
%token CONTINUE
%token DEBUGGER_DELETE
%token DISASSEMBLE
+%token EXIT
%token FINISH
%token IF
%token DEBUGGER_IGNORE
@@ -156,6 +157,7 @@
| DEBUGGER_DELETE { debugger_breakpoint_remove_all(); }
| DEBUGGER_DELETE number { debugger_breakpoint_remove( $2 ); }
| DISASSEMBLE number { ui_debugger_disassemble( $2 ); }
+ | EXIT { debugger_exit_emulator(); }
| FINISH { debugger_breakpoint_exit(); }
| DEBUGGER_IGNORE NUMBER number {
debugger_breakpoint_ignore( $2, $3 );
Modified: trunk/fuse/debugger/debugger.c
===================================================================
--- trunk/fuse/debugger/debugger.c 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/debugger/debugger.c 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
/* debugger.c: Fuse's monitor/debugger
Copyright (c) 2002-2004 Philip Kendall
- $Id: debugger.c 3115 2007-08-19 02:49:14Z fredm $
+ $Id: debugger.c 3503 2008-01-30 14:58:55Z pak21 $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,6 +28,7 @@
#include "debugger.h"
#include "debugger_internals.h"
#include "event.h"
+#include "fuse.h"
#include "memory.h"
#include "periph.h"
#include "ui/ui.h"
@@ -146,3 +147,11 @@
writeport_internal( port, value );
return 0;
}
+
+/* Exit the emulator */
+void
+debugger_exit_emulator( void )
+{
+ fuse_exiting = 1;
+ debugger_run();
+}
Modified: trunk/fuse/debugger/debugger_internals.h
===================================================================
--- trunk/fuse/debugger/debugger_internals.h 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/debugger/debugger_internals.h 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
/* debugger_internals.h: The internals of Fuse's monitor/debugger
Copyright (c) 2002-2003 Philip Kendall
- $Id: debugger_internals.h 3111 2007-08-17 12:42:10Z pak21 $
+ $Id: debugger_internals.h 3503 2008-01-30 14:58:55Z pak21 $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -43,6 +43,8 @@
void debugger_register_set( int which, libspectrum_word value );
const char* debugger_register_text( int which );
+void debugger_exit_emulator( void );
+
/* Utility functions called by the flex scanner */
int debugger_command_input( char *buf, int *result, int max_size );
Modified: trunk/fuse/disk/Makefile.am
===================================================================
--- trunk/fuse/disk/Makefile.am 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/disk/Makefile.am 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
## Copyright (c) 2007 Stuart Brady
-## $Id: Makefile.am 3207 2007-10-19 20:04:47Z zubzero $
+## $Id: Makefile.am 3584 2008-03-25 10:27:30Z fredm $
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -34,6 +34,7 @@
disk.c \
fdd.c \
plusd.c \
+ upd_fdc.c \
wd_fdc.c
noinst_HEADERS = beta.h \
@@ -41,4 +42,5 @@
disk.h \
fdd.h \
plusd.h \
+ upd_fdc.h \
wd_fdc.h
Modified: trunk/fuse/disk/beta.c
===================================================================
--- trunk/fuse/disk/beta.c 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/disk/beta.c 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
/* beta.c: Routines for handling the Beta disk interface
- Copyright (c) 2004-2007 Stuart Brady
+ Copyright (c) 2004-2008 Stuart Brady
- $Id: beta.c 3400 2007-12-04 18:24:31Z zubzero $
+ $Id: beta.c 3556 2008-03-15 11:11:47Z fredm $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -78,6 +78,7 @@
static void beta_reset( int hard_reset );
static void beta_memory_map( void );
+static void beta_enabled_snapshot( libspectrum_snap *snap );
static void beta_from_snapshot( libspectrum_snap *snap );
static void beta_to_snapshot( libspectrum_snap *snap );
@@ -85,7 +86,7 @@
beta_reset,
beta_memory_map,
- NULL, /* XXX: beta_enabled_snapshot */
+ beta_enabled_snapshot,
beta_from_snapshot,
beta_to_snapshot,
@@ -116,19 +117,32 @@
memory_map_read[1] = memory_map_write[1] = memory_map_romcs[ 1 ];
}
+static void
+beta_select_drive( int i )
+{
+ if( beta_fdc->current_drive != &beta_drives[ i & 0x03 ] ) {
+ if( beta_fdc->current_drive != NULL )
+ fdd_select( &beta_fdc->current_drive->fdd, 0 );
+ beta_fdc->current_drive = &beta_drives[ i & 0x03 ];
+ fdd_select( &beta_fdc->current_drive->fdd, 1 );
+ }
+}
+
int
beta_init( void )
{
int i;
wd_fdc_drive *d;
- beta_fdc = wd_fdc_alloc_fdc( FD1793 );
- beta_fdc->current_drive = &beta_drives[ 0 ];
+ beta_fdc = wd_fdc_alloc_fdc( FD1793, 0, WD_FLAG_BETA128 );
+ beta_fdc->current_drive = NULL;
for( i = 0; i < BETA_NUM_DRIVES; i++ ) {
d = &beta_drives[ i ];
- fdd_init( &d->fdd, 0, 0 ); /* drive geometry 'autodetect' */
+ fdd_init( &d->fdd, FDD_SHUGART, 0, 0 ); /* drive geometry 'autodetect' */
+ d->disk.flag = DISK_FLAG_NONE;
}
+ beta_select_drive( 0 );
beta_fdc->dden = 1;
beta_fdc->set_intrq = NULL;
@@ -142,7 +156,7 @@
}
static void
-beta_reset( int hard_reset )
+beta_reset( int hard_reset GCC_UNUSED )
{
int i;
wd_fdc_drive *d;
@@ -198,7 +212,7 @@
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_D_WP_SET,
!beta_drives[ BETA_DRIVE_D ].fdd.wrprot );
- beta_fdc->current_drive = &beta_drives[ 0 ];
+ beta_select_drive( 0 );
machine_current->memory_map();
beta_event_index( 0 );
@@ -283,10 +297,11 @@
beta_sp_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
{
if( !beta_active ) return;
-
- beta_fdc->current_drive = &beta_drives[ b & 0x03 ];
+
/* reset 0x04 and then set it to reset controller */
+ beta_select_drive( b & 0x03 );
/* 0x08 = block hlt, normally set */
+ wd_fdc_set_hlt( beta_fdc, ( ( b & 0x08 ) ? 1 : 0 ) );
fdd_set_head( &beta_fdc->current_drive->fdd, ( ( b & 0x10 ) ? 0 : 1 ) );
/* 0x20 = density, reset = FM, set = MFM */
beta_fdc->dden = b & 0x20 ? 1 : 0;
@@ -539,10 +554,16 @@
}
static void
+beta_enabled_snapshot( libspectrum_snap *snap )
+{
+ if( libspectrum_snap_beta_active( snap ) )
+ settings_current.beta128 = 1;
+}
+
+static void
beta_from_snapshot( libspectrum_snap *snap )
{
- if( !( machine_current->capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_TRDOS_DISK ) )
- return;
+ if( !libspectrum_snap_beta_active( snap ) ) return;
beta_active = libspectrum_snap_beta_paged( snap );
@@ -552,6 +573,15 @@
beta_unpage();
}
+ if( libspectrum_snap_beta_custom_rom( snap ) &&
+ libspectrum_snap_beta_rom( snap, 0 ) &&
+ machine_load_rom_bank_from_buffer(
+ memory_map_romcs, 0, 0,
+ libspectrum_snap_beta_rom( snap, 0 ),
+ MEMORY_PAGE_SIZE * 2,
+ 1 ) )
+ return;
+
beta_fdc->direction = libspectrum_snap_beta_direction( snap );
beta_cr_write ( 0x001f, 0 );
@@ -566,8 +596,29 @@
{
int attached;
wd_fdc *f = beta_fdc;
+ libspectrum_byte *buffer;
+ if( !periph_beta128_active ) return;
+
libspectrum_snap_set_beta_active( snap, 1 );
+
+ if( memory_map_romcs[0].source == MEMORY_SOURCE_CUSTOMROM ) {
+ size_t rom_length = MEMORY_PAGE_SIZE * 2;
+
+ buffer = malloc( rom_length );
+ if( !buffer ) {
+ ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ );
+ return;
+ }
+
+ memcpy( buffer, memory_map_romcs[0].page, MEMORY_PAGE_SIZE );
+ memcpy( buffer + MEMORY_PAGE_SIZE, memory_map_romcs[1].page,
+ MEMORY_PAGE_SIZE );
+
+ libspectrum_snap_set_beta_rom( snap, 0, buffer );
+ libspectrum_snap_set_beta_custom_rom( snap, 1 );
+ }
+
libspectrum_snap_set_beta_paged ( snap, beta_active );
libspectrum_snap_set_beta_direction( snap, beta_fdc->direction );
libspectrum_snap_set_beta_status( snap, beta_sr_read( 0x001f, &attached ) );
Modified: trunk/fuse/disk/disk.c
===================================================================
--- trunk/fuse/disk/disk.c 2008-05-07 12:29:58 UTC (rev 530)
+++ trunk/fuse/disk/disk.c 2008-05-10 23:53:25 UTC (rev 531)
@@ -1,7 +1,7 @@
/* disk.c: Routines for handling disk images
Copyright (c) 2007 Gergely Szasz
- $Id: disk.c 3471 2008-01-05 18:14:15Z pak21 $
+ $Id: disk.c 3583 2008-03-25 09:29:59Z fredm $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -60,6 +60,7 @@
10416, /* 8" DD */
3125, /* SD */
6250, /* DD */
+ 6500, /* DD+ e.g. Coin Op Hits */
12500, /* HD */
};
@@ -69,16 +70,17 @@
int gap; /* gap byte */
int sync; /* sync byte */
int sync_len;
+ int mark; /* mark byte 0xa1 for MFM -1 for MF */
int len[4];
} disk_gap_t;
disk_gap_t gaps[] = {
- { 0x4e, 0x00, 12, { 0, 60, 22, 24 } }, /* MGT MFM */
- { 0x4e, 0x00, 12, { 0, 10, 22, 60 } }, /* TRD MFM */
- { 0xff, 0x00, 6, { 40, 26, 11, 27 } }, /* IBM3740 FM */
- { 0x4e, 0x00, 12, { 80, 50, 22, 54 } }, /* IBM34 MFM */
- { 0xff, 0x00, 6, { 0, 16, 11, 10 } }, /* MINIMAL FM */
- { 0x4e, 0x00, 12, { 0, 32, 22, 24 } }, /* MINIMAL MFM */
+ { 0x4e, 0x00, 12, 0xa1, { 0, 60, 22, 24 } }, /* MGT MFM */
+ { 0x4e, 0x00, 12, 0xa1, { 0, 10, 22, 60 } }, /* TRD MFM */
+ { 0xff, 0x00, 6, -1, { 40, 26, 11, 27 } }, /* IBM3740 FM */
+ { 0x4e, 0x00, 12, 0xa1, { 80, 50, 22, 54 } }, /* IBM34 MFM */
+ { 0xff, 0x00, 6, -1, { 0, 16, 11, 10 } }, /* MINIMAL FM */
+ { 0x4e, 0x00, 12, 0xa1, { 0, 32, 22, 24 } }, /* MINIMAL MFM */
};
#define GAP_MGT_PLUSD 0
@@ -242,7 +244,6 @@
*mfm = d->track[ d->i ] == 0x4e ? 1 : 0; /* not so robust */
if( !datamark_read( d, &del ) )
r |= DISK_CORRUPT_SECTOR;
- /* h != head? s != sectors? */
if( t != track )
r |= DISK_ID_NOTMATCH;
if( s < *sector_base )
@@ -308,49 +309,70 @@
}
static int
-gap_add( disk_t *d, int gap, int mark, int gaptype )
+gap_add( disk_t *d, int gap, int gaptype )
{
disk_gap_t *g = &gaps[ gaptype ];
- if( d->i + g->sync_len + g->len[gap] +
- ( d->density != DISK_SD ? 3 : 0 ) >= d->bpt ) /* too many data bytes */
+ if( d->i + g->len[gap] >= d->bpt ) /* too many data bytes */
return 1;
/*-------------------------------- given gap --------------------------------*/
memset( d->track + d->i, g->gap, g->len[gap] ); d->i += g->len[gap];
- memset( d->track + d->i, g->sync, g->sync_len ); d->i += g->sync_len;
- if( d->density != DISK_SD ) {
- memset( d->track + d->i , mark, 3 );
- bitmap_set( d->clocks, d->i ); d->i++;
- bitmap_set( d->clocks, d->i ); d->i++;
- bitmap_set( d->clocks, d->i ); d->i++;
- }
return 0;
}
static int
-preindex_add( disk_t *d, int gap ) /* preindex gap and index mark */
+preindex_len( disk_t *d, int gaptype ) /* preindex gap and index mark */
{
+ disk_gap_t *g = &gaps[ gaptype ];
+ return g->len[0] + g->sync_len + ( g->mark >= 0 ? 3 : 0 ) + 1;
+}
+
+/*
+ [ ....GAP.... ] [ ... SYNC ... ] [ . MARK . ]
+ |------------------------------------------->
+ Preindex
+*/
+static int
+preindex_add( disk_t *d, int gaptype ) /* preindex gap and index mark */
+{
+ disk_gap_t *g = &gaps[ gaptype ];
+ if( d->i + preindex_len( d, gaptype ) >= d->bpt )
+ return 1;
/*------------------------------ pre-index gap -------------------------------*/
- if( gap_add( d, 0, 0xc2, gap ) )
+ if( gap_add( d, 0, gaptype ) )
return 1;
- if( d->i + 1 >= d->bpt ) /* too many data bytes */
- return 1;
- if( d->density == DISK_SD )
+/*------------------------------ sync ---------------------------*/
+ memset( d->track + d->i, g->sync, g->sync_len ); d->i += g->sync_len;
+ if( g->mark >= 0 ) {
+ memset( d->track + d->i , g->mark, 3 );
+ bitmap_set( d->clocks, d->i ); d->i++;
+ bitmap_set( d->clocks, d->i ); d->i++;
+ bitmap_set( d->clocks, d->i ); d->i++;
+ }
+/*------------------------------ mark ------------------------------*/
+ if( g->mark < 0 ) /* FM */
bitmap_set( d->clocks, d->i ); /* set clock mark */
d->track[ d->i++ ] = 0xfc; /* index mark */
return 0;
}
static int
-postindex_add( disk_t *d, int gap ) /* preindex gap and index mark */
+postindex_len( disk_t *d, int gaptype ) /* preindex gap and index mark */
{
- return gap_add( d, 1, 0xa1, gap );
+ disk_gap_t *g = &gaps[ gaptype ];
+ return g->len[1];
}
static int
-gap4_add( disk_t *d, int gap )
+postindex_add( disk_t *d, int gaptype ) /* postindex gap */
{
+ return gap_add( d, 1, gaptype );
+}
+
+static int
+gap4_add( disk_t *d, int gaptype )
+{
int len = d->bpt - d->i;
- disk_gap_t *g = &gaps[ gap ];
+ disk_gap_t *g = &gaps[ gaptype ];
if( len < 0 ) {
return 1;
@@ -368,22 +390,35 @@
#define CRC_OK 0
#define CRC_ERROR 1
+/*
+ [ ....GAP.... ] [ ... SYNC ... ] [ . MARK . ] [ .. DATA .. ] [ . CRC . ]
+ |------------------------------------------------------->
+ ID
+*/
static int
-id_add( disk_t *d, int h, int t, int s, int l, int gap, int crc_error )
+id_add( disk_t *d, int h, int t, int s, int l, int gaptype, int crc_error )
{
libspectrum_word crc = 0xffff;
- if( d->i + 7 >= d->bpt ) /* too many data bytes */
+ disk_gap_t *g = &gaps[ gaptype ];
+ if( d->i + g->sync_len + ( g->mark >= 0 ? 3 : 0 ) + 7 >= d->bpt )
return 1;
-/*------------------------------ header ------------------------------*/
- if( d->density == DISK_SD )
- bitmap_set( d->clocks, d->i ); /* set clock mark */
+/*------------------------------ sync ---------------------------*/
+ memset( d->track + d->i, g->sync, g->sync_len ); d->i += g->sync_len;
+ if( g->mark >= 0 ) {
+ memset( d->track + d->i , g->mark, 3 );
+ bitmap_set( d->clocks, d->i ); d->i++;
+ crc = crc_fdc( crc, g->mark );
+ bitmap_set( d->clocks, d->i ); d->i++;
+ crc = crc_fdc( crc, g->mark );
+ bitmap_set( d->clocks, d->i ); d->i++;
+ crc = crc_fdc( crc, g->mark );
+ }
+/*------------------------------ mark ------------------------------*/
+ if( g->mark < 0 ) /* FM */
+ bitmap_set( d->clocks, d->i ); /* set clock mark */
d->track[ d->i++ ] = 0xfe; /* ID mark */
- if( d->density != DISK_SD ) {
- crc = crc_fdc( crc, 0xa1 );
- crc = crc_fdc( crc, 0xa1 );
- crc = crc_fdc( crc, 0xa1 );
- }
crc = crc_fdc( crc, 0xfe );
+/*------------------------------ header ------------------------------*/
d->track[ d->i++ ] = t; crc = crc_fdc( crc, t );
d->track[ d->i++ ] = h; crc = crc_fdc( crc, h );
d->track[ d->i++ ] = s; crc = crc_fdc( crc, s );
@@ -395,41 +430,58 @@
d->track[ d->i++ ] = crc & 0xff; /* CRC */
}
/*------------------------------ GAP II ------------------------------*/
- return gap_add( d, 2, 0xa1, gap );
+ return gap_add( d, 2, gaptype );
}
+/*
+ [ ....GAP.... ] [ ... SYNC ... ] [ . MARK . ] [ .. DATA .. ] [ . CRC . ]
+ |-------------------------------------------->
+ datamark
+*/
static int
-datamark_add( disk_t *d, int ddam )
+datamark_add( disk_t *d, int ddam, int gaptype )
{
- if( d->i + 1 >= d->bpt ) /* too many data bytes */
+ disk_gap_t *g = &gaps[ gaptype ];
+ if( d->i + g->len[2] + g->sync_len + ( g->mark >= 0 ? 3 : 0 ) + 1 >= d->bpt )
return 1;
-/*------------------------------ data ------------------------------*/
- if( d->density == DISK_SD )
- bitmap_set( d->clocks, d->i ); /* set clock mark */
+/*------------------------------ sync ---------------------------*/
+ memset( d->track + d->i, g->sync, g->sync_len ); d->i += g->sync_len;
+ if( g->mark >= 0 ) {
+ memset( d->track + d->i , g->mark, 3 );
+ bitmap_set( d->clocks, d->i ); d->i++;
+ bitmap_set( d->clocks, d->i ); d->i++;
+ bitmap_set( d->clocks, d->i ); d->i++;
+ }
+/*------------------------------ mark ------------------------------*/
+ if( g->mark < 0 ) /* FM */
+ bitmap_set( d->clocks, d->i ); /* set clock mark */
d->track[ d->i++ ] = ddam ? 0xf8 : 0xfb; /* DATA mark 0xf8 -> deleted data */
return 0;
}
+
#define NO_DDAM 0
#define DDAM 1
#define NO_AUTOFILL -1
/* if 'file' == NULL, then copy data bytes from 'data' */
static int
-data_add( disk_t *d, FILE *file, unsigned char *data, int len, int ddam, int gap, int autofill )
+data_add( disk_t *d, FILE *file, unsigned char *data, int len, int ddam, int gaptype, int crc_error, int autofill )
{
int length;
libspectrum_word crc = 0xffff;
+ disk_gap_t *g = &gaps[ gaptype ];
- if( datamark_add( d, ddam ) )
+ if( datamark_add( d, ddam, gaptype ) )
return 1;
- if( d->density != DISK_SD ) {
- crc = crc_fdc( crc, 0xa1 );
- crc = crc_fdc( crc, 0xa1 );
- crc = crc_fdc( crc, 0xa1 );
+
+ if( g->mark >= 0 ) {
+ crc = crc_fdc( crc, g->mark );
+ crc = crc_fdc( crc, g->mark );
+ crc = crc_fdc( crc, g->mark );
}
- crc = crc_fdc( crc, 0xfb );
+ crc = crc_fdc( crc, ddam ? 0xf8 : 0xfb ); /* deleted or normal */
if( len < 0 )
- goto header_crc_error; /* CRC error */
- if( d->i + len + 2 >= d->bpt ) /* too many data bytes */
+ goto header_crc_error; /* CRC error */
+ if( d->i + len + 2 >= d->bpt ) /* too many data bytes */
return 1;
/*------------------------------ data ------------------------------*/
if( file == NULL ) {
@@ -452,32 +504,29 @@
d->i++;
length++;
}
+ if( crc_error ) crc ^= 1; /* mess up CRC */
d->track[ d->i++ ] = crc >> 8; d->track[ d->i++ ] = crc & 0xff; /* CRC */
/*------------------------------ GAP III ------------------------------*/
header_crc_error:
- return ( gap_add( d, 3, 0xa1, gap ) );
+ return ( gap_add( d, 3, gaptype ) );
}
static int
-calc_sectorlen( int mfm, int sector_length, int gap )
+calc_sectorlen( int mfm, int sector_length, int gaptype )
{
int len = 0;
- disk_gap_t *g = &gaps[ gap ];
+ disk_gap_t *g = &gaps[ gaptype ];
/*------------------------------ ID ------------------------------*/
- len += 7;
+ len += g->sync_len + ( g->mark >= 0 ? 3 : 0 ) + 7;
/*------------------------------ GAP II ------------------------------*/
- len += g->len[2] + g->sync_len;
- if( mfm )
- len += 3;
+ len += g->len[2];
/*--------------------------------- data ---------------------------------*/
- len += 1; /* DAM */
+ len += g->sync_len + ( g->mark >= 0 ? 3 : 0 ) + 1; /* DAM */
len += sector_length;
len += 2; /* CRC */
/*------------------------------ GAP III ------------------------------*/
- len += g->len[3] + g->sync_len;
- if( mfm )
- len += 3;
+ len += g->len[3];
return len;
}
@@ -510,7 +559,7 @@
d->i = idx + ( pos + i ) * slen;
if( id_add( d, head, track, s, sector_length >> 8, gap, CRC_OK ) )
return 1;
- if( data_add( d, file, NULL, sector_length, NO_DDAM, gap, autofill ) )
+ if( data_add( d, file, NULL, sector_length, NO_DDAM, gap, CRC_OK, autofill ) )
return 1;
pos += interleave;
if( pos >= sectors ) {
@@ -546,18 +595,21 @@
if( d->density != DISK_DENS_AUTO ) {
d->bpt = disk_bpt[ d->density ];
- } else if( d->bpt > 13000 ) {
+ } else if( d->bpt > 12500 ) {
return d->status = DISK_UNSUP;
- } else if( d->bpt > 10600 ) {
+ } else if( d->bpt > 10416 ) {
d->density = DISK_HD;
d->bpt = disk_bpt[ DISK_HD ];
} else if( d->bpt > 6500 ) {
d->density = DISK_8_DD;
d->bpt = disk_bpt[ DISK_8_DD ];
- } else if( d->bpt > 5300 ) {
+ } else if( d->bpt > 6250 ) {
+ d->density = DISK_DD_PLUS;
+ d->bpt = disk_bpt[ DISK_DD_PLUS ];
+ } else if( d->bpt > 5208 ) {
d->density = DISK_DD;
d->bpt = disk_bpt[ DISK_DD ];
- } else if( d->bpt > 3250 ) {
+ } else if( d->bpt > 3125 ) {
d->density = DISK_8_SD;
d->bpt = disk_bpt[ DISK_8_SD ];
} else if( d->bpt > 0 ) {
@@ -806,8 +858,10 @@
fseek( file, head_offset, SEEK_SET );
if( fread( head, 7, 1, file ) != 1 ) /* 7 := track head */
return d->status = DISK_OPEN;
- bpt = bpt_fm = 0;
-
+ bpt = postindex_len( d, GAP_MINIMAL_MFM ) +
+ ( preindex ? preindex_len( d, GAP_MINIMAL_MFM ) : 0 ) + 6; /* +gap4 */
+ bpt_fm = postindex_len( d, GAP_MINIMAL_FM ) +
+ ( preindex ? preindex_len( d, GAP_MINIMAL_FM ) : 0 ) + 3; /* +gap4 */
for( j = 0; j < head[0x06]; j++ ) { /* calculate track len */
if( j % 35 == 0 ) { /* 35-sector header */
if( fread( head + 7, 245, 1, file ) != 1 ) /* 7*35 := max 35 sector head */
@@ -871,7 +925,7 @@
data_add( d, file, NULL, ( head[ 0x0b + 7 * ( j % 35 ) ] & 0x3f ) == 0 ?
-1 : 0x80 << head[ 0x0a + 7 * ( j % 35 ) ],
head[ 0x0b + 7 * ( j % 35 ) ] & 0x80 ? DDAM : NO_DDAM,
- gap, NO_AUTOFILL );
+ gap, CRC_OK, NO_AUTOFILL );
}
head_offset += 7 + 7 * head[0x06];
gap4_add( d, gap );
@@ -882,57 +936,147 @@
static int
open_cpc( FILE *file, disk_t *d, disk_type_t type, int preindex )
{
- int i, j, seclen, gap;
- int bpt, max_bpt = 0, max_bpt_fm = 0;
+ int i, j, seclen, idlen, gap;
+ int bpt, max_bpt = 0, trlen;
+ int fix[42], plus3_fix;
d->sides = head[0x31];
- d->cylinders = head[0x30];
- if( type == DISK_CPC ) {
- max_bpt = calc_sectorlen( 1, head[0x32] + 256 * head[0x33] - 0x100, GAP_MINIMAL_MFM );
- max_bpt_fm = calc_sectorlen( 0, head[0x32] + 256 * head[0x33] - 0x100, GAP_MINIMAL_FM );
- } else {
- d->bpt = 0;
- for( i = 0; i < d->sides * d->cylinders; i++ ) {
- bpt = calc_sectorlen( 1, ( head[ 0x34 + i ] << 8 ) - 0x100, GAP_MINIMAL_MFM );
- if( bpt > max_bpt )
- max_bpt = bpt;
- bpt = calc_sectorlen( 0, ( head[ 0x34 + i ] << 8 ) - 0x100, GAP_MINIMAL_FM );
- if( bpt > max_bpt_...
[truncated message content] |