Qbasicnews.com

Full Version: Extracting FONTS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Obviously this is me again with the game of Paganitzu.

Now I'm trying to figure out if there is any way to use the fonts in these files that have Fonts in them.

PAGA1.001 Executable
PAGA1.002 Executable
PAGA1.003 Fonts
PAGA1.004 PCX Graphics
PAGA1.005 Some texts
PAGA1.006 PCX Graphics
PAGA1.007 Rooms
PAGA1.008 CGA Graphics
PAGA1.009 PCX Graphics
PAGA1.010 EGA Graphics
PAGA1.011 CGA Graphics
PAGA1.012 EGA Graphics
PAGA1.013 CGA Graphics
PAGA1.014 EGA Numbers
PAGA1.015 CGA Numbers
PAGA1.016 EGA Graphics
PAGA1.EXE Executable

Here is some information about these Font files that may help you see something that I can't because I don't understand what this person is even talking about.

///////////////////////////////////////////////////////////////////////
//
// Fonts
//
///////////////////////////////////////////////////////////////////////

Inside the fonts-files there are some strings. Each string represents
another letter or number. Each letter inside a string is a command:

Line-Drawing and Cursor-Movement Commands
[B] Move without plotting [N] Plot and return
U[n] Up E[n] Diagonally up and right
D[n] Down F[n] Diagonally down and right
L[n] Left G[n] Diagonally down and left
R[n] Right H[n] Diagonally up and left
M[{+|-}]x,y Move to point x,y
(or relative move)

Color, Scale, and Rotation Commands
Cn Change the drawing (foreground) color
(SCREEN mode determines valid values for 'n')
Pp,b Fill enclosed shape that has border color 'b'
with color 'p'
Sn Increase or decrease length of moves (n=4 default)
An Rotate (n * 90) degrees, where n = 0, 1, 2, or 3
TAn Rotate (0 <= n <= 360) degrees

///////////////////////////////////

Any idea how I can view or use these fonts in a qbasic game?
You making a paganitzu clone or something? Wink

Those are QB DRAW strings. Open up PAGA1.003 with a text editor and you'll see:

"NU4EU4R2FD2NL4D2BR2"
"NU5RU5R2FGNL2FDGNL2BR3"
"BM+5,-4HL2G2DNENRF2R2EBDBR2"
"NU5RU5RM+2,+3DGNL2BR3"
"BM+5,-4HL2G2DNENR3F2R2EBDBR2"
"NU4EUNR2U3R3BD5BR2"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BUBR5"
"BDHU5ERFNDREFG2F2DGH2D2NLBR4BU"
"BDLU7R3D5R2FGNL3BR2BU"
"BDHU4E2RFEF2D4GHU4DL2UD3GBR6"
"BDHU4E2R2F2D4GHU4LD3GBR5"
"BRH2UE3R2F2D3G2L2BU2U3R2D3NLBR3BD"
"BDHU4E2R2F2DG2LNGBU2URDBR3BD3"
"BRH2UE3R2F2D2GFGHGLBU2U3R2D2GBR4BD"
"BDHU4E2R2F2DGDFGH2NGBU2URDBR3BD3"
"HER2NRNFNDLH2E2R3FGNL2DFDG2NL2BUBR3"
"U4HER5FGL2D4GNLBR5BU"
"HU4EF2D3RU4EFD4G2NL2BUBR3"
"BDLU6ERFD3EU2EFD2G4NLBR5BU"
"HU4EF2D3EFU4EFD4G2HGNLBUBR5"
"BDHUE2H2EF2E2FG2F2DGHUHD2GBUBR5"
"BDHU5ERFNDREFG3D2GNLBR5BU"
"BDHUE3L2HER4FG3DR2FGNL3BR2BU"
"HU3E2R2F2D3G2L2RBU2NRUBU2RDBD3BR3"
"BDHEU2HE2RFD4RFGL3BUBR5"
"BDHE3ULDLHE2R2F2DG2NLRFGNL3BR2BU"
"HERFRUHELGLHE2R2F2GFDG2NL2BR3BU"
"BUHEU2ERFND2EFD5GHUL2BR5BD"
"HER2NDNFNRL2HU2ER4FGNL2DFDG2NL2BUBR3"
"HU3E2R2FGNLF2DG2L2RBU2URDBR3BD"
"U2E2L2HER4FG2D3GLBUBR5"
"HUENRHE2R2F2GFDG2L2RBU2UBU2RBD2DBR3BD"
"ENR2H2UE2R2F2D3G2L2RBU4URDBD3BR3"

