Previous Thread
Next Thread
Print Thread
Page 4 of 6 1 2 3 4 5 6
Joined: Jan 2021
Posts: 108
=
Senior Member
Offline
Senior Member
=
Joined: Jan 2021
Posts: 108
Is the chip (AY-3-8760?) inside the "Stunt Cycle" home console based on similar logic gate circuit or is it some kind of microcontroller?

https://handwiki.org/wiki/Software:Stunt_Cycle

I only find it mentioned here:
https://nerdstuffbycole.blogspot.com/2019/03/the-ay-3-8606-another-successfully.html

https://atariage.com/forums/topic/288619-tennis-a-pong-chip-port-to-the-intellivision/

I own the PAL version by Atari and a clone in a cartridge of Unimex Mark IX.

Last edited by =CO=Windler; 07/06/22 07:42 AM.
Joined: Feb 2014
Posts: 869
Likes: 53
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 869
Likes: 53
Yes, I think Evel's taken the day off, maybe it was Awful Knopfel...


====================================



Part of my debugging strategy is to use some printfs inside of a NETDEV_ANALOG_CALLBACK_MEMBER to see what's happening with the signals:


so I've got a NETLIST_ANALOG_OUTPUT which will call a NETDEV_ANALOG_CALLBACK_MEMBER:


inside stuntcyc_state I put:

Code
#define DEBUGNLAO(x,y) NETDEV_ANALOG_CALLBACK_MEMBER(update_##x) {printf("UPDATE " #x ": %f  "#x"= %f\n",time.as_double(),data); }

DEBUGNLAO(cyclereset,CYCLE_RESET)
DEBUGNLAO(cycleresetq,CYCLE_RESET_Q)
DEBUGNLAO(direction,DIRECTION)

#undef DEBUGNLAO



Then inside stuntcyc_state::stuntcyc(machine_config &config) you put:

Code
#define DEBUGNLAO(x,y) NETLIST_ANALOG_OUTPUT(config, "maincpu:"#x, 0).set_params(#y, FUNC(stuntcyc_state::update_##x));

DEBUGNLAO(cyclereset,CYCLE_RESET)
DEBUGNLAO(cycleresetq,CYCLE_RESET_Q)
DEBUGNLAO(direction,DIRECTION)


#undef DEBUGNLAO


You have to put a routine into two different locations in the code.

This way I can just copy and paste the same line DEBUGNLAO(cycleresetq,CYCLE_RESET_Q) and it will make the appropriate NETDEV_ANALOG_CALLBACK_MEMBER or NETLIST_ANALOG_OUTPUT.


so output looks like this:

UPDATE direction: 0.000000 direction= 0.100000
UPDATE cyclereset: 0.000000 cyclereset= 0.100000
UPDATE cycleresetq: 0.000000 cycleresetq= 0.100000
UPDATE cycleresetq: 0.000000 cycleresetq= 3.999999
UPDATE direction: 0.000000 direction= 3.999999




One thing that's interesting in the debugger, if you "gt 1" you can see the strip of screen that gets painted during the millisecond. It shouldn't be too hard to make it possible to step by less than a millisecond.

[Linked Image from i.imgur.com]

Joined: Feb 2014
Posts: 869
Likes: 53
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 869
Likes: 53

Joined: May 2009
Posts: 2,053
Likes: 85
J
Very Senior Member
Offline
Very Senior Member
J
Joined: May 2009
Posts: 2,053
Likes: 85
Originally Posted by =CO=Windler
Is the chip (AY-3-8760?) inside the "Stunt Cycle" home console based on similar logic gate circuit or is it some kind of microcontroller?

It's at least pretty certain it's not a microcontroller - microcontrollers that could actually do TV-based graphics didn't exist back then. There's no telling if it's based on "similar logic gate circuits" or not. It's an ASIC, all of the one-off TV game systems of that era were. It would require someone decapping such a chip and actually tracing out the silicon to work out an equivalent schematic to know anything more than that.

Joined: Feb 2014
Posts: 869
Likes: 53
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 869
Likes: 53
JD left another clue in the code:
Code
 // TTL_74193(name, A, B, C, D, CLEAR, LOADQ, CU, CD)
