Changeset 29

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

Add the screenshot packet response so we can start taking screenshots, and add some more to the proposed boot loader

Location:
trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/includes/os2.inc

    r28 r29  
    7070; 
    7171curUnder                    EQU    844Eh 
     72; 
     73curXRow                     EQU    8451h 
    7274; 
    7375indicCounter                EQU    8476h 
  • trunk/page00/boot.asm

    r28 r29  
    103103       DB 23h,0Fh ;penCol coordinates for displaying OS version 
    104104;0064h: 
    105        DB "0.01 ",0 
     105       DB "0.01" 
     106OS2Marker: 
     107       DB 0   ;I have this set as 0, any other TI-OS version will have it set as a space 
     108       DB 0   ;This is a crude check, and hopefully temporary. 
    106109Placeholder0006h_1: 
    107110       jp Placeholder0006h 
     
    464467       call ClrLCDFull 
    465468       res indicOnly,(iy+indicFlags) 
     469       in a,(statusPort) 
     470       and STATUS_NON_83P_MASK 
     471       jr z,$F                     ;no dual booting for you! 
    466472       call ReadKeypad 
    467473       cp skGraphvar 
    468474       jr z,StartBootLoader 
    469        ld hl,0 
     475$$:    ld hl,0 
    470476       ld (appBackUpScreen+50),hl 
    471477       ld (appBackUpScreen+52),hl 
     
    536542 
    537543StartBootLoader: 
     544       res indicOnly,(iy+indicFlags) 
     545       res curAble,(iy+curFlags) 
     546       call ClrLCDFull 
    538547       ld hl,0 
    539548       ld (curRow),hl 
    540549       ld hl,sBoot 
     550       call PutS 
     551       ld hl,2 
     552       ld (curRow),hl 
     553       call NZIfTIOSExists 
     554       jr nz,$F 
     555       ld hl,sStartTransfer 
     556       call PutS 
     557       jr ContinueBootLoader 
     558$$:    ld hl,sCurrently 
     559       call PutS 
     560       call IsOS2Running 
     561       ld hl,sOS2 
     562       jr z,$F 
     563       ld hl,sTIOS 
     564$$:    call PutS 
     565       ld hl,6 
     566       ld (curRow),hl 
     567       ld hl,sInstructions 
     568       call PutS 
     569ContinueBootLoader: 
     570       ld hl,7 
     571       ld (curRow),hl 
     572       ld hl,sClearToCancel 
    541573       call PutS 
    542574BootLoaderKeyLoop: 
    543575       B_CALL GetKey 
     576       cp skClear 
     577       jr z,$F 
    544578       cp skYEqu 
    545        jr z,$F 
     579       jr z,SwitchOS 
    546580       jr BootLoaderKeyLoop 
    547581$$:    call ClrLCDFull 
    548582       jr TurnCalculatorOn 
     583SwitchOS: 
     584       call IsOS2Running 
     585       jr z,SwitchToTIOS 
     586;Switch back to OS2 
     587       call ClrLCDFull 
     588       jr TurnCalculatorOn 
     589NZIfTIOSExists: 
     590       in a,(memPageAPort) 
     591       push af 
     592       ld a,70h 
     593       out (memPageAPort),a 
     594       ld hl,(4000h) 
     595       ld a,h 
     596       or l 
     597       pop bc 
     598       ld a,b 
     599       out (memPageAPort),a 
     600       ret 
     601IsOS2Running: 
     602       ld a,(OS2Marker) 
     603       or a 
     604       ret 
    549605sBoot: DB "Select Boot OS",0CEh,0 
     606sCurrently: 
     607       DB "Currently: ",0 
     608sTIOS: DB "TI-OS",0 
     609sOS2:  DB "OS2",0 
     610sInstructions: 
     611       DB LlBrack,"Y=] to switch",0CEh,0 
     612sClearToCancel: 
     613       DB LlBrack,"CLEAR] to exit",0CEh,0 
     614sStartTransfer: 
     615       DB "TI-OS not found." 
     616       DB "Send via PC or  " 
     617       DB "other calculator" 
     618       DB "to enable dual  " 
     619       DB "booting.",0 
     620SwitchToTIOS: 
     621       ;TODO: Uh...not yet! 
     622       call ClrLCDFull 
     623       jr TurnCalculatorOn 
    550624 
  • trunk/page00/display.asm

    r28 r29  
    33 
    44 PUBLIC AnimateRunIndicator,DispHexA,PutS,PutC,curBlink,SaveOScreen,DispHexHL,EraseEOL,ClrLCDFull 
     5 PUBLIC _LCD_COMMAND,SetXAutoIncrementMode,SetYAutoIncrementMode 
    56 EXTERN IsAtEditTail,IsAtBtm,LCDDelay 
    67 
    78 include "includes\os2.inc" 
     9 
     10_LCD_COMMAND: 
     11       call LCDDelay 
     12       out (LCDinstPort),a 
     13       ret 
    814 
    915ClrLCDFull: 
     
    1723       ld b,128 
    1824       ld a,0B8h 
    19        jr $F 
    2025       di 
    2126$$:    push bc 
  • trunk/page00/util.asm

    r18 r29  
    1414FPAdd: 
    1515OP1ToOP2: 
    16 LCDDelay: 
    1716FindSym: 
    1817Placeholder0003h: 
     
    2120Placeholder004Eh: 
    2221Placeholder005Fh: 
     22       ret 
     23 
     24LCDDelay: 
     25       push af 
     26$$:    in a,(2) 
     27       and 2 
     28       jr z,$B 
     29       pop af 
    2330       ret 
    2431 
  • trunk/page1C/linkprotocol.asm

    r24 r29  
    55 include "includes\internal.inc" 
    66 
    7  PUBLIC SendCommandA,ReceiveHeaderPacket,SendSkipExitPacket 
     7 PUBLIC SendCommandA,ReceiveHeaderPacket,SendSkipExitPacket,SendCAndAddToChecksum 
    88 EXTERN SetupPagedPtr,EnableLinkAssist,Send4Bytes,PagedGet,SendAByte,Get4BytesNC,JErrorNo 
    99 EXTERN SendCByte,RecAByteIO,SaveFlashBytes,SendAcknowledge 
  • trunk/page1C/silentlink.asm

    r26 r29  
    88 EXTERN JErrorNo,NZIf83Plus,CheckLinkLines,EnableLinkAssist,DisableLinkAssist,ContinueGetByte,Get3Bytes 
    99 EXTERN DispHexA,LdHLInd,SendAcknowledge,ReceiveHeaderPacket,SendSkipExitPacket,Get4BytesNC,SendCommandA 
     10 EXTERN Send4Bytes,SendCAndAddToChecksum,LCDDelay,_LCD_COMMAND,SendAByte,SetXAutoIncrementMode 
     11 EXTERN SetYAutoIncrementMode 
    1012 
    1113keyscnlnk: 
     
    9395       DB 87h 
    9496       DW remoteControlPacket 
     97       DB 6Dh 
     98       DW screenshotPacket 
    9599cmdTableEnd: 
     100 
     101screenshotPacket: 
     102       call SendScreenshotResponse 
     103       jr keyscnlnkEnd 
     104SendScreenshotResponse: 
     105       call SendAcknowledge 
     106       ld de,768 
     107       ld (header+2),de 
     108       ld hl,1573h 
     109       ld (header),hl 
     110       call Send4Bytes 
     111       di 
     112       call SetYAutoIncrementMode 
     113       ld a,7Fh 
     114       ld b,40h 
     115SendScreenshotResponseLoop: 
     116       push bc 
     117       inc a 
     118       ld (curXRow),a 
     119       call SetYAutoIncrementMode 
     120       call _LCD_COMMAND 
     121       ld a,20h 
     122       call _LCD_COMMAND 
     123       call LCDDelay 
     124       in a,(LCDdataPort) 
     125       ld b,12 
     126$$:    push bc 
     127       call LCDDelay 
     128       in a,(LCDdataPort) 
     129       ld c,a 
     130       call SendCAndAddToChecksum 
     131       pop bc 
     132       djnz $B 
     133       pop bc 
     134       ld a,(curXRow) 
     135       djnz SendScreenshotResponseLoop 
     136       call SetXAutoIncrementMode 
     137       ei 
     138SendChecksumAcknowledge: 
     139       ld hl,(header+4) 
     140       ld a,l 
     141       push hl 
     142       call SendAByte 
     143       pop af 
     144       call SendAByte 
     145ReceiveAcknowledgement: 
     146       call Get4BytesNC 
     147       ld a,(header+1) 
     148       cp 56h 
     149       ret z 
     150       jp JErrorNo 
    96151 
    97152remoteControlPacket: