Search found 1927 matches

by alvin
Wed Apr 18, 2018 8:10 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

I can give a more complete answer when I have time later tonight. The immediate problem is you are not exporting the name "_main" from your asm file. Within each file all symbols are local unless you explicitly export them with a PUBLIC directive. The crt that starts the program (the start...
by alvin
Wed Apr 04, 2018 3:40 pm
Forum: MSX, SVI, TMS99x8 and Sega Master System
Topic: The file I/O does not work?
Replies: 9
Views: 9345

Thanks for the links. Newlib still doesn't have file io integrated but a couple of targets have added file io in parallel. For example, the ChanFatFS system for yaz180 (and any other target) has been compiled and it used names that ensure it doesn't conflict with the C library. So FILE becomes FIL, ...
by alvin
Sun Apr 01, 2018 2:40 pm
Forum: Sinclair ZX
Topic: ZX81: Plot, Unplot and test-point for LOWRES (64x44) screen
Replies: 57
Views: 43007

z88dk/lib/config/trs80.cfg is missing a minus in the disk subtype line: .. SUBTYPE default -lgfxtrs80 SUBTYPE disk lgfxtrs80 -Cz--cmd SUBTYPE wav -lgfxtrs80 -Cz--audio -Cz--fast .. I'll commit that now. I don't see how zcc is turning "lgfxtrs80" into "lgfxtrs80.asm.m4".
by alvin
Sun Apr 01, 2018 2:20 pm
Forum: Sinclair ZX
Topic: Newbie in need of help!
Replies: 43
Views: 32781

> But is there a reason why the characters number 8, 9 and 10 do not appear on the screen?

8 is usually backspace and 10 is \r on machines that swap \r and \n (like the zx81 I think). That could be the reason but I am not too familiar with the zx81 codebase.
by alvin
Fri Mar 30, 2018 9:21 pm
Forum: CP/M, FLOS and OS related
Topic: Hitting a linking problem zcc/z80asm externs etc.
Replies: 5
Views: 6203

It works for me with both compile lines: zcc +cpm -O3 -vn -DMALLOC --c-code-in-asm --list -no-cleanup -create-app foo.c bar.c zcc +cpm -O3 -s -m -DAMALLOC --c-code-in-asm --list -no-cleanup -create-app foo.c bar.c I think you have an older version that may have some problems you're seeing. The "...
by alvin
Fri Mar 30, 2018 3:42 pm
Forum: Sinclair ZX
Topic: Latest version and ZX81
Replies: 30
Views: 20315

ex af,af'
should be fine now :)
by alvin
Fri Mar 30, 2018 3:39 pm
Forum: Sinclair ZX
Topic: Optimize for speed? Unefficient code
Replies: 16
Views: 13278

Although be careful because the post increment and pre increment don't mean the same thing.

if (ev++) ...

Means increment the value but use the old value in the if test. That's why the following "dec hl" must be there.

if (++ev) ...

Mean increment the value and use that for the if test.
by alvin
Fri Mar 30, 2018 3:32 pm
Forum: CP/M, FLOS and OS related
Topic: Hitting a linking problem zcc/z80asm externs etc.
Replies: 5
Views: 6203

Issue found with filenames and sccz80 compiles:
https://github.com/z88dk/z88dk/issues/673
by alvin
Fri Mar 30, 2018 3:20 pm
Forum: CP/M, FLOS and OS related
Topic: Hitting a linking problem zcc/z80asm externs etc.
Replies: 5
Views: 6203

I didn't encounter the error (although I did encounter another one, see next post): foo.c int trace; void main(void) { } bar.c extern int trace; void bla(void) { int i = trace; } (guessing cpm target although it won't matter for this test) classic sccz80: zcc +cpm foo.c bar.c -o baz -create-app clas...
by alvin
Mon Mar 26, 2018 3:02 pm
Forum: Sinclair ZX
Topic: Compile and link vs. whatever zcc does
Replies: 10
Views: 7818

I guess the best way to see what pragmas were active in a compile is to take a look at the zcc_opt.def file after the binary is built. In this case you would have noticed the REGISTER_SP pragma was missing from the file.
by alvin
Mon Mar 26, 2018 2:58 pm
Forum: Sinclair ZX
Topic: Compile and link vs. whatever zcc does
Replies: 10
Views: 7818

The pragma is not active in the object file compile version so that the stack is not initialized at address 0xd000. zcc +zx -vn -c -clib=sdcc_iy sp1_test.c This sees the pragma and creates the file "zcc_opt.def" to store the initial stack location. Pragmas are communicated to the crt when ...
by alvin
Mon Mar 26, 2018 2:41 pm
Forum: Sinclair ZX
Topic: Compile and link vs. whatever zcc does
Replies: 10
Views: 7818

You're right. Something odd there - I'm looking into it now. The object linked one is sitting on a halt with ints disabled.
by alvin
Mon Mar 26, 2018 2:37 pm
Forum: Sinclair ZX
Topic: Compile and link vs. whatever zcc does
Replies: 10
Views: 7818

try this:

Code: Select all

zcc +zx -v -c -clib=sdcc_iy sp1_test.c
zcc +zx -v -startup=31 -clib=sdcc_iy sp1_test.o -o sp1_test -create-app
Make sure the old objects are gone just in case an error is occurring and it's picking up an old .o
by alvin
Mon Mar 26, 2018 2:29 pm
Forum: Sinclair ZX
Topic: Compile and link vs. whatever zcc does
Replies: 10
Views: 7818

It looks like I doddle a lot more tan dom :)
by alvin
Mon Mar 26, 2018 2:25 pm
Forum: Sinclair ZX
Topic: Compile and link vs. whatever zcc does
Replies: 10
Views: 7818

If I build it with these two lines: zcc +zx -compiler=sdcc -c sp1_test.c -o sp1_test.o -I$ZCCCFG/../../include/_DEVELOPMENT/sdcc zcc +zx -v -startup=31 -clib=sdcc_iy sp1_test.o -o sp1_test -create-app then I'm not sure what happens. The machine locks up (expected since there's an infinite loop) but...
by alvin
Mon Mar 26, 2018 2:04 pm
Forum: Sinclair ZX
Topic: Latest version and ZX81
Replies: 30
Views: 20315

And what seed should I use for srand()? srand() always requires a seed value. I think you probably avoided an error and got a warning instead because stdlib.h wasn't included. srand(0) corresponds to the default seed value compiled into the binary. If you need a random seed you need some external e...
by alvin
Fri Mar 16, 2018 11:25 pm
Forum: Sinclair ZX
Topic: SP1 on zx: do I need to sync to the raster?
Replies: 1
Views: 2514

Received wisdom for Spectrum developers is that graphics will flicker unless display file updates are done when the raster is doing the border. Does SP1 have a way round this? Is sync with the raster really not necessary? No syncing is necessary. Flicker happens when you erase sprites and redraw th...
by alvin
Sat Mar 10, 2018 5:38 pm
Forum: Other targets
Topic: printf and creating custom stdout and stdin routines.
Replies: 35
Views: 26469

Yeah this is an idea being considered. Currenty a particular target defines io ports, etc, in its config directory. The yaz180 has a lot as does the zxn target. As an example: https://github.com/z88dk/z88dk/tree/master/libsrc/_DEVELOPMENT/target/zxn/config The *.m4 contain configuration information....
by alvin
Sat Mar 10, 2018 4:30 pm
Forum: Sinclair ZX
Topic: SP1: What's the "graphic" argument in sprite creation?
Replies: 10
Views: 8444

You give zeroes as the graphic data to the Create and AddCol functions, then the absolute address of the graphic data in the Move function's frame argument. Yes that's right. It's not always zeroes though for the columns. The number is an offset from the start of the frame or an absolute address of...
by alvin
Sat Mar 10, 2018 6:03 am
Forum: Sinclair ZX
Topic: SP1: What's the "graphic" argument in sprite creation?
Replies: 10
Views: 8444

sp1.h says the signature for sp1_CreateSpr is: sp1_CreateSpr(void *drawf,uint16_t type,uint16_t height,int graphic,uint16_t plane) I'm trying to work out what the 'graphic' value is for. ... The sp1_AddColSpr() routine has a similar argument, which might be related? I can't find anything on that ei...
by alvin
Thu Mar 08, 2018 4:29 am
Forum: Other targets
Topic: printf and creating custom stdout and stdin routines.
Replies: 35
Views: 26469

I've added the input terminal instantiation to the example code here: https://github.com/z88dk/z88dk/tree/master/libsrc/_DEVELOPMENT/EXAMPLES/z80/stdio As before some subroutines have to be provided to customize for your hardware, all in the terminal/term_01_input_char directory: https://github.com/...
by alvin
Wed Mar 07, 2018 8:45 pm
Forum: Other targets
Topic: Raw output option
Replies: 3
Views: 3891

Adding a text terminal to stdin, stdout, stderr for a standalone system is being talked about in NexesOne's post: https://www.z88dk.org/forum/viewtopic.php?id=10223 An example is forming in the newlib z88dk examples directory to add stdin and stdout and I should be putting in stdin later today: http...
by alvin
Wed Mar 07, 2018 8:42 pm
Forum: Other targets
Topic: Raw output option
Replies: 3
Views: 3891

The +z80 target in the newlib is intended for generating standalone code for sbc machines:
https://www.z88dk.org/wiki/doku.php?id= ... t_embedded

Setting up im2 mode is now done differently (and better) but is not yet documented:
https://github.com/z88dk/z88dk/issues/573
by alvin
Wed Mar 07, 2018 3:33 pm
Forum: Sinclair ZX
Topic: putchar and backspace
Replies: 6
Views: 6090

Ok, good that z88dk doesn't use the system variables area (except when configured to do so). Just to be sure, z88dk doesn't use the LASTK system variable for keyboard handling either? In the input terminals there is a LASTK keyboard driver available but none of the terminals use it - they all use t...
by alvin
Tue Mar 06, 2018 6:35 pm
Forum: Sinclair ZX
Topic: putchar and backspace
Replies: 6
Views: 6090

For now, I'm thinking of doing my own buffering in the output function called by the Magnetic interpreter and handle backspace there. That's probably the best solution. By the way, is it safe to use the memory area 0x5800 - 0x6000 (between the two Times hi-res display buffers)? The C library in z88...