home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-10-31 | 7.8 KB | 222 lines | [TEXT/MPS ] |
- MacWT v0.04 QUICK NOTES
-
- A quickie port of Chris Laurel’s “wt” experiment to the Macintosh.
-
- =======================
- New 0.04 Info at bottom
- =======================
-
-
- About “wt”
- ==========
-
- Chris Laurel on “wt”:
- “ wt is my portable 3D game engine. It is by no means a complete
- and ready-to-go game. Right now, it is little other than a demo of the
- graphics engine’s capabilities. While wt does look similar in many
- respects to Id Software's game DOOM, it is not in any way connected.”
-
- wt runs on X-window Unix systems, PeeCees, and now, the Macintosh.
-
- Note! wt is a real CPU hog.
- For best results, use a 68040 (or better yet, an 060 :-).
-
- This was built with Chris's "wt" version 0.03 distribution.
-
- For more information on the "wt" project, please read the posting
- from Chris Laurel entitled "wt Update".
-
-
- About the Macintosh port
- ========================
- This was quickly hacked together (as if you couldn't guess.)
- The "wt" distribution REQUIRES 32-bit "int"s, and currently
- has a few types (e.g., "Region") which clash with the Mac's.
- So Precompiled Headers for all sources are out; I have to
- manually include them at the start of each of the Mac-specific
- C files (there are only 3, so its not too bad.)
-
- Most of the work was done in Metrowerks, an environment I can heartily
- recommend (especially in the light of my experiences with THICK C.)
-
- Organisation of Sources
- =======================
- MacMain.c -- macintosh main program for the game
- MacWT.c -- macintosh functions used by "base" wt
- MacGame.h -- shared between MacMain.c and MacWT.c
- WT.µ -- Metrowerks project file for MacWT
- MacWT -- the Metrowerks version of the MacWT application
- mac_wt.h -- Hack alert: how I bolt onto the "base" wt
- wt -- this folder contains the "wt" distribution (v0.03)
- WT.µ.rsrc -- Resource file
- WT.π -- Think C 7 project file for MacWT
- turlsLibs -- various files of mine needed to build MacWT
- Mac README -- this file
- wt Update -- A posting to rec.games.programmer" from Mr. Laurel
-
-
- NB: I HAVE HAD TO MODIFY THE "BASE" wt DISTRIBUTION;
- USE THIS BUILD SYSTEM AT YOUR OWN RISK UNTIL CHRIS LAUREL ACCEPTS MY
- MODS INTO HIS "BASE".
-
-
- I get about 6-7 frames per second (just sitting there) on my Centris
- 650 (a stock 25MHz 68040.) That's in a teensy 320x200 window with
- direct screen writes on (i.e., bypassing QuickDraw)! Zooming doubles
- every pixel to give a 640x400 but (as you can imagine) slows us down
- somewhat. Direct screen writing ONLY WORKS WITH 8 BITS PER PIXEL; the
- user interface for this is a bit noddy at the moment. I'll fix it during
- the week.
-
- When moving around, you get some squiffy bits passing thru walls and
- doors or passing thru the ceiling when you jump, so there's definitely
- something wrong on this front.
-
- The THICK C version is quite happy if you're just sitting there (you get
- about 4-5 fps.) Unfortunately, it's CRASH AND BURN TIME if you walk thru
- a wall or whatever.
-
-
- Project File
- ============
-
- My Project file (in case you want to roll your own and can't use mine):
-
- You need a "-D macintosh".
-
- Seg#1: MacMain.c <Main program, event loop, etc. Not brilliant.>
- MacWT.c <Routines needed by the "base" WT system>
- :turlslib:Failure.c <a handy printf-like _DebugStr>
- :turlslib:FixMulDiv.c <68K asm for Fixed-point muls/divs>
- :turlslib:DirScrnWrite.c <Handy direct-screen writing stuff>
- <NB: ONLY 8-bit at the moment, sorry>
-
- :wt:fixed.c <Leave all WT files in their own folder.>
- :wt:framebuf.c <This makes it easier to just hide the old>
- :wt:list.c <"wt" folder and replace it with a newer one!>
- :wt:render.c
- :wt:table.c
- :wt:texture.c
- :wt:view.c
- :wt:world.c
- :wt:worldfile.c
- :wt:wt.c
- :wt:wtmem.c
-
- Seg#2:
- MacTraps or MacOS.Lib
- ANSI library (SUITABLE FOR 4-BYTE INTS!)
-
- Resource file: WT.µ.rsrc
-
-
- Modified BASE FILES
- ===================
- "BASE" Files I have modified (all in the "wt" folder...)
-
- wt.h -- include "mac_wt.h" if we're being compiled on a Mac.
- texture.c -- Allow texture palette indices to be adjusted on a Mac.
- worldfile.c -- Macs don't use Unix pathnames.
- render.c -- undefine PROFILE and TEST_ASM if we're a Mac.
- fixed.h -- allow hosts to override the supplied fixmul/div routines.
-
- DEFINITIONS I HAVE INTRODUCED
- =============================
- If you're compiling on a Mac, define "macintosh" so my hack regarding
- inclusion of "mac_wt.h" in "wt.h" works. Metrowerks is taken care of by
- explicitly checking for __MWERKS__.
-
-
- Plans
- =====
- • THINK C v5, v6 project files (if I can find TC5 and 6!)
- • MPW C, Gnu C makefiles
- • Tidy up horrible hacks (no Precompiled headers?)
- • Why does the THICK C 7 version crash horribly when you pass thru
- a wall/door/ceiling?
- • Better fixed-point multiply routines (currently using _FracMul.)
- • A PowerPC version -- should be a doddle with Metrowerks.
- Possibly even an "xlc" version!
-
-
- --turly
-
- Any Mac-specific issues/bug reports/fixes, etc, should be addressed to:
- "turly@isltd.insignia.com". I will do my best to fix all reported bugs
- and pass them on to Mr. Laurel for inclusion in a future "base" distribution.
-
- Any "base" wt issues/bug reports/fixes, etc, should be mailed to the
- "wt" project mailing list (join by mailing "wtm-request@magoo.uwsuper.edu")
- See the "wt Update" document for more details.
-
- Have fun!
-
-
- =====================
- New 0.04 Info, 11-May
- =====================
- Sorry folkz, this is a bit quick. I've got a 4 mile walk home and I'd like
- to reach there before 2:30AM!
-
-
- Basically, we now do PowerPC (easy with Metrowerks, new project supplied.)
- I make my fat binaries with Metrowerks by a brute force method -- open up
- the 68K and PPC apps using ResEdit and copy everything in the 68K one to
- the PPC one! Dirty, but it works.
-
-
- MPW C (68K) -- very disappointing. My inline 68K asm FixMul etc. bust MPW C.
- And as for MPW C's "optimiser" -- Oh dear! Let's just forget it, shall we?
-
-
- MPW PPCC -- reasonable, if the optimiser worked on the ONE file that really
- needs it, "render.c". I've had to turn off optimisation for that file.
- See "MacWT.fat.make" for more details.
-
-
- GNU C -- haven't a clue, as the version I have (1.371r15) dies horribly. I
- haven't looked at it since I first tried it because I wanted to get the PPCC
- version working. On my "to-do" list.
-
-
- THICKC7 -- The more I use it, the more I loathe it!
- Current Proj file should work OK (albeit slowly.)
- As a matter of interest, can I get THICK C to load a precompiled header file
- from within a header file? (As in "LoadMacHeaders.h"?) THINK experts??
-
-
- General -- thanks to Al Evans (al@crucible.powertools.com) for pointing out
- the lines I managed to miss when extracting the direct screen writing stuff
- from my C++ TDirScrn lib: basically, copy the screen colortable's ctSeed
- to the offscreen pixmap's colortable. This means that _CopyBits is now as
- fast as my hacky direct screen writing -- for 320x200. When we scale up to
- 640x400, direct screen writing is still 2x faster on both 68K and PPC Macs.
-
- Al also looked into why THICK C falls over and found something in "slice.c".
- Unfortunately, "slice.c" has changed between 0.03 and 0.04. I added an
- "#ifdef PARANOID" around a check for 'nPix < 0'. "mac_wt.h" now defines
- PARANOID. THICK C seems to produce much better results if we don't use
- my inline asm versions of _FixMul, etc.
-
- You can have lots of fun running various experiments with the settings in
- "mac_wt.h". See the various comments, etc, there!
-
-
- • NOTE • Chris Laurel (wt's author) said that he'd try to incorporate my
- mods to ease Mac porting in wt-0.05. So you should:
-
- USE THIS BUILD SYSTEM AT YOUR OWN RISK UNTIL CHRIS LAUREL ACCEPTS MY
- MODS INTO HIS "BASE".
-
- Anyway, have fun again!
-
- --turly
-
- Oh, and PS, does anyone know if the PowerPC's _FixMul and _FracMul are
- native? 'Cos if they are, hmmmm....
-
-
-
- Turlough O'Connor, Insignia Solutions Ltd, High Wycombe, Bucks, UK.
- turly@isltd.insignia.com
-