From dbh Wed Jan 27 18:20:27 1993 Date: Fri, 26 Jun 92 16:05:47 EST From: dbh To: jwil1@cs.aukuni.ac.nz (TMOTA) In-reply-to: jwil1@cs.aukuni.ac.nz's message of Thu, 25 Jun 1992 23:13:26 GMT Subject: Source submission This program prints the details stored in a podule header. It also extracts any relocatable module and saves it in a file called Module in the current directory. If there's more than one module present you'll get the last one. It currently only looks at the Podule in slot 0 but you could easily change the assignment statement (Slot%=0) or even make it into a loop. What use is it? Well, when I upgraded my MIDI podule ROM, I wanted to be able to RMLoad the old MIDI module from disc so I could test my software for backward compatibility without having to change ROMs. Denis Howe --------8<---------8<-------- CUT HERE --------8<---------8<-------- REM > PodInfo Copyright © Denis Howe 1992 REM You may copy this program freely as long as this REM notice is retained and you don't charge for it. REM Please send me a copy of any modifications you make REM and list them below with your name. REM 0.00 14-Jun-1992 Written by Denis Howe REM 26-Jun-1992 Released to comp.sources.acorn DIM b% 16 Slot%=0 SYS "Podule_ReadHeader",,,b%,Slot% ID%=b%?0 >> 3 AND &F NonAcorn%=b%?0 >> 7 AND 1 PRINT"Interrupt request (IRQ) = ";b%?0 >> 0 AND 1 PRINT"Podule absent = ";b%?0 >> 1 AND 1 PRINT"Fast interrupt request (FIRQ) = ";b%?0 >> 2 AND 1 PRINT"Short ID (ID) = ";ID%; IF ID%=0 PRINT" (extended ID used)" ELSE PRINT PRINT"Acorn non-conformant (A) = ";NonAcorn% IF ID% OR NonAcorn% QUIT ChunkDir%=b%?1 >> 0 AND 1 PRINT"Chunk directory present (CD) = ";ChunkDir% PRINT"Interrupt status pointers (IS) = ";b%?1 >> 1 AND 1 PRINT"Podule space word width (W) = "; Width%=b%?4 >> 2 AND 3 IF Width%=3 PRINT;"Reserved" ELSE PRINT;1<<(3+Width%); " bits" Product%=b%?3 OR b%?4 << 8 PRINT"Product type code (P) = ";Product%; IF Product%=19 PRINT" (MIDI Interface)" ELSE PRINT Manufacturer%=b%?5 OR b%?6 << 8 PRINT"Manufacturer code (M) = ";Manufacturer%; IF Manufacturer%=0 PRINT" (Acorn)" ELSE PRINT Country%=b%?7 PRINT"Country of origin (C) = ";Country%; IF Country%=0 PRINT" (UK)" ELSE PRINT PRINT SYS"Podule_HardwareAddress",,,,Slot% TO ,,,Ad% PRINT"CMOS RAM word base address = &";Ad% AND &0000FFF PRINT"Expansion card base address = &";Ad% AND &3FFF000 IF ChunkDir%=0 QUIT PRINT Chunk%=0 REPEAT SYS"Podule_EnumerateChunks",Chunk%,,,Slot%,0 TO Chunk%,Size%,OSId%,,Name% IF Chunk% THEN PRINT "Chunk ";Chunk%-1;" ";Size%;" bytes, OS ID &";~OSId%;" ("; CASE OSId% >> 4 AND 7 OF WHEN 0:PRINT"Arthur/RISC OS "; CASE OSId% AND 15 OF WHEN 0:PRINT"loader"; WHEN 1:PRINT"relocatable module"; DIM buf% Size% SYS "Podule_ReadChunk",Chunk%-1,,buf%,Slot% OSCLI"Save module "+STR$~buf%+" +"+STR$~Size% *SetType Module Module WHEN 2:PRINT"BBC ROM"; WHEN 3:PRINT"sprite"; OTHERWISE:PRINT"reserved"; ENDCASE WHEN 2:PRINT"Acorn Unix"; WHEN 6:PRINT"Manufacturer specific"; WHEN 7:PRINT"Device data: "; CASE OSId% AND 15 OF WHEN 0:PRINT"chunk directory link"; WHEN 1:PRINT"serial number"; WHEN 2:PRINT"date of manufacture"; WHEN 3:PRINT"modification status"; WHEN 4:PRINT"place of manufacture"; WHEN 5:PRINT"description"; WHEN 6:PRINT"part number"; WHEN15:PRINT"empty"; OTHERWISE:PRINT"reserved"; ENDCASE OTHERWISE:PRINT"Reserved"; ENDCASE PRINT")"; IF Name% THEN VDU 32,34 WHILE ?Name%>31 VDU ?Name%:Name%+=1:ENDWHILE VDU 34 ENDIF PRINT ENDIF UNTIL Chunk%=0 PRINT *FileInfo Module --------8<---------8<-------- CUT HERE --------8<---------8<-------- Denis Howe cmprsd sg vrs: pl cp I have an answering machine in my car. It says, "I'm home now but leave a message and I'll call when I'm out."