My MSX applications

I learned to program in Basic during an extracurricular activity at my elementary school (ARCE) over the last couple of years with Juan Carlos, a teacher who came from Salvador Batlle.

Later I bought an MSX computer (a Sony Hit Bit 501P (Sony HB-501P)) and, together with a friend, we explored the possibilities of the machine, spending entire afternoons typing programs that came written on paper in some MSX magazines of the time.

The next step, after taking up the challenge from my math teacher, was to learn to program in MSX assembly language (Z-80 processor).


On this website, I intend to share some of the best applications I programmed back then in .cas format:

  • Flute: A program for a competition at my secondary school (I.B. Gabriel Ferrater), when I was in the first year of BUP (in BASIC).
  • Design: A graphic designer, to design the graphics for the games he was going to program in the future (in Assembler Z-80).
  • Zodia: A spaceship game, with vertical scrolling included (in Assembler Z-80).
  • Habla: A text-to-speech application for Spanish. (A combination of Z-80 Assembler and BASIC).
  • Tetris: My version of the popular Tetris game. (in Assembler Z-80).
  • Ristu: The seed of what was supposed to be a maze game, inspired by Konami's The Maze of Galious. I ran out of memory... (in Assembler Z-80).
  • I also share the source codes of the apps in Assembler, along with the Hisoft assembler that I bought back in the day, and which I share among the .cas files in the download (not all of them work).


I'm also going to share some modifications I've made to the wav2cas command-line interface application, programmed by Vincent van Dam.

There is now an optional function to dump the signal processed by wav2cas to a csv, among other new features.

I will also share a series of complementary scripts to work with .cas, or with the new .csv of the wav2cas signal samples:

  • histogram.py: Script to obtain histogram values from samples.
  • .
  • split_msx_tapes_into_singular_files.py: Splits .cas files into .cas files containing individual files. Handles casdir file types, plus asm (HiSoft Assembler) source files.
  • .
  • extract_msx_sources.py: It allows you to extract a .txt file with each source file from a .cas file (ascii and asm). It doesn't work very well, but it can be a start.
  • .

Flute (1987)

Watch vídeo

Graphic designer (1989)

Watch vídeo

Zodia (1987-1989)

Watch vídeo

Synthesizer (1991)

Watch vídeo

Tetris (1992)

Watch vídeo

Speak (1991)

Watch vídeo

Ristu (1990-1992)

Watch vídeo

Session with the assembler

Watch vídeo

Program description

image
image

The Flauta program was created to participate in a software competition at my secondary school (I.B. Gabriel Ferrater), when I was in the first year of high school.

It is intended to be an application for reviewing the finger position for playing each note on a flute.

The program is an excuse to display a user interface in graphical mode.

You can see a video of the program working Demo video

image
image

The idea of the graphic designer (Diseña) was to have a tool to be able to properly design the graphics for the games he was going to program in the future.

It is programmed in Assembler Z-80.

I finished programming it after two intensive months of development.

It's the most profitable program I've programmed, thanks to its usefulness and the number of times I've used it.

With it, you could design presentation screens, sprites, and game characters.

You can see a video of the program working Demo video


There's also a demo showing the best screenshots and graphics I designed with it: Video of the best screens

image
image

I programmed the Zodia spaceship game inspired by Konami's scrolling spaceship games.

It is programmed in Assembler Z-80.

It is dedicated to my math teacher (J. R. M. - José Ramón Molina), for giving me the idea of learning assembler.

The game is on SCREEN 1, with lighter graphics than SCREEN 2.


To give you an idea of what things were like...

Obviously, at some point the score achieved by the player had to be printed...

The numbers were either equivalent to uint8 or uint16

