Changeset 48
- Timestamp:
- 10/10/09 22:20:11 (2 years ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
includes/os2.inc (modified) (1 diff)
-
page00/boot.asm (modified) (10 diffs)
-
page00/home.asm (modified) (1 diff)
-
page00/menu.asm (modified) (1 diff)
-
page01/01base.asm (modified) (2 diffs)
-
page1C/silentlink.asm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/os2.inc
r47 r48 110 110 onSP EQU 85BCh 111 111 RAMChecksum EQU 85BEh 112 ; 113 menuCurrent EQU 85DEh 112 114 ; 113 115 ioFlag EQU 8670h -
trunk/page00/boot.asm
r47 r48 4 4 include "includes\os2.inc" 5 5 6 PUBLIC LdHLInd,BCALLRoutine,CheckForBootLoader,OS2Marker 6 PUBLIC LdHLInd,BCALLRoutine,CheckForBootLoader,OS2Marker,AppInit 7 7 EXTERN PutS,PutC,ifastcopy,CallUSBActivityHook,CheckLowBatteriesTurnOff,SaveOScreen 8 EXTERN RunLinkActivityHook,HandleLinkKeyActivity 8 EXTERN RunLinkActivityHook,HandleLinkKeyActivity,ResetStacks 9 9 EXTERN _APP_PUSH_ERRORH,_APP_POP_ERRORH,FindSym,PushRealO1,Mov9ToOP1,FPAdd,OP1ToOP2,LCDDelay 10 10 EXTERN Placeholder005Fh,Placeholder0006h,Placeholder004Eh,Placeholder0003h,Placeholder0035h 11 11 EXTERN outputPage,NZIf83Plus,_ZERO_PORT_3,_OUT_PORT_3,AnimateRunIndicator,PowerOff 12 EXTERN DispHexA,DispHexHL,IPutC,ReadKeyboardKey,ReadKeypad,ClrLCDFull 12 EXTERN DispHexA,DispHexHL,IPutC,ReadKeyboardKey,ReadKeypad,ClrLCDFull,InitHomescreenContext 13 13 EXTERN curBlink,resetAPDTimer,UpdateAPD,BCALL,BJUMP,CopyRAMToFlashPage,cphlde,CalculateOSChecksum 14 14 EXTERN _HandleDefaultUSBInterrupt,_ReadUSBInterruptData,_HandleUSBInterruptInitialize,CopyToRAMPage … … 374 374 pop hl 375 375 call _ZERO_PORT_3 376 ld a, iNormal376 ld a,11h 377 377 jr interruptDirectReturnA 378 378 handleKeyOn: … … 397 397 and 4Fh 398 398 cp 41h 399 dol2: jr nz, TurnCalculatorOn399 dol2: jr nz,RAMUnhookedTurnCalculatorOn 400 400 bit shift2nd,(iy+shiftFlags) 401 401 jr z,_2ndNotPressedWithOn … … 438 438 ld sp,0FFC5h 439 439 ld iy,flags 440 B_CALL ClrScrnFull441 440 ;Do any other initialization 441 call SetContrast 442 442 ;Appear "off" 443 443 xor a … … 451 451 ei 452 452 halt 453 TurnCalculatorOn:453 RAMUnhookedTurnCalculatorOn: 454 454 ;Set everything back up 455 455 ld a,STATE_MODE0_DEFAULT … … 467 467 out (0Fh),a 468 468 $$: call _ZERO_PORT_3 469 ld a,lcdTurnOn470 out (LCDinstPort),a471 469 call SetContrast 472 470 ld a,INTERRUPT_MASK_POWER+INTERRUPT_MASK_HW1+INTERRUPT_MASK_ON 473 471 out (interruptEnPort),a 474 set onRunning,(iy+onFlags)475 472 res receiveTIOS,(iy+linkFlags2) 476 473 ;Start the OS, minimal as it is 474 ld hl,(RAMChecksum) 475 ld de,0A55Ah 476 call cphlde 477 jr z,$F 477 478 call CalculateOSChecksum 478 479 ld de,(RAMChecksum) … … 481 482 ;The RAM checksum check has failed, so wipe out RAM and hope for the best 482 483 ;TODO: figure out what this actually needs to do 483 ; ld hl,appData 484 ; ld de,appData+1 485 ; ld bc,7FFFh 486 ; ld (hl),0 487 ; ldir 488 ; jp 0000h 484 ld hl,appData 485 ld de,appData+1 486 ld bc,7FFFh 487 ld (hl),0 488 ldir 489 489 $$: ;Screw up the RAM checksum so it's no longer valid 490 490 dec de 491 491 ld (RAMChecksum),de 492 call ClrLCDFull 492 TurnCalculatorOn: 493 ld a,lcdTurnOn 494 out (LCDinstPort),a 495 set onRunning,(iy+onFlags) 493 496 res indicOnly,(iy+indicFlags) 494 497 in a,(statusPort) … … 502 505 set apdAble,(iy+apdFlags) 503 506 set apdRunning,(iy+apdFlags) 504 ld hl,8000h505 ld (editTop),hl506 inc hl507 ld (editCursor),hl508 inc hl509 ld (editTail),hl510 inc hl511 ld (editBtm),hl512 ld a,' '513 ld (curUnder),a514 ld hl,0515 ld (curRow),hl516 507 ld sp,0FFF7h 517 508 ld hl,0109h ;English 518 509 ld (localLanguage),hl 519 ld hl,homescreenContextVectors 520 call AppInit 521 B_CALL ClrLCDFull 510 ld a,appStart 511 call _newContext0 522 512 ld hl,_monErrorHandler 523 513 call APP_PUSH_ERRORH 524 514 ld (onSP),sp 515 call ResetStacks 516 xor a 517 ld (menuCurrent),a 518 set appTextSave,(iy+appFlags) 525 519 RestartMon: 526 520 _Mon: xor a … … 581 575 ret 582 576 differentContext: 577 ld b,a 578 in a,(memPageAPort) 579 push af 580 ld a,b 581 583 582 push bc 584 push af 585 sub appStart 586 call GetContextStartRoutine 587 pop af 588 push hl 589 push af 590 res curLock,(iy+curFlags) 591 call CallcxPPutAwayRoutine 592 pop af 593 push af 594 call CallcxPutAwayRoutine 595 call IsExternalApp 596 call z,SetFastSpeed 597 ld a,(cxCurApp) 598 pop bc 599 push af 600 push bc 601 ld hl,cxMain 602 ld de,cxPrev 603 ld bc,14 604 ldir 605 ld a,(flags+appFlags) 606 ld (de),a 607 pop af 608 push af 609 pop af 610 pop bc 611 pop hl 612 ld (cxCurApp),a 613 pop af 614 CallContextStartRoutine: 583 push af 584 sub appStart 585 call GetContextStartRoutine 586 out (memPageAPort),a 587 pop af 588 push hl 589 push af 590 res curLock,(iy+curFlags) 591 ; call CallcxPPutAwayRoutine 592 pop af 593 push af 594 ; call CallcxPutAwayRoutine 595 call IsExternalApp 596 call z,SetFastSpeed 597 ld a,(cxCurApp) 598 pop bc 599 push af 600 push bc 601 ld hl,cxMain 602 ld de,cxPrev 603 ld bc,14 604 ldir 605 ld a,(flags+appFlags) 606 ld (de),a 607 pop af 608 push af 609 pop af 610 pop bc 611 pop hl 612 ld (cxCurApp),a 613 pop af 614 ;Call context start routine 615 615 push af 616 616 call jumpToHL 617 617 pop bc 618 619 pop af 620 out (memPageAPort),a 618 621 ret 619 622 AppInit: … … 663 666 add hl,de 664 667 add hl,de 665 jr LdHLInd 668 add hl,de 669 ld e,(hl) 670 inc hl 671 ld d,(hl) 672 inc hl 673 ld a,(hl) 674 ex de,hl 675 ret 666 676 contextStartTable: 667 DW 0000h 677 DW InitHomescreenContext 678 DB 00h 668 679 669 680 CheckForBootLoader: -
trunk/page00/home.asm
r47 r48 4 4 include "includes\os2.inc" 5 5 6 PUBLIC homescreenContextVectors 7 EXTERN DispHexA,DispHexHL,GetHexA,GetHexHL 6 PUBLIC homescreenContextVectors,InitHomescreenContext 7 EXTERN DispHexA,DispHexHL,GetHexA,GetHexHL,AppInit 8 9 InitHomescreenContext: 10 ld hl,8000h 11 ld (editTop),hl 12 inc hl 13 ld (editCursor),hl 14 inc hl 15 ld (editTail),hl 16 inc hl 17 ld (editBtm),hl 18 ld a,' ' 19 ld (curUnder),a 20 ld hl,0 21 ld (curRow),hl 22 ld hl,homescreenContextVectors 23 call AppInit 24 B_CALL ClrLCDFull 25 ret 8 26 9 27 homescreenContextVectors: -
trunk/page00/menu.asm
r47 r48 9 9 ;Key code is in A. Check to see if it's a menu key and back out if not, otherwise handle it. 10 10 ;Return carry flag set if you want the system monitor to restart, otherwise the current cxMain handler will get called for this key. 11 or a 12 ret 11 13 -
trunk/page01/01base.asm
r47 r48 36 36 set apdRunning,(iy+apdFlags) 37 37 restartKeyLoop: 38 set enableHW2Timer,(iy+interruptFlags) 38 39 bit onInterrupt,(iy+onFlags) 39 40 res onInterrupt,(iy+onFlags) … … 45 46 or a 46 47 jr nz,scanCodeFound 47 call HandleLinkKeyActivity 48 $$: call HandleLinkKeyActivity 49 bit hw2TimerSkipped,(iy+linkKeyFlags) 50 jr nz,$B 48 51 in a,(2) 49 52 and 80h -
trunk/page1C/silentlink.asm
r47 r48 42 42 bit 5,(iy+3Dh) 43 43 jr nz,keyscnlnkEnd 44 ;HACK: until I figure out where the extra zero's coming from...45 44 call Get3Bytes 46 45 HandleLinkPacket: … … 74 73 keyscnlnkHandler: 75 74 di 76 call DisableLinkAssist75 ; call DisableLinkAssist 77 76 pop af 78 77 bit 2,a … … 101 100 DB 06h 102 101 DW receivedVariableHeader 102 DB 0C9h 103 DW receivedVariableRequest 103 104 DB 0A2h 104 105 DW receivedRequestToSend … … 112 113 DW keyscnlnkEnd 113 114 cmdTableEnd: 115 116 receivedVariableRequest: 117 ld hl,ioData 118 ld (iMathPtr5),hl 119 call receiveRestOfDataPacket 120 ld de,1 121 ld a,0Ch 122 call SendSkipExitPacket 123 jr keyscnlnkEnd 114 124 115 125 memoryDumpPacket:
