Changeset 35
- Timestamp:
- 08/05/09 02:59:44 (3 years ago)
- Location:
- trunk
- Files:
-
- 5 modified
-
page00/boot.asm (modified) (5 diffs)
-
page00/display.asm (modified) (2 diffs)
-
page00/util.asm (modified) (1 diff)
-
page1C/linkprotocol.asm (modified) (1 diff)
-
page1C/silentlink.asm (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/page00/boot.asm
r34 r35 473 473 call ReadKeypad 474 474 cp skGraphvar 475 jrz,StartBootLoader475 call z,StartBootLoader 476 476 $$: set indicRun,(iy+indicFlags) 477 477 ld hl,1 … … 512 512 513 513 StartBootLoader: 514 ;TODO: this whole thing eventually needs to run from sector 70h or wherever I back myself up to 514 ;This is called in two places: during OS2 boot (we're on page 0) 515 ; while on page 70h and we're temporarily swapped in 516 ;We need to put a loader in RAM and call that, which might return and we're good, or it'll switch OSes. 517 ;TODO: this whole thing needs to run from RAM and depend on neither OS 518 ld hl,BootLoader 519 ld de,userMem 520 ld bc,BootLoaderEnd-BootLoader 521 ldir 522 jp userMem 523 BootLoader: 515 524 res indicOnly,(iy+indicFlags) 516 525 res curAble,(iy+curFlags) … … 552 561 jr BootLoaderKeyLoop 553 562 $$: call ClrLCDFull 554 j rTurnCalculatorOn563 jp TurnCalculatorOn 555 564 SwitchOS: 565 B_CALL UnlockFlash 566 ;NOTE: this loader of the loader needs to execute as if it were either from here or page 70h. 567 ;TODO: Uh...not yet! 556 568 ;Copy a loader to RAM which does the following: 557 569 ; Back up sector 0 to the extra RAM pages … … 566 578 ; Copy from the extra RAM pages to pages 68h-6Bh 567 579 ;Restart. 568 ;NOTE: this loader of the loader needs to execute as if it were either from here or page 70h. 569 ;TODO: Uh...not yet! 570 call ClrLCDFull 571 jr TurnCalculatorOn 580 rst 00h 572 581 NZIfTIOSExists: 573 582 in a,(memPageAPort) … … 601 610 DB "enable dual " 602 611 DB "booting.",0 612 BootLoaderEnd: 603 613 -
trunk/page00/display.asm
r29 r35 3 3 4 4 PUBLIC AnimateRunIndicator,DispHexA,PutS,PutC,curBlink,SaveOScreen,DispHexHL,EraseEOL,ClrLCDFull 5 PUBLIC _LCD_COMMAND,SetXAutoIncrementMode,SetYAutoIncrementMode 5 PUBLIC _LCD_COMMAND,SetXAutoIncrementMode,SetYAutoIncrementMode,IPutSB 6 6 EXTERN IsAtEditTail,IsAtBtm,LCDDelay 7 7 … … 11 11 call LCDDelay 12 12 out (LCDinstPort),a 13 ret 14 15 IPutSB: 16 push bc 17 ld a,(hl) 18 inc hl 19 call PutC 20 pop bc 21 djnz IPutSB 13 22 ret 14 23 -
trunk/page00/util.asm
r34 r35 7 7 PUBLIC CopyRAMToFlashPage 8 8 PUBLIC BCALL,BJUMP,JErrorNo,SetupPagedPtr,PagedGet,EraseRAMPage 9 EXTERN Page0Call,UpdateAPD,PowerOff,GetCSC 9 EXTERN Page0Call,UpdateAPD,PowerOff,GetCSC,PutC 10 10 11 11 include "includes\os2.inc" -
trunk/page1C/linkprotocol.asm
r34 r35 6 6 7 7 PUBLIC SendCommandA,ReceiveHeaderPacket,SendSkipExitPacket,SendCAndAddToChecksum,SendContinue,ReceiveDataPacket 8 PUBLIC receiveRestOfDataPacket 8 PUBLIC receiveRestOfDataPacket,SendHCommand 9 9 EXTERN SetupPagedPtr,EnableLinkAssist,Send4Bytes,PagedGet,SendAByte,Get4BytesNC,JErrorNo 10 10 EXTERN SendCByte,RecAByteIO,SaveFlashBytes,SendAcknowledge -
trunk/page1C/silentlink.asm
r34 r35 10 10 EXTERN Send4Bytes,SendCAndAddToChecksum,LCDDelay,_LCD_COMMAND,SendAByte,SetXAutoIncrementMode,EraseRAMPage 11 11 EXTERN SetYAutoIncrementMode,SendContinue,ReceiveDataPacket,DispHexHL,PutC,receiveRestOfDataPacket 12 EXTERN CopyToRAMPage,CopyRAMToFlashPage,EraseEOL,PowerOff 12 EXTERN CopyToRAMPage,CopyRAMToFlashPage,EraseEOL,PowerOff,SendHCommand,IPutSB 13 13 14 14 keyscnlnk: … … 51 51 ;This is a command we don't recognize 52 52 ;TODO: for now, freak out 53 ld a,5 54 call PutC 53 55 ld a,(header+1) 54 56 call DispHexA … … 94 96 DB 06h 95 97 DW receivedVariableHeader 98 DB 0A2h 99 DW receivedRequestToSend 96 100 DB 87h 97 101 DW remoteControlPacket … … 101 105 DW keyscnlnkEnd 102 106 cmdTableEnd: 107 108 receivedRequestToSend: 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 123 sendDirectoryContentsResponse: 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 103 133 104 134 screenshotPacket: … … 163 193 jr z,receivingOS 164 194 ;Not accepting anything else for now 195 call DispHexA 165 196 ld de,1 166 197 ld a,0Ch … … 170 201 bit receiveTIOS,(iy+linkFlags2) 171 202 jr z,ReceiveNewOS 203 B_CALL UnlockFlash 172 204 ;Wipe the extra RAM pages 173 205 ld a,84h … … 246 278 push af 247 279 push hl 280 call DispHexHL ;*** TESTING 248 281 ld b,a 249 282 ld a,(appSearchPage) … … 300 333 jr dataWritten 301 334 $$: ;Is this page 7Ch or 7Dh? If so, change it to 6Ah or 6Bh 302 push af303 ld a,6304 call PutC305 pop af306 335 cp 7Ch 307 336 ld b,6Ah … … 316 345 ld b,3Bh 317 346 jr z,translatePage 347 cp 3Ah 348 jr z,checkAddress 349 cp 7Ah 350 jr z,checkAddress 318 351 $$: ;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 320 362 ld hl,appData 321 363 B_CALL WriteFlash … … 324 366 ld a,b 325 367 jr $B 368 checkAddress: 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 326 377 dataWritten: 327 378 call Get4BytesNC … … 332 383 jr ReceiveOSPage 333 384 $$: 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 336 396 call APP_POP_ERRORH 337 397 ;Seems like the most sensible thing to do after receiving the TI-OS is just shut off … … 358 418 call SendAcknowledge 359 419 ld hl,ioData 360 ld (hl), OS2_VERSION_MAJOR361 inc hl 362 ld (hl), OS2_VERSION_MINOR420 ld (hl),2 ;OS2_VERSION_MAJOR 421 inc hl 422 ld (hl),22h ;OS2_VERSION_MINOR 363 423 inc hl 364 424 B_CALL GetBootVer
