Select screen mode 7 in assembler

Door inchl

Supporter (5)

afbeelding van inchl

16-05-2019, 12:22

Does somebody have some assembler code that selects screen mode 7 without using any bios calls (#5f). My own code isn't working. It puts the msx vdp in to a very strange mode that keeps repeating the first 32 scanlines over and over again. In the openmsx emulator its a little bit different. In that emulator it repeats the scanlines in blocks of 8 scanlines.

Many thanks!

Stephan

Aangemeld of registreer om reacties te plaatsen

Van inchl

Supporter (5)

afbeelding van inchl

16-05-2019, 12:49

solved,...
ld a,%00001010
out (#99),a
ld a,128+0
out (#99),a
ld a,%01100000
out (#99),a
ld a,128+1
out (#99),a
ld a,%00101010
out (#99),a
ld a,128+8
out (#99),a
ld a,%10000000
out (#99),a
ld a,128+9
out (#99),a
ld a,%00011111
out (#99),a
ld a,128+2
out (#99),a

Van bore

Expert (115)

afbeelding van bore

16-05-2019, 13:10

inchl wrote:

It puts the msx vdp in to a very strange mode that keeps repeating the first 32 scanlines over and over again. In the openmsx emulator its a little bit different. In that emulator it repeats the scanlines in blocks of 8 scanlines.

If you can recreate that code you should report the difference to the openmsx developers.

While it might seem pointless to emulate a mode like that I am pretty sure they want to make the emulator as accurate as possible.

Van Grauw

Ascended (8516)

afbeelding van Grauw

16-05-2019, 15:10

I second bore’s comment!

Van turbor

Champion (428)

afbeelding van turbor

16-05-2019, 15:56

inchl wrote:

It puts the msx vdp in to a very strange mode that keeps repeating the first 32 scanlines over and over again. In the openmsx emulator its a little bit different. In that emulator it repeats the scanlines in blocks of 8 scanlines.

This actually sounds like the value of vdp(2) was wrong...
The difference between the repeating of 8 and 32 scanlines is then caused by the fact if you start your program from screen 1 or screen 0. That startcondition will have set the vdp(2) to an other value.

I hope you didn't forget to add a DI and EI around your code or the interrupt might cause it to be interrupted and your init maight go haywire because of it.

Van Grauw

Ascended (8516)

afbeelding van Grauw

16-05-2019, 19:55

turbor wrote:

The difference between the repeating of 8 and 32 scanlines is then caused by the fact if you start your program from screen 1 or screen 0. That startcondition will have set the vdp(2) to an other value.

Ahh I see that would explain…

turbor wrote:

I hope you didn't forget to add a DI and EI around your code or the interrupt might cause it to be interrupted and your init maight go haywire because of it.

Also I think it’s better to read the register values from their mirrors in the system RAM, and then only modify the bits that you need to modify… E.g. your current code hardcodes the display frequency to 60 Hz, which will mess up the video output for people who connected their monitor via composite video.