MSX Basic Tokenizer. Should I?

Страница 4/5
1 | 2 | 3 | | 5

By farique

Resident (34)

Аватар пользователя farique

13-08-2019, 18:13

I remade the script without the savestates and it is now working like a charm!
It boots using the default machine or a specified one. An extension can also be specified in case the machine does not have a disk drive.

Using a Phillips NMS 8250 and a Sharp HB-8000 with a Microsol disk extension I had no problems at all. A stress test with a Terminal script to batch convert lots of files at once worked flawlessly. Even when the folder got full it just stopped saving the new files, no corruption.
I feared that opening several instances of openMSX at the same time and mounting the same folder as disk wold cause problems but or the timing of mounting didn't quite clash or they didn't care.

About the speed, I think the bottleneck now is just the time it takes to launch openMSX itself (~2-3s) but have yet to confirm.
The times I got using the TIME command on the Terminal where:
(didn't test with mute)

20 files .bas  to .asc ~95k total:
real 0m56.690s, user 0m0.878s, sys 0m1.221s

20 files .asc to .bas ~115k total:
real 0m55.474s, user 0m0.871s, sys 0m1.238s

Unfortunately I still don't know what was really causing the problem with the previous method, I changed several things at the same time and now I don't know which one was to blame. I know the basic files I was using (from MSX Archive) were mostly corrupted and I am ALMOST sure I had problems with the Sony 500P even using it normally.
I still want to do some stability (and better speed) tests and will report here.

By Manuel

Ascended (16702)

Аватар пользователя Manuel

13-08-2019, 21:29

2-3 seconds? Strange...

On my 2008 PC I did this test:

$ time openmsx -machine Boosted_MSX2_EN -diska /tmp/bla /tmp/quit.tcl 

real	0m0,780s
user	0m0,170s
sys	0m0,166s

and quit.tcl contains:
after realtime 0 exit

So this measures the start-up time for a very large machine and using dir-as-disk. Less than 1 second....

If you can reproduce this, it must be something else.

By farique

Resident (34)

Аватар пользователя farique

21-08-2019, 23:40

Ok, so I did the same test as you (I don't have the files for a Boosted MSX2 so I used the plain Philips NMS 8250) but I'm confused.

The test shows a time around:

real 0m0.180s
user 0m0.032s
sys 0m0.028s

But this time is much smaller than the time the program take to really open and close.
The time it takes from when icon appears on the dock to the time the program closes can be anywhere between 1s to 6s.
What is this discrepancy?
My impression is that the Mac Terminal is asking someone to open the emulator and reporting the job done without accounting the whole process.

By pgimeno

Master (191)

Аватар пользователя pgimeno

08-01-2020, 00:31

Hi farique! I'm interested in using your program in this project: https://notabug.org/pgimeno/vdptest because loading from tape (soundcard in my case) in ASCII really sucks. But I'm facing a problem, there's no license at all in the MSGitHub repository for the program, and without one, it can't be legally used for any purpose other than staring at the source.

Would you please include a license? It would greatly increase the usefulness of the program.

By farique

Resident (34)

Аватар пользователя farique

15-01-2020, 18:27

Yeah, pgimeno, I read that once: "no one will ever dare to touch your code without an explicit licence", never gave it a second thought.
I will include a license shortly.
Thanks for your interest.

By Grauw

Ascended (9176)

Аватар пользователя Grauw

15-01-2020, 18:45

I recommend MIT or BSD. Pgimeno's project is MIT.

By farique

Resident (34)

Аватар пользователя farique

15-01-2020, 20:08

There you go. It now has a MIT license.
You are welcome Tongue

By pgimeno

Master (191)

Аватар пользователя pgimeno

18-01-2020, 23:17

Thank you! Unfortunately it comes a bit too late. I've already finished my own tokenizer (asc2cld.py + test_asc2cld/*). Sorry I couldn't wait, I needed to move on with my project!

Note there are several licenses called MIT. To prevent confusion, the FSF recommendation is to avoid calling it "MIT". It is uniquely called Expat. Another license often called MIT is the X11 license, which includes an additional clause.

By farique

Resident (34)

Аватар пользователя farique

19-01-2020, 01:04

Sorry but nice. The more the merrier!

By pgimeno

Master (191)

Аватар пользователя pgimeno

19-01-2020, 02:04

While doing unit testing, I ran into an interesting bug in MSX BASIC:

10 PRINT 9.999995!
RUN
 1
Ok

The ! forces single precision mode, which rounds the float to 6 significant digits. But when the rounding propagates the carry all the way to the next power of ten, the exponent is not increased.

I reproduce the bug in my tokenizer: https://notabug.org/pgimeno/vdptest/src/tokens/asc2cld.py#L167

I also ran into a gotcha. If you enter 1e-65, you get 0, i.e. it silently underflows. But if you enter 1e-66 or less, it gives you Overflow.

Страница 4/5
1 | 2 | 3 | | 5