Changeset 60

Show
Ignore:
Timestamp:
11/08/09 18:23:13 (3 years ago)
Author:
brandonlw
Message:

More attempts to stabilize dual booting

Location:
trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/includes/os2.inc

    r57 r60  
    4141_keyscnlnk                  EQU 4A1Ah 
    4242_GetKey                     EQU 4972h 
     43_LCD_DRIVERON               EQU 4978h 
    4344_MemClear                   EQU 4C30h 
    4445_Rec1stByteNC               EQU 4EFDh 
    4546_RecAByteIO                 EQU 4F03h 
     47_PowerOff                   EQU 5008h 
    4648_UnlockFlash                EQU 7000h 
    4749 
  • trunk/page00/boot.asm

    r59 r60  
    66 PUBLIC LdHLInd,BCALLRoutine,CheckForBootLoader,OS2Marker,AppInit,JForceCmdNoChar,JForceCmd 
    77 EXTERN PutS,PutC,ifastcopy,CallUSBActivityHook,CheckLowBatteriesTurnOff,SaveOScreen 
    8  EXTERN RunLinkActivityHook,HandleLinkKeyActivity,ResetStacks,_LCD_DRIVERON,NZIf84PlusSeries 
     8 EXTERN RunLinkActivityHook,HandleLinkKeyActivity,ResetStacks,LCD_DRIVERON,NZIf84PlusSeries 
    99 EXTERN _APP_PUSH_ERRORH,_APP_POP_ERRORH,FindSym,PushRealO1,Mov9ToOP1,FPAdd,OP1ToOP2,LCDDelay 
    1010 EXTERN Placeholder005Fh,Placeholder0006h,Placeholder004Eh,Placeholder0003h,Placeholder0035h 
     
    1818 
    1919;0000h: 
    20 boot:  jp BootCalculator 
     20boot:  jp JumpToBootCode 
    2121;0003h: 
    2222       jp Placeholder0003h 
     
    418418       ret 
    419419 
     420JumpToBootCode: 
     421       in a,(statusPort) 
     422       and STATUS_NON_83P_MASK 
     423       ld a,1Fh 
     424       jr z,$F 
     425       ld a,3 
     426       out (0Eh),a ;not sure yet 
     427       ld a,7Fh 
     428$$:    out (memPageAPort),a 
     429       ld a,7 
     430       out (4),a 
     431       ld hl,812Ch 
     432       in a,(statusPort) 
     433       and STATUS_84P_SERIES_MASK 
     434       jr nz,$F 
     435       ld hl,80D5h 
     436$$:    jp (hl) 
     437       xor a 
    420438BootCalculator: 
    421439       di 
     
    494512       ld a,17h ;default contrast level 
    495513       ld (contrast),a 
    496        call _LCD_DRIVERON 
     514       call LCD_DRIVERON 
    497515       ld hl,0800h 
    498516       ld (winTop),hl 
     
    520538       call APP_PUSH_ERRORH 
    521539       ld (onSP),sp 
    522        call _LCD_DRIVERON 
     540       call LCD_DRIVERON 
    523541       set onRunning,(iy+onFlags) 
    524542       res indicOnly,(iy+indicFlags) 
     
    552570       ld (RAMChecksum),de 
    553571TurnCalculatorOn: 
    554        call _LCD_DRIVERON 
     572       call LCD_DRIVERON 
    555573       set onRunning,(iy+onFlags) 
    556574       res indicOnly,(iy+indicFlags) 
     
    765783       nop 
    766784       in a,(1) 
    767        and 07Fh 
     785       bit 7,a 
    768786       ld a,0FFh 
    769787       out (1),a 
     
    777795;We need to put a loader in RAM and call that, which might return and we're good, or it'll switch OSes. 
    778796;TODO: this whole thing needs to run from RAM and depend on neither OS (or both, you might say) 
     797       ld a,81h 
     798       out (memPageBPort),a 
     799       xor a 
     800       out (memPageCPort),a 
    779801       ld a,(OS2Marker) 
    780802       or a 
     
    787809       jp userMem 
    788810BootLoader: 
     811       B_CALL LCD_DRIVERON 
    789812       res indicOnly,(iy+indicFlags) 
    790813       res curAble,(iy+curFlags) 
     
    796819       ld hl,2 
    797820       ld (curRow),hl 
    798        call NZIfTIOSExists-BootLoader+userMem 
     821       call DoesSecondOSExist-BootLoader+userMem 
    799822       jp z,ReceiveTIOS-BootLoader+userMem 
    800823       ;We have the TI-OS, decide to make the switch or not 
     
    835858       jr nz,bootSelectKeyLoop 
    836859       ;We pressed CLEAR, just reset and boot whatever it is that we are 
    837        B_CALL ClrLCDFull 
     860;       B_CALL ClrLCDFull 
     861       xor a 
     862       out (memPageBPort),a 
    838863       rst 00h 
    839864contrastUp: 
     
    944969       jr nz,$B 
    945970       ;Restart. 
    946        B_CALL ClrLCDFull 
     971       ld hl,0 
     972       ld (RAMChecksum),hl 
     973;       B_CALL ClrLCDFull 
     974;       B_CALL PowerOff 
    947975       rst 00h 
    948976DeleteOS: 
     
    953981       B_CALL WriteAByte 
    954982       ;Restart. 
     983       xor a 
     984       out (memPageBPort),a 
    955985       rst 00h 
    956986ReceiveTIOS: 
     
    965995       ld hl,2 
    966996       ld (curRow),hl 
    967        call NZIfTIOSExists-BootLoader+userMem 
     997       call DoesSecondOSExist-BootLoader+userMem 
    968998       ld hl,sStartTransfer2-BootLoader+userMem 
    969999       jr nz,$F 
     
    9821012$$:    B_CALL ClrLCDFull 
    9831013       jp TurnCalculatorOn 
    984 NZIfTIOSExists: 
     1014DoesSecondOSExist: 
    9851015       in a,(memPageAPort) 
    9861016       push af 
     
    9921022       jr z,$F 
    9931023       xor a 
    994        jr NZIfTIOSExists_1 
     1024       jr DoesSecondOSExist_1 
    9951025$$:    or 1 
    996 NZIfTIOSExists_1: 
     1026DoesSecondOSExist_1: 
    9971027       pop bc 
    9981028       ld a,b 
     
    12141244       DB LlBrack,"CLEAR] to exit",0 
    12151245sStartTransfer: 
    1216        DB "TI-OS not found." 
     1246       DB "OS not found.   " 
    12171247sStartTransfer2: 
    1218        DB "Send TI-OS now  " 
    1219        DB "to enable dual  " 
    1220        DB "booting.",0 
     1248       DB "Send secondary  " 
     1249       DB "OS now to enable" 
     1250       DB "dual booting.",0 
    12211251sSwitching: 
    12221252       DB "Switching...",0 
  • trunk/page00/display.asm

    r55 r60  
    44 PUBLIC AnimateRunIndicator,DispHexA,PutS,PutC,curBlink,SaveOScreen,DispHexHL,EraseEOL,ClrLCDFull 
    55 PUBLIC _LCD_COMMAND,SetXAutoIncrementMode,SetYAutoIncrementMode,IPutSB,PutMap,ClrScrnFull,ClrTxtShd 
    6  PUBLIC saveTR,restoreTR,showCursor,CursorOff,CursorOn,hideCursor,RunIndicOn,IPutC,_LCD_DRIVERON 
     6 PUBLIC saveTR,restoreTR,showCursor,CursorOff,CursorOn,hideCursor,RunIndicOn,IPutC,LCD_DRIVERON 
    77 PUBLIC RestoreTextShadow,rstrpartialWin,savepartialWin,PutPS 
    88 EXTERN IsAtEditTail,IsAtBtm,LCDDelay,ATimes16,NZIf83Plus,_GetCharacterBitmap 
     
    5252       ret 
    5353 
    54 _LCD_DRIVERON: 
     54LCD_DRIVERON: 
    5555       ld a,40h 
    5656       call LCDDelay 
     
    193193       cp b 
    194194       jr nc,$B 
    195        ei 
     195;       ei 
    196196       nop 
    197197       pop af 
  • trunk/page00/home.asm

    r57 r60  
    5151       cp kGraph 
    5252       jr z,killOtherOS 
     53       cp kWindow 
     54       jr z,writeByte 
    5355       cp kYequ 
    5456       ret nz 
     
    9092       B_CALL EraseFlashPage 
    9193       ret 
     94writeByte: 
     95       B_CALL UnlockFlash 
     96       ld hl,(curRow) 
     97       push hl 
     98       ld hl,0 
     99       ld (curRow),hl 
     100       call GetHexA 
     101       push af 
     102       call GetHexHL 
     103       push hl 
     104       call GetHexA 
     105       ld b,a 
     106       pop de 
     107       pop af 
     108       B_CALL WriteAByte 
     109       pop hl 
     110       ld (curRow),hl 
     111       ret 
    92112 
  • trunk/page1C/silentlink.asm

    r59 r60  
    315315       ld hl,(ioData+6) 
    316316;       call DispHexHL 
    317        call EraseEOL 
     317;       call EraseEOL 
    318318       pop hl 
    319319       ld (curRow),hl 
     
    337337       push af 
    338338       push hl 
    339        call DispHexHL       ;*** TESTING 
     339;       call DispHexHL       ;*** TESTING 
    340340       ld b,a 
    341341       ld a,(appSearchPage) 
     
    473473       ld (3FFEh+8000h),hl 
    474474       ;Find the jump to the boot code and modify it to be appropriate for the model 
    475        ld de,8000h 
    476        add hl,de 
     475       ld hl,8000h 
    477476       push hl 
    478477       pop ix 
     
    546545       jr nz,$B 
    547546       ;Mark the OS as valid 
    548        xor a 
     547       ld a,70h 
    549548       ld b,5Ah 
    550        ld de,0056h 
     549       ld de,4056h 
    551550       B_CALL WriteAByte 
    552551       ld hl,0 
     
    558557       out (7),a 
    559558;       call DispHexHL 
    560        ld a,'Y' 
     559;       ld a,'Y' 
    561560;       call PutC 
    562561       res indicOnly,(iy+indicFlags) 
     
    571570       call APP_POP_ERRORH 
    572571       ;Seems like the most sensible thing to do after receiving the TI-OS is just shut off 
    573        call PowerOff 
    574572receiveTIOSHandler: 
    575573       jr keyscnlnkEnd 
  • trunk/page1D/1Dbase.asm

    r55 r60  
    55 EXTERN JErrorNo,UnlockFlash,GetKey,keyscnlnk,Rec1stByteNC,RecAByteIO,MemClear,ClrTxtShd 
    66 EXTERN ClrLCDFull,PutS,GetCSC,CursorOff,CursorOn,hideCursor,showCursor,ClrScrnFull,KeyToString 
    7  EXTERN JForceCmdNoChar,JForceCmd 
     7 EXTERN JForceCmdNoChar,JForceCmd,PowerOff,LCD_DRIVERON 
    88 
    99;4000h: 
     
    24342434       DW 0000h 
    24352435       DB 00h 
    2436 ;_LCD_DRIVERON          equ 4978h  
    2437        DW 0000h 
     2436_LCD_DRIVERON: 
     2437       DW LCD_DRIVERON 
    24382438       DB 00h 
    24392439;_DFMIN2                        equ 497Bh 
     
    41144114       DW 0000h 
    41154115       DB 00h 
    4116 ;_PowerOff              equ 5008h 
    4117        DW 0000h 
     4116_PowerOff: 
     4117       DW PowerOff 
    41184118       DB 00h 
    41194119;_GetKeyRetOff          equ 500Bh ;same as getkey, only returns kOff if 2nd+on is pressed