<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.amstrad-cpc.net/index.php?action=history&amp;feed=atom&amp;title=M4reconf</id>
	<title>M4reconf - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.amstrad-cpc.net/index.php?action=history&amp;feed=atom&amp;title=M4reconf"/>
	<link rel="alternate" type="text/html" href="https://wiki.amstrad-cpc.net/index.php?title=M4reconf&amp;action=history"/>
	<updated>2026-09-04T12:08:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wiki.amstrad-cpc.net/index.php?title=M4reconf&amp;diff=116915&amp;oldid=prev</id>
		<title>Arnoldemu at 17:59, 13 January 2019</title>
		<link rel="alternate" type="text/html" href="https://wiki.amstrad-cpc.net/index.php?title=M4reconf&amp;diff=116915&amp;oldid=prev"/>
		<updated>2019-01-13T17:59:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:59, 13 January 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l166&quot;&gt;Line 166:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 166:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;buf2:    ds 1088,0     &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;buf2:    ds 1088,0     &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Hardware]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Arnoldemu</name></author>
	</entry>
	<entry>
		<id>https://wiki.amstrad-cpc.net/index.php?title=M4reconf&amp;diff=116914&amp;oldid=prev</id>
		<title>Remax: Created page with &quot; m4reconf.zip  Here is a native CPC program to use other people&#039;s (or sd cards) M4 rom configuration:  Unpack the m4reconf.bin to the /M4 directory of...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.amstrad-cpc.net/index.php?title=M4reconf&amp;diff=116914&amp;oldid=prev"/>
		<updated>2018-12-21T16:07:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/images/2/29/M4reconf.zip&quot; class=&quot;internal&quot; title=&quot;M4reconf.zip&quot;&gt; m4reconf.zip&lt;/a&gt;  Here is a native CPC program to use other people&amp;#039;s (or sd cards) M4 rom configuration:  Unpack the m4reconf.bin to the /M4 directory of...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Media:m4reconf.zip | m4reconf.zip]]&lt;br /&gt;
&lt;br /&gt;
Here is a native CPC program to use other people&amp;#039;s (or sd cards) M4 rom configuration:&lt;br /&gt;
&lt;br /&gt;
Unpack the m4reconf.bin to the /M4 directory of the microSD.&lt;br /&gt;
Copy whatever romslots.bin and romconfig.bin you want to use to the /M4 directory aswell.&lt;br /&gt;
Run&amp;quot;m4reconf.bin&amp;quot;&lt;br /&gt;
Power cycle CPC and done.&lt;br /&gt;
&lt;br /&gt;
== Source code ==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
        ; M4 rom re-config&lt;br /&gt;
        ; To assemble use RASM assembler&lt;br /&gt;
        ; Duke - 2018&lt;br /&gt;
        &lt;br /&gt;
        org    0x4000&lt;br /&gt;
        nolist&lt;br /&gt;
&lt;br /&gt;
km_wait_key        equ 0xBB18&lt;br /&gt;
txt_output        equ 0xBB5A&lt;br /&gt;
txt_set_column    equ 0xBB6F&lt;br /&gt;
scr_reset        equ    0xBC0E&lt;br /&gt;
scr_set_ink        equ    0xBC32&lt;br /&gt;
scr_set_border    equ    0xBC38&lt;br /&gt;
cas_in_open        equ 0xBC77&lt;br /&gt;
cas_in_close    equ 0xBC7A&lt;br /&gt;
cas_in_char        equ 0xBC80&lt;br /&gt;
cas_out_open    equ 0xBC8C&lt;br /&gt;
cas_out_close    equ 0xBC8F&lt;br /&gt;
cas_out_char    equ 0xBC95&lt;br /&gt;
kl_init_back    equ 0xBCCE&lt;br /&gt;
&lt;br /&gt;
        ; re-init M4rom&lt;br /&gt;
    &lt;br /&gt;
        ld de,0x40 &lt;br /&gt;
        ld hl,0xB0FF&lt;br /&gt;
        call 0xBCCB&lt;br /&gt;
        &lt;br /&gt;
        ; setup screen&lt;br /&gt;
        &lt;br /&gt;
        ld a,2            &lt;br /&gt;
        call scr_reset        ; set mode 2&lt;br /&gt;
        xor a&lt;br /&gt;
        ld b,a&lt;br /&gt;
        call scr_set_border&lt;br /&gt;
        xor a&lt;br /&gt;
        ld b,a&lt;br /&gt;
        ld c,b&lt;br /&gt;
        call scr_set_ink&lt;br /&gt;
        ld a,1&lt;br /&gt;
        ld b,26&lt;br /&gt;
        ld c,b&lt;br /&gt;
        call scr_set_ink&lt;br /&gt;
&lt;br /&gt;
        ld    a,20&lt;br /&gt;
        call txt_set_column&lt;br /&gt;
        ld    hl,txt_title&lt;br /&gt;
        call wrt&lt;br /&gt;
        &lt;br /&gt;
        ; read romconfig.bin&lt;br /&gt;
        &lt;br /&gt;
        ld    hl,filename&lt;br /&gt;
        ld    de,buf&lt;br /&gt;
        ld    b,13        ; &amp;quot;romconfig.bin&amp;quot;&lt;br /&gt;
        call cas_in_open&lt;br /&gt;
        jp    nc,file_err&lt;br /&gt;
        ld    hl, buf2&lt;br /&gt;
        ld    bc,1088        ; file len&lt;br /&gt;
