I am hoping that I can get a little help figuring this section out. I am pretty good with digital analysis, but my transistor theory is a little (ok a lot) rusty. The purpose of this section is to control the game state. Here are the things that I do know about this circuit:
- When either /STOPG1 or /STOPG2 goes low, indicating that one of the score counters has reached the game ending score, the output of B3 (STOP G) will go high which stops the game. The high on STOP G will also set /ATRAC
In my last post I showed how the Action! compiler produces some pretty optimized code for CARD math under certain circumstances. This time I will show the more general case which should be pretty familiar to anyone who has done 6502 programming.
Here is the Action! program and it’s dis-assembly:
CARD I
PROC MAIN()
I=2
I=I+2
RETURN
0E6C: .BYTE 00,00
0E6E: 4C 71 0E JMP $0E71
;I=2
0E71: A0 00 LDY #$00
0E73: 8C 6D 0E STY $0E6D
0E76: A9 02 L
I can’t believe it’s been over a year since my last blog post, time sure does fly! I thought it was about time to get back to some posts and continue my Action! language topic.
Last time I talked about BYTE math, this time we will start looking at CARDinal math. In Action the CARD data type is a two byte unsigned value. Here is the first piece of Action! code:
CARD I
PROC MAIN()
I=1
I=I+1
RETURN
Here is the resulting disassembly:
0E6A: .BYTE #$00,#$00
0E6C: 4C 6F 0E J
In the discussion of the ball horizontal control circuit, supercat proposed a simplified circuit that would perform the same function. This is the circuit I believe he is describing:
starfire.zip
It actually comes pretty close to working, and it does use less chips, but instead of generating 3 speeds it generates 4.
The VSYNC input will make sure the circuit is only enabled for the first four lines on the screen. For each count on the hit counter the MOVE signal will be enabled for
The final graphic element we need to look at is the ball. Like the score this is a pretty complex, but very clever circuit.
The first part of the circuit we will look at is the horizontal counter. This circuit controls the horizontal location, motion and size of the ball. Later we will look at a similar circuit that controls the vertical.
The main part of the circuit is a 9 bit counter composed of G7 and H7, which are synchronous counters, and G6. When the co
While studying the score counters I was having a hard time figuring out how the score was credited to the correct player, it seemed that misses on the left side where scoring on the left side instead of the right. Turns out that I had a mistake in an earlier section, Ball Horizontal Control (Part 1). Turns out that I had the /HIT1 and /HIT2 counters reversed, the circuit should look like this:
This is the proper description of how this circuit should work.
The flip/flop H3 is used
Here is the other proposal supercat made for the ball horizontal control circuit. This one actually appears to work exactly like the real circuit, providing 3 different ball speeds and saves at least 2 chips.
As supercat observed in my last entry, I totally missed this part the first time around. Better late then never...
_pesco_pacman_v8.zip
For anyone who has played Pong, you may remember that the more times you volley the ball back and forth, the faster the ball will move. This counter counts those volleys. Each time the ball is hit by either player the counter will increment until it reaches a count of 12, at which point it will be disabled by NAND gate E1. The counter is reset by the RST
The purpose of this circuit is to generate the Aa and Bb signals that go into the horizontal ball counter. I will describe what this circuit does first, and then go into the details of how it does it. There are three valid states for Aa,Bb:
Bb Aa
0 1 - move left
1 0 - stationary
1 1 - move right
Normally the Aa/Bb outputs will be in the stationary state, because we only want the ball to move a little bit on each frame, so for most of the horizontal lines the ball is not m
The next thing I want to talk about is the attract mode, which is the mode the game is in when it’s not being played, designed to “attract” new players. Most of the schematics for this section I have posted already, so I will just describe how attract effects each section. The attract signal is generated by the game control circuit and is fed as both an active high and active low signal to various other circuits in the game.
In the paddle circuit, /ATTRACT holds the preset pin of flip-flop
Next let’s look at some simple byte variable manipulation. Here is the first sample Action program:
BYTE I
PROC MAIN()
I=1
I=I+2
RETURN
And the assembly code
24B3: .byte $00
24B4: JMP $24B7
24B7: LDY #$01
24B9: STY $24B3
24BC: CLC
24BD: LDA $24B3
24C0: ADC #$02
24C2: STA $24B3
24C5: RTS
This code starts at memory location $24B3 which is where the global variable I is stored. Next we have a jump instruction that gets us to the MAIN procedure. Like
One of the trickier parts of the 7800’s MARIA graphics chip is understanding how to setup the display lists and display list list (DL and DLL). Even trying to put a single sprite on the screen can be tricky. In this article I will explain how to setup these data structures to get a simple sprite on the screen.
In this example we will take a very narrow scenario just to explain the basics of how to get a sprite on the screen. I will show how to display a single 16 line high by 1 byte wide spr
I’ve recently been doing some research into how scrolling games work on the 7800. I have created a demo program that shows a method for doing horizontal and vertical fine scrolling controlled with the player one joystick. I’ve tested this program on an emulator but on the actual hardware. The attached ZIP files contains the source and binary that can be used with an emulator.
Display List
The display list for the demo consists of 24, 8 line high regions. Each region will display 41 chara
Occasionally questions come up about the special “hidden” control register in the 7800, and I usually end up searching back through the forum archive for the answer, so I thought I’d finally document it somewhere I can find it!
The purpose of this control register is to switch the 7800 from 7800 mode to 2600 mode. The register can be written to using any address between $0000 and $001F. This address range overlaps the TIA so once the register is set you need to set the lock bit (see below) b