Hey heeeeeeeeeeey !!! =)

So my dream becomes true... we have working, full-featured Quake for our 
little, 060-powered, birds !

========
Features
========

- 320x200, 256 colours

- VGA or RGB

- 24 kHz 16bit stereo sound

- full mouse support

- 060 optimized rendering routines

- TOS/MagiC/FreeMiNT friendly

- runs in 99% time in user space so you can use memory protection, 
  background audio (yeah, you can run aniplayer and then quake...) etc.

- support for some Eiffel keys -- '~', PageUp, PageDown, Home, End, 
  MouseWheelUp, MouseWheelDown, Pause


=============
Release Notes
=============

There's a few things you should know before running:

1. Best and recommended configuration to run is FreeMiNT + Falcon 060. On 
   anything else you'll become worser performance and/or lack of some 
   features.

2. I _DON'T CARE_ about ARAnyM. If it runs, fine, if not, you're out of 
   luck. Don't try to ask me why it doesn't work :) This release is meant 
   as gift to loyal Atari fans who gave a lot of money for that 060 
   miracle and I want to thank them and make them happy in this way :)

3. Since TOS and MagiC lacks of gettimeofday() functions (POSIX functions 
   to get very precise time) this function has to be "emulated" -- see 
   "Command line" for more details.

4. Both shifts behave as one key (dunno why ID guys don't use two shifts ;)

5. Networking is disabled (with "-record" and "-playback" options as well) 
   -- I haven't got my EtherNATs yet so I can test it. Sorry.


============
Command line
============

Except mentioned "-record" and "-playback" there are all command line 
parameters available as in original pc version. The most important ones:

-nosound: disable all sound activity

-nomouse: ignore mouse movement and buttons

-mem <size>: set memory heap. Default is 48 MB, minimum is 8 MB

Except this I added new, in my opinion very missing, ones:

-mouselook: use mouselook all the time. Dunno if I'm blind but I didn't 
            find this one in Options menu. And it's very, very handy if 
            you use step left/right instead of move left/right!

-frametime <number>: Quake uses time spent with rendering as input 
                     parameter for next frame. I'm not sure what exactly 
                     it does but important is that you can't get this 
                     number under TOS/MagiC since they aren't able to 
                     return time in miliseconds. So this number tells what 
                     value should be used instead. Default is 0.1 but... 
                     you'll see the game is in some place pretty fast :) 
                     So you maybe need to play with this number a little 
                     bit... or to install FreeMiNT where is used correct 
                     time all the time :)

All the others you can find using google...


==========
Background
==========

The first lines/attempts were done at Glucholazy demoparty in Poland. 
There I decided to make this port. My first approach was to take Amiga 
sources (which are free available thanks to GNU GPL) and just change "a 
few lines" to port it to Atari. Hahahah =)

After some days I went to Norway/Sweden/Finland for about one month so I 
didn't touch it -- I only decided to download ID's original sources since 
in the Amiga version I just commented out again and again...

After the return to home I began with the work... I was pretty surprised 
how fucking portable is this beast. ID guys are real masters in this job! 
After 2-3 days I've got my first version (no keyboard, just showing 3 
demos). After another 2-4 days I've got keyboard support (using hook on 
IKBD since there's no chance how to get message about releasing keys on 
keyboard) -- thanks Patrice Mandin for the tip about saving registers :), 
sound and mouse support.

And the biggest shit was just awaiting... since I've got Amiga version 
(even versions -- there are two independent ports for Amiga!) I decided to 
include their m68k rendering routs (even PC version contains a lot of asm 
code -- C only version is for about two times slower!) but ... all the 
sources are in well-known Devpac syntax... and GNU AS uses what? Its own, 
strange, uncomfortable and features-missing syntax...

So I began to work on devpac2gas converter... I was pretty far (and my 
skills in sed, awk and perl increased a LOT :) and then ... I deleted 
*ALL* my quake sources -- of course, no backup ;)))

(from this I situation I took one thing: NEVER INCLUDE 'rm -rf' COMMAND IN 
YOUR SHELL SCRIPT !!!!!!!!!!!!! ;-)

Ok, so all the work again.... argh!!! I started at Saturday 18:00 and 
ended on Sunday 05:00 with basic work... another day spent with more 
precise devpac2gas converter... on Monday I finally got compilable m68k 
sources for GNU AS.

So I replaced C functions with their asm equivalents and ... game hangs :) 
Another day spent on finding what fucked up. Curious? It was ... fucking 
.x size in floating point instrucions. I thought it's 80 bit long and no, 
it's 96 bit :) So stack totally fucked up. Interesting thing is some 
functions worked and some semiworked when I tested each function 
separately... you can imagine that 'fun' in bug finding :)

(if you wonder how it's possible original amiga sources were ok -- GNU AS 
lacks of rsreset/rs.<size> and setso/so.<size> directives so it needs to 
be calculated on the fly and converted to definitions (!), not speaking 
about local -> global labels conversion -- yep, perl fucking rulez)

OK, stack corrected thanks to little change in perl script. Again included 
all asm files and ... no, game not hangs ... game doesn't show walls, 
weapon nor textures ;) So _AGAIN_ something fucked up. Another two days 
spent with bug hunting. Curious again? :) GNU AS BUG. Yes, you're reaging 
correctly. That motherfucker badly calculates integers if they are used as 
floats (e.g. fmove.s #65536,fp0 has to be replaced with fmove.l 
#65536,fp0).

OK, again all fixed and ... the last one bug ... the enemies are visible 
thru the walls :) Nooooooo.... but I've got a luck it took me just 4 hours 
to find a bug :) Curious, hm? ;) AGAIN FUCKING GNU AS BUG. It isn't able 
to translate long constant bigger than 2 billions (e.g. fmove.l 
#65536*32768, fp0) -- fucking sign overflow problem. Argh!!!!!!!!!!!

And that's it. After this fix game, finally, runs in brutal framerate :) 
Please, keep in mind, when you'll play this game HOW FUCKING HARD WAS TO 
MAKE THIS PORT. It wasn't just copy&paste thing ;)


============
Future Plans
============

- double/triple buffer

- use tricky c2p from Amiga, these guys are using some kind of "compare
  c2p" so 16bit databus transfers less data

- 16bit colour depth (yes, this is possible very easy)

- more resolutions (320x200 isn't the max possible one :)

- joystick support?

- cd audio?

- networking


=======
Credits
=======

PC game and sources: ID Software
68060 routs:         Frank Wille
The rest:            Miro Kropacek (me :)


===========
Final words
===========

Enjoy! ;)


Miro Kropacek aka MiKRO / Mystic Bytes
miro.kropacek@gmail.com (my old address mikro@hysteria.sk is working, too 
                         but please use this one instead)

2006/09/06,01:45
Bratislava, Slovakia
