spritedata in page 2 in stead of page 0 (Development MSX Fora)MSX Resource Center MSXdev 2008 - MSX1 development bonanza!           
            
English Nederlands Español Português Russian         
 Nieuws
   Voorpagina
  Nieuws archief
  Nieuws onderwerpen

 Informatie
   MSX Fora
  Artikelen
  Recensies
  Beursverslagen
  Fotoreportages
  Beurzen en meetings
  Enquêtes
  Links
  Zoek

 Software
   Downloads
  Webshop

 MRC
   Wie we zijn
  Kom bij ons team
  Doneren
  Policies
  Contact met het MRC
  Link naar Ons
  Statistieken

 Zoek
 
  

  

 Login
 

Gebruikersnaam

Wachtwoord




Ben je nog niet lid? Klik hier en word MSX vriend!


 Statistieken
 

Er zijn 40 gasten en 2 MSX vrienden online

Je bent een anonieme bezoeker.
 

MSX Fora


MSX Fora

Development - spritedata in page 2 in stead of page 0

Schrijver

spritedata in page 2 in stead of page 0

norakomi
msx professional
Berichten: 861
Geplaatst: 13 Oktober 2005, 13:07   
The file below puts some stars in screen.
I tried to put the data of the stars in page 2 in stead of page 0.
But how do I set the computer to start readout spritedata (attribute table, color table etc) from page 2???


ORG 0C200H

LD HL,0F3E9H ; Ini screen 8
XOR A
LD (HL),A
INC HL
LD (HL),A
INC HL
LD (HL),A
LD A,8
CALL 5FH
LD A,63 ; Page 1
OUT (99H),A ; (Sprite-tabellen staan wel op page 0)
LD A,2+128
OUT (99H),A

CALL AAN ; Ini sprites en zet hook

JOOP: LD A,(0FBEDH) ; Wacht op spatie
BIT 0,A
JR NZ,JOOP

CALL UIT
LD HL,0F3E9H
LD (HL),15
INC HL
LD (HL),4
INC HL
LD (HL),4
XOR A
CALL 5FH
RET

AAN: CALL 69H ; Initialisatie sterrenhemel
DI
LD A,(0F3E0H) ; Sprites 8*8, niet vergroot
AND 252
LD (0F3E0H),A
OUT (99H),A
LD A,129
OUT (99H),A


; Zet VRAM-adres &HFA00 (sprite-kleurtabel)
LD HL,0FA00H
LD B,0
CALL SETVDP
LD A,15 ; (Alleen kleur van bovenste lijn is nodig)
OUT (98H),A


LD HL,0F000H ; Vul patroon van spritenr. 0 (1 puntje)
LD B,0
CALL SETVDP ; (de volgende 9 bytes zijn al 0, call &H69)
LD A,128
OUT (98H),A
XOR A
LD B,15
LOOP2: OUT (98H),A
DJNZ LOOP2
LD HL,0F800H ; Vul kleurtabel
LD B,0
CALL SETVDP
LD C,32
LOOP0: LD A,15
OUT (98H),A
XOR A
LD B,15
LOOP1: OUT (98H),A
DJNZ LOOP1
DEC C
JR NZ,LOOP0

LD HL,0FD9FH
LD DE,OLDHOO
LD BC,5
LDIR
LD A,0C3H
LD (0FD9FH),A
LD HL,STARS
LD (0FDA0H),HL
EI
RET

UIT: DI ; Reset hook
LD HL,OLDHOO
LD DE,0FD9FH
LD BC,5
LDIR
EI
RET


STARS: DI ; Zet sprites neer
LD B,32
LD HL,DATSP2
LOOP!!: PUSH BC
INC HL ; Tel X-waarde op
LD A,(HL)
INC HL
INC HL
ADD A,(HL)
DEC HL
DEC HL
LD (HL),A
DEC HL
LD D,(HL) ; Bereken VRAM-adres waar sprite komt
INC D ; ( (Y+1)*256+X )
LD E,A

EX DE,HL ; Kijk of er plaatje staat
LD B,65
CALL SETVDP
IN A,(98H)

PUSH AF
EX DE,HL
LD DE,0FA00H-DATSP2
ADD HL,DE ; Zet VRAM-adres van attribuut-tabel
LD B,0
CALL SETVDP
POP AF
OR A
JR Z,PUTSTR

SBC HL,DE
LD A,220 ; Plaatje op voorgrond: zet sprite weg.
OUT (98H),A
LD DE,4
ADD HL,DE
JR VERDER

PUTSTR: SBC HL,DE ; Geen plaatje: zet sprite neer.
LD BC,0498H
OTIR
VERDER: POP BC
DJNZ LOOP!!

EI
OLDHOO: DEFB 0,0,0,0,0

