Motronic 8bit maps

Most of Motronic maps use the same format.
The code is usually in the beginning of the EPROM, simply because IT vectors start at address $0000. This code is general purpose, very configurable and usable by any Bosch's customer. The other part of the EPROM contains customer's code and data (maps or parameters).

Maps can be 1D or 2D. They are all accessed by the same procedure which is given a table address and the map number.
We'll call this table Map descriptors.
Each byte of this table describes where and how to find the needed map. The meaning of each map has been defined once forever by Bosch, they refer to these tables in their code. The customer is free to define whether the map is 1D or 2D, which parameters it depends on and where to find it.

The map access procedure reads from DPTR pointers the location of the table and reads the byte in the requested position (as in a 1D array). If the read byte is even then the map is 1D, if it's odd - 2D. In both cases the rest of the byte is used to find the address of the map. The address is found at: (<map directory addr> + & 0xFE), because addresses are 2 byte long.
The map directory address is given by the caller or is known by the procedure. The directory stores 2 byte addresses with the MSByte first. The directory is usually straightforward to find as it contains addresses that point at the socend part of the EPROM address space.

Each map describes which input parameters must be fetched to get the output value. In case of input values out of the map, the border map value is used (the output saturates on border values).

By looking at the map you can not find if it's 1D or 2D, you must know it from the map descriptors.

Example of a 2D map starting at 49F4

049F0 38 50 50 80 3A 04 05 23 23 9C 42 02 0A 9C FF 00
04A00 CD 00 9A 00 4D 00 38 06 1F 1F 20 1E 1F 51 80 60

map byte description:
3A - the X parameter name, in fact the 8051 sram location
04 - the X map size
05 23 23 9C - value of X axis points calculated as follows
x0: 0x100 - (9c - 23 - 23 - 05)
x1: 0x100 - (9c - 23 - 23)
x2: 0x100 - (9c - 23)
x3: 0x100 - 9c
it's a delta format, the x3 value can not be less then x2 value
42 - the Y param name
02 - the Y size
0A 9C - Y axis values (100-9C-0A) (100-9C)

FF 00 CD 00 9A 00 4D 00 - the Z values in the order
x0y0 x0y1 x1y0 x1y1 x2y0 x2y1 x3y0 x3y1