Merge pull request #450 from roukaour/master

Constants for TextBoxFlags
This commit is contained in:
yenatch 2017-12-30 21:32:45 -05:00 committed by GitHub
commit 92fba8821c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 68 additions and 59 deletions

View File

@ -29,6 +29,11 @@ TEXT_DELAY_SLOW EQU 5
const FRAME_7 ; 6 const FRAME_7 ; 6
const FRAME_8 ; 7 const FRAME_8 ; 7
; TextBoxFlags:
const_def
const FAST_TEXT_DELAY_F ; 0
const NO_TEXT_DELAY_F ; 1
; Options2: ; Options2:
const_def const_def
const MENU_ACCOUNT ; 0 const MENU_ACCOUNT ; 0

View File

@ -5,12 +5,12 @@ DefaultOptions: ; 14f7c
db $00 db $00
; TextBoxFrame: frame 1 ; TextBoxFrame: frame 1
db FRAME_1 db FRAME_1
; TextBoxFlags: ?? ; TextBoxFlags: use text speed
db $01 db 1 << FAST_TEXT_DELAY_F
; GBPrinter: normal brightness ; GBPrinter: normal brightness
db GBPRINTER_NORMAL db GBPRINTER_NORMAL
; Options2: menu account on ; Options2: menu account on
db $01 db 1 << MENU_ACCOUNT
; $cfd2: ?? ; $cfd2: ??
db $00 db $00
; $cfd3: ?? ; $cfd3: ??

View File

@ -875,10 +875,10 @@ CheckMenuOW: ; 96b30
ld [hMenuReturn + 1], a ld [hMenuReturn + 1], a
ld a, [hJoyPressed] ld a, [hJoyPressed]
bit 2, a ; SELECT bit SELECT_F, a
jr nz, .Select jr nz, .Select
bit 3, a ; START bit START_F, a
jr z, .NoMenu jr z, .NoMenu
ld a, BANK(StartMenuScript) ld a, BANK(StartMenuScript)

View File

@ -262,19 +262,19 @@ SetMagnetTrainPals: ; 8cdc3
; bushes ; bushes
hlbgcoord 0, 0 hlbgcoord 0, 0
ld bc, 4 bgrows ld bc, 4 * BG_MAP_WIDTH
ld a, $2 ld a, $2
call ByteFill call ByteFill
; train ; train
hlbgcoord 0, 4 hlbgcoord 0, 4
ld bc, 10 bgrows ld bc, 10 * BG_MAP_WIDTH
xor a xor a
call ByteFill call ByteFill
; more bushes ; more bushes
hlbgcoord 0, 14 hlbgcoord 0, 14
ld bc, 4 bgrows ld bc, 4 * BG_MAP_WIDTH
ld a, $2 ld a, $2
call ByteFill call ByteFill

View File

@ -89,9 +89,9 @@ MonMenuLoop: ; 24d59
ld de, SFX_READ_TEXT_2 ld de, SFX_READ_TEXT_2
call PlaySFX call PlaySFX
ld a, [hJoyPressed] ld a, [hJoyPressed]
bit 0, a ; A bit A_BUTTON_F, a
jr nz, .select jr nz, .select
bit 1, a ; B bit B_BUTTON_F, a
jr nz, .cancel jr nz, .cancel
jr .loop jr .loop

View File

@ -65,21 +65,21 @@ ScrollingMenuJoyAction: ; 24609
ld a, [hJoyPressed] ld a, [hJoyPressed]
and BUTTONS and BUTTONS
or b or b
bit 0, a ; A bit A_BUTTON_F, a
jp nz, .a_button jp nz, .a_button
bit 1, a ; B bit B_BUTTON_F, a
jp nz, .b_button jp nz, .b_button
bit 2, a ; Select bit SELECT_F, a
jp nz, .select jp nz, .select
bit 3, a ; Start bit START_F, a
jp nz, .start jp nz, .start
bit 4, a ; Right bit D_RIGHT_F, a
jp nz, .d_right jp nz, .d_right
bit 5, a ; Left bit D_LEFT_F, a
jp nz, .d_left jp nz, .d_left
bit 6, a ; Up bit D_UP_F, a
jp nz, .d_up jp nz, .d_up
bit 7, a ; Down bit D_DOWN_F, a
jp nz, .d_down jp nz, .d_down
jr .loop jr .loop
; 24640 ; 24640

