The SP7001 plug-in’s screens and data

The SP7001 upgrade puts a second program in the KN7000’s table flash: Key Soft Service’s XAPR plug-in, which program 942 finds at start-up and runs (SP7001 Firmware: What Changed, and the Plug-in). It brings 10 widget classes of its own and 479 widgets on 31 screens: SD SETTINGS, SELECT SONG, SD JUKE BOX, SELECT C.L.S., CUSTOM LYRICS, and the naming and load / save windows. Since 2026-10-30 the disassembly types all of it the way the program’s own GUI is typed (KN7000 Menu Map): each widget is one line named by its class, and a generated menu map lists every screen.

The lane notes are part 2 of kn7000/notes/data-final/README.md (lane kn7000-final); the menu map is kn7000/notes/sp7001-plugin-menu-map.md.

Where it is

The plug-in is table 83 0x3E8000..0x3FB5A0 (CPU 0x483E8000), in kn7000/src/sp7001/table.s. Its code, 0x3E803C..0x3EF6C5, was already MN10300 assembly. Its data, 0x3EF6C5..0x3FB59C (48,855 bytes), held three generic pieces (33,127 + 4,274 + 9,224 bytes) and typed bits between them. It is now kn7000/src/sp7001/plugin/data/, generated by tools/gen_data_s.py --profile sp7001plugin, and tools/gen_table_s.py --plugin-data includes its data.s in place of the old gaps:

make -C kn7000 plugin-src      # regenerate (runs both generators twice: a fixpoint)
make -C kn7000 verify-sp7001   # table 83 and program 942 rebuilt byte for byte
make -C kn7000 verify-gui-map  # the menu maps, this one included, are current

After wave 11 plugin-src failed; since 2026-11-06 (lane mn10300-data4, kn7000/notes/mn10300-data4/README.md) it runs again: milk_model.parse_calls follows the host’s Function-table record that func_483E8071 reaches by an address sum (add dN, aM, then mov (aM), aN), so the data generator sees all ten RegisterObjectTable calls below, and the plug-in’s object names are kept in kn7000/src/sp7001/plugin/data/gui_object_names.tsv (311 objects) like every other tree’s.

How it registers its GUI with the host

The plug-in calls program 942 through 942’s own registered Function table, as the HD-SX6 plug-in calls the KN6000’s (KN6000 Program Data). func_483E8071 makes the registrations:

mov (KssFrameworkObj), a0 / mov (0x1c, a0), a0 / mov (0xec, a0), a1 / calls (a1)

reads entry 0xEC / 4 of registry slot 1’s table (16-byte registry records, +0xC the table; slot 1 is block 0’s Function table), which is RegisterObjectTable, with the 16-byte {class, proc, count, table} record on the stack and the slot in d0:

slot what the plug-in registers
0x2F0 the Viewable table (its 479 widget records)
0x2F8 the ResName table, parallel to it
0x2F1 / 0x2F9 Functions and their names
0x2F2 / 0x2FA ApFunctions and their names
0x2F3 / 0x2FB MainFunctions and their names
0x2F4 its 10 classes (PLUG_Classes)
0x2F5 events
0x2F6 methods

Registry block 0x2F0 is the plug-in’s own; the classes and ids its records use from block 0 are 942’s. Initialised RAM: func_483E803E clears 0xA48 bytes from 0x50299498 (KssWorkRam) and copies 0x1498 bytes from 0x483FA104 (KssRamImage) to 0x50298000. Widget records and the variables their fields point at live there, labelled by their RAM addresses.

The classes

One .macro each in kn7000/src/sp7001/plugin/data/gui_classes.inc, with the host classes they derive from; the type characters are those of the KN7000 Menu Map:

class derives from bytes own fields (first)
AcKssList VwBox < Viewable 112 ap_func, style_id, is_big, auto_big_sel, font, columns …
PsKssTextBox PsParaBox < VwBox < Viewable 64 is_3d, ver_align, padding, auto_wrap, init_str, str_adr
KssBgScreen Screen < GroupBox < VwBox < Viewable 52 image_id, title, icon
DbKssMemo VwBox < Viewable 44 ap_func, popup, extension
AcKssScreenMenu PsKssTextBox < PsParaBox < VwBox < Viewable 72 ap_func, editsw
AcKssEditBox PsParaBox < VwBox < Viewable 84 ap_func, editsw, is_selected, selection, caption …
AcKssNamingWindow Window < GroupBox < VwBox < Viewable 44 (none)
IvKssNaming PsInvisibleBox < Viewable 28 func
AcKssNamingEditSw PsEditSwBox < VwBox < Viewable 52 sign, page
KssXLyricsBox VwBox < Viewable 36 pEnable

What a record looks like

		AcKssList	Lst_SelDir, super=SelDir, next=SelDir_IndexEditSw1, prev=Tb_SelDir_ScreenName, flag=VF_Const, X=26, Y=38, W=510, H=172, color=CL_Silver, border=BD_3D_UP1, ap_func=FN_Ap_Lst_SelDir, auto_big_sel=1, font=3, columns=4, rows=12, ...
		AcIndexEditSw	SelDir_IndexEditSw1, super=SelDir, next=SelDir_IndexEditSw2, prev=Lst_SelDir, flag=VF_Const, X=124, Y=217, W=32, H=22, color=CL_Silver, border=BD_3D_UP1, index=8, fontcolor=CL_Black, editsw=ES_Bottom4, style=15

