Corrupt File?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: Corrupt File?

Post by unregistered »

So you've quickly reached a point in your game where you want to start the trace log... Then press the pause button on your keyboard. With the game paused press the '-' key to set your game to run at the slowest speed possible (~2 seconds per frame). Next click the 'Start Logging' button on the trace logger window. Now, the game is still paused so your file isn't growing at all... you have ample time to open the hex editor (click Debug>Hex Editor...) or click Tools>Memory Watch... to watch up to 24 decimal values.

Press the pause key again and the file will slowly build. I'm testing a direction and a being pressed together... so I hold down and then press a many times. The game is running at a rate of two seconds per frame so pressing a once will probably not be recognized. Having the hex editor or memory watch window open should allow you to view exactly when your controller bytes change. My controller bytes read 84 (or 132 decimal) once down and a are pressed together. Once you know your controller input has been recognized correctly, wait a few frames for your game to react... then click the stop logging button on the Trace Logger window to stop your file from growing.

Open the file with a text editor... windows notepad is great for these .log files. Then, in windows notepad, to find the first time down and a were pressed: click Edit>Find... and then type "A:41 X:08" and press enter. The abetudlr helps me to quickly find button presses...

A:41 X:08 finds a
A:41 X:07 finds b
A:41 X:06 finds select
A:41 X:05 finds start
A:41 X:04 finds up
A:41 X:03 finds down
A:41 X:02 finds left
A:41 X:01 finds right being pressed :)

(Holding down and then pressing a many times makes 100% chance that the first instance of "A:41 X:08" found will be at a time when both a and down were pressed. :) Well, maybe not a 100% chance cause you could have something like

Code: Select all

lda #$41
ldx #$08
in the very beginning... but once you are certain your controller routine works and you have memorized the address of your "look at controller" routine, there is 100% chance that the first stop at the address you memorized will be a time when both [/color]a and down are pressed :) )

edit. addition
colored buttons
edit2
Post Reply