Search found 2563 matches

by dom
Thu Apr 10, 2025 8:44 pm
Forum: Misc
Topic: Linker errors with double functions
Replies: 7
Views: 12467

Re: Linker errors with double functions

If you're using sdcc then you've run into the need to specify printf formatters, add something like: #pragma printf "%d %0.f %s %c" To clock.h and you'll get some numbers printed. See https://github.com/z88dk/z88dk/wiki/Classic--Pragmas#configuring-printf-and-scanf-converters for details I...
by dom
Sun Apr 06, 2025 1:43 pm
Forum: Misc
Topic: Simple text mode on tms9928.
Replies: 4
Views: 3201

Re: Simple text mode on tms9928.

Assuming that the ROM is paged in, then -pragma-export:CRT_FONT=nnnn will use the ROM version.
by dom
Sat Apr 05, 2025 11:41 pm
Forum: Misc
Topic: Simple text mode on tms9928.
Replies: 4
Views: 3201

Re: Simple text mode on tms9928.

Simplest way: --generic-console as the arguments and then <video/tms99x8.h> and call vdp_set_mode(0)

And then remove the code for the other modes with:

; -pragma-define:CLIB_DISABLE_MODE1=1 (also disables mangled mode)
; -pragma-define:CLIB_DISABLE_MODE2=1
; -pragma-define:CLIB_DISABLE_MODE3=1
by dom
Sat Mar 15, 2025 10:38 pm
Forum: Misc
Topic: Using z88dk with assembler projects
Replies: 5
Views: 19040

Re: Using z88dk with assembler projects

Obviously these days I’m a jack-of-all-platforms rather than a specialist but I am initially surprised that MSX style mappers don’t exist on the SVI.
by dom
Fri Mar 14, 2025 9:53 pm
Forum: Misc
Topic: Linker errors with double functions
Replies: 7
Views: 12467

Re: Linker errors with double functions

The good news is that it doesn't occur with a recent nightly - we upgraded sdcc in January.
by dom
Fri Mar 14, 2025 7:32 pm
Forum: Misc
Topic: Linker errors with double functions
Replies: 7
Views: 12467

Re: Linker errors with double functions

The correct maths library needs to be used! -lmath48 instead of -lm - see: https://github.com/z88dk/z88dk/wiki/Cla ... ---lmath48
by dom
Thu Mar 13, 2025 10:02 pm
Forum: Misc
Topic: Using z88dk with assembler projects
Replies: 5
Views: 19040

Re: Using z88dk with assembler projects

I hope I'm answering the right question! For banking we use pretty predictable section names: eg for zx: SECTION BANK_6 org 0x060000 + CRT_ORG_BANK_6 SECTION CODE_6 SECTION RODATA_6 SECTION DATA_6 SECTION BSS_6 SECTION BANK_6_END eg for msx: SECTION BANK_01 org $010000 + CRT_ORG_BANK_01 SECTION CODE...
by dom
Tue Mar 11, 2025 3:02 pm
Forum: Misc
Topic: Using z88dk with assembler projects
Replies: 5
Views: 19040

Using z88dk with assembler projects

It's of course possible to use z88dk to create pure assembler projects optionally picking and choosing which library routines you may want to use. As a simple skeleton, here's something simple for +zx: ; example.asm ; zcc +zx example.asm --no-crt -create-app defc __crt_org_code = 30000 org __crt_org...
by dom
Tue Mar 11, 2025 2:17 pm
Forum: Announcements
Topic: Forum registration
Replies: 8
Views: 69826

Re: Forum registration

Now my travels are over for a while I've re-opened registrations.
by dom
Sat Feb 15, 2025 9:25 am
Forum: Misc
Topic: Understanding sccz80 list files
Replies: 2
Views: 20040

Re: Understanding sccz80 list files

Some things to note: - each sub expression on a line is dumped separately - you’ve spotted that already. - the optimiser may throw away some of the annotations - likewise you’ve seen that. - C_LINE can be extracted from the map file to provide an address to source code line mapping. C_LINE 8,"f...
by dom
Sat Feb 15, 2025 9:16 am
Forum: Misc
Topic: Understanding sccz80 list files
Replies: 2
Views: 20040

Re: Understanding sccz80 list files

All the information you need (and more) is actually in the cdb files. However since you’re working from .lis files that’s not much use! I’m currently semi-afk for the next week (aka I won’t have much time until later this month). But if you can specify the format you want I’ll update sccz80 to match...
by dom
Tue Feb 11, 2025 8:28 am
Forum: Misc
Topic: Appmake and intel hex
Replies: 3
Views: 13589

Re: Appmake and intel hex

Take a look here: https://github.com/z88dk/z88dk/wiki/Classic--Homebrew

There’s an example of your use case and info on how to generate an ihex file in one command.
by dom
Tue Feb 11, 2025 8:20 am
Forum: Misc
Topic: Curiosity Question: .rom vs .bin binaries
Replies: 2
Views: 11891

Re: Curiosity Question: .rom vs .bin binaries

The bin file just contains the code. The rom file also has the data section inserted at the appropriate place.

