From: Alex B. <vam...@gm...> - 2012-08-12 20:35:18
|
Hi, On Fri, Aug 10, 2012 at 12:06 AM, Alex Badea <vam...@gm...> wrote: > == Code == > > I've written a proof-of-concept hack[2] for fuse which adds i8272 > support to IF1 code. In conjunction with the HC IF1 ROM it can > successfully emulate floppy access from BASIC, including the use of > disk images dumped from real disks. Of note, the IF1 controls the > i8272 Terminal Count (TC) input, and relies on its proper operation; > support for this was added to upd_fdc. > > There are a couple of design choices where I'd like to ask for advice. > > 1) How do we implement the floppy-flavoured IF1? > 1A) implement a whole new peripheral type, with its own paging routines, etc. > 1B) add a switchable mode to the existing IF1 code, allowing to choose > between microdrive and floppy > > 2) Should we create new machine types for these clones? > 2A) Yes (presumably one for each model) > 2B) No, we would simply have some peripherals which can be manually > enabled on top of spec48 > > Any and all other feedback is greatly appreciated. For now, I took the easy way out and prototyped a patch series[1] for solutions 1B and 2B. This is pretty much full HC90 (non-CP/M) support, except for saving IF1 FDC state in snapshots. Brief instructions for anyone wishing to try this out: # clone and build git clone -b hc-if1-v3 git://github.com/vamposdecampos/fuse-emulator-svn.git cd fuse-emulator-svn/fuse ./configure && make # get the IF1 ROM, trim it to 8K wget -O hc2k_old.zip https://sites.google.com/site/georgechirtoaca/HC2K_OLD.ZIP?attredirects=0 unzip hc2k.zip if1_old.rom dd if=if1_old.rom of=if1_trunc.rom bs=8192 count=1 # run ./fuse -m 48 --rom-interface-i=if1_old_trunc.rom --interface1 --interface1-fdc # menu: Media, Disk, HC Interface 1, Drive 1, Insert New # on the speccy: FORMAT "d";1 SAVE *"d";1;"test" CAT 1 Cheers, Alex [1] https://github.com/vamposdecampos/fuse-emulator-svn/commits/hc-if1-v3 Alex Badea (15): upd_fdc: implement Terminal Count support debugger: add support for setting IM and IFFs gtk debugger: use MEMORY_PAGE_SIZE instead of hard-coded 4k disk: allow reading/writing mgt layouts of 80x16x256 and 40x16x256 memory: change page size from 4k to 1k Add skeleton if1_fdc peripheral if1_fdc: add periph type and setting for enabling it if1_fdc: add 1kB RAM if1_fdc: add if1_fdc_available flag if1_fdc: create an i8272 / uPD765 FDC if1: disable microdrive I/O if if1_fdc is enabled if1_fdc: hook up i8272 to I/O ports if1_fdc: add UI and drive type settings if1_fdc: hook up media menu items if1_fdc: emulate 555 timer for fdd deselection fuse/debugger/command.c | 18 ++ fuse/debugger/commandl.l | 3 + fuse/fuse.c | 1 + fuse/machines/machines_periph.c | 1 + fuse/memory.h | 2 +- fuse/menu.c | 22 ++ fuse/menu_data.dat | 26 +++ fuse/periph.h | 1 + fuse/peripherals/Makefile.am | 2 + fuse/peripherals/disk/disk.c | 10 +- fuse/peripherals/disk/upd_fdc.c | 44 +++-- fuse/peripherals/disk/upd_fdc.h | 2 + fuse/peripherals/if1.c | 14 ++- fuse/peripherals/if1_fdc.c | 401 +++++++++++++++++++++++++++++++++++++++ fuse/peripherals/if1_fdc.h | 23 +++ fuse/settings.dat | 3 + fuse/ui.c | 62 ++++++- fuse/ui/gtk/debugger.c | 2 +- fuse/ui/options.dat | 3 + fuse/ui/ui.h | 10 + 20 files changed, 630 insertions(+), 20 deletions(-) |