Archive for the Megaman Category

Summer update

Posted in homebrew, Megaman, NES2PCE, translations on July 6, 2014 by pcedev

Lost my place (last minute notice, didn’t have a contract); everything got moved to storage or thrown away (tower is in storage). I’m also away/out of town for the summer, so things are slow and limited on the PCE side (this is the time of year I make my money). I have my laptop to do some dev stuff on, but no translations or megaman hacking stuffs. My classes started late August, so when things get settled down – I can started working on stuff again. I swear to whoever – life is never a dull moment for long.. ugh.

I want to keep my PCE coding skills sharp and in practice, so I’m gonna do a tiny little project with CC65 for PCE. A one level/simple game or something. Mostly to get a CC65 setup for PCE, etc.

Posted in hacks, Megaman, NES2PCE on February 23, 2014 by pcedev

I’ve been thinking about the map format for Megaman. I really don’t like the idea of 32×32 with a huge LUT to draw from. Not because it’s hard to write the decoder, quite the opposite. But more of because writing the encoder means writing a whole new app.

So that got me thinking. 8×8 is out of the question for all room data, but 16×16 is a good compromise. 16×16 with WORD entries (4bits for subpalette and 9bits for tile). The ’tile’ could simply just be the base number<<4 and each tile following tile is +1 (for whatever layout I want). Typical stuffs for meta tiles, but 16×16 format is small enough; only 512bytes per 256×256 pixel res room. It also makes use of existing tilemap tools. And, if I ~really~ need more precision than that, I can reserve anything between the 10th bit to indicate a look up value, rather than an actual straight block reference. That way, if I really need 8×8 with each subpalette reference for small specific parts of the room map, I’ll have it. Done and done.

Been busy this weekend though (I’m replacing the cylinder head of my 1993 4.0L 4×4 jeep. Old head cracked, so I bought a new one. I’m reassembling the engine, slowly). Gonna try to do some test runs on new BG stuff tonight though.

Posted in Megaman, NES2PCE, Uncategorized on February 20, 2014 by pcedev

Working on changing the tilemap format, for the room/screens. Originally, the game uses a 32×32 meta tile format. IIRC, it’s one byte per 32×32 block. So that’s 64 bytes per 256×256 pixel screen. That’s pretty small. A 256×256 pixel screen with 8×8 tiles (and subpalette per tile) is 2048 bytes. Quite a bit bigger. Cutman’s level has 22 rooms. If I made each room unique, than that’s 45k just for that level. Not a big deal if this was strictly just a hucard/rom project, but that’s pushing it a bit for the CD project. I’ve already decided that I’m gonna break the levels into ‘loads’, and certain things can be loaded directly into vram from the CD track at the start of a level, but even then – I still need to keep the space requirements down.

I figured that I can build upon the 32×32 block system. I could double the map entry with a parallel map, so that each block is two bytes instead of 1 byte. That gives me 65,536 blocks; too much for a look up table. But I don’t need to use all the bits. I figured, with 16k, I can get about ~630 32×32 blocks in the decode table. That would decode the 32×32 block into 16 8×8 tiles. Each tile would be 9bit addressing (access up to 512 tiles in vram), and each tile would have access to its own unique subpalette. I’d bitpack everything to cram it into 16k table. I think the original game uses something like 64 32×32 blocks? This would be a big improvement, in just that alone. I could even use the unused bits for collision stuffs. For the backend PPU emulation, I’ll add a special ‘reg’ that the code reads from – to get the additional subpalette and MSbit. It’ll clear it after reading from it, too.

Posted in Megaman, NES2PCE on February 19, 2014 by pcedev

Power meter replacement design/code is finished. I’m pretty happy with the way it works. In regular weapon mode, the whole meter width is the health. In weapon mode, the meter is divided by half – one side for health and one side for weapon energy (well, one more pixel for health width than weapon energy). Next will be to do a version for the boss as well. I still need to make some ‘weapon’ icons for below/base of MM power meter, since I’m keeping Megaman blue regardless of the weapon picked. Though I might have a setting in the options to change this (retro look). It’s not that it’s more difficult, it’s just that I like the original megaman colors for the more modern looking sprite.

