tlcs900: Add TMP94C241 LDC control register mappings for DMA#14970
Open
felipesanches wants to merge 1 commit intomamedev:masterfrom
Open
tlcs900: Add TMP94C241 LDC control register mappings for DMA#14970felipesanches wants to merge 1 commit intomamedev:masterfrom
felipesanches wants to merge 1 commit intomamedev:masterfrom
Conversation
The LDC instruction uses an immediate byte to select control registers. Different TLCS-900/H variants place their DMA registers at different offsets within this encoding space. The disassembler previously had all variants' CR register names hardcoded in the shared dasm900.cpp. Refactor CR register name resolution into a table-driven lookup that each variant provides alongside its existing SFR symbol table. This moves model-specific register names to the model-specific source files, following the same pattern already used for SFR symbolic names. Add TMP94C241 DMA control register encodings (DMAM at 0x42-0x4e, DMAC at 0x40-0x4c, DMAD at 0x20-0x2c) which differ from the TMP96C141/TMP95C061/TMP95C063 encodings (DMAM at 0x22-0x2e, DMAC at 0x20-0x2c, DMAD at 0x10-0x1c).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
900tbl.hxxProblem
The
LDC(Load Control Register) instruction uses an immediate byte to select which internal register to access. The TMP94C241 places its DMA registers at different offsets than the TMP96C141/TMP95C061/TMP95C063:Without the TMP94C241 cases,
LDC cr,DMAMnwrites go to a dummy register and DMA never configures. This blocks the Technics KN5000 (the only driver currently using TMP94C241) from performing HDMA-based firmware payload transfers.Changes
900tbl.hxx: Add TMP94C241caseentries to the six existing CR switch blocks inprepare_operands(). The encoding values are disjoint between variants so the new cases coexist harmlessly — unreachable cases have zero runtime cost in the compiler's jump table. Each case is annotated with a comment identifying which variant(s) use that encoding.dasm900.h: Addcr_symstruct andcr_name()lookup, paralleling the existing SFR symbol table pattern.dasm900.cpp: Replace six hardcoded switch blocks forO_CR8/O_CR16/O_CR32with table-driven lookups viacr_name().tmp94c241.cpp,tmp96c141.cpp,tmp95c061.cpp,tmp95c063.cpp: Each variant defines its own*_cr_syms[]table passed to the disassembler constructor.Test plan
Reference
Toshiba TMP94C241F Data Sheet, Section 5 "DMA Controller", Table 5-1 "DMA Register Map".