View File

@ -32,7 +32,7 @@ _TitleScreen: ; 10ed67
; Clear screen palettes ; Clear screen palettes
hlbgcoord 0, 0 hlbgcoord 0, 0
ld bc, 20 bgrows ld bc, 20 * BG_MAP_WIDTH
xor a xor a
call ByteFill call ByteFill
@ -43,7 +43,7 @@ _TitleScreen: ; 10ed67
; line 0 (copyright) ; line 0 (copyright)
hlbgcoord 0, 0, vBGMap1 hlbgcoord 0, 0, vBGMap1
ld bc, 1 bgrows ld bc, BG_MAP_WIDTH
ld a, 7 ; palette ld a, 7 ; palette
call ByteFill call ByteFill
@ -54,27 +54,27 @@ _TitleScreen: ; 10ed67
; lines 3-4 ; lines 3-4
hlbgcoord 0, 3 hlbgcoord 0, 3
ld bc, 2 bgrows ld bc, 2 * BG_MAP_WIDTH
ld a, 2 ld a, 2
call ByteFill call ByteFill
; line 5 ; line 5
hlbgcoord 0, 5 hlbgcoord 0, 5
ld bc, 1 bgrows ld bc, BG_MAP_WIDTH
ld a, 3 ld a, 3
call ByteFill call ByteFill
; line 6 ; line 6
hlbgcoord 0, 6 hlbgcoord 0, 6
ld bc, 1 bgrows ld bc, BG_MAP_WIDTH
ld a, 4 ld a, 4
call ByteFill call ByteFill
; line 7 ; line 7
hlbgcoord 0, 7 hlbgcoord 0, 7
ld bc, 1 bgrows ld bc, BG_MAP_WIDTH
ld a, 5 ld a, 5
call ByteFill call ByteFill
; lines 8-9 ; lines 8-9
hlbgcoord 0, 8 hlbgcoord 0, 8
ld bc, 2 bgrows ld bc, 2 * BG_MAP_WIDTH
ld a, 6 ld a, 6
call ByteFill call ByteFill
@ -87,7 +87,7 @@ _TitleScreen: ; 10ed67
; Suicune gfx ; Suicune gfx
hlbgcoord 0, 12 hlbgcoord 0, 12
ld bc, 6 bgrows ; the rest of the screen ld bc, 6 * BG_MAP_WIDTH ; the rest of the screen
ld a, 0 | VRAM_BANK_1 ld a, 0 | VRAM_BANK_1
call ByteFill call ByteFill
@ -110,7 +110,7 @@ _TitleScreen: ; 10ed67
; Clear screen tiles ; Clear screen tiles
hlbgcoord 0, 0 hlbgcoord 0, 0
ld bc, 64 bgrows ld bc, 64 * BG_MAP_WIDTH
ld a, " " ld a, " "
call ByteFill call ByteFill

View File

@ -306,7 +306,7 @@ PrintLetterDelay:: ; 313d
; non-scrolling text? ; non-scrolling text?
ld a, [TextBoxFlags] ld a, [TextBoxFlags]
bit 1, a bit NO_TEXT_DELAY_F, a
ret z ret z
push hl push hl
@ -323,7 +323,7 @@ PrintLetterDelay:: ; 313d
; force fast scroll? ; force fast scroll?
ld a, [TextBoxFlags] ld a, [TextBoxFlags]
bit 0, a bit FAST_TEXT_DELAY_F, a
jr z, .fast jr z, .fast
; text speed ; text speed
@ -332,7 +332,7 @@ PrintLetterDelay:: ; 313d
jr .updatedelay jr .updatedelay
.fast .fast
ld a, 1 ld a, TEXT_DELAY_FAST
.updatedelay .updatedelay
ld [TextDelayFrames], a ld [TextDelayFrames], a
@ -347,11 +347,11 @@ PrintLetterDelay:: ; 313d
; Wait one frame if holding A or B. ; Wait one frame if holding A or B.
ld a, [hJoyDown] ld a, [hJoyDown]
bit 0, a ; A_BUTTON bit A_BUTTON_F, a
jr z, .checkb jr z, .checkb
jr .delay jr .delay
.checkb .checkb
bit 1, a ; B_BUTTON bit B_BUTTON_F, a
jr z, .wait jr z, .wait
.delay .delay

View File

