Add bbraun/bmow romdrv source for perusal

This commit is contained in:
Elliot Nunn 2020-12-01 10:38:20 +08:00
parent f0ddddcef9
commit bd32694280
20 changed files with 36 additions and 0 deletions

0
TheIcon Normal file
View File

30
TheIcon.rdump Normal file
View File

@ -0,0 +1,30 @@
data 'ICN#' (128) {
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
$"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" /* ................ */
$"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" /* ................ */
$"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" /* ................ */
$"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" /* ................ */
$"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" /* ................ */
$"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" /* ................ */
$"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" /* ................ */
$"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF" /* ................ */
};
data 'ICON' (128) {
$"7FFF FFFE 8000 0001 8000 0001 8000 0001" /* ................ */
$"8000 0001 8000 0001 8C00 0001 8000 2801" /* ..............(. */
$"8000 2801 7FFF 7DFE 0000 4400 0000 4400" /* ..(...}...D...D. */
$"0000 7C00 0000 5400 BFFF 93FD 0000 2800" /* ..|...T.......(. */
$"BFFF C7FD 0000 0000 0000 0000 0000 0000" /* ................ */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
};

0
romdrv 0.9.6/CDEV.rsrc Normal file
View File

0
romdrv 0.9.6/ROMDisk Normal file
View File

0
romdrv 0.9.6/RomDiskCP Normal file
View File

BIN
romdrv 0.9.6/RomDiskCP.SYM Normal file

Binary file not shown.

1
romdrv 0.9.6/RomDiskCP.c Normal file
View File

@ -0,0 +1 @@
#include <A4Stuff.h> #include <Devices.h> #define kOnButton 2 #define kOffButton 3 #define kRAMButton 6 #define kROMButton 7 #pragma parameter __D0 ReadXPRam(__D0, __D1, __A0) short ReadXPRam(short size, short offset, char *where) = {0x4840, 0x3001, _ReadXPRam}; #pragma parameter __D0 WriteXPRam(__D0, __D1, __A0) short WriteXPRam(short size, short offset, char *where) = {0x4840, 0x3001, _WriteXPRam}; void updateDisplay(DialogPtr d, short numItems, char startup, char ram, char grayed); void updateDisplay(DialogPtr d, short numItems, char startup, char ram, char grayed) { GrafPtr savePort; Handle h; Rect r; short type; GetPort(&savePort); SetPort(d); GetDItem(d, kOnButton+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, startup); GetDItem(d, kOffButton+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, !startup); GetDItem(d, kRAMButton+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, ram); GetDItem(d, kROMButton+numItems, &type, &h, &r); SetCtlValue((ControlHandle)h, !ram); SetPort(savePort); return; } pascal long main(short message,short item,short numItems,short /*privateValue*/, EventRecord *e, void *cdev, DialogPtr d) { EnterCodeResource(); long result; Handle h; Rect r; short type; GrafPtr savePort; unsigned char **via1ptr = (unsigned char**)0x01D4; unsigned char data, dir; char startup = 0; char ram = 0; result = (long)cdev; switch (message) { case initDev: cdev = (Handle)cdevUnset; ReadXPRam(1, 4, &startup); ReadXPRam(1, 5, &ram); result = (long)cdev; break; case closeDev: cdev = (Handle)cdevUnset; result = cdevUnset; break; case macDev: result = 1L; break; case updateDev: case activDev: ReadXPRam(1, 4, &startup); ReadXPRam(1, 5, &ram); updateDisplay(d, numItems, startup, ram, 0); break; case deactivDev: ReadXPRam(1, 4, &startup); ReadXPRam(1, 5, &ram); updateDisplay(d, numItems, startup, ram, 1); break; case hitDev: ReadXPRam(1, 4, &startup); ReadXPRam(1, 5, &ram); switch(item-numItems) { case kOnButton: startup = 1; break; case kOffButton: startup = 0; break; case kRAMButton: ram = 1; break; case kROMButton: ram = 0; break; default: break; }; updateDisplay(d, numItems, startup, ram, 0); WriteXPRam(1, 4, &startup); WriteXPRam(1, 5, &ram); break; default: break; }; ExitCodeResource(); return result; }

BIN
romdrv 0.9.6/RomDiskCP.proj Normal file

Binary file not shown.

0
romdrv 0.9.6/netBOOT Normal file
View File

BIN
romdrv 0.9.6/romdrv Normal file

Binary file not shown.

BIN
romdrv 0.9.6/romdrv inrom Normal file

Binary file not shown.

1
romdrv 0.9.6/romdrv.c Normal file

File diff suppressed because one or more lines are too long

