Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Amiga Bloodwych Code Hacks  (Read 6382 times)

0 Members and 1 Guest are viewing this topic.

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Amiga Bloodwych Code Hacks
« on: May 21, 2014, 11:13:51 AM »

A dedicated thread to any findings / notes in relation to making modifications to the Bloodwych Amiga source code.

There is a separate guide to the data structure, and comments  / findings relating to 'pure' cross-format data structure edits should be kept to separate threads.
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Amiga Bloodwych Code Hacks
« Reply #1 on: May 21, 2014, 11:16:46 AM »

Number one:

This code kindly tells Zendick to initially hold the Ace of Swords in his pocket, which can either be purchased, exchanged for the permit, or collected when dropped.

Code: [Select]
lbC00073A:
cmpi.b #$40,$000B(a4)
000740 bne.s lbC000748
000742 move.b #$37,$000C(a4)

lbC000748:

I make the assumption that this is done when Zendick is move from the "main" monster data block (which is only 6 (?) characters long per monster) to the "live" monster data block which is stored at around $16C80 in memory  (or thereabouts, I will have to check)
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Amiga Bloodwych Code Hacks
« Reply #2 on: May 21, 2014, 11:57:24 AM »

This codes determined if a character is placed in the central position:


Code: [Select]
009728 cmpi.b #$15,-$0017(a3)
00972E beq.s lbC009750
009730 cmpi.b #$16,-$0017(a3)
009736 beq.s lbC009750
009738 cmpi.b #$40,-$0017(a3)
00973E beq.s lbC009750
009740 cmpi.b #$67,-$0017(a3)
009746 bcc.s lbC009750

basically, it the monster type is 15,16,40 (traders and zendick) or $67 (behemoth) or above....
« Last Edit: May 21, 2014, 12:02:41 PM by Hungry Horace »
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Amiga Bloodwych Code Hacks
« Reply #3 on: May 21, 2014, 12:28:03 PM »


This nice little bit of code allows Zendik to name himself when asked:


Code: [Select]
002A38 cmpi.b #$40,$0B(a1,d0.w)
002A3E bne.s lbC002A46
002A40 lea ZendikMsg.l,a6
lbC002A46:
bra.l lbC002990
002A4A
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Amiga Bloodwych Code Hacks
« Reply #4 on: May 21, 2014, 12:56:35 PM »

This is an interesting one....

Code: [Select]
002A84 cmpi.b #$5F,d1
002A88 beq.s lbC002A92
002A8A cmpi.b #$40,d1
002A8E bcc.l lbC002CCA
lbC002A92:
...
...
...
lbC002CCA:
move.b #$07,$0001(a4)
002CD0 lea NeverTrustUnnaturalMsg.l,a6

This seems to be the start of looking at all objects which can be sold/traded, and include the Permit $5F as an exception, otherwise only allow objects from $40 downwards.

This could be used for some fun stuff, like stating that an object is priceless or making some other comment!
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Amiga Bloodwych Code Hacks
« Reply #5 on: May 21, 2014, 05:12:26 PM »

Code: [Select]
00066A lea UnpackedMonsters.l,a4
000670 move.w #$01FF,d0

lbC000674:
move.l d6,(a4)+
000676 dbra d0,lbC000674

00067A move.w lbB00EA8A.l,d0

000680 move.w d0,d1
000682 add.w d0,d0

000684 lea MonsterTotalsCounts.l,a4
00068A move.w $00(a4,d0.w),d6

00068E lea UnpackedMonsters.l,a4
000694 move.w d6,-$0002(a4)
000698 bmi.l lbC006C72
00069C add.w d1,d0
00069E asl.w #$08,d0
0006A0 lea TheMonsterBlock.l,a3
0006A6 adda.w d0,a3
0006A8 moveq #$00,d4

lbC0006AA:
clr.b $0005(a4)
0006AE clr.b $0002(a4)
0006B2 move.b (a3)+,d0
0006B4 subq.b #$01,d0
0006B6 move.b d0,d1
0006B8 lsr.b #$04,d1
0006BA move.b d1,$000A(a4)
0006BE andi.w #$000F,d0
0006C2 move.b d0,$0004(a4)
0006C6 bsr.l lbC008136
0006CA moveq #$00,d7
0006CC move.b (a3)+,d7
0006CE move.b d7,$0000(a4)
0006D2 swap d7
0006D4 move.b (a3)+,d7
0006D6 move.b d7,$0001(a4)
0006DA btst #$17,d7
0006DE bne.s lbC0006EA
0006E0 bsr.l lbC0080F8
0006E4 bset #$07,$01(a6,d0.w)

