-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathusage.txt
149 lines (120 loc) · 5.83 KB
/
usage.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
Using freemlib for Neo-Geo
==========================
The freemlib is comprised of two types of files:
1) Files to Copy (or Symlink) and Leave Alone
2) Files to Copy and Change
The files in Category 2 are the ones that will change per-game.
The best examples of generally using the freemlib for Neo-Geo are in the
examples directory. However, that doesn't cover what you should do to set up
your environment so you can actually use the freemlib in the first place.
Files to Copy (or Symlink) and Leave Alone
------------------------------------------
(Addresses, Registers)
* src_68k/inc/input.inc Defines for Controller inputs.
* src_68k/inc/mvs_bram.inc Defines for MVS Backup RAM.
* src_68k/inc/neogeo.inc Defines for Neo-Geo hardware.
* src_68k/inc/ram_bios.inc Defines for the BIOS RAM locations.
(freemlib Functionality)
* src_68k/inc/mess_macro.inc Macros for use with MESS_OUT.
* src_68k/inc/mess_defs.inc Defines for characters to use with MESS_OUT.
--------------------------------
* src_68k/func/animation.asm Animation-related functions.
* src_68k/func/background.asm Background-related functions.
* src_68k/func/collision.asm Collision-related functions.
* src_68k/func/fix.asm Fix layer-related functions.
* src_68k/func/memcard.asm Memory Card-related functions.
* src_68k/func/palette.asm Palette-related functions.
* src_68k/func/sprites.asm Sprite-related functions.
* src_68k/func/system.asm System-related functions.
(CD System-specific Files)
* cdfiles/ABS.TXT Abstract file with required data for loading.
* cdfiles/BIB.TXT Bibliography file with required data for loading.
* cdfiles/CPY.TXT Copyright file with required data for loading.
Files to Copy and Change
------------------------
* src_68k/header_68k.inc 68000 Vectors and such at $0.
* src_68k/header_cart.inc Neo-Geo program header for Cart systems at $100.
* src_68k/header_cd.inc Neo-Geo program header for CD systems at $100.
* src_68k/ram_user.inc User RAM defines.
header_68k.inc
--------------
This file contains the 68000 vectors, spanning from $00-$FF.
By default, this file won't compile.
Yes, I want you to think about what you're doing here.
"Note: You must modify the "$????????" sections for your game."
$???????? ; Divide by 0
$???????? ; CHK Instruction
$???????? ; TRAPV Instruction
$???????? ; Line 1010 Emulator
$???????? ; Line 1111 Emulator
$???????? ; Level 3 interrupt
$???????? ; Level 4 interrupt
$???????? ; Level 5 interrupt
$???????? ; Level 6 interrupt
$???????? ; Level 7 interrupt (NMI)
Thing is, you might actually be using some of these for features in your game.
I can't tell ahead of time. However, I'm sure you'd like to have some example
values for things to get started.
$00C00426 ; Divide by 0
$00C00426 ; CHK Instruction
$00C00426 ; TRAPV Instruction
$00C00426 ; Line 1010 Emulator
$00C00426 ; Line 1111 Emulator
When any of these are triggered, the system will be reset.
Some games handle these differently (I believe Puzzle Bobble actually handles
TRAPV, but I don't fully remember), so it's really up to you.
$00000000 ; Level 3 interrupt
$00000000 ; Level 4 interrupt
$00000000 ; Level 5 interrupt
$00000000 ; Level 6 interrupt
$00000000 ; Level 7 interrupt (NMI)
This is what I use in a few of the examples. It may not the the best choice.
For what it's worth, though, Samurai Shodown/Samurai Spirits does the same thing.
Some cart games have a very short Level 3 interrupt handler. Others point the
Level 3 interrupt handler to $00000000. The examples use a minimal Level 3
interrupt handler just to be safe.
On CD systems, you're going to want to handle interrupt level 3, though I'm not
sure what code needs to be run, so that's a work in progress.
Some games also use $00C00426 here. I am unsure if you can fully take advantage
of the other interrupts (4-7) on the Neo-Geo in any way. (Perhaps via TRAPV?)
header_cart.inc
---------------
This file handles the data starting at $100, also known as the Neo-Geo header.
I'm unsure of how the "System Version" byte is fully utilized, but unless you're
making a game for the Neo-Geo CD, you'll probably want to leave it at $00.
You'll want to change the NGH number. I haven't left you in the cold this time,
but the game ID you get by default is 0FFF. You'll probably want to change that.
Please note that the NGH number must NOT be 0000, otherwise all other values
are "valid". SNK only ever used BCD numerals here, as far as I could tell.
* Game program size
$00080000 = 4Mbits/512KB
$00100000 = 16Mbits/1MB (max size without bankswitching)
and so on. (What is the smallest valid program size?)
The pointer to backup RAM block is at $10E. The first two bytes at the location
pointed to hold the game's debug dipswitches.
* Game save size (in bytes)
The next two bytes are eyecatch-related:
* Animation Flag (0=Eyecatch by BIOS, 1=Eyecatch by game, 2=Nothing)
* Sprite Bank (if eyecatch done by BIOS)
The software dip pointers start at $116 and map out like so:
$116 Japan
$11A USA
$11E Europe/Asia
These next four are very important, so pay attention!
$122 jmp USER
$128 jmp PLAYER_START
$12E jmp DEMO_END
$134 jmp COIN_SOUND
You will need to have functions matching these names (unless you change them,
which I really don't recommend).
header_cd.inc
-------------
header_cd.inc is based off of header_cart.inc, so please see that section for
more information. The main difference is that you might want to modify the
system type byte that appears after the "NEO-GEO" string, as well as an extra
memory position used for Z80 purposes.
ram_user.inc
------------
ram_user.inc holds the RAM for your program. Currently, the state of affairs in
here is terrible, and I wish there was a better way of handling it.
Alas, until I do, you'll have to make do with equ.