[hatari-devel] Extended video mode

Eero Tamminen eerot at users.berlios.de
Tue Mar 9 21:43:23 CET 2010


Hi,

On Tuesday 09 March 2010, ghst at ghstwlf.com wrote:
> I am looking in to extending the resolution of my atari st to someting
> like, 1280x1024 or even bigger. I want to do this by a small mod to the
> cardrige port by adding WE in some way. Now I am curios how Hatari does
> its extended grafics mode. I have tried to read the code but I can't make
> any sens of it. Please tell me. //Pär

I took a quick look at it.

Hatari's own cartridge code adds CPU opcode that goes into VDI code.

The CPU startup code (in hatari-glue.c) sets the LineA variables according
to the VDI resolution.

newcpu.c has following code:
    /* Intercept VDI exception (Trap #2 with D0 = 0x73) */
    if (ExceptionSource == M68000_EXC_SRC_CPU)
      {
        if(bUseVDIRes && nr == 0x22 && regs.regs[0] == 0x73)
        {
          if(!VDI())
          {
            /* Set 'PC' as address of 'VDI_OPCODE' illegal instruction
             * This will call OpCode_VDI after completion of Trap call!
             * Use to modify return structure from VDI */
            VDI_OldPC = currpc;
            currpc = CART_VDI_OPCODE_ADDR;
          }
        }

OpCode_VDI() function in vdi.c modifies VDI variables according to set VDI
resolution when the VDI call completes.

video.c has checks to skip lot of stuff when VDI mode is used and screen.c
just blits the Atari screen memory to the Hatari window.


	- Eero



More information about the hatari-devel mailing list