Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - someone good with art can help me with some VU needles?

Reply to topic
Author Message
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
someone good with art can help me with some VU needles?
Post Posted: Thu Nov 07, 2019 11:10 pm
I'm working on this. I had put a red dot now, but I'd like to draw proper needles (sprites). Any taker?
VU.png (9.42 KB)
VU (preview image)
VU.png

  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14688
  • Location: London
Reply with quote
Post Posted: Thu Nov 07, 2019 11:20 pm
I guess a single pixel line is what’s needed - so you could generate them on the fly. If you are plotting PSG volumes then you only have 16 possibilities - so you could pre-render (perhaps with antialiasing and shadows) and do it without sprites at all.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Thu Nov 07, 2019 11:33 pm
I guess I'm lazy and I prefer sprites ;)
  View user's profile Send private message Visit poster's website
  • Joined: 23 Aug 2009
  • Posts: 213
  • Location: Seattle, WA
Reply with quote
Post Posted: Fri Nov 08, 2019 1:42 am
If you’re looking for smooth rotation, may I introduce you to my friend Mr. Bresenham?

https://en.m.wikipedia.org/wiki/Bresenham's_line_algorithm
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Nov 08, 2019 9:50 am
I think I know him. Still I'd like to keep a very lazy approach to this ;)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14688
  • Location: London
Reply with quote
Post Posted: Fri Nov 08, 2019 10:25 am
So you want someone to draw some lines? Is this for PSG volume levels? Should they be linear or logarithmic on this scale? A “proper” VU meter should smooth the needles between levels, and rendering 60fps transitions would be nice. Failing that, you’re just drawing lines in a paint program...
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Nov 08, 2019 5:40 pm
No, I'm not just showing the current volume, even if I can switch to that mode with a button.

OK I know, I shouldn't be so lazy. Actually rendering the lines myself I could even display some 256 levels, and that would work as I'm adding the volume level over 17 frames (so max is 17*15=255)...

should I render over empty tiles and use them with sprites or should I render over existing tiles? Again I'm probably seeking the cheapest solution in terms of work to do ;)

also probably using color 15 for that it would mean that I have just to OR my rendered byte with all the 4 bitplanes... mmm...
  View user's profile Send private message Visit poster's website
  • Joined: 23 Aug 2009
  • Posts: 213
  • Location: Seattle, WA
Reply with quote
Post Posted: Fri Nov 08, 2019 7:47 pm
If you're going to use sprites, you will probably hit the 8 sprites on a line. I would suggest realtime compositing them in BG.

I wrote some compositing routines which may be of use?

https://github.com/SavagePencil/SMSFramework/blob/master/Utils/tile_routines.asm...
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14688
  • Location: London
Reply with quote
Post Posted: Fri Nov 08, 2019 8:01 pm
If your background is 8 colours or less you can draw into the high bit plane.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Mon Nov 11, 2019 2:31 pm
SavagePencil wrote
If you're going to use sprites, you will probably hit the 8 sprites on a line.


lines will mostly be vertical so I think I won't really hit that limit

Will see what I can do and will post news.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Nov 12, 2019 9:25 am
OK, I'm using this very simple line algorithm with some pre-rendered line segments (sprites) that I'm assembling so to build a longer segment and results seems interesting so far :)
needle.png (10.29 KB)
VU meter needle
needle.png

  View user's profile Send private message Visit poster's website
  • Joined: 23 Aug 2009
  • Posts: 213
  • Location: Seattle, WA
Reply with quote
Post Posted: Tue Nov 12, 2019 4:25 pm
I'd be interested to see how that differs from Bresenham's (or the integer-only variant linked in the Wikipedia article above). At some point this weekend I should revisit how Michael Abrash's highly optimized assembly version for x86 worked.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Nov 13, 2019 9:54 am
Bresenham's accumulates the 'error' and each time this goes over 0.5, it will increment the other coordinate. This is sort of less precise, but still effective enough for my needs, I'd say.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!