To show the letters, just use draw:

Code:
SCREEN 7
DRAW "BM0,8"  'x and y coordinates of the letter
DRAW "NU4EU4R2FD2NL4D2BR2"

etc.
Ok, but how would I use these fonts in the Paganitzu clone I'm making?

I'm actually making it in qbasic for fun and a learning experience for me in programming games. This is my first time doing so. That's why I appreciate all your help. (of course that goes without saying)

The creator of the original game Keith Schuler made the game in 1991 or something and has lost the source code for it. This is another reason I am trying to remake it.

Also:

1. To have a Level Editor to make own Rooms or Levels

2. Add new elements and stuff in the game that I wish it had while
I was playing it for the first time and thereafter.

Ok, there's 2 more reasons why.

Obviously I don't know if you know how the fonts are used in the game but you can check it out by downloading the shareware version of the game. Just check search engine for: Paganitzu Download

So it's old and maybe you don't want to even take a look but that's up to you to decide. I'm not trying to get you to do anything really but to see what I'm trying to accomplish as far as implementing everything in this game to run in Qbasic.

AnyforDoodleHow; How would I go about using these fonts the proper way without wasting too much memory?
Code:
DEFINT A-Z
'$DYNAMIC

DECLARE SUB FontLoad (Filename$)
DECLARE SUB FontPrint (x, y, FontColr, Text$)
DECLARE SUB FontPrintBorder (x, y, FontColr, BorderColr, Text$)
DIM SHARED Font$(71)

FontLoad "C:\PAGA\PAGA1.003"

SCREEN 7
CLS
PAINT (0, 0), 9

FontPrint 0, 0, 14, "THIS IS THE PLAIN FONT"
FontPrintBorder 0, 10, 14, 0, "THIS FONT HAS A BORDER"

SUB FontLoad (Filename$)

  FontFile = FREEFILE
  OPEN Filename$ FOR INPUT AS #FontFile
  FOR i = 0 TO 71
    LINE INPUT #FontFile, Font$(i)
    Font$(i) = MID$(Font$(i), 2, LEN(Font$(i)) - 2)
  NEXT
  CLOSE #FontFile

END SUB

SUB FontPrint (x, y, FontColr, Text$)

  DRAW "BM" + STR$(x + 1) + "," + STR$(y + 6) + "C" + STR$(FontColr)
  FOR i = 1 TO LEN(Text$)
    Char$ = UCASE$(MID$(Text$, i, 1))
    SELECT CASE Char$
      CASE "A" TO "Z": DRAW "X" + VARPTR$(Font$(ASC(Char$) - 65))
      CASE "1" TO "9": DRAW "X" + VARPTR$(Font$(ASC(Char$) - 22))
      CASE "0": DRAW "X" + VARPTR$(Font$(26))
      CASE ",": DRAW "BRNUNGBR2"
      CASE ".": DRAW "BRR0BR2"
      CASE CHR$(34): DRAW "BU4UBR2DBD4BR2"
      CASE "?": DRAW "BU4RUR2FDGLBD2R0BR4"
      CASE "'": DRAW "BU4EUBR4BD6"
      CASE "-": DRAW "BU3R4BD3BR2"
      CASE "/": DRAW "E5BD5BR2"
      CASE "$": DRAW "BUR2NDREHL2HERNUR2BD5BR2"
      CASE "!": DRAW "BRR0BU2NU4ENU2BD3BR3"
      CASE " ": DRAW "BM+8,0"
    END SELECT
  NEXT

END SUB

