quoi mettre dans les registres 0-7 ?

Page 2/2
1 |

By hit9918

Prophet (2795)

hit9918's picture

04-11-2018, 18:14

Quote:

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?

yes, something like that it must be. because it is physicaly impossible that the set 1,(hl) instruction changes the VDP register.

By rendomizer

Rookie (27)

rendomizer's picture

04-11-2018, 19:28

Je me demande pourquoi les sprites 1 et 2 ont les mêmes data ???

org $c000 

ld a,$02; screen mode 2
call $005F
 ld b,$c2; sprite 16x16
 ld c,$01; register 1
 call $0047
 
 debut:
      
    
     
  
 
ld hl,$1B00  
ld (tas),hl
ld hl,$3800
ld (pixel),hl

;-----------sprite 1----------
;1 er sprite
ld a,(y) 
ld hl,(tas) ; locate y sprite 1
call $004d 
inc hl
ld (tas),hl 
ld a,(x)  
ld hl,(tas) ; locate x sprite 1
call $004d 
inc hl
 ld (tas),hl
ld a,0
ld hl,(tas) ; tgs sprite 1
call $004d  
inc hl 
ld (tas),hl
ld a,$57 
ld hl,(tas) ; color sprite 1
call $004d  
inc hl
ld (tas),hl 
;-----------sprite 2----------
; 
ld a,(y2) 
ld hl,(tas) ; locate y sprite 2
call $004d 
inc hl
ld (tas),hl

ld a,(x2) 
ld hl,(tas) ; locate x sprite 2
call $004d 

inc hl
ld (tas),hl 
ld a,0
ld hl,(tas) ; tgs sprite 2
call $004d 
 inc hl 
ld (tas),hl 

ld a,$89 
ld hl,(tas) ; color sprite 2
call $004d 
inc hl 
ld (tas),hl 

     
     ld bc, message
mainLoop:
      
    ld a,(bc);stock 
    ld hl, (pixel); 1 octet
    call $004d
    ld hl,(pixel)
    inc hl
    ld (pixel),hl; build sprite1  
      
       
            ld a, (bc)
            cp 0
            jp z,fin
            call $00a2
            inc bc
            jr mainLoop

message: 
       db 128,128+64,128+64+32,128+64+32+16,128+64+32+16+8,128+64+32+16+8+4,128+64+32+16+8+4+2,128+64+32+16+8+4+2+1            
       db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
       db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
       db $ff,$ff,$ff,$ff,$ff,$ff,$FF,$ff 
       db 128,128+64,128+64+32,128+64+32+16,128+64+32+16+8,128+64+32+16+8+4,128+64+32+16+8+4+2,128+64+32+16+8+4+2+1            
       db $ff,$81,$81,$81,$81,$81,$81,$ff
       db $ff,$81,$81,$81,$81,$81,$81,$ff
       db $ff,$81,$81,$81,$81,$81,$81,$ff,$ff,0
     
      
    nop
    nop
    nop
    
    ;ld a,(counter)
    ;inc a
    ;ld (counter),a
    ;cp 7
    ;jp z, fin
    ;jp boucle 
fin:
      
     jp debut
     
 
       
            
         
  
tas:  dw $0000
pixel: dw $0000
 
y: db 0
x: db 127
y2: db 16
x2: db 127+16

By rendomizer

Rookie (27)

rendomizer's picture

04-11-2018, 19:37

By Grauw

Enlighted (7548)

Grauw's picture

06-11-2018, 18:34

hit9918 wrote:
Quote:

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?

yes, something like that it must be. because it is physicaly impossible that the set 1,(hl) instruction changes the VDP register.

It does, because in order to reset the BL flag it must take the existing register value from the RG1SAV mirror, modify it, and then set it to the VDP.

By rendomizer

Rookie (27)

rendomizer's picture

07-11-2018, 07:49

Why sprite 1 have the same data than the sprite 2 ?
https://msxpen.com/codes/-LQgvcf13DHKKM8pp0Lh

By rendomizer

Rookie (27)

rendomizer's picture

10-11-2018, 13:40

By rendomizer

Rookie (27)

rendomizer's picture

15-11-2018, 09:33

resoulut

Page 2/2
1 |
My MSX profile