Acidmods
Console Modding------ ( Here you can talk about your favorite Consoles ) => XBOX 360 => Topic started by: bluedog on March 19, 2009, 08:29:20 PM
-
Could somebody copile this hex for me? I'm having issues installing MPLAB IDE so thanks!
; XBOX360 Rapidfire / Sleeperfire Opensource Project *
; on the PICmicro PIC12F683. This file contains the basic code *
; building blocks to build upon. *
; *
; *
; Refer to the MPASM User's Guide for additional information on *
; features of the assembler (Document DS33014). *
; *
; Refer to the respective PICmicro data sheet for additional *
; information on the instruction set. REPEAT: READ the #$%^&*&*ing *
; datasheet. Its all in there, so stop wasting others time by asking*
; questions already asnwered.If you dont understand the datasheet *
; then by all means ask the question. *
;**********************************************************************
; *
; Filename: xxx.asm *
; Date: Now *
; File Version: *
; *
; Author: Hazer *
; Company: *
; *
; *
;**********************************************************************
; *
; Files required: p12F683.inc *
; *
; *
; *
;**********************************************************************
; *
; Notes: *
; *
; *
; *
; *
;**********************************************************************
list p=12F683 ; list directive to define processor
#include <p12F683.inc> ; processor specific variable definitions
errorlevel -302 ; suppress message 302 from list file
__CONFIG _FCMEN_OFF & _IESO_OFF & _CP_OFF & _CPD_OFF & _BOD_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTOSCIO
;***** VARIABLE DEFINITIONS******************
w_temp EQU 0x70 ; variable used for context saving
status_temp EQU 0x71 ; variable used for context saving
FLAGS EQU 0x20 ;software state register
PULSER EQU 0x21 ;pulse on counter
DWELLTIMER EQU 0x22 ;pulse off counter
STATE EQU 0x23 ;programmed state
BUTTONHOLD EQU 0x24
FREQR EQU 0x25 ;frequency value
TEMP1 EQU 0x26
TEMP2 EQU 0x27
PULSEL EQU 0x28
DWELLTIMEL EQU 0x29
TEMP5 EQU 0x2A
LEDBLINK EQU 0x2B
TEMP3 EQU 0x2C
;*******bits in FLAGS register***********
PULSEONR equ 0
PULSEONL equ 1
TRIGOUT equ 2
LEDHI equ 3
STATECHANGE equ 4
;*******bits in STATE register***********
RIGHTACTIVE equ 0
LEFTACTIVE equ 1
;*********GPIO pin names*****************
LEDL equ 5
LEDR equ 4
BUTTONR equ 2
BUTTONL equ 3
TRIGGERR equ 0
TRIGGERL equ 1
;**********Speed settings: change these to change speed (0x05-0xFF)(Halo COD4 COD5 Gow2)
FIRERATE1 equ 0x2F
FIRERATE2 equ 0x12
FIRERATE3 equ 0x41
FIRERATE4 equ 0x64
;**********************************************************************
ORG 0x000 ; processor reset vector
goto main ; go to beginning of program
ORG 0x004 ; interrupt vector location
movwf w_temp ; save off current W register contents
movf STATUS,w ; move status register into W register
movwf status_temp ; save off contents of STATUS register
;Take a good note here. OSC is left at default 4MHz.
; We are running at 1MHz instruction cycle, or 1 micro second
;Timer 2 is prescaled 1:4 and compared (PR2) to 250.
; we now have hardware interupt that falls every 1ms exactly
;within limitation of osctune. Main code is inconsequential.
;PULSE and DWELL values control the signals precisely.
;All pulse logic is switched within the few microseconds to
;service the interupt routine. DO NOT modify the ISR
;with any kind of 'wait' or 'loop'. If you want to trigger
; timed events do so by setting an open FLAG bit and have the
;event done in the main loop.
btfss PIR1, TMR2IF ;timer 2 int happened
retfie
;**************** LED blinking *********************************************
;Our main routine will turn the flag bit
;LEDON on or off. The 10ms pulse is a duty cycle
;for the code to work with both CG and
;matrix controllers.
BlinkLed
btfss FLAGS, LEDHI
goto LedLow
decfsz LEDBLINK, f ;if pulse is active, count down 10ms
goto RightLED
movlw 0x0A
movwf LEDBLINK
bcf FLAGS, LEDHI ;10ms done, turn off LEDHI bit
goto RightLED
LedLow
decfsz LEDBLINK, f ;LEDLO time, count down 10ms
goto RightLED
movlw 0x0A
movwf LEDBLINK
bsf FLAGS, LEDHI ;10ms done, turn LEDHI bit on
RightLED
btfsc STATE, RIGHTACTIVE ;is RF on?
goto OutputRightLED
bsf STATUS, RP0 ;bank 1
bsf TRISIO, LEDR ;tristate LED
bcf STATUS, RP0 ;bank 0
goto LeftLED
OutputRightLED
btfsc FLAGS, LEDHI ;if ledhi true,
bsf GPIO, LEDR ;turn output hi
btfss FLAGS, LEDHI ;if ledhi flase,
bcf GPIO, LEDR ;turn led output lo
bsf STATUS, RP0 ;bank 1
bcf TRISIO, LEDR ;turn output on
bcf STATUS, RP0 ;bank 0
LeftLED
btfsc STATE, LEFTACTIVE ;is RF on?
goto OutputleftLED
bsf STATUS, RP0 ;bank 1
bsf TRISIO, LEDL ;tristate LED
bcf STATUS, RP0 ;bank 0
goto RightTrigger
OutputleftLED
btfsc FLAGS, LEDHI ;if ledhi true,
bsf GPIO, LEDL ;turn output hi
btfss FLAGS, LEDHI ;if ledhi flase,
bcf GPIO, LEDL ;turn led output lo
bsf STATUS, RP0 ;bank 1
bcf TRISIO, LEDL ;turn output on
bcf STATUS, RP0 ;bank 0
;**************** Right trigger logic***************************************
RightTrigger
btfsc STATE, RIGHTACTIVE ;is RF on?
goto ActiveR
bsf STATUS, RP0 ;bank 1
bsf TRISIO, TRIGGERR ;output off
bcf STATUS, RP0 ;bank 0
goto LeftTrigger
ActiveR
btfss FLAGS, TRIGOUT ;controllertype
bcf GPIO, TRIGGERR ;determines
btfsc FLAGS, TRIGOUT ;output state
bsf GPIO, TRIGGERR
btfss FLAGS, PULSEONR ;is pulse active?
goto OffstateR
decfsz PULSER, f ;if pulse is active, count down 10ms
goto LeftTrigger
bcf FLAGS, PULSEONR ;10ms is over, clear flags and
bsf STATUS, RP0 ;bank 1
bsf TRISIO, TRIGGERR ;tristate output
bcf STATUS, RP0 ;bank 0
movf FREQR, w ;and reset pulse time.
movwf PULSER
goto LeftTrigger
OffstateR
decfsz DWELLTIMER, f ;count down dwell time to next pulse
goto LeftTrigger
bsf FLAGS, PULSEONR ;if dwell is done turn on outputs
bsf STATUS, RP0 ;bank 1
bcf TRISIO, TRIGGERR ;and reset pulse time
bcf STATUS, RP0 ;bank 0
movf FREQR, w ;from frequency value
movwf DWELLTIMER
LeftTrigger
btfsc STATE, LEFTACTIVE ;is RF on?
goto ActiveL
bsf STATUS, RP0 ;bank 1
bsf TRISIO, TRIGGERL ;output off
bcf STATUS, RP0 ;bank 0
goto EndInterupt
ActiveL
btfss FLAGS, TRIGOUT ;controllertype
bcf GPIO, TRIGGERL ;determines
btfsc FLAGS, TRIGOUT ;output state
bsf GPIO, TRIGGERL
btfss FLAGS, PULSEONL ;is pulse active?
goto OffstateL
decfsz PULSEL, f ;if pulse is active, count down 10ms
goto EndInterupt
bcf FLAGS, PULSEONL ;10ms is over, clear flags and
bsf STATUS, RP0 ;bank 1
bsf TRISIO, TRIGGERL ;tristate output
bcf STATUS, RP0 ;bank 0
movf FREQR, w ;and reset pulse time.
movwf PULSEL
goto EndInterupt
OffstateL
decfsz DWELLTIMEL, f ;count down dwell time to next pulse
goto EndInterupt
bsf FLAGS, PULSEONL ;if dwell is done turn on outputs
bsf STATUS, RP0 ;bank 1
bcf TRISIO, TRIGGERL ;and reset pulse time
bcf STATUS, RP0 ;bank 0
movf FREQR, w ;from frequency value
movwf DWELLTIMEL
EndInterupt
bcf PIR1, TMR2IF
movf status_temp,w ; retrieve copy of STATUS register
movwf STATUS ; restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w ; restore pre-isr W register contents
retfie ; return from interrupt
;*************************************SUBROUTINES**********************************
Wait10ms
clrf TEMP2
movlw 0x0D
movwf TEMP1 ;rough 10ms timer for button debounce.
Loop1
decfsz TEMP2, f ;count down 256*3=768 cycles
goto Loop1
decfsz TEMP1, f ;count down 768*13=9986 cycles
goto Loop1
return
;*************************************************************
ReadEE
bsf STATUS , RP0 ;Bank1
movlw 0x02
movwf EEADR
bsf EECON1 , RD ;start read
movf EEDAT , W
bcf STATUS , RP0 ;Bank0
return
;*************************************************************
WriteEE
bsf STATUS , RP0
movwf EEDAT
movlw 0x02
movwf EEADR
bsf EECON1,WREN ;Enable write
bcf INTCON, GIE ;Disable INTs
btfsc INTCON, GIE ;See AN576
goto $-2
movlw 0x55 ;Unlock write
movwf EECON2
movlw 0xAA
movwf EECON2
bsf EECON1, WR ;Start the write
WaitForEEWrite
btfsc EECON1, WR ;wait for hardware to clear (done writing)
goto WaitForEEWrite
bcf STATUS , RP0 ;Bank0
bsf INTCON, GIE ;Enable INTS
return
;**********************************************************************************
;**********************************************************************************
;**********************************************************************************
main
clrf GPIO
clrf FLAGS ;clear outputs and code status register
movlw 0x07
movwf CMCON0 ;comparators off
bsf STATUS, RP0 ;bank 1
movlw 0x0F ;start with 0-3 inputs (ADC read)
movwf TRISIO ;pin 0 & 1 & 5 out, all other inputs
movlw 0x51 ;Fosc/16, pin 0 analog
movwf ANSEL ;Right trigger is analog input
movlw 0x04
movwf WPU ;enable week pullups
bcf OPTION_REG, 7 ;enable all week pullups
bcf STATUS, RP0 ;bank 0
movlw 0x01 ;Left just, Vdd, channel 0
movwf ADCON0 ;module on.
movlw 0x10
movwf TEMP1
Wait4ADC
decfsz TEMP1, f
goto Wait4ADC ;acquisition time
bsf ADCON0, 1 ;start ADC
btfsc ADCON0, 1
goto $-1 ;wait for conversion to be done
movlw 0x40 ;about 0.5V from 2V ref
subwf ADRESH, w ;if f > W, C=1
btfsc STATUS, C ;ie- if trigger > 0.5V, then matrix
bsf FLAGS, TRIGOUT ;matrix config sources (output high)
bsf STATUS, RP0 ;bank 1
movlw 0x0C ;restore pin IO
movwf TRISIO
clrf ANSEL ;all digital now
bcf STATUS, RP0 ;bank 0
movlw 0x0A ;start with 10ms pulse width
movwf LEDBLINK ;for the LEDs
movlw FIRERATE1 ;this will get overwritten,
movwf PULSER ; but start with a default value
movwf PULSEL
movwf DWELLTIMER
movwf DWELLTIMEL
call ReadEE ;get state value
movwf STATE
movlw 0x01
movwf T2CON ;timer 2, prescale 1:4, no postscale
bsf STATUS, RP0 ;bank 1
movlw 0xFA
movwf PR2 ;setup 1ms hardware interupt
bsf PIE1, TMR2IE ;enable timer2 interupt
bcf STATUS, RP0 ;bank 0
bsf T2CON, TMR2ON ;turn on timer2
movlw 0xC0
movwf INTCON ;turn on interupts globally
goto InitState ;get first firerate value
;******MAIN LOOP***************
Start
TestLeft
btfsc GPIO, BUTTONL
goto TestRight ;Test for left button press
call Wait10ms
btfsc GPIO, BUTTONL ;button is down for 10ms
goto TestRight
ReleaseLeft
btfss GPIO, BUTTONL ;wait for button release
goto ReleaseLeft
call Wait10ms
btfss GPIO, BUTTONL ;wait for button release
goto ReleaseLeft
movlw 0x02
xorwf STATE, f ;toggle left trigger
call WriteEE ;store state
TestRight
btfsc GPIO, BUTTONR
goto Start
; goto DisplayState ;Test for right button press
call Wait10ms
btfsc GPIO, BUTTONR ;button is down for min 10ms
goto Start
; goto DisplayState
movlw 0xC8
movwf BUTTONHOLD ;setup for 2 second hold
First2seconds
call Wait10ms
btfsc GPIO, BUTTONR ;button is down for more than 10ms
goto ReleaseRight
decfsz BUTTONHOLD, f
goto First2seconds
movlw 0xC8
movwf BUTTONHOLD ;setup for 2 second hold
Second2seconds
call Wait10ms
btfsc GPIO, BUTTONR
goto ReleaseRight
decfsz BUTTONHOLD, f
goto Second2seconds ;button down for 4 seconds, change firerate
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
State1
movlw FIRERATE1 ;state 1
movwf FREQR
bcf STATE, RIGHTACTIVE ;led off
movlw 0x0A
movwf TEMP3
Loop01
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop01
bsf STATE, RIGHTACTIVE ;led on
bsf FLAGS, STATECHANGE ;notify a state change
goto ReleaseRight
State2
movlw FIRERATE2 ;state 2
movwf FREQR
bcf STATE, RIGHTACTIVE ;blink twice, led off
movlw 0x0A
movwf TEMP3
Loop02
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop02
bsf STATE, RIGHTACTIVE ;led on
movlw 0x0A
movwf TEMP3
Loop03
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop03
bcf STATE, RIGHTACTIVE ;led off
movlw 0x0A
movwf TEMP3
Loop04
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop04
bsf STATE, RIGHTACTIVE ;led on
bsf FLAGS, STATECHANGE ;notify a state change
goto ReleaseRight
State3
btfsc STATE, 6
goto State4
movlw FIRERATE3 ;state 3
movwf FREQR
bcf STATE, RIGHTACTIVE ;blink 3 times, led off
movlw 0x0A
movwf TEMP3
Loop05
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop05
bsf STATE, RIGHTACTIVE ;led on
movlw 0x0A
movwf TEMP3
Loop06
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop06
bcf STATE, RIGHTACTIVE ;led off
movlw 0x0A
movwf TEMP3
Loop07
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop07
bsf STATE, RIGHTACTIVE ;led on
movlw 0x0A
movwf TEMP3
Loop08
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop08
bcf STATE, RIGHTACTIVE ;led off
movlw 0x0A
movwf TEMP3
Loop09
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop09
bsf STATE, RIGHTACTIVE ;led on
bsf FLAGS, STATECHANGE ;notify a state change
goto ReleaseRight
State4
movlw FIRERATE4 ;state 4, 22ms cycle
movwf FREQR
bcf STATE, RIGHTACTIVE ;blink 4 times, led off
movlw 0x0A
movwf TEMP3
Loop10
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop10
bsf STATE, RIGHTACTIVE ;led on
movlw 0x0A
movwf TEMP3
Loop11
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop11
bcf STATE, RIGHTACTIVE ;led off
movlw 0x0A
movwf TEMP3
Loop12
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop12
bsf STATE, RIGHTACTIVE ;led on
movlw 0x0A
movwf TEMP3
Loop13
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop13
bcf STATE, RIGHTACTIVE ;led off
movlw 0x0A
movwf TEMP3
Loop14
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop14
bsf STATE, RIGHTACTIVE ;led on
movlw 0x0A
movwf TEMP3
Loop15
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop15
bcf STATE, RIGHTACTIVE ;led off
movlw 0x0A
movwf TEMP3
Loop16
call Wait10ms ;100 ms
decfsz TEMP3, f
goto Loop16
bsf STATE, RIGHTACTIVE ;led on
bsf FLAGS, STATECHANGE ;notify a state change
ReleaseRight
btfss GPIO, BUTTONR ;wait for button release
goto ReleaseRight
call Wait10ms
btfss GPIO, BUTTONL ;wait for button release
goto ReleaseRight
btfsc FLAGS, STATECHANGE ;test for button tap or state change
goto Continue01
movlw 0x01
xorwf STATE, f ;toggle left trigger if button tap
Continue01
bcf FLAGS, STATECHANGE
call WriteEE ;store state
goto Start
; initialize eeprom locations
ORG 0x2100
DE 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07
END ; directive 'end of program'
-
I can, but are you sure these are the fire rates you want???
you have fire rates set at:
#1===10.6 pulses per sec
#2===24pulses per sec
#3===7.6 pulses per sec
#4===5 pulses per sec
if you want to use cod5 the cap kicks in for anything over 8.33 which is 0x3c in hex. let me know what you are doing and I can compile it for you
-
yeah i know, first mode is for halo, second for COD4, third is for GOW2/COD5 and the last one is...I just put it like that.
-
I am not very familiar with rapid shar, but here is the link. http://rapidshare.de/files/46230556/GameplayRF.HEX.html (http://rapidshare.de/files/46230556/GameplayRF.HEX.html)
I used your fire rates, this is fairly slow for cod5 but its what you asked for
-
http://download375.mediafire.com/fxnrcnynx5tg/ynynyn1onik/BurnMeUp2_COD5.asm (http://download375.mediafire.com/fxnrcnynx5tg/ynynyn1onik/BurnMeUp2_COD5.asm)
Great thanks, could you compile this one for me too?
-
here is your hex for burnmeup (sleeper)
http://rapidshare.de/files/46231280/BurnMeUp2_COD5.HEX.html (http://rapidshare.de/files/46231280/BurnMeUp2_COD5.HEX.html)
try mine mode 3 for cod5 8.33 no cap burnmeup (sleeper)
http://rapidshare.de/files/46231348/8.33_cod5_hex.html (http://rapidshare.de/files/46231348/8.33_cod5_hex.html)
-
try mine mode 3 for cod5 8.33 no cap burnmeup (sleeper)
http://rapidshare.de/files/46231348/8.33_cod5_hex.html (http://rapidshare.de/files/46231348/8.33_cod5_hex.html)
What pic is it for??
-
What pic is it for??
PIC12F683
Matt, the reason why I didn't put 0x3c is because I kept on getting capped right before I would finish a round, so that's why I put it a little slower. Also, could anyone help me with installing MPLAB IDE? I keep on getting an error. I've already posted a topic on microchip forums, but they don't have a clue what's going on :dntknw: I run Windows XP SP3 so that may be a problem because MPLAB has only been tested on Windows XP SP2
-
What pic is it for??
this is havers code for the 12f683 3 and 4 moderapid fire..
blue, as for the install?? I dont know if I can help I would tell you to delete it from the computer and download it and install a new copy. I am running win xp sp3 never had anyprobs with mplab. you may need "port talk" for win pic, but not mplab??
-
I've never had any problems with WinPic ever, but yeah I've already downloaded installed and redownloaded and installed but still no luck. Anybody got any alternative hex assemblers? Oh and about the 8.33 code, I tested it out on Call of Duty 5 and it worked great, but it's a little buggy and sputters a bit on Gears of War 2. So I tried out my code and it worked pretty good on both games.
-
yea, i dont play gears, and thats the absolute fastest avail for cod5..to each his own. sry about mplab..let me know if you got more .asm files to compile..its no biggy if its .asm takes about a minute on my pc
-
alright thanks
Could you do this last one? I changed up the speeds a bit.
http://download269.mediafire.com/jndng5emtkxg/mmgjzmmdlmi/GameplayRF_COD5.asm (http://download269.mediafire.com/jndng5emtkxg/mmgjzmmdlmi/GameplayRF_COD5.asm)
-
alright thanks
Could you do this last one? I changed up the speeds a bit.
http://download269.mediafire.com/jndng5emtkxg/mmgjzmmdlmi/GameplayRF_COD5.asm (http://download269.mediafire.com/jndng5emtkxg/mmgjzmmdlmi/GameplayRF_COD5.asm)
sory bud the wife had me busy all weekend, now your latest file is "invalid file" please double check the link and repost it..if you still need it compiled
or you can just tell me what file (gameplayrf or burn me up) and what fire rates you want set.
-
FIRERATE1 equ 0x2F
FIRERATE2 equ 0x12
FIRERATE3 equ 0x3C
FIRERATE4 equ 0x41
GAMEPLAY RF
-
here ya go:
http://rapidshare.com/files/213000807/GameplayRF.HEX.html (http://rapidshare.com/files/213000807/GameplayRF.HEX.html)
I would like to take a moment to say thanks agian to hazer for witing this code, your unselfish acts have touched the lives of many gamers across the world. I for one would like to extend my complete graditude.