Jump to content



0

Memory map for SC kernel option


4 replies to this topic

#1 jbs30000 OFFLINE  

jbs30000

    Moonsweeper

  • 459 posts

Posted Sat Apr 5, 2008 4:10 PM

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....p;hl=memory map ?

Thank you.

#2 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,543 posts
  • Location:Georgia, USA

Posted Sun Apr 6, 2008 1:13 AM

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

#3 jbs30000 OFFLINE  

jbs30000

    Moonsweeper

  • 459 posts

Posted Sun Apr 6, 2008 3:42 AM

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.

#4 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,543 posts
  • Location:Georgia, USA

Posted Sun Apr 6, 2008 10:04 AM

View Postjbs30000, on Sun Apr 6, 2008 5:42 AM, said:

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

Attached Files



#5 jbs30000 OFFLINE  

jbs30000

    Moonsweeper

  • 459 posts

Posted Sun Apr 6, 2008 10:18 AM

Thank you, but I already have all of those files.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users