summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1f9660c)
Basically give a more meaningful error message in incbin if the filename
is missing, and use the macros already defined in opkw.h instead of
cooking up our own and (possibly) getting out of sync later on down the
road.
- error("syntax error; string missing");
+ error("syntax error; file to include missing");
#include "sect.h"
#include "token.h"
#include "sect.h"
#include "token.h"
-// Macros to help define things (though largely unnecessary for this assembler)
-#define BITMAP 3100
-#define SCBITMAP 3101
-#define GPUOBJ 3102
-#define BRANCH 3103
-#define STOP 3104
-#define NOP 3105
-#define JUMP 3106
+#define DEF_MO
+#include "opkw.h" // For MO_* macros
-int HandleBitmap(void);
-int HandleScaledBitmap(void);
-int HandleGPUObject(void);
-int HandleBranch(void);
-int HandleStop(void);
-int HandleNOP(void);
-int HandleJump(void);
+static int HandleBitmap(void);
+static int HandleScaledBitmap(void);
+static int HandleGPUObject(void);
+static int HandleBranch(void);
+static int HandleStop(void);
+static int HandleNOP(void);
+static int HandleJump(void);
// OP assembler vars.
static uint8_t lastObjType;
// OP assembler vars.
static uint8_t lastObjType;
return HandleScaledBitmap();
return HandleScaledBitmap();
return HandleGPUObject();
return HandleGPUObject();
// Form: bitmap <data>, <xloc>, <yloc>, <dwidth>, <iwidth>, <iheight>, <bpp>,
// <pallete idx>, <flags>, <firstpix>, <pitch>
//
// Form: bitmap <data>, <xloc>, <yloc>, <dwidth>, <iwidth>, <iheight>, <bpp>,
// <pallete idx>, <flags>, <firstpix>, <pitch>
//
+static int HandleBitmap(void)
{
uint64_t xpos = 0;
uint64_t ypos = 0;
{
uint64_t xpos = 0;
uint64_t ypos = 0;
// <xscale>, <yscale>, <remainder>, <bpp>, <pallete idx>,
// <flags>, <firstpix>, <pitch>
//
// <xscale>, <yscale>, <remainder>, <bpp>, <pallete idx>,
// <flags>, <firstpix>, <pitch>
//
-int HandleScaledBitmap(void)
+static int HandleScaledBitmap(void)
{
uint64_t xpos = 0;
uint64_t ypos = 0;
{
uint64_t xpos = 0;
uint64_t ypos = 0;
// Insert GPU object
// Form: gpuobj <line #>, <userdata> (bits 14-63 of this object)
//
// Insert GPU object
// Form: gpuobj <line #>, <userdata> (bits 14-63 of this object)
//
-int HandleGPUObject(void)
+static int HandleGPUObject(void)
{
uint64_t eval;
uint16_t eattr;
{
uint64_t eval;
uint16_t eattr;
// branch OPFLAG, <link addr>
// branch SECHALF, <link addr>
//
// branch OPFLAG, <link addr>
// branch SECHALF, <link addr>
//
+static int HandleBranch(void)
{
char missingKeyword[] = "missing VC, OPFLAG, or SECHALF in branch";
uint32_t cc = 0;
{
char missingKeyword[] = "missing VC, OPFLAG, or SECHALF in branch";
uint32_t cc = 0;
// Insert a stop object
// Form: stop
//
// Insert a stop object
// Form: stop
//
+static int HandleStop(void)
{
lastObjType = 4;
D_quad(4LL);
{
lastObjType = 4;
D_quad(4LL);
// Insert a phrase sized "NOP" in the object list (psuedo-op)
// Form: nop
//
// Insert a phrase sized "NOP" in the object list (psuedo-op)
// Form: nop
//
+static int HandleNOP(void)
{
uint64_t eval = (orgaddr + 8) & 0x3FFFF8;
// This is "branch if VC > 2047". Branch addr is next phrase, so either way
{
uint64_t eval = (orgaddr + 8) & 0x3FFFF8;
// This is "branch if VC > 2047". Branch addr is next phrase, so either way
// Insert an unconditional jump in the object list (psuedo-op)
// Form: jump <link addr>
//
// Insert an unconditional jump in the object list (psuedo-op)
// Form: jump <link addr>
//
+static int HandleJump(void)
{
uint64_t eval;
uint16_t eattr;
{
uint64_t eval;
uint16_t eattr;