quoi mettre dans les registres 0-7 ?

Pagina 1/2
| 2

Door rendomizer

Rookie (27)

afbeelding van rendomizer

02-11-2018, 09:21

comment adresse t'on les registres 0 à 7 et quoi mettre dedans !
J'ai essaillé ça mais rien ...
equivalent en basic=screen 2,0

ORG c000
ld b,$02
ld c,$0 ; registre 0
call $0047  
ld b,$B2
ld c,$01 ; registre 1
call $0047  
ld b,$06
ld c, $02; registre 2 tnp 1800h
call $0047  
ld b,$FF
ld c,$03 ; registre 3 tc 2000h
call $0047  
ld b,$03
ld c,$04 ; registre 4 tgp 0000h
call $0047  
ld b,$36
ld c,$05 ; registre 5 tas 1B00h 
call $0047  
ld b,$07
ld c,$06 ; registre 6 tgs 3800h
call $0047  
ld b,$57
ld c,$07 ; registre  7 color
call $0047 
boucle:
jp boucle 
 
Aangemeld of registreer om reacties te plaatsen

Van gdx

Prophet (2976)

afbeelding van gdx

02-11-2018, 09:38

I recommend you to modify only bits required for registers less than 3 by using system variables RG00SAV to RG03SAV like following example.

; Double the size of sprites
;
ld c,$01 ; registre 1
ld a,(RG01SAV)
or 1
ld b,a
call $0047

Same thing by direct access:

ld a,(7)
ld c,a
inc
ld a,(RG01SAV)
or 1
di
ld (RG01SAV),a
out (c),a
ld a,$80+1   ; Register 1
ei
out (c),a

Van rendomizer

Rookie (27)

afbeelding van rendomizer

02-11-2018, 11:56

Dans msxpen.com
J'affiche 5 sprite en taille 8x8
comment afficher en 16x16 ?

10bload"program.bin"
11fori=&hc000to&hC000+70:printhex$(peek(i));" ";:nexti

20defusr=&hc000:x=usr(x):goto30
22 defusr=&hc005:x=usr(x)

30 forb=0to 255
31 line(0,0)-(255,192),1
40defusr=&hc000+22:x=usr(x)
50 nextb
60goto22

   

org $c000 
          push hl 
        ld a,$02; screen mode 2
        call $005F
        
        ;ld a,$02; screen mode 2
        ;call $005F
        ld bc,$1B00 
        ld (tas),bc
        ld bc,$3800
        ld (pixel),bc
;Double the size of sprites
 
