Clean Split Screen / How to ? (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 137 gasten en 3 MSX vrienden online

Je bent een anonieme bezoeker.
 

MSX Fora


MSX Fora

Development - Clean Split Screen / How to ?

Ga naar pagina ( 1 | 2 | 3 | 4 Volgende pagina )
Schrijver

Clean Split Screen / How to ?

Maggoo
msx professional
Berichten: 576
Geplaatst: 02 Oktober 2003, 15:30   
This is a move of the on-going discussion regarding VScreen0.4 split screen thing.

Here is the place to tell everyone how to perform a clean split screen that works
at any CPU speed, any refresh rate.

Who's shooting first ?
chaos
msx addict
Berichten: 276
Geplaatst: 02 Oktober 2003, 15:41   
Quote:

This is a move of the on-going discussion regarding VScreen0.4 split screen thing.

Here is the place to tell everyone how to perform a clean split screen that works
at any CPU speed, any refresh rate.

Who's shooting first ?



On the MSX Assembly Page you can find a screensplit programming guide
Here it is:
http://map.tni.nl/?p=articles/split_guide.html
Maggoo
msx professional
Berichten: 576
Geplaatst: 02 Oktober 2003, 15:49   
Very nice article. Indeed I use the blank line technique described in it but I guess I'll need to add HR check before changing register 2, and again before restoring display.
ro
msx guru
Berichten: 2320
Geplaatst: 02 Oktober 2003, 16:42   
The HR check is to make sure on ALL systems the split is equal in lenght. You also might wanna create a little blank in the GFX part (a few black lines for example)

Maggoo: do u use stander os ISR or what??!
might wanna check on that, you can get very pleasing results experimenting with ISR settings

I remember Alex (savage) did an interresting article on VDP status register setting/reading for ISR on some sunrise mag. dunno which one (could be a magazine-special.. dunno here)

I copied pasted the one we use in the f-kernel:

the LNIISR+1 label is were we set LNI address DIRECTLY -> ld (lniisr+1),hl
this will surely speed things up.
Notice that the VDP status register is already set at #15 to read the interupt mode.
The register push/pops are only for the vblank coz that's a non-critical one (could do without and set it yourself, but no you got it all in one routine other wise you'll need to save regs in every vblroutine... ) the call to vblisr is a stacked one. just read the kernel manual and you'll understand.


