Search found 2374 matches

by dom
Tue Feb 27, 2024 9:32 pm
Forum: Sinclair ZX
Topic: Bank 7 corruption while loading in Plus2A mode
Replies: 7
Views: 307

Re: Bank 7 corruption while loading in Plus2A mode

BTW, I was thinking: should this be added to the banked loader routine in CRT? I have checked and there is no provision for this, meaning that anyone who uses BANK7 up to address $E600 will get corrupted data at that address when loading in +2A/+3 machines, right? Good point, I've added it in to th...
by dom
Tue Feb 27, 2024 10:21 am
Forum: Sinclair ZX
Topic: Bank 7 corruption while loading in Plus2A mode
Replies: 7
Views: 307

Re: Bank 7 corruption while loading in Plus2A mode

See the disassembly here: https://github.com/ZXSpectrumVault/rom- ... .asm#L9212

Poking iy+1 should skip that check and prevent the corruption.
by dom
Tue Feb 27, 2024 6:42 am
Forum: Sinclair ZX
Topic: Bank 7 corruption while loading in Plus2A mode
Replies: 7
Views: 307

Re: Bank 7 corruption while loading in Plus2A mode

From memory the interrupt does some stuff up in page 7 - there’s a timer to turn off the disk motor.

Does loading in spectrum mode solve it?
by dom
Thu Feb 22, 2024 12:27 pm
Forum: Sinclair ZX
Topic: +zx81 Noob Question About Libraries
Replies: 19
Views: 2324

Re: +zx81 Noob Question About Libraries

pdr0663 wrote: Wed Feb 21, 2024 11:40 pm Sorry, I can see that it is supported from the earlier fortuitous post.

Is it ZX81 safe? I see it uses the alternate registers.

Paul
Unfortunately it uses the af' register for add, multiply and polynomial expansion so that's a no.

fix16 looks like it's good though.
by dom
Thu Feb 22, 2024 12:22 pm
Forum: Misc
Topic: switch jump table?
Replies: 6
Views: 216

Re: switch jump table?

For a large switch both mechanisms we use (the cp/jp as used for uint8_t and the value/address map used for other types) is not at all efficient. I'm not sure of the number of case statements where a binary search mechanism becomes more efficient - I'm guessing it might be around about 30 case state...
by dom
Mon Feb 19, 2024 6:56 pm
Forum: Sinclair ZX
Topic: __bss_compiler_head
Replies: 1
Views: 136

Re: __bss_compiler_head

I have a feeling that you might have too much uninitialised static data - 28k seems like quite a lot for a +zx bss_compiler will be from your code (and maybe a few bytes from some library routines depending on what you're using), the crt itself might use about a couple of hundred bytes depending on ...
by dom
Mon Feb 19, 2024 6:50 pm
Forum: Other platforms
Topic: Nightly build URL not responding!?
Replies: 6
Views: 6062

Re: Nightly build URL not responding!?

Sorry, for some reason the proxy VM keeps dropping off the network and leaves nothing in the logs to indicate why. My suspicion is that something on my network doesn't like VLANs (I've got a couple of other problems) but nothing concrete yet, Anyway, if it happens again let me know and I'll give it ...
by dom
Mon Feb 19, 2024 6:45 pm
Forum: CP/M, FLOS and OS related
Topic: Custom CPM target | Z80-Retro!
Replies: 2
Views: 149

Re: Custom CPM target | Z80-Retro!

When you set has_skew in the table, you also need to write a list of the sector orders - that might explain why your directory listing is off. Alternatively don't bother with skew and use a container - the skew is most useful for the raw images. By default, the CP/M target uses BDOS to handle std* s...
by dom
Sat Feb 17, 2024 7:45 pm
Forum: Misc
Topic: Recommendation for declaring constants
Replies: 6
Views: 182

Re: Recommendation for declaring constants

It's the same pattern - we use this one in the library to pass link time values from the crt to the library. The generated code is the same as my previous example. ; Assembler file PUBLIC _SCRM_TEXT1 defc _SCRM_TEXT1 = 0x1000 // C file extern void screenmode(int); extern void *SCRM_TEXT1; #define SC...
by dom
Fri Feb 16, 2024 8:40 pm
Forum: Misc
Topic: Recommendation for declaring constants
Replies: 6
Views: 182

Re: Recommendation for declaring constants

My preferred way is #define or enums, but you can achieve what you want this way:

Code: Select all

extern __at(0x1000) int SCRM_TEXT1;

extern void screenmode(int);

void func()
{
   screenmode((int)&SCRM_TEXT1);
}
And several permutations of similar ideas.
by dom
Mon Feb 12, 2024 10:13 am
Forum: Sinclair ZX
Topic: How to allocate a variable in a specific memory location
Replies: 12
Views: 345

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

Actually looking through the crt, there's an easier way if you just want data to go in there and not worry about the address of the data. When the org is < 32768 a section called CONTENDED is created. So, simply put all data into CONTENDED (using the #pragma method above) The startup will be at what...
by dom
Sun Feb 11, 2024 9:51 am
Forum: Other targets
Topic: NABU Computer Support
Replies: 94
Views: 556710

Re: NABU Computer Support

