Skip to content

Commit

Permalink
Work on the first ending. Fix crash due to wrong stack value before e…
Browse files Browse the repository at this point in the history
…ntering game loop.
  • Loading branch information
cadaver committed Feb 4, 2016
1 parent c314dee commit 07390ed
Show file tree
Hide file tree
Showing 18 changed files with 399 additions and 102 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ hessian.d64: hessian.seq loader.prg main.pak options.bin emptysave.bin savelist.
sprplayert.pak sprplayerb.pak sprplayerta.pak sprplayerba.pak \
sprsmallrobots.pak sprhazards.pak sprhazards2.pak spranimals.pak sprmediumrobots.pak sprguard.pak sprheavyguard.pak \
sprcombatrobot.pak sprlargewalker.pak sprlargetank.pak sprhighwalker.pak sprhazmat.pak sprserver.pak sprsecuritychief.pak \
sprrotordrone.pak sprlargespider.pak sprscientist.pak sprhacker.pak
sprrotordrone.pak sprlargespider.pak sprscientist.pak sprhacker.pak sprending.pak
maked64 hessian.d64 hessian.seq HESSIAN___________HE_2A 10
reorder hessian.d64

Expand Down Expand Up @@ -627,4 +627,7 @@ sprhacker.pak: spr/hacker.spr
pchunk2 spr/hacker.spr sprhacker.pak

sprhazmat.pak: spr/hazmat.spr
pchunk2 spr/hazmat.spr sprhazmat.pak
pchunk2 spr/hazmat.spr sprhazmat.pak

sprending.pak: spr/ending.spr
pchunk2 spr/ending.spr sprending.pak
7 changes: 4 additions & 3 deletions actor.s
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ ACT_SCIENTIST3 = 70
ACT_HACKER = 71
ACT_HAZMAT = 72
ACT_COMBATROBOTSABOTEUR = 73
ACT_ENDINGSPRITES = 74

ACT_FIRSTPERSISTENTNPC = ACT_SCIENTIST2

Expand Down Expand Up @@ -369,7 +370,6 @@ DrawActorSub_NoColor:
lda (actLo),y
cmp sprFileNum
beq DA_SameSprFile
sta sprFileNum ;Store spritefilenumber, needed in caching
tay
lda fileHi,y
bne DA_SprFileLoaded
Expand All @@ -378,6 +378,7 @@ DA_SprFileLoaded:
sta sprFileHi
lda fileLo,y
sta sprFileLo
sty sprFileNum
DA_SameSprFile: ldy #AD_NUMSPRITES ;Get number of sprites / humanoid flag
clc
lda (actLo),y
Expand Down Expand Up @@ -414,7 +415,6 @@ DA_HumanRight1: ldy #ADH_BASEINDEX
lda (actLo),y
cmp sprFileNum
beq DA_SameSprFile2
sta sprFileNum
tay
lda fileHi,y
bne DA_SprFileLoaded2
Expand All @@ -423,6 +423,7 @@ DA_SprFileLoaded2:
sta sprFileHi
lda fileLo,y
sta sprFileLo
sty sprFileNum
DA_SameSprFile2:lda temp5
jsr GetAndStoreSprite
DA_HumanWpnF: lda #$00
Expand Down Expand Up @@ -781,7 +782,7 @@ UpdateActors: ldx #$00
lda menuMode
cmp #MENU_PAUSE
bcs UA_Paused
UA_Scroll: ldx #MAX_ACT-1
UA_NoShakeReset:ldx #MAX_ACT-1
UA_Loop: ldy actT,x
beq UA_Next
UA_NotZero: stx actIndex
Expand Down
16 changes: 12 additions & 4 deletions actordata.s
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ actDispTblLo: dc.b <adPlayer
dc.b <adHacker
dc.b <adHazmat
dc.b <adCombatRobot
dc.b <adEndingSprites

actDispTblHi: dc.b >adPlayer
dc.b >adItem
Expand Down Expand Up @@ -199,6 +200,7 @@ actDispTblHi: dc.b >adPlayer
dc.b >adHacker
dc.b >adHazmat
dc.b >adCombatRobot
dc.b >adEndingSprites

adPlayer: dc.b HUMANOID ;Number of sprites
adPlayerBottomSprFile:
Expand Down Expand Up @@ -584,6 +586,10 @@ adHazmat: dc.b HUMANOID ;Number of sprites
dc.b 0 ;Upper part base index into the frametable
dc.b 39 ;Upper part left frame add

adEndingSprites:dc.b ONESPRITEDIRECT ;Number of sprites
dc.b C_ENDING ;Spritefile number
dc.b 0 ;Base spritenumber

; Actor logic data

actLogicTblLo: dc.b <alPlayer
Expand Down Expand Up @@ -651,14 +657,15 @@ actLogicTblLo: dc.b <alPlayer
dc.b <alAcid
dc.b <alScrapMetal
dc.b <alArmorer
dc.b <alThroneChief
dc.b <alDoNothing
dc.b <alMediumWalker
dc.b <alScientist1
dc.b <alScientist23
dc.b <alScientist23
dc.b <alHacker
dc.b <alScientist23
dc.b <alCombatRobotSaboteur
dc.b <alDoNothing

