Outrun style road demo MSX2

Página 2/21
1 | | 3 | 4 | 5 | 6 | 7

Por Pac

Guardian (6380)

Imagen del Pac

28-11-2019, 21:02

Nice work! Smile

Por Ivan

Ascended (9295)

Imagen del 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.

Por Pencioner

Scribe (1464)

Imagen del 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 :)

Por Grauw

Ascended (10013)

Imagen del Grauw

29-11-2019, 00:11

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

Por Metalion

Paragon (1428)

Imagen del 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.

Por Pencioner

Scribe (1464)

Imagen del 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

Por Metalion

Paragon (1428)

Imagen del 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

Por wimpie3

Champion (368)

Imagen del wimpie3

12-12-2019, 12:23

Niiiice!

Por ARTRAG

Enlighted (6515)

Imagen del ARTRAG

12-12-2019, 14:35

very nice!!

Por zett

Hero (608)

Imagen del 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

Página 2/21
1 | | 3 | 4 | 5 | 6 | 7