Remove floppy disk hack

I don't want it and I have more pressing concerns at the moment
This commit is contained in:
InvisibleUp 2023-04-01 17:44:25 -07:00
parent 33d075812a
commit 30ded064a5
12 changed files with 10 additions and 1801 deletions

View File

@ -282,20 +282,6 @@ void put_vm_long(uint32_t addr, uint32_t l) {
m68k_write_memory_32(addr, l);
}
void DiskInsertedPsuedoException(CPTR newpc, uint32_t data)
{
/*uint sr;
sr = m68ki_init_exception();
m68ki_stack_frame_0000(REG_PPC, sr, EXCEPTION_1010);
m68ki_jump_vector(newpc);
// push data onto... something?
m68k_set_reg(M68K_REG_A7, m68k_get_reg(NULL, M68K_REG_A7) - 4);
m68k_write_memory_32(m68k_get_reg(NULL, M68K_REG_A7), data);*/
return;
}
// purely for debugging purposes
void m68k_instruction_hook(uint32_t pc)
{

View File

@ -69,8 +69,6 @@ WIN_RSRC = windows.compile_resources(
'rsrc/WIN32/ICONAPPW.ico',
'rsrc/WIN32/ICONDSKW.ico',
'rsrc/WIN32/ICONROMW.ico',
'rsrc/SONYDRV.bin',
'rsrc/SONYICO.bin',
]
)
@ -82,8 +80,6 @@ HW_SRC = {
],
'DISK': [
'src/HW/DISK/IWMEMDEV.c',
'src/HW/DISK/SONYEMDV.c',
'src/PATCHES/SONYDRV.c'
],
'KBRD': [
'src/HW/KBRD/KBRDEMDV.c',

Binary file not shown.

Binary file not shown.

View File

@ -10,10 +10,6 @@ ICO_APP ICON DISCARDABLE "ICONAPPW.ico"
ICO_DSK ICON DISCARDABLE "ICONDSKW.ico"
ICO_ROM ICON DISCARDABLE "ICONROMW.ico"
// Binary data
SONY_DRV RCDATA "../SONYDRV.bin"
SONY_ICO RCDATA "../SONYICO.bin"
// Version information
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,37,0,0

View File

@ -109,7 +109,7 @@ GLOBALPROC customreset(void)
//SCC_Reset();
SCSI_Reset();
VIA_Reset();
Sony_Reset();
//Sony_Reset();
Extn_Reset();
#if CurEmMd <= kEmMd_Plus
WantMacReset = true;
@ -531,10 +531,10 @@ LOCALPROC Extn_Access(uint32_t Data, CPTR addr)
break;
#endif
case kExtnDisk:
ExtnDisk_Access(p);
//ExtnDisk_Access(p);
break;
case kExtnSony:
ExtnSony_Access(p);
//ExtnSony_Access(p);
break;
default:
put_vm_word(p + ExtnDat_result,
@ -546,7 +546,7 @@ LOCALPROC Extn_Access(uint32_t Data, CPTR addr)
break;
case kDSK_QuitOnEject:
/* obsolete, kept for compatibility */
Sony_SetQuitOnEject();
//Sony_SetQuitOnEject();
break;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
#else
#define SONYEMDV_H
#endif
/*
EXPORTPROC ExtnDisk_Access(CPTR p);
EXPORTPROC ExtnSony_Access(CPTR p);
@ -29,3 +29,4 @@ EXPORTPROC Sony_EjectAllDisks(void);
EXPORTPROC Sony_Reset(void);
EXPORTPROC Sony_Update(void);
*/

View File

@ -32,7 +32,6 @@
#include "UTIL/ENDIANAC.h"
#include "PATCHES/ROMEMDEV.h"
#include "PATCHES/SCRNHACK.h"
#include "PATCHES/SONYDRV.h"
#ifdef CurAltHappyMac
#include "HPMCHACK.h"
#endif

View File

@ -1,98 +0,0 @@
/*
Replacement for .Sony driver
68k machine code, compiled from mydriver.a
Included in the resource file for WIN32 builds
*/
#include <stdint.h>
#include <string.h>
#include "incbin/incbin.h"
#ifdef _MSC_VER
#include <Windows.h>
#endif
#include "EMCONFIG.h"
#include "GLOBGLUE.h"
#include "UTIL/ENDIANAC.h"
#include "UI/MYOSGLUE.h"
#include "PATCHES/SONYDRV.h"
#include "PATCHES/ROMEMDEV.h"
//#include "PATCHES/SCRNHACK.h"
// temporary screenhack stuff
#include "HW/SCREEN/SCRNEMDV.h"
// Include binaries
#ifndef _MSC_VER
INCBIN(SonyDriver, "rsrc/SONYDRV.bin");
INCBIN(SonyIcon, "rsrc/SONYICO.bin");
#endif
void Sony_LoadDriver(uint8_t *pto, int *size)
{
#ifdef _MSC_VER
HRSRC hDrvInfo = FindResource(NULL, "SONY_DRV", RT_RCDATA);
HGLOBAL hDrv = LoadResource(NULL, hDrvInfo);
DWORD sDrv = SizeofResource(NULL, hDrvInfo);
void *pDrv = LockResource(hDrv);
memcpy(pto, pDrv, sDrv);
*size = sDrv;
#else
memcpy(pto, gSonyDriverData, gSonyDriverSize);
*size = gSonyDriverSize;
#endif
}
void Sony_LoadIcon(uint8_t *pto, int *icoSize)
{
disk_icon_addr = (pto - ROM) + kROM_Base;
#ifdef _MSC_VER
HRSRC hIcoInfo = FindResource(NULL, "SONY_ICO", RT_RCDATA);
HGLOBAL hIco = LoadResource(NULL, hIcoInfo);
DWORD sIco = SizeofResource(NULL, hIcoInfo);
void *pIco = LockResource(hIco);
memcpy(pto, pIco, sIco);
pto += sizeof(sIco);
#else
memcpy(pto, gSonyIconData, gSonyIconSize);
*icoSize = gSonyIconSize;
#endif
}
void Sony_TwiggyPatch(uint8_t *pto)
{
if (CurEmMd == kEmMd_Twiggy || CurEmMd == kEmMd_Twig43) {
/* 'Disk' instead of 'Sony' */
do_put_mem_long(pto + 0x14, 0x4469736B);
if (CurEmMd == kEmMd_Twig43) {
do_put_mem_word(pto + 0xEA, 0x0C8A);
} else {
do_put_mem_word(pto + 0xEA, 0x0B74);
}
}
}
void Sony_CallPatch(uint8_t *pto, int drvSize)
{
do_put_mem_word(pto, kcom_callcheck);
do_put_mem_word(pto+2, kExtnSony);
do_put_mem_long(pto+4, kExtn_Block_Base); /* pokeaddr */
}
void Sony_Install(void)
{
uint8_t * pto = Sony_DriverBase + ROM;
int drvSize, icoSize;
if (!UseSonyPatch) { return; }
Sony_LoadDriver(pto, &drvSize);
Sony_TwiggyPatch(pto);
pto += drvSize;
Sony_CallPatch(pto, drvSize);
pto += 8;
Sony_LoadIcon(pto, &icoSize);
pto += icoSize;
// currently broken
//ScreenHack_Install(&pto);
}

View File

@ -1,19 +0,0 @@
#define UseSonyPatch \
((CurEmMd <= kEmMd_Classic) || (CurEmMd == kEmMd_II) \
|| (CurEmMd == kEmMd_IIx))
#if CurEmMd <= kEmMd_Twig43
#define Sony_DriverBase 0x1836
#elif CurEmMd <= kEmMd_Twiggy
#define Sony_DriverBase 0x16E4
#elif CurEmMd <= kEmMd_128K
#define Sony_DriverBase 0x1690
#elif CurEmMd <= kEmMd_Plus
#define Sony_DriverBase 0x17D30
#elif CurEmMd <= kEmMd_Classic
#define Sony_DriverBase 0x34680
#elif (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx)
#define Sony_DriverBase 0x2D72C
#endif
void Sony_Install();

View File

@ -133,8 +133,8 @@ const DevMethods_t DEVICES[] = {
// Sony disk drive
{
.init = NULL,
.reset = Sony_Reset,
.starttick = Sony_Update,
.reset = NULL,
.starttick = NULL,
.endtick = NULL,
.subtick = NULL,
.timebegin = NULL,
@ -251,7 +251,7 @@ LOCALPROC EmulatedHardwareZap(void)
LOCALPROC DoMacReset(void)
{
Sony_EjectAllDisks();
//Sony_EjectAllDisks();
EmulatedHardwareZap();
}
@ -325,7 +325,7 @@ LOCALPROC SixtiethSecondNotify(void)
//if (EmADB) { ADB_Update(); }
Screen_RaiseVBlank();
Sony_Update();
//Sony_Update();
#if EmLocalTalk
LocalTalkTick();