Asteroids vector help

RGP

Meeter & Greeter
Feedback
5 (100%)
Credits
2,039CR
Finding myself needing a nudge in the right direction on Asteroids vector side.

Board powers up, have done all RAM/ROM tests, all pass, clock is fine etc. Here's the mess I see on the test screen:



I'm taking a few wild guesses here about what might be going on.

1) State Machine is not reading vector RAM properly thus getting rubbish into the drawing routines.

2) Counters in either the timer or x / y routines are bad.

3) I don't think its the analog side of it as what it is drawing is stable in both directions and I have control over the X/Y sizes.

Having a bit of troubling homing in on where to go here.

I started at the beginning of sheet 2A in the schematics and found I had nothing on one of the ADMAx signals but then I compared it to the board I sorted out the other day and that was exactly the same.

Anyone can help with any theory on this?

Thanks :)
 

Mitchell Gant

Active member
vacBacker
Feedback
2 (100%)
Credits
888CR
RGP said:
1) State Machine is not reading vector RAM properly thus getting rubbish into the drawing routines.

Could be, but the test screen is asking a lot of the DVG section, it uses pretty much everything, short vectors, long vectors, subroutine jumps and returns on the stack and absolute jumps to the ROM location for test screen as well. So it's NEVER likely to show properly with any fault in the DVG.

RGP said:
2) Counters in either the timer or x / y routines are bad.

Unlikely looking at the vectors it does manage to draw.

RGP said:
3) I don't think its the analog side of it as what it is drawing is stable in both directions and I have control over the X/Y sizes.

I agree, analogue side looks good from vectors shown.

RGP said:
I started at the beginning of sheet 2A in the schematics and found I had nothing on one of the ADMAx signals but then I compared it to the board I sorted out the other day and that was exactly the same.

Yeah, red herring 'dead' logic line. It's a bitch
smiley36.gif


I usually do incremental tests for the DVG and have written routines to insert vector instructions and execute them. If you have one of those Fluke thingys I guess you'll have to write some scripts (?) to do the same sort of thing.

First test is to write a single DVG HALT instruction to vector address 0 (6502 address 0x4000) then write to DMAGO (0x3000). Then repeat the DMAGO if HALT readback (0x2002) is *low* (LS251 is inverting!)

If that works then you should see a short low on the HALT line (A9 pin 10) for a couple of microseconds on a 'scope.

Then I do a JMP to address 1 and HALT and see if that works. HALT low time should be a bit longer now.

Then a JSRL to address 2, return to address 1 and halt.

Next is JRSL to 2, then another JRSL to 4, return, return again and halt. Etc...

The JMP and JSRL tests can show problems with the Program Counter section. Though checking the LS670 file registers is not so easy, swap or piggyback? I do keep trying to develop deeper tests for parts like this though. I have a walking jump test for example that fills all vector RAM with JMP 1, JMP 2, JMP 3, etc up until the last instruction which is a HALT. That tests program counters F5, H5 and J5 and load buffers H6 and J6. Well apart from the higher order ADMA lines 11 and 12. Unless you have a way of replacing the vector ROM with RAM areas and being able to test all the vector address space...
smiley9.gif


After that I'll do LABS instructions then vector draws and short draws to check out the vector timer, rate multipliers and position counter sections.

A faulty PROM at C8 can give you the run around though, regardless of any test routines, and I've seen a few duff ones!

Hope that helps, though not knowing how a Fluke works I'm not sure how easily you can do those sorts of tests.
 

RGP

Meeter & Greeter
Feedback
5 (100%)
Credits
2,039CR
I understood the words that you wrote above but not enough to make use of them, I have a Fluke 9010A and a 6502 pod, I can write to the 0x4000-0x47ff memory I just don't know what values to put in there.

JMP, JSRL, HALT etc are these all VSM instructions?

I see from the schematic that the 670's (mine is a revision using 170's) are a stack.

The other possibility is the vector timer circuit, the E7 LS42 decoder sets the presets for the 3 x 161's.

Forgive me if i've interpreted it wrong but it seems like the board uses the timer circuit in a sort of negative offset mode from 1024 - so if you want to draw a very short vector you start with a high number, "GO" allows the counters to run and then when they hit 1024 /STOP happens.

Lets describe what the visual problem seems to be breaking down just one element of it:

Top line of the box - Draw me a line - from X=0, Y=0 to X=1023, Y=0

Knowing the format of the VSM commands would be helpful here but without that, i'm assuming that we have to get DVX0-10 and DVY0-10 to be all 0 and get all the signals coming off the LS42 @ E7 to also be 0 and then we release the /HALT on A9 so that "GO" oscillates and the timer starts running, the x/y position counters incremement and the line is drawn.

I hope i've got it right as to what happens here as i'm assuming the command is draw here to here with no change in Y along the route.

So, what seems to be happening in the case is that DVX0-10 signals are actually being set to about half way across the screen but likely the timer is being initialised properly the GO and /STOP signals are working just fine but there's some wraparound going on.

DVX0-10 come from the 273's at J7 & K7 which are derived from DDMA0-7 and depending on the state of /BUFFEN come from either vector ROM or vector RAM - this is the bit I don't know.

Is vector ROM a collection of drawing routes and vector ram is a smaller table of draw rock at x,y, draw rock at x,y draw saucer at x,y etc or is the CPU copying VROM segments into VRAM?

