Sharing technical information

Talk about anything else you want

Moderator: BigEvilCorporation

ElBarto
Very interested
Posts: 160
Joined: Wed Dec 13, 2006 10:29 am
Contact:

Post by ElBarto » Wed Mar 25, 2009 7:20 am

I've setup a wiki a long time ago, not enough time to write on it thought http://wiki.megadrive.org/index.php/Main_Page
Since last week I've redo some work on megadrive so I think I'll soon update/create a lot of page on this wiki.

koilazka
Interested
Posts: 30
Joined: Mon Nov 30, 2009 1:51 am

Post by koilazka » Sun Apr 18, 2010 4:34 am

ElBarto feel free to modify and add to your wiki if you want to. I wasnt sure how to.




Images are hosted and loaded from imageshack.us directly i think..
But if this is using up spriteminds.net bandwidth, tell me.

Anyway, i havnt written a map processor, engine, or whatever you call it yet.
But ive written some notes down, how it might be done.
I will be trying to write one in the future, in assembly, for games.
This is one project for me, it'll take a while, whole things a bit big.

These are just dev notes, abstract thinking, not much code just ways of doing stuff, "Technical Info", where do i post it.

One thing i found kinda anoying, you can only really use one 1024x1024 Plane, they take $8000 VRAM.




// Example Info

MAX MAP size V1024 H2048, thats like 4 512 planes accross.
Would be a small map for sonic, but a good size.

Plane blocks would be 32 x 32 written with block_pointers in a abstract map_sheet.
The map_sheet is an array of 8 bit block_pointers -bbbbbbb 128 different blocks, extra bit reserved.
A 2 x 4 Map_Sheet would take $800 RAM (2048 blocks) with the extra bit.




Memory stuff

Code: Select all

// DISPLAY VXX H40 2*PNT 512	$5640 USED    $A9C0 MAX FREE
PNT W		$1000
PNT 512	$2000
PNT 512	$2000
SAT		$280		80 sprites
Hscroll	$3C0

// VRAM $A000 FREE
One Pattern		  $20 VRAM
One Block		  $80 VRAM		could just load visible data, but anyway
128 Blocks		$4000 VRAM		could load every map block ready
						that would leave $6000 VRAM (blocks are for both planes)
// RAM abstract MAP
map planes		   2 x 4		8 planes
block size		  32 x 32		4 patterns
blocks per plane	  16 x 16		256 blocks
map_sheet		  32 x 64		2048 blocks		$800 RAM
block bitmap		  32 x 64		2048 blocks		$100 RAM


Block VRAM $0000 - $3FFF

512 PLANE + window
Image

8 Abstract planes will be written to the real_background_plane dependant on the MANXY position.

window window
MANXY player position
CHAXY player sprite position
PLANE real_background_plane
MAP map_sheet

The the window doesnt move, the PLANE does.
The MAP pattern order is the same, but segmented into planes (Easier to decode).

MAP
Image

MAP 0
Image

MAP 0, 1, 4, 5
Image




All variables will be derived from MANX and MANY.

MANX = 0 (minimum X position)
CHAX = 128 (window left edge)
PLANEX = 0 (plane left edge)
Image

MANX = 512 (X position)
CHAX = 256 (window center)
PLANEX = 350 (from window X)
Image





The MAP needs to be loaded into the PLANE before the wait loop & before video update.
4 MAP segments mabey used at one time, this part will take alot of good program design.

All variables are derived from MANXY, to get the right patterns from the MAP to the PLANE:

Calculate Hscroll position.
Calculate Fake window position relative to the MANXY position.

In the below example you would use that fake window position and from that..
Execute a plane loader function 4 times (MAP x,y,width,height -> PLANE x,y,width,height)
MAP 0 -> PLANE
MAP 1 -> PLANE
MAP 4 -> PLANE
MAP 5 -> PLANE

Image

:P

Post Reply