hmsl icon indicating copy to clipboard operation
hmsl copied to clipboard

HMSL for Amiga is unavailable

Open philburk opened this issue 1 year ago • 12 comments

Some users are trying to run HMSL on the new Amigas and Amiga emulators. Files are scattered and some are missing.

JForth for the Amiga can be downloaded from: https://www.softsynth.com/jforth/download.html

Amiga source files are in https://github.com/philburk/hmsl/tree/master/hmsl/amiga

The "Amiga Supplement" mentioned in the main HMSL manual seems to be missing! The supplement was probably written on the Mac because we used Word and the Apple laser printer.

The file for loading HMSL on top of JForth is at https://github.com/philburk/hmsl/blob/master/hmsl/amiga/hostdep/load_hmsl.fth

Note that it does not have the ".fth" suffix on the file names.

It may be possible to recover HMSL on Amiga by:

  1. Run JForth on Amiga
  2. Expand the dictionary
  3. Update the load_hmsl.fth to use the ".fth" suffix. Maybe extend this load file.
  4. Compile HMSL
  5. SAVE-FORTH

philburk avatar Sep 10 '23 16:09 philburk

There are new Amigas? I knew about the emulators but I didn't know you could get newly-built hardware.

znmeb avatar Sep 10 '23 17:09 znmeb

I think the new hardware is basically a turnkey dedicated emulator: http://www.a-eon.com/?page=x5000

philburk avatar Sep 10 '23 19:09 philburk

(follow-up to my email)

Hello!

So for now I'm just trying a couple of things just to see how far I can go, and I have a couple questions:

  • is it a correct assumption that HMSL for Amiga, should be in fact a combination of platform specific files (hmsl/amiga/hostdep) with platform agnostic files (hmsl/fth)?
  • I have assigned the former to hh: and the later to h: as well as edited hh:load_hmsl.fth so that it points to the needed files with right extension. These assignments and edits seem to help progress in the parsing of the file. I am making changes every time I block somewhere new.
  • I had to force .need HOST=AMIGA because the test for the DOS_LIB constant is failing, which makes me think that a couple of preparatory steps are missing.
  • I noticed that ho:utils does not seem to exist anywhere, so I replaced it with h:utils.fth but then I am stuck because JForth does not know ?DO so include load_hmsl.fth breaks at this point. Could it be that h:utils.fth was written for PForth and not JForth? And what is/was ho:?

320x200 avatar Sep 15 '23 17:09 320x200

The files in "hmsl/amiga/hostdep" are designed to load on top of JForth. The files in "hmsl//fth" are designed to load on top of pForth. Those files need to be reconciled.

One problem is that the "hmsl/amiga/hostdep" is trying to load "hmsl//fth" files on top of JForth. JForth and pForth are very similar at a basic level. But there are a few differences, eg. DOS_LIB. You seem to be hitting those.

I have asked the HMSL list if anyone has old Amiga HMSL disks. Fingers crossed.

JForth does not know ?DO

I think the JForth was the same as ?DO. Try this in JForth:

0 0 DO i . cr LOOP ." yay"

If it hangs then I am wrong. If it prints "yay" then I am right. If so you can define an alias. Try:

: ?DO postpone do ; immediate

And what is/was ho:?

I think that was the ODE directory.

philburk avatar Sep 15 '23 23:09 philburk

And what is/was ho:?

I think that was the ODE directory.

Yes! It was the utils from ODE that was missing, not the one from HMSL. However further down the compilation, the ?DO issue appeared again via stacks.fth

0 0 DO i . cr LOOP ." yay"

This one : YAY 0 0 DO i . cr LOOP ." yay" ; worked. I do get a "yay" back. However:

: ?DO postpone do ; immediate

Does not work. POSTPONE does not seem to exist or be defined in JForth?

I have asked the HMSL list if anyone has old Amiga HMSL disks. Fingers crossed.

Thanks, fingers crossed indeed :)

320x200 avatar Sep 16 '23 17:09 320x200

POSTPONE does not seem to exist or be defined in JForth?

Right. I spent some time today installing an Amiga emulator. I managed to get JForth running. Try this:

ALIAS DO ?DO IMMEDIATE
: YAY 0 0 ?DO i . cr LOOP ." yay" ;
YAY

BTW, The word DO does not work in JForth outside of a colon definition. It works in pForth.

I will help to get HMSL running on the Amiga again.

philburk avatar Sep 17 '23 06:09 philburk

More progress:

  • the ?DO alias works
  • stacks.fth failed later because there is a conditional compilation at the end with [IF]...[THEN] and it looks like JForth does not support this. It seems it was just some test words, so I commented out the whole block.
  • now stuck at the include of h:midi_globals.fth that fails right early on with an undefined hostmidi_port(). Could it be that h:midi_globals.fth is now only meant to work on Mac?

320x200 avatar Sep 17 '23 14:09 320x200

JForth has .IF and .THEN pForth uses [IF] and [THEN], which are more standard. Unfortunately ALIAS does not work with [IF] because it scans for [THEN] by name. I will add a compatibility layer for JFortth.

In h:midi_globals.fth you can see that I had to move the variable into the host code.

\ As of 2021, the variable now resides in the Host code.
\ VARIABLE MIDI-PORT      \  Current port being used; 0=modem, 1=printer
: MIDI-PORT hostmidi_port() ;

You can reenable the old variable for now.

philburk avatar Sep 19 '23 15:09 philburk

Could it be that h:midi_globals.fth is now only meant to work on Mac?

The new code does only work on the new Mac. But now I think we should preserve compatibility with JForth. I did not anticipate building HMSL on Amiga from this code base.

philburk avatar Sep 19 '23 15:09 philburk

The new code does only work on the new Mac. But now I think we should preserve compatibility with JForth. I did not anticipate building HMSL on Amiga from this code base.

I can imagine... and really appreciate your help to try bringing Amiga support back!

With the MIDI-PORT variable back, things moved further. However there were a lot of words used to initialize MIDI for JUCE... I think? I commented out these words in the hope they were not used at all on Amiga.

Now I am stuck here https://github.com/philburk/hmsl/blob/7a2925e1f052dcf8d81283fd0fe86d116c9a08c0/hmsl/amiga/hostdep/load_hmsl.fth#L121

and not quite sure how to solve this because this file does not seem to exist anymore.

320x200 avatar Sep 19 '23 18:09 320x200

Oh! That's not good. The event_buffer is code that would store CFAs and data in a time ordered buffer. This was used for scheduling MIDI and Amiga Local sound events in the near future to reduce jitter. Scheduling jitter was a big issue on 8 MHz CPUs.

The event buffer functionality in the current HMSL/JUCE is built in the native C code. See this host API:

https://github.com/philburk/hmsl/blob/7a2925e1f052dcf8d81283fd0fe86d116c9a08c0/native/juce/Source/hmsl_host.h#L98

So yeah, those mising files are not needed on the JUCE version but are needed on the Amiga. I will look again on my old drives. And I just thought of someone else who may have the HMSL Amiga disks!

philburk avatar Sep 20 '23 00:09 philburk

Good news! I found some files that I got from Henry Lowengard. It seems to have the original HMSL source including "event_buffer" and others mixed in with some of Henry's stuff. It might even have an executable hmsl4th! I will figure out what I have and talk to Henry. I don't want to post his personal files without permission.

philburk avatar Sep 21 '23 04:09 philburk