Author
| Strange video effect in MrGhost
|
cax
 msx professional Posts: 1011 | Posted: May 11 2004, 12:09   |
Recently I played MrGhost on real MSX connected to TV via RGB and saw very interesting video effect:
when you find the hidden room
(if I am not mistaken, on level 2, when you go down with the screen all the time),
the screen start showing some kind of wavy effect.
The whole screen moves right-left, creating waves on the borders.
Something like that:
__________
( (
) )
( (
) )
( (
) )
----------
I never saw this on any emulator, only on real MSX.
Can anybody comment on this ?
What happens on a hardware level, and how this effect can be made from the software ?
|
|
Latok msx master Posts: 1724 | Posted: May 11 2004, 12:35   |
I think you smoked too much  But seriously, both VDPregisters #18 and #23 are being used to create this effect, right? |
|
BiFi msx guru Posts: 3142 | Posted: May 11 2004, 12:44   |
It's just R#18 for that effect. To be more precise: the R#18 value is changed at every line in such a sine wave style. The CPU waits for the next line by polling a bit in one of the VDP status registers. When it's set, the R#18 register will be updated with a value that was read from a table and the table pointer will be updated. Next it waits for the bit to be reset, so it can test for the next line.
Most of the recent emulators are capable of doing this effect as well.
|
|
Latok msx master Posts: 1724 | Posted: May 11 2004, 12:59   |
So all you need is a R#18, a sinustable and the time_interrupt. Hook #fd9f?
|
|
cax
 msx professional Posts: 1011 | Posted: May 11 2004, 13:05   |
BiFi: to make things clear, I am going to play MrGhost in an emulator and save it's state exactly before the mentioned effect. Which emulator(s) do you suggest to try this on ?
|
|
wolf_
 msx legend Posts: 4663 | Posted: May 11 2004, 13:16   |
There was a weird effect, once published in mcm.. dunno who came with it.. xelasoft, shuqair or whoever.. it was an 'automated' horizontal wave, fullscreen.. you could run it in basic, by xoring some vdp register... it was pretty weird  |
|
cax
 msx professional Posts: 1011 | Posted: May 11 2004, 13:22   |
wolf_: do you have the basic code or any other program to show the weird effect you mentioned ?
|
|
chaos msx addict Posts: 276 | Posted: May 11 2004, 13:24   |
|
|
wolf_
 msx legend Posts: 4663 | Posted: May 11 2004, 13:32   |
hm.. my MCM's are almost all in some box..
it was something simple.. like vdp(2)=vdp(2) xor 32 or something.. the numbers are all wrong I guess... but it was like this.. and after that, your screen begins to wave  Not with a perfect sine.. but at least it moved
|
|
Grauw msx professional Posts: 1002 | Posted: May 11 2004, 13:34   |
This effect is also used in the main screen of Compjoetania's SandStone.
Anyways, "So all you need is a R#18, a sinustable and the time_interrupt. Hook #fd9f?"... No. Well. And yes. Yes it has to be done like that, but no it is not as easy as that, unfortunately. The VDP suffers from some bugs there. More info here and here.
~Grauw |
|
The_Engineer msx user Posts: 38 | Posted: May 11 2004, 13:45   |
And if you really want to see an interesting effect of the V9938/V9958 VDP, check the 'stress-out' effect of Teachers Terror.
What happens here is that the display alternately shows a correct frame and a frame with the wave effect described above applied. The effect is generated by writing the vdp(18) register while in the vertical blank (which accidentally/intentionally happened in my code):
Note that INT should be called at hook #FD9A.
WRTVDI is the code of bios call WRTVDP (#0047) without the EI and update of the shadow registers at the end.
VDPSTI is the code of subrom call VDPSTA (#????) again without the EI at the end.
Also note that this is very old code and at that time I never had any courses in how you should program and make code readable
DISCLAIMER: Most emulators cannot display this effect. Use a real MSX2 or above
;----------------------------------------------------------------------------
INT:
LD A,1
CALL VDPSTI
AND 1
JP NZ,LININT
IN A,(#99)
AND A
JP M,H_TIMI
RET
LININT:
LD A,2
OUT (#99),A
LD A,#8F
OUT (#99),A
LD A,(COUNT)
AND A
JP Z,VE
LD HL,COUNT1
DEC (HL)
JP NZ,VE
LD (HL),212
XOR A
LD (COUNT),A
LD HL,SINUS
LD (LINPNT),HL
VE:
LD B,212
LD HL,(LINPNT)
LINLP:
LIN2:
IN A,(#99)
AND #20
JP Z,LIN2
LD A,(HL)
CP #FF
JP NZ,LINNEW
LD A,1
LD (COUNT),A
LD HL,SINUS
LD A,(HL)
LINNEW:
OUT (#99),A
LD A,#92
OUT (#99),A
INC HL
DJNZ LINLP
LD A,(#F3DF)
LD B,A
LD C,0
CALL WRTVDI
XOR A
JP VDPSTI
LINPNT: DW SINUS
COUNT: DB 0
COUNT1: DB 212
H_TIMI:
CALL FDINT
CALL MUSINT
LD HL,(LINPNT)
INC HL
LD (LINPNT),HL
XOR A
OUT (#99),A
LD A,#93
OUT (#99),A
LD A,(#F3DF)
OR #10
OUT (#99),A
LD A,#80
OUT (#99),A
RET
|
|
BiFi msx guru Posts: 3142 | Posted: May 11 2004, 13:46   |
Quote:
| So all you need is a R#18, a sinustable and the time_interrupt. Hook #fd9f?
|
Without the time interrupt. You should wait on the VDP for this one. Hook #FD9F is called every time the screen is fully built, and you don't want that right now. You want to change R#18 on every line. |
|
GuyveR800 msx guru Posts: 3048 | Posted: May 11 2004, 14:05   |
Quote:
| BiFi: to make things clear, I am going to play MrGhost in an emulator and save it's state exactly before the mentioned effect. Which emulator(s) do you suggest to try this on ?
|
openMSX correctly emulates this trick. |
|
[D-Tail]
 msx guru Posts: 2994 | Posted: May 11 2004, 14:07   |
wolf_, about that BASIC sine you mentioned, you can achieve it with
10 VDP(10)=VDP(10) XOR 1: GOTO 10
This will alternate bit0 of R#9, which is used for (Yamaha tech manual):
[(c) ASCII Corp., Nippon Gakki Co., Ltd.]
R#9
[...]
Bit0: DC : When 1, sets *DLCLK to input mode; when 0, sets *DLCLK to output mode.
Dunno what that DC-bit has gotta do with the sine effect, but the effect's very striking indeed. Try to bash down some keys while you're at it. The sine will 'walk away', because the interrupt cycle becomes longer.
Please note that this sine wave is everything except stable ^^;.
|
|
BiFi msx guru Posts: 3142 | Posted: May 11 2004, 14:09   |
Quote:
| BiFi: to make things clear, I am going to play MrGhost in an emulator and save it's state exactly before the mentioned effect. Which emulator(s) do you suggest to try this on ?
|
An emulator which can do both effect and have savestates.  In this case I think blueMSX would be the best choice since openMSX has no save state feature (yet). |
|
|
|
|