Kodewerx

Our culture has advanced beyond all that you could possibly comprehend with one hundred percent of your brain.
It is currently Thu Mar 28, 2024 4:12 am

All times are UTC - 8 hours [ DST ]


Forum rules





Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Apr 15, 2007 11:37 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
Silent Hill

Unlock All Inventory Slots
300BCADF 0028

Inventory Editor
80007800 E17C
80007802 8C62
80007806 8C06
80007808 0029
8000780A 04C1
8000780C FFFF
8000780E 24C6
80007810 C76C
80007812 9689
80007814 CA34
80007816 3671
80007818 1880
8000781A 0002
8000781C 8821
8000781E 0223
80007822 9223
80007824 0001
80007826 9230
80007828 3821
8000782A 0060
8000782C 0800
8000782E 3138
80007830 0002
80007832 1018
80007834 0400
80007836 3138
80007838 0001
8000783A 2467
8000783C 0002
8000783E 1018
80007840 0200
80007842 3138
80007844 FFFF
80007846 2467
80007848 0003
8000784A 1018
8000784C 0100
8000784E 3138
80007850 0001
80007852 2610
80007854 0009
80007856 3406
80007858 0003
8000785A 1018
80007860 FFFF
80007862 2610
80007864 0009
80007866 3406
80007868 0010
8000786A 1067
8000786C 182A
8000786E 0067
80007870 7040
80007872 0003
80007874 FFFF
80007876 25CE
80007878 0821
8000787A 01C3
8000787C 000A
8000787E 240F
80007880 7901
80007882 9078
80007884 C021
80007886 030E
80007888 0002
8000788A 14F8
8000788C FFFF
8000788E 25EF
80007890 7901
80007892 9027
80007894 0002
80007896 2463
80007898 FFF9
8000789A 1DE0
8000789C 0002
8000789E 2421
800078A0 5080
800078A2 0C01
800078A6 A227
800078A8 0009
800078AA 3406
800078AC 0001
800078AE A230
800078B0 330D
800078B2 0801
800078B6 AC06
80007900 20FF
80007902 4022
80007904 5755
80007906 6058
80007908 706E
8000790A 8482
8000790C A087
8000790E C0A3
80007910 E0C2
80007912 FFE2
80007914 20FF
8004CC2C 1E00
8004CC2E 0800

Code:
; Silent Hill "Inventory Editor"
; Copyright 2001-2007 Parasyte
;
; Project began 10-10-2001, completed 04-15-2007
;
; 800AE17C - Cursor position modifier
; 8004CC2C - Cursor position modifier read breakpoint (breakout location)
; 800BCA34 - Slot 1 modifier
; 800BC76C - Pad value
; 800BC774 - Down-state pad value (not used)

.org    0x80007800
lw      $v0, 0xE17C($v1)        ; Moved from break out location [read current cursor position]
lw      $a2, 0x0000($zero)      ; Counter = byte at (80000000)
bgez    $a2, return             ; If counter == 0, continue (and decrement counter)
addiu   $a2, $a2, 0xFFFF        ; Decrement counter

begin:
lhu     $t1, 0xC76C($s4)        ; load pad value into $t1
ori     $s1, $s3, 0xCA34        ; $s1 = 800BCA34 (slot 1 mod)
sll     $v1, $v0, 0x0002        ; $at = Current cursor position * 4
addu    $s1, $s1, $v1           ; $s1 = Current slot selected
lbu     $v1, 0x0000($s1)        ; Load item number (from current slot) into $v1
lbu     $s0, 0x0001($s1)        ; Load quantity of current slot into $a0
addu    $a3, $v1, $zero         ; Copy item number to a backup register

andi    $t8, $t1, 0x0800        ; Check for R1
beq     $t8, $zero, notR1       ; If R1 is not pushed, branch (and check for L1)
andi    $t8, $t1, 0x0400        ; Check for L1
addiu   $a3, $v1, 0x0001        ; Increment item in current slot

notR1:
beq     $t8, $zero, notL1       ; If L1 is not pushed, branch (and check for R2)
andi    $t8, $t1, 0x0200        ; Check for R2
addiu   $a3, $v1, 0xFFFF        ; Decrement item in current slot

notL1:
beq     $t8, $zero, notR2       ; If R2 is not pushed, branch (and check for L2)
andi    $t8, $t1, 0x0100        ; Check for L2
addiu   $s0, $s0, 0x0001        ; Increment item value in current slot
ori     $a2, $zero, 0x0009      ; Counter = 9

notR2:
beq     $t8, $zero, notL2       ; If L2 is not pushed, branch
nop
addiu   $s0, $s0, 0xFFFF        ; Decrement item value in current slot
ori     $a2, $zero, 0x0009      ; Counter = 9

notL2:
beq     $a3, $v1, no_new_item   ; Update item only when changed

; Here is where some magic happens by clipping the item into the valid ranges
slt     $v1, $v1, $a3           ; $v1 = 1 if we are increasing, or 0 if decreasing
sll     $t6, $v1, 0x0001
addiu   $t6, $t6, 0xFFFF        ; $t6 = 1 if we are increasing, or -1 if decreasing
addu    $at, $t6, $v1           ; $at = 2 if we are increasing, or -1 if decreasing
addiu   $t7, $zero, 0x000A      ; Number of lines in the lookup table

loop:
lbu     $t8, 0x7901($v1)        ; Check item against lookup table (this instruction is non-relocatable)
addu    $t8, $t8, $t6
bne     $t8, $a3, valid_item
addiu   $t7, $t7, 0xFFFF
lbu     $a3, 0x7901($at)        ; Load proper item (this instruction is non-relocatable)

valid_item:
addiu   $v1, $v1, 0x0002
bgtz    $t7, loop
addiu   $at, $at, 0x0002

jal     0x80054200              ; Update screen (redraw items)
sb      $a3, 0x0000($s1)        ; Update item in current slot
ori     $a2, $zero, 0x0009      ; Counter = 9
no_new_item:
sb      $s0, 0x0001($s1)        ; Update item value in current slot

return:
j       0x0004CC34              ; Return to breakout location
sw      $a2, 0x0000($zero)      ; Store counter into 80000000


.org    0x80007900
.db           0xFF
.db     0x20, 0x22              ; Every two bytes defines a range of "valid" items
.db     0x40, 0x55
.db     0x57, 0x58
.db     0x60, 0x6E
.db     0x70, 0x82
.db     0x84, 0x87
.db     0xA0, 0xA3
.db     0xC0, 0xC2
.db     0xE0, 0xE2
.db     0xFF, 0xFF
.db     0x20


.org    0x8004CC2C
j       0x80007800

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 168 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group