diff options
author | Marcus Huderle <huderlem@gmail.com> | 2017-07-09 10:20:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-09 10:20:05 -0700 |
commit | 40b27505b32bac1d96e20a168ac96ab3384878b3 (patch) | |
tree | 9de98df1188d19ded55bed9f943d785bb1392409 | |
parent | f1612ae5bfcf3e8e7c250b214883f9ae1abe7fbd (diff) | |
parent | 51b81e4d9734c9db8b673074e6ab26dd8280f61c (diff) |
Merge pull request #18 from TwitchPlaysPokemon/chaos_requests
stationary text labeling
-rw-r--r-- | engine/pinball_game/catchem_mode.asm | 4 | ||||
-rw-r--r-- | engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm | 8 | ||||
-rw-r--r-- | engine/pinball_game/catchem_mode/catchem_mode_red_field.asm | 8 | ||||
-rw-r--r-- | home/text.asm | 78 | ||||
-rw-r--r-- | main.asm | 14 | ||||
-rw-r--r-- | wram.asm | 27 |
6 files changed, 74 insertions, 65 deletions
diff --git a/engine/pinball_game/catchem_mode.asm b/engine/pinball_game/catchem_mode.asm index 095a877..0268589 100644 --- a/engine/pinball_game/catchem_mode.asm +++ b/engine/pinball_game/catchem_mode.asm @@ -1163,12 +1163,12 @@ Func_10825: ; 0x10825 call AddBCDEToCurBufferValue
call FillBottomMessageBufferWithBlackTile
call Func_30db
- ld hl, wd5e9
+ ld hl, wStationaryText2
ld de, Data_2a50
call Func_3372
pop de
pop bc
- ld hl, wd5e4
+ ld hl, wStationaryText1
ld de, JackpotText
call Func_3357
ret
diff --git a/engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm b/engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm index c4b90fa..d03094d 100644 --- a/engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm +++ b/engine/pinball_game/catchem_mode/catchem_mode_blue_field.asm @@ -127,12 +127,12 @@ Func_20394: ; 0x20394 push de
call FillBottomMessageBufferWithBlackTile
call Func_30db
- ld hl, wd5e9
+ ld hl, wStationaryText2
ld de, Data_2a2a
call Func_3372
pop de
pop bc
- ld hl, wd5e4
+ ld hl, wStationaryText1
ld de, HitText
call Func_3357
ld a, [wNumMonHits]
@@ -271,12 +271,12 @@ Func_204f1: ; 0x204f1 push de
call FillBottomMessageBufferWithBlackTile
call Func_30db
- ld hl, wd5e9
+ ld hl, wStationaryText2
ld de, Data_2a3d
call Func_3372
pop de
pop bc
- ld hl, wd5e4
+ ld hl, wStationaryText1
ld de, FlippedText
call Func_3357
.asm_2055e
diff --git a/engine/pinball_game/catchem_mode/catchem_mode_red_field.asm b/engine/pinball_game/catchem_mode/catchem_mode_red_field.asm index b34f93d..d6738d8 100644 --- a/engine/pinball_game/catchem_mode/catchem_mode_red_field.asm +++ b/engine/pinball_game/catchem_mode/catchem_mode_red_field.asm @@ -125,12 +125,12 @@ Func_200d3: ; 0x200d3 push de
call FillBottomMessageBufferWithBlackTile
call Func_30db
- ld hl, wd5e9
+ ld hl, wStationaryText2
ld de, Data_2a2a
call Func_3372
pop de
pop bc
- ld hl, wd5e4
+ ld hl, wStationaryText1
ld de, HitText
call Func_3357
ld a, [wNumMonHits]
@@ -269,12 +269,12 @@ Func_20230: ; 0x20230 push de
call FillBottomMessageBufferWithBlackTile
call Func_30db
- ld hl, wd5e9
+ ld hl, wStationaryText2
ld de, Data_2a3d
call Func_3372
pop de
pop bc
- ld hl, wd5e4
+ ld hl, wStationaryText1
ld de, FlippedText
call Func_3357
.asm_2029d
diff --git a/home/text.asm b/home/text.asm index feb972a..b9bcea2 100644 --- a/home/text.asm +++ b/home/text.asm @@ -8,7 +8,7 @@ Func_30db: ; 0x30db ld [wd5cb], a ret -FillBottomMessageBufferWithBlackTile: ; 0x30e8 +FillBottomMessageBufferWithBlackTile: ; 0x30e8 wipes the message buffer and disables all text ld a, $81 ld hl, wBottomMessageBuffer ld b, $40 @@ -23,9 +23,9 @@ FillBottomMessageBufferWithBlackTile: ; 0x30e8 ld [wScrollingText1Enabled], a ld [wScrollingText2Enabled], a ld [wScrollingText3Enabled], a - ld [wd5e4], a - ld [wd5e9], a - ld [wd5ee], a + ld [wStationaryText1], a + ld [wStationaryText2], a + ld [wStationaryText3], a ret Func_310a: ; 0x310a @@ -584,19 +584,19 @@ Func_33a7: ; 0x33a7 inc de ret -Func_33c3: ; 0x33c3 - ld a, [hli] +HandleStationaryText: ; 0x33c3 Handles stationary text + ld a, [hli] ;+1 and a - ret z - ld a, [hli] + ret z ;ret if not enabled + ld a, [hli] ;load buffer offset into e ld e, a ld d, wBottomMessageBuffer / $100 push hl - ld l, [hl] + ld l, [hl] ;Place text from buffer into text ld h, wBottomMessageText / $100 call PlaceTextLow pop hl - inc hl + inc hl ;decrement timer ld a, [hl] dec a ld [hli], a @@ -604,7 +604,7 @@ Func_33c3: ; 0x33c3 ld a, [hl] dec a ld [hld], a - bit 7, a + bit 7, a ;if Var5 <= 128, which is to say has not underflowed, ret, else disable text ret z dec hl dec hl @@ -615,7 +615,7 @@ Func_33c3: ; 0x33c3 Func_33e3: ; 0x33e3 ld a, [wd5ca] and a - jr nz, .asm_33ed ;if ??? = nz, load into ???, else jump + jr nz, .asm_33ed ;if ??? = z, load 0 into ???, else jump ld [wd5cb], a ret @@ -623,63 +623,63 @@ Func_33e3: ; 0x33e3 ld c, $0 ld a, [wScrollingText1Enabled] and a - jr z, .asm_33fe ;if ?? is 0 - push bc ;store b and 0 + jr z, .Scrolling1Off ;if scrolling text is enabled, scroll text and inc c. repeat for each struct + push bc ld hl, wScrollingText1 call HandleScrolling pop bc inc c -.asm_33fe +.Scrolling1Off ld a, [wScrollingText2Enabled] and a - jr z, .asm_340d + jr z, .Scrolling2Off push bc ld hl, wScrollingText2 call HandleScrolling pop bc inc c -.asm_340d +.Scrolling2Off ld a, [wScrollingText3Enabled] and a - jr z, .asm_341c + jr z, .Scrolling3Off push bc ld hl, wScrollingText3 call HandleScrolling pop bc inc c -.asm_341c - ld a, [wd5e4] +.Scrolling3Off + ld a, [wStationaryText1] and a - jr z, .asm_342b + jr z, .Stationary1Off push bc - ld hl, wd5e4 - call Func_33c3 + ld hl, wStationaryText1 + call HandleStationaryText pop bc inc c -.asm_342b - ld a, [wd5e9] +.Stationary1Off + ld a, [wStationaryText2] and a - jr z, .asm_343a + jr z, .Stationary2Off push bc - ld hl, wd5e9 - call Func_33c3 + ld hl, wStationaryText2 + call HandleStationaryText pop bc inc c -.asm_343a - ld a, [wd5ee] +.Stationary2Off + ld a, [wStationaryText3] and a - jr z, .asm_3449 + jr z, .Stationary3Off push bc - ld hl, wd5ee - call Func_33c3 + ld hl, wStationaryText3 + call HandleStationaryText pop bc inc c -.asm_3449 +.Stationary3Off ld a, c and a - ret nz - ld [wd5ca], a - call FillBottomMessageBufferWithBlackTile + ret nz ;if text has displayed, we are done, else + ld [wd5ca], a ;place 0 in ??? + call FillBottomMessageBufferWithBlackTile ;fill with default data? ld a, [hGameBoyColorFlag] and a jr nz, .gameboyColor @@ -705,7 +705,7 @@ Func_3475: ; 0x3475 ld [hPressedButtons], a call HandleTilts ld a, [wCurrentStage] - bit 0, a + bit 0, a ;handle flippers if the stage has any callba nz, HandleFlippers callba DrawSpritesForStage call Func_33e3 @@ -713,7 +713,7 @@ Func_3475: ; 0x3475 rst AdvanceFrame ld a, [wd5ca] and a - jr nz, Func_3475 + jr nz, Func_3475 ;loops until wd5ca is zero ret FivePoints: ; 34a6 @@ -186,13 +186,13 @@ SECTION "bank4", ROMX Func_10000: ; 0x10000 ld c, a - ld a, [wInSpecialMode] + ld a, [wInSpecialMode] ;special mode in c and a - ret z + ret z ;if mot in special mode, ret ld a, c ld [wd54c], a ld a, [wSpecialMode] - cp SPECIAL_MODE_CATCHEM + cp SPECIAL_MODE_CATCHEM ;branch based on mode jp z, Func_10a95 cp SPECIAL_MODE_EVOLUTION jr nz, .next @@ -1500,11 +1500,11 @@ CallTable_3021f: ; 0x3021f Func_3022b: ; 0x3022b xor a - ld [wd5ca], a - call FillBottomMessageBufferWithBlackTile + ld [wd5ca], a ;turn text off + call FillBottomMessageBufferWithBlackTile ;clear text xor a ld [wInSpecialMode], a - ld [wSpecialMode], a + ld [wSpecialMode], a ;no longer in special modes callba StopTimer ld a, [wCurrentStage] rst JumpTable ; calls JumpToFuncInTable @@ -2081,7 +2081,7 @@ Func_31660: ; 0x31660 ret Func_31672: ; 0x31672 - ld a, [wd5ca] + ld a, [wd5ca] ;if text is off and a ret nz call FillBottomMessageBufferWithBlackTile @@ -229,7 +229,7 @@ wDrawBottomMessageBox:: ; 0xd4aa wd4ab:: ; 0xd4ab ds $1 -wCurrentStage:: ; 0xd4ac +wCurrentStage:: ; 0xd4ac see constants/stage_constants.asm for list. bit 1 is 1 if the stage has flippers ds $1 wd4ad:: ; 0xd4ad @@ -556,7 +556,7 @@ wInSpecialMode:: ; 0xd54b ; Set to 1 if currently in special game mode. See wSpecialMode. ds $1 -wd54c:: ; 0xd54c +wd54c:: ; 0xd54c 10000 sets it to c. red evo mode checks it for it's contents ds $1 wd54d:: ; 0xd54d @@ -730,7 +730,7 @@ wWildMonCollision:: ; 0xd5c7 ds $1 -wd5ca:: ; 0xd5ca set to 1 by a commonly called text function that is called at the start of catch and raises the score bar +wd5ca:: ; 0xd5ca set to 1 by a commonly called text function that is called at the start of catch and raises the score bar. set off by text handler if no text is ready to run. Possibly toggles if text is running? ds $1 wd5cb:: ; 0xd5cb set to 0 if the above is 0 during Func_33e3 @@ -754,14 +754,23 @@ wScrollingText2:: ; 0xd5d4 wScrollingText3:: ; 0xd5dc scrolling_text wScrollingText3 -wd5e4:: ; 0xd5e4 - ds $5 +stationary_text: MACRO +\1Enabled::ds 1 ; Toggles if enabled. 0 is off, non-0 is on +\1MessageBoxOffset:: ds 1 ; Offset in wBottomMessageBuffer to place first character of text +\1SourceTextOffset:: ds 1 ; Offset in wBottomMessageText for the text to be displayed +\1Duration:: +\1DurationLowByte:: ds 1 ;how many frames to stay on screen. +\1DurationHighByte:: ds 1 ;thiswill trigger as 0 if >= 128 +ENDM -wd5e9:: ; 0xd5e9 - ds $5 +wStationaryText1:: ; 0xd5e4 + stationary_text wStationaryText1 -wd5ee:: ; 0xd5ee - ds $5 +wStationaryText2:: ; 0xd5e9 + stationary_text wStationaryText2 + +wStationaryText3:: ; 0xd5ee + stationary_text wStationaryText3 wCapturingMon:: ; 0xd5f3 ; Set to 1 when the capturing animation starts. |