Karoshi MSX Community

Desarrollo MSX => Development (English/Ingles) => Mensaje iniciado por: dvik en 03 de Julio de 2006, 12:21:17 am



Título: New Screenmode
Publicado por: dvik en 03 de Julio de 2006, 12:21:17 am
I did some testing today and found a new screen mode. Its screen 0 but with screen 2 style BG tiles addressing. Its probably not the most useful screen mode but I made a little demo using it:

http://www.bluemsx.com/demos/scr05demo.zip

In this demo I use it to create interlaced images but it can of course be used without interlace as well. This screen mode was actually what I had in mind for interlaced width 80 but I did some calculations and although its more powerful than screen 0 its only possible to do width 64. If you look at the text on the bottom of the screen you'll see how it would look.

Note that no emulators support this screen mode yet so you can only run it on a real MSX. I've added support for it in blueMSX so it will be available in the next release.


Título: Re: New Screenmode
Publicado por: dvik en 03 de Julio de 2006, 01:17:56 am
The code for the demo is quite simple. It pretty much sets up the undocumented screen mode, adds an interrupt handler which toggles the BG tiles every frame, either 0000h or 2000h. The colors are standard screen 0, i.e. whatever is in VDP(7). The BG map is also as screen 0, i.e. 40x20 bytes.

The code includes a vram binary that has tile data for odd pages at 0000h-1800h and even pages at 2000h-3800h. Then the BG map is at 1800h. So you could easily just create a vram dump yourselves if you want to play with the code.

Código:
;------------------------------------------------------
;
; Description: Views an image using undocumented screen mode
;
; The new VRAM map is:
; 0000-17FF : Pattern table 1
; 2000-37FF : Pattern table 2
; 1800-1BC0 : Name table
;
; Use asMSX to compile (although is easily adapted to other assemblers)
;
;------------------------------------------------------

        .bios
        .page 1
        .rom
.start MAIN
       
RG2SAV equ     $F3E1
RG4SAV equ     $F3E3

MAIN:

        ld      hl,VDP_REGS
       
        di
        ld      a,$80
        ld      c,$99
@@CPYLOOP:
        outi
        nop
        nop
        out     ($99),a
        inc     a
        cp      $88
        jp      nz,@@CPYLOOP
       
        ei
       
        ld      a,3
        ld      [VALUE],a
       
        ld      hl,VRAM_DATA
        ld      de,0
        ld      bc,$3800
        call    LDIRVM

; installs interupt hook
        call    INSTALLISR

@@HANG:
        jp      @@HANG


;
; Interrupt routine
;
ISR:
        di
        in      a,($99)
       
        ld      a,[VALUE]
        out     [$99],a
        xor     4
        ld      [VALUE],a
        ld      a,$84
        out     [$99],a
        ei
        ret

;
; Installs interrupt hook
;
INSTALLISR: di
        ld hl,$FD9F
        ld de,HOOK
        ld bc,5
        ldir
        ld a,$C3
        ld hl,ISR
        ld [$FD9F],a
        ld [$FD9F+1],hl
        ei
        ret

;
; Uninstalls interrupt hook (not used in this example! :P)
;
REMOVEISR: di
        ld hl,HOOK
        ld de,$FD9F
        ld bc,5
        ldir
        ei
        ret



VDP_REGS:
db 02h,f0h,06h,ffh,03h,36h,07h,b1h

VRAM_DATA:
.INCBIN "vram.dat"

;
; RAM variables
;
.page 3

VALUE: DS 1
HOOK: DS 5


Título: Re: New Screenmode
Publicado por: Jon_Cortazar en 03 de Julio de 2006, 07:46:26 am
Nice, dvik!. I'll test it later, thnx for submitting it!  :D


Título: Re: New Screenmode
Publicado por: dvik en 03 de Julio de 2006, 08:02:18 am
I've only tested it on my CX5M so I'm curious to hear how its running on other MSXes.


Título: Re: New Screenmode
Publicado por: dvik en 03 de Julio de 2006, 09:08:41 am
And here is a width80 text using the new screen mode that is quite readable: http://www.bluemsx.com/demos/scr05demo2.zip

And here is an emulator screenshot: http://www.bluemsx.com/demos/scr05demo2.png


Título: Re: New Screenmode
Publicado por: Jon_Cortazar en 03 de Julio de 2006, 09:35:44 am
Lookin' good!. When I arrive home, I'll test both demos!.


Título: Re: New Screenmode
Publicado por: jltursan en 03 de Julio de 2006, 10:56:22 am
Impressive!, you've finally done it!. I'll test too ASAP.

Btw, have you find the way to use the font you post here some days ago?. If so, I think that the same font design could be used with a 64 chars font and achieve a very good looking 64 columns mode.


Título: Re: New Screenmode
Publicado por: pitpan en 03 de Julio de 2006, 07:13:58 pm
Cool screen mode! I have to test it on the real MSX at 50 Hz. Anyone ready to code an eBook reader?


Título: Re: New Screenmode
Publicado por: jltursan en 03 de Julio de 2006, 09:27:36 pm
It works flawlessly on my HB-75 and the font reads very well!. I haven't tested the new mode on higher machines; but I suppose that it will work fine....and thinking about that; maybe is possible to obtain a still readable text mode with 160 columns interlacing a 80 columns mode... :o


Título: Re: New Screenmode
Publicado por: coldbreeze en 21 de Mayo de 2007, 09:13:52 am
It failed on my HB-F1XDmk2... hung up on white screen.  :(


Título: Re: New Screenmode
Publicado por: jltursan en 21 de Mayo de 2007, 12:39:11 pm
Mmmm....maybe a problem with the V9938. I finally never tested it on MSX2 machines and I'm curious about if it works or not. I'll give a look...


Título: Re: New Screenmode
Publicado por: coldbreeze en 21 de Mayo de 2007, 01:33:11 pm
Please give it a try on any MSX2 machine with V9938. I am going to test the sample app on my SVI-728 shortly. I will let you know of the outcome.


Título: Re: New Screenmode
Publicado por: coldbreeze en 21 de Mayo de 2007, 02:03:13 pm
It worked fine on SVI-728!  :)