分类:
2008-08-18 01:19:49
作者: zchou (Nelson Chou) 看板: Emulator
標題: [情報]送一篇關於NEOGEO/MVS ROM的文章[原文版]
時間: Tue Sep 15 00:46:06 1998
[March 11th 1998]
Shin Seiki project
Neo Geo Technical Notes
=======================
revision 0.2
by shseiki@mygale.org
(previously neooge@hotmail.com)
This document contains several technical information I discovered
while coding "Shin Seiki", the current name for my NeoGeo Arcade
and Home Console systems emulator.
Please note: I give those notes 'as is', there are probably many
things wrong and misunderstood.
I have absolutely *NO* docs about the NeoGeo, here is the results
of BIOS/ROM tracing and disassembling.
If this file is of any use to an NG emulator coder, I'd appreciate
in exchange to be credited :), and most important: that he shares his
own information and discoveries to the NeoGeo emu community.
---------------------------------------------------------------------
Unless specified, all numbers are in hexadecimal.
MEMORY MAPPING:
===============
000000-003FFF ROM BIOS [or ROM CARTRIDGE if any]
000400-0FFFFF ROM CARTDRIDGE
100000-10FFFF 64Kb RAM
3xxxxx Several hardware registers (see below)
400000-401FFF 8Kb COLOR RAM (current bank)
800000-800FFF Calendar or Memory Card?
C00400-C1FFFF ROM BIOS
D00000-D0FFFF BACKUP RAM
There is a bunch of hardware registers, most of them are still a
mystery.
ROMS:
=====
Dumped ROM are likely to be files under the form N0xx00xx.*
*.03? : 68000 ROM
*.17?, *.27? : Sound ROM
*.47? : Z80 ROM
*.53?, *.63? : CHAR ROM
About Tiles ROM:
================
The 'Joy Joy Kid' game have only 2 (N022001A.538 (planes 2 & 3)
and N022001A.0638 (planes 0 & 1)), but for instance '3 Count Bout'
have 16. Each Tiles ROM file handle two planes, assembled one after
another in a linear way.
I'll take the example of 'NAM 1975'. There are 6 CHAR ROMs, each
being 512Kb. In each of them, two planes.... For a total of 32768
8x8 tiles in a ROM.
N046001A.538 from 00000-3FFFF : Data of plane 3, chars 0-32767
from 40000-7FFFF : Data of plane 2, chars 0-32767
N046001A.638 from 00000-3FFFF : Data of plane 1, chars 0-32767
from 40000-7FFFF : Data of plane 0, chars 0-32767
N046001A.53C from 00000-3FFFF : Data of plane 3, chars 32768-65535
from 40000-7FFFF : Data of plane 2, chars 32768-65535
N046001A.63C from 00000-3FFFF : Data of plane 1, chars 32768-65535
from 40000-7FFFF : Data of plane 0, chars 32768-65535
N046001B.538 from 00000-3FFFF : Data of plane 3, chars 65536-98303
from 40000-7FFFF : Data of plane 2, chars 65536-98303
N046001B.638 from 00000-3FFFF : Data of plane 1, chars 65536-98303
from 40000-7FFFF : Data of plane 0, chars 65536-98303
COLOR RAM:
==========
Two banks of 4096 colors exist, you can choose one by poking at
either 3A000F or 3A001F ("strobe" registers).
3A000F Byte Select Color Bank 1
3A001F Byte Select Color Bank 0
Adresses from 400000-4001FFF give you 4096 colors, divided into
256 palettes of 16 each.
400000 Word Color $0 / Palette $00
400002 Word Color $1 / Palette $00
40001E Word Color $F / Palette $00
400024 Word Color $2 / Palette $01
401FFE Word Color $F / Palette $FF
It's perhaps not always the case (Sengoku ROM seems different), but
the colors are RGB coded, with
Bit 12 - 15 : ?
Bit 8 - 11 : R
Bit 4 - 7 : G
Bit 0 - 3 : B
VIDEO RAM:
==========
Be aware that those information were guessed and are likely to be
unexact.
You can consider VRAM like a 'word memory space', made of $8600 words.
It's perhaps not a general rule, but you can figure it as a big two-
dimensions (Y,X) array with Y being from 0 to 31. Many background
screens in games are shown in VRAM this way.
The RAM video seems to be $10C00 bytes, the last 3072 bytes probably
related to sprites. VRAM can only be reached using 3 ports.
3C0000 word VRAM pointer
3C0002 word VRAM data
3C0004 word VRAM modulo
To summarize, 3C0002 (VRAM DATA) is where you poke a word in VRAM at
the VRAM pointer written at 3C0000. The modulo at 3C0004 is then
added to the VRAM pointer.
VRAM pointer:
bit 1-15: location of the WORD to adress
bit 0: byte access
if bit 0 is clear, a word write to 3C0002 will be done at the VRAM
word location from bit 1-15.
If bit 0 is set, then writes to 3C0002 will be done to the low order
byte of the given VRAM word location AND the high order byte of the
following word location.
In all case, 3C0004 (VRAM modulo) will be added to the WORD adress.
In most case, modulo is set to 1 (fill VRAM 'vertically') or to $20
(fill VRAM 'horizontally')
BACKGROUND GRAPHICS:
====================
They are made of 16x16 tiles, each occupying two WORDs in VRAM:
WORD 0:
Bit 15-0 : Tile index
WORD 1:
Bit 15-8 : Palette index in Color RAM
Bit 7-1 : ? (perhaps hi order of Tile index, yflip,
priority?)
Bit 0 : Horizontal Flip
The CHAR ROM is made of 8x8 chars, and a background tile need 4
consecutives chars. Simply multiply the Tile index by 4. The
CHARS are displayed this way:
15 8 7 0
+--------+--------+ 15
| char 0 | char 2|
---------+--------+
| char 1 | char 3|
+--------+--------+ 0
In almost all games, the only thing ShinSeiki can do at this time
is allowing the user to browse the VRAM while running a GAM ROM.
This is still quite limited, but one can see the title pic and
some background graphics in almost all games. If x and y means
the position of the tile, the VRAM contains:
Words 0,1 : 16x16 Tile at x=0, y=0
Words 1,2 : 16x16 Tile at x=0, y=1
Words 31,32 : 16x16 Tile at x=0, y=15
Words 33,34 : 16x16 Tile at x=1, y=0
....
As you perhaps read, setting the bit 0 of 3C0000, allow to write
in a single instruction the low-order Tile index AND the
palette index. It's used in particular in the BIOS to display
text strings.
CONTROLLER REGISTERS:
=====================
Bits are active low.
300000 Byte Controller #1
Bit 7 : Button D
Bit 6 : Button C
Bit 5 : Button B
Bit 4 : button A
Bit 3 : Right
Bit 2 : Left
Bit 1 : Down
Bit 0 : Up
340000 Byte Controller #2 (same bits as 300000)
380000 Byte Start, Select
Bit 1 : Player 1 Select
Bit 0 : Player 1 Start
Z80
===
Nothing to say at this time, except this register on the
68000 side:
320000 Byte Send Z80 a command
3C000C W IRQ Acknoledge?
Bit 2 Level 1 Interrupt (Vertical blank)
Bit 1 Level 2 Interrupt
Bit 0 Level 3 Interrupt
Each interrupt is acknoledged by its setting the corresponding
bit.
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Voila! Stay tuned for more material in the future.