LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

SmileBASIC 4 Discussion「プチコン4」

Root / General / [.]

📌
MZ952Created:
Did you try some 3ds programs that work that way on the switch to see if they act differently? P.S. great tutorials btw
There’s a lot of the same functions but SB4 is pretty different. Still figuring out the basics. P.S. Glad I can help man

Can we detect via code when the Switch is docked or undocked?

Can we detect via code when the Switch is docked or undocked?
No EDIT: Maybe No access rn but it seems like CONTROLLER(1) is 1 when the system is in portable mode. Seems like that should do it. Try it
DEF DOCKED()
 RETURN CONTROLLER(1) != 1
END

LOOP
 VSYNC
 CLS
 PRINT "NY"[DOCKED()]
ENDLOOP

No access rn but it seems like CONTROLLER(1) is 1 when the system is in portable mode. Seems like that should do it.
Unfortunately that doesn't cover it. Controllers can be detached, even in portable mode.

No access rn but it seems like CONTROLLER(1) is 1 when the system is in portable mode. Seems like that should do it.
Unfortunately that doesn't cover it. Controllers can be detached, even in portable mode.
Well, this at least tells you that the device is definitely being used in handheld mode as opposed to docked or tabletop mode. Consider that portable docks exist, and the two aren't so different anyway.

Well, this at least tells you that the device is definitely being used in handheld mode as opposed to docked or tabletop mode. Consider that portable docks exist, and the two aren't so different anyway.
It's probably the best we can hope for, but it doesn't suit my purposes. Was aiming to detect what screen was being used, HDMI out or the Switch's screen. It seems the best I can hope for is to listen for touch input, shame there's nothing automatic though.

Make it a menu option of some sort, let the user tell you the mode.

Is there a "replace all" or "replace and next" button somewhere with the keyboard's search function? It would do me a number of favors...
Shift+find is replace (and it does replace and next by default), but I'm not sure if there's a replace all.
from find mode(CTRL+F, F3), hit TAB to get into replacement mode (CTRL+H), first line is the search, second is the replacement, one by one ENTER to replace, or CTRL+ENTER to replace all. saw it in the manual and remembered this post. Dunno if answered before. https://video.twimg.com/ext_tw_video/1153088256143060992/pu/vid/1280x720/HDlTEOrVAuf7osyA.mp4 didnt look for an onscreen keyboard version for replace all

https://twitter.com/notohoho/status/1153616941539479552
<Notice for the upcoming SmileBASIC 4.1.0> To begin with, we're making it easier to play. ■PLAYMENU ・Public works screen: Search by tag, sort order (order by recent popularity, newest works, or most recently updated) ・Local screen: A Button long press submenu (check for updates, delete, and jump directly to BASIC screen for the specified project)■FILEMENU ・Tag setting feature when releasing a work

https://twitter.com/notohoho/status/1153616941539479552
<Notice for the upcoming SmileBASIC 4.1.0> To begin with, we're making it easier to play. ■PLAYMENU ・Public works screen: Search by tag, sort order (order by recent popularity, newest works, or most recently updated) ・Local screen: A Button long press submenu (check for updates, delete, and jump directly to BASIC screen for the specified project)■FILEMENU ・Tag setting feature when releasing a work
These are all great features. An option for automatic project updates would be great as well (even if it's just a prompt to update when you run it.) Something that's a bit interesting is that he hasn't mentioned the additional functions etc. that were missing and they claimed to be adding. I guess they aren't finalized since there isn't even a date and they just wanted to put this out there.

Can you disable the minus button from opening the on-screen keyboard while the program in a running? Can't seem to find that in the translated docs.

Does anyone have any information on the international releases of SB4? I can't find anything and I'm getting so tired of the built-in help menu being Japanese.
Can you disable the minus button from opening the on-screen keyboard while the program in a running? Can't seem to find that in the translated docs.
I can't find it either, but I don't see why you would need it. iirc, you can't detect the minus button using BUTTON() anyways.

LOOP
ENDLOOP
There will be an alternative to
WHILE
and Label loops?

I don't see why you would need it. iirc, you can't detect the minus button using BUTTON() anyways.
It's to prevent players from opening the keyboard and covering half of the screen.

LOOP
ENDLOOP
There will be an alternative to
WHILE
and Label loops?
Yes, it's an infinite loop. That means it can be used in place of either of these:
WHILE TRUE
 'code goes here
WEND
@LOOP
 'code goes here
GOTO @LOOP
The only real advantages it has are being able to state your intent more directly than WHILE TRUE, and being able to BREAK and CONTINUE unlike GOTO @LOOP.

LOOP
ENDLOOP
There will be an alternative to
WHILE
and Label loops?
Yes, it's an infinite loop. That means it can be used in place of either of these:
WHILE TRUE
 'code goes here
WEND
@LOOP
 'code goes here
GOTO @LOOP
The only real advantages it has are being able to state your intent more directly than WHILE TRUE, and being able to BREAK and CONTINUE unlike GOTO @LOOP.
yes I love while loops tho :(

I don't see why you would need it. iirc, you can't detect the minus button using BUTTON() anyways.
It's to prevent players from opening the keyboard and covering half of the screen.
There's no way to disable it. That said, if they're opening the keyboard, they're probably doing it on purpose, so I don't see the point in disabling it. It's the only way (without a USB keyboard) to run a subprogram while your game is running, for instance, so it does have utility even if there's no reason to type in your game.

LOOP/ENDLOOP should be faster than @LOOP/GOTO @LOOP WHILE,FOR,LOOP,REPEAT,IF,etc. all use literal addresses to jump to, while GOTO has a pointer to a position in the name table, where the address of the label is stored. WHILE/REPEAT are still slower than GOTO because they have to check the condition, though.

LOOP/ENDLOOP should be faster than @LOOP/GOTO @LOOP WHILE,FOR,LOOP,REPEAT,IF,etc. all use literal addresses to jump to, while GOTO has a pointer to a position in the name table, where the address of the label is stored. WHILE/REPEAT are still slower than GOTO because they have to check the condition, though.
The interesting thing about that is for constant labels it's very easy to optimize in an absolute jump. In most cases a name table lookup shouldn't even be necessary. At least, you COULD, if you didn't allow jumping across slots.

Yeah it would've been simple to just make a second pass through the bytecode to replace label addresses when possible. The reason it uses the nametable is because if you have something like: GOTO @A @A with GOTO @A, it checks for @A in the table, doesn't find it, and so it adds an entry (but without an address set), and outputs bytecode using the position of that item in the nametable. then when it reaches @A, it finds that in the nametable so it fills in the address. But for some reason, even if the label is BEFORE the goto, it still does this.