Search found 121 matches

by derekfountain
Wed Feb 14, 2024 9:03 pm
Forum: Sinclair ZX
Topic: How to allocate a variable in a specific memory location
Replies: 12
Views: 287

Re: How to allocate a variable in a specific memory location

Thank you everyone, I didn't realise it would be this complex. I'd have thought this feature was essential to anyone making a ZX spectrum game You have to remember that z88dk supports over 100 different targets, and weirdness like contended memory on one particular platform needs to be dealt with i...
by derekfountain
Sat Feb 10, 2024 11:45 am
Forum: Sinclair ZX
Topic: How to allocate a variable in a specific memory location
Replies: 12
Views: 287

Re: How to allocate a variable in a specific memory location

I've written a couple of games where I had this exact problem. I don't think __at() is the right way to approach it, you're asking an awful lot from a very simple feature which wasn't really designed for this. The correct way to solve the problem is to use sections. Unfortunately sections aren't eas...
by derekfountain
Wed Aug 16, 2023 11:03 am
Forum: Other platforms
Topic: Better Linux Install Experience?
Replies: 50
Views: 55643

Re: Better Linux Install Experience?

What are you trying to install from? What did you download and what command did you use to run the install?
by derekfountain
Sun Jul 02, 2023 5:17 pm
Forum: Project Activity
Topic: ez80-clang supported as compiler
Replies: 4
Views: 1789

Re: ez80-clang supported as compiler

Do you have any feeling on the speed of the generated code relative to the other two compilers?
by derekfountain
Sun May 07, 2023 8:36 am
Forum: Sinclair ZX
Topic: Using SP1 for scroller games
Replies: 46
Views: 17460

Re: Using SP1 for scroller games

Yes, I've moved from z88dk to other projects for a while, but I'm following along too. :)
by derekfountain
Fri Jan 06, 2023 7:43 pm
Forum: Sinclair ZX
Topic: Thanks for the 'ZX Spectrum getting started guide'
Replies: 2
Views: 908

Re: Thanks for the 'ZX Spectrum getting started guide'

Just to confirm the updates suggested here went into the ZX Getting Started Guide earlier today. Thanks for the input, much appreciated.
by derekfountain
Thu Dec 29, 2022 9:57 am
Forum: Misc
Topic: Change BSS org address
Replies: 1
Views: 1430

Re: Change BSS org address

Have a look here. In particular, the CRT_ORG_BSS, CRT_ORG_DATA and CRT_ORG_CODE pragmas are what you're looking for.
by derekfountain
Fri Dec 02, 2022 9:02 am
Forum: Sinclair ZX
Topic: Thanks for the 'ZX Spectrum getting started guide'
Replies: 2
Views: 908

Re: Thanks for the 'ZX Spectrum getting started guide'

I've just worked through all of the the 'ZX Spectrum getting started guide' and it was most excellent, a really useful introduction to a good range of topics. Many thanks! Thank you! You remind me, it needs a bit of a refresh to prevent too much bit rot getting in there. I'll get round to your sugg...
by derekfountain
Thu Oct 27, 2022 1:17 pm
Forum: Misc
Topic: Misc functions
Replies: 8
Views: 1156

Re: Misc functions

jorgegv wrote: Thu Oct 27, 2022 8:44 am Just a small enhancement (a classic):

Code: Select all

void swap(int *p1, int *p2)
{
         // no temps needed
         *p1^=*p2;
         *p2^=*p1;
         *p1^=*p2;
}
Have you seen what the compiler makes of that? An enhancement it is not... :)
by derekfountain
Wed Aug 31, 2022 9:08 am
Forum: Sinclair ZX
Topic: change default font with FZX in nirvana
Replies: 11
Views: 2876

Re: change default font with FZX in nirvana

I've never used FZX and I'm not sure how much knowledge there is about it in the z88dk world.

You could try starting a new thread with an appropriate subject line and your example code so far.
by derekfountain
Sun Aug 28, 2022 8:50 am
Forum: Sinclair ZX
Topic: change default font with FZX in nirvana
Replies: 11
Views: 2876

Re: change default font with FZX in nirvana

FZX is a font engine for the Spectrum:

https://spectrumcomputing.co.uk/entry/2 ... ectrum/FZX

It's been integrated into z88dk so you can use its features from C.

As you were unaware of that I suspect it's probably not what you should be using at the moment. :)
by derekfountain
Thu Aug 25, 2022 3:03 pm
Forum: Sinclair ZX
Topic: change default font with FZX in nirvana
Replies: 11
Views: 2876

Re: change default font with FZX in nirvana

and another question, testing without nirvana using -clib=ansi and setting #pragma define ansicolumns=42 could change the number of columns... is there a similar parameter in fzx or using -clib=sdcc_iy? What exactly are you trying to achieve? Specifying a number of columns with proportionally space...
by derekfountain
Sun Aug 21, 2022 3:05 pm
Forum: Sinclair ZX
Topic: change default font with FZX in nirvana
Replies: 11
Views: 2876

Re: change default font with FZX in nirvana

Really Timmy? I tried the demo the OP linked to with stdio and -startup=9 and it seems to work fine:

Image
by derekfountain
Fri Aug 19, 2022 4:05 pm
Forum: Sinclair ZX
Topic: change default font with FZX in nirvana
Replies: 11
Views: 2876

Re: change default font with FZX in nirvana

The nirvana example uses printf(), and hence requires stdio. To use FZX with stdio you need to use a stdio driver which supports it. There are two of those: number 8, which enables FZX but doesn't support control codes embedded in the output string, and number 9, which enables FZX and does support e...
by derekfountain
Wed Jul 27, 2022 7:24 pm
Forum: Sinclair ZX
Topic: Why is my ROM writable code not working?
Replies: 3
Views: 1965

Re: Why is my ROM writable code not working?

Yes, making it my code:

Code: Select all

volatile uint8_t byte0 = z80_bpeek(0);
fixes it for 2.2.

So the compiler is assuming that it's already got a copy of the value at 0x0000 and thinks it doesn't need to reread it. So is what it's doing valid? I think it is, isn't it? I'm not sure what the rules are...
by derekfountain
Wed Jul 27, 2022 6:25 pm
Forum: Sinclair ZX
Topic: Why is my ROM writable code not working?
Replies: 3
Views: 1965

Re: Why is my ROM writable code not working?

I just reverted to my 2.1 install which has >zsdcc -v ZSDCC IS A MODIFICATION OF SDCC FOR Z88DK Build: 4.0.7 #12036 (Linux) Nov 27 2021 That works. The generated code is 491 004E _is_rom_writable: 492 004E ;tracetable.c:58: uint8_t byte0 = z80_bpeek(0); 493 004E 21 00 00 ld hl,0x0000 494 0051 4E ld ...
by derekfountain
Wed Jul 27, 2022 6:17 pm
Forum: Sinclair ZX
Topic: Why is my ROM writable code not working?
Replies: 3
Views: 1965

Why is my ROM writable code not working?

I have this piece of code which checks to see if the Spectrum's ROM is writable (which on an emulator it might be): uint8_t is_rom_writable(void) { uint8_t byte0 = z80_bpeek(0); z80_bpoke( 0, ~byte0 ); if( z80_bpeek(0) == byte0 ) return 0; z80_bpoke( 0, byte0 ); return 1; } So peek the byte at 0000,...
by derekfountain
Tue Jul 26, 2022 5:29 pm
Forum: Misc
Topic: z80asm user manual disappeared from 2.2?
Replies: 2
Views: 1068

Re: z80asm user manual disappeared from 2.2?

Excellent, thank you!
by derekfountain
Tue Jul 26, 2022 10:37 am
Forum: Misc
Topic: z80asm user manual disappeared from 2.2?
Replies: 2
Views: 1068

z80asm user manual disappeared from 2.2?

In 2.1 the z80asm user manual was in doc/z80asm.txt (and the HTML equivalent). It appears to have disappeared? Where did it go?
by derekfountain
Mon Jul 25, 2022 9:50 am
Forum: Announcements
Topic: z88dk v2.2 released
Replies: 5
Views: 6680

Re: z88dk v2.2 released

See the comment I added to the PR. :)
by derekfountain
Sun Jul 24, 2022 10:30 am
Forum: Announcements
Topic: z88dk v2.2 released
Replies: 5
Views: 6680

Re: z88dk v2.2 released

Hmmm, I can't be the only person who went to Github, clicked the green "Code" button, then hit "Download ZIP" from the dropdown that appears. Is there any merit in putting a check in the build script to stop with an informative error if it finds the external dependency directorie...
by derekfountain
Sat Jul 23, 2022 4:37 pm
Forum: Announcements
Topic: z88dk v2.2 released
Replies: 5
Views: 6680

Re: z88dk v2.2 released

Struggling to build on my Ubuntu Focal box. I downloaded the z88dk-2.2.zip straight from the github site, then followed the instructions in the installation wiki page. I needed to install uthash-dev, so I think that should be added to the dependencies list? Even then it still fails to build: ccache ...
by derekfountain
Fri May 20, 2022 9:13 am
Forum: Sinclair ZX
Topic: math16 on the Spectrum
Replies: 20
Views: 8173

Re: math16 on the Spectrum

Yes, everything I found got fixed. :)
by derekfountain
Wed May 18, 2022 7:37 am
Forum: Sinclair ZX
Topic: math16 on the Spectrum
Replies: 20
Views: 8173

Re: math16 on the Spectrum

I'm quite interested in what the use case is, the best I can come up with is something graphically related. It was 6 months ago, but since I finally finished the project I'll fill in this blank. ;) I started with a port of the Boids algorithm, as demonstrated here . I implemented it on Linux, then ...
by derekfountain
Mon May 09, 2022 2:39 pm
Forum: Sinclair ZX
Topic: zsdcc register usage
Replies: 8
Views: 2491

Re: zsdcc register usage

"PUSH rr" is 11 Ts, and I need 4 of them, plus PUSH IX and PUSH IY (15 Ts each), then an EXX (4 Ts), then 3 more PUSHes for the alternate set, then another EXX... 155 Ts. Plus about the same to put everything back when the routine exists. I'm rewriting the routine in ASM because it's calle...