Outrun style road demo MSX2

Pagina 2/18
1 | | 3 | 4 | 5 | 6 | 7

Van PAC

Guardian (5603)

afbeelding van PAC

28-11-2019, 21:02

Nice work! Smile

Van Ivan

Ascended (9157)

afbeelding van Ivan

28-11-2019, 21:09

Looking really good! I would like to see changes of slope like in Chase HQ or WEC Le Mans.

Van Pencioner

Scribe (1097)

afbeelding van Pencioner

28-11-2019, 22:21

Metalion wrote:

It's a funky mix of HMMV, OTIR, Bresenham and large tables Wink

If you use long OTIRs (with bigger values in B register), you might try to optimize speed with kind of loop unrolling technique
I made sketch (might contain bugs, i didn't verify it, just to make an idea):

OTIR_UNROLL:
  LD A, B
  AND A, #0F
  ADD A
  LD DE, OTIR_LOOP
  ADD E
  LD E, A
  LD A, 0
  ADC D
  LD D, A
  PUSH DE
  LD A, B
  AND #F0
  LD B, A
  RET  ; jumps to OTIR_LOOP + 2 * (B AND #0F)

OTIR_LOOP:
REPEAT 16   ; 16 OUTI command in a row
  OUTI
ENDR
  LD A, B
  OR A
  JP NZ, OTIR_LOOP
  RET

This technique is described in more detail in Grauw's article on fast loops but i tried to modify it to the case when you don't know exact number of bytes you OUT. If you know exact number of bytes, it gets simpler and faster :)

Van Grauw

Ascended (8927)

afbeelding van Grauw

29-11-2019, 00:11

Or if the number of bytes is an exact multiple of the number of OUTIs.

Van Metalion

Paragon (1110)

afbeelding van Metalion

29-11-2019, 07:43

I know about the OTIR/OUTI optimization, but when you don't know the b value in advance, you're left with an overhead code that destroy the benefit of OUTI, at least under a certain value of b. I have calculated that you need at least 10 bytes for the OUTI optimization to be profitable. My b values are between 1 and 31, at the moment.

Furthermore, my OTIR are racing against HMMV, in order for the CPU to use all the time the VDP takes. It is already too fast, as HMMV writes over my OTIR in some extreme cases. If I accelerate by using OUTI, it will be a problem.

Van Pencioner

Scribe (1097)

afbeelding van Pencioner

29-11-2019, 08:40

Metalion wrote:

I know about the OTIR/OUTI optimization, but when you don't know the b value in advance, you're left with an overhead code that destroy the benefit of OUTI, at least under a certain value of b. I have calculated that you need at least 10 bytes for the OUTI optimization to be profitable. My b values are between 1 and 31, at the moment.

Yes, those are small values.

Metalion wrote:

Furthermore, my OTIR are racing against HMMV, in order for the CPU to use all the time the VDP takes. It is already too fast, as HMMV writes over my OTIR in some extreme cases. If I accelerate by using OUTI, it will be a problem.

That's crazy Smile

Van Metalion

Paragon (1110)

afbeelding van Metalion

12-12-2019, 10:54

erpirao wrote:

Now we just need a car and some curves

It's been a few days, but curves and hills have been added to the road engine.
Wink

Van wimpie3

Champion (294)

afbeelding van wimpie3

12-12-2019, 12:23

Niiiice!

Van ARTRAG

Enlighted (6339)

afbeelding van ARTRAG

12-12-2019, 14:35

very nice!!

Van zett

Hero (606)

afbeelding van zett

12-12-2019, 14:36

Metalion wrote:
erpirao wrote:

Now we just need a car and some curves

It's been a few days, but curves and hills have been added to the road engine.
Wink

Good start

Pagina 2/18
1 | | 3 | 4 | 5 | 6 | 7