city41
Posts: 22
Joined: 22 Dec 2018, 10:11

Questions on writing .neo files

22 Dec 2018, 10:20

Hey everyone, my first post on this forum. I just got my NeoSD the other day.

I am writing a command line tool to build .neo files for homebrew ROMs: https://github.com/city41/neosdconv, I'm building it because I could not get the official tool to work in Linux with Wine (and I prefer to avoid Wine if possible).

I have it working on my tiny little demo ROM. But have some questions.

It looks like the C ROM data is interlaced? So the first byte comes from C1, the second from C2, then C1, etc? How does this work for larger games with more C ROMs? Is it C1 C2 C1 C2 ... then C3 C4 C3 C4, or C1 C2 C3 C4 C1 C2 C3 C4 ... ?

It looks like only officially released games can have screenshots?

I don't totally understand the V2Size part of the header. When would V2Size not be zero? I'm new to Neo Geo programming and haven't done any audio yet, so maybe that's a dumb question.

Thanks!

User avatar
neodev
Posts: 217
Joined: 09 Apr 2018, 14:47

Re: Questions on writing .neo files

22 Dec 2018, 10:39

Yes, C data is interleaved. 2 bytes from C1, 2 bytes from C2, 2 bytes from C1, 2 bytes frlm C2... Then repeat for pairs C3,C4 C5,c6 c7,c8.

V2 size is not 0 if the game uses separate adpcm A and B regions (older games use that, but snk introduced the neo-pcm chip that allowed combining botn regions in a single rom). Setting v2size to 0 enables the neo-pcm emulation and single adpcm area

city41
Posts: 22
Joined: 22 Dec 2018, 10:11

Re: Questions on writing .neo files

22 Dec 2018, 18:44

When I interleave 2 bytes I get wrong results, but if I interleave 1 byte it works. Hmmm, not sure what's wrong. But I'll keep playing with it.

And starting to get the v rom stuff. Like I see that League Bowling has 019-v11.rom, 019-v12.rom and 019-v21.rom

Thanks for the help!

city41
Posts: 22
Joined: 22 Dec 2018, 10:11

Re: Questions on writing .neo files

22 Dec 2018, 19:05

I'm starting to think the interleave is 1 byte. I got my tool to convert League Bowling successfully using 1 byte.

city41
Posts: 22
Joined: 22 Dec 2018, 10:11

Re: Questions on writing .neo files

22 Dec 2018, 20:20

Ok got my tool converting League Bowling and Pulstar correctly. KOF94 and Kizuna Encounter crash back to the NeoSD menu. I'll dig out a hex editor and compare to see where I'm going wrong. But pretty happy with this for now, can get back to writing my game :)

User avatar
neodev
Posts: 217
Joined: 09 Apr 2018, 14:47

Re: Questions on writing .neo files

22 Dec 2018, 20:37

Nice. Probably the interleaving is 1 byte then. I'm not at home and just wrote it from memory.
A game returning to neosd menu after flashing usually means the neogeo header is not correct. That usually means the P rom has some special loading. The most common one is having the rom halves swapped, that is, for a 2MB P rom, copy to neo the 2nd MB first and the first one next. That's due to the cart using the bank access output enable signal (that is active low) as the high address bit for the P rom, so when accessing rom (1st MB) it's 1 qnd when accessing bank (2nd one) it's 0.

city41
Posts: 22
Joined: 22 Dec 2018, 10:11

Re: Questions on writing .neo files

22 Dec 2018, 23:20

Awesome, thanks! That did the trick and now KOF94 and Kizuna Encounter load just fine.

city41
Posts: 22
Joined: 22 Dec 2018, 10:11

Re: Questions on writing .neo files

10 Jan 2019, 05:39

Is there a minimum size the P ROM section must be? For home brew games, it's very easy to have a tiny P ROM (say 12kb). But when I write a P ROM that small, I see graphical glitches. The glitches seem to suggest the S and C tiles are not in the correct spot.

If I pad the P ROM out to a more reasonable size, say 512kb, then it works fine.

User avatar
neodev
Posts: 217
Joined: 09 Apr 2018, 14:47

Re: Questions on writing .neo files

10 Jan 2019, 07:29

All rom files inside the neo must be multiples of the erase size of the flash roms. That is 64KB for P, V, S and M, and 256KB for C. Neobuilder will pad them with FF bytes when needed.

city41
Posts: 22
Joined: 22 Dec 2018, 10:11

Re: Questions on writing .neo files

13 Jan 2019, 06:12

Awesome, thanks again! Padding out the roms worked great.

Return to “NEOSD and NEOSD Pro General Discussion”