Skip to content

Commit 06c6256

Browse files
committed
Merge branch 'feature/loading-screen'
2 parents 0d28a1f + 14fb380 commit 06c6256

File tree

4 files changed

+35
-12
lines changed

4 files changed

+35
-12
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@ src/test/JUNGLE.ASC
6161
src/msx/BASBIN.BIN
6262
src/cli/basbinizer-linux-x64-bin
6363
*.elf
64+
*.ppj
65+
*.ppx
66+
src/cli/basbinizer.tag
67+
test/

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Options:
4343

4444
--quiet suppress messages on screen (except for critical errors)
4545

46+
--addr prints memory address for each line (assumed base address #8000)
47+
4648

4749
The maximum program size for ROM file conversion is 16368 bytes and the variable area must start beyond address #C000. The program will fail if it sets the variable area to any address under #C000 (e.g. by using a CLEAR statement).
4850

src/cli/basbinizer.c

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ void usage(void)
4242
fprintf(options.stdoutf, "\t<screen mode> is the SCREEN mode in MSX-BASIC to be set before loading the screen. Default: 2\n");
4343
fprintf(options.stdoutf, "\nOptions:\n");
4444
fprintf(options.stdoutf, "\t--fix\t\tFixes certain data errors found in the source .BAS file\n");
45-
fprintf(options.stdoutf, "\t--quiet\t\t suppress messages on screen (except for critical errors)\n\n");
45+
fprintf(options.stdoutf, "\t--quiet\t\t suppress messages on screen (except for critical errors)\n");
46+
fprintf(options.stdoutf, "\t--addr\t\t prints memory address for each line (assumed base address #8000)\n\n");
4647

4748
fprintf(options.stdoutf, "ROM files must be under %d bytes and the variable area must start beyond address #C000. The program will fail if it sets the variable area to any address under #C000 (e.g. by using a CLEAR statement)\n\n", MAX_ROM_SIZE);
4849

@@ -162,22 +163,29 @@ bool process_params(int argc, char **argv, options_t *opt)
162163
}
163164
else
164165
{
165-
if ((!strcmp(argv[i], "-a")) && (i < (argc - 1)))
166+
if (!strcmp(argv[i], "--addr"))
166167
{
167-
opt->ascfile = argv[++i];
168+
opt->addr = true;
168169
}
169170
else
170171
{
171-
if ((!strcmp(argv[i], "-r")) && (i < (argc - 1)))
172+
if ((!strcmp(argv[i], "-a")) && (i < (argc - 1)))
172173
{
173-
if (opt->infile_s <= MAX_ROM_SIZE)
174-
{
175-
opt->romfile = argv[++i];
176-
}
177-
else
174+
opt->ascfile = argv[++i];
175+
}
176+
else
177+
{
178+
if ((!strcmp(argv[i], "-r")) && (i < (argc - 1)))
178179
{
179-
strcpy(opt->valerror, "BASIC program is too big to be fitted in a ROM.\n");
180-
return (false);
180+
if (opt->infile_s <= MAX_ROM_SIZE)
181+
{
182+
opt->romfile = argv[++i];
183+
}
184+
else
185+
{
186+
strcpy(opt->valerror, "BASIC program is too big to be fitted in a ROM.\n");
187+
return (false);
188+
}
181189
}
182190
}
183191
}
@@ -563,6 +571,10 @@ void decodeBAS(byte *buffer, off_t size, uint16_t base_addr, FILE *output)
563571
*/
564572
int pos = 1;
565573

574+
if (options.addr) {
575+
fprintf(output, "[#%4x]: ", base_addr+1);
576+
}
577+
566578
while ((link_pointer = get_word_value(buffer + pos)) != 0)
567579
{
568580
/*
@@ -571,6 +583,10 @@ void decodeBAS(byte *buffer, off_t size, uint16_t base_addr, FILE *output)
571583
pos = decodeLine(buffer, pos, size, base_addr, output);
572584

573585
fprintf(output, "\r\n");
586+
if (options.addr) {
587+
fprintf(output, "[#%4x]: ",link_pointer);
588+
}
589+
574590
}
575591
}
576592

src/cli/basbinizer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ typedef long long int off_t;
3636
typedef struct _stat st_stat;
3737
#endif
3838

39-
#define VERSION "1.9.3"
39+
#define VERSION "1.9.5"
4040
#define BIN_LOADER_SIZE 50
4141
#define CAS_LOADER_SIZE 208
4242
#define BIN_PATCH_POS 10
@@ -101,6 +101,7 @@ typedef struct options
101101
bool fix;
102102
bool verbose;
103103
bool quiet;
104+
bool addr;
104105
char *infile;
105106
off_t infile_s;
106107
char *scrfile;

0 commit comments

Comments
 (0)