Author Topic: VRAM and palette access - Neo Geo  (Read 3571 times)

Offline Heudebert

  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
VRAM and palette access - Neo Geo
« on: October 19, 2014, 07:29:13 PM »
Hi,
I'm trying to build a sprite extractor for Neo Geo. I want to extract the sprites in a Neo Geo game and transform them into annimated gif.

I need to be able to read some VRAM adresses and access the palette.
In burn/drv/d_neogeo.cpp i found a few functions: neogeoReadByteSMA9A37(UINT32 sekAddress), neogeoReadByteSMARNG(UINT32 sekAddress) and NeoSMABankswitch()

could you explain me the differences between the two first functions and how the third one works ?
Do you have any advice on how i could do it or where i should look ?

Thanks in advance,
Pierre.

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Re: VRAM and palette access - Neo Geo
« Reply #1 on: October 19, 2014, 10:34:55 PM »
Hi,
I'm trying to build a sprite extractor for Neo Geo. I want to extract the sprites in a Neo Geo game and transform them into annimated gif.

I need to be able to read some VRAM adresses and access the palette.
In burn/drv/d_neogeo.cpp i found a few functions: neogeoReadByteSMA9A37(UINT32 sekAddress), neogeoReadByteSMARNG(UINT32 sekAddress) and NeoSMABankswitch()
could you explain me the differences between the two first functions and how the third one works ?
Those are protection (think DRM)-related. The SMA9A37 returns a fixed value the protection device overlays over that chunk of the program rom. The SMARNG is a Random Number Generator function. (Really pseudo-random). The bankswitch function basically allows the game cartridge to have more program rom than the main system (neogeo) normally allows. Normally you are allowed 2mb of program data, from 0-0xfffff of the 68k's address space and from 200000-2fffff of the space. (the main ram is 100000-10ffff and a ton of mirrors take up the space until 200000). The bankswitch swaps out that blob of rom that is banked in 200000-2fffff with another section of rom.
It's not necessarily something you'll need for a sprite dumper.
Quote
Do you have any advice on how i could do it or where i should look ?

Thanks in advance,
Pierre.

neo_run and neo_sprite are going to have more of the functions that you're looking for.
INT32 NeoRenderSprites(), for example, is a great place to start in regards to the actual sprite drawing. Do keep in mind the Neo-Geo is a bit odd as far as actual sprite functions. The backgrounds are even sprites! The sprites can be drawn in vertical strips of 16x16 tiles and do have an auto-animation function that advances them to the next strip in the sprite data.