Jump to content
IGNORED

New game port on the way - Gr......er


Heaven/TQA

Recommended Posts

oh...and another side story... it seems Jeff wrote the game on paper... as I found this in the code, too...

 

lda $30,x or sta $30,x has been assembled to 3 byte commands instead of 2 bytes... so no gain here but using zeropage... (normally this would be assembled to 2 byte commands...)

Link to comment
Share on other sites

rockets work...

 

hole bug fixed.

 

I've enjoyed watching this one "come to life". A couple of points on the latest build (I've only played on the emulator - not real kit yet) :

 

1) If I move to the extreme right of the playfield my ship disappears.

2) As soon as I loose a life the game stops.

 

Can't wait to play it on my 800XL :)

 

Just looked in the monitor and this could be the reason why things stop:

 

Atari800MacX Monitor

Type '?' for help, 'CONT' to exit

0 1 323E: 4C 3E 32 JMP $323E

A=01 S=f9 X=00 Y=00 P=-V*B--Z-

> d 323e

323E: 4C 3E 32 JMP $323E

Edited by spookt
Link to comment
Share on other sites

oops... debug code still in place... ;)

 

intermission screen fixed btw... try this build...

 

ps. the "offscreen" is mainly caused by that I haven't applied the 22-to-20 patch which is needed... so the game runs still in vic-20 standard resolution (22x23).

post-528-1245795176_thumb.png

gridrunner.zip

Edited by Heaven/TQA
Link to comment
Share on other sites

played around little bit with the sound... someone with an idea how to quickly convert from vic to pokey?

 

HOW MUSIC WORKS ON THE VIC

 As already mentioned, the VIC's speakers each cover 3 octaves,
but together reach a total range of 5 octaves. This is because the
VIC's 3 tone generators are "staggered" so the octaves of the
different speakers overlap. A more graphic picture of which
speakers cover which octaves and how they overlap is shown in the
chart on page 99. Musical note values are shown below:

		   TABLE OF MUSICAL NOTES
+-----------------------------------------------------+
| APPROX.					   APPROX.			   |
|  NOTE		  VALUE		   NOTE		  VALUE  |
+-----------------------------------------------------+
|   C			 135			 G			 215   |
|   C#			143			 G#			217   |
|   D			 147			 A			 219   |
|   D#			151			 A#			221   |
|   E			 159			 B			 223   |
|   F			 163			 C			 225   |
|   F#			167			 C#			227   |
|   G			 175			 D			 228   |
|   G#			179			 D#			229   |
|   A			 183			 E			 231   |
|   A#			187			 F			 232   |
|   B			 191			 F#			233   |
|   C			 195			 G			 235   |
|   C#			199			 G#			236   |
|   D			 201			 A			 237   |
|   D#			203			 A#			238   |
|   E			 207			 B			 239   |
|   F			 209			 C			 240   |
|   F#			212			 C#			241   |
+-----------------------------------------------------+
| SPEAKER											 |
| COMMANDS:	  WHERE X CAN BE:		FUNCTION	  |
+-----------------------------------------------------+
| POKE 36878,X	  0 to 15			 sets volume   |
| POKE 36874,X	 128 to 255		   plays tone	|
| POKE 36875,X	 128 to 255		   plays tone	|
| POKE 36876,X	 128 to 255		   plays tone	|
| POKE 36876,X	 128 to 255		   plays "noise" |
+-----------------------------------------------------+

								97
~
The Octave Chart illustrates the three octaves contained in each
speaker register. It also shows how several octaves overlap...for
instance, the lowest octave of Speaker 3 contains the same notes
as the middle octave of Speaker 2. Of course, the same note played
on different speakers may sound slightly different... just as the
same note played on a piano may sound slightly different from the same
note played on a harpsichord. Also, some television sets and
speakers may cause varying results in terms of tonal qualities.
 The Table of Musical Notes on page 97 is Intended to help you
approximate note values in your computer program using the VIC.
The number values are approximate only and may be adjusted by
using values between those shown.

MUSIC PROGRAMMING TECHNIQUES

 There are four basic parameters in programming music:
 1. Volume
 2. Speaker/Sound Register Selection
 3. Note
 4. Duration
In other words, the things you have to consider when programming
music are which volume to set, which speaker(s) to use, the notes
being played by each speaker, and the duration of each note. Let's
consider some techniques for putting these parameters in your 
program:

EXAMPLE 1: MUSIC USING DATA STATEMENT

10 POKE 36787, 15	 Set volume to highest level (15)
20 S2=36875		   Set speaker to equal S2 (any variable)
30 READ N,D		   Read duration & note from DATA
					below.
40 IF N=-1 THEN	   Turn off speaker & end program at -1
  POKES2,0:END
50 POKES2,N		   Play note N from DATA on Speaker S2
60 FORT=1TOD:		 Duration loop to set up time value.
  NEXT
70 GOTO30			 Keeps going back to DATA list to get
					duration & note (N,D) values.
