comparison compal/sym-fw-disasm @ 390:37ee46a0dde7

compal/sym-fw-disasm: some study of buz.obj code
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 01 Apr 2022 04:30:44 +0000
parents f724d574cff3
children
comparison
equal deleted inserted replaced
389:623316d1ece7 390:37ee46a0dde7
2 ; and AI_InitIOConfig() in the special Mot C11x fw version with symbols 2 ; and AI_InitIOConfig() in the special Mot C11x fw version with symbols
3 ; (R87.2.1.03.m0 and R87.2.1.03.map), made in order to look into these 3 ; (R87.2.1.03.m0 and R87.2.1.03.map), made in order to look into these
4 ; critical board-specific init functions and in order to better prepare 4 ; critical board-specific init functions and in order to better prepare
5 ; ourselves for doing similar analysis on other Compal fw versions 5 ; ourselves for doing similar analysis on other Compal fw versions
6 ; for which we don't have any symbols. 6 ; for which we don't have any symbols.
7 ;
8 ; 2022 update: we have now also done some disassembly of Compal's buzzer
9 ; melody player code, guided by the linker map and symbol table.
7 10
8 0: ea000225 b 0x89c 11 0: ea000225 b 0x89c
9 4: ea000825 b 0x20a0 12 4: ea000825 b 0x20a0
10 8: ea000825 b 0x20a4 13 8: ea000825 b 0x20a4
11 c: ea000825 b 0x20a8 14 c: ea000825 b 0x20a8
200 22ec: e51f0200 ldr r0, =0x280c ; via 0x20f4 203 22ec: e51f0200 ldr r0, =0x280c ; via 0x20f4
201 22f0: e3700001 cmn r0, #1 204 22f0: e3700001 cmn r0, #1
202 22f4: 1b000077 blne 0x24d8 ; _auto_init 205 22f4: 1b000077 blne 0x24d8 ; _auto_init
203 22f8: e1a00002 mov r0, r2 206 22f8: e1a00002 mov r0, r2
204 22fc: ea061cdf b 0x189680 ; _INC_Initialize 207 22fc: ea061cdf b 0x189680 ; _INC_Initialize
208
209 ; Compal-original buz.obj .text section
210
211 $PWT_BZ_set:
212 16dba8: 49de ldr r1, =0xfffef008 ; via 0x16df24
213 16dbaa: 2020 mov r0, #32 ; 0x20
214 16dbac: 880a ldrh r2, [r1, #0]
215 16dbae: 4310 orr r0, r2
216 16dbb0: 8008 strh r0, [r1, #0]
217 16dbb2: 4770 bx lr
218
219 $PWT_BZ_reset:
220 16dbb4: 49db ldr r1, =0xfffef008 ; via 0x16df24
221 16dbb6: 48dc ldr r0, =0xffdf ; via 0x16df28
222 16dbb8: 880a ldrh r2, [r1, #0]
223 16dbba: 4010 and r0, r2
224 16dbbc: 8008 strh r0, [r1, #0]
225 16dbbe: 4770 bx lr
226
227 $lmi_buzzer_on:
228 16dbc0: b510 push {r4, lr}
229 16dbc2: 4bda ldr r3, =0xfffe8802 ; via 0x16df2c
230 16dbc4: 2201 mov r2, #1
231 16dbc6: 781c ldrb r4, [r3, #0]
232 16dbc8: 4322 orr r2, r4
233 16dbca: 701a strb r2, [r3, #0]
234 16dbcc: 4ad8 ldr r2, =0xfffe8800 ; via 0x16df30
235 16dbce: 7010 strb r0, [r2, #0]
236 16dbd0: 2001 mov r0, #1
237 16dbd2: 0049 lsl r1, r1, #1
238 16dbd4: 4308 orr r0, r1
239 16dbd6: 7050 strb r0, [r2, #1]
240 16dbd8: bd10 pop {r4, pc}
241
242 $lmi_buzzer_off:
243 16dbda: 48d6 ldr r0, =0xfffe8801 ; via 0x16df34
244 16dbdc: 7841 ldrb r1, [r0, #1]
245 16dbde: 0849 lsr r1, r1, #1
246 16dbe0: d305 bcc 0x16dbee
247 16dbe2: 2100 mov r1, #0
248 16dbe4: 7001 strb r1, [r0, #0]
249 16dbe6: 21fe mov r1, #254 ; 0xfe
250 16dbe8: 7842 ldrb r2, [r0, #1]
251 16dbea: 4011 and r1, r2
252 16dbec: 7041 strb r1, [r0, #1]
253 16dbee: 4770 bx lr
254
255 $pick_tempo_shift:
256 16dbf0: 1e80 sub r0, r0, #2
257 16dbf2: 2800 cmp r0, #0
258 16dbf4: d012 beq 0x16dc1c
259 16dbf6: 3801 sub r0, #1
260 16dbf8: 2800 cmp r0, #0
261 16dbfa: d00d beq 0x16dc18
262 16dbfc: 3803 sub r0, #3
263 16dbfe: 2802 cmp r0, #2
264 16dc00: d90a bls 0x16dc18
265 16dc02: 3806 sub r0, #6
266 16dc04: 2801 cmp r0, #1
267 16dc06: d907 bls 0x16dc18
268 16dc08: 3803 sub r0, #3
269 16dc0a: 2802 cmp r0, #2
270 16dc0c: d904 bls 0x16dc18
271 16dc0e: 3804 sub r0, #4
272 16dc10: 2801 cmp r0, #1
273 16dc12: d901 bls 0x16dc18
274 16dc14: 2000 mov r0, #0
275 16dc16: 4770 bx lr
276 16dc18: 2001 mov r0, #1
277 16dc1a: 4770 bx lr
278 16dc1c: 2002 mov r0, #2
279 16dc1e: 4770 bx lr
280
281 $pick_freq_shift:
282 16dc20: 1e40 sub r0, r0, #1
283 16dc22: 2813 cmp r0, #19 ; 0x13
284 16dc24: d903 bls 0x16dc2e
285 16dc26: 3825 sub r0, #37 ; 0x25
286 16dc28: 2800 cmp r0, #0
287 16dc2a: d02f beq 0x16dc8c
288 16dc2c: e02c b 0x16dc88
289 16dc2e: a102 add r1, pc, #8
290 16dc30: 0080 lsl r0, r0, #2
291 16dc32: 5808 ldr r0, [r1, r0]
292 16dc34: 4687 mov pc, r0
293 16dc36: 46c0 nop (mov r8, r8)
294
295 16dc38: 0016dca8
296 16dc3c: 0016dca4
297 16dc40: 0016dca0
298 16dc44: 0016dca8
299 16dc48: 0016dc9c
300 16dc4c: 0016dca8
301 16dc50: 0016dc88
302 16dc54: 0016dca8
303 16dc58: 0016dc98
304 16dc5c: 0016dc98
305 16dc60: 0016dc90
306 16dc64: 0016dc90
307 16dc68: 0016dc9c
308 16dc6c: 0016dc9c
309 16dc70: 0016dc88
310 16dc74: 0016dc98
311 16dc78: 0016dca8
312 16dc7c: 0016dc88
313 16dc80: 0016dc94
314 16dc84: 0016dc90
315
316 16dc88: 2100 mov r1, #0
317 16dc8a: e00f b 0x16dcac
318 16dc8c: 2101 mov r1, #1
319 16dc8e: e00d b 0x16dcac
320 16dc90: 2103 mov r1, #3
321 16dc92: e00a b 0x16dcaa
322 16dc94: 2106 mov r1, #6
323 16dc96: e008 b 0x16dcaa
324 16dc98: 2101 mov r1, #1
325 16dc9a: e006 b 0x16dcaa
326 16dc9c: 2102 mov r1, #2
327 16dc9e: e004 b 0x16dcaa
328 16dca0: 2105 mov r1, #5
329 16dca2: e002 b 0x16dcaa
330 16dca4: 2108 mov r1, #8
331 16dca6: e000 b 0x16dcaa
332 16dca8: 2104 mov r1, #4
333 16dcaa: 43c9 mvn r1, r1
334 16dcac: 48a2 ldr r0, =0x83e408 ; _freq_shift
335 16dcae: 6001 str r1, [r0, #0]
336 16dcb0: 2100 mov r1, #0
337 16dcb2: 5e40 ldrsh r0, [r0, r1]
338 16dcb4: 4770 bx lr
339
340 $lmi_custom_tone_req_ring:
341 16dcb6: b5f0 push {r4, r5, r6, r7, lr}
342 16dcb8: 1c04 add r4, r0, #0
343 16dcba: 4da0 ldr r5, =0x83e414 ; _lmi_audio_control
344 16dcbc: 2005 mov r0, #5
345 16dcbe: 7028 strb r0, [r5, #0]
346 16dcc0: 2c25 cmp r4, #37 ; 0x25
347 16dcc2: d001 beq 0x16dcc8
348 16dcc4: 2c26 cmp r4, #38 ; 0x26
349 16dcc6: d101 bne 0x16dccc
350 16dcc8: 2004 mov r0, #4
351 16dcca: 7028 strb r0, [r5, #0]
352 16dccc: 2600 mov r6, #0
353 16dcce: 706e strb r6, [r5, #1]
354 16dcd0: 2c01 cmp r4, #1
355 16dcd2: d101 bne 0x16dcd8
356 16dcd4: 489a ldr r0, =0x34ab4 ; _custom_tone_volume_table_1
357 16dcd6: e008 b 0x16dcea
358 16dcd8: 2c02 cmp r4, #2
359 16dcda: d003 beq 0x16dce4
360 16dcdc: 2c0b cmp r4, #11 ; 0xb
361 16dcde: d001 beq 0x16dce4
362 16dce0: 2c09 cmp r4, #9
363 16dce2: d101 bne 0x16dce8
364 16dce4: 4897 ldr r0, =0x34abc ; _custom_tone_volume_table_2
365 16dce6: e000 b 0x16dcea
366 16dce8: 4897 ldr r0, =0x34aac ; _custom_tone_volume_table
367 16dcea: 5c40 ldrb r0, [r0, r1]
368 16dcec: 70a8 strb r0, [r5, #2]
369 16dcee: 70ea strb r2, [r5, #3]
370 16dcf0: 2701 mov r7, #1
371 16dcf2: 712f strb r7, [r5, #4]
372 16dcf4: 80ee strh r6, [r5, #6]
373 16dcf6: f018 faeb bl 0x1862d0 ; $mmiGetRingTone
374 16dcfa: 2c00 cmp r4, #0
375 16dcfc: dd1d ble 0x16dd3a
376 16dcfe: 2c2a cmp r4, #42 ; 0x2a
377 16dd00: dc1b bgt 0x16dd3a
378 16dd02: 0121 lsl r1, r4, #4
379 16dd04: 1841 add r1, r0, r1
380 16dd06: 4a91 ldr r2, =0x83e40c ; _lmi_playing_tone
381 16dd08: 1c08 add r0, r1, #0
382 16dd0a: 3810 sub r0, #16 ; 0x10
383 16dd0c: 6800 ldr r0, [r0, #0]
384 16dd0e: 6010 str r0, [r2, #0]
385 16dd10: 200c mov r0, #12 ; 0xc
386 16dd12: 1a08 sub r0, r1, r0
387 16dd14: 498e ldr r1, =0x83e410 ; _freq_component
388 16dd16: 7802 ldrb r2, [r0, #0]
389 16dd18: 700a strb r2, [r1, #0]
390 16dd1a: 498e ldr r1, =0x83e411 ; _style_infor
391 16dd1c: 700f strb r7, [r1, #0]
392 16dd1e: 2c2a cmp r4, #42 ; 0x2a
393 16dd20: db02 blt 0x16dd28
394 16dd22: 4885 ldr r0, =0x83e408 ; _freq_shift
395 16dd24: 6006 str r6, [r0, #0]
396 16dd26: e006 b 0x16dd36
397 16dd28: 4a83 ldr r2, =0x83e408 ; _freq_shift
398 16dd2a: 6841 ldr r1, [r0, #4]
399 16dd2c: 6011 str r1, [r2, #0]
400 16dd2e: 6880 ldr r0, [r0, #8]
401 16dd30: 7829 ldrb r1, [r5, #0]
402 16dd32: 1840 add r0, r0, r1
403 16dd34: 7028 strb r0, [r5, #0]
404 16dd36: 4888 ldr r0, =0x83e404 ; _lmi_play_state
405 16dd38: 7007 strb r7, [r0, #0]
406 16dd3a: bdf0 pop {r4, r5, r6, r7, pc}
407
408 $lmi_custom_tone_req:
409 16dd3c: b530 push {r4, r5, lr}
410 16dd3e: 4c7f ldr r4, =0x83e414 ; _lmi_audio_control
411 16dd40: 2505 mov r5, #5
412 16dd42: 7025 strb r5, [r4, #0]
413 16dd44: 2500 mov r5, #0
414 16dd46: 7065 strb r5, [r4, #1]
415 16dd48: 4d7f ldr r5, =0x34aac ; _custom_tone_volume_table
416 16dd4a: 5c69 ldrb r1, [r5, r1]
417 16dd4c: 70a1 strb r1, [r4, #2]
418 16dd4e: 70e2 strb r2, [r4, #3]
419 16dd50: 2101 mov r1, #1
420 16dd52: 7121 strb r1, [r4, #4]
421 16dd54: 2200 mov r2, #0
422 16dd56: 80e2 strh r2, [r4, #6]
423 16dd58: 4a7e ldr r2, =0x83e411 ; _style_infor
424 16dd5a: 7011 strb r1, [r2, #0]
425 16dd5c: 4a7b ldr r2, =0x83e40c ; _lmi_playing_tone
426 16dd5e: 6010 str r0, [r2, #0]
427 16dd60: 487b ldr r0, =0x83e410 ; _freq_component
428 16dd62: 7003 strb r3, [r0, #0]
429 16dd64: 4874 ldr r0, =0x83e408 ; _freq_shift
430 16dd66: 2200 mov r2, #0
431 16dd68: 6002 str r2, [r0, #0]
432 16dd6a: 487b ldr r0, =0x83e404 ; _lmi_play_state
433 16dd6c: 7001 strb r1, [r0, #0]
434 16dd6e: bd30 pop {r4, r5, pc}
435
436 $DM_buzzer_ringtone_control:
437 16dd70: b500 push {lr}
438 16dd72: 2800 cmp r0, #0
439 16dd74: d107 bne 0x16dd86
440 16dd76: f7ff ff30 bl 0x16dbda ; $lmi_buzzer_off
441 16dd7a: f7ff ff1b bl 0x16dbb4 ; $PWT_BZ_reset
442 16dd7e: 4976 ldr r1, =0x83e404 ; _lmi_play_state
443 16dd80: 2000 mov r0, #0
444 16dd82: 7008 strb r0, [r1, #0]
445 16dd84: bd00 pop {pc}
446 16dd86: 1c10 add r0, r2, #0
447 16dd88: 1c1a add r2, r3, #0
448 16dd8a: f7ff ff94 bl 0x16dcb6 ; $lmi_custom_tone_req_ring
449 16dd8e: f7ff ff0b bl 0x16dba8 ; $PWT_BZ_set
450 16dd92: bd00 pop {pc}
451
452 $DM_buzzer_control:
453 16dd94: b590 push {r4, r7, lr}
454 16dd96: af03 add r7, sp, #12 ; 0xc
455 16dd98: 1c1c add r4, r3, #0
456 16dd9a: 783b ldrb r3, [r7, #0]
457 16dd9c: 2800 cmp r0, #0
458 16dd9e: d107 bne 0x16ddb0
459 16dda0: f7ff ff1b bl 0x16dbda ; $lmi_buzzer_off
460 16dda4: f7ff ff06 bl 0x16dbb4 ; $PWT_BZ_reset
461 16dda8: 496b ldr r1, =0x83e404 ; _lmi_play_state
462 16ddaa: 2000 mov r0, #0
463 16ddac: 7008 strb r0, [r1, #0]
464 16ddae: bd90 pop {r4, r7, pc}
465 16ddb0: 1c10 add r0, r2, #0
466 16ddb2: 1c22 add r2, r4, #0
467 16ddb4: f7ff ffc2 bl 0x16dd3c ; $lmi_custom_tone_req
468 16ddb8: f7ff fef6 bl 0x16dba8 ; $PWT_BZ_set
469 16ddbc: bd90 pop {r4, r7, pc}
470
471 $BZ_status:
472 16ddbe: 2000 mov r0, #0
473 16ddc0: 4965 ldr r1, =0x83e404 ; _lmi_play_state
474 16ddc2: 7809 ldrb r1, [r1, #0]
475 16ddc4: 2900 cmp r1, #0
476 16ddc6: d000 beq 0x16ddca
477 16ddc8: 2001 mov r0, #1
478 16ddca: 4770 bx lr
479
480 $lmi_custom_tone_handler:
481 16ddcc: b570 push {r4, r5, r6, lr}
482 16ddce: b094 sub sp, #80 ; 0x50
483 16ddd0: 4d61 ldr r5, =0x83e404 ; _lmi_play_state
484 16ddd2: 7828 ldrb r0, [r5, #0]
485 16ddd4: 2800 cmp r0, #0
486 16ddd6: d100 bne 0x16ddda
487 16ddd8: e099 b 0x16df0e
488 16ddda: 485c ldr r0, =0x83e40c ; _lmi_playing_tone
489 16dddc: 6801 ldr r1, [r0, #0]
490 16ddde: 4c57 ldr r4, =0x83e414 ; _lmi_audio_control
491 16dde0: 7860 ldrb r0, [r4, #1]
492 16dde2: 0080 lsl r0, r0, #2
493 16dde4: 180e add r6, r1, r0
494 16dde6: 7920 ldrb r0, [r4, #4]
495 16dde8: 1e40 sub r0, r0, #1
496 16ddea: 2800 cmp r0, #0
497 16ddec: d053 beq 0x16de96
498 16ddee: 3801 sub r0, #1
499 16ddf0: 2800 cmp r0, #0
500 16ddf2: d035 beq 0x16de60
501 16ddf4: 3801 sub r0, #1
502 16ddf6: 2800 cmp r0, #0
503 16ddf8: d15b bne 0x16deb2
504 16ddfa: 2006 mov r0, #6
505 16ddfc: 5f00 ldrsh r0, [r0, r4]
506 16ddfe: 2800 cmp r0, #0
507 16de00: dc44 bgt 0x16de8c
508 16de02: 7860 ldrb r0, [r4, #1]
509 16de04: 3001 add r0, #1
510 16de06: 7060 strb r0, [r4, #1]
511 16de08: 7860 ldrb r0, [r4, #1]
512 16de0a: 0080 lsl r0, r0, #2
513 16de0c: 180d add r5, r1, r0
514 16de0e: 8868 ldrh r0, [r5, #2]
515 16de10: 2800 cmp r0, #0
516 16de12: d10f bne 0x16de34
517 16de14: 7861 ldrb r1, [r4, #1]
518 16de16: 484e ldr r0, =0x83e410 ; _freq_component
519 16de18: 7800 ldrb r0, [r0, #0]
520 16de1a: 3801 sub r0, #1
521 16de1c: 4281 cmp r1, r0
522 16de1e: da04 bge 0x16de2a
523 16de20: 4944 ldr r1, =0xfffe8801 ; via 0x16df34
524 16de22: 2000 mov r0, #0
525 16de24: 7008 strb r0, [r1, #0]
526 16de26: 2003 mov r0, #3
527 16de28: e015 b 0x16de56
528 16de2a: 2001 mov r0, #1
529 16de2c: 7120 strb r0, [r4, #4]
530 16de2e: 2000 mov r0, #0
531 16de30: 7060 strb r0, [r4, #1]
532 16de32: e011 b 0x16de58
533 16de34: 4840 ldr r0, =0x83e408 ; _freq_shift
534 16de36: 8801 ldrh r1, [r0, #0]
535 16de38: 8868 ldrh r0, [r5, #2]
536 16de3a: 1808 add r0, r1, r0
537 16de3c: 0400 lsl r0, r0, #16
538 16de3e: 0c00 lsr r0, r0, #16
539 16de40: 0040 lsl r0, r0, #1
540 16de42: 4946 ldr r1, =0x34ac4 ; _l1_tone_table
541 16de44: 5c08 ldrb r0, [r1, r0]
542 16de46: 78a1 ldrb r1, [r4, #2]
543 16de48: 786a ldrb r2, [r5, #1]
544 16de4a: 1889 add r1, r1, r2
545 16de4c: 0609 lsl r1, r1, #24
546 16de4e: 0e09 lsr r1, r1, #24
547 16de50: f7ff feb6 bl 0x16dbc0 ; $lmi_buzzer_on
548 16de54: 2002 mov r0, #2
549 16de56: 7120 strb r0, [r4, #4]
550 16de58: 7828 ldrb r0, [r5, #0]
551 16de5a: 7821 ldrb r1, [r4, #0]
552 16de5c: 4348 mul r0, r1
553 16de5e: e018 b 0x16de92
554 16de60: 2006 mov r0, #6
555 16de62: 5f00 ldrsh r0, [r0, r4]
556 16de64: 2800 cmp r0, #0
557 16de66: dc11 bgt 0x16de8c
558 16de68: 2100 mov r1, #0
559 16de6a: 4832 ldr r0, =0xfffe8801 ; via 0x16df34
560 16de6c: 7001 strb r1, [r0, #0]
561 16de6e: 7862 ldrb r2, [r4, #1]
562 16de70: 4837 ldr r0, =0x83e410 ; _freq_component
563 16de72: 7800 ldrb r0, [r0, #0]
564 16de74: 3801 sub r0, #1
565 16de76: 4282 cmp r2, r0
566 16de78: db02 blt 0x16de80
567 16de7a: 2001 mov r0, #1
568 16de7c: 7061 strb r1, [r4, #1]
569 16de7e: e003 b 0x16de88
570 16de80: 4834 ldr r0, =0x83e411 ; _style_infor
571 16de82: 7800 ldrb r0, [r0, #0]
572 16de84: 80e0 strh r0, [r4, #6]
573 16de86: 2003 mov r0, #3
574 16de88: 7120 strb r0, [r4, #4]
575 16de8a: e040 b 0x16df0e
576 16de8c: 2006 mov r0, #6
577 16de8e: 5f00 ldrsh r0, [r0, r4]
578 16de90: 3801 sub r0, #1
579 16de92: 80e0 strh r0, [r4, #6]
580 16de94: e03b b 0x16df0e
581 16de96: 4668 mov r0, sp
582 16de98: a11e add r1, pc, #120 ; 0x78
583 16de9a: f01a f9e7 bl 0x18826c ; $sprintf
584 16de9e: 4668 mov r0, sp
585 16dea0: f751 fd90 bl 0xbf9c4 ; $L1_send_debug
586 16dea4: 78e0 ldrb r0, [r4, #3]
587 16dea6: 2800 cmp r0, #0
588 16dea8: d003 beq 0x16deb2
589 16deaa: 4829 ldr r0, =0x83e410 ; _freq_component
590 16deac: 7800 ldrb r0, [r0, #0]
591 16deae: 2800 cmp r0, #0
592 16deb0: d106 bne 0x16dec0
593 16deb2: f7ff fe92 bl 0x16dbda ; $lmi_buzzer_off
594 16deb6: f7ff fe7d bl 0x16dbb4 ; $PWT_BZ_reset
595 16deba: 2000 mov r0, #0
596 16debc: 7028 strb r0, [r5, #0]
597 16debe: e026 b 0x16df0e
598 16dec0: 8870 ldrh r0, [r6, #2]
599 16dec2: 2800 cmp r0, #0
600 16dec4: d109 bne 0x16deda
601 16dec6: 481b ldr r0, =0xfffe8801 ; via 0x16df34
602 16dec8: 1c42 add r2, r0, #1
603 16deca: 2101 mov r1, #1
604 16decc: 7813 ldrb r3, [r2, #0]
605 16dece: 4319 orr r1, r3
606 16ded0: 7011 strb r1, [r2, #0]
607 16ded2: 2100 mov r1, #0
608 16ded4: 7001 strb r1, [r0, #0]
609 16ded6: 2003 mov r0, #3
610 16ded8: e00f b 0x16defa
611 16deda: 4917 ldr r1, =0x83e408 ; _freq_shift
612 16dedc: 8809 ldrh r1, [r1, #0]
613 16dede: 1840 add r0, r0, r1
614 16dee0: 0400 lsl r0, r0, #16
615 16dee2: 0c00 lsr r0, r0, #16
616 16dee4: 0040 lsl r0, r0, #1
617 16dee6: 491d ldr r1, =0x34ac4 ; _l1_tone_table
618 16dee8: 5c08 ldrb r0, [r1, r0]
619 16deea: 78a1 ldrb r1, [r4, #2]
620 16deec: 7872 ldrb r2, [r6, #1]
621 16deee: 1889 add r1, r1, r2
622 16def0: 0609 lsl r1, r1, #24
623 16def2: 0e09 lsr r1, r1, #24
624 16def4: f7ff fe64 bl 0x16dbc0 ; $lmi_buzzer_on
625 16def8: 2002 mov r0, #2
626 16defa: 7120 strb r0, [r4, #4]
627 16defc: 7830 ldrb r0, [r6, #0]
628 16defe: 7821 ldrb r1, [r4, #0]
629 16df00: 4348 mul r0, r1
630 16df02: 80e0 strh r0, [r4, #6]
631 16df04: 78e0 ldrb r0, [r4, #3]
632 16df06: 28ff cmp r0, #255 ; 0xff
633 16df08: d001 beq 0x16df0e
634 16df0a: 1e40 sub r0, r0, #1
635 16df0c: 70e0 strb r0, [r4, #3]
636 16df0e: b014 add sp, #80 ; 0x50
637 16df10: bd70 pop {r4, r5, r6, pc}
638 16df12: 46c0 nop (mov r8, r8)
205 639
206 $Init_Target: 640 $Init_Target:
207 17ba8c: b530 push {r4, r5, lr} 641 17ba8c: b530 push {r4, r5, lr}
208 17ba8e: b081 sub sp, #4 642 17ba8e: b081 sub sp, #4
209 17ba90: 496e ldr r1, =0xfffef008 ; via 0x17bc4c 643 17ba90: 496e ldr r1, =0xfffef008 ; via 0x17bc4c
580 18226c: 8811 ldrh r1, [r2, #0] 1014 18226c: 8811 ldrh r1, [r2, #0]
581 18226e: 4301 orr r1, r0 1015 18226e: 4301 orr r1, r0
582 182270: 8011 strh r1, [r2, #0] 1016 182270: 8011 strh r1, [r2, #0]
583 182272: 4770 bx lr 1017 182272: 4770 bx lr
584 1018
1019 ; buzzer.obj .text section follows, as identified in the linker map.
1020 ; All code is strictly unchanged from TCS211 original.
1021
1022 $BZ_Init:
1023 186124: 4770 bx lr
1024
1025 $BZ_Enable:
1026 186126: 492e ldr r1, =0xfffe480e ; via 0x1861e0
1027 186128: 2001 mov r0, #1
1028 18612a: 880a ldrh r2, [r1, #0]
1029 18612c: 4310 orr r0, r2
1030 18612e: 8008 strh r0, [r1, #0]
1031 186130: 4770 bx lr
1032
1033 $BZ_Disable:
1034 186132: 482b ldr r0, =0xfffe480e ; via 0x1861e0
1035 186134: 8801 ldrh r1, [r0, #0]
1036 186136: 0409 lsl r1, r1, #16
1037 186138: 0c49 lsr r1, r1, #17
1038 18613a: 0049 lsl r1, r1, #1
1039 18613c: 8001 strh r1, [r0, #0]
1040 18613e: 4770 bx lr
1041
1042 $BZ_Tone:
1043 186140: 21ff mov r1, #255 ; 0xff
1044 186142: 3101 add r1, #1
1045 186144: 4288 cmp r0, r1
1046 186146: db00 blt 0x18614a
1047 186148: 20ff mov r0, #255 ; 0xff
1048 18614a: 4926 ldr r1, =0xfffe4808 ; via 0x1861e4
1049 18614c: 8008 strh r0, [r1, #0]
1050 18614e: 4770 bx lr
1051
1052 $BZ_Volume:
1053 186150: 2840 cmp r0, #64 ; 0x40
1054 186152: db00 blt 0x186156
1055 186154: 203f mov r0, #63 ; 0x3f
1056 186156: 4924 ldr r1, =0xfffe4812 ; via 0x1861e8
1057 186158: 8008 strh r0, [r1, #0]
1058 18615a: 4770 bx lr
1059
1060 $BZ_KeyBeep_ON:
1061 18615c: b500 push {lr}
1062 18615e: b081 sub sp, #4
1063 186160: f7ff ffe0 bl 0x186124
1064 186164: 20ff mov r0, #255 ; 0xff
1065 186166: f7ff fff3 bl 0x186150
1066 18616a: f7ff ffdc bl 0x186126
1067 18616e: 2032 mov r0, #50 ; 0x32
1068 186170: f7ff ffe6 bl 0x186140
1069 186174: 2000 mov r0, #0
1070 186176: e001 b 0x18617c
1071 186178: 9800 ldr r0, [sp, #0]
1072 18617a: 3001 add r0, #1
1073 18617c: 9000 str r0, [sp, #0]
1074 18617e: 9900 ldr r1, [sp, #0]
1075 186180: 481a ldr r0, =0x4268 ; via 0x1861ec
1076 186182: 4281 cmp r1, r0
1077 186184: dbf8 blt 0x186178
1078 186186: f7ff ffd4 bl 0x186132
1079 18618a: b001 add sp, #4
1080 18618c: bd00 pop {pc}
1081
1082 $BZ_KeyBeep_OFF:
1083 18618e: b500 push {lr}
1084 186190: b081 sub sp, #4
1085 186192: f7ff ffc7 bl 0x186124
1086 186196: 20ff mov r0, #255 ; 0xff
1087 186198: f7ff ffda bl 0x186150
1088 18619c: f7ff ffc3 bl 0x186126
1089 1861a0: 2064 mov r0, #100 ; 0x64
1090 1861a2: f7ff ffcd bl 0x186140
1091 1861a6: 2000 mov r0, #0
1092 1861a8: e001 b 0x1861ae
1093 1861aa: 9800 ldr r0, [sp, #0]
1094 1861ac: 3001 add r0, #1
1095 1861ae: 9000 str r0, [sp, #0]
1096 1861b0: 9900 ldr r1, [sp, #0]
1097 1861b2: 480e ldr r0, =0x4268 ; via 0x1861ec
1098 1861b4: 4281 cmp r1, r0
1099 1861b6: dbf8 blt 0x1861aa
1100 1861b8: f7ff ffbb bl 0x186132
1101 1861bc: b001 add sp, #4
1102 1861be: bd00 pop {pc}
1103
1104 $LT_Enable:
1105 1861c0: 4770 bx lr
1106
1107 $LT_Disable:
1108 1861c2: 4770 bx lr
1109
1110 $LT_Level:
1111 1861c4: 2840 cmp r0, #64 ; 0x40
1112 1861c6: db00 blt 0x1861ca
1113 1861c8: 203f mov r0, #63 ; 0x3f
1114 1861ca: 4909 ldr r1, =0xfffe4810 ; via 0x1861f0
1115 1861cc: 8008 strh r0, [r1, #0]
1116 1861ce: 4770 bx lr
1117
1118 $LT_Status:
1119 1861d0: 4803 ldr r0, =0xfffe480e ; via 0x1861e0
1120 1861d2: 8800 ldrh r0, [r0, #0]
1121 1861d4: 0840 lsr r0, r0, #1
1122 1861d6: 07c0 lsl r0, r0, #31
1123 1861d8: 0fc0 lsr r0, r0, #31
1124 1861da: 0600 lsl r0, r0, #24
1125 1861dc: 0e00 lsr r0, r0, #24
1126 1861de: 4770 bx lr
1127
585 $INC_Initialize: 1128 $INC_Initialize:
586 1887ac: b510 push {r4, lr} 1129 1887ac: b510 push {r4, lr}
587 1887ae: 1c04 add r4, r0, #0 1130 1887ae: 1c04 add r4, r0, #0
588 1887b0: 4813 ldr r0, =0x83e688 ; via 0x188800 1131 1887b0: 4813 ldr r0, =0x83e688 ; via 0x188800
589 1887b2: 2101 mov r1, #1 1132 1887b2: 2101 mov r1, #1