Archive for April, 2021

Neo Geo compatibility for my portable arcade test rig

April 16, 2021

I figured I’d go over some mods done to make my arcade test rig Neo Geo compatible. The first thing to do was make a JAMMA fingerboard adapter. I have a 2-slot motherboard so it’s not the vanilla JAMMA pinout, but it’s pretty close. Take a look:

The main changes I made are these:

moved test button to the right location

moved service button to the right location

tied right and left speaker together through 1uF caps and connected them to speaker positive

tied case ground to speaker negative

wired select up and down to player 1 buttons E and F

wired coin 3 and 4 to player 2 buttons E and F

One quirk I found is that I couldn’t make the mono audio work well, perhaps it’s my amplifier behind a matching transformer, perhaps my board is messed up in that respect, that’s why I had to mix the stereo audio to get it to work. The last time I talked about this project I had also not used the buttons D, E, and F for either player. I have installed those wires now and built an adapter to make those work. I decided to keep the theme running with the genesis controllers, but now I’m using unmodified ones and an arduino to make them work.

I have an arduino pro mini (running off the same 5v power supply as the rest of the system) connected to two MCP23018 I/O expanders. Plenty of people use the MCP23017 for things, the 23018 just has open-drain outputs. That means that when the outputs are live they ground the pins instead of pulling them high, and when deactivated they float rather than pulling them low. This simulates button presses for a system that all the buttons have a common ground pin like the Neo Geo. The code just glues two libraries together, one for reading genesis controllers found here and one for talking to I/O expanders found here. I may re-shuffle the button positions to more closely simulate the button placement on a Neo Geo, but this is more meant as a general purpose expansion to allow for 6-button JAMMA games to be used in this tester, not just the Neo Geo.

Another new feature (along with my 3d-printed fan grills) is video out. Having the ability to throw this up on a bigger monitor is nice, so I added a tap for video out. I don’t know how having both monitors connected will affect the impedance of the video line, but it probably won’t be too bad.

Synthesizing a neo-geo game from scratch (ish)

April 13, 2021

I recently decided to take on a project building a neo-geo MVS cart of a rather rare game, Twinkle Star Sprites. It is possible to buy this game for cheaper on the PS2 or Dreamcast, but why hack one of those into an arcade cabinet when you already have a Neo-Geo? When I started this project the prices on MVS carts on ebay started at around $1200 and went up from there, so it seems like a worthy effort. I’m gonna buzz through the easy stuff and focus on the things I had to do that you cannot easily figure out by googling or reading the silkscreen.

First step is acquiring parts. I needed a cartrige shell, they are reproduced in whatever color you want at RetroModding. I did find that the PCBs fit a bit tight so I shaved some of the plastic tabs with a hobby knife so it was snug but not bowing out. The PCBs I determined by looking at MVS Scans and then getting the bare circuit boards from ebay. You can also compare what games used each PCB and buy a game with compatible boards and pull the ROMs yourself. I did not have enough confidence in this project to try buying cheaper games with boards that MIGHT be compatible and start hacking on them, so to give myself the best chance at this working I got the PROGBK1 and the CHA256B boards. You also need to be sure to get the right chips on your PROGBK1 board, I bought the fully populated one and pulled the bottom chip off just to be sure I would have it if I needed it as I didn’t have the complete plan for how this would work at the time I bought these parts.

The ROMs are a whole other thing, looking at the PCB silkscreen I got this:

P1, V1, V2, TC5316200

C1-C4, KM23C32000

S1, TC531000

M1, TC531001

Looking these chips up and googling for equivalents or people replacing ROMs in neo geo carts I came up with this table:

big roms
small roms

So, it looks like I just need to get some of these UV erasable EPROMs to replace the mask ROMs in this game, that won’t be that hard. Programming them, however, is a bit of a challenge. I can program the 27C101 with my TL866A, but none of the others. The 27C301 is no big deal, I just made a passive adapter swapping /OE and A16 and pretend it’s a ‘101 (this difference is between standard JEDEC pinouts and non-JEDEC and I don’t know why they laid this board out with both, it seems really dumb). The bigger 16-bit ROMs will take some more doing, and I ended up buying one of these: E2R16v2.1 – 27C400/800/160/322 programming adapter for Minipro TL866. There are a bunch out there, but GGlabs does lots of other cool stuff and I like them.

