Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
Acmlm's Board - I2 Archive - - Posts by Dish
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
User Post
Dish

Spiny
Level: 38

Posts: 321/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-01-05 08:57 PM, in C/C++ is easier then VB Link
interdpth:

That's not string comparison, that's number comparison =P

I mean if you have a string that says "house" and other string that says "shoe" --- if you'd want to see if they both say the same thing, you'd use strcmp().

PS - this bork bork bork thing really sucks -- some lame april fools joke or something?


(edited by Disch on 04-01-05 10:58 AM)
Dish

Spiny
Level: 38

Posts: 322/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-02-05 12:57 PM, in C/C++ is easier then VB Link

Str1 = Str1 + Str2.


strcat( Str1, Str2 );


Const x as String = "Text omfg".


const char* str = "Text omfg";


Really simple stuff. I still don't see what the fuss is about.
Dish

Spiny
Level: 38

Posts: 323/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-05-05 07:10 AM, in GBS2GSF conversions Link
Originally posted by Xkeeper

Pros of GBS->GSF conversion
1. Some sound enhanchments, like interpolation or whatever



This is a false pro -- it has nothing to do with GSF conversions. It has to do with the lack of [quality] GBS players. A GBS player could have just as good or better quality sound as a GSF player -- the format with which hold the music data doesn't dictate it one way or the other.
Dish

Spiny
Level: 38

Posts: 324/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-06-05 06:28 AM, in How do I capitolise the first character of a string in C++? Link
Instead of -= 0x20 -- I'd just use character constants:

MyString[0] += 'A' - 'a';

so you don't have to remember an exact value (this might also work if you change charsets too -- but don't take my word on that one).

But yeah -- either way you get the result.
Dish

Spiny
Level: 38

Posts: 325/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-07-05 02:57 AM, in How do I capitolise the first character of a string in C++? Link
oh yeah -- I forgot about those XD

But yeah -- since C++ includes all of C, that'd work in C++ too.
Dish

Spiny
Level: 38

Posts: 326/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-07-05 03:11 AM, in MegaFLE X release Link
I'd like it if you can say "Mega Flex" -- it sounds much nicer than "Mega Flea" or "Mega Flee" or "Mega Eff Ell Eee". But I'm against the whole "Add an X to make it cool" trend. So unless the X actually stands for something that starts with an X...

Anyway -- kudos for ditching DOS -- even if it means using the wretch that is VB. It's looking good so far. Keep up the good work.
Dish

Spiny
Level: 38

Posts: 327/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-07-05 10:38 AM, in How do I capitolise the first character of a string in C++? Link
HH's way was a shorter version of mine. Or rather I should say mine was a longer method of his, since he brought it up first.

To clarify the logic behind mine (even though you already pretty much have it solved -- I still feel compelled to explain mine so that the concept is understood):

A character in single quotes (such as 'A') is a character constant. It's replaced with the numerical value representing that character at compiletime. To illustrate this with pseudo-code (assuming ASCII char set):


char ch;

ch = 'A'; //this line has the same result as the line below
ch = 0x41;

if( 'A' == 0x41 )
{
//this condition is true, code here would execute
}

if( 'a' == 0x61 )
{
//also true
}

if( ('a' - 'A') == 0x20 )
{
//also true
}


My code essentially does the exact same thing as HH's, it just doesn't make you remember the exact numerical difference between upper and lowercase letters in the charset.

MyString[0] += 'A' - 'a';

... is the same as ...

MyString[0] += 0x41 - 0x61;

... is the same as ...

MyString[0] += -0x20;

... is the same as ...

MyString[0] -= 0x20;


The only difference is I dodged the use of a numerical constant (0x20) and used easier-to-remember character constants ('A' , 'a') with some simple logic math (add the target character, subtract the current character -- or add the difference between the two).

It's the same principle as converting a numerical charater ("0 1 2 3 4 5 6 7 8 9") to a numerical value.


char ch = '6';

int num;

num = ch - '0'; //this will yield 6
num = ch - 0x30; // this will also yield 6



They both do the same thing -- but the former doesn't require you to remember an arbitrary value.
Dish

Spiny
Level: 38

Posts: 328/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-07-05 09:07 PM, in ASM Hacking Question - Controller Presses Link
FF1's method is actually roundabout and wasteful (AND + CMP is silly -- a simple LSR would be much easier and more effective). Something like this makes more sense to me (probably is in more games):



LDX #$01
STX $4016
DEX
STX $4016 ; strobe joypad

LDX #$08
loop:

LDA $4016 ; get button state (p1)
LSR A ; move low bit to carry flag
ROR joy_data_p1 ; roll carry flag into memory

LDA $4017 ;get button state (p2)
LSR A ; move low bit to C flag
ROR joy_data_p2 ; roll C into mem

