mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-16 18:30:50 +12:00
Use rgblink dmg mode
This commit is contained in:
parent
91e55dbe0b
commit
98f09b6d26
2
Makefile
2
Makefile
|
@ -49,7 +49,7 @@ pokered_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON RED"
|
||||||
pokeblue_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON BLUE"
|
pokeblue_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON BLUE"
|
||||||
|
|
||||||
%.gbc: $$(%_obj)
|
%.gbc: $$(%_obj)
|
||||||
rgblink -n $*.sym -l pokered.link -o $@ $^
|
rgblink -d -n $*.sym -l pokered.link -o $@ $^
|
||||||
rgbfix $($*_opt) $@
|
rgbfix $($*_opt) $@
|
||||||
sort $*.sym -o $*.sym
|
sort $*.sym -o $*.sym
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ PrintSafariZoneBattleText:
|
||||||
ld [wd0b5], a
|
ld [wd0b5], a
|
||||||
call GetMonHeader
|
call GetMonHeader
|
||||||
ld a, [wMonHCatchRate]
|
ld a, [wMonHCatchRate]
|
||||||
ld [wEnemyMonCatchRate], a
|
ld [wEnemyMonActualCatchRate], a
|
||||||
pop hl
|
pop hl
|
||||||
.asm_429f
|
.asm_429f
|
||||||
push hl
|
push hl
|
||||||
|
|
|
@ -297,7 +297,7 @@ ItemUseBall:
|
||||||
pop bc ; b = Rand1 - Status
|
pop bc ; b = Rand1 - Status
|
||||||
|
|
||||||
; If Rand1 - Status > CatchRate, the ball fails to capture the Pokémon.
|
; If Rand1 - Status > CatchRate, the ball fails to capture the Pokémon.
|
||||||
ld a, [wEnemyMonCatchRate]
|
ld a, [wEnemyMonActualCatchRate]
|
||||||
cp b
|
cp b
|
||||||
jr c, .failedToCapture
|
jr c, .failedToCapture
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ ItemUseBall:
|
||||||
xor a
|
xor a
|
||||||
ld [H_MULTIPLICAND], a
|
ld [H_MULTIPLICAND], a
|
||||||
ld [H_MULTIPLICAND + 1], a
|
ld [H_MULTIPLICAND + 1], a
|
||||||
ld a, [wEnemyMonCatchRate]
|
ld a, [wEnemyMonActualCatchRate]
|
||||||
ld [H_MULTIPLICAND + 2], a
|
ld [H_MULTIPLICAND + 2], a
|
||||||
ld a, 100
|
ld a, 100
|
||||||
ld [H_MULTIPLIER], a
|
ld [H_MULTIPLIER], a
|
||||||
|
@ -1434,7 +1434,7 @@ VitaminText:
|
||||||
ItemUseBait:
|
ItemUseBait:
|
||||||
ld hl, ThrewBaitText
|
ld hl, ThrewBaitText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld hl, wEnemyMonCatchRate ; catch rate
|
ld hl, wEnemyMonActualCatchRate ; catch rate
|
||||||
srl [hl] ; halve catch rate
|
srl [hl] ; halve catch rate
|
||||||
ld a, BAIT_ANIM
|
ld a, BAIT_ANIM
|
||||||
ld hl, wSafariBaitFactor ; bait factor
|
ld hl, wSafariBaitFactor ; bait factor
|
||||||
|
@ -1444,7 +1444,7 @@ ItemUseBait:
|
||||||
ItemUseRock:
|
ItemUseRock:
|
||||||
ld hl, ThrewRockText
|
ld hl, ThrewRockText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld hl, wEnemyMonCatchRate ; catch rate
|
ld hl, wEnemyMonActualCatchRate ; catch rate
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
add a ; double catch rate
|
add a ; double catch rate
|
||||||
jr nc, .noCarry
|
jr nc, .noCarry
|
||||||
|
|
|
@ -159,9 +159,6 @@ ROMX $2C
|
||||||
WRAM0
|
WRAM0
|
||||||
"WRAM Bank 0"
|
"WRAM Bank 0"
|
||||||
|
|
||||||
WRAMX 1
|
|
||||||
"WRAM Bank 1"
|
|
||||||
|
|
||||||
SRAM 0
|
SRAM 0
|
||||||
"Sprite Buffers"
|
"Sprite Buffers"
|
||||||
|
|
||||||
|
|
37
wram.asm
37
wram.asm
|
@ -41,6 +41,7 @@ ENDM
|
||||||
battle_struct: MACRO
|
battle_struct: MACRO
|
||||||
\1Species:: db
|
\1Species:: db
|
||||||
\1HP:: dw
|
\1HP:: dw
|
||||||
|
\1PartyPos::
|
||||||
\1BoxLevel:: db
|
\1BoxLevel:: db
|
||||||
\1Status:: db
|
\1Status:: db
|
||||||
\1Type::
|
\1Type::
|
||||||
|
@ -1590,40 +1591,10 @@ wBattleMonSpecies2:: ; cfd9
|
||||||
|
|
||||||
wEnemyMonNick:: ds NAME_LENGTH ; cfda
|
wEnemyMonNick:: ds NAME_LENGTH ; cfda
|
||||||
|
|
||||||
wEnemyMon:: ; cfe5
|
wEnemyMon:: battle_struct wEnemyMon ; cfe5
|
||||||
; The wEnemyMon struct reaches past 0xcfff,
|
|
||||||
; the end of wram bank 0 on cgb.
|
|
||||||
; This has no significance on dmg, where wram
|
|
||||||
; isn't banked (c000-dfff is contiguous).
|
|
||||||
; However, recent versions of rgbds have replaced
|
|
||||||
; dmg-style wram with cgb wram banks.
|
|
||||||
|
|
||||||
; Until this is fixed, this struct will have
|
|
||||||
; to be declared manually.
|
|
||||||
|
|
||||||
wEnemyMonSpecies:: db
|
|
||||||
wEnemyMonHP:: dw
|
|
||||||
wEnemyMonPartyPos::
|
|
||||||
wEnemyMonBoxLevel:: db
|
|
||||||
wEnemyMonStatus:: db
|
|
||||||
wEnemyMonType::
|
|
||||||
wEnemyMonType1:: db
|
|
||||||
wEnemyMonType2:: db
|
|
||||||
wEnemyMonCatchRate_NotReferenced:: db
|
|
||||||
wEnemyMonMoves:: ds NUM_MOVES
|
|
||||||
wEnemyMonDVs:: ds 2
|
|
||||||
wEnemyMonLevel:: db
|
|
||||||
wEnemyMonMaxHP:: dw
|
|
||||||
wEnemyMonAttack:: dw
|
|
||||||
wEnemyMonDefense:: dw
|
|
||||||
wEnemyMonSpeed:: dw
|
|
||||||
wEnemyMonSpecial:: dw
|
|
||||||
wEnemyMonPP:: ds 2 ; NUM_MOVES - 2
|
|
||||||
SECTION "WRAM Bank 1", WRAMX, BANK[1]
|
|
||||||
ds 2 ; NUM_MOVES - 2
|
|
||||||
|
|
||||||
wEnemyMonBaseStats:: ds 5
|
wEnemyMonBaseStats:: ds 5
|
||||||
wEnemyMonCatchRate:: ds 1
|
wEnemyMonActualCatchRate:: ds 1
|
||||||
wEnemyMonBaseExp:: ds 1
|
wEnemyMonBaseExp:: ds 1
|
||||||
|
|
||||||
wBattleMonNick:: ds NAME_LENGTH ; d009
|
wBattleMonNick:: ds NAME_LENGTH ; d009
|
||||||
|
@ -3233,7 +3204,7 @@ wBoxMonNicksEnd:: ; dee2
|
||||||
wBoxDataEnd::
|
wBoxDataEnd::
|
||||||
|
|
||||||
|
|
||||||
SECTION "Stack", WRAMX[$df00], BANK[1]
|
SECTION "Stack", WRAM0[$df00]
|
||||||
ds $ff
|
ds $ff
|
||||||
wStack:: ; dfff
|
wStack:: ; dfff
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue