mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Clean object file format code and documentation
Remove unused code. Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -1,64 +1,6 @@
|
|||||||
#ifndef RGBDS_ASM_LINK_H
|
#ifndef RGBDS_ASM_LINK_H
|
||||||
#define RGBDS_ASM_LINK_H
|
#define RGBDS_ASM_LINK_H
|
||||||
|
|
||||||
/* RGB4 .o format:
|
|
||||||
*
|
|
||||||
* Header
|
|
||||||
* Symbols
|
|
||||||
* Sections
|
|
||||||
*
|
|
||||||
* Header:
|
|
||||||
* "RGB4"
|
|
||||||
* LONG NumberOfSymbols
|
|
||||||
* LONG NumberOfSections
|
|
||||||
*
|
|
||||||
* Symbols:
|
|
||||||
* Symbol[NumberOfSymbols]
|
|
||||||
*
|
|
||||||
* Symbol:
|
|
||||||
* char Name (NULL terminated)
|
|
||||||
* char nType
|
|
||||||
* if (nType != SYM_IMPORT)
|
|
||||||
* {
|
|
||||||
* LONG SectionID
|
|
||||||
* LONG Offset
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* Sections:
|
|
||||||
* Section[NumberOfSections]
|
|
||||||
*
|
|
||||||
* Section:
|
|
||||||
* char SectionName (NULL-terminated)
|
|
||||||
* LONG SizeInBytes
|
|
||||||
* char Type
|
|
||||||
* LONG OrgPosition
|
|
||||||
* LONG Bank
|
|
||||||
* LONG Alignment
|
|
||||||
* if (Type == ROM0 || Type == ROMX)
|
|
||||||
* {
|
|
||||||
* char Data[SizeInBytes]
|
|
||||||
* Patches
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* Patches:
|
|
||||||
* LONG NumberOfPatches
|
|
||||||
* Patch[NumberOfPatches]
|
|
||||||
*
|
|
||||||
* Patch:
|
|
||||||
* char Filename NULL-terminated
|
|
||||||
* LONG LineNo
|
|
||||||
* LONG Offset
|
|
||||||
* char Type
|
|
||||||
* LONG RpnByteSize
|
|
||||||
* Rpn[RpnByteSize]
|
|
||||||
*
|
|
||||||
* Rpn:
|
|
||||||
* Operators: 0x00-0x7F
|
|
||||||
* Constants: 0x80 0x00000000
|
|
||||||
* Symbols : 0x81 0x00000000
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
RPN_ADD = 0,
|
RPN_ADD = 0,
|
||||||
RPN_SUB,
|
RPN_SUB,
|
||||||
@@ -90,11 +32,6 @@ enum {
|
|||||||
|
|
||||||
RPN_HRAM,
|
RPN_HRAM,
|
||||||
|
|
||||||
/* TODO: This hasn't been removed in order not to break compatibility
|
|
||||||
* with the existing object files, but it will be removed in a future
|
|
||||||
* version. */
|
|
||||||
RPN_unused,
|
|
||||||
|
|
||||||
RPN_RANGECHECK,
|
RPN_RANGECHECK,
|
||||||
|
|
||||||
RPN_CONST = 0x80,
|
RPN_CONST = 0x80,
|
||||||
@@ -121,8 +58,6 @@ enum {
|
|||||||
enum {
|
enum {
|
||||||
PATCH_BYTE = 0,
|
PATCH_BYTE = 0,
|
||||||
PATCH_WORD_L,
|
PATCH_WORD_L,
|
||||||
PATCH_LONG_L,
|
PATCH_LONG_L
|
||||||
PATCH_WORD_B,
|
|
||||||
PATCH_LONG_B
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -96,9 +96,7 @@ struct sSymbol {
|
|||||||
enum ePatchType {
|
enum ePatchType {
|
||||||
PATCH_BYTE = 0,
|
PATCH_BYTE = 0,
|
||||||
PATCH_WORD_L,
|
PATCH_WORD_L,
|
||||||
PATCH_LONG_L,
|
PATCH_LONG_L
|
||||||
PATCH_WORD_B,
|
|
||||||
PATCH_LONG_B
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sPatch {
|
struct sPatch {
|
||||||
|
|||||||
@@ -264,22 +264,12 @@ Patch(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PATCH_WORD_L:
|
case PATCH_WORD_L:
|
||||||
case PATCH_WORD_B:
|
|
||||||
if (t >= -32768 && t <= 65535) {
|
if (t >= -32768 && t <= 65535) {
|
||||||
t &= 0xFFFF;
|
t &= 0xFFFF;
|
||||||
if (pPatch->Type == PATCH_WORD_L) {
|
pSect->pData[pPatch->nOffset] =
|
||||||
pSect->pData[pPatch->nOffset] =
|
t & 0xFF;
|
||||||
t & 0xFF;
|
pSect->pData[pPatch->nOffset + 1] =
|
||||||
pSect->pData[pPatch->nOffset +
|
(t >> 8) & 0xFF;
|
||||||
1] =
|
|
||||||
(t >> 8) & 0xFF;
|
|
||||||
} else {
|
|
||||||
//Assume big endian
|
|
||||||
pSect->pData[pPatch->nOffset] =
|
|
||||||
(t >> 8) & 0xFF;
|
|
||||||
pSect->pData[pPatch->nOffset +
|
|
||||||
1] = t & 0xFF;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
errx(1,
|
errx(1,
|
||||||
"%s(%ld) : Value must be 16-bit",
|
"%s(%ld) : Value must be 16-bit",
|
||||||
@@ -296,15 +286,6 @@ Patch(void)
|
|||||||
pSect->pData[pPatch->nOffset + 3] =
|
pSect->pData[pPatch->nOffset + 3] =
|
||||||
(t >> 24) & 0xFF;
|
(t >> 24) & 0xFF;
|
||||||
break;
|
break;
|
||||||
case PATCH_LONG_B:
|
|
||||||
pSect->pData[pPatch->nOffset + 0] =
|
|
||||||
(t >> 24) & 0xFF;
|
|
||||||
pSect->pData[pPatch->nOffset + 1] =
|
|
||||||
(t >> 16) & 0xFF;
|
|
||||||
pSect->pData[pPatch->nOffset + 2] =
|
|
||||||
(t >> 8) & 0xFF;
|
|
||||||
pSect->pData[pPatch->nOffset + 3] = t & 0xFF;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pPatch = pPatch->pNext;
|
pPatch = pPatch->pNext;
|
||||||
|
|||||||
@@ -115,9 +115,7 @@ REPT NumberOfSections
|
|||||||
|
|
||||||
BYTE Type ; 0 = BYTE patch.
|
BYTE Type ; 0 = BYTE patch.
|
||||||
; 1 = little endian WORD patch.
|
; 1 = little endian WORD patch.
|
||||||
; 2 = little endianLONG patch.
|
; 2 = little endian LONG patch.
|
||||||
; 3 = big endian WORD patch (unused)
|
|
||||||
; 4 = big endian LONG patch (unused)
|
|
||||||
|
|
||||||
LONG RPNSize ; Size of the buffer with the RPN.
|
LONG RPNSize ; Size of the buffer with the RPN.
|
||||||
; expression.
|
; expression.
|
||||||
|
|||||||
Reference in New Issue
Block a user