(kn7000/src/sp7001/plugin/data/data_00.s, abridged.) Links are object names, nested by indentation; X / Y / W / H, colours and flags by constant name; captions inline; procedures by FN_ id; titles by TT_ name, 942’s TT_PS, TT_SDCCUS and TT_SDAUDPLY among them. The plug-in’s code spells its data operands with the same labels (mov 0x483f8db8, d0 became mov PLUG_Classes, d0).

The screens

The plug-in’s title TT_PLUGIN opens Main, whose menu leads to the SD SETTINGS, SELECT SONG, SD JUKE BOX, SELECT C.L.S. and CUSTOM LYRICS screens and to two of 942’s own titles, CUSTOM STYLE LOAD/SAVE (TT_SDCCUS) and SD-AUDIO PLAY (TT_SDAUDPLY). Every top-level object of the map (the table is printed by tools/menu_map_summary.py --screens in this site’s repository; “objects” counts the widgets in its tree):

screen class objects first captions
Main TtlScreen 19 “SYSTEM PLUG-IN”, “– SYSTEM PLUG-iN SP7001 –”, “SD SETTINGS”
SelDir KssBgScreen 18 “ALPHA”, “NUMBER”, “SELECT DIRECTORY”
SelSong KssBgScreen 11 “LOAD”
WinSelSong Window 17 “SEL. SONG”, “DEL. SONG”, “DEL. DIR”
WinSfxSelect Window 37 “SONG NAME :”, “text”, “PANEL”
SEL_SONG_WIN3 Window 30 “SD SINGLE LOAD”, “- PANEL MEMORY -“, “MODE”
AlphaSort KssBgScreen 10 “LOAD”
WinAlphaSort Window 23 “0..9 A B/C D”, “text”, “ALPHABETIC LIST”
Lbn KssBgScreen 10 “LOAD”
WinLbn Window 34 “LOAD BY NUMBER”, “1”, “3”
HELP_WORKSHOP_SEL KssBgScreen 8 “OK”, “SELECT HELP WORKSHOP”
HELP_WORKSHOP_CONTENT KssBgScreen 8 “OK”, “HELP WORKSHOP”
Lyrics KssBgScreen 17 “COPY TLX TO SD”, “APC CHORD:”, “Title :”
PLUG_IN KssBgScreen 10 “OK”, “SELECT PLUG-iN”, “READ FROM FD”
JukeBox KssBgScreen 18 “SD JUKE BOX”, “Selected Song :”, “name”
Settings KssBgScreen 8 “SD PLUG-IN SETTINGS”
WinSettings Window 13 “COPY FD TO SD”, “SAVE SETTINGS”
WinSettings2 Window 11 “SD FORMAT”
Debug KssBgScreen 10  
ClsDir KssBgScreen 14 “OK”, “C.L.S. SELECT”, “NAMING”
Dialog KssBgScreen 7 “text”
StartUp KssBgScreen 5 “Initializing PLUG-iN System”, “Diese Funktion kann bis zu 5 Min. dauern”
WinWait Window 2 “text”
Naming KssBgScreen 5  
WinNaming AcKssNamingWindow 49 “DEL”, “CLR”, “INS”
WinNamingHistory Window 12 “OK”, “CANCEL”, “Clipboard”
Fd2Sd KssBgScreen 27 “COPY * TO SD”, “SEL. ON/OFF”, “SELECT ALL”
Cls KssBgScreen 30 “C.L.S. SONG SELECT”, “SAVE SONG”, “AS”
WinLoadSave Window 3  
Not_implemented_yet Window 2 ”!!! This function is not available !!!”
Format_Code_Win Window 11 “CANCEL”, “FORMAT”, “0 2 4 6 8 1 3 5 7”

Main’s info box carries the build stamp “Tentative develop.-No. 20-09-2002” (Tb_Main_CompileDate), and StartUp adds, in German, that this can take up to 5 minutes (“Diese Funktion kann bis zu 5 Min. dauern”). The per-widget detail (rects, links, which screen or title each menu entry opens) is in the full map.

Readability

tools/gui_readability.py, row kn7000-sp7001plugin; “before” counted the same way on the lane’s base (disassembly fd73a97fa), whose plug-in data had no widget record typed:

measure before after
widget records typed / in blobs 0 / 479 479 / 0
raw class ids, numeric links, unnamed fields - 0, 0, 0
numeric data addresses in the plug-in’s data rows 328 0
numeric data / RAM addresses in the plug-in’s code 1,293 3

Open

  • image_id=32872 and icon=1 of the KssBgScreen records are numbers: traced by lane mn10300-formats (2026-10-31, kn7000/notes/mn10300-formats/README.md, section 4; probe kss_bgscreen_ids.py), and the plug-in’s records now say both in their comments:
    • icon (1 in every record) is program 942’s icon index. KssBgScreenProc (0x483E9060) answers its +0x30 for MT_GetIcon, which 942’s TtlScreenProc sends and passes to DrawTitleBar -> DrawTitleBarOW -> DrawIcons: entry 1 of the table flash’s ResIconTable, ResIcon001, the icon 942’s own TtSoftver / TtDebug screens show.
    • image_id (0x8068 in every record) is read by nothing: no access of the plug-in’s code at +0x28 is 16 bits wide, KssBgScreenProc reads +0x2C and +0x30 only, and 942’s Screen class (40 bytes) ends before it. 0x8068 is no id of 942’s resource-id trie. [INFERENCE] A field the plug-in’s authors did not use; read as a Slide Show picture code (0x8000 + n), n = 104 would be past the 100 presets the slide show accepts.
  • The RAM words the str_adr / extension fields point at hold values like 0x00C5CF2D / 0x01514568 that are no address of this image or of the program; [INFERENCE] initial values the code overwrites. They are written .long with the comment “initial value”.