Skip to content

Commit

Permalink
Add twoplayer-garbage convenience IPS
Browse files Browse the repository at this point in the history
  • Loading branch information
ejona86 committed Nov 1, 2020
1 parent be26310 commit 0f891bc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
all: tetris taus screens custom handicap twoplayer playerid build/game_palette.pal build/menu_palette.pal build/game_nametable.nam build/level_menu_nametable.nam
all: tetris taus screens custom handicap twoplayer twoplayer-garbage playerid build/game_palette.pal build/menu_palette.pal build/game_nametable.nam build/level_menu_nametable.nam
test: build/tetris-test build/taus-test.test build/chart-test.test build/twoplayer-test.test
# These are simply aliases
.PHONY: all dis tetris taus screens custom handicap twoplayer playerid
.PHONY: all dis tetris taus screens custom handicap twoplayer twoplayer-garbage playerid

dis: build/tetris-PRG.s

Expand Down Expand Up @@ -92,6 +92,17 @@ build/twoplayer-test.test: twoplayer-test.lua build/twoplayer.nes
build/twoplayer-pal.nes.cfg: twoplayer.nes.cfg ntsc2pal.awk | build
awk -f ntsc2pal.awk $< > $@

twoplayer-garbage: build/twoplayer-garbage.nes
# For .o files, manually list prerequisites that are generated. Non-generated
# files will automatically be computed
build/twoplayer-garbage.o: build/tetris.inc
# Detect IPS hunks. These .o files used ips_segments in their .s
build/twoplayer-garbage.ips.cfg: build/twoplayer-garbage.o
# Linker dependencies. There is a corresponding .cfg file
build/twoplayer-garbage.ips: build/twoplayer-garbage.o build/ips.o
# IPS base file. There is a corresponding .ips file
build/twoplayer-garbage.nes: build/twoplayer.nes

custom: build/custom.nes
build/custom.nes: build/taus.ips build/highscores.ips build/playerid.ips
build/custom.nes: build/tetris.nes
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ of lines.
[![Next on top](media/twoplayer-top.thumb.png)](media/twoplayer-top.aspect.png)

The twoplayer mod allows two simultaneous players to play while receiving the
same pieces. Garbage is not sent between players.
same pieces. Garbage is not sent between players by default. The GameGenie code
KUTPUX or the twoplayer-garbage IPS enables garbage.

There are two variations of the mod. One shows the next piece on the side,
which makes it easier to see with peripheral vision. The other shows it on top,
Expand Down
13 changes: 13 additions & 0 deletions twoplayer-garbage.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
;
; Mod that enables garbage for twoplayer mod
;

.include "ips.inc"
.include "build/tetris.inc"

.segment "ADD_GARBAGE"
ips_segment "ADD_GARBAGE",$9AE2

; The twoplayer mod disables garbage by throwing away the garbage here.
; This reverts the change.
sta pendingGarbageInactivePlayer

0 comments on commit 0f891bc

Please sign in to comment.