UK101 Programming Tips, Tricks, Pitfalls, Tools & Resources

Talk about non-Acorn classic computers/hardware/software here (including retro consoles)
User avatar
Seldon2k
Posts: 92
Joined: Sun Dec 08, 2013 3:19 am
Location: Redditch, UK
Contact:

UK101 Programming Tips, Tricks, Pitfalls, Tools & Resources

Postby Seldon2k » Tue Aug 08, 2017 4:44 pm

I thought it might be a good idea to gather any useful UK101 relevant Programming tools & resources in one location.
Most of these are scattered in many documents such as the UK101 manual, CUA Newsletters, PE Magazine articles etc.
This may encourage the writing of NEW software for the UK101 or just remind some of us of how much we had forgotten about it!

I will start the ball rolling with an Open Office spreadsheet of the machines Memory Map, this is a work in progress as I have yet to find all of the documentation.
UK101 Memory Map.ods
(14.33 KiB) Downloaded 11 times

Next, we have a useful spreadsheet illustrating the screen mapping and layout.
The UK101 shows a 48 to 50 character wide window on a larger 64x16 (1kB) or 64x32 (2kB) screen.
The actual boundaries are unique to each machine, my old UK101 had a 48 character wide screen,
I managed 50 chars from the Emulator.
UK101 Screen Addressing (Default).ods
(33.35 KiB) Downloaded 7 times

UK101 Screen Addressing (Emulator).ods
(33.16 KiB) Downloaded 7 times

Finally a PDF of this information, the two pages would need printing and joining together.
NB: The 'Unused' areas of RAM to the left and right of the Display could be used for Message Tables or other storage!
UK101 Screen Addressing.pdf
(17.7 KiB) Downloaded 10 times

I hope someone finds this useful and goes on to create some new and innovative applications for the old UK101.

I have just started the ball rolling by spending an insane amount of time writing a screen calibration application for the UK101! 8)
It autodetects the amount of video ram and tests accordingly.
I would be interested in any results from other UK101 users as these will depend to an extent on component drift and screen technology!

Code: Select all

 10 REM SCREEN SIZE CALIBRATOR
 20 PRINT CHR$(26): REM CLR SCRN
 25 GOSUB 700:REM INIT GETKEY
 30 BASE=53248
 32 REM TEST VIDEO RAM SIZE
 34 RT=55295
 36 POKE RT,255:RR=PEEK(RT):IF RR=255 THEN 40
 38 RAM=1:GOTO 45
 40 POKE RT,0:RR=PEEK(RT):IF RR=0 THEN RAM=2
 45 ON RAM GOSUB 1050,1150:REM DISPLAY INSTRUCTIONS
 50 V=USR(X): IF V THEN 60
 55 GOTO 50
 60 PRINT CHR$(26):REM CLR THE INSTRUCTIONS
 75 IF RAM=1 THEN C=BASE+32+64*7:TL=C-19-64*5:BL=C-19+64*6
 80 IF RAM=2 THEN C=BASE+32+64*15:TL=C-19-64*13:BL=C-19+64*15
 85 TR=TL+40
 90 BR=BL+40
 95 W=16:Z=20:A=22:S=18:REM DEFINE ARROW GRAPHICS
