At least! I know how to create a megarom with SDCC in the correct way.

Por samsaga2

Resident (60)

Imagen del samsaga2

03-06-2021, 11:50

With the last SDCC version (I don't know with the previous) the z80 target has support for banks. You can create a megarom without doing weird things. Calling methods from one page to another is totaly transparent (with a little performance cost).

You can see my test project at https://github.com/samsaga2/sdcc_megarom. It is far from finished, now it only supports changing the second page. But it works and we can have a complete solution with a little of work.

Summary
- Generate banking code directly from the SDCC
- Call to a function in the same module has not any performance penalty, only calling from one bank to another.
- I am using the SDCC way, is not an external utility that could stop working with new SDCC versions.
- My code is unfinished but a complete solution can be done.

Login sesión o register para postear comentarios

Por samsaga2

Resident (60)

Imagen del samsaga2

06-06-2021, 18:00

I have updated the github code. Now it is a fully workable konami megarom compiled with sdcc.
You can call any function in any page and sdcc, transparently, it will manage the page changes for you.

Por geijoenr

Master (254)

Imagen del geijoenr

06-06-2021, 18:44

Congratulations...

Not to diminish your achievement, but this has been solved for a long time in different ways in previous versions of sdcc. See:

https://github.com/retrodeluxe/sdcc-msx
https://github.com/retrodeluxe/rlengine-msx
https://github.com/MartinezTorres/sdcc_msx

Por samsaga2

Resident (60)

Imagen del samsaga2

07-06-2021, 08:56

I was already familiar with the K5link. The others I didn't, even though I had been diving a lot in github.

Anyway, all of these only works with previous versions of SDCC. With SDCC 4 the things has changed a little. And I think it is important to update. In the near future it seems that they are going to implement functions parameters using registers in z80 and the register allocator is being improved.

geijoenr wrote:

Congratulations...

Not to diminish your achievement, but this has been solved for a long time in different ways in previous versions of sdcc. See:

https://github.com/retrodeluxe/sdcc-msx
https://github.com/retrodeluxe/rlengine-msx
https://github.com/MartinezTorres/sdcc_msx