;Int. Service Routine (RST &H38)
ISR: PUSH AF
IN A,(#99)
RLCA
LNIISR: JP NC,LNI_00 ;LNI vector (Set via SETLNI
PUSH BC
PUSH DE
PUSH HL
EX AF,AF
EXX
PUSH AF
PUSH BC
PUSH DE
PUSH HL
PUSH IX
PUSH IY
LD HL,TIMER ;VBL timer
INC (HL)
CALL VBLISR ;VBL vector
POP IY
POP IX
POP HL
POP DE
POP BC
POP AF
EXX
EX AF,AF
POP HL
POP DE
POP BC
LNI_00: POP AF
EI
RET
Maggoo
msx professional
Berichten: 576
Geplaatst: 02 Oktober 2003, 16:49   
Actually I don't go thru RST38, I just test the status of the vdp register for the interupt. Althought the way you describe could also be handy because it permits to do the split right in the middle of the execution of another routine that takes more time (like the music replay routine) instead of wasting CPU time waiting for the split line...

Time to experiment...
BiFi
msx guru
Berichten: 3142
Geplaatst: 02 Oktober 2003, 20:45   
I learned screen splits without the interrupt as well, but wanted to do them on the interrupt as well. Now I prefer doing any line interrupt stuff on the interrupt which opens some very nice possibilities.
GuyveR800
msx guru
Berichten: 3048
Geplaatst: 02 Oktober 2003, 20:55   
Quote:

Actually I don't go thru RST38, I just test the status of the vdp register for the interupt.


AH, there is your problem!

TVSP ISR:

RST38: push af

call InterruptHook ; FD9A

in a,[99h]
rlca
call c,VBlankHook ; FD9F

pop af
ei
ret


TVSP SCREEN8/SCREEN4 split:

LineInterrupt24:
ld a,1
out [99h],a
ld a,15+128
out [99h],a
in a,[99h]
rrca
jp nc,.endint ; no VDP interrupt

ld a,00010100b ; set SCREEN 4
out [99h],a
ld a,0+128
out [99h],a
ld a,01100010b
out [99h],a
ld a,1+128
out [99h],a

.endint:
ld a,0
out [99h],a
ld a,15+128
out [99h],a
ret


The usage of HR bit is generally useless, because the Z80 is so slow, you're already half a line beyond the HR point before you realize where you are.

As said, this split is clean on 3.58 or 7.16Mhz, 50 or 60 Hz, Z80 or R800. With clean I mean CLEAN, no visible split at all, no black line, no garbage, completely invisible.
Maggoo
msx professional
Berichten: 576
Geplaatst: 02 Oktober 2003, 22:51   
Just changed the split routine, no garbage on the MSX2s (but there was already none before), got twice as much garbage on openmsx in pixel accuracy mode.

I say "oh well" to emulators for now and will focus on solving that later, I got boders to mask

BTW, thanks to everyone for the very interesting feedback, it's been VERY helpfull.
ro
msx guru
Berichten: 2320
Geplaatst: 03 Oktober 2003, 14:32   
Guyver:

In the LNI routine you do a check on int.stat (r#15/0). I noticed you've set the VDP status to r#15 BEFORE checking. You don't have to. the stat. will be set to r#15 in ISR mode already! (this saves extra timing)
it's also a bit faster to set the int.stat. check ON the ISR (check my routine) instead of CALLING the LNI, checking INT stat and RET to ISR.

What we do is FIRST check int.stat and then JUMP if itsa LNI.
later in the LNI (line interrupt) you have to POP the AF reg. again.
saves some extra timing which is always cool. (esp. on isr)

'notha thing: Why would you set r#15 to zero again at the end of the LNI???
(it's already set) oh, wait. wasn't that for RESETING the int.stat.??? (I forgot, sorry)

and the HR is very important: you have to know, atleast, how many lines you're using. Don't matter if the z80 is slow, it's all about knowing the little details (making sure you skip a line for example) For example, the CPU difference is something to consider (z80/r800/7mhz)

Well, maggoo; hope this will help ya out making some real ISR routines eh!
GuyveR800
msx guru
Berichten: 3048
Geplaatst: 03 Oktober 2003, 15:22   
Quote:

Guyver:

In the LNI routine you do a check on int.stat (r#15/0). I noticed you've set the VDP status to r#15 BEFORE checking. You don't have to. the stat. will be set to r#15 in ISR mode already! (this saves extra timing)


Where do you get this idea?!
Normally the R#15 is set to S#0, for reading out Vblank interrupts.
To check for Line interrupts, you need S#1, so it must be set first.

Quote:

it's also a bit faster to set the int.stat. check ON the ISR (check my routine) instead of CALLING the LNI, checking INT stat and RET to ISR.


This is a general purpose ISR, it can handle e.g. MoonSound interrupts too. With what you suggest it's impossible, or you'd need a whole list of checks hardcoded in the ISR... Not too pretty if you ask me!

Quote:

What we do is FIRST check int.stat and then JUMP if itsa LNI.
later in the LNI (line interrupt) you have to POP the AF reg. again.
saves some extra timing which is always cool. (esp. on isr)


What?!
Sorry, but inspecting your routine, you only check for VBLANK interrupts. You assume if an interrupt is NOT a vblank interrupt, that it is a Line interrupt.
But that doesn't work! Your code breaks when other devices generate interrupts. MIDI, RS232, Music Module, MoonSound etc. can generate interrupts too. It's impossible for your routine to work with e.g. the Moonblaster for Moonsound replayer.

Quote:

'notha thing: Why would you set r#15 to zero again at the end of the LNI???
(it's already set) oh, wait. wasn't that for RESETING the int.stat.??? (I forgot, sorry)

R#15 must be set to S#0 to fetch Vblank interrupts.

Quote:

and the HR is very important: you have to know, atleast, how many lines you're using. Don't matter if the z80 is slow, it's all about knowing the little details (making sure you skip a line for example) For example, the CPU difference is something to consider (z80/r800/7mhz)

?! You have to know how many lines you're using??? And HR helps with that HOW?
As I stated, the line split I published does not care about Z80/R800/7MHz. It sounds to me you're overly complicating stuff.
ro
msx guru
Berichten: 2320
Geplaatst: 03 Oktober 2003, 17:32   
seems like we're set on this world to argue eh guyver!

As I mentioned before (somewhere) you should read Alex's article about ISR and you'll grasp the stat.reg idea
(and you'll see why my ISR works, b'coz of the stats being set allready, it's a proven theory.. )

And yes, you're right about the interrupt polling for ONLY VDP interrupts. That's simply b'coz we don't use any other interrupts. so why waste code (and speed) on uncoded parts.
But to be honest, the opl4 interrupt is something we've been playing with before but never really implemented. Never needed it so far.

The general idea is to NOT use unsupported routines just for the sake of SPEED BABY

The thing about CALLING and JUMPING to int's: you should check again and read the comments on that. It's all about SPEEEEEEEEEED

AND, excuse me for that, I am that kinda dude that works in/with DETAILS. So, YES I need EXACTLY how many hlines an LNI takes. I don't take things for granted, nothing goes without checking and double checking it again untill it's right.

But it's good to hear your point of view, 'coz, afterall, I am not GOD either.

GuyveR800
msx guru
Berichten: 3048
Geplaatst: 03 Oktober 2003, 18:58   
I don't know why you think this is an argument... Just trying to help out Maggoo and other coders here. Thanks for your friendly words that have been modded out btw

Quote:

As I mentioned before (somewhere) you should read Alex's article about ISR and you'll grasp the stat.reg idea
(and you'll see why my ISR works, b'coz of the stats being set allready, it's a proven theory.. )


Don't talk to me like I'm stupid please. I know how it works, and I'm just pointing out your ISR does not work with e.g. Moonblaster for Moonsound.

Quote:

The thing about CALLING and JUMPING to int's: you should check again and read the comments on that. It's all about SPEEEEEEEEEED


The difference between CALL and JP is only 7 t-states (less than a single LD A,n) so I'd say that isn't worth throwing out the entire hook-mechanism.
ro
msx guru
Berichten: 2320
Geplaatst: 03 Oktober 2003, 20:27   
too bad someone (was it you mr. g?) removed my previous message which prooved you soooo wrong. But hey, I'm a sport and don't hold any grudge like some other ppl I could mention. I might as well be your only friend here G. and you don't even see it. oh, well. not my mistake

-continue with the thread please?-
The thing with the 'jump' instead of the 'call' is more speed optimizing than mr. guyver thinks, but I'll give ya'll a challenge and figure it our yourself (yep, we're all briliant coders here.. right mr. Guyver?)

Well, I think I've demonstrated some great ISR work already in several demos we released so it might be a good thing to explore new options.

good luck
snout

msx legend
Berichten: 4991
Geplaatst: 03 Oktober 2003, 20:29   
{Moderator's notes}

Although I understand people don't appreciate GuyveR's direct approach in this thread I decided all that was replied to it to prevent further flame-wars. I'm not a coder. I have seen Ro, Maggoo and GuyveR products in action and all I can say is

RESPECT

since you mastered the skills of perfect/invisible screensplits. So, whatever methods you are using... they are correct. Maybe you should respect each others approaches a bit more and try to learn from each other?

I -know- GuyveR's approach is real neat as it's invisible, works in a game, doesn't crash when other interrupts occur and it even works in emulators like NLMSX, openMSX and MSXPLAYer.

So, lets continue this thread focussing on screensplit techniques instead of personal grudges.

And uhm.. Ro.. no worries... GuyveR posts a lot here but that doesn't give him extra rights. He can't delete posts
ro
msx guru
Berichten: 2320
Geplaatst: 03 Oktober 2003, 20:37   
I'm never worried Snout, I'm always relaxed
Guyer and I will behave now, we're all adults here. .right?!
 
Ga naar pagina ( 1 | 2 | 3 | 4 Volgende pagina )
 







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