Merge branch 'experimental_host_fst' into 'experimental'

Experimental host fst

Host FST support. Works on OS X. In theory may work elsewhere but hasn't been tested or compiled yet.

See merge request !1
This commit is contained in:
Dagen Brock 2016-10-30 12:24:28 -05:00
commit 89edb6d3aa
9 changed files with 2879 additions and 2 deletions

View File

@ -4,7 +4,7 @@
OBJECTS1 = adb.o clock.o config.o debug.o dis.o engine_c.o scc.o iwm.o \
joystick_driver.o moremem.o paddles.o parallel.o printer.o sim65816.o \
smartport.o sound.o sound_driver.o video.o scc_socket_driver.o glog.o \
imagewriter.o scc_imagewriter.o scc_llap.o
imagewriter.o scc_imagewriter.o scc_llap.o host_fst.o
ATOBJ = atbridge/aarp.o atbridge/atbridge.o atbridge/elap.o atbridge/llap.o atbridge/port.o
PCAPOBJ = atbridge/pcap_delay.o
TFEOBJ = tfe/tfe.o tfe/tfearch.o tfe/tfesupp.o

View File

@ -116,6 +116,9 @@ extern int g_win_show_console_request;
extern int g_win_status_debug_request;
#endif
extern char *g_cfg_host_path;
extern int g_cfg_host_read_only;
extern int g_screen_index[];
extern word32 g_full_refresh_needed;
extern word32 g_a2_screen_buffer_changed;
@ -234,6 +237,19 @@ Cfg_menu g_cfg_rom_menu[] = {
{ 0, 0, 0, 0, 0 },
};
Cfg_menu g_cfg_host_menu[] = {
{ "Host FST Configuration", g_cfg_host_menu, 0, 0, CFGTYPE_MENU },
{ "Shared Host Folder", KNMP(g_cfg_host_path), CFGTYPE_STR },
{ "Read Only,0,No,1,Yes", KNMP(g_cfg_host_read_only), CFGTYPE_INT },
{ "", 0, 0, 0, 0 },
{ "Back to Main Config", g_cfg_main_menu, 0, 0, CFGTYPE_MENU },
{ 0, 0, 0, 0, 0 },
};
Cfg_menu g_cfg_serial_menu[] = {
{ "Serial Port Configuration", g_cfg_serial_menu, 0, 0, CFGTYPE_MENU },
#ifdef HAVE_SDL
@ -376,6 +392,7 @@ Cfg_menu g_cfg_main_menu[] = {
{ "Disk Configuration", g_cfg_disk_menu, 0, 0, CFGTYPE_MENU },
{ "Joystick Configuration", g_cfg_joystick_menu, 0, 0, CFGTYPE_MENU },
{ "ROM File Selection", g_cfg_rom_menu, 0, 0, CFGTYPE_MENU },
{ "HOST FST Configuration", g_cfg_host_menu, 0, 0, CFGTYPE_MENU },
{ "Serial Port Configuration", g_cfg_serial_menu, 0, 0, CFGTYPE_MENU },
{ "Ethernet Card Configuration", g_cfg_ethernet_menu, 0, 0, CFGTYPE_MENU },
{ "Parallel Card Configuration", g_cfg_parallel_menu, 0, 0, CFGTYPE_MENU },

View File

@ -602,6 +602,23 @@ get_memory24_c(word32 addr, int cycs)
(get_memory_c(addr+2, (int)fcycs) << 16);
}
word32
get_memory32_c(word32 addr, int cycs)
{
double fcycs;
fcycs = 0;
return get_memory_c(addr, (int)fcycs) +
(get_memory_c(addr+1, (int)fcycs) << 8) +
(get_memory_c(addr+2, (int)fcycs) << 16) +
(get_memory_c(addr+3, (int)fcycs) << 24);
}
void
set_memory_c(word32 addr, word32 val, int cycs)
{
@ -642,6 +659,17 @@ set_memory24_c(word32 addr, word32 val, int cycs)
set_memory_c(addr + 2, val >> 16, 0);
}
void
set_memory32_c(word32 addr, word32 val, int cycs)
{
set_memory_c(addr, val, 0);
set_memory_c(addr + 1, val >> 8, 0);
set_memory_c(addr + 2, val >> 16, 0);
set_memory_c(addr + 3, val >> 24, 0);
}
word32
do_adc_sbc8(word32 in1, word32 in2, word32 psr, int sub)
{

182
src/fst.h Normal file
View File

@ -0,0 +1,182 @@
/* generated on Tue Oct 18 20:54:09 2016 */
#define GSString255_length 0
#define GSString255_text 2
#define GSString32_length 0
#define GSString32_text 2
#define ResultBuf255_bufSize 0
#define ResultBuf255_bufString 2
#define ResultBuf32_bufSize 0
#define ResultBuf32_bufString 2
#define TimeRec_second 0
#define TimeRec_minute 1
#define TimeRec_hour 2
#define TimeRec_year 3
#define TimeRec_day 4
#define TimeRec_month 5
#define TimeRec_extra 6
#define TimeRec_weekDay 7
#define CreateRecGS_pCount 0
#define CreateRecGS_pathname 2
#define CreateRecGS_access 6
#define CreateRecGS_fileType 8
#define CreateRecGS_auxType 10
#define CreateRecGS_storageType 14
#define CreateRecGS_eof 16
#define CreateRecGS_resourceEOF 20
#define CreateRec_pathname 0
#define CreateRec_fAccess 4
#define CreateRec_fileType 6
#define CreateRec_auxType 8
#define CreateRec_storageType 12
#define CreateRec_createDate 14
#define CreateRec_createTime 16
#define DirEntryRecGS_pCount 0
#define DirEntryRecGS_refNum 2
#define DirEntryRecGS_flags 4
#define DirEntryRecGS_base 6
#define DirEntryRecGS_displacement 8
#define DirEntryRecGS_name 10
#define DirEntryRecGS_entryNum 14
#define DirEntryRecGS_fileType 16
#define DirEntryRecGS_eof 18
#define DirEntryRecGS_blockCount 22
#define DirEntryRecGS_createDateTime 26
#define DirEntryRecGS_modDateTime 34
#define DirEntryRecGS_access 42
#define DirEntryRecGS_auxType 44
#define DirEntryRecGS_fileSysID 48
#define DirEntryRecGS_optionList 50
#define DirEntryRecGS_resourceEOF 54
#define DirEntryRecGS_resourceBlocks 58
#define DirEntryRec_refNum 0
#define DirEntryRec_flags 2
#define DirEntryRec_base 4
#define DirEntryRec_displacement 6
#define DirEntryRec_nameBuffer 8
#define DirEntryRec_entryNum 12
#define DirEntryRec_fileType 14
#define DirEntryRec_endOfFile 16
#define DirEntryRec_blockCount 20
#define DirEntryRec_createTime 24
#define DirEntryRec_modTime 32
#define DirEntryRec_access 40
#define DirEntryRec_auxType 42
#define DirEntryRec_fileSysID 46
#define FileInfoRecGS_pCount 0
#define FileInfoRecGS_pathname 2
#define FileInfoRecGS_access 6
#define FileInfoRecGS_fileType 8
#define FileInfoRecGS_auxType 10
#define FileInfoRecGS_storageType 14
#define FileInfoRecGS_createDateTime 16
#define FileInfoRecGS_modDateTime 24
#define FileInfoRecGS_optionList 32
#define FileInfoRecGS_eof 36
#define FileInfoRecGS_blocksUsed 40
#define FileInfoRecGS_resourceEOF 44
#define FileInfoRecGS_resourceBlocks 48
#define FileRec_pathname 0
#define FileRec_fAccess 4
#define FileRec_fileType 6
#define FileRec_auxType 8
#define FileRec_storageType 12
#define FileRec_createDate 14
#define FileRec_createTime 16
#define FileRec_modDate 18
#define FileRec_modTime 20
#define FileRec_blocksUsed 22
#define OpenRecGS_pCount 0
#define OpenRecGS_refNum 2
#define OpenRecGS_pathname 4
#define OpenRecGS_requestAccess 8
#define OpenRecGS_resourceNumber 10
#define OpenRecGS_access 12
#define OpenRecGS_fileType 14
#define OpenRecGS_auxType 16
#define OpenRecGS_storageType 20
#define OpenRecGS_createDateTime 22
#define OpenRecGS_modDateTime 30
#define OpenRecGS_optionList 38
#define OpenRecGS_eof 42
#define OpenRecGS_blocksUsed 46
#define OpenRecGS_resourceEOF 50
#define OpenRecGS_resourceBlocks 54
#define OpenRec_openRefNum 0
#define OpenRec_openPathname 2
#define OpenRec_ioBuffer 6
#define VolumeRecGS_pCount 0
#define VolumeRecGS_devName 2
#define VolumeRecGS_volName 6
#define VolumeRecGS_totalBlocks 10
#define VolumeRecGS_freeBlocks 14
#define VolumeRecGS_fileSysID 18
#define VolumeRecGS_blockSize 20
#define VolumeRecGS_characteristics 22
#define VolumeRecGS_deviceID 24
#define VolumeRec_deviceName 0
#define VolumeRec_volName 4
#define VolumeRec_totalBlocks 8
#define VolumeRec_freeBlocks 12
#define VolumeRec_fileSysID 16
#define JudgeNameRecGS_pCount 0
#define JudgeNameRecGS_fileSysID 2
#define JudgeNameRecGS_nameType 4
#define JudgeNameRecGS_syntax 6
#define JudgeNameRecGS_maxLen 10
#define JudgeNameRecGS_name 12
#define JudgeNameRecGS_nameFlags 16
#define PositionRecGS_pCount 0
#define PositionRecGS_refNum 2
#define PositionRecGS_position 4
#define MarkRec_markRefNum 0
#define MarkRec_position 2
#define EOFRecGS_pCount 0
#define EOFRecGS_refNum 2
#define EOFRecGS_eof 4
#define EOFRec_eofRefNum 0
#define EOFRec_eofPosition 2
#define IORecGS_pCount 0
#define IORecGS_refNum 2
#define IORecGS_dataBuffer 4
#define IORecGS_requestCount 8
#define IORecGS_transferCount 12
#define IORecGS_cachePriority 16
#define FileIORec_fileRefNum 0
#define FileIORec_dataBuffer 2
#define FileIORec_requestCount 6
#define FileIORec_transferCount 10
#define SetPositionRecGS_pCount 0
#define SetPositionRecGS_refNum 2
#define SetPositionRecGS_base 4
#define SetPositionRecGS_displacement 6
#define DevNumRecGS_pCount 0
#define DevNumRecGS_devName 2
#define DevNumRecGS_devNum 6
#define DevNumRec_devName 0
#define DevNumRec_devNum 4

164
src/gsos.h Normal file
View File

@ -0,0 +1,164 @@
#define readEnableAllowWrite 0x0000
#define readEnable 0x0001
#define writeEnable 0x0002
#define readWriteEnable 0x0003
#define fileInvisible 0x0004 /* Invisible bit */
#define backupNeeded 0x0020 /* backup needed bit: CreateRec/ OpenRec access field. (Must be 0 in requestAccess field ) */
#define renameEnable 0x0040 /* rename enable bit: CreateRec/ OpenRec access and requestAccess fields */
#define destroyEnable 0x0080 /* destroy enable bit: CreateRec/ OpenRec access and requestAccess fields */
#define startPlus 0x0000 /* base -> setMark = displacement */
#define eofMinus 0x0001 /* base -> setMark = eof - displacement */
#define markPlus 0x0002 /* base -> setMark = mark + displacement */
#define markMinus 0x0003 /* base -> setMark = mark - displacement */
/* cachePriority Codes */
#define cacheOff 0x0000 /* do not cache blocks invloved in this read */
#define cacheOn 0x0001 /* cache blocks invloved in this read if possible */
/* Error Codes */
#define badSystemCall 0x0001 /* bad system call number */
#define invalidPcount 0x0004 /* invalid parameter count */
#define gsosActive 0x0007 /* GS/OS already active */
#ifndef devNotFound /* device not found */
#define devNotFound 0x0010
#endif
#define invalidDevNum 0x0011 /* invalid device number */
#define drvrBadReq 0x0020 /* bad request or command */
#define drvrBadCode 0x0021 /* bad control or status code */
#define drvrBadParm 0x0022 /* bad call parameter */
#define drvrNotOpen 0x0023 /* character device not open */
#define drvrPriorOpen 0x0024 /* character device already open */
#define irqTableFull 0x0025 /* interrupt table full */
#define drvrNoResrc 0x0026 /* resources not available */
#define drvrIOError 0x0027 /* I/O error */
#define drvrNoDevice 0x0028 /* device not connected */
#define drvrBusy 0x0029 /* call aborted; driver is busy */
#define drvrWrtProt 0x002B /* device is write protected */
#define drvrBadCount 0x002C /* invalid byte count */
#define drvrBadBlock 0x002D /* invalid block address */
#define drvrDiskSwitch 0x002E /* disk has been switched */
#define drvrOffLine 0x002F /* device off line/ no media present */
#define badPathSyntax 0x0040 /* invalid pathname syntax */
#define tooManyFilesOpen 0x0042 /* too many files open on server volume */
#define invalidRefNum 0x0043 /* invalid reference number */
#ifndef pathNotFound /* subdirectory does not exist */
#define pathNotFound 0x0044
#endif
#define volNotFound 0x0045 /* volume not found */
#ifndef fileNotFound /* file not found */
#define fileNotFound 0x0046
#endif
#define dupPathname 0x0047 /* create or rename with existing name */
#define volumeFull 0x0048 /* volume full error */
#define volDirFull 0x0049 /* volume directory full */
#define badFileFormat 0x004A /* version error (incompatible file format) */
#ifndef badStoreType /* unsupported (or incorrect) storage type */
#define badStoreType 0x004B
#endif
#ifndef eofEncountered /* end-of-file encountered */
#define eofEncountered 0x004C
#endif
#define outOfRange 0x004D /* position out of range */
#define invalidAccess 0x004E /* access not allowed */
#define buffTooSmall 0x004F /* buffer too small */
#define fileBusy 0x0050 /* file is already open */
#define dirError 0x0051 /* directory error */
#define unknownVol 0x0052 /* unknown volume type */
#ifndef paramRangeErr /* parameter out of range */
#define paramRangeErr 0x0053
#endif
#define outOfMem 0x0054 /* out of memory */
#define dupVolume 0x0057 /* duplicate volume name */
#define notBlockDev 0x0058 /* not a block device */
#ifndef invalidLevel /* specifield level outside legal range */
#define invalidLevel 0x0059
#endif
#define damagedBitMap 0x005A /* block number too large */
#define badPathNames 0x005B /* invalid pathnames for ChangePath */
#define notSystemFile 0x005C /* not an executable file */
#define osUnsupported 0x005D /* Operating System not supported */
#ifndef stackOverflow /* too many applications on stack */
#define stackOverflow 0x005F
#endif
#define dataUnavail 0x0060 /* Data unavailable */
#define endOfDir 0x0061 /* end of directory has been reached */
#define invalidClass 0x0062 /* invalid FST call class */
#define resForkNotFound 0x0063 /* file does not contain required resource */
#define invalidFSTID 0x0064 /* error - FST ID is invalid */
#define invalidFSTop 0x0065 /* invalid FST operation */
#define fstCaution 0x0066 /* FST handled call, but result is weird */
#define devNameErr 0x0067 /* device exists with same name as replacement name */
#define defListFull 0x0068 /* device list is full */
#define supListFull 0x0069 /* supervisor list is full */
#define fstError 0x006a /* generic FST error */
#define resExistsErr 0x0070 /* cannot expand file, resource already exists */
#define resAddErr 0x0071 /* cannot add resource fork to this type file */
#define networkError 0x0088 /* generic network error */
/* fileSys IDs */
#define proDOSFSID 0x0001 /* ProDOS/SOS */
#define dos33FSID 0x0002 /* DOS 3.3 */
#define dos32FSID 0x0003 /* DOS 3.2 */
#define dos31FSID 0x0003 /* DOS 3.1 */
#define appleIIPascalFSID 0x0004 /* Apple II Pascal */
#define mfsFSID 0x0005 /* Macintosh (flat file system) */
#define hfsFSID 0x0006 /* Macintosh (hierarchical file system) */
#define lisaFSID 0x0007 /* Lisa file system */
#define appleCPMFSID 0x0008 /* Apple CP/M */
#define charFSTFSID 0x0009 /* Character FST */
#define msDOSFSID 0x000A /* MS/DOS */
#define highSierraFSID 0x000B /* High Sierra */
#define iso9660FSID 0x000C /* ISO 9660 */
#define appleShareFSID 0x000D /* ISO 9660 */
/* FSTInfo.attributes Codes */
#define characterFST 0x4000 /* character FST */
#define ucFST 0x8000 /* SCM should upper case pathnames before passing them to the FST */
/* QuitRec.flags Codes */
#define onStack 0x8000 /* place state information about quitting program on the quit return stack */
#define restartable 0x4000 /* the quitting program is capable of being restarted from its dormant memory */
/* storageType Codes */
#define seedling 0x0001 /* standard file with seedling structure */
#define standardFile 0x0001 /* standard file type (no resource fork) */
#define sapling 0x0002 /* standard file with sapling structure */
#define tree 0x0003 /* standard file with tree structure */
#define pascalRegion 0x0004 /* UCSD Pascal region on a partitioned disk */
#define extendedFile 0x0005 /* extended file type (with resource fork) */
#define directoryFile 0x000D /* volume directory or subdirectory file */
/* version Codes */
#define minorRelNumMask 0x00FF /* minor release number */
#define majorRelNumMask 0x7F00 /* major release number */
#define finalRelNumMask 0x8000 /* final release number */
/* Other Constants */
#define isFileExtended 0x8000 /* GetDirEntryGS */
/* DControl Codes */
#define resetDevice 0x0000
#define formatDevice 0x0001
#define eject 0x0002
#define setConfigParameters 0x0003
#define setWaitStatus 0x0004
#define setFormatOptions 0x0005
#define assignPartitionOwner 0x0006
#define armSignal 0x0007
#define disarmSignal 0x0008
#define setPartitionMap 0x0009

2475
src/host_fst.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -59,6 +59,7 @@ word32 get_itimer(void);
word32 get_memory_c(word32 addr, int cycs);
word32 get_memory16_c(word32 addr, int cycs);
word32 get_memory24_c(word32 addr, int cycs);
word32 get_memory32_c(word32 addr, int cycs);
int get_memory_asm(word32 addr, int cycs);
int get_memory16_asm(word32 addr, int cycs);
@ -69,6 +70,7 @@ int get_memory16_act_stub_asm(word32 addr, int cycs);
void set_memory_c(word32 addr, word32 val, int cycs);
void set_memory16_c(word32 addr, word32 val, int cycs);
void set_memory24_c(word32 addr, word32 val, int cycs);
void set_memory32_c(word32 addr, word32 val, int cycs);
int enter_engine(Engine_reg *ptr);
void clr_halt_act(void);

View File

@ -34,9 +34,11 @@ void set_memory24_pieces_stub(word32 addr, word32 val, double *fcycs_ptr, Fplus
word32 get_memory_c(word32 addr, int cycs);
word32 get_memory16_c(word32 addr, int cycs);
word32 get_memory24_c(word32 addr, int cycs);
word32 get_memory32_c(word32 addr, int cycs);
void set_memory_c(word32 addr, word32 val, int cycs);
void set_memory16_c(word32 addr, word32 val, int cycs);
void set_memory24_c(word32 addr, word32 val, int cycs);
void set_memory32_c(word32 addr, word32 val, int cycs);
word32 do_adc_sbc8(word32 in1, word32 in2, word32 psr, int sub);
word32 do_adc_sbc16(word32 in1, word32 in2, word32 psr, int sub);
void fixed_memory_ptrs_init(void);

View File

@ -2685,14 +2685,21 @@ do_mvn(word32 banks)
}
#endif
extern void host_fst(void);
void
do_wdm(word32 arg)
{
switch(arg) {
case 0x8d: /* Bouncin Ferno does WDM 8d */
break;
case 0xff: /* fst */
host_fst();
break;
default:
halt_printf("do_wdm: %02x!\n", arg);
halt_printf("do_wdm: %02x! pc = $%06x\n", arg, engine.kpc - 2);
}
}