//	TTL_74193(L8, FIXED_RAMP_ZONE_Q, FIXED_RAMP_ZONE, P, P, JUMP_Q, LOAD_Q, P, GRAVITY) // Schematics say C and D should be to VCC - maybe ground instead?

// changed to GROUND and bike jumps!!!
	TTL_74193(L8, FIXED_RAMP_ZONE_Q, FIXED_RAMP_ZONE, GROUND, GROUND, JUMP_Q, LOAD_Q, P, GRAVITY) // Schematics say C and D should be to VCC - maybe ground instead?





I also tried to model a bunch of stuff that leads up to the SPEED_PULSES and up to R38 and R39 but it ran super slow...like over a minute to generate a single frame.

1 member likes this: wolfi
Joined: Feb 2014
Posts: 869
Likes: 53
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 869
Likes: 53
It's interesting to study the different Atari TTL games of this period as they have quite a bit of similarities.

I thought I'd try to figure out how the rom in tank works too:


Code

f = io.open("/mnt/z/mame/roms/tank/90-2006.k10","r")  a = f:read("*a")
function prtbyte(adr,a) if adr then io.write(string.format("%x",adr)..":") end for i=7,0,-1 do if (a & (2^i)) ~= 0 then io.write(i) else io.write(" ") end end end
function bit(x,y) return (x >> y) & 1 end

for score=0,63 do for v=0,7 do adr=((score<<3) | v | (1<<10)) io.write(score.." "..v..":") prtbyte(adr, a:byte(adr+1)) print() end end
for dir=0,31 do for v=0,7 do for h = 0,1 do adr=(v | bit(dir,4)<<3 | h<<4 | (dir & 0xf) << 5 | 1 << 10 | 1 << 9) prtbyte(nil,a:byte(adr+1)) end print() end print(string.rep("=",16))  end
for v=0,31 do for h=0,15 do adr=((v<<4) | h | (0<<9)) if h~=7 then prtbyte(nil,a:byte(adr+1)) end end print() end  -- playfield 0
for v=0,31 do for h=0,15 do adr=((v<<4) | h | (1<<9)) if h~=7 then prtbyte(nil,a:byte(adr+1)) end end print() end  -- playfield 1



Code
for v=0,31 do for h=0,15 do adr=((v<<4) | h | (0<<9)) if h~=7 then prtbyte(nil,a:byte(adr+1)) end end print() end  -- playfield 0
 6  3210 6       6 4     6 4   0 6 4  1  65   1  654  1 7     107  4  107  4  1 7 5   1 7 54  1 7 54   07 54    76      
76  321076  321 7 54321 7 5432 07 5432  7 5 32  7  432  7   3 10 6543 10 65432   65 32   6 432   6 432 0 6 4321  6  321 
7   3210                                          5 3 1 7 5 3                                                           
                  5432107654321076543210765432  7             1  6543210765432107654321076543                           
                                                                                                                        
        76543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076      76543210
76543210        76                              7                  4                                    76              
76543210        76                              7                  4                                    76              
              1076                              7       7654       4             6                      76              
                76        5432107654                    7654                                3210        76              
                76        543210                             2                              3210        76              
                76        543210                 6                        5432              3210        76              
                76                                                 4      5432                          76              
                76         4                             6                5432                          76              
                76               6           2                                         0                76              
                76                                               6                                      76      76543210
                76                                 4                                                    76      76543210
                76              76543                      4                  1                         76      76543210
                76              765432107654                         2                    54321         76              
                76              765432107654         2                                    54321         76              
                76                             0                                    32107654321         76              
                76     0                                       0                                        76              
           4    76                                     0                                                76              
                76                     0                             2                                  76              
76543210        76        5432                   6                        54321076543                   76              
                76        5432                             4              54321076543                   76              
                76        5432                     4321         765          210                        76              
                76        5432        1076         4321         765          210            3           76       6543210
                76                    1076                      765                                     76              
                76                    1076                      765432                                  76              
                76                    1076                      765432                                  76              
7 5 3 10        765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076              
> 



 for v=0,31 do for h=0,15 do adr=((v<<4) | h | (1<<9)) if h~=7 then prtbyte(nil,a:byte(adr+1)) end end print() end
 6  3210 6       6 4     6 4   0 6 4  1  65   1  654  1 7     107  4  107  4  1 7 5   1 7 54  1 7 54   07 54    76      
