Code Monkey home page Code Monkey logo

Comments (31)

bgri avatar bgri commented on June 7, 2024

from m100le.

bgri avatar bgri commented on June 7, 2024

Just catching up on these... yes, we'll tokenize the .BA once we lock down the next version, 'M100LEm'.

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

The 8201 BASIC is somewhat different than the m100. Drawing characters to x,y doesn't exist in the same way. There's a few other things... so a direct 1:1 conversion isn't possible. The 8201 is my first love for these units, so I have to get a version running on it :)

I have a solution for the X,Y problem in issue #11. You already are setting variables to store the coordinate. I was thinking the variables could simply be the VT52 strings for cursor placement. That should work on any of the Kyocera sisters. I am eager to get it working, once we know that random access reads can work properly on the 8201.

from m100le.

bgri avatar bgri commented on June 7, 2024

Nice idea! I've been reluctant to dig into that one as I used PRINT @ statements everywhere :).

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

Now that I think the program should work on the NEC portables, I'm looking into how to tokenize to a M100LE.BA.NEC file. I already have tokenizing working well enough for the Model 100 and Tandy 102/200 at https://github.com/hackerb9/tokenize .

One problem I'm running into is that VIrtual T sometimes garbles .BA files when saving from the NEC 8201A emulation, so I don't have a baseline of what the output should look like.

from m100le.

bgri avatar bgri commented on June 7, 2024

Hmm, interesting. What would it take to get a baseline?

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

Would you be willing to load the M100 code into your NEC 8201A and then post the .BA file in this thread? I believe the tokenization is the same for all the NEC portables, but we should probably check that.

from m100le.

bgri avatar bgri commented on June 7, 2024

Yep, for sure! I've got a bit more bandwidth to look back at this stuff (for a little while anyway :)). I'll try and have it up in the next few days.

from m100le.

bgri avatar bgri commented on June 7, 2024

Ok, that's cool! The code runs!!!

image

Though it's not reading the .CO properly...

image

Amazing progress!

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

FLJFP.... Wasn't that the "word" when the wordlist wasn't properly initialized by CMPRSS and so it was just looking at a copy of the NEC ROM?

Please try downloading the .CO file directly. If that works, please send me the output of running CMPRSS so we can debug it. If the .CO file doesn't work, then I'm curious if the program even works with the old .DO format. (It should if there is no .CO file).

It's not possible you have an old copy of CMPRSS.DO, right?

from m100le.

bgri avatar bgri commented on June 7, 2024

Would you be willing to load the M100 code into your NEC 8201A and then post the .BA file in this thread? I believe the tokenization is the same for all the NEC portables, but we should probably check that.

Bah, I must be bad at reading. Just to confirm what I've done (hopefully it's what you were looking for :) ):

  • Download M100LE.DO
  • copy to 8201a
  • load the .DO into basic
  • save the .BA to RAM
  • attach the .BA here. Attached as .txt and .zip incase something muddled it as Github received.

M100LE_BA.txt
M100LE.BA.zip

On to the next part...

from m100le.

bgri avatar bgri commented on June 7, 2024

