From: msmakela@cc.helsinki.fi
Newsgroups: comp.sys.cbm
Subject: Utilize your Commodore 64
Date: 21 Nov 92 22:07:47 GMT
Organization: University of Helsinki

GamePreProcessor - Commodore 64 utility program

A brief introduction

GamePreProcessor turns your C64 into a game computer. You may play a game in
another computer and store the joystick movements simultaneously. The control
sequence may be repeated afterwards.

The cable

You need a cable between the two computers. One end goes to the C-64 user port
and the other to the another computer's or game console's Atari-style control
port. The pins to be connected are following:

User port           Joystick connector
C                   1
D                   2
E                   3
F                   4
H                   6
A                   8

Operation

Storing a movement sequence is started by pressing C. The game is plaid with a
joystick connected to the control port #2. The amount of free memory, the
time elapsed from the latest movement and the joystick position are shown on
the screen.

With a joystick in port 1 (or with the keys ConTRoL, left-arrow, 1, 2 and 
space) you may control the auto-playing features. If you push fire, the 
autofire switches on. While keeping the fire button down, you can change
the fire button down time by turning left or right, and the up time by turning
up or down. The autofire switches off when you push fire on the main joystick.
There are also up-down and left-right vibrations, which come in handy in
sports games. By turning left or right on the feature joystick the left-right
vibration switches on and its rate may be changed. The vibration may be stopped
by turning left or right on the main joystick. The same goes for the up-down
vibration. The two vibrations may be combined to form a rotating vibration,
north, northeast, east, southeast, south, southwest, west, northwest and so on,
which is required in the Summer Games cycling.

The storing mode is ended upon memory shortage or by punching Restore.
The sequence may be saved by pressing S. The filename, which has a suffix
of ",;", is changed by pressing N, using DELete and writing keys and RETURN.
With L you may load the sequence. These operations go to the last active
device before program startup, usually the disk drive. If you insist to use
cassette, poke 1 to $BA by ordering POKE 186,1 before running.

By pressing M and using DELete, number keys and RETURN you may change the 
movement counter in order to start repeating a sequence from the middle or to 
destroy the end or the whole of old sequence before appending new. The
repetition of existing sequence starts with R and ends as the sequence ends
or by pressing RESTORE.

You can also change the sampling rate by pressing F. You can change the divisor
of the high clock frequency of the Commodore 64 (in PAL models 985 248 Hz, in
NTSC models approximately 1,02 MHz). It may be between 13 568 and 65 529 
(65 529 instead of 65 535 or 65 536 to shorten the program. The low limit could
be lowered in NTSC systems.), which results in a sampling frequency of 15,0 Hz
up to 72,6 Hz. The optimal frequency may be50 Hz in PAL models, which 
corresponds divisor $4CC7 = 19 655, and 60 Hz in NTSC models, which corresponds
approximately a divisor of 1,02 MHz / 60 Hz = 17000. An interesting but useless
effect is recording with a low sampling rate and increasing the speed before 
repeating. 
The recording eats memory even if you don't touch the joystick. This is
shown on the top of the screen (accurately for PAL systems), and it is smaller
at higher sampling frequencies. If you play BASIC-games, you may want to lower
the frequency to save memory.
With the highest sampling rate the memory is consumed in 5 minutes 
and 37 seconds in PAL model, when vibrations are running at full speed.

Patching

If you just want to use the program as a joystick booster (autofire and
sports game oscillator) and do not want the game to stop as the memory gets
filled, poke 173 (LDA) instead of 141 (STA) in the address, which is followed
by the bytes 64 ($40) and 5. (I don't have the program available just now.)
The new version may be saved on a different name.

Have fun with this program. I had enough fun when writing it with a machine
language monitor and keeping correcting absolute memory references when moving
the code to gain more space. (Real men don't use Assembler.)

The program follows in UUencoded form.

begin 644 GamePreProcessor
M 0@>",<'GC(P.# BC9$='1T=34%22T\@34%+14Q!    >*4!*?@)!H4!H ",
M&M",#]R, ]R(C +<C /=J7^-#=R-#=VI@8T-W*T-W*T-W:E^C10#J>J-%0.I
MT8T8 ZD,C1D#6""!_Z( CB#0CB'0H(",D0*(C(H"K9\.G0#8G0#9G0#:G0#;
MRM#QJ:F%^ZD.A?R@ K'[JHBQ^S SJ!BE^VD"A?N0 ^;\&"#P_Z(#H #F^] "
MYORQ^_#8I-/FTY'1R2#PZ+V>#I'SRA#BZ/#?HBBI0,J=* 2=D 6=@ :=^ ;0
M\:GIC5($C: $J=^-4P2-I02I7XW(!(T:!:EIC<T$C1L%J>&->@2-\@2I88U[
M!(WS!*(#O:(.G:$$O:8.G<D$RA#QH &B Y3WE/O*$/FI (V9$*DUC9H0J9N%
MK(6NJ1"%K86OJ0"1KH6=B*D?D:Z% B"2"B#$"ZD!IKJH(+K_H!#*T :I$**)
MT 2I$J*'(+W_J0 @&@P@Y/_)3=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   /#B M( ,( 0X'!2 &"0P%( X!#04@!A(/#0  
M$08@+2 #" $.!P4@$@4##Q($"0X'( 82!1$5!0X#&2 &$@\-  02.3@U,C0X
M(!(% P\2! D.!Q,@+P >$A,% P\.!!,  !0#("T@ P\.% D.%04@$@4##Q($
M"0X'   6$B M(!(%$ 4!%" *#QD3% D#"R -#Q8%#04.%" 3!1$5!0X#!0  
M& T@+2 -#P0)!AD@#0\6!0T%#A0@ P\5#A0%$@ ""0D."10 _T]03'H3% \0
J:DUJ3A , 1E524I+$@4#( \&!E)44*("0#I415-4(%)53J"@H*"@H*R[
 
end
Newsgroups: comp.sys.cbm