Nice work!
Looking really good! I would like to see changes of slope like in Chase HQ or WEC Le Mans.
It's a funky mix of HMMV, OTIR, Bresenham and large tables
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 :)
Or if the number of bytes is an exact multiple of the number of OUTIs.
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.
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.
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
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.
Niiiice!
very nice!!
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.
Good start