I also got rid of the score at the top, as well as the sprite ‘flicker’ routine. The routine is automatic, and cycles/staggers the sprite order depending on even/odd frames. This is primarily to reduce blank out (induce flicker) for the NES sprite line width problems. Since I’ve upgraded the sprites to new sizes and less of them, this isn’t an issue anymore. Plus, it’ll make sprite layers for parallax less of an issue to deal with (I want specific sprite priorities).

Posted in Megaman on February 13, 2014 by pcedev

Working on the new Power meter for Megaman. The original game uses sprites with pre-rendered sections. I’m completely redoing the meter graphics. It’ll now be slimmer, use much-much less sprites (three sprites instead of 8 sprites) and will use pixel drawing to vram. I’ve set it up in a brilliant way, that I can exploit both the planar format of the sprites and the LSB/MSB latch of the VDC write port. Planes 0 and 2 are used for meter graphics (has checkered board see through parts too), and planes 1/3 for the meter levels. Plane 1 is for health, plane 3 is for the weapon energy of the current selected weapon. If no weapon, the whole bar represents health.

I like the look of the megaman X series bar, so it’s tailored after that but skinnier. There is a total of 28 levels for each bar, and one bar is 3 pixels wide and the weapon one is 2 pixels wide. With some optimized code, I can draw both bars in 440 cycles; just under one scanline. Of course, I’m using some st1/st2 opcodes to embed the writes – so a little bit of bloat (less than 1k) – but it’s worth the big speed increase. Speed is critical because this happens during vblank (I don’t want to move it outside of vblank if I don’t have too. ‘Break little as possible’ is the best approach to hacking someone else’s game engine). I estimate the cost will be less than the original code took to build out these two meters, as well as the saving of having to convert less sprites. I’ll be removing the score sprites as well. No need to display them during the game (boss/end of game/continue is good enough). That’ll save some cycles as well. I’ll do the same for the boss meter.

There will be an icon right below the meter, that will show the current weapon selected. Fancy, fancy.

Posted in hacks, Megaman, NES2PCE with tags , , , , , , , , , on February 12, 2014 by pcedev

Show off new sprites for Cutman’s level:

Can’t really see much, but each sprite has its own subpalette. I think I reserved something like 10 per room, for enemies. Most sprites use all 15 colors, though it doesn’t really show. In comparison, MM Wily Wars uses 7/8 colors per enemy sprite. Fragmare’s working on tweaking the MM sprites.

So nothing fancy to show off, other than it’s up and working (room sprite/pal load routine).

Posted in Audio, hacks, Megaman, NES2PCE, retro with tags , , , , , , , , , , , , , , , , on February 8, 2014 by pcedev

More Megaman 1 stuff.

Maaaannnn. Talk about a pain. Principle and execution; two very different things. What should have been a very easy upgrade to the load room graphics hook/code, ended up being a nightmare. It broke a lot of stuff that I already had in place. So, some other stuff got changed/upgraded (mostly OAM->SAT conversion). But it’s done and working. Finally. All the enemy sprites for Cutman stage are up and running. All converted to native PCE format. I worked out how to handle the palettes for those enemies too. You know, you don’t realize how much 16 subpalettes just for sprites – is incredibly large for that era. It makes things sooo much easier, and the fact that I still have another set of 16 just for the BG graphics – this is gonna be easy. Wily Wars on the MD/Gen, uses 7+1 colors for sprites. That how the extend the 4 subpalettes to be more than 4. 8 colors for a sprite, isn’t so bad for Megaman style design. BUT WE ARE GOING THE FULL 15 COLORS PER SPRITE! Yeah, baby. I purposely added colors to the sprites, even if you can see them – lol. I wanna have a few screens in the game, surpass the 100+ color count mark.

Anyway, things are coming along. I’m working on the ‘start stage sprite’ load routine, which is different than the load-room-sprites (not sure why). I’ll have something to show off when that’s finished.

Posted in hacks, Megaman, NES2PCE, retro on February 4, 2014 by pcedev

