Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if (args.includes('-h')) {

-m mapper
-a faster aeppoz + press select to end game
-A build anydas
-s disable highscores/SRAM
-k Famicom Keyboard support
-w force WASM compiler
Expand Down Expand Up @@ -88,6 +89,11 @@ if (args.includes('-o')) {
console.log('cnrom override for autodetect');
}

if (args.includes('-A')) {
compileFlags.push('-D', 'ANYDAS=1');
console.log('anydas enabled');
}

// pass additional arguments to ca65
if (args.includes('--')) {
const ca65Flags = args.slice(1+args.indexOf('--'));
Expand All @@ -100,6 +106,7 @@ console.log();
// build / compress nametables

console.time('nametables');
process.env['GYM_FLAGS'] = compileFlags.join(' ');
require('./src/nametables/build');
console.timeEnd('nametables');

Expand Down
6 changes: 6 additions & 0 deletions src/boot.asm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@
sta paceModifier

lda #$10
.if ANYDAS <> 1
sta dasModifier
.else
sta anydasDASValue
lda #$06
sta anydasARRValue
.endif

lda #INITIAL_LINECAP_LEVEL
sta linecapLevel
Expand Down
26 changes: 25 additions & 1 deletion src/constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ KEYBOARD := 0
CNROM_OVERRIDE := 0
.endif

.ifndef ANYDAS
ANYDAS = 0
.endif

NO_MUSIC := 1

; dev flags
Expand Down Expand Up @@ -81,7 +85,9 @@ MODE_TAPQTY
MODE_CHECKERBOARD
MODE_GARBAGE
MODE_DROUGHT
.if ANYDAS <> 1
MODE_DAS
.endif
MODE_LOWSTACK
MODE_KILLX2
MODE_INVISIBLE
Expand All @@ -98,12 +104,19 @@ MODE_DARK
MODE_GOOFY
MODE_DEBUG
MODE_LINECAP
.if ANYDAS <> 1
MODE_DASONLY
.endif
MODE_QUAL
MODE_PAL
.if ANYDAS = 1
MODE_DAS_VALUE
MODE_ARR_VALUE
MODE_ARE_CHARGE
.endif
MODE_QUANTITY
.endenum

MODE_QUANTITY = MODE_PAL + 1
MODE_GAME_QUANTITY = MODE_HARDDROP + 1

SCORING_CLASSIC := 0 ; for scoringModifier
Expand Down Expand Up @@ -149,7 +162,9 @@ MENU_TOP_MARGIN_SCROLL := 7 ; in blocks
.byte $8 ; MODE_CHECKERBOARD
.byte $4 ; MODE_GARBAGE
.byte $12 ; MODE_DROUGHT
.if ANYDAS <> 1
.byte $10 ; MODE_DAS
.endif
.byte $12 ; MODE_LOWSTACK
.byte $0 ; MODE_KILLX2
.byte $0 ; MODE_INVISIBLE
Expand All @@ -166,9 +181,16 @@ MENU_TOP_MARGIN_SCROLL := 7 ; in blocks
.byte $1 ; MODE_GOOFY
.byte $1 ; MODE_DEBUG
.byte $1 ; MODE_LINECAP
.if ANYDAS <> 1
.byte $1 ; MODE_DASONLY
.endif
.byte $1 ; MODE_QUAL
.byte $1 ; MODE_PAL
.if ANYDAS = 1
.byte $40 ; MODE_DAS_VALUE
.byte $40 ; MODE_ARR_VALUE
.byte $2 ; MODE_ARE_CHARGE
.endif
.endmacro

.macro MODENAMES
Expand All @@ -188,7 +210,9 @@ MENU_TOP_MARGIN_SCROLL := 7 ; in blocks
.byte "CKRBRD"
.byte "GARBGE"
.byte "LOBARS"
.if ANYDAS <> 1
.byte "DASDLY"
.endif
.byte "LOWSTK"
.byte "KILLX2"
.byte "INVZBL"
Expand Down
31 changes: 31 additions & 0 deletions src/gamemodestate/updateplayer1.asm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,38 @@ gameModeState_updatePlayer1:
jsr checkDebugGameplay
jsr practiseAdvanceGame
jsr practiseGameHUD
.if ANYDAS = 1
; do nothing while piece is active (playstate = 1)
ldx playState
dex
beq @branchOnPlaystate
; do nothing if not kitaru charge
lda anydasARECharge
cmp #2
bne @branchOnPlaystate
; do nothing when down is held
lda heldButtons
and #BUTTON_DOWN
bne @branchOnPlaystate
; reset das on new input
lda newlyPressedButtons
and #BUTTON_LEFT|BUTTON_RIGHT
bne @resetDas
lda heldButtons
and #BUTTON_LEFT|BUTTON_RIGHT
beq @branchOnPlaystate
; charge das (unless charged)
ldx autorepeatX
dex
beq @branchOnPlaystate
dec autorepeatX ; will clear zero flag
bne @branchOnPlaystate
@resetDas:
lda anydasDASValue
sta autorepeatX
@branchOnPlaystate:
jsr branchOnPlayStatePlayer1
.endif
jsr stageSpriteForCurrentPiece
jsr stageSpriteForNextPiece

Expand Down
2 changes: 2 additions & 0 deletions src/modes/hz.asm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ hzTap:
lda #0
sta hzDebounceCounter

.if ANYDAS <> 1
lda dasOnlyFlag
beq :+
lda #0
Expand All @@ -104,6 +105,7 @@ hzTap:
lda #1
sta dasOnlyShiftDisabled
:
.endif

; ignore 1 tap
lda hzTapCounter
Expand Down
135 changes: 68 additions & 67 deletions src/nametables/game_type_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const {
flatLookup,
} = require('./nametables');

const anydas = !!process.env['GYM_FLAGS']?.match(/-D ANYDAS=1/);

const lookup = flatLookup(`
0123456789ABCDEF
GHIJKLMNOPQRSTUV
Expand All @@ -29,71 +31,72 @@ WXYZ-,˙>########
const buffer = blankNT();
const extra = [...buffer];

drawTiles(buffer, lookup, `
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a TETRIS d#
#a T-SPINS d#
#a SEED d#
#a STACKING d#
#a PACE d#
#a SETUPS d#
#a B-TYPE d#
#a FLOOR d#
#a CRUNCH d#
#a (QUICK)TAP d#
#a TRANSITION d#
#a MARATHON d#
#a TAP QUANTITY d#
#a CHECKERBOARD d#
#a GARBAGE d#
#a DROUGHT d#
#a DAS DELAY d#
#a LOW STACK d#
#a KILLSCREEN »2 d#
#a INVISIBLE d#
#a HARD DROP d#
`);drawTiles(extra, lookup, `
#a TAP/ROLL SPEED d#
#a SCORING d#
#a CRASH d#
#a STRICT CRASH d#
#a HZ DISPLAY d#
#a INPUT DISPLAY d#
#a DISABLE FLASH d#
#a DISABLE PAUSE d#
#a DARK MODE d#
#a GOOFY FOOT d#
#a BLOCK TOOL d#
#a LINECAP d#
#a DAS ONLY d#
#a QUAL MODE d#
#a PAL MODE d#
#a d#
#a d#
#a V6 d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
#a d#
`);
modes = `
TETRIS
T-SPINS
SEED
STACKING
PACE
SETUPS
B-TYPE
FLOOR
CRUNCH
(QUICK)TAP
TRANSITION
MARATHON
TAP QUANTITY
CHECKERBOARD
GARBAGE
DROUGHT
DAS DELAY
LOW STACK
KILLSCREEN »2
INVISIBLE
HARD DROP
TAP/ROLL SPEED
SCORING
CRASH
STRICT CRASH
HZ DISPLAY
INPUT DISPLAY
DISABLE FLASH
DISABLE PAUSE
DARK MODE
GOOFY FOOT
BLOCK TOOL
LINECAP
DAS ONLY
QUAL MODE
PAL MODE
`
.trim()
.split('\n');

if (anydas) {
modes.splice(modes.indexOf('DAS DELAY'), 1);
modes.splice(modes.indexOf('DAS ONLY'), 1);
modes.push('DAS', 'ARR', 'ENTRY CHARGE');
}

const modeStartRow = 9;
const modeOffset = 6;
const modeIdx = modeStartRow * 32 + modeOffset;

const urlX = 3;
const urlY = 17;

menuScreens = [...Array(30 * 2)]
.map(() => '#a d#'.split(''))
.flat();

modes.forEach((mode, i) =>
menuScreens.splice(i * 32 + modeIdx, mode.length, ...mode),
);

menuScreens.splice((30 + urlY) * 32 + urlX, 2, ...'V6');

drawTiles(buffer, lookup, menuScreens.splice(0, 32*30).join(''));
drawTiles(extra, lookup, menuScreens.join(''));

const background = `
ɢ##############################ɳ
Expand Down Expand Up @@ -133,8 +136,6 @@ drawTiles(extra, lookup, background);

drawRect(buffer, 8, 2, 10, 5, 0xB0); // draw logo

const urlX = 3;
const urlY = 17;
drawRect(extra, urlX, urlY, 12, 1, 0x74);
drawRect(extra, urlX+12, urlY, 12, 1, 0x84);

Expand Down
Loading