Skip to content

Commit 0126d18

Browse files
committed
Atari Quake 1.01
1 parent d44c401 commit 0126d18

18 files changed

+553
-162
lines changed

CHANGES

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
1.01
2+
====
3+
4+
- fixed bug with setting RGB resolution
5+
6+
- compiled with gcc-3.3.6 -m68060 -O3 => better performance (maybe ;)
7+
8+
- HELP/UNDO keys renamed back to F11/F12 (to make .cfg files happy)
9+
10+
- added m68k sprite drawing routine from another amiga port => better speed
11+
12+
- support for another version of shareware edition (thanks to Patrice Mandin)
13+
14+
- sound system is now stored and restored completely
15+
16+
- mouse is handled in more sensible way (moving forward doesn't look like snail :)

Makefile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ BUILD_RELEASE_DIR=release
1313

1414
M68KASM_DIR=asm68k
1515

16+
CC=gcc
17+
CC3=gcc-3.3.6
18+
1619
BASE_CFLAGS=-Dstricmp=strcasecmp -DM68K_MIX -DM68KASM
17-
RELEASE_CFLAGS=$(BASE_CFLAGS) -g -Wall -m68020-60 -O2 -fomit-frame-pointer
18-
DEBUG_CFLAGS=$(BASE_CFLAGS) -g -Wall -m68020-60
20+
RELEASE_CFLAGS=$(BASE_CFLAGS) -g -Wall -m68060 -O3 -fomit-frame-pointer
21+
DEBUG_CFLAGS=$(BASE_CFLAGS) -g -Wall -m68060
1922
LDFLAGS=-lm
2023

21-
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
24+
DO_CC=$(CC3) $(CFLAGS) -o $@ -c $<
2225
DO_AS=$(AS) -m68060 -o $@ $<
2326
DO_DEVPAC2GAS=$(MOUNT_DIR)/devpac2gas.perl $< > $@
2427

@@ -138,7 +141,8 @@ QUAKE_M68K_OBJS = \
138141
$(BUILDDIR)/obj/r_draw68k.o \
139142
$(BUILDDIR)/obj/r_alias68k.o \
140143
$(BUILDDIR)/obj/d_polyset68k.o \
141-
$(BUILDDIR)/obj/d_scan68k.o
144+
$(BUILDDIR)/obj/d_scan68k.o \
145+
$(BUILDDIR)/obj/d_sprite68k.o
142146

143147

144148
$(BUILDDIR)/quake.ttp : $(QUAKE_OBJS) $(QUAKE_M68K_OBJS)
@@ -420,7 +424,10 @@ $(BUILDDIR)/obj/r_draw68k.o: $(MOUNT_DIR)/r_draw68k.s quakedef68k.i
420424

421425
$(BUILDDIR)/obj/r_bsp68k.o: $(MOUNT_DIR)/r_bsp68k.s sincos.bin quakedef68k.i
422426
$(DO_AS)
423-
427+
428+
$(BUILDDIR)/obj/d_sprite68k.o: $(MOUNT_DIR)/d_sprite68k.s
429+
$(DO_AS)
430+
424431
#####
425432

426433

@@ -472,6 +479,9 @@ $(MOUNT_DIR)/r_draw68k.s: $(M68KASM_DIR)/r_draw68k.s
472479
$(MOUNT_DIR)/r_bsp68k.s: $(M68KASM_DIR)/r_bsp68k.s
473480
$(DO_DEVPAC2GAS)
474481

482+
$(MOUNT_DIR)/d_sprite68k.s: $(M68KASM_DIR)/d_sprite68k.s
483+
$(DO_DEVPAC2GAS)
484+
475485
#############################################################################
476486
# MISC
477487
#############################################################################

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ just a few notes...
1111
- the source includes very sophisticated devpac to gnu as converter, you
1212
need a perl package from sparemint distribution to run it
1313

14-
- it's possible you'll get some compile errors -- i use some own <mint>/*
14+
- it's possible you'll get some compile errors -- i use some own <mint/*>
1515
includes (with constants from Atari Compendium) -- drop me a line if
1616
you're interested
1717

asm68k/d_sprite68k.s

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
; 680x0 optimised Quake render routines by John Selck.
2+
3+
XREF _d_ziorigin
4+
XREF _cacheblock
5+
XREF _bbextents
6+
XREF _bbextents
7+
XREF _sadjust
8+
XREF _d_sdivzstepu
9+
XREF _d_sdivzstepv
10+
XREF _d_viewbuffer
11+
XREF _d_sdivzorigin
12+
XREF _d_tdivzstepu
13+
XREF _d_tdivzstepv
14+
XREF _d_pzbuffer
15+
XREF _d_zwidth
16+
XREF _d_tdivzorigin
17+
XREF _tadjust
18+
XREF _bbextentt
19+
XREF _cachewidth
20+
21+
XDEF _D_SpriteDrawSpans
22+
23+
;void D_SpriteDrawSpans (sspan_t *pspan);
24+
25+
cnop 0,4
26+
_D_SpriteDrawSpans:
27+
fmovem.x fp2-fp5,-(sp)
28+
29+
fmove.s _d_ziorigin,fp2
30+
fmove.l #65536,fp3
31+
fdiv.x fp2,fp3 ; z
32+
33+
movem.l d2-d7/a2-a6,-(sp)
34+
move.l (4+4*12+11*4,sp),a6
35+
move.l _cacheblock,a0 ; pbase
36+
37+
fmul.l #32768,fp2
38+
39+
move.l _bbextents,a4
40+
move.l _sadjust,a5
41+
42+
fmove.l fp2,d6 ; izi
43+
.ls1
44+
move.l 8(a6),d7 ; count
45+
ble.w .skip
46+
47+
move.l (a6),d0
48+
fmove.l d0,fp4 ; du
49+
50+
fmove.s _d_sdivzstepu,fp0
51+
fmul.x fp4,fp0
52+
move.l 4(a6),d1
53+
fmove.l d1,fp5 ; dv
54+
fmove.s _d_sdivzstepv,fp1
55+
fmul.x fp5,fp1
56+
move.l _d_viewbuffer,a1
57+
move.l d1,d2
58+
add.l d0,a1
59+
fadd.x fp1,fp0
60+
fadd.s _d_sdivzorigin,fp0 ; sdivz
61+
62+
fmove.s _d_tdivzstepu,fp1
63+
fmul.x fp4,fp1
64+
mulu.l _screenwidth,d2
65+
add.l d2,a1 ; pdest
66+
fmove.s _d_tdivzstepv,fp2
67+
fmul.x fp5,fp2
68+
move.l _d_pzbuffer,a2
69+
move.l d1,d2
70+
mulu.l _d_zwidth,d2
71+
fadd.x fp2,fp1
72+
fadd.s _d_tdivzorigin,fp1 ; tdivz
73+
74+
fmove.x fp0,fp4
75+
fmul.x fp3,fp4
76+
add.l d0,d2
77+
moveq #-1,d1
78+
add.l d2,d2
79+
move.l d7,d0
80+
add.l d2,a2 ; pz
81+
subq.l #1,d0
82+
fmove.l fp4,d2
83+
fmove.l d0,fp4 ; spancountminus1
84+
fmul.x fp3,fp1
85+
86+
add.l a5,d2 ; s
87+
88+
cmp.l a4,d2
89+
ble.b .s0
90+
move.l a4,d2
91+
bra.b .s1
92+
.s0
93+
tst.l d2
94+
bpl.b .s1
95+
moveq #0,d2
96+
.s1
97+
fmove.l fp1,d3
98+
fmove.s _d_sdivzstepu,fp5
99+
fmul.x fp4,fp5
100+
add.l _tadjust,d3 ; t
101+
102+
move.l _bbextentt,d0
103+
cmp.l d0,d3
104+
ble.b .s2
105+
move.l d0,d3
106+
bra.b .s3
107+
.s2
108+
tst.l d3
109+
bpl.b .s3
110+
moveq #0,d3
111+
.s3
112+
fadd.x fp5,fp0
113+
fmul.x fp3,fp0
114+
swap d3
115+
muls.w _cachewidth+2,d3
116+
move.l a0,a3
117+
move.l a4,d0
118+
add.l d3,a3
119+
fmove.l fp0,d4
120+
add.l a5,d4
121+
122+
cmp.l d0,d4
123+
bgt.b .s4
124+
moveq #8,d0
125+
cmp.l d0,d4
126+
bge.b .s5
127+
.s4
128+
move.l d0,d4
129+
.s5
130+
131+
move.l d7,d0
132+
subq.l #1,d0
133+
ble.b .sd
134+
sub.l d2,d4
135+
divs.l d0,d4
136+
.sd
137+
.ls0
138+
move.l d2,d0
139+
swap d0
140+
move.b (a3,d0.w),d3
141+
cmp.b d1,d3
142+
beq.b .ss
143+
cmp.w (a2),d6
144+
ble.b .ss
145+
move.w d6,(a2)
146+
move.b d3,(a1)
147+
.ss
148+
add.l d4,d2
149+
addq.l #2,a2
150+
addq.l #1,a1
151+
subq.l #1,d7
152+
bgt.b .ls0
153+
.skip
154+
add.w #12,a6
155+
moveq #-128,d0
156+
cmp.l 8(a6),d0
157+
bne.w .ls1
158+
159+
movem.l (sp)+,d2-d7/a2-a6
160+
fmovem.x (sp)+,fp2-fp5
161+
rts

common.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ extern float FloatSwap(float);
5151
// if a packfile directory differs from this, it is assumed to be hacked
5252
#define PAK0_COUNT 339
5353
#define PAK0_CRC 32981
54+
#define PAK0_CRC2 62751
5455

5556
char com_token[1024];
5657
int com_argc;
@@ -1700,7 +1701,7 @@ pack_t *COM_LoadPackFile (char *packfile)
17001701
CRC_Init (&crc);
17011702
for (i=0 ; i<header.dirlen ; i++)
17021703
CRC_ProcessByte (&crc, ((byte *)info)[i]);
1703-
if (crc != PAK0_CRC)
1704+
if (crc != PAK0_CRC && crc != PAK0_CRC2 )
17041705
com_modified = true;
17051706

17061707
// parse the directory

d_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2222
#include "quakedef.h"
2323
#include "d_local.h"
2424

25-
#undef M68KASM
25+
//#undef M68KASM
2626

2727
#define NUM_MIPS 4
2828

d_sprite.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2020
// d_sprite.c: software top-level rasterization driver module for drawing
2121
// sprites
2222

23+
//#undef M68KASM
24+
2325
#include "quakedef.h"
2426
#include "d_local.h"
2527

2628
static int sprite_height;
2729
static int minindex, maxindex;
2830
static sspan_t *sprite_spans;
2931

32+
#ifndef M68KASM
3033

3134
/*
3235
=====================
@@ -187,6 +190,8 @@ void D_SpriteDrawSpans (sspan_t *pspan)
187190
} while (pspan->count != DS_SPAN_LIST_END);
188191
}
189192

193+
#endif
194+
190195

191196
/*
192197
=====================

draw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ void Draw_ConsoleBackground (int lines)
558558
sprintf (ver, "(Linux Quake %2.2f) %4.2f", (float)LINUX_VERSION, (float)VERSION);
559559
dest = conback->data + 320*186 + 320 - 11 - 8*strlen(ver);
560560
#elif defined(__MINT__)
561-
sprintf (ver, "(Atari Quake %2.1f) %4.2f", (float)ATARI_VERSION, (float)VERSION);
561+
sprintf (ver, "(Atari Quake %2.2f) %4.2f", (float)ATARI_VERSION, (float)VERSION);
562562
dest = conback->data + 320*186 + 320 - 11 - 8*strlen(ver);
563563
#else
564564
dest = conback->data + 320 - 43 + 320*186;

0 commit comments

Comments
 (0)