Plane remapping

For anything related to VDP (plane, color, sprite, tiles)

Moderators: BigEvilCorporation, Mask of Destiny

Post Reply
Bitybity
Interested
Posts: 36
Joined: Wed Dec 07, 2011 2:09 am

Plane remapping

Post by Bitybity » Thu Sep 06, 2012 4:07 am

Hello everyone.

From the past week, I had the idea to remake a pokemon game.

Everything was ok until yesterday, when I had to write the scrolling system.
The hardest part of this, is when I must do the map renewing code, to simulate a bigger map.
I'm stuck trying to program this part. I have no idea which formula I can follow to do this.
Can you at least give me a clue about this?

Thanks, and excuse my bad english.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Thu Sep 06, 2012 9:57 am

Did you see the genres demo ?
I have a huge plan you can scroll left / right / up / down

How I did this ?
I haven't source code here so , from what I remember (since I fought a lot with the best / speed method for thos)
1. define 64x64 scrollable plane
2. define the 2 "switch" columns and 2 rows you'll use for redraw in the middle of the initially hidden parts of the plane
3.draw up to first column, the second column and after will be the column before you.

col 0 = map[n]
col 1 = map[n+1]
col .. = map[n+..]
col 40= map[n+40] ===> first switch column
col 41= map[n-(64-41)] ===> second switch column
...
col 62 = map[n-2]
col 63 = map[n-1]


4. the REAL plane index of a switch colum will always be colIdx + (scrollHIndex / 8)%64
the REAL plane index of a switch row will always be rowIdx + (scrollVIndex / 8)%64
5. every vblank redraw the 2 columns and 2 rows from map[colIdx][...] and map[...][rowIdx] at the plane REAL index


It's what I use with the MAP Genres plugin

Bitybity
Interested
Posts: 36
Joined: Wed Dec 07, 2011 2:09 am

Post by Bitybity » Thu Sep 06, 2012 11:27 pm

I don't use GenRes, because I don't know how to work with C language (I'm 100% "lost"). I work in ASM.

As for this, I must confess something: I'm a bit newbie at this, and I don't understood half of what you told. Can you explain more in detail?

Thanks, and I'm sorry.

ammianus
Very interested
Posts: 124
Joined: Sun Jan 29, 2012 2:10 pm
Location: North America
Contact:

Post by ammianus » Fri Sep 07, 2012 2:34 am

Bitybity wrote:I don't use GenRes, because I don't know how to work with C language (I'm 100% "lost"). I work in ASM.
Out of curioisity how did you start out learning ASM before something C or C-like?

I am in great awe of people who hand-code ASM, but I've always seen C, C++ or Java taught in schools when teaching computer programming concepts. I work in Java, but now can switch back and forth fairly easy. Still don't have ability to write ASM though.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Fri Sep 07, 2012 8:33 am

I still don't know C or C++ or such... just ASM, several kinds. I find ASM a whole lot easier haha
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Fri Sep 07, 2012 9:30 am

I didn't say to use GenRes ;)
There is a demo coming with it : basic sprite, large sprite and ... large map scrolling
so you could see how I did

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri Sep 07, 2012 6:42 pm

When I started on computers, there wasn't C available... you had your choice of assembly, Forth, or BASIC. C was for mainframes or the like. C started to penetrate the home computer market in the mid to late 90's, and was often a really crappy K&R compliant homebrew compiler, or a REALLY expensive SAS compiler (seriously, they wanted over $500 for SAS C at the time).

I did get Deep Blue C for the Atari 8-bit - that was a Small C compiler that wasn't too bad made in the late 80's. But for the most part, it was BASIC's Golden Age... every platform had at least a couple different BASIC systems, be it MS's super-buggy BASIC, to BASIC compilers. BASIC dialects became very popular, like AMOS.

So many people of the time started with BASIC, but soon realized it was usually too slow. So you learned assembly so that critical portions of your BASIC program could be done as an assembly language routine instead. That led to full assembly programs. Most of my work on the Apple, Atari, and Amiga was 100% assembly. It was only after CBM went bust that C really started to hit its stride, and I started mixing a little C and mostly assembly. It wasn't until I was working on P2's and PowerMacs that it became mostly C with a little assembly rather than the other way around.

Bitybity
Interested
Posts: 36
Joined: Wed Dec 07, 2011 2:09 am

Post by Bitybity » Fri Sep 07, 2012 9:07 pm

As for me, I learned ASM by working with a sonic 1's disassemble.

Many times I tried to learn C, but I don't even understand the basics. And also, in Chile, there's no way to learn to program if it's not at the university (I know in other countries is possible to study languages at secondary schools, as I have a friend who learns about web there.).

notaz
Very interested
Posts: 193
Joined: Mon Feb 04, 2008 11:58 pm
Location: Lithuania

Post by notaz » Tue Sep 11, 2012 2:07 pm

Actually you don't need a school to learn C/asm or programming in general, you learn it by doing it. The key here is to be active in learning yourself and be persistent, not expect someone to teach you.

Post Reply