Wishlist for BBC BASIC for Windows ================================== =QUIT ----- On RISC OS, QUIT returns TRUE if the program has been run with -quit on the command line, the normal way of running a BASIC program file. It returns FALSE if the program has been run from BASIC immediate mode. The corresponding functionality for BBFW would be for QUIT to return TRUE if running as a compiled program, FALSE if running in the IDE. ^FN and ^PROC to not need a call before ^ works ----------------------------------------------- When reading the address of a FN or PROC at least one call must have been made to place its entry in the heap before its address can be fetched with ^. This should not be needed. ^PROC and ^FN should be able to do the same as the normal PROC/FN lookup which does a program search if it doesn't find it in the heap. It should be possible to use the same code, as with the BBFW extension to ARM BASIC. It's counter-intuitve that you can do result=FNcode without any prior preparation, but you can't do addr%=^FNcode without prior preparation. ADVAL(7), ADVAL(8) ------------------ On other platforms these return the mouse position. Can they do so with BBFW? After all, INKEY-10, INKEY-11 and INKEY-12 already return the mouse button state. I keep finding I have programs that think the mouse is stuck in the bottom lefthand corner ;) Here and there in the documentation there are references to 'aiding porting' (eg EXIT) and this would aid porting, as well as completing the ADVAL/INKEY interface to the mouse. Paletted/Full screen display modes ---------------------------------- I'm still digging around the manual, so this may already be there and I haven't found it yet. It would be useful to be able to select a paletted mode so that paletted switched animation works. To palette switch without disturbing the rest of the desktop its usual to go into a full-screen display. That's easy enough with SetWindow calls, but it would be useful if it could be called more directly. It could be an extension to VDU 23,22 to select a user-defined screen mode. charset-b7 sets black/on/white or white/on/black, b6 and b5 could be used to select fullscreen and paletted. ADVAL(-buf) to return correct values ----------------------------------- ADVAL(-buf) should be implemented so that the following code works: IF ADVAL(-inputbuffer) THEN read_byte_from_inputbuffer IF ADVAL(-outputbuffer) THEN write_byte_to_outputbuffer That is: * when reading the state of an input buffer, it should return 0 if there is nothing to read and non-zero (the number of bytes that can be read) if there is something to read. * when reading the state of an output buffer, it should return 0 if there is no space left to write to it, and non-zero (the number of bytes left in the buffer) if there is space left to write to. Unfortunately, ADVAL(-1), which reads the keyboard /input/ buffer, actually returns the number of /free/ bytes in the buffer, as though it was an output buffer. Teletext display control via VDU 23 ----------------------------------- RISC OS 5 has introduced VDU 23,18 codes to control aspects of the teletext (MODE 7) display: VDU 23,18,1,flags,0,0,0,0,0,0 - set display update state: * bit 0 = suspend all automatic display update * bit 1 = update display after every character VDU 23,18,2,flags,0,0,0,0,0,0 - Set Teletext reveal state: * bit 0 = if set, any concealed text will be displayed. If cleared, concealed text is concealed. VDU 23,18,16,flags,0,0,0,0,0,0 - Set Teletext display characteristics * bit 0 = render high quality text Of these, VDU 23,18,2 to conceal and reveal concealed text is the most generally useful. Octal and binary ---------------- &o for octal, STR$# for octal output, STR$/ for binary output *FX vs CALL &FFF4 ----------------- *FX15 clears buffers, but A%=15:CALL &FFF4 doesn't. Could the *FX15 functionality be put in OSBYTE, and make *FX just parse its parameters and send them to OSBYTE. Could be another one to put under 'aiding portability', I have quite a bit of code that uses A%=FNfx(15,0) instead of *FX15, etc. Vectoring IO calls ------------------ Might be useful: Chapter 8 details how assembler code can access various OS routines. Are these OS routines vectored, like they are in BASIC-86, so they can be redirected? If not, can they be? CHAIN recognise Acorn format files ---------------------------------- Not essential, but it would be useful if CHAIN could recognise Acorn-format BASIC files and convert them on loading. I know that it's easier to recognise 80-format when expecting 65-format than the other way around, particularly with an 80-format program starting with a line length of 13. Some initial working 80x86 code is as follows: REM > B65to80 REM Test converting 6502 BASIC REM My first real 80x86 code! : DIM mcode% &FF,data% &3FF FOR P=0 TO 1 O%=mcode%:P%=mcode% [OPT P*3+4 .go% ; On entry, AX=program start MOV SI,AX ; Copy start to SourceIndex MOV DI,AX ; Copy start to DestIndex .ScanLoop MOV AL,[SI] ; Get or MOV AH,0 AND AX,AX ; Set Z flag JZ LoadOk1 ; Zero, must be Bas80, end of program CMP AX,13 ; Is it JNZ LoadOk1 ; Not , must be a length byte, must be Bas80 ; 0D byte, either Bas65 or Bas80 ADD SI,AX ; Assume length, step to next line DEC SI ; Point to byte before next byte ; Will be either Bas80 or Bas65 non- MOV AL,[SI] ; Get the byte MOV AH,0 CMP AL,13 ; There must be a before the JNZ NotBas80 ; No , can't be Bas80 INC SI JMP ScanLoop : .NotBas80 MOV SI,DI ; Point back to program start ; SI=>, DI=> ; INC SI ; SI=> .LoadLoop INC SI:INC SI ; SI=> MOV AL,[SI]:MOV [DI],AL ; Transfer DEC SI:MOV BL,[SI] ; Get DEC SI:MOV AL,[SI] ; Get INC DI:MOV [DI],BL ; Transfer INC DI:MOV [DI],AL ; Transfer INC AL:AND AL,AL ; Is =&FF, end of program? JZ LoadEnd ; ; Need to check overflow past top of memory ; INC SI:INC SI:INC SI ; SI=> DEC DI:DEC DI ; DI=> ; .LoadLineSpc ; Strip leading spaces MOV AL,[SI] ; Get character from line CMP AL,32 ; Is it a space JNZ LoadLineText ; Not a space, copy rest of line DEC BYTE PTR [DI] ; Decrease stored line length INC SI ; Point to next character JP LoadLineSpc ; Loop for whole line .LoadLineText INC DI:INC DI:INC DI ; DI=> .LoadTextLoop MOV AL,[SI]:MOV [DI],AL ; Copy a byte INC SI:INC DI ; Increment pointers CMP AL,13 JNZ LoadTextLoop ; Loop until at end of line ; SI=>+1, DI=>+1 JP LoadLoop ; Loop to do next line .LoadOk1 RETF ; .LoadEnd MOV BYTE PTR [DI],&FF:DEC DI MOV BYTE PTR [DI],&FF:DEC DI MOV BYTE PTR [DI],0 ; Insert Bas80 end marker .LoadOk RETF ]NEXT The following have been implemented =================================== TRACE STEP ON|OFF (v5.91a) -------------------------- TRACE STEP ON is the equivalent of @flags%OR=1 and TRACE STEP OFF the equivalent of @flags%AND=-2. SOUND ON -------- SOUND OFF exists, but not its complement SOUND ON. Actually a documentation error. SOUND ON does exist. *SAVE name start +length|end ---------------------------- Low priority, not essential, but would be useful, if *SAVE could ignore any additional parameters after the length/end address, so '*SAVE name start end exec load' would just ignore the 'exec load' parameters. In going through checking my programs I've found that almost the only change a lot have needed is changing just, eg: OSCLI "SAVE "+fn$+" "STR$~start%+" "+STR$~end+" 0 FFFFFD00" Another one to put under 'aiding porting'. BBFW editor ----------- When searching comes to the bottom of the document allow to continue searching from the top. Allow (possibly configurably) Del-> to join this line to the next line.