10 ' Flash Kanji ROM levels 1 and 2 into the GR8NET 20 ' designed by Eugeny Brychkov 20210811 (revision of 20210819) 30 DIMD(4):V=INP(&H5E):CALLNETGETDA(A,B):N=0:C=B:FORI=0TO3:IF(CAND1)=1THENN=N+1:D(I)=1ELSED(I)=0 40 C=C\2:NEXTI:IFN=1THEN120 50 PRINT"You have several GR8NET":PRINT"adapters in the system":PRINT:PRINT"ID";CHR$(9);"Slot":FORI=0TO3:IFD(I)=0THEN80 60 OUT&H5E,I*&H50+1:S=INP(&H5F):PRINTI;CHR$(9);HEX$(SAND3);:IF(SAND128)<>0THENPRINT".";HEX$((S\4)AND3); 70 IFI=ATHENPRINT" (default)"ELSEPRINT 80 NEXTI:OUT&H5E,V:PRINT:X=-1 90 INPUT"Select ID: ";X:IFX<0ORX>3THEN90 100 IFD(X)=0THEN90 110 CALLNETSETDA(X) 120 CALLNETGETMMV(U):IFU<33THENPRINT"Insufficient GR8NET RAM:":PRINT"Please boot into":PRINT"mapper mode 0":END 130 CALLNETGETMEM(201,&H609C,A):IFA=255THENA=21 140 S=2^(A-16):DEFUSR=342 150 PRINT"Important: the program will":PRINT"save current configuration" 160 PRINT"into ROM, if you do not want":PRINT"current configuration to be" 170 PRINT"saved then press CTRL-STOP":PRINT"now and perform clean boot";:X=USR(0):A$=INPUT$(1):PRINT 180 PRINT:PRINT"List of images in GR8NET":CALLFLLIST:PRINT:PRINT 190 PRINT"Choose Kanji ROM image vendor:":PRINT"1. Panasonic (FS-A1GT)":PRINT"2. Sanyo (PHC-70FD2)":PRINT"3. Sony (HB-F1XDJ)" 200 PRINT"4. Mitsubishi (ML-TS2)":PRINT"5. Custom (A2C for emulators)":A=0:INPUT"Choice";A:IFA<1ORA>5THENPRINT"Aborted":STOP 210 IFA=1THENP$="gr8net-fpga-pakanjirom.bin" 220 IFA=2THENP$="gr8net-fpga-sakanjirom.bin" 230 IFA=3THENP$="gr8net-fpga-sokanjirom.bin" 240 IFA=4THENP$="gr8net-fpga-mikanjirom.bin" 250 IFA=5THENP$="gr8net-fpga-emukanjirom.bin" 260 P$="http://www.gr8bit.ru:80/software/firmware/GR8NET/Kanji-ROM/"+P$ 270 A=4:PRINT:PRINT"Image will require";A;"sectors" 280 INPUT"Select starting sector: ";N:IFN<4THENPRINT"Overwriting factory image":PRINT"is not allowed":GOTO280 290 IFN+A>STHENPRINT"ROM will not fit":GOTO280 300 PRINT"Press uppercase Y":PRINT"to start >"; 310 X=USR(0):A$=INPUT$(1):PRINTA$:IFA$<>"Y"THENPRINT"Aborted":END 320 PRINT"Loading image...";:CALLNETBLOAD(P$):PRINT"done":PRINT:CALLFLUPDATE(N,1) 330 PRINT:PRINT"Update finished":CALLNETGETMEM(255,&H6BFD,A):IFA<4ORA>252THEN360 340 PRINT"Kanji ROM at sector";A;"is already":PRINT"configured, do you want to make":A$="":INPUT"new Kanji ROM active (Y)";A$ 350 IFA$<>"Y"THENEND 360 PRINT"Updating configuration..."; 370 CALLNETGETMEM(191,&H6000,A):CALLNETSETMEM(255,&H5FFF,A,A):CALLNETSETMEM(255,&H6BFD,N) 380 CALLNETSAVE:PRINT"done":PRINT"Press any key for reset":A$=INPUT$(1):CALLNETMRESET:END