For the scoreboard, I chose the uint16 type (it couldn't exceed 65535)

To print the digits, the number had to be converted to Base-10, which I did by dividing by 10 n times, taking the moduli and quotients.

But... the Z-80 didn't have any instructions in Assembler for multiplying or dividing!! And now what?

Well, it's easy... we divide, subtracting the divisor from the dividend N times, and we increase the quotient as long as the result doesn't overflow...

How tacky!

Well, that's how things were...


There is a video that shows the complete scroll (with some errors): Full scroll video


You can see a video of the program working Demo video

image

After finishing high school, I wanted to try my programming skills in assembly language again.

The objective was to program a synthesizer adapted to the MSX sound chip (with three voices, and applying reverb effects (rapidly changing (manually) the emitted frequency for each pressed note), and turning off the note when the key was released.

The state of three synthesizer keys pressed at the same time (the three voices of the chip) was remembered.

I also wanted to make use of the frequencies associated with each note, which I found hardcoded in an area of the MSX ROM during a search.

To perform the search, I proceeded, simply knowing the frequency of the note A ((tuning fork) 400 Hz, and applying a root-twelve factor of 2 (2 ^ (1/12)) (one octave, twelve semitones)).

And then searching for the corresponding elements in the ROM, with uint16 type numbers.


You can see a video of the program working Demo video

image

During the summer between my senior year of secondary school and my first year of Teleco (1991), I worked intensively as a waiter at Bar Argente's in Salou.

I took the bus back and forth, and on the way back, before heading home, I would stop by an arcade to play a few games of the fabulous Tetris...

After more than 60 games of that game, I became an expert, and I loved finding that game when fate took me by chance to a place where there were arcade machines.


In 1992, I decided to program my version of Tetris, in Assembler Z-80 and in the record time of three days.

At that time, I had already flirted a bit with the digitization of sounds (from the MSX tape), and on the game's standby screen, a song is played through the speaker. (the openMSX emulator perfectly emulates that detail).


You can see a video of the program working Demo video

image

I don't remember when I first came across the possibility of digitizing sounds from the MSX tape.

But I do remember that I didn't even know what frequency I was sampling at... I just put a delay loop between samples for digitization, and the same delay loop for playback through the speaker.

I found that when that delay was too large, the sound didn't reproduce well. Later, I learned through sampling theory that this effect was known as aliasing.


From a television series I liked, I got the idea that a computer could "pronounce" a sentence chosen by the user.

So, with the new toy of digitization, I set out to obtain all the phonemes by digitizing my own voice.

The next step would be to go through the letters of a sentence, separate it into phonemes, and emit each phoneme in turn.

Yeah, a bit tacky... But it didn't give any more...

I programmed the rules of Spanish phonetics in an Assembler Z-80 application, with the interaction with the user by asking for the sentence in BASIC.


With the openMSX emulator you can perfectly emulate the execution of that little program.


You can see a video of the program working Demo video

image

Well, after spending countless hours playing The Maze of Galious, I decided to create a maze game inspired by it, and with a very similar visual appearance (with my limitations).

The program was again in Assembler Z-80.

I created the screens (in a 14 x 12 screen matrix) based on 4x4 character blocks that were combined like a puzzle.

So, a screen occupied 5 x 8 = 40 bytes, although a fixed memory occupation had to be added to define the 4 x 4 blocks.


I rescued several implementations to move the character around the world, although the most complete one ('PERFEC'), I couldn't get it to work in the emulator.

I think it has to do with the fact that the source code in assembly took up too much space, and conflicted with the area BASIC data, and the assembler, under those conditions, refused to assemble the program.

I remember that one day I had to do the trick of moving the BASIC memory area higher (with some wonderful pokes that I no longer remember).

And without them, there is no way to make that implementation work (although that source code was extracted correctly in the .cas).


You can see a video of the program working Demo video

image

The assembler is a fundamental part of developing in Assembler Z-80.

I bought the devpack from hisoft and made the most of it, making intensive use of it.

There was also a monitor, but I never knew how to get it to work...


In the video you can see an example of a session with the assembler Demo video

Videos

Downloads