I've now exported the following functions: extern void __LIB__ nabu_set_interrupt(int enabled) __z88dk_fastcall; extern uint8_t __LIB__ nabu_set_interrupts(void); extern void __LIB__ nabu_enable_interrupt(uint8_t flags) __z88dk_fastcall; extern void __LIB__ nabu_disable_interrupt(uint8_t flags) __z8...
by dom
Sat Feb 10, 2024 5:44 pm
Forum: Other targets
Topic: NABU Computer Support
Replies: 94
Views: 556710

Re: NABU Computer Support

Hmmm. It’s a bit of a sledgehammer but there’s a nabu_set_interrupt in arch/nabu.h so you could disable the VDP interrupt.

There’s also uint8_t nabu_get_interrupt() which isn’t in the header yet.
by dom
Fri Feb 09, 2024 7:59 pm
Forum: Sinclair ZX
Topic: CP/M on the Spectrum: current library status
Replies: 2
Views: 188

Re: CP/M on the Spectrum: current library status

The other CP/M versions will require a parallel library build. The graphics code must stay in behind $8000 (I guess). I guess this is a parallel of the high memory graphics we have to do for some targets. Best thing to do here is to move code_graphics to earlier in the map if an option is set and t...
by dom
Fri Feb 09, 2024 7:18 pm
Forum: Sinclair ZX
Topic: How to allocate a variable in a specific memory location
Replies: 12
Views: 345

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

This is the first I've heard of someone wanting to place data at a particular address, the original intention behind the __at() syntax was I believe for access to system variables or data already existing in memory. However, it does look like data can be initialised and this should answer the questi...
by dom
Wed Feb 07, 2024 10:09 pm
Forum: Sinclair ZX
Topic: ZX81 Static Variables
Replies: 7
Views: 513

Re: ZX81 Static Variables

Can I ask then, is static void *sp[MAXSTACK] = {0}; a valid way to declare an ARRAY OF VOID POINTERS? If not, then how? That's a valid way to declare an array of void pointers and initialise them to NULL. For static variables, the {0} isn't that important (since without {0} the variable will end up...
by dom
Wed Feb 07, 2024 8:54 pm
Forum: Announcements
Topic: Forum registration
Replies: 1
Views: 349

Forum registration

It must be a year of elections... Unfortunately, one of the numerous Russian bot networks seems to have found us. I somehow don't expect them to be sharing interesting details about the design of the KR580VM80A As a result, forum registration might be disabled from time to time whilst I clean up the...
by dom
Thu Feb 01, 2024 5:04 pm
Forum: MSX, SVI, TMS99x8 and Sega Master System
Topic: How to display sprites on colecovision?
Replies: 2
Views: 322

Re: How to display sprites on colecovision?

There's examples in examples/msx/. ex4, ex6, ex7, ex8, ex9 all use sprites.
by dom
Thu Feb 01, 2024 4:57 pm
Forum: Sinclair ZX
Topic: Issues when migrating to classic lib
Replies: 15
Views: 641

Re: Issues when migrating to classic lib

So the code for classic should be (removing the noise):

Code: Select all

ld hl,__malloc_heap
ld bc,__heap_size
call asm_HeapAlloc
vs the following for newlib:

Code: Select all

ld hl,__malloc_block
ld bc,__heap_size
call asm_heap_init

by dom
Thu Feb 01, 2024 3:55 pm
Forum: Sinclair ZX
Topic: Issues when migrating to classic lib
Replies: 15
Views: 641

Re: Issues when migrating to classic lib

I think classic takes the address of a pointer to the heap start.
by dom
Tue Jan 30, 2024 6:18 pm
Forum: Sinclair ZX
Topic: Issues when migrating to classic lib
Replies: 15
Views: 641

Re: Issues when migrating to classic lib

I see you are initializing sp1 without parameters but one of those params is used specifically for requestimng the rotation tables, so i guess the error regarding SP1V_ROTTBL is due to that. You should use the init params. I think in newlib, the table is defined in config_private.inc and then expor...
by dom
Fri Jan 26, 2024 9:58 pm
Forum: MSX, SVI, TMS99x8 and Sega Master System
Topic: Complete noob in need of help! (Colecovision programming)
Replies: 6
Views: 418

Re: Complete noob in need of help! (Colecovision programming)

I don’t want to completely discourage you but I think it’s probably best if you do one of the free online C courses before you start developing for the coleco. If you’re on windows download visual studio to do the courses - it’s a fantastic environment for developing and debugging. If you’re on Linu...
by dom
Thu Jan 25, 2024 4:30 pm
Forum: MSX, SVI, TMS99x8 and Sega Master System
Topic: Complete noob in need of help! (Colecovision programming)
Replies: 6
Views: 418

Re: Complete noob in need of help! (Colecovision programming)

The Coleco joypad is handled by the int joystick(int stick_nr) function in <games.h>. The lower 8 bits return the directions (bit set for each direction that's pressed): #define MOVE_RIGHT 1 #define MOVE_LEFT 2 #define MOVE_DOWN 4 #define MOVE_UP 8 #define MOVE_FIRE 16 #define MOVE_FIRE1 MOVE_FIRE #...
by dom
Thu Jan 25, 2024 8:37 am
Forum: Sinclair ZX
Topic: ZX81 Static Variables
Replies: 7
Views: 513

Re: ZX81 Static Variables

It looks like it's a bit of funky initialisation behaviour - you're initialising an array incorrectly and it's being turned into a pointer. You need the curly braces, however uninitialised global variables end up in bss anyway, so you don't need to initialise them unless you really want the arrays t...