DEX
BNE loop ;loop 8 times



Originally posted by DahrkDaiz
As far as a I know, NES only has the 2 registers which you must strobe. Though I rememeber reading something about a "half" strobe, but I never did read any more information on what that exactly did or the results of doing it.


I heard from somewhere (can't remember where -- and I doubt it's accurate) that reading $4016/7 on a half strobe (writing 1 but not 0) will access the Famicom expansion port rather than joypad data. Although I find that to be rather unlikely. I'd imagine reading either reg on an incomplete strobe would just give you garbage joypad data.

Other terminology I've seen thrown around is writing 1 is called "resetting the strobe", and writing 0 is called "clearing the strobe". To me this would imply that writing 1 make it so the next button read will be the A button. And that writing 0 would clear out current joy data and fetch new data from the gamepad. So I'd guess that if you did something like the following:



LDX #$01

STX $4016
LDA $4016
STX $4016
LDA $4016



I'd think you'd just get the status of the A button over and over every time you read -- and it would never change (it would never refresh with whatever's currently being pressed, since you're never clearing the strobe). This is all a complete guess though -- I really don't know.


edit:

but, erm, yeah. As Para and others have mentioned -- you shouldnt' be doing this. If the game is already strobing and fetching joypad data (which it IS) you shouldn't - since that is unnecessary work and could even cause problems. DD already posted those offsets to where key state is stored in RAM.


(edited by Disch on 04-07-05 04:10 AM)
Dish

Spiny
Level: 38

Posts: 329/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-08-05 06:32 AM, in ASM Hacking Question - Controller Presses Link
[edit]

My previous theory seems to have been wrong -- I'm looking at the area you're talking about now it does only seem to be called once per frame.

[edit again]

your branch is screwey -- that might be part of your problem

BEQ $00 <-- is a null branch. It will not branch anywhere regardless of the state of the Z flag (although it will burn extra cycles depending on the Z flag). If you're wanting to skip the following instruction, you'd want:

BEQ $03 (skip 3 bytes -- the following INC is 3 bytes long)

[edit a 3rd time]

I put in your same code at the start of the NOP chunks I think you were talking about ($3CE8E in the (PRG 0) rom) -- with the corrected BEQ command. And it seems to *kind of* be working.

It seems like that NOP chunk is only run when the game is paused -- so it will only add lives when you press select while the game is paused. That's how it worked for me. One life per press -- but the life count in the status bar didn't change until you unpause.


(edited by Disch on 04-07-05 01:36 PM)
(edited by Disch on 04-07-05 01:39 PM)
(edited by Disch on 04-07-05 01:45 PM)
Dish

Spiny
Level: 38

Posts: 330/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-09-05 04:55 AM, in ASM Hacking Question - Controller Presses Link
Originally posted by eb_h4x0r
Is it possible to ASM hack other games for the controller thing?


Umm... what are you talking about?
Dish

Spiny
Level: 38

Posts: 331/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-10-05 04:18 AM, in is there a super mario bro 2 gfx inserter Link
There are many. They're called "Tile Editors"

Look for:

Tile Layer Pro
YY-Chr
or
Tile Molester
Dish

Spiny
Level: 38

Posts: 332/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-10-05 11:30 PM, in Music ASM Hack Question Link
Originally posted by ||bass
If I threw some code together to take some spc data and just dump it straight into the SPC700 chip, would that actually work?


I'm no expert on the subject of SPCs, but I'd imagine that'd work just fine -- and in fact, that's exactly what most games probably do. AFAIK the SPC has its own seperate processor, so if you feed it an executable and get it up and running, the music will play itself.
Dish

Spiny
Level: 38

Posts: 333/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-10-05 11:34 PM, in ASM Hacking Question - Controller Presses Link
Originally posted by Rockman
I need help with something.

BEQ means Branch on Result Zero.

Does this mean to branch to that location if the result is false?



Technically... all it means is "Branch if the Z flag is set". How the Z flag is set depends on the previous instruction(s). Typically, the Z flag is set when the last instruction resulted in an output of Zero (and is cleared otherwise). For example:



LDA #$00 ; this will set the Z flag
LDA #$01 ; this will clear it (nonzero)

SEC
SBC #$01 ; This will subtract 1 from A, making it zero -- so the Z flag will be set

LDA #$0E
CMP #$0E ; CMP internally does subtraction to set flags. 0E - 0E = 0, so Z will be set
CMP #$0D ; However, 0E - 0D = 1, so Z will be clear here




BNE is the inverse -- all it means is "Branch if Z flag is clear".



edit:

To further clarify your bolded section:

$9538:A5 18 LDA $18 = #$00
$953A:29 02 AND #$02
$953C:F0 05 BEQ $9543


