Working on spiral problems

This commit is contained in:
randall.rupper
2019-09-05 21:09:26 -06:00
parent c6a1e90043
commit eb3b1eaa44
8 changed files with 62 additions and 21 deletions

View File

@@ -860,7 +860,8 @@ class Door(object):
layer = 4 * (self.layer ^ 1 if toggle else self.layer) layer = 4 * (self.layer ^ 1 if toggle else self.layer)
return [self.roomIndex, layer + self.doorIndex] return [self.roomIndex, layer + self.doorIndex]
if self.type == DoorType.SpiralStairs: if self.type == DoorType.SpiralStairs:
bitmask = 0x10 * int(self.zeroHzCam) bitmask = 0x04 * int(self.layer)
bitmask += 0x10 * int(self.zeroHzCam)
bitmask += 0x20 * int(self.zeroVtCam) bitmask += 0x20 * int(self.zeroVtCam)
return [self.roomIndex, bitmask + self.quadrant, self.shiftX, self.shiftY] return [self.roomIndex, bitmask + self.quadrant, self.shiftX, self.shiftY]

View File

@@ -57,7 +57,7 @@ def create_doors(world, player):
create_spiral_stairs(player, 'Hyrule Dungeon Armory Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x71, 0, Low, A, 0x1e, 0xa0, True), create_spiral_stairs(player, 'Hyrule Dungeon Armory Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x71, 0, Low, A, 0x1e, 0xa0, True),
create_spiral_stairs(player, 'Hyrule Dungeon Staircase Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x70, 2, High, A, 0x36, 0xa0, True), create_spiral_stairs(player, 'Hyrule Dungeon Staircase Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x70, 2, High, A, 0x36, 0xa0, True),
create_spiral_stairs(player, 'Hyrule Dungeon Staircase Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x70, 1, High, A, 0x1f, 0x50), create_spiral_stairs(player, 'Hyrule Dungeon Staircase Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x70, 1, High, A, 0x1f, 0x50),
create_spiral_stairs(player, 'Hyrule Dungeon Cellblock Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x80, 0, Low, A, 0x1f, 0x50), create_spiral_stairs(player, 'Hyrule Dungeon Cellblock Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x80, 0, High, A, 0x1f, 0x50),
# sewers # sewers
create_blocked_door(player, 'Sewers Behind Tapestry S', DoorType.Normal, Direction.South, 0x41, Mid, High), create_blocked_door(player, 'Sewers Behind Tapestry S', DoorType.Normal, Direction.South, 0x41, Mid, High),

2
Rom.py
View File

@@ -18,7 +18,7 @@ from EntranceShuffle import door_addresses
JAP10HASH = '03a63945398191337e896e5771f77173' JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = 'fdfff1a9046506a57dbcbe23fb5fd386' RANDOMIZERBASEHASH = '6b3a06053a9751e976a228ded2b0439d'
class JsonRom(object): class JsonRom(object):

View File

@@ -122,6 +122,26 @@ c2 21 ae b6 0a bf 1b
Trap doors:
0468 - flag is set when doors are down (1 = down? 0 = up?)
$690 - 7 for open - 0 for down
IntraRoom: ->
Dungeon_IntraRoomTransShutDoors (maybe should be Open)
stz $0468
#$07 -> $0690
Dungeon_IntraRoomTransOpenDoors (maybe should be Shut)
10D71 -> A
A -> 0468
0468++
0 -> 0690
Other transition stuff Other transition stuff
Overworld_LoadTransGfx -> LoadTransAuxGfx Overworld_LoadTransGfx -> LoadTransAuxGfx

View File

@@ -29,7 +29,7 @@ NotLinkDoor2:
; Staircase routine ; Staircase routine
;org $02a1e7 ;(PC: 121e7) ;org $02a1e7 ;(PC: 121e7)
org $01c3d4 ;(PC: c3d4) org $01c3d4 ;(PC: c3d4)
jsl SpiralWarp : nop jsl SpiralWarp : nop #4
; Graphics fix ; Graphics fix
@@ -333,5 +333,7 @@ ShiftQuadIndex:
db 2, 1 ; see ShiftQuad func (relates to $a9,$aa) db 2, 1 ; see ShiftQuad func (relates to $a9,$aa)
CamBoundIndex: ; Horizontal 1st CamBoundIndex: ; Horizontal 1st
db 0, 4 ; Camera Bounds $0618-$61f db 0, 4 ; Camera Bounds $0618-$61f
OppCamBoundIndex: ; Horizontal 1st
db 4, 0 ; Camera Bounds $0618-$61f
incsrc doortables.asm incsrc doortables.asm

