<br />
<b>Notice</b>:  Trying to access array offset on value of type bool in <b>/mnt/cpcwiki-httpdocs/includes/libs/IPSet.php</b> on line <b>243</b><br />
<br />
<b>Notice</b>:  Trying to access array offset on value of type bool in <b>/mnt/cpcwiki-httpdocs/includes/libs/IPSet.php</b> on line <b>246</b><br />
<br />
<b>Notice</b>:  Trying to access array offset on value of type bool in <b>/mnt/cpcwiki-httpdocs/includes/libs/IPSet.php</b> on line <b>243</b><br />
<br />
<b>Notice</b>:  Trying to access array offset on value of type bool in <b>/mnt/cpcwiki-httpdocs/includes/libs/IPSet.php</b> on line <b>246</b><br />
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://oldwiki.cpcwiki.eu/index.php?action=history&amp;feed=atom&amp;title=Programming%3ACrt0Cart</id>
		<title>Programming:Crt0Cart - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://oldwiki.cpcwiki.eu/index.php?action=history&amp;feed=atom&amp;title=Programming%3ACrt0Cart"/>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Crt0Cart&amp;action=history"/>
		<updated>2026-08-28T20:55:44Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:Crt0Cart&amp;diff=108823&amp;oldid=prev</id>
		<title>Reidrac at 07:49, 4 June 2022</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Crt0Cart&amp;diff=108823&amp;oldid=prev"/>
				<updated>2022-06-04T07:49:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 07:49, 4 June 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L3&quot; &gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It should be easy to adapt to other assemblers (it is likely that you won't need all the extra directives for the linker).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It should be easy to adapt to other assemblers (it is likely that you won't need all the extra directives for the linker).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I think got most of it from Kevin Thacker's [https://cpctech.cpcwiki.de/ The Unofficial Amstrad WWW Resource], but I can't find the exact link now. Anyway, Kevin is awesome and you should thank him if you have the chance.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;I think &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;I &lt;/ins&gt;got most of it from Kevin Thacker's [https://cpctech.cpcwiki.de/ The Unofficial Amstrad WWW Resource], but I can't find the exact link now. Anyway, Kevin is awesome and you should thank him if you have the chance.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; .module crt0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; .module crt0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:108820:newid:108823 --&gt;