76  321076  321 7 54321 7 5432 07 5432  7 5 32  7  432  7   3 10 6543 10 65432   65 32   6 432   6 432 0 6 4321  6  321 
7   3210                                          5 3 1 7 5 3                                                           
                  5432107654321076543210765432  7             1  6543210765432107654321076543                           
                                                                                                                        
        76543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076      76543210
76543210        76                                    10                      10                        76              
76543210        76                                    10                      10                        76              
                76                                    10                                                76              
                76        5432107654                  10            3210                765432          76              
                76              7         54                 2        10                                76              
                76              7         54     6                    10      10                        76              
                76                        54                       4                      543   7   3   76              
                76                                       6                                54            76              
                7654321076                   2                        1076          32107654            76              
                76                                               6    10                                76      76543210
                76                  32107654       4                  10                                76      76543210
                76                        54               4                                  1076543   76      76543210
                76                        54                         2                        10        76              
                76      76543210                     2                           6543210   43210        76              
                76                             0                                                        76              
                76                                             0        76543210                        76              
           4    76                54                   0                                                76              
                76    107654      54      54                         2                  76              76              
76543210        76        54              54     6                                      76              76              
                76        54              54               4          10                76              76              
                76                        5432        10        76543210      10                        76              
                76                                              76            10                        76       6543210
                76                               65                           10              10        76              
                76            10                                                              10        76              
                76            10                      10                                      10        76              
7 5 3 10        765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076           



0 0:400:        
0 1:401:     210
0 2:402:     2 0
0 3:403:     2 0
0 4:404:     2 0
0 5:405:     2 0
0 6:406:     2 0
0 7:407:     210
1 0:408:        
1 1:409:     21 
1 2:40a:      1 
1 3:40b:      1 
1 4:40c:      1 
1 5:40d:      1 
1 6:40e:      1 
1 7:40f:     210
2 0:410:        
2 1:411:     210
2 2:412:     2 0
2 3:413:       0
2 4:414:     210
2 5:415:     2  
2 6:416:     2  
2 7:417:     210
3 0:418:        
3 1:419:     210
3 2:41a:     2 0
3 3:41b:       0
3 4:41c:      10
3 5:41d:       0
3 6:41e:     2 0
3 7:41f:     210
4 0:420:        
4 1:421:     2  
4 2:422:     2 0
4 3:423:     2 0
4 4:424:     2 0
4 5:425:     210
4 6:426:       0
4 7:427:       0
5 0:428:        
5 1:429:     210
5 2:42a:     2  
5 3:42b:     2  
5 4:42c:     210
5 5:42d:       0
5 6:42e:     2 0
5 7:42f:     210
6 0:430:        
6 1:431:     210
6 2:432:     2 0
6 3:433:     2  
6 4:434:     210
6 5:435:     2 0
6 6:436:     2 0
6 7:437:     210
7 0:438:        
7 1:439:     210
7 2:43a:     2 0
7 3:43b:       0
7 4:43c:       0
7 5:43d:       0
7 6:43e:       0
7 7:43f:       0
8 0:440:        
8 1:441:     210
8 2:442:     2 0
8 3:443:     2 0
8 4:444:     210
8 5:445:     2 0
8 6:446:     2 0
8 7:447:     210
9 0:448:        
9 1:449:     210
9 2:44a:     2 0
9 3:44b:     2 0
9 4:44c:     210
9 5:44d:       0
9 6:44e:     2 0
9 7:44f:     210
10 0:450:        
10 1:451: 65  210
10 2:452:  5  2 0
10 3:453:  5  2 0
10 4:454:  5  2 0
10 5:455:  5  2 0
10 6:456:  5  2 0
10 7:457: 654 210





      1076      
       07       
 6543  07  4321 
 65432107654321 
 65432107654321 
 65432107654321 
 6543      4321 
                
================
        76543   
         65     
  5432  76  3210
  5432107654321 
 65432107654321 
 6543210765432  
76543     5432  
                
================
         65432  
   4321   54    
  54321  65   10
  54321076543210
 65432107654321 
7654     65432  
         6543   
                
================
           432  
   43210   43210
  54321   54    
 6543210765  210
