• Please review our updated Terms and Rules here

PET 2001-8C glitches when screen is redrawn/cleared...

So this means there shouldn't be any snow then... so the "I/O chip" (the VIA I guess) could perhaps not be functioning properly, or something else in that circuit?

This is possible if the VIA always read a zero instead of the true state of the Sync signal. Do you have another 6522 VIA you can try in the A5 socket?
 
I can borrow from a VIC-20, I have three (or four), might need to desolder.

I played Galaxy Invaders today ( ftp://www.zimmers.net/pub/cbm/pet/games/english/space invader.prg ), picture was glitch free the whole game, glitches only appeared when starting a new level or between game screen and text screen. So basically when screen was cleared. Fun playing a fast game with a lot of sound - I was considering making a color-overlay and attach to the screen - like the ones for Vectrex. Color-gaming on PET 2001...

That "Fire" game has a small ML routine at 826 IIRC, when I just ran the SYS command for that I got the glitches.


I'll check my VIC:s, these are in the 1541 as well... might have one of those in a socket perhaps...
 
No, swapping 6522 didn't make any difference. It's possible there's a problem with the socket maybe, I can check continuity unless you have other ideas?

I tried swapping the 6502 as well since it was socketed in the VIC as well - as expected, no change.

I'm wondering if my temporary eprom adapter on veroboard could be the problem, wrong speed rom, interference. It's not beautiful but it got the machine started.
Going to have a proper board made at work on Thursday.

IMG_20151231_224110.jpg
 
Last edited:
That "Fire" game has a small ML routine at 826 IIRC, when I just ran the SYS command for that I got the glitches.

Yes, that's the killer POKE that allows writes to the screen without waiting for vertical retrace time. So that snow is expected. Note that after you run that game program, it is important to reset the PET to clear out the effects of the POKE.
-Dave
 
Don't think that routine is the killer POKE, I tried that poke with "Fire", there was snow all the time and game was a bit faster.

I disassembled it in VICE, looks like this:


Code:
.C:033a  A0 FF       LDY #$FF
.C:033c  84 01       STY $01
.C:033e  A0 84       LDY #$84
.C:0340  84 02       STY $02
.C:0342  A0 00       LDY #$00
.C:0344  A9 00       LDA #$00
.C:0346  A2 00       LDX #$00
.C:0348  B1 01       LDA ($01),Y
.C:034a  C9 DF       CMP #$DF
.C:034c  F0 03       BEQ $0351
.C:034e  4C 58 03    JMP $0358
.C:0351  A9 E9       LDA #$E9
.C:0353  91 01       STA ($01),Y
.C:0355  4C 7F 03    JMP $037F
.C:0358  C9 E9       CMP #$E9
.C:035a  F0 03       BEQ $035F
.C:035c  4C 66 03    JMP $0366
.C:035f  A9 DF       LDA #$DF
.C:0361  91 01       STA ($01),Y
.C:0363  4C 7F 03    JMP $037F
.C:0366  C9 CD       CMP #$CD
.C:0368  F0 03       BEQ $036D
.C:036a  4C 74 03    JMP $0374
.C:036d  A9 CE       LDA #$CE
.C:036f  91 01       STA ($01),Y
.C:0371  4C 7F 03    JMP $037F
.C:0374  C9 CE       CMP #$CE
.C:0376  F0 03       BEQ $037B
.C:0378  4C 7F 03    JMP $037F
.C:037b  A9 CD       LDA #$CD
.C:037d  91 01       STA ($01),Y
.C:037f  C6 01       DEC $01
.C:0381  F0 03       BEQ $0386
.C:0383  4C 48 03    JMP $0348
.C:0386  C6 02       DEC $02
.C:0388  A9 FF       LDA #$FF
.C:038a  85 01       STA $01
.C:038c  E8          INX
.C:038d  E0 04       CPX #$04
.C:038f  F0 03       BEQ $0394
.C:0391  4C 48 03    JMP $0348
.C:0394  60          RTS

Don't know what it does exactly, update graphics? Collision check?
 
It goes through the screen memory (assuming 40 columns) swapping $DF <-> $E9, and $CD <-> $CE, I assume to create the flame effect.

edit: I just noticed that there's a bug in it as well. It will not check locations $8000, $8100, $8200 and $8300 as inner loop starts with $FF in location $01 and decrements until BEQ is true. If the LDY #$FF at $033a and the LDA #$FF at $0388 was changed to #$00, it should work correctly. :)
 
Last edited:
Don't think that routine is the killer POKE, I tried that poke with "Fire", there was snow all the time and game was a bit faster.

I don't have that program handy for my PET, but on my PC, I briefly looked at the hex dump of the Fire program and I see what looks like tokens for POKEs in the 59464 thru 59467 area which I think is the VIA. It is close to a GOSUB 6000.
-Dave
 
It misses the killer poke address then (59458), 59464 is timer lo, next is timer hi and then:

http://www.6502.org/users/andre/petindex/progmod.html#via
Code:
E84B    ACR     Aux. control register; set to $00 at power on
                7-6 timer 1 control
                5   timer 2 control
                4-2 shift register control
                1   port B latch
                0   port A latch
E84C    PCR     Peripheral Control Register; set to $0C or $0E at power on
                7-5 CB2 control (user port pin M) (note 3)
                4   CB1 control (note 3)
                3-1 CA2 control (graphics mode) (note 3)
                0   CA1 control (note 3)

Maybe the sound there on CB2.


Note 3: CA1 is connected to pin B of the user port. Pins B-L correspond to
port A, which is invariably E84E. CB2 (connected to the shift register) also
connects to pin M of the user port; square wave tones (see chapter 9 of
"Programming the PET/CBM") use these facts. CB1 signals input from cassette
#2. CA2 controls screen graphics: it is configured for output, and, when
low, gives lower case characters and others. When high, the mode is upper
case and graphics.
 
Last edited:
Ok, so I finally got around to plugging in my 2001 (Original model 6550 based motherboard) and running fire.
It's the same as yours. See the video here.

https://youtu.be/kikLnI72N2I


You'll find quite a few games that have screen garbage on the 2001 versus the newer models.

Later,
dabone
 
You'll find quite a few games that have screen garbage on the 2001 versus the newer models.

That is interesting. So even with not using the 'Fast Print' POKE, one can still get some snow. I had forgotten. I bought a 2001-8 in late 1978 and was so happy to have a real computer at home rather than lining up to use a time share terminal at work, I must have too overjoyed to notice!

Can you try eFrogs three line BASIC program to see about the strange behavior at the lower right of screen? I suppose things can happen when the CPU and video refresh are allowed to read/write into the video RAM at the same time.
-Dave
 
Good, so it's not something that's broken.

I saw some article about someone correcting a phase difference on some pulse with a cap over an IC, but perhaps this is a bit too much stuck in the system to fix.
Wonder if updating ROM:s would change anything or upgrading video ram to modern chips...

dabone - you don't happen to have any such modern upgrades to test with? The under-cpu ram/rom replace would be a nice thing to test.

Not a big problem, it's not a great game, I wonder if it can be rewritten into a non-glitching version, maybe it just needs to be synced to a screen refresh or similar.

Galaxy Invaders is rock sold though. ;-)
It's getting time to make my own games, it seems some things are missing from the library.

Thanks for your help guys - so at least we have the same problem on two machines.
 
If someone has the real hardware to hand, would they care to try this updated version?

http://inchocks.co.uk/commodore/PET/fire3.prg

I tweaked the ML routine to wait for the retrace before it starts updating the screen RAM and also to speed it up by only checking from location $8100 as I don't think the flames can get any higher. Nevertheless, it's got a lot to do so I'm sceptical if it'll work.

cheers, Rob
 
No noticeable difference, still same type of interference, I'm leaning towards more glitches but I'd have to compare it, it's not less.
 
Could be something else that causes it, if I list program and write the SYS826 I get one blink of glitches, if I clear the screen and write it in the corner there's nothing so it seems it's what is displayed on screen that is thrown out on screen in the wrong spot in some circumstances. So maybe screen is open to write when it not supposed to be, maybe a delay is needed somewhere...
 
Probably because the routine only writes to screen memory if it finds one of the four characters that comprise the flames. Try putting one char somewhere in the bottom half of the screen.
 
Back
Top