Fix NorthMapObjectIndexBuffer etc

This commit is contained in:
PikalaxALT 2015-11-02 12:54:27 -05:00
parent d35cfad0de
commit e0d6e9ca7a
5 changed files with 44 additions and 38 deletions

View File

@ -351,24 +351,24 @@ Function97df9:: ; 97df9
Function97e08:: ; 97e08 Function97e08:: ; 97e08
ld hl, wd6de ld hl, wd6de
xor a xor a
.asm_97e0c .loop
ld [hMapObjectIndexBuffer], a ld [hMapObjectIndexBuffer], a
ld a, [hl] ld a, [hl]
and a and a
jr z, .asm_97e19 jr z, .skip
push hl push hl
ld b, h ld b, h
ld c, l ld c, l
call Function97e79 call Function97e79
pop hl pop hl
.asm_97e19 .skip
ld de, $0006 ld de, $0006
add hl, de add hl, de
ld a, [hMapObjectIndexBuffer] ld a, [hMapObjectIndexBuffer]
inc a inc a
cp $4 cp $4
jr nz, .asm_97e0c jr nz, .loop
ret ret
; 97e25 ; 97e25

View File

@ -1209,28 +1209,29 @@ ApplyPersonFacing: ; 0x9728b
call SetSpriteDirection call SetSpriteDirection
ld hl, VramState ld hl, VramState
bit 6, [hl] bit 6, [hl]
jr nz, .asm_972b5 ; 0x972b0 $3 jr nz, .text_state ; 0x972b0 $3
call Function972bc call .DisableTextTiles
.asm_972b5 .text_state
call UpdateSprites call UpdateSprites
ret ret
.not_visible .not_visible
pop de pop de
scf scf
ret ret
; 0x972bc ; 0x972bc
Function972bc: ; 0x972bc .DisableTextTiles: ; 0x972bc
call Function217a call Function217a
hlcoord 0, 0 hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
.asm_972c5 .loop
res 7, [hl] res 7, [hl]
inc hl inc hl
dec bc dec bc
ld a, b ld a, b
or c or c
jr nz, .asm_972c5 ; 0x972cb $f8 jr nz, .loop ; 0x972cb $f8
ret ret
; 0x972ce ; 0x972ce

View File

@ -111,7 +111,7 @@ Function217a:: ; 217a
call Function2198 call Function2198
ld a, $60 ld a, $60
hlcoord 0, 0 hlcoord 0, 0
ld bc, TileMapEnd - TileMap ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill call ByteFill
ld a, BANK(Function4d15b) ld a, BANK(Function4d15b)
@ -131,12 +131,12 @@ Function2198:: ; 2198
ld hl, wEnemyMoveStruct ld hl, wEnemyMoveStruct
ld b, $5 ld b, $5
.asm_21a5 .loop
push de push de
push hl push hl
ld c, $6 ld c, $6
.asm_21a9 .loop2
push de push de
push hl push hl
ld a, [de] ld a, [de]
@ -187,7 +187,7 @@ endr
pop de pop de
inc de inc de
dec c dec c
jp nz, .asm_21a9 jp nz, .loop2
pop hl pop hl
ld de, $0060 ld de, $0060
add hl, de add hl, de
@ -201,7 +201,7 @@ endr
.asm_2225 .asm_2225
dec b dec b
jp nz, .asm_21a5 jp nz, .loop
ret ret
; 222a ; 222a
@ -729,9 +729,9 @@ ChangeMap:: ; 24e4
ld hl, OverworldMap ld hl, OverworldMap
ld a, [MapWidth] ld a, [MapWidth]
ld [hObjectStructIndexBuffer], a ld [hConnectedMapWidth], a
add $6 add $6
ld [hMapObjectIndexBuffer], a ld [hConnectionStripLength], a
ld c, a ld c, a
ld b, 0 ld b, 0
rept 3 rept 3
@ -750,7 +750,7 @@ endr
ld b, a ld b, a
.asm_250c .asm_250c
push hl push hl
ld a, [hObjectStructIndexBuffer] ld a, [hConnectedMapWidth]
ld c, a ld c, a
.asm_2510 .asm_2510
ld a, [de] ld a, [de]
@ -759,7 +759,7 @@ endr
dec c dec c
jr nz, .asm_2510 jr nz, .asm_2510
pop hl pop hl
ld a, [hMapObjectIndexBuffer] ld a, [hConnectionStripLength]
add l add l
ld l, a ld l, a
jr nc, .asm_251e jr nc, .asm_251e
@ -794,10 +794,10 @@ FillMapConnections:: ; 2524
ld e, a ld e, a
ld a, [NorthConnectionStripLocation + 1] ld a, [NorthConnectionStripLocation + 1]
ld d, a ld d, a
ld a, [NorthMapObjectIndexBuffer] ld a, [NorthConnectionStripLength]
ld [hMapObjectIndexBuffer], a ld [hConnectionStripLength], a
ld a, [NorthObjectStructIndexBuffer] ld a, [NorthConnectedMapWidth]
ld [hObjectStructIndexBuffer], a ld [hConnectedMapWidth], a
call FillNorthConnectionStrip call FillNorthConnectionStrip
.South .South
@ -817,10 +817,10 @@ FillMapConnections:: ; 2524
ld e, a ld e, a
ld a, [SouthConnectionStripLocation + 1] ld a, [SouthConnectionStripLocation + 1]
ld d, a ld d, a
ld a, [SouthMapObjectIndexBuffer] ld a, [SouthConnectionStripLength]
ld [hMapObjectIndexBuffer], a ld [hConnectionStripLength], a
ld a, [SouthObjectStructIndexBuffer] ld a, [SouthConnectedMapWidth]
ld [hObjectStructIndexBuffer], a ld [hConnectedMapWidth], a
call FillSouthConnectionStrip call FillSouthConnectionStrip
.West .West
@ -843,7 +843,7 @@ FillMapConnections:: ; 2524
ld a, [WestConnectionStripLength] ld a, [WestConnectionStripLength]
ld b, a ld b, a
ld a, [WestConnectedMapWidth] ld a, [WestConnectedMapWidth]
ld [hMapObjectIndexBuffer], a ld [hConnectionStripLength], a
call FillWestConnectionStrip call FillWestConnectionStrip
.East .East
@ -866,7 +866,7 @@ FillMapConnections:: ; 2524
ld a, [EastConnectionStripLength] ld a, [EastConnectionStripLength]
ld b, a ld b, a
ld a, [EastConnectedMapWidth] ld a, [EastConnectedMapWidth]
ld [hMapObjectIndexBuffer], a ld [hConnectionStripLength], a
call FillEastConnectionStrip call FillEastConnectionStrip
.Done .Done
@ -882,7 +882,7 @@ FillSouthConnectionStrip:: ; 25d3
push de push de
push hl push hl
ld a, [hMapObjectIndexBuffer] ld a, [hConnectionStripLength]
ld b, a ld b, a
.x .x
ld a, [hli] ld a, [hli]
@ -892,7 +892,7 @@ FillSouthConnectionStrip:: ; 25d3
jr nz, .x jr nz, .x
pop hl pop hl
ld a, [hObjectStructIndexBuffer] ld a, [hConnectedMapWidth]
ld e, a ld e, a
ld d, 0 ld d, 0
add hl, de add hl, de
@ -917,7 +917,7 @@ FillEastConnectionStrip:: ; 25f6
.asm_25f6 .asm_25f6
ld a, [MapWidth] ld a, [MapWidth]
add 6 add 6
ld [hObjectStructIndexBuffer], a ld [hConnectedMapWidth], a
push de push de
@ -933,13 +933,13 @@ FillEastConnectionStrip:: ; 25f6
inc de inc de
pop hl pop hl
ld a, [hMapObjectIndexBuffer] ld a, [hConnectionStripLength]
ld e, a ld e, a
ld d, 0 ld d, 0
add hl, de add hl, de
pop de pop de
ld a, [hObjectStructIndexBuffer] ld a, [hConnectedMapWidth]
add e add e
ld e, a ld e, a
jr nc, .asm_2617 jr nc, .asm_2617

