Skip to content

VT100 support for SmallBASIC console#287

Open
Joe7M wants to merge 31 commits into
smallbasic:masterfrom
Joe7M:master
Open

VT100 support for SmallBASIC console#287
Joe7M wants to merge 31 commits into
smallbasic:masterfrom
Joe7M:master

Conversation

@Joe7M

@Joe7M Joe7M commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@chrisws chrisws self-assigned this Jun 29, 2026

@chrisws chrisws left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks really good, just a few minor fixes. Have you tested this with raylib etc?

Comment thread src/common/smbas.h Outdated
EXTERN byte opt_antialias; /**< OPTION ANTIALIAS OFF */
EXTERN byte opt_autolocal; /**< OPTION AUTOLOCAL */
EXTERN byte opt_trace_on; /**< initial value for the TRON command */
EXTERN byte opt_vt100; /**< disable VT100 in console */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables are for the executor. I think opt_vt100 could just be defined in the console code somewhere directly. It has no purpose for the other platforms.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed opt_vt100 in smbas.h and defined it in console/main.cpp

Comment thread src/common/device.c Outdated
dev_initfs();
dev_fgcolor = 0;
dev_bgcolor = (os_graphics) ? 15 : 0;
dev_fgcolor = 15;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it work just the same now if this change was reverted? It might change change one of the other platforms in someway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it works. I reverted the changes.

Comment thread src/common/screen.c Outdated
//
void dev_setcolor(long color) {
if (color <= 15 && color >= 0) {
/*if (color <= 15 && color >= 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use the #ifdef for console use here. don't leave the commented out code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used #ifdef. I tried to understand how osd_setcolor is used. I think the if-else-statement is not necessary but I'm not 100% sure.

return 0;
}

#if USE_TERM_IO || defined (_Win32)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be simplified to just #if USE_TERM_IO ? it could be defined in the configure script when building for windows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this can be simplified. If USE_TERM_IO is defined for windows, then in device.cpp the Linux code will be build in windows (see line 133 and 219).

@Joe7M

Joe7M commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Raylib works with and without the no-vt100 parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants