Skip to content

Commit

Permalink
Fix grenade salvage text and salvage sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
D0ntPanic committed Nov 11, 2015
1 parent 10bf023 commit 8130ced
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 69 deletions.
100 changes: 35 additions & 65 deletions mapper1.asm
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@

.segment "FIXED"

PROC reset_mapper
; Reset the mapper write state
lda #$80
sta $8000

; Init settings (8k CHR, 16k PRG, $8000 swap, vertical)
lda #$0e
PROC write_mapper_8000
sta $8000
lsr
sta $8000
Expand All @@ -33,9 +27,11 @@ PROC reset_mapper
sta $8000
lsr
sta $8000
rts
.endproc

; Set CHR select to 0, disable save RAM for some SNROM boards
lda #$10

PROC write_mapper_a000
sta $a000
lsr
sta $a000
Expand All @@ -45,9 +41,11 @@ PROC reset_mapper
sta $a000
lsr
sta $a000
rts
.endproc

; Map first bank into $8000, disable save RAM until accessing
lda #$10

PROC write_mapper_e000
sta $e000
lsr
sta $e000
Expand All @@ -57,6 +55,26 @@ PROC reset_mapper
sta $e000
lsr
sta $e000
rts
.endproc


PROC reset_mapper
; Reset the mapper write state
lda #$80
sta $8000

; Init settings (8k CHR, 16k PRG, $8000 swap, vertical)
lda #$0e
jsr write_mapper_8000

; Set CHR select to 0, disable save RAM for some SNROM boards
lda #$10
jsr write_mapper_a000

; Map first bank into $8000, disable save RAM until accessing
lda #$10
jsr write_mapper_e000

rts
.endproc
Expand All @@ -82,15 +100,7 @@ nmi:
pla
pha
ora #$10
sta $e000
lsr
sta $e000
lsr
sta $e000
lsr
sta $e000
lsr
sta $e000
jsr write_mapper_e000

lda in_nmi
bne done
Expand All @@ -117,15 +127,7 @@ ramnmi:

pla
pha
sta $e000
lsr
sta $e000
lsr
sta $e000
lsr
sta $e000
lsr
sta $e000
jsr write_mapper_e000

lda in_nmi
bne ramdone
Expand Down Expand Up @@ -164,26 +166,10 @@ nmi:
sta $8000

lda current_bank
sta $e000
lsr
sta $e000
lsr
sta $e000
lsr
sta $e000
lsr
sta $e000
jsr write_mapper_e000

lda #$00
sta $a000
lsr
sta $a000
lsr
sta $a000
lsr
sta $a000
lsr
sta $a000
jsr write_mapper_a000

lda in_nmi
bne done
Expand Down Expand Up @@ -215,26 +201,10 @@ nmi:

lda current_bank
ora #$10
sta $e000
lsr
sta $e000
lsr
sta $e000
lsr
sta $e000
lsr
sta $e000
jsr write_mapper_e000

lda #$10
sta $a000
lsr
sta $a000
lsr
sta $a000
lsr
sta $a000
lsr
sta $a000
jsr write_mapper_a000

lda in_nmi
bne done
Expand Down
7 changes: 3 additions & 4 deletions salvage.asm
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,10 @@ PROC salvage_current_item
lda #^do_salvage_current_item
jsr bankswitch
jsr do_salvage_current_item & $ffff
sta arg0
pla
jsr bankswitch
lda arg0
rts
.endproc

Expand Down Expand Up @@ -747,7 +749,7 @@ getcountstr:
cmp #ITEM_TYPE_GUN
beq ammo
cmp #ITEM_TYPE_GRENADE
beq weapon
beq ammo
cmp #ITEM_TYPE_CRAFTING
beq crafting
cmp #ITEM_TYPE_OUTFIT
Expand All @@ -763,9 +765,6 @@ ammo:
crafting:
LOAD_PTR inventory_crafting_tiles
jmp drawtype & $ffff
weapon:
LOAD_PTR inventory_weapon_tiles
jmp drawtype & $ffff
wearable:
LOAD_PTR inventory_wearable_tiles
jmp drawtype & $ffff
Expand Down

0 comments on commit 8130ced

Please sign in to comment.