Hi people.
Some days ago I asked about a sprite problem... Well, this is my
initsprite routine... I don't know what is wrong. When this routine
is called, screen 6 and its palette are already set.
Some comments are in portuguese, but the main are in english
---- Begin Code ----
INITSPRITES:
; Clear Sprite Tables
LD IX,CLRSPR ; Indica funcao de limpar sprites
CALL CALLSUB ; Executa funcao
; Set Sprite 8x8 normal size.
LD A,(RG1SAV) ; Carrega R#1 em A
AND 11111100b ; Zera bit 0 (tam normal) e 1 (8x8)
LD B,A ; Carrega B com valor de escrita
LD C,1 ; Indica R#1
LD IX,WRTVDP ; Indica funcao de escrita no VDP
CALL CALLBIOS ; Executa funcao
; Make sure that the sprites are turned on.
LD A,(RG8SAV) ; Carrega R#8 em A
AND 11111101b ; Zera 2o. bit (Liga Sprites)
LD B,A ; Carrega B com valor
LD C,8 ; Indica R#8
LD IX,WRTVDP ; Chama funcao de escrita no VDP
CALL CALLBIOS ; Executa
; Finds sprites pattern table address
LD IX,CALPAT ; Aponta funcao que acha tabela de patt
XOR A ; Indica sprite 0
CALL CALLSUB ; Chama subrom
LD (SPRPTR),HL ; Grava em local adequado
; Finds sprites attribute table address
LD IX,CALATR ; Indica funao que acha end de attr.
XOR A ; Indica sprite 0
CALL CALLSUB ; Chama SubRom
LD (SPRATT),HL ; Grava no local adequado
; Finds sprites color table address
XOR A ; Zera Cf
LD DE,512 ; Carrega 512 em DE
SBC HL,DE ; Subtrai 512 de HL (HL agora = tab.de cores)
LD (SPRCOL),HL ; Salva na RAM
; Initialize patern table
LD DE,0A000h ; Aponta para endereco temporario
LD HL,SPRITES_PAT ; Aponta para tabela
LD BC,8*2 ; Indica 16 bytes
LDIR ; Copia
LD DE,(SPRPTR) ; Aponta DE para tabela de padroes na VRAM
LD HL,0A000h ; Aponta HL para inicio da tabela de padroes
LD BC,8*2 ; Indica 8 bytes*2sprites
LD IX,LDIRVM ; Indica funcao de copia RAM->VRAM
CALL CALLBIOS ; Executa funcao
; Initialize color table
LD DE,0A000h ; Aponta para endereco temporario
LD HL,SPRITES_COL ; Aponta para tabela
LD BC,16*2 ; Indica 16*2 bytes
LDIR ; Copia
LD DE,(SPRCOL) ; Aponta DE para tabela de cores na VRAM
LD HL,0A000h ; Aponta HL para inicio da tabela de cores
LD BC,16*2 ; Indica 16bytes*2sprites
LD IX,LDIRVM ; Indica funcao de copia da RAM->VRAM
CALL CALLBIOS ; Executa
; Initialize attribute table
LD DE,0A000h ; Aponta para endereco temporario
LD HL,SPRITES_ATT ; Aponta para tabela
LD BC,4*2 ; Indica 8 bytes
LDIR ; Copia
LD DE,(SPRATT) ; Aponta DE para tabela de atributos na VRAM
LD HL,0A000h ; Aponta HL para inicio da tabela de atributos
LD BC,4*2 ; Indica 4bytes*2sprites
LD IX,LDIRVM ; Indica funcao de copia RAM->VRAM
CALL CALLBIOS ; Executa
RET ; Retorna...
SPRPTR: DB 000h,000h
SPRATT: DB 000h,000h
SPRCOL: DB 000h,000h
;Sprites --- these are just test sprites
SPRITES_PAT:
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; contorno seta
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh ; contorno seta
SPRITES_ATT:
DB 06Ah,07Fh,000h,001h
DB 06Ah,07Fh,001h,001h
SPRITES_COL:
DB 001h,001h,001h,001h,001h,001h,001h,001h ; contorno da seta
DB 001h,001h,001h,001h,001h,001h,001h,001h ;
DB 001h,001h,001h,001h,001h,001h,001h,001h ; miolo da seta
DB 001h,001h,001h,001h,001h,001h,001h,001h ;
---- End Code ----
Any ideas? I'm trying to do this stupid thing for days, and NOTHING.
Thanks in advance.
[]'s Daniel Caetano ([EMAIL PROTECTED])
LOVE IS: Delete windows from her harddisk!
OS/2 Sites: http://www.os2brasil.com.br/novidades/
http://www.os2brasil.com.br/novidades/drivers.shtml
http://www.geocities.com/SiliconValley/8752/os2hp/index.html
MSX Sites: http://www.fudeba.cjb.net/ e http://www.msxnews.cjb.net/
MSX Phoenix: http://www.msxphoenix.cjb.net/
****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****