From c56e932c93b4249996b5c7203dbd36551e52888c Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sun, 28 Dec 2025 12:55:06 +0100 Subject: [PATCH] readme --- readme.md | 6 ++++++ scripts/1-rft.lua | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 359cce4..4b1bc2d 100644 --- a/readme.md +++ b/readme.md @@ -35,6 +35,12 @@ You wanna make an ODA? Sure go for it, look in the scripts folder to see `0-ert. Wanna do scrolling PS without C stuff and no external scripts? Just do it with the `tick` function! Don't wanna run a bash script to send your station's data to the encoder when defaults take over? I'll welcome you to the `on_init` function +### RFT + +For a long time there was no RFT in RDS95, but on 28th December 2025 that changed when i implemented it in lua, just call the load function with the path and id 0 and set rds2 mode to 2, and see the your station's logo in the decoder + +And yes, it is implemented in only Lua and the ODA engine which is also in Lua + ## Disclaimer RDS95 is "based" on [Anthony96922](https://github.com/Anthony96922/)'s [MiniRDS](https://github.com/Anthony96922/MiniRDS) licensed under GPLv3 diff --git a/scripts/1-rft.lua b/scripts/1-rft.lua index 01f265c..06e3577 100644 --- a/scripts/1-rft.lua +++ b/scripts/1-rft.lua @@ -16,11 +16,8 @@ local function start_rft() local function b(i) return string.byte(_Rft_file, base + i) or 0 end local word1 = (((_Rft_toggle and 1 or 0) << 7) | ((seg >> 8) & 0x7F)) - local word2 = ((seg & 0xFF) << 8) | b(0) - local word3 = (b(1) << 8) | b(2) - local word4 = (b(3) << 8) | b(4) _Rft_file_segment = seg + 1 @@ -43,6 +40,7 @@ function load_rft_file(path, id) if not file then error("Could not open file") end _Rft_file = file:read("*a") file:close() + if #_Rft_file > 262143 then error("The file is too large", 2) end if _Rft_oda_id == nil then start_rft() end ---@diagnostic disable-next-line: param-type-mismatch