Search found 286 matches

by Miquel
Tue Jun 19, 2018 12:01 am
Forum: SGDK
Topic: Pixel,circle,square and line draw
Replies: 7
Views: 158

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). And do you know how they did it ? Perhaps using h-blank time to change x and y of sprites.. or maybe c...
by Miquel
Mon Jun 18, 2018 8:46 pm
Forum: SGDK
Topic: Pixel,circle,square and line draw
Replies: 7
Views: 158

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...
by Miquel
Sat Jun 16, 2018 12:59 pm
Forum: SGDK
Topic: Pixel,circle,square and line draw
Replies: 7
Views: 158

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.
by Miquel
Sat Jun 16, 2018 12:20 pm
Forum: Video Display Processor
Topic: disable video on vblank, better?
Replies: 7
Views: 334

Re: disable video on vblank, better?

If you do only that kind of DMAs though (entirely possible for most games actually!) then it's indeed a better option to unroll the loop . Loop unrolled, but no two queues thankfully: 0: addq.w #1, g_framesLost rte ROUTINE ExceptionVideoVerticalBlank * Check if frame is ended btst.b #gameStateNotRe...
by Miquel
Tue Jun 12, 2018 11:45 am
Forum: Video Display Processor
Topic: How h interrupt register works?
Replies: 3
Views: 199

Re: How h interrupt register works?

I just tried to disconnect display while dma'ing and works MUCH better, on real hardware I only see artefacts with sprites on a very precise line (on the top of the D), and not at all with planes.

Alien Noise (clearer than before).zip
(8.49 KiB) Downloaded 5 times
by Miquel
Sun Jun 10, 2018 9:33 am
Forum: Video Display Processor
Topic: How h interrupt register works?
Replies: 3
Views: 199

Re: How h interrupt register works?

Quite bothering indeed. That's the best explanation I have found so far: The VDP has a counter that is decremented on every line. When the counter has expired, and if bit 4 (IE1) of register #0 is set, then a level 4 interrupt will occur. The counter is loaded with the contents of register #10 in th...
by Miquel
Sat Jun 09, 2018 5:54 pm
Forum: Video Display Processor
Topic: How h interrupt register works?
Replies: 3
Views: 199

How h interrupt register works?

How "h interrupt register" reg #10 really works? I'm trying to modify it's value inside a horizontal exception to fire again in X raster lines more and it seems to completely ignore the value, instead fires again at the previous value, but strangely enough half screen later takes my value into accou...
by Miquel
Thu Jun 07, 2018 4:25 pm
Forum: Video Display Processor
Topic: disable video on vblank, better?
Replies: 7
Views: 334

Re: disable video on vblank, better?

As you say, this code not only does dma operations but also any other video operation, like setting register 0, 1, plane addresses, window position,... anything except for: - Some operations directly related to horizontal-interrupts, which must be done on spot - Fill and vpd copy dma operations, whi...
by Miquel
Thu Jun 07, 2018 11:20 am
Forum: Video Display Processor
Topic: disable video on vblank, better?
Replies: 7
Views: 334

Re: disable video on vblank, better?

I guess your small loop is to set the DMA registers right ? In this case why not just enroll the loop as the number of register to set is fixed. Yes, while in the vert-except all it does is set vdp registers, but it's length it's not fixed, it depends completely on the frame. In regular code when I...
by Miquel
Wed Jun 06, 2018 5:38 pm
Forum: Video Display Processor
Topic: disable video on vblank, better?
Replies: 7
Views: 334

Re: disable video on vblank, better?

Roger Charles. What you say seems the logical answer, but you never know how things are implemented for real, so I ask. Thanks! It's the second the I implement the vertical exception routine and both times I have find myself thinking about this. This time I have reduced the vertical exception to bas...
by Miquel
Sun Jun 03, 2018 12:50 am
Forum: Video Display Processor
Topic: disable video on vblank, better?
Replies: 7
Views: 334

disable video on vblank, better?

Makes any difference disabling the display at the beginning of a vertical blank in terms of upload speed to vpd memory?, basically doing dma copy (68k ram->vdp ram). And then enabling it, hopefully inside the same vblank. Another related question: why sega docs says dma flag must be set on and off a...
by Miquel
Thu May 31, 2018 12:38 pm
Forum: Megadrive/Genesis
Topic: Loop Unrolling - Optimal Unrolling Factor?
Replies: 7
Views: 233

Re: Loop Unrolling - Optimal Unrolling Factor?

Making speed code optimizations is the root of all devils, unless the development is finished you code is final and you have speed problems I would never recommend to do them, and only if you maintain two versions of your code. Usually it's much more rewarding and safe to do structural optimizations...
by Miquel
Thu May 31, 2018 2:47 am
Forum: Megadrive/Genesis
Topic: Loop Unrolling - Optimal Unrolling Factor?
Replies: 7
Views: 233

Re: Loop Unrolling - Optimal Unrolling Factor?

Ok, but what exactly are you trying to optimize? or it's just a 'magic' formula, not matter what, a guidance oblivious of goal and circumstances?
by Miquel
Thu May 31, 2018 2:15 am
Forum: Megadrive/Genesis
Topic: Game loops and Vertical Blank interupts
Replies: 29
Views: 1005

Re: Game loops and Vertical Blank interupts

Unless I misunderstand you that's more or less how my last example works, or how SGDK works.

Since 68K has bit specialized instructions could be better to just use a bit of a variable.
by Miquel
Wed May 30, 2018 9:34 pm
Forum: Megadrive/Genesis
Topic: Loop Unrolling - Optimal Unrolling Factor?
Replies: 7
Views: 233

Re: Loop Unrolling - Optimal Unrolling Factor?

(iterations*10)^1/2

Why this formula is the optimal?
An educated guess, perhaps?