/* GLOBGLUE.c Copyright (C) 2003 Bernd Schmidt, Philip Cummins, Paul C. Pratt You can redistribute this file and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. You should have received a copy of the license along with this file; see the file COPYING. This file 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 license for more details.*/ /* GLOBal GLUE (or GLOB of GLUE) Holds the program together. Some code here adapted from "custom.c" in vMac by Philip Cummins, in turn descended from code in the Un*x Amiga Emulator by Bernd Schmidt.*/ #ifndef AllFiles#include "SYSDEPNS.h" #include "MYOSGLUE.h"#include "ENDIANAC.h"#include "EMCONFIG.h"#endif #include "GLOBGLUE.h" /* ReportAbnormalID unused 0x111D - 0x11FF*/ /* ReportAbnormalID ranges unused 0x12xx - 0xFFxx*/ IMPORTPROC m68k_reset(void);IMPORTPROC IWM_Reset(void);IMPORTPROC SCC_Reset(void);IMPORTPROC SCSI_Reset(void);IMPORTPROC VIA1_Reset(void);#if EmVIA2IMPORTPROC VIA2_Reset(void);#endifIMPORTPROC Sony_Reset(void); IMPORTPROC ExtnDisk_Access(CPTR p);IMPORTPROC ExtnSony_Access(CPTR p);#if EmVidCardIMPORTPROC ExtnVideo_Access(CPTR p);#endif IMPORTPROC Sony_SetQuitOnEject(void); IMPORTPROC m68k_IPLchangeNtfy(void);IMPORTPROC MINEM68K_Init( ui3b *fIPL); IMPORTFUNC si5r GetCyclesRemaining(void);IMPORTPROC SetCyclesRemaining(si5r n); IMPORTPROC SetHeadATTel(ATTep p);IMPORTFUNC ATTep FindATTel(CPTR addr); IMPORTFUNC ui5b SCSI_Access(ui5b Data, blnr WriteMem, CPTR addr);IMPORTFUNC ui5b SCC_Access(ui5b Data, blnr WriteMem, CPTR addr);IMPORTFUNC ui5b IWM_Access(ui5b Data, blnr WriteMem, CPTR addr);IMPORTFUNC ui5b VIA1_Access(ui5b Data, blnr WriteMem, CPTR addr);#if EmVIA2IMPORTFUNC ui5b VIA2_Access(ui5b Data, blnr WriteMem, CPTR addr);#endif#if EmASCIMPORTFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr);#endif IMPORTFUNC ui3r get_vm_byte(CPTR addr);IMPORTFUNC ui4r get_vm_word(CPTR addr);IMPORTFUNC ui5r get_vm_long(CPTR addr); IMPORTPROC put_vm_byte(CPTR addr, ui3r b);IMPORTPROC put_vm_word(CPTR addr, ui4r w);IMPORTPROC put_vm_long(CPTR addr, ui5r l); GLOBALVAR ui5r my_disk_icon_addr; GLOBALPROC customreset(void){ IWM_Reset(); SCC_Reset(); SCSI_Reset(); VIA1_Reset();#if EmVIA2 VIA2_Reset();#endif Sony_Reset(); Extn_Reset();#if CurEmMd <= kEmMd_Plus WantMacReset = trueblnr; /* kludge, code in Finder appears to do RESET and not expect to come back. Maybe asserting the RESET somehow causes other hardware compenents to later reset the 68000. */#endif} GLOBALVAR ui3p RAM = nullpr; #if EmVidCardGLOBALVAR ui3p VidROM = nullpr;#endif #if IncludeVidMemGLOBALVAR ui3p VidMem = nullpr;#endif GLOBALVAR ui3b Wires[kNumWires]; #if WantDisasmIMPORTPROC m68k_WantDisasmContext(void);#endif #if WantDisasmGLOBALPROC dbglog_StartLine(void){ m68k_WantDisasmContext(); dbglog_writeCStr(" ");}#endif #if dbglog_HAVEGLOBALPROC dbglog_WriteMemArrow(blnr WriteMem){ if (WriteMem) { dbglog_writeCStr(" <- "); } else { dbglog_writeCStr(" -> "); }}#endif #if dbglog_HAVEGLOBALPROC dbglog_AddrAccess(char *s, ui5r Data, blnr WriteMem, ui5r addr){ dbglog_StartLine(); dbglog_writeCStr(s); dbglog_writeCStr("["); dbglog_writeHex(addr); dbglog_writeCStr("]"); dbglog_WriteMemArrow(WriteMem); dbglog_writeHex(Data); dbglog_writeReturn();}#endif #if dbglog_HAVEGLOBALPROC dbglog_Access(char *s, ui5r Data, blnr WriteMem){ dbglog_StartLine(); dbglog_writeCStr(s); dbglog_WriteMemArrow(WriteMem); dbglog_writeHex(Data); dbglog_writeReturn();}#endif #if dbglog_HAVEGLOBALPROC dbglog_WriteNote(char *s){ dbglog_StartLine(); dbglog_writeCStr(s); dbglog_writeReturn();}#endif #if dbglog_HAVEGLOBALPROC dbglog_WriteSetBool(char *s, blnr v){ dbglog_StartLine(); dbglog_writeCStr(s); dbglog_writeCStr(" <- "); if (v) { dbglog_writeCStr("1"); } else { dbglog_writeCStr("0"); } dbglog_writeReturn();}#endif #if WantAbnormalReportsLOCALVAR blnr GotOneAbnormal = falseblnr;#endif #ifndef ReportAbnormalInterrupt#define ReportAbnormalInterrupt 0#endif #if WantAbnormalReportsGLOBALPROC DoReportAbnormalID(ui4r id#if dbglog_HAVE , char *s#endif ){#if dbglog_HAVE dbglog_StartLine(); dbglog_writeCStr("*** abnormal : "); dbglog_writeCStr(s); dbglog_writeReturn();#endif if (! GotOneAbnormal) { WarnMsgAbnormalID(id);#if ReportAbnormalInterrupt SetInterruptButton(trueblnr);#endif GotOneAbnormal = trueblnr; }}#endif /* map of address space */ #define kRAM_Base 0x00000000 /* when overlay off */#if (CurEmMd == kEmMd_PB100)#define kRAM_ln2Spc 23#elif (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx)#define kRAM_ln2Spc 23#else#define kRAM_ln2Spc 22#endif #if IncludeVidMem#if CurEmMd == kEmMd_PB100#define kVidMem_Base 0x00FA0000#define kVidMem_ln2Spc 16#else#define kVidMem_Base 0x00540000#define kVidMem_ln2Spc 18#endif#endif #if CurEmMd == kEmMd_PB100#define kSCSI_Block_Base 0x00F90000#define kSCSI_ln2Spc 16#else#define kSCSI_Block_Base 0x00580000#define kSCSI_ln2Spc 19#endif #define kRAM_Overlay_Base 0x00600000 /* when overlay on */#define kRAM_Overlay_Top 0x00800000 #if CurEmMd == kEmMd_PB100#define kSCCRd_Block_Base 0x00FD0000#define kSCC_ln2Spc 16#else#define kSCCRd_Block_Base 0x00800000#define kSCC_ln2Spc 22#endif #if CurEmMd != kEmMd_PB100#define kSCCWr_Block_Base 0x00A00000#define kSCCWr_Block_Top 0x00C00000#endif #if CurEmMd == kEmMd_PB100#define kIWM_Block_Base 0x00F60000#define kIWM_ln2Spc 16#else#define kIWM_Block_Base 0x00C00000#define kIWM_ln2Spc 21#endif #if CurEmMd == kEmMd_PB100#define kVIA1_Block_Base 0x00F70000#define kVIA1_ln2Spc 16#else#define kVIA1_Block_Base 0x00E80000#define kVIA1_ln2Spc 19#endif #if CurEmMd == kEmMd_PB100#define kASC_Block_Base 0x00FB0000#define kASC_ln2Spc 16#endif#define kASC_Mask 0x00000FFF #if IncludeExtnPbufsLOCALFUNC tMacErr PbufTransferVM(CPTR Buffera, tPbuf i, ui5r offset, ui5r count, blnr IsWrite){ tMacErr result; ui5b contig; ui3p Buffer; label_1: if (0 == count) { result = mnvm_noErr; } else { Buffer = get_real_address0(count, ! IsWrite, Buffera, &contig); if (0 == contig) { result = mnvm_miscErr; } else { PbufTransfer(Buffer, i, offset, contig, IsWrite); offset += contig; Buffera += contig; count -= contig; goto label_1; } } return result;}#endif /* extension mechanism */ #if IncludeExtnPbufs#define kCmndPbufFeatures 1#define kCmndPbufNew 2#define kCmndPbufDispose 3#define kCmndPbufGetSize 4#define kCmndPbufTransfer 5#endif #if IncludeExtnPbufsLOCALPROC ExtnParamBuffers_Access(CPTR p){ tMacErr result = mnvm_controlErr; switch (get_vm_word(p + ExtnDat_commnd)) { case kCmndVersion: put_vm_word(p + ExtnDat_version, 1); result = mnvm_noErr; break; case kCmndPbufFeatures: put_vm_long(p + ExtnDat_params + 0, 0); result = mnvm_noErr; break; case kCmndPbufNew: { tPbuf Pbuf_No; ui5b count = get_vm_long(p + ExtnDat_params + 4); /* reserved word at offset 2, should be zero */ result = PbufNew(count, &Pbuf_No); put_vm_word(p + ExtnDat_params + 0, Pbuf_No); } break; case kCmndPbufDispose: { tPbuf Pbuf_No = get_vm_word(p + ExtnDat_params + 0); /* reserved word at offset 2, should be zero */ result = CheckPbuf(Pbuf_No); if (mnvm_noErr == result) { PbufDispose(Pbuf_No); } } break; case kCmndPbufGetSize: { ui5r Count; tPbuf Pbuf_No = get_vm_word(p + ExtnDat_params + 0); /* reserved word at offset 2, should be zero */ result = PbufGetSize(Pbuf_No, &Count); if (mnvm_noErr == result) { put_vm_long(p + ExtnDat_params + 4, Count); } } break; case kCmndPbufTransfer: { ui5r PbufCount; tPbuf Pbuf_No = get_vm_word(p + ExtnDat_params + 0); /* reserved word at offset 2, should be zero */ ui5r offset = get_vm_long(p + ExtnDat_params + 4); ui5r count = get_vm_long(p + ExtnDat_params + 8); CPTR Buffera = get_vm_long(p + ExtnDat_params + 12); blnr IsWrite = (get_vm_word(p + ExtnDat_params + 16) != 0); result = PbufGetSize(Pbuf_No, &PbufCount); if (mnvm_noErr == result) { ui5r endoff = offset + count; if ((endoff < offset) /* overflow */ || (endoff > PbufCount)) { result = mnvm_eofErr; } else { result = PbufTransferVM(Buffera, Pbuf_No, offset, count, IsWrite); } } } break; } put_vm_word(p + ExtnDat_result, result);}#endif #if IncludeExtnHostTextClipExchange#define kCmndHTCEFeatures 1#define kCmndHTCEExport 2#define kCmndHTCEImport 3#endif #if IncludeExtnHostTextClipExchangeLOCALPROC ExtnHostTextClipExchange_Access(CPTR p){ tMacErr result = mnvm_controlErr; switch (get_vm_word(p + ExtnDat_commnd)) { case kCmndVersion: put_vm_word(p + ExtnDat_version, 1); result = mnvm_noErr; break; case kCmndHTCEFeatures: put_vm_long(p + ExtnDat_params + 0, 0); result = mnvm_noErr; break; case kCmndHTCEExport: { tPbuf Pbuf_No = get_vm_word(p + ExtnDat_params + 0); result = CheckPbuf(Pbuf_No); if (mnvm_noErr == result) { result = HTCEexport(Pbuf_No); } } break; case kCmndHTCEImport: { tPbuf Pbuf_No; result = HTCEimport(&Pbuf_No); put_vm_word(p + ExtnDat_params + 0, Pbuf_No); } break; } put_vm_word(p + ExtnDat_result, result);}#endif #define kFindExtnExtension 0x64E1F58A#define kDiskDriverExtension 0x4C9219E6#if IncludeExtnPbufs#define kHostParamBuffersExtension 0x314C87BF#endif#if IncludeExtnHostTextClipExchange#define kHostClipExchangeExtension 0x27B130CA#endif #define kCmndFindExtnFind 1#define kCmndFindExtnId2Code 2#define kCmndFindExtnCount 3 #define kParamFindExtnTheExtn 8#define kParamFindExtnTheId 12 LOCALPROC ExtnFind_Access(CPTR p){ tMacErr result = mnvm_controlErr; switch (get_vm_word(p + ExtnDat_commnd)) { case kCmndVersion: put_vm_word(p + ExtnDat_version, 1); result = mnvm_noErr; break; case kCmndFindExtnFind: { ui5b extn = get_vm_long(p + kParamFindExtnTheExtn); if (extn == kDiskDriverExtension) { put_vm_word(p + kParamFindExtnTheId, kExtnDisk); result = mnvm_noErr; } else#if IncludeExtnPbufs if (extn == kHostParamBuffersExtension) { put_vm_word(p + kParamFindExtnTheId, kExtnParamBuffers); result = mnvm_noErr; } else#endif#if IncludeExtnHostTextClipExchangeLines 1–500 of 1762. Load more
/* GLOBGLUE.c Copyright (C) 2003 Bernd Schmidt, Philip Cummins, Paul C. Pratt You can redistribute this file and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. You should have received a copy of the license along with this file; see the file COPYING. This file 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 license for more details. */ /* GLOBal GLUE (or GLOB of GLUE) Holds the program together. Some code here adapted from "custom.c" in vMac by Philip Cummins, in turn descended from code in the Un*x Amiga Emulator by Bernd Schmidt. */ #ifndef AllFiles #include "SYSDEPNS.h" #include "MYOSGLUE.h" #include "ENDIANAC.h" #include "EMCONFIG.h" #endif #include "GLOBGLUE.h" /* ReportAbnormalID unused 0x111D - 0x11FF */ /* ReportAbnormalID ranges unused 0x12xx - 0xFFxx */ IMPORTPROC m68k_reset(void); IMPORTPROC IWM_Reset(void); IMPORTPROC SCC_Reset(void); IMPORTPROC SCSI_Reset(void); IMPORTPROC VIA1_Reset(void); #if EmVIA2 IMPORTPROC VIA2_Reset(void); #endif IMPORTPROC Sony_Reset(void); IMPORTPROC ExtnDisk_Access(CPTR p); IMPORTPROC ExtnSony_Access(CPTR p); #if EmVidCard IMPORTPROC ExtnVideo_Access(CPTR p); #endif IMPORTPROC Sony_SetQuitOnEject(void); IMPORTPROC m68k_IPLchangeNtfy(void); IMPORTPROC MINEM68K_Init( ui3b *fIPL); IMPORTFUNC si5r GetCyclesRemaining(void); IMPORTPROC SetCyclesRemaining(si5r n); IMPORTPROC SetHeadATTel(ATTep p); IMPORTFUNC ATTep FindATTel(CPTR addr); IMPORTFUNC ui5b SCSI_Access(ui5b Data, blnr WriteMem, CPTR addr); IMPORTFUNC ui5b SCC_Access(ui5b Data, blnr WriteMem, CPTR addr); IMPORTFUNC ui5b IWM_Access(ui5b Data, blnr WriteMem, CPTR addr); IMPORTFUNC ui5b VIA1_Access(ui5b Data, blnr WriteMem, CPTR addr); #if EmVIA2 IMPORTFUNC ui5b VIA2_Access(ui5b Data, blnr WriteMem, CPTR addr); #endif #if EmASC IMPORTFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr); #endif IMPORTFUNC ui3r get_vm_byte(CPTR addr); IMPORTFUNC ui4r get_vm_word(CPTR addr); IMPORTFUNC ui5r get_vm_long(CPTR addr); IMPORTPROC put_vm_byte(CPTR addr, ui3r b); IMPORTPROC put_vm_word(CPTR addr, ui4r w); IMPORTPROC put_vm_long(CPTR addr, ui5r l); GLOBALVAR ui5r my_disk_icon_addr; GLOBALPROC customreset(void) { IWM_Reset(); SCC_Reset(); SCSI_Reset(); VIA1_Reset(); #if EmVIA2 VIA2_Reset(); #endif Sony_Reset(); Extn_Reset(); #if CurEmMd <= kEmMd_Plus WantMacReset = trueblnr; /* kludge, code in Finder appears to do RESET and not expect to come back. Maybe asserting the RESET somehow causes other hardware compenents to later reset the 68000. */ #endif } GLOBALVAR ui3p RAM = nullpr; #if EmVidCard GLOBALVAR ui3p VidROM = nullpr; #endif #if IncludeVidMem GLOBALVAR ui3p VidMem = nullpr; #endif GLOBALVAR ui3b Wires[kNumWires]; #if WantDisasm IMPORTPROC m68k_WantDisasmContext(void); #endif #if WantDisasm GLOBALPROC dbglog_StartLine(void) { m68k_WantDisasmContext(); dbglog_writeCStr(" "); } #endif #if dbglog_HAVE GLOBALPROC dbglog_WriteMemArrow(blnr WriteMem) { if (WriteMem) { dbglog_writeCStr(" <- "); } else { dbglog_writeCStr(" -> "); } } #endif #if dbglog_HAVE GLOBALPROC dbglog_AddrAccess(char *s, ui5r Data, blnr WriteMem, ui5r addr) { dbglog_StartLine(); dbglog_writeCStr(s); dbglog_writeCStr("["); dbglog_writeHex(addr); dbglog_writeCStr("]"); dbglog_WriteMemArrow(WriteMem); dbglog_writeHex(Data); dbglog_writeReturn(); } #endif #if dbglog_HAVE GLOBALPROC dbglog_Access(char *s, ui5r Data, blnr WriteMem) { dbglog_StartLine(); dbglog_writeCStr(s); dbglog_WriteMemArrow(WriteMem); dbglog_writeHex(Data); dbglog_writeReturn(); } #endif #if dbglog_HAVE GLOBALPROC dbglog_WriteNote(char *s) { dbglog_StartLine(); dbglog_writeCStr(s); dbglog_writeReturn(); } #endif #if dbglog_HAVE GLOBALPROC dbglog_WriteSetBool(char *s, blnr v) { dbglog_StartLine(); dbglog_writeCStr(s); dbglog_writeCStr(" <- "); if (v) { dbglog_writeCStr("1"); } else { dbglog_writeCStr("0"); } dbglog_writeReturn(); } #endif #if WantAbnormalReports LOCALVAR blnr GotOneAbnormal = falseblnr; #endif #ifndef ReportAbnormalInterrupt #define ReportAbnormalInterrupt 0 #endif #if WantAbnormalReports GLOBALPROC DoReportAbnormalID(ui4r id #if dbglog_HAVE , char *s #endif ) { #if dbglog_HAVE dbglog_StartLine(); dbglog_writeCStr("*** abnormal : "); dbglog_writeCStr(s); dbglog_writeReturn(); #endif if (! GotOneAbnormal) { WarnMsgAbnormalID(id); #if ReportAbnormalInterrupt SetInterruptButton(trueblnr); #endif GotOneAbnormal = trueblnr; } } #endif /* map of address space */ #define kRAM_Base 0x00000000 /* when overlay off */ #if (CurEmMd == kEmMd_PB100) #define kRAM_ln2Spc 23 #elif (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx) #define kRAM_ln2Spc 23 #else #define kRAM_ln2Spc 22 #endif #if IncludeVidMem #if CurEmMd == kEmMd_PB100 #define kVidMem_Base 0x00FA0000 #define kVidMem_ln2Spc 16 #else #define kVidMem_Base 0x00540000 #define kVidMem_ln2Spc 18 #endif #endif #if CurEmMd == kEmMd_PB100 #define kSCSI_Block_Base 0x00F90000 #define kSCSI_ln2Spc 16 #else #define kSCSI_Block_Base 0x00580000 #define kSCSI_ln2Spc 19 #endif #define kRAM_Overlay_Base 0x00600000 /* when overlay on */ #define kRAM_Overlay_Top 0x00800000 #if CurEmMd == kEmMd_PB100 #define kSCCRd_Block_Base 0x00FD0000 #define kSCC_ln2Spc 16 #else #define kSCCRd_Block_Base 0x00800000 #define kSCC_ln2Spc 22 #endif #if CurEmMd != kEmMd_PB100 #define kSCCWr_Block_Base 0x00A00000 #define kSCCWr_Block_Top 0x00C00000 #endif #if CurEmMd == kEmMd_PB100 #define kIWM_Block_Base 0x00F60000 #define kIWM_ln2Spc 16 #else #define kIWM_Block_Base 0x00C00000 #define kIWM_ln2Spc 21 #endif #if CurEmMd == kEmMd_PB100 #define kVIA1_Block_Base 0x00F70000 #define kVIA1_ln2Spc 16 #else #define kVIA1_Block_Base 0x00E80000 #define kVIA1_ln2Spc 19 #endif #if CurEmMd == kEmMd_PB100 #define kASC_Block_Base 0x00FB0000 #define kASC_ln2Spc 16 #endif #define kASC_Mask 0x00000FFF #if IncludeExtnPbufs LOCALFUNC tMacErr PbufTransferVM(CPTR Buffera, tPbuf i, ui5r offset, ui5r count, blnr IsWrite) { tMacErr result; ui5b contig; ui3p Buffer; label_1: if (0 == count) { result = mnvm_noErr; } else { Buffer = get_real_address0(count, ! IsWrite, Buffera, &contig); if (0 == contig) { result = mnvm_miscErr; } else { PbufTransfer(Buffer, i, offset, contig, IsWrite); offset += contig; Buffera += contig; count -= contig; goto label_1; } } return result; } #endif /* extension mechanism */ #if IncludeExtnPbufs #define kCmndPbufFeatures 1 #define kCmndPbufNew 2 #define kCmndPbufDispose 3 #define kCmndPbufGetSize 4 #define kCmndPbufTransfer 5 #endif #if IncludeExtnPbufs LOCALPROC ExtnParamBuffers_Access(CPTR p) { tMacErr result = mnvm_controlErr; switch (get_vm_word(p + ExtnDat_commnd)) { case kCmndVersion: put_vm_word(p + ExtnDat_version, 1); result = mnvm_noErr; break; case kCmndPbufFeatures: put_vm_long(p + ExtnDat_params + 0, 0); result = mnvm_noErr; break; case kCmndPbufNew: { tPbuf Pbuf_No; ui5b count = get_vm_long(p + ExtnDat_params + 4); /* reserved word at offset 2, should be zero */ result = PbufNew(count, &Pbuf_No); put_vm_word(p + ExtnDat_params + 0, Pbuf_No); } break; case kCmndPbufDispose: { tPbuf Pbuf_No = get_vm_word(p + ExtnDat_params + 0); /* reserved word at offset 2, should be zero */ result = CheckPbuf(Pbuf_No); if (mnvm_noErr == result) { PbufDispose(Pbuf_No); } } break; case kCmndPbufGetSize: { ui5r Count; tPbuf Pbuf_No = get_vm_word(p + ExtnDat_params + 0); /* reserved word at offset 2, should be zero */ result = PbufGetSize(Pbuf_No, &Count); if (mnvm_noErr == result) { put_vm_long(p + ExtnDat_params + 4, Count); } } break; case kCmndPbufTransfer: { ui5r PbufCount; tPbuf Pbuf_No = get_vm_word(p + ExtnDat_params + 0); /* reserved word at offset 2, should be zero */ ui5r offset = get_vm_long(p + ExtnDat_params + 4); ui5r count = get_vm_long(p + ExtnDat_params + 8); CPTR Buffera = get_vm_long(p + ExtnDat_params + 12); blnr IsWrite = (get_vm_word(p + ExtnDat_params + 16) != 0); result = PbufGetSize(Pbuf_No, &PbufCount); if (mnvm_noErr == result) { ui5r endoff = offset + count; if ((endoff < offset) /* overflow */ || (endoff > PbufCount)) { result = mnvm_eofErr; } else { result = PbufTransferVM(Buffera, Pbuf_No, offset, count, IsWrite); } } } break; } put_vm_word(p + ExtnDat_result, result); } #endif #if IncludeExtnHostTextClipExchange #define kCmndHTCEFeatures 1 #define kCmndHTCEExport 2 #define kCmndHTCEImport 3 #endif #if IncludeExtnHostTextClipExchange LOCALPROC ExtnHostTextClipExchange_Access(CPTR p) { tMacErr result = mnvm_controlErr; switch (get_vm_word(p + ExtnDat_commnd)) { case kCmndVersion: put_vm_word(p + ExtnDat_version, 1); result = mnvm_noErr; break; case kCmndHTCEFeatures: put_vm_long(p + ExtnDat_params + 0, 0); result = mnvm_noErr; break; case kCmndHTCEExport: { tPbuf Pbuf_No = get_vm_word(p + ExtnDat_params + 0); result = CheckPbuf(Pbuf_No); if (mnvm_noErr == result) { result = HTCEexport(Pbuf_No); } } break; case kCmndHTCEImport: { tPbuf Pbuf_No; result = HTCEimport(&Pbuf_No); put_vm_word(p + ExtnDat_params + 0, Pbuf_No); } break; } put_vm_word(p + ExtnDat_result, result); } #endif #define kFindExtnExtension 0x64E1F58A #define kDiskDriverExtension 0x4C9219E6 #if IncludeExtnPbufs #define kHostParamBuffersExtension 0x314C87BF #endif #if IncludeExtnHostTextClipExchange #define kHostClipExchangeExtension 0x27B130CA #endif #define kCmndFindExtnFind 1 #define kCmndFindExtnId2Code 2 #define kCmndFindExtnCount 3 #define kParamFindExtnTheExtn 8 #define kParamFindExtnTheId 12 LOCALPROC ExtnFind_Access(CPTR p) { tMacErr result = mnvm_controlErr; switch (get_vm_word(p + ExtnDat_commnd)) { case kCmndVersion: put_vm_word(p + ExtnDat_version, 1); result = mnvm_noErr; break; case kCmndFindExtnFind: { ui5b extn = get_vm_long(p + kParamFindExtnTheExtn); if (extn == kDiskDriverExtension) { put_vm_word(p + kParamFindExtnTheId, kExtnDisk); result = mnvm_noErr; } else #if IncludeExtnPbufs if (extn == kHostParamBuffersExtension) { put_vm_word(p + kParamFindExtnTheId, kExtnParamBuffers); result = mnvm_noErr; } else #endif #if IncludeExtnHostTextClipExchange