;ld c,$01 ; registre 1
;ld a,$00
;or 1
;ld b,a
;call $0047
        pop hl
        ret
        
      push hl
        ;1 er sprite
       ld a,(y)
        ;inc a
       ld (y),a 
       ld hl,(tas) ; locate y
       call $004d 
       inc hl
       ld (tas),hl
       ld a,(x)
        ;inc a 
       ld (x),a 
       ld hl,(tas) ; locate x
       call $004d 
       inc hl
       ld (tas),hl 
       ld a,0  
       ld hl,(tas) ; tgs
       inc hl
       ld (tas),hl
       ld a,$01  
       ld hl,(tas) ; color
       call $004d 
       ld hl,$1B04
       ld (tas),hl
       ;deuxieme sprite
        ld a,(y2)
       ;dec a
       ld (y2),a 
       ld hl,(tas) ; locate y
       call $004d 
       inc hl
       ld (tas),hl
       ld a,(x2)
        ;inc a
       ld (x2),a 
       ld hl,(tas) ; locate x
       call $004d 
       inc hl
       ld (tas),hl 
       ld a,0 
       ld hl,(tas) ; tgs
       inc hl
       ld (tas),hl
       ld a,6  
       ld hl,(tas) ; color
       call $004d 
       ld hl,$1B08
       ld (tas),hl
       ;troixieme sprite
        ld a,(y3)
       ;dec a
       ld (y3),a 
       ld hl,(tas) ; locate y
       call $004d 
       inc hl
       ld (tas),hl
       ld a,(x3)
        ;inc a
       ld (x3),a 
       ld hl,(tas) ; locate x
       call $004d 
       inc hl
       ld (tas),hl 
       ld a,0 
       ld hl,(tas) ; tgs
       inc hl
       ld (tas),hl
       ld a,7  
       ld hl,(tas) ; color
       call $004d 
       ld hl,$1B0c
       ld (tas),hl
       ;quatrieme sprite
        ld a,(y4)
       ;dec a
       ld (y4),a 
       ld hl,(tas) ; locate y
       call $004d 
       inc hl
       ld (tas),hl
       ld a,(x4)
        ;inc a
       ld (x4),a 
       ld hl,(tas) ; locate x
       call $004d 
       inc hl
       ld (tas),hl 
       ld a,0 
       ld hl,(tas) ; tgs
       inc hl
       ld (tas),hl
       ld a,14  
       ld hl,(tas) ; color
       call $004d 
       ld hl,$1B10
       ld (tas),hl
     ;-------------------------------
     ;cinquieme sprite
        ld a,(y5)
       ;dec a
       ld (y5),a 
       ld hl,(tas) ; locate y
       call $004d 
       inc hl
       ld (tas),hl
       ld a,(x5)
        ;inc a
       ld (x5),a 
       ld hl,(tas) ; locate x
       call $004d 
       inc hl
       ld (tas),hl 
       ld a,0 
       ld hl,(tas) ; tgs
       inc hl
       ld (tas),hl
       ld a,3  
       ld hl,(tas) ; color
       call $004d 
       ld hl,$1B00
       ld (tas),hl
     ;-------------------------------   
         ld a,$ff;pixel
       ld hl, (pixel); 1 octet
       call $004d
       inc hl
       ld (pixel),hl
       ld a,$00;pixel
       ld hl, (pixel); 2 eme octet
       call $004d
       ld hl,(pixel)
       inc hl 
       ld (pixel),hl
          ld a,$ff;pixel
       ld hl, (pixel); 3 eme octet
       call $004d
       inc hl
       ld (pixel),hl
       ld a,$00;pixel
       ld hl, (pixel); 4 eme octet
       call $004d
       ld hl,(pixel)
       inc hl 
       ld (pixel),hl
        ld a,$ff;pixel
       ld hl, (pixel); 5 octet
       call $004d
       inc hl
       ld (pixel),hl
       ld a,$00;pixel
       ld hl, (pixel); 6 eme octet
       call $004d
       ld hl,(pixel)
       inc hl 
       ld (pixel),hl
          ld a,$ff;pixel
       ld hl, (pixel); 7 eme octet
       call $004d
       inc hl
       ld (pixel),hl
       ld a,$00;pixel
       ld hl, (pixel); 8 eme octet
       call $004d
       ld hl,(pixel)
       inc hl 
       ld (pixel),hl
          
        
       ;-------------------------------
          
       pop hl
       ret
       
tas: dw    $00,$00
pixel: dw    $00,$00
x: db  0
y: db  0  
x2: db  8
y2: db  0
x3: db  16
y3: db 0
x4: db 24
y4: db 0
x5: db 0
y5: db 8

Van Meits

Scribe (5480)

afbeelding van Meits

02-11-2018, 14:08

Please keep it English.

Van rendomizer

Rookie (27)

afbeelding van rendomizer

02-11-2018, 19:49

I want to set screen 2 with sprites 16x16 ...But how to do ? please give a little help because I turn and turn the manuals and books over and over but nothing about setting register 0 to 7 !!!

Van gdx

Prophet (2976)

afbeelding van gdx

03-11-2018, 06:22

Rendomizer,

Pratique du MSX.PDF -> Le processeur vidéo (VDP) -> Les registres de contrôle du processeur video. -> Registre 1

Everything is explained in French.

Van rendomizer

Rookie (27)

afbeelding van rendomizer

03-11-2018, 23:46

merci gdx

Van theNestruo

Expert (106)

afbeelding van theNestruo

04-11-2018, 11:21

This is my screen initialization:

; color 15,1,1
	ld	a, 15
	ld	[FORCLR], a
	ld	a, 1
	ld	[BAKCLR], a
	ld	[BDRCLR], a
; screen 2
	call	INIGRP
	call	DISSCR ; (optional)
; screen ,2
	ld	hl, RG1SAV
	set	1, [hl]
; screen ,,0
	xor	a
	ld	[CLIKSW], a
gdx wrote:

I recommend you to modify only bits required for registers less than 3 by using system variables RG00SAV to RG03SAV like following example.

; Double the size of sprites
;
ld c,$01 ; registre 1
ld a,(RG01SAV)
or 1
ld b,a
call $0047

After reading your code... I don't why mine actually works! (I don't have any call WRTVDP)
Maybe the call ENASCR (called later, not shown in the snippet) copies back the RGnSAV values to the VDP?

Van rendomizer

Rookie (27)

afbeelding van rendomizer

04-11-2018, 14:28

J'ai trouvé comment modifier screen 2 pour avoir des sprites 16x16 !

ld a,$02; screen mode 2
call $005F
 ;ld b,$c2; sprite 16x16
 ;ld c,$01; register 1
 ;call $0047

Van rendomizer

Rookie (27)

afbeelding van rendomizer

04-11-2018, 14:30

maintenant je me demande comment on attribut les numéros de sprites ?

Pagina 1/2
| 2