Search found 2375 matches
- Mon Mar 04, 2024 9:30 pm
- Forum: CP/M, FLOS and OS related
- Topic: Any type of file IO causes errors with submit.com
- Replies: 2
- Views: 201
Re: Any type of file IO causes errors with submit.com
For archive purposes this one is now fixed. The issue was that we didn't bother to set sp on entry to the program. On CP/M 2.2 this is okay, since sp floats somewhere below the bdos address. However on CP/M 3, sp on entry is some temporary workspace in high memory, so we end up overwriting bits of C...
- Tue Feb 27, 2024 9:32 pm
- Forum: Sinclair ZX
- Topic: Bank 7 corruption while loading in Plus2A mode
- Replies: 7
- Views: 330
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...
- Tue Feb 27, 2024 10:21 am
- Forum: Sinclair ZX
- Topic: Bank 7 corruption while loading in Plus2A mode
- Replies: 7
- Views: 330
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.
Poking iy+1 should skip that check and prevent the corruption.
- Tue Feb 27, 2024 6:42 am
- Forum: Sinclair ZX
- Topic: Bank 7 corruption while loading in Plus2A mode
- Replies: 7
- Views: 330
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?
Does loading in spectrum mode solve it?
- Thu Feb 22, 2024 12:27 pm
- Forum: Sinclair ZX
- Topic: +zx81 Noob Question About Libraries
- Replies: 19
- Views: 2361
Re: +zx81 Noob Question About Libraries
Unfortunately it uses the af' register for add, multiply and polynomial expansion so that's a no.
fix16 looks like it's good though.
- Thu Feb 22, 2024 12:22 pm
- Forum: Misc
- Topic: switch jump table?
- Replies: 6
- Views: 233
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...
- Mon Feb 19, 2024 6:56 pm
- Forum: Sinclair ZX
- Topic: __bss_compiler_head
- Replies: 1
- Views: 152
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 ...
- Mon Feb 19, 2024 6:50 pm
- Forum: Other platforms
- Topic: Nightly build URL not responding!?
- Replies: 6
- Views: 6269
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 ...
- Mon Feb 19, 2024 6:45 pm
- Forum: CP/M, FLOS and OS related
- Topic: Custom CPM target | Z80-Retro!
- Replies: 2
- Views: 162
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...
- Sat Feb 17, 2024 7:45 pm
- Forum: Misc
- Topic: Recommendation for declaring constants
- Replies: 6
- Views: 194
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...
- Fri Feb 16, 2024 8:40 pm
- Forum: Misc
- Topic: Recommendation for declaring constants
- Replies: 6
- Views: 194
Re: Recommendation for declaring constants
My preferred way is #define or enums, but you can achieve what you want this way:
And several permutations of similar ideas.
Code: Select all
extern __at(0x1000) int SCRM_TEXT1;
extern void screenmode(int);
void func()
{
screenmode((int)&SCRM_TEXT1);
}
- Mon Feb 12, 2024 10:13 am
- Forum: Sinclair ZX
- Topic: How to allocate a variable in a specific memory location
- Replies: 12
- Views: 372
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...
- Sun Feb 11, 2024 9:51 am
- Forum: Other targets
- Topic: NABU Computer Support
- Replies: 94
- Views: 557703
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...
- Sat Feb 10, 2024 5:44 pm
- Forum: Other targets
- Topic: NABU Computer Support
- Replies: 94
- Views: 557703
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.
There’s also uint8_t nabu_get_interrupt() which isn’t in the header yet.
- Fri Feb 09, 2024 7:59 pm
- Forum: Sinclair ZX
- Topic: CP/M on the Spectrum: current library status
- Replies: 2
- Views: 205
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...
- Fri Feb 09, 2024 7:18 pm
- Forum: Sinclair ZX
- Topic: How to allocate a variable in a specific memory location
- Replies: 12
- Views: 372
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...
- Wed Feb 07, 2024 10:09 pm
- Forum: Sinclair ZX
- Topic: ZX81 Static Variables
- Replies: 7
- Views: 537
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...
- Wed Feb 07, 2024 8:54 pm
- Forum: Announcements
- Topic: Forum registration
- Replies: 1
- Views: 417
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...
- 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: 335
Re: How to display sprites on colecovision?
There's examples in examples/msx/. ex4, ex6, ex7, ex8, ex9 all use sprites.
- Thu Feb 01, 2024 4:57 pm
- Forum: Sinclair ZX
- Topic: Issues when migrating to classic lib
- Replies: 15
- Views: 671
Re: Issues when migrating to classic lib
So the code for classic should be (removing the noise):
vs the following for newlib:
Code: Select all
ld hl,__malloc_heap
ld bc,__heap_size
call asm_HeapAlloc
Code: Select all
ld hl,__malloc_block
ld bc,__heap_size
call asm_heap_init
- Thu Feb 01, 2024 3:55 pm
- Forum: Sinclair ZX
- Topic: Issues when migrating to classic lib
- Replies: 15
- Views: 671
Re: Issues when migrating to classic lib
I think classic takes the address of a pointer to the heap start.
- Tue Jan 30, 2024 6:18 pm
- Forum: Sinclair ZX
- Topic: Issues when migrating to classic lib
- Replies: 15
- Views: 671
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...
- 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: 435
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...
- Fri Jan 26, 2024 5:08 pm
- Forum: MSX, SVI, TMS99x8 and Sega Master System
- Topic: Complete noob in need of help! (Colecovision programming)
- Replies: 6
- Views: 435
Re: Complete noob in need of help! (Colecovision programming)
The psglib example already shows how to read a joystick, see here: https://github.com/z88dk/z88dk/blob/mas ... main.c#L26
- 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: 435
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 #...