8-Bit Software Online Conversion
SWRload and Notepad ROM - Listing
10REM Sideways Ram Utilites
20REM Written by Ben J. Dooks
30REM (c) 1990 Micro User
40REM
50REM Put all Rom Images in DIR R
60REM
70RM%=0:BK%=0
80DR%=0:TI$=" Hello"
90DIM RF$(32),RAM(16),LF$(16),LF(16)
100ONERROR IF ERR=17 END ELSE REPORT:P
RINT " at line ";ERL:A=INKEY(200):GOTO 1
80
110MODE 7:HIMEM=&3C00
120HIMEM=&3C00
130PRINT ''" Programmed by B.J. Dooks"
140PRINT ''" Please wait .."'" Reading
files ";
150PROCrfile
160PROCass
170PROCfindram
180MODE 7:HIMEM=&3C00
190s$=STRING$(34,"s")
200PRINT CHR$(148);" ";s$
210PRINT CHR$(141);CHR$(134);CHR$(157)
;CHR$(132);" Sideways RAM/ROM Utilites
";CHR$(156)'CHR$(141);CHR$(134);CHR$
(157);CHR$(132);" Sideways RAM/ROM Utili
tes ";CHR$(156)
220PRINT CHR$(148)" ";STRING$(34,"s")
230PRINTTAB(1,19)CHR$(148)STRING$(34,"
s")
240PRINTTAB(0,20)" ";CHR$(134);CHR$(15
7);CHR$(132);" Drive :";CHR$(135);DR%;C
HR$(132)" Tit.";CHR$(135);TI$
250PRINTTAB(36,20)CHR$(156)
260PRINTTAB(0,21)" ";CHR$(134);CHR$(15
7);CHR$(135);" ";FI%;CHR$(132);"Rom Ima
ge(s) on disc"
270PRINTTAB(36,21)CHR$(156)
280PRINTTAB(0,22)" ";CHR$(134);CHR$(15
7);CHR$(135);" ";BK%;CHR$(132);"Bank(s)
of RAM ";CHR$(135);RM%;CHR$(132);"Roms
"
290PRINTTAB(36,22)CHR$(156)
300PRINTTAB(1,23)CHR$(148);s$
310VDU 28,2,18,34,4
320PRINT '''" L..... Load to Sideways
RAM"
330PRINT " S..... Save ROM Image"
340PRINT " C..... Clear Sideways RAM"
350PRINT " R..... List ROM's"
360PRINT " F..... List ROM Files on di
sc "
370PRINT " I..... Infomation on ROM "
380PRINT " (0-4). Change drive"
390PRINT '" Chose: "
400A$=GET$
410A=ASC(A$)
420IF A$="L" PROCl:GOTO 180
430IF A$="C" PROCc:GOTO 180
440IF A$="S" PROCs:GOTO 180
450IF A$="R" PROCr:GOTO 180
460IF A$="I" PROCi:GOTO 180
470IF A$="F" PROCf:GOTO 180
480IF A>47 AND A<53 PROCndrive:GOTO 18
0
490GOTO 400
500DEFPROCfindram
510CALL findram
520FOR I=HIMEM TO HIMEM+16
530RAM(I-HIMEM)=?I
540IF ?I=255 THEN BK%=BK%+1
550NEXT
560FOR I=0 TO 16 STEP 1
570IF ?(&2A1+I)>0 THEN RM%=RM%+1
580IF ?(&2A1+I)>0 AND RAM(I)=255 THEN
LF(I)=1:LF$(I)=FNromtitle(I)
590NEXT I
600ENDPROC
610DEFPROCass
620romt=HIMEM
630FOR I%=0 TO 2 STEP 2
640P%=&900
650[OPT I%
660.findram
670LDA&F4:PHA
680LDA#0:LDX#15
690.lp3
700STA romt,X
710STX&F4:STX&FE30
720STX&8000
730DEX:BPL lp3
740LDX#15:LDA#255
750.lp4
760STX&F4:STX&FE30
770CPX&8000:BNE notram1
780STA romt,X
790.notram1
800DEX:BPL lp4
810LDX#15
820.lp5
830STX&F4:STX&FE30
840LDA#&4C:STA&8000
850LDA&8000
860CMP #&4C:BEQ notnotram2
870LDA#0:STA romt,X
880.notnotram2
890DEX:BPL lp5
900PLA:STA&F4:STA&FE30
910RTS
920.rtitle
930LDA &F4
940PHA
950SEI
960STX &F4:STX &FE30
970LDX #9
980LDY #0
990.looprt
1000LDA &8000,X
1010STA &C00,Y
1020CMP #0
1030BEQ finrd
1040CPX #&1C
1050BEQ finrd
1060INX:INY
1070JMP looprt
1080.finrd
1090INY
1100LDA #13
1110STA &C00,Y
1120PLA
1130STA &F4
1140STA &FE30
1150CLI
1160RTS
1170.moveup
1180SEI
1190LDA &F4:PHA
1200STX &F4
1210STX &FE30
1220LDA #0
1230LDA #0
1240STA &72
1250LDA #&3C
1260STA &71
1270LDA #&80
1280LDY #0
1290STA &73
1300.loopup
1310LDA (&70),Y
1320STA (&72),Y
1330CPY #&FF
1340BEQ incc
1350INY:JMP loopup
1360.incc
1370LDA &71
1380CLC
1390ADC #1
1400STA &71
1410CMP #&7C
1420BEQ finup
1430INC &73
1440LDY #0
1450JMP loopup
1460.finup
1470PLA:STA &F4
1480STA &FE30
1490CLI
1500RTS
1510.movedown
1520SEI
1530LDA &F4:PHA
1540STX &F4
1550STX &FE30
1560LDA #0
1570STA &72
1580STA &70
1590LDA #&3C
1600STA &71
1610LDA #&80
1620STA &73
1630LDY #0
1640.loopdown
1650LDA (&72),Y
1660STA (&70),Y
1670CPY #&FF
1680BEQ incd
1690INY
1700JMP loopdown
1710.incd
1720LDA &71
1730CLC
1740ADC #1
1750STA &71
1760CMP #&7C
1770BEQ findown
1780INC &73
1790LDY #0
1800JMP loopdown
1810.findown
1820PLA
1830STA &F4
1840STA &FE30
1850CLI
1860RTS
1870.clear
1880LDA &F4:PHA
1890SEI
1900STX &F4:STX &FE30
1910LDA #0:STA &70
1920LDA #&80:STA &71
1930LDA #0
1940LDY #0
1950.loopclr
1960LDA #0
1970STA (&70),Y
1980LDA &70
1990ADC #1
2000STA &70
2010LDA &71
2020ADC #0
2030STA &71
2040CMP #&C0
2050BEQ finclr
2060LDA #0
2070JMP loopclr
2080.finclr
2090PLA:STA &F4
2100STA &FE30
2110CLI
2120RTS
2130]:NEXT
2140ENDPROC
2150RTS
2160DEFPROCr
2170CLS
2180PRINT ' " Current Roms are :"
2190PROCrlist
2200PROCwait:ENDPROC
2210ENDPROC
2220DEFPROCrlist
2230I=15
2240REPEAT
2250T$=FNromtype(I)
2260IF ?(&2A1+I)=0 THEN 2310
2270RT$=FNromtitle(I)
2280IF RAM(I)=&FF THEN C=131 ELSE C=134
2290PROCromp(I,CHR$(130)+T$+CHR$(C)+RT$
)
2300T=0
2310I=I-1:UNTIL I=0
2320PRINT " ";CHR$(131);"Yellow =";CHR$
(134);"Sideways Ram"
2330ENDPROC
2340DEF FNromtype(ROM%)
2350X%=?(&2A1+ROM%)
2360IF (X% AND 64)=64 THEN U$="Language
":GOTO 2390
2370IF (X% AND 128)=128 THEN U$="Utilit
y ":GOTO 2390
2380U$=""
2390=U$
2400DEF FNromtitle(ROM%)
2410IF ?(&2A1+ROM%)=0 THEN U$="":GOTO 2
450
2420X%=ROM%
2430CALL rtitle
2440=$&C00
2450=""
2460DEFPROCromp(R%,M$)
2470PRINT CHR$(131);R%;CHR$(134);"...."
;
2480PRINTTAB(6,VPOS);M$
2490ENDPROC
2500DEFPROCl
2510CLS
2520IF BK%<1 THEN PRINT '''CHR$(134);"N
o SIDEWAYS RAM Present ":VDU 7:A=INKEY(3
00):ENDPROC
2530PRINT " Sideways RAM Status"
2540PROCdispram
2550PRINT
2560FOR I=1 TO FI% STEP 2
2570PRINT CHR$(134);CHR$(64+I);CHR$(131
);;RF$(I);CHR$(134);CHR$(65+I);CHR$(131)
;RF$(I+1)
2580NEXT
2590PRINT 'CHR$(134)"Letter or 'RETURN'
to EXIT";CHR$(133);"?"
2600F$=GET$
2610IF F$=CHR$(13) THEN ENDPROC
2620X=ASC(F$):IF X>64 AND X<90 THEN F$=
RF$(X-64) ELSE VDU 7:GOTO 2600
2630PRINT CHR$(133)"Socket (0-16) ";:IN
PUT SN%
2640IF SN%<0 OR SN%>15 THEN VDU 7:GOTO
2510
2650IF RAM(SN%)<>255 THEN PRINT '" Bad
socket ":VDU 7:A=INKEY(150):GOTO 2510
2660PROCload(SN%,F$)
2670LF(SN%)=1
2680LF$(SN%)=F$
2690PRINT CHR$(133)"Update ROM table ";
2700INPUT U$
2710IF U$="Y" THEN ?(&2A1+SN%)=?&3C06
2720ENDPROC
2730DEFPROCrfile
2740PROCdrive
2750*DIR R
2760FI%=0
2770?&CD0=0
2780!&CD1=&C30
2790REPEAT
2800!&CD1=&C30
2810!&CD5=1
2820FI%=FI%+1
2830X%=&D0
2840Y%=&C
2850A%=8
2860R%=USR(&FFD1) AND &1000000
2870IF R%=TRUE THEN 2920
2880L=?&C30
2890?(&C31+L)=13
2900RF$(FI%)=$&C31
2910PRINT "*";
2920UNTIL R%
2930?&CD0=0
2940!&CD1=&C30
2950!&CD5=1
2960!&CD9=0
2970X%=&D0:Y%=&C
2980A%=5
2990CALL &FFD1
3000L=?&C30:?(&C31+L)=13
3010TI$=$&C31
3020FI%=FI%-1
3030ENDPROC
3040DEFPROCdrive
3050PROCosc("DRIVE "+STR$(DR%))
3060ENDPROC
3070DEFPROCosc($&C00)
3080X%=0
3090A%=0
3100Y%=&C
3110CALL &FFF7
3120ENDPROC
3130DEFPROCload(SK%,F$)
3140PROCosc("LOAD "+F$+" 3C00")
3150X%=SK%
3160CALL moveup
3170ENDPROC
3180DEFPROCsave(SK%,F$)
3190X%=SK%
3200CALL movedown
3210PROCosc("SAVE "+F$+" 3C00 7C00 8000
8000")
3220ENDPROC
3230DEFPROCndrive
3240DR%=A-48
3250CLS
3260PRINT '''" Changing to Drive ";DR%
3270PRINT ''" Reading files :";
3280PROCrfile
3290ENDPROC
3300DEFPROCc
3310CLS
3320PRINT '" Clear Sideways RAM"'
3330PROCdispram
3340PRINT 'CHR$(133)"Socket ";:INPUT SK
%
3350X%=SK%
3360?(&2A1+SK%)=0:LF(SK%)=0
3370X%=SK%
3380CALL clear
3390PRINT " Cleared ":A=INKEY(100):ENDP
ROC
3400DEFPROCdispram
3410R=15
3420REPEAT
3430IF RAM(R)<>255 THEN 3470
3440PRINT CHR$(131);R;CHR$(134);"....";
3450IF LF(R)=0 THEN PRINTTAB(10,VPOS)"
Nothing Loaded "
3460IF LF(R)=1 THEN PRINTTAB(10,VPOS)CH
R$(131);LF$(R);CHR$(134);"Loaded "
3470R=R-1
3480UNTIL R=0
3490ENDPROC
3500DEFPROCs
3510CLS
3520PROCrlist
3530PRINT 'CHR$(133)"Socket ";:INPUT SK
%
3540IF SK%<0 OR SK%>15 THEN PRINT '" Ba
d socket ":VDU 7:A=INKEY(100):GOTO 3510
3550PRINT 'CHR$(133)"Filename ";:INPUT
F$
3560IF F$="" ENDPROC
3570PROCsave(SK%,F$)
3580PRINT '"Done"
3590FI%=FI%+1
3600RF$(FI%-1)=F$
3610GOTO 3510
3620DEFPROCf
3630CLS
3640PRINT CHR$(135)" Rom Files on Disc
"
3650PRINT
3660FOR I=1 TO FI% STEP 2
3670PRINT CHR$(134);" ";RF$(I);CHR$(131
);".....";CHR$(134);RF$(I+1)
3680NEXT
3690PROCwait
3700ENDPROC
3710DEFPROCi
3720CLS
3730PRINT CHR$(135);" From ROM or ROM F
ile (R/F) "
3740A$=GET$
3750IF A$="R" PROCri:ENDPROC
3760IF A$="F" PROCfi:ENDPROC
3770VDU 7:GOTO 3720
3780ENDPROC
3790DEFPROCri
3800CLS
3810PRINT 'CHR$(133)" Socket ";
3820INPUT "";SK%
3830IF SK%<0 OR SK%>15 THEN 3800
3840X%=SK%
3850A%=0:Y%=0
3860CALL movedown
3870PROCpi
3880ENDPROC
3890DEFPROCfi
3900PRINT 'CHR$(133)" Filename ";
3910INPUT "";F$
3920PROCosc("LOAD "+F$+" 3C00")
3930PROCpi
3940ENDPROC
3950DEFPROCpi
3960CLS
3970IF A$="R" PRINT '" Rom number ";SK%
;"'s info:"
3980IF A$="F" PRINT '" Rom file ";F$;"'
s info:"
3990PRINT CHR$(134)" Rom type ";CHR$(13
1);
4000T%=?&3C06
4010IF (T% AND 64)=64 PRINT " Language
" ELSE IF (T% AND 128)=128 PRINT " Utili
ty "
4020I=&3C08
4030REPEAT
4040I=I+1
4050IF ?I=0 THEN ?I=13
4060UNTIL ?I=13 OR I=&3C19
4070?&3C19=13
4080PRINT CHR$(134)" Rom tit. ";CHR$(1
31);$&3C09
4090IF (T% AND 64)=64 THEN PRINT 'CHR$(
134)" Language entry ";CHR$(131);"&";÷(?
&3C01+?&3C02*256):ELSE PRINT 'CHR$(134)"
No Language Entry"
4100IF (T% AND 128)=128 THEN PRINT CHR$
(134)" Service entry ";CHR$(131);"&";÷(
?&3C04+?&3C05*256):ELSE PRINT CHR$(134)"
No Service Entry "
4110IF (T% AND 32)=32 THEN PRINT 'CHR$(
134)" Tube Relocatable "
4120PROCwait:ENDPROC
4130DEFPROCwait
4140I=INKEY(1000):ENDPROC