Some spiral layers fixed

Some spiral camera bounds fixed
This commit is contained in:
randall.rupper
2019-09-06 09:13:49 -06:00
parent eb3b1eaa44
commit 02b3ca5d52
6 changed files with 48 additions and 33 deletions

View File

@@ -72,7 +72,7 @@ def create_doors(world, player):
create_small_key_door(player, 'Sewers Key Rat Key Door N', DoorType.Normal, Direction.North, 0x21, Right, High),
create_small_key_door(player, 'Sewers Secret Room Key Door S', DoorType.Normal, Direction.South, 0x11, Right, High),
create_spiral_stairs(player, 'Sewers Secret Room Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x11, 0, High, S, 0x37, 0x78),
create_spiral_stairs(player, 'Sewers Pull Switch Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x02, 0, High, S, 0x1f, 0x78),
create_spiral_stairs(player, 'Sewers Pull Switch Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x02, 0, Low, S, 0x1f, 0x78),
create_toggle_door(player, 'Sewers Pull Switch S', DoorType.Normal, Direction.South, 0x02, Mid, Low),
# logically one way the sanc, but should be linked - also toggle
create_blocked_door(player, 'Sanctuary N', DoorType.Normal, Direction.North, 0x12, Mid, 0, True),

2
Rom.py
View File

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

View File

@@ -335,5 +335,10 @@ CamBoundIndex: ; Horizontal 1st
db 0, 4 ; Camera Bounds $0618-$61f
OppCamBoundIndex: ; Horizontal 1st
db 4, 0 ; Camera Bounds $0618-$61f
CamBoundBaseLine: ; X camera stuff is 1st column todo Y camera is not right yet
dw $007f, $0077 ; Left/Top camera bounds when at edge or layout frozen
dw $0007, $000b ; Left/Top camera bounds when not frozen + appropriate low byte $22/$20 (preadj. by #$78/#$6c)
dw $00ff, $010b ; Right/Bot camera bounds when not frozen + appropriate low byte $20/$22
dw $017f, $0187 ; Right/Bot camera bound when at edge or layout frozen
incsrc doortables.asm

View File

@@ -1,6 +1,4 @@
SpiralWarp:
{
SpiralWarp: {
pha : lda $040c : cmp.b #$ff : beq .abort ; abort if not in dungeon
cmp #$06 : bcs .abort ; abort if not supported yet -- todo: this needs to be altered/removed as more dungeons are implemented
lda $0e : cmp #$5e : beq .gtg ; abort if not spiral - intended room is in A!
@@ -34,7 +32,9 @@ SpiralWarp:
lda $02 : sta $22
lda $03 : sta $20
lda $01 : and #$10 : sta $07 ; zeroHzCam check
ldy #$00 : jsr SetCamera
lda $01 : and #$20 : sta $07 ; zeroVtCam check
ldy #$01 : jsr SetCamera
ply : plx : plb ; pull the stuff we pushed
@@ -47,8 +47,7 @@ SpiralWarp:
}
;Sets the offset in A
LookupSpiralOffset:
{
LookupSpiralOffset: {
;where link currently is in $a2: quad in a8 & #$03
;count doors
stz $00 : ldx #$00 : stz $01
@@ -85,8 +84,7 @@ LookupSpiralOffset:
rts
}
ShiftQuadSimple:
{
ShiftQuadSimple: {
lda CoordIndex,y : tax
lda $21,x : !add $06 : sta $21,x ; coordinate update
lda CamQuadIndex,y : tax
@@ -95,8 +93,7 @@ ShiftQuadSimple:
rts
}
SetCamera:
{
SetCamera: {
stz $04 : sty $05
tyx : lda $a9,x : bne .nonZeroHalf
@@ -105,40 +102,43 @@ SetCamera:
dec $e3,x
.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 $07 : bne .adj0
lda CoordIndex,y : tax
lda $20,x : cmp #$79 : bcc .done
!sub #$78 : sta $04 : bra .done
lda $20,x : cmp #$79 : bcc .adj0
!sub #$78 : sta $04
tya : asl : !add #$04 : tax : jsr AdjCamBounds : bra .done
.adj0
tya : asl : tax : jsr AdjCamBounds : bra .done
.nonZeroHalf ;meaning either right half or bottom half
lda CoordIndex,y : tax
lda $20,x : cmp #$78 : bcs .setQuad
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
lda $07 : bne .adj1
!add #$78 : sta $04
tya : asl : !add #$08 : tax : jsr AdjCamBounds : bra .done
.setQuad
lda CamQuadIndex,y : tax : lda $0607, x : pha
lda CameraIndex,y : tax : pla : sta $e3, x
bra .done
.adj1
tya : asl : !add #$0c : tax : jsr AdjCamBounds : bra .done
.done
lda CameraIndex,y : tax : lda $e2, x : phx
jsr AdjCamBounds
plx : lda $e2, x : !sub $04 : sta $e2, x
lda CameraIndex,y : tax : lda $e2, x
lda $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
; input, expects X to be an appropriate offset into the CamBoundBaseLine table
; when $04 is 0 no coordinate are added
AdjCamBounds: {
rep #$20 : lda CamBoundBaseLine, x : sta $05
lda $04 : and #$00ff : beq .common
lda CoordIndex,y : tax
lda $20, x : and #$00ff : !add $05 : sta $05
.common
lda OppCamBoundIndex,y : tax
lda $0618, x : !sub $04 : sta $0618, x
lda $061A, x : !sub $04 : sta $061A, x
sep #$30
lda $05 : sta $0618, x
inc #2 : sta $061A, x : sep #$20
rts
}

File diff suppressed because one or more lines are too long

View File

@@ -13,4 +13,14 @@ Notes 2:
(Fixed partially )Guardroom N Door is set to $8000, I think it was supposed to be Eastern Compass Area SW $02a8 that how this get teleported back to HC. Wrong room index. Still might be a toggle door
(Fixed) Courtyard N is set to $02D8 - typo
(Fixed) Sanc N is $0650 but should be $0250 which I think is right. typo again on the wrong layer
(Fixed) Eastern boss had wrong room
(Fixed) Eastern boss had wrong room
Pairing Notes
30-34 4f-37 #$18,-24
30-34 37-1f #$18,-24
30-34 1f-1f???
30-35 1f-1f
30-34 36-1e #$18,-24
30-34 1e-1f
inconsistencies are caused by $0492 being set wrong