Best VDP Setup

Everything about programming, including VDP and Sound programming.
Post Reply
User avatar
thewiz
Posts: 137
Joined: 12 Aug 2012 16:08

Best VDP Setup

Post by thewiz »

Hi,

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?

Cheers
THIS is what Memotech is doing now.
User avatar
Crazyboss
Site Admin
Posts: 274
Joined: 09 Aug 2012 21:45
Location: Sweden
Contact:

Re: Best VDP Setup

Post by Crazyboss »

256 sprites ? Not sure that is used by any one.

This is from Astropac:

L813D:
ld hl,X8150
ld b,$08
L8142:
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
ret
;
X8150:
db $02
db $E2, $06, $FF, $03
db $38, $07, $01

Kilopede used another way the data is here:
KIVDP:
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 ?
//CLAUS - Webmaster at www.mtxworld.dk
Martin A
Posts: 799
Joined: 09 Nov 2013 21:03

Re: Best VDP Setup

Post 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

Agrovator
.REGSET
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
.REGSET
LD DE,2
CALL VOUTRG
LD DE,&1C2
CALL VOUTRG
LD DE,&20F
CALL VOUTRG
LD DE,&3FF
CALL VOUTRG
LD DE,&403
CALL VOUTRG
LD DE,&57E
CALL VOUTRG
LD DE,&607
CALL VOUTRG
LD DE,&701
CALL VOUTRG
RET
The only change form Basic here is 16x16 sprites are set


MTX Basic uses
.g2val
DB &02,&C0,&0F,&FF,&03,&7E,&07
.txval
DB &00,&D0,&07,&00,&03,&7E,&07
User avatar
Crazyboss
Site Admin
Posts: 274
Joined: 09 Aug 2012 21:45
Location: Sweden
Contact:

Re: Best VDP Setup

Post by Crazyboss »

you can actually see the vdp registers in menu using the switches -diag-console -diag-vid-registers
//CLAUS - Webmaster at www.mtxworld.dk
User avatar
thewiz
Posts: 137
Joined: 12 Aug 2012 16:08

Re: Best VDP Setup

Post 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.

Cheers
THIS is what Memotech is doing now.
User avatar
thewiz
Posts: 137
Joined: 12 Aug 2012 16:08

Re: Best VDP Setup

Post 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.
THIS is what Memotech is doing now.
Post Reply