Rom an

= Intro = These are ROMs which I (fenugrec) initially analyzed as part of the crowdfunding campaing for the reflashing kernel.

All additional observations, notes and data are *very* useful ! Feel free to add stuff here; if it's something tentative or unconfirmed, it should still be added, with the note "unconfirmed".

A lot of concepts are covered elsewhere ( https://nissanecu.miraheze.org/wiki/Firmware_re ). Most of this assumes that the reader will be familiar with microcontrollers and low level programming in general.

It goes without saying that the SuperH docs (datasheet and software reference Manual), listed on https://nissanecu.miraheze.org/wiki/Sh_docs, should be kept handy.

= Definitions and conventions = Everything is of course based only on my limited experience, and can therefore be wrong or misleading. Some of the naming conventions are my own and are just the first names I came up with when analyzing code.

To lighten the text, I will often write " in every ROM" or " always"; what I really mean is " in every ROM I've seen", which consists of only about 30 ROMs.

In general I use a notation very similar to standard C. Some examples:
 * << means binary left shift
 * & between numbers or register names means a bitwise AND, which is not the same thing as the logic AND operator &&. (0x55 & 0xF0) == 0x50.
 * & prefixed to a name means "address of". i.e. "r4=&table_axis" would mean "	write the address of table_axis to the register r4".

For table(map) names, I use mostly "t__aXb_addr", and a few of a previous notation "t _AxB_addr". Axis : ax___addr. Example:

Examples:
 * t_b_8X8_8EED means an 8x8 table, where each value is a byte; table stored at 0x8EED in the ROM.
 * t16u_1x32_DE58 is a 1x32 table of 16bit words.
 * ax_16_u8_DDA8 is a 16-element axis of bytes, at 0xDDA8.

= Analyzed ROMs =
 * CF43D - '06 350Z, VQ35DE