Jump to content
  • 0
rje

Is VERA's 2nd Layer random?

Question

In my game "Rogue Forest", I write the forest map on Layer 2... and originally, that layer looks to have random data on it.

Is it?

Or is it a pattern?

I took two screen shots (ok only two), and they look like they might be completely different to me, which would suggest "totally random".  But of course TOTALLY random is impossible.

I was just wondering.

Actually, I was wondering if that's EXPLOITABLE by me in my games?  A totally[sic] random set of data with each new boot-up?

 

Screen Shot 2020-10-20 at 2.04.19 PM.png

Screen Shot 2020-10-20 at 2.04.46 PM.png

Edited by rje

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

By default , layer "2" (technically layer 1, which is above layer 0) is the text layer at startup, so its contents are just what's on the screen, with the header and READY prompt. When you change the map base address in $9F35 (the default value is zero), it will just have whatever was in VRAM at that location, which appears to be random in the emulator between the end of the text map and the beginning of the palette (this includes the PSG registers, which will also read random values). This may not be how the actual VERA VRAM will be behave in hardware, as this is likely just uninitialized host RAM in the emulator.

Share this post


Link to post
Share on other sites
  • 0
10 minutes ago, SlithyMatt said:

This may not be how the actual VERA VRAM will be behave in hardware, as this is likely just uninitialized host RAM in the emulator.

That's a good point, and I was wondering if a real FGPA will simply have zeros or a constant-fill in RAM ($DE $AD $DE $AD $DE $AD...).  Randomization is never free, and never random.

 

Edited by rje

Share this post


Link to post
Share on other sites
  • 0

My guess is that if the FPGA uses SRAM for the VRAM, that depending on the implementation will start out all 0s or 1s ($FF). If it can do DRAM, then it will be random. Either way, no point in depending on one or the other in your code.

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

The emulator was programmed to contain random data because supposedly that mimics the hardware's state. I couldn't tell you whether that's an assumption or whether that was informed by conversations with the VERA's designer, Frank van den Hoef. Since Frank wrote the original implementation of the VERA emulation, I'm assuming it's how the hardware actually behaves.

Share this post


Link to post
Share on other sites
  • 0

Heh.  I guess we will see.

 

I tell ya, a pile of random numbers in video RAM would be interesting.  I'm not betting on it though.

 

 

Share this post


Link to post
Share on other sites
  • 0

I am not sure about the emulator, but I would expect RAM on physical hardware to contain random data on bootup.

Unless the RAM is actually initialized at power on by some other hardware/software.

  • Thanks 1

Share this post


Link to post
Share on other sites
  • 0

Just stumpled over this in the VERA Programmers Reference: "Since the VRAM contains random values at startup the values read back in the register area will not correspond to the actual values in the write-only registers until they are written to once."

Source: https://github.com/commanderx16/x16-docs/blob/master/VERA Programmer's Reference.md#vram-address-space-layout

Edited by JimmyDansbo

Share this post


Link to post
Share on other sites
  • 0
7 hours ago, JimmyDansbo said:

Just stumpled over this in the VERA Programmers Reference: "Since the VRAM contains random values at startup the values read back in the register area will not correspond to the actual values in the write-only registers until they are written to once."

Source: https://github.com/commanderx16/x16-docs/blob/master/VERA Programmer's Reference.md#vram-address-space-layout

I verified this when I wrote my PSG demo. I had to write out default values on startup to sync the display with the settings, as reading uninitialized VRAM registers was inaccurate.

Share this post


Link to post
Share on other sites
  • 0

Yes that is correct. the same happens with default palette. At startup the memory addresses from $1FA00 to $1FBFF do not contain actual color definitions, which is kind of confusing especially because older versions of Emulator/VERA did.

Share this post


Link to post
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.

Guest
Answer this question...

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


×
×
  • Create New...

Important Information

Please review our Terms of Use