Changeset 35 for trunk/page1C/silentlink.asm
- Timestamp:
- 08/05/09 02:59:44 (3 years ago)
- Files:
-
- 1 modified
-
trunk/page1C/silentlink.asm (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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