fread_loop:&lt;br /&gt;
        call cas_in_char&lt;br /&gt;
        ld    (hl),a&lt;br /&gt;
        inc    hl&lt;br /&gt;
        dec    bc&lt;br /&gt;
        xor    a&lt;br /&gt;
        cp    c&lt;br /&gt;
        jr    nz, fread_loop&lt;br /&gt;
        cp    b&lt;br /&gt;
        jr    nz, fread_loop&lt;br /&gt;
        &lt;br /&gt;
        call cas_in_close&lt;br /&gt;
        &lt;br /&gt;
        ; display &amp;#039;active&amp;#039; roms and set the flag so they are re-flashed on power cycle&lt;br /&gt;
        &lt;br /&gt;
        ld    ix,buf2&lt;br /&gt;
        ld    b,(ix)        ; number of roms (either 16 or 32)&lt;br /&gt;
        ld    de,32&lt;br /&gt;
        add    ix,de        ; skip header&lt;br /&gt;
        inc    de&lt;br /&gt;
rom_loop:&lt;br /&gt;
        ld    a,(ix)&lt;br /&gt;
        cp    1&lt;br /&gt;
        jr    nz, rom_not_used&lt;br /&gt;
        push de&lt;br /&gt;
        push ix&lt;br /&gt;
        pop    hl&lt;br /&gt;
        push bc&lt;br /&gt;
        inc hl            ; point to rom name&lt;br /&gt;
        ld de,text_buf&lt;br /&gt;
        ld bc,32&lt;br /&gt;
        ldir&lt;br /&gt;
        pop bc&lt;br /&gt;
        pop de&lt;br /&gt;
        ld hl,text_buf&lt;br /&gt;
        call wrt&lt;br /&gt;
        ld hl,txt_reen&lt;br /&gt;
        call wrt&lt;br /&gt;
        ld (ix),2        ; set rom to NEW&lt;br /&gt;
rom_not_used:&lt;br /&gt;
        add    ix,de        ; +33&lt;br /&gt;
        djnz rom_loop&lt;br /&gt;
        &lt;br /&gt;
        ; save the modified romconfig.bin&lt;br /&gt;
        &lt;br /&gt;
        ld hl,filename&lt;br /&gt;
        ld de,buf&lt;br /&gt;
        ld b,13        ; &amp;quot;romconfig.bin&amp;quot;&lt;br /&gt;
        call cas_out_open&lt;br /&gt;
        ld hl,buf2&lt;br /&gt;
        ld bc,1088        ; file len&lt;br /&gt;
fwrite_loop:&lt;br /&gt;
        ld    a,(hl)&lt;br /&gt;
        call cas_out_char&lt;br /&gt;
        inc hl&lt;br /&gt;
        dec bc&lt;br /&gt;
        xor a&lt;br /&gt;
        cp c&lt;br /&gt;
        jr nz, fwrite_loop&lt;br /&gt;
        cp b&lt;br /&gt;
        jr nz, fwrite_loop&lt;br /&gt;
        &lt;br /&gt;
        call cas_out_close&lt;br /&gt;
done:&lt;br /&gt;
        ; display done&lt;br /&gt;
        &lt;br /&gt;
        ld hl,txt_done&lt;br /&gt;
        call wrt&lt;br /&gt;
        jp    km_wait_key&lt;br /&gt;
file_err:&lt;br /&gt;
        ld    hl,txt_file_err&lt;br /&gt;
        call wrt&lt;br /&gt;
        jp    km_wait_key&lt;br /&gt;
wrt:&lt;br /&gt;
        ld    a,(hl)&lt;br /&gt;
        or    a&lt;br /&gt;
        ret    z&lt;br /&gt;
        call txt_output&lt;br /&gt;
        inc    hl&lt;br /&gt;
        jr    wrt&lt;br /&gt;
        &lt;br /&gt;
filename:&lt;br /&gt;
        db &amp;quot;romconfig.bin&amp;quot;&lt;br /&gt;
txt_title:&lt;br /&gt;
        db &amp;quot;M4 rom reconfig - Duke 2018&amp;quot;,10,13,10,13,0&lt;br /&gt;
txt_file_err:&lt;br /&gt;
        db &amp;quot;Error M4 romconfig.bin not found!&amp;quot;,10,13,0&lt;br /&gt;
txt_reen:&lt;br /&gt;
        db &amp;quot; re-enabled.&amp;quot;,10,13,0&lt;br /&gt;
txt_done:&lt;br /&gt;
        db 10,13,10,13,&amp;quot;Done! Power-cycle CPC&amp;quot;,0&lt;br /&gt;
&lt;br /&gt;
text_buf:&lt;br /&gt;
        ds 33,0&lt;br /&gt;
        &lt;br /&gt;
buf:    ds 2048,0&lt;br /&gt;
buf2:    ds 1088,0    &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Remax</name></author>
	</entry>
</feed>