ASIC Trace Table Question

Ask anything your want about Mega/SegaCD programming.

Moderator: Mask of Destiny

Post Reply
Ralakimus
Interested
Posts: 18
Joined: Mon Nov 30, 2015 12:38 pm

ASIC Trace Table Question

Post by Ralakimus » Mon Nov 30, 2015 12:44 pm

I've been working with the MegaCD lately, and after some research, I've come to understand how the ASIC works...for the most part.

The only thing I have been rather confused on is how the trace table is formatted and how it works. Looking at a manual didn't really help me much, and experimenting didn't help much. I've tried all I could to look it up, but to no avail. All I understand is that it involves a starting X and Y value, and X delta and Y delta values for each entry.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: ASIC Trace Table Question

Post by Stef » Mon Nov 30, 2015 1:14 pm

From what i remember you have a vector table giving :
- the X,Y start position in source image
- a list of X,Y vector which give you the X, Y step to add after each pixel read in source image.
you have as many entry in the vector list than the Y size of the output buffer (one vector per Y line).

Ralakimus
Interested
Posts: 18
Joined: Mon Nov 30, 2015 12:38 pm

Re: ASIC Trace Table Question

Post by Ralakimus » Tue Dec 01, 2015 12:39 am

After doing more experimenting with what Stef said in mind, it definitely has helped me understand the trace table more.

Thanks!

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: ASIC Trace Table Question

Post by Sik » Thu Dec 03, 2015 2:35 pm

Yeah, it's pretty trivial actually. For future reference if somebody else needs (remember start/delta values aren't integers):

Code: Select all

x = start x
y = stary y
for each pixel
    draw texture[x][y]
    x = x + delta x
    y = y + delta y
Sik is pronounced as "seek", not as "sick".

Orion_
Very interested
Posts: 52
Joined: Mon May 02, 2011 2:26 pm
Location: France
Contact:

Re: ASIC Trace Table Question

Post by Orion_ » Sun Feb 07, 2016 2:13 pm

can someone post a source code example on how to use this rotation feature of the mega cd ?
the official sega sdk documentation is not very crystal clear on how to use it, and I didn't find any open source example of this :/
Retro game programming !

Ralakimus
Interested
Posts: 18
Joined: Mon Nov 30, 2015 12:38 pm

Re: ASIC Trace Table Question

Post by Ralakimus » Sun Oct 14, 2018 12:40 pm

So, I've managed to get rotation to work, but I have one more problem: it's not centered. Right now, I have the start X and Ys use the standard rotation algorithm and I have the deltas be the cosine and sine of the angle. I am not sure how I would put centering into the equation.

EDIT: Solved, I subtracted the center to the x and y and then add them back at the end and it worked.

Post Reply