gbdev / rgbds Goto Github PK
View Code? Open in Web Editor NEWRednex Game Boy Development System - An assembly toolchain for the Nintendo Game Boy and Game Boy Color
Home Page: https://rgbds.gbdev.io
License: MIT License
Rednex Game Boy Development System - An assembly toolchain for the Nintendo Game Boy and Game Boy Color
Home Page: https://rgbds.gbdev.io
License: MIT License
Section names don't carry over between objects. Perhaps this is for the best, but it would be nice to influence section order between several objects.
rgbasm predefined macros are not described in man page. The man pages are not yet a complete replacement for the old HTML docs.
string equs "anything"
string equs "anything"
string
rgbasm will accept the following without complaint if string
is not referenced:
string equs "anything"
string equs "anything"
If the equates don't match, rgbasm will raise Buffer safety margin exceeded
:
string equs "anything"
string equs "anything else"
Definition:
foo_struct: STRUCT foo, bar
Declaration:
foo_struct Name, $01, $2345
Use:
dbw Name.foo, Name.bar
I'm working on a submission to homebrew Homebrew/legacy-homebrew#32647. By default they use a parallel build. I found that when homebrew tries to build rgbds in parallel it fails.
To build in parallel use the following:
make -j4
MBC5 supports more than 4 SRAM banks, which I would like to use in some homebrew I'm developing. My EMS flash cart in particular has 128 kiB of SRAM.
$ rgblib foo add bar
Library 'foo' opened
Added module 'bar'
Library 'foo' closed
$ rgblib foo delete bar
Library 'foo' opened
Segmentation fault (core dumped)
Happens every time.
As is, symbols (labels) which aren't referenced aren't written in the symfile. An option to write them all would be nice.
Are link files supported at all anymore? I'm trying to link RGBGrafx into my project, but passing the link file by calling rgblink LinkFileName
outputs rgblink: 'LinkFileName' is not a valid object, as if it is expecting an object file. The command line arguments seem to have changed significantly, but the HTML documentation is not up-to-date.
#7 broke dmg in the process
one way to fix is to assume wram0 is 0x2000 long in the absence of wramx sections
Currently the BSS section type supports WRAM banks 0-1 ($c000-$dfff) which works perfectly for compiling DMG. CGB introduces WRAM banks 2-7, which the current implementation can't account for. The same complication exists with CGB's VRAM bank 1.
Since it works the same way, I'd like to request SRAM allocation as well. Maybe that should have its own issue.
MOVES EQU [$24, $3a]
db LENGTH(MOVES)
db MOVES[0], MOVES[1]
Is there any chance for something like this to happen at all? Is it even a good idea?
Should be made to work for strings too.
POKEMON_NAMES EQU ["BULBASAUR", "IVYSAUR"]
db "So you want ", POKEMON_NAMES[STARTER1], "?@"
Another jp [hl]
case.
ld hl, [sp+$nn]
should be ld hl, sp+$nn
. Support both for legacy.
Maybe warnings could be produced for old variants?
rgbasm tends to segfault on OpenBSD (not on Linux) when assembling anything non-trivial. It is inconsistent—reinvoking rgbasm five or six times generally results in at least one successful compile.
The issue seems to be with the toupper() on line 396 of src/asm/lexer.c.
Implement HIGH() and LOW() functions that take a 16-bit register and return the appropriate 8-bit register.
HIGH(hl) → h
LOW(bc) → c
This would make the creation of macros that take 16-bit registers and work with their 8-bit partitions possible.
Example script;
Function1:
ld a, 1
.subscript
and a
ret z
scf
ret
Function2:
xor a
jp .subscript
Result: Segmentation fault
. No additional information is available, and it can be a struggle to try and find the offender.
What I'd like to see is: Symbol "Function2.subscript" not found.
This at least tells the user where to start looking.
There is no document for rgbfix, though other documents refers to it as "fix.htm"
Given the following code:
SECTION "Test WRAM", WRAM0
wc000::
SECTION "Test ROM", HOME
RST_00::
ld a, BANK(wc000)
ret
Expected result:
0000: 3e 00 c9 ...
Error message: Value must be 8-bit
The newly added test/asm/divzero-section-bank.asm
crashes.
Starting program: /home/anthony/bin/rgbasm divzero-section-bank.asm
Program received signal SIGFPE, Arithmetic exception.
0x0000073742b06bc0 in yyparse () at asmy.y:995
995 asmy.y: No such file or directory.
in asmy.y
A__ = -1
test_1: macro
db \1_\1_\1
endm
test_2: macro
db \1_\2_\3
endm
section "main", rom0
test_1 A ; -1
test_2 A, B, C ; -1
Numbers are weirder:
test_3: macro
db \11
endm
test_4: macro
db -\1
endm
test_5: macro
db 1\12
endm
test_6: macro
db 1\1
endm
section "main", rom0
test_3 1 ; 11
test_4 1 ; -1
test_5 - ; -1
test_5 1 ; syntax error
test_6 1 ; syntax error
Suggested solution: write gbz80(7), a list of opcodes and their flags (like gbcpu_instr).
yacc warns about some conflicts and then chooses whatever default it seems was more likely intended. We should remove those conflicts.
I don't understand the yacc language that well, but here's what I was able to figure out.
1. const : T_ID { $$ = sym_GetConstantValue($1); }
| const T_OP_SUB const { $$ = $1 - $3; }
| T_ID T_OP_SUB T_ID { $$ = sym_GetDefinedValue($1) - sym_GetDefinedValue($3); }
2. constlist_8bit_entry : { out_Skip( 1 ); }
| const_8bit { out_RelByte( &$1 ); }
| string { char *s; int length; s = $1; length = charmap_Convert(&s); out_AbsByteGroup(s, length); free(s); }
(const_8bit contains relocconst which contains string)
In WLA-DX I can have an enumeration where OAM RAM is defined ($FE00). RGBDS doesn't appear to have enums or a section that can reach that point. Can there be one?
would be nice
Getting this as an output of make
src/gfx/png.c:166:2: error: implicit declaration of function 'png_set_quantize'
is invalid in C99 [-Werror,-Wimplicit-function-declaration]
png_set_quantize(img->png, palette, colors, colors, NULL, 1);
portions of bss can be repurposed between program states. this generally involves overlapping sets of labels. this occurs in commercial software
wram banks can act as ghost banks for address space 0xd000-0xdfff, but 0xc000-0xcfff is mapped to one bank only. an example workaround is to define constants in place of would-be ghost labels. however, the start point must be set manually, since constants must be evaluated before linking
there is potential for a lot of unneeded complexity, so this would be a good place to hash out how it could work
section wram0
wSomething:
ds 100
wGhostArea:
ds 5
wGhostAreaSubset:
ds 5
section wram0 [wGhostArea], ghost
wGhostedArea:
ds 10
section wram0 [wGhostArea], ghost [1] ; multiple ghost banks
wAnotherGhostedArea:
ds 20
section wram0 [wAnotherGhostedArea] ; a ghost of a ghost
ds 30
what if starting from a relocatable was interpreted as a ghost section in the first place? is that too implicit? how would the linker know which ghost bank to put it in?
section wram0 [wGhostArea]
other section features to consider in the context of ghosting:
https://github.com/RenaKunisaki/pokered
This had been building fine a while ago, but after merging a newer version of the original pokered and fixing some labels, rgblink segfaults when running make red
.
As mentined here (stag019@a15ab65#commitcomment-9195341), reallocarray() needs to be implemented.
At present, the if_skip_to_else()
, if_skip_to_endc()
, copymacro()
and copyrept()
functions in asmy.y
continue to read an IF
, MACRO
or REPT
block until they either reach their corresponding ENDC
/ENDR
/ENDM
, or the end of the file is reached.
Such unterminated sections are likely to be erroneous, causing further headaches whilst trying to fix them down the line. Also, the copymacro()
and copyrept()
functions currently assume that an ENDR
or ENDM
is scanned, which can cause memory allocation failures and segmentation faults if the file ends shortly afterwards (this was exacerbated by the tests in #50).
As a result, I propose that an error is displayed to the user when such a circumstance arises, along the lines of No ENDM found for MACRO
. This shouldn't be tricky to implement, and I'd be surprised if this caused any problems for existing projects. Any thoughts on this before I go look into implementing it?
RGBASM dies when an assembled portion exceeds the maximum size of a bank or section, however the message it outputs is completely uninformative. Specifically, it does not inform the user as to which line caused the overflow at compile time. This issue serves as a request to implement this information in the error message for bank/section overflows.
make install
fails with an issue relating to copying man files. I tried to use "MANPREFIX=#{man}" (man is a variable representing "/usr/local/Cellar/rgbds/0.1.0/share/man") and it fails with the following:
==> make install MANPREFIX=/usr/local/Cellar/rgbds/0.1.0/share/man
install: /usr/local/Cellar/rgbds/0.1.0/share/man/
/usr/local/Cellar/rgbds/0.1.0/share/man/man7/rgbds.7: No such file or directory
Installing manpages to /usr/local/Cellar/rgbds/0.1.0/share/man failed.
I have a disassembly that uses the instruction
ldi a,[hl]
rgbasm tells me
rgbasm -i src/ -o src/main.o src/main.asm
ERROR: src/main.asm(1644) :
syntax error
C:\MinGW\msys\1.0\bin\rgbasm.exe: Assembly aborted in pass 1 (1 errors)!
make: *** [src/main.o] Error 1
Right now I am working past that by doing
db $2A ; ldi a,[hl]
I'm having trouble using macros with rgbasm. If I define a macro and call it, the assembler seems to think I'm trying to define it twice.
Foo: MACRO
ENDM
Foo
Assembling this snippet outputs the error 'Foo' already defined. Am I missing something here?
The newly added test/asm/divzero-instr.asm
crashes.
Starting program: /home/anthony/bin/rgbasm bar.asm
Program received signal SIGFPE, Arithmetic exception.
0x00000bbb2660cd0c in rpn_DIV (expr=0xbbb26a19280, src1=Variable "src1" is not available.
) at src/asm/rpn.c:319
319 expr->nVal = (expr->nVal / src2->nVal);
(gdb) bt
#0 0x00000bbb2660cd0c in rpn_DIV (expr=0xbbb26a19280, src1=Variable "src1" is not available.
)
at src/asm/rpn.c:319
#1 0x00000bbb26606d16 in yyparse () at asmy.y:931
#2 0x00000bbb2660aa84 in main (argc=Variable "argc" is not available.
) at src/asm/main.c:334
Apologies if this is just my newbishness, but...
I have a file, screens.asm, that has two labels:
Splash_Screen:
;...
Title_Screen:
In my main file, main.asm, I have:
IMPORT Splash_Screen
IMPORT Title_Screen
When running rgblink, I get the error: rgblink: Unknown symbol 'Title_Screen'
EXPORTing Splash_Screen and Title_Screen works, as does using GLOBAL.
Am I doing something wrong, or is IMPORT really not working?
20:55 <@beware> to be clear, the linker is responsible for placing "thing with
symbol X", at bank Y and address Z in the rom, right?
20:56 <@beware> can you make it shuffle these "things" around to optimally
(maximum densely) utilize banks?
Just leaving my notes here, I don't care if you fix it or wait for me to get around to it, but I'd like to free up some text files from my computer and this seems like the place to put it.
This was just me grep
ing "err" in all the files, so excuse the mistake if there's something in here that shouldn't be deleted.
include/asm/main.h:void fatalerror(const char *fmt, ...);
include/asm/main.h:void yyerror(const char *fmt, ...);
include/asm/main.h:#define YY_FATAL_ERROR fatalerror
src/link/main.c: fprintf(stderr, "Argument for option 'p' must be between 0 and 0xFF");
src/asm/gameboy/yaccprt4.y: yyerror("Address $%x not 16-bit", $6);
src/asm/gameboy/yaccprt4.y: yyerror("ROM bank value $%x out of range (1 to $1ff)", $8);
src/asm/gameboy/yaccprt4.y: yyerror("SRAM bank value $%x out of range (0 to 3)", $8);
src/asm/gameboy/yaccprt4.y: yyerror("WRAMX bank value $%x out of range (1 to 7)", $8);
src/asm/gameboy/yaccprt4.y: yyerror("VRAM bank value $%x out of range (0 to 1)", $8);
src/asm/gameboy/yaccprt4.y: yyerror("BANK only allowed for ROMX, WRAMX, SRAM, or VRAM sections");
src/asm/gameboy/yaccprt4.y: yyerror("ROM bank value $%x out of range (1 to $1ff)", $11);
src/asm/gameboy/yaccprt4.y: yyerror("Address $%x not 16-bit", $6);
src/asm/gameboy/yaccprt4.y: yyerror("SRAM bank value $%x out of range (0 to 3)", $11);
src/asm/gameboy/yaccprt4.y: yyerror("Address $%x not 16-bit", $6);
src/asm/gameboy/yaccprt4.y: yyerror("WRAMX bank value $%x out of range (1 to 7)", $11);
src/asm/gameboy/yaccprt4.y: yyerror("Address $%x not 16-bit", $6);
src/asm/gameboy/yaccprt4.y: yyerror("VRAM bank value $%x out of range (0 to 1)", $11);
src/asm/gameboy/yaccprt4.y: yyerror("Address $%x not 16-bit", $6);
src/asm/gameboy/yaccprt4.y: yyerror("BANK only allowed for ROMX, WRAMX, SRAM, or VRAM sections");
src/asm/gameboy/yaccprt4.y: yyerror("Source address $%x not in HRAM ($FF00 to $FFFE)", $4.nVal);
src/asm/gameboy/yaccprt4.y: yyerror("Destination address $%x not in HRAM ($FF00 to $FFFE)", $2.nVal);
src/asm/gameboy/yaccprt4.y: yyerror("LD [HL],[HL] not a valid instruction");
src/asm/gameboy/yaccprt4.y: yyerror("Destination operand must be A");
src/asm/gameboy/yaccprt4.y: yyerror("Destination operand must be A");
src/asm/gameboy/yaccprt4.y: yyerror("Destination operand must be A");
src/asm/gameboy/yaccprt4.y: yyerror("Address for RST must be absolute");
src/asm/gameboy/yaccprt4.y: yyerror("Invalid address $%x for RST", $2.nVal);
src/asm/rpn.c: yyerror("'%s' not defined", tzSym);
src/asm/rpn.c: yyerror("BANK argument must be a relocatable identifier");
src/asm/fstack.c: fatalerror("No memory for context");
src/asm/fstack.c: * Dump the context stack to stderr
src/asm/fstack.c: fprintf(stderr, "%s(%ld) -> ", pLastFile->tzFileName,
src/asm/fstack.c: fprintf(stderr, "%s(%ld)", tzCurrentFileName, nLineNo);
src/asm/fstack.c: fatalerror("No such macroargument");
src/asm/fstack.c: yyerror("No such string symbol '%s'", s);
src/asm/yaccprt1.y: fatalerror("Symbol value too long to fit buffer");
src/asm/yaccprt1.y: fatalerror("snprintf encoding error");
src/asm/yaccprt1.y: fatalerror("Symbol value too long to fit buffer");
src/asm/yaccprt1.y: fatalerror( "No mem for REPT block" );
src/asm/yaccprt1.y: fatalerror( "No mem for MACRO definition" );
src/asm/asmy.y: fatalerror("Symbol value too long to fit buffer");
src/asm/asmy.y: fatalerror("snprintf encoding error");
src/asm/asmy.y: fatalerror("Symbol value too long to fit buffer");
src/asm/asmy.y: fatalerror( "No mem for REPT block" );
src/asm/asmy.y: fatalerror( "No mem for MACRO definition" );
src/asm/asmy.y: yyerror("Macro '%s' not defined", $1);
src/asm/asmy.y: { fatalerror("%s", $2); }
src/asm/asmy.y: { yyerror("%s", $2); }
src/asm/asmy.y: yyerror("Immediate value must be 3-bit");
src/asm/asmy.y: yyerror("Expression must be PC-relative");
src/asm/asmy.y: yyerror("Expression must be 8-bit");
src/asm/asmy.y: yyerror("Expression must be 16-bit");
src/asm/asmy.y: yyerror("Address $%x not 16-bit", $6);
src/asm/asmy.y: yyerror("ROM bank value $%x out of range (1 to $1ff)", $8);
src/asm/asmy.y: yyerror("SRAM bank value $%x out of range (0 to 3)", $8);
src/asm/asmy.y: yyerror("WRAMX bank value $%x out of range (1 to 7)", $8);
src/asm/asmy.y: yyerror("VRAM bank value $%x out of range (0 to 1)", $8);
src/asm/asmy.y: yyerror("BANK only allowed for ROMX, WRAMX, SRAM, or VRAM sections");
src/asm/asmy.y: yyerror("ROM bank value $%x out of range (1 to $1ff)", $11);
src/asm/asmy.y: yyerror("Address $%x not 16-bit", $6);
src/asm/asmy.y: yyerror("SRAM bank value $%x out of range (0 to 3)", $11);
src/asm/asmy.y: yyerror("Address $%x not 16-bit", $6);
src/asm/asmy.y: yyerror("WRAMX bank value $%x out of range (1 to 7)", $11);
src/asm/asmy.y: yyerror("Address $%x not 16-bit", $6);
src/asm/asmy.y: yyerror("VRAM bank value $%x out of range (0 to 1)", $11);
src/asm/asmy.y: yyerror("Address $%x not 16-bit", $6);
src/asm/asmy.y: yyerror("BANK only allowed for ROMX, WRAMX, SRAM, or VRAM sections");
src/asm/asmy.y: yyerror("Source address $%x not in HRAM ($FF00 to $FFFE)", $4.nVal);
src/asm/asmy.y: yyerror("Destination address $%x not in HRAM ($FF00 to $FFFE)", $2.nVal);
src/asm/asmy.y: yyerror("LD [HL],[HL] not a valid instruction");
src/asm/asmy.y: yyerror("Destination operand must be A");
src/asm/asmy.y: yyerror("Destination operand must be A");
src/asm/asmy.y: yyerror("Destination operand must be A");
src/asm/asmy.y: yyerror("Address for RST must be absolute");
src/asm/asmy.y: yyerror("Invalid address $%x for RST", $2.nVal);
src/asm/globlex.c: fatalerror("Malformed ID");
src/asm/globlex.c: fatalerror("Symbol too long");
src/asm/globlex.c: yyerror("Macro argument not defined");
src/asm/globlex.c: yyerror("Invalid macro argument");
src/asm/globlex.c: yyerror("Macro unique label string not defined");
src/asm/output.c: fatalerror("No memory for section stack");
src/asm/output.c: fatalerror("No entries in the section stack");
src/asm/output.c: fatalerror("INTERNAL: Unknown section");
src/asm/output.c: fatalerror("No memory for patchsymbol");
src/asm/output.c: fatalerror("No memory for patch");
src/asm/output.c: fatalerror("Code generation before SECTION directive");
src/asm/output.c: fatalerror
src/asm/output.c: fatalerror
src/asm/output.c: fatalerror("Not enough memory for section");
src/asm/output.c: fatalerror("Not enough memory for sectionname");
src/asm/output.c: fatalerror("Not enough memory for section");
src/asm/output.c: yyerror("PC-relative value must be 8-bit");
src/asm/output.c: fatalerror("Start position cannot be negative");
src/asm/output.c: fatalerror("Number of bytes to read must be greater than zero");
src/asm/output.c: fatalerror("Specified start position is greater than length of file");
src/asm/output.c: fatalerror("Specified range in INCBIN is out of bounds");
src/asm/main.c: fatalerror("Unknown option");
src/asm/main.c: fatalerror("No memory for option stack");
src/asm/main.c: fatalerror("No entries in the option stack");
src/asm/main.c:verror(const char *fmt, va_list args)
src/asm/main.c: fprintf(stderr, "ERROR:\t");
src/asm/main.c: fprintf(stderr, " :\n\t");
src/asm/main.c: vfprintf(stderr, fmt, args);
src/asm/main.c: fprintf(stderr, "\n");
src/asm/main.c:yyerror(const char *fmt, ...)
src/asm/main.c: verror(fmt, args);
src/asm/main.c:fatalerror(const char *fmt, ...)
src/asm/main.c: verror(fmt, args);
src/asm/symbol.c: fatalerror("No memory for symbol");
src/asm/symbol.c: yyerror("'%s' not defined", tzName);
src/asm/symbol.c: fatalerror("'%s' is not allowed as argument to the "
src/asm/symbol.c: yyerror("Stringsymbol '%s' not defined", tzSym);
src/asm/symbol.c: fatalerror("Expression must have a constant value");
src/asm/symbol.c: yyerror("'%s' not defined", s);
src/asm/symbol.c: yyerror("'%s' is a macro or string symbol", s);
src/asm/symbol.c: yyerror("'%s' not defined", s);
src/asm/symbol.c: yyerror("'%s' is a macro or string symbol", s);
src/asm/symbol.c: yyerror("'%s' not defined", s);
src/asm/symbol.c: yyerror("'%s' not defined", s);
src/asm/symbol.c: yyerror("A maximum of 9 arguments allowed");
src/asm/symbol.c: yyerror("'%s' already defined", tzSym);
src/asm/symbol.c: yyerror("'%s' already defined", tzSym);
src/asm/symbol.c: fatalerror("No memory for stringequate");
src/asm/symbol.c: yyerror("'%s' already defined", tzSym);
src/asm/symbol.c: fatalerror("Local label in main scope");
src/asm/symbol.c: yyerror("'%s' already defined", tzSym);
src/asm/symbol.c: yyerror("'%s' not defined", tzSym);
src/asm/symbol.c: yyerror("'%s' already defined", tzSym);
src/asm/symbol.c: yyerror("'%s' already defined", tzSym);
src/asm/lexer.c: fatalerror("Buffer safety margin exceeded");
src/asm/lexer.c: fatalerror("Buffer safety margin exceeded");
src/asm/lexer.c: fatalerror("Out of memory!");
src/asm/lexer.c: fatalerror("Out of memory!");
src/asm/lexer.c: fatalerror("Internal error in lexgetfloat");
src/asm/lexer.c: fatalerror("Out of memory!");
src/asm/lexer.c: fatalerror("Out of memory!");
src/asm/lexer.c: fatalerror("Macro argument not defined");
src/asm/lexer.c: fatalerror("Macro argument too long to fit buffer");
src/asm/lexer.c: fatalerror("String too long");
src/asm/lexer.c: fatalerror("Symbol too long");
src/asm/lexer.c: fatalerror("Illegal character escape '%c'", ch);
src/asm/lexer.c: yyerror("Missing }");
src/asm/lexer.c: fatalerror("Illegal character escape '%c'", ch);
src/asm/lexer.c: yyerror("Unterminated string");
src/asm/lexer.c: fatalerror("Illegal character escape '%c'", ch);
src/asm/lexer.c: fatalerror("Internal error in yylex_MACROARGS");
src/asm/lexer.c: fatalerror("Internal error in yylex");
src/asm/yaccprt3.y: yyerror("Macro '%s' not defined", $1);
src/asm/yaccprt3.y: { fatalerror("%s", $2); }
src/asm/yaccprt3.y: { yyerror("%s", $2); }
src/asm/yaccprt3.y: yyerror("Immediate value must be 3-bit");
src/asm/yaccprt3.y: yyerror("Expression must be PC-relative");
src/asm/yaccprt3.y: yyerror("Expression must be 8-bit");
src/asm/yaccprt3.y: yyerror("Expression must be 16-bit");
20:51 <@beware> anjbe_: is "smart linking" something you can do? smart linking means: only include things that are actually referenced
20:51 <@beware> this mostly helps with libraries
20:51 <@beware> as not all of the library has to be linked
20:51 <@beware> libraries tend to contain a lot of things a project doesn't need
20:52 <@beware> i think a linker could do this transparently
20:52 <@beware> (as in, as part of the linker)
20:53 <@beware> to resolve "is symbol X being referenced", you need to trace it from the program's entry point
20:53 <@beware> because a library can reference a symbol, but if that library is never used, then this reference doesn't mean it should be included
20:54 <@beware> anything (that has a symbol) that is never referenced is "dead" (as in, dead code, dead data)
Again, copy/pasting a grep
.
include/link/library.h:#ifndef ASMOTOR_LINK_LIBRARY_H
include/link/library.h:#define ASMOTOR_LINK_LIBRARY_H
include/link/symbol.h:#ifndef ASMOTOR_LINK_SYMBOL_H
include/link/symbol.h:#define ASMOTOR_LINK_SYMBOL_H
include/link/main.h:#ifndef ASMOTOR_LINK_MAIN_H
include/link/main.h:#define ASMOTOR_LINK_MAIN_H
include/link/mapfile.h:#ifndef ASMOTOR_LINK_MAPFILE_H
include/link/mapfile.h:#define ASMOTOR_LINK_MAPFILE_H
include/link/output.h:#ifndef ASMOTOR_LINK_OUTPUT_H
include/link/output.h:#define ASMOTOR_LINK_OUTPUT_H
include/link/patch.h:#ifndef ASMOTOR_LINK_PATCH_H
include/link/patch.h:#define ASMOTOR_LINK_PATCH_H
include/link/assign.h:#ifndef ASMOTOR_LINK_ASSIGN_H
include/link/assign.h:#define ASMOTOR_LINK_ASSIGN_H
include/link/mylink.h:#ifndef ASMOTOR_LINK_LINK_H
include/link/mylink.h:#define ASMOTOR_LINK_LINK_H
include/link/types.h:#ifndef ASMOTOR_LINK_TYPES_H
include/link/types.h:#define ASMOTOR_LINK_TYPES_H
include/link/object.h:#ifndef ASMOTOR_LINK_OBJECT_H
include/link/object.h:#define ASMOTOR_LINK_OBJECT_H
include/asm/lexer.h:#ifndef ASMOTOR_ASM_LEXER_H
include/asm/lexer.h:#define ASMOTOR_ASM_LEXER_H
include/asm/charmap.h:#ifndef ASMOTOR_ASM_CHARMAP_H
include/asm/charmap.h:#define ASMOTOR_ASM_CHARMAP_H
include/asm/symbol.h:#ifndef ASMOTOR_SYMBOL_H
include/asm/symbol.h:#define ASMOTOR_SYMBOL_H
include/asm/main.h:#ifndef ASMOTOR_MAIN_H
include/asm/main.h:#define ASMOTOR_MAIN_H
include/asm/rpn.h:#ifndef ASMOTOR_ASM_RPN_H
include/asm/rpn.h:#define ASMOTOR_ASM_RPN_H
include/asm/output.h:#ifndef ASMOTOR_ASM_OUTPUT_H
include/asm/output.h:#define ASMOTOR_ASM_OUTPUT_H
include/asm/fstack.h:#ifndef ASMOTOR_ASM_FSTACK_H
include/asm/fstack.h:#define ASMOTOR_ASM_FSTACK_H
include/asm/mymath.h:#ifndef ASMOTOR_ASM_MATH_H
include/asm/mymath.h:#define ASMOTOR_ASM_MATH_H
include/asm/mylink.h:#ifndef ASMOTOR_ASM_LINK_H
include/asm/mylink.h:#define ASMOTOR_ASM_LINK_H
include/asm/asm.h:#ifndef ASMOTOR_ASM_ASM_H
include/asm/asm.h:#define ASMOTOR_ASM_ASM_H
include/asm/types.h:#ifndef ASMOTOR_ASM_TYPES_H
include/asm/types.h:#define ASMOTOR_ASM_TYPES_H
`3210 should be equal to $e4, instead returns $C0A
/usr/local/man/man1 and /usr/local/man/man7 were not created using make install, and caused the script to fail. Had to create them manually before it would work.
When you define a GB graphic constant, like DW `00133100 the resulting two bytes of planar data seem to get stored in the wrong order. It should store the least significant bits first and the most significant ones after them.
Currently DW `00133100 results in $18 $3C being stored instead of $3C $18.
Due to this bug, all pixels with ligh-gray or dark-gray shades get swapped.
Now RGBDS can only supprot
charmap "C", $01
Can RGBDS support widechar charmap like
charmap "C", $01F0
or
charmap "C", $01F0, 2
?
_PI is defined with sym_AddEqu during sym_Init, but that's broken for some reason.
sanky@warata:~/romhacking/rgbds_$ cat test.asm
SECTION "rst00",HOME[0]
db _PI % 256
sanky@warata:~/romhacking/rgbds_$ rgbasm test.asm
ERROR: test.asm(3) :
'_PI' not defined
Segmentation fault (core dumped)
The newly added test/asm/null-in-macro.asm
crashes.
The 0 byte embedded in the source code results in a zero‐length string buffer, which then gets assigned to.
Starting program: /home/anthony/bin/rgbasm null-in-macro.asm
Program received signal SIGSEGV, Segmentation fault.
0x00001112c5504427 in copymacro () at asmy.y:226
226 asmy.y: No such file or directory.
in asmy.y
(gdb) bt
#0 0x00001112c5504427 in copymacro () at asmy.y:226
#1 0x00001112c5506e68 in yyparse () at asmy.y:643
#2 0x00001112c550aa84 in main (argc=Variable "argc" is not available.
) at src/asm/main.c:334
I'd like to make a keg for this on homebrew, but homebrew needs a version (tag) to stick to. I could fork, but I'd rather use this repo as it seems like the canonical one. Could you please add a tag to the latest commit, and continue tagging as fixes/additions are made?
Thanks!
Matt
I think it would be nice if we could have some verbose output when there is a label redefinition.
Say like
ERROR: src/main.asm(10) -> banks/Bank3.asm(3) :
'label_C000' already defined
Could be
ERROR: src/main.asm(10) -> banks/Bank3.asm(3) :
'label_C000' already defined wram.asm(33)
Homebrew doesn't like HEAD only formulas. The current HEAD works properly with homebrew, so if you could tag it with a version, then I could get the formula accepted into the homebrew repo.
Thanks for all your help with these changes!
The newly added test/asm/bank-noexist.asm
crashes.
Starting program: /home/anthony/bin/rgbasm bank-noexist.asm
ERROR: bank-noexist.asm(2) :
'noexist' not defined
Program received signal SIGSEGV, Segmentation fault.
calchash (s=0x0) at src/asm/symbol.c:56
56 while (*s != 0)
(gdb) bt
#0 calchash (s=0x0) at src/asm/symbol.c:56
#1 0x0000160af950bde0 in addsymbol (pSym=0x0) at src/asm/output.c:286
#2 0x0000160af950bfaa in createpatch (type=Variable "type" is not available.
) at src/asm/output.c:400
#3 0x0000160af950c2e4 in out_RelByte (expr=0x160d070964a0)
at src/asm/output.c:675
#4 0x0000160af950678c in yyparse () at asmy.y:839
#5 0x0000160af950aac8 in main (argc=Variable "argc" is not available.
) at src/asm/main.c:358
https://github.com/bentley/rgbds/blob/master/src/link/symbol.c#L79
https://github.com/bentley/rgbds/blob/master/include/link/symbol.h#L7
Change the last argument in both lines by: "SLONG nBank"
b0.asm:
GLOBAL LABEL_B258
SECTION "INIT",ROM0[0]
DW BANK(LABEL_B258)
b1.asm:
SECTION "GBT_BANK0",ROMX,BANK[258]
LABEL_B258:: DB 0
Make ROM:
rgbasm -ob0.o b0.asm
rgbasm -ob1.o b1.asm
rgblink -o out.gb b0.o b1.o
Should output 02 01 FF FF ...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.