From 700f95c776ce6cf4ea4d4e4a9c8372bf48aad114 Mon Sep 17 00:00:00 2001 From: Zane Kaminski Date: Wed, 31 Mar 2021 19:10:47 -0400 Subject: [PATCH] New debug/CD disable strategy --- bin/driver7M5.bin | Bin 1925 -> 1891 bytes bin/rom8M.bin | Bin 8388608 -> 8388608 bytes rdisk.c | 28 ++++++++++++---------------- rdisk.h | 2 -- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/bin/driver7M5.bin b/bin/driver7M5.bin index d2e0363c4105fcedd64c5adcd26bda43c4d2a1c4..3ba5646e7294e9f4cc3836a48c0a80c713bfc92b 100755 GIT binary patch delta 793 zcmZ8eL1+^}6n(S1#aKd(VN*&%>#(FTrX?v@Xeb^wF_i66gB6M%L{^2Y)*wr0B|w(65rs@DGoFA5muij6v%aTkQrz5S>UT0XLFJS)*FLglA#dW&F||A z{ZGy6<)%?GnyFG!F{zH9t{7zaZD3zajP|e4$fi*?HdAGvj-W4rLGw9yn`S&Rw%(TP zxeLGag#p!!yBkE@Se}rA#lcB%CvWJypf3XTXfgunQ~@aj9M;y>X2Ey1h2wPXZ*Aph z%~b5W#F9-pGwZyW+P&I$Whp)Hp&eYHEL>^~0SkxSy`Y^WsxjLuYGTuSMV4m{qjpbH zvVJ6G>w8WhK3G7B*ez>X>)tk)u2J`zDcjz$0&37khM+*_7}KGcWWvVbLmmMSofGSr zC0h!C-+|}TqBaDNyNo=LrC7tm2)ZlC7X`$DXnv@4+SvCFy*sarVMdjQq;q1urUV#!x!&m7VSfNPl+@t> delta 807 zcma))F=!J}7{~wb?y3<&O-o3M+VVKkBsL{2NJ}UV*Vy5Dl+q5xPI9JjXKRKdG$leL zcalN|u_*x&>5#!eu|sJmC)466QmTks3l`iI#KA!uzn8S)=y3P$|9#*8eZTj;``o#D zu{wM0>(rr)>Ae00joV;Jp-i={lu@DlcffGT>O8CID6f~-SiBZw_e-g`9+~8e2yXoX zY)Hq^nVtmtEU;VQBH8-Jzaf-U9Hwi-tUgOBo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m&iTlJYmcEc&yzk7X|38!bm{vWhGWXY0{oJ|N&9AgvqYRUlnc0-` zmB$o?&1&JGJIBne06p!_{K#`S^E1yKOKVJTv!-2IGBcwp zandmd$F`T^I2<^5(6I-G>DcikbUZpvr#g-^9@+yl-gL%kXFO=}y8#@J9zNMT`@YY< zzxUmBUDt3u6|JIId==xOe>t}Aw}ERu8Jx0zm8B!1rMxO*u2n{tR|SuXCfl>yHs<&% zvo~V?Gg|X(rO|(?)ZJ{y`_;IF7yc5-iN2B;YG{?ltZ0X$MLHXMf0xLlQP6CwLz_QH z6`k~NR8F@xl^0nGcWWnfU9?EMM0B4RS&{4Nq;)#>iF5YQlI_|{eQw%ty!+n;+Qlc4 zoXBNwMptZ(Da&@*UhXSLEr~~aC6R8GCM2CNMXj~lAJ~__b#s=}9bBaK>k;2~iUg`l)KRNGMpA8IinbBh76R4_4MI#~Zs^`FFIZzD+g< zHPJb&3ua!_`kp^3DMKBYPdUdVp6ysWT@~`07u``+d&mWeFS=u4@Bi7dqSf@?!RK}7 z0zy|}y=(4&b$#J=DV}5!_DZ?Ql2T}IuQaEvjNJNEZJ8f7EicgE+NsFu1etx=>zsq0 zEwc9+FF-B(kTOhy|2HyYL>;Zgzgi{qrrO8WR0}+3)_Dsrlt*3fdZoHh9+TDSRBcL< z7m`1f-Pn#D*ohb#u?q^jVPX&BXhH%>G-EGX(26$PgB04) zfqQWu_TheXq6-h88xNuf4`DwZ#v^zX7J8A!0rcT9JdP(|qaO~Q!~mYcAfCn$4&oU+ zi{~(m=Wz%lcmXfsCA^GRa2T&5gCiKl7+%Bc$RdZM7{>&TA&)okCXSdbgEN = dbgEN; c->cdromEN = cdromEN; - // Clear debug and CD-ROM overwrite flags - c->dbgOverwrite = 0; - c->cdromOverwrite = 0; // If RAM disk enabled, try to allocate RAM disk buffer if not already if (ramEN & !c->ramdisk) { @@ -158,6 +155,14 @@ static void RDInit(IOParamPtr p, DCtlPtr d, RDiskStorage_t *c) { // That's not the worst, since the system would just crash, // but it would be better to switch to read-only status } + // Patch debug and CD-ROM enable bytes + char dis = 0x44; + //if (!c->dbgEN) { + copy24(&dis/*RDiskDBGDisByte*/, &c->ramdisk[*RDiskDBGDisPos], 1); + //} + //if (!c->cdromEN) { + copy24(&dis/*RDiskCDROMDisByte*/, &c->ramdisk[*RDiskCDROMDisPos], 1); + //} } // Unmount if not booting from ROM disk @@ -200,15 +205,15 @@ OSErr RDPrime(IOParamPtr p, DCtlPtr d) { if (*MMU32bit) { BlockMove(disk, p->ioBuffer, p->ioReqCount); } else { copy24(disk, StripAddress(p->ioBuffer), p->ioReqCount); } - if (!c->dbgEN && !c->dbgOverwrite && + if (/*!c->dbgEN && */!c->ramdisk && *RDiskDBGDisPos >= d->dCtlPosition && *RDiskDBGDisPos < d->dCtlPosition + p->ioReqCount) { - p->ioBuffer[*RDiskDBGDisPos - d->dCtlPosition] = *RDiskDBGDisByte; + p->ioBuffer[*RDiskDBGDisPos - d->dCtlPosition] = 0x44;//*RDiskDBGDisByte; } - if (!c->cdromEN && !c->cdromOverwrite && + if (/*!c->cdromEN && */!c->ramdisk && *RDiskCDROMDisPos >= d->dCtlPosition && *RDiskCDROMDisPos < d->dCtlPosition + p->ioReqCount) { - p->ioBuffer[*RDiskCDROMDisPos - d->dCtlPosition] = *RDiskCDROMDisByte; + p->ioBuffer[*RDiskCDROMDisPos - d->dCtlPosition] = 0x44;//*RDiskCDROMDisByte; } } else if (cmd == aWrCmd) { // Write // Fail if write protected or RAM disk buffer not set up @@ -216,15 +221,6 @@ OSErr RDPrime(IOParamPtr p, DCtlPtr d) { // Write from buffer into disk. if (*MMU32bit) { BlockMove(p->ioBuffer, disk, p->ioReqCount); } else { copy24(StripAddress(p->ioBuffer), disk, p->ioReqCount); } - - if (*RDiskDBGDisPos >= d->dCtlPosition && - *RDiskDBGDisPos < d->dCtlPosition + p->ioReqCount) { - c->dbgOverwrite = 1; - } - if (*RDiskCDROMDisPos >= d->dCtlPosition && - *RDiskCDROMDisPos < d->dCtlPosition + p->ioReqCount) { - c->cdromOverwrite = 1; - } } else { return noErr; } //FIXME: Fail if cmd isn't read or write? // Update count and position/offset, then return diff --git a/rdisk.h b/rdisk.h index 988d2db..e947293 100644 --- a/rdisk.h +++ b/rdisk.h @@ -29,9 +29,7 @@ typedef struct RDiskStorage_s { char initialized; Ptr ramdisk; char dbgEN; - char dbgOverwrite; char cdromEN; - char cdromOverwrite; #ifdef RDISK_COMPRESS_ICON_ENABLE char icon[RDISK_ICON_SIZE]; #endif