@ -442,10 +442,10 @@ ButtonSound:: ; aaf
jr .load_cursor_state jr .load_cursor_state
.cursor_off .cursor_off
ld a, [TileMap + 17 + 17 * SCREEN_WIDTH] lda_coord 17, 17
.load_cursor_state .load_cursor_state
ld [TileMap + 18 + 17 * SCREEN_WIDTH], a ldcoord_a 18, 17
ret ret
; b06 ; b06

View File

@ -697,7 +697,7 @@ PokeFluteTerminatorCharacter:: ; 13e0
PlaceHLTextAtBC:: ; 13e5 PlaceHLTextAtBC:: ; 13e5
ld a, [TextBoxFlags] ld a, [TextBoxFlags]
push af push af
set 1, a set NO_TEXT_DELAY_F, a
ld [TextBoxFlags], a ld [TextBoxFlags], a
call DoTextUntilTerminator call DoTextUntilTerminator

View File

@ -1,51 +1,52 @@
hlcoord EQUS "coord hl,"
bccoord EQUS "coord bc," bccoord EQUS "coord bc,"
decoord EQUS "coord de," decoord EQUS "coord de,"
hlcoord EQUS "coord hl,"
coord: MACRO coord: MACRO
; register, x, y[, origin] ; register, x, y[, origin]
if _NARG < 4 if _NARG < 4
ld \1, TileMap + SCREEN_WIDTH * (\3) + (\2) ld \1, (\3) * SCREEN_WIDTH + (\2) + TileMap
else else
ld \1, \4 + SCREEN_WIDTH * (\3) + (\2) ld \1, (\3) * SCREEN_WIDTH + (\2) + \4
endc
ENDM
hlbgcoord EQUS "bgcoord hl,"
bcbgcoord EQUS "bgcoord bc,"
debgcoord EQUS "bgcoord de,"
bgcoord: MACRO
; register, x, y[, origin]
if _NARG < 4
ld \1, (\3) * BG_MAP_WIDTH + (\2) + vBGMap0
else
ld \1, (\3) * BG_MAP_WIDTH + (\2) + \4
endc endc
ENDM ENDM
dwcoord: MACRO dwcoord: MACRO
; x, y
rept _NARG / 2 rept _NARG / 2
dw TileMap + SCREEN_WIDTH * (\2) + (\1) dw (\2) * SCREEN_WIDTH + (\1) + TileMap
shift shift
shift shift
endr endr
ENDM ENDM
ldcoord_a: MACRO ldcoord_a: MACRO
; x, y[, origin]
if _NARG < 3 if _NARG < 3
ld [TileMap + SCREEN_WIDTH * (\2) + (\1)], a ld [(\2) * SCREEN_WIDTH + (\1) + TileMap], a
else else
ld [\3 + SCREEN_WIDTH * (\2) + (\1)], a ld [(\2) * SCREEN_WIDTH + (\1) + \3], a
endc endc
ENDM ENDM
lda_coord: MACRO lda_coord: MACRO
; x, y[, origin]
if _NARG < 3 if _NARG < 3
ld a, [TileMap + SCREEN_WIDTH * (\2) + (\1)] ld a, [(\2) * SCREEN_WIDTH + (\1) + TileMap]
else else
ld a, [\3 + SCREEN_WIDTH * (\2) + (\1)] ld a, [(\2) * SCREEN_WIDTH + (\1) + \3]
endc
ENDM
bgrows EQUS "* $20" ; SCREEN_WIDTH
hlbgcoord EQUS "bgcoord hl,"
debgcoord EQUS "bgcoord de,"
bcbgcoord EQUS "bgcoord bc,"
bgcoord: MACRO
if _NARG >= 4
ld \1, \3 bgrows + \2 + \4
else
ld \1, \3 bgrows + \2 + vBGMap0
endc endc
ENDM ENDM

View File

@ -1480,7 +1480,10 @@ wSaveFileExists:: db
TextBoxFrame:: ; cfce TextBoxFrame:: ; cfce
; bits 0-2: textbox frame 0-7 ; bits 0-2: textbox frame 0-7
db db
TextBoxFlags:: db TextBoxFlags::
; bit 0: 1-frame text delay
; bit 4: no text delay
db
GBPrinter:: ; cfd0 GBPrinter:: ; cfd0
; bit 0-6: brightness ; bit 0-6: brightness
; lightest: $00 ; lightest: $00