ref: bc287b9b80cec819e6df7b6b1ff7110eabf606f7
parent: 5ebae4747b49d7067cc75919a2b0983fae6a88d7
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Mon Oct 19 16:26:35 EDT 2020
Some formatting changes
--- a/audio.asm
+++ b/audio.asm
@@ -43,7 +43,8 @@
INCLUDE "audio/sfx/noise_instrument18_1.asm"
INCLUDE "audio/sfx/noise_instrument19_1.asm"
-Audio1_WavePointers: INCLUDE "audio/wave_instruments.asm"
+Audio1_WavePointers:
+INCLUDE "audio/wave_instruments.asm"
INCLUDE "audio/sfx/start_menu_1.asm"
INCLUDE "audio/sfx/pokeflute.asm"
@@ -142,7 +143,8 @@
INCLUDE "audio/sfx/noise_instrument18_2.asm"
INCLUDE "audio/sfx/noise_instrument19_2.asm"
-Audio2_WavePointers: INCLUDE "audio/wave_instruments.asm"
+Audio2_WavePointers:
+INCLUDE "audio/wave_instruments.asm"
INCLUDE "audio/sfx/press_ab_2.asm"
INCLUDE "audio/sfx/start_menu_2.asm"
@@ -267,7 +269,8 @@
INCLUDE "audio/sfx/noise_instrument18_3.asm"
INCLUDE "audio/sfx/noise_instrument19_3.asm"
-Audio3_WavePointers: INCLUDE "audio/wave_instruments.asm"
+Audio3_WavePointers:
+INCLUDE "audio/wave_instruments.asm"
INCLUDE "audio/sfx/start_menu_3.asm"
INCLUDE "audio/sfx/cut_3.asm"
--- a/data/sgb/sgb_packets.asm
+++ b/data/sgb/sgb_packets.asm
@@ -4,6 +4,7 @@
db ($4 << 3) + ((\1 * 6) / 16 + 1)
db \1
ENDM
+
ATTR_BLK_DATA: MACRO
db \1 ; which regions are affected
db \2 + (\3 << 2) + (\4 << 4) ; palette for each region
@@ -51,6 +52,7 @@
db \3 ; length (1-11)
ENDM
+
BlkPacket_WholeScreen:
ATTR_BLK 1
ATTR_BLK_DATA %011, 0,0,0, 00,00, 19,17
@@ -239,13 +241,15 @@
; This set of packets is found in several Japanese SGB-compatible titles.
; It appears to be part of NCL's SGB devkit.
-DataSnd_72548: DATA_SND $85d, $0, 11
+DataSnd_72548:
+ DATA_SND $85d, $0, 11
db $8C ; cpx #$8c (2)
db $D0, $F4 ; bne -$0c
db $60 ; rts
ds 7, 0
-DataSnd_72558: DATA_SND $852, $0, 11
+DataSnd_72558:
+ DATA_SND $852, $0, 11
db $A9, $E7 ; lda #$e7
db $9F, $01, $C0, $7E ; sta $7ec001, x
db $E8 ; inx
@@ -254,7 +258,8 @@
db $E8 ; inx
db $E0 ; cpx #$8c (1)
-DataSnd_72568: DATA_SND $847, $0, 11
+DataSnd_72568:
+ DATA_SND $847, $0, 11
db $C4 ; cmp #$c4 (2)
db $D0, $16 ; bne +$16
db $A5 ; lda dp
@@ -263,7 +268,8 @@
db $D0, $10 ; bne +$10
db $A2, $28 ; ldx #$28
-DataSnd_72578: DATA_SND $83c, $0, 11
+DataSnd_72578:
+ DATA_SND $83c, $0, 11
db $F0, $12 ; beq +$12
db $A5 ; lda dp
db $C9, $C9 ; cmp #$c9
@@ -273,7 +279,8 @@
db $CA ; dex
db $C9 ; cmp #$c4 (1)
-DataSnd_72588: DATA_SND $831, $0, 11
+DataSnd_72588:
+ DATA_SND $831, $0, 11
dbw $0C, $CAA5 ; tsb $caa5
db $C9, $7E ; cmp #$7e
db $D0, $06 ; bne +$06
@@ -281,7 +288,8 @@
db $CB ; wai
db $C9, $7E ; cmp #$7e
-DataSnd_72598: DATA_SND $826, $0, 11
+DataSnd_72598:
+ DATA_SND $826, $0, 11
db $39 ; bne +$39 (2)
dbw $CD, $C48 ; cmp $c48
db $D0, $34 ; bne +$34
@@ -289,7 +297,8 @@
db $C9, $C9 ; cmp #$c9
db $80, $D0 ; bra -$30
-DataSnd_725a8: DATA_SND $81b, $0, 11
+DataSnd_725a8:
+ DATA_SND $81b, $0, 11
db $EA ; nop
db $EA ; nop
db $EA ; nop
@@ -300,7 +309,8 @@
dbw $CD,$C4F ; cmp $c4f
db $D0 ; bne +$39 (1)
-DataSnd_725b8: DATA_SND $810, $0, 11
+DataSnd_725b8:
+ DATA_SND $810, $0, 11
dbw $4C, $820 ; jmp $820
db $EA ; nop
db $EA ; nop
--- a/data/text_predef_pointers.asm
+++ b/data/text_predef_pointers.asm
@@ -1,5 +1,6 @@
add_tx_pre: MACRO
-\1_id:: dw \1
+\1_id::
+ dw \1
ENDM
TextPredefs::
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -335,7 +335,18 @@
ret
BattleTransition_FlashScreenPalettes:
- db $F9,$FE,$FF,$FE,$F9,$E4,$90,$40,$00,$40,$90,$E4
+ db %11111001
+ db %11111110
+ db %11111111
+ db %11111110
+ db %11111001
+ db %11100100
+ db %10010000
+ db %01000000
+ db %00000000
+ db %01000000
+ db %10010000
+ db %11100100
db 1 ; end
; used for low level trainer dungeon battles
@@ -646,6 +657,11 @@
ld l, a
jp BattleTransition_Circle_Sub3
+; halves
+ const_def
+ const CIRCLE_LEFT
+ const CIRCLE_RIGHT
+
half_circle: MACRO
; quadrant x, circle data, target coord
db \1
@@ -654,28 +670,28 @@
ENDM
BattleTransition_HalfCircle1:
- half_circle $01, BattleTransition_CircleData1, 18, 6
- half_circle $01, BattleTransition_CircleData2, 19, 3
- half_circle $01, BattleTransition_CircleData3, 18, 0
- half_circle $01, BattleTransition_CircleData4, 14, 0
- half_circle $01, BattleTransition_CircleData5, 10, 0
- half_circle $00, BattleTransition_CircleData5, 9, 0
- half_circle $00, BattleTransition_CircleData4, 5, 0
- half_circle $00, BattleTransition_CircleData3, 1, 0
- half_circle $00, BattleTransition_CircleData2, 0, 3
- half_circle $00, BattleTransition_CircleData1, 1, 6
+ half_circle CIRCLE_RIGHT, BattleTransition_CircleData1, 18, 6
+ half_circle CIRCLE_RIGHT, BattleTransition_CircleData2, 19, 3
+ half_circle CIRCLE_RIGHT, BattleTransition_CircleData3, 18, 0
+ half_circle CIRCLE_RIGHT, BattleTransition_CircleData4, 14, 0
+ half_circle CIRCLE_RIGHT, BattleTransition_CircleData5, 10, 0
+ half_circle CIRCLE_LEFT, BattleTransition_CircleData5, 9, 0
+ half_circle CIRCLE_LEFT, BattleTransition_CircleData4, 5, 0
+ half_circle CIRCLE_LEFT, BattleTransition_CircleData3, 1, 0
+ half_circle CIRCLE_LEFT, BattleTransition_CircleData2, 0, 3
+ half_circle CIRCLE_LEFT, BattleTransition_CircleData1, 1, 6
BattleTransition_HalfCircle2:
- half_circle $00, BattleTransition_CircleData1, 1, 11
- half_circle $00, BattleTransition_CircleData2, 0, 14
- half_circle $00, BattleTransition_CircleData3, 1, 17
- half_circle $00, BattleTransition_CircleData4, 5, 17
- half_circle $00, BattleTransition_CircleData5, 9, 17
- half_circle $01, BattleTransition_CircleData5, 10, 17
- half_circle $01, BattleTransition_CircleData4, 14, 17
- half_circle $01, BattleTransition_CircleData3, 18, 17
- half_circle $01, BattleTransition_CircleData2, 19, 14
- half_circle $01, BattleTransition_CircleData1, 18, 11
+ half_circle CIRCLE_LEFT, BattleTransition_CircleData1, 1, 11
+ half_circle CIRCLE_LEFT, BattleTransition_CircleData2, 0, 14
+ half_circle CIRCLE_LEFT, BattleTransition_CircleData3, 1, 17
+ half_circle CIRCLE_LEFT, BattleTransition_CircleData4, 5, 17
+ half_circle CIRCLE_LEFT, BattleTransition_CircleData5, 9, 17
+ half_circle CIRCLE_RIGHT, BattleTransition_CircleData5, 10, 17
+ half_circle CIRCLE_RIGHT, BattleTransition_CircleData4, 14, 17
+ half_circle CIRCLE_RIGHT, BattleTransition_CircleData3, 18, 17
+ half_circle CIRCLE_RIGHT, BattleTransition_CircleData2, 19, 14
+ half_circle CIRCLE_RIGHT, BattleTransition_CircleData1, 18, 11
BattleTransition_Circle_Sub3:
push hl
@@ -704,7 +720,7 @@
add hl, bc
ld a, [de]
inc de
- cp $ff
+ cp -1
ret z
and a
jr z, BattleTransition_Circle_Sub3
@@ -722,17 +738,8 @@
jr nz, .loop2
jr BattleTransition_Circle_Sub3
-BattleTransition_CircleData1:
- db $02,$03,$05,$04,$09,$FF
-
-BattleTransition_CircleData2:
- db $01,$01,$02,$02,$04,$02,$04,$02,$03,$FF
-
-BattleTransition_CircleData3:
- db $02,$01,$03,$01,$04,$01,$04,$01,$04,$01,$03,$01,$02,$01,$01,$01,$01,$FF
-
-BattleTransition_CircleData4:
- db $04,$01,$04,$00,$03,$01,$03,$00,$02,$01,$02,$00,$01,$FF
-
-BattleTransition_CircleData5:
- db $04,$00,$03,$00,$03,$00,$02,$00,$02,$00,$01,$00,$01,$00,$01,$FF
+BattleTransition_CircleData1: db 2, 3, 5, 4, 9, -1
+BattleTransition_CircleData2: db 1, 1, 2, 2, 4, 2, 4, 2, 3, -1
+BattleTransition_CircleData3: db 2, 1, 3, 1, 4, 1, 4, 1, 4, 1, 3, 1, 2, 1, 1, 1, 1, -1
+BattleTransition_CircleData4: db 4, 1, 4, 0, 3, 1, 3, 0, 2, 1, 2, 0, 1, -1
+BattleTransition_CircleData5: db 4, 0, 3, 0, 3, 0, 2, 0, 2, 0, 1, 0, 1, 0, 1, -1
--- a/engine/battle/trainer_ai.asm
+++ b/engine/battle/trainer_ai.asm
@@ -146,11 +146,11 @@
jr .nextMove
StatusAilmentMoveEffects:
- db $01 ; unused sleep effect
+ db EFFECT_01 ; unused sleep effect
db SLEEP_EFFECT
db POISON_EFFECT
db PARALYZE_EFFECT
- db $FF
+ db -1 ; end
; slightly encourage moves with specific effects.
; in particular, stat-modifying moves and other move effects
--- a/engine/movie/splash.asm
+++ b/engine/movie/splash.asm
@@ -110,7 +110,7 @@
ld c, 4
.smallStarsInnerLoop ; introduce new wave of 4 small stars OAM entries
ld a, [de]
- cp $ff
+ cp -1
jr z, .next2
ld [hli], a ; Y
inc de
@@ -165,27 +165,23 @@
db $68, $40
db $68, $58
db $68, $78
-
SmallStarsWave2Coords:
db $68, $38
db $68, $48
db $68, $60
db $68, $70
-
SmallStarsWave3Coords:
db $68, $34
db $68, $4C
db $68, $54
db $68, $64
-
SmallStarsWave4Coords:
db $68, $3C
db $68, $5C
db $68, $6C
db $68, $74
-
SmallStarsEmptyWave:
- db $FF
+ db -1 ; end
MoveDownSmallStars:
ld b, 8
--- a/engine/overworld/field_move_messages.asm
+++ b/engine/overworld/field_move_messages.asm
@@ -46,7 +46,8 @@
jp PrintText
CoordsData_cdf7:
- db $0B,$07,$FF
+ dbmapcoord 7, 11
+ db -1 ; end
CurrentTooFastText:
text_far _CurrentTooFastText
--- a/engine/overworld/push_boulder.asm
+++ b/engine/overworld/push_boulder.asm
@@ -71,16 +71,20 @@
ret
PushBoulderUpMovementData:
- db NPC_MOVEMENT_UP,$FF
+ db NPC_MOVEMENT_UP
+ db -1 ; end
PushBoulderDownMovementData:
- db NPC_MOVEMENT_DOWN,$FF
+ db NPC_MOVEMENT_DOWN
+ db -1 ; end
PushBoulderLeftMovementData:
- db NPC_MOVEMENT_LEFT,$FF
+ db NPC_MOVEMENT_LEFT
+ db -1 ; end
PushBoulderRightMovementData:
- db NPC_MOVEMENT_RIGHT,$FF
+ db NPC_MOVEMENT_RIGHT
+ db -1 ; end
DoBoulderDustAnimation::
ld a, [wd730]