Page 1 of 1

Best VDP Setup

Posted: 28 Oct 2015 11:23
by thewiz

What's the best VDP setup for game writing on the MTX?

I guess this will depend on using GR 1 or GR 2 I suppose.

Is having space for 256 sprites worth having?

What about double buffering a GR 1 screen?

Don't care about having a 40 column text screen.

What was used back in the day?


Re: Best VDP Setup

Posted: 28 Oct 2015 16:06
by Crazyboss
256 sprites ? Not sure that is used by any one.

This is from Astropac:

ld hl,X8150
ld b,$08
push bc
ld e,(hl)
inc hl
ld a,$08
sub b
ld d,a
call L8130 ; must be something to put data to the vdp.
pop bc
djnz L8142
db $02
db $E2, $06, $FF, $03
db $38, $07, $01

Kilopede used another way the data is here:
db $02
db $00, $C2, $01, $06
db $02, $FF, $03, $03
db $04, $38, $05, $07
db $06, $01, $07

1st byte is value, next byte is register number. Its basicly the same way as Andy Did. Only set $C2 to reg.1 instead of $E2 to reg.1

But I have seen dirty ways to do things where one table over write another table.

Also cound set sprite attribute table on the fly to simualte 64 sprites on screen.

Its a bit funny in the MTX games I have been looking at never use OTIR or OUTI.

I did improve a ColecoVision game to run more smoth by using OUTI instead of code the manual way.

One of the Colecovision guys said using OUTI and a JR is the fastest way you can transfer data to the VDP at Colecovision, and it worked for me, but you can use OUTI and a JP, it have to be JR.

Powerpac used otir to transfer the sound data to the sound processor, ofcause I had to change that to my own way, cause the MTX need the in a,(3) after writing to the sound port.

The way andy used to write the VDP (in Astropac), saved 8 bytes, cause the counter is used as register number, but maybe the routine it self is more than 8 bytes longer ?

Re: Best VDP Setup

Posted: 28 Oct 2015 21:23
by Martin A
The 2 games I have a "kind" of source for, Bouncing Bill and Agrovator both use a fairly standard looking graphics 2 setup. I've not seen any games that used the modified G2 mode that you get if you setup G2 with R4 set to 0 instead of 3

DB &02,&00
DB &E2,&01
DB &06,&02
DB &FF,&03
DB &03,&04
DB &38,&05
DB &07,&06
DB &11,&07
I think that works out as G2 mode, 16x16 sprites with interrupt enabled
Name Table 1800-1AFF
Colour table 2000-37FF
Pattern Table 0000-17FF
Sprite attributes 1C00-1C7F
Sprite Patterns 3800-3FFF
So it looks like the programmer wanted a full complement of sprites.

Bouncing Bill
LD DE,&1C2
LD DE,&20F
LD DE,&403
LD DE,&57E
LD DE,&607
LD DE,&701
The only change form Basic here is 16x16 sprites are set

MTX Basic uses
DB &02,&C0,&0F,&FF,&03,&7E,&07
DB &00,&D0,&07,&00,&03,&7E,&07

Re: Best VDP Setup

Posted: 28 Oct 2015 23:46
by Crazyboss
you can actually see the vdp registers in menu using the switches -diag-console -diag-vid-registers

Re: Best VDP Setup

Posted: 29 Oct 2015 15:26
by thewiz
Thanks all.

So we have the following from four games:

Astropac Kilopede Agrovator Bill
0 02 02 02 02
1 e2 c2 e2 c0
2 06 06 06 0f Name table at $06 = $1800-$1aff. $0f=$3c00-$3f00
3 ff ff ff ff Colour table at $2000
4 03 03 03 03 Pattern table at $0000
5 38 38 38 7e Spr Attr $38 = $1c00-$1c7f. $7e = $3f00-$3f7f
6 07 07 07 07 Spr Pattern at $3800-$3fff
7 01 01 01 xx Paper/ink

All are Graphic mode 2.
All but Bill have 16x16 sprites. Bill has 8x8.
Astropac and Agrovator has interrupts enabled.
Looks like Bill can only have 32 sprite definitions. The rest can have 64.

Thats great. We have a joint winner, Astropac and Agrovator.


Re: Best VDP Setup

Posted: 14 Nov 2015 19:38
by thewiz
Realised there is a slight improvement that can be made.

The sprite attribute can be moved to $1b00 leaving $1c00 to $1fff free. This means register 6 (I think) should be 36.