In any case the start offset for the line isn't right which means the values of "A" are wrong.

Its trying to draw that full length line but it just can't.

Wondering if its possible that DACX1-10 signals (and the DACY1-10) might be being corrupted .
 

Mitchell Gant

Active member
vacBacker
Feedback
2 (100%)
Credits
888CR
RGP said:
JMP, JSRL, HALT etc are these all VSM instructions?

Yes. You need to see the horses mouth

http://www.jmargolin.com/vgens/vgens.htm

and

http://blog.philpem.me.uk/?p=73

RGP said:
Forgive me if i've interpreted it wrong but it seems like the board uses the timer circuit in a sort of negative offset mode from 1024 - so if you want to draw a very short vector you start with a high number, "GO" allows the counters to run and then when they hit 1024 /STOP happens.

Yes that's correct.

RGP said:
Lets describe what the visual problem seems to be breaking down just one element of it:

Top line of the box - Draw me a line - from X=0, Y=0 to X=1023, Y=0

Knowing the format of the VSM commands would be helpful here but without that, i'm assuming that we have to get DVX0-10 and DVY0-10 to be all 0 and get all the signals coming off the LS42 @ E7 to also be 0 and then we release the /HALT on A9 so that "GO" oscillates and the timer starts running, the x/y position counters incremement and the line is drawn.

I hope i've got it right as to what happens here as i'm assuming the command is draw here to here with no change in Y along the route.

So, what seems to be happening in the case is that DVX0-10 signals are actually being set to about half way across the screen but likely the timer is being initialised properly the GO and /STOP signals are working just fine but there's some wraparound going on.

DVX0-10 come from the 273's at J7 & K7 which are derived from DDMA0-7 and depending on the state of /BUFFEN come from either vector ROM or vector RAM - this is the bit I don't know.

If it were only the vector timer at fault, it should not stop the LABS instruction loading the absolute position counters and the far corners of the screen being reached, not just getting half way there for the start of vector draws. Just the length of each would be wrong if it's a faulty vector timer. Though it's difficult to see exactly from your scope shot.

RGP said:
Is vector ROM a collection of drawing routes and vector ram is a smaller table of draw rock at x,y, draw rock at x,y draw saucer at x,y etc or is the CPU copying VROM segments into VRAM?

Yes most of ROM is just subroutines for drawing, although there is some 6502 data in there too when they ran out of main ROM space. But it's not relevant to fixing the board.

RGP said:
In any case the start offset for the line isn't right which means the values of "A" are wrong.

Its trying to draw that full length line but it just can't.

Wondering if its possible that DACX1-10 signals (and the DACY1-10) might be being corrupted .
 

RGP

Meeter & Greeter
Feedback
5 (100%)
Credits
2,039CR
I'm going to have to absorb that document.

I did have a very quick look and once you see the circuit broken down its a bit easier to digest.

The PROM is the program counter effectively.

I'm wondering if i can feed the VSM some custom data to make it draw a very simple shape which has known states - fix one shape, fix them all approach?
 

RGP

Meeter & Greeter
Feedback
5 (100%)
Credits
2,039CR
Ok, so having now understood the opcodes (i think), should i be able to poke some commands into the DVG and get it to obey my whims?

Eg draw a line across the top of the screen

Org $4000
LABS 0,0
VCTR 0, 1023, intensity 8
JMPL $0000

Or

10100000 00000000 000000000 00000000 A0 00 00 00
10010000 00000000 100000111 111111111 90 00 87 FF
11100000 00000000 E0 00

That sound right?
 

Mitchell Gant

Active member
vacBacker
Feedback
2 (100%)
Credits
888CR
Close, but no cigar
smiley19.gif


You seem to have MSB and LSB bytes swapped, remember a 6502 is little endian and vector instructions sit in the MSB top nibble.

Top left of screen actually is 0, 767 (not 0,0 that the PDF Philip Pemberton wrote) and you need to specify the vector shift opcode type (VCTR8) to suit the global scale factor set in the LABS instruction (Scale 0).

My AVG/DVG assembler would process this:

L_0000: LABS 00, 767,0

VCTR8 1023, 00, 15

JMPL L_0000

into this:

FF A2 00 00 00 80 FF F3 00 E0

Which I just tested out and it draws a full bright line from top left to top right on my vector disassembler. Not tried on real hardware though so might not be right!

I usually stick a HALT at the end though your method of keep jumping back should work fine for your Fluke test I think. Hitting reset should stop the DVG.
 

RGP

Meeter & Greeter
Feedback
5 (100%)
Credits
2,039CR
Ah, yes, well, what tripped me up was that the data bus is 8 bit so I assumed it was pulling each byte sequentially from vector ram at 0x4000 onwards so the first byte it receives would be the opcode and first operand and that PDF's ordering was actually in bytes received - not words.

But actually its receiving a word of data as bits 7-0 and 15-8 with 15-11 (or 7-4) being the opcode.

Equally I was confused because the 6502 only writes 8 bits at a time and the vector system is logic implemented so can read 8 or even 16 bits at a time and the ROM/RAM is common to both so why would you just not write 0x4000 (15-8) and 0x4001 (7-0).

I've always been tripped up on endianness.
 
Top