Ok - TLDR -- It works :)

  • downloaded the current text version of CMPRSS.DO
  • loaded it into basic and saved it out as CMPRSS.BA
  • ran CMPRSS.BA on the current version of WL2022.DO
  • which created WL2022.CO
  • ran the current version of M100LE.BA
  • stopped execution to get the value of TW$ (today's word), which resulted in DANDY
  • also, something seemed to be going on as when I entered "PRINT TW$" in addition to printing the word, it seemed to start executing basic code and generated an error message. It also did this the first time I attempted to clear the screen with CLS. - the second CLS attempt worked, and then was able to cleanly print the value of TW$ without issue.

image
Running CMPRSS.BA to generate WL2022.CO

image
Jobs Done.

image
Program running

image
Complete

image
The error

image
After a couple of CLS

Also -- I had previous issues attempting to delete WL2022.CO -- the 8201a would freeze and a hard reset was needed. That doesn't happen now.

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

Also -- I had previous issues attempting to delete WL2022.CO -- the 8201a would freeze and a hard reset was needed. That doesn't happen now.

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

(Oops, clicking wrong buttons as I'm too sleepy)

Hurray that CMPRSS works (at least partially)! It would be good to know if it is able to compress on the fly over the serial port instead of using WL2022.DO.

The .txt worked with no file mangling; no need for the .zip.

The file you had a hard time deleting makes me more sure that I should finish up bug #37 before the cut to 0.m.

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

I think I mentioned this in a different issue, but if not, it's good to note that I have discovered using Virtual T that there are only two different tokenized BASIC formats across all the Kyotronic sister-computers.

Platform BASIC Tokenization
NEC PC-8201
NEC PC-8201A
NEC PC-8300
N82 BASIC
Kyocera Kyotronic-85
TRS-80 Model 100
Tandy 200
Tandy 102
Olivetti M10 (Italy)
Tandy BASIC

After I finish the Kyocera Kyotronic-85 port, I may come back to looking at documenting the N82 BASIC tokenization so I can extend my tokenizer to automatically create .NEC.BA files.

A Makefile is now included (ever since the Olivetti M10 pull request). This makes it easy (on a UNIX-like system, anyhow) to re-create the M100LE.BA file. It uses my tandy-tokenize program to do the tokenization. Typing make is all that is needed to generate M100LE.BA, M100LE+comments.BA, and M100LE.DO.

Apple MacOS should come with make, so it should work there. On the other hand, I'm not sure if Apple MacOS even includes libfl, which is needed to compile my tokenizer from C. Microsoft Windows may work as well, if WSL is installed from the Appstore. I don't have access to either, so I can't say for sure.

from m100le.

bgri avatar bgri commented on June 7, 2024

Interesting. That makes sense. The WEB82201 technical documents page only references converting between the two so it looks like the other orgs. decided Tandy basic was fine.

And I discovered that since Lion, OSX doesn't come with developer tools installed. My last Macbook Pro had it but I guess I haven't done any mac dev work since then :( Downloading now :)

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

Interesting. That makes sense. The WEB82201 technical documents page only references converting between the two so it looks like the other orgs. decided Tandy basic was fine.

And I discovered that since Lion, OSX doesn't come with developer tools installed. My last Macbook Pro had it but I guess I haven't done any mac dev work since then :( Downloading now :)

No dev tools? Wow, it's been a while since I used MacOS.

Are they still using "homebrew" for package management? You might need to "brew install flex" for my tokenizer. If you compile it, please upload the executable so I can add it to the available downloads.

from m100le.

bgri avatar bgri commented on June 7, 2024

Well, I thought I'd give your cleaner/tokenizer a try. I installed Flex using Brew then went and attempted build tandy-tokenize...

Sadly, I got this error:

brad@Brads-MacBook-Pro-16 tokenize % sudo make
Password:
gcc -o tandy-tokenize lex.yy.c -lfl
ld: library not found for -lfl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [tandy-tokenize] Error 1
brad@Brads-MacBook-Pro-16 tokenize %

Looks like the Mac is missing that library. Thoughts on how I can add it manually? I would have thought it would have come in with the Flex package... I missed something?

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

Yeah, libfl is supposed to come with flex. Did you install flex using brew install flex? (If you don't have brew, please see brew.sh).

By the way, still working on the NEC PC-8201A tokenizer. Had some hiccups, but making progress.

from m100le.

bgri avatar bgri commented on June 7, 2024

Yep, had brew installed previously. Updated it then added Flex as you describe :(

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

I wonder if brew installs library files in weird places. Does locate libfl give you any information on MacOS?

Try brew --prefix to find the lib directory that contains libfl.

from m100le.

bgri avatar bgri commented on June 7, 2024

Got this:

brad@Brads-MacBook-Pro-16 / % locate libfl
/Applications/LibreOffice.app/Contents/Frameworks/libflatlo.dylib
/Applications/VLC.app/Contents/MacOS/plugins/libflac_plugin.dylib
/Applications/VLC.app/Contents/MacOS/plugins/libflacsys_plugin.dylib
/Applications/VLC.app/Contents/MacOS/plugins/libflaschen_plugin.dylib
/Applications/VLC.app/Contents/MacOS/plugins/libfloat_mixer_plugin.dylib
/Applications/VirtualT.app/Contents/Resources/lib/libfltk.1.3.dylib
/Applications/VirtualT.app/Contents/Resources/lib/libfltk_images.1.3.dylib
/usr/local/Cellar/flex/2.6.4_2/lib/libfl.2.dylib
/usr/local/Cellar/flex/2.6.4_2/lib/libfl.a
/usr/local/Cellar/flex/2.6.4_2/lib/libfl.dylib
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libflowmanager.rb
brad@Brads-MacBook-Pro-16 / %

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

So, it looks like brew stashed it in /usr/local/Cellar/flex/2.6.4_2/lib but didn't add that to the standard library directory path. What about the results for pkg-config --libs libfl ?

from m100le.

bgri avatar bgri commented on June 7, 2024

pkg-config wasn't installed - added it via brew:

brad@Brads-MacBook-Pro-16 / % sudo pkg-config --libs libfl
Package libfl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libfl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libfl' found
brad@Brads-MacBook-Pro-16 / % 

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

I don't know why locate wouldn't have found it, but people on the net claim that brew creates symlinks to every installed library in a standard directory. Could you please try brew --prefix and check if there is a lib directory in there, with libfl inside?

If not, could you try brew --prefix libfl and see if that works any better?

from m100le.

bgri avatar bgri commented on June 7, 2024

Interesting and confusing.

image
Nothing here...
image
Didn't like that one...
image
I did find this.

And I've been searching online a little bit too. Found this one snippet that seems to indicate a minor change to the tandy-tokenize makefile is required -lfl -> -ll

https://stackoverflow.com/a/56087296

I know nothing about this level of scripting so I'm not sure if this even makes sense in our context. Would updating that makefile and running it do what's needed?

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

Interesting! I think you're right that using -ll would work on MacOS. Moreover, that stackoverflow answer reminds me that it would be less work to just include my own main() routine than to try to adapt the Makefile to use -ll some places and -lfl elsewhere.

On a side note, this is not a level of scripting that I think you'd find rewarding to learn. Normally one wouldn't have to deal with this kind of fiddly stuff as the library should just be found automatically by the compiler. If it is in an unusual place, pkg-config should have worked as that's a standard part of flex (and many other libraries). I wonder if this is a bug in the Brew formula or is just a difference in the way MacOS likes to operate that I'm not familiar with yet. Not that it matters, of course. I'll just implement a main() routine and we can circumvent all these shenanigans.

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

Okay, I've updated my tokenize project so that it no longer requires libfl. Please try compiling it now on MacOS. A simple, make should be all you need. If you run make test it'll try some of the sample programs and make sure the output matches what a real (or virtual) Model T generated.

from m100le.

bgri avatar bgri commented on June 7, 2024

Cool. I love the idea of having one input generate all the outputs we need and appreciate your work on this! I've been working on a simple Python script to dump out all lines containing GOTO and GOSUB statements so that I can track them as I try and condense the code. Scripting is harder than it looks!

I tried running the new version and bumped into problems :(

Make produced a tandy tokenize file. I make-installed it. It seems to run, but the output files aren't loading into VirtualT as they're being reported as 'Ill formed BASIC files'. I will try and load one into my m102 tomorrow in case VirtualT is being weird and the files are fine (it's getting late and I don't want to do something dumb :) ).

Command was tandy-tokenize < M100LE+comments.DO > M100LE+comments.BA Output as a .zip ->
M100LE+comments.BA.zip

Also, when I attempted a make in my working directory to produce +comments.BA, .DO, .BA files from the source .DO, the comment cleaner would work, but the output files were a bit mangled. Then tandy tokenize would run over that...
image

created:
Archive.zip

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

I've been working on a simple Python script to dump out all lines containing GOTO and GOSUB statements so that I can track them as I try and condense the code.

Oh, did you know about adjunct/jumpdestinations? It also handles THEN linenum with implicit GOTO and some other weird references to line numbers that I added even though I don't think we use (like ON p GOSUB x, y, z and RESTORE linenum). I think it should work for everything except commands which take a range of numbers (LIST, EDIT, RENUM).

You may want to try using the adjunct/jumpdestinations -c | sort -n to see a sorted count of how many different references there are to a certain destination.

from m100le.

hackerb9 avatar hackerb9 commented on June 7, 2024

Whoa! I see what you mean about the comment cleaner mangling the output files.

0 CLEAR 512
1 DIM WD$(5):  RD
2 DIM HI$(5)   RRENT HINT SYMBOLS
3 DIM SO$(6,5)
4 DIM UL$(6):  rline
5 DIM DA(12):  RRAY
6 R OF DAYS FOR EACH MONTH INTO THE ARRAY DA()

That is not what it does on my system, so I'm guessing the problem is I relied on some feature of GNU sed that MacOS's default sed doesn't support. It looks like you can't just brew install gnu-sed and have it magically work because brew wants to call it gsed. I'll fix my script to use that if it exists.

from m100le.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.