Skip to content

Commit 3bfc8a8

Browse files
authored
Merge branch 'master' into mapper_edit
2 parents 4607e67 + 723b8e5 commit 3bfc8a8

File tree

11 files changed

+131
-18
lines changed

11 files changed

+131
-18
lines changed

CHANGELOG.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
## [unreleased]
44
* Crunch Mode
55
* Marathon Mode
6-
* Added hidden score option
7-
* M Scoring changed to just add a millions counter to Classic Scoring
8-
* Famicom Keyboard support
9-
* MMC3 Support
10-
* MMC5 Support
6+
* Hidden Score Mode
7+
* M Score changed to Classic Scoring + Millions counter
118
* Invisible linecap turns entire playfield invisible
129
* Invisible mode preserves original piece colors
1310
* Floor no longer gobbled up by top line clear
1411
* Floor 0 has original no-burns behaviour again
12+
* Fixed ingame score display at 8 million with Classic Scoring
1513
* Fixed CNROM legal screen CHR bank
1614
* Fixed CNROM legal to title flicker
17-
* Fixed ingame score display at 8 million with Classic Scoring
1815
* Block Tool pieces wrap around
1916
* 0001 seeds are ignored
17+
* Famicom Keyboard support
18+
* MMC3 Support
19+
* MMC5 Support
2020

2121
## [v5 tournament]
2222
* Linecap Menu (from CTM Masters September 2022)

src/constants.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ TETRIMINO_X_HIDE := $EF
4040

4141
PAUSE_SPRITE_X := $74
4242
PAUSE_SPRITE_Y := $58
43-
; yobi-style
43+
; jazzthief-style
4444
; PAUSE_SPRITE_X := $C4
4545
; PAUSE_SPRITE_Y := $16
4646

src/gamemode/gametypemenu/menu.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ seedControls:
207207
jmp @skipSeedDown
208208
@lowNybbleDown:
209209
lda set_seed_input, x
210-
clc
211210
tay
212211
and #$F
213212
; cmp #$0 ; and sets z flag
@@ -220,6 +219,7 @@ seedControls:
220219
jmp @skipSeedDown
221220
@noWrapDown:
222221
tya
222+
sec
223223
sbc #1
224224
sta set_seed_input, x
225225
@skipSeedDown:

src/gamemodestate/initstate.asm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ gameModeState_initGameState:
4040
sta linecapState
4141
sta dasOnlyShiftDisabled
4242
sta invisibleFlag
43+
sta currentFloor
44+
45+
; initialize currentFloor if necessary
46+
lda practiseType
47+
cmp #MODE_FLOOR
48+
bne @notFloor
49+
lda floorModifier
50+
sta currentFloor
51+
@notFloor:
4352

4453
lda practiseType
4554
cmp #MODE_INVISIBLE

src/modes/floor.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
advanceGameFloor:
2-
lda floorModifier
2+
lda currentFloor
33
drawFloor:
44
; get correct offset
55
sta tmp1

src/playstate/completedrows.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ playState_checkForCompletedRows:
4545
bne @normalRow
4646

4747
@floorCheck:
48-
lda floorModifier
48+
lda currentFloor
4949
beq @rowNotComplete
5050

5151
@fullRowBurningCheck:
5252
inc activeFloorMode ; Floor is active
5353
lda #$13
5454
sec
5555
sbc generalCounter2 ; contains current row being checked
56-
cmp floorModifier
56+
cmp currentFloor
5757
bcc @rowNotComplete ; ignore floor rows
5858
@normalRow:
5959

@@ -98,7 +98,7 @@ playState_checkForCompletedRows:
9898
beq @incrementLineIndex
9999
lda #$14
100100
sec
101-
sbc floorModifier
101+
sbc currentFloor
102102
tax
103103
ldy multBy10Table,x
104104
ldx #$0A

src/playstate/updatestats.asm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ checkLinecap: ; set linecapState
164164
sta garbageHole
165165
lda #1
166166
sta pendingGarbage
167+
inc currentFloor
167168
@floorLinecapEnd:
168169

169170
addPoints:

src/ram.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ linecapState: .res 1 ; $639 ; 0 if not triggered, 1 + linecapHow otherwise, rese
209209
dasOnlyShiftDisabled: .res 1 ; $63A
210210

211211
invisibleFlag: .res 1 ; $63B ; 0 for normal mode, non-zero for Invisible playfield rendering. Reset on game init and game over.
212+
currentFloor: .res 1 ; $63C floorModifier is copied here at game init. Set to 0 otherwise and incremented when linecap floor.
213+
mapperId: .res 1 ; $63D ; For INES_MAPPER 1000 (autodetect). 0 = CNROM. 1 = MMC1.
212214

213-
mapperId: .res 1 ; $63C ; For INES_MAPPER 1000 (autodetect). 0 = CNROM. 1 = MMC1.
214-
215-
.res $38
215+
.res $37
216216

217217
.if KEYBOARD
218218
newlyPressedKeys: .res 1 ; $0675

tests/src/floor.rs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
use crate::{util, labels, playfield};
2+
3+
pub fn test() {
4+
// check floor 0 doesnt burn lines
5+
6+
let mut emu = util::emulator(None);
7+
8+
for _ in 0..3 {
9+
emu.run_until_vblank();
10+
}
11+
12+
let practise_type = labels::get("practiseType") as usize;
13+
let game_mode = labels::get("gameMode") as usize;
14+
let main_loop = labels::get("mainLoop");
15+
let level_number = labels::get("levelNumber") as usize;
16+
17+
// load floor 0
18+
19+
emu.memory.iram_raw[practise_type] = labels::get("MODE_FLOOR") as _;
20+
emu.memory.iram_raw[level_number] = 18;
21+
emu.memory.iram_raw[game_mode] = 4;
22+
23+
emu.registers.pc = main_loop;
24+
25+
for _ in 0..5 {
26+
emu.run_until_vblank();
27+
}
28+
29+
// setup a tetris
30+
31+
emu.memory.iram_raw[labels::get("currentPiece") as usize] = 0x11;
32+
emu.memory.iram_raw[labels::get("tetriminoX") as usize] = 0x5;
33+
emu.memory.iram_raw[labels::get("tetriminoY") as usize] = 0x11;
34+
emu.memory.iram_raw[labels::get("autorepeatY") as usize] = 0;
35+
36+
playfield::set_str(&mut emu,r##"
37+
##### ####
38+
##### ####
39+
##### ####
40+
##### ####"##);
41+
42+
emu.memory.iram_raw[labels::get("vramRow") as usize] = 0;
43+
44+
for _ in 0..20 {
45+
emu.run_until_vblank();
46+
}
47+
48+
assert_ne!(playfield::get(&mut emu, 0, 19), 0xEF);
49+
}

tests/src/main.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
mod block;
22
mod cycle_count;
3-
mod drought;
43
mod input;
54
mod labels;
5+
mod playfield;
6+
mod util;
7+
mod video;
8+
9+
mod drought;
10+
mod floor;
611
mod pushdown;
712
mod rng;
813
mod score;
914
mod sps;
10-
mod util;
11-
mod video;
1215

1316
use gumdrop::Options;
1417

@@ -39,6 +42,8 @@ fn main() {
3942

4043
// run tests
4144
if options.test {
45+
floor::test();
46+
println!("floor 0 works!");
4247
score::test();
4348
println!("score works!");
4449
score::test_render();

0 commit comments

Comments
 (0)