SUB FontPrintBorder (x, y, FontColr, BorderColr, Text$)

  DRAW "BM" + STR$(x + 1) + "," + STR$(y + 6) + "C" + STR$(BorderColr)
  FOR i = 1 TO LEN(Text$)
    Char$ = UCASE$(MID$(Text$, i, 1))
    SELECT CASE Char$
      CASE "A" TO "Z": DRAW "X" + VARPTR$(Font$(ASC(Char$) - 29))
      CASE "1" TO "9": DRAW "X" + VARPTR$(Font$(ASC(Char$) + 14))
      CASE "0": DRAW "X" + VARPTR$(Font$(62))
      CASE ",": DRAW "UEFDG2HEBR3"
      CASE ".": DRAW "EFNGBR"
      CASE CHR$(34): DRAW "BU3HUEFDNFUEFDBD4BR"
      CASE "?": DRAW "BU3HE2R2F2DG2LFGHEHENRNENULBR5BD3"
      CASE "'": DRAW "BU3HEUEFDNGBD5BR3"
      CASE "-": DRAW "BU2NR4HER4FBD3BR"
      CASE "/": DRAW "BDHE6FG6BUBR7"
      CASE "$": DRAW "NRHER3L2H2E3FRFGNL3DFG3BR4BU"
      CASE "!": DRAW "FEH2U4EF2D2GBR3BD2"
      CASE " ": DRAW "BM+8,0"
    END SELECT
  NEXT
  FontPrint x, y, FontColr, Text$

END SUB

Turns out punctuation was hard coded into the program and not stored in the font file. That's why there's all those special cases.
Wow! Neat.

You must have done similar things before already to make this code.

I did notice that the punctuation was in this to as I tried them.

What exactly does "hard coded into the program" mean?
By "hard coded" I mean that the font info (the draw strings) for punctuation were stored in the actual program code and not in the separate file with the rest of the font. (The font file has A-Z, 1-9 solid and outlined.)

I got the punctuation font info from the original program by unpacking PAGA1.001 with UNLZEXE and poking around until I found some draw strings.
So I take it you have the Shareware version or own the game.

I was hoping you would put the puntuation in for me like that. Would have taken me forever to figure out how to do all that in order to get the fonts on the screen.

Thanks

Anyways, Frenkel was having trouble with finding what he wanted in these files or something to that affect.

He has used the UNLZEXE progame.

I would like to know one thing however, since you seem to have such great access to all these files for Paganitzu.

That is for when Alabama dies by the Snake firing at him and Alabama turns into a bunch of ashes and falls down.

There seems to be a graphic effect of the smoke that comes up from the ashes afterwords that I have not seen in the PCX files, EGA CGA grapics.

Is there a possibility this could be in the EXE files somewhere and if so can you show it to me so I can put it in my QB conversion of the game?
These are the only other "DRAW" graphics in the EXEs:

Code:
SCREEN 7

' Some music/sounds
'PLAY "mfo4l20t150cdefgmb"
'PLAY "mbl64t255o2fgo1fg"
'PLAY "mbt255l64o3acego4acego5aceg"

' Score boxes
'DRAW "C3BM8,44L2G2D11F2R39E2U11H2L2"
'DRAW "BM11,14L5G2D11F2R39E2U11H2L5"
'DRAW "BM9,75L3G2D18F2R39E2U18H2L2"
'DRAW "BM9,113L3G2D11F2R39E2U11H2L2"
'DRAW "BM11,143L5G2D18F2R39E2U18H2L5"

' left arrow
'DRAW "BU3BR2NE2NF2R4BD3BR3"

' down arrow
'DRAW "BM172,171H3R2U5R2D5R2G3"

' right arrow
'DRAW "C2H3D2L7D2R7D2E3"

' plus sign
'DRAW "C10NU2ND2NL2NR2"

' yellow menu arrows
'DRAW "C14H3D2L7D2R7D2E3BR109E3D2R7D2L7D2H3"

' green menu arrows
'DRAW "C2H3D2L7D2R7D2E3BR109E3D2R7D2L7D2H3"

The smoke effect is probably done with PSETs, so there's no way to get that from the code as it is. You're probably better off taking some screen caps in slow motion with DOSBOX and recreating it yourself.
Nice! This is getting even better than I thought it could.

Well that's 3 sounds from play statements that I don't have to reinvent by ear. Although I did get pretty close on alot of them.

I was wondering however if you could find any more play statements or sound statements in the EXE files?

If you can not find any more then I might need to send you the EXE's of the second game because some of the sound effects are similar.

Or maybe you can get me that UNLZEXE program and I could do it.

But don't give it if it takes too much thinking to find that stuff.
Those are all I can find. The other sounds are probably just sound statements, not play strings, so I can't get those from the EXE. The other episodes probably used the same engine, so I doubt I'll be able to find any more sounds in those.

(You can get UNLZEXE from here.)
Pages: 1 2