]> Shamusworld >> Repos - rmac/blobdiff - 6502.c
Version bump for last commit. :-)
[rmac] / 6502.c
diff --git a/6502.c b/6502.c
index 131c6d8c106982d4cd70825ea5e8db5c875b2d52..66f2080977e2a0d73a639252a43867c672da9ef9 100644 (file)
--- a/6502.c
+++ b/6502.c
@@ -243,6 +243,7 @@ int d_6502()
        regtab = reg65tab;
        regcheck = reg65check;
        regaccept = reg65accept;
+       used_architectures |= M6502;
 
        return 0;
 }
@@ -570,6 +571,26 @@ void m6502obj(int ofd)
 }
 
 
+// Write raw 6502 org'd code.
+// Super copypasta'd from above function
+void m6502raw(int ofd)
+{
+       CHUNK * ch = sect[M6502].scode;
+
+       // If no 6502 code was generated, bail out
+       if ((ch == NULL) || (ch->challoc == 0))
+               return;
+
+       register uint8_t *p = ch->chptr;
+
+       for(uint16_t * l=&orgmap[0][0]; l<currentorg; l+=2)
+       {
+               // Write the segment data
+               uint32_t unused = write(ofd, p + l[0], l[1] - l[0]);
+       }
+}
+
+
 //
 // Generate a C64 .PRG output file
 //