-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmySE30rom.a
254 lines (208 loc) · 10.3 KB
/
mySE30rom.a
1
;-------------------------------------------------------------------; Fully disassebled, reformatted and commented Declaration ROM ; of the Apple Macintosh SE/30 internal video "card". ; ; This can be interesting for the nosy people and helpful for ; those planing to write their own DeclROM.; ; Can be assembled with MPW 3.2 ; - not tested with more recent versions which changed some of ; the toolbox calls;; There is an indepth article explaining the basic functionality ; of Declaration ROMs available at; https://www.geekdot.com/macintosh-declaration-rom-101/; and a step-by-step discussion of this code in the following; posts of that article.;; disassembly, reformatting and comments by Axel Muhr ; V1.0 - 01.08.2022 ;;-------------------------------------------------------------------; Some global flags which can be helpful during coding/testing;------------------------------------------------------------------- GBLA &withEasterEgg&withEasterEgg SETA 1 ; Add the SE/30 team easter egg which lives at $1000 GBLA &testing ; Useful if you want to include blocks of code for testing&testing SETA 0 MACHINE MC68020;=====================================================================; Initial Assembler Directives;===================================================================== STRING C PRINT OFF INCLUDE 'SysErr.a' ; Macintosh System equates INCLUDE 'SysEqu.a' ; Macintosh System equates INCLUDE 'ROMEqu.a' ; Declaration ROM equates INCLUDE 'SlotEqu.a' ; Slot Manager equates and macros INCLUDE 'TimeEqu.a' ; Macintosh traps INCLUDE 'Traps.a' ; Macintosh traps INCLUDE 'VideoEqu.a' ; Video driver equates INCLUDE 'QuickEqu.a' ; QuickDraw equates PRINT ON; ;=====================================================================; BEGIN Declaration ROM;=====================================================================SE30DeclROM MAIN WITH VDPageInfo, SlotIntQElement ;*************************************************************;Constants;*************************************************************ROMSize EQU $2000 ;8K byte ROMsRsrc_Board EQU 1 ;Board sResource sRsrc_Video1 EQU $80 ;Video sResource - this is the only Rsc which actually been usedsRsrc_Video2 EQU $A0 ;Video sResource - this will be removed later and differs by the ; used HWdrID (3 vs. 1) and the driver used. standard_Mode EQU $80stealth_Mode EQU $A0;=====================================================================; Directory ;=====================================================================_sRsrcDir OSLstEntry sRsrc_Board,_sRsrc_Board ; References the board sResource. OSLstEntry sRsrc_Video1,_sRsrc_Video1 ; References the video sResource. OSLstEntry sRsrc_Video2,_sRsrc_Video2 ; References the video sResource. DatLstEntry endOfList,0 ;=============================================================; sRsrc_Board List;============================================================= STRING C _sRsrc_Board OSLstEntry sRsrcType,_BoardType ; References the sResource type. OSLstEntry sRsrcName,_BoardName ; References the sResource name. OSLstEntry sRsrcIcon,_VidICON DatLstEntry boardId,$000C ; The board Id. OSLstEntry primaryInit,_sPInitRec ; References the Primary init record. OSLstEntry vendorInfo,_VendorInfo ; References the Vendor information list.; OSLstEntry secondaryInit, _sSInitRec ; we don't have one, so this is a placeholder; OSLstEntry sRsrcVidNames,_sVidNameDir ; video name directory, again, a placeholder DatLstEntry endOfList,0 _BoardType DC.W CatBoard ;The Board sResource : <Category> DC.W TypBoard ; <Type> DC.W 0 ; <DrvrSw> DC.W 0 ; <DrvrHw>_BoardName DC.L 'Macintosh SE/30 Internal Video',0 ;The name of the Board ALIGN 2 _VidICON ; This is the icon displayed when clicking the "option" button ; in the "monitors" control panel - it's optional and not defined ; in the original ROM, i.e. shamelessly added by me, Axel. DC.L $00000000, $7FFFFFFE, $79FFFF9E, $707FFF9E DC.L $6F7FFF9E, $4FE1C392, $4FCC9986, $4840818E DC.L $4E4F9F8E, $664C9996, $7061C392, $7FFFFFFE DC.L $00000000, $7FFFFFFE, $7F8FFFFE, $7F0FFFFE DC.L $7FCFFFFE, $7F8FFFEE, $7F8FFFCE, $7F9FFF8E DC.L $781F0606, $711E0606, $671CE31E, $4718E31E DC.L $4F39E31E, $0E39E33E, $0E31E73E, $0C31C73E DC.L $0039CE3E, $42381E1E, $671C3F1E, $00000000;-------------------------------------------------------------; Primary Init Record;-------------------------------------------------------------_sPInitRec DC.L _EndsPInitRec-_sPInitRec ;The physical Block Size INCLUDE 'mySE30_primaryInit.a' ALIGN 2_EndsPInitRec ;-------------------------------------------------------------; Vendor Info record;-------------------------------------------------------------_VendorInfo OSLstEntry VendorId,_VendorId ;References the Vendor Id. OSLstEntry RevLevel,_RevLevel ;References the Revision Level. OSLstEntry PartNum,_PartNum ;References the Part Number. DatLstEntry endOfList,0 ;End of the list._VendorId DC.L 'Apple Computer' ;The Vendor Id_RevLevel DC.L 'MacSE/30-1.0' ;The Revision Level_PartNum DC.L '341-0650' ALIGN 2 ;=============================================================; sRsrc_Video;=============================================================_sRsrc_Video1 OSLstEntry sRsrcType,_VideoType1 ;References the sResource Type. OSLstEntry sRsrcName,_VideoNameStd ;References the sResource Name. OSLstEntry sRsrcDrvrDir,_VidDrvrDir1 ;References the driver directory. DatLstEntry sRsrcHWDevId,1 ;The hardware device Id. OSLstEntry MinorBaseOS,_MinorBase ;References the Minor Base Offset. OSLstEntry MinorLength,_MinorLength ;References the Minor Base Length. ;Parameters OSLstEntry standard_Mode, _Standard_Mode ;References the 1-bit mode parameters. DatLstEntry endOfList,0 ;End of the list. _sRsrc_Video2 OSLstEntry sRsrcType,_VideoType2 ;References the sResource Type. OSLstEntry sRsrcName,_VideoNameStd ;References the sResource Name. OSLstEntry sRsrcDrvrDir,_VidDrvrDir2 ;References the driver directory - differs from mode 0x80. DatLstEntry sRsrcHWDevId,1 ;The hardware device Id. OSLstEntry MinorBaseOS,_MinorBase ;References the Minor Base Offset. OSLstEntry MinorLength,_MinorLength ;References the Minor Base Length. ;Parameters OSLstEntry stealth_Mode, _Standard_Mode ;References the 1-bit mode parameters. DatLstEntry endOfList,0 ;End of the list. _VideoNameStd dc.b 'Display_Video_Apple_MacSE/30 Video',0 _VideoType1 DC.W CatDisplay ;Video sResource : <Category> DC.W TypVideo ; <Type> DC.W DrSwApple ; <DrvrSw> DC.W $9 ; <DrvrHw> _VideoType2 DC.W CatDisplay ;Video sResource : <Category> DC.W TypVideo ; <Type> DC.W $0003 ; Thats drHWSE30 DC.W $9 ; <DrvrHw> _MinorBase DC.L 0 ; Video RAM Offset is 0_MinorLength DC.L $D5C0 ; That just 54720B/53K of the available 64K;-------------------------------------------------------------; One-Bit per pixel parameter list.;-------------------------------------------------------------_Standard_Mode OSLstEntry mVidParams,_StandardVidParams1 ;References the one-bit mode parameter record. DatLstEntry mPageCnt,2 ;The page count. DatLstEntry mDevType, 1 ;The device type 1 = Fixed. DatLstEntry endOfList,0 ;End of the list._StandardVidParams1 DC.L _EndStdVParams1-_StandardVidParams1 ;The physical Block Size. IF not &testing THEN dc.l $8040 ; base offset for start of screen memory ELSE dc.l $0040 ; base offset for start of alternative screen memory ENDIF dc.w $40 ; rowbytes (64) dc.w 0 ; top dc.w 0 ; left dc.w $156 ; bottom 342 dc.w $200 ; right 512 dc.w 0 ; bmVersion dc.w 0 ; packType not used dc.l 0 ; packSize not used dc.l $480000 ; bmHRes dc.l $480000 ; bmVRes dc.w 0 ; bmPixelType dc.w 1 ; bmPixelSize dc.w 1 ; bmCmpCount dc.w 1 ; bmCmpSize dc.l 0 ; bmPlaneBytes_EndStdVParams1 ;-------------------------------------------------------------; Driver directory;-------------------------------------------------------------_VidDrvrDir1 OSLstEntry sMacOS68020,_sMacOS68020 ;References the Macintosh-OS 68020 driver. DatLstEntry endOfList,0 _sMacOS68020 DC.L _End020Drvr-_sMacOS68020 ;The physical Block Size INCLUDE 'mySE30_driver_full.a' _End020Drvr _VidDrvrDir2 OSLstEntry sMacOS68030,_sMacOS68030 ;References the other Macintosh-OS driver. DatLstEntry endOfList,0 ; I made up the 030 notion - it does *not* mean ; that this driver is 68030 optimized in any way! ; Actually it's just a tiny stub, probably debugging remains. _sMacOS68030 DC.L _End030Drvr-_sMacOS68030 ;The physical Block Size INCLUDE 'mySE30_driver_stub.a' _End030Drvr STRING C if &withEasterEgg THEN ORG $1000 INCLUDE 'mySE30_easteregg.a' ENDIF ORG ROMSize-FHeaderRec.fhBlockSize;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++; Format/Header Block;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ DC.L (_sRsrcDir-*)**$00FFFFFF ;Offset to sResource directory DC.L ROMSize ;Length of declaration data DC.L 0 ;CRC {Patched by crcPatch (MPW tool)} DC.B 0 ;Revision level DC.B AppleFormat ;Format DC.L TestPattern ;Test pattern DC.B 0 ;Reserved byte (must be zero) DC.B $F ;ByteLanes: 1,2,3 and 4 ENDP END