No title to the post. Megaman stuffs…

Anyway, I got all the sprites for Cutman’s stage done. That is to say, all the new sprite sheets are in order. Hacking the room loading routine is next. I’ve already traced through it more times than I care to admit. I might be pretty fluent in 65x, but that doesn’t reading/understanding someone else’ code is easy.

The game makes it easy though. The game breaks down a sprite/palette load for a given room, over about 40 frames. That slow pan up or down, left or right, it’s updating vram sprites (which is why all sprites except megaman/score/powermeter are turned off). The game divides a level into 16k banks. There’s a variable for ‘currentlevel’; the game grabs this, maps it, uses the ‘current room’ as an index, and reads from a table (this table is in every level and in the same spot, just different values corresponding to the level), then maps in the tile bank and transfers to vram. All my hook needs to do, is get ‘currentlevel’ and ‘currentroom’, and the rest is just loading my own graphics to vram.

That part is fairly easy. The problem I’m running into now, is that there’s no room left in the ’emulation’ bank. There is where all the apu/ppu/mapper emulation code is. Since this is a fixed bank, this is also where my hack code and tables are. As of yesterday, I had to move all the enemy sprite sheets (object information, not the cell data) to another bank. Even with that, I’m left with 500bytes free in that 8k bank. So now I’m tasked with creating a second ‘library’ bank for code, and move non essential code to there (APU reg write code, PPU reg write code). I’m taking a note from the NES games, and duplicating the TIMER and VDC/NMI code into the second lib bank at the same place. That way when I swap in the far bank, the interrupt code still behaves as normal.

Eventually, I’ll won’t be needing the APU and PPU emulation code anymore. Actually, I soon plan to convert the sound FX in the game to a different format. Something along the lines of VGM format. That is to say, the sound FX will be streaming port writes at 1/60 tick (anything higher seems wasteful). It takes up very little room, compresses easily (and light on cpu resource), and allows me to make new sound FX outside of any music/sound engine design (and I don’t have to worry about a new PCE sound engine having legacy support too). Though OAM emulation will probably be the first to go. Once all the sprites have been converted over, I won’t need NES OAM (SAT) emulation anymore. That’ll free up a little bit of cpu resource. The tilemap code will probably be one of the last to go, leaving the game completely native PCE in execution (albeit limited to game logic).

But back to the ‘currentlevel’ and ‘currentgame’ variables. Knowing these two, I can create new stages. I just need to hook the bank changing routine for the higher level #’s. I want to add in two more Robot Master levels. Not MM: Powered Up levels, but something unique to this PCE version. That also means two new items or weapons. I figured I’ll probably make them ‘item-ish’ rather than weapons, as that would be harder to balance the game with new weapons. Or maybe new ‘moves’, like slide and charge power shot (you won’t need to ‘equip’ them). I do want to make a weapon/function that’s equivalent to ‘enery tanks’ in later MM games. I figured something along the lines of; convert weapon energy to health. And depending on the difficulty of the game setting, will be the ratio of transfer from energy to health.


Posted in hacks, Megaman, NES2PCE on February 2, 2014 by pcedev

The replacement hook for new sprites is working great, but the game loads new palettes and enemy sprites – per room load (small breaks in the level). Took me a bit, but I figured it out and how to hook it. This is important, because my hook needs to load the alt sprite graphics and palettes for ‘rooms’. Things are coming along nicely for the sprite upgrades. Much faster than I had originally thought.

I can also use this hook, to identify when a new room is loaded, and thus call my special foreground/background effects hook based on this. Since I’m reducing sprites to large than 8×8 cell segments, I’ll have more SAT room for these ‘effects’. And since the sprites are not made of less segments, I’ll have a much-much better sprite-pixel-scanline setup for this as well. Annnddd, the new graphics actually take up less vram than the emulated NES ones – so more vram for said ‘effect’ sprites.

This is really cool

Posted in Megaman, Uncategorized on January 31, 2014 by pcedev

I’d totally buy one of those cards and slap a sticker on it. I’m jealous 😛