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 2017-11-20 14:50:01

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

Assembly: draw functions

Sorry for oppening another thread...

Is there any tutorial about drawing lines, circles, triangles etc in assembly?

GBDK drawing functions are very slow, and they are creating a lot of conflicts with code, it looks like they have some issue, and gbdk tends to show a lot of "overwritten address" errors when using several banks.

I only found a source code for this demo:  http://www.devrs.com/gb/files/apa.zip

It looks a bit complicated.

Thanks.

Last edited by Mills (2017-11-20 14:51:39)

Offline

 

#2 2017-11-20 15:52:32

ISSOtm
Member
From: Somewhere in Echo RAM
Registered: 2017-04-18
Posts: 160
Website

Re: Assembly: draw functions

I didn't ever write any code to draw geometric figures on the screen, so I'm pretty interested as to why you would like to do that. Afaik the Game Boy is really not designed to do that, with its tile format.


The French Lord Of Laziness.
Legend of Zelda and Undertale fan, I also tend to break Pokémon R/B/Y a little too much.

Twitter | Me on GCL | Discord : ISSOtm#9015 | Skype : isso.tm (I don't login anymore)

Offline

 

#3 2017-11-20 16:06:01

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

Re: Assembly: draw functions

ISSOtm wrote:

I didn't ever write any code to draw geometric figures on the screen, so I'm pretty interested as to why you would like to do that. Afaik the Game Boy is really not designed to do that, with its tile format.

I made a vector scene with the gbdk functions, and it runs quite well, so I was planning to include it in a demo, but it had conflicts with.. I don't know.

Also some custom asm functions would surely be faster.

So I wondered if it would be easy to make custom drawing functions.

This scene is working at around 20 fps on CGB, everything moving, the waves, the sun, the ship:


https://github.com/mills32/GAMEBOY-DEMOS/blob/master/MISC/bgb0ship.bmp?raw=true

Last edited by Mills (2017-11-20 16:32:34)

Offline

 

#4 2017-11-20 17:29:33

AntonioND
Member
Registered: 2014-06-17
Posts: 134
Website

Re: Assembly: draw functions

Mills wrote:

Also some custom asm functions would surely be faster.

As far as I know, the functions that come with GBDK for this kind of things are written in assembly. You're just not going to get them to be faster, the GB wasn't designed to be used like this...

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson