Jump to content
IGNORED

CDFJ support?


Andrew Davie

Recommended Posts

6 minutes ago, Andrew Davie said:


Here are my changed lines...

 


/* LPC2103 memory areas  */
MEMORY 
{
    boot (RX)   : ORIGIN = 0x20000800     , LENGTH = 0x80    /* C-runtime booter */
    C_code (RX) : ORIGIN = 0x20000880     , LENGTH = 0x6780  /* C code (26K) */
    ram         : ORIGIN = 0x10001800, LENGTH = 0x800   /* 2K free RAM */
}



/* Global symbol _stack_end */
_stack_end = 0x10001FDC;

 

 

cubiks20211207PlusCart#2.bin 32 kB · 1 download

Same with the second ROM

 

Link to comment
Share on other sites

4 minutes ago, Al_Nafuur said:

I just found on my harddisk a collect3 demo which I modified half a year ago.

 

it worked in gopher2600:

 

here is the code and the binary:

Collect3.zip 54.84 kB · 0 downloads

 

 

This version takes defines_cdfj.h and custom_boot.lds directly from that zip..

 

cubiks20211207PlusCart#3.bin

Link to comment
Share on other sites

5 minutes ago, Al_Nafuur said:

I just found on my harddisk a collect3 demo which I modified half a year ago.

 

it worked in gopher2600:

 

here is the code and the binary:

Collect3.zip 54.84 kB · 2 downloads

 

 

 

Github project. The second commit shows the changes I made to target PlusCart.

 

https://github.com/JetSetIlly/plusromtest_cdfj

  • Like 1
Link to comment
Share on other sites

1 minute ago, JetSetIlly said:

 

Github project. The second commit shows the changes I made to target PlusCart.

 

https://github.com/JetSetIlly/plusromtest_cdfj

 

If you've coded with the assumption that Flash Origin is at 0x00000000 then you're going to need to change more than the header files. The diff file below shows how I needed to add the "ROM" address to "offset" values in a few places.

 

https://github.com/JetSetIlly/plusromtest_cdfj/commit/33d400d2ceb9ea8be7dc3c0178b812236f224fc9#diff-2978fe1c2c45b4eca89dc476376ddc7193bc4e5e7fff0c7d1c465f057b35a5e6

 

  • Thanks 1
Link to comment
Share on other sites

12 minutes ago, Andrew Davie said:

This version takes defines_cdfj.h and custom_boot.lds directly from that zip..

 

cubiks20211207PlusCart#3.bin 32 kB · 2 downloads

same as the other 2 builds. Could be the Flash ROM base address as @JetSetIlly suggested or maybe you are using the timers in your ARM-Thumb code. 

 

Link to comment
Share on other sites

1 hour ago, JetSetIlly said:

 

Github project. The second commit shows the changes I made to target PlusCart.

 

https://github.com/JetSetIlly/plusromtest_cdfj

 

do you have a build of this version?

The version of collect3 I used is 3 months older, and I am not sure if it is working properly..

 

 

Link to comment
Share on other sites

33 minutes ago, Thomas Jentzsch said:

Thanks. That one works perfect in Gopher2600 (and my local Stella hack ;) ). :thumbsup:

 

Now we only new @Andrew Davie to succeed with Cubix and we have a test ROM for our emulator and PlusCart development too.

 

 

I'd throw up the source code for everyone to play with, but it's an embarrassing test-bed/mess.

 

Link to comment
Share on other sites

1 hour ago, Thomas Jentzsch said:

@Al_Nafuur Wasn't there someone developing a UnoCart/PlusCart exclusive game? I somehow remember this from a @ZeroPage Homebrew stream.

There were two games that were UnoCart exclusive that I had on the show. The binaries were not publicly released and I haven't heard about any further development on the games.

 

It was the Jun 19, 2019 episode with the games Gorilla Force & Wushu Masters by @ZackAttack & @MayDay.

 

- James

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Andrew Davie said:

I made some progress, but I am stuck at the "defines_from_dasm_for_c.h" file. The ROM and RAM addresses have an offset of 0x00000000, but for STM32F the ROM addresses need an offset of 0x20000000. Does anyone have an idea how to fix that automatically?

Edited by Thomas Jentzsch
Link to comment
Share on other sites

9 minutes ago, Thomas Jentzsch said:

I made some progress, but I am stuck at the "defines_from_dasm_for_c.h" file. The ROM and RAM addresses have an offset of 0x00000000, but for STM32F the ROM addresses need an offset of 0x20000000. Does anyone have an idea how to fix that automatically?

these defines are from dasm and, as far as i know, already an offset to the ARM base address. So they don't need to be changed or only if you use them in your C code

 

Link to comment
Share on other sites

2 minutes ago, Thomas Jentzsch said:

I made some progress, but I am stuck at the "defines_from_dasm_for_c.h" file. The ROM and RAM addresses have an offset of 0x00000000, but for STM32F the ROM addresses need an offset of 0x20000000. Does anyone have an idea how to fix that automatically?

 

I don't think there's a satisfactory why to do that.

 

You could alter the awk script in the Makefile that generates the defines_from_dasm_for_c.h file so that the offset is added. But that doesn't sound like a good solution to me because it means putting information about the ARM in the 6507 half of the project.

 

You could have a second awk script I suppose that processes the .h file further but again, that sounds clumsy.

 

The best solution, and this doesn't really help you here, is to code so that the ROM value (defined in defines_cdfj.h) is added to all memory offsets - even if ROM is 0x0.

 

 

 

Link to comment
Share on other sites

Just now, Thomas Jentzsch said:

Well, @JetSetIlly changed them in his Collect3 code.

that was not necessary (or a fault), but as long as they are not used in the C code it will work.

 

 Usually they are used as "array-index" to the RAM base address (e.g. https://github.com/andrew-davie/Cubix/blob/master/main/main.c#L42)

    while (i < _ARENA_SCANLINES) {
        RAM[_BUF_COLUPF + i] = ColourConvert(colour[cno]);
        RAM[_BUF_COLUBK + i] = bgCol;
        cno = cnoNext[cno];
        i++;
    }
Link to comment
Share on other sites

Just now, JetSetIlly said:

I don't think there's a satisfactory why to do that.

I think some find and replace would work here:

  1. Replace 0x00... with e.g. xxxx....
  2. Replace 0x.... with 0x2000
  3. Replace xxxx with 0x00

But I don't know command line tools which could be integrated into the makefile.

Link to comment
Share on other sites

1 minute ago, Thomas Jentzsch said:

I think some find and replace would work here:

  1. Replace 0x00... with e.g. xxxx....
  2. Replace 0x.... with 0x2000
  3. Replace xxxx with 0x00

But I don't know command line tools which could be integrated into the makefile.

I don't think it should be done this way. I think using defined ROM/RAM base addresses will make it easier to switch between a STM32 and LPC200 build for the developer.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...