ON ERROR PROCe DIM rom% 512*1024 DIM Overflow 32*1024 DIM name$(36) DIM n%(36) VDU 26,12 REM fill empty locations with &FF FOR X%=rom% TO rom%+512*1024-1 !X%=-1 NEXT RESTORE +0 REM game directory at 3C00 *spool build sector%=0 entry%=0 REPEAT READ file$,name$, IF name$<>"***" THEN file$="RUNGAMES."+file$ REM read bytes 3 and 4 to get the size K%=OPENIN file$ x%=BGET#K% y%=BGET#K% x%=BGET#K% y%=BGET#K% filesize%=x%+256*y%+4 size%=INT((2047+filesize%)/2048) CLOSE#K% REM now check the game fits in before the next code section end%=sector%+size%-1 REM Problem area's are sectors &04-&07, &44-&47, &84-&87, &C4-&C7, for a mark 2 board REM or just &04 to &07 on a mark 3 board flag%=FALSE FOR count%=sector% TO end% nib%=count% MOD &40 IF nib%>=4 AND nib%<=7 THEN flag%=TRUE NEXT IF flag% THEN oldsec%=sector% group%=end% DIV &40 sector%=8+64*group% PRINT '"Moving file pointer, unused sectors:";sector%-oldsec%-4 PRINT ENDIF name$(entry%)=name$ n%(entry%)=sector% PRINT "Sector ";sector%;" File ";file$;" Game ";name$;" size &";~filesize%;" sectors needed ";size% chunk%=rom%+sector%*&800 OSCLI "LOAD "+file$+" "+STR$~chunk% sector%+=size% entry%+=1 ENDIF UNTIL sector%>255 OR name$="***" free%=256-sector% IF sector%<196 free%-=4 IF sector%<132 free%-=4 IF sector%<68 free%-=4 PRINT "Total sectors used ";sector% PRINT "Total sectors free ";free% PRINT "Total games added ";entry% REM now sort the list bubble sort used as its easy to code REPEAT swap%=FALSE FOR X%=1 TO entry%-1 IF name$(X%) < name$(X%-1) THEN temp$=name$(X%) temp%=n%(X%) name$(X%)=name$(X%-1) n%(X%)=n%(X%-1) name$(X%-1)=temp$ n%(X%-1)=temp% swap%=TRUE ENDIF NEXT UNTIL swap%=FALSE FOR X%=0 TO entry%-1 dir%=rom%+&3C00+16*X% dir%?0=n%(X%) name$=name$(X%)+STRING$(14," ") FOR Z%=1 TO 14 dir%?Z%=ASC(MID$(name$,Z%)) NEXT dir%?15=0 NEXT REM NOW DUMP THE ROM 7 CODE TO OFFSET &2000 OSCLI "LOAD !GAMEMTX.ROMS.GAMEROM "+STR$~(rom%+&2000) REM and copy to offsets &22000,&42000 &62000 REM cant just *load, as directory info has to be copied too FOR X%=0 TO &1FFF STEP4 Y%=!(rom%+&2000+X%) !(rom%+&22000+X%)=Y% !(rom%+&42000+X%)=Y% !(rom%+&62000+X%)=Y% NEXT OSCLI "SAVE !GAMEMTX.BIGGAMEROM "+STR$~rom%+" +80000 0 0" *spool *settype build text END DATA HAWKWARS,Hawkwars DATA ALICE,Alice DATA ARCAZION,Arcazions DATA ASTROPAC,"Astro Pac" DATA BAK80FF,Bakery DATA BLOBBO,Blobbo DATA CHESS,Chess DATA DRAUGHTS,Draughts DATA ICEBURG,Iceburg DATA KILOPEAD,Kilopead DATA OMEGA,"Mission Omega" DATA KNUCKLES,Knuckles DATA ALPHA,"Mission Alpha" DATA NEMO,Nemo DATA OBLOIDS,Obloids DATA PHAID,Phaid DATA QOGO,Qogo DATA QOGO2,"Qogo 2" DATA QUAZZIA,Quazzia DATA DEVILS,"Little Devils" DATA REVERSI,Reversi DATA STAR,"Star Command" DATA SCANNER,"SurfaceScanner" DATA TACHYON,"TachyonFighter" DATA TOADO,"Toado" DATA TURBO,"Turbo" DATA OBLITER,Obliteration Z DATA BORIS,"Boris & Bats" DATA ASTROMILON,Astromilon DATA S_MINE,"SuperMinefield" DATA BGAMMON,Backgammon DATA BBILL,"Bouncing Bill" DATA FATHOMS,"Fathoms Deep" DATA COSMIC,"Cosmic Raiders" DATA MINERD,"Miner Dick" DATA RB,"Rolla Bearing" REM End marker DATA ***,*** DEF PROCe REPORT PRINT " at line ";ERL *CLOSE END