home *** CD-ROM | disk | FTP | other *** search
- '─ Area: F-QUICKBASIC ─────────────────────────────────────────────────────────
- ' Msg#: 376 Date: 11 Apr 94 21:28:20
- ' From: Jared Grubb Read: Yes Replied: No
- ' To: All Who Wanted This Mark:
- ' Subj: PCX files, not written by me!
- '──────────────────────────────────────────────────────────────────────────────
- 'From: BRENT ASHLEY
- 'Subj: PICTURES WITH QBASIC
- '---------------------------------------------------------------------------
- 'Here's a PCX loader I found and played with some time ago. There are no
- 'comments and I'm not sure about converting to other screen modes, but 'it's a
- 'start and you're welcome to it. For speed, you'll want to either 'modify this
- 'to write to an invisible page and then make the page visible '(apparent speed),
- 'or find a library with PCX routines (some of Tom 'Hanlin's have them) written
- 'in assembler.
- DEFINT A-Z
- DECLARE SUB PCXLOAD (File$)
-
- File$ = "FILENAME.PCX"
-
- CLS
- PCXLOAD File$
-
- SUB PCXLOAD (File$) STATIC
- SCREEN 12, , 0
- OPEN File$ FOR INPUT AS #1 LEN = 16384
- SEEK #1, 129
- DEF SEG = &HA000
- FOR ScrLin = 0 TO 479
- Addr& = 80& * ScrLin
- LinStrt& = Addr&: LinEnd& = Addr& + 80
- Plane = 1
- OUT &H3C4, 2: OUT &H3C5, Plane
- DO WHILE Plane <= 8
- Byte = ASC(INPUT$(1, 1))
- IF EOF(1) THEN EXIT FOR
- IF (Byte AND 192) <> 192 THEN
- POKE Addr&, Byte
- Addr& = Addr& + 1
- IF Addr& >= LinEnd& THEN
- Addr& = LinStrt&
- Plane = Plane * 2
- OUT &H3C4, 2: OUT &H3C5, Plane
- END IF
- ELSE
- Byte = Byte AND 63
- Byte2 = ASC(INPUT$(1, 1))
- IF EOF(1) THEN EXIT FOR
- FOR Expand = 1 TO Byte
- POKE Addr&, Byte2
- Addr& = Addr& + 1
- IF Addr& >= LinEnd& THEN
- Addr& = LinStrt&
- Plane = Plane * 2
- OUT &H3C4, 2: OUT &H3C5, Plane
- END IF
- NEXT
- END IF
- LOOP
- NEXT
- OUT &H3C4, 2: OUT &H3C5, &HF
- DEF SEG
- CLOSE #1
- END SUB
-