Search found 1927 matches

by alvin
Sat May 05, 2018 3:31 pm
Forum: Sinclair ZX
Topic: Compiling a ROM replacement with custom CRT0 - how to handle data/bss
Replies: 8
Views: 8578

In the above you are using the classic library. The newlib library has a +z80 target that is intended for bare metal machines that you may want to check out. 1. The documentation is here: https://www.z88dk.org/wiki/doku.php?id=libnew:target_embedded 2. Newlib source is rooted here: https://github.co...
by alvin
Fri May 04, 2018 3:32 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

Offline we got the sample code to work. The main issue with dot commands written for other assemblers is that those commands are "bare" in the sense there is no code running before or after the dot command is started. With the z88dk dot command subtypes, the crt is present and roughly does...
by alvin
Tue May 01, 2018 2:44 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

The thing I did not do is ld hl,0 ; report success to esxdos I have just read your post about the specifics of HL for z88dk or esxDOS. Yes that will do it. You have to be careful with the return value to esxdos because one combination of register settings (or HL > 255 with z88dk's crt) will treat t...
by alvin
Tue May 01, 2018 2:35 pm
Forum: Sinclair ZX
Topic: SP1: What's the "graphic" argument in sprite creation?
Replies: 10
Views: 8444

Also I should remind that changes to the sprite do not become visible unless the sprite is redrawn either by invalidating the characters the sprite occupies (there is a "struct sp1_Rect" structure at the top of "struct sp1_ss" so you can in fact "sp1_Invalidate(sprite)"...
by alvin
Tue May 01, 2018 2:26 pm
Forum: Sinclair ZX
Topic: SP1: What's the "graphic" argument in sprite creation?
Replies: 10
Views: 8444

is simple, but changing the sprite structure directly goes behind the (presumably opaque) interface. Do you recommend beginners take that approach? Yeah I would agree this is probably the easiest to talk about. Mentioning that the 0 in the move* functions means it will not alter the frame address y...
by alvin
Tue May 01, 2018 12:31 am
Forum: Sinclair ZX
Topic: SP1: What's the "graphic" argument in sprite creation?
Replies: 10
Views: 8444

In retrospect, -1 (0xffff) would have been a better choice to indicate that the sprite image should not be changed but I think this ship has sailed now since 0 is being used in real software. I think for the next version I will change this to a defined constant and probably move away from 0. This ve...
by alvin
Tue May 01, 2018 12:16 am
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

I should add the return value in HL is specific to z88dk since z88dk's crt looks at HL to generate the error for esxdos. If making a bare binary without crt or using another assembler, the return value must be what esxdos expects: https://github.com/z88dk/z88dk/blob/master/libsrc/_DEVELOPMENT/target...
by alvin
Mon Apr 30, 2018 9:33 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

This next one uses z88dk's print functionality instead of the ROM's. This means you can print strings that are stored in the dot command without copying them to ram first. So we return to the regular dot command in 8k-16k limited to 8k size. The startup value will 30 in the compile so that z88dk's s...
by alvin
Mon Apr 30, 2018 8:54 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

Yes you can go to bed happy :) I'll put a couple more examples here of doing things a little differently so you're aware of them. The last one I showed up there was a plain dot command. It copied the string into ram before calling the PR_STRING rom routine to print it. This is not good because the r...
by alvin
Mon Apr 30, 2018 8:06 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

This works: zzz.asm ; zcc +zxn -vn -startup=31 -clib=sdcc_iy zzz.asm -o zzz -subtype=dot -create-app ; copy "ZZZ" to /bin on the sd card and run with ".ZZZ" SECTION code_user PUBLIC _main _main: ; copy message to ram ld hl,msg_src ld de,msg_ram ld bc,msg_src_end - msg_src ldir ; ...
by alvin
Mon Apr 30, 2018 7:42 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

I'll have some time in a bit and will give it a go.
by alvin
Mon Apr 30, 2018 7:35 pm
Forum: Sinclair ZX
Topic: SP1: What's the "graphic" argument in sprite creation?
Replies: 10
Views: 8444

number_simple.c: /* * zcc +zx -vn -m -startup=1 -clib=sdcc_iy number_simple.c number_sprite.asm -o number_simple -create-app */ #pragma output REGISTER_SP = 0xD000 #include <arch/zx.h> #include <z80.h> #include <arch/zx/sp1.h> #include <stdio.h> extern unsigned char number[]; struct sp1_Rect full_sc...
by alvin
Mon Apr 30, 2018 7:30 pm
Forum: Sinclair ZX
Topic: SP1: What's the "graphic" argument in sprite creation?
Replies: 10
Views: 8444

This is something I'd completely forgotten... if the animation offset is 0 it means "do not change the graphic". So this is a problem for doing things this way. A little think is in order to figure out if this behaviour should be changed. In the meantime, there is another way to write the ...
by alvin
Mon Apr 30, 2018 7:13 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

I should add: using startup=30 will mean stdio uses RST$10 to print as expected by dot commands and you still have access to asm_write ( https://github.com/z88dk/z88dk/blob/master/libsrc/_DEVELOPMENT/fcntl/z80/asm_write.asm#L24 ), asm_puts ( https://github.com/z88dk/z88dk/blob/master/libsrc/_DEVELOP...
by alvin
Mon Apr 30, 2018 7:09 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

In the example above I have not included the relocation of what would be the equivalent to 'msg' being out of the way at a high memory location but I have learned how to do that bit (yes, easy when you know how). That's the only thing I can see that is potentially wrong with what you've done: ld de...
by alvin
Sun Apr 22, 2018 10:31 pm
Forum: Sinclair ZX
Topic: ZX81: Plot, Unplot and test-point for LOWRES (64x44) screen
Replies: 57
Views: 43007

BTW, it seems that compiling for the TRS-80 with the subtype "disk" is broken now. With yesterdays nightly when you compile like this... zcc +trs80 -lndos -lm -create-app -o plottest_trs80.bin -subtype=disk plottest.c ...at this step... PROCESSING lgfxtrs80.asm.m4 m4 -I "C:\Misc\z88d...
by alvin
Sun Apr 22, 2018 10:25 pm
Forum: Windows
Topic: v1.99B Windows XP
Replies: 4
Views: 7651

I downloaded the nightly build and this works fine thank you. It was only the stable version. I tried three times. Anyway, problem solved so thank you! I'm glad you got it to work. I'm thinking it might be something to do with XP. For a time we were compiling with Visual Studio targetting win vista...
by alvin
Sun Apr 22, 2018 5:05 pm
Forum: Windows
Topic: v1.99B Windows XP
Replies: 4
Views: 7651

It seems to be fine: C:\>dumpbin /headers psdcc.exe Microsoft (R) COFF/PE Dumper Version 14.00.24215.1 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file zsdcc.exe PE signature found File Type: EXECUTABLE IMAGE FILE HEADER VALUES 14C machine (x86) 6 number of sections 58693B08 ti...
by alvin
Sun Apr 22, 2018 4:53 pm
Forum: Windows
Topic: v1.99B Windows XP
Replies: 4
Views: 7651

Use the current version instead. 1.99B is more than a thousand commits behind and some things have changed a lot. A binary package can be downloaded from http://nightly.z88dk.org/. Just unzip where you want it and set ZCCCFG and the PATH as mentioned here: https://www.z88dk.org/wiki/doku.php?id=temp...
by alvin
Sat Apr 21, 2018 2:45 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

After reading about dot, dotx and dotn I did actually try compiling those variants yesterday in a bit of a 'clutching at straws' moment. I saw a RAMTOP error message with dotx so knew it was compiled as a proper dotx variant. By default dotx splits the program between divmmc in 8k-16k and main ram ...
by alvin
Sat Apr 21, 2018 2:39 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

That's how I think it works - I haven't actually tried it. You can try it by calling PR_STRING with rst$18 and see if it will work.
by alvin
Sat Apr 21, 2018 2:37 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

After reflecting a bit more on the dot command notes I removed the 'message to screen' section out of my code and left just the border flashing bit. Guess what, It worked! Would this happen to be, by any chance, because I am using the PR_STRING routine which is located at 0x203C and my ORG is at 0x...
by alvin
Fri Apr 20, 2018 4:18 pm
Forum: Other targets
Topic: VZ200 / VZ300 Function: POINT()
Replies: 7
Views: 6275

Thanks bushy555. This should be something looked at by stefano as he's currently working on this area in the classic library.
by alvin
Fri Apr 20, 2018 4:05 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

....I just used ORG 0x2000 (or what ever the dot command location should be). There's no need for any ORG. "-subtype=dot" sets up a memory map with org already set to 0x2000. Instead place your code in "SECTION code_user". This will place it in that container and the memory map ...
by alvin
Thu Apr 19, 2018 4:24 pm
Forum: Sinclair ZX
Topic: Error creating a compile for a zxn dot command
Replies: 30
Views: 23655

Continuing with a little more information. z88dk works like commercial tools rather than like the assemblers normally used with the spectrum. So there are object files, libraries and linking and along with that comes the concept of local and global scope of labels. A project can consist of a lot of ...