Search found 60 matches

by Zetr0
Tue Mar 19, 2024 10:54 am
Forum: Sinclair ZX
Topic: Strange Malloc Problem
Replies: 3
Views: 138

Re: Strange Malloc Problem

@dom A huge thanks sir, I do so appreciate the heads up. from my perspective, instead of adding <stdlib.h> to my build and then additionally configuring a pragma - I might as well declare a large 6-8k byte array ( since that's what I am working with ) and store all the graphical data in there. Then ...
by Zetr0
Sat Mar 16, 2024 12:05 pm
Forum: Sinclair ZX
Topic: Strange Malloc Problem
Replies: 3
Views: 138

Strange Malloc Problem

Greetings fellow z88dk'ers Going through tidying up code and ( attempting ) to make it more modular I decided to use memory allocation ( stdlib.h ) function "malloc" to assert structures and sizes as opposed to direct declaration of vectors / structures Imagine my surprise when I was met w...
by Zetr0
Tue Dec 19, 2023 11:46 am
Forum: Sinclair ZX
Topic: Flipping Bytes & Bits!
Replies: 11
Views: 3197

Re: Flipping Bytes & Bits!

Hello my fellow z88dk'ers A big thanks for all the input!! So i have been experimenting with various results - so here are some "solutions" bare with me.... this is a long one ( you have been cautioned ). Preprocessor // typedef typedef unsigned char ubyte; typedef unsigned int uword; so f...
by Zetr0
Tue Dec 05, 2023 3:23 pm
Forum: Other platforms
Topic: Installing z88dk via Snap-Store on Raspberry Pi 32bit Legacy ( Pi 2B+ )
Replies: 2
Views: 4729

Re: Installing z88dk via Snap-Store on Raspberry Pi 32bit Legacy ( Pi 2B+ )

Thanks for the reply DOM, As with all things you truly are a Hero! I started a new Raspbian OS 32bit (legacy) on a uSD card - and installed SNAP / SNAP-STORE, then Fuse and finally I then installed the SNAP store --edge z88dk setup the Assigns as linked in your post, and then the libraries linked in...
by Zetr0
Mon Dec 04, 2023 4:04 pm
Forum: Other platforms
Topic: Installing z88dk via Snap-Store on Raspberry Pi 32bit Legacy ( Pi 2B+ )
Replies: 2
Views: 4729

Installing z88dk via Snap-Store on Raspberry Pi 32bit Legacy ( Pi 2B+ )

Greeting fellow z88dk'ers Yes I know the title reads as though I am somewhat of a masochist, and while this might be true, it does have a reason... I promise... Recently refreshing an old build of my Pi 2B+ - despite all of the SBC's I have this one kinda... well calls me... even if I have a Zero 2 ...
by Zetr0
Fri Dec 01, 2023 5:12 pm
Forum: Sinclair ZX
Topic: Flipping Bytes & Bits!
Replies: 11
Views: 3197

Re: Flipping Bytes & Bits!

I should point out this is based on simple black/white bitmap image data as that's what I am working with...
by Zetr0
Fri Dec 01, 2023 5:09 pm
Forum: Sinclair ZX
Topic: Flipping Bytes & Bits!
Replies: 11
Views: 3197

Re: Flipping Bytes & Bits!

That's really helpful! Thank you stefano! Its given me an idea with a 32 byte index, breaking a byte into nibbles - using the lower nibble ( 0 - 3 = bits 1,2,3,4 ) as the index value... hmm something like this... Nibble X Mirror index flipped value Change State 0000 = 0000 0 0 NC* 0001 = 1000 1 8 +7...
by Zetr0
Fri Dec 01, 2023 3:58 pm
Forum: Sinclair ZX
Topic: Flipping Bytes & Bits!
Replies: 11
Views: 3197

Flipping Bytes & Bits!

Hello there my fellow z88dk'ers I was wondering, after having a look around on the interwebs, on how to horizontally flip a bitmap image so that you get a mirror - now with the oodles of power a PC has this is quite a trivial matter and can easily be brute forced - however implement this ( even for ...
by Zetr0
Sun Feb 05, 2023 11:58 pm
Forum: Sinclair ZX
Topic: +3e DOS File Handling
Replies: 18
Views: 5302

Re: +3e DOS File Handling

dom wrote: Sun Feb 05, 2023 12:06 am I suspect you might be tracking latest/beta rather than latest/edge
LOL, yes that would be me.


Finally got round to installing the latest/edge, and I am happy to say that YES it now functions as expected!!!


Thank you for your invaluable help, Dom!!!
by Zetr0
Sat Feb 04, 2023 11:15 pm
Forum: Sinclair ZX
Topic: +3e DOS File Handling
Replies: 18
Views: 5302

Re: +3e DOS File Handling

Just a silly question,

When, and or does, the nightly build get pushed onto the snap-store?
by Zetr0
Thu Feb 02, 2023 10:11 pm
Forum: Sinclair ZX
Topic: +3e DOS File Handling
Replies: 18
Views: 5302

Re: +3e DOS File Handling

DOM!

You sir are a code-smithing genius!

I will install this a little later.
by Zetr0
Thu Feb 02, 2023 3:46 pm
Forum: Sinclair ZX
Topic: +3e DOS File Handling
Replies: 18
Views: 5302

Re: +3e DOS File Handling

@all I decided to put together a very BASIC File IO and compile it an attempt to run it under v1.43 * Basic IO - testing +3e ROM v1.43 */ // pre-processor typedef unsigned char ubyte; #include <stdio.h> void clearscr( void ); void clearscr( void ) { #asm CALL 0x0DAF ; call ROM routine to clear the s...
by Zetr0
Thu Feb 02, 2023 12:31 pm
Forum: Sinclair ZX
Topic: +3e DOS File Handling
Replies: 18
Views: 5302

Re: +3e DOS File Handling

@stefano This was an error on my part back in 2017 - when I was starting out with +3e DOS / z88dk... I remember back then.... I had the looks... the taste... and the hair..... its been over 5 years since I updated this thread last Wednesday. ;) @dom Hello there, an email is digitizing its way to yo...
by Zetr0
Wed Feb 01, 2023 11:22 pm
Forum: Sinclair ZX
Topic: +3e DOS File Handling
Replies: 18
Views: 5302

Re: +3e DOS File Handling

Ohhh. would you like a copy of the +3e Disk Image ( 64mb ) as well ?

I use this for launching the programs
by Zetr0
Wed Feb 01, 2023 11:19 pm
Forum: Sinclair ZX
Topic: +3e DOS File Handling
Replies: 18
Views: 5302

Re: +3e DOS File Handling

Of course I can, it spans a few files, I can zip it up, how can I send it you?
by Zetr0
Wed Feb 01, 2023 5:01 pm
Forum: Sinclair ZX
Topic: +3e DOS File Handling
Replies: 18
Views: 5302

Re: +3e DOS File Handling

@dom Thanks for looking into this. zxmp.c size of bin file = 23,323 bytes testfio.c size of bin file = 9,238 bytes It would appear that you are ( especially with the blue spiked hair ) a legendary code-smith! zxmp.c when loaded at 32,768 has a codebase spanning an upper address of 56,091 hmmm a buff...
by Zetr0
Wed Feb 01, 2023 2:29 pm
Forum: Sinclair ZX
Topic: +3e DOS File Handling
Replies: 18
Views: 5302

Re: +3e DOS File Handling ( New Problem )

Hello there my fellow z88dk'ers I have quite the conundrum and I hope someone can see what I am obviously missing. Problem: when attempting to open a file for writing, reading or appending, I am met with an error or crash. Compile Line: #!/bin/bash zcc +zx -lp3 -DPLUS3 -lm -create-app zxmp.c > build...
by Zetr0
Mon Dec 19, 2022 1:45 pm
Forum: Sinclair ZX
Topic: Raw Keyboard Input
Replies: 3
Views: 990

Re: Raw Keyboard Input

Just to tidy that code up a bit typedef unsigned char ubyte; ubyte getch( void ); ubyte getch( void ) { ubyte *LASTK = 23560; // ZX Spectrum System Variable Address // fflush last input *LASTK = 0; // wait untill a keypress while( *LASTK == 0 ); // return keypress value return *LASTK; } This code wa...
by Zetr0
Tue Dec 13, 2022 1:46 am
Forum: Sinclair ZX
Topic: Raw Keyboard Input
Replies: 3
Views: 990

Re: Raw Keyboard Input

The value 10 (0x0a) is in fact the value for LF (Linefeed). In the old telex world (and in DOS I might add), CRLF (0x0D followed by 0x0A) was the combo of: - Carriage return - Line Feed HTH, Gerard Thank you Gerard! I suspected that it would be something of this nature, one of the super powers of Z...
by Zetr0
Sun Dec 11, 2022 11:16 pm
Forum: Sinclair ZX
Topic: Raw Keyboard Input
Replies: 3
Views: 990

Raw Keyboard Input

Hello there my fellow z88dk'ers I am hoping that some might know of how I can get a RAW keyboard value from stdin. I have looked about and searched here, as such I have tried a few options - char ch=0; ch = getchar() ch = fgetc() ch = getkey() However each one I use doesn't return the value I expect...
by Zetr0
Wed Nov 09, 2022 6:40 pm
Forum: Sinclair ZX
Topic: printf ( Control Codes )
Replies: 8
Views: 1239

Re: printf ( Control Codes )

My hope is that this thread will explain a little about the print driver, or more so how to use it. With one last hurrah! for( unsigned char i = 0; i < 8; i += 1) { sprintf( str, "Hello World %d\0", i); zx_printf( str, 4, 5+i, zx_colour[ i ], zx_colour[ 7 - i ], 1, 0, 0 ); } https://i.imgu...
by Zetr0
Wed Nov 09, 2022 6:21 pm
Forum: Sinclair ZX
Topic: printf ( Control Codes )
Replies: 8
Views: 1239

Re: printf ( Control Codes )

soo... errr about that shuffle of characters 1 space to the right... thats on me... my bad.... i did that..... I was sending it a value of x = 5 in the functions, and it was 4 in the other one.... soo.... yeah.... totally my fault with that lets have a look - #define cmode64 32 void zx_printf( char ...
by Zetr0
Wed Nov 09, 2022 5:18 pm
Forum: Sinclair ZX
Topic: printf ( Control Codes )
Replies: 8
Views: 1239

Re: printf ( Control Codes ) "update 4"

Well I must admit, I have a sneak suspicion it might be the '\0' terminator at the end of the print_code string. now since we are going to be using it a string we need to know when it ends or printf will likely burn the house down with rage... Hmmm instead of a NULL lets fix the size of the print_co...
by Zetr0
Wed Nov 09, 2022 4:55 pm
Forum: Sinclair ZX
Topic: printf ( Control Codes )
Replies: 8
Views: 1239

Re: printf ( Control Codes ) "update 3"

Making it a function So here is a function void test_printer( char *str, char x, char y, char paper, char ink, char bright, char flash ) { unsigned char print_code[ 14 ]; unsigned char character_mode = 32; // one printf statement to rule them all - so lets make a string of print codes //set position...
by Zetr0
Wed Nov 09, 2022 4:29 pm
Forum: Sinclair ZX
Topic: printf ( Control Codes )
Replies: 8
Views: 1239

Re: printf ( Control Codes ) "update 2"

Colour & Control Codes So moving the above example over to using just using the printf function #include <stdio.h> // printf control characters #define zxp_at 22 #define zxp_paper 17 #define zxp_ink 16 #define zxp_bright 19 #define zxp_flash 18 #define zxp_over 21 #define zxp_inverse 20 #define...