Skip to content
Snippets Groups Projects

Initial changes to support MODE7 graphics natively

Closed Nigel Reed requested to merge mode7 into master
26 unresolved threads

Similar to PETSCII it will answer on a dedicated port.

Merge request reports

Merge request pipeline #8231 passed

Merge request pipeline passed for e5b2ee64

Approval is optional

Closed by Rob SwindellRob Swindell 1 month ago (Feb 20, 2025 7:30am UTC)

Merge details

  • The changes were not merged into master.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Rob Swindell
  • Rob Swindell
  • 13 if (!options)
    14 options = load("modopts.js", "chat_sec");
    15 if (!options)
    16 options = {};
    17 if (options.irc === undefined)
    18 options.irc = true;
    19 if (options.irc_server === undefined)
    20 options.irc_server = "irc.synchro.net 6667";
    21 if (options.irc_channel === undefined)
    22 options.irc_channel = "#Synchronet";
    23 if (options.irc_seclevel === undefined)
    24 options.irc_seclevel = 90;
    25 if (options.finger === undefined)
    26 options.finger = true;
    27 if (options.imsg === undefined)
    28 options.imsg = true;
    • I'm uneasy about all this copy-pasta. Now we've got 2 places that someone (me) has to update anytime we need to update these defaults. Please move to a common source file or .ini file or something.

    • Author Developer

      OK. I will have to think about how I want to do that. I'll put it on my todo list.

    • Please register or sign in to reply
  • 127 break;
    128 case 'M':
    129 bbs.exec_xtrn("MULTIRELAYCHAT");
    130 break;
    131 case '?':
    132 if(user.settings & USER_EXPERT)
    133 bbs.menu("mode7/mode7_chat");
    134 break;
    135 case 'Q':
    136 break menu;
    137
    138 default:
    139 console.clear();
    140 break;
    141 }
    142 }
  • 1 // E-mail Section
  • 48 49
    49 50 while(bbs.online && !js.terminated) {
    50 51 if(bbs.menu("../bullseye", P_NOERROR)) {
    51 console.mnemonics("\r\nEnter number of bulletin or [~Quit]: ");
    52 console.mnemonics(gettext("\r\nEnter number of bulletin or [~Quit]: "));
  • 67 67 if(!str.length) // blank
    68 68 continue;
    69 69
    70
  • 11 11
    12 12 require("sbbsdefs.js", 'SS_RLOGIN');
    13 13 require("nodedefs.js", 'NODE_QUIET');
    14
  • exec/mode7.js 0 → 100644
    1 // Default/Classic Synchronet Command Shell
  • 8 8 const no_str = bbs.text(bbs.text.No);
    9 9 const no_key = no_str[0];
    10 10
    11 var options = load("modopts.js", "noyesbar");
  • 18 22 console.question = console.question.substring(2);
    19 23 }
    20 24
    21 console.putmsg("\x01n\x01b\x01h[\x01c@CHECKMARK@\x01b] \x01y@QUESTION->@? @CLEAR_HOT@", P_NOABORT);
    25 console.putmsg(options.noyes_question || "\x01n\x01b\x01h[\x01c@CHECKMARK@\x01b] \x01y@QUESTION->@? @CLEAR_HOT@", P_NOABORT);
  • 245 245 return ch;
    246 246 }
    247 247
    248 unsigned char cp437_to_mode7(unsigned char ch)
  • 24 24 #include "telnet.h"
    25 25 #include "netwrap.h"
    26 26 #include "petdefs.h"
    27 #include "mode7defs.h"
  • 5663 5664 sbbs->outcom(PETSCII_UPPERLOWER);
    5664 5665 }
    5665 5666
    5667 if (inet_addrport(&local_addr) == startup->mode7_port) {
    5668 sbbs->autoterm = MODE7;
    5669 sbbs->cols = 40;
    5670 sbbs->rows = 25;
  • 22 22 #include "sbbs.h"
    23 23 #include "utf8.h"
    24 24 #include "petdefs.h"
    25 #include "mode7defs.h"
  • 54 55 mode |= P_NOPAUSE;
    55 56 } else if (stricmp(p, ".seq") == 0) {
    56 57 mode |= P_PETSCII;
    58 } else if (stricmp(p, ".m7") == 0) {
  • 1961 1968 }
    1962 1969 if (term_supports(PETSCII))
    1963 1970 petscii_convert(bp, output_len);
    1971 else if (term_supports(MODE7))
    • I noticed this conversion isn't happening in the Windows version of this function, but it's not happening for PETSCII or UTF-8 either, so we'll have to deal with all 3 of those charset conversion together someday.

    • Please register or sign in to reply
  • 1 /* Commodore/PET definitions */
  • 6 * *
    7 * Copyright Rob Swindell - http://www.synchro.net/copyright.html *
    8 * *
    9 * This library is free software; you can redistribute it and/or *
    10 * modify it under the terms of the GNU Lesser General Public License *
    11 * as published by the Free Software Foundation; either version 2 *
    12 * of the License, or (at your option) any later version. *
    13 * See the GNU Lesser General Public License for more details: lgpl.txt or *
    14 * http://www.fsf.org/copyleft/lesser.html *
    15 * *
    16 * For Synchronet coding style and modification guidelines, see *
    17 * http://www.synchro.net/source.html *
    18 * *
    19 * Note: If this box doesn't appear square, then you need to fix your tabs. *
    20 ****************************************************************************/
    21 #ifndef _MODE7DFS_H_
  • 51
    52 /* Cursor movement */
    53 MODE7_LEFT = 8,
    54 MODE7_RIGHT = 9,
    55 MODE7_DOWN = 10,
    56 MODE7_UP = 11,
    57 MODE7_HOME = 30,
    58 MODE7_CLEAR = 12,
    59 /* Symbols (which don't align with ASCII) */
    60 MODE7_BRITPOUND = 96,
    61 MODE7_QUARTER = 123,
    62 MODE7_HALF = 92,
    63 MODE7_THREE_QUARTER = 125,
    64 MODE7_DIVIDE = 126
    65 /* Replacement chars (missing ASCII chars) */
    66 // PETSCII_BACKSLASH = '/', // the 109 graphics char is an 'M' in shifted/text mode :-(
  • text/bullseye.m7 0 → 100755
    1 @CLS@|l4|h4| | |$l<h4x|0|,Last updated: {4oz%001j5j5j5sFeb 5 2025 //,,.-,/,.,.,.-.-.,-.,,/////////////// 7````````````````````````````````````k 51 - Statistics for j 5@BBS-L........................@j
  • text/system.m7 0 → 100644
    1 @CLS@‚@BBS@‡located in‚@LOCATION@‡
    • This file appears to be identical to system.msg just with the Ctrl-A codes stripped. If we're stripping Ctrl-A codes from display files already, why do we need this file (the result is the same)?

    • Please register or sign in to reply
  • 539 544 if (term & PETSCII)
    540 545 safe_snprintf(str, size, "%sCBM/PETSCII"
    541 546 , (user->misc & AUTOTERM) ? text[TerminalAutoDetect] : nulstr);
    547 else if (term & MODE7)
    548 safe_snprintf(str, size, "%s/MODE7"
  • 560 568 term = term_supports();
    561 569 if (term & PETSCII)
    562 570 return "PETSCII";
    571 if (term & MODE7)
    572 return "MODE7";
  • 19 * Note: If this box doesn't appear square, then you need to fix your tabs. *
    20 ****************************************************************************/
    21 #ifndef _MODE7DFS_H_
    22 #define _MODE7DEFS_H_
    23
    24 enum mode7_char {
    25 /* Colors */
    26 MODE7_ALPHA_RED = 129,
    27 MODE7_ALPHA_GREEN = 130,
    28 MODE7_ALPHA_YELLOW = 131,
    29 MODE7_ALPHA_BLUE = 132,
    30 MODE7_ALPHA_MAGENTA = 133,
    31 MODE7_ALPHA_CYAN = 134,
    32 MODE7_ALPHA_WHITE = 135,
    33 MODE7_FLASH = 136,
    34 MODE7_STEADY = 137,
  • 568 568 #define COLDKEYS (1 << 18) /* No hot-keys */
    569 569 #define EXTDESC (1 << 19) /* Extended file descriptions */
    570 570 #define AUTOHANG (1 << 20) /* Auto-hang-up after transfer */
    571 #define WIP_UNUSED (1 << 21) /* Supports WIP terminal emulation */
    571 #define MODE7 (1 << 21) /* BBC Micro Mode 7 terminal support */
  • 129 129 uint16_t rlogin_port;
    130 130 uint16_t pet40_port; // 40-column PETSCII terminal server
    131 131 uint16_t pet80_port; // 80-column PETSCII terminal server
    132 uint16_t mode7_port; // 40-column MODE7 terminal server
  • 694 695 #define P_REMOTE (1 << 18) /* Only print when online == ON_REMOTE */
    695 696 #define P_INDENT (1 << 19) /* Indent lines to current cursor column */
    696 697 #define P_ATCODES (1 << 20) /* Trusted @-codes in formatted string */
    698 #define P_MODE7 (1 << 21) /* Message is native Mode 7 */
  • Nice! It could be merged as is but it'd be nice if it was cleaned-up a bit first.

  • Now that I think about it... where is the change to ignore/strip Ctrl-A codes? I'm not seeing that.

  • I see now, none of the values from mode7defs.h appear to be used, so I'm guessing this branch isn't as far along as I assumed. Hopefully the comments so far are at least helpful in some regard.

  • closed

  • Please register or sign in to reply
    Loading