Hello,
Today I have been thinking again about the idea of turning off the second floppy drive or what is the same: emulate the press of the CTRL Key by Software.
Searching on Internet I saw that in some thread someone talked about a program called "CONTROL.BAS". I discover aht this Program was in the #20 of the Brazilian Magazine called "CPU MSX". I found that Magazine here:
http://files.datassette.org/revistas/cpu_msx_20.pdf?file=1&t...
in the page 38 we can find the List of the Program. I put it here:
100 ' CONTROL.BAS 110 ' 120 ' Simula pulsaci¢n de la Tecla CTRL 130 ' para eliminar todas las Unidades 140 ' menos la primera (A:) 150 ' 160 ' por Francis N. Ouinn (Revista: CPU MSX - Num 20) 170 ' 180 IF PEEK(&HFD9F)=&HC9 THEN END 190 IF PEEK(&HF347)=1 THEN END 200 FOR I=1 TO 1000: NEXT I 210 DP=256*PEEK(&HF356)+PEEK(&HF355) 220 IF PEEK(DP+16)=3 THEN FS=512 230 HI=&HE68D-FS 240 FC=&HE7A9-FS 250 E7=&HE7-(FS/256): E6=E7-1 260 BL=256*PEEK(&HF379)+PEEK(&HF378) 270 BS=PEEK(&HF348) 280 POKE &HFD9F,&HC9 290 FOR I=0 TO 24 300 POKE HI+I,PEEK(BL+I) 310 NEXT I 320 POKE &HF1AA,0 330 POKE &HF1BD,&HAA: POKE &HF1BE,E7 340 POKE &HF1C5,0: POKE &HF1C8,1 350 POKE FC,&HFF: POKE &HFB21,1 360 POKE &HF247,0: POKE &HF347,1 370 POKE &HF349,&HA9: POKE &HF34A,E7 380 POKE &HF34D,&HAA: POKE &HF34E,&HEF 390 POKE &HF34F,&HAA: POKE &HF350,&HED 400 POKE &HF351,&HAA: POKE &HF352,&HEB 410 POKE &HF353,&HA6: POKE &HF354,E6 420 POKE &HF355,&HAA: POKE &HF356,&HF1 430 IF PEEK(&HFB2C)<>BS THEN 470 440 FOR I=0 TO 2 450 POKE &HFDA0+I, PEEK(&HFB2C+I) 460 NEXT I 470 CLEAR 200,HI: CLEAR 480 POKE &HFD9F,&HF7 490 ' 500 POKE &HFD09,&HF7 510 POKE &HFD0A,PEEK(&HF348) 520 POKE &HFD0B,&H22: POKE &HFD0C,&H40 530 DEFUSR=&HFD09: X=USR(0)
The purpose of this program is as I said before to disable the SECOND DRIVE in order to obtain more free memory. I have tested it on a real MSX (a Philips 8245) and also on the OpenMSX (emulating also the Philips 8245). The results obtained are the following:
- Running the program "CONTROL.BAS" and doing a PRINT FRE (0) I get 24,988 bytes free.
- If I hold the CTRL key pressed during startup and I make PRINT FRE (0) I get 24,990 bytes free.
There is a tiny difference of 2 bytes. But the matter is that after having executed the "CONTROL.BAS" Program te main Drive is disabled (in both case: the real MSX and the EMUlator)
Perhaps the Program "CONTROL.BAS" may be oriented to some Brazilian model. If any of you have a good knowledge of Assembler and the working of MSX Drives could find the error/s, because I don't have idea at all... :-(
I put HERE a ".DSK" image that contains the file "CONTROL.BAS".
Gracias & Saludetes. ;-)