80 DATA 225,250,226   DATA statements...the first number
  250,227,250,228,	 is the note from the note value chart
  250,229,250,230,	 earlier in text, and the second
  250,231,250,232,	 number is the duration the note is
  250,233,250,234,	 played.
  250,235,250,-1,
  -1

								98
~
	   VIC OCTAVE COMPARISON CHART
+------------------------------------------------+
| S3 (36876)									 |
| ----------									 |
|	D  O										|
|	E  C										|
|	F  T										|
|	G  A						HIGHEST OCTAVE  |
|	A  V										|
|	B  E										|
|	C  3	 S2 (36875)						 |
| ----------  ----------						 |
|	D  O		D  O							|
|	E  C		E  C							|
|	F  T		F  T							|
|	G  A		G  A							|
|	A  V		A  V							|
|	B  E		B  E							|
|	C  2		C  3	 S1 (36874)			 |
| ----------  ----------  ----------			 |
|	D  O		D  O		D  O				|
|	E  C		E  C		E  C				|
|	F  T		F  T		F  T				|
|	G  A		G  A		G  A				|
|	A  V		A  V		A  V				|
|	B  E		B  E		B  E				|
|	C  1		C  2		C  3				|
| ----------  ----------  ----------			 |
|				D  O		D  O				|
|				E  C		E  C				|
|				F  T		F  T				|
|				G  A		G  A				|
|				A  V		A  V				|
|				B  E		B  E				|
|				C  1		C  2				|
|			 ----------  ----------			 |
|							D  O				|
|							E  C				|
|							F  T				|
| LOWEST OCTAVE			  G  A				|
|							A  V				|
|							B  E				|
|							C  1				|
|						 ----------			 |
+------------------------------------------------+

								99

Link to comment
Share on other sites

played around little bit with the sound... someone with an idea how to quickly convert from vic to pokey?

 

HOW MUSIC WORKS ON THE VIC

		   TABLE OF MUSICAL NOTES
+-----------------------------------------------------+
| APPROX.					   APPROX.			   |
|  NOTE		  VALUE		   NOTE		  VALUE  |
+-----------------------------------------------------+
|   C			 135			 G			 215   |
|   C#			143			 G#			217   |
|   D			 147			 A			 219   |
|   D#			151			 A#			221   |
|   E			 159			 B			 223   |
|   F			 163			 C			 225   |
|   F#			167			 C#			227   |
|   G			 175			 D			 228   |
|   G#			179			 D#			229   |
|   A			 183			 E			 231   |
|   A#			187			 F			 232   |
|   B			 191			 F#			233   |
|   C			 195			 G			 235   |
|   C#			199			 G#			236   |
|   D			 201			 A			 237   |
|   D#			203			 A#			238   |
|   E			 207			 B			 239   |
|   F			 209			 C			 240   |
|   F#			212			 C#			241   |
+-----------------------------------------------------+
| SPEAKER											 |
| COMMANDS:	  WHERE X CAN BE:		FUNCTION	  |
+-----------------------------------------------------+
| POKE 36878,X	  0 to 15			 sets volume   |
| POKE 36874,X	 128 to 255		   plays tone	|
| POKE 36875,X	 128 to 255		   plays tone	|
| POKE 36876,X	 128 to 255		   plays tone	|
| POKE 36876,X	 128 to 255		   plays "noise" |
+-----------------------------------------------------+

 

(frequency in Hertz are just numbers I picked, the exact frequency depends on the octave on the VIC-20)

 

A 183 ~220 Hz (0)

A 219 ~440 Hz (+36) (440Hz A is an international standard)

A 237 ~880 Hz (+18 = 36/2)

 

C 135 ~128 Hz (0)

C 195 ~256 Hz (+60) (256Hz C depends on tuning of the 'instrument')

C 225 ~512 Hz (+30 = 60/2)

C 240 ~1024Hz (+15 = 30/2)

 

So, it looks like the numbers relate nicely to frequencies, and are reverse from what we are used to on the Atari. That's easily solved by taking the two's complement of the numbers. After that, a lower numbers means a higher frequency, just like Pokey.

 

 

 

For Pokey, the formula is:

 

F_clock is either 64kHz or 15kHz

 

v = F_clock / F_note / 2 - 1

 

The 64kHz clock is actually the CPU clock divided by 28. 15kHz is CPU clock divided by 114.

 

e.g. on a PAL machine (braces for clarity):

 

v = (1773447 / 28) / 440 / 2 - 1 = 70.97431 = ~71

 

NTSC:

 

v = (1789772.5 / 28) / 440 / 2 - 1 = 71.636871 = ~72

 

 

I don't have the time right now to lookup a well-tempered tuning frequency table and correlate both chips to it, but it should be pretty easy to do ;)

 

 

[edit]

 

OK, I couldn't resist :)

 

VIC						 Atari

183	 --> xor 255	 --> 72
219	 --> xor 255	 --> 36
237	 --> xor 255	 --> 18

 

Basically, it's just 'xor 255' to convert from the VIC to the Atari. If it's not the right octave, shift left or right as needed.

Edited by ivop
Link to comment
Share on other sites

