MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / encode_l2

Function encode_l2

src/cdrom.cpp:218–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216 }
217
218 void encode_l2 (uae_u8 *p, int address)
219 {
220 uae_u32 v;
221
222 p[0] = 0x00;
223 memset (p + 1, 0xff, 11);
224 p[12] = tobcd ((uae_u8)(address / (60 * 75)));
225 p[13] = tobcd ((uae_u8)((address / 75) % 60));
226 p[14] = tobcd ((uae_u8)(address % 75));
227 p[15] = 1; /* MODE1 */
228 v = build_edc (p, 0, 16 + 2048 - 1);
229 p[2064 + 0] = (uae_u8) (v >> 0);
230 p[2064 + 1] = (uae_u8) (v >> 8);
231 p[2064 + 2] = (uae_u8) (v >> 16);
232 p[2064 + 3] = (uae_u8) (v >> 24);
233 memset (p + 2064 + 4, 0, 8);
234 encode_L2_P (p + 12);
235 encode_L2_Q (p + 12);
236 }

Callers 2

command_rawreadFunction · 0.85
read_blockFunction · 0.85

Calls 4

build_edcFunction · 0.85
encode_L2_PFunction · 0.85
encode_L2_QFunction · 0.85
tobcdFunction · 0.70

Tested by

no test coverage detected