News:

Want an XLerator? Please participate in the market research thread: https://lisalist2.com/index.php/topic,594.msg4180.html

Main Menu

Newbie: simple Pascal program doesn't work in LisaEm

Started by kewatsdop, January 28, 2022, 02:19:50 AM

Previous topic - Next topic

kewatsdop

Hi all,

I'm new here so please don't be mad at me if this question has an obvious answer. I search the forum and Google and could not find anything obvious...

I input a very simple Pascal program "beep.text" in LisaEm, using Workshop 3.0:

PROGRAM sound;
USES HWINT;

BEGIN
    Beep(3000, 5000);
END.


Then I compile it with P command to beep.obj, then link it with L command using beep.obj, iospaslib.obj and sys1lib.obj. The object files are linked successfully into an output file bp.obj. Then I run the program with R, and it executes successfully but there's no sound from the beeper.

What am I doing wrong?

Adam


compu_85

If you go into the Preferences window and change the beeper volume does it make a tone?

kewatsdop

I don't see beeper volume option (see attached), but LisaEm _does_ make beeper sounds e.g. when boot drive is missing or similar.

rayarachelian

#3
@compu_85 is talking about the Preferences icon in Lisa Office System (LOS). see: http://toastytech.com/guis/lisaos31prefs.png




(You'd normally need to install both Lisa Pascal Workshop (LPW) + Lisa Office on the same ProFile drive and then use the Environments window to switch between them, though it's possible to just install LPW by itself.)
see: https://lisafaq.sunder.net/single.html#lisafaq-sw_os_environments

However, first things first, do you hear sound effects such as clicks when the Lisa turns on/off and the floppy is accessed? So looks like you've replied that you do, so that's good.
Next, I'd say try changing the pitch value to some other value, and extend the delay, and see if that helps.

I'd also see if there's some Setvolume() function you can access from your code and try to set that, I guess to 5 or 7 or whatever the max is.

As an aside/reference for other sound issues with LisaEm:

(I know from your screenshot that you're using MacOS so the following doesn't apply to you, this section is for future reference for others who might be searching LisaList2 for sound issues.)
There is an issue on GTK (Linux, FreeBSD, etc.) with wxWidgets where, wxWidgets needs to be compiled with LibSDL in order for sound to work. see: https://docs.wxwidgets.org/trunk/classwx_sound.html
"Currently this class is implemented on Windows and Unix and can use either Open Sound System (OSS) or Simple DirectMedia Layer (SDL) under the latter. Notice that OSS is not provided any more by most, and maybe even all, Linux systems in 2017 and osspd (OSS Proxy Daemon) package typically needs to be installed to make it work."

So if you're on Linux/FreeBSD, you'll likely need the  pulseaudio/ALSA proxy package bridges installed as well. I know, it's a mess.
All that said, I've seen sounds fail on Windows and MacOS as well.

But generally if you can hear the sound effects in LisaEm, clicks, floppy, etc., and you've said you did in this thread, you should hear the beeps from the Lisa Boot ROM and LOS/LPW as well.
You don't know what it's like, you don't have a clue, if you did you'd find yourselves doing the same thing, too, Writing the code, Writing the code

compu_85

You can access the preferences window within the workshop too - I believe it's under the System heading.

kewatsdop

Thank you both for trying to help!

I did access the Preferences window, and I can hear the sound being played when setting the volume low/up, but the program above still doesn't give me any sound. I did play with frequency/duration values, to no avail.

If that helps in anything, I'm using macOS Monterey, lisaem-1.2.7-RC3a-2020.08.24, Workshop 3.0.


rayarachelian

You don't know what it's like, you don't have a clue, if you did you'd find yourselves doing the same thing, too, Writing the code, Writing the code

kewatsdop

Thank you for trying to help though...

I'll give it another try during the weekend on my Windows machine, with exactly the same steps, and will update us here.

rayarachelian

Quote from: kewatsdop on January 28, 2022, 12:29:56 PM
Thank you for trying to help though...

I'll give it another try during the weekend on my Windows machine, with exactly the same steps, and will update us here.

Sure thing. Pro tip, you can just copy the lisaem-profile.dc42 file from your Mac to your Windows machines. You won't be able to copy the preferences file, which on macos is in plist format (I think), but on Windows will be a .ini file, but you can manually copy the LisaEm preferences, etc.

If you want, could you create a blank dc42 floppy in LisaEm and use the LPW F)ile menu to copy both the source code and the compiled program to this new floppy image, and then once you eject that floppy image from LPW, upload it here. If I have time this weekend, I can poke at it and see what happens.

(I can compile LisaEm with debug enabled and add some code around the sound generation routines to see if LisaEm notices sound being invoked, and what frequency, etc.)
You don't know what it's like, you don't have a clue, if you did you'd find yourselves doing the same thing, too, Writing the code, Writing the code

kewatsdop

Sure will do. Thank you Ray for helping. Also in about 10-12 days from now I'll have an opportunity to test this on a physical Lisa...

I will have other newbie questions too, but not sure if I should start a separate thread; I'm new to this forum and don't know the local netiquette. One thing for example is why, no matter how I try, I cannot set the 6552 Shift Register to any value in assembly code. I'm trying to do e.g. MOVE d0, $00FCDD81 or MOVE d0, $0000DD81 (documentation says sometimes former, sometimes latter for the VIA memory location) plus $14 offset to access the Shift Register and it always gives me ADDRESS ERROR when running the program from Pascal. Any ideas what I'm doing wrong? Sorry if this is not for this thread, will start a new one if needed.

rayarachelian

I've split the reply to this new topic (writing directly to the VIA) to this post: https://lisalist2.com/index.php/topic,242.0.html
You don't know what it's like, you don't have a clue, if you did you'd find yourselves doing the same thing, too, Writing the code, Writing the code

kewatsdop

Thank you Ray, will follow in both threads. But somehow I cannot add my answer to the other thread ("Database Error").

blusnowkitty

Quote from: kewatsdop on January 28, 2022, 04:35:45 PM
Thank you Ray, will follow in both threads. But somehow I cannot add my answer to the other thread ("Database Error").

SMF (forum software) doesn't like the enhanced character set that OS X/iOS uses for things like apostrophes.
You haven't lived until you've heard the sound of a Sony 400k drive.

kewatsdop

Indeed, thank you blusnowkitty. I managed to upload my comment when I removed my m-dashes.

kewatsdop

#14
I started a new thread on being unable to mount a diskette, plus one more on not seeing a *.dc42 image from Mac on a Windows installation.