Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2015-11-18 15:48:47

Mills
Member
Registered: 2012-12-21
Posts: 132

GBDK Scrolling Big Maps [Working!]

Taking some ideas from the web and "fasebonus forum", I managed to code a scroll for big maps in C.

What I do, is to fill the line / column that is going to appear on screen. I made it in two steps or different frames, because GBDK is not fast enough to fill an entire line very fast.

Code:

set_bkg_tiles(POS_X, TY, 1, 1, (unsigned char *) &MapPLN0+Cnt);

Only a forward scroll is working for the moment, just like in super mario land, you can't go back. It can also work in all directions, i tested it to see cpu usage, but it is not working well now.

https://db.tt/5PI32D7U

You can see a 128x128 map, and CPU usage, DMG(green), CGB (orange):

1-Not filling lines / columns

2-Filling just one line / column
Every 8 pixels we move, just for horizontal or vertical scroll.

On CGB, we need twice CPU power, to fill the new line with colors.

3-Filling a line and a column
If we move in two directions, requires more CPU.

Optimization
We can draw every line in 4 frames, but this will need 8 frames in case we are scrolling in two directions. 4 to draw a column, and the next 4 to draw a line, for example.

I'll upload a source soon.

Last edited by Mills (2015-11-18 15:52:33)

Offline

 

#2 2015-12-19 12:26:01

bokny
New member
Registered: 2015-06-01
Posts: 4

Re: GBDK Scrolling Big Maps [Working!]

would love to see your progress on this mills. i'm currently working on a zelda style room transition system and am struggling a lot.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson