(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
03-29-24 12:53 AM
0 users currently in SMW Hacking.
Acmlm's Board - I3 Archive - SMW Hacking - CPU usage meter! New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
BMF54123
WARNING: MOOD LEVEL CRITICAL








Since: 11-18-05
From: MOOGLES

Last post: 6248 days
Last view: 6248 days
Posted on 10-17-06 08:19 AM Link | Quote


cpumeter.ips

(WARNING: open your ROM and make sure that $819C-$81BF is empty (all FFs) before applying this patch!)

What this patch does is add some visual indicators of how many CPU cycles your hack is using per frame, which quickly tells you how many sprites and/or custom blocks you can have in an area before slowdown will occur. Similar systems have been used in many commercial games during development, for the same purpose (ex: StarTropics, Gunstar Heroes beta, Super Mario 64).

By default, the patch will show a yellow star and dim the screen at the point where the CPU enters its main wait loop (when there's nothing left to do before the frame is drawn). The lower the line, the more work the CPU has done in that particular frame. If the line hits the bottom of the screen, it means there is no more time to process the current frame, and the previous frame is displayed again (which causes slowdown). If slowdown is severe enough, the star may wrap back to the top of the screen and the brightness may flicker. This is particularly noticeable during the palette fade after you pass the goal point (it's a really long, slow process!).

This patch is easy to disable, and can be permanently left in your ROM with no ill effects (unless some future hack overwrites the space it occupies). To disable it, simply change $81A0 to 1E. If you just want to eliminate the screen-dimming effect, change the same address to 05 instead.

Enjoy!


(edited by BMF54123 on 10-17-06 07:20 AM)
Kailieann



 





Since: 11-18-05

Last post: 6248 days
Last view: 6248 days
Posted on 10-17-06 08:27 AM Link | Quote
Snazzy. I can definately see this being useful.
rubixcuber

Mole








Since: 09-08-06
From: St. Louis, MO

Last post: 6357 days
Last view: 6357 days
Posted on 10-17-06 10:10 AM Link | Quote
Ooh, nifty! I haven't had much problem with slowdown, but this will be fun to mess with. I was about to ask what method you used to dim the screen, but I'll just disassemble it. I like figuring things out for myself.
Kiwisauce

Red Goomba








Since: 09-23-06

Last post: 6251 days
Last view: 6250 days
Posted on 10-17-06 10:47 AM Link | Quote
Wow! Thanks! This is sure to come in handy.
3.14159265358979323846

Red Paragoomba








Since: 05-30-06
From: China

Last post: 6257 days
Last view: 6258 days
Posted on 10-17-06 10:50 AM Link | Quote
It's an interesing yet useful patch. Everybody(especially SSM and me)will find this very useful. Good work, BMF

*download as soon as I see this thread*


(edited by 3.14159265358979323846 on 10-17-06 09:51 AM)
Smallhacker

Super Koopa
I AM A Group Of Officially Frustrated Younglings, G.O.O.F.Y. MEMBER








Since: 11-17-05
From: Söderhamn, Sweden

Last post: 6250 days
Last view: 6248 days
Skype
Posted on 10-17-06 12:00 PM Link | Quote
wtf

















...brilliant!
Raccoon Sam

Boomerang Brother
Custom Title








Since: 11-20-05
From: Correct

Last post: 6248 days
Last view: 6248 days
Posted on 10-17-06 01:43 PM Link | Quote
Hey! The Super Metroid has a similiar option in the debug mode!
I always wondered what the rising and falling dark thing was. Thanks.
Sukasa

Birdo
Not quite as active as before.
Xkeeper supporter
Xk > ||bass
I IP Banned myself! Twice!








Since: 11-17-05
From: Somewhere over there

Last post: 6249 days
Last view: 6248 days
Posted on 10-17-06 09:46 PM Link | Quote
Whoa... I am so downloading that when I get home
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6248 days
Last view: 6248 days
Posted on 10-19-06 05:42 AM Link | Quote
I haven't sat down and disassembled this patch yet, but simply want to know whether this restores existing code in the ROM, or adds in the functionality itself. It seems quite a lot to accomplish in just $24 bytes from scratch.
BMF54123
WARNING: MOOD LEVEL CRITICAL








Since: 11-18-05
From: MOOGLES

Last post: 6248 days
Last view: 6248 days
Posted on 10-19-06 07:03 AM Link | Quote
It really wasn't that complicated.

My routine hooks a JSR right before the idle loop. All it does is write #$0B to the brightness register and set up a single sprite in OAM. The sprite's attributes are fixed, aside from the vertical position, which is obtained by reading the V-counter from $213D. Although the sprite has a delay of 1 frame (due to the way OAM is handled), the brightness change takes effect immediately.

All in all, the code performs two reads and five writes, which fits nicely into 36 bytes.

JSR $9322 ; "master index" handler
BRA #$00 ; used to disable/enable code
LDA #$0B
STA $2100 ; brightness register
LDA $2137 ; latch V-counter
LDA $213D ; read V-counter (lower 8 bits)
STA $02ED ; sprite Y
LDA #$EF ; star graphic
STA $02EE
LDA #$34 ; palette, priority
STA $02EF
STZ $02EC ; sprite X
STZ $045B ; sprite size
RTS



(edited by BMF54123 on 10-19-06 06:05 AM)
MathOnNapkins

1100

In SPC700 HELL


 





Since: 11-18-05

Last post: 6248 days
Last view: 6248 days
Posted on 10-19-06 07:36 AM Link | Quote
Ah... figured it was something like that. I was only weirded out b/c I thought you included your own data for the star's graphical data, etc. But since it used existing graphical data I'm not all that surprised. Trying to think if this would be easy to put into LTTP... probably. I've got enough room.
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - SMW Hacking - CPU usage meter! |


ABII

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

Page rendered in 0.016 seconds; used 399.52 kB (max 492.84 kB)