Changeset 31

Show
Ignore:
Timestamp:
08/02/09 03:47:17 (3 years ago)
Author:
brandonlw
Message:

Set up the framework for receiving the TI-OS to dual boot

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/includes/os2.inc

    r29 r31  
    201201linkFlags                   EQU    1Bh 
    202202useUSB                      EQU    5 
     203 
     204linkFlags2                  EQU    1Ch    ;this is not used by the TI-OS as far as I know 
     205receiveTIOS                 EQU    0 
    203206 
    204207;---------------------------------------------------------------------- 
  • trunk/page00/boot.asm

    r30 r31  
    465465       set onRunning,(iy+onFlags) 
    466466;Start the OS, minimal as it is 
     467       res receiveTIOS,(iy+linkFlags2) 
    467468       call ClrLCDFull 
    468469       res indicOnly,(iy+indicFlags) 
     
    572573       ld hl,sClearToCancel 
    573574       call PutS 
     575       set receiveTIOS,(iy+linkFlags2)    ;receive the TI-OS to the extra pages instead of just jumping to the boot code 
    574576BootLoaderKeyLoop: 
    575577       B_CALL GetKey 
  • trunk/page1C/linkprotocol.asm

    r29 r31  
    55 include "includes\internal.inc" 
    66 
    7  PUBLIC SendCommandA,ReceiveHeaderPacket,SendSkipExitPacket,SendCAndAddToChecksum 
     7 PUBLIC SendCommandA,ReceiveHeaderPacket,SendSkipExitPacket,SendCAndAddToChecksum,SendContinue,ReceiveDataPacket 
    88 EXTERN SetupPagedPtr,EnableLinkAssist,Send4Bytes,PagedGet,SendAByte,Get4BytesNC,JErrorNo 
    99 EXTERN SendCByte,RecAByteIO,SaveFlashBytes,SendAcknowledge 
     10 
     11SendContinue: 
     12       ld hl,0973h 
     13       ld (header),hl 
     14       ld hl,0 
     15       ld (header+2),hl 
     16       jr Send4Bytes 
    1017 
    1118SendCommandA: 
  • trunk/page1C/silentlink.asm

    r30 r31  
    99 EXTERN DispHexA,LdHLInd,SendAcknowledge,ReceiveHeaderPacket,SendSkipExitPacket,Get4BytesNC,SendCommandA 
    1010 EXTERN Send4Bytes,SendCAndAddToChecksum,LCDDelay,_LCD_COMMAND,SendAByte,SetXAutoIncrementMode 
    11  EXTERN SetYAutoIncrementMode 
     11 EXTERN SetYAutoIncrementMode,SendContinue,ReceiveDataPacket 
    1212 
    1313keyscnlnk: 
     
    153153       call SendAcknowledge 
    154154       jr keyscnlnkEnd 
     155 
    155156receivedVariableHeader: 
    156157       call ReceiveHeaderPacket 
     
    164165       jr keyscnlnkEnd 
    165166receivingOS: 
     167       bit receiveTIOS,(iy+linkFlags2) 
     168       jr z,ReceiveNewOS 
     169       ld hl,receiveTIOSHandler 
     170       call APP_PUSH_ERRORH 
     171;TODO: actually implement all of this 
     172ReceiveOSPage: 
     173       call SendContinue 
     174       ld bc,(ioData) 
     175       ld hl,appData 
     176       ld (iMathPtr5),hl 
     177       call ReceiveDataPacket 
     178       call Get4BytesNC 
     179       ld a,(header+1) 
     180       cp 92h 
     181       jr z,$F 
     182       call ReceiveHeaderPacket 
     183       jr ReceiveOSPage 
     184$$:    call SendAcknowledge 
     185;Receive a copy of the TI-OS to the spare Flash sectors 
     186;Patch the received TI-OS to not erase sector 70h (where we will be backed up) 
     187;Put the [X,T,theta,N] boot loader in page 0 
     188       call APP_POP_ERRORH 
     189receiveTIOSHandler: 
     190       jr keyscnlnkEnd 
     191ReceiveNewOS: 
     192;Start the process of receiving the OS to replace this one 
    166193       call EnableLinkAssist 
    167194       ld a,0FFh