[z88dk-dev] ZX Spectrum

Bridge to the z88dk-developers mailing list
Post Reply
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

[z88dk-dev] ZX Spectrum

Post by stefano »

I was trying to list the available (and possible) CP/M extensions for specific targets:
http://www.z88dk.org/wiki/doku.php?id=p ... extensions

I noticed we still didn't succeed to produce a valid extension for the Spectrum +3 (Locomotive CP/M)
On that case the video is not directly reachable, and the only unchanged page is the last one (I think it is at C000)
Is there already a way to compile and link a separate block (i.e. for graphics) and refer to it via a map file ?



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

On that case the video is not directly reachable, and the only unchanged page is the last one (I think it is at C000)
Is there already a way to compile and link a separate block (i.e. for graphics) and refer to it via a map file ?
Yes just add sections to the memory map in the crt for each bank you want to define.

Here's what I did for the new c lib sms target:

http://z88dk.cvs.sourceforge.net/viewvc ... iew=markup
(by default all the org are 0x8000)

If the program puts anything in any of those sections so that they are non-zero in size, z80asm will output a separate bin named "outname_BANK_nn.bin" that can be placed in memory somehow. In create-app, sms.c looks for these banks and adds them to a .sms file which is a flat rom file as large as necessary to hold all these banks.

For the spectrum you can add new banks BANK_nn and put stuff in there to get a separate bin out. After that you have to figure out how to add that to a tap or some other emulator form in appmake. The compilers are not going to do bankswitching for you so if the program needs to use data in that bank, it has to take care of all the bankswitching details. Right now the new c llib is putting "common code", ie code that has to be present in all banking configurations, into a section called "code_crt_common" so that it appears very early in the main bank's output binary. Hopefully low addresses do not get banked out in the bankswitching model used.

sdcc can place c code in specific memory banks on a per-file basis with --code-seg and --const-seg. There also needs to be a --bss-seg and --data-seg. I'm looking at adding these to sccz80 as well.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

and refer to it via a map file ?
Forgot to add: there's no difference in how symbols are referred to, banked or not. z80asm does generate symbol names to demarcate the boundaries of individual sections: __sectionname_head, __sectionname_tail, __sectionname_size



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

(...)
If the program puts anything in any of those sections so that they are non-zero in size, z80asm will output a separate bin named "outname_BANK_nn.bin" that can be placed in memory somehow. In create-app, sms.c looks for these banks and adds them to a .sms file which is a flat rom file as large as necessary to hold all these banks.

For the spectrum you can add new banks BANK_nn and put stuff in there to get a separate bin out.
This is definitely intriguing, I'll give it a try :cool:



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

This is definitely intriguing, I'll give it a try :cool:
Well the +3 Locomotive CP/M uses that page for the stack, so I found an easier (slow-ish) workaround to access the video memory.. coming soon ;)

Stefano



------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

Well the +3 Locomotive CP/M uses that page for the stack, so I found an easier (slow-ish) workaround to access the video memory.. coming soon ;)
The new variant of the library is now online.

I'd like to extend the specific CP/M and Spectrum sections to support the CP/M extensions and similar stuff.

Alvin, is it correct to just feed the legacy "libsrc/spectrum" and revive "libsrc/cpm/" ? Otherwise, could you help me getting straight to the right files in the new library ?



------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

Well the +3 Locomotive CP/M uses that page for the stack, so I found an easier (slow-ish) workaround to access the video memory.. coming soon ;)
The new variant of the library is now online.
I don't see how the +3 gets the extra functions when compiling for cp/m... how do you activate those things?
I'd like to extend the specific CP/M and Spectrum sections to support the CP/M extensions and similar stuff.
Alvin, is it correct to just feed the legacy "libsrc/spectrum" and revive "libsrc/cpm/" ? Otherwise, could you help me getting straight to the right files in the new library ?
The classic lib is completely separate so it's okay to make whatever modifications there.



------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

》I don't see how the +3 gets the extra functions when compiling for cp/m... how do you activate those things?

I inserted a new option (-startup=3), it loads a bank interposer in the stack, so I can poke the video memory etc..
Another way to get a similar result is a the user cp/ m extension by Amstrad.
The way I did it permits to alter the interposer to support other cpm variants



------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive.
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
Post Reply