├── bsrom ├── README.md └── doc │ ├── whatsnew140-en.txt │ ├── whatsnew140-sk.txt │ ├── bsrom118-en.txt │ ├── bsrom118-sk.txt │ ├── bsrom140-en.txt │ └── bsrom140-sk.txt ├── README.md ├── LICENSE.md └── zx-spectrum-sysvars.asm /bsrom/README.md: -------------------------------------------------------------------------------- 1 | # BSROM 2 | An assembly file listing to generate a 16K ZX Spectrum ROM modified by Busy. Syntax is for SjASMPlus. 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ZX Spectrum ROM 2 | 3 | An assembly file listing to generate a 16K ROM for the ZX Spectrum. Syntax is for SjASMPlus. 4 | 5 | The ZX Spectrum ROM code remain the copyright of Amstrad plc. See LICENSE.md for details. 6 | -------------------------------------------------------------------------------- /bsrom/doc/whatsnew140-en.txt: -------------------------------------------------------------------------------- 1 | Changes 118 -> 140 2 | ~~~~~~~~~~~~~~~~~~ 3 | + Fixed bug of INT x, where x=-65536.9 to -65535.1 4 | + Fixed bug of addition (-65535-1 is now -65536) 5 | + Fixed bug of multiplication (bad jump in routine) 6 | + Fixed bug of double store of string in SCREEN$ 7 | 8 | + Command '*' - header: '?' replaced by '_' (code 30) 9 | + Autolisting - control codes: '?' replaced by '_' too 10 | + New start-up colors after resets and NEW: BORDER 1:PAPER 0:INK 7 11 | + Better handler for 'Scroll ?' in displaying mg. headers 12 | - Hexadecimal numbers only after character '%' (& is removed) 13 | + You can write negative number in commands what need 8-bit value 14 | + Some OUTs in NMI menu is corrected 15 | 16 | + MG. commands with optional string parameter (name of program) 17 | + New feature in function CHR$ (it can return whole memory as string) 18 | + Command POKE with enhacement syntax (you can write more parameters) 19 | -------------------------------------------------------------------------------- /bsrom/doc/whatsnew140-sk.txt: -------------------------------------------------------------------------------- 1 | Zmeny 118 -> 140 2 | ~~~~~~~~~~~~~~~~ 3 | + Opravena chyba INT x, kde x=-65536.9 az -65535.1 4 | + Opravena chyba scitania (-65535-1 uz je -65536) 5 | + Opravena chyba nasobenia (chybny skok v rutinke) 6 | + Opravena chyba dvojiteho ukladania retazca v SCREEN$ 7 | 8 | + Prikaz "*" - header: namiesto "?" vypisuje novy znak ciarku 9 | + Autolist - namiesto kodov vypisuje tiez ciarku (pri POKE 23728,6) 10 | + Nove startovacie farby po resetoch a NEWe: BORDER 1:PAPER 0:INK 7 11 | + Lepsie osetreny "Scroll ?" pri vypise magnetofonovej hlavicky 12 | - Hexadecimalne cisla sa uz pisu len po znaku '%' (& je zruseny) 13 | + V prikazoch kde sa pise jednobajtove cislo, mozno napisat aj zaporne. 14 | + Skorigovane niektore adresy a OUTy v NMI menu 15 | 16 | + Magnetofonove prikazy s nepovinnym menom suboru 17 | + Nova funkcia CHR$ (pri zapornom parametri vrati celu pamet) 18 | + Prikaz POKE s celkom novou rozsirenou syntaxou (viac parametrov naraz) 19 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | ### Copyright (c) Amstrad plc. All rights reserved. 2 | 3 | * Forum: comp.sys.sinclair 4 | * Thread: Amstrad ROM permissions 5 | * Message 1 of 1 6 | 7 | - Subject: Amstrad ROM permissions 8 | - Date: 08/31/1999 9 | - Author: Cliff Lawson 10 | 11 | Hi, 12 | 13 | Andrew Owen sent me the following email about the Spectrum ROMs and said it was being discussed on c.s.s but I can't see the 14 | relevant thread (I have a totally crap newsfeed - Psinet - who only carry about half the traffic!!). So, anyway, here's my reply about 15 | these issues: 16 | 17 | "I know you have answered the question of Amstrad's policy on the use of the Spectrum ROMs before but the debate has come up 18 | again on comp.sys.sinclair and as much as I tell people what I believe it is, they want a definitive answer. So when you have time here 19 | are the questions. Thanks!" 20 | 21 | ### 1) "What exactly do you have to do to use Sinclair ROMs in an emulator, such as acknowledgements etc?" 22 | 23 | Amstrad are happy for emulator writers to include images of our copyrighted code as long as the (c)opyright messages are not altered 24 | and we appreciate it if the program/manual includes a note to the effect that "Amstrad have kindly given their permission for the 25 | redistribution of their copyrighted material but retain that copyright". 26 | 27 | ### 2) "Can you charge a shareware fee for an emulator that uses the Sinclair ROMs?" 28 | 29 | No. No one should be charging for the ROM code because (as a result of the point above) there are loads of freely available images 30 | anyway. If I ever thought someone was charging for the ROM images then I'd make them available as a free download on the 31 | www.amstrad.com web site. Naturally I imagine that some emulator writers want to charge a shareware fee for the code they have 32 | written and we have absolutely no problem with that as long as they aren't, in any sense, charging for the parts of the code that are 33 | (c)Amstrad and (c) Sinclair. 34 | 35 | ### 3) "Can you modify the ROMs, for instance to enable tape loading and saving, and if so what are the requirements?" 36 | 37 | The ROM code is simply a tool to let the emulator writers make a program that works as close to the original machine as possible. If 38 | they choose to modify the behaviour in any way then that's entirely up to them (I guess you could say that that is exactly what an 39 | emulator IS doing (ie modifying the screen output and keyboard input to go via the PC bits)!!) 40 | 41 | ### 4) "Can you distribute modified ROMs?" 42 | 43 | If you like (with that (c) proviso). 44 | 45 | ### 5) "Does this apply to all ROMs, Interface 1+2, ZX80, ZX81, Spectrum 48, 128, +2, +2A and +3." 46 | 47 | I think Amstrad only bought the rights to Spectrum 48/128 from Sinclair and then produced the + machines ourselves. I do not believe 48 | the (c) for ZXs or IF1/2 has anything to do with Amstrad. 49 | 50 | ### 6) "Does Amstrad own the rights to the QL as well?" 51 | 52 | Someone asked me this before and I think our lawyer at that time said that we may have had the rights to the QL stuff but then sold it 53 | on to someone else but I haven't a clue who. 54 | 55 | ### 7) "What is the legal position with regard to distributing ROMs from legal Spectrum clones such as the Timex 2048?" 56 | 57 | Ask Timex. We only hold the copyright for code that was written by Sinclair or Amstrad for the Spectrum machines. I haven't a clue 58 | about the Timex deal as it was done in the days before Amstrad were ever involved. 59 | 60 | ### 8) "What is the legal position with regard to distributing ROMs from illegal Spectrum clones such as the Russian Scorpion and Pentagon machines?" 61 | 62 | Anyone pirating hardware/software should be shot.... though that may be to quick a death for them. Perhaps nailing them up by the 63 | testicles using rusty nails would be the best thing to do to them? 64 | 65 | ### 9) "Is Amstrad happy for software owned by Sinclair to be distributed in a similar way?" 66 | 67 | I think that the majority of software, even that 10/12 game pack bundled with + machines remains the copyrighted property of its 68 | authors (Ocean etc.). Amstrad/Sincliar merely acted as a publishing house but I don't think that gave us the copyright to it, just an 69 | agreed licence to make copies IYSWIM. 70 | 71 | ### 10) "What is Amstrad's policy on the distribution of electronic versions of Sinclair documentation?" 72 | 73 | The more the merrier. People scanning, OCRing, HTMLing & PDFing any manuals that are genuinely (c)Amstrad are actually doing 74 | us a favour because if someone asks for a copy we can just point them at a URL (please keep me informed!! ;-). So we'd welcome as 75 | many of them to be put online as possible if people can take out the time and trouble to do it. 76 | 77 | "I sincerly hope this is the last time you will be bothered with such questions. Thank you again for your time." 78 | 79 | Your welcome. It's good to have the opportunity to make our position on this clear and I've cross-posted this to c.s.a.8 because it 80 | applies equally well to all the CPC stuff (though some bits of that are also (c)Locomotive so you need to seek their permission too - 81 | however I don't think there's ever a problem in so doing). 82 | 83 | Cliff Lawson, 84 | Amstrad plc 85 | -------------------------------------------------------------------------------- /zx-spectrum-sysvars.asm: -------------------------------------------------------------------------------- 1 | ;********************************** 2 | ;** ZX SPECTRUM SYSTEM VARIABLES ** 3 | ;********************************** 4 | 5 | KSTATE_0 equ $5C00 ; 23552 ; (IY+$C6) ; Used in reading the keyboard. 6 | KSTATE_4 equ $5C04 ; 23556 ; (IY+$CA) 7 | LASTK equ $5C08 ; 23560 ; (IY+$CE) ; Stores newly pressed key. 8 | REPDEL equ $5C09 ; 23561 ; (IY+$CF) ; Time (in 50ths of a second in 60ths of a second in N. America) that a key must be held down before it repeats. This starts off at 35, but you can POKE in other values. 9 | REPPER equ $5C0A ; 23562 ; (IY+$D0) ; Delay (in 50ths of a second in 60ths of a second in N. America) between successive repeats of a key held down: initially 5. 10 | DEFADD equ $5C0B ; 23563 ; (IY+$D1) ; Address of arguments of user defined function if one is being evaluated; otherwise 0. 11 | KDATA equ $5C0D ; 23565 ; (IY+$D3) ; Stores 2nd byte of colour controls entered from keyboard . 12 | TVDATA_LO equ $5C0E ; 23566 ; (IY+$D4) ; Stores bytes of colour, AT and TAB controls going to television. 13 | TVDATA_HI equ $5C0F ; 23567 ; (IY+$D5) 14 | STRMS_FD equ $5C10 ; 23568 ; (IY+$D6) ; Addresses of channels attached to streams. 15 | STRMS_00 equ $5C16 ; 23574 ; (IY+$DC) 16 | CHARS equ $5C36 ; 23606 ; (IY+$FC) ; 256 less than address of character set (which starts with space and carries on to the copyright symbol). Normally in ROM, but you can set up your own in RAM and make CHARS point to it. 17 | RASP_PIP equ $5C38 ; 23608 ; (IY+$FE) ; Length of warning buzz. 18 | ERR_NR equ $5C3A ; 23610 ; (IY+$00) ; 1 less than the report code. Starts off at 255 (for 1) so PEEK 23610 gives 255. 19 | FLAGS equ $5C3B ; 23611 ; (IY+$01) ; Various flags to control the BASIC system. See * 20 | TV_FLAG equ $5C3C ; 23612 ; (IY+$02) ; Flags associated with the television. See ** 21 | ERR_SP equ $5C3D ; 23613 ; (IY+$03) ; Address of item on machine stack to be used as error return. 22 | LIST_SP equ $5C3F ; 23615 ; (IY+$05) ; Address of return address from automatic listing. 23 | MODE equ $5C41 ; 23617 ; (IY+$07) ; Specifies K, L, C. E or G cursor. 24 | NEWPPC equ $5C42 ; 23618 ; (IY+$08) ; Line to be jumped to. 25 | NSPPC equ $5C44 ; 23620 ; (IY+$0A) ; Statement number in line to be jumped to. Poking first NEWPPC and then NSPPC forces a jump to a specified statement in a line. 26 | PPC equ $5C45 ; 23621 ; (IY+$0B) ; Line number of statement currently being executed. 27 | SUBPPC equ $5C47 ; 23623 ; (IY+$0D) ; Number within line of statement being executed. 28 | BORDCR equ $5C48 ; 23624 ; (IY+$0E) ; Border colour * 8; also contains the attributes normally used for the lower half of the screen. 29 | E_PPC equ $5C49 ; 23625 ; (IY+$0F) ; Number of current line (with program cursor). 30 | E_PPC_HI equ $5C4A ; 23626 ; (IY+$10) 31 | VARS equ $5C4B ; 23627 ; (IY+$11) ; Address of variables. 32 | DEST equ $5C4D ; 23629 ; (IY+$13) ; Address of variable in assignment. 33 | CHANS equ $5C4F ; 23631 ; (IY+$15) ; Address of channel data. 34 | CURCHL equ $5C51 ; 23633 ; (IY+$17) ; Address of information currently being used for input and output. 35 | PROG equ $5C53 ; 23635 ; (IY+$19) ; Address of BASIC program. 36 | NXTLIN equ $5C55 ; 23637 ; (IY+$1B) ; Address of next line in program. 37 | DATADD equ $5C57 ; 23639 ; (IY+$1D) ; Address of terminator of last DATA item. 38 | E_LINE equ $5C59 ; 23641 ; (IY+$1F) ; Address of command being typed in. 39 | K_CUR equ $5C5B ; 23643 ; (IY+$21) ; Address of cursor. 40 | CH_ADD equ $5C5D ; 23645 ; (IY+$23) ; Address of the next character to be interpreted: the character after the argument of PEEK, or the NEWLINE at the end of a POKE statement. 41 | X_PTR equ $5C5F ; 23647 ; (IY+$25) ; Address of the character after the ? marker. 42 | WORKSP equ $5C61 ; 23649 ; (IY+$27) ; Address of temporary work space. 43 | STKBOT equ $5C63 ; 23651 ; (IY+$29) ; Address of bottom of calculator stack. 44 | STKEND equ $5C65 ; 23653 ; (IY+$2B) ; Address of start of spare space. 45 | STKEND_HI equ $5C66 ; 23654 ; (IY+$2C) 46 | BREG equ $5C67 ; 23655 ; (IY+$2D) ; Calculator's b register. 47 | MEM equ $5C68 ; 23656 ; (IY+$2E) ; Address of area used for calculator's memory. (Usually MEMBOT, but not always.) 48 | FLAGS2 equ $5C6A ; 23658 ; (IY+$30) ; More flags. See *** 49 | DF_SZ equ $5C6B ; 23659 ; (IY+$31) ; The number of lines (including one blank line) in the lower part of the screen. 50 | S_TOP equ $5C6C ; 23660 ; (IY+$32) ; The number of the top program line in automatic listings. 51 | OLDPPC equ $5C6E ; 23662 ; (IY+$34) ; Line number to which CONTINUE jumps. 52 | OSPPC equ $5C70 ; 23664 ; (IY+$36) ; Number within line of statement to which CONTINUE jumps. 53 | FLAGX equ $5C71 ; 23665 ; (IY+$37) ; Various flags. See **** 54 | STRLEN equ $5C72 ; 23666 ; (IY+$38) ; Length of string type destination in assignment. 55 | T_ADDR equ $5C74 ; 23668 ; (IY+$3A) ; Address of next item in syntax table (very unlikely to be useful). 56 | SEED equ $5C76 ; 23670 ; (IY+$3C) ; The seed for RND. This is the variable that is set by RANDOMIZE. 57 | FRAMES1 equ $5C78 ; 23672 ; (IY+$3E) ; 3 byte (least significant first), frame counter. Incremented every 20ms. 58 | UDG equ $5C7B ; 23675 ; (IY+$41) ; Address of 1st user defined graphic You can change this for instance to save space by having fewer user defined graphics. 59 | COORDS equ $5C7D ; 23677 ; (IY+$43) ; x-coordinate of last point plotted. 60 | COORDS_Y equ $5C7E ; 23678 ; (IY+$44) ; y-coordinate of last point plotted. 61 | PR_CC equ $5C80 ; 23680 ; (IY+$46) ; Full address of next position for LPRINT to print at (in ZX printer buffer). Legal values $5B00 - $5B1F. [Not used in 128K mode or when certain peripherals are attached] 62 | ECHO_E equ $5C82 ; 23682 ; (IY+$48) ; 33 column number and 24 line number (in lower half) of end of input buffer. 63 | DF_CC equ $5C84 ; 23684 ; (IY+$4A) ; Address in display file of PRINT position. 64 | DFCCL equ $5C86 ; 23686 ; (IY+$4C) ; Like DF_CC for lower part of screen. 65 | S_POSN equ $5C88 ; 23688 ; (IY+$4E) ; 33 column number for PRINT position 66 | S_POSN_HI equ $5C89 ; 23689 ; (IY+$4F) ; 24 line number for PRINT position. 67 | SPOSNL equ $5C8A ; 23690 ; (IY+$50) ; Like S_POSN for lower part 68 | SPOSNL_HI equ $5C8B ; 23691 ; (IY+$51) 69 | SCR_CT equ $5C8C ; 23692 ; (IY+$52) ; Counts scrolls: it is always 1 more than the number of scrolls that will be done before stopping with scroll? If you keep poking this with a number bigger than 1 (say 255), the screen will scroll on and on without asking you. 70 | ATTRP_MASKP equ $5C8D ; 23693 ; (IY+$53) ; Permanent current colours, etc (as set up by colour statements). 71 | ATTRT_MASKT equ $5C8F ; 23695 ; (IY+$55) ; Temporary current colours, etc (as set up by colour items). 72 | MASK_T equ $5C90 ; 23696 ; (IY+$56) ; Like MASK_P, but temporary. 73 | P_FLAG equ $5C91 ; 23697 ; (IY+$57) ; More flags. 74 | MEM_0 equ $5C92 ; 23698 ; (IY+$58) ; Calculator's memory area; used to store numbers that cannot conveniently be put on the calculator stack. 75 | MEM_3 equ $5CA1 ; 23713 ; (IY+$67) 76 | MEM_4 equ $5CA6 ; 23718 ; (IY+$6C) 77 | MEM_4_4 equ $5CAA ; 23722 ; (IY+$70) 78 | MEM_5_0 equ $5CAB ; 23723 ; (IY+$71) 79 | MEM_5_1 equ $5CAC ; 23724 ; (IY+$72) 80 | NMIADD equ $5CB0 ; 23728 ; (IY+$76) ; This is the address of a user supplied NMI address which is read by the standard ROM when a peripheral activates the NMI. Probably intentionally disabled so that the effect is to perform a reset if both locations hold zero, but do nothing if the locations hold a non-zero value. Interface 1's with serial number greater than 87315 will initialize these locations to 0 and 80 to allow the RS232 "T" channel to use a variable line width. 23728 is the current print position and 23729 the width - default 80. 81 | RAMTOP equ $5CB2 ; 23730 ; (IY+$78) ; Address of last byte of BASIC system area. 82 | P_RAMT equ $5CB4 ; 23732 ; (IY+$7A) ; Address of last byte of physical RAM. 83 | 84 | ; * 85 | ; FLAGS equ $5C3B ; 23611 ; (IY+$01) ; BASIC flags, particular bits meaning: 86 | ; ; 0 ... 1 = supress leading space for tokens 87 | ; ; 1 ... 1 = listing to ZX Printer 88 | ; ; 2 ... 1 = listing in mode 'L', 0 = listing in mode 'K' 89 | ; ; 3 ... 1 = keyboard mode 'L', 0 = keyboard mode 'K' 90 | ; ; 4 ... 48k: unused, 128k: 0 = basic48, 1 = basic128 91 | ; ; 5 ... 1= new key was pressed on 92 | ; ; 6 ... 1= numeric result of the operation, 0=string result of the operation (SCANN is set) 93 | ; ; 7 ... 1= syntax checking off, 0=syntax checking on 94 | ; 95 | ; ** 96 | ; TV_FLAG equ $5C3C ; 23612 ; (IY+$02) ; PRINT routine flags, particular bits meaning: 97 | ; ; 0 ... 1=lower part of screen 98 | ; ; 3 ... 1=mode change in EDIT 99 | ; ; 4 ... 1=Autolist 100 | ; ; 5 ... 1=screen is clear 101 | ; 102 | ; *** 103 | ; FLAGS2 equ $5C6A ; 23658 ; (IY+$30) ; BASIC flags, particular bits meaning: 104 | ; ; 0 ... 1=screen is clear 105 | ; ; 1 ... 1=ZX Printeru buffer is not empty 106 | ; ; 2 ... 1=quotation mode during string processing 107 | ; ; 3 ... 1=caps lock 108 | ; ; 4 ... 1=channel 'K' 109 | ; ; 5 ... 1=new key was pressed on 110 | ; ; 6 ... unused 111 | ; ; 7 ... unused 112 | ; 113 | ; **** 114 | ; FLAGX equ $5C71 ; 23665 ; (IY+$37) ; BASIC flags, particular bits meaning: 115 | ; ; 0 ... 1=remove string from variable before new string assign 116 | ; ; 1 ... 1=create variable at LET, 0=variable already exists 117 | ; ; 5 ... 1=INPUT mode, 0=EDIT BASIC line 118 | ; ; 6 ... 1=numeric variable in INPUT, 0=string variable in INPUT mode 119 | ; ; 7 ... 1=input line 120 | -------------------------------------------------------------------------------- /bsrom/doc/bsrom118-en.txt: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # BSrom118 - Modified ZX Spectrum ROM - (c) Busy soft - Release 13.03.94 # 3 | ########################################################################## 4 | Original rom: (c) Amstrad 5 | 6 | 7 | Generally 8 | ========= 9 | 10 | It's classic ZX Spectrum 48k (+) ROM with this modifications: 11 | - some new commands - see below 12 | - additional syntax of some commands - see below 13 | - cca four times more speed of pilot signal synchronize from tape 14 | - program cursor changed from ">" to "*" (for autolisting) 15 | - increase frequency of error beep (RASP) 16 | - full work with 16-bit hexadecimal numbers in range 0-65535 17 | - more speed autorepeat after initialization (new,reset) 18 | - enter of error line caused move of cursor into error position 19 | - option for list by ingore control codes (for colors,at,tab) 20 | - extendable NMI handle program - see below 21 | - corrected some errors - see below 22 | - two new characters - small underline and square (code 30,31) 23 | - program cursor "*" displayed only on autolist 24 | - full movement on edit area (left,rigth,up,down) 25 | - more more more more speed reset and new (memory clears by push) 26 | - stopable autolist by the "Q" key in all moment 27 | - some enhancements for ZX Spectrum 128k 28 | - line number range 0-16383 (original rom was 1-9999) 29 | (You can correctly edit and enter line with number zero!) 30 | 31 | Corrected errors 32 | ================ 33 | 34 | - Error in original NMI handle routine. But error byte is not modified 35 | [if some programs will test it]. There new NMI menu handles it now. 36 | - PRINT AT 0,0;CHR$ 8; moves cursor into position AT -1,31 37 | There position of cursor is not changed by CHR$ 8 in this rom. 38 | - Display of error message if interrupt is disabled. There 39 | interrupt is enabled before displaiyng error message in this rom. 40 | - Original rom writes five bytes into address range 0-4. 41 | There range address 0-4 is not changed in this rom. This feature 42 | is useful for not disabled write access into RAM address 0-#3FFF. 43 | - If last line in basic program is N, you enter empty line N+1 and 44 | press EDIT key, then line N is edited into edit area WITH program 45 | cursor. There program cursor is not transfer into edit area in this rom. 46 | 47 | 48 | Initialization (reset,new) 49 | ========================== 50 | 51 | After start is system report no classic message. There is displayed 52 | information about length of basic, variables and free memory. 53 | 48k and 128k reset do not test memory. I think damaged memory is past... 54 | 55 | 56 | Extendable NMI handler 57 | ====================== 58 | 59 | RESET and NMI signals causes jump into address #00 and #66 and this event 60 | is indicated by snowing on red border. If SP was in range 0-#4000 then is 61 | set to #5800 value. Control keys: 62 | 63 | B - warm start of basic system. All variables are inicialized 64 | but PROG, VARS and ELINE was not changed. It causes that 65 | basic program with variables is not deleted. 66 | N - the same as CLEAR #5FFF: NEW - memory above #6000 is not changed. 67 | R - the same as CLEAR #FFFF: NEW - classic 48k reset. 68 | E - extended 128k reset. It clears all 128k memory on Spectrum 128k 69 | I - sets AY to quiet and on MB-02 resets FDC,DMA and stops disk drive 70 | S - save "" screen$ on tape (on MB-02 can save on disk) 71 | T - like USR 15522 - set tape as actual device (only on MB-02) 72 | D - like USR 15524 - set disk as actual devide (only on MB-02) 73 | Q - return into broken program. Warning: return will be 74 | correct only if SP was not set to #5800! All registers 75 | (beside low 7 bit of refresh) are restored to original values. 76 | M - jump into MRS 08/09 debugger. MRS must be loaded into memory. 77 | All registers on register panel will be set to values from 78 | broken program - you can continue broken program by using 79 | any trace mode of MRS debugger. Warning: This feature will 80 | works only if SP was not set to #5800 (like as Q-quit). 81 | 0..9 - switching of RAM banks on ZX Spectrum 128k. If SP is 82 | in range #C000-#FFFF then it will be set to #5800. 83 | This is the same as OUT (#7FFD),number - you can see 84 | second videoram by pressing 8 or 9 key. 85 | U - user function. There are JP XXXX at address #3901. You can 86 | set address of this jump to you own routine. Your routine 87 | can end with ret - it causes return into NMI handler. 88 | Z - user function like 'U' but this key is reserved for using 89 | in MB-02 applications (for example make snapshots,...) 90 | However, if you want use this key, place address 91 | of you routine into address #3904. 92 | 93 | 94 | Additional syntax of old commands 95 | ================================= 96 | 97 | Legend: num ...... any expresion with number result 98 | string ... any expresion with string result 99 | Items in brackets < > are optional. 100 | 101 | CONTINUE ... if num is nonzero then run machine code from this 102 | address. Different from USR is if machine code returns (very seldom 103 | event:)) IY must be set to #5C3A but HL' can be different #2758. 104 | CLS ... if num is nonzero then all attributes and border is set to 105 | num. For example: CLS 7 = BORDER 0: PAPER 0: INK 7: BRIGHT 0: FLASH 0. 106 | GOTO, GOSUB, PAUSE, BORDER ... numer parameter of this commands is 107 | optional, not compulsatory. If parameter not present, means zero value. 108 | list of items ... Yes, it means that PRINT command is optional ! 109 | If list of items is not beginning with characters , ; ' then you 110 | may not write PRINT command in your program :) 111 | POKE add,byte ... classic original poke (use comma) 112 | POKE add;word ... stores 16-bit number into address add (use semicolon) 113 | POKE add,string ... stores string into address add (use comma) - first 114 | character into address add, second into add+1, third into add+2...etc. 115 | VAL num ... 16-bit PEEK. Returns 16-bit word from address num. 116 | This function is opposition to 'POKE add;word' command. 117 | VAL$ num ... If parameter is number type then result of this function 118 | is four character string contains hexadecimal digits of this number. 119 | This is very useful for convert number into hexadecimal base. 120 | %,& ... prefix characters for writing hexadecimal numbers. 121 | The same as BIN for writing binary number. Number must be max 16-bit. 122 | 123 | 124 | New commands and its syntax 125 | =========================== 126 | 127 | , ... comma ... edit of basic line num. 128 | ' ... apostrophe ... switching of RAM banks on ZX Spectrum 128k. 129 | The same as OUT #7FFD,num. (Be sure that RAMTOP is under #C000!) 130 |  ... 'C' in circle ... the same as 'B' in NMI handler. 131 | Inicialize all system variables besides PROG, VARS and ELINE. 132 | ^ ... up arrow ... the same as E in NMI handler. Clears all 128k memory. 133 | ? ... displays information about length of basic, variables and free 134 | memory. This command is called internally after each reset or new. 135 | * ... header ... displays header information from tape in following format: 136 | type of file : name of file : address : length 137 | _ .. the same as USR 00102 - jump into NMI handler ('Q' continues) 138 | # .. the same as USR 54885 - jump into MRS 08/09 (MRS must be loaded) 139 | 140 | 141 | One new system variable 142 | ======================= 143 | 144 | NMI handler does not need vector at address 23728. 145 | This address is used for storing three bits with following meaning: 146 | 147 | bit 0=0: number of basic lines is displayed with four digits 148 | bit 0=1: number of basic lines is displayed with five digits 149 | bit 1=0: control codes in autolist is displayed normally 150 | bit 1=0: control codes in autolist is displayed by bit 2 151 | bit 2=0: do not display control codes in autolist 152 | bit 2=1: display all control codes as "?" character 153 | 154 | This variable is initialized to zero value after reset or new. 155 | 156 | Five digits displaying of basic numbers is very useful 157 | if you use line range 0 to 16383. This feature has no 158 | effect to running of basic program. If you edit any basic 159 | line then this line is edited with five digit numbers always. 160 | If number is under 10000 then it's space blanked from left. 161 | 162 | ---------------------- 163 | 164 | There is a little free space on address #3C98-#3CEF in this rom. 165 | The space is reserved for MB-02 extensions. If you have no MB-02 166 | then you can use the space for some your routines as you want. 167 | 168 | =========================================================================== 169 | Address of author: E-mail: busy@elf.stuba.sk 170 | Slavko Labsky http://www.elf.stuba.sk/~busy 171 | Gallayova 13 172 | 841 02 Bratislava Telephone: 173 | Slovak republic (07) 764 705 (only in slovak!) 174 | =========================================================================== 175 | -------------------------------------------------------------------------------- /bsrom/doc/bsrom118-sk.txt: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # BSrom118 - Modifikovana ZX Spectrum ROM - (c) Busy soft - Release 13.03.94 # 3 | ############################################################################## 4 | Originalna romka: (c) Amstrad 5 | (Ak nemate diakritiku Kamenickych, 6 | skuste spustit program setkam.com) 7 | 8 | Vseobecne 9 | --------- 10 | Jedna sa o klasicku romku zo ZX Spectra 48k (+) na ktorej boli 11 | spachane tieto upravy: 12 | 13 | - pribudlo zopar novych prikazov - prehlad dalej 14 | - rozsirena syntax niektorych prikazov - prehlad dalej 15 | - asi stvornasobne rychle chytanie uvodneho tonu z kazetaku 16 | - programovy kurzor zmeneny zo znaku ">" na znak "*" 17 | - zvysena frekvencia chyboveho beepu 18 | - spracovanie hexadecimalnych cisel v rozsahu 0-65535 19 | - moznost pisania basicovych riadkov v rozsahu 0-16383 20 | (mozete normalne editovat a odosielat aj nulty riadok!) 21 | - rychlejsi autorepeat na zaciatku po inicializacii 22 | - pri pokuse o odoslanie chybneho prikazu alebo riadku skoci 23 | kurzor na miesto chyby (lepsie ako v IZO-ROM) 24 | - moznost vypisovat listing programu bez riadiacich kodov 25 | (nereaguje na farby, TAB a AT - vhodne na zasite programy) 26 | - osetrenie NMI pomocou rozsiritelneho menu - prehlad dalej 27 | - opravene niektore chyby - prehlad dalej 28 | - dva nove znaky v znakovom subore - maly podciarnik a stvorcek 29 | - programovy kurzor "*" sa vypisuje iba pri autoliste 30 | - po editacnej zone sa da chodit hore a dolu 31 | - reset a new mazu pamet pomocou PUSH - je to super rychle 32 | - autolist mozno v kazdom okamihu zastavit klavesou "Q" 33 | - niekolko vymozenosti pre uzivatelov ZX Spektra 128k 34 | 35 | 36 | Prehlad chyb, ktore boli opravene 37 | --------------------------------- 38 | - Chybne osetenie NMI rutiny - vyriesilo to NMI menu. Ale 39 | prislusny bajt zostal nezmeneny - to keby ho nahodou 40 | nejaky program moc usilovne zacal skumat a testovat. 41 | - PRINT AT 0,0;CHR$ 8; - posunulo kurzor na poziciu AT -1,31 - 42 | v tejto romke sa poloha kurzora nemeni. 43 | - Ak sa malo vypisat chybove hlasenie a je zakazane prerusenie, 44 | tak to zmrzlo. V tejto romke sa to nemoze stat. 45 | - Normalna romka sama seba na adresach 0..4 prepisuje. Tato 46 | romka nie, preto moze bezat aj bez zakazaneho zapisu v ramke. 47 | - Ak je posledny riadok v programe N, vy odoslete prazdny 48 | riadok N+1 (akoze ho zmazete) a potom stlacite EDIT, editne 49 | sa vam N-ty riadok aj s programovym kurzorom. V tejto romke 50 | sa programovy kurzor objavuje iba autolistingu a preto sa 51 | nikdy nemoze objavit v editnutom riadku. 52 | 53 | Po starte alebo NEWe sa romka prihlasi vypisanim informacie, 54 | kolko je volneho miesta (basic a premenne basicu maju vtedy 55 | samozrejme nulovu dlzku) a vypise sa normalne hlasenie OK. 56 | 48k a 128k reset a ani NEW netestuju pamet - predpoklada sa, ze 57 | cela 48kB alebo 128k pamet je funkcna. 58 | 59 | Po resete alebo NMI (skoku na adresy #00 alebo #66) zacne srsat 60 | border, co je znakom ze ste v NMI menu. Ak by bol zasobnik SP na 61 | adresach #00-#4000, zmeni sa na #5800. Ovladacie klavesy: 62 | 63 | B - teply start basicu. Inicializuju sa vseky systemove 64 | premenne okrem PROG, VARS a ELINE - teda basicovy 65 | program a basicoe premenne zostanu zachovane. 66 | N - to iste ako CLEAR #5fff: NEW - teda pamet nad #6000 ostane 67 | neporusena. 68 | R - zmaze celu pamet 48kB - je to klasicky 48k reset. 69 | E - zmaze celu pamet 128k - (extend reset 128k) 70 | I - resetuje tieto periferie: AY, FDC, DMA a mechaniku disku. 71 | S - save "" screen$ na aktualne zariadenie (MG alebo disk) 72 | T - ako USR 15522 cize aktualne zariadenie bude paska. 73 | D - ako USR 15524 cize aktualne zariadenie bude disk. 74 | Q - navrat spet do preruseneho programu. Pozor: navrat bude 75 | korektny iba vtedy, ak SP nebol zmeneny na #5800. 76 | Pri navrate su vsetky registre (okrem dolnych 7 bitov 77 | registra R) obnovene na povodne hodnoty. 78 | M - skok do debuggera v MRS (musi byt v pameti!). 79 | Vsetky registre sa nastavia ako boli v okamihu prerusenia 80 | programu pomocou MNI - cize mozno preruseny program dalej 81 | krokovat (PC a SP sa korektne nastavia iba ak sa SP 82 | nezmenilo na #5800!). 83 | 0..9 - prepnutie ram-banky na 128k. Ak by sa SP nachadzal v 84 | oblasti hornych 16 kB, bude zmeneny na #5800. 85 | Je to vlastne OUT (#7ffd),cislo - cize pomocou 8 a 9 si 86 | mozno pozriet obsah druhej videostranky. 87 | U - uzivatelska funkcia - na adrese #3901 je JP XXX, kde si 88 | moze uzivatel napokovat adresu svojej aplikacie a po stlaceni 89 | klavesy "U" sa tato aplikacia spusti. Navrat je normalne pomocou 90 | RET. 91 | Z - uzivatelska funkcia - na adrese #3904 je DW xxx, a dalej 92 | presne tak isto ako "U". Tieto dve funkcie v samotnej romke 93 | nerobia nic, ale su vyhradene pre dalsie rozsirenia (napr. 94 | rezidentny monitor). 95 | 96 | 97 | Rozsirenie syntaxe existujucich prikazov 98 | ---------------------------------------- 99 | (Polozky v zatvorkach < > su nepovinne.) 100 | 101 | CONTINUE .. ak je vyraz nenulovy tak sa spusti strojak 102 | od tejto adresy. Pozor ! Pri navrate musi byt na rozdiel od 103 | USR register IY nastaveny na #5c3a, ale zato HL' nemusi mat 104 | hodnotu #2758. 105 | CLS .. ak vyraz je nenulovy tak sa nim nastavia vsetky 106 | farby (pr. CLS 7 = BORDER 0: PAPER 0:INK 7:BRIGHT 0:FLASH 0). 107 | GOTO, GOSUB, PAUSE, BORDER .. ciselny parameter pri tychto 108 | prikazoch je nepovinny - nezadany sa chape ako nula. 109 | zoznam poloziek .. Za predpokladu, ze zoznam poloziek 110 | nezacina cislicou, ciarkou, bodkociarku a apostrofom mozete 111 | pokojne vynechat prikaz PRINT. Totiz ak sa pri behu programu 112 | najde nieco, co nie je ziadny prikaz, skoci sa do rutinky na 113 | prikaz PRINT. 114 | POKE add,byte .. normalne povodne poke 115 | POKE add;word .. dvojbajtove poke (nizsi bajt sa uklada nizsie) 116 | POKE add,retazec .. ulozene daneho retazca do pameti. Prvy znak 117 | sa ulozi na adresu add, druhy na adresu add+1 ... atd. V 118 | principe nezalezi na tom, ci pri ukladani retazca v tomto 119 | prikaze napisete carku alebo bodkociarku, ale z dovodu 120 | mozneho rozsirenia v buducnosti sa odporuca pouzivat vyhradne 121 | iba ciarku. 122 | 123 | VAL$ .. ak je vyraz ciselneho typu, tak vysledkom tejto 124 | funkcie je stvorznakovy retazec hexadecimalnych cislic - inac 125 | povedane prevod DEC -> HEX (pr. VAL$ 33023 = "80ff"). 126 | VAL .. ak je vyraz ciselneho typu, tak vysledkom tejto 127 | funkcie je dvojbajtove cislo uvozene na tejto adrese - inac 128 | povedane dvojbajtovy PEEK. 129 | %,& .. prevod HEX -> DEC podobne ako je BIN prevod BIN -> DEC. 130 | Inac povedane ak chcete ako cislo zapisat hexadecimalnu 131 | konstantu, musi zacinat znakom "%" alebo "&". Znak "#" nebol 132 | pouzity preto, lebo ten sa pouziva na nastavenie kanala v 133 | prikazoch PRINT A INPUT (pr. %80ff = 33023). 134 | 135 | 136 | Nove prikazy a ich syntax 137 | ------------------------- 138 | , .. (ciarka) editne prislusny basicovy riadok. Ak 139 | vyraz nie je uvedeny alebo nadobuda nulovu hodnotu, 140 | edituje sa riadok s najnizsim poradovym cislom. 141 | ' .. (apostrof) prepina ram-banky na 128k ako OUT 142 | (#7ffd),vyraz. Vyraz musi byt v intervale 0 az 15. Pozor! 143 | Pri prepinani musi byt RAMTOP mensi ako #c000 (inac ako 144 | 0-9 v NMI menu). 145 |  .. obnovi vsetky systemove premenne okrem PROG, VARS a ELINE. 146 | (Ako "B" v NMI menu.) [C v kruzku] 147 | ^ .. velky 128k reset - maze celu pamet 128k. 148 | (Ako "E" v NMI menu.) [sipka hore] 149 | ? .. vypise informaciu o dlzke programu, dlzke premennych a 150 | velkost volnej pamete pre basic. 151 | * .. header - z pasky cita hlavicky a vypisuje o nich toto: 152 | typ suboru : meno suboru : adresa : dlzka 153 | _ .. to iste ako USR 00102 - skok do NMI menu. 154 | # .. to iste ako USR 54885 - skok do MRS (musi byt v pameti!). 155 | 156 | 157 | Jedna nova systemova premenna 158 | ----------------------------- 159 | Kedze NMI rutinka vzdy zavola NMI menu, nepotrebuje uz vektor 160 | na adrese 23728. Preto tri bity na 23728 su takto vyuzite: 161 | 162 | bit 0=0:cisla basicovych riadkov sa vypisuju ako stvormiestne 163 | bit 0=1:cisla basicovych riadkov sa vypisuju ako petmiestne 164 | bit 1=0:pri autoliste sa vypisuju riadiace kody normalne 165 | bit 1=1:pri autoliste sa vypisuju riadiace kody podla bitu 2 166 | bit 2=0:pri autoliste sa vobec nevypisuju riadiace kody 167 | bit 2=1:pri autoliste sa vypisuju riadiace kody ako "?" 168 | 169 | Po resete alebo newe sa tu zapise nula. Petmiestne cisla riadkov 170 | maju vyznam vtedy, ak pouzivate riadky v rozsahu 10000 az 16383. 171 | Tento bit nijako neovplyvnuje beh programu s takymito riadkami, 172 | len meni format listingu. Pri editovani riadku sa jeho cislo 173 | vypise vzdy ako petmiestne. 174 | 175 | ---------------------------- 176 | 177 | Na adresach #3C98-#3CEF sa nachadza kusok volneho miesta. 178 | Toto miesto je rezervovane pre pouzitie v MB-02. Ale ak nemate 179 | MB-02 tak si mozete toto miesto vyuzit pre svoje vlastne ucely. 180 | 181 | ================================================================== 182 | Adresa autora: E-mail: busy@elf.stuba.sk 183 | Slavko Labsky http://www.elf.stuba.sk/~busy 184 | Gallayova 13 185 | 841 02 Bratislava Telefon: 186 | Slovenska republika (07) 764 705 (len slovensky a cesky!) 187 | ================================================================== 188 | -------------------------------------------------------------------------------- /bsrom/doc/bsrom140-en.txt: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # BSrom140 - Modified ZX Spectrum ROM - (c) Busy soft - Release 22.04.97 # 3 | ########################################################################## 4 | Original ROM: (c) Amstrad 5 | 6 | 7 | Generally 8 | ========= 9 | 10 | It's classic ZX Spectrum ROM with this modifications: 11 | - some new commands and functions - see below 12 | - additional syntax of some commands and functions - see below 13 | - cca four times more speed of pilot signal synchronize from tape 14 | - program cursor changed from ">" to "*" (for autolisting) 15 | - increase frequency of error beep (RASP) 16 | - full work with 16-bit hexadecimal numbers in range 0-65535 17 | - more speed autorepeat after initialization (new,reset) 18 | - enter of error line caused move of cursor into error position 19 | - option for list by ingore control codes (for colors,at,tab) 20 | - extendable NMI handle program - see below 21 | - corrected some errors - see below 22 | - two new characters - small underline and square (code 30,31) 23 | - program cursor "*" displayed only on autolist 24 | - full movement on edit area (left,rigth,up,down) 25 | - more more more more speed reset and new (memory clears by PUSH) 26 | - new start-up colors after reset and new: paper 0, ink 7 27 | - stopable autolist by the "Q" key in all moment 28 | - some enhancements for ZX Spectrum 128k 29 | - You can write negative number in commands what needs 30 | 8-bit value. Real value will be your_negative_value + 256. 31 | - full work with line number range 0-16383 (original ROM was only 1-9999) 32 | (You can correctly edit and enter line with number zero!) 33 | 34 | 35 | Corrected errors 36 | ================ 37 | 38 | - Error in original NMI handle routine. But error byte is not modified 39 | [if some programs will test it]. There new NMI menu handles it now. 40 | - PRINT AT 0,0;CHR$ 8; moves cursor into position AT -1,31 41 | There position of cursor is not changed by CHR$ 8 in this ROM. 42 | - Display of error message if interrupt is disabled. There 43 | interrupt is enabled before displaiyng error message in this ROM. 44 | - Original ROM writes five bytes into address range 0-4. 45 | There range address 0-4 is not changed in this ROM. This feature 46 | is useful for not disabled write access into RAM address 0-#3FFF. 47 | - If success of addition or substraction of two integers is -65536 48 | then it failed. (Note: Integer range is -65535 .. +65535) 49 | - This is another similar bug: If x is in range -65537 .. -65535 50 | (open range) then INT x failed. This bug is fixed too. 51 | - If last line in basic program is N, you enter empty line N+1 and 52 | press EDIT key, then line N is edited into edit area WITH program 53 | cursor. There program cursor is not transfer into edit area in this ROM. 54 | 55 | It's good idea to run next program to demonstrate INT and -65536 bug: 56 | FOR a=-65538 TO -65533.9 STEP 0.25: PRINT a,INT a : NEXT a 57 | Try this program on classic ZX ROM and then on this bugfixed ROM. 58 | 59 | 60 | Initialization (reset,new) 61 | ========================== 62 | 63 | System report is not classic message after start. There is displayed 64 | information about length of basic, variables and free memory. 65 | 48k and 128k reset do not test memory. I think damaged memory is past... 66 | 67 | 68 | Extendable NMI handler 69 | ====================== 70 | 71 | RESET and NMI signals causes jump into address #00 and #66 and this event 72 | is indicated by snowing on black border. If SP was in range 0-#4000 then is 73 | set to #5800 value. Control keys: 74 | 75 | B - warm start of basic system. All variables are inicialized 76 | but PROG, VARS and ELINE was not changed. It causes that 77 | basic program with variables is not deleted. 78 | N - the same as CLEAR #5FFF: NEW - memory above #6000 is not changed. 79 | R - the same as CLEAR #FFFF: NEW - classic 48k reset. 80 | E - extended 128k reset. It clears all 128k memory on Spectrum 128k 81 | I - sets AY to quiet and on MB-02 resets FDC,DMA and stops disk drive 82 | S - save "" screen$ on tape (on MB-02 can save on disk) 83 | T - like USR 15522 - set tape as actual device (only on MB-02) 84 | D - like USR 15524 - set disk as actual device (only on MB-02) 85 | Q - return into broken program. Warning: return will be 86 | correct only if SP was not set to #5800! All registers 87 | (beside low 7 bit of refresh) are restored to original values. 88 | M - jump into MRS 08/09 debugger. MRS must be loaded into memory. 89 | All registers on register panel will be set to values from 90 | broken program - you can continue broken program by using 91 | any trace mode of MRS debugger. Warning: This feature will 92 | works only if SP was not set to #5800 (like as Q-quit). 93 | 0..9 - switching of RAM banks on ZX Spectrum 128k. If SP is 94 | in range #C000-#FFFF then it will be set to #5800. 95 | This is the same as OUT (#7FFD),number - you can see 96 | second videoram by pressing 8 or 9 key. 97 | U - user function. There are JP XXXX at address #3901. You can 98 | set address of this jump to you own routine. Your routine 99 | can end with ret - it causes return into NMI handler. 100 | Z - user function like 'U' but this key is reserved for using 101 | in MB-02 applications (for example make snapshots,...) 102 | However, if you want use this key, place address 103 | of you routine into address #3904. 104 | 105 | 106 | Additional syntax of old commands 107 | ================================= 108 | 109 | Legend: num ...... any expresion with number result 110 | string ... any expresion with string result 111 | Items in brackets < > are optional. 112 | 113 | CONTINUE ... if num is nonzero then run machine code from this 114 | address. Different from USR is if machine code returns (very seldom 115 | event:)) IY must be set to #5C3A but HL' can be different #2758. 116 | CLS ... if num is nonzero then all attributes and border is set to 117 | num. For example: CLS 7 = BORDER 0: PAPER 0: INK 7: BRIGHT 0: FLASH 0. 118 | GOTO, GOSUB, PAUSE, BORDER ... numer parameter of this commands is 119 | optional, not compulsatory. If parameter not present, means zero value. 120 | LOAD, SAVE, VERIFY, MERGE ... string parameter of this commands is 121 | optional, not compulsatory. If parameter not present, means empty string. 122 | list of items ... Yes, it means that PRINT command is optional ! 123 | If list of items is not beginning with characters ,' (comma and apostrophe) 124 | then you must not write PRINT command in your program :) 125 | POKE address ... storing item(s) into memory. 126 | You can write how many items as you want. Each item may be: 127 | , 8-bit-num ... stores one byte (the same as classic POKE) 128 | ; 16-bit-num ... stores one word (two bytes, LSB first) 129 | , string ... stores string into memory 130 | ; string ... the same as above but last character has bit 7 = 1 131 | Example: POKE 16384,20;1025,"hello";"world" 132 | stores these bytes: 20, 1,4, 104,101,108,108,111, 119,111,114,108,228 133 | 134 | 135 | Enhaced functions 136 | ================= 137 | 138 | CHR$ num ... If num is 0..255 then this is classic CHR$. 139 | But if num = -1 then this function returns whole memory 140 | (without byte at add 0) as string with length 65535 bytes. 141 | VAL$ num ... If parameter is number type then result of this function 142 | is four character string contains hexadecimal digits of this number. 143 | This is very useful for convert number into hexadecimal base. 144 | VAL num ... 16-bit PEEK. Returns 16-bit word from address num. 145 | This function is opposite to 'POKE add;word' command. 146 | % ... prefix character for writing hexadecimal numbers. 147 | The same as BIN for writing binary number. Number must be max 16-bit. 148 | 149 | It's recomended to use function CHR$ with parameter -1 with command POKE 150 | together for work with memory blocks (or only CHR$ -1 for reading memory). 151 | For example LET a$=(CHR$ -1)(16384 TO 23295) saves screen into variable a$ 152 | and then you can do command POKE 16384,a$ to restore saved screen back. 153 | Because 'PEEK address' and 'CODE (CHR$ -1)(adresa)' are the same. 154 | 155 | 156 | New commands and its syntax 157 | =========================== 158 | 159 | , ... comma ... edit of basic line num. 160 | ' ... apostrophe ... switching of RAM banks on ZX Spectrum 128k. 161 | The same as OUT #7FFD,num. (Be sure that RAMTOP is under #C000!) 162 |  ... (c) ... the same as 'B' in NMI handler. 163 | Inicialize all system variables besides PROG, VARS and ELINE. 164 | ^ ... up arrow ... the same as E in NMI handler. Clears all 128k memory. 165 | ? ... displays information about length of basic, variables and free 166 | memory. This command is called internally after each reset or new. 167 | * ... header ... displays header information from tape in following format: 168 | type of file : name of file : address : length 169 | _ .. the same as USR 00102 - jump into NMI handler ('Q' continues) 170 | # .. the same as USR 54885 - jump into MRS 08/09 (MRS must be loaded) 171 | 172 | 173 | One new system variable 174 | ======================= 175 | 176 | NMI handler does not need vector at address 23728. 177 | This address is used for storing three bits with following meaning: 178 | 179 | bit 0=0: number of basic lines is displayed with four digits 180 | bit 0=1: number of basic lines is displayed with five digits 181 | bit 1=0: control codes in autolist is displayed normally 182 | bit 1=0: control codes in autolist is displayed by bit 2 183 | bit 2=0: do not display control codes in autolist 184 | bit 2=1: display all control codes as "_" character (code 30). 185 | 186 | This variable is initialized to zero value after reset or new. 187 | 188 | Five digits displaying of basic numbers is very useful 189 | if you use line range 0 to 16383. This feature has no 190 | effect to running of basic program. If you edit any basic 191 | line then this line is edited with five digit numbers always. 192 | If number is under 10000 then it's space blanked from left. 193 | 194 | ---------------------- 195 | 196 | There is a little free space on address #3C98-#3CEF in this ROM. 197 | The space is reserved for MB-02 extensions. If you have no MB-02 198 | then you can use the space for some your routines as you want. 199 | 200 | Thanx to this peoples: 201 | - Milan Pikula - WWW (www@crazy.elf.stuba.sk) 202 | - Ian Collier (sorry, I don't know his e-mail) 203 | for their modified ROMs. I get some ideas from these ROMs. 204 | (But only ideas, all routines are my own.) 205 | 206 | =========================================================================== 207 | Address of author: E-mail: busy@elf.stuba.sk 208 | Slavko Labsky http://www.elf.stuba.sk/~busy 209 | Gallayova 13 210 | 841 02 Bratislava Telephone: 211 | Slovak republic (07) 764 705 (only in slovak!) 212 | =========================================================================== 213 | -------------------------------------------------------------------------------- /bsrom/doc/bsrom140-sk.txt: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # BSrom140 - Modifikovana ZX Spectrum ROM - (c) Busy soft - Release 22.04.97 # 3 | ############################################################################## 4 | Originalna romka: (c) Amstrad 5 | (Ak nemate diakritiku Kamenickych, 6 | skuste spustit program setkam.com) 7 | 8 | Vseobecne 9 | --------- 10 | Jedna sa o klasicku romku zo ZX Spectra na ktorej boli spachane tieto upravy: 11 | 12 | - pribudlo zopar novych prikazov a funkcii - prehlad dalej 13 | - rozsirena syntax niektorych prikazov a funkcii - prehlad dalej 14 | - asi stvornasobne rychle chytanie uvodneho tonu z magnetofonu 15 | - programovy kurzor zmeneny zo znaku ">" na znak "*" 16 | - zvysena frekvencia chyboveho beepu 17 | - spracovanie hexadecimalnych cisel v rozsahu 0-65535 18 | - moznost pisania basicovych riadkov v rozsahu 0-16383 19 | (mozete normalne editovat a odosielat aj nulty riadok!) 20 | - v prikazoch ocakavajucich 8-bitovu hodnotu mozete pisat 21 | aj zaporne cisla, realna hodnota bude potom o 256 vecsia. 22 | - rychlejsi autorepeat na zaciatku po inicializacii 23 | - pri pokuse o odoslanie chybneho prikazu alebo riadku skoci 24 | kurzor na miesto chyby (lepsie ako v IZO-ROM) 25 | - moznost vypisovat listing programu bez riadiacich kodov 26 | (nereaguje na farby, TAB a AT - vhodne na zasite programy) 27 | - osetrenie NMI pomocou rozsiritelneho menu - prehlad dalej 28 | - opravene niektore chyby - prehlad dalej 29 | - dva nove znaky v znakovom subore - maly podciarnik a stvorcek 30 | - programovy kurzor "*" sa vypisuje iba pri autoliste 31 | - po editacnej zone sa da chodit hore a dolu 32 | - resety a NEW mazu pamet pomocou PUSH - je to super rychle 33 | - nove farby po resetoch a NEWe: ink 7, paper 0 34 | - autolist mozno v kazdom okamihu zastavit klavesou "Q" 35 | - niekolko vymozenosti pre uzivatelov ZX Spektra 128k 36 | 37 | 38 | Prehlad chyb, ktore boli opravene 39 | --------------------------------- 40 | - Chybne osetenie NMI rutiny - vyriesilo to NMI menu. Ale 41 | prislusny bajt zostal nezmeneny - to keby ho nahodou 42 | nejaky program moc usilovne zacal skumat a testovat. 43 | - PRINT AT 0,0;CHR$ 8; - posunulo kurzor na poziciu AT -1,31 - 44 | v tejto romke sa poloha kurzora nemeni. 45 | - Ak sa malo vypisat chybove hlasenie a je zakazane prerusenie, 46 | tak to zmrzlo. V tejto romke sa to nemoze stat. 47 | - Normalna romka sama seba na adresach 0..4 prepisuje. Tato 48 | romka nie, preto moze bezat aj bez zakazaneho zapisu v ramke. 49 | - Ak vysledok scitania alebo odcitania dvoch cisel v rozsahu 50 | -65535 az 65535 mal vyjst -65536, dopadlo to zle. 51 | V tejto romke je tato chyba scitania uz osetrena. 52 | - S chybou -65536 suvisi aj chybny vypocet INT x, 53 | kde x=-65536.9 az -65535.1 Tento vypocet je tiez osetreny. 54 | - Ak je posledny riadok v programe N, vy odoslete prazdny 55 | riadok N+1 (akoze ho zmazete) a potom stlacite EDIT, editne 56 | sa vam N-ty riadok aj s programovym kurzorom. V tejto romke 57 | sa programovy kurzor objavuje iba pri autolistingu a preto sa 58 | nikdy nemoze objavit v editnutom riadku. 59 | 60 | Na demonstraciu chyby -65536 a chyby INT je vhodny nasledujuci program: 61 | FOR a=-65538 TO -65533.9 STEP 0.25: PRINT a,INT a : NEXT a 62 | Schvalne si ho skuste spustit na povodnej ZX romke, a na tejto opravenej. 63 | 64 | Po starte alebo NEWe sa romka prihlasi vypisanim informacie, 65 | kolko je volneho miesta (basic a premenne basicu maju vtedy 66 | samozrejme nulovu dlzku) a vypise sa normalne hlasenie OK. 67 | 48k a 128k reset a ani NEW netestuju pamet - predpoklada sa, ze 68 | cela 48kB alebo 128k pamet je funkcna. 69 | 70 | Po resete alebo NMI (skoku na adresy #00 alebo #66) zacne srsat 71 | border, co je znakom ze ste v NMI menu. Ak by bol zasobnik SP 72 | na adresach #00-#4000, zmeni sa na #5800. Ovladacie klavesy: 73 | 74 | B - teply start basicu. Inicializuju sa vseky systemove 75 | premenne okrem PROG, VARS a ELINE - teda basicovy 76 | program a basicoe premenne zostanu zachovane. 77 | N - podobne ako CLEAR #5fff: NEW - teda pamet nad #6000 ostane 78 | neporusena. 79 | R - zmaze celu pamet 48kB - je to klasicky 48k reset. 80 | E - zmaze celu pamet 128k - (extend reset 128k) 81 | I - resetuje tieto periferie: AY, FDC, DMA a mechaniku disku. 82 | S - save "" screen$ na aktualne zariadenie (MG alebo disk) 83 | T - ako USR 15522 cize aktualne zariadenie bude paska. 84 | D - ako USR 15524 cize aktualne zariadenie bude disk. 85 | Q - navrat spat do preruseneho programu. Pozor: navrat bude 86 | korektny iba vtedy, ak SP nebol zmeneny na #5800. 87 | Pri navrate su vsetky registre (okrem dolnych 7 bitov 88 | registra R) obnovene na povodne hodnoty. 89 | M - skok do debuggera v MRS (musi byt v pameti!). 90 | Vsetky registre sa nastavia ako boli v okamihu prerusenia 91 | programu pomocou MNI - cize mozno preruseny program dalej 92 | krokovat (PC a SP sa korektne nastavia iba ak sa SP 93 | nezmenilo na #5800!). 94 | 0..9 - prepnutie ram-banky na 128k. Ak by sa SP nachadzal v 95 | oblasti hornych 16 kB, bude zmeneny na #5800. 96 | Je to vlastne OUT (#7ffd),cislo - cize pomocou 8 a 9 si 97 | mozno pozriet obsah druhej videostranky. 98 | U - uzivatelska funkcia - na adrese #3901 je JP XXX, kde si moze 99 | uzivatel napokovat adresu svojej aplikacie a po stlaceni klavesy "U" 100 | sa tato aplikacia spusti. Navrat je normalne pomocou RET. 101 | Z - uzivatelska funkcia - na adrese #3904 je DW xxx, a dalej presne 102 | tak isto ako "U". Tieto dve funkcie v samotnej romke nerobia nic, 103 | ale su vyhradene pre dalsie rozsirenia (napr. rezidentny monitor). 104 | 105 | 106 | Rozsirenie syntaxe existujucich prikazov 107 | ---------------------------------------- 108 | (Polozky v zatvorkach < > su nepovinne.) 109 | 110 | CONTINUE .. ak je vyraz nenulovy tak sa spusti strojak 111 | od tejto adresy. Pozor ! Pri navrate musi byt na rozdiel od 112 | USR register IY nastaveny na #5c3a, ale zato HL' nemusi mat 113 | hodnotu #2758. 114 | CLS .. ak vyraz je nenulovy tak sa nim nastavia vsetky 115 | farby (pr. CLS 7 = BORDER 0: PAPER 0:INK 7:BRIGHT 0:FLASH 0). 116 | GOTO, GOSUB, PAUSE, BORDER .. ciselny parameter pri tychto 117 | prikazoch je nepovinny, nezadany sa chape ako nula. 118 | LOAD, SAVE, VERIFY, MERGE .. retazcovy parameter pri tychto 119 | prikazoch je nepovinny, nezadany sa chape ako prazdny retazec. 120 | zoznam poloziek .. Za predpokladu, ze zoznam poloziek 121 | nezacina cislicou, ciarkou, a apostrofom mozete pokojne vynechat 122 | prikaz PRINT. Totiz ak sa pri behu programu najde nieco, co nie 123 | je ziadny prikaz, skoci sa do rutinky na prikaz PRINT. 124 | POKE adresa ... ukladanie poloziek do pameti. 125 | Poloziek moze byt lubovolny pocet. Moznosti poloziek: 126 | , 8-bit-hodnota ... ulozenie jedneho bajtu do pameti 127 | ; 16-bit-hodnota ... ulozenie dvojbajtovej hodnoty 128 | , retazec ... ulozenie retazca postupne po znakoch 129 | ; retazec ... posledny znak retazca bude mat nastaveny siedmy bit 130 | Priklad: POKE 16384,20;1025,"ahoj";"cau" 131 | ulozi do pameti tieto bajty: 20, 1,4, 97,104,111,106, 99,97,245 132 | Samozrejme ze vsade, kde sa ocakava nejaka hodnota (ciselna 133 | alebo retazcova) mozno napisat lubovolny vyraz prislusneho typu. 134 | 135 | Rozsirenie niektorych funkcii 136 | ----------------------------- 137 | CHR$ vyraz .. ak je vyraz v rozsahu 0..255, pracuje ako predtym, 138 | t.j. vrati prislusny znak ktoreho kod je hodnota vyrazu. 139 | Ale ak vyraz nadobudne hodnotu -1, potom tato funkcia vrati 140 | skoro celu pamet - t.j. retazec dlhy 65535 znakov. 141 | (Vratit vsetkych 65536 bajtov by bolo technicky problematicke). 142 | VAL$ vyraz .. ak je vyraz ciselneho typu, tak vysledkom tejto 143 | funkcie je stvorznakovy retazec hexadecimalnych cislic - inac 144 | povedane prevod DEC -> HEX (pr. VAL$ 33023 = "80ff"). 145 | VAL vyraz .. ak je vyraz ciselneho typu, tak vysledkom tejto 146 | funkcie je dvojbajtove cislo ulozene na tejto adrese - inac 147 | povedane dvojbajtovy PEEK. 148 | % .. prevod HEX -> DEC podobne ako je BIN prevod BIN -> DEC. 149 | Inac povedane ak chcete ako cislo zapisat hexadecimalnu 150 | konstantu, musi zacinat znakom "%". Znak "#" nebol pouzity 151 | preto, lebo ten sa pouziva na nastavenie kanala v prikazoch 152 | PRINT A INPUT (priklad: zapis %80ff je totozny s 33023). 153 | 154 | Funkciu CHR$ s parametrom -1 je velmi vyhodne pouzivat spolu s prikazom 155 | POKE na pracu s blokmi pameti, alebo aj samostatne na citanie pameti. 156 | Napriklad prikaz LET a$=(CHR$ -1)(16384 TO 23295) odlozi do premennej a$ 157 | obrazovku. Potom zase prikaz POKE 16384,a$ vrati odlozenu obrazovku spet. 158 | Pretoze zapisy "PEEK adresa" a "CODE (CHR$ -1)(adresa)" su totozne. 159 | 160 | Nove prikazy a ich syntax 161 | ------------------------- 162 | , .. (ciarka) editne prislusny basicovy riadok. Ak 163 | vyraz nie je uvedeny alebo nadobuda nulovu hodnotu, 164 | edituje sa riadok s najnizsim poradovym cislom. 165 | ' .. (apostrof) prepina ram-banky na 128k ako OUT 166 | (#7ffd),vyraz (podobne ako 0-9 v NMI menu). Vyraz musi 167 | byt v intervale 0 az 15. Pozor! Pri prepinani musi byt 168 | RAMTOP mensi ako #c000. 169 |  .. obnovi vsetky systemove premenne okrem PROG, VARS a ELINE. 170 | (Ako "B" v NMI menu.) [C v kruzku] 171 | ^ .. velky 128k reset - maze celu pamet 128k. 172 | (Ako "E" v NMI menu.) [sipka hore] 173 | ? .. vypise informaciu o dlzke programu, dlzke premennych a 174 | velkost volnej pamete pre basic. 175 | * .. header - z pasky cita hlavicky a vypisuje o nich toto: 176 | typ suboru : meno suboru : adresa : dlzka 177 | _ .. to iste ako USR 00102 - skok do NMI menu. 178 | # .. to iste ako USR 54885 - skok do MRS (musi byt v pameti!). 179 | 180 | 181 | Jedna nova systemova premenna 182 | ----------------------------- 183 | Kedze NMI rutinka vzdy zavola NMI menu, nepotrebuje uz vektor 184 | na adrese 23728. Preto tri bity na 23728 su takto vyuzite: 185 | 186 | bit 0=0:cisla basicovych riadkov sa vypisuju ako stvormiestne 187 | bit 0=1:cisla basicovych riadkov sa vypisuju ako petmiestne 188 | bit 1=0:pri autoliste sa vypisuju riadiace kody normalne 189 | bit 1=1:pri autoliste sa vypisuju riadiace kody podla bitu 2 190 | bit 2=0:pri autoliste sa vobec nevypisuju riadiace kody 191 | bit 2=1:pri autoliste sa vypisuju riadiace kody ako "_" 192 | 193 | Po resete alebo newe sa tu zapise nula. Petmiestne cisla riadkov 194 | maju vyznam vtedy, ak pouzivate riadky v rozsahu 10000 az 16383. 195 | Tento bit nijako neovplyvnuje beh programu s takymito riadkami, 196 | len meni format listingu. Pri editovani riadku sa jeho cislo 197 | vypise vzdy ako petmiestne. 198 | 199 | ---------------------------- 200 | 201 | Na adresach #3C98-#3CEF sa nachadza kusok volneho miesta. 202 | Toto miesto je rezervovane pre pouzitie v MB-02. Ale ak nemate 203 | MB-02 tak si mozete toto miesto vyuzit pre svoje vlastne ucely. 204 | 205 | Na zaver by som chcel podakovat tymto ludom 206 | - Milan Pikula - WWW (www@crazy.elf.stuba.sk) 207 | - Ian Collier (jeho e-mail adresu neviem) 208 | za ich modifikovane romky, ktorymi som sa nechal inspirovat 209 | a z ktorych som si dovolil "pozicat" si niektore napady. 210 | (Ale len napady a nic viac, vsetky rutinky mam vlastne). 211 | 212 | ================================================================== 213 | Adresa autora: E-mail: busy@elf.stuba.sk 214 | Slavko Labsky http://www.elf.stuba.sk/~busy 215 | Gallayova 13 216 | 841 02 Bratislava Telefon: 217 | Slovenska republika (07) 764 705 (len slovensky a cesky!) 218 | ================================================================== 219 | --------------------------------------------------------------------------------