OLIMEX / AgonLight2

AgonLight OSHW Retro Z80 computer - updated version with few updates
GNU General Public License v3.0
82 stars 7 forks source link

Firmware is out of date for Version of Quark (MOS/VDP v 1.03) Currently Being Shipped #3

Open oldpatientsea opened 1 year ago

oldpatientsea commented 1 year ago

New Agon Lights are being shipped with 1.03 but this repo still includes firmware (i.e. BBC BASIC for Z80 plus example and test files) that is incompatible with 1.03.

I have seen several new users tripping over this recently on Facebook and Discord.

Perhaps it makes sense to replace the cached firmware in this repository with a README pointing users to the official agon-bbc-basic repository instead, along with a brief explanation of which versions of BASIC work with which versions of Quark just in case people who bought older stock of the boards that shipped with 1.02 (or earlier?) come looking for firmware.

Also worth noting that if you find you need to press ENTER twice after each line in BASIC then you are running an incompatible, earlier version since this is what new users notice immediately.

DanKoloff commented 1 year ago

It should be now updated, thanks for notice.

oldpatientsea commented 1 year ago

Thank you.

Unfortunately you're still including out of date examples that will not work with the latest version of BBC BASIC - eg SOFTWARE/1-SD-card-contents/basic_examples_tests contains the files for v.1.02 of BBC BASIC not v1.04.

I haven't checked the others.

DanKoloff commented 1 year ago

Yeah we just copy-pasted these and added some more:

https://github.com/TheByteAttic/AgonLight/tree/main/uSD%20card%20files

The idea was to place everything we've tested in one place instead of just posting links and throwing people left and right.

oldpatientsea commented 1 year ago

I like your thinking :)

Yeah, that's a very good idea to have everything in one place and it makes sense that it would be the Olimex repo since you are the ones manufacturing and selling the board.

Unfortunately though the files you copied are out of date - if you look at the README in TheByteAttic's repository he warns "THE FILES ABOVE ARE APPROPRIATE ONLY FOR RELEASE 1.02 OF THE FIRMWARE."

You need to replace them with the ones from Dean's BBC BASIC repository, https://github.com/breakintoprogram/agon-bbc-basic

DanKoloff commented 1 year ago

Thanks, will check it. On first look it appears the "Examples" are same if not older, will probably just delete "Examples" from our repo if they don't compile with the newer firmware.

Removed most of the "Examples", left only "animal" since that one seems to be working fine. Replaced "Tests" with the ones from https://github.com/breakintoprogram/agon-bbc-basic

theflynn49 commented 1 year ago

The files in "tests" still don't work, because (at least in my setup which says basic version 3.00) the lines in the .bas files all end with a single "0x0a" instead of "0x0d 0x0a". Once corrected, it works.

DanKoloff commented 1 year ago

Which bas file exactly? Or all of them in folder "tests"?

Do you use bbc basic 1.04? As it says at bottom of folder tests:

"These have been saved now as text files, so will need BBC BASIC 1.04 to load"

What does it mean basic version 3.00? I can't see it listed here: https://github.com/breakintoprogram/agon-bbc-basic/releases

theflynn49 commented 1 year ago

I only considered the files in directory "tests"; I treated the file sound_1.bas to generate sound_2.bas. All files give me a "Bad program" message when I try to "LOAD" them, except sound_2.bas, the one I generated. I have no idea where to find basic 1.04, I only know the one in THIS repository which says "basic 3.00" Or else, this linux command should answer your question :

file * assembler_stub.bas: ASCII text benchm1.bas: ASCII text benchm2.bas: ASCII text benchm3.bas: ASCII text benchm4.bas: ASCII text benchm5.bas: ASCII text benchm6.bas: ASCII text benchm7.bas: ASCII text benchm8.bas: ASCII text benchm9.bas: ASCII text BENCHMARK.md: ASCII text circle_1.bas: ASCII text circle_2.bas: ASCII text cube.bas: ASCII text fireworks.bas: ASCII text gpio_port_1.bas: ASCII text hatgraph.bas: ASCII text keyboard_1.bas: ASCII text lines.bas: ASCII text mandlebrot_1.bas: ASCII text mode_test_1.bas: ASCII text mode_test_2.bas: ASCII text palette_1.bas: ASCII text README.md: ASCII text rtc.bas: ASCII text scroll_1.bas: ASCII text scroll_2.bas: ASCII text shadows.bas: data sound_1.bas: ASCII text sound_2.bas: ASCII text, with CRLF line terminators sprites_1.bas: ASCII text sprites_2.bas: ASCII text sprites_3.bas: ASCII text sprites_4.bas: ASCII text sprites_5.bas: ASCII text sysvars.bas: ASCII text triangles.bas: ASCII text udg.bas: ASCII text

theflynn49 commented 1 year ago

Regarding the bbcbasic version, it seems that version "3.00" is version 1.04 (my file is identical to the one you gave me an url for, beside, it CAN read text-non-tokenized basic files, which means it has the 1.04 capabilities)

strings bbcbasic.bin | grep -i version 3BBC BASIC (Z80) Version 3.00 3BBC BASIC (Agon) Version 1.04

DanKoloff commented 1 year ago

Thanks for info will look into it.

theflynn49 commented 1 year ago

Welcome. I wonder where the problem really comes from though. I just checked all files in the subtree "1-SD-card-contents", none has CRLF to terminate a line. On another hand, it's a very recent capability of bbcbasic to read non-tokenized files; so the old .BAS files format was due to a complete different publishing scheme and we are the first people to try LOADing these directly from bbcbasic.

To me, fixing bbcbasic to accept both CRLF and single LF text files should be the way to go ?

DanKoloff commented 1 year ago

From what we see right now is that the original files had carriage return, but when we uploaded them to the GitHub carriage return disappeared, only LF is in the files at GitHub. Some setting made them Unix style.

oldpatientsea commented 1 year ago

I haven't tested this but if you create a .gitattributes file and include the following it should force the .bas files to have the required CRLF line endings.

# Declare files that will always have CRLF line endings on checkout.
*.bas text eol=crlf

Note this will override any local settings so you may want to check with colleagues what else if anything this file should contain before creating it :)

See: https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings

BASIC currently shows the version number for the BBC BASIC (Z80) code on which it has been based rather than the BBC BASIC (Agon) version number. There is an open issue suggesting it display both on startup to reduce confusion: https://github.com/breakintoprogram/agon-bbc-basic/issues/54

DanKoloff commented 1 year ago

Alright let's give it a try.

DanKoloff commented 1 year ago

This seems to fix it. Interesting that we encounter this issue for first time. And I wonder why would it convert CRLF to just LF.

Edit: .bas text eol=crlf doesn't cover it lol since some of the solutions are .BAS and it is case sensitive; uploading .BAS would still convert CRLF to LF. I guess I have to add .BAS text eol=crlf and I hope no one will use BaS or BAs or bAS.

theflynn49 commented 1 year ago

Good news it's a git problem and not an Agon mess. Congrats for the elegant solution. More historical info here : https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/