&lt;/table&gt;</summary>
		<author><name>Reidrac</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:Crt0Cart&amp;diff=108820&amp;oldid=prev</id>
		<title>Reidrac: CRT0 for SDCC and CPC+ CPR carts</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Crt0Cart&amp;diff=108820&amp;oldid=prev"/>
				<updated>2022-06-04T07:42:58Z</updated>
		
		<summary type="html">&lt;p&gt;CRT0 for SDCC and CPC+ CPR carts&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is an example of crt0.asm to use with [http://sdcc.sourceforge.net/ SDCC] compiler.&lt;br /&gt;
&lt;br /&gt;
It should be easy to adapt to other assemblers (it is likely that you won't need all the extra directives for the linker).&lt;br /&gt;
&lt;br /&gt;
I think got most of it from Kevin Thacker's [https://cpctech.cpcwiki.de/ The Unofficial Amstrad WWW Resource], but I can't find the exact link now. Anyway, Kevin is awesome and you should thank him if you have the chance.&lt;br /&gt;
&lt;br /&gt;
        .module crt0&lt;br /&gt;
        .globl _main&lt;br /&gt;
        .globl _main_init&lt;br /&gt;
        &lt;br /&gt;
        ;; user_isr_hook will be exported so you can get current value&lt;br /&gt;
        ;; from C if you need to (it is defined in USR_ISR_HOOK anyway)&lt;br /&gt;
        .globl _user_isr_hook&lt;br /&gt;
        &lt;br /&gt;
        ;; the address for the ISR will be in RAM&lt;br /&gt;
        ;; this address is safe is you use double buffer, if you don't&lt;br /&gt;
        ;; use 0xc000 - 3 instead; the stack will be placed after this stack&lt;br /&gt;
        USER_ISR_HOOK = 0x8000 - 3&lt;br /&gt;
        &lt;br /&gt;
                .area	_HOME&lt;br /&gt;
                .area	_CODE&lt;br /&gt;
                .area	_DATA&lt;br /&gt;
                .area	_INITIALIZER&lt;br /&gt;
                .area	_BSEG&lt;br /&gt;
                .area   _BSS&lt;br /&gt;
                .area	_HEAP&lt;br /&gt;
        &lt;br /&gt;
                .area   _CODE&lt;br /&gt;
        &lt;br /&gt;
        _main_init::&lt;br /&gt;
                jp init_cart&lt;br /&gt;
        &lt;br /&gt;
                ;; magic! used to setup the CRCT&lt;br /&gt;
                .db 0x3f, 0x28, 0x2e, 0x8e, 0x26, 0x00, 0x19, 0x1e, 0x00, 0x07, 0x00, 0x00, 0x30, 0x00, 0xc0, 0x00&lt;br /&gt;
        end_crtc_data:&lt;br /&gt;
        &lt;br /&gt;
                .ds 37&lt;br /&gt;
                &lt;br /&gt;
                ;; jump to a memory address that is RAM and we can change to&lt;br /&gt;
                ;; set our ISR&lt;br /&gt;
                .db 0xc3&lt;br /&gt;
        _user_isr_hook::&lt;br /&gt;
                .dw USER_ISR_HOOK&lt;br /&gt;
        &lt;br /&gt;
        init_cart:&lt;br /&gt;
                di&lt;br /&gt;
        &lt;br /&gt;
                ;; lower ROM on, mode 0&lt;br /&gt;
                ld bc, #0x7f88&lt;br /&gt;
                out (c), c&lt;br /&gt;
        &lt;br /&gt;
                ;; init PPI&lt;br /&gt;
                ld bc, #0xf782&lt;br /&gt;
                out (c), c&lt;br /&gt;
        &lt;br /&gt;
                ld bc, #0xf400&lt;br /&gt;
                out (c), c&lt;br /&gt;
        &lt;br /&gt;
                ld bc, #0xf600&lt;br /&gt;
                out (c), c&lt;br /&gt;
        &lt;br /&gt;
                ;; RAM config&lt;br /&gt;
                ld bc, #0x7fc0&lt;br /&gt;
                out (c), c&lt;br /&gt;
        &lt;br /&gt;
                ;; setup CRTC (from 6128 ROM)&lt;br /&gt;
                ld hl, #end_crtc_data&lt;br /&gt;
                ld bc, #0xbc0f&lt;br /&gt;
        crtc_loop:&lt;br /&gt;
                out (c), c&lt;br /&gt;
                dec hl&lt;br /&gt;
                ld a, (hl)&lt;br /&gt;
                inc b&lt;br /&gt;
                out (c), a&lt;br /&gt;
                dec b&lt;br /&gt;
                dec c&lt;br /&gt;
                jp p, crtc_loop&lt;br /&gt;
        &lt;br /&gt;
                ;; set the stack&lt;br /&gt;
                ld sp, #USER_ISR_HOOK&lt;br /&gt;
        &lt;br /&gt;
                ;; dummy int handler&lt;br /&gt;
                im 1&lt;br /&gt;
                ld hl, #0xc9fb&lt;br /&gt;
                ld (USER_ISR_HOOK), hl&lt;br /&gt;
        &lt;br /&gt;
                ei&lt;br /&gt;
        &lt;br /&gt;
                call _main&lt;br /&gt;
        &lt;br /&gt;
        halt0:&lt;br /&gt;
                halt&lt;br /&gt;
                jr halt0&lt;br /&gt;
        &lt;br /&gt;
        .area _DATA&lt;/div&gt;</summary>
		<author><name>Reidrac</name></author>	</entry>

	</feed>