Now that I have established that I have all the parts, how do I set up the boards I just bought? The easy answer is to copy the jumper positions on MVS Scans, but that flies in the face (a little) of the documentation on the Neo Geo Development wiki. I read up on these boards and added some stuff, cleaned up some red links and made some page redirects so the information I needed was all nice and organized on the wiki. There’s still plenty to be done, but largely what I needed that wasn’t already up there has been put up there. There is still an outstanding issue for me about ROM size nomenclature, however. Some of these roms are 16 bits wide, so do you talk in terms of 16bit words? or perhaps if the rom is being used in byte mode and accessed in 8bit bytes you use that? With all this confusion do you just refer to them in bits? Sometimes I find it unclear since there’s no units and that can be frustrating.

The first questionable thing is on the CHA256B board (which is supposedly just a slightly different layout of the CHA256 board). The scan of the OEM board has jumpers J2, J3, J9, J10, J11, and J16 set. According to the wiki the combination of J9/J10 means the board is set for 4MiB (the largest) C-ROMs, J2/J3 means it uses a 128KiB M-ROM (also, the bigger of the two available configurations), but J11/J16 seems to be an invalid configuration. There isn’t a fully reverse engineered schematic of this section of the board so I can’t check it but here’s my thoughts. If the ROMs in C1/C2 are less than 4MiB then you set J15, if they are 4MiB you set J11. If the ROMs in C3/C4 are less than 4MiB then you set J16, if they are 4MiB you set J12, and so on… After checking the MAME source I can see that C3/C4 are indeed smaller than C1/C2 which makes sense why the jumper would be set differently. This game does not use C5-C8 so that also makes sense why those jumpers are just not present.

Programming these chips was as easy as finding the ROMs on the internet (this was even easier than it usually is, they were hosted somewhere halfway-legitimate) and burning them. S1 and M1 burned ok, after using my adapter to program S1. The S1 spot on the board helpfully has power and ground run so that when you put in the 32pin EPROM the /OE line is grounded and power goes to the Vcc pin, even though with the mask ROM those pins on the board aren’t connected to anything. I programmed the C-ROMs using 27C322s even for C3/C4 and just put more copies of the code in the empty space so it would simulate the mirroring of code into upper memory that would happen if smaller ROMs were installed there. To use the adapter I bought you need to split the ROMs into chunks, a friend wrote some scripts to make that easy.

The next board was easier in some ways and harder in others. The PROGBK1 has the chip enable schematics traced out, but I had some shenanigans to perform to make this one work right. Looking at the PCB on MVS Scans I moved all the jumpers and removed the un-needed bank switching chip. Now I want to understand what is actually going on so I can know which chips to install here.

stock Twinkle Star Sprites configuration

Here is the stock configuration, it uses half of the 74ls139 to decode the A21 and A22 lines to chip select lines for each of the 4 chip positions. What is of particular interest to me is the stuff going on with JV11 and JV8. JV11 sends A20 to a pin on V1, JV8 grounds that pin on V2. I know V2 is half the size of V2 so this makes some sense, but look at what the pin is labeled: A20 or /BYTE. Now when I was looking for equivalent chips I found that the 27C160 has what is known as byte mode where the contents of the chip can be read out in 8bit bytes instead of 16bit words. One of the unused data lines is used as another address line and that’s how the chip can be 1Mx16 OR 2Mx8. Looking closer at the traces on the board I can see that NO V-ROM uses all 16 data lines, so they are all operating in BYTE mode all the time. This is making me sweat a little because the 27C322 that I THOUGHT could be an equivalent for the larger rom here does not have that mode. Looking at the V-ROM page on the wiki reveals that little oversight of mine:

The TC5332204 mask ROMs have a similar pinout to the 27C322 EPROMs. The only difference is that they’re set to byte mode only: half of the data output pins are unused. Pin 30 (Q15) is used as the address lowest bit.

some of those traces don’t go anywhere…

Oops. It looks like there are no easy solutions for how to get a TC5332204 equivalent EPROM. But where did that come from, I thought these were TC5316200 ROMs? Turns out the silkscreen only covers one possible ROM that can fill that spot, MAME has a listing of the actual ROM types in the comments (differences from above in bold):