If you’re not using any statics the difference in file size will be minimal.
by dom
Sat Feb 08, 2025 7:11 pm
Forum: Misc
Topic: Top of the stack
Replies: 4
Views: 11207

Re: Top of the stack

Yes. From memory most of them set sp to an absolute address.
by dom
Sat Feb 08, 2025 5:11 pm
Forum: Misc
Topic: Top of the stack
Replies: 4
Views: 11207

Re: Top of the stack

That symbol is probably the closest you‘ll get IF the stack has been set. The setting of sp is here: https://github.com/z88dk/z88dk/blob/master/lib/crt/classic/crt_init_sp.inc There are ways of walking the frame at runtime using ix eg see cmd_backtrace here: https://github.com/z88dk/z88dk/blob/maste...
by dom
Fri Feb 07, 2025 7:01 pm
Forum: Sinclair ZX
Topic: Can I have multiple sections for C code?
Replies: 13
Views: 29458

Re: Can I have multiple sections for C code?

I think it's easiest if you break it down into multiple questions. 1. Can you have multiple sections for C code. Yes! Just use the pragmas to place things in the section you desire. 2. If you do this, does appmake handle it in one step. No. Appmake doesn't handle it. As noted in the previous thread ...
by dom
Mon Feb 03, 2025 7:15 pm
Forum: MSX, SVI, TMS99x8 and Sega Master System
Topic: [MSX] Back to screen 0
Replies: 2
Views: 22928

Re: [MSX] Back to screen 0

This is probably the easiest way to do it - just do an interslot call to reset back to SCREEN 0. #include <msx.h> #include <stdlib.h> #include <stdio.h> void main() { clg(); vdp_set_mode(mode_2); while (!getk()) { } #asm CALSLT: EQU $001C EXPTBL: EQU $FCC1 ld iy,(EXPTBL-1) ;BIOS slot in iyh ld ix,$0...
by dom
Sun Feb 02, 2025 11:17 am
Forum: Other targets
Topic: Problem using custom console routine
Replies: 4
Views: 35075

Re: Problem using custom console routine

No worries. We’ve all had Heisenbugs!
by dom
Sun Feb 02, 2025 11:15 am
Forum: Misc
Topic: Arithmetics inside constants not working?
Replies: 9
Views: 22901

Re: Arithmetics inside constants not working?

That’s good news!

Sourceforge is just setup as a mirror of GitHub. I’ve just found out that it doesn’t update the “default download” when you do that.

Release versions lag a fair bit (eg there’s been about 1000 changes since 2.3) so taking a nightly build is usually the better option.
by dom
Sat Feb 01, 2025 7:13 pm
Forum: Other targets
Topic: Problem using custom console routine
Replies: 4
Views: 35075

Re: Problem using custom console routine

That bit of code sign extends an 8 bit value to a 16 bit value. I suspect we're missing a couple of diagnostics, but the way I can reproduce what you're seeing is this: extern void jlbputs_cons(char *); int main() { char roms = "/cores"; jlbputs_cons(roms); } Which obviously doesn't match ...
by dom
Sat Feb 01, 2025 7:09 pm
Forum: Misc
Topic: Arithmetics inside constants not working?
Replies: 9
Views: 22901

Re: Arithmetics inside constants not working?

I'll be honest I'm struggling to reproduce this one with 2.3 and later. I've even run the Windows binaries since I think you're on Windows. I do see the same as you when using 2.2. This does actually make sense because there were some fixups in this area just before the release of 2.3. When I say I ...
by dom
Sat Feb 01, 2025 3:50 pm
Forum: Misc
Topic: Arithmetics inside constants not working?
Replies: 9
Views: 22901

Re: Arithmetics inside constants not working?

I can't reproduce this at the moment - what version of z88dk are you using?
by dom
Fri Jan 31, 2025 4:05 pm
Forum: Other targets
Topic: Newb questions for developing OS for new target
Replies: 7
Views: 15404

Re: Newb questions for developing OS for new target

Sorry that's my fault, try this fudge block: // SDCC exporting fudge to handle the double export of library functions #ifdef __SDCC static void fudge_export(void) { __asm PUBLIC fputc_cons_native PUBLIC _fputc_cons_native PUBLIC fgetc_cons PUBLIC _fgetc_cons defc fputc_cons_native = _fputc_cons_nati...
by dom
Fri Jan 24, 2025 6:44 pm
Forum: MSX, SVI, TMS99x8 and Sega Master System
Topic: Only the first argument is parsed in sscanf
Replies: 3
Views: 13835

Re: Only the first argument is parsed in sscanf

Okay, I've pushed a fix for this so it'll be available in the 20250125 nightly.
by dom
Fri Jan 24, 2025 3:53 pm
Forum: MSX, SVI, TMS99x8 and Sega Master System
Topic: Only the first argument is parsed in sscanf
Replies: 3
Views: 13835

Re: Only the first argument is parsed in sscanf

Okay, I understand what's gone wrong here - the handler for %f has modified the register holding the format string. I'll fix it up over the weekend and post back when it's pushed. Thanks for the report.