Bugzilla – Attachment 205 Details for
Bug 194
C64 .prg output support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
The patches!
0001-Added-support-for-C64-.PRG-output-format-194.patch (text/plain), 2.94 KB, created by
ggn
on 2022-12-20 15:51:05 CST
(
hide
)
Description:
The patches!
Filename:
MIME Type:
Creator:
ggn
Created:
2022-12-20 15:51:05 CST
Size:
2.94 KB
patch
obsolete
>From 0d852247f1662c836ba8772909e932b08e68fd7b Mon Sep 17 00:00:00 2001 >From: ggn <ggn@atari.org> >Date: Tue, 20 Dec 2022 23:48:39 +0200 >Subject: [PATCH] Added support for C64 .PRG output format (#194) > >--- > 6502.c | 31 +++++++++++++++++++++++++++++++ > 6502.h | 2 ++ > object.c | 5 +++++ > rmac.c | 5 +++++ > rmac.h | 1 + > 5 files changed, 44 insertions(+) > >diff --git a/6502.c b/6502.c >index c523086..5d1d7c7 100644 >--- a/6502.c >+++ b/6502.c >@@ -587,3 +587,34 @@ void m6502raw(int ofd) > uint32_t unused = write(ofd, p + l[0], l[1] - l[0]); > } > } >+ >+// >+// Generate a C64 .PRG output file >+// >+void m6502c64(int ofd) >+{ >+ uint8_t header[2]; >+ uint32_t unused; >+ >+ CHUNK *ch = sect[M6502].scode; >+ >+ // If no 6502 code was generated, bail out >+ if ((ch == NULL) || (ch->challoc == 0)) >+ return; >+ >+ if (currentorg != &orgmap[1][0]) >+ { >+ // More than one 6502 section created, this is not allowed >+ error("when generating C64 .PRG files only one org section is allowed - aborting"); >+ return; >+ } >+ >+ SETLE16(header, 0, orgmap[0][0]); >+ register uint8_t *p = ch->chptr; >+ >+ // Write header >+ unused = write(ofd, header, 2); >+ // Write the data >+ unused = write(ofd, p + orgmap[0][0], orgmap[0][1] - orgmap[0][0]); >+ >+} >\ No newline at end of file >diff --git a/6502.h b/6502.h >index bddf065..453c66b 100644 >--- a/6502.h >+++ b/6502.h >@@ -19,6 +19,8 @@ extern void Init6502(); > extern int d_6502(); > extern void m6502cg(int op); > extern void m6502obj(int ofd); >+extern void m6502raw(int ofd); >+extern void m6502c64(int ofd); > > #endif // __6502_H__ > >diff --git a/object.c b/object.c >index 6a69fcf..6dbf9c5 100644 >--- a/object.c >+++ b/object.c >@@ -831,6 +831,11 @@ for(int j=0; j<i; j++) > // Just write the object file > m6502obj(fd); > } >+ else if (obj_format == C64PRG) >+ { >+ // Just write the object file >+ m6502c64(fd); >+ } > else if (obj_format == P56 || obj_format == LOD) > { > // Allocate 6MB object file image memory >diff --git a/rmac.c b/rmac.c >index 26b1222..8e5f410 100644 >--- a/rmac.c >+++ b/rmac.c >@@ -164,6 +164,7 @@ void DisplayHelp(void) > " -f[format] Output object file format\n" > " a: ALCYON\n" > " b: BSD (use this for Jaguar)\n" >+ " c: PRG (C64)\n" > " e: ELF\n" > " p: P56 (use this for DSP56001 only)\n" > " l: LOD (use this for DSP56001 only)\n" >@@ -445,6 +446,10 @@ int Process(int argc, char ** argv) > case 'B': > obj_format = BSD; > break; >+ case 'c': >+ case 'C': >+ obj_format = C64PRG; >+ break; > case 'e': // -fe = ELF > case 'E': > obj_format = ELF; >diff --git a/rmac.h b/rmac.h >index 388adec..00dcd3b 100644 >--- a/rmac.h >+++ b/rmac.h >@@ -198,6 +198,7 @@ LOD, // DSP 56001 object format > P56, // DSP 56001 object format > XEX, // COM/EXE/XEX/whatever a8 object format > RAW, // Output at absolute address >+C64PRG, // C64 .PRG format > }; > > // Assembler token >-- >2.38.1.windows.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 194
: 205 |
206