actLogicTblHi: dc.b >alPlayer
dc.b >alItem
Expand Down Expand Up @@ -725,14 +732,15 @@ actLogicTblHi: dc.b >alPlayer
dc.b >alAcid
dc.b >alScrapMetal
dc.b >alArmorer
dc.b >alThroneChief
dc.b >alDoNothing
dc.b >alMediumWalker
dc.b >alScientist1
dc.b >alScientist23
dc.b >alScientist23
dc.b >alHacker
dc.b >alScientist23
dc.b >alCombatRobotSaboteur
dc.b >alDoNothing

alPlayer: dc.w MovePlayer ;Update routine
dc.b GRP_HEROES|AF_ORGANIC|AF_NOREMOVECHECK|AF_INITONLYSIZE ;Actor flags
Expand Down Expand Up @@ -1577,8 +1585,8 @@ alGenerator: dc.w MoveGenerator ;Update routine
dc.w RemoveActor ;Destroy routine
dc.b 0 ;Initial health

alThroneChief: dc.w DoNothing ;Update routine
dc.b AF_INITONLYSIZE ;Actor flags
alDoNothing: dc.w DoNothing ;Update routine
dc.b AF_INITONLYSIZE|AF_NOREMOVECHECK ;Actor flags

alMediumWalker: dc.w MoveWalker ;Update routine
dc.b GRP_ENEMIES|AF_NOWEAPON ;Actor flags
Expand Down
7 changes: 3 additions & 4 deletions aligneddata.s
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
shiftOffsetTbl: dc.b 6,6,6
dc.b 0,0,0
dc.b 6,6,6

org (* + $ff) & $ff00

; Sprite cache / depacking tables
Expand Down Expand Up @@ -398,6 +394,9 @@ fileAge: ds.b MAX_CHUNKFILES,0
; Remaining data

d018Tbl: dc.b GAMESCR1_D018,GAMESCR2_D018,TEXTSCR_D018
shiftOffsetTbl: dc.b 6,6,6
dc.b 0,0,0
dc.b 6,6,6

; Gameworld & level data (not saved)

Expand Down
Binary file modified bg/world.map
Binary file not shown.
Binary file modified bg/world02.map
Binary file not shown.
Binary file modified bg/world15.blk
Binary file not shown.
Binary file modified bg/world15.chc
Binary file not shown.
Binary file modified bg/world15.chi
Binary file not shown.
Binary file modified bg/world15.chr
Binary file not shown.
4 changes: 2 additions & 2 deletions hessian.seq
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ charset01.pak 13
charset03.pak 15
charset13.pak 1F
level02.pak 04
charset15.pak 21
level04.pak 06
level15.pak 11
charset05.pak 17
Expand Down Expand Up @@ -74,7 +73,6 @@ sprlargetank.pak 41
sprhighwalker.pak 42
sprserver.pak 43
sprhazmat.pak 44
sprending.pak 45
music00.pak 22
script02.pak 48
script03.pak 49
Expand All @@ -101,6 +99,8 @@ script21.pak 5B
script22.pak 5C
script23.pak 5D
script24.pak 5E
charset15.pak 21
sprending.pak 45
music02.pak 24
music03.pak 25
main.pak 01
2 changes: 0 additions & 2 deletions init.s
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ IVid_InitScorePanel:
; Relies on loader init to have already disabled the timer interrupt

InitRaster: sei
ldx #$ff
txs
ldy #$35
sty irqSave01
dey
Expand Down
2 changes: 1 addition & 1 deletion memory.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MAX_SPR = 24
MAX_ACT = 22
MAX_COMPLEXACT = 7
MAX_CACHESPRITES = 64
MAX_CHUNKFILES = 27
MAX_CHUNKFILES = 28
MAX_MAPROWS = 128
MAX_BLK = 192
MAX_LVLDATAACT = 80 ;Defined actors per level, on/off persistency
Expand Down
2 changes: 1 addition & 1 deletion script00.s
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ IP_CodeLoop: if CODE_CHEAT > 0
lda #<EP_ENDSEQUENCE
ldx #>EP_ENDSEQUENCE
ldy #ENDING_TEST-1
jmp ExecScript
jmp ExecScriptParam
else
if START_LEVEL = $00 && START_Y = $1b00
lda #<EP_INTROCUTSCENE ;Intro works right only in the official start location
Expand Down
3 changes: 1 addition & 2 deletions script18.s
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,12 @@ DTM_RedrawBG: lda scrollOffset
sta temp1
ldx #$00
DTM_RedrawLoop: lda screen2+$100,x
beq DTM_RedrawSkip1
jsr DTM_GetTunnelChar
sta screen2+$100,x
tay
lda charColors,y
sta colors+$100,x
DTM_RedrawSkip1:lda screen2+$200,x
beq DTM_RedrawSkip2
jsr DTM_GetTunnelChar
sta screen2+$200,x
tay
Expand Down Expand Up @@ -489,6 +487,7 @@ DTM_DelayLoop: jsr WaitBottom
bpl DTM_DelayLoop
rts
DTM_GetTunnelChar:
beq DTM_GTCDone
cmp #25
bcs DTM_GTCDone
txa
Expand Down
Loading

0 comments on commit 07390ed

Please sign in to comment.