taviso / 123elf

A native port of Lotus 1-2-3 to Linux.
1.18k stars 59 forks source link

Macro / step not visible #101

Closed rruhle closed 1 year ago

rruhle commented 2 years ago

Hello, many thanks for this project, which migrates Lotus 1-2-3 from Windows to Linux

Linux novice using (Ubuntu 22.04 LTS) Release Candidate "lotus123r3_1.0-2jammy_i386.deb"

This runs my legacy 30yr. old 16bit DOS 123.v2 macro library natively on 64bit PopOS linux. Simply amazing

Minor hot key, macro syntax, & display changes mostly due to lotus-123 application change from v2 to v3.

Can't figure out why Macro code won't display during STEP function "Ctrl-F2". Getting panel results only.

Do Macros show their steps for anyone else?

taviso commented 2 years ago

I see, you're right - the STEP function works but doesn't display the step at the bottom like it does in DOS. Let me investigate and see if I can figure out why!

taviso commented 2 years ago

Okay, let's try to fix this issue! It looks like the STEP function is handled by mr_step_wait(). I don't see any logic anywhere for displaying the current status, I think it was never implemented on UNIX.

Let's try to add some, I think we can just call set_error_string() with the current macro step and see if that works.

Something like this...

int mr_step_wait()
{
    uint32_t key  = input_key();
    uint16_t wkey = key;
    char cellname[256];

    char *p;

    if (key & 0xFFFF0000)
        return true;

    if (wkey == 0)
        return false;

    p = cellname;

    if (INVALID_CELL_ADDR(mac_cell)) {
        if (mac_xrtns.get_mac_name) {
            mac_xrtns.get_mac_name(&p);
        } else if (!INVALID_CELL_ADDR(mac_lastgoodcell)) {
            dspcref(0xff, mac_lastgoodcell, 0, &p, 1);
        }
    } else {
        dspcref(0xff, mac_cell, 0, &p, 1);
    }

    // Terminate the string.
    *p = 0;

    if (strlen(cellname)) {
        set_error_string(cellname, 0, 0);
    }

    if (wkey != KFUN_BREAK)
        return true;

    if (!mac_nobreak())
        return true;

    return false;
}

I'll try this out for a while and see if anything breaks, if it looks okay I'll commit it.

rruhle commented 2 years ago

Excellent - look forward to beta testing..

rruhle commented 2 years ago

If waiting on me to beta test, I would need a procedure to compile, or *.deb file similar to "lotus123r3_1.0-3jammy_i386.deb"

My Linux terminal Kung Fu began this year on System76 hardware with Pop!_OS, but tech support won't help compile anything from source, preferring to direct me to apps within their POP shop instead.

taviso commented 2 years ago

Oh okay - no problem, see if this one works!

https://lock.cmpxchg8b.com/files/lotus123r3_1.0-4betajammy_i386.deb

rruhle commented 2 years ago

Congratulations are in order, since Macro STEP function now displays limited Macro progress at bottom left.

1) Except for blank {Subroutines}, STEP displays top-level command, with first 18 of 625 characters of macro, until the next macro line becomes active. So, top-level functions are followed, but not displayed beyond first 18 characters of each line. 2) STEP can appear stuck waiting or blank during multi-levels of subroutine {Branch ..} and perhaps {goto}

-- Some trouble with installing the Beta -- Apparently, Linux "APT" re/install refuses .deb file names that don't match expected release candidates? 'APT' $ 'Note, selecting 'lotus123r3:i386' instead of 'lotus123r3_1.0-4betajammy_i386' After hiding prior release files & disconnecting internet .deb Beta file loaded with complaints