Jump to content
IGNORED

Memory map for SC kernel option


jbs30000

Recommended Posts

I'm having to re-write my QBert game, and one way I thought that I could cut down on code is to write to the screen directly.

 

In the standard kernel var0-47 are used, but I'm using the SuperChip option and const pfres=32 and the vars don't work.

 

So I'm curious about a few things:

_1) Which memory locations are used?

_2) Do they have names, or do you use their hex address to access them?

_3) If you know the answer to the 2 questions above, could you be able to post an SC memory map similar to what's posted here http://www.atariage.com/forums/index.php?s...p;hl=memory+map ?

 

Thank you.

Link to comment
Share on other sites

In the standard kernel, there are two factors that affect the location of the playfield RAM-- whether or not the Superchip option is being used, and whether or not the pfres option is being used.

 

If the Superchip option is *not* being used, then the playfieldbase is set to $A4.

 

If the Superchip option *is* being used, then the playfieldbase is set to $10D0.

 

If the pfres option is *not* being used, then the playfield is set to the playfieldbase. If the Superchip option is *not* being used, that means the playfield is at $A4 through $D3, which are named var0 through var47. If the Superchip option *is* being used, that means the playfield is at $10D0 through $10FF, which don't have names unless you're using the superchip.h include file, in which case they're named r080 through r127.

 

If the pfres option *is* being used, then the playfield is set to the playfieldbase minus (4 times (pfres minus 12)). That means the playfield's location will vary depending on the value of pfres:

 

Without the Superchip:

 

pfres = 1, playfield = $D0 through $D3

pfres = 2, playfield = $CC through $D3

pfres = 3, playfield = $C8 through $D3

etc.

 

With the Superchip:

 

pfres = 1, playfield = $10FC through $10FF

pfres = 2, playfield = $10F8 through $10FF

pfres = 3, playfield = $10F4 through $10FF

etc.

 

Notice that the number of bytes used by the playfield is 4 times pfres, and the last row is always in the same place-- either $D0 through $D3 (without the Superchip), or $10FC through $10FF (with the Superchip). The start of the first row will move depending on pfres.

 

If you want to write directly to the playfield RAM when the playfield is located in the Superchip RAM, you'll need to be aware that the Superchip has different read and write addresses. The write addresses are in the first 128 bytes of the Superchip ($1000 through $107F), and the read addresses are in the second 128 bytes ($1080 through $10FF). When I wrote the superchip.h include file, I defined the 128 write addresses as w000 through w127, and the 128 read addresses as r000 through r127. When writing to the Superchip playfield, be sure to use the w000 through W127 variables.

 

Michael

Link to comment
Share on other sites

Thank you. Now that you mention it, I do remember reading about r000 through r127 and w000 through w127, but had completely forgotten until now (I have very crappy memory).

Anyway, this should be a big help. Thanks again.

Just be careful, because the online help talks about them, but the superchip.h file was left out of the 1.0 release package, nor was it included in the includes file for Superchip games. If you try to use those variables and get a compile error, you can fix it by unzipping the attached file into your Includes directory.

 

The attachment also contains the two files needed to create Superchip games with the multisprite kernel, but you have to put "set includesfile multisprite_superchip.inc" as the first line of your program for that.

 

Michael

superchip.zip

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