P1, TC5316200

V1, TC5332204

V2, TC5316200

C1, C2, TC5332205

C3, C4, TC538200

S1, TC531000

M1, TC531001

So how do I make this work with parts I can get? One solution I saw involved a couple 74LS245 gates to ‘make’ a byte mode for the 27C322. That seemed like a lot of work and not much fun. My next thought was to do some of my own address decoding to split the memory space of V1 into two chips. Turns out that is exactly what this board is FOR!

my new configuration

I decided that because A22 is unused (the top half of the available memory that is being decoded) then I would just remap the available 4 chips into the range of memory I care about. JV7, JV8, and JV9 now set the V1, V2, and V3 chip locations to 27C160s in BYTE mode. JV3 and JV4 now decode the memory range into chunks half the size they were before, which lets me use chips half the size (but twice as many) and all is well.

There are some differences between this memory map and the original. In the original case since A20 was not wired to v2 at all that means if you access the memory region from 0x300000 through 0x3FFFFF you get the same data that was from 0x200000 to 0x2FFFFF, what MAME calls a mirror. I checked and MAME doesn’t implement the mirror even though the original game has it, that means to me that the game will work without it. Also when accessing memory above 0x400000 you get noise (probably all 0 actually) because there are physically no chips at those locations, so when the 74ls139 enables that socket, nothing happens. The difference now is that the way I rewired it reading from 0x300000 through 0x3FFFFF gives you nothing instead of that mirror and reading from 0x400000 to 0x7FFFFF gives you a mirror of what’s on 0x000000 to 0x3FFFFF. This is because now A22 is hooked to nothing so the decoder just happily routes those requests to V1 and 2 again since it doesn’t know the requests are actually for higher addresses because the only difference is A22 going high.

In the case of this game it doesn’t matter, but for some games they use tricks where they access the same information from different locations because it’s faster in code to do that, they use the mirroring intentionally to save instructions. Also, some security checks in games check for mirroring because inexact implementations like mine can be detected by looking at higher memory that’s supposed to be empty and finding data. It would get a bit more complicated if I wanted to get around that, basically I’d add a 74ls138 that is like the 139 but uses 3 bits to decode to 4 chip locations instead of 2 bits to 4 chip locations, then I’d use A22 on that and have it route to 4 unconnected chips (I may actually do this to make a metal slug 3 cart and stack chips to give me 8 V-ROMs decoded using a 74ls138 instead of the ‘139 that’s in there).

To finish off the cart there are replacement labels available for download in various places. I use Irfanview for my images because it was nice like a decade ago and this is an old windows installation. The print dialog in that program lets you pick the image size in X and Y (or just one and preserve the aspect ratio). for my printer and the specific label it took some tweaking as I printed test pieces on regular paper but once it was just right I ran a sheet of inkjet printable photo sticker paper and cut it out. Now I only realized that the original labels are not nearly that shiny after printing it, but it’ll probably be fine.

Lavender Hazelnut cake, attempt one

April 8, 2021
the serving tray is plastic, but focus on the fact I even have one, this chunk of kitchen counter is plywood

I decided to create a cake based on the following directions: “hazelnut and lavender spongecake with italian buttercream and frosted with a little chocolate ganache” and this is what my first try looks like. For all the ingredients I tried to get the best stuff I could: good quality chocolate, milk, cream, and butter from a local dairy, and homemade roasted sugar. If I was more patient I would have gotten a few dozen eggs from a friend’s farm an hour or so away. My girlfriend was a big help when making this cake, even though it took until 2am to complete.

Starting with the easiest thing first, the ganache. 8oz dark chocolate melting wafers (I used dark because it felt right with the buttercream being so sweet) and a half a cup of heavy cream. Stir together in a double boiler and once smooth you’re done. I used the entire amount on my cake and it ended up being a large clumsy puck topping the cake instead of a thin layer frosting the entire outside. If I can get the cakes to come out smoothly next time I won’t have to hide them in so much frosting.

Next is the italian buttercream. I made way more than I really needed, but it wasn’t all that difficult. Considering I had two 9″ round cakes this website gave me the recipe and I scaled it up to 10 cups (except the vanilla). My advice for this is to use a thermometer with an alarm in the sugar so you can be informed when it hits the right temperatures instead of staring at it the whole time. In addition to that I substituted the vanilla extract for Nielsen-Massey Vanilla Paste on the recommendation of the podcast A Hotdog is a Sandwich.

