I didn't foresee when asking that I was asking about the file format used for saving and loading from Family BASIC. Unlike other home computers such as the ZX Spectrum, the BASIC is in a cartridge ROM and other games which use the Data Recorder have their own cartridge with their own ROM and the BASIC ROM is not present, so they implement their own custom save and load routines rather calling the BASIC routines.
The Nes Dev wiki linked says it's not known which encoding convention Family BASIC uses. But that's the low-level format. Basically magnetic media will have a low-level format relating to encoding digital data into audio, and a high-level byte-oriented format encoding information about the file's data and the data itself. The low-level format is the tape equivalent of GCR and MFM used on floppy disks whereas the high-level format is comparable to an OS's directory structure and file formats.
I was asking about both but actually I was most interested in the high-level format. It turns out that the same Nes Dev wiki actually has this link that includes that info, but in Japanese. Google Translate does well with it though:
Similar to Sharp's MZ and X1, the PWM method is used for soft timing.
The tape format is also quite close to MZ and X1.
BASIC itself can only save and load BASIC programs.
If you want to save and load the binary file, you need to create your own program.
Information block (FCB)
"0" * 20000
Tape mark ("1" * 40 + "0" * 40)
"1"
Information 128 bytes
Checksum 2 bytes
"1"
Data block
"0" * 20000
Tape mark ("1" * 20 + "0" * 20)
"1"
Data block
Checksum 2 bytes
"1"
Contents of 1-byte data
"1", d7, d6, d5, d4, d3, d2, d1, d0
Information block
Attribute 1 byte ($ 02 = BASIC, $ 03 = BG-GRAPHIC)
File name 16 bytes 16 characters or less End mark $ 00 at the end
Spare 1 byte $ 00
2 bytes long
Load address 2 bytes
Execution address 2 bytes
104 bytes free
(Note) The checksum is not simply the sum of data, but
It is the number of "1" in the content of each bit of 1-byte data.
If the data is $ FF, it will be +8, if it is $ C0, it will be +2, and if it is $ 00, it will be +0.
BG-GRAPHIC data
Save the data transferred from the contents of BG2 to CPU $ 0700- $ 07FFH in 4 divisions
Data to be transferred to BG2 is loaded into CPU $ 0700- $ 07FFH in 4 divisions and transferred to PPU.
Notes:
- PWM is "pulse width modulation".
- It says BASIC itself can only save and load BASIC programs, but the information block contains a type field which differentiates between two file types: BASIC or "BG-GRAPHIC".
- The information block contains load address and execute address fields, but those would only make sense for machine code files.