LoginLogin

How to use SmileBASIC File Manager to edit files on a PC.

Root / Submissions / [.]

triangleCreated:
If you haven't seen already, I made a homebrew application that can copy files to and from SmileBASIC without the need for Petit Modem's annoying sounds. You can find that here: http://www.smilebasicsource.com/forum?ftid=468 Some people have reported that it isn't exactly the most self-explanatory program. So here is a tutorial on how to transfer files properly, along with some general advice. I will be referring to SmileBASIC File Manager with the acronym SBFM. I also made some web tools that are intended for use with SBFM: https://trinitro21.github.io/

GENERAL ADVICE

The first letter of filenames You may notice that each of your files starts with a T or a B. This is to quickly distinguish between TXT (T) and DAT (B) files. Without these, SmileBASIC might not behave correctly, and so SBFM automatically inserts a T or B if one isn't present. If it can't determine which to insert, it will ask the user. Methods of copying There are three options when transferring files: you can copy with either X, Y, or A. Pressing Y copies the entire file, while X ignores the 80-byte header and 20-byte footer, and A ignores the 80-byte header, the 28-byte DAT header, and 20-byte footer. Pressing X to copy a file back into SmileBASIC will inject a "default" header and footer that I made, and pressing A will inject a custom DAT header that is created from user input in addition to the default header and footer. The option to copy with X was made so that you can edit the code without worrying about doing something bad with the header or footer, and also so that you might be able to make your own programs without editing a program that you made. File formats Some file formats may have SmileBASIC equivalents, like WAV files; however this does not mean that they are compatible with the PC formats. Don't attempt to just copy over any file from a PC to SmileBASIC. It most likely won't work. Line breaks Instead of the CHR$(13)+CHR$(10) that most programs use for line breaks, SmileBASIC just uses CHR$(10). This causes problems, because some text editors don't support the line breaks. For example, Notepad (the text editor that comes with Windows) won't actually go to another line when it incounters a line break from SmileBASIC. The ones I know of that work are Programmer's Notepad, SynWrite, and Notepad++. When creating files, this isn't much of a problem unless you don't want double line breaks, as SmileBASIC reads two-character line breaks as two separate line breaks. If using Notepad++, you can avoid this problem with Edit > EOL Conversion > UNIX/OSX Format. Syntax highlighting If you would like to have syntax highlighting for SmileBASIC in your text editor, you can use this user-defined language that I made for Notepad++ (https://drive.google.com/file/d/0B4kbPEFlGXXIRUdCcE1xc0dTMTQ/view?usp=sharing) or this SynWrite build (http://www.smilebasicsource.com/page?pid=54). To use my syntax highlighting, open Notepad++, then go to Language > Define your language..., hit Import, then browse to the file you downloaded. Something that may improve the experience is using the Black board style (Settings > Style Configurator...) and the fonts from SmileBASIC's website: http://smilebasic.com/en/download/. You can set a style's fonts from the style configurator. GRP editor There exists an aseprite mod that can edit GRP files: http://www.smilebasicsource.com/page?pid=69 However you should not use this to create GRP files, only to edit them. When it creates GRP files, it doesn't put in the correct headers for SBFM to recognize it as a GRP file, even when you try the headerless copy method, and it will show up improperly in SmileBASIC because of this. For creating GRP files, you should convert the image from another image format.

PRG FILES

The recommended usage for editing PRG files is:
  • Dump your program with SBFM using Y or X to copy the file.
  • Put your SD/microSD into your computer or connect it using FTP or MicroSD Management.
  • Edit the file with a text editor such as Notepad++. Keep in mind that if you copied it with the header, there will not be a line break before the first line, so you might have to scroll to edit that.
  • Put the file back onto your SD/microSD if you moved it off of it. Make sure that the file retains the T at the front of the filename. That indicates a TXT file, and without it, SmileBASIC will not correctly display the file or filename.
  • Open SBFM and restore your file using the same button you used to copy it.
  • Open and save your file within SmileBASIC to make sure everything can be uploaded without any potential errors.
The recommended usage for creating PRG files is:
  • Create your file in a text editor such as Notepad++.
  • If you can, use UNIX/OSX format line breaks.
  • Save your file with a name that starts with T and only includes uppercase characters, periods, underscores, dashes, and @. Other characters won't be displayed by SmileBASIC.
  • Put the file on your SD/microSD card and open SBFM.
  • Transfer the program using X.
  • Open and save your file within SmileBASIC to make sure everything can be uploaded without any potential errors.

GRP FILES

The recommended usage for editing GRP files is:
  • Dump the GRP file with SBFM using Y to copy it.
  • Download this aseprite mod that can edit GRP files: http://www.smilebasicsource.com/page?pid=69
  • Put your SD/microSD into your computer or connect it using FTP or MicroSD Management.
  • Add .GRP to the filename if it doesn't already have it; aseprite won't recognize your image as a GRP unless you do.
  • Open up your file in aseprite.
  • Enable transparency by going to Layer > Layer from Background.
  • Edit away! You can also use an image editor of your choice and copy and paste into aseprite.
  • Put the file back onto your SD/microSD if you moved it off of it. Make sure that the file retains the B at the front of the file name. That indicates a DAT/GRP file, and without it, SmileBASIC will not correctly display the file.
  • Open SBFM and restore your file using Y to copy it.
  • Open and save your file within SmileBASIC to make sure everything can be uploaded without any potential errors.
The recommended usage for creating GRP files is:

WAV FILES

Instructions for using Perska's WAV2SBWAV tool can be found here: http://www.smilebasicsource.com/page?pid=339

The last character of a program
This section can be removed, since the bug was fixed.

Save your file with a name that starts with T and only includes uppercase characters, periods, underscores, and dashes. Other characters won't be displayed by SmileBASIC.
@ is allowed allowed

Version 1.5 it gives you info or something about the file you're on pleaaaase make a thing that reprints the instructions so that they can be remembered after a file decides to shove its lame info in the way

DEUUEAUGH!! also Omiwa trinitro wherever you are try copying two different files with the same name in sbfm to your sd card and then try deleting it from sbfm from the sd card and see if it works maybe

Replying to:answer
Is there a way to convert WAV files into computer readable code and back(because I'm pretty sure one of my guys doesn't sound like a dog in a muffler)
It's not that difficult, just look up the file format for a Microsoft WAVE (.wav) file, it's incredibly simple. The header tells you how the data is formatted. If you are just using WAVESETA to play the audio back, you can only play back 8-bit audio. You can still play back 16-bit WAV files, but you will need to down-sample it to 8-bits. SmileBASIC supports stereo audio so handling two channels shouldn't be difficult. Just make sure to check for Endianness when down-sampling.

Iā€™d reccomend updating the page to include a warning about having uneven file sizes. That way people at least know how to avoid the error.

Replying to:h267
Iā€™d reccomend updating the page to include a warning about having uneven file sizes. That way people at least know how to avoid the error.
This isn't a bug, you're actually just using it wrong lol.

Replying to:h267
Iā€™d reccomend updating the page to include a warning about having uneven file sizes. That way people at least know how to avoid the error.
Sure, but here should be something there to tell users how to avoid that.

Replying to:h267
Iā€™d reccomend updating the page to include a warning about having uneven file sizes. That way people at least know how to avoid the error.
The fact that there's an error should be a pretty good sign that you're doing something wrong

The manual is great, especially that I can use the tool now myself but the link for "trotyl.tk" seems to be dead. It just redirects me to a different clickbait-ish website regardless if I use my 2DS or not.

Is anyone else unable to delete files from SBFM on the SmileBASIC side? Is this intended?