This change was suppsed to fix the issue that the former JUMPTABLE is merked as 'ro' while it is actually written to in several scenarios. When drivers are converted using co65 and then compiled into ROMs the JUMPTABLE isn't copied to RAM and therefore the write operations in question fail.
However unfortunately I didn't succeed in changing that :-( Just setting the former JUMPTABLE to 'rw' broke the drivers. So I placed the DATA segment directly after the former JUMPTABLE segment. This made the drivers converted with co65 work again - obviously after changing libsrc/Makefile:235 from '--code-label' to '--data-label'. But the actual dynamic drivers still didn't work as the former JUMPTABLE wasn't placed as the beginning of the loaded file anymore. That effect could be changed by exchanging src/ld65/o65.c:1391 with src/ld65/o65.c:1394 but doing so broke the drivers again :-((
MEMORY {
- ZP: file = %O, start = $0000, size = $0100, type = rw, define = yes;
+ ZP: start = $0000, size = $0100;
COMBINED: file = %O, start = $0000, size = $FFFF;
}
SEGMENTS {
- JUMPTABLE: load = COMBINED, type = ro;
- INIT: load = COMBINED, type = ro, optional = yes;
- CODE: load = COMBINED, type = ro;
- RODATA: load = COMBINED, type = ro;
- DATA: load = COMBINED, type = rw, define = yes;
- BSS: load = COMBINED, type = bss, define = yes;
- ZEROPAGE: load = ZP, type = zp;
- EXTZP: load = ZP, type = zp, optional = yes;
+ ZEROPAGE: load = ZP, type = zp;
+ EXTZP: load = ZP, type = zp, optional = yes;
+ HEADER: load = COMBINED, type = ro;
+ CODE: load = COMBINED, type = ro;
+ RODATA: load = COMBINED, type = ro;
+ DATA: load = COMBINED, type = rw;
+ BSS: load = COMBINED, type = bss;
}
FILES {
%O: format = o65;
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; Header. Includes jump table.
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Driver signature
.byte $6D, $6F, $75 ; "mou"
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Driver signature
.byte $73, $65, $72 ; "ser"
; ------------------------------------------------------------------------
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Header. Includes jump table and constants.
; ------------------------------------------------------------------------
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Header. Includes jump table and constants.
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
;
; ----------------------------------------------------------------------
-.segment "JUMPTABLE"
+.segment "HEADER"
; Header
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Driver signature
.byte $73, $65, $72 ; "ser"
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "JUMPTABLE"
+.segment "HEADER"
; The first part of the header is a structure that has a signature,
; and defines the capabilities of the driver.
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "JUMPTABLE"
+.segment "HEADER"
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table.
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "JUMPTABLE"
+.segment "HEADER"
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "JUMPTABLE"
+.segment "HEADER"
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table.
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "JUMPTABLE"
+.segment "HEADER"
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table.
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
HEADER:
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "JUMPTABLE"
+.segment "HEADER"
; First part of the header is a structure that has a magic signature,
; and defines the capabilities of the driver.
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Driver signature
.byte $73, $65, $72 ; "ser"
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "JUMPTABLE"
+.segment "HEADER"
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table and constants.
-.segment "JUMPTABLE"
+.segment "HEADER"
; First part of the header is a structure that has a magic and defines the
; capabilities of the driver
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
- .segment "JUMPTABLE"
+ .segment "HEADER"
; Driver signature
; ------------------------------------------------------------------------
; Header. Includes jump table
-.segment "JUMPTABLE"
+.segment "HEADER"
; Driver signature