mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-16 12:41:09 +00:00
Minimize mos65816 decoding tables
This commit is contained in:
@@ -152,10 +152,8 @@ encode_flags_literal :: proc(f: m.Encoding_Flags) -> string {
|
||||
emit_range_table :: proc(sb: ^strings.Builder, name: string, ranges: []Range) {
|
||||
fmt.sbprintfln(sb, "%s := [%d]Decode_Index{{", name, len(ranges))
|
||||
for r, i in ranges {
|
||||
if r.count == 0 {
|
||||
fmt.sbprintfln(sb, "\t/* %02X */ {{0, 0}},", i)
|
||||
} else {
|
||||
fmt.sbprintfln(sb, "\t/* %02X */ {{%d, %d}},", i, r.start, r.count)
|
||||
if r.count != 0 {
|
||||
fmt.sbprintfln(sb, "\t0x%02X = {{%d, %d}},", i, r.start, r.count)
|
||||
}
|
||||
}
|
||||
strings.write_string(sb, "}\n\n")
|
||||
|
||||
Reference in New Issue
Block a user