That BEQ will branch... since the previous instruction (AND) will produce a result of zero, setting the Z flag. If $18 had the B button pressed ($02), the AND would produce a nonzero result, clearing the Z flag -- and the branch would not occur.


(edited by Disch on 04-10-05 06:34 AM)
(edited by Disch on 04-10-05 06:40 AM)
Dish

Spiny
Level: 38

Posts: 334/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-11-05 06:46 AM, in I need a resource editor! Link
I'm sure you already clarified this -- but why aren't you just using VS? it has a great resource editor.
Dish

Spiny
Level: 38

Posts: 335/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-12-05 07:54 AM, in Bring fresh blood in to liven the forums! Link
There are several new posts daily in this forum.

Another poll just for the sake of having using the poll feature?
Dish

Spiny
Level: 38

Posts: 336/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-12-05 09:35 PM, in Disable emulator savestates in a hack? Link
Originally posted by Geiger
if you think about it for a moment, you'll notice that savestates restore all the internal ram, but they dont restore the sram on the cart.


If they don't, they certainly should. They would have to on the NES anyway -- so many games use cartridge RAM for normal game stuff. Savestates are supposed to be a complete snapshot of the game's state -- if it only snapshots half of it what's the point?

But anyway, I'd say it's up the user whether or not they want to abuse savestates. Putting in a feature like this would completely ruin the game for people like me that use savestates legitimately (save to quit when I feel like and pick back up whenever I get back in the mood without having to trek back to a save point)


(edited by Disch on 04-12-05 04:35 AM)
Dish

Spiny
Level: 38

Posts: 337/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-13-05 04:41 AM, in Mapper Information Link
I just realized my MMC3 example code was a little inefficient. This code would have a smaller size:



swap_routine:

ASL A ; double page number (16k index becomes 8k index)
TAX ; stuff in X

LDY #$06 ;this uses Y, alternatively you could use A here
STY $8000
STX $8001 ; for some reason I forgot STX existed when I wrote that other code

INX
INY ; if using A, you'll need to do LDA #$07 instead
STY $8000
STX $8001

RTS



That code does the same thing as the above listed code but uses 19 bytes (20 if you use A instead of Y). The old code used 23 bytes.
Dish

Spiny
Level: 38

Posts: 338/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-13-05 10:36 PM, in Mapper Information Link
Originally posted by dan
it seems to be that the CHR bank number must be a multiple of 2. This didn't seem to be covered in Firebug's documents.


Kind of.

MMC3 doesn't have eight 1k CHR banks... instead it has four 1k banks, and two 2k banks. The oddity is... when swapping in the 2k banks you give a 1k bank number (or 2x the 2k bank number) -- and the low bit of the written value is ignored.

So specifying $04 for the 2k bank at $0000, would have the same as specifying $04 for the 1k bank at $0000 and $05 for the 1k bank at $0400. Specifying $05 for the 2k bank would have the exact same effect as specifying $04 (low bit unused on 2k page selection).

This behavior exists on many/most/all mappers which have multiple bank sizes. Only one I can think of which has variable bank sizes and doesn't exhibit this behavior is CHR swapping on MMC5 (although PRG swapping does exhibit it).

Also: note that you cannot 'trick' the MMC3 to try to get eight 1k banks. A lot of people see the 'XOR CHR address' bit in the $8000 reg and think they can use it to get a higher swapping res -- but MMC3 does not work that way. Same for the PRG swapping mode bit in $8000 -- you can only swap $8000 or $C000 -- you cannot manipulate $8000.6 to swap both... it won't work.

EDIT:

As for what DD was talking about -- yes, when expanding a ROM, you should keep all PRG/CHR sizes a nice, even, power-of-two value (64k, 128k, 256k, 512k, 1M). I'm unsure of MMC3's maximum... according to Kevtris' doc the largest MMC3 boards (TK-ROM, TS-ROM) are 512k PRG, 256k CHR -- so those are likely your limit.

And yeah... I think the max for MMC5 is 1MB of each (along with a whopping 64k of WRAM!).


(edited by Disch on 04-13-05 05:45 AM)
Dish

Spiny
Level: 38

Posts: 339/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-14-05 03:54 AM, in Mapper Information Link
This would only be legit on mappers which have WRAM/SRAM. Mapper 2 (to my knowledge) does not -- which is one reason why the FF2 translation hack which changes mappers to mapper 2 is taboo.

Emulators probably don't really care -- and probably put WRAM at $6000-$7FFF regardless (for example my emu puts RAM there for pretty much every mapper -- except mapper 0)
Dish

Spiny
Level: 38

Posts: 340/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 04-15-05 10:05 PM, in A Link to the Past - Footwear & Swords Link
Originally posted by Euclid
Just when did Gideon start hacking things other than text


Translating is not just hacking text. It often involves quite a bit more.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Acmlm's Board - I2 Archive - - Posts by Dish


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.017 seconds.