I don’t know how much frosting people normally like on cakes, but 10 cups seems like WAY too much for two 9″ cakes and I have quite the sweet tooth. That is neglecting the fact I never intended to frost anything but the center layer so maybe 3 cups max for that? maybe 2? When making this it is important to have faith. Your wonderful italian meringue will separate after being refrigerated, just whip it back up. It will also look like thin soupy clumps of butter in a broken hollandaise but have faith and keep going and it will come together into a very very stable frosting. Also, fix your stand mixer beforehand so you don’t have to take the back off and hold down the governor like I did. Repairs during cooking are exciting but counterproductive.

How else could I fancy this up a bit? make it a little more special? I used roasted sugar for the cake so here’s how I did that.

  • Start with 30oz. of white sugar, empty it into an even layer in a 9”x13” glass baking dish.
  • Place the baking dish into an oven and set the oven for 300F (I did not preheat mine, it came up to temperature with the sugar in the oven).
  • Bake for one hour, then open the oven and stir the sugar. It should already have started to take on a slight color and is probably clumped together. Break it up as best as possible to avoid issues later.
  • Bake for half an hour and stir again.
  • Bake for half an hour and stir again.  At this point I decided my sugar was ready, you might want a darker color and flavor, in which case repeat the above process as needed. 
  • Remove the sugar and let cool completely (you may want to stir while cooling, I did not). 
  • Once the sugar is cooled, sift into your seal-able retention vessel (I used a hand crank sifter to break it up into a light fluffy powder and stored it in a wire-top glass container). 

Notes on the sugar: I made more roasted sugar than was needed for this cake, by a lot. To convert it into caster sugar put a bit more than you think you will need in a food processor with the metal blade and let go for… a while. Weigh it AFTER that process to make sure you didn’t lose any that stuck to things or floated away. Do not try to process all 30oz. of sugar in the food processor, this will take forever. Did this add much flavor? I dunno, but it seemed like a nice touch and it was flavored enough that my girlfriend did not like the clumps which did not sift well in her tea, so it did something.

unmodified sponge (slightly overcooked and dry) to check for what the crumb is supposed to look like

For the cake I tweaked the recipe for this Classic Victoria sandwich cake. I am not happy with how it turned out but I have thoughts on how to help it. First I did a 1.5x batch because it calls for 20cm cake tins and I had 9″ ones. I buttered the tins and coated with the roasted sugar, but I would use cut rounds of parchment paper on the bottom of the pans if I did it again. You could use cake tins where the bottom comes out, but I couldn’t find these and I don’t like having tons of parts rattling around that can get lost.

I used 1/3 hazelnut flour and used a bit more baking powder to compensate for the heaviness (perhaps more was needed?). The rest of the flour I used cake flour and just added baking powder and salt to compensate for not using the self rising flour. The extra fine texture I was hoping would offset the hazelnut flour’s coarse grind. I might try a double-whammy of whipping the egg whites separately, creaming the egg yolks, butter, and sugar, then adding the dry ingredients, then folding in the whites to give extra mechanical lift in addition to chemical leavening. If I do that I will be sure to put them in a low rack in the oven, take out all the other racks, and then never move them (so as not to deflate them) when I open the oven to check them for done-ness with a toothpick.

seems too dense and not tall enough despite the extra baking powder

The lavender ratio was from someone else’s recipe and I used the ratio of lavender to other dry ingredients to figure out how much to use. I think it was too much, but not by a lot. Redoing this I might try 3tsp. The reasoning for powdered lavender was I envisioned this being done with picked fresh lavender buds from the garden of a nice victorian or second empire house, then ground by hand. Lacking that I ordered some from Bulk Apothecary and ground them in a spice grinder. I needed 4 grams and it was too much. DO NOT buy a pound because it’s not that expensive and you’d rather not run out. In fact, e-mail me if you want any. I have a lifetime supply.

  • 300g caster sugar (from roasted sugar)
  • 300g softened unsalted butter
  • 6 eggs beaten
  • 300g self-rising flour (made from the following ingredients)
    • 200g cake flour
    • 100g hazelnut flour
    • 5tsp baking powder
    • 1.25tsp salt
  • 1.5tsp baking powder (in addition to above)
  • 3tbsp milk
  • 4tsp lavender, finely ground

