File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,19 @@ const { spawnSync } = require('child_process');
6
6
console . log ( 'TetrisGYM buildscript' ) ;
7
7
console . time ( 'build' ) ;
8
8
9
- const mappers = [ 1 , 3 , 4 , 5 ] ;
9
+ const mappers = { // https://www.nesdev.org/wiki/Mapper
10
+ 1 : 'MMC1' ,
11
+ 3 : 'CNROM' ,
12
+ 4 : 'MMC3' ,
13
+ 5 : 'MMC5' ,
14
+ } ;
10
15
11
16
// options handling
12
17
13
18
const args = process . argv . slice ( 2 ) ;
14
19
15
20
if ( args . includes ( '-h' ) ) {
16
- console . log ( `usage: node build.js [-h] [-v] [-m<${ mappers . join ( '|' ) } >] [-a] [-s] [-k] [-w]
21
+ console . log ( `usage: node build.js [-h] [-v] [-m<${ Object . keys ( mappers ) . join ( '|' ) } >] [-a] [-s] [-k] [-w]
17
22
18
23
-m mapper
19
24
-a faster aeppoz + press select to end game
@@ -44,9 +49,9 @@ console.log(`using ${nativeCC65 ? 'system' : 'wasm'} ca65/ld65`);
44
49
45
50
const mapper = args . find ( ( d ) => d . startsWith ( '-m' ) ) ?. slice ( 2 ) ?? 1 ;
46
51
47
- if ( ! mappers . includes ( + mapper ) ) {
52
+ if ( ! mappers [ mapper ] ) {
48
53
console . error (
49
- `Invalid INES_MAPPER - options are ${ mappers
54
+ `invalid INES_MAPPER - options are ${ Object . keys ( mappers )
50
55
. map ( ( d ) => `-m${ d } ` )
51
56
. join ( ', ' ) } `,
52
57
) ;
@@ -57,7 +62,7 @@ if (!mappers.includes(+mapper)) {
57
62
58
63
compileFlags . push ( '-D' , `INES_MAPPER=${ mapper } ` ) ;
59
64
60
- console . log ( `using mapper ${ mapper } ` ) ;
65
+ console . log ( `using ${ mappers [ mapper ] } ` ) ;
61
66
62
67
if ( args . includes ( '-a' ) ) {
63
68
compileFlags . push ( '-D' , 'AUTO_WIN=1' ) ;
You can’t perform that action at this time.
0 commit comments