; Sprite-info-tabel: Y-coord / X-coord / spritenummer / X-snelheid
; (4e byte was kleurnr op MSX1, maar wordt toch niet gebruikt)
DATSP2: DEFB 15,230,0,5,20,237,0,5,25,136,0,6,30,46,0,4
DEFB 35,66,0,5,40,216,0,6,45,206,0,3,50,1,0,4
DEFB 55,154,0,2,60,61,0,5,65,41,0,6,70,212,0,4
DEFB 75,10,0,3,80,229,0,4,85,124,0,6,90,128,0,3
DEFB 95,184,0,4,100,152,0,7,105,167,0,2,110,50,0,2
DEFB 115,118,0,2,120,234,0,6,125,68,0,7,120,169,0,3
DEFB 135,80,0,4,140,111,0,5,145,24,0,7,150,152,0,7
DEFB 155,147,0,6,160,44,0,6,165,235,0,3,170,10,0,5

; Naam : SETVDP
; Funktie : Zet de VDP op schrijven of lezen
; Invoer : HL = VRAM-adres, B = >bit 0 pagina >bit 6 schrijven(0) of lezen(1)
; Uitvoer : C = datalees of dataschrijfpoort
; Verandert: AF,BC
SETVDP: LD C,99H
LD A,H
AND 0C0H
PUSH BC
RES 6,B
OR B
RLCA
RLCA
OUT (C),A
LD A,14 OR 128
OUT (C),A
LD A,H
OUT (C),L
POP BC
RES 0,B
AND 3FH
OR B
XOR 64
OUT (C),A
DEC C
RET


RES 0,B
AND
GhostwriterP
msx addict
Berichten: 312
Geplaatst: 13 Oktober 2005, 15:58   
How about setting the right read out adress?

GhostwriterP
msx addict
Berichten: 312
Geplaatst: 13 Oktober 2005, 16:01   
it is a 17 bit adress, devided over 14 bit and 3 bit.

norakomi
msx professional
Berichten: 861
Geplaatst: 13 Oktober 2005, 16:17   
how do I find out what the original value is??
(the original value, which is in page 0, more at less starting at y=212 will be about HL=$7000)

so if I know the original value and want to move it 2 pages then the new value will be:
AHL=$17000

right??

(if the standard value=$7000)

and which registers do I fill to change this??
BiFi
msx guru
Berichten: 3142
Geplaatst: 13 Oktober 2005, 16:23   
try this:
SCREEN5:SETPAGE,2:A=VDP(5):B=VDP(12)
then R#5=A and R#11=B

try to get yourself a (hard)copy of the V9938 application manual... all the info you need is in there... for additional info on the V9958 you'll need to get a (hard)copy of that application manual too...
norakomi
msx professional
Berichten: 861
Geplaatst: 13 Oktober 2005, 16:46   
thanx

so what I said before
just make the A from AHL a 1 is like adding 2 pages, is it?
BiFi
msx guru
Berichten: 3142
Geplaatst: 13 Oktober 2005, 16:47   
yep, though you need to change the sprite attribute registers as well... and the sprite pattern register(s) if you want to move the patterns in page 2 as well

I hereby invite you to join #msxdev on the Rizon IRC network. I'm there most of the time and it's a much quicker method to exchange info like this.
norakomi
msx professional
Berichten: 861
Geplaatst: 14 Oktober 2005, 00:32   
thank you !
Ill do some experimenting 2morrow,
and if it doesnt work out Ill meet you there 2morrow-> or soon !!
AuroraMSX

msx master
Berichten: 1248
Geplaatst: 14 Oktober 2005, 14:37   
Quote:

try to get yourself a (hard)copy of the V9938 application manual... all the info you need is in there... for additional info on the V9958 you'll need to get a (hard)copy of that application manual too...



And all those goodies are right here

Remember: Funet is your friend! (You may quote me on that )
BiFi
msx guru
Berichten: 3142
Geplaatst: 14 Oktober 2005, 15:08   
that V9938 one is quite big and has no table of contents... the one that comes with Chaos Assembler 3 is smaller and does have one, which is very useful.
norakomi
msx professional
Berichten: 861
Geplaatst: 14 Oktober 2005, 17:53   
the one that comes with Chaos Assembler 3
Bifi: where can I find this one?
BiFi
msx guru
Berichten: 3142
Geplaatst: 14 Oktober 2005, 19:33   
I don't know where d-fader got it from back then, but I the CD-ROM with CA3 (and that version of the manual). It's a bit hard to send it to you though, as I don't have any info on that... but you can join #msxdev on Rizon of course and I can DCC it to you... and there are many coders in there being able to help you out where necessary.
norakomi
msx professional
Berichten: 861
Geplaatst: 14 Oktober 2005, 21:13   
unable to connect: null

thats what it says when I try to connect on Rizon IRC Network
BiFi
msx guru
Berichten: 3142
Geplaatst: 14 Oktober 2005, 21:22   
irc.rizon.net
irc.rizon.org

I'm on irc.corezx.com:6669 now... that should work...
Edwin
msx professional
Berichten: 620
Geplaatst: 15 Oktober 2005, 01:08   
irc.eu.rizon.net works for me most of the time.
 
 







(c) 1994 - 2008 Stichting MSX Resource Center. MSX is een trademark van MSX Licensing Corporation.