View File

@@ -29,20 +29,21 @@ SpiralWarp:
ldy #$01 : jsr ShiftQuadSimple ldy #$01 : jsr ShiftQuadSimple
.skipYQuad .skipYQuad
lda $01 : and #$04 : lsr : sta $048a ;fix layer calc 0->0 2->1
; shift lower coordinates ; shift lower coordinates
lda $02 : sta $22 lda $02 : sta $22
lda $03 : sta $20 lda $03 : sta $20
ldy #$00 : jsr SetCamera ; todo: figure out camera jazz ldy #$00 : jsr SetCamera
ldy #$01 : jsr SetCamera ldy #$01 : jsr SetCamera
ply : plx : plb ; pull the stuff we pushed ply : plx : plb ; pull the stuff we pushed
.end .end rtl
; this is the code we are hijacking ; this is the code we are hijacking
; lda $a0 - we overwrote this behavior ; lda $a0 - we overwrote all this behavior
lda $063d, x ; lda $063d, x
rtl ; sta $048a
} }
;Sets the offset in A ;Sets the offset in A
@@ -97,8 +98,6 @@ ShiftQuadSimple:
SetCamera: SetCamera:
{ {
stz $04 : sty $05 stz $04 : sty $05
lda $01 : and #$10 : !add $05 : cmp #$10 : beq .done ; zeroHzCam check (10+0 = 10)
lda $01 : and #$20 : !add $05 : cmp #$21 : beq .done ; zeroVtCam check (20+1 = 21)
tyx : lda $a9,x : bne .nonZeroHalf tyx : lda $a9,x : bne .nonZeroHalf
lda CamQuadIndex,y : tax : lda $607,x : pha lda CamQuadIndex,y : tax : lda $607,x : pha
@@ -106,21 +105,40 @@ SetCamera:
dec $e3,x dec $e3,x
.noQuadAdj .noQuadAdj
lda $01 : and #$10 : !add $05 : cmp #$10 : beq .done ; zeroHzCam check (10+0 = 10)
lda $01 : and #$20 : !add $05 : cmp #$21 : beq .done ; zeroVtCam check (20+1 = 21)
lda CoordIndex,y : tax lda CoordIndex,y : tax
lda $20,x : cmp #$79 : bcc .adjust lda $20,x : cmp #$79 : bcc .done
!sub #$78 : sta $04 : bra .adjust !sub #$78 : sta $04 : bra .done
.nonZeroHalf ;meaning either right half or bottom half .nonZeroHalf ;meaning either right half or bottom half
lda CoordIndex,y : tax lda CoordIndex,y : tax
lda $20,x : cmp #$78 : bcs .setQuad lda $20,x : cmp #$78 : bcs .setQuad
!add #$78 : sta $04 : bra .adjust lda $01 : and #$10 : !add $05 : cmp #$10 : beq .done ; zeroHzCam check (10+0 = 10)
lda $01 : and #$20 : !add $05 : cmp #$21 : beq .done ; zeroVtCam check (20+1 = 21)
!add #$78 : sta $04 : bra .done
.setQuad .setQuad
lda CamQuadIndex,y : tax : lda $0607, x : pha lda CamQuadIndex,y : tax : lda $0607, x : pha
lda CameraIndex,y : tax : pla : sta $e3, x : bra .done lda CameraIndex,y : tax : pla : sta $e3, x
bra .done
.adjust .done
lda CameraIndex,y : tax lda CameraIndex,y : tax : lda $e2, x : phx
.done lda $04 : sta $e2,x jsr AdjCamBounds
plx : lda $e2, x : !sub $04 : sta $e2, x
rts
}
;input : A should be loaded with current camera low byte
; $04 should be loaded with what we want the low byte to become (00-ff)
AdjCamBounds:
{
stz $05 : rep #$30 : and #$00FF ; sanitize input for 16 bit
!sub $04 : sta $04
lda OppCamBoundIndex,y : tax
lda $0618, x : !sub $04 : sta $0618, x
lda $061A, x : !sub $04 : sta $061A, x
sep #$30
rts rts
} }

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,9 @@
Notes: Notes:
Zero camera out skips quad logic
The armory guard room and the room above have fake layers. Shutter doors
The armory guard room and the room above have fake layers. Maybe not???