7654321076543210
765     7654321 
         65432  
        76543   
================
     210   43   
   43210   43210
 654321  654    
76543210765  210
765   1076543210
        765432  
       07654    
       076      
================
      107       
   4321076  321 
76543210   43210
 65432107654    
     210765 3210
      1076543210
    321076543   
     21076      
================
      1076      
 654321076   21 
 65432107   3210
    321076543 10
     210765     
     21076543   
   4321076543   
    3210        
================
       07654    
 65432107654    
 654321076    10
     21076543210
     21076    10
     21076543   
   4321076543   
    32107       
================
                
  5432107654    
  5432107654    
    321076    10
    321076543210
    321076    10
  5432107654    
  5432107654    
================


1 member likes this: wolfi
Joined: Feb 2014
Posts: 869
Likes: 53
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 869
Likes: 53
So one of the things that had me baffled about tank was figuring out how it handles the mines. Specifically, how does it keep track of whether a mine has been hit or not?

It doesn't have a cpu, and it only has a ROM chip, no ram chips, so how does it know if a mine has been hit?

There's a dual 8 bit shift register, the Signetics N8277, that is used as a 16 bit shift register and that's enough to hold 1 bit of state for each mine.

In the playfield, there's a rectangular region defined for the mines, any bit that's set in this region will be a mine, but we're only allowed 1 mine per row.

When the game starts, the shift register is cleared, a 1 bit means that the mine has been hit.


As the playfield gets scanned vertically, this shift register gets cycled through and updated, collision with either tank1 or tank2 will remove the mine (set the bit to 1 that will get shifted in on the next clock).
The D0A and D1A are set so that it inverts the input DSA on pin 4.


[Linked Image from i.imgur.com]

1 member likes this: wolfi
Joined: Feb 2014
Posts: 869
Likes: 53
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 869
Likes: 53
I managed to get one of the tanks displaying. It's super hacky but at least it shows something.

There's something very very wrong with one of the 74107's. Hooked up normally, IC_N1.6 GOES TO IC_M1.4 but for some reason, it never gets updated. If I put a debug net list analog output on IC_N1.6, it never gets updated, however if I put a debug net list analog output on IC_N1.5, it magically starts updating??? If it never updates properly THR1Q and THW1Q don't activate and the display window doesn't get activated.

Here you see a tank in the lower right, it jumps all around:
[Linked Image from i.imgur.com]

Got both tanks appearing, but jumping all over the place:
[Linked Image from i.imgur.com]

1 member likes this: wolfi
Joined: Feb 2014
Posts: 869
Likes: 53
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 869
Likes: 53
Another question was where does the explosion graphic come from?

It isn't in the rom, so where does it originate?

It comes from a bunch of XOR and NOR and NAND logic that generates an image based on the horizontal and vertical coordinates.

[Linked Image from i.imgur.com]

A couple of screenshots from a youtube video of kee tank (the machine in the video has a color mod)

[Linked Image from i.imgur.com][Linked Image from i.imgur.com]

So let's make a PCBASIC program (GWBasic interpreter that is ubuntu package python3-pcbasic) that will render our explosion:

I hate basic boolean logic semantics like -1 for positive, so I made some more c-like boolean operations with DEF FN:

Code
10 DIM A(5000),B(5000)
50 DEF FN cnot(xarg)=(xarg=0)*-1
60 DEF FN cbool(xarg)=(xarg<>0)*-1
70 DEF FN bit(xarg,yarg)=fn cbool( xarg and (2^yarg))
80 def fn cxor(xarg,yarg)=fn cbool(fn cbool(xarg) xor fn cbool(yarg))
90 DEF FN cnand(xarg,yarg)=fn cbool(fn cnot(fn cbool(xarg) and fn cbool(yarg)))
91 DEF FN cnor(xarg,yarg)=fn cbool(fn cnot(fn cbool(xarg) or fn cbool(yarg)))
100 SCREEN 7 : rem screen 2 too much resolution
101 SIZE=16
105 FOR FLASH = 0 TO 1
110 FOR X = 0 TO SIZE-1
120 FOR Y = 0 TO SIZE-1
130 P = FN cnand ( FN cxor( FN cxor( FN cxor(FN bit(y,2),FN bit(y,3)), FN cxor(FN bit(x,2),FN bit(x,3))), flash), FN cnor(  FN cxor( FN bit(y,1),FN bit(x,1)), FN cnor(  FN cxor(FN bit(x,2),FN bit(x,3)), FN cxor(FN bit(y,2),FN bit(y,3)) ) )  ) 
140 PSET(X,Y),FN CNOT(P)*4
150 NEXT : NEXT
155 IF FLASH = 0 THEN GET (0,0)-(SIZE-1,SIZE-1),A ELSE GET(0,0)-(SIZE-1,SIZE-1),B
160 NEXT
200 FOR I = 1 TO 500
210  FLASH = I MOD 2
220 IF FLASH = 1 THEN PUT(160-(size/2),100-(size/2)),A,PSET ELSE PUT (160-(size/2),100-(size/2)),B,PSET
225 FOR DELAY = 1 TO 10000:NEXT
230 NEXT


