|
Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment. |
|
Thread Tools |
20th Feb 2024, 4:04 pm | #1 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
NIBL 'helper' routines
I've started a bit of a helper/library thing for NIBL-E to add features it cant easily do... its a work in progress but so far it does these:
Print X as a byte 0-255 in hex 00-FF Print Y as a word 0-65535 (actually 0-32767 then -32768 to -1) in hex 0000-FFFF Clear the terminal screen (CLS) Cursor movement - up, down, left, right Delay Z seconds (can be interrupted) Beep, Whoop, Laser & Tick sounds via a speaker on Flag 2. LINK doesnt do parameter passing hence the use of X, Y & Z variables, doesnt mean you cant use them elsewhere. I expect it will live somewhere in the vast emptiness of ROM space on the 'MGH8060' and 'SC/MP II Max' boards, but for now, whilst its still a WIP, its in RAM. Its just a bit of fun, maybe has some application somewhere? Heres a bit of a demo: https://youtu.be/oD3vgFBTw4g I'll post files including source when I cant think of any more to add... though it is really simple. Is novelty stuff like this of any interest to NIBBLERS or is it just me? Last edited by Phil__G; 20th Feb 2024 at 4:22 pm. |
20th Feb 2024, 7:51 pm | #2 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
Posted the files at the bottom of the SC/MP page: https://philg.uk
Theres the library (if you can call it that!), the source, a brief doc, and the NIBL example program shown on the video above. Its far from optimised, theres a fair bit of repetition in there not helped by the SC/MP's difficulties with nested subs. Cheers Phil Last edited by Phil__G; 20th Feb 2024 at 8:01 pm. |
22nd Feb 2024, 7:02 pm | #3 | |
Hexode
Join Date: Jan 2021
Location: Ashford, Kent, UK
Posts: 320
|
Re: NIBL 'helper' routines
Quote:
|
|
22nd Feb 2024, 9:15 pm | #4 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
Aw shucks
|
6th Mar 2024, 5:02 pm | #5 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
Still expanding the NIBL-E 'helper', it now supports the 9600 baud Aliexpress receipt printer, with print character, print string, and I'm just doing 'list NIBL program to printer' like the old microsoft basic 'LLIST' command. What it doesnt have yet is a name, not even a generic 'what is it' name
Cheers Phil PS the delay function is in tenths, not seconds, my typo sorry, gives up to 25.5 seconds with Z=255 (interrupable) |
8th Mar 2024, 4:22 pm | #6 | |
Hexode
Join Date: Jan 2021
Location: Ashford, Kent, UK
Posts: 320
|
Re: NIBL 'helper' routines
Quote:
Any news Phil ? Starter for 10: NIBL Tiny Toolbox or Tiny Toolkit |
|
8th Mar 2024, 10:55 pm | #7 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
|
9th Mar 2024, 2:40 am | #8 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
Okay
The LLIST function wasnt as easy as it sounds and its been quite a learning exercise! One problem is that the NIBL line buffer which we use for scratchpad ram is beyond the reach of P2 which NIBL points to the variables A-Z. There just arent enough pointer registers! What I've done is to point to 0x2090 which is exactly midway between variables and a useful portion of the line buffer so with one pointer I can access from PAGE, through all the variables A-Z, and well into (but not all) the line buffer. Sounds obvious now but this was the eureka discovery Printing line numbers stored as inline hex was fun too. Anywho its all good to go: https://www.mccrash-racing.co.uk/phi...p.htm#basement I do need to think of a better function table, this one is quite wasteful Heres a short video of the LLIST function: https://youtu.be/gWpbZJP2Aas |
10th Mar 2024, 1:03 pm | #9 |
Hexode
Join Date: Jan 2021
Location: Ashford, Kent, UK
Posts: 320
|
Re: NIBL 'helper' routines
Thanks Phil, the mini-printer is now connected to the LCDS and printing perfectly. LLIST is great.
|
10th Mar 2024, 1:32 pm | #10 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
Ian spotted a typo in the PDF regarding 'print-character' which uses Z not X
I've corrected the document and took the opportunity to update 'print-string' so it adds a LF when it sees a CR. This stops the printer 'overprinting' consecutive strings Please download a fresh copy ! https://www.mccrash-racing.co.uk/phi...p.htm#basement Another thing I forgot to mention, which I've also added to the doc, is that just once, or again after a hard reset, SOUT must be set using Z=0:LINK#8254 Forgetting to do this results in the printer missing the very first character of a print, but thereafter its fine, you dont need to set SOUT again unless you press 'reset'. |
10th Mar 2024, 7:03 pm | #11 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
|
10th Mar 2024, 10:42 pm | #12 |
Hexode
Join Date: Jan 2021
Location: Ashford, Kent, UK
Posts: 320
|
Re: NIBL 'helper' routines
Indeed! I’m using the original SC/MP 1MHz card for running kitbug+ at 110 baud to test the TELEKIT interface.
|
11th Mar 2024, 2:58 pm | #13 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
The "SC/MP II Max" uses a 128k nvram with A16 on a selection jumper - so I'm going to put a 110 baud version of everything in the 'unused' half just for giggles & nostalgia...
I wonder how practical it will be... Conways 'Life' at 3 frames per minute? Meanwhile I was thinking about CP/M 3 and its banked memory, (the BBC's side-ways ROM is another example) and realised that NIBL is the ideal platform for banked memory - one 4k 'hole' could be occupied by either ram or one of several rom images... just like we were saying that SIO/SIN/SOUT were almost made for SPI, it seems NIBL was made for paging... SC/MP page 3 is an ideal candidate for paging in either either RAM or PAGE3.SYS... although that could probably be done already via a GAL input... I'm going to ponder on it and maybe come up with something. Unless its already been done? Last edited by Phil__G; 11th Mar 2024 at 3:05 pm. |
11th Mar 2024, 4:40 pm | #14 |
Octode
Join Date: Mar 2020
Location: Kitchener, Ontario, Canada
Posts: 1,300
|
Re: NIBL 'helper' routines
74LS612 memory mapper is also suitable for 4k pages. Also available as 74HCT612. It might be a bit complicated if only using it for 128k ram.
|
12th Mar 2024, 11:16 pm | #15 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
Another sound effect for the toolkit, a ringing telephone:
https://youtu.be/DqF-xBpSmVE https://www.mccrash-racing.co.uk/phi...p.htm#basement Last edited by Phil__G; 12th Mar 2024 at 11:29 pm. |
15th Mar 2024, 1:52 pm | #16 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
I added colour selection to the NIBL-E Toolkit.
The current functions are: Print Hex Byte In X Print Hex Word In Y Clear Screen Cursor Up Cursor Down Cursor Right Cursor Left Beep Speaker On Flag 2 Descending Sound (like a laser gun) Ascending 'whoop' sound (these two together make a good wolf whistle!) Tick Sound Wait Z Tenths Of Seconds (interruptable with 'Break' ALT/B) Print the ascii character in Z to the printer, ie Z=#41 prints 'A' Print the string at address Y to the printer, List the program in the current page to the printer Phone ringing sound on Flag 2 Set colour to value in Z, zero to 7 work-in-progress... https://www.mccrash-racing.co.uk/phi...p.htm#basement . Last edited by Phil__G; 15th Mar 2024 at 2:18 pm. |
15th Mar 2024, 5:58 pm | #17 |
Hexode
Join Date: Jan 2021
Location: Ashford, Kent, UK
Posts: 320
|
Re: NIBL 'helper' routines
Very nice. I’ll try that later. Does that work on a per character basis, i.e colour can be changed for each character output?
|
15th Mar 2024, 6:05 pm | #18 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
Not really Ian but you could print a character, change colour, print the next, change colour... a bit long winded
|
15th Mar 2024, 7:03 pm | #19 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
Havent tried this but straight off-the-top of my noggin...
100 T=TOP:B=TOP+10 110 $T="COLOURS" 120 $B=" " 130 FOR Z=0 TO 6 140 LINK#8270 150 @(B)=@(T+Z) 160 PRINT $B; 170 NEXT Z 180 PRINT "" Edit: couldnt resist, had to try it and yes it works. To explain, theres very little string handling in NIBL, so $B is an empty character slot into which we sequentially copy characters from the "COLOURS" string. so 150 @(B)=@(T+Z) is like the MID$(T$,Z,1) that we're all familiar with. You could do much longer strings with Z>7 as the colour is set by the least significant 3 bits (0-7) so 8=0=16=32=64 etc, see 2nd pic (I swapped B & T around so as not to limit the string length) Last edited by Phil__G; 15th Mar 2024 at 7:32 pm. |
18th Mar 2024, 3:03 pm | #20 |
Octode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,126
|
Re: NIBL 'helper' routines
Here's my old BASYS monitor with the hex conversions replaced by toolkit calls.
The difference in speed is remarkable! Last edited by Phil__G; 18th Mar 2024 at 3:28 pm. |