[MOTO] BASIC Compiler .. ?

Cette catégorie traite de développements récents pour nos vieilles machines, applications, jeux ou démos... Amis programmeurs, c'est ici que vous pourrez enfin devenir célèbres!

Modérateurs : Papy.G, fneck, Carl

Garland
Messages : 40
Inscription : 25 oct. 2018 19:40

[MOTO] BASIC Compiler .. ?

Message par Garland »

A little premise. Some time ago, I started to work on a shooter for MO6, 100% plain asm. I managed to use double buffer with scrolling screen, collisions, animations and whatever. I want to thank Fool-Duplex for that, because he has had the monk's patience to teach me and to help me with my issues. The result was very fluid and worthed the effort:



Now planning to have a complete, commercial game is not an easy decision. Thomson machines are not so spread around the world, there's no market, the demo scene is mainly focused on more powerful and rewarding machines. But nothing could stop our love for Thomson so occasionally i come back to code something; i often don't' have so much time to spend on asm because you know asm is prolix.

The Basic128 offers a very confortable way to get a prototype quickly despite his biggest flaws (no struct progamming, performaces slow as hell).

Then I was looking for a compromise and i started to code some plain asm routine to use with Basic 128.

As you may know, the Thomson game library was filled with games coded with basic + asm. They all stuttered, while 100% asm game like Captain blood or Vampire were fluid. I wanted to test this compromise by my hands and here's a little puzzle game i did with my libraries:



The speed is enjoyable but i coded this under very strict constraints. Only one sprite to move for each frame, no erasement or sprite masking, color collision check (which is painful) and most of all the sluggish speed of basic interpreter.

I had another try today, this demo uses GET/PUT to redraw the old background portion:



While the speed isn't that bad, the flickering is horrible. This needs a double buffer and a double buffer will probably kill the performances in basic.

Beside all, Basic 128 interpreter will remain always such a ball and chain for performances, while plain asm will take you too much time even if you want to just prototype something.

So i had a read on these boards about compilers:

viewtopic.php?f=24&t=9543&p=145508&hili ... ur#p145508


Do you think BASCOM could be adapted for Basic 1 / 128 / 512 ??

How much effort would require for an expert to write a Thomson Simiv Basic compiler which could work on any Thomson machine?

Writing once to compile for each machine should be nice even for plain asm coders.
Fool-DupleX
Messages : 2284
Inscription : 06 avr. 2009 12:07

Re: [MOTO] BASIC Compiler .. ?

Message par Fool-DupleX »

Hi, it's me. :lol:

Before shooting at the stars or reinventing the wheel, I would advise to have a look at two very nice initiatives back in the days :

1. Speedy Wonder : a BASIC compiler on Thomson
2. L'interpréteur BASIC du TO7, a book that explains in depth how to add new instructions to BASIC or totally modify it, including writing your own compiler and tips and tricks to improve BASIC's speed. This book has a very nice SPRITE routine for example (no double buffering though). It will need a bit of porting though, since it was written for the TO7.
jvernet
Messages : 2454
Inscription : 12 avr. 2007 10:59
Localisation : France 69
Contact :

Re: [MOTO] BASIC Compiler .. ?

Message par jvernet »

Fool-DupleX a écrit : 02 juil. 2019 14:53 [supp modo: quote inutile]
Merci pour l'info sur le compilateur, il faut que j'essaye ça !
jvernet
Messages : 2454
Inscription : 12 avr. 2007 10:59
Localisation : France 69
Contact :

Re: [MOTO] BASIC Compiler .. ?

Message par jvernet »

Le compilateur marche plutôt pas mal, c'est efficace, mais pas de calculs en réels ??. Une fois que tu as compris qu'il ne fonctionne pas sous BASIC 128, aussi...

J'ai chargé la doc DJVU, elle n'est pas très lisible :( . Il y en aurait une version avec une meilleure définition ?
Daniel
Messages : 17316
Inscription : 01 mai 2007 18:30
Localisation : Vaucluse
Contact :

Re: [MOTO] BASIC Compiler .. ?

Message par Daniel »

Si ça peut aider, voici le pdf original avant compression au format DjVu :
speedy_wonder.zip
(742.57 Kio) Téléchargé 148 fois
Daniel
L'obstacle augmente mon ardeur.
Garland
Messages : 40
Inscription : 25 oct. 2018 19:40

Re: [MOTO] BASIC Compiler .. ?

Message par Garland »

Fool-DupleX a écrit : 02 juil. 2019 14:53 Hi, it's me. :lol:

Before shooting at the stars or reinventing the wheel, I would advise to have a look at two very nice initiatives back in the days :

1. Speedy Wonder : a BASIC compiler on Thomson
2. L'interpréteur BASIC du TO7, a book that explains in depth how to add new instructions to BASIC or totally modify it, including writing your own compiler and tips and tricks to improve BASIC's speed. This book has a very nice SPRITE routine for example (no double buffering though). It will need a bit of porting though, since it was written for the TO7.
Hey Fool :)

Point 2 is very nice and i already started to read that book.

Point 1 to me is a little useless since Speedy Wonder only works for Basic 1.0 and only on the machine (no cross development)

Thanks anyway !! :)
Fool-DupleX
Messages : 2284
Inscription : 06 avr. 2009 12:07

Re: [MOTO] BASIC Compiler .. ?

Message par Fool-DupleX »

The nice thing with point 2 is that the book is actually a cleverly concealed reverse-engineering of BASIC. Following each chapter and step, you should be able to apply the technique to other BASIC versions. That's why I mention it.
jvernet
Messages : 2454
Inscription : 12 avr. 2007 10:59
Localisation : France 69
Contact :

Re: [MOTO] BASIC Compiler .. ?

Message par jvernet »

Daniel a écrit : 05 juil. 2019 14:25 Si ça peut aider, voici le pdf original avant compression au format DjVu :
speedy_wonder.zip
DJVU n'a pas l'air de beaucoup altérer les documents, c'est à peine mieux. Le document d'origine n'est peut être plus très lisible.
Dernière modification par jvernet le 08 juil. 2019 23:07, modifié 1 fois.
Ythunder
Messages : 928
Inscription : 21 août 2019 10:12

Re: [MOTO] BASIC Compiler .. ?

Message par Ythunder »

Le shoot est d'enfer, quelle rapidité.

Il y a des projets qui peuvent naitre sur thomson. De gros projets, mais comme écrit ce qui peut tres génant c'est l'aspect trop confidentiel.
Répondre