Acidmods
AcidMods Resources ----- ( These are helpful tools for modding ) => Open Source Code & AcidMods Free Code => Topic started by: Layman on February 29, 2012, 11:42:30 AM
-
i have been looking into how to write code in c and started making a few of my own but i just carnt understand this bit of hazers code? ive looked and looked at other peoples to get to understand how to but could some one help? if i wanted to add one more mode would i have to alter this? thanks for your help, any help is welcome, i appreciate every little bit of help here is the part of the code im stuck with and carnt understand;
NextState
movlw 0x40
addwf STATE, f ;change firerate state
InitState ;begin test for
btfsc STATE, 7 ;state 1 or 2
goto State3
btfsc STATE, 6
goto State2
-
Hazer actually wrote a walkthrough of each piece of his code explaining what it does, you can find it at http://forums.xbox-scene.com/index.php?showtopic=679378 (http://forums.xbox-scene.com/index.php?showtopic=679378). Essentially, this section of code is testing the bits of the state variable that are used to determine what state the chip is in.
-
ok, i looked over hazers explanation, i want to add two more modes into the program is this possible, because hazer wrote " By adding the value of 0x40 to the register STATER, I can cycle through 4 states. 0x40 in binary is the same as b’0100 0000’. By adding 0x40 I switch between the following values in binary:
b’00000000’; b’01000000’; b’10000000’; b’1100000’
So I create a 4 mode STATER and use bits 6 and 7 in the register to test which state I am in" so i was thinking if i halved the 0x40 and made it twenty and did the same to bits 6 and 7 could i add more modes or am i thinking too hard? thanks
EDIT: THANK YOU FOR YOUR ALL HELP, but i have CRACKED it lol i found a way to get 8 modes on all hazers codes, thank you hazer for letting me have your codes, its very simple when thought about if you want to know post here and i will show you :w00t:
[gmod]Do Not Double Post click modify to edit post.[/gmod]