(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-04-24 06:19 PM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - I need a little ASM related help please. New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
Jigglysaint

Octoballoon








Since: 11-19-05

Last post: 6304 days
Last view: 6289 days
Posted on 08-05-06 10:19 PM Link | Quote
Okay, I am working on a hack for Blaster Master that when finished, will insert 8 extra upgrades into the game. One thing I allready did, was convert the item pickup for multiwarhead missiles, in the tank stage, to an item that sets a bit depending on which stage you are in. I also want to add the upgrade music to give it an upgrade feel(that reminds me, I should disable the time limit on it too).

Now, to get this to work, I've decided I need a countdown loop that lasts the duration of the song, so when it's over, the regular stage music can play again. The problem is the countdown is instantanious, and nowhere near enough time for the music to play. What I need to know, is how I can make a countdown loop, and control it's speed so I can achieve it's desired effect.
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6285 days
Last view: 6285 days
Posted on 08-05-06 10:49 PM Link | Quote
Use a frame counter; increment some number every VBlank. The game might already have one somewhere.
Jigglysaint

Octoballoon








Since: 11-19-05

Last post: 6304 days
Last view: 6289 days
Posted on 08-05-06 10:53 PM Link | Quote
So I can steal an existing routine from somewhere? If I can't find one, how would I go about making one?
DarkPhoenix

Red Goomba


 





Since: 12-27-05

Last post: 6289 days
Last view: 6289 days
Posted on 08-05-06 10:55 PM Link | Quote
I'm not too familiar with the NES, but if there aren't any registers to help you with timers, one rather inelegant, hackish way would be to throw in an empty loop to waste away a few clock cycles. Another way (that would be more accurate, but would take a little more invention) would be to count frames.

Edit: HH beat me to the punch on that one. - You could check a SMB game for routines that control the timer or invincibility. Assuming the NES is like the SNES, there's probably a place somewhere in zero page with a frame count.


(edited by DarkPhoenix on 08-05-06 09:59 PM)
Jigglysaint

Octoballoon








Since: 11-19-05

Last post: 6304 days
Last view: 6289 days
Posted on 08-05-06 11:05 PM Link | Quote
Blaster Master is a NES game, BTW. Anyway, I am not familar with how I can go about to use frame rate or empty loops to make the countdown slow down enough. The basic premise is for a countdown to occure while a song without a loop is playing, then have it branch on 00, to the next part of the code that plays the level's music again. Perhaps there is another method of timing things?
DarkPhoenix

Red Goomba


 





Since: 12-27-05

Last post: 6289 days
Last view: 6289 days
Posted on 08-05-06 11:34 PM Link | Quote
(for two byte counters)
Empty Loops:
1: Load $FF into Register 2
2: Load $FF into Register 1
3: Subtract 1 from Register 1
4: Compare Register 1 with $00
5: If Not Equal Branch to Line 3
6: Subtract 1 from Register 2
7: Compare Register 2 with $00
8: If Not Equal Branch to Line 2
Change the $FF's around until the timing seems about right - performance will vary from computer to computer and emulator to emulator, depending on how fast instructions are executed. This, however, might not vary too much on actual hardware.

Frame Counters (if there isn't one already):
Pick two unused memory locations
In the Vblank function, add 1 to the first memory location. If it rolls over (carry set), add 1 to the second location.
In the function that needs to keep track of time, just load the value in one of these locations...location 1 for individual frames, location 2 for sets of 256 frames.
Check this value, and branch appropriately.
This method shouldn't vary much, since VBlank is executed regularly.
Jigglysaint

Octoballoon








Since: 11-19-05

Last post: 6304 days
Last view: 6289 days
Posted on 08-06-06 12:19 AM Link | Quote
As it turns out, the song I was trying to time, came with a cue that allowed me to branch once the song finished playing. Even better, it comes with a pause effect making it look extra cool. Now I am working on the upgrades, so if anybody has any ideas, go right ahead and share.
MasterTenor

Double hammer


 





Since: 06-22-06
From: Ames, IA (United States)

Last post: 6295 days
Last view: 6324 days
Posted on 08-06-06 06:02 AM Link | Quote
If it's possible, some Jason (as in him, not the tank) upgrades are interesting in theory, but the more I think about that idea, the less I like it. I'm leaving these two sentences solely for the purpose of inspiring others to think of something useful here. :p

In lieu of that, you could add the ability to "catch" a wall mid-jump -- blocking corners etc. with spikes would make this neccessary: (x = spike)

_ <-- climb to the top, and proceed through my profile :p
|
|
| <-- catch the wall here
|xx
|xx <-- hover here
|xx
|xx________
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - ROM Hacking - I need a little ASM related help please. |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.016 seconds; used 381.73 kB (max 462.55 kB)