1
0

DTC and SCI improvements

This commit is contained in:
Aiden
2026-05-25 14:22:32 +10:00
parent 62d1c3c876
commit 80819448cf
21 changed files with 13823 additions and 86 deletions

View File

@@ -2,6 +2,7 @@ from __future__ import annotations
from typing import TypedDict
from .dtc import DtcRegisterInfo, decode_dtc_register_info
from .rom import Rom
from .tables import VECTOR_NAMES_MIN
@@ -11,6 +12,7 @@ class DtcVectorEntry(TypedDict):
source: str
register_info_address: int
target: int
register_info: DtcRegisterInfo
DTC_VECTOR_NAMES_MIN: dict[int, str] = {
@@ -71,12 +73,13 @@ def read_vectors_max(rom: Rom) -> dict[int, tuple[str, int]]:
return vectors
def _dtc_entry(vector_address: int, source: str, target: int) -> DtcVectorEntry:
def _dtc_entry(rom: Rom, vector_address: int, source: str, target: int) -> DtcVectorEntry:
return {
"vector_address": vector_address,
"source": source,
"register_info_address": target,
"target": target,
"register_info": decode_dtc_register_info(rom, target),
}
@@ -88,7 +91,7 @@ def read_dtc_vectors_min(rom: Rom) -> dict[int, DtcVectorEntry]:
target = rom.u16(addr)
if target in (0x0000, 0xFFFF):
continue
vectors[addr] = _dtc_entry(addr, source, target)
vectors[addr] = _dtc_entry(rom, addr, source, target)
return vectors
@@ -100,5 +103,5 @@ def read_dtc_vectors_max(rom: Rom) -> dict[int, DtcVectorEntry]:
target = rom.u16(addr + 2)
if target in (0x0000, 0xFFFF):
continue
vectors[addr] = _dtc_entry(addr, source, target)
vectors[addr] = _dtc_entry(rom, addr, source, target)
return vectors