Page 1 of 1

v2023.04.10.00

Posted: Mon Apr 10, 2023 8:25 pm
by DJ Sures
Added new RetroNET file system command. I'm adding several new retronet file commands that will be utilities for offloading processing from the NABU. This week I'll release several new commands for saving configurations, parsing text/binary, regular expressions, and more.. Stay tuned!

Here's how to use the new retronet line count/parsing command. It's also in github

Code: Select all

#define BIN_TYPE BIN_CPM
#define DISABLE_KEYBOARD_INT
#define DISABLE_VDP

#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include "../NABULIB/NABU-LIB.h"
#include "../NABULIB/RetroNET-FileStore.h"

#define BUFFER_LEN 1024
uint8_t _buffer[BUFFER_LEN] = { 0 };

void main() {

  initNABULib();  

  uint8_t fileHandle = rn_fileOpen(7, "LST.TXT", OPEN_FILE_FLAG_READONLY, 0xff);

  printf("File handle: %u\n", fileHandle);

  uint16_t lineCnt = rn_fileHandleLineCount(fileHandle);

  printf("Line Count: %u\n", lineCnt);

  uint16_t bufLen = rn_fileHandleGetLine(fileHandle, 150, _buffer);

  printf("Buffer length: %u\n", bufLen);

  printf("Line: %s\n", _buffer);

  rn_fileHandleClose(fileHandle);
}