100 GOSUB 500
110 REM SCAN KBD FOR T,B,L,R
130 V=USR(X): IF V THEN 150
140 GOTO 130
150 FOR DEL=1 TO 200:NEXT DEL: REM WHY IS THIS NEEDED!
155 V$=CHR$(V):POKE C,V
160 IF V$="T" THEN MODE=V:GOSUB 850
170 IF V$="B" THEN MODE=V:GOSUB 900
180 IF V$="L" THEN MODE=V:GOSUB 950
190 IF V$="R" THEN MODE=V:GOSUB 1000
200 IF V$="E" THEN 215
210 GOTO 130
215 REM RESULTS
217 PRINT CHR$(26);"   Calibration Results"
218 PRINT "   -------------------"
219 PRINT
220 PRINT "TL = ";TL,"TR = ";TR
230 PRINT
240 PRINT "BL = ";BL,"BR = ";BR
499 END
500 REM DRAW THE TEST BOX
510 POKE TL,210:POKE TR,207
520 POKE BL,209:POKE BR,208
530 FOR LOOP=TL+1 TO TR-1
540 POKE LOOP,135
550 NEXT LOOP
560 FOR LOOP=BL+1 TO BR-1
570 POKE LOOP,128
580 NEXT LOOP
590 FOR LOOP=TL+64 TO BL-64 STEP 64
600 POKE LOOP,136
610 NEXT LOOP
620 FOR LOOP=TR+64 TO BR-64 STEP 64
630 POKE LOOP,143
640 NEXT LOOP
650 GOSUB 1250:REM CLEAR THE ARROWS
660 RETURN
700 REM SET UP THE GETKEY ROUTINE
710 FOR X=1 TO 80:M=PEEK(64767+X):POKE(575+X),M:NEXT
720 FOR X=1 TO 3:READ M:POKE(633+X),M:NEXT
730 DATA 76,208,253 : REM - JMP $FDD0
740 FOR X=1 TO 15:READ M:POKE(655+X),M:NEXT
750 DATA 141,19,2 :      REM - STA $0213
760 DATA 76,110,253 :  REM - JMP $FD6E
770 DATA 32,64,2 :         REM - JSR $0240
780 DATA 168,169,0 :    REM - TAY, LDA #$00
790 DATA 76,193,175 :  REM - JMP $AFC1
800 POKE 11,150:POKE 12,2
810 RETURN
850 V=USR(X): IF V THEN 860
855 GOTO 850:REM TOP ROUTINE
860 V$=CHR$(V)
865 IF (V$="T" OR V$="B" OR V$="L" OR V$="R"OR V$="E") THEN 890
870 IF V$="W"THENPRINTCHR$(26):POKEC,MODE:POKEC-128,W:TL=TL-64:TR=TR-64
875 IF V$="Z"THENPRINTCHR$(26):POKEC,MODE:POKEC+128,Z:TL=TL+64:TR=TR+64
880 GOSUB 500
885 GOTO 850
890  V$="":V=0
895 RETURN
900 V=USR(X): IF V THEN 910
905 GOTO 900:REM BOTTOM ROUTINE
910 V$=CHR$(V)
915 IF (V$="T"ORV$="B"ORV$="L"ORV$="R"ORV$="E") THEN 940
920 IFV$="W"THENPRINTCHR$(26):POKEC,MODE:POKEC-128,W:BL=BL-64:BR=BR-64
925 IFV$="Z"THENPRINTCHR$(26):POKEC,MODE:POKEC+128,Z:BL=BL+64:BR=BR+64
930 GOSUB 500
935 GOTO 900
940 V$="":V=0
945 RETURN
950 V=USR(X): IF V THEN 960
955 GOTO 950:REM LEFT ROUTINE
960 V$=CHR$(V)
965 IF (V$="T" OR V$="B" OR V$="L" OR V$="R"OR V$="E") THEN 990
970 IF V$="A" THENPRINTCHR$(26):POKEC,MODE:POKEC-2,A:TL=TL-1:BL=BL-1
975 IF V$="S" THENPRINTCHR$(26):POKEC,MODE:POKEC+2,S:TL=TL+1:BL=BL+1
980 GOSUB 500
985 GOTO 950
990 V$="":V=0
995 RETURN
1000 V=USR(X): IF V THEN 1010
1005 GOTO 1000:REM RIGHT ROUTINE
1010 V$=CHR$(V)
1015 IF (V$="T" OR V$="B" OR V$="L" OR V$="R"OR V$="E") THEN 1040
1020 IF V$="A" THENPRINTCHR$(26):POKEC,MODE:POKEC-2,A:TR=TR-1:BR=BR-1
1025 IF V$="S" THENPRINTCHR$(26):POKEC,MODE:POKEC+2,S:TR=TR+1:BR=BR+1
1030 GOSUB 500
1035 GOTO 1000
1040 V$="":V=0
1045 RETURN
1050 PRINT "    SCREEN CALIBRATION by Terry (09/08/17)"
1055 PRINT "    --------------------------------------"
1060 REM PRINT "This program expects the CEGMON monitor"
1070 PRINT "After testing for a 1KB or 2KB screen size"
1080 PRINT "A rectangle is then drawn on the screen"
1090 PRINT "The user then moves this by choosing the lines"
1100 PRINT "Top (T), Bottom (B), Left (L) or Right (R)"
1105 PRINT
1110 PRINT "If 'T' or 'B' use 'W' & 'Z' to move Up & Down"
1120 PRINT "If 'L' or 'R' use 'A' & 'S' to move Left & Right"
1130 PRINT "To exit the program with your results hit 'E'"
1135 PRINT
1140 PRINT "           Press any key to continue"
1145 RETURN
1150 PRINT "    SCREEN CALIBRATION by Terry (09/08/17)"
1155 PRINT "    --------------------------------------"
1160 REM PRINT:PRINT "This program expects the CEGMON monitor"
1170 PRINT:PRINT "After testing for a 1KB or 2KB screen size"
1180 PRINT:PRINT "A rectangle is then drawn on the screen"
1190 PRINT:PRINT "The user then moves this by choosing the lines"
1200 PRINT:PRINT "Top (T), Bottom (B), Left (L) or Right (R)"
1205 PRINT
1210 PRINT:PRINT "If 'T' or 'B' use 'W' & 'Z' to move Up & Down"
1220 PRINT:PRINT "If 'L' or 'R' use 'A' & 'S' to move Left & Right"
1230 PRINT:PRINT "To exit the program with your results hit 'E'"
1235 PRINT
1240 PRINT:PRINT "           Press any key to continue"
1245 RETURN
1250 REM CLEAR THE ARROWS
1255 FOR DEL =1 TO 50:NEXT DEL
1260 POKE C-2,32
1270 POKE C+2,32
1280 POKE C-128,32
1290 POKE C+128,32
1295 RETURN

