Show
Ignore:
Timestamp:
11/09/09 21:57:30 (3 years ago)
Author:
brandonlw
Message:

Added small font routines
Added "OS2 v[version]\nBuild [build]" text on RAM clear

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/page00/display.asm

    r60 r68  
    55 PUBLIC _LCD_COMMAND,SetXAutoIncrementMode,SetYAutoIncrementMode,IPutSB,PutMap,ClrScrnFull,ClrTxtShd 
    66 PUBLIC saveTR,restoreTR,showCursor,CursorOff,CursorOn,hideCursor,RunIndicOn,IPutC,LCD_DRIVERON 
    7  PUBLIC RestoreTextShadow,rstrpartialWin,savepartialWin,PutPS 
    8  EXTERN IsAtEditTail,IsAtBtm,LCDDelay,ATimes16,NZIf83Plus,_GetCharacterBitmap 
     7 PUBLIC RestoreTextShadow,rstrpartialWin,savepartialWin,PutPS,VPutMap,VPutS,VPutSCenter 
     8 EXTERN IsAtEditTail,IsAtBtm,LCDDelay,ATimes16,NZIf83Plus,_GetCharacterBitmap,_GetSmallFontCharacterBitmap 
     9 EXTERN _GetSStringLength 
    910 
    1011 include "includes\os2.inc" 
     
    695696       ret 
    696697 
     698VPutSCenter: 
     699       push hl 
     700       call _GetSStringLength 
     701       pop hl 
     702       ld a,95 
     703       sub c 
     704       jr nc,$F 
     705       xor a 
     706$$:    srl a 
     707       ld (penCol),a 
     708VPutS: 
     709       push af 
     710       push de 
     711       push ix 
     712VPutSLoop: 
     713       ld a,(hl) 
     714       inc hl 
     715       or a 
     716       jr z,$F 
     717       call VPutMap 
     718       jr nc,VPutSLoop 
     719$$:    pop ix 
     720       pop de 
     721       pop af 
     722       ret 
     723 
     724VPutMap: 
     725       push bc 
     726       ld b,a 
     727       ld a,i 
     728       jp pe,$F 
     729       ld a,i 
     730$$:    push af 
     731       ld a,b 
     732       di 
     733       push hl 
     734       call _GetSmallFontCharacterBitmap 
     735       push hl 
     736       pop ix 
     737       ld e,(ix+0) 
     738       ld d,0 
     739       ld hl,vpmTable-1 
     740       add hl,de 
     741       ld d,(hl) 
     742       push de 
     743       ld a,(penRow) 
     744       ld b,a 
     745       or 80h 
     746       ld (curXRow),a 
     747       call SetLCDRow 
     748       call SetXAutoIncrementMode 
     749       call vpm1 
     750       ld a,(penCol) 
     751       ld e,a 
     752       srl a 
     753       srl a 
     754       srl a 
     755       or 20h 
     756       ld (curY),a 
     757       call LCDDelay 
     758       out (LCDinstPort),a 
     759       ld d,0 
     760       add hl,de 
     761       ld a,e 
     762       pop de 
     763       add a,e 
     764       cp 60h 
     765       ccf 
     766       jr c,vpmReturnC 
     767       push de 
     768       ld (penCol),a 
     769       ld a,l 
     770       and 7 
     771       ld c,a 
     772       srl h 
     773       rr l 
     774       srl h 
     775       rr l 
     776       srl h 
     777       rr l 
     778       ld de,plotSScreen 
     779       add hl,de 
     780       pop de 
     781       ld b,6 
     782       ld a,8 
     783       sub c 
     784       sub (ix+0) 
     785       inc ix 
     786       jp m,vpm3 
     787       ld c,a 
     788       inc c 
     789vpmLoop: 
     790       push bc 
     791       ld b,c 
     792       ld a,(hl) 
     793       call LCDDelay 
     794       in a,(LCDdataPort) 
     795       call LCDDelay 
     796       in a,(LCDdataPort) 
     797       push af 
     798       ld a,(curXRow) 
     799       call SetLCDRow 
     800       call SetXAutoIncrementMode 
     801       pop af 
     802       jr vpm4 
     803$$:    rrca 
     804vpm4:  djnz $B 
     805       bit textInverse,(iy+textFlags) 
     806       jr z,$F 
     807       ld b,a 
     808       ld a,0FFh 
     809       xor d 
     810       or b 
     811       jr vpm5 
     812$$:    and d 
     813vpm5:  xor (ix+0) 
     814       inc ix 
     815       ld b,c 
     816       jr vpm6 
     817$$:    rlca 
     818vpm6:  djnz $B 
     819       call LCDDelay 
     820       out (LCDdataPort),a 
     821       ld hl,curXRow 
     822       inc (hl) 
     823       pop bc 
     824       ld a,(hl) 
     825       cp 0C0h 
     826       jr nc,vpmReturn 
     827       djnz vpmLoop 
     828vpmReturn: 
     829       pop hl 
     830       pop af 
     831       jp po,$F 
     832       ei 
     833$$:    pop bc 
     834       xor a 
     835       ret 
     836vpm1:  inc b 
     837       ld hl,0 
     838       ld de,60h 
     839       jr vpm2 
     840$$:    add hl,de 
     841vpm2:  djnz $B 
     842       ret 
     843vpmReturnC: 
     844       pop hl 
     845       pop af 
     846       jp po,$F 
     847       ei 
     848$$:    pop bc 
     849       scf 
     850       ret 
     851vpm3:  neg 
     852       ld c,a 
     853vpm9:  push bc 
     854       ld b,c 
     855       call LCDDelay 
     856       in a,(LCDdataPort) 
     857       call LCDDelay 
     858       in a,(LCDdataPort) 
     859       push af 
     860       ld a,(curXRow) 
     861       call SetLCDRow 
     862       call SetXAutoIncrementMode 
     863       pop af 
     864       push af 
     865       ld a,(curY) 
     866       inc a 
     867       call LCDDelay 
     868       out (LCDinstPort),a 
     869       call LCDDelay 
     870       in a,(LCDdataPort) 
     871       call LCDDelay 
     872       in a,(LCDdataPort) 
     873       push af 
     874       ld a,(curXRow) 
     875       call SetLCDRow 
     876       call SetXAutoIncrementMode 
     877       pop af 
     878       ld e,a 
     879       pop af 
     880vpm10: sla e 
     881       rla 
     882       jr nc,$F 
     883       inc e 
     884$$:    djnz vpm10 
     885       call GetLCDMask 
     886vpm12: srl a 
     887       rr e 
     888       jr nc,$F 
     889       add a,80h 
     890$$:    djnz vpm12 
     891       push af 
     892       ld a,e 
     893       call LCDDelay 
     894       out (LCDdataPort),a 
     895       call MySetLCDRow 
     896       ld a,(curY) 
     897       call LCDDelay 
     898       out (LCDinstPort),a 
     899       pop af 
     900       call LCDDelay 
     901       out (LCDdataPort),a 
     902       ld hl,curXRow 
     903       inc (hl) 
     904       pop bc 
     905       ld a,(hl) 
     906       cp 0C0h 
     907       jr nc,vpmReturn 
     908       djnz vpm9 
     909       jr vpmReturn 
     910MySetLCDRow: 
     911       push af 
     912       ld a,(curXRow) 
     913       call SetLCDRow 
     914       call SetXAutoIncrementMode 
     915       pop af 
     916       ret 
     917GetLCDMask: 
     918       bit textInverse,(iy+textFlags) 
     919       jr z,$F 
     920       ld b,a 
     921       ld a,0FFh 
     922       xor d 
     923       or b 
     924       jr vpm11 
     925$$:    and d 
     926vpm11: xor (ix+0) 
     927       inc ix 
     928       ld b,c 
     929       ret 
     930vpmTable: 
     931       DB 0FEh 
     932       DB 0FCh 
     933       DB 0F8h 
     934       DB 0F0h 
     935       DB 0E0h 
     936       DB 0C0h 
     937