BIN
romdrv 0.9.6/romdrvinit Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
#include <Files.h> #include <Types.h> #include <Events.h> #include <Memory.h> #include <Resources.h> #include <Errors.h> #include <Devices.h> #include <SetUpA4.h> #include <A4Stuff.h> /* Name of driver to load */ #define kDrvrName "\p.Romdrv" #define UTableBase (*(DCtlHandle**) 0x11C) #define UnitNtryCnt (*(short*) 0x1D2) struct Driver { short drvrFlags; short drvrDelay; short drvrEMask; short drvrMenu; short drvrOpen; short drvrPrime; short drvrCtl; short drvrStatus; short drvrClose; Str255 drvrName; }; short MyFindSpaceInUnitTable(void); OSErr MyOpenDriver(void); /* Stolen nearly verbatim from IM: Devices */ short MyFindSpaceInUnitTable(void) { Ptr curUTableBase, newUTableBase; short curUTableEntries, newUTableEntries; short refNum, unitNum; long *entryarray; /* get current unit table values from low memory globals */ curUTableEntries = UnitNtryCnt; curUTableBase = (Ptr)UTableBase; entryarray = (long*)UTableBase; /* search for empty space in the current unit table */ for(unitNum = curUTableEntries-1; unitNum >= 48; unitNum--) { if(entryarray[unitNum] == 0) { return unitNum; } } /* no space in the current table, so make a new one */ /* increase the size of the table by 16 (an arbitrary value) */ newUTableEntries = curUTableEntries + 16; /* allocate space for the new table */ newUTableBase = NewPtrSysClear((long)newUTableEntries * sizeof(Handle)); if(newUTableBase == nil) return dsMemFullErr; /* copy the old table to the new table */ BlockMove(curUTableBase, newUTableBase, (long)curUTableEntries * sizeof(Handle)); /* set the new unit table values in low memory */ UTableBase = (void*)newUTableBase; UnitNtryCnt = newUTableEntries; unitNum = newUTableEntries - 1; return unitNum; } /* Stolen from IM: Devices */ OSErr MyOpenDriver(void) { Handle drvrHdl; short drvrID; short tempDrvrID; ResType drvrType; Str255 drvrName; OSErr myErr = noErr; struct IOParam pb; char hackname[8]; struct Driver *drvrPtr; DCtlHandle entryHdl; hackname[0] = 7; hackname[1] = '.'; hackname[2] = 'R'; hackname[3] = 'o'; hackname[4] = 'm'; hackname[5] = 'd'; hackname[6] = 'r'; hackname[7] = 'v'; tempDrvrID = MyFindSpaceInUnitTable(); if(tempDrvrID > 0) { drvrHdl = GetResource((ResType)'DRVR', 192); if(!drvrHdl) { //DebugStr("\pCould not get named resource"); return openErr; } GetResInfo(drvrHdl, &drvrID, &drvrType, drvrName); SetResInfo(drvrHdl, tempDrvrID, drvrName); LoadResource(drvrHdl); DetachResource(drvrHdl); entryHdl = (DCtlHandle)NewHandleSysClear(40); drvrPtr = *(struct Driver **)drvrHdl; drvrPtr->drvrFlags |= dRAMBased | dCtlEnable | dNeedTime | dNeedLock | dReadEnable | dStatEnable; drvrPtr->drvrDelay = 0x300; (*entryHdl)->dCtlDriver = (Ptr)drvrHdl; (*entryHdl)->dCtlFlags = drvrPtr->drvrFlags; (*entryHdl)->dCtlDelay = drvrPtr->drvrDelay; (*entryHdl)->dCtlEMask = drvrPtr->drvrEMask; (*entryHdl)->dCtlMenu = drvrPtr->drvrMenu; (*entryHdl)->dCtlPosition = 0; (*entryHdl)->dCtlRefNum = ~tempDrvrID; (*entryHdl)->dCtlWindow = NULL; (*((DCtlHandle**)0x11C))[tempDrvrID] = entryHdl; pb.ioCompletion = NULL; pb.ioNamePtr = (StringPtr)hackname; pb.ioPermssn = 0; myErr = PBOpen((ParmBlkPtr)&pb, false); if(myErr != noErr) { //DebugStr("\pError with pbopen"); } drvrHdl = GetResource((ResType)'DRVR', tempDrvrID); SetResInfo(drvrHdl, drvrID, drvrName); return(myErr); } else { return openErr; } } int main(void) { THz save, sys; save = GetZone(); sys = SystemZone(); SetZone(sys); if(MyOpenDriver() != 0) { //DebugStr("\pProblem loading driver"); } SetZone(save); }

View File

0
romdrv1.2/atBOOT Normal file
View File

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
#ifndef _FC8_H_ #define _FC8_H_ #pragma parameter __D0 fc8_decode(__A0, __A1, __D1) asm unsigned short fc8_decode(unsigned char* in, unsigned char* out, unsigned long outsize); #endif

BIN
romdrv1.2/romdrv inrom v2 Normal file

Binary file not shown.

1
romdrv1.2/romdrv.c Normal file

File diff suppressed because one or more lines are too long