[Linked Image from i.imgur.com]
[Linked Image from i.imgur.com]

And why not render a larger area just to see the repeated pattern:

[Linked Image from i.imgur.com]

Joined: Feb 2014
Posts: 869
Likes: 53
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 869
Likes: 53
And where to do the mine X images come from?

[Linked Image from i.imgur.com]


So modifying my PCBASIC program you can see the mine image, what's kind of interesting is that it doesn't occupy the entire 16x16 area, just the lower right 8x8.

Code

10 DIM A(5000),B(5000)
50 DEF FN cnot(xarg)=(xarg=0)*-1
60 DEF FN cbool(xarg)=(xarg<>0)*-1
70 DEF FN bit(xarg,yarg)=fn cbool( xarg and (2^yarg))
80 def fn cxor(xarg,yarg)=fn cbool(fn cbool(xarg) xor fn cbool(yarg))
90 DEF FN cnand(xarg,yarg)=fn cbool(fn cnot(fn cbool(xarg) and fn cbool(yarg)))
91 DEF FN cnor(xarg,yarg)=fn cbool(fn cnot(fn cbool(xarg) or fn cbool(yarg)))
100 SCREEN 7 : rem screen 2 too much resolution
101 SIZE=16
105 FOR FLASH = 0 TO 1
110 FOR X = 0 TO SIZE-1
120 FOR Y = 0 TO SIZE-1
130 P = FN cnand ( FN cxor( FN cxor( FN cxor(FN bit(y,2),FN bit(y,3)), FN cxor(FN bit(x,2),FN bit(x,3))), flash), FN cnor(  FN cxor( FN bit(y,1),FN bit(x,1)), FN cnor(  FN cxor(FN bit(x,2),FN bit(x,3)), FN cxor(FN bit(y,2),FN bit(y,3)) ) )  ) 
140 PSET(X,Y),FN CNOT(P)*4
150 NEXT : NEXT
155 IF FLASH = 0 THEN GET (0,0)-(SIZE-1,SIZE-1),A ELSE GET(0,0)-(SIZE-1,SIZE-1),B
160 NEXT
200 FOR I = 1 TO 500
210  FLASH = I MOD 2
220 IF FLASH = 1 THEN PUT(160-(size/2),100-(size/2)),A,PSET ELSE PUT (160-(size/2),100-(size/2)),B,PSET
225 FOR DELAY = 1 TO 10000:NEXT
230 NEXT



130 F13.11 = FN CXOR( FN BIT(X,1), FN BIT(X,2) ) : F13.8= FN CXOR( FN BIT(Y,1), FN BIT(Y,2) ) : F13.6 = FN CXOR( F13.8, F13.11) : A10.11= FN CNAND( FN BIT(Y,3), FN BIT(X,3) ) : D7.02 = FN CNOR( A10.11, F13.6) : P = D7.02
140 PSET(X,Y),FN CBOOL(P)*4

[Linked Image from i.imgur.com]
If I change the colors a little, you can see it only occupies the lower right quadrant.
[Linked Image from i.imgur.com]

Page 4 of 6 1 2 3 4 5 6

Link Copied to Clipboard
Who's Online Now
1 members (robcfg), 20 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,112
Posts119,407
Members5,024
Most Online890
Jan 17th, 2020
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com