Search found 301 matches
- Sun Jun 18, 2023 9:48 am
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
I slipped a small mistake in the video: around 13:05 I say that the fastest scrolling routine is the LDDR one, but it is not. The fastest one is the one with the unrolled LDD loop, as it can be correctly seen in the repo code.
- Sat Jun 17, 2023 10:16 pm
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
Following Derek's suggestion, I have prepared a video presentation on these articles. Some SP1 background and detailed explanations on how the examples work are included; they are also shown running:
https://youtu.be/wSUX3YdvARw
The video is ~30 minutes long, you have been warned
https://youtu.be/wSUX3YdvARw
The video is ~30 minutes long, you have been warned
- Mon Jun 12, 2023 10:03 am
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
I'm posting here direct links to the TAP files for easier reference: Test 0 (baseline): TAP file Test 1 (randomtiles): TAP file Test 2 (sprites): TAP file Test 3 (patial-inv-1): TAP file Test 4 (partial-inv-2): TAP file Test 6 (parallax): TAP file Someone has suggested me to make a video showcasing ...
- Mon Jun 12, 2023 7:46 am
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
Updated performance review for a 16x24-cell scrolling zone I have reconfigured all tests to use a 16x24-cell scrolling zone, which is a more realistic size for a scrolling game on the ZX. The results are proportionally similar to the previous ones, but with bigger differences between the baseline m...
- Sun Jun 11, 2023 12:24 pm
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
Performance review of all SP1 scrolling tests In this section I have compiled the performance characteristics for all the previous tests. For this, I have needed to normalize the code so that comparison between measurements are meaninful. I have disabled the regular ROM interrupt processing and act...
- Fri Jun 09, 2023 5:04 pm
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
SP1 scrolling test 5 I have decided not to explore the mentioned Test 5 case (partial column scroll), since again we will have the degenerated case of having to scroll most of the column most of the time, and also the scrolling is not the most time-consuming operation which is being executed. SP1 s...
- Fri Jun 09, 2023 4:20 pm
- Forum: Feature Requests
- Topic: Creating library documentation needs an update
- Replies: 15
- Views: 5233
Re: Creating library documentation needs an update
Try this code: // zcc +zx -vn -c test.c // zcc +zx -vn -c -compiler=sdcc test.c // Then check with: z88dk-z80nm test.o int __LIB__ test_func_lib( void ) { return 3; } int test_func_nolib( void ) { return 3; } The __LIB__ qualifier only works with sccz80, and it makes it generate a stub linker symbol...
- Tue May 30, 2023 5:28 pm
- Forum: Feature Requests
- Topic: Creating library documentation needs an update
- Replies: 15
- Views: 5233
Re: Creating library documentation needs an update
No wrapper. The functions are called vía pointers with arg in HL and the receiving functions just use HL as It comes. I think I checked the generated assembly at the time... I'm declaring the function pointers this way: // Dispatch tables for rule checks and actions typedef uint8_t (*rule_check_fn_...
- Tue May 30, 2023 1:55 pm
- Forum: Feature Requests
- Topic: Creating library documentation needs an update
- Replies: 15
- Views: 5233
Re: Creating library documentation needs an update
No wrapper. The functions are called vía pointers with arg in HL and the receiving functions just use HL as It comes. I think I checked the generated assembly at the time...
- Tue May 30, 2023 8:51 am
- Forum: Feature Requests
- Topic: Creating library documentation needs an update
- Replies: 15
- Views: 5233
Re: Creating library documentation needs an update
Decorated function pointers are "fun", it's true that sccz80 does support fastcall function pointers (though at a bit of register juggling cost - it probably could be done better), though last time I tested sdcc doesn't. Mmm I have been using __z88dk_fastcall function pointers in RAGE1 si...
- Sun May 28, 2023 10:43 am
- Forum: Feature Requests
- Topic: sccz80 allow return 8-bit values in L register
- Replies: 12
- Views: 3625
Re: sccz80 allow return 8-bit values in L register
I think a compiler option to do that for 8-bit returning values could do the trick. Casting works nice and no matter if the functions uses HL or only L for returning values, as the issue is later when the compiled code reads that value. This sounds like you just want the compiler to insert a LD H,0...
- Wed May 24, 2023 9:13 am
- Forum: Feature Requests
- Topic: sccz80 allow return 8-bit values in L register
- Replies: 12
- Views: 3625
Re: sccz80 allow return 8-bit values in L register
Mmmm acording to documentation, the L register is used when returning 8-bit values from functions. And the following code seems to confirm it: // zcc +zx --list --c-code-in-asm main.c -o main -create-app #include <stdint.h> uint8_t return_twice( uint8_t a ) { return a*2; } void main( void ) { uint8_...
- Mon May 15, 2023 9:50 pm
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
SP1 scrolling test 4 It can be found in the src/sp1-partial-inv-2 directory. Based on Test 3, but changing the algorithm which keeps track of the cells to invalidate. Conceptually, this method keeps track of the position of each and every tile which is seen on screen, and periodically adjusts the c...
- Sat May 13, 2023 11:43 am
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
Well, I'm always aiming for generic solutions, but I'm in the middle of explorations right now. So far my next plans/ideas to test are (you have indeed read my mind): A better invalidation algorithm for the scrolling tiles (stay tuned for Test 4, I'm right on it now) Selective scrolling: not the ful...
- Fri May 12, 2023 8:35 pm
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
New stack-based scrolling routine Also in Test 3, a new stack-based scrolling function has been developed and tested. I have found that the regular unrolled LDD version is hard to beat, mainly due to the fact that when moving the bytes, the source and destination ranges mostly overlap, and this mak...
- Fri May 12, 2023 8:33 pm
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
SP1 scrolling test 3 It can be found in the src/sp1-partial-inv-1 directory. Based on Test 2, but this one keeps track of the tiles that are present on each column, and only invalidates the cells that are affected by them. It also keeps track of how the tiles walk down the screen, and propery moves...
- Mon May 08, 2023 2:33 pm
- Forum: CP/M, FLOS and OS related
- Topic: Xerox 820 disk format
- Replies: 20
- Views: 3404
Re: Xerox 820 disk format
I'm always amazed at the density of platform-specific knowledge that is stored in this forum and its users :-)
Surgically exact, pinhead specific knowledge
Surgically exact, pinhead specific knowledge
- Sun May 07, 2023 12:31 pm
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
Ooohhh, I see..... You were referring to initializers that are specified in different order than in the struct... Now I understand.
But my code should have matching order! My OCD was not very alert on that one!
I just fixed it on the sprite example code for you
But my code should have matching order! My OCD was not very alert on that one!
I just fixed it on the sprite example code for you
- Sun May 07, 2023 11:17 am
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
This morning I merged in partial support. Since that bit of the code is a single pass it can’t handle going backwards in the struct. But skipping is supported of course. I figure that covers about 80% of use cases with minimal effort. Your example falls into the 20% unfortunately of course. Sorry, ...
- Sat May 06, 2023 4:13 pm
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
Designated initialisers? Anything else? They've been on my "want-to-do" list for a good few years. Exactly that. :lol: But besides that, everything works fine with both compilers. It's just that designated initializers is one of my programming OCTs... It helps me to not have to go back an...
- Sat May 06, 2023 12:59 pm
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
SP1 scrolling test 2 It can be found in the src/sp1-sprites directory. It's the previous Test 1 real scroller, but this time with sprites running all over the place, while the background is scrolling down. The source is fully parameterized, so that different configurations can be tested and conclus...
- Fri May 05, 2023 9:39 am
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
I just updated all my examples to work with Newlib. SP needs to be put out of SP1 data area when running on Newlib (in Classic, SP is aready set up out of the way).
- Thu May 04, 2023 8:30 am
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
SP1 scrolling test 1 It can be found in the src/sp1-randomtiles directory. This is a real scroller, using the workflow that would be used for a real game: tiles are drawn on some non-visible top rows and are brought into view by the scrolling process. In this example, the logic for printing tiles o...
- Tue May 02, 2023 6:04 pm
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Re: Using SP1 for scroller games
Just to clarify: my scrolling experiments are always pixel scrolling, not character scrolling.
- Tue May 02, 2023 12:25 pm
- Forum: Sinclair ZX
- Topic: Using SP1 for scroller games
- Replies: 46
- Views: 17607
Using SP1 for scroller games
My previous proofs of concept for vertical scrollers on the ZX spectrum were based on double buffering, and the offscreen buffer had a linear memory layout. This layout very much simplifies the scrolling and screen transfer routines, and also the sprite routines (had they been written!). Linear memo...