Search found 15 matches

by clebin
Mon Dec 19, 2022 4:01 pm
Forum: Feature Requests
Topic: Issues when migrating back to Classic from newlib
Replies: 74
Views: 63806

Re: Issues when migrating back to Classic from newlib

dom wrote: Sun Dec 18, 2022 9:02 pm There's a precanned tick count ISR in the library already:

Code: Select all

add_raster_int(tick_count_isr);
Which mutates the counter long tick_count;
Thanks both! I went with tick_count_isr.
by clebin
Sun Dec 18, 2022 7:56 pm
Forum: Feature Requests
Topic: Issues when migrating back to Classic from newlib
Replies: 74
Views: 63806

Re: Issues when migrating back to Classic from newlib

Also remember to call ROM ISR with IY = $5C3A, ROM expects that value in IY always Thanks jorgegv, that was enough to get me started. I chose to increment it myself: void framecounter() { if (FRAMES + 1 > FRAMES) // check overflow FRAMES++; else FRAMES = 0; } int main() { intrinsic_di(); zx_im2_ini...
by clebin
Sun Dec 18, 2022 12:27 pm
Forum: Feature Requests
Topic: Issues when migrating back to Classic from newlib
Replies: 74
Views: 63806

Re: Issues when migrating back to Classic from newlib

Me again, with a semi-related question... The following bit of code works fine now, but the zx_im2_init() prevents me from being able to use the FRAMES counter. With printf("%d", FRAMES) the number output is always 24 in my case. Without that line, FRAMES counts up as expected. What do I n...
by clebin
Sun Nov 20, 2022 8:48 pm
Forum: Feature Requests
Topic: Issues when migrating back to Classic from newlib
Replies: 74
Views: 63806

Re: Issues when migrating back to Classic from newlib

(I haven't touched sp1 in years now, so I've spent lot of time to just make your code work first -- while not having the php part, and so many different files -- and then I had to compare your code against a working one to see what you were missing. So that took me some hours on a saturday evening....
by clebin
Sun Nov 20, 2022 9:02 am
Forum: Feature Requests
Topic: Issues when migrating back to Classic from newlib
Replies: 74
Views: 63806

Re: Issues when migrating back to Classic from newlib

Woohoo, you star! Thanks Timmy and jorgegv. As I'm using 128k banks I had to move the table further down in memory with zx_im2_init() but I have my cursor sprite at last! It's shown me I've still a lot to learn but one step (and game) at a time...
by clebin
Sat Nov 19, 2022 10:31 pm
Forum: Feature Requests
Topic: Issues when migrating back to Classic from newlib
Replies: 74
Views: 63806

Re: Issues when migrating back to Classic from newlib

This is so weird. Here's a (virtually) empty project with the same sprite disappearing magic trick. Note: I'm compiling on a M1 Mac in case there's some platform specific weirdness.

https://github.com/clebin/spritepocalypse
by clebin
Sat Nov 19, 2022 4:18 pm
Forum: Feature Requests
Topic: Issues when migrating back to Classic from newlib
Replies: 74
Views: 63806

Re: Issues when migrating back to Classic from newlib

Thanks both. That was stupid of me not reducing the heap size there. The thing is, I should be using next to no heap. I also like to reuse and recycle sprites etc as much as possible, creating arrays of the maximum size of anything I'm going to need, so I'm not using malloc anywhere in my own code. ...
by clebin
Fri Nov 18, 2022 9:51 pm
Forum: Feature Requests
Topic: Issues when migrating back to Classic from newlib
Replies: 74
Views: 63806

Re: Issues when migrating back to Classic from newlib

The program is very big now, but I'll try and share the pertinent bits (I can also share the private git repo with you?) The sprite code works ok in newlib and is mostly copied from my previous game, so I'm stumped. =( Initialise sp1: sp1_Initialize( SP1_IFLAG_MAKE_ROTTBL | SP1_IFLAG_OVERWRITE_TILES...
by clebin
Fri Nov 18, 2022 8:40 pm
Forum: Feature Requests
Topic: Issues when migrating back to Classic from newlib
Replies: 74
Views: 63806

Re: Issues when migrating back to Classic from newlib

Thanks again jorgegv! That sort of worked - except it's now doing something very weird that never happened with newlib. Whenever I press a key, any key, my sprite disappears. Even if I put it in a loop with nothing else changing, like this: while (1) { // draw cursor sp1_MoveSprAbs( cursorSp, &f...
by clebin
Fri Nov 18, 2022 6:57 pm
Forum: Feature Requests
Topic: Issues when migrating back to Classic from newlib
Replies: 74
Views: 63806

Re: Issues when migrating back to Classic from newlib

I'm getting the SP1 u_malloc errors on sccz80 - not sure if this was fixed. How do I prevent these? /home/build/z88dk/build/z88dk/libsrc/_DEVELOPMENT/temp/sp1/zx/sprites/asm_sp1_AddColSpr.asm:40: error: undefined symbol: _u_malloc ^---- _u_malloc /home/build/z88dk/build/z88dk/libsrc/_DEVELOPMENT/tem...
by clebin
Tue Nov 15, 2022 9:10 pm
Forum: Sinclair ZX
Topic: Simple tile drawing routines
Replies: 8
Views: 1511

Re: Simple tile drawing routines

I'm doing what you want to do, though (have cut-scenes in banks) and I have done it... without using SP1. I'm using SP1 for the game, but for the cut-scenes I have a dedicated print routine which also lives in the cut-scenes bank, and I use that instead of SP1 for the display. Since the routine is ...
by clebin
Tue Nov 15, 2022 9:22 am
Forum: Sinclair ZX
Topic: Simple tile drawing routines
Replies: 8
Views: 1511

Re: Simple tile drawing routines

Also to avoid filckering you can do what SP1 does: temporarily read the previous screen data into an 8-byte buffer, do your operations with the buffer (masking, ORing, XORing, whatever with your new tile...) and transfer the modified buffer back into the original place on the screen. This way you d...
by clebin
Tue Nov 15, 2022 9:15 am
Forum: Sinclair ZX
Topic: Simple tile drawing routines
Replies: 8
Views: 1511

Re: Simple tile drawing routines

Not the best choice ever, but putsprite does it. To avoid flicker you could add a sync checkpoint e.g. waiting for the timer being updated. Thanks for the tips! putsprite looks like a good solution for the cursor. It needs extra bytes for dimensions and padding so I won't use it for the tiles/blocks.
by clebin
Mon Nov 14, 2022 5:00 pm
Forum: Sinclair ZX
Topic: Simple tile drawing routines
Replies: 8
Views: 1511

Re: Simple tile drawing routines

Thanks very much Timmy. I missed that thread I think because I'm looking at graphics rather than characters, but I'll give your WOS thread & code a good look tonight. Maybe it'll help if I share a bit of code. I have some graphics defined like this with 8-bytes for each tile: ._gameplayGraphics ...
by clebin
Mon Nov 14, 2022 1:53 pm
Forum: Sinclair ZX
Topic: Simple tile drawing routines
Replies: 8
Views: 1511

Simple tile drawing routines

Hello all. I recently started on my second z88dk game. I'm currently using SP1 as before but it's massive overkill for what I need and I need to free up RAM. I'm looking for some simple code block or library I can drop in to save precious RAM. Maybe what I need is built into z88dk already? These are...