Show
Ignore:
Timestamp:
10/11/09 23:33:32 (3 years ago)
Author:
brandonlw
Message:

We now have a basic menu system and the beginnings of an oncalc hex editor
I also was forced to duplicate PutMap? instead of using the boot code hack, since it doesn't support inverse text
Progress...

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/page00/display.asm

    r49 r55  
    55 PUBLIC _LCD_COMMAND,SetXAutoIncrementMode,SetYAutoIncrementMode,IPutSB,PutMap,ClrScrnFull,ClrTxtShd 
    66 PUBLIC saveTR,restoreTR,showCursor,CursorOff,CursorOn,hideCursor,RunIndicOn,IPutC,_LCD_DRIVERON 
    7  EXTERN IsAtEditTail,IsAtBtm,LCDDelay,ATimes16,NZIf83Plus 
     7 PUBLIC RestoreTextShadow,rstrpartialWin,savepartialWin,PutPS 
     8 EXTERN IsAtEditTail,IsAtBtm,LCDDelay,ATimes16,NZIf83Plus,_GetCharacterBitmap 
    89 
    910 include "includes\os2.inc" 
     11 
     12PutPS: 
     13       ld b,(hl) 
     14$$:    inc hl 
     15       ld a,(hl) 
     16       call PutC 
     17       djnz $B 
     18       ret 
     19 
     20RestoreTextShadow: 
     21       ld hl,0 
     22       ld (curRow),hl 
     23       ld hl,textShadow 
     24       ld b,127 
     25$$:    ld a,(hl) 
     26       inc hl 
     27       call IPutC 
     28       djnz $B 
     29       ld a,(hl) 
     30       call PutMap 
     31rstrpartialWin: 
     32       ld hl,(textShadCur) 
     33       ld (curRow),hl 
     34       ld a,(textShadAlph) 
     35       ld (flags+shiftFlags),a 
     36       ld a,(textShadIns) 
     37       and 0EFh 
     38       ld hl,flags+textFlags 
     39       or (hl) 
     40       ld (hl),a 
     41       ret 
     42savepartialWin: 
     43       ld hl,(curRow) 
     44       ld (textShadCur),hl 
     45       ld a,(winTop) 
     46       ld (textShadTop),a 
     47       ld a,(flags+shiftFlags) 
     48       ld (textShadAlph),a 
     49       ld a,(flags+textFlags) 
     50       and 10h 
     51       ld (textShadIns),a 
     52       ret 
    1053 
    1154_LCD_DRIVERON: 
     
    83126       jr endTR 
    84127 
    85 PutMap: 
    86        push hl 
    87        ld hl,(curRow) 
    88        push hl 
    89        call PutC 
    90        pop hl 
    91        ld (curRow),hl 
    92        pop hl 
    93        ret 
    94  
    95128restoreTR: 
    96129       bit indicInUse,(iy+indicFlags) 
     
    255288 
    256289EraseEOL: 
    257        ld hl,(curRow) 
     290       push af 
     291       push bc 
     292       push de 
    258293       push hl 
    259294       ld a,(curCol) 
     295       push af 
     296       sub 16 
     297       jr nc,EraseEOL_1 
     298       neg 
    260299       ld b,a 
    261        ld a,16 
    262        sub b 
    263        ld b,a 
    264 $$:    ld a,' ' 
    265        push bc 
    266        call PutC 
    267        pop bc 
     300       ld a,' ' 
     301       dec b 
     302       jr z,EraseEOL_2 
     303$$:    call PutC 
    268304       djnz $B 
    269        pop hl 
    270        ld (curRow),hl 
    271        ret 
    272  
    273 ;TODO: get this using a built-in font table instead of this boot code hack 
     305EraseEOL_2: 
     306       call PutMap 
     307;       ei 
     308EraseEOL_1: 
     309       pop af 
     310       ld (curCol),a 
     311       pop hl 
     312       pop de 
     313       pop bc 
     314       pop af 
     315       ret 
     316 
     317newLine: 
     318       push af 
     319       ld a,(curRow) 
     320       inc a 
     321       ld (curRow),a 
     322       xor a 
     323       ld (curCol),a 
     324       pop af 
     325       ret 
     326 
    274327PutC: 
     328       push af 
     329       push hl 
     330       cp 0D6h 
     331       jr nz,$F 
     332       call EraseEOL 
     333       call newLine 
     334       ld a,(winBtm) 
     335       ld l,a 
     336       ld a,(curRow) 
     337       cp l 
     338       jr nc,PutC_Done 
     339       ld a,3Ah 
     340$$:    call PutMap 
     341       res 0,(iy+8) 
     342       ld hl,curCol 
     343       inc (hl) 
     344       ld a,(hl) 
     345       cp 16 
     346       call nc,newLine 
     347PutC_Done: 
     348       pop hl 
     349       pop af 
     350       ret 
     351 
     352PutMap: 
    275353       push af 
    276354       push bc 
     
    282360       call GetTextShadowOffset 
    283361       ld (hl),a 
    284 $$:    ld b,a 
     362$$:    or a 
     363       jr z,$F 
     364       cp 0F5h 
     365       jr c,PutMap_1 
     366$$:    ld a,0D0h 
     367PutMap_1: 
     368       ld l,a 
     369       ld h,0 
     370       add hl,hl 
     371       add hl,hl 
     372       add hl,hl 
     373       call _GetCharacterBitmap 
     374       push hl 
     375       pop ix 
     376       ld a,(curRow) 
     377       add a,a 
     378       add a,a 
     379       add a,a 
     380       add a,80h 
     381       ld (curXRow),a 
     382       ld a,(curCol) 
     383       and 1Fh 
     384       add a,20h 
     385       ld b,a 
     386       xor a 
     387       call LCDDelay 
     388       out (LCDinstPort),a 
     389       ld a,(curXRow) 
     390       call SetLCDRow 
     391       call SetXAutoIncrementMode 
     392       ld a,b 
     393       call LCDDelay 
     394       out (LCDinstPort),a 
     395       ld b,8 
     396PutMap_Loop1: 
     397       xor a 
     398       dec b 
     399       jr z,$F 
     400       ld a,(ix+0) 
     401       inc ix 
     402$$:    inc b 
     403       sla a 
     404       bit textInverse,(iy+textFlags) 
     405       jr z,PutMap_3 
     406       xor 3Eh 
     407PutMap_4:push af 
     408       ld a,(curCol) 
     409       and 1Fh 
     410       jr z,PutMap_2 
     411       add a,1Fh 
     412       call LCDDelay 
     413       out (LCDinstPort),a 
     414       call SetLCDRow_1 
     415       or 1 
     416       bit 0,(iy+8) 
     417       jr z,$F 
     418       and 3Eh 
     419$$:    call LCDDelay 
     420       out (LCDdataPort),a 
     421       ld a,(curCol) 
     422       and 1Fh 
     423       add a,20h 
     424       call LCDDelay 
     425       out (LCDinstPort),a 
     426       call SetLCDRow_2 
     427PutMap_2: 
     428       pop af 
     429       jr PutMap_5 
     430PutMap_3: 
     431       bit 0,(iy+8) 
     432       jr nz,PutMap_4 
     433PutMap_5: 
     434       call LCDDelay 
     435       out (LCDdataPort),a 
     436       djnz PutMap_Loop1 
     437       ld a,1 
     438       call LCDDelay 
     439       out (LCDinstPort),a 
     440       COMMENT ~ 
     441       ld b,a 
    285442       in a,(6) 
    286443       push af 
     
    318475       ld a,b 
    319476       out (6),a 
     477       ~ 
    320478       pop ix 
    321479       pop hl 
    322480       pop de 
    323481       pop bc 
     482       pop af 
     483       ret 
     484SetLCDRow_1: 
     485       call LCDDelay 
     486       in a,(LCDdataPort) 
     487       call LCDDelay 
     488       in a,(LCDdataPort) 
     489SetLCDRow_2: 
     490       push af 
     491       ld a,(curXRow) 
     492       add a,8 
     493       sub b 
     494       call SetLCDRow 
     495       call SetXAutoIncrementMode 
    324496       pop af 
    325497       ret