lbC0006EA:
moveq #$00,d0
0006EC move.b (a3)+,d0
0006EE move.b d0,$0006(a4)
0006F2 move.b d0,$0007(a4)
0006F6 moveq #$0E,d1
0006F8 sub.b d0,d1
0006FA bcs.s lbC000702
0006FC cmpi.b #$08,d1
000700 bcc.s lbC000704

lbC000702:
moveq #$08,d1

lbC000704:
asl.b #$04,d1
000706 move.b d1,$0003(a4)
00070A move.w #$0190,d1
00070E cmpi.b #$19,d0
000712 bcc.s lbC000722
000714 move.w #$00FA,d1
000718 cmpi.b #$10,d0
00071C bcc.s lbC000722
00071E move.b lbB00077E(pc,d0.w),d1

lbC000722:
mulu.w d1,d0
000724 addi.w #$0019,d0
000728 move.w d0,$0008(a4)
00072C move.b (a3)+,$000B(a4)
000730 bpl.s lbC00073A
000732 move.b #$10,$0003(a4)
000738 bra.s lbC000748

lbC00073A:
cmpi.b #$40,$000B(a4)
000740 bne.s lbC000748
000742 move.b #$37,$000C(a4)

lbC000748:
moveq #$00,d0
00074A move.b (a3)+,d0
00074C cmpi.b #$FF,d0
000750 beq.s lbC000772
000752 lea lbW016FEC.l,a0
000758 move.b d4,$00(a0,d0.w)
00075C move.b d0,d1
00075E andi.b #$03,d1
000762 tst.b $0000(a4)
000766 bmi.s lbC000772
000768 addq.w #$01,-$0002(a0)
00076C lsr.b #$02,d0
00076E move.b d0,$000D(a4)

lbC000772:
adda.w #$0010,a4
000776 addq.w #$01,d4
000778 dbra d6,lbC0006AA
00077C rts

Ok, so it looks like this is what you are interested in MadMunky....  This seems to load the monsters from the .monsters setup section (the files we know and love from the editing process) and loads them into an allocated space in memory ($16B7C in memory) - this address also has a "count" at the start of it....    lbW0167DA seems to be the reference to that space.



If I can get to grip with what some of the labels should be, we might be able to make some sense of this, and translate it into "English" (or other code)
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Amiga Bloodwych Code Hacks
« Reply #6 on: May 21, 2014, 09:33:22 PM »

similar code for reading through the champions data on game start:

Code: [Select]
lbC0005F2:
bsr.l lbC0007C4
0005F6 lea CharacterStats.l,a4
0005FC moveq #$0F,d6

ChampionLoop:
clr.b $0011(a4)
000602 move.b #$FF,$0013(a4)

000608 clr.b $001E(a4)
00060C clr.b $001B(a4)
000610 move.b #$FF,$001D(a4)
000616 move.w d6,d0
000618 eori.b #$0F,d0
00061C bsr.l lbC00482A
000620 move.b $000A(a4),$0009(a4)
000626 moveq #$00,d0
000628 move.b $001A(a4),d0
00062C jsr lbC008136.l
000632 moveq #$00,d7
000634 move.b $0016(a4),d7
000638 bmi.s lbC00064A

00063A swap d7
00063C move.b $0017(a4),d7
000640 bsr.l lbC0080F8
000644 bset #$07,$01(a6,d0.w)

lbC00064A:
adda.w #$0020,a4
00064E dbra d6,ChampionLoop

The main problem here, is not knowing exactly what each champion data item is used for, or what the other subroutines being called do.
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Amiga Bloodwych Code Hacks
« Reply #7 on: January 06, 2016, 08:22:01 PM »

managed a nice hack that stops the problem of 'I start in a locked room' on Book of Skulls.....  I use a small bit of new data to determine which Champions are 'permitted'

If the are not, then they are shown as grey, and cannot be chosen....   (i would also like it to make the 'badge' icon grey if i can work it out)
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022