Show
Ignore:
Timestamp:
08/05/09 02:59:44 (3 years ago)
Author:
brandonlw
Message:

We can now receive a copy of the TI-OS and save it to pages 04h-07h and 74h-7Bh (pages 00h-03h are redirected to pages 70h-73h, and 7Ch-7Dh to 6Ah-6Bh)
Now we just need the boot loader and TI-OS patches to allow on-the-fly dual booting
And direct USB support so everyone can use it...

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/page1C/silentlink.asm

    r34 r35  
    1010 EXTERN Send4Bytes,SendCAndAddToChecksum,LCDDelay,_LCD_COMMAND,SendAByte,SetXAutoIncrementMode,EraseRAMPage 
    1111 EXTERN SetYAutoIncrementMode,SendContinue,ReceiveDataPacket,DispHexHL,PutC,receiveRestOfDataPacket 
    12  EXTERN CopyToRAMPage,CopyRAMToFlashPage,EraseEOL,PowerOff 
     12 EXTERN CopyToRAMPage,CopyRAMToFlashPage,EraseEOL,PowerOff,SendHCommand,IPutSB 
    1313 
    1414keyscnlnk: 
     
    5151       ;This is a command we don't recognize 
    5252       ;TODO: for now, freak out 
     53       ld a,5 
     54       call PutC 
    5355       ld a,(header+1) 
    5456       call DispHexA 
     
    9496       DB 06h 
    9597       DW receivedVariableHeader 
     98       DB 0A2h 
     99       DW receivedRequestToSend 
    96100       DB 87h 
    97101       DW remoteControlPacket 
     
    101105       DW keyscnlnkEnd 
    102106cmdTableEnd: 
     107 
     108receivedRequestToSend: 
     109       call receiveRestOfDataPacket 
     110       ld a,(ioOP1) 
     111       cp 19h 
     112       jr z,sendDirectoryContentsResponse 
     113       ld a,6 
     114       call PutC 
     115       ld a,0A2h 
     116       call DispHexA 
     117       ld hl,ioOP1 
     118       ld b,11 
     119       call IPutSB 
     120       ld a,6 
     121       call PutC 
     122       jr keyscnlnkEnd 
     123sendDirectoryContentsResponse: 
     124;TODO: actually implement the directory contents response 
     125       ld hl,22000 
     126       ld (ioData),hl 
     127       ld a,15h 
     128       ld hl,2 
     129       call SendCommandA 
     130       ld h,92h 
     131       call SendHCommand 
     132       jr keyscnlnkEnd 
    103133 
    104134screenshotPacket: 
     
    163193       jr z,receivingOS 
    164194       ;Not accepting anything else for now 
     195       call DispHexA 
    165196       ld de,1 
    166197       ld a,0Ch 
     
    170201       bit receiveTIOS,(iy+linkFlags2) 
    171202       jr z,ReceiveNewOS 
     203       B_CALL UnlockFlash 
    172204       ;Wipe the extra RAM pages 
    173205       ld a,84h 
     
    246278       push af 
    247279       push hl 
     280       call DispHexHL       ;*** TESTING 
    248281       ld b,a 
    249282       ld a,(appSearchPage) 
     
    300333       jr dataWritten 
    301334$$:    ;Is this page 7Ch or 7Dh? If so, change it to 6Ah or 6Bh 
    302        push af 
    303        ld a,6 
    304        call PutC 
    305        pop af 
    306335       cp 7Ch 
    307336       ld b,6Ah 
     
    316345       ld b,3Bh 
    317346       jr z,translatePage 
     347       cp 3Ah 
     348       jr z,checkAddress 
     349       cp 7Ah 
     350       jr z,checkAddress 
    318351$$:    ;Just write it 
    319        pop bc 
     352       ld hl,6 
     353       ld (curRow),hl 
     354       call DispHexA 
     355       ex de,hl 
     356       call DispHexHL 
     357       ex de,hl 
     358       pop bc 
     359       push bc 
     360       pop hl 
     361       call DispHexHL 
    320362       ld hl,appData 
    321363       B_CALL WriteFlash 
     
    324366       ld a,b 
    325367       jr $B 
     368checkAddress: 
     369       push de 
     370       ld hl,4200h 
     371       or a 
     372       sbc hl,de 
     373       pop de 
     374       jr c,$B 
     375       jr z,$B 
     376       ;Skip writes to 7A:4000h and 7A:4100h 
    326377dataWritten: 
    327378       call Get4BytesNC 
     
    332383       jr ReceiveOSPage 
    333384$$:    call SendAcknowledge 
    334 ;Patch the received TI-OS to not erase sector 70h (where we will be backed up) 
    335 ;Put the [X,T,theta,N] boot loader in page 0 
     385;TODO: Patch the received TI-OS to not erase sector 70h (where we will be backed up) 
     386;TODO: Put the [X,T,theta,N] boot loader in page 0 
     387       ;This loader needs to read the keypad for skGraphvar, and if it's being pressed, call: 
     388       ;      in a,(6) 
     389       ;      push af 
     390       ;      ld a,70h 
     391       ;      out (6),a 
     392       ;      call StartBootLoader+4000h 
     393       ;      pop af 
     394       ;      out (6),a 
     395       ;      ret 
    336396       call APP_POP_ERRORH 
    337397       ;Seems like the most sensible thing to do after receiving the TI-OS is just shut off 
     
    358418       call SendAcknowledge 
    359419       ld hl,ioData 
    360        ld (hl),OS2_VERSION_MAJOR 
    361        inc hl 
    362        ld (hl),OS2_VERSION_MINOR 
     420       ld (hl),2 ;OS2_VERSION_MAJOR 
     421       inc hl 
     422       ld (hl),22h ;OS2_VERSION_MINOR 
    363423       inc hl 
    364424       B_CALL GetBootVer