View File

@ -35,6 +35,9 @@ hInMenu EQU $ffaa
hMapObjectIndexBuffer EQU $ffaf hMapObjectIndexBuffer EQU $ffaf
hObjectStructIndexBuffer EQU $ffb0 hObjectStructIndexBuffer EQU $ffb0
hConnectionStripLength EQU $ffaf
hConnectedMapWidth EQU $ffb0
hPastLeadingZeroes EQU $ffb3 hPastLeadingZeroes EQU $ffb3
hStringCmpString1 EQU $ffb1 hStringCmpString1 EQU $ffb1

View File

@ -1649,9 +1649,9 @@ NorthConnectionStripPointer:: ; d1ab
ds 2 ds 2
NorthConnectionStripLocation:: ; d1ad NorthConnectionStripLocation:: ; d1ad
ds 2 ds 2
NorthMapObjectIndexBuffer:: ; d1af NorthConnectionStripLength:: ; d1af
ds 1 ds 1
NorthObjectStructIndexBuffer:: ; d1b0 NorthConnectedMapWidth:: ; d1b0
ds 1 ds 1
NorthConnectionStripYOffset:: ; d1b1 NorthConnectionStripYOffset:: ; d1b1
ds 1 ds 1
@ -1669,9 +1669,9 @@ SouthConnectionStripPointer:: ; d1b7
ds 2 ds 2
SouthConnectionStripLocation:: ; d1b9 SouthConnectionStripLocation:: ; d1b9
ds 2 ds 2
SouthMapObjectIndexBuffer:: ; d1bb SouthConnectionStripLength:: ; d1bb
ds 1 ds 1
SouthObjectStructIndexBuffer:: ; d1bc SouthConnectedMapWidth:: ; d1bc
ds 1 ds 1
SouthConnectionStripYOffset:: ; d1bd SouthConnectionStripYOffset:: ; d1bd
ds 1 ds 1
@ -1927,6 +1927,8 @@ wd431:: ds 1
MapStatus:: ; d432 MapStatus:: ; d432
ds 1 ds 1
MapEventStatus:: ; d433 MapEventStatus:: ; d433
; 0: do map events
; 1: do background events
ds 1 ds 1
ScriptFlags:: ; d434 ScriptFlags:: ; d434