I creamed together the sugar and butter until smooth, then mixed in the eggs and milk, then slowly incorporated the sifted together dry ingredients. I weighed the two baking pans, going back and forth one dollop at a time trying to get them even before spreading them evenly. Cooked until the toothpick comes out clean (I think mine were a bit too long).

cleaning the frosting off those little bumps around this cake stand is not fun, don’t be messy like me

For frosting the cake I like to run my spatula under hot water so it doesn’t stick to the frosting while I’m spreading it. Also, it’s probably important to have a real offset spatula and not just a big solid stainless steel one used mostly for burgers and grilling. If I had thought about it at the time I would have put down a cake round, carefully sliced it with my knife to make it a clean cylinder trimming the crumbly and messy edges. Then frosted the top and added my second layer, also making it a perfect cylinder of the same diameter. Then after cleanup I could have lightly frosted the whole thing in ganache (I don’t exactly know how, I think I would have had to wait for it to cool a lot more that I did this time just pouring it into the hole in the top of my frosting mountain).

This has been attempt one of this cake, there may be another but not for a while (I’m out of eggs, butter, and some other stuff…). Now I’m going to get back to house remodeling (I kid you not, the paint in the bedroom is slightly off and it’s bugging the crap out of me).

Croque Monsieur En Croûte

April 8, 2021

Small deviation from our regularly scheduled programming. After bodging a bunch of recipes together I think this deserves to be preserved as a flexible recipe that turns out pretty good.

The inspiration for this was watching a bunch of youtube cooking shows like Binging With Babbish, and what was in the fridge at the time. The idea here is to make something like a croque monsieur but to use up the crescent roll dough that was the only bread like stuff in the house. My girlfriend brought the dough and has a deep love of ham-based foods, so even though we had ham steaks in the fridge I went out to get deli ham because it fits this recipe much better.

This is the form factor that came to mind. I will say now that puff pastry would have suited this better, but working with what we had in the house the crescent roll dough worked. In addition to that I wanted to jazz up the cheese a bit (and we didn’t have the gruyere that everyone seems to want in a croque monsieur anyway) so I stole the spice blend from this Alton Brown recipe for grilled cheese.

I don’t have exact measurements for anything but this is what ended up happening:

  1. 50/50 mix of finely grated swiss and un-smoked gouda tossed generously with that spice mixture
  2. thinly sliced deli black forest ham sliced even more into strips
  3. a single container of crescent roll dough (8 rolls)
  4. the bechamel as discribed in the Babbish recipe up top

Lay out the crescent roll triangles, spread with bechamel. Layer with sliced ham. Absolutely douse them in cheese, you should not be able to see them because your surface is so uniformly coated in cheese (this is fine). Spray down some muffin tins. Roll the triangles up and place them in the tins. Bake at about 375F until the tops are getting brown and you are worried they are getting done too fast on top. Take them out of the oven, free them up with a knife so they aren’t sticking at all. Remove the two stragglers in the otherwise empty muffin tin to a cutting board temporarily. Invert that muffin tin on top of the other six. Flip the whole thing. Place two stragglers back in the now available tin, but upside down. Return rolls to oven until toasty on bottoms (new tops). Dollop with remaining bechamel (it should be kept warm during this process, it will not have time to reheat in the next step). Coat liberally with remaining cheese mixture. Return to oven and broil the shit out of them. Remove when you are slightly worried about getting the cheese off the muffin tins. Quickly use a spatula to remove them from the tins immediately because that cheese will solidify there and you will never get them out at that point. Eat.

Fixes for next time:

  1. Keep the sauce warm while the rolls are in the oven
  2. Use less sweet dough (like the puff pastry)
  3. Maybe reduce cooking temperature or cover with foil to stop browning
  4. Cook a number of rolls equal to exactly half of your available muffin tin space, inverting halfway through may have been a good thing for browning and even cooking
  5. Do whatever you want with the spices in the cheese and sauce
  6. Honestly do whatever you want with the cheese mix and meat/filling entirely