home *** CD-ROM | disk | FTP | other *** search
- title colorize.asm
- page 62,132
-
- ; fake color for games by wedging into BIOS video interrupt
- ; mode must be co80
-
- code segment
- assume cs:code,ds:nothing,es:nothing
- org 100H
-
- ; .com entry point
- start: jmp short install
-
- ; program variables
- vector$10 dd 4*010h
- old$10 dd ? ; save original intr entry addr
-
- ;;;;;;;;;;;;;;;;;;;;;; interrupt entry point ;;;;;;;;;;;;;;;;;;;;;;;;
-
- wedge$10 proc far
-
- cmp ah,09h ; write char & attr func call ?
- je L1
- cmp ah,0ah ; write char func call ?
- jne exitwedge ; neither, go exec BIOS intr
- mov ah,09h ; always write attr with char
- mov bl,07h
-
- ; fiddle attributes for character graphics
- L1: cmp bl,07h ; white ?
- jnz L2
- mov bl,02h ; then make green
-
- L2: cmp al,'@' ; player symbol ?
- jnz L3
- mov bl,03h ; then make cyan
-
- L3: test al,80h ; hi bit char ?
- jz exitwedge
- mov bl,04h ; then make red
-
- exitwedge: jmp [old$10] ; exec BIOS intr
- wedge$10 endp
-
- ;;;;;;;;;;;;;;;;;;;;;;;;; installation code ;;;;;;;;;;;;;;;;;;;;;;;;;
-
- install proc near
- cli
- lds si,vector$10 ; load addr of vector table entry
- les di,dword ptr [si] ; read entry from vector table
- mov word ptr old$10,di
- mov word ptr old$10+2,es ; save original vector
- mov word ptr [si],offset wedge$10
- mov word ptr [si+2],cs ; set new vector
- sti
-
- mov dx,offset install
- int 27h ; terminate & remain resident
- install endp
-
- code ends
- end start