Jump to content

Shake Screen

Recommended Posts

Hi. I am trying to recreate a program that I wrote 30+ years ago in Atari Basic. I necer got to the point of hooking up a floppy drive to a modern computer and a few years ago, I was moving and gave away all my Atari stuff including the disks. Anyway, one effect I remember doing, but cannot remember how (I probably stole it from another game in one of my Antic magazines) was shaking the screen.


Basically, when the avatar you are controlling is caught by the bad guy, I had an effect that would viloently shake the screen. I think it was done by poking somewhere to make the Atari display the screen differently, but it might also have been an assembler routine.


Does anyone know how to do this, and if so, could you please share some code?


Than you.


Link to comment
Share on other sites

First, here's a tiny BASIC program which will give you your Display List:

20 DLIST=PEEK(560)+256*PEEK(561)
30 FOR A=0 TO 31

The first 3 values are 112 ($70 in HEX) which means display 8 lines. The following values are the codes for blank lines:

$00		0		1 blank lines
$10		16		2 blank lines
$20		32		3 blank lines
$30		48		4 blank lines
$40		64		5 blank lines
$50		80		6 blank lines
$60		96		7 blank lines
$70		112		8 blank lines

Now that we know the location in memory for those blank lines, and we also have 24 by default and cannot go over this, the following program will move the screen.

20 DLIST=PEEK(560)+256*PEEK(561)
30 FOR A=0 TO 7
40 POKE DLIST, (A*16)
70 GOTO 30
Link to comment
Share on other sites

Vertical is easy - just have about 50 zeros at the start of Display List, normally point to the middle then vary the pointer to get that shake.


Horizontal a bit harder. You could do it with horizontal scrolling but enabling that means the memory fetched per scanline increases by 20%

You'd need a DList with an LMS per line, also you'd probably want to pad zeroes each side per displayed line which would change the entire dynamics of generating the display.

A better method might be to use an asm routine to copy the screen to a temporary alternate location with the changed layout.

Link to comment
Share on other sites

@stephen, Thank you for the reply. Unfortunately, it looks like your sample code at the bottom is the same as the sample code at the top. The actual shaking code appears to be missing.


Thank you.

Grrr - I hate this editor. It screwed my post TWICE! I corrected the original post.

Link to comment
Share on other sites

Isn't that an interesting idea?

Using a POKEY timer at 15kHz for forming a fixed PMg picture by sheer multiplexing?


Then testing the behavior of any Graphics mode.... just like moving objects in character memory, or doing animations in Antic D.... GTIA modes ... whatever...

So - setup a PoKey timer at 15kHz - we get an interrupt per scanline. How many registers can we change per scanline? I'm thinking 8? I wonder what could actually be done with just PM/G and colour or sizing changes?

Link to comment
Share on other sites

But this would be easy for non-character modes only. In character modes you'd have to take into account badlines and execute a different code. Possibly not worh the fuss and easier with DLIs.

"Shaking" the screen via DL commands, also will move the DLIs. You had to take care of everything then.

"Shaking" the screen via DL commands and using a pokey timer, will correct things automatically. Using the "PM multiplexing, allows to use PMg everywhere. So in some circumstances, char modes have to be shortened to 32 bytes when scrolling is used 40Bytes.


If you do a program, that checks a special code for DLI needed everytime , you miss the point.

Edited by emkay
Link to comment
Share on other sites

Generally I agree, but the case is in DLI you might know quite easily where the badline is, with POKEY interrupts it would not be so easy, so you'd need to constrain code to the worst case (I am just repeating what you wrote, so no new data here).

POKEY timers would do some "auto correction".

And, again, that part of the A8 is a little underdiscovered ;)

Multiplexing the PMg doesn't usually mean to pull all resources, depending on the nature of the PMg to fill the y position automatically.

But, keep in Mind, After a "multiplexed" PMg screen is placed, you could move a softwaresprite, bigger than the screen, jumping on platforms, or use to have a great HUD, and to use low res graphics for fluent "3d" projection. Either using Antic mode 7 , for some colourful spaceshooter , or Antic B for "irregular speed" ;)


Or mix different resolutions....

You have a slight touch of that in Rescue on Fractalus.

Really. I still hope that people rethink stuff, as the "PMg" easily can be used for a "less detailed" overlay, while detail grow by using the playfield for details of moving objects.

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.

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.


  • Recently Browsing   0 members

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