PDA

View Full Version : REG_PALBANK0/1 register mapping



ack
12-27-2019, 07:09 PM
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

Hine62
12-30-2019, 04:44 PM
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.

ack
12-30-2019, 07:35 PM
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.

Hine62
12-31-2019, 12:24 PM
Most likely the dev wiki is backwards.