Results 1 to 4 of 4

Thread: REG_PALBANK0/1 register mapping

  1. #1
    Another Striker
    ack's Avatar
    Join Date
    Apr 2009
    Location
    Seattle, WA

    Posts
    312

    REG_PALBANK0/1 register mapping

    I've been working on a project disassembling some neogeo code and came across an inconsistency in documentation with the memory locations that REG_PALBANK0/1 map to.

    The dev wiki and a lot of example code out there have

    $3A000F = REG_PALBANK1
    $3A001F = REG_PALBANK0

    Where as snk docs are the opposite

    $3A000F = REG_PALBANK0
    $3A001F = REG_PALBANK1

    The disassembled code appears to be following the snk docs.

    Far as I have been able to tell the default active bank at power-on is $3A000F. Calling that REG_PALBANK0 would make the most sense.

    Curious if anyone has any info.

    thanks

  2. #2
    Crossed Swords Squire
    Hine62's Avatar
    Join Date
    Jul 2005
    Location
    New York

    Posts
    195
    Since REG_PALBANK0 would be referenced in code to locate the bank instead of using $3A000F, I don't think the naming matters. It must be a typo. I didn't find anything in the docs that states you have to use one bank before the other.

    All the code I have studied has used some sort of label instead of the actual memory location. This makes it easier to read and identify what the code does. As far as I can tell, once the palette location is stored in the SCB1 for the LSPC it doesn't matter which bank it is in.

  3. #3
    Another Striker
    ack's Avatar
    Join Date
    Apr 2009
    Location
    Seattle, WA

    Posts
    312
    A typo in the code or a typo on the wiki?

    For most cases the name/address mapping doesn't matter like you suggest. In my case I've been disassembling smkdan's diagbios so to some degree it does. When an error is detected using bank $3A000F (power on bank) it prints an error about BANK0, and BANK1 when it switches to $3A001F. This would mean either the wiki is typo'd or the bios has it backwards. I was curious if anyone knew for sure which is correct. I guess for now I will use snk docs for my defines so they match up with the errors the bios prints and just add a comment they are backwards from the wiki.

  4. #4
    Crossed Swords Squire
    Hine62's Avatar
    Join Date
    Jul 2005
    Location
    New York

    Posts
    195
    Most likely the dev wiki is backwards.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •