Search found 1927 matches

by alvin
Tue Feb 26, 2019 6:50 am
Forum: Sinclair ZX
Topic: SP1 and complex backgrounds (scr files)
Replies: 7
Views: 7240

But I think instead of going that intermediate step of copying to screen$ and then generating the screen buffer from that, I would store the screen buffer in the correct format and just decompress it directly the screen buffer location.
by alvin
Tue Feb 26, 2019 6:45 am
Forum: Sinclair ZX
Topic: SP1 and complex backgrounds (scr files)
Replies: 7
Views: 7240

If you're paging the top 16k, you definitely have to make sure the code running, the stack and interrupt routines (if ints are enabled) are below 0xc000. By default, z88dk is going to place the stack up there and the suggested sp1 stack location is also up there so you will get a crash if you bank w...
by alvin
Tue Feb 26, 2019 6:38 am
Forum: Sinclair ZX
Topic: SP1 and complex backgrounds (scr files)
Replies: 7
Views: 7240

Thanks, so putTitles do work then? Yes but I think I would use "sp1_IterateUpdateRect(rect,func)" for this instead. If you pass it a rectangle that covers the full screen, this function will visit all the "struct sp1_update" in the screen in left to right, top to bottom order. E...
by alvin
Sat Feb 23, 2019 6:00 pm
Forum: Sinclair ZX
Topic: SP1 and complex backgrounds (scr files)
Replies: 7
Views: 7240

Nirvana is an entirely separate game engine that supports multi-colour graphics. In SP1, the tiles are 16-bit. If you print tiles that are only 8-bit (0-255) then the tile graphics are looked up like usual through the tile array. However, if you print 16-bit values such that the MSB is not 0, then t...
by alvin
Mon Feb 18, 2019 7:16 pm
Forum: Sinclair ZX
Topic: Efficiency of globals vs local variables in ZSDCC
Replies: 2
Views: 3477

SCCZ80 picks up a statement, generates code for it and is done. ZSDCC looks at all the code and decides how to allocate values to registers that persist across statements so that it doesn't have to constantly read/write to memory. For ZSDCC you always want to use locals because then the compiler can...
by alvin
Fri Jan 25, 2019 7:23 am
Forum: Misc
Topic: Plans for next release?
Replies: 3
Views: 3949

Maybe it would be better just to push a successful nightly to sf every night. You might end up with short-lived bugs but I think that's still preferable to ancient tested packages that don't work as expected.
by alvin
Fri Dec 28, 2018 5:31 am
Forum: z88dk-users
Topic: [Z88dk-users] Is either SCCZ80 or ZSDCC single-pass or multi-pass?
Replies: 2
Views: 5247

Is either SCCZ80 or ZSDCC one-pass or multi-pass?
For example, can any ot these compilers efficiently optimize code with GOTO's to a backward label?
I'm pretty sure this makes no difference to zsdcc. It contains GOTO in its intermediate code and uses it for things other than the C statement.
by alvin
Sun Dec 23, 2018 9:05 pm
Forum: z88dk-users
Topic: [Z88dk-users] Global Optimization? Or just per file optimization?
Replies: 1
Views: 4364

Does the optimizer look at each file seperately? Or doing global optimization? In C, each translation unit (file) is consumed independently. The only kind of optimization that could be done across files is link-time optimization and nothing like that is being done now. Within a file, optimization i...
by alvin
Tue Nov 27, 2018 5:41 am
Forum: Misc
Topic: z80asm equ
Replies: 11
Views: 7786

I opened an issue on github:
https://github.com/z88dk/z88dk/issues/1018
by alvin
Tue Nov 27, 2018 5:37 am
Forum: Sinclair ZX
Topic: How to play AY music with z88dk?
Replies: 44
Views: 54093

I'm glad it worked out. SP1 is something I want to come back to to improve, mainly because the zx next makes some of the removed display modes relevant again. At one time it supported the timex hi colour mode and timex hi res mode (actually I think the hi res mode is still there) and at the same tim...
by alvin
Sun Nov 25, 2018 9:11 pm
Forum: Sinclair ZX
Topic: How to play AY music with z88dk?
Replies: 44
Views: 54093

Anyway the changes: 1. vt_sound.lib was modified by zobjcopy to change the code and data sections it uses to BANK_6. There is a readme.txt in the ay directory that shows how it was invoked. It was also used to make some symbols PUBLIC that weren't PUBLIC already. 2. misafu_ay.asm's section changed t...
by alvin
Sun Nov 25, 2018 8:02 pm
Forum: Sinclair ZX
Topic: How to play AY music with z88dk?
Replies: 44
Views: 54093

I'm having trouble applying the patch to your last main commit and I'm not sure if it has to do with the windows version of the patch utility. I'll post the patch and the current source in this zip:

https://drive.google.com/file/d/1NaCxq- ... sp=sharing
by alvin
Sun Nov 25, 2018 7:04 pm
Forum: Sinclair ZX
Topic: How to play AY music with z88dk?
Replies: 44
Views: 54093

I've just made the changes on your current master branch and will describe them here after I've sent a pull request.
by alvin
Tue Nov 20, 2018 5:26 pm
Forum: Sinclair ZX
Topic: How to play AY music with z88dk?
Replies: 44
Views: 54093

The all-ram mode is only available on the +3 which is probably the least common spectrum model so it's better not to use that. Your program's 64k space consists of the bottom 16k rom, then 16k banks 5/2/0. This is the memory configuration spectrum basic runs out of and your program loads into. The 1...
by alvin
Mon Nov 12, 2018 5:54 pm
Forum: Sinclair ZX
Topic: Linking in a low memory data section
Replies: 2
Views: 3556

There's no way to independently set the org address and load address in the tapmaker. But tap files are very simple. You can make your own basic loader in an emulator like this one: 10 CLEAR 24999 20 LOAD ""CODE 30 RANDOMIZE USR 32768 and save it to a tap file with: SAVE "loader"...
by alvin
Thu Nov 08, 2018 6:58 pm
Forum: Sinclair ZX
Topic: Debugging in SP1
Replies: 4
Views: 4663

In your compile line "-startup=31" means you are getting a minimal crt with no streams (no stdout, stdin) so printf and scanf have nothing to connect to. As mentioned you can change your startup to something like "-startup=0" and then you will have stdin,stdout and can printf and...
by alvin
Wed Oct 31, 2018 3:52 am
Forum: Sinclair ZX
Topic: How to play AY music with z88dk?
Replies: 44
Views: 54093

I think I calculate about 4560 bytes required from the add_sprites_for_all_levels() function in defines.c. So there are probably still problems with the compile that runs with stack size 256 bytes. There are a few more things you can do. The clothes sprites, if they are always at the bottom priority...
by alvin
Wed Oct 31, 2018 3:33 am
Forum: Sinclair ZX
Topic: How to play AY music with z88dk?
Replies: 44
Views: 54093

Thanks for the advice, I'll change the code to test for sp1_CreateSpr not returning zero. Adding test code is ok for finding the problem, otherwise it just adds to the code size; you want to make sure the game always has sufficient memory otherwise it can't run anyway, test code or not. 3970 bytes ...
by alvin
Wed Oct 31, 2018 3:14 am
Forum: Sinclair ZX
Topic: How to play AY music with z88dk?
Replies: 44
Views: 54093

The crash branch has about 3970 bytes available for sprites. I tried adding more memory by reducing the expected size of the stack to 256 bytes by adding this pragma to zpragma.inc: #pragma output CRT_STACK_SIZE = 256 The default is 512 bytes reserved for the stack and that's very large. 256 bytes i...
by alvin
Mon Oct 29, 2018 8:00 pm
Forum: Other targets
Topic: Questions on porting to Z80 Membership Card kit
Replies: 1
Views: 2894

1) This page https://www.z88dk.org/wiki/doku.php?id=libnew:target_embedded says the "embedded" target is now renamed "z80", but if I use that target instead, the embedded examples seem to break? I would have to see what your compile line was and what examples you are trying. &qu...
by alvin
Mon Oct 29, 2018 4:56 pm
Forum: Sinclair ZX
Topic: How to play AY music with z88dk?
Replies: 44
Views: 54093

Hi jordi, I downloaded a zip and built the game - it's looking good! It's a little finicky with jumping onto the barrels in the first level; I don't know if that's how the original works or not but if not maybe a little smoothing over there would help :) 2018-10-29 10:06 AM 22,823 misifu_CODE.bin Th...
by alvin
Thu Oct 18, 2018 7:18 am
Forum: MSX, SVI, TMS99x8 and Sega Master System
Topic: Rom of 48Kb for MSX
Replies: 9
Views: 8358

It can be done but I'm not sure how classic is handling org 0 code - it might not so you may have to provide a new crt if so. But otherwise it should be fairly straightforward by setting CRT_ORG_CODE to 0 and CRT_ORG_BSS or CRT_ORG_DATA to the location of your ram. It's fairly late here to delve int...
by alvin
Thu Oct 18, 2018 7:14 am
Forum: Sinclair ZX
Topic: quickly blit a custom 4x6 font character to screen?
Replies: 13
Views: 11535

This bit of code generates word-wrapped strings for output given a pixel width (output_terminal_width). It assumes the current x coord is at the left edge. It's written by Stefan Bylund and I don't think he will mind sharing this small snippet: static type8 *str_word_wrap(type8 *str) { type8 *line; ...
by alvin
Thu Oct 18, 2018 7:09 am
Forum: Sinclair ZX
Topic: quickly blit a custom 4x6 font character to screen?
Replies: 13
Views: 11535

There is a short example here showing use of the fzx structure. The link points at some rectangles used to define the fzx paper.
https://github.com/z88dk/z88dk/blob/mas ... odes.c#L25
by alvin
Thu Oct 18, 2018 7:04 am
Forum: Sinclair ZX
Topic: quickly blit a custom 4x6 font character to screen?
Replies: 13
Views: 11535

There are about 100 fzx fonts you can look at in the library: https://github.com/z88dk/z88dk/tree/master/libsrc/_DEVELOPMENT/font/fzx/fonts The fzx routines are in classic but it looks like the header file was not included. That can be fixed fairly quickly. This is the header file: https://github.co...