I suspect the VIC tone generators probably use counters that add upward and rely on overflow to trigger waveform transitions, similar to the way the C64 does it.

 

If you found the proper formula, you could probably generate an Excel spreadsheet that translates between Atari/VIC AUDF values.

 

Then again, I reckon the C64 version had some good SFX - would be cool to use some advanced Pokey techniques like filtering and 1.79 MHz mode to get saw/triangle waveforms.

Link to comment
Share on other sites

thanks. I thought that we easily could recreate the sound fx. because the Metagalactic project showed that using RMT would not help either even when only using instruments...

 

and we missed sometimes some notes...

 

as all registers are $900a-$900d I can take them via VBL "overlay" and translate them to Pokey...

Link to comment
Share on other sites

at the moment I am doing this highly complicated conversion written very tired... ;)

 

;try to patch the sound
		lda $900e
		and #$0f
		ora #$a0
		sta $d201
		sta $d203
		sta $d205
		lda $900a;low channel #0
		bpl sound1
		and #$7f
sound1		eor #$ff
		sta $d200
		lda $900b;medium channel #1
		bpl sound2
		and #$7f
sound2		eor $ff
		sta $d202
		lda $900c;hi channel #2
		bpl sound3
		eor $ff
sound3		sta $d204
		rts

Link to comment
Share on other sites

I suspect the VIC tone generators probably use counters that add upward and rely on overflow to trigger waveform transitions, similar to the way the C64 does it.

 

If you found the proper formula, you could probably generate an Excel spreadsheet that translates between Atari/VIC AUDF values.

 

Then again, I reckon the C64 version had some good SFX - would be cool to use some advanced Pokey techniques like filtering and 1.79 MHz mode to get saw/triangle waveforms.

 

VIC sound and wave forms??? ;) i doubt...

Link to comment
Share on other sites

Emkay... they are not bad but my experience with RMT for VIC20 conversions regarding sound fx was not good... not sure if it was because of my sound wrapper triggering RMT fx or RMT itself...

 

so that's why I am aiming this time for a more "direct" usage of the sound generators...

Link to comment
Share on other sites

btw. what are your thoughts compared to the 800 "original" version of Gridrunner?

 

I played Gridrunner quite a bit on my XL back in the day (I had a 600XL first and it would run in 16K) and I always liked it but TBH I'm liking the VIC conversion better. I think the "chunkier" graphics work well for the game. Even though the playfield is bigger on the A8 version I think the VIC version plays better.

 

I might do some head to head if it turns out to be a slow day ;)

 

BTW - I know you mentioned somewhere in the thread about posting some notes about the code etc. I'd be pretty interested to see that.

Link to comment
Share on other sites

so that's why I am aiming this time for a more "direct" usage of the sound generators...

 

Which should be much easier than to produce them in RMT.

Set pokey registers, start volume and pitch on the needed generators, and do some increase/decrease on the volume and pitch. For the reference you can use the RMT showing the registers... but independent from the VBI.

Edited by emkay
Link to comment
Share on other sites

VBL vs direct CPU kernel which the game uses... VIC20 version does not use any interrupt.

 

I'm just curious, but how comes it's not possible to directly map the 3 square voices and noise voice directly to Pokey voices, with some frequency translation lookup on each frequency write ?

Link to comment
Share on other sites

Big football game happening here... means I'm "too busy".

 

I'm pretty sure there's a good deal of sound range missing at the low frequency end if you're talking 64 KHz mode.

Suppose there's always the option to use 16 bit voice too but then we're down to 3 voices available.

 

I reckon a "virtual voices" system is the way to go... in the cases where 4 notes are needed you just have some sort of decision process to choose which sound gets dropped.

Link to comment
Share on other sites

the game uses 3 channels.- and does not have many sound fx.

 

channels used:

 

1 for the player shot

1 for the zappers

1 for noise fx

 

so that's why I still think we can recreate the sounds without implementing a virutal sound system...maybe I take the XL version and have a look there... ;)

Link to comment
Share on other sites

According to a doc I found...

 

Frequency is calculated as follows... remembering the high bit of the Freq register turns the voice on/off, so we have 7 bits per voice Freqency resolution:

 

Bass freq = Phi2/256/(255-F)

Alto freq = Phi2/128/(255-F)

Soprano freq = Phi2/64/(255-F)

Noise freq f=Phi2/32/(255-F)

 

PAL Phi2 clock is 1108404.5 MHz

Link to comment
Share on other sites

spookt...not my work...you have to thank Jeff... ;)

 

btw. what are your thoughts compared to the 800 "original" version of Gridrunner?

 

and I definitly will get Gridrunner+++ from XBLA when it is done... ;)

Heaven, Gridrunner+++ will not be coming to XBLA. MS has not returned any of Llamasoft's calls so they've spent the last few months basically rewriting the game as a PC only version. I'm at work right now so don't have the link handy, but if you go to YakYak and do a search for "The definitive GR+++ thread" you'll find all the details.

 

BTW - I posted a link to this thread over at his forum. Hopefully it will generate a bit more interest in your conversions.

 

Stephen Anderson

Edited by Stephen
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...