0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-26 12:32:05 +01:00

allow 3a as no group

This commit is contained in:
2025-12-26 21:36:16 +01:00
parent d14c580ce1
commit f0b44e607e
2 changed files with 6 additions and 4 deletions

View File

@@ -417,7 +417,6 @@ int lua_register_oda(lua_State *localL) {
break;
case 10:
case 4:
case 3:
case 1:
if(mod->enc->state[mod->enc->program].user_oda.odas[id].group_version == 0) return luaL_error(localL, "Invalid group");
default:
@@ -434,6 +433,7 @@ int lua_set_oda_handler(lua_State *localL) {
uint8_t idx = luaL_checkinteger(localL, 1);
if(idx >= 32) return luaL_error(localL, "There can't be more than 32 registered ODAs");
if(mod->enc->state[mod->enc->program].user_oda.odas[idx].group == 0) return luaL_error(localL, "this oda is not registered");
if(mod->enc->state[mod->enc->program].user_oda.odas[idx].group == 3) return luaL_error(localL, "this oda cannot have a handler");
luaL_checktype(localL, 2, LUA_TFUNCTION);
lua_pushvalue(localL, 2);
if(mod->enc->state[mod->enc->program].user_oda.odas[idx].lua_handler != 0) luaL_unref(localL, LUA_REGISTRYINDEX, mod->enc->state[mod->enc->program].user_oda.odas[idx].lua_handler);

View File

@@ -319,8 +319,10 @@ void get_rds_user_oda_group(RDSEncoder* enc, RDSGroup *group) {
RDSODA oda = enc->state[enc->program].user_oda.odas[pointer];
group->b |= 3 << 12;
group->b |= oda.group << 1;
group->b |= oda.group_version;
if(oda.group != 3) {
group->b |= oda.group << 1;
group->b |= oda.group_version;
}
group->c = oda.id_data;
group->d = oda.id;
}
@@ -333,7 +335,7 @@ int get_rds_user_oda_group_content(RDSEncoder* enc, RDSGroup *group) {
oda_state->oda_runner_pointer = (oda_state->oda_runner_pointer + 1) % oda_state->oda_len;
if (oda_state->odas[current_idx].lua_handler != 0) {
if (oda_state->odas[current_idx].lua_handler != 0 && oda_state->odas[current_idx].group != 3) {
lua_group_ref(group, oda_state->odas[current_idx].lua_handler);
group->b |= oda_state->odas[current_idx].group << 12;
group->b |= oda_state->odas[current_idx].group_version << 11;