Toastie Posted December 3, 2024 Author Posted December 3, 2024 54 minutes ago, alexGS said: You are of course correct that BASIC routines were provided in the 9771 instructions (complete with the famous typo in the bitwise mask), but I still see that as a ‘hack’ because it doesn’t provide the framework for solving an actual problem - much is left to the reader, and four programmers would come up with four different solutions - there is no ‘right’ way. 100% agreed. It is just that I love BASIC so much. It is the only programming language, I managed to "understand" to the degree of feeling comfortable when using it. Logo simply made me nervous (seeing all these kids on the LEGO books and flyers, happily programming and me not getting it); C or C++ is always a wild ride for me ... pressing "compile" is generally: Close eyes, wait, prepare to open them again and hoping for a "successfully compiled" message ... So in essence, I just chickened out and do what I did for decades ... All the best, Thorsten Quote
evank Posted December 3, 2024 Posted December 3, 2024 (edited) 4 hours ago, Toastie said: But wait - wasn't your machine an Apple clone? Ha! In the instructions that came with 9771, the LEGO folks are listing a (PC) BASIC program for interface A control To be (correct) or not to be (correct), that is the question. I generally tend to lean towards a little incorrect behavior ... :D Never take me seriously ... You all have fun!!! (so nice to know, that all 5 people are still here, I love it ...) All the best, Thorsten I started in this with a Laser 128, which I still have, but my current project uses a real //e because it requires more than two cards. I still need to update the 9771 scan on the Internet Archive. It's missing the last two pages, with the BASIC code! I have the physical booklet right here. We should all have a Zoom meetup over the winter holidays. Timing would be a challenge: US, Germany, New Zealand, etc. Edited December 3, 2024 by evank Quote
Toastie Posted December 3, 2024 Author Posted December 3, 2024 2 hours ago, evank said: Timing would be a challenge: US, Germany, New Zealand, Easy: We make it - let's say 1 pm German time - that is 1 am in NZ and 7 am in New Jersey (I believe) - where is the problem? Best, Thorsten Quote
alexGS Posted December 3, 2024 Posted December 3, 2024 (edited) 57 minutes ago, Toastie said: Easy: We make it - let's say 1 pm German time - that is 1 am in NZ and 7 am in New Jersey (I believe) - where is the problem? Best, Thorsten Lol… And winter holidays? That’s a long time to wait - summer has just started on the 1st of December 😛 Seriously, good idea Evan, thank you for including me. From about 2pm onwards (your time) would be good here Edited December 3, 2024 by alexGS Quote
evank Posted December 3, 2024 Posted December 3, 2024 (edited) Aaaah .... December holidays, then. I'm off from work the last week of this year and first week of 2025. I will try to plan something. Edited December 3, 2024 by evank Quote
maehw Posted December 3, 2024 Posted December 3, 2024 Hi all, I am happy to tell you that BRICK Lines works now... also for reading the inputs. I've committed the @Toastie's slightly modified code to the git repo and added the pinout details here: https://github.com/maehw/BrickLines/tree/main/hardware/serial2parallel_converter I've also fixed the always-serial-write-then-serial-read mechanism in BRICK Lines. I can still observe that the first character sent to the Arduino is not properly "echoed". (Actually ASCII capital letters A, B, C, ... make up for a good binary testing patterns as A = 0x41 which is masked to 0x01, B to 0x02 etc). I am not 100% sure if this is due to sending the first character very soon after the serial connection is opened... or this is a platform-specific problem on my macOS machine. However, not a big deal as I've implemented a workaround for this. Thanks for pointing out that the input can be shorted and nothing will light up in magic smoke. This made it easy for me to test the inputs and make a special cable which I can plug in to simulate a touch sensor. This allowed me to load and execute LEGO Lines program BTEST: ┌ IN ───┬ OUT ──────────────────┐ BRICK Lines ├───┬───┼───┬───┬───┬───┬───┬───┤ │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │ ┌─ # ──┬─ LABEL ──────┼───┼───┼───┼───┼───┼───┼───┼───┼───────┐ │ 1 │ light │▒▒▒│▒▒▒│ 0 │ 1 │ 0 │ 0 │ 0 │ 0 │ │ │ 2 │ REPEAT │▒▒▒│▒▒▒│ │ │ │ 3 │ UNTIL │▒▒▒│ 1 │ │ │ │ 4 │ open │▒▒▒│▒▒▒│ 0 │ 0 │ 0 │ 0 │ 0 │ 1 │ 2 │ │ 5 │ close │▒▒▒│▒▒▒│ 0 │ 0 │ 0 │ 0 │ 1 │ 0 │ 2 │ └──────┴──────────────┴───┴───┴───┴───┴───┴───┴───┴───┴───────┘ BTW: I also thought about embedding a LEGO Lines program to BASIC code and/or TClogo code converter into BRICK Lines. Let me know if you'd find this useful. :) I think the cable-motor or cable-lamp connections do not work very reliably. It seems that for some cables (or light bricks?) I need to wobble to get a connection. Especially for motors... the vibrations can loosen existing connections. Any helpful hints if this is normal wear-out, has always been like this or something else? Next logical step would be to re-create models for LINES and play around with them. Do you know which instruction manual I'd have to look at (and check if I have those bricks available here)? Can you tell if the instructions for LINES and TClogo used the same models or different ones? PS: I'd be happy to join a call but I'll be at 38C3 congress in Hamburg during the last week of this year. Quote
alexGS Posted December 4, 2024 Posted December 4, 2024 1 hour ago, maehw said: I think the cable-motor or cable-lamp connections do not work very reliably. It seems that for some cables (or light bricks?) I need to wobble to get a connection. Especially for motors... the vibrations can loosen existing connections. Any helpful hints if this is normal wear-out, has always been like this or something else? A razor blade (of the type used in a scraper) is the best tool for spreading the cross-cut pins. They should be a nice tight fit - particularly the 4.5V Technic motors tend to suffer from a loose fit, but by expanding the pins you will greatly improve reliability. This is essential in 12V train layouts too :) Quote
alexGS Posted December 4, 2024 Posted December 4, 2024 (edited) 18 hours ago, maehw said: Next logical step would be to re-create models for LINES and play around with them. Do you know which instruction manual I'd have to look at (and check if I have those bricks available here)? Can you tell if the instructions for LINES and TClogo used the same models or different ones? LINES material was designed around set 1090 (never 9700) but the parts and concepts are similar (for example, there is an instructed washing machine build in both). 9700 has two switches and an optosensor, while 1090 has two optosensors. The instructions for set 1090 may be particularly hard to find online (if you want to make the exact models) but I eventually bought a physical copy. We can refer to Evan’s collection for programming examples. This teacher’s guide was the typical reference for LINES (versions exist for BBC, Apple II): https://archive.org/details/lego-lines-teacher-materials/page/n15/mode/1up The C64 LINES software that I translated (mostly) to English included four samples, WASH, BELT, and so on, which were provided in Dutch and I converted across. You could open this in a C64 emulator to see the programs https://archive.org/details/en-legolines_202112 There is TCLogo material in the collection, for both 1090 and 9700. This workbook has fairly complex TCLogo examples: https://archive.org/details/technic-control-i-resource-guide Edited December 4, 2024 by alexGS Quote
evank Posted December 4, 2024 Posted December 4, 2024 20 hours ago, alexGS said: A razor blade (of the type used in a scraper) is the best tool for spreading the cross-cut pins. They should be a nice tight fit - particularly the 4.5V Technic motors tend to suffer from a loose fit, but by expanding the pins you will greatly improve reliability. This is essential in 12V train layouts too :) I use a tiny slotted screwdriver. It's safer than a blade. Quote
Toastie Posted December 4, 2024 Author Posted December 4, 2024 And after the mechanical treatment as described above (I am also a guy), I do a little "Kontakt 60" spray treatment to both, pin and socket, using a Q-tip swab (not directly spraying the contacts, just into the cap of the spray can and then soaking the cotton tip). Never use WD40! (https://www.reichelt.de/kontaktspray-kontakt-60-100-ml-oxid-und-sulfidloesend-kontakt-2010-p9462.html) Best, Thorsten Quote
maehw Posted December 4, 2024 Posted December 4, 2024 (edited) 5 hours ago, alexGS said: LINES material was designed around set 1090 (never 9700) but the parts and concepts are similar (for example, there is an instructed washing machine build in both). 9700 has two switches and an optosensor, while 1090 has two optosensors. The instructions for set 1090 may be particularly hard to find online (if you want to make the exact models) but I eventually bought a physical copy. We can refer to Evan’s collection for programming examples. This teacher’s guide was the typical reference for LINES (versions exist for BBC, Apple II): https://archive.org/details/lego-lines-teacher-materials/page/n15/mode/1up The C64 LINES software that I translated (mostly) to English included four samples, WASH, BELT, and so on, which were provided in Dutch and I converted across. You could open this in a C64 emulator to see the programs https://archive.org/details/en-legolines_202112 There is TCLogo material in the collection, for both 1090 and 9700. This workbook has fairly complex TCLogo examples: https://archive.org/details/technic-control-i-resource-guide Thanks for elaborating on the details! Is this actually you(r blog)? https://lukazi.blogspot.com/2014/07/lego-legos-first-programmable-product.html?m=1 — If so, I didn't get it until now. Thanks for sharing the instructions! I am most excited about the robot arm 1090 E), the crane (1092 E) and the plotter (1092 A) models. Thanks for sharing the zip/pdf files. Unfortunately 1092 E seems incomplete. It's really interesting how LEGO had multiple plotter models — interface A, Technic Control Center and also interface B I guess? I had played around with Technic Control Center's plotter model and used it with the RCX earlier this year. Cheers Edit: also thanks to everyone for having good hints about fixing the wobbly cable connections! PS: Thanks for pointing me to the C64 and Apple ][ disk files. I knew about them and had extracted the save files and uploaded them as examples in the git repo. They do work with BRICK Lines out of the box. Edited December 4, 2024 by maehw Quote
alexGS Posted December 5, 2024 Posted December 5, 2024 13 minutes ago, maehw said: Thanks for elaborating on the details! Is this actually you(r blog)? https://lukazi.blogspot.com/2014/07/lego-legos-first-programmable-product.html?m=1 — That’s Alex Lukazi - a different Alex. I’m Alex Shepherd :) Quote
evank Posted December 5, 2024 Posted December 5, 2024 Alex L. was very helpful to me when I discovered this stuff in 2016. Nice guy! Quote
Toastie Posted December 5, 2024 Author Posted December 5, 2024 And Alex S. pushed me so much during my "awakening" with regard to TC - and then Evan simply pushed me through ... these are all extremely nice and helpful guys. And there are more (there always are) of course ... As I said @maehw, "this particular" world is small, but one that I never want to leave ... Best wishes to you all Thorsten Quote
evank Posted December 6, 2024 Posted December 6, 2024 17 hours ago, Toastie said: Alex S. pushed me so much during my "awakening" with regard to TC - and then Evan simply pushed me through Gooooooaaaaaaaaaaaaallllllllllllllllllllll! Quote
evank Posted December 9, 2024 Posted December 9, 2024 (edited) Here is my review of Jason Merrill's Blocko card, which is a replica of the Lego 9767 hardware interface card. Bottom line, it's good! Edited December 9, 2024 by evank Quote
Toastie Posted December 12, 2024 Author Posted December 12, 2024 Hi Evan, wonderful video!!! Not only the new product is shown but all the alternatives as well! OK, the original is THE original ... and my favorite is OF COURSE the home brew card. And what the heck is going on with all these blue Technic bricks in the back? (I just got clearance from the higher authority here, to make a BL Xmas order, used stuff, of course ...). I'll get to see all that on Christmas Eve ... Anyway, looking forward to what the secrets are about!!! All the best, Thorsten Quote
evank Posted December 13, 2024 Posted December 13, 2024 The blue parts are for my Donkey Kong machine. It's not a secret. Mainly I talk about it on Facebook, in my group called "Square Pistons". Quote
evank Posted January 14 Posted January 14 (edited) Can someone convert the BBC Micro SSD file for the Lego Lines program into a raw text file for me? I no longer have access to Beeb hardware and would like to examine its BASIC code. The file is here: https://archive.org/details/lego-technic.ssd_202012 Update -- Disregard; I have the text files now. Edited January 14 by evank Quote
maehw Posted January 15 Posted January 15 12 hours ago, evank said: Can someone convert the BBC Micro SSD file for the Lego Lines program into a raw text file for me? I no longer have access to Beeb hardware and would like to examine its BASIC code. The file is here: https://archive.org/details/lego-technic.ssd_202012 Update -- Disregard; I have the text files now. Hi Evan (and all), I read about your post in my e-mails and got interested so I was planning to help this morning (before seeing your edit). I stumbled across this tool: https://github.com/monkeyman79/dfsimage - and was able to extract the files, too. Actually I was quite surprised that you were expecting BASIC source code files... I'd have expected binary (compiled) executables instead. But that may not be how the BBC Micro worked. Maybe you can enlighten us (me?) here. Honestly, I haven't done any research on my own here but it might be interesting to hear from someone directly who's familiar with systems from back then. Looking at LINES, the file doesn't seem to contain only printable characters (from an UTF-8 perspective) - so I guess there's a bunch of control characters in every line. Looking at TITLE.. at least the very end looks like assembler mnemonics. Again surprised, because why would you ship them in this encoding? Was runtime compilation of assembly a thing? Quote
evank Posted January 15 Posted January 15 The BASIC files, as raw text, are here: https://drive.google.com/file/d/1P84zJh7h0F3zIllRhx_w0-PxoLbj9YLt/view?usp=drive_link. It's a fact that Lego Lines is written in BASIC. I was curious how they output to 9750. In my own (limited) experience with a Model B, I performed outputs via the user port. First I wrote ?&FE62=63, which tells the user port to set its first six bits as outputs, and then ?&FE60=(decimal-encoded value of the binary total for whichever ports I want on or off, from 0-63). The method works fine and I documented it for the Apple II, BBC, C-64, and PC on my website here: https://www.brickhacks.com/basic.php. But if you look at the main file in the link from my previous post -- the main file being T.LINES -- there's no such output code that I can see. Hopefully someone who knows that computer better than I do, and/or someone who's a better BASIC programmer than me, can identify it. I asked @Toastie for help; he's a bit stumped too. Quote
Toastie Posted January 15 Author Posted January 15 4 hours ago, evank said: he's a bit stumped too Yeap - but even more than that, I am pretty much impressed by the architecture of the Beep. What a cool machine! The olden days were definitely better - I mean: Which machine calls a particular part of its memory SHEILA? Unfortunately, Beep's don't need any custom interface to talk to #9750 - they can do that out of the box. I did already feel it (you know, this "inner unrest") but then read that a 6522 VIA is in charge, port A for the printer, B for the user, both accessible from BASIC and - swooosh - inner unrest was gone. So Ms. Toastie will not suffer another crisis when more "old trash" (NOT MY WORDS!) populates the house . We'll see. Let's browse the files, Evan provided ... Best, Thorsten Quote
Toastie Posted January 16 Author Posted January 16 @evank After browsing through all the files, hoping for some nice BASIC lines , I think I found at least the initialization you are looking for; however, it is of course done in assembly - and I am terrible regarding 6502 assembly. It is in file T.TITLE as @maehw speculated/suggested, beginning at (editor line 187 =) program line 930: "DEF PROC assem". Assembly begins at line 960 - there is repeated access to SHEILA: According to the BBC User Guide, the following code does access the direction register of the 6522 VIA (copy/pasted, here in italics), making all 8 bits/lines to outputs (&FF = bin 11111111): LDA #&97 LDX #&62 LDY #&FF JSR &FFF4 would write &FF into location &FE62. An OSBYTE call with A=&97 will write to sheila. The base address of SHEILA is &FE00 and to this is added the offset in X (&62). The value written is contained in Y. The net effect is to write to the 6522 Data direction register and to cause all the PB lines to become outputs. This is in the T.TITLE code at program line 1120: 1120 LDA #&97 1130 LDX #&62 1140 LDY #63 1150 JSR & FFF4 Which should write &63 (bin 0011111) into the data direction register for port B of the 6522 VIA = lower 6 bits outputs, upper 2 bits inputs. That should be it, right? Best, Thorsten Quote
evank Posted January 16 Posted January 16 Thanks!! I never would have figured that out on my own. Quote
Toastie Posted January 16 Author Posted January 16 You are very welcome! I like to learn, and I really appreciate that you do get me in touch with all these wonderful machines, I never heard of back in the days. The Beep BASIC is really, really cool - handling of machine code is fantastic! All the best, Thorsten Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.