Index: apps/installer-classic/bootstub/bootstub.S |
— | — | @@ -425,6 +425,7 @@ |
426 | 426 | .hword 0xc000
|
427 | 427 | lcddata_2:
|
428 | 428 | lcddata_3:
|
| 429 | + .hword 0xc010
|
429 | 430 | .hword 0x4008
|
430 | 431 | .hword 0x0808
|
431 | 432 | .hword 0x8110
|
— | — | @@ -772,11 +773,10 @@ |
773 | 774 | bne lcdbyteseq
|
774 | 775 | movne r0, r0,lsl#4
|
775 | 776 | bne udelay
|
776 | | - tst r8, #0x20
|
777 | 777 | adr r1, _stubend + 4
|
778 | | - ldreq r6, val_80100db0
|
| 778 | + ldr r6, val_80100db0
|
779 | 779 | ldr r0, _stubend
|
780 | | - streq r6, [r4]
|
| 780 | + str r6, [r4]
|
781 | 781 | add r0, r1, r0
|
782 | 782 | mov r2, #0x08000000
|
783 | 783 | movepayloadloop:
|
Index: umsboot/target/ipodclassic/lcd.c |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | static void lcd_send_data(uint16_t data)
|
62 | 62 | {
|
63 | 63 | while (LCDSTATUS & 0x10);
|
64 | | - LCDWDATA = data;
|
| 64 | + LCDWDATA = (data & 0xff) | ((data & 0x7f00) << 1);
|
65 | 65 | }
|
66 | 66 |
|
67 | 67 | static uint32_t lcd_detect()
|
Index: embios/trunk/target/ipodnano3g/lcd.c |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | static void lcd_send_data(uint16_t data)
|
63 | 63 | {
|
64 | 64 | while (LCDSTATUS & 0x10);
|
65 | | - LCDWDATA = data;
|
| 65 | + LCDWDATA = (data & 0xff) | ((data & 0x7f00) << 1);
|
66 | 66 | }
|
67 | 67 |
|
68 | 68 | static uint32_t lcd_detect()
|
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | {
|
144 | 144 | displaylcd_sync();
|
145 | 145 | uint32_t type = lcd_detect();
|
146 | | - if (type == 3)
|
| 146 | + if (type & 2)
|
147 | 147 | {
|
148 | 148 | lcd_send_cmd(0x7);
|
149 | 149 | lcd_send_data(0x172);
|
Index: embios/trunk/loader/ipodclassic/main.S |
— | — | @@ -446,6 +446,7 @@ |
447 | 447 | .hword 0xc000
|
448 | 448 | lcddata_2:
|
449 | 449 | lcddata_3:
|
| 450 | + .hword 0xc010
|
450 | 451 | .hword 0x4008
|
451 | 452 | .hword 0x0808
|
452 | 453 | .hword 0x8110
|
— | — | @@ -599,6 +600,78 @@ |
600 | 601 | .hword 0x0173
|
601 | 602 | .hword 0xc000
|
602 | 603 |
|
| 604 | + .code 16
|
| 605 | +
|
| 606 | +thumb_nrv2e_d8:
|
| 607 | + mov r7,r2
|
| 608 | + mov r4,#1; neg r5,r4 @ r5= -1 initial condition
|
| 609 | + lsl r4,#31 @ 1<<31: refill next time
|
| 610 | + mov r6,#5
|
| 611 | + lsl r6,#8 @ 0x500 @ nrv2e M2_MAX_OFFSET
|
| 612 | + b top_n2e
|
| 613 | +
|
| 614 | +nrv2e_done:
|
| 615 | + blx flushcache
|
| 616 | + bx r7
|
| 617 | +
|
| 618 | +get1_n2e: @ In: Carry set [from adding 0x80000000 (1<<31) to itself]
|
| 619 | + ldrb r4,[r0] @ zero-extend next byte
|
| 620 | + adc r4,r4 @ double and insert CarryIn as low bit
|
| 621 | + add r0,#1
|
| 622 | + lsl r4,#24 @ move to top byte, and set CarryOut from old bit 8
|
| 623 | + mov pc,lr @ return, stay in current (THUMB) mode
|
| 624 | +
|
| 625 | +lit_n2e:
|
| 626 | + ldrb r3,[r0]; add r0,#1
|
| 627 | + strb r3,[r2]; add r2,#1
|
| 628 | +top_n2e:
|
| 629 | + add r4,r4; mov lr,pc; beq get1_n2e; bcs lit_n2e
|
| 630 | + mov r1,#1; b getoff_n2e
|
| 631 | +
|
| 632 | +off_n2e:
|
| 633 | + sub r1,#1
|
| 634 | + add r4,r4; mov lr,pc; beq get1_n2e; adc r1,r1
|
| 635 | +getoff_n2e:
|
| 636 | + add r4,r4; mov lr,pc; beq get1_n2e; adc r1,r1
|
| 637 | + add r4,r4; mov lr,pc; beq get1_n2e; bcc off_n2e
|
| 638 | +
|
| 639 | + sub r3,r1,#3 @ set Carry
|
| 640 | + mov r1,#0 @ Carry unaffected
|
| 641 | + blo offprev_n2e @ r1 was 2; tests Carry only
|
| 642 | + lsl r3,#8
|
| 643 | + ldrb r5,[r0]; add r0,#1 @ low 7+1 r4
|
| 644 | + orr r5,r3
|
| 645 | + mvn r5,r5; beq nrv2e_done @ r5= ~r5
|
| 646 | + asr r5,#1; bcs lenlast_n2e
|
| 647 | + b lenmore_n2e
|
| 648 | +
|
| 649 | +offprev_n2e:
|
| 650 | + add r4,r4; mov lr,pc; beq get1_n2e; bcs lenlast_n2e
|
| 651 | +lenmore_n2e:
|
| 652 | + mov r1,#1
|
| 653 | + add r4,r4; mov lr,pc; beq get1_n2e; bcs lenlast_n2e
|
| 654 | +len_n2e:
|
| 655 | + add r4,r4; mov lr,pc; beq get1_n2e; adc r1,r1
|
| 656 | + add r4,r4; mov lr,pc; beq get1_n2e; bcc len_n2e
|
| 657 | + add r1,#6-2
|
| 658 | + b gotlen_n2e
|
| 659 | +
|
| 660 | +lenlast_n2e:
|
| 661 | + add r4,r4; mov lr,pc; beq get1_n2e; adc r1,r1 @ 0,1,2,3
|
| 662 | + add r1,#2
|
| 663 | +gotlen_n2e: @ 'cmn': add the inputs, set condition codes, discard the sum
|
| 664 | + cmn r6,r5; bcs near_n2e @ within M2_MAX_OFFSET
|
| 665 | + add r1,#1 @ too far away, so minimum match length is 3
|
| 666 | +near_n2e:
|
| 667 | + ldrb r3,[r2] @ force cacheline allocate
|
| 668 | +copy_n2e:
|
| 669 | + ldrb r3,[r2,r5]
|
| 670 | + strb r3,[r2]; add r2,#1
|
| 671 | + sub r1,#1; bne copy_n2e
|
| 672 | + b top_n2e
|
| 673 | +
|
| 674 | + .code 32
|
| 675 | +
|
603 | 676 | font:
|
604 | 677 | .byte 0, 0, 0, 0, 0
|
605 | 678 | .byte 0, 0, 95, 0, 0
|
— | — | @@ -696,78 +769,6 @@ |
697 | 770 | .byte 0, 65, 54, 8, 0
|
698 | 771 | .byte 2, 1, 2, 4, 2
|
699 | 772 |
|
700 | | - .code 16
|
701 | | - .align 1
|
702 | | -
|
703 | | -thumb_nrv2e_d8:
|
704 | | - mov r7,r2
|
705 | | - mov r4,#1; neg r5,r4 @ r5= -1 initial condition
|
706 | | - lsl r4,#31 @ 1<<31: refill next time
|
707 | | - mov r6,#5
|
708 | | - lsl r6,#8 @ 0x500 @ nrv2e M2_MAX_OFFSET
|
709 | | - b top_n2e
|
710 | | -
|
711 | | -nrv2e_done:
|
712 | | - blx flushcache
|
713 | | - bx r7
|
714 | | -
|
715 | | -get1_n2e: @ In: Carry set [from adding 0x80000000 (1<<31) to itself]
|
716 | | - ldrb r4,[r0] @ zero-extend next byte
|
717 | | - adc r4,r4 @ double and insert CarryIn as low bit
|
718 | | - add r0,#1
|
719 | | - lsl r4,#24 @ move to top byte, and set CarryOut from old bit 8
|
720 | | - mov pc,lr @ return, stay in current (THUMB) mode
|
721 | | -
|
722 | | -lit_n2e:
|
723 | | - ldrb r3,[r0]; add r0,#1
|
724 | | - strb r3,[r2]; add r2,#1
|
725 | | -top_n2e:
|
726 | | - add r4,r4; mov lr,pc; beq get1_n2e; bcs lit_n2e
|
727 | | - mov r1,#1; b getoff_n2e
|
728 | | -
|
729 | | -off_n2e:
|
730 | | - sub r1,#1
|
731 | | - add r4,r4; mov lr,pc; beq get1_n2e; adc r1,r1
|
732 | | -getoff_n2e:
|
733 | | - add r4,r4; mov lr,pc; beq get1_n2e; adc r1,r1
|
734 | | - add r4,r4; mov lr,pc; beq get1_n2e; bcc off_n2e
|
735 | | -
|
736 | | - sub r3,r1,#3 @ set Carry
|
737 | | - mov r1,#0 @ Carry unaffected
|
738 | | - blo offprev_n2e @ r1 was 2; tests Carry only
|
739 | | - lsl r3,#8
|
740 | | - ldrb r5,[r0]; add r0,#1 @ low 7+1 r4
|
741 | | - orr r5,r3
|
742 | | - mvn r5,r5; beq nrv2e_done @ r5= ~r5
|
743 | | - asr r5,#1; bcs lenlast_n2e
|
744 | | - b lenmore_n2e
|
745 | | -
|
746 | | -offprev_n2e:
|
747 | | - add r4,r4; mov lr,pc; beq get1_n2e; bcs lenlast_n2e
|
748 | | -lenmore_n2e:
|
749 | | - mov r1,#1
|
750 | | - add r4,r4; mov lr,pc; beq get1_n2e; bcs lenlast_n2e
|
751 | | -len_n2e:
|
752 | | - add r4,r4; mov lr,pc; beq get1_n2e; adc r1,r1
|
753 | | - add r4,r4; mov lr,pc; beq get1_n2e; bcc len_n2e
|
754 | | - add r1,#6-2
|
755 | | - b gotlen_n2e
|
756 | | -
|
757 | | -lenlast_n2e:
|
758 | | - add r4,r4; mov lr,pc; beq get1_n2e; adc r1,r1 @ 0,1,2,3
|
759 | | - add r1,#2
|
760 | | -gotlen_n2e: @ 'cmn': add the inputs, set condition codes, discard the sum
|
761 | | - cmn r6,r5; bcs near_n2e @ within M2_MAX_OFFSET
|
762 | | - add r1,#1 @ too far away, so minimum match length is 3
|
763 | | -near_n2e:
|
764 | | - ldrb r3,[r2] @ force cacheline allocate
|
765 | | -copy_n2e:
|
766 | | - ldrb r3,[r2,r5]
|
767 | | - strb r3,[r2]; add r2,#1
|
768 | | - sub r1,#1; bne copy_n2e
|
769 | | - b top_n2e
|
770 | | -
|
771 | | - .code 32
|
772 | 773 | .align 2
|
773 | 774 |
|
774 | 775 | foundfile:
|
— | — | @@ -1074,11 +1075,10 @@ |
1075 | 1076 | bne lcdbyteseq
|
1076 | 1077 | movne r0, r0,lsl#4
|
1077 | 1078 | bne udelay
|
1078 | | - tst r8, #0x20
|
1079 | 1079 | mov r10, #0x22000000
|
1080 | | - ldreq r6, val_80100db0
|
| 1080 | + ldr r6, val_80100db0
|
1081 | 1081 | orr r10, r10, #0x10000
|
1082 | | - streq r6, [r4]
|
| 1082 | + str r6, [r4]
|
1083 | 1083 | add r11, r10, #0x25800
|
1084 | 1084 | mov r0, #-1
|
1085 | 1085 | fillbuff:
|
— | — | @@ -1101,7 +1101,7 @@ |
1102 | 1102 | bl sendlcdd
|
1103 | 1103 | add r0, r9, #0x11
|
1104 | 1104 | bl sendlcdc
|
1105 | | - sub r0, r9, #0xc1
|
| 1105 | + add r0, r9, #0x3f
|
1106 | 1106 | bl sendlcdd
|
1107 | 1107 | add r0, r9, #0x12
|
1108 | 1108 | bl sendlcdc
|