• Black-on-black doesn't change attributes in Frame.js implementation of

    From Josh Renaud@1:103/705 to GitLab issue in main/sbbs on Tue Nov 11 20:30:33 2025
    open https://gitlab.synchro.net/main/sbbs/-/issues/1007

    If you use Frame.js's .putmsg() to write text in a color (say blue-on-black), then OVERWRITE that text with identical text in a different color (say red-on-black), it works as expected.

    But if instead you were to overwrite with BLACK-on-black, it does NOT work. The frame keeps the previous foreground attribute (blue) instead of changing to black.

    In contrast, console.putmsg() does NOT have this problem. It handles black-on-black just fine.

    I presume there is a logic problem in Frame.prototype.putmsg(), but I haven't been able to figure it out.

    Here's a short test case script:

    ```
    load("sbbsdefs.js");
    load("frame.js");

    // COLOR CODES
    var lowRed = '\1N\1R\10';
    var lowBlue = '\1N\1B\10';
    var lowWhite = '\1N\1W\10';
    var highCyan = '\1H\1C\10';
    var lowBlack = '\1N\1K\10';
    var highBlack = '\1H\1K\10';

    console.clear();

    // PLAIN CONSOLE VERSION
    console.gotoxy(1,1);
    console.putmsg(lowWhite + 'PLAIN CONSOLE VERSION');
    mswait(4000);
    console.gotoxy(1,1);
    console.putmsg(lowBlue + 'TEST1 TEST1' + highBlack + ' ... should say TEST1 TEST1 in low blue on black ');
    mswait(4000);
    console.gotoxy(1,1);
    console.putmsg(lowBlack + 'TEST2 TEST2' + highBlack + ' ... should say TEST2 TEST2 in black on black ');
    mswait(4000);
    console.gotoxy(1,1);
    console.putmsg(highCyan + 'TEST3 TEST3' + highBlack + ' ... should say TEST3 TEST3 in high cyan on black ');
    mswait(4000);

    // FRAME VERSION
    testFrame = new Frame(1, 1, 80, 24, BG_BLACK);
    testFrame.open();
    testFrame.draw();
    testFrame.gotoxy(1,1);
    testFrame.putmsg(lowWhite + 'FRAME.JS VERSION');
    testFrame.cycle();
    mswait(4000);
    testFrame.gotoxy(1,1);
    testFrame.putmsg(lowBlue + 'TEST1 TEST1' + highBlack + ' ... should say TEST1 TEST1 in low blue on black ');
    testFrame.cycle();
    mswait(4000);
    testFrame.gotoxy(1,1);
    testFrame.putmsg(lowBlack + 'TEST2 TEST2' + highBlack + ' ... should say TEST2 TEST2 in black on black ');
    testFrame.cycle();
    mswait(4000);
    testFrame.gotoxy(1,1);
    testFrame.putmsg(highCyan + 'TEST3 TEST3' + highBlack + ' ... should say TEST3 TEST3 in high cyan on black ');
    testFrame.cycle();
    mswait(4000);
    ```
    --- SBBSecho 3.31-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to GitLab note in main/sbbs on Wed Nov 12 20:27:39 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/1007#note_7872

    The problem appears to be line 391 in frame.js...

    ```javascript
    if(attr)
    this.__properties__.data[py][px].attr = attr;
    ```

    Since (dark) black on black has a value of zero, it doesn't actually get set.

    This change was apparently made in 2011 with commit 72488196a51
    --- SBBSecho 3.31-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Deucе@1:103/705 to GitLab note in main/sbbs on Wed Nov 12 20:30:00 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/1007#note_7874

    A simple workaround would be to use *blinking* black on black. :grin:
    --- SBBSecho 3.31-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Josh Renaud@1:103/705 to GitLab note in main/sbbs on Thu Nov 13 07:06:57 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/1007#note_7875

    A better check might be `if(attr !== undefined)`? Or maybe a comparison with the existing attr to see if they're different?

    ```
    if(attr !== undefined && properties.data[x + position.offset.x][y + position.offset.y].attr != attr)
    properties.data[x + position.offset.x][y + position.offset.y].attr = attr;
    ```
    ?
    --- SBBSecho 3.31-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Josh Renaud@1:103/705 to GitLab note in main/sbbs on Thu Nov 13 07:12:16 2025
    https://gitlab.synchro.net/main/sbbs/-/issues/1007#note_7876

    Actually, on second thought, that's probably a bad idea -- `undefined` is used for transparency.

    I should probably try some tests.
    --- SBBSecho 3.31-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)

Novedades:

Servidor de Quake 3 Arena Online! - Conectate a ferchobbs.ddns.net, puerto 27960 y vence con tu equipo!