Changeset 47

Show
Ignore:
Timestamp:
10/10/09 03:20:47 (3 years ago)
Author:
brandonlw
Message:

I'm reaching a point where I really need to be adding oncalc debugging tools, so I guess I'll start working on the system monitor and a basic menu system, rebuilding the APPS and PRGM menus to start with.
From there I can get a Calcsys-style hex editor in there and oncalc usb8x/USBTools-style logging.
Heck, maybe I can even transfer Calcsys TO it and execute at least part of it.
It's a lot of work and kind of off-track, but it's the only way I'm going to diagnose the dual booting and linking problems.

Location:
trunk
Files:
1 added
12 modified

Legend:

Unmodified
Added
Removed
  • trunk/OS2.zws

    r42 r47  
    4444SOURCE = page00\util.asm 
    4545SOURCE = page00\home.asm 
     46SOURCE = page00\menu.asm 
    4647SOURCE = page00\jumptable.asm 
    4748SOURCE = page01\01base.asm 
  • trunk/extras/dumpmem.z80

    r46 r47  
    3333        pop bc 
    3434        pop de 
     35        jr nc,noErrorDetected 
     36        ld a,(myPage) 
     37        push de 
     38        push bc 
     39        push hl 
     40        call GetSmallDump 
     41        pop hl 
     42        pop bc 
     43        pop de 
    3544        jr c,errorDetected 
     45noErrorDetected: 
    3646        add hl,bc 
    3747        ex de,hl 
     
    8797        bcall(_RecAByteIO) 
    8898        bcall(_SendAck) 
     99        call APP_POP_ERRORH 
    89100        xor a 
    90101        jr getDumpDone 
  • trunk/includes/os2.inc

    r42 r47  
    3030_PutS                       EQU 450Ah 
    3131_ClrLCDFull                 EQU 4540h 
     32_ClrScrnFull                EQU 4546h 
     33_ClrTxtShd                  EQU 454Ch 
    3234_CursorOff                  EQU 45BEh 
    3335_hideCursor                 EQU 45C1h 
     
    9395iMathPtr4                   EQU    84D9h 
    9496iMathPtr5                   EQU    84DBh 
     97; 
     98textShadow                  EQU    8508h 
    9599; 
    96100cxMain                      EQU    858Dh 
  • trunk/page00/boot.asm

    r44 r47  
    1111 EXTERN outputPage,NZIf83Plus,_ZERO_PORT_3,_OUT_PORT_3,AnimateRunIndicator,PowerOff 
    1212 EXTERN DispHexA,DispHexHL,IPutC,ReadKeyboardKey,ReadKeypad,ClrLCDFull 
    13  EXTERN curBlink,resetAPDTimer,UpdateAPD,BCALL,BJUMP,CopyRAMToFlashPage 
     13 EXTERN curBlink,resetAPDTimer,UpdateAPD,BCALL,BJUMP,CopyRAMToFlashPage,cphlde,CalculateOSChecksum 
    1414 EXTERN _HandleDefaultUSBInterrupt,_ReadUSBInterruptData,_HandleUSBInterruptInitialize,CopyToRAMPage 
    1515 EXTERN _HandleUSBACablePluggedIn,_HandleUSBACableUnplugged,_HandleUSBBCablePluggedIn,_HandleUSBBCableUnplugged 
    16  EXTERN GetHexA,GetHexHL,CursorOff,RunIndicOn,SetFastSpeed,CanAlph,homescreenContextVectors,SetContrast 
     16 EXTERN GetHexA,GetHexHL,CursorOff,RunIndicOn,SetFastSpeed,CanAlph,homescreenContextVectors,SetContrast,_PULLDOWNCHK 
    1717 
    1818;0000h: 
     
    438438       ld sp,0FFC5h 
    439439       ld iy,flags 
     440       B_CALL ClrScrnFull 
    440441       ;Do any other initialization 
    441442       ;Appear "off" 
     
    474475       res receiveTIOS,(iy+linkFlags2) 
    475476;Start the OS, minimal as it is 
     477       call CalculateOSChecksum 
     478       ld de,(RAMChecksum) 
     479       call cphlde 
     480       jr z,$F 
     481       ;The RAM checksum check has failed, so wipe out RAM and hope for the best 
     482       ;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 
     489$$:    ;Screw up the RAM checksum so it's no longer valid 
     490       dec de 
     491       ld (RAMChecksum),de 
    476492       call ClrLCDFull 
    477493       res indicOnly,(iy+indicFlags) 
     
    507523       call APP_PUSH_ERRORH 
    508524       ld (onSP),sp 
     525RestartMon: 
    509526_Mon:  xor a 
    510527       ld (kbdKey),a 
     
    515532       call CursorOff 
    516533       call RunIndicOn 
     534       call _PULLDOWNCHK 
     535       jr c,RestartMon 
    517536       call CallcxMain 
    518537       jr _Mon 
  • trunk/page00/display.asm

    r42 r47  
    33 
    44 PUBLIC AnimateRunIndicator,DispHexA,PutS,PutC,curBlink,SaveOScreen,DispHexHL,EraseEOL,ClrLCDFull 
    5  PUBLIC _LCD_COMMAND,SetXAutoIncrementMode,SetYAutoIncrementMode,IPutSB,PutMap 
     5 PUBLIC _LCD_COMMAND,SetXAutoIncrementMode,SetYAutoIncrementMode,IPutSB,PutMap,ClrScrnFull,ClrTxtShd 
    66 PUBLIC saveTR,restoreTR,showCursor,CursorOff,CursorOn,hideCursor,RunIndicOn,IPutC 
    7  EXTERN IsAtEditTail,IsAtBtm,LCDDelay 
     7 EXTERN IsAtEditTail,IsAtBtm,LCDDelay,ATimes16 
    88 
    99 include "includes\os2.inc" 
     
    1616CursorOn: 
    1717;TODO: come back to these... 
     18       ret 
     19 
     20ClrScrnFull: 
     21       call ClrLCDFull 
     22ClrTxtShd: 
     23       bit appTextSave,(iy+appFlags) 
     24       ret z 
     25       ld hl,textShadow 
     26       ld (hl),' ' 
     27       ld de,textShadow+1 
     28       ld bc,127 
     29       ldir 
    1830       ret 
    1931 
     
    229241;TODO: get this using a built-in font table instead of this boot code hack 
    230242PutC: 
    231        ld b,a 
     243       push af 
     244       push bc 
     245       push de 
     246       push hl 
     247       push ix 
     248       bit appTextSave,(iy+appFlags) 
     249       jr z,$F 
     250       call GetTextShadowOffset 
     251       ld (hl),a 
     252$$:    ld b,a 
    232253       in a,(6) 
    233254       push af 
     
    265286       ld a,b 
    266287       out (6),a 
     288       pop ix 
     289       pop hl 
     290       pop de 
     291       pop bc 
     292       pop af 
     293       ret 
     294GetTextShadowOffset: 
     295       push af 
     296       push bc 
     297       push de 
     298       ld hl,(curRow) 
     299       ld a,l 
     300       call ATimes16 
     301       add a,h 
     302       ld l,a 
     303       ld h,0 
     304       ld de,textShadow 
     305       add hl,de 
     306       pop de 
     307       pop bc 
     308       pop af 
    267309       ret 
    268310 
  • trunk/page00/home.asm

    r42 r47  
    2626       pop hl 
    2727       ld (curRow),hl 
    28        cp kGraph 
    29        jr z,graphPressed 
    3028       cp kYequ 
    3129       ret nz 
     
    6260       set curAble,(iy+curFlags) 
    6361       ret 
    64 graphPressed: 
    65        B_CALL UnlockFlash 
    66        ld a,70h 
    67        ld b,0 
    68        ld de,7FFFh 
    69        B_CALL WriteAByte 
    70        ret 
     62 
  • trunk/page00/intmisc.asm

    r12 r47  
    55 
    66 PUBLIC CheckLowBatteriesTurnOff,_ZERO_PORT_3,_OUT_PORT_3,PowerOff,UpdateAPD,resetAPDTimer 
    7  EXTERN SaveOScreen,LCDDelay 
     7 EXTERN SaveOScreen,LCDDelay,CalculateOSChecksum 
    88 
    99PowerOff: 
     
    1616       call LCDDelay 
    1717       out (LCDinstPort),a 
     18       call CalculateOSChecksum 
     19       ld (RAMChecksum),hl 
    1820       ld a,STATE_MODE0_DEFAULT 
    1921       out (interruptStatusPort),a 
  • trunk/page00/util.asm

    r43 r47  
    33 
    44 PUBLIC _APP_PUSH_ERRORH,_APP_POP_ERRORH,FindSym,PushRealO1,Mov9ToOP1,FPAdd,OP1ToOP2,LCDDelay 
    5  PUBLIC CopyFlashPage 
     5 PUBLIC CopyFlashPage,ATimes16,CalculateOSChecksum 
    66 PUBLIC Placeholder005Fh,Placeholder0006h,Placeholder004Eh,Placeholder0003h,Placeholder0035h 
    77 PUBLIC outputPage,NZIf83Plus,ZIfSlowSpeed,GetBytePaged,MakeOffPageCall,CopyToRAMPage 
    8  PUBLIC CopyRAMToFlashPage,CanAlphIns,CanAlph,ResAlph,GetHexA,GetHexHL,SetFastSpeed 
     8 PUBLIC CopyRAMToFlashPage,CanAlphIns,CanAlph,ResAlph,GetHexA,GetHexHL,SetFastSpeed,cphlde 
    99 PUBLIC BCALL,BJUMP,JErrorNo,SetupPagedPtr,PagedGet,EraseRAMPage,SetContrast,MemClear 
    1010 EXTERN Page0Call,UpdateAPD,PowerOff,GetCSC,PutC,DispHexHL,PutMap,BCALLRoutine,OS2Marker 
     
    2222Placeholder004Eh: 
    2323Placeholder005Fh: 
     24       ret 
     25 
     26cphlde: 
     27       push hl 
     28       or a 
     29       sbc hl,de 
     30       pop hl 
     31       ret 
     32 
     33ATimes16: 
     34       add a,a 
     35       add a,a 
     36       add a,a 
     37       add a,a 
     38       ret 
     39 
     40CalculateOSChecksum: 
     41       push ix 
     42       ld ix,userMem 
     43       ld bc,0FE70h-userMem 
     44       ld hl,0011h 
     45       ld d,h 
     46$$:    ld e,(ix+0) 
     47       inc ix 
     48       add hl,de 
     49       dec bc 
     50       ld a,b 
     51       or c 
     52       jr nz,$B 
     53       ld e,d 
     54       ex de,hl 
     55       sbc hl,de 
     56       pop ix 
    2457       ret 
    2558 
  • trunk/page01/01base.asm

    r41 r47  
    1212       and STATUS_NON_83P_MASK 
    1313       jr z,GetKeyStart 
    14        set linkAssistEnabled,(iy+linkAssistFlags) 
    15        in a,(laStatusPort) 
    16        xor a 
    17        out (laEnPort),a 
     14       ;set linkAssistEnabled,(iy+linkAssistFlags) 
     15       ;in a,(laStatusPort) 
     16       ;xor a 
     17       ;out (laEnPort),a 
    1818       bit 0,(iy+3Eh) 
    1919       jr z,disableLA 
     
    6868       jr GetKeyMainLoop 
    6969receivingData: 
     70       ld hl,kbdKey 
     71       ld (hl),0 
    7072       B_CALL keyscnlnk 
     73;       res indicOnly,(iy+indicFlags)      ;***TESTING 
    7174       ld a,(kbdKey) 
    7275       or a 
  • trunk/page1C/linklow.asm

    r24 r47  
    140140       jr nz,cgbNoAssist 
    141141       di 
    142        jr ReceiveLAByteToC 
     142       call ReceiveLAByteToC 
     143       ld a,c 
     144       ret 
    143145cgbNoAssist: 
    144146       ld b,8 
  • trunk/page1C/silentlink.asm

    r44 r47  
    1111 EXTERN SetYAutoIncrementMode,SendContinue,ReceiveDataPacket,DispHexHL,PutC,receiveRestOfDataPacket 
    1212 EXTERN CopyToRAMPage,CopyRAMToFlashPage,EraseEOL,PowerOff,SendHCommand,IPutSB,IPutC,CheckForBootLoader 
    13  EXTERN SetupPagedPtr,PagedGet,SendChecksumGetAcknowledge 
     13 EXTERN SetupPagedPtr,PagedGet,SendChecksumGetAcknowledge,RecAByteIO 
    1414 
    1515keyscnlnk: 
     
    4040       ld a,(ioData) 
    4141       call ContinueGetByte 
     42       bit 5,(iy+3Dh) 
     43       jr nz,keyscnlnkEnd 
     44       ;HACK: until I figure out where the extra zero's coming from... 
    4245       call Get3Bytes 
     46HandleLinkPacket: 
    4347       ld hl,cmdTable 
    4448       ld b,(hl) 
     
    110114 
    111115memoryDumpPacket: 
     116       ld hl,ioData 
     117       ld (iMathPtr5),hl 
    112118       call receiveRestOfDataPacket 
    113119       ld bc,(ioData) 
    114120       ld b,c 
    115121       ld de,(ioOP1) 
     122       ld a,b 
     123       ld hl,0 
     124       ld (curRow),hl 
     125       call DispHexA 
     126       ex de,hl 
     127       call DispHexHL 
     128       ex de,hl 
    116129       call SetupPagedPtr 
    117130       ld de,(ioOP1+2) 
    118131       ld (header+2),de 
     132       push de 
    119133       ld hl,1573h 
    120134       ld (header),hl 
    121135       call Send4Bytes 
    122136       ld hl,0 
    123        ld (checksum),hl 
    124        ld de,(header+2) 
     137       ld (header+4),hl 
     138       pop de 
    125139$$:    push de 
    126140       call PagedGet 
     
    135149 
    136150receivedRequestToSend: 
     151       ld hl,ioData 
     152       ld (iMathPtr5),hl 
    137153       call receiveRestOfDataPacket 
    138154       ld a,(ioOP1) 
  • trunk/page1D/1Dbase.asm

    r42 r47  
    33 
    44 PUBLIC _JErrorNo,_UnlockFlash,_GetKey 
    5  EXTERN JErrorNo,UnlockFlash,GetKey,keyscnlnk,Rec1stByteNC,RecAByteIO,MemClear 
    6  EXTERN ClrLCDFull,PutS,GetCSC,CursorOff,CursorOn,hideCursor,showCursor 
     5 EXTERN JErrorNo,UnlockFlash,GetKey,keyscnlnk,Rec1stByteNC,RecAByteIO,MemClear,ClrTxtShd 
     6 EXTERN ClrLCDFull,PutS,GetCSC,CursorOff,CursorOn,hideCursor,showCursor,ClrScrnFull 
    77 
    88;4000h: 
     
    13591359       DW 0000h 
    13601360       DB 00h 
    1361 ;_ClrScrnFull           equ 4546h 
    1362        DW 0000h 
     1361_ClrScrnFull: 
     1362       DW ClrScrnFull 
    13631363       DB 00h 
    13641364;_ClrScrn               equ 4549h 
    13651365       DW 0000h 
    13661366       DB 00h 
    1367 ;_ClrTxtShd             equ 454Ch 
    1368        DW 0000h 
     1367_ClrTxtShd: 
     1368       DW ClrTxtShd 
    13691369       DB 00h 
    13701370;_ClrWindow             equ 454Fh