Jump to content
IGNORED

Pokey poly counter noise output?


OxC0FFEE

Recommended Posts

I've been looking at the De Re Atari chapter on the POKEY and I'm trying to figure out if the output of the noise generator is output to a register anywhere. From the diagram on this page showing the poly counters it appears not; the output seems to go directly to the speaker. Is this true though?

 

PEEKing the sound registers while playing sound does not appear to achieve this — though it does return what appears to be waveform values:

sound 0,121,10,8

while 1
  pos. 2,0
  for x=53760 to 53775
    ? x,peek(x)
  next x
wend

I'd like a native, fast source of noise (note, not randomness) and thought that it would be convenient to use the noise generator's output directly, if possible.

Edited by OxC0FFEE
Link to comment
Share on other sites

1 hour ago, popmilo said:

Can you elaborate on the difference between noise and randomness in this case ?

 

I'm working on a procgen asteroid/space tenline basic game. I've considered regular noise algorithms, diamond-square terrain gen, cellular automata like for dungeon generation, and other methods. I was hoping to find a native source of something non-"random", but closer to perlin noise or at least selectable (think octaves of noise). Math on the CPU is slow, constructing and consulting lookup tables seems a bit heavy in a short basic program. I'm looking for a cheap, native hack like HSW's Yar's Revenge trick of displaying the ROM data in a player to make interesting looking 2d outlines of planetoid surfaces.

  • Like 1
Link to comment
Share on other sites

5 hours ago, OxC0FFEE said:

I've been looking at the De Re Atari chapter on the POKEY and I'm trying to figure out if the output of the noise generator is output to a register anywhere. From the diagram on this page showing the poly counters it appears not; the output seems to go directly to the speaker. Is this true though?

The output of the poly counters is not available for the CPU, no, except for the longest polycounter, whose value is available at $D20A. If you read the pokey frequency register, you read the values of the POT counters.

Link to comment
Share on other sites

The RANDOM register returns a sample from the noise output which is used for AUDCn value $8x.

 

The "noise" poly-counter output will either be 17 or 9 bits depending on the AUDCTL setting (9-bit is almost "regular") and only goes through a sequence 511 times where 17-bit is over 130,000.

 

Note it's not truly random - totally deterministic - and in 9-bit mode even less random.  But programatically it's usually sampled at non-regular intervals so is sufficient.

 

Note also that the noise sampling by Pokey (in fact all audio generation except forced volume) generates a 0 or 1 value at the point in time which then has the voice's volume level applied.

Edited by Rybags
  • Like 1
Link to comment
Share on other sites

22 hours ago, OxC0FFEE said:

I'm working on a procgen asteroid/space tenline basic game. I've considered regular noise algorithms, diamond-square terrain gen, cellular automata like for dungeon generation, and other methods. I was hoping to find a native source of something non-"random", but closer to perlin noise or at least selectable (think octaves of noise). Math on the CPU is slow, constructing and consulting lookup tables seems a bit heavy in a short basic program. I'm looking for a cheap, native hack like HSW's Yar's Revenge trick of displaying the ROM data in a player to make interesting looking 2d outlines of planetoid surfaces.

Had to google "diamond square terrain gen" to realize that's exactly what I used in Monk game for terrain height map :)

I did put additional filter (kind of circular height map function that depended on distance from center of map so I would get lowest height on edges of map, so in the terrain looked like an island.

 

Please share if you find some cool, fast hack, as we all could use one :)

Good luck !

 

  • Like 1
Link to comment
Share on other sites

On 12/20/2021 at 1:40 PM, popmilo said:

Had to google "diamond square terrain gen" to realize that's exactly what I used in Monk game for terrain height map :)

I did put additional filter (kind of circular height map function that depended on distance from center of map so I would get lowest height on edges of map, so in the terrain looked like an island.

 

Please share if you find some cool, fast hack, as we all could use one :)

Good luck !

 

@popmilo a link to your Monk game? I'm curious

Link to comment
Share on other sites

3 hours ago, OxC0FFEE said:

@popmilo a link to your Monk game? I'm curious

Think this topic should have most of interesting info about it :)

 

It's basically my take on a small game that Minecraft author Notch did for one of those 48h LudumDare compos called "minicraft". Player goes around 2d map, chopping wood, digging earth and stone and kills zombies. Plan was to make full crafting part of game, but didn't have enough time in the end. That's why now I have Monk2 in my project folder :)

 

You can see terrain generator code working in phases when game starts.

 

  • Like 1
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.

Guest
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.

Loading...
  • Recently Browsing   0 members

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