Please don't judge me by the spaghetti code as it was written in a hurry. :roll:
I stole the GetKey routing from the Cegmon monitor ROM manual. I am pretty sure it will work for other monitors but have not tested this! [-o<
Obviously, the screen clearing technique would differ but that is a trivial fix. Perhaps I should have had it probe the monitor ROM for its ID.

UK101 GetKey Program.png

I have used an inelegant workaround at line 150 as I noticed that it seemed fussy about the speed of keystrokes! :oops:
I would be grateful if anyone, with a clearer head than I, could tell me why I needed it
I look forward to seeing some result if only to prove that I didn't waste my time :-)
Last edited by Seldon2k on Thu Aug 10, 2017 3:02 pm, edited 2 times in total.

User avatar
flaxcottage
Posts: 2728
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire

Re: UK101 Programming Tips, Tricks, Pitfalls, Tools & Resources

Postby flaxcottage » Tue Aug 08, 2017 6:09 pm

A great idea, thanks. =D>

May I contribute details for a non-destructive 32K RAM upgrade.
Attachments
32K upgrade UK101.pdf
(1.54 MiB) Downloaded 8 times
- John

Currently running Level 4 Econet with BBC B, BBC B+ 128K, Master 128K, 4Mb A3000, 4Mb A3020, 4Mb A4000, 4Mb A5000 dual FDD; UK101; HP41CX setup; Psion 3a, 3mx and 5mx; Z88; TI-58c, TI-59 and printer

User avatar
hoglet
Posts: 6352
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: UK101 Programming Tips, Tricks, Pitfalls, Tools & Resources

Postby hoglet » Tue Aug 08, 2017 6:13 pm

Does any kind of an SD based floppy disk interface exist for the UK101 (i.e. some thing like BEEBMMB/MMFS/SmartSPI/TurboMMC)?

I have a Superboard II, and it's the lack of a disk interface that is holding me back from doing much with it.

Dave

User avatar
flaxcottage
Posts: 2728
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire

Re: UK101 Programming Tips, Tricks, Pitfalls, Tools & Resources

Postby flaxcottage » Tue Aug 08, 2017 6:19 pm

Retyped documentation for Premier Publications BASIC 5 and BASIC X
Attachments
BASIC X.pdf
(39.25 KiB) Downloaded 9 times
BASIC 5.pdf
(38.68 KiB) Downloaded 8 times
- John

Currently running Level 4 Econet with BBC B, BBC B+ 128K, Master 128K, 4Mb A3000, 4Mb A3020, 4Mb A4000, 4Mb A5000 dual FDD; UK101; HP41CX setup; Psion 3a, 3mx and 5mx; Z88; TI-58c, TI-59 and printer

User avatar
flaxcottage
Posts: 2728
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire

Re: UK101 Programming Tips, Tricks, Pitfalls, Tools & Resources

Postby flaxcottage » Tue Aug 08, 2017 6:27 pm

As far as I know there is no SD type of storage device in use for the UK101.

I am toying with the idea of fitting a Raspberry Pi zero as a fileserver. I have the code and circuitry worked out. All that is needed is to interface a dedicated 8-bit bi-directional port to the UK101.

The 6502 code can be developed on a BBC Master, written to a 16K EPROM that holds BASICs 1 - 5 and added to my RAM/ROM expansion board and it should work. Ha Ha!

However if someone would like to beat me to it .... [-o< :D
- John

Currently running Level 4 Econet with BBC B, BBC B+ 128K, Master 128K, 4Mb A3000, 4Mb A3020, 4Mb A4000, 4Mb A5000 dual FDD; UK101; HP41CX setup; Psion 3a, 3mx and 5mx; Z88; TI-58c, TI-59 and printer

User avatar
Seldon2k
Posts: 92
Joined: Sun Dec 08, 2013 3:19 am
Location: Redditch, UK
Contact:

Re: UK101 Programming Tips, Tricks, Pitfalls, Tools & Resources

Postby Seldon2k » Tue Aug 08, 2017 7:01 pm

I also know of no SD solution for the UK101, but it sounds a great idea :-)
I was going to suggest that Dave build just the floppy portion of a 610 board.
http://www.osiweb.org/manuals/OSI_610.pdf
and then attach an existing solution.

Do you have the Service Manual for your 600 board (Superboard II), Dave?
http://www.osiweb.org/manuals/SAMS-C1P-Service-Manual.pdf
Not only useful to maintain the SB II but includes info on the 610 board.

John, I love the idea of the RPI, the PI Zero would be the best fit, both physically and financially.
You could throw a 6821 and an address decoder together ala Technomatics Decoder Module, or possibly use an Arduino or
Atmel chip with the right code sitting between the UK101 and the RPI0.
Actually, an Arduino with SD card reader board would probably cost the same as a RPI0 and would be TTL compatible!
The RP would need a buffer between it and the UK101 to do the 3.3v to 5v conversion. (Bet you knew that John :D )

User avatar
BigEd
Posts: 1387
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: UK101 Programming Tips, Tricks, Pitfalls, Tools & Resources

Postby BigEd » Tue Aug 08, 2017 7:58 pm

I believe there was a simple mod to double the CPU clock, which I did at some point.

Edit: oops, that's not software!
Last edited by BigEd on Wed Aug 09, 2017 7:22 pm, edited 1 time in total.

User avatar
Seldon2k
Posts: 92
Joined: Sun Dec 08, 2013 3:19 am
Location: Redditch, UK
Contact:

Re: UK101 Programming Tips, Tricks, Pitfalls, Tools & Resources

Postby Seldon2k » Wed Aug 09, 2017 7:19 pm

This forum is to help Programmers of the UK101 cope with the wide array of hardware modifications to the UK101.
Some of these relocated the ACIA and did other damage to the machines Memory Map, usually adding whole chips full of registers to it :-)

I have just created this Hardware Modification forum http://stardot.org.uk/forums/viewtopic.php?f=45&t=13557
that could be used to archive the practical side of the modifications, i.e. what track is cut and why!

Note: I have just edited/updated the original post above to include an application for the UK101, so please check it out!


Return to “other vintage computer hardware, software and games”

Who is online

Users browsing this forum: No registered users and 1 guest