Pixel,circle,square and line draw
Moderator: Stef
-
- Interested
- Posts: 19
- Joined: Mon Jul 03, 2017 2:23 pm
- Location: Sao Paulo -Sp
- Contact:
Pixel,circle,square and line draw
hello guys,
I'm trying to create lines, pixels, circles and squares that appear on screen by sgdk, I know there's a function, but nn I'm getting it, could anyone help me
I'm trying to create lines, pixels, circles and squares that appear on screen by sgdk, I know there's a function, but nn I'm getting it, could anyone help me
The Mega Drive Will Never Die In Our Hearts.
Project Leyria RPG for Sega Mega Drive / Genesis
https://gendev.spritesmind.net/forum/vi ... php?t=2728
Project Leyria RPG for Sega Mega Drive / Genesis
https://gendev.spritesmind.net/forum/vi ... php?t=2728
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Re: Pixel,circle,square and line draw
Look at the BMP commands. You can set pixels, draw lines, or draw polygons. If you use enough sides in the polygon, it'll appear circular.
Re: Pixel,circle,square and line draw
Or just draw circles and lines through tiles (sprites or planes) were Geny excels on. MD hardware wasn't designed to draw using bitmaps, Stef simulated it but with a performance penalty.
HELP. Spanish TVs are brain washing people to be hostile to me.
-
- Interested
- Posts: 19
- Joined: Mon Jul 03, 2017 2:23 pm
- Location: Sao Paulo -Sp
- Contact:
Re: Pixel,circle,square and line draw
I'm doing rain and snow effects for my rpg, I'll analyze if I get more perfomance like this or with tiles.
Although I have already seen that the functions are very different from the "line" of the Amiga and Msx.
Although I have already seen that the functions are very different from the "line" of the Amiga and Msx.
The Mega Drive Will Never Die In Our Hearts.
Project Leyria RPG for Sega Mega Drive / Genesis
https://gendev.spritesmind.net/forum/vi ... php?t=2728
Project Leyria RPG for Sega Mega Drive / Genesis
https://gendev.spritesmind.net/forum/vi ... php?t=2728
Re: Pixel,circle,square and line draw
On a bitmap device (like a traditional PC) drawing lines and circles it's a very easy/basic arithmetic operation probably convenient for starters, but no on tile devices like MD.
I also recently pondered this functionality for my game and I can tell you the drawbacks of bitmap 'mode' on MD are:
- It uses a plane
- It uses a significant part of the vram
- Effectively lowers the resolution
- Takes a lot of cpu (it depends on how many raster ops)
- Lower fps
- Takes all (or a loooooot) bandwidth with vdp
The advantage is as long you have cpu available you can draw unlimitless.
You can reproduce rain/snow with sprites but with a 80 unit limit; or also you can use a plane with repeated pattern plus scroll(s) for better results and much less pain.
I also recently pondered this functionality for my game and I can tell you the drawbacks of bitmap 'mode' on MD are:
- It uses a plane
- It uses a significant part of the vram
- Effectively lowers the resolution
- Takes a lot of cpu (it depends on how many raster ops)
- Lower fps
- Takes all (or a loooooot) bandwidth with vdp
The advantage is as long you have cpu available you can draw unlimitless.
You can reproduce rain/snow with sprites but with a 80 unit limit; or also you can use a plane with repeated pattern plus scroll(s) for better results and much less pain.
HELP. Spanish TVs are brain washing people to be hostile to me.
Re: Pixel,circle,square and line draw
There's a game (forgot the name now) that multiplexes two sprites across the screen and uses them to do snow (the multiplexing is needed to avoid hogging the whole sprite table with snow sprites).Cristiano Sword wrote: ↑Mon Jun 18, 2018 5:45 pmI'm doing rain and snow effects for my rpg, I'll analyze if I get more perfomance like this or with tiles.
Although I have already seen that the functions are very different from the "line" of the Amiga and Msx.
If you don't need a separate plane for background (e.g. no parallax, or only linescroll or software-rendered parallax) you'd be better off using one of the tilemap layers for the job instead.
Sik is pronounced as "seek", not as "sick".
Re: Pixel,circle,square and line draw
And do you know how they did it ?
Perhaps using h-blank time to change x and y of sprites.. or maybe changing the address of the sprite table...
HELP. Spanish TVs are brain washing people to be hostile to me.
Re: Pixel,circle,square and line draw
It just rewrites those sprite entries during hblank interrupts (possibly just the X and Y coordinates - an autoincrement of 6 can help here).
Note that you don't need to rewrite them every line (that'd be slow), just fast enough that it matches the difference between two uses of the same sprite (which was 8 lines in that case I think? would need to look up which game it was again to tell you). You don't even need to rewrite both sprites in the same line, you could alternate between each of them every time.
Note that you don't need to rewrite them every line (that'd be slow), just fast enough that it matches the difference between two uses of the same sprite (which was 8 lines in that case I think? would need to look up which game it was again to tell you). You don't even need to rewrite both sprites in the same line, you could alternate between each of them every time.
Sik is pronounced as "seek", not as "sick".
-
- Interested
- Posts: 19
- Joined: Mon Jul 03, 2017 2:23 pm
- Location: Sao Paulo -Sp
- Contact:
Re: Pixel,circle,square and line draw
I will try with sprites or a plan, thanks for the information, so I have managed to do post here in the forum
The Mega Drive Will Never Die In Our Hearts.
Project Leyria RPG for Sega Mega Drive / Genesis
https://gendev.spritesmind.net/forum/vi ... php?t=2728
Project Leyria RPG for Sega Mega Drive / Genesis
https://gendev.spritesmind.net/forum/vi ... php?t=2728