Changeset 36

Show
Ignore:
Timestamp:
08/13/09 22:14:33 (2 years ago)
Author:
brandonlw
Message:

More attempts to get dual booting working...

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/includes/os2.inc

    r34 r36  
    2626; OS2 Entry Points 
    2727;====================================================================== 
     28_GetCSC                     EQU 4018h 
     29_PutS                       EQU 450Ah 
     30_ClrLCDFull                 EQU 4540h 
    2831_keyscnlnk                  EQU 4A1Ah 
    2932_GetKey                     EQU 4972h 
  • trunk/page00/boot.asm

    r35 r36  
    493493       set apdAble,(iy+apdFlags) 
    494494       set apdRunning,(iy+apdFlags) 
     495       ld hl,0 
     496       ld (curRow),hl 
     497       ld a,70h 
     498       out (6),a 
     499       ld hl,(4000h) 
     500       call DispHexHL 
    495501$$:    ld hl,6 
    496502       ld (curRow),hl 
     
    524530       res indicOnly,(iy+indicFlags) 
    525531       res curAble,(iy+curFlags) 
    526        call ClrLCDFull 
     532       B_CALL ClrLCDFull 
    527533       ld hl,0 
    528534       ld (curRow),hl 
    529        ld hl,sBoot 
    530        call PutS 
     535       ld hl,sBoot-BootLoader+userMem 
     536       B_CALL PutS 
    531537       ld hl,2 
    532538       ld (curRow),hl 
    533        call NZIfTIOSExists 
    534        jr nz,$F 
    535        ld hl,sStartTransfer 
    536        call PutS 
    537        jr ContinueBootLoader 
    538 $$:    ld hl,sCurrently 
    539        call PutS 
    540        call IsOS2Running 
    541        ld hl,sOS2 
    542        jr z,$F 
    543        ld hl,sTIOS 
    544 $$:    call PutS 
     539       call NZIfTIOSExists-BootLoader+userMem 
     540       jp z,ReceiveTIOS-BootLoader+userMem 
     541       ;We have the TI-OS, decide to make the switch or not 
     542$$:    ld hl,sCurrently-BootLoader+userMem 
     543       B_CALL PutS 
     544       call IsOS2Running-BootLoader+userMem 
     545       ld hl,sOS2-BootLoader+userMem 
     546       jr z,$F 
     547       ld hl,sTIOS-BootLoader+userMem 
     548$$:    B_CALL PutS 
    545549       ld hl,6 
    546550       ld (curRow),hl 
    547        ld hl,sInstructions 
    548        call PutS 
    549 ContinueBootLoader: 
     551       ld hl,sInstructions-BootLoader+userMem 
     552       B_CALL PutS 
    550553       ld hl,7 
    551554       ld (curRow),hl 
    552        ld hl,sClearToCancel 
    553        call PutS 
    554        set receiveTIOS,(iy+linkFlags2)    ;receive the TI-OS to the extra pages instead of just jumping to the boot code 
    555 BootLoaderKeyLoop: 
    556        B_CALL GetKey 
    557        cp skClear 
    558        jr z,$F 
     555       ld hl,sClearToCancel-BootLoader+userMem 
     556       B_CALL PutS 
     557bootSelectKeyLoop: 
     558       ei 
     559       B_CALL GetCSC 
    559560       cp skYEqu 
    560561       jr z,SwitchOS 
    561        jr BootLoaderKeyLoop 
    562 $$:    call ClrLCDFull 
    563        jp TurnCalculatorOn 
     562       cp skClear 
     563       jr nz,bootSelectKeyLoop 
     564       ;We pressed CLEAR, just reset and boot whatever it is that we are 
     565       B_CALL ClrLCDFull 
     566       rst 00h 
    564567SwitchOS: 
    565568       B_CALL UnlockFlash 
     
    578581       ;      Copy from the extra RAM pages to pages 68h-6Bh 
    579582       ;Restart. 
     583       B_CALL ClrLCDFull 
    580584       rst 00h 
     585ReceiveTIOS: 
     586;We don't have a copy of the TI-OS, receive one 
     587       ld hl,sStartTransfer-BootLoader+userMem 
     588       B_CALL PutS 
     589       ld hl,7 
     590       ld (curRow),hl 
     591       ld hl,sClearToCancel-BootLoader+userMem 
     592       B_CALL PutS 
     593       set receiveTIOS,(iy+linkFlags2)    ;receive the TI-OS to the extra pages instead of just jumping to the boot code 
     594BootLoaderKeyLoop: 
     595       B_CALL GetKey 
     596       cp skClear 
     597       jr z,$F 
     598       jr BootLoaderKeyLoop 
     599$$:    B_CALL ClrLCDFull 
     600       jp TurnCalculatorOn 
    581601NZIfTIOSExists: 
    582602       in a,(memPageAPort) 
  • trunk/page1C/silentlink.asm

    r35 r36  
    383383       jr ReceiveOSPage 
    384384$$:    call SendAcknowledge 
     385       ;Couldn't hurt to try to send another acknowledge, because TI Connect sucks 
     386       ld hl,tryAckAgainHandler 
     387       call APP_PUSH_ERRORH 
     388       call SendAcknowledge 
     389       call APP_POP_ERRORH 
     390tryAckAgainHandler: 
    385391;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 
     392;TODO: Put the [X,T,theta,N] boot loader in page 0 (currently in the extra RAM pages) 
    387393       ;This loader needs to read the keypad for skGraphvar, and if it's being pressed, call: 
    388        ;      in a,(6) 
    389        ;      push af 
    390394       ;      ld a,70h 
    391395       ;      out (6),a 
    392        ;      call StartBootLoader+4000h 
    393        ;      pop af 
    394        ;      out (6),a 
    395        ;      ret 
     396       ;      jp StartBootLoader+4000h 
     397       ;Copy the extra RAM pages to sector 70h 
     398       ld a,04h 
     399       ld b,70h 
     400       ld c,4 
     401$$:    push af 
     402       push bc 
     403       call CopyRAMToFlashPage 
     404       pop bc 
     405       pop af 
     406       inc a 
     407       inc b 
     408       dec c 
     409       jr nz,$B 
     410       ld a,'D' 
     411       call PutC 
    396412       call APP_POP_ERRORH 
    397413       ;Seems like the most sensible thing to do after receiving the TI-OS is just shut off 
  • trunk/page1D/1Dbase.asm

    r28 r36  
    44 PUBLIC _JErrorNo,_UnlockFlash,_GetKey 
    55 EXTERN JErrorNo,UnlockFlash,GetKey,keyscnlnk,Rec1stByteNC,RecAByteIO 
     6 EXTERN ClrLCDFull,PutS,GetCSC 
    67 
    78;4000h: 
     
    3132       DB 00h 
    3233;_GetCSC                        equ 4018h ;key board scan codes 
    33        DW 0000h 
     34_GetCSC: 
     35       DW GetCSC 
    3436       DB 00h 
    3537;_coorMon               equ 401Bh ; 
     
    12971299       DB 00h 
    12981300;_PutS                  equ 450Ah 
    1299        DW 0000h 
     1301_PutS: 
     1302       DW PutS 
    13001303       DB 00h 
    13011304;_putpsb                        equ 450Dh 
     
    13501353       DW 0000h 
    13511354       DB 00h 
    1352 ;_ClrLCDFull            equ 4540h 
    1353        DW 0000h 
     1355_ClrLCDFull: 
     1356       DW ClrLCDFull 